From 2bf7afcf1e6487b531b2cfea03f2c81f03f8819d Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 12:36:41 +0100 Subject: [PATCH 01/52] build: update to php 8.3 --- README.md | 6 +- composer.json | 2 +- composer.lock | 2108 +++++++++++++++++++++++++------------------------ package.json | 3 +- 4 files changed, 1086 insertions(+), 1033 deletions(-) diff --git a/README.md b/README.md index 839a8c0a..2f63fb3c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # DataWiz - Research Data Documentation Assistant ![Symfony Version](https://img.shields.io/badge/Symfony-^6.2-success?logo=symfony&style=flat-square) -![PHP Version](https://img.shields.io/badge/Php-^8.2-informational?logo=PHP&style=flat-square&logoColor=white) -![Composer Version](https://img.shields.io/badge/Composer-^2.0-informational?logo=Composer&style=flat-square&logoColor=white) +![PHP Version](https://img.shields.io/badge/Php-^8.3-informational?logo=PHP&style=flat-square&logoColor=white) +![Composer Version](https://img.shields.io/badge/Composer-^2.7-informational?logo=Composer&style=flat-square&logoColor=white) ![Nodejs Version](https://img.shields.io/badge/Nodejs-18_LTS-informational?logo=node.js&style=flat-square&logoColor=white) -![MySql Version](https://img.shields.io/badge/MySql-8.0-informational?logo=mysql&style=flat-square&logoColor=white) +![MariaDB Version](https://img.shields.io/badge/MariaDB-10.11-informational?logo=mariadb&style=flat-square&logoColor=white) [![DataWiz 2 Build](https://github.com/leibniz-psychology/datawiz2/actions/workflows/wf-main.yml/badge.svg?branch=master)](https://github.com/leibniz-psychology/datawiz2/actions/workflows/wf-main.yml) [![Übersetzungsstatus](http://weblate.zpid.de/widgets/datawiz/-/datawiz-2/svg-badge.svg)](http://weblate.zpid.de/engage/datawiz/) diff --git a/composer.json b/composer.json index 263160ad..ee7ef8d3 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "description": "lorem ipsum", "license": "MIT", "require": { - "php": "^8.2", + "php": "^8.3", "ext-ctype": "*", "ext-iconv": "*", "ext-json": "*", diff --git a/composer.lock b/composer.lock index adfd8861..da74dcef 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bf577350bdddfa43a60f92cc4066ffce", + "content-hash": "47d58333bdd6ed722b870c7b34f0f107", "packages": [ { "name": "composer/package-versions-deprecated", @@ -81,16 +81,16 @@ }, { "name": "dflydev/dot-access-data", - "version": "v3.0.2", + "version": "v3.0.3", "source": { "type": "git", "url": "https://github.com/dflydev/dflydev-dot-access-data.git", - "reference": "f41715465d65213d644d3141a6a93081be5d3549" + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/f41715465d65213d644d3141a6a93081be5d3549", - "reference": "f41715465d65213d644d3141a6a93081be5d3549", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f", "shasum": "" }, "require": { @@ -150,9 +150,9 @@ ], "support": { "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", - "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.2" + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3" }, - "time": "2022-10-27T11:44:00+00:00" + "time": "2024-07-08T12:26:09+00:00" }, { "name": "doctrine/cache", @@ -249,16 +249,16 @@ }, { "name": "doctrine/collections", - "version": "2.1.2", + "version": "2.2.2", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "db8cda536a034337f7dd63febecc713d4957f9ee" + "reference": "d8af7f248c74f195f7347424600fd9e17b57af59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/db8cda536a034337f7dd63febecc713d4957f9ee", - "reference": "db8cda536a034337f7dd63febecc713d4957f9ee", + "url": "https://api.github.com/repos/doctrine/collections/zipball/d8af7f248c74f195f7347424600fd9e17b57af59", + "reference": "d8af7f248c74f195f7347424600fd9e17b57af59", "shasum": "" }, "require": { @@ -266,12 +266,12 @@ "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^10.0", + "doctrine/coding-standard": "^12", "ext-json": "*", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^4.22" + "phpunit/phpunit": "^10.5", + "vimeo/psalm": "^5.11" }, "type": "library", "autoload": { @@ -315,7 +315,7 @@ ], "support": { "issues": "https://github.com/doctrine/collections/issues", - "source": "https://github.com/doctrine/collections/tree/2.1.2" + "source": "https://github.com/doctrine/collections/tree/2.2.2" }, "funding": [ { @@ -331,24 +331,24 @@ "type": "tidelift" } ], - "time": "2022-12-27T23:41:38+00:00" + "time": "2024-04-18T06:56:21+00:00" }, { "name": "doctrine/common", - "version": "3.4.3", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "8b5e5650391f851ed58910b3e3d48a71062eeced" + "reference": "d9ea4a54ca2586db781f0265d36bea731ac66ec5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/8b5e5650391f851ed58910b3e3d48a71062eeced", - "reference": "8b5e5650391f851ed58910b3e3d48a71062eeced", + "url": "https://api.github.com/repos/doctrine/common/zipball/d9ea4a54ca2586db781f0265d36bea731ac66ec5", + "reference": "d9ea4a54ca2586db781f0265d36bea731ac66ec5", "shasum": "" }, "require": { - "doctrine/persistence": "^2.0 || ^3.0", + "doctrine/persistence": "^2.0 || ^3.0 || ^4.0", "php": "^7.1 || ^8.0" }, "require-dev": { @@ -406,7 +406,7 @@ ], "support": { "issues": "https://github.com/doctrine/common/issues", - "source": "https://github.com/doctrine/common/tree/3.4.3" + "source": "https://github.com/doctrine/common/tree/3.5.0" }, "funding": [ { @@ -422,20 +422,20 @@ "type": "tidelift" } ], - "time": "2022-10-09T11:47:59+00:00" + "time": "2025-01-01T22:12:03+00:00" }, { "name": "doctrine/dbal", - "version": "3.6.4", + "version": "3.9.4", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "19f0dec95edd6a3c3c5ff1d188ea94c6b7fc903f" + "reference": "ec16c82f20be1a7224e65ac67144a29199f87959" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/19f0dec95edd6a3c3c5ff1d188ea94c6b7fc903f", - "reference": "19f0dec95edd6a3c3c5ff1d188ea94c6b7fc903f", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/ec16c82f20be1a7224e65ac67144a29199f87959", + "reference": "ec16c82f20be1a7224e65ac67144a29199f87959", "shasum": "" }, "require": { @@ -450,15 +450,14 @@ "require-dev": { "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", - "jetbrains/phpstorm-stubs": "2022.3", - "phpstan/phpstan": "1.10.14", - "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "9.6.7", - "psalm/plugin-phpunit": "0.18.4", - "squizlabs/php_codesniffer": "3.7.2", - "symfony/cache": "^5.4|^6.0", - "symfony/console": "^4.4|^5.4|^6.0", - "vimeo/psalm": "4.30.0" + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "2.1.1", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "9.6.22", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.10.2", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/console": "^4.4|^5.4|^6.0|^7.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -518,7 +517,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.6.4" + "source": "https://github.com/doctrine/dbal/tree/3.9.4" }, "funding": [ { @@ -534,33 +533,31 @@ "type": "tidelift" } ], - "time": "2023-06-15T07:40:12+00:00" + "time": "2025-01-16T08:28:55+00:00" }, { "name": "doctrine/deprecations", - "version": "v1.1.1", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", - "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -568,7 +565,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -579,64 +576,68 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2023-06-03T09:27:29+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/doctrine-bundle", - "version": "2.10.1", + "version": "2.13.2", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineBundle.git", - "reference": "f9d59c90b6f525dfc2a2064a695cb56e0ab40311" + "reference": "2363c43d9815a11657e452625cd64172d5587486" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/f9d59c90b6f525dfc2a2064a695cb56e0ab40311", - "reference": "f9d59c90b6f525dfc2a2064a695cb56e0ab40311", + "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/2363c43d9815a11657e452625cd64172d5587486", + "reference": "2363c43d9815a11657e452625cd64172d5587486", "shasum": "" }, "require": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/dbal": "^3.6.0", + "doctrine/dbal": "^3.7.0 || ^4.0", "doctrine/persistence": "^2.2 || ^3", "doctrine/sql-formatter": "^1.0.1", "php": "^7.4 || ^8.0", - "symfony/cache": "^5.4 || ^6.0", - "symfony/config": "^5.4 || ^6.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/dependency-injection": "^5.4 || ^6.0", + "symfony/cache": "^5.4 || ^6.0 || ^7.0", + "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/deprecation-contracts": "^2.1 || ^3", - "symfony/doctrine-bridge": "^5.4.19 || ^6.0.7", - "symfony/framework-bundle": "^5.4 || ^6.0", + "symfony/doctrine-bridge": "^5.4.46 || ~6.3.12 || ^6.4.3 || ^7.0.3", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-php80": "^1.15", "symfony/service-contracts": "^1.1.1 || ^2.0 || ^3" }, "conflict": { "doctrine/annotations": ">=3.0", - "doctrine/orm": "<2.11 || >=3.0", + "doctrine/orm": "<2.17 || >=4.0", "twig/twig": "<1.34 || >=2.0 <2.4" }, "require-dev": { "doctrine/annotations": "^1 || ^2", - "doctrine/coding-standard": "^9.0", + "doctrine/coding-standard": "^12", "doctrine/deprecations": "^1.0", - "doctrine/orm": "^2.11 || ^3.0", + "doctrine/orm": "^2.17 || ^3.0", "friendsofphp/proxy-manager-lts": "^1.0", - "phpunit/phpunit": "^9.5.26 || ^10.0", - "psalm/plugin-phpunit": "^0.18.4", - "psalm/plugin-symfony": "^4", + "phpstan/phpstan": "2.1.1", + "phpstan/phpstan-phpunit": "2.0.3", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^9.5.26", "psr/log": "^1.1.4 || ^2.0 || ^3.0", - "symfony/phpunit-bridge": "^6.1", - "symfony/property-info": "^5.4 || ^6.0", + "symfony/phpunit-bridge": "^6.1 || ^7.0", + "symfony/property-info": "^5.4 || ^6.0 || ^7.0", "symfony/proxy-manager-bridge": "^5.4 || ^6.0", - "symfony/security-bundle": "^5.4 || ^6.0", - "symfony/twig-bridge": "^5.4 || ^6.0", - "symfony/validator": "^5.4 || ^6.0", - "symfony/web-profiler-bundle": "^5.4 || ^6.0", - "symfony/yaml": "^5.4 || ^6.0", - "twig/twig": "^1.34 || ^2.12 || ^3.0", - "vimeo/psalm": "^4.30" + "symfony/security-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0", + "symfony/string": "^5.4 || ^6.0 || ^7.0", + "symfony/twig-bridge": "^5.4 || ^6.0 || ^7.0", + "symfony/validator": "^5.4 || ^6.0 || ^7.0", + "symfony/var-exporter": "^5.4 || ^6.2 || ^7.0", + "symfony/web-profiler-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0", + "twig/twig": "^1.34 || ^2.12 || ^3.0" }, "suggest": { "doctrine/orm": "The Doctrine ORM integration is optional in the bundle.", @@ -646,7 +647,7 @@ "type": "symfony-bundle", "autoload": { "psr-4": { - "Doctrine\\Bundle\\DoctrineBundle\\": "" + "Doctrine\\Bundle\\DoctrineBundle\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -681,7 +682,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineBundle/issues", - "source": "https://github.com/doctrine/DoctrineBundle/tree/2.10.1" + "source": "https://github.com/doctrine/DoctrineBundle/tree/2.13.2" }, "funding": [ { @@ -697,47 +698,48 @@ "type": "tidelift" } ], - "time": "2023-06-28T07:47:41+00:00" + "time": "2025-01-15T11:12:38+00:00" }, { "name": "doctrine/doctrine-migrations-bundle", - "version": "3.2.4", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineMigrationsBundle.git", - "reference": "94e6b0fe1a50901d52f59dbb9b4b0737718b2c1e" + "reference": "a5c5fe0d2c6b911c03555046febb05a05a347078" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/94e6b0fe1a50901d52f59dbb9b4b0737718b2c1e", - "reference": "94e6b0fe1a50901d52f59dbb9b4b0737718b2c1e", + "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/a5c5fe0d2c6b911c03555046febb05a05a347078", + "reference": "a5c5fe0d2c6b911c03555046febb05a05a347078", "shasum": "" }, "require": { - "doctrine/doctrine-bundle": "~1.0|~2.0", + "doctrine/doctrine-bundle": "^2.4", "doctrine/migrations": "^3.2", - "php": "^7.2|^8.0", - "symfony/framework-bundle": "~3.4|~4.0|~5.0|~6.0" + "php": "^7.2 || ^8.0", + "symfony/deprecation-contracts": "^2.1 || ^3", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "doctrine/orm": "^2.6", - "doctrine/persistence": "^1.3||^2.0", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-phpunit": "^1", - "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8.5|^9.5", - "vimeo/psalm": "^4.22" + "composer/semver": "^3.0", + "doctrine/coding-standard": "^12", + "doctrine/orm": "^2.6 || ^3", + "doctrine/persistence": "^2.0 || ^3", + "phpstan/phpstan": "^1.4 || ^2", + "phpstan/phpstan-deprecation-rules": "^1 || ^2", + "phpstan/phpstan-phpunit": "^1 || ^2", + "phpstan/phpstan-strict-rules": "^1.1 || ^2", + "phpstan/phpstan-symfony": "^1.3 || ^2", + "phpunit/phpunit": "^8.5 || ^9.5", + "symfony/phpunit-bridge": "^6.3 || ^7", + "symfony/var-exporter": "^5.4 || ^6 || ^7" }, "type": "symfony-bundle", "autoload": { "psr-4": { - "Doctrine\\Bundle\\MigrationsBundle\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Doctrine\\Bundle\\MigrationsBundle\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -766,7 +768,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineMigrationsBundle/issues", - "source": "https://github.com/doctrine/DoctrineMigrationsBundle/tree/3.2.4" + "source": "https://github.com/doctrine/DoctrineMigrationsBundle/tree/3.4.0" }, "funding": [ { @@ -782,20 +784,20 @@ "type": "tidelift" } ], - "time": "2023-06-02T08:19:26+00:00" + "time": "2025-01-16T20:28:10+00:00" }, { "name": "doctrine/event-manager", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/event-manager.git", - "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32" + "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/750671534e0241a7c50ea5b43f67e23eb5c96f32", - "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/b680156fa328f1dfd874fd48c7026c41570b9c6e", + "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e", "shasum": "" }, "require": { @@ -805,10 +807,10 @@ "doctrine/common": "<2.9" }, "require-dev": { - "doctrine/coding-standard": "^10", + "doctrine/coding-standard": "^12", "phpstan/phpstan": "^1.8.8", - "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^4.28" + "phpunit/phpunit": "^10.5", + "vimeo/psalm": "^5.24" }, "type": "library", "autoload": { @@ -857,7 +859,7 @@ ], "support": { "issues": "https://github.com/doctrine/event-manager/issues", - "source": "https://github.com/doctrine/event-manager/tree/2.0.0" + "source": "https://github.com/doctrine/event-manager/tree/2.0.1" }, "funding": [ { @@ -873,20 +875,20 @@ "type": "tidelift" } ], - "time": "2022-10-12T20:59:15+00:00" + "time": "2024-05-22T20:47:39+00:00" }, { "name": "doctrine/inflector", - "version": "2.0.8", + "version": "2.0.10", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff" + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/f9301a5b2fb1216b2b08f02ba04dc45423db6bff", - "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", "shasum": "" }, "require": { @@ -948,7 +950,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.8" + "source": "https://github.com/doctrine/inflector/tree/2.0.10" }, "funding": [ { @@ -964,7 +966,7 @@ "type": "tidelift" } ], - "time": "2023-06-16T13:40:37+00:00" + "time": "2024-02-18T20:23:39+00:00" }, { "name": "doctrine/instantiator", @@ -1038,28 +1040,27 @@ }, { "name": "doctrine/lexer", - "version": "2.1.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124" + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", "shasum": "" }, "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^4.11 || ^5.0" + "vimeo/psalm": "^5.21" }, "type": "library", "autoload": { @@ -1096,7 +1097,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/2.1.0" + "source": "https://github.com/doctrine/lexer/tree/3.0.1" }, "funding": [ { @@ -1112,51 +1113,52 @@ "type": "tidelift" } ], - "time": "2022-12-14T08:49:07+00:00" + "time": "2024-02-05T11:56:58+00:00" }, { "name": "doctrine/migrations", - "version": "3.6.0", + "version": "3.8.2", "source": { "type": "git", "url": "https://github.com/doctrine/migrations.git", - "reference": "e542ad8bcd606d7a18d0875babb8a6d963c9c059" + "reference": "5007eb1168691225ac305fe16856755c20860842" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/migrations/zipball/e542ad8bcd606d7a18d0875babb8a6d963c9c059", - "reference": "e542ad8bcd606d7a18d0875babb8a6d963c9c059", + "url": "https://api.github.com/repos/doctrine/migrations/zipball/5007eb1168691225ac305fe16856755c20860842", + "reference": "5007eb1168691225ac305fe16856755c20860842", "shasum": "" }, "require": { "composer-runtime-api": "^2", - "doctrine/dbal": "^3.5.1", + "doctrine/dbal": "^3.6 || ^4", "doctrine/deprecations": "^0.5.3 || ^1", "doctrine/event-manager": "^1.2 || ^2.0", "php": "^8.1", "psr/log": "^1.1.3 || ^2 || ^3", - "symfony/console": "^4.4.16 || ^5.4 || ^6.0", - "symfony/stopwatch": "^4.4 || ^5.4 || ^6.0", - "symfony/var-exporter": "^6.2" + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0", + "symfony/var-exporter": "^6.2 || ^7.0" }, "conflict": { - "doctrine/orm": "<2.12" + "doctrine/orm": "<2.12 || >=4" }, "require-dev": { - "doctrine/coding-standard": "^9", - "doctrine/orm": "^2.13", + "doctrine/coding-standard": "^12", + "doctrine/orm": "^2.13 || ^3", "doctrine/persistence": "^2 || ^3", "doctrine/sql-formatter": "^1.0", "ext-pdo_sqlite": "*", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.1", - "phpstan/phpstan-symfony": "^1.1", - "phpunit/phpunit": "^9.5.24", - "symfony/cache": "^4.4 || ^5.4 || ^6.0", - "symfony/process": "^4.4 || ^5.4 || ^6.0", - "symfony/yaml": "^4.4 || ^5.4 || ^6.0" + "fig/log-test": "^1", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpstan/phpstan-strict-rules": "^1.4", + "phpstan/phpstan-symfony": "^1.3", + "phpunit/phpunit": "^10.3", + "symfony/cache": "^5.4 || ^6.0 || ^7.0", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "suggest": { "doctrine/sql-formatter": "Allows to generate formatted SQL with the diff command.", @@ -1168,7 +1170,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Migrations\\": "lib/Doctrine/Migrations" + "Doctrine\\Migrations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1198,7 +1200,7 @@ ], "support": { "issues": "https://github.com/doctrine/migrations/issues", - "source": "https://github.com/doctrine/migrations/tree/3.6.0" + "source": "https://github.com/doctrine/migrations/tree/3.8.2" }, "funding": [ { @@ -1214,20 +1216,20 @@ "type": "tidelift" } ], - "time": "2023-02-15T18:49:46+00:00" + "time": "2024-10-10T21:35:27+00:00" }, { "name": "doctrine/orm", - "version": "2.15.3", + "version": "2.20.1", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "4c3bd208018c26498e5f682aaad45fa00ea307d5" + "reference": "e3cabade99ebccc6ba078884c1c5f250866a494e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/4c3bd208018c26498e5f682aaad45fa00ea307d5", - "reference": "4c3bd208018c26498e5f682aaad45fa00ea307d5", + "url": "https://api.github.com/repos/doctrine/orm/zipball/e3cabade99ebccc6ba078884c1c5f250866a494e", + "reference": "e3cabade99ebccc6ba078884c1c5f250866a494e", "shasum": "" }, "require": { @@ -1240,12 +1242,12 @@ "doctrine/event-manager": "^1.2 || ^2", "doctrine/inflector": "^1.4 || ^2.0", "doctrine/instantiator": "^1.3 || ^2", - "doctrine/lexer": "^2", + "doctrine/lexer": "^2 || ^3", "doctrine/persistence": "^2.4 || ^3", "ext-ctype": "*", "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3", - "symfony/console": "^4.2 || ^5.0 || ^6.0", + "symfony/console": "^4.2 || ^5.0 || ^6.0 || ^7.0", "symfony/polyfill-php72": "^1.23", "symfony/polyfill-php80": "^1.16" }, @@ -1256,14 +1258,15 @@ "doctrine/annotations": "^1.13 || ^2", "doctrine/coding-standard": "^9.0.2 || ^12.0", "phpbench/phpbench": "^0.16.10 || ^1.0", - "phpstan/phpstan": "~1.4.10 || 1.10.18", + "phpstan/extension-installer": "~1.1.0 || ^1.4", + "phpstan/phpstan": "~1.4.10 || 2.0.3", + "phpstan/phpstan-deprecation-rules": "^1 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", "psr/log": "^1 || ^2 || ^3", "squizlabs/php_codesniffer": "3.7.2", - "symfony/cache": "^4.4 || ^5.4 || ^6.0", - "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2", - "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0", - "vimeo/psalm": "4.30.0 || 5.12.0" + "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7.0", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2 || ^7.0", + "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "ext-dom": "Provides support for XSD validation for XML mapping files", @@ -1276,7 +1279,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\ORM\\": "lib/Doctrine/ORM" + "Doctrine\\ORM\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1313,22 +1316,22 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.15.3" + "source": "https://github.com/doctrine/orm/tree/2.20.1" }, - "time": "2023-06-22T12:36:06+00:00" + "time": "2024-12-19T06:48:36+00:00" }, { "name": "doctrine/persistence", - "version": "3.2.0", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/persistence.git", - "reference": "63fee8c33bef740db6730eb2a750cd3da6495603" + "reference": "0ea965320cec355dba75031c1b23d4c78362e3ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/63fee8c33bef740db6730eb2a750cd3da6495603", - "reference": "63fee8c33bef740db6730eb2a750cd3da6495603", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/0ea965320cec355dba75031c1b23d4c78362e3ff", + "reference": "0ea965320cec355dba75031c1b23d4c78362e3ff", "shasum": "" }, "require": { @@ -1340,15 +1343,13 @@ "doctrine/common": "<2.10" }, "require-dev": { - "composer/package-versions-deprecated": "^1.11", - "doctrine/coding-standard": "^11", + "doctrine/coding-standard": "^12", "doctrine/common": "^3.0", - "phpstan/phpstan": "1.9.4", + "phpstan/phpstan": "1.12.7", "phpstan/phpstan-phpunit": "^1", "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6.0", - "vimeo/psalm": "4.30.0 || 5.3.0" + "phpunit/phpunit": "^8.5.38 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6.0 || ^7.0" }, "type": "library", "autoload": { @@ -1397,7 +1398,7 @@ ], "support": { "issues": "https://github.com/doctrine/persistence/issues", - "source": "https://github.com/doctrine/persistence/tree/3.2.0" + "source": "https://github.com/doctrine/persistence/tree/3.4.0" }, "funding": [ { @@ -1413,27 +1414,31 @@ "type": "tidelift" } ], - "time": "2023-05-17T18:32:04+00:00" + "time": "2024-10-30T19:48:12+00:00" }, { "name": "doctrine/sql-formatter", - "version": "1.1.3", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/doctrine/sql-formatter.git", - "reference": "25a06c7bf4c6b8218f47928654252863ffc890a5" + "reference": "b784cbde727cf806721451dde40eff4fec3bbe86" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/sql-formatter/zipball/25a06c7bf4c6b8218f47928654252863ffc890a5", - "reference": "25a06c7bf4c6b8218f47928654252863ffc890a5", + "url": "https://api.github.com/repos/doctrine/sql-formatter/zipball/b784cbde727cf806721451dde40eff4fec3bbe86", + "reference": "b784cbde727cf806721451dde40eff4fec3bbe86", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4" + "doctrine/coding-standard": "^12", + "ergebnis/phpunit-slow-test-detector": "^2.14", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", + "vimeo/psalm": "^5.24" }, "bin": [ "bin/sql-formatter" @@ -1463,32 +1468,32 @@ ], "support": { "issues": "https://github.com/doctrine/sql-formatter/issues", - "source": "https://github.com/doctrine/sql-formatter/tree/1.1.3" + "source": "https://github.com/doctrine/sql-formatter/tree/1.5.1" }, - "time": "2022-05-23T21:33:49+00:00" + "time": "2024-10-21T18:21:57+00:00" }, { "name": "firebase/php-jwt", - "version": "v6.8.0", + "version": "v6.10.2", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "48b0210c51718d682e53210c24d25c5a10a2299b" + "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/48b0210c51718d682e53210c24d25c5a10a2299b", - "reference": "48b0210c51718d682e53210c24d25c5a10a2299b", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/30c19ed0f3264cb660ea496895cfb6ef7ee3653b", + "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b", "shasum": "" }, "require": { - "php": "^7.4||^8.0" + "php": "^8.0" }, "require-dev": { - "guzzlehttp/guzzle": "^6.5||^7.4", + "guzzlehttp/guzzle": "^7.4", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.5", - "psr/cache": "^1.0||^2.0", + "psr/cache": "^2.0||^3.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0" }, @@ -1526,28 +1531,28 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.8.0" + "source": "https://github.com/firebase/php-jwt/tree/v6.10.2" }, - "time": "2023-06-20T16:45:35+00:00" + "time": "2024-11-24T11:22:49+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.7.0", + "version": "7.9.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5" + "reference": "d281ed313b989f213357e3be1a179f02196ac99b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0", - "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -1556,11 +1561,11 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", + "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "guzzle/client-integration-tests": "3.0.2", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -1638,7 +1643,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.7.0" + "source": "https://github.com/guzzle/guzzle/tree/7.9.2" }, "funding": [ { @@ -1654,28 +1659,28 @@ "type": "tidelift" } ], - "time": "2023-05-21T14:04:53+00:00" + "time": "2024-07-24T11:22:20+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.0", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6" + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", "extra": { @@ -1721,7 +1726,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.0" + "source": "https://github.com/guzzle/promises/tree/2.0.4" }, "funding": [ { @@ -1737,20 +1742,20 @@ "type": "tidelift" } ], - "time": "2023-05-21T13:50:22+00:00" + "time": "2024-10-17T10:06:22+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.5.0", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6" + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "shasum": "" }, "require": { @@ -1764,9 +1769,9 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -1837,7 +1842,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.5.0" + "source": "https://github.com/guzzle/psr7/tree/2.7.0" }, "funding": [ { @@ -1853,36 +1858,35 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:11:26+00:00" + "time": "2024-07-18T11:15:46+00:00" }, { "name": "knpuniversity/oauth2-client-bundle", - "version": "v2.15.0", + "version": "v2.18.3", "source": { "type": "git", "url": "https://github.com/knpuniversity/oauth2-client-bundle.git", - "reference": "9df0736d02eb20b953ec8e9986743611747d9ed9" + "reference": "c38ca88a70aae3694ca346a41b13b9a8f6e33ed4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/knpuniversity/oauth2-client-bundle/zipball/9df0736d02eb20b953ec8e9986743611747d9ed9", - "reference": "9df0736d02eb20b953ec8e9986743611747d9ed9", + "url": "https://api.github.com/repos/knpuniversity/oauth2-client-bundle/zipball/c38ca88a70aae3694ca346a41b13b9a8f6e33ed4", + "reference": "c38ca88a70aae3694ca346a41b13b9a8f6e33ed4", "shasum": "" }, "require": { "league/oauth2-client": "^2.0", - "php": ">=7.4", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/framework-bundle": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/routing": "^4.4|^5.0|^6.0" + "php": ">=8.1", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0" }, "require-dev": { "league/oauth2-facebook": "^1.1|^2.0", - "phpstan/phpstan": "^0.12", - "symfony/phpunit-bridge": "^5.3.1|^6.0", - "symfony/security-guard": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0" + "symfony/phpunit-bridge": "^5.4|^6.0|^7.0", + "symfony/security-guard": "^5.4", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "suggest": { "symfony/security-guard": "For integration with Symfony's Guard Security layer" @@ -1911,22 +1915,22 @@ ], "support": { "issues": "https://github.com/knpuniversity/oauth2-client-bundle/issues", - "source": "https://github.com/knpuniversity/oauth2-client-bundle/tree/v2.15.0" + "source": "https://github.com/knpuniversity/oauth2-client-bundle/tree/v2.18.3" }, - "time": "2023-05-03T16:44:38+00:00" + "time": "2024-10-02T14:26:09+00:00" }, { "name": "league/commonmark", - "version": "2.4.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048" + "reference": "d990688c91cedfb69753ffc2512727ec646df2ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d44a24690f16b8c1808bf13b1bd54ae4c63ea048", - "reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d990688c91cedfb69753ffc2512727ec646df2ad", + "reference": "d990688c91cedfb69753ffc2512727ec646df2ad", "shasum": "" }, "require": { @@ -1939,8 +1943,8 @@ }, "require-dev": { "cebe/markdown": "^1.0", - "commonmark/cmark": "0.30.0", - "commonmark/commonmark.js": "0.30.0", + "commonmark/cmark": "0.31.1", + "commonmark/commonmark.js": "0.31.1", "composer/package-versions-deprecated": "^1.8", "embed/embed": "^4.4", "erusev/parsedown": "^1.0", @@ -1949,10 +1953,11 @@ "michelf/php-markdown": "^1.4 || ^2.0", "nyholm/psr7": "^1.5", "phpstan/phpstan": "^1.8.2", - "phpunit/phpunit": "^9.5.21", + "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0", "scrutinizer/ocular": "^1.8.1", - "symfony/finder": "^5.3 | ^6.0", - "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0", + "symfony/finder": "^5.3 | ^6.0 | ^7.0", + "symfony/process": "^5.4 | ^6.0 | ^7.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0", "unleashedtech/php-coding-standard": "^3.1.1", "vimeo/psalm": "^4.24.0 || ^5.0.0" }, @@ -1962,7 +1967,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "2.7-dev" } }, "autoload": { @@ -2019,7 +2024,7 @@ "type": "tidelift" } ], - "time": "2023-03-24T15:16:10+00:00" + "time": "2024-12-29T14:10:59+00:00" }, { "name": "league/config", @@ -2105,38 +2110,38 @@ }, { "name": "league/csv", - "version": "9.9.0", + "version": "9.21.0", "source": { "type": "git", "url": "https://github.com/thephpleague/csv.git", - "reference": "b4418ede47fbd88facc34e40a16c8ce9153b961b" + "reference": "72196d11ebba22d868954cb39c0c7346207430cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/csv/zipball/b4418ede47fbd88facc34e40a16c8ce9153b961b", - "reference": "b4418ede47fbd88facc34e40a16c8ce9153b961b", + "url": "https://api.github.com/repos/thephpleague/csv/zipball/72196d11ebba22d868954cb39c0c7346207430cc", + "reference": "72196d11ebba22d868954cb39c0c7346207430cc", "shasum": "" }, "require": { - "ext-json": "*", - "ext-mbstring": "*", + "ext-filter": "*", "php": "^8.1.2" }, "require-dev": { - "doctrine/collections": "^2.1.2", "ext-dom": "*", "ext-xdebug": "*", - "friendsofphp/php-cs-fixer": "^v3.14.3", - "phpbench/phpbench": "^1.2.8", - "phpstan/phpstan": "^1.10.4", - "phpstan/phpstan-deprecation-rules": "^1.1.2", - "phpstan/phpstan-phpunit": "^1.3.10", - "phpstan/phpstan-strict-rules": "^1.5.0", - "phpunit/phpunit": "^10.0.14" + "friendsofphp/php-cs-fixer": "^3.64.0", + "phpbench/phpbench": "^1.3.1", + "phpstan/phpstan": "^1.12.11", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.1", + "phpstan/phpstan-strict-rules": "^1.6.1", + "phpunit/phpunit": "^10.5.16 || ^11.4.3", + "symfony/var-dumper": "^6.4.8 || ^7.1.8" }, "suggest": { "ext-dom": "Required to use the XMLConverter and the HTMLConverter classes", - "ext-iconv": "Needed to ease transcoding CSV using iconv stream filters" + "ext-iconv": "Needed to ease transcoding CSV using iconv stream filters", + "ext-mbstring": "Needed to ease transcoding CSV using mb stream filters" }, "type": "library", "extra": { @@ -2149,7 +2154,7 @@ "src/functions_include.php" ], "psr-4": { - "League\\Csv\\": "src" + "League\\Csv\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2188,20 +2193,20 @@ "type": "github" } ], - "time": "2023-03-11T15:57:12+00:00" + "time": "2025-01-08T19:27:58+00:00" }, { "name": "league/flysystem", - "version": "3.15.1", + "version": "3.29.1", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "a141d430414fcb8bf797a18716b09f759a385bed" + "reference": "edc1bb7c86fab0776c3287dbd19b5fa278347319" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a141d430414fcb8bf797a18716b09f759a385bed", - "reference": "a141d430414fcb8bf797a18716b09f759a385bed", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/edc1bb7c86fab0776c3287dbd19b5fa278347319", + "reference": "edc1bb7c86fab0776c3287dbd19b5fa278347319", "shasum": "" }, "require": { @@ -2210,6 +2215,8 @@ "php": "^8.0.2" }, "conflict": { + "async-aws/core": "<1.19.0", + "async-aws/s3": "<1.14.0", "aws/aws-sdk-php": "3.209.31 || 3.210.0", "guzzlehttp/guzzle": "<7.0", "guzzlehttp/ringphp": "<1.1.1", @@ -2217,20 +2224,23 @@ "symfony/http-client": "<5.2" }, "require-dev": { - "async-aws/s3": "^1.5", - "async-aws/simple-s3": "^1.1", - "aws/aws-sdk-php": "^3.220.0", + "async-aws/s3": "^1.5 || ^2.0", + "async-aws/simple-s3": "^1.1 || ^2.0", + "aws/aws-sdk-php": "^3.295.10", "composer/semver": "^3.0", "ext-fileinfo": "*", "ext-ftp": "*", + "ext-mongodb": "^1.3", "ext-zip": "*", "friendsofphp/php-cs-fixer": "^3.5", "google/cloud-storage": "^1.23", + "guzzlehttp/psr7": "^2.6", "microsoft/azure-storage-blob": "^1.1", - "phpseclib/phpseclib": "^3.0.14", - "phpstan/phpstan": "^0.12.26", - "phpunit/phpunit": "^9.5.11", - "sabre/dav": "^4.3.1" + "mongodb/mongodb": "^1.2", + "phpseclib/phpseclib": "^3.0.36", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.11|^10.0", + "sabre/dav": "^4.6.0" }, "type": "library", "autoload": { @@ -2264,32 +2274,22 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.15.1" + "source": "https://github.com/thephpleague/flysystem/tree/3.29.1" }, - "funding": [ - { - "url": "https://ecologi.com/frankdejonge", - "type": "custom" - }, - { - "url": "https://github.com/frankdejonge", - "type": "github" - } - ], - "time": "2023-05-04T09:04:26+00:00" + "time": "2024-10-08T08:58:34+00:00" }, { "name": "league/flysystem-local", - "version": "3.15.0", + "version": "3.29.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-local.git", - "reference": "543f64c397fefdf9cfeac443ffb6beff602796b3" + "reference": "e0e8d52ce4b2ed154148453d321e97c8e931bd27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/543f64c397fefdf9cfeac443ffb6beff602796b3", - "reference": "543f64c397fefdf9cfeac443ffb6beff602796b3", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/e0e8d52ce4b2ed154148453d321e97c8e931bd27", + "reference": "e0e8d52ce4b2ed154148453d321e97c8e931bd27", "shasum": "" }, "require": { @@ -2323,43 +2323,32 @@ "local" ], "support": { - "issues": "https://github.com/thephpleague/flysystem-local/issues", - "source": "https://github.com/thephpleague/flysystem-local/tree/3.15.0" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.29.0" }, - "funding": [ - { - "url": "https://ecologi.com/frankdejonge", - "type": "custom" - }, - { - "url": "https://github.com/frankdejonge", - "type": "github" - } - ], - "time": "2023-05-02T20:02:14+00:00" + "time": "2024-08-09T21:24:39+00:00" }, { "name": "league/mime-type-detection", - "version": "1.11.0", + "version": "1.16.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/2d6702ff215bf922936ccc1ad31007edc76451b9", + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" }, "type": "library", "autoload": { @@ -2380,7 +2369,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.11.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.16.0" }, "funding": [ { @@ -2392,39 +2381,34 @@ "type": "tidelift" } ], - "time": "2022-04-17T13:12:02+00:00" + "time": "2024-09-21T08:32:55+00:00" }, { "name": "league/oauth2-client", - "version": "2.7.0", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-client.git", - "reference": "160d6274b03562ebeb55ed18399281d8118b76c8" + "reference": "3d5cf8d0543731dfb725ab30e4d7289891991e13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/160d6274b03562ebeb55ed18399281d8118b76c8", - "reference": "160d6274b03562ebeb55ed18399281d8118b76c8", + "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/3d5cf8d0543731dfb725ab30e4d7289891991e13", + "reference": "3d5cf8d0543731dfb725ab30e4d7289891991e13", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.0 || ^7.0", - "paragonie/random_compat": "^1 || ^2 || ^9.99", - "php": "^5.6 || ^7.0 || ^8.0" + "ext-json": "*", + "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", + "php": "^7.1 || >=8.0.0 <8.5.0" }, "require-dev": { "mockery/mockery": "^1.3.5", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpunit/phpunit": "^5.7 || ^6.0 || ^9.5", - "squizlabs/php_codesniffer": "^2.3 || ^3.0" + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11", + "squizlabs/php_codesniffer": "^3.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "League\\OAuth2\\Client\\": "src/" @@ -2460,22 +2444,22 @@ ], "support": { "issues": "https://github.com/thephpleague/oauth2-client/issues", - "source": "https://github.com/thephpleague/oauth2-client/tree/2.7.0" + "source": "https://github.com/thephpleague/oauth2-client/tree/2.8.0" }, - "time": "2023-04-16T18:19:15+00:00" + "time": "2024-12-11T05:05:52+00:00" }, { "name": "monolog/monolog", - "version": "3.4.0", + "version": "3.8.1", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "e2392369686d420ca32df3803de28b5d6f76867d" + "reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/e2392369686d420ca32df3803de28b5d6f76867d", - "reference": "e2392369686d420ca32df3803de28b5d6f76867d", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/aef6ee73a77a66e404dd6540934a9ef1b3c855b4", + "reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4", "shasum": "" }, "require": { @@ -2495,12 +2479,14 @@ "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpstan/phpstan": "^1.9", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-strict-rules": "^1.4", - "phpunit/phpunit": "^10.1", + "php-console/php-console": "^3.1.8", + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^10.5.17 || ^11.0.7", "predis/predis": "^1.1 || ^2", - "ruflin/elastica": "^7", + "rollbar/rollbar": "^4.0", + "ruflin/elastica": "^7 || ^8", "symfony/mailer": "^5.4 || ^6", "symfony/mime": "^5.4 || ^6" }, @@ -2551,7 +2537,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.4.0" + "source": "https://github.com/Seldaek/monolog/tree/3.8.1" }, "funding": [ { @@ -2563,35 +2549,35 @@ "type": "tidelift" } ], - "time": "2023-06-21T08:46:11+00:00" + "time": "2024-12-05T17:15:07+00:00" }, { "name": "nette/schema", - "version": "v1.2.3", + "version": "v1.3.2", "source": { "type": "git", "url": "https://github.com/nette/schema.git", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f" + "reference": "da801d52f0354f70a638673c4a0f04e16529431d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", + "url": "https://api.github.com/repos/nette/schema/zipball/da801d52f0354f70a638673c4a0f04e16529431d", + "reference": "da801d52f0354f70a638673c4a0f04e16529431d", "shasum": "" }, "require": { - "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": ">=7.1 <8.3" + "nette/utils": "^4.0", + "php": "8.1 - 8.4" }, "require-dev": { - "nette/tester": "^2.3 || ^2.4", + "nette/tester": "^2.5.2", "phpstan/phpstan-nette": "^1.0", - "tracy/tracy": "^2.7" + "tracy/tracy": "^2.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2623,26 +2609,26 @@ ], "support": { "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.3" + "source": "https://github.com/nette/schema/tree/v1.3.2" }, - "time": "2022-10-13T01:24:26+00:00" + "time": "2024-10-06T23:10:23+00:00" }, { "name": "nette/utils", - "version": "v4.0.0", + "version": "v4.0.5", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e" + "reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/cacdbf5a91a657ede665c541eda28941d4b09c1e", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e", + "url": "https://api.github.com/repos/nette/utils/zipball/736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", + "reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", "shasum": "" }, "require": { - "php": ">=8.0 <8.3" + "php": "8.0 - 8.4" }, "conflict": { "nette/finder": "<3", @@ -2650,7 +2636,7 @@ }, "require-dev": { "jetbrains/phpstorm-attributes": "dev-master", - "nette/tester": "^2.4", + "nette/tester": "^2.5", "phpstan/phpstan": "^1.0", "tracy/tracy": "^2.9" }, @@ -2660,8 +2646,7 @@ "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", "ext-json": "to use Nette\\Utils\\Json", "ext-mbstring": "to use Strings::lower() etc...", - "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" }, "type": "library", "extra": { @@ -2710,31 +2695,33 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.0" + "source": "https://github.com/nette/utils/tree/v4.0.5" }, - "time": "2023-02-02T10:41:53+00:00" + "time": "2024-08-07T15:39:19+00:00" }, { "name": "nikic/php-parser", - "version": "v4.16.0", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -2742,7 +2729,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2766,34 +2753,34 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2023-06-25T14:52:30+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "oneup/flysystem-bundle", - "version": "4.8.0", + "version": "4.12.3", "source": { "type": "git", "url": "https://github.com/1up-lab/OneupFlysystemBundle.git", - "reference": "85d2928bfc8e0c1e68a3e6c0e5a122872ed125a0" + "reference": "23d7186524a9c6236662c452891b1175cb193777" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/1up-lab/OneupFlysystemBundle/zipball/85d2928bfc8e0c1e68a3e6c0e5a122872ed125a0", - "reference": "85d2928bfc8e0c1e68a3e6c0e5a122872ed125a0", + "url": "https://api.github.com/repos/1up-lab/OneupFlysystemBundle/zipball/23d7186524a9c6236662c452891b1175cb193777", + "reference": "23d7186524a9c6236662c452891b1175cb193777", "shasum": "" }, "require": { "league/flysystem": "^2.0 || ^3.0", - "php": "^8.0", - "symfony/config": "^4.4 || ^5.3 || ^6.0", - "symfony/dependency-injection": "^4.4 || ^5.3 || ^6.0", - "symfony/http-kernel": "^4.4 || ^5.3 || ^6.0" + "php": "^8.1", + "symfony/config": "^5.4 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { "ext-simplexml": "*", - "friendsofphp/php-cs-fixer": "^2.16 || ^3.5", + "friendsofphp/php-cs-fixer": "^3.51", "league/flysystem-async-aws-s3": "^2.0 || ^3.0", "league/flysystem-aws-s3-v3": "^2.0 || ^3.0", "league/flysystem-azure-blob-storage": "^3.0", @@ -2801,17 +2788,16 @@ "league/flysystem-google-cloud-storage": "^2.0 || ^3.0", "league/flysystem-memory": "^2.0 || ^3.0", "league/flysystem-sftp-v3": "^2.0 || ^3.0", - "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.6.17", "royvoetman/flysystem-gitlab-storage": "^2.0 || ^3.0", - "symfony/asset": "^4.4 || ^5.3 || ^6.0", - "symfony/browser-kit": "^4.4 || ^5.3 || ^6.0", - "symfony/finder": "^4.4 || ^5.3 || ^6.0", - "symfony/framework-bundle": "^4.4 || ^5.3 || ^6.0", - "symfony/phpunit-bridge": "^6.0", - "symfony/templating": "^4.4 || ^5.3 || ^6.0", - "symfony/translation": "^4.4 || ^5.3 || ^6.0", - "symfony/yaml": "^4.4 || ^5.3 || ^6.0" + "symfony/asset": "^5.4 || ^6.0 || ^7.0", + "symfony/browser-kit": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/phpunit-bridge": "^7.0", + "symfony/translation": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "suggest": { "ext-fileinfo": "Required for MimeType", @@ -2856,9 +2842,9 @@ ], "support": { "issues": "https://github.com/1up-lab/OneupFlysystemBundle/issues", - "source": "https://github.com/1up-lab/OneupFlysystemBundle/tree/4.8.0" + "source": "https://github.com/1up-lab/OneupFlysystemBundle/tree/4.12.3" }, - "time": "2023-06-12T08:51:10+00:00" + "time": "2024-10-15T06:27:06+00:00" }, { "name": "oneup/uploader-bundle", @@ -3156,16 +3142,16 @@ }, { "name": "psr/http-client", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", "shasum": "" }, "require": { @@ -3202,26 +3188,26 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/1.0.2" + "source": "https://github.com/php-fig/http-client" }, - "time": "2023-04-10T20:12:12+00:00" + "time": "2023-09-23T14:17:50+00:00" }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -3245,7 +3231,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -3257,9 +3243,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", @@ -3372,16 +3358,16 @@ }, { "name": "psr/log", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { @@ -3416,9 +3402,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-07-14T16:46:02+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { "name": "ralouphie/getallheaders", @@ -3527,16 +3513,16 @@ }, { "name": "symfony/asset", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/asset.git", - "reference": "b77a4cc8e266b7e0db688de740f9ee7253aa411c" + "reference": "a579e67adaa9586a007abd1b6faf97296eef08ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/asset/zipball/b77a4cc8e266b7e0db688de740f9ee7253aa411c", - "reference": "b77a4cc8e266b7e0db688de740f9ee7253aa411c", + "url": "https://api.github.com/repos/symfony/asset/zipball/a579e67adaa9586a007abd1b6faf97296eef08ec", + "reference": "a579e67adaa9586a007abd1b6faf97296eef08ec", "shasum": "" }, "require": { @@ -3576,7 +3562,7 @@ "description": "Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/asset/tree/v6.3.0" + "source": "https://github.com/symfony/asset/tree/v6.3.12" }, "funding": [ { @@ -3592,20 +3578,20 @@ "type": "tidelift" } ], - "time": "2023-04-21T14:41:17+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/cache", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "52cff7608ef6e38376ac11bd1fbb0a220107f066" + "reference": "d085eedf33550ce014230bc51fca8df726ed7ac5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/52cff7608ef6e38376ac11bd1fbb0a220107f066", - "reference": "52cff7608ef6e38376ac11bd1fbb0a220107f066", + "url": "https://api.github.com/repos/symfony/cache/zipball/d085eedf33550ce014230bc51fca8df726ed7ac5", + "reference": "d085eedf33550ce014230bc51fca8df726ed7ac5", "shasum": "" }, "require": { @@ -3614,7 +3600,7 @@ "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3", - "symfony/var-exporter": "^6.2.10" + "symfony/var-exporter": "^6.3.6" }, "conflict": { "doctrine/dbal": "<2.13.1", @@ -3629,7 +3615,7 @@ }, "require-dev": { "cache/integration-tests": "dev-master", - "doctrine/dbal": "^2.13.1|^3.0", + "doctrine/dbal": "^2.13.1|^3|^4", "predis/predis": "^1.1|^2.0", "psr/simple-cache": "^1.0|^2.0|^3.0", "symfony/config": "^5.4|^6.0", @@ -3672,7 +3658,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.3.1" + "source": "https://github.com/symfony/cache/tree/v6.3.12" }, "funding": [ { @@ -3688,20 +3674,20 @@ "type": "tidelift" } ], - "time": "2023-06-24T11:51:27+00:00" + "time": "2024-01-23T14:42:18+00:00" }, { "name": "symfony/cache-contracts", - "version": "v3.3.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "ad945640ccc0ae6e208bcea7d7de4b39b569896b" + "reference": "15a4f8e5cd3bce9aeafc882b1acab39ec8de2c1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/ad945640ccc0ae6e208bcea7d7de4b39b569896b", - "reference": "ad945640ccc0ae6e208bcea7d7de4b39b569896b", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/15a4f8e5cd3bce9aeafc882b1acab39ec8de2c1b", + "reference": "15a4f8e5cd3bce9aeafc882b1acab39ec8de2c1b", "shasum": "" }, "require": { @@ -3710,12 +3696,12 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -3748,7 +3734,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/cache-contracts/tree/v3.5.1" }, "funding": [ { @@ -3764,20 +3750,20 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/clock", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/clock.git", - "reference": "2c72817f85cbdd0ae4e49643514a889004934296" + "reference": "b0fd66f03a9afb104a8def4e893fa96e1699c39b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/clock/zipball/2c72817f85cbdd0ae4e49643514a889004934296", - "reference": "2c72817f85cbdd0ae4e49643514a889004934296", + "url": "https://api.github.com/repos/symfony/clock/zipball/b0fd66f03a9afb104a8def4e893fa96e1699c39b", + "reference": "b0fd66f03a9afb104a8def4e893fa96e1699c39b", "shasum": "" }, "require": { @@ -3821,7 +3807,7 @@ "time" ], "support": { - "source": "https://github.com/symfony/clock/tree/v6.3.1" + "source": "https://github.com/symfony/clock/tree/v6.3.12" }, "funding": [ { @@ -3837,20 +3823,20 @@ "type": "tidelift" } ], - "time": "2023-06-08T23:46:55+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/config", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "a5e00dec161b08c946a2c16eed02adbeedf827ae" + "reference": "66b548223ec2569cc9f997f0dfbe8c3cfed9417e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/a5e00dec161b08c946a2c16eed02adbeedf827ae", - "reference": "a5e00dec161b08c946a2c16eed02adbeedf827ae", + "url": "https://api.github.com/repos/symfony/config/zipball/66b548223ec2569cc9f997f0dfbe8c3cfed9417e", + "reference": "66b548223ec2569cc9f997f0dfbe8c3cfed9417e", "shasum": "" }, "require": { @@ -3896,7 +3882,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.3.0" + "source": "https://github.com/symfony/config/tree/v6.3.12" }, "funding": [ { @@ -3912,20 +3898,20 @@ "type": "tidelift" } ], - "time": "2023-04-25T10:46:17+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/console", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7" + "reference": "6f69929b2421cf733a5b791dde3c3a2cfa6340cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", - "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", + "url": "https://api.github.com/repos/symfony/console/zipball/6f69929b2421cf733a5b791dde3c3a2cfa6340cd", + "reference": "6f69929b2421cf733a5b791dde3c3a2cfa6340cd", "shasum": "" }, "require": { @@ -3986,7 +3972,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.3.0" + "source": "https://github.com/symfony/console/tree/v6.3.12" }, "funding": [ { @@ -4002,20 +3988,20 @@ "type": "tidelift" } ], - "time": "2023-05-29T12:49:39+00:00" + "time": "2024-01-23T16:21:43+00:00" }, { "name": "symfony/debug-bundle", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/debug-bundle.git", - "reference": "02fe831f7cdd472c561116189bcc30d0759665e7" + "reference": "a7c57aecdb226c5293675e51c2fd6a7ed9a8a9a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug-bundle/zipball/02fe831f7cdd472c561116189bcc30d0759665e7", - "reference": "02fe831f7cdd472c561116189bcc30d0759665e7", + "url": "https://api.github.com/repos/symfony/debug-bundle/zipball/a7c57aecdb226c5293675e51c2fd6a7ed9a8a9a4", + "reference": "a7c57aecdb226c5293675e51c2fd6a7ed9a8a9a4", "shasum": "" }, "require": { @@ -4060,7 +4046,7 @@ "description": "Provides a tight integration of the Symfony VarDumper component and the ServerLogCommand from MonologBridge into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug-bundle/tree/v6.3.0" + "source": "https://github.com/symfony/debug-bundle/tree/v6.3.12" }, "funding": [ { @@ -4076,20 +4062,20 @@ "type": "tidelift" } ], - "time": "2023-05-25T12:58:06+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/dependency-injection", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "7abf242af21f196b65f20ab00ff251fdf3889b8d" + "reference": "3ca6c70bef0644be86d5acd962f11a6a6aa9382d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/7abf242af21f196b65f20ab00ff251fdf3889b8d", - "reference": "7abf242af21f196b65f20ab00ff251fdf3889b8d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/3ca6c70bef0644be86d5acd962f11a6a6aa9382d", + "reference": "3ca6c70bef0644be86d5acd962f11a6a6aa9382d", "shasum": "" }, "require": { @@ -4141,7 +4127,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.3.1" + "source": "https://github.com/symfony/dependency-injection/tree/v6.3.12" }, "funding": [ { @@ -4157,20 +4143,20 @@ "type": "tidelift" } ], - "time": "2023-06-24T11:51:27+00:00" + "time": "2024-01-30T08:17:33+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.3.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -4178,12 +4164,12 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -4208,7 +4194,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -4224,20 +4210,20 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/doctrine-bridge", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "594263c7d2677022a16e4f39d20070463ba03888" + "reference": "395b7bfd32b0f7700877c50ab1452f283c99878a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/594263c7d2677022a16e4f39d20070463ba03888", - "reference": "594263c7d2677022a16e4f39d20070463ba03888", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/395b7bfd32b0f7700877c50ab1452f283c99878a", + "reference": "395b7bfd32b0f7700877c50ab1452f283c99878a", "shasum": "" }, "require": { @@ -4270,8 +4256,8 @@ "doctrine/annotations": "^1.13.1|^2", "doctrine/collections": "^1.0|^2.0", "doctrine/data-fixtures": "^1.1", - "doctrine/dbal": "^2.13.1|^3.0", - "doctrine/orm": "^2.12", + "doctrine/dbal": "^2.13.1|^3|^4", + "doctrine/orm": "^2.12|^3", "psr/log": "^1|^2|^3", "symfony/cache": "^5.4|^6.0", "symfony/config": "^5.4|^6.0", @@ -4318,7 +4304,7 @@ "description": "Provides integration for Doctrine with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-bridge/tree/v6.3.1" + "source": "https://github.com/symfony/doctrine-bridge/tree/v6.3.12" }, "funding": [ { @@ -4334,20 +4320,20 @@ "type": "tidelift" } ], - "time": "2023-06-18T20:33:34+00:00" + "time": "2024-01-23T14:42:18+00:00" }, { "name": "symfony/dotenv", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/dotenv.git", - "reference": "ceadb434fe2a6763a03d2d110441745834f3dd1e" + "reference": "d9eaf699978601af5a50c26cbc4326158d9bd8b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/ceadb434fe2a6763a03d2d110441745834f3dd1e", - "reference": "ceadb434fe2a6763a03d2d110441745834f3dd1e", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/d9eaf699978601af5a50c26cbc4326158d9bd8b0", + "reference": "d9eaf699978601af5a50c26cbc4326158d9bd8b0", "shasum": "" }, "require": { @@ -4392,7 +4378,7 @@ "environment" ], "support": { - "source": "https://github.com/symfony/dotenv/tree/v6.3.0" + "source": "https://github.com/symfony/dotenv/tree/v6.3.12" }, "funding": [ { @@ -4408,20 +4394,20 @@ "type": "tidelift" } ], - "time": "2023-04-21T14:41:17+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/error-handler", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "99d2d814a6351461af350ead4d963bd67451236f" + "reference": "93a8400a7eaaaf385b2d6f71e30e064baa639629" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/99d2d814a6351461af350ead4d963bd67451236f", - "reference": "99d2d814a6351461af350ead4d963bd67451236f", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/93a8400a7eaaaf385b2d6f71e30e064baa639629", + "reference": "93a8400a7eaaaf385b2d6f71e30e064baa639629", "shasum": "" }, "require": { @@ -4466,7 +4452,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.3.0" + "source": "https://github.com/symfony/error-handler/tree/v6.3.12" }, "funding": [ { @@ -4482,20 +4468,20 @@ "type": "tidelift" } ], - "time": "2023-05-10T12:03:13+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa" + "reference": "6e344ddd3c18c525b5e5a4e996f3debda48e3078" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa", - "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/6e344ddd3c18c525b5e5a4e996f3debda48e3078", + "reference": "6e344ddd3c18c525b5e5a4e996f3debda48e3078", "shasum": "" }, "require": { @@ -4546,7 +4532,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.12" }, "funding": [ { @@ -4562,20 +4548,20 @@ "type": "tidelift" } ], - "time": "2023-04-21T14:41:17+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.3.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { @@ -4584,12 +4570,12 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -4622,7 +4608,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" }, "funding": [ { @@ -4638,20 +4624,20 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/expression-language", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", - "reference": "6d560c4c80e7e328708efd923f93ad67e6a0c1c0" + "reference": "89f6dc6f1883c3dc3c31d418038966c9b1766617" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/6d560c4c80e7e328708efd923f93ad67e6a0c1c0", - "reference": "6d560c4c80e7e328708efd923f93ad67e6a0c1c0", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/89f6dc6f1883c3dc3c31d418038966c9b1766617", + "reference": "89f6dc6f1883c3dc3c31d418038966c9b1766617", "shasum": "" }, "require": { @@ -4686,7 +4672,7 @@ "description": "Provides an engine that can compile and evaluate expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/expression-language/tree/v6.3.0" + "source": "https://github.com/symfony/expression-language/tree/v6.3.12" }, "funding": [ { @@ -4702,20 +4688,20 @@ "type": "tidelift" } ], - "time": "2023-04-28T16:05:33+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/filesystem", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" + "reference": "9f4b59b7906ccb0692d7565f98012fd1679eedfc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", - "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/9f4b59b7906ccb0692d7565f98012fd1679eedfc", + "reference": "9f4b59b7906ccb0692d7565f98012fd1679eedfc", "shasum": "" }, "require": { @@ -4749,7 +4735,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.3.1" + "source": "https://github.com/symfony/filesystem/tree/v6.3.12" }, "funding": [ { @@ -4765,20 +4751,20 @@ "type": "tidelift" } ], - "time": "2023-06-01T08:30:39+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/finder", - "version": "v6.3.0", + "version": "v6.3.5", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2" + "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d9b01ba073c44cef617c7907ce2419f8d00d75e2", - "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2", + "url": "https://api.github.com/repos/symfony/finder/zipball/a1b31d88c0e998168ca7792f222cbecee47428c4", + "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4", "shasum": "" }, "require": { @@ -4813,7 +4799,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.3.0" + "source": "https://github.com/symfony/finder/tree/v6.3.5" }, "funding": [ { @@ -4829,26 +4815,29 @@ "type": "tidelift" } ], - "time": "2023-04-02T01:25:41+00:00" + "time": "2023-09-26T12:56:25+00:00" }, { "name": "symfony/flex", - "version": "v2.3.1", + "version": "v2.4.7", "source": { "type": "git", "url": "https://github.com/symfony/flex.git", - "reference": "3c9c3424efdafe33e0e3cfb5e87e50b34711fedf" + "reference": "92f4fba342161ff36072bd3b8e0b3c6c23160402" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/flex/zipball/3c9c3424efdafe33e0e3cfb5e87e50b34711fedf", - "reference": "3c9c3424efdafe33e0e3cfb5e87e50b34711fedf", + "url": "https://api.github.com/repos/symfony/flex/zipball/92f4fba342161ff36072bd3b8e0b3c6c23160402", + "reference": "92f4fba342161ff36072bd3b8e0b3c6c23160402", "shasum": "" }, "require": { "composer-plugin-api": "^2.1", "php": ">=8.0" }, + "conflict": { + "composer/semver": "<1.7.2" + }, "require-dev": { "composer/composer": "^2.1", "symfony/dotenv": "^5.4|^6.0", @@ -4878,7 +4867,7 @@ "description": "Composer plugin for Symfony", "support": { "issues": "https://github.com/symfony/flex/issues", - "source": "https://github.com/symfony/flex/tree/v2.3.1" + "source": "https://github.com/symfony/flex/tree/v2.4.7" }, "funding": [ { @@ -4894,20 +4883,20 @@ "type": "tidelift" } ], - "time": "2023-05-27T07:38:25+00:00" + "time": "2024-10-07T08:51:54+00:00" }, { "name": "symfony/form", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "59e7c5afef32b9ff735e83e5fc74d63044833a2b" + "reference": "bf78d0298e2bc6313063bdc1e6d85d5e05e1dc88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/59e7c5afef32b9ff735e83e5fc74d63044833a2b", - "reference": "59e7c5afef32b9ff735e83e5fc74d63044833a2b", + "url": "https://api.github.com/repos/symfony/form/zipball/bf78d0298e2bc6313063bdc1e6d85d5e05e1dc88", + "reference": "bf78d0298e2bc6313063bdc1e6d85d5e05e1dc88", "shasum": "" }, "require": { @@ -4928,7 +4917,7 @@ "symfony/error-handler": "<5.4", "symfony/framework-bundle": "<5.4", "symfony/http-kernel": "<5.4", - "symfony/translation": "<5.4", + "symfony/translation": "<5.4.35|>=6.0,<6.3.12|>=6.4,<6.4.3", "symfony/translation-contracts": "<2.5", "symfony/twig-bridge": "<6.3" }, @@ -4944,7 +4933,7 @@ "symfony/intl": "^5.4|^6.0", "symfony/security-core": "^6.2", "symfony/security-csrf": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", + "symfony/translation": "^5.4.35|~6.3.12|^6.4.3", "symfony/uid": "^5.4|^6.0", "symfony/validator": "^5.4|^6.0", "symfony/var-dumper": "^5.4|^6.0" @@ -4975,7 +4964,7 @@ "description": "Allows to easily create, process and reuse HTML forms", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/form/tree/v6.3.0" + "source": "https://github.com/symfony/form/tree/v6.3.12" }, "funding": [ { @@ -4991,20 +4980,20 @@ "type": "tidelift" } ], - "time": "2023-05-25T13:09:35+00:00" + "time": "2024-01-23T16:21:43+00:00" }, { "name": "symfony/framework-bundle", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "42b0707efba17ca7c6af7373cb1b1a1b4f24f772" + "reference": "e144e3757296bed367ec3b764d8438891af75f78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/42b0707efba17ca7c6af7373cb1b1a1b4f24f772", - "reference": "42b0707efba17ca7c6af7373cb1b1a1b4f24f772", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/e144e3757296bed367ec3b764d8438891af75f78", + "reference": "e144e3757296bed367ec3b764d8438891af75f78", "shasum": "" }, "require": { @@ -5031,7 +5020,7 @@ "phpdocumentor/type-resolver": "<1.4.0", "symfony/asset": "<5.4", "symfony/clock": "<6.3", - "symfony/console": "<5.4", + "symfony/console": "<5.4|>=7.0", "symfony/dom-crawler": "<6.3", "symfony/dotenv": "<5.4", "symfony/form": "<5.4", @@ -5119,7 +5108,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v6.3.1" + "source": "https://github.com/symfony/framework-bundle/tree/v6.3.12" }, "funding": [ { @@ -5135,20 +5124,20 @@ "type": "tidelift" } ], - "time": "2023-06-24T09:59:31+00:00" + "time": "2024-01-23T16:21:43+00:00" }, { "name": "symfony/http-client", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "1c828a06aef2f5eeba42026dfc532d4fc5406123" + "reference": "510c51058dbef5db7d49c704954f32d6527d17f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/1c828a06aef2f5eeba42026dfc532d4fc5406123", - "reference": "1c828a06aef2f5eeba42026dfc532d4fc5406123", + "url": "https://api.github.com/repos/symfony/http-client/zipball/510c51058dbef5db7d49c704954f32d6527d17f8", + "reference": "510c51058dbef5db7d49c704954f32d6527d17f8", "shasum": "" }, "require": { @@ -5211,7 +5200,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.3.1" + "source": "https://github.com/symfony/http-client/tree/v6.3.12" }, "funding": [ { @@ -5227,20 +5216,20 @@ "type": "tidelift" } ], - "time": "2023-06-24T11:51:27+00:00" + "time": "2024-01-29T14:46:07+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.3.0", + "version": "v3.5.2", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "3b66325d0176b4ec826bffab57c9037d759c31fb" + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/3b66325d0176b4ec826bffab57c9037d759c31fb", - "reference": "3b66325d0176b4ec826bffab57c9037d759c31fb", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/ee8d807ab20fcb51267fdace50fbe3494c31e645", + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645", "shasum": "" }, "require": { @@ -5248,12 +5237,12 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -5289,7 +5278,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.2" }, "funding": [ { @@ -5305,20 +5294,20 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-12-07T08:49:48+00:00" }, { "name": "symfony/http-foundation", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e0ad0d153e1c20069250986cd9e9dd1ccebb0d66" + "reference": "3b72add708d48e8c08f7152df2d0b8d5303408fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e0ad0d153e1c20069250986cd9e9dd1ccebb0d66", - "reference": "e0ad0d153e1c20069250986cd9e9dd1ccebb0d66", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3b72add708d48e8c08f7152df2d0b8d5303408fa", + "reference": "3b72add708d48e8c08f7152df2d0b8d5303408fa", "shasum": "" }, "require": { @@ -5328,12 +5317,12 @@ "symfony/polyfill-php83": "^1.27" }, "conflict": { - "symfony/cache": "<6.2" + "symfony/cache": "<6.3" }, "require-dev": { - "doctrine/dbal": "^2.13.1|^3.0", + "doctrine/dbal": "^2.13.1|^3|^4", "predis/predis": "^1.1|^2.0", - "symfony/cache": "^5.4|^6.0", + "symfony/cache": "^6.3", "symfony/dependency-injection": "^5.4|^6.0", "symfony/expression-language": "^5.4|^6.0", "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", @@ -5366,7 +5355,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.3.1" + "source": "https://github.com/symfony/http-foundation/tree/v6.3.12" }, "funding": [ { @@ -5382,20 +5371,20 @@ "type": "tidelift" } ], - "time": "2023-06-24T11:51:27+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "161e16fd2e35fb4881a43bc8b383dfd5be4ac374" + "reference": "f7d160e46a6e0d3183e7a3846d4e3b4d04d5898b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/161e16fd2e35fb4881a43bc8b383dfd5be4ac374", - "reference": "161e16fd2e35fb4881a43bc8b383dfd5be4ac374", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f7d160e46a6e0d3183e7a3846d4e3b4d04d5898b", + "reference": "f7d160e46a6e0d3183e7a3846d4e3b4d04d5898b", "shasum": "" }, "require": { @@ -5404,7 +5393,7 @@ "symfony/deprecation-contracts": "^2.5|^3", "symfony/error-handler": "^6.3", "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-foundation": "^6.2.7", + "symfony/http-foundation": "^6.3.4", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -5412,7 +5401,7 @@ "symfony/cache": "<5.4", "symfony/config": "<6.1", "symfony/console": "<5.4", - "symfony/dependency-injection": "<6.3", + "symfony/dependency-injection": "<6.3.4", "symfony/doctrine-bridge": "<5.4", "symfony/form": "<5.4", "symfony/http-client": "<5.4", @@ -5436,7 +5425,7 @@ "symfony/config": "^6.1", "symfony/console": "^5.4|^6.0", "symfony/css-selector": "^5.4|^6.0", - "symfony/dependency-injection": "^6.3", + "symfony/dependency-injection": "^6.3.4", "symfony/dom-crawler": "^5.4|^6.0", "symfony/expression-language": "^5.4|^6.0", "symfony/finder": "^5.4|^6.0", @@ -5479,7 +5468,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.3.1" + "source": "https://github.com/symfony/http-kernel/tree/v6.3.12" }, "funding": [ { @@ -5495,56 +5484,54 @@ "type": "tidelift" } ], - "time": "2023-06-26T06:07:32+00:00" + "time": "2024-01-30T20:05:26+00:00" }, { "name": "symfony/maker-bundle", - "version": "v1.49.0", + "version": "v1.53.0", "source": { "type": "git", "url": "https://github.com/symfony/maker-bundle.git", - "reference": "ce1d424f76bbb377f1956cc7641e8e2eafe81cde" + "reference": "8d2f3f96704766837548d177fe3ae39ae94822d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/ce1d424f76bbb377f1956cc7641e8e2eafe81cde", - "reference": "ce1d424f76bbb377f1956cc7641e8e2eafe81cde", + "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/8d2f3f96704766837548d177fe3ae39ae94822d9", + "reference": "8d2f3f96704766837548d177fe3ae39ae94822d9", "shasum": "" }, "require": { "doctrine/inflector": "^2.0", - "nikic/php-parser": "^4.11", - "php": ">=8.0", - "symfony/config": "^5.4.7|^6.0", - "symfony/console": "^5.4.7|^6.0", - "symfony/dependency-injection": "^5.4.7|^6.0", + "nikic/php-parser": "^4.18|^5.0", + "php": ">=8.1", + "symfony/config": "^6.3|^7.0", + "symfony/console": "^6.3|^7.0", + "symfony/dependency-injection": "^6.3|^7.0", "symfony/deprecation-contracts": "^2.2|^3", - "symfony/filesystem": "^5.4.7|^6.0", - "symfony/finder": "^5.4.3|^6.0", - "symfony/framework-bundle": "^5.4.7|^6.0", - "symfony/http-kernel": "^5.4.7|^6.0", - "symfony/process": "^5.4.7|^6.0" + "symfony/filesystem": "^6.3|^7.0", + "symfony/finder": "^6.3|^7.0", + "symfony/framework-bundle": "^6.3|^7.0", + "symfony/http-kernel": "^6.3|^7.0", + "symfony/process": "^6.3|^7.0" }, "conflict": { "doctrine/doctrine-bundle": "<2.4", - "doctrine/orm": "<2.10", - "symfony/doctrine-bridge": "<5.4" + "doctrine/orm": "<2.10" }, "require-dev": { "composer/semver": "^3.0", - "doctrine/doctrine-bundle": "^2.4", + "doctrine/doctrine-bundle": "^2.5.0", "doctrine/orm": "^2.10.0", - "symfony/http-client": "^5.4.7|^6.0", - "symfony/phpunit-bridge": "^5.4.17|^6.0", - "symfony/polyfill-php80": "^1.16.0", - "symfony/security-core": "^5.4.7|^6.0", - "symfony/yaml": "^5.4.3|^6.0", - "twig/twig": "^2.0|^3.0" + "symfony/http-client": "^6.3|^7.0", + "symfony/phpunit-bridge": "^6.3|^7.0", + "symfony/security-core": "^6.3|^7.0", + "symfony/yaml": "^6.3|^7.0", + "twig/twig": "^3.0|^4.x-dev" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-main": "1.0-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -5566,13 +5553,14 @@ "homepage": "https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html", "keywords": [ "code generator", + "dev", "generator", "scaffold", "scaffolding" ], "support": { "issues": "https://github.com/symfony/maker-bundle/issues", - "source": "https://github.com/symfony/maker-bundle/tree/v1.49.0" + "source": "https://github.com/symfony/maker-bundle/tree/v1.53.0" }, "funding": [ { @@ -5588,24 +5576,25 @@ "type": "tidelift" } ], - "time": "2023-06-07T13:10:14+00:00" + "time": "2024-02-01T10:05:38+00:00" }, { "name": "symfony/mime", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "7b5d2121858cd6efbed778abce9cfdd7ab1f62ad" + "reference": "4b24dcaf8dfcd23fb7abb5b9df11e8c8093db68a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/7b5d2121858cd6efbed778abce9cfdd7ab1f62ad", - "reference": "7b5d2121858cd6efbed778abce9cfdd7ab1f62ad", + "url": "https://api.github.com/repos/symfony/mime/zipball/4b24dcaf8dfcd23fb7abb5b9df11e8c8093db68a", + "reference": "4b24dcaf8dfcd23fb7abb5b9df11e8c8093db68a", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, @@ -5614,7 +5603,7 @@ "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<5.4", - "symfony/serializer": "<6.2" + "symfony/serializer": "<6.3.12|>=6.4,<6.4.3" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", @@ -5623,7 +5612,7 @@ "symfony/dependency-injection": "^5.4|^6.0", "symfony/property-access": "^5.4|^6.0", "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "^6.2" + "symfony/serializer": "~6.3.12|^6.4.3" }, "type": "library", "autoload": { @@ -5655,7 +5644,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.3.0" + "source": "https://github.com/symfony/mime/tree/v6.3.12" }, "funding": [ { @@ -5671,20 +5660,20 @@ "type": "tidelift" } ], - "time": "2023-04-28T15:57:00+00:00" + "time": "2024-01-30T08:17:33+00:00" }, { "name": "symfony/monolog-bridge", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bridge.git", - "reference": "04b04b8e465e0fa84940e5609b6796a8b4e51bf1" + "reference": "b655801218307a85cc0ebb853ac289446db3084a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/04b04b8e465e0fa84940e5609b6796a8b4e51bf1", - "reference": "04b04b8e465e0fa84940e5609b6796a8b4e51bf1", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/b655801218307a85cc0ebb853ac289446db3084a", + "reference": "b655801218307a85cc0ebb853ac289446db3084a", "shasum": "" }, "require": { @@ -5733,7 +5722,7 @@ "description": "Provides integration for Monolog with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/monolog-bridge/tree/v6.3.1" + "source": "https://github.com/symfony/monolog-bridge/tree/v6.3.12" }, "funding": [ { @@ -5749,34 +5738,34 @@ "type": "tidelift" } ], - "time": "2023-06-08T11:13:32+00:00" + "time": "2024-01-29T14:47:00+00:00" }, { "name": "symfony/monolog-bundle", - "version": "v3.8.0", + "version": "v3.10.0", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bundle.git", - "reference": "a41bbcdc1105603b6d73a7d9a43a3788f8e0fb7d" + "reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/a41bbcdc1105603b6d73a7d9a43a3788f8e0fb7d", - "reference": "a41bbcdc1105603b6d73a7d9a43a3788f8e0fb7d", + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181", + "reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181", "shasum": "" }, "require": { - "monolog/monolog": "^1.22 || ^2.0 || ^3.0", - "php": ">=7.1.3", - "symfony/config": "~4.4 || ^5.0 || ^6.0", - "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", - "symfony/http-kernel": "~4.4 || ^5.0 || ^6.0", - "symfony/monolog-bridge": "~4.4 || ^5.0 || ^6.0" + "monolog/monolog": "^1.25.1 || ^2.0 || ^3.0", + "php": ">=7.2.5", + "symfony/config": "^5.4 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0", + "symfony/monolog-bridge": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "symfony/console": "~4.4 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^5.2 || ^6.0", - "symfony/yaml": "~4.4 || ^5.0 || ^6.0" + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/phpunit-bridge": "^6.3 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "type": "symfony-bundle", "extra": { @@ -5814,7 +5803,7 @@ ], "support": { "issues": "https://github.com/symfony/monolog-bundle/issues", - "source": "https://github.com/symfony/monolog-bundle/tree/v3.8.0" + "source": "https://github.com/symfony/monolog-bundle/tree/v3.10.0" }, "funding": [ { @@ -5830,7 +5819,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T14:24:36+00:00" + "time": "2023-11-06T17:08:13+00:00" }, { "name": "symfony/options-resolver", @@ -5901,16 +5890,16 @@ }, { "name": "symfony/password-hasher", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/password-hasher.git", - "reference": "d23ad221989e6b8278d050cabfd7b569eee84590" + "reference": "513140986f5d6ca1b1ef86f47166a36654571bfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/password-hasher/zipball/d23ad221989e6b8278d050cabfd7b569eee84590", - "reference": "d23ad221989e6b8278d050cabfd7b569eee84590", + "url": "https://api.github.com/repos/symfony/password-hasher/zipball/513140986f5d6ca1b1ef86f47166a36654571bfe", + "reference": "513140986f5d6ca1b1ef86f47166a36654571bfe", "shasum": "" }, "require": { @@ -5953,7 +5942,7 @@ "password" ], "support": { - "source": "https://github.com/symfony/password-hasher/tree/v6.3.0" + "source": "https://github.com/symfony/password-hasher/tree/v6.3.12" }, "funding": [ { @@ -5969,20 +5958,20 @@ "type": "tidelift" } ], - "time": "2023-02-14T09:04:20+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "0b0bf59b0d9bd1422145a123a67fb12af546ef0d" + "reference": "9e480445d8bb5f343870a1cba45e15a54cb3d83c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/0b0bf59b0d9bd1422145a123a67fb12af546ef0d", - "reference": "0b0bf59b0d9bd1422145a123a67fb12af546ef0d", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/9e480445d8bb5f343870a1cba45e15a54cb3d83c", + "reference": "9e480445d8bb5f343870a1cba45e15a54cb3d83c", "shasum": "" }, "require": { @@ -6002,8 +5991,8 @@ "type": "symfony-bridge", "extra": { "thanks": { - "name": "phpunit/phpunit", - "url": "https://github.com/sebastianbergmann/phpunit" + "url": "https://github.com/sebastianbergmann/phpunit", + "name": "phpunit/phpunit" } }, "autoload": { @@ -6034,7 +6023,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v6.3.1" + "source": "https://github.com/symfony/phpunit-bridge/tree/v6.3.12" }, "funding": [ { @@ -6050,36 +6039,33 @@ "type": "tidelift" } ], - "time": "2023-06-23T13:25:16+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6115,7 +6101,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -6131,36 +6117,33 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-icu", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "a3d9148e2c363588e05abbdd4ee4f971f0a5330c" + "reference": "d80a05e9904d2c2b9b95929f3e4b5d3a8f418d78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/a3d9148e2c363588e05abbdd4ee4f971f0a5330c", - "reference": "a3d9148e2c363588e05abbdd4ee4f971f0a5330c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/d80a05e9904d2c2b9b95929f3e4b5d3a8f418d78", + "reference": "d80a05e9904d2c2b9b95929f3e4b5d3a8f418d78", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance and support of other locales than \"en\"" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6202,7 +6185,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.31.0" }, "funding": [ { @@ -6218,38 +6201,34 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da" + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6289,7 +6268,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" }, "funding": [ { @@ -6305,36 +6284,33 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6373,7 +6349,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -6389,24 +6365,24 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -6416,12 +6392,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6456,7 +6429,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -6472,41 +6445,30 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" + "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", + "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, - "type": "library", + "type": "metapackage", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "notification-url": "https://packagist.org/downloads/", @@ -6532,7 +6494,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.31.0" }, "funding": [ { @@ -6548,33 +6510,30 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6615,7 +6574,83 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { @@ -6631,34 +6666,30 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php83", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "508c652ba3ccf69f8c97f251534f229791b52a57" + "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/508c652ba3ccf69f8c97f251534f229791b52a57", - "reference": "508c652ba3ccf69f8c97f251534f229791b52a57", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/2fb86d65e2d424369ad2905e83b236a8805ba491", + "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-php80": "^1.14" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6667,7 +6698,10 @@ ], "psr-4": { "Symfony\\Polyfill\\Php83\\": "" - } + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6692,7 +6726,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.31.0" }, "funding": [ { @@ -6708,24 +6742,24 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166" + "reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/f3cf1a645c2734236ed1e2e671e273eeb3586166", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/21533be36c24be3f4b1669c4725c7d1d2bab4ae2", + "reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-uuid": "*" @@ -6735,12 +6769,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6774,7 +6805,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.31.0" }, "funding": [ { @@ -6790,20 +6821,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628" + "reference": "6c5eceb88510fc6ccd7044f2bacb21a3c0993882" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/8741e3ed7fe2e91ec099e02446fb86667a0f1628", - "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628", + "url": "https://api.github.com/repos/symfony/process/zipball/6c5eceb88510fc6ccd7044f2bacb21a3c0993882", + "reference": "6c5eceb88510fc6ccd7044f2bacb21a3c0993882", "shasum": "" }, "require": { @@ -6835,7 +6866,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.3.0" + "source": "https://github.com/symfony/process/tree/v6.3.12" }, "funding": [ { @@ -6851,20 +6882,20 @@ "type": "tidelift" } ], - "time": "2023-05-19T08:06:44+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/property-access", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "db9358571ce63f09c439c2fee6c12e5b090b69ac" + "reference": "bbf7228ce2673538e1502cf1613d84ecfe8548d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/db9358571ce63f09c439c2fee6c12e5b090b69ac", - "reference": "db9358571ce63f09c439c2fee6c12e5b090b69ac", + "url": "https://api.github.com/repos/symfony/property-access/zipball/bbf7228ce2673538e1502cf1613d84ecfe8548d0", + "reference": "bbf7228ce2673538e1502cf1613d84ecfe8548d0", "shasum": "" }, "require": { @@ -6912,7 +6943,7 @@ "reflection" ], "support": { - "source": "https://github.com/symfony/property-access/tree/v6.3.0" + "source": "https://github.com/symfony/property-access/tree/v6.3.12" }, "funding": [ { @@ -6928,20 +6959,20 @@ "type": "tidelift" } ], - "time": "2023-05-19T08:06:44+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/property-info", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "7f3a03716112269741fe2a809f8f791a371d1fcd" + "reference": "ad9640f115b090503d52e8c8d5029e6041a40ccb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/7f3a03716112269741fe2a809f8f791a371d1fcd", - "reference": "7f3a03716112269741fe2a809f8f791a371d1fcd", + "url": "https://api.github.com/repos/symfony/property-info/zipball/ad9640f115b090503d52e8c8d5029e6041a40ccb", + "reference": "ad9640f115b090503d52e8c8d5029e6041a40ccb", "shasum": "" }, "require": { @@ -6995,7 +7026,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v6.3.0" + "source": "https://github.com/symfony/property-info/tree/v6.3.12" }, "funding": [ { @@ -7011,24 +7042,25 @@ "type": "tidelift" } ], - "time": "2023-05-19T08:06:44+00:00" + "time": "2024-01-23T16:21:43+00:00" }, { "name": "symfony/routing", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "d37ad1779c38b8eb71996d17dc13030dcb7f9cf5" + "reference": "c7a3dcdd44d14022bf0d9d27f14a7b238f7e3e85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/d37ad1779c38b8eb71996d17dc13030dcb7f9cf5", - "reference": "d37ad1779c38b8eb71996d17dc13030dcb7f9cf5", + "url": "https://api.github.com/repos/symfony/routing/zipball/c7a3dcdd44d14022bf0d9d27f14a7b238f7e3e85", + "reference": "c7a3dcdd44d14022bf0d9d27f14a7b238f7e3e85", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "doctrine/annotations": "<1.12", @@ -7077,7 +7109,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.3.1" + "source": "https://github.com/symfony/routing/tree/v6.3.12" }, "funding": [ { @@ -7093,20 +7125,20 @@ "type": "tidelift" } ], - "time": "2023-06-05T15:30:22+00:00" + "time": "2024-01-30T13:17:59+00:00" }, { "name": "symfony/runtime", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/runtime.git", - "reference": "8e83b5d8e0ace903e1a91dedfe08a84ed2a54b0d" + "reference": "a8d2b8f6033a33c224b43065a10bab5e4f0be486" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/runtime/zipball/8e83b5d8e0ace903e1a91dedfe08a84ed2a54b0d", - "reference": "8e83b5d8e0ace903e1a91dedfe08a84ed2a54b0d", + "url": "https://api.github.com/repos/symfony/runtime/zipball/a8d2b8f6033a33c224b43065a10bab5e4f0be486", + "reference": "a8d2b8f6033a33c224b43065a10bab5e4f0be486", "shasum": "" }, "require": { @@ -7156,7 +7188,7 @@ "runtime" ], "support": { - "source": "https://github.com/symfony/runtime/tree/v6.3.1" + "source": "https://github.com/symfony/runtime/tree/v6.3.12" }, "funding": [ { @@ -7172,20 +7204,20 @@ "type": "tidelift" } ], - "time": "2023-06-21T12:08:28+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/security-bundle", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "f4fe79d7ebafd406e1a6f646839bfbbed641d8b2" + "reference": "60eeacf3bbcbc830919824fbacaf6a9c0ecd0244" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/f4fe79d7ebafd406e1a6f646839bfbbed641d8b2", - "reference": "f4fe79d7ebafd406e1a6f646839bfbbed641d8b2", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/60eeacf3bbcbc830919824fbacaf6a9c0ecd0244", + "reference": "60eeacf3bbcbc830919824fbacaf6a9c0ecd0244", "shasum": "" }, "require": { @@ -7195,13 +7227,15 @@ "symfony/clock": "^6.3", "symfony/config": "^6.1", "symfony/dependency-injection": "^6.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/event-dispatcher": "^5.4|^6.0", "symfony/http-foundation": "^6.2", "symfony/http-kernel": "^6.2", "symfony/password-hasher": "^5.4|^6.0", "symfony/security-core": "^6.2", "symfony/security-csrf": "^5.4|^6.0", - "symfony/security-http": "^6.3" + "symfony/security-http": "^6.3.6", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { "symfony/browser-kit": "<5.4", @@ -7265,7 +7299,7 @@ "description": "Provides a tight integration of the Security component into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-bundle/tree/v6.3.1" + "source": "https://github.com/symfony/security-bundle/tree/v6.3.12" }, "funding": [ { @@ -7281,24 +7315,25 @@ "type": "tidelift" } ], - "time": "2023-06-21T12:08:28+00:00" + "time": "2024-01-23T14:42:18+00:00" }, { "name": "symfony/security-core", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/security-core.git", - "reference": "9cb74232e978be1440d2bb7daf91eb40a9363890" + "reference": "a2e6a338aaf4efec722839ec49f88eed2d752f92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/9cb74232e978be1440d2bb7daf91eb40a9363890", - "reference": "9cb74232e978be1440d2bb7daf91eb40a9363890", + "url": "https://api.github.com/repos/symfony/security-core/zipball/a2e6a338aaf4efec722839ec49f88eed2d752f92", + "reference": "a2e6a338aaf4efec722839ec49f88eed2d752f92", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/event-dispatcher-contracts": "^2.5|^3", "symfony/password-hasher": "^5.4|^6.0", "symfony/service-contracts": "^2.5|^3" @@ -7308,6 +7343,7 @@ "symfony/http-foundation": "<5.4", "symfony/ldap": "<5.4", "symfony/security-guard": "<5.4", + "symfony/translation": "<5.4.35|>=6.0,<6.3.12|>=6.4,<6.4.3", "symfony/validator": "<5.4" }, "require-dev": { @@ -7320,7 +7356,7 @@ "symfony/http-foundation": "^5.4|^6.0", "symfony/ldap": "^5.4|^6.0", "symfony/string": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", + "symfony/translation": "^5.4.35|~6.3.12|^6.4.3", "symfony/validator": "^5.4|^6.0" }, "type": "library", @@ -7349,7 +7385,7 @@ "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-core/tree/v6.3.0" + "source": "https://github.com/symfony/security-core/tree/v6.3.12" }, "funding": [ { @@ -7365,20 +7401,20 @@ "type": "tidelift" } ], - "time": "2023-04-28T15:57:00+00:00" + "time": "2024-01-23T14:42:18+00:00" }, { "name": "symfony/security-csrf", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/security-csrf.git", - "reference": "1f505c9060bde692eb37718c78a91d95d9abeeec" + "reference": "7d6ba797b8523da6d2e5b59994e7a73d305ce4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-csrf/zipball/1f505c9060bde692eb37718c78a91d95d9abeeec", - "reference": "1f505c9060bde692eb37718c78a91d95d9abeeec", + "url": "https://api.github.com/repos/symfony/security-csrf/zipball/7d6ba797b8523da6d2e5b59994e7a73d305ce4b5", + "reference": "7d6ba797b8523da6d2e5b59994e7a73d305ce4b5", "shasum": "" }, "require": { @@ -7417,7 +7453,7 @@ "description": "Symfony Security Component - CSRF Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-csrf/tree/v6.3.0" + "source": "https://github.com/symfony/security-csrf/tree/v6.3.12" }, "funding": [ { @@ -7433,20 +7469,20 @@ "type": "tidelift" } ], - "time": "2023-04-21T14:41:17+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/security-http", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/security-http.git", - "reference": "36d2bdd09c33f63014dc65f164a77ff099d256c6" + "reference": "09eb813655cd9b1f679f4d984721633e9a0bab60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-http/zipball/36d2bdd09c33f63014dc65f164a77ff099d256c6", - "reference": "36d2bdd09c33f63014dc65f164a77ff099d256c6", + "url": "https://api.github.com/repos/symfony/security-http/zipball/09eb813655cd9b1f679f4d984721633e9a0bab60", + "reference": "09eb813655cd9b1f679f4d984721633e9a0bab60", "shasum": "" }, "require": { @@ -7456,7 +7492,8 @@ "symfony/http-kernel": "^6.3", "symfony/polyfill-mbstring": "~1.0", "symfony/property-access": "^5.4|^6.0", - "symfony/security-core": "^6.3" + "symfony/security-core": "^6.3", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { "symfony/clock": "<6.3", @@ -7504,7 +7541,7 @@ "description": "Symfony Security Component - HTTP Integration", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-http/tree/v6.3.1" + "source": "https://github.com/symfony/security-http/tree/v6.3.12" }, "funding": [ { @@ -7520,24 +7557,25 @@ "type": "tidelift" } ], - "time": "2023-06-18T15:50:12+00:00" + "time": "2024-01-23T14:42:18+00:00" }, { "name": "symfony/serializer", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "1d238ee3180bc047f8ab713bfb73848d553f4407" + "reference": "917d5ecbd6a7aece5b6a33c7aab82ee087d69803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/1d238ee3180bc047f8ab713bfb73848d553f4407", - "reference": "1d238ee3180bc047f8ab713bfb73848d553f4407", + "url": "https://api.github.com/repos/symfony/serializer/zipball/917d5ecbd6a7aece5b6a33c7aab82ee087d69803", + "reference": "917d5ecbd6a7aece5b6a33c7aab82ee087d69803", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -7546,7 +7584,7 @@ "phpdocumentor/type-resolver": "<1.4.0", "symfony/dependency-injection": "<5.4", "symfony/property-access": "<5.4", - "symfony/property-info": "<5.4", + "symfony/property-info": "<5.4.24|>=6,<6.2.11", "symfony/uid": "<5.4", "symfony/yaml": "<5.4" }, @@ -7563,8 +7601,8 @@ "symfony/http-foundation": "^5.4|^6.0", "symfony/http-kernel": "^5.4|^6.0", "symfony/mime": "^5.4|^6.0", - "symfony/property-access": "^5.4|^6.0", - "symfony/property-info": "^5.4|^6.0", + "symfony/property-access": "^5.4.26|^6.3", + "symfony/property-info": "^5.4.24|^6.2.11", "symfony/uid": "^5.4|^6.0", "symfony/validator": "^5.4|^6.0", "symfony/var-dumper": "^5.4|^6.0", @@ -7597,7 +7635,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v6.3.1" + "source": "https://github.com/symfony/serializer/tree/v6.3.12" }, "funding": [ { @@ -7613,37 +7651,38 @@ "type": "tidelift" } ], - "time": "2023-06-21T19:54:33+00:00" + "time": "2024-01-30T08:17:33+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.3.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -7679,7 +7718,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -7695,20 +7734,20 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/stopwatch", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2" + "reference": "416596166641f1f728b0a64f5b9dd07cceb410c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/416596166641f1f728b0a64f5b9dd07cceb410c1", + "reference": "416596166641f1f728b0a64f5b9dd07cceb410c1", "shasum": "" }, "require": { @@ -7741,7 +7780,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.3.0" + "source": "https://github.com/symfony/stopwatch/tree/v6.3.12" }, "funding": [ { @@ -7757,20 +7796,20 @@ "type": "tidelift" } ], - "time": "2023-02-16T10:14:28+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/string", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f" + "reference": "bce75043af265dc8aca536a6ab1d6b3181763529" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "url": "https://api.github.com/repos/symfony/string/zipball/bce75043af265dc8aca536a6ab1d6b3181763529", + "reference": "bce75043af265dc8aca536a6ab1d6b3181763529", "shasum": "" }, "require": { @@ -7827,7 +7866,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.3.0" + "source": "https://github.com/symfony/string/tree/v6.3.12" }, "funding": [ { @@ -7843,20 +7882,20 @@ "type": "tidelift" } ], - "time": "2023-03-21T21:06:29+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/templating", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/templating.git", - "reference": "27d79475d8bcba894235b5472df158e78c6419a3" + "reference": "4c54c5c58e0c7ddf8fd452b4657ed7cec586d013" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/templating/zipball/27d79475d8bcba894235b5472df158e78c6419a3", - "reference": "27d79475d8bcba894235b5472df158e78c6419a3", + "url": "https://api.github.com/repos/symfony/templating/zipball/4c54c5c58e0c7ddf8fd452b4657ed7cec586d013", + "reference": "4c54c5c58e0c7ddf8fd452b4657ed7cec586d013", "shasum": "" }, "require": { @@ -7892,7 +7931,7 @@ "description": "Provides all the tools needed to build any kind of template system", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/templating/tree/v6.3.0" + "source": "https://github.com/symfony/templating/tree/v6.3.12" }, "funding": [ { @@ -7908,24 +7947,25 @@ "type": "tidelift" } ], - "time": "2023-04-22T08:23:52+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/translation", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "f72b2cba8f79dd9d536f534f76874b58ad37876f" + "reference": "5c67cd1b1635be525f4dbe89042cdc3749a89ff5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f72b2cba8f79dd9d536f534f76874b58ad37876f", - "reference": "f72b2cba8f79dd9d536f534f76874b58ad37876f", + "url": "https://api.github.com/repos/symfony/translation/zipball/5c67cd1b1635be525f4dbe89042cdc3749a89ff5", + "reference": "5c67cd1b1635be525f4dbe89042cdc3749a89ff5", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/translation-contracts": "^2.5|^3.0" }, @@ -7943,7 +7983,7 @@ "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", "symfony/console": "^5.4|^6.0", @@ -7986,7 +8026,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.3.0" + "source": "https://github.com/symfony/translation/tree/v6.3.12" }, "funding": [ { @@ -8002,20 +8042,20 @@ "type": "tidelift" } ], - "time": "2023-05-19T12:46:45+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.3.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "02c24deb352fb0d79db5486c0c79905a85e37e86" + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/02c24deb352fb0d79db5486c0c79905a85e37e86", - "reference": "02c24deb352fb0d79db5486c0c79905a85e37e86", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/4667ff3bd513750603a09c8dedbea942487fb07c", + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c", "shasum": "" }, "require": { @@ -8023,12 +8063,12 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -8064,7 +8104,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.5.1" }, "funding": [ { @@ -8080,20 +8120,20 @@ "type": "tidelift" } ], - "time": "2023-05-30T17:17:10+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/twig-bridge", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "67a33c71062d7d931fe9a8cb7be79cca986a6c09" + "reference": "dd34e348a9237d40eb7a791ee14de6efbadd5108" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/67a33c71062d7d931fe9a8cb7be79cca986a6c09", - "reference": "67a33c71062d7d931fe9a8cb7be79cca986a6c09", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/dd34e348a9237d40eb7a791ee14de6efbadd5108", + "reference": "dd34e348a9237d40eb7a791ee14de6efbadd5108", "shasum": "" }, "require": { @@ -8136,7 +8176,7 @@ "symfony/security-core": "^5.4|^6.0", "symfony/security-csrf": "^5.4|^6.0", "symfony/security-http": "^5.4|^6.0", - "symfony/serializer": "^6.2", + "symfony/serializer": "~6.3.12|^6.4.3", "symfony/stopwatch": "^5.4|^6.0", "symfony/translation": "^6.1", "symfony/web-link": "^5.4|^6.0", @@ -8172,7 +8212,7 @@ "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bridge/tree/v6.3.0" + "source": "https://github.com/symfony/twig-bridge/tree/v6.3.12" }, "funding": [ { @@ -8188,20 +8228,20 @@ "type": "tidelift" } ], - "time": "2023-05-29T13:12:36+00:00" + "time": "2024-01-30T08:17:33+00:00" }, { "name": "symfony/twig-bundle", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/twig-bundle.git", - "reference": "d0cd4d1675c0582d27c2e8bb0dc27c0303d8e3ea" + "reference": "820d2a7a2b876b287215a6b93f482dace8057d9b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/d0cd4d1675c0582d27c2e8bb0dc27c0303d8e3ea", - "reference": "d0cd4d1675c0582d27c2e8bb0dc27c0303d8e3ea", + "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/820d2a7a2b876b287215a6b93f482dace8057d9b", + "reference": "820d2a7a2b876b287215a6b93f482dace8057d9b", "shasum": "" }, "require": { @@ -8257,7 +8297,7 @@ "description": "Provides a tight integration of Twig into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bundle/tree/v6.3.0" + "source": "https://github.com/symfony/twig-bundle/tree/v6.3.12" }, "funding": [ { @@ -8273,20 +8313,20 @@ "type": "tidelift" } ], - "time": "2023-05-06T09:53:41+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/uid", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "01b0f20b1351d997711c56f1638f7a8c3061e384" + "reference": "49d02f0c96c79f9cbfdb0e88ea2be0654b1c2da4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/01b0f20b1351d997711c56f1638f7a8c3061e384", - "reference": "01b0f20b1351d997711c56f1638f7a8c3061e384", + "url": "https://api.github.com/repos/symfony/uid/zipball/49d02f0c96c79f9cbfdb0e88ea2be0654b1c2da4", + "reference": "49d02f0c96c79f9cbfdb0e88ea2be0654b1c2da4", "shasum": "" }, "require": { @@ -8331,7 +8371,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v6.3.0" + "source": "https://github.com/symfony/uid/tree/v6.3.12" }, "funding": [ { @@ -8347,24 +8387,25 @@ "type": "tidelift" } ], - "time": "2023-04-08T07:25:02+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c81268d6960ddb47af17391a27d222bd58cf0515" + "reference": "5791cc448c78a1a7879812d8073cc6690286e488" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c81268d6960ddb47af17391a27d222bd58cf0515", - "reference": "c81268d6960ddb47af17391a27d222bd58cf0515", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/5791cc448c78a1a7879812d8073cc6690286e488", + "reference": "5791cc448c78a1a7879812d8073cc6690286e488", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -8373,6 +8414,7 @@ "require-dev": { "ext-iconv": "*", "symfony/console": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0", "symfony/process": "^5.4|^6.0", "symfony/uid": "^5.4|^6.0", "twig/twig": "^2.13|^3.0.4" @@ -8413,7 +8455,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.3.1" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.12" }, "funding": [ { @@ -8429,20 +8471,20 @@ "type": "tidelift" } ], - "time": "2023-06-21T12:08:28+00:00" + "time": "2024-01-23T16:21:43+00:00" }, { "name": "symfony/var-exporter", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "db5416d04269f2827d8c54331ba4cfa42620d350" + "reference": "ea6fe0e7d188f4b34c28a00d3f9a58ee33801a4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/db5416d04269f2827d8c54331ba4cfa42620d350", - "reference": "db5416d04269f2827d8c54331ba4cfa42620d350", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/ea6fe0e7d188f4b34c28a00d3f9a58ee33801a4b", + "reference": "ea6fe0e7d188f4b34c28a00d3f9a58ee33801a4b", "shasum": "" }, "require": { @@ -8487,7 +8529,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.3.0" + "source": "https://github.com/symfony/var-exporter/tree/v6.3.12" }, "funding": [ { @@ -8503,20 +8545,20 @@ "type": "tidelift" } ], - "time": "2023-04-21T08:48:44+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/web-link", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/web-link.git", - "reference": "0989ca617d0703cdca501a245f10e194ff22315b" + "reference": "0bc29a164b8c9c683d5eb0f839762c055d01e42e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-link/zipball/0989ca617d0703cdca501a245f10e194ff22315b", - "reference": "0989ca617d0703cdca501a245f10e194ff22315b", + "url": "https://api.github.com/repos/symfony/web-link/zipball/0bc29a164b8c9c683d5eb0f839762c055d01e42e", + "reference": "0bc29a164b8c9c683d5eb0f839762c055d01e42e", "shasum": "" }, "require": { @@ -8570,7 +8612,7 @@ "push" ], "support": { - "source": "https://github.com/symfony/web-link/tree/v6.3.0" + "source": "https://github.com/symfony/web-link/tree/v6.3.12" }, "funding": [ { @@ -8586,26 +8628,26 @@ "type": "tidelift" } ], - "time": "2023-04-21T14:41:17+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/web-profiler-bundle", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/web-profiler-bundle.git", - "reference": "4a6cf8cb093e720c7ae4d55b1af848ce7e9abd36" + "reference": "920efdd0f53f088b44963cf89368038ee39719b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/4a6cf8cb093e720c7ae4d55b1af848ce7e9abd36", - "reference": "4a6cf8cb093e720c7ae4d55b1af848ce7e9abd36", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/920efdd0f53f088b44963cf89368038ee39719b9", + "reference": "920efdd0f53f088b44963cf89368038ee39719b9", "shasum": "" }, "require": { "php": ">=8.1", "symfony/config": "^5.4|^6.0", - "symfony/framework-bundle": "^5.4|^6.0", + "symfony/framework-bundle": "^5.4|^6.0,<6.4", "symfony/http-kernel": "^6.3", "symfony/routing": "^5.4|^6.0", "symfony/twig-bundle": "^5.4|^6.0", @@ -8651,7 +8693,7 @@ "dev" ], "support": { - "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.3.1" + "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.3.12" }, "funding": [ { @@ -8667,20 +8709,20 @@ "type": "tidelift" } ], - "time": "2023-06-24T11:51:27+00:00" + "time": "2024-01-23T16:21:43+00:00" }, { "name": "symfony/webpack-encore-bundle", - "version": "v1.17.1", + "version": "v1.17.2", "source": { "type": "git", "url": "https://github.com/symfony/webpack-encore-bundle.git", - "reference": "7e3b6f69bcfcbb40ecfe83ad7a77e44316d26573" + "reference": "471ebbc03072dad6e31840dc317bc634a32785f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/webpack-encore-bundle/zipball/7e3b6f69bcfcbb40ecfe83ad7a77e44316d26573", - "reference": "7e3b6f69bcfcbb40ecfe83ad7a77e44316d26573", + "url": "https://api.github.com/repos/symfony/webpack-encore-bundle/zipball/471ebbc03072dad6e31840dc317bc634a32785f5", + "reference": "471ebbc03072dad6e31840dc317bc634a32785f5", "shasum": "" }, "require": { @@ -8702,8 +8744,8 @@ "type": "symfony-bundle", "extra": { "thanks": { - "name": "symfony/webpack-encore", - "url": "https://github.com/symfony/webpack-encore" + "url": "https://github.com/symfony/webpack-encore", + "name": "symfony/webpack-encore" } }, "autoload": { @@ -8724,7 +8766,7 @@ "description": "Integration with your Symfony app & Webpack Encore!", "support": { "issues": "https://github.com/symfony/webpack-encore-bundle/issues", - "source": "https://github.com/symfony/webpack-encore-bundle/tree/v1.17.1" + "source": "https://github.com/symfony/webpack-encore-bundle/tree/v1.17.2" }, "funding": [ { @@ -8740,24 +8782,25 @@ "type": "tidelift" } ], - "time": "2023-05-29T00:18:01+00:00" + "time": "2023-09-26T14:36:28+00:00" }, { "name": "symfony/yaml", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "a9a8337aa641ef2aa39c3e028f9107ec391e5927" + "reference": "8ab9bb61e9b862c9b481af745ff163bc5e5e6246" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/a9a8337aa641ef2aa39c3e028f9107ec391e5927", - "reference": "a9a8337aa641ef2aa39c3e028f9107ec391e5927", + "url": "https://api.github.com/repos/symfony/yaml/zipball/8ab9bb61e9b862c9b481af745ff163bc5e5e6246", + "reference": "8ab9bb61e9b862c9b481af745ff163bc5e5e6246", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -8795,7 +8838,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.3.0" + "source": "https://github.com/symfony/yaml/tree/v6.3.12" }, "funding": [ { @@ -8811,31 +8854,31 @@ "type": "tidelift" } ], - "time": "2023-04-28T13:28:14+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "twig/extra-bundle", - "version": "v3.6.1", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/twigphp/twig-extra-bundle.git", - "reference": "802cc2dd46ec88285d6c7fa85c26ab7f2cd5bc49" + "reference": "32807183753de0388c8e59f7ac2d13bb47311140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/802cc2dd46ec88285d6c7fa85c26ab7f2cd5bc49", - "reference": "802cc2dd46ec88285d6c7fa85c26ab7f2cd5bc49", + "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/32807183753de0388c8e59f7ac2d13bb47311140", + "reference": "32807183753de0388c8e59f7ac2d13bb47311140", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/framework-bundle": "^4.4|^5.0|^6.0", - "symfony/twig-bundle": "^4.4|^5.0|^6.0", - "twig/twig": "^2.7|^3.0" + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/twig-bundle": "^5.4|^6.0|^7.0", + "twig/twig": "^3.0" }, "require-dev": { "league/commonmark": "^1.0|^2.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", + "symfony/phpunit-bridge": "^6.4|^7.0", "twig/cache-extra": "^3.0", "twig/cssinliner-extra": "^2.12|^3.0", "twig/html-extra": "^2.12|^3.0", @@ -8873,7 +8916,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.6.1" + "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.8.0" }, "funding": [ { @@ -8885,35 +8928,39 @@ "type": "tidelift" } ], - "time": "2023-05-06T11:11:46+00:00" + "time": "2023-11-21T14:02:01+00:00" }, { "name": "twig/markdown-extra", - "version": "v3.6.0", + "version": "v3.18.0", "source": { "type": "git", "url": "https://github.com/twigphp/markdown-extra.git", - "reference": "8f1179e279cea6ef14066a4560b859df58acd5d8" + "reference": "76219b06e104a706879752e6e4d79f63ef7e9f23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/8f1179e279cea6ef14066a4560b859df58acd5d8", - "reference": "8f1179e279cea6ef14066a4560b859df58acd5d8", + "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/76219b06e104a706879752e6e4d79f63ef7e9f23", + "reference": "76219b06e104a706879752e6e4d79f63ef7e9f23", "shasum": "" }, "require": { - "php": ">=7.1.3", - "twig/twig": "^2.7|^3.0" + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.5|^3", + "twig/twig": "^3.13|^4.0" }, "require-dev": { - "erusev/parsedown": "^1.7", + "erusev/parsedown": "dev-master as 1.x-dev", "league/commonmark": "^1.0|^2.0", "league/html-to-markdown": "^4.8|^5.0", "michelf/php-markdown": "^1.8|^2.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + "symfony/phpunit-bridge": "^6.4|^7.0" }, "type": "library", "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { "Twig\\Extra\\Markdown\\": "" }, @@ -8941,7 +8988,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/markdown-extra/tree/v3.6.0" + "source": "https://github.com/twigphp/markdown-extra/tree/v3.18.0" }, "funding": [ { @@ -8953,30 +9000,30 @@ "type": "tidelift" } ], - "time": "2023-02-09T06:45:16+00:00" + "time": "2024-12-02T08:57:02+00:00" }, { "name": "twig/string-extra", - "version": "v3.6.0", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/twigphp/string-extra.git", - "reference": "fab682645b3f8730fbdb7bf9ec8fe668d6f76638" + "reference": "b0c9037d96baff79abe368dc092a59b726517548" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/string-extra/zipball/fab682645b3f8730fbdb7bf9ec8fe668d6f76638", - "reference": "fab682645b3f8730fbdb7bf9ec8fe668d6f76638", + "url": "https://api.github.com/repos/twigphp/string-extra/zipball/b0c9037d96baff79abe368dc092a59b726517548", + "reference": "b0c9037d96baff79abe368dc092a59b726517548", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/string": "^5.0|^6.0", + "symfony/string": "^5.4|^6.0|^7.0", "symfony/translation-contracts": "^1.1|^2|^3", - "twig/twig": "^2.7|^3.0" + "twig/twig": "^3.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + "symfony/phpunit-bridge": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -9008,7 +9055,7 @@ "unicode" ], "support": { - "source": "https://github.com/twigphp/string-extra/tree/v3.6.0" + "source": "https://github.com/twigphp/string-extra/tree/v3.8.0" }, "funding": [ { @@ -9020,33 +9067,42 @@ "type": "tidelift" } ], - "time": "2023-02-09T06:45:16+00:00" + "time": "2023-11-21T14:02:01+00:00" }, { "name": "twig/twig", - "version": "v3.6.1", + "version": "v3.18.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd" + "reference": "acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", - "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50", + "reference": "acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php81": "^1.29" }, "require-dev": { + "phpstan/phpstan": "^2.0", "psr/container": "^1.0|^2.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" }, "type": "library", "autoload": { + "files": [ + "src/Resources/core.php", + "src/Resources/debug.php", + "src/Resources/escaper.php", + "src/Resources/string_loader.php" + ], "psr-4": { "Twig\\": "src/" } @@ -9079,7 +9135,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.6.1" + "source": "https://github.com/twigphp/Twig/tree/v3.18.0" }, "funding": [ { @@ -9091,22 +9147,22 @@ "type": "tidelift" } ], - "time": "2023-06-08T12:52:13+00:00" + "time": "2024-12-29T10:51:50+00:00" } ], "packages-dev": [ { "name": "masterminds/html5", - "version": "2.8.0", + "version": "2.9.0", "source": { "type": "git", "url": "https://github.com/Masterminds/html5-php.git", - "reference": "3c5d5a56d56f48a1ca08a0670f0f80c1dad368f3" + "reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/3c5d5a56d56f48a1ca08a0670f0f80c1dad368f3", - "reference": "3c5d5a56d56f48a1ca08a0670f0f80c1dad368f3", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f5ac2c0b0a2eefca70b2ce32a5809992227e75a6", + "reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6", "shasum": "" }, "require": { @@ -9114,7 +9170,7 @@ "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8" + "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9" }, "type": "library", "extra": { @@ -9158,22 +9214,22 @@ ], "support": { "issues": "https://github.com/Masterminds/html5-php/issues", - "source": "https://github.com/Masterminds/html5-php/tree/2.8.0" + "source": "https://github.com/Masterminds/html5-php/tree/2.9.0" }, - "time": "2023-04-26T07:27:39+00:00" + "time": "2024-03-31T07:05:07+00:00" }, { "name": "phpstan/phpstan", - "version": "1.10.25", + "version": "1.12.15", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "578f4e70d117f9a90699324c555922800ac38d8c" + "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/578f4e70d117f9a90699324c555922800ac38d8c", - "reference": "578f4e70d117f9a90699324c555922800ac38d8c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c91d4e8bc056f46cf653656e6f71004b254574d1", + "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1", "shasum": "" }, "require": { @@ -9216,13 +9272,9 @@ { "url": "https://github.com/phpstan", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2023-07-06T12:11:37+00:00" + "time": "2025-01-05T16:40:22+00:00" }, { "name": "rector/rector", @@ -9287,16 +9339,16 @@ }, { "name": "symfony/browser-kit", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "0eb7228e7c435169e65c911ba8d107d56d850049" + "reference": "867868fca3a0939236ab89600f9480eee74843ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/0eb7228e7c435169e65c911ba8d107d56d850049", - "reference": "0eb7228e7c435169e65c911ba8d107d56d850049", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/867868fca3a0939236ab89600f9480eee74843ce", + "reference": "867868fca3a0939236ab89600f9480eee74843ce", "shasum": "" }, "require": { @@ -9335,7 +9387,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v6.3.0" + "source": "https://github.com/symfony/browser-kit/tree/v6.3.12" }, "funding": [ { @@ -9351,20 +9403,20 @@ "type": "tidelift" } ], - "time": "2023-04-25T10:46:17+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/css-selector", - "version": "v6.3.0", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf" + "reference": "7bb2f446287397cc41ebd9acfa0755b16db05fbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf", - "reference": "88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/7bb2f446287397cc41ebd9acfa0755b16db05fbc", + "reference": "7bb2f446287397cc41ebd9acfa0755b16db05fbc", "shasum": "" }, "require": { @@ -9400,7 +9452,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.3.0" + "source": "https://github.com/symfony/css-selector/tree/v6.3.12" }, "funding": [ { @@ -9416,20 +9468,20 @@ "type": "tidelift" } ], - "time": "2023-03-20T16:43:42+00:00" + "time": "2024-01-23T14:35:58+00:00" }, { "name": "symfony/dom-crawler", - "version": "v6.3.1", + "version": "v6.3.12", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "8aa333f41f05afc7fc285a976b58272fd90fc212" + "reference": "e412abb0a443dc2c29decb96cac476aed7b8234b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/8aa333f41f05afc7fc285a976b58272fd90fc212", - "reference": "8aa333f41f05afc7fc285a976b58272fd90fc212", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/e412abb0a443dc2c29decb96cac476aed7b8234b", + "reference": "e412abb0a443dc2c29decb96cac476aed7b8234b", "shasum": "" }, "require": { @@ -9467,7 +9519,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v6.3.1" + "source": "https://github.com/symfony/dom-crawler/tree/v6.3.12" }, "funding": [ { @@ -9483,7 +9535,7 @@ "type": "tidelift" } ], - "time": "2023-06-05T15:30:22+00:00" + "time": "2024-01-23T14:35:58+00:00" } ], "aliases": [], @@ -9492,12 +9544,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^8.2", + "php": "^8.3", "ext-ctype": "*", "ext-iconv": "*", "ext-json": "*", "ext-zip": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.6.0" } diff --git a/package.json b/package.json index 69f772fa..276607b8 100644 --- a/package.json +++ b/package.json @@ -89,5 +89,6 @@ "dependencies": { "datatables.net": "^1.11.5", "datatables.net-dt": "^1.11.5" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } From 56400cc0bba5de3607e37bb4effdd23835e1d542 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 12:42:45 +0100 Subject: [PATCH 02/52] build: upgrade to symfony 6.4 --- README.md | 2 +- composer.json | 44 +- composer.lock | 1433 +++++++++++++++++++++++++------------------------ 3 files changed, 754 insertions(+), 725 deletions(-) diff --git a/README.md b/README.md index 2f63fb3c..864c7028 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DataWiz - Research Data Documentation Assistant -![Symfony Version](https://img.shields.io/badge/Symfony-^6.2-success?logo=symfony&style=flat-square) +![Symfony Version](https://img.shields.io/badge/Symfony-^6.4-success?logo=symfony&style=flat-square) ![PHP Version](https://img.shields.io/badge/Php-^8.3-informational?logo=PHP&style=flat-square&logoColor=white) ![Composer Version](https://img.shields.io/badge/Composer-^2.7-informational?logo=Composer&style=flat-square&logoColor=white) ![Nodejs Version](https://img.shields.io/badge/Nodejs-18_LTS-informational?logo=node.js&style=flat-square&logoColor=white) diff --git a/composer.json b/composer.json index ee7ef8d3..a1918468 100644 --- a/composer.json +++ b/composer.json @@ -19,29 +19,29 @@ "oneup/flysystem-bundle": "^4.6", "oneup/uploader-bundle": "^4.0", "stevenmaguire/oauth2-keycloak": "^4.0", - "symfony/console": "6.3.*", - "symfony/debug-bundle": "6.3.*", - "symfony/dotenv": "6.3.*", - "symfony/expression-language": "6.3.*", + "symfony/console": "6.4.*", + "symfony/debug-bundle": "6.4.*", + "symfony/dotenv": "6.4.*", + "symfony/expression-language": "6.4.*", "symfony/flex": "^2.1", - "symfony/form": "6.3.*", - "symfony/framework-bundle": "6.3.*", - "symfony/http-client": "6.3.*", + "symfony/form": "6.4.*", + "symfony/framework-bundle": "6.4.*", + "symfony/http-client": "6.4.*", "symfony/maker-bundle": "^1.33", "symfony/monolog-bundle": "^3.0", - "symfony/phpunit-bridge": "6.3.*", - "symfony/runtime": "6.3.*", - "symfony/security-bundle": "6.3.*", - "symfony/serializer": "6.3.*", - "symfony/stopwatch": "6.3.*", - "symfony/translation": "6.3.*", - "symfony/twig-bundle": "6.3.*", - "symfony/uid": "6.3.*", - "symfony/var-dumper": "6.3.*", - "symfony/web-link": "6.3.*", - "symfony/web-profiler-bundle": "6.3.*", + "symfony/phpunit-bridge": "6.4.*", + "symfony/runtime": "6.4.*", + "symfony/security-bundle": "6.4.*", + "symfony/serializer": "6.4.*", + "symfony/stopwatch": "6.4.*", + "symfony/translation": "6.4.*", + "symfony/twig-bundle": "6.4.*", + "symfony/uid": "6.4.*", + "symfony/var-dumper": "6.4.*", + "symfony/web-link": "6.4.*", + "symfony/web-profiler-bundle": "6.4.*", "symfony/webpack-encore-bundle": "^1.7", - "symfony/yaml": "6.3.*", + "symfony/yaml": "6.4.*", "twig/extra-bundle": "^3.3", "twig/markdown-extra": "^3.3", "twig/string-extra": "^3.3", @@ -50,8 +50,8 @@ "require-dev": { "phpstan/phpstan": "^1.10", "rector/rector": "^0.15.25", - "symfony/browser-kit": "6.3.*", - "symfony/css-selector": "6.3.*" + "symfony/browser-kit": "6.4.*", + "symfony/css-selector": "6.4.*" }, "config": { "preferred-install": { @@ -99,7 +99,7 @@ "extra": { "symfony": { "allow-contrib": false, - "require": "6.3.*" + "require": "6.4.*" } } } diff --git a/composer.lock b/composer.lock index da74dcef..79a863fb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "47d58333bdd6ed722b870c7b34f0f107", + "content-hash": "2bdf851cacea6a98db4e860916c2faa3", "packages": [ { "name": "composer/package-versions-deprecated", @@ -3513,16 +3513,16 @@ }, { "name": "symfony/asset", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/asset.git", - "reference": "a579e67adaa9586a007abd1b6faf97296eef08ec" + "reference": "2466c17d61d14539cddf77e57ebb9cc971185302" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/asset/zipball/a579e67adaa9586a007abd1b6faf97296eef08ec", - "reference": "a579e67adaa9586a007abd1b6faf97296eef08ec", + "url": "https://api.github.com/repos/symfony/asset/zipball/2466c17d61d14539cddf77e57ebb9cc971185302", + "reference": "2466c17d61d14539cddf77e57ebb9cc971185302", "shasum": "" }, "require": { @@ -3532,9 +3532,9 @@ "symfony/http-foundation": "<5.4" }, "require-dev": { - "symfony/http-client": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0" + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -3562,7 +3562,7 @@ "description": "Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/asset/tree/v6.3.12" + "source": "https://github.com/symfony/asset/tree/v6.4.13" }, "funding": [ { @@ -3578,20 +3578,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-10-25T15:07:50+00:00" }, { "name": "symfony/cache", - "version": "v6.3.12", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "d085eedf33550ce014230bc51fca8df726ed7ac5" + "reference": "70d60e9a3603108563010f8592dff15a6f15dfae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/d085eedf33550ce014230bc51fca8df726ed7ac5", - "reference": "d085eedf33550ce014230bc51fca8df726ed7ac5", + "url": "https://api.github.com/repos/symfony/cache/zipball/70d60e9a3603108563010f8592dff15a6f15dfae", + "reference": "70d60e9a3603108563010f8592dff15a6f15dfae", "shasum": "" }, "require": { @@ -3600,7 +3600,7 @@ "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3", - "symfony/var-exporter": "^6.3.6" + "symfony/var-exporter": "^6.3.6|^7.0" }, "conflict": { "doctrine/dbal": "<2.13.1", @@ -3618,12 +3618,12 @@ "doctrine/dbal": "^2.13.1|^3|^4", "predis/predis": "^1.1|^2.0", "psr/simple-cache": "^1.0|^2.0|^3.0", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/filesystem": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/messenger": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -3658,7 +3658,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.3.12" + "source": "https://github.com/symfony/cache/tree/v6.4.16" }, "funding": [ { @@ -3674,7 +3674,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:42:18+00:00" + "time": "2024-11-20T10:10:54+00:00" }, { "name": "symfony/cache-contracts", @@ -3754,21 +3754,22 @@ }, { "name": "symfony/clock", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/clock.git", - "reference": "b0fd66f03a9afb104a8def4e893fa96e1699c39b" + "reference": "b2bf55c4dd115003309eafa87ee7df9ed3dde81b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/clock/zipball/b0fd66f03a9afb104a8def4e893fa96e1699c39b", - "reference": "b0fd66f03a9afb104a8def4e893fa96e1699c39b", + "url": "https://api.github.com/repos/symfony/clock/zipball/b2bf55c4dd115003309eafa87ee7df9ed3dde81b", + "reference": "b2bf55c4dd115003309eafa87ee7df9ed3dde81b", "shasum": "" }, "require": { "php": ">=8.1", - "psr/clock": "^1.0" + "psr/clock": "^1.0", + "symfony/polyfill-php83": "^1.28" }, "provide": { "psr/clock-implementation": "1.0" @@ -3807,7 +3808,7 @@ "time" ], "support": { - "source": "https://github.com/symfony/clock/tree/v6.3.12" + "source": "https://github.com/symfony/clock/tree/v6.4.13" }, "funding": [ { @@ -3823,26 +3824,26 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/config", - "version": "v6.3.12", + "version": "v6.4.14", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "66b548223ec2569cc9f997f0dfbe8c3cfed9417e" + "reference": "4e55e7e4ffddd343671ea972216d4509f46c22ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/66b548223ec2569cc9f997f0dfbe8c3cfed9417e", - "reference": "66b548223ec2569cc9f997f0dfbe8c3cfed9417e", + "url": "https://api.github.com/repos/symfony/config/zipball/4e55e7e4ffddd343671ea972216d4509f46c22ef", + "reference": "4e55e7e4ffddd343671ea972216d4509f46c22ef", "shasum": "" }, "require": { "php": ">=8.1", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^5.4|^6.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -3850,11 +3851,11 @@ "symfony/service-contracts": "<2.5" }, "require-dev": { - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/messenger": "^5.4|^6.0", + "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/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0" + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -3882,7 +3883,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.3.12" + "source": "https://github.com/symfony/config/tree/v6.4.14" }, "funding": [ { @@ -3898,20 +3899,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-11-04T11:33:53+00:00" }, { "name": "symfony/console", - "version": "v6.3.12", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6f69929b2421cf733a5b791dde3c3a2cfa6340cd" + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6f69929b2421cf733a5b791dde3c3a2cfa6340cd", - "reference": "6f69929b2421cf733a5b791dde3c3a2cfa6340cd", + "url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04", + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04", "shasum": "" }, "require": { @@ -3919,7 +3920,7 @@ "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0" + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { "symfony/dependency-injection": "<5.4", @@ -3933,12 +3934,16 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -3972,7 +3977,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.3.12" + "source": "https://github.com/symfony/console/tree/v6.4.17" }, "funding": [ { @@ -3988,37 +3993,37 @@ "type": "tidelift" } ], - "time": "2024-01-23T16:21:43+00:00" + "time": "2024-12-07T12:07:30+00:00" }, { "name": "symfony/debug-bundle", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/debug-bundle.git", - "reference": "a7c57aecdb226c5293675e51c2fd6a7ed9a8a9a4" + "reference": "7bcfaff39e094cc09455201916d016d9b2ae08ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug-bundle/zipball/a7c57aecdb226c5293675e51c2fd6a7ed9a8a9a4", - "reference": "a7c57aecdb226c5293675e51c2fd6a7ed9a8a9a4", + "url": "https://api.github.com/repos/symfony/debug-bundle/zipball/7bcfaff39e094cc09455201916d016d9b2ae08ff", + "reference": "7bcfaff39e094cc09455201916d016d9b2ae08ff", "shasum": "" }, "require": { "ext-xml": "*", "php": ">=8.1", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/twig-bridge": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/twig-bridge": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "conflict": { "symfony/config": "<5.4", "symfony/dependency-injection": "<5.4" }, "require-dev": { - "symfony/config": "^5.4|^6.0", - "symfony/web-profiler-bundle": "^5.4|^6.0" + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/web-profiler-bundle": "^5.4|^6.0|^7.0" }, "type": "symfony-bundle", "autoload": { @@ -4046,7 +4051,7 @@ "description": "Provides a tight integration of the Symfony VarDumper component and the ServerLogCommand from MonologBridge into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug-bundle/tree/v6.3.12" + "source": "https://github.com/symfony/debug-bundle/tree/v6.4.13" }, "funding": [ { @@ -4062,20 +4067,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/dependency-injection", - "version": "v6.3.12", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "3ca6c70bef0644be86d5acd962f11a6a6aa9382d" + "reference": "7a379d8871f6a36f01559c14e11141cc02eb8dc8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/3ca6c70bef0644be86d5acd962f11a6a6aa9382d", - "reference": "3ca6c70bef0644be86d5acd962f11a6a6aa9382d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/7a379d8871f6a36f01559c14e11141cc02eb8dc8", + "reference": "7a379d8871f6a36f01559c14e11141cc02eb8dc8", "shasum": "" }, "require": { @@ -4083,7 +4088,7 @@ "psr/container": "^1.1|^2.0", "symfony/deprecation-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.2.10" + "symfony/var-exporter": "^6.2.10|^7.0" }, "conflict": { "ext-psr": "<1.1|>=2", @@ -4097,9 +4102,9 @@ "symfony/service-implementation": "1.1|2.0|3.0" }, "require-dev": { - "symfony/config": "^6.1", - "symfony/expression-language": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "symfony/config": "^6.1|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -4127,7 +4132,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.3.12" + "source": "https://github.com/symfony/dependency-injection/tree/v6.4.16" }, "funding": [ { @@ -4143,7 +4148,7 @@ "type": "tidelift" } ], - "time": "2024-01-30T08:17:33+00:00" + "time": "2024-11-25T14:52:46+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4214,21 +4219,21 @@ }, { "name": "symfony/doctrine-bridge", - "version": "v6.3.12", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "395b7bfd32b0f7700877c50ab1452f283c99878a" + "reference": "2ba7e747a944b69f9f583c35173560afebbff995" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/395b7bfd32b0f7700877c50ab1452f283c99878a", - "reference": "395b7bfd32b0f7700877c50ab1452f283c99878a", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/2ba7e747a944b69f9f583c35173560afebbff995", + "reference": "2ba7e747a944b69f9f583c35173560afebbff995", "shasum": "" }, "require": { "doctrine/event-manager": "^1.2|^2", - "doctrine/persistence": "^2|^3", + "doctrine/persistence": "^3.1", "php": ">=8.1", "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "~1.8", @@ -4236,47 +4241,45 @@ "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "doctrine/annotations": "<1.13.1", "doctrine/dbal": "<2.13.1", "doctrine/lexer": "<1.1", - "doctrine/orm": "<2.12", + "doctrine/orm": "<2.15", "symfony/cache": "<5.4", "symfony/dependency-injection": "<6.2", - "symfony/form": "<5.4.21|>=6,<6.2.7", + "symfony/form": "<5.4.38|>=6,<6.4.6|>=7,<7.0.6", "symfony/http-foundation": "<6.3", "symfony/http-kernel": "<6.2", "symfony/lock": "<6.3", "symfony/messenger": "<5.4", "symfony/property-info": "<5.4", "symfony/security-bundle": "<5.4", - "symfony/security-core": "<6.0", - "symfony/validator": "<5.4.25|>=6,<6.2.12|>=6.3,<6.3.1" + "symfony/security-core": "<6.4", + "symfony/validator": "<6.4" }, "require-dev": { - "doctrine/annotations": "^1.13.1|^2", "doctrine/collections": "^1.0|^2.0", - "doctrine/data-fixtures": "^1.1", + "doctrine/data-fixtures": "^1.1|^2", "doctrine/dbal": "^2.13.1|^3|^4", - "doctrine/orm": "^2.12|^3", + "doctrine/orm": "^2.15|^3", "psr/log": "^1|^2|^3", - "symfony/cache": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^6.2", - "symfony/doctrine-messenger": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/form": "^5.4.21|^6.2.7", - "symfony/http-kernel": "^6.3", - "symfony/lock": "^6.3", - "symfony/messenger": "^5.4|^6.0", - "symfony/property-access": "^5.4|^6.0", - "symfony/property-info": "^5.4|^6.0", - "symfony/proxy-manager-bridge": "^5.4|^6.0", - "symfony/security-core": "^6.0", - "symfony/stopwatch": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", - "symfony/uid": "^5.4|^6.0", - "symfony/validator": "^5.4.25|~6.2.12|^6.3.1", - "symfony/var-dumper": "^5.4|^6.0" + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^6.2|^7.0", + "symfony/doctrine-messenger": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/form": "^5.4.38|^6.4.6|^7.0.6", + "symfony/http-kernel": "^6.3|^7.0", + "symfony/lock": "^6.3|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/proxy-manager-bridge": "^6.4", + "symfony/security-core": "^6.4|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "symfony-bridge", "autoload": { @@ -4304,7 +4307,7 @@ "description": "Provides integration for Doctrine with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-bridge/tree/v6.3.12" + "source": "https://github.com/symfony/doctrine-bridge/tree/v6.4.17" }, "funding": [ { @@ -4320,20 +4323,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:42:18+00:00" + "time": "2024-12-18T10:42:42+00:00" }, { "name": "symfony/dotenv", - "version": "v6.3.12", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/dotenv.git", - "reference": "d9eaf699978601af5a50c26cbc4326158d9bd8b0" + "reference": "1ac5e7e7e862d4d574258daf08bd569ba926e4a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/d9eaf699978601af5a50c26cbc4326158d9bd8b0", - "reference": "d9eaf699978601af5a50c26cbc4326158d9bd8b0", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/1ac5e7e7e862d4d574258daf08bd569ba926e4a5", + "reference": "1ac5e7e7e862d4d574258daf08bd569ba926e4a5", "shasum": "" }, "require": { @@ -4344,8 +4347,8 @@ "symfony/process": "<5.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0" + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -4378,7 +4381,7 @@ "environment" ], "support": { - "source": "https://github.com/symfony/dotenv/tree/v6.3.12" + "source": "https://github.com/symfony/dotenv/tree/v6.4.16" }, "funding": [ { @@ -4394,34 +4397,35 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-11-27T11:08:19+00:00" }, { "name": "symfony/error-handler", - "version": "v6.3.12", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "93a8400a7eaaaf385b2d6f71e30e064baa639629" + "reference": "37ad2380e8c1a8cf62a1200a5c10080b679b446c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/93a8400a7eaaaf385b2d6f71e30e064baa639629", - "reference": "93a8400a7eaaaf385b2d6f71e30e064baa639629", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/37ad2380e8c1a8cf62a1200a5c10080b679b446c", + "reference": "37ad2380e8c1a8cf62a1200a5c10080b679b446c", "shasum": "" }, "require": { "php": ">=8.1", "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^5.4|^6.0" + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "conflict": { - "symfony/deprecation-contracts": "<2.5" + "symfony/deprecation-contracts": "<2.5", + "symfony/http-kernel": "<6.4" }, "require-dev": { "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0" + "symfony/http-kernel": "^6.4|^7.0", + "symfony/serializer": "^5.4|^6.0|^7.0" }, "bin": [ "Resources/bin/patch-type-declarations" @@ -4452,7 +4456,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.3.12" + "source": "https://github.com/symfony/error-handler/tree/v6.4.17" }, "funding": [ { @@ -4468,20 +4472,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-12-06T13:30:51+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "6e344ddd3c18c525b5e5a4e996f3debda48e3078" + "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/6e344ddd3c18c525b5e5a4e996f3debda48e3078", - "reference": "6e344ddd3c18c525b5e5a4e996f3debda48e3078", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", + "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", "shasum": "" }, "require": { @@ -4498,13 +4502,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^5.4|^6.0" + "symfony/stopwatch": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -4532,7 +4536,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.12" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.13" }, "funding": [ { @@ -4548,7 +4552,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -4628,21 +4632,21 @@ }, { "name": "symfony/expression-language", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", - "reference": "89f6dc6f1883c3dc3c31d418038966c9b1766617" + "reference": "3524904fb026356a5230cd197f9a4e6a61e0e7df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/89f6dc6f1883c3dc3c31d418038966c9b1766617", - "reference": "89f6dc6f1883c3dc3c31d418038966c9b1766617", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/3524904fb026356a5230cd197f9a4e6a61e0e7df", + "reference": "3524904fb026356a5230cd197f9a4e6a61e0e7df", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/cache": "^5.4|^6.0", + "symfony/cache": "^5.4|^6.0|^7.0", "symfony/deprecation-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3" }, @@ -4672,7 +4676,7 @@ "description": "Provides an engine that can compile and evaluate expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/expression-language/tree/v6.3.12" + "source": "https://github.com/symfony/expression-language/tree/v6.4.13" }, "funding": [ { @@ -4688,20 +4692,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-10-09T08:40:40+00:00" }, { "name": "symfony/filesystem", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "9f4b59b7906ccb0692d7565f98012fd1679eedfc" + "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/9f4b59b7906ccb0692d7565f98012fd1679eedfc", - "reference": "9f4b59b7906ccb0692d7565f98012fd1679eedfc", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/4856c9cf585d5a0313d8d35afd681a526f038dd3", + "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3", "shasum": "" }, "require": { @@ -4709,6 +4713,9 @@ "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, + "require-dev": { + "symfony/process": "^5.4|^6.4|^7.0" + }, "type": "library", "autoload": { "psr-4": { @@ -4735,7 +4742,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.3.12" + "source": "https://github.com/symfony/filesystem/tree/v6.4.13" }, "funding": [ { @@ -4751,27 +4758,27 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-10-25T15:07:50+00:00" }, { "name": "symfony/finder", - "version": "v6.3.5", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4" + "reference": "1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a1b31d88c0e998168ca7792f222cbecee47428c4", - "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4", + "url": "https://api.github.com/repos/symfony/finder/zipball/1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7", + "reference": "1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7", "shasum": "" }, "require": { "php": ">=8.1" }, "require-dev": { - "symfony/filesystem": "^6.0" + "symfony/filesystem": "^6.0|^7.0" }, "type": "library", "autoload": { @@ -4799,7 +4806,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.3.5" + "source": "https://github.com/symfony/finder/tree/v6.4.17" }, "funding": [ { @@ -4815,7 +4822,7 @@ "type": "tidelift" } ], - "time": "2023-09-26T12:56:25+00:00" + "time": "2024-12-29T13:51:37+00:00" }, { "name": "symfony/flex", @@ -4887,27 +4894,27 @@ }, { "name": "symfony/form", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "bf78d0298e2bc6313063bdc1e6d85d5e05e1dc88" + "reference": "0fe17f90af23908ddc11dc23507db98e66572046" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/bf78d0298e2bc6313063bdc1e6d85d5e05e1dc88", - "reference": "bf78d0298e2bc6313063bdc1e6d85d5e05e1dc88", + "url": "https://api.github.com/repos/symfony/form/zipball/0fe17f90af23908ddc11dc23507db98e66572046", + "reference": "0fe17f90af23908ddc11dc23507db98e66572046", "shasum": "" }, "require": { "php": ">=8.1", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/options-resolver": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/options-resolver": "^5.4|^6.0|^7.0", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-icu": "^1.21", "symfony/polyfill-mbstring": "~1.0", - "symfony/property-access": "^5.4|^6.0", + "symfony/property-access": "^5.4|^6.0|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -4917,26 +4924,26 @@ "symfony/error-handler": "<5.4", "symfony/framework-bundle": "<5.4", "symfony/http-kernel": "<5.4", - "symfony/translation": "<5.4.35|>=6.0,<6.3.12|>=6.4,<6.4.3", + "symfony/translation": "<5.4.35|>=6.0,<6.3.12|>=6.4,<6.4.3|>=7.0,<7.0.3", "symfony/translation-contracts": "<2.5", "symfony/twig-bridge": "<6.3" }, "require-dev": { "doctrine/collections": "^1.0|^2.0", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/html-sanitizer": "^6.1", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/intl": "^5.4|^6.0", - "symfony/security-core": "^6.2", - "symfony/security-csrf": "^5.4|^6.0", - "symfony/translation": "^5.4.35|~6.3.12|^6.4.3", - "symfony/uid": "^5.4|^6.0", - "symfony/validator": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "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/expression-language": "^5.4|^6.0|^7.0", + "symfony/html-sanitizer": "^6.1|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/intl": "^5.4|^6.0|^7.0", + "symfony/security-core": "^6.2|^7.0", + "symfony/security-csrf": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4.35|~6.3.12|^6.4.3|^7.0.3", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -4964,7 +4971,7 @@ "description": "Allows to easily create, process and reuse HTML forms", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/form/tree/v6.3.12" + "source": "https://github.com/symfony/form/tree/v6.4.13" }, "funding": [ { @@ -4980,38 +4987,38 @@ "type": "tidelift" } ], - "time": "2024-01-23T16:21:43+00:00" + "time": "2024-10-09T08:40:40+00:00" }, { "name": "symfony/framework-bundle", - "version": "v6.3.12", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "e144e3757296bed367ec3b764d8438891af75f78" + "reference": "17d8ae2e7aa77154f942e8ac48849ac718b0963f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/e144e3757296bed367ec3b764d8438891af75f78", - "reference": "e144e3757296bed367ec3b764d8438891af75f78", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/17d8ae2e7aa77154f942e8ac48849ac718b0963f", + "reference": "17d8ae2e7aa77154f942e8ac48849ac718b0963f", "shasum": "" }, "require": { "composer-runtime-api": ">=2.1", "ext-xml": "*", "php": ">=8.1", - "symfony/cache": "^5.4|^6.0", - "symfony/config": "^6.1", - "symfony/dependency-injection": "^6.3.1", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/config": "^6.1|^7.0", + "symfony/dependency-injection": "^6.4.12|^7.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/error-handler": "^6.1", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/filesystem": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/http-foundation": "^6.3", - "symfony/http-kernel": "^6.3", + "symfony/error-handler": "^6.1|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4", "symfony/polyfill-mbstring": "~1.0", - "symfony/routing": "^5.4|^6.0" + "symfony/routing": "^6.4|^7.0" }, "conflict": { "doctrine/annotations": "<1.13.1", @@ -5019,68 +5026,73 @@ "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/asset": "<5.4", + "symfony/asset-mapper": "<6.4", "symfony/clock": "<6.3", "symfony/console": "<5.4|>=7.0", - "symfony/dom-crawler": "<6.3", + "symfony/dom-crawler": "<6.4", "symfony/dotenv": "<5.4", "symfony/form": "<5.4", "symfony/http-client": "<6.3", "symfony/lock": "<5.4", "symfony/mailer": "<5.4", "symfony/messenger": "<6.3", - "symfony/mime": "<6.2", + "symfony/mime": "<6.4", "symfony/property-access": "<5.4", "symfony/property-info": "<5.4", + "symfony/runtime": "<5.4.45|>=6.0,<6.4.13|>=7.0,<7.1.6", + "symfony/scheduler": "<6.4.4|>=7.0.0,<7.0.4", "symfony/security-core": "<5.4", "symfony/security-csrf": "<5.4", - "symfony/serializer": "<6.3", + "symfony/serializer": "<6.4", "symfony/stopwatch": "<5.4", - "symfony/translation": "<6.2.8", + "symfony/translation": "<6.4", "symfony/twig-bridge": "<5.4", "symfony/twig-bundle": "<5.4", - "symfony/validator": "<6.3", - "symfony/web-profiler-bundle": "<5.4", - "symfony/workflow": "<5.4" + "symfony/validator": "<6.4", + "symfony/web-profiler-bundle": "<6.4", + "symfony/workflow": "<6.4" }, "require-dev": { "doctrine/annotations": "^1.13.1|^2", "doctrine/persistence": "^1.3|^2|^3", + "dragonmantank/cron-expression": "^3.1", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/asset": "^5.4|^6.0", - "symfony/asset-mapper": "^6.3", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/clock": "^6.2", - "symfony/console": "^5.4.9|^6.0.9", - "symfony/css-selector": "^5.4|^6.0", - "symfony/dom-crawler": "^6.3", - "symfony/dotenv": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/form": "^5.4|^6.0", - "symfony/html-sanitizer": "^6.1", - "symfony/http-client": "^6.3", - "symfony/lock": "^5.4|^6.0", - "symfony/mailer": "^5.4|^6.0", - "symfony/messenger": "^6.3", - "symfony/mime": "^6.2", - "symfony/notifier": "^5.4|^6.0", + "seld/jsonlint": "^1.10", + "symfony/asset": "^5.4|^6.0|^7.0", + "symfony/asset-mapper": "^6.4|^7.0", + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/clock": "^6.2|^7.0", + "symfony/console": "^5.4.9|^6.0.9|^7.0", + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/dom-crawler": "^6.4|^7.0", + "symfony/dotenv": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/form": "^5.4|^6.0|^7.0", + "symfony/html-sanitizer": "^6.1|^7.0", + "symfony/http-client": "^6.3|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/mailer": "^5.4|^6.0|^7.0", + "symfony/messenger": "^6.3|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/notifier": "^5.4|^6.0|^7.0", "symfony/polyfill-intl-icu": "~1.0", - "symfony/process": "^5.4|^6.0", - "symfony/property-info": "^5.4|^6.0", - "symfony/rate-limiter": "^5.4|^6.0", - "symfony/scheduler": "^6.3", - "symfony/security-bundle": "^5.4|^6.0", - "symfony/semaphore": "^5.4|^6.0", - "symfony/serializer": "^6.3", - "symfony/stopwatch": "^5.4|^6.0", - "symfony/string": "^5.4|^6.0", - "symfony/translation": "^6.2.8", - "symfony/twig-bundle": "^5.4|^6.0", - "symfony/uid": "^5.4|^6.0", - "symfony/validator": "^6.3", - "symfony/web-link": "^5.4|^6.0", - "symfony/workflow": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0", - "twig/twig": "^2.10|^3.0" + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/rate-limiter": "^5.4|^6.0|^7.0", + "symfony/scheduler": "^6.4.4|^7.0.4", + "symfony/security-bundle": "^5.4|^6.0|^7.0", + "symfony/semaphore": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/string": "^5.4|^6.0|^7.0", + "symfony/translation": "^6.4|^7.0", + "symfony/twig-bundle": "^5.4|^6.0|^7.0", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/web-link": "^5.4|^6.0|^7.0", + "symfony/workflow": "^6.4|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0", + "twig/twig": "^2.10|^3.0.4" }, "type": "symfony-bundle", "autoload": { @@ -5108,7 +5120,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v6.3.12" + "source": "https://github.com/symfony/framework-bundle/tree/v6.4.17" }, "funding": [ { @@ -5124,27 +5136,27 @@ "type": "tidelift" } ], - "time": "2024-01-23T16:21:43+00:00" + "time": "2024-12-19T14:08:41+00:00" }, { "name": "symfony/http-client", - "version": "v6.3.12", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "510c51058dbef5db7d49c704954f32d6527d17f8" + "reference": "88898d842eb29d7e1a903724c94e90a6ca9c0509" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/510c51058dbef5db7d49c704954f32d6527d17f8", - "reference": "510c51058dbef5db7d49c704954f32d6527d17f8", + "url": "https://api.github.com/repos/symfony/http-client/zipball/88898d842eb29d7e1a903724c94e90a6ca9c0509", + "reference": "88898d842eb29d7e1a903724c94e90a6ca9c0509", "shasum": "" }, "require": { "php": ">=8.1", "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "^3", + "symfony/http-client-contracts": "~3.4.4|^3.5.2", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -5162,14 +5174,15 @@ "amphp/http-client": "^4.2.1", "amphp/http-tunnel": "^1.0", "amphp/socket": "^1.1", - "guzzlehttp/promises": "^1.4", + "guzzlehttp/promises": "^1.4|^2.0", "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", "psr/http-client": "^1.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/stopwatch": "^5.4|^6.0" + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -5200,7 +5213,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.3.12" + "source": "https://github.com/symfony/http-client/tree/v6.4.17" }, "funding": [ { @@ -5216,7 +5229,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T14:46:07+00:00" + "time": "2024-12-18T12:18:31+00:00" }, { "name": "symfony/http-client-contracts", @@ -5298,16 +5311,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.3.12", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "3b72add708d48e8c08f7152df2d0b8d5303408fa" + "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3b72add708d48e8c08f7152df2d0b8d5303408fa", - "reference": "3b72add708d48e8c08f7152df2d0b8d5303408fa", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/431771b7a6f662f1575b3cfc8fd7617aa9864d57", + "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57", "shasum": "" }, "require": { @@ -5317,17 +5330,17 @@ "symfony/polyfill-php83": "^1.27" }, "conflict": { - "symfony/cache": "<6.3" + "symfony/cache": "<6.4.12|>=7.0,<7.1.5" }, "require-dev": { "doctrine/dbal": "^2.13.1|^3|^4", "predis/predis": "^1.1|^2.0", - "symfony/cache": "^6.3", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", - "symfony/mime": "^5.4|^6.0", - "symfony/rate-limiter": "^5.2|^6.0" + "symfony/cache": "^6.4.12|^7.1.5", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4|^7.0", + "symfony/mime": "^5.4|^6.0|^7.0", + "symfony/rate-limiter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -5355,7 +5368,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.3.12" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.16" }, "funding": [ { @@ -5371,29 +5384,29 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-11-13T18:58:10+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.3.12", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "f7d160e46a6e0d3183e7a3846d4e3b4d04d5898b" + "reference": "c5647393c5ce11833d13e4b70fff4b571d4ac710" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f7d160e46a6e0d3183e7a3846d4e3b4d04d5898b", - "reference": "f7d160e46a6e0d3183e7a3846d4e3b4d04d5898b", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c5647393c5ce11833d13e4b70fff4b571d4ac710", + "reference": "c5647393c5ce11833d13e4b70fff4b571d4ac710", "shasum": "" }, "require": { "php": ">=8.1", "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/error-handler": "^6.3", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-foundation": "^6.3.4", + "symfony/error-handler": "^6.4|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -5401,7 +5414,7 @@ "symfony/cache": "<5.4", "symfony/config": "<6.1", "symfony/console": "<5.4", - "symfony/dependency-injection": "<6.3.4", + "symfony/dependency-injection": "<6.4", "symfony/doctrine-bridge": "<5.4", "symfony/form": "<5.4", "symfony/http-client": "<5.4", @@ -5411,7 +5424,7 @@ "symfony/translation": "<5.4", "symfony/translation-contracts": "<2.5", "symfony/twig-bridge": "<5.4", - "symfony/validator": "<5.4", + "symfony/validator": "<6.4", "symfony/var-dumper": "<6.3", "twig/twig": "<2.13" }, @@ -5420,26 +5433,27 @@ }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/clock": "^6.2", - "symfony/config": "^6.1", - "symfony/console": "^5.4|^6.0", - "symfony/css-selector": "^5.4|^6.0", - "symfony/dependency-injection": "^6.3.4", - "symfony/dom-crawler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/clock": "^6.2|^7.0", + "symfony/config": "^6.1|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/dom-crawler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", "symfony/http-client-contracts": "^2.5|^3", - "symfony/process": "^5.4|^6.0", - "symfony/property-access": "^5.4.5|^6.0.5", - "symfony/routing": "^5.4|^6.0", - "symfony/serializer": "^6.3", - "symfony/stopwatch": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4.5|^6.0.5|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.4.4|^7.0.4", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", "symfony/translation-contracts": "^2.5|^3", - "symfony/uid": "^5.4|^6.0", - "symfony/validator": "^6.3", - "symfony/var-exporter": "^6.2", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/var-dumper": "^5.4|^6.4|^7.0", + "symfony/var-exporter": "^6.2|^7.0", "twig/twig": "^2.13|^3.0.4" }, "type": "library", @@ -5468,7 +5482,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.3.12" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.17" }, "funding": [ { @@ -5484,48 +5498,48 @@ "type": "tidelift" } ], - "time": "2024-01-30T20:05:26+00:00" + "time": "2024-12-31T14:49:31+00:00" }, { "name": "symfony/maker-bundle", - "version": "v1.53.0", + "version": "v1.62.1", "source": { "type": "git", "url": "https://github.com/symfony/maker-bundle.git", - "reference": "8d2f3f96704766837548d177fe3ae39ae94822d9" + "reference": "468ff2708200c95ebc0d85d3174b6c6711b8a590" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/8d2f3f96704766837548d177fe3ae39ae94822d9", - "reference": "8d2f3f96704766837548d177fe3ae39ae94822d9", + "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/468ff2708200c95ebc0d85d3174b6c6711b8a590", + "reference": "468ff2708200c95ebc0d85d3174b6c6711b8a590", "shasum": "" }, "require": { "doctrine/inflector": "^2.0", "nikic/php-parser": "^4.18|^5.0", "php": ">=8.1", - "symfony/config": "^6.3|^7.0", - "symfony/console": "^6.3|^7.0", - "symfony/dependency-injection": "^6.3|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", "symfony/deprecation-contracts": "^2.2|^3", - "symfony/filesystem": "^6.3|^7.0", - "symfony/finder": "^6.3|^7.0", - "symfony/framework-bundle": "^6.3|^7.0", - "symfony/http-kernel": "^6.3|^7.0", - "symfony/process": "^6.3|^7.0" + "symfony/filesystem": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/framework-bundle": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0" }, "conflict": { - "doctrine/doctrine-bundle": "<2.4", - "doctrine/orm": "<2.10" + "doctrine/doctrine-bundle": "<2.10", + "doctrine/orm": "<2.15" }, "require-dev": { "composer/semver": "^3.0", "doctrine/doctrine-bundle": "^2.5.0", - "doctrine/orm": "^2.10.0", - "symfony/http-client": "^6.3|^7.0", - "symfony/phpunit-bridge": "^6.3|^7.0", - "symfony/security-core": "^6.3|^7.0", - "symfony/yaml": "^6.3|^7.0", + "doctrine/orm": "^2.15|^3", + "symfony/http-client": "^6.4|^7.0", + "symfony/phpunit-bridge": "^6.4.1|^7.0", + "symfony/security-core": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0", "twig/twig": "^3.0|^4.x-dev" }, "type": "symfony-bundle", @@ -5560,7 +5574,7 @@ ], "support": { "issues": "https://github.com/symfony/maker-bundle/issues", - "source": "https://github.com/symfony/maker-bundle/tree/v1.53.0" + "source": "https://github.com/symfony/maker-bundle/tree/v1.62.1" }, "funding": [ { @@ -5576,20 +5590,20 @@ "type": "tidelift" } ], - "time": "2024-02-01T10:05:38+00:00" + "time": "2025-01-15T00:21:40+00:00" }, { "name": "symfony/mime", - "version": "v6.3.12", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "4b24dcaf8dfcd23fb7abb5b9df11e8c8093db68a" + "reference": "ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/4b24dcaf8dfcd23fb7abb5b9df11e8c8093db68a", - "reference": "4b24dcaf8dfcd23fb7abb5b9df11e8c8093db68a", + "url": "https://api.github.com/repos/symfony/mime/zipball/ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232", + "reference": "ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232", "shasum": "" }, "require": { @@ -5603,16 +5617,17 @@ "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<5.4", - "symfony/serializer": "<6.3.12|>=6.4,<6.4.3" + "symfony/serializer": "<6.4.3|>7.0,<7.0.3" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", "league/html-to-markdown": "^5.0", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/property-access": "^5.4|^6.0", - "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "~6.3.12|^6.4.3" + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.4|^7.0", + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.4.3|^7.0.3" }, "type": "library", "autoload": { @@ -5644,7 +5659,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.3.12" + "source": "https://github.com/symfony/mime/tree/v6.4.17" }, "funding": [ { @@ -5660,41 +5675,42 @@ "type": "tidelift" } ], - "time": "2024-01-30T08:17:33+00:00" + "time": "2024-12-02T11:09:41+00:00" }, { "name": "symfony/monolog-bridge", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bridge.git", - "reference": "b655801218307a85cc0ebb853ac289446db3084a" + "reference": "9d14621e59f22c2b6d030d92d37ffe5ae1e60452" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/b655801218307a85cc0ebb853ac289446db3084a", - "reference": "b655801218307a85cc0ebb853ac289446db3084a", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/9d14621e59f22c2b6d030d92d37ffe5ae1e60452", + "reference": "9d14621e59f22c2b6d030d92d37ffe5ae1e60452", "shasum": "" }, "require": { "monolog/monolog": "^1.25.1|^2|^3", "php": ">=8.1", - "symfony/http-kernel": "^5.4|^6.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-kernel": "^5.4|^6.0|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { "symfony/console": "<5.4", "symfony/http-foundation": "<5.4", - "symfony/security-core": "<6.0" + "symfony/security-core": "<5.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/mailer": "^5.4|^6.0", - "symfony/messenger": "^5.4|^6.0", - "symfony/mime": "^5.4|^6.0", - "symfony/security-core": "^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/mailer": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/mime": "^5.4|^6.0|^7.0", + "symfony/security-core": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "symfony-bridge", "autoload": { @@ -5722,7 +5738,7 @@ "description": "Provides integration for Monolog with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/monolog-bridge/tree/v6.3.12" + "source": "https://github.com/symfony/monolog-bridge/tree/v6.4.13" }, "funding": [ { @@ -5738,7 +5754,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T14:47:00+00:00" + "time": "2024-10-14T08:49:08+00:00" }, { "name": "symfony/monolog-bundle", @@ -5823,16 +5839,16 @@ }, { "name": "symfony/options-resolver", - "version": "v6.3.0", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd" + "reference": "368128ad168f20e22c32159b9f761e456cec0c78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd", - "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/368128ad168f20e22c32159b9f761e456cec0c78", + "reference": "368128ad168f20e22c32159b9f761e456cec0c78", "shasum": "" }, "require": { @@ -5870,7 +5886,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.3.0" + "source": "https://github.com/symfony/options-resolver/tree/v6.4.16" }, "funding": [ { @@ -5886,20 +5902,20 @@ "type": "tidelift" } ], - "time": "2023-05-12T14:21:09+00:00" + "time": "2024-11-20T10:57:02+00:00" }, { "name": "symfony/password-hasher", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/password-hasher.git", - "reference": "513140986f5d6ca1b1ef86f47166a36654571bfe" + "reference": "e97a1b31f60b8bdfc1fdedab4398538da9441d47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/password-hasher/zipball/513140986f5d6ca1b1ef86f47166a36654571bfe", - "reference": "513140986f5d6ca1b1ef86f47166a36654571bfe", + "url": "https://api.github.com/repos/symfony/password-hasher/zipball/e97a1b31f60b8bdfc1fdedab4398538da9441d47", + "reference": "e97a1b31f60b8bdfc1fdedab4398538da9441d47", "shasum": "" }, "require": { @@ -5909,8 +5925,8 @@ "symfony/security-core": "<5.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0", - "symfony/security-core": "^5.4|^6.0" + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/security-core": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -5942,7 +5958,7 @@ "password" ], "support": { - "source": "https://github.com/symfony/password-hasher/tree/v6.3.12" + "source": "https://github.com/symfony/password-hasher/tree/v6.4.13" }, "funding": [ { @@ -5958,20 +5974,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v6.3.12", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "9e480445d8bb5f343870a1cba45e15a54cb3d83c" + "reference": "cebafe2f1ad2d1e745c1015b7c2519592341e4e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/9e480445d8bb5f343870a1cba45e15a54cb3d83c", - "reference": "9e480445d8bb5f343870a1cba45e15a54cb3d83c", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/cebafe2f1ad2d1e745c1015b7c2519592341e4e6", + "reference": "cebafe2f1ad2d1e745c1015b7c2519592341e4e6", "shasum": "" }, "require": { @@ -5982,7 +5998,7 @@ }, "require-dev": { "symfony/deprecation-contracts": "^2.5|^3.0", - "symfony/error-handler": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", "symfony/polyfill-php81": "^1.27" }, "bin": [ @@ -6003,7 +6019,8 @@ "Symfony\\Bridge\\PhpUnit\\": "" }, "exclude-from-classmap": [ - "/Tests/" + "/Tests/", + "/bin/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -6023,7 +6040,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v6.3.12" + "source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.16" }, "funding": [ { @@ -6039,7 +6056,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-11-13T15:06:22+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -6825,16 +6842,16 @@ }, { "name": "symfony/process", - "version": "v6.3.12", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "6c5eceb88510fc6ccd7044f2bacb21a3c0993882" + "reference": "3cb242f059c14ae08591c5c4087d1fe443564392" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/6c5eceb88510fc6ccd7044f2bacb21a3c0993882", - "reference": "6c5eceb88510fc6ccd7044f2bacb21a3c0993882", + "url": "https://api.github.com/repos/symfony/process/zipball/3cb242f059c14ae08591c5c4087d1fe443564392", + "reference": "3cb242f059c14ae08591c5c4087d1fe443564392", "shasum": "" }, "require": { @@ -6866,7 +6883,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.3.12" + "source": "https://github.com/symfony/process/tree/v6.4.15" }, "funding": [ { @@ -6882,29 +6899,29 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-11-06T14:19:14+00:00" }, { "name": "symfony/property-access", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "bbf7228ce2673538e1502cf1613d84ecfe8548d0" + "reference": "8cc779d88d12e440adaa26387bcfc25744064afe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/bbf7228ce2673538e1502cf1613d84ecfe8548d0", - "reference": "bbf7228ce2673538e1502cf1613d84ecfe8548d0", + "url": "https://api.github.com/repos/symfony/property-access/zipball/8cc779d88d12e440adaa26387bcfc25744064afe", + "reference": "8cc779d88d12e440adaa26387bcfc25744064afe", "shasum": "" }, "require": { "php": ">=8.1", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/property-info": "^5.4|^6.0" + "symfony/property-info": "^5.4|^6.0|^7.0" }, "require-dev": { - "symfony/cache": "^5.4|^6.0" + "symfony/cache": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -6943,7 +6960,7 @@ "reflection" ], "support": { - "source": "https://github.com/symfony/property-access/tree/v6.3.12" + "source": "https://github.com/symfony/property-access/tree/v6.4.13" }, "funding": [ { @@ -6959,38 +6976,39 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/property-info", - "version": "v6.3.12", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "ad9640f115b090503d52e8c8d5029e6041a40ccb" + "reference": "38b125d78e67668159f75383a293ec0c5d3f2963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/ad9640f115b090503d52e8c8d5029e6041a40ccb", - "reference": "ad9640f115b090503d52e8c8d5029e6041a40ccb", + "url": "https://api.github.com/repos/symfony/property-info/zipball/38b125d78e67668159f75383a293ec0c5d3f2963", + "reference": "38b125d78e67668159f75383a293ec0c5d3f2963", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/string": "^5.4|^6.0" + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { + "doctrine/annotations": "<1.12", "phpdocumentor/reflection-docblock": "<5.2", "phpdocumentor/type-resolver": "<1.5.1", - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<5.4|>=6.0,<6.4" }, "require-dev": { - "doctrine/annotations": "^1.10.4|^2", + "doctrine/annotations": "^1.12|^2", "phpdocumentor/reflection-docblock": "^5.2", - "phpstan/phpdoc-parser": "^1.0", - "symfony/cache": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0" + "phpstan/phpdoc-parser": "^1.0|^2.0", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/serializer": "^5.4|^6.4|^7.0" }, "type": "library", "autoload": { @@ -7026,7 +7044,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v6.3.12" + "source": "https://github.com/symfony/property-info/tree/v6.4.17" }, "funding": [ { @@ -7042,20 +7060,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T16:21:43+00:00" + "time": "2024-12-26T19:01:29+00:00" }, { "name": "symfony/routing", - "version": "v6.3.12", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "c7a3dcdd44d14022bf0d9d27f14a7b238f7e3e85" + "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/c7a3dcdd44d14022bf0d9d27f14a7b238f7e3e85", - "reference": "c7a3dcdd44d14022bf0d9d27f14a7b238f7e3e85", + "url": "https://api.github.com/repos/symfony/routing/zipball/91e02e606b4b705c2f4fb42f7e7708b7923a3220", + "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220", "shasum": "" }, "require": { @@ -7071,11 +7089,11 @@ "require-dev": { "doctrine/annotations": "^1.12|^2", "psr/log": "^1|^2|^3", - "symfony/config": "^6.2", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "symfony/config": "^6.2|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -7109,7 +7127,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.3.12" + "source": "https://github.com/symfony/routing/tree/v6.4.16" }, "funding": [ { @@ -7125,20 +7143,20 @@ "type": "tidelift" } ], - "time": "2024-01-30T13:17:59+00:00" + "time": "2024-11-13T15:31:34+00:00" }, { "name": "symfony/runtime", - "version": "v6.3.12", + "version": "v6.4.14", "source": { "type": "git", "url": "https://github.com/symfony/runtime.git", - "reference": "a8d2b8f6033a33c224b43065a10bab5e4f0be486" + "reference": "4facd4174f45cd37c65860403412b67c7381136a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/runtime/zipball/a8d2b8f6033a33c224b43065a10bab5e4f0be486", - "reference": "a8d2b8f6033a33c224b43065a10bab5e4f0be486", + "url": "https://api.github.com/repos/symfony/runtime/zipball/4facd4174f45cd37c65860403412b67c7381136a", + "reference": "4facd4174f45cd37c65860403412b67c7381136a", "shasum": "" }, "require": { @@ -7150,10 +7168,10 @@ }, "require-dev": { "composer/composer": "^1.0.2|^2.0", - "symfony/console": "^5.4.9|^6.0.9", - "symfony/dotenv": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0" + "symfony/console": "^5.4.9|^6.0.9|^7.0", + "symfony/dotenv": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0" }, "type": "composer-plugin", "extra": { @@ -7188,7 +7206,7 @@ "runtime" ], "support": { - "source": "https://github.com/symfony/runtime/tree/v6.3.12" + "source": "https://github.com/symfony/runtime/tree/v6.4.14" }, "funding": [ { @@ -7204,67 +7222,68 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-11-05T16:39:55+00:00" }, { "name": "symfony/security-bundle", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "60eeacf3bbcbc830919824fbacaf6a9c0ecd0244" + "reference": "181d1fcf5f88ef8212ed7f6434e5ff51c9d7dff3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/60eeacf3bbcbc830919824fbacaf6a9c0ecd0244", - "reference": "60eeacf3bbcbc830919824fbacaf6a9c0ecd0244", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/181d1fcf5f88ef8212ed7f6434e5ff51c9d7dff3", + "reference": "181d1fcf5f88ef8212ed7f6434e5ff51c9d7dff3", "shasum": "" }, "require": { "composer-runtime-api": ">=2.1", "ext-xml": "*", "php": ">=8.1", - "symfony/clock": "^6.3", - "symfony/config": "^6.1", - "symfony/dependency-injection": "^6.2", + "symfony/clock": "^6.3|^7.0", + "symfony/config": "^6.1|^7.0", + "symfony/dependency-injection": "^6.4.11|^7.1.4", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-foundation": "^6.2", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.2|^7.0", "symfony/http-kernel": "^6.2", - "symfony/password-hasher": "^5.4|^6.0", - "symfony/security-core": "^6.2", - "symfony/security-csrf": "^5.4|^6.0", - "symfony/security-http": "^6.3.6", + "symfony/password-hasher": "^5.4|^6.0|^7.0", + "symfony/security-core": "^6.2|^7.0", + "symfony/security-csrf": "^5.4|^6.0|^7.0", + "symfony/security-http": "^6.3.6|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { "symfony/browser-kit": "<5.4", "symfony/console": "<5.4", - "symfony/framework-bundle": "<6.3", + "symfony/framework-bundle": "<6.4", "symfony/http-client": "<5.4", "symfony/ldap": "<5.4", - "symfony/twig-bundle": "<5.4" + "symfony/serializer": "<6.4", + "symfony/twig-bundle": "<5.4", + "symfony/validator": "<6.4" }, "require-dev": { - "doctrine/annotations": "^1.10.4|^2", - "symfony/asset": "^5.4|^6.0", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/css-selector": "^5.4|^6.0", - "symfony/dom-crawler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/form": "^5.4|^6.0", - "symfony/framework-bundle": "^6.3", - "symfony/http-client": "^5.4|^6.0", - "symfony/ldap": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/rate-limiter": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", - "symfony/twig-bridge": "^5.4|^6.0", - "symfony/twig-bundle": "^5.4|^6.0", - "symfony/validator": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0", + "symfony/asset": "^5.4|^6.0|^7.0", + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/dom-crawler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/form": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^6.4|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/ldap": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/rate-limiter": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/twig-bridge": "^5.4|^6.0|^7.0", + "symfony/twig-bundle": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0", "twig/twig": "^2.13|^3.0.4", "web-token/jwt-checker": "^3.1", "web-token/jwt-signature-algorithm-ecdsa": "^3.1", @@ -7299,7 +7318,7 @@ "description": "Provides a tight integration of the Security component into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-bundle/tree/v6.3.12" + "source": "https://github.com/symfony/security-bundle/tree/v6.4.13" }, "funding": [ { @@ -7315,27 +7334,27 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:42:18+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/security-core", - "version": "v6.3.12", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/security-core.git", - "reference": "a2e6a338aaf4efec722839ec49f88eed2d752f92" + "reference": "19cdb7de86e556202ab16e0cffd1a97348231bc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/a2e6a338aaf4efec722839ec49f88eed2d752f92", - "reference": "a2e6a338aaf4efec722839ec49f88eed2d752f92", + "url": "https://api.github.com/repos/symfony/security-core/zipball/19cdb7de86e556202ab16e0cffd1a97348231bc0", + "reference": "19cdb7de86e556202ab16e0cffd1a97348231bc0", "shasum": "" }, "require": { "php": ">=8.1", "symfony/deprecation-contracts": "^2.5|^3", "symfony/event-dispatcher-contracts": "^2.5|^3", - "symfony/password-hasher": "^5.4|^6.0", + "symfony/password-hasher": "^5.4|^6.0|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -7343,21 +7362,21 @@ "symfony/http-foundation": "<5.4", "symfony/ldap": "<5.4", "symfony/security-guard": "<5.4", - "symfony/translation": "<5.4.35|>=6.0,<6.3.12|>=6.4,<6.4.3", + "symfony/translation": "<5.4.35|>=6.0,<6.3.12|>=6.4,<6.4.3|>=7.0,<7.0.3", "symfony/validator": "<5.4" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", "psr/container": "^1.1|^2.0", "psr/log": "^1|^2|^3", - "symfony/cache": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/ldap": "^5.4|^6.0", - "symfony/string": "^5.4|^6.0", - "symfony/translation": "^5.4.35|~6.3.12|^6.4.3", - "symfony/validator": "^5.4|^6.0" + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/ldap": "^5.4|^6.0|^7.0", + "symfony/string": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4.35|~6.3.12|^6.4.3|^7.0.3", + "symfony/validator": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -7385,7 +7404,7 @@ "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-core/tree/v6.3.12" + "source": "https://github.com/symfony/security-core/tree/v6.4.16" }, "funding": [ { @@ -7401,31 +7420,31 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:42:18+00:00" + "time": "2024-11-27T09:48:51+00:00" }, { "name": "symfony/security-csrf", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/security-csrf.git", - "reference": "7d6ba797b8523da6d2e5b59994e7a73d305ce4b5" + "reference": "c34421b7d34efbaef5d611ab2e646a0ec464ffe3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-csrf/zipball/7d6ba797b8523da6d2e5b59994e7a73d305ce4b5", - "reference": "7d6ba797b8523da6d2e5b59994e7a73d305ce4b5", + "url": "https://api.github.com/repos/symfony/security-csrf/zipball/c34421b7d34efbaef5d611ab2e646a0ec464ffe3", + "reference": "c34421b7d34efbaef5d611ab2e646a0ec464ffe3", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/security-core": "^5.4|^6.0" + "symfony/security-core": "^5.4|^6.0|^7.0" }, "conflict": { "symfony/http-foundation": "<5.4" }, "require-dev": { - "symfony/http-foundation": "^5.4|^6.0" + "symfony/http-foundation": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -7453,7 +7472,7 @@ "description": "Symfony Security Component - CSRF Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-csrf/tree/v6.3.12" + "source": "https://github.com/symfony/security-csrf/tree/v6.4.13" }, "funding": [ { @@ -7469,30 +7488,30 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/security-http", - "version": "v6.3.12", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/security-http.git", - "reference": "09eb813655cd9b1f679f4d984721633e9a0bab60" + "reference": "ded1e078f952e686b058d9eac98e497bea47b308" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-http/zipball/09eb813655cd9b1f679f4d984721633e9a0bab60", - "reference": "09eb813655cd9b1f679f4d984721633e9a0bab60", + "url": "https://api.github.com/repos/symfony/security-http/zipball/ded1e078f952e686b058d9eac98e497bea47b308", + "reference": "ded1e078f952e686b058d9eac98e497bea47b308", "shasum": "" }, "require": { "php": ">=8.1", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/http-kernel": "^6.3", + "symfony/http-foundation": "^6.2|^7.0", + "symfony/http-kernel": "^6.3|^7.0", "symfony/polyfill-mbstring": "~1.0", - "symfony/property-access": "^5.4|^6.0", - "symfony/security-core": "^6.3", + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/security-core": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -7504,14 +7523,14 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/cache": "^5.4|^6.0", - "symfony/clock": "^6.3", - "symfony/expression-language": "^5.4|^6.0", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/clock": "^6.3|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", "symfony/http-client-contracts": "^3.0", - "symfony/rate-limiter": "^5.4|^6.0", - "symfony/routing": "^5.4|^6.0", - "symfony/security-csrf": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", + "symfony/rate-limiter": "^5.4|^6.0|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/security-csrf": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", "web-token/jwt-checker": "^3.1", "web-token/jwt-signature-algorithm-ecdsa": "^3.1" }, @@ -7541,7 +7560,7 @@ "description": "Symfony Security Component - HTTP Integration", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-http/tree/v6.3.12" + "source": "https://github.com/symfony/security-http/tree/v6.4.15" }, "funding": [ { @@ -7557,20 +7576,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:42:18+00:00" + "time": "2024-11-13T13:40:18+00:00" }, { "name": "symfony/serializer", - "version": "v6.3.12", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "917d5ecbd6a7aece5b6a33c7aab82ee087d69803" + "reference": "9d862d66198f3c2e30404228629ef4c18d5d608e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/917d5ecbd6a7aece5b6a33c7aab82ee087d69803", - "reference": "917d5ecbd6a7aece5b6a33c7aab82ee087d69803", + "url": "https://api.github.com/repos/symfony/serializer/zipball/9d862d66198f3c2e30404228629ef4c18d5d608e", + "reference": "9d862d66198f3c2e30404228629ef4c18d5d608e", "shasum": "" }, "require": { @@ -7586,28 +7605,32 @@ "symfony/property-access": "<5.4", "symfony/property-info": "<5.4.24|>=6,<6.2.11", "symfony/uid": "<5.4", + "symfony/validator": "<6.4", "symfony/yaml": "<5.4" }, "require-dev": { "doctrine/annotations": "^1.12|^2", "phpdocumentor/reflection-docblock": "^3.2|^4.0|^5.0", - "symfony/cache": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/filesystem": "^5.4|^6.0", - "symfony/form": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/mime": "^5.4|^6.0", - "symfony/property-access": "^5.4.26|^6.3", - "symfony/property-info": "^5.4.24|^6.2.11", - "symfony/uid": "^5.4|^6.0", - "symfony/validator": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0", - "symfony/var-exporter": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "seld/jsonlint": "^1.10", + "symfony/cache": "^5.4|^6.0|^7.0", + "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/error-handler": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/form": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/mime": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4.26|^6.3|^7.0", + "symfony/property-info": "^5.4.24|^6.2.11|^7.0", + "symfony/translation-contracts": "^2.5|^3", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -7635,7 +7658,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v6.3.12" + "source": "https://github.com/symfony/serializer/tree/v6.4.15" }, "funding": [ { @@ -7651,7 +7674,7 @@ "type": "tidelift" } ], - "time": "2024-01-30T08:17:33+00:00" + "time": "2024-10-23T13:25:59+00:00" }, { "name": "symfony/service-contracts", @@ -7738,16 +7761,16 @@ }, { "name": "symfony/stopwatch", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "416596166641f1f728b0a64f5b9dd07cceb410c1" + "reference": "2cae0a6f8d04937d02f6d19806251e2104d54f92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/416596166641f1f728b0a64f5b9dd07cceb410c1", - "reference": "416596166641f1f728b0a64f5b9dd07cceb410c1", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2cae0a6f8d04937d02f6d19806251e2104d54f92", + "reference": "2cae0a6f8d04937d02f6d19806251e2104d54f92", "shasum": "" }, "require": { @@ -7780,7 +7803,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.3.12" + "source": "https://github.com/symfony/stopwatch/tree/v6.4.13" }, "funding": [ { @@ -7796,20 +7819,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/string", - "version": "v6.3.12", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "bce75043af265dc8aca536a6ab1d6b3181763529" + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/bce75043af265dc8aca536a6ab1d6b3181763529", - "reference": "bce75043af265dc8aca536a6ab1d6b3181763529", + "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", "shasum": "" }, "require": { @@ -7823,11 +7846,11 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -7866,7 +7889,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.3.12" + "source": "https://github.com/symfony/string/tree/v6.4.15" }, "funding": [ { @@ -7882,24 +7905,25 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-11-13T13:31:12+00:00" }, { "name": "symfony/templating", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/templating.git", - "reference": "4c54c5c58e0c7ddf8fd452b4657ed7cec586d013" + "reference": "e27b6ea8d737cb0dfd41b2f5f055c9ed677afa33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/templating/zipball/4c54c5c58e0c7ddf8fd452b4657ed7cec586d013", - "reference": "4c54c5c58e0c7ddf8fd452b4657ed7cec586d013", + "url": "https://api.github.com/repos/symfony/templating/zipball/e27b6ea8d737cb0dfd41b2f5f055c9ed677afa33", + "reference": "e27b6ea8d737cb0dfd41b2f5f055c9ed677afa33", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "~1.8" }, "require-dev": { @@ -7931,7 +7955,7 @@ "description": "Provides all the tools needed to build any kind of template system", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/templating/tree/v6.3.12" + "source": "https://github.com/symfony/templating/tree/v6.4.13" }, "funding": [ { @@ -7947,20 +7971,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-10-25T15:07:50+00:00" }, { "name": "symfony/translation", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "5c67cd1b1635be525f4dbe89042cdc3749a89ff5" + "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/5c67cd1b1635be525f4dbe89042cdc3749a89ff5", - "reference": "5c67cd1b1635be525f4dbe89042cdc3749a89ff5", + "url": "https://api.github.com/repos/symfony/translation/zipball/bee9bfabfa8b4045a66bf82520e492cddbaffa66", + "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66", "shasum": "" }, "require": { @@ -7985,17 +8009,17 @@ "require-dev": { "nikic/php-parser": "^4.18|^5.0", "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", + "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/http-client-contracts": "^2.5|^3.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/intl": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/intl": "^5.4|^6.0|^7.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/routing": "^5.4|^6.0", + "symfony/routing": "^5.4|^6.0|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0" + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -8026,7 +8050,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.3.12" + "source": "https://github.com/symfony/translation/tree/v6.4.13" }, "funding": [ { @@ -8042,7 +8066,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-27T18:14:25+00:00" }, { "name": "symfony/translation-contracts", @@ -8124,20 +8148,21 @@ }, { "name": "symfony/twig-bridge", - "version": "v6.3.12", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "dd34e348a9237d40eb7a791ee14de6efbadd5108" + "reference": "238e1aac992b5231c66faf10131ace7bdba97065" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/dd34e348a9237d40eb7a791ee14de6efbadd5108", - "reference": "dd34e348a9237d40eb7a791ee14de6efbadd5108", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/238e1aac992b5231c66faf10131ace7bdba97065", + "reference": "238e1aac992b5231c66faf10131ace7bdba97065", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/translation-contracts": "^2.5|^3", "twig/twig": "^2.13|^3.0.4" }, @@ -8147,41 +8172,41 @@ "symfony/console": "<5.4", "symfony/form": "<6.3", "symfony/http-foundation": "<5.4", - "symfony/http-kernel": "<6.2", + "symfony/http-kernel": "<6.4", "symfony/mime": "<6.2", + "symfony/serializer": "<6.4", "symfony/translation": "<5.4", "symfony/workflow": "<5.4" }, "require-dev": { - "doctrine/annotations": "^1.12|^2", "egulias/email-validator": "^2.1.10|^3|^4", "league/html-to-markdown": "^5.0", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/asset": "^5.4|^6.0", - "symfony/asset-mapper": "^6.3", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/form": "^6.3", - "symfony/html-sanitizer": "^6.1", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/http-kernel": "^6.2", - "symfony/intl": "^5.4|^6.0", - "symfony/mime": "^6.2", + "symfony/asset": "^5.4|^6.0|^7.0", + "symfony/asset-mapper": "^6.3|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/form": "^6.4|^7.0", + "symfony/html-sanitizer": "^6.1|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/intl": "^5.4|^6.0|^7.0", + "symfony/mime": "^6.2|^7.0", "symfony/polyfill-intl-icu": "~1.0", - "symfony/property-info": "^5.4|^6.0", - "symfony/routing": "^5.4|^6.0", + "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", "symfony/security-acl": "^2.8|^3.0", - "symfony/security-core": "^5.4|^6.0", - "symfony/security-csrf": "^5.4|^6.0", - "symfony/security-http": "^5.4|^6.0", - "symfony/serializer": "~6.3.12|^6.4.3", - "symfony/stopwatch": "^5.4|^6.0", - "symfony/translation": "^6.1", - "symfony/web-link": "^5.4|^6.0", - "symfony/workflow": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0", + "symfony/security-core": "^5.4|^6.0|^7.0", + "symfony/security-csrf": "^5.4|^6.0|^7.0", + "symfony/security-http": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.4.3|^7.0.3", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/translation": "^6.1|^7.0", + "symfony/web-link": "^5.4|^6.0|^7.0", + "symfony/workflow": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0", "twig/cssinliner-extra": "^2.12|^3", "twig/inky-extra": "^2.12|^3", "twig/markdown-extra": "^2.12|^3" @@ -8212,7 +8237,7 @@ "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bridge/tree/v6.3.12" + "source": "https://github.com/symfony/twig-bridge/tree/v6.4.17" }, "funding": [ { @@ -8228,30 +8253,30 @@ "type": "tidelift" } ], - "time": "2024-01-30T08:17:33+00:00" + "time": "2024-12-19T14:08:41+00:00" }, { "name": "symfony/twig-bundle", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/twig-bundle.git", - "reference": "820d2a7a2b876b287215a6b93f482dace8057d9b" + "reference": "c3beeb5336aba1ea03c37e526968c2fde3ef25c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/820d2a7a2b876b287215a6b93f482dace8057d9b", - "reference": "820d2a7a2b876b287215a6b93f482dace8057d9b", + "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/c3beeb5336aba1ea03c37e526968c2fde3ef25c4", + "reference": "c3beeb5336aba1ea03c37e526968c2fde3ef25c4", "shasum": "" }, "require": { "composer-runtime-api": ">=2.1", "php": ">=8.1", - "symfony/config": "^6.1", - "symfony/dependency-injection": "^6.1", - "symfony/http-foundation": "^5.4|^6.0", + "symfony/config": "^6.1|^7.0", + "symfony/dependency-injection": "^6.1|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", "symfony/http-kernel": "^6.2", - "symfony/twig-bridge": "^6.3", + "symfony/twig-bridge": "^6.4", "twig/twig": "^2.13|^3.0.4" }, "conflict": { @@ -8259,17 +8284,16 @@ "symfony/translation": "<5.4" }, "require-dev": { - "doctrine/annotations": "^1.10.4|^2", - "symfony/asset": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/form": "^5.4|^6.0", - "symfony/framework-bundle": "^5.4|^6.0", - "symfony/routing": "^5.4|^6.0", - "symfony/stopwatch": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", - "symfony/web-link": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "symfony/asset": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/form": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/web-link": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "symfony-bundle", "autoload": { @@ -8297,7 +8321,7 @@ "description": "Provides a tight integration of Twig into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bundle/tree/v6.3.12" + "source": "https://github.com/symfony/twig-bundle/tree/v6.4.13" }, "funding": [ { @@ -8313,20 +8337,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/uid", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "49d02f0c96c79f9cbfdb0e88ea2be0654b1c2da4" + "reference": "18eb207f0436a993fffbdd811b5b8fa35fa5e007" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/49d02f0c96c79f9cbfdb0e88ea2be0654b1c2da4", - "reference": "49d02f0c96c79f9cbfdb0e88ea2be0654b1c2da4", + "url": "https://api.github.com/repos/symfony/uid/zipball/18eb207f0436a993fffbdd811b5b8fa35fa5e007", + "reference": "18eb207f0436a993fffbdd811b5b8fa35fa5e007", "shasum": "" }, "require": { @@ -8334,7 +8358,7 @@ "symfony/polyfill-uuid": "^1.15" }, "require-dev": { - "symfony/console": "^5.4|^6.0" + "symfony/console": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -8371,7 +8395,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v6.3.12" + "source": "https://github.com/symfony/uid/tree/v6.4.13" }, "funding": [ { @@ -8387,20 +8411,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.3.12", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "5791cc448c78a1a7879812d8073cc6690286e488" + "reference": "38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/5791cc448c78a1a7879812d8073cc6690286e488", - "reference": "5791cc448c78a1a7879812d8073cc6690286e488", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80", + "reference": "38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80", "shasum": "" }, "require": { @@ -8413,10 +8437,11 @@ }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/uid": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^6.3|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/uid": "^5.4|^6.0|^7.0", "twig/twig": "^2.13|^3.0.4" }, "bin": [ @@ -8455,7 +8480,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.3.12" + "source": "https://github.com/symfony/var-dumper/tree/v6.4.15" }, "funding": [ { @@ -8471,27 +8496,30 @@ "type": "tidelift" } ], - "time": "2024-01-23T16:21:43+00:00" + "time": "2024-11-08T15:28:48+00:00" }, { "name": "symfony/var-exporter", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "ea6fe0e7d188f4b34c28a00d3f9a58ee33801a4b" + "reference": "0f605f72a363f8743001038a176eeb2a11223b51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/ea6fe0e7d188f4b34c28a00d3f9a58ee33801a4b", - "reference": "ea6fe0e7d188f4b34c28a00d3f9a58ee33801a4b", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/0f605f72a363f8743001038a176eeb2a11223b51", + "reference": "0f605f72a363f8743001038a176eeb2a11223b51", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "require-dev": { - "symfony/var-dumper": "^5.4|^6.0" + "symfony/property-access": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -8529,7 +8557,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.3.12" + "source": "https://github.com/symfony/var-exporter/tree/v6.4.13" }, "funding": [ { @@ -8545,20 +8573,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/web-link", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/web-link.git", - "reference": "0bc29a164b8c9c683d5eb0f839762c055d01e42e" + "reference": "4d188b64bb9a9c5e2e4d20c8d5fdce6bbbb32c94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-link/zipball/0bc29a164b8c9c683d5eb0f839762c055d01e42e", - "reference": "0bc29a164b8c9c683d5eb0f839762c055d01e42e", + "url": "https://api.github.com/repos/symfony/web-link/zipball/4d188b64bb9a9c5e2e4d20c8d5fdce6bbbb32c94", + "reference": "4d188b64bb9a9c5e2e4d20c8d5fdce6bbbb32c94", "shasum": "" }, "require": { @@ -8572,7 +8600,7 @@ "psr/link-implementation": "1.0|2.0" }, "require-dev": { - "symfony/http-kernel": "^5.4|^6.0" + "symfony/http-kernel": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -8612,7 +8640,7 @@ "push" ], "support": { - "source": "https://github.com/symfony/web-link/tree/v6.3.12" + "source": "https://github.com/symfony/web-link/tree/v6.4.13" }, "funding": [ { @@ -8628,41 +8656,42 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/web-profiler-bundle", - "version": "v6.3.12", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/web-profiler-bundle.git", - "reference": "920efdd0f53f088b44963cf89368038ee39719b9" + "reference": "979f8ee1a4f2464c20f3fef0d2111827fef2e97e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/920efdd0f53f088b44963cf89368038ee39719b9", - "reference": "920efdd0f53f088b44963cf89368038ee39719b9", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/979f8ee1a4f2464c20f3fef0d2111827fef2e97e", + "reference": "979f8ee1a4f2464c20f3fef0d2111827fef2e97e", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/config": "^5.4|^6.0", - "symfony/framework-bundle": "^5.4|^6.0,<6.4", - "symfony/http-kernel": "^6.3", - "symfony/routing": "^5.4|^6.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", "symfony/twig-bundle": "^5.4|^6.0", "twig/twig": "^2.13|^3.0.4" }, "conflict": { "symfony/form": "<5.4", "symfony/mailer": "<5.4", - "symfony/messenger": "<5.4" + "symfony/messenger": "<5.4", + "symfony/twig-bundle": ">=7.0" }, "require-dev": { - "symfony/browser-kit": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/css-selector": "^5.4|^6.0", - "symfony/stopwatch": "^5.4|^6.0" + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0" }, "type": "symfony-bundle", "autoload": { @@ -8693,7 +8722,7 @@ "dev" ], "support": { - "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.3.12" + "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.4.17" }, "funding": [ { @@ -8709,7 +8738,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T16:21:43+00:00" + "time": "2024-12-08T23:00:41+00:00" }, { "name": "symfony/webpack-encore-bundle", @@ -8786,16 +8815,16 @@ }, { "name": "symfony/yaml", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "8ab9bb61e9b862c9b481af745ff163bc5e5e6246" + "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/8ab9bb61e9b862c9b481af745ff163bc5e5e6246", - "reference": "8ab9bb61e9b862c9b481af745ff163bc5e5e6246", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", + "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", "shasum": "" }, "require": { @@ -8807,7 +8836,7 @@ "symfony/console": "<5.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0" + "symfony/console": "^5.4|^6.0|^7.0" }, "bin": [ "Resources/bin/yaml-lint" @@ -8838,7 +8867,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.3.12" + "source": "https://github.com/symfony/yaml/tree/v6.4.13" }, "funding": [ { @@ -8854,38 +8883,38 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "twig/extra-bundle", - "version": "v3.8.0", + "version": "v3.18.0", "source": { "type": "git", "url": "https://github.com/twigphp/twig-extra-bundle.git", - "reference": "32807183753de0388c8e59f7ac2d13bb47311140" + "reference": "9746573ca4bc1cd03a767a183faadaf84e0c31fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/32807183753de0388c8e59f7ac2d13bb47311140", - "reference": "32807183753de0388c8e59f7ac2d13bb47311140", + "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/9746573ca4bc1cd03a767a183faadaf84e0c31fa", + "reference": "9746573ca4bc1cd03a767a183faadaf84e0c31fa", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/framework-bundle": "^5.4|^6.0|^7.0", - "symfony/twig-bundle": "^5.4|^6.0|^7.0", - "twig/twig": "^3.0" + "php": ">=8.0.2", + "symfony/framework-bundle": "^5.4|^6.4|^7.0", + "symfony/twig-bundle": "^5.4|^6.4|^7.0", + "twig/twig": "^3.2|^4.0" }, "require-dev": { "league/commonmark": "^1.0|^2.0", "symfony/phpunit-bridge": "^6.4|^7.0", "twig/cache-extra": "^3.0", - "twig/cssinliner-extra": "^2.12|^3.0", - "twig/html-extra": "^2.12|^3.0", - "twig/inky-extra": "^2.12|^3.0", - "twig/intl-extra": "^2.12|^3.0", - "twig/markdown-extra": "^2.12|^3.0", - "twig/string-extra": "^2.12|^3.0" + "twig/cssinliner-extra": "^3.0", + "twig/html-extra": "^3.0", + "twig/inky-extra": "^3.0", + "twig/intl-extra": "^3.0", + "twig/markdown-extra": "^3.0", + "twig/string-extra": "^3.0" }, "type": "symfony-bundle", "autoload": { @@ -8916,7 +8945,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.8.0" + "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.18.0" }, "funding": [ { @@ -8928,7 +8957,7 @@ "type": "tidelift" } ], - "time": "2023-11-21T14:02:01+00:00" + "time": "2024-09-26T19:22:23+00:00" }, { "name": "twig/markdown-extra", @@ -9004,23 +9033,23 @@ }, { "name": "twig/string-extra", - "version": "v3.8.0", + "version": "v3.18.0", "source": { "type": "git", "url": "https://github.com/twigphp/string-extra.git", - "reference": "b0c9037d96baff79abe368dc092a59b726517548" + "reference": "cb4eec11de02f63ad8ea9d065a1f27752d0bf752" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/string-extra/zipball/b0c9037d96baff79abe368dc092a59b726517548", - "reference": "b0c9037d96baff79abe368dc092a59b726517548", + "url": "https://api.github.com/repos/twigphp/string-extra/zipball/cb4eec11de02f63ad8ea9d065a1f27752d0bf752", + "reference": "cb4eec11de02f63ad8ea9d065a1f27752d0bf752", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/string": "^5.4|^6.0|^7.0", + "php": ">=8.0.2", + "symfony/string": "^5.4|^6.4|^7.0", "symfony/translation-contracts": "^1.1|^2|^3", - "twig/twig": "^3.0" + "twig/twig": "^3.13|^4.0" }, "require-dev": { "symfony/phpunit-bridge": "^6.4|^7.0" @@ -9055,7 +9084,7 @@ "unicode" ], "support": { - "source": "https://github.com/twigphp/string-extra/tree/v3.8.0" + "source": "https://github.com/twigphp/string-extra/tree/v3.18.0" }, "funding": [ { @@ -9067,7 +9096,7 @@ "type": "tidelift" } ], - "time": "2023-11-21T14:02:01+00:00" + "time": "2024-11-30T08:42:13+00:00" }, { "name": "twig/twig", @@ -9339,27 +9368,27 @@ }, { "name": "symfony/browser-kit", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "867868fca3a0939236ab89600f9480eee74843ce" + "reference": "65d4b3fd9556e4b5b41287bef93c671f8f9f86ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/867868fca3a0939236ab89600f9480eee74843ce", - "reference": "867868fca3a0939236ab89600f9480eee74843ce", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/65d4b3fd9556e4b5b41287bef93c671f8f9f86ab", + "reference": "65d4b3fd9556e4b5b41287bef93c671f8f9f86ab", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/dom-crawler": "^5.4|^6.0" + "symfony/dom-crawler": "^5.4|^6.0|^7.0" }, "require-dev": { - "symfony/css-selector": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/mime": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0" + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/mime": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -9387,7 +9416,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v6.3.12" + "source": "https://github.com/symfony/browser-kit/tree/v6.4.13" }, "funding": [ { @@ -9403,20 +9432,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-10-25T15:07:50+00:00" }, { "name": "symfony/css-selector", - "version": "v6.3.12", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "7bb2f446287397cc41ebd9acfa0755b16db05fbc" + "reference": "cb23e97813c5837a041b73a6d63a9ddff0778f5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/7bb2f446287397cc41ebd9acfa0755b16db05fbc", - "reference": "7bb2f446287397cc41ebd9acfa0755b16db05fbc", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/cb23e97813c5837a041b73a6d63a9ddff0778f5e", + "reference": "cb23e97813c5837a041b73a6d63a9ddff0778f5e", "shasum": "" }, "require": { @@ -9452,7 +9481,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.3.12" + "source": "https://github.com/symfony/css-selector/tree/v6.4.13" }, "funding": [ { @@ -9468,20 +9497,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/dom-crawler", - "version": "v6.3.12", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "e412abb0a443dc2c29decb96cac476aed7b8234b" + "reference": "4304e6ad5c894a9c72831ad459f627bfd35d766d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/e412abb0a443dc2c29decb96cac476aed7b8234b", - "reference": "e412abb0a443dc2c29decb96cac476aed7b8234b", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4304e6ad5c894a9c72831ad459f627bfd35d766d", + "reference": "4304e6ad5c894a9c72831ad459f627bfd35d766d", "shasum": "" }, "require": { @@ -9491,7 +9520,7 @@ "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "^5.4|^6.0" + "symfony/css-selector": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -9519,7 +9548,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v6.3.12" + "source": "https://github.com/symfony/dom-crawler/tree/v6.4.16" }, "funding": [ { @@ -9535,7 +9564,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:35:58+00:00" + "time": "2024-11-13T15:06:22+00:00" } ], "aliases": [], From 982208671b0d5b3de24fd5538f3a6d506760e658 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 12:47:12 +0100 Subject: [PATCH 03/52] build: update recipe doctrine/doctrine-bundle --- .env | 8 +++++--- config/packages/doctrine.yaml | 6 +++++- symfony.lock | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.env b/.env index da3ba257..38e65d36 100644 --- a/.env +++ b/.env @@ -25,9 +25,11 @@ TRUSTED_PROXIES=127.0.0.1,REMOTE_ADDR # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml # # DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" -# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8&charset=utf8mb4" -# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8" -DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7 +# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" +# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" +# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8" +DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=10.11.8-MariaDB&charset=utf8mb4 + ###< doctrine/doctrine-bundle ### ###< Keycloak OAUTH >### diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index 9b1539ec..be036a8c 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -4,7 +4,10 @@ doctrine: # IMPORTANT: You MUST configure your server version, # either here or in the DATABASE_URL env var (see .env file) - #server_version: '15' + #server_version: '16' + + profiling_collect_backtrace: '%kernel.debug%' + use_savepoints: true orm: auto_generate_proxy_classes: true enable_lazy_ghost_objects: true @@ -14,6 +17,7 @@ doctrine: auto_mapping: true mappings: App: + type: attribute is_bundle: false dir: '%kernel.project_dir%/src/Entity' prefix: 'App\Entity' diff --git a/symfony.lock b/symfony.lock index 95663dc1..bc7a2553 100644 --- a/symfony.lock +++ b/symfony.lock @@ -21,12 +21,12 @@ "version": "v0.5.3" }, "doctrine/doctrine-bundle": { - "version": "2.10", + "version": "2.13", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", "version": "2.10", - "ref": "f0d8c9a4da17815830aac0d63e153a940ae176bb" + "ref": "c170ded8fc587d6bd670550c43dafcf093762245" }, "files": [ "config/packages/doctrine.yaml", From 56ecc2b5a6c172cb54294b762e9e212ef15a6842 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 12:49:40 +0100 Subject: [PATCH 04/52] build: update recipe phpstan/phpstan --- phpstan.neon => phpstan.dist.neon | 1 - symfony.lock | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) rename phpstan.neon => phpstan.dist.neon (76%) diff --git a/phpstan.neon b/phpstan.dist.neon similarity index 76% rename from phpstan.neon rename to phpstan.dist.neon index 1af7f380..895af969 100644 --- a/phpstan.neon +++ b/phpstan.dist.neon @@ -6,4 +6,3 @@ parameters: - public/ - src/ - tests/ - treatPhpDocTypesAsCertain: false \ No newline at end of file diff --git a/symfony.lock b/symfony.lock index bc7a2553..e4b3fdf5 100644 --- a/symfony.lock +++ b/symfony.lock @@ -151,15 +151,15 @@ ] }, "phpstan/phpstan": { - "version": "1.10", + "version": "1.12", "recipe": { "repo": "github.com/symfony/recipes-contrib", "branch": "main", "version": "1.0", - "ref": "d74d4d719d5f53856c9c13544aa22d44144b1819" + "ref": "5e490cc197fb6bb1ae22e5abbc531ddc633b6767" }, "files": [ - "phpstan.neon" + "phpstan.dist.neon" ] }, "psr/cache": { From 0fbf02900115db8a867aad66de608caf1093e35f Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 12:51:03 +0100 Subject: [PATCH 05/52] build: update recipe symfony/console --- bin/console | 4 ++++ symfony.lock | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/console b/bin/console index c933dc53..d8d530e2 100755 --- a/bin/console +++ b/bin/console @@ -4,6 +4,10 @@ use App\Kernel; use Symfony\Bundle\FrameworkBundle\Console\Application; +if (!is_dir(dirname(__DIR__).'/vendor')) { + throw new LogicException('Dependencies are missing. Try running "composer install".'); +} + if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) { throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".'); } diff --git a/symfony.lock b/symfony.lock index e4b3fdf5..357dc0e9 100644 --- a/symfony.lock +++ b/symfony.lock @@ -208,12 +208,12 @@ "version": "v4.4.10" }, "symfony/console": { - "version": "5.4", + "version": "6.4", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", "version": "5.3", - "ref": "da0c8be8157600ad34f10ff0c9cc91232522e047" + "ref": "1781ff40d8a17d87cf53f8d4cf0c8346ed2bb461" }, "files": [ "bin/console" From 8e6ba1d7024ff0c81a0545fa484abede6a71393f Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 12:52:31 +0100 Subject: [PATCH 06/52] build: update recipe symfony/flex --- .env.dev | 0 symfony.lock | 9 +++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 .env.dev diff --git a/.env.dev b/.env.dev new file mode 100644 index 00000000..e69de29b diff --git a/symfony.lock b/symfony.lock index 357dc0e9..065d0993 100644 --- a/symfony.lock +++ b/symfony.lock @@ -268,15 +268,16 @@ "version": "v4.4.10" }, "symfony/flex": { - "version": "1.19", + "version": "2.4", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "1.0", - "ref": "146251ae39e06a95be0fe3d13c807bcf3938b172" + "version": "2.4", + "ref": "52e9754527a15e2b79d9a610f98185a1fe46622a" }, "files": [ - ".env" + ".env", + ".env.dev" ] }, "symfony/form": { From 3a459fc4db01123f5d90db3e00c5f8288134bac4 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 12:53:35 +0100 Subject: [PATCH 07/52] build: update recipe symfony/framework-bundle --- config/packages/framework.yaml | 3 +-- symfony.lock | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index bc6b3a88..0dd27ddb 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -1,7 +1,7 @@ # see https://symfony.com/doc/current/reference/configuration/framework.html framework: secret: '%env(APP_SECRET)%' - #csrf_protection: true + annotations: false http_method_override: false handle_all_throwables: true @@ -11,7 +11,6 @@ framework: handler_id: null cookie_secure: auto cookie_samesite: lax - storage_factory_id: session.storage.factory.native #esi: true #fragments: true diff --git a/symfony.lock b/symfony.lock index 065d0993..4c142d3a 100644 --- a/symfony.lock +++ b/symfony.lock @@ -284,12 +284,12 @@ "version": "v4.4.19" }, "symfony/framework-bundle": { - "version": "6.2", + "version": "6.4", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.2", - "ref": "af47254c5e4cd543e6af3e4508298ffebbdaddd3" + "version": "6.4", + "ref": "32126346f25e1cee607cc4aa6783d46034920554" }, "files": [ "config/packages/cache.yaml", From b9de766fea188d735b09114d9192de4e7f3f463b Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 12:54:25 +0100 Subject: [PATCH 08/52] build: update recipe symfony/monolog-bundle --- config/packages/monolog.yaml | 1 + symfony.lock | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/packages/monolog.yaml b/config/packages/monolog.yaml index 8c9efa91..9db7d8a7 100644 --- a/config/packages/monolog.yaml +++ b/config/packages/monolog.yaml @@ -59,3 +59,4 @@ when@prod: type: stream channels: [deprecation] path: php://stderr + formatter: monolog.formatter.json diff --git a/symfony.lock b/symfony.lock index 4c142d3a..7e5fbbb9 100644 --- a/symfony.lock +++ b/symfony.lock @@ -330,12 +330,12 @@ "version": "v4.4.10" }, "symfony/monolog-bundle": { - "version": "3.8", + "version": "3.10", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", "version": "3.7", - "ref": "213676c4ec929f046dfde5ea8e97625b81bc0578" + "ref": "aff23899c4440dd995907613c1dd709b6f59503f" }, "files": [ "config/packages/monolog.yaml" From 1f59c37b8c827ccd41fa533c21f4d331c4d6f618 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 12:56:18 +0100 Subject: [PATCH 09/52] build: update recipe symfony/security-bundle --- config/routes/security.yaml | 3 +++ symfony.lock | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 config/routes/security.yaml diff --git a/config/routes/security.yaml b/config/routes/security.yaml new file mode 100644 index 00000000..f853be15 --- /dev/null +++ b/config/routes/security.yaml @@ -0,0 +1,3 @@ +_security_logout: + resource: security.route_loader.logout + type: service diff --git a/symfony.lock b/symfony.lock index 7e5fbbb9..e656c31b 100644 --- a/symfony.lock +++ b/symfony.lock @@ -406,15 +406,16 @@ ] }, "symfony/security-bundle": { - "version": "6.2", + "version": "6.4", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.0", - "ref": "8a5b112826f7d3d5b07027f93786ae11a1c7de48" + "version": "6.4", + "ref": "2ae08430db28c8eb4476605894296c82a642028f" }, "files": [ - "config/packages/security.yaml" + "config/packages/security.yaml", + "config/routes/security.yaml" ] }, "symfony/security-core": { From 188c49735d3aee0671f36cff5a6c1a4bb176a3ee Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 12:58:32 +0100 Subject: [PATCH 10/52] build: update recipe symfony/translation --- config/packages/translation.yaml | 8 +------- symfony.lock | 6 +++--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml index abb76aae..b3f8f9cf 100644 --- a/config/packages/translation.yaml +++ b/config/packages/translation.yaml @@ -4,10 +4,4 @@ framework: default_path: '%kernel.project_dir%/translations' fallbacks: - en -# providers: -# crowdin: -# dsn: '%env(CROWDIN_DSN)%' -# loco: -# dsn: '%env(LOCO_DSN)%' -# lokalise: -# dsn: '%env(LOKALISE_DSN)%' + providers: diff --git a/symfony.lock b/symfony.lock index e656c31b..f7a13a65 100644 --- a/symfony.lock +++ b/symfony.lock @@ -443,12 +443,12 @@ "version": "v5.2.4" }, "symfony/translation": { - "version": "5.4", + "version": "6.4", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "5.3", - "ref": "da64f5a2b6d96f5dc24914517c0350a5f91dee43" + "version": "6.3", + "ref": "e28e27f53663cc34f0be2837aba18e3a1bef8e7b" }, "files": [ "config/packages/translation.yaml", From 758f5a3e56948f73465ffede0d558c28175acddb Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 13:02:02 +0100 Subject: [PATCH 11/52] build: update recipe symfony/twig-bundle --- config/packages/twig.yaml | 11 ++++++----- symfony.lock | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index ede3afaf..5a8641a5 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -1,6 +1,7 @@ -twig: - default_path: '%kernel.project_dir%/templates' - -when@test: - twig: +twig: + default_path: '%kernel.project_dir%/templates' + file_name_pattern: '*.twig' + +when@test: + twig: strict_variables: true \ No newline at end of file diff --git a/symfony.lock b/symfony.lock index f7a13a65..b2a055d3 100644 --- a/symfony.lock +++ b/symfony.lock @@ -462,12 +462,12 @@ "version": "v4.4.10" }, "symfony/twig-bundle": { - "version": "6.3", + "version": "6.4", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.3", - "ref": "b7772eb20e92f3fb4d4fe756e7505b4ba2ca1a2c" + "version": "6.4", + "ref": "cab5fd2a13a45c266d45a7d9337e28dee6272877" }, "files": [ "config/packages/twig.yaml", From 2bde5f165e4b817c6a725d0b503c7bfeb01e467f Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 13:09:28 +0100 Subject: [PATCH 12/52] build: update recipe symfony/phpunit-bridge --- bin/phpunit | 10 +++++++--- symfony.lock | 4 ++-- tests/bootstrap.php | 4 +--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bin/phpunit b/bin/phpunit index f26f2c72..692baccb 100755 --- a/bin/phpunit +++ b/bin/phpunit @@ -6,9 +6,13 @@ if (!ini_get('date.timezone')) { } if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) { - define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php'); - require PHPUNIT_COMPOSER_INSTALL; - PHPUnit\TextUI\Command::main(); + if (PHP_VERSION_ID >= 80000) { + require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit'; + } else { + define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php'); + require PHPUNIT_COMPOSER_INSTALL; + PHPUnit\TextUI\Command::main(); + } } else { if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) { echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n"; diff --git a/symfony.lock b/symfony.lock index b2a055d3..2a2a9d7f 100644 --- a/symfony.lock +++ b/symfony.lock @@ -348,12 +348,12 @@ "version": "v5.3.3" }, "symfony/phpunit-bridge": { - "version": "6.3", + "version": "6.4", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", "version": "6.3", - "ref": "01dfaa98c58f7a7b5a9b30e6edb7074af7ed9819" + "ref": "a411a0480041243d97382cac7984f7dce7813c08" }, "files": [ ".env.test", diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3181151d..47a58557 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -4,9 +4,7 @@ require dirname(__DIR__).'/vendor/autoload.php'; -if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) { - require dirname(__DIR__).'/config/bootstrap.php'; -} elseif (method_exists(Dotenv::class, 'bootEnv')) { +if (method_exists(Dotenv::class, 'bootEnv')) { (new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); } From 19afbd303722ef5cf73db0b76a4928621f39ce5c Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 13:13:25 +0100 Subject: [PATCH 13/52] ci: update php-cs-fixer --- migrations/Version20230428165114.php | 7 +- src/Controller/AdministrationController.php | 3 +- src/Controller/CodebookController.php | 4 +- src/Controller/FileManagementController.php | 3 +- src/Controller/ModerationController.php | 3 +- src/Controller/NavigationController.php | 4 +- src/Controller/OauthController.php | 12 +- src/Controller/ReviewController.php | 4 +- src/Controller/StudyController.php | 3 +- src/Controller/UserController.php | 4 +- src/Entity/Administration/DataWizUser.php | 2 +- src/Entity/Study/SettingsMetaDataGroup.php | 1 + src/Form/CreatorType.php | 2 +- src/Repository/ExperimentRepository.php | 2 +- .../Authentication/OauthAuthenticator.php | 5 +- .../Authentication/OauthLogoutSubscriber.php | 3 +- src/Service/Api/ApiClientService.php | 7 +- src/Service/Api/SpssApiClient.php | 5 +- src/Service/Crud/CrudService.php | 3 +- src/Service/Io/Formats/CsvImportable.php | 3 +- src/Service/Io/Formats/SavImportable.php | 3 +- .../Io/Input/DatasetUploadSubscriber.php | 3 +- .../Io/Input/MaterialUploadSubscriber.php | 3 +- .../Questionnaire/QuestionnaireService.php | 3 +- src/Service/Review/ReviewDataCollectable.php | 4 +- src/Twig/CommonMarkdown.php | 2 +- tools/php-cs-fixer/composer.lock | 1334 +++++++++----- tools/php-cs-fixer/vendor/autoload.php | 18 + tools/php-cs-fixer/vendor/bin/php-cs-fixer | 10 +- .../clue/ndjson-react/.github/FUNDING.yml | 2 + .../vendor/clue/ndjson-react/CHANGELOG.md | 75 + .../annotations => clue/ndjson-react}/LICENSE | 20 +- .../vendor/clue/ndjson-react/README.md | 365 ++++ .../vendor/clue/ndjson-react/composer.json | 31 + .../vendor/clue/ndjson-react/src/Decoder.php | 166 ++ .../vendor/clue/ndjson-react/src/Encoder.php | 144 ++ .../vendor/composer/ClassLoader.php | 137 +- .../vendor/composer/InstalledVersions.php | 33 +- .../vendor/composer/autoload_classmap.php | 3 +- .../vendor/composer/autoload_files.php | 9 +- .../vendor/composer/autoload_namespaces.php | 2 +- .../vendor/composer/autoload_psr4.php | 15 +- .../vendor/composer/autoload_real.php | 54 +- .../vendor/composer/autoload_static.php | 73 +- .../vendor/composer/installed.json | 1421 ++++++++++----- .../vendor/composer/installed.php | 249 ++- .../vendor/composer/pcre/README.md | 10 +- .../vendor/composer/pcre/composer.json | 18 +- .../vendor/composer/pcre/extension.neon | 22 + .../composer/pcre/src/MatchAllResult.php | 2 +- .../pcre/src/MatchAllStrictGroupsResult.php | 2 +- .../src/PHPStan/InvalidRegexPatternRule.php | 142 ++ .../pcre/src/PHPStan/PregMatchFlags.php | 70 + .../PregMatchParameterOutTypeExtension.php | 65 + .../PregMatchTypeSpecifyingExtension.php | 119 ++ ...regReplaceCallbackClosureTypeExtension.php | 91 + .../PHPStan/UnsafeStrictGroupsCallRule.php | 112 ++ .../composer/pcre/src/PcreException.php | 7 +- .../vendor/composer/pcre/src/Preg.php | 50 +- .../vendor/composer/pcre/src/Regex.php | 10 +- .../vendor/composer/platform_check.php | 4 +- .../vendor/composer/semver/CHANGELOG.md | 20 + .../vendor/composer/semver/README.md | 7 +- .../vendor/composer/semver/composer.json | 6 +- .../composer/semver/src/CompilingMatcher.php | 2 +- .../composer/semver/src/VersionParser.php | 29 +- .../composer/xdebug-handler/CHANGELOG.md | 13 +- .../vendor/composer/xdebug-handler/README.md | 15 +- .../composer/xdebug-handler/composer.json | 8 +- .../composer/xdebug-handler/src/Process.php | 1 + .../composer/xdebug-handler/src/Status.php | 35 +- .../xdebug-handler/src/XdebugHandler.php | 152 +- .../vendor/doctrine/annotations/README.md | 24 - .../vendor/doctrine/annotations/UPGRADE.md | 18 - .../vendor/doctrine/annotations/composer.json | 72 - .../annotations/docs/en/annotations.rst | 189 -- .../doctrine/annotations/docs/en/custom.rst | 443 ----- .../doctrine/annotations/docs/en/index.rst | 102 -- .../doctrine/annotations/docs/en/sidebar.rst | 6 - .../Common/Annotations/Annotation.php | 54 - .../Annotations/Annotation/Attribute.php | 21 - .../Annotations/Annotation/Attributes.php | 15 - .../Common/Annotations/Annotation/Enum.php | 69 - .../Annotation/IgnoreAnnotation.php | 43 - .../Annotation/NamedArgumentConstructor.php | 13 - .../Annotations/Annotation/Required.php | 13 - .../Common/Annotations/Annotation/Target.php | 101 -- .../Annotations/AnnotationException.php | 158 -- .../Common/Annotations/AnnotationReader.php | 385 ---- .../Common/Annotations/AnnotationRegistry.php | 43 - .../Doctrine/Common/Annotations/DocLexer.php | 131 -- .../Doctrine/Common/Annotations/DocParser.php | 1494 ---------------- .../ImplicitlyIgnoredAnnotationNames.php | 178 -- .../Common/Annotations/IndexedReader.php | 99 -- .../Doctrine/Common/Annotations/PhpParser.php | 78 - .../Common/Annotations/PsrCachedReader.php | 232 --- .../Doctrine/Common/Annotations/Reader.php | 80 - .../Common/Annotations/TokenParser.php | 205 --- .../vendor/doctrine/lexer/README.md | 9 - .../vendor/doctrine/lexer/UPGRADE.md | 22 - .../vendor/doctrine/lexer/composer.json | 55 - .../doctrine/lexer/src/AbstractLexer.php | 330 ---- .../vendor/doctrine/lexer/src/Token.php | 56 - .../vendor/evenement/evenement/.gitattributes | 7 + .../evenement/LICENSE} | 10 +- .../vendor/evenement/evenement/README.md | 64 + .../vendor/evenement/evenement/composer.json | 29 + .../evenement/evenement/src/EventEmitter.php | 17 + .../evenement/src/EventEmitterInterface.php | 22 + .../evenement/src/EventEmitterTrait.php | 154 ++ .../vendor/fidry/cpu-core-counter/.envrc | 5 + .../vendor/fidry/cpu-core-counter/LICENSE.md | 16 + .../vendor/fidry/cpu-core-counter/README.md | 138 ++ .../fidry/cpu-core-counter/bin/diagnose.php | 27 + .../fidry/cpu-core-counter/bin/execute.php | 21 + .../fidry/cpu-core-counter/bin/trace.php | 32 + .../fidry/cpu-core-counter/composer.json | 48 + .../cpu-core-counter/src/CpuCoreCounter.php | 268 +++ .../fidry/cpu-core-counter/src/Diagnoser.php | 101 ++ .../src/Executor/ProcOpenExecutor.php | 56 + .../src/Executor/ProcessExecutor.php | 22 + .../src/Finder/CmiCmdletLogicalFinder.php | 46 + .../src/Finder/CmiCmdletPhysicalFinder.php | 47 + .../src/Finder/CpuCoreFinder.php | 37 + .../src/Finder/CpuInfoFinder.php | 100 ++ .../src/Finder/DummyCpuCoreFinder.php | 57 + .../src/Finder/EnvVariableFinder.php | 69 + .../src/Finder/FinderRegistry.php | 91 + .../src/Finder/HwLogicalFinder.php | 33 + .../src/Finder/HwPhysicalFinder.php | 33 + .../src/Finder/LscpuLogicalFinder.php | 52 + .../src/Finder/LscpuPhysicalFinder.php | 66 + .../src/Finder/NProcFinder.php | 59 + .../src/Finder/NProcessorFinder.php | 32 + .../src/Finder/NullCpuCoreFinder.php | 35 + .../src/Finder/OnlyInPowerShellFinder.php | 62 + .../src/Finder/OnlyOnOSFamilyFinder.php | 113 ++ .../src/Finder/ProcOpenBasedFinder.php | 107 ++ .../src/Finder/SkipOnOSFamilyFinder.php | 113 ++ .../Finder/WindowsRegistryLogicalFinder.php | 51 + .../src/Finder/WmicLogicalFinder.php | 47 + .../src/Finder/WmicPhysicalFinder.php | 47 + .../src/Finder/_NProcessorFinder.php | 32 + .../src/NumberOfCpuCoreNotFound.php | 26 + .../src/ParallelisationResult.php | 87 + .../friendsofphp/php-cs-fixer/CHANGELOG.md | 1301 +++++++++++++- .../friendsofphp/php-cs-fixer/CONTRIBUTING.md | 113 +- .../friendsofphp/php-cs-fixer/README.md | 27 +- .../friendsofphp/php-cs-fixer/UPGRADE-v3.md | 169 +- .../php-cs-fixer/ci-integration.sh | 2 +- .../friendsofphp/php-cs-fixer/composer.json | 188 +- .../vendor/friendsofphp/php-cs-fixer/logo.md | 2 +- .../friendsofphp/php-cs-fixer/php-cs-fixer | 30 +- .../src/AbstractDoctrineAnnotationFixer.php | 31 +- .../php-cs-fixer/src/AbstractFixer.php | 108 +- .../src/AbstractFopenFlagFixer.php | 6 - .../src/AbstractFunctionReferenceFixer.php | 13 +- .../src/AbstractLinesBeforeNamespaceFixer.php | 120 -- .../src/AbstractNoUselessElseFixer.php | 5 +- .../AbstractPhpdocToTypeDeclarationFixer.php | 169 +- .../src/AbstractPhpdocTypesFixer.php | 56 +- .../php-cs-fixer/src/AbstractProxyFixer.php | 20 +- .../php-cs-fixer/src/Cache/Cache.php | 36 +- .../src/Cache/CacheManagerInterface.php | 2 + .../php-cs-fixer/src/Cache/Directory.php | 5 +- .../src/Cache/FileCacheManager.php | 36 +- .../php-cs-fixer/src/Cache/FileHandler.php | 166 +- .../src/Cache/NullCacheManager.php | 7 +- .../php-cs-fixer/src/Cache/Signature.php | 2 + .../friendsofphp/php-cs-fixer/src/Config.php | 118 +- .../php-cs-fixer/src/ConfigInterface.php | 28 +- .../InvalidFixerConfigurationException.php | 2 +- ...validForEnvFixerConfigurationException.php | 4 +- .../RequiredFixerConfigurationException.php | 4 +- .../php-cs-fixer/src/Console/Application.php | 105 +- .../src/Console/Command/CheckCommand.php | 64 + .../src/Console/Command/DescribeCommand.php | 196 ++- .../Console/Command/DocumentationCommand.php | 35 +- .../src/Console/Command/FixCommand.php | 262 +-- .../FixCommandExitStatusCalculator.php | 9 +- .../src/Console/Command/HelpCommand.php | 61 +- .../src/Console/Command/ListFilesCommand.php | 9 +- .../src/Console/Command/ListSetsCommand.php | 11 +- .../src/Console/Command/SelfUpdateCommand.php | 44 +- .../src/Console/Command/WorkerCommand.php | 243 +++ .../src/Console/ConfigurationResolver.php | 201 +-- .../src/Console/Output/ErrorOutput.php | 32 +- .../src/Console/Output/OutputContext.php | 54 + .../src/Console/Output/ProcessOutput.php | 133 -- .../Console/Output/Progress/DotsOutput.php | 124 ++ .../Console/Output/Progress/NullOutput.php | 29 + .../Output/Progress/PercentageBarOutput.php | 78 + .../Output/Progress/ProgressOutputFactory.php | 63 + .../Progress/ProgressOutputInterface.php | 27 + .../Output/Progress/ProgressOutputType.php | 37 + .../Report/FixReport/CheckstyleReporter.php | 12 +- .../Report/FixReport/GitlabReporter.php | 45 +- .../Console/Report/FixReport/JsonReporter.php | 16 +- .../Report/FixReport/JunitReporter.php | 22 +- .../Report/FixReport/ReportSummary.php | 2 + .../Report/FixReport/ReporterFactory.php | 14 +- .../Console/Report/FixReport/TextReporter.php | 22 +- .../Console/Report/FixReport/XmlReporter.php | 23 +- .../Report/ListSetsReport/JsonReporter.php | 14 +- .../Report/ListSetsReport/ReportSummary.php | 2 + .../Report/ListSetsReport/ReporterFactory.php | 10 +- .../Report/ListSetsReport/TextReporter.php | 14 +- .../src/Console/SelfUpdate/GithubClient.php | 35 +- .../SelfUpdate/GithubClientInterface.php | 7 +- .../Console/SelfUpdate/NewVersionChecker.php | 22 +- .../src/Console/WarningsDetector.php | 12 +- .../src/Differ/DiffConsoleFormatter.php | 8 +- .../php-cs-fixer/src/Differ/FullDiffer.php | 5 +- .../php-cs-fixer/src/Differ/NullDiffer.php | 3 - .../php-cs-fixer/src/Differ/UnifiedDiffer.php | 5 +- .../php-cs-fixer/src/DocBlock/Annotation.php | 121 +- .../php-cs-fixer/src/DocBlock/DocBlock.php | 4 +- .../php-cs-fixer/src/DocBlock/Line.php | 6 +- .../src/DocBlock/ShortDescription.php | 2 + .../src/DocBlock/TagComparator.php | 4 +- .../src/DocBlock/TypeExpression.php | 691 ++++++-- .../src/Doctrine/Annotation/DocLexer.php | 171 ++ .../src/Doctrine/Annotation/Token.php | 14 +- .../src/Doctrine/Annotation/Tokens.php | 52 +- .../Documentation/DocumentationLocator.php | 12 +- .../Documentation/FixerDocumentGenerator.php | 215 ++- .../Documentation/ListDocumentGenerator.php | 174 -- .../src/Documentation/RstUtils.php | 7 +- .../RuleSetDocumentationGenerator.php | 81 +- .../php-cs-fixer/src/Error/Error.php | 34 +- .../php-cs-fixer/src/Error/ErrorsManager.php | 32 +- .../src/Error/SourceExceptionFactory.php | 62 + .../src/ExecutorWithoutErrorHandler.php | 58 + .../ExecutorWithoutErrorHandlerException.php | 22 + .../php-cs-fixer/src/FileReader.php | 9 +- .../php-cs-fixer/src/FileRemoval.php | 4 +- .../src/Fixer/AbstractPhpUnitFixer.php | 148 +- .../src/Fixer/AbstractShortOperatorFixer.php | 264 +++ .../src/Fixer/Alias/ArrayPushFixer.php | 9 - .../Fixer/Alias/BacktickToShellExecFixer.php | 24 +- .../src/Fixer/Alias/EregToPregFixer.php | 20 +- .../src/Fixer/Alias/MbStrFunctionsFixer.php | 20 +- .../src/Fixer/Alias/ModernizeStrposFixer.php | 121 +- .../src/Fixer/Alias/NoAliasFunctionsFixer.php | 70 +- .../NoAliasLanguageConstructCallFixer.php | 9 - .../src/Fixer/Alias/NoMixedEchoPrintFixer.php | 60 +- .../Fixer/Alias/PowToExponentiationFixer.php | 29 +- .../Fixer/Alias/RandomApiMigrationFixer.php | 63 +- .../src/Fixer/Alias/SetTypeToCastFixer.php | 11 +- .../Fixer/ArrayNotation/ArraySyntaxFixer.php | 65 +- ...tilineWhitespaceAroundDoubleArrowFixer.php | 9 - .../NoTrailingCommaInSinglelineArrayFixer.php | 9 - .../NoWhitespaceBeforeCommaInArrayFixer.php | 30 +- .../NormalizeIndexBraceFixer.php | 17 +- .../ArrayNotation/ReturnToYieldFromFixer.php | 105 ++ .../ArrayNotation/TrimArraySpacesFixer.php | 15 +- .../WhitespaceAfterCommaInArrayFixer.php | 31 +- .../YieldFromArrayToYieldsFixer.php | 189 ++ .../AttributeEmptyParenthesesFixer.php | 136 ++ .../GeneralAttributeRemoveFixer.php | 142 ++ .../OrderedAttributesFixer.php | 271 +++ .../src/Fixer/Basic/BracesFixer.php | 63 +- .../src/Fixer/Basic/BracesPositionFixer.php | 441 +++++ .../Fixer/Basic/CurlyBracesPositionFixer.php | 425 +---- .../src/Fixer/Basic/EncodingFixer.php | 20 +- .../NoMultipleStatementsPerLineFixer.php | 24 +- .../NoTrailingCommaInSinglelineFixer.php | 29 +- .../Basic/NonPrintableCharacterFixer.php | 48 +- .../Basic/NumericLiteralSeparatorFixer.php | 232 +++ .../src/Fixer/Basic/OctalNotationFixer.php | 17 +- .../src/Fixer/Basic/PsrAutoloadingFixer.php | 73 +- .../Fixer/Basic/SingleLineEmptyBodyFixer.php | 83 + .../Casing/ClassReferenceNameCasingFixer.php | 17 +- .../src/Fixer/Casing/ConstantCaseFixer.php | 144 +- .../Fixer/Casing/IntegerLiteralCaseFixer.php | 9 +- .../Fixer/Casing/LowercaseKeywordsFixer.php | 16 +- .../Casing/LowercaseStaticReferenceFixer.php | 5 +- .../Fixer/Casing/MagicConstantCasingFixer.php | 11 +- .../Fixer/Casing/MagicMethodCasingFixer.php | 26 +- .../Casing/NativeFunctionCasingFixer.php | 9 - ...tiveFunctionTypeDeclarationCasingFixer.php | 137 +- .../NativeTypeDeclarationCasingFixer.php | 360 ++++ .../Fixer/CastNotation/CastSpacesFixer.php | 25 +- .../Fixer/CastNotation/LowercaseCastFixer.php | 33 +- .../ModernizeTypesCastingFixer.php | 6 - .../CastNotation/NoShortBoolCastFixer.php | 9 - .../Fixer/CastNotation/NoUnsetCastFixer.php | 9 - .../CastNotation/ShortScalarCastFixer.php | 19 +- .../ClassAttributesSeparationFixer.php | 111 +- .../ClassNotation/ClassDefinitionFixer.php | 113 +- .../Fixer/ClassNotation/FinalClassFixer.php | 14 +- .../ClassNotation/FinalInternalClassFixer.php | 273 ++- ...FinalPublicMethodForAbstractClassFixer.php | 22 +- .../NoBlankLinesAfterClassOpeningFixer.php | 9 - .../NoNullPropertyInitializationFixer.php | 9 - .../ClassNotation/NoPhp4ConstructorFixer.php | 17 +- .../NoUnneededFinalMethodFixer.php | 49 +- .../OrderedClassElementsFixer.php | 298 ++-- .../ClassNotation/OrderedInterfacesFixer.php | 64 +- .../ClassNotation/OrderedTraitsFixer.php | 63 +- .../Fixer/ClassNotation/OrderedTypesFixer.php | 453 +++++ ...pdocReadonlyClassCommentToKeywordFixer.php | 129 ++ .../ClassNotation/ProtectedToPrivateFixer.php | 17 +- .../Fixer/ClassNotation/SelfAccessorFixer.php | 37 +- .../ClassNotation/SelfStaticAccessorFixer.php | 68 +- .../SingleClassElementPerStatementFixer.php | 29 +- .../SingleTraitInsertPerStatementFixer.php | 6 +- .../ClassNotation/VisibilityRequiredFixer.php | 29 +- .../ClassUsage/DateTimeImmutableFixer.php | 12 - .../Fixer/Comment/CommentToPhpdocFixer.php | 57 +- .../src/Fixer/Comment/HeaderCommentFixer.php | 43 +- .../MultilineCommentOpeningClosingFixer.php | 35 +- .../src/Fixer/Comment/NoEmptyCommentFixer.php | 31 +- .../NoTrailingWhitespaceInCommentFixer.php | 9 - .../Comment/SingleLineCommentSpacingFixer.php | 11 +- .../Comment/SingleLineCommentStyleFixer.php | 62 +- .../src/Fixer/ConfigurableFixerInterface.php | 5 +- .../src/Fixer/ConfigurableFixerTrait.php | 124 ++ .../NativeConstantInvocationFixer.php | 60 +- .../ControlStructureBracesFixer.php | 22 +- ...trolStructureContinuationPositionFixer.php | 17 +- .../Fixer/ControlStructure/ElseifFixer.php | 6 - .../ControlStructure/EmptyLoopBodyFixer.php | 26 +- .../EmptyLoopConditionFixer.php | 28 +- .../Fixer/ControlStructure/IncludeFixer.php | 13 +- .../NoAlternativeSyntaxFixer.php | 25 +- .../ControlStructure/NoBreakCommentFixer.php | 52 +- .../NoSuperfluousElseifFixer.php | 9 - .../NoTrailingCommaInListCallFixer.php | 9 - .../NoUnneededBracesFixer.php | 182 ++ .../NoUnneededControlParenthesesFixer.php | 92 +- .../NoUnneededCurlyBracesFixer.php | 156 +- .../ControlStructure/NoUselessElseFixer.php | 13 +- .../SimplifiedIfReturnFixer.php | 15 +- .../SwitchCaseSemicolonToColonFixer.php | 9 - .../ControlStructure/SwitchCaseSpaceFixer.php | 9 - .../SwitchContinueToBreakFixer.php | 13 +- .../TrailingCommaInMultilineFixer.php | 148 +- .../Fixer/ControlStructure/YodaStyleFixer.php | 69 +- .../src/Fixer/DeprecatedFixerInterface.php | 2 +- ...DoctrineAnnotationArrayAssignmentFixer.php | 32 +- .../DoctrineAnnotationBracesFixer.php | 45 +- .../DoctrineAnnotationIndentationFixer.php | 50 +- .../DoctrineAnnotationSpacesFixer.php | 115 +- .../ExperimentalFixerInterface.php} | 7 +- .../CombineNestedDirnameFixer.php | 44 +- .../DateTimeCreateFromFormatCallFixer.php | 9 +- .../FunctionNotation/FopenFlagOrderFixer.php | 7 +- .../FunctionNotation/FopenFlagsFixer.php | 20 +- .../FunctionDeclarationFixer.php | 36 +- .../FunctionTypehintSpaceFixer.php | 47 +- .../FunctionNotation/ImplodeCallFixer.php | 16 +- .../LambdaNotUsedImportFixer.php | 36 +- .../MethodArgumentSpaceFixer.php | 130 +- .../NativeFunctionInvocationFixer.php | 92 +- .../NoSpacesAfterFunctionNameFixer.php | 27 +- ...lingCommaInSinglelineFunctionCallFixer.php | 9 - ...NoUnreachableDefaultArgumentValueFixer.php | 12 - .../NoUselessSprintfFixer.php | 14 +- ...ypeDeclarationForDefaultNullValueFixer.php | 142 +- .../PhpdocToParamTypeFixer.php | 86 +- .../PhpdocToPropertyTypeFixer.php | 108 +- .../PhpdocToReturnTypeFixer.php | 108 +- .../RegularCallableCallFixer.php | 11 +- .../ReturnTypeDeclarationFixer.php | 27 +- .../FunctionNotation/SingleLineThrowFixer.php | 19 +- .../FunctionNotation/StaticLambdaFixer.php | 41 +- .../UseArrowFunctionsFixer.php | 58 +- .../FunctionNotation/VoidReturnFixer.php | 34 +- .../Import/FullyQualifiedStrictTypesFixer.php | 897 +++++++++- .../Import/GlobalNamespaceImportFixer.php | 170 +- .../src/Fixer/Import/GroupImportFixer.php | 161 +- .../Import/NoLeadingImportSlashFixer.php | 9 - .../Import/NoUnneededImportAliasFixer.php | 9 - .../src/Fixer/Import/NoUnusedImportsFixer.php | 229 ++- .../src/Fixer/Import/OrderedImportsFixer.php | 226 ++- .../Import/SingleImportPerStatementFixer.php | 39 +- .../Import/SingleLineAfterImportsFixer.php | 9 - .../php-cs-fixer/src/Fixer/Indentation.php | 2 +- .../InternalFixerInterface.php} | 9 +- .../LanguageConstruct/ClassKeywordFixer.php | 100 ++ .../ClassKeywordRemoveFixer.php | 29 +- .../CombineConsecutiveIssetsFixer.php | 21 +- .../CombineConsecutiveUnsetsFixer.php | 13 +- .../DeclareEqualNormalizeFixer.php | 45 +- .../LanguageConstruct/DirConstantFixer.php | 9 - .../ErrorSuppressionFixer.php | 38 +- .../ExplicitIndirectVariableFixer.php | 23 +- .../FunctionToConstantFixer.php | 96 +- .../GetClassToClassKeywordFixer.php | 14 +- .../Fixer/LanguageConstruct/IsNullFixer.php | 12 - .../NoUnsetOnPropertyFixer.php | 13 +- .../NullableTypeDeclarationFixer.php | 348 ++++ .../SingleSpaceAfterConstructFixer.php | 60 +- .../SingleSpaceAroundConstructFixer.php | 219 ++- .../Fixer/ListNotation/ListSyntaxFixer.php | 55 +- .../BlankLineAfterNamespaceFixer.php | 13 +- .../BlankLinesBeforeNamespaceFixer.php | 242 +++ .../NamespaceNotation/CleanNamespaceFixer.php | 19 +- .../NoBlankLinesBeforeNamespaceFixer.php | 40 +- .../NoLeadingNamespaceWhitespaceFixer.php | 9 - .../SingleBlankLineBeforeNamespaceFixer.php | 42 +- .../Fixer/Naming/NoHomoglyphNamesFixer.php | 20 +- ...signNullCoalescingToCoalesceEqualFixer.php | 144 +- .../Operator/BinaryOperatorSpacesFixer.php | 166 +- .../src/Fixer/Operator/ConcatSpaceFixer.php | 58 +- .../Fixer/Operator/IncrementStyleFixer.php | 27 +- .../Fixer/Operator/LogicalOperatorsFixer.php | 12 - .../Operator/LongToShorthandOperatorFixer.php | 140 ++ .../src/Fixer/Operator/NewWithBracesFixer.php | 205 +-- .../Operator/NewWithParenthesesFixer.php | 216 +++ .../NoSpaceAroundDoubleColonFixer.php | 15 +- .../Operator/NoUselessConcatOperatorFixer.php | 142 +- .../NoUselessNullsafeOperatorFixer.php | 11 +- .../Operator/NotOperatorWithSpaceFixer.php | 9 - .../NotOperatorWithSuccessorSpaceFixer.php | 9 - .../ObjectOperatorWithoutWhitespaceFixer.php | 9 - .../Fixer/Operator/OperatorLinebreakFixer.php | 93 +- .../Operator/StandardizeIncrementFixer.php | 10 +- .../Operator/StandardizeNotEqualsFixer.php | 9 - .../Operator/TernaryOperatorSpacesFixer.php | 40 +- .../Operator/TernaryToElvisOperatorFixer.php | 34 +- .../Operator/TernaryToNullCoalescingFixer.php | 19 +- .../Operator/UnaryOperatorSpacesFixer.php | 59 +- .../PhpTag/BlankLineAfterOpeningTagFixer.php | 42 +- .../src/Fixer/PhpTag/EchoTagSyntaxFixer.php | 41 +- .../src/Fixer/PhpTag/FullOpeningTagFixer.php | 14 +- .../PhpTag/LinebreakAfterOpeningTagFixer.php | 22 +- .../src/Fixer/PhpTag/NoClosingTagFixer.php | 17 +- .../PhpUnit/PhpUnitAssertNewNamesFixer.php | 107 ++ .../Fixer/PhpUnit/PhpUnitAttributesFixer.php | 596 +++++++ .../Fixer/PhpUnit/PhpUnitConstructFixer.php | 62 +- .../PhpUnit/PhpUnitDataProviderNameFixer.php | 199 +++ .../PhpUnitDataProviderReturnTypeFixer.php | 120 ++ .../PhpUnitDataProviderStaticFixer.php | 34 +- .../PhpUnit/PhpUnitDedicateAssertFixer.php | 211 +-- ...PhpUnitDedicateAssertInternalTypeFixer.php | 25 +- .../Fixer/PhpUnit/PhpUnitExpectationFixer.php | 66 +- .../PhpUnit/PhpUnitFqcnAnnotationFixer.php | 8 +- .../PhpUnit/PhpUnitInternalClassFixer.php | 27 +- .../PhpUnit/PhpUnitMethodCasingFixer.php | 40 +- .../src/Fixer/PhpUnit/PhpUnitMockFixer.php | 39 +- .../PhpUnitMockShortWillReturnFixer.php | 18 +- .../Fixer/PhpUnit/PhpUnitNamespacedFixer.php | 71 +- .../PhpUnitNoExpectationAnnotationFixer.php | 47 +- .../PhpUnitSetUpTearDownVisibilityFixer.php | 54 +- .../Fixer/PhpUnit/PhpUnitSizeClassFixer.php | 37 +- .../src/Fixer/PhpUnit/PhpUnitStrictFixer.php | 35 +- .../Fixer/PhpUnit/PhpUnitTargetVersion.php | 7 +- .../PhpUnit/PhpUnitTestAnnotationFixer.php | 50 +- .../PhpUnitTestCaseStaticMethodCallsFixer.php | 151 +- .../PhpUnitTestClassRequiresCoversFixer.php | 25 +- .../Phpdoc/AlignMultilineCommentFixer.php | 54 +- .../GeneralPhpdocAnnotationRemoveFixer.php | 35 +- .../Phpdoc/GeneralPhpdocTagRenameFixer.php | 63 +- .../Phpdoc/NoBlankLinesAfterPhpdocFixer.php | 13 +- .../src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php | 39 +- .../Phpdoc/NoSuperfluousPhpdocTagsFixer.php | 238 ++- .../PhpdocAddMissingParamAnnotationFixer.php | 48 +- .../src/Fixer/Phpdoc/PhpdocAlignFixer.php | 311 ++-- .../PhpdocAnnotationWithoutDotFixer.php | 23 +- .../src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php | 92 + .../src/Fixer/Phpdoc/PhpdocIndentFixer.php | 25 +- .../Phpdoc/PhpdocInlineTagNormalizerFixer.php | 36 +- .../src/Fixer/Phpdoc/PhpdocLineSpanFixer.php | 26 +- .../src/Fixer/Phpdoc/PhpdocListTypeFixer.php | 70 + .../src/Fixer/Phpdoc/PhpdocNoAccessFixer.php | 14 +- .../Fixer/Phpdoc/PhpdocNoAliasTagFixer.php | 28 +- .../Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php | 11 +- .../src/Fixer/Phpdoc/PhpdocNoPackageFixer.php | 13 +- .../Phpdoc/PhpdocNoUselessInheritdocFixer.php | 15 +- .../Fixer/Phpdoc/PhpdocOrderByValueFixer.php | 40 +- .../src/Fixer/Phpdoc/PhpdocOrderFixer.php | 61 +- .../Fixer/Phpdoc/PhpdocParamOrderFixer.php | 273 +++ .../Phpdoc/PhpdocReturnSelfReferenceFixer.php | 47 +- .../src/Fixer/Phpdoc/PhpdocScalarFixer.php | 40 +- .../Fixer/Phpdoc/PhpdocSeparationFixer.php | 127 +- .../PhpdocSingleLineVarSpacingFixer.php | 9 - .../src/Fixer/Phpdoc/PhpdocSummaryFixer.php | 20 +- .../src/Fixer/Phpdoc/PhpdocTagCasingFixer.php | 31 +- .../src/Fixer/Phpdoc/PhpdocTagTypeFixer.php | 38 +- .../src/Fixer/Phpdoc/PhpdocToCommentFixer.php | 73 +- ...rimConsecutiveBlankLineSeparationFixer.php | 16 +- .../src/Fixer/Phpdoc/PhpdocTrimFixer.php | 11 +- .../src/Fixer/Phpdoc/PhpdocTypesFixer.php | 93 +- .../Fixer/Phpdoc/PhpdocTypesOrderFixer.php | 80 +- .../PhpdocVarAnnotationCorrectOrderFixer.php | 2 +- .../Phpdoc/PhpdocVarWithoutNameFixer.php | 20 +- .../ReturnNotation/NoUselessReturnFixer.php | 13 +- .../ReturnNotation/ReturnAssignmentFixer.php | 89 +- .../SimplifiedNullReturnFixer.php | 58 +- ...ltilineWhitespaceBeforeSemicolonsFixer.php | 148 +- .../Fixer/Semicolon/NoEmptyStatementFixer.php | 9 - ...glelineWhitespaceBeforeSemicolonsFixer.php | 11 +- .../SemicolonAfterInstructionFixer.php | 9 - .../Semicolon/SpaceAfterSemicolonFixer.php | 26 +- .../Fixer/Strict/DeclareStrictTypesFixer.php | 56 +- .../Fixer/Strict/StrictComparisonFixer.php | 9 - .../src/Fixer/Strict/StrictParamFixer.php | 17 +- .../EscapeImplicitBackslashesFixer.php | 137 +- .../ExplicitStringVariableFixer.php | 34 +- .../HeredocClosingMarkerFixer.php | 205 +++ .../StringNotation/HeredocToNowdocFixer.php | 23 +- .../MultilineStringToHeredocFixer.php | 166 ++ .../StringNotation/NoBinaryStringFixer.php | 9 - .../NoTrailingWhitespaceInStringFixer.php | 12 - .../SimpleToComplexStringVariableFixer.php | 56 +- .../Fixer/StringNotation/SingleQuoteFixer.php | 39 +- .../StringImplicitBackslashesFixer.php | 194 ++ .../StringLengthToEmptyFixer.php | 8 +- .../StringNotation/StringLineEndingFixer.php | 12 - .../Whitespace/ArrayIndentationFixer.php | 22 +- .../BlankLineBeforeStatementFixer.php | 105 +- .../BlankLineBetweenImportGroupsFixer.php | 20 +- .../CompactNullableTypeDeclarationFixer.php | 72 + .../CompactNullableTypehintFixer.php | 69 +- .../Whitespace/HeredocIndentationFixer.php | 89 +- .../Fixer/Whitespace/IndentationTypeFixer.php | 18 +- .../src/Fixer/Whitespace/LineEndingFixer.php | 9 - .../MethodChainingIndentationFixer.php | 27 +- .../Whitespace/NoExtraBlankLinesFixer.php | 174 +- .../Whitespace/NoSpacesAroundOffsetFixer.php | 27 +- .../NoSpacesInsideParenthesisFixer.php | 60 +- .../Whitespace/NoTrailingWhitespaceFixer.php | 17 +- .../NoWhitespaceInBlankLineFixer.php | 13 +- .../Whitespace/SingleBlankLineAtEofFixer.php | 14 +- .../SpacesInsideParenthesesFixer.php | 223 +++ .../Whitespace/StatementIndentationFixer.php | 326 +++- .../Whitespace/TypeDeclarationSpacesFixer.php | 212 +++ .../src/Fixer/Whitespace/TypesSpacesFixer.php | 50 +- .../FixerConfiguration/AliasedFixerOption.php | 23 +- .../AliasedFixerOptionBuilder.php | 2 +- .../FixerConfiguration/AllowedValueSubset.php | 4 +- .../DeprecatedFixerOption.php | 23 +- .../FixerConfigurationResolver.php | 79 +- .../src/FixerConfiguration/FixerOption.php | 42 +- .../FixerConfiguration/FixerOptionBuilder.php | 21 +- .../FixerOptionInterface.php | 2 +- .../FixerConfiguration/FixerOptionSorter.php | 37 + .../InvalidOptionsForEnvException.php | 4 +- .../src/FixerDefinition/CodeSample.php | 2 + .../FileSpecificCodeSample.php | 11 +- .../src/FixerDefinition/FixerDefinition.php | 8 + .../VersionSpecificCodeSample.php | 11 +- .../FixerDefinition/VersionSpecification.php | 5 +- .../php-cs-fixer/src/FixerFactory.php | 40 +- .../php-cs-fixer/src/FixerNameValidator.php | 4 +- .../Indicator/PhpUnitTestCaseIndicator.php | 8 +- .../php-cs-fixer/src/Linter/CachingLinter.php | 21 +- .../php-cs-fixer/src/Linter/Linter.php | 11 +- .../src/Linter/LintingException.php | 4 +- .../php-cs-fixer/src/Linter/ProcessLinter.php | 19 +- .../Linter/ProcessLinterProcessBuilder.php | 2 + .../src/Linter/ProcessLintingResult.php | 16 +- .../src/Linter/TokenizerLinter.php | 13 +- .../src/Linter/TokenizerLintingResult.php | 7 +- .../src/Linter/UnavailableLinterException.php | 4 +- .../src/ParallelAwareConfigInterface.php | 29 + .../php-cs-fixer/src/PharChecker.php | 3 - .../friendsofphp/php-cs-fixer/src/Preg.php | 146 +- .../php-cs-fixer/src/PregException.php | 4 +- .../AbstractMigrationSetDescription.php | 10 +- .../RuleSet/AbstractRuleSetDescription.php | 4 +- .../DeprecatedRuleSetDescriptionInterface.php | 28 + .../php-cs-fixer/src/RuleSet/RuleSet.php | 47 +- .../src/RuleSet/RuleSetInterface.php | 2 +- .../php-cs-fixer/src/RuleSet/RuleSets.php | 10 +- .../src/RuleSet/Sets/PERCS1x0RiskySet.php | 44 + .../src/RuleSet/Sets/PERCS1x0Set.php | 44 + .../src/RuleSet/Sets/PERCS2x0RiskySet.php | 44 + .../src/RuleSet/Sets/PERCS2x0Set.php | 112 ++ .../src/RuleSet/Sets/PERCSRiskySet.php | 40 + .../src/RuleSet/Sets/PERCSSet.php | 40 + .../src/RuleSet/Sets/PERRiskySet.php | 23 +- .../php-cs-fixer/src/RuleSet/Sets/PERSet.php | 18 +- .../RuleSet/Sets/PHP82MigrationRiskySet.php | 31 + .../src/RuleSet/Sets/PHP83MigrationSet.php | 30 + .../src/RuleSet/Sets/PHP84MigrationSet.php | 31 + .../Sets/PHPUnit100MigrationRiskySet.php | 4 +- .../Sets/PHPUnit91MigrationRiskySet.php | 31 + .../src/RuleSet/Sets/PSR12Set.php | 63 +- .../php-cs-fixer/src/RuleSet/Sets/PSR2Set.php | 39 +- .../src/RuleSet/Sets/PhpCsFixerRiskySet.php | 14 +- .../src/RuleSet/Sets/PhpCsFixerSet.php | 25 +- .../src/RuleSet/Sets/SymfonyRiskySet.php | 6 +- .../src/RuleSet/Sets/SymfonySet.php | 65 +- .../src/Runner/Event/AnalysisStarted.php | 54 + .../Event/FileProcessed.php} | 30 +- ...php => FileCachingLintingFileIterator.php} | 16 +- .../src/Runner/FileFilterIterator.php | 9 +- ...ngIterator.php => LintingFileIterator.php} | 7 +- ...intingResultAwareFileIteratorInterface.php | 29 + .../src/Runner/Parallel/ParallelAction.php | 35 + .../src/Runner/Parallel/ParallelConfig.php | 67 + .../Runner/Parallel/ParallelConfigFactory.php | 61 + .../Parallel/ParallelisationException.php | 30 + .../src/Runner/Parallel/Process.php | 189 ++ .../src/Runner/Parallel/ProcessFactory.php | 111 ++ .../src/Runner/Parallel/ProcessIdentifier.php | 55 + .../src/Runner/Parallel/ProcessPool.php | 99 ++ .../src/Runner/Parallel/WorkerException.php | 66 + .../php-cs-fixer/src/Runner/Runner.php | 375 +++- .../php-cs-fixer/src/Runner/RunnerConfig.php | 64 + .../php-cs-fixer/src/StdinFileInfo.php | 25 +- .../src/Tokenizer/AbstractTransformer.php | 9 - .../src/Tokenizer/AbstractTypeTransformer.php | 14 +- .../Analyzer/AlternativeSyntaxAnalyzer.php | 5 + .../AbstractControlCaseStructuresAnalysis.php | 2 + .../Analyzer/Analysis/ArgumentAnalysis.php | 16 +- .../Analyzer/Analysis/AttributeAnalysis.php | 76 + .../Analyzer/Analysis/CaseAnalysis.php | 2 + .../Analysis/DataProviderAnalysis.php | 68 + .../Analyzer/Analysis/DefaultAnalysis.php | 2 + .../Analyzer/Analysis/EnumAnalysis.php | 2 + .../Analyzer/Analysis/MatchAnalysis.php | 2 + .../Analyzer/Analysis/NamespaceAnalysis.php | 2 + .../Analysis/NamespaceUseAnalysis.php | 85 +- .../Analysis/StartEndTokenAwareAnalysis.php | 5 + .../Analyzer/Analysis/SwitchAnalysis.php | 2 + .../Analyzer/Analysis/TypeAnalysis.php | 40 +- .../Tokenizer/Analyzer/ArgumentsAnalyzer.php | 6 +- .../Tokenizer/Analyzer/AttributeAnalyzer.php | 141 ++ .../src/Tokenizer/Analyzer/BlocksAnalyzer.php | 10 +- .../src/Tokenizer/Analyzer/ClassyAnalyzer.php | 8 +- .../Tokenizer/Analyzer/CommentsAnalyzer.php | 69 +- .../ControlCaseStructuresAnalyzer.php | 8 +- .../Analyzer/DataProviderAnalyzer.php | 61 +- .../Tokenizer/Analyzer/FunctionsAnalyzer.php | 18 +- .../Analyzer/NamespaceUsesAnalyzer.php | 163 +- .../Tokenizer/Analyzer/NamespacesAnalyzer.php | 36 +- .../src/Tokenizer/Analyzer/SwitchAnalyzer.php | 69 + .../php-cs-fixer/src/Tokenizer/CT.php | 92 +- .../php-cs-fixer/src/Tokenizer/CodeHasher.php | 2 + .../Tokenizer/Processor/ImportProcessor.php | 103 ++ .../php-cs-fixer/src/Tokenizer/Token.php | 84 +- .../php-cs-fixer/src/Tokenizer/Tokens.php | 478 +++-- .../src/Tokenizer/TokensAnalyzer.php | 132 +- .../Transformer/ArrayTypehintTransformer.php | 9 - .../Transformer/AttributeTransformer.php | 12 - .../BraceClassInstantiationTransformer.php | 14 +- ...ceTransformer.php => BraceTransformer.php} | 150 +- .../Transformer/ClassConstantTransformer.php | 9 - .../ConstructorPromotionTransformer.php | 33 +- ...veNormalFormTypeParenthesisTransformer.php | 12 - .../FirstClassCallableTransformer.php | 9 - .../Transformer/ImportTransformer.php | 12 - .../Transformer/NameQualifiedTransformer.php | 42 +- .../Transformer/NamedArgumentTransformer.php | 12 - .../NamespaceOperatorTransformer.php | 9 - .../Transformer/NullableTypeTransformer.php | 13 +- .../Transformer/ReturnRefTransformer.php | 9 - .../Transformer/SquareBraceTransformer.php | 12 - .../TypeAlternationTransformer.php | 12 - .../Transformer/TypeColonTransformer.php | 12 - .../TypeIntersectionTransformer.php | 12 - .../Tokenizer/Transformer/UseTransformer.php | 12 - .../WhitespacyCommentTransformer.php | 9 - .../src/Tokenizer/Transformers.php | 6 +- .../php-cs-fixer/src/ToolInfo.php | 20 +- .../php-cs-fixer/src/ToolInfoInterface.php | 2 + .../friendsofphp/php-cs-fixer/src/Utils.php | 122 +- .../src/WhitespacesFixerConfig.php | 14 + .../php-cs-fixer/src/WordMatcher.php | 6 +- .../vendor/psr/cache/CHANGELOG.md | 16 - tools/php-cs-fixer/vendor/psr/cache/README.md | 12 - .../vendor/psr/cache/composer.json | 25 - .../vendor/psr/cache/src/CacheException.php | 10 - .../psr/cache/src/CacheItemInterface.php | 105 -- .../psr/cache/src/CacheItemPoolInterface.php | 138 -- .../cache/src/InvalidArgumentException.php | 13 - .../psr/log/src/LoggerAwareInterface.php | 4 - .../vendor/psr/log/src/LoggerAwareTrait.php | 4 - .../vendor/psr/log/src/LoggerInterface.php | 29 +- .../vendor/psr/log/src/LoggerTrait.php | 46 +- .../vendor/psr/log/src/NullLogger.php | 6 +- .../vendor/react/cache/CHANGELOG.md | 96 + .../{doctrine/lexer => react/cache}/LICENSE | 20 +- .../php-cs-fixer/vendor/react/cache/README.md | 367 ++++ .../vendor/react/cache/composer.json | 45 + .../vendor/react/cache/src/ArrayCache.php | 181 ++ .../vendor/react/cache/src/CacheInterface.php | 194 ++ .../vendor/react/child-process/CHANGELOG.md | 176 ++ .../vendor/react/child-process/LICENSE | 21 + .../vendor/react/child-process/README.md | 619 +++++++ .../vendor/react/child-process/composer.json | 49 + .../react/child-process/src/Process.php | 585 ++++++ .../vendor/react/dns/CHANGELOG.md | 452 +++++ tools/php-cs-fixer/vendor/react/dns/LICENSE | 21 + tools/php-cs-fixer/vendor/react/dns/README.md | 453 +++++ .../vendor/react/dns/composer.json | 49 + .../react/dns/src/BadServerException.php | 7 + .../vendor/react/dns/src/Config/Config.php | 137 ++ .../vendor/react/dns/src/Config/HostsFile.php | 153 ++ .../vendor/react/dns/src/Model/Message.php | 230 +++ .../vendor/react/dns/src/Model/Record.php | 153 ++ .../react/dns/src/Protocol/BinaryDumper.php | 199 +++ .../vendor/react/dns/src/Protocol/Parser.php | 356 ++++ .../react/dns/src/Query/CachingExecutor.php | 88 + .../dns/src/Query/CancellationException.php | 7 + .../react/dns/src/Query/CoopExecutor.php | 91 + .../react/dns/src/Query/ExecutorInterface.php | 43 + .../react/dns/src/Query/FallbackExecutor.php | 49 + .../react/dns/src/Query/HostsFileExecutor.php | 89 + .../vendor/react/dns/src/Query/Query.php | 69 + .../react/dns/src/Query/RetryExecutor.php | 85 + .../src/Query/SelectiveTransportExecutor.php | 85 + .../dns/src/Query/TcpTransportExecutor.php | 382 ++++ .../react/dns/src/Query/TimeoutException.php | 7 + .../react/dns/src/Query/TimeoutExecutor.php | 78 + .../dns/src/Query/UdpTransportExecutor.php | 221 +++ .../react/dns/src/RecordNotFoundException.php | 7 + .../vendor/react/dns/src/Resolver/Factory.php | 226 +++ .../react/dns/src/Resolver/Resolver.php | 147 ++ .../dns/src/Resolver/ResolverInterface.php | 94 + .../vendor/react/event-loop/CHANGELOG.md | 468 +++++ .../vendor/react/event-loop/LICENSE | 21 + .../vendor/react/event-loop/README.md | 930 ++++++++++ .../vendor/react/event-loop/composer.json | 47 + .../vendor/react/event-loop/src/ExtEvLoop.php | 253 +++ .../react/event-loop/src/ExtEventLoop.php | 275 +++ .../react/event-loop/src/ExtLibevLoop.php | 201 +++ .../react/event-loop/src/ExtLibeventLoop.php | 285 +++ .../vendor/react/event-loop/src/ExtUvLoop.php | 342 ++++ .../vendor/react/event-loop/src/Factory.php | 75 + .../vendor/react/event-loop/src/Loop.php | 266 +++ .../react/event-loop/src/LoopInterface.php | 472 +++++ .../react/event-loop/src/SignalsHandler.php | 63 + .../react/event-loop/src/StreamSelectLoop.php | 330 ++++ .../event-loop/src/Tick/FutureTickQueue.php | 60 + .../react/event-loop/src/Timer/Timer.php | 55 + .../react/event-loop/src/Timer/Timers.php | 113 ++ .../react/event-loop/src/TimerInterface.php | 27 + .../vendor/react/promise/CHANGELOG.md | 156 ++ .../php-cs-fixer/vendor/react/promise/LICENSE | 24 + .../vendor/react/promise/README.md | 722 ++++++++ .../vendor/react/promise/composer.json | 57 + .../vendor/react/promise/src/Deferred.php | 52 + .../src/Exception/CompositeException.php | 32 + .../promise/src/Exception/LengthException.php | 7 + .../src/Internal/CancellationQueue.php | 64 + .../promise/src/Internal/FulfilledPromise.php | 89 + .../promise/src/Internal/RejectedPromise.php | 128 ++ .../vendor/react/promise/src/Promise.php | 303 ++++ .../react/promise/src/PromiseInterface.php | 152 ++ .../vendor/react/promise/src/functions.php | 345 ++++ .../react/promise/src/functions_include.php | 5 + .../vendor/react/socket/CHANGELOG.md | 785 +++++++++ .../php-cs-fixer/vendor/react/socket/LICENSE | 21 + .../vendor/react/socket/README.md | 1564 +++++++++++++++++ .../vendor/react/socket/composer.json | 52 + .../vendor/react/socket/src/Connection.php | 183 ++ .../react/socket/src/ConnectionInterface.php | 119 ++ .../vendor/react/socket/src/Connector.php | 236 +++ .../react/socket/src/ConnectorInterface.php | 59 + .../vendor/react/socket/src/DnsConnector.php | 117 ++ .../vendor/react/socket/src/FdServer.php | 222 +++ .../react/socket/src/FixedUriConnector.php | 41 + .../src/HappyEyeBallsConnectionBuilder.php | 334 ++++ .../socket/src/HappyEyeBallsConnector.php | 80 + .../react/socket/src/LimitingServer.php | 203 +++ .../react/socket/src/SecureConnector.php | 132 ++ .../vendor/react/socket/src/SecureServer.php | 210 +++ .../vendor/react/socket/src/Server.php | 118 ++ .../react/socket/src/ServerInterface.php | 151 ++ .../vendor/react/socket/src/SocketServer.php | 215 +++ .../react/socket/src/StreamEncryption.php | 158 ++ .../vendor/react/socket/src/TcpConnector.php | 173 ++ .../vendor/react/socket/src/TcpServer.php | 262 +++ .../react/socket/src/TimeoutConnector.php | 79 + .../vendor/react/socket/src/UnixConnector.php | 58 + .../vendor/react/socket/src/UnixServer.php | 162 ++ .../vendor/react/stream/CHANGELOG.md | 460 +++++ .../php-cs-fixer/vendor/react/stream/LICENSE | 21 + .../vendor/react/stream/README.md | 1249 +++++++++++++ .../vendor/react/stream/composer.json | 47 + .../react/stream/src/CompositeStream.php | 83 + .../react/stream/src/DuplexResourceStream.php | 240 +++ .../stream/src/DuplexStreamInterface.php | 39 + .../stream/src/ReadableResourceStream.php | 188 ++ .../stream/src/ReadableStreamInterface.php | 362 ++++ .../vendor/react/stream/src/ThroughStream.php | 195 ++ .../vendor/react/stream/src/Util.php | 75 + .../stream/src/WritableResourceStream.php | 178 ++ .../stream/src/WritableStreamInterface.php | 347 ++++ .../vendor/sebastian/diff/ChangeLog.md | 52 + .../vendor/sebastian/diff/LICENSE | 2 +- .../vendor/sebastian/diff/README.md | 1 - .../vendor/sebastian/diff/composer.json | 8 +- .../vendor/sebastian/diff/src/Chunk.php | 35 +- .../vendor/sebastian/diff/src/Diff.php | 43 +- .../vendor/sebastian/diff/src/Differ.php | 12 +- .../src/Exception/ConfigurationException.php | 13 +- .../vendor/sebastian/diff/src/Line.php | 19 +- ...ientLongestCommonSubsequenceCalculator.php | 8 +- .../Output/StrictUnifiedDiffOutputBuilder.php | 20 +- .../src/Output/UnifiedDiffOutputBuilder.php | 13 +- .../vendor/sebastian/diff/src/Parser.php | 6 +- .../vendor/symfony/console/Application.php | 257 +-- .../symfony/console/Attribute/AsCommand.php | 6 + .../vendor/symfony/console/CHANGELOG.md | 39 + .../console/CI/GithubActionReporter.php | 20 +- .../vendor/symfony/console/Color.php | 8 +- .../symfony/console/Command/Command.php | 111 +- .../console/Command/CompleteCommand.php | 39 +- .../console/Command/DumpCompletionCommand.php | 24 +- .../symfony/console/Command/HelpCommand.php | 12 +- .../symfony/console/Command/LazyCommand.php | 23 +- .../symfony/console/Command/ListCommand.php | 10 +- .../symfony/console/Command/LockableTrait.php | 22 +- .../Command/SignalableCommandInterface.php | 4 +- .../console/Command/TraceableCommand.php | 356 ++++ .../CommandLoader/ContainerCommandLoader.php | 13 +- .../CommandLoader/FactoryCommandLoader.php | 10 +- .../console/Completion/CompletionInput.php | 22 +- .../Completion/CompletionSuggestions.php | 4 +- .../Output/FishCompletionOutput.php | 9 +- .../symfony/console/Completion/Suggestion.php | 2 +- .../vendor/symfony/console/Cursor.php | 23 +- .../DataCollector/CommandDataCollector.php | 234 +++ .../symfony/console/Debug/CliRequest.php | 70 + .../AddConsoleCommandPass.php | 12 +- .../Descriptor/ApplicationDescription.php | 17 +- .../symfony/console/Descriptor/Descriptor.php | 24 +- .../Descriptor/DescriptorInterface.php | 2 +- .../console/Descriptor/JsonDescriptor.php | 12 +- .../console/Descriptor/MarkdownDescriptor.php | 40 +- .../Descriptor/ReStructuredTextDescriptor.php | 273 +++ .../console/Descriptor/TextDescriptor.php | 40 +- .../console/Descriptor/XmlDescriptor.php | 24 +- .../console/Event/ConsoleAlarmEvent.php | 47 + .../console/Event/ConsoleCommandEvent.php | 5 +- .../console/Event/ConsoleErrorEvent.php | 11 +- .../symfony/console/Event/ConsoleEvent.php | 15 +- .../console/Event/ConsoleSignalEvent.php | 31 +- .../console/Event/ConsoleTerminateEvent.php | 19 +- .../console/EventListener/ErrorListener.php | 30 +- .../Exception/CommandNotFoundException.php | 12 +- .../Exception/RunCommandFailedException.php | 29 + .../Formatter/NullOutputFormatterStyle.php | 10 +- .../console/Formatter/OutputFormatter.php | 28 +- .../Formatter/OutputFormatterInterface.php | 4 +- .../Formatter/OutputFormatterStyle.php | 18 +- .../OutputFormatterStyleInterface.php | 10 +- .../Formatter/OutputFormatterStyleStack.php | 8 +- .../WrappableOutputFormatterInterface.php | 4 +- .../console/Helper/DebugFormatterHelper.php | 16 +- .../console/Helper/DescriptorHelper.php | 6 +- .../vendor/symfony/console/Helper/Dumper.php | 28 +- .../console/Helper/FormatterHelper.php | 6 +- .../vendor/symfony/console/Helper/Helper.php | 72 +- .../console/Helper/HelperInterface.php | 6 +- .../symfony/console/Helper/HelperSet.php | 4 +- .../console/Helper/InputAwareHelper.php | 4 +- .../symfony/console/Helper/OutputWrapper.php | 6 +- .../symfony/console/Helper/ProcessHelper.php | 14 +- .../symfony/console/Helper/ProgressBar.php | 160 +- .../console/Helper/ProgressIndicator.php | 63 +- .../symfony/console/Helper/QuestionHelper.php | 62 +- .../console/Helper/SymfonyQuestionHelper.php | 16 +- .../vendor/symfony/console/Helper/Table.php | 104 +- .../symfony/console/Helper/TableCell.php | 11 +- .../symfony/console/Helper/TableCellStyle.php | 8 +- .../symfony/console/Helper/TableRows.php | 8 +- .../symfony/console/Helper/TableStyle.php | 6 +- .../symfony/console/Input/ArgvInput.php | 80 +- .../symfony/console/Input/ArrayInput.php | 26 +- .../vendor/symfony/console/Input/Input.php | 45 +- .../symfony/console/Input/InputArgument.php | 48 +- .../console/Input/InputAwareInterface.php | 2 +- .../symfony/console/Input/InputDefinition.php | 44 +- .../symfony/console/Input/InputInterface.php | 32 +- .../symfony/console/Input/InputOption.php | 52 +- .../Input/StreamableInputInterface.php | 2 +- .../symfony/console/Input/StringInput.php | 8 +- .../symfony/console/Logger/ConsoleLogger.php | 13 +- .../console/Messenger/RunCommandContext.php | 25 + .../console/Messenger/RunCommandMessage.php | 36 + .../Messenger/RunCommandMessageHandler.php | 49 + .../symfony/console/Output/AnsiColorMode.php | 40 +- .../symfony/console/Output/BufferedOutput.php | 2 +- .../symfony/console/Output/ConsoleOutput.php | 10 +- .../console/Output/ConsoleOutputInterface.php | 2 +- .../console/Output/ConsoleSectionOutput.php | 27 +- .../symfony/console/Output/NullOutput.php | 19 +- .../vendor/symfony/console/Output/Output.php | 24 +- .../console/Output/OutputInterface.php | 17 +- .../symfony/console/Output/StreamOutput.php | 39 +- .../console/Output/TrimmedBufferOutput.php | 8 +- .../console/Question/ChoiceQuestion.php | 21 +- .../console/Question/ConfirmationQuestion.php | 10 +- .../symfony/console/Question/Question.php | 31 +- .../vendor/symfony/console/README.md | 7 + .../symfony/console/Resources/completion.bash | 12 +- .../symfony/console/Resources/completion.fish | 6 +- .../console/SignalRegistry/SignalMap.php | 36 + .../console/SignalRegistry/SignalRegistry.php | 8 + .../console/SingleCommandApplication.php | 4 +- .../symfony/console/Style/OutputStyle.php | 28 +- .../symfony/console/Style/StyleInterface.php | 32 +- .../symfony/console/Style/SymfonyStyle.php | 89 +- .../vendor/symfony/console/Terminal.php | 25 +- .../console/Tester/ApplicationTester.php | 8 +- .../Tester/CommandCompletionTester.php | 8 +- .../symfony/console/Tester/CommandTester.php | 8 +- .../Tester/Constraint/CommandIsSuccessful.php | 2 +- .../symfony/console/Tester/TesterTrait.php | 4 +- .../vendor/symfony/console/composer.json | 39 +- .../deprecation-contracts/composer.json | 2 +- .../EventDispatcherInterface.php | 2 +- .../event-dispatcher-contracts/composer.json | 5 +- .../Attribute/AsEventListener.php | 6 + .../Debug/TraceableEventDispatcher.php | 50 +- .../Debug/WrappedListener.php | 21 +- .../AddEventAliasesPass.php | 8 +- .../RegisterListenersPass.php | 18 +- .../event-dispatcher/EventDispatcher.php | 18 +- .../EventDispatcherInterface.php | 12 +- .../symfony/event-dispatcher/GenericEvent.php | 15 +- .../ImmutableEventDispatcher.php | 22 +- .../symfony/event-dispatcher/composer.json | 25 +- .../vendor/symfony/filesystem/CHANGELOG.md | 10 + .../Exception/FileNotFoundException.php | 4 +- .../filesystem/Exception/IOException.php | 12 +- .../vendor/symfony/filesystem/Filesystem.php | 158 +- .../vendor/symfony/filesystem/Path.php | 27 +- .../vendor/symfony/filesystem/composer.json | 5 +- .../vendor/symfony/finder/CHANGELOG.md | 5 + .../symfony/finder/Comparator/Comparator.php | 10 +- .../finder/Comparator/DateComparator.php | 6 +- .../finder/Comparator/NumberComparator.php | 6 +- .../vendor/symfony/finder/Finder.php | 72 +- .../vendor/symfony/finder/Gitignore.php | 4 +- .../ExcludeDirectoryFilterIterator.php | 25 +- .../Iterator/FileTypeFilterIterator.php | 10 +- .../Iterator/MultiplePcreFilterIterator.php | 10 +- .../Iterator/RecursiveDirectoryIterator.php | 39 +- .../finder/Iterator/SortableIterator.php | 38 +- .../Iterator/VcsIgnoredFilterIterator.php | 19 +- .../vendor/symfony/finder/SplFileInfo.php | 12 +- .../vendor/symfony/finder/composer.json | 4 +- .../symfony/options-resolver/CHANGELOG.md | 10 + .../Debug/OptionsResolverIntrospector.php | 16 +- .../options-resolver/OptionConfigurator.php | 23 +- .../options-resolver/OptionsResolver.php | 137 +- .../symfony/options-resolver/composer.json | 4 +- .../vendor/symfony/polyfill-ctype/LICENSE | 2 +- .../symfony/polyfill-ctype/composer.json | 5 +- .../symfony/polyfill-intl-grapheme/LICENSE | 2 +- .../polyfill-intl-grapheme/composer.json | 5 +- .../symfony/polyfill-intl-normalizer/LICENSE | 2 +- .../polyfill-intl-normalizer/composer.json | 5 +- .../vendor/symfony/polyfill-mbstring/LICENSE | 2 +- .../symfony/polyfill-mbstring/Mbstring.php | 185 +- .../Resources/unidata/caseFolding.php | 119 ++ .../symfony/polyfill-mbstring/bootstrap.php | 25 + .../symfony/polyfill-mbstring/bootstrap80.php | 26 +- .../symfony/polyfill-mbstring/composer.json | 5 +- .../vendor/symfony/polyfill-php80/LICENSE | 2 +- .../symfony/polyfill-php80/composer.json | 5 +- .../vendor/symfony/polyfill-php81/LICENSE | 2 +- .../vendor/symfony/polyfill-php81/README.md | 1 + .../Resources/stubs/CURLStringFile.php | 51 + .../symfony/polyfill-php81/composer.json | 5 +- .../vendor/symfony/process/CHANGELOG.md | 12 + .../Exception/ProcessFailedException.php | 13 +- .../Exception/ProcessSignaledException.php | 11 +- .../Exception/ProcessStartFailedException.php | 43 + .../Exception/ProcessTimedOutException.php | 24 +- .../Exception/RunProcessFailedException.php | 25 + .../symfony/process/ExecutableFinder.php | 69 +- .../vendor/symfony/process/InputStream.php | 19 +- .../process/Messenger/RunProcessContext.php | 33 + .../process/Messenger/RunProcessMessage.php | 32 + .../Messenger/RunProcessMessageHandler.php | 33 + .../symfony/process/PhpExecutableFinder.php | 17 +- .../vendor/symfony/process/PhpProcess.php | 8 +- .../vendor/symfony/process/PhpSubprocess.php | 164 ++ .../symfony/process/Pipes/AbstractPipes.php | 21 +- .../symfony/process/Pipes/PipesInterface.php | 2 +- .../symfony/process/Pipes/UnixPipes.php | 18 +- .../symfony/process/Pipes/WindowsPipes.php | 25 +- .../vendor/symfony/process/Process.php | 288 +-- .../vendor/symfony/process/ProcessUtils.php | 5 +- .../vendor/symfony/process/composer.json | 2 +- .../Attribute/SubscribedService.php | 4 +- .../ServiceCollectionInterface.php | 26 + .../service-contracts/ServiceLocatorTrait.php | 2 +- .../ServiceMethodsSubscriberTrait.php | 80 + .../ServiceProviderInterface.php | 2 +- .../ServiceSubscriberTrait.php | 16 +- .../Test/ServiceLocatorTest.php | 81 +- .../Test/ServiceLocatorTestCase.php | 96 + .../symfony/service-contracts/composer.json | 8 +- .../vendor/symfony/stopwatch/CHANGELOG.md | 6 + .../vendor/symfony/stopwatch/README.md | 4 +- .../vendor/symfony/stopwatch/Section.php | 14 +- .../vendor/symfony/stopwatch/Stopwatch.php | 30 +- .../symfony/stopwatch/StopwatchEvent.php | 28 +- .../symfony/stopwatch/StopwatchPeriod.php | 4 +- .../vendor/symfony/stopwatch/composer.json | 4 +- .../vendor/symfony/string/AbstractString.php | 66 +- .../symfony/string/AbstractUnicodeString.php | 104 +- .../vendor/symfony/string/ByteString.php | 31 +- .../vendor/symfony/string/CHANGELOG.md | 11 + .../vendor/symfony/string/CodePointString.php | 6 +- .../string/Inflector/EnglishInflector.php | 131 +- .../string/Inflector/SpanishInflector.php | 126 ++ .../vendor/symfony/string/LazyString.php | 12 +- .../Resources/data/wcswidth_table_wide.php | 60 +- .../Resources/data/wcswidth_table_zero.php | 52 +- .../symfony/string/Slugger/AsciiSlugger.php | 20 +- .../string/Slugger/SluggerInterface.php | 2 +- .../vendor/symfony/string/TruncateMode.php | 42 + .../vendor/symfony/string/UnicodeString.php | 56 +- .../vendor/symfony/string/composer.json | 15 +- 1015 files changed, 55916 insertions(+), 18523 deletions(-) create mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/.github/FUNDING.yml create mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/CHANGELOG.md rename tools/php-cs-fixer/vendor/{doctrine/annotations => clue/ndjson-react}/LICENSE (58%) create mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/README.md create mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/composer.json create mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/src/Decoder.php create mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/src/Encoder.php create mode 100644 tools/php-cs-fixer/vendor/composer/pcre/extension.neon create mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/InvalidRegexPatternRule.php create mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchFlags.php create mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchParameterOutTypeExtension.php create mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchTypeSpecifyingExtension.php create mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregReplaceCallbackClosureTypeExtension.php create mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/UnsafeStrictGroupsCallRule.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/README.md delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/UPGRADE.md delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/composer.json delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/annotations.rst delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/custom.rst delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/index.rst delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/sidebar.rst delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attributes.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/NamedArgumentConstructor.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Required.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Target.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/lexer/README.md delete mode 100644 tools/php-cs-fixer/vendor/doctrine/lexer/UPGRADE.md delete mode 100644 tools/php-cs-fixer/vendor/doctrine/lexer/composer.json delete mode 100644 tools/php-cs-fixer/vendor/doctrine/lexer/src/AbstractLexer.php delete mode 100644 tools/php-cs-fixer/vendor/doctrine/lexer/src/Token.php create mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/.gitattributes rename tools/php-cs-fixer/vendor/{psr/cache/LICENSE.txt => evenement/evenement/LICENSE} (83%) create mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/README.md create mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/composer.json create mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitter.php create mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterInterface.php create mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterTrait.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/.envrc create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/LICENSE.md create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/README.md create mode 100755 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/diagnose.php create mode 100755 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/execute.php create mode 100755 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/trace.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/composer.json create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Diagnoser.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuLogicalFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php create mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/ParallelisationResult.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractLinesBeforeNamespaceFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/WorkerCommand.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ProcessOutput.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/ListDocumentGenerator.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/SourceExceptionFactory.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractShortOperatorFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ReturnToYieldFromFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/AttributeEmptyParenthesesFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/GeneralAttributeRemoveFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/SingleLineEmptyBodyFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/PhpdocReadonlyClassCommentToKeywordFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerTrait.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php rename tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/{Console/Output/ProcessOutputInterface.php => Fixer/ExperimentalFixerInterface.php} (73%) rename tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/{Console/Output/NullOutput.php => Fixer/InternalFixerInterface.php} (67%) create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NullableTypeDeclarationFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLinesBeforeNamespaceFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LongToShorthandOperatorFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithParenthesesFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAssertNewNamesFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAttributesFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderNameFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderReturnTypeFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocListTypeFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocParamOrderFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocClosingMarkerFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/MultilineStringToHeredocFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringImplicitBackslashesFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypeDeclarationFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SpacesInsideParenthesesFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypeDeclarationSpacesFixer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionSorter.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ParallelAwareConfigInterface.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/DeprecatedRuleSetDescriptionInterface.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0RiskySet.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0Set.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0RiskySet.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0Set.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSRiskySet.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSSet.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationRiskySet.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP83MigrationSet.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP84MigrationSet.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit91MigrationRiskySet.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/AnalysisStarted.php rename tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/{FixerFileProcessedEvent.php => Runner/Event/FileProcessed.php} (58%) rename tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/{FileCachingLintingIterator.php => FileCachingLintingFileIterator.php} (84%) rename tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/{FileLintingIterator.php => LintingFileIterator.php} (89%) create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingResultAwareFileIteratorInterface.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelAction.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfig.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfigFactory.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelisationException.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/Process.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessFactory.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessIdentifier.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessPool.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/WorkerException.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/RunnerConfig.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AttributeAnalysis.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DataProviderAnalysis.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/SwitchAnalyzer.php create mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Processor/ImportProcessor.php rename tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/{CurlyBraceTransformer.php => BraceTransformer.php} (57%) delete mode 100644 tools/php-cs-fixer/vendor/psr/cache/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/psr/cache/README.md delete mode 100644 tools/php-cs-fixer/vendor/psr/cache/composer.json delete mode 100644 tools/php-cs-fixer/vendor/psr/cache/src/CacheException.php delete mode 100644 tools/php-cs-fixer/vendor/psr/cache/src/CacheItemInterface.php delete mode 100644 tools/php-cs-fixer/vendor/psr/cache/src/CacheItemPoolInterface.php delete mode 100644 tools/php-cs-fixer/vendor/psr/cache/src/InvalidArgumentException.php create mode 100644 tools/php-cs-fixer/vendor/react/cache/CHANGELOG.md rename tools/php-cs-fixer/vendor/{doctrine/lexer => react/cache}/LICENSE (55%) create mode 100644 tools/php-cs-fixer/vendor/react/cache/README.md create mode 100644 tools/php-cs-fixer/vendor/react/cache/composer.json create mode 100644 tools/php-cs-fixer/vendor/react/cache/src/ArrayCache.php create mode 100644 tools/php-cs-fixer/vendor/react/cache/src/CacheInterface.php create mode 100644 tools/php-cs-fixer/vendor/react/child-process/CHANGELOG.md create mode 100644 tools/php-cs-fixer/vendor/react/child-process/LICENSE create mode 100644 tools/php-cs-fixer/vendor/react/child-process/README.md create mode 100644 tools/php-cs-fixer/vendor/react/child-process/composer.json create mode 100644 tools/php-cs-fixer/vendor/react/child-process/src/Process.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/CHANGELOG.md create mode 100644 tools/php-cs-fixer/vendor/react/dns/LICENSE create mode 100644 tools/php-cs-fixer/vendor/react/dns/README.md create mode 100644 tools/php-cs-fixer/vendor/react/dns/composer.json create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/BadServerException.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Config/Config.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Config/HostsFile.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Model/Message.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Model/Record.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Protocol/BinaryDumper.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Protocol/Parser.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/CachingExecutor.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/CancellationException.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/CoopExecutor.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/ExecutorInterface.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/FallbackExecutor.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/HostsFileExecutor.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/Query.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/RetryExecutor.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/SelectiveTransportExecutor.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/TcpTransportExecutor.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/TimeoutException.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/TimeoutExecutor.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/UdpTransportExecutor.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/RecordNotFoundException.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Resolver/Factory.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Resolver/Resolver.php create mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Resolver/ResolverInterface.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/CHANGELOG.md create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/LICENSE create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/README.md create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/composer.json create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/ExtEvLoop.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/ExtEventLoop.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibevLoop.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibeventLoop.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/ExtUvLoop.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/Factory.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/Loop.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/LoopInterface.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/SignalsHandler.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/StreamSelectLoop.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/Tick/FutureTickQueue.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timer.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timers.php create mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/TimerInterface.php create mode 100644 tools/php-cs-fixer/vendor/react/promise/CHANGELOG.md create mode 100644 tools/php-cs-fixer/vendor/react/promise/LICENSE create mode 100644 tools/php-cs-fixer/vendor/react/promise/README.md create mode 100644 tools/php-cs-fixer/vendor/react/promise/composer.json create mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Deferred.php create mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Exception/CompositeException.php create mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Exception/LengthException.php create mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Internal/CancellationQueue.php create mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Internal/FulfilledPromise.php create mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Internal/RejectedPromise.php create mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Promise.php create mode 100644 tools/php-cs-fixer/vendor/react/promise/src/PromiseInterface.php create mode 100644 tools/php-cs-fixer/vendor/react/promise/src/functions.php create mode 100644 tools/php-cs-fixer/vendor/react/promise/src/functions_include.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/CHANGELOG.md create mode 100644 tools/php-cs-fixer/vendor/react/socket/LICENSE create mode 100644 tools/php-cs-fixer/vendor/react/socket/README.md create mode 100644 tools/php-cs-fixer/vendor/react/socket/composer.json create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/Connection.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/ConnectionInterface.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/Connector.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/ConnectorInterface.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/DnsConnector.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/FdServer.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/FixedUriConnector.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnectionBuilder.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnector.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/LimitingServer.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/SecureConnector.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/SecureServer.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/Server.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/ServerInterface.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/SocketServer.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/StreamEncryption.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/TcpConnector.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/TcpServer.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/TimeoutConnector.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/UnixConnector.php create mode 100644 tools/php-cs-fixer/vendor/react/socket/src/UnixServer.php create mode 100644 tools/php-cs-fixer/vendor/react/stream/CHANGELOG.md create mode 100644 tools/php-cs-fixer/vendor/react/stream/LICENSE create mode 100644 tools/php-cs-fixer/vendor/react/stream/README.md create mode 100644 tools/php-cs-fixer/vendor/react/stream/composer.json create mode 100644 tools/php-cs-fixer/vendor/react/stream/src/CompositeStream.php create mode 100644 tools/php-cs-fixer/vendor/react/stream/src/DuplexResourceStream.php create mode 100644 tools/php-cs-fixer/vendor/react/stream/src/DuplexStreamInterface.php create mode 100644 tools/php-cs-fixer/vendor/react/stream/src/ReadableResourceStream.php create mode 100644 tools/php-cs-fixer/vendor/react/stream/src/ReadableStreamInterface.php create mode 100644 tools/php-cs-fixer/vendor/react/stream/src/ThroughStream.php create mode 100644 tools/php-cs-fixer/vendor/react/stream/src/Util.php create mode 100644 tools/php-cs-fixer/vendor/react/stream/src/WritableResourceStream.php create mode 100644 tools/php-cs-fixer/vendor/react/stream/src/WritableStreamInterface.php create mode 100644 tools/php-cs-fixer/vendor/symfony/console/Command/TraceableCommand.php create mode 100644 tools/php-cs-fixer/vendor/symfony/console/DataCollector/CommandDataCollector.php create mode 100644 tools/php-cs-fixer/vendor/symfony/console/Debug/CliRequest.php create mode 100644 tools/php-cs-fixer/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php create mode 100644 tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleAlarmEvent.php create mode 100644 tools/php-cs-fixer/vendor/symfony/console/Exception/RunCommandFailedException.php create mode 100644 tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandContext.php create mode 100644 tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessage.php create mode 100644 tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessageHandler.php create mode 100644 tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalMap.php create mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php create mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php create mode 100644 tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessStartFailedException.php create mode 100644 tools/php-cs-fixer/vendor/symfony/process/Exception/RunProcessFailedException.php create mode 100644 tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessContext.php create mode 100644 tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessage.php create mode 100644 tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessageHandler.php create mode 100644 tools/php-cs-fixer/vendor/symfony/process/PhpSubprocess.php create mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceCollectionInterface.php create mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php create mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php create mode 100644 tools/php-cs-fixer/vendor/symfony/string/Inflector/SpanishInflector.php create mode 100644 tools/php-cs-fixer/vendor/symfony/string/TruncateMode.php diff --git a/migrations/Version20230428165114.php b/migrations/Version20230428165114.php index ef8b493b..80791916 100644 --- a/migrations/Version20230428165114.php +++ b/migrations/Version20230428165114.php @@ -6,6 +6,7 @@ use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\Schema; +use Doctrine\DBAL\Types\ArrayType; use Doctrine\DBAL\Types\ConversionException; use Doctrine\DBAL\Types\JsonType; use Doctrine\Migrations\AbstractMigration; @@ -80,12 +81,12 @@ private function convertColumnToJson(string $tableName, string $columnName, stri } } - private function convertArrayToJson(string $array): null|string + private function convertArrayToJson(string $array): ?string { $platform = $this->platform; - if (class_exists(\Doctrine\DBAL\Types\ArrayType::class)) { - $arrayType = new \Doctrine\DBAL\Types\ArrayType(); + if (class_exists(ArrayType::class)) { + $arrayType = new ArrayType(); try { $array = $arrayType->convertToPHPValue($array, $platform); } catch (ConversionException $e) { diff --git a/src/Controller/AdministrationController.php b/src/Controller/AdministrationController.php index 0aa915f2..cf072e91 100644 --- a/src/Controller/AdministrationController.php +++ b/src/Controller/AdministrationController.php @@ -19,8 +19,7 @@ class AdministrationController extends AbstractController public function __construct( private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger - ) { - } + ) {} #[Route(path: '/admin/user', name: 'admin_user', methods: ['GET'])] public function listUser(): Response diff --git a/src/Controller/CodebookController.php b/src/Controller/CodebookController.php index da7583e2..b8823975 100644 --- a/src/Controller/CodebookController.php +++ b/src/Controller/CodebookController.php @@ -23,9 +23,7 @@ #[IsGranted('ROLE_USER')] class CodebookController extends AbstractController { - public function __construct(protected EntityManagerInterface $em, protected LoggerInterface $logger, private readonly FilesystemOperator $matrixFilesystem) - { - } + public function __construct(protected EntityManagerInterface $em, protected LoggerInterface $logger, private readonly FilesystemOperator $matrixFilesystem) {} #[Route(path: '/{uuid}', name: 'index', methods: ['GET'])] public function codebookIndexAction(string $uuid): Response diff --git a/src/Controller/FileManagementController.php b/src/Controller/FileManagementController.php index 786a8a94..72f31ada 100644 --- a/src/Controller/FileManagementController.php +++ b/src/Controller/FileManagementController.php @@ -28,8 +28,7 @@ public function __construct( private readonly SavImportable $savImportable, private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger - ) { - } + ) {} #[Route(path: '/preview/sav/{fileId}', name: 'preview-sav', methods: ['POST'])] public function previewSavAction(string $fileId): JsonResponse diff --git a/src/Controller/ModerationController.php b/src/Controller/ModerationController.php index f0e311f0..8da019a0 100644 --- a/src/Controller/ModerationController.php +++ b/src/Controller/ModerationController.php @@ -13,8 +13,7 @@ class ModerationController extends AbstractController { public function __construct( private readonly LoggerInterface $logger - ) { - } + ) {} #[Route(path: '/moderation/dashboard', name: 'moderation_dashboard', methods: ['GET'])] public function dashboard(): Response diff --git a/src/Controller/NavigationController.php b/src/Controller/NavigationController.php index ecb5f778..8b61b310 100644 --- a/src/Controller/NavigationController.php +++ b/src/Controller/NavigationController.php @@ -11,9 +11,7 @@ class NavigationController extends AbstractController { - public function __construct(private readonly EntityManagerInterface $em) - { - } + public function __construct(private readonly EntityManagerInterface $em) {} public function sidebarNavigationAction(Request $request): Response { diff --git a/src/Controller/OauthController.php b/src/Controller/OauthController.php index 9e982791..5f215a82 100644 --- a/src/Controller/OauthController.php +++ b/src/Controller/OauthController.php @@ -10,9 +10,7 @@ #[Route(path: '/security', name: 'Security-', condition: "'%kernel.environment%' in ['dev', 'prod']")] class OauthController extends AbstractController { - public function __construct(private readonly ClientRegistry $clientRegistry) - { - } + public function __construct(private readonly ClientRegistry $clientRegistry) {} #[Route(path: '/login', name: 'login', methods: ['GET'])] public function loginAction(): RedirectResponse @@ -21,12 +19,8 @@ public function loginAction(): RedirectResponse } #[Route(path: '/logout', name: 'logout', methods: ['GET'])] - public function logoutAction(ClientRegistry $clientRegistry) - { - } + public function logoutAction(ClientRegistry $clientRegistry) {} #[Route(path: '/login/check', name: 'check', methods: ['GET'])] - public function loginCheckAction() - { - } + public function loginCheckAction() {} } diff --git a/src/Controller/ReviewController.php b/src/Controller/ReviewController.php index 6371cfd3..bdc14d47 100644 --- a/src/Controller/ReviewController.php +++ b/src/Controller/ReviewController.php @@ -13,9 +13,7 @@ #[IsGranted('ROLE_USER')] class ReviewController extends AbstractController { - public function __construct(private readonly EntityManagerInterface $em) - { - } + public function __construct(private readonly EntityManagerInterface $em) {} #[Route(path: 'review/{uuid}', name: 'Study-review', methods: ['GET'])] public function reviewAction(string $uuid): Response diff --git a/src/Controller/StudyController.php b/src/Controller/StudyController.php index b59a0469..91fd56b2 100644 --- a/src/Controller/StudyController.php +++ b/src/Controller/StudyController.php @@ -32,8 +32,7 @@ public function __construct( private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly Crudable $crud - ) { - } + ) {} #[Route(path: '/', name: 'overview', methods: ['GET'])] public function overviewAction(): Response diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 77a2e6c8..126e6a88 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -16,9 +16,7 @@ #[IsGranted('ROLE_USER')] class UserController extends AbstractController { - public function __construct(private readonly LoggerInterface $logger, private readonly KernelInterface $kernel) - { - } + public function __construct(private readonly LoggerInterface $logger, private readonly KernelInterface $kernel) {} /** * @throws \Exception diff --git a/src/Entity/Administration/DataWizUser.php b/src/Entity/Administration/DataWizUser.php index 664a56e1..3c434f7f 100644 --- a/src/Entity/Administration/DataWizUser.php +++ b/src/Entity/Administration/DataWizUser.php @@ -14,7 +14,7 @@ class DataWizUser implements UserInterface { #[ORM\Id] #[ORM\Column(type: 'uuid')] - private UUid $id; + private Uuid $id; #[ORM\Column(type: 'simple_array')] private array $roles; diff --git a/src/Entity/Study/SettingsMetaDataGroup.php b/src/Entity/Study/SettingsMetaDataGroup.php index 5a66158e..ee1c3a3f 100644 --- a/src/Entity/Study/SettingsMetaDataGroup.php +++ b/src/Entity/Study/SettingsMetaDataGroup.php @@ -1,4 +1,5 @@ ['class' => 'MetaData-Label !px-4 !mt-0'], 'attr' => ['class' => 'MetaData-Widget MetaData-Widget_collection'], 'entry_type' => ChoiceType::class, - 'delete_empty' => fn (string $role = null) => empty($role), + 'delete_empty' => fn (?string $role = null) => empty($role), 'entry_options' => [ 'placeholder' => 'input.creator.credit.choices.placeholder', 'required' => true, diff --git a/src/Repository/ExperimentRepository.php b/src/Repository/ExperimentRepository.php index 8e630916..f2b3110a 100644 --- a/src/Repository/ExperimentRepository.php +++ b/src/Repository/ExperimentRepository.php @@ -19,7 +19,7 @@ public function __construct(ManagerRegistry $registry) parent::__construct($registry, Experiment::class); } - public function findByBasicMetadata(array $orderBy = null, $limit = null, $offset = null) + public function findByBasicMetadata(?array $orderBy = null, $limit = null, $offset = null) { $qb = $this->createQueryBuilder('e'); if (is_iterable($orderBy) && sizeof($orderBy) > 1) { diff --git a/src/Security/Authentication/OauthAuthenticator.php b/src/Security/Authentication/OauthAuthenticator.php index 18c92bc8..afeb9e90 100644 --- a/src/Security/Authentication/OauthAuthenticator.php +++ b/src/Security/Authentication/OauthAuthenticator.php @@ -27,8 +27,7 @@ public function __construct( private readonly ClientRegistry $clientRegistry, private readonly Crudable $crud, private readonly UrlGeneratorInterface $urlGenerator, - ) { - } + ) {} public function authenticate(Request $request): SelfValidatingPassport { @@ -66,7 +65,7 @@ public function authenticate(Request $request): SelfValidatingPassport ); } - public function start(Request $request, AuthenticationException $authException = null): RedirectResponse + public function start(Request $request, ?AuthenticationException $authException = null): RedirectResponse { return new RedirectResponse('/', Response::HTTP_TEMPORARY_REDIRECT); } diff --git a/src/Security/Authentication/OauthLogoutSubscriber.php b/src/Security/Authentication/OauthLogoutSubscriber.php index 9a065bd1..d688ca8f 100644 --- a/src/Security/Authentication/OauthLogoutSubscriber.php +++ b/src/Security/Authentication/OauthLogoutSubscriber.php @@ -14,8 +14,7 @@ public function __construct( private ClientRegistry $clientRegistry, private UrlGeneratorInterface $urlGenerator - ) { - } + ) {} /** * This function returns an array containing the subscribed events and the function that is called when the subscribed event is called. diff --git a/src/Service/Api/ApiClientService.php b/src/Service/Api/ApiClientService.php index c3584f4c..a0f32139 100644 --- a/src/Service/Api/ApiClientService.php +++ b/src/Service/Api/ApiClientService.php @@ -15,8 +15,7 @@ public function __construct( private HttpClientInterface $client, private LoggerInterface $logger - ) { - } + ) {} public function GET(string $uri, array $params): ?array { @@ -33,7 +32,7 @@ public function GET(string $uri, array $params): ?array if ($response->getStatusCode() == 200) { $content = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR); } - } catch (TransportExceptionInterface|ClientExceptionInterface|RedirectionExceptionInterface|ServerExceptionInterface $e) { + } catch (ClientExceptionInterface|RedirectionExceptionInterface|ServerExceptionInterface|TransportExceptionInterface $e) { $this->logger->error("HttpClientService::GET - Exception thrown: {$e->getMessage()}"); } @@ -57,7 +56,7 @@ public function POST(string $uri, array $params): ?array if ($response->getStatusCode() == 200) { $content = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR); } - } catch (TransportExceptionInterface|ClientExceptionInterface|RedirectionExceptionInterface|ServerExceptionInterface $e) { + } catch (ClientExceptionInterface|RedirectionExceptionInterface|ServerExceptionInterface|TransportExceptionInterface $e) { $this->logger->error("HttpClientService::POST - Exception thrown: {$e->getMessage()}"); } diff --git a/src/Service/Api/SpssApiClient.php b/src/Service/Api/SpssApiClient.php index 573dcb50..7c8b9219 100644 --- a/src/Service/Api/SpssApiClient.php +++ b/src/Service/Api/SpssApiClient.php @@ -19,10 +19,9 @@ public function __construct( private ApiClientService $clientService, private LoggerInterface $logger, private string $spss_uri - ) { - } + ) {} - public function savToArray(?Dataset $dataset): array|null + public function savToArray(?Dataset $dataset): ?array { if ($dataset === null) { return null; diff --git a/src/Service/Crud/CrudService.php b/src/Service/Crud/CrudService.php index be56bd8d..038c6417 100644 --- a/src/Service/Crud/CrudService.php +++ b/src/Service/Crud/CrudService.php @@ -21,8 +21,7 @@ public function __construct( private FilesystemOperator $materialFilesystem, private EntityManagerInterface $em, private LoggerInterface $logger - ) { - } + ) {} /** * Wrapper for find from EntityManager. diff --git a/src/Service/Io/Formats/CsvImportable.php b/src/Service/Io/Formats/CsvImportable.php index fd8e8923..03116b9f 100644 --- a/src/Service/Io/Formats/CsvImportable.php +++ b/src/Service/Io/Formats/CsvImportable.php @@ -14,8 +14,7 @@ public function __construct( private FilesystemOperator $datasetFilesystem, private LoggerInterface $logger - ) { - } + ) {} public function csvToArray(string $fileId, string $delimiter, string $escape, int $headerRows, int $resultSize = 0): ?array { diff --git a/src/Service/Io/Formats/SavImportable.php b/src/Service/Io/Formats/SavImportable.php index 1ed89200..96d90a99 100644 --- a/src/Service/Io/Formats/SavImportable.php +++ b/src/Service/Io/Formats/SavImportable.php @@ -11,8 +11,7 @@ public function __construct( private SpssApiClient $spssApiClient, private LoggerInterface $logger - ) { - } + ) {} public function savToArray(Dataset $dataset): array { diff --git a/src/Service/Io/Input/DatasetUploadSubscriber.php b/src/Service/Io/Input/DatasetUploadSubscriber.php index fc873aae..0b3601af 100644 --- a/src/Service/Io/Input/DatasetUploadSubscriber.php +++ b/src/Service/Io/Input/DatasetUploadSubscriber.php @@ -15,8 +15,7 @@ { public function __construct( private EntityManagerInterface $em - ) { - } + ) {} public static function getSubscribedEvents(): array { diff --git a/src/Service/Io/Input/MaterialUploadSubscriber.php b/src/Service/Io/Input/MaterialUploadSubscriber.php index 86816473..adc1efb7 100644 --- a/src/Service/Io/Input/MaterialUploadSubscriber.php +++ b/src/Service/Io/Input/MaterialUploadSubscriber.php @@ -13,8 +13,7 @@ { public function __construct( private EntityManagerInterface $em - ) { - } + ) {} public static function getSubscribedEvents(): array { diff --git a/src/Service/Questionnaire/QuestionnaireService.php b/src/Service/Questionnaire/QuestionnaireService.php index 4866c189..7a444fd3 100644 --- a/src/Service/Questionnaire/QuestionnaireService.php +++ b/src/Service/Questionnaire/QuestionnaireService.php @@ -11,8 +11,7 @@ { public function __construct( private FormFactoryInterface $formBuilder - ) { - } + ) {} public function formFromEntity(Questionable $entity, string $buttonLabel): ?FormInterface { diff --git a/src/Service/Review/ReviewDataCollectable.php b/src/Service/Review/ReviewDataCollectable.php index 7a647da7..e675f30d 100644 --- a/src/Service/Review/ReviewDataCollectable.php +++ b/src/Service/Review/ReviewDataCollectable.php @@ -10,9 +10,7 @@ final class ReviewDataCollectable private ?string $errorMessage = null; private ?string $errorType = null; - private function __construct() - { - } + private function __construct() {} public function getDataName(): string { diff --git a/src/Twig/CommonMarkdown.php b/src/Twig/CommonMarkdown.php index f73a2c62..15a4a33e 100644 --- a/src/Twig/CommonMarkdown.php +++ b/src/Twig/CommonMarkdown.php @@ -17,7 +17,7 @@ class CommonMarkdown implements MarkdownInterface private readonly Environment $environment; private readonly MarkdownConverter $converter; - public function __construct(MarkdownConverter $converter = null) + public function __construct(?MarkdownConverter $converter = null) { // Configure the Environment with all the CommonMark parsers/renderers $this->environment = new Environment($this->config); diff --git a/tools/php-cs-fixer/composer.lock b/tools/php-cs-fixer/composer.lock index b3b126f0..4c2178da 100644 --- a/tools/php-cs-fixer/composer.lock +++ b/tools/php-cs-fixer/composer.lock @@ -6,30 +6,102 @@ ], "content-hash": "8e940cfd5a10474f1bb48c5a5b12da94", "packages": [ + { + "name": "clue/ndjson-react", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" + }, { "name": "composer/pcre", - "version": "3.1.0", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, "branch-alias": { "dev-main": "3.x-dev" } @@ -59,7 +131,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.0" + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { @@ -75,28 +147,28 @@ "type": "tidelift" } ], - "time": "2022-11-17T09:50:14+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { "name": "composer/semver", - "version": "3.3.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -138,9 +210,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -156,20 +228,20 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/xdebug-handler", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { @@ -180,7 +252,7 @@ "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { @@ -204,9 +276,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, "funding": [ { @@ -222,43 +294,32 @@ "type": "tidelift" } ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { - "name": "doctrine/annotations", - "version": "2.0.1", + "name": "evenement/evenement", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", "shasum": "" }, "require": { - "doctrine/lexer": "^2 || ^3", - "ext-tokenizer": "*", - "php": "^7.2 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" + "php": ">=7.0" }, "require-dev": { - "doctrine/cache": "^2.0", - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + "phpunit/phpunit": "^9 || ^6" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + "Evenement\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -267,67 +328,53 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" } ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "description": "Événement is a very simple event dispatching library for PHP", "keywords": [ - "annotations", - "docblock", - "parser" + "event-dispatcher", + "event-emitter" ], "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/2.0.1" + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" }, - "time": "2023-02-02T22:02:53+00:00" + "time": "2023-08-08T05:53:35+00:00" }, { - "name": "doctrine/lexer", - "version": "3.0.0", + "name": "fidry/cpu-core-counter", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "84a527db05647743d50373e0ec53a152f2cde568" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", - "reference": "84a527db05647743d50373e0ec53a152f2cde568", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", "shasum": "" }, "require": { - "php": "^8.1" + "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.0" + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "src" + "Fidry\\CpuCoreCounter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -336,96 +383,80 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" } ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "description": "Tiny utility to get the number of CPU cores.", "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" + "CPU", + "core" ], "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.0" + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" + "url": "https://github.com/theofidry", + "type": "github" } ], - "time": "2022-12-15T16:57:16+00:00" + "time": "2024-08-06T10:04:20+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.16.0", + "version": "v3.68.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc" + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", - "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b9db2b2ea3cdba7201067acee46f984ef2397cff", + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff", "shasum": "" }, "require": { - "composer/semver": "^3.3", + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^2", - "doctrine/lexer": "^2 || ^3", + "ext-filter": "*", "ext-json": "*", "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.2", "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0 || ^5.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.27", - "symfony/polyfill-php80": "^1.27", - "symfony/polyfill-php81": "^1.27", - "symfony/process": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.1 || ^6.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" }, "require-dev": { - "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^2.0", - "mikey179/vfsstream": "^1.6.11", - "php-coveralls/php-coveralls": "^2.5.3", + "facile-it/paraunit": "^1.3.1 || ^2.4", + "infection/infection": "^0.29.8", + "justinrainbow/json-schema": "^5.3 || ^6.0", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.7", "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.16", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.6", - "phpunitgoodpractices/traits": "^1.9.2", - "symfony/phpunit-bridge": "^6.2.3", - "symfony/yaml": "^5.4 || ^6.0" + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", + "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -438,7 +469,10 @@ "autoload": { "psr-4": { "PhpCsFixer\\": "src/" - } + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -463,7 +497,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.16.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.1" }, "funding": [ { @@ -471,56 +505,7 @@ "type": "github" } ], - "time": "2023-04-02T19:30:06+00:00" - }, - { - "name": "psr/cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "time": "2021-02-03T23:26:27+00:00" + "time": "2025-01-17T09:20:36+00:00" }, { "name": "psr/container", @@ -627,16 +612,16 @@ }, { "name": "psr/log", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { @@ -671,35 +656,561 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" + }, + { + "name": "react/child-process", + "version": "v0.6.6", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.6" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-01-01T16:37:48+00:00" + }, + { + "name": "react/dns", + "version": "v1.13.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-13T14:18:03+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" + }, + { + "name": "react/promise", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-05-24T10:39:05+00:00" + }, + { + "name": "react/socket", + "version": "v1.16.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, - "time": "2021-07-14T16:46:02+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-07-26T10:38:09+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" }, { "name": "sebastian/diff", - "version": "5.0.3", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", - "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -732,7 +1243,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -740,53 +1251,50 @@ "type": "github" } ], - "time": "2023-05-01T07:48:21+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { "name": "symfony/console", - "version": "v6.2.10", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "12288d9f4500f84a4d02254d4aa968b15488476f" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/12288d9f4500f84a4d02254d4aa968b15488476f", - "reference": "12288d9f4500f84a4d02254d4aa968b15488476f", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -820,7 +1328,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.10" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -836,20 +1344,20 @@ "type": "tidelift" } ], - "time": "2023-04-28T13:37:43+00:00" + "time": "2024-12-11T03:49:26+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.1", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -857,12 +1365,12 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -887,7 +1395,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -903,28 +1411,29 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:25:55+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.2.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339" + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/04046f35fd7d72f9646e721fc2ecb8f9c67d3339", - "reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2|^3" + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", @@ -932,17 +1441,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -970,7 +1475,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.2.8" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" }, "funding": [ { @@ -986,37 +1491,34 @@ "type": "tidelift" } ], - "time": "2023-03-20T16:06:02+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.2.1", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd" + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -1049,7 +1551,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" }, "funding": [ { @@ -1065,27 +1567,30 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:32:47+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/filesystem", - "version": "v6.2.10", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd588debf7d1bc16a2c84b4b3b71145d9946b894", - "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, + "require-dev": { + "symfony/process": "^6.4|^7.0" + }, "type": "library", "autoload": { "psr-4": { @@ -1112,7 +1617,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.2.10" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -1128,27 +1633,27 @@ "type": "tidelift" } ], - "time": "2023-04-18T13:46:08+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v6.2.7", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb" + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb", - "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "symfony/filesystem": "^6.0" + "symfony/filesystem": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -1176,7 +1681,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.2.7" + "source": "https://github.com/symfony/finder/tree/v7.2.2" }, "funding": [ { @@ -1192,25 +1697,25 @@ "type": "tidelift" } ], - "time": "2023-02-16T09:57:23+00:00" + "time": "2024-12-30T19:00:17+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.2.7", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "aa0e85b53bbb2b4951960efd61d295907eacd629" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/aa0e85b53bbb2b4951960efd61d295907eacd629", - "reference": "aa0e85b53bbb2b4951960efd61d295907eacd629", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -1243,7 +1748,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.2.7" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -1259,24 +1764,24 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:44:56+00:00" + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -1286,12 +1791,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1325,7 +1827,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -1341,36 +1843,33 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1406,7 +1905,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -1422,36 +1921,33 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1490,7 +1986,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -1506,24 +2002,24 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -1533,12 +2029,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1573,7 +2066,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -1589,33 +2082,30 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1656,7 +2146,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -1672,33 +2162,30 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1735,7 +2222,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { @@ -1751,24 +2238,24 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v6.2.10", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e", - "reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -1796,7 +2283,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.2.10" + "source": "https://github.com/symfony/process/tree/v7.2.0" }, "funding": [ { @@ -1812,40 +2299,38 @@ "type": "tidelift" } ], - "time": "2023-04-18T13:56:57+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.2.1", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -1881,7 +2366,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -1897,25 +2382,25 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:32:47+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/stopwatch", - "version": "v6.2.7", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f" + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", - "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e46690d5b9d7164a6d061cab1e8d46141b9f49df", + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/service-contracts": "^1|^2|^3" + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -1943,7 +2428,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.2.7" + "source": "https://github.com/symfony/stopwatch/tree/v7.2.2" }, "funding": [ { @@ -1959,38 +2444,39 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:44:56+00:00" + "time": "2024-12-18T14:28:33+00:00" }, { "name": "symfony/string", - "version": "v6.2.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -2029,7 +2515,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.2.8" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { @@ -2045,7 +2531,7 @@ "type": "tidelift" } ], - "time": "2023-03-20T16:06:02+00:00" + "time": "2024-11-13T13:31:26+00:00" } ], "packages-dev": [], @@ -2056,5 +2542,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.6.0" } diff --git a/tools/php-cs-fixer/vendor/autoload.php b/tools/php-cs-fixer/vendor/autoload.php index af11a0ee..aaa8907f 100644 --- a/tools/php-cs-fixer/vendor/autoload.php +++ b/tools/php-cs-fixer/vendor/autoload.php @@ -2,6 +2,24 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + trigger_error( + $err, + E_USER_ERROR + ); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit5d6f4352aed43a8d4e8a161c85a71e74::getLoader(); diff --git a/tools/php-cs-fixer/vendor/bin/php-cs-fixer b/tools/php-cs-fixer/vendor/bin/php-cs-fixer index 897061a4..d40411aa 100755 --- a/tools/php-cs-fixer/vendor/bin/php-cs-fixer +++ b/tools/php-cs-fixer/vendor/bin/php-cs-fixer @@ -108,10 +108,12 @@ if (PHP_VERSION_ID < 80000) { } } - if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer'); - exit(0); + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer'); } } -include __DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer'; +return include __DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer'; diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/.github/FUNDING.yml b/tools/php-cs-fixer/vendor/clue/ndjson-react/.github/FUNDING.yml new file mode 100644 index 00000000..9c09fb87 --- /dev/null +++ b/tools/php-cs-fixer/vendor/clue/ndjson-react/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: clue +custom: https://clue.engineering/support diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/CHANGELOG.md b/tools/php-cs-fixer/vendor/clue/ndjson-react/CHANGELOG.md new file mode 100644 index 00000000..bc4faf69 --- /dev/null +++ b/tools/php-cs-fixer/vendor/clue/ndjson-react/CHANGELOG.md @@ -0,0 +1,75 @@ +# Changelog + +## 1.3.0 (2022-12-23) + +* Feature: Add support for PHP 8.1 and PHP 8.2. + (#31 by @clue and #30 by @SimonFring) + +* Feature: Check type of incoming `data` before trying to decode NDJSON. + (#29 by @SimonFrings) + +* Improve documentation and examples and update to new [default loop](https://reactphp.org/event-loop/#loop). + (#26 by @clue, #27 by @SimonFrings and #25 by @PaulRotmann) + +* Improve test suite, report failed assertions and ensure 100% code coverage. + (#32 and #33 by @clue and #28 by @SimonFrings) + +## 1.2.0 (2020-12-09) + +* Improve test suite and add `.gitattributes` to exclude dev files from exports. + Add PHP 8 support, update to PHPUnit 9 and simplify test setup. + (#18 by @clue and #19, #22 and #23 by @SimonFrings) + +## 1.1.0 (2020-02-04) + +* Feature: Improve error reporting and add parsing error message to Exception and + ignore `JSON_THROW_ON_ERROR` option (available as of PHP 7.3). + (#14 by @clue) + +* Feature: Add bechmarking script and import all global function references. + (#16 by @clue) + +* Improve documentation and add NDJSON format description and + add support / sponsorship info. + (#12 and #17 by @clue) + +* Improve test suite to run tests on PHP 7.4 and simplify test matrix and + apply minor code style adjustments to make phpstan happy. + (#13 and #15 by @clue) + +## 1.0.0 (2018-05-17) + +* First stable release, now following SemVer + +* Improve documentation and usage examples + +> Contains no other changes, so it's actually fully compatible with the v0.1.2 release. + +## 0.1.2 (2018-05-11) + +* Feature: Limit buffer size to 64 KiB by default. + (#10 by @clue) + +* Feature: Forward compatiblity with EventLoop v0.5 and upcoming v1.0. + (#8 by @clue) + +* Fix: Return bool `false` if encoding fails due to invalid value to pause source. + (#9 by @clue) + +* Improve test suite by supporting PHPUnit v6 and test against legacy PHP 5.3 through PHP 7.2. + (#7 by @clue) + +* Update project homepage. + (#11 by @clue) + +## 0.1.1 (2017-05-22) + +* Feature: Forward compatibility with Stream v0.7, v0.6, v0.5 and upcoming v1.0 (while keeping BC) + (#6 by @thklein) + +* Improved test suite by adding PHPUnit to `require-dev` + (#5 by @thklein) + +## 0.1.0 (2016-11-24) + +* First tagged release diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/LICENSE b/tools/php-cs-fixer/vendor/clue/ndjson-react/LICENSE similarity index 58% rename from tools/php-cs-fixer/vendor/doctrine/annotations/LICENSE rename to tools/php-cs-fixer/vendor/clue/ndjson-react/LICENSE index 5e781fce..7baae8e9 100644 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/LICENSE +++ b/tools/php-cs-fixer/vendor/clue/ndjson-react/LICENSE @@ -1,11 +1,13 @@ -Copyright (c) 2006-2013 Doctrine Project +The MIT License (MIT) -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: +Copyright (c) 2016 Christian Lück + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. @@ -15,5 +17,5 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/README.md b/tools/php-cs-fixer/vendor/clue/ndjson-react/README.md new file mode 100644 index 00000000..0ca4eabe --- /dev/null +++ b/tools/php-cs-fixer/vendor/clue/ndjson-react/README.md @@ -0,0 +1,365 @@ +# clue/reactphp-ndjson + +[![CI status](https://github.com/clue/reactphp-ndjson/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/reactphp-ndjson/actions) +[![installs on Packagist](https://img.shields.io/packagist/dt/clue/ndjson-react?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/clue/ndjson-react) +[![code coverage](https://img.shields.io/badge/code%20coverage-100%25-success)](#tests) + +Streaming newline-delimited JSON ([NDJSON](http://ndjson.org/)) parser and encoder for [ReactPHP](https://reactphp.org/). + +[NDJSON](http://ndjson.org/) can be used to store multiple JSON records in a +file to store any kind of (uniform) structured data, such as a list of user +objects or log entries. It uses a simple newline character between each +individual record and as such can be both used for efficient persistence and +simple append-style operations. This also allows it to be used in a streaming +context, such as a simple inter-process communication (IPC) protocol or for a +remote procedure call (RPC) mechanism. This library provides a simple +streaming API to process very large NDJSON files with thousands or even millions +of rows efficiently without having to load the whole file into memory at once. + +* **Standard interfaces** - + Allows easy integration with existing higher-level components by implementing + ReactPHP's standard streaming interfaces. +* **Lightweight, SOLID design** - + Provides a thin abstraction that is [*just good enough*](https://en.wikipedia.org/wiki/Principle_of_good_enough) + and does not get in your way. + Builds on top of well-tested components and well-established concepts instead of reinventing the wheel. +* **Good test coverage** - + Comes with an [automated tests suite](#tests) and is regularly tested in the *real world*. + +**Table of contents** + +* [Support us](#support-us) +* [NDJSON format](#ndjson-format) +* [Usage](#usage) + * [Decoder](#decoder) + * [Encoder](#encoder) +* [Install](#install) +* [Tests](#tests) +* [License](#license) +* [More](#more) + +## Support us + +We invest a lot of time developing, maintaining, and updating our awesome +open-source projects. You can help us sustain this high-quality of our work by +[becoming a sponsor on GitHub](https://github.com/sponsors/clue). Sponsors get +numerous benefits in return, see our [sponsoring page](https://github.com/sponsors/clue) +for details. + +Let's take these projects to the next level together! 🚀 + +## NDJSON format + +NDJSON ("Newline-Delimited JSON" or sometimes referred to as "JSON lines") is a +very simple text-based format for storing a large number of records, such as a +list of user records or log entries. + +```JSON +{"name":"Alice","age":30,"comment":"Yes, I like cheese"} +{"name":"Bob","age":50,"comment":"Hello\nWorld!"} +``` + +If you understand JSON and you're now looking at this newline-delimited JSON for +the first time, you should already know everything you need to know to +understand NDJSON: As the name implies, this format essentially consists of +individual lines where each individual line is any valid JSON text and each line +is delimited with a newline character. + +This example uses a list of user objects where each user has some arbitrary +properties. This can easily be adjusted for many different use cases, such as +storing for example products instead of users, assigning additional properties +or having a significantly larger number of records. You can edit NDJSON files in +any text editor or use them in a streaming context where individual records +should be processed. Unlike normal JSON files, adding a new log entry to this +NDJSON file does not require modification of this file's structure (note there's +no "outer array" to be modified). This makes it a perfect fit for a streaming +context, for line-oriented CLI tools (such as `grep` and others) or for a logging +context where you want to append records at a later time. Additionally, this +also allows it to be used in a streaming context, such as a simple inter-process +communication (IPC) protocol or for a remote procedure call (RPC) mechanism. + +The newline character at the end of each line allows for some really simple +*framing* (detecting individual records). While each individual line is valid +JSON, the complete file as a whole is technically no longer valid JSON, because +it contains multiple JSON texts. This implies that for example calling PHP's +`json_decode()` on this complete input would fail because it would try to parse +multiple records at once. Likewise, using "pretty printing" JSON +(`JSON_PRETTY_PRINT`) is not allowed because each JSON text is limited to exactly +one line. On the other hand, values containing newline characters (such as the +`comment` property in the above example) do not cause issues because each newline +within a JSON string will be represented by a `\n` instead. + +One common alternative to NDJSON would be Comma-Separated Values (CSV). +If you want to process CSV files, you may want to take a look at the related +project [clue/reactphp-csv](https://github.com/clue/reactphp-csv) instead: + +``` +name,age,comment +Alice,30,"Yes, I like cheese" +Bob,50,"Hello +World!" +``` + +CSV may look slightly simpler, but this simplicity comes at a price. CSV is +limited to untyped, two-dimensional data, so there's no standard way of storing +any nested structures or to differentiate a boolean value from a string or +integer. Field names are sometimes used, sometimes they're not +(application-dependant). Inconsistent handling for fields that contain +separators such as `,` or spaces or line breaks (see the `comment` field above) +introduce additional complexity and its text encoding is usually undefined, +Unicode (or UTF-8) is unlikely to be supported and CSV files often use ISO +8859-1 encoding or some variant (again application-dependant). + +While NDJSON helps avoiding many of CSV's shortcomings, it is still a +(relatively) young format while CSV files have been used in production systems +for decades. This means that if you want to interface with an existing system, +you may have to rely on the format that's already supported. If you're building +a new system, using NDJSON is an excellent choice as it provides a flexible way +to process individual records using a common text-based format that can include +any kind of structured data. + +## Usage + +### Decoder + +The `Decoder` (parser) class can be used to make sure you only get back +complete, valid JSON elements when reading from a stream. +It wraps a given +[`ReadableStreamInterface`](https://github.com/reactphp/stream#readablestreaminterface) +and exposes its data through the same interface, but emits the JSON elements +as parsed values instead of just chunks of strings: + +``` +{"name":"test","active":true} +{"name":"hello w\u00f6rld","active":true} +``` + +```php +$stdin = new React\Stream\ReadableResourceStream(STDIN); + +$ndjson = new Clue\React\NDJson\Decoder($stdin); + +$ndjson->on('data', function ($data) { + // $data is a parsed element from the JSON stream + // line 1: $data = (object)array('name' => 'test', 'active' => true); + // line 2: $data = (object)array('name' => 'hello wörld', 'active' => true); + var_dump($data); +}); +``` + +ReactPHP's streams emit chunks of data strings and make no assumption about their lengths. +These chunks do not necessarily represent complete JSON elements, as an +element may be broken up into multiple chunks. +This class reassembles these elements by buffering incomplete ones. + +The `Decoder` supports the same optional parameters as the underlying +[`json_decode()`](https://www.php.net/manual/en/function.json-decode.php) function. +This means that, by default, JSON objects will be emitted as a `stdClass`. +This behavior can be controlled through the optional constructor parameters: + +```php +$ndjson = new Clue\React\NDJson\Decoder($stdin, true); + +$ndjson->on('data', function ($data) { + // JSON objects will be emitted as assoc arrays now +}); +``` + +Additionally, the `Decoder` limits the maximum buffer size (maximum line +length) to avoid buffer overflows due to malformed user input. Usually, there +should be no need to change this value, unless you know you're dealing with some +unreasonably long lines. It accepts an additional argument if you want to change +this from the default of 64 KiB: + +```php +$ndjson = new Clue\React\NDJson\Decoder($stdin, false, 512, 0, 64 * 1024); +``` + +If the underlying stream emits an `error` event or the plain stream contains +any data that does not represent a valid NDJson stream, +it will emit an `error` event and then `close` the input stream: + +```php +$ndjson->on('error', function (Exception $error) { + // an error occured, stream will close next +}); +``` + +If the underlying stream emits an `end` event, it will flush any incomplete +data from the buffer, thus either possibly emitting a final `data` event +followed by an `end` event on success or an `error` event for +incomplete/invalid JSON data as above: + +```php +$ndjson->on('end', function () { + // stream successfully ended, stream will close next +}); +``` + +If either the underlying stream or the `Decoder` is closed, it will forward +the `close` event: + +```php +$ndjson->on('close', function () { + // stream closed + // possibly after an "end" event or due to an "error" event +}); +``` + +The `close(): void` method can be used to explicitly close the `Decoder` and +its underlying stream: + +```php +$ndjson->close(); +``` + +The `pipe(WritableStreamInterface $dest, array $options = array(): WritableStreamInterface` +method can be used to forward all data to the given destination stream. +Please note that the `Decoder` emits decoded/parsed data events, while many +(most?) writable streams expect only data chunks: + +```php +$ndjson->pipe($logger); +``` + +For more details, see ReactPHP's +[`ReadableStreamInterface`](https://github.com/reactphp/stream#readablestreaminterface). + +### Encoder + +The `Encoder` (serializer) class can be used to make sure anything you write to +a stream ends up as valid JSON elements in the resulting NDJSON stream. +It wraps a given +[`WritableStreamInterface`](https://github.com/reactphp/stream#writablestreaminterface) +and accepts its data through the same interface, but handles any data as complete +JSON elements instead of just chunks of strings: + +```php +$stdout = new React\Stream\WritableResourceStream(STDOUT); + +$ndjson = new Clue\React\NDJson\Encoder($stdout); + +$ndjson->write(array('name' => 'test', 'active' => true)); +$ndjson->write(array('name' => 'hello wörld', 'active' => true)); +``` +``` +{"name":"test","active":true} +{"name":"hello w\u00f6rld","active":true} +``` + +The `Encoder` supports the same parameters as the underlying +[`json_encode()`](https://www.php.net/manual/en/function.json-encode.php) function. +This means that, by default, Unicode characters will be escaped in the output. +This behavior can be controlled through the optional constructor parameters: + +```php +$ndjson = new Clue\React\NDJson\Encoder($stdout, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + +$ndjson->write('hello wörld'); +``` +``` +"hello wörld" +``` + +Note that trying to pass the `JSON_PRETTY_PRINT` option will yield an +`InvalidArgumentException` because it is not compatible with NDJSON. + +If the underlying stream emits an `error` event or the given data contains +any data that can not be represented as a valid NDJSON stream, +it will emit an `error` event and then `close` the input stream: + +```php +$ndjson->on('error', function (Exception $error) { + // an error occured, stream will close next +}); +``` + +If either the underlying stream or the `Encoder` is closed, it will forward +the `close` event: + +```php +$ndjson->on('close', function () { + // stream closed + // possibly after an "end" event or due to an "error" event +}); +``` + +The `end(mixed $data = null): void` method can be used to optionally emit +any final data and then soft-close the `Encoder` and its underlying stream: + +```php +$ndjson->end(); +``` + +The `close(): void` method can be used to explicitly close the `Encoder` and +its underlying stream: + +```php +$ndjson->close(); +``` + +For more details, see ReactPHP's +[`WritableStreamInterface`](https://github.com/reactphp/stream#writablestreaminterface). + +## Install + +The recommended way to install this library is [through Composer](https://getcomposer.org/). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) + +This project follows [SemVer](https://semver.org/). +This will install the latest supported version: + +```bash +composer require clue/ndjson-react:^1.3 +``` + +See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. + +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.3 through current PHP 8+ and +HHVM. +It's *highly recommended to use the latest supported PHP version* for this project. + +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org/): + +```bash +composer install +``` + +To run the test suite, go to the project root and run: + +```bash +vendor/bin/phpunit +``` + +## License + +This project is released under the permissive [MIT license](LICENSE). + +> Did you know that I offer custom development services and issuing invoices for + sponsorships of releases and for contributions? Contact me (@clue) for details. + +## More + +* If you want to learn more about processing streams of data, refer to the documentation of + the underlying [react/stream](https://github.com/reactphp/stream) component. + +* If you want to process compressed NDJSON files (`.ndjson.gz` file extension), + you may want to use [clue/reactphp-zlib](https://github.com/clue/reactphp-zlib) + on the compressed input stream before passing the decompressed stream to the NDJSON decoder. + +* If you want to create compressed NDJSON files (`.ndjson.gz` file extension), + you may want to use [clue/reactphp-zlib](https://github.com/clue/reactphp-zlib) + on the resulting NDJSON encoder output stream before passing the compressed + stream to the file output stream. + +* If you want to concurrently process the records from your NDJSON stream, + you may want to use [clue/reactphp-flux](https://github.com/clue/reactphp-flux) + to concurrently process many (but not too many) records at once. + +* If you want to process structured data in the more common text-based format, + you may want to use [clue/reactphp-csv](https://github.com/clue/reactphp-csv) + to process Comma-Separated-Values (CSV) files (`.csv` file extension). diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/composer.json b/tools/php-cs-fixer/vendor/clue/ndjson-react/composer.json new file mode 100644 index 00000000..01a4b859 --- /dev/null +++ b/tools/php-cs-fixer/vendor/clue/ndjson-react/composer.json @@ -0,0 +1,31 @@ +{ + "name": "clue/ndjson-react", + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "keywords": ["NDJSON", "newline", "JSON", "jsonlines", "streaming", "ReactPHP"], + "homepage": "https://github.com/clue/reactphp-ndjson", + "license": "MIT", + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" + }, + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Clue\\Tests\\React\\NDJson\\": "tests/" + } + } +} diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Decoder.php b/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Decoder.php new file mode 100644 index 00000000..876ff2b1 --- /dev/null +++ b/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Decoder.php @@ -0,0 +1,166 @@ +input = $input; + + if (!$input->isReadable()) { + $this->close(); + return; + } + + $this->assoc = $assoc; + $this->depth = $depth; + $this->options = $options; + $this->maxlength = $maxlength; + + $this->input->on('data', array($this, 'handleData')); + $this->input->on('end', array($this, 'handleEnd')); + $this->input->on('error', array($this, 'handleError')); + $this->input->on('close', array($this, 'close')); + } + + public function isReadable() + { + return !$this->closed; + } + + public function close() + { + if ($this->closed) { + return; + } + + $this->closed = true; + $this->buffer = ''; + + $this->input->close(); + + $this->emit('close'); + $this->removeAllListeners(); + } + + public function pause() + { + $this->input->pause(); + } + + public function resume() + { + $this->input->resume(); + } + + public function pipe(WritableStreamInterface $dest, array $options = array()) + { + Util::pipe($this, $dest, $options); + + return $dest; + } + + /** @internal */ + public function handleData($data) + { + if (!\is_string($data)) { + $this->handleError(new \UnexpectedValueException('Expected stream to emit string, but got ' . \gettype($data))); + return; + } + + $this->buffer .= $data; + + // keep parsing while a newline has been found + while (($newline = \strpos($this->buffer, "\n")) !== false && $newline <= $this->maxlength) { + // read data up until newline and remove from buffer + $data = (string)\substr($this->buffer, 0, $newline); + $this->buffer = (string)\substr($this->buffer, $newline + 1); + + // decode data with options given in ctor + // @codeCoverageIgnoreStart + if ($this->options === 0) { + $data = \json_decode($data, $this->assoc, $this->depth); + } else { + assert(\PHP_VERSION_ID >= 50400); + $data = \json_decode($data, $this->assoc, $this->depth, $this->options); + } + // @codeCoverageIgnoreEnd + + // abort stream if decoding failed + if ($data === null && \json_last_error() !== \JSON_ERROR_NONE) { + // @codeCoverageIgnoreStart + if (\PHP_VERSION_ID > 50500) { + $errstr = \json_last_error_msg(); + } elseif (\json_last_error() === \JSON_ERROR_SYNTAX) { + $errstr = 'Syntax error'; + } else { + $errstr = 'Unknown error'; + } + // @codeCoverageIgnoreEnd + return $this->handleError(new \RuntimeException('Unable to decode JSON: ' . $errstr, \json_last_error())); + } + + $this->emit('data', array($data)); + } + + if (isset($this->buffer[$this->maxlength])) { + $this->handleError(new \OverflowException('Buffer size exceeded')); + } + } + + /** @internal */ + public function handleEnd() + { + if ($this->buffer !== '') { + $this->handleData("\n"); + } + + if (!$this->closed) { + $this->emit('end'); + $this->close(); + } + } + + /** @internal */ + public function handleError(\Exception $error) + { + $this->emit('error', array($error)); + $this->close(); + } +} diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Encoder.php b/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Encoder.php new file mode 100644 index 00000000..30d5c311 --- /dev/null +++ b/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Encoder.php @@ -0,0 +1,144 @@ +output = $output; + + if (!$output->isWritable()) { + $this->close(); + return; + } + + $this->options = $options; + $this->depth = $depth; + + $this->output->on('drain', array($this, 'handleDrain')); + $this->output->on('error', array($this, 'handleError')); + $this->output->on('close', array($this, 'close')); + } + + public function write($data) + { + if ($this->closed) { + return false; + } + + // we have to handle PHP warnings for legacy PHP < 5.5 + // certain values (such as INF etc.) emit a warning, but still encode successfully + // @codeCoverageIgnoreStart + if (\PHP_VERSION_ID < 50500) { + $errstr = null; + \set_error_handler(function ($_, $error) use (&$errstr) { + $errstr = $error; + }); + + // encode data with options given in ctor (depth not supported) + $data = \json_encode($data, $this->options); + + // always check error code and match missing error messages + \restore_error_handler(); + $errno = \json_last_error(); + if (\defined('JSON_ERROR_UTF8') && $errno === \JSON_ERROR_UTF8) { + // const JSON_ERROR_UTF8 added in PHP 5.3.3, but no error message assigned in legacy PHP < 5.5 + // this overrides PHP 5.3.14 only: https://3v4l.org/IGP8Z#v5314 + $errstr = 'Malformed UTF-8 characters, possibly incorrectly encoded'; + } elseif ($errno !== \JSON_ERROR_NONE && $errstr === null) { + // error number present, but no error message applicable + $errstr = 'Unknown error'; + } + + // abort stream if encoding fails + if ($errno !== \JSON_ERROR_NONE || $errstr !== null) { + $this->handleError(new \RuntimeException('Unable to encode JSON: ' . $errstr, $errno)); + return false; + } + } else { + // encode data with options given in ctor + $data = \json_encode($data, $this->options, $this->depth); + + // abort stream if encoding fails + if ($data === false && \json_last_error() !== \JSON_ERROR_NONE) { + $this->handleError(new \RuntimeException('Unable to encode JSON: ' . \json_last_error_msg(), \json_last_error())); + return false; + } + } + // @codeCoverageIgnoreEnd + + return $this->output->write($data . "\n"); + } + + public function end($data = null) + { + if ($data !== null) { + $this->write($data); + } + + $this->output->end(); + } + + public function isWritable() + { + return !$this->closed; + } + + public function close() + { + if ($this->closed) { + return; + } + + $this->closed = true; + $this->output->close(); + + $this->emit('close'); + $this->removeAllListeners(); + } + + /** @internal */ + public function handleDrain() + { + $this->emit('drain'); + } + + /** @internal */ + public function handleError(\Exception $error) + { + $this->emit('error', array($error)); + $this->close(); + } +} diff --git a/tools/php-cs-fixer/vendor/composer/ClassLoader.php b/tools/php-cs-fixer/vendor/composer/ClassLoader.php index afef3fa2..7824d8f7 100644 --- a/tools/php-cs-fixer/vendor/composer/ClassLoader.php +++ b/tools/php-cs-fixer/vendor/composer/ClassLoader.php @@ -42,35 +42,37 @@ */ class ClassLoader { - /** @var ?string */ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr0 = array(); @@ -78,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array + * @var array */ private $classMap = array(); @@ -87,29 +88,29 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array + * @var array */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } /** - * @return string[] + * @return array> */ public function getPrefixes() { @@ -121,8 +122,7 @@ public function getPrefixes() } /** - * @return array[] - * @psalm-return array> + * @return array> */ public function getPrefixesPsr4() { @@ -130,8 +130,7 @@ public function getPrefixesPsr4() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirs() { @@ -139,8 +138,7 @@ public function getFallbackDirs() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirsPsr4() { @@ -148,8 +146,7 @@ public function getFallbackDirsPsr4() } /** - * @return string[] Array of classname => path - * @psalm-return array + * @return array Array of classname => path */ public function getClassMap() { @@ -157,8 +154,7 @@ public function getClassMap() } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap + * @param array $classMap Class to filename map * * @return void */ @@ -175,24 +171,25 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -201,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -222,9 +219,9 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -232,17 +229,18 @@ public function add($prefix, $paths, $prepend = false) */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -252,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -272,8 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories * * @return void */ @@ -290,8 +288,8 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -425,7 +423,8 @@ public function unregister() public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } @@ -476,9 +475,9 @@ public function findFile($class) } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { @@ -555,18 +554,26 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/tools/php-cs-fixer/vendor/composer/InstalledVersions.php b/tools/php-cs-fixer/vendor/composer/InstalledVersions.php index d50e0c9f..51e734a7 100644 --- a/tools/php-cs-fixer/vendor/composer/InstalledVersions.php +++ b/tools/php-cs-fixer/vendor/composer/InstalledVersions.php @@ -21,12 +21,14 @@ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final */ class InstalledVersions { /** * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null */ private static $installed; @@ -37,7 +39,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array}> + * @psalm-var array}> */ private static $installedByVendor = array(); @@ -96,7 +98,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -117,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -241,7 +243,7 @@ public static function getInstallPath($packageName) /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { @@ -255,7 +257,7 @@ public static function getRootPackage() * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} */ public static function getRawData() { @@ -278,7 +280,7 @@ public static function getRawData() * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -301,7 +303,7 @@ public static function getAllRawData() * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data */ public static function reload($data) { @@ -311,7 +313,7 @@ public static function reload($data) /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { @@ -326,7 +328,9 @@ private static function getInstalled() if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -338,12 +342,17 @@ private static function getInstalled() // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/tools/php-cs-fixer/vendor/composer/autoload_classmap.php b/tools/php-cs-fixer/vendor/composer/autoload_classmap.php index 46781d65..1d1b8341 100644 --- a/tools/php-cs-fixer/vendor/composer/autoload_classmap.php +++ b/tools/php-cs-fixer/vendor/composer/autoload_classmap.php @@ -2,11 +2,12 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', diff --git a/tools/php-cs-fixer/vendor/composer/autoload_files.php b/tools/php-cs-fixer/vendor/composer/autoload_files.php index 002499ee..758ec42f 100644 --- a/tools/php-cs-fixer/vendor/composer/autoload_files.php +++ b/tools/php-cs-fixer/vendor/composer/autoload_files.php @@ -2,16 +2,17 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( + 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', - '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', ); diff --git a/tools/php-cs-fixer/vendor/composer/autoload_namespaces.php b/tools/php-cs-fixer/vendor/composer/autoload_namespaces.php index b7fc0125..15a2ff3a 100644 --- a/tools/php-cs-fixer/vendor/composer/autoload_namespaces.php +++ b/tools/php-cs-fixer/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/tools/php-cs-fixer/vendor/composer/autoload_psr4.php b/tools/php-cs-fixer/vendor/composer/autoload_psr4.php index e0608504..b34ad2ea 100644 --- a/tools/php-cs-fixer/vendor/composer/autoload_psr4.php +++ b/tools/php-cs-fixer/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( @@ -22,14 +22,21 @@ 'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'), 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), + 'React\\Stream\\' => array($vendorDir . '/react/stream/src'), + 'React\\Socket\\' => array($vendorDir . '/react/socket/src'), + 'React\\Promise\\' => array($vendorDir . '/react/promise/src'), + 'React\\EventLoop\\' => array($vendorDir . '/react/event-loop/src'), + 'React\\Dns\\' => array($vendorDir . '/react/dns/src'), + 'React\\ChildProcess\\' => array($vendorDir . '/react/child-process/src'), + 'React\\Cache\\' => array($vendorDir . '/react/cache/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), 'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), - 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), 'PhpCsFixer\\' => array($vendorDir . '/friendsofphp/php-cs-fixer/src'), - 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/src'), - 'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations'), + 'Fidry\\CpuCoreCounter\\' => array($vendorDir . '/fidry/cpu-core-counter/src'), + 'Evenement\\' => array($vendorDir . '/evenement/evenement/src'), 'Composer\\XdebugHandler\\' => array($vendorDir . '/composer/xdebug-handler/src'), 'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'), 'Composer\\Pcre\\' => array($vendorDir . '/composer/pcre/src'), + 'Clue\\React\\NDJson\\' => array($vendorDir . '/clue/ndjson-react/src'), ); diff --git a/tools/php-cs-fixer/vendor/composer/autoload_real.php b/tools/php-cs-fixer/vendor/composer/autoload_real.php index 6aef2ef8..79ef3fb8 100644 --- a/tools/php-cs-fixer/vendor/composer/autoload_real.php +++ b/tools/php-cs-fixer/vendor/composer/autoload_real.php @@ -25,56 +25,26 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInit5d6f4352aed43a8d4e8a161c85a71e74', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit5d6f4352aed43a8d4e8a161c85a71e74', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74::getInitializer($loader)); - call_user_func(\Composer\Autoload\ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } + $loader->register(true); - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } + $filesToLoad = \Composer\Autoload\ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); + require $file; } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire5d6f4352aed43a8d4e8a161c85a71e74($fileIdentifier, $file); + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequire5d6f4352aed43a8d4e8a161c85a71e74($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/autoload_static.php b/tools/php-cs-fixer/vendor/composer/autoload_static.php index 61f3edd0..508ac083 100644 --- a/tools/php-cs-fixer/vendor/composer/autoload_static.php +++ b/tools/php-cs-fixer/vendor/composer/autoload_static.php @@ -7,14 +7,15 @@ class ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74 { public static $files = array ( + 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', - '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', ); public static $prefixLengthsPsr4 = array ( @@ -37,24 +38,37 @@ class ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74 'Symfony\\Component\\EventDispatcher\\' => 34, 'Symfony\\Component\\Console\\' => 26, ), + 'R' => + array ( + 'React\\Stream\\' => 13, + 'React\\Socket\\' => 13, + 'React\\Promise\\' => 14, + 'React\\EventLoop\\' => 16, + 'React\\Dns\\' => 10, + 'React\\ChildProcess\\' => 19, + 'React\\Cache\\' => 12, + ), 'P' => array ( 'Psr\\Log\\' => 8, 'Psr\\EventDispatcher\\' => 20, 'Psr\\Container\\' => 14, - 'Psr\\Cache\\' => 10, 'PhpCsFixer\\' => 11, ), - 'D' => + 'F' => + array ( + 'Fidry\\CpuCoreCounter\\' => 21, + ), + 'E' => array ( - 'Doctrine\\Common\\Lexer\\' => 22, - 'Doctrine\\Common\\Annotations\\' => 28, + 'Evenement\\' => 10, ), 'C' => array ( 'Composer\\XdebugHandler\\' => 23, 'Composer\\Semver\\' => 16, 'Composer\\Pcre\\' => 14, + 'Clue\\React\\NDJson\\' => 18, ), ); @@ -123,6 +137,34 @@ class ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74 array ( 0 => __DIR__ . '/..' . '/symfony/console', ), + 'React\\Stream\\' => + array ( + 0 => __DIR__ . '/..' . '/react/stream/src', + ), + 'React\\Socket\\' => + array ( + 0 => __DIR__ . '/..' . '/react/socket/src', + ), + 'React\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/react/promise/src', + ), + 'React\\EventLoop\\' => + array ( + 0 => __DIR__ . '/..' . '/react/event-loop/src', + ), + 'React\\Dns\\' => + array ( + 0 => __DIR__ . '/..' . '/react/dns/src', + ), + 'React\\ChildProcess\\' => + array ( + 0 => __DIR__ . '/..' . '/react/child-process/src', + ), + 'React\\Cache\\' => + array ( + 0 => __DIR__ . '/..' . '/react/cache/src', + ), 'Psr\\Log\\' => array ( 0 => __DIR__ . '/..' . '/psr/log/src', @@ -135,21 +177,17 @@ class ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74 array ( 0 => __DIR__ . '/..' . '/psr/container/src', ), - 'Psr\\Cache\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/cache/src', - ), 'PhpCsFixer\\' => array ( 0 => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src', ), - 'Doctrine\\Common\\Lexer\\' => + 'Fidry\\CpuCoreCounter\\' => array ( - 0 => __DIR__ . '/..' . '/doctrine/lexer/src', + 0 => __DIR__ . '/..' . '/fidry/cpu-core-counter/src', ), - 'Doctrine\\Common\\Annotations\\' => + 'Evenement\\' => array ( - 0 => __DIR__ . '/..' . '/doctrine/annotations/lib/Doctrine/Common/Annotations', + 0 => __DIR__ . '/..' . '/evenement/evenement/src', ), 'Composer\\XdebugHandler\\' => array ( @@ -163,10 +201,15 @@ class ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74 array ( 0 => __DIR__ . '/..' . '/composer/pcre/src', ), + 'Clue\\React\\NDJson\\' => + array ( + 0 => __DIR__ . '/..' . '/clue/ndjson-react/src', + ), ); public static $classMap = array ( 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'CURLStringFile' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', diff --git a/tools/php-cs-fixer/vendor/composer/installed.json b/tools/php-cs-fixer/vendor/composer/installed.json index 8443d0e0..642d68a1 100644 --- a/tools/php-cs-fixer/vendor/composer/installed.json +++ b/tools/php-cs-fixer/vendor/composer/installed.json @@ -1,31 +1,106 @@ { "packages": [ + { + "name": "clue/ndjson-react", + "version": "v1.3.0", + "version_normalized": "1.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" + }, + "time": "2022-12-23T10:58:28+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "install-path": "../clue/ndjson-react" + }, { "name": "composer/pcre", - "version": "3.1.0", - "version_normalized": "3.1.0.0", + "version": "3.3.2", + "version_normalized": "3.3.2.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" }, - "time": "2022-11-17T09:50:14+00:00", + "time": "2024-11-12T16:29:46+00:00", "type": "library", "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, "branch-alias": { "dev-main": "3.x-dev" } @@ -56,7 +131,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.0" + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { @@ -76,27 +151,27 @@ }, { "name": "composer/semver", - "version": "3.3.2", - "version_normalized": "3.3.2.0", + "version": "3.4.3", + "version_normalized": "3.4.3.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, - "time": "2022-04-01T19:23:25+00:00", + "time": "2024-09-19T14:15:21+00:00", "type": "library", "extra": { "branch-alias": { @@ -138,9 +213,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -160,17 +235,17 @@ }, { "name": "composer/xdebug-handler", - "version": "3.0.3", - "version_normalized": "3.0.3.0", + "version": "3.0.5", + "version_normalized": "3.0.5.0", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { @@ -181,9 +256,9 @@ "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, - "time": "2022-02-25T21:32:43+00:00", + "time": "2024-05-06T16:37:16+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -207,9 +282,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, "funding": [ { @@ -228,43 +303,32 @@ "install-path": "./xdebug-handler" }, { - "name": "doctrine/annotations", - "version": "2.0.1", - "version_normalized": "2.0.1.0", + "name": "evenement/evenement", + "version": "v3.0.2", + "version_normalized": "3.0.2.0", "source": { "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", "shasum": "" }, "require": { - "doctrine/lexer": "^2 || ^3", - "ext-tokenizer": "*", - "php": "^7.2 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" + "php": ">=7.0" }, "require-dev": { - "doctrine/cache": "^2.0", - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + "phpunit/phpunit": "^9 || ^6" }, - "time": "2023-02-02T22:02:53+00:00", + "time": "2023-08-08T05:53:35+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + "Evenement\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -273,70 +337,56 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" } ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "description": "Événement is a very simple event dispatching library for PHP", "keywords": [ - "annotations", - "docblock", - "parser" + "event-dispatcher", + "event-emitter" ], "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/2.0.1" + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" }, - "install-path": "../doctrine/annotations" + "install-path": "../evenement/evenement" }, { - "name": "doctrine/lexer", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "name": "fidry/cpu-core-counter", + "version": "1.2.0", + "version_normalized": "1.2.0.0", "source": { "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "84a527db05647743d50373e0ec53a152f2cde568" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", - "reference": "84a527db05647743d50373e0ec53a152f2cde568", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", "shasum": "" }, "require": { - "php": "^8.1" + "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.0" - }, - "time": "2022-12-15T16:57:16+00:00", + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "time": "2024-08-06T10:04:20+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "src" + "Fidry\\CpuCoreCounter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -345,103 +395,87 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" } ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "description": "Tiny utility to get the number of CPU cores.", "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" + "CPU", + "core" ], "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.0" + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" + "url": "https://github.com/theofidry", + "type": "github" } ], - "install-path": "../doctrine/lexer" + "install-path": "../fidry/cpu-core-counter" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.16.0", - "version_normalized": "3.16.0.0", + "version": "v3.68.1", + "version_normalized": "3.68.1.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc" + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", - "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b9db2b2ea3cdba7201067acee46f984ef2397cff", + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff", "shasum": "" }, "require": { - "composer/semver": "^3.3", + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^2", - "doctrine/lexer": "^2 || ^3", + "ext-filter": "*", "ext-json": "*", "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.2", "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0 || ^5.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.27", - "symfony/polyfill-php80": "^1.27", - "symfony/polyfill-php81": "^1.27", - "symfony/process": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.1 || ^6.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" }, "require-dev": { - "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^2.0", - "mikey179/vfsstream": "^1.6.11", - "php-coveralls/php-coveralls": "^2.5.3", + "facile-it/paraunit": "^1.3.1 || ^2.4", + "infection/infection": "^0.29.8", + "justinrainbow/json-schema": "^5.3 || ^6.0", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.7", "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.16", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.6", - "phpunitgoodpractices/traits": "^1.9.2", - "symfony/phpunit-bridge": "^6.2.3", - "symfony/yaml": "^5.4 || ^6.0" + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", + "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" }, "suggest": { "ext-dom": "For handling output formats in XML", "ext-mbstring": "For handling non-UTF8 characters." }, - "time": "2023-04-02T19:30:06+00:00", + "time": "2025-01-17T09:20:36+00:00", "bin": [ "php-cs-fixer" ], @@ -450,7 +484,10 @@ "autoload": { "psr-4": { "PhpCsFixer\\": "src/" - } + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -475,7 +512,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.16.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.1" }, "funding": [ { @@ -485,58 +522,6 @@ ], "install-path": "../friendsofphp/php-cs-fixer" }, - { - "name": "psr/cache", - "version": "3.0.0", - "version_normalized": "3.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "time": "2021-02-03T23:26:27+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "install-path": "../psr/cache" - }, { "name": "psr/container", "version": "2.0.2", @@ -648,23 +633,23 @@ }, { "name": "psr/log", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "version": "3.0.2", + "version_normalized": "3.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { "php": ">=8.0.0" }, - "time": "2021-07-14T16:46:02+00:00", + "time": "2024-09-11T13:17:53+00:00", "type": "library", "extra": { "branch-alias": { @@ -695,37 +680,584 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, "install-path": "../psr/log" }, + { + "name": "react/cache", + "version": "v1.2.0", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "time": "2022-11-30T15:59:55+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "install-path": "../react/cache" + }, + { + "name": "react/child-process", + "version": "v0.6.6", + "version_normalized": "0.6.6.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "time": "2025-01-01T16:37:48+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.6" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "install-path": "../react/child-process" + }, + { + "name": "react/dns", + "version": "v1.13.0", + "version_normalized": "1.13.0.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "time": "2024-06-13T14:18:03+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "install-path": "../react/dns" + }, + { + "name": "react/event-loop", + "version": "v1.5.0", + "version_normalized": "1.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "time": "2023-11-13T13:48:05+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "install-path": "../react/event-loop" + }, + { + "name": "react/promise", + "version": "v3.2.0", + "version_normalized": "3.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "time": "2024-05-24T10:39:05+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "install-path": "../react/promise" + }, + { + "name": "react/socket", + "version": "v1.16.0", + "version_normalized": "1.16.0.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" + }, + "time": "2024-07-26T10:38:09+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.16.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "install-path": "../react/socket" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "version_normalized": "1.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "time": "2024-06-11T12:45:25+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "install-path": "../react/stream" + }, { "name": "sebastian/diff", - "version": "5.0.3", - "version_normalized": "5.0.3.0", + "version": "6.0.2", + "version_normalized": "6.0.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", - "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.0", "symfony/process": "^4.2 || ^5" }, - "time": "2023-05-01T07:48:21+00:00", + "time": "2024-07-03T04:53:05+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "installation-source": "dist", @@ -759,7 +1291,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -771,52 +1303,49 @@ }, { "name": "symfony/console", - "version": "v6.2.10", - "version_normalized": "6.2.10.0", + "version": "v7.2.1", + "version_normalized": "7.2.1.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "12288d9f4500f84a4d02254d4aa968b15488476f" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/12288d9f4500f84a4d02254d4aa968b15488476f", - "reference": "12288d9f4500f84a4d02254d4aa968b15488476f", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "time": "2023-04-28T13:37:43+00:00", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "time": "2024-12-11T03:49:26+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -850,7 +1379,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.10" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -870,31 +1399,31 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.1", - "version_normalized": "3.2.1.0", + "version": "v3.5.1", + "version_normalized": "3.5.1.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { "php": ">=8.1" }, - "time": "2023-03-01T10:25:55+00:00", + "time": "2024-09-25T14:20:29+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "installation-source": "dist", @@ -920,7 +1449,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -940,25 +1469,26 @@ }, { "name": "symfony/event-dispatcher", - "version": "v6.2.8", - "version_normalized": "6.2.8.0", + "version": "v7.2.0", + "version_normalized": "7.2.0.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339" + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/04046f35fd7d72f9646e721fc2ecb8f9c67d3339", - "reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2|^3" + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", @@ -966,19 +1496,15 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "time": "2023-03-20T16:06:02+00:00", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" + }, + "time": "2024-09-25T14:21:43+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1006,7 +1532,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.2.8" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" }, "funding": [ { @@ -1026,35 +1552,32 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.2.1", - "version_normalized": "3.2.1.0", + "version": "v3.5.1", + "version_normalized": "3.5.1.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd" + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "time": "2023-03-01T10:32:47+00:00", + "time": "2024-09-25T14:20:29+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "installation-source": "dist", @@ -1088,7 +1611,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" }, "funding": [ { @@ -1108,25 +1631,28 @@ }, { "name": "symfony/filesystem", - "version": "v6.2.10", - "version_normalized": "6.2.10.0", + "version": "v7.2.0", + "version_normalized": "7.2.0.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd588debf7d1bc16a2c84b4b3b71145d9946b894", - "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, - "time": "2023-04-18T13:46:08+00:00", + "require-dev": { + "symfony/process": "^6.4|^7.0" + }, + "time": "2024-10-25T15:15:23+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1154,7 +1680,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.2.10" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -1174,26 +1700,26 @@ }, { "name": "symfony/finder", - "version": "v6.2.7", - "version_normalized": "6.2.7.0", + "version": "v7.2.2", + "version_normalized": "7.2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb" + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb", - "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "symfony/filesystem": "^6.0" + "symfony/filesystem": "^6.4|^7.0" }, - "time": "2023-02-16T09:57:23+00:00", + "time": "2024-12-30T19:00:17+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1221,7 +1747,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.2.7" + "source": "https://github.com/symfony/finder/tree/v7.2.2" }, "funding": [ { @@ -1241,24 +1767,24 @@ }, { "name": "symfony/options-resolver", - "version": "v6.2.7", - "version_normalized": "6.2.7.0", + "version": "v7.2.0", + "version_normalized": "7.2.0.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "aa0e85b53bbb2b4951960efd61d295907eacd629" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/aa0e85b53bbb2b4951960efd61d295907eacd629", - "reference": "aa0e85b53bbb2b4951960efd61d295907eacd629", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" }, - "time": "2023-02-14T08:44:56+00:00", + "time": "2024-11-20T11:17:29+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1291,7 +1817,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.2.7" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -1311,21 +1837,21 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -1333,15 +1859,12 @@ "suggest": { "ext-ctype": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -1376,7 +1899,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -1396,34 +1919,31 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -1460,7 +1980,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -1480,34 +2000,31 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -1547,7 +2064,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -1567,21 +2084,21 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -1589,15 +2106,12 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -1633,7 +2147,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -1653,31 +2167,28 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -1719,7 +2230,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -1739,31 +2250,28 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -1801,7 +2309,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { @@ -1821,23 +2329,23 @@ }, { "name": "symfony/process", - "version": "v6.2.10", - "version_normalized": "6.2.10.0", + "version": "v7.2.0", + "version_normalized": "7.2.0.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e", - "reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, - "time": "2023-04-18T13:56:57+00:00", + "time": "2024-11-06T14:24:19+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1865,7 +2373,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.2.10" + "source": "https://github.com/symfony/process/tree/v7.2.0" }, "funding": [ { @@ -1885,38 +2393,36 @@ }, { "name": "symfony/service-contracts", - "version": "v3.2.1", - "version_normalized": "3.2.1.0", + "version": "v3.5.1", + "version_normalized": "3.5.1.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, - "time": "2023-03-01T10:32:47+00:00", + "time": "2024-09-25T14:20:29+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "installation-source": "dist", @@ -1953,7 +2459,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -1973,24 +2479,24 @@ }, { "name": "symfony/stopwatch", - "version": "v6.2.7", - "version_normalized": "6.2.7.0", + "version": "v7.2.2", + "version_normalized": "7.2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f" + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", - "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e46690d5b9d7164a6d061cab1e8d46141b9f49df", + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/service-contracts": "^1|^2|^3" + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" }, - "time": "2023-02-14T08:44:56+00:00", + "time": "2024-12-18T14:28:33+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2018,7 +2524,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.2.7" + "source": "https://github.com/symfony/stopwatch/tree/v7.2.2" }, "funding": [ { @@ -2038,37 +2544,38 @@ }, { "name": "symfony/string", - "version": "v6.2.8", - "version_normalized": "6.2.8.0", + "version": "v7.2.0", + "version_normalized": "7.2.0.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "time": "2023-03-20T16:06:02+00:00", + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" + }, + "time": "2024-11-13T13:31:26+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2107,7 +2614,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.2.8" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { diff --git a/tools/php-cs-fixer/vendor/composer/installed.php b/tools/php-cs-fixer/vendor/composer/installed.php index 5daa04b9..08936f96 100644 --- a/tools/php-cs-fixer/vendor/composer/installed.php +++ b/tools/php-cs-fixer/vendor/composer/installed.php @@ -1,103 +1,103 @@ array( + 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', + 'reference' => '2bde5f165e4b817c6a725d0b503c7bfeb01e467f', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'b982a766fe33dda238d09e54a405685b90ef1102', - 'name' => '__root__', 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', + 'reference' => '2bde5f165e4b817c6a725d0b503c7bfeb01e467f', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'b982a766fe33dda238d09e54a405685b90ef1102', + 'dev_requirement' => false, + ), + 'clue/ndjson-react' => array( + 'pretty_version' => 'v1.3.0', + 'version' => '1.3.0.0', + 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../clue/ndjson-react', + 'aliases' => array(), 'dev_requirement' => false, ), 'composer/pcre' => array( - 'pretty_version' => '3.1.0', - 'version' => '3.1.0.0', + 'pretty_version' => '3.3.2', + 'version' => '3.3.2.0', + 'reference' => 'b2bed4734f0cc156ee1fe9c0da2550420d99a21e', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), - 'reference' => '4bff79ddd77851fe3cdd11616ed3f92841ba5bd2', 'dev_requirement' => false, ), 'composer/semver' => array( - 'pretty_version' => '3.3.2', - 'version' => '3.3.2.0', + 'pretty_version' => '3.4.3', + 'version' => '3.4.3.0', + 'reference' => '4313d26ada5e0c4edfbd1dc481a92ff7bff91f12', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), - 'reference' => '3953f23262f2bff1919fc82183ad9acb13ff62c9', 'dev_requirement' => false, ), 'composer/xdebug-handler' => array( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', + 'pretty_version' => '3.0.5', + 'version' => '3.0.5.0', + 'reference' => '6c1925561632e83d60a44492e0b344cf48ab85ef', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), - 'reference' => 'ced299686f41dce890debac69273b47ffe98a40c', 'dev_requirement' => false, ), - 'doctrine/annotations' => array( - 'pretty_version' => '2.0.1', - 'version' => '2.0.1.0', + 'evenement/evenement' => array( + 'pretty_version' => 'v3.0.2', + 'version' => '3.0.2.0', + 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', 'type' => 'library', - 'install_path' => __DIR__ . '/../doctrine/annotations', + 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), - 'reference' => 'e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f', 'dev_requirement' => false, ), - 'doctrine/lexer' => array( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', + 'fidry/cpu-core-counter' => array( + 'pretty_version' => '1.2.0', + 'version' => '1.2.0.0', + 'reference' => '8520451a140d3f46ac33042715115e290cf5785f', 'type' => 'library', - 'install_path' => __DIR__ . '/../doctrine/lexer', + 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), - 'reference' => '84a527db05647743d50373e0ec53a152f2cde568', 'dev_requirement' => false, ), 'friendsofphp/php-cs-fixer' => array( - 'pretty_version' => 'v3.16.0', - 'version' => '3.16.0.0', + 'pretty_version' => 'v3.68.1', + 'version' => '3.68.1.0', + 'reference' => 'b9db2b2ea3cdba7201067acee46f984ef2397cff', 'type' => 'application', 'install_path' => __DIR__ . '/../friendsofphp/php-cs-fixer', 'aliases' => array(), - 'reference' => 'd40f9436e1c448d309fa995ab9c14c5c7a96f2dc', - 'dev_requirement' => false, - ), - 'psr/cache' => array( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/cache', - 'aliases' => array(), - 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'dev_requirement' => false, ), 'psr/container' => array( 'pretty_version' => '2.0.2', 'version' => '2.0.2.0', + 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), - 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'dev_requirement' => false, ), 'psr/event-dispatcher' => array( 'pretty_version' => '1.0.0', 'version' => '1.0.0.0', + 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/event-dispatcher', 'aliases' => array(), - 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'dev_requirement' => false, ), 'psr/event-dispatcher-implementation' => array( @@ -107,12 +107,12 @@ ), ), 'psr/log' => array( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', + 'pretty_version' => '3.0.2', + 'version' => '3.0.2.0', + 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), - 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', 'dev_requirement' => false, ), 'psr/log-implementation' => array( @@ -121,49 +121,112 @@ 0 => '1.0|2.0|3.0', ), ), + 'react/cache' => array( + 'pretty_version' => 'v1.2.0', + 'version' => '1.2.0.0', + 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../react/cache', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'react/child-process' => array( + 'pretty_version' => 'v0.6.6', + 'version' => '0.6.6.0', + 'reference' => '1721e2b93d89b745664353b9cfc8f155ba8a6159', + 'type' => 'library', + 'install_path' => __DIR__ . '/../react/child-process', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'react/dns' => array( + 'pretty_version' => 'v1.13.0', + 'version' => '1.13.0.0', + 'reference' => 'eb8ae001b5a455665c89c1df97f6fb682f8fb0f5', + 'type' => 'library', + 'install_path' => __DIR__ . '/../react/dns', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'react/event-loop' => array( + 'pretty_version' => 'v1.5.0', + 'version' => '1.5.0.0', + 'reference' => 'bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354', + 'type' => 'library', + 'install_path' => __DIR__ . '/../react/event-loop', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'react/promise' => array( + 'pretty_version' => 'v3.2.0', + 'version' => '3.2.0.0', + 'reference' => '8a164643313c71354582dc850b42b33fa12a4b63', + 'type' => 'library', + 'install_path' => __DIR__ . '/../react/promise', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'react/socket' => array( + 'pretty_version' => 'v1.16.0', + 'version' => '1.16.0.0', + 'reference' => '23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1', + 'type' => 'library', + 'install_path' => __DIR__ . '/../react/socket', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'react/stream' => array( + 'pretty_version' => 'v1.4.0', + 'version' => '1.4.0.0', + 'reference' => '1e5b0acb8fe55143b5b426817155190eb6f5b18d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../react/stream', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'sebastian/diff' => array( - 'pretty_version' => '5.0.3', - 'version' => '5.0.3.0', + 'pretty_version' => '6.0.2', + 'version' => '6.0.2.0', + 'reference' => 'b4ccd857127db5d41a5b676f24b51371d76d8544', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), - 'reference' => '912dc2fbe3e3c1e7873313cc801b100b6c68c87b', 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v6.2.10', - 'version' => '6.2.10.0', + 'pretty_version' => 'v7.2.1', + 'version' => '7.2.1.0', + 'reference' => 'fefcc18c0f5d0efe3ab3152f15857298868dc2c3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), - 'reference' => '12288d9f4500f84a4d02254d4aa968b15488476f', 'dev_requirement' => false, ), 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.2.1', - 'version' => '3.2.1.0', + 'pretty_version' => 'v3.5.1', + 'version' => '3.5.1.0', + 'reference' => '74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), - 'reference' => 'e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e', 'dev_requirement' => false, ), 'symfony/event-dispatcher' => array( - 'pretty_version' => 'v6.2.8', - 'version' => '6.2.8.0', + 'pretty_version' => 'v7.2.0', + 'version' => '7.2.0.0', + 'reference' => '910c5db85a5356d0fea57680defec4e99eb9c8c1', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/event-dispatcher', 'aliases' => array(), - 'reference' => '04046f35fd7d72f9646e721fc2ecb8f9c67d3339', 'dev_requirement' => false, ), 'symfony/event-dispatcher-contracts' => array( - 'pretty_version' => 'v3.2.1', - 'version' => '3.2.1.0', + 'pretty_version' => 'v3.5.1', + 'version' => '3.5.1.0', + 'reference' => '7642f5e970b672283b7823222ae8ef8bbc160b9f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts', 'aliases' => array(), - 'reference' => '0ad3b6f1e4e2da5690fefe075cd53a238646d8dd', 'dev_requirement' => false, ), 'symfony/event-dispatcher-implementation' => array( @@ -173,120 +236,120 @@ ), ), 'symfony/filesystem' => array( - 'pretty_version' => 'v6.2.10', - 'version' => '6.2.10.0', + 'pretty_version' => 'v7.2.0', + 'version' => '7.2.0.0', + 'reference' => 'b8dce482de9d7c9fe2891155035a7248ab5c7fdb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), - 'reference' => 'fd588debf7d1bc16a2c84b4b3b71145d9946b894', 'dev_requirement' => false, ), 'symfony/finder' => array( - 'pretty_version' => 'v6.2.7', - 'version' => '6.2.7.0', + 'pretty_version' => 'v7.2.2', + 'version' => '7.2.2.0', + 'reference' => '87a71856f2f56e4100373e92529eed3171695cfb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), - 'reference' => '20808dc6631aecafbe67c186af5dcb370be3a0eb', 'dev_requirement' => false, ), 'symfony/options-resolver' => array( - 'pretty_version' => 'v6.2.7', - 'version' => '6.2.7.0', + 'pretty_version' => 'v7.2.0', + 'version' => '7.2.0.0', + 'reference' => '7da8fbac9dcfef75ffc212235d76b2754ce0cf50', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/options-resolver', 'aliases' => array(), - 'reference' => 'aa0e85b53bbb2b4951960efd61d295907eacd629', 'dev_requirement' => false, ), 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), - 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', 'dev_requirement' => false, ), 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => 'b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', 'aliases' => array(), - 'reference' => '511a08c03c1960e08a883f4cffcacd219b758354', 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '3833d7255cc303546435cb650316bff708a1c75c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), - 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), - 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', 'dev_requirement' => false, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '60328e362d4c2c802a54fcbf04f9d3fb892b4cf8', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), - 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936', 'dev_requirement' => false, ), 'symfony/polyfill-php81' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php81', 'aliases' => array(), - 'reference' => '707403074c8ea6e2edaf8794b0157a0bfa52157a', 'dev_requirement' => false, ), 'symfony/process' => array( - 'pretty_version' => 'v6.2.10', - 'version' => '6.2.10.0', + 'pretty_version' => 'v7.2.0', + 'version' => '7.2.0.0', + 'reference' => 'd34b22ba9390ec19d2dd966c40aa9e8462f27a7e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), - 'reference' => 'b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e', 'dev_requirement' => false, ), 'symfony/service-contracts' => array( - 'pretty_version' => 'v3.2.1', - 'version' => '3.2.1.0', + 'pretty_version' => 'v3.5.1', + 'version' => '3.5.1.0', + 'reference' => 'e53260aabf78fb3d63f8d79d69ece59f80d5eda0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), - 'reference' => 'a8c9cedf55f314f3a186041d19537303766df09a', 'dev_requirement' => false, ), 'symfony/stopwatch' => array( - 'pretty_version' => 'v6.2.7', - 'version' => '6.2.7.0', + 'pretty_version' => 'v7.2.2', + 'version' => '7.2.2.0', + 'reference' => 'e46690d5b9d7164a6d061cab1e8d46141b9f49df', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/stopwatch', 'aliases' => array(), - 'reference' => 'f3adc98c1061875dd2edcd45e5b04e63d0e29f8f', 'dev_requirement' => false, ), 'symfony/string' => array( - 'pretty_version' => 'v6.2.8', - 'version' => '6.2.8.0', + 'pretty_version' => 'v7.2.0', + 'version' => '7.2.0.0', + 'reference' => '446e0d146f991dde3e73f45f2c97a9faad773c82', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), - 'reference' => '193e83bbd6617d6b2151c37fff10fa7168ebddef', 'dev_requirement' => false, ), ), diff --git a/tools/php-cs-fixer/vendor/composer/pcre/README.md b/tools/php-cs-fixer/vendor/composer/pcre/README.md index 973b17d8..49065149 100644 --- a/tools/php-cs-fixer/vendor/composer/pcre/README.md +++ b/tools/php-cs-fixer/vendor/composer/pcre/README.md @@ -12,7 +12,8 @@ to understand the implications. It thus makes it easier to work with static analysis tools like PHPStan or Psalm as it simplifies and reduces the possible return values from all the `preg_*` functions which -are quite packed with edge cases. +are quite packed with edge cases. As of v2.2.0 / v3.2.0 the library also comes with a +[PHPStan extension](#phpstan-extension) for parsing regular expressions and giving you even better output types. This library is a thin wrapper around `preg_*` functions with [some limitations](#restrictions--limitations). If you are looking for a richer API to handle regular expressions have a look at @@ -175,6 +176,13 @@ preg_match('/(a)(b)*(c)(d)*/', 'ac', $matches, $flags); | group 2 (any unmatched group preceding one that matched) is set to `''`. You cannot tell if it matched an empty string or did not match at all | group 2 is `null` when unmatched and a string if it matched, easy to check for | | group 4 (any optional group without a matching one following) is missing altogether. So you have to check with `isset()`, but really you want `isset($m[4]) && $m[4] !== ''` for safety unless you are very careful to check that a non-optional group follows it | group 4 is always set, and null in this case as there was no match, easy to check for with `$m[4] !== null` | +PHPStan Extension +----------------- + +To use the PHPStan extension if you do not use `phpstan/extension-installer` you can include `vendor/composer/pcre/extension.neon` in your PHPStan config. + +The extension provides much better type information for $matches as well as regex validation where possible. + License ------- diff --git a/tools/php-cs-fixer/vendor/composer/pcre/composer.json b/tools/php-cs-fixer/vendor/composer/pcre/composer.json index 40477ff4..d3a7e67c 100644 --- a/tools/php-cs-fixer/vendor/composer/pcre/composer.json +++ b/tools/php-cs-fixer/vendor/composer/pcre/composer.json @@ -20,9 +20,12 @@ "php": "^7.4 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^5", - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1" + "phpunit/phpunit": "^8 || ^9", + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" }, "autoload": { "psr-4": { @@ -37,10 +40,15 @@ "extra": { "branch-alias": { "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] } }, "scripts": { - "test": "vendor/bin/simple-phpunit", - "phpstan": "phpstan analyse" + "test": "@php vendor/bin/phpunit", + "phpstan": "@php phpstan analyse" } } diff --git a/tools/php-cs-fixer/vendor/composer/pcre/extension.neon b/tools/php-cs-fixer/vendor/composer/pcre/extension.neon new file mode 100644 index 00000000..b9cea113 --- /dev/null +++ b/tools/php-cs-fixer/vendor/composer/pcre/extension.neon @@ -0,0 +1,22 @@ +# composer/pcre PHPStan extensions +# +# These can be reused by third party packages by including 'vendor/composer/pcre/extension.neon' +# in your phpstan config + +services: + - + class: Composer\Pcre\PHPStan\PregMatchParameterOutTypeExtension + tags: + - phpstan.staticMethodParameterOutTypeExtension + - + class: Composer\Pcre\PHPStan\PregMatchTypeSpecifyingExtension + tags: + - phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension + - + class: Composer\Pcre\PHPStan\PregReplaceCallbackClosureTypeExtension + tags: + - phpstan.staticMethodParameterClosureTypeExtension + +rules: + - Composer\Pcre\PHPStan\UnsafeStrictGroupsCallRule + - Composer\Pcre\PHPStan\InvalidRegexPatternRule diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllResult.php b/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllResult.php index 4310c536..b22b52d6 100644 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllResult.php +++ b/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllResult.php @@ -35,7 +35,7 @@ final class MatchAllResult /** * @param 0|positive-int $count - * @param array> $matches + * @param array> $matches */ public function __construct(int $count, array $matches) { diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php b/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php index 69dcd062..b7ec3974 100644 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php +++ b/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php @@ -35,7 +35,7 @@ final class MatchAllStrictGroupsResult /** * @param 0|positive-int $count - * @param array> $matches + * @param array> $matches */ public function __construct(int $count, array $matches) { diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/InvalidRegexPatternRule.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/InvalidRegexPatternRule.php new file mode 100644 index 00000000..8a05fb24 --- /dev/null +++ b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/InvalidRegexPatternRule.php @@ -0,0 +1,142 @@ + + */ +class InvalidRegexPatternRule implements Rule +{ + public function getNodeType(): string + { + return StaticCall::class; + } + + public function processNode(Node $node, Scope $scope): array + { + $patterns = $this->extractPatterns($node, $scope); + + $errors = []; + foreach ($patterns as $pattern) { + $errorMessage = $this->validatePattern($pattern); + if ($errorMessage === null) { + continue; + } + + $errors[] = RuleErrorBuilder::message(sprintf('Regex pattern is invalid: %s', $errorMessage))->identifier('regexp.pattern')->build(); + } + + return $errors; + } + + /** + * @return string[] + */ + private function extractPatterns(StaticCall $node, Scope $scope): array + { + if (!$node->class instanceof FullyQualified) { + return []; + } + $isRegex = $node->class->toString() === Regex::class; + $isPreg = $node->class->toString() === Preg::class; + if (!$isRegex && !$isPreg) { + return []; + } + if (!$node->name instanceof Node\Identifier || !Preg::isMatch('{^(match|isMatch|grep|replace|split)}', $node->name->name)) { + return []; + } + + $functionName = $node->name->name; + if (!isset($node->getArgs()[0])) { + return []; + } + + $patternNode = $node->getArgs()[0]->value; + $patternType = $scope->getType($patternNode); + + $patternStrings = []; + + foreach ($patternType->getConstantStrings() as $constantStringType) { + if ($functionName === 'replaceCallbackArray') { + continue; + } + + $patternStrings[] = $constantStringType->getValue(); + } + + foreach ($patternType->getConstantArrays() as $constantArrayType) { + if ( + in_array($functionName, [ + 'replace', + 'replaceCallback', + ], true) + ) { + foreach ($constantArrayType->getValueTypes() as $arrayKeyType) { + foreach ($arrayKeyType->getConstantStrings() as $constantString) { + $patternStrings[] = $constantString->getValue(); + } + } + } + + if ($functionName !== 'replaceCallbackArray') { + continue; + } + + foreach ($constantArrayType->getKeyTypes() as $arrayKeyType) { + foreach ($arrayKeyType->getConstantStrings() as $constantString) { + $patternStrings[] = $constantString->getValue(); + } + } + } + + return $patternStrings; + } + + private function validatePattern(string $pattern): ?string + { + try { + $msg = null; + $prev = set_error_handler(function (int $severity, string $message, string $file) use (&$msg): bool { + $msg = preg_replace("#^preg_match(_all)?\\(.*?\\): #", '', $message); + + return true; + }); + + if ($pattern === '') { + return 'Empty string is not a valid regular expression'; + } + + Preg::match($pattern, ''); + if ($msg !== null) { + return $msg; + } + } catch (PcreException $e) { + if ($e->getCode() === PREG_INTERNAL_ERROR && $msg !== null) { + return $msg; + } + + return preg_replace('{.*? failed executing ".*": }', '', $e->getMessage()); + } finally { + restore_error_handler(); + } + + return null; + } + +} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchFlags.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchFlags.php new file mode 100644 index 00000000..aa30ab34 --- /dev/null +++ b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchFlags.php @@ -0,0 +1,70 @@ +getType($flagsArg->value); + + $constantScalars = $flagsType->getConstantScalarValues(); + if ($constantScalars === []) { + return null; + } + + $internalFlagsTypes = []; + foreach ($flagsType->getConstantScalarValues() as $constantScalarValue) { + if (!is_int($constantScalarValue)) { + return null; + } + + $internalFlagsTypes[] = new ConstantIntegerType($constantScalarValue | PREG_UNMATCHED_AS_NULL); + } + return TypeCombinator::union(...$internalFlagsTypes); + } + + static public function removeNullFromMatches(Type $matchesType): Type + { + return TypeTraverser::map($matchesType, static function (Type $type, callable $traverse): Type { + if ($type instanceof UnionType || $type instanceof IntersectionType) { + return $traverse($type); + } + + if ($type instanceof ConstantArrayType) { + return new ConstantArrayType( + $type->getKeyTypes(), + array_map(static function (Type $valueType) use ($traverse): Type { + return $traverse($valueType); + }, $type->getValueTypes()), + $type->getNextAutoIndexes(), + [], + $type->isList() + ); + } + + if ($type instanceof ArrayType) { + return new ArrayType($type->getKeyType(), $traverse($type->getItemType())); + } + + return TypeCombinator::removeNull($type); + }); + } + +} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchParameterOutTypeExtension.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchParameterOutTypeExtension.php new file mode 100644 index 00000000..e0d60208 --- /dev/null +++ b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchParameterOutTypeExtension.php @@ -0,0 +1,65 @@ +regexShapeMatcher = $regexShapeMatcher; + } + + public function isStaticMethodSupported(MethodReflection $methodReflection, ParameterReflection $parameter): bool + { + return + $methodReflection->getDeclaringClass()->getName() === Preg::class + && in_array($methodReflection->getName(), [ + 'match', 'isMatch', 'matchStrictGroups', 'isMatchStrictGroups', + 'matchAll', 'isMatchAll', 'matchAllStrictGroups', 'isMatchAllStrictGroups' + ], true) + && $parameter->getName() === 'matches'; + } + + public function getParameterOutTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, ParameterReflection $parameter, Scope $scope): ?Type + { + $args = $methodCall->getArgs(); + $patternArg = $args[0] ?? null; + $matchesArg = $args[2] ?? null; + $flagsArg = $args[3] ?? null; + + if ( + $patternArg === null || $matchesArg === null + ) { + return null; + } + + $flagsType = PregMatchFlags::getType($flagsArg, $scope); + if ($flagsType === null) { + return null; + } + + if (stripos($methodReflection->getName(), 'matchAll') !== false) { + return $this->regexShapeMatcher->matchAllExpr($patternArg->value, $flagsType, TrinaryLogic::createMaybe(), $scope); + } + + return $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createMaybe(), $scope); + } + +} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchTypeSpecifyingExtension.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchTypeSpecifyingExtension.php new file mode 100644 index 00000000..3db0ce06 --- /dev/null +++ b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchTypeSpecifyingExtension.php @@ -0,0 +1,119 @@ +regexShapeMatcher = $regexShapeMatcher; + } + + public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void + { + $this->typeSpecifier = $typeSpecifier; + } + + public function getClass(): string + { + return Preg::class; + } + + public function isStaticMethodSupported(MethodReflection $methodReflection, StaticCall $node, TypeSpecifierContext $context): bool + { + return in_array($methodReflection->getName(), [ + 'match', 'isMatch', 'matchStrictGroups', 'isMatchStrictGroups', + 'matchAll', 'isMatchAll', 'matchAllStrictGroups', 'isMatchAllStrictGroups' + ], true) + && !$context->null(); + } + + public function specifyTypes(MethodReflection $methodReflection, StaticCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes + { + $args = $node->getArgs(); + $patternArg = $args[0] ?? null; + $matchesArg = $args[2] ?? null; + $flagsArg = $args[3] ?? null; + + if ( + $patternArg === null || $matchesArg === null + ) { + return new SpecifiedTypes(); + } + + $flagsType = PregMatchFlags::getType($flagsArg, $scope); + if ($flagsType === null) { + return new SpecifiedTypes(); + } + + if (stripos($methodReflection->getName(), 'matchAll') !== false) { + $matchedType = $this->regexShapeMatcher->matchAllExpr($patternArg->value, $flagsType, TrinaryLogic::createFromBoolean($context->true()), $scope); + } else { + $matchedType = $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createFromBoolean($context->true()), $scope); + } + + if ($matchedType === null) { + return new SpecifiedTypes(); + } + + if ( + in_array($methodReflection->getName(), ['matchStrictGroups', 'isMatchStrictGroups', 'matchAllStrictGroups', 'isMatchAllStrictGroups'], true) + ) { + $matchedType = PregMatchFlags::removeNullFromMatches($matchedType); + } + + $overwrite = false; + if ($context->false()) { + $overwrite = true; + $context = $context->negate(); + } + + // @phpstan-ignore function.alreadyNarrowedType + if (method_exists('PHPStan\Analyser\SpecifiedTypes', 'setRootExpr')) { + $typeSpecifier = $this->typeSpecifier->create( + $matchesArg->value, + $matchedType, + $context, + $scope + )->setRootExpr($node); + + return $overwrite ? $typeSpecifier->setAlwaysOverwriteTypes() : $typeSpecifier; + } + + // @phpstan-ignore arguments.count + return $this->typeSpecifier->create( + $matchesArg->value, + $matchedType, + $context, + // @phpstan-ignore argument.type + $overwrite, + $scope, + $node + ); + } +} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregReplaceCallbackClosureTypeExtension.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregReplaceCallbackClosureTypeExtension.php new file mode 100644 index 00000000..7b953672 --- /dev/null +++ b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregReplaceCallbackClosureTypeExtension.php @@ -0,0 +1,91 @@ +regexShapeMatcher = $regexShapeMatcher; + } + + public function isStaticMethodSupported(MethodReflection $methodReflection, ParameterReflection $parameter): bool + { + return in_array($methodReflection->getDeclaringClass()->getName(), [Preg::class, Regex::class], true) + && in_array($methodReflection->getName(), ['replaceCallback', 'replaceCallbackStrictGroups'], true) + && $parameter->getName() === 'replacement'; + } + + public function getTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, ParameterReflection $parameter, Scope $scope): ?Type + { + $args = $methodCall->getArgs(); + $patternArg = $args[0] ?? null; + $flagsArg = $args[5] ?? null; + + if ( + $patternArg === null + ) { + return null; + } + + $flagsType = PregMatchFlags::getType($flagsArg, $scope); + + $matchesType = $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createYes(), $scope); + if ($matchesType === null) { + return null; + } + + if ($methodReflection->getName() === 'replaceCallbackStrictGroups' && count($matchesType->getConstantArrays()) === 1) { + $matchesType = $matchesType->getConstantArrays()[0]; + $matchesType = new ConstantArrayType( + $matchesType->getKeyTypes(), + array_map(static function (Type $valueType): Type { + if (count($valueType->getConstantArrays()) === 1) { + $valueTypeArray = $valueType->getConstantArrays()[0]; + return new ConstantArrayType( + $valueTypeArray->getKeyTypes(), + array_map(static function (Type $valueType): Type { + return TypeCombinator::removeNull($valueType); + }, $valueTypeArray->getValueTypes()), + $valueTypeArray->getNextAutoIndexes(), + [], + $valueTypeArray->isList() + ); + } + return TypeCombinator::removeNull($valueType); + }, $matchesType->getValueTypes()), + $matchesType->getNextAutoIndexes(), + [], + $matchesType->isList() + ); + } + + return new ClosureType( + [ + new NativeParameterReflection($parameter->getName(), $parameter->isOptional(), $matchesType, $parameter->passedByReference(), $parameter->isVariadic(), $parameter->getDefaultValue()), + ], + new StringType() + ); + } +} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/UnsafeStrictGroupsCallRule.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/UnsafeStrictGroupsCallRule.php new file mode 100644 index 00000000..5bced507 --- /dev/null +++ b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/UnsafeStrictGroupsCallRule.php @@ -0,0 +1,112 @@ + + */ +final class UnsafeStrictGroupsCallRule implements Rule +{ + /** + * @var RegexArrayShapeMatcher + */ + private $regexShapeMatcher; + + public function __construct(RegexArrayShapeMatcher $regexShapeMatcher) + { + $this->regexShapeMatcher = $regexShapeMatcher; + } + + public function getNodeType(): string + { + return StaticCall::class; + } + + public function processNode(Node $node, Scope $scope): array + { + if (!$node->class instanceof FullyQualified) { + return []; + } + $isRegex = $node->class->toString() === Regex::class; + $isPreg = $node->class->toString() === Preg::class; + if (!$isRegex && !$isPreg) { + return []; + } + if (!$node->name instanceof Node\Identifier || !in_array($node->name->name, ['matchStrictGroups', 'isMatchStrictGroups', 'matchAllStrictGroups', 'isMatchAllStrictGroups'], true)) { + return []; + } + + $args = $node->getArgs(); + if (!isset($args[0])) { + return []; + } + + $patternArg = $args[0] ?? null; + if ($isPreg) { + if (!isset($args[2])) { // no matches set, skip as the matches won't be used anyway + return []; + } + $flagsArg = $args[3] ?? null; + } else { + $flagsArg = $args[2] ?? null; + } + + if ($patternArg === null) { + return []; + } + + $flagsType = PregMatchFlags::getType($flagsArg, $scope); + if ($flagsType === null) { + return []; + } + + $matchedType = $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createYes(), $scope); + if ($matchedType === null) { + return [ + RuleErrorBuilder::message(sprintf('The %s call is potentially unsafe as $matches\' type could not be inferred.', $node->name->name)) + ->identifier('composerPcre.maybeUnsafeStrictGroups') + ->build(), + ]; + } + + if (count($matchedType->getConstantArrays()) === 1) { + $matchedType = $matchedType->getConstantArrays()[0]; + $nullableGroups = []; + foreach ($matchedType->getValueTypes() as $index => $type) { + if (TypeCombinator::containsNull($type)) { + $nullableGroups[] = $matchedType->getKeyTypes()[$index]->getValue(); + } + } + + if (\count($nullableGroups) > 0) { + return [ + RuleErrorBuilder::message(sprintf( + 'The %s call is unsafe as match group%s "%s" %s optional and may be null.', + $node->name->name, + \count($nullableGroups) > 1 ? 's' : '', + implode('", "', $nullableGroups), + \count($nullableGroups) > 1 ? 'are' : 'is' + ))->identifier('composerPcre.unsafeStrictGroups')->build(), + ]; + } + } + + return []; + } +} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PcreException.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PcreException.php index 218b2f2d..23d93279 100644 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/PcreException.php +++ b/tools/php-cs-fixer/vendor/composer/pcre/src/PcreException.php @@ -39,13 +39,8 @@ private static function pcreLastErrorMessage($code) return preg_last_error_msg(); } - // older php versions did not set the code properly in all cases - if (PHP_VERSION_ID < 70201 && $code === 0) { - return 'UNDEFINED_ERROR'; - } - $constants = get_defined_constants(true); - if (!isset($constants['pcre'])) { + if (!isset($constants['pcre']) || !is_array($constants['pcre'])) { return 'UNDEFINED_ERROR'; } diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/Preg.php b/tools/php-cs-fixer/vendor/composer/pcre/src/Preg.php index 0e35f7d6..400abbfe 100644 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/Preg.php +++ b/tools/php-cs-fixer/vendor/composer/pcre/src/Preg.php @@ -20,7 +20,7 @@ class Preg /** * @param non-empty-string $pattern - * @param array $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported * @return 0|1 * @@ -42,7 +42,7 @@ public static function match(string $pattern, string $subject, ?array &$matches * Variant of `match()` which outputs non-null matches (or throws) * * @param non-empty-string $pattern - * @param array $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported * @return 0|1 * @throws UnexpectedNullMatchException @@ -61,7 +61,7 @@ public static function matchStrictGroups(string $pattern, string $subject, ?arra * Runs preg_match with PREG_OFFSET_CAPTURE * * @param non-empty-string $pattern - * @param array $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_OFFSET_CAPTURE are always set, no other flags are supported * @return 0|1 * @@ -79,7 +79,7 @@ public static function matchWithOffsets(string $pattern, string $subject, ?array /** * @param non-empty-string $pattern - * @param array> $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported * @return 0|positive-int * @@ -102,7 +102,7 @@ public static function matchAll(string $pattern, string $subject, ?array &$match * Variant of `match()` which outputs non-null matches (or throws) * * @param non-empty-string $pattern - * @param array> $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported * @return 0|positive-int * @throws UnexpectedNullMatchException @@ -121,11 +121,11 @@ public static function matchAllStrictGroups(string $pattern, string $subject, ?a * Runs preg_match_all with PREG_OFFSET_CAPTURE * * @param non-empty-string $pattern - * @param array> $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_MATCH_OFFSET are always set, no other flags are supported * @return 0|positive-int * - * @phpstan-param array}>> $matches + * @param-out array}>> $matches */ public static function matchAllWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): int { @@ -147,7 +147,7 @@ public static function matchAllWithOffsets(string $pattern, string $subject, ?ar * * @param-out int<0, max> $count */ - public static function replace($pattern, $replacement, $subject, int $limit = -1, int &$count = null): string + public static function replace($pattern, $replacement, $subject, int $limit = -1, ?int &$count = null): string { if (!is_scalar($subject)) { if (is_array($subject)) { @@ -167,14 +167,14 @@ public static function replace($pattern, $replacement, $subject, int $limit = -1 /** * @param string|string[] $pattern - * @param callable(array): string $replacement + * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement * @param string $subject * @param int $count Set by method * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set * * @param-out int<0, max> $count */ - public static function replaceCallback($pattern, callable $replacement, $subject, int $limit = -1, int &$count = null, int $flags = 0): string + public static function replaceCallback($pattern, callable $replacement, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string { if (!is_scalar($subject)) { if (is_array($subject)) { @@ -196,14 +196,14 @@ public static function replaceCallback($pattern, callable $replacement, $subject * Variant of `replaceCallback()` which outputs non-null matches (or throws) * * @param string $pattern - * @param callable(array): string $replacement + * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement * @param string $subject * @param int $count Set by method - * @param int-mask $flags PREG_OFFSET_CAPTURE or PREG_UNMATCHED_AS_NULL, only available on PHP 7.4+ + * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set * * @param-out int<0, max> $count */ - public static function replaceCallbackStrictGroups(string $pattern, callable $replacement, $subject, int $limit = -1, int &$count = null, int $flags = 0): string + public static function replaceCallbackStrictGroups(string $pattern, callable $replacement, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string { return self::replaceCallback($pattern, function (array $matches) use ($pattern, $replacement) { return $replacement(self::enforceNonNullMatches($pattern, $matches, 'replaceCallback')); @@ -211,14 +211,14 @@ public static function replaceCallbackStrictGroups(string $pattern, callable $re } /** - * @param array): string> $pattern + * @param ($flags is PREG_OFFSET_CAPTURE ? (array}>): string>) : array): string>) $pattern * @param string $subject * @param int $count Set by method * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set * * @param-out int<0, max> $count */ - public static function replaceCallbackArray(array $pattern, $subject, int $limit = -1, int &$count = null, int $flags = 0): string + public static function replaceCallbackArray(array $pattern, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string { if (!is_scalar($subject)) { if (is_array($subject)) { @@ -291,7 +291,7 @@ public static function grep(string $pattern, array $array, int $flags = 0): arra * Variant of match() which returns a bool instead of int * * @param non-empty-string $pattern - * @param array $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported * * @param-out array $matches @@ -305,7 +305,7 @@ public static function isMatch(string $pattern, string $subject, ?array &$matche * Variant of `isMatch()` which outputs non-null matches (or throws) * * @param non-empty-string $pattern - * @param array $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported * @throws UnexpectedNullMatchException * @@ -320,7 +320,7 @@ public static function isMatchStrictGroups(string $pattern, string $subject, ?ar * Variant of matchAll() which returns a bool instead of int * * @param non-empty-string $pattern - * @param array> $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported * * @param-out array> $matches @@ -334,7 +334,7 @@ public static function isMatchAll(string $pattern, string $subject, ?array &$mat * Variant of `isMatchAll()` which outputs non-null matches (or throws) * * @param non-empty-string $pattern - * @param array> $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported * * @param-out array> $matches @@ -350,7 +350,7 @@ public static function isMatchAllStrictGroups(string $pattern, string $subject, * Runs preg_match with PREG_OFFSET_CAPTURE * * @param non-empty-string $pattern - * @param array $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported * * @param-out array}> $matches @@ -366,7 +366,7 @@ public static function isMatchWithOffsets(string $pattern, string $subject, ?arr * Runs preg_match_all with PREG_OFFSET_CAPTURE * * @param non-empty-string $pattern - * @param array> $matches Set by method + * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported * * @param-out array}>> $matches @@ -391,16 +391,18 @@ private static function checkSetOrder(int $flags): void } /** - * @param array $matches + * @param array $matches * @return array * @throws UnexpectedNullMatchException */ private static function enforceNonNullMatches(string $pattern, array $matches, string $variantMethod) { foreach ($matches as $group => $match) { - if (null === $match) { - throw new UnexpectedNullMatchException('Pattern "'.$pattern.'" had an unexpected unmatched group "'.$group.'", make sure the pattern always matches or use '.$variantMethod.'() instead.'); + if (is_string($match) || (is_array($match) && is_string($match[0]))) { + continue; } + + throw new UnexpectedNullMatchException('Pattern "'.$pattern.'" had an unexpected unmatched group "'.$group.'", make sure the pattern always matches or use '.$variantMethod.'() instead.'); } /** @var array */ diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/Regex.php b/tools/php-cs-fixer/vendor/composer/pcre/src/Regex.php index 112fa325..038cf069 100644 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/Regex.php +++ b/tools/php-cs-fixer/vendor/composer/pcre/src/Regex.php @@ -43,6 +43,7 @@ public static function match(string $pattern, string $subject, int $flags = 0, i */ public static function matchStrictGroups(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchStrictGroupsResult { + // @phpstan-ignore composerPcre.maybeUnsafeStrictGroups $count = Preg::matchStrictGroups($pattern, $subject, $matches, $flags, $offset); return new MatchStrictGroupsResult($count, $matches); @@ -87,6 +88,7 @@ public static function matchAllStrictGroups(string $pattern, string $subject, in self::checkOffsetCapture($flags, 'matchAllWithOffsets'); self::checkSetOrder($flags); + // @phpstan-ignore composerPcre.maybeUnsafeStrictGroups $count = Preg::matchAllStrictGroups($pattern, $subject, $matches, $flags, $offset); return new MatchAllStrictGroupsResult($count, $matches); @@ -120,7 +122,7 @@ public static function replace($pattern, $replacement, $subject, int $limit = -1 /** * @param string|string[] $pattern - * @param callable(array): string $replacement + * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement * @param string $subject * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set */ @@ -135,9 +137,9 @@ public static function replaceCallback($pattern, callable $replacement, $subject * Variant of `replaceCallback()` which outputs non-null matches (or throws) * * @param string $pattern - * @param callable(array): string $replacement + * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement * @param string $subject - * @param int-mask $flags PREG_OFFSET_CAPTURE or PREG_UNMATCHED_AS_NULL, only available on PHP 7.4+ + * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set */ public static function replaceCallbackStrictGroups($pattern, callable $replacement, $subject, int $limit = -1, int $flags = 0): ReplaceResult { @@ -147,7 +149,7 @@ public static function replaceCallbackStrictGroups($pattern, callable $replaceme } /** - * @param array): string> $pattern + * @param ($flags is PREG_OFFSET_CAPTURE ? (array}>): string>) : array): string>) $pattern * @param string $subject * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set */ diff --git a/tools/php-cs-fixer/vendor/composer/platform_check.php b/tools/php-cs-fixer/vendor/composer/platform_check.php index 4c3a5d68..d32d90c6 100644 --- a/tools/php-cs-fixer/vendor/composer/platform_check.php +++ b/tools/php-cs-fixer/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 80100)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 80200)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.2.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/tools/php-cs-fixer/vendor/composer/semver/CHANGELOG.md b/tools/php-cs-fixer/vendor/composer/semver/CHANGELOG.md index c9514773..bad46cd1 100644 --- a/tools/php-cs-fixer/vendor/composer/semver/CHANGELOG.md +++ b/tools/php-cs-fixer/vendor/composer/semver/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +### [3.4.3] 2024-09-19 + + * Fixed some type annotations + +### [3.4.2] 2024-07-12 + + * Fixed PHP 5.3 syntax error + +### [3.4.1] 2024-07-12 + + * Fixed normalizeStability's return type to enforce valid stabilities + +### [3.4.0] 2023-08-31 + + * Support larger major version numbers (#149) + ### [3.3.2] 2022-04-01 * Fixed handling of non-string values (#134) @@ -175,6 +191,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Namespace: `Composer\Test\Package\LinkConstraint` -> `Composer\Test\Semver\Constraint` * Changed: code style using php-cs-fixer. +[3.4.3]: https://github.com/composer/semver/compare/3.4.2...3.4.3 +[3.4.2]: https://github.com/composer/semver/compare/3.4.1...3.4.2 +[3.4.1]: https://github.com/composer/semver/compare/3.4.0...3.4.1 +[3.4.0]: https://github.com/composer/semver/compare/3.3.2...3.4.0 [3.3.2]: https://github.com/composer/semver/compare/3.3.1...3.3.2 [3.3.1]: https://github.com/composer/semver/compare/3.3.0...3.3.1 [3.3.0]: https://github.com/composer/semver/compare/3.2.9...3.3.0 diff --git a/tools/php-cs-fixer/vendor/composer/semver/README.md b/tools/php-cs-fixer/vendor/composer/semver/README.md index 35db99a5..76778490 100644 --- a/tools/php-cs-fixer/vendor/composer/semver/README.md +++ b/tools/php-cs-fixer/vendor/composer/semver/README.md @@ -6,8 +6,9 @@ Semver (Semantic Versioning) library that offers utilities, version constraint p Originally written as part of [composer/composer](https://github.com/composer/composer), now extracted and made available as a stand-alone library. -[![Continuous Integration](https://github.com/composer/semver/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/composer/semver/actions) - +[![Continuous Integration](https://github.com/composer/semver/actions/workflows/continuous-integration.yml/badge.svg?branch=main)](https://github.com/composer/semver/actions/workflows/continuous-integration.yml) +[![PHP Lint](https://github.com/composer/semver/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/composer/semver/actions/workflows/lint.yml) +[![PHPStan](https://github.com/composer/semver/actions/workflows/phpstan.yml/badge.svg?branch=main)](https://github.com/composer/semver/actions/workflows/phpstan.yml) Installation ------------ @@ -15,7 +16,7 @@ Installation Install the latest version with: ```bash -$ composer require composer/semver +composer require composer/semver ``` diff --git a/tools/php-cs-fixer/vendor/composer/semver/composer.json b/tools/php-cs-fixer/vendor/composer/semver/composer.json index ba78676d..1fad9e54 100644 --- a/tools/php-cs-fixer/vendor/composer/semver/composer.json +++ b/tools/php-cs-fixer/vendor/composer/semver/composer.json @@ -27,15 +27,15 @@ } ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.2 || ^5", - "phpstan/phpstan": "^1.4" + "symfony/phpunit-bridge": "^3 || ^7", + "phpstan/phpstan": "^1.11" }, "autoload": { "psr-4": { diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/CompilingMatcher.php b/tools/php-cs-fixer/vendor/composer/semver/src/CompilingMatcher.php index 45bce70a..aea1d3b9 100644 --- a/tools/php-cs-fixer/vendor/composer/semver/src/CompilingMatcher.php +++ b/tools/php-cs-fixer/vendor/composer/semver/src/CompilingMatcher.php @@ -64,7 +64,7 @@ public static function clear() * @phpstan-param Constraint::OP_* $operator * @param string $version * - * @return mixed + * @return bool */ public static function match(ConstraintInterface $constraint, $operator, $version) { diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/VersionParser.php b/tools/php-cs-fixer/vendor/composer/semver/src/VersionParser.php index 202ce247..305a0fae 100644 --- a/tools/php-cs-fixer/vendor/composer/semver/src/VersionParser.php +++ b/tools/php-cs-fixer/vendor/composer/semver/src/VersionParser.php @@ -82,11 +82,16 @@ public static function parseStability($version) * @param string $stability * * @return string + * @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev' */ public static function normalizeStability($stability) { $stability = strtolower((string) $stability); + if (!in_array($stability, array('stable', 'rc', 'beta', 'alpha', 'dev'), true)) { + throw new \InvalidArgumentException('Invalid stability string "'.$stability.'", expected one of stable, RC, beta, alpha or dev'); + } + return $stability === 'rc' ? 'RC' : $stability; } @@ -134,15 +139,15 @@ public function normalize($version, $fullVersion = null) } // match classical versioning - if (preg_match('{^v?(\d{1,5})(\.\d++)?(\.\d++)?(\.\d++)?' . self::$modifierRegex . '$}i', $version, $matches)) { + if (preg_match('{^v?(\d{1,5}+)(\.\d++)?(\.\d++)?(\.\d++)?' . self::$modifierRegex . '$}i', $version, $matches)) { $version = $matches[1] . (!empty($matches[2]) ? $matches[2] : '.0') . (!empty($matches[3]) ? $matches[3] : '.0') . (!empty($matches[4]) ? $matches[4] : '.0'); $index = 5; // match date(time) based versioning - } elseif (preg_match('{^v?(\d{4}(?:[.:-]?\d{2}){1,6}(?:[.:-]?\d{1,3})?)' . self::$modifierRegex . '$}i', $version, $matches)) { - $version = preg_replace('{\D}', '.', $matches[1]); + } elseif (preg_match('{^v?(\d{4}(?:[.:-]?\d{2}){1,6}(?:[.:-]?\d{1,3}){0,2})' . self::$modifierRegex . '$}i', $version, $matches)) { + $version = (string) preg_replace('{\D}', '.', $matches[1]); $index = 2; } @@ -260,16 +265,16 @@ public function parseConstraints($constraints) } $orGroups = array(); - foreach ($orConstraints as $constraints) { - $andConstraints = preg_split('{(?< ,]) *(?< ,]) *(? 1) { $constraintObjects = array(); - foreach ($andConstraints as $constraint) { - foreach ($this->parseConstraint($constraint) as $parsedConstraint) { - $constraintObjects[] = $parsedConstraint; + foreach ($andConstraints as $andConstraint) { + foreach ($this->parseConstraint($andConstraint) as $parsedAndConstraint) { + $constraintObjects[] = $parsedAndConstraint; } } } else { @@ -285,11 +290,11 @@ public function parseConstraints($constraints) $orGroups[] = $constraint; } - $constraint = MultiConstraint::create($orGroups, false); + $parsedConstraint = MultiConstraint::create($orGroups, false); - $constraint->setPrettyString($prettyConstraint); + $parsedConstraint->setPrettyString($prettyConstraint); - return $constraint; + return $parsedConstraint; } /** diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/CHANGELOG.md b/tools/php-cs-fixer/vendor/composer/xdebug-handler/CHANGELOG.md index c5b5bcf4..62ebe223 100644 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/CHANGELOG.md +++ b/tools/php-cs-fixer/vendor/composer/xdebug-handler/CHANGELOG.md @@ -1,5 +1,12 @@ ## [Unreleased] +## [3.0.5] - 2024-05-06 + * Fixed: fail restart if PHP_BINARY is not available + +## [3.0.4] - 2024-03-26 + * Added: Functional tests. + * Fixed: Incompatibility with PHPUnit 10. + ## [3.0.3] - 2022-02-25 * Added: support for composer/pcre versions 2 and 3. @@ -108,8 +115,10 @@ * Break: the following class was renamed: - `Composer\XdebugHandler` -> `Composer\XdebugHandler\XdebugHandler` -[Unreleased]: https://github.com/composer/xdebug-handler/compare/3.0.3...HEAD -[3.0.2]: https://github.com/composer/xdebug-handler/compare/3.0.2...3.0.3 +[Unreleased]: https://github.com/composer/xdebug-handler/compare/3.0.5...HEAD +[3.0.5]: https://github.com/composer/xdebug-handler/compare/3.0.4...3.0.5 +[3.0.4]: https://github.com/composer/xdebug-handler/compare/3.0.3...3.0.4 +[3.0.3]: https://github.com/composer/xdebug-handler/compare/3.0.2...3.0.3 [3.0.2]: https://github.com/composer/xdebug-handler/compare/3.0.1...3.0.2 [3.0.1]: https://github.com/composer/xdebug-handler/compare/3.0.0...3.0.1 [3.0.0]: https://github.com/composer/xdebug-handler/compare/2.0.3...3.0.0 diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/README.md b/tools/php-cs-fixer/vendor/composer/xdebug-handler/README.md index 56618fc1..f7f581ac 100644 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/README.md +++ b/tools/php-cs-fixer/vendor/composer/xdebug-handler/README.md @@ -51,6 +51,7 @@ The constructor takes a single parameter, `$envPrefix`, which is upper-cased and * [Process configuration](#process-configuration) * [Troubleshooting](#troubleshooting) * [Extending the library](#extending-the-library) +* [Examples](#examples) ### How it works @@ -64,6 +65,8 @@ A temporary ini file is created from the loaded (and scanned) ini files, with an * The application runs and exits. * The main process exits with the exit code from the restarted process. +See [Examples](#examples) for further information. + #### Signal handling Asynchronous signal handling is automatically enabled if the pcntl extension is loaded. `SIGINT` is set to `SIG_IGN` in the parent process and restored to `SIG_DFL` in the restarted process (if no other handler has been set). @@ -74,7 +77,7 @@ From PHP 7.4 on Windows, `CTRL+C` and `CTRL+BREAK` handling is automatically ena There are a few things to be aware of when running inside a restarted process. * Extensions set on the command-line will not be loaded. -* Ini file locations will be reported as per the restart - see [getAllIniFiles()](#getallinifiles). +* Ini file locations will be reported as per the restart - see [getAllIniFiles()](#getallinifiles-array). * Php sub-processes may be loaded with Xdebug enabled - see [Process configuration](#process-configuration). ### Helper methods @@ -200,12 +203,12 @@ Uses environment variables to remove Xdebug from the new process and persist the >_If the new process calls a PHP sub-process, Xdebug will not be loaded in that sub-process._ -This strategy can be used in the restart by calling [setPersistent()](#setpersistent). +This strategy can be used in the restart by calling [setPersistent()](#setpersistent-self). #### Sub-processes The `PhpConfig` helper class makes it easy to invoke a PHP sub-process (with or without Xdebug loaded), regardless of whether there has been a restart. -Each of its methods returns an array of PHP options (to add to the command-line) and sets up the environment for the required strategy. The [getRestartSettings()](#getrestartsettings) method is used internally. +Each of its methods returns an array of PHP options (to add to the command-line) and sets up the environment for the required strategy. The [getRestartSettings()](#getrestartsettings-array) method is used internally. * `useOriginal()` - Xdebug will be loaded in the new process. * `useStandard()` - Xdebug will **not** be loaded in the new process - see [standard settings](#standard-settings). @@ -245,7 +248,7 @@ The API is defined by classes and their accessible elements that are not annotat By default the process will restart if Xdebug is loaded and not running with `xdebug.mode=off`. Extending this method allows an application to decide, by returning a boolean (or equivalent) value. It is only called if `MYAPP_ALLOW_XDEBUG` is empty, so it will not be called in the restarted process (where this variable contains internal data), or if the restart has been overridden. -Note that the [setMainScript()](#setmainscriptscript) and [setPersistent()](#setpersistent) setters can be used here, if required. +Note that the [setMainScript()](#setmainscriptstring-script-self) and [setPersistent()](#setpersistent-self) setters can be used here, if required. #### _restart(array $command): void_ An application can extend this to modify the temporary ini file, its location given in the `tmpIni` property. New settings can be safely appended to the end of the data, which is `PHP_EOL` terminated. @@ -294,5 +297,9 @@ class MyRestarter extends XdebugHandler } ``` +### Examples +The `tests\App` directory contains command-line scripts that demonstrate the internal workings in a variety of scenarios. +See [Functional Test Scripts](./tests/App/README.md). + ## License composer/xdebug-handler is licensed under the MIT License, see the LICENSE file for details. diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/composer.json b/tools/php-cs-fixer/vendor/composer/xdebug-handler/composer.json index 6b649dab..d205dc10 100644 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/composer.json +++ b/tools/php-cs-fixer/vendor/composer/xdebug-handler/composer.json @@ -14,7 +14,7 @@ } ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues" }, "require": { @@ -23,9 +23,9 @@ "composer/pcre": "^1 || ^2 || ^3" }, "require-dev": { - "symfony/phpunit-bridge": "^6.0", "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1" + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "autoload": { "psr-4": { @@ -38,7 +38,7 @@ } }, "scripts": { - "test": "@php vendor/bin/simple-phpunit", + "test": "@php vendor/bin/phpunit", "phpstan": "@php vendor/bin/phpstan analyse" } } diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Process.php b/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Process.php index c612200b..4e9f076b 100644 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Process.php +++ b/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Process.php @@ -41,6 +41,7 @@ public static function escape(string $arg, bool $meta = true, bool $module = fal $quote = strpbrk($arg, " \t") !== false || $arg === ''; $arg = Preg::replace('/(\\\\*)"/', '$1$1\\"', $arg, -1, $dquotes); + $dquotes = (bool) $dquotes; if ($meta) { $meta = $dquotes || Preg::isMatch('/%[^%]+%/', $arg); diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Status.php b/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Status.php index b434f859..96c5944a 100644 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Status.php +++ b/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Status.php @@ -82,14 +82,33 @@ public function setLogger(LoggerInterface $logger): void public function report(string $op, ?string $data): void { if ($this->logger !== null || $this->debug) { - $callable = [$this, 'report'.$op]; - - if (!is_callable($callable)) { - throw new \InvalidArgumentException('Unknown op handler: '.$op); + $param = (string) $data; + + switch($op) { + case self::CHECK: + $this->reportCheck($param); + break; + case self::ERROR: + $this->reportError($param); + break; + case self::INFO: + $this->reportInfo($param); + break; + case self::NORESTART: + $this->reportNoRestart(); + break; + case self::RESTART: + $this->reportRestart(); + break; + case self::RESTARTED: + $this->reportRestarted(); + break; + case self::RESTARTING: + $this->reportRestarting($param); + break; + default: + throw new \InvalidArgumentException('Unknown op handler: '.$op); } - - $params = $data !== null ? [$data] : []; - call_user_func_array($callable, $params); } } @@ -180,7 +199,7 @@ private function reportRestarting(string $command): void { $text = sprintf('Process restarting (%s)', $this->getEnvAllow()); $this->output($text); - $text = 'Running '.$command; + $text = 'Running: '.$command; $this->output($text); } diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/XdebugHandler.php b/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/XdebugHandler.php index 9052bfa4..a665939d 100644 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/XdebugHandler.php +++ b/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/XdebugHandler.php @@ -143,9 +143,9 @@ public function check(): void if (!((bool) $envArgs[0]) && $this->requiresRestart(self::$xdebugActive)) { // Restart required $this->notify(Status::RESTART); + $command = $this->prepareRestart(); - if ($this->prepareRestart()) { - $command = $this->getCommand(); + if ($command !== null) { $this->restart($command); } return; @@ -183,9 +183,9 @@ public function check(): void * Returns an array of php.ini locations with at least one entry * * The equivalent of calling php_ini_loaded_file then php_ini_scanned_files. - * The loaded ini location is the first entry and may be empty. + * The loaded ini location is the first entry and may be an empty string. * - * @return string[] + * @return non-empty-list */ public static function getAllIniFiles(): array { @@ -267,7 +267,7 @@ protected function requiresRestart(bool $default): bool /** * Allows an extending class to access the tmpIni * - * @param string[] $command * + * @param non-empty-list $command */ protected function restart(array $command): void { @@ -277,24 +277,26 @@ protected function restart(array $command): void /** * Executes the restarted command then deletes the tmp ini * - * @param string[] $command + * @param non-empty-list $command * @phpstan-return never */ private function doRestart(array $command): void { - $this->tryEnableSignals(); - $this->notify(Status::RESTARTING, implode(' ', $command)); - if (PHP_VERSION_ID >= 70400) { $cmd = $command; + $displayCmd = sprintf('[%s]', implode(', ', $cmd)); } else { $cmd = Process::escapeShellCommand($command); if (defined('PHP_WINDOWS_VERSION_BUILD')) { // Outer quotes required on cmd string below PHP 8 $cmd = '"'.$cmd.'"'; } + $displayCmd = $cmd; } + $this->tryEnableSignals(); + $this->notify(Status::RESTARTING, $displayCmd); + $process = proc_open($cmd, [], $pipes); if (is_resource($process)) { $exitCode = proc_close($process); @@ -318,52 +320,74 @@ private function doRestart(array $command): void } /** - * Returns true if everything was written for the restart + * Returns the command line array if everything was written for the restart * * If any of the following fails (however unlikely) we must return false to * stop potential recursion: * - tmp ini file creation * - environment variable creation + * + * @return non-empty-list|null */ - private function prepareRestart(): bool + private function prepareRestart(): ?array { + if (!$this->cli) { + $this->notify(Status::ERROR, 'Unsupported SAPI: '.PHP_SAPI); + return null; + } + + if (($argv = $this->checkServerArgv()) === null) { + $this->notify(Status::ERROR, '$_SERVER[argv] is not as expected'); + return null; + } + + if (!$this->checkConfiguration($info)) { + $this->notify(Status::ERROR, $info); + return null; + } + + $mainScript = (string) $this->script; + if (!$this->checkMainScript($mainScript, $argv)) { + $this->notify(Status::ERROR, 'Unable to access main script: '.$mainScript); + return null; + } + + $tmpDir = sys_get_temp_dir(); + $iniError = 'Unable to create temp ini file at: '.$tmpDir; + + if (($tmpfile = @tempnam($tmpDir, '')) === false) { + $this->notify(Status::ERROR, $iniError); + return null; + } + $error = null; $iniFiles = self::getAllIniFiles(); $scannedInis = count($iniFiles) > 1; - $tmpDir = sys_get_temp_dir(); - if (!$this->cli) { - $error = 'Unsupported SAPI: '.PHP_SAPI; - } elseif (!$this->checkConfiguration($info)) { - $error = $info; - } elseif (!$this->checkMainScript()) { - $error = 'Unable to access main script: '.$this->script; - } elseif (!$this->writeTmpIni($iniFiles, $tmpDir, $error)) { - $error = $error !== null ? $error : 'Unable to create temp ini file at: '.$tmpDir; - } elseif (!$this->setEnvironment($scannedInis, $iniFiles)) { - $error = 'Unable to set environment variables'; + if (!$this->writeTmpIni($tmpfile, $iniFiles, $error)) { + $this->notify(Status::ERROR, $error ?? $iniError); + @unlink($tmpfile); + return null; } - if ($error !== null) { - $this->notify(Status::ERROR, $error); + if (!$this->setEnvironment($scannedInis, $iniFiles, $tmpfile)) { + $this->notify(Status::ERROR, 'Unable to set environment variables'); + @unlink($tmpfile); + return null; } - return $error === null; + $this->tmpIni = $tmpfile; + + return $this->getCommand($argv, $tmpfile, $mainScript); } /** * Returns true if the tmp ini file was written * - * @param string[] $iniFiles All ini files used in the current process + * @param non-empty-list $iniFiles All ini files used in the current process */ - private function writeTmpIni(array $iniFiles, string $tmpDir, ?string &$error): bool + private function writeTmpIni(string $tmpFile, array $iniFiles, ?string &$error): bool { - if (($tmpfile = @tempnam($tmpDir, '')) === false) { - return false; - } - - $this->tmpIni = $tmpfile; - // $iniFiles has at least one item and it may be empty if ($iniFiles[0] === '') { array_shift($iniFiles); @@ -380,7 +404,7 @@ private function writeTmpIni(array $iniFiles, string $tmpDir, ?string &$error): return false; } // Check and remove directives after HOST and PATH sections - if (Preg::isMatchWithOffsets($sectionRegex, $data, $matches, PREG_OFFSET_CAPTURE)) { + if (Preg::isMatchWithOffsets($sectionRegex, $data, $matches)) { $data = substr($data, 0, $matches[0][1]); } $content .= Preg::replace($xdebugRegex, ';$1', $data).PHP_EOL; @@ -400,25 +424,26 @@ private function writeTmpIni(array $iniFiles, string $tmpDir, ?string &$error): // Work-around for https://bugs.php.net/bug.php?id=75932 $content .= 'opcache.enable_cli=0'.PHP_EOL; - return (bool) @file_put_contents($this->tmpIni, $content); + return (bool) @file_put_contents($tmpFile, $content); } /** * Returns the command line arguments for the restart * - * @return string[] + * @param non-empty-list $argv + * @return non-empty-list */ - private function getCommand(): array + private function getCommand(array $argv, string $tmpIni, string $mainScript): array { $php = [PHP_BINARY]; - $args = array_slice($_SERVER['argv'], 1); + $args = array_slice($argv, 1); if (!$this->persistent) { // Use command-line options - array_push($php, '-n', '-c', $this->tmpIni); + array_push($php, '-n', '-c', $tmpIni); } - return array_merge($php, [$this->script], $args); + return array_merge($php, [$mainScript], $args); } /** @@ -426,9 +451,9 @@ private function getCommand(): array * * No need to update $_SERVER since this is set in the restarted process. * - * @param string[] $iniFiles All ini files used in the current process + * @param non-empty-list $iniFiles All ini files used in the current process */ - private function setEnvironment(bool $scannedInis, array $iniFiles): bool + private function setEnvironment(bool $scannedInis, array $iniFiles, string $tmpIni): bool { $scanDir = getenv('PHP_INI_SCAN_DIR'); $phprc = getenv('PHPRC'); @@ -440,7 +465,7 @@ private function setEnvironment(bool $scannedInis, array $iniFiles): bool if ($this->persistent) { // Use the environment to persist the settings - if (!putenv('PHP_INI_SCAN_DIR=') || !putenv('PHPRC='.$this->tmpIni)) { + if (!putenv('PHP_INI_SCAN_DIR=') || !putenv('PHPRC='.$tmpIni)) { return false; } } @@ -495,15 +520,17 @@ private function mergeLoadedConfig(array $loadedConfig, array $iniConfig): strin /** * Returns true if the script name can be used + * + * @param non-empty-list $argv */ - private function checkMainScript(): bool + private function checkMainScript(string &$mainScript, array $argv): bool { - if ($this->script !== null) { + if ($mainScript !== '') { // Allow an application to set -- for standard input - return file_exists($this->script) || '--' === $this->script; + return file_exists($mainScript) || '--' === $mainScript; } - if (file_exists($this->script = $_SERVER['argv'][0])) { + if (file_exists($mainScript = $argv[0])) { return true; } @@ -512,7 +539,7 @@ private function checkMainScript(): bool $main = end($trace); if ($main !== false && isset($main['file'])) { - return file_exists($this->script = $main['file']); + return file_exists($mainScript = $main['file']); } return false; @@ -521,7 +548,7 @@ private function checkMainScript(): bool /** * Adds restart settings to the environment * - * @param string[] $envArgs + * @param non-empty-list $envArgs */ private function setEnvRestartSettings(array $envArgs): void { @@ -563,6 +590,11 @@ private function checkConfiguration(?string &$info): bool return false; } + if (!file_exists(PHP_BINARY)) { + $info = 'PHP_BINARY is not available'; + return false; + } + if (extension_loaded('uopz') && !((bool) ini_get('uopz.disable'))) { // uopz works at opcode level and disables exit calls if (function_exists('uopz_allow_exit')) { @@ -619,6 +651,28 @@ private function tryEnableSignals(): void } } + /** + * Returns $_SERVER['argv'] if it is as expected + * + * @return non-empty-list|null + */ + private function checkServerArgv(): ?array + { + $result = []; + + if (isset($_SERVER['argv']) && is_array($_SERVER['argv'])) { + foreach ($_SERVER['argv'] as $value) { + if (!is_string($value)) { + return null; + } + + $result[] = $value; + } + } + + return count($result) > 0 ? $result : null; + } + /** * Sets static properties $xdebugActive, $xdebugVersion and $xdebugMode */ diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/README.md b/tools/php-cs-fixer/vendor/doctrine/annotations/README.md deleted file mode 100644 index 6b8c0359..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/README.md +++ /dev/null @@ -1,24 +0,0 @@ -⚠️ PHP 8 introduced -[attributes](https://www.php.net/manual/en/language.attributes.overview.php), -which are a native replacement for annotations. As such, this library is -considered feature complete, and should receive exclusively bugfixes and -security fixes. - -# Doctrine Annotations - -[![Build Status](https://github.com/doctrine/annotations/workflows/Continuous%20Integration/badge.svg?label=build)](https://github.com/doctrine/persistence/actions) -[![Dependency Status](https://www.versioneye.com/package/php--doctrine--annotations/badge.png)](https://www.versioneye.com/package/php--doctrine--annotations) -[![Reference Status](https://www.versioneye.com/php/doctrine:annotations/reference_badge.svg)](https://www.versioneye.com/php/doctrine:annotations/references) -[![Total Downloads](https://poser.pugx.org/doctrine/annotations/downloads.png)](https://packagist.org/packages/doctrine/annotations) -[![Latest Stable Version](https://img.shields.io/packagist/v/doctrine/annotations.svg?label=stable)](https://packagist.org/packages/doctrine/annotations) - -Docblock Annotations Parser library (extracted from [Doctrine Common](https://github.com/doctrine/common)). - -## Documentation - -See the [doctrine-project website](https://www.doctrine-project.org/projects/doctrine-annotations/en/latest/index.html). - -## Contributing - -When making a pull request, make sure your changes follow the -[Coding Standard Guidelines](https://www.doctrine-project.org/projects/doctrine-coding-standard/en/current/reference/index.html#introduction). diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/UPGRADE.md b/tools/php-cs-fixer/vendor/doctrine/annotations/UPGRADE.md deleted file mode 100644 index 4172708f..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/UPGRADE.md +++ /dev/null @@ -1,18 +0,0 @@ -# Upgrade from 1.0.x to 2.0.x - -- The `NamedArgumentConstructorAnnotation` has been removed. Use the `@NamedArgumentConstructor` - annotation instead. -- `SimpleAnnotationReader` has been removed. -- `DocLexer::peek()` and `DocLexer::glimpse` now return -`Doctrine\Common\Lexer\Token` objects. When using `doctrine/lexer` 2, these -implement `ArrayAccess` as a way for you to still be able to treat them as -arrays in some ways. -- `CachedReader` and `FileCacheReader` have been removed. -- `AnnotationRegistry` methods related to registering annotations instead of - using autoloading have been removed. -- Parameter type declarations have been added to all methods of all classes. If -you have classes inheriting from classes inside this package, you should add -parameter and return type declarations. -- Support for PHP < 7.2 has been removed -- `PhpParser::parseClass()` has been removed. Use - `PhpParser::parseUseStatements()` instead. diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/composer.json b/tools/php-cs-fixer/vendor/doctrine/annotations/composer.json deleted file mode 100644 index d1d3d8db..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/composer.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "doctrine/annotations", - "description": "Docblock Annotations Parser", - "license": "MIT", - "type": "library", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "require": { - "php": "^7.2 || ^8.0", - "ext-tokenizer": "*", - "doctrine/lexer": "^2 || ^3", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^2.0", - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "autoload-dev": { - "psr-4": { - "Doctrine\\Performance\\Common\\Annotations\\": "tests/Doctrine/Performance/Common/Annotations", - "Doctrine\\Tests\\Common\\Annotations\\": "tests/Doctrine/Tests/Common/Annotations" - }, - "files": [ - "tests/Doctrine/Tests/Common/Annotations/Fixtures/functions.php", - "tests/Doctrine/Tests/Common/Annotations/Fixtures/SingleClassLOC1000.php" - ] - }, - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - }, - "sort-packages": true - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/annotations.rst b/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/annotations.rst deleted file mode 100644 index d32b15d1..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/annotations.rst +++ /dev/null @@ -1,189 +0,0 @@ -Handling Annotations -==================== - -There are several different approaches to handling annotations in PHP. -Doctrine Annotations maps docblock annotations to PHP classes. Because -not all docblock annotations are used for metadata purposes a filter is -applied to ignore or skip classes that are not Doctrine annotations. - -Take a look at the following code snippet: - -.. code-block:: php - - namespace MyProject\Entities; - - use Doctrine\ORM\Mapping AS ORM; - use Symfony\Component\Validator\Constraints AS Assert; - - /** - * @author Benjamin Eberlei - * @ORM\Entity - * @MyProject\Annotations\Foobarable - */ - class User - { - /** - * @ORM\Id @ORM\Column @ORM\GeneratedValue - * @dummy - * @var int - */ - private $id; - - /** - * @ORM\Column(type="string") - * @Assert\NotEmpty - * @Assert\Email - * @var string - */ - private $email; - } - -In this snippet you can see a variety of different docblock annotations: - -- Documentation annotations such as ``@var`` and ``@author``. These - annotations are ignored and never considered for throwing an - exception due to wrongly used annotations. -- Annotations imported through use statements. The statement ``use - Doctrine\ORM\Mapping AS ORM`` makes all classes under that namespace - available as ``@ORM\ClassName``. Same goes for the import of - ``@Assert``. -- The ``@dummy`` annotation. It is not a documentation annotation and - not ignored. For Doctrine Annotations it is not entirely clear how - to handle this annotation. Depending on the configuration an exception - (unknown annotation) will be thrown when parsing this annotation. -- The fully qualified annotation ``@MyProject\Annotations\Foobarable``. - This is transformed directly into the given class name. - -How are these annotations loaded? From looking at the code you could -guess that the ORM Mapping, Assert Validation and the fully qualified -annotation can just be loaded using -the defined PHP autoloaders. This is not the case however: For error -handling reasons every check for class existence inside the -``AnnotationReader`` sets the second parameter $autoload -of ``class_exists($name, $autoload)`` to false. To work flawlessly the -``AnnotationReader`` requires silent autoloaders which many autoloaders are -not. Silent autoloading is NOT part of the `PSR-0 specification -`_ -for autoloading. - -This is why Doctrine Annotations uses its own autoloading mechanism -through a global registry. If you are wondering about the annotation -registry being global, there is no other way to solve the architectural -problems of autoloading annotation classes in a straightforward fashion. -Additionally if you think about PHP autoloading then you recognize it is -a global as well. - -To anticipate the configuration section, making the above PHP class work -with Doctrine Annotations requires this setup: - -.. code-block:: php - - use Doctrine\Common\Annotations\AnnotationReader; - - $reader = new AnnotationReader(); - AnnotationReader::addGlobalIgnoredName('dummy'); - -We create the actual ``AnnotationReader`` instance. -Note that we also add ``dummy`` to the global list of ignored -annotations for which we do not throw exceptions. Setting this is -necessary in our example case, otherwise ``@dummy`` would trigger an -exception to be thrown during the parsing of the docblock of -``MyProject\Entities\User#id``. - -Setup and Configuration ------------------------ - -To use the annotations library is simple, you just need to create a new -``AnnotationReader`` instance: - -.. code-block:: php - - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - -This creates a simple annotation reader with no caching other than in -memory (in php arrays). Since parsing docblocks can be expensive you -should cache this process by using a caching reader. - -To cache annotations, you can create a ``Doctrine\Common\Annotations\PsrCachedReader``. -This reader decorates the original reader and stores all annotations in a PSR-6 -cache: - -.. code-block:: php - - use Doctrine\Common\Annotations\AnnotationReader; - use Doctrine\Common\Annotations\PsrCachedReader; - - $cache = ... // instantiate a PSR-6 Cache pool - - $reader = new PsrCachedReader( - new AnnotationReader(), - $cache, - $debug = true - ); - -The ``debug`` flag is used here as well to invalidate the cache files -when the PHP class with annotations changed and should be used during -development. - -.. warning :: - - The ``AnnotationReader`` works and caches under the - assumption that all annotations of a doc-block are processed at - once. That means that annotation classes that do not exist and - aren't loaded and cannot be autoloaded (using the - AnnotationRegistry) would never be visible and not accessible if a - cache is used unless the cache is cleared and the annotations - requested again, this time with all annotations defined. - -By default the annotation reader returns a list of annotations with -numeric indexes. If you want your annotations to be indexed by their -class name you can wrap the reader in an ``IndexedReader``: - -.. code-block:: php - - use Doctrine\Common\Annotations\AnnotationReader; - use Doctrine\Common\Annotations\IndexedReader; - - $reader = new IndexedReader(new AnnotationReader()); - -.. warning:: - - You should never wrap the indexed reader inside a cached reader, - only the other way around. This way you can re-use the cache with - indexed or numeric keys, otherwise your code may experience failures - due to caching in a numerical or indexed format. - -Ignoring missing exceptions -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -By default an exception is thrown from the ``AnnotationReader`` if an -annotation was found that: - -- is not part of the list of ignored "documentation annotations"; -- was not imported through a use statement; -- is not a fully qualified class that exists. - -You can disable this behavior for specific names if your docblocks do -not follow strict requirements: - -.. code-block:: php - - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - AnnotationReader::addGlobalIgnoredName('foo'); - -PHP Imports -~~~~~~~~~~~ - -By default the annotation reader parses the use-statement of a php file -to gain access to the import rules and register them for the annotation -processing. Only if you are using PHP Imports can you validate the -correct usage of annotations and throw exceptions if you misspelled an -annotation. This mechanism is enabled by default. - -To ease the upgrade path, we still allow you to disable this mechanism. -Note however that we will remove this in future versions: - -.. code-block:: php - - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - $reader->setEnabledPhpImports(false); diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/custom.rst b/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/custom.rst deleted file mode 100644 index 30051662..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/custom.rst +++ /dev/null @@ -1,443 +0,0 @@ -Custom Annotation Classes -========================= - -If you want to define your own annotations, you just have to group them -in a namespace. -Annotation classes have to contain a class-level docblock with the text -``@Annotation``: - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** @Annotation */ - class Bar - { - // some code - } - -Inject annotation values ------------------------- - -The annotation parser checks if the annotation constructor has arguments, -if so then it will pass the value array, otherwise it will try to inject -values into public properties directly: - - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** - * @Annotation - * - * Some Annotation using a constructor - */ - class Bar - { - private $foo; - - public function __construct(array $values) - { - $this->foo = $values['foo']; - } - } - - /** - * @Annotation - * - * Some Annotation without a constructor - */ - class Foo - { - public $bar; - } - -Optional: Constructors with Named Parameters --------------------------------------------- - -Starting with Annotations v1.11 a new annotation instantiation strategy -is available that aims at compatibility of Annotation classes with the PHP 8 -attribute feature. You need to declare a constructor with regular parameter -names that match the named arguments in the annotation syntax. - -To enable this feature, you can tag your annotation class with -``@NamedArgumentConstructor`` (available from v1.12) or implement the -``Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation`` interface -(available from v1.11 and deprecated as of v1.12). -When using the ``@NamedArgumentConstructor`` tag, the first argument of the -constructor is considered as the default one. - - -Usage with the ``@NamedArgumentConstructor`` tag - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** - * @Annotation - * @NamedArgumentConstructor - */ - class Bar implements NamedArgumentConstructorAnnotation - { - private $foo; - - public function __construct(string $foo) - { - $this->foo = $foo; - } - } - - /** Usable with @Bar(foo="baz") */ - /** Usable with @Bar("baz") */ - -In combination with PHP 8's constructor property promotion feature -you can simplify this to: - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** - * @Annotation - * @NamedArgumentConstructor - */ - class Bar implements NamedArgumentConstructorAnnotation - { - public function __construct(private string $foo) {} - } - - -Usage with the -``Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation`` -interface (v1.11, deprecated as of v1.12): -.. code-block:: php - - namespace MyCompany\Annotations; - - use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; - - /** @Annotation */ - class Bar implements NamedArgumentConstructorAnnotation - { - private $foo; - - public function __construct(private string $foo) {} - } - - /** Usable with @Bar(foo="baz") */ - -Annotation Target ------------------ - -``@Target`` indicates the kinds of class elements to which an annotation -type is applicable. Then you could define one or more targets: - -- ``CLASS`` Allowed in class docblocks -- ``PROPERTY`` Allowed in property docblocks -- ``METHOD`` Allowed in the method docblocks -- ``FUNCTION`` Allowed in function dockblocks -- ``ALL`` Allowed in class, property, method and function docblocks -- ``ANNOTATION`` Allowed inside other annotations - -If the annotations is not allowed in the current context, an -``AnnotationException`` is thrown. - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** - * @Annotation - * @Target({"METHOD","PROPERTY"}) - */ - class Bar - { - // some code - } - - /** - * @Annotation - * @Target("CLASS") - */ - class Foo - { - // some code - } - -Attribute types ---------------- - -The annotation parser checks the given parameters using the phpdoc -annotation ``@var``, The data type could be validated using the ``@var`` -annotation on the annotation properties or using the ``@Attributes`` and -``@Attribute`` annotations. - -If the data type does not match you get an ``AnnotationException`` - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** - * @Annotation - * @Target({"METHOD","PROPERTY"}) - */ - class Bar - { - /** @var mixed */ - public $mixed; - - /** @var boolean */ - public $boolean; - - /** @var bool */ - public $bool; - - /** @var float */ - public $float; - - /** @var string */ - public $string; - - /** @var integer */ - public $integer; - - /** @var array */ - public $array; - - /** @var SomeAnnotationClass */ - public $annotation; - - /** @var array */ - public $arrayOfIntegers; - - /** @var array */ - public $arrayOfAnnotations; - } - - /** - * @Annotation - * @Target({"METHOD","PROPERTY"}) - * @Attributes({ - * @Attribute("stringProperty", type = "string"), - * @Attribute("annotProperty", type = "SomeAnnotationClass"), - * }) - */ - class Foo - { - public function __construct(array $values) - { - $this->stringProperty = $values['stringProperty']; - $this->annotProperty = $values['annotProperty']; - } - - // some code - } - -Annotation Required -------------------- - -``@Required`` indicates that the field must be specified when the -annotation is used. If it is not used you get an ``AnnotationException`` -stating that this value can not be null. - -Declaring a required field: - -.. code-block:: php - - /** - * @Annotation - * @Target("ALL") - */ - class Foo - { - /** @Required */ - public $requiredField; - } - -Usage: - -.. code-block:: php - - /** @Foo(requiredField="value") */ - public $direction; // Valid - - /** @Foo */ - public $direction; // Required field missing, throws an AnnotationException - - -Enumerated values ------------------ - -- An annotation property marked with ``@Enum`` is a field that accepts a - fixed set of scalar values. -- You should use ``@Enum`` fields any time you need to represent fixed - values. -- The annotation parser checks the given value and throws an - ``AnnotationException`` if the value does not match. - - -Declaring an enumerated property: - -.. code-block:: php - - /** - * @Annotation - * @Target("ALL") - */ - class Direction - { - /** - * @Enum({"NORTH", "SOUTH", "EAST", "WEST"}) - */ - public $value; - } - -Annotation usage: - -.. code-block:: php - - /** @Direction("NORTH") */ - public $direction; // Valid value - - /** @Direction("NORTHEAST") */ - public $direction; // Invalid value, throws an AnnotationException - - -Constants ---------- - -The use of constants and class constants is available on the annotations -parser. - -The following usages are allowed: - -.. code-block:: php - - namespace MyCompany\Entity; - - use MyCompany\Annotations\Foo; - use MyCompany\Annotations\Bar; - use MyCompany\Entity\SomeClass; - - /** - * @Foo(PHP_EOL) - * @Bar(Bar::FOO) - * @Foo({SomeClass::FOO, SomeClass::BAR}) - * @Bar({SomeClass::FOO_KEY = SomeClass::BAR_VALUE}) - */ - class User - { - } - - -Be careful with constants and the cache ! - -.. note:: - - The cached reader will not re-evaluate each time an annotation is - loaded from cache. When a constant is changed the cache must be - cleaned. - - -Usage ------ - -Using the library API is simple. Using the annotations described in the -previous section, you can now annotate other classes with your -annotations: - -.. code-block:: php - - namespace MyCompany\Entity; - - use MyCompany\Annotations\Foo; - use MyCompany\Annotations\Bar; - - /** - * @Foo(bar="foo") - * @Bar(foo="bar") - */ - class User - { - } - -Now we can write a script to get the annotations above: - -.. code-block:: php - - $reflClass = new ReflectionClass('MyCompany\Entity\User'); - $classAnnotations = $reader->getClassAnnotations($reflClass); - - foreach ($classAnnotations AS $annot) { - if ($annot instanceof \MyCompany\Annotations\Foo) { - echo $annot->bar; // prints "foo"; - } else if ($annot instanceof \MyCompany\Annotations\Bar) { - echo $annot->foo; // prints "bar"; - } - } - -You have a complete API for retrieving annotation class instances from a -class, property or method docblock: - - -Reader API -~~~~~~~~~~ - -Access all annotations of a class -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getClassAnnotations(\ReflectionClass $class); - -Access one annotation of a class -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getClassAnnotation(\ReflectionClass $class, $annotationName); - -Access all annotations of a method -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getMethodAnnotations(\ReflectionMethod $method); - -Access one annotation of a method -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getMethodAnnotation(\ReflectionMethod $method, $annotationName); - -Access all annotations of a property -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getPropertyAnnotations(\ReflectionProperty $property); - -Access one annotation of a property -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName); - -Access all annotations of a function -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getFunctionAnnotations(\ReflectionFunction $property); - -Access one annotation of a function -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getFunctionAnnotation(\ReflectionFunction $property, $annotationName); diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/index.rst b/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/index.rst deleted file mode 100644 index a6e33833..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/index.rst +++ /dev/null @@ -1,102 +0,0 @@ -Deprecation notice -================== - -PHP 8 introduced `attributes -`_, -which are a native replacement for annotations. As such, this library is -considered feature complete, and should receive exclusively bugfixes and -security fixes. - -Introduction -============ - -Doctrine Annotations allows to implement custom annotation -functionality for PHP classes and functions. - -.. code-block:: php - - class Foo - { - /** - * @MyAnnotation(myProperty="value") - */ - private $bar; - } - -Annotations aren't implemented in PHP itself which is why this component -offers a way to use the PHP doc-blocks as a place for the well known -annotation syntax using the ``@`` char. - -Annotations in Doctrine are used for the ORM configuration to build the -class mapping, but it can be used in other projects for other purposes -too. - -Installation -============ - -You can install the Annotation component with composer: - -.. code-block:: - -   $ composer require doctrine/annotations - -Create an annotation class -========================== - -An annotation class is a representation of the later used annotation -configuration in classes. The annotation class of the previous example -looks like this: - -.. code-block:: php - - /** - * @Annotation - */ - final class MyAnnotation - { - public $myProperty; - } - -The annotation class is declared as an annotation by ``@Annotation``. - -:ref:`Read more about custom annotations. ` - -Reading annotations -=================== - -The access to the annotations happens by reflection of the class or function -containing them. There are multiple reader-classes implementing the -``Doctrine\Common\Annotations\Reader`` interface, that can access the -annotations of a class. A common one is -``Doctrine\Common\Annotations\AnnotationReader``: - -.. code-block:: php - - use Doctrine\Common\Annotations\AnnotationReader; - - $reflectionClass = new ReflectionClass(Foo::class); - $property = $reflectionClass->getProperty('bar'); - - $reader = new AnnotationReader(); - $myAnnotation = $reader->getPropertyAnnotation( - $property, - MyAnnotation::class - ); - - echo $myAnnotation->myProperty; // result: "value" - -A reader has multiple methods to access the annotations of a class or -function. - -:ref:`Read more about handling annotations. ` - -IDE Support ------------ - -Some IDEs already provide support for annotations: - -- Eclipse via the `Symfony2 Plugin `_ -- PhpStorm via the `PHP Annotations Plugin `_ or the `Symfony Plugin `_ - -.. _Read more about handling annotations.: annotations -.. _Read more about custom annotations.: custom diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/sidebar.rst b/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/sidebar.rst deleted file mode 100644 index 6f5d13c4..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/docs/en/sidebar.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. toctree:: - :depth: 3 - - index - annotations - custom diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php deleted file mode 100644 index fba23e9f..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php +++ /dev/null @@ -1,54 +0,0 @@ - $data Key-value for properties to be defined in this class. */ - final public function __construct(array $data) - { - foreach ($data as $key => $value) { - $this->$key = $value; - } - } - - /** - * Error handler for unknown property accessor in Annotation class. - * - * @throws BadMethodCallException - */ - public function __get(string $name) - { - throw new BadMethodCallException( - sprintf("Unknown property '%s' on annotation '%s'.", $name, static::class) - ); - } - - /** - * Error handler for unknown property mutator in Annotation class. - * - * @param mixed $value Property value. - * - * @throws BadMethodCallException - */ - public function __set(string $name, $value) - { - throw new BadMethodCallException( - sprintf("Unknown property '%s' on annotation '%s'.", $name, static::class) - ); - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php deleted file mode 100644 index b1f85140..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php +++ /dev/null @@ -1,21 +0,0 @@ - */ - public $value; -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php deleted file mode 100644 index 6f24d9f1..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php +++ /dev/null @@ -1,69 +0,0 @@ - */ - public $value; - - /** - * Literal target declaration. - * - * @var mixed[] - */ - public $literal; - - /** - * @phpstan-param array{literal?: mixed[], value: list} $values - * - * @throws InvalidArgumentException - */ - public function __construct(array $values) - { - if (! isset($values['literal'])) { - $values['literal'] = []; - } - - foreach ($values['value'] as $var) { - if (! is_scalar($var)) { - throw new InvalidArgumentException(sprintf( - '@Enum supports only scalar values "%s" given.', - is_object($var) ? get_class($var) : gettype($var) - )); - } - } - - foreach ($values['literal'] as $key => $var) { - if (! in_array($key, $values['value'])) { - throw new InvalidArgumentException(sprintf( - 'Undefined enumerator value "%s" for literal "%s".', - $key, - $var - )); - } - } - - $this->value = $values['value']; - $this->literal = $values['literal']; - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php deleted file mode 100644 index 97a15c25..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php +++ /dev/null @@ -1,43 +0,0 @@ - */ - public $names; - - /** - * @phpstan-param array{value: string|list} $values - * - * @throws RuntimeException - */ - public function __construct(array $values) - { - if (is_string($values['value'])) { - $values['value'] = [$values['value']]; - } - - if (! is_array($values['value'])) { - throw new RuntimeException(sprintf( - '@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', - json_encode($values['value']) - )); - } - - $this->names = $values['value']; - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/NamedArgumentConstructor.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/NamedArgumentConstructor.php deleted file mode 100644 index 16906010..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/NamedArgumentConstructor.php +++ /dev/null @@ -1,13 +0,0 @@ - */ - private static $map = [ - 'ALL' => self::TARGET_ALL, - 'CLASS' => self::TARGET_CLASS, - 'METHOD' => self::TARGET_METHOD, - 'PROPERTY' => self::TARGET_PROPERTY, - 'FUNCTION' => self::TARGET_FUNCTION, - 'ANNOTATION' => self::TARGET_ANNOTATION, - ]; - - /** @phpstan-var list */ - public $value; - - /** - * Targets as bitmask. - * - * @var int - */ - public $targets; - - /** - * Literal target declaration. - * - * @var string - */ - public $literal; - - /** - * @phpstan-param array{value?: string|list} $values - * - * @throws InvalidArgumentException - */ - public function __construct(array $values) - { - if (! isset($values['value'])) { - $values['value'] = null; - } - - if (is_string($values['value'])) { - $values['value'] = [$values['value']]; - } - - if (! is_array($values['value'])) { - throw new InvalidArgumentException( - sprintf( - '@Target expects either a string value, or an array of strings, "%s" given.', - is_object($values['value']) ? get_class($values['value']) : gettype($values['value']) - ) - ); - } - - $bitmask = 0; - foreach ($values['value'] as $literal) { - if (! isset(self::$map[$literal])) { - throw new InvalidArgumentException( - sprintf( - 'Invalid Target "%s". Available targets: [%s]', - $literal, - implode(', ', array_keys(self::$map)) - ) - ); - } - - $bitmask |= self::$map[$literal]; - } - - $this->targets = $bitmask; - $this->value = $values['value']; - $this->literal = implode(', ', $this->value); - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php deleted file mode 100644 index 002ee049..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php +++ /dev/null @@ -1,158 +0,0 @@ - $available - * - * @return AnnotationException - */ - public static function enumeratorError( - string $attributeName, - string $annotationName, - string $context, - array $available, - $given - ) { - return new self(sprintf( - '[Enum Error] Attribute "%s" of @%s declared on %s accepts only [%s], but got %s.', - $attributeName, - $annotationName, - $context, - implode(', ', $available), - is_object($given) ? get_class($given) : $given - )); - } - - /** @return AnnotationException */ - public static function optimizerPlusSaveComments() - { - return new self( - 'You have to enable opcache.save_comments=1 or zend_optimizerplus.save_comments=1.' - ); - } - - /** @return AnnotationException */ - public static function optimizerPlusLoadComments() - { - return new self( - 'You have to enable opcache.load_comments=1 or zend_optimizerplus.load_comments=1.' - ); - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php deleted file mode 100644 index 31f3777a..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ /dev/null @@ -1,385 +0,0 @@ - - */ - private static $globalImports = [ - 'ignoreannotation' => Annotation\IgnoreAnnotation::class, - ]; - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names are case sensitive. - * - * @var array - */ - private static $globalIgnoredNames = ImplicitlyIgnoredAnnotationNames::LIST; - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names are case sensitive. - * - * @var array - */ - private static $globalIgnoredNamespaces = []; - - /** - * Add a new annotation to the globally ignored annotation names with regard to exception handling. - */ - public static function addGlobalIgnoredName(string $name) - { - self::$globalIgnoredNames[$name] = true; - } - - /** - * Add a new annotation to the globally ignored annotation namespaces with regard to exception handling. - */ - public static function addGlobalIgnoredNamespace(string $namespace) - { - self::$globalIgnoredNamespaces[$namespace] = true; - } - - /** - * Annotations parser. - * - * @var DocParser - */ - private $parser; - - /** - * Annotations parser used to collect parsing metadata. - * - * @var DocParser - */ - private $preParser; - - /** - * PHP parser used to collect imports. - * - * @var PhpParser - */ - private $phpParser; - - /** - * In-memory cache mechanism to store imported annotations per class. - * - * @psalm-var array<'class'|'function', array>> - */ - private $imports = []; - - /** - * In-memory cache mechanism to store ignored annotations per class. - * - * @psalm-var array<'class'|'function', array>> - */ - private $ignoredAnnotationNames = []; - - /** - * Initializes a new AnnotationReader. - * - * @throws AnnotationException - */ - public function __construct(?DocParser $parser = null) - { - if ( - extension_loaded('Zend Optimizer+') && (ini_get('zend_optimizerplus.save_comments') === '0' || - ini_get('opcache.save_comments') === '0') - ) { - throw AnnotationException::optimizerPlusSaveComments(); - } - - if (extension_loaded('Zend OPcache') && ini_get('opcache.save_comments') === 0) { - throw AnnotationException::optimizerPlusSaveComments(); - } - - // Make sure that the IgnoreAnnotation annotation is loaded - class_exists(IgnoreAnnotation::class); - - $this->parser = $parser ?: new DocParser(); - - $this->preParser = new DocParser(); - - $this->preParser->setImports(self::$globalImports); - $this->preParser->setIgnoreNotImportedAnnotations(true); - $this->preParser->setIgnoredAnnotationNames(self::$globalIgnoredNames); - - $this->phpParser = new PhpParser(); - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(ReflectionClass $class) - { - $this->parser->setTarget(Target::TARGET_CLASS); - $this->parser->setImports($this->getImports($class)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); - - return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName()); - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName) - { - $annotations = $this->getClassAnnotations($class); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $context = 'property ' . $class->getName() . '::$' . $property->getName(); - - $this->parser->setTarget(Target::TARGET_PROPERTY); - $this->parser->setImports($this->getPropertyImports($property)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); - - return $this->parser->parse($property->getDocComment(), $context); - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName) - { - $annotations = $this->getPropertyAnnotations($property); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $context = 'method ' . $class->getName() . '::' . $method->getName() . '()'; - - $this->parser->setTarget(Target::TARGET_METHOD); - $this->parser->setImports($this->getMethodImports($method)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); - - return $this->parser->parse($method->getDocComment(), $context); - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName) - { - $annotations = $this->getMethodAnnotations($method); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Gets the annotations applied to a function. - * - * @phpstan-return list An array of Annotations. - */ - public function getFunctionAnnotations(ReflectionFunction $function): array - { - $context = 'function ' . $function->getName(); - - $this->parser->setTarget(Target::TARGET_FUNCTION); - $this->parser->setImports($this->getImports($function)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($function)); - $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); - - return $this->parser->parse($function->getDocComment(), $context); - } - - /** - * Gets a function annotation. - * - * @return object|null The Annotation or NULL, if the requested annotation does not exist. - */ - public function getFunctionAnnotation(ReflectionFunction $function, string $annotationName) - { - $annotations = $this->getFunctionAnnotations($function); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Returns the ignored annotations for the given class or function. - * - * @param ReflectionClass|ReflectionFunction $reflection - * - * @return array - */ - private function getIgnoredAnnotationNames($reflection): array - { - $type = $reflection instanceof ReflectionClass ? 'class' : 'function'; - $name = $reflection->getName(); - - if (isset($this->ignoredAnnotationNames[$type][$name])) { - return $this->ignoredAnnotationNames[$type][$name]; - } - - $this->collectParsingMetadata($reflection); - - return $this->ignoredAnnotationNames[$type][$name]; - } - - /** - * Retrieves imports for a class or a function. - * - * @param ReflectionClass|ReflectionFunction $reflection - * - * @return array - */ - private function getImports($reflection): array - { - $type = $reflection instanceof ReflectionClass ? 'class' : 'function'; - $name = $reflection->getName(); - - if (isset($this->imports[$type][$name])) { - return $this->imports[$type][$name]; - } - - $this->collectParsingMetadata($reflection); - - return $this->imports[$type][$name]; - } - - /** - * Retrieves imports for methods. - * - * @return array - */ - private function getMethodImports(ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $classImports = $this->getImports($class); - - $traitImports = []; - - foreach ($class->getTraits() as $trait) { - if ( - ! $trait->hasMethod($method->getName()) - || $trait->getFileName() !== $method->getFileName() - ) { - continue; - } - - $traitImports = array_merge($traitImports, $this->phpParser->parseUseStatements($trait)); - } - - return array_merge($classImports, $traitImports); - } - - /** - * Retrieves imports for properties. - * - * @return array - */ - private function getPropertyImports(ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $classImports = $this->getImports($class); - - $traitImports = []; - - foreach ($class->getTraits() as $trait) { - if (! $trait->hasProperty($property->getName())) { - continue; - } - - $traitImports = array_merge($traitImports, $this->phpParser->parseUseStatements($trait)); - } - - return array_merge($classImports, $traitImports); - } - - /** - * Collects parsing metadata for a given class or function. - * - * @param ReflectionClass|ReflectionFunction $reflection - */ - private function collectParsingMetadata($reflection): void - { - $type = $reflection instanceof ReflectionClass ? 'class' : 'function'; - $name = $reflection->getName(); - - $ignoredAnnotationNames = self::$globalIgnoredNames; - $annotations = $this->preParser->parse($reflection->getDocComment(), $type . ' ' . $name); - - foreach ($annotations as $annotation) { - if (! ($annotation instanceof IgnoreAnnotation)) { - continue; - } - - foreach ($annotation->names as $annot) { - $ignoredAnnotationNames[$annot] = true; - } - } - - $this->imports[$type][$name] = array_merge( - self::$globalImports, - $this->phpParser->parseUseStatements($reflection), - [ - '__NAMESPACE__' => $reflection->getNamespaceName(), - 'self' => $name, - ] - ); - - $this->ignoredAnnotationNames[$type][$name] = $ignoredAnnotationNames; - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php deleted file mode 100644 index 290e60ab..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -final class DocLexer extends AbstractLexer -{ - public const T_NONE = 1; - public const T_INTEGER = 2; - public const T_STRING = 3; - public const T_FLOAT = 4; - - // All tokens that are also identifiers should be >= 100 - public const T_IDENTIFIER = 100; - public const T_AT = 101; - public const T_CLOSE_CURLY_BRACES = 102; - public const T_CLOSE_PARENTHESIS = 103; - public const T_COMMA = 104; - public const T_EQUALS = 105; - public const T_FALSE = 106; - public const T_NAMESPACE_SEPARATOR = 107; - public const T_OPEN_CURLY_BRACES = 108; - public const T_OPEN_PARENTHESIS = 109; - public const T_TRUE = 110; - public const T_NULL = 111; - public const T_COLON = 112; - public const T_MINUS = 113; - - /** @var array */ - protected $noCase = [ - '@' => self::T_AT, - ',' => self::T_COMMA, - '(' => self::T_OPEN_PARENTHESIS, - ')' => self::T_CLOSE_PARENTHESIS, - '{' => self::T_OPEN_CURLY_BRACES, - '}' => self::T_CLOSE_CURLY_BRACES, - '=' => self::T_EQUALS, - ':' => self::T_COLON, - '-' => self::T_MINUS, - '\\' => self::T_NAMESPACE_SEPARATOR, - ]; - - /** @var array */ - protected $withCase = [ - 'true' => self::T_TRUE, - 'false' => self::T_FALSE, - 'null' => self::T_NULL, - ]; - - /** - * Whether the next token starts immediately, or if there were - * non-captured symbols before that - */ - public function nextTokenIsAdjacent(): bool - { - return $this->token === null - || ($this->lookahead !== null - && ($this->lookahead->position - $this->token->position) === strlen($this->token->value)); - } - - /** - * {@inheritdoc} - */ - protected function getCatchablePatterns() - { - return [ - '[a-z_\\\][a-z0-9_\:\\\]*[a-z_][a-z0-9_]*', - '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?', - '"(?:""|[^"])*+"', - ]; - } - - /** - * {@inheritdoc} - */ - protected function getNonCatchablePatterns() - { - return ['\s+', '\*+', '(.)']; - } - - /** - * {@inheritdoc} - */ - protected function getType(&$value) - { - $type = self::T_NONE; - - if ($value[0] === '"') { - $value = str_replace('""', '"', substr($value, 1, strlen($value) - 2)); - - return self::T_STRING; - } - - if (isset($this->noCase[$value])) { - return $this->noCase[$value]; - } - - if ($value[0] === '_' || $value[0] === '\\' || ctype_alpha($value[0])) { - return self::T_IDENTIFIER; - } - - $lowerValue = strtolower($value); - - if (isset($this->withCase[$lowerValue])) { - return $this->withCase[$lowerValue]; - } - - // Checking numeric value - if (is_numeric($value)) { - return strpos($value, '.') !== false || stripos($value, 'e') !== false - ? self::T_FLOAT : self::T_INTEGER; - } - - return $type; - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php deleted file mode 100644 index a12c15e7..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php +++ /dev/null @@ -1,1494 +0,0 @@ - - */ - private static $classIdentifiers = [ - DocLexer::T_IDENTIFIER, - DocLexer::T_TRUE, - DocLexer::T_FALSE, - DocLexer::T_NULL, - ]; - - /** - * The lexer. - * - * @var DocLexer - */ - private $lexer; - - /** - * Current target context. - * - * @var int - */ - private $target; - - /** - * Doc parser used to collect annotation target. - * - * @var DocParser - */ - private static $metadataParser; - - /** - * Flag to control if the current annotation is nested or not. - * - * @var bool - */ - private $isNestedAnnotation = false; - - /** - * Hashmap containing all use-statements that are to be used when parsing - * the given doc block. - * - * @var array - */ - private $imports = []; - - /** - * This hashmap is used internally to cache results of class_exists() - * look-ups. - * - * @var array - */ - private $classExists = []; - - /** - * Whether annotations that have not been imported should be ignored. - * - * @var bool - */ - private $ignoreNotImportedAnnotations = false; - - /** - * An array of default namespaces if operating in simple mode. - * - * @var string[] - */ - private $namespaces = []; - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names must be the raw names as used in the class, not the fully qualified - * - * @var bool[] indexed by annotation name - */ - private $ignoredAnnotationNames = []; - - /** - * A list with annotations in namespaced format - * that are not causing exceptions when not resolved to an annotation class. - * - * @var bool[] indexed by namespace name - */ - private $ignoredAnnotationNamespaces = []; - - /** @var string */ - private $context = ''; - - /** - * Hash-map for caching annotation metadata. - * - * @var array - */ - private static $annotationMetadata = [ - Annotation\Target::class => [ - 'is_annotation' => true, - 'has_constructor' => true, - 'has_named_argument_constructor' => false, - 'properties' => [], - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => 'value', - 'attribute_types' => [ - 'value' => [ - 'required' => false, - 'type' => 'array', - 'array_type' => 'string', - 'value' => 'array', - ], - ], - ], - Annotation\Attribute::class => [ - 'is_annotation' => true, - 'has_constructor' => false, - 'has_named_argument_constructor' => false, - 'targets_literal' => 'ANNOTATION_ANNOTATION', - 'targets' => Target::TARGET_ANNOTATION, - 'default_property' => 'name', - 'properties' => [ - 'name' => 'name', - 'type' => 'type', - 'required' => 'required', - ], - 'attribute_types' => [ - 'value' => [ - 'required' => true, - 'type' => 'string', - 'value' => 'string', - ], - 'type' => [ - 'required' => true, - 'type' => 'string', - 'value' => 'string', - ], - 'required' => [ - 'required' => false, - 'type' => 'boolean', - 'value' => 'boolean', - ], - ], - ], - Annotation\Attributes::class => [ - 'is_annotation' => true, - 'has_constructor' => false, - 'has_named_argument_constructor' => false, - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => 'value', - 'properties' => ['value' => 'value'], - 'attribute_types' => [ - 'value' => [ - 'type' => 'array', - 'required' => true, - 'array_type' => Annotation\Attribute::class, - 'value' => 'array<' . Annotation\Attribute::class . '>', - ], - ], - ], - Annotation\Enum::class => [ - 'is_annotation' => true, - 'has_constructor' => true, - 'has_named_argument_constructor' => false, - 'targets_literal' => 'ANNOTATION_PROPERTY', - 'targets' => Target::TARGET_PROPERTY, - 'default_property' => 'value', - 'properties' => ['value' => 'value'], - 'attribute_types' => [ - 'value' => [ - 'type' => 'array', - 'required' => true, - ], - 'literal' => [ - 'type' => 'array', - 'required' => false, - ], - ], - ], - Annotation\NamedArgumentConstructor::class => [ - 'is_annotation' => true, - 'has_constructor' => false, - 'has_named_argument_constructor' => false, - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => null, - 'properties' => [], - 'attribute_types' => [], - ], - ]; - - /** - * Hash-map for handle types declaration. - * - * @var array - */ - private static $typeMap = [ - 'float' => 'double', - 'bool' => 'boolean', - // allow uppercase Boolean in honor of George Boole - 'Boolean' => 'boolean', - 'int' => 'integer', - ]; - - /** - * Constructs a new DocParser. - */ - public function __construct() - { - $this->lexer = new DocLexer(); - } - - /** - * Sets the annotation names that are ignored during the parsing process. - * - * The names are supposed to be the raw names as used in the class, not the - * fully qualified class names. - * - * @param bool[] $names indexed by annotation name - * - * @return void - */ - public function setIgnoredAnnotationNames(array $names) - { - $this->ignoredAnnotationNames = $names; - } - - /** - * Sets the annotation namespaces that are ignored during the parsing process. - * - * @param bool[] $ignoredAnnotationNamespaces indexed by annotation namespace name - * - * @return void - */ - public function setIgnoredAnnotationNamespaces(array $ignoredAnnotationNamespaces) - { - $this->ignoredAnnotationNamespaces = $ignoredAnnotationNamespaces; - } - - /** - * Sets ignore on not-imported annotations. - * - * @return void - */ - public function setIgnoreNotImportedAnnotations(bool $bool) - { - $this->ignoreNotImportedAnnotations = $bool; - } - - /** - * Sets the default namespaces. - * - * @return void - * - * @throws RuntimeException - */ - public function addNamespace(string $namespace) - { - if ($this->imports) { - throw new RuntimeException('You must either use addNamespace(), or setImports(), but not both.'); - } - - $this->namespaces[] = $namespace; - } - - /** - * Sets the imports. - * - * @param array $imports - * - * @return void - * - * @throws RuntimeException - */ - public function setImports(array $imports) - { - if ($this->namespaces) { - throw new RuntimeException('You must either use addNamespace(), or setImports(), but not both.'); - } - - $this->imports = $imports; - } - - /** - * Sets current target context as bitmask. - * - * @return void - */ - public function setTarget(int $target) - { - $this->target = $target; - } - - /** - * Parses the given docblock string for annotations. - * - * @phpstan-return list Array of annotations. If no annotations are found, an empty array is returned. - * - * @throws AnnotationException - * @throws ReflectionException - */ - public function parse(string $input, string $context = '') - { - $pos = $this->findInitialTokenPosition($input); - if ($pos === null) { - return []; - } - - $this->context = $context; - - $this->lexer->setInput(trim(substr($input, $pos), '* /')); - $this->lexer->moveNext(); - - return $this->Annotations(); - } - - /** - * Finds the first valid annotation - */ - private function findInitialTokenPosition(string $input): ?int - { - $pos = 0; - - // search for first valid annotation - while (($pos = strpos($input, '@', $pos)) !== false) { - $preceding = substr($input, $pos - 1, 1); - - // if the @ is preceded by a space, a tab or * it is valid - if ($pos === 0 || $preceding === ' ' || $preceding === '*' || $preceding === "\t") { - return $pos; - } - - $pos++; - } - - return null; - } - - /** - * Attempts to match the given token with the current lookahead token. - * If they match, updates the lookahead token; otherwise raises a syntax error. - * - * @param int $token Type of token. - * - * @return bool True if tokens match; false otherwise. - * - * @throws AnnotationException - */ - private function match(int $token): bool - { - if (! $this->lexer->isNextToken($token)) { - throw $this->syntaxError($this->lexer->getLiteral($token)); - } - - return $this->lexer->moveNext(); - } - - /** - * Attempts to match the current lookahead token with any of the given tokens. - * - * If any of them matches, this method updates the lookahead token; otherwise - * a syntax error is raised. - * - * @phpstan-param list $tokens - * - * @throws AnnotationException - */ - private function matchAny(array $tokens): bool - { - if (! $this->lexer->isNextTokenAny($tokens)) { - throw $this->syntaxError(implode(' or ', array_map([$this->lexer, 'getLiteral'], $tokens))); - } - - return $this->lexer->moveNext(); - } - - /** - * Generates a new syntax error. - * - * @param string $expected Expected string. - * @param mixed[]|null $token Optional token. - */ - private function syntaxError(string $expected, ?array $token = null): AnnotationException - { - if ($token === null) { - $token = $this->lexer->lookahead; - } - - $message = sprintf('Expected %s, got ', $expected); - $message .= $this->lexer->lookahead === null - ? 'end of string' - : sprintf("'%s' at position %s", $token->value, $token->position); - - if (strlen($this->context)) { - $message .= ' in ' . $this->context; - } - - $message .= '.'; - - return AnnotationException::syntaxError($message); - } - - /** - * Attempts to check if a class exists or not. This never goes through the PHP autoloading mechanism - * but uses the {@link AnnotationRegistry} to load classes. - * - * @param class-string $fqcn - */ - private function classExists(string $fqcn): bool - { - if (isset($this->classExists[$fqcn])) { - return $this->classExists[$fqcn]; - } - - // first check if the class already exists, maybe loaded through another AnnotationReader - if (class_exists($fqcn, false)) { - return $this->classExists[$fqcn] = true; - } - - // final check, does this class exist? - return $this->classExists[$fqcn] = AnnotationRegistry::loadAnnotationClass($fqcn); - } - - /** - * Collects parsing metadata for a given annotation class - * - * @param class-string $name The annotation name - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function collectAnnotationMetadata(string $name): void - { - if (self::$metadataParser === null) { - self::$metadataParser = new self(); - - self::$metadataParser->setIgnoreNotImportedAnnotations(true); - self::$metadataParser->setIgnoredAnnotationNames($this->ignoredAnnotationNames); - self::$metadataParser->setImports([ - 'enum' => Enum::class, - 'target' => Target::class, - 'attribute' => Attribute::class, - 'attributes' => Attributes::class, - 'namedargumentconstructor' => NamedArgumentConstructor::class, - ]); - - // Make sure that annotations from metadata are loaded - class_exists(Enum::class); - class_exists(Target::class); - class_exists(Attribute::class); - class_exists(Attributes::class); - class_exists(NamedArgumentConstructor::class); - } - - $class = new ReflectionClass($name); - $docComment = $class->getDocComment(); - - // Sets default values for annotation metadata - $constructor = $class->getConstructor(); - $metadata = [ - 'default_property' => null, - 'has_constructor' => $constructor !== null && $constructor->getNumberOfParameters() > 0, - 'constructor_args' => [], - 'properties' => [], - 'property_types' => [], - 'attribute_types' => [], - 'targets_literal' => null, - 'targets' => Target::TARGET_ALL, - 'is_annotation' => strpos($docComment, '@Annotation') !== false, - ]; - - $metadata['has_named_argument_constructor'] = false; - - // verify that the class is really meant to be an annotation - if ($metadata['is_annotation']) { - self::$metadataParser->setTarget(Target::TARGET_CLASS); - - foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) { - if ($annotation instanceof Target) { - $metadata['targets'] = $annotation->targets; - $metadata['targets_literal'] = $annotation->literal; - - continue; - } - - if ($annotation instanceof NamedArgumentConstructor) { - $metadata['has_named_argument_constructor'] = $metadata['has_constructor']; - if ($metadata['has_named_argument_constructor']) { - // choose the first argument as the default property - $metadata['default_property'] = $constructor->getParameters()[0]->getName(); - } - } - - if (! ($annotation instanceof Attributes)) { - continue; - } - - foreach ($annotation->value as $attribute) { - $this->collectAttributeTypeMetadata($metadata, $attribute); - } - } - - // if not has a constructor will inject values into public properties - if ($metadata['has_constructor'] === false) { - // collect all public properties - foreach ($class->getProperties(ReflectionProperty::IS_PUBLIC) as $property) { - $metadata['properties'][$property->name] = $property->name; - - $propertyComment = $property->getDocComment(); - if ($propertyComment === false) { - continue; - } - - $attribute = new Attribute(); - - $attribute->required = (strpos($propertyComment, '@Required') !== false); - $attribute->name = $property->name; - $attribute->type = (strpos($propertyComment, '@var') !== false && - preg_match('/@var\s+([^\s]+)/', $propertyComment, $matches)) - ? $matches[1] - : 'mixed'; - - $this->collectAttributeTypeMetadata($metadata, $attribute); - - // checks if the property has @Enum - if (strpos($propertyComment, '@Enum') === false) { - continue; - } - - $context = 'property ' . $class->name . '::$' . $property->name; - - self::$metadataParser->setTarget(Target::TARGET_PROPERTY); - - foreach (self::$metadataParser->parse($propertyComment, $context) as $annotation) { - if (! $annotation instanceof Enum) { - continue; - } - - $metadata['enum'][$property->name]['value'] = $annotation->value; - $metadata['enum'][$property->name]['literal'] = (! empty($annotation->literal)) - ? $annotation->literal - : $annotation->value; - } - } - - // choose the first property as default property - $metadata['default_property'] = reset($metadata['properties']); - } elseif ($metadata['has_named_argument_constructor']) { - foreach ($constructor->getParameters() as $parameter) { - if ($parameter->isVariadic()) { - break; - } - - $metadata['constructor_args'][$parameter->getName()] = [ - 'position' => $parameter->getPosition(), - 'default' => $parameter->isOptional() ? $parameter->getDefaultValue() : null, - ]; - } - } - } - - self::$annotationMetadata[$name] = $metadata; - } - - /** - * Collects parsing metadata for a given attribute. - * - * @param mixed[] $metadata - */ - private function collectAttributeTypeMetadata(array &$metadata, Attribute $attribute): void - { - // handle internal type declaration - $type = self::$typeMap[$attribute->type] ?? $attribute->type; - - // handle the case if the property type is mixed - if ($type === 'mixed') { - return; - } - - // Evaluate type - $pos = strpos($type, '<'); - if ($pos !== false) { - // Checks if the property has array - $arrayType = substr($type, $pos + 1, -1); - $type = 'array'; - - if (isset(self::$typeMap[$arrayType])) { - $arrayType = self::$typeMap[$arrayType]; - } - - $metadata['attribute_types'][$attribute->name]['array_type'] = $arrayType; - } else { - // Checks if the property has type[] - $pos = strrpos($type, '['); - if ($pos !== false) { - $arrayType = substr($type, 0, $pos); - $type = 'array'; - - if (isset(self::$typeMap[$arrayType])) { - $arrayType = self::$typeMap[$arrayType]; - } - - $metadata['attribute_types'][$attribute->name]['array_type'] = $arrayType; - } - } - - $metadata['attribute_types'][$attribute->name]['type'] = $type; - $metadata['attribute_types'][$attribute->name]['value'] = $attribute->type; - $metadata['attribute_types'][$attribute->name]['required'] = $attribute->required; - } - - /** - * Annotations ::= Annotation {[ "*" ]* [Annotation]}* - * - * @phpstan-return list - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function Annotations(): array - { - $annotations = []; - - while ($this->lexer->lookahead !== null) { - if ($this->lexer->lookahead->type !== DocLexer::T_AT) { - $this->lexer->moveNext(); - continue; - } - - // make sure the @ is preceded by non-catchable pattern - if ( - $this->lexer->token !== null && - $this->lexer->lookahead->position === $this->lexer->token->position + strlen( - $this->lexer->token->value - ) - ) { - $this->lexer->moveNext(); - continue; - } - - // make sure the @ is followed by either a namespace separator, or - // an identifier token - $peek = $this->lexer->glimpse(); - if ( - ($peek === null) - || ($peek->type !== DocLexer::T_NAMESPACE_SEPARATOR && ! in_array( - $peek->type, - self::$classIdentifiers, - true - )) - || $peek->position !== $this->lexer->lookahead->position + 1 - ) { - $this->lexer->moveNext(); - continue; - } - - $this->isNestedAnnotation = false; - $annot = $this->Annotation(); - if ($annot === false) { - continue; - } - - $annotations[] = $annot; - } - - return $annotations; - } - - /** - * Annotation ::= "@" AnnotationName MethodCall - * AnnotationName ::= QualifiedName | SimpleName - * QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName - * NameSpacePart ::= identifier | null | false | true - * SimpleName ::= identifier | null | false | true - * - * @return object|false False if it is not a valid annotation. - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function Annotation() - { - $this->match(DocLexer::T_AT); - - // check if we have an annotation - $name = $this->Identifier(); - - if ( - $this->lexer->isNextToken(DocLexer::T_MINUS) - && $this->lexer->nextTokenIsAdjacent() - ) { - // Annotations with dashes, such as "@foo-" or "@foo-bar", are to be discarded - return false; - } - - // only process names which are not fully qualified, yet - // fully qualified names must start with a \ - $originalName = $name; - - if ($name[0] !== '\\') { - $pos = strpos($name, '\\'); - $alias = ($pos === false) ? $name : substr($name, 0, $pos); - $found = false; - $loweredAlias = strtolower($alias); - - if ($this->namespaces) { - foreach ($this->namespaces as $namespace) { - if ($this->classExists($namespace . '\\' . $name)) { - $name = $namespace . '\\' . $name; - $found = true; - break; - } - } - } elseif (isset($this->imports[$loweredAlias])) { - $namespace = ltrim($this->imports[$loweredAlias], '\\'); - $name = ($pos !== false) - ? $namespace . substr($name, $pos) - : $namespace; - $found = $this->classExists($name); - } elseif ( - ! isset($this->ignoredAnnotationNames[$name]) - && isset($this->imports['__NAMESPACE__']) - && $this->classExists($this->imports['__NAMESPACE__'] . '\\' . $name) - ) { - $name = $this->imports['__NAMESPACE__'] . '\\' . $name; - $found = true; - } elseif (! isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { - $found = true; - } - - if (! $found) { - if ($this->isIgnoredAnnotation($name)) { - return false; - } - - throw AnnotationException::semanticalError(sprintf( - <<<'EXCEPTION' -The annotation "@%s" in %s was never imported. Did you maybe forget to add a "use" statement for this annotation? -EXCEPTION - , - $name, - $this->context - )); - } - } - - $name = ltrim($name, '\\'); - - if (! $this->classExists($name)) { - throw AnnotationException::semanticalError(sprintf( - 'The annotation "@%s" in %s does not exist, or could not be auto-loaded.', - $name, - $this->context - )); - } - - // at this point, $name contains the fully qualified class name of the - // annotation, and it is also guaranteed that this class exists, and - // that it is loaded - - // collects the metadata annotation only if there is not yet - if (! isset(self::$annotationMetadata[$name])) { - $this->collectAnnotationMetadata($name); - } - - // verify that the class is really meant to be an annotation and not just any ordinary class - if (self::$annotationMetadata[$name]['is_annotation'] === false) { - if ($this->isIgnoredAnnotation($originalName) || $this->isIgnoredAnnotation($name)) { - return false; - } - - throw AnnotationException::semanticalError(sprintf( - <<<'EXCEPTION' -The class "%s" is not annotated with @Annotation. -Are you sure this class can be used as annotation? -If so, then you need to add @Annotation to the _class_ doc comment of "%s". -If it is indeed no annotation, then you need to add @IgnoreAnnotation("%s") to the _class_ doc comment of %s. -EXCEPTION - , - $name, - $name, - $originalName, - $this->context - )); - } - - //if target is nested annotation - $target = $this->isNestedAnnotation ? Target::TARGET_ANNOTATION : $this->target; - - // Next will be nested - $this->isNestedAnnotation = true; - - //if annotation does not support current target - if ((self::$annotationMetadata[$name]['targets'] & $target) === 0 && $target) { - throw AnnotationException::semanticalError( - sprintf( - <<<'EXCEPTION' -Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s. -EXCEPTION - , - $originalName, - $this->context, - self::$annotationMetadata[$name]['targets_literal'] - ) - ); - } - - $arguments = $this->MethodCall(); - $values = $this->resolvePositionalValues($arguments, $name); - - if (isset(self::$annotationMetadata[$name]['enum'])) { - // checks all declared attributes - foreach (self::$annotationMetadata[$name]['enum'] as $property => $enum) { - // checks if the attribute is a valid enumerator - if (isset($values[$property]) && ! in_array($values[$property], $enum['value'])) { - throw AnnotationException::enumeratorError( - $property, - $name, - $this->context, - $enum['literal'], - $values[$property] - ); - } - } - } - - // checks all declared attributes - foreach (self::$annotationMetadata[$name]['attribute_types'] as $property => $type) { - if ( - $property === self::$annotationMetadata[$name]['default_property'] - && ! isset($values[$property]) && isset($values['value']) - ) { - $property = 'value'; - } - - // handle a not given attribute or null value - if (! isset($values[$property])) { - if ($type['required']) { - throw AnnotationException::requiredError( - $property, - $originalName, - $this->context, - 'a(n) ' . $type['value'] - ); - } - - continue; - } - - if ($type['type'] === 'array') { - // handle the case of a single value - if (! is_array($values[$property])) { - $values[$property] = [$values[$property]]; - } - - // checks if the attribute has array type declaration, such as "array" - if (isset($type['array_type'])) { - foreach ($values[$property] as $item) { - if (gettype($item) !== $type['array_type'] && ! $item instanceof $type['array_type']) { - throw AnnotationException::attributeTypeError( - $property, - $originalName, - $this->context, - 'either a(n) ' . $type['array_type'] . ', or an array of ' . $type['array_type'] . 's', - $item - ); - } - } - } - } elseif (gettype($values[$property]) !== $type['type'] && ! $values[$property] instanceof $type['type']) { - throw AnnotationException::attributeTypeError( - $property, - $originalName, - $this->context, - 'a(n) ' . $type['value'], - $values[$property] - ); - } - } - - if (self::$annotationMetadata[$name]['has_named_argument_constructor']) { - if (PHP_VERSION_ID >= 80000) { - foreach ($values as $property => $value) { - if (! isset(self::$annotationMetadata[$name]['constructor_args'][$property])) { - throw AnnotationException::creationError(sprintf( - <<<'EXCEPTION' -The annotation @%s declared on %s does not have a property named "%s" -that can be set through its named arguments constructor. -Available named arguments: %s -EXCEPTION - , - $originalName, - $this->context, - $property, - implode(', ', array_keys(self::$annotationMetadata[$name]['constructor_args'])) - )); - } - } - - return $this->instantiateAnnotiation($originalName, $this->context, $name, $values); - } - - $positionalValues = []; - foreach (self::$annotationMetadata[$name]['constructor_args'] as $property => $parameter) { - $positionalValues[$parameter['position']] = $parameter['default']; - } - - foreach ($values as $property => $value) { - if (! isset(self::$annotationMetadata[$name]['constructor_args'][$property])) { - throw AnnotationException::creationError(sprintf( - <<<'EXCEPTION' -The annotation @%s declared on %s does not have a property named "%s" -that can be set through its named arguments constructor. -Available named arguments: %s -EXCEPTION - , - $originalName, - $this->context, - $property, - implode(', ', array_keys(self::$annotationMetadata[$name]['constructor_args'])) - )); - } - - $positionalValues[self::$annotationMetadata[$name]['constructor_args'][$property]['position']] = $value; - } - - return $this->instantiateAnnotiation($originalName, $this->context, $name, $positionalValues); - } - - // check if the annotation expects values via the constructor, - // or directly injected into public properties - if (self::$annotationMetadata[$name]['has_constructor'] === true) { - return $this->instantiateAnnotiation($originalName, $this->context, $name, [$values]); - } - - $instance = $this->instantiateAnnotiation($originalName, $this->context, $name, []); - - foreach ($values as $property => $value) { - if (! isset(self::$annotationMetadata[$name]['properties'][$property])) { - if ($property !== 'value') { - throw AnnotationException::creationError(sprintf( - <<<'EXCEPTION' -The annotation @%s declared on %s does not have a property named "%s". -Available properties: %s -EXCEPTION - , - $originalName, - $this->context, - $property, - implode(', ', self::$annotationMetadata[$name]['properties']) - )); - } - - // handle the case if the property has no annotations - $property = self::$annotationMetadata[$name]['default_property']; - if (! $property) { - throw AnnotationException::creationError(sprintf( - 'The annotation @%s declared on %s does not accept any values, but got %s.', - $originalName, - $this->context, - json_encode($values) - )); - } - } - - $instance->{$property} = $value; - } - - return $instance; - } - - /** - * MethodCall ::= ["(" [Values] ")"] - * - * @return mixed[] - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function MethodCall(): array - { - $values = []; - - if (! $this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { - return $values; - } - - $this->match(DocLexer::T_OPEN_PARENTHESIS); - - if (! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { - $values = $this->Values(); - } - - $this->match(DocLexer::T_CLOSE_PARENTHESIS); - - return $values; - } - - /** - * Values ::= Array | Value {"," Value}* [","] - * - * @return mixed[] - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function Values(): array - { - $values = [$this->Value()]; - - while ($this->lexer->isNextToken(DocLexer::T_COMMA)) { - $this->match(DocLexer::T_COMMA); - - if ($this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { - break; - } - - $token = $this->lexer->lookahead; - $value = $this->Value(); - - $values[] = $value; - } - - $namedArguments = []; - $positionalArguments = []; - foreach ($values as $k => $value) { - if (is_object($value) && $value instanceof stdClass) { - $namedArguments[$value->name] = $value->value; - } else { - $positionalArguments[$k] = $value; - } - } - - return ['named_arguments' => $namedArguments, 'positional_arguments' => $positionalArguments]; - } - - /** - * Constant ::= integer | string | float | boolean - * - * @return mixed - * - * @throws AnnotationException - */ - private function Constant() - { - $identifier = $this->Identifier(); - - if (! defined($identifier) && strpos($identifier, '::') !== false && $identifier[0] !== '\\') { - [$className, $const] = explode('::', $identifier); - - $pos = strpos($className, '\\'); - $alias = ($pos === false) ? $className : substr($className, 0, $pos); - $found = false; - $loweredAlias = strtolower($alias); - - switch (true) { - case ! empty($this->namespaces): - foreach ($this->namespaces as $ns) { - if (class_exists($ns . '\\' . $className) || interface_exists($ns . '\\' . $className)) { - $className = $ns . '\\' . $className; - $found = true; - break; - } - } - - break; - - case isset($this->imports[$loweredAlias]): - $found = true; - $className = ($pos !== false) - ? $this->imports[$loweredAlias] . substr($className, $pos) - : $this->imports[$loweredAlias]; - break; - - default: - if (isset($this->imports['__NAMESPACE__'])) { - $ns = $this->imports['__NAMESPACE__']; - - if (class_exists($ns . '\\' . $className) || interface_exists($ns . '\\' . $className)) { - $className = $ns . '\\' . $className; - $found = true; - } - } - - break; - } - - if ($found) { - $identifier = $className . '::' . $const; - } - } - - /** - * Checks if identifier ends with ::class and remove the leading backslash if it exists. - */ - if ( - $this->identifierEndsWithClassConstant($identifier) && - ! $this->identifierStartsWithBackslash($identifier) - ) { - return substr($identifier, 0, $this->getClassConstantPositionInIdentifier($identifier)); - } - - if ($this->identifierEndsWithClassConstant($identifier) && $this->identifierStartsWithBackslash($identifier)) { - return substr($identifier, 1, $this->getClassConstantPositionInIdentifier($identifier) - 1); - } - - if (! defined($identifier)) { - throw AnnotationException::semanticalErrorConstants($identifier, $this->context); - } - - return constant($identifier); - } - - private function identifierStartsWithBackslash(string $identifier): bool - { - return $identifier[0] === '\\'; - } - - private function identifierEndsWithClassConstant(string $identifier): bool - { - return $this->getClassConstantPositionInIdentifier($identifier) === strlen($identifier) - strlen('::class'); - } - - /** @return int|false */ - private function getClassConstantPositionInIdentifier(string $identifier) - { - return stripos($identifier, '::class'); - } - - /** - * Identifier ::= string - * - * @throws AnnotationException - */ - private function Identifier(): string - { - // check if we have an annotation - if (! $this->lexer->isNextTokenAny(self::$classIdentifiers)) { - throw $this->syntaxError('namespace separator or identifier'); - } - - $this->lexer->moveNext(); - - $className = $this->lexer->token->value; - - while ( - $this->lexer->lookahead !== null && - $this->lexer->lookahead->position === ($this->lexer->token->position + - strlen($this->lexer->token->value)) && - $this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR) - ) { - $this->match(DocLexer::T_NAMESPACE_SEPARATOR); - $this->matchAny(self::$classIdentifiers); - - $className .= '\\' . $this->lexer->token->value; - } - - return $className; - } - - /** - * Value ::= PlainValue | FieldAssignment - * - * @return mixed - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function Value() - { - $peek = $this->lexer->glimpse(); - - if ($peek->type === DocLexer::T_EQUALS) { - return $this->FieldAssignment(); - } - - return $this->PlainValue(); - } - - /** - * PlainValue ::= integer | string | float | boolean | Array | Annotation - * - * @return mixed - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function PlainValue() - { - if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) { - return $this->Arrayx(); - } - - if ($this->lexer->isNextToken(DocLexer::T_AT)) { - return $this->Annotation(); - } - - if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) { - return $this->Constant(); - } - - switch ($this->lexer->lookahead->type) { - case DocLexer::T_STRING: - $this->match(DocLexer::T_STRING); - - return $this->lexer->token->value; - - case DocLexer::T_INTEGER: - $this->match(DocLexer::T_INTEGER); - - return (int) $this->lexer->token->value; - - case DocLexer::T_FLOAT: - $this->match(DocLexer::T_FLOAT); - - return (float) $this->lexer->token->value; - - case DocLexer::T_TRUE: - $this->match(DocLexer::T_TRUE); - - return true; - - case DocLexer::T_FALSE: - $this->match(DocLexer::T_FALSE); - - return false; - - case DocLexer::T_NULL: - $this->match(DocLexer::T_NULL); - - return null; - - default: - throw $this->syntaxError('PlainValue'); - } - } - - /** - * FieldAssignment ::= FieldName "=" PlainValue - * FieldName ::= identifier - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function FieldAssignment(): stdClass - { - $this->match(DocLexer::T_IDENTIFIER); - $fieldName = $this->lexer->token->value; - - $this->match(DocLexer::T_EQUALS); - - $item = new stdClass(); - $item->name = $fieldName; - $item->value = $this->PlainValue(); - - return $item; - } - - /** - * Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}" - * - * @return mixed[] - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function Arrayx(): array - { - $array = $values = []; - - $this->match(DocLexer::T_OPEN_CURLY_BRACES); - - // If the array is empty, stop parsing and return. - if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) { - $this->match(DocLexer::T_CLOSE_CURLY_BRACES); - - return $array; - } - - $values[] = $this->ArrayEntry(); - - while ($this->lexer->isNextToken(DocLexer::T_COMMA)) { - $this->match(DocLexer::T_COMMA); - - // optional trailing comma - if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) { - break; - } - - $values[] = $this->ArrayEntry(); - } - - $this->match(DocLexer::T_CLOSE_CURLY_BRACES); - - foreach ($values as $value) { - [$key, $val] = $value; - - if ($key !== null) { - $array[$key] = $val; - } else { - $array[] = $val; - } - } - - return $array; - } - - /** - * ArrayEntry ::= Value | KeyValuePair - * KeyValuePair ::= Key ("=" | ":") PlainValue | Constant - * Key ::= string | integer | Constant - * - * @phpstan-return array{mixed, mixed} - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function ArrayEntry(): array - { - $peek = $this->lexer->glimpse(); - - if ( - $peek->type === DocLexer::T_EQUALS - || $peek->type === DocLexer::T_COLON - ) { - if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) { - $key = $this->Constant(); - } else { - $this->matchAny([DocLexer::T_INTEGER, DocLexer::T_STRING]); - $key = $this->lexer->token->value; - } - - $this->matchAny([DocLexer::T_EQUALS, DocLexer::T_COLON]); - - return [$key, $this->PlainValue()]; - } - - return [null, $this->Value()]; - } - - /** - * Checks whether the given $name matches any ignored annotation name or namespace - */ - private function isIgnoredAnnotation(string $name): bool - { - if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) { - return true; - } - - foreach (array_keys($this->ignoredAnnotationNamespaces) as $ignoredAnnotationNamespace) { - $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\') . '\\'; - - if (stripos(rtrim($name, '\\') . '\\', $ignoredAnnotationNamespace) === 0) { - return true; - } - } - - return false; - } - - /** - * Resolve positional arguments (without name) to named ones - * - * @param array $arguments - * - * @return array - */ - private function resolvePositionalValues(array $arguments, string $name): array - { - $positionalArguments = $arguments['positional_arguments'] ?? []; - $values = $arguments['named_arguments'] ?? []; - - if ( - self::$annotationMetadata[$name]['has_named_argument_constructor'] - && self::$annotationMetadata[$name]['default_property'] !== null - ) { - // We must ensure that we don't have positional arguments after named ones - $positions = array_keys($positionalArguments); - $lastPosition = null; - foreach ($positions as $position) { - if ( - ($lastPosition === null && $position !== 0) || - ($lastPosition !== null && $position !== $lastPosition + 1) - ) { - throw $this->syntaxError('Positional arguments after named arguments is not allowed'); - } - - $lastPosition = $position; - } - - foreach (self::$annotationMetadata[$name]['constructor_args'] as $property => $parameter) { - $position = $parameter['position']; - if (isset($values[$property]) || ! isset($positionalArguments[$position])) { - continue; - } - - $values[$property] = $positionalArguments[$position]; - } - } else { - if (count($positionalArguments) > 0 && ! isset($values['value'])) { - if (count($positionalArguments) === 1) { - $value = array_pop($positionalArguments); - } else { - $value = array_values($positionalArguments); - } - - $values['value'] = $value; - } - } - - return $values; - } - - /** - * Try to instantiate the annotation and catch and process any exceptions related to failure - * - * @param class-string $name - * @param array $arguments - * - * @return object - * - * @throws AnnotationException - */ - private function instantiateAnnotiation(string $originalName, string $context, string $name, array $arguments) - { - try { - return new $name(...$arguments); - } catch (Throwable $exception) { - throw AnnotationException::creationError( - sprintf( - 'An error occurred while instantiating the annotation @%s declared on %s: "%s".', - $originalName, - $context, - $exception->getMessage() - ), - $exception - ); - } - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php deleted file mode 100644 index ab27f8a5..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php +++ /dev/null @@ -1,178 +0,0 @@ - true, - 'Attribute' => true, - 'Attributes' => true, - /* Can we enable this? 'Enum' => true, */ - 'Required' => true, - 'Target' => true, - 'NamedArgumentConstructor' => true, - ]; - - private const WidelyUsedNonStandard = [ - 'fix' => true, - 'fixme' => true, - 'override' => true, - ]; - - private const PhpDocumentor1 = [ - 'abstract' => true, - 'access' => true, - 'code' => true, - 'deprec' => true, - 'endcode' => true, - 'exception' => true, - 'final' => true, - 'ingroup' => true, - 'inheritdoc' => true, - 'inheritDoc' => true, - 'magic' => true, - 'name' => true, - 'private' => true, - 'static' => true, - 'staticvar' => true, - 'staticVar' => true, - 'toc' => true, - 'tutorial' => true, - 'throw' => true, - ]; - - private const PhpDocumentor2 = [ - 'api' => true, - 'author' => true, - 'category' => true, - 'copyright' => true, - 'deprecated' => true, - 'example' => true, - 'filesource' => true, - 'global' => true, - 'ignore' => true, - /* Can we enable this? 'index' => true, */ - 'internal' => true, - 'license' => true, - 'link' => true, - 'method' => true, - 'package' => true, - 'param' => true, - 'property' => true, - 'property-read' => true, - 'property-write' => true, - 'return' => true, - 'see' => true, - 'since' => true, - 'source' => true, - 'subpackage' => true, - 'throws' => true, - 'todo' => true, - 'TODO' => true, - 'usedby' => true, - 'uses' => true, - 'var' => true, - 'version' => true, - ]; - - private const PHPUnit = [ - 'author' => true, - 'after' => true, - 'afterClass' => true, - 'backupGlobals' => true, - 'backupStaticAttributes' => true, - 'before' => true, - 'beforeClass' => true, - 'codeCoverageIgnore' => true, - 'codeCoverageIgnoreStart' => true, - 'codeCoverageIgnoreEnd' => true, - 'covers' => true, - 'coversDefaultClass' => true, - 'coversNothing' => true, - 'dataProvider' => true, - 'depends' => true, - 'doesNotPerformAssertions' => true, - 'expectedException' => true, - 'expectedExceptionCode' => true, - 'expectedExceptionMessage' => true, - 'expectedExceptionMessageRegExp' => true, - 'group' => true, - 'large' => true, - 'medium' => true, - 'preserveGlobalState' => true, - 'requires' => true, - 'runTestsInSeparateProcesses' => true, - 'runInSeparateProcess' => true, - 'small' => true, - 'test' => true, - 'testdox' => true, - 'testWith' => true, - 'ticket' => true, - 'uses' => true, - ]; - - private const PhpCheckStyle = ['SuppressWarnings' => true]; - - private const PhpStorm = ['noinspection' => true]; - - private const PEAR = ['package_version' => true]; - - private const PlainUML = [ - 'startuml' => true, - 'enduml' => true, - ]; - - private const Symfony = ['experimental' => true]; - - private const PhpCodeSniffer = [ - 'codingStandardsIgnoreStart' => true, - 'codingStandardsIgnoreEnd' => true, - ]; - - private const SlevomatCodingStandard = ['phpcsSuppress' => true]; - - private const Phan = ['suppress' => true]; - - private const Rector = ['noRector' => true]; - - private const StaticAnalysis = [ - // PHPStan, Psalm - 'extends' => true, - 'implements' => true, - 'readonly' => true, - 'template' => true, - 'use' => true, - - // Psalm - 'pure' => true, - 'immutable' => true, - ]; - - public const LIST = self::Reserved - + self::WidelyUsedNonStandard - + self::PhpDocumentor1 - + self::PhpDocumentor2 - + self::PHPUnit - + self::PhpCheckStyle - + self::PhpStorm - + self::PEAR - + self::PlainUML - + self::Symfony - + self::SlevomatCodingStandard - + self::PhpCodeSniffer - + self::Phan - + self::Rector - + self::StaticAnalysis; - - private function __construct() - { - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php deleted file mode 100644 index 77b5b9cb..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php +++ /dev/null @@ -1,99 +0,0 @@ -delegate = $reader; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(ReflectionClass $class) - { - $annotations = []; - foreach ($this->delegate->getClassAnnotations($class) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName) - { - return $this->delegate->getClassAnnotation($class, $annotationName); - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(ReflectionMethod $method) - { - $annotations = []; - foreach ($this->delegate->getMethodAnnotations($method) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName) - { - return $this->delegate->getMethodAnnotation($method, $annotationName); - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(ReflectionProperty $property) - { - $annotations = []; - foreach ($this->delegate->getPropertyAnnotations($property) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName) - { - return $this->delegate->getPropertyAnnotation($property, $annotationName); - } - - /** - * Proxies all methods to the delegate. - * - * @param mixed[] $args - * - * @return mixed - */ - public function __call(string $method, array $args) - { - return call_user_func_array([$this->delegate, $method], $args); - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php deleted file mode 100644 index 312a2ab1..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php +++ /dev/null @@ -1,78 +0,0 @@ - a list with use statements in the form (Alias => FQN). - */ - public function parseUseStatements($reflection): array - { - if (method_exists($reflection, 'getUseStatements')) { - return $reflection->getUseStatements(); - } - - $filename = $reflection->getFileName(); - - if ($filename === false) { - return []; - } - - $content = $this->getFileContent($filename, $reflection->getStartLine()); - - if ($content === null) { - return []; - } - - $namespace = preg_quote($reflection->getNamespaceName()); - $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content); - $tokenizer = new TokenParser('parseUseStatements($reflection->getNamespaceName()); - } - - /** - * Gets the content of the file right up to the given line number. - * - * @param string $filename The name of the file to load. - * @param int $lineNumber The number of lines to read from file. - * - * @return string|null The content of the file or null if the file does not exist. - */ - private function getFileContent(string $filename, $lineNumber) - { - if (! is_file($filename)) { - return null; - } - - $content = ''; - $lineCnt = 0; - $file = new SplFileObject($filename); - while (! $file->eof()) { - if ($lineCnt++ === $lineNumber) { - break; - } - - $content .= $file->fgets(); - } - - return $content; - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php deleted file mode 100644 index a7099d57..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php +++ /dev/null @@ -1,232 +0,0 @@ -> */ - private $loadedAnnotations = []; - - /** @var int[] */ - private $loadedFilemtimes = []; - - public function __construct(Reader $reader, CacheItemPoolInterface $cache, bool $debug = false) - { - $this->delegate = $reader; - $this->cache = $cache; - $this->debug = (bool) $debug; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(ReflectionClass $class) - { - $cacheKey = $class->getName(); - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - $annots = $this->fetchFromCache($cacheKey, $class, 'getClassAnnotations', $class); - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName) - { - foreach ($this->getClassAnnotations($class) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $cacheKey = $class->getName() . '$' . $property->getName(); - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - $annots = $this->fetchFromCache($cacheKey, $class, 'getPropertyAnnotations', $property); - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName) - { - foreach ($this->getPropertyAnnotations($property) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $cacheKey = $class->getName() . '#' . $method->getName(); - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - $annots = $this->fetchFromCache($cacheKey, $class, 'getMethodAnnotations', $method); - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName) - { - foreach ($this->getMethodAnnotations($method) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - public function clearLoadedAnnotations(): void - { - $this->loadedAnnotations = []; - $this->loadedFilemtimes = []; - } - - /** @return mixed[] */ - private function fetchFromCache( - string $cacheKey, - ReflectionClass $class, - string $method, - Reflector $reflector - ): array { - $cacheKey = rawurlencode($cacheKey); - - $item = $this->cache->getItem($cacheKey); - if (($this->debug && ! $this->refresh($cacheKey, $class)) || ! $item->isHit()) { - $this->cache->save($item->set($this->delegate->{$method}($reflector))); - } - - return $item->get(); - } - - /** - * Used in debug mode to check if the cache is fresh. - * - * @return bool Returns true if the cache was fresh, or false if the class - * being read was modified since writing to the cache. - */ - private function refresh(string $cacheKey, ReflectionClass $class): bool - { - $lastModification = $this->getLastModification($class); - if ($lastModification === 0) { - return true; - } - - $item = $this->cache->getItem('[C]' . $cacheKey); - if ($item->isHit() && $item->get() >= $lastModification) { - return true; - } - - $this->cache->save($item->set(time())); - - return false; - } - - /** - * Returns the time the class was last modified, testing traits and parents - */ - private function getLastModification(ReflectionClass $class): int - { - $filename = $class->getFileName(); - - if (isset($this->loadedFilemtimes[$filename])) { - return $this->loadedFilemtimes[$filename]; - } - - $parent = $class->getParentClass(); - - $lastModification = max(array_merge( - [$filename ? filemtime($filename) : 0], - array_map(function (ReflectionClass $reflectionTrait): int { - return $this->getTraitLastModificationTime($reflectionTrait); - }, $class->getTraits()), - array_map(function (ReflectionClass $class): int { - return $this->getLastModification($class); - }, $class->getInterfaces()), - $parent ? [$this->getLastModification($parent)] : [] - )); - - assert($lastModification !== false); - - return $this->loadedFilemtimes[$filename] = $lastModification; - } - - private function getTraitLastModificationTime(ReflectionClass $reflectionTrait): int - { - $fileName = $reflectionTrait->getFileName(); - - if (isset($this->loadedFilemtimes[$fileName])) { - return $this->loadedFilemtimes[$fileName]; - } - - $lastModificationTime = max(array_merge( - [$fileName ? filemtime($fileName) : 0], - array_map(function (ReflectionClass $reflectionTrait): int { - return $this->getTraitLastModificationTime($reflectionTrait); - }, $reflectionTrait->getTraits()) - )); - - assert($lastModificationTime !== false); - - return $this->loadedFilemtimes[$fileName] = $lastModificationTime; - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php deleted file mode 100644 index 0663ffda..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php +++ /dev/null @@ -1,80 +0,0 @@ - An array of Annotations. - */ - public function getClassAnnotations(ReflectionClass $class); - - /** - * Gets a class annotation. - * - * @param ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * @param class-string $annotationName The name of the annotation. - * - * @return T|null The Annotation or NULL, if the requested annotation does not exist. - * - * @template T - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName); - - /** - * Gets the annotations applied to a method. - * - * @param ReflectionMethod $method The ReflectionMethod of the method from which - * the annotations should be read. - * - * @return array An array of Annotations. - */ - public function getMethodAnnotations(ReflectionMethod $method); - - /** - * Gets a method annotation. - * - * @param ReflectionMethod $method The ReflectionMethod to read the annotations from. - * @param class-string $annotationName The name of the annotation. - * - * @return T|null The Annotation or NULL, if the requested annotation does not exist. - * - * @template T - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName); - - /** - * Gets the annotations applied to a property. - * - * @param ReflectionProperty $property The ReflectionProperty of the property - * from which the annotations should be read. - * - * @return array An array of Annotations. - */ - public function getPropertyAnnotations(ReflectionProperty $property); - - /** - * Gets a property annotation. - * - * @param ReflectionProperty $property The ReflectionProperty to read the annotations from. - * @param class-string $annotationName The name of the annotation. - * - * @return T|null The Annotation or NULL, if the requested annotation does not exist. - * - * @template T - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName); -} diff --git a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php b/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php deleted file mode 100644 index 0534fd17..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php +++ /dev/null @@ -1,205 +0,0 @@ - - */ - private $tokens; - - /** - * The number of tokens. - * - * @var int - */ - private $numTokens; - - /** - * The current array pointer. - * - * @var int - */ - private $pointer = 0; - - public function __construct(string $contents) - { - $this->tokens = token_get_all($contents); - - // The PHP parser sets internal compiler globals for certain things. Annoyingly, the last docblock comment it - // saw gets stored in doc_comment. When it comes to compile the next thing to be include()d this stored - // doc_comment becomes owned by the first thing the compiler sees in the file that it considers might have a - // docblock. If the first thing in the file is a class without a doc block this would cause calls to - // getDocBlock() on said class to return our long lost doc_comment. Argh. - // To workaround, cause the parser to parse an empty docblock. Sure getDocBlock() will return this, but at least - // it's harmless to us. - token_get_all("numTokens = count($this->tokens); - } - - /** - * Gets the next non whitespace and non comment token. - * - * @param bool $docCommentIsComment If TRUE then a doc comment is considered a comment and skipped. - * If FALSE then only whitespace and normal comments are skipped. - * - * @return mixed[]|string|null The token if exists, null otherwise. - */ - public function next(bool $docCommentIsComment = true) - { - for ($i = $this->pointer; $i < $this->numTokens; $i++) { - $this->pointer++; - if ( - $this->tokens[$i][0] === T_WHITESPACE || - $this->tokens[$i][0] === T_COMMENT || - ($docCommentIsComment && $this->tokens[$i][0] === T_DOC_COMMENT) - ) { - continue; - } - - return $this->tokens[$i]; - } - - return null; - } - - /** - * Parses a single use statement. - * - * @return array A list with all found class names for a use statement. - */ - public function parseUseStatement() - { - $groupRoot = ''; - $class = ''; - $alias = ''; - $statements = []; - $explicitAlias = false; - while (($token = $this->next())) { - if (! $explicitAlias && $token[0] === T_STRING) { - $class .= $token[1]; - $alias = $token[1]; - } elseif ($explicitAlias && $token[0] === T_STRING) { - $alias = $token[1]; - } elseif ( - PHP_VERSION_ID >= 80000 && - ($token[0] === T_NAME_QUALIFIED || $token[0] === T_NAME_FULLY_QUALIFIED) - ) { - $class .= $token[1]; - - $classSplit = explode('\\', $token[1]); - $alias = $classSplit[count($classSplit) - 1]; - } elseif ($token[0] === T_NS_SEPARATOR) { - $class .= '\\'; - $alias = ''; - } elseif ($token[0] === T_AS) { - $explicitAlias = true; - $alias = ''; - } elseif ($token === ',') { - $statements[strtolower($alias)] = $groupRoot . $class; - $class = ''; - $alias = ''; - $explicitAlias = false; - } elseif ($token === ';') { - $statements[strtolower($alias)] = $groupRoot . $class; - break; - } elseif ($token === '{') { - $groupRoot = $class; - $class = ''; - } elseif ($token === '}') { - continue; - } else { - break; - } - } - - return $statements; - } - - /** - * Gets all use statements. - * - * @param string $namespaceName The namespace name of the reflected class. - * - * @return array A list with all found use statements. - */ - public function parseUseStatements(string $namespaceName) - { - $statements = []; - while (($token = $this->next())) { - if ($token[0] === T_USE) { - $statements = array_merge($statements, $this->parseUseStatement()); - continue; - } - - if ($token[0] !== T_NAMESPACE || $this->parseNamespace() !== $namespaceName) { - continue; - } - - // Get fresh array for new namespace. This is to prevent the parser to collect the use statements - // for a previous namespace with the same name. This is the case if a namespace is defined twice - // or if a namespace with the same name is commented out. - $statements = []; - } - - return $statements; - } - - /** - * Gets the namespace. - * - * @return string The found namespace. - */ - public function parseNamespace() - { - $name = ''; - while ( - ($token = $this->next()) && ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR || ( - PHP_VERSION_ID >= 80000 && - ($token[0] === T_NAME_QUALIFIED || $token[0] === T_NAME_FULLY_QUALIFIED) - )) - ) { - $name .= $token[1]; - } - - return $name; - } - - /** - * Gets the class name. - * - * @return string The found class name. - */ - public function parseClass() - { - // Namespaces and class names are tokenized the same: T_STRINGs - // separated by T_NS_SEPARATOR so we can use one function to provide - // both. - return $this->parseNamespace(); - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/lexer/README.md b/tools/php-cs-fixer/vendor/doctrine/lexer/README.md deleted file mode 100644 index 784f2a27..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/lexer/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Doctrine Lexer - -[![Build Status](https://github.com/doctrine/lexer/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/lexer/actions) - -Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers. - -This lexer is used in Doctrine Annotations and in Doctrine ORM (DQL). - -https://www.doctrine-project.org/projects/lexer.html diff --git a/tools/php-cs-fixer/vendor/doctrine/lexer/UPGRADE.md b/tools/php-cs-fixer/vendor/doctrine/lexer/UPGRADE.md deleted file mode 100644 index 1933fcb2..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/lexer/UPGRADE.md +++ /dev/null @@ -1,22 +0,0 @@ -Note about upgrading: Doctrine uses static and runtime mechanisms to raise -awareness about deprecated code. - -- Use of `@deprecated` docblock that is detected by IDEs (like PHPStorm) or - Static Analysis tools (like Psalm, phpstan) -- Use of our low-overhead runtime deprecation API, details: - https://github.com/doctrine/deprecations/ - -# Upgrade to 3.0.0 - -`Doctrine\Common\Lexer\Token` no longer implements `ArrayAccess`. -Parameter type declarations have been added to -`Doctrine\Common\Lexer\AbstractLexer` and `Doctrine\Common\Lexer\Token`. -You should add both parameter type declarations and return type declarations to -your lexers, based on the `@return` phpdoc. - -# Upgrade to 2.0.0 - -`AbstractLexer::glimpse()` and `AbstractLexer::peek()` now return -instances of `Doctrine\Common\Lexer\Token`, which is an array-like class -Using it as an array is deprecated in favor of using properties of that class. -Using `count()` on it is deprecated with no replacement. diff --git a/tools/php-cs-fixer/vendor/doctrine/lexer/composer.json b/tools/php-cs-fixer/vendor/doctrine/lexer/composer.json deleted file mode 100644 index 8a61afe8..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/lexer/composer.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "doctrine/lexer", - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "license": "MIT", - "type": "library", - "keywords": [ - "php", - "parser", - "lexer", - "annotations", - "docblock" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.0" - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Doctrine\\Tests\\Common\\Lexer\\": "tests" - } - }, - "config": { - "allow-plugins": { - "composer/package-versions-deprecated": true, - "dealerdirect/phpcodesniffer-composer-installer": true - }, - "sort-packages": true - } -} diff --git a/tools/php-cs-fixer/vendor/doctrine/lexer/src/AbstractLexer.php b/tools/php-cs-fixer/vendor/doctrine/lexer/src/AbstractLexer.php deleted file mode 100644 index 7c31935d..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/lexer/src/AbstractLexer.php +++ /dev/null @@ -1,330 +0,0 @@ -> - */ - private array $tokens = []; - - /** - * Current lexer position in input string. - */ - private int $position = 0; - - /** - * Current peek of current lexer position. - */ - private int $peek = 0; - - /** - * The next token in the input. - * - * @var mixed[]|null - * @psalm-var Token|null - */ - public Token|null $lookahead; - - /** - * The last matched/seen token. - * - * @var mixed[]|null - * @psalm-var Token|null - */ - public Token|null $token; - - /** - * Composed regex for input parsing. - */ - private string|null $regex = null; - - /** - * Sets the input data to be tokenized. - * - * The Lexer is immediately reset and the new input tokenized. - * Any unprocessed tokens from any previous input are lost. - * - * @param string $input The input to be tokenized. - * - * @return void - */ - public function setInput(string $input) - { - $this->input = $input; - $this->tokens = []; - - $this->reset(); - $this->scan($input); - } - - /** - * Resets the lexer. - * - * @return void - */ - public function reset() - { - $this->lookahead = null; - $this->token = null; - $this->peek = 0; - $this->position = 0; - } - - /** - * Resets the peek pointer to 0. - * - * @return void - */ - public function resetPeek() - { - $this->peek = 0; - } - - /** - * Resets the lexer position on the input to the given position. - * - * @param int $position Position to place the lexical scanner. - * - * @return void - */ - public function resetPosition(int $position = 0) - { - $this->position = $position; - } - - /** - * Retrieve the original lexer's input until a given position. - * - * @return string - */ - public function getInputUntilPosition(int $position) - { - return substr($this->input, 0, $position); - } - - /** - * Checks whether a given token matches the current lookahead. - * - * @param T $type - * - * @return bool - * - * @psalm-assert-if-true !=null $this->lookahead - */ - public function isNextToken(int|string|UnitEnum $type) - { - return $this->lookahead !== null && $this->lookahead->isA($type); - } - - /** - * Checks whether any of the given tokens matches the current lookahead. - * - * @param list $types - * - * @return bool - * - * @psalm-assert-if-true !=null $this->lookahead - */ - public function isNextTokenAny(array $types) - { - return $this->lookahead !== null && $this->lookahead->isA(...$types); - } - - /** - * Moves to the next token in the input string. - * - * @return bool - * - * @psalm-assert-if-true !null $this->lookahead - */ - public function moveNext() - { - $this->peek = 0; - $this->token = $this->lookahead; - $this->lookahead = isset($this->tokens[$this->position]) - ? $this->tokens[$this->position++] : null; - - return $this->lookahead !== null; - } - - /** - * Tells the lexer to skip input tokens until it sees a token with the given value. - * - * @param T $type The token type to skip until. - * - * @return void - */ - public function skipUntil(int|string|UnitEnum $type) - { - while ($this->lookahead !== null && ! $this->lookahead->isA($type)) { - $this->moveNext(); - } - } - - /** - * Checks if given value is identical to the given token. - * - * @return bool - */ - public function isA(string $value, int|string|UnitEnum $token) - { - return $this->getType($value) === $token; - } - - /** - * Moves the lookahead token forward. - * - * @return mixed[]|null The next token or NULL if there are no more tokens ahead. - * @psalm-return Token|null - */ - public function peek() - { - if (isset($this->tokens[$this->position + $this->peek])) { - return $this->tokens[$this->position + $this->peek++]; - } - - return null; - } - - /** - * Peeks at the next token, returns it and immediately resets the peek. - * - * @return mixed[]|null The next token or NULL if there are no more tokens ahead. - * @psalm-return Token|null - */ - public function glimpse() - { - $peek = $this->peek(); - $this->peek = 0; - - return $peek; - } - - /** - * Scans the input string for tokens. - * - * @param string $input A query string. - * - * @return void - */ - protected function scan(string $input) - { - if (! isset($this->regex)) { - $this->regex = sprintf( - '/(%s)|%s/%s', - implode(')|(', $this->getCatchablePatterns()), - implode('|', $this->getNonCatchablePatterns()), - $this->getModifiers(), - ); - } - - $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE; - $matches = preg_split($this->regex, $input, -1, $flags); - - if ($matches === false) { - // Work around https://bugs.php.net/78122 - $matches = [[$input, 0]]; - } - - foreach ($matches as $match) { - // Must remain before 'value' assignment since it can change content - $firstMatch = $match[0]; - $type = $this->getType($firstMatch); - - $this->tokens[] = new Token( - $firstMatch, - $type, - $match[1], - ); - } - } - - /** - * Gets the literal for a given token. - * - * @param T $token - * - * @return int|string - */ - public function getLiteral(int|string|UnitEnum $token) - { - if ($token instanceof UnitEnum) { - return $token::class . '::' . $token->name; - } - - $className = static::class; - - $reflClass = new ReflectionClass($className); - $constants = $reflClass->getConstants(); - - foreach ($constants as $name => $value) { - if ($value === $token) { - return $className . '::' . $name; - } - } - - return $token; - } - - /** - * Regex modifiers - * - * @return string - */ - protected function getModifiers() - { - return 'iu'; - } - - /** - * Lexical catchable patterns. - * - * @return string[] - */ - abstract protected function getCatchablePatterns(); - - /** - * Lexical non-catchable patterns. - * - * @return string[] - */ - abstract protected function getNonCatchablePatterns(); - - /** - * Retrieve token type. Also processes the token value if necessary. - * - * @return T|null - * - * @param-out V $value - */ - abstract protected function getType(string &$value); -} diff --git a/tools/php-cs-fixer/vendor/doctrine/lexer/src/Token.php b/tools/php-cs-fixer/vendor/doctrine/lexer/src/Token.php deleted file mode 100644 index b6df6946..00000000 --- a/tools/php-cs-fixer/vendor/doctrine/lexer/src/Token.php +++ /dev/null @@ -1,56 +0,0 @@ -value = $value; - $this->type = $type; - $this->position = $position; - } - - /** @param T ...$types */ - public function isA(...$types): bool - { - return in_array($this->type, $types, true); - } -} diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/.gitattributes b/tools/php-cs-fixer/vendor/evenement/evenement/.gitattributes new file mode 100644 index 00000000..8e493b8c --- /dev/null +++ b/tools/php-cs-fixer/vendor/evenement/evenement/.gitattributes @@ -0,0 +1,7 @@ +/.github export-ignore +/doc export-ignore +/examples export-ignore +/tests export-ignore +/.gitignore export-ignore +/CHANGELOG.md export-ignore +/phpunit.xml.dist export-ignore diff --git a/tools/php-cs-fixer/vendor/psr/cache/LICENSE.txt b/tools/php-cs-fixer/vendor/evenement/evenement/LICENSE similarity index 83% rename from tools/php-cs-fixer/vendor/psr/cache/LICENSE.txt rename to tools/php-cs-fixer/vendor/evenement/evenement/LICENSE index b1c2c97b..d9a37d0a 100644 --- a/tools/php-cs-fixer/vendor/psr/cache/LICENSE.txt +++ b/tools/php-cs-fixer/vendor/evenement/evenement/LICENSE @@ -1,14 +1,14 @@ -Copyright (c) 2015 PHP Framework Interoperability Group +Copyright (c) 2011 Igor Wiedler Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/README.md b/tools/php-cs-fixer/vendor/evenement/evenement/README.md new file mode 100644 index 00000000..455dd22c --- /dev/null +++ b/tools/php-cs-fixer/vendor/evenement/evenement/README.md @@ -0,0 +1,64 @@ +# Événement + +Événement is a very simple event dispatching library for PHP. + +It has the same design goals as [Silex](https://silex.symfony.com/) and +[Pimple](https://github.com/silexphp/Pimple), to empower the user while staying concise +and simple. + +It is very strongly inspired by the [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) API found in +[node.js](http://nodejs.org). + +![Continuous Integration](https://github.com/igorw/evenement/workflows/CI/badge.svg) +[![Latest Stable Version](https://poser.pugx.org/evenement/evenement/v/stable.png)](https://packagist.org/packages/evenement/evenement) +[![Total Downloads](https://poser.pugx.org/evenement/evenement/downloads.png)](https://packagist.org/packages/evenement/evenement/stats) +[![License](https://poser.pugx.org/evenement/evenement/license.png)](https://packagist.org/packages/evenement/evenement) + +## Fetch + +The recommended way to install Événement is [through composer](http://getcomposer.org). By running the following command: + + $ composer require evenement/evenement + +## Usage + +### Creating an Emitter + +```php +on('user.created', function (User $user) use ($logger) { + $logger->log(sprintf("User '%s' was created.", $user->getLogin())); +}); +``` + +### Removing Listeners + +```php +removeListener('user.created', function (User $user) use ($logger) { + $logger->log(sprintf("User '%s' was created.", $user->getLogin())); +}); +``` + +### Emitting Events + +```php +emit('user.created', [$user]); +``` + +Tests +----- + + $ ./vendor/bin/phpunit + +License +------- +MIT, see LICENSE. diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/composer.json b/tools/php-cs-fixer/vendor/evenement/evenement/composer.json new file mode 100644 index 00000000..5444d93e --- /dev/null +++ b/tools/php-cs-fixer/vendor/evenement/evenement/composer.json @@ -0,0 +1,29 @@ +{ + "name": "evenement/evenement", + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": ["event-dispatcher", "event-emitter"], + "license": "MIT", + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Evenement\\Tests\\": "tests/" + }, + "files": ["tests/functions.php"] + } +} diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitter.php b/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitter.php new file mode 100644 index 00000000..db189b97 --- /dev/null +++ b/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitter.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Evenement; + +class EventEmitter implements EventEmitterInterface +{ + use EventEmitterTrait; +} diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterInterface.php b/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterInterface.php new file mode 100644 index 00000000..310631a1 --- /dev/null +++ b/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterInterface.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Evenement; + +interface EventEmitterInterface +{ + public function on($event, callable $listener); + public function once($event, callable $listener); + public function removeListener($event, callable $listener); + public function removeAllListeners($event = null); + public function listeners($event = null); + public function emit($event, array $arguments = []); +} diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterTrait.php b/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterTrait.php new file mode 100644 index 00000000..15034296 --- /dev/null +++ b/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterTrait.php @@ -0,0 +1,154 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Evenement; + +use InvalidArgumentException; + +use function count; +use function array_keys; +use function array_merge; +use function array_search; +use function array_unique; +use function array_values; + +trait EventEmitterTrait +{ + protected $listeners = []; + protected $onceListeners = []; + + public function on($event, callable $listener) + { + if ($event === null) { + throw new InvalidArgumentException('event name must not be null'); + } + + if (!isset($this->listeners[$event])) { + $this->listeners[$event] = []; + } + + $this->listeners[$event][] = $listener; + + return $this; + } + + public function once($event, callable $listener) + { + if ($event === null) { + throw new InvalidArgumentException('event name must not be null'); + } + + if (!isset($this->onceListeners[$event])) { + $this->onceListeners[$event] = []; + } + + $this->onceListeners[$event][] = $listener; + + return $this; + } + + public function removeListener($event, callable $listener) + { + if ($event === null) { + throw new InvalidArgumentException('event name must not be null'); + } + + if (isset($this->listeners[$event])) { + $index = array_search($listener, $this->listeners[$event], true); + if (false !== $index) { + unset($this->listeners[$event][$index]); + if (count($this->listeners[$event]) === 0) { + unset($this->listeners[$event]); + } + } + } + + if (isset($this->onceListeners[$event])) { + $index = array_search($listener, $this->onceListeners[$event], true); + if (false !== $index) { + unset($this->onceListeners[$event][$index]); + if (count($this->onceListeners[$event]) === 0) { + unset($this->onceListeners[$event]); + } + } + } + } + + public function removeAllListeners($event = null) + { + if ($event !== null) { + unset($this->listeners[$event]); + } else { + $this->listeners = []; + } + + if ($event !== null) { + unset($this->onceListeners[$event]); + } else { + $this->onceListeners = []; + } + } + + public function listeners($event = null): array + { + if ($event === null) { + $events = []; + $eventNames = array_unique( + array_merge( + array_keys($this->listeners), + array_keys($this->onceListeners) + ) + ); + foreach ($eventNames as $eventName) { + $events[$eventName] = array_merge( + isset($this->listeners[$eventName]) ? $this->listeners[$eventName] : [], + isset($this->onceListeners[$eventName]) ? $this->onceListeners[$eventName] : [] + ); + } + return $events; + } + + return array_merge( + isset($this->listeners[$event]) ? $this->listeners[$event] : [], + isset($this->onceListeners[$event]) ? $this->onceListeners[$event] : [] + ); + } + + public function emit($event, array $arguments = []) + { + if ($event === null) { + throw new InvalidArgumentException('event name must not be null'); + } + + $listeners = []; + if (isset($this->listeners[$event])) { + $listeners = array_values($this->listeners[$event]); + } + + $onceListeners = []; + if (isset($this->onceListeners[$event])) { + $onceListeners = array_values($this->onceListeners[$event]); + } + + if(empty($listeners) === false) { + foreach ($listeners as $listener) { + $listener(...$arguments); + } + } + + if(empty($onceListeners) === false) { + unset($this->onceListeners[$event]); + foreach ($onceListeners as $listener) { + $listener(...$arguments); + } + } + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/.envrc b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/.envrc new file mode 100644 index 00000000..a7c02efb --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/.envrc @@ -0,0 +1,5 @@ +use nix --packages \ + gnumake \ + yamllint + +source_env_if_exists .envrc.local diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/LICENSE.md b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/LICENSE.md new file mode 100644 index 00000000..02442130 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/LICENSE.md @@ -0,0 +1,16 @@ +# The MIT License (MIT) + +Copyright (c) 2022 Théo FIDRY + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the _Software_), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED **AS IS**, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/README.md b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/README.md new file mode 100644 index 00000000..6b554d2e --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/README.md @@ -0,0 +1,138 @@ +# CPU Core Counter + +This package is a tiny utility to get the number of CPU cores. + +```sh +composer require fidry/cpu-core-counter +``` + + +## Usage + +```php +use Fidry\CpuCoreCounter\CpuCoreCounter; +use Fidry\CpuCoreCounter\NumberOfCpuCoreNotFound; +use Fidry\CpuCoreCounter\Finder\DummyCpuCoreFinder; + +$counter = new CpuCoreCounter(); + +// For knowing the number of cores you can use for launching parallel processes: +$counter->getAvailableForParallelisation()->availableCpus; + +// Get the number of CPU cores (by default it will use the logical cores count): +try { + $counter->getCount(); // e.g. 8 +} catch (NumberOfCpuCoreNotFound) { + return 1; // Fallback value +} + +// An alternative form where we not want to catch the exception: + +$counter = new CpuCoreCounter([ + ...CpuCoreCounter::getDefaultFinders(), + new DummyCpuCoreFinder(1), // Fallback value +]); + +// A type-safe alternative form: +$counter->getCountWithFallback(1); + +// Note that the result is memoized. +$counter->getCount(); // e.g. 8 + +``` + + +## Advanced usage + +### Changing the finders + +When creating `CpuCoreCounter`, you may want to change the order of the finders +used or disable a specific finder. You can easily do so by passing the finders +you want + +```php +// Remove WindowsWmicFinder +$finders = array_filter( + CpuCoreCounter::getDefaultFinders(), + static fn (CpuCoreFinder $finder) => !($finder instanceof WindowsWmicFinder) +); + +$cores = (new CpuCoreCounter($finders))->getCount(); +``` + +```php +// Use CPUInfo first & don't use Nproc +$finders = [ + new CpuInfoFinder(), + new WindowsWmicFinder(), + new HwLogicalFinder(), +]; + +$cores = (new CpuCoreCounter($finders))->getCount(); +``` + +### Choosing only logical or physical finders + +`FinderRegistry` provides two helpful entries: + +- `::getDefaultLogicalFinders()`: gives an ordered list of finders that will + look for the _logical_ CPU cores count. +- `::getDefaultPhysicalFinders()`: gives an ordered list of finders that will + look for the _physical_ CPU cores count. + +By default, when using `CpuCoreCounter`, it will use the logical finders since +it is more likely what you are looking for and is what is used by PHP source to +build the PHP binary. + + +### Checks what finders find what on your system + +You have three scrips available that provides insight about what the finders +can find: + +```shell +# Checks what each given finder will find on your system with details about the +# information it had. +make diagnose # From this repository +./vendor/fidry/cpu-core-counter/bin/diagnose.php # From the library +``` + +And: +```shell +# Execute all finders and display the result they found. +make execute # From this repository +./vendor/fidry/cpu-core-counter/bin/execute.php # From the library +``` + + +### Debug the results found + +You have 3 methods available to help you find out what happened: + +1. If you are using the default configuration of finder registries, you can check + the previous section which will provide plenty of information. +2. If what you are interested in is how many CPU cores were found, you can use + the `CpuCoreCounter::trace()` method. +3. If what you are interested in is how the calculation of CPU cores available + for parallelisation was done, you can inspect the values of `ParallelisationResult` + returned by `CpuCoreCounter::getAvailableForParallelisation()`. + + +## Backward Compatibility Promise (BCP) + +The policy is for the major part following the same as [Symfony's one][symfony-bc-policy]. +Note that the code marked as `@private` or `@internal` are excluded from the BCP. + +The following elements are also excluded: + +- The `diagnose` and `execute` commands: those are for debugging/inspection purposes only +- `FinderRegistry::get*Finders()`: new finders may be added or the order of finders changed at any time + + +## License + +This package is licensed using the MIT License. + +Please have a look at [`LICENSE.md`](LICENSE.md). + +[symfony-bc-policy]: https://symfony.com/doc/current/contributing/code/bc.html diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/diagnose.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/diagnose.php new file mode 100755 index 00000000..7dd894a1 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/diagnose.php @@ -0,0 +1,27 @@ +#!/usr/bin/env php + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +use Fidry\CpuCoreCounter\Diagnoser; +use Fidry\CpuCoreCounter\Finder\FinderRegistry; + +require_once __DIR__.'/../vendor/autoload.php'; + +echo 'Running diagnosis...'.PHP_EOL.PHP_EOL; +echo Diagnoser::diagnose(FinderRegistry::getAllVariants()).PHP_EOL; + +echo 'Logical CPU cores finders...'.PHP_EOL.PHP_EOL; +echo Diagnoser::diagnose(FinderRegistry::getDefaultLogicalFinders()).PHP_EOL; + +echo 'Physical CPU cores finders...'.PHP_EOL.PHP_EOL; +echo Diagnoser::diagnose(FinderRegistry::getDefaultPhysicalFinders()).PHP_EOL; diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/execute.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/execute.php new file mode 100755 index 00000000..edadebb1 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/execute.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +use Fidry\CpuCoreCounter\Diagnoser; +use Fidry\CpuCoreCounter\Finder\FinderRegistry; + +require_once __DIR__.'/../vendor/autoload.php'; + +echo 'Executing finders...'.PHP_EOL.PHP_EOL; +echo Diagnoser::execute(FinderRegistry::getAllVariants()).PHP_EOL; diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/trace.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/trace.php new file mode 100755 index 00000000..adb52e24 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/trace.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +use Fidry\CpuCoreCounter\CpuCoreCounter; +use Fidry\CpuCoreCounter\Finder\FinderRegistry; + +require_once __DIR__.'/../vendor/autoload.php'; + +$separator = str_repeat('–', 80); + +echo 'With all finders...'.PHP_EOL.PHP_EOL; +echo (new CpuCoreCounter(FinderRegistry::getAllVariants()))->trace().PHP_EOL; +echo $separator.PHP_EOL.PHP_EOL; + +echo 'Logical CPU cores finders...'.PHP_EOL.PHP_EOL; +echo (new CpuCoreCounter(FinderRegistry::getDefaultLogicalFinders()))->trace().PHP_EOL; +echo $separator.PHP_EOL.PHP_EOL; + +echo 'Physical CPU cores finders...'.PHP_EOL.PHP_EOL; +echo (new CpuCoreCounter(FinderRegistry::getDefaultPhysicalFinders()))->trace().PHP_EOL; +echo $separator.PHP_EOL.PHP_EOL; diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/composer.json b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/composer.json new file mode 100644 index 00000000..3f324d19 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/composer.json @@ -0,0 +1,48 @@ +{ + "name": "fidry/cpu-core-counter", + "description": "Tiny utility to get the number of CPU cores.", + "license": "MIT", + "type": "library", + "keywords": [ + "cpu", + "core" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Fidry\\CpuCoreCounter\\Test\\": "tests/" + } + }, + "config": { + "allow-plugins": { + "ergebnis/composer-normalize": true, + "infection/extension-installer": true, + "phpstan/extension-installer": true + }, + "sort-packages": true + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php new file mode 100644 index 00000000..8c8b55bd --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php @@ -0,0 +1,268 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter; + +use Fidry\CpuCoreCounter\Finder\CpuCoreFinder; +use Fidry\CpuCoreCounter\Finder\EnvVariableFinder; +use Fidry\CpuCoreCounter\Finder\FinderRegistry; +use InvalidArgumentException; +use function implode; +use function max; +use function sprintf; +use function sys_getloadavg; +use const PHP_EOL; + +final class CpuCoreCounter +{ + /** + * @var list + */ + private $finders; + + /** + * @var positive-int|null + */ + private $count; + + /** + * @param list|null $finders + */ + public function __construct(?array $finders = null) + { + $this->finders = $finders ?? FinderRegistry::getDefaultLogicalFinders(); + } + + /** + * @param positive-int|0 $reservedCpus Number of CPUs to reserve. This is useful when you want + * to reserve some CPUs for other processes. If the main + * process is going to be busy still, you may want to set + * this value to 1. + * @param non-zero-int|null $countLimit The maximum number of CPUs to return. If not provided, it + * may look for a limit in the environment variables, e.g. + * KUBERNETES_CPU_LIMIT. If negative, the limit will be + * the total number of cores found minus the absolute value. + * For instance if the system has 10 cores and countLimit=-2, + * then the effective limit considered will be 8. + * @param float|null $loadLimit Element of [0., 1.]. Percentage representing the + * amount of cores that should be used among the available + * resources. For instance, if set to 0.7, it will use 70% + * of the available cores, i.e. if 1 core is reserved, 11 + * cores are available and 5 are busy, it will use 70% + * of (11-1-5)=5 cores, so 3 cores. Set this parameter to null + * to skip this check. Beware that 1 does not mean "no limit", + * but 100% of the _available_ resources, i.e. with the + * previous example, it will return 5 cores. How busy is + * the system is determined by the system load average + * (see $systemLoadAverage). + * @param float|null $systemLoadAverage The system load average. If passed, it will use + * this information to limit the available cores based + * on the _available_ resources. For instance, if there + * is 10 cores but 3 are busy, then only 7 cores will + * be considered for further calculation. If set to + * `null`, it will use `sys_getloadavg()` to check the + * load of the system in the past minute. You can + * otherwise pass an arbitrary value. Should be a + * positive float. + * + * @see https://php.net/manual/en/function.sys-getloadavg.php + */ + public function getAvailableForParallelisation( + int $reservedCpus = 0, + ?int $countLimit = null, + ?float $loadLimit = null, + ?float $systemLoadAverage = 0. + ): ParallelisationResult { + self::checkCountLimit($countLimit); + self::checkLoadLimit($loadLimit); + self::checkSystemLoadAverage($systemLoadAverage); + + $totalCoreCount = $this->getCountWithFallback(1); + $availableCores = max(1, $totalCoreCount - $reservedCpus); + + // Adjust available CPUs based on current load + if (null !== $loadLimit) { + $correctedSystemLoadAverage = null === $systemLoadAverage + ? sys_getloadavg()[0] ?? 0. + : $systemLoadAverage; + + $availableCores = max( + 1, + $loadLimit * ($availableCores - $correctedSystemLoadAverage) + ); + } + + if (null === $countLimit) { + $correctedCountLimit = self::getKubernetesLimit(); + } else { + $correctedCountLimit = $countLimit > 0 + ? $countLimit + : max(1, $totalCoreCount + $countLimit); + } + + if (null !== $correctedCountLimit && $availableCores > $correctedCountLimit) { + $availableCores = $correctedCountLimit; + } + + return new ParallelisationResult( + $reservedCpus, + $countLimit, + $loadLimit, + $systemLoadAverage, + $correctedCountLimit, + $correctedSystemLoadAverage ?? $systemLoadAverage, + $totalCoreCount, + (int) $availableCores + ); + } + + /** + * @throws NumberOfCpuCoreNotFound + * + * @return positive-int + */ + public function getCount(): int + { + // Memoize result + if (null === $this->count) { + $this->count = $this->findCount(); + } + + return $this->count; + } + + /** + * @param positive-int $fallback + * + * @return positive-int + */ + public function getCountWithFallback(int $fallback): int + { + try { + return $this->getCount(); + } catch (NumberOfCpuCoreNotFound $exception) { + return $fallback; + } + } + + /** + * This method is mostly for debugging purposes. + */ + public function trace(): string + { + $output = []; + + foreach ($this->finders as $finder) { + $output[] = sprintf( + 'Executing the finder "%s":', + $finder->toString() + ); + $output[] = $finder->diagnose(); + + $cores = $finder->find(); + + if (null !== $cores) { + $output[] = 'Result found: '.$cores; + + break; + } + + $output[] = '–––'; + } + + return implode(PHP_EOL, $output); + } + + /** + * @throws NumberOfCpuCoreNotFound + * + * @return positive-int + */ + private function findCount(): int + { + foreach ($this->finders as $finder) { + $cores = $finder->find(); + + if (null !== $cores) { + return $cores; + } + } + + throw NumberOfCpuCoreNotFound::create(); + } + + /** + * @throws NumberOfCpuCoreNotFound + * + * @return array{CpuCoreFinder, positive-int} + */ + public function getFinderAndCores(): array + { + foreach ($this->finders as $finder) { + $cores = $finder->find(); + + if (null !== $cores) { + return [$finder, $cores]; + } + } + + throw NumberOfCpuCoreNotFound::create(); + } + + /** + * @return positive-int|null + */ + public static function getKubernetesLimit(): ?int + { + $finder = new EnvVariableFinder('KUBERNETES_CPU_LIMIT'); + + return $finder->find(); + } + + private static function checkCountLimit(?int $countLimit): void + { + if (0 === $countLimit) { + throw new InvalidArgumentException( + 'The count limit must be a non zero integer. Got "0".' + ); + } + } + + private static function checkLoadLimit(?float $loadLimit): void + { + if (null === $loadLimit) { + return; + } + + if ($loadLimit < 0. || $loadLimit > 1.) { + throw new InvalidArgumentException( + sprintf( + 'The load limit must be in the range [0., 1.], got "%s".', + $loadLimit + ) + ); + } + } + + private static function checkSystemLoadAverage(?float $systemLoadAverage): void + { + if (null !== $systemLoadAverage && $systemLoadAverage < 0.) { + throw new InvalidArgumentException( + sprintf( + 'The system load average must be a positive float, got "%s".', + $systemLoadAverage + ) + ); + } + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Diagnoser.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Diagnoser.php new file mode 100644 index 00000000..872b55f8 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Diagnoser.php @@ -0,0 +1,101 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter; + +use Fidry\CpuCoreCounter\Finder\CpuCoreFinder; +use function array_map; +use function explode; +use function implode; +use function max; +use function str_repeat; +use const PHP_EOL; + +/** + * Utility to debug. + * + * @private + */ +final class Diagnoser +{ + /** + * Provides an aggregated diagnosis based on each finders diagnosis. + * + * @param list $finders + */ + public static function diagnose(array $finders): string + { + $diagnoses = array_map( + static function (CpuCoreFinder $finder): string { + return self::diagnoseFinder($finder); + }, + $finders + ); + + return implode(PHP_EOL, $diagnoses); + } + + /** + * Executes each finders. + * + * @param list $finders + */ + public static function execute(array $finders): string + { + $diagnoses = array_map( + static function (CpuCoreFinder $finder): string { + $coresCount = $finder->find(); + + return implode( + '', + [ + $finder->toString(), + ': ', + null === $coresCount ? 'NULL' : $coresCount, + ] + ); + }, + $finders + ); + + return implode(PHP_EOL, $diagnoses); + } + + private static function diagnoseFinder(CpuCoreFinder $finder): string + { + $diagnosis = $finder->diagnose(); + + $maxLineLength = max( + array_map( + 'strlen', + explode(PHP_EOL, $diagnosis) + ) + ); + + $separator = str_repeat('-', $maxLineLength); + + return implode( + '', + [ + $finder->toString().':'.PHP_EOL, + $separator.PHP_EOL, + $diagnosis.PHP_EOL, + $separator.PHP_EOL, + ] + ); + } + + private function __construct() + { + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php new file mode 100644 index 00000000..751a311d --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Executor; + +use function fclose; +use function function_exists; +use function is_resource; +use function proc_close; +use function proc_open; +use function stream_get_contents; + +final class ProcOpenExecutor implements ProcessExecutor +{ + public function execute(string $command): ?array + { + if (!function_exists('proc_open')) { + return null; + } + + $pipes = []; + + $process = @proc_open( + $command, + [ + ['pipe', 'rb'], + ['pipe', 'wb'], // stdout + ['pipe', 'wb'], // stderr + ], + $pipes + ); + + if (!is_resource($process)) { + return null; + } + + fclose($pipes[0]); + + $stdout = (string) stream_get_contents($pipes[1]); + $stderr = (string) stream_get_contents($pipes[2]); + + proc_close($process); + + return [$stdout, $stderr]; + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php new file mode 100644 index 00000000..287c01e1 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Executor; + +interface ProcessExecutor +{ + /** + * @return array{string, string}|null STDOUT & STDERR tuple + */ + public function execute(string $command): ?array; +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php new file mode 100644 index 00000000..ee5c7d3d --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function preg_match; + +/** + * Find the number of logical CPU cores for Windows leveraging the Get-CimInstance + * cmdlet, which is a newer version that is recommended over Get-WmiObject. + */ +final class CmiCmdletLogicalFinder extends ProcOpenBasedFinder +{ + private const CPU_CORE_COUNT_REGEX = '/NumberOfLogicalProcessors[\s\n]-+[\s\n]+(?\d+)/'; + + protected function getCommand(): string + { + return 'Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property NumberOfLogicalProcessors'; + } + + public function toString(): string + { + return 'CmiCmdletLogicalFinder'; + } + + protected function countCpuCores(string $process): ?int + { + if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) { + return parent::countCpuCores($process); + } + + $count = $matches['count']; + + return parent::countCpuCores($count); + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php new file mode 100644 index 00000000..85301236 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function preg_match; + +/** + * Find the number of physical CPU cores for Windows. + * + * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L912-L916 + */ +final class CmiCmdletPhysicalFinder extends ProcOpenBasedFinder +{ + private const CPU_CORE_COUNT_REGEX = '/NumberOfCores[\s\n]-+[\s\n]+(?\d+)/'; + + protected function getCommand(): string + { + return 'Get-CimInstance -ClassName Win32_Processor | Select-Object -Property NumberOfCores'; + } + + public function toString(): string + { + return 'CmiCmdletPhysicalFinder'; + } + + protected function countCpuCores(string $process): ?int + { + if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) { + return parent::countCpuCores($process); + } + + $count = $matches['count']; + + return parent::countCpuCores($count); + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php new file mode 100644 index 00000000..edb40e86 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +interface CpuCoreFinder +{ + /** + * Provides an explanation which may offer some insight as to what the finder + * will be able to find. + * + * This is practical to have an idea of what each finder will find collect + * information for the unit tests, since integration tests are quite complicated + * as dependent on complex infrastructures. + */ + public function diagnose(): string; + + /** + * Find the number of CPU cores. If it could not find it, returns null. The + * means used to find the cores are at the implementation discretion. + * + * @return positive-int|null + */ + public function find(): ?int; + + public function toString(): string; +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php new file mode 100644 index 00000000..8013877d --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function file_get_contents; +use function is_file; +use function sprintf; +use function substr_count; +use const PHP_EOL; + +/** + * Find the number of CPU cores looking up at the cpuinfo file which is available + * on Linux systems and Windows systems with a Linux sub-system. + * + * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L903-L909 + * @see https://unix.stackexchange.com/questions/146051/number-of-processors-in-proc-cpuinfo + */ +final class CpuInfoFinder implements CpuCoreFinder +{ + private const CPU_INFO_PATH = '/proc/cpuinfo'; + + public function diagnose(): string + { + if (!is_file(self::CPU_INFO_PATH)) { + return sprintf( + 'The file "%s" could not be found.', + self::CPU_INFO_PATH + ); + } + + $cpuInfo = file_get_contents(self::CPU_INFO_PATH); + + if (false === $cpuInfo) { + return sprintf( + 'Could not get the content of the file "%s".', + self::CPU_INFO_PATH + ); + } + + return sprintf( + 'Found the file "%s" with the content:%s%s%sWill return "%s".', + self::CPU_INFO_PATH, + PHP_EOL, + $cpuInfo, + PHP_EOL, + self::countCpuCores($cpuInfo) + ); + } + + /** + * @return positive-int|null + */ + public function find(): ?int + { + $cpuInfo = self::getCpuInfo(); + + return null === $cpuInfo ? null : self::countCpuCores($cpuInfo); + } + + public function toString(): string + { + return 'CpuInfoFinder'; + } + + private static function getCpuInfo(): ?string + { + if (!@is_file(self::CPU_INFO_PATH)) { + return null; + } + + $cpuInfo = @file_get_contents(self::CPU_INFO_PATH); + + return false === $cpuInfo + ? null + : $cpuInfo; + } + + /** + * @internal + * + * @return positive-int|null + */ + public static function countCpuCores(string $cpuInfo): ?int + { + $processorCount = substr_count($cpuInfo, 'processor'); + + return $processorCount > 0 ? $processorCount : null; + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php new file mode 100644 index 00000000..1efa4da6 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function sprintf; + +/** + * This finder returns whatever value you gave to it. This is useful for testing + * or as a fallback to avoid to catch the NumberOfCpuCoreNotFound exception. + */ +final class DummyCpuCoreFinder implements CpuCoreFinder +{ + /** + * @var positive-int + */ + private $count; + + public function diagnose(): string + { + return sprintf( + 'Will return "%d".', + $this->count + ); + } + + /** + * @param positive-int $count + */ + public function __construct(int $count) + { + $this->count = $count; + } + + public function find(): ?int + { + return $this->count; + } + + public function toString(): string + { + return sprintf( + 'DummyCpuCoreFinder(value=%d)', + $this->count + ); + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php new file mode 100644 index 00000000..fa23278f --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function getenv; +use function preg_match; +use function sprintf; +use function var_export; + +final class EnvVariableFinder implements CpuCoreFinder +{ + /** @var string */ + private $environmentVariableName; + + public function __construct(string $environmentVariableName) + { + $this->environmentVariableName = $environmentVariableName; + } + + public function diagnose(): string + { + $value = getenv($this->environmentVariableName); + + return sprintf( + 'parse(getenv(%s)=%s)=%s', + $this->environmentVariableName, + var_export($value, true), + self::isPositiveInteger($value) ? $value : 'null' + ); + } + + public function find(): ?int + { + $value = getenv($this->environmentVariableName); + + return self::isPositiveInteger($value) + ? (int) $value + : null; + } + + public function toString(): string + { + return sprintf( + 'getenv(%s)', + $this->environmentVariableName + ); + } + + /** + * @param string|false $value + */ + private static function isPositiveInteger($value): bool + { + return false !== $value + && 1 === preg_match('/^\d+$/', $value) + && (int) $value > 0; + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php new file mode 100644 index 00000000..ca9b8602 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php @@ -0,0 +1,91 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +final class FinderRegistry +{ + /** + * @return list List of all the known finders with all their variants. + */ + public static function getAllVariants(): array + { + return [ + new CpuInfoFinder(), + new DummyCpuCoreFinder(1), + new HwLogicalFinder(), + new HwPhysicalFinder(), + new LscpuLogicalFinder(), + new LscpuPhysicalFinder(), + new _NProcessorFinder(), + new NProcessorFinder(), + new NProcFinder(true), + new NProcFinder(false), + new NullCpuCoreFinder(), + SkipOnOSFamilyFinder::forWindows( + new DummyCpuCoreFinder(1) + ), + OnlyOnOSFamilyFinder::forWindows( + new DummyCpuCoreFinder(1) + ), + new OnlyInPowerShellFinder(new CmiCmdletLogicalFinder()), + new OnlyInPowerShellFinder(new CmiCmdletPhysicalFinder()), + new WindowsRegistryLogicalFinder(), + new WmicPhysicalFinder(), + new WmicLogicalFinder(), + ]; + } + + /** + * @return list + */ + public static function getDefaultLogicalFinders(): array + { + return [ + OnlyOnOSFamilyFinder::forWindows( + new OnlyInPowerShellFinder( + new CmiCmdletLogicalFinder() + ) + ), + OnlyOnOSFamilyFinder::forWindows(new WindowsRegistryLogicalFinder()), + OnlyOnOSFamilyFinder::forWindows(new WmicLogicalFinder()), + new NProcFinder(), + new HwLogicalFinder(), + new _NProcessorFinder(), + new NProcessorFinder(), + new LscpuLogicalFinder(), + new CpuInfoFinder(), + ]; + } + + /** + * @return list + */ + public static function getDefaultPhysicalFinders(): array + { + return [ + OnlyOnOSFamilyFinder::forWindows( + new OnlyInPowerShellFinder( + new CmiCmdletPhysicalFinder() + ) + ), + OnlyOnOSFamilyFinder::forWindows(new WmicPhysicalFinder()), + new HwPhysicalFinder(), + new LscpuPhysicalFinder(), + ]; + } + + private function __construct() + { + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php new file mode 100644 index 00000000..d1129038 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +/** + * Find the number of logical CPU cores for Linux, BSD and OSX. + * + * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L903-L909 + * @see https://opensource.apple.com/source/xnu/xnu-792.2.4/libkern/libkern/sysctl.h.auto.html + */ +final class HwLogicalFinder extends ProcOpenBasedFinder +{ + protected function getCommand(): string + { + return 'sysctl -n hw.logicalcpu'; + } + + public function toString(): string + { + return 'HwLogicalFinder'; + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php new file mode 100644 index 00000000..65ca1cfd --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +/** + * Find the number of physical CPU cores for Linux, BSD and OSX. + * + * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L903-L909 + * @see https://opensource.apple.com/source/xnu/xnu-792.2.4/libkern/libkern/sysctl.h.auto.html + */ +final class HwPhysicalFinder extends ProcOpenBasedFinder +{ + protected function getCommand(): string + { + return 'sysctl -n hw.physicalcpu'; + } + + public function toString(): string + { + return 'HwPhysicalFinder'; + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuLogicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuLogicalFinder.php new file mode 100644 index 00000000..bce09ebf --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuLogicalFinder.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function count; +use function explode; +use function is_array; +use function preg_grep; +use const PHP_EOL; + +/** + * The number of logical cores. + * + * @see https://stackoverflow.com/a/23378780/5846754 + */ +final class LscpuLogicalFinder extends ProcOpenBasedFinder +{ + public function getCommand(): string + { + return 'lscpu -p'; + } + + protected function countCpuCores(string $process): ?int + { + $lines = explode(PHP_EOL, $process); + $actualLines = preg_grep('/^\d+,/', $lines); + + if (!is_array($actualLines)) { + return null; + } + + $count = count($actualLines); + + return 0 === $count ? null : $count; + } + + public function toString(): string + { + return 'LscpuLogicalFinder'; + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php new file mode 100644 index 00000000..58523cee --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function count; +use function explode; +use function is_array; +use function preg_grep; +use function strtok; +use const PHP_EOL; + +/** + * The number of physical processors. + * + * @see https://stackoverflow.com/a/23378780/5846754 + */ +final class LscpuPhysicalFinder extends ProcOpenBasedFinder +{ + public function toString(): string + { + return 'LscpuPhysicalFinder'; + } + + public function getCommand(): string + { + return 'lscpu -p'; + } + + protected function countCpuCores(string $process): ?int + { + $lines = explode(PHP_EOL, $process); + $actualLines = preg_grep('/^\d+/', $lines); + + if (!is_array($actualLines)) { + return null; + } + + $cores = []; + foreach ($actualLines as $line) { + strtok($line, ','); + $core = strtok(','); + + if (false === $core) { + continue; + } + + $cores[$core] = true; + } + unset($cores['-']); + + $count = count($cores); + + return 0 === $count ? null : $count; + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php new file mode 100644 index 00000000..c0f7a6f7 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use Fidry\CpuCoreCounter\Executor\ProcessExecutor; +use function sprintf; + +/** + * The number of (logical) cores. + * + * @see https://github.com/infection/infection/blob/fbd8c44/src/Resource/Processor/CpuCoresCountProvider.php#L69-L82 + * @see https://unix.stackexchange.com/questions/146051/number-of-processors-in-proc-cpuinfo + */ +final class NProcFinder extends ProcOpenBasedFinder +{ + /** + * @var bool + */ + private $all; + + /** + * @param bool $all If disabled will give the number of cores available for the current process + * only. This is disabled by default as it is known to be "buggy" on virtual + * environments as the virtualization tool, e.g. VMWare, might over-commit + * resources by default. + */ + public function __construct( + bool $all = false, + ?ProcessExecutor $executor = null + ) { + parent::__construct($executor); + + $this->all = $all; + } + + public function toString(): string + { + return sprintf( + 'NProcFinder(all=%s)', + $this->all ? 'true' : 'false' + ); + } + + protected function getCommand(): string + { + return 'nproc'.($this->all ? ' --all' : ''); + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php new file mode 100644 index 00000000..9143e31c --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +/** + * Find the number of logical CPU cores for FreeSBD, Solaris and the likes. + * + * @see https://twitter.com/freebsdfrau/status/1052016199452700678?s=20&t=M2pHkRqmmna-UF68lfL2hw + */ +final class NProcessorFinder extends ProcOpenBasedFinder +{ + protected function getCommand(): string + { + return 'getconf NPROCESSORS_ONLN'; + } + + public function toString(): string + { + return 'NProcessorFinder'; + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php new file mode 100644 index 00000000..50af2d4d --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +/** + * This finder returns whatever value you gave to it. This is useful for testing. + */ +final class NullCpuCoreFinder implements CpuCoreFinder +{ + public function diagnose(): string + { + return 'Will return "null".'; + } + + public function find(): ?int + { + return null; + } + + public function toString(): string + { + return 'NullCpuCoreFinder'; + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php new file mode 100644 index 00000000..d36d0305 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function getenv; +use function sprintf; + +final class OnlyInPowerShellFinder implements CpuCoreFinder +{ + /** + * @var CpuCoreFinder + */ + private $decoratedFinder; + + public function __construct(CpuCoreFinder $decoratedFinder) + { + $this->decoratedFinder = $decoratedFinder; + } + + public function diagnose(): string + { + $powerShellModulePath = getenv('PSModulePath'); + + return $this->skip() + ? sprintf( + 'Skipped; no power shell module path detected ("%s").', + $powerShellModulePath + ) + : $this->decoratedFinder->diagnose(); + } + + public function find(): ?int + { + return $this->skip() + ? null + : $this->decoratedFinder->find(); + } + + public function toString(): string + { + return sprintf( + 'OnlyInPowerShellFinder(%s)', + $this->decoratedFinder->toString() + ); + } + + private function skip(): bool + { + return false === getenv('PSModulePath'); + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php new file mode 100644 index 00000000..31478083 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php @@ -0,0 +1,113 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function implode; +use function sprintf; +use const PHP_OS_FAMILY; + +final class OnlyOnOSFamilyFinder implements CpuCoreFinder +{ + /** + * @var list + */ + private $skippedOSFamilies; + + /** + * @var CpuCoreFinder + */ + private $decoratedFinder; + + /** + * @param string|list $skippedOSFamilyOrFamilies + */ + public function __construct( + $skippedOSFamilyOrFamilies, + CpuCoreFinder $decoratedFinder + ) { + $this->skippedOSFamilies = (array) $skippedOSFamilyOrFamilies; + $this->decoratedFinder = $decoratedFinder; + } + + public static function forWindows(CpuCoreFinder $decoratedFinder): self + { + return new self( + 'Windows', + $decoratedFinder + ); + } + + public static function forBSD(CpuCoreFinder $decoratedFinder): self + { + return new self( + 'BSD', + $decoratedFinder + ); + } + + public static function forDarwin(CpuCoreFinder $decoratedFinder): self + { + return new self( + 'Darwin', + $decoratedFinder + ); + } + + public static function forSolaris(CpuCoreFinder $decoratedFinder): self + { + return new self( + 'Solaris', + $decoratedFinder + ); + } + + public static function forLinux(CpuCoreFinder $decoratedFinder): self + { + return new self( + 'Linux', + $decoratedFinder + ); + } + + public function diagnose(): string + { + return $this->skip() + ? sprintf( + 'Skipped platform detected ("%s").', + PHP_OS_FAMILY + ) + : $this->decoratedFinder->diagnose(); + } + + public function find(): ?int + { + return $this->skip() + ? null + : $this->decoratedFinder->find(); + } + + public function toString(): string + { + return sprintf( + 'OnlyOnOSFamilyFinder(only=(%s),%s)', + implode(',', $this->skippedOSFamilies), + $this->decoratedFinder->toString() + ); + } + + private function skip(): bool + { + return !in_array(PHP_OS_FAMILY, $this->skippedOSFamilies, true); + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php new file mode 100644 index 00000000..4d51f898 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use Fidry\CpuCoreCounter\Executor\ProcessExecutor; +use Fidry\CpuCoreCounter\Executor\ProcOpenExecutor; +use function filter_var; +use function function_exists; +use function is_int; +use function sprintf; +use function trim; +use const FILTER_VALIDATE_INT; +use const PHP_EOL; + +abstract class ProcOpenBasedFinder implements CpuCoreFinder +{ + /** + * @var ProcessExecutor + */ + private $executor; + + public function __construct(?ProcessExecutor $executor = null) + { + $this->executor = $executor ?? new ProcOpenExecutor(); + } + + public function diagnose(): string + { + if (!function_exists('proc_open')) { + return 'The function "proc_open" is not available.'; + } + + $command = $this->getCommand(); + $output = $this->executor->execute($command); + + if (null === $output) { + return sprintf( + 'Failed to execute the command "%s".', + $command + ); + } + + [$stdout, $stderr] = $output; + $failed = '' !== trim($stderr); + + return $failed + ? sprintf( + 'Executed the command "%s" which wrote the following output to the STDERR:%s%s%sWill return "null".', + $command, + PHP_EOL, + $stderr, + PHP_EOL + ) + : sprintf( + 'Executed the command "%s" and got the following (STDOUT) output:%s%s%sWill return "%s".', + $command, + PHP_EOL, + $stdout, + PHP_EOL, + $this->countCpuCores($stdout) ?? 'null' + ); + } + + /** + * @return positive-int|null + */ + public function find(): ?int + { + $output = $this->executor->execute($this->getCommand()); + + if (null === $output) { + return null; + } + + [$stdout, $stderr] = $output; + $failed = '' !== trim($stderr); + + return $failed + ? null + : $this->countCpuCores($stdout); + } + + /** + * @internal + * + * @return positive-int|null + */ + protected function countCpuCores(string $process): ?int + { + $cpuCount = filter_var($process, FILTER_VALIDATE_INT); + + return is_int($cpuCount) && $cpuCount > 0 ? $cpuCount : null; + } + + abstract protected function getCommand(): string; +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php new file mode 100644 index 00000000..66a50164 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php @@ -0,0 +1,113 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function implode; +use function in_array; +use function sprintf; + +final class SkipOnOSFamilyFinder implements CpuCoreFinder +{ + /** + * @var list + */ + private $skippedOSFamilies; + + /** + * @var CpuCoreFinder + */ + private $decoratedFinder; + + /** + * @param string|list $skippedOSFamilyOrFamilies + */ + public function __construct( + $skippedOSFamilyOrFamilies, + CpuCoreFinder $decoratedFinder + ) { + $this->skippedOSFamilies = (array) $skippedOSFamilyOrFamilies; + $this->decoratedFinder = $decoratedFinder; + } + + public static function forWindows(CpuCoreFinder $decoratedFinder): self + { + return new self( + 'Windows', + $decoratedFinder + ); + } + + public static function forBSD(CpuCoreFinder $decoratedFinder): self + { + return new self( + 'BSD', + $decoratedFinder + ); + } + + public static function forDarwin(CpuCoreFinder $decoratedFinder): self + { + return new self( + 'Darwin', + $decoratedFinder + ); + } + + public static function forSolaris(CpuCoreFinder $decoratedFinder): self + { + return new self( + 'Solaris', + $decoratedFinder + ); + } + + public static function forLinux(CpuCoreFinder $decoratedFinder): self + { + return new self( + 'Linux', + $decoratedFinder + ); + } + + public function diagnose(): string + { + return $this->skip() + ? sprintf( + 'Skipped platform detected ("%s").', + PHP_OS_FAMILY + ) + : $this->decoratedFinder->diagnose(); + } + + public function find(): ?int + { + return $this->skip() + ? null + : $this->decoratedFinder->find(); + } + + public function toString(): string + { + return sprintf( + 'SkipOnOSFamilyFinder(skip=(%s),%s)', + implode(',', $this->skippedOSFamilies), + $this->decoratedFinder->toString() + ); + } + + private function skip(): bool + { + return in_array(PHP_OS_FAMILY, $this->skippedOSFamilies, true); + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php new file mode 100644 index 00000000..b223652b --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function array_filter; +use function count; +use function explode; +use const PHP_EOL; + +/** + * Find the number of logical CPU cores for Windows. + * + * @see https://knowledge.informatica.com/s/article/151521 + */ +final class WindowsRegistryLogicalFinder extends ProcOpenBasedFinder +{ + protected function getCommand(): string + { + return 'reg query HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor'; + } + + public function toString(): string + { + return 'WindowsRegistryLogicalFinder'; + } + + protected function countCpuCores(string $process): ?int + { + $count = count( + array_filter( + explode(PHP_EOL, $process), + static function (string $line): bool { + return '' !== trim($line); + } + ) + ); + + return $count > 0 ? $count : null; + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php new file mode 100644 index 00000000..db576a64 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function preg_match; + +/** + * Find the number of logical CPU cores for Windows. + * + * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L912-L916 + */ +final class WmicLogicalFinder extends ProcOpenBasedFinder +{ + private const CPU_CORE_COUNT_REGEX = '/NumberOfLogicalProcessors[\s\n]+(?\d+)/'; + + protected function getCommand(): string + { + return 'wmic cpu get NumberOfLogicalProcessors'; + } + + public function toString(): string + { + return 'WmicLogicalFinder'; + } + + protected function countCpuCores(string $process): ?int + { + if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) { + return parent::countCpuCores($process); + } + + $count = $matches['count']; + + return parent::countCpuCores($count); + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php new file mode 100644 index 00000000..140b9fdb --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +use function preg_match; + +/** + * Find the number of physical CPU cores for Windows. + * + * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L912-L916 + */ +final class WmicPhysicalFinder extends ProcOpenBasedFinder +{ + private const CPU_CORE_COUNT_REGEX = '/NumberOfCores[\s\n]+(?\d+)/'; + + protected function getCommand(): string + { + return 'wmic cpu get NumberOfCores'; + } + + public function toString(): string + { + return 'WmicPhysicalFinder'; + } + + protected function countCpuCores(string $process): ?int + { + if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) { + return parent::countCpuCores($process); + } + + $count = $matches['count']; + + return parent::countCpuCores($count); + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php new file mode 100644 index 00000000..23f452e4 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter\Finder; + +/** + * Find the number of logical CPU cores for Linux and the likes. + * + * @see https://twitter.com/freebsdfrau/status/1052016199452700678?s=20&t=M2pHkRqmmna-UF68lfL2hw + */ +final class _NProcessorFinder extends ProcOpenBasedFinder +{ + protected function getCommand(): string + { + return 'getconf _NPROCESSORS_ONLN'; + } + + public function toString(): string + { + return '_NProcessorFinder'; + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php new file mode 100644 index 00000000..e54f8931 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter; + +use RuntimeException; + +final class NumberOfCpuCoreNotFound extends RuntimeException +{ + public static function create(): self + { + return new self( + 'Could not find the number of CPU cores available.' + ); + } +} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/ParallelisationResult.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/ParallelisationResult.php new file mode 100644 index 00000000..1f294349 --- /dev/null +++ b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/ParallelisationResult.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Fidry\CpuCoreCounter; + +/** + * @readonly + */ +final class ParallelisationResult +{ + /** + * @var positive-int|0 + */ + public $passedReservedCpus; + + /** + * @var non-zero-int|null + */ + public $passedCountLimit; + + /** + * @var float|null + */ + public $passedLoadLimit; + + /** + * @var float|null + */ + public $passedSystemLoadAverage; + + /** + * @var non-zero-int|null + */ + public $correctedCountLimit; + + /** + * @var float|null + */ + public $correctedSystemLoadAverage; + + /** + * @var positive-int + */ + public $totalCoresCount; + + /** + * @var positive-int + */ + public $availableCpus; + + /** + * @param positive-int|0 $passedReservedCpus + * @param non-zero-int|null $passedCountLimit + * @param non-zero-int|null $correctedCountLimit + * @param positive-int $totalCoresCount + * @param positive-int $availableCpus + */ + public function __construct( + int $passedReservedCpus, + ?int $passedCountLimit, + ?float $passedLoadLimit, + ?float $passedSystemLoadAverage, + ?int $correctedCountLimit, + ?float $correctedSystemLoadAverage, + int $totalCoresCount, + int $availableCpus + ) { + $this->passedReservedCpus = $passedReservedCpus; + $this->passedCountLimit = $passedCountLimit; + $this->passedLoadLimit = $passedLoadLimit; + $this->passedSystemLoadAverage = $passedSystemLoadAverage; + $this->correctedCountLimit = $correctedCountLimit; + $this->correctedSystemLoadAverage = $correctedSystemLoadAverage; + $this->totalCoresCount = $totalCoresCount; + $this->availableCpus = $availableCpus; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md index 18127c00..934f4d58 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md @@ -3,6 +3,1238 @@ CHANGELOG for PHP CS Fixer This file contains changelogs for stable releases only. +Changelog for v3.68.1 +--------------------- + +* chore: `AutoReview/CiConfigurationTest` - handle failure of reading files (#8375) +* CI: `Docker` - check all `compose` services (#8370) +* deps: bump alpine from 3.18 to 3.21 (#8377) +* deps: bump alpine from 3.18.4 to 3.21.2 (#8362) +* refactor: Tokens::clearEmptyTokens - optimize cache handling (#8335) + +Changelog for v3.68.0 +--------------------- + +* feat: `ModernizeStrposFixer` - support `stripos` (#8019) +* chore: `FullyQualifiedStrictTypesFixer` - reduce conditions count (#8368) +* test: `PhpUnitSetUpTearDownVisibilityFixer` - extend test for anonymous classes (#8369) + +Changelog for v3.67.1 +--------------------- + +* fix: `FullyQualifiedStrictTypesFixer` - fix return types (#8367) +* fix: `PhpUnitSetUpTearDownVisibilityFixer` - do not touch anonymous classes (#8366) +* chore: allow for class-string in doc types of rule options (#8358) +* chore: CS: Move data provider methods after their test method (#8302) +* chore: dependabot integration (#8357) +* chore: `PHPStan` - upgrade to 2.1 (#8355) +* CI: Introduce PHP compatibility check (#7844) +* deps: bump docker/build-push-action from 5 to 6 (#8361) +* docs: update installation instructions (#8356) + +Changelog for v3.67.0 +--------------------- + +* chore: simplify loops using `end`/`prev` functions (#8352) +* feat: Introduce `general_attribute_remove` fixer (#8339) + +Changelog for v3.66.2 +--------------------- + +* chore: do not use bitwise "or" assignment operator (#8346) +* chore: remove extra check, never happening (#8348) +* chore: remove impossible `@throws` annotation (#8353) +* chore: Tokens - cleanup (#8350) +* chore: Tokens - minor performance and types optimizations (#8349) + +Changelog for v3.66.1 +--------------------- + +* chore: fix CI for Windows (#8326) +* chore: `NoMultipleStatementsPerLineFixer` - be aware of PHP 8.4 property hooks (#8344) +* chore: `TernaryToElvisOperatorFixer` - improvements based on PHPStan detections (#8345) +* chore: `PhpUnitTestCaseStaticMethodCallsFixer` - fix type of `methods` option in documemtation and add example with it (#8338) +* chore: update legacy deps (#8342) +* deps: update box (#8336) + +Changelog for v3.66.0 +--------------------- + +* feat: `Tokenizer` - initial support for PHP 8.4 property hooks (#8312) +* feat: `PhpUnitTestCaseStaticMethodCallsFixer` - cover PHPUnit v11.5 methods (#8314) +* feat: `PhpUnitTestCaseStaticMethodCallsFixer` - make sure all static protected methods are handled (#8327) +* feat: `PhpUnitTestCaseStaticMethodCallsFixer` - support createStub (#8319) +* feat: `UseArrowFunctionsFixer` - support multiline statements (#8311) +* fix: `NullableTypeDeclarationFixer` - do not break multi-line declaration (#8331) +* test: `CiConfigurationTest` - drop not needed condition, logic is checked in upcoming assertion (#8303) +* chore: add more typehints (#8325) +* chore: `DotsOutput` - more const, better typing (#8318) +* chore: mark classes as readonly (#8275) +* chore: more const, better typing (#8320) +* chore: temporarily prevent symfony/process 7.2+ (#8322) +* chore: `Tokens` - simplify (un)registerFoundToken types (#8328) +* chore: upgrade PHPStan (#8321) +* chore: `BraceTransformer` - don't touch curly index braces since 8.4, as it's not a valid syntax anymore (#8313) +* CI: enable phpdoc_to_property_type on php-lowest (#8324) +* Create SECURITY.md +* docs: `Tokens` - fix docs (#8332) + +Changelog for v3.65.0 +--------------------- + +* feat: Ability to set upper limit when using CPU auto-detection (#8280) +* feat: create `@PHP82Migration:risky` ruleset (#8277) +* feat: Impl. TypeExpression::mapTypes() (#8077) +* feat: Parse array/generic/nullable type into inner expression (#8106) +* feat: phpdoc_to_property_type - handle virtual types and null initialization, enable in php-highest CI job (#8283) +* feat: Store PHPDoc offset in `DataProviderAnalysis` (#8226) +* feat: Support for complex PHPDoc types in `fully_qualified_strict_types` (#8085) +* fix: check for priority tests correctly (#8221) +* fix: Do not mark with `@coversNothing` if `CoversMethod`/`CoversFunction` attribute is used (#8268) +* fix: enum-case mistaken for const invocation (#8190) +* fix: fix typing of few properties wrongly typed as non-nullable (#8285) +* fix: fix typing property wrongly typed as non-nullable (#8290) +* fix: MethodChainingIndentationFixer does not fix indentation of last chained property (#8080) +* fix: NoSuperfluousPhpdocTagsFixer - Remove superfluous phpdoc of parameter with attribute (#8237) +* fix: parsing mixed `&` and `|` in `TypeExpression` (#8210) +* fix: proper base class used for AbstractDoctrineAnnotationFixer templates generation (#8291) +* fix: Properly recognise constants in foreach loops (#8203) +* fix: Tokens::overrideRange() block cache pruning (#8240) +* fix: `BlankLineAfterOpeningTagFixer` - add blank line in file starting with multi-line comment (#8256) +* fix: `MultilineWhitespaceBeforeSemicolonsFixer` - do not produce syntax error when there is a meaningful token after semicolon (#8230) +* fix: `NullableTypeDeclarationFixer` - do not break syntax when there is no space before `?` (#8224) +* fix: `PhpUnitDataProvider(.+)Fixer` - do not omit when there is an attribute between PHPDoc and test method (#8185) +* fix: `PhpUnitDataProviderNameFixer` - for an attribute between PHPDoc and test method (#8217) +* chore: add todo for PHP v8 (#8274) +* chore: auto-fallback to sequential runner if single CPU would handle it (#8154) +* chore: block changing tokens collection size using `PhpCsFixer\Tokenizer\Tokens::setSize` (#8257) +* chore: bump dev-tools (#8286) +* chore: bump PHPStan (#8245) +* chore: Cheaper file check first (#8252) +* chore: ConfigInterface - better types (#8244) +* chore: do not call `Tokens::setSize` in `GroupImportFixer` (#8253) +* chore: do not use `Reflection*::setAccessible` (#8264) +* chore: fix priority tests (#8223) +* chore: Fix typos in AbstractFixerTestCase (#8247) +* chore: GithubClient - make URL injectable (#8272) +* chore: Implement PHPStan `Preg::match()` extensions (#8103) +* chore: mark remaining Analysis as `@internal` (#8284) +* chore: PHPStan - upgrade to v2 (#8288) +* chore: reduce amount of class mutable properties (#8281) +* chore: remove from priority tests exceptions tests that are not actually exceptions (#8222) +* chore: remove incorrect priority tests (#8231) +* chore: remove not needed PHP version requirements in descriptions (#8265) +* chore: remove unnecessary methods (#8200) +* chore: tests/Tokenizer/Transformer - better typehinting (#8243) +* chore: Token - remove 'changed' property (#8273) +* chore: Token::getContent() phpdoc return type (#8236) +* chore: update dev dependencies in root (#8289) +* chore: update PHPStan to 1.12.9 (#8271) +* chore: update `checkbashisms` to 2.24.1 (#8258) +* chore: use null coalescing assignment operator where possible (#8219) +* CI: allow macos to fail (#8194) +* CI: build phar on PHP 8.3 (#8195) +* CI: drop matrix for single-matrix-entry jobs of SCA and Deployment checks (#8193) +* CI: Ensure php-cs-fixer PHP compatibility /part (#8241) +* CI: Ensure `php-cs-fixer` PHP compatibility (#8235) +* CI: generate and execute code in `assert` (#8207) +* CI: update PHPStan to 1.12.2 (#8198) +* CI: update PHPStan to 1.12.3 (#8204) +* CI: use phpstan-symfony (#8287) +* depr: ConfigInterface::getPhpExecutable() and ConfigInterface::setPhpExecutable() (#8192) +* deps: add `composer-smaller-lock` (#8263) +* deps: Update PHPStan to 1.12.4 (#8215) +* deps: Update PHPStan to 1.12.5 (#8218) +* deps: update PHPStan to 1.12.7 (#8255) +* docs: fix unconsistency in config doc (#8269) +* docs: mention github action example instead of travis-ci (#8250) +* DX: Cover `php-cs-fixer` file with static analysis (#8229) +* DX: Make `TypeExpression` API more explicit about composite types (#8214) +* refactor: change `_AttributeItems` to `non-empty-list<_AttributeItem>` to allow using single attribute item (#8199) +* refactor: Rename newly introduced option (#8293) +* refactor: Runner - Enhance eventing system (#8276) +* refactor: Runner - make 4.0 TODOs easier to understand (#8196) +* refactor: use arrow functions in more places (#8294) +* test: `@PHP82Migration:risky` - add integration tests (#8278) + +Changelog for v3.64.0 +--------------------- + +* feat: Symfony - adjust configuration for sets (#8188) +* feat: Symfony.trailing_comma_in_multiline - adjust configuration (#8161) +* feat: Update PSR2, PSR12 and PER-CS2 with `single_space_around_construct` config (#8171) +* CI: Update PHPStan to 1.12.0 and fix the error that appeared (#8184) + +Changelog for v3.63.2 +--------------------- + +* fix: `FullyQualifiedStrictTypesFixer` - reset cache even if there is no `use` (#8183) + +Changelog for v3.63.1 +--------------------- + +* dummy release + +Changelog for v3.63.0 +--------------------- + +* feat: Add `array_destructuring` as option for `trailing_comma_in_multiline` (#8172) +* feat: remove braces even for single import (#8156) +* feat: TrailingCommaInMultilineFixer - dynamically evaluate config against PHP version (#8167) +* fix: Do not shorten FQN for class resolution if imported symbol is not a class (#7705) +* fix: Ensure PHP binary path is used as a single CLI argument in parallel worker process (#8180) +* fix: `PhpUnitAttributesFixer` - fix priorities with `PhpUnitDataProvider(.+)Fixer` (#8169) +* chore: add tags for data providers that will change PHPStan's baseline (#8178) +* chore: add `@return` tags for data providers already having PHPDoc (#8176) +* chore: add `@return` tags for data providers that do not have array in data (#8179) +* chore: remove duplicates from data providers (#8164) +* chore: remove duplicates from data providers that are copies in code (#8145) +* chore: remove `beStrictAboutTodoAnnotatedTests` from PHPUnit's config (#8160) +* CI: Update PHPStan to 1.11.10 (#8163) +* CI: Update PHPStan to 1.11.11 and fix error that changed (#8174) +* docs: fix indent on rule `date_time_create_from_format_call` (#8173) + +Changelog for v3.62.0 +--------------------- + +* feat: set new_with_parentheses for anonymous_class to false in PER-CS2.0 (#8140) +* chore: NewWithParenthesesFixer - create TODO to change the default configuration to match PER-CS2 (#8148) + +Changelog for v3.61.1 +--------------------- + +* fix: `NoSuperfluousPhpdocTagsFixer` - fix "Undefined array key 0" error (#8150) + +Changelog for v3.61.0 +--------------------- + +* feat: no_superfluous_phpdoc_tags - also cover ?type (#8125) +* feat: support PHPUnit v9.1 naming for some asserts (#7997) +* fix: Do not mangle non-whitespace token in `PhpdocIndentFixer` (#8147) +* DX: add more typehints for `class-string` (#8139) +* DX: refactor `ProjectCodeTest::provideDataProviderMethodCases` (#8138) + +Changelog for v3.60.0 +--------------------- + +* feat: Add sprintf in the list of compiler optimized functions (#8092) +* feat: `PhpUnitAttributesFixer` - add option to keep annotations (#8090) +* chore: cleanup tests that had `@requires PHP 7.4` ages ago (#8122) +* chore: cleanup `TokensAnalyzerTest` (#8123) +* chore: fix example issue reported by reportPossiblyNonexistentGeneralArrayOffset from PHPStan (#8089) +* chore: NoSuperfluousPhpdocTagsFixer - no need to call heavy toComparableNames method to add null type (#8132) +* chore: PHPStan 11 array rules (#8011) +* chore: PhpUnitSizeClassFixerTest - solve PHP 8.4 issues (#8105) +* chore: reduce PHPStan errors in PhpUnitAttributesFixer (#8091) +* chore: reuse test methods (#8119) +* CI: check autoload (#8121) +* CI: Update PHPStan to 1.11.8 (#8133) +* deps: upgrade dev-tools (#8102) +* DX: check for duplicated test data (#8131) +* DX: check for duplicated test methods (#8124) +* DX: check for duplicated test methods (as AutoReview test) (#8134) +* DX: do not exclude duplicates that are clearly mistakes (#8135) +* DX: Dump `offsetAccess.notFound` errors to baseline (#8107) +* fix: Better way of walking types in `TypeExpression` (#8076) +* fix: CI for PHP 8.4 (#8114) +* fix: update `TokensTest` to shrink PHPStan's baseline (#8112) +* fix: `no_useless_concat_operator` - do not break variable (2) (#7927) +* fix: `NullableTypeDeclarationFixer` - don't convert standalone `null` into nullable union type (#8098) +* fix: `NullableTypeDeclarationFixer` - don't convert standalone `NULL` into nullable union type (#8111) +* fix: `NullableTypeDeclarationFixer` - insert correct token (#8118) +* fix: `PhpUnitAttributesFixer` - handle multiple annotations of the same name (#8075) + +Changelog for v3.59.3 +--------------------- + +* refactor: refactor to templated trait+interface (#7988) + +Changelog for v3.59.2 +--------------------- + +* fix: "list" is reserved type (#8087) +* chore: add missing type in method prototype (#8088) +* CI: bump Ubuntu version (#8086) +* deps: bump infection to unblock PHPUnit 11, and few more as chore (#8083) + +Changelog for v3.59.1 +--------------------- + +* fix: Bump React's JSON decoder buffer size (#8068) +* docs: options - handle enums in dicts (#8082) + +Changelog for v3.59.0 +--------------------- + +* feat(Docker): Multi-arch build (support for `arm64`) (#8079) +* feat: `@PhpCsFixer` ruleset - normalise implicit backslashes in single quoted strings (#7965) +* feat: `SimpleToComplexStringVariableFixer` - support variable being an array (#8064) +* fix: Look up for PHPDoc's variable name by only chars allowed in the variables (#8062) +* fix: Update `PhpUnitTestCaseStaticMethodCallsFixer::STATIC_METHODS` (#8073) +* fix: `native_constant_invocation` - array constants with native constant names (#8008) +* chore: update PHPStan (#8060) +* CI: Update PHPStan to 1.11.4 (#8074) +* docs: don't expose list as config type for dicts (#8081) +* docs: Make wording in `final_class` docs less dismissive (#8065) +* docs: Update 1-bug_report.yml (#8067) +* DX: Remove version from Docker Compose files (#8061) + +Changelog for v3.58.1 +--------------------- + +* fix: `ConstantCaseFixer` - do not change class constant usages (#8055) +* fix: `PhpUnitTestClassRequiresCoversFixer` - do not add annotation when attribute with leading slash present (#8054) + +Changelog for v3.58.0 +--------------------- + +* chore(doc): Use FQCN for parallel config in documentation (#8029) +* chore: fix typo in `PhpUnitTestClassRequiresCoversFixerTest` (#8047) +* chore: RandomApiMigrationFixer - do not modify configuration property (#8033) +* chore: Tokens::setCode - further improvements to cache (#8053) +* chore: update PHPStan (#8045) +* docs: Add missing imports in a cookbook about creating custom rules (#8031) +* docs: fix deprecated string interpolation style (#8036) +* docs: global_namespace_import - simplify allowed config types (#8023) +* feat(GroupImportFixer): Ability to configure which type of imports should be grouped (#8046) +* fix: clear `Tokens::$blockStartCache` and `Tokens::$blockEndCache` when calling `Tokens::setCode` (#8051) +* fix: correctly handle PHP closing tag with `simplified_null_return` (#8049) +* fix: `ConstantCaseFixer` - do not change namespace (#8004) +* fix: `PhpUnitAttributesFixer` - do not add attribute if already present (#8043) +* fix: `PhpUnitSizeClassFixer` - do not add annotation when there are attributes (#8044) +* fix: `PhpUnitTestClassRequiresCoversFixer` - attribute detection when class is `readonly` (#8042) + +Changelog for v3.57.2 +--------------------- + +* docs: better ConfigurableFixer allowed types (#8024) +* docs: Improve Docker usage example (#8021) +* feat: Report used memory to 2 decimal digits only (#8017) +* fix: Support named args in `ParallelConfigFactory::detect()` (#8026) +* fix: `php_unit_test_class_requires_covers` Attribute detection when class is final (#8016) + +Changelog for v3.57.1 +--------------------- + +* chore: update PHPDoc in `Preg::matchAll` (#8012) +* fix: Runner - handle no files while in parallel runner (#8015) + +Changelog for v3.57.0 +--------------------- + +* feat: Ability to run Fixer with parallel runner 🎉 (#7777) + +Changelog for v3.56.2 +--------------------- + +* chore: update PHPStan (#8010) +* DX: Fix Mess Detector violations (#8007) +* DX: Install PCov extension for local Docker (#8006) + +Changelog for v3.56.1 +--------------------- + +* chore: improve PHPDoc typehints (#7994) +* CI: Allow any integer in PHPStan error for Token's constructor (#8000) +* fix: Better array shape in `PhpUnitDedicateAssertFixer` (#7999) +* fix: `ConstantCaseFixer` - do not touch typed constants (#7998) + +Changelog for v3.56.0 +--------------------- + +* feat: `TrailingCommaInMultilineFixer` - handle trailing comma in language constructs (#7989) +* fix: `TrailingCommaInMultilineFixer` - language constructs should be covered by arguments, not parameters (#7990) +* chore: remove invalid comment (#7987) +* DX: Cache optimisation (#7985) + +Changelog for v3.55.0 +--------------------- + +* feat: Introduce `OrderedAttributesFixer` (#7395) +* chore: few SCA fixes and dev-tools update (#7969) +* chore: fix phpdoc types (#7977) +* chore: narrow PHPDoc types (#7979) +* chore: Normalize implicit backslahes in single quoted strings internally (#7786) +* chore: phpdoc - rely on strict list/tuple/assoc instead of array (#7978) +* chore: PhpUnitDataProviderNameFixer - follow config creation pattern (#7980) +* chore: Preg - drop half-support for array-pattern (#7976) +* chore: re-use CodeHasher (#7984) +* chore: RuleSetsTest - assert that Fixer is configurable (#7961) +* chore: sugar syntax (#7986) +* chore: Tokens should be always a list (#7698) +* CI: Ad-hoc fix for MacOS jobs (#7970) +* CI: Fix calculating diff between branches in PRs (#7973) +* DX: allow to enforce cache mechanism by env var (#7983) +* DX: do not typehint fixed-length arrays as lists (#7974) +* DX: Prevent having deprecated fixers listed as successors of other deprecated fixers (#7967) +* DX: Resolve/Ignore PHPStan issues on level 6 + bump to level 7 with new baseline (#7971) +* DX: use `list` type in PHPDoc (#7975) +* fix: `PhpUnitAttributesFixer` - fix for `#[RequiresPhp]` exceeding its constructor parameters (#7966) +* test: don't count comment after class as another classy element (#7982) + +Changelog for v3.54.0 +--------------------- + +* feat: introduce `PhpUnitAttributesFixer` (#7831) +* chore: Properly determine self-approval trigger commit (#7936) +* chore: Revert ref for self-approval Git checkout (#7944) +* CI: check if proper array key is declared (#7912) +* DX: cleanup `FullyQualifiedStrictTypesFixerTest` (#7954) +* DX: cleanup `PhpdocNoAccessFixerTest` (#7933) +* DX: cleanup `PhpUnitMethodCasingFixerTest` (#7948) +* DX: cleanup `PhpUnitStrictFixerTest` (#7938) +* DX: Improve internal dist config for Fixer (#7952) +* DX: Improve issue templates (#7942) +* DX: there is no namespace if there is no PHP code (#7953) +* DX: update .gitattributes (#7931) +* fix: Remove Infection during Docker release (#7937) +* fix: `FullyQualifiedStrictTypesFixer` - do not add imports before PHP opening tag (#7955) +* fix: `PhpUnitMethodCasingFixer` - do not double underscore (#7949) +* fix: `PhpUnitTestClassRequiresCoversFixer` - do not add annotation when there are attributes (#7880) +* test: Ignore PHP version related mutations (#7935) + +Changelog for v3.53.0 +--------------------- + +* chore: Use `list` over `array` in more places (#7905) +* CI: allow for self-approvals for maintainers (#7921) +* CI: Improve Infection setup (#7913) +* CI: no need to trigger enable auto-merge when self-approve (#7929) +* DX: reduce `array_filter` function usages (#7923) +* DX: remove duplicated character from `trim` call (#7930) +* DX: update actions producing warnings (#7925) +* DX: update actions producing warnings (#7928) +* DX: update `phpstan/phpstan-strict-rules` (#7924) +* feat: Add trailing comma in multiline to PER-CS 2.0 (#7916) +* feat: Introduce `AttributeAnalysis` (#7909) +* feat: `@PHP84Migration` introduction (#7774) +* fix: Constant invocation detected in typed constants (#7892) +* fix: `PhpdocArrayTypeFixer` - JIT stack limit exhausted (#7895) +* test: Introduce Infection for mutation tests (#7874) + +Changelog for v3.52.1 +--------------------- + +* fix: StatementIndentationFixer - do not crash on ternary operator in class property (#7899) +* fix: `PhpCsFixer\Tokenizer\Tokens::setSize` return type (#7900) + +Changelog for v3.52.0 +--------------------- + +* chore: fix PHP 8.4 deprecations (#7894) +* chore: fix PHPStan 1.10.60 issues (#7873) +* chore: list over array in more places (#7876) +* chore: replace template with variable in Preg class (#7882) +* chore: update PHPStan (#7871) +* depr: `nullable_type_declaration_for_default_null_value` - deprecate option that is against `@PHP84Migration` (#7872) +* docs: Fix typo (#7889) +* feat: Add support for callable template in PHPDoc parser (#7084) +* feat: Add `array_indentation` to `PER-CS2.0` ruleset (#7881) +* feat: `@Symfony:risky` - add `no_unreachable_default_argument_value` (#7863) +* feat: `PhpCsFixer` ruleset - enable `nullable_type_declaration_for_default_null_value` (#7870) +* fix: Constant invocation detected in DNF types (#7869) +* fix: Correctly indent multiline constants and properties (#7875) +* fix: `no_useless_concat_operator` - do not break variable (#7827) +* fix: `TokensAnalyzer` - handle unary operator in arrow functions (#7862) +* fix: `TypeExpression` - fix "JIT stack limit exhausted" error (#7843) + +Changelog for v3.51.0 +--------------------- + +* chore: add missing tests for non-documentation classes (#7848) +* chore: do not perform type analysis in tests (#7852) +* chore: list over array in more places (#7857) +* chore: tests documentation classes (#7855) +* feat: `@Symfony` - add nullable_type_declaration (#7856) +* test: fix wrong type in param annotation (#7858) + +Changelog for v3.50.0 +--------------------- + +* chore: add missing types (#7842) +* chore: BlocksAnalyzer - raise exception on invalid index (#7819) +* chore: DataProviderAnalysis - expect list over array (#7800) +* chore: do not use `@large` on method level (#7832) +* chore: do not use `@medium` on method level (#7833) +* chore: Fix typos (#7835) +* chore: rename variables (#7847) +* chore: some improvements around array typehints (#7799) +* CI: fix PHP 8.4 job (#7829) +* DX: Include `symfony/var-dumper` in dev tools (#7795) +* feat: Ability to remove unused imports from multi-use statements (#7815) +* feat: allow PHPUnit 11 (#7824) +* feat: Allow shortening symbols from multi-use statements (only classes for now) (#7816) +* feat: introduce `PhpdocArrayTypeFixer` (#7812) +* feat: PhpUnitTestCaseStaticMethodCallsFixer - cover PHPUnit v11 methods (#7822) +* feat: Support for multi-use statements in `NamespaceUsesAnalyzer` (#7814) +* feat: `MbStrFunctionsFixer` - add support for `mb_trim`, `mb_ltrim` and `mb_rtrim` functions (#7840) +* feat: `NoEmptyPhpdocFixer` - do not leave empty line after removing PHPDoc (#7820) +* feat: `no_superfluous_phpdoc_tags` - introduce `allow_future_params` option (#7743) +* fix: do not use wrongly named arguments in data providers (#7823) +* fix: Ensure PCNTL extension is always installed in Docker (#7782) +* fix: PhpdocListTypeFixer - support key types containing `<…>` (#7817) +* fix: Proper build target for local Docker Compose (#7834) +* fix: union PHPDoc support in `fully_qualified_strict_types` fixer (#7719) +* fix: `ExecutorWithoutErrorHandler` - remove invalid PHP 7.4 type (#7845) +* fix: `fully_qualified_strict_types` must honor template/local type identifiers (#7724) +* fix: `MethodArgumentSpaceFixer` - do not break heredoc/nowdoc (#7828) +* fix: `NumericLiteralSeparatorFixer` - do not change `float` to `int` when there is nothing after the dot (#7805) +* fix: `PhpUnitStrictFixer` - do not crash on property having the name of method to fix (#7804) +* fix: `SingleSpaceAroundConstructFixer` - correctly recognise multiple constants (#7700) +* fix: `TypeExpression` - handle array shape key with dash (#7841) + +Changelog for v3.49.0 +--------------------- + +* chore(checkbashisms): update to 2.23.7 (#7780) +* chore: add missing key types in PHPDoc types (#7779) +* chore: Exclude `topic/core` issues/PRs from Stale Bot (#7788) +* chore: `DescribeCommand` - better handling of deprecations (#7778) +* docs: docker - use gitlab reporter in GitLab integration example (#7764) +* docs: docker in CI - don't suggest command that overrides path from config file (#7763) +* DX: check deprecations exactly (#7742) +* feat: Add `ordered_types` to `@Symfony` (#7356) +* feat: introduce `PhpdocListTypeFixer` (#7796) +* feat: introduce `string_implicit_backslashes` as `escape_implicit_backslashes` replacement (#7669) +* feat: update `Symfony.nullable_type_declaration_for_default_null_value` config (#7773) +* feat: `@PhpCsFixer` ruleset - enable `php_unit_data_provider_static` (#7685) +* fix: Allow using cache when running in Docker distribution (#7769) +* fix: ClassDefinitionFixer for anonymous class with phpdoc/attribute on separate line (#7546) +* fix: `ClassKeywordFixer` must run before `FullyQualifiedStrictTypesFixer` (#7767) +* fix: `function_to_constant` `get_class()` replacement (#7770) +* fix: `LowercaseStaticReferenceFixer` - do not change typed constants (#7775) +* fix: `PhpdocTypesFixer` - handle more complex types (#7791) +* fix: `TypeExpression` - do not break type using `walkTypes` method (#7785) + +Changelog for v3.48.0 +--------------------- + +* chore: `FullyQualifiedStrictTypesFixer` must run before `OrderedInterfacesFixer` (#7762) +* docs: Add PHP-CS-Fixer integration in a GitHub Action step (#7757) +* feat: `PhpdocTypesOrderFixer` Support DNF types (#7732) +* fix: Support shebang in fixers operating on PHP opening tag (#7687) +* fix: work correctly for a switch/case with ternary operator (#7756) +* fix: `NoUselessConcatOperatorFixer` - do not remove new line (#7759) + +Changelog for v3.47.1 +--------------------- + +* fix: Do not override short name with relative reference (#7752) +* fix: make `BinaryOperatorSpacesFixer` work as pre-v3.47 (#7751) +* fix: Proper Docker image name suffix (#7739) +* fix: `FullyQualifiedStrictTypesFixer` - do not change case of the symbol when there's name collision between imported class and imported function (#7750) +* fix: `FullyQualifiedStrictTypesFixer` - do not modify statements with property fetch and `::` (#7749) + +Changelog for v3.47.0 +--------------------- + +* chore: better identify EXPERIMENTAL rules (#7729) +* chore: fix issue detected by unlocked PHPStan + upgrade dev-tools (#7678) +* chore: handle extract() (#7684) +* chore: Mention contributors in app info (#7668) +* chore: no need to mark private methods as internal (#7715) +* chore: ProjectCodeTests - dry for function usage extractions (#7690) +* chore: reduce PHPStan baseline (#7644) +* chore: use numeric literal separator for PHP version IDs (#7712) +* chore: use numeric_literal_separator for project (#7713) +* chore: Utils::sortElements - better typing (#7646) +* CI: Allow running Stale Bot on demand (#7711) +* CI: Fix PHP 8.4 (#7702) +* CI: Give write permissions to Stale Bot (#7716) +* CI: Use `actions/stale` v9 (#7710) +* docs: Add information about allowing maintainers to update PRs (#7683) +* docs: CONTRIBUTING.md - update Opening a PR (#7691) +* docs: Display/include tool info/version by default in commands and reports (#7733) +* DX: fix deprecation tests warnings for PHP 7.4 (#7725) +* DX: update `host.docker.internal` in Compose override template (#7661) +* DX: `NumericLiteralSeparatorFixer` - change default strategy to `use_separator` (#7730) +* feat: Add support for official Docker images of Fixer (#7555) +* feat: Add `spacing` option to `PhpdocAlignFixer` (#6505) +* feat: Add `union_types` option to `phpdoc_to_param_type`, `phpdoc_to_property_type`, and `phpdoc_to_return_type` fixers (#7672) +* feat: Introduce `heredoc_closing_marker` fixer (#7660) +* feat: Introduce `multiline_string_to_heredoc` fixer (#7665) +* feat: Introduce `NumericLiteralSeparatorFixer` (#6761) +* feat: no_superfluous_phpdoc_tags - support for arrow function (#7666) +* feat: Simplify closing marker when possible in `heredoc_closing_marker` fixer (#7676) +* feat: Support typed properties and attributes in `fully_qualified_strict_types` (#7659) +* feat: `@PhpCsFixer` ruleset - enable no_whitespace_before_comma_in_array.after_heredoc (#7670) +* fix: Improve progress bar visual layer (#7708) +* fix: indentation of control structure body without braces (#7663) +* fix: make sure all PHP extensions required by PHPUnit are installed (#7727) +* fix: PhpdocToReturnTypeFixerTest - support for arrow functions (#7645) +* fix: Several improvements for `fully_qualified_strict_types` (respect declared symbols, relative imports, leading backslash in global namespace) (#7679) +* fix: SimplifiedNullReturnFixer - support array return typehint (#7728) +* fix: Support numeric values without leading zero in `numeric_literal_separator` (#7735) +* fix: `BinaryOperatorSpacesFixer` - align correctly when multiple shifts occurs in single line (#7593) +* fix: `ClassReferenceNameCasingFixer` capitalizes the property name after the nullsafe operator (#7696) +* fix: `fully_qualified_strict_types` with `leading_backslash_in_global_namespace` enabled - handle reserved types in phpDoc (#7648) +* fix: `NoSpaceAroundDoubleColonFixer` must run before `MethodChainingIndentationFixer` (#7723) +* fix: `no_superfluous_phpdoc_tags` must honor multiline docs (#7697) +* fix: `numeric_literal_separator` - Handle zero-leading floats properly (#7737) +* refactor: increase performance by ~7% thanks to `Tokens::block*Cache` hit increased by ~12% (#6176) +* refactor: Tokens - fast check for non-block in 'detectBlockType', evaluate definitions only once in 'getBlockEdgeDefinitions' (#7655) +* refactor: `Tokens::clearEmptyTokens` - play defensive with cache clearing (#7658) +* test: ensure we do not forget to test any short_open_tag test (#7638) + +Changelog for v3.46.0 +--------------------- + +* chore: fix internal typehints in Tokens (#7656) +* chore: reduce PHPStan baseline (#7643) +* docs: Show class with unit tests and BC promise info (#7667) +* feat: change default ruleset to `@PER-CS` (only behind PHP_CS_FIXER_FUTURE_MODE=1) (#7650) +* feat: Support new/instanceof/use trait in `fully_qualified_strict_types` (#7653) +* fix: FQCN parse phpdoc using full grammar regex (#7649) +* fix: Handle FQCN properly with `leading_backslash_in_global_namespace` option enabled (#7654) +* fix: PhpdocToParamTypeFixerTest - support for arrow functions (#7647) +* fix: PHP_CS_FIXER_FUTURE_MODE - proper boolean validation (#7651) + +Changelog for v3.45.0 +--------------------- + +* feat: Enable symbol importing in `@PhpCsFixer` ruleset (#7629) +* fix: NoUnneededBracesFixer - improve handling of global namespace (#7639) +* test: run tests with "short_open_tag" enabled (#7637) + +Changelog for v3.44.0 +--------------------- + +* feat: Introduce percentage bar as new default progress output (#7603) + +Changelog for v3.43.1 +--------------------- + +* fix: Import only unique symbols' short names (#7635) + +Changelog for v3.43.0 +--------------------- + +* chore: change base of `@Symfony` set to `@PER-CS2.0` (#7627) +* chore: PHPUnit - allow for v10 (#7606) +* chore: Preg - rework catching the error (#7616) +* chore: Revert unneeded peer-dep-pin and re-gen lock file (#7618) +* docs: drop extra note about 8.0.0 bug in README.md (#7614) +* feat: add cast_spaces into `@PER-CS2.0` (#7625) +* feat: Configurable phpDoc tags for FQCN processing (#7628) +* feat: StatementIndentationFixer - introduce stick_comment_to_next_continuous_control_statement config (#7624) +* feat: UnaryOperatorSpacesFixer - introduce only_dec_inc config (#7626) +* fix: FullyQualifiedStrictTypesFixer - better support annotations in inline {} (#7633) +* fix: Improve how FQCN is handled in phpDoc (#7622) +* fix: phpdoc_align - fix multiline tag alignment issue (#7630) + +Changelog for v3.42.0 +--------------------- + +* chore: aim to not rely on internal array pointer but use array_key_first (#7613) +* chore: deprecate Token::isKeyCaseSensitive (#7599) +* chore: deprecate Token::isKeyCaseSensitive, 2nd part (#7601) +* chore: do not check PHP_VERSION_ID (#7602) +* chore: FileFilterIteratorTest - more accurate type in docs (#7542) +* chore: minor code cleanup (#7607) +* chore: more types (#7598) +* chore: PHPDoc key-value spacing (#7592) +* chore: PHPUnit - run defects first (#7570) +* chore: ProjectCodeTest - DRY on Tokens creation (#7574) +* chore: ProjectCodeTest - prepare for symfony/console v7 (#7605) +* chore: ProjectCodeTest::provide*ClassCases to return iterable with key for better tests execution log (#7572) +* chore: ProjectCodeTest::testDataProvidersDeclaredReturnType - use better DataProvider to simplify test logic (#7573) +* chore: TokensAnalyzer - string-enum for better typehinting (#7571) +* chore: unify tests not agnostic of PHP version (#7581) +* chore: use ::class more (#7545) +* CI: Introduce `composer-unused` (#7536) +* DX: add types to anonymous functions (#7561) +* DX: Allow running smoke tests within Docker runtime (#7608) +* DX: check fixer's options for wording (#7543) +* DX: cleanup deprecation message (#7576) +* DX: do not allow overriding constructor of `PHPUnit\Framework\TestCase` (#7563) +* DX: do not import ExpectDeprecationTrait in UtilsTest (#7562) +* DX: Enforce consistent naming in tests (#7556) +* DX: fix checking test class extends `PhpCsFixer\Tests\TestCase` (#7567) +* DX: make sure that exceptions in `AbstractFixerTestCase::testProperMethodNaming` are not already fixed (#7588) +* DX: remove recursion from AbstractIntegrationTestCase::testIntegration (#7577) +* DX: remove `PhpUnitNamespacedFixerTest::testClassIsFixed` (#7564) +* DX: remove `symfony/phpunit-bridge` (#7578) +* DX: replace fixture classes with anonymous ones (#7533) +* DX: Unify Docker mount points and paths (#7549) +* DX: unify fixer's test method names - quick wins (#7584) +* DX: unify tests for casing fixers (#7558) +* DX: use anonymous function over concrete classes (#7553) +* feat(EXPERIMENTAL): ClassKeywordFixer (#2918) +* feat(EXPERIMENTAL): ClassKeywordFixer, part 2 (#7550) +* feat(PhpdocToCommentFixer): Add option to handle return as valid docblock usage (#7401) (#7402) +* feat: Ability to import FQCNs found during analysis (#7597) +* feat: add phpDoc support for `fully_qualified_strict_types` fixer (#5620) +* feat: Handle deprecated rule sets similarly to deprecated fixers (#7288) +* feat: PhpUnitTestCaseStaticMethodCallsFixer - cover PHPUnit v10 methods (#7604) +* feat: Support more FQCNs cases in `fully_qualified_strict_types` (#7459) +* fix: AbstractFixerTestCase - fix checking for correct casing (#7540) +* fix: Better OS detection in integration tests (#7547) +* fix: NativeTypeDeclarationCasingFixe - handle static property without type (#7589) +* test: AutoReview - unify data provider returns (#7544) +* test: check to have DataProviders code agnostic of PHP version (#7575) + +Changelog for v3.41.1 +--------------------- + +* DX: Change `@testWith` to `@dataProvider` (#7535) +* DX: Introduce Markdownlint (#7534) +* fix: NativeTypeDeclarationCasingFixer - do not crash on `var` keyword (#7538) + +Changelog for v3.41.0 +--------------------- + +* chore: Move `mb_str_functions` PHP 8.3 cases to separate test (#7505) +* chore: Symfony v7 is now stable (#7469) +* CI: drop PHP 8.3 hacks (#7519) +* docs: Improve docs for `no_spaces_after_function_name` (#7520) +* DX: Ability to run Sphinx linter locally (#7481) +* DX: AbstractFixerTest - use anonymous classes (#7527) +* DX: Add progress output for `cs:check` script (#7514) +* DX: align doubles naming (#7525) +* DX: remove AbstractFixerTestCase::getTestFile() (#7495) +* DX: remove jangregor/phpstan-prophecy (#7524) +* DX: remove Prophecy (#7509) +* DX: replace Prophecy with anonymous classes in CacheTest (#7503) +* DX: replace Prophecy with anonymous classes in ProcessLintingResultTest (#7501) +* DX: Utilise auto-discovery for PHPStan formatter (#7490) +* feat: Support `mb_str_pad` function in `mb_str_functions` rule (#7499) +* fix: BinaryOperatorSpacesFixer - do not add whitespace inside short function (#7523) +* fix: Downgrade PDepend to version not supporting Symfony 7 (#7513) +* fix: GlobalNamespaceImportFixer - key in PHPDoc's array shape matching class name (#7522) +* fix: SpacesInsideParenthesesFixer - handle class instantiation parentheses (#7531) +* Update PHPstan to 1.10.48 (#7532) + +Changelog for v3.40.2 +--------------------- + +* docs: fix link to source classes (#7493) + +Changelog for v3.40.1 +--------------------- + +* chore: Delete stray file x (#7473) +* chore: Fix editorconfig (#7478) +* chore: Fix typos (#7474) +* chore: Fix YAML line length (#7476) +* chore: Indent JSON files with 4 spaces (#7480) +* chore: Make YAML workflow git-based (#7477) +* chore: Use stable XDebug (#7489) +* CI: Lint docs (#7479) +* CI: Use PHPStan's native Github error formatter (#7487) +* DX: fix PHPStan error (#7488) +* DX: PsrAutoloadingFixerTest - do not build mock in data provider (#7491) +* DX: PsrAutoloadingFixerTest - merge all data providers into one (#7492) +* DX: Update PHPStan to 1.10.46 (#7486) +* fix: `NoSpacesAfterFunctionNameFixer` - do not remove space if the opening parenthesis part of an expression (#7430) + +Changelog for v3.40.0 +--------------------- + +* chore: officially support PHP 8.3 (#7466) +* chore: update deps (#7471) +* CI: add --no-update while dropping non-compat `facile-it/paraunit` (#7470) +* CI: automate --ignore-platform-req=PHP (#7467) +* CI: bump actions/github-script to v7 (#7468) +* CI: move humbug/box out of dev-tools/composer.json (#7472) + +Changelog for v3.39.1 +--------------------- + +* DX: introduce SwitchAnalyzer (#7456) +* fix: NoExtraBlankLinesFixer - do not remove blank line after `? : throw` (#7457) +* fix: OrderedInterfacesFixer - do not comment out interface (#7464) +* test: Improve `ExplicitIndirectVariableFixerTest` (#7451) + +Changelog for v3.39.0 +--------------------- + +* chore: Add support for Symfony 7 (#7453) +* chore: IntegrationTest - move support of php< requirement to main Integration classes (#7448) +* CI: drop Symfony ^7 incompat exceptions of php-coveralls and cli-executor (#7455) +* CI: early compatibility checks with Symfony 7 (#7431) +* docs: drop list.rst and code behind it (#7436) +* docs: remove Gitter mentions (#7441) +* DX: Ability to run Fixer on PHP8.3 for development (#7449) +* DX: describe command - for rules, list also sets that are including them (#7419) +* DX: Docker clean up (#7450) +* DX: more usage of spaceship operator (#7438) +* DX: Put `Preg`'s last error message in exception message (#7443) +* feat: Introduce `@PHP83Migration` ruleset and PHP 8.3 integration test (#7439) +* test: Improve `AbstractIntegrationTestCase` description (#7452) + +Changelog for v3.38.2 +--------------------- + +* docs: fix 'Could not lex literal_block as "php". Highlighting skipped.' (#7433) +* docs: small unification between FixerDocumentGenerator and ListDocumentGenerator (#7435) +* docs: unify ../ <> ./../ (#7434) + +Changelog for v3.38.1 +--------------------- + +* chore: ListSetsCommand::execute - add missing return type (#7432) +* chore: PHPStan - add counter to dataProvider exception, so we do not increase the tech debt on it (#7425) +* CI: Use `actions/checkout` v4 (#7423) +* fix: ClassAttributesSeparationFixer - handle Disjunctive Normal Form types parentheses (#7428) +* fix: Remove all variable names in `@var` callable signature (#7429) +* fix: Satisfy `composer normalize` (#7424) + +Changelog for v3.38.0 +--------------------- + +* chore: upgrade phpstan (#7421) +* CI: add curl and mbstring to build php (#7409) +* CI: cache dev-tools/bin (#7416) +* CI: Composer - move prefer-stable to file config (#7406) +* CI: conditionally install flex (#7412) +* CI: dev-tools/build.sh - no need to repeat 'prefer-stable', but let's use '--no-scripts' (#7408) +* CI: Do not run post-autoload-dump on Composer install (#7403) +* CI: general restructure (#7407) +* CI: GitHub Actions - use actions/cache for Composer in composite action (#7415) +* CI: Improve QA process - suplement (#7411) +* CI: prevent Infection plugins during build time, as we do not use it (#7422) +* CI: simplify setup-php config (#7404) +* DX: Do not mark as stale issues/PRs with milestone assigned (#7398) +* DX: Improve QA process (#7366) +* feat: phpDoc to property/return/param Fixer - allow fixing mixed on PHP >= 8 (#6356) +* feat: phpDoc to property/return/param Fixer - allow fixing union types on PHP >= 8 (#6359) +* feat: Support for array destructuring in `array_indentation` (#7405) +* feat: `@Symfony` - keep Annotation,NamedArgumentConstructor,Target annotations as single group (#7399) +* fix(SelfAccessorFixer): do not touch references inside lambda and/or arrow function (#7349) +* fix: long_to_shorthand_operator - mark as risky fixer (#7418) +* fix: OrderedImportsFixer - handle non-grouped list of const/function imports (#7397) + +Changelog for v3.37.1 +--------------------- + +* docs: config file - provide better examples (#7396) +* docs: config file - provide better link to Finder docs (#6992) + +Changelog for v3.37.0 +--------------------- + +* feat: add parallel cache support (#7131) + +Changelog for v3.36.0 +--------------------- + +* chore: disable `infection-installer` plugin, as we do not use `infection/*` yet (#7391) +* chore: Run dev-tools on PHP 8.2 (#7389) +* CI: Run Symfony 6 compat check on PHP 8.1 (#7383) +* CI: use fast-linter when calculating code coverage (#7390) +* docs: extend example for nullable_type_declaration (#7381) +* DX: FixerFactoryTest - make assertion failing msg more descriptive (#7387) +* feat: PhpdocSummaryFixer - support lists in description (#7385) +* feat: PSR12 - configure unary_operator_spaces (#7388) +* feat: StatementIndentationFixer - support comment for continuous control statement (#7384) + +Changelog for v3.35.1 +--------------------- + +* fix: Mark `PhpdocReadonlyClassCommentToKeywordFixer` as risky (#7372) + +Changelog for v3.35.0 +--------------------- + +* chore: Autoreview: test all formats are listed in `usage.rst` (#7357) +* chore: no need for `phpunitgoodpractices/traits` anymore (#7362) +* chore: Rename `indexes` to `indices` (#7368) +* chore: stop using `phpunitgoodpractices/traits` (#7363) +* chore: typo (#7367) +* docs: Sort options in documentation (#7345) +* feat(PhpdocReadonlyClassCommentToKeywordFixer): Introduction (#7353) +* feat: Ability to keep/enforce leading `\` when in global namespace (#7186) +* feat: Update `@PER-CS2.0` to match short closure space (#6970) +* feat: use `ordered_types` in `@PhpCsFixer` (#7361) +* fix(SingleLineThrowFixer): fixer goes out of range on close tag (#7369) + +Changelog for v3.34.1 +--------------------- + +* deps: revert "prevent using PHPCSFixer along with unfinalize package (#7343)" (#7348) + +Changelog for v3.34.0 +--------------------- + +* feat: Introduce `check` command (alias for `fix --dry-run`) (#7322) + +Changelog for v3.33.0 +--------------------- + +* feat: Introduce `native_type_declaration_casing` fixer (#7330) + +Changelog for v3.32.0 +--------------------- + +* deps: Prevent using PHPCSFixer along with `unfinalize` package (#7343) +* feat: Deprecate `CompactNullableTypehintFixer` and proxy to `CompactNullableTypeDeclarationFixer` (#7339) +* feat: Deprecate `CurlyBracesPositionFixer` and proxy to `BracesPositionFixer` (#7334) +* feat: Deprecate `NewWithBracesFixer` and proxy to `NewWithParenthesesFixer` (#7331) +* feat: Deprecate `NoUnneededCurlyBracesFixer` and proxy to `NoUnneededBracesFixer` (#7335) +* feat: Rename `CurlyBraceTransformer` to `BraceTransformer` (#7333) + +Changelog for v3.31.0 +--------------------- + +* chore: Use type declaration instead of type hint (#7338) +* feat: Introduce `attribute_placement` option for `MethodArgumentSpaceFixer` (#7320) +* fix: Adjust wording related to deprecations (#7332) +* fix: Correct deprecation header in rules' docs (#7337) +* fix: Replace mention of bracket with parenthesis (#7336) +* fix: `FunctionToConstantFixer` should run before `NativeConstantInvocationFixer` (#7344) + +Changelog for v3.30.0 +--------------------- + +* feat: Introduce `AttributeEmptyParenthesesFixer` (#7284) +* fix(method_argument_space): inject new line after trailing space on current line (#7327) +* fix(`YodaStyleFixer`): do not touch `require(_once)`, `include(_once)` and `yield from` statements (#7325) +* fix: illegal offset type on file-wide return in `ReturnToYieldFromFixer` (#7318) + +Changelog for v3.29.0 +--------------------- + +* chore: fix TODO tasks about T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG support (#7316) +* feat(`@PhpCsFixer:risky`): use newest `@PER-CS:risky` instead of locked `@PER-CS2.0:risky` (#7323) +* feat: Introduce `@PER-CS` ruleset (#7321) +* fix: priority issue between array_syntax and space after rules (#7324) + +Changelog for v3.28.0 +--------------------- + +* chore(prlint): allow for 'deps' type (#7304) +* CI(prlint): allow for special chars in parentheses (#7308) +* deps(dev-tools): update dev-tools (#7309) +* DX: Bump XDebug version in Docker services (#7300) +* feat(`@PER-CS2.0`): Add `concat_space` to the ruleset (#7302) + +Changelog for v3.27.0 +--------------------- + +* docs: cleanup old mention of `--show-progress=estimating` in docs (#7287) +* DX: add Composer script for applying CS fixes in parallel (#7274) +* feat: Clone PER-CS1.0 to PER-CS2.0 to prepare for adding new rules (#7249) +* feat: Introduce `LongToShorthandOperatorFixer` (#7295) +* feat: Mark PER-CS v1 as deprecated (#7283) +* feat: Move `single_line_empty_body` to `@PER-CS2.0` (#7282) +* fix: Priorities for fixers related to curly braces, empty lines and trailing whitespace (#7296) +* fix: `OrderedTraitsFixer` - better support for multiple traits in one `use` statement (#7289) + +Changelog for v3.26.1 +--------------------- + +* fix: Handle superfluous asterisk in `no_superfluous_phpdoc_tags` (#7279) + +Changelog for v3.26.0 +--------------------- + +* chore(checkbashisms): update to 2.23.6 (#7276) +* chore(phpstan): reduce baseline (#7275) +* feat: Add `single_line_empty_body` to `@PhpCsFixer` (#7266) +* fix(YieldFromArrayToYieldsFixer): mark as Risky (#7272) +* fix(YieldFromArrayToYieldsFixer): skip touching empty array (#7273) +* test: Introduce common way of creating fake Composer project in `InstallViaComposerTest` (#7265) + +Changelog for v3.25.1 +--------------------- + +* fix: PhpdocTypesFixer - do not crash for type followed by braces/brackets/chevrons/parentheses (#7268) + +Changelog for v3.25.0 +--------------------- + +* feat: Remove Doctrine dependencies (#7263) + +Changelog for v3.24.0 +--------------------- + +* chore: apply CS (#7240) +* chore: apply static_lambda rule (#7239) +* chore: Improve template for creating new issue (#7255) +* CI: Conventional Commits support in PRLint config (#7037) +* CI: Remove Travis leftovers (#7259) +* docs: Add information about installing Fixer as dev dependency (#7129) +* docs: document composer script aliases (#7230) +* DX: Add script for running Composer Require Checker (#7252) +* DX: composer script aliases - ensure templated description (#7235) +* DX: composer-script - count PHPMD as static-analysis (#7231) +* DX: do not allow version specific code sample with minimum PHP version lower than the lowest supported one (#7207) +* DX: ensure version specific code samples are suitable for at least 1 supported PHP version (#7212) +* DX: Improve contributing guide (#7241) +* DX: More descriptive stale messages (#7236) +* feat(@PhpCsFixer:risky): add static_lambda rule (#7237) +* feat: Add literal separator support for `integer_literal_case` (#7081) +* feat: Configurable case sensitivity for more ordering fixers (#7021) +* feat: Support for attributes in `method_argument_space` (#7242) +* fix: import detection for attributes at `NoUnusedImportsFixer` (#7246) +* fix: `no_superfluous_phpdoc_tags` with `null` phpdoc (#7234) +* fix: `phpdoc_types` must not lowercase literal types (#7108) +* test: Add static methods from PHPUnit 9.6.11 (#7243) + +Changelog for v3.23.0 +--------------------- + +* bug: BlankLineBeforeStatementFixer - do not enforce/add a blank line when there is a blank line between the comment and the statement already (#7190) +* bug: Fix detecting classy invocation in catch (#7191) +* bug: Fix names resolving in `no_superfluous_phpdoc_tags` fixer (#7189) +* bug: Fix various bugs in `FullyQualifiedStrictTypesFixer` fixer (#7188) +* bug: Fixed line between general script documentation and require (#7177) +* bug: Support annotations with arguments in `FinalInternalClassFixer` (#7160) +* bug: YieldFromArrayToYieldsFixer - fix for `yield from` after `}` (#7169) +* bug: YieldFromArrayToYieldsFixer - fix handling the comment before the first array element (#7193) +* bug: `HeaderCommentFixer` must run before `BlankLinesBeforeNamespaceFixer` (#7205) +* bug: `NoUselessReturnFixer` must run before `SingleLineEmptyBodyFixer` (#7226) +* bug: `PhpdocInlineTagNormalizerFixer` - do not break tags (#7227) +* docs: Add allowed values of tags in the `phpdoc_align` (#7120) +* docs: Add extra information for GitLab reporter's integration with GitLab Code Quality (#7172) +* docs: Change the single backticks to double in description of the rules option (#7173) +* docs: Condensed output for rule sets' list that fixer is included in (#7182) +* docs: Improve contributing guide (#7204) +* docs: `MethodArgumentSpaceFixer` - mention PSR in Fixer definition (#7157) +* DX: add first auto-review tests for composer.json file (#7210) +* DX: add `YieldFromArrayToYieldsFixer` to `PhpCsFixer` set (#7115) +* DX: Allow OS conditions for integration tests (#7161) +* DX: Apply current CS rules (#7178) +* DX: Apply suggestions from PR 7210 (#7213) +* DX: apply `ReturnToYieldFromFixer` (#7181) +* DX: Do not mark "long term ideas" as stale (#7206) +* DX: enable `HeredocIndentationFixer` for the codebase (#7195) +* DX: enable `UseArrowFunctionsFixer` for the codebase (#7194) +* DX: few phpstan fixes (#7208) +* DX: fix contravariant types in PHPDocs (#7167) +* DX: Fix detecting trailing spaces (#7216) +* DX: Fix some PHPStan issues (#7180) +* DX: Get rid of deprecation warnings in Mess Detector (#7215) +* DX: Improve Composer scripts (#7214) +* DX: Improve Mess Detector Integration (#7224) +* DX: Introduce Composer scripts as common DX (#6839) +* DX: refactor `ErrorOutputTest` (#7183) +* DX: remove unnecessary arrays from data providers (#7170) +* DX: update `CurlyBracesPositionFixer` code samples (#7198) +* DX: update `HeredocIndentationFixer` code samples (#7197) +* DX: update `PhpdocToReturnTypeFixer` code samples (#7199) +* feature: add at least one space around binary operators (#7175) +* feature: BlankLineBeforeStatementFixer - take into account comment before statement (#7166) +* feature: Introduce `ReturnToYieldFromFixer` (#7168) +* feature: Introduce `SpacesInsideParenthesesFixer` (#5709) +* feature: Support array destructuring in `trim_array_spaces` (#7218) +* feature: `BlankLineBeforeStatementFixer` - skip enum cases (#7203) +* minor: more arrow function usage (#7223) +* minor: PhpdocAlignFixerTest - convert CUSTOM tags test to not rely on non-custom tag from TAGS_WITH_NAME (#7209) +* minor: use JSON_THROW_ON_ERROR for trivial cases (#7221) +* minor: use more spread operator (#7222) + +Changelog for v3.22.0 +--------------------- + +* DX: add proper test for `SelfAccessorFixer` must run before `SelfAccessorFixer` (#7153) +* DX: FixerFactoryTest - apply CS (#7154) +* feature: Introduce `PhpUnitDataProviderReturnTypeFixer` (#7156) +* feature: Introduce `YieldFromArrayToYieldsFixer` (#7114) + +Changelog for v3.21.3 +--------------------- + +* Revert "DX: encourage to provide wider description" (#7155) + +Changelog for v3.21.2 +--------------------- + +* docs: check format of FixerDefinition::getDescription() (#7127) +* DX: add phpstan/phpstan-strict-rules (#7143) +* DX: allow for progressive cache (#7132) +* DX: Copy-pasteable `class::getPriority` for phpDoc diffs (#7148) +* DX: do not allow linebreak at the beginning of code sample (#7126) +* DX: encourage to provide wider description (#7128) +* DX: fix function calls (#7136) +* DX: fix PHPDoc types issues (#7135) +* DX: improve `Tokens` checking for found tokens (#7139) +* DX: Make `AbstractFixerTestCase::getTestFile()` final (#7116) +* DX: make `array_search` call strict (#7145) +* DX: remove `empty` calls (#7138) +* DX: store cache to file only if content will get modified (#7151) +* DX: unify Preg:match in logical conditions (#7146) +* DX: use booleans in conditions (#7149) +* DX: Use ParaUnit to speed up tests (#6883) +* DX: Use relative fixture path as integration test case's name (#7147) +* DX: use strict assertions (#7144) +* DX: `AbstractIntegrationTestCase::provideIntegrationCases` - yield over array, better typehinting (#7150) + +Changelog for v3.21.1 +--------------------- + +experimental release + +* Require PHP ^8.0.1 + +Changelog for v3.21.0 +--------------------- + +* bug: Fix and enhance Gitlab reporter (#7089) +* bug: Import with different case must not be removed by non-risky fixer (#7095) +* bug: ordered imports fixer top group only (#7023) +* bug: `FinalPublicMethodForAbstractClassFixer` - fix for readonly classes (#7123) +* DX: do not nest ".editorconfig" files (#7112) +* DX: exclude Dockerfile from dist (#7113) +* DX: fix checkbashisms installation (#7102) +* DX: fix Smoke tests for various git default branch name (#7119) +* DX: Fix `FileRemovalTest` (do not fail when running it standalone) (#7104) +* DX: Progress output refactor (#6848) +* DX: Rename abstract test classes to `*TestCase` convention (#7100) +* DX: test all PHPUnit migration sets (#7107) +* DX: [Docker] Distinguish Alpine version between PHP versions (#7105) +* feature: Create cache path if it does not exist (#7109) +* feature: Introduce `NullableTypeDeclarationFixer` (#7002) +* feature: Introduce `TypeDeclarationSpacesFixer` (#7001) +* feature: `BlankLineBetweenImportGroupsFixer` - keep indent (#7122) +* minor: Parse callable using full phpdoc grammar (#7094) +* minor: PHP8.3 const type tokenizing (#7055) + +Changelog for v3.20.0 +--------------------- + +* DX: fix priority of `FinalClassFixer` (#7091) +* DX: use FAST_LINT_TEST_CASES=1 for CI run on macOS (#7092) +* feature: SingleLineEmptyBodyFixer - support interfaces, traits and enums (#7096) +* feature: `NullableTypeDeclarationForDefaultNullValue` - support for nullability in union types (#5819) + +Changelog for v3.19.2 +--------------------- + +* bug: NoMultipleStatementsPerLineFixer must run before CurlyBracesPositionFixer (#7087) +* bug: PhpdocAddMissingParamAnnotationFixer - fix for promoted properties (#7090) +* DX: fix priority of SingleBlankLineBeforeNamespaceFixer (#7088) +* minor: Parse all phpdoc types using full grammar (#7010) + +Changelog for v3.19.1 +--------------------- + +* bug: CurlyBracesPositionFixer must run before StatementIndentationFixer (#7085) + +Changelog for v3.19.0 +--------------------- + +* bug: SelfAccessorFixer - fix for union types (#7080) +* DX: add `php_unit_data_provider_name` to `@PhpCsFixer:risky` set (#7069) +* DX: make data providers return type "iterable" (#7072) +* DX: rename tests and data providers (#7070) +* feature: Introduce `PhpUnitDataProviderNameFixer` (#7057) + +Changelog for v3.18.0 +--------------------- + +* bug: Fix tokenizing of type hints (#7054) +* bug: CompactNullableTypehintFixer - fix for whitespace between `?` and `static` (#6993) +* bug: consider function modifiers for `statement_indentation` (#6978) +* bug: Exclude `$this` from `TernaryToNullCoalescingFixer` (#7052) +* bug: False positive on used imports when docblock includes it with mismatching case (#6909) +* bug: Fix chained calls semicolon indent in switch case (#7045) +* bug: Fix multiline_whitespace_before_semicolons for echo tags (#7019) +* bug: Fix phpDoc align when there is inconsistent spacing after comment star (#7012) +* bug: Fix phpDoc parsing without PCRE JIT (#7031) +* bug: Fix PhpdocVarWithoutNameFixer with Closure with $this (#6979) +* bug: Fix `return_assignment` not formatting when variables are used in `catch` and `finally` (#6960) +* bug: Fix `TypeExpression::allowsNull()` with nullable (#7000) +* bug: Improve definition of conflicting fixers (#7066) +* bug: LambdaNotUsedImportFixer - fix for anonymous class with a string argument (#6972) +* bug: ListFilesCommand - fix computing of relative path (#7028) +* bug: make `php_unit_namespaced` less greedy (#6952) +* bug: PhpdocToCommentFixer - fix for PHPDoc before fn (#6973) +* bug: Restructure PER-CS rule sets (#6707) +* bug: SelfStaticAccessor - fix static access inside enums (#7024) +* bug: SingleSpaceAroundConstructFixer - fix more cases involving `static` (#6995) +* bug: `FullyQualifiedStrictTypesFixer` - fix shortening when namespace is not empty and import exists (#7027) +* bug: `NoUnneededControlParenthesesFixer` PHP8.0 null-safe operator (#7056) +* bug: `PhpdocToCommentFixer` support for enum cases (#7040) +* DX: add more tests to CommentsAnalyzer (#7041) +* DX: Cleanup duplicate files in finder (#7042) +* DX: ControlCaseStructuresAnalyzerTest - cleanup (#6874) +* DX: Fix warning when running test on PHP<8 (#7008) +* DX: handle `@` in PR title (#6982) +* DX: officially deprecate internal Utils anti-pattern class (#7039) +* DX: Remove Fabbot.io conditional configuration (#7038) +* DX: rename data providers (#7058) +* DX: Use `actions/stale` to handle stale issues and pull requests (#5085) +* DX: Use `Utils::naturalLanguageJoin()` in implode calls (#7032) +* feature: Add support for custom method placement in `ordered_class_elements` (#6360) +* feature: Allow case sensitive order for OrderedClassElementsFixer (#7020) +* feature: PHP8.3 - Add CT and block type for `Dynamic class constant fetch` (#7004) +* feature: Support attributes in `FinalClassFixer` (#6893) +* minor: "Callback" must not be fixed to "callback" by default (#7011) +* minor: Add `Util::naturalLanguageJoin()` (#7022) +* minor: ClassDefinitionFixer - handle attributes and `readonly` in anonymous class definitions (#7014) +* minor: FixerFactory::getFixersConflicts - better type hinting (#7044) +* minor: PHP8.3 - Fix TokensAnalyzer::isAnonymousClass support for `readonly` (#7013) +* minor: PHP8.3 - Typed class constants - handle nullable by transformer (#7009) +* minor: Reduce phpDoc type parser complexity from O(n^2) to O(nlog(n)) (#6988) +* minor: ReturnAssignmentFixer - Better handling of anonymous classes (#7015) +* minor: Transfer `HelpCommand::toString()` to `Utils` (#7034) +* minor: Unify "blank lines before namespace" fixers (#7053) +* minor: `SelfStaticAccessorFixer` improvements for enums (#7026) +* minor: `SingleSpaceAroundConstructFixer` - support space before `as` (#7029) +* minor: `UseArrowFunctionsFixer` - run before `FunctionDeclarationFixer` (#7065) + +Changelog for v3.17.0 +--------------------- + +* bug: Allow string quote to be escaped within phpdoc constant (#6798) +* bug: ConfigurationResolver - fix running without cache (#6915) +* bug: Fix array/object shape phpdoc type parse (#6962) +* bug: Fix FullyQualifiedStrictTypesFixer common prefix bug (#6898) +* bug: Fix non-parenthesized callable return type parse (#6961) +* bug: Fix parsing of edge cases phpdoc types (#6977) +* bug: FullyQualifiedStrictTypesFixer - fix for FQCN type with class with the same name being imported (#6923) +* bug: GroupImportFixer - support for aliased imports (#6951) +* bug: MultilineWhitespaceBeforeSemicolonsFixer - fix chained calls (#6926) +* bug: MultilineWhitespaceBeforeSemicolonsFixer - fix for discovering multi line calls (#6938) +* bug: NoBreakCommentFixer - fix for nested match (#6899) +* bug: NoExtraBlankLinesFixer - fix for attribute in abstract function (#6920) +* bug: PhpdocTypesFixer - handle types with no space between type and variable (#6922) +* bug: PhpUnitMockShortWillReturnFixer - fix for trailing commas (#6900) +* bug: StatementIndentationFixer - fix comments at the end of if/elseif/else blocks (#6918) +* bug: StatementIndentationFixer - fix for multiline arguments starting with "new" keyword (#6913) +* bug: StatementIndentationFixer - fix for multiline arguments starting with "new" keyword preceded by class instantiation (#6914) +* bug: VoidReturnFixer - fix for intervening attributes (#6863) +* docs: improve code samples for MultilineWhitespaceBeforeSemicolonsFixer (#6919) +* docs: improve cookbook (#6880) +* DX: add cache related tests (#6916) +* DX: Apply `self_static_accessor` fixer to the project (again) (#6927) +* DX: cancel running builds on subsequent pushes in CI (#6940) +* DX: convert more `static` to `self` assert calls (#6931) +* DX: fix GitHub Actions errors and warnings (#6917) +* DX: fix Unsafe call to private method errors reported by PHPStan (#6879) +* DX: Improve performance of FunctionsAnalyzer (#6939) +* DX: improve test method names to avoid confusion (#6974) +* DX: Include self_static_accessor fixer in PhpCsFixer set (#6882) +* DX: make data providers static with straight-forward changes (#6907) +* DX: Mark Tokens::getNamespaceDeclarations as @internal (#6949) +* DX: PHPStan improvements (#6868) +* DX: refactor PhpdocAlignFixerTest (#6925) +* DX: Remove @inheritdoc PHPDoc (#6955) +* DX: Run AutoReview tests only once (#6889) +* DX: simplify EncodingFixer (#6956) +* DX: update Symfony rule set (#6958) +* DX: Use $tokens->getNamespaceDeclarations() to improve performance (#6942) +* DX: use force option for php_unit_data_provider_static in PHPUnit 10.0 migration set (#6908) +* DX: use only PHP modules that are required (#6954) +* DX: use PHPUnit's "requires" instead of "if" condition (#6975) +* feature: Add align_multiline_comment rule to @Symfony (#6875) +* feature: Add no_null_property_initialization rule to @Symfony (#6876) +* feature: Add operator_linebreak rule to @Symfony (#6877) +* feature: add SingleLineEmptyBodyFixer (#6933) +* feature: DescribeCommand - allow describing custom fixers (#6957) +* feature: Introduce `OrderedTypesFixer` (#6571) +* feature: Order of PHPDoc @param annotations (#3909) +* feature: Parse parenthesized & conditional phpdoc type (#6796) +* feature: PhpUnitInternalClassFixer - add empty line before PHPDoc (#6924) +* feature: [PhpdocAlignFixer] Add support for every tag (#6564) +* minor: align NoSuperfluousPhpdocTagsFixer with actual Symfony configuration (#6953) +* minor: do not add empty line in PHPDoc when adding annotation in PHPUnit class (#6928) +* minor: PhpdocAlignFixer - support cases with type and variable separated with no space (#6921) +* minor: PhpdocSeparationFixer - add integration tests (#6929) +* minor: update PHPStan (to fix CI on master branch) (#6901) +* minor: Use single Dockerfile with multiple build targets (#6840) + Changelog for v3.16.0 --------------------- @@ -172,7 +1404,7 @@ Changelog for v3.11.0 * bug: Fix MethodChainingIndentationFixer with arrow functions and class instantiation (#5587) * bug: MethodChainingIndentationFixer - Fix bug with attribute access (#6573) * bug: NoMultilineWhitespaceAroundDoubleArrowFixer - fix for single line comment (#6589) -* bug: TypeAlternationTransformer - TypeIntersectionTransforme - Bug: handle attributes (#6579) +* bug: TypeAlternationTransformer - TypeIntersectionTransformer - Bug: handle attributes (#6579) * bug: [BinaryOperatorFixer] Fix more issues with scoped operators (#6559) * docs: Remove `$` from console command snippets (#6600) * docs: Remove `$` from console command snippets in documentation (#6599) @@ -231,7 +1463,7 @@ Changelog for v3.9.5 * DX: Narrow docblock types in Runner and Report (#6465) * DX: Narrow docblock types in Tokenizer (#6293) * minor: extract NoMultipleStatementsPerLineFixer from BracesFixer (#6458) -* minor: Let PhpdocLineSpan fixer detect docblocks when seperator from token with attribute (#6343) +* minor: Let PhpdocLineSpan fixer detect docblocks when separator from token with attribute (#6343) Changelog for v3.9.4 -------------------- @@ -313,7 +1545,7 @@ Changelog for v3.7.0 * bug #6112 [BinaryOperatorSpacesFixer] Fix align of `=` inside calls of methods (VincentLanglet) * bug #6279 ClassReferenceNameCasingFixer - Fix for double arrow (SpacePossum) -* bug #6280 Fix bunch of enum issus (SpacePossum) +* bug #6280 Fix bunch of enum issues (SpacePossum) * bug #6283 ClassReferenceNameCasingFixer - detect imports (SpacePossum) * feature #5892 NewWithBracesFixer - option to remove braces (jrmajor) * feature #6081 Allow multiline constructor arguments in an anonymous classes (jrmajor, SpacePossum) @@ -343,7 +1575,7 @@ Changelog for v3.6.0 * bug #6241 NoSuperfluousPhpdocTagsFixer - fix for reference and splat operator (kubawerlos) * bug #6243 PhpdocTypesOrderFixer - fix for intersection types (kubawerlos) * bug #6254 PhpUnitDedicateAssertFixer - remove `is_resource`. (drupol) -* bug #6264 TokensAnalyzer - fix isConstantInvocation detection for mulitple exce… (SpacePossum) +* bug #6264 TokensAnalyzer - fix isConstantInvocation detection for multiple exce… (SpacePossum) * bug #6265 NullableTypeDeclarationForDefaultNullValueFixer - handle "readonly" a… (SpacePossum) * bug #6266 SimplifiedIfReturnFixer - handle statement in loop without braces (SpacePossum) * feature #6262 ClassReferenceNameCasingFixer - introduction (SpacePossum) @@ -365,7 +1597,7 @@ Changelog for v3.5.0 * bug #6165 DeclareEqualNormalizeFixer - fix for declare having multiple directives (kubawerlos) * bug #6170 NonPrintableCharacterFixer - fix for string in single quotes, having non-breaking space, linebreak, and single quote inside (kubawerlos) * bug #6181 UseTransformer - Trait import in enum fix (PHP8.1) (SpacePossum) -* bug #6188 PhpdocTo(Param|Property|Return)TypeFixer - fix for type intersections (kubawerlos) +* bug #6188 `PhpdocTo(Param|Property|Return)TypeFixer` - fix for type intersections (kubawerlos) * bug #6202 SquareBraceTransformer - fix for destructing square brace after double arrow (kubawerlos) * bug #6209 OrderedClassElementsFixer - PHP8.0 support abstract private methods in traits (SpacePossum) * bug #6224 ArgumentsAnalyzer - support PHP8.1 readonly (SpacePossum) @@ -421,7 +1653,7 @@ Changelog for v3.4.0 * minor #6109 Add return type to `DummyTestSplFileInfo::getRealPath()` (derrabus) * minor #6115 Remove PHP 7.2 polyfill (derrabus) * minor #6116 CI: remove installation of mbstring polyfill in build script, it's required dependency now (keradus) -* minor #6119 OrderedClassElementsFixer - PHPUnit assert(Pre|Post)Conditions methods support (meyerbaptiste) +* minor #6119 OrderedClassElementsFixer - PHPUnit `assert(Pre|Post)Conditions` methods support (meyerbaptiste) * minor #6121 Use Tokens::ensureWhitespaceAtIndex to simplify code (kubawerlos) * minor #6127 Remove 2nd parameter to XdebugHandler constructor (phil-davis) * minor #6129 clean ups (SpacePossum) @@ -544,7 +1776,7 @@ Changelog for v3.2.0 * minor #6029 PhpUnitDedicateAssertFixer - add "assertStringContainsString" and "as… (SpacePossum) * minor #6030 SingleSpaceAfterConstructFixer - Add `switch` support (SpacePossum) * minor #6033 ArgumentsAnalyzerTest - add more tests (SpacePossum) -* minor #6034 7.0|7.1 - cleanup tests (SpacePossum) +* minor #6034 Cleanup tests for PHP 7.0 and 7.1 (SpacePossum) * minor #6035 Documentation generation split up and add list. (SpacePossum) * minor #6048 Fix "can not" spelling (mvorisek) @@ -1003,7 +2235,7 @@ Changelog for v2.17.3 Changelog for v2.17.2 --------------------- -* bug #5345 CleanNamespaceFixer - preserve traling comments (SpacePossum) +* bug #5345 CleanNamespaceFixer - preserve trailing comments (SpacePossum) * bug #5348 PsrAutoloadingFixer - fix for class without namespace (kubawerlos) * bug #5362 SingleSpaceAfterConstructFixer: Do not adjust whitespace before multiple multi-line extends (localheinz, SpacePossum) * minor #5314 Enable testing with PHPUnit 9.x (sanmai) @@ -1101,7 +2333,6 @@ Changelog for v2.17.0 * minor #5323 NoUselessSprintfFixer - Fix test on PHP5.6 (SpacePossum) * minor #5326 DX: relax composer requirements to not block installation under PHP v8, support for PHP v8 is not yet ready (keradus) - Changelog for v2.16.10 ---------------------- @@ -1725,7 +2956,7 @@ Changelog for v2.15.4 * minor #4564 Move readme-update command to Section 3 (iwasherefirst2) * minor #4566 Update symfony ruleset (gharlan) * minor #4570 Command::execute() should always return an integer (derrabus) -* minor #4580 Add suport for true/false return type hints. (SpacePossum) +* minor #4580 Add support for true/false return type hints. (SpacePossum) * minor #4584 Increase PHPStan level to 1 (julienfalque) * minor #4585 Fix deprecation notices (julienfalque) * minor #4587 Output details - Explain why a file was skipped (SpacePossum) @@ -1886,8 +3117,8 @@ Changelog for v2.14.3 * minor #4340 Travis: build against 7.4snapshot instead of nightly (Slamdunk) * minor #4351 code grooming (SpacePossum) * minor #4353 Add more priority tests (SpacePossum) -* minor #4364 DX: MethodChainingIndentationFixer - remove unneccesary loop (Sijun Zhu) -* minor #4366 Unset the auxillary variable $a (GrahamCampbell) +* minor #4364 DX: MethodChainingIndentationFixer - remove unnecessary loop (Sijun Zhu) +* minor #4366 Unset the auxiliary variable $a (GrahamCampbell) * minor #4368 Fixed TypeShortNameResolverTest::testResolver (GrahamCampbell) * minor #4380 PHP7.4 - Add "str_split" => "mb_str_split" mapping. (SpacePossum) * minor #4381 PHP7.4 - Add support for magic methods (un)serialize. (SpacePossum) @@ -2061,7 +3292,7 @@ Changelog for v2.13.0 * feature #3812 Add FopenFlagOrderFixer & FopenFlagsFixer (SpacePossum) * feature #3826 Add CombineNestedDirnameFixer (gharlan) * feature #3833 BinaryOperatorSpacesFixer - Add "no space" fix strategy (SpacePossum) -* feature #3841 NoAliasFunctionsFixer - add opt in option for ext-mbstring aliasses (SpacePossum) +* feature #3841 NoAliasFunctionsFixer - add opt in option for ext-mbstring aliases (SpacePossum) * feature #3876 NativeConstantInvocationFixer - add the scope option (stof, keradus) * feature #3886 Add PhpUnitMethodCasingFixer (Slamdunk) * feature #3907 Add ImplodeCallFixer (kubawerlos) @@ -2142,8 +3373,8 @@ Changelog for v2.12.9 * minor #4340 Travis: build against 7.4snapshot instead of nightly (Slamdunk) * minor #4351 code grooming (SpacePossum) * minor #4353 Add more priority tests (SpacePossum) -* minor #4364 DX: MethodChainingIndentationFixer - remove unneccesary loop (Sijun Zhu) -* minor #4366 Unset the auxillary variable $a (GrahamCampbell) +* minor #4364 DX: MethodChainingIndentationFixer - remove unnecessary loop (Sijun Zhu) +* minor #4366 Unset the auxiliary variable $a (GrahamCampbell) * minor #4368 Fixed TypeShortNameResolverTest::testResolver (GrahamCampbell) * minor #4380 PHP7.4 - Add "str_split" => "mb_str_split" mapping. (SpacePossum) * minor #4393 DX: add missing explicit return types (kubawerlos) @@ -2398,7 +3629,7 @@ Changelog for v2.11.2 * bug #3673 PhpdocScalarFixer - Add "types" option (julienfalque, keradus) * bug #3674 YodaStyleFixer - Fix variable detection for multidimensional arrays (julienfalque, SpacePossum) * bug #3684 PhpUnitStrictFixer - Do not fix if not correct # of arguments are used (SpacePossum) -* bug #3708 EspaceImplicitBackslashesFixer - Fix escaping multiple backslashes (julienfalque) +* bug #3708 EscapeImplicitBackslashesFixer - Fix escaping multiple backslashes (julienfalque) * bug #3715 SingleImportPerStatementFixer - Fix handling whitespace before opening brace (julienfalque) * bug #3731 PhpdocIndentFixer - crash fix (SpacePossum) * bug #3755 YodaStyleFixer - handle space between var name and index (SpacePossum) @@ -2532,7 +3763,7 @@ Changelog for v2.10.3 * minor #3484 Create Tokens::findBlockStart (ntzm) * minor #3512 Add missing array typehints (ntzm) * minor #3513 Making AppVeyor happy (kubawerlos) -* minor #3516 Use null|type instead of ?type in PHPDocs (ntzm) +* minor #3516 Use `null|type` instead of `?type` in PHPDocs (ntzm) * minor #3518 FixerFactoryTest - Test each priority test file is listed as test (SpacePossum) * minor #3519 Fix typo (SpacePossum) * minor #3520 Fix typos: ran vs. run (SpacePossum) @@ -2717,7 +3948,7 @@ Changelog for v2.8.1 * bug #3199 TokensAnalyzer - getClassyElements (SpacePossum) * bug #3208 BracesFixer - Fix for instantiation in control structures (julienfalque, SpacePossum) -* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (|) (ntzm) +* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (ntzm) * bug #3216 AbstractLinesBeforeNamespaceFixer - add min. and max. option, not only single target count (SpacePossum) * bug #3217 TokenizerLinter - fix lack of linting when code is cached (SpacePossum, keradus) * minor #3200 Skip slow test when Xdebug is loaded (julienfalque) @@ -2764,7 +3995,7 @@ Changelog for v2.7.4 * bug #3199 TokensAnalyzer - getClassyElements (SpacePossum) * bug #3208 BracesFixer - Fix for instantiation in control structures (julienfalque, SpacePossum) -* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (|) (ntzm) +* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (ntzm) * bug #3216 AbstractLinesBeforeNamespaceFixer - add min. and max. option, not only single target count (SpacePossum) * bug #3217 TokenizerLinter - fix lack of linting when code is cached (SpacePossum, keradus) * minor #3200 Skip slow test when Xdebug is loaded (julienfalque) @@ -2786,7 +4017,7 @@ Changelog for v2.7.2 * bug #3062 BraceClassInstantiationTransformer - Fix instantiation inside method call braces case (julienfalque, keradus) * bug #3083 SingleBlankLineBeforeNamespaceFixer - Fix handling namespace right after opening tag (mlocati) * bug #3109 SwitchCaseSemicolonToColonFixer - Fix bug with nested constructs (SpacePossum) -* bug #3117 Multibyte character in array key makes alignment incorect (kubawerlos) +* bug #3117 Multibyte character in array key makes alignment incorrect (kubawerlos) * bug #3123 Cache - File permissions (SpacePossum) * bug #3138 NoHomoglyphNamesFixer - fix crash on non-ascii but not mapped either (SpacePossum) * bug #3172 IndentationTypeFixer - do not touch whitespace that is not indentation (SpacePossum) @@ -2986,7 +4217,7 @@ Changelog for v2.3.3 * bug #2807 NoUselessElseFixer - Fix detection of conditional block (SpacePossum) * bug #2809 Phar release - fix readme generation (SpacePossum, keradus) * bug #2827 MethodArgumentSpaceFixer - Always remove trailing spaces (julienfalque) -* bug #2835 SelfAcessorFixer - class property fix (mnabialek) +* bug #2835 SelfAccessorFixer - class property fix (mnabialek) * bug #2848 PhpdocIndentFixer - fix edge case with inline phpdoc (keradus) * bug #2849 BracesFixer - Fix indentation issues with comments (julienfalque) * bug #2851 Tokens - ensureWhitespaceAtIndex (GrahamCampbell, SpacePossum) @@ -3175,7 +4406,7 @@ Changelog for v2.2.17 * minor #3435 Add tests for general_phpdoc_annotation_remove (BackEndTea) * minor #3484 Create Tokens::findBlockStart (ntzm) * minor #3512 Add missing array typehints (ntzm) -* minor #3516 Use null|type instead of ?type in PHPDocs (ntzm) +* minor #3516 Use `null|type` instead of `?type` in PHPDocs (ntzm) * minor #3518 FixerFactoryTest - Test each priority test file is listed as test (SpacePossum) * minor #3520 Fix typos: ran vs. run (SpacePossum) * minor #3521 Use HTTPS (carusogabriel) @@ -3268,7 +4499,7 @@ Changelog for v2.2.10 * bug #3199 TokensAnalyzer - getClassyElements (SpacePossum) * bug #3208 BracesFixer - Fix for instantiation in control structures (julienfalque, SpacePossum) -* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (|) (ntzm) +* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (ntzm) * bug #3216 AbstractLinesBeforeNamespaceFixer - add min. and max. option, not only single target count (SpacePossum) * bug #3217 TokenizerLinter - fix lack of linting when code is cached (SpacePossum, keradus) * minor #3200 Skip slow test when Xdebug is loaded (julienfalque) @@ -3374,7 +4605,7 @@ Changelog for v2.2.5 * bug #2807 NoUselessElseFixer - Fix detection of conditional block (SpacePossum) * bug #2809 Phar release - fix readme generation (SpacePossum, keradus) * bug #2827 MethodArgumentSpaceFixer - Always remove trailing spaces (julienfalque) -* bug #2835 SelfAcessorFixer - class property fix (mnabialek) +* bug #2835 SelfAccessorFixer - class property fix (mnabialek) * bug #2848 PhpdocIndentFixer - fix edge case with inline phpdoc (keradus) * bug #2849 BracesFixer - Fix indentation issues with comments (julienfalque) * bug #2851 Tokens - ensureWhitespaceAtIndex (GrahamCampbell, SpacePossum) @@ -3463,7 +4694,9 @@ Changelog for v2.2.2 -------------------- Warning, this release breaks BC due to introduction of: + * minor #2554 Add short diff. output format (SpacePossum, keradus) + That PR was reverted in v2.2.3, which should be used instead of v2.2.2. * bug #2545 RuleSet - change resolvement (SpacePossum) @@ -3662,7 +4895,7 @@ Changelog for v2.0.1 * minor #2499 FileSpecificCodeSample - Specify class name relative to root namespace (localheinz, keradus) * minor #2506 SCA (SpacePossum) * minor #2515 Fix code indentation (keradus) -* minor #2521 SCA trailing spces check - ouput lines with trailing white space (SpacePossum) +* minor #2521 SCA trailing spces check - output lines with trailing white space (SpacePossum) * minor #2522 Fix docs and small code issues (keradus) Changelog for v2.0.0 @@ -3713,7 +4946,7 @@ Changelog for v2.0.0 * feature #1628 Added OrderedClassElementsFixer (gharlan) * feature #1742 path argument is used to create an intersection with existing finder (keradus, gharlan) * feature #1779 Added GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocAnnotationRenameFixer (keradus) -* feature #1811 Added NoSpacesInsideOfssetFixer (phansys) +* feature #1811 Added NoSpacesInsideOffsetFixer (phansys) * feature #1819 Added DirConstantFixer, ModernizeTypesCastingFixer, RandomApiMigrationFixer (kalessil, SpacePossum, keradus) * feature #1825 Added junit format (ekho) * feature #1862 FixerFactory - Do not allow conflicting fixers (SpacePossum) @@ -3830,7 +5063,7 @@ Changelog for v2.0.0 * minor #1846 FileFilterIterator - Corrected an iterator typehint (GrahamCampbell) * minor #1848 DocBlock - Remove some old unused phpdoc tags (GrahamCampbell) * minor #1856 NoDuplicateSemicolonsFixer - Remove overcomplete fixer (SpacePossum) -* minor #1861 Fix: Ofsset should be Offset (localheinz) +* minor #1861 Fix: Offset should be Offset (localheinz) * minor #1867 Print non-report output to stdErr (SpacePossum, keradus) * minor #1873 Enhancement: Show path to cache file if it exists (localheinz) * minor #1875 renamed Composer package (fabpot) @@ -3893,7 +5126,7 @@ Changelog for v2.0.0 * minor #2318 *TestCase - Reduce visibility of setUp() (localheinz) * minor #2319 Code grooming (keradus) * minor #2322 DX: use whitemessy aware assertion (keradus) -* minor #2324 Echo|Print*Fixer - unify printing fixers (SpacePossum, keradus) +* minor #2324 `Echo|Print*Fixer` - unify printing fixers (SpacePossum, keradus) * minor #2337 Normalize rule naming (keradus) * minor #2338 Drop hacks for unsupported HHVM (keradus) * minor #2339 Add some Fixer descriptions (SpacePossum, keradus) @@ -3971,7 +5204,7 @@ Changelog for v1.12.3 * bug #2209 LinefeedFixer - Fix in a safe way (SpacePossum) * bug #2228 NoEmptyLinesAfterPhpdocs, SingleBlankLineBeforeNamespace - Fix priority (SpacePossum) * bug #2230 FunctionDeclarationFixer - Fix T_USE case (SpacePossum) -* bug #2232 Add a test for style of varaible decalration : var (daiglej) +* bug #2232 Add a test for style of variable declaration : var (daiglej) * bug #2246 Fix itest requirements (keradus) * minor #2238 .gitattributes - specified line endings (keradus) * minor #2239 IntegrationCase - no longer internal (keradus) @@ -4260,7 +5493,7 @@ Changelog for v1.10.1 * bug #1444 OrderedUseFixer - fix next case (keradus) * bug #1441 BracesFixer - fix next case (keradus) * bug #1422 AlignDoubleArrowFixer - fix handling of nested array (SpacePossum) -* bug #1425 PhpdocInlineTagFixerTest - fix case when met inalid PHPDoc (keradus) +* bug #1425 PhpdocInlineTagFixerTest - fix case when met invalid PHPDoc (keradus) * bug #1419 AlignDoubleArrowFixer, AlignEqualsFixer - fix priorities (keradus) * bug #1415 BlanklineAfterOpenTagFixer - Do not add a line break if there is one already. (SpacePossum) * bug #1410 PhpdocIndentFixer - Fix for open tag (SpacePossum) @@ -4408,7 +5641,7 @@ Changelog for v1.5.1 -------------------- * bug #1054 VisibilityFixer - fix var with array value assigned (localheinz, keradus) -* bug #1048 MultilineArrayTrailingCommaFixer, SingleArrayNoTrailingCommaFixer - using heredoc inside array not cousing to treat it as multiline array (keradus) +* bug #1048 MultilineArrayTrailingCommaFixer, SingleArrayNoTrailingCommaFixer - using heredoc inside array not causing to treat it as multiline array (keradus) * bug #1043 PhpdocToCommentFixer - also check other control structures, besides foreach (ceeram) * bug #1045 OrderedUseFixer - fix namespace order for trailing digits (rusitschka) * bug #1035 PhpdocToCommentFixer - Add static as valid keyword for structural element (ceeram) @@ -4442,7 +5675,7 @@ Changelog for v1.5 * minor #957 Fix Fixers methods order (GrahamCampbell) * minor #944 Enable caching of composer downloads on Travis (stof) * minor #941 EncodingFixer - enhance tests (keradus) -* minor #938 Psr0Fixer - remove unneded assignment (keradus) +* minor #938 Psr0Fixer - remove unneeded assignment (keradus) * minor #936 FixerTest - test description consistency (keradus) * minor #933 NoEmptyLinesAfterPhpdocsFixer - remove unneeded code, clarify description (ceeram) * minor #934 StdinFileInfo::getFilename - Replace phpdoc with normal comment and add back empty line before return (ceeram) @@ -4485,7 +5718,7 @@ Changelog for v1.4 * bug #945 Skip files containing __halt_compiler() on PHP 5.3 (stof) * bug #946 BracesFixer - fix typo in exception name (keradus) * bug #940 Tokens::setCode - apply missing transformation (keradus) -* bug #908 BracesFixer - fix invalide inserting brace for control structure without brace and lambda inside of it (keradus) +* bug #908 BracesFixer - fix invalid inserting brace for control structure without brace and lambda inside of it (keradus) * bug #903 NoEmptyLinesAfterPhpdocsFixer - fix bug with Windows style lines (GrahamCampbell) * bug #895 [PSR-2] Preserve blank line after control structure opening brace (marcaube) * bug #892 Fixed the double arrow multiline whitespace fixer (GrahamCampbell) @@ -4549,7 +5782,7 @@ Changelog for v1.2 * minor #779 Fixed a docblock type (GrahamCampbell) * minor #765 Typehinting in FileCacheManager, remove unused variable in Tokens (keradus) * minor #764 SelfUpdateCommand - get local version only if remote version was successfully obtained (keradus) -* minor #761 aling => (keradus) +* minor #761 align => (keradus) * minor #757 Some minor code simplify and extra test (keradus) * minor #713 Download php-cs-fixer.phar without sudo (michaelsauter) * minor #742 Various Minor Improvements (GrahamCampbell) diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md index a9c27e34..f0f5a429 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md @@ -1,99 +1,98 @@ # Contributions Are Welcome! -If you need any help, don't hesitate to ask the community on [Gitter](https://gitter.im/PHP-CS-Fixer/Lobby). +If you need any help, don't hesitate to ask the community using [GitHub Discussions](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/categories/q-a). -## Quick Guide +## Glossary ### Fixer -A *fixer* is a class that tries to fix one code style issue (a ``Fixer`` class -must implement ``FixerInterface``). +A *fixer* is a class that tries to fix a single code style issue (a ``Fixer`` class must implement ``FixerInterface``). + +### Ruleset + +A *ruleset* is a collection of rules (*fixers*) that may be referenced in the config file similarly to a single *fixer*. When you work on existing fixer please keep in mind it can be a part of a *ruleset*(s) and changes may affect many users. When working on new *fixer* please consider if it should be added to some *ruleset*(s). ### Config -A *config* knows about the code style rules and the files and directories that -must be scanned by the tool when run in the directory of your project. It is -useful for projects that follow a well-known directory structures (like for -Symfony projects for instance). - -### How-To - -* [Fork](https://help.github.com/articles/fork-a-repo/) the repo. -* [Checkout](https://git-scm.com/docs/git-checkout) the branch you want to make changes on: - * If you are fixing a bug or typo, improving tests or for any small tweak: the lowest branch where the changes can be applied. Once your Pull Request is accepted, the changes will get merged up to highest branches. - * `master` in other cases (new feature, deprecation, or backwards compatibility breaking changes). Note that most of the time, `master` represents the next minor release of PHP CS Fixer, so Pull Requests that break backwards compatibility might be postponed. -* Install dependencies: `composer install`. -* Create a new branch, e.g. `feature-foo` or `bugfix-bar`. -* Make changes. -* If you are adding functionality or fixing a bug - add a test! Prefer adding new test cases over modifying existing ones. -* Make sure there is no wrong file permissions in the repository: `./dev-tools/check_file_permissions.sh`. -* Make sure there is no trailing spaces in the code: `./dev-tools/check_trailing_spaces.sh`. -* Update documentation: `php dev-tools/doc.php`. This requires the highest version of PHP supported by PHP CS Fixer. If it is not installed on your system, you can run it in a Docker container instead: `docker-compose run php-8.2 php dev-tools/doc.php`. -* Install dev tools: `dev-tools/install.sh` -* Run static analysis using PHPStan: `php -d memory_limit=256M dev-tools/vendor/bin/phpstan analyse` -* Check if tests pass: `vendor/bin/phpunit`. -* Fix project itself: `php php-cs-fixer fix`. +A *config* knows about the code style rules and the files and directories that must be scanned by the tool when run in the context of your project. It is useful for projects that follow a well-known directory structures, but the tool is not limited to any specific structure, and you can configure it in a very flexible way. -## Working With Docker +## How to contribute -This project provides a Docker setup that allows working on it using any of the supported PHP versions. +> [!IMPORTANT] +> Before contributing with _really_ significant changes that require a lot of effort or are crucial from this tool's +> architecture perspective, please open [RFC on GitHub Discussion](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/categories/rfc). +> The development effort should start only after the proposal is discussed and the approach aligned. -To use it, you first need to install: +### Development - * [Docker](https://docs.docker.com/get-docker/) - * [Docker Compose](https://docs.docker.com/compose/install/) +* [Fork](https://help.github.com/articles/fork-a-repo/) this repository. You can use native Git approach or use [`gh` CLI tool](https://cli.github.com/). +* Create new branch on top of the latest revision of `master` branch (if you already had project locally, then make sure to update this branch before going to next steps). It's good when branch's name reflects intent of the changes, but this is not strict requirement since pull request provides description of the change. However, with good branch naming it's easier to work on multiple changes simultaneously. +* Install dependencies by running `composer update` (since project does not contain `composer.lock` it's better to ensure latest versions of packages by running `update` command instead of `install`). +* Make changes. Please remember that **all** changes have to be covered by tests. + * if you work on a bug fix, please start with reproducing the problem by adding failing test case(s). When you have failing test case(s), you can [create pull request](#opening-a-pull-request) just to reproduce fail in the CI. Then you can provide fix _in the subsequent commits_, it will make code review easier. It's allowed to modify existing test cases in bug fix pull request, but *only if* current behavior is proved to be invalid. + * if you work on existing fixers then don't change existing test cases, because these are contract between the maintainers and users (they ensure how tool works). Add new test cases that cover provided changes - preferred way of defining test cases is with [data provider](https://docs.phpunit.de/en/10.0/writing-tests-for-phpunit.html#data-providers) which uses `yield` with proper case description as a key (e.g. `yield 'Some specific scenario' => ['some', 'example', 'data'];`). Codebase may still contain test cases in different format, and it's totally acceptable to use `yield` approach next to existing `return` usages. +* Update documentation: `composer docs`. This requires the highest version of PHP supported by PHP CS Fixer. If it is not installed on your system, you can run it in a Docker container instead: `docker compose run php-8.2 php dev-tools/doc.php`. +* Run QA suite: `composer qa`. +* Fix project itself (if needed): `composer cs:fix`. -Make sure the versions installed support [Compose file format 3.8](https://docs.docker.com/compose/compose-file/). +### Opening a [pull request](https://help.github.com/articles/about-pull-requests/) -Next, copy [`docker-compose.override.yaml.dist`](./docker-compose.override.yaml.dist) to `docker-compose.override.yaml` -and edit it to your needs. The relevant parameters that might require some tweaking have comments to help you. +You can do some things to increase the chance that your pull request is accepted without communication ping-pong between you and the reviewers: + +* Submit [single](https://en.wikipedia.org/wiki/Single-responsibility_principle) pull request per fix or feature. +* Keep meaningful commit logs, don't use meaningless messages (e.g. `foo`, `more work`, `more work`, `more work`) and don't push complex PR as a single commit. +* Don't [amend](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---amend) commits because it makes review rounds harder - all commits from your branch will be squashed (without commit messages) during the merge. +* Follow the conventions used in the project. +* Remember about tests and documentation. +* Don't bump `PhpCsFixer\Console\Application::VERSION`, it's done during release. + +> [!IMPORTANT] +> Your pull request will have much higher chance of getting merged if you allow maintainers to push changes to your +> branch. You can do it by ticking "Allow edits and access to secrets by maintainers" checkbox, but please keep in mind +> this option is available only if your PR is created from a user's fork. If your fork is a part of organisation, then +> you can add [Fixer maintainers](https://github.com/orgs/PHP-CS-Fixer/people) as members of that repository. This way +> maintainers will be able to provide required changes or rebase your branch (only up-to-date PRs can be merged). + +## Working With Docker + +This project provides a Docker setup that allows working on it using any of the PHP versions supported by the tool. + +To use it, you first need to install [Docker](https://docs.docker.com/get-docker/) ([Docker Compose](https://docs.docker.com/compose/) is a built-in plugin of the main tool). + +Next, copy [`compose.override.dist.yaml`](./compose.override.dist.yaml) to `compose.override.yaml` and edit it to your needs. The relevant parameters that might require some tweaking have comments to help you. You can then build the images: ```console -docker-compose build --parallel +docker compose build --parallel ``` -Now you can run commands needed to work on the project. For example, say you want to run PHPUnit tests on PHP 7.4: +Now you can run commands needed to work on the project. For example, say you want to run PHPUnit tests on PHP 8.2: ```console -docker-compose run php-7.4 vendor/bin/phpunit +docker compose run php-8.2 vendor/bin/phpunit ``` Sometimes it can be more convenient to have a shell inside the container: ```console -docker-compose run php-7.4 sh -/app vendor/bin/phpunit +docker compose run php-7.4 sh +/fixer vendor/bin/phpunit ``` -The images come with an [`xdebug` script](github.com/julienfalque/xdebug/) that allows running any PHP command with -Xdebug enabled to help debug problems. +The images come with an [`xdebug` script](github.com/julienfalque/xdebug/) that allows running any PHP command with Xdebug enabled to help debug problems. ```console -docker-compose run php-7.4 xdebug vendor/bin/phpunit +docker compose run php-8.2 xdebug vendor/bin/phpunit ``` -If you're using PhpStorm, you need to create a [server](https://www.jetbrains.com/help/phpstorm/servers.html) with a -name that matches the `PHP_IDE_CONFIG` environment variable defined in the Docker Compose configuration files, which is -`php-cs-fixer` by default. +If you're using PhpStorm, you need to create a [server](https://www.jetbrains.com/help/phpstorm/servers.html) with a name that matches the `PHP_IDE_CONFIG` environment variable defined in the Docker Compose configuration files, which is `php-cs-fixer` by default. All images use port 9003 for debug connections. -## Opening a [Pull Request](https://help.github.com/articles/about-pull-requests/) - -You can do some things to increase the chance that your Pull Request is accepted the first time: - -* Submit one Pull Request per fix or feature. -* If your changes are not up to date, [rebase](https://git-scm.com/docs/git-rebase) your branch onto the parent branch. -* Follow the conventions used in the project. -* Remember about tests and documentation. -* Don't bump version. - ## Making New Fixers -There is a [cookbook](doc/cookbook_fixers.rst) with basic instructions on how to build a new fixer. Consider reading it -before opening a PR. +There is a [cookbook](doc/cookbook_fixers.rst) with basic instructions on how to build a new fixer. Consider reading it before opening a PR. ## Project's Standards diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/README.md b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/README.md index 0be52542..bee2b94e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/README.md +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/README.md @@ -4,8 +4,7 @@

-PHP Coding Standards Fixer -========================== +# PHP Coding Standards Fixer The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards; whether you want to follow PHP coding standards as defined in the PSR-1, PSR-2, etc., @@ -22,9 +21,10 @@ projects. This tool does not only detect them, but also fixes them for you. ## Supported PHP Versions * PHP 7.4 -* PHP 8.0 (except PHP 8.0.0 due to [bug in PHP tokenizer](https://bugs.php.net/bug.php?id=80462)) +* PHP 8.0 * PHP 8.1 * PHP 8.2 +* PHP 8.3 > **Note** > Each new PHP version requires a huge effort to support the new syntax. @@ -38,25 +38,24 @@ projects. This tool does not only detect them, but also fixes them for you. ### Installation -The recommended way to install PHP CS Fixer is to use [Composer](https://getcomposer.org/download/) -in a dedicated `composer.json` file in your project, for example in the -`tools/php-cs-fixer` directory: +The recommended way to install PHP CS Fixer is to use [Composer](https://getcomposer.org/download/): ```console -mkdir -p tools/php-cs-fixer -composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer +composer require --dev friendsofphp/php-cs-fixer +## or when facing conflicts in dependencies: +composer require --dev php-cs-fixer/shim ``` -For more details and other installation methods, see +For more details and other installation methods (also with Docker or behind CI), see [installation instructions](./doc/installation.rst). ### Usage Assuming you installed PHP CS Fixer as instructed above, you can run the -following command to fix the files PHP files in the `src` directory: +following command to fix the PHP files in the `src` directory: ```console -tools/php-cs-fixer/vendor/bin/php-cs-fixer fix src +./vendor/bin/php-cs-fixer fix src ``` See [usage](./doc/usage.rst), list of [built-in rules](./doc/rules/index.rst), list of [rule sets](./doc/ruleSets/index.rst) @@ -77,11 +76,11 @@ Dedicated plugins exist for: ## Community -The PHP CS Fixer is maintained on GitHub at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer. +The PHP CS Fixer is maintained on GitHub at . Bug reports and ideas about new features are welcome there. -You can reach us at https://gitter.im/PHP-CS-Fixer/Lobby about the project, -configuration, possible improvements, ideas and questions, please visit us! +You can reach us in the [GitHub Discussions](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/) regarding the +project, configuration, possible improvements, ideas and questions. Please visit us there! ## Contribute diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md index 00e0a9c5..bea1ff4f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md @@ -1,21 +1,18 @@ -UPGRADE GUIDE FROM 2.x to 3.0 -============================= +# UPGRADE GUIDE FROM 2.x to 3.0 This is guide for upgrade from version 2.x to 3.0 for using the CLI tool. *Before following this guide, install [v2.19](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/v2.19.0) and run in verbose mode (`php-cs-fixer fix -v`) or in future mode (`PHP_CS_FIXER_FUTURE_MODE=1 php-cs-fixer fix`) to identify deprecations and fix them first.* -Rename of files ---------------- +## Rename of files | 2.x | 3.0 | Description | -| ---------------- | ------------------------ | -------------------------------------- | +|------------------|--------------------------|----------------------------------------| | `.php_cs` | `.php-cs-fixer.php` | Configuration file (local) | | `.php_cs.dist` | `.php-cs-fixer.dist.php` | Configuration file (to be distributed) | | `.php_cs.cache` | `.php-cs-fixer.cache` | Cache file | -CLI options ------------ +## CLI options | 2.x | 3.0 | Description | Note | | ---------------- | --------------- | ----------------------------------------------- | -------------------------------------- | @@ -27,94 +24,93 @@ CLI options | --rules | --rules | Default value changed from @PSR2 to @PSR12 | | | --config --rules | | | No longer allowed to pass both | -Changes to rules ----------------- +## Changes to rules ### Renamed rules -Old name | New name | Note --------- | -------- | ---- -`blank_line_before_return` | `blank_line_before_statement` | use configuration `['statements' => ['return']]` -`final_static_access` | `self_static_accessor` | -`hash_to_slash_comment` | `single_line_comment_style` | use configuration `['comment_types' => ['hash']]` -`lowercase_constants` | `constant_case` | use configuration `['case' => 'lower']` -`method_separation` | `class_attributes_separation` | use configuration `['elements' => ['method']]` -`no_extra_consecutive_blank_lines` | `no_extra_blank_lines` | -`no_multiline_whitespace_before_semicolons` | `multiline_whitespace_before_semicolons` | -`no_short_echo_tag` | `echo_tag_syntax` | use configuration `['format' => 'long']` -`php_unit_ordered_covers` | `phpdoc_order_by_value` | use configuration `['annotations' => [ 'covers' ]]` -`phpdoc_inline_tag` | `general_phpdoc_tag_rename`, `phpdoc_inline_tag_normalizer` and `phpdoc_tag_type` | -`pre_increment` | `increment_style` | use configuration `['style' => 'pre']` -`psr0` | `psr_autoloading` | use configuration `['dir' => x ]` -`psr4` | `psr_autoloading` | -`silenced_deprecation_error` | `error_suppression` | -`trailing_comma_in_multiline_array` | `trailing_comma_in_multiline` | use configuration `['elements' => ['arrays']]` +| Old name | New name | Note | +|--------------------------------------------|-----------------------------------------------------------------------------------|------------------------------------------------------| +|`blank_line_before_return` | `blank_line_before_statement` | use configuration `['statements' => ['return']]` | +|`final_static_access` | `self_static_accessor` | | +|`hash_to_slash_comment` | `single_line_comment_style` | use configuration `['comment_types' => ['hash']]` | +|`lowercase_constants` | `constant_case` | use configuration `['case' => 'lower']` | +|`method_separation` | `class_attributes_separation` | use configuration `['elements' => ['method']]` | +|`no_extra_consecutive_blank_lines` | `no_extra_blank_lines` | | +|`no_multiline_whitespace_before_semicolons` | `multiline_whitespace_before_semicolons` | | +|`no_short_echo_tag` | `echo_tag_syntax` | use configuration `['format' => 'long']` | +|`php_unit_ordered_covers` | `phpdoc_order_by_value` | use configuration `['annotations' => [ 'covers' ]]` | +|`phpdoc_inline_tag` | `general_phpdoc_tag_rename`, `phpdoc_inline_tag_normalizer` and `phpdoc_tag_type` | | +|`pre_increment` | `increment_style` | use configuration `['style' => 'pre']` | +|`psr0` | `psr_autoloading` | use configuration `['dir' => x ]` | +|`psr4` | `psr_autoloading` | | +|`silenced_deprecation_error` | `error_suppression` | | +|`trailing_comma_in_multiline_array` | `trailing_comma_in_multiline` | use configuration `['elements' => ['arrays']]` | ### Removed rootless configuration -Rule | Root option | Note ------------------------------------- | -------------- | ---- -`general_phpdoc_annotation_remove` | `annotations` -`no_extra_consecutive_blank_lines` | `tokens` -`no_spaces_around_offset` | `positions` -`no_unneeded_control_parentheses` | `statements` -`ordered_class_elements` | `order` -`php_unit_construct` | `assertions` -`php_unit_dedicate_assert` | `target` | root option works differently than rootless configuration -`php_unit_strict` | `assertions` -`phpdoc_no_alias_tag` | `replacements` -`phpdoc_return_self_reference` | `replacements` -`random_api_migration` | `replacements` -`single_class_element_per_statement` | `elements` -`visibility_required` | `elements` +| Rule | Root option | Note | +|--------------------------------------| -------------- |-----------------------------------------------------------| +| `general_phpdoc_annotation_remove` | `annotations` | | +| `no_extra_consecutive_blank_lines` | `tokens` | | +| `no_spaces_around_offset` | `positions` | | +| `no_unneeded_control_parentheses` | `statements` | | +| `ordered_class_elements` | `order` | | +| `php_unit_construct` | `assertions` | | +| `php_unit_dedicate_assert` | `target` | root option works differently than rootless configuration | +| `php_unit_strict` | `assertions` | | +| `phpdoc_no_alias_tag` | `replacements` | | +| `phpdoc_return_self_reference` | `replacements` | | +| `random_api_migration` | `replacements` | | +| `single_class_element_per_statement` | `elements` | | +| `visibility_required` | `elements` | | ### Changed options -Rule | Option | Change ----- | ------ | ------ -`binary_operator_spaces` | `align_double_arrow` | option was removed, use `operators` instead -`binary_operator_spaces` | `align_equals` | option was removed use `operators` instead -`blank_line_before_statement` | `statements: die` | option `die` was removed from `statements`, use `exit` instead -`class_attributes_separation` | `elements` | option does no longer accept flat array as a value, use map instead -`class_definition` | `multiLineExtendsEachSingleLine` | option was renamed to `multi_line_extends_each_single_line` -`class_definition` | `singleItemSingleLine` | option was renamed to `single_item_single_line` -`class_definition` | `singleLine` | option was renamed to `single_line` -`doctrine_annotation_spaces` | `around_argument_assignments` | option was removed, use `before_argument_assignments` and `after_argument_assignments` instead -`doctrine_annotation_spaces` | `around_array_assignments` | option was removed, use `after_array_assignments_colon`, `after_array_assignments_equals`, `before_array_assignments_colon` and `before_array_assignments_equals` instead -`final_internal_class` | `annotation-black-list` | option was renamed, use `annotation_exclude` -`final_internal_class` | `annotation-white-list` | option was renamed, use `annotation_include` -`final_internal_class` | `consider-absent-docblock-as-internal-class` | option was renamed, use `consider_absent_docblock_as_internal_class` -`header_comment` | `commentType` | option was renamed to `comment_type` -`is_null` | `use_yoda_style` | option was removed, use `yoda_style` rule instead -`no_extra_consecutive_blank_lines` | `tokens` | one of possible values, `useTrait`, was renamed to `use_trait` -`ordered_class_elements` | `sortAlgorithm` | option was renamed, use `sort_algorithm` instead -`ordered_imports` | `importsOrder` | option was renamed, use `imports_order` -`ordered_imports` | `sortAlgorithm` | option was renamed, use `sort_algorithm` -`php_unit_dedicate_assert` | `functions` | option was removed, use `target` instead -`php_unit_test_annotation` | `case` | option was removed, use `php_unit_method_casing` rule instead +| Rule | Option | Change | +|------------------------------------|----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `binary_operator_spaces` | `align_double_arrow` | option was removed, use `operators` instead | +| `binary_operator_spaces` | `align_equals` | option was removed use `operators` instead | +| `blank_line_before_statement` | `statements: die` | option `die` was removed from `statements`, use `exit` instead | +| `class_attributes_separation` | `elements` | option does no longer accept flat array as a value, use map instead | +| `class_definition` | `multiLineExtendsEachSingleLine` | option was renamed to `multi_line_extends_each_single_line` | +| `class_definition` | `singleItemSingleLine` | option was renamed to `single_item_single_line` | +| `class_definition` | `singleLine` | option was renamed to `single_line` | +| `doctrine_annotation_spaces` | `around_argument_assignments` | option was removed, use `before_argument_assignments` and `after_argument_assignments` instead | +| `doctrine_annotation_spaces` | `around_array_assignments` | option was removed, use `after_array_assignments_colon`, `after_array_assignments_equals`, `before_array_assignments_colon` and `before_array_assignments_equals` instead | +| `final_internal_class` | `annotation-black-list` | option was renamed, use `annotation_exclude` | +| `final_internal_class` | `annotation-white-list` | option was renamed, use `annotation_include` | +| `final_internal_class` | `consider-absent-docblock-as-internal-class` | option was renamed, use `consider_absent_docblock_as_internal_class` | +| `header_comment` | `commentType` | option was renamed to `comment_type` | +| `is_null` | `use_yoda_style` | option was removed, use `yoda_style` rule instead | +| `no_extra_consecutive_blank_lines` | `tokens` | one of possible values, `useTrait`, was renamed to `use_trait` | +| `ordered_class_elements` | `sortAlgorithm` | option was renamed, use `sort_algorithm` instead | +| `ordered_imports` | `importsOrder` | option was renamed, use `imports_order` | +| `ordered_imports` | `sortAlgorithm` | option was renamed, use `sort_algorithm` | +| `php_unit_dedicate_assert` | `functions` | option was removed, use `target` instead | +| `php_unit_test_annotation` | `case` | option was removed, use `php_unit_method_casing` rule instead | ### Changed default values of options -Rule | Option | Old value | New value ----- | ---- | ---- | ---- -`array_syntax` | `syntax` | `'long'` | `'short'` -`function_to_constant` | `functions` | `['get_class', 'php_sapi_name', 'phpversion', 'pi']` | `['get_called_class', 'get_class', 'php_sapi_name', 'phpversion', 'pi']` -`list_syntax` | `syntax` | `'long'` | `'short'` -`method_argument_space` | `on_multiline` | `'ignore'` | `'ensure_fully_multiline'` -`native_constant_invocation` | `strict` | `false` | `true` -`native_function_casing` | `include` | `'@internal'` | `'@compiler_optimized'` -`native_function_invocation` | `include` | `'@internal'` | `'@compiler_optimized'` -`native_function_invocation` | `strict` | `false` | `true` -`non_printable_character` | `use_escape_sequences_in_strings` | `false` | `true` (when running on PHP 7.0 and up) -`php_unit_dedicate_assert` | `target` | `'5.0'` | `'newest'` -`phpdoc_align` | `tags` | `['param', 'return', 'throws', 'type', 'var']` | `['method', 'param', 'property', 'return', 'throws', 'type', 'var']` -`phpdoc_scalar` | `types` | `['boolean', 'double', 'integer', 'real', 'str']` | `['boolean', 'callback', 'double', 'integer', 'real', 'str']` +| Rule | Option | Old value | New value | +|------------------------------|-----------------------------------|------------------------------------------------------|--------------------------------------------------------------------------| +| `array_syntax` | `syntax` | `'long'` | `'short'` | +| `function_to_constant` | `functions` | `['get_class', 'php_sapi_name', 'phpversion', 'pi']` | `['get_called_class', 'get_class', 'php_sapi_name', 'phpversion', 'pi']` | +| `list_syntax` | `syntax` | `'long'` | `'short'` | +| `method_argument_space` | `on_multiline` | `'ignore'` | `'ensure_fully_multiline'` | +| `native_constant_invocation` | `strict` | `false` | `true` | +| `native_function_casing` | `include` | `'@internal'` | `'@compiler_optimized'` | +| `native_function_invocation` | `include` | `'@internal'` | `'@compiler_optimized'` | +| `native_function_invocation` | `strict` | `false` | `true` | +| `non_printable_character` | `use_escape_sequences_in_strings` | `false` | `true` (when running on PHP 7.0 and up) | +| `php_unit_dedicate_assert` | `target` | `'5.0'` | `'newest'` | +| `phpdoc_align` | `tags` | `['param', 'return', 'throws', 'type', 'var']` | `['method', 'param', 'property', 'return', 'throws', 'type', 'var']` | +| `phpdoc_scalar` | `types` | `['boolean', 'double', 'integer', 'real', 'str']` | `['boolean', 'callback', 'double', 'integer', 'real', 'str']` | ### Removed rule sets -Rule set | Note --------- | ---- -`@PHP56Migration` | was empty +| Rule set | Note | +|-------------------|------------| +| `@PHP56Migration` | was empty | ### Rule behavior changes @@ -124,8 +120,7 @@ Rule set | Note - `udiff` output now includes the file name in the output (if applicable) -Code BC changes -=============== +## Code BC changes ### Removed; various @@ -138,11 +133,11 @@ Code BC changes - `MethodArgumentSpaceFixer` deprecated methods have been removed - `NoMixedEchoPrintFixer` the property `$defaultConfig` has been removed - class `Tokens`, the following methods has been removed: - - `current()` - - `key()` - - `next()` - - `rewind()` - - `valid()` + - `current()` + - `key()` + - `next()` + - `rewind()` + - `valid()` - namespace `PhpCsFixer\Test\` and each class in it has been removed, as it served pure development purpose and should not be part of production code - reach out to community if you are willing to help building dev package ### Interface changes diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/ci-integration.sh b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/ci-integration.sh index 2521e249..39d99955 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/ci-integration.sh +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/ci-integration.sh @@ -5,4 +5,4 @@ IFS=' ' CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${COMMIT_RANGE}") if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi -vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no ${EXTRA_ARGS} +vendor/bin/php-cs-fixer check --config=.php-cs-fixer.dist.php -v --show-progress=dots --stop-on-violation --using-cache=no ${EXTRA_ARGS} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/composer.json b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/composer.json index e3ea370f..a3f667e6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/composer.json +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/composer.json @@ -21,39 +21,43 @@ ], "require": { "php": "^7.4 || ^8.0", + "ext-filter": "*", "ext-json": "*", "ext-tokenizer": "*", - "composer/semver": "^3.3", + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^2", - "doctrine/lexer": "^2 || ^3", - "sebastian/diff": "^4.0 || ^5.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.27", - "symfony/polyfill-php80": "^1.27", - "symfony/polyfill-php81": "^1.27", - "symfony/process": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" + "fidry/cpu-core-counter": "^1.2", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.1 || ^6.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" }, "require-dev": { - "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^2.0", - "mikey179/vfsstream": "^1.6.11", - "php-coveralls/php-coveralls": "^2.5.3", + "facile-it/paraunit": "^1.3.1 || ^2.4", + "infection/infection": "^0.29.8", + "justinrainbow/json-schema": "^5.3 || ^6.0", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.7", "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.16", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.6", - "phpunitgoodpractices/traits": "^1.9.2", - "symfony/phpunit-bridge": "^6.2.3", - "symfony/yaml": "^5.4 || ^6.0" + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", + "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -62,20 +66,144 @@ "autoload": { "psr-4": { "PhpCsFixer\\": "src/" - } + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] }, "autoload-dev": { "psr-4": { + "PhpCsFixer\\PHPStan\\": "dev-tools/phpstan/src/", "PhpCsFixer\\Tests\\": "tests/" - } + }, + "exclude-from-classmap": [ + "tests/Fixtures/" + ] }, "bin": [ "php-cs-fixer" ], "config": { "allow-plugins": { - "ergebnis/composer-normalize": true + "ergebnis/composer-normalize": true, + "infection/extension-installer": false }, + "prefer-stable": true, "sort-packages": true + }, + "scripts": { + "post-autoload-dump": [ + "@install-tools" + ], + "auto-review": [ + "Composer\\Config::disableProcessTimeout", + "paraunit run --testsuite auto-review" + ], + "cs:check": "@php php-cs-fixer check --verbose --diff", + "cs:fix": "@php php-cs-fixer fix", + "cs:fix:parallel": [ + "echo '⚠️ This script is deprecated! Utilise built-in parallelisation instead.';", + "@cs:fix" + ], + "docs": "@php dev-tools/doc.php", + "infection": "@test:mutation", + "install-tools": "@composer --working-dir=dev-tools install", + "mess-detector": "@php dev-tools/vendor/bin/phpmd . ansi dev-tools/mess-detector/phpmd.xml --exclude vendor/*,dev-tools/vendor/*,dev-tools/phpstan/*,tests/Fixtures/*", + "normalize": [ + "@composer normalize --working-dir=dev-tools --dry-run ../composer.json", + "@composer normalize --working-dir=dev-tools --dry-run composer.json" + ], + "normalize:fix": [ + "@composer normalize --working-dir=dev-tools ../composer.json", + "@composer normalize --working-dir=dev-tools composer.json" + ], + "php-compatibility": "@php dev-tools/vendor/bin/phpcs -p --standard=dev-tools/php-compatibility/phpcs-php-compatibility.xml", + "phpstan": "@php -d memory_limit=512M dev-tools/vendor/bin/phpstan analyse", + "phpstan:baseline": "@php -d memory_limit=512M dev-tools/vendor/bin/phpstan analyse --generate-baseline=./dev-tools/phpstan/baseline.php", + "qa": "@quality-assurance", + "quality-assurance": [ + "Composer\\Config::disableProcessTimeout", + "@install-tools --quiet", + "@self-check", + "@static-analysis", + "@test" + ], + "require-checker": "@php dev-tools/vendor/bin/composer-require-checker check composer.json --config-file .composer-require-checker.json", + "sa": "@static-analysis", + "self-check": [ + "./dev-tools/check_file_permissions.sh", + "./dev-tools/check_trailing_spaces.sh", + "@composer dump-autoload --dry-run --optimize --strict-psr", + "@normalize", + "@unused-deps", + "@require-checker", + "@auto-review" + ], + "static-analysis": [ + "@cs:check", + "@phpstan", + "@mess-detector" + ], + "test": "@test:all", + "test:all": [ + "@test:unit", + "@test:integration" + ], + "test:coverage": [ + "Composer\\Config::disableProcessTimeout", + "@composer show facile-it/paraunit ^2 && (paraunit coverage --testsuite unit --pass-through=--exclude-group=covers-nothing) || (paraunit coverage --testsuite unit --exclude-group covers-nothing)" + ], + "test:integration": [ + "Composer\\Config::disableProcessTimeout", + "paraunit run --testsuite integration" + ], + "test:mutation": [ + "Composer\\Config::disableProcessTimeout", + "infection --threads=max --only-covered --min-covered-msi=80" + ], + "test:short-open-tag": [ + "Composer\\Config::disableProcessTimeout", + "@php -d short_open_tag=1 ./vendor/bin/phpunit --do-not-cache-result --testsuite short-open-tag" + ], + "test:smoke": [ + "Composer\\Config::disableProcessTimeout", + "paraunit run --testsuite smoke" + ], + "test:unit": [ + "Composer\\Config::disableProcessTimeout", + "paraunit run --testsuite unit" + ], + "unused-deps": "@php dev-tools/vendor/bin/composer-unused --excludePackage=composer/xdebug-handler" + }, + "scripts-descriptions": { + "auto-review": "Execute Auto-review", + "cs:check": "Check coding standards", + "cs:fix": "Fix coding standards", + "cs:fix:parallel": "⚠️DEPRECATED! Use cs:fix with proper parallel config", + "docs": "Regenerate docs", + "infection": "Alias for 'test:mutation'", + "install-tools": "Install DEV tools", + "mess-detector": "Analyse code with Mess Detector", + "normalize": "Check normalization for composer.json files", + "normalize:fix": "Run normalization for composer.json files", + "php-compatibility": "Check compatibility with all supported PHP versions", + "phpstan": "Run PHPStan analysis", + "phpstan:baseline": "Dump PHPStan baseline file - use only for updating, do not add new errors when possible", + "post-autoload-dump": "Run additional tasks after installing/updating main dependencies", + "qa": "Alias for 'quality-assurance'", + "quality-assurance": "Run QA suite", + "require-checker": "Verifies if codebase does not contain soft dependencies", + "sa": "Alias for 'static-analysis'", + "self-check": "Run set of self-checks ensuring repository's validity", + "static-analysis": "Run static analysis", + "test": "Alias for 'test:all'", + "test:all": "Run Unit and Integration tests (but *NOT* Smoke tests)", + "test:coverage": "Run tests that provide code coverage", + "test:integration": "Run Integration tests", + "test:mutation": "Run mutation tests", + "test:short-open-tag": "Run tests with \"short_open_tag\" enabled", + "test:smoke": "Run Smoke tests", + "test:unit": "Run Unit tests", + "unused-deps": "Verifies if app has dependencies that are not used" } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/logo.md b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/logo.md index c2877f71..68e03a58 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/logo.md +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/logo.md @@ -1,3 +1,3 @@ The logo is © 2010+ Sensio Labs. -Original resolution can be found at https://github.com/PHP-CS-Fixer/logo . +Original resolution can be found at . diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer index e29468be..f00964cd 100755 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer @@ -1,6 +1,8 @@ #!/usr/bin/env php = 80300) { - fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.2.*.\n"); + if (\PHP_VERSION_ID < (int) '70400' || \PHP_VERSION_ID >= (int) '80400') { + fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.3.*.\n"); fwrite(STDERR, 'Current PHP version: '.PHP_VERSION.".\n"); - if (getenv('PHP_CS_FIXER_IGNORE_ENV')) { + if (filter_var(getenv('PHP_CS_FIXER_IGNORE_ENV'), FILTER_VALIDATE_BOOLEAN)) { fwrite(STDERR, "Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.\n"); } else { fwrite(STDERR, "To ignore this requirement please set `PHP_CS_FIXER_IGNORE_ENV`.\n"); @@ -47,7 +54,7 @@ set_error_handler(static function ($severity, $message, $file, $line) { if (!extension_loaded($extension)) { fwrite(STDERR, sprintf("PHP extension ext-%s is missing from your system. Install or enable it.\n", $extension)); - if (getenv('PHP_CS_FIXER_IGNORE_ENV')) { + if (filter_var(getenv('PHP_CS_FIXER_IGNORE_ENV'), FILTER_VALIDATE_BOOLEAN)) { fwrite(STDERR, "Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.\n"); } else { exit(1); @@ -57,14 +64,16 @@ set_error_handler(static function ($severity, $message, $file, $line) { })(); // load dependencies -(function () { +(static function (): void { $require = true; if (class_exists('Phar')) { // Maybe this file is used as phar-stub? Let's try! try { Phar::mapPhar('php-cs-fixer.phar'); + /** @phpstan-ignore requireOnce.fileNotFound */ require_once 'phar://php-cs-fixer.phar/vendor/autoload.php'; + $require = false; } catch (PharException $e) { } @@ -90,9 +99,6 @@ set_error_handler(static function ($severity, $message, $file, $line) { } })(); -use Composer\XdebugHandler\XdebugHandler; -use PhpCsFixer\Console\Application; - // Restart if xdebug is loaded, unless the environment variable PHP_CS_FIXER_ALLOW_XDEBUG is set. $xdebug = new XdebugHandler('PHP_CS_FIXER'); $xdebug->check(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php index dd7ad5ac..6a2be5f9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php @@ -26,6 +26,15 @@ /** * @internal + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * ignored_tags?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * ignored_tags: list + * } + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ abstract class AbstractDoctrineAnnotationFixer extends AbstractFixer implements ConfigurableFixerInterface { @@ -34,17 +43,11 @@ abstract class AbstractDoctrineAnnotationFixer extends AbstractFixer implements */ private array $classyElements; - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { // fetch indices one time, this is safe as we never add or remove a token during fixing @@ -59,7 +62,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $doctrineAnnotationTokens = DoctrineAnnotationTokens::createFromDocComment( $docCommentToken, - $this->configuration['ignored_tags'] + $this->configuration['ignored_tags'] // @phpstan-ignore-line ); $this->fixAnnotations($doctrineAnnotationTokens); @@ -72,23 +75,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void */ abstract protected function fixAnnotations(DoctrineAnnotationTokens $doctrineAnnotationTokens): void; - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('ignored_tags', 'List of tags that must not be treated as Doctrine Annotations.')) - ->setAllowedTypes(['array']) - ->setAllowedValues([static function (array $values): bool { - foreach ($values as $value) { - if (!\is_string($value)) { - return false; - } - } - - return true; - }]) + ->setAllowedTypes(['string[]']) ->setDefault([ // PHPDocumentor 1 'abstract', diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php index cdb46059..878ac3d6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php @@ -14,19 +14,11 @@ namespace PhpCsFixer; -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; -use PhpCsFixer\ConfigurationException\InvalidForEnvFixerConfigurationException; use PhpCsFixer\ConfigurationException\RequiredFixerConfigurationException; -use PhpCsFixer\Console\Application; use PhpCsFixer\Fixer\ConfigurableFixerInterface; use PhpCsFixer\Fixer\FixerInterface; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\DeprecatedFixerOption; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\InvalidOptionsForEnvException; use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Exception\ExceptionInterface; -use Symfony\Component\OptionsResolver\Exception\MissingOptionsException; /** * @author Dariusz Rumiński @@ -35,20 +27,7 @@ */ abstract class AbstractFixer implements FixerInterface { - /** - * @var null|array - */ - protected $configuration; - - /** - * @var WhitespacesFixerConfig - */ - protected $whitespacesConfig; - - /** - * @var null|FixerConfigurationResolverInterface - */ - private $configurationDefinition; + protected WhitespacesFixerConfig $whitespacesConfig; public function __construct() { @@ -67,7 +46,7 @@ public function __construct() final public function fix(\SplFileInfo $file, Tokens $tokens): void { - if ($this instanceof ConfigurableFixerInterface && null === $this->configuration) { + if ($this instanceof ConfigurableFixerInterface && property_exists($this, 'configuration') && null === $this->configuration) { throw new RequiredFixerConfigurationException($this->getName(), 'Configuration is required.'); } @@ -76,17 +55,11 @@ final public function fix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return false; } - /** - * {@inheritdoc} - */ public function getName(): string { $nameParts = explode('\\', static::class); @@ -95,84 +68,16 @@ public function getName(): string return Utils::camelCaseToUnderscore($name); } - /** - * {@inheritdoc} - */ public function getPriority(): int { return 0; } - /** - * {@inheritdoc} - */ public function supports(\SplFileInfo $file): bool { return true; } - /** - * @param array $configuration - */ - public function configure(array $configuration): void - { - if (!$this instanceof ConfigurableFixerInterface) { - throw new \LogicException('Cannot configure using Abstract parent, child not implementing "PhpCsFixer\Fixer\ConfigurableFixerInterface".'); - } - - foreach ($this->getConfigurationDefinition()->getOptions() as $option) { - if (!$option instanceof DeprecatedFixerOption) { - continue; - } - - $name = $option->getName(); - if (\array_key_exists($name, $configuration)) { - Utils::triggerDeprecation(new \InvalidArgumentException(sprintf( - 'Option "%s" for rule "%s" is deprecated and will be removed in version %d.0. %s', - $name, - $this->getName(), - Application::getMajorVersion() + 1, - str_replace('`', '"', $option->getDeprecationMessage()) - ))); - } - } - - try { - $this->configuration = $this->getConfigurationDefinition()->resolve($configuration); - } catch (MissingOptionsException $exception) { - throw new RequiredFixerConfigurationException( - $this->getName(), - sprintf('Missing required configuration: %s', $exception->getMessage()), - $exception - ); - } catch (InvalidOptionsForEnvException $exception) { - throw new InvalidForEnvFixerConfigurationException( - $this->getName(), - sprintf('Invalid configuration for env: %s', $exception->getMessage()), - $exception - ); - } catch (ExceptionInterface $exception) { - throw new InvalidFixerConfigurationException( - $this->getName(), - sprintf('Invalid configuration: %s', $exception->getMessage()), - $exception - ); - } - } - - public function getConfigurationDefinition(): FixerConfigurationResolverInterface - { - if (!$this instanceof ConfigurableFixerInterface) { - throw new \LogicException(sprintf('Cannot get configuration definition using Abstract parent, child "%s" not implementing "PhpCsFixer\Fixer\ConfigurableFixerInterface".', static::class)); - } - - if (null === $this->configurationDefinition) { - $this->configurationDefinition = $this->createConfigurationDefinition(); - } - - return $this->configurationDefinition; - } - public function setWhitespacesConfig(WhitespacesFixerConfig $config): void { if (!$this instanceof WhitespacesAwareFixerInterface) { @@ -184,15 +89,6 @@ public function setWhitespacesConfig(WhitespacesFixerConfig $config): void abstract protected function applyFix(\SplFileInfo $file, Tokens $tokens): void; - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - if (!$this instanceof ConfigurableFixerInterface) { - throw new \LogicException('Cannot create configuration definition using Abstract parent, child not implementing "PhpCsFixer\Fixer\ConfigurableFixerInterface".'); - } - - throw new \LogicException('Not implemented.'); - } - private function getDefaultWhitespacesFixerConfig(): WhitespacesFixerConfig { static $defaultWhitespacesFixerConfig = null; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php index e9d7a120..da862da7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php @@ -22,17 +22,11 @@ */ abstract class AbstractFopenFlagFixer extends AbstractFunctionReferenceFixer { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_STRING, T_CONSTANT_ENCAPSED_STRING]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $argumentsAnalyzer = new ArgumentsAnalyzer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php index 350b87cf..b919b217 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php @@ -24,22 +24,13 @@ */ abstract class AbstractFunctionReferenceFixer extends AbstractFixer { - /** - * @var null|FunctionsAnalyzer - */ - private $functionsAnalyzer; + private ?FunctionsAnalyzer $functionsAnalyzer = null; - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; @@ -49,7 +40,7 @@ public function isRisky(): bool * Looks up Tokens sequence for suitable candidates and delivers boundaries information, * which can be supplied by other methods in this abstract class. * - * @return null|int[] returns $functionName, $openParenthesis, $closeParenthesis packed into array + * @return ?array{int, int, int} returns $functionName, $openParenthesis, $closeParenthesis packed into array */ protected function find(string $functionNameToSearch, Tokens $tokens, int $start = 0, ?int $end = null): ?array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractLinesBeforeNamespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractLinesBeforeNamespaceFixer.php deleted file mode 100644 index f574b970..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractLinesBeforeNamespaceFixer.php +++ /dev/null @@ -1,120 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * This abstract fixer is responsible for ensuring that a certain number of - * lines prefix a namespace declaration. - * - * @author Graham Campbell - * - * @internal - */ -abstract class AbstractLinesBeforeNamespaceFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - /** - * Make sure # of line breaks prefixing namespace is within given range. - * - * @param int $expectedMin min. # of line breaks - * @param int $expectedMax max. # of line breaks - */ - protected function fixLinesBeforeNamespace(Tokens $tokens, int $index, int $expectedMin, int $expectedMax): void - { - // Let's determine the total numbers of new lines before the namespace - // and the opening token - $openingTokenIndex = null; - $precedingNewlines = 0; - $newlineInOpening = false; - $openingToken = null; - - for ($i = 1; $i <= 2; ++$i) { - if (isset($tokens[$index - $i])) { - $token = $tokens[$index - $i]; - - if ($token->isGivenKind(T_OPEN_TAG)) { - $openingToken = $token; - $openingTokenIndex = $index - $i; - $newlineInOpening = str_contains($token->getContent(), "\n"); - - if ($newlineInOpening) { - ++$precedingNewlines; - } - - break; - } - - if (false === $token->isGivenKind(T_WHITESPACE)) { - break; - } - - $precedingNewlines += substr_count($token->getContent(), "\n"); - } - } - - if ($precedingNewlines >= $expectedMin && $precedingNewlines <= $expectedMax) { - return; - } - - $previousIndex = $index - 1; - $previous = $tokens[$previousIndex]; - - if (0 === $expectedMax) { - // Remove all the previous new lines - if ($previous->isWhitespace()) { - $tokens->clearAt($previousIndex); - } - - // Remove new lines in opening token - if ($newlineInOpening) { - $tokens[$openingTokenIndex] = new Token([T_OPEN_TAG, rtrim($openingToken->getContent()).' ']); - } - - return; - } - - $lineEnding = $this->whitespacesConfig->getLineEnding(); - $newlinesForWhitespaceToken = $expectedMax; - - if (null !== $openingToken) { - // Use the configured line ending for the PHP opening tag - $content = rtrim($openingToken->getContent()); - $newContent = $content.$lineEnding; - $tokens[$openingTokenIndex] = new Token([T_OPEN_TAG, $newContent]); - --$newlinesForWhitespaceToken; - } - - if (0 === $newlinesForWhitespaceToken) { - // We have all the needed new lines in the opening tag - if ($previous->isWhitespace()) { - // Let's remove the previous token containing extra new lines - $tokens->clearAt($previousIndex); - } - - return; - } - - if ($previous->isWhitespace()) { - // Fix the previous whitespace token - $tokens[$previousIndex] = new Token([T_WHITESPACE, str_repeat($lineEnding, $newlinesForWhitespaceToken).substr($previous->getContent(), strrpos($previous->getContent(), "\n") + 1)]); - } else { - // Add a new whitespace token - $tokens->insertAt($index, new Token([T_WHITESPACE, str_repeat($lineEnding, $newlinesForWhitespaceToken)])); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php index 96f6bb09..b45be5ac 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php @@ -18,9 +18,6 @@ abstract class AbstractNoUselessElseFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // should be run before NoWhitespaceInBlankLineFixer, NoExtraBlankLinesFixer, BracesFixer and after NoEmptyStatementFixer. @@ -96,7 +93,7 @@ protected function isSuperfluousElse(Tokens $tokens, int $index): bool * * @param int $index T_IF, T_ELSE, T_ELSEIF * - * @return int[] + * @return array{int, int} */ private function getPreviousBlock(Tokens $tokens, int $index): array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php index 5dfc6a59..47dcf2f7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php @@ -16,7 +16,9 @@ use PhpCsFixer\DocBlock\Annotation; use PhpCsFixer\DocBlock\DocBlock; +use PhpCsFixer\DocBlock\TypeExpression; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -28,10 +30,28 @@ /** * @internal + * + * @phpstan-type _CommonTypeInfo array{commonType: string, isNullable: bool} + * @phpstan-type _AutogeneratedInputConfiguration array{ + * scalar_types?: bool, + * types_map?: array, + * union_types?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * scalar_types: bool, + * types_map: array, + * union_types: bool + * } + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ abstract class AbstractPhpdocToTypeDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface { - private const CLASS_REGEX = '/^\\\\?[a-zA-Z_\\x7f-\\xff](?:\\\\?[a-zA-Z0-9_\\x7f-\\xff]+)*$/'; + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + private const REGEX_CLASS = '(?:\\\?+'.TypeExpression::REGEX_IDENTIFIER + .'(\\\\'.TypeExpression::REGEX_IDENTIFIER.')*+)'; /** * @var array @@ -41,6 +61,7 @@ abstract class AbstractPhpdocToTypeDeclarationFixer extends AbstractFixer implem 'iterable' => 7_01_00, 'object' => 7_02_00, 'mixed' => 8_00_00, + 'never' => 8_01_00, ]; /** @@ -58,9 +79,6 @@ abstract class AbstractPhpdocToTypeDeclarationFixer extends AbstractFixer implem */ private static array $syntaxValidationCache = []; - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; @@ -68,9 +86,6 @@ public function isRisky(): bool abstract protected function isSkippedType(string $type): bool; - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -78,6 +93,14 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setAllowedTypes(['bool']) ->setDefault(true) ->getOption(), + (new FixerOptionBuilder('union_types', 'Fix also union types; turned on by default on PHP >= 8.0.0.')) + ->setAllowedTypes(['bool']) + ->setDefault(\PHP_VERSION_ID >= 8_00_00) + ->getOption(), + (new FixerOptionBuilder('types_map', 'Map of custom types, e.g. template types from PHPStan.')) + ->setAllowedTypes(['array']) + ->setDefault([]) + ->getOption(), ]); } @@ -106,7 +129,7 @@ protected function findFunctionDocComment(Tokens $tokens, int $index): ?int } /** - * @return Annotation[] + * @return list */ protected function getAnnotationsFromDocComment(string $name, Tokens $tokens, int $docCommentIndex): array { @@ -126,55 +149,53 @@ protected function getAnnotationsFromDocComment(string $name, Tokens $tokens, in } /** - * @return Token[] + * @return list */ protected function createTypeDeclarationTokens(string $type, bool $isNullable): array { - static $specialTypes = [ - 'array' => [CT::T_ARRAY_TYPEHINT, 'array'], - 'callable' => [T_CALLABLE, 'callable'], - 'static' => [T_STATIC, 'static'], - ]; - $newTokens = []; if (true === $isNullable && 'mixed' !== $type) { $newTokens[] = new Token([CT::T_NULLABLE_TYPE, '?']); } - if (isset($specialTypes[$type])) { - $newTokens[] = new Token($specialTypes[$type]); - } else { - $typeUnqualified = ltrim($type, '\\'); - - if (isset($this->scalarTypes[$typeUnqualified]) || isset($this->versionSpecificTypes[$typeUnqualified])) { - // 'scalar's, 'void', 'iterable' and 'object' must be unqualified - $newTokens[] = new Token([T_STRING, $typeUnqualified]); - } else { - foreach (explode('\\', $type) as $nsIndex => $value) { - if (0 === $nsIndex && '' === $value) { - continue; - } - - if (0 < $nsIndex) { - $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); - } + $newTokens = array_merge( + $newTokens, + $this->createTokensFromRawType($type)->toArray() + ); - $newTokens[] = new Token([T_STRING, $value]); + // 'scalar's, 'void', 'iterable' and 'object' must be unqualified + foreach ($newTokens as $i => $token) { + if ($token->isGivenKind(T_STRING)) { + $typeUnqualified = $token->getContent(); + + if ( + (isset($this->scalarTypes[$typeUnqualified]) || isset($this->versionSpecificTypes[$typeUnqualified])) + && isset($newTokens[$i - 1]) + && '\\' === $newTokens[$i - 1]->getContent() + ) { + unset($newTokens[$i - 1]); } } } - return $newTokens; + return array_values($newTokens); } /** - * @return null|array{string, bool} + * Each fixer inheriting from this class must define a way of creating token collection representing type + * gathered from phpDoc, e.g. `Foo|Bar` should be transformed into 3 tokens (`Foo`, `|` and `Bar`). + * This can't be standardised, because some types may be allowed in one place, and invalid in others. + * + * @param string $type Type determined (and simplified) from phpDoc */ - protected function getCommonTypeFromAnnotation(Annotation $annotation, bool $isReturnType): ?array - { - $typesExpression = $annotation->getTypeExpression(); + abstract protected function createTokensFromRawType(string $type): Tokens; + /** + * @return ?_CommonTypeInfo + */ + protected function getCommonTypeInfo(TypeExpression $typesExpression, bool $isReturnType): ?array + { $commonType = $typesExpression->getCommonType(); $isNullable = $typesExpression->allowsNull(); @@ -198,15 +219,83 @@ protected function getCommonTypeFromAnnotation(Annotation $annotation, bool $isR return null; } + if (\array_key_exists($commonType, $this->configuration['types_map'])) { + $commonType = $this->configuration['types_map'][$commonType]; + } + if (isset($this->scalarTypes[$commonType])) { if (false === $this->configuration['scalar_types']) { return null; } - } elseif (1 !== Preg::match(self::CLASS_REGEX, $commonType)) { + } elseif (!Preg::match('/^'.self::REGEX_CLASS.'$/', $commonType)) { + return null; + } + + return ['commonType' => $commonType, 'isNullable' => $isNullable]; + } + + protected function getUnionTypes(TypeExpression $typesExpression, bool $isReturnType): ?string + { + if (\PHP_VERSION_ID < 8_00_00) { + return null; + } + + if (!$typesExpression->isUnionType()) { return null; } - return [$commonType, $isNullable]; + if (false === $this->configuration['union_types']) { + return null; + } + + $types = $typesExpression->getTypes(); + $isNullable = $typesExpression->allowsNull(); + $unionTypes = []; + $containsOtherThanIterableType = false; + $containsOtherThanEmptyType = false; + + foreach ($types as $type) { + if ('null' === $type) { + continue; + } + + if ($this->isSkippedType($type)) { + return null; + } + + if (isset($this->versionSpecificTypes[$type]) && \PHP_VERSION_ID < $this->versionSpecificTypes[$type]) { + return null; + } + + $typeExpression = new TypeExpression($type, null, []); + $commonType = $typeExpression->getCommonType(); + + if (!$containsOtherThanIterableType && !\in_array($commonType, ['array', \Traversable::class, 'iterable'], true)) { + $containsOtherThanIterableType = true; + } + if ($isReturnType && !$containsOtherThanEmptyType && !\in_array($commonType, ['null', 'void', 'never'], true)) { + $containsOtherThanEmptyType = true; + } + + if (!$isNullable && $typesExpression->allowsNull()) { + $isNullable = true; + } + + $unionTypes[] = $commonType; + } + + if (!$containsOtherThanIterableType) { + return null; + } + if ($isReturnType && !$containsOtherThanEmptyType) { + return null; + } + + if ($isNullable) { + $unionTypes[] = 'null'; + } + + return implode($typesExpression->getTypesGlue(), array_unique($unionTypes)); } final protected function isValidSyntax(string $code): bool diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php index bff21d10..fe9ff4e6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\DocBlock\Annotation; use PhpCsFixer\DocBlock\DocBlock; +use PhpCsFixer\DocBlock\TypeExpression; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; @@ -31,13 +32,10 @@ abstract class AbstractPhpdocTypesFixer extends AbstractFixer /** * The annotation tags search inside. * - * @var string[] + * @var list */ protected array $tags; - /** - * {@inheritdoc} - */ public function __construct() { parent::__construct(); @@ -45,17 +43,11 @@ public function __construct() $this->tags = Annotation::getTagsWithTypes(); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -71,7 +63,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } foreach ($annotations as $annotation) { - $this->fixTypes($annotation); + $this->fixType($annotation); } $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); @@ -84,44 +76,30 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void abstract protected function normalize(string $type): string; /** - * Fix the types at the given line. + * Fix the type at the given line. * * We must be super careful not to modify parts of words. * * This will be nicely handled behind the scenes for us by the annotation class. */ - private function fixTypes(Annotation $annotation): void + private function fixType(Annotation $annotation): void { - $types = $annotation->getTypes(); - - $new = $this->normalizeTypes($types); + $typeExpression = $annotation->getTypeExpression(); - if ($types !== $new) { - $annotation->setTypes($new); + if (null === $typeExpression) { + return; } - } - /** - * @param string[] $types - * - * @return string[] - */ - private function normalizeTypes(array $types): array - { - foreach ($types as $index => $type) { - $types[$index] = $this->normalizeType($type); - } + $newTypeExpression = $typeExpression->mapTypes(function (TypeExpression $type) { + if (!$type->isCompositeType()) { + $value = $this->normalize($type->toString()); - return $types; - } + return new TypeExpression($value, null, []); + } - /** - * Prepare the type and normalize it. - */ - private function normalizeType(string $type): string - { - return str_ends_with($type, '[]') - ? $this->normalizeType(substr($type, 0, -2)).'[]' - : $this->normalize($type); + return $type; + }); + + $annotation->setTypes([$newTypeExpression->toString()]); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php index 97a86d1d..96eab156 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php @@ -39,9 +39,6 @@ public function __construct() parent::__construct(); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { foreach ($this->proxyFixers as $fixer) { @@ -53,9 +50,6 @@ public function isCandidate(Tokens $tokens): bool return false; } - /** - * {@inheritdoc} - */ public function isRisky(): bool { foreach ($this->proxyFixers as $fixer) { @@ -67,9 +61,6 @@ public function isRisky(): bool return false; } - /** - * {@inheritdoc} - */ public function getPriority(): int { if (\count($this->proxyFixers) > 1) { @@ -79,9 +70,6 @@ public function getPriority(): int return reset($this->proxyFixers)->getPriority(); } - /** - * {@inheritdoc} - */ public function supports(\SplFileInfo $file): bool { foreach ($this->proxyFixers as $fixer) { @@ -93,9 +81,6 @@ public function supports(\SplFileInfo $file): bool return false; } - /** - * {@inheritdoc} - */ public function setWhitespacesConfig(WhitespacesFixerConfig $config): void { parent::setWhitespacesConfig($config); @@ -107,9 +92,6 @@ public function setWhitespacesConfig(WhitespacesFixerConfig $config): void } } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($this->proxyFixers as $fixer) { @@ -118,7 +100,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @return FixerInterface[] + * @return list */ abstract protected function createProxyFixers(): array; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php index 8793630b..29976749 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php @@ -14,6 +14,8 @@ namespace PhpCsFixer\Cache; +use PhpCsFixer\Utils; + /** * @author Andreas Möller * @@ -73,8 +75,8 @@ public function toJson(): string 'hashes' => $this->hashes, ]); - if (JSON_ERROR_NONE !== json_last_error()) { - throw new \UnexpectedValueException(sprintf( + if (JSON_ERROR_NONE !== json_last_error() || false === $json) { + throw new \UnexpectedValueException(\sprintf( 'Cannot encode cache signature to JSON, error: "%s". If you have non-UTF8 chars in your signature, like in license for `header_comment`, consider enabling `ext-mbstring` or install `symfony/polyfill-mbstring`.', json_last_error_msg() )); @@ -91,7 +93,7 @@ public static function fromJson(string $json): self $data = json_decode($json, true); if (null === $data && JSON_ERROR_NONE !== json_last_error()) { - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException(\sprintf( 'Value needs to be a valid JSON string, got "%s", error: "%s".', $json, json_last_error_msg() @@ -110,9 +112,9 @@ public static function fromJson(string $json): self $missingKeys = array_diff_key(array_flip($requiredKeys), $data); if (\count($missingKeys) > 0) { - throw new \InvalidArgumentException(sprintf( - 'JSON data is missing keys "%s"', - implode('", "', $missingKeys) + throw new \InvalidArgumentException(\sprintf( + 'JSON data is missing keys %s', + Utils::naturalLanguageJoin(array_keys($missingKeys)) )); } @@ -126,12 +128,24 @@ public static function fromJson(string $json): self $cache = new self($signature); - $cache->hashes = array_map(function ($v): string { - // before v3.11.1 the hashes were crc32 encoded and saved as integers - // @TODO: remove the to string cast/array_map in v4.0 - return \is_int($v) ? (string) $v : $v; - }, $data['hashes']); + // before v3.11.1 the hashes were crc32 encoded and saved as integers + // @TODO: remove the to string cast/array_map in v4.0 + $cache->hashes = array_map(static fn ($v): string => \is_int($v) ? (string) $v : $v, $data['hashes']); return $cache; } + + /** + * @internal + */ + public function backfillHashes(self $oldCache): bool + { + if (!$this->getSignature()->equals($oldCache->getSignature())) { + return false; + } + + $this->hashes = array_merge($oldCache->hashes, $this->hashes); + + return true; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php index 4e82d0c9..b9fb2ff6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php @@ -24,4 +24,6 @@ interface CacheManagerInterface public function needFixing(string $file, string $fileContent): bool; public function setFile(string $file, string $fileContent): void; + + public function setFileHash(string $file, string $hash): void; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php index 90882af0..396137d9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php @@ -17,6 +17,8 @@ /** * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class Directory implements DirectoryInterface @@ -28,9 +30,6 @@ public function __construct(string $directoryName) $this->directoryName = $directoryName; } - /** - * {@inheritdoc} - */ public function getRelativePathTo(string $file): string { $file = $this->normalizePath($file); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php index d17afb8c..57b9f3b6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php @@ -14,6 +14,8 @@ namespace PhpCsFixer\Cache; +use PhpCsFixer\Tokenizer\CodeHasher; + /** * Class supports caching information about state of fixing files. * @@ -32,6 +34,8 @@ */ final class FileCacheManager implements CacheManagerInterface { + public const WRITE_FREQUENCY = 10; + private FileHandlerInterface $handler; private SignatureInterface $signature; @@ -40,10 +44,11 @@ final class FileCacheManager implements CacheManagerInterface private DirectoryInterface $cacheDirectory; - /** - * @var CacheInterface - */ - private $cache; + private int $writeCounter = 0; + + private bool $signatureWasUpdated = false; + + private CacheInterface $cache; public function __construct( FileHandlerInterface $handler, @@ -61,7 +66,9 @@ public function __construct( public function __destruct() { - $this->writeCache(); + if (true === $this->signatureWasUpdated || 0 !== $this->writeCounter) { + $this->writeCache(); + } } /** @@ -93,17 +100,23 @@ public function needFixing(string $file, string $fileContent): bool public function setFile(string $file, string $fileContent): void { - $file = $this->cacheDirectory->getRelativePathTo($file); + $this->setFileHash($file, $this->calcHash($fileContent)); + } - $hash = $this->calcHash($fileContent); + public function setFileHash(string $file, string $hash): void + { + $file = $this->cacheDirectory->getRelativePathTo($file); if ($this->isDryRun && $this->cache->has($file) && $this->cache->get($file) !== $hash) { $this->cache->clear($file); - - return; + } else { + $this->cache->set($file, $hash); } - $this->cache->set($file, $hash); + if (self::WRITE_FREQUENCY === ++$this->writeCounter) { + $this->writeCounter = 0; + $this->writeCache(); + } } private function readCache(): void @@ -112,6 +125,7 @@ private function readCache(): void if (null === $cache || !$this->signature->equals($cache->getSignature())) { $cache = new Cache($this->signature); + $this->signatureWasUpdated = true; } $this->cache = $cache; @@ -124,6 +138,6 @@ private function writeCache(): void private function calcHash(string $content): string { - return md5($content); + return CodeHasher::calculateCodeHash($content); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php index 059e6b42..a1b83ed7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php @@ -18,89 +18,167 @@ /** * @author Andreas Möller + * @author Dariusz Rumiński * * @internal */ final class FileHandler implements FileHandlerInterface { - private string $file; + private \SplFileInfo $fileInfo; + + private int $fileMTime = 0; public function __construct(string $file) { - $this->file = $file; + $this->fileInfo = new \SplFileInfo($file); } public function getFile(): string { - return $this->file; + return $this->fileInfo->getPathname(); } public function read(): ?CacheInterface { - if (!file_exists($this->file)) { + if (!$this->fileInfo->isFile() || !$this->fileInfo->isReadable()) { return null; } - $content = file_get_contents($this->file); + $fileObject = $this->fileInfo->openFile('r'); - try { - $cache = Cache::fromJson($content); - } catch (\InvalidArgumentException $exception) { - return null; - } + $cache = $this->readFromHandle($fileObject); + $this->fileMTime = $this->getFileCurrentMTime(); + + unset($fileObject); // explicitly close file handler return $cache; } public function write(CacheInterface $cache): void { - $content = $cache->toJson(); - - if (file_exists($this->file)) { - if (is_dir($this->file)) { - throw new IOException( - sprintf('Cannot write cache file "%s" as the location exists as directory.', realpath($this->file)), - 0, - null, - $this->file - ); + $this->ensureFileIsWriteable(); + + $fileObject = $this->fileInfo->openFile('r+'); + + if (method_exists($cache, 'backfillHashes') && $this->fileMTime < $this->getFileCurrentMTime()) { + $resultOfFlock = $fileObject->flock(LOCK_EX); + if (false === $resultOfFlock) { + // Lock failed, OK - we continue without the lock. + // noop } - if (!is_writable($this->file)) { - throw new IOException( - sprintf('Cannot write to file "%s" as it is not writable.', realpath($this->file)), - 0, - null, - $this->file - ); + $oldCache = $this->readFromHandle($fileObject); + + $fileObject->rewind(); + + if (null !== $oldCache) { + $cache->backfillHashes($oldCache); } - } else { - $dir = \dirname($this->file); - - if (!is_dir($dir)) { - throw new IOException( - sprintf('Directory of cache file "%s" does not exists.', $this->file), - 0, - null, - $this->file - ); + } + + $resultOfTruncate = $fileObject->ftruncate(0); + if (false === $resultOfTruncate) { + // Truncate failed. OK - we do not save the cache. + return; + } + + $resultOfWrite = $fileObject->fwrite($cache->toJson()); + if (false === $resultOfWrite) { + // Write failed. OK - we did not save the cache. + return; + } + + $resultOfFlush = $fileObject->fflush(); + if (false === $resultOfFlush) { + // Flush failed. OK - part of cache can be missing, in case this was last chunk in this pid. + // noop + } + + $this->fileMTime = time(); // we could take the fresh `mtime` of file that we just modified with `$this->getFileCurrentMTime()`, but `time()` should be good enough here and reduce IO operation + } + + private function getFileCurrentMTime(): int + { + clearstatcache(true, $this->fileInfo->getPathname()); + + $mtime = $this->fileInfo->getMTime(); + + if (false === $mtime) { + // cannot check mtime? OK - let's pretend file is old. + $mtime = 0; + } + + return $mtime; + } + + private function readFromHandle(\SplFileObject $fileObject): ?CacheInterface + { + try { + $size = $fileObject->getSize(); + if (false === $size || 0 === $size) { + return null; + } + + $content = $fileObject->fread($size); + + if (false === $content) { + return null; } - @touch($this->file); - @chmod($this->file, 0666); + return Cache::fromJson($content); + } catch (\InvalidArgumentException $exception) { + return null; } + } - $bytesWritten = @file_put_contents($this->file, $content); + private function ensureFileIsWriteable(): void + { + if ($this->fileInfo->isFile() && $this->fileInfo->isWritable()) { + // all good + return; + } - if (false === $bytesWritten) { - $error = error_get_last(); + if ($this->fileInfo->isDir()) { + throw new IOException( + \sprintf('Cannot write cache file "%s" as the location exists as directory.', $this->fileInfo->getRealPath()), + 0, + null, + $this->fileInfo->getPathname() + ); + } + if ($this->fileInfo->isFile() && !$this->fileInfo->isWritable()) { throw new IOException( - sprintf('Failed to write file "%s", "%s".', $this->file, $error['message'] ?? 'no reason available'), + \sprintf('Cannot write to file "%s" as it is not writable.', $this->fileInfo->getRealPath()), 0, null, - $this->file + $this->fileInfo->getPathname() ); } + + $this->createFile($this->fileInfo->getPathname()); + } + + private function createFile(string $file): void + { + $dir = \dirname($file); + + // Ensure path is created, but ignore if already exists. FYI: ignore EA suggestion in IDE, + // `mkdir()` returns `false` for existing paths, so we can't mix it with `is_dir()` in one condition. + if (!@is_dir($dir)) { + @mkdir($dir, 0777, true); + } + + if (!@is_dir($dir)) { + throw new IOException( + \sprintf('Directory of cache file "%s" does not exists and couldn\'t be created.', $file), + 0, + null, + $file + ); + } + + @touch($file); + @chmod($file, 0666); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php index 63094804..3a5fe991 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php @@ -16,6 +16,7 @@ /** * @author Andreas Möller + * @author Dariusz Rumiński * * @internal */ @@ -26,7 +27,7 @@ public function needFixing(string $file, string $fileContent): bool return true; } - public function setFile(string $file, string $fileContent): void - { - } + public function setFile(string $file, string $fileContent): void {} + + public function setFileHash(string $file, string $hash): void {} } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php index 48c96289..17be5de0 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php @@ -17,6 +17,8 @@ /** * @author Andreas Möller * + * @readonly + * * @internal */ final class Signature implements SignatureInterface diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Config.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Config.php index 856f88b7..ac59e143 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Config.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Config.php @@ -15,18 +15,23 @@ namespace PhpCsFixer; use PhpCsFixer\Fixer\FixerInterface; +use PhpCsFixer\Runner\Parallel\ParallelConfig; +use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; /** * @author Fabien Potencier * @author Katsuhiro Ogawa * @author Dariusz Rumiński */ -class Config implements ConfigInterface +class Config implements ConfigInterface, ParallelAwareConfigInterface { + /** + * @var non-empty-string + */ private string $cacheFile = '.php-cs-fixer.cache'; /** - * @var FixerInterface[] + * @var list */ private array $customFixers = []; @@ -39,44 +44,60 @@ class Config implements ConfigInterface private bool $hideProgress = false; + /** + * @var non-empty-string + */ private string $indent = ' '; private bool $isRiskyAllowed = false; + /** + * @var non-empty-string + */ private string $lineEnding = "\n"; private string $name; - /** - * @var null|string - */ - private $phpExecutable; + private ParallelConfig $parallelConfig; + + private ?string $phpExecutable = null; /** * @TODO: 4.0 - update to @PER * * @var array|bool> */ - private array $rules = ['@PSR12' => true]; + private array $rules; private bool $usingCache = true; public function __construct(string $name = 'default') { - $this->name = $name; + // @TODO 4.0 cleanup + if (Utils::isFutureModeEnabled()) { + $this->name = $name.' (future mode)'; + $this->rules = ['@PER-CS' => true]; + } else { + $this->name = $name; + $this->rules = ['@PSR12' => true]; + } + + // @TODO 4.0 cleanup + if (Utils::isFutureModeEnabled() || filter_var(getenv('PHP_CS_FIXER_PARALLEL'), FILTER_VALIDATE_BOOL)) { + $this->parallelConfig = ParallelConfigFactory::detect(); + } else { + $this->parallelConfig = ParallelConfigFactory::sequential(); + } } /** - * {@inheritdoc} + * @return non-empty-string */ public function getCacheFile(): string { return $this->cacheFile; } - /** - * {@inheritdoc} - */ public function getCustomFixers(): array { return $this->customFixers; @@ -87,88 +108,61 @@ public function getCustomFixers(): array */ public function getFinder(): iterable { - if (null === $this->finder) { - $this->finder = new Finder(); - } + $this->finder ??= new Finder(); return $this->finder; } - /** - * {@inheritdoc} - */ public function getFormat(): string { return $this->format; } - /** - * {@inheritdoc} - */ public function getHideProgress(): bool { return $this->hideProgress; } - /** - * {@inheritdoc} - */ public function getIndent(): string { return $this->indent; } - /** - * {@inheritdoc} - */ public function getLineEnding(): string { return $this->lineEnding; } - /** - * {@inheritdoc} - */ public function getName(): string { return $this->name; } - /** - * {@inheritdoc} - */ + public function getParallelConfig(): ParallelConfig + { + return $this->parallelConfig; + } + public function getPhpExecutable(): ?string { return $this->phpExecutable; } - /** - * {@inheritdoc} - */ public function getRiskyAllowed(): bool { return $this->isRiskyAllowed; } - /** - * {@inheritdoc} - */ public function getRules(): array { return $this->rules; } - /** - * {@inheritdoc} - */ public function getUsingCache(): bool { return $this->usingCache; } - /** - * {@inheritdoc} - */ public function registerCustomFixers(iterable $fixers): ConfigInterface { foreach ($fixers as $fixer) { @@ -179,7 +173,7 @@ public function registerCustomFixers(iterable $fixers): ConfigInterface } /** - * {@inheritdoc} + * @param non-empty-string $cacheFile */ public function setCacheFile(string $cacheFile): ConfigInterface { @@ -188,9 +182,6 @@ public function setCacheFile(string $cacheFile): ConfigInterface return $this; } - /** - * {@inheritdoc} - */ public function setFinder(iterable $finder): ConfigInterface { $this->finder = $finder; @@ -198,9 +189,6 @@ public function setFinder(iterable $finder): ConfigInterface return $this; } - /** - * {@inheritdoc} - */ public function setFormat(string $format): ConfigInterface { $this->format = $format; @@ -208,9 +196,6 @@ public function setFormat(string $format): ConfigInterface return $this; } - /** - * {@inheritdoc} - */ public function setHideProgress(bool $hideProgress): ConfigInterface { $this->hideProgress = $hideProgress; @@ -219,7 +204,7 @@ public function setHideProgress(bool $hideProgress): ConfigInterface } /** - * {@inheritdoc} + * @param non-empty-string $indent */ public function setIndent(string $indent): ConfigInterface { @@ -229,7 +214,7 @@ public function setIndent(string $indent): ConfigInterface } /** - * {@inheritdoc} + * @param non-empty-string $lineEnding */ public function setLineEnding(string $lineEnding): ConfigInterface { @@ -238,9 +223,13 @@ public function setLineEnding(string $lineEnding): ConfigInterface return $this; } - /** - * {@inheritdoc} - */ + public function setParallelConfig(ParallelConfig $config): ConfigInterface + { + $this->parallelConfig = $config; + + return $this; + } + public function setPhpExecutable(?string $phpExecutable): ConfigInterface { $this->phpExecutable = $phpExecutable; @@ -248,9 +237,6 @@ public function setPhpExecutable(?string $phpExecutable): ConfigInterface return $this; } - /** - * {@inheritdoc} - */ public function setRiskyAllowed(bool $isRiskyAllowed): ConfigInterface { $this->isRiskyAllowed = $isRiskyAllowed; @@ -258,9 +244,6 @@ public function setRiskyAllowed(bool $isRiskyAllowed): ConfigInterface return $this; } - /** - * {@inheritdoc} - */ public function setRules(array $rules): ConfigInterface { $this->rules = $rules; @@ -268,9 +251,6 @@ public function setRules(array $rules): ConfigInterface return $this; } - /** - * {@inheritdoc} - */ public function setUsingCache(bool $usingCache): ConfigInterface { $this->usingCache = $usingCache; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php index b46b191b..c097a582 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php @@ -25,14 +25,14 @@ interface ConfigInterface /** * Returns the path to the cache file. * - * @return null|string Returns null if not using cache + * @return null|non-empty-string Returns null if not using cache */ public function getCacheFile(): ?string; /** * Returns the custom fixers to use. * - * @return FixerInterface[] + * @return list */ public function getCustomFixers(): array; @@ -50,8 +50,14 @@ public function getFormat(): string; */ public function getHideProgress(): bool; + /** + * @return non-empty-string + */ public function getIndent(): string; + /** + * @return non-empty-string + */ public function getLineEnding(): string; /** @@ -65,6 +71,10 @@ public function getName(): string; /** * Get configured PHP executable, if any. + * + * @deprecated + * + * @TODO 4.0 remove me */ public function getPhpExecutable(): ?string; @@ -92,12 +102,14 @@ public function getUsingCache(): bool; * * Name of custom fixer should follow `VendorName/rule_name` convention. * - * @param FixerInterface[]|iterable|\Traversable $fixers + * @param iterable $fixers */ public function registerCustomFixers(iterable $fixers): self; /** * Sets the path to the cache file. + * + * @param non-empty-string $cacheFile */ public function setCacheFile(string $cacheFile): self; @@ -110,12 +122,22 @@ public function setFormat(string $format): self; public function setHideProgress(bool $hideProgress): self; + /** + * @param non-empty-string $indent + */ public function setIndent(string $indent): self; + /** + * @param non-empty-string $lineEnding + */ public function setLineEnding(string $lineEnding): self; /** * Set PHP executable. + * + * @deprecated + * + * @TODO 4.0 remove me */ public function setPhpExecutable(?string $phpExecutable): self; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php index 140385c3..8607bbfa 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php @@ -30,7 +30,7 @@ class InvalidFixerConfigurationException extends InvalidConfigurationException public function __construct(string $fixerName, string $message, ?\Throwable $previous = null) { parent::__construct( - sprintf('[%s] %s', $fixerName, $message), + \sprintf('[%s] %s', $fixerName, $message), FixCommandExitStatusCalculator::EXIT_STATUS_FLAG_HAS_INVALID_FIXER_CONFIG, $previous ); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidForEnvFixerConfigurationException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidForEnvFixerConfigurationException.php index 6e4dcd4b..440b2470 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidForEnvFixerConfigurationException.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidForEnvFixerConfigurationException.php @@ -19,6 +19,4 @@ * * @internal */ -final class InvalidForEnvFixerConfigurationException extends InvalidFixerConfigurationException -{ -} +final class InvalidForEnvFixerConfigurationException extends InvalidFixerConfigurationException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/RequiredFixerConfigurationException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/RequiredFixerConfigurationException.php index d229cda3..bcc07bdf 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/RequiredFixerConfigurationException.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/RequiredFixerConfigurationException.php @@ -19,6 +19,4 @@ * * @internal */ -final class RequiredFixerConfigurationException extends InvalidFixerConfigurationException -{ -} +final class RequiredFixerConfigurationException extends InvalidFixerConfigurationException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php index 8705dec6..635d7986 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php @@ -14,18 +14,22 @@ namespace PhpCsFixer\Console; +use PhpCsFixer\Console\Command\CheckCommand; use PhpCsFixer\Console\Command\DescribeCommand; use PhpCsFixer\Console\Command\FixCommand; use PhpCsFixer\Console\Command\HelpCommand; use PhpCsFixer\Console\Command\ListFilesCommand; use PhpCsFixer\Console\Command\ListSetsCommand; use PhpCsFixer\Console\Command\SelfUpdateCommand; +use PhpCsFixer\Console\Command\WorkerCommand; use PhpCsFixer\Console\SelfUpdate\GithubClient; use PhpCsFixer\Console\SelfUpdate\NewVersionChecker; use PhpCsFixer\PharChecker; +use PhpCsFixer\Runner\Parallel\WorkerException; use PhpCsFixer\ToolInfo; use PhpCsFixer\Utils; use Symfony\Component\Console\Application as BaseApplication; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\ListCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\ConsoleOutputInterface; @@ -39,19 +43,25 @@ */ final class Application extends BaseApplication { - public const VERSION = '3.16.0'; - public const VERSION_CODENAME = 'BoY42'; + public const NAME = 'PHP CS Fixer'; + public const VERSION = '3.68.1'; + public const VERSION_CODENAME = 'Persian Successor'; + /** + * @readonly + */ private ToolInfo $toolInfo; + private ?Command $executedCommand = null; public function __construct() { - parent::__construct('PHP CS Fixer', self::VERSION); + parent::__construct(self::NAME, self::VERSION); $this->toolInfo = new ToolInfo(); // in alphabetical order $this->add(new DescribeCommand()); + $this->add(new CheckCommand($this->toolInfo)); $this->add(new FixCommand($this->toolInfo)); $this->add(new ListFilesCommand($this->toolInfo)); $this->add(new ListSetsCommand()); @@ -60,6 +70,7 @@ public function __construct() $this->toolInfo, new PharChecker() )); + $this->add(new WorkerCommand($this->toolInfo)); } public static function getMajorVersion(): int @@ -67,9 +78,6 @@ public static function getMajorVersion(): int return (int) explode('.', self::VERSION)[0]; } - /** - * {@inheritdoc} - */ public function doRun(InputInterface $input, OutputInterface $output): int { $stdErr = $output instanceof ConsoleOutputInterface @@ -84,7 +92,7 @@ public function doRun(InputInterface $input, OutputInterface $output): int if (\count($warnings) > 0) { foreach ($warnings as $warning) { - $stdErr->writeln(sprintf($stdErr->isDecorated() ? '%s' : '%s', $warning)); + $stdErr->writeln(\sprintf($stdErr->isDecorated() ? '%s' : '%s', $warning)); } $stdErr->writeln(''); } @@ -102,7 +110,7 @@ public function doRun(InputInterface $input, OutputInterface $output): int $stdErr->writeln(''); $stdErr->writeln($stdErr->isDecorated() ? 'Detected deprecations in use:' : 'Detected deprecations in use:'); foreach ($triggeredDeprecations as $deprecation) { - $stdErr->writeln(sprintf('- %s', $deprecation)); + $stdErr->writeln(\sprintf('- %s', $deprecation)); } } } @@ -111,10 +119,12 @@ public function doRun(InputInterface $input, OutputInterface $output): int } /** - * {@inheritdoc} + * @internal */ - public function getLongVersion(): string + public static function getAbout(bool $decorated = false): string { + $longVersion = \sprintf('%s %s', self::NAME, self::VERSION); + $commit = '@git-commit@'; $versionCommit = ''; @@ -122,20 +132,81 @@ public function getLongVersion(): string $versionCommit = substr($commit, 0, 7); } - return implode('', [ - parent::getLongVersion(), - $versionCommit ? sprintf(' (%s)', $versionCommit) : '', // @phpstan-ignore-line to avoid `Ternary operator condition is always true|false.` - self::VERSION_CODENAME ? sprintf(' %s', self::VERSION_CODENAME) : '', // @phpstan-ignore-line to avoid `Ternary operator condition is always true|false.` - ' by Fabien Potencier and Dariusz Ruminski.', - "\nPHP runtime: ".PHP_VERSION.'', + $about = implode('', [ + $longVersion, + $versionCommit ? \sprintf(' (%s)', $versionCommit) : '', // @phpstan-ignore-line to avoid `Ternary operator condition is always true|false.` + self::VERSION_CODENAME ? \sprintf(' %s', self::VERSION_CODENAME) : '', // @phpstan-ignore-line to avoid `Ternary operator condition is always true|false.` + ' by Fabien Potencier, Dariusz Ruminski and contributors.', ]); + + if (false === $decorated) { + return strip_tags($about); + } + + return $about; } /** - * {@inheritdoc} + * @internal */ + public static function getAboutWithRuntime(bool $decorated = false): string + { + $about = self::getAbout(true)."\nPHP runtime: ".PHP_VERSION.''; + if (false === $decorated) { + return strip_tags($about); + } + + return $about; + } + + public function getLongVersion(): string + { + return self::getAboutWithRuntime(true); + } + protected function getDefaultCommands(): array { return [new HelpCommand(), new ListCommand()]; } + + /** + * @throws \Throwable + */ + protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output): int + { + $this->executedCommand = $command; + + return parent::doRunCommand($command, $input, $output); + } + + protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void + { + // Since parallel analysis utilises child processes, and they have their own output, + // we need to capture the output of the child process to determine it there was an exception. + // Default render format is not machine-friendly, so we need to override it for `worker` command, + // in order to be able to easily parse exception data for further displaying on main process' side. + if ($this->executedCommand instanceof WorkerCommand) { + $output->writeln(WorkerCommand::ERROR_PREFIX.json_encode( + [ + 'class' => \get_class($e), + 'message' => $e->getMessage(), + 'file' => $e->getFile(), + 'line' => $e->getLine(), + 'code' => $e->getCode(), + 'trace' => $e->getTraceAsString(), + ] + )); + + return; + } + + parent::doRenderThrowable($e, $output); + + if ($output->isVeryVerbose() && $e instanceof WorkerException) { + $output->writeln('Original trace from worker:'); + $output->writeln(''); + $output->writeln($e->getOriginalTraceAsString()); + $output->writeln(''); + } + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php new file mode 100644 index 00000000..cb261916 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php @@ -0,0 +1,64 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Console\Command; + +use PhpCsFixer\ToolInfoInterface; +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; + +/** + * @author Greg Korba + * + * @internal + */ +#[AsCommand(name: 'check', description: 'Checks if configured files/directories comply with configured rules.')] +final class CheckCommand extends FixCommand +{ + protected static $defaultName = 'check'; + + protected static $defaultDescription = 'Checks if configured files/directories comply with configured rules.'; + + public function __construct(ToolInfoInterface $toolInfo) + { + parent::__construct($toolInfo); + } + + public function getHelp(): string + { + $help = explode('--dry-run', parent::getHelp()); + + return substr($help[0], 0, strrpos($help[0], "\n") - 1) + .substr($help[1], strpos($help[1], "\n")); + } + + protected function configure(): void + { + parent::configure(); + + $this->setDefinition([ + ...array_values($this->getDefinition()->getArguments()), + ...array_values(array_filter( + $this->getDefinition()->getOptions(), + static fn (InputOption $option): bool => 'dry-run' !== $option->getName() + )), + ]); + } + + protected function isDryRun(InputInterface $input): bool + { + return true; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php index 3410794b..f3ae6569 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php @@ -14,11 +14,17 @@ namespace PhpCsFixer\Console\Command; +use PhpCsFixer\Config; +use PhpCsFixer\Console\Application; +use PhpCsFixer\Console\ConfigurationResolver; use PhpCsFixer\Differ\DiffConsoleFormatter; use PhpCsFixer\Differ\FullDiffer; +use PhpCsFixer\Documentation\FixerDocumentGenerator; use PhpCsFixer\Fixer\ConfigurableFixerInterface; use PhpCsFixer\Fixer\DeprecatedFixerInterface; +use PhpCsFixer\Fixer\ExperimentalFixerInterface; use PhpCsFixer\Fixer\FixerInterface; +use PhpCsFixer\Fixer\InternalFixerInterface; use PhpCsFixer\FixerConfiguration\AliasedFixerOption; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\DeprecatedFixerOption; @@ -30,6 +36,7 @@ use PhpCsFixer\RuleSet\RuleSets; use PhpCsFixer\StdinFileInfo; use PhpCsFixer\Tokenizer\Tokens; +use PhpCsFixer\ToolInfo; use PhpCsFixer\Utils; use PhpCsFixer\WordMatcher; use Symfony\Component\Console\Attribute\AsCommand; @@ -37,6 +44,7 @@ use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -48,22 +56,19 @@ #[AsCommand(name: 'describe')] final class DescribeCommand extends Command { - /** - * @var string - */ protected static $defaultName = 'describe'; /** - * @var string[] + * @var ?list */ - private $setNames; + private ?array $setNames = null; private FixerFactory $fixerFactory; /** - * @var array + * @var null|array */ - private $fixers; + private ?array $fixers = null; public function __construct(?FixerFactory $fixerFactory = null) { @@ -77,31 +82,35 @@ public function __construct(?FixerFactory $fixerFactory = null) $this->fixerFactory = $fixerFactory; } - /** - * {@inheritdoc} - */ protected function configure(): void { $this ->setDefinition( [ new InputArgument('name', InputArgument::REQUIRED, 'Name of rule / set.'), + new InputOption('config', '', InputOption::VALUE_REQUIRED, 'The path to a .php-cs-fixer.php file.'), ] ) ->setDescription('Describe rule / ruleset.') ; } - /** - * {@inheritdoc} - */ protected function execute(InputInterface $input, OutputInterface $output): int { - if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity() && $output instanceof ConsoleOutputInterface) { + if ($output instanceof ConsoleOutputInterface) { $stdErr = $output->getErrorOutput(); - $stdErr->writeln($this->getApplication()->getLongVersion()); + $stdErr->writeln(Application::getAboutWithRuntime(true)); } + $resolver = new ConfigurationResolver( + new Config(), + ['config' => $input->getOption('config')], + getcwd(), + new ToolInfo() + ); + + $this->fixerFactory->registerCustomFixers($resolver->getConfig()->getCustomFixers()); + $name = $input->getArgument('name'); try { @@ -121,7 +130,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->describeList($output, $e->getType()); - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException(\sprintf( '%s "%s" not found.%s', ucfirst($e->getType()), $name, @@ -145,24 +154,28 @@ private function describeRule(OutputInterface $output, string $name): void $definition = $fixer->getDefinition(); - $summary = $definition->getSummary(); + $output->writeln(\sprintf('Description of the `%s` rule.', $name)); + $output->writeln(''); + + if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { + $output->writeln(\sprintf('Fixer class: %s.', \get_class($fixer))); + $output->writeln(''); + } if ($fixer instanceof DeprecatedFixerInterface) { $successors = $fixer->getSuccessorsNames(); $message = [] === $successors - ? 'will be removed on next major version' - : sprintf('use %s instead', Utils::naturalLanguageJoinWithBackticks($successors)); - $message = Preg::replace('/(`.+?`)/', '$1', $message); - $summary .= sprintf(' DEPRECATED: %s.', $message); - } - - $output->writeln(sprintf('Description of %s rule.', $name)); + ? \sprintf('it will be removed in version %d.0', Application::getMajorVersion() + 1) + : \sprintf('use %s instead', Utils::naturalLanguageJoinWithBackticks($successors)); - if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { - $output->writeln(sprintf('Fixer class: %s.', \get_class($fixer))); + $endMessage = '. '.ucfirst($message); + Utils::triggerDeprecation(new \RuntimeException(str_replace('`', '"', "Rule \"{$name}\" is deprecated{$endMessage}."))); + $message = Preg::replace('/(`[^`]+`)/', '$1', $message); + $output->writeln(\sprintf('DEPRECATED: %s.', $message)); + $output->writeln(''); } - $output->writeln($summary); + $output->writeln($definition->getSummary()); $description = $definition->getDescription(); @@ -172,8 +185,22 @@ private function describeRule(OutputInterface $output, string $name): void $output->writeln(''); + if ($fixer instanceof ExperimentalFixerInterface) { + $output->writeln('Fixer applying this rule is EXPERIMENTAL..'); + $output->writeln('It is not covered with backward compatibility promise and may produce unstable or unexpected results.'); + + $output->writeln(''); + } + + if ($fixer instanceof InternalFixerInterface) { + $output->writeln('Fixer applying this rule is INTERNAL..'); + $output->writeln('It is expected to be used only on PHP CS Fixer project itself.'); + + $output->writeln(''); + } + if ($fixer->isRisky()) { - $output->writeln('Fixer applying this rule is risky.'); + $output->writeln('Fixer applying this rule is RISKY.'); $riskyDescription = $definition->getRiskyDescription(); @@ -188,7 +215,7 @@ private function describeRule(OutputInterface $output, string $name): void $configurationDefinition = $fixer->getConfigurationDefinition(); $options = $configurationDefinition->getOptions(); - $output->writeln(sprintf('Fixer is configurable using following option%s:', 1 === \count($options) ? '' : 's')); + $output->writeln(\sprintf('Fixer is configurable using following option%s:', 1 === \count($options) ? '' : 's')); foreach ($options as $option) { $line = '* '.OutputFormatter::escape($option->getName()).''; @@ -200,22 +227,20 @@ private function describeRule(OutputInterface $output, string $name): void $option->getAllowedTypes(), ); } else { - $allowed = array_map(static function ($value): string { - return $value instanceof AllowedValueSubset - ? 'a subset of '.HelpCommand::toString($value->getAllowedValues()).'' - : ''.HelpCommand::toString($value).''; - }, $allowed); + $allowed = array_map(static fn ($value): string => $value instanceof AllowedValueSubset + ? 'a subset of '.Utils::toString($value->getAllowedValues()).'' + : ''.Utils::toString($value).'', $allowed); } - $line .= ' ('.implode(', ', $allowed).')'; + $line .= ' ('.Utils::naturalLanguageJoin($allowed, '').')'; $description = Preg::replace('/(`.+?`)/', '$1', OutputFormatter::escape($option->getDescription())); $line .= ': '.lcfirst(Preg::replace('/\.$/', '', $description)).'; '; if ($option->hasDefault()) { - $line .= sprintf( + $line .= \sprintf( 'defaults to %s', - HelpCommand::toString($option->getDefault()) + Utils::toString($option->getDefault()) ); } else { $line .= 'required'; @@ -239,7 +264,7 @@ private function describeRule(OutputInterface $output, string $name): void $output->writeln(''); } - /** @var CodeSampleInterface[] $codeSamples */ + /** @var list $codeSamples */ $codeSamples = array_filter($definition->getCodeSamples(), static function (CodeSampleInterface $codeSample): bool { if ($codeSample instanceof VersionSpecificCodeSampleInterface) { return $codeSample->isSuitableFor(\PHP_VERSION_ID); @@ -248,9 +273,14 @@ private function describeRule(OutputInterface $output, string $name): void return true; }); - if (0 === \count($codeSamples)) { + if (0 === \count($definition->getCodeSamples())) { + $output->writeln([ + 'Fixing examples are not available for this rule.', + '', + ]); + } elseif (0 === \count($codeSamples)) { $output->writeln([ - 'Fixing examples cannot be demonstrated on the current PHP version.', + 'Fixing examples cannot be demonstrated on the current PHP version.', '', ]); } else { @@ -259,7 +289,7 @@ private function describeRule(OutputInterface $output, string $name): void $differ = new FullDiffer(); $diffFormatter = new DiffConsoleFormatter( $output->isDecorated(), - sprintf( + \sprintf( ' ---------- begin diff ----------%s%%s%s ----------- end diff -----------', PHP_EOL, PHP_EOL @@ -286,17 +316,35 @@ private function describeRule(OutputInterface $output, string $name): void if ($fixer instanceof ConfigurableFixerInterface) { if (null === $configuration) { - $output->writeln(sprintf(' * Example #%d. Fixing with the default configuration.', $index + 1)); + $output->writeln(\sprintf(' * Example #%d. Fixing with the default configuration.', $index + 1)); } else { - $output->writeln(sprintf(' * Example #%d. Fixing with configuration: %s.', $index + 1, HelpCommand::toString($codeSample->getConfiguration()))); + $output->writeln(\sprintf(' * Example #%d. Fixing with configuration: %s.', $index + 1, Utils::toString($codeSample->getConfiguration()))); } } else { - $output->writeln(sprintf(' * Example #%d.', $index + 1)); + $output->writeln(\sprintf(' * Example #%d.', $index + 1)); } $output->writeln([$diffFormatter->format($diff, ' %s'), '']); } } + + $ruleSetConfigs = FixerDocumentGenerator::getSetsOfRule($name); + + if ([] !== $ruleSetConfigs) { + ksort($ruleSetConfigs); + $plural = 1 !== \count($ruleSetConfigs) ? 's' : ''; + $output->writeln("Fixer is part of the following rule set{$plural}:"); + + foreach ($ruleSetConfigs as $set => $config) { + if (null !== $config) { + $output->writeln(\sprintf('* %s with config: %s', $set, Utils::toString($config))); + } else { + $output->writeln(\sprintf('* %s with default config', $set)); + } + } + + $output->writeln(''); + } } private function describeSet(OutputInterface $output, string $name): void @@ -308,21 +356,23 @@ private function describeSet(OutputInterface $output, string $name): void $ruleSetDefinitions = RuleSets::getSetDefinitions(); $fixers = $this->getFixers(); - $output->writeln(sprintf('Description of the %s set.', $ruleSetDefinitions[$name]->getName())); + $output->writeln(\sprintf('Description of the `%s` set.', $ruleSetDefinitions[$name]->getName())); + $output->writeln(''); + $output->writeln($this->replaceRstLinks($ruleSetDefinitions[$name]->getDescription())); + $output->writeln(''); if ($ruleSetDefinitions[$name]->isRisky()) { - $output->writeln('This set contains risky rules.'); + $output->writeln('This set contains risky rules.'); + $output->writeln(''); } - $output->writeln(''); - $help = ''; foreach ($ruleSetDefinitions[$name]->getRules() as $rule => $config) { if (str_starts_with($rule, '@')) { $set = $ruleSetDefinitions[$rule]; - $help .= sprintf( + $help .= \sprintf( " * %s%s\n | %s\n\n", $rule, $set->isRisky() ? ' risky' : '', @@ -336,12 +386,12 @@ private function describeSet(OutputInterface $output, string $name): void $fixer = $fixers[$rule]; $definition = $fixer->getDefinition(); - $help .= sprintf( + $help .= \sprintf( " * %s%s\n | %s\n%s\n", $rule, $fixer->isRisky() ? ' risky' : '', $definition->getSummary(), - true !== $config ? sprintf(" | Configuration: %s\n", HelpCommand::toString($config)) : '' + true !== $config ? \sprintf(" | Configuration: %s\n", Utils::toString($config)) : '' ); } @@ -370,7 +420,7 @@ private function getFixers(): array } /** - * @return string[] + * @return list */ private function getSetNames(): array { @@ -388,23 +438,25 @@ private function getSetNames(): array */ private function describeList(OutputInterface $output, string $type): void { - if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE) { - $describe = [ - 'sets' => $this->getSetNames(), - 'rules' => $this->getFixers(), - ]; - } elseif ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { - $describe = 'set' === $type ? ['sets' => $this->getSetNames()] : ['rules' => $this->getFixers()]; - } else { + if ($output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE) { return; } - /** @var string[] $items */ - foreach ($describe as $list => $items) { - $output->writeln(sprintf('Defined %s:', $list)); + if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE || 'set' === $type) { + $output->writeln('Defined sets:'); + + $items = $this->getSetNames(); + foreach ($items as $item) { + $output->writeln(\sprintf('* %s', $item)); + } + } + + if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE || 'rule' === $type) { + $output->writeln('Defined rules:'); - foreach ($items as $name => $item) { - $output->writeln(sprintf('* %s', \is_string($name) ? $name : $item)); + $items = array_keys($this->getFixers()); + foreach ($items as $item) { + $output->writeln(\sprintf('* %s', $item)); } } } @@ -413,15 +465,11 @@ private function replaceRstLinks(string $content): string { return Preg::replaceCallback( '/(`[^<]+<[^>]+>`_)/', - static function (array $matches) { - return Preg::replaceCallback( - '/`(.*)<(.*)>`_/', - static function (array $matches): string { - return $matches[1].'('.$matches[2].')'; - }, - $matches[1] - ); - }, + static fn (array $matches) => Preg::replaceCallback( + '/`(.*)<(.*)>`_/', + static fn (array $matches): string => $matches[1].'('.$matches[2].')', + $matches[1] + ), $content ); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php index 95a7f57b..a2e34695 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php @@ -16,7 +16,6 @@ use PhpCsFixer\Documentation\DocumentationLocator; use PhpCsFixer\Documentation\FixerDocumentGenerator; -use PhpCsFixer\Documentation\ListDocumentGenerator; use PhpCsFixer\Documentation\RuleSetDocumentationGenerator; use PhpCsFixer\FixerFactory; use PhpCsFixer\RuleSet\RuleSets; @@ -34,11 +33,16 @@ #[AsCommand(name: 'documentation')] final class DocumentationCommand extends Command { - /** - * @var string - */ protected static $defaultName = 'documentation'; + private Filesystem $filesystem; + + public function __construct(Filesystem $filesystem) + { + parent::__construct(); + $this->filesystem = $filesystem; + } + protected function configure(): void { $this @@ -49,7 +53,6 @@ protected function configure(): void protected function execute(InputInterface $input, OutputInterface $output): int { - $filesystem = new Filesystem(); $locator = new DocumentationLocator(); $fixerFactory = new FixerFactory(); @@ -60,7 +63,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int $fixerDocumentGenerator = new FixerDocumentGenerator($locator); $ruleSetDocumentationGenerator = new RuleSetDocumentationGenerator($locator); - $listDocumentGenerator = new ListDocumentGenerator($locator); // Array of existing fixer docs. // We first override existing files, and then we will delete files that are no longer needed. @@ -70,7 +72,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int foreach ($fixers as $fixer) { $docForFixerRelativePaths[] = $locator->getFixerDocumentationFileRelativePath($fixer); - $filesystem->dumpFile( + $this->filesystem->dumpFile( $locator->getFixerDocumentationFilePath($fixer), $fixerDocumentGenerator->generateFixerDocumentation($fixer) ); @@ -82,12 +84,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int ->in($locator->getFixersDocumentationDirectoryPath()) ->notPath($docForFixerRelativePaths) as $file ) { - $filesystem->remove($file->getPathname()); + $this->filesystem->remove($file->getPathname()); } // Fixer doc. index - $filesystem->dumpFile( + $this->filesystem->dumpFile( $locator->getFixersDocumentationIndexFilePath(), $fixerDocumentGenerator->generateFixersDocumentationIndex($fixers) ); @@ -96,31 +98,24 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** @var SplFileInfo $file */ foreach ((new Finder())->files()->in($locator->getRuleSetsDocumentationDirectoryPath()) as $file) { - $filesystem->remove($file->getPathname()); + $this->filesystem->remove($file->getPathname()); } $paths = []; foreach ($setDefinitions as $name => $definition) { $path = $locator->getRuleSetsDocumentationFilePath($name); - $paths[$name] = $path; - $filesystem->dumpFile($path, $ruleSetDocumentationGenerator->generateRuleSetsDocumentation($definition, $fixers)); + $paths[$path] = $definition; + $this->filesystem->dumpFile($path, $ruleSetDocumentationGenerator->generateRuleSetsDocumentation($definition, $fixers)); } // RuleSet doc. index - $filesystem->dumpFile( + $this->filesystem->dumpFile( $locator->getRuleSetsDocumentationIndexFilePath(), $ruleSetDocumentationGenerator->generateRuleSetsDocumentationIndex($paths) ); - // List file / Appendix - - $filesystem->dumpFile( - $locator->getListingFilePath(), - $listDocumentGenerator->generateListingDocumentation($fixers) - ); - $output->writeln('Docs updated.'); return 0; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php index 0d8de7f5..7c157f95 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php @@ -17,16 +17,20 @@ use PhpCsFixer\Config; use PhpCsFixer\ConfigInterface; use PhpCsFixer\ConfigurationException\InvalidConfigurationException; +use PhpCsFixer\Console\Application; use PhpCsFixer\Console\ConfigurationResolver; use PhpCsFixer\Console\Output\ErrorOutput; -use PhpCsFixer\Console\Output\NullOutput; -use PhpCsFixer\Console\Output\ProcessOutput; +use PhpCsFixer\Console\Output\OutputContext; +use PhpCsFixer\Console\Output\Progress\ProgressOutputFactory; +use PhpCsFixer\Console\Output\Progress\ProgressOutputType; use PhpCsFixer\Console\Report\FixReport\ReportSummary; use PhpCsFixer\Error\ErrorsManager; +use PhpCsFixer\Runner\Event\FileProcessed; use PhpCsFixer\Runner\Runner; use PhpCsFixer\ToolInfoInterface; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -41,16 +45,17 @@ * @author Fabien Potencier * @author Dariusz Rumiński * + * @final + * * @internal */ -#[AsCommand(name: 'fix')] -final class FixCommand extends Command +#[AsCommand(name: 'fix', description: 'Fixes a directory or a file.')] +/* final */ class FixCommand extends Command { - /** - * @var string - */ protected static $defaultName = 'fix'; + protected static $defaultDescription = 'Fixes a directory or a file.'; + private EventDispatcherInterface $eventDispatcher; private ErrorsManager $errorsManager; @@ -61,6 +66,8 @@ final class FixCommand extends Command private ToolInfoInterface $toolInfo; + private ProgressOutputFactory $progressOutputFactory; + public function __construct(ToolInfoInterface $toolInfo) { parent::__construct(); @@ -70,6 +77,7 @@ public function __construct(ToolInfoInterface $toolInfo) $this->stopwatch = new Stopwatch(); $this->defaultConfig = new Config(); $this->toolInfo = $toolInfo; + $this->progressOutputFactory = new ProgressOutputFactory(); } /** @@ -80,140 +88,136 @@ public function __construct(ToolInfoInterface $toolInfo) public function getHelp(): string { return <<<'EOF' -The %command.name% command tries to fix as much coding standards -problems as possible on a given file or files in a given directory and its subdirectories: + The %command.name% command tries to %command.name% as much coding standards + problems as possible on a given file or files in a given directory and its subdirectories: + + $ php %command.full_name% /path/to/dir + $ php %command.full_name% /path/to/file - $ php %command.full_name% /path/to/dir - $ php %command.full_name% /path/to/file + By default --path-mode is set to `override`, which means, that if you specify the path to a file or a directory via + command arguments, then the paths provided to a `Finder` in config file will be ignored. You can use --path-mode=intersection + to merge paths from the config file and from the argument: -By default --path-mode is set to `override`, which means, that if you specify the path to a file or a directory via -command arguments, then the paths provided to a `Finder` in config file will be ignored. You can use --path-mode=intersection -to merge paths from the config file and from the argument: + $ php %command.full_name% --path-mode=intersection /path/to/dir - $ php %command.full_name% --path-mode=intersection /path/to/dir + The --format option for the output format. Supported formats are `txt` (default one), `json`, `xml`, `checkstyle`, `junit` and `gitlab`. -The --format option for the output format. Supported formats are `txt` (default one), `json`, `xml`, `checkstyle`, `junit` and `gitlab`. + NOTE: the output for the following formats are generated in accordance with schemas -NOTE: the output for the following formats are generated in accordance with schemas + * `checkstyle` follows the common `"checkstyle" XML schema `_ + * `gitlab` follows the `codeclimate JSON schema `_ + * `json` follows the `own JSON schema `_ + * `junit` follows the `JUnit XML schema from Jenkins `_ + * `xml` follows the `own XML schema `_ -* `checkstyle` follows the common `"checkstyle" XML schema `_ -* `json` follows the `own JSON schema `_ -* `junit` follows the `JUnit XML schema from Jenkins `_ -* `xml` follows the `own XML schema `_ + The --quiet Do not output any message. -The --quiet Do not output any message. + The --verbose option will show the applied rules. When using the `txt` format it will also display progress notifications. -The --verbose option will show the applied rules. When using the `txt` format it will also display progress notifications. + NOTE: if there is an error like "errors reported during linting after fixing", you can use this to be even more verbose for debugging purpose -NOTE: if there is an error like "errors reported during linting after fixing", you can use this to be even more verbose for debugging purpose + * `-v`: verbose + * `-vv`: very verbose + * `-vvv`: debug -* `-v`: verbose -* `-vv`: very verbose -* `-vvv`: debug + The --rules option limits the rules to apply to the + project: -The --rules option limits the rules to apply to the -project: + EOF. /* @TODO: 4.0 - change to @PER */ <<<'EOF' -EOF. /* @TODO: 4.0 - change to @PER */ <<<'EOF' + $ php %command.full_name% /path/to/project --rules=@PSR12 - $ php %command.full_name% /path/to/project --rules=@PSR12 + By default the PSR-12 rules are used. -By default the PSR-12 rules are used. + The --rules option lets you choose the exact rules to + apply (the rule names must be separated by a comma): -The --rules option lets you choose the exact rules to -apply (the rule names must be separated by a comma): + $ php %command.full_name% /path/to/dir --rules=line_ending,full_opening_tag,indentation_type - $ php %command.full_name% /path/to/dir --rules=line_ending,full_opening_tag,indentation_type + You can also exclude the rules you don't want by placing a dash in front of the rule name, if this is more convenient, + using -name_of_fixer: -You can also exclude the rules you don't want by placing a dash in front of the rule name, if this is more convenient, -using -name_of_fixer: + $ php %command.full_name% /path/to/dir --rules=-full_opening_tag,-indentation_type - $ php %command.full_name% /path/to/dir --rules=-full_opening_tag,-indentation_type + When using combinations of exact and exclude rules, applying exact rules along with above excluded results: -When using combinations of exact and exclude rules, applying exact rules along with above excluded results: + $ php %command.full_name% /path/to/project --rules=@Symfony,-@PSR1,-blank_line_before_statement,strict_comparison - $ php %command.full_name% /path/to/project --rules=@Symfony,-@PSR1,-blank_line_before_statement,strict_comparison + Complete configuration for rules can be supplied using a `json` formatted string. -Complete configuration for rules can be supplied using a `json` formatted string. + $ php %command.full_name% /path/to/project --rules='{"concat_space": {"spacing": "none"}}' - $ php %command.full_name% /path/to/project --rules='{"concat_space": {"spacing": "none"}}' + The --dry-run flag will run the fixer without making changes to your files. -The --dry-run flag will run the fixer without making changes to your files. + The --sequential flag will enforce sequential analysis even if parallel config is provided. -The --diff flag can be used to let the fixer output all the changes it makes. + The --diff flag can be used to let the fixer output all the changes it makes. -The --allow-risky option (pass `yes` or `no`) allows you to set whether risky rules may run. Default value is taken from config file. -A rule is considered risky if it could change code behaviour. By default no risky rules are run. + The --allow-risky option (pass `yes` or `no`) allows you to set whether risky rules may run. Default value is taken from config file. + A rule is considered risky if it could change code behaviour. By default no risky rules are run. -The --stop-on-violation flag stops the execution upon first file that needs to be fixed. + The --stop-on-violation flag stops the execution upon first file that needs to be fixed. -The --show-progress option allows you to choose the way process progress is rendered: + The --show-progress option allows you to choose the way process progress is rendered: -* none: disables progress output; -* dots: multiline progress output with number of files and percentage on each line. + * none: disables progress output; + * dots: multiline progress output with number of files and percentage on each line. + * bar: single line progress output with number of files and calculated percentage. -If the option is not provided, it defaults to dots unless a config file that disables output is used, in which case it defaults to none. This option has no effect if the verbosity of the command is less than verbose. + If the option is not provided, it defaults to bar unless a config file that disables output is used, in which case it defaults to none. This option has no effect if the verbosity of the command is less than verbose. - $ php %command.full_name% --verbose --show-progress=dots + $ php %command.full_name% --verbose --show-progress=dots -By using --using-cache option with `yes` or `no` you can set if the caching -mechanism should be used. + By using --using-cache option with `yes` or `no` you can set if the caching + mechanism should be used. -The command can also read from standard input, in which case it won't -automatically fix anything: + The command can also read from standard input, in which case it won't + automatically fix anything: - $ cat foo.php | php %command.full_name% --diff - + $ cat foo.php | php %command.full_name% --diff - -Finally, if you don't need BC kept on CLI level, you might use `PHP_CS_FIXER_FUTURE_MODE` to start using options that -would be default in next MAJOR release and to forbid using deprecated configuration: + Finally, if you don't need BC kept on CLI level, you might use `PHP_CS_FIXER_FUTURE_MODE` to start using options that + would be default in next MAJOR release and to forbid using deprecated configuration: - $ PHP_CS_FIXER_FUTURE_MODE=1 php %command.full_name% -v --diff + $ PHP_CS_FIXER_FUTURE_MODE=1 php %command.full_name% -v --diff -Exit code ---------- + Exit code + --------- -Exit code of the fix command is built using following bit flags: + Exit code of the `%command.name%` command is built using following bit flags: -* 0 - OK. -* 1 - General error (or PHP minimal requirement not matched). -* 4 - Some files have invalid syntax (only in dry-run mode). -* 8 - Some files need fixing (only in dry-run mode). -* 16 - Configuration error of the application. -* 32 - Configuration error of a Fixer. -* 64 - Exception raised within the application. + * 0 - OK. + * 1 - General error (or PHP minimal requirement not matched). + * 4 - Some files have invalid syntax (only in dry-run mode). + * 8 - Some files need fixing (only in dry-run mode). + * 16 - Configuration error of the application. + * 32 - Configuration error of a Fixer. + * 64 - Exception raised within the application. -EOF; + EOF; } - /** - * {@inheritdoc} - */ protected function configure(): void { - $this - ->setDefinition( - [ - new InputArgument('path', InputArgument::IS_ARRAY, 'The path.'), - new InputOption('path-mode', '', InputOption::VALUE_REQUIRED, 'Specify path mode (can be override or intersection).', ConfigurationResolver::PATH_MODE_OVERRIDE), - new InputOption('allow-risky', '', InputOption::VALUE_REQUIRED, 'Are risky fixers allowed (can be yes or no).'), - new InputOption('config', '', InputOption::VALUE_REQUIRED, 'The path to a .php-cs-fixer.php file.'), - new InputOption('dry-run', '', InputOption::VALUE_NONE, 'Only shows which files would have been modified.'), - new InputOption('rules', '', InputOption::VALUE_REQUIRED, 'The rules.'), - new InputOption('using-cache', '', InputOption::VALUE_REQUIRED, 'Does cache should be used (can be yes or no).'), - new InputOption('cache-file', '', InputOption::VALUE_REQUIRED, 'The path to the cache file.'), - new InputOption('diff', '', InputOption::VALUE_NONE, 'Also produce diff for each file.'), - new InputOption('format', '', InputOption::VALUE_REQUIRED, 'To output results in other formats.'), - new InputOption('stop-on-violation', '', InputOption::VALUE_NONE, 'Stop execution on first violation.'), - new InputOption('show-progress', '', InputOption::VALUE_REQUIRED, 'Type of progress indicator (none, dots).'), - ] - ) - ->setDescription('Fixes a directory or a file.') - ; + $this->setDefinition( + [ + new InputArgument('path', InputArgument::IS_ARRAY, 'The path(s) that rules will be run against (each path can be a file or directory).'), + new InputOption('path-mode', '', InputOption::VALUE_REQUIRED, 'Specify path mode (can be `override` or `intersection`).', ConfigurationResolver::PATH_MODE_OVERRIDE), + new InputOption('allow-risky', '', InputOption::VALUE_REQUIRED, 'Are risky fixers allowed (can be `yes` or `no`).'), + new InputOption('config', '', InputOption::VALUE_REQUIRED, 'The path to a config file.'), + new InputOption('dry-run', '', InputOption::VALUE_NONE, 'Only shows which files would have been modified.'), + new InputOption('rules', '', InputOption::VALUE_REQUIRED, 'List of rules that should be run against configured paths.'), + new InputOption('using-cache', '', InputOption::VALUE_REQUIRED, 'Should cache be used (can be `yes` or `no`).'), + new InputOption('cache-file', '', InputOption::VALUE_REQUIRED, 'The path to the cache file.'), + new InputOption('diff', '', InputOption::VALUE_NONE, 'Prints diff for each file.'), + new InputOption('format', '', InputOption::VALUE_REQUIRED, 'To output results in other formats.'), + new InputOption('stop-on-violation', '', InputOption::VALUE_NONE, 'Stop execution on first violation.'), + new InputOption('show-progress', '', InputOption::VALUE_REQUIRED, 'Type of progress indicator (none, dots).'), + new InputOption('sequential', '', InputOption::VALUE_NONE, 'Enforce sequential analysis.'), + ] + ); } - /** - * {@inheritdoc} - */ protected function execute(InputInterface $input, OutputInterface $output): int { $verbosity = $output->getVerbosity(); @@ -230,7 +234,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int [ 'allow-risky' => $input->getOption('allow-risky'), 'config' => $passedConfig, - 'dry-run' => $input->getOption('dry-run'), + 'dry-run' => $this->isDryRun($input), 'rules' => $passedRules, 'path' => $input->getArgument('path'), 'path-mode' => $input->getOption('path-mode'), @@ -241,6 +245,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int 'stop-on-violation' => $input->getOption('stop-on-violation'), 'verbosity' => $verbosity, 'show-progress' => $input->getOption('show-progress'), + 'sequential' => $input->getOption('sequential'), ], getcwd(), $this->toolInfo @@ -253,58 +258,84 @@ protected function execute(InputInterface $input, OutputInterface $output): int : ('txt' === $reporter->getFormat() ? $output : null); if (null !== $stdErr) { - if (OutputInterface::VERBOSITY_VERBOSE <= $verbosity) { - $stdErr->writeln($this->getApplication()->getLongVersion()); - } + $stdErr->writeln(Application::getAboutWithRuntime(true)); + $isParallel = $resolver->getParallelConfig()->getMaxProcesses() > 1; + + $stdErr->writeln(\sprintf( + 'Running analysis on %d core%s.', + $resolver->getParallelConfig()->getMaxProcesses(), + $isParallel ? \sprintf( + 's with %d file%s per process', + $resolver->getParallelConfig()->getFilesPerProcess(), + $resolver->getParallelConfig()->getFilesPerProcess() > 1 ? 's' : '' + ) : ' sequentially' + )); + + /** @TODO v4 remove warnings related to parallel runner */ + $usageDocs = 'https://cs.symfony.com/doc/usage.html'; + $stdErr->writeln(\sprintf( + $stdErr->isDecorated() ? '%s' : '%s', + $isParallel + ? 'Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!' + : \sprintf( + 'You can enable parallel runner and speed up the analysis! Please see %s for more information.', + $stdErr->isDecorated() + ? \sprintf('usage docs', OutputFormatter::escape($usageDocs)) + : $usageDocs + ) + )); $configFile = $resolver->getConfigFile(); - $stdErr->writeln(sprintf('Loaded config %s%s.', $resolver->getConfig()->getName(), null === $configFile ? '' : ' from "'.$configFile.'"')); + $stdErr->writeln(\sprintf('Loaded config %s%s.', $resolver->getConfig()->getName(), null === $configFile ? '' : ' from "'.$configFile.'"')); if ($resolver->getUsingCache()) { $cacheFile = $resolver->getCacheFile(); if (is_file($cacheFile)) { - $stdErr->writeln(sprintf('Using cache file "%s".', $cacheFile)); + $stdErr->writeln(\sprintf('Using cache file "%s".', $cacheFile)); } } } - $progressType = $resolver->getProgress(); $finder = new \ArrayIterator(iterator_to_array($resolver->getFinder())); if (null !== $stdErr && $resolver->configFinderIsOverridden()) { $stdErr->writeln( - sprintf($stdErr->isDecorated() ? '%s' : '%s', 'Paths from configuration file have been overridden by paths provided as command arguments.') + \sprintf($stdErr->isDecorated() ? '%s' : '%s', 'Paths from configuration file have been overridden by paths provided as command arguments.') ); } - if ('none' === $progressType || null === $stdErr) { - $progressOutput = new NullOutput(); - } else { - $progressOutput = new ProcessOutput( + $progressType = $resolver->getProgressType(); + $progressOutput = $this->progressOutputFactory->create( + $progressType, + new OutputContext( $stdErr, - $this->eventDispatcher, (new Terminal())->getWidth(), \count($finder) - ); - } + ) + ); $runner = new Runner( $finder, $resolver->getFixers(), $resolver->getDiffer(), - 'none' !== $progressType ? $this->eventDispatcher : null, + ProgressOutputType::NONE !== $progressType ? $this->eventDispatcher : null, $this->errorsManager, $resolver->getLinter(), $resolver->isDryRun(), $resolver->getCacheManager(), $resolver->getDirectory(), - $resolver->shouldStopOnViolation() + $resolver->shouldStopOnViolation(), + $resolver->getParallelConfig(), + $input, + $resolver->getConfigFile() ); + $this->eventDispatcher->addListener(FileProcessed::NAME, [$progressOutput, 'onFixerFileProcessed']); $this->stopwatch->start('fixFiles'); $changed = $runner->fix(); $this->stopwatch->stop('fixFiles'); + $this->eventDispatcher->removeListener(FileProcessed::NAME, [$progressOutput, 'onFixerFileProcessed']); $progressOutput->printLegend(); @@ -354,4 +385,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int \count($lintErrors) > 0 ); } + + protected function isDryRun(InputInterface $input): bool + { + return $input->getOption('dry-run'); + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommandExitStatusCalculator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommandExitStatusCalculator.php index 727dfff5..28d6b258 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommandExitStatusCalculator.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommandExitStatusCalculator.php @@ -28,8 +28,13 @@ final class FixCommandExitStatusCalculator public const EXIT_STATUS_FLAG_HAS_INVALID_FIXER_CONFIG = 32; public const EXIT_STATUS_FLAG_EXCEPTION_IN_APP = 64; - public function calculate(bool $isDryRun, bool $hasChangedFiles, bool $hasInvalidErrors, bool $hasExceptionErrors, bool $hasLintErrorsAfterFixing): int - { + public function calculate( + bool $isDryRun, + bool $hasChangedFiles, + bool $hasInvalidErrors, + bool $hasExceptionErrors, + bool $hasLintErrorsAfterFixing + ): int { $exitStatus = 0; if ($isDryRun) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php index c945a629..6dace362 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php @@ -16,7 +16,7 @@ use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerOptionInterface; -use PhpCsFixer\Preg; +use PhpCsFixer\Utils; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\HelpCommand as BaseHelpCommand; use Symfony\Component\Console\Formatter\OutputFormatterStyle; @@ -32,21 +32,8 @@ #[AsCommand(name: 'help')] final class HelpCommand extends BaseHelpCommand { - /** - * @var string - */ protected static $defaultName = 'help'; - /** - * @param mixed $value - */ - public static function toString($value): string - { - return \is_array($value) - ? static::arrayToString($value) - : static::scalarToString($value); - } - /** * Returns the allowed values of the given option that can be converted to a string. * @@ -57,9 +44,7 @@ public static function getDisplayableAllowedValues(FixerOptionInterface $option) $allowed = $option->getAllowedValues(); if (null !== $allowed) { - $allowed = array_filter($allowed, static function ($value): bool { - return !$value instanceof \Closure; - }); + $allowed = array_filter($allowed, static fn ($value): bool => !$value instanceof \Closure); usort($allowed, static function ($valueA, $valueB): int { if ($valueA instanceof AllowedValueSubset) { @@ -71,8 +56,8 @@ public static function getDisplayableAllowedValues(FixerOptionInterface $option) } return strcasecmp( - self::toString($valueA), - self::toString($valueB) + Utils::toString($valueA), + Utils::toString($valueB) ); }); @@ -84,46 +69,8 @@ public static function getDisplayableAllowedValues(FixerOptionInterface $option) return $allowed; } - /** - * {@inheritdoc} - */ protected function initialize(InputInterface $input, OutputInterface $output): void { $output->getFormatter()->setStyle('url', new OutputFormatterStyle('blue')); } - - /** - * @param mixed $value - */ - private static function scalarToString($value): string - { - $str = var_export($value, true); - - return Preg::replace('/\bNULL\b/', 'null', $str); - } - - /** - * @param array $value - */ - private static function arrayToString(array $value): string - { - if (0 === \count($value)) { - return '[]'; - } - - $isHash = !array_is_list($value); - $str = '['; - - foreach ($value as $k => $v) { - if ($isHash) { - $str .= static::scalarToString($k).' => '; - } - - $str .= \is_array($v) - ? static::arrayToString($v).', ' - : static::scalarToString($v).', '; - } - - return substr($str, 0, -2).']'; - } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php index b92dae77..93549116 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php @@ -23,6 +23,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Filesystem\Path; /** * @author Markus Staab @@ -32,9 +33,6 @@ #[AsCommand(name: 'list-files')] final class ListFilesCommand extends Command { - /** - * @var string - */ protected static $defaultName = 'list-files'; private ConfigInterface $defaultConfig; @@ -49,9 +47,6 @@ public function __construct(ToolInfoInterface $toolInfo) $this->toolInfo = $toolInfo; } - /** - * {@inheritdoc} - */ protected function configure(): void { $this @@ -83,7 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** @var \SplFileInfo $file */ foreach ($finder as $file) { if ($file->isFile()) { - $relativePath = str_replace($cwd, '.', $file->getRealPath()); + $relativePath = './'.Path::makeRelative($file->getRealPath(), $cwd); // unify directory separators across operating system $relativePath = str_replace('/', \DIRECTORY_SEPARATOR, $relativePath); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php index 8807f135..97737a79 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php @@ -20,6 +20,7 @@ use PhpCsFixer\Console\Report\ListSetsReport\ReportSummary; use PhpCsFixer\Console\Report\ListSetsReport\TextReporter; use PhpCsFixer\RuleSet\RuleSets; +use PhpCsFixer\Utils; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Formatter\OutputFormatter; @@ -35,14 +36,8 @@ #[AsCommand(name: 'list-sets')] final class ListSetsCommand extends Command { - /** - * @var string - */ protected static $defaultName = 'list-sets'; - /** - * {@inheritdoc} - */ protected function configure(): void { $this @@ -55,7 +50,7 @@ protected function configure(): void ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $reporter = $this->resolveReporterWithFactory( $input->getOption('format'), @@ -84,7 +79,7 @@ private function resolveReporterWithFactory(string $format, ReporterFactory $fac $formats = $factory->getFormats(); sort($formats); - throw new InvalidConfigurationException(sprintf('The format "%s" is not defined, supported are "%s".', $format, implode('", "', $formats))); + throw new InvalidConfigurationException(\sprintf('The format "%s" is not defined, supported are %s.', $format, Utils::naturalLanguageJoin($formats))); } return $reporter; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php index 947cd5b5..ab2b9049 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php @@ -14,6 +14,7 @@ namespace PhpCsFixer\Console\Command; +use PhpCsFixer\Console\Application; use PhpCsFixer\Console\SelfUpdate\NewVersionCheckerInterface; use PhpCsFixer\PharCheckerInterface; use PhpCsFixer\Preg; @@ -36,9 +37,6 @@ #[AsCommand(name: 'self-update')] final class SelfUpdateCommand extends Command { - /** - * @var string - */ protected static $defaultName = 'self-update'; private NewVersionCheckerInterface $versionChecker; @@ -59,9 +57,6 @@ public function __construct( $this->pharChecker = $pharChecker; } - /** - * {@inheritdoc} - */ protected function configure(): void { $this @@ -74,25 +69,22 @@ protected function configure(): void ->setDescription('Update php-cs-fixer.phar to the latest stable version.') ->setHelp( <<<'EOT' -The %command.name% command replace your php-cs-fixer.phar by the -latest version released on: -https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases + The %command.name% command replace your php-cs-fixer.phar by the + latest version released on: + https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases -$ php php-cs-fixer.phar %command.name% + $ php php-cs-fixer.phar %command.name% -EOT + EOT ) ; } - /** - * {@inheritdoc} - */ protected function execute(InputInterface $input, OutputInterface $output): int { - if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity() && $output instanceof ConsoleOutputInterface) { + if ($output instanceof ConsoleOutputInterface) { $stdErr = $output->getErrorOutput(); - $stdErr->writeln($this->getApplication()->getLongVersion()); + $stdErr->writeln(Application::getAboutWithRuntime(true)); } if (!$this->toolInfo->isInstalledAsPhar()) { @@ -109,7 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $latestVersion = $this->versionChecker->getLatestVersion(); $latestVersionOfCurrentMajor = $this->versionChecker->getLatestVersionOfMajor($currentMajor); } catch (\Exception $exception) { - $output->writeln(sprintf( + $output->writeln(\sprintf( 'Unable to determine newest version: %s', $exception->getMessage() )); @@ -129,8 +121,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int 0 !== $this->versionChecker->compareVersions($latestVersionOfCurrentMajor, $latestVersion) && true !== $input->getOption('force') ) { - $output->writeln(sprintf('A new major version of PHP CS Fixer is available (%s)', $latestVersion)); - $output->writeln(sprintf('Before upgrading please read https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/%s/UPGRADE-v%s.md', $latestVersion, $currentMajor + 1)); + $output->writeln(\sprintf('A new major version of PHP CS Fixer is available (%s)', $latestVersion)); + $output->writeln(\sprintf('Before upgrading please read https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/%s/UPGRADE-v%s.md', $latestVersion, $currentMajor + 1)); $output->writeln('If you are ready to upgrade run this command with -f'); $output->writeln('Checking for new minor/patch version...'); @@ -143,10 +135,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int $remoteTag = $latestVersionOfCurrentMajor; } - $localFilename = realpath($_SERVER['argv'][0]) ?: $_SERVER['argv'][0]; + $localFilename = $_SERVER['argv'][0]; + $realPath = realpath($localFilename); + if (false !== $realPath) { + $localFilename = $realPath; + } if (!is_writable($localFilename)) { - $output->writeln(sprintf('No permission to update "%s" file.', $localFilename)); + $output->writeln(\sprintf('No permission to update "%s" file.', $localFilename)); return 1; } @@ -155,7 +151,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $remoteFilename = $this->toolInfo->getPharDownloadUri($remoteTag); if (false === @copy($remoteFilename, $tempFilename)) { - $output->writeln(sprintf('Unable to download new version %s from the server.', $remoteTag)); + $output->writeln(\sprintf('Unable to download new version %s from the server.', $remoteTag)); return 1; } @@ -165,7 +161,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $pharInvalidityReason = $this->pharChecker->checkFileValidity($tempFilename); if (null !== $pharInvalidityReason) { unlink($tempFilename); - $output->writeln(sprintf('The download of %s is corrupt (%s).', $remoteTag, $pharInvalidityReason)); + $output->writeln(\sprintf('The download of %s is corrupt (%s).', $remoteTag, $pharInvalidityReason)); $output->writeln('Please re-run the "self-update" command to try again.'); return 1; @@ -173,7 +169,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int rename($tempFilename, $localFilename); - $output->writeln(sprintf('PHP CS Fixer updated (%s -> %s)', $currentVersion, $remoteTag)); + $output->writeln(\sprintf('PHP CS Fixer updated (%s -> %s)', $currentVersion, $remoteTag)); return 0; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/WorkerCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/WorkerCommand.php new file mode 100644 index 00000000..92f03bf9 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/WorkerCommand.php @@ -0,0 +1,243 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Console\Command; + +use Clue\React\NDJson\Decoder; +use Clue\React\NDJson\Encoder; +use PhpCsFixer\Cache\NullCacheManager; +use PhpCsFixer\Config; +use PhpCsFixer\Console\ConfigurationResolver; +use PhpCsFixer\Error\ErrorsManager; +use PhpCsFixer\Runner\Event\FileProcessed; +use PhpCsFixer\Runner\Parallel\ParallelAction; +use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; +use PhpCsFixer\Runner\Parallel\ParallelisationException; +use PhpCsFixer\Runner\Runner; +use PhpCsFixer\ToolInfoInterface; +use React\EventLoop\StreamSelectLoop; +use React\Socket\ConnectionInterface; +use React\Socket\TcpConnector; +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; + +/** + * @author Greg Korba + * + * @internal + */ +#[AsCommand(name: 'worker', description: 'Internal command for running fixers in parallel', hidden: true)] +final class WorkerCommand extends Command +{ + /** @var string Prefix used before JSON-encoded error printed in the worker's process */ + public const ERROR_PREFIX = 'WORKER_ERROR::'; + + protected static $defaultName = 'worker'; + + protected static $defaultDescription = 'Internal command for running fixers in parallel'; + + private ToolInfoInterface $toolInfo; + private ConfigurationResolver $configurationResolver; + private ErrorsManager $errorsManager; + private EventDispatcherInterface $eventDispatcher; + + /** @var list */ + private array $events; + + public function __construct(ToolInfoInterface $toolInfo) + { + parent::__construct(); + + $this->setHidden(true); + $this->toolInfo = $toolInfo; + $this->errorsManager = new ErrorsManager(); + $this->eventDispatcher = new EventDispatcher(); + } + + protected function configure(): void + { + $this->setDefinition( + [ + new InputOption('port', null, InputOption::VALUE_REQUIRED, 'Specifies parallelisation server\'s port.'), + new InputOption('identifier', null, InputOption::VALUE_REQUIRED, 'Specifies parallelisation process\' identifier.'), + new InputOption('allow-risky', '', InputOption::VALUE_REQUIRED, 'Are risky fixers allowed (can be `yes` or `no`).'), + new InputOption('config', '', InputOption::VALUE_REQUIRED, 'The path to a config file.'), + new InputOption('dry-run', '', InputOption::VALUE_NONE, 'Only shows which files would have been modified.'), + new InputOption('rules', '', InputOption::VALUE_REQUIRED, 'List of rules that should be run against configured paths.'), + new InputOption('using-cache', '', InputOption::VALUE_REQUIRED, 'Should cache be used (can be `yes` or `no`).'), + new InputOption('cache-file', '', InputOption::VALUE_REQUIRED, 'The path to the cache file.'), + new InputOption('diff', '', InputOption::VALUE_NONE, 'Prints diff for each file.'), + new InputOption('stop-on-violation', '', InputOption::VALUE_NONE, 'Stop execution on first violation.'), + ] + ); + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $errorOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output; + $identifier = $input->getOption('identifier'); + $port = $input->getOption('port'); + + if (null === $identifier || !is_numeric($port)) { + throw new ParallelisationException('Missing parallelisation options'); + } + + try { + $runner = $this->createRunner($input); + } catch (\Throwable $e) { + throw new ParallelisationException('Unable to create runner: '.$e->getMessage(), 0, $e); + } + + $loop = new StreamSelectLoop(); + $tcpConnector = new TcpConnector($loop); + $tcpConnector + ->connect(\sprintf('127.0.0.1:%d', $port)) + ->then( + /** @codeCoverageIgnore */ + function (ConnectionInterface $connection) use ($loop, $runner, $identifier): void { + $jsonInvalidUtf8Ignore = \defined('JSON_INVALID_UTF8_IGNORE') ? JSON_INVALID_UTF8_IGNORE : 0; + $out = new Encoder($connection, $jsonInvalidUtf8Ignore); + $in = new Decoder($connection, true, 512, $jsonInvalidUtf8Ignore); + + // [REACT] Initialise connection with the parallelisation operator + $out->write(['action' => ParallelAction::WORKER_HELLO, 'identifier' => $identifier]); + + $handleError = static function (\Throwable $error) use ($out): void { + $out->write([ + 'action' => ParallelAction::WORKER_ERROR_REPORT, + 'class' => \get_class($error), + 'message' => $error->getMessage(), + 'file' => $error->getFile(), + 'line' => $error->getLine(), + 'code' => $error->getCode(), + 'trace' => $error->getTraceAsString(), + ]); + }; + $out->on('error', $handleError); + $in->on('error', $handleError); + + // [REACT] Listen for messages from the parallelisation operator (analysis requests) + $in->on('data', function (array $json) use ($loop, $runner, $out): void { + $action = $json['action'] ?? null; + + // Parallelisation operator does not have more to do, let's close the connection + if (ParallelAction::RUNNER_THANK_YOU === $action) { + $loop->stop(); + + return; + } + + if (ParallelAction::RUNNER_REQUEST_ANALYSIS !== $action) { + // At this point we only expect analysis requests, if any other action happen, we need to fix the code. + throw new \LogicException(\sprintf('Unexpected action ParallelAction::%s.', $action)); + } + + /** @var iterable $files */ + $files = $json['files']; + + foreach ($files as $absolutePath) { + // Reset events because we want to collect only those coming from analysed files chunk + $this->events = []; + $runner->setFileIterator(new \ArrayIterator([new \SplFileInfo($absolutePath)])); + $analysisResult = $runner->fix(); + + if (1 !== \count($this->events)) { + throw new ParallelisationException('Runner did not report a fixing event or reported too many.'); + } + + if (1 < \count($analysisResult)) { + throw new ParallelisationException('Runner returned more analysis results than expected.'); + } + + $out->write([ + 'action' => ParallelAction::WORKER_RESULT, + 'file' => $absolutePath, + 'fileHash' => $this->events[0]->getFileHash(), + 'status' => $this->events[0]->getStatus(), + 'fixInfo' => array_pop($analysisResult), + 'errors' => $this->errorsManager->forPath($absolutePath), + ]); + } + + // Request another file chunk (if available, the parallelisation operator will request new "run" action) + $out->write(['action' => ParallelAction::WORKER_GET_FILE_CHUNK]); + }); + }, + static function (\Throwable $error) use ($errorOutput): void { + // @TODO Verify onRejected behaviour → https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777#discussion_r1590399285 + $errorOutput->writeln($error->getMessage()); + } + ) + ; + + $loop->run(); + + return Command::SUCCESS; + } + + private function createRunner(InputInterface $input): Runner + { + $passedConfig = $input->getOption('config'); + $passedRules = $input->getOption('rules'); + + if (null !== $passedConfig && null !== $passedRules) { + throw new \RuntimeException('Passing both `--config` and `--rules` options is not allowed'); + } + + // There's no one single source of truth when it comes to fixing single file, we need to collect statuses from events. + $this->eventDispatcher->addListener(FileProcessed::NAME, function (FileProcessed $event): void { + $this->events[] = $event; + }); + + $this->configurationResolver = new ConfigurationResolver( + new Config(), + [ + 'allow-risky' => $input->getOption('allow-risky'), + 'config' => $passedConfig, + 'dry-run' => $input->getOption('dry-run'), + 'rules' => $passedRules, + 'path' => [], + 'path-mode' => ConfigurationResolver::PATH_MODE_OVERRIDE, // IMPORTANT! WorkerCommand is called with file that already passed filtering, so here we can rely on PATH_MODE_OVERRIDE. + 'using-cache' => $input->getOption('using-cache'), + 'cache-file' => $input->getOption('cache-file'), + 'diff' => $input->getOption('diff'), + 'stop-on-violation' => $input->getOption('stop-on-violation'), + ], + getcwd(), // @phpstan-ignore-line + $this->toolInfo + ); + + return new Runner( + null, // Paths are known when parallelisation server requests new chunk, not now + $this->configurationResolver->getFixers(), + $this->configurationResolver->getDiffer(), + $this->eventDispatcher, + $this->errorsManager, + $this->configurationResolver->getLinter(), + $this->configurationResolver->isDryRun(), + new NullCacheManager(), // IMPORTANT! We pass null cache, as cache is read&write in main process and we do not need to do it again. + $this->configurationResolver->getDirectory(), + $this->configurationResolver->shouldStopOnViolation(), + ParallelConfigFactory::sequential(), // IMPORTANT! Worker must run in sequential mode. + null, + $this->configurationResolver->getConfigFile() + ); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php index 5494fda1..496948af 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php @@ -23,7 +23,7 @@ use PhpCsFixer\Cache\Signature; use PhpCsFixer\ConfigInterface; use PhpCsFixer\ConfigurationException\InvalidConfigurationException; -use PhpCsFixer\Console\Command\HelpCommand; +use PhpCsFixer\Console\Output\Progress\ProgressOutputType; use PhpCsFixer\Console\Report\FixReport\ReporterFactory; use PhpCsFixer\Console\Report\FixReport\ReporterInterface; use PhpCsFixer\Differ\DifferInterface; @@ -35,14 +35,16 @@ use PhpCsFixer\FixerFactory; use PhpCsFixer\Linter\Linter; use PhpCsFixer\Linter\LinterInterface; +use PhpCsFixer\ParallelAwareConfigInterface; use PhpCsFixer\RuleSet\RuleSet; use PhpCsFixer\RuleSet\RuleSetInterface; +use PhpCsFixer\Runner\Parallel\ParallelConfig; +use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; use PhpCsFixer\StdinFileInfo; use PhpCsFixer\ToolInfoInterface; use PhpCsFixer\Utils; use PhpCsFixer\WhitespacesFixerConfig; use PhpCsFixer\WordMatcher; -use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Finder\Finder as SymfonyFinder; @@ -60,49 +62,28 @@ final class ConfigurationResolver public const PATH_MODE_OVERRIDE = 'override'; public const PATH_MODE_INTERSECTION = 'intersection'; - /** - * @var null|bool - */ - private $allowRisky; + private ?bool $allowRisky = null; - /** - * @var null|ConfigInterface - */ - private $config; + private ?ConfigInterface $config = null; - /** - * @var null|string - */ - private $configFile; + private ?string $configFile = null; private string $cwd; private ConfigInterface $defaultConfig; - /** - * @var null|ReporterInterface - */ - private $reporter; + private ?ReporterInterface $reporter = null; - /** - * @var null|bool - */ - private $isStdIn; + private ?bool $isStdIn = null; - /** - * @var null|bool - */ - private $isDryRun; + private ?bool $isDryRun = null; /** - * @var null|FixerInterface[] + * @var null|list */ - private $fixers; + private ?array $fixers = null; - /** - * @var null|bool - */ - private $configFinderIsOverridden; + private ?bool $configFinderIsOverridden = null; private ToolInfoInterface $toolInfo; @@ -119,31 +100,20 @@ final class ConfigurationResolver 'path' => [], 'path-mode' => self::PATH_MODE_OVERRIDE, 'rules' => null, + 'sequential' => null, 'show-progress' => null, 'stop-on-violation' => null, 'using-cache' => null, 'verbosity' => null, ]; - /** - * @var null|string - */ - private $cacheFile; + private ?string $cacheFile = null; - /** - * @var null|CacheManagerInterface - */ - private $cacheManager; + private ?CacheManagerInterface $cacheManager = null; - /** - * @var null|DifferInterface - */ - private $differ; + private ?DifferInterface $differ = null; - /** - * @var null|Directory - */ - private $directory; + private ?Directory $directory = null; /** * @var null|iterable<\SplFileInfo> @@ -152,10 +122,7 @@ final class ConfigurationResolver private ?string $format = null; - /** - * @var null|Linter - */ - private $linter; + private ?Linter $linter = null; /** * @var null|list @@ -163,24 +130,15 @@ final class ConfigurationResolver private ?array $path = null; /** - * @var null|string + * @var null|ProgressOutputType::* */ private $progress; - /** - * @var null|RuleSet - */ - private $ruleSet; + private ?RuleSet $ruleSet = null; - /** - * @var null|bool - */ - private $usingCache; + private ?bool $usingCache = null; - /** - * @var FixerFactory - */ - private $fixerFactory; + private ?FixerFactory $fixerFactory = null; /** * @param array $options @@ -275,6 +233,15 @@ public function getConfig(): ConfigInterface return $this->config; } + public function getParallelConfig(): ParallelConfig + { + $config = $this->getConfig(); + + return true !== $this->options['sequential'] && $config instanceof ParallelAwareConfigInterface + ? $config->getParallelConfig() + : ParallelConfigFactory::sequential(); + } + public function getConfigFile(): ?string { if (null === $this->configFile) { @@ -287,11 +254,7 @@ public function getConfigFile(): ?string public function getDiffer(): DifferInterface { if (null === $this->differ) { - if ($this->options['diff']) { - $this->differ = new UnifiedDiffer(); - } else { - $this->differ = new NullDiffer(); - } + $this->differ = (true === $this->options['diff']) ? new UnifiedDiffer() : new NullDiffer(); } return $this->differ; @@ -309,16 +272,17 @@ public function getDirectory(): DirectoryInterface $absolutePath = $filesystem->isAbsolutePath($path) ? $path : $this->cwd.\DIRECTORY_SEPARATOR.$path; + $absolutePath = \dirname($absolutePath); } - $this->directory = new Directory(\dirname($absolutePath)); + $this->directory = new Directory($absolutePath); } return $this->directory; } /** - * @return FixerInterface[] An array of FixerInterface + * @return list */ public function getFixers(): array { @@ -331,19 +295,15 @@ public function getFixers(): array if (false === $this->getRiskyAllowed()) { $riskyFixers = array_map( - static function (FixerInterface $fixer): string { - return $fixer->getName(); - }, + static fn (FixerInterface $fixer): string => $fixer->getName(), array_filter( $this->fixers, - static function (FixerInterface $fixer): bool { - return $fixer->isRisky(); - } + static fn (FixerInterface $fixer): bool => $fixer->isRisky() ) ); if (\count($riskyFixers) > 0) { - throw new InvalidConfigurationException(sprintf('The rules contain risky fixers ("%s"), but they are not allowed to run. Perhaps you forget to use --allow-risky=yes option?', implode('", "', $riskyFixers))); + throw new InvalidConfigurationException(\sprintf('The rules contain risky fixers (%s), but they are not allowed to run. Perhaps you forget to use --allow-risky=yes option?', Utils::naturalLanguageJoin($riskyFixers))); } } } @@ -363,7 +323,7 @@ public function getLinter(): LinterInterface /** * Returns path. * - * @return string[] + * @return list */ public function getPath(): array { @@ -387,7 +347,7 @@ static function (string $rawPath) use ($cwd, $filesystem): string { : $cwd.\DIRECTORY_SEPARATOR.$path; if (!file_exists($absolutePath)) { - throw new InvalidConfigurationException(sprintf( + throw new InvalidConfigurationException(\sprintf( 'The path "%s" is not readable.', $path )); @@ -404,28 +364,31 @@ static function (string $rawPath) use ($cwd, $filesystem): string { } /** + * @return ProgressOutputType::* + * * @throws InvalidConfigurationException */ - public function getProgress(): string + public function getProgressType(): string { if (null === $this->progress) { - if (OutputInterface::VERBOSITY_VERBOSE <= $this->options['verbosity'] && 'txt' === $this->getFormat()) { + if ('txt' === $this->getFormat()) { $progressType = $this->options['show-progress']; - $progressTypes = ['none', 'dots']; if (null === $progressType) { - $progressType = $this->getConfig()->getHideProgress() ? 'none' : 'dots'; - } elseif (!\in_array($progressType, $progressTypes, true)) { - throw new InvalidConfigurationException(sprintf( - 'The progress type "%s" is not defined, supported are "%s".', + $progressType = $this->getConfig()->getHideProgress() + ? ProgressOutputType::NONE + : ProgressOutputType::BAR; + } elseif (!\in_array($progressType, ProgressOutputType::all(), true)) { + throw new InvalidConfigurationException(\sprintf( + 'The progress type "%s" is not defined, supported are %s.', $progressType, - implode('", "', $progressTypes) + Utils::naturalLanguageJoin(ProgressOutputType::all()) )); } $this->progress = $progressType; } else { - $this->progress = 'none'; + $this->progress = ProgressOutputType::NONE; } } @@ -446,7 +409,7 @@ public function getReporter(): ReporterInterface $formats = $reporterFactory->getFormats(); sort($formats); - throw new InvalidConfigurationException(sprintf('The format "%s" is not defined, supported are "%s".', $format, implode('", "', $formats))); + throw new InvalidConfigurationException(\sprintf('The format "%s" is not defined, supported are %s.', $format, Utils::naturalLanguageJoin($formats))); } } @@ -486,7 +449,7 @@ public function getUsingCache(): bool } } - $this->usingCache = $this->usingCache && ($this->toolInfo->isInstalledAsPhar() || $this->toolInfo->isInstalledByComposer()); + $this->usingCache = $this->usingCache && $this->isCachingAllowedForRuntime(); return $this->usingCache; } @@ -537,7 +500,7 @@ public function configFinderIsOverridden(): bool /** * Compute file candidates for config file. * - * @return string[] + * @return list */ private function computeConfigFiles(): array { @@ -545,7 +508,7 @@ private function computeConfigFiles(): array if (null !== $configFile) { if (false === file_exists($configFile) || false === is_readable($configFile)) { - throw new InvalidConfigurationException(sprintf('Cannot read config file "%s".', $configFile)); + throw new InvalidConfigurationException(\sprintf('Cannot read config file "%s".', $configFile)); } return [$configFile]; @@ -561,7 +524,7 @@ private function computeConfigFiles(): array $configDir = $path[0]; } else { $dirName = pathinfo($path[0], PATHINFO_DIRNAME); - $configDir = $dirName ?: $path[0]; + $configDir = is_dir($dirName) ? $dirName : $path[0]; } $candidates = [ @@ -637,7 +600,7 @@ private function iterableToTraversable(iterable $iterable): \Traversable } /** - * @return array + * @return array */ private function parseRules(): array { @@ -654,7 +617,7 @@ private function parseRules(): array $rules = json_decode($rules, true); if (JSON_ERROR_NONE !== json_last_error()) { - throw new InvalidConfigurationException(sprintf('Invalid JSON rules input: "%s".', json_last_error_msg())); + throw new InvalidConfigurationException(\sprintf('Invalid JSON rules input: "%s".', json_last_error_msg())); } return $rules; @@ -680,7 +643,7 @@ private function parseRules(): array } /** - * @param array $rules + * @param array $rules * * @throws InvalidConfigurationException */ @@ -695,7 +658,7 @@ private function validateRules(array $rules): void foreach ($rules as $key => $value) { if (\is_int($key)) { - throw new InvalidConfigurationException(sprintf('Missing value for "%s" rule/set.', $value)); + throw new InvalidConfigurationException(\sprintf('Missing value for "%s" rule/set.', $value)); } $ruleSet[$key] = true; @@ -771,16 +734,16 @@ private function validateRules(array $rules): void foreach ($unknownFixers as $unknownFixer) { if (isset($renamedRules[$unknownFixer])) { // Check if present as old renamed rule $hasOldRule = true; - $message .= sprintf( + $message .= \sprintf( '"%s" is renamed (did you mean "%s"?%s), ', $unknownFixer, $renamedRules[$unknownFixer]['new_name'], - isset($renamedRules[$unknownFixer]['config']) ? ' (note: use configuration "'.HelpCommand::toString($renamedRules[$unknownFixer]['config']).'")' : '' + isset($renamedRules[$unknownFixer]['config']) ? ' (note: use configuration "'.Utils::toString($renamedRules[$unknownFixer]['config']).'")' : '' ); } else { // Go to normal matcher if it is not a renamed rule $matcher = new WordMatcher($availableFixers); $alternative = $matcher->match($unknownFixer); - $message .= sprintf( + $message .= \sprintf( '"%s"%s, ', $unknownFixer, null === $alternative ? '' : ' (did you mean "'.$alternative.'"?)' @@ -802,8 +765,8 @@ private function validateRules(array $rules): void if (isset($rules[$fixerName]) && $fixer instanceof DeprecatedFixerInterface) { $successors = $fixer->getSuccessorsNames(); $messageEnd = [] === $successors - ? sprintf(' and will be removed in version %d.0.', Application::getMajorVersion() + 1) - : sprintf('. Use %s instead.', str_replace('`', '"', Utils::naturalLanguageJoinWithBackticks($successors))); + ? \sprintf(' and will be removed in version %d.0.', Application::getMajorVersion() + 1) + : \sprintf('. Use %s instead.', str_replace('`', '"', Utils::naturalLanguageJoinWithBackticks($successors))); Utils::triggerDeprecation(new \RuntimeException("Rule \"{$fixerName}\" is deprecated{$messageEnd}")); } @@ -830,21 +793,19 @@ private function resolveFinder(): iterable $modes, true )) { - throw new InvalidConfigurationException(sprintf( - 'The path-mode "%s" is not defined, supported are "%s".', + throw new InvalidConfigurationException(\sprintf( + 'The path-mode "%s" is not defined, supported are %s.', $this->options['path-mode'], - implode('", "', $modes) + Utils::naturalLanguageJoin($modes) )); } $isIntersectionPathMode = self::PATH_MODE_INTERSECTION === $this->options['path-mode']; - $paths = array_filter(array_map( - static function (string $path) { - return realpath($path); - }, + $paths = array_map( + static fn (string $path) => realpath($path), $this->getPath() - )); + ); if (0 === \count($paths)) { if ($isIntersectionPathMode) { @@ -922,7 +883,7 @@ static function (\SplFileInfo $current) use ($pathsByType): bool { private function setOption(string $name, $value): void { if (!\array_key_exists($name, $this->options)) { - throw new InvalidConfigurationException(sprintf('Unknown option name: "%s".', $name)); + throw new InvalidConfigurationException(\sprintf('Unknown option name: "%s".', $name)); } $this->options[$name] = $value; @@ -933,7 +894,7 @@ private function resolveOptionBooleanValue(string $optionName): bool $value = $this->options[$optionName]; if (!\is_string($value)) { - throw new InvalidConfigurationException(sprintf('Expected boolean or string value for option "%s".', $optionName)); + throw new InvalidConfigurationException(\sprintf('Expected boolean or string value for option "%s".', $optionName)); } if ('yes' === $value) { @@ -944,7 +905,7 @@ private function resolveOptionBooleanValue(string $optionName): bool return false; } - throw new InvalidConfigurationException(sprintf('Expected "yes" or "no" for option "%s", got "%s".', $optionName, $value)); + throw new InvalidConfigurationException(\sprintf('Expected "yes" or "no" for option "%s", got "%s".', $optionName, $value)); } private static function separatedContextLessInclude(string $path): ConfigInterface @@ -953,9 +914,17 @@ private static function separatedContextLessInclude(string $path): ConfigInterfa // verify that the config has an instance of Config if (!$config instanceof ConfigInterface) { - throw new InvalidConfigurationException(sprintf('The config file: "%s" does not return a "PhpCsFixer\ConfigInterface" instance. Got: "%s".', $path, \is_object($config) ? \get_class($config) : \gettype($config))); + throw new InvalidConfigurationException(\sprintf('The config file: "%s" does not return a "PhpCsFixer\ConfigInterface" instance. Got: "%s".', $path, \is_object($config) ? \get_class($config) : \gettype($config))); } return $config; } + + private function isCachingAllowedForRuntime(): bool + { + return $this->toolInfo->isInstalledAsPhar() + || $this->toolInfo->isInstalledByComposer() + || $this->toolInfo->isRunInsideDocker() + || filter_var(getenv('PHP_CS_FIXER_ENFORCE_CACHE'), FILTER_VALIDATE_BOOL); + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php index 926872af..b51c8ae5 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php @@ -17,20 +17,20 @@ use PhpCsFixer\Differ\DiffConsoleFormatter; use PhpCsFixer\Error\Error; use PhpCsFixer\Linter\LintingException; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Output\OutputInterface; /** + * @readonly + * * @internal */ final class ErrorOutput { private OutputInterface $output; - /** - * @var bool - */ - private $isDecorated; + private bool $isDecorated; public function __construct(OutputInterface $output) { @@ -39,11 +39,11 @@ public function __construct(OutputInterface $output) } /** - * @param Error[] $errors + * @param list $errors */ public function listErrors(string $process, array $errors): void { - $this->output->writeln(['', sprintf( + $this->output->writeln(['', \sprintf( 'Files that were not fixed due to errors reported during %s:', $process )]); @@ -51,13 +51,13 @@ public function listErrors(string $process, array $errors): void $showDetails = $this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE; $showTrace = $this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG; foreach ($errors as $i => $error) { - $this->output->writeln(sprintf('%4d) %s', $i + 1, $error->getFilePath())); + $this->output->writeln(\sprintf('%4d) %s', $i + 1, $error->getFilePath())); $e = $error->getSource(); if (!$showDetails || null === $e) { continue; } - $class = sprintf('[%s]', \get_class($e)); + $class = \sprintf('[%s]', \get_class($e)); $message = $e->getMessage(); $code = $e->getCode(); if (0 !== $code) { @@ -79,14 +79,14 @@ public function listErrors(string $process, array $errors): void $line .= str_repeat(' ', $length - \strlen($line)); } - $this->output->writeln(sprintf(' %s ', $this->prepareOutput($line))); + $this->output->writeln(\sprintf(' %s ', $this->prepareOutput($line))); } if ($showTrace && !$e instanceof LintingException) { // stack trace of lint exception is of no interest $this->output->writeln(''); $stackTrace = $e->getTrace(); foreach ($stackTrace as $trace) { - if (isset($trace['class']) && \Symfony\Component\Console\Command\Command::class === $trace['class'] && 'run' === $trace['function']) { + if (isset($trace['class']) && Command::class === $trace['class'] && 'run' === $trace['function']) { $this->output->writeln(' [ ... ]'); break; @@ -98,13 +98,13 @@ public function listErrors(string $process, array $errors): void if (Error::TYPE_LINT === $error->getType() && 0 < \count($error->getAppliedFixers())) { $this->output->writeln(''); - $this->output->writeln(sprintf(' Applied fixers: %s', implode(', ', $error->getAppliedFixers()))); + $this->output->writeln(\sprintf(' Applied fixers: %s', implode(', ', $error->getAppliedFixers()))); $diff = $error->getDiff(); - if (!empty($diff)) { + if (null !== $diff) { $diffFormatter = new DiffConsoleFormatter( $this->isDecorated, - sprintf( + \sprintf( ' ---------- begin diff ----------%s%%s%s ----------- end diff -----------', PHP_EOL, PHP_EOL @@ -131,18 +131,18 @@ public function listErrors(string $process, array $errors): void private function outputTrace(array $trace): void { if (isset($trace['class'], $trace['type'], $trace['function'])) { - $this->output->writeln(sprintf( + $this->output->writeln(\sprintf( ' %s%s%s()', $this->prepareOutput($trace['class']), $this->prepareOutput($trace['type']), $this->prepareOutput($trace['function']) )); } elseif (isset($trace['function'])) { - $this->output->writeln(sprintf(' %s()', $this->prepareOutput($trace['function']))); + $this->output->writeln(\sprintf(' %s()', $this->prepareOutput($trace['function']))); } if (isset($trace['file'])) { - $this->output->writeln(sprintf(' in %s at line %d', $this->prepareOutput($trace['file']), $trace['line'])); + $this->output->writeln(\sprintf(' in %s at line %d', $this->prepareOutput($trace['file']), $trace['line'])); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php new file mode 100644 index 00000000..60ff2611 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php @@ -0,0 +1,54 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Console\Output; + +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @readonly + * + * @internal + */ +final class OutputContext +{ + private ?OutputInterface $output; + private int $terminalWidth; + private int $filesCount; + + public function __construct( + ?OutputInterface $output, + int $terminalWidth, + int $filesCount + ) { + $this->output = $output; + $this->terminalWidth = $terminalWidth; + $this->filesCount = $filesCount; + } + + public function getOutput(): ?OutputInterface + { + return $this->output; + } + + public function getTerminalWidth(): int + { + return $this->terminalWidth; + } + + public function getFilesCount(): int + { + return $this->filesCount; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ProcessOutput.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ProcessOutput.php deleted file mode 100644 index 6d504b8e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ProcessOutput.php +++ /dev/null @@ -1,133 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Output; - -use PhpCsFixer\FixerFileProcessedEvent; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; - -/** - * Output writer to show the process of a FixCommand. - * - * @internal - */ -final class ProcessOutput implements ProcessOutputInterface -{ - /** - * File statuses map. - * - * @var array - */ - private static array $eventStatusMap = [ - FixerFileProcessedEvent::STATUS_NO_CHANGES => ['symbol' => '.', 'format' => '%s', 'description' => 'no changes'], - FixerFileProcessedEvent::STATUS_FIXED => ['symbol' => 'F', 'format' => '%s', 'description' => 'fixed'], - FixerFileProcessedEvent::STATUS_SKIPPED => ['symbol' => 'S', 'format' => '%s', 'description' => 'skipped (cached or empty file)'], - FixerFileProcessedEvent::STATUS_INVALID => ['symbol' => 'I', 'format' => '%s', 'description' => 'invalid file syntax (file ignored)'], - FixerFileProcessedEvent::STATUS_EXCEPTION => ['symbol' => 'E', 'format' => '%s', 'description' => 'error'], - FixerFileProcessedEvent::STATUS_LINT => ['symbol' => 'E', 'format' => '%s', 'description' => 'error'], - ]; - - private OutputInterface $output; - - private EventDispatcherInterface $eventDispatcher; - - private int $files; - - private int $processedFiles = 0; - - /** - * @var int - */ - private $symbolsPerLine; - - public function __construct(OutputInterface $output, EventDispatcherInterface $dispatcher, int $width, int $nbFiles) - { - $this->output = $output; - $this->eventDispatcher = $dispatcher; - $this->eventDispatcher->addListener(FixerFileProcessedEvent::NAME, [$this, 'onFixerFileProcessed']); - $this->files = $nbFiles; - - // max number of characters per line - // - total length x 2 (e.g. " 1 / 123" => 6 digits and padding spaces) - // - 11 (extra spaces, parentheses and percentage characters, e.g. " x / x (100%)") - $this->symbolsPerLine = max(1, $width - \strlen((string) $this->files) * 2 - 11); - } - - public function __destruct() - { - $this->eventDispatcher->removeListener(FixerFileProcessedEvent::NAME, [$this, 'onFixerFileProcessed']); - } - - /** - * This class is not intended to be serialized, - * and cannot be deserialized (see __wakeup method). - */ - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - /** - * Disable the deserialization of the class to prevent attacker executing - * code by leveraging the __destruct method. - * - * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection - */ - public function __wakeup(): void - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function onFixerFileProcessed(FixerFileProcessedEvent $event): void - { - $status = self::$eventStatusMap[$event->getStatus()]; - $this->output->write($this->output->isDecorated() ? sprintf($status['format'], $status['symbol']) : $status['symbol']); - - ++$this->processedFiles; - - $symbolsOnCurrentLine = $this->processedFiles % $this->symbolsPerLine; - $isLast = $this->processedFiles === $this->files; - - if (0 === $symbolsOnCurrentLine || $isLast) { - $this->output->write(sprintf( - '%s %'.\strlen((string) $this->files).'d / %d (%3d%%)', - $isLast && 0 !== $symbolsOnCurrentLine ? str_repeat(' ', $this->symbolsPerLine - $symbolsOnCurrentLine) : '', - $this->processedFiles, - $this->files, - round($this->processedFiles / $this->files * 100) - )); - - if (!$isLast) { - $this->output->writeln(''); - } - } - } - - public function printLegend(): void - { - $symbols = []; - - foreach (self::$eventStatusMap as $status) { - $symbol = $status['symbol']; - if ('' === $symbol || isset($symbols[$symbol])) { - continue; - } - - $symbols[$symbol] = sprintf('%s-%s', $this->output->isDecorated() ? sprintf($status['format'], $symbol) : $symbol, $status['description']); - } - - $this->output->write(sprintf("\nLegend: %s\n", implode(', ', $symbols))); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php new file mode 100644 index 00000000..e2821146 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php @@ -0,0 +1,124 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Console\Output\Progress; + +use PhpCsFixer\Console\Output\OutputContext; +use PhpCsFixer\Runner\Event\FileProcessed; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Output writer to show the progress of a FixCommand using dots and meaningful letters. + * + * @internal + */ +final class DotsOutput implements ProgressOutputInterface +{ + /** + * File statuses map. + * + * @var array + */ + private const EVENT_STATUS_MAP = [ + FileProcessed::STATUS_NO_CHANGES => ['symbol' => '.', 'format' => '%s', 'description' => 'no changes'], + FileProcessed::STATUS_FIXED => ['symbol' => 'F', 'format' => '%s', 'description' => 'fixed'], + FileProcessed::STATUS_SKIPPED => ['symbol' => 'S', 'format' => '%s', 'description' => 'skipped (cached or empty file)'], + FileProcessed::STATUS_INVALID => ['symbol' => 'I', 'format' => '%s', 'description' => 'invalid file syntax (file ignored)'], + FileProcessed::STATUS_EXCEPTION => ['symbol' => 'E', 'format' => '%s', 'description' => 'error'], + FileProcessed::STATUS_LINT => ['symbol' => 'E', 'format' => '%s', 'description' => 'error'], + ]; + + /** @readonly */ + private OutputContext $context; + + private int $processedFiles = 0; + + private int $symbolsPerLine; + + public function __construct(OutputContext $context) + { + $this->context = $context; + + // max number of characters per line + // - total length x 2 (e.g. " 1 / 123" => 6 digits and padding spaces) + // - 11 (extra spaces, parentheses and percentage characters, e.g. " x / x (100%)") + $this->symbolsPerLine = max(1, $context->getTerminalWidth() - \strlen((string) $context->getFilesCount()) * 2 - 11); + } + + /** + * This class is not intended to be serialized, + * and cannot be deserialized (see __wakeup method). + */ + public function __sleep(): array + { + throw new \BadMethodCallException('Cannot serialize '.self::class); + } + + /** + * Disable the deserialization of the class to prevent attacker executing + * code by leveraging the __destruct method. + * + * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection + */ + public function __wakeup(): void + { + throw new \BadMethodCallException('Cannot unserialize '.self::class); + } + + public function onFixerFileProcessed(FileProcessed $event): void + { + $status = self::EVENT_STATUS_MAP[$event->getStatus()]; + $this->getOutput()->write($this->getOutput()->isDecorated() ? \sprintf($status['format'], $status['symbol']) : $status['symbol']); + + ++$this->processedFiles; + + $symbolsOnCurrentLine = $this->processedFiles % $this->symbolsPerLine; + $isLast = $this->processedFiles === $this->context->getFilesCount(); + + if (0 === $symbolsOnCurrentLine || $isLast) { + $this->getOutput()->write(\sprintf( + '%s %'.\strlen((string) $this->context->getFilesCount()).'d / %d (%3d%%)', + $isLast && 0 !== $symbolsOnCurrentLine ? str_repeat(' ', $this->symbolsPerLine - $symbolsOnCurrentLine) : '', + $this->processedFiles, + $this->context->getFilesCount(), + round($this->processedFiles / $this->context->getFilesCount() * 100) + )); + + if (!$isLast) { + $this->getOutput()->writeln(''); + } + } + } + + public function printLegend(): void + { + $symbols = []; + + foreach (self::EVENT_STATUS_MAP as $status) { + $symbol = $status['symbol']; + if (isset($symbols[$symbol])) { + continue; + } + + $symbols[$symbol] = \sprintf('%s-%s', $this->getOutput()->isDecorated() ? \sprintf($status['format'], $symbol) : $symbol, $status['description']); + } + + $this->getOutput()->write(\sprintf("\nLegend: %s\n", implode(', ', $symbols))); + } + + private function getOutput(): OutputInterface + { + return $this->context->getOutput(); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php new file mode 100644 index 00000000..497ea8b0 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php @@ -0,0 +1,29 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Console\Output\Progress; + +use PhpCsFixer\Runner\Event\FileProcessed; + +/** + * @readonly + * + * @internal + */ +final class NullOutput implements ProgressOutputInterface +{ + public function printLegend(): void {} + + public function onFixerFileProcessed(FileProcessed $event): void {} +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php new file mode 100644 index 00000000..fc320fa2 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php @@ -0,0 +1,78 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Console\Output\Progress; + +use PhpCsFixer\Console\Output\OutputContext; +use PhpCsFixer\Runner\Event\FileProcessed; +use Symfony\Component\Console\Helper\ProgressBar; + +/** + * Output writer to show the progress of a FixCommand using progress bar (percentage). + * + * @readonly + * + * @internal + */ +final class PercentageBarOutput implements ProgressOutputInterface +{ + /** @readonly */ + private OutputContext $context; + + private ProgressBar $progressBar; + + public function __construct(OutputContext $context) + { + $this->context = $context; + + $this->progressBar = new ProgressBar($context->getOutput(), $this->context->getFilesCount()); + $this->progressBar->setBarCharacter('▓'); // dark shade character \u2593 + $this->progressBar->setEmptyBarCharacter('░'); // light shade character \u2591 + $this->progressBar->setProgressCharacter(''); + $this->progressBar->setFormat('normal'); + + $this->progressBar->start(); + } + + /** + * This class is not intended to be serialized, + * and cannot be deserialized (see __wakeup method). + */ + public function __sleep(): array + { + throw new \BadMethodCallException('Cannot serialize '.self::class); + } + + /** + * Disable the deserialization of the class to prevent attacker executing + * code by leveraging the __destruct method. + * + * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection + */ + public function __wakeup(): void + { + throw new \BadMethodCallException('Cannot unserialize '.self::class); + } + + public function onFixerFileProcessed(FileProcessed $event): void + { + $this->progressBar->advance(1); + + if ($this->progressBar->getProgress() === $this->progressBar->getMaxSteps()) { + $this->context->getOutput()->write("\n\n"); + } + } + + public function printLegend(): void {} +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php new file mode 100644 index 00000000..a1474aea --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php @@ -0,0 +1,63 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Console\Output\Progress; + +use PhpCsFixer\Console\Output\OutputContext; + +/** + * @readonly + * + * @internal + */ +final class ProgressOutputFactory +{ + /** + * @var array> + */ + private const OUTPUT_TYPE_MAP = [ + ProgressOutputType::NONE => NullOutput::class, + ProgressOutputType::DOTS => DotsOutput::class, + ProgressOutputType::BAR => PercentageBarOutput::class, + ]; + + /** + * @param ProgressOutputType::* $outputType + */ + public function create(string $outputType, OutputContext $context): ProgressOutputInterface + { + if (null === $context->getOutput()) { + $outputType = ProgressOutputType::NONE; + } + + if (!$this->isBuiltInType($outputType)) { + throw new \InvalidArgumentException( + \sprintf( + 'Something went wrong, "%s" output type is not supported', + $outputType + ) + ); + } + + $outputClass = self::OUTPUT_TYPE_MAP[$outputType]; + + // @phpstan-ignore-next-line new.noConstructor + return new $outputClass($context); + } + + private function isBuiltInType(string $outputType): bool + { + return \in_array($outputType, ProgressOutputType::all(), true); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php new file mode 100644 index 00000000..48881e65 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php @@ -0,0 +1,27 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Console\Output\Progress; + +use PhpCsFixer\Runner\Event\FileProcessed; + +/** + * @internal + */ +interface ProgressOutputInterface +{ + public function printLegend(): void; + + public function onFixerFileProcessed(FileProcessed $event): void; +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php new file mode 100644 index 00000000..6f427a46 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php @@ -0,0 +1,37 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Console\Output\Progress; + +/** + * @internal + */ +final class ProgressOutputType +{ + public const NONE = 'none'; + public const DOTS = 'dots'; + public const BAR = 'bar'; + + /** + * @return list + */ + public static function all(): array + { + return [ + self::BAR, + self::DOTS, + self::NONE, + ]; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php index c283b238..79806d1f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php @@ -14,26 +14,23 @@ namespace PhpCsFixer\Console\Report\FixReport; +use PhpCsFixer\Console\Application; use Symfony\Component\Console\Formatter\OutputFormatter; /** * @author Kévin Gomez * + * @readonly + * * @internal */ final class CheckstyleReporter implements ReporterInterface { - /** - * {@inheritdoc} - */ public function getFormat(): string { return 'checkstyle'; } - /** - * {@inheritdoc} - */ public function generate(ReportSummary $reportSummary): string { if (!\extension_loaded('dom')) { @@ -41,7 +38,10 @@ public function generate(ReportSummary $reportSummary): string } $dom = new \DOMDocument('1.0', 'UTF-8'); + + /** @var \DOMElement $checkstyles */ $checkstyles = $dom->appendChild($dom->createElement('checkstyle')); + $checkstyles->setAttribute('version', Application::getAbout()); foreach ($reportSummary->getChanged() as $filePath => $fixResult) { /** @var \DOMElement $file */ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php index 974d66d1..3061b6fc 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php @@ -14,6 +14,10 @@ namespace PhpCsFixer\Console\Report\FixReport; +use PhpCsFixer\Console\Application; +use SebastianBergmann\Diff\Chunk; +use SebastianBergmann\Diff\Diff; +use SebastianBergmann\Diff\Parser; use Symfony\Component\Console\Formatter\OutputFormatter; /** @@ -23,10 +27,19 @@ * * @author Hans-Christian Otto * + * @readonly + * * @internal */ final class GitlabReporter implements ReporterInterface { + private Parser $diffParser; + + public function __construct() + { + $this->diffParser = new Parser(); + } + public function getFormat(): string { return 'gitlab'; @@ -37,25 +50,47 @@ public function getFormat(): string */ public function generate(ReportSummary $reportSummary): string { + $about = Application::getAbout(); + $report = []; foreach ($reportSummary->getChanged() as $fileName => $change) { foreach ($change['appliedFixers'] as $fixerName) { $report[] = [ - 'description' => $fixerName, + 'check_name' => 'PHP-CS-Fixer.'.$fixerName, + 'description' => 'PHP-CS-Fixer.'.$fixerName.' by '.$about, + 'categories' => ['Style'], 'fingerprint' => md5($fileName.$fixerName), 'severity' => 'minor', 'location' => [ 'path' => $fileName, - 'lines' => [ - 'begin' => 0, // line numbers are required in the format, but not available to reports - ], + 'lines' => self::getLines($this->diffParser->parse($change['diff'])), ], ]; } } - $jsonString = json_encode($report); + $jsonString = json_encode($report, JSON_THROW_ON_ERROR); return $reportSummary->isDecoratedOutput() ? OutputFormatter::escape($jsonString) : $jsonString; } + + /** + * @param list $diffs + * + * @return array{begin: int, end: int} + */ + private static function getLines(array $diffs): array + { + if (isset($diffs[0])) { + $firstDiff = $diffs[0]; + + $firstChunk = \Closure::bind(static fn (Diff $diff) => array_shift($diff->chunks), null, $firstDiff)($firstDiff); + + if ($firstChunk instanceof Chunk) { + return \Closure::bind(static fn (Chunk $chunk): array => ['begin' => $chunk->start, 'end' => $chunk->startRange], null, $firstChunk)($firstChunk); + } + } + + return ['begin' => 0, 'end' => 0]; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php index 4e170e4b..49ea9e30 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php @@ -14,26 +14,23 @@ namespace PhpCsFixer\Console\Report\FixReport; +use PhpCsFixer\Console\Application; use Symfony\Component\Console\Formatter\OutputFormatter; /** * @author Boris Gorbylev * + * @readonly + * * @internal */ final class JsonReporter implements ReporterInterface { - /** - * {@inheritdoc} - */ public function getFormat(): string { return 'json'; } - /** - * {@inheritdoc} - */ public function generate(ReportSummary $reportSummary): string { $jsonFiles = []; @@ -53,14 +50,15 @@ public function generate(ReportSummary $reportSummary): string } $json = [ + 'about' => Application::getAbout(), 'files' => $jsonFiles, 'time' => [ - 'total' => round($reportSummary->getTime() / 1000, 3), + 'total' => round($reportSummary->getTime() / 1_000, 3), ], - 'memory' => round($reportSummary->getMemory() / 1024 / 1024, 3), + 'memory' => round($reportSummary->getMemory() / 1_024 / 1_024, 3), ]; - $json = json_encode($json); + $json = json_encode($json, JSON_THROW_ON_ERROR); return $reportSummary->isDecoratedOutput() ? OutputFormatter::escape($json) : $json; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php index 9cf9c6df..2017a0d7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php @@ -14,27 +14,24 @@ namespace PhpCsFixer\Console\Report\FixReport; +use PhpCsFixer\Console\Application; use PhpCsFixer\Preg; use Symfony\Component\Console\Formatter\OutputFormatter; /** * @author Boris Gorbylev * + * @readonly + * * @internal */ final class JunitReporter implements ReporterInterface { - /** - * {@inheritdoc} - */ public function getFormat(): string { return 'junit'; } - /** - * {@inheritdoc} - */ public function generate(ReportSummary $reportSummary): string { if (!\extension_loaded('dom')) { @@ -44,10 +41,17 @@ public function generate(ReportSummary $reportSummary): string $dom = new \DOMDocument('1.0', 'UTF-8'); $testsuites = $dom->appendChild($dom->createElement('testsuites')); - /** @var \DomElement $testsuite */ + /** @var \DOMElement $testsuite */ $testsuite = $testsuites->appendChild($dom->createElement('testsuite')); $testsuite->setAttribute('name', 'PHP CS Fixer'); + $properties = $dom->createElement('properties'); + $property = $dom->createElement('property'); + $property->setAttribute('name', 'about'); + $property->setAttribute('value', Application::getAbout()); + $properties->appendChild($property); + $testsuite->appendChild($properties); + if (\count($reportSummary->getChanged()) > 0) { $this->createFailedTestCases($dom, $testsuite, $reportSummary); } else { @@ -57,9 +61,9 @@ public function generate(ReportSummary $reportSummary): string if ($reportSummary->getTime() > 0) { $testsuite->setAttribute( 'time', - sprintf( + \sprintf( '%.3f', - $reportSummary->getTime() / 1000 + $reportSummary->getTime() / 1_000 ) ); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php index ccdfefb3..231ddeae 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php @@ -17,6 +17,8 @@ /** * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class ReportSummary diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php index d091f441..1b2d8122 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php @@ -23,9 +23,7 @@ */ final class ReporterFactory { - /** - * @var array - */ + /** @var array */ private array $reporters = []; public function registerBuiltInReporters(): self @@ -38,10 +36,10 @@ public function registerBuiltInReporters(): self foreach (SymfonyFinder::create()->files()->name('*Reporter.php')->in(__DIR__) as $file) { $relativeNamespace = $file->getRelativePath(); - $builtInReporters[] = sprintf( - '%s\\%s%s', + $builtInReporters[] = \sprintf( + '%s\%s%s', __NAMESPACE__, - $relativeNamespace ? $relativeNamespace.'\\' : '', + '' !== $relativeNamespace ? $relativeNamespace.'\\' : '', $file->getBasename('.php') ); } @@ -62,7 +60,7 @@ public function registerReporter(ReporterInterface $reporter): self $format = $reporter->getFormat(); if (isset($this->reporters[$format])) { - throw new \UnexpectedValueException(sprintf('Reporter for format "%s" is already registered.', $format)); + throw new \UnexpectedValueException(\sprintf('Reporter for format "%s" is already registered.', $format)); } $this->reporters[$format] = $reporter; @@ -84,7 +82,7 @@ public function getFormats(): array public function getReporter(string $format): ReporterInterface { if (!isset($this->reporters[$format])) { - throw new \UnexpectedValueException(sprintf('Reporter for format "%s" is not registered.', $format)); + throw new \UnexpectedValueException(\sprintf('Reporter for format "%s" is not registered.', $format)); } return $this->reporters[$format]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php index 6de741bc..ccdeeabb 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php @@ -19,21 +19,17 @@ /** * @author Boris Gorbylev * + * @readonly + * * @internal */ final class TextReporter implements ReporterInterface { - /** - * {@inheritdoc} - */ public function getFormat(): string { return 'txt'; } - /** - * {@inheritdoc} - */ public function generate(ReportSummary $reportSummary): string { $output = ''; @@ -41,7 +37,7 @@ public function generate(ReportSummary $reportSummary): string $identifiedFiles = 0; foreach ($reportSummary->getChanged() as $file => $fixResult) { ++$identifiedFiles; - $output .= sprintf('%4d) %s', $identifiedFiles, $file); + $output .= \sprintf('%4d) %s', $identifiedFiles, $file); if ($reportSummary->shouldAddAppliedFixers()) { $output .= $this->getAppliedFixers( @@ -68,7 +64,7 @@ public function generate(ReportSummary $reportSummary): string */ private function getAppliedFixers(bool $isDecoratedOutput, array $appliedFixers): string { - return sprintf( + return \sprintf( $isDecoratedOutput ? ' (%s)' : ' (%s)', implode(', ', $appliedFixers) ); @@ -80,7 +76,7 @@ private function getDiff(bool $isDecoratedOutput, string $diff): string return ''; } - $diffFormatter = new DiffConsoleFormatter($isDecoratedOutput, sprintf( + $diffFormatter = new DiffConsoleFormatter($isDecoratedOutput, \sprintf( ' ---------- begin diff ----------%s%%s%s ----------- end diff -----------', PHP_EOL, PHP_EOL @@ -95,14 +91,14 @@ private function getFooter(int $time, int $identifiedFiles, int $files, int $mem return ''; } - return PHP_EOL.sprintf( - '%s %d of %d %s in %.3f seconds, %.3f MB memory used'.PHP_EOL, + return PHP_EOL.\sprintf( + '%s %d of %d %s in %.3f seconds, %.2f MB memory used'.PHP_EOL, $isDryRun ? 'Found' : 'Fixed', $identifiedFiles, $files, $isDryRun ? 'files that can be fixed' : 'files', - $time / 1000, - $memory / 1024 / 1024 + $time / 1_000, + $memory / 1_024 / 1_024 ); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php index d487a189..3914377d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php @@ -14,26 +14,23 @@ namespace PhpCsFixer\Console\Report\FixReport; +use PhpCsFixer\Console\Application; use Symfony\Component\Console\Formatter\OutputFormatter; /** * @author Boris Gorbylev * + * @readonly + * * @internal */ final class XmlReporter implements ReporterInterface { - /** - * {@inheritdoc} - */ public function getFormat(): string { return 'xml'; } - /** - * {@inheritdoc} - */ public function generate(ReportSummary $reportSummary): string { if (!\extension_loaded('dom')) { @@ -45,6 +42,8 @@ public function generate(ReportSummary $reportSummary): string $root = $dom->createElement('report'); $dom->appendChild($root); + $root->appendChild($this->createAboutElement($dom, Application::getAbout())); + $filesXML = $dom->createElement('files'); $root->appendChild($filesXML); @@ -105,7 +104,7 @@ private function createDiffElement(\DOMDocument $dom, string $diff): \DOMElement private function createTimeElement(float $time, \DOMDocument $dom): \DOMElement { - $time = round($time / 1000, 3); + $time = round($time / 1_000, 3); $timeXML = $dom->createElement('time'); $timeXML->setAttribute('unit', 's'); @@ -118,7 +117,7 @@ private function createTimeElement(float $time, \DOMDocument $dom): \DOMElement private function createMemoryElement(float $memory, \DOMDocument $dom): \DOMElement { - $memory = round($memory / 1024 / 1024, 3); + $memory = round($memory / 1_024 / 1_024, 3); $memoryXML = $dom->createElement('memory'); $memoryXML->setAttribute('value', (string) $memory); @@ -126,4 +125,12 @@ private function createMemoryElement(float $memory, \DOMDocument $dom): \DOMElem return $memoryXML; } + + private function createAboutElement(\DOMDocument $dom, string $about): \DOMElement + { + $xml = $dom->createElement('about'); + $xml->setAttribute('value', $about); + + return $xml; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php index 20469397..9cc1602e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php @@ -19,28 +19,22 @@ /** * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class JsonReporter implements ReporterInterface { - /** - * {@inheritdoc} - */ public function getFormat(): string { return 'json'; } - /** - * {@inheritdoc} - */ public function generate(ReportSummary $reportSummary): string { $sets = $reportSummary->getSets(); - usort($sets, static function (RuleSetDescriptionInterface $a, RuleSetDescriptionInterface $b): int { - return strcmp($a->getName(), $b->getName()); - }); + usort($sets, static fn (RuleSetDescriptionInterface $a, RuleSetDescriptionInterface $b): int => $a->getName() <=> $b->getName()); $json = ['sets' => []]; @@ -53,6 +47,6 @@ public function generate(ReportSummary $reportSummary): string ]; } - return json_encode($json, JSON_PRETTY_PRINT); + return json_encode($json, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php index c7d66e71..e6ced136 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php @@ -19,6 +19,8 @@ /** * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class ReportSummary diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php index cbbb7f4e..ad963f6d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php @@ -38,10 +38,10 @@ public function registerBuiltInReporters(): self foreach (SymfonyFinder::create()->files()->name('*Reporter.php')->in(__DIR__) as $file) { $relativeNamespace = $file->getRelativePath(); - $builtInReporters[] = sprintf( - '%s\\%s%s', + $builtInReporters[] = \sprintf( + '%s\%s%s', __NAMESPACE__, - $relativeNamespace ? $relativeNamespace.'\\' : '', + '' !== $relativeNamespace ? $relativeNamespace.'\\' : '', $file->getBasename('.php') ); } @@ -59,7 +59,7 @@ public function registerReporter(ReporterInterface $reporter): self $format = $reporter->getFormat(); if (isset($this->reporters[$format])) { - throw new \UnexpectedValueException(sprintf('Reporter for format "%s" is already registered.', $format)); + throw new \UnexpectedValueException(\sprintf('Reporter for format "%s" is already registered.', $format)); } $this->reporters[$format] = $reporter; @@ -81,7 +81,7 @@ public function getFormats(): array public function getReporter(string $format): ReporterInterface { if (!isset($this->reporters[$format])) { - throw new \UnexpectedValueException(sprintf('Reporter for format "%s" is not registered.', $format)); + throw new \UnexpectedValueException(\sprintf('Reporter for format "%s" is not registered.', $format)); } return $this->reporters[$format]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php index 0caddef5..62b338df 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php @@ -19,33 +19,27 @@ /** * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class TextReporter implements ReporterInterface { - /** - * {@inheritdoc} - */ public function getFormat(): string { return 'txt'; } - /** - * {@inheritdoc} - */ public function generate(ReportSummary $reportSummary): string { $sets = $reportSummary->getSets(); - usort($sets, static function (RuleSetDescriptionInterface $a, RuleSetDescriptionInterface $b): int { - return strcmp($a->getName(), $b->getName()); - }); + usort($sets, static fn (RuleSetDescriptionInterface $a, RuleSetDescriptionInterface $b): int => $a->getName() <=> $b->getName()); $output = ''; foreach ($sets as $i => $set) { - $output .= sprintf('%2d) %s', $i + 1, $set->getName()).PHP_EOL.' '.$set->getDescription().PHP_EOL; + $output .= \sprintf('%2d) %s', $i + 1, $set->getName()).PHP_EOL.' '.$set->getDescription().PHP_EOL; if ($set->isRisky()) { $output .= ' Set contains risky rules.'.PHP_EOL; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php index 26d669ac..b6a0a279 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php @@ -15,19 +15,23 @@ namespace PhpCsFixer\Console\SelfUpdate; /** + * @readonly + * * @internal */ final class GithubClient implements GithubClientInterface { - /** - * {@inheritdoc} - */ - public function getTags(): array + private string $url; + + public function __construct(string $url = 'https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/tags') { - $url = 'https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/tags'; + $this->url = $url; + } + public function getTags(): array + { $result = @file_get_contents( - $url, + $this->url, false, stream_context_create([ 'http' => [ @@ -37,18 +41,29 @@ public function getTags(): array ); if (false === $result) { - throw new \RuntimeException(sprintf('Failed to load tags at "%s".', $url)); + throw new \RuntimeException(\sprintf('Failed to load tags at "%s".', $this->url)); } + /** + * @var list + */ $result = json_decode($result, true); if (JSON_ERROR_NONE !== json_last_error()) { - throw new \RuntimeException(sprintf( + throw new \RuntimeException(\sprintf( 'Failed to read response from "%s" as JSON: %s.', - $url, + $this->url, json_last_error_msg() )); } - return $result; + return array_map( + static fn (array $tagData): string => $tagData['name'], + $result + ); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php index 38178a22..27728327 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php @@ -20,12 +20,7 @@ interface GithubClientInterface { /** - * @return list + * @return list */ public function getTags(): array; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php index 54ec34dd..67ed6e66 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php @@ -28,9 +28,9 @@ final class NewVersionChecker implements NewVersionCheckerInterface private VersionParser $versionParser; /** - * @var null|string[] + * @var null|list */ - private $availableVersions; + private ?array $availableVersions = null; public function __construct(GithubClientInterface $githubClient) { @@ -38,9 +38,6 @@ public function __construct(GithubClientInterface $githubClient) $this->versionParser = new VersionParser(); } - /** - * {@inheritdoc} - */ public function getLatestVersion(): string { $this->retrieveAvailableVersions(); @@ -48,9 +45,6 @@ public function getLatestVersion(): string return $this->availableVersions[0]; } - /** - * {@inheritdoc} - */ public function getLatestVersionOfMajor(int $majorVersion): ?string { $this->retrieveAvailableVersions(); @@ -66,9 +60,6 @@ public function getLatestVersionOfMajor(int $majorVersion): ?string return null; } - /** - * {@inheritdoc} - */ public function compareVersions(string $versionA, string $versionB): int { $versionA = $this->versionParser->normalize($versionA); @@ -91,9 +82,7 @@ private function retrieveAvailableVersions(): void return; } - foreach ($this->githubClient->getTags() as $tag) { - $version = $tag['name']; - + foreach ($this->githubClient->getTags() as $version) { try { $this->versionParser->normalize($version); @@ -105,6 +94,9 @@ private function retrieveAvailableVersions(): void } } - $this->availableVersions = Semver::rsort($this->availableVersions); + $versions = Semver::rsort($this->availableVersions); + \assert(array_is_list($versions)); // Semver::rsort provides soft `array` type, let's validate and ensure proper type for SCA + + $this->availableVersions = $versions; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php index dac182b8..7465c2a4 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php @@ -27,7 +27,7 @@ final class WarningsDetector private ToolInfoInterface $toolInfo; /** - * @var string[] + * @var list */ private array $warnings = []; @@ -50,7 +50,7 @@ public function detectOldVendor(): void if ($this->toolInfo->isInstalledByComposer()) { $details = $this->toolInfo->getComposerInstallationDetails(); if (ToolInfo::COMPOSER_LEGACY_PACKAGE_NAME === $details['name']) { - $this->warnings[] = sprintf( + $this->warnings[] = \sprintf( 'You are running PHP CS Fixer installed with old vendor `%s`. Please update to `%s`.', ToolInfo::COMPOSER_LEGACY_PACKAGE_NAME, ToolInfo::COMPOSER_PACKAGE_NAME @@ -60,7 +60,7 @@ public function detectOldVendor(): void } /** - * @return string[] + * @return list */ public function getWarnings(): array { @@ -68,9 +68,9 @@ public function getWarnings(): array return []; } - return array_unique(array_merge( + return array_values(array_unique(array_merge( $this->warnings, - ['If you need help while solving warnings, ask at https://gitter.im/PHP-CS-Fixer, we will help you!'] - )); + ['If you need help while solving warnings, ask at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/, we will help you!'] + ))); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php index f2896253..79385bc3 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php @@ -20,6 +20,8 @@ /** * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class DiffConsoleFormatter @@ -42,7 +44,7 @@ public function format(string $diff, string $lineTemplate = '%s'): string ? $this->template : Preg::replace('/<[^<>]+>/', '', $this->template); - return sprintf( + return \sprintf( $template, implode( PHP_EOL, @@ -61,7 +63,7 @@ static function (array $matches): string { $colour = 'cyan'; } - return sprintf('%s', $colour, OutputFormatter::escape($matches[0]), $colour); + return \sprintf('%s', $colour, OutputFormatter::escape($matches[0]), $colour); }, $line, 1, @@ -73,7 +75,7 @@ static function (array $matches): string { } } - return sprintf($lineTemplate, $line); + return \sprintf($lineTemplate, $line); }, Preg::split('#\R#u', $diff) ) diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php index 4509ea99..7749866c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php @@ -20,6 +20,8 @@ /** * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class FullDiffer implements DifferInterface @@ -37,9 +39,6 @@ public function __construct() ])); } - /** - * {@inheritdoc} - */ public function diff(string $old, string $new, ?\SplFileInfo $file = null): string { return $this->differ->diff($old, $new); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/NullDiffer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/NullDiffer.php index 8ef968ee..cf07f9e7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/NullDiffer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/NullDiffer.php @@ -19,9 +19,6 @@ */ final class NullDiffer implements DifferInterface { - /** - * {@inheritdoc} - */ public function diff(string $old, string $new, ?\SplFileInfo $file = null): string { return ''; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php index ad668608..36663aa1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php @@ -20,9 +20,6 @@ final class UnifiedDiffer implements DifferInterface { - /** - * {@inheritdoc} - */ public function diff(string $old, string $new, ?\SplFileInfo $file = null): string { if (null === $file) { @@ -33,7 +30,7 @@ public function diff(string $old, string $new, ?\SplFileInfo $file = null): stri } else { $filePath = $file->getRealPath(); - if (1 === Preg::match('/\s/', $filePath)) { + if (Preg::match('/\s/', $filePath)) { $filePath = '"'.$filePath.'"'; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php index 629f04c7..c3af8adf 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php @@ -29,9 +29,9 @@ final class Annotation /** * All the annotation tag names with types. * - * @var string[] + * @var list */ - private static array $tags = [ + private const TAGS = [ 'method', 'param', 'property', @@ -46,61 +46,50 @@ final class Annotation /** * The lines that make up the annotation. * - * @var Line[] + * @var array */ private array $lines; /** * The position of the first line of the annotation in the docblock. - * - * @var int */ - private $start; + private int $start; /** * The position of the last line of the annotation in the docblock. - * - * @var int */ - private $end; + private int $end; /** * The associated tag. - * - * @var null|Tag */ - private $tag; + private ?Tag $tag = null; /** * Lazy loaded, cached types content. - * - * @var null|string */ - private $typesContent; + private ?string $typesContent = null; /** * The cached types. * - * @var null|string[] + * @var null|list */ - private $types; + private ?array $types = null; - /** - * @var null|NamespaceAnalysis - */ - private $namespace; + private ?NamespaceAnalysis $namespace = null; /** - * @var NamespaceUseAnalysis[] + * @var list */ private array $namespaceUses; /** * Create a new line instance. * - * @param Line[] $lines - * @param null|NamespaceAnalysis $namespace - * @param NamespaceUseAnalysis[] $namespaceUses + * @param array $lines + * @param null|NamespaceAnalysis $namespace + * @param list $namespaceUses */ public function __construct(array $lines, $namespace = null, array $namespaceUses = []) { @@ -108,10 +97,8 @@ public function __construct(array $lines, $namespace = null, array $namespaceUse $this->namespace = $namespace; $this->namespaceUses = $namespaceUses; - $keys = array_keys($lines); - - $this->start = $keys[0]; - $this->end = end($keys); + $this->start = array_key_first($lines); + $this->end = array_key_last($lines); } /** @@ -125,11 +112,11 @@ public function __toString(): string /** * Get all the annotation tag names with types. * - * @return string[] + * @return list */ public static function getTagsWithTypes(): array { - return self::$tags; + return self::TAGS; } /** @@ -163,20 +150,27 @@ public function getTag(): Tag /** * @internal */ - public function getTypeExpression(): TypeExpression + public function getTypeExpression(): ?TypeExpression { - return new TypeExpression($this->getTypesContent(), $this->namespace, $this->namespaceUses); + $typesContent = $this->getTypesContent(); + + return null === $typesContent + ? null + : new TypeExpression($typesContent, $this->namespace, $this->namespaceUses); } /** - * @return null|string - * * @internal */ - public function getVariableName() + public function getVariableName(): ?string { - $type = preg_quote($this->getTypesContent(), '/'); - $regex = "/@{$this->tag->getName()}\\s+({$type}\\s*)?(&\\s*)?(\\.{3}\\s*)?(?\\$.+?)(?:[\\s*]|$)/"; + $type = preg_quote($this->getTypesContent() ?? '', '/'); + $regex = \sprintf( + '/@%s\s+(%s\s*)?(&\s*)?(\.{3}\s*)?(?\$%s)(?:.*|$)/', + $this->tag->getName(), + $type, + TypeExpression::REGEX_IDENTIFIER + ); if (Preg::match($regex, $this->lines[0]->getContent(), $matches)) { return $matches['variable']; @@ -188,12 +182,15 @@ public function getVariableName() /** * Get the types associated with this annotation. * - * @return string[] + * @return list */ public function getTypes(): array { if (null === $this->types) { - $this->types = $this->getTypeExpression()->getTypes(); + $typeExpression = $this->getTypeExpression(); + $this->types = null === $typeExpression + ? [] + : $typeExpression->getTypes(); } return $this->types; @@ -202,13 +199,25 @@ public function getTypes(): array /** * Set the types associated with this annotation. * - * @param string[] $types + * @param list $types */ public function setTypes(array $types): void { - $pattern = '/'.preg_quote($this->getTypesContent(), '/').'/'; + $origTypesContent = $this->getTypesContent(); + $newTypesContent = implode( + // Fallback to union type is provided for backward compatibility (previously glue was set to `|` by default even when type was not composite) + // @TODO Better handling for cases where type is fixed (original type is not composite, but was made composite during fix) + $this->getTypeExpression()->getTypesGlue() ?? '|', + $types + ); + + if ($origTypesContent === $newTypesContent) { + return; + } + + $pattern = '/'.preg_quote($origTypesContent, '/').'/'; - $this->lines[0]->setContent(Preg::replace($pattern, implode($this->getTypeExpression()->getTypesGlue(), $types), $this->lines[0]->getContent(), 1)); + $this->lines[0]->setContent(Preg::replace($pattern, $newTypesContent, $this->lines[0]->getContent(), 1)); $this->clearCache(); } @@ -216,17 +225,21 @@ public function setTypes(array $types): void /** * Get the normalized types associated with this annotation, so they can easily be compared. * - * @return string[] + * @return list */ public function getNormalizedTypes(): array { - $normalized = array_map(static function (string $type): string { - return strtolower($type); - }, $this->getTypes()); + $typeExpression = $this->getTypeExpression(); + if (null === $typeExpression) { + return []; + } - sort($normalized); + $normalizedTypeExpression = $typeExpression + ->mapTypes(static fn (TypeExpression $v) => new TypeExpression(strtolower($v->toString()), null, [])) + ->sortTypes(static fn (TypeExpression $a, TypeExpression $b) => $a->toString() <=> $b->toString()) + ; - return $normalized; + return $normalizedTypeExpression->getTypes(); } /** @@ -267,7 +280,7 @@ public function getContent(): string public function supportTypes(): bool { - return \in_array($this->getTag()->getName(), self::$tags, true); + return \in_array($this->getTag()->getName(), self::TAGS, true); } /** @@ -275,7 +288,7 @@ public function supportTypes(): bool * * Be careful modifying the underlying line as that won't flush the cache. */ - private function getTypesContent(): string + private function getTypesContent(): ?string { if (null === $this->typesContent) { $name = $this->getTag()->getName(); @@ -285,14 +298,14 @@ private function getTypesContent(): string } $matchingResult = Preg::match( - '{^(?:\s*\*|/\*\*)\s*@'.$name.'\s+'.TypeExpression::REGEX_TYPES.'(?:(?:[*\h\v]|\&[\.\$]).*)?\r?$}isx', + '{^(?:\h*\*|/\*\*)[\h*]*@'.$name.'\h+'.TypeExpression::REGEX_TYPES.'(?:(?:[*\h\v]|\&?[\.\$]).*)?\r?$}is', $this->lines[0]->getContent(), $matches ); - $this->typesContent = 1 === $matchingResult + $this->typesContent = $matchingResult ? $matches['types'] - : ''; + : null; } return $this->typesContent; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php index 5a0b2f40..b4ae53e2 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php @@ -152,9 +152,7 @@ public function makeSingleLine(): void $usefulLines = array_filter( $this->lines, - static function (Line $line): bool { - return $line->containsUsefulContent(); - } + static fn (Line $line): bool => $line->containsUsefulContent() ); if (1 < \count($usefulLines)) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php index 0db50e82..9ef4a087 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php @@ -59,7 +59,7 @@ public function getContent(): string */ public function containsUsefulContent(): bool { - return 0 !== Preg::match('/\\*\s*\S+/', $this->content) && '' !== trim(str_replace(['/', '*'], ' ', $this->content)); + return Preg::match('/\*\s*\S+/', $this->content) && '' !== trim(str_replace(['/', '*'], ' ', $this->content)); } /** @@ -69,7 +69,7 @@ public function containsUsefulContent(): bool */ public function containsATag(): bool { - return 0 !== Preg::match('/\\*\s*@/', $this->content); + return Preg::match('/\*\s*@/', $this->content); } /** @@ -119,7 +119,7 @@ public function addBlank(): void { $matched = Preg::match('/^(\h*\*)[^\r\n]*(\r?\n)$/', $this->content, $matches); - if (1 !== $matched) { + if (!$matched) { return; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/ShortDescription.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/ShortDescription.php index dbd9e5da..d053bc44 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/ShortDescription.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/ShortDescription.php @@ -17,6 +17,8 @@ /** * This class represents a short description (aka summary) of a docblock. * + * @readonly + * * @internal */ final class ShortDescription diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php index 578fd3a7..c5a3a896 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php @@ -28,6 +28,8 @@ final class TagComparator /** * Groups of tags that should be allowed to immediately follow each other. * + * @var list> + * * @internal */ public const DEFAULT_GROUPS = [ @@ -40,7 +42,7 @@ final class TagComparator /** * Should the given tags be kept together, or kept apart? * - * @param string[][] $groups + * @param list> $groups */ public static function shouldBeTogether(Tag $first, Tag $second, array $groups = self::DEFAULT_GROUPS): bool { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php index 783d4a79..39e68686 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php @@ -20,111 +20,212 @@ use PhpCsFixer\Utils; /** + * @author Michael Vorisek + * * @internal */ final class TypeExpression { /** - * Regex to match any types, shall be used with `x` modifier. + * Regex to match any PHP identifier. + * + * @internal + */ + public const REGEX_IDENTIFIER = '(?:(?!(? # several types separated by `|` or `&` - (? # single type - (?\??) + public const REGEX_TYPES = '(?(?x) # one or several types separated by `|` or `&` +'.self::REGEX_TYPE.' + (?: + \h*(?[|&])\h* + (?&type) + )*+ + )'; + + /** + * Based on: + * - https://github.com/phpstan/phpdoc-parser/blob/1.26.0/doc/grammars/type.abnf fuzzing grammar + * - and https://github.com/phpstan/phpdoc-parser/blob/1.26.0/src/Parser/PhpDocParser.php parser impl. + */ + private const REGEX_TYPE = '(?(?x) # single type + (?\??\h*) (?: - (? - (?array\h*\{) - (? - (? - \h*[^?:\h]+\h*\??\h*:\h*(?&types) - ) - (?:\h*,(?&object_like_array_key))* + (? + (?(?i)(?:array|list|object)(?-i)) + (?\h*\{\h*) + (? + (? + (?(?:(?&constant)|(?&identifier)|(?&name))\h*\??\h*:\h*|) + (?(?&types_inner)) ) + (?: + \h*,\h* + (?&array_shape_inner) + )*+ + (?:\h*,\h*)? + |) \h*\} ) | - (? # callable syntax, e.g. `callable(string): bool` - (?(?:callable|\\\\?Closure)\h*\(\h*) - (? - (?&types) + (? # callable syntax, e.g. `callable(string, int...): bool`, `\Closure(T, int): T` + (?(?&name)) + (? + (?\h*<\h*) + (? + (? + (? + (?&identifier) + ) + (? # template bound + \h+(?i)(?of|as)(?-i)\h+ + (?(?&types_inner)) + |) + (? # template default + \h*=\h* + (?(?&types_inner)) + |) + ) (?: \h*,\h* - (?&types) - )* - )? + (?&callable_template_inner) + )*+ + ) + \h*> + (?=\h*\() + |) + (?\h*\(\h*) + (? + (? + (?(?&types_inner)) + (?\h*&|) + (?\h*\.\.\.|) + (?\h*\$(?&identifier)|) + (?\h*=|) + ) + (?: + \h*,\h* + (?&callable_argument) + )*+ + (?:\h*,\h*)? + |) \h*\) (?: \h*\:\h* - (?(?&types)) + (?(?&type)) )? ) | (? # generic syntax, e.g.: `array` - (? - (?&name)+ - \h*<\h* + (?(?&name)) + (?\h*<\h*) + (? + (?&types_inner) + (?: + \h*,\h* + (?&types_inner) + )*+ + (?:\h*,\h*)? ) - (? - (?&types) - (?: - \h*,\h* - (?&types) - )* - ) \h*> ) | (? # class constants with optional wildcard, e.g.: `Foo::*`, `Foo::CONST_A`, `FOO::CONST_*` - (?&name)::(\*|\w+\*?) + (?(?&name)) + ::\*?(?:(?&identifier)\*?)* ) | - (? # array expression, e.g.: `string[]`, `string[][]` - (?&name)(\[\])+ + (? # single constant value (case insensitive), e.g.: 1, -1.8E+6, `\'a\'` + (?i) + # all sorts of numbers: with or without sign, supports literal separator and several numeric systems, + # e.g.: 1, +1.1, 1., .1, -1, 123E+8, 123_456_789, 0x7Fb4, 0b0110, 0o777 + [+-]?(?: + (?:0b[01]++(?:_[01]++)*+) + | (?:0o[0-7]++(?:_[0-7]++)*+) + | (?:0x[\da-f]++(?:_[\da-f]++)*+) + | (?:(?\d++(?:_\d++)*+)|(?=\.\d)) + (?:\.(?&constant_digits)|(?<=\d)\.)?+ + (?:e[+-]?(?&constant_digits))?+ + ) + | \'(?:[^\'\\\]|\\\.)*+\' + | "(?:[^"\\\]|\\\.)*+" + (?-i) ) | - (? # single constant value (case insensitive), e.g.: 1, `\'a\'` + (? # self reference, e.g.: $this, $self, @static (?i) - null | true | false - | -?(?:\d+(?:\.\d*)?|\.\d+) # all sorts of numbers with or without minus, e.g.: 1, 1.1, 1., .1, -1 - | \'[^\']+?\' | "[^"]+?" - | [@$]?(?:this | self | static) + [@$](?:this | self | static) (?-i) ) | - (? # single type, e.g.: `null`, `int`, `\Foo\Bar` - [\\\\\w-]++ + (? # full name, e.g.: `int`, `\DateTime`, `\Foo\Bar`, `positive-int` + \\\?+ + (?'.self::REGEX_IDENTIFIER.') + (?:[\\\\\-](?&identifier))*+ + ) + | + (? # parenthesized type, e.g.: `(int)`, `(int|\stdClass)` + (? + \(\h* + ) + (?: + (? + (?&types_inner) + ) + | + (? # conditional type, e.g.: `$foo is \Throwable ? false : $foo` + (? + (?:\$(?&identifier)) + | + (?(?&types_inner)) + ) + (? + \h+(?i)is(?:\h+not)?(?-i)\h+ + ) + (?(?&types_inner)) + (?\h*\?\h*) + (?(?&types_inner)) + (?\h*:\h*) + (?(?&types_inner)) + ) + ) + \h*\) ) ) - ) - (?: - \h*(?[|&])\h* - (?&type) - )* - ) - '; + (? # array, e.g.: `string[]`, `array[][]` + (\h*\[\h*\])* + ) + (?:(?=1)0 + (?(?> + (?&type) + (?: + \h*[|&]\h* + (?&type) + )*+ + )) + |) + )'; private string $value; - private bool $isUnionType = false; + private bool $isCompositeType; - /** - * @var list - */ - private array $innerTypeExpressions = []; + /** @var null|'&'|'|' */ + private ?string $typesGlue = null; - private string $typesGlue = '|'; + /** @var list */ + private array $innerTypeExpressions = []; private ?NamespaceAnalysis $namespace; - /** - * @var NamespaceUseAnalysis[] - */ + /** @var list */ private array $namespaceUses; /** - * @param NamespaceUseAnalysis[] $namespaceUses + * @param list $namespaceUses */ public function __construct(string $value, ?NamespaceAnalysis $namespace, array $namespaceUses) { @@ -141,11 +242,11 @@ public function toString(): string } /** - * @return string[] + * @return list */ public function getTypes(): array { - if ($this->isUnionType) { + if ($this->isCompositeType) { return array_map( static fn (array $type) => $type['expression']->toString(), $this->innerTypeExpressions, @@ -156,40 +257,105 @@ public function getTypes(): array } /** - * @param callable(self $a, self $b): int $compareCallback + * Determines if type expression is a composite type (union or intersection). + */ + public function isCompositeType(): bool + { + return $this->isCompositeType; + } + + public function isUnionType(): bool + { + return $this->isCompositeType && '|' === $this->typesGlue; + } + + public function isIntersectionType(): bool + { + return $this->isCompositeType && '&' === $this->typesGlue; + } + + /** + * @return null|'&'|'|' + */ + public function getTypesGlue(): ?string + { + return $this->typesGlue; + } + + /** + * @param \Closure(self): self $callback */ - public function sortTypes(callable $compareCallback): void + public function mapTypes(\Closure $callback): self { - foreach (array_reverse($this->innerTypeExpressions) as [ - 'start_index' => $startIndex, + $value = $this->value; + $startIndexOffset = 0; + + foreach ($this->innerTypeExpressions as [ + 'start_index' => $startIndexOrig, 'expression' => $inner, ]) { - $initialValueLength = \strlen($inner->toString()); + $innerValueOrig = $inner->value; - $inner->sortTypes($compareCallback); + $inner = $inner->mapTypes($callback); - $this->value = substr_replace( - $this->value, - $inner->toString(), - $startIndex, - $initialValueLength - ); + if ($inner->value !== $innerValueOrig) { + $value = substr_replace( + $value, + $inner->value, + $startIndexOrig + $startIndexOffset, + \strlen($innerValueOrig) + ); + + $startIndexOffset += \strlen($inner->value) - \strlen($innerValueOrig); + } } - if ($this->isUnionType) { - $this->innerTypeExpressions = Utils::stableSort( - $this->innerTypeExpressions, - static fn (array $type): self => $type['expression'], - $compareCallback, - ); + $type = $value === $this->value + ? $this + : $this->inner($value); - $this->value = implode($this->getTypesGlue(), $this->getTypes()); - } + return $callback($type); } - public function getTypesGlue(): string + /** + * @param \Closure(self): void $callback + */ + public function walkTypes(\Closure $callback): void { - return $this->typesGlue; + $this->mapTypes(static function (self $type) use ($callback) { + $valueOrig = $type->value; + $callback($type); + \assert($type->value === $valueOrig); + + return $type; + }); + } + + /** + * @param \Closure(self, self): (-1|0|1) $compareCallback + */ + public function sortTypes(\Closure $compareCallback): self + { + return $this->mapTypes(function (self $type) use ($compareCallback): self { + if ($type->isCompositeType) { + $innerTypeExpressions = Utils::stableSort( + $type->innerTypeExpressions, + static fn (array $v): self => $v['expression'], + $compareCallback, + ); + + if ($innerTypeExpressions !== $type->innerTypeExpressions) { + $value = implode( + $type->getTypesGlue(), + array_map(static fn (array $v): string => $v['expression']->toString(), $innerTypeExpressions) + ); + + return $this->inner($value); + } + } + + return $type; + }); } public function getCommonType(): ?string @@ -203,14 +369,20 @@ public function getCommonType(): ?string continue; } - if (isset($aliases[$type])) { - $type = $aliases[$type]; - } elseif (1 === Preg::match('/\[\]$/', $type)) { + if (str_starts_with($type, '?')) { + $type = substr($type, 1); + } + + if (Preg::match('/\[\h*\]$/', $type)) { $type = 'array'; - } elseif (1 === Preg::match('/^(.+?)getTypes() as $type) { - if (\in_array($type, ['null', 'mixed'], true)) { + if (\in_array($type, ['null', 'mixed'], true) || str_starts_with($type, '?')) { return true; } } @@ -240,135 +412,317 @@ public function allowsNull(): bool private function parse(): void { - $value = $this->value; - - Preg::match( - '{^'.self::REGEX_TYPES.'$}x', - $value, - $matches - ); - - if ([] === $matches) { - return; - } + $seenGlues = null; + $innerValues = []; - $this->typesGlue = $matches['glue'] ?? $this->typesGlue; + $index = 0; + while (true) { + Preg::match( + '{\G'.self::REGEX_TYPE.'(?\h*(?[|&])\h*(?!$)|$)}', + $this->value, + $matches, + PREG_OFFSET_CAPTURE, + $index + ); - $index = '' !== $matches['nullable'] ? 1 : 0; + if ([] === $matches) { + throw new \Exception('Unable to parse phpdoc type '.var_export($this->value, true)); + } - if ($matches['type'] !== $matches['types']) { - $this->isUnionType = true; + if (null === $seenGlues) { + if (($matches['glue'][0] ?? '') === '') { + break; + } - while (true) { - $innerType = $matches['type']; + $seenGlues = ['|' => false, '&' => false]; + } - $newValue = Preg::replace( - '/^'.preg_quote($innerType, '/').'(\h*[|&]\h*)?/', - '', - $value - ); + if (($matches['glue'][0] ?? '') !== '') { + \assert(isset($seenGlues[$matches['glue'][0]])); + $seenGlues[$matches['glue'][0]] = true; + } - $this->innerTypeExpressions[] = [ - 'start_index' => $index, - 'expression' => $this->inner($innerType), - ]; + $innerValues[] = [ + 'start_index' => $index, + 'value' => $matches['type'][0], + 'next_glue' => $matches['glue'][0] ?? null, + 'next_glue_raw' => $matches['glue_raw'][0] ?? null, + ]; - if ('' === $newValue) { - return; + $consumedValueLength = \strlen($matches[0][0]); + $index += $consumedValueLength; + + if (\strlen($this->value) <= $index) { + \assert(\strlen($this->value) === $index); + + $seenGlues = array_filter($seenGlues); + \assert([] !== $seenGlues); + + $this->isCompositeType = true; + $this->typesGlue = array_key_first($seenGlues); + + if (1 === \count($seenGlues)) { + foreach ($innerValues as $innerValue) { + $this->innerTypeExpressions[] = [ + 'start_index' => $innerValue['start_index'], + 'expression' => $this->inner($innerValue['value']), + ]; + } + } else { + for ($i = 0; $i < \count($innerValues); ++$i) { + $innerStartIndex = $innerValues[$i]['start_index']; + $innerValue = ''; + while (true) { + $innerValue .= $innerValues[$i]['value']; + + if (($innerValues[$i]['next_glue'] ?? $this->typesGlue) === $this->typesGlue) { + break; + } + + $innerValue .= $innerValues[$i]['next_glue_raw']; + + ++$i; + } + + $this->innerTypeExpressions[] = [ + 'start_index' => $innerStartIndex, + 'expression' => $this->inner($innerValue), + ]; + } } - $index += \strlen($value) - \strlen($newValue); - $value = $newValue; - - Preg::match( - '{^'.self::REGEX_TYPES.'$}x', - $value, - $matches - ); + return; } } - if ('' !== ($matches['generic'] ?? '')) { + $this->isCompositeType = false; + + if ('' !== $matches['nullable'][0]) { + $this->innerTypeExpressions[] = [ + 'start_index' => \strlen($matches['nullable'][0]), + 'expression' => $this->inner(substr($matches['type'][0], \strlen($matches['nullable'][0]))), + ]; + } elseif ('' !== $matches['array'][0]) { + $this->innerTypeExpressions[] = [ + 'start_index' => 0, + 'expression' => $this->inner(substr($matches['type'][0], 0, -\strlen($matches['array'][0]))), + ]; + } elseif ('' !== ($matches['generic'][0] ?? '') && 0 === $matches['generic'][1]) { + $this->innerTypeExpressions[] = [ + 'start_index' => 0, + 'expression' => $this->inner($matches['generic_name'][0]), + ]; + $this->parseCommaSeparatedInnerTypes( - $index + \strlen($matches['generic_start']), - $matches['generic_types'] + \strlen($matches['generic_name'][0]) + \strlen($matches['generic_start'][0]), + $matches['generic_types'][0] ); + } elseif ('' !== ($matches['callable'][0] ?? '') && 0 === $matches['callable'][1]) { + $this->innerTypeExpressions[] = [ + 'start_index' => 0, + 'expression' => $this->inner($matches['callable_name'][0]), + ]; - return; - } + $this->parseCallableTemplateInnerTypes( + \strlen($matches['callable_name'][0]) + + \strlen($matches['callable_template_start'][0]), + $matches['callable_template_inners'][0] + ); - if ('' !== ($matches['callable'] ?? '')) { - $this->parseCommaSeparatedInnerTypes( - $index + \strlen($matches['callable_start']), - $matches['callable_arguments'] ?? '' + $this->parseCallableArgumentTypes( + \strlen($matches['callable_name'][0]) + + \strlen($matches['callable_template'][0]) + + \strlen($matches['callable_start'][0]), + $matches['callable_arguments'][0] ); - $return = $matches['callable_return'] ?? null; - if (null !== $return) { + if ('' !== ($matches['callable_return'][0] ?? '')) { $this->innerTypeExpressions[] = [ - 'start_index' => \strlen($this->value) - \strlen($matches['callable_return']), - 'expression' => $this->inner($matches['callable_return']), + 'start_index' => \strlen($this->value) - \strlen($matches['callable_return'][0]), + 'expression' => $this->inner($matches['callable_return'][0]), ]; } + } elseif ('' !== ($matches['array_shape'][0] ?? '') && 0 === $matches['array_shape'][1]) { + $this->innerTypeExpressions[] = [ + 'start_index' => 0, + 'expression' => $this->inner($matches['array_shape_name'][0]), + ]; - return; - } - - if ('' !== ($matches['object_like_array'] ?? '')) { - $this->parseObjectLikeArrayKeys( - $index + \strlen($matches['object_like_array_start']), - $matches['object_like_array_keys'] + $this->parseArrayShapeInnerTypes( + \strlen($matches['array_shape_name'][0]) + \strlen($matches['array_shape_start'][0]), + $matches['array_shape_inners'][0] ); + } elseif ('' !== ($matches['parenthesized'][0] ?? '') && 0 === $matches['parenthesized'][1]) { + $index = \strlen($matches['parenthesized_start'][0]); + + if ('' !== ($matches['conditional'][0] ?? '')) { + if ('' !== ($matches['conditional_cond_left_types'][0] ?? '')) { + $this->innerTypeExpressions[] = [ + 'start_index' => $index, + 'expression' => $this->inner($matches['conditional_cond_left_types'][0]), + ]; + } + + $index += \strlen($matches['conditional_cond_left'][0]) + \strlen($matches['conditional_cond_middle'][0]); + + $this->innerTypeExpressions[] = [ + 'start_index' => $index, + 'expression' => $this->inner($matches['conditional_cond_right_types'][0]), + ]; + + $index += \strlen($matches['conditional_cond_right_types'][0]) + \strlen($matches['conditional_true_start'][0]); + + $this->innerTypeExpressions[] = [ + 'start_index' => $index, + 'expression' => $this->inner($matches['conditional_true_types'][0]), + ]; + + $index += \strlen($matches['conditional_true_types'][0]) + \strlen($matches['conditional_false_start'][0]); + + $this->innerTypeExpressions[] = [ + 'start_index' => $index, + 'expression' => $this->inner($matches['conditional_false_types'][0]), + ]; + } else { + $this->innerTypeExpressions[] = [ + 'start_index' => $index, + 'expression' => $this->inner($matches['parenthesized_types'][0]), + ]; + } + } elseif ('' !== $matches['class_constant'][0]) { + $this->innerTypeExpressions[] = [ + 'start_index' => 0, + 'expression' => $this->inner($matches['class_constant_name'][0]), + ]; } } private function parseCommaSeparatedInnerTypes(int $startIndex, string $value): void { - while ('' !== $value) { + $index = 0; + while (\strlen($value) !== $index) { Preg::match( - '{^'.self::REGEX_TYPES.'\h*(?:,|$)}x', + '{\G'.self::REGEX_TYPES.'(?:\h*,\h*|$)}', $value, - $matches + $matches, + 0, + $index ); $this->innerTypeExpressions[] = [ - 'start_index' => $startIndex, + 'start_index' => $startIndex + $index, 'expression' => $this->inner($matches['types']), ]; - $newValue = Preg::replace( - '/^'.preg_quote($matches['types'], '/').'(\h*\,\h*)?/', - '', - $value + $index += \strlen($matches[0]); + } + } + + private function parseCallableTemplateInnerTypes(int $startIndex, string $value): void + { + $index = 0; + while (\strlen($value) !== $index) { + Preg::match( + '{\G(?:(?=1)0'.self::REGEX_TYPES.'|(?<_callable_template_inner>(?&callable_template_inner))(?:\h*,\h*|$))}', + $value, + $prematches, + 0, + $index ); + $consumedValue = $prematches['_callable_template_inner']; + $consumedValueLength = \strlen($consumedValue); + $consumedCommaLength = \strlen($prematches[0]) - $consumedValueLength; + + $addedPrefix = 'Closure<'; + Preg::match( + '{^'.self::REGEX_TYPES.'$}', + $addedPrefix.$consumedValue.'>(): void', + $matches, + PREG_OFFSET_CAPTURE + ); + + if ('' !== $matches['callable_template_inner_b'][0]) { + $this->innerTypeExpressions[] = [ + 'start_index' => $startIndex + $index + $matches['callable_template_inner_b_types'][1] + - \strlen($addedPrefix), + 'expression' => $this->inner($matches['callable_template_inner_b_types'][0]), + ]; + } + + if ('' !== $matches['callable_template_inner_d'][0]) { + $this->innerTypeExpressions[] = [ + 'start_index' => $startIndex + $index + $matches['callable_template_inner_d_types'][1] + - \strlen($addedPrefix), + 'expression' => $this->inner($matches['callable_template_inner_d_types'][0]), + ]; + } - $startIndex += \strlen($value) - \strlen($newValue); - $value = $newValue; + $index += $consumedValueLength + $consumedCommaLength; } } - private function parseObjectLikeArrayKeys(int $startIndex, string $value): void + private function parseCallableArgumentTypes(int $startIndex, string $value): void { - while ('' !== $value) { + $index = 0; + while (\strlen($value) !== $index) { Preg::match( - '{(?<_start>^.+?:\h*)'.self::REGEX_TYPES.'\h*(?:,|$)}x', + '{\G(?:(?=1)0'.self::REGEX_TYPES.'|(?<_callable_argument>(?&callable_argument))(?:\h*,\h*|$))}', $value, - $matches + $prematches, + 0, + $index + ); + $consumedValue = $prematches['_callable_argument']; + $consumedValueLength = \strlen($consumedValue); + $consumedCommaLength = \strlen($prematches[0]) - $consumedValueLength; + + $addedPrefix = 'Closure('; + Preg::match( + '{^'.self::REGEX_TYPES.'$}', + $addedPrefix.$consumedValue.'): void', + $matches, + PREG_OFFSET_CAPTURE ); $this->innerTypeExpressions[] = [ - 'start_index' => $startIndex + \strlen($matches['_start']), - 'expression' => $this->inner($matches['types']), + 'start_index' => $startIndex + $index, + 'expression' => $this->inner($matches['callable_argument_type'][0]), ]; - $newValue = Preg::replace( - '/^.+?:\h*'.preg_quote($matches['types'], '/').'(\h*\,\h*)?/', - '', - $value + $index += $consumedValueLength + $consumedCommaLength; + } + } + + private function parseArrayShapeInnerTypes(int $startIndex, string $value): void + { + $index = 0; + while (\strlen($value) !== $index) { + Preg::match( + '{\G(?:(?=1)0'.self::REGEX_TYPES.'|(?<_array_shape_inner>(?&array_shape_inner))(?:\h*,\h*|$))}', + $value, + $prematches, + 0, + $index ); + $consumedValue = $prematches['_array_shape_inner']; + $consumedValueLength = \strlen($consumedValue); + $consumedCommaLength = \strlen($prematches[0]) - $consumedValueLength; + + $addedPrefix = 'array{'; + Preg::match( + '{^'.self::REGEX_TYPES.'$}', + $addedPrefix.$consumedValue.'}', + $matches, + PREG_OFFSET_CAPTURE + ); + + $this->innerTypeExpressions[] = [ + 'start_index' => $startIndex + $index + $matches['array_shape_inner_value'][1] + - \strlen($addedPrefix), + 'expression' => $this->inner($matches['array_shape_inner_value'][0]), + ]; - $startIndex += \strlen($value) - \strlen($newValue); - $value = $newValue; + $index += $consumedValueLength + $consumedCommaLength; } } @@ -408,6 +762,7 @@ private function normalize(string $type): string 'array', 'bool', 'callable', + 'false', 'float', 'int', 'iterable', @@ -417,16 +772,17 @@ private function normalize(string $type): string 'object', 'resource', 'string', + 'true', 'void', ], true)) { return $type; } - if (1 === Preg::match('/\[\]$/', $type)) { + if (Preg::match('/\[\]$/', $type)) { return 'array'; } - if (1 === Preg::match('/^(.+?) + * @return array */ private function getAliases(): array { @@ -458,6 +814,7 @@ private function getAliases(): array 'double' => 'float', 'false' => 'bool', 'integer' => 'int', + 'list' => 'array', 'real' => 'float', 'true' => 'bool', ]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php new file mode 100644 index 00000000..af64205b --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php @@ -0,0 +1,171 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Doctrine\Annotation; + +use PhpCsFixer\Preg; + +/** + * Copyright (c) 2006-2013 Doctrine Project. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished to do + * so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * @internal + */ +final class DocLexer +{ + public const T_NONE = 1; + public const T_INTEGER = 2; + public const T_STRING = 3; + public const T_FLOAT = 4; + + // All tokens that are also identifiers should be >= 100 + public const T_IDENTIFIER = 100; + public const T_AT = 101; + public const T_CLOSE_CURLY_BRACES = 102; + public const T_CLOSE_PARENTHESIS = 103; + public const T_COMMA = 104; + public const T_EQUALS = 105; + public const T_FALSE = 106; + public const T_NAMESPACE_SEPARATOR = 107; + public const T_OPEN_CURLY_BRACES = 108; + public const T_OPEN_PARENTHESIS = 109; + public const T_TRUE = 110; + public const T_NULL = 111; + public const T_COLON = 112; + public const T_MINUS = 113; + + /** @var array */ + private array $noCase = [ + '@' => self::T_AT, + ',' => self::T_COMMA, + '(' => self::T_OPEN_PARENTHESIS, + ')' => self::T_CLOSE_PARENTHESIS, + '{' => self::T_OPEN_CURLY_BRACES, + '}' => self::T_CLOSE_CURLY_BRACES, + '=' => self::T_EQUALS, + ':' => self::T_COLON, + '-' => self::T_MINUS, + '\\' => self::T_NAMESPACE_SEPARATOR, + ]; + + /** @var list */ + private array $tokens = []; + + private int $position = 0; + + private int $peek = 0; + + private ?string $regex = null; + + public function setInput(string $input): void + { + $this->tokens = []; + $this->reset(); + $this->scan($input); + } + + public function reset(): void + { + $this->peek = 0; + $this->position = 0; + } + + public function peek(): ?Token + { + if (isset($this->tokens[$this->position + $this->peek])) { + return $this->tokens[$this->position + $this->peek++]; + } + + return null; + } + + /** + * @return list + */ + private function getCatchablePatterns(): array + { + return [ + '[a-z_\\\][a-z0-9_\:\\\]*[a-z_][a-z0-9_]*', + '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?', + '"(?:""|[^"])*+"', + ]; + } + + /** + * @return list + */ + private function getNonCatchablePatterns(): array + { + return ['\s+', '\*+', '(.)']; + } + + /** + * @return self::T_* + */ + private function getType(string &$value): int + { + $type = self::T_NONE; + + if ('"' === $value[0]) { + $value = str_replace('""', '"', substr($value, 1, \strlen($value) - 2)); + + return self::T_STRING; + } + + if (isset($this->noCase[$value])) { + return $this->noCase[$value]; + } + + if ('_' === $value[0] || '\\' === $value[0] || !Preg::match('/[^A-Za-z]/', $value[0])) { + return self::T_IDENTIFIER; + } + + if (is_numeric($value)) { + return str_contains($value, '.') || false !== stripos($value, 'e') + ? self::T_FLOAT : self::T_INTEGER; + } + + return $type; + } + + private function scan(string $input): void + { + $this->regex ??= \sprintf( + '/(%s)|%s/%s', + implode(')|(', $this->getCatchablePatterns()), + implode('|', $this->getNonCatchablePatterns()), + 'iu' + ); + + $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE; + $matches = Preg::split($this->regex, $input, -1, $flags); + + foreach ($matches as $match) { + // Must remain before 'value' assignment since it can change content + $firstMatch = $match[0]; + $type = $this->getType($firstMatch); + + $this->tokens[] = new Token($type, $firstMatch, (int) $match[1]); + } + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php index 4e5a4a5d..56cb83e4 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php @@ -14,8 +14,6 @@ namespace PhpCsFixer\Doctrine\Annotation; -use Doctrine\Common\Annotations\DocLexer; - /** * A Doctrine annotation token. * @@ -27,14 +25,17 @@ final class Token private string $content; + private int $position; + /** * @param int $type The type * @param string $content The content */ - public function __construct(int $type = DocLexer::T_NONE, string $content = '') + public function __construct(int $type = DocLexer::T_NONE, string $content = '', int $position = 0) { $this->type = $type; $this->content = $content; + $this->position = $position; } public function getType(): int @@ -57,10 +58,15 @@ public function setContent(string $content): void $this->content = $content; } + public function getPosition(): int + { + return $this->position; + } + /** * Returns whether the token type is one of the given types. * - * @param int|int[] $types + * @param int|list $types */ public function isType($types): bool { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php index 9817f256..b73d14a4 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php @@ -14,8 +14,6 @@ namespace PhpCsFixer\Doctrine\Annotation; -use Doctrine\Common\Annotations\DocLexer; -use Doctrine\Common\Lexer\Token as LexerToken; use PhpCsFixer\Preg; use PhpCsFixer\Tokenizer\Token as PhpToken; @@ -29,7 +27,7 @@ final class Tokens extends \SplFixedArray { /** - * @param string[] $ignoredTags + * @param list $ignoredTags * * @throws \InvalidArgumentException */ @@ -60,27 +58,27 @@ public static function createFromDocComment(PhpToken $input, array $ignoredTags $nbScannedTokensToUse = 0; $nbScopes = 0; while (null !== $token = $lexer->peek()) { - if (0 === $index && !$token->isA(DocLexer::T_AT)) { + if (0 === $index && !$token->isType(DocLexer::T_AT)) { break; } if (1 === $index) { - if (!$token->isA(DocLexer::T_IDENTIFIER) || \in_array($token->value, $ignoredTags, true)) { + if (!$token->isType(DocLexer::T_IDENTIFIER) || \in_array($token->getContent(), $ignoredTags, true)) { break; } $nbScannedTokensToUse = 2; } - if ($index >= 2 && 0 === $nbScopes && !$token->isA(DocLexer::T_NONE, DocLexer::T_OPEN_PARENTHESIS)) { + if ($index >= 2 && 0 === $nbScopes && !$token->isType([DocLexer::T_NONE, DocLexer::T_OPEN_PARENTHESIS])) { break; } $scannedTokens[] = $token; - if ($token->isA(DocLexer::T_OPEN_PARENTHESIS)) { + if ($token->isType(DocLexer::T_OPEN_PARENTHESIS)) { ++$nbScopes; - } elseif ($token->isA(DocLexer::T_CLOSE_PARENTHESIS)) { + } elseif ($token->isType(DocLexer::T_CLOSE_PARENTHESIS)) { if (0 === --$nbScopes) { $nbScannedTokensToUse = \count($scannedTokens); @@ -102,16 +100,16 @@ public static function createFromDocComment(PhpToken $input, array $ignoredTags } $lastTokenEndIndex = 0; - foreach (\array_slice($scannedTokens, 0, $nbScannedTokensToUse) as $token) { - if ($token->isA(DocLexer::T_STRING)) { - $token = new LexerToken( - '"'.str_replace('"', '""', $token->value).'"', - $token->type, - $token->position - ); - } - - $missingTextLength = $token->position - $lastTokenEndIndex; + foreach (\array_slice($scannedTokens, 0, $nbScannedTokensToUse) as $scannedToken) { + $token = $scannedToken->isType(DocLexer::T_STRING) + ? new Token( + $scannedToken->getType(), + '"'.str_replace('"', '""', $scannedToken->getContent()).'"', + $scannedToken->getPosition() + ) + : $scannedToken; + + $missingTextLength = $token->getPosition() - $lastTokenEndIndex; if ($missingTextLength > 0) { $tokens[] = new Token(DocLexer::T_NONE, substr( $content, @@ -120,11 +118,11 @@ public static function createFromDocComment(PhpToken $input, array $ignoredTags )); } - $tokens[] = new Token($token->type, $token->value); - $lastTokenEndIndex = $token->position + \strlen($token->value); + $tokens[] = new Token($token->getType(), $token->getContent()); + $lastTokenEndIndex = $token->getPosition() + \strlen($token->getContent()); } - $currentPosition = $ignoredTextPosition = $nextAtPosition + $token->position + \strlen($token->value); + $currentPosition = $ignoredTextPosition = $nextAtPosition + $token->getPosition() + \strlen($token->getContent()); } else { $currentPosition = $nextAtPosition + 1; } @@ -140,8 +138,8 @@ public static function createFromDocComment(PhpToken $input, array $ignoredTags /** * Create token collection from array. * - * @param Token[] $array the array to import - * @param ?bool $saveIndices save the numeric indices used in the original array, default is yes + * @param array $array the array to import + * @param ?bool $saveIndices save the numeric indices used in the original array, default is yes */ public static function fromArray($array, $saveIndices = null): self { @@ -248,7 +246,7 @@ public function insertAt(int $index, Token $token): void public function offsetSet($index, $token): void { if (null === $token) { - throw new \InvalidArgumentException('Token must be an instance of PhpCsFixer\\Doctrine\\Annotation\\Token, "null" given.'); + throw new \InvalidArgumentException('Token must be an instance of PhpCsFixer\Doctrine\Annotation\Token, "null" given.'); } if (!$token instanceof Token) { @@ -258,21 +256,21 @@ public function offsetSet($index, $token): void $type = \get_class($token); } - throw new \InvalidArgumentException(sprintf('Token must be an instance of PhpCsFixer\\Doctrine\\Annotation\\Token, "%s" given.', $type)); + throw new \InvalidArgumentException(\sprintf('Token must be an instance of PhpCsFixer\Doctrine\Annotation\Token, "%s" given.', $type)); } parent::offsetSet($index, $token); } /** - * {@inheritdoc} + * @param mixed $index * * @throws \OutOfBoundsException */ public function offsetUnset($index): void { if (!isset($this[$index])) { - throw new \OutOfBoundsException(sprintf('Index "%s" is invalid or does not exist.', $index)); + throw new \OutOfBoundsException(\sprintf('Index "%s" is invalid or does not exist.', $index)); } $max = \count($this) - 1; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php index 73544963..5da0e31c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php @@ -19,6 +19,8 @@ use PhpCsFixer\Utils; /** + * @readonly + * * @internal */ final class DocumentationLocator @@ -43,10 +45,8 @@ public function getFixersDocumentationIndexFilePath(): string public function getFixerDocumentationFilePath(FixerInterface $fixer): string { return $this->getFixersDocumentationDirectoryPath().'/'.Preg::replaceCallback( - '/^.*\\\\(.+)\\\\(.+)Fixer$/', - static function (array $matches): string { - return Utils::camelCaseToUnderscore($matches[1]).'/'.Utils::camelCaseToUnderscore($matches[2]); - }, + '/^.*\\\(.+)\\\(.+)Fixer$/', + static fn (array $matches): string => Utils::camelCaseToUnderscore($matches[1]).'/'.Utils::camelCaseToUnderscore($matches[2]), \get_class($fixer) ).'.rst'; } @@ -75,8 +75,8 @@ public function getRuleSetsDocumentationFilePath(string $name): string return $this->getRuleSetsDocumentationDirectoryPath().'/'.str_replace(':risky', 'Risky', ucfirst(substr($name, 1))).'.rst'; } - public function getListingFilePath(): string + public function getUsageFilePath(): string { - return $this->path.'/list.rst'; + return $this->path.'/usage.rst'; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php index fcfd0fdc..34ae74a7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php @@ -18,6 +18,7 @@ use PhpCsFixer\Differ\FullDiffer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; use PhpCsFixer\Fixer\DeprecatedFixerInterface; +use PhpCsFixer\Fixer\ExperimentalFixerInterface; use PhpCsFixer\Fixer\FixerInterface; use PhpCsFixer\FixerConfiguration\AliasedFixerOption; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; @@ -33,6 +34,8 @@ use PhpCsFixer\Utils; /** + * @readonly + * * @internal */ final class FixerDocumentGenerator @@ -64,11 +67,11 @@ public function generateFixerDocumentation(FixerInterface $fixer): string $doc .= <<getSuccessorsNames(); if (0 !== \count($alternatives)) { - $deprecationDescription .= RstUtils::toRst(sprintf( + $deprecationDescription .= RstUtils::toRst(\sprintf( "\n\nYou should use %s instead.", Utils::naturalLanguageJoinWithBackticks($alternatives) ), 0); } } + $experimentalDescription = ''; + + if ($fixer instanceof ExperimentalFixerInterface) { + $experimentalDescriptionRaw = RstUtils::toRst('Rule is not covered with backward compatibility promise, use it at your own risk. Rule\'s behaviour may be changed at any point, including rule\'s name; its options\' names, availability and allowed values; its default configuration. Rule may be even removed without prior notice. Feel free to provide feedback and help with determining final state of the rule.', 0); + $experimentalDescription = <<getRiskyDescription(); @@ -96,36 +112,40 @@ public function generateFixerDocumentation(FixerInterface $fixer): string $riskyDescriptionRaw = RstUtils::toRst($riskyDescriptionRaw, 0); $riskyDescription = << '' !== $text + )); } if ($fixer instanceof ConfigurableFixerInterface) { $doc .= <<<'RST' -Configuration -------------- -RST; + Configuration + ------------- + RST; $configurationDefinition = $fixer->getConfigurationDefinition(); @@ -135,13 +155,13 @@ public function generateFixerDocumentation(FixerInterface $fixer): string if ($option instanceof DeprecatedFixerOptionInterface) { $deprecationMessage = RstUtils::toRst($option->getDeprecationMessage()); - $optionInfo .= "\n\n.. warning:: This option is deprecated and will be removed on next major version. {$deprecationMessage}"; + $optionInfo .= "\n\n.. warning:: This option is deprecated and will be removed in the next major version. {$deprecationMessage}"; } $optionInfo .= "\n\n".RstUtils::toRst($option->getDescription()); if ($option instanceof AliasedFixerOption) { - $optionInfo .= "\n\n.. note:: The previous name of this option was ``{$option->getAlias()}`` but it is now deprecated and will be removed on next major version."; + $optionInfo .= "\n\n.. note:: The previous name of this option was ``{$option->getAlias()}`` but it is now deprecated and will be removed in the next major version."; } $allowed = HelpCommand::getDisplayableAllowedValues($option); @@ -149,23 +169,21 @@ public function generateFixerDocumentation(FixerInterface $fixer): string if (null === $allowed) { $allowedKind = 'Allowed types'; $allowed = array_map( - static fn ($value): string => '``'.$value.'``', + static fn (string $value): string => '``'.Utils::convertArrayTypeToList($value).'``', $option->getAllowedTypes(), ); } else { $allowedKind = 'Allowed values'; - $allowed = array_map(static function ($value): string { - return $value instanceof AllowedValueSubset - ? 'a subset of ``'.HelpCommand::toString($value->getAllowedValues()).'``' - : '``'.HelpCommand::toString($value).'``'; - }, $allowed); + $allowed = array_map(static fn ($value): string => $value instanceof AllowedValueSubset + ? 'a subset of ``'.Utils::toString($value->getAllowedValues()).'``' + : '``'.Utils::toString($value).'``', $allowed); } - $allowed = implode(', ', $allowed); + $allowed = Utils::naturalLanguageJoin($allowed, ''); $optionInfo .= "\n\n{$allowedKind}: {$allowed}"; if ($option->hasDefault()) { - $default = HelpCommand::toString($option->getDefault()); + $default = Utils::toString($option->getDefault()); $optionInfo .= "\n\nDefault value: ``{$default}``"; } else { $optionInfo .= "\n\nThis option is required."; @@ -181,12 +199,12 @@ public function generateFixerDocumentation(FixerInterface $fixer): string $doc .= <<<'RST' -Examples --------- -RST; + Examples + -------- + RST; foreach ($samples as $index => $sample) { - $title = sprintf('Example #%d', $index + 1); + $title = \sprintf('Example #%d', $index + 1); $titleLine = str_repeat('~', \strlen($title)); $doc .= "\n\n{$title}\n{$titleLine}"; @@ -194,9 +212,9 @@ public function generateFixerDocumentation(FixerInterface $fixer): string if (null === $sample->getConfiguration()) { $doc .= "\n\n*Default* configuration."; } else { - $doc .= sprintf( + $doc .= \sprintf( "\n\nWith configuration: ``%s``.", - HelpCommand::toString($sample->getConfiguration()) + Utils::toString($sample->getConfiguration()) ); } } @@ -205,53 +223,82 @@ public function generateFixerDocumentation(FixerInterface $fixer): string } } - $ruleSetConfigs = []; - - foreach (RuleSets::getSetDefinitionNames() as $set) { - $ruleSet = new RuleSet([$set => true]); - - if ($ruleSet->hasRule($name)) { - $ruleSetConfigs[$set] = $ruleSet->getRuleConfiguration($name); - } - } + $ruleSetConfigs = self::getSetsOfRule($name); if ([] !== $ruleSetConfigs) { $plural = 1 !== \count($ruleSetConfigs) ? 's' : ''; $doc .= << $config) { $ruleSetPath = $this->locator->getRuleSetsDocumentationFilePath($set); $ruleSetPath = substr($ruleSetPath, strrpos($ruleSetPath, '/')); + $configInfo = (null !== $config) + ? " with config:\n\n ``".Utils::toString($config)."``\n" + : ''; + $doc .= <<`_{$configInfo}\n + RST; + } + } + $reflectionObject = new \ReflectionObject($fixer); + $className = str_replace('\\', '\\\\', $reflectionObject->getName()); + $fileName = $reflectionObject->getFileName(); + $fileName = str_replace('\\', '/', $fileName); + $fileName = substr($fileName, strrpos($fileName, '/src/Fixer/') + 1); + $fileName = "`{$className} <./../../../{$fileName}>`_"; -{$set} - Using the `{$set} <./../../ruleSets{$ruleSetPath}>`_ rule set will enable the ``{$name}`` rule -RST; + $testFileName = Preg::replace('~.*\K/src/(?=Fixer/)~', '/tests/', $fileName); + $testFileName = Preg::replace('~PhpCsFixer\\\\\\\\\K(?=Fixer\\\\\\\)~', 'Tests\\\\\\\\', $testFileName); + $testFileName = Preg::replace('~(?= <|\.php>)~', 'Test', $testFileName); - if (null !== $config) { - $doc .= " with the config below:\n\n ``".HelpCommand::toString($config).'``'; - } elseif ($fixer instanceof ConfigurableFixerInterface) { - $doc .= ' with the default config.'; - } else { - $doc .= '.'; - } + $doc .= <<', $doc); + + return "{$doc}\n"; + } + + /** + * @internal + * + * @return array> + */ + public static function getSetsOfRule(string $ruleName): array + { + $ruleSetConfigs = []; + + foreach (RuleSets::getSetDefinitionNames() as $set) { + $ruleSet = new RuleSet([$set => true]); + + if ($ruleSet->hasRule($ruleName)) { + $ruleSetConfigs[$set] = $ruleSet->getRuleConfiguration($ruleName); } } - return "{$doc}\n"; + return $ruleSetConfigs; } /** - * @param FixerInterface[] $fixers + * @param list $fixers */ public function generateFixersDocumentationIndex(array $fixers): string { @@ -261,20 +308,18 @@ public function generateFixersDocumentationIndex(array $fixers): string 'Phpdoc' => 'PHPDoc', ]; - usort($fixers, static function (FixerInterface $a, FixerInterface $b): int { - return strcmp(\get_class($a), \get_class($b)); - }); + usort($fixers, static fn (FixerInterface $a, FixerInterface $b): int => \get_class($a) <=> \get_class($b)); $documentation = <<<'RST' -======================= -List of Available Rules -======================= -RST; + ======================= + List of Available Rules + ======================= + RST; $currentGroup = null; foreach ($fixers as $fixer) { - $namespace = Preg::replace('/^.*\\\\(.+)\\\\.+Fixer$/', '$1', \get_class($fixer)); + $namespace = Preg::replace('/^.*\\\(.+)\\\.+Fixer$/', '$1', \get_class($fixer)); $group = $overrideGroups[$namespace] ?? Preg::replace('/(?<=[[:lower:]])(?=[[:upper:]])/', ' ', $namespace); if ($group !== $currentGroup) { @@ -292,6 +337,10 @@ public function generateFixersDocumentationIndex(array $fixers): string $attributes[] = 'deprecated'; } + if ($fixer instanceof ExperimentalFixerInterface) { + $attributes[] = 'experimental'; + } + if ($fixer->isRisky()) { $attributes[] = 'risky'; } @@ -304,10 +353,10 @@ public function generateFixersDocumentationIndex(array $fixers): string $documentation .= <<getName()} <{$path}>`_{$attributes} + - `{$fixer->getName()} <{$path}>`_{$attributes} - {$summary} -RST; + {$summary} + RST; } return "{$documentation}\n"; @@ -328,12 +377,12 @@ private function generateSampleDiff(FixerInterface $fixer, CodeSampleInterface $ $error = <<getCode(); @@ -358,9 +407,9 @@ private function generateSampleDiff(FixerInterface $fixer, CodeSampleInterface $ return << - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Documentation; - -use PhpCsFixer\Console\Command\HelpCommand; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\FixerConfiguration\AliasedFixerOption; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\DeprecatedFixerOptionInterface; -use PhpCsFixer\RuleSet\RuleSet; -use PhpCsFixer\RuleSet\RuleSets; -use PhpCsFixer\Utils; - -/** - * @internal - */ -final class ListDocumentGenerator -{ - private DocumentationLocator $locator; - - public function __construct(DocumentationLocator $locator) - { - $this->locator = $locator; - } - - /** - * @param FixerInterface[] $fixers - */ - public function generateListingDocumentation(array $fixers): string - { - usort( - $fixers, - static function (FixerInterface $fixer1, FixerInterface $fixer2): int { - return strnatcasecmp($fixer1->getName(), $fixer2->getName()); - } - ); - - $documentation = <<<'RST' -======================= -List of Available Rules -======================= - -RST; - foreach ($fixers as $fixer) { - $name = $fixer->getName(); - $definition = $fixer->getDefinition(); - $path = './rules/'.$this->locator->getFixerDocumentationFileRelativePath($fixer); - - $documentation .= "\n- `{$name} <{$path}>`_\n"; - $documentation .= "\n ".str_replace('`', '``', $definition->getSummary())."\n"; - - $description = $definition->getDescription(); - - if (null !== $description) { - $documentation .= "\n ".RstUtils::toRst($description, 3)."\n"; - } - - if ($fixer instanceof DeprecatedFixerInterface) { - $documentation .= "\n *warning deprecated*"; - $alternatives = $fixer->getSuccessorsNames(); - - if (0 !== \count($alternatives)) { - $documentation .= RstUtils::toRst(sprintf( - ' Use %s instead.', - Utils::naturalLanguageJoinWithBackticks($alternatives) - ), 3); - } - - $documentation .= "\n"; - } - - if ($fixer->isRisky()) { - $documentation .= "\n *warning risky* ".RstUtils::toRst($definition->getRiskyDescription(), 3)."\n"; - } - - if ($fixer instanceof ConfigurableFixerInterface) { - $documentation .= "\n Configuration options:\n"; - $configurationDefinition = $fixer->getConfigurationDefinition(); - - foreach ($configurationDefinition->getOptions() as $option) { - $documentation .= "\n - | ``{$option->getName()}``"; - $documentation .= "\n | {$option->getDescription()}"; - - if ($option instanceof DeprecatedFixerOptionInterface) { - $deprecationMessage = RstUtils::toRst($option->getDeprecationMessage(), 3); - $documentation .= "\n | warning:: This option is deprecated and will be removed on next major version. {$deprecationMessage}"; - } - - if ($option instanceof AliasedFixerOption) { - $documentation .= "\n | note:: The previous name of this option was ``{$option->getAlias()}`` but it is now deprecated and will be removed on next major version."; - } - - $allowed = HelpCommand::getDisplayableAllowedValues($option); - - if (null === $allowed) { - $allowedKind = 'Allowed types'; - $allowed = array_map( - static fn ($value): string => '``'.$value.'``', - $option->getAllowedTypes(), - ); - } else { - $allowedKind = 'Allowed values'; - $allowed = array_map(static function ($value): string { - return $value instanceof AllowedValueSubset - ? 'a subset of ``'.HelpCommand::toString($value->getAllowedValues()).'``' - : '``'.HelpCommand::toString($value).'``'; - }, $allowed); - } - - $allowed = implode(', ', $allowed); - $documentation .= "\n | {$allowedKind}: {$allowed}"; - - if ($option->hasDefault()) { - $default = HelpCommand::toString($option->getDefault()); - $documentation .= "\n | Default value: ``{$default}``"; - } else { - $documentation .= "\n | This option is required."; - } - } - - $documentation .= "\n\n"; - } - - $ruleSetConfigs = []; - - foreach (RuleSets::getSetDefinitionNames() as $set) { - $ruleSet = new RuleSet([$set => true]); - - if ($ruleSet->hasRule($name)) { - $ruleSetConfigs[$set] = $ruleSet->getRuleConfiguration($name); - } - } - - if ([] !== $ruleSetConfigs) { - $plural = 1 !== \count($ruleSetConfigs) ? 's' : ''; - - $documentation .= "\n Part of rule set{$plural} "; - - foreach ($ruleSetConfigs as $set => $config) { - $ruleSetPath = $this->locator->getRuleSetsDocumentationFilePath($set); - $ruleSetPath = substr($ruleSetPath, strrpos($ruleSetPath, '/')); - - $documentation .= "`{$set} <./ruleSets{$ruleSetPath}>`_ "; - } - - $documentation = rtrim($documentation)."\n"; - } - - $reflectionObject = new \ReflectionObject($fixer); - $className = str_replace('\\', '\\\\', $reflectionObject->getName()); - $fileName = $reflectionObject->getFileName(); - $fileName = str_replace('\\', '/', $fileName); - $fileName = substr($fileName, strrpos($fileName, '/src/Fixer/') + 1); - $fileName = "`Source {$className} <./../{$fileName}>`_"; - $documentation .= "\n ".$fileName; - } - - return $documentation."\n"; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/RstUtils.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/RstUtils.php index b7b5c51c..129bc5d0 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/RstUtils.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/RstUtils.php @@ -28,11 +28,16 @@ private function __construct() public static function toRst(string $string, int $indent = 0): string { - $string = wordwrap(Preg::replace('/(? $fixers */ public function generateRuleSetsDocumentation(RuleSetDescriptionInterface $definition, array $fixers): string { @@ -46,8 +49,52 @@ public function generateRuleSetsDocumentation(RuleSetDescriptionInterface $defin $titleLine = str_repeat('=', \strlen($title)); $doc = "{$titleLine}\n{$title}\n{$titleLine}\n\n".$definition->getDescription(); + $warnings = []; + if ($definition instanceof DeprecatedRuleSetDescriptionInterface) { + $deprecationDescription = <<<'RST' + + This rule set is deprecated and will be removed in the next major version + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RST; + $alternatives = $definition->getSuccessorsNames(); + + if (0 !== \count($alternatives)) { + $deprecationDescription .= RstUtils::toRst( + \sprintf( + "\n\nYou should use %s instead.", + Utils::naturalLanguageJoinWithBackticks($alternatives) + ), + 0 + ); + } else { + $deprecationDescription .= 'No replacement available.'; + } + + $warnings[] = $deprecationDescription; + } + if ($definition->isRisky()) { - $doc .= ' This set contains rules that are risky.'; + $warnings[] = <<<'RST' + + This set contains rules that are risky + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Using this rule set may lead to changes in your code's logic and behaviour. Use it with caution and review changes before incorporating them into your code base. + RST; + } + + if ([] !== $warnings) { + $warningsHeader = 1 === \count($warnings) ? 'Warning' : 'Warnings'; + + $warningsHeaderLine = str_repeat('-', \strlen($warningsHeader)); + $doc .= "\n\n".implode( + "\n", + [ + $warningsHeader, + $warningsHeaderLine, + ...$warnings, + ] + ); } $rules = $definition->getRules(); @@ -76,7 +123,7 @@ public function generateRuleSetsDocumentation(RuleSetDescriptionInterface $defin } if (!\is_bool($config)) { - $doc .= "\n config:\n ``".HelpCommand::toString($config).'``'; + $doc .= " with config:\n\n ``".Utils::toString($config)."``\n"; } } }; @@ -96,18 +143,30 @@ public function generateRuleSetsDocumentation(RuleSetDescriptionInterface $defin } /** - * @param array $setDefinitions + * @param array $setDefinitions */ public function generateRuleSetsDocumentationIndex(array $setDefinitions): string { $documentation = <<<'RST' -=========================== -List of Available Rule sets -=========================== -RST; - foreach ($setDefinitions as $name => $path) { + =========================== + List of Available Rule sets + =========================== + RST; + + foreach ($setDefinitions as $path => $definition) { $path = substr($path, strrpos($path, '/')); - $documentation .= "\n- `{$name} <.{$path}>`_"; + + $attributes = []; + + if ($definition instanceof DeprecatedRuleSetDescriptionInterface) { + $attributes[] = 'deprecated'; + } + + $attributes = 0 === \count($attributes) + ? '' + : ' *('.implode(', ', $attributes).')*'; + + $documentation .= "\n- `{$definition->getName()} <.{$path}>`_{$attributes}"; } return $documentation."\n"; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php index 1f14ed9f..e20ff2f7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php @@ -19,9 +19,11 @@ * * @author Andreas Möller * + * @readonly + * * @internal */ -final class Error +final class Error implements \JsonSerializable { /** * Error which has occurred in linting phase, before applying any fixers. @@ -38,6 +40,7 @@ final class Error */ public const TYPE_LINT = 3; + /** @var self::TYPE_* */ private int $type; private string $filePath; @@ -52,6 +55,7 @@ final class Error private ?string $diff; /** + * @param self::TYPE_* $type * @param list $appliedFixers */ public function __construct(int $type, string $filePath, ?\Throwable $source = null, array $appliedFixers = [], ?string $diff = null) @@ -90,4 +94,32 @@ public function getDiff(): ?string { return $this->diff; } + + /** + * @return array{ + * type: self::TYPE_*, + * filePath: string, + * source: null|array{class: class-string, message: string, code: int, file: string, line: int}, + * appliedFixers: list, + * diff: null|string + * } + */ + public function jsonSerialize(): array + { + return [ + 'type' => $this->type, + 'filePath' => $this->filePath, + 'source' => null !== $this->source + ? [ + 'class' => \get_class($this->source), + 'message' => $this->source->getMessage(), + 'code' => $this->source->getCode(), + 'file' => $this->source->getFile(), + 'line' => $this->source->getLine(), + ] + : null, + 'appliedFixers' => $this->appliedFixers, + 'diff' => $this->diff, + ]; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php index 01006673..e6333db8 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php @@ -24,44 +24,48 @@ final class ErrorsManager { /** - * @var Error[] + * @var list */ private array $errors = []; /** * Returns errors reported during linting before fixing. * - * @return Error[] + * @return list */ public function getInvalidErrors(): array { - return array_filter($this->errors, static function (Error $error): bool { - return Error::TYPE_INVALID === $error->getType(); - }); + return array_filter($this->errors, static fn (Error $error): bool => Error::TYPE_INVALID === $error->getType()); } /** * Returns errors reported during fixing. * - * @return Error[] + * @return list */ public function getExceptionErrors(): array { - return array_filter($this->errors, static function (Error $error): bool { - return Error::TYPE_EXCEPTION === $error->getType(); - }); + return array_filter($this->errors, static fn (Error $error): bool => Error::TYPE_EXCEPTION === $error->getType()); } /** * Returns errors reported during linting after fixing. * - * @return Error[] + * @return list */ public function getLintErrors(): array { - return array_filter($this->errors, static function (Error $error): bool { - return Error::TYPE_LINT === $error->getType(); - }); + return array_filter($this->errors, static fn (Error $error): bool => Error::TYPE_LINT === $error->getType()); + } + + /** + * Returns errors reported for specified path. + * + * @return list + */ + public function forPath(string $path): array + { + return array_values(array_filter($this->errors, static fn (Error $error): bool => $path === $error->getFilePath())); } /** @@ -69,7 +73,7 @@ public function getLintErrors(): array */ public function isEmpty(): bool { - return empty($this->errors); + return [] === $this->errors; } public function report(Error $error): void diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/SourceExceptionFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/SourceExceptionFactory.php new file mode 100644 index 00000000..03773861 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/SourceExceptionFactory.php @@ -0,0 +1,62 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Error; + +/** + * @readonly + * + * @internal + */ +final class SourceExceptionFactory +{ + /** + * @param array{class: class-string<\Throwable>, message: string, code: int, file: string, line: int} $error + */ + public static function fromArray(array $error): \Throwable + { + $exceptionClass = $error['class']; + + try { + $exception = new $exceptionClass($error['message'], $error['code']); + + if ( + $exception->getMessage() !== $error['message'] + || $exception->getCode() !== $error['code'] + ) { + throw new \RuntimeException('Failed to create exception from array. Message and code are not the same.'); + } + } catch (\Throwable $e) { + $exception = new \RuntimeException( + \sprintf('[%s] %s', $exceptionClass, $error['message']), + $error['code'] + ); + } + + try { + $exceptionReflection = new \ReflectionClass($exception); + foreach (['file', 'line'] as $property) { + $propertyReflection = $exceptionReflection->getProperty($property); + $propertyReflection->setAccessible(true); + $propertyReflection->setValue($exception, $error[$property]); + $propertyReflection->setAccessible(false); + } + } catch (\Throwable $reflectionException) { + // Ignore if we were not able to set file/line properties. In most cases it should be fine, + // we just need to make sure nothing is broken when we recreate errors from raw data passed from worker. + } + + return $exception; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php new file mode 100644 index 00000000..003398e4 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php @@ -0,0 +1,58 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer; + +/** + * @author Dariusz Rumiński + * + * @internal + */ +final class ExecutorWithoutErrorHandler +{ + private function __construct() {} + + /** + * @template T + * + * @param callable(): T $callback + * + * @return T + * + * @throws ExecutorWithoutErrorHandlerException + */ + public static function execute(callable $callback) + { + /** @var ?string */ + $error = null; + + set_error_handler(static function (int $errorNumber, string $errorString, string $errorFile, int $errorLine) use (&$error): bool { + $error = $errorString; + + return true; + }); + + try { + $result = $callback(); + } finally { + restore_error_handler(); + } + + if (null !== $error) { + throw new ExecutorWithoutErrorHandlerException($error); + } + + return $result; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php new file mode 100644 index 00000000..750352a2 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php @@ -0,0 +1,22 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer; + +/** + * @author Dariusz Rumiński + * + * @internal + */ +final class ExecutorWithoutErrorHandlerException extends \RuntimeException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileReader.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileReader.php index d71f5f76..30eeabef 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileReader.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileReader.php @@ -25,10 +25,7 @@ */ final class FileReader { - /** - * @var null|string - */ - private $stdinContent; + private ?string $stdinContent = null; public static function createSingleton(): self { @@ -61,10 +58,10 @@ private function readRaw(string $realPath): string if (false === $content) { $error = error_get_last(); - throw new \RuntimeException(sprintf( + throw new \RuntimeException(\sprintf( 'Failed to read content from "%s".%s', $realPath, - $error ? ' '.$error['message'] : '' + null !== $error ? ' '.$error['message'] : '' )); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php index dce4d924..148a4c5e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php @@ -47,7 +47,7 @@ public function __destruct() */ public function __sleep(): array { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); + throw new \BadMethodCallException('Cannot serialize '.self::class); } /** @@ -58,7 +58,7 @@ public function __sleep(): array */ public function __wakeup(): void { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); + throw new \BadMethodCallException('Cannot unserialize '.self::class); } /** diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php index a9517f30..b6a8660c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php @@ -18,6 +18,9 @@ use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\DocBlock\Line; use PhpCsFixer\Indicator\PhpUnitTestCaseIndicator; +use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; +use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; +use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; @@ -28,10 +31,7 @@ */ abstract class AbstractPhpUnitFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ - final public function isCandidate(Tokens $tokens): bool + public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_CLASS, T_STRING]); } @@ -71,22 +71,26 @@ final protected function getDocBlockIndex(Tokens $tokens, int $index): int } /** - * @param array $preventingAnnotations + * @param list $preventingAnnotations + * @param list $preventingAttributes */ - final protected function ensureIsDockBlockWithAnnotation( + final protected function ensureIsDocBlockWithAnnotation( Tokens $tokens, int $index, string $annotation, - bool $addWithEmptyLineBeforePhpdoc, - bool $addWithEmptyLineBeforeAnnotation, - array $preventingAnnotations + array $preventingAnnotations, + array $preventingAttributes ): void { $docBlockIndex = $this->getDocBlockIndex($tokens, $index); + if (self::isPreventedByAttribute($tokens, $index, $preventingAttributes)) { + return; + } + if ($this->isPHPDoc($tokens, $docBlockIndex)) { - $this->updateDocBlockIfNeeded($tokens, $docBlockIndex, $annotation, $addWithEmptyLineBeforeAnnotation, $preventingAnnotations); + $this->updateDocBlockIfNeeded($tokens, $docBlockIndex, $annotation, $preventingAnnotations); } else { - $this->createDocBlock($tokens, $docBlockIndex, $annotation, $addWithEmptyLineBeforePhpdoc); + $this->createDocBlock($tokens, $docBlockIndex, $annotation); } } @@ -95,7 +99,53 @@ final protected function isPHPDoc(Tokens $tokens, int $index): bool return $tokens[$index]->isGivenKind(T_DOC_COMMENT); } - private function createDocBlock(Tokens $tokens, int $docBlockIndex, string $annotation, bool $addWithEmptyLineBeforePhpdoc): void + /** + * @return iterable + */ + protected function getPreviousAssertCall(Tokens $tokens, int $startIndex, int $endIndex): iterable + { + $functionsAnalyzer = new FunctionsAnalyzer(); + + for ($index = $endIndex; $index > $startIndex; --$index) { + $index = $tokens->getPrevTokenOfKind($index, [[T_STRING]]); + + if (null === $index) { + return; + } + + // test if "assert" something call + $loweredContent = strtolower($tokens[$index]->getContent()); + + if (!str_starts_with($loweredContent, 'assert')) { + continue; + } + + // test candidate for simple calls like: ([\]+'some fixable call'(...)) + $openBraceIndex = $tokens->getNextMeaningfulToken($index); + + if (!$tokens[$openBraceIndex]->equals('(')) { + continue; + } + + if (!$functionsAnalyzer->isTheSameClassCall($tokens, $index)) { + continue; + } + + yield [ + 'index' => $index, + 'loweredName' => $loweredContent, + 'openBraceIndex' => $openBraceIndex, + 'closeBraceIndex' => $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openBraceIndex), + ]; + } + } + + private function createDocBlock(Tokens $tokens, int $docBlockIndex, string $annotation): void { $lineEnd = $this->whitespacesConfig->getLineEnding(); $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex)); @@ -106,7 +156,7 @@ private function createDocBlock(Tokens $tokens, int $docBlockIndex, string $anno $index = $tokens->getNextMeaningfulToken($docBlockIndex); $tokens->insertAt($index, $toInsert); - if ($addWithEmptyLineBeforePhpdoc && !$tokens[$index - 1]->isGivenKind(T_WHITESPACE)) { + if (!$tokens[$index - 1]->isGivenKind(T_WHITESPACE)) { $extraNewLines = $this->whitespacesConfig->getLineEnding(); if (!$tokens[$index - 1]->isGivenKind(T_OPEN_TAG)) { @@ -120,13 +170,12 @@ private function createDocBlock(Tokens $tokens, int $docBlockIndex, string $anno } /** - * @param array $preventingAnnotations + * @param list $preventingAnnotations */ private function updateDocBlockIfNeeded( Tokens $tokens, int $docBlockIndex, string $annotation, - bool $addWithEmptyLineBeforeAnnotation, array $preventingAnnotations ): void { $doc = new DocBlock($tokens[$docBlockIndex]->getContent()); @@ -136,22 +185,79 @@ private function updateDocBlockIfNeeded( } } $doc = $this->makeDocBlockMultiLineIfNeeded($doc, $tokens, $docBlockIndex, $annotation); - $lines = $this->addInternalAnnotation($doc, $tokens, $docBlockIndex, $annotation, $addWithEmptyLineBeforeAnnotation); + + $lines = $this->addInternalAnnotation($doc, $tokens, $docBlockIndex, $annotation); $lines = implode('', $lines); $tokens[$docBlockIndex] = new Token([T_DOC_COMMENT, $lines]); } /** - * @return array + * @param list $preventingAttributes + */ + private static function isPreventedByAttribute(Tokens $tokens, int $index, array $preventingAttributes): bool + { + if ([] === $preventingAttributes) { + return false; + } + + $modifiers = [T_FINAL]; + if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.2+ is required + $modifiers[] = T_READONLY; + } + + do { + $index = $tokens->getPrevMeaningfulToken($index); + } while ($tokens[$index]->isGivenKind($modifiers)); + if (!$tokens[$index]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { + return false; + } + $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); + + foreach (AttributeAnalyzer::collect($tokens, $index) as $attributeAnalysis) { + foreach ($attributeAnalysis->getAttributes() as $attribute) { + if (\in_array(ltrim(self::getFullyQualifiedName($tokens, $attribute['name']), '\\'), $preventingAttributes, true)) { + return true; + } + } + } + + return false; + } + + private static function getFullyQualifiedName(Tokens $tokens, string $name): string + { + $name = strtolower($name); + + $names = []; + foreach ((new NamespaceUsesAnalyzer())->getDeclarationsFromTokens($tokens) as $namespaceUseAnalysis) { + $names[strtolower($namespaceUseAnalysis->getShortName())] = strtolower($namespaceUseAnalysis->getFullName()); + } + + foreach ($names as $shortName => $fullName) { + if ($name === $shortName) { + return $fullName; + } + + if (!str_starts_with($name, $shortName.'\\')) { + continue; + } + + return $fullName.substr($name, \strlen($shortName)); + } + + return $name; + } + + /** + * @return list */ - private function addInternalAnnotation(DocBlock $docBlock, Tokens $tokens, int $docBlockIndex, string $annotation, bool $addWithEmptyLineBeforeAnnotation): array + private function addInternalAnnotation(DocBlock $docBlock, Tokens $tokens, int $docBlockIndex, string $annotation): array { $lines = $docBlock->getLines(); $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $docBlockIndex); $lineEnd = $this->whitespacesConfig->getLineEnding(); - $extraLine = $addWithEmptyLineBeforeAnnotation ? $lineEnd.$originalIndent.' *' : ''; - array_splice($lines, -1, 0, $originalIndent.' *'.$extraLine.' @'.$annotation.$lineEnd); + array_splice($lines, -1, 0, $originalIndent.' * @'.$annotation.$lineEnd); return $lines; } @@ -159,7 +265,7 @@ private function addInternalAnnotation(DocBlock $docBlock, Tokens $tokens, int $ private function makeDocBlockMultiLineIfNeeded(DocBlock $doc, Tokens $tokens, int $docBlockIndex, string $annotation): DocBlock { $lines = $doc->getLines(); - if (1 === \count($lines) && empty($doc->getAnnotationsOfType($annotation))) { + if (1 === \count($lines) && [] === $doc->getAnnotationsOfType($annotation)) { $indent = WhitespacesAnalyzer::detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex)); $doc->makeMultiLine($indent, $this->whitespacesConfig->getLineEnding()); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractShortOperatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractShortOperatorFixer.php new file mode 100644 index 00000000..1897e042 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractShortOperatorFixer.php @@ -0,0 +1,264 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Tokenizer\Analyzer\AlternativeSyntaxAnalyzer; +use PhpCsFixer\Tokenizer\Analyzer\RangeAnalyzer; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @internal + */ +abstract class AbstractShortOperatorFixer extends AbstractFixer +{ + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $alternativeSyntaxAnalyzer = new AlternativeSyntaxAnalyzer(); + + for ($index = \count($tokens) - 1; $index > 3; --$index) { + if (!$this->isOperatorTokenCandidate($tokens, $index)) { + continue; + } + + // get what is before the operator + + $beforeRange = $this->getBeforeOperatorRange($tokens, $index); + $equalsIndex = $tokens->getPrevMeaningfulToken($beforeRange['start']); + + // make sure that before that is '=' + + if (!$tokens[$equalsIndex]->equals('=')) { + continue; + } + + // get and check what is before '=' + + $assignRange = $this->getBeforeOperatorRange($tokens, $equalsIndex); + $beforeAssignmentIndex = $tokens->getPrevMeaningfulToken($assignRange['start']); + + if ($tokens[$beforeAssignmentIndex]->equals(':')) { + if (!$this->belongsToSwitchOrAlternativeSyntax($alternativeSyntaxAnalyzer, $tokens, $beforeAssignmentIndex)) { + continue; + } + } elseif (!$tokens[$beforeAssignmentIndex]->equalsAny([';', '{', '}', '(', ')', ',', [T_OPEN_TAG], [T_RETURN]])) { + continue; + } + + // check if "assign" and "before" the operator are (functionally) the same + + if (RangeAnalyzer::rangeEqualsRange($tokens, $assignRange, $beforeRange)) { + $this->shortenOperation($tokens, $equalsIndex, $index, $assignRange, $beforeRange); + + continue; + } + + if (!$this->isOperatorCommutative($tokens[$index])) { + continue; + } + + $afterRange = $this->getAfterOperatorRange($tokens, $index); + + // check if "assign" and "after" the operator are (functionally) the same + if (!RangeAnalyzer::rangeEqualsRange($tokens, $assignRange, $afterRange)) { + continue; + } + + $this->shortenOperation($tokens, $equalsIndex, $index, $assignRange, $afterRange); + } + } + + abstract protected function getReplacementToken(Token $token): Token; + + abstract protected function isOperatorTokenCandidate(Tokens $tokens, int $index): bool; + + /** + * @param array{start: int, end: int} $assignRange + * @param array{start: int, end: int} $operatorRange + */ + private function shortenOperation( + Tokens $tokens, + int $equalsIndex, + int $operatorIndex, + array $assignRange, + array $operatorRange + ): void { + $tokens[$equalsIndex] = $this->getReplacementToken($tokens[$operatorIndex]); + $tokens->clearTokenAndMergeSurroundingWhitespace($operatorIndex); + $this->clearMeaningfulFromRange($tokens, $operatorRange); + + foreach ([$equalsIndex, $assignRange['end']] as $i) { + $i = $tokens->getNonEmptySibling($i, 1); + + if ($tokens[$i]->isWhitespace(" \t")) { + $tokens[$i] = new Token([T_WHITESPACE, ' ']); + } elseif (!$tokens[$i]->isWhitespace()) { + $tokens->insertAt($i, new Token([T_WHITESPACE, ' '])); + } + } + } + + /** + * @return array{start: int, end: int} + */ + private function getAfterOperatorRange(Tokens $tokens, int $index): array + { + $index = $tokens->getNextMeaningfulToken($index); + $range = ['start' => $index]; + + while (true) { + $nextIndex = $tokens->getNextMeaningfulToken($index); + + if (null === $nextIndex || $tokens[$nextIndex]->equalsAny([';', ',', [T_CLOSE_TAG]])) { + break; + } + + $blockType = Tokens::detectBlockType($tokens[$nextIndex]); + + if (null === $blockType) { + $index = $nextIndex; + + continue; + } + + if (false === $blockType['isStart']) { + break; + } + + $index = $tokens->findBlockEnd($blockType['type'], $nextIndex); + } + + $range['end'] = $index; + + return $range; + } + + /** + * @return array{start: int, end: int} + */ + private function getBeforeOperatorRange(Tokens $tokens, int $index): array + { + static $blockOpenTypes; + + if (null === $blockOpenTypes) { + $blockOpenTypes = [',']; // not a true "block type", but speeds up things + + foreach (Tokens::getBlockEdgeDefinitions() as $definition) { + $blockOpenTypes[] = $definition['start']; + } + } + + $controlStructureWithoutBracesTypes = [T_IF, T_ELSE, T_ELSEIF, T_FOR, T_FOREACH, T_WHILE]; + + $previousIndex = $tokens->getPrevMeaningfulToken($index); + $previousToken = $tokens[$previousIndex]; + + if ($tokens[$previousIndex]->equalsAny($blockOpenTypes)) { + return ['start' => $index, 'end' => $index]; + } + + $range = ['end' => $previousIndex]; + $index = $previousIndex; + + while ($previousToken->equalsAny([ + '$', + ']', + ')', + [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], + [CT::T_DYNAMIC_PROP_BRACE_CLOSE], + [CT::T_DYNAMIC_VAR_BRACE_CLOSE], + [T_NS_SEPARATOR], + [T_STRING], + [T_VARIABLE], + ])) { + $blockType = Tokens::detectBlockType($previousToken); + + if (null !== $blockType) { + $blockStart = $tokens->findBlockStart($blockType['type'], $previousIndex); + + if ($tokens[$previousIndex]->equals(')') && $tokens[$tokens->getPrevMeaningfulToken($blockStart)]->isGivenKind($controlStructureWithoutBracesTypes)) { + break; // we went too far back + } + + $previousIndex = $blockStart; + } + + $index = $previousIndex; + $previousIndex = $tokens->getPrevMeaningfulToken($previousIndex); + $previousToken = $tokens[$previousIndex]; + } + + if ($previousToken->isGivenKind(T_OBJECT_OPERATOR)) { + $index = $this->getBeforeOperatorRange($tokens, $previousIndex)['start']; + } elseif ($previousToken->isGivenKind(T_PAAMAYIM_NEKUDOTAYIM)) { + $index = $this->getBeforeOperatorRange($tokens, $tokens->getPrevMeaningfulToken($previousIndex))['start']; + } + + $range['start'] = $index; + + return $range; + } + + /** + * @param array{start: int, end: int} $range + */ + private function clearMeaningfulFromRange(Tokens $tokens, array $range): void + { + // $range['end'] must be meaningful! + for ($i = $range['end']; $i >= $range['start']; $i = $tokens->getPrevMeaningfulToken($i)) { + $tokens->clearTokenAndMergeSurroundingWhitespace($i); + } + } + + private function isOperatorCommutative(Token $operatorToken): bool + { + static $commutativeKinds = ['*', '|', '&', '^']; // note that for arrays in PHP `+` is not commutative + static $nonCommutativeKinds = ['-', '/', '.', '%', '+']; + + if ($operatorToken->isGivenKind(T_COALESCE)) { + return false; + } + + if ($operatorToken->equalsAny($commutativeKinds)) { + return true; + } + + if ($operatorToken->equalsAny($nonCommutativeKinds)) { + return false; + } + + throw new \InvalidArgumentException(\sprintf('Not supported operator "%s".', $operatorToken->toJson())); + } + + private function belongsToSwitchOrAlternativeSyntax(AlternativeSyntaxAnalyzer $alternativeSyntaxAnalyzer, Tokens $tokens, int $index): bool + { + $candidate = $index; + $index = $tokens->getPrevMeaningfulToken($candidate); + + if ($tokens[$index]->isGivenKind(T_DEFAULT)) { + return true; + } + + $index = $tokens->getPrevMeaningfulToken($index); + + if ($tokens[$index]->isGivenKind(T_CASE)) { + return true; + } + + return $alternativeSyntaxAnalyzer->belongsToAlternativeSyntax($tokens, $candidate); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ArrayPushFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ArrayPushFixer.php index 9f4c05d4..9023bbd3 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ArrayPushFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ArrayPushFixer.php @@ -25,9 +25,6 @@ final class ArrayPushFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -38,17 +35,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING) && $tokens->count() > 7; } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php index eca32ba6..70865e6c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php @@ -27,17 +27,11 @@ */ final class BacktickToShellExecFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound('`'); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -45,11 +39,11 @@ public function getDefinition(): FixerDefinitionInterface [ new CodeSample( <<<'EOT' -call()}`; + call()}`; -EOT + EOT ), ], 'Conversion is done only when it is non risky, so when special chars like single-quotes, double-quotes and backticks are not used inside the command.' @@ -59,16 +53,13 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before EscapeImplicitBackslashesFixer, ExplicitStringVariableFixer, NativeFunctionInvocationFixer, SingleQuoteFixer. + * Must run before ExplicitStringVariableFixer, NativeFunctionInvocationFixer, SingleQuoteFixer. */ public function getPriority(): int { return 17; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $backtickStarted = false; @@ -104,9 +95,8 @@ private function fixBackticks(Tokens $tokens, array $backtickTokens): void { // Track indices for final override ksort($backtickTokens); - $openingBacktickIndex = key($backtickTokens); - end($backtickTokens); - $closingBacktickIndex = key($backtickTokens); + $openingBacktickIndex = array_key_first($backtickTokens); + $closingBacktickIndex = array_key_last($backtickTokens); // Strip enclosing backticks array_shift($backtickTokens); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php index 7058032b..f7579861 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php @@ -33,7 +33,7 @@ final class EregToPregFixer extends AbstractFixer * @var list> the list of the ext/ereg function names, their preg equivalent and the preg modifier(s), if any * all condensed in an array of arrays */ - private static array $functions = [ + private const FUNCTIONS = [ ['ereg', 'preg_match', ''], ['eregi', 'preg_match', 'i'], ['ereg_replace', 'preg_replace', ''], @@ -47,9 +47,6 @@ final class EregToPregFixer extends AbstractFixer */ private static array $delimiters = ['/', '#', '!']; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -70,31 +67,22 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $end = $tokens->count() - 1; $functionsAnalyzer = new FunctionsAnalyzer(); - foreach (self::$functions as $map) { + foreach (self::FUNCTIONS as $map) { // the sequence is the function name, followed by "(" and a quoted string $seq = [[T_STRING, $map[0]], '(', [T_CONSTANT_ENCAPSED_STRING]]; $currIndex = 0; @@ -109,7 +97,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void // findSequence also returns the tokens, but we're only interested in the indices, i.e.: // 0 => function name, - // 1 => bracket "(" + // 1 => parenthesis "(" // 2 => quoted string passed as 1st parameter $match = array_keys($match); @@ -200,6 +188,6 @@ private function getBestDelimiter(string $pattern): string return $a[0] <=> $b[0]; }); - return key($delimiters); + return array_key_first($delimiters); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php index 514352aa..1cbbd874 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php @@ -69,17 +69,22 @@ public function __construct() { parent::__construct(); + if (\PHP_VERSION_ID >= 8_03_00) { + self::$functionsMap['str_pad'] = ['alternativeName' => 'mb_str_pad', 'argumentCount' => [1, 2, 3, 4]]; + } + + if (\PHP_VERSION_ID >= 8_04_00) { + self::$functionsMap['trim'] = ['alternativeName' => 'mb_trim', 'argumentCount' => [1, 2]]; + self::$functionsMap['ltrim'] = ['alternativeName' => 'mb_ltrim', 'argumentCount' => [1, 2]]; + self::$functionsMap['rtrim'] = ['alternativeName' => 'mb_rtrim', 'argumentCount' => [1, 2]]; + } + $this->functions = array_filter( self::$functionsMap, - static function (array $mapping): bool { - return (new \ReflectionFunction($mapping['alternativeName']))->isInternal(); - } + static fn (array $mapping): bool => (new \ReflectionFunction($mapping['alternativeName']))->isInternal() ); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -107,9 +112,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $argumentsAnalyzer = new ArgumentsAnalyzer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ModernizeStrposFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ModernizeStrposFixer.php index 3ec0ec64..7842f541 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ModernizeStrposFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ModernizeStrposFixer.php @@ -15,6 +15,11 @@ namespace PhpCsFixer\Fixer\Alias; use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; @@ -25,9 +30,21 @@ /** * @author Alexander M. Turek + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * modernize_stripos?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * modernize_stripos: bool + * } */ -final class ModernizeStrposFixer extends AbstractFixer +final class ModernizeStrposFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + private const REPLACEMENTS = [ [ 'operator' => [T_IS_IDENTICAL, '==='], @@ -55,10 +72,12 @@ final class ModernizeStrposFixer extends AbstractFixer ], ]; + private bool $modernizeStripos = false; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Replace `strpos()` calls with `str_starts_with()` or `str_contains()` if possible.', + 'Replace `strpos()` and `stripos()` calls with `str_starts_with()` or `str_contains()` if possible.', [ new CodeSample( ' true] ), ], null, - 'Risky if `strpos`, `str_starts_with` or `str_contains` functions are overridden.' + 'Risky if `strpos`, `stripos`, `str_starts_with`, `str_contains` or `strtolower` functions are overridden.' ); } /** * {@inheritdoc} * - * Must run before BinaryOperatorSpacesFixer, NoExtraBlankLinesFixer, NoSpacesInsideParenthesisFixer, NoTrailingWhitespaceFixer, NotOperatorWithSpaceFixer, NotOperatorWithSuccessorSpaceFixer, PhpUnitDedicateAssertFixer, SingleSpaceAfterConstructFixer, SingleSpaceAroundConstructFixer. + * Must run before BinaryOperatorSpacesFixer, NoExtraBlankLinesFixer, NoSpacesInsideParenthesisFixer, NoTrailingWhitespaceFixer, NotOperatorWithSpaceFixer, NotOperatorWithSuccessorSpaceFixer, PhpUnitDedicateAssertFixer, SingleSpaceAfterConstructFixer, SingleSpaceAroundConstructFixer, SpacesInsideParenthesesFixer. * Must run after StrictComparisonFixer. */ public function getPriority(): int @@ -95,14 +127,36 @@ public function isRisky(): bool return true; } + protected function configurePostNormalisation(): void + { + if (isset($this->configuration['modernize_stripos']) && true === $this->configuration['modernize_stripos']) { + $this->modernizeStripos = true; + } + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('modernize_stripos', 'Whether to modernize `stripos` calls as well.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) // @TODO change to "true" on next major 4.0 + ->getOption(), + ]); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionsAnalyzer = new FunctionsAnalyzer(); $argumentsAnalyzer = new ArgumentsAnalyzer(); + $modernizeCandidates = [[T_STRING, 'strpos']]; + if ($this->modernizeStripos) { + $modernizeCandidates[] = [T_STRING, 'stripos']; + } + for ($index = \count($tokens) - 1; $index > 0; --$index) { // find candidate function call - if (!$tokens[$index]->equals([T_STRING, 'strpos'], false) || !$functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { + if (!$tokens[$index]->equalsAny($modernizeCandidates, false) || !$functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { continue; } @@ -123,7 +177,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } if (null !== $compareTokens) { - $this->fixCall($tokens, $index, $compareTokens); + $isCaseInsensitive = $tokens[$index]->equals([T_STRING, 'stripos'], false); + $this->fixCall($tokens, $index, $compareTokens, $isCaseInsensitive); } } } @@ -131,7 +186,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void /** * @param array{operator_index: int, operand_index: int} $operatorIndices */ - private function fixCall(Tokens $tokens, int $functionIndex, array $operatorIndices): void + private function fixCall(Tokens $tokens, int $functionIndex, array $operatorIndices, bool $isCaseInsensitive): void { foreach (self::REPLACEMENTS as $replacement) { if (!$tokens[$operatorIndices['operator_index']]->equals($replacement['operator'])) { @@ -160,10 +215,60 @@ private function fixCall(Tokens $tokens, int $functionIndex, array $operatorIndi $tokens->insertAt($functionIndex, new Token($replacement['replacement'])); + if ($isCaseInsensitive) { + $this->wrapArgumentsWithStrToLower($tokens, $functionIndex); + } + break; } } + private function wrapArgumentsWithStrToLower(Tokens $tokens, int $functionIndex): void + { + $argumentsAnalyzer = new ArgumentsAnalyzer(); + $shouldAddNamespace = $tokens[$functionIndex - 1]->isGivenKind(T_NS_SEPARATOR); + + $openIndex = $tokens->getNextMeaningfulToken($functionIndex); + $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); + $arguments = $argumentsAnalyzer->getArguments($tokens, $openIndex, $closeIndex); + + $firstArgumentIndexStart = array_key_first($arguments); + if (!isset($arguments[$firstArgumentIndexStart])) { + return; + } + $firstArgumentIndexEnd = $arguments[$firstArgumentIndexStart] + 3 + ($shouldAddNamespace ? 1 : 0); + + $isSecondArgumentTokenWhiteSpace = $tokens[array_key_last($arguments)]->isGivenKind(T_WHITESPACE); + + if ($isSecondArgumentTokenWhiteSpace) { + $secondArgumentIndexStart = $tokens->getNextMeaningfulToken(array_key_last($arguments)); + } else { + $secondArgumentIndexStart = array_key_last($arguments); + } + + $secondArgumentIndexStart += 3 + ($shouldAddNamespace ? 1 : 0); + if (!isset($arguments[array_key_last($arguments)])) { + return; + } + $secondArgumentIndexEnd = $arguments[array_key_last($arguments)] + 6 + ($shouldAddNamespace ? 1 : 0) + ($isSecondArgumentTokenWhiteSpace ? 1 : 0); + + if ($shouldAddNamespace) { + $tokens->insertAt($firstArgumentIndexStart, new Token([T_NS_SEPARATOR, '\\'])); + ++$firstArgumentIndexStart; + } + + $tokens->insertAt($firstArgumentIndexStart, [new Token([T_STRING, 'strtolower']), new Token('(')]); + $tokens->insertAt($firstArgumentIndexEnd, new Token(')')); + + if ($shouldAddNamespace) { + $tokens->insertAt($secondArgumentIndexStart, new Token([T_NS_SEPARATOR, '\\'])); + ++$secondArgumentIndexStart; + } + + $tokens->insertAt($secondArgumentIndexStart, [new Token([T_STRING, 'strtolower']), new Token('(')]); + $tokens->insertAt($secondArgumentIndexEnd, new Token(')')); + } + /** * @param -1|1 $direction * diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php index 315d2be1..efd042cf 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -31,9 +32,21 @@ /** * @author Vladimir Reznichenko * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * sets?: list<'@all'|'@exif'|'@ftp'|'@IMAP'|'@internal'|'@ldap'|'@mbreg'|'@mysqli'|'@oci'|'@odbc'|'@openssl'|'@pcntl'|'@pg'|'@posix'|'@snmp'|'@sodium'|'@time'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * sets: list<'@all'|'@exif'|'@ftp'|'@IMAP'|'@internal'|'@ldap'|'@mbreg'|'@mysqli'|'@oci'|'@odbc'|'@openssl'|'@pcntl'|'@pg'|'@posix'|'@snmp'|'@sodium'|'@time'> + * } */ final class NoAliasFunctionsFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + private const SETS = [ '@internal' => [ 'diskfreespace' => 'disk_free_space', @@ -156,30 +169,10 @@ final class NoAliasFunctionsFixer extends AbstractFixer implements ConfigurableF ]; /** - * @var array|string> stores alias (key) - master (value) functions mapping + * @var array stores alias (key) - master (value) functions mapping */ private array $aliases = []; - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->aliases = []; - - foreach ($this->configuration['sets'] as $set) { - if ('@all' === $set) { - $this->aliases = array_merge(...array_values(self::SETS)); - - break; - } - - $this->aliases = array_merge($this->aliases, self::SETS[$set]); - } - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -233,25 +226,35 @@ public function getPriority(): int return 40; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->aliases = []; + + foreach ($this->configuration['sets'] as $set) { + if ('@all' === $set) { + $this->aliases = array_merge(...array_values(self::SETS)); + + break; + } + + if (!isset(self::SETS[$set])) { + throw new \LogicException(\sprintf('Set %s passed option validation, but not part of ::SETS.', $set)); + } + + $this->aliases = array_merge($this->aliases, self::SETS[$set]); + } + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionsAnalyzer = new FunctionsAnalyzer(); @@ -293,9 +296,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $sets = [ @@ -321,14 +321,14 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn $list = "List of sets to fix. Defined sets are:\n\n"; foreach ($sets as $set => $description) { - $list .= sprintf("* `%s` (%s);\n", $set, $description); + $list .= \sprintf("* `%s` (%s);\n", $set, $description); } $list = rtrim($list, ";\n").'.'; return new FixerConfigurationResolver([ (new FixerOptionBuilder('sets', $list)) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset(array_keys($sets))]) ->setDefault(['@internal', '@IMAP', '@pg']) ->getOption(), diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasLanguageConstructCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasLanguageConstructCallFixer.php index 357fa228..4df764ab 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasLanguageConstructCallFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasLanguageConstructCallFixer.php @@ -23,9 +23,6 @@ final class NoAliasLanguageConstructCallFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -40,17 +37,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_EXIT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php index 46782415..7a0292fe 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -28,38 +29,26 @@ /** * @author Sullivan Senechal + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * use?: 'echo'|'print' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * use: 'echo'|'print' + * } */ final class NoMixedEchoPrintFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * @var string - */ - private $callBack; + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; /** - * @var int T_ECHO or T_PRINT + * @var T_ECHO|T_PRINT */ - private $candidateTokenType; + private int $candidateTokenType; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - if ('echo' === $this->configuration['use']) { - $this->candidateTokenType = T_PRINT; - $this->callBack = 'fixPrintToEcho'; - } else { - $this->candidateTokenType = T_ECHO; - $this->callBack = 'fixEchoToPrint'; - } - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -81,30 +70,29 @@ public function getPriority(): int return -10; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound($this->candidateTokenType); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->candidateTokenType = 'echo' === $this->configuration['use'] ? T_PRINT : T_ECHO; + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $callBack = $this->callBack; foreach ($tokens as $index => $token) { if ($token->isGivenKind($this->candidateTokenType)) { - $this->{$callBack}($tokens, $index); + if (T_PRINT === $this->candidateTokenType) { + $this->fixPrintToEcho($tokens, $index); + } else { + $this->fixEchoToPrint($tokens, $index); + } } } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php index 30386770..84e68090 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php @@ -25,18 +25,12 @@ final class PowToExponentiationFixer extends AbstractFunctionReferenceFixer { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { // minimal candidate to fix is seven tokens: pow(x,y); return $tokens->count() > 7 && $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -54,16 +48,13 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before BinaryOperatorSpacesFixer, MethodArgumentSpaceFixer, NativeFunctionCasingFixer, NoSpacesAfterFunctionNameFixer, NoSpacesInsideParenthesisFixer. + * Must run before BinaryOperatorSpacesFixer, MethodArgumentSpaceFixer, NativeFunctionCasingFixer, NoSpacesAfterFunctionNameFixer, NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. */ public function getPriority(): int { return 32; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $candidates = $this->findPowCalls($tokens); @@ -106,7 +97,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @return array + * @return list */ private function findPowCalls(Tokens $tokens): array { @@ -214,17 +205,15 @@ private function isParenthesisNeeded(Tokens $tokens, int $argumentStartIndex, in } /** - * @return int[] + * @return list */ private function getAllowedKinds(): array { - return array_merge( - [ - T_DNUMBER, T_LNUMBER, T_VARIABLE, T_STRING, T_CONSTANT_ENCAPSED_STRING, T_DOUBLE_CAST, - T_INT_CAST, T_INC, T_DEC, T_NS_SEPARATOR, T_WHITESPACE, T_DOUBLE_COLON, T_LINE, T_COMMENT, T_DOC_COMMENT, - CT::T_NAMESPACE_OPERATOR, - ], - Token::getObjectOperatorKinds() - ); + return [ + T_DNUMBER, T_LNUMBER, T_VARIABLE, T_STRING, T_CONSTANT_ENCAPSED_STRING, T_DOUBLE_CAST, + T_INT_CAST, T_INC, T_DEC, T_NS_SEPARATOR, T_WHITESPACE, T_DOUBLE_COLON, T_LINE, T_COMMENT, T_DOC_COMMENT, + CT::T_NAMESPACE_OPERATOR, + ...Token::getObjectOperatorKinds(), + ]; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/RandomApiMigrationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/RandomApiMigrationFixer.php index b72aad7f..7f2b8cff 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/RandomApiMigrationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/RandomApiMigrationFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFunctionReferenceFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -29,13 +30,25 @@ /** * @author Vladimir Reznichenko + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * replacements?: array + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * replacements: array + * } */ final class RandomApiMigrationFixer extends AbstractFunctionReferenceFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @var array> */ - private static array $argumentCounts = [ + private const ARGUMENT_COUNTS = [ 'getrandmax' => [0], 'mt_rand' => [1, 2], 'rand' => [0, 2], @@ -43,24 +56,6 @@ final class RandomApiMigrationFixer extends AbstractFunctionReferenceFixer imple 'random_int' => [0, 2], ]; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - foreach ($this->configuration['replacements'] as $functionName => $replacement) { - $this->configuration['replacements'][$functionName] = [ - 'alternativeName' => $replacement, - 'argumentCount' => self::$argumentCounts[$functionName], - ]; - } - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -81,15 +76,12 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $argumentsAnalyzer = new ArgumentsAnalyzer(); foreach ($this->configuration['replacements'] as $functionIdentity => $functionReplacement) { - if ($functionIdentity === $functionReplacement['alternativeName']) { + if ($functionIdentity === $functionReplacement) { continue; } @@ -107,15 +99,17 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void [$functionName, $openParenthesis, $closeParenthesis] = $boundaries; $count = $argumentsAnalyzer->countArguments($tokens, $openParenthesis, $closeParenthesis); - if (!\in_array($count, $functionReplacement['argumentCount'], true)) { + \assert(isset(self::ARGUMENT_COUNTS[$functionIdentity])); // for PHPStan + + if (!\in_array($count, self::ARGUMENT_COUNTS[$functionIdentity], true)) { continue 2; } // analysing cursor shift, so nested calls could be processed $currIndex = $openParenthesis; - $tokens[$functionName] = new Token([T_STRING, $functionReplacement['alternativeName']]); + $tokens[$functionName] = new Token([T_STRING, $functionReplacement]); - if (0 === $count && 'random_int' === $functionReplacement['alternativeName']) { + if (0 === $count && 'random_int' === $functionReplacement) { $tokens->insertAt($currIndex + 1, [ new Token([T_LNUMBER, '0']), new Token(','), @@ -131,30 +125,19 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('replacements', 'Mapping between replaced functions with the new ones.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['array']) ->setAllowedValues([static function (array $value): bool { foreach ($value as $functionName => $replacement) { - if (!\array_key_exists($functionName, self::$argumentCounts)) { - throw new InvalidOptionsException(sprintf( + if (!\array_key_exists($functionName, self::ARGUMENT_COUNTS)) { + throw new InvalidOptionsException(\sprintf( 'Function "%s" is not handled by the fixer.', $functionName )); } - - if (!\is_string($replacement)) { - throw new InvalidOptionsException(sprintf( - 'Replacement for function "%s" must be a string, "%s" given.', - $functionName, - get_debug_type($replacement) - )); - } } return true; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php index 0aa88d62..2127e33d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php @@ -24,9 +24,6 @@ final class SetTypeToCastFixer extends AbstractFunctionReferenceFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -55,17 +52,11 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_CONSTANT_ENCAPSED_STRING, T_STRING, T_VARIABLE]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $map = [ @@ -135,7 +126,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void // --- Test type ------------------------------ - $type = strtolower(trim($tokens[$secondArgumentStart]->getContent(), '"\'"')); + $type = strtolower(trim($tokens[$secondArgumentStart]->getContent(), '"\'')); if ('null' !== $type && !isset($map[$type])) { continue; // we don't know how to map diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php index c878a023..2eab59c6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -30,33 +31,26 @@ * @author Gregor Harlan * @author Sebastiaan Stok * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * syntax?: 'long'|'short' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * syntax: 'long'|'short' + * } */ final class ArraySyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * @var null|int - */ - private $candidateTokenKind; + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; /** - * @var null|string - */ - private $fixCallback; - - /** - * {@inheritdoc} + * @var CT::T_ARRAY_SQUARE_BRACE_OPEN|T_ARRAY */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->resolveCandidateTokenKind(); - $this->resolveFixCallback(); - } + private $candidateTokenKind; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -76,38 +70,36 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before BinaryOperatorSpacesFixer, TernaryOperatorSpacesFixer. + * Must run before BinaryOperatorSpacesFixer, SingleSpaceAfterConstructFixer, SingleSpaceAroundConstructFixer, TernaryOperatorSpacesFixer. */ public function getPriority(): int { - return 1; + return 37; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound($this->candidateTokenKind); } - /** - * {@inheritdoc} - */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + protected function configurePostNormalisation(): void { - $callback = $this->fixCallback; + $this->resolveCandidateTokenKind(); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { for ($index = $tokens->count() - 1; 0 <= $index; --$index) { if ($tokens[$index]->isGivenKind($this->candidateTokenKind)) { - $this->{$callback}($tokens, $index); + if ('short' === $this->configuration['syntax']) { + $this->fixToShortArraySyntax($tokens, $index); + } else { + $this->fixToLongArraySyntax($tokens, $index); + } } } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -139,11 +131,6 @@ private function fixToShortArraySyntax(Tokens $tokens, int $index): void $tokens->clearTokenAndMergeSurroundingWhitespace($index); } - private function resolveFixCallback(): void - { - $this->fixCallback = sprintf('fixTo%sArraySyntax', ucfirst($this->configuration['syntax'])); - } - private function resolveCandidateTokenKind(): void { $this->candidateTokenKind = 'long' === $this->configuration['syntax'] ? CT::T_ARRAY_SQUARE_BRACE_OPEN : T_ARRAY; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoMultilineWhitespaceAroundDoubleArrowFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoMultilineWhitespaceAroundDoubleArrowFixer.php index a8e98aac..b7a888f0 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoMultilineWhitespaceAroundDoubleArrowFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoMultilineWhitespaceAroundDoubleArrowFixer.php @@ -28,9 +28,6 @@ */ final class NoMultilineWhitespaceAroundDoubleArrowFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -49,17 +46,11 @@ public function getPriority(): int return 31; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOUBLE_ARROW); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixer.php index 6ced6ca3..6d133841 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixer.php @@ -29,9 +29,6 @@ */ final class NoTrailingCommaInSinglelineArrayFixer extends AbstractProxyFixer implements DeprecatedFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -40,17 +37,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function getSuccessorsNames(): array { return array_keys($this->proxyFixers); } - /** - * {@inheritdoc} - */ protected function createProxyFixers(): array { $fixer = new NoTrailingCommaInSinglelineFixer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoWhitespaceBeforeCommaInArrayFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoWhitespaceBeforeCommaInArrayFixer.php index 2a5af329..e5e75489 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoWhitespaceBeforeCommaInArrayFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoWhitespaceBeforeCommaInArrayFixer.php @@ -16,32 +16,40 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Tokens; /** * @author Adam Marczuk + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * after_heredoc?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * after_heredoc: bool + * } */ final class NoWhitespaceBeforeCommaInArrayFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'In array declaration, there MUST NOT be a whitespace before each comma.', [ new CodeSample(" true] ), ] ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; $index > 0; --$index) { @@ -78,9 +79,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NormalizeIndexBraceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NormalizeIndexBraceFixer.php index f4d76525..3d5f5616 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NormalizeIndexBraceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NormalizeIndexBraceFixer.php @@ -15,9 +15,10 @@ namespace PhpCsFixer\Fixer\ArrayNotation; use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\FixerDefinition\VersionSpecification; +use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; @@ -27,28 +28,22 @@ */ final class NormalizeIndexBraceFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'Array index should always be written by using square braces.', - [new CodeSample("isTokenKindFound(CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ReturnToYieldFromFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ReturnToYieldFromFixer.php new file mode 100644 index 00000000..4b130a27 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ReturnToYieldFromFixer.php @@ -0,0 +1,105 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\ArrayNotation; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Kuba Werłos + */ +final class ReturnToYieldFromFixer extends AbstractFixer +{ + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'If the function explicitly returns an array, and has the return type `iterable`, then `yield from` must be used instead of `return`.', + [new CodeSample('isAllTokenKindsFound([T_FUNCTION, T_RETURN]) && $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN]); + } + + /** + * {@inheritdoc} + * + * Must run before YieldFromArrayToYieldsFixer. + * Must run after PhpUnitDataProviderReturnTypeFixer, PhpdocToReturnTypeFixer. + */ + public function getPriority(): int + { + return 1; + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + foreach ($tokens->findGivenKind(T_RETURN) as $index => $token) { + if (!$this->shouldBeFixed($tokens, $index)) { + continue; + } + + $tokens[$index] = new Token([T_YIELD_FROM, 'yield from']); + } + } + + private function shouldBeFixed(Tokens $tokens, int $returnIndex): bool + { + $arrayStartIndex = $tokens->getNextMeaningfulToken($returnIndex); + if (!$tokens[$arrayStartIndex]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN])) { + return false; + } + + if ($tokens[$arrayStartIndex]->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { + $arrayEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $arrayStartIndex); + } else { + $arrayOpenParenthesisIndex = $tokens->getNextTokenOfKind($arrayStartIndex, ['(']); + $arrayEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $arrayOpenParenthesisIndex); + } + + $functionEndIndex = $arrayEndIndex; + do { + $functionEndIndex = $tokens->getNextMeaningfulToken($functionEndIndex); + } while (null !== $functionEndIndex && $tokens[$functionEndIndex]->equals(';')); + if (null === $functionEndIndex || !$tokens[$functionEndIndex]->equals('}')) { + return false; + } + + $functionStartIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $functionEndIndex); + + $returnTypeIndex = $tokens->getPrevMeaningfulToken($functionStartIndex); + if (!$tokens[$returnTypeIndex]->isGivenKind(T_STRING)) { + return false; + } + + if ('iterable' !== strtolower($tokens[$returnTypeIndex]->getContent())) { + return false; + } + + $beforeReturnTypeIndex = $tokens->getPrevMeaningfulToken($returnTypeIndex); + + return $tokens[$beforeReturnTypeIndex]->isGivenKind(CT::T_TYPE_COLON); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/TrimArraySpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/TrimArraySpacesFixer.php index d2e19bfb..775e9125 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/TrimArraySpacesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/TrimArraySpacesFixer.php @@ -26,9 +26,6 @@ */ final class TrimArraySpacesFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -37,21 +34,15 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - return $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN]); + return $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = 0, $c = $tokens->count(); $index < $c; ++$index) { - if ($tokens[$index]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN])) { + if ($tokens[$index]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN])) { self::fixArray($tokens, $index); } } @@ -67,6 +58,8 @@ private static function fixArray(Tokens $tokens, int $index): void if ($tokens[$startIndex]->isGivenKind(T_ARRAY)) { $startIndex = $tokens->getNextMeaningfulToken($startIndex); $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startIndex); + } elseif ($tokens[$startIndex]->isGivenKind(CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN)) { + $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_DESTRUCTURING_SQUARE_BRACE, $startIndex); } else { $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $startIndex); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php index 8e299b15..88cd0724 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -29,12 +30,21 @@ /** * @author Adam Marczuk + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * ensure_single_space?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * ensure_single_space: bool + * } */ final class WhitespaceAfterCommaInArrayFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -46,17 +56,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN]); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -67,9 +71,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensToInsert = []; @@ -95,10 +96,10 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void if (!$tokens[$i + 1]->isWhitespace()) { $tokensToInsert[$i + 1] = new Token([T_WHITESPACE, ' ']); } elseif ( - $this->configuration['ensure_single_space'] + true === $this->configuration['ensure_single_space'] && ' ' !== $tokens[$i + 1]->getContent() - && 1 === Preg::match('/^\h+$/', $tokens[$i + 1]->getContent()) - && (!$tokens[$i + 2]->isComment() || 1 === Preg::match('/^\h+$/', $tokens[$i + 3]->getContent())) + && Preg::match('/^\h+$/', $tokens[$i + 1]->getContent()) + && (!$tokens[$i + 2]->isComment() || Preg::match('/^\h+$/', $tokens[$i + 3]->getContent())) ) { $tokens[$i + 1] = new Token([T_WHITESPACE, ' ']); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php new file mode 100644 index 00000000..021d1cd1 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php @@ -0,0 +1,189 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\ArrayNotation; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Kuba Werłos + */ +final class YieldFromArrayToYieldsFixer extends AbstractFixer +{ + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Yield from array must be unpacked to series of yields.', + [ + new CodeSample('isTokenKindFound(T_YIELD_FROM); + } + + /** + * {@inheritdoc} + * + * Must run before BlankLineBeforeStatementFixer, NoExtraBlankLinesFixer, NoMultipleStatementsPerLineFixer, NoWhitespaceInBlankLineFixer, StatementIndentationFixer. + * Must run after ReturnToYieldFromFixer. + */ + public function getPriority(): int + { + return 0; + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + /** + * @var array $inserts + */ + $inserts = []; + + foreach ($this->getYieldsFromToUnpack($tokens) as $index => [$startIndex, $endIndex]) { + $tokens->clearTokenAndMergeSurroundingWhitespace($index); + + if ($tokens[$startIndex]->equals('(')) { + $prevStartIndex = $tokens->getPrevMeaningfulToken($startIndex); + $tokens->clearTokenAndMergeSurroundingWhitespace($prevStartIndex); // clear `array` from `array(` + } + + $tokens->clearTokenAndMergeSurroundingWhitespace($startIndex); + $tokens->clearTokenAndMergeSurroundingWhitespace($endIndex); + + $arrayHasTrailingComma = false; + + $startIndex = $tokens->getNextMeaningfulToken($startIndex); + + $inserts[$startIndex] = [new Token([T_YIELD, 'yield']), new Token([T_WHITESPACE, ' '])]; + + foreach ($this->findArrayItemCommaIndex( + $tokens, + $startIndex, + $tokens->getPrevMeaningfulToken($endIndex), + ) as $commaIndex) { + $nextItemIndex = $tokens->getNextMeaningfulToken($commaIndex); + + if ($nextItemIndex < $endIndex) { + $inserts[$nextItemIndex] = [new Token([T_YIELD, 'yield']), new Token([T_WHITESPACE, ' '])]; + $tokens[$commaIndex] = new Token(';'); + } else { + $arrayHasTrailingComma = true; + // array has trailing comma - we replace it with `;` (as it's best fit to put it) + $tokens[$commaIndex] = new Token(';'); + } + } + + // there was a trailing comma, so we do not need original `;` after initial array structure + if (true === $arrayHasTrailingComma) { + $tokens->clearTokenAndMergeSurroundingWhitespace($tokens->getNextMeaningfulToken($endIndex)); + } + } + + $tokens->insertSlices($inserts); + } + + /** + * @return iterable + */ + private function getYieldsFromToUnpack(Tokens $tokens): iterable + { + $tokensCount = $tokens->count(); + $index = 0; + while (++$index < $tokensCount) { + if (!$tokens[$index]->isGivenKind(T_YIELD_FROM)) { + continue; + } + + $prevIndex = $tokens->getPrevMeaningfulToken($index); + if (!$tokens[$prevIndex]->equalsAny([';', '{', '}', [T_OPEN_TAG]])) { + continue; + } + + $arrayStartIndex = $tokens->getNextMeaningfulToken($index); + + if (!$tokens[$arrayStartIndex]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN])) { + continue; + } + + if ($tokens[$arrayStartIndex]->isGivenKind(T_ARRAY)) { + $startIndex = $tokens->getNextTokenOfKind($arrayStartIndex, ['(']); + $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startIndex); + } else { + $startIndex = $arrayStartIndex; + $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $startIndex); + } + + // is there empty "yield from []" ? + if ($endIndex === $tokens->getNextMeaningfulToken($startIndex)) { + continue; + } + + // is there any nested "yield from"? + if ([] !== $tokens->findGivenKind(T_YIELD_FROM, $startIndex, $endIndex)) { + continue; + } + + yield $index => [$startIndex, $endIndex]; + } + } + + /** + * @return iterable + */ + private function findArrayItemCommaIndex(Tokens $tokens, int $startIndex, int $endIndex): iterable + { + for ($index = $startIndex; $index <= $endIndex; ++$index) { + $token = $tokens[$index]; + + // skip nested (), [], {} constructs + $blockDefinitionProbe = Tokens::detectBlockType($token); + + if (null !== $blockDefinitionProbe && true === $blockDefinitionProbe['isStart']) { + $index = $tokens->findBlockEnd($blockDefinitionProbe['type'], $index); + + continue; + } + + if (!$tokens[$index]->equals(',')) { + continue; + } + + yield $index; + } + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/AttributeEmptyParenthesesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/AttributeEmptyParenthesesFixer.php new file mode 100644 index 00000000..8166a0f2 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/AttributeEmptyParenthesesFixer.php @@ -0,0 +1,136 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\AttributeNotation; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author HypeMC + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * use_parentheses?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * use_parentheses: bool + * } + */ +final class AttributeEmptyParenthesesFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'PHP attributes declared without arguments must (not) be followed by empty parentheses.', + [ + new CodeSample(" true] + ), + ] + ); + } + + public function isCandidate(Tokens $tokens): bool + { + return \defined('T_ATTRIBUTE') && $tokens->isTokenKindFound(T_ATTRIBUTE); + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('use_parentheses', 'Whether attributes should be followed by parentheses or not.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + ]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $index = 0; + + while (null !== $index = $tokens->getNextTokenOfKind($index, [[T_ATTRIBUTE]])) { + $nextIndex = $index; + + do { + $parenthesesIndex = $tokens->getNextTokenOfKind($nextIndex, ['(', ',', [CT::T_ATTRIBUTE_CLOSE]]); + + if (true === $this->configuration['use_parentheses']) { + $this->ensureParenthesesAt($tokens, $parenthesesIndex); + } else { + $this->ensureNoParenthesesAt($tokens, $parenthesesIndex); + } + + $nextIndex = $tokens->getNextTokenOfKind($nextIndex, ['(', ',', [CT::T_ATTRIBUTE_CLOSE]]); + + // Find closing parentheses, we need to do this in case there's a comma inside the parentheses + if ($tokens[$nextIndex]->equals('(')) { + $nextIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $nextIndex); + $nextIndex = $tokens->getNextTokenOfKind($nextIndex, [',', [CT::T_ATTRIBUTE_CLOSE]]); + } + + // In case there's a comma right before T_ATTRIBUTE_CLOSE + if (!$tokens[$nextIndex]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { + $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); + } + } while (!$tokens[$nextIndex]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)); + } + } + + private function ensureParenthesesAt(Tokens $tokens, int $index): void + { + if ($tokens[$index]->equals('(')) { + return; + } + + $tokens->insertAt( + $tokens->getPrevMeaningfulToken($index) + 1, + [new Token('('), new Token(')')] + ); + } + + private function ensureNoParenthesesAt(Tokens $tokens, int $index): void + { + if (!$tokens[$index]->equals('(')) { + return; + } + + $closingIndex = $tokens->getNextMeaningfulToken($index); + + // attribute has arguments - parentheses can not be removed + if (!$tokens[$closingIndex]->equals(')')) { + return; + } + + $tokens->clearTokenAndMergeSurroundingWhitespace($closingIndex); + $tokens->clearTokenAndMergeSurroundingWhitespace($index); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/GeneralAttributeRemoveFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/GeneralAttributeRemoveFixer.php new file mode 100644 index 00000000..a915f2a7 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/GeneralAttributeRemoveFixer.php @@ -0,0 +1,142 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\AttributeNotation; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\AttributeAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Raffaele Carelle + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-import-type _AttributeItems from AttributeAnalysis + * @phpstan-import-type _AttributeItem from AttributeAnalysis + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * attributes?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * attributes: list + * } + */ +final class GeneralAttributeRemoveFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Removes configured attributes by their respective FQN.', + [ + new CodeSample( + ' ['\A\B\Foo']] + ), + new CodeSample( + ' ['\A\B\Foo', 'A\B\Bar']] + ), + ] + ); + } + + public function getPriority(): int + { + return 0; + } + + public function isCandidate(Tokens $tokens): bool + { + return \defined('T_ATTRIBUTE') && $tokens->isTokenKindFound(T_ATTRIBUTE); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + if (0 === \count($this->configuration['attributes'])) { + return; + } + + $index = 0; + + while (null !== $index = $tokens->getNextTokenOfKind($index, [[T_ATTRIBUTE]])) { + $attributeAnalysis = AttributeAnalyzer::collectOne($tokens, $index); + + $endIndex = $attributeAnalysis->getEndIndex(); + + $removedCount = 0; + foreach ($attributeAnalysis->getAttributes() as $element) { + $fullname = AttributeAnalyzer::determineAttributeFullyQualifiedName($tokens, $element['name'], $element['start']); + + if (!\in_array($fullname, $this->configuration['attributes'], true)) { + continue; + } + + $tokens->clearRange($element['start'], $element['end']); + ++$removedCount; + + $siblingIndex = $tokens->getNonEmptySibling($element['end'], 1); + + // Clear element comma + if (',' === $tokens[$siblingIndex]->getContent()) { + $tokens->clearAt($siblingIndex); + } + } + + // Clear whole attribute if all are removed (multiline attribute case) + if (\count($attributeAnalysis->getAttributes()) === $removedCount) { + $tokens->clearRange($attributeAnalysis->getStartIndex(), $attributeAnalysis->getEndIndex()); + } + + // Clear trailing comma + $tokenIndex = $tokens->getMeaningfulTokenSibling($attributeAnalysis->getClosingBracketIndex(), -1); + if (',' === $tokens[$tokenIndex]->getContent()) { + $tokens->clearAt($tokenIndex); + } + + $index = $endIndex; + } + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('attributes', 'List of FQNs of attributes for removal.')) + ->setAllowedTypes(['class-string[]']) + ->setDefault([]) + ->getOption(), + ]); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php new file mode 100644 index 00000000..957344e4 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php @@ -0,0 +1,271 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\AttributeNotation; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\FixerDefinition\VersionSpecification; +use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\AttributeAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; +use Symfony\Component\OptionsResolver\Options; + +/** + * @author HypeMC + * + * @phpstan-import-type _AttributeItems from AttributeAnalysis + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * order?: list, + * sort_algorithm?: 'alpha'|'custom' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * order: array, + * sort_algorithm: 'alpha'|'custom' + * } + */ +final class OrderedAttributesFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public const ORDER_ALPHA = 'alpha'; + public const ORDER_CUSTOM = 'custom'; + + private const SUPPORTED_SORT_ALGORITHMS = [ + self::ORDER_ALPHA, + self::ORDER_CUSTOM, + ]; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Sorts attributes using the configured sort algorithm.', + [ + new VersionSpecificCodeSample( + <<<'EOL' + self::ORDER_CUSTOM, 'order' => ['A\B\Qux', 'A\B\Bar', 'A\B\Corge']], + ), + ], + ); + } + + /** + * {@inheritdoc} + * + * Must run after FullyQualifiedStrictTypesFixer. + */ + public function getPriority(): int + { + return 0; + } + + public function isCandidate(Tokens $tokens): bool + { + return \defined('T_ATTRIBUTE') && $tokens->isTokenKindFound(T_ATTRIBUTE); + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + $fixerName = $this->getName(); + + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('sort_algorithm', 'How the attributes should be sorted.')) + ->setAllowedValues(self::SUPPORTED_SORT_ALGORITHMS) + ->setDefault(self::ORDER_ALPHA) + ->setNormalizer(static function (Options $options, string $value) use ($fixerName): string { + if (self::ORDER_CUSTOM === $value && [] === $options['order']) { + throw new InvalidFixerConfigurationException( + $fixerName, + 'The custom order strategy requires providing `order` option with a list of attributes\'s FQNs.' + ); + } + + return $value; + }) + ->getOption(), + (new FixerOptionBuilder('order', 'A list of FQCNs of attributes defining the desired order used when custom sorting algorithm is configured.')) + ->setAllowedTypes(['string[]']) + ->setDefault([]) + ->setNormalizer(static function (Options $options, array $value) use ($fixerName): array { + if ($value !== array_unique($value)) { + throw new InvalidFixerConfigurationException($fixerName, 'The list includes attributes that are not unique.'); + } + + return array_flip(array_values( + array_map(static fn (string $attribute): string => ltrim($attribute, '\\'), $value), + )); + }) + ->getOption(), + ]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $index = 0; + + while (null !== $index = $tokens->getNextTokenOfKind($index, [[T_ATTRIBUTE]])) { + /** @var _AttributeItems $elements */ + $elements = array_map(fn (AttributeAnalysis $attributeAnalysis): array => [ + 'name' => $this->sortAttributes($tokens, $attributeAnalysis->getStartIndex(), $attributeAnalysis->getAttributes()), + 'start' => $attributeAnalysis->getStartIndex(), + 'end' => $attributeAnalysis->getEndIndex(), + ], AttributeAnalyzer::collect($tokens, $index)); + + $endIndex = end($elements)['end']; + + try { + if (1 === \count($elements)) { + continue; + } + + $sortedElements = $this->sortElements($elements); + + if ($elements === $sortedElements) { + continue; + } + + $this->sortTokens($tokens, $index, $endIndex, $sortedElements); + } finally { + $index = $endIndex; + } + } + } + + /** + * @param _AttributeItems $attributes + */ + private function sortAttributes(Tokens $tokens, int $index, array $attributes): string + { + if (1 === \count($attributes)) { + return $this->getAttributeName($tokens, $attributes[0]['name'], $attributes[0]['start']); + } + + foreach ($attributes as &$attribute) { + $attribute['name'] = $this->getAttributeName($tokens, $attribute['name'], $attribute['start']); + } + + $sortedElements = $this->sortElements($attributes); + + if ($attributes === $sortedElements) { + return $attributes[0]['name']; + } + + $this->sortTokens($tokens, $index + 1, end($attributes)['end'], $sortedElements, new Token(',')); + + return $sortedElements[0]['name']; + } + + private function getAttributeName(Tokens $tokens, string $name, int $index): string + { + if (self::ORDER_CUSTOM === $this->configuration['sort_algorithm']) { + $name = AttributeAnalyzer::determineAttributeFullyQualifiedName($tokens, $name, $index); + } + + return ltrim($name, '\\'); + } + + /** + * @param _AttributeItems $elements + * + * @return _AttributeItems + */ + private function sortElements(array $elements): array + { + usort($elements, function (array $a, array $b): int { + $sortAlgorithm = $this->configuration['sort_algorithm']; + + if (self::ORDER_ALPHA === $sortAlgorithm) { + return $a['name'] <=> $b['name']; + } + + if (self::ORDER_CUSTOM === $sortAlgorithm) { + return + ($this->configuration['order'][$a['name']] ?? PHP_INT_MAX) + <=> + ($this->configuration['order'][$b['name']] ?? PHP_INT_MAX); + } + + throw new \InvalidArgumentException(\sprintf('Invalid sort algorithm "%s" provided.', $sortAlgorithm)); + }); + + return $elements; + } + + /** + * @param _AttributeItems $elements + */ + private function sortTokens(Tokens $tokens, int $startIndex, int $endIndex, array $elements, ?Token $delimiter = null): void + { + $replaceTokens = []; + + foreach ($elements as $pos => $element) { + for ($i = $element['start']; $i <= $element['end']; ++$i) { + $replaceTokens[] = clone $tokens[$i]; + } + if (null !== $delimiter && $pos !== \count($elements) - 1) { + $replaceTokens[] = clone $delimiter; + } + } + + $tokens->overrideRange($startIndex, $endIndex, $replaceTokens); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php index eae186e1..5057ae16 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractProxyFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\ControlStructure\ControlStructureBracesFixer; use PhpCsFixer\Fixer\ControlStructure\ControlStructureContinuationPositionFixer; use PhpCsFixer\Fixer\DeprecatedFixerInterface; @@ -37,9 +38,29 @@ * @author Dariusz Rumiński * * @deprecated + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * allow_single_line_anonymous_class_with_empty_body?: bool, + * allow_single_line_closure?: bool, + * position_after_anonymous_constructs?: 'next'|'same', + * position_after_control_structures?: 'next'|'same', + * position_after_functions_and_oop_constructs?: 'next'|'same' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * allow_single_line_anonymous_class_with_empty_body: bool, + * allow_single_line_closure: bool, + * position_after_anonymous_constructs: 'next'|'same', + * position_after_control_structures: 'next'|'same', + * position_after_functions_and_oop_constructs: 'next'|'same' + * } */ final class BracesFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface, DeprecatedFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -50,19 +71,10 @@ final class BracesFixer extends AbstractProxyFixer implements ConfigurableFixerI */ public const LINE_SAME = 'same'; - /** - * @var null|CurlyBracesPositionFixer - */ - private $curlyBracesPositionFixer; + private ?BracesPositionFixer $bracesPositionFixer = null; - /** - * @var null|ControlStructureContinuationPositionFixer - */ - private $controlStructureContinuationPositionFixer; + private ?ControlStructureContinuationPositionFixer $controlStructureContinuationPositionFixer = null; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -150,19 +162,14 @@ public function getPriority(): int return 35; } - /** - * {@inheritdoc} - */ public function getSuccessorsNames(): array { return array_keys($this->proxyFixers); } - public function configure(array $configuration = null): void + protected function configurePostNormalisation(): void { - parent::configure($configuration); - - $this->getCurlyBracesPositionFixer()->configure([ + $this->getBracesPositionFixer()->configure([ 'control_structures_opening_brace' => $this->translatePositionOption($this->configuration['position_after_control_structures']), 'functions_opening_brace' => $this->translatePositionOption($this->configuration['position_after_functions_and_oop_constructs']), 'anonymous_functions_opening_brace' => $this->translatePositionOption($this->configuration['position_after_anonymous_constructs']), @@ -179,9 +186,6 @@ public function configure(array $configuration = null): void ]); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -226,7 +230,7 @@ protected function createProxyFixers(): array $singleSpaceAroundConstructFixer, new ControlStructureBracesFixer(), $noExtraBlankLinesFixer, - $this->getCurlyBracesPositionFixer(), + $this->getBracesPositionFixer(), $this->getControlStructureContinuationPositionFixer(), new DeclareParenthesesFixer(), new NoMultipleStatementsPerLineFixer(), @@ -234,13 +238,13 @@ protected function createProxyFixers(): array ]; } - private function getCurlyBracesPositionFixer(): CurlyBracesPositionFixer + private function getBracesPositionFixer(): BracesPositionFixer { - if (null === $this->curlyBracesPositionFixer) { - $this->curlyBracesPositionFixer = new CurlyBracesPositionFixer(); + if (null === $this->bracesPositionFixer) { + $this->bracesPositionFixer = new BracesPositionFixer(); } - return $this->curlyBracesPositionFixer; + return $this->bracesPositionFixer; } private function getControlStructureContinuationPositionFixer(): ControlStructureContinuationPositionFixer @@ -252,10 +256,13 @@ private function getControlStructureContinuationPositionFixer(): ControlStructur return $this->controlStructureContinuationPositionFixer; } + /** + * @return BracesPositionFixer::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END|BracesPositionFixer::SAME_LINE + */ private function translatePositionOption(string $option): string { return self::LINE_NEXT === $option - ? CurlyBracesPositionFixer::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END - : CurlyBracesPositionFixer::SAME_LINE; + ? BracesPositionFixer::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END + : BracesPositionFixer::SAME_LINE; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php new file mode 100644 index 00000000..492c35d8 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php @@ -0,0 +1,441 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Basic; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\Fixer\Indentation; +use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; +use PhpCsFixer\Tokenizer\TokensAnalyzer; + +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * allow_single_line_anonymous_functions?: bool, + * allow_single_line_empty_anonymous_classes?: bool, + * anonymous_classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', + * anonymous_functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', + * classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', + * control_structures_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', + * functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * allow_single_line_anonymous_functions: bool, + * allow_single_line_empty_anonymous_classes: bool, + * anonymous_classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', + * anonymous_functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', + * classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', + * control_structures_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', + * functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line' + * } + */ +final class BracesPositionFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + use Indentation; + + /** + * @internal + */ + public const NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END = 'next_line_unless_newline_at_signature_end'; + + /** + * @internal + */ + public const SAME_LINE = 'same_line'; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Braces must be placed as configured.', + [ + new CodeSample( + ' self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END] + ), + new CodeSample( + ' self::SAME_LINE] + ), + new CodeSample( + ' self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END] + ), + new CodeSample( + ' self::SAME_LINE] + ), + new CodeSample( + ' self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END] + ), + new CodeSample( + ' true] + ), + new CodeSample( + ' true] + ), + ] + ); + } + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isTokenKindFound('{'); + } + + /** + * {@inheritdoc} + * + * Must run before SingleLineEmptyBodyFixer, StatementIndentationFixer. + * Must run after ControlStructureBracesFixer, NoMultipleStatementsPerLineFixer. + */ + public function getPriority(): int + { + return -2; + } + + /** @protected */ + public function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('control_structures_opening_brace', 'The position of the opening brace of control structures‘ body.')) + ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) + ->setDefault(self::SAME_LINE) + ->getOption(), + (new FixerOptionBuilder('functions_opening_brace', 'The position of the opening brace of functions‘ body.')) + ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) + ->setDefault(self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END) + ->getOption(), + (new FixerOptionBuilder('anonymous_functions_opening_brace', 'The position of the opening brace of anonymous functions‘ body.')) + ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) + ->setDefault(self::SAME_LINE) + ->getOption(), + (new FixerOptionBuilder('classes_opening_brace', 'The position of the opening brace of classes‘ body.')) + ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) + ->setDefault(self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END) + ->getOption(), + (new FixerOptionBuilder('anonymous_classes_opening_brace', 'The position of the opening brace of anonymous classes‘ body.')) + ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) + ->setDefault(self::SAME_LINE) + ->getOption(), + (new FixerOptionBuilder('allow_single_line_empty_anonymous_classes', 'Allow anonymous classes to have opening and closing braces on the same line.')) + ->setAllowedTypes(['bool']) + ->setDefault(true) + ->getOption(), + (new FixerOptionBuilder('allow_single_line_anonymous_functions', 'Allow anonymous functions to have opening and closing braces on the same line.')) + ->setAllowedTypes(['bool']) + ->setDefault(true) + ->getOption(), + ]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $classyTokens = Token::getClassyTokenKinds(); + $controlStructureTokens = [T_DECLARE, T_DO, T_ELSE, T_ELSEIF, T_FINALLY, T_FOR, T_FOREACH, T_IF, T_WHILE, T_TRY, T_CATCH, T_SWITCH]; + // @TODO: drop condition when PHP 8.0+ is required + if (\defined('T_MATCH')) { + $controlStructureTokens[] = T_MATCH; + } + + $tokensAnalyzer = new TokensAnalyzer($tokens); + + $allowSingleLineUntil = null; + + foreach ($tokens as $index => $token) { + $allowSingleLine = false; + $allowSingleLineIfEmpty = false; + + if ($token->isGivenKind($classyTokens)) { + $openBraceIndex = $tokens->getNextTokenOfKind($index, ['{']); + + if ($tokensAnalyzer->isAnonymousClass($index)) { + $allowSingleLineIfEmpty = true === $this->configuration['allow_single_line_empty_anonymous_classes']; + $positionOption = 'anonymous_classes_opening_brace'; + } else { + $positionOption = 'classes_opening_brace'; + } + } elseif ($token->isGivenKind(T_FUNCTION)) { + $openBraceIndex = $tokens->getNextTokenOfKind($index, ['{', ';']); + + if ($tokens[$openBraceIndex]->equals(';')) { + continue; + } + + if ($tokensAnalyzer->isLambda($index)) { + $allowSingleLine = true === $this->configuration['allow_single_line_anonymous_functions']; + $positionOption = 'anonymous_functions_opening_brace'; + } else { + $positionOption = 'functions_opening_brace'; + } + } elseif ($token->isGivenKind($controlStructureTokens)) { + $parenthesisEndIndex = $this->findParenthesisEnd($tokens, $index); + $openBraceIndex = $tokens->getNextMeaningfulToken($parenthesisEndIndex); + + if (!$tokens[$openBraceIndex]->equals('{')) { + continue; + } + + $positionOption = 'control_structures_opening_brace'; + } else { + continue; + } + + $closeBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $openBraceIndex); + + $addNewlinesInsideBraces = true; + if ($allowSingleLine || $allowSingleLineIfEmpty || $index < $allowSingleLineUntil) { + $addNewlinesInsideBraces = false; + + for ($indexInsideBraces = $openBraceIndex + 1; $indexInsideBraces < $closeBraceIndex; ++$indexInsideBraces) { + $tokenInsideBraces = $tokens[$indexInsideBraces]; + + if ( + ($allowSingleLineIfEmpty && !$tokenInsideBraces->isWhitespace() && !$tokenInsideBraces->isComment()) + || ($tokenInsideBraces->isWhitespace() && Preg::match('/\R/', $tokenInsideBraces->getContent())) + ) { + $addNewlinesInsideBraces = true; + + break; + } + } + + if (!$addNewlinesInsideBraces && null === $allowSingleLineUntil) { + $allowSingleLineUntil = $closeBraceIndex; + } + } + + if ( + $addNewlinesInsideBraces + && !$this->isFollowedByNewLine($tokens, $openBraceIndex) + && !$this->hasCommentOnSameLine($tokens, $openBraceIndex) + && !$tokens[$tokens->getNextMeaningfulToken($openBraceIndex)]->isGivenKind(T_CLOSE_TAG) + ) { + $whitespace = $this->whitespacesConfig->getLineEnding().$this->getLineIndentation($tokens, $openBraceIndex); + if ($tokens->ensureWhitespaceAtIndex($openBraceIndex + 1, 0, $whitespace)) { + ++$closeBraceIndex; + } + } + + $whitespace = ' '; + if (self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END === $this->configuration[$positionOption]) { + $whitespace = $this->whitespacesConfig->getLineEnding().$this->getLineIndentation($tokens, $index); + + $previousTokenIndex = $openBraceIndex; + do { + $previousTokenIndex = $tokens->getPrevMeaningfulToken($previousTokenIndex); + } while ($tokens[$previousTokenIndex]->isGivenKind([CT::T_TYPE_COLON, CT::T_NULLABLE_TYPE, T_STRING, T_NS_SEPARATOR, CT::T_ARRAY_TYPEHINT, T_STATIC, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, T_CALLABLE, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE])); + + if ($tokens[$previousTokenIndex]->equals(')')) { + if ($tokens[--$previousTokenIndex]->isComment()) { + --$previousTokenIndex; + } + if ( + $tokens[$previousTokenIndex]->isWhitespace() + && Preg::match('/\R/', $tokens[$previousTokenIndex]->getContent()) + ) { + $whitespace = ' '; + } + } + } + + $moveBraceToIndex = null; + + if (' ' === $whitespace) { + $previousMeaningfulIndex = $tokens->getPrevMeaningfulToken($openBraceIndex); + for ($indexBeforeOpenBrace = $openBraceIndex - 1; $indexBeforeOpenBrace > $previousMeaningfulIndex; --$indexBeforeOpenBrace) { + if (!$tokens[$indexBeforeOpenBrace]->isComment()) { + continue; + } + + $tokenBeforeOpenBrace = $tokens[--$indexBeforeOpenBrace]; + if ($tokenBeforeOpenBrace->isWhitespace()) { + $moveBraceToIndex = $indexBeforeOpenBrace; + } elseif ($indexBeforeOpenBrace === $previousMeaningfulIndex) { + $moveBraceToIndex = $previousMeaningfulIndex + 1; + } + } + } elseif (!$tokens[$openBraceIndex - 1]->isWhitespace() || !Preg::match('/\R/', $tokens[$openBraceIndex - 1]->getContent())) { + for ($indexAfterOpenBrace = $openBraceIndex + 1; $indexAfterOpenBrace < $closeBraceIndex; ++$indexAfterOpenBrace) { + if ($tokens[$indexAfterOpenBrace]->isWhitespace() && Preg::match('/\R/', $tokens[$indexAfterOpenBrace]->getContent())) { + break; + } + + if ($tokens[$indexAfterOpenBrace]->isComment() && !str_starts_with($tokens[$indexAfterOpenBrace]->getContent(), '/*')) { + $moveBraceToIndex = $indexAfterOpenBrace + 1; + } + } + } + + if (null !== $moveBraceToIndex) { + /** @var Token $movedToken */ + $movedToken = clone $tokens[$openBraceIndex]; + + $delta = $openBraceIndex < $moveBraceToIndex ? 1 : -1; + + if ($tokens[$openBraceIndex + $delta]->isWhitespace()) { + if (-1 === $delta && Preg::match('/\R/', $tokens[$openBraceIndex - 1]->getContent())) { + $content = Preg::replace('/^(\h*?\R)?\h*/', '', $tokens[$openBraceIndex + 1]->getContent()); + if ('' !== $content) { + $tokens[$openBraceIndex + 1] = new Token([T_WHITESPACE, $content]); + } else { + $tokens->clearAt($openBraceIndex + 1); + } + } elseif ($tokens[$openBraceIndex - 1]->isWhitespace()) { + $tokens->clearAt($openBraceIndex - 1); + } + } + + for (; $openBraceIndex !== $moveBraceToIndex; $openBraceIndex += $delta) { + /** @var Token $siblingToken */ + $siblingToken = $tokens[$openBraceIndex + $delta]; + $tokens[$openBraceIndex] = $siblingToken; + } + + $tokens[$openBraceIndex] = $movedToken; + + $openBraceIndex = $moveBraceToIndex; + } + + if ($tokens->ensureWhitespaceAtIndex($openBraceIndex - 1, 1, $whitespace)) { + ++$closeBraceIndex; + if (null !== $allowSingleLineUntil) { + ++$allowSingleLineUntil; + } + } + + if ( + !$addNewlinesInsideBraces + || $tokens[$tokens->getPrevMeaningfulToken($closeBraceIndex)]->isGivenKind(T_OPEN_TAG) + ) { + continue; + } + + $prevIndex = $closeBraceIndex - 1; + while ($tokens->isEmptyAt($prevIndex)) { + --$prevIndex; + } + + $prevToken = $tokens[$prevIndex]; + + if ($prevToken->isWhitespace() && Preg::match('/\R/', $prevToken->getContent())) { + continue; + } + + $whitespace = $this->whitespacesConfig->getLineEnding().$this->getLineIndentation($tokens, $openBraceIndex); + $tokens->ensureWhitespaceAtIndex($prevIndex, 1, $whitespace); + } + } + + private function findParenthesisEnd(Tokens $tokens, int $structureTokenIndex): int + { + $nextIndex = $tokens->getNextMeaningfulToken($structureTokenIndex); + $nextToken = $tokens[$nextIndex]; + + // return if next token is not opening parenthesis + if (!$nextToken->equals('(')) { + return $structureTokenIndex; + } + + return $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $nextIndex); + } + + private function isFollowedByNewLine(Tokens $tokens, int $index): bool + { + for (++$index, $max = \count($tokens) - 1; $index < $max; ++$index) { + $token = $tokens[$index]; + if (!$token->isComment()) { + return $token->isWhitespace() && Preg::match('/\R/', $token->getContent()); + } + } + + return false; + } + + private function hasCommentOnSameLine(Tokens $tokens, int $index): bool + { + $token = $tokens[$index + 1]; + + if ($token->isWhitespace() && !Preg::match('/\R/', $token->getContent())) { + $token = $tokens[$index + 2]; + } + + return $token->isComment(); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/CurlyBracesPositionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/CurlyBracesPositionFixer.php index 1a6be644..099b6381 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/CurlyBracesPositionFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/CurlyBracesPositionFixer.php @@ -14,26 +14,45 @@ namespace PhpCsFixer\Fixer\Basic; -use PhpCsFixer\AbstractFixer; +use PhpCsFixer\AbstractProxyFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\Fixer\DeprecatedFixerInterface; use PhpCsFixer\Fixer\Indentation; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; -final class CurlyBracesPositionFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface +/** + * @deprecated + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * allow_single_line_anonymous_functions?: bool, + * allow_single_line_empty_anonymous_classes?: bool, + * anonymous_classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', + * anonymous_functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', + * classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', + * control_structures_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', + * functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * allow_single_line_anonymous_functions: bool, + * allow_single_line_empty_anonymous_classes: bool, + * anonymous_classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', + * anonymous_functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', + * classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', + * control_structures_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', + * functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line' + * } + */ +final class CurlyBracesPositionFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + use Indentation; /** @@ -46,384 +65,62 @@ final class CurlyBracesPositionFixer extends AbstractFixer implements Configurab */ public const SAME_LINE = 'same_line'; - /** - * {@inheritdoc} - */ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Curly braces must be placed as configured.', - [ - new CodeSample( - 'bracesPositionFixer = new BracesPositionFixer(); -if (foo()) -{ - bar(); -} -' - ), - new VersionSpecificCodeSample( - ' self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END] - ), - new CodeSample( - ' self::SAME_LINE] - ), - new CodeSample( - ' self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END] - ), - new CodeSample( - ' self::SAME_LINE] - ), - new VersionSpecificCodeSample( - ' self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END] - ), - new VersionSpecificCodeSample( - ' true] - ), - new CodeSample( - ' true] - ), - ] - ); + parent::__construct(); } - /** - * {@inheritdoc} - */ - public function isCandidate(Tokens $tokens): bool + public function getDefinition(): FixerDefinitionInterface { - return $tokens->isTokenKindFound('{'); + $fixerDefinition = $this->bracesPositionFixer->getDefinition(); + + return new FixerDefinition( + 'Curly braces must be placed as configured.', + $fixerDefinition->getCodeSamples(), + $fixerDefinition->getDescription(), + $fixerDefinition->getRiskyDescription() + ); } /** * {@inheritdoc} * - * Must run after ControlStructureBracesFixer. + * Must run before SingleLineEmptyBodyFixer, StatementIndentationFixer. + * Must run after ControlStructureBracesFixer, NoMultipleStatementsPerLineFixer. */ public function getPriority(): int { - return parent::getPriority(); + return $this->bracesPositionFixer->getPriority(); } - /** - * {@inheritdoc} - */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + public function getSuccessorsNames(): array { - $classyTokens = Token::getClassyTokenKinds(); - $controlStructureTokens = [T_DECLARE, T_DO, T_ELSE, T_ELSEIF, T_FINALLY, T_FOR, T_FOREACH, T_IF, T_WHILE, T_TRY, T_CATCH, T_SWITCH]; - // @TODO: drop condition when PHP 8.0+ is required - if (\defined('T_MATCH')) { - $controlStructureTokens[] = T_MATCH; - } - - $tokensAnalyzer = new TokensAnalyzer($tokens); - - $allowSingleLineUntil = null; - - foreach ($tokens as $index => $token) { - $allowSingleLine = false; - $allowSingleLineIfEmpty = false; - - if ($token->isGivenKind($classyTokens)) { - $openBraceIndex = $tokens->getNextTokenOfKind($index, ['{']); - - if ($tokensAnalyzer->isAnonymousClass($index)) { - $allowSingleLineIfEmpty = $this->configuration['allow_single_line_empty_anonymous_classes']; - $positionOption = 'anonymous_classes_opening_brace'; - } else { - $positionOption = 'classes_opening_brace'; - } - } elseif ($token->isGivenKind(T_FUNCTION)) { - $openBraceIndex = $tokens->getNextTokenOfKind($index, ['{', ';']); - - if ($tokens[$openBraceIndex]->equals(';')) { - continue; - } - - if ($tokensAnalyzer->isLambda($index)) { - $allowSingleLine = $this->configuration['allow_single_line_anonymous_functions']; - $positionOption = 'anonymous_functions_opening_brace'; - } else { - $positionOption = 'functions_opening_brace'; - } - } elseif ($token->isGivenKind($controlStructureTokens)) { - $parenthesisEndIndex = $this->findParenthesisEnd($tokens, $index); - $openBraceIndex = $tokens->getNextMeaningfulToken($parenthesisEndIndex); - - if (!$tokens[$openBraceIndex]->equals('{')) { - continue; - } - - $positionOption = 'control_structures_opening_brace'; - } else { - continue; - } - - $closeBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $openBraceIndex); - - $addNewlinesInsideBraces = true; - if ($allowSingleLine || $allowSingleLineIfEmpty || $index < $allowSingleLineUntil) { - $addNewlinesInsideBraces = false; - - for ($indexInsideBraces = $openBraceIndex + 1; $indexInsideBraces < $closeBraceIndex; ++$indexInsideBraces) { - $tokenInsideBraces = $tokens[$indexInsideBraces]; - - if ( - ($allowSingleLineIfEmpty && !$tokenInsideBraces->isWhitespace() && !$tokenInsideBraces->isComment()) - || ($tokenInsideBraces->isWhitespace() && 1 === Preg::match('/\R/', $tokenInsideBraces->getContent())) - ) { - $addNewlinesInsideBraces = true; - - break; - } - } - - if (!$addNewlinesInsideBraces && null === $allowSingleLineUntil) { - $allowSingleLineUntil = $closeBraceIndex; - } - } - - if ( - $addNewlinesInsideBraces - && !$this->isFollowedByNewLine($tokens, $openBraceIndex) - && !$this->hasCommentOnSameLine($tokens, $openBraceIndex) - && !$tokens[$tokens->getNextMeaningfulToken($openBraceIndex)]->isGivenKind(T_CLOSE_TAG) - ) { - $whitespace = $this->whitespacesConfig->getLineEnding().$this->getLineIndentation($tokens, $openBraceIndex); - if ($tokens->ensureWhitespaceAtIndex($openBraceIndex + 1, 0, $whitespace)) { - ++$closeBraceIndex; - } - } - - $whitespace = ' '; - if (self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END === $this->configuration[$positionOption]) { - $whitespace = $this->whitespacesConfig->getLineEnding().$this->getLineIndentation($tokens, $index); - - $previousTokenIndex = $openBraceIndex; - do { - $previousTokenIndex = $tokens->getPrevMeaningfulToken($previousTokenIndex); - } while ($tokens[$previousTokenIndex]->isGivenKind([CT::T_TYPE_COLON, CT::T_NULLABLE_TYPE, T_STRING, T_NS_SEPARATOR, CT::T_ARRAY_TYPEHINT, T_STATIC, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, T_CALLABLE, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE])); - - if ($tokens[$previousTokenIndex]->equals(')')) { - if ($tokens[--$previousTokenIndex]->isComment()) { - --$previousTokenIndex; - } - if ( - $tokens[$previousTokenIndex]->isWhitespace() - && 1 === Preg::match('/\R/', $tokens[$previousTokenIndex]->getContent()) - ) { - $whitespace = ' '; - } - } - } - - $moveBraceToIndex = null; - - if (' ' === $whitespace) { - $previousMeaningfulIndex = $tokens->getPrevMeaningfulToken($openBraceIndex); - for ($indexBeforeOpenBrace = $openBraceIndex - 1; $indexBeforeOpenBrace > $previousMeaningfulIndex; --$indexBeforeOpenBrace) { - if (!$tokens[$indexBeforeOpenBrace]->isComment()) { - continue; - } - - $tokenBeforeOpenBrace = $tokens[--$indexBeforeOpenBrace]; - if ($tokenBeforeOpenBrace->isWhitespace()) { - $moveBraceToIndex = $indexBeforeOpenBrace; - } elseif ($indexBeforeOpenBrace === $previousMeaningfulIndex) { - $moveBraceToIndex = $previousMeaningfulIndex + 1; - } - } - } elseif (!$tokens[$openBraceIndex - 1]->isWhitespace() || !Preg::match('/\R/', $tokens[$openBraceIndex - 1]->getContent())) { - for ($indexAfterOpenBrace = $openBraceIndex + 1; $indexAfterOpenBrace < $closeBraceIndex; ++$indexAfterOpenBrace) { - if ($tokens[$indexAfterOpenBrace]->isWhitespace() && Preg::match('/\R/', $tokens[$indexAfterOpenBrace]->getContent())) { - break; - } - - if ($tokens[$indexAfterOpenBrace]->isComment() && !str_starts_with($tokens[$indexAfterOpenBrace]->getContent(), '/*')) { - $moveBraceToIndex = $indexAfterOpenBrace + 1; - } - } - } - - if (null !== $moveBraceToIndex) { - /** @var Token $movedToken */ - $movedToken = clone $tokens[$openBraceIndex]; - - $delta = $openBraceIndex < $moveBraceToIndex ? 1 : -1; - - if ($tokens[$openBraceIndex + $delta]->isWhitespace()) { - if (-1 === $delta && Preg::match('/\R/', $tokens[$openBraceIndex - 1]->getContent())) { - $content = Preg::replace('/^(\h*?\R)?\h*/', '', $tokens[$openBraceIndex + 1]->getContent()); - if ('' !== $content) { - $tokens[$openBraceIndex + 1] = new Token([T_WHITESPACE, $content]); - } else { - $tokens->clearAt($openBraceIndex + 1); - } - } elseif ($tokens[$openBraceIndex - 1]->isWhitespace()) { - $tokens->clearAt($openBraceIndex - 1); - } - } - - for (; $openBraceIndex !== $moveBraceToIndex; $openBraceIndex += $delta) { - /** @var Token $siblingToken */ - $siblingToken = $tokens[$openBraceIndex + $delta]; - $tokens[$openBraceIndex] = $siblingToken; - } - - $tokens[$openBraceIndex] = $movedToken; - - $openBraceIndex = $moveBraceToIndex; - } - - if ($tokens->ensureWhitespaceAtIndex($openBraceIndex - 1, 1, $whitespace)) { - ++$closeBraceIndex; - if (null !== $allowSingleLineUntil) { - ++$allowSingleLineUntil; - } - } - - if ( - !$addNewlinesInsideBraces - || $tokens[$tokens->getPrevMeaningfulToken($closeBraceIndex)]->isGivenKind(T_OPEN_TAG) - ) { - continue; - } - - for ($prevIndex = $closeBraceIndex - 1; $tokens->isEmptyAt($prevIndex); --$prevIndex); - - $prevToken = $tokens[$prevIndex]; - if ($prevToken->isWhitespace() && 1 === Preg::match('/\R/', $prevToken->getContent())) { - continue; - } - - $whitespace = $this->whitespacesConfig->getLineEnding().$this->getLineIndentation($tokens, $openBraceIndex); - $tokens->ensureWhitespaceAtIndex($prevIndex, 1, $whitespace); - } + return [ + $this->bracesPositionFixer->getName(), + ]; } /** - * {@inheritdoc} + * @param _AutogeneratedInputConfiguration $configuration */ - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + protected function configurePreNormalisation(array $configuration): void { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('control_structures_opening_brace', 'The position of the opening brace of control structures‘ body.')) - ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) - ->setDefault(self::SAME_LINE) - ->getOption(), - (new FixerOptionBuilder('functions_opening_brace', 'The position of the opening brace of functions‘ body.')) - ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) - ->setDefault(self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END) - ->getOption(), - (new FixerOptionBuilder('anonymous_functions_opening_brace', 'The position of the opening brace of anonymous functions‘ body.')) - ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) - ->setDefault(self::SAME_LINE) - ->getOption(), - (new FixerOptionBuilder('classes_opening_brace', 'The position of the opening brace of classes‘ body.')) - ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) - ->setDefault(self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END) - ->getOption(), - (new FixerOptionBuilder('anonymous_classes_opening_brace', 'The position of the opening brace of anonymous classes‘ body.')) - ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) - ->setDefault(self::SAME_LINE) - ->getOption(), - (new FixerOptionBuilder('allow_single_line_empty_anonymous_classes', 'Allow anonymous classes to have opening and closing braces on the same line.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('allow_single_line_anonymous_functions', 'Allow anonymous functions to have opening and closing braces on the same line.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - private function findParenthesisEnd(Tokens $tokens, int $structureTokenIndex): int - { - $nextIndex = $tokens->getNextMeaningfulToken($structureTokenIndex); - $nextToken = $tokens[$nextIndex]; - - // return if next token is not opening parenthesis - if (!$nextToken->equals('(')) { - return $structureTokenIndex; - } - - return $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $nextIndex); + $this->bracesPositionFixer->configure($configuration); } - private function isFollowedByNewLine(Tokens $tokens, int $index): bool + protected function createProxyFixers(): array { - for (++$index, $max = \count($tokens) - 1; $index < $max; ++$index) { - $token = $tokens[$index]; - if (!$token->isComment()) { - return $token->isWhitespace() && 1 === Preg::match('/\R/', $token->getContent()); - } - } - - return false; + return [ + $this->bracesPositionFixer, + ]; } - private function hasCommentOnSameLine(Tokens $tokens, int $index): bool + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { - $token = $tokens[$index + 1]; - - if ($token->isWhitespace() && 1 !== Preg::match('/\R/', $token->getContent())) { - $token = $tokens[$index + 2]; - } - - return $token->isComment(); + return $this->bracesPositionFixer->createConfigurationDefinition(); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/EncodingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/EncodingFixer.php index f3145832..2dc98e47 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/EncodingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/EncodingFixer.php @@ -28,25 +28,22 @@ */ final class EncodingFixer extends AbstractFixer { - private string $BOM; + private string $bom; public function __construct() { parent::__construct(); - $this->BOM = pack('CCC', 0xEF, 0xBB, 0xBF); + $this->bom = pack('CCC', 0xEF, 0xBB, 0xBF); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'PHP code MUST use only UTF-8 without BOM (remove BOM).', [ new CodeSample( - $this->BOM.'bom.'getContent(); - if (0 === strncmp($content, $this->BOM, 3)) { + if (str_starts_with($content, $this->bom)) { $newContent = substr($content, 3); if ('' === $newContent) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoMultipleStatementsPerLineFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoMultipleStatementsPerLineFixer.php index d7ed993c..e499d260 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoMultipleStatementsPerLineFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoMultipleStatementsPerLineFixer.php @@ -21,6 +21,7 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Tokens; /** @@ -30,9 +31,6 @@ final class NoMultipleStatementsPerLineFixer extends AbstractFixer implements Wh { use Indentation; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -44,24 +42,19 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run after ControlStructureBracesFixer, NoEmptyStatementFixer. + * Must run before BracesPositionFixer, CurlyBracesPositionFixer. + * Must run after ControlStructureBracesFixer, NoEmptyStatementFixer, YieldFromArrayToYieldsFixer. */ public function getPriority(): int { return -1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(';'); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = 1, $max = \count($tokens) - 1; $index < $max; ++$index) { @@ -74,6 +67,15 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } + if ($tokens[$index]->isGivenKind(CT::T_PROPERTY_HOOK_BRACE_OPEN)) { + $index = $tokens->findBlockEnd( + Tokens::BLOCK_TYPE_PROPERTY_HOOK, + $index + ); + + continue; + } + if (!$tokens[$index]->equals(';')) { continue; } @@ -82,7 +84,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $token = $tokens[$nextIndex]; if ($token->isWhitespace() || $token->isComment()) { - if (1 === Preg::match('/\R/', $token->getContent())) { + if (Preg::match('/\R/', $token->getContent())) { break; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php index 50f1ac94..f7d69226 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -27,11 +28,21 @@ use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Tokens; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * elements?: list<'arguments'|'array'|'array_destructuring'|'group_import'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * elements: list<'arguments'|'array'|'array_destructuring'|'group_import'> + * } + */ final class NoTrailingCommaInSinglelineFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -43,9 +54,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return @@ -53,25 +61,19 @@ public function isCandidate(Tokens $tokens): bool && $tokens->isAnyTokenKindsFound([')', CT::T_ARRAY_SQUARE_BRACE_CLOSE, CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE, CT::T_GROUP_IMPORT_BRACE_CLOSE]); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $elements = ['arguments', 'array_destructuring', 'array', 'group_import']; return new FixerConfigurationResolver([ (new FixerOptionBuilder('elements', 'Which elements to fix.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset($elements)]) ->setDefault($elements) ->getOption(), ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; $index >= 0; --$index) { @@ -107,7 +109,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void private function shouldBeCleared(Tokens $tokens, int $openIndex): bool { - /** @var string[] $elements */ $elements = $this->configuration['elements']; if ($tokens[$openIndex]->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php index 953e709c..44fe6093 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -30,18 +31,25 @@ * Removes Zero-width space (ZWSP), Non-breaking space (NBSP) and other invisible unicode symbols. * * @author Ivan Boprzenkov + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * use_escape_sequences_in_strings?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * use_escape_sequences_in_strings: bool + * } */ final class NonPrintableCharacterFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * @var array - */ - private array $symbolsReplace; + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; /** - * @var int[] + * @var list */ - private static array $tokens = [ + private const TOKENS = [ T_STRING_VARNAME, T_INLINE_HTML, T_VARIABLE, @@ -51,6 +59,11 @@ final class NonPrintableCharacterFixer extends AbstractFixer implements Configur T_DOC_COMMENT, ]; + /** + * @var array + */ + private array $symbolsReplace; + public function __construct() { parent::__construct(); @@ -64,9 +77,6 @@ public function __construct() ]; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -85,25 +95,16 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - return $tokens->isAnyTokenKindsFound(self::$tokens); + return $tokens->isAnyTokenKindsFound(self::TOKENS); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -114,9 +115,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $replacements = []; @@ -131,7 +129,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $content = $token->getContent(); if ( - $this->configuration['use_escape_sequences_in_strings'] + true === $this->configuration['use_escape_sequences_in_strings'] && $token->isGivenKind([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE]) ) { if (!Preg::match('/'.implode('|', array_keys($escapeSequences)).'/', $content)) { @@ -159,7 +157,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } if ($stringTypeChanged) { - $content = Preg::replace('/(\\\\{1,2})/', '\\\\\\\\', $content); + $content = Preg::replace('/(\\\{1,2})/', '\\\\\\\\', $content); $content = str_replace('$', '\$', $content); } @@ -173,7 +171,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - if ($token->isGivenKind(self::$tokens)) { + if ($token->isGivenKind(self::TOKENS)) { $newContent = strtr($content, $replacements); // variable name cannot contain space diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php new file mode 100644 index 00000000..b062dcde --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php @@ -0,0 +1,232 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Basic; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * Let's you add underscores to numeric literals. + * + * Inspired by: + * - {@link https://github.com/kubawerlos/php-cs-fixer-custom-fixers/blob/main/src/Fixer/NumericLiteralSeparatorFixer.php} + * - {@link https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/rules/numeric-separators-style.js} + * + * @author Marvin Heilemann + * @author Greg Korba + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * override_existing?: bool, + * strategy?: 'no_separator'|'use_separator' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * override_existing: bool, + * strategy: 'no_separator'|'use_separator' + * } + */ +final class NumericLiteralSeparatorFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public const STRATEGY_USE_SEPARATOR = 'use_separator'; + public const STRATEGY_NO_SEPARATOR = 'no_separator'; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Adds separators to numeric literals of any kind.', + [ + new CodeSample( + <<<'PHP' + self::STRATEGY_NO_SEPARATOR], + ), + new CodeSample( + <<<'PHP' + self::STRATEGY_USE_SEPARATOR], + ), + new CodeSample( + " true] + ), + ] + ); + } + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isAnyTokenKindsFound([T_DNUMBER, T_LNUMBER]); + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder( + 'override_existing', + 'Whether literals already containing underscores should be reformatted.' + )) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + (new FixerOptionBuilder( + 'strategy', + 'Whether numeric literal should be separated by underscores or not.' + )) + ->setAllowedValues([self::STRATEGY_USE_SEPARATOR, self::STRATEGY_NO_SEPARATOR]) + ->setDefault(self::STRATEGY_USE_SEPARATOR) + ->getOption(), + ]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + foreach ($tokens as $index => $token) { + if (!$token->isGivenKind([T_DNUMBER, T_LNUMBER])) { + continue; + } + + $content = $token->getContent(); + + $newContent = $this->formatValue($content); + + if ($content === $newContent) { + // Skip Token override if its the same content, like when it + // already got a valid literal separator structure. + continue; + } + + $tokens[$index] = new Token([$token->getId(), $newContent]); + } + } + + private function formatValue(string $value): string + { + if (self::STRATEGY_NO_SEPARATOR === $this->configuration['strategy']) { + return str_contains($value, '_') ? str_replace('_', '', $value) : $value; + } + + if (true === $this->configuration['override_existing']) { + $value = str_replace('_', '', $value); + } elseif (str_contains($value, '_')) { + // Keep already underscored literals untouched. + return $value; + } + + $lowerValue = strtolower($value); + + if (str_starts_with($lowerValue, '0b')) { + // Binary + return $this->insertEveryRight($value, 8, 2); + } + + if (str_starts_with($lowerValue, '0x')) { + // Hexadecimal + return $this->insertEveryRight($value, 2, 2); + } + + if (str_starts_with($lowerValue, '0o')) { + // Octal + return $this->insertEveryRight($value, 3, 2); + } + if (str_starts_with($lowerValue, '0') && !str_contains($lowerValue, '.')) { + // Octal notation prior PHP 8.1 but still valid + return $this->insertEveryRight($value, 3, 1); + } + + // All other types + + /** If its a negative value we need an offset */ + $negativeOffset = static fn ($v) => str_contains($v, '-') ? 1 : 0; + + Preg::matchAll('/([0-9-_]+)?((\.)([0-9_]*))?((e)([0-9-_]+))?/i', $value, $result); + + $integer = $result[1][0]; + $joinedValue = $this->insertEveryRight($integer, 3, $negativeOffset($integer)); + + $dot = $result[3][0]; + if ('' !== $dot) { + $integer = $result[4][0]; + $decimal = $this->insertEveryLeft($integer, 3, $negativeOffset($integer)); + $joinedValue = $joinedValue.$dot.$decimal; + } + + $tim = $result[6][0]; + if ('' !== $tim) { + $integer = $result[7][0]; + $times = $this->insertEveryRight($integer, 3, $negativeOffset($integer)); + $joinedValue = $joinedValue.$tim.$times; + } + + return $joinedValue; + } + + private function insertEveryRight(string $value, int $length, int $offset = 0): string + { + $position = $length * -1; + while ($position > -(\strlen($value) - $offset)) { + $value = substr_replace($value, '_', $position, 0); + $position -= $length + 1; + } + + return $value; + } + + private function insertEveryLeft(string $value, int $length, int $offset = 0): string + { + $position = $length; + while ($position < \strlen($value)) { + $value = substr_replace($value, '_', $position, $offset); + $position += $length + 1; + } + + return $value; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/OctalNotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/OctalNotationFixer.php index 48ace2f4..36f19e88 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/OctalNotationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/OctalNotationFixer.php @@ -25,9 +25,6 @@ final class OctalNotationFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -41,17 +38,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return \PHP_VERSION_ID >= 8_01_00 && $tokens->isTokenKindFound(T_LNUMBER); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -61,13 +52,13 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $content = $token->getContent(); - if (1 !== Preg::match('#^0[\d_]+$#', $content)) { + $newContent = Preg::replace('#^0_*+([0-7_]+)$#', '0o$1', $content); + + if ($content === $newContent) { continue; } - $tokens[$index] = 1 === Preg::match('#^0+$#', $content) - ? new Token([T_LNUMBER, '0']) - : new Token([T_LNUMBER, '0o'.('_' === $content[1] ? '0' : '').substr($content, 1)]); + $tokens[$index] = new Token([T_LNUMBER, $newContent]); } } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php index a62ba3d4..7f795cb9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php @@ -15,7 +15,9 @@ namespace PhpCsFixer\Fixer\Basic; use PhpCsFixer\AbstractFixer; +use PhpCsFixer\DocBlock\TypeExpression; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -34,12 +36,21 @@ * @author Bram Gotink * @author Graham Campbell * @author Kuba Werłos + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * dir?: null|string + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * dir: null|string + * } */ final class PsrAutoloadingFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -66,35 +77,11 @@ class InvalidName {} ); } - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - if (null !== $this->configuration['dir']) { - $realpath = realpath($this->configuration['dir']); - - if (false === $realpath) { - throw new \InvalidArgumentException(sprintf('Failed to resolve configured directory "%s".', $this->configuration['dir'])); - } - - $this->configuration['dir'] = $realpath; - } - } - - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; @@ -102,15 +89,14 @@ public function isRisky(): bool /** * {@inheritdoc} + * + * Must run before SelfAccessorFixer. */ public function getPriority(): int { return -10; } - /** - * {@inheritdoc} - */ public function supports(\SplFileInfo $file): bool { if ($file instanceof StdinFileInfo) { @@ -121,13 +107,13 @@ public function supports(\SplFileInfo $file): bool // ignore file with extension other than php ('php' !== $file->getExtension()) // ignore file with name that cannot be a class name - || 0 === Preg::match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $file->getBasename('.php')) + || !Preg::match('/^'.TypeExpression::REGEX_IDENTIFIER.'$/', $file->getBasename('.php')) ) { return false; } try { - $tokens = Tokens::fromCode(sprintf('getBasename('.php'))); + $tokens = Tokens::fromCode(\sprintf('getBasename('.php'))); if ($tokens[3]->isKeyword() || $tokens[3]->isMagicConstant()) { // name cannot be a class name - detected by PHP 5.x @@ -139,12 +125,22 @@ public function supports(\SplFileInfo $file): bool } // ignore stubs/fixtures, since they typically contain invalid files for various reasons - return !Preg::match('{[/\\\\](stub|fixture)s?[/\\\\]}i', $file->getRealPath()); + return !Preg::match('{[/\\\](stub|fixture)s?[/\\\]}i', $file->getRealPath()); + } + + protected function configurePostNormalisation(): void + { + if (null !== $this->configuration['dir']) { + $realpath = realpath($this->configuration['dir']); + + if (false === $realpath) { + throw new \InvalidArgumentException(\sprintf('Failed to resolve configured directory "%s".', $this->configuration['dir'])); + } + + $this->configuration['dir'] = $realpath; + } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -155,9 +151,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokenAnalyzer = new TokensAnalyzer($tokens); @@ -248,7 +241,7 @@ private function calculateClassyName(\SplFileInfo $file, ?string $namespace, str $namespaceParts = array_reverse(explode('\\', $maxNamespace)); foreach ($namespaceParts as $namespacePart) { - $nameCandidate = sprintf('%s_%s', $namespacePart, $name); + $nameCandidate = \sprintf('%s_%s', $namespacePart, $name); if (strtolower($nameCandidate) !== strtolower(substr($currentName, -\strlen($nameCandidate)))) { break; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/SingleLineEmptyBodyFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/SingleLineEmptyBodyFixer.php new file mode 100644 index 00000000..c3a81769 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/SingleLineEmptyBodyFixer.php @@ -0,0 +1,83 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Basic; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +final class SingleLineEmptyBodyFixer extends AbstractFixer +{ + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Empty body of class, interface, trait, enum or function must be abbreviated as `{}` and placed on the same line as the previous symbol, separated by a single space.', + [new CodeSample('isTokenKindFound(T_ENUM)) { // @TODO: drop condition when PHP 8.1+ is required + return true; + } + + return $tokens->isAnyTokenKindsFound([T_INTERFACE, T_CLASS, T_FUNCTION, T_TRAIT]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + for ($index = $tokens->count() - 1; $index > 0; --$index) { + if (!$tokens[$index]->isGivenKind([...Token::getClassyTokenKinds(), T_FUNCTION])) { + continue; + } + + $openBraceIndex = $tokens->getNextTokenOfKind($index, ['{', ';']); + if (!$tokens[$openBraceIndex]->equals('{')) { + continue; + } + + $closeBraceIndex = $tokens->getNextNonWhitespace($openBraceIndex); + if (!$tokens[$closeBraceIndex]->equals('}')) { + continue; + } + + $tokens->ensureWhitespaceAtIndex($openBraceIndex + 1, 0, ''); + + $beforeOpenBraceIndex = $tokens->getPrevNonWhitespace($openBraceIndex); + if (!$tokens[$beforeOpenBraceIndex]->isGivenKind([T_COMMENT, T_DOC_COMMENT])) { + $tokens->ensureWhitespaceAtIndex($openBraceIndex - 1, 1, ' '); + } + } + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php index 8243617f..20b951d1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php @@ -19,7 +19,6 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; @@ -27,9 +26,6 @@ final class ClassReferenceNameCasingFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -40,24 +36,17 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $namespacesAnalyzer = new NamespacesAnalyzer(); $namespaceUsesAnalyzer = new NamespaceUsesAnalyzer(); $classNames = $this->getClassNames(); - foreach ($namespacesAnalyzer->getDeclarations($tokens) as $namespace) { + foreach ($tokens->getNamespaceDeclarations() as $namespace) { $uses = []; foreach ($namespaceUsesAnalyzer->getDeclarationsInNamespace($tokens, $namespace) as $use) { @@ -95,6 +84,10 @@ private function getClassReference(Tokens $tokens, NamespaceAnalysis $namespace) T_TRAIT, ]; + if (\defined('T_NULLSAFE_OBJECT_OPERATOR')) { // @TODO: drop condition when PHP 8.0+ is required + $notBeforeKinds[] = T_NULLSAFE_OBJECT_OPERATOR; + } + if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required $notBeforeKinds[] = T_ENUM; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php index b4fa37e0..00389a17 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php @@ -16,13 +16,13 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; @@ -30,9 +30,21 @@ * Fixer for constants case. * * @author Pol Dellaiera + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * case?: 'lower'|'upper' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * case: 'lower'|'upper' + * } */ final class ConstantCaseFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * Hold the function that will be used to convert the constants. * @@ -40,29 +52,6 @@ final class ConstantCaseFixer extends AbstractFixer implements ConfigurableFixer */ private $fixFunction; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - if ('lower' === $this->configuration['case']) { - $this->fixFunction = static function (string $content): string { - return strtolower($content); - }; - } - - if ('upper' === $this->configuration['case']) { - $this->fixFunction = static function (string $content): string { - return strtoupper($content); - }; - } - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -74,17 +63,22 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + if ('lower' === $this->configuration['case']) { + $this->fixFunction = static fn (string $content): string => strtolower($content); + } + + if ('upper' === $this->configuration['case']) { + $this->fixFunction = static fn (string $content): string => strtoupper($content); + } + } + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -95,82 +89,42 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $fixFunction = $this->fixFunction; + static $forbiddenPrevKinds = null; + if (null === $forbiddenPrevKinds) { + $forbiddenPrevKinds = [ + T_DOUBLE_COLON, + T_EXTENDS, + T_IMPLEMENTS, + T_INSTANCEOF, + T_NAMESPACE, + T_NEW, + T_NS_SEPARATOR, + ...Token::getObjectOperatorKinds(), + ]; + } foreach ($tokens as $index => $token) { - if (!$token->isNativeConstant()) { + if (!$token->equalsAny([[T_STRING, 'true'], [T_STRING, 'false'], [T_STRING, 'null']], false)) { continue; } - if ( - $this->isNeighbourAccepted($tokens, $tokens->getPrevMeaningfulToken($index)) - && $this->isNeighbourAccepted($tokens, $tokens->getNextMeaningfulToken($index)) - && !$this->isEnumCaseName($tokens, $index) - ) { - $tokens[$index] = new Token([$token->getId(), $fixFunction($token->getContent())]); + $prevIndex = $tokens->getPrevMeaningfulToken($index); + if ($tokens[$prevIndex]->isGivenKind($forbiddenPrevKinds)) { + continue; } - } - } - - private function isNeighbourAccepted(Tokens $tokens, int $index): bool - { - static $forbiddenTokens = null; - - if (null === $forbiddenTokens) { - $forbiddenTokens = array_merge( - [ - T_AS, - T_CLASS, - T_CONST, - T_EXTENDS, - T_IMPLEMENTS, - T_INSTANCEOF, - T_INSTEADOF, - T_INTERFACE, - T_NEW, - T_NS_SEPARATOR, - T_PAAMAYIM_NEKUDOTAYIM, - T_TRAIT, - T_USE, - CT::T_USE_TRAIT, - CT::T_USE_LAMBDA, - ], - Token::getObjectOperatorKinds() - ); - } - - $token = $tokens[$index]; - - if ($token->equalsAny(['{', '}'])) { - return false; - } - - return !$token->isGivenKind($forbiddenTokens); - } - private function isEnumCaseName(Tokens $tokens, int $index): bool - { - if (!\defined('T_ENUM') || !$tokens->isTokenKindFound(T_ENUM)) { // @TODO: drop condition when PHP 8.1+ is required - return false; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); + $nextIndex = $tokens->getNextMeaningfulToken($index); + if ($tokens[$nextIndex]->isGivenKind(T_PAAMAYIM_NEKUDOTAYIM) || $tokens[$nextIndex]->equalsAny(['='], false)) { + continue; + } - if (null === $prevIndex || !$tokens[$prevIndex]->isGivenKind(T_CASE)) { - return false; - } + if ($tokens[$prevIndex]->isGivenKind(T_CASE) && $tokens[$nextIndex]->equals(';')) { + continue; + } - if (!$tokens->isTokenKindFound(T_SWITCH)) { - return true; + $tokens[$index] = new Token([$token->getId(), ($this->fixFunction)($token->getContent())]); } - - $prevIndex = $tokens->getPrevTokenOfKind($prevIndex, [[T_ENUM], [T_SWITCH]]); - - return null !== $prevIndex && $tokens[$prevIndex]->isGivenKind(T_ENUM); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/IntegerLiteralCaseFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/IntegerLiteralCaseFixer.php index 5d262ffe..1d85abba 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/IntegerLiteralCaseFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/IntegerLiteralCaseFixer.php @@ -24,9 +24,6 @@ final class IntegerLiteralCaseFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -53,11 +50,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $content = $token->getContent(); - if (1 !== Preg::match('#^0[bxoBXO][0-9a-fA-F]+$#', $content)) { - continue; - } - - $newContent = '0'.strtolower($content[1]).strtoupper(substr($content, 2)); + $newContent = Preg::replaceCallback('#^0([boxBOX])([0-9a-fA-F_]+)$#', static fn ($matches) => '0'.strtolower($matches[1]).strtoupper($matches[2]), $content); if ($content === $newContent) { continue; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php index 304b10aa..53f98d15 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php @@ -28,14 +28,6 @@ */ final class LowercaseKeywordsFixer extends AbstractFixer { - /** - * @var int[] - */ - private static array $excludedTokens = [T_HALT_COMPILER]; - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -59,21 +51,15 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(Token::getKeywords()); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { - if ($token->isKeyword() && !$token->isGivenKind(self::$excludedTokens)) { + if ($token->isKeyword() && !$token->isGivenKind([T_HALT_COMPILER])) { $tokens[$index] = new Token([$token->getId(), strtolower($token->getContent())]); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php index 830a511d..7615b296 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php @@ -27,9 +27,6 @@ */ final class LowercaseStaticReferenceFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -87,7 +84,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } $prevIndex = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$prevIndex]->isGivenKind([T_CONST, T_DOUBLE_COLON, T_FUNCTION, T_NAMESPACE, T_NS_SEPARATOR]) || $tokens[$prevIndex]->isObjectOperator()) { + if ($tokens[$prevIndex]->isGivenKind([T_CONST, T_DOUBLE_COLON, T_FUNCTION, T_NAMESPACE, T_NS_SEPARATOR, T_STATIC, T_STRING, CT::T_ARRAY_TYPEHINT, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE]) || $tokens[$prevIndex]->isObjectOperator()) { continue; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php index 3cfae9bf..b8de332e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php @@ -27,9 +27,6 @@ */ final class MagicConstantCasingFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -38,17 +35,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound($this->getMagicConstantTokens()); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $magicConstants = $this->getMagicConstants(); @@ -86,7 +77,7 @@ private function getMagicConstants(): array } /** - * @return array + * @return list */ private function getMagicConstantTokens(): array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php index 9179845f..d8eaa3d0 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php @@ -24,9 +24,9 @@ final class MagicMethodCasingFixer extends AbstractFixer { /** - * @var array + * @var array */ - private static array $magicNames = [ + private const MAGIC_NAMES = [ '__call' => '__call', '__callstatic' => '__callStatic', '__clone' => '__clone', @@ -46,9 +46,6 @@ final class MagicMethodCasingFixer extends AbstractFixer '__wakeup' => '__wakeup', ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -73,17 +70,11 @@ public function __Sleep() ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - return $tokens->isTokenKindFound(T_STRING) && $tokens->isAnyTokenKindsFound(array_merge([T_FUNCTION, T_DOUBLE_COLON], Token::getObjectOperatorKinds())); + return $tokens->isTokenKindFound(T_STRING) && $tokens->isAnyTokenKindsFound([T_FUNCTION, T_DOUBLE_COLON, ...Token::getObjectOperatorKinds()]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $inClass = 0; @@ -186,17 +177,22 @@ private function isStaticMethodCall(Tokens $tokens, int $index): bool return $tokens[$tokens->getNextMeaningfulToken($index)]->equals('('); } + /** + * @phpstan-assert-if-true key-of $name + */ private function isMagicMethodName(string $name): bool { - return isset(self::$magicNames[$name]); + return isset(self::MAGIC_NAMES[$name]); } /** - * @param string $name name of a magic method + * @param key-of $name name of a magic method + * + * @return value-of */ private function getMagicMethodNameInCorrectCasing(string $name): string { - return self::$magicNames[$name]; + return self::MAGIC_NAMES[$name]; } private function setTokenToCorrectCasing(Tokens $tokens, int $index, string $nameInCorrectCasing): void diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionCasingFixer.php index cf0f68da..84c7c643 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionCasingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionCasingFixer.php @@ -24,9 +24,6 @@ final class NativeFunctionCasingFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -45,17 +42,11 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionsAnalyzer = new FunctionsAnalyzer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixer.php index 6ed3f08d..2b2d5094 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixer.php @@ -14,89 +14,21 @@ namespace PhpCsFixer\Fixer\Casing; -use PhpCsFixer\AbstractFixer; +use PhpCsFixer\AbstractProxyFixer; +use PhpCsFixer\Fixer\DeprecatedFixerInterface; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -final class NativeFunctionTypeDeclarationCasingFixer extends AbstractFixer +/** + * @deprecated in favor of NativeTypeDeclarationCasingFixer + */ +final class NativeFunctionTypeDeclarationCasingFixer extends AbstractProxyFixer implements DeprecatedFixerInterface { - /** - * https://secure.php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration. - * - * self PHP 5.0 - * array PHP 5.1 - * callable PHP 5.4 - * bool PHP 7.0 - * float PHP 7.0 - * int PHP 7.0 - * string PHP 7.0 - * iterable PHP 7.1 - * void PHP 7.1 - * object PHP 7.2 - * static PHP 8.0 (return type only) - * mixed PHP 8.0 - * false PHP 8.0 (union return type only) - * null PHP 8.0 (union return type only) - * never PHP 8.1 (return type only) - * true PHP 8.2 (standalone type: https://wiki.php.net/rfc/true-type) - * false PHP 8.2 (standalone type: https://wiki.php.net/rfc/null-false-standalone-types) - * null PHP 8.2 (standalone type: https://wiki.php.net/rfc/null-false-standalone-types) - * - * @var array - */ - private array $hints; - - private FunctionsAnalyzer $functionsAnalyzer; - - public function __construct() - { - parent::__construct(); - - $this->hints = [ - 'array' => true, - 'bool' => true, - 'callable' => true, - 'float' => true, - 'int' => true, - 'iterable' => true, - 'object' => true, - 'self' => true, - 'string' => true, - 'void' => true, - ]; - - if (\PHP_VERSION_ID >= 8_00_00) { - $this->hints['false'] = true; - $this->hints['mixed'] = true; - $this->hints['null'] = true; - $this->hints['static'] = true; - } - - if (\PHP_VERSION_ID >= 8_01_00) { - $this->hints['never'] = true; - } - - if (\PHP_VERSION_ID >= 8_02_00) { - $this->hints['true'] = true; - } - - $this->functionsAnalyzer = new FunctionsAnalyzer(); - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Native type hints for functions should use the correct case.', + 'Native type declarations for functions should use the correct case.', [ new CodeSample("isAnyTokenKindsFound([T_FUNCTION, T_FN]); + return array_keys($this->proxyFixers); } - /** - * {@inheritdoc} - */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + protected function createProxyFixers(): array { - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if ($tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) { - $this->fixFunctionReturnType($tokens, $index); - $this->fixFunctionArgumentTypes($tokens, $index); - } - } - } - - private function fixFunctionArgumentTypes(Tokens $tokens, int $index): void - { - foreach ($this->functionsAnalyzer->getFunctionArguments($tokens, $index) as $argument) { - $this->fixArgumentType($tokens, $argument->getTypeAnalysis()); - } - } - - private function fixFunctionReturnType(Tokens $tokens, int $index): void - { - $this->fixArgumentType($tokens, $this->functionsAnalyzer->getFunctionReturnType($tokens, $index)); - } - - private function fixArgumentType(Tokens $tokens, ?TypeAnalysis $type = null): void - { - if (null === $type) { - return; - } - - for ($index = $type->getStartIndex(); $index <= $type->getEndIndex(); ++$index) { - if ($tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(T_NS_SEPARATOR)) { - continue; - } - - $lowerCasedName = strtolower($tokens[$index]->getContent()); - - if (!isset($this->hints[$lowerCasedName])) { - continue; - } + $fixer = new NativeTypeDeclarationCasingFixer(); - $tokens[$index] = new Token([$tokens[$index]->getId(), $lowerCasedName]); - } + return [$fixer]; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php new file mode 100644 index 00000000..e46f10df --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php @@ -0,0 +1,360 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Casing; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\FixerDefinition\VersionSpecification; +use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; +use PhpCsFixer\Tokenizer\TokensAnalyzer; + +final class NativeTypeDeclarationCasingFixer extends AbstractFixer +{ + /* + * https://wiki.php.net/rfc/typed_class_constants + * Supported types + * Class constant type declarations support all type declarations supported by PHP, + * except `void`, `callable`, `never`. + * + * array + * bool + * callable + * float + * int + * iterable + * object + * mixed + * parent + * self + * string + * any class or interface name -> not native, so not applicable for this Fixer + * ?type -> not native, `?` has no casing, so not applicable for this Fixer + * + * Not in the list referenced but supported: + * null + * static + */ + private const CLASS_CONST_SUPPORTED_HINTS = [ + 'array' => true, + 'bool' => true, + 'float' => true, + 'int' => true, + 'iterable' => true, + 'mixed' => true, + 'null' => true, + 'object' => true, + 'parent' => true, + 'self' => true, + 'string' => true, + 'static' => true, + ]; + + private const CLASS_PROPERTY_SUPPORTED_HINTS = [ + 'array' => true, + 'bool' => true, + 'float' => true, + 'int' => true, + 'iterable' => true, + 'mixed' => true, + 'null' => true, + 'object' => true, + 'parent' => true, + 'self' => true, + 'static' => true, + 'string' => true, + ]; + + private const TYPE_SEPARATION_TYPES = [ + CT::T_TYPE_ALTERNATION, + CT::T_TYPE_INTERSECTION, + CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, + CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, + ]; + + /** + * https://secure.php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration. + * + * self PHP 5.0 + * array PHP 5.1 + * callable PHP 5.4 + * bool PHP 7.0 + * float PHP 7.0 + * int PHP 7.0 + * string PHP 7.0 + * iterable PHP 7.1 + * void PHP 7.1 + * object PHP 7.2 + * static PHP 8.0 (return type only) + * mixed PHP 8.0 + * false PHP 8.0 (union return type only) + * null PHP 8.0 (union return type only) + * never PHP 8.1 (return type only) + * true PHP 8.2 (standalone type: https://wiki.php.net/rfc/true-type) + * false PHP 8.2 (standalone type: https://wiki.php.net/rfc/null-false-standalone-types) + * null PHP 8.2 (standalone type: https://wiki.php.net/rfc/null-false-standalone-types) + * + * @var array + */ + private array $functionTypeHints; + + private FunctionsAnalyzer $functionsAnalyzer; + + /** + * @var list + */ + private array $beforePropertyTypeTokens; + + public function __construct() + { + parent::__construct(); + + $this->beforePropertyTypeTokens = ['{', ';', [T_PRIVATE], [T_PROTECTED], [T_PUBLIC], [T_VAR]]; + + $this->functionTypeHints = [ + 'array' => true, + 'bool' => true, + 'callable' => true, + 'float' => true, + 'int' => true, + 'iterable' => true, + 'object' => true, + 'self' => true, + 'string' => true, + 'void' => true, + ]; + + if (\PHP_VERSION_ID >= 8_00_00) { + $this->functionTypeHints['false'] = true; + $this->functionTypeHints['mixed'] = true; + $this->functionTypeHints['null'] = true; + $this->functionTypeHints['static'] = true; + } + + if (\PHP_VERSION_ID >= 8_01_00) { + $this->functionTypeHints['never'] = true; + + $this->beforePropertyTypeTokens[] = [T_READONLY]; + } + + if (\PHP_VERSION_ID >= 8_02_00) { + $this->functionTypeHints['true'] = true; + } + + $this->functionsAnalyzer = new FunctionsAnalyzer(); + } + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Native type declarations should be used in the correct case.', + [ + new CodeSample( + "isAnyTokenKindsFound(Token::getClassyTokenKinds()); + + return + $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]) + || ($classyFound && $tokens->isTokenKindFound(T_STRING)) + || ( + \PHP_VERSION_ID >= 8_03_00 + && $tokens->isTokenKindFound(T_CONST) + && $classyFound + ); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $this->fixFunctions($tokens); + $this->fixClassConstantsAndProperties($tokens); + } + + private function fixFunctions(Tokens $tokens): void + { + for ($index = $tokens->count() - 1; $index >= 0; --$index) { + if ($tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) { + $this->fixFunctionReturnType($tokens, $index); + $this->fixFunctionArgumentTypes($tokens, $index); + } + } + } + + private function fixFunctionArgumentTypes(Tokens $tokens, int $index): void + { + foreach ($this->functionsAnalyzer->getFunctionArguments($tokens, $index) as $argument) { + $this->fixArgumentType($tokens, $argument->getTypeAnalysis()); + } + } + + private function fixFunctionReturnType(Tokens $tokens, int $index): void + { + $this->fixArgumentType($tokens, $this->functionsAnalyzer->getFunctionReturnType($tokens, $index)); + } + + private function fixArgumentType(Tokens $tokens, ?TypeAnalysis $type = null): void + { + if (null === $type) { + return; + } + + for ($index = $type->getStartIndex(); $index <= $type->getEndIndex(); ++$index) { + if ($tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(T_NS_SEPARATOR)) { + continue; + } + + $this->fixCasing($this->functionTypeHints, $tokens, $index); + } + } + + private function fixClassConstantsAndProperties(Tokens $tokens): void + { + $analyzer = new TokensAnalyzer($tokens); + $elements = array_reverse($analyzer->getClassyElements(), true); + + foreach ($elements as $index => $element) { + if ('const' === $element['type']) { + if (\PHP_VERSION_ID >= 8_03_00 && !$this->isConstWithoutType($tokens, $index)) { + foreach ($this->getNativeTypeHintCandidatesForConstant($tokens, $index) as $nativeTypeHintIndex) { + $this->fixCasing($this::CLASS_CONST_SUPPORTED_HINTS, $tokens, $nativeTypeHintIndex); + } + } + + continue; + } + + if ('property' === $element['type']) { + foreach ($this->getNativeTypeHintCandidatesForProperty($tokens, $index) as $nativeTypeHintIndex) { + $this->fixCasing($this::CLASS_PROPERTY_SUPPORTED_HINTS, $tokens, $nativeTypeHintIndex); + } + } + } + } + + /** @return iterable */ + private function getNativeTypeHintCandidatesForConstant(Tokens $tokens, int $index): iterable + { + $constNameIndex = $this->getConstNameIndex($tokens, $index); + $index = $this->getFirstIndexOfType($tokens, $index); + + do { + $typeEnd = $this->getTypeEnd($tokens, $index, $constNameIndex); + + if ($typeEnd === $index) { + yield $index; + } + + do { + $index = $tokens->getNextMeaningfulToken($index); + } while ($tokens[$index]->isGivenKind(self::TYPE_SEPARATION_TYPES)); + } while ($index < $constNameIndex); + } + + private function isConstWithoutType(Tokens $tokens, int $index): bool + { + $index = $tokens->getNextMeaningfulToken($index); + + return $tokens[$index]->isGivenKind(T_STRING) && $tokens[$tokens->getNextMeaningfulToken($index)]->equals('='); + } + + private function getConstNameIndex(Tokens $tokens, int $index): int + { + return $tokens->getPrevMeaningfulToken( + $tokens->getNextTokenOfKind($index, ['=']), + ); + } + + /** @return iterable */ + private function getNativeTypeHintCandidatesForProperty(Tokens $tokens, int $index): iterable + { + $propertyNameIndex = $index; + $index = $tokens->getPrevTokenOfKind($index, $this->beforePropertyTypeTokens); + + $index = $this->getFirstIndexOfType($tokens, $index); + + do { + $typeEnd = $this->getTypeEnd($tokens, $index, $propertyNameIndex); + + if ($typeEnd === $index) { + yield $index; + } + + do { + $index = $tokens->getNextMeaningfulToken($index); + } while ($tokens[$index]->isGivenKind(self::TYPE_SEPARATION_TYPES)); + } while ($index < $propertyNameIndex); + + return []; + } + + private function getFirstIndexOfType(Tokens $tokens, int $index): int + { + $index = $tokens->getNextMeaningfulToken($index); + + if ($tokens[$index]->isGivenKind(CT::T_NULLABLE_TYPE)) { + $index = $tokens->getNextMeaningfulToken($index); + } + + if ($tokens[$index]->isGivenKind(CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN)) { + $index = $tokens->getNextMeaningfulToken($index); + } + + return $index; + } + + private function getTypeEnd(Tokens $tokens, int $index, int $upperLimit): int + { + if (!$tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR])) { + return $index; // callable, array, self, static, etc. + } + + $endIndex = $index; + while ($tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR]) && $index < $upperLimit) { + $endIndex = $index; + $index = $tokens->getNextMeaningfulToken($index); + } + + return $endIndex; + } + + /** + * @param array $supportedTypeHints + */ + private function fixCasing(array $supportedTypeHints, Tokens $tokens, int $index): void + { + $typeContent = $tokens[$index]->getContent(); + $typeContentLower = strtolower($typeContent); + + if (isset($supportedTypeHints[$typeContentLower]) && $typeContent !== $typeContentLower) { + $tokens[$index] = new Token([$tokens[$index]->getId(), $typeContentLower]); + } + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/CastSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/CastSpacesFixer.php index 09c65e9c..11ee3732 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/CastSpacesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/CastSpacesFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -27,9 +28,21 @@ /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * space?: 'none'|'single' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * space: 'none'|'single' + * } */ final class CastSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + private const INSIDE_CAST_SPACE_REPLACE_MAP = [ ' ' => '', "\t" => '', @@ -39,9 +52,6 @@ final class CastSpacesFixer extends AbstractFixer implements ConfigurableFixerIn "\x0B" => '', ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -72,17 +82,11 @@ public function getPriority(): int return -10; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(Token::getCastTokenKinds()); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -115,9 +119,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/LowercaseCastFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/LowercaseCastFixer.php index ca9b139f..e50db282 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/LowercaseCastFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/LowercaseCastFixer.php @@ -15,24 +15,20 @@ namespace PhpCsFixer\Fixer\CastNotation; use PhpCsFixer\AbstractFixer; +use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; final class LowercaseCastFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'Cast should be written in lower case.', [ - new VersionSpecificCodeSample( + new CodeSample( 'isAnyTokenKindsFound(Token::getCastTokenKinds()); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = 0, $count = $tokens->count(); $index < $count; ++$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ModernizeTypesCastingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ModernizeTypesCastingFixer.php index 86986b01..75f2a437 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ModernizeTypesCastingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ModernizeTypesCastingFixer.php @@ -27,9 +27,6 @@ */ final class ModernizeTypesCastingFixer extends AbstractFunctionReferenceFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -60,9 +57,6 @@ public function getPriority(): int return 31; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { // replacement patterns diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoShortBoolCastFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoShortBoolCastFixer.php index d802d495..80439c17 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoShortBoolCastFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoShortBoolCastFixer.php @@ -33,9 +33,6 @@ public function getPriority(): int return -9; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -44,17 +41,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound('!'); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = \count($tokens) - 1; $index > 1; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoUnsetCastFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoUnsetCastFixer.php index c75f8ba4..81c1567f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoUnsetCastFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoUnsetCastFixer.php @@ -23,9 +23,6 @@ final class NoUnsetCastFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -34,9 +31,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_UNSET_CAST); @@ -52,9 +46,6 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = \count($tokens) - 1; $index > 0; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ShortScalarCastFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ShortScalarCastFixer.php index fea0e6ef..934d8a89 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ShortScalarCastFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ShortScalarCastFixer.php @@ -15,46 +15,31 @@ namespace PhpCsFixer\Fixer\CastNotation; use PhpCsFixer\AbstractFixer; +use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; final class ShortScalarCastFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'Cast `(boolean)` and `(integer)` should be written as `(bool)` and `(int)`, `(double)` and `(real)` as `(float)`, `(binary)` as `(string)`.', [ - new VersionSpecificCodeSample( - "isAnyTokenKindsFound(Token::getCastTokenKinds()); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { static $castMap = [ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php index 4a0791fa..c72398d1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -30,15 +31,36 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; +use PhpCsFixer\Utils; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; /** * Make sure there is one blank line above and below class elements. * * The exception is when an element is the first or last item in a 'classy'. + * + * @phpstan-type _Class array{ + * index: int, + * open: int, + * close: int, + * elements: non-empty-list<_Element> + * } + * @phpstan-type _Element array{token: Token, type: string, index: int, start?: int, end?: int} + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * elements?: array + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * elements: array + * } */ final class ClassAttributesSeparationFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -56,23 +78,6 @@ final class ClassAttributesSeparationFixer extends AbstractFixer implements Conf */ private array $classElementTypes = []; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->classElementTypes = []; // reset previous configuration - - foreach ($this->configuration['elements'] as $elementType => $spacing) { - $this->classElementTypes[$elementType] = $spacing; - } - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -164,17 +169,20 @@ public function getPriority(): int return 55; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->classElementTypes = []; // reset previous configuration + + foreach ($this->configuration['elements'] as $elementType => $spacing) { + $this->classElementTypes[$elementType] = $spacing; + } + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($this->getElementsByClass($tokens) as $class) { @@ -198,23 +206,20 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('elements', 'Dictionary of `const|method|property|trait_import|case` => `none|one|only_if_meta` values.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['array']) ->setAllowedValues([static function (array $option): bool { foreach ($option as $type => $spacing) { $supportedTypes = ['const', 'method', 'property', 'trait_import', 'case']; if (!\in_array($type, $supportedTypes, true)) { throw new InvalidOptionsException( - sprintf( - 'Unexpected element type, expected any of "%s", got "%s".', - implode('", "', $supportedTypes), + \sprintf( + 'Unexpected element type, expected any of %s, got "%s".', + Utils::naturalLanguageJoin($supportedTypes), \gettype($type).'#'.$type ) ); @@ -224,10 +229,10 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn if (!\in_array($spacing, $supportedSpacings, true)) { throw new InvalidOptionsException( - sprintf( - 'Unexpected spacing for element type "%s", expected any of "%s", got "%s".', + \sprintf( + 'Unexpected spacing for element type "%s", expected any of %s, got "%s".', $spacing, - implode('", "', $supportedSpacings), + Utils::naturalLanguageJoin($supportedSpacings), \is_object($spacing) ? \get_class($spacing) : (null === $spacing ? 'null' : \gettype($spacing).'#'.$spacing) ) ); @@ -252,6 +257,8 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn * * Deals with comments, PHPDocs and spaces above the element with respect to the position of the * element within the class, interface or trait. + * + * @param _Class $class */ private function fixSpaceAboveClassElement(Tokens $tokens, array $class, int $elementIndex): void { @@ -322,6 +329,9 @@ private function fixSpaceAboveClassElement(Tokens $tokens, array $class, int $el $this->correctLineBreaks($tokens, $nonWhiteAbove, $element['start'], $this->determineRequiredLineCount($tokens, $class, $elementIndex)); } + /** + * @param _Class $class + */ private function determineRequiredLineCount(Tokens $tokens, array $class, int $elementIndex): int { $type = $class['elements'][$elementIndex]['type']; @@ -353,9 +363,12 @@ private function determineRequiredLineCount(Tokens $tokens, array $class, int $e return $tokens[$aboveElementDocCandidateIndex]->isGivenKind([T_DOC_COMMENT, CT::T_ATTRIBUTE_CLOSE]) ? 2 : 1; } - throw new \RuntimeException(sprintf('Unknown spacing "%s".', $spacing)); + throw new \RuntimeException(\sprintf('Unknown spacing "%s".', $spacing)); } + /** + * @param _Class $class + */ private function fixSpaceBelowClassElement(Tokens $tokens, array $class): void { $element = $class['elements'][0]; @@ -454,20 +467,17 @@ private function findCommentBlockStart(Tokens $tokens, int $start, int $elementA return $start; } + /** + * @TODO Introduce proper DTO instead of an array + * + * @return \Generator<_Class> + */ private function getElementsByClass(Tokens $tokens): \Generator { $tokensAnalyzer = new TokensAnalyzer($tokens); $class = $classIndex = false; - $elements = $tokensAnalyzer->getClassyElements(); - - for (end($elements);; prev($elements)) { - $index = key($elements); - - if (null === $index) { - break; - } - $element = current($elements); + foreach (array_reverse($tokensAnalyzer->getClassyElements(), true) as $index => $element) { $element['index'] = $index; if ($element['classIndex'] !== $classIndex) { @@ -498,9 +508,15 @@ private function getElementsByClass(Tokens $tokens): \Generator } } + /** + * including trailing single line comments if belonging to the class element. + * + * @param _Class $class + * @param _Element $element + */ private function getFirstTokenIndexOfClassElement(Tokens $tokens, array $class, array $element): int { - $modifierTypes = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_ABSTRACT, T_FINAL, T_STATIC, T_STRING, T_NS_SEPARATOR, T_VAR, CT::T_NULLABLE_TYPE, CT::T_ARRAY_TYPEHINT, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION]; + $modifierTypes = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_ABSTRACT, T_FINAL, T_STATIC, T_STRING, T_NS_SEPARATOR, T_VAR, CT::T_NULLABLE_TYPE, CT::T_ARRAY_TYPEHINT, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE]; if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required $modifierTypes[] = T_READONLY; @@ -521,7 +537,12 @@ private function getFirstTokenIndexOfClassElement(Tokens $tokens, array $class, return $firstElementAttributeIndex; } - // including trailing single line comments if belonging to the class element + /** + * including trailing single line comments if belonging to the class element. + * + * @param _Class $class + * @param _Element $element + */ private function getLastTokenIndexOfClassElement(Tokens $tokens, array $class, array $element, TokensAnalyzer $tokensAnalyzer): int { // find last token of the element diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php index f6b8dfcf..8ff8b030 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -23,18 +24,39 @@ use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; /** * Fixer for part of the rules defined in PSR2 ¶4.1 Extends and Implements and PSR12 ¶8. Anonymous Classes. + * + * @phpstan-type _ClassExtendsInfo array{start: int, numberOfExtends: int, multiLine: bool} + * @phpstan-type _ClassImplementsInfo array{start: int, numberOfImplements: int, multiLine: bool} + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * inline_constructor_arguments?: bool, + * multi_line_extends_each_single_line?: bool, + * single_item_single_line?: bool, + * single_line?: bool, + * space_before_parenthesis?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * inline_constructor_arguments: bool, + * multi_line_extends_each_single_line: bool, + * single_item_single_line: bool, + * single_line: bool, + * space_before_parenthesis: bool + * } */ final class ClassDefinitionFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -104,25 +126,19 @@ interface Bar extends /** * {@inheritdoc} * - * Must run before BracesFixer. - * Must run after NewWithBracesFixer. + * Must run before BracesFixer, SingleLineEmptyBodyFixer. + * Must run after NewWithBracesFixer, NewWithParenthesesFixer. */ public function getPriority(): int { return 36; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { // -4, one for count to index, 3 because min. of tokens for a classy location. @@ -133,9 +149,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -201,7 +214,7 @@ private function fixClassyDefinition(Tokens $tokens, int $classyIndex): void $end = $tokens->getPrevNonWhitespace($classDefInfo['open']); } - if ($classDefInfo['anonymousClass'] && !$this->configuration['inline_constructor_arguments']) { + if ($classDefInfo['anonymousClass'] && false === $this->configuration['inline_constructor_arguments']) { if (!$tokens[$end]->equals(')')) { // anonymous class with `extends` and/or `implements` $start = $tokens->getPrevMeaningfulToken($end); $this->makeClassyDefinitionSingleLine($tokens, $start, $end); @@ -219,6 +232,11 @@ private function fixClassyDefinition(Tokens $tokens, int $classyIndex): void $this->sortClassModifiers($tokens, $classDefInfo); } + /** + * @param _ClassExtendsInfo $classExtendsInfo + * + * @return _ClassExtendsInfo + */ private function fixClassyDefinitionExtends(Tokens $tokens, int $classOpenIndex, array $classExtendsInfo): array { $endIndex = $tokens->getPrevNonWhitespace($classOpenIndex); @@ -237,6 +255,11 @@ private function fixClassyDefinitionExtends(Tokens $tokens, int $classOpenIndex, return $classExtendsInfo; } + /** + * @param _ClassImplementsInfo $classImplementsInfo + * + * @return _ClassImplementsInfo + */ private function fixClassyDefinitionImplements(Tokens $tokens, int $classOpenIndex, array $classImplementsInfo): array { $endIndex = $tokens->getPrevNonWhitespace($classOpenIndex); @@ -255,6 +278,19 @@ private function fixClassyDefinitionImplements(Tokens $tokens, int $classOpenInd return $classImplementsInfo; } + /** + * @param array{ + * start: int, + * classy: int, + * open: int, + * extends: false|_ClassExtendsInfo, + * implements: false|_ClassImplementsInfo, + * anonymousClass: bool, + * final: false|int, + * abstract: false|int, + * readonly: false|int, + * } $classDefInfo + */ private function fixClassyDefinitionOpenSpacing(Tokens $tokens, array $classDefInfo): int { if ($classDefInfo['anonymousClass']) { @@ -293,8 +329,8 @@ private function fixClassyDefinitionOpenSpacing(Tokens $tokens, array $classDefI * start: int, * classy: int, * open: int, - * extends: false|array{start: int, numberOfExtends: int, multiLine: bool}, - * implements: false|array{start: int, numberOfImplements: int, multiLine: bool}, + * extends: false|_ClassExtendsInfo, + * implements: false|_ClassImplementsInfo, * anonymousClass: bool, * final: false|int, * abstract: false|int, @@ -318,17 +354,17 @@ private function getClassyDefinitionInfo(Tokens $tokens, int $classyIndex): arra if (!$tokens[$classyIndex]->isGivenKind(T_TRAIT)) { $extends = $tokens->findGivenKind(T_EXTENDS, $classyIndex, $openIndex); - $def['extends'] = \count($extends) ? $this->getClassyInheritanceInfo($tokens, key($extends), 'numberOfExtends') : false; + $def['extends'] = [] !== $extends ? $this->getClassyInheritanceInfo($tokens, array_key_first($extends), 'numberOfExtends') : false; if (!$tokens[$classyIndex]->isGivenKind(T_INTERFACE)) { $implements = $tokens->findGivenKind(T_IMPLEMENTS, $classyIndex, $openIndex); - $def['implements'] = \count($implements) ? $this->getClassyInheritanceInfo($tokens, key($implements), 'numberOfImplements') : false; + $def['implements'] = [] !== $implements ? $this->getClassyInheritanceInfo($tokens, array_key_first($implements), 'numberOfImplements') : false; $def['anonymousClass'] = $tokensAnalyzer->isAnonymousClass($classyIndex); } } if ($def['anonymousClass']) { - $startIndex = $tokens->getPrevMeaningfulToken($classyIndex); // go to "new" for anonymous class + $startIndex = $tokens->getPrevTokenOfKind($classyIndex, [[T_NEW]]); // go to "new" for anonymous class } else { $modifiers = $tokensAnalyzer->getClassyModifiers($classyIndex); $startIndex = $classyIndex; @@ -348,6 +384,9 @@ private function getClassyDefinitionInfo(Tokens $tokens, int $classyIndex): arra return $def; } + /** + * @return array|array{start: int, multiLine: bool} + */ private function getClassyInheritanceInfo(Tokens $tokens, int $startIndex, string $label): array { $implementsInfo = ['start' => $startIndex, $label => 1, 'multiLine' => false]; @@ -374,15 +413,37 @@ private function makeClassyDefinitionSingleLine(Tokens $tokens, int $startIndex, { for ($i = $endIndex; $i >= $startIndex; --$i) { if ($tokens[$i]->isWhitespace()) { - if ($tokens[$i - 1]->isComment() || $tokens[$i + 1]->isComment()) { + if (str_contains($tokens[$i]->getContent(), "\n")) { + if (\defined('T_ATTRIBUTE')) { // @TODO: drop condition and else when PHP 8.0+ is required + if ($tokens[$i - 1]->isGivenKind(CT::T_ATTRIBUTE_CLOSE) || $tokens[$i + 1]->isGivenKind(T_ATTRIBUTE)) { + continue; + } + } else { + if (($tokens[$i - 1]->isComment() && str_ends_with($tokens[$i - 1]->getContent(), ']')) + || ($tokens[$i + 1]->isComment() && str_starts_with($tokens[$i + 1]->getContent(), '#[')) + ) { + continue; + } + } + + if ($tokens[$i - 1]->isGivenKind(T_DOC_COMMENT) || $tokens[$i + 1]->isGivenKind(T_DOC_COMMENT)) { + continue; + } + } + + if ($tokens[$i - 1]->isComment()) { $content = $tokens[$i - 1]->getContent(); + if (!str_starts_with($content, '//') && !str_starts_with($content, '#')) { + $tokens[$i] = new Token([T_WHITESPACE, ' ']); + } - if (!('#' === $content || str_starts_with($content, '//'))) { - $content = $tokens[$i + 1]->getContent(); + continue; + } - if (!('#' === $content || str_starts_with($content, '//'))) { - $tokens[$i] = new Token([T_WHITESPACE, ' ']); - } + if ($tokens[$i + 1]->isComment()) { + $content = $tokens[$i + 1]->getContent(); + if (!str_starts_with($content, '//')) { + $tokens[$i] = new Token([T_WHITESPACE, ' ']); } continue; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalClassFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalClassFixer.php index 5372ca76..c79a1008 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalClassFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalClassFixer.php @@ -24,9 +24,6 @@ */ final class FinalClassFixer extends AbstractProxyFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -42,19 +39,26 @@ class MyApp {} .'If you want to subclass a class, mark the parent class as abstract and create two child classes, one empty if necessary: you\'ll gain much more fine grained type-hinting. ' .'If you need to mock a standalone class, create an interface, or maybe it\'s a value-object that shouldn\'t be mocked at all. ' .'If you need to extend a standalone class, create an interface and use the Composite pattern. ' - .'If you aren\'t ready yet for serious OOP, go with FinalInternalClassFixer, it\'s fine.', + .'If these rules are too strict for you, you can use `FinalInternalClassFixer` instead.', 'Risky when subclassing non-abstract classes.' ); } /** * {@inheritdoc} + * + * Must run before ProtectedToPrivateFixer, SelfStaticAccessorFixer. */ + public function getPriority(): int + { + return parent::getPriority(); + } + protected function createProxyFixers(): array { $fixer = new FinalInternalClassFixer(); $fixer->configure([ - 'annotation_include' => [], + 'include' => [], 'consider_absent_docblock_as_internal_class' => true, ]); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php index 19880988..44278aa5 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php @@ -18,6 +18,7 @@ use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -25,36 +26,62 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; +use PhpCsFixer\Utils; use Symfony\Component\OptionsResolver\Options; /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * annotation_exclude?: list, + * annotation_include?: list, + * consider_absent_docblock_as_internal_class?: bool, + * exclude?: list, + * include?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * annotation_exclude: array, + * annotation_include: array, + * consider_absent_docblock_as_internal_class: bool, + * exclude: array, + * include: array + * } */ final class FinalInternalClassFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + private const DEFAULTS = [ + 'include' => [ + 'internal', + ], + 'exclude' => [ + 'final', + 'Entity', + 'ORM\Entity', + 'ORM\Mapping\Entity', + 'Mapping\Entity', + 'Document', + 'ODM\Document', + ], + ]; + + private bool $checkAttributes; + + public function __construct() { - parent::configure($configuration); - - $intersect = array_intersect_assoc( - $this->configuration['annotation_include'], - $this->configuration['annotation_exclude'] - ); + parent::__construct(); - if (\count($intersect) > 0) { - throw new InvalidFixerConfigurationException($this->getName(), sprintf('Annotation cannot be used in both the include and exclude list, got duplicates: "%s".', implode('", "', array_keys($intersect)))); - } + $this->checkAttributes = \PHP_VERSION_ID >= 8_00_00; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -64,8 +91,8 @@ public function getDefinition(): FixerDefinitionInterface new CodeSample( " ['@Custom'], - 'annotation_exclude' => ['@not-fix'], + 'include' => ['@Custom'], + 'exclude' => ['@not-fix'], ] ), ], @@ -85,25 +112,21 @@ public function getPriority(): int return 67; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_CLASS); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->assertConfigHasNoConflicts(); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); @@ -113,25 +136,21 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - // make class final - $tokens->insertAt( - $index, - [ + // make class 'final' + $tokens->insertSlices([ + $index => [ new Token([T_FINAL, 'final']), new Token([T_WHITESPACE, ' ']), - ] - ); + ], + ]); } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $annotationsAsserts = [static function (array $values): bool { foreach ($values as $value) { - if (!\is_string($value) || '' === $value) { + if ('' === $value) { return false; } } @@ -153,24 +172,40 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn }; return new FixerConfigurationResolver([ - (new FixerOptionBuilder('annotation_include', 'Class level annotations tags that must be set in order to fix the class (case insensitive).')) - ->setAllowedTypes(['array']) + (new FixerOptionBuilder('annotation_include', 'Class level attribute or annotation tags that must be set in order to fix the class (case insensitive).')) + ->setAllowedTypes(['string[]']) + ->setAllowedValues($annotationsAsserts) + ->setDefault( + array_map( + static fn (string $string) => '@'.$string, + self::DEFAULTS['include'], + ), + ) + ->setNormalizer($annotationsNormalizer) + ->setDeprecationMessage('Use `include` to configure PHPDoc annotations tags and attributes.') + ->getOption(), + (new FixerOptionBuilder('annotation_exclude', 'Class level attribute or annotation tags that must be omitted to fix the class, even if all of the white list ones are used as well (case insensitive).')) + ->setAllowedTypes(['string[]']) ->setAllowedValues($annotationsAsserts) - ->setDefault(['@internal']) + ->setDefault( + array_map( + static fn (string $string) => '@'.$string, + self::DEFAULTS['exclude'], + ), + ) ->setNormalizer($annotationsNormalizer) + ->setDeprecationMessage('Use `exclude` to configure PHPDoc annotations tags and attributes.') ->getOption(), - (new FixerOptionBuilder('annotation_exclude', 'Class level annotations tags that must be omitted to fix the class, even if all of the white list ones are used as well (case insensitive).')) - ->setAllowedTypes(['array']) + (new FixerOptionBuilder('include', 'Class level attribute or annotation tags that must be set in order to fix the class (case insensitive).')) + ->setAllowedTypes(['string[]']) ->setAllowedValues($annotationsAsserts) - ->setDefault([ - '@final', - '@Entity', - '@ORM\Entity', - '@ORM\Mapping\Entity', - '@Mapping\Entity', - '@Document', - '@ODM\Document', - ]) + ->setDefault(self::DEFAULTS['include']) + ->setNormalizer($annotationsNormalizer) + ->getOption(), + (new FixerOptionBuilder('exclude', 'Class level attribute or annotation tags that must be omitted to fix the class, even if all of the white list ones are used as well (case insensitive).')) + ->setAllowedTypes(['string[]']) + ->setAllowedValues($annotationsAsserts) + ->setDefault(self::DEFAULTS['exclude']) ->setNormalizer($annotationsNormalizer) ->getOption(), (new FixerOptionBuilder('consider_absent_docblock_as_internal_class', 'Whether classes without any DocBlock should be fixed to final.')) @@ -195,37 +230,145 @@ private function isClassCandidate(TokensAnalyzer $tokensAnalyzer, Tokens $tokens return false; // ignore class; it is abstract or already final } - $docToken = $tokens[$tokens->getPrevNonWhitespace($index)]; + $decisions = []; + $currentIndex = $index; - if (!$docToken->isGivenKind(T_DOC_COMMENT)) { - return $this->configuration['consider_absent_docblock_as_internal_class']; + $acceptTypes = [ + CT::T_ATTRIBUTE_CLOSE, + T_DOC_COMMENT, + T_COMMENT, // Skip comments + ]; + + if (\defined('T_READONLY')) { + // Skip readonly classes for PHP 8.2+ + $acceptTypes[] = T_READONLY; } - $doc = new DocBlock($docToken->getContent()); + while ($currentIndex) { + $currentIndex = $tokens->getPrevNonWhitespace($currentIndex); + + if (!$tokens[$currentIndex]->isGivenKind($acceptTypes)) { + break; + } + + if ($this->checkAttributes && $tokens[$currentIndex]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { + $attributeStartIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $currentIndex); + $decisions[] = $this->isClassCandidateBasedOnAttribute($tokens, $attributeStartIndex, $currentIndex); + + $currentIndex = $attributeStartIndex; + } + + if ($tokens[$currentIndex]->isGivenKind([T_DOC_COMMENT])) { + $decisions[] = $this->isClassCandidateBasedOnPhpDoc($tokens, $currentIndex); + } + } + + if (\in_array(false, $decisions, true)) { + return false; + } + + return \in_array(true, $decisions, true) + || ([] === $decisions && true === $this->configuration['consider_absent_docblock_as_internal_class']); + } + + private function isClassCandidateBasedOnPhpDoc(Tokens $tokens, int $index): ?bool + { + $doc = new DocBlock($tokens[$index]->getContent()); $tags = []; foreach ($doc->getAnnotations() as $annotation) { - if (1 !== Preg::match('/@\S+(?=\s|$)/', $annotation->getContent(), $matches)) { + if (!Preg::match('/@([^\(\s]+)/', $annotation->getContent(), $matches)) { continue; } - $tag = strtolower(substr(array_shift($matches), 1)); - foreach ($this->configuration['annotation_exclude'] as $tagStart => $true) { - if (str_starts_with($tag, $tagStart)) { - return false; // ignore class: class-level PHPDoc contains tag that has been excluded through configuration + $tags[$tag] = true; + } + + if (\count(array_intersect_key($this->configuration['exclude'], $tags)) > 0) { + return false; + } + + if ($this->isConfiguredAsInclude($tags)) { + return true; + } + + return null; + } + + private function isClassCandidateBasedOnAttribute(Tokens $tokens, int $startIndex, int $endIndex): ?bool + { + $attributeCandidates = []; + $attributeString = ''; + $currentIndex = $startIndex; + + while ($currentIndex < $endIndex && null !== ($currentIndex = $tokens->getNextMeaningfulToken($currentIndex))) { + if (!$tokens[$currentIndex]->isGivenKind([T_STRING, T_NS_SEPARATOR])) { + if ('' !== $attributeString) { + $attributeCandidates[$attributeString] = true; + $attributeString = ''; } + + continue; } - $tags[$tag] = true; + $attributeString .= strtolower($tokens[$currentIndex]->getContent()); + } + + if (\count(array_intersect_key($this->configuration['exclude'], $attributeCandidates)) > 0) { + return false; + } + + if ($this->isConfiguredAsInclude($attributeCandidates)) { + return true; } - foreach ($this->configuration['annotation_include'] as $tag => $true) { - if (!isset($tags[$tag])) { - return false; // ignore class: class-level PHPDoc does not contain all tags that has been included through configuration + return null; + } + + /** + * @param array $attributes + */ + private function isConfiguredAsInclude(array $attributes): bool + { + if (0 === \count($this->configuration['include'])) { + return true; + } + + return \count(array_intersect_key($this->configuration['include'], $attributes)) > 0; + } + + private function assertConfigHasNoConflicts(): void + { + foreach (['include' => 'annotation_include', 'exclude' => 'annotation_exclude'] as $newConfigKey => $oldConfigKey) { + $defaults = []; + + foreach (self::DEFAULTS[$newConfigKey] as $foo) { + $defaults[strtolower($foo)] = true; } + + $newConfigIsSet = $this->configuration[$newConfigKey] !== $defaults; + $oldConfigIsSet = $this->configuration[$oldConfigKey] !== $defaults; + + if ($newConfigIsSet && $oldConfigIsSet) { + throw new InvalidFixerConfigurationException($this->getName(), \sprintf('Configuration cannot contain deprecated option "%s" and new option "%s".', $oldConfigKey, $newConfigKey)); + } + + if ($oldConfigIsSet) { + $this->configuration[$newConfigKey] = $this->configuration[$oldConfigKey]; // @phpstan-ignore-line crazy mapping, to be removed while cleaning up deprecated options + $this->checkAttributes = false; // run in old mode + } + + // if ($newConfigIsSet) - only new config is set, all good + // if (!$newConfigIsSet && !$oldConfigIsSet) - both are set as to default values, all good + + unset($this->configuration[$oldConfigKey]); // @phpstan-ignore-line crazy mapping, to be removed while cleaning up deprecated options } - return true; + $intersect = array_intersect_assoc($this->configuration['include'], $this->configuration['exclude']); + + if (\count($intersect) > 0) { + throw new InvalidFixerConfigurationException($this->getName(), \sprintf('Annotation cannot be used in both "include" and "exclude" list, got duplicates: %s.', Utils::naturalLanguageJoin(array_keys($intersect)))); + } } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixer.php index 05dc97bb..ed9a7ac7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixer.php @@ -47,9 +47,6 @@ final class FinalPublicMethodForAbstractClassFixer extends AbstractFixer '__debuginfo' => true, ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -72,32 +69,23 @@ public function start() ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - return $tokens->isAllTokenKindsFound([T_CLASS, T_ABSTRACT, T_PUBLIC, T_FUNCTION]); + return $tokens->isAllTokenKindsFound([T_ABSTRACT, T_PUBLIC, T_FUNCTION]); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $classes = array_keys($tokens->findGivenKind(T_CLASS)); + $abstracts = array_keys($tokens->findGivenKind(T_ABSTRACT)); - while ($classIndex = array_pop($classes)) { - $prevToken = $tokens[$tokens->getPrevMeaningfulToken($classIndex)]; - if (!$prevToken->isGivenKind(T_ABSTRACT)) { + while ($abstractIndex = array_pop($abstracts)) { + $classIndex = $tokens->getNextTokenOfKind($abstractIndex, [[T_CLASS], [T_FUNCTION]]); + if (!$tokens[$classIndex]->isGivenKind(T_CLASS)) { continue; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixer.php index 868cfd64..b09c2a2b 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixer.php @@ -27,17 +27,11 @@ */ final class NoBlankLinesAfterClassOpeningFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -68,9 +62,6 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoNullPropertyInitializationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoNullPropertyInitializationFixer.php index 76f71cff..b08a9231 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoNullPropertyInitializationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoNullPropertyInitializationFixer.php @@ -25,9 +25,6 @@ */ final class NoNullPropertyInitializationFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -51,17 +48,11 @@ class Foo { ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_CLASS, T_TRAIT]) && $tokens->isAnyTokenKindsFound([T_PUBLIC, T_PROTECTED, T_PRIVATE, T_VAR, T_STATIC]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $inClass = []; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php index f74dd69e..6547cc62 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php @@ -27,9 +27,6 @@ */ final class NoPhp4ConstructorFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -59,25 +56,16 @@ public function getPriority(): int return 75; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_CLASS); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); @@ -118,6 +106,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void ++$i; } } + // and continue checking the classes that might follow continue; } @@ -150,7 +139,7 @@ private function fixConstructor(Tokens $tokens, string $className, int $classSta return; // no PHP4-constructor! } - if (!empty($php4['modifiers'][T_ABSTRACT]) || !empty($php4['modifiers'][T_STATIC])) { + if (isset($php4['modifiers'][T_ABSTRACT]) || isset($php4['modifiers'][T_STATIC])) { return; // PHP4 constructor can't be abstract or static } @@ -301,7 +290,7 @@ private function fixInfiniteRecursion(Tokens $tokens, int $start, int $end): voi * @param int $startIndex function/method start index * @param int $bodyIndex function/method body index * - * @return array an array containing the sequence and case sensitiveness [ 0 => $seq, 1 => $case ] + * @return array{list>, array{3: false}} */ private function getWrapperMethodSequence(Tokens $tokens, string $method, int $startIndex, int $bodyIndex): array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoUnneededFinalMethodFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoUnneededFinalMethodFixer.php index 0f386a9d..16fc2754 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoUnneededFinalMethodFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoUnneededFinalMethodFixer.php @@ -16,23 +16,34 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; /** * @author Filippo Tessarotto + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * private_methods?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * private_methods: bool + * } */ final class NoUnneededFinalMethodFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -73,9 +84,6 @@ final private function bar1() {} ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { if (!$tokens->isAllTokenKindsFound([T_FINAL, T_FUNCTION])) { @@ -94,9 +102,6 @@ public function isRisky(): bool return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($this->getMethods($tokens) as $element) { @@ -116,9 +121,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -129,6 +131,18 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } + /** + * @return \Generator + */ private function getMethods(Tokens $tokens): \Generator { $tokensAnalyzer = new TokensAnalyzer($tokens); @@ -136,17 +150,8 @@ private function getMethods(Tokens $tokens): \Generator $enums = []; $classesAreFinal = []; - $elements = $tokensAnalyzer->getClassyElements(); - - for (end($elements);; prev($elements)) { - $index = key($elements); - - if (null === $index) { - break; - } - - $element = current($elements); + foreach ($tokensAnalyzer->getClassyElements() as $index => $element) { if ('method' !== $element['type']) { continue; // not a method } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php index 244791d6..71febf69 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php @@ -16,7 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -26,12 +26,40 @@ use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +use PhpCsFixer\Utils; /** * @author Gregor Harlan + * + * @phpstan-type _ClassElement array{ + * start: int, + * visibility: string, + * abstract: bool, + * static: bool, + * readonly: bool, + * type: string, + * name: string, + * end: int, + * } + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * case_sensitive?: bool, + * order?: list, + * sort_algorithm?: 'alpha'|'none' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * case_sensitive: bool, + * order: list, + * sort_algorithm: 'alpha'|'none' + * } */ final class OrderedClassElementsFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** @internal */ public const SORT_ALPHA = 'alpha'; @@ -46,7 +74,7 @@ final class OrderedClassElementsFixer extends AbstractFixer implements Configura /** * @var array> Array containing all class element base types (keys) and their parent types (values) */ - private static array $typeHierarchy = [ + private const TYPE_HIERARCHY = [ 'use_trait' => null, 'public' => null, 'protected' => null, @@ -87,7 +115,7 @@ final class OrderedClassElementsFixer extends AbstractFixer implements Configura /** * @var array Array containing special method types */ - private static array $specialTypes = [ + private const SPECIAL_TYPES = [ 'construct' => null, 'destruct' => null, 'magic' => null, @@ -99,64 +127,11 @@ final class OrderedClassElementsFixer extends AbstractFixer implements Configura */ private array $typePosition; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->typePosition = []; - $pos = 0; - - foreach ($this->configuration['order'] as $type) { - $this->typePosition[$type] = $pos++; - } - - foreach (self::$typeHierarchy as $type => $parents) { - if (isset($this->typePosition[$type])) { - continue; - } - - if (!$parents) { - $this->typePosition[$type] = null; - - continue; - } - - foreach ($parents as $parent) { - if (isset($this->typePosition[$parent])) { - $this->typePosition[$type] = $this->typePosition[$parent]; - - continue 2; - } - } - - $this->typePosition[$type] = null; - } - - $lastPosition = \count($this->configuration['order']); - - foreach ($this->typePosition as &$pos) { - if (null === $pos) { - $pos = $lastPosition; - } - - $pos *= 10; // last digit is used by phpunit method ordering - } - } - - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -217,7 +192,28 @@ public function C(){} ', ['order' => ['method_public'], 'sort_algorithm' => self::SORT_ALPHA] ), - ] + new CodeSample( + ' ['method_public'], 'sort_algorithm' => self::SORT_ALPHA, 'case_sensitive' => true] + ), + ], + 'Accepts a subset of pre-defined element types, special element groups, and custom patterns. + +Element types: `[\''.implode('\', \'', array_keys(self::TYPE_HIERARCHY)).'\']` + +Special element types: `[\''.implode('\', \'', array_keys(self::SPECIAL_TYPES)).'\']` + +Custom values: + +- `method:*`: specify a single method name (e.g. `method:__invoke`) to set the order of that specific method.' ); } @@ -232,9 +228,48 @@ public function getPriority(): int return 65; } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->typePosition = []; + $position = 0; + + foreach ($this->configuration['order'] as $type) { + $this->typePosition[$type] = $position++; + } + + foreach (self::TYPE_HIERARCHY as $type => $parents) { + if (isset($this->typePosition[$type])) { + continue; + } + + if (null === $parents) { + $this->typePosition[$type] = null; + + continue; + } + + foreach ($parents as $parent) { + if (isset($this->typePosition[$parent])) { + $this->typePosition[$type] = $this->typePosition[$parent]; + + continue 2; + } + } + + $this->typePosition[$type] = null; + } + + $lastPosition = \count($this->configuration['order']); + + foreach ($this->typePosition as &$pos) { + if (null === $pos) { + $pos = $lastPosition; + } + + $pos *= 10; // last digit is used by phpunit method ordering + } + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($i = 1, $count = $tokens->count(); $i < $count; ++$i) { @@ -260,15 +295,28 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { + $builtIns = array_keys(array_merge(self::TYPE_HIERARCHY, self::SPECIAL_TYPES)); + return new FixerConfigurationResolver([ (new FixerOptionBuilder('order', 'List of strings defining order of elements.')) - ->setAllowedTypes(['array']) - ->setAllowedValues([new AllowedValueSubset(array_keys(array_merge(self::$typeHierarchy, self::$specialTypes)))]) + ->setAllowedTypes(['string[]']) + ->setAllowedValues([ + static function (array $values) use ($builtIns): bool { + foreach ($values as $value) { + if (\in_array($value, $builtIns, true)) { + return true; + } + + if ('method:' === substr($value, 0, 7)) { + return true; + } + } + + return false; + }, + ]) ->setDefault([ 'use_trait', 'case', @@ -291,20 +339,15 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setAllowedValues(self::SUPPORTED_SORT_ALGORITHMS) ->setDefault(self::SORT_NONE) ->getOption(), + (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), ]); } /** - * @return list + * @return list<_ClassElement> */ private function getElements(Tokens $tokens, int $startIndex): array { @@ -382,7 +425,7 @@ private function getElements(Tokens $tokens, int $startIndex): array } /** - * @return array|string type or array of type and name + * @return list|string type or array of type and name */ private function detectElementType(Tokens $tokens, int $index) { @@ -450,17 +493,9 @@ private function findElementEnd(Tokens $tokens, int $index): int } /** - * @return list + * @param list<_ClassElement> $elements + * + * @return list<_ClassElement> */ private function sortElements(array $elements): array { @@ -477,18 +512,22 @@ private function sortElements(array $elements): array 'doteardown' => 10, ]; - foreach ($elements as &$element) { + $getPositionType = function (array $element) use ($phpunitPositions): int { $type = $element['type']; - if (\array_key_exists($type, self::$specialTypes)) { + if (\in_array($type, ['method', 'magic', 'phpunit'], true) && isset($this->typePosition["method:{$element['name']}"])) { + return $this->typePosition["method:{$element['name']}"]; + } + + if (\array_key_exists($type, self::SPECIAL_TYPES)) { if (isset($this->typePosition[$type])) { - $element['position'] = $this->typePosition[$type]; + $position = $this->typePosition[$type]; if ('phpunit' === $type) { - $element['position'] += $phpunitPositions[$element['name']]; + $position += $phpunitPositions[$element['name']]; } - continue; + return $position; } $type = 'method'; @@ -510,69 +549,42 @@ private function sortElements(array $elements): array } } - $element['position'] = $this->typePosition[$type]; - } - - unset($element); - - usort($elements, function (array $a, array $b): int { - if ($a['position'] === $b['position']) { - return $this->sortGroupElements($a, $b); - } - - return $a['position'] <=> $b['position']; - }); - - return $elements; + return $this->typePosition[$type]; + }; + + return Utils::stableSort( + $elements, + /** + * @return array{element: _ClassElement, position: int} + */ + static fn (array $element): array => ['element' => $element, 'position' => $getPositionType($element)], + /** + * @param array{element: _ClassElement, position: int} $a + * @param array{element: _ClassElement, position: int} $b + * + * @return -1|0|1 + */ + fn (array $a, array $b): int => ($a['position'] === $b['position']) ? $this->sortGroupElements($a['element'], $b['element']) : $a['position'] <=> $b['position'], + ); } /** - * @param array{ - * start: int, - * visibility: string, - * abstract: bool, - * static: bool, - * readonly: bool, - * type: string, - * name: string, - * end: int, - * position: int, - * } $a - * @param array{ - * start: int, - * visibility: string, - * abstract: bool, - * static: bool, - * readonly: bool, - * type: string, - * name: string, - * end: int, - * position: int, - * } $b + * @param _ClassElement $a + * @param _ClassElement $b */ private function sortGroupElements(array $a, array $b): int { - $selectedSortAlgorithm = $this->configuration['sort_algorithm']; - - if (self::SORT_ALPHA === $selectedSortAlgorithm) { - return strcasecmp($a['name'], $b['name']); + if (self::SORT_ALPHA === $this->configuration['sort_algorithm']) { + return true === $this->configuration['case_sensitive'] + ? $a['name'] <=> $b['name'] + : strcasecmp($a['name'], $b['name']); } return $a['start'] <=> $b['start']; } /** - * @param list $elements + * @param list<_ClassElement> $elements */ private function sortTokens(Tokens $tokens, int $startIndex, int $endIndex, array $elements): void { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php index 778735eb..c2589df1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -27,9 +28,25 @@ /** * @author Dave van der Brugge + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * case_sensitive?: bool, + * direction?: 'ascend'|'descend', + * order?: 'alpha'|'length' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * case_sensitive: bool, + * direction: 'ascend'|'descend', + * order: 'alpha'|'length' + * } */ final class OrderedInterfacesFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** @internal */ public const OPTION_DIRECTION = 'direction'; @@ -51,7 +68,7 @@ final class OrderedInterfacesFixer extends AbstractFixer implements Configurable /** * Array of supported directions in configuration. * - * @var string[] + * @var list */ private const SUPPORTED_DIRECTION_OPTIONS = [ self::DIRECTION_ASCEND, @@ -61,16 +78,13 @@ final class OrderedInterfacesFixer extends AbstractFixer implements Configurable /** * Array of supported orders in configuration. * - * @var string[] + * @var list */ private const SUPPORTED_ORDER_OPTIONS = [ self::ORDER_ALPHA, self::ORDER_LENGTH, ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -94,22 +108,39 @@ public function getDefinition(): FixerDefinitionInterface self::OPTION_DIRECTION => self::DIRECTION_DESCEND, ] ), + new CodeSample( + " self::ORDER_ALPHA, + ] + ), + new CodeSample( + " self::ORDER_ALPHA, + 'case_sensitive' => true, + ] + ), ], ); } /** * {@inheritdoc} + * + * Must run after FullyQualifiedStrictTypesFixer. */ + public function getPriority(): int + { + return 0; + } + public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_IMPLEMENTS) || $tokens->isAllTokenKindsFound([T_INTERFACE, T_EXTENDS]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -128,7 +159,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } $implementsStart = $index + 1; - $implementsEnd = $tokens->getPrevNonWhitespace($tokens->getNextTokenOfKind($implementsStart, ['{'])); + $implementsEnd = $tokens->getPrevMeaningfulToken($tokens->getNextTokenOfKind($implementsStart, ['{'])); $interfaces = $this->getInterfaces($tokens, $implementsStart, $implementsEnd); @@ -137,7 +168,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } foreach ($interfaces as $interfaceIndex => $interface) { - $interfaceTokens = Tokens::fromArray($interface, false); + $interfaceTokens = Tokens::fromArray($interface); $normalized = ''; $actualInterfaceIndex = $interfaceTokens->getNextMeaningfulToken(-1); @@ -162,7 +193,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void usort($interfaces, function (array $first, array $second): int { $score = self::ORDER_LENGTH === $this->configuration[self::OPTION_ORDER] ? \strlen($first['normalized']) - \strlen($second['normalized']) - : strcasecmp($first['normalized'], $second['normalized']); + : ( + true === $this->configuration['case_sensitive'] + ? $first['normalized'] <=> $second['normalized'] + : strcasecmp($first['normalized'], $second['normalized']) + ); if (self::DIRECTION_DESCEND === $this->configuration[self::OPTION_DIRECTION]) { $score *= -1; @@ -195,9 +230,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -209,6 +241,10 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setAllowedValues(self::SUPPORTED_DIRECTION_OPTIONS) ->setDefault(self::DIRECTION_ASCEND) ->getOption(), + (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), ]); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php index 1cf5ad2e..4d3b6dd7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php @@ -15,48 +15,70 @@ namespace PhpCsFixer\Fixer\ClassNotation; use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Tokens; -final class OrderedTraitsFixer extends AbstractFixer +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * case_sensitive?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * case_sensitive: bool + * } + */ +final class OrderedTraitsFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'Trait `use` statements must be sorted alphabetically.', [ new CodeSample(" true, + ] + ), ], null, 'Risky when depending on order of the imports.' ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(CT::T_USE_TRAIT); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + ]); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($this->findUseStatementsGroups($tokens) as $uses) { @@ -175,15 +197,20 @@ private function sort(Tokens $tokens, array $elements): void }; $sortedElements = $elements; - uasort($sortedElements, static function (Tokens $useA, Tokens $useB) use ($toTraitName): int { - return strcasecmp($toTraitName($useA), $toTraitName($useB)); - }); + uasort( + $sortedElements, + fn (Tokens $useA, Tokens $useB): int => true === $this->configuration['case_sensitive'] + ? $toTraitName($useA) <=> $toTraitName($useB) + : strcasecmp($toTraitName($useA), $toTraitName($useB)) + ); $sortedElements = array_combine( array_keys($elements), array_values($sortedElements) ); + $beforeOverrideCount = $tokens->count(); + foreach (array_reverse($sortedElements, true) as $index => $tokensToInsert) { $tokens->overrideRange( $index, @@ -191,5 +218,9 @@ private function sort(Tokens $tokens, array $elements): void $tokensToInsert ); } + + if ($beforeOverrideCount < $tokens->count()) { + $tokens->clearEmptyTokens(); + } } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php new file mode 100644 index 00000000..e70c6baa --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php @@ -0,0 +1,453 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\ClassNotation; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\FixerDefinition\VersionSpecification; +use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; +use PhpCsFixer\Tokenizer\TokensAnalyzer; + +/** + * @author John Paul E. Balandan, CPA + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * case_sensitive?: bool, + * null_adjustment?: 'always_first'|'always_last'|'none', + * sort_algorithm?: 'alpha'|'none' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * case_sensitive: bool, + * null_adjustment: 'always_first'|'always_last'|'none', + * sort_algorithm: 'alpha'|'none' + * } + */ +final class OrderedTypesFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Sort union types and intersection types using configured order.', + [ + new CodeSample( + 'save($foo); +} catch (\RuntimeException|CacheException $e) { + logger($e); + + throw $e; +} +' + ), + new VersionSpecificCodeSample( + ' true, + ] + ), + new VersionSpecificCodeSample( + ' 'always_last'] + ), + new VersionSpecificCodeSample( + ' 'none', + 'null_adjustment' => 'always_last', + ] + ), + ] + ); + } + + /** + * {@inheritdoc} + * + * Must run before TypesSpacesFixer. + * Must run after NullableTypeDeclarationFixer, NullableTypeDeclarationForDefaultNullValueFixer. + */ + public function getPriority(): int + { + return 0; + } + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isAnyTokenKindsFound([CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION]); + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('sort_algorithm', 'Whether the types should be sorted alphabetically, or not sorted.')) + ->setAllowedValues(['alpha', 'none']) + ->setDefault('alpha') + ->getOption(), + (new FixerOptionBuilder('null_adjustment', 'Forces the position of `null` (overrides `sort_algorithm`).')) + ->setAllowedValues(['always_first', 'always_last', 'none']) + ->setDefault('always_first') + ->getOption(), + (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + ]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $functionsAnalyzer = new FunctionsAnalyzer(); + + foreach ($this->getElements($tokens) as $index => $type) { + if ('catch' === $type) { + $this->fixCatchArgumentType($tokens, $index); + + continue; + } + + if ('property' === $type) { + $this->fixPropertyType($tokens, $index); + + continue; + } + + $this->fixMethodArgumentType($functionsAnalyzer, $tokens, $index); + $this->fixMethodReturnType($functionsAnalyzer, $tokens, $index); + } + } + + /** + * @return array + * + * @phpstan-return array + */ + private function getElements(Tokens $tokens): array + { + $tokensAnalyzer = new TokensAnalyzer($tokens); + + $elements = array_map( + static fn (array $element): string => $element['type'], + array_filter( + $tokensAnalyzer->getClassyElements(), + static fn (array $element): bool => \in_array($element['type'], ['method', 'property'], true) + ) + ); + + foreach ($tokens as $index => $token) { + if ($token->isGivenKind(T_CATCH)) { + $elements[$index] = 'catch'; + + continue; + } + + if ( + $token->isGivenKind(T_FN) + || ($token->isGivenKind(T_FUNCTION) && !isset($elements[$index])) + ) { + $elements[$index] = 'method'; + } + } + + return $elements; + } + + private function collectTypeAnalysis(Tokens $tokens, int $startIndex, int $endIndex): ?TypeAnalysis + { + $type = ''; + $typeStartIndex = $tokens->getNextMeaningfulToken($startIndex); + $typeEndIndex = $typeStartIndex; + + for ($i = $typeStartIndex; $i < $endIndex; ++$i) { + if ($tokens[$i]->isWhitespace() || $tokens[$i]->isComment()) { + continue; + } + + $type .= $tokens[$i]->getContent(); + $typeEndIndex = $i; + } + + return '' !== $type ? new TypeAnalysis($type, $typeStartIndex, $typeEndIndex) : null; + } + + private function fixCatchArgumentType(Tokens $tokens, int $index): void + { + $catchStart = $tokens->getNextTokenOfKind($index, ['(']); + $catchEnd = $tokens->getNextTokenOfKind($catchStart, [')', [T_VARIABLE]]); + + $catchArgumentType = $this->collectTypeAnalysis($tokens, $catchStart, $catchEnd); + + if (null === $catchArgumentType || !$this->isTypeSortable($catchArgumentType)) { + return; // nothing to fix + } + + $this->sortTypes($catchArgumentType, $tokens); + } + + private function fixPropertyType(Tokens $tokens, int $index): void + { + $propertyIndex = $index; + $propertyModifiers = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_STATIC, T_VAR]; + + if (\defined('T_READONLY')) { + $propertyModifiers[] = T_READONLY; // @TODO drop condition when PHP 8.1 is supported + } + + do { + $index = $tokens->getPrevMeaningfulToken($index); + } while (!$tokens[$index]->isGivenKind($propertyModifiers)); + + $propertyType = $this->collectTypeAnalysis($tokens, $index, $propertyIndex); + + if (null === $propertyType || !$this->isTypeSortable($propertyType)) { + return; // nothing to fix + } + + $this->sortTypes($propertyType, $tokens); + } + + private function fixMethodArgumentType(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index): void + { + foreach ($functionsAnalyzer->getFunctionArguments($tokens, $index) as $argumentInfo) { + $argumentType = $argumentInfo->getTypeAnalysis(); + + if (null === $argumentType || !$this->isTypeSortable($argumentType)) { + continue; // nothing to fix + } + + $this->sortTypes($argumentType, $tokens); + } + } + + private function fixMethodReturnType(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index): void + { + $returnType = $functionsAnalyzer->getFunctionReturnType($tokens, $index); + + if (null === $returnType || !$this->isTypeSortable($returnType)) { + return; // nothing to fix + } + + $this->sortTypes($returnType, $tokens); + } + + private function sortTypes(TypeAnalysis $typeAnalysis, Tokens $tokens): void + { + $type = $typeAnalysis->getName(); + + if (str_contains($type, '|') && str_contains($type, '&')) { + // a DNF type of the form (A&B)|C, available as of PHP 8.2 + [$originalTypes, $glue] = $this->collectDisjunctiveNormalFormTypes($type); + } else { + [$originalTypes, $glue] = $this->collectUnionOrIntersectionTypes($type); + } + + // If the $types array is coming from a DNF type, then we have parts + // which are also array. If so, we sort those sub-types first before + // running the sorting algorithm to the entire $types array. + $sortedTypes = array_map(function ($subType) { + if (\is_array($subType)) { + return $this->runTypesThroughSortingAlgorithm($subType); + } + + return $subType; + }, $originalTypes); + + $sortedTypes = $this->runTypesThroughSortingAlgorithm($sortedTypes); + + if ($sortedTypes === $originalTypes) { + return; + } + + $tokens->overrideRange( + $typeAnalysis->getStartIndex(), + $typeAnalysis->getEndIndex(), + $this->createTypeDeclarationTokens($sortedTypes, $glue) + ); + } + + private function isTypeSortable(TypeAnalysis $type): bool + { + return str_contains($type->getName(), '|') || str_contains($type->getName(), '&'); + } + + /** + * @return array{0: list|string>, 1: string} + */ + private function collectDisjunctiveNormalFormTypes(string $type): array + { + $types = array_map(static function (string $subType) { + if (str_starts_with($subType, '(')) { + return explode('&', trim($subType, '()')); + } + + return $subType; + }, explode('|', $type)); + + return [$types, '|']; + } + + /** + * @return array{0: list, 1: string} + */ + private function collectUnionOrIntersectionTypes(string $type): array + { + $types = explode('|', $type); + $glue = '|'; + + if (1 === \count($types)) { + $types = explode('&', $type); + $glue = '&'; + } + + return [$types, $glue]; + } + + /** + * @param list|string> $types + * + * @return ($types is list ? list : list>) + */ + private function runTypesThroughSortingAlgorithm(array $types): array + { + $normalizeType = static fn (string $type): string => Preg::replace('/^\\\?/', '', $type); + + usort($types, function ($a, $b) use ($normalizeType): int { + if (\is_array($a)) { + $a = implode('&', $a); + } + + if (\is_array($b)) { + $b = implode('&', $b); + } + + $a = $normalizeType($a); + $b = $normalizeType($b); + $lowerCaseA = strtolower($a); + $lowerCaseB = strtolower($b); + + if ('none' !== $this->configuration['null_adjustment']) { + if ('null' === $lowerCaseA && 'null' !== $lowerCaseB) { + return 'always_last' === $this->configuration['null_adjustment'] ? 1 : -1; + } + + if ('null' !== $lowerCaseA && 'null' === $lowerCaseB) { + return 'always_last' === $this->configuration['null_adjustment'] ? -1 : 1; + } + } + + if ('alpha' === $this->configuration['sort_algorithm']) { + return true === $this->configuration['case_sensitive'] ? $a <=> $b : strcasecmp($a, $b); + } + + return 0; + }); + + return $types; + } + + /** + * @param list|string> $types + * + * @return list + */ + private function createTypeDeclarationTokens(array $types, string $glue, bool $isDisjunctive = false): array + { + static $specialTypes = [ + 'array' => [CT::T_ARRAY_TYPEHINT, 'array'], + 'callable' => [T_CALLABLE, 'callable'], + 'static' => [T_STATIC, 'static'], + ]; + + static $glues = [ + '|' => [CT::T_TYPE_ALTERNATION, '|'], + '&' => [CT::T_TYPE_INTERSECTION, '&'], + ]; + + $count = \count($types); + $newTokens = []; + + foreach ($types as $i => $type) { + if (\is_array($type)) { + $newTokens = [ + ...$newTokens, + ...$this->createTypeDeclarationTokens($type, '&', true), + ]; + } elseif (isset($specialTypes[$type])) { + $newTokens[] = new Token($specialTypes[$type]); + } else { + foreach (explode('\\', $type) as $nsIndex => $value) { + if (0 === $nsIndex && '' === $value) { + continue; + } + + if ($nsIndex > 0) { + $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); + } + + $newTokens[] = new Token([T_STRING, $value]); + } + } + + if ($i <= $count - 2) { + $newTokens[] = new Token($glues[$glue]); + } + } + + if ($isDisjunctive) { + array_unshift($newTokens, new Token([CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, '('])); + $newTokens[] = new Token([CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, ')']); + } + + return $newTokens; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/PhpdocReadonlyClassCommentToKeywordFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/PhpdocReadonlyClassCommentToKeywordFixer.php new file mode 100644 index 00000000..78916047 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/PhpdocReadonlyClassCommentToKeywordFixer.php @@ -0,0 +1,129 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\ClassNotation; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\DocBlock\DocBlock; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\FixerDefinition\VersionSpecification; +use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Marcel Behrmann + */ +final class PhpdocReadonlyClassCommentToKeywordFixer extends AbstractFixer +{ + /** + * {@inheritdoc} + * + * Must run before NoEmptyPhpdocFixer, NoExtraBlankLinesFixer, PhpdocAlignFixer. + * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. + */ + public function getPriority(): int + { + return 4; + } + + public function isCandidate(Tokens $tokens): bool + { + return \PHP_VERSION_ID >= 8_02_00 && $tokens->isTokenKindFound(T_DOC_COMMENT); + } + + public function isRisky(): bool + { + return true; + } + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Converts readonly comment on classes to the readonly keyword.', + [ + new VersionSpecificCodeSample( + << $token) { + if (!$token->isGivenKind(T_DOC_COMMENT)) { + continue; + } + + $doc = new DocBlock($token->getContent()); + + $annotations = $doc->getAnnotationsOfType('readonly'); + + if (0 === \count($annotations)) { + continue; + } + + foreach ($annotations as $annotation) { + $annotation->remove(); + } + + $mainIndex = $index; + $index = $tokens->getNextMeaningfulToken($index); + $addReadonly = true; + + while ($tokens[$index]->isGivenKind([ + T_ABSTRACT, + T_FINAL, + T_PRIVATE, + T_PUBLIC, + T_PROTECTED, + T_READONLY, + ])) { + if ($tokens[$index]->isGivenKind([T_READONLY])) { + $addReadonly = false; + } + + $index = $tokens->getNextMeaningfulToken($index); + } + + if (!$tokens[$index]->isGivenKind(T_CLASS)) { + continue; + } + + if ($addReadonly) { + $tokens->insertAt($index, [new Token([T_READONLY, 'readonly']), new Token([T_WHITESPACE, ' '])]); + } + + $newContent = $doc->getContent(); + + if ('' === $newContent) { + $tokens->clearTokenAndMergeSurroundingWhitespace($mainIndex); + + continue; + } + + $tokens[$mainIndex] = new Token([T_DOC_COMMENT, $doc->getContent()]); + } + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ProtectedToPrivateFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ProtectedToPrivateFixer.php index f84ae211..27cc50c4 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ProtectedToPrivateFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ProtectedToPrivateFixer.php @@ -30,9 +30,6 @@ final class ProtectedToPrivateFixer extends AbstractFixer { private TokensAnalyzer $tokensAnalyzer; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -58,16 +55,13 @@ protected function test() * {@inheritdoc} * * Must run before OrderedClassElementsFixer. - * Must run after FinalInternalClassFixer. + * Must run after FinalClassFixer, FinalInternalClassFixer. */ public function getPriority(): int { return 66; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { if (\defined('T_ENUM') && $tokens->isAllTokenKindsFound([T_ENUM, T_PROTECTED])) { // @TODO: drop condition when PHP 8.1+ is required @@ -77,9 +71,6 @@ public function isCandidate(Tokens $tokens): bool return $tokens->isAllTokenKindsFound([T_CLASS, T_FINAL, T_PROTECTED]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $this->tokensAnalyzer = new TokensAnalyzer($tokens); @@ -95,9 +86,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void foreach ($this->tokensAnalyzer->getClassyElements() as $index => $element) { $classIndex = $element['classIndex']; - if (!\array_key_exists($classIndex, $classesCandidate)) { - $classesCandidate[$classIndex] = $this->isClassCandidate($tokens, $classIndex); - } + $classesCandidate[$classIndex] ??= $this->isClassCandidate($tokens, $classIndex); if (false === $classesCandidate[$classIndex]) { continue; @@ -139,7 +128,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void * - an Enum (PHP8.1+) * - a class, which: * - is not anonymous - * - is not final + * - is final * - does not use traits * - does not extend other class. */ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php index 568ab6e2..7150b6bb 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php @@ -19,7 +19,6 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; @@ -30,9 +29,6 @@ */ final class SelfAccessorFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -58,9 +54,6 @@ public function getBar() ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_CLASS, T_INTERFACE]); @@ -68,20 +61,24 @@ public function isCandidate(Tokens $tokens): bool /** * {@inheritdoc} + * + * Must run after PsrAutoloadingFixer. */ + public function getPriority(): int + { + return -11; + } + public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); - foreach ((new NamespacesAnalyzer())->getDeclarations($tokens) as $namespace) { + foreach ($tokens->getNamespaceDeclarations() as $namespace) { for ($index = $namespace->getScopeStartIndex(); $index < $namespace->getScopeEndIndex(); ++$index) { if (!$tokens[$index]->isGivenKind([T_CLASS, T_INTERFACE]) || $tokensAnalyzer->isAnonymousClass($index)) { continue; @@ -123,7 +120,21 @@ private function replaceNameOccurrences(Tokens $tokens, string $namespace, strin continue; } + if ($token->isGivenKind(T_FN)) { + $i = $tokensAnalyzer->getLastTokenIndexOfArrowFunction($i); + $i = $tokens->getNextMeaningfulToken($i); + + continue; + } + if ($token->isGivenKind(T_FUNCTION)) { + if ($tokensAnalyzer->isLambda($i)) { + $i = $tokens->getNextTokenOfKind($i, ['{']); + $i = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $i); + + continue; + } + $i = $tokens->getNextTokenOfKind($i, ['(']); $insideMethodSignatureUntil = $tokens->getNextTokenOfKind($i, ['{', ';']); @@ -158,7 +169,7 @@ private function replaceNameOccurrences(Tokens $tokens, string $namespace, strin || ( null !== $insideMethodSignatureUntil && $i < $insideMethodSignatureUntil - && $prevToken->equalsAny(['(', ',', [CT::T_TYPE_COLON], [CT::T_NULLABLE_TYPE]]) + && $prevToken->equalsAny(['(', ',', [CT::T_NULLABLE_TYPE], [CT::T_TYPE_ALTERNATION], [CT::T_TYPE_COLON]]) ) ) { for ($j = $classStartIndex; $j < $i; ++$j) { @@ -173,7 +184,7 @@ private function getClassStart(Tokens $tokens, int $index, string $namespace): ? { $namespace = ('' !== $namespace ? '\\'.$namespace : '').'\\'; - foreach (array_reverse(Preg::split('/(\\\\)/', $namespace, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)) as $piece) { + foreach (array_reverse(Preg::split('/(\\\)/', $namespace, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)) as $piece) { $index = $tokens->getPrevMeaningfulToken($index); if ('\\' === $piece) { if (!$tokens[$index]->isGivenKind(T_NS_SEPARATOR)) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfStaticAccessorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfStaticAccessorFixer.php index 5c6c5eca..0bf56ab0 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfStaticAccessorFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfStaticAccessorFixer.php @@ -18,6 +18,8 @@ use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\FixerDefinition\VersionSpecification; +use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; @@ -26,13 +28,10 @@ final class SelfStaticAccessorFixer extends AbstractFixer { private TokensAnalyzer $tokensAnalyzer; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Inside a `final` class or anonymous class `self` should be preferred to `static`.', + 'Inside an enum or `final`/anonymous class, `self` should be preferred over `static`.', [ new CodeSample( 'isAllTokenKindsFound([T_CLASS, T_STATIC]) && $tokens->isAnyTokenKindsFound([T_DOUBLE_COLON, T_NEW, T_INSTANCEOF]); + $classyTypes = [T_CLASS]; + + if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required + $classyTypes[] = T_ENUM; + } + + return $tokens->isTokenKindFound(T_STATIC) + && $tokens->isAnyTokenKindsFound($classyTypes) + && $tokens->isAnyTokenKindsFound([T_DOUBLE_COLON, T_NEW, T_INSTANCEOF]); } /** * {@inheritdoc} * - * Must run after FinalInternalClassFixer, FunctionToConstantFixer, PhpUnitTestCaseStaticMethodCallsFixer. + * Must run after FinalClassFixer, FinalInternalClassFixer, FunctionToConstantFixer, PhpUnitTestCaseStaticMethodCallsFixer. */ public function getPriority(): int { return -10; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { + $classyTokensOfInterest = [[T_CLASS]]; + + if (\defined('T_ENUM')) { + $classyTokensOfInterest[] = [T_ENUM]; // @TODO drop condition when PHP 8.1+ is required + } + $this->tokensAnalyzer = new TokensAnalyzer($tokens); - $classIndex = $tokens->getNextTokenOfKind(0, [[T_CLASS]]); + $classyIndex = $tokens->getNextTokenOfKind(0, $classyTokensOfInterest); - while (null !== $classIndex) { - $modifiers = $this->tokensAnalyzer->getClassyModifiers($classIndex); + while (null !== $classyIndex) { + if ($tokens[$classyIndex]->isGivenKind(T_CLASS)) { + $modifiers = $this->tokensAnalyzer->getClassyModifiers($classyIndex); - if (isset($modifiers['final']) || $this->tokensAnalyzer->isAnonymousClass($classIndex)) { - $classIndex = $this->fixClass($tokens, $classIndex); + if ( + isset($modifiers['final']) + || $this->tokensAnalyzer->isAnonymousClass($classyIndex) + ) { + $classyIndex = $this->fixClassy($tokens, $classyIndex); + } + } else { + $classyIndex = $this->fixClassy($tokens, $classyIndex); } - $classIndex = $tokens->getNextTokenOfKind($classIndex, [[T_CLASS]]); + $classyIndex = $tokens->getNextTokenOfKind($classyIndex, $classyTokensOfInterest); } } - private function fixClass(Tokens $tokens, int $index): int + private function fixClassy(Tokens $tokens, int $index): int { $index = $tokens->getNextTokenOfKind($index, ['{']); $classOpenCount = 1; @@ -159,7 +187,7 @@ private function fixClass(Tokens $tokens, int $index): int } elseif ($tokens[$index]->equals('{')) { ++$openCount; } else { - $index = $this->fixClass($tokens, $index); + $index = $this->fixClassy($tokens, $index); } } while ($openCount > 0); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php index 2c8c8dcb..5b1f781e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; @@ -35,12 +36,21 @@ * * @author Javier Spagnoletti * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * elements?: list<'const'|'property'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * elements: list<'const'|'property'> + * } */ final class SingleClassElementPerStatementFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); @@ -56,9 +66,6 @@ public function getPriority(): int return 56; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -87,9 +94,6 @@ final class Example ); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $analyzer = new TokensAnalyzer($tokens); @@ -104,9 +108,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $values = ['const', 'property']; @@ -114,7 +115,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn return new FixerConfigurationResolver([ (new FixerOptionBuilder('elements', 'List of strings which element should be modified.')) ->setDefault($values) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset($values)]) ->getOption(), ]); @@ -207,7 +208,7 @@ private function expandElement(Tokens $tokens, string $type, int $startIndex, in } /** - * @return Token[] + * @return list */ private function getModifiersSequences(Tokens $tokens, string $type, int $startIndex, int $endIndex): array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php index d3d839fb..03eb845a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php @@ -70,7 +70,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @param int[] $candidates ',' indices to fix + * @param list $candidates ',' indices to fix */ private function fixTraitUse(Tokens $tokens, int $useTraitIndex, array $candidates): void { @@ -83,7 +83,7 @@ private function fixTraitUse(Tokens $tokens, int $useTraitIndex, array $candidat $nextImportStartIndex = $tokens->getNextMeaningfulToken($commaIndex); if ($tokens[$nextImportStartIndex - 1]->isWhitespace()) { - if (1 === Preg::match('/\R/', $tokens[$nextImportStartIndex - 1]->getContent())) { + if (Preg::match('/\R/', $tokens[$nextImportStartIndex - 1]->getContent())) { array_unshift($inserts, clone $tokens[$useTraitIndex - 1]); } $tokens->clearAt($nextImportStartIndex - 1); @@ -95,7 +95,7 @@ private function fixTraitUse(Tokens $tokens, int $useTraitIndex, array $candidat } /** - * @return int[] + * @return list */ private function getCandidates(Tokens $tokens, int $index): array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/VisibilityRequiredFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/VisibilityRequiredFixer.php index fc8f6eba..b85f4cf9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/VisibilityRequiredFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/VisibilityRequiredFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -32,12 +33,21 @@ * Fixer for rules defined in PSR2 ¶4.3, ¶4.5. * * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * elements?: list<'const'|'method'|'property'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * elements: list<'const'|'method'|'property'> + * } */ final class VisibilityRequiredFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -79,31 +89,22 @@ public function getPriority(): int return 56; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('elements', 'The structural elements to fix (PHP >= 7.1 required for `const`).')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset(['property', 'method', 'const'])]) ->setDefault(['property', 'method', 'const']) ->getOption(), ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); @@ -118,7 +119,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } $expectedKindsGeneric = [T_ABSTRACT, T_FINAL, T_PRIVATE, T_PROTECTED, T_PUBLIC, T_STATIC, T_VAR]; - $expectedKindsPropertyKinds = array_merge($expectedKindsGeneric, $propertyTypeDeclarationKinds); + $expectedKindsPropertyKinds = [...$expectedKindsGeneric, ...$propertyTypeDeclarationKinds]; foreach (array_reverse($tokensAnalyzer->getClassyElements(), true) as $index => $element) { if (!\in_array($element['type'], $this->configuration['elements'], true)) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassUsage/DateTimeImmutableFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassUsage/DateTimeImmutableFixer.php index 1d0610ea..2add0308 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassUsage/DateTimeImmutableFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassUsage/DateTimeImmutableFixer.php @@ -27,9 +27,6 @@ */ final class DateTimeImmutableFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -40,25 +37,16 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionsAnalyzer = new FunctionsAnalyzer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php index 834aca31..770814b2 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -31,25 +32,31 @@ /** * @author Kuba Werłos + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * ignored_tags?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * ignored_tags: list + * } */ final class CommentToPhpdocFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** - * @var string[] + * @var list */ private array $ignoredTags = []; - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_COMMENT); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; @@ -58,7 +65,7 @@ public function isRisky(): bool /** * {@inheritdoc} * - * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. + * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocArrayTypeFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. * Must run after AlignMultilineCommentFixer. */ public function getPriority(): int @@ -67,9 +74,6 @@ public function getPriority(): int return 26; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -83,37 +87,24 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void + protected function configurePostNormalisation(): void { - parent::configure($configuration); - $this->ignoredTags = array_map( - static function (string $tag): string { - return strtolower($tag); - }, + static fn (string $tag): string => strtolower($tag), $this->configuration['ignored_tags'] ); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('ignored_tags', 'List of ignored tags.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setDefault([]) ->getOption(), ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $commentsAnalyzer = new CommentsAnalyzer(); @@ -144,7 +135,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @param int[] $indices + * @param list $indices */ private function isCommentCandidate(Tokens $tokens, array $indices): bool { @@ -154,7 +145,7 @@ function (bool $carry, int $index) use ($tokens): bool { if ($carry) { return true; } - if (1 !== Preg::match('~(?:#|//|/\*+|\R(?:\s*\*)?)\s*\@([a-zA-Z0-9_\\\\-]+)(?=\s|\(|$)~', $tokens[$index]->getContent(), $matches)) { + if (!Preg::match('~(?:#|//|/\*+|\R(?:\s*\*)?)\s*\@([a-zA-Z0-9_\\\-]+)(?=\s|\(|$)~', $tokens[$index]->getContent(), $matches)) { return false; } @@ -165,12 +156,12 @@ function (bool $carry, int $index) use ($tokens): bool { } /** - * @param int[] $indices + * @param non-empty-list $indices */ private function fixComment(Tokens $tokens, array $indices): void { if (1 === \count($indices)) { - $this->fixCommentSingleLine($tokens, reset($indices)); + $this->fixCommentSingleLine($tokens, $indices[0]); } else { $this->fixCommentMultiLine($tokens, $indices); } @@ -192,11 +183,11 @@ private function fixCommentSingleLine(Tokens $tokens, int $index): void } /** - * @param int[] $indices + * @param non-empty-list $indices */ private function fixCommentMultiLine(Tokens $tokens, array $indices): void { - $startIndex = reset($indices); + $startIndex = $indices[0]; $indent = Utils::calculateTrailingWhitespaceIndent($tokens[$startIndex - 1]); $newContent = '/**'.$this->whitespacesConfig->getLineEnding(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php index 044bf1e8..cdf0be00 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php @@ -17,6 +17,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -31,9 +32,27 @@ /** * @author Antonio J. García Lagar + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * comment_type?: 'PHPDoc'|'comment', + * header: string, + * location?: 'after_declare_strict'|'after_open', + * separate?: 'both'|'bottom'|'none'|'top' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * comment_type: 'PHPDoc'|'comment', + * header: string, + * location: 'after_declare_strict'|'after_open', + * separate: 'both'|'bottom'|'none'|'top' + * } */ final class HeaderCommentFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -44,9 +63,6 @@ final class HeaderCommentFixer extends AbstractFixer implements ConfigurableFixe */ public const HEADER_COMMENT = 'comment'; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -113,18 +129,15 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - return $tokens->isMonolithicPhp(); + return $tokens->isMonolithicPhp() && !$tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO); } /** * {@inheritdoc} * - * Must run before SingleLineCommentStyleFixer. + * Must run before BlankLinesBeforeNamespaceFixer, SingleBlankLineBeforeNamespaceFixer, SingleLineCommentStyleFixer. * Must run after DeclareStrictTypesFixer, NoBlankLinesAfterPhpdocFixer. */ public function getPriority(): int @@ -135,9 +148,6 @@ public function getPriority(): int return -30; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $location = $this->configuration['location']; @@ -172,7 +182,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $expectedLocation = $possibleLocation === $location; if (!$sameComment || !$expectedLocation) { - if ($expectedLocation ^ $sameComment) { + if ($expectedLocation xor $sameComment) { $this->removeHeader($tokens, $headerCurrentIndex); } @@ -191,9 +201,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $fixerName = $this->getName(); @@ -278,11 +285,7 @@ private function findHeaderCommentCurrentIndex(Tokens $tokens, int $headerNewInd */ private function findHeaderCommentInsertionIndex(Tokens $tokens, string $location): int { - $openTagIndex = $tokens[0]->isGivenKind(T_OPEN_TAG) ? 0 : $tokens->getNextTokenOfKind(0, [[T_OPEN_TAG]]); - - if (null === $openTagIndex) { - return 1; - } + $openTagIndex = $tokens[0]->isGivenKind(T_INLINE_HTML) ? 1 : 0; if ('after_open' === $location) { return $openTagIndex + 1; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php index d27585ea..055c701b 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php @@ -27,9 +27,6 @@ */ final class MultilineCommentOpeningClosingFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -37,37 +34,31 @@ public function getDefinition(): FixerDefinitionInterface [ new CodeSample( <<<'EOT' -isAnyTokenKindsFound([T_COMMENT, T_DOC_COMMENT]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -84,11 +75,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void // Fix opening if ($token->isGivenKind(T_COMMENT)) { - $newContent = Preg::replace('/^\\/\\*{2,}(?!\\/)/', '/*', $newContent); + $newContent = Preg::replace('/^\/\*{2,}(?!\/)/', '/*', $newContent); } // Fix closing - $newContent = Preg::replace('/(?getId(), $newContent]); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php index 7d3ca2c5..23f0b1a3 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php @@ -40,9 +40,6 @@ public function getPriority(): int return 2; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -51,17 +48,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = 1, $count = \count($tokens); $index < $count; ++$index) { @@ -69,7 +60,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - [$blockStart, $index, $isEmpty] = $this->getCommentBlock($tokens, $index); + $blockInfo = $this->getCommentBlock($tokens, $index); + $blockStart = $blockInfo['blockStart']; + $index = $blockInfo['blockEnd']; + $isEmpty = $blockInfo['isEmpty']; + if (false === $isEmpty) { continue; } @@ -84,6 +79,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void * Return the start index, end index and a flag stating if the comment block is empty. * * @param int $index T_COMMENT index + * + * @return array{blockStart: int, blockEnd: int, isEmpty: bool} */ private function getCommentBlock(Tokens $tokens, int $index): array { @@ -91,7 +88,11 @@ private function getCommentBlock(Tokens $tokens, int $index): array $empty = $this->isEmptyComment($tokens[$index]->getContent()); if (self::TYPE_SLASH_ASTERISK === $commentType) { - return [$index, $index, $empty]; + return [ + 'blockStart' => $index, + 'blockEnd' => $index, + 'isEmpty' => $empty, + ]; } $start = $index; @@ -116,7 +117,11 @@ private function getCommentBlock(Tokens $tokens, int $index): array } } - return [$start, $index - 1, $empty]; + return [ + 'blockStart' => $start, + 'blockEnd' => $index - 1, + 'isEmpty' => $empty, + ]; } private function getCommentType(string $content): int @@ -152,6 +157,6 @@ private function isEmptyComment(string $content): bool $type = $this->getCommentType($content); - return 1 === Preg::match($mapper[$type], $content); + return Preg::match($mapper[$type], $content); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoTrailingWhitespaceInCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoTrailingWhitespaceInCommentFixer.php index 2c37ae09..d17a4495 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoTrailingWhitespaceInCommentFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoTrailingWhitespaceInCommentFixer.php @@ -27,9 +27,6 @@ */ final class NoTrailingWhitespaceInCommentFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -51,17 +48,11 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_COMMENT, T_DOC_COMMENT]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentSpacingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentSpacingFixer.php index 490ee88f..7b6931cc 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentSpacingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentSpacingFixer.php @@ -24,9 +24,6 @@ final class SingleLineCommentSpacingFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -53,17 +50,11 @@ public function getPriority(): int return 1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = \count($tokens) - 1; 0 <= $index; --$index) { @@ -108,7 +99,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void // fix space between comment open and leading text private function fixCommentLeadingSpace(string $content, string $prefix): string { - if (0 !== Preg::match(sprintf('@^%s\h+.*$@', preg_quote($prefix, '@')), $content)) { + if (Preg::match(\sprintf('@^%s\h+.*$@', preg_quote($prefix, '@')), $content)) { return $content; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php index 21df338a..e4261fc9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -29,33 +30,25 @@ /** * @author Filippo Tessarotto + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * comment_types?: list<'asterisk'|'hash'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * comment_types: list<'asterisk'|'hash'> + * } */ final class SingleLineCommentStyleFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * @var bool - */ - private $asteriskEnabled; + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; - /** - * @var bool - */ - private $hashEnabled; - - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); + private bool $asteriskEnabled; - $this->asteriskEnabled = \in_array('asterisk', $this->configuration['comment_types'], true); - $this->hashEnabled = \in_array('hash', $this->configuration['comment_types'], true); - } + private bool $hashEnabled; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -112,17 +105,17 @@ public function getPriority(): int return -31; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_COMMENT); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->asteriskEnabled = \in_array('asterisk', $this->configuration['comment_types'], true); + $this->hashEnabled = \in_array('hash', $this->configuration['comment_types'], true); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -131,7 +124,9 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } $content = $token->getContent(); - $commentContent = substr($content, 2, -2) ?: ''; + + /** @TODO PHP 8.0 - no more need for `?: ''` */ + $commentContent = substr($content, 2, -2) ?: ''; // @phpstan-ignore-line if ($this->hashEnabled && str_starts_with($content, '#')) { if (isset($content[1]) && '[' === $content[1]) { @@ -147,7 +142,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void !$this->asteriskEnabled || str_contains($commentContent, '?>') || !str_starts_with($content, '/*') - || 1 === Preg::match('/[^\s\*].*\R.*[^\s\*]/s', $commentContent) + || Preg::match('/[^\s\*].*\R.*[^\s\*]/s', $commentContent) ) { continue; } @@ -155,7 +150,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $nextTokenIndex = $index + 1; if (isset($tokens[$nextTokenIndex])) { $nextToken = $tokens[$nextTokenIndex]; - if (!$nextToken->isWhitespace() || 1 !== Preg::match('/\R/', $nextToken->getContent())) { + if (!$nextToken->isWhitespace() || !Preg::match('/\R/', $nextToken->getContent())) { continue; } @@ -163,21 +158,18 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } $content = '//'; - if (1 === Preg::match('/[^\s\*]/', $commentContent)) { + if (Preg::match('/[^\s\*]/', $commentContent)) { $content = '// '.Preg::replace('/[\s\*]*([^\s\*](?:.+[^\s\*])?)[\s\*]*/', '\1', $commentContent); } $tokens[$index] = new Token([$token->getId(), $content]); } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('comment_types', 'List of comment types to fix.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset(['asterisk', 'hash'])]) ->setDefault(['asterisk', 'hash']) ->getOption(), diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerInterface.php index 1cc18ad1..443141c3 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerInterface.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerInterface.php @@ -19,6 +19,9 @@ /** * @author Dariusz Rumiński + * + * @template TFixerInputConfig of array + * @template TFixerComputedConfig of array */ interface ConfigurableFixerInterface extends FixerInterface { @@ -34,7 +37,7 @@ interface ConfigurableFixerInterface extends FixerInterface * eg `php_unit_strict` fixer allows to configure which methods should be fixed. * Finally, some fixers need configuration to work, eg `header_comment`. * - * @param array $configuration configuration depends on Fixer + * @param TFixerInputConfig $configuration configuration depends on Fixer * * @throws InvalidFixerConfigurationException */ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerTrait.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerTrait.php new file mode 100644 index 00000000..b0120994 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerTrait.php @@ -0,0 +1,124 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer; + +use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; +use PhpCsFixer\ConfigurationException\InvalidForEnvFixerConfigurationException; +use PhpCsFixer\ConfigurationException\RequiredFixerConfigurationException; +use PhpCsFixer\Console\Application; +use PhpCsFixer\FixerConfiguration\DeprecatedFixerOption; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\InvalidOptionsForEnvException; +use PhpCsFixer\Utils; +use Symfony\Component\OptionsResolver\Exception\ExceptionInterface; +use Symfony\Component\OptionsResolver\Exception\MissingOptionsException; + +/** + * @author Dariusz Rumiński + * + * @internal + * + * @template TFixerInputConfig of array + * @template TFixerComputedConfig of array + */ +trait ConfigurableFixerTrait +{ + /** + * @var null|TFixerComputedConfig + */ + protected ?array $configuration = null; + + private ?FixerConfigurationResolverInterface $configurationDefinition = null; + + /** + * @param TFixerInputConfig $configuration + */ + final public function configure(array $configuration): void + { + $this->configurePreNormalisation($configuration); + + foreach ($this->getConfigurationDefinition()->getOptions() as $option) { + if (!$option instanceof DeprecatedFixerOption) { + continue; + } + + $name = $option->getName(); + if (\array_key_exists($name, $configuration)) { + Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( + 'Option "%s" for rule "%s" is deprecated and will be removed in version %d.0. %s', + $name, + $this->getName(), + Application::getMajorVersion() + 1, + str_replace('`', '"', $option->getDeprecationMessage()) + ))); + } + } + + try { + $this->configuration = $this->getConfigurationDefinition()->resolve($configuration); // @phpstan-ignore-line ->configuration typehint is autogenerated base on ConfigurationDefinition + } catch (MissingOptionsException $exception) { + throw new RequiredFixerConfigurationException( + $this->getName(), + \sprintf('Missing required configuration: %s', $exception->getMessage()), + $exception + ); + } catch (InvalidOptionsForEnvException $exception) { + throw new InvalidForEnvFixerConfigurationException( + $this->getName(), + \sprintf('Invalid configuration for env: %s', $exception->getMessage()), + $exception + ); + } catch (ExceptionInterface $exception) { + throw new InvalidFixerConfigurationException( + $this->getName(), + \sprintf('Invalid configuration: %s', $exception->getMessage()), + $exception + ); + } + + $this->configurePostNormalisation(); + } + + final public function getConfigurationDefinition(): FixerConfigurationResolverInterface + { + if (null === $this->configurationDefinition) { + $this->configurationDefinition = $this->createConfigurationDefinition(); + } + + return $this->configurationDefinition; + } + + abstract public function getName(): string; + + /** + * One can override me. + * + * @param TFixerInputConfig $configuration + */ + protected function configurePreNormalisation(array &$configuration): void + { + // 🤔 ideally this method won't be needed, maybe we can remove it over time + } + + /** + * One can override me. + */ + protected function configurePostNormalisation(): void + { + // 🤔 ideally this method won't be needed, maybe we can remove it over time + } + + abstract protected function createConfigurationDefinition(): FixerConfigurationResolverInterface; +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php index 509f1372..7b53770b 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -23,7 +24,6 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; @@ -32,9 +32,29 @@ /** * @author Filippo Tessarotto + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * exclude?: list, + * fix_built_in?: bool, + * include?: list, + * scope?: 'all'|'namespaced', + * strict?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * exclude: list, + * fix_built_in: bool, + * include: list, + * scope: 'all'|'namespaced', + * strict: bool + * } */ final class NativeConstantInvocationFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @var array */ @@ -45,9 +65,6 @@ final class NativeConstantInvocationFixer extends AbstractFixer implements Confi */ private array $caseInsensitiveConstantsToEscape = []; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -100,35 +117,25 @@ public function getDefinition(): FixerDefinitionInterface * {@inheritdoc} * * Must run before GlobalNamespaceImportFixer. + * Must run after FunctionToConstantFixer. */ public function getPriority(): int { - return 10; + return 1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void + protected function configurePostNormalisation(): void { - parent::configure($configuration); - $uniqueConfiguredExclude = array_unique($this->configuration['exclude']); // Case-sensitive constants handling @@ -138,10 +145,11 @@ public function configure(array $configuration): void $getDefinedConstants = get_defined_constants(true); unset($getDefinedConstants['user']); foreach ($getDefinedConstants as $constants) { - $constantsToEscape = array_merge($constantsToEscape, array_keys($constants)); + $constantsToEscape = [...$constantsToEscape, ...array_keys($constants)]; } } + /** @var list */ $constantsToEscape = array_diff( array_unique($constantsToEscape), $uniqueConfiguredExclude @@ -175,9 +183,6 @@ public function configure(array $configuration): void ksort($this->caseInsensitiveConstantsToEscape); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { if ('all' === $this->configuration['scope']) { @@ -186,7 +191,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void return; } - $namespaces = (new NamespacesAnalyzer())->getDeclarations($tokens); + $namespaces = $tokens->getNamespaceDeclarations(); // 'scope' is 'namespaced' here /** @var NamespaceAnalysis $namespace */ @@ -199,15 +204,12 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $constantChecker = static function (array $value): bool { foreach ($value as $constantName) { - if (!\is_string($constantName) || '' === trim($constantName) || trim($constantName) !== $constantName) { - throw new InvalidOptionsException(sprintf( + if (trim($constantName) !== $constantName) { + throw new InvalidOptionsException(\sprintf( 'Each element must be a non-empty, trimmed string, got "%s" instead.', get_debug_type($constantName) )); @@ -223,12 +225,12 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setDefault(true) ->getOption(), (new FixerOptionBuilder('include', 'List of additional constants to fix.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([$constantChecker]) ->setDefault([]) ->getOption(), (new FixerOptionBuilder('exclude', 'List of constants to ignore.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([$constantChecker]) ->setDefault(['null', 'false', 'true']) ->getOption(), diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureBracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureBracesFixer.php index fc9ef57f..f89d959a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureBracesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureBracesFixer.php @@ -24,9 +24,6 @@ final class ControlStructureBracesFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -35,9 +32,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return true; @@ -46,16 +40,13 @@ public function isCandidate(Tokens $tokens): bool /** * {@inheritdoc} * - * Must run before ControlStructureContinuationPositionFixer, CurlyBracesPositionFixer, NoMultipleStatementsPerLineFixer. + * Must run before BracesPositionFixer, ControlStructureContinuationPositionFixer, CurlyBracesPositionFixer, NoMultipleStatementsPerLineFixer. */ public function getPriority(): int { return 1; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $alternativeSyntaxAnalyzer = new AlternativeSyntaxAnalyzer(); @@ -139,12 +130,12 @@ private function findParenthesisEnd(Tokens $tokens, int $structureTokenIndex): i private function findStatementEnd(Tokens $tokens, int $parenthesisEndIndex): int { $nextIndex = $tokens->getNextMeaningfulToken($parenthesisEndIndex); - $nextToken = $tokens[$nextIndex]; - - if (!$nextToken) { + if (null === $nextIndex) { return $parenthesisEndIndex; } + $nextToken = $tokens[$nextIndex]; + if ($nextToken->equals('{')) { return $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $nextIndex); } @@ -159,13 +150,12 @@ private function findStatementEnd(Tokens $tokens, int $parenthesisEndIndex): int while (true) { $nextIndex = $tokens->getNextMeaningfulToken($endIndex); - $nextToken = isset($nextIndex) ? $tokens[$nextIndex] : null; - if ($nextToken && $nextToken->isGivenKind($this->getControlContinuationTokensForOpeningToken($openingTokenKind))) { + if (null !== $nextIndex && $tokens[$nextIndex]->isGivenKind($this->getControlContinuationTokensForOpeningToken($openingTokenKind))) { $parenthesisEndIndex = $this->findParenthesisEnd($tokens, $nextIndex); $endIndex = $this->findStatementEnd($tokens, $parenthesisEndIndex); - if ($nextToken->isGivenKind($this->getFinalControlContinuationTokensForOpeningToken($openingTokenKind))) { + if ($tokens[$nextIndex]->isGivenKind($this->getFinalControlContinuationTokensForOpeningToken($openingTokenKind))) { return $endIndex; } } else { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureContinuationPositionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureContinuationPositionFixer.php index 2b04e56d..95639763 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureContinuationPositionFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureContinuationPositionFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -26,8 +27,21 @@ use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; use PhpCsFixer\Tokenizer\Tokens; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * position?: 'next_line'|'same_line' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * position: 'next_line'|'same_line' + * } + */ final class ControlStructureContinuationPositionFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -46,9 +60,6 @@ final class ControlStructureContinuationPositionFixer extends AbstractFixer impl T_WHILE, ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ElseifFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ElseifFixer.php index dc50f2ba..19c810ec 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ElseifFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ElseifFixer.php @@ -28,9 +28,6 @@ */ final class ElseifFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -49,9 +46,6 @@ public function getPriority(): int return 40; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_IF, T_ELSE]); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopBodyFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopBodyFixer.php index 6ba0c383..03f6a905 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopBodyFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopBodyFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -26,17 +27,27 @@ use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * style?: 'braces'|'semicolon' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * style: 'braces'|'semicolon' + * } + */ final class EmptyLoopBodyFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + private const STYLE_BRACES = 'braces'; private const STYLE_SEMICOLON = 'semicolon'; private const TOKEN_LOOP_KINDS = [T_FOR, T_FOREACH, T_WHILE]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -64,17 +75,11 @@ public function getPriority(): int return 39; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(self::TOKEN_LOOP_KINDS); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { if (self::STYLE_BRACES === $this->configuration['style']) { @@ -121,9 +126,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php index 7f82fc4a..2feac4ea 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -25,17 +26,27 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * style?: 'for'|'while' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * style: 'for'|'while' + * } + */ final class EmptyLoopConditionFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + private const STYLE_FOR = 'for'; private const STYLE_WHILE = 'while'; private const TOKEN_LOOP_KINDS = [T_FOR, T_WHILE]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -57,17 +68,11 @@ public function getPriority(): int return 1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(self::TOKEN_LOOP_KINDS); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { if (self::STYLE_WHILE === $this->configuration['style']) { @@ -119,9 +124,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -143,7 +145,7 @@ private static function clearNotCommentsInRange(Tokens $tokens, int $indexStart, } /** - * @param Token[] $replacement + * @param list $replacement */ private static function cloneAndInsert(Tokens $tokens, int $index, array $replacement): void { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/IncludeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/IncludeFixer.php index 99a3c85a..a0bd5acc 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/IncludeFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/IncludeFixer.php @@ -29,13 +29,10 @@ */ final class IncludeFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Include/Require and file path should be divided with a single space. File path should not be placed under brackets.', + 'Include/Require and file path should be divided with a single space. File path should not be placed within parentheses.', [ new CodeSample( 'isAnyTokenKindsFound([T_REQUIRE, T_REQUIRE_ONCE, T_INCLUDE, T_INCLUDE_ONCE]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $this->clearIncludies($tokens, $this->findIncludies($tokens)); @@ -73,7 +64,7 @@ private function clearIncludies(Tokens $tokens, array $includies): void $blocksAnalyzer = new BlocksAnalyzer(); foreach ($includies as $includy) { - if ($includy['end'] && !$tokens[$includy['end']]->isGivenKind(T_CLOSE_TAG)) { + if (!$tokens[$includy['end']]->isGivenKind(T_CLOSE_TAG)) { $afterEndIndex = $tokens->getNextNonWhitespace($includy['end']); if (null === $afterEndIndex || !$tokens[$afterEndIndex]->isComment()) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoAlternativeSyntaxFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoAlternativeSyntaxFixer.php index 5e112f40..c0622fd2 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoAlternativeSyntaxFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoAlternativeSyntaxFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -27,12 +28,21 @@ /** * @author Eddilbert Macharia + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * fix_non_monolithic_code?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * fix_non_monolithic_code: bool + * } */ final class NoAlternativeSyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -49,9 +59,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->hasAlternativeSyntax() && (true === $this->configuration['fix_non_monolithic_code'] || $tokens->isMonolithicPhp()); @@ -67,9 +74,6 @@ public function getPriority(): int return 42; } - /** - * {@inheritDoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -80,9 +84,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = \count($tokens) - 1; 0 <= $index; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php index dfcb2088..821df86c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -32,12 +33,21 @@ /** * Fixer for rule defined in PSR2 ¶5.2. + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * comment_text?: string + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * comment_text: string + * } */ final class NoBreakCommentFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -73,9 +83,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_SWITCH); @@ -91,9 +98,6 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -108,17 +112,12 @@ static function (string $value): bool { return true; }, ]) - ->setNormalizer(static function (Options $options, string $value): string { - return rtrim($value); - }) + ->setNormalizer(static fn (Options $options, string $value): string => rtrim($value)) ->setDefault('no break') ->getOption(), ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = \count($tokens) - 1; $index >= 0; --$index) { @@ -141,7 +140,7 @@ private function fixCase(Tokens $tokens, int $casePosition): void $commentPosition = null; for ($i = $casePosition + 1, $max = \count($tokens); $i < $max; ++$i) { - if ($tokens[$i]->isGivenKind([T_SWITCH, T_IF, T_ELSE, T_ELSEIF, T_FOR, T_FOREACH, T_WHILE, T_DO, T_FUNCTION, T_CLASS])) { + if ($tokens[$i]->isGivenKind([...self::getParenthesisedStructureKinds(), T_ELSE, T_DO, T_CLASS])) { $empty = false; $i = $this->getStructureEnd($tokens, $i); @@ -217,7 +216,7 @@ private function isNoBreakComment(Token $token): bool $text = preg_quote($this->configuration['comment_text'], '~'); - return 1 === Preg::match("~^((//|#)\\s*{$text}\\s*)|(/\\*\\*?\\s*{$text}(\\s+.*)*\\*/)$~i", $token->getContent()); + return Preg::match("~^((//|#)\\s*{$text}\\s*)|(/\\*\\*?\\s*{$text}(\\s+.*)*\\*/)$~i", $token->getContent()); } private function insertCommentAt(Tokens $tokens, int $casePosition): void @@ -312,7 +311,7 @@ private function getStructureEnd(Tokens $tokens, int $position): int { $initialToken = $tokens[$position]; - if ($initialToken->isGivenKind([T_FOR, T_FOREACH, T_WHILE, T_IF, T_ELSEIF, T_SWITCH, T_FUNCTION])) { + if ($initialToken->isGivenKind(self::getParenthesisedStructureKinds())) { $position = $tokens->findBlockEnd( Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $tokens->getNextTokenOfKind($position, ['(']) @@ -347,4 +346,21 @@ private function getStructureEnd(Tokens $tokens, int $position): int return $position; } + + /** + * @return list + */ + private static function getParenthesisedStructureKinds(): array + { + static $structureKinds = null; + + if (null === $structureKinds) { + $structureKinds = [T_FOR, T_FOREACH, T_WHILE, T_IF, T_ELSEIF, T_SWITCH, T_FUNCTION]; + if (\defined('T_MATCH')) { // @TODO: drop condition when PHP 8.0+ is required + $structureKinds[] = T_MATCH; + } + } + + return $structureKinds; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoSuperfluousElseifFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoSuperfluousElseifFixer.php index 9df093d3..93dbb083 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoSuperfluousElseifFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoSuperfluousElseifFixer.php @@ -24,17 +24,11 @@ final class NoSuperfluousElseifFixer extends AbstractNoUselessElseFixer { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_ELSE, T_ELSEIF]); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -56,9 +50,6 @@ public function getPriority(): int return parent::getPriority(); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoTrailingCommaInListCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoTrailingCommaInListCallFixer.php index 00cb3da0..4b710058 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoTrailingCommaInListCallFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoTrailingCommaInListCallFixer.php @@ -28,9 +28,6 @@ */ final class NoTrailingCommaInListCallFixer extends AbstractProxyFixer implements DeprecatedFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -39,17 +36,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function getSuccessorsNames(): array { return array_keys($this->proxyFixers); } - /** - * {@inheritdoc} - */ protected function createProxyFixers(): array { $fixer = new NoTrailingCommaInSinglelineFixer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php new file mode 100644 index 00000000..ce46c859 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php @@ -0,0 +1,182 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\ControlStructure; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * namespaces?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * namespaces: bool + * } + */ +final class NoUnneededBracesFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Removes unneeded braces that are superfluous and aren\'t part of a control structure\'s body.', + [ + new CodeSample( + ' true] + ), + ] + ); + } + + /** + * {@inheritdoc} + * + * Must run before NoUselessElseFixer, NoUselessReturnFixer, ReturnAssignmentFixer, SimplifiedIfReturnFixer. + */ + public function getPriority(): int + { + return 40; + } + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isTokenKindFound('}'); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + foreach ($this->findBraceOpen($tokens) as $index) { + if ($this->isOverComplete($tokens, $index)) { + $this->clearOverCompleteBraces($tokens, $index, $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index)); + } + } + + if (true === $this->configuration['namespaces']) { + $this->clearIfIsOverCompleteNamespaceBlock($tokens); + } + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('namespaces', 'Remove unneeded braces from bracketed namespaces.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + ]); + } + + /** + * @param int $openIndex index of `{` token + * @param int $closeIndex index of `}` token + */ + private function clearOverCompleteBraces(Tokens $tokens, int $openIndex, int $closeIndex): void + { + $tokens->clearTokenAndMergeSurroundingWhitespace($closeIndex); + $tokens->clearTokenAndMergeSurroundingWhitespace($openIndex); + } + + /** + * @return iterable + */ + private function findBraceOpen(Tokens $tokens): iterable + { + for ($i = \count($tokens) - 1; $i > 0; --$i) { + if ($tokens[$i]->equals('{')) { + yield $i; + } + } + } + + /** + * @param int $index index of `{` token + */ + private function isOverComplete(Tokens $tokens, int $index): bool + { + static $include = ['{', '}', [T_OPEN_TAG], ':', ';']; + + return $tokens[$tokens->getPrevMeaningfulToken($index)]->equalsAny($include); + } + + private function clearIfIsOverCompleteNamespaceBlock(Tokens $tokens): void + { + if (1 !== $tokens->countTokenKind(T_NAMESPACE)) { + return; // fast check, we never fix if multiple namespaces are defined + } + + $index = $tokens->getNextTokenOfKind(0, [[T_NAMESPACE]]); + + $namespaceIsNamed = false; + + $index = $tokens->getNextMeaningfulToken($index); + while ($tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR])) { + $index = $tokens->getNextMeaningfulToken($index); + $namespaceIsNamed = true; + } + + if (!$namespaceIsNamed) { + return; + } + + if (!$tokens[$index]->equals('{')) { + return; // `;` + } + + $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); + $afterCloseIndex = $tokens->getNextMeaningfulToken($closeIndex); + + if (null !== $afterCloseIndex && (!$tokens[$afterCloseIndex]->isGivenKind(T_CLOSE_TAG) || null !== $tokens->getNextMeaningfulToken($afterCloseIndex))) { + return; + } + + // clear up + $tokens->clearTokenAndMergeSurroundingWhitespace($closeIndex); + $tokens[$index] = new Token(';'); + + if ($tokens[$index - 1]->isWhitespace(" \t") && !$tokens[$index - 2]->isComment()) { + $tokens->clearTokenAndMergeSurroundingWhitespace($index - 1); + } + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php index 6d381385..6b2c3cb1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -32,11 +33,23 @@ * @author Sullivan Senechal * @author Dariusz Rumiński * @author Gregor Harlan + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * statements?: list<'break'|'clone'|'continue'|'echo_print'|'negative_instanceof'|'others'|'return'|'switch_case'|'yield'|'yield_from'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * statements: list<'break'|'clone'|'continue'|'echo_print'|'negative_instanceof'|'others'|'return'|'switch_case'|'yield'|'yield_from'> + * } */ final class NoUnneededControlParenthesesFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** - * @var int[] + * @var list */ private const BLOCK_TYPES = [ Tokens::BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE, @@ -69,28 +82,6 @@ final class NoUnneededControlParenthesesFixer extends AbstractFixer implements C [T_INCLUDE_ONCE], ]; - private const NOOP_TYPES = [ - '$', - [T_CONSTANT_ENCAPSED_STRING], - [T_DNUMBER], - [T_DOUBLE_COLON], - [T_LNUMBER], - [T_NS_SEPARATOR], - [T_OBJECT_OPERATOR], - [T_STRING], - [T_VARIABLE], - [T_STATIC], - // magic constants - [T_CLASS_C], - [T_DIR], - [T_FILE], - [T_FUNC_C], - [T_LINE], - [T_METHOD_C], - [T_NS_C], - [T_TRAIT_C], - ]; - private const CONFIG_OPTIONS = [ 'break', 'clone', @@ -123,11 +114,43 @@ final class NoUnneededControlParenthesesFixer extends AbstractFixer implements C T_INCLUDE_ONCE, ]; - private TokensAnalyzer $tokensAnalyzer; - /** - * {@inheritdoc} + * @var list */ + private array $noopTypes; + + private TokensAnalyzer $tokensAnalyzer; + + public function __construct() + { + parent::__construct(); + + $this->noopTypes = [ + '$', + [T_CONSTANT_ENCAPSED_STRING], + [T_DNUMBER], + [T_DOUBLE_COLON], + [T_LNUMBER], + [T_NS_SEPARATOR], + [T_STRING], + [T_VARIABLE], + [T_STATIC], + // magic constants + [T_CLASS_C], + [T_DIR], + [T_FILE], + [T_FUNC_C], + [T_LINE], + [T_METHOD_C], + [T_NS_C], + [T_TRAIT_C], + ]; + + foreach (Token::getObjectOperatorKinds() as $kind) { + $this->noopTypes[] = [$kind]; + } + } + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -170,17 +193,11 @@ public function getPriority(): int return 30; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(['(', CT::T_BRACE_CLASS_INSTANTIATION_OPEN]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $this->tokensAnalyzer = new TokensAnalyzer($tokens); @@ -258,21 +275,16 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $defaults = array_filter( self::CONFIG_OPTIONS, - static function (string $option): bool { - return 'negative_instanceof' !== $option && 'others' !== $option && 'yield_from' !== $option; - } + static fn (string $option): bool => 'negative_instanceof' !== $option && 'others' !== $option && 'yield_from' !== $option ); return new FixerConfigurationResolver([ (new FixerOptionBuilder('statements', 'List of control statements to fix.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset(self::CONFIG_OPTIONS)]) ->setDefault(array_values($defaults)) ->getOption(), @@ -655,7 +667,7 @@ private function containsOperation(Tokens $tokens, int $startIndex, int $endInde continue; } - if (!$tokens[$startIndex]->equalsAny(self::NOOP_TYPES)) { + if (!$tokens[$startIndex]->equalsAny($this->noopTypes)) { return true; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededCurlyBracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededCurlyBracesFixer.php index 808e1453..40610d2a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededCurlyBracesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededCurlyBracesFixer.php @@ -14,48 +14,51 @@ namespace PhpCsFixer\Fixer\ControlStructure; -use PhpCsFixer\AbstractFixer; +use PhpCsFixer\AbstractProxyFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\Fixer\DeprecatedFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -final class NoUnneededCurlyBracesFixer extends AbstractFixer implements ConfigurableFixerInterface +/** + * @deprecated + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * namespaces?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * namespaces: bool + * } + */ +final class NoUnneededCurlyBracesFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + private NoUnneededBracesFixer $noUnneededBracesFixer; + + public function __construct() + { + $this->noUnneededBracesFixer = new NoUnneededBracesFixer(); + + parent::__construct(); + } + public function getDefinition(): FixerDefinitionInterface { + $fixerDefinition = $this->noUnneededBracesFixer->getDefinition(); + return new FixerDefinition( 'Removes unneeded curly braces that are superfluous and aren\'t part of a control structure\'s body.', - [ - new CodeSample( - ' true] - ), - ] + $fixerDefinition->getCodeSamples(), + $fixerDefinition->getDescription(), + $fixerDefinition->getRiskyDescription() ); } @@ -66,36 +69,24 @@ function Bar(){} */ public function getPriority(): int { - return 40; + return $this->noUnneededBracesFixer->getPriority(); } - /** - * {@inheritdoc} - */ - public function isCandidate(Tokens $tokens): bool + public function getSuccessorsNames(): array { - return $tokens->isTokenKindFound('}'); + return [ + $this->noUnneededBracesFixer->getName(), + ]; } /** - * {@inheritdoc} + * @param _AutogeneratedInputConfiguration $configuration */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + protected function configurePreNormalisation(array $configuration): void { - foreach ($this->findCurlyBraceOpen($tokens) as $index) { - if ($this->isOverComplete($tokens, $index)) { - $this->clearOverCompleteBraces($tokens, $index, $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index)); - } - } - - if (true === $this->configuration['namespaces']) { - $this->clearIfIsOverCompleteNamespaceBlock($tokens); - } + $this->noUnneededBracesFixer->configure($configuration); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -106,67 +97,10 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * @param int $openIndex index of `{` token - * @param int $closeIndex index of `}` token - */ - private function clearOverCompleteBraces(Tokens $tokens, int $openIndex, int $closeIndex): void - { - $tokens->clearTokenAndMergeSurroundingWhitespace($closeIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($openIndex); - } - - /** - * @return iterable - */ - private function findCurlyBraceOpen(Tokens $tokens): iterable - { - for ($i = \count($tokens) - 1; $i > 0; --$i) { - if ($tokens[$i]->equals('{')) { - yield $i; - } - } - } - - /** - * @param int $index index of `{` token - */ - private function isOverComplete(Tokens $tokens, int $index): bool - { - static $include = ['{', '}', [T_OPEN_TAG], ':', ';']; - - return $tokens[$tokens->getPrevMeaningfulToken($index)]->equalsAny($include); - } - - private function clearIfIsOverCompleteNamespaceBlock(Tokens $tokens): void + protected function createProxyFixers(): array { - if (1 !== $tokens->countTokenKind(T_NAMESPACE)) { - return; // fast check, we never fix if multiple namespaces are defined - } - - $index = $tokens->getNextTokenOfKind(0, [[T_NAMESPACE]]); - - do { - $index = $tokens->getNextMeaningfulToken($index); - } while ($tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR])); - - if (!$tokens[$index]->equals('{')) { - return; // `;` - } - - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - $afterCloseIndex = $tokens->getNextMeaningfulToken($closeIndex); - - if (null !== $afterCloseIndex && (!$tokens[$afterCloseIndex]->isGivenKind(T_CLOSE_TAG) || null !== $tokens->getNextMeaningfulToken($afterCloseIndex))) { - return; - } - - // clear up - $tokens->clearTokenAndMergeSurroundingWhitespace($closeIndex); - $tokens[$index] = new Token(';'); - - if ($tokens[$index - 1]->isWhitespace(" \t") && !$tokens[$index - 2]->isComment()) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index - 1); - } + return [ + $this->noUnneededBracesFixer, + ]; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUselessElseFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUselessElseFixer.php index 58a9a3cb..9b2d1cce 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUselessElseFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUselessElseFixer.php @@ -22,17 +22,11 @@ final class NoUselessElseFixer extends AbstractNoUselessElseFixer { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_ELSE); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -46,17 +40,14 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before BracesFixer, CombineConsecutiveUnsetsFixer, NoBreakCommentFixer, NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer, NoUselessReturnFixer, NoWhitespaceInBlankLineFixer, SimplifiedIfReturnFixer. - * Must run after NoAlternativeSyntaxFixer, NoEmptyStatementFixer, NoUnneededCurlyBracesFixer. + * Must run before BlankLineBeforeStatementFixer, BracesFixer, CombineConsecutiveUnsetsFixer, NoBreakCommentFixer, NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer, NoUselessReturnFixer, NoWhitespaceInBlankLineFixer, SimplifiedIfReturnFixer, StatementIndentationFixer. + * Must run after NoAlternativeSyntaxFixer, NoEmptyStatementFixer, NoUnneededBracesFixer, NoUnneededCurlyBracesFixer. */ public function getPriority(): int { return parent::getPriority(); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php index 513bf5ba..a3633700 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php @@ -27,7 +27,7 @@ final class SimplifiedIfReturnFixer extends AbstractFixer { /** - * @var list|string>}> + * @var list}> */ private array $sequences = [ [ @@ -60,9 +60,6 @@ final class SimplifiedIfReturnFixer extends AbstractFixer ], ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -75,24 +72,18 @@ public function getDefinition(): FixerDefinitionInterface * {@inheritdoc} * * Must run before MultilineWhitespaceBeforeSemicolonsFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer. - * Must run after NoSuperfluousElseifFixer, NoUnneededCurlyBracesFixer, NoUselessElseFixer, SemicolonAfterInstructionFixer. + * Must run after NoSuperfluousElseifFixer, NoUnneededBracesFixer, NoUnneededCurlyBracesFixer, NoUselessElseFixer, SemicolonAfterInstructionFixer. */ public function getPriority(): int { return 1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_IF, T_RETURN, T_STRING]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($ifIndex = $tokens->count() - 1; 0 <= $ifIndex; --$ifIndex) { @@ -115,7 +106,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - $firstSequenceIndex = key($sequenceFound); + $firstSequenceIndex = array_key_first($sequenceFound); if ($firstSequenceIndex !== $firstCandidateIndex) { continue; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixer.php index bbc6516a..f5e2210f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixer.php @@ -28,9 +28,6 @@ */ final class SwitchCaseSemicolonToColonFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -60,17 +57,11 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_SWITCH); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { /** @var SwitchAnalysis $analysis */ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSpaceFixer.php index a48a1462..5616e1f3 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSpaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSpaceFixer.php @@ -29,9 +29,6 @@ */ final class SwitchCaseSpaceFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -51,17 +48,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_SWITCH); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { /** @var SwitchAnalysis $analysis */ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php index 22ce3c17..b42fc3a9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php @@ -25,13 +25,10 @@ final class SwitchContinueToBreakFixer extends AbstractFixer { /** - * @var int[] + * @var list */ private array $switchLevels = []; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -77,17 +74,11 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_SWITCH, T_CONTINUE]) && !$tokens->hasAlternativeSyntax(); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $count = \count($tokens); @@ -213,7 +204,7 @@ private function fixContinueWhenActsAsBreak(Tokens $tokens, int $continueIndex, $jump = bindec($jump); // binary - 0b1 } elseif (\strlen($jump) > 1 && '0' === $jump[0]) { $jump = octdec($jump); // octal 01 - } elseif (1 === Preg::match('#^\d+$#', $jump)) { // positive int + } elseif (Preg::match('#^\d+$#', $jump)) { // positive int $jump = (float) $jump; // cast to float, might be a number bigger than PHP max. int value } else { return $afterFollowingContinueIndex; // cannot process value, ignore diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php index 0c90f993..10a39785 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php @@ -16,11 +16,11 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerConfiguration\InvalidOptionsForEnvException; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; @@ -30,15 +30,28 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; -use Symfony\Component\OptionsResolver\Options; /** * @author Sebastiaan Stok * @author Dariusz Rumiński * @author Kuba Werłos + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * after_heredoc?: bool, + * elements?: list<'arguments'|'array_destructuring'|'arrays'|'match'|'parameters'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * after_heredoc: bool, + * elements: list<'arguments'|'array_destructuring'|'arrays'|'match'|'parameters'> + * } */ final class TrailingCommaInMultilineFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -56,94 +69,84 @@ final class TrailingCommaInMultilineFixer extends AbstractFixer implements Confi private const MATCH_EXPRESSIONS = 'match'; - /** - * {@inheritdoc} - */ + private const ARRAY_DESTRUCTURING = 'array_destructuring'; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Multi-line arrays, arguments list, parameters list and `match` expressions must have a trailing comma.', + 'Arguments lists, array destructuring lists, arrays that are multi-line, `match`-lines and parameters lists must have a trailing comma.', [ new CodeSample(" true] ), - new VersionSpecificCodeSample(" [self::ELEMENTS_ARGUMENTS]]), + new CodeSample(" [self::ELEMENTS_ARGUMENTS]]), new VersionSpecificCodeSample(" [self::ELEMENTS_PARAMETERS]]), ] ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - return $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN, '(']); + return $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN, '(', CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN]); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('after_heredoc', 'Whether a trailing comma should also be placed after heredoc end.')) ->setAllowedTypes(['bool']) - ->setDefault(false) + ->setDefault(false) // @TODO 4.0: set to `true`. ->getOption(), - (new FixerOptionBuilder('elements', sprintf('Where to fix multiline trailing comma (PHP >= 8.0 for `%s` and `%s`).', self::ELEMENTS_PARAMETERS, self::MATCH_EXPRESSIONS))) // @TODO: remove text when PHP 8.0+ is required - ->setAllowedTypes(['array']) - ->setAllowedValues([new AllowedValueSubset([self::ELEMENTS_ARRAYS, self::ELEMENTS_ARGUMENTS, self::ELEMENTS_PARAMETERS, self::MATCH_EXPRESSIONS])]) + (new FixerOptionBuilder('elements', \sprintf('Where to fix multiline trailing comma (PHP >= 8.0 for `%s` and `%s`).', self::ELEMENTS_PARAMETERS, self::MATCH_EXPRESSIONS))) // @TODO: remove text when PHP 8.0+ is required + ->setAllowedTypes(['string[]']) + ->setAllowedValues([ + new AllowedValueSubset([ + self::ARRAY_DESTRUCTURING, + self::ELEMENTS_ARGUMENTS, + self::ELEMENTS_ARRAYS, + self::ELEMENTS_PARAMETERS, + self::MATCH_EXPRESSIONS, + ]), + ]) ->setDefault([self::ELEMENTS_ARRAYS]) - ->setNormalizer(static function (Options $options, $value) { - if (\PHP_VERSION_ID < 8_00_00) { // @TODO: drop condition when PHP 8.0+ is required - foreach ([self::ELEMENTS_PARAMETERS, self::MATCH_EXPRESSIONS] as $option) { - if (\in_array($option, $value, true)) { - throw new InvalidOptionsForEnvException(sprintf('"%s" option can only be enabled with PHP 8.0+.', $option)); - } - } - } - - return $value; - }) ->getOption(), ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $fixArrays = \in_array(self::ELEMENTS_ARRAYS, $this->configuration['elements'], true); - $fixArguments = \in_array(self::ELEMENTS_ARGUMENTS, $this->configuration['elements'], true); - $fixParameters = \PHP_VERSION_ID >= 8_00_00 && \in_array(self::ELEMENTS_PARAMETERS, $this->configuration['elements'], true); // @TODO: drop condition when PHP 8.0+ is required - $fixMatch = \PHP_VERSION_ID >= 8_00_00 && \in_array(self::MATCH_EXPRESSIONS, $this->configuration['elements'], true); // @TODO: drop condition when PHP 8.0+ is required + $configuredElements = $this->configuration['elements']; + $fixArrays = \in_array(self::ELEMENTS_ARRAYS, $configuredElements, true); + $fixArguments = \in_array(self::ELEMENTS_ARGUMENTS, $configuredElements, true); + $fixParameters = \PHP_VERSION_ID >= 8_00_00 && \in_array(self::ELEMENTS_PARAMETERS, $configuredElements, true); // @TODO: drop condition when PHP 8.0+ is required + $fixMatch = \PHP_VERSION_ID >= 8_00_00 && \in_array(self::MATCH_EXPRESSIONS, $configuredElements, true); // @TODO: drop condition when PHP 8.0+ is required + $fixDestructuring = \in_array(self::ARRAY_DESTRUCTURING, $configuredElements, true); for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $prevIndex = $tokens->getPrevMeaningfulToken($index); + if ($tokens[$index]->isGivenKind(CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN)) { + if ($fixDestructuring) { // array destructing short syntax + $this->fixBlock($tokens, $index); + } - if ( - $fixArrays - && ( - $tokens[$index]->equals('(') && $tokens[$prevIndex]->isGivenKind(T_ARRAY) // long syntax - || $tokens[$index]->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN) // short syntax - ) - ) { - $this->fixBlock($tokens, $index); + continue; + } + + if ($tokens[$index]->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { + if ($fixArrays) { // array short syntax + $this->fixBlock($tokens, $index); + } continue; } @@ -152,10 +155,34 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } + $prevIndex = $tokens->getPrevMeaningfulToken($index); + + if ($tokens[$prevIndex]->isGivenKind(T_ARRAY)) { + if ($fixArrays) { // array long syntax + $this->fixBlock($tokens, $index); + } + + continue; + } + + if ($tokens[$prevIndex]->isGivenKind(T_LIST)) { + if ($fixDestructuring || $fixArguments) { // array destructing long syntax + $this->fixBlock($tokens, $index); + } + + continue; + } + + if ($fixMatch && $tokens[$prevIndex]->isGivenKind(T_MATCH)) { + $this->fixMatch($tokens, $index); + + continue; + } + $prevPrevIndex = $tokens->getPrevMeaningfulToken($prevIndex); if ($fixArguments - && $tokens[$prevIndex]->equalsAny([']', [T_CLASS], [T_STRING], [T_VARIABLE], [T_STATIC]]) + && $tokens[$prevIndex]->equalsAny([']', [T_CLASS], [T_STRING], [T_VARIABLE], [T_STATIC], [T_ISSET], [T_UNSET], [T_LIST]]) && !$tokens[$prevPrevIndex]->isGivenKind(T_FUNCTION) ) { $this->fixBlock($tokens, $index); @@ -166,16 +193,13 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void if ( $fixParameters && ( - $tokens[$prevIndex]->isGivenKind(T_STRING) && $tokens[$prevPrevIndex]->isGivenKind(T_FUNCTION) + $tokens[$prevIndex]->isGivenKind(T_STRING) + && $tokens[$prevPrevIndex]->isGivenKind(T_FUNCTION) || $tokens[$prevIndex]->isGivenKind([T_FN, T_FUNCTION]) ) ) { $this->fixBlock($tokens, $index); } - - if ($fixMatch && $tokens[$prevIndex]->isGivenKind(T_MATCH)) { - $this->fixMatch($tokens, $index); - } } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php index a09bb1cc..2bf136ca 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -30,37 +31,42 @@ /** * @author Bram Gotink * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * always_move_variable?: bool, + * equal?: bool|null, + * identical?: bool|null, + * less_and_greater?: bool|null + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * always_move_variable: bool, + * equal: bool|null, + * identical: bool|null, + * less_and_greater: bool|null + * } */ final class YodaStyleFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @var array */ - private $candidatesMap; + private array $candidatesMap; /** * @var array */ - private $candidateTypesConfiguration; - - /** - * @var array - */ - private $candidateTypes; + private array $candidateTypesConfiguration; /** - * {@inheritdoc} + * @var list */ - public function configure(array $configuration): void - { - parent::configure($configuration); + private array $candidateTypes; - $this->resolveConfiguration(); - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -120,25 +126,21 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound($this->candidateTypes); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->resolveConfiguration(); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $this->fixTokens($tokens); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -352,7 +354,7 @@ private function fixTokensCompare( private function fixTokensComparePart(Tokens $tokens, int $start, int $end): Tokens { $newTokens = $tokens->generatePartialCode($start, $end); - $newTokens = $this->fixTokens(Tokens::fromCode(sprintf('fixTokens(Tokens::fromCode(\sprintf('clearAt(\count($newTokens) - 1); $newTokens->clearAt(0); $newTokens->clearEmptyTokens(); @@ -360,15 +362,19 @@ private function fixTokensComparePart(Tokens $tokens, int $start, int $end): Tok return $newTokens; } + /** + * @return null|array{left: array{start: int, end: int}, right: array{start: int, end: int}} + */ private function getCompareFixableInfo(Tokens $tokens, int $index, bool $yoda): ?array { - $left = $this->getLeftSideCompareFixableInfo($tokens, $index); $right = $this->getRightSideCompareFixableInfo($tokens, $index); if (!$yoda && $this->isOfLowerPrecedenceAssignment($tokens[$tokens->getNextMeaningfulToken($right['end'])])) { return null; } + $left = $this->getLeftSideCompareFixableInfo($tokens, $index); + if ($this->isListStatement($tokens, $left['start'], $left['end']) || $this->isListStatement($tokens, $right['start'], $right['end'])) { return null; // do not fix lists assignment inside statements } @@ -378,7 +384,7 @@ private function getCompareFixableInfo(Tokens $tokens, int $index, bool $yoda): $leftSideIsVariable = $this->isVariable($tokens, $left['start'], $left['end'], $strict); $rightSideIsVariable = $this->isVariable($tokens, $right['start'], $right['end'], $strict); - if (!($leftSideIsVariable ^ $rightSideIsVariable)) { + if (!($leftSideIsVariable xor $rightSideIsVariable)) { return null; // both are (not) variables, do not touch } @@ -455,6 +461,11 @@ private function isOfLowerPrecedence(Token $token): bool T_THROW, // throw T_COALESCE, T_YIELD, // yield + T_YIELD_FROM, + T_REQUIRE, + T_REQUIRE_ONCE, + T_INCLUDE, + T_INCLUDE_ONCE, ]; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php index 6d7d7e84..eded1614 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php @@ -22,7 +22,7 @@ interface DeprecatedFixerInterface extends FixerInterface /** * Returns names of fixers to use instead, if any. * - * @return string[] + * @return list */ public function getSuccessorsNames(): array; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationArrayAssignmentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationArrayAssignmentFixer.php index f2ead599..d3158f54 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationArrayAssignmentFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationArrayAssignmentFixer.php @@ -14,9 +14,11 @@ namespace PhpCsFixer\Fixer\DoctrineAnnotation; -use Doctrine\Common\Annotations\DocLexer; use PhpCsFixer\AbstractDoctrineAnnotationFixer; +use PhpCsFixer\Doctrine\Annotation\DocLexer; use PhpCsFixer\Doctrine\Annotation\Tokens; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -26,12 +28,23 @@ /** * Forces the configured operator for assignment in arrays in Doctrine Annotations. + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * ignored_tags?: list, + * operator?: ':'|'=' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * ignored_tags: list, + * operator: ':'|'=' + * } */ -final class DoctrineAnnotationArrayAssignmentFixer extends AbstractDoctrineAnnotationFixer +final class DoctrineAnnotationArrayAssignmentFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -58,15 +71,11 @@ public function getPriority(): int return 1; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $options = parent::createConfigurationDefinition()->getOptions(); - $operator = new FixerOptionBuilder('operator', 'The operator to use.'); - $options[] = $operator + $options[] = (new FixerOptionBuilder('operator', 'The operator to use.')) ->setAllowedValues(['=', ':']) ->setDefault('=') ->getOption() @@ -75,9 +84,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn return new FixerConfigurationResolver($options); } - /** - * {@inheritdoc} - */ protected function fixAnnotations(Tokens $doctrineAnnotationTokens): void { $scopes = []; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationBracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationBracesFixer.php index 8ecbda4c..928254a2 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationBracesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationBracesFixer.php @@ -14,10 +14,12 @@ namespace PhpCsFixer\Fixer\DoctrineAnnotation; -use Doctrine\Common\Annotations\DocLexer; use PhpCsFixer\AbstractDoctrineAnnotationFixer; +use PhpCsFixer\Doctrine\Annotation\DocLexer; use PhpCsFixer\Doctrine\Annotation\Token; use PhpCsFixer\Doctrine\Annotation\Tokens; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -27,12 +29,23 @@ /** * Adds braces to Doctrine annotations when missing. + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * ignored_tags?: list, + * syntax?: 'with_braces'|'without_braces' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * ignored_tags: list, + * syntax: 'with_braces'|'without_braces' + * } */ -final class DoctrineAnnotationBracesFixer extends AbstractDoctrineAnnotationFixer +final class DoctrineAnnotationBracesFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -49,25 +62,17 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { - return new FixerConfigurationResolver(array_merge( - parent::createConfigurationDefinition()->getOptions(), - [ - (new FixerOptionBuilder('syntax', 'Whether to add or remove braces.')) - ->setAllowedValues(['with_braces', 'without_braces']) - ->setDefault('without_braces') - ->getOption(), - ] - )); + return new FixerConfigurationResolver([ + ...parent::createConfigurationDefinition()->getOptions(), + (new FixerOptionBuilder('syntax', 'Whether to add or remove braces.')) + ->setAllowedValues(['with_braces', 'without_braces']) + ->setDefault('without_braces') + ->getOption(), + ]); } - /** - * {@inheritdoc} - */ protected function fixAnnotations(Tokens $doctrineAnnotationTokens): void { if ('without_braces' === $this->configuration['syntax']) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php index 8da8cc0a..c9c01e01 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php @@ -14,9 +14,11 @@ namespace PhpCsFixer\Fixer\DoctrineAnnotation; -use Doctrine\Common\Annotations\DocLexer; use PhpCsFixer\AbstractDoctrineAnnotationFixer; +use PhpCsFixer\Doctrine\Annotation\DocLexer; use PhpCsFixer\Doctrine\Annotation\Tokens; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -25,11 +27,23 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; -final class DoctrineAnnotationIndentationFixer extends AbstractDoctrineAnnotationFixer +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * ignored_tags?: list, + * indent_mixed_lines?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * ignored_tags: list, + * indent_mixed_lines: bool + * } + */ +final class DoctrineAnnotationIndentationFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -44,25 +58,17 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { - return new FixerConfigurationResolver(array_merge( - parent::createConfigurationDefinition()->getOptions(), - [ - (new FixerOptionBuilder('indent_mixed_lines', 'Whether to indent lines that have content before closing parenthesis.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ] - )); + return new FixerConfigurationResolver([ + ...parent::createConfigurationDefinition()->getOptions(), + (new FixerOptionBuilder('indent_mixed_lines', 'Whether to indent lines that have content before closing parenthesis.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + ]); } - /** - * {@inheritdoc} - */ protected function fixAnnotations(Tokens $doctrineAnnotationTokens): void { $annotationPositions = []; @@ -116,7 +122,7 @@ protected function fixAnnotations(Tokens $doctrineAnnotationTokens): void } /** - * @return int[] + * @return array{int, int} */ private function getLineBracesCount(Tokens $tokens, int $index): array { @@ -168,7 +174,7 @@ private function isClosingLineWithMeaningfulContent(Tokens $tokens, int $index): } /** - * @param array> $annotationPositions Pairs of begin and end indices of main annotations + * @param list $annotationPositions Pairs of begin and end indices of main annotations */ private function indentationCanBeFixed(Tokens $tokens, int $newLineTokenIndex, array $annotationPositions): bool { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixer.php index bc04e752..e39fe008 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixer.php @@ -14,10 +14,12 @@ namespace PhpCsFixer\Fixer\DoctrineAnnotation; -use Doctrine\Common\Annotations\DocLexer; use PhpCsFixer\AbstractDoctrineAnnotationFixer; +use PhpCsFixer\Doctrine\Annotation\DocLexer; use PhpCsFixer\Doctrine\Annotation\Token; use PhpCsFixer\Doctrine\Annotation\Tokens; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -28,12 +30,37 @@ /** * Fixes spaces around commas and assignment operators in Doctrine annotations. + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * after_argument_assignments?: bool|null, + * after_array_assignments_colon?: bool|null, + * after_array_assignments_equals?: bool|null, + * around_commas?: bool, + * around_parentheses?: bool, + * before_argument_assignments?: bool|null, + * before_array_assignments_colon?: bool|null, + * before_array_assignments_equals?: bool|null, + * ignored_tags?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * after_argument_assignments: bool|null, + * after_array_assignments_colon: bool|null, + * after_array_assignments_equals: bool|null, + * around_commas: bool, + * around_parentheses: bool, + * before_argument_assignments: bool|null, + * before_array_assignments_colon: bool|null, + * before_array_assignments_equals: bool|null, + * ignored_tags: list + * } */ -final class DoctrineAnnotationSpacesFixer extends AbstractDoctrineAnnotationFixer +final class DoctrineAnnotationSpacesFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -61,53 +88,45 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { - return new FixerConfigurationResolver(array_merge( - parent::createConfigurationDefinition()->getOptions(), - [ - (new FixerOptionBuilder('around_parentheses', 'Whether to fix spaces around parentheses.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('around_commas', 'Whether to fix spaces around commas.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('before_argument_assignments', 'Whether to add, remove or ignore spaces before argument assignment operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('after_argument_assignments', 'Whether to add, remove or ignore spaces after argument assignment operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('before_array_assignments_equals', 'Whether to add, remove or ignore spaces before array `=` assignment operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('after_array_assignments_equals', 'Whether to add, remove or ignore spaces after array assignment `=` operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('before_array_assignments_colon', 'Whether to add, remove or ignore spaces before array `:` assignment operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('after_array_assignments_colon', 'Whether to add, remove or ignore spaces after array assignment `:` operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(true) - ->getOption(), - ] - )); + return new FixerConfigurationResolver([ + ...parent::createConfigurationDefinition()->getOptions(), + (new FixerOptionBuilder('around_parentheses', 'Whether to fix spaces around parentheses.')) + ->setAllowedTypes(['bool']) + ->setDefault(true) + ->getOption(), + (new FixerOptionBuilder('around_commas', 'Whether to fix spaces around commas.')) + ->setAllowedTypes(['bool']) + ->setDefault(true) + ->getOption(), + (new FixerOptionBuilder('before_argument_assignments', 'Whether to add, remove or ignore spaces before argument assignment operator.')) + ->setAllowedTypes(['null', 'bool']) + ->setDefault(false) + ->getOption(), + (new FixerOptionBuilder('after_argument_assignments', 'Whether to add, remove or ignore spaces after argument assignment operator.')) + ->setAllowedTypes(['null', 'bool']) + ->setDefault(false) + ->getOption(), + (new FixerOptionBuilder('before_array_assignments_equals', 'Whether to add, remove or ignore spaces before array `=` assignment operator.')) + ->setAllowedTypes(['null', 'bool']) + ->setDefault(true) + ->getOption(), + (new FixerOptionBuilder('after_array_assignments_equals', 'Whether to add, remove or ignore spaces after array assignment `=` operator.')) + ->setAllowedTypes(['null', 'bool']) + ->setDefault(true) + ->getOption(), + (new FixerOptionBuilder('before_array_assignments_colon', 'Whether to add, remove or ignore spaces before array `:` assignment operator.')) + ->setAllowedTypes(['null', 'bool']) + ->setDefault(true) + ->getOption(), + (new FixerOptionBuilder('after_array_assignments_colon', 'Whether to add, remove or ignore spaces after array assignment `:` operator.')) + ->setAllowedTypes(['null', 'bool']) + ->setDefault(true) + ->getOption(), + ]); } - /** - * {@inheritdoc} - */ protected function fixAnnotations(Tokens $doctrineAnnotationTokens): void { if (true === $this->configuration['around_parentheses']) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ProcessOutputInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php similarity index 73% rename from tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ProcessOutputInterface.php rename to tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php index 80726c38..9ade1875 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ProcessOutputInterface.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php @@ -12,12 +12,9 @@ * with this source code in the file LICENSE. */ -namespace PhpCsFixer\Console\Output; +namespace PhpCsFixer\Fixer; /** * @internal */ -interface ProcessOutputInterface -{ - public function printLegend(): void; -} +interface ExperimentalFixerInterface extends FixerInterface {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php index 985d9a93..39841f2d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php @@ -27,13 +27,10 @@ */ final class CombineNestedDirnameFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Replace multiple nested calls of `dirname` by only one call with second `$level` parameter. Requires PHP >= 7.0.', + 'Replace multiple nested calls of `dirname` by only one call with second `$level` parameter.', [ new CodeSample( "isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; @@ -63,7 +54,7 @@ public function isRisky(): bool /** * {@inheritdoc} * - * Must run before MethodArgumentSpaceFixer, NoSpacesInsideParenthesisFixer. + * Must run before MethodArgumentSpaceFixer, NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. * Must run after DirConstantFixer. */ public function getPriority(): int @@ -71,19 +62,16 @@ public function getPriority(): int return 35; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; 0 <= $index; --$index) { $dirnameInfo = $this->getDirnameInfo($tokens, $index); - if (!$dirnameInfo) { + if (false === $dirnameInfo) { continue; } - $prev = $tokens->getPrevMeaningfulToken($dirnameInfo['indexes'][0]); + $prev = $tokens->getPrevMeaningfulToken($dirnameInfo['indices'][0]); if (!$tokens[$prev]->equals('(')) { continue; @@ -95,7 +83,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void while ($dirnameInfo = $this->getDirnameInfo($tokens, $prev, $firstArgumentEnd)) { $dirnameInfoArray[] = $dirnameInfo; - $prev = $tokens->getPrevMeaningfulToken($dirnameInfo['indexes'][0]); + $prev = $tokens->getPrevMeaningfulToken($dirnameInfo['indices'][0]); if (!$tokens[$prev]->equals('(')) { break; @@ -117,7 +105,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void * @param int $index Index of `dirname` * @param null|int $firstArgumentEndIndex Index of last token of first argument of `dirname` call * - * @return array{indexes: list, secondArgument?: int, levels: int, end: int}|bool `false` when it is not a (supported) `dirname` call, an array with info about the dirname call otherwise + * @return array{indices: list, secondArgument?: int, levels: int, end: int}|false `false` when it is not a (supported) `dirname` call, an array with info about the dirname call otherwise */ private function getDirnameInfo(Tokens $tokens, int $index, ?int $firstArgumentEndIndex = null) { @@ -129,18 +117,18 @@ private function getDirnameInfo(Tokens $tokens, int $index, ?int $firstArgumentE return false; } - $info = ['indexes' => []]; + $info = ['indices' => []]; $prev = $tokens->getPrevMeaningfulToken($index); if ($tokens[$prev]->isGivenKind(T_NS_SEPARATOR)) { - $info['indexes'][] = $prev; + $info['indices'][] = $prev; } - $info['indexes'][] = $index; + $info['indices'][] = $index; // opening parenthesis "(" $next = $tokens->getNextMeaningfulToken($index); - $info['indexes'][] = $next; + $info['indices'][] = $next; if (null !== $firstArgumentEndIndex) { $next = $tokens->getNextMeaningfulToken($firstArgumentEndIndex); @@ -162,11 +150,11 @@ private function getDirnameInfo(Tokens $tokens, int $index, ?int $firstArgumentE } } - $info['indexes'][] = $next; + $info['indices'][] = $next; if ($tokens[$next]->equals(',')) { $next = $tokens->getNextMeaningfulToken($next); - $info['indexes'][] = $next; + $info['indices'][] = $next; } if ($tokens[$next]->equals(')')) { @@ -186,7 +174,7 @@ private function getDirnameInfo(Tokens $tokens, int $index, ?int $firstArgumentE $next = $tokens->getNextMeaningfulToken($next); if ($tokens[$next]->equals(',')) { - $info['indexes'][] = $next; + $info['indices'][] = $next; $next = $tokens->getNextMeaningfulToken($next); } @@ -194,14 +182,14 @@ private function getDirnameInfo(Tokens $tokens, int $index, ?int $firstArgumentE return false; } - $info['indexes'][] = $next; + $info['indices'][] = $next; $info['end'] = $next; return $info; } /** - * @param array, secondArgument?: int, levels: int, end: int}> $dirnameInfoArray + * @param non-empty-list, secondArgument?: int, levels: int, end: int}> $dirnameInfoArray */ private function combineDirnames(Tokens $tokens, array $dirnameInfoArray): void { @@ -211,7 +199,7 @@ private function combineDirnames(Tokens $tokens, array $dirnameInfoArray): void foreach ($dirnameInfoArray as $dirnameInfo) { $levels += $dirnameInfo['levels']; - foreach ($dirnameInfo['indexes'] as $index) { + foreach ($dirnameInfo['indices'] as $index) { $tokens->removeLeadingWhitespace($index); $tokens->clearTokenAndMergeSurroundingWhitespace($index); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php index f07f2db5..4888fe40 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php @@ -19,7 +19,6 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; @@ -35,7 +34,8 @@ public function getDefinition(): FixerDefinitionInterface ], "Consider this code: `DateTime::createFromFormat('Y-m-d', '2022-02-11')`. - What value will be returned? '2022-02-11 00:00:00.0'? No, actual return value has 'H:i:s' section like '2022-02-11 16:55:37.0'. + What value will be returned? '2022-02-11 00:00:00.0'? + No, actual return value has 'H:i:s' section like '2022-02-11 16:55:37.0'. Change 'Y-m-d' to '!Y-m-d', return value will be '2022-02-11 00:00:00.0'. So, adding `!` to format string will make return value more intuitive.", 'Risky when depending on the actual timings being used even when not explicit set in format.' @@ -65,10 +65,9 @@ public function isRisky(): bool protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $argumentsAnalyzer = new ArgumentsAnalyzer(); - $namespacesAnalyzer = new NamespacesAnalyzer(); $namespaceUsesAnalyzer = new NamespaceUsesAnalyzer(); - foreach ($namespacesAnalyzer->getDeclarations($tokens) as $namespace) { + foreach ($tokens->getNamespaceDeclarations() as $namespace) { $scopeStartIndex = $namespace->getScopeStartIndex(); $useDeclarations = $namespaceUsesAnalyzer->getDeclarationsInNamespace($tokens, $namespace); @@ -89,7 +88,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $classNameIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$classNameIndex]->equalsAny([[T_STRING, 'DateTime'], [T_STRING, 'DateTimeImmutable']], false)) { + if (!$tokens[$classNameIndex]->equalsAny([[T_STRING, \DateTime::class], [T_STRING, \DateTimeImmutable::class]], false)) { continue; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php index 15b0174f..3bf72e22 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php @@ -24,9 +24,6 @@ final class FopenFlagOrderFixer extends AbstractFopenFlagFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -88,9 +85,9 @@ protected function fixFopenFlagToken(Tokens $tokens, int $argumentStartIndex, in } /** - * @param string[] $flags + * @param list $flags * - * @return string[] + * @return list */ private function sortFlags(array $flags): array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagsFixer.php index 55412a18..b363dc87 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagsFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFopenFlagFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -25,11 +26,21 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * b_mode?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * b_mode: bool + * } + */ final class FopenFlagsFixer extends AbstractFopenFlagFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -43,9 +54,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionDeclarationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionDeclarationFixer.php index c0a79c7a..2f200630 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionDeclarationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionDeclarationFixer.php @@ -16,14 +16,13 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; @@ -32,9 +31,25 @@ * Fixer for rules defined in PSR2 generally (¶1 and ¶6). * * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * closure_fn_spacing?: 'none'|'one', + * closure_function_spacing?: 'none'|'one', + * trailing_comma_single_line?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * closure_fn_spacing: 'none'|'one', + * closure_function_spacing: 'none'|'one', + * trailing_comma_single_line: bool + * } */ final class FunctionDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -49,17 +64,11 @@ final class FunctionDeclarationFixer extends AbstractFixer implements Configurab private string $singleLineWhitespaceOptions = " \t"; - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -88,11 +97,10 @@ function foo ($bar, $baz) ', ['closure_function_spacing' => self::SPACING_NONE] ), - new VersionSpecificCodeSample( + new CodeSample( ' null; ', - new VersionSpecification(7_04_00), ['closure_fn_spacing' => self::SPACING_NONE] ), ] @@ -103,16 +111,13 @@ function foo ($bar, $baz) * {@inheritdoc} * * Must run before MethodArgumentSpaceFixer. - * Must run after SingleSpaceAfterConstructFixer, SingleSpaceAroundConstructFixer. + * Must run after SingleSpaceAfterConstructFixer, SingleSpaceAroundConstructFixer, UseArrowFunctionsFixer. */ public function getPriority(): int { return 31; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); @@ -221,9 +226,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionTypehintSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionTypehintSpaceFixer.php index f1f16cc9..132f7c13 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionTypehintSpaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionTypehintSpaceFixer.php @@ -14,22 +14,21 @@ namespace PhpCsFixer\Fixer\FunctionNotation; -use PhpCsFixer\AbstractFixer; +use PhpCsFixer\AbstractProxyFixer; +use PhpCsFixer\Fixer\DeprecatedFixerInterface; +use PhpCsFixer\Fixer\Whitespace\TypeDeclarationSpacesFixer; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; use PhpCsFixer\Tokenizer\Tokens; /** * @author Dariusz Rumiński + * + * @deprecated */ -final class FunctionTypehintSpaceFixer extends AbstractFixer +final class FunctionTypehintSpaceFixer extends AbstractProxyFixer implements DeprecatedFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -41,39 +40,21 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]); } - /** - * {@inheritdoc} - */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + public function getSuccessorsNames(): array { - $functionsAnalyzer = new FunctionsAnalyzer(); - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind([T_FUNCTION, T_FN])) { - continue; - } - - $arguments = $functionsAnalyzer->getFunctionArguments($tokens, $index); - - foreach (array_reverse($arguments) as $argument) { - $type = $argument->getTypeAnalysis(); + return array_keys($this->proxyFixers); + } - if (!$type instanceof TypeAnalysis) { - continue; - } + protected function createProxyFixers(): array + { + $fixer = new TypeDeclarationSpacesFixer(); + $fixer->configure(['elements' => ['function']]); - $tokens->ensureWhitespaceAtIndex($type->getEndIndex() + 1, 0, ' '); - } - } + return [$fixer]; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php index 166482d6..4561c393 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php @@ -28,9 +28,6 @@ */ final class ImplodeCallFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -44,17 +41,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); @@ -71,9 +62,6 @@ public function getPriority(): int return 37; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionsAnalyzer = new FunctionsAnalyzer(); @@ -90,7 +78,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $argumentsIndices = $this->getArgumentIndices($tokens, $index); if (1 === \count($argumentsIndices)) { - $firstArgumentIndex = key($argumentsIndices); + $firstArgumentIndex = array_key_first($argumentsIndices); $tokens->insertAt($firstArgumentIndex, [ new Token([T_CONSTANT_ENCAPSED_STRING, "''"]), new Token(','), @@ -115,7 +103,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void // collect tokens from first argument $firstArgumentEndIndex = $argumentsIndices[key($argumentsIndices)]; $newSecondArgumentTokens = []; - for ($i = key($argumentsIndices); $i <= $firstArgumentEndIndex; ++$i) { + for ($i = array_key_first($argumentsIndices); $i <= $firstArgumentEndIndex; ++$i) { $newSecondArgumentTokens[] = clone $tokens[$i]; $tokens->clearAt($i); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php index b60dd148..80fa74fd 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php @@ -26,24 +26,12 @@ final class LambdaNotUsedImportFixer extends AbstractFixer { - /** - * @var ArgumentsAnalyzer - */ - private $argumentsAnalyzer; + private ArgumentsAnalyzer $argumentsAnalyzer; - /** - * @var FunctionsAnalyzer - */ - private $functionAnalyzer; + private FunctionsAnalyzer $functionAnalyzer; - /** - * @var TokensAnalyzer - */ - private $tokensAnalyzer; + private TokensAnalyzer $tokensAnalyzer; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -55,16 +43,13 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before MethodArgumentSpaceFixer, NoSpacesInsideParenthesisFixer. + * Must run before MethodArgumentSpaceFixer, NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. */ public function getPriority(): int { return 31; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_FUNCTION, CT::T_USE_LAMBDA]); @@ -114,6 +99,8 @@ private function fixLambda(Tokens $tokens, int $lambdaUseIndex): void } /** + * @param array $imports + * * @return array */ private function findNotUsedLambdaImports(Tokens $tokens, array $imports, int $lambdaUseCloseBraceIndex): array @@ -240,6 +227,12 @@ private function findNotUsedLambdaImports(Tokens $tokens, array $imports, int $l return $imports; } + /** + * @param array $imports + * @param array $arguments + * + * @return array + */ private function countImportsUsedAsArgument(Tokens $tokens, array $imports, array $arguments): array { foreach ($arguments as $start => $end) { @@ -283,6 +276,11 @@ private function getLambdaUseIndex(Tokens $tokens, int $index) return $lambdaUseIndex; } + /** + * @param array $arguments + * + * @return array + */ private function filterArguments(Tokens $tokens, array $arguments): array { $imports = []; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php index 333982b8..612fa4b7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -23,23 +24,34 @@ use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Preg; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; /** - * Fixer for rules defined in PSR2 ¶4.4, ¶4.6. - * * @author Kuanhung Chen + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * after_heredoc?: bool, + * attribute_placement?: 'ignore'|'same_line'|'standalone', + * keep_multiple_spaces_after_comma?: bool, + * on_multiline?: 'ensure_fully_multiline'|'ensure_single_line'|'ignore' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * after_heredoc: bool, + * attribute_placement: 'ignore'|'same_line'|'standalone', + * keep_multiple_spaces_after_comma: bool, + * on_multiline: 'ensure_fully_multiline'|'ensure_single_line'|'ignore' + * } */ final class MethodArgumentSpaceFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -79,49 +91,56 @@ public function getDefinition(): FixerDefinitionInterface 'keep_multiple_spaces_after_comma' => false, ] ), - new VersionSpecificCodeSample( + new CodeSample( + " 'ensure_fully_multiline', + 'attribute_placement' => 'ignore', + ] + ), + new CodeSample( + " 'ensure_fully_multiline', + 'attribute_placement' => 'same_line', + ] + ), + new CodeSample( + " 'ensure_fully_multiline', + 'attribute_placement' => 'standalone', + ] + ), + new CodeSample( <<<'SAMPLE' - true] ), - ] + ], + 'This fixer covers rules defined in PSR2 ¶4.4, ¶4.6.' ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound('('); } - public function configure(array $configuration): void - { - parent::configure($configuration); - - if (isset($configuration['ensure_fully_multiline'])) { - $this->configuration['on_multiline'] = $this->configuration['ensure_fully_multiline'] - ? 'ensure_fully_multiline' - : 'ignore'; - } - } - /** * {@inheritdoc} * - * Must run before ArrayIndentationFixer. + * Must run before ArrayIndentationFixer, StatementIndentationFixer. * Must run after CombineNestedDirnameFixer, FunctionDeclarationFixer, ImplodeCallFixer, LambdaNotUsedImportFixer, NoMultilineWhitespaceAroundDoubleArrowFixer, NoUselessSprintfFixer, PowToExponentiationFixer, StrictParamFixer. */ public function getPriority(): int @@ -129,9 +148,6 @@ public function getPriority(): int return 30; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $expectedTokens = [T_LIST, T_FUNCTION, CT::T_USE_LAMBDA, T_FN, T_CLASS]; @@ -164,9 +180,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -185,6 +198,13 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setAllowedTypes(['bool']) ->setDefault(false) ->getOption(), + (new FixerOptionBuilder( + 'attribute_placement', + 'Defines how to handle argument attributes when function definition is multiline.' + )) + ->setAllowedValues(['ignore', 'same_line', 'standalone']) + ->setDefault('standalone') + ->getOption(), ]); } @@ -300,7 +320,7 @@ private function ensureFunctionFullyMultiline(Tokens $tokens, int $startFunction do { $prevWhitespaceTokenIndex = $tokens->getPrevTokenOfKind( $searchIndex, - [[T_WHITESPACE]] + [[T_ENCAPSED_AND_WHITESPACE], [T_WHITESPACE]], ); $searchIndex = $prevWhitespaceTokenIndex; @@ -310,6 +330,8 @@ private function ensureFunctionFullyMultiline(Tokens $tokens, int $startFunction if (null === $prevWhitespaceTokenIndex) { $existingIndentation = ''; + } elseif (!$tokens[$prevWhitespaceTokenIndex]->isGivenKind(T_WHITESPACE)) { + return; } else { $existingIndentation = $tokens[$prevWhitespaceTokenIndex]->getContent(); $lastLineIndex = strrpos($existingIndentation, "\n"); @@ -354,7 +376,23 @@ private function ensureFunctionFullyMultiline(Tokens $tokens, int $startFunction continue; } - if ($token->equals(',') && !$tokens[$tokens->getNextMeaningfulToken($index)]->equals(')')) { + if ($tokens[$tokens->getNextMeaningfulToken($index)]->equals(')')) { + continue; + } + + if ($token->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { + if ('standalone' === $this->configuration['attribute_placement']) { + $this->fixNewline($tokens, $index, $indentation); + } elseif ('same_line' === $this->configuration['attribute_placement']) { + $this->ensureSingleLine($tokens, $index + 1); + $tokens->ensureWhitespaceAtIndex($index + 1, 0, ' '); + } + $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); + + continue; + } + + if ($token->equals(',')) { $this->fixNewline($tokens, $index, $indentation); } } @@ -363,7 +401,7 @@ private function ensureFunctionFullyMultiline(Tokens $tokens, int $startFunction } /** - * Method to insert newline after comma or opening parenthesis. + * Method to insert newline after comma, attribute or opening parenthesis. * * @param int $index index of a comma * @param string $indentation the indentation that should be used @@ -378,6 +416,10 @@ private function fixNewline(Tokens $tokens, int $index, string $indentation, boo if ($tokens[$index + 2]->isComment()) { $nextMeaningfulTokenIndex = $tokens->getNextMeaningfulToken($index + 2); if (!$this->isNewline($tokens[$nextMeaningfulTokenIndex - 1])) { + if ($tokens[$nextMeaningfulTokenIndex - 1]->isWhitespace()) { + $tokens->clearAt($nextMeaningfulTokenIndex - 1); + } + $tokens->ensureWhitespaceAtIndex($nextMeaningfulTokenIndex, 0, $this->whitespacesConfig->getLineEnding().$indentation); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php index 7ccbbfa7..4feb68b8 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -24,16 +25,34 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +use PhpCsFixer\Utils; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; /** * @author Andreas Möller + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * exclude?: list, + * include?: list, + * scope?: 'all'|'namespaced', + * strict?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * exclude: list, + * include: list, + * scope: 'all'|'namespaced', + * strict: bool + * } */ final class NativeFunctionInvocationFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -61,16 +80,6 @@ final class NativeFunctionInvocationFixer extends AbstractFixer implements Confi */ private $functionFilter; - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->functionFilter = $this->getFunctionFilter(); - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -174,25 +183,21 @@ public function getPriority(): int return 1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->functionFilter = $this->getFunctionFilter(); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { if ('all' === $this->configuration['scope']) { @@ -201,7 +206,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void return; } - $namespaces = (new NamespacesAnalyzer())->getDeclarations($tokens); + $namespaces = $tokens->getNamespaceDeclarations(); // 'scope' is 'namespaced' here /** @var NamespaceAnalysis $namespace */ @@ -210,18 +215,15 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('exclude', 'List of functions to ignore.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([static function (array $value): bool { foreach ($value as $functionName) { - if (!\is_string($functionName) || '' === trim($functionName) || trim($functionName) !== $functionName) { - throw new InvalidOptionsException(sprintf( + if ('' === trim($functionName) || trim($functionName) !== $functionName) { + throw new InvalidOptionsException(\sprintf( 'Each element must be a non-empty, trimmed string, got "%s" instead.', get_debug_type($functionName) )); @@ -233,11 +235,11 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setDefault([]) ->getOption(), (new FixerOptionBuilder('include', 'List of function names or sets to fix. Defined sets are `@internal` (all native functions), `@all` (all global functions) and `@compiler_optimized` (functions that are specially optimized by Zend).')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([static function (array $value): bool { foreach ($value as $functionName) { - if (!\is_string($functionName) || '' === trim($functionName) || trim($functionName) !== $functionName) { - throw new InvalidOptionsException(sprintf( + if ('' === trim($functionName) || trim($functionName) !== $functionName) { + throw new InvalidOptionsException(\sprintf( 'Each element must be a non-empty, trimmed string, got "%s" instead.', get_debug_type($functionName) )); @@ -250,7 +252,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]; if (str_starts_with($functionName, '@') && !\in_array($functionName, $sets, true)) { - throw new InvalidOptionsException(sprintf('Unknown set "%s", known sets are "%s".', $functionName, implode('", "', $sets))); + throw new InvalidOptionsException(\sprintf('Unknown set "%s", known sets are %s.', $functionName, Utils::naturalLanguageJoin($sets))); } } @@ -309,14 +311,10 @@ private function getFunctionFilter(): callable if (\in_array(self::SET_ALL, $this->configuration['include'], true)) { if (\count($exclude) > 0) { - return static function (string $functionName) use ($exclude): bool { - return !isset($exclude[strtolower($functionName)]); - }; + return static fn (string $functionName): bool => !isset($exclude[strtolower($functionName)]); } - return static function (): bool { - return true; - }; + return static fn (): bool => true; } $include = []; @@ -334,14 +332,10 @@ private function getFunctionFilter(): callable } if (\count($exclude) > 0) { - return static function (string $functionName) use ($include, $exclude): bool { - return isset($include[strtolower($functionName)]) && !isset($exclude[strtolower($functionName)]); - }; + return static fn (string $functionName): bool => isset($include[strtolower($functionName)]) && !isset($exclude[strtolower($functionName)]); } - return static function (string $functionName) use ($include): bool { - return isset($include[strtolower($functionName)]); - }; + return static fn (string $functionName): bool => isset($include[strtolower($functionName)]); } /** @@ -384,6 +378,7 @@ private function getAllCompilerOptimizedFunctionsNormalized(): array 'is_string', 'ord', 'sizeof', + 'sprintf', 'strlen', 'strval', // @see https://github.com/php/php-src/blob/php-7.2.6/ext/opcache/Optimizer/pass1_5.c @@ -408,17 +403,18 @@ private function getAllInternalFunctionsNormalized(): array } /** - * @param string[] $functionNames + * @param list $functionNames * * @return array all function names lower cased */ private function normalizeFunctionNames(array $functionNames): array { - foreach ($functionNames as $index => $functionName) { - $functionNames[strtolower($functionName)] = true; - unset($functionNames[$index]); + $result = []; + + foreach ($functionNames as $functionName) { + $result[strtolower($functionName)] = true; } - return $functionNames; + return $result; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php index 0bb5650c..a63e9914 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php @@ -29,14 +29,11 @@ */ final class NoSpacesAfterFunctionNameFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'When making a method or function call, there MUST NOT be a space between the method or function name and the opening parenthesis.', - [new CodeSample("isAnyTokenKindsFound(array_merge($this->getFunctionyTokenKinds(), [T_STRING])); + return $tokens->isAnyTokenKindsFound([T_STRING, ...$this->getFunctionyTokenKinds()]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionyTokens = $this->getFunctionyTokenKinds(); @@ -82,7 +73,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $nextNonWhiteSpace = $tokens->getNextMeaningfulToken($endParenthesisIndex); if ( null !== $nextNonWhiteSpace - && $tokens[$nextNonWhiteSpace]->equals('?') + && !$tokens[$nextNonWhiteSpace]->equals(';') && $tokens[$lastTokenIndex]->isGivenKind($languageConstructionTokens) ) { continue; @@ -125,24 +116,22 @@ private function fixFunctionCall(Tokens $tokens, int $index): void } /** - * @return array|string> + * @return list */ private function getBraceAfterVariableKinds(): array { - static $tokens = [ + return [ ')', ']', [CT::T_DYNAMIC_VAR_BRACE_CLOSE], [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], ]; - - return $tokens; } /** * Gets the token kinds which can work as function calls. * - * @return int[] Token names + * @return list Token names */ private function getFunctionyTokenKinds(): array { @@ -169,7 +158,7 @@ private function getFunctionyTokenKinds(): array /** * Gets the token kinds of actually language construction. * - * @return int[] + * @return list */ private function getLanguageConstructionTokenKinds(): array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoTrailingCommaInSinglelineFunctionCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoTrailingCommaInSinglelineFunctionCallFixer.php index 7f8f4135..b0be871d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoTrailingCommaInSinglelineFunctionCallFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoTrailingCommaInSinglelineFunctionCallFixer.php @@ -26,9 +26,6 @@ */ final class NoTrailingCommaInSinglelineFunctionCallFixer extends AbstractProxyFixer implements DeprecatedFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -47,17 +44,11 @@ public function getPriority(): int return 3; } - /** - * {@inheritdoc} - */ public function getSuccessorsNames(): array { return array_keys($this->proxyFixers); } - /** - * {@inheritdoc} - */ protected function createProxyFixers(): array { $fixer = new NoTrailingCommaInSinglelineFixer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixer.php index a41ca009..108901da 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixer.php @@ -28,9 +28,6 @@ */ final class NoUnreachableDefaultArgumentValueFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -57,25 +54,16 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionKinds = [T_FUNCTION, T_FN]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUselessSprintfFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUselessSprintfFixer.php index d5af4435..125bbab6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUselessSprintfFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUselessSprintfFixer.php @@ -24,9 +24,6 @@ final class NoUselessSprintfFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -41,17 +38,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; @@ -60,16 +51,13 @@ public function isRisky(): bool /** * {@inheritdoc} * - * Must run before MethodArgumentSpaceFixer, NativeFunctionCasingFixer, NoEmptyStatementFixer, NoExtraBlankLinesFixer, NoSpacesInsideParenthesisFixer. + * Must run before MethodArgumentSpaceFixer, NativeFunctionCasingFixer, NoEmptyStatementFixer, NoExtraBlankLinesFixer, NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. */ public function getPriority(): int { return 42; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionAnalyzer = new FunctionsAnalyzer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php index 9ad6c993..b21a9ea5 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php @@ -16,30 +16,43 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\FixerDefinition\VersionSpecification; +use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Tokenizer\Analyzer\Analysis\ArgumentAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; /** - * @author HypeMC + * @author HypeMC + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * use_nullable_type_declaration?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * use_nullable_type_declaration: bool + * } */ final class NullableTypeDeclarationForDefaultNullValueFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Adds or removes `?` before type declarations for parameters with a default `null` value.', + 'Adds or removes `?` before single type declarations or `|null` at the end of union types when parameters have a default `null` value.', [ new CodeSample( " false] ), + new VersionSpecificCodeSample( + " false] + ), + new VersionSpecificCodeSample( + " false] + ), ], 'Rule is applied only in a PHP 7.1+ environment.' ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_VARIABLE) && $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]); @@ -64,29 +92,24 @@ public function isCandidate(Tokens $tokens): bool /** * {@inheritdoc} * - * Must run before NoUnreachableDefaultArgumentValueFixer. + * Must run before NoUnreachableDefaultArgumentValueFixer, NullableTypeDeclarationFixer, OrderedTypesFixer. */ public function getPriority(): int { - return 1; + return 3; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ - (new FixerOptionBuilder('use_nullable_type_declaration', 'Whether to add or remove `?` before type declarations for parameters with a default `null` value.')) + (new FixerOptionBuilder('use_nullable_type_declaration', 'Whether to add or remove `?` or `|null` to parameters with a default `null` value.')) ->setAllowedTypes(['bool']) ->setDefault(true) + ->setDeprecationMessage('Behaviour will follow default one.') // @TODO remove the option on next major 4.0 ->getOption(), ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionsAnalyzer = new FunctionsAnalyzer(); @@ -105,7 +128,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @param ArgumentAnalysis[] $arguments + * @param array $arguments */ private function fixFunctionParameters(Tokens $tokens, array $arguments): void { @@ -124,8 +147,8 @@ private function fixFunctionParameters(Tokens $tokens, array $arguments): void // Skip, if the parameter // - doesn't have a type declaration !$argumentInfo->hasTypeAnalysis() - // type is a union - || str_contains($argumentInfo->getTypeAnalysis()->getName(), '|') + // - has a mixed or standalone null type + || \in_array(strtolower($argumentInfo->getTypeAnalysis()->getName()), ['mixed', 'null'], true) // - a default value is not null we can continue || !$argumentInfo->hasDefault() || 'null' !== strtolower($argumentInfo->getDefault()) ) { @@ -142,16 +165,83 @@ private function fixFunctionParameters(Tokens $tokens, array $arguments): void } } - if (true === $this->configuration['use_nullable_type_declaration']) { - if (!$argumentTypeInfo->isNullable() && 'mixed' !== $argumentTypeInfo->getName()) { - $tokens->insertAt($argumentTypeInfo->getStartIndex(), new Token([CT::T_NULLABLE_TYPE, '?'])); + $typeAnalysisName = $argumentTypeInfo->getName(); + if (str_contains($typeAnalysisName, '|') || str_contains($typeAnalysisName, '&')) { + $this->fixUnionTypeParameter($tokens, $argumentTypeInfo); + } else { + $this->fixSingleTypeParameter($tokens, $argumentTypeInfo); + } + } + } + + private function fixSingleTypeParameter(Tokens $tokens, TypeAnalysis $argumentTypeInfo): void + { + if (true === $this->configuration['use_nullable_type_declaration']) { + if (!$argumentTypeInfo->isNullable()) { + $tokens->insertAt($argumentTypeInfo->getStartIndex(), new Token([CT::T_NULLABLE_TYPE, '?'])); + } + } elseif ($argumentTypeInfo->isNullable()) { + $tokens->removeTrailingWhitespace($startIndex = $argumentTypeInfo->getStartIndex()); + $tokens->clearTokenAndMergeSurroundingWhitespace($startIndex); + } + } + + private function fixUnionTypeParameter(Tokens $tokens, TypeAnalysis $argumentTypeInfo): void + { + if (true === $this->configuration['use_nullable_type_declaration']) { + if ($argumentTypeInfo->isNullable()) { + return; + } + + $typeAnalysisName = $argumentTypeInfo->getName(); + $endIndex = $argumentTypeInfo->getEndIndex(); + + if (str_contains($typeAnalysisName, '&') && !str_contains($typeAnalysisName, '|')) { + $endIndex += 2; + $tokens->insertAt($argumentTypeInfo->getStartIndex(), new Token([CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, '('])); + $tokens->insertAt($endIndex, new Token([CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, ')'])); + } + + $tokens->insertAt($endIndex + 1, [ + new Token([CT::T_TYPE_ALTERNATION, '|']), + new Token([T_STRING, 'null']), + ]); + } elseif ($argumentTypeInfo->isNullable()) { + $startIndex = $argumentTypeInfo->getStartIndex(); + + $index = $tokens->getNextTokenOfKind($startIndex - 1, [[T_STRING, 'null']], false); + + if ($index === $startIndex) { + $tokens->removeTrailingWhitespace($index); + $tokens->clearTokenAndMergeSurroundingWhitespace($index); + + $index = $tokens->getNextMeaningfulToken($index); + if ($tokens[$index]->equals([CT::T_TYPE_ALTERNATION, '|'])) { + $tokens->removeTrailingWhitespace($index); + $tokens->clearTokenAndMergeSurroundingWhitespace($index); } } else { - if ($argumentTypeInfo->isNullable()) { - $tokens->removeTrailingWhitespace($argumentTypeInfo->getStartIndex()); - $tokens->clearTokenAndMergeSurroundingWhitespace($argumentTypeInfo->getStartIndex()); + $tokens->removeLeadingWhitespace($index); + $tokens->clearTokenAndMergeSurroundingWhitespace($index); + + $index = $tokens->getPrevMeaningfulToken($index); + if ($tokens[$index]->equals([CT::T_TYPE_ALTERNATION, '|'])) { + $tokens->removeLeadingWhitespace($index); + $tokens->clearTokenAndMergeSurroundingWhitespace($index); } } + + $typeAnalysisName = $argumentTypeInfo->getName(); + + if (str_contains($typeAnalysisName, '&') && 1 === substr_count($typeAnalysisName, '|')) { + $index = $tokens->getNextTokenOfKind($startIndex - 1, [[CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN]]); + $tokens->removeTrailingWhitespace($index); + $tokens->clearTokenAndMergeSurroundingWhitespace($index); + + $index = $tokens->getPrevTokenOfKind($argumentTypeInfo->getEndIndex() + 1, [[CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE]]); + $tokens->removeLeadingWhitespace($index); + $tokens->clearTokenAndMergeSurroundingWhitespace($index); + } } } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php index 488df0d7..37d0f060 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php @@ -16,6 +16,8 @@ use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer; use PhpCsFixer\DocBlock\Annotation; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ExperimentalFixerInterface; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; @@ -24,11 +26,26 @@ /** * @author Jan Gantzert + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * scalar_types?: bool, + * types_map?: array, + * union_types?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * scalar_types: bool, + * types_map: array, + * union_types: bool + * } */ -final class PhpdocToParamTypeFixer extends AbstractPhpdocToTypeDeclarationFixer +final class PhpdocToParamTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ConfigurableFixerInterface, ExperimentalFixerInterface { + private const TYPE_CHECK_TEMPLATE = ' */ private const EXCLUDE_FUNC_NAMES = [ [T_STRING, '__clone'], @@ -39,19 +56,15 @@ final class PhpdocToParamTypeFixer extends AbstractPhpdocToTypeDeclarationFixer * @var array */ private const SKIPPED_TYPES = [ - 'mixed' => true, 'resource' => true, 'static' => true, 'void' => true, ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'EXPERIMENTAL: Takes `@param` annotations of non-mixed types and adjusts accordingly the function signature. Requires PHP >= 7.0.', + 'Takes `@param` annotations of non-mixed types and adjusts accordingly the function signature.', [ new CodeSample( ' false] ), + new CodeSample( + ' false] + ), ], null, - 'This rule is EXPERIMENTAL and [1] is not covered with backward compatibility promise. [2] `@param` annotation is mandatory for the fixer to make changes, signatures of methods without it (no docblock, inheritdocs) will not be fixed. [3] Manual actions are required if inherited signatures are not properly documented.' + 'The `@param` annotation is mandatory for the fixer to make changes, signatures of methods without it (no docblock, inheritdocs) will not be fixed. Manual actions are required if inherited signatures are not properly documented.' ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - return $tokens->isTokenKindFound(T_FUNCTION); + return $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]); } /** @@ -104,13 +124,10 @@ protected function isSkippedType(string $type): bool return isset(self::SKIPPED_TYPES[$type]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; 0 < $index; --$index) { - if (!$tokens[$index]->isGivenKind(T_FUNCTION)) { + if (!$tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) { continue; } @@ -126,13 +143,34 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } foreach ($this->getAnnotationsFromDocComment('param', $tokens, $docCommentIndex) as $paramTypeAnnotation) { - $typeInfo = $this->getCommonTypeFromAnnotation($paramTypeAnnotation, false); + $typesExpression = $paramTypeAnnotation->getTypeExpression(); + + if (null === $typesExpression) { + continue; + } + + $typeInfo = $this->getCommonTypeInfo($typesExpression, false); + $unionTypes = null; if (null === $typeInfo) { + $unionTypes = $this->getUnionTypes($typesExpression, false); + } + + if (null === $typeInfo && null === $unionTypes) { continue; } - [$paramType, $isNullable] = $typeInfo; + if (null !== $typeInfo) { + $paramType = $typeInfo['commonType']; + $isNullable = $typeInfo['isNullable']; + } elseif (null !== $unionTypes) { + $paramType = $unionTypes; + $isNullable = false; + } + + if (!isset($paramType, $isNullable)) { + continue; + } $startIndex = $tokens->getNextTokenOfKind($index, ['(']); $variableIndex = $this->findCorrectVariable($tokens, $startIndex, $paramTypeAnnotation); @@ -151,7 +189,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - if (!$this->isValidSyntax(sprintf('isValidSyntax(\sprintf(self::TYPE_CHECK_TEMPLATE, $paramType))) { continue; } @@ -163,6 +201,16 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } + protected function createTokensFromRawType(string $type): Tokens + { + $typeTokens = Tokens::fromCode(\sprintf(self::TYPE_CHECK_TEMPLATE, $type)); + $typeTokens->clearRange(0, 4); + $typeTokens->clearRange(\count($typeTokens) - 6, \count($typeTokens) - 1); + $typeTokens->clearEmptyTokens(); + + return $typeTokens; + } + private function findCorrectVariable(Tokens $tokens, int $startIndex, Annotation $paramTypeAnnotation): ?int { $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startIndex); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php index 260f7592..f7db0a4b 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php @@ -16,33 +16,48 @@ use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer; use PhpCsFixer\DocBlock\Annotation; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ExperimentalFixerInterface; +use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; -final class PhpdocToPropertyTypeFixer extends AbstractPhpdocToTypeDeclarationFixer +/** + * @phpstan-import-type _CommonTypeInfo from AbstractPhpdocToTypeDeclarationFixer + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * scalar_types?: bool, + * types_map?: array, + * union_types?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * scalar_types: bool, + * types_map: array, + * union_types: bool + * } + */ +final class PhpdocToPropertyTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ConfigurableFixerInterface, ExperimentalFixerInterface { + private const TYPE_CHECK_TEMPLATE = ' */ private array $skippedTypes = [ - 'mixed' => true, 'resource' => true, 'null' => true, ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'EXPERIMENTAL: Takes `@var` annotation of non-mixed types and adjusts accordingly the property signature. Requires PHP >= 7.4.', + 'Takes `@var` annotation of non-mixed types and adjusts accordingly the property signature..', [ - new VersionSpecificCodeSample( + new CodeSample( ' false] ), + new CodeSample( + ' false] + ), ], null, - 'This rule is EXPERIMENTAL and [1] is not covered with backward compatibility promise. [2] `@var` annotation is mandatory for the fixer to make changes, signatures of properties without it (no docblock) will not be fixed. [3] Manual actions might be required for newly typed properties that are read before initialization.' + 'The `@var` annotation is mandatory for the fixer to make changes, signatures of properties without it (no docblock) will not be fixed. Manual actions might be required for newly typed properties that are read before initialization.' ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); @@ -82,12 +103,12 @@ public function isCandidate(Tokens $tokens): bool /** * {@inheritdoc} * - * Must run before NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer. + * Must run before FullyQualifiedStrictTypesFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer. * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. */ public function getPriority(): int { - return 7; + return 8; } protected function isSkippedType(string $type): bool @@ -95,9 +116,6 @@ protected function isSkippedType(string $type): bool return isset($this->skippedTypes[$type]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; 0 < $index; --$index) { @@ -107,6 +125,16 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } + protected function createTokensFromRawType(string $type): Tokens + { + $typeTokens = Tokens::fromCode(\sprintf(self::TYPE_CHECK_TEMPLATE, $type)); + $typeTokens->clearRange(0, 8); + $typeTokens->clearRange(\count($typeTokens) - 5, \count($typeTokens) - 1); + $typeTokens->clearEmptyTokens(); + + return $typeTokens; + } + private function fixClass(Tokens $tokens, int $index): void { $index = $tokens->getNextTokenOfKind($index, ['{']); @@ -143,12 +171,17 @@ private function fixClass(Tokens $tokens, int $index): void continue; } - [$propertyType, $isNullable] = $typeInfo; + $propertyType = $typeInfo['commonType']; + $isNullable = $typeInfo['isNullable']; if (\in_array($propertyType, ['callable', 'never', 'void'], true)) { continue; } + if (!$this->isValidSyntax(\sprintf(self::TYPE_CHECK_TEMPLATE, $propertyType))) { + continue; + } + $newTokens = array_merge( $this->createTypeDeclarationTokens($propertyType, $isNullable), [new Token([T_WHITESPACE, ' '])] @@ -195,7 +228,9 @@ private function findNextUntypedPropertiesDeclaration(Tokens $tokens, int $index /** * @param array $propertyIndices - * @param Annotation[] $annotations + * @param list $annotations + * + * @return ?_CommonTypeInfo */ private function resolveApplicableType(array $propertyIndices, array $annotations): ?array { @@ -209,18 +244,35 @@ private function resolveApplicableType(array $propertyIndices, array $annotation continue; } - $propertyName = key($propertyIndices); + $propertyName = array_key_first($propertyIndices); } if (!isset($propertyIndices[$propertyName])) { continue; } - $typeInfo = $this->getCommonTypeFromAnnotation($annotation, false); + $typesExpression = $annotation->getTypeExpression(); + + if (null === $typesExpression) { + continue; + } + + $typeInfo = $this->getCommonTypeInfo($typesExpression, false); + $unionTypes = null; + + if (null === $typeInfo) { + $unionTypes = $this->getUnionTypes($typesExpression, false); + } + + if (null === $typeInfo && null === $unionTypes) { + continue; + } + + if (null !== $unionTypes) { + $typeInfo = ['commonType' => $unionTypes, 'isNullable' => false]; + } - if (!isset($propertyTypes[$propertyName])) { - $propertyTypes[$propertyName] = []; - } elseif ($typeInfo !== $propertyTypes[$propertyName]) { + if (\array_key_exists($propertyName, $propertyTypes) && $typeInfo !== $propertyTypes[$propertyName]) { return null; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php index cc0b6804..0debfc93 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php @@ -15,6 +15,8 @@ namespace PhpCsFixer\Fixer\FunctionNotation; use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ExperimentalFixerInterface; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; @@ -26,9 +28,24 @@ /** * @author Filippo Tessarotto + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * scalar_types?: bool, + * types_map?: array, + * union_types?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * scalar_types: bool, + * types_map: array, + * union_types: bool + * } */ -final class PhpdocToReturnTypeFixer extends AbstractPhpdocToTypeDeclarationFixer +final class PhpdocToReturnTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ConfigurableFixerInterface, ExperimentalFixerInterface { + private const TYPE_CHECK_TEMPLATE = '> */ @@ -42,18 +59,14 @@ final class PhpdocToReturnTypeFixer extends AbstractPhpdocToTypeDeclarationFixer * @var array */ private array $skippedTypes = [ - 'mixed' => true, 'resource' => true, 'null' => true, ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'EXPERIMENTAL: Takes `@return` annotation of non-mixed types and adjusts accordingly the function signature. Requires PHP >= 7.0.', + 'Takes `@return` annotation of non-mixed types and adjusts accordingly the function signature.', [ new CodeSample( ' false] ), + new CodeSample( + ' false] + ), new VersionSpecificCodeSample( 'isAnyTokenKindsFound([T_FUNCTION, T_FN]); @@ -116,7 +131,7 @@ public function isCandidate(Tokens $tokens): bool /** * {@inheritdoc} * - * Must run before FullyQualifiedStrictTypesFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer, ReturnTypeDeclarationFixer. + * Must run before FullyQualifiedStrictTypesFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer, ReturnToYieldFromFixer, ReturnTypeDeclarationFixer. * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. */ public function getPriority(): int @@ -129,15 +144,8 @@ protected function isSkippedType(string $type): bool return isset($this->skippedTypes[$type]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - if (\PHP_VERSION_ID >= 8_00_00) { - unset($this->skippedTypes['mixed']); - } - for ($index = $tokens->count() - 1; 0 < $index; --$index) { if (!$tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) { continue; @@ -154,33 +162,57 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - $returnTypeAnnotation = $this->getAnnotationsFromDocComment('return', $tokens, $docCommentIndex); - if (1 !== \count($returnTypeAnnotation)) { + $returnTypeAnnotations = $this->getAnnotationsFromDocComment('return', $tokens, $docCommentIndex); + if (1 !== \count($returnTypeAnnotations)) { continue; } - $typeInfo = $this->getCommonTypeFromAnnotation(current($returnTypeAnnotation), true); + $returnTypeAnnotation = $returnTypeAnnotations[0]; - if (null === $typeInfo) { + $typesExpression = $returnTypeAnnotation->getTypeExpression(); + + if (null === $typesExpression) { continue; } - [$returnType, $isNullable] = $typeInfo; + $typeInfo = $this->getCommonTypeInfo($typesExpression, true); + $unionTypes = null; - $startIndex = $tokens->getNextTokenOfKind($index, ['{', ';']); + if (null === $typeInfo) { + $unionTypes = $this->getUnionTypes($typesExpression, true); + } - if ($this->hasReturnTypeHint($tokens, $startIndex)) { + if (null === $typeInfo && null === $unionTypes) { continue; } - if (!$this->isValidSyntax(sprintf('getPrevTokenOfKind($startIndex, [')']); + $paramsStartIndex = $tokens->getNextTokenOfKind($index, ['(']); + $paramsEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $paramsStartIndex); + + $bodyStartIndex = $tokens->getNextTokenOfKind($paramsEndIndex, ['{', ';', [T_DOUBLE_ARROW]]); + + if ($this->hasReturnTypeHint($tokens, $bodyStartIndex)) { + continue; + } + + if (!$this->isValidSyntax(\sprintf(self::TYPE_CHECK_TEMPLATE, $returnType))) { + continue; + } $tokens->insertAt( - $endFuncIndex + 1, + $paramsEndIndex + 1, array_merge( [ new Token([CT::T_TYPE_COLON, ':']), @@ -192,6 +224,16 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } + protected function createTokensFromRawType(string $type): Tokens + { + $typeTokens = Tokens::fromCode(\sprintf(self::TYPE_CHECK_TEMPLATE, $type)); + $typeTokens->clearRange(0, 7); + $typeTokens->clearRange(\count($typeTokens) - 3, \count($typeTokens) - 1); + $typeTokens->clearEmptyTokens(); + + return $typeTokens; + } + /** * Determine whether the function already has a return type hint. * diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php index 32d49213..7538ff7a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php @@ -28,9 +28,6 @@ */ final class RegularCallableCallFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -69,9 +66,6 @@ public function getPriority(): int return 2; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); @@ -82,9 +76,6 @@ public function isRisky(): bool return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionsAnalyzer = new FunctionsAnalyzer(); @@ -112,7 +103,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @param array $arguments + * @param non-empty-array $arguments */ private function processCall(Tokens $tokens, int $index, array $arguments): void { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ReturnTypeDeclarationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ReturnTypeDeclarationFixer.php index eea0fb89..1b54e2ff 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ReturnTypeDeclarationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ReturnTypeDeclarationFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -28,12 +29,21 @@ /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * space_before?: 'none'|'one' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * space_before: 'none'|'one' + * } */ final class ReturnTypeDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -58,24 +68,18 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run after PhpdocToReturnTypeFixer, VoidReturnFixer. + * Must run after PhpUnitDataProviderReturnTypeFixer, PhpdocToReturnTypeFixer, VoidReturnFixer. */ public function getPriority(): int { return -17; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(CT::T_TYPE_COLON); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $oneSpaceBefore = 'one' === $this->configuration['space_before']; @@ -116,9 +120,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/SingleLineThrowFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/SingleLineThrowFixer.php index 7a6e8c23..3ee0d51a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/SingleLineThrowFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/SingleLineThrowFixer.php @@ -31,9 +31,6 @@ final class SingleLineThrowFixer extends AbstractFixer private const REMOVE_WHITESPACE_AROUND_TOKENS = ['(', [T_DOUBLE_COLON]]; private const REMOVE_WHITESPACE_BEFORE_TOKENS = [')', ']', ',', ';']; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -44,9 +41,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_THROW); @@ -62,9 +56,6 @@ public function getPriority(): int return 36; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = 0, $count = $tokens->count(); $index < $count; ++$index) { @@ -74,7 +65,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $endCandidateIndex = $tokens->getNextMeaningfulToken($index); - while (!$tokens[$endCandidateIndex]->equalsAny([')', ']', ',', ';'])) { + while (!$tokens[$endCandidateIndex]->equalsAny([')', ']', ',', ';', [T_CLOSE_TAG]])) { $blockType = Tokens::detectBlockType($tokens[$endCandidateIndex]); if (null !== $blockType) { @@ -104,7 +95,7 @@ private function trimNewLines(Tokens $tokens, int $startIndex, int $endIndex): v } elseif (str_starts_with($content, '#')) { $content = '/*'.substr($content, 1).' */'; $tokens->clearAt($index + 1); - } elseif (0 !== Preg::match('/\R/', $content)) { + } elseif (Preg::match('/\R/', $content)) { $content = Preg::replace('/\R/', ' ', $content); } @@ -117,7 +108,7 @@ private function trimNewLines(Tokens $tokens, int $startIndex, int $endIndex): v continue; } - if (0 === Preg::match('/\R/', $content)) { + if (!Preg::match('/\R/', $content)) { continue; } @@ -149,7 +140,7 @@ private function isPreviousTokenToClear(Token $token): bool static $tokens = null; if (null === $tokens) { - $tokens = array_merge(self::REMOVE_WHITESPACE_AFTER_TOKENS, self::REMOVE_WHITESPACE_AROUND_TOKENS); + $tokens = [...self::REMOVE_WHITESPACE_AFTER_TOKENS, ...self::REMOVE_WHITESPACE_AROUND_TOKENS]; } return $token->equalsAny($tokens) || $token->isObjectOperator(); @@ -160,7 +151,7 @@ private function isNextTokenToClear(Token $token): bool static $tokens = null; if (null === $tokens) { - $tokens = array_merge(self::REMOVE_WHITESPACE_AROUND_TOKENS, self::REMOVE_WHITESPACE_BEFORE_TOKENS); + $tokens = [...self::REMOVE_WHITESPACE_AROUND_TOKENS, ...self::REMOVE_WHITESPACE_BEFORE_TOKENS]; } return $token->equalsAny($tokens) || $token->isObjectOperator(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/StaticLambdaFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/StaticLambdaFixer.php index 9db289f3..81763f7f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/StaticLambdaFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/StaticLambdaFixer.php @@ -25,38 +25,26 @@ final class StaticLambdaFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Lambdas not (indirect) referencing `$this` must be declared `static`.', + 'Lambdas not (indirectly) referencing `$this` must be declared `static`.', [new CodeSample("bindTo` on lambdas without referencing to `$this`.' ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $analyzer = new TokensAnalyzer($tokens); @@ -83,7 +71,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $lambdaEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $lambdaOpenIndex); } else { // T_FN $lambdaOpenIndex = $tokens->getNextTokenOfKind($argumentsEndIndex, [[T_DOUBLE_ARROW]]); - $lambdaEndIndex = $this->findExpressionEnd($tokens, $lambdaOpenIndex); + $lambdaEndIndex = $analyzer->getLastTokenIndexOfArrowFunction($index); } if ($this->hasPossibleReferenceToThis($tokens, $lambdaOpenIndex, $lambdaEndIndex)) { @@ -103,31 +91,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - private function findExpressionEnd(Tokens $tokens, int $index): int - { - $nextIndex = $tokens->getNextMeaningfulToken($index); - - while (null !== $nextIndex) { - /** @var Token $nextToken */ - $nextToken = $tokens[$nextIndex]; - - if ($nextToken->equalsAny([',', ';', [T_CLOSE_TAG]])) { - break; - } - - $blockType = Tokens::detectBlockType($nextToken); - - if (null !== $blockType && $blockType['isStart']) { - $nextIndex = $tokens->findBlockEnd($blockType['type'], $nextIndex); - } - - $index = $nextIndex; - $nextIndex = $tokens->getNextMeaningfulToken($index); - } - - return $index; - } - /** * Returns 'true' if there is a possible reference to '$this' within the given tokens index range. */ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/UseArrowFunctionsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/UseArrowFunctionsFixer.php index 624a8205..4d18b8cd 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/UseArrowFunctionsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/UseArrowFunctionsFixer.php @@ -15,10 +15,9 @@ namespace PhpCsFixer\Fixer\FunctionNotation; use PhpCsFixer\AbstractFixer; +use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; @@ -29,24 +28,20 @@ */ final class UseArrowFunctionsFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Anonymous functions with one-liner return statement must use arrow functions.', + 'Anonymous functions with return as the only statement must use arrow functions.', [ - new VersionSpecificCodeSample( + new CodeSample( <<<'SAMPLE' -isAllTokenKindsFound([T_FUNCTION, T_RETURN]); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; @@ -72,7 +61,14 @@ public function isRisky(): bool /** * {@inheritdoc} + * + * Must run before FunctionDeclarationFixer. */ + public function getPriority(): int + { + return 32; + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $analyzer = new TokensAnalyzer($tokens); @@ -82,8 +78,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - // Find parameters end - // Abort if they are multilined + // Find parameters $parametersStart = $tokens->getNextMeaningfulToken($index); @@ -93,10 +88,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $parametersEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $parametersStart); - if ($this->isMultilined($tokens, $parametersStart, $parametersEnd)) { - continue; - } - // Find `use ()` start and end // Abort if it contains reference variables @@ -162,29 +153,12 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - // Abort if the `return` statement is multilined - - if ($this->isMultilined($tokens, $return, $semicolon)) { - continue; - } - // Transform the function to an arrow function $this->transform($tokens, $index, $useStart, $useEnd, $braceOpen, $return, $semicolon, $braceClose); } } - private function isMultilined(Tokens $tokens, int $start, int $end): bool - { - for ($i = $start; $i < $end; ++$i) { - if (str_contains($tokens[$i]->getContent(), "\n")) { - return true; - } - } - - return false; - } - private function transform(Tokens $tokens, int $index, ?int $useStart, ?int $useEnd, int $braceOpen, int $return, int $semicolon, int $braceClose): void { $tokensToInsert = [new Token([T_DOUBLE_ARROW, '=>'])]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php index 61d4a8ea..f391347e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php @@ -30,13 +30,10 @@ */ final class VoidReturnFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Add `void` return type to functions with missing or empty return statements, but priority is given to `@return` annotations. Requires PHP >= 7.1.', + 'Add `void` return type to functions with missing or empty return statements, but priority is given to `@return` annotations.', [ new CodeSample( "isTokenKindFound(T_FUNCTION); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { // These cause syntax errors. @@ -232,20 +220,30 @@ private function fixFunctionDefinition(Tokens $tokens, int $index): void * * @param int $index The index of the function token * - * @return Annotation[] + * @return list */ private function findReturnAnnotations(Tokens $tokens, int $index): array { - do { - $index = $tokens->getPrevNonWhitespace($index); - } while ($tokens[$index]->isGivenKind([ + $previousTokens = [ T_ABSTRACT, T_FINAL, T_PRIVATE, T_PROTECTED, T_PUBLIC, T_STATIC, - ])); + ]; + + if (\defined('T_ATTRIBUTE')) { // @TODO: drop condition when PHP 8.0+ is required + $previousTokens[] = T_ATTRIBUTE; + } + + do { + $index = $tokens->getPrevNonWhitespace($index); + + if ($tokens[$index]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { + $index = $tokens->getPrevTokenOfKind($index, [[T_ATTRIBUTE]]); + } + } while ($tokens[$index]->isGivenKind($previousTokens)); if (!$tokens[$index]->isGivenKind(T_DOC_COMMENT)) { return []; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php index 9a08aae5..151604b2 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php @@ -15,39 +15,147 @@ namespace PhpCsFixer\Fixer\Import; use PhpCsFixer\AbstractFixer; +use PhpCsFixer\DocBlock\TypeExpression; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Preg; use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Processor\ImportProcessor; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; /** * @author VeeWee + * @author Tomas Jadrny + * @author Greg Korba + * @author SpacePossum + * @author Michael Vorisek + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * import_symbols?: bool, + * leading_backslash_in_global_namespace?: bool, + * phpdoc_tags?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * import_symbols: bool, + * leading_backslash_in_global_namespace: bool, + * phpdoc_tags: list + * } + * @phpstan-type _Uses array{ + * constant?: array, + * class?: array, + * function?: array + * } + * + * @phpstan-import-type _ImportType from \PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis */ -final class FullyQualifiedStrictTypesFixer extends AbstractFixer +final class FullyQualifiedStrictTypesFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + private const REGEX_CLASS = '(?:\\\?+'.TypeExpression::REGEX_IDENTIFIER + .'(\\\\'.TypeExpression::REGEX_IDENTIFIER.')*+)'; + /** - * {@inheritdoc} + * @var array{ + * constant?: list, + * class?: list, + * function?: list + * }|null + */ + private ?array $discoveredSymbols; + + /** + * @var array{ + * constant?: array, + * class?: array, + * function?: array + * } + */ + private array $symbolsForImport = []; + + /** + * @var array, array> + */ + private array $reservedIdentifiersByLevel; + + /** + * @var array{ + * constant?: array, + * class?: array, + * function?: array + * } */ + private array $cacheUsesLast = []; + + /** + * @var array{ + * constant?: array, + * class?: array, + * function?: array + * } + */ + private array $cacheUseNameByShortNameLower; + + /** @var _Uses */ + private array $cacheUseShortNameByNameLower; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Transforms imported FQCN parameters and return types in function arguments to short version.', + 'Removes the leading part of fully qualified symbol references if a given symbol is imported or belongs to the current namespace.', [ new CodeSample( 'baz = $baz; + } + + /** + * @return \Foo\Bar\Baz + */ + public function getBaz() { + return $this->baz; + } + + public function doX(\Foo\Bar $foo, \Exception $e): \Foo\Bar\Baz { + try {} + catch (\Foo\SomeException $e) {} } } ' @@ -55,16 +163,51 @@ public function doSomething(\Foo\Bar $foo) new CodeSample( ' true] + ), + new CodeSample( + ' true] + ), + new CodeSample( + ' true] ), ] ); @@ -73,55 +216,413 @@ public function doSomething(\Foo\Bar $foo): \Foo\Bar\Baz /** * {@inheritdoc} * - * Must run before NoSuperfluousPhpdocTagsFixer. - * Must run after PhpdocToReturnTypeFixer. + * Must run before NoSuperfluousPhpdocTagsFixer, OrderedAttributesFixer, OrderedImportsFixer, OrderedInterfacesFixer, StatementIndentationFixer. + * Must run after ClassKeywordFixer, PhpUnitAttributesFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer. */ public function getPriority(): int { return 7; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - return $tokens->isTokenKindFound(T_FUNCTION); + return $tokens->isAnyTokenKindsFound([ + CT::T_USE_TRAIT, + ...(\defined('T_ATTRIBUTE') ? [T_ATTRIBUTE] : []), // @TODO: drop condition when PHP 8.0+ is required + T_CATCH, + T_DOUBLE_COLON, + T_DOC_COMMENT, + T_EXTENDS, + T_FUNCTION, + T_IMPLEMENTS, + T_INSTANCEOF, + T_NEW, + T_VARIABLE, + ]); + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder( + 'leading_backslash_in_global_namespace', + 'Whether FQCN is prefixed with backslash when that FQCN is used in global namespace context.' + )) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + (new FixerOptionBuilder( + 'import_symbols', + 'Whether FQCNs should be automatically imported.' + )) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + (new FixerOptionBuilder( + 'phpdoc_tags', + 'Collection of PHPDoc annotation tags where FQCNs should be processed. As of now only simple tags with `@tag \F\Q\C\N` format are supported (no complex types).' + )) + ->setAllowedTypes(['string[]']) + ->setDefault([ + 'param', + 'phpstan-param', + 'phpstan-property', + 'phpstan-property-read', + 'phpstan-property-write', + 'phpstan-return', + 'phpstan-var', + 'property', + 'property-read', + 'property-write', + 'psalm-param', + 'psalm-property', + 'psalm-property-read', + 'psalm-property-write', + 'psalm-return', + 'psalm-var', + 'return', + 'see', + 'throws', + 'var', + ]) + ->getOption(), + ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $namespacesAnalyzer = new NamespacesAnalyzer(); $namespaceUsesAnalyzer = new NamespaceUsesAnalyzer(); $functionsAnalyzer = new FunctionsAnalyzer(); - foreach ($namespacesAnalyzer->getDeclarations($tokens) as $namespace) { - $namespaceName = strtolower($namespace->getFullName()); + $this->symbolsForImport = []; + + foreach ($tokens->getNamespaceDeclarations() as $namespaceIndex => $namespace) { + $namespace = $tokens->getNamespaceDeclarations()[$namespaceIndex]; + + $namespaceName = $namespace->getFullName(); + + /** @var _Uses $uses */ $uses = []; + $lastUse = null; + + foreach ($namespaceUsesAnalyzer->getDeclarationsInNamespace($tokens, $namespace, true) as $use) { + if (!$use->isClass()) { + continue; + } + + $uses[$use->getHumanFriendlyType()][ltrim($use->getFullName(), '\\')] = $use->getShortName(); + $lastUse = $use; + } + + $indexDiff = 0; + foreach (true === $this->configuration['import_symbols'] ? [true, false] : [false] as $discoverSymbolsPhase) { + $this->discoveredSymbols = $discoverSymbolsPhase ? [] : null; + + $classyKinds = [T_CLASS, T_INTERFACE, T_TRAIT]; + if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required + $classyKinds[] = T_ENUM; + } + + $openedCurlyBrackets = 0; + $this->reservedIdentifiersByLevel = []; + + for ($index = $namespace->getScopeStartIndex(); $index < $namespace->getScopeEndIndex() + $indexDiff; ++$index) { + $origSize = \count($tokens); + + if ($tokens[$index]->equals('{')) { + ++$openedCurlyBrackets; + } if ($tokens[$index]->equals('}')) { + unset($this->reservedIdentifiersByLevel[$openedCurlyBrackets]); + --$openedCurlyBrackets; + } elseif ($discoverSymbolsPhase && $tokens[$index]->isGivenKind($classyKinds)) { + $this->fixNextName($tokens, $index, $uses, $namespaceName); + } elseif ($tokens[$index]->isGivenKind(T_FUNCTION)) { + $this->fixFunction($functionsAnalyzer, $tokens, $index, $uses, $namespaceName); + } elseif ($tokens[$index]->isGivenKind([T_EXTENDS, T_IMPLEMENTS])) { + $this->fixExtendsImplements($tokens, $index, $uses, $namespaceName); + } elseif ($tokens[$index]->isGivenKind(T_CATCH)) { + $this->fixCatch($tokens, $index, $uses, $namespaceName); + } elseif ($tokens[$index]->isGivenKind(T_DOUBLE_COLON)) { + $this->fixPrevName($tokens, $index, $uses, $namespaceName); + } elseif ($tokens[$index]->isGivenKind([T_INSTANCEOF, T_NEW, CT::T_USE_TRAIT, CT::T_TYPE_COLON])) { + $this->fixNextName($tokens, $index, $uses, $namespaceName); + } elseif ($tokens[$index]->isGivenKind(T_VARIABLE)) { + $prevIndex = $tokens->getPrevMeaningfulToken($index); + if (null !== $prevIndex && $tokens[$prevIndex]->isGivenKind(T_STRING)) { + $this->fixPrevName($tokens, $index, $uses, $namespaceName); + } + } elseif (\defined('T_ATTRIBUTE') && $tokens[$index]->isGivenKind(T_ATTRIBUTE)) { // @TODO: drop const check when PHP 8.0+ is required + $this->fixAttribute($tokens, $index, $uses, $namespaceName); + } elseif ($discoverSymbolsPhase && !\defined('T_ATTRIBUTE') && $tokens[$index]->isComment() && Preg::match('/#\[\s*('.self::REGEX_CLASS.')/', $tokens[$index]->getContent(), $matches)) { // @TODO: drop when PHP 8.0+ is required + /** @var class-string $attributeClass */ + $attributeClass = $matches[1]; + $this->determineShortType($attributeClass, 'class', $uses, $namespaceName); + } elseif ($tokens[$index]->isGivenKind(T_DOC_COMMENT)) { + Preg::matchAll('/\*\h*@(?:psalm-|phpstan-)?(?:template(?:-covariant|-contravariant)?|(?:import-)?type)\h+('.TypeExpression::REGEX_IDENTIFIER.')(?!\S)/i', $tokens[$index]->getContent(), $matches); + foreach ($matches[1] as $reservedIdentifier) { + $this->reservedIdentifiersByLevel[$openedCurlyBrackets + 1][$reservedIdentifier] = true; + } + + $this->fixPhpDoc($tokens, $index, $uses, $namespaceName); + } + + $indexDiff += \count($tokens) - $origSize; + } + + $this->reservedIdentifiersByLevel = []; + + if ($discoverSymbolsPhase) { + $this->setupUsesFromDiscoveredSymbols($uses, $namespaceName); + } + } + + if ([] !== $this->symbolsForImport) { + if (null !== $lastUse) { + $atIndex = $lastUse->getEndIndex() + 1; + } elseif (0 !== $namespace->getEndIndex()) { + $atIndex = $namespace->getEndIndex() + 1; + } else { + $firstTokenIndex = $tokens->getNextMeaningfulToken($namespace->getScopeStartIndex()); + if (null !== $firstTokenIndex && $tokens[$firstTokenIndex]->isGivenKind(T_DECLARE)) { + $atIndex = $tokens->getNextTokenOfKind($firstTokenIndex, [';']) + 1; + } else { + $atIndex = $namespace->getScopeStartIndex() + 1; + } + } + + // Insert all registered FQCNs + $this->createImportProcessor()->insertImports($tokens, $this->symbolsForImport, $atIndex); + + $this->symbolsForImport = []; + } + } + } + + /** + * @param _Uses $uses + */ + private function refreshUsesCache(array $uses): void + { + if ($this->cacheUsesLast === $uses) { + return; + } + + $this->cacheUsesLast = $uses; + + $this->cacheUseNameByShortNameLower = []; + $this->cacheUseShortNameByNameLower = []; + + foreach ($uses as $kind => $kindUses) { + foreach ($kindUses as $useLongName => $useShortName) { + $this->cacheUseNameByShortNameLower[$kind][strtolower($useShortName)] = $useLongName; + + /** + * @var class-string $normalisedUseLongName + * + * @phpstan-ignore varTag.nativeType + */ + $normalisedUseLongName = strtolower($useLongName); + $this->cacheUseShortNameByNameLower[$kind][$normalisedUseLongName] = $useShortName; + } + } + } + + private function isReservedIdentifier(string $symbol): bool + { + if (str_contains($symbol, '\\')) { // optimization only + return false; + } + + if ((new TypeAnalysis($symbol))->isReservedType()) { + return true; + } + + foreach ($this->reservedIdentifiersByLevel as $reservedIdentifiers) { + if (isset($reservedIdentifiers[$symbol])) { + return true; + } + } + + return false; + } + + /** + * Resolve absolute or relative symbol to normalized FQCN. + * + * @param _ImportType $importKind + * @param _Uses $uses + * + * @return class-string + */ + private function resolveSymbol(string $symbol, string $importKind, array $uses, string $namespaceName): string + { + if (str_starts_with($symbol, '\\')) { + return substr($symbol, 1); // @phpstan-ignore return.type + } + + if ($this->isReservedIdentifier($symbol)) { + return $symbol; // @phpstan-ignore return.type + } + + $this->refreshUsesCache($uses); + + $symbolArr = explode('\\', $symbol, 2); + $shortStartNameLower = strtolower($symbolArr[0]); + if (isset($this->cacheUseNameByShortNameLower[$importKind][$shortStartNameLower])) { + // @phpstan-ignore return.type + return $this->cacheUseNameByShortNameLower[$importKind][$shortStartNameLower].(isset($symbolArr[1]) ? '\\'.$symbolArr[1] : ''); + } + + return ('' !== $namespaceName ? $namespaceName.'\\' : '').$symbol; // @phpstan-ignore return.type + } + + /** + * Shorten normalized FQCN as much as possible. + * + * @param _ImportType $importKind + * @param _Uses $uses + */ + private function shortenSymbol(string $fqcn, string $importKind, array $uses, string $namespaceName): string + { + if ($this->isReservedIdentifier($fqcn)) { + return $fqcn; + } + + $this->refreshUsesCache($uses); + + $res = null; + + // try to shorten the name using namespace + $iMin = 0; + if (str_starts_with($fqcn, $namespaceName.'\\')) { + $tmpRes = substr($fqcn, \strlen($namespaceName) + 1); + if (!isset($this->cacheUseNameByShortNameLower[$importKind][strtolower(explode('\\', $tmpRes, 2)[0])]) && !$this->isReservedIdentifier($tmpRes)) { + $res = $tmpRes; + $iMin = substr_count($namespaceName, '\\') + 1; + } + } + + // try to shorten the name using uses + $tmp = $fqcn; + for ($i = substr_count($fqcn, '\\'); $i >= $iMin; --$i) { + if (isset($this->cacheUseShortNameByNameLower[$importKind][strtolower($tmp)])) { + $tmpRes = $this->cacheUseShortNameByNameLower[$importKind][strtolower($tmp)].substr($fqcn, \strlen($tmp)); + if (!$this->isReservedIdentifier($tmpRes)) { + $res = $tmpRes; + + break; + } + } + + if ($i > 0) { + $tmp = substr($tmp, 0, strrpos($tmp, '\\')); + } + } + + // shortening is not possible, add leading backslash if needed + if (null === $res) { + $res = $fqcn; + if ('' !== $namespaceName + || true === $this->configuration['leading_backslash_in_global_namespace'] + || isset($this->cacheUseNameByShortNameLower[$importKind][strtolower(explode('\\', $res, 2)[0])]) + ) { + $res = '\\'.$res; + } + } + + return $res; + } + + /** + * @param _Uses $uses + */ + private function setupUsesFromDiscoveredSymbols(array &$uses, string $namespaceName): void + { + foreach ($this->discoveredSymbols as $kind => $discoveredSymbols) { + $discoveredFqcnByShortNameLower = []; + + if ('' === $namespaceName) { + foreach ($discoveredSymbols as $symbol) { + if (!str_starts_with($symbol, '\\')) { + $shortStartName = explode('\\', ltrim($symbol, '\\'), 2)[0]; + $shortStartNameLower = strtolower($shortStartName); + $discoveredFqcnByShortNameLower[$kind][$shortStartNameLower] = $this->resolveSymbol($shortStartName, $kind, $uses, $namespaceName); + } + } + } - foreach ($namespaceUsesAnalyzer->getDeclarationsInNamespace($tokens, $namespace) as $use) { - $uses[strtolower(ltrim($use->getFullName(), '\\'))] = $use->getShortName(); + foreach ($uses[$kind] ?? [] as $useLongName => $useShortName) { + $discoveredFqcnByShortNameLower[$kind][strtolower($useShortName)] = $useLongName; } - for ($index = $namespace->getScopeStartIndex(); $index < $namespace->getScopeEndIndex(); ++$index) { - if ($tokens[$index]->isGivenKind(T_FUNCTION)) { - $this->fixFunction($functionsAnalyzer, $tokens, $index, $uses, $namespaceName); + $useByShortNameLower = []; + foreach ($uses[$kind] ?? [] as $useShortName) { + $useByShortNameLower[strtolower($useShortName)] = true; + } + + uasort($discoveredSymbols, static function ($a, $b) { + $res = str_starts_with($a, '\\') <=> str_starts_with($b, '\\'); + if (0 !== $res) { + return $res; + } + + return substr_count($a, '\\') <=> substr_count($b, '\\'); + }); + foreach ($discoveredSymbols as $symbol) { + while (true) { + $shortEndNameLower = strtolower(str_contains($symbol, '\\') ? substr($symbol, strrpos($symbol, '\\') + 1) : $symbol); + if (!isset($discoveredFqcnByShortNameLower[$kind][$shortEndNameLower])) { + $shortStartNameLower = strtolower(explode('\\', ltrim($symbol, '\\'), 2)[0]); + if (str_starts_with($symbol, '\\') || ('' === $namespaceName && !isset($useByShortNameLower[$shortStartNameLower])) + || !str_contains($symbol, '\\') + ) { + $discoveredFqcnByShortNameLower[$kind][$shortEndNameLower] = $this->resolveSymbol($symbol, $kind, $uses, $namespaceName); + + break; + } + } + // else short name collision - keep unimported + + if (str_starts_with($symbol, '\\') || '' === $namespaceName || !str_contains($symbol, '\\')) { + break; + } + + $symbol = substr($symbol, 0, strrpos($symbol, '\\')); + } + } + + foreach ($uses[$kind] ?? [] as $useLongName => $useShortName) { + $discoveredLongName = $discoveredFqcnByShortNameLower[$kind][strtolower($useShortName)] ?? null; + if (strtolower($discoveredLongName) === strtolower($useLongName)) { + unset($discoveredFqcnByShortNameLower[$kind][strtolower($useShortName)]); } } + + foreach ($discoveredFqcnByShortNameLower[$kind] ?? [] as $fqcn) { + $shortenedName = ltrim($this->shortenSymbol($fqcn, $kind, [], $namespaceName), '\\'); + if (str_contains($shortenedName, '\\')) { // prevent importing non-namespaced names in global namespace + $shortEndName = str_contains($fqcn, '\\') ? substr($fqcn, strrpos($fqcn, '\\') + 1) : $fqcn; + $uses[$kind][$fqcn] = $shortEndName; + $this->symbolsForImport[$kind][$shortEndName] = $fqcn; + } + } + + if (isset($this->symbolsForImport[$kind])) { + ksort($this->symbolsForImport[$kind], SORT_NATURAL); + } } } /** - * @param array $uses + * @param _Uses $uses */ private function fixFunction(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index, array $uses, string $namespaceName): void { $arguments = $functionsAnalyzer->getFunctionArguments($tokens, $index); - foreach ($arguments as $argument) { + foreach ($arguments as $i => $argument) { + $argument = $functionsAnalyzer->getFunctionArguments($tokens, $index)[$i]; + if ($argument->hasTypeAnalysis()) { $this->replaceByShortType($tokens, $argument->getTypeAnalysis(), $uses, $namespaceName); } @@ -135,90 +636,335 @@ private function fixFunction(FunctionsAnalyzer $functionsAnalyzer, Tokens $token } /** - * @param array $uses + * @param _Uses $uses */ - private function replaceByShortType(Tokens $tokens, TypeAnalysis $type, array $uses, string $namespaceName): void + private function fixPhpDoc(Tokens $tokens, int $index, array $uses, string $namespaceName): void { - if ($type->isReservedType()) { + $allowedTags = $this->configuration['phpdoc_tags']; + + if ([] === $allowedTags) { return; } - $typeStartIndex = $type->getStartIndex(); + $phpDoc = $tokens[$index]; + $phpDocContent = $phpDoc->getContent(); + $phpDocContentNew = Preg::replaceCallback('/([*{]\h*@)(\S+)(\h+)('.TypeExpression::REGEX_TYPES.')(?!(?!\})\S)/', function ($matches) use ($allowedTags, $uses, $namespaceName) { + if (!\in_array($matches[2], $allowedTags, true)) { + return $matches[0]; + } - if ($tokens[$typeStartIndex]->isGivenKind(CT::T_NULLABLE_TYPE)) { - $typeStartIndex = $tokens->getNextMeaningfulToken($typeStartIndex); + return $matches[1].$matches[2].$matches[3].$this->fixPhpDocType($matches[4], $uses, $namespaceName); + }, $phpDocContent); + + if ($phpDocContentNew !== $phpDocContent) { + $tokens[$index] = new Token([T_DOC_COMMENT, $phpDocContentNew]); } + } - $namespaceNameLength = \strlen($namespaceName); - $types = $this->getTypes($tokens, $typeStartIndex, $type->getEndIndex()); + /** + * @param _Uses $uses + */ + private function fixPhpDocType(string $type, array $uses, string $namespaceName): string + { + $typeExpression = new TypeExpression($type, null, []); + + $typeExpression = $typeExpression->mapTypes(function (TypeExpression $type) use ($uses, $namespaceName) { + $currentTypeValue = $type->toString(); - foreach ($types as $typeName => [$startIndex, $endIndex]) { - if (!str_starts_with($typeName, '\\')) { - continue; // no shorter type possible + if ($type->isCompositeType() || !Preg::match('/^'.self::REGEX_CLASS.'$/', $currentTypeValue)) { + return $type; } - $typeName = substr($typeName, 1); - $typeNameLower = strtolower($typeName); + /** @var class-string $currentTypeValue */ + $shortTokens = $this->determineShortType($currentTypeValue, 'class', $uses, $namespaceName); - if (isset($uses[$typeNameLower])) { - // if the type without leading "\" equals any of the full "uses" long names, it can be replaced with the short one - $tokens->overrideRange($startIndex, $endIndex, $this->namespacedStringToTokens($uses[$typeNameLower])); - } elseif ('' === $namespaceName) { - // if we are in the global namespace and the type is not imported the leading '\' can be removed (TODO nice config candidate) - foreach ($uses as $useShortName) { - if (strtolower($useShortName) === $typeNameLower) { - continue 2; - } + if (null === $shortTokens) { + return $type; + } + + $newTypeValue = implode('', array_map( + static fn (Token $token) => $token->getContent(), + $shortTokens + )); + + return $currentTypeValue === $newTypeValue + ? $type + : new TypeExpression($newTypeValue, null, []); + }); + + return $typeExpression->toString(); + } + + /** + * @param _Uses $uses + */ + private function fixExtendsImplements(Tokens $tokens, int $index, array $uses, string $namespaceName): void + { + // We handle `extends` and `implements` with similar logic, but we need to exit the loop under different conditions. + $isExtends = $tokens[$index]->equals([T_EXTENDS]); + $index = $tokens->getNextMeaningfulToken($index); + + $typeStartIndex = null; + $typeEndIndex = null; + + while (true) { + if ($tokens[$index]->equalsAny([',', '{', [T_IMPLEMENTS]])) { + if (null !== $typeStartIndex) { + $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName); } + $typeStartIndex = null; - $tokens->overrideRange($startIndex, $endIndex, $this->namespacedStringToTokens($typeName)); - } elseif ($typeNameLower !== $namespaceName && str_starts_with($typeNameLower, $namespaceName)) { - // if the type starts with namespace and the type is not the same as the namespace it can be shortened - $typeNameShort = substr($typeName, $namespaceNameLength + 1); - $tokens->overrideRange($startIndex, $endIndex, $this->namespacedStringToTokens($typeNameShort)); + if ($tokens[$index]->equalsAny($isExtends ? [[T_IMPLEMENTS], '{'] : ['{'])) { + break; + } + } else { + if (null === $typeStartIndex) { + $typeStartIndex = $index; + } + $typeEndIndex = $index; } + + $index = $tokens->getNextMeaningfulToken($index); } } /** - * @return iterable + * @param _Uses $uses */ - private function getTypes(Tokens $tokens, int $index, int $endIndex): iterable + private function fixCatch(Tokens $tokens, int $index, array $uses, string $namespaceName): void { - $index = $typeStartIndex = $typeEndIndex = $tokens->getNextMeaningfulToken($index - 1); - $type = $tokens[$index]->getContent(); + $index = $tokens->getNextMeaningfulToken($index); // '(' + $index = $tokens->getNextMeaningfulToken($index); // first part of first exception class to be caught + + $typeStartIndex = null; + $typeEndIndex = null; while (true) { + if ($tokens[$index]->equalsAny([')', [T_VARIABLE], [CT::T_TYPE_ALTERNATION]])) { + if (null === $typeStartIndex) { + break; + } + + $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName); + $typeStartIndex = null; + + if ($tokens[$index]->equals(')')) { + break; + } + } else { + if (null === $typeStartIndex) { + $typeStartIndex = $index; + } + $typeEndIndex = $index; + } + $index = $tokens->getNextMeaningfulToken($index); + } + } - if ($tokens[$index]->isGivenKind([CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION])) { - yield $type => [$typeStartIndex, $typeEndIndex]; + /** + * @param _Uses $uses + */ + private function fixAttribute(Tokens $tokens, int $index, array $uses, string $namespaceName): void + { + $attributeAnalysis = AttributeAnalyzer::collectOne($tokens, $index); - $index = $typeStartIndex = $typeEndIndex = $tokens->getNextMeaningfulToken($index); - $type = $tokens[$index]->getContent(); + foreach ($attributeAnalysis->getAttributes() as $attribute) { + $index = $attribute['start']; + while ($tokens[$index]->equalsAny([[T_STRING], [T_NS_SEPARATOR]])) { + $index = $tokens->getPrevMeaningfulToken($index); + } + $this->fixNextName($tokens, $index, $uses, $namespaceName); + } + } - continue; + /** + * @param _Uses $uses + */ + private function fixPrevName(Tokens $tokens, int $index, array $uses, string $namespaceName): void + { + $typeStartIndex = null; + $typeEndIndex = null; + + while (true) { + $index = $tokens->getPrevMeaningfulToken($index); + if ($tokens[$index]->isObjectOperator()) { + break; } - if ($index > $endIndex || !$tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR])) { - yield $type => [$typeStartIndex, $typeEndIndex]; + if ($tokens[$index]->equalsAny([[T_STRING], [T_NS_SEPARATOR]])) { + $typeStartIndex = $index; + if (null === $typeEndIndex) { + $typeEndIndex = $index; + } + } else { + if (null !== $typeEndIndex) { + $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName); + } + + break; + } + } + } + + /** + * @param _Uses $uses + */ + private function fixNextName(Tokens $tokens, int $index, array $uses, string $namespaceName): void + { + $typeStartIndex = null; + $typeEndIndex = null; + + while (true) { + $index = $tokens->getNextMeaningfulToken($index); + + if ($tokens[$index]->equalsAny([[T_STRING], [T_NS_SEPARATOR]])) { + if (null === $typeStartIndex) { + $typeStartIndex = $index; + } + $typeEndIndex = $index; + } else { + if (null !== $typeStartIndex) { + $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName); + } break; } + } + } + + /** + * @param _Uses $uses + */ + private function shortenClassIfPossible(Tokens $tokens, int $typeStartIndex, int $typeEndIndex, array $uses, string $namespaceName): int + { + /** @var class-string $content */ + $content = $tokens->generatePartialCode($typeStartIndex, $typeEndIndex); + $newTokens = $this->determineShortType($content, 'class', $uses, $namespaceName); + if (null === $newTokens) { + return 0; + } + + $tokens->overrideRange($typeStartIndex, $typeEndIndex, $newTokens); + + return \count($newTokens) - ($typeEndIndex - $typeStartIndex) - 1; + } + + /** + * @param _Uses $uses + */ + private function replaceByShortType(Tokens $tokens, TypeAnalysis $type, array $uses, string $namespaceName): void + { + $typeStartIndex = $type->getStartIndex(); + + if ($tokens[$typeStartIndex]->isGivenKind(CT::T_NULLABLE_TYPE)) { + $typeStartIndex = $tokens->getNextMeaningfulToken($typeStartIndex); + } + + $types = $this->getTypes($tokens, $typeStartIndex, $type->getEndIndex()); + + foreach ($types as [$startIndex, $endIndex]) { + /** @var class-string $content */ + $content = $tokens->generatePartialCode($startIndex, $endIndex); + $newTokens = $this->determineShortType($content, 'class', $uses, $namespaceName); + if (null !== $newTokens) { + $tokens->overrideRange($startIndex, $endIndex, $newTokens); + } + } + } + /** + * Determines short type based on FQCN, current namespace and imports (`use` declarations). + * + * @param class-string $typeName + * @param _ImportType $importKind + * @param _Uses $uses + * + * @return null|list + */ + private function determineShortType(string $typeName, string $importKind, array $uses, string $namespaceName): ?array + { + if (null !== $this->discoveredSymbols) { + if (!$this->isReservedIdentifier($typeName)) { + $this->discoveredSymbols[$importKind][] = $typeName; + } + + return null; + } + + $fqcn = $this->resolveSymbol($typeName, $importKind, $uses, $namespaceName); + $shortenedType = $this->shortenSymbol($fqcn, $importKind, $uses, $namespaceName); + if ($shortenedType === $typeName) { + return null; + } + + return $this->namespacedStringToTokens($shortenedType); + } + + /** + * @return iterable + */ + private function getTypes(Tokens $tokens, int $index, int $endIndex): iterable + { + $skipNextYield = false; + $typeStartIndex = $typeEndIndex = null; + while (true) { + if ($tokens[$index]->isGivenKind(CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN)) { + $index = $tokens->getNextMeaningfulToken($index); + $typeStartIndex = $typeEndIndex = null; + + continue; + } + + if ( + $tokens[$index]->isGivenKind([CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE]) + || $index > $endIndex + ) { + if (!$skipNextYield && null !== $typeStartIndex) { + $origCount = \count($tokens); + + yield [$typeStartIndex, $typeEndIndex]; + + $endIndex += \count($tokens) - $origCount; + + // type tokens were possibly updated, restart type match + $skipNextYield = true; + $index = $typeEndIndex = $typeStartIndex; + } else { + $skipNextYield = false; + $index = $tokens->getNextMeaningfulToken($index); + $typeStartIndex = $typeEndIndex = null; + } + + if ($index > $endIndex) { + break; + } + + continue; + } + + if (null === $typeStartIndex) { + $typeStartIndex = $index; + } $typeEndIndex = $index; - $type .= $tokens[$index]->getContent(); + + $index = $tokens->getNextMeaningfulToken($index); } } /** - * @return Token[] + * @return list */ private function namespacedStringToTokens(string $input): array { $tokens = []; - $parts = explode('\\', $input); + if (str_starts_with($input, '\\')) { + $tokens[] = new Token([T_NS_SEPARATOR, '\\']); + $input = substr($input, 1); + } + + $parts = explode('\\', $input); foreach ($parts as $index => $part) { $tokens[] = new Token([T_STRING, $part]); @@ -229,4 +975,13 @@ private function namespacedStringToTokens(string $input): array return $tokens; } + + /** + * We need to create import processor dynamically (not in costructor), because actual whitespace configuration + * is set later, not when fixer's instance is created. + */ + private function createImportProcessor(): ImportProcessor + { + return new ImportProcessor($this->whitespacesConfig); + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php index 7764cb2f..56c673ea 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php @@ -18,6 +18,7 @@ use PhpCsFixer\DocBlock\Annotation; use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -29,21 +30,43 @@ use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; use PhpCsFixer\Tokenizer\Analyzer\ClassyAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Processor\ImportProcessor; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; /** * @author Gregor Harlan + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * import_classes?: bool|null, + * import_constants?: bool|null, + * import_functions?: bool|null + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * import_classes: bool|null, + * import_constants: bool|null, + * import_functions: bool|null + * } */ final class GlobalNamespaceImportFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + private ImportProcessor $importProcessor; + + public function __construct() + { + parent::__construct(); + + $this->importProcessor = new ImportProcessor($this->whitespacesConfig); + } + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -94,7 +117,7 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before NoUnusedImportsFixer, OrderedImportsFixer. + * Must run before NoUnusedImportsFixer, OrderedImportsFixer, StatementIndentationFixer. * Must run after NativeConstantInvocationFixer, NativeFunctionInvocationFixer. */ public function getPriority(): int @@ -102,9 +125,6 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_DOC_COMMENT, T_NS_SEPARATOR, T_USE]) @@ -113,12 +133,9 @@ public function isCandidate(Tokens $tokens): bool && $tokens->isMonolithicPhp(); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $namespaceAnalyses = (new NamespacesAnalyzer())->getDeclarations($tokens); + $namespaceAnalyses = $tokens->getNamespaceDeclarations(); if (1 !== \count($namespaceAnalyses) || $namespaceAnalyses[0]->isGlobalNamespace()) { return; @@ -146,10 +163,16 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $this->fullyQualifyClasses($tokens, $useDeclarations); } - $newImports = array_filter($newImports); - if (\count($newImports) > 0) { - $this->insertImports($tokens, $newImports, $useDeclarations); + if (\count($useDeclarations) > 0) { + $useDeclaration = end($useDeclarations); + $atIndex = $useDeclaration->getEndIndex() + 1; + } else { + $namespace = $tokens->getNamespaceDeclarations()[0]; + $atIndex = $namespace->getEndIndex() + 1; + } + + $this->importProcessor->insertImports($tokens, $newImports, $atIndex); } } @@ -158,29 +181,27 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn return new FixerConfigurationResolver([ (new FixerOptionBuilder('import_constants', 'Whether to import, not import or ignore global constants.')) ->setDefault(null) - ->setAllowedValues([true, false, null]) + ->setAllowedTypes(['null', 'bool']) ->getOption(), (new FixerOptionBuilder('import_functions', 'Whether to import, not import or ignore global functions.')) ->setDefault(null) - ->setAllowedValues([true, false, null]) + ->setAllowedTypes(['null', 'bool']) ->getOption(), (new FixerOptionBuilder('import_classes', 'Whether to import, not import or ignore global classes.')) ->setDefault(true) - ->setAllowedValues([true, false, null]) + ->setAllowedTypes(['null', 'bool']) ->getOption(), ]); } /** - * @param NamespaceUseAnalysis[] $useDeclarations + * @param list $useDeclarations * - * @return array + * @return array */ private function importConstants(Tokens $tokens, array $useDeclarations): array { - [$global, $other] = $this->filterUseDeclarations($useDeclarations, static function (NamespaceUseAnalysis $declaration): bool { - return $declaration->isConstant(); - }, true); + [$global, $other] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isConstant(), true); // find namespaced const declarations (`const FOO = 1`) // and add them to the not importable names (already used) @@ -245,15 +266,13 @@ private function importConstants(Tokens $tokens, array $useDeclarations): array } /** - * @param NamespaceUseAnalysis[] $useDeclarations + * @param list $useDeclarations * - * @return array + * @return array */ private function importFunctions(Tokens $tokens, array $useDeclarations): array { - [$global, $other] = $this->filterUseDeclarations($useDeclarations, static function (NamespaceUseAnalysis $declaration): bool { - return $declaration->isFunction(); - }, false); + [$global, $other] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isFunction(), false); // find function declarations // and add them to the not importable names (already used) @@ -297,17 +316,15 @@ private function importFunctions(Tokens $tokens, array $useDeclarations): array } /** - * @param NamespaceUseAnalysis[] $useDeclarations + * @param list $useDeclarations * - * @return array + * @return array */ private function importClasses(Tokens $tokens, array $useDeclarations): array { - [$global, $other] = $this->filterUseDeclarations($useDeclarations, static function (NamespaceUseAnalysis $declaration): bool { - return $declaration->isClass(); - }, false); + [$global, $other] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isClass(), false); - /** @var DocBlock[] $docBlocks */ + /** @var array $docBlocks */ $docBlocks = []; // find class declarations and class usages in docblocks @@ -386,7 +403,9 @@ private function importClasses(Tokens $tokens, array $useDeclarations): array return $type; } + /** @var class-string $name */ $name = substr($type, 1); + $checkName = strtolower($name); if (str_contains($checkName, '\\') || isset($other[$checkName])) { @@ -407,22 +426,24 @@ private function importClasses(Tokens $tokens, array $useDeclarations): array } } - return $imports + $this->prepareImports($tokens, $indices, $global, $other, false); + return array_merge($imports, $this->prepareImports($tokens, $indices, $global, $other, false)); } /** * Removes the leading slash at the given indices (when the name is not already used). * - * @param int[] $indices - * @param array $other + * @param list $indices + * @param array $global + * @param array $other * - * @return array array keys contain the names that must be imported + * @return array array keys contain the names that must be imported */ private function prepareImports(Tokens $tokens, array $indices, array $global, array $other, bool $caseSensitive): array { $imports = []; foreach ($indices as $index) { + /** @var class-string $name */ $name = $tokens[$index]->getContent(); $checkName = $caseSensitive ? $name : strtolower($name); @@ -443,50 +464,7 @@ private function prepareImports(Tokens $tokens, array $indices, array $global, a } /** - * @param NamespaceUseAnalysis[] $useDeclarations - */ - private function insertImports(Tokens $tokens, array $imports, array $useDeclarations): void - { - if (\count($useDeclarations) > 0) { - $useDeclaration = end($useDeclarations); - $index = $useDeclaration->getEndIndex() + 1; - } else { - $namespace = (new NamespacesAnalyzer())->getDeclarations($tokens)[0]; - $index = $namespace->getEndIndex() + 1; - } - - $lineEnding = $this->whitespacesConfig->getLineEnding(); - - if (!$tokens[$index]->isWhitespace() || !str_contains($tokens[$index]->getContent(), "\n")) { - $tokens->insertAt($index, new Token([T_WHITESPACE, $lineEnding])); - } - - foreach ($imports as $type => $typeImports) { - foreach ($typeImports as $name) { - $items = [ - new Token([T_WHITESPACE, $lineEnding]), - new Token([T_USE, 'use']), - new Token([T_WHITESPACE, ' ']), - ]; - - if ('const' === $type) { - $items[] = new Token([CT::T_CONST_IMPORT, 'const']); - $items[] = new Token([T_WHITESPACE, ' ']); - } elseif ('function' === $type) { - $items[] = new Token([CT::T_FUNCTION_IMPORT, 'function']); - $items[] = new Token([T_WHITESPACE, ' ']); - } - - $items[] = new Token([T_STRING, $name]); - $items[] = new Token(';'); - - $tokens->insertAt($index, $items); - } - } - } - - /** - * @param NamespaceUseAnalysis[] $useDeclarations + * @param list $useDeclarations */ private function fullyQualifyConstants(Tokens $tokens, array $useDeclarations): void { @@ -494,11 +472,9 @@ private function fullyQualifyConstants(Tokens $tokens, array $useDeclarations): return; } - [$global] = $this->filterUseDeclarations($useDeclarations, static function (NamespaceUseAnalysis $declaration): bool { - return $declaration->isConstant() && !$declaration->isAliased(); - }, true); + [$global] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isConstant() && !$declaration->isAliased(), true); - if (!$global) { + if ([] === $global) { return; } @@ -528,7 +504,7 @@ private function fullyQualifyConstants(Tokens $tokens, array $useDeclarations): } /** - * @param NamespaceUseAnalysis[] $useDeclarations + * @param list $useDeclarations */ private function fullyQualifyFunctions(Tokens $tokens, array $useDeclarations): void { @@ -536,11 +512,9 @@ private function fullyQualifyFunctions(Tokens $tokens, array $useDeclarations): return; } - [$global] = $this->filterUseDeclarations($useDeclarations, static function (NamespaceUseAnalysis $declaration): bool { - return $declaration->isFunction() && !$declaration->isAliased(); - }, false); + [$global] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isFunction() && !$declaration->isAliased(), false); - if (!$global) { + if ([] === $global) { return; } @@ -570,7 +544,7 @@ private function fullyQualifyFunctions(Tokens $tokens, array $useDeclarations): } /** - * @param NamespaceUseAnalysis[] $useDeclarations + * @param list $useDeclarations */ private function fullyQualifyClasses(Tokens $tokens, array $useDeclarations): void { @@ -578,11 +552,9 @@ private function fullyQualifyClasses(Tokens $tokens, array $useDeclarations): vo return; } - [$global] = $this->filterUseDeclarations($useDeclarations, static function (NamespaceUseAnalysis $declaration): bool { - return $declaration->isClass() && !$declaration->isAliased(); - }, false); + [$global] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isClass() && !$declaration->isAliased(), false); - if (!$global) { + if ([] === $global) { return; } @@ -630,7 +602,9 @@ private function fullyQualifyClasses(Tokens $tokens, array $useDeclarations): vo } /** - * @param NamespaceUseAnalysis[] $declarations + * @param list $declarations + * + * @return array{0: array, 1: array} */ private function filterUseDeclarations(array $declarations, callable $callback, bool $caseSensitive): array { @@ -728,7 +702,7 @@ private function traverseDocBlockTypes(DocBlock $doc, callable $callback): bool foreach ($types as $i => $fullType) { $newFullType = $fullType; - Preg::matchAll('/[\\\\\w]+/', $fullType, $matches, PREG_OFFSET_CAPTURE); + Preg::matchAll('/[\\\\\w]+(?![\\\\\w:])/', $fullType, $matches, PREG_OFFSET_CAPTURE); foreach (array_reverse($matches[0]) as [$type, $offset]) { $newType = $callback($type); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GroupImportFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GroupImportFixer.php index d6e4351d..039555d5 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GroupImportFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GroupImportFixer.php @@ -15,6 +15,11 @@ namespace PhpCsFixer\Fixer\Import; use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; @@ -23,15 +28,36 @@ use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +use PhpCsFixer\Utils; +use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; /** * @author Volodymyr Kupriienko + * @author Greg Korba + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * group_types?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * group_types: list + * } + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ -final class GroupImportFixer extends AbstractFixer +final class GroupImportFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + /** @internal */ + public const GROUP_CLASSY = 'classy'; + + /** @internal */ + public const GROUP_CONSTANTS = 'constants'; + + /** @internal */ + public const GROUP_FUNCTIONS = 'functions'; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -40,39 +66,93 @@ public function getDefinition(): FixerDefinitionInterface new CodeSample( " [self::GROUP_CLASSY]] + ), ] ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_USE); } - /** - * {@inheritdoc} - */ + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + $allowedTypes = [self::GROUP_CLASSY, self::GROUP_FUNCTIONS, self::GROUP_CONSTANTS]; + + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('group_types', 'Defines the order of import types.')) + ->setAllowedTypes(['string[]']) + ->setAllowedValues([static function (array $types) use ($allowedTypes): bool { + foreach ($types as $type) { + if (!\in_array($type, $allowedTypes, true)) { + throw new InvalidOptionsException( + \sprintf( + 'Invalid group type: %s, allowed types: %s.', + $type, + Utils::naturalLanguageJoin($allowedTypes) + ) + ); + } + } + + return true; + }]) + ->setDefault($allowedTypes) + ->getOption(), + ]); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $useWithSameNamespaces = $this->getSameNamespaces($tokens); + $useWithSameNamespaces = $this->getSameNamespacesByType($tokens); if ([] === $useWithSameNamespaces) { return; } - $this->removeSingleUseStatements($useWithSameNamespaces, $tokens); - $this->addGroupUseStatements($useWithSameNamespaces, $tokens); + $typeMap = [ + NamespaceUseAnalysis::TYPE_CLASS => self::GROUP_CLASSY, + NamespaceUseAnalysis::TYPE_FUNCTION => self::GROUP_FUNCTIONS, + NamespaceUseAnalysis::TYPE_CONSTANT => self::GROUP_CONSTANTS, + ]; + + // As a first step we need to remove all the use statements for the enabled import types. + // We can't add new group imports yet, because we need to operate on previously determined token indices for all types. + foreach ($useWithSameNamespaces as $type => $uses) { + if (!\in_array($typeMap[$type], $this->configuration['group_types'], true)) { + continue; + } + + $this->removeSingleUseStatements($uses, $tokens); + } + + foreach ($useWithSameNamespaces as $type => $uses) { + if (!\in_array($typeMap[$type], $this->configuration['group_types'], true)) { + continue; + } + + $this->addGroupUseStatements($uses, $tokens); + } } /** * Gets namespace use analyzers with same namespaces. * - * @return NamespaceUseAnalysis[] + * @return array> */ - private function getSameNamespaces(Tokens $tokens): array + private function getSameNamespacesByType(Tokens $tokens): array { $useDeclarations = (new NamespaceUsesAnalyzer())->getDeclarationsFromTokens($tokens); @@ -81,15 +161,11 @@ private function getSameNamespaces(Tokens $tokens): array } $allNamespaceAndType = array_map( - function (NamespaceUseAnalysis $useDeclaration): string { - return $this->getNamespaceNameWithSlash($useDeclaration).$useDeclaration->getType(); - }, + fn (NamespaceUseAnalysis $useDeclaration): string => $this->getNamespaceNameWithSlash($useDeclaration).$useDeclaration->getType(), $useDeclarations ); - $sameNamespaces = array_filter(array_count_values($allNamespaceAndType), static function (int $count): bool { - return $count > 1; - }); + $sameNamespaces = array_filter(array_count_values($allNamespaceAndType), static fn (int $count): bool => $count > 1); $sameNamespaces = array_keys($sameNamespaces); $sameNamespaceAnalysis = array_filter($useDeclarations, function (NamespaceUseAnalysis $useDeclaration) use ($sameNamespaces): bool { @@ -102,14 +178,23 @@ function (NamespaceUseAnalysis $useDeclaration): string { $namespaceA = $this->getNamespaceNameWithSlash($a); $namespaceB = $this->getNamespaceNameWithSlash($b); - return \strlen($namespaceA) - \strlen($namespaceB) ?: strcmp($a->getFullName(), $b->getFullName()); + $namespaceDifference = \strlen($namespaceA) <=> \strlen($namespaceB); + + return 0 !== $namespaceDifference ? $namespaceDifference : $a->getFullName() <=> $b->getFullName(); }); - return $sameNamespaceAnalysis; + $sameNamespaceAnalysisByType = []; + foreach ($sameNamespaceAnalysis as $analysis) { + $sameNamespaceAnalysisByType[$analysis->getType()][] = $analysis; + } + + ksort($sameNamespaceAnalysisByType); + + return $sameNamespaceAnalysisByType; } /** - * @param NamespaceUseAnalysis[] $statements + * @param list $statements */ private function removeSingleUseStatements(array $statements, Tokens $tokens): void { @@ -140,12 +225,21 @@ private function removeSingleUseStatements(array $statements, Tokens $tokens): v } /** - * @param NamespaceUseAnalysis[] $statements + * @param list $statements */ private function addGroupUseStatements(array $statements, Tokens $tokens): void { $currentUseDeclaration = null; - $insertIndex = \array_slice($statements, -1)[0]->getEndIndex() + 1; + $insertIndex = $statements[0]->getStartIndex(); + + // If group import was inserted in place of removed imports, it may have more tokens than before, + // and indices stored in imports of another type can be out-of-sync, and can point in the middle of group import. + // Let's move the pointer to the closest empty token (erased single import). + if (null !== $tokens[$insertIndex]->getId() || '' !== $tokens[$insertIndex]->getContent()) { + do { + ++$insertIndex; + } while (null !== $tokens[$insertIndex]->getId() || '' !== $tokens[$insertIndex]->getContent()); + } foreach ($statements as $index => $useDeclaration) { if ($this->areDeclarationsDifferent($currentUseDeclaration, $useDeclaration)) { @@ -154,7 +248,7 @@ private function addGroupUseStatements(array $statements, Tokens $tokens): void $tokens, $insertIndex, $useDeclaration, - $this->getNamespaceNameWithSlash($currentUseDeclaration) + rtrim($this->getNamespaceNameWithSlash($currentUseDeclaration), '\\') ); } else { $newTokens = [ @@ -208,7 +302,7 @@ private function insertToGroupUseWithAlias(Tokens $tokens, int $insertIndex, Nam $tokens->insertAt($insertIndex, $newTokens); - return \count($newTokens) + 1; + return \count($newTokens); } /** @@ -218,10 +312,6 @@ private function createNewGroup(Tokens $tokens, int $insertIndex, NamespaceUseAn { $insertedTokens = 0; - if (\count($tokens) === $insertIndex) { - $tokens->setSize($insertIndex + 1); - } - $newTokens = [ new Token([T_USE, 'use']), new Token([T_WHITESPACE, ' ']), @@ -236,7 +326,7 @@ private function createNewGroup(Tokens $tokens, int $insertIndex, NamespaceUseAn $newTokens[] = new Token([T_WHITESPACE, ' ']); } - $namespaceParts = array_filter(explode('\\', $currentNamespace)); + $namespaceParts = explode('\\', $currentNamespace); foreach ($namespaceParts as $part) { $newTokens[] = new Token([T_STRING, $part]); @@ -252,15 +342,14 @@ private function createNewGroup(Tokens $tokens, int $insertIndex, NamespaceUseAn $insertIndex += $newTokensCount; if ($useDeclaration->isAliased()) { - $inserted = $this->insertToGroupUseWithAlias($tokens, $insertIndex + 1, $useDeclaration); + $inserted = $this->insertToGroupUseWithAlias($tokens, $insertIndex + 1, $useDeclaration) + 1; $insertedTokens += $inserted; $insertIndex += $inserted; } $tokens->insertAt($insertIndex, new Token([T_STRING, $useDeclaration->getShortName()])); - ++$insertedTokens; - return $insertedTokens; + return ++$insertedTokens; } /** diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoLeadingImportSlashFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoLeadingImportSlashFixer.php index a1bcc09a..b9120518 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoLeadingImportSlashFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoLeadingImportSlashFixer.php @@ -28,9 +28,6 @@ */ final class NoLeadingImportSlashFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -50,17 +47,11 @@ public function getPriority(): int return -20; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_USE); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnneededImportAliasFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnneededImportAliasFixer.php index 56a7d959..2d1532c9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnneededImportAliasFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnneededImportAliasFixer.php @@ -23,9 +23,6 @@ final class NoUnneededImportAliasFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -34,9 +31,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_USE, T_AS]); @@ -52,9 +46,6 @@ public function getPriority(): int return 1; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = \count($tokens) - 1; 0 <= $index; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnusedImportsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnusedImportsFixer.php index f39f4197..44642831 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnusedImportsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnusedImportsFixer.php @@ -22,7 +22,6 @@ use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; use PhpCsFixer\Tokenizer\Analyzer\GotoLabelAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; @@ -34,9 +33,6 @@ */ final class NoUnusedImportsFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -49,33 +45,27 @@ public function getDefinition(): FixerDefinitionInterface * {@inheritdoc} * * Must run before BlankLineAfterNamespaceFixer, NoExtraBlankLinesFixer, NoLeadingImportSlashFixer, SingleLineAfterImportsFixer. - * Must run after ClassKeywordRemoveFixer, GlobalNamespaceImportFixer, PhpUnitDedicateAssertFixer, PhpUnitFqcnAnnotationFixer, SingleImportPerStatementFixer. + * Must run after ClassKeywordRemoveFixer, GlobalNamespaceImportFixer, PhpUnitDedicateAssertFixer, PhpUnitFqcnAnnotationFixer. */ public function getPriority(): int { return -10; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_USE); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $useDeclarations = (new NamespaceUsesAnalyzer())->getDeclarationsFromTokens($tokens); + $useDeclarations = (new NamespaceUsesAnalyzer())->getDeclarationsFromTokens($tokens, true); if (0 === \count($useDeclarations)) { return; } - foreach ((new NamespacesAnalyzer())->getDeclarations($tokens) as $namespace) { + foreach ($tokens->getNamespaceDeclarations() as $namespace) { $currentNamespaceUseDeclarations = []; $currentNamespaceUseDeclarationIndices = []; @@ -141,10 +131,6 @@ private function isImportUsed(Tokens $tokens, NamespaceAnalysis $namespace, Name continue; } - if ($inAttribute) { - return true; - } - $prevMeaningfulToken = $tokens[$tokens->getPrevMeaningfulToken($index)]; if ($prevMeaningfulToken->isGivenKind(T_NAMESPACE)) { @@ -160,6 +146,10 @@ private function isImportUsed(Tokens $tokens, NamespaceAnalysis $namespace, Name continue; } + if ($inAttribute) { + return true; + } + $nextMeaningfulIndex = $tokens->getNextMeaningfulToken($index); if ($gotoLabelAnalyzer->belongsToGoToLabel($tokens, $nextMeaningfulIndex)) { @@ -185,7 +175,7 @@ private function isImportUsed(Tokens $tokens, NamespaceAnalysis $namespace, Name if ($token->isComment() && Preg::match( - '/(?getShortName().'(?![[:alnum:]])/i', + '/(?getShortName().'(?![[:alnum:]])/i', $token->getContent() ) ) { @@ -196,15 +186,23 @@ private function isImportUsed(Tokens $tokens, NamespaceAnalysis $namespace, Name return false; } - private function removeUseDeclaration(Tokens $tokens, NamespaceUseAnalysis $useDeclaration): void - { - for ($index = $useDeclaration->getEndIndex() - 1; $index >= $useDeclaration->getStartIndex(); --$index) { + private function removeUseDeclaration( + Tokens $tokens, + NamespaceUseAnalysis $useDeclaration, + bool $forceCompleteRemoval = false + ): void { + [$start, $end] = ($useDeclaration->isInMulti() && !$forceCompleteRemoval) + ? [$useDeclaration->getChunkStartIndex(), $useDeclaration->getChunkEndIndex()] + : [$useDeclaration->getStartIndex(), $useDeclaration->getEndIndex()]; + $loopStartIndex = $useDeclaration->isInMulti() || $forceCompleteRemoval ? $end : $end - 1; + + for ($index = $loopStartIndex; $index >= $start; --$index) { if ($tokens[$index]->isComment()) { continue; } if (!$tokens[$index]->isWhitespace() || !str_contains($tokens[$index]->getContent(), "\n")) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); + $tokens->clearAt($index); continue; } @@ -220,12 +218,109 @@ private function removeUseDeclaration(Tokens $tokens, NamespaceUseAnalysis $useD } } + // For multi-use import statements the tokens containing FQN were already removed in the loop above. + // We need to clean up tokens around the ex-chunk to keep the correct syntax and achieve proper formatting. + if (!$forceCompleteRemoval && $useDeclaration->isInMulti()) { + $this->cleanUpAfterImportChunkRemoval($tokens, $useDeclaration); + + return; + } + if ($tokens[$useDeclaration->getEndIndex()]->equals(';')) { // do not remove `? >` $tokens->clearAt($useDeclaration->getEndIndex()); } - // remove white space above and below where the `use` statement was + $this->cleanUpSurroundingNewLines($tokens, $useDeclaration); + } + + /** + * @param list $useDeclarations + */ + private function removeUsesInSameNamespace(Tokens $tokens, array $useDeclarations, NamespaceAnalysis $namespaceDeclaration): void + { + $namespace = $namespaceDeclaration->getFullName(); + $nsLength = \strlen($namespace.'\\'); + + foreach ($useDeclarations as $useDeclaration) { + if ($useDeclaration->isAliased()) { + continue; + } + + $useDeclarationFullName = ltrim($useDeclaration->getFullName(), '\\'); + + if (!str_starts_with($useDeclarationFullName, $namespace.'\\')) { + continue; + } + + $partName = substr($useDeclarationFullName, $nsLength); + + if (!str_contains($partName, '\\')) { + $this->removeUseDeclaration($tokens, $useDeclaration); + } + } + } + + private function cleanUpAfterImportChunkRemoval(Tokens $tokens, NamespaceUseAnalysis $useDeclaration): void + { + $beforeChunkIndex = $tokens->getPrevMeaningfulToken($useDeclaration->getChunkStartIndex()); + $afterChunkIndex = $tokens->getNextMeaningfulToken($useDeclaration->getChunkEndIndex()); + $hasNonEmptyTokenBefore = $this->scanForNonEmptyTokensUntilNewLineFound( + $tokens, + $afterChunkIndex, + -1 + ); + $hasNonEmptyTokenAfter = $this->scanForNonEmptyTokensUntilNewLineFound( + $tokens, + $afterChunkIndex, + 1 + ); + // We don't want to merge consequent new lines with indentation (leading to e.g. `\n \n `), + // so it's safe to merge whitespace only if there is any non-empty token before or after the chunk. + $mergingSurroundingWhitespaceIsSafe = $hasNonEmptyTokenBefore[1] || $hasNonEmptyTokenAfter[1]; + $clearToken = static function (int $index) use ($tokens, $mergingSurroundingWhitespaceIsSafe): void { + if ($mergingSurroundingWhitespaceIsSafe) { + $tokens->clearTokenAndMergeSurroundingWhitespace($index); + } else { + $tokens->clearAt($index); + } + }; + + if ($tokens[$afterChunkIndex]->equals(',')) { + $clearToken($afterChunkIndex); + } elseif ($tokens[$beforeChunkIndex]->equals(',')) { + $clearToken($beforeChunkIndex); + } + + // Ensure there's a single space where applicable, otherwise no space (before comma, before closing brace) + for ($index = $beforeChunkIndex; $index <= $afterChunkIndex; ++$index) { + if (null === $tokens[$index]->getId() || !$tokens[$index]->isWhitespace(' ')) { + continue; + } + + $nextTokenIndex = $tokens->getNextMeaningfulToken($index); + if ( + $tokens[$nextTokenIndex]->equals(',') + || $tokens[$nextTokenIndex]->equals(';') + || $tokens[$nextTokenIndex]->isGivenKind([CT::T_GROUP_IMPORT_BRACE_CLOSE]) + ) { + $tokens->clearAt($index); + } else { + $tokens[$index] = new Token([T_WHITESPACE, ' ']); + } + + $prevTokenIndex = $tokens->getPrevMeaningfulToken($index); + if ($tokens[$prevTokenIndex]->isGivenKind([CT::T_GROUP_IMPORT_BRACE_OPEN])) { + $tokens->clearAt($index); + } + } + + $this->removeLineIfEmpty($tokens, $useDeclaration); + $this->removeImportStatementIfEmpty($tokens, $useDeclaration); + } + + private function cleanUpSurroundingNewLines(Tokens $tokens, NamespaceUseAnalysis $useDeclaration): void + { $prevIndex = $useDeclaration->getStartIndex() - 1; $prevToken = $tokens[$prevIndex]; @@ -271,30 +366,90 @@ private function removeUseDeclaration(Tokens $tokens, NamespaceUseAnalysis $useD } } - /** - * @param list $useDeclarations - */ - private function removeUsesInSameNamespace(Tokens $tokens, array $useDeclarations, NamespaceAnalysis $namespaceDeclaration): void + private function removeImportStatementIfEmpty(Tokens $tokens, NamespaceUseAnalysis $useDeclaration): void { - $namespace = $namespaceDeclaration->getFullName(); - $nsLength = \strlen($namespace.'\\'); + // First we look for empty groups where all chunks were removed (`use Foo\{};`). + // We're only interested in ending brace if its index is between start and end of the import statement. + $endingBraceIndex = $tokens->getPrevTokenOfKind( + $useDeclaration->getEndIndex(), + [[CT::T_GROUP_IMPORT_BRACE_CLOSE]] + ); - foreach ($useDeclarations as $useDeclaration) { - if ($useDeclaration->isAliased()) { - continue; + if ($endingBraceIndex > $useDeclaration->getStartIndex()) { + $openingBraceIndex = $tokens->getPrevMeaningfulToken($endingBraceIndex); + + if ($tokens[$openingBraceIndex]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_OPEN)) { + $this->removeUseDeclaration($tokens, $useDeclaration, true); } + } - $useDeclarationFullName = ltrim($useDeclaration->getFullName(), '\\'); + // Second we look for empty groups where all comma-separated chunks were removed (`use;`). + $beforeSemicolonIndex = $tokens->getPrevMeaningfulToken($useDeclaration->getEndIndex()); + if ( + $tokens[$beforeSemicolonIndex]->isGivenKind([T_USE]) + || \in_array($tokens[$beforeSemicolonIndex]->getContent(), ['function', 'const'], true) + ) { + $this->removeUseDeclaration($tokens, $useDeclaration, true); + } + } - if (!str_starts_with($useDeclarationFullName, $namespace.'\\')) { + private function removeLineIfEmpty(Tokens $tokens, NamespaceUseAnalysis $useAnalysis): void + { + if (!$useAnalysis->isInMulti()) { + return; + } + + $hasNonEmptyTokenBefore = $this->scanForNonEmptyTokensUntilNewLineFound( + $tokens, + $useAnalysis->getChunkStartIndex(), + -1 + ); + $hasNonEmptyTokenAfter = $this->scanForNonEmptyTokensUntilNewLineFound( + $tokens, + $useAnalysis->getChunkEndIndex(), + 1 + ); + + if ( + \is_int($hasNonEmptyTokenBefore[0]) + && !$hasNonEmptyTokenBefore[1] + && \is_int($hasNonEmptyTokenAfter[0]) + && !$hasNonEmptyTokenAfter[1] + ) { + $tokens->clearRange($hasNonEmptyTokenBefore[0], $hasNonEmptyTokenAfter[0] - 1); + } + } + + /** + * Returns tuple with the index of first token with whitespace containing new line char + * and a flag if any non-empty token was found along the way. + * + * @param -1|1 $direction + * + * @return array{0: null|int, 1: bool} + */ + private function scanForNonEmptyTokensUntilNewLineFound(Tokens $tokens, int $index, int $direction): array + { + $hasNonEmptyToken = false; + $newLineTokenIndex = null; + + // Iterate until we find new line OR we get out of $tokens bounds (next sibling index is `null`). + while (\is_int($index)) { + $index = $tokens->getNonEmptySibling($index, $direction); + + if (null === $index || null === $tokens[$index]->getId()) { continue; } - $partName = substr($useDeclarationFullName, $nsLength); + if (!$tokens[$index]->isWhitespace()) { + $hasNonEmptyToken = true; + } elseif (str_starts_with($tokens[$index]->getContent(), "\n")) { + $newLineTokenIndex = $index; - if (!str_contains($partName, '\\')) { - $this->removeUseDeclaration($tokens, $useDeclaration); + break; } } + + return [$newLineTokenIndex, $hasNonEmptyToken]; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/OrderedImportsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/OrderedImportsFixer.php index 2b04d51d..eea91b49 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/OrderedImportsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/OrderedImportsFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -28,6 +29,7 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; +use PhpCsFixer\Utils; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; /** @@ -35,9 +37,33 @@ * @author Dariusz Rumiński * @author Darius Matulionis * @author Adriano Pilger + * + * @phpstan-type _UseImportInfo array{ + * namespace: non-empty-string, + * startIndex: int, + * endIndex: int, + * importType: self::IMPORT_TYPE_*, + * group: bool, + * } + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * case_sensitive?: bool, + * imports_order?: list|null, + * sort_algorithm?: 'alpha'|'length'|'none' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * case_sensitive: bool, + * imports_order: list|null, + * sort_algorithm: 'alpha'|'length'|'none' + * } */ final class OrderedImportsFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -71,20 +97,17 @@ final class OrderedImportsFixer extends AbstractFixer implements ConfigurableFix /** * Array of supported sort types in configuration. * - * @var string[] + * @var list */ private const SUPPORTED_SORT_TYPES = [self::IMPORT_TYPE_CLASS, self::IMPORT_TYPE_CONST, self::IMPORT_TYPE_FUNCTION]; /** * Array of supported sort algorithms in configuration. * - * @var string[] + * @var list */ private const SUPPORTED_SORT_ALGORITHMS = [self::SORT_ALPHA, self::SORT_LENGTH, self::SORT_NONE]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -93,6 +116,10 @@ public function getDefinition(): FixerDefinitionInterface new CodeSample( " true] + ), new CodeSample( 'isTokenKindFound(T_USE); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); $namespacesImports = $tokensAnalyzer->getImportUseIndexes(true); - if (0 === \count($namespacesImports)) { - return; - } + foreach (array_reverse($namespacesImports) as $usesPerNamespaceIndices) { + $count = \count($usesPerNamespaceIndices); - $usesOrder = []; - foreach ($namespacesImports as $uses) { - $usesOrder[] = $this->getNewOrder(array_reverse($uses), $tokens); - } - $usesOrder = array_replace(...$usesOrder); + if (0 === $count) { + continue; // nothing to sort + } - $usesOrder = array_reverse($usesOrder, true); - $mapStartToEnd = []; + if (1 === $count) { + $this->setNewOrder($tokens, $this->getNewOrder($usesPerNamespaceIndices, $tokens)); - foreach ($usesOrder as $use) { - $mapStartToEnd[$use['startIndex']] = $use['endIndex']; - } + continue; + } - // Now insert the new tokens, starting from the end - foreach ($usesOrder as $index => $use) { - $declarationTokens = Tokens::fromCode( - sprintf( - ' [$usesPerNamespaceIndices[0]]]; - $declarationTokens->clearRange(0, 2); // clear `clearAt(\count($declarationTokens) - 1); // clear `;` - $declarationTokens->clearEmptyTokens(); + // if there's some logic between two `use` statements, sort only imports grouped before that logic + for ($index = 0; $index < $count - 1; ++$index) { + $nextGroupUse = $tokens->getNextTokenOfKind($usesPerNamespaceIndices[$index], [';', [T_CLOSE_TAG]]); - $tokens->overrideRange($index, $mapStartToEnd[$index], $declarationTokens); - if ($use['group']) { - // a group import must start with `use` and cannot be part of comma separated import list - $prev = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$prev]->equals(',')) { - $tokens[$prev] = new Token(';'); - $tokens->insertAt($prev + 1, new Token([T_USE, 'use'])); + if ($tokens[$nextGroupUse]->isGivenKind(T_CLOSE_TAG)) { + $nextGroupUse = $tokens->getNextTokenOfKind($usesPerNamespaceIndices[$index], [[T_OPEN_TAG]]); + } - if (!$tokens[$prev + 2]->isWhitespace()) { - $tokens->insertAt($prev + 2, new Token([T_WHITESPACE, ' '])); - } + $nextGroupUse = $tokens->getNextMeaningfulToken($nextGroupUse); + + if ($nextGroupUse !== $usesPerNamespaceIndices[$index + 1]) { + $groupUses[++$groupUsesOffset] = []; } + + $groupUses[$groupUsesOffset][] = $usesPerNamespaceIndices[$index + 1]; + } + + for ($index = $groupUsesOffset; $index >= 0; --$index) { + $this->setNewOrder($tokens, $this->getNewOrder($groupUses[$index], $tokens)); } } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $supportedSortTypes = self::SUPPORTED_SORT_TYPES; @@ -256,24 +266,24 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setDefault(self::SORT_ALPHA) ->getOption(), (new FixerOptionBuilder('imports_order', 'Defines the order of import types.')) - ->setAllowedTypes(['array', 'null']) + ->setAllowedTypes(['string[]', 'null']) ->setAllowedValues([static function (?array $value) use ($supportedSortTypes): bool { if (null !== $value) { $missing = array_diff($supportedSortTypes, $value); if (\count($missing) > 0) { - throw new InvalidOptionsException(sprintf( - 'Missing sort %s "%s".', + throw new InvalidOptionsException(\sprintf( + 'Missing sort %s %s.', 1 === \count($missing) ? 'type' : 'types', - implode('", "', $missing) + Utils::naturalLanguageJoin($missing) )); } $unknown = array_diff($value, $supportedSortTypes); if (\count($unknown) > 0) { - throw new InvalidOptionsException(sprintf( - 'Unknown sort %s "%s".', + throw new InvalidOptionsException(\sprintf( + 'Unknown sort %s %s.', 1 === \count($unknown) ? 'type' : 'types', - implode('", "', $unknown) + Utils::naturalLanguageJoin($unknown) )); } } @@ -282,16 +292,18 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn }]) ->setDefault(null) // @TODO set to ['class', 'function', 'const'] on 4.0 ->getOption(), + (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), ]); } /** * This method is used for sorting the uses in a namespace. * - * @param array $first - * @param array $second - * - * @internal + * @param _UseImportInfo $first + * @param _UseImportInfo $second */ private function sortAlphabetically(array $first, array $second): int { @@ -299,16 +311,16 @@ private function sortAlphabetically(array $first, array $second): int $firstNamespace = str_replace('\\', ' ', $this->prepareNamespace($first['namespace'])); $secondNamespace = str_replace('\\', ' ', $this->prepareNamespace($second['namespace'])); - return strcasecmp($firstNamespace, $secondNamespace); + return true === $this->configuration['case_sensitive'] + ? $firstNamespace <=> $secondNamespace + : strcasecmp($firstNamespace, $secondNamespace); } /** * This method is used for sorting the uses statements in a namespace by length. * - * @param array $first - * @param array $second - * - * @internal + * @param _UseImportInfo $first + * @param _UseImportInfo $second */ private function sortByLength(array $first, array $second): int { @@ -319,7 +331,9 @@ private function sortByLength(array $first, array $second): int $secondNamespaceLength = \strlen($secondNamespace); if ($firstNamespaceLength === $secondNamespaceLength) { - $sortResult = strcasecmp($firstNamespace, $secondNamespace); + $sortResult = true === $this->configuration['case_sensitive'] + ? $firstNamespace <=> $secondNamespace + : strcasecmp($firstNamespace, $secondNamespace); } else { $sortResult = $firstNamespaceLength > $secondNamespaceLength ? 1 : -1; } @@ -334,14 +348,17 @@ private function prepareNamespace(string $namespace): string /** * @param list $uses + * + * @return array */ private function getNewOrder(array $uses, Tokens $tokens): array { $indices = []; $originalIndices = []; $lineEnding = $this->whitespacesConfig->getLineEnding(); + $usesCount = \count($uses); - for ($i = \count($uses) - 1; $i >= 0; --$i) { + for ($i = 0; $i < $usesCount; ++$i) { $index = $uses[$i]; $startIndex = $tokens->getTokenNotOfKindsSibling($index + 1, 1, [T_WHITESPACE]); @@ -492,7 +509,7 @@ private function getNewOrder(array $uses, Tokens $tokens): array $sortedGroups = []; foreach ($this->configuration['imports_order'] as $type) { - if (isset($groupedByTypes[$type]) && !empty($groupedByTypes[$type])) { + if (isset($groupedByTypes[$type]) && [] !== $groupedByTypes[$type]) { foreach ($groupedByTypes[$type] as $startIndex => $item) { $sortedGroups[$startIndex] = $item; } @@ -517,27 +534,9 @@ private function getNewOrder(array $uses, Tokens $tokens): array } /** - * @param array< - * int, - * array{ - * namespace: string, - * startIndex: int, - * endIndex: int, - * importType: string, - * group: bool, - * } - * > $indices + * @param array $indices * - * @return array< - * int, - * array{ - * namespace: string, - * startIndex: int, - * endIndex: int, - * importType: string, - * group: bool, - * } - * > + * @return array */ private function sortByAlgorithm(array $indices): array { @@ -549,4 +548,53 @@ private function sortByAlgorithm(array $indices): array return $indices; } + + /** + * @param array $usesOrder + */ + private function setNewOrder(Tokens $tokens, array $usesOrder): void + { + $mapStartToEnd = []; + + foreach ($usesOrder as $use) { + $mapStartToEnd[$use['startIndex']] = $use['endIndex']; + } + + // Now insert the new tokens, starting from the end + foreach (array_reverse($usesOrder, true) as $index => $use) { + $code = \sprintf( + 'getPrevMeaningfulToken($index); + if ($tokens[$prevIndex]->equals(',')) { + $numberOfInitialTokensToClear = 5; // clear `clearRange(0, $numberOfInitialTokensToClear - 1); + $declarationTokens->clearAt(\count($declarationTokens) - 1); // clear `;` + $declarationTokens->clearEmptyTokens(); + + $tokens->overrideRange($index, $mapStartToEnd[$index], $declarationTokens); + + if ($use['group']) { + // a group import must start with `use` and cannot be part of comma separated import list + $prev = $tokens->getPrevMeaningfulToken($index); + if ($tokens[$prev]->equals(',')) { + $tokens[$prev] = new Token(';'); + $tokens->insertAt($prev + 1, new Token([T_USE, 'use'])); + + if (!$tokens[$prev + 2]->isWhitespace()) { + $tokens->insertAt($prev + 2, new Token([T_WHITESPACE, ' '])); + } + } + } + } + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php index 9f8979fd..cf368a8b 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -33,12 +34,21 @@ * Fixer for rules defined in PSR2 ¶3. * * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * group_to_single_imports?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * group_to_single_imports: bool + * } */ final class SingleImportPerStatementFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -66,35 +76,28 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before MultilineWhitespaceBeforeSemicolonsFixer, NoLeadingImportSlashFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, NoUnusedImportsFixer, SpaceAfterSemicolonFixer. + * Must run before MultilineWhitespaceBeforeSemicolonsFixer, NoLeadingImportSlashFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, SpaceAfterSemicolonFixer. */ public function getPriority(): int { return 1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_USE); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); - $fixGroups = $this->configuration['group_to_single_imports']; foreach (array_reverse($tokensAnalyzer->getImportUseIndexes()) as $index) { $endIndex = $tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]); $groupClose = $tokens->getPrevMeaningfulToken($endIndex); if ($tokens[$groupClose]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_CLOSE)) { - if ($fixGroups) { + if (true === $this->configuration['group_to_single_imports']) { $this->fixGroupUse($tokens, $index, $endIndex); } } else { @@ -103,9 +106,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -116,6 +116,9 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } + /** + * @return array{string, ?int, int, string} + */ private function getGroupDeclaration(Tokens $tokens, int $index): array { $groupPrefix = ''; @@ -156,7 +159,7 @@ private function getGroupDeclaration(Tokens $tokens, int $index): array } /** - * @return string[] + * @return list */ private function getGroupStatements(Tokens $tokens, string $groupPrefix, int $groupOpenIndex, int $groupCloseIndex, string $comment): array { @@ -211,10 +214,6 @@ private function fixGroupUse(Tokens $tokens, int $index, int $endIndex): void [$groupPrefix, $groupOpenIndex, $groupCloseIndex, $comment] = $this->getGroupDeclaration($tokens, $index); $statements = $this->getGroupStatements($tokens, $groupPrefix, $groupOpenIndex, $groupCloseIndex, $comment); - if (\count($statements) < 2) { - return; - } - $tokens->clearRange($index, $groupCloseIndex); if ($tokens[$endIndex]->equals(';')) { $tokens->clearAt($endIndex); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php index 773f25bf..b8b97797 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php @@ -32,17 +32,11 @@ */ final class SingleLineAfterImportsFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_USE); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -86,9 +80,6 @@ public function getPriority(): int return -11; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $ending = $this->whitespacesConfig->getLineEnding(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php index cbf64c94..0e370f20 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php @@ -87,6 +87,6 @@ private function isNewLineToken(Tokens $tokens, int $index): bool return false; } - return (bool) Preg::match('/\R/', $this->computeNewLineContent($tokens, $index)); + return Preg::match('/\R/', $this->computeNewLineContent($tokens, $index)); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/NullOutput.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/InternalFixerInterface.php similarity index 67% rename from tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/NullOutput.php rename to tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/InternalFixerInterface.php index 38b6999e..cf843c80 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/NullOutput.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/InternalFixerInterface.php @@ -12,14 +12,9 @@ * with this source code in the file LICENSE. */ -namespace PhpCsFixer\Console\Output; +namespace PhpCsFixer\Fixer; /** * @internal */ -final class NullOutput implements ProcessOutputInterface -{ - public function printLegend(): void - { - } -} +interface InternalFixerInterface extends FixerInterface {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php new file mode 100644 index 00000000..b171e56b --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php @@ -0,0 +1,100 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\LanguageConstruct; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ExperimentalFixerInterface; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Dariusz Rumiński + */ +final class ClassKeywordFixer extends AbstractFixer implements ExperimentalFixerInterface +{ + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Converts FQCN strings to `*::class` keywords.', + [ + new CodeSample( + 'count() - 1; $index >= 0; --$index) { + $token = $tokens[$index]; + + if ($token->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { + $name = substr($token->getContent(), 1, -1); + $name = ltrim($name, '\\'); + $name = str_replace('\\\\', '\\', $name); + + if ($this->exists($name)) { + $substitution = Tokens::fromCode("clearRange(0, 2); + $substitution->clearAt($substitution->getSize() - 1); + $substitution->clearEmptyTokens(); + + $tokens->clearAt($index); + $tokens->insertAt($index, $substitution); + } + } + } + } + + private function exists(string $name): bool + { + if (class_exists($name) || interface_exists($name) || trait_exists($name)) { + $rc = new \ReflectionClass($name); + + return $rc->getName() === $name; + } + + return false; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php index 491aa89f..3caf9f1b 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php @@ -19,7 +19,6 @@ use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; @@ -33,13 +32,10 @@ final class ClassKeywordRemoveFixer extends AbstractFixer implements DeprecatedFixerInterface { /** - * @var string[] + * @var array */ private array $imports = []; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -57,9 +53,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function getSuccessorsNames(): array { return []; @@ -75,23 +68,15 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(CT::T_CLASS_CONSTANT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $namespacesAnalyzer = new NamespacesAnalyzer(); - $previousNamespaceScopeEndIndex = 0; - foreach ($namespacesAnalyzer->getDeclarations($tokens) as $declaration) { + foreach ($tokens->getNamespaceDeclarations() as $declaration) { $this->replaceClassKeywordsSection($tokens, '', $previousNamespaceScopeEndIndex, $declaration->getStartIndex()); $this->replaceClassKeywordsSection($tokens, $declaration->getFullName(), $declaration->getStartIndex(), $declaration->getScopeEndIndex()); $previousNamespaceScopeEndIndex = $declaration->getScopeEndIndex(); @@ -124,15 +109,11 @@ private function storeImports(Tokens $tokens, int $startIndex, int $endIndex): v if ($tokens[$index]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_OPEN)) { $groupEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_GROUP_IMPORT_BRACE, $index); $groupImports = array_map( - static function (string $import): string { - return trim($import); - }, + static fn (string $import): string => trim($import), explode(',', $tokens->generatePartialCode($index + 1, $groupEndIndex - 1)) ); foreach ($groupImports as $groupImport) { - $groupImportParts = array_map(static function (string $import): string { - return trim($import); - }, explode(' as ', $groupImport)); + $groupImportParts = array_map(static fn (string $import): string => trim($import), explode(' as ', $groupImport)); if (2 === \count($groupImportParts)) { $this->imports[$groupImportParts[1]] = $import.$groupImportParts[0]; } else { @@ -207,7 +188,7 @@ private function replaceClassKeyword(Tokens $tokens, string $namespacePrefix, in $classStringArray = explode('\\', $classString); $namespaceToTest = $classStringArray[0]; - if (0 === strcmp($namespaceToTest, substr($import, -\strlen($namespaceToTest)))) { + if (0 === ($namespaceToTest <=> substr($import, -\strlen($namespaceToTest)))) { $classImport = $import; break; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php index ce09c125..e84bcb9d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php @@ -23,9 +23,6 @@ final class CombineConsecutiveIssetsFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -37,24 +34,18 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before MultilineWhitespaceBeforeSemicolonsFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, NoSpacesInsideParenthesisFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer. + * Must run before MultilineWhitespaceBeforeSemicolonsFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, NoSpacesInsideParenthesisFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer, SpacesInsideParenthesesFixer. */ public function getPriority(): int { - return 3; + return 4; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_ISSET, T_BOOLEAN_AND]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokenCount = $tokens->count(); @@ -113,7 +104,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @param int[] $indices + * @param list $indices */ private function clearTokens(Tokens $tokens, array $indices): void { @@ -125,7 +116,7 @@ private function clearTokens(Tokens $tokens, array $indices): void /** * @param int $index of T_ISSET * - * @return int[] indices of meaningful tokens belonging to the isset statement + * @return list indices of meaningful tokens belonging to the isset statement */ private function getIssetInfo(Tokens $tokens, int $index): array { @@ -155,9 +146,9 @@ private function getIssetInfo(Tokens $tokens, int $index): array } /** - * @param int[] $indices + * @param list $indices * - * @return Token[] + * @return list */ private function getTokenClones(Tokens $tokens, array $indices): array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveUnsetsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveUnsetsFixer.php index 6a595b69..24f18958 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveUnsetsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveUnsetsFixer.php @@ -23,9 +23,6 @@ final class CombineConsecutiveUnsetsFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -45,17 +42,11 @@ public function getPriority(): int return 24; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_UNSET); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; $index >= 0; --$index) { @@ -101,7 +92,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @param int[] $indices + * @param list $indices */ private function clearOffsetTokens(Tokens $tokens, int $offset, array $indices): void { @@ -121,7 +112,7 @@ private function clearOffsetTokens(Tokens $tokens, int $offset, array $indices): * * Or the index to where the method looked for a call. * - * @return int|int[] + * @return array{int, int, int, int}|int */ private function getPreviousUnsetCall(Tokens $tokens, int $index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareEqualNormalizeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareEqualNormalizeFixer.php index 8e0d4da9..442ee723 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareEqualNormalizeFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareEqualNormalizeFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -27,27 +28,21 @@ /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * space?: 'none'|'single' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * space: 'none'|'single' + * } */ final class DeclareEqualNormalizeFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * @var string - */ - private $callback; - - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; - $this->callback = 'none' === $this->configuration['space'] ? 'removeWhitespaceAroundToken' : 'ensureWhitespaceAroundToken'; - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -69,20 +64,13 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DECLARE); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $callback = $this->callback; for ($index = 0, $count = $tokens->count(); $index < $count - 6; ++$index) { if (!$tokens[$index]->isGivenKind(T_DECLARE)) { continue; @@ -93,15 +81,16 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void for ($i = $closeParenthesisIndex; $i > $openParenthesisIndex; --$i) { if ($tokens[$i]->equals('=')) { - $this->{$callback}($tokens, $i); + if ('none' === $this->configuration['space']) { + $this->removeWhitespaceAroundToken($tokens, $i); + } else { + $this->ensureWhitespaceAroundToken($tokens, $i); + } } } } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DirConstantFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DirConstantFixer.php index 112101a3..a19368e0 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DirConstantFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DirConstantFixer.php @@ -26,9 +26,6 @@ */ final class DirConstantFixer extends AbstractFunctionReferenceFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -39,9 +36,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_STRING, T_FILE]); @@ -57,9 +51,6 @@ public function getPriority(): int return 40; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $currIndex = 0; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ErrorSuppressionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ErrorSuppressionFixer.php index 47de2a4c..551d8e33 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ErrorSuppressionFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ErrorSuppressionFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -29,9 +30,25 @@ /** * @author Jules Pietri * @author Kuba Werłos + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * mute_deprecation_error?: bool, + * noise_remaining_usages?: bool, + * noise_remaining_usages_exclude?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * mute_deprecation_error: bool, + * noise_remaining_usages: bool, + * noise_remaining_usages_exclude: list + * } */ final class ErrorSuppressionFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -47,9 +64,6 @@ final class ErrorSuppressionFixer extends AbstractFixer implements ConfigurableF */ public const OPTION_NOISE_REMAINING_USAGES_EXCLUDE = 'noise_remaining_usages_exclude'; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -73,25 +87,16 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -104,21 +109,16 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setDefault(false) ->getOption(), (new FixerOptionBuilder(self::OPTION_NOISE_REMAINING_USAGES_EXCLUDE, 'List of global functions to exclude from removing `@`.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setDefault([]) ->getOption(), ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionsAnalyzer = new FunctionsAnalyzer(); - $excludedFunctions = array_map(static function (string $function): string { - return strtolower($function); - }, $this->configuration[self::OPTION_NOISE_REMAINING_USAGES_EXCLUDE]); + $excludedFunctions = array_map(static fn (string $function): string => strtolower($function), $this->configuration[self::OPTION_NOISE_REMAINING_USAGES_EXCLUDE]); for ($index = $tokens->count() - 1; $index >= 0; --$index) { $token = $tokens[$index]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ExplicitIndirectVariableFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ExplicitIndirectVariableFixer.php index 25925fe1..7be05e43 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ExplicitIndirectVariableFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ExplicitIndirectVariableFixer.php @@ -27,39 +27,30 @@ */ final class ExplicitIndirectVariableFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Add curly braces to indirect variables to make them clear to understand. Requires PHP >= 7.0.', + 'Add curly braces to indirect variables to make them clear to understand.', [ new CodeSample( <<<'EOT' -$bar['baz']; -echo $foo->$callback($baz); + $bar['baz']; + echo $foo->$callback($baz); -EOT + EOT ), ] ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_VARIABLE); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; $index > 1; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/FunctionToConstantFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/FunctionToConstantFixer.php index 42d15028..157a013e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/FunctionToConstantFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/FunctionToConstantFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -28,15 +29,28 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * functions?: list<'get_called_class'|'get_class'|'get_class_this'|'php_sapi_name'|'phpversion'|'pi'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * functions: list<'get_called_class'|'get_class'|'get_class_this'|'php_sapi_name'|'phpversion'|'pi'> + * } + */ final class FunctionToConstantFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** - * @var array + * @var null|array> */ - private static $availableFunctions; + private static ?array $availableFunctions = null; /** - * @var array + * @var array> */ private array $functionsFixMap; @@ -49,7 +63,11 @@ public function __construct() new Token([T_DOUBLE_COLON, '::']), new Token([CT::T_CLASS_CONSTANT, 'class']), ], - 'get_class' => [new Token([T_CLASS_C, '__CLASS__'])], + 'get_class' => [ + new Token([T_STRING, 'self']), + new Token([T_DOUBLE_COLON, '::']), + new Token([CT::T_CLASS_CONSTANT, 'class']), + ], 'get_class_this' => [ new Token([T_STATIC, 'static']), new Token([T_DOUBLE_COLON, '::']), @@ -64,23 +82,6 @@ public function __construct() parent::__construct(); } - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->functionsFixMap = []; - - foreach ($this->configuration['functions'] as $key) { - $this->functionsFixMap[$key] = self::$availableFunctions[$key]; - } - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -102,33 +103,33 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before NativeFunctionCasingFixer, NoExtraBlankLinesFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer, SelfStaticAccessorFixer. - * Must run after NoSpacesAfterFunctionNameFixer, NoSpacesInsideParenthesisFixer. + * Must run before NativeConstantInvocationFixer, NativeFunctionCasingFixer, NoExtraBlankLinesFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer, SelfStaticAccessorFixer. + * Must run after NoSpacesAfterFunctionNameFixer, NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. */ public function getPriority(): int { - return 1; + return 2; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->functionsFixMap = []; + + foreach ($this->configuration['functions'] as $key) { + $this->functionsFixMap[$key] = self::$availableFunctions[$key]; + } + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionAnalyzer = new FunctionsAnalyzer(); @@ -149,16 +150,13 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $functionNames = array_keys(self::$availableFunctions); return new FixerConfigurationResolver([ (new FixerOptionBuilder('functions', 'List of function names to fix.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset($functionNames)]) ->setDefault([ 'get_called_class', @@ -173,7 +171,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn } /** - * @param Token[] $replacements + * @param list $replacements */ private function fixFunctionCallToConstant(Tokens $tokens, int $index, int $braceOpenIndex, int $braceCloseIndex, array $replacements): void { @@ -185,7 +183,10 @@ private function fixFunctionCallToConstant(Tokens $tokens, int $index, int $brac $tokens->clearTokenAndMergeSurroundingWhitespace($i); } - if ($replacements[0]->isGivenKind([T_CLASS_C, T_STATIC])) { + if ( + $replacements[0]->isGivenKind([T_CLASS_C, T_STATIC]) + || ($replacements[0]->isGivenKind(T_STRING) && 'self' === $replacements[0]->getContent()) + ) { $prevIndex = $tokens->getPrevMeaningfulToken($index); $prevToken = $tokens[$prevIndex]; if ($prevToken->isGivenKind(T_NS_SEPARATOR)) { @@ -197,6 +198,9 @@ private function fixFunctionCallToConstant(Tokens $tokens, int $index, int $brac $tokens->insertAt($index, $replacements); } + /** + * @return ?array{int, int, list} + */ private function getReplaceCandidate( Tokens $tokens, FunctionsAnalyzer $functionAnalyzer, @@ -234,6 +238,9 @@ private function getReplaceCandidate( return $this->getReplacementTokenClones($lowerContent, $braceOpenIndex, $braceCloseIndex); } + /** + * @return ?array{int, int, list} + */ private function fixGetClassCall( Tokens $tokens, FunctionsAnalyzer $functionAnalyzer, @@ -285,12 +292,15 @@ private function fixGetClassCall( return null; } + /** + * @return array{int, int, list} + */ private function getReplacementTokenClones(string $lowerContent, int $braceOpenIndex, int $braceCloseIndex): array { - $clones = []; - foreach ($this->functionsFixMap[$lowerContent] as $token) { - $clones[] = clone $token; - } + $clones = array_map( + static fn (Token $token): Token => clone $token, + $this->functionsFixMap[$lowerContent], + ); return [ $braceOpenIndex, diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/GetClassToClassKeywordFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/GetClassToClassKeywordFixer.php index 8e2ed7b0..d5ceb526 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/GetClassToClassKeywordFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/GetClassToClassKeywordFixer.php @@ -29,9 +29,6 @@ */ final class GetClassToClassKeywordFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -55,32 +52,23 @@ public function getDefinition(): FixerDefinitionInterface * {@inheritdoc} * * Must run before MultilineWhitespaceBeforeSemicolonsFixer. - * Must run after NoSpacesAfterFunctionNameFixer, NoSpacesInsideParenthesisFixer. + * Must run after NoSpacesAfterFunctionNameFixer, NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. */ public function getPriority(): int { return 1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return \PHP_VERSION_ID >= 8_00_00 && $tokens->isAllTokenKindsFound([T_STRING, T_VARIABLE]); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionsAnalyzer = new FunctionsAnalyzer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/IsNullFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/IsNullFixer.php index 673c558b..a99695d4 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/IsNullFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/IsNullFixer.php @@ -27,9 +27,6 @@ */ final class IsNullFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -52,25 +49,16 @@ public function getPriority(): int return 1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { static $sequenceNeeded = [[T_STRING, 'is_null'], '(']; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NoUnsetOnPropertyFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NoUnsetOnPropertyFixer.php index af7f65d6..c72a783a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NoUnsetOnPropertyFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NoUnsetOnPropertyFixer.php @@ -27,9 +27,6 @@ */ final class NoUnsetOnPropertyFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -43,17 +40,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_UNSET) @@ -93,7 +84,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @return array> + * @return list> */ private function getUnsetsInfo(Tokens $tokens, int $index): array { @@ -153,7 +144,7 @@ private function isProperty(Tokens $tokens, int $index, int $endIndex): bool } /** - * @param array> $unsetsInfo + * @param list> $unsetsInfo */ private function isAnyUnsetToTransform(array $unsetsInfo): bool { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NullableTypeDeclarationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NullableTypeDeclarationFixer.php new file mode 100644 index 00000000..708c17c8 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NullableTypeDeclarationFixer.php @@ -0,0 +1,348 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\LanguageConstruct; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\FixerDefinition\VersionSpecification; +use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; +use PhpCsFixer\Tokenizer\TokensAnalyzer; + +/** + * @author John Paul E. Balandan, CPA + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * syntax?: 'question_mark'|'union' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * syntax: 'question_mark'|'union' + * } + */ +final class NullableTypeDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + private const OPTION_SYNTAX_UNION = 'union'; + private const OPTION_SYNTAX_QUESTION_MARK = 'question_mark'; + + private int $candidateTokenKind; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Nullable single type declaration should be standardised using configured syntax.', + [ + new VersionSpecificCodeSample( + " self::OPTION_SYNTAX_UNION] + ), + new VersionSpecificCodeSample( + ' self::OPTION_SYNTAX_QUESTION_MARK] + ), + ] + ); + } + + public function isCandidate(Tokens $tokens): bool + { + return \PHP_VERSION_ID >= 8_00_00 && $tokens->isTokenKindFound($this->candidateTokenKind); + } + + /** + * {@inheritdoc} + * + * Must run before OrderedTypesFixer, TypesSpacesFixer. + * Must run after NullableTypeDeclarationForDefaultNullValueFixer. + */ + public function getPriority(): int + { + return 2; + } + + protected function configurePostNormalisation(): void + { + $this->candidateTokenKind = self::OPTION_SYNTAX_QUESTION_MARK === $this->configuration['syntax'] + ? CT::T_TYPE_ALTERNATION // `|` -> `?` + : CT::T_NULLABLE_TYPE; // `?` -> `|` + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('syntax', 'Whether to use question mark (`?`) or explicit `null` union for nullable type.')) + ->setAllowedValues([self::OPTION_SYNTAX_UNION, self::OPTION_SYNTAX_QUESTION_MARK]) + ->setDefault(self::OPTION_SYNTAX_QUESTION_MARK) + ->getOption(), + ]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $functionsAnalyzer = new FunctionsAnalyzer(); + + foreach (array_reverse($this->getElements($tokens), true) as $index => $type) { + if ('property' === $type) { + $this->normalizePropertyType($tokens, $index); + + continue; + } + + $this->normalizeMethodReturnType($functionsAnalyzer, $tokens, $index); + $this->normalizeMethodArgumentType($functionsAnalyzer, $tokens, $index); + } + } + + /** + * @return array + * + * @phpstan-return array + */ + private function getElements(Tokens $tokens): array + { + $tokensAnalyzer = new TokensAnalyzer($tokens); + + $elements = array_map( + static fn (array $element): string => 'method' === $element['type'] ? 'function' : $element['type'], + array_filter( + $tokensAnalyzer->getClassyElements(), + static fn (array $element): bool => \in_array($element['type'], ['method', 'property'], true) + ) + ); + + foreach ($tokens as $index => $token) { + if ( + $token->isGivenKind(T_FN) + || ($token->isGivenKind(T_FUNCTION) && !isset($elements[$index])) + ) { + $elements[$index] = 'function'; + } + } + + return $elements; + } + + private function collectTypeAnalysis(Tokens $tokens, int $startIndex, int $endIndex): ?TypeAnalysis + { + $type = ''; + $typeStartIndex = $tokens->getNextMeaningfulToken($startIndex); + $typeEndIndex = $typeStartIndex; + + for ($i = $typeStartIndex; $i < $endIndex; ++$i) { + if ($tokens[$i]->isWhitespace() || $tokens[$i]->isComment()) { + continue; + } + + $type .= $tokens[$i]->getContent(); + $typeEndIndex = $i; + } + + return '' !== $type ? new TypeAnalysis($type, $typeStartIndex, $typeEndIndex) : null; + } + + private function isTypeNormalizable(TypeAnalysis $typeAnalysis): bool + { + $type = $typeAnalysis->getName(); + + if ('null' === strtolower($type) || !$typeAnalysis->isNullable()) { + return false; + } + + if (str_contains($type, '&')) { + return false; // skip DNF types + } + + if (!str_contains($type, '|')) { + return true; + } + + return 1 === substr_count($type, '|') && Preg::match('/(?:\|null$|^null\|)/i', $type); + } + + private function normalizePropertyType(Tokens $tokens, int $index): void + { + $propertyEndIndex = $index; + $propertyModifiers = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_STATIC, T_VAR]; + + if (\defined('T_READONLY')) { + $propertyModifiers[] = T_READONLY; // @TODO: Drop condition when PHP 8.1+ is required + } + + do { + $index = $tokens->getPrevMeaningfulToken($index); + } while (!$tokens[$index]->isGivenKind($propertyModifiers)); + + $propertyType = $this->collectTypeAnalysis($tokens, $index, $propertyEndIndex); + + if (null === $propertyType || !$this->isTypeNormalizable($propertyType)) { + return; + } + + $this->normalizeNullableType($tokens, $propertyType); + } + + private function normalizeMethodArgumentType(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index): void + { + foreach (array_reverse($functionsAnalyzer->getFunctionArguments($tokens, $index), true) as $argumentInfo) { + $argumentType = $argumentInfo->getTypeAnalysis(); + + if (null === $argumentType || !$this->isTypeNormalizable($argumentType)) { + continue; + } + + $this->normalizeNullableType($tokens, $argumentType); + } + } + + private function normalizeMethodReturnType(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index): void + { + $returnType = $functionsAnalyzer->getFunctionReturnType($tokens, $index); + + if (null === $returnType || !$this->isTypeNormalizable($returnType)) { + return; + } + + $this->normalizeNullableType($tokens, $returnType); + } + + private function normalizeNullableType(Tokens $tokens, TypeAnalysis $typeAnalysis): void + { + $type = $typeAnalysis->getName(); + + if (!str_contains($type, '|') && !str_contains($type, '&')) { + $type = ($typeAnalysis->isNullable() ? '?' : '').$type; + } + + $isQuestionMarkSyntax = self::OPTION_SYNTAX_QUESTION_MARK === $this->configuration['syntax']; + + if ($isQuestionMarkSyntax) { + $normalizedType = $this->convertToNullableType($type); + $normalizedTypeAsString = implode('', $normalizedType); + } else { + $normalizedType = $this->convertToExplicitUnionType($type); + $normalizedTypeAsString = implode('|', $normalizedType); + } + + if ($normalizedTypeAsString === $type) { + return; // nothing to fix + } + + $tokens->overrideRange( + $typeAnalysis->getStartIndex(), + $typeAnalysis->getEndIndex(), + $this->createTypeDeclarationTokens($normalizedType, $isQuestionMarkSyntax) + ); + + $prevStartIndex = $typeAnalysis->getStartIndex() - 1; + if (!$tokens[$prevStartIndex]->isWhitespace() && !$tokens[$prevStartIndex]->equals('(')) { + $tokens->ensureWhitespaceAtIndex($prevStartIndex, 1, ' '); + } + } + + /** + * @return list + */ + private function convertToNullableType(string $type): array + { + if (str_starts_with($type, '?')) { + return [$type]; // no need to convert; already fixed + } + + return ['?', Preg::replace('/(?:\|null$|^null\|)/i', '', $type)]; + } + + /** + * @return list + */ + private function convertToExplicitUnionType(string $type): array + { + if (str_contains($type, '|')) { + return [$type]; // no need to convert; already fixed + } + + return ['null', substr($type, 1)]; + } + + /** + * @param list $types + * + * @return list + */ + private function createTypeDeclarationTokens(array $types, bool $isQuestionMarkSyntax): array + { + static $specialTypes = [ + '?' => CT::T_NULLABLE_TYPE, + 'array' => CT::T_ARRAY_TYPEHINT, + 'callable' => T_CALLABLE, + 'static' => T_STATIC, + ]; + + $count = \count($types); + $newTokens = []; + + foreach ($types as $index => $type) { + if (isset($specialTypes[strtolower($type)])) { + $newTokens[] = new Token([$specialTypes[strtolower($type)], $type]); + } else { + foreach (explode('\\', $type) as $nsIndex => $value) { + if (0 === $nsIndex && '' === $value) { + continue; + } + + if ($nsIndex > 0) { + $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); + } + + $newTokens[] = new Token([T_STRING, $value]); + } + } + + if ($index <= $count - 2 && !$isQuestionMarkSyntax) { + $newTokens[] = new Token([CT::T_TYPE_ALTERNATION, '|']); + } + } + + return $newTokens; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAfterConstructFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAfterConstructFixer.php index 5c125825..586c37c9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAfterConstructFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAfterConstructFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractProxyFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\DeprecatedFixerInterface; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; @@ -30,13 +31,25 @@ * @author Andreas Möller * * @deprecated + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * constructs?: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * constructs: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'> + * } */ final class SingleSpaceAfterConstructFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @var array */ - private static array $tokenMap = [ + private const TOKEN_MAP = [ 'abstract' => T_ABSTRACT, 'as' => T_AS, 'attribute' => CT::T_ATTRIBUTE_CLOSE, @@ -102,9 +115,6 @@ final class SingleSpaceAfterConstructFixer extends AbstractProxyFixer implements private SingleSpaceAroundConstructFixer $singleSpaceAroundConstructFixer; - /** - * {@inheritdoc} - */ public function __construct() { $this->singleSpaceAroundConstructFixer = new SingleSpaceAroundConstructFixer(); @@ -112,33 +122,11 @@ public function __construct() parent::__construct(); } - /** - * {@inheritdoc} - */ public function getSuccessorsNames(): array { return array_keys($this->proxyFixers); } - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->singleSpaceAroundConstructFixer->configure([ - 'constructs_contain_a_single_space' => [ - 'yield_from', - ], - 'constructs_preceded_by_a_single_space' => [], - 'constructs_followed_by_a_single_space' => $this->configuration['constructs'], - ]); - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -180,16 +168,24 @@ public function getDefinition(): FixerDefinitionInterface * {@inheritdoc} * * Must run before BracesFixer, FunctionDeclarationFixer. - * Must run after ModernizeStrposFixer. + * Must run after ArraySyntaxFixer, ModernizeStrposFixer. */ public function getPriority(): int { return parent::getPriority(); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->singleSpaceAroundConstructFixer->configure([ + 'constructs_contain_a_single_space' => [ + 'yield_from', + ], + 'constructs_preceded_by_a_single_space' => [], + 'constructs_followed_by_a_single_space' => $this->configuration['constructs'], + ]); + } + protected function createProxyFixers(): array { return [$this->singleSpaceAroundConstructFixer]; @@ -197,14 +193,14 @@ protected function createProxyFixers(): array protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { - $defaults = self::$tokenMap; + $defaults = self::TOKEN_MAP; $tokens = array_keys($defaults); unset($defaults['type_colon']); return new FixerConfigurationResolver([ (new FixerOptionBuilder('constructs', 'List of constructs which must be followed by a single space.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset($tokens)]) ->setDefault(array_keys($defaults)) ->getOption(), diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixer.php index 48704521..c76ef293 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -31,9 +32,25 @@ /** * @author Andreas Möller * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * constructs_contain_a_single_space?: list<'yield_from'>, + * constructs_followed_by_a_single_space?: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'>, + * constructs_preceded_by_a_single_space?: list<'as'|'else'|'elseif'|'use_lambda'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * constructs_contain_a_single_space: list<'yield_from'>, + * constructs_followed_by_a_single_space: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'>, + * constructs_preceded_by_a_single_space: list<'as'|'else'|'elseif'|'use_lambda'> + * } */ final class SingleSpaceAroundConstructFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @var array */ @@ -46,7 +63,9 @@ final class SingleSpaceAroundConstructFixer extends AbstractFixer implements Con * @var array */ private static array $tokenMapPrecededByASingleSpace = [ - // for now, only one case - but we are ready to extend it, when we learn about new cases to cover + 'as' => T_AS, + 'else' => T_ELSE, + 'elseif' => T_ELSEIF, 'use_lambda' => CT::T_USE_LAMBDA, ]; @@ -132,65 +151,6 @@ final class SingleSpaceAroundConstructFixer extends AbstractFixer implements Con */ private array $fixTokenMapPrecededByASingleSpace = []; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - if (\defined('T_MATCH')) { // @TODO: drop condition when PHP 8.0+ is required - self::$tokenMapFollowedByASingleSpace['match'] = T_MATCH; - } - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - self::$tokenMapFollowedByASingleSpace['readonly'] = T_READONLY; - } - - if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required - self::$tokenMapFollowedByASingleSpace['enum'] = T_ENUM; - } - - $this->fixTokenMapContainASingleSpace = []; - - foreach ($this->configuration['constructs_contain_a_single_space'] as $key) { - if (null !== self::$tokenMapContainASingleSpace[$key]) { - $this->fixTokenMapContainASingleSpace[$key] = self::$tokenMapContainASingleSpace[$key]; - } - } - - $this->fixTokenMapPrecededByASingleSpace = []; - - foreach ($this->configuration['constructs_preceded_by_a_single_space'] as $key) { - if (null !== self::$tokenMapPrecededByASingleSpace[$key]) { - $this->fixTokenMapPrecededByASingleSpace[$key] = self::$tokenMapPrecededByASingleSpace[$key]; - } - } - - $this->fixTokenMapFollowedByASingleSpace = []; - - foreach ($this->configuration['constructs_followed_by_a_single_space'] as $key) { - if (null !== self::$tokenMapFollowedByASingleSpace[$key]) { - $this->fixTokenMapFollowedByASingleSpace[$key] = self::$tokenMapFollowedByASingleSpace[$key]; - } - } - - if (isset($this->fixTokenMapFollowedByASingleSpace['public'])) { - $this->fixTokenMapFollowedByASingleSpace['constructor_public'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC; - } - - if (isset($this->fixTokenMapFollowedByASingleSpace['protected'])) { - $this->fixTokenMapFollowedByASingleSpace['constructor_protected'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED; - } - - if (isset($this->fixTokenMapFollowedByASingleSpace['private'])) { - $this->fixTokenMapFollowedByASingleSpace['constructor_private'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE; - } - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -262,30 +222,75 @@ function foo() { yield from baz(); } * {@inheritdoc} * * Must run before BracesFixer, FunctionDeclarationFixer. - * Must run after ModernizeStrposFixer. + * Must run after ArraySyntaxFixer, ModernizeStrposFixer. */ public function getPriority(): int { return 36; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - $tokenKinds = array_merge( - array_values($this->fixTokenMapContainASingleSpace), - array_values($this->fixTokenMapPrecededByASingleSpace), - array_values($this->fixTokenMapFollowedByASingleSpace), - ); + $tokenKinds = [ + ...array_values($this->fixTokenMapContainASingleSpace), + ...array_values($this->fixTokenMapPrecededByASingleSpace), + ...array_values($this->fixTokenMapFollowedByASingleSpace), + ]; return $tokens->isAnyTokenKindsFound($tokenKinds) && !$tokens->hasAlternativeSyntax(); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + if (\defined('T_MATCH')) { // @TODO: drop condition when PHP 8.0+ is required + self::$tokenMapFollowedByASingleSpace['match'] = T_MATCH; + } + + if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required + self::$tokenMapFollowedByASingleSpace['readonly'] = T_READONLY; + } + + if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required + self::$tokenMapFollowedByASingleSpace['enum'] = T_ENUM; + } + + $this->fixTokenMapContainASingleSpace = []; + + foreach ($this->configuration['constructs_contain_a_single_space'] as $key) { + if (null !== self::$tokenMapContainASingleSpace[$key]) { + $this->fixTokenMapContainASingleSpace[$key] = self::$tokenMapContainASingleSpace[$key]; + } + } + + $this->fixTokenMapPrecededByASingleSpace = []; + + foreach ($this->configuration['constructs_preceded_by_a_single_space'] as $key) { + if (null !== self::$tokenMapPrecededByASingleSpace[$key]) { + $this->fixTokenMapPrecededByASingleSpace[$key] = self::$tokenMapPrecededByASingleSpace[$key]; + } + } + + $this->fixTokenMapFollowedByASingleSpace = []; + + foreach ($this->configuration['constructs_followed_by_a_single_space'] as $key) { + if (null !== self::$tokenMapFollowedByASingleSpace[$key]) { + $this->fixTokenMapFollowedByASingleSpace[$key] = self::$tokenMapFollowedByASingleSpace[$key]; + } + } + + if (isset($this->fixTokenMapFollowedByASingleSpace['public'])) { + $this->fixTokenMapFollowedByASingleSpace['constructor_public'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC; + } + + if (isset($this->fixTokenMapFollowedByASingleSpace['protected'])) { + $this->fixTokenMapFollowedByASingleSpace['constructor_protected'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED; + } + + if (isset($this->fixTokenMapFollowedByASingleSpace['private'])) { + $this->fixTokenMapFollowedByASingleSpace['constructor_private'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE; + } + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokenKindsContainASingleSpace = array_values($this->fixTokenMapContainASingleSpace); @@ -311,7 +316,9 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void for ($index = $tokens->count() - 1; $index > 0; --$index) { if ($tokens[$index]->isGivenKind($tokenKindsPrecededByASingleSpace)) { - $tokens->ensureWhitespaceAtIndex($index - 1, 1, ' '); + if (!$this->isFullLineCommentBefore($tokens, $index)) { + $tokens->ensureWhitespaceAtIndex($index - 1, 1, ' '); + } } } @@ -332,7 +339,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void if ( $token->isGivenKind(T_STATIC) - && !$tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind([T_FUNCTION, T_VARIABLE]) + && !$tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind([T_FN, T_FUNCTION, T_NS_SEPARATOR, T_STRING, T_VARIABLE, CT::T_ARRAY_TYPEHINT, CT::T_NULLABLE_TYPE]) ) { continue; } @@ -357,7 +364,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - if ($token->isGivenKind(T_CONST) && $this->isMultilineConstant($tokens, $index)) { + if ($token->isGivenKind(T_CONST) && $this->isMultilineCommaSeparatedConstant($tokens, $index)) { continue; } @@ -367,6 +374,23 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } + if ($tokens[$whitespaceTokenIndex]->isWhitespace() && str_contains($tokens[$whitespaceTokenIndex]->getContent(), "\n")) { + $nextNextToken = $tokens[$whitespaceTokenIndex + 1]; + if (\defined('T_ATTRIBUTE')) { // @TODO: drop condition and else when PHP 8.0+ is required + if ($nextNextToken->isGivenKind(T_ATTRIBUTE)) { + continue; + } + } else { + if ($nextNextToken->isComment() && str_starts_with($nextNextToken->getContent(), '#[')) { + continue; + } + } + + if ($nextNextToken->isGivenKind(T_DOC_COMMENT)) { + continue; + } + } + $tokens->ensureWhitespaceAtIndex($whitespaceTokenIndex, 0, ' '); } } @@ -379,17 +403,17 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn return new FixerConfigurationResolver([ (new FixerOptionBuilder('constructs_contain_a_single_space', 'List of constructs which must contain a single space.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset($tokenMapContainASingleSpaceKeys)]) ->setDefault($tokenMapContainASingleSpaceKeys) ->getOption(), (new FixerOptionBuilder('constructs_preceded_by_a_single_space', 'List of constructs which must be preceded by a single space.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset($tokenMapPrecededByASingleSpaceKeys)]) - ->setDefault($tokenMapPrecededByASingleSpaceKeys) + ->setDefault(['as', 'use_lambda']) ->getOption(), (new FixerOptionBuilder('constructs_followed_by_a_single_space', 'List of constructs which must be followed by a single space.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset($tokenMapFollowedByASingleSpaceKeys)]) ->setDefault($tokenMapFollowedByASingleSpaceKeys) ->getOption(), @@ -452,11 +476,40 @@ private function isMultilineExtendsOrImplementsWithMoreThanOneAncestor(Tokens $t return false; } - private function isMultilineConstant(Tokens $tokens, int $index): bool + private function isMultilineCommaSeparatedConstant(Tokens $tokens, int $constantIndex): bool { - $scopeEnd = $tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]) - 1; - $hasMoreThanOneConstant = null !== $tokens->findSequence([new Token(',')], $index + 1, $scopeEnd); + $isMultilineConstant = false; + $hasMoreThanOneConstant = false; + $index = $constantIndex; + while (!$tokens[$index]->equalsAny([';', [T_CLOSE_TAG]])) { + ++$index; + + $isMultilineConstant = $isMultilineConstant || str_contains($tokens[$index]->getContent(), "\n"); + + if ($tokens[$index]->equals(',')) { + $hasMoreThanOneConstant = true; + } + + $blockType = Tokens::detectBlockType($tokens[$index]); + + if (null !== $blockType && true === $blockType['isStart']) { + $index = $tokens->findBlockEnd($blockType['type'], $index); + } + } + + return $hasMoreThanOneConstant && $isMultilineConstant; + } + + private function isFullLineCommentBefore(Tokens $tokens, int $index): bool + { + $beforeIndex = $tokens->getPrevNonWhitespace($index); + + if (!$tokens[$beforeIndex]->isGivenKind([T_COMMENT])) { + return false; + } + + $content = $tokens[$beforeIndex]->getContent(); - return $hasMoreThanOneConstant && $tokens->isPartialCodeMultiline($index, $scopeEnd); + return str_starts_with($content, '#') || str_starts_with($content, '//'); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ListNotation/ListSyntaxFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ListNotation/ListSyntaxFixer.php index bdd35d7c..ecc55cf7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ListNotation/ListSyntaxFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ListNotation/ListSyntaxFixer.php @@ -15,8 +15,8 @@ namespace PhpCsFixer\Fixer\ListNotation; use PhpCsFixer\AbstractFixer; -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -27,34 +27,27 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * syntax?: 'long'|'short' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * syntax: 'long'|'short' + * } + */ final class ListSyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * @var null|int - */ - private $candidateTokenKind; - - /** - * Use 'syntax' => 'long'|'short'. - * - * @param array $configuration - * - * @throws InvalidFixerConfigurationException - */ - public function configure(array $configuration): void - { - parent::configure($configuration); + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; - $this->candidateTokenKind = 'long' === $this->configuration['syntax'] ? CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN : T_LIST; - } + private ?int $candidateTokenKind = null; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'List (`array` destructuring) assignment should be declared using the configured syntax. Requires PHP >= 7.1.', + 'List (`array` destructuring) assignment should be declared using the configured syntax.', [ new CodeSample( "isTokenKindFound($this->candidateTokenKind); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->candidateTokenKind = 'long' === $this->configuration['syntax'] ? CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN : T_LIST; + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; 0 <= $index; --$index) { @@ -101,13 +93,10 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ - (new FixerOptionBuilder('syntax', 'Whether to use the `long` or `short` `list` syntax.')) + (new FixerOptionBuilder('syntax', 'Whether to use the `long` or `short` syntax for array destructuring.')) ->setAllowedValues(['long', 'short']) ->setDefault('short') ->getOption(), diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixer.php index 3ef36517..7c27bef6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixer.php @@ -30,9 +30,6 @@ */ final class BlankLineAfterNamespaceFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -54,17 +51,11 @@ public function getPriority(): int return -20; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_NAMESPACE); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $lastIndex = $tokens->count() - 1; @@ -103,7 +94,7 @@ private function getIndexToEnsureBlankLineAfter(Tokens $tokens, int $index): int $token = $tokens[$nextIndex]; if ($token->isWhitespace()) { - if (1 === Preg::match('/\R/', $token->getContent())) { + if (Preg::match('/\R/', $token->getContent())) { break; } $nextNextIndex = $tokens->getNonEmptySibling($nextIndex, 1); @@ -129,7 +120,7 @@ private function getTokenToInsert(string $currentContent, bool $isLastIndex): To $ending = $this->whitespacesConfig->getLineEnding(); $emptyLines = $isLastIndex ? $ending : $ending.$ending; - $indent = 1 === Preg::match('/^.*\R( *)$/s', $currentContent, $matches) ? $matches[1] : ''; + $indent = Preg::match('/^.*\R( *)$/s', $currentContent, $matches) ? $matches[1] : ''; return new Token([T_WHITESPACE, $emptyLines.$indent]); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLinesBeforeNamespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLinesBeforeNamespaceFixer.php new file mode 100644 index 00000000..2a3a9456 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLinesBeforeNamespaceFixer.php @@ -0,0 +1,242 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\NamespaceNotation; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; +use Symfony\Component\OptionsResolver\Options; + +/** + * @author Graham Campbell + * @author Greg Korba + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * max_line_breaks?: int, + * min_line_breaks?: int + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * max_line_breaks: int, + * min_line_breaks: int + * } + */ +final class BlankLinesBeforeNamespaceFixer extends AbstractFixer implements WhitespacesAwareFixerInterface, ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Controls blank lines before a namespace declaration.', + [ + new CodeSample(" 1]), + new CodeSample(" 2]), + new CodeSample(" 2]), + new CodeSample(" 0, 'max_line_breaks' => 0]), + ] + ); + } + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isTokenKindFound(T_NAMESPACE); + } + + /** + * {@inheritdoc} + * + * Must run after BlankLineAfterOpeningTagFixer, HeaderCommentFixer. + */ + public function getPriority(): int + { + return -31; + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('min_line_breaks', 'Minimum line breaks that should exist before namespace declaration.')) + ->setAllowedTypes(['int']) + ->setDefault(2) + ->setNormalizer(static function (Options $options, int $value): int { + if ($value < 0) { + throw new InvalidFixerConfigurationException( + (new self())->getName(), + 'Option `min_line_breaks` cannot be lower than 0.' + ); + } + + return $value; + }) + ->getOption(), + (new FixerOptionBuilder('max_line_breaks', 'Maximum line breaks that should exist before namespace declaration.')) + ->setAllowedTypes(['int']) + ->setDefault(2) + ->setNormalizer(static function (Options $options, int $value): int { + if ($value < 0) { + throw new InvalidFixerConfigurationException( + (new self())->getName(), + 'Option `max_line_breaks` cannot be lower than 0.' + ); + } + + if ($value < $options['min_line_breaks']) { + throw new InvalidFixerConfigurationException( + (new self())->getName(), + 'Option `max_line_breaks` cannot have lower value than `min_line_breaks`.' + ); + } + + return $value; + }) + ->getOption(), + ]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + for ($index = $tokens->count() - 1; $index >= 0; --$index) { + $token = $tokens[$index]; + + if ($token->isGivenKind(T_NAMESPACE)) { + $this->fixLinesBeforeNamespace( + $tokens, + $index, + $this->configuration['min_line_breaks'], + $this->configuration['max_line_breaks'] + ); + } + } + } + + /** + * Make sure # of line breaks prefixing namespace is within given range. + * + * @param int $expectedMin min. # of line breaks + * @param int $expectedMax max. # of line breaks + */ + protected function fixLinesBeforeNamespace(Tokens $tokens, int $index, int $expectedMin, int $expectedMax): void + { + // Let's determine the total numbers of new lines before the namespace + // and the opening token + $openingTokenIndex = null; + $precedingNewlines = 0; + $newlineInOpening = false; + $openingToken = null; + + for ($i = 1; $i <= 2; ++$i) { + if (isset($tokens[$index - $i])) { + $token = $tokens[$index - $i]; + + if ($token->isGivenKind(T_OPEN_TAG)) { + $openingToken = $token; + $openingTokenIndex = $index - $i; + $newlineInOpening = str_contains($token->getContent(), "\n"); + + if ($newlineInOpening) { + ++$precedingNewlines; + } + + break; + } + + if (false === $token->isGivenKind(T_WHITESPACE)) { + break; + } + + $precedingNewlines += substr_count($token->getContent(), "\n"); + } + } + + if ($precedingNewlines >= $expectedMin && $precedingNewlines <= $expectedMax) { + return; + } + + $previousIndex = $index - 1; + $previous = $tokens[$previousIndex]; + + if (0 === $expectedMax) { + // Remove all the previous new lines + if ($previous->isWhitespace()) { + $tokens->clearAt($previousIndex); + } + + // Remove new lines in opening token + if ($newlineInOpening) { + $tokens[$openingTokenIndex] = new Token([T_OPEN_TAG, rtrim($openingToken->getContent()).' ']); + } + + return; + } + + $lineEnding = $this->whitespacesConfig->getLineEnding(); + + // Allow only as many line breaks as configured: + // - keep as-is when current preceding line breaks are within configured range + // - use configured max line breaks if currently there is more preceding line breaks + // - use configured min line breaks if currently there is less preceding line breaks + $newlinesForWhitespaceToken = $precedingNewlines >= $expectedMax + ? $expectedMax + : max($precedingNewlines, $expectedMin); + + if (null !== $openingToken) { + // Use the configured line ending for the PHP opening tag + $content = rtrim($openingToken->getContent()); + $newContent = $content.$lineEnding; + $tokens[$openingTokenIndex] = new Token([T_OPEN_TAG, $newContent]); + --$newlinesForWhitespaceToken; + } + + if (0 === $newlinesForWhitespaceToken) { + // We have all the needed new lines in the opening tag + if ($previous->isWhitespace()) { + // Let's remove the previous token containing extra new lines + $tokens->clearAt($previousIndex); + } + + return; + } + + if ($previous->isWhitespace()) { + // Fix the previous whitespace token + $tokens[$previousIndex] = new Token( + [ + T_WHITESPACE, + str_repeat($lineEnding, $newlinesForWhitespaceToken).substr( + $previous->getContent(), + strrpos($previous->getContent(), "\n") + 1 + ), + ] + ); + } else { + // Add a new whitespace token + $tokens->insertAt($index, new Token([T_WHITESPACE, str_repeat($lineEnding, $newlinesForWhitespaceToken)])); + } + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/CleanNamespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/CleanNamespaceFixer.php index 94292985..aaa13cc0 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/CleanNamespaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/CleanNamespaceFixer.php @@ -14,23 +14,20 @@ namespace PhpCsFixer\Fixer\NamespaceNotation; -use PhpCsFixer\AbstractLinesBeforeNamespaceFixer; +use PhpCsFixer\AbstractFixer; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\FixerDefinition\VersionSpecification; use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Tokenizer\Tokens; -final class CleanNamespaceFixer extends AbstractLinesBeforeNamespaceFixer +final class CleanNamespaceFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { $samples = []; - foreach (['namespace Foo \\ Bar;', 'echo foo /* comment */ \\ bar();'] as $sample) { + foreach (['namespace Foo \ Bar;', 'echo foo /* comment */ \ bar();'] as $sample) { $samples[] = new VersionSpecificCodeSample( "isTokenKindFound(T_NS_SEPARATOR); @@ -53,7 +47,14 @@ public function isCandidate(Tokens $tokens): bool /** * {@inheritdoc} + * + * Must run before PhpUnitDataProviderReturnTypeFixer. */ + public function getPriority(): int + { + return 10; + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $count = $tokens->count(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixer.php index 96bc14b0..20dc38ea 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixer.php @@ -14,7 +14,9 @@ namespace PhpCsFixer\Fixer\NamespaceNotation; -use PhpCsFixer\AbstractLinesBeforeNamespaceFixer; +use PhpCsFixer\AbstractProxyFixer; +use PhpCsFixer\Fixer\DeprecatedFixerInterface; +use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; @@ -22,20 +24,21 @@ /** * @author Graham Campbell + * + * @deprecated Use `blank_lines_before_namespace` with config: ['min_line_breaks' => 0, 'max_line_breaks' => 1] */ -final class NoBlankLinesBeforeNamespaceFixer extends AbstractLinesBeforeNamespaceFixer +final class NoBlankLinesBeforeNamespaceFixer extends AbstractProxyFixer implements WhitespacesAwareFixerInterface, DeprecatedFixerInterface { - /** - * {@inheritdoc} - */ + public function getSuccessorsNames(): array + { + return array_keys($this->proxyFixers); + } + public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_NAMESPACE); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -58,19 +61,16 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + protected function createProxyFixers(): array { - for ($index = 0, $limit = $tokens->count(); $index < $limit; ++$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_NAMESPACE)) { - continue; - } + $blankLineBeforeNamespace = new BlankLinesBeforeNamespaceFixer(); + $blankLineBeforeNamespace->configure([ + 'min_line_breaks' => 0, + 'max_line_breaks' => 1, + ]); - $this->fixLinesBeforeNamespace($tokens, $index, 0, 1); - } + return [ + $blankLineBeforeNamespace, + ]; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoLeadingNamespaceWhitespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoLeadingNamespaceWhitespaceFixer.php index 6a038c8f..0d866d4a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoLeadingNamespaceWhitespaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoLeadingNamespaceWhitespaceFixer.php @@ -28,17 +28,11 @@ */ final class NoLeadingNamespaceWhitespaceFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_NAMESPACE); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -54,9 +48,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = \count($tokens) - 1; 0 <= $index; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixer.php index 667b1da5..67de6a24 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixer.php @@ -14,7 +14,9 @@ namespace PhpCsFixer\Fixer\NamespaceNotation; -use PhpCsFixer\AbstractLinesBeforeNamespaceFixer; +use PhpCsFixer\AbstractProxyFixer; +use PhpCsFixer\Fixer\DeprecatedFixerInterface; +use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; @@ -22,12 +24,16 @@ /** * @author Graham Campbell + * + * @deprecated Use `blank_lines_before_namespace` with config: ['min_line_breaks' => 2, 'max_line_breaks' => 2] (default) */ -final class SingleBlankLineBeforeNamespaceFixer extends AbstractLinesBeforeNamespaceFixer +final class SingleBlankLineBeforeNamespaceFixer extends AbstractProxyFixer implements WhitespacesAwareFixerInterface, DeprecatedFixerInterface { - /** - * {@inheritdoc} - */ + public function getSuccessorsNames(): array + { + return array_keys($this->proxyFixers); + } + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -39,9 +45,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_NAMESPACE); @@ -49,23 +52,24 @@ public function isCandidate(Tokens $tokens): bool /** * {@inheritdoc} + * + * Must run after HeaderCommentFixer. */ public function getPriority(): int { - return -21; + return parent::getPriority(); } - /** - * {@inheritdoc} - */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + protected function createProxyFixers(): array { - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; + $blankLineBeforeNamespace = new BlankLinesBeforeNamespaceFixer(); + $blankLineBeforeNamespace->configure([ + 'min_line_breaks' => 2, + 'max_line_breaks' => 2, + ]); - if ($token->isGivenKind(T_NAMESPACE)) { - $this->fixLinesBeforeNamespace($tokens, $index, 2, 2); - } - } + return [ + $blankLineBeforeNamespace, + ]; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Naming/NoHomoglyphNamesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Naming/NoHomoglyphNamesFixer.php index ca3e0721..8bd9fccb 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Naming/NoHomoglyphNamesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Naming/NoHomoglyphNamesFixer.php @@ -48,7 +48,7 @@ final class NoHomoglyphNamesFixer extends AbstractFixer * * @var array */ - private static array $replacements = [ + private const REPLACEMENTS = [ 'O' => '0', '0' => '0', 'I' => '1', @@ -193,9 +193,6 @@ final class NoHomoglyphNamesFixer extends AbstractFixer 'z' => 'z', ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -206,25 +203,16 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_VARIABLE, T_STRING]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -232,11 +220,9 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - $replaced = Preg::replaceCallback('/[^[:ascii:]]/u', static function (array $matches): string { - return self::$replacements[$matches[0]] ?? $matches[0]; - }, $token->getContent(), -1, $count); + $replaced = Preg::replaceCallback('/[^[:ascii:]]/u', static fn (array $matches): string => self::REPLACEMENTS[$matches[0]] ?? $matches[0], $token->getContent(), -1, $count); - if ($count) { + if ($count > 0) { $tokens->offsetSet($index, new Token([$token->getId(), $replaced])); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/AssignNullCoalescingToCoalesceEqualFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/AssignNullCoalescingToCoalesceEqualFixer.php index 12dda62f..b1c37606 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/AssignNullCoalescingToCoalesceEqualFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/AssignNullCoalescingToCoalesceEqualFixer.php @@ -14,29 +14,22 @@ namespace PhpCsFixer\Fixer\Operator; -use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\AbstractShortOperatorFixer; +use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\Analyzer\RangeAnalyzer; -use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; -final class AssignNullCoalescingToCoalesceEqualFixer extends AbstractFixer +final class AssignNullCoalescingToCoalesceEqualFixer extends AbstractShortOperatorFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'Use the null coalescing assignment operator `??=` where possible.', [ - new VersionSpecificCodeSample( + new CodeSample( "isTokenKindFound(T_COALESCE); } - /** - * {@inheritdoc} - */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 1; $index > 3; --$index) { - if (!$tokens[$index]->isGivenKind(T_COALESCE)) { - continue; - } - - // make sure after '??' does not contain '? :' - - $nextIndex = $tokens->getNextTokenOfKind($index, ['?', ';', [T_CLOSE_TAG]]); - - if ($tokens[$nextIndex]->equals('?')) { - continue; - } - - // get what is before '??' - - $beforeRange = $this->getBeforeOperator($tokens, $index); - $equalsIndex = $tokens->getPrevMeaningfulToken($beforeRange['start']); - - // make sure that before that is '=' - - if (!$tokens[$equalsIndex]->equals('=')) { - continue; - } - - // get what is before '=' - - $assignRange = $this->getBeforeOperator($tokens, $equalsIndex); - $beforeAssignmentIndex = $tokens->getPrevMeaningfulToken($assignRange['start']); - - // make sure that before that is ';', '{', '}', '(', ')' or 'equalsAny([';', '{', '}', ')', '(', [T_OPEN_TAG]])) { - continue; - } - - // make sure before and after are the same - - if (!RangeAnalyzer::rangeEqualsRange($tokens, $assignRange, $beforeRange)) { - continue; - } - - $tokens[$equalsIndex] = new Token([T_COALESCE_EQUAL, '??=']); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - $this->clearMeaningfulFromRange($tokens, $beforeRange); - - foreach ([$equalsIndex, $assignRange['end']] as $i) { - $i = $tokens->getNonEmptySibling($i, 1); - - if ($tokens[$i]->isWhitespace(" \t")) { - $tokens[$i] = new Token([T_WHITESPACE, ' ']); - } elseif (!$tokens[$i]->isWhitespace()) { - $tokens->insertAt($i, new Token([T_WHITESPACE, ' '])); - } - } - } - } - - /** - * @return array{start: int, end: int} - */ - private function getBeforeOperator(Tokens $tokens, int $index): array + protected function isOperatorTokenCandidate(Tokens $tokens, int $index): bool { - $controlStructureWithoutBracesTypes = [T_IF, T_ELSE, T_ELSEIF, T_FOR, T_FOREACH, T_WHILE]; - - $index = $tokens->getPrevMeaningfulToken($index); - $range = [ - 'start' => $index, - 'end' => $index, - ]; - - $previousIndex = $index; - $previousToken = $tokens[$previousIndex]; - - while ($previousToken->equalsAny([ - '$', - ']', - ')', - [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], - [CT::T_DYNAMIC_PROP_BRACE_CLOSE], - [CT::T_DYNAMIC_VAR_BRACE_CLOSE], - [T_NS_SEPARATOR], - [T_STRING], - [T_VARIABLE], - ])) { - $blockType = Tokens::detectBlockType($previousToken); - - if (null !== $blockType) { - $blockStart = $tokens->findBlockStart($blockType['type'], $previousIndex); - - if ($tokens[$previousIndex]->equals(')') && $tokens[$tokens->getPrevMeaningfulToken($blockStart)]->isGivenKind($controlStructureWithoutBracesTypes)) { - break; // we went too far back - } - - $previousIndex = $blockStart; - } - - $index = $previousIndex; - $previousIndex = $tokens->getPrevMeaningfulToken($previousIndex); - $previousToken = $tokens[$previousIndex]; + if (!$tokens[$index]->isGivenKind(T_COALESCE)) { + return false; } - if ($previousToken->isGivenKind(T_OBJECT_OPERATOR)) { - $index = $this->getBeforeOperator($tokens, $previousIndex)['start']; - } elseif ($previousToken->isGivenKind(T_PAAMAYIM_NEKUDOTAYIM)) { - $index = $this->getBeforeOperator($tokens, $tokens->getPrevMeaningfulToken($previousIndex))['start']; - } + // make sure after '??' does not contain '? :' - $range['start'] = $index; + $nextIndex = $tokens->getNextTokenOfKind($index, ['?', ';', [T_CLOSE_TAG]]); - return $range; + return !$tokens[$nextIndex]->equals('?'); } - /** - * @param array{start: int, end: int} $range - */ - private function clearMeaningfulFromRange(Tokens $tokens, array $range): void + protected function getReplacementToken(Token $token): Token { - // $range['end'] must be meaningful! - for ($i = $range['end']; $i >= $range['start']; $i = $tokens->getPrevMeaningfulToken($i)) { - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - } + return new Token([T_COALESCE_EQUAL, '??=']); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/BinaryOperatorSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/BinaryOperatorSpacesFixer.php index d17e1b61..5ecd14d3 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/BinaryOperatorSpacesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/BinaryOperatorSpacesFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -27,18 +28,38 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; +use PhpCsFixer\Utils; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * default?: 'align'|'align_by_scope'|'align_single_space'|'align_single_space_by_scope'|'align_single_space_minimal'|'align_single_space_minimal_by_scope'|'at_least_single_space'|'no_space'|'single_space'|null, + * operators?: array + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * default: 'align'|'align_by_scope'|'align_single_space'|'align_single_space_by_scope'|'align_single_space_minimal'|'align_single_space_minimal_by_scope'|'at_least_single_space'|'no_space'|'single_space'|null, + * operators: array + * } */ final class BinaryOperatorSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ public const SINGLE_SPACE = 'single_space'; + /** + * @internal + */ + public const AT_LEAST_SINGLE_SPACE = 'at_least_single_space'; + /** * @internal */ @@ -82,7 +103,7 @@ final class BinaryOperatorSpacesFixer extends AbstractFixer implements Configura public const ALIGN_PLACEHOLDER = "\x2 ALIGNABLE%d \x3"; /** - * @var string[] + * @var list */ private const SUPPORTED_OPERATORS = [ '=', @@ -129,6 +150,22 @@ final class BinaryOperatorSpacesFixer extends AbstractFixer implements Configura '??=', ]; + /** + * @var list + */ + private const ALLOWED_VALUES = [ + self::ALIGN, + self::ALIGN_BY_SCOPE, + self::ALIGN_SINGLE_SPACE, + self::ALIGN_SINGLE_SPACE_MINIMAL, + self::ALIGN_SINGLE_SPACE_BY_SCOPE, + self::ALIGN_SINGLE_SPACE_MINIMAL_BY_SCOPE, + self::SINGLE_SPACE, + self::NO_SPACE, + self::AT_LEAST_SINGLE_SPACE, + null, + ]; + /** * Keep track of the deepest level ever achieved while * parsing the code. Used later to replace alignment @@ -143,21 +180,6 @@ final class BinaryOperatorSpacesFixer extends AbstractFixer implements Configura */ private int $currentLevel; - /** - * @var array - */ - private static array $allowedValues = [ - self::ALIGN, - self::ALIGN_BY_SCOPE, - self::ALIGN_SINGLE_SPACE, - self::ALIGN_SINGLE_SPACE_MINIMAL, - self::ALIGN_SINGLE_SPACE_BY_SCOPE, - self::ALIGN_SINGLE_SPACE_MINIMAL_BY_SCOPE, - self::SINGLE_SPACE, - self::NO_SPACE, - null, - ]; - private TokensAnalyzer $tokensAnalyzer; /** @@ -170,19 +192,6 @@ final class BinaryOperatorSpacesFixer extends AbstractFixer implements Configura */ private array $operators = []; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->operators = $this->resolveOperatorsFromConfig(); - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -307,24 +316,23 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run after ArrayIndentationFixer, ArraySyntaxFixer, AssignNullCoalescingToCoalesceEqualFixer, ListSyntaxFixer, ModernizeStrposFixer, NoMultilineWhitespaceAroundDoubleArrowFixer, NoUnsetCastFixer, PowToExponentiationFixer, StandardizeNotEqualsFixer, StrictComparisonFixer. + * Must run after ArrayIndentationFixer, ArraySyntaxFixer, AssignNullCoalescingToCoalesceEqualFixer, ListSyntaxFixer, LongToShorthandOperatorFixer, ModernizeStrposFixer, NoMultilineWhitespaceAroundDoubleArrowFixer, NoUnsetCastFixer, PowToExponentiationFixer, StandardizeNotEqualsFixer, StrictComparisonFixer. */ public function getPriority(): int { return -32; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return true; } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->operators = $this->resolveOperatorsFromConfig(); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $this->tokensAnalyzer = new TokensAnalyzer($tokens); @@ -355,36 +363,36 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('default', 'Default fix strategy.')) ->setDefault(self::SINGLE_SPACE) - ->setAllowedValues(self::$allowedValues) + ->setAllowedValues(self::ALLOWED_VALUES) ->getOption(), - (new FixerOptionBuilder('operators', 'Dictionary of `binary operator` => `fix strategy` values that differ from the default strategy. Supported are: `'.implode('`, `', self::SUPPORTED_OPERATORS).'`.')) - ->setAllowedTypes(['array']) + (new FixerOptionBuilder('operators', 'Dictionary of `binary operator` => `fix strategy` values that differ from the default strategy. Supported are: '.Utils::naturalLanguageJoinWithBackticks(self::SUPPORTED_OPERATORS).'.')) + ->setAllowedTypes(['array']) ->setAllowedValues([static function (array $option): bool { foreach ($option as $operator => $value) { if (!\in_array($operator, self::SUPPORTED_OPERATORS, true)) { throw new InvalidOptionsException( - sprintf( - 'Unexpected "operators" key, expected any of "%s", got "%s".', - implode('", "', self::SUPPORTED_OPERATORS), + \sprintf( + 'Unexpected "operators" key, expected any of %s, got "%s".', + Utils::naturalLanguageJoin(self::SUPPORTED_OPERATORS), \gettype($operator).'#'.$operator ) ); } - if (!\in_array($value, self::$allowedValues, true)) { + if (!\in_array($value, self::ALLOWED_VALUES, true)) { throw new InvalidOptionsException( - sprintf( - 'Unexpected value for operator "%s", expected any of "%s", got "%s".', + \sprintf( + 'Unexpected value for operator "%s", expected any of %s, got "%s".', $operator, - implode('", "', self::$allowedValues), + Utils::naturalLanguageJoin(array_map( + static fn ($value): string => Utils::toString($value), + self::ALLOWED_VALUES + )), \is_object($value) ? \get_class($value) : (null === $value ? 'null' : \gettype($value).'#'.$value) ) ); @@ -412,6 +420,12 @@ private function fixWhiteSpaceAroundOperator(Tokens $tokens, int $index): void return; } + if (self::AT_LEAST_SINGLE_SPACE === $this->operators[$tokenContent]) { + $this->fixWhiteSpaceAroundOperatorToAtLeastSingleSpace($tokens, $index); + + return; + } + if (self::NO_SPACE === $this->operators[$tokenContent]) { $this->fixWhiteSpaceAroundOperatorToNoSpace($tokens, $index); @@ -466,6 +480,19 @@ private function fixWhiteSpaceAroundOperatorToSingleSpace(Tokens $tokens, int $i } } + private function fixWhiteSpaceAroundOperatorToAtLeastSingleSpace(Tokens $tokens, int $index): void + { + // fix white space after operator + if (!$tokens[$index + 1]->isWhitespace()) { + $tokens->insertAt($index + 1, new Token([T_WHITESPACE, ' '])); + } + + // fix white space before operator + if (!$tokens[$index - 1]->isWhitespace()) { + $tokens->insertAt($index, new Token([T_WHITESPACE, ' '])); + } + } + private function fixWhiteSpaceAroundOperatorToNoSpace(Tokens $tokens, int $index): void { // fix white space after operator @@ -604,7 +631,7 @@ private function injectAlignmentPlaceholdersDefault(Tokens $tokens, int $startAt && ('=' !== $content || !$this->isEqualPartOfDeclareStatement($tokens, $index)) && $newLineFoundSinceLastPlaceholder ) { - $tokens[$index] = new Token(sprintf(self::ALIGN_PLACEHOLDER, $this->currentLevel).$content); + $tokens[$index] = new Token(\sprintf(self::ALIGN_PLACEHOLDER, $this->currentLevel).$content); $newLineFoundSinceLastPlaceholder = false; continue; @@ -612,7 +639,7 @@ private function injectAlignmentPlaceholdersDefault(Tokens $tokens, int $startAt if ($token->isGivenKind(T_FN)) { $from = $tokens->getNextMeaningfulToken($index); - $until = $this->getLastTokenIndexOfFn($tokens, $index); + $until = $this->tokensAnalyzer->getLastTokenIndexOfArrowFunction($index); $this->injectAlignmentPlaceholders($tokens, $from + 1, $until - 1, $tokenContent); $index = $until; @@ -701,7 +728,7 @@ private function injectAlignmentPlaceholdersForArrow(Tokens $tokens, int $startA if ($token->isGivenKind(T_FN)) { $yieldFoundSinceLastPlaceholder = false; $from = $tokens->getNextMeaningfulToken($index); - $until = $this->getLastTokenIndexOfFn($tokens, $index); + $until = $this->tokensAnalyzer->getLastTokenIndexOfArrowFunction($index); $this->injectArrayAlignmentPlaceholders($tokens, $from + 1, $until - 1); $index = $until; @@ -737,7 +764,7 @@ private function injectAlignmentPlaceholdersForArrow(Tokens $tokens, int $startA ++$this->deepestLevel; ++$this->currentLevel; } - $tokenContent = sprintf(self::ALIGN_PLACEHOLDER, $this->currentLevel).$token->getContent(); + $tokenContent = \sprintf(self::ALIGN_PLACEHOLDER, $this->currentLevel).$token->getContent(); $nextToken = $tokens[$index + 1]; if (!$nextToken->isWhitespace()) { @@ -844,7 +871,7 @@ private function replacePlaceholders(Tokens $tokens, string $alignStrategy, stri $tmpCode = $tokens->generateCode(); for ($j = 0; $j <= $this->deepestLevel; ++$j) { - $placeholder = sprintf(self::ALIGN_PLACEHOLDER, $j); + $placeholder = \sprintf(self::ALIGN_PLACEHOLDER, $j); if (!str_contains($tmpCode, $placeholder)) { continue; @@ -890,7 +917,7 @@ private function replacePlaceholders(Tokens $tokens, string $alignStrategy, stri self::ALIGN_SINGLE_SPACE_MINIMAL === $alignStrategy || self::ALIGN_SINGLE_SPACE_MINIMAL_BY_SCOPE === $alignStrategy ) { - if (1 !== Preg::match('/^\h+$/', $before)) { // if indent; do not move, leave to other fixer + if (!Preg::match('/^\h+$/', $before)) { // if indent; do not move, leave to other fixer $before = rtrim($before).' '; } } @@ -921,33 +948,4 @@ private function replacePlaceholders(Tokens $tokens, string $alignStrategy, stri return $tmpCode; } - - private function getLastTokenIndexOfFn(Tokens $tokens, int $index): int - { - $index = $tokens->getNextTokenOfKind($index, [[T_DOUBLE_ARROW]]); - - while (true) { - $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->equalsAny([';', ',', [T_CLOSE_TAG]])) { - break; - } - - $blockType = Tokens::detectBlockType($tokens[$index]); - - if (null === $blockType) { - continue; - } - - if ($blockType['isStart']) { - $index = $tokens->findBlockEnd($blockType['type'], $index); - - continue; - } - - break; - } - - return $index; - } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ConcatSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ConcatSpaceFixer.php index 582c025a..c9d962c3 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ConcatSpaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ConcatSpaceFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -27,31 +28,21 @@ /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * spacing?: 'none'|'one' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * spacing: 'none'|'one' + * } */ final class ConcatSpaceFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * @var null|string - */ - private $fixCallback; + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - if ('one' === $this->configuration['spacing']) { - $this->fixCallback = 'fixConcatenationToSingleSpace'; - } else { - $this->fixCallback = 'fixConcatenationToNoSpace'; - } - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -82,30 +73,24 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound('.'); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $callBack = $this->fixCallback; for ($index = $tokens->count() - 1; $index >= 0; --$index) { if ($tokens[$index]->equals('.')) { - $this->{$callBack}($tokens, $index); + if ('one' === $this->configuration['spacing']) { + $this->fixConcatenationToSingleSpace($tokens, $index); + } else { + $this->fixConcatenationToNoSpace($tokens, $index); + } } } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -147,10 +132,17 @@ private function fixConcatenationToSingleSpace(Tokens $tokens, int $index): void */ private function fixWhiteSpaceAroundConcatToken(Tokens $tokens, int $index, int $offset): void { + if (-1 !== $offset && 1 !== $offset) { + throw new \InvalidArgumentException(\sprintf( + 'Expected `-1|1` for "$offset", got "%s"', + $offset + )); + } + $offsetIndex = $index + $offset; if (!$tokens[$offsetIndex]->isWhitespace()) { - $tokens->insertAt($index + (1 === $offset ?: 0), new Token([T_WHITESPACE, ' '])); + $tokens->insertAt($index + (1 === $offset ? 1 : 0), new Token([T_WHITESPACE, ' '])); return; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/IncrementStyleFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/IncrementStyleFixer.php index 52b8ad13..bc5de5bd 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/IncrementStyleFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/IncrementStyleFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\Fixer\AbstractIncrementOperatorFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -29,9 +30,21 @@ /** * @author Gregor Harlan * @author Kuba Werłos + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * style?: 'post'|'pre' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * style: 'post'|'pre' + * } */ final class IncrementStyleFixer extends AbstractIncrementOperatorFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -42,9 +55,6 @@ final class IncrementStyleFixer extends AbstractIncrementOperatorFixer implement */ public const STYLE_POST = 'post'; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -62,7 +72,7 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before NoSpacesInsideParenthesisFixer. + * Must run before NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. * Must run after StandardizeIncrementFixer. */ public function getPriority(): int @@ -70,17 +80,11 @@ public function getPriority(): int return 15; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_INC, T_DEC]); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -91,9 +95,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LogicalOperatorsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LogicalOperatorsFixer.php index 583e2a9a..5e05aac6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LogicalOperatorsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LogicalOperatorsFixer.php @@ -26,9 +26,6 @@ */ final class LogicalOperatorsFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -47,25 +44,16 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_LOGICAL_AND, T_LOGICAL_OR]); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LongToShorthandOperatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LongToShorthandOperatorFixer.php new file mode 100644 index 00000000..23099621 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LongToShorthandOperatorFixer.php @@ -0,0 +1,140 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Operator; + +use PhpCsFixer\Fixer\AbstractShortOperatorFixer; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; +use PhpCsFixer\Tokenizer\TokensAnalyzer; + +final class LongToShorthandOperatorFixer extends AbstractShortOperatorFixer +{ + /** + * @var array + */ + private const OPERATORS = [ + '+' => [T_PLUS_EQUAL, '+='], + '-' => [T_MINUS_EQUAL, '-='], + '*' => [T_MUL_EQUAL, '*='], + '/' => [T_DIV_EQUAL, '/='], + '&' => [T_AND_EQUAL, '&='], + '.' => [T_CONCAT_EQUAL, '.='], + '%' => [T_MOD_EQUAL, '%='], + '|' => [T_OR_EQUAL, '|='], + '^' => [T_XOR_EQUAL, '^='], + ]; + + /** + * @var list + */ + private array $operatorTypes; + + private TokensAnalyzer $tokensAnalyzer; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Shorthand notation for operators should be used if possible.', + [ + new CodeSample("isAnyTokenKindsFound(array_keys(self::OPERATORS))) { + return true; + } + + // @TODO: drop condition when PHP 8.0 is required and the "&" issues went away + return \defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG'); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $this->operatorTypes = array_keys(self::OPERATORS); + $this->tokensAnalyzer = new TokensAnalyzer($tokens); + + parent::applyFix($file, $tokens); + } + + protected function isOperatorTokenCandidate(Tokens $tokens, int $index): bool + { + if (!$tokens[$index]->equalsAny($this->operatorTypes)) { + return false; + } + + while (null !== $index) { + $index = $tokens->getNextMeaningfulToken($index); + $otherToken = $tokens[$index]; + + if ($otherToken->equalsAny([';', [T_CLOSE_TAG]])) { + return true; + } + + // fast precedence check + if ($otherToken->equals('?') || $otherToken->isGivenKind(T_INSTANCEOF)) { + return false; + } + + $blockType = Tokens::detectBlockType($otherToken); + + if (null !== $blockType) { + if (false === $blockType['isStart']) { + return true; + } + + $index = $tokens->findBlockEnd($blockType['type'], $index); + + continue; + } + + // precedence check + if ($this->tokensAnalyzer->isBinaryOperator($index)) { + return false; + } + } + + return false; // unreachable, but keeps SCA happy + } + + protected function getReplacementToken(Token $token): Token + { + \assert(isset(self::OPERATORS[$token->getContent()])); // for PHPStan + + return new Token(self::OPERATORS[$token->getContent()]); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithBracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithBracesFixer.php index 83cdccfb..865f6897 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithBracesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithBracesFixer.php @@ -14,41 +14,53 @@ namespace PhpCsFixer\Fixer\Operator; -use PhpCsFixer\AbstractFixer; +use PhpCsFixer\AbstractProxyFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\Fixer\DeprecatedFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; /** * @author Dariusz Rumiński + * + * @deprecated + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * anonymous_class?: bool, + * named_class?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * anonymous_class: bool, + * named_class: bool + * } */ -final class NewWithBracesFixer extends AbstractFixer implements ConfigurableFixerInterface +final class NewWithBracesFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + private NewWithParenthesesFixer $newWithParenthesesFixer; + + public function __construct() + { + $this->newWithParenthesesFixer = new NewWithParenthesesFixer(); + + parent::__construct(); + } + public function getDefinition(): FixerDefinitionInterface { + $fixerDefinition = $this->newWithParenthesesFixer->getDefinition(); + return new FixerDefinition( 'All instances created with `new` keyword must (not) be followed by braces.', - [ - new CodeSample(" false] - ), - new CodeSample( - " false] - ), - ] + $fixerDefinition->getCodeSamples(), + $fixerDefinition->getDescription(), + $fixerDefinition->getRiskyDescription(), ); } @@ -59,154 +71,33 @@ public function getDefinition(): FixerDefinitionInterface */ public function getPriority(): int { - return 37; + return $this->newWithParenthesesFixer->getPriority(); } - /** - * {@inheritdoc} - */ - public function isCandidate(Tokens $tokens): bool + public function getSuccessorsNames(): array { - return $tokens->isTokenKindFound(T_NEW); + return [ + $this->newWithParenthesesFixer->getName(), + ]; } /** - * {@inheritdoc} + * @param _AutogeneratedInputConfiguration $configuration */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + protected function configurePreNormalisation(array $configuration): void { - static $nextTokenKinds = null; - - if (null === $nextTokenKinds) { - $nextTokenKinds = [ - '?', - ';', - ',', - '(', - ')', - '[', - ']', - ':', - '<', - '>', - '+', - '-', - '*', - '/', - '%', - '&', - '^', - '|', - [T_CLASS], - [T_IS_SMALLER_OR_EQUAL], - [T_IS_GREATER_OR_EQUAL], - [T_IS_EQUAL], - [T_IS_NOT_EQUAL], - [T_IS_IDENTICAL], - [T_IS_NOT_IDENTICAL], - [T_CLOSE_TAG], - [T_LOGICAL_AND], - [T_LOGICAL_OR], - [T_LOGICAL_XOR], - [T_BOOLEAN_AND], - [T_BOOLEAN_OR], - [T_SL], - [T_SR], - [T_INSTANCEOF], - [T_AS], - [T_DOUBLE_ARROW], - [T_POW], - [T_SPACESHIP], - [CT::T_ARRAY_SQUARE_BRACE_OPEN], - [CT::T_ARRAY_SQUARE_BRACE_CLOSE], - [CT::T_BRACE_CLASS_INSTANTIATION_OPEN], - [CT::T_BRACE_CLASS_INSTANTIATION_CLOSE], - ]; - - if (\defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG')) { // @TODO: drop condition when PHP 8.1+ is required - $nextTokenKinds[] = [T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG]; - $nextTokenKinds[] = [T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG]; - } - } - - for ($index = $tokens->count() - 3; $index > 0; --$index) { - if (!$tokens[$index]->isGivenKind(T_NEW)) { - continue; - } - - $nextIndex = $tokens->getNextTokenOfKind($index, $nextTokenKinds); - - // new anonymous class definition - if ($tokens[$nextIndex]->isGivenKind(T_CLASS)) { - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - - if ($this->configuration['anonymous_class']) { - $this->ensureBracesAt($tokens, $nextIndex); - } else { - $this->ensureNoBracesAt($tokens, $nextIndex); - } - - continue; - } - - // entrance into array index syntax - need to look for exit - - while ($tokens[$nextIndex]->equals('[') || $tokens[$nextIndex]->isGivenKind(CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN)) { - $nextIndex = $tokens->findBlockEnd(Tokens::detectBlockType($tokens[$nextIndex])['type'], $nextIndex); - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - } - - if ($this->configuration['named_class']) { - $this->ensureBracesAt($tokens, $nextIndex); - } else { - $this->ensureNoBracesAt($tokens, $nextIndex); - } - } + $this->newWithParenthesesFixer->configure($configuration); } - /** - * {@inheritdoc} - */ - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + protected function createProxyFixers(): array { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('named_class', 'Whether named classes should be followed by parentheses.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('anonymous_class', 'Whether anonymous classes should be followed by parentheses.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - private function ensureBracesAt(Tokens $tokens, int $index): void - { - $token = $tokens[$index]; - - if (!$token->equals('(') && !$token->isObjectOperator()) { - $tokens->insertAt( - $tokens->getPrevMeaningfulToken($index) + 1, - [new Token('('), new Token(')')] - ); - } + return [ + $this->newWithParenthesesFixer, + ]; } - private function ensureNoBracesAt(Tokens $tokens, int $index): void + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { - if (!$tokens[$index]->equals('(')) { - return; - } - - $closingIndex = $tokens->getNextMeaningfulToken($index); - - // constructor has arguments - braces can not be removed - if (!$tokens[$closingIndex]->equals(')')) { - return; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($closingIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); + return $this->newWithParenthesesFixer->createConfigurationDefinition(); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithParenthesesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithParenthesesFixer.php new file mode 100644 index 00000000..f7f1af3e --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithParenthesesFixer.php @@ -0,0 +1,216 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Operator; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * anonymous_class?: bool, + * named_class?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * anonymous_class: bool, + * named_class: bool + * } + */ +final class NewWithParenthesesFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'All instances created with `new` keyword must (not) be followed by parentheses.', + [ + new CodeSample(" false] + ), + new CodeSample( + " false] + ), + ] + ); + } + + /** + * {@inheritdoc} + * + * Must run before ClassDefinitionFixer. + */ + public function getPriority(): int + { + return 37; + } + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isTokenKindFound(T_NEW); + } + + /** @protected */ + public function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('named_class', 'Whether named classes should be followed by parentheses.')) + ->setAllowedTypes(['bool']) + ->setDefault(true) + ->getOption(), + (new FixerOptionBuilder('anonymous_class', 'Whether anonymous classes should be followed by parentheses.')) + ->setAllowedTypes(['bool']) + ->setDefault(true) // @TODO 4.0: set to `false` + ->getOption(), + ]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + static $nextTokenKinds = null; + + if (null === $nextTokenKinds) { + $nextTokenKinds = [ + '?', + ';', + ',', + '(', + ')', + '[', + ']', + ':', + '<', + '>', + '+', + '-', + '*', + '/', + '%', + '&', + '^', + '|', + [T_CLASS], + [T_IS_SMALLER_OR_EQUAL], + [T_IS_GREATER_OR_EQUAL], + [T_IS_EQUAL], + [T_IS_NOT_EQUAL], + [T_IS_IDENTICAL], + [T_IS_NOT_IDENTICAL], + [T_CLOSE_TAG], + [T_LOGICAL_AND], + [T_LOGICAL_OR], + [T_LOGICAL_XOR], + [T_BOOLEAN_AND], + [T_BOOLEAN_OR], + [T_SL], + [T_SR], + [T_INSTANCEOF], + [T_AS], + [T_DOUBLE_ARROW], + [T_POW], + [T_SPACESHIP], + [CT::T_ARRAY_SQUARE_BRACE_OPEN], + [CT::T_ARRAY_SQUARE_BRACE_CLOSE], + [CT::T_BRACE_CLASS_INSTANTIATION_OPEN], + [CT::T_BRACE_CLASS_INSTANTIATION_CLOSE], + ]; + + if (\defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG')) { // @TODO: drop condition when PHP 8.1+ is required + $nextTokenKinds[] = [T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG]; + $nextTokenKinds[] = [T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG]; + } + } + + for ($index = $tokens->count() - 3; $index > 0; --$index) { + if (!$tokens[$index]->isGivenKind(T_NEW)) { + continue; + } + + $nextIndex = $tokens->getNextTokenOfKind($index, $nextTokenKinds); + + // new anonymous class definition + if ($tokens[$nextIndex]->isGivenKind(T_CLASS)) { + $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); + + if (true === $this->configuration['anonymous_class']) { + $this->ensureParenthesesAt($tokens, $nextIndex); + } else { + $this->ensureNoParenthesesAt($tokens, $nextIndex); + } + + continue; + } + + // entrance into array index syntax - need to look for exit + + while ($tokens[$nextIndex]->equals('[') || $tokens[$nextIndex]->isGivenKind(CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN)) { + $nextIndex = $tokens->findBlockEnd(Tokens::detectBlockType($tokens[$nextIndex])['type'], $nextIndex); + $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); + } + + if (true === $this->configuration['named_class']) { + $this->ensureParenthesesAt($tokens, $nextIndex); + } else { + $this->ensureNoParenthesesAt($tokens, $nextIndex); + } + } + } + + private function ensureParenthesesAt(Tokens $tokens, int $index): void + { + $token = $tokens[$index]; + + if (!$token->equals('(') && !$token->isObjectOperator()) { + $tokens->insertAt( + $tokens->getPrevMeaningfulToken($index) + 1, + [new Token('('), new Token(')')] + ); + } + } + + private function ensureNoParenthesesAt(Tokens $tokens, int $index): void + { + if (!$tokens[$index]->equals('(')) { + return; + } + + $closingIndex = $tokens->getNextMeaningfulToken($index); + + // constructor has arguments - parentheses can not be removed + if (!$tokens[$closingIndex]->equals(')')) { + return; + } + + $tokens->clearTokenAndMergeSurroundingWhitespace($closingIndex); + $tokens->clearTokenAndMergeSurroundingWhitespace($index); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoSpaceAroundDoubleColonFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoSpaceAroundDoubleColonFixer.php index ccb8071f..d897fff5 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoSpaceAroundDoubleColonFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoSpaceAroundDoubleColonFixer.php @@ -22,28 +22,29 @@ final class NoSpaceAroundDoubleColonFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'There must be no space around double colons (also called Scope Resolution Operator or Paamayim Nekudotayim).', - [new CodeSample("\nisTokenKindFound(T_DOUBLE_COLON); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = \count($tokens) - 2; $index > 1; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessConcatOperatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessConcatOperatorFixer.php index 95310ac5..f42196d2 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessConcatOperatorFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessConcatOperatorFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -26,15 +27,31 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +/** + * @phpstan-type _ConcatOperandType array{ + * start: int, + * end: int, + * type: self::STR_*, + * } + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * juggle_simple_strings?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * juggle_simple_strings: bool + * } + */ final class NoUselessConcatOperatorFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + private const STR_DOUBLE_QUOTE = 0; private const STR_DOUBLE_QUOTE_VAR = 1; private const STR_SINGLE_QUOTE = 2; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -50,24 +67,18 @@ public function getDefinition(): FixerDefinitionInterface * {@inheritdoc} * * Must run before DateTimeCreateFromFormatCallFixer, EregToPregFixer, PhpUnitDedicateAssertInternalTypeFixer, RegularCallableCallFixer, SetTypeToCastFixer. - * Must run after NoBinaryStringFixer, SingleQuoteFixer. + * Must run after ExplicitStringVariableFixer, NoBinaryStringFixer, SingleQuoteFixer. */ public function getPriority(): int { return 5; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound('.') && $tokens->isAnyTokenKindsFound([T_CONSTANT_ENCAPSED_STRING, '"']); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; $index > 0; --$index) { @@ -103,9 +114,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -117,16 +125,8 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn } /** - * @param array{ - * start: int, - * end: int, - * type: self::STR_*, - * } $firstOperand - * @param array{ - * start: int, - * end: int, - * type: self::STR_*, - * } $secondOperand + * @param _ConcatOperandType $firstOperand + * @param _ConcatOperandType $secondOperand */ private function fixConcatOperation(Tokens $tokens, array $firstOperand, int $concatIndex, array $secondOperand): void { @@ -136,13 +136,17 @@ private function fixConcatOperation(Tokens $tokens, array $firstOperand, int $co (self::STR_DOUBLE_QUOTE === $firstOperand['type'] && self::STR_DOUBLE_QUOTE === $secondOperand['type']) || (self::STR_SINGLE_QUOTE === $firstOperand['type'] && self::STR_SINGLE_QUOTE === $secondOperand['type']) ) { - $this->mergeContantEscapedStringOperands($tokens, $firstOperand, $concatIndex, $secondOperand); + $this->mergeConstantEscapedStringOperands($tokens, $firstOperand, $concatIndex, $secondOperand); return; } if (self::STR_DOUBLE_QUOTE_VAR === $firstOperand['type'] && self::STR_DOUBLE_QUOTE_VAR === $secondOperand['type']) { - $this->mergeContantEscapedStringVarOperands($tokens, $firstOperand, $concatIndex, $secondOperand); + if ($this->operandsCanNotBeMerged($tokens, $firstOperand, $secondOperand)) { + return; + } + + $this->mergeConstantEscapedStringVarOperands($tokens, $firstOperand, $concatIndex, $secondOperand); return; } @@ -158,12 +162,16 @@ private function fixConcatOperation(Tokens $tokens, array $firstOperand, int $co [$operand1, $operand2] = $operandPair; if (self::STR_DOUBLE_QUOTE_VAR === $operand1['type'] && self::STR_DOUBLE_QUOTE === $operand2['type']) { - $this->mergeContantEscapedStringVarOperands($tokens, $firstOperand, $concatIndex, $secondOperand); + if ($this->operandsCanNotBeMerged($tokens, $operand1, $operand2)) { + return; + } + + $this->mergeConstantEscapedStringVarOperands($tokens, $firstOperand, $concatIndex, $secondOperand); return; } - if (!$this->configuration['juggle_simple_strings']) { + if (false === $this->configuration['juggle_simple_strings']) { continue; } @@ -171,7 +179,7 @@ private function fixConcatOperation(Tokens $tokens, array $firstOperand, int $co $operantContent = $tokens[$operand2['start']]->getContent(); if ($this->isSimpleQuotedStringContent($operantContent)) { - $this->mergeContantEscapedStringOperands($tokens, $firstOperand, $concatIndex, $secondOperand); + $this->mergeConstantEscapedStringOperands($tokens, $firstOperand, $concatIndex, $secondOperand); } return; @@ -181,7 +189,11 @@ private function fixConcatOperation(Tokens $tokens, array $firstOperand, int $co $operantContent = $tokens[$operand2['start']]->getContent(); if ($this->isSimpleQuotedStringContent($operantContent)) { - $this->mergeContantEscapedStringVarOperands($tokens, $firstOperand, $concatIndex, $secondOperand); + if ($this->operandsCanNotBeMerged($tokens, $operand1, $operand2)) { + return; + } + + $this->mergeConstantEscapedStringVarOperands($tokens, $firstOperand, $concatIndex, $secondOperand); } return; @@ -192,11 +204,7 @@ private function fixConcatOperation(Tokens $tokens, array $firstOperand, int $co /** * @param -1|1 $direction * - * @return null|array{ - * start: int, - * end: int, - * type: self::STR_*, - * } + * @return null|_ConcatOperandType */ private function getConcatOperandType(Tokens $tokens, int $index, int $direction): ?array { @@ -228,18 +236,10 @@ private function getConcatOperandType(Tokens $tokens, int $index, int $direction } /** - * @param array{ - * start: int, - * end: int, - * type: self::STR_*, - * } $firstOperand - * @param array{ - * start: int, - * end: int, - * type: self::STR_*, - * } $secondOperand + * @param _ConcatOperandType $firstOperand + * @param _ConcatOperandType $secondOperand */ - private function mergeContantEscapedStringOperands( + private function mergeConstantEscapedStringOperands( Tokens $tokens, array $firstOperand, int $concatOperatorIndex, @@ -256,29 +256,21 @@ private function mergeContantEscapedStringOperands( ], ); - $tokens->clearTokenAndMergeSurroundingWhitespace($secondOperand['start']); $this->clearConcatAndAround($tokens, $concatOperatorIndex); + $tokens->clearTokenAndMergeSurroundingWhitespace($secondOperand['start']); } /** - * @param array{ - * start: int, - * end: int, - * type: self::STR_*, - * } $firstOperand - * @param array{ - * start: int, - * end: int, - * type: self::STR_*, - * } $secondOperand + * @param _ConcatOperandType $firstOperand + * @param _ConcatOperandType $secondOperand */ - private function mergeContantEscapedStringVarOperands( + private function mergeConstantEscapedStringVarOperands( Tokens $tokens, array $firstOperand, int $concatOperatorIndex, array $secondOperand ): void { - // build uo the new content + // build up the new content $newContent = ''; foreach ([$firstOperand, $secondOperand] as $operant) { @@ -335,7 +327,7 @@ private function clearConcatAndAround(Tokens $tokens, int $concatOperatorIndex): private function isSimpleQuotedStringContent(string $candidate): bool { - return 0 === Preg::match('#[\$"\'\\\]#', substr($candidate, 1, -1)); + return !Preg::match('#[\$"\'\\\]#', substr($candidate, 1, -1)); } private function containsLinebreak(Tokens $tokens, int $startIndex, int $endIndex): bool @@ -348,4 +340,36 @@ private function containsLinebreak(Tokens $tokens, int $startIndex, int $endInde return false; } + + /** + * @param _ConcatOperandType $firstOperand + * @param _ConcatOperandType $secondOperand + */ + private function operandsCanNotBeMerged(Tokens $tokens, array $firstOperand, array $secondOperand): bool + { + // If the first operand does not end with a variable, no variables would be broken by concatenation. + if (self::STR_DOUBLE_QUOTE_VAR !== $firstOperand['type']) { + return false; + } + if (!$tokens[$firstOperand['end'] - 1]->isGivenKind(T_VARIABLE)) { + return false; + } + + $allowedPatternsForSecondOperand = [ + '/^ .*/', // e.g. " foo", ' bar', " $baz" + '/^-(?!\>)/', // e.g. "-foo", '-bar', "-$baz" + ]; + + // If the first operand ends with a variable, the second operand should match one of the allowed patterns. + // Otherwise, the concatenation can break a variable in the first operand. + foreach ($allowedPatternsForSecondOperand as $allowedPattern) { + $secondOperandInnerContent = substr($tokens->generatePartialCode($secondOperand['start'], $secondOperand['end']), 1, -1); + + if (Preg::match($allowedPattern, $secondOperandInnerContent)) { + return false; + } + } + + return true; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessNullsafeOperatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessNullsafeOperatorFixer.php index d2267652..2754e152 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessNullsafeOperatorFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessNullsafeOperatorFixer.php @@ -24,13 +24,10 @@ final class NoUselessNullsafeOperatorFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'There should not be useless `null-safe-operators` `?->` used.', + 'There should not be useless Null-safe operator `?->` used.', [ new VersionSpecificCodeSample( '= 8_00_00 && $tokens->isAllTokenKindsFound([T_VARIABLE, T_NULLSAFE_OBJECT_OPERATOR]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; $index >= 0; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSpaceFixer.php index 83c5cf55..f40dcc22 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSpaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSpaceFixer.php @@ -26,9 +26,6 @@ */ final class NotOperatorWithSpaceFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -54,17 +51,11 @@ public function getPriority(): int return -10; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound('!'); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; $index >= 0; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSuccessorSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSuccessorSpaceFixer.php index 22901318..bf228b52 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSuccessorSpaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSuccessorSpaceFixer.php @@ -25,9 +25,6 @@ */ final class NotOperatorWithSuccessorSpaceFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -53,17 +50,11 @@ public function getPriority(): int return -10; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound('!'); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; $index >= 0; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixer.php index 71e4cd6b..fe6e7ac9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixer.php @@ -27,9 +27,6 @@ */ final class ObjectOperatorWithoutWhitespaceFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -38,17 +35,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(Token::getObjectOperatorKinds()); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { // [Structure] there should not be space before or after "->" or "?->" diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/OperatorLinebreakFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/OperatorLinebreakFixer.php index 668f9103..fdec2fb1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/OperatorLinebreakFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/OperatorLinebreakFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -24,30 +25,40 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; use PhpCsFixer\Tokenizer\Analyzer\AlternativeSyntaxAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\SwitchAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\ControlCaseStructuresAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\GotoLabelAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\ReferenceAnalyzer; +use PhpCsFixer\Tokenizer\Analyzer\SwitchAnalyzer; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; /** * @author Kuba Werłos + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * only_booleans?: bool, + * position?: 'beginning'|'end' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * only_booleans: bool, + * position: 'beginning'|'end' + * } */ final class OperatorLinebreakFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + private const BOOLEAN_OPERATORS = [[T_BOOLEAN_AND], [T_BOOLEAN_OR], [T_LOGICAL_AND], [T_LOGICAL_OR], [T_LOGICAL_XOR]]; private string $position = 'beginning'; /** - * @var array|string> + * @var list */ private array $operators = []; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -72,13 +83,13 @@ function foo() { ); } - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void + public function isCandidate(Tokens $tokens): bool { - parent::configure($configuration); + return true; + } + protected function configurePostNormalisation(): void + { $this->position = $this->configuration['position']; $this->operators = self::BOOLEAN_OPERATORS; @@ -87,17 +98,6 @@ public function configure(array $configuration): void } } - /** - * {@inheritdoc} - */ - public function isCandidate(Tokens $tokens): bool - { - return true; - } - - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -112,17 +112,12 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $referenceAnalyzer = new ReferenceAnalyzer(); $gotoLabelAnalyzer = new GotoLabelAnalyzer(); $alternativeSyntaxAnalyzer = new AlternativeSyntaxAnalyzer(); - $excludedIndices = $this->getExcludedIndices($tokens); - $index = $tokens->count(); while ($index > 1) { --$index; @@ -143,7 +138,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - if (\in_array($index, $excludedIndices, true)) { + if (SwitchAnalyzer::belongsToSwitch($tokens, $index)) { continue; } @@ -162,32 +157,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * Currently only colons from "switch". - * - * @return int[] - */ - private function getExcludedIndices(Tokens $tokens): array - { - $colonIndices = []; - - /** @var SwitchAnalysis $analysis */ - foreach (ControlCaseStructuresAnalyzer::findControlStructures($tokens, [T_SWITCH]) as $analysis) { - foreach ($analysis->getCases() as $case) { - $colonIndices[] = $case->getColonIndex(); - } - - $defaultAnalysis = $analysis->getDefaultAnalysis(); - - if (null !== $defaultAnalysis) { - $colonIndices[] = $defaultAnalysis->getColonIndex(); - } - } - - return $colonIndices; - } - - /** - * @param int[] $operatorIndices + * @param non-empty-list $operatorIndices */ private function fixOperatorLinebreak(Tokens $tokens, array $operatorIndices): void { @@ -219,7 +189,7 @@ private function fixOperatorLinebreak(Tokens $tokens, array $operatorIndices): v } /** - * @param int[] $operatorIndices + * @param non-empty-list $operatorIndices */ private function fixMoveToTheBeginning(Tokens $tokens, array $operatorIndices): void { @@ -230,7 +200,7 @@ private function fixMoveToTheBeginning(Tokens $tokens, array $operatorIndices): $nextIndex = $tokens->getNextMeaningfulToken(max($operatorIndices)); for ($i = $nextIndex - 1; $i > max($operatorIndices); --$i) { - if ($tokens[$i]->isWhitespace() && 1 === Preg::match('/\R/u', $tokens[$i]->getContent())) { + if ($tokens[$i]->isWhitespace() && Preg::match('/\R/u', $tokens[$i]->getContent())) { $isWhitespaceBefore = $tokens[$prevIndex]->isWhitespace(); $inserts = $this->getReplacementsAndClear($tokens, $operatorIndices, -1); if ($isWhitespaceBefore) { @@ -244,7 +214,7 @@ private function fixMoveToTheBeginning(Tokens $tokens, array $operatorIndices): } /** - * @param int[] $operatorIndices + * @param non-empty-list $operatorIndices */ private function fixMoveToTheEnd(Tokens $tokens, array $operatorIndices): void { @@ -255,7 +225,7 @@ private function fixMoveToTheEnd(Tokens $tokens, array $operatorIndices): void $nextIndex = $tokens->getNonEmptySibling(max($operatorIndices), 1); for ($i = $prevIndex + 1; $i < max($operatorIndices); ++$i) { - if ($tokens[$i]->isWhitespace() && 1 === Preg::match('/\R/u', $tokens[$i]->getContent())) { + if ($tokens[$i]->isWhitespace() && Preg::match('/\R/u', $tokens[$i]->getContent())) { $isWhitespaceAfter = $tokens[$nextIndex]->isWhitespace(); $inserts = $this->getReplacementsAndClear($tokens, $operatorIndices, 1); if ($isWhitespaceAfter) { @@ -269,9 +239,9 @@ private function fixMoveToTheEnd(Tokens $tokens, array $operatorIndices): void } /** - * @param int[] $indices + * @param list $indices * - * @return Token[] + * @return list */ private function getReplacementsAndClear(Tokens $tokens, array $indices, int $direction): array { @@ -302,6 +272,9 @@ private function isMultiline(Tokens $tokens, int $indexStart, int $indexEnd): bo return false; } + /** + * @return list + */ private static function getNonBooleanOperators(): array { return array_merge( diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeIncrementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeIncrementFixer.php index 023332a9..1aaae169 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeIncrementFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeIncrementFixer.php @@ -38,9 +38,6 @@ final class StandardizeIncrementFixer extends AbstractIncrementOperatorFixer [T_CLOSE_TAG], ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -56,23 +53,18 @@ public function getDefinition(): FixerDefinitionInterface * {@inheritdoc} * * Must run before IncrementStyleFixer. + * Must run after LongToShorthandOperatorFixer. */ public function getPriority(): int { return 16; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_PLUS_EQUAL, T_MINUS_EQUAL]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1; $index > 0; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeNotEqualsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeNotEqualsFixer.php index fe5a73e4..2dab6092 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeNotEqualsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeNotEqualsFixer.php @@ -26,9 +26,6 @@ */ final class StandardizeNotEqualsFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -47,17 +44,11 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_IS_NOT_EQUAL); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryOperatorSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryOperatorSpacesFixer.php index 0a0324bd..758c7939 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryOperatorSpacesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryOperatorSpacesFixer.php @@ -19,9 +19,8 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Tokenizer\Analyzer\AlternativeSyntaxAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\SwitchAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\ControlCaseStructuresAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\GotoLabelAnalyzer; +use PhpCsFixer\Tokenizer\Analyzer\SwitchAnalyzer; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; @@ -30,9 +29,6 @@ */ final class TernaryOperatorSpacesFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -48,33 +44,26 @@ public function getDefinition(): FixerDefinitionInterface */ public function getPriority(): int { - return 0; + return 1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound(['?', ':']); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $alternativeSyntaxAnalyzer = new AlternativeSyntaxAnalyzer(); $gotoLabelAnalyzer = new GotoLabelAnalyzer(); $ternaryOperatorIndices = []; - $excludedIndices = $this->getColonIndicesForSwitch($tokens); foreach ($tokens as $index => $token) { if (!$token->equalsAny(['?', ':'])) { continue; } - if (\in_array($index, $excludedIndices, true)) { + if (SwitchAnalyzer::belongsToSwitch($tokens, $index)) { continue; } @@ -123,29 +112,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * @return int[] - */ - private function getColonIndicesForSwitch(Tokens $tokens): array - { - $colonIndices = []; - - /** @var SwitchAnalysis $analysis */ - foreach (ControlCaseStructuresAnalyzer::findControlStructures($tokens, [T_SWITCH]) as $analysis) { - foreach ($analysis->getCases() as $case) { - $colonIndices[] = $case->getColonIndex(); - } - - $defaultAnalysis = $analysis->getDefaultAnalysis(); - - if (null !== $defaultAnalysis) { - $colonIndices[] = $defaultAnalysis->getColonIndex(); - } - } - - return $colonIndices; - } - private function ensureWhitespaceExistence(Tokens $tokens, int $index, bool $after): void { if ($tokens[$index]->isWhitespace()) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToElvisOperatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToElvisOperatorFixer.php index 2cd7e9b9..e1e85b37 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToElvisOperatorFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToElvisOperatorFixer.php @@ -56,9 +56,6 @@ final class TernaryToElvisOperatorFixer extends AbstractFixer [T_XOR_EQUAL], // ^= ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -83,32 +80,21 @@ public function getDefinition(): FixerDefinitionInterface */ public function getPriority(): int { - return 1; + return 2; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound('?'); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - $blockEdgeDefinitions = Tokens::getBlockEdgeDefinitions(); - for ($index = \count($tokens) - 5; $index > 1; --$index) { if (!$tokens[$index]->equals('?')) { continue; @@ -122,7 +108,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void // get and check what is before the `?` operator - $beforeOperator = $this->getBeforeOperator($tokens, $index, $blockEdgeDefinitions); + $beforeOperator = $this->getBeforeOperator($tokens, $index); if (null === $beforeOperator) { continue; // contains something we cannot fix because of priorities @@ -141,10 +127,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @return null|array{start: int, end: int} null if contains ++/-- operator + * @return ?array{start: int, end: int} null if contains ++/-- operator */ - private function getBeforeOperator(Tokens $tokens, int $index, array $blockEdgeDefinitions): ?array + private function getBeforeOperator(Tokens $tokens, int $index): ?array { + $blockEdgeDefinitions = Tokens::getBlockEdgeDefinitions(); $index = $tokens->getPrevMeaningfulToken($index); $before = ['end' => $index]; @@ -153,16 +140,17 @@ private function getBeforeOperator(Tokens $tokens, int $index, array $blockEdgeD return null; } - $blockType = Tokens::detectBlockType($tokens[$index]); + $detectedBlockType = Tokens::detectBlockType($tokens[$index]); - if (null === $blockType || $blockType['isStart']) { + if (null === $detectedBlockType || $detectedBlockType['isStart']) { $before['start'] = $index; $index = $tokens->getPrevMeaningfulToken($index); continue; } - $blockType = $blockEdgeDefinitions[$blockType['type']]; + /** @phpstan-ignore-next-line offsetAccess.notFound (we just detected block type, we know it's definition exists under given PHP runtime) */ + $blockType = $blockEdgeDefinitions[$detectedBlockType['type']]; $openCount = 1; do { @@ -202,7 +190,7 @@ private function getAfterOperator(Tokens $tokens, int $index): array $index = $tokens->getNextMeaningfulToken($index); $after = ['start' => $index]; - while (!$tokens[$index]->equals(':')) { + do { $blockType = Tokens::detectBlockType($tokens[$index]); if (null !== $blockType) { @@ -211,7 +199,7 @@ private function getAfterOperator(Tokens $tokens, int $index): array $after['end'] = $index; $index = $tokens->getNextMeaningfulToken($index); - } + } while (!$tokens[$index]->equals(':')); return $after; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToNullCoalescingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToNullCoalescingFixer.php index b5b5ea8c..e73c5861 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToNullCoalescingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToNullCoalescingFixer.php @@ -26,13 +26,10 @@ */ final class TernaryToNullCoalescingFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Use `null` coalescing operator `??` where possible. Requires PHP >= 7.0.', + 'Use `null` coalescing operator `??` where possible.', [ new CodeSample( "isTokenKindFound(T_ISSET); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $issetIndices = array_keys($tokens->findGivenKind(T_ISSET)); @@ -98,11 +89,17 @@ private function fixIsset(Tokens $tokens, int $index): void return; // some weird stuff inside the isset } + $issetCode = $issetTokens->generateCode(); + + if ('$this' === $issetCode) { + return; // null coalescing operator does not with $this + } + // search what is inside the middle argument of ternary operator $ternaryColonIndex = $tokens->getNextTokenOfKind($ternaryQuestionMarkIndex, [':']); $ternaryFirstOperandTokens = $this->getMeaningfulSequence($tokens, $ternaryQuestionMarkIndex, $ternaryColonIndex); - if ($issetTokens->generateCode() !== $ternaryFirstOperandTokens->generateCode()) { + if ($issetCode !== $ternaryFirstOperandTokens->generateCode()) { return; // regardless of non-meaningful tokens, the operands are different } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/UnaryOperatorSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/UnaryOperatorSpacesFixer.php index c1558d7e..42b977fe 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/UnaryOperatorSpacesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/UnaryOperatorSpacesFixer.php @@ -15,6 +15,11 @@ namespace PhpCsFixer\Fixer\Operator; use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; @@ -23,17 +28,41 @@ /** * @author Gregor Harlan + * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * only_dec_inc?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * only_dec_inc: bool + * } */ -final class UnaryOperatorSpacesFixer extends AbstractFixer +final class UnaryOperatorSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'Unary operators should be placed adjacent to their operands.', - [new CodeSample(" false] + ), + new CodeSample( + ' true] + ), + ] ); } @@ -47,22 +76,30 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return true; } - /** - * {@inheritdoc} - */ + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('only_dec_inc', 'Limit to increment and decrement operators.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + ]); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); for ($index = $tokens->count() - 1; $index >= 0; --$index) { + if (true === $this->configuration['only_dec_inc'] && !$tokens[$index]->isGivenKind([T_DEC, T_INC])) { + continue; + } + if ($tokensAnalyzer->isUnarySuccessorOperator($index)) { if (!$tokens[$tokens->getPrevNonWhitespace($index)]->isComment()) { $tokens->removeLeadingWhitespace($index); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/BlankLineAfterOpeningTagFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/BlankLineAfterOpeningTagFixer.php index f6f7ab18..849f3016 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/BlankLineAfterOpeningTagFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/BlankLineAfterOpeningTagFixer.php @@ -27,9 +27,6 @@ */ final class BlankLineAfterOpeningTagFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -41,7 +38,7 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before NoBlankLinesBeforeNamespaceFixer. + * Must run before BlankLinesBeforeNamespaceFixer, NoBlankLinesBeforeNamespaceFixer. * Must run after DeclareStrictTypesFixer. */ public function getPriority(): int @@ -49,31 +46,18 @@ public function getPriority(): int return 1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - return $tokens->isTokenKindFound(T_OPEN_TAG); + return $tokens->isMonolithicPhp() && !$tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $lineEnding = $this->whitespacesConfig->getLineEnding(); - // ignore files with short open tag and ignore non-monolithic files - if (!$tokens[0]->isGivenKind(T_OPEN_TAG) || !$tokens->isMonolithicPhp()) { - return; - } - $newlineFound = false; - - /** @var Token $token */ foreach ($tokens as $token) { - if ($token->isWhitespace() && str_contains($token->getContent(), "\n")) { + if (($token->isWhitespace() || $token->isGivenKind(T_OPEN_TAG)) && str_contains($token->getContent(), "\n")) { $newlineFound = true; break; @@ -85,18 +69,24 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void return; } - $token = $tokens[0]; + $openTagIndex = $tokens[0]->isGivenKind(T_INLINE_HTML) ? 1 : 0; + $token = $tokens[$openTagIndex]; if (!str_contains($token->getContent(), "\n")) { - $tokens[0] = new Token([$token->getId(), rtrim($token->getContent()).$lineEnding]); + $tokens[$openTagIndex] = new Token([$token->getId(), rtrim($token->getContent()).$lineEnding]); + } + + $newLineIndex = $openTagIndex + 1; + if (!$tokens->offsetExists($newLineIndex)) { + return; } - if (!str_contains($tokens[1]->getContent(), "\n")) { - if ($tokens[1]->isWhitespace()) { - $tokens[1] = new Token([T_WHITESPACE, $lineEnding.$tokens[1]->getContent()]); - } else { - $tokens->insertAt(1, new Token([T_WHITESPACE, $lineEnding])); + if ($tokens[$newLineIndex]->isWhitespace()) { + if (!str_contains($tokens[$newLineIndex]->getContent(), "\n")) { + $tokens[$newLineIndex] = new Token([T_WHITESPACE, $lineEnding.$tokens[$newLineIndex]->getContent()]); } + } else { + $tokens->insertAt($newLineIndex, new Token([T_WHITESPACE, $lineEnding])); } } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/EchoTagSyntaxFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/EchoTagSyntaxFixer.php index 81018c43..2953c35d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/EchoTagSyntaxFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/EchoTagSyntaxFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -27,9 +28,25 @@ /** * @author Michele Locati + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * format?: 'long'|'short', + * long_function?: 'echo'|'print', + * shorten_simple_statements_only?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * format: 'long'|'short', + * long_function: 'echo'|'print', + * shorten_simple_statements_only: bool + * } */ final class EchoTagSyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** @internal */ public const OPTION_FORMAT = 'format'; @@ -61,18 +78,15 @@ final class EchoTagSyntaxFixer extends AbstractFixer implements ConfigurableFixe self::LONG_FUNCTION_PRINT, ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { $sample = <<<'EOT' - - - - + + + + -EOT; + EOT; return new FixerDefinition( 'Replaces short-echo `configuration[self::OPTION_FORMAT]) { @@ -109,9 +120,6 @@ public function isCandidate(Tokens $tokens): bool return $tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -130,9 +138,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { if (self::FORMAT_SHORT === $this->configuration[self::OPTION_FORMAT]) { @@ -238,7 +243,7 @@ private function isComplexCode(Tokens $tokens, int $index): bool /** * Builds the list of tokens that replace a long echo sequence. * - * @return Token[] + * @return list */ private function buildLongToShortTokens(Tokens $tokens, int $openTagIndex, int $echoTagIndex): array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/FullOpeningTagFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/FullOpeningTagFixer.php index 2fc80bc5..bf6c1313 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/FullOpeningTagFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/FullOpeningTagFixer.php @@ -29,9 +29,6 @@ */ final class FullOpeningTagFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -47,26 +44,17 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function getPriority(): int { // must run before all Token-based fixers return 98; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $content = $tokens->generateCode(); @@ -74,7 +62,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void // replace all isTokenKindFound(T_OPEN_TAG); + return $tokens->isMonolithicPhp() && !$tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - // ignore files with short open tag and ignore non-monolithic files - if (!$tokens[0]->isGivenKind(T_OPEN_TAG) || !$tokens->isMonolithicPhp()) { - return; - } + $openTagIndex = $tokens[0]->isGivenKind(T_INLINE_HTML) ? 1 : 0; // ignore if linebreak already present - if (str_contains($tokens[0]->getContent(), "\n")) { + if (str_contains($tokens[$openTagIndex]->getContent(), "\n")) { return; } $newlineFound = false; foreach ($tokens as $token) { - if ($token->isWhitespace() && str_contains($token->getContent(), "\n")) { + if (($token->isWhitespace() || $token->isGivenKind(T_OPEN_TAG)) && str_contains($token->getContent(), "\n")) { $newlineFound = true; break; @@ -75,6 +63,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void return; } - $tokens[0] = new Token([T_OPEN_TAG, rtrim($tokens[0]->getContent()).$this->whitespacesConfig->getLineEnding()]); + $tokens[$openTagIndex] = new Token([T_OPEN_TAG, rtrim($tokens[$openTagIndex]->getContent()).$this->whitespacesConfig->getLineEnding()]); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/NoClosingTagFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/NoClosingTagFixer.php index ff1e00be..14c40c03 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/NoClosingTagFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/NoClosingTagFixer.php @@ -28,9 +28,6 @@ */ final class NoClosingTagFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -39,25 +36,15 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - return $tokens->isTokenKindFound(T_CLOSE_TAG); + return \count($tokens) >= 2 && $tokens->isMonolithicPhp() && $tokens->isTokenKindFound(T_CLOSE_TAG); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - if (\count($tokens) < 2 || !$tokens->isMonolithicPhp() || !$tokens->isTokenKindFound(T_CLOSE_TAG)) { - return; - } - $closeTags = $tokens->findGivenKind(T_CLOSE_TAG); - $index = key($closeTags); + $index = array_key_first($closeTags); if (isset($tokens[$index - 1]) && $tokens[$index - 1]->isWhitespace()) { $tokens->clearAt($index - 1); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAssertNewNamesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAssertNewNamesFixer.php new file mode 100644 index 00000000..71f02b5d --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAssertNewNamesFixer.php @@ -0,0 +1,107 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\PhpUnit; + +use PhpCsFixer\Fixer\AbstractPhpUnitFixer; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Krzysztof Ciszewski + */ +final class PhpUnitAssertNewNamesFixer extends AbstractPhpUnitFixer +{ + public function isRisky(): bool + { + return true; + } + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Rename deprecated PHPUnit assertions like `assertFileNotExists` to new methods like `assertFileDoesNotExist`.', + [ + new CodeSample( + 'assertFileNotExists("test.php"); + $this->assertNotIsWritable("path.php"); + } +} +' + ), + ], + null, + 'Fixer could be risky if one is overriding PHPUnit\'s native methods.' + ); + } + + /** + * {@inheritdoc} + * + * Must run after PhpUnitDedicateAssertFixer. + */ + public function getPriority(): int + { + return -10; + } + + protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void + { + foreach ($this->getPreviousAssertCall($tokens, $startIndex, $endIndex) as $assertCall) { + $this->fixAssertNewNames($tokens, $assertCall); + } + } + + /** + * @param array{ + * index: int, + * loweredName: string, + * openBraceIndex: int, + * closeBraceIndex: int, + * } $assertCall + */ + private function fixAssertNewNames(Tokens $tokens, array $assertCall): void + { + $replacements = [ + 'assertnotisreadable' => 'assertIsNotReadable', + 'assertnotiswritable' => 'assertIsNotWritable', + 'assertdirectorynotexists' => 'assertDirectoryDoesNotExist', + 'assertfilenotexists' => 'assertFileDoesNotExist', + 'assertdirectorynotisreadable' => 'assertDirectoryIsNotReadable', + 'assertdirectorynotiswritable' => 'assertDirectoryIsNotWriteable', + 'assertfilenotisreadable' => 'assertFileIsNotReadable', + 'assertfilenotiswritable' => 'assertFileIsNotWriteable', + 'assertregexp' => 'assertMatchesRegularExpression', + 'assertnotregexp' => 'assertDoesNotMatchRegularExpression', + ]; + $replacement = $replacements[$assertCall['loweredName']] ?? null; + + if (null === $replacement) { + return; + } + + $tokens[$assertCall['index']] = new Token([ + T_STRING, + $replacement, + ]); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAttributesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAttributesFixer.php new file mode 100644 index 00000000..49b045b7 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAttributesFixer.php @@ -0,0 +1,596 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\PhpUnit; + +use PhpCsFixer\DocBlock\Annotation; +use PhpCsFixer\DocBlock\DocBlock; +use PhpCsFixer\Fixer\AbstractPhpUnitFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\FixerDefinition\VersionSpecification; +use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Processor\ImportProcessor; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Kuba Werłos + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * keep_annotations?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * keep_annotations: bool + * } + */ +final class PhpUnitAttributesFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + /** @var array */ + private array $fixingMap; + + public function __construct() + { + parent::__construct(); + $this->prepareFixingMap(); + } + + public function getDefinition(): FixerDefinitionInterface + { + $codeSample = <<<'PHP' + true]), + ], + ); + } + + public function isCandidate(Tokens $tokens): bool + { + return \PHP_VERSION_ID >= 8_00_00 && parent::isCandidate($tokens); + } + + /** + * {@inheritdoc} + * + * Must run before FullyQualifiedStrictTypesFixer, PhpdocSeparationFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer. + * Must run after PhpUnitDataProviderNameFixer, PhpUnitDataProviderReturnTypeFixer, PhpUnitDataProviderStaticFixer. + */ + public function getPriority(): int + { + return 8; + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('keep_annotations', 'Whether to keep annotations or not. This may be helpful for projects that support PHP before version 8 or PHPUnit before version 10.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + ]); + } + + protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void + { + $classIndex = $tokens->getPrevTokenOfKind($startIndex, [[T_CLASS]]); + $docBlockIndex = $this->getDocBlockIndex($tokens, $classIndex); + if ($tokens[$docBlockIndex]->isGivenKind(T_DOC_COMMENT)) { + $startIndex = $docBlockIndex; + } + + for ($index = $endIndex; $index >= $startIndex; --$index) { + if (!$tokens[$index]->isGivenKind(T_DOC_COMMENT)) { + continue; + } + + $targetIndex = $tokens->getTokenNotOfKindSibling( + $index, + 1, + [[T_ABSTRACT], [T_COMMENT], [T_FINAL], [T_FUNCTION], [T_PRIVATE], [T_PROTECTED], [T_PUBLIC], [T_STATIC], [T_WHITESPACE]], + ); + $annotationScope = $tokens[$targetIndex]->isGivenKind(T_CLASS) ? 'class' : 'method'; + + $docBlock = new DocBlock($tokens[$index]->getContent()); + + $presentAttributes = []; + foreach (array_reverse($docBlock->getAnnotations()) as $annotation) { + $annotationName = $annotation->getTag()->getName(); + + if (!isset($this->fixingMap[$annotationName])) { + continue; + } + if (!self::shouldBeFixed($annotationName, $annotationScope)) { + continue; + } + + /** @phpstan-ignore-next-line */ + $tokensToInsert = self::{$this->fixingMap[$annotationName]}($tokens, $index, $annotation); + + $presentAttributes[$annotationName] ??= self::isAttributeAlreadyPresent($tokens, $index, $tokensToInsert); + + if ($presentAttributes[$annotationName]) { + continue; + } + + if ([] === $tokensToInsert) { + continue; + } + + $tokens->insertSlices([$index + 1 => $tokensToInsert]); + + if (!$this->configuration['keep_annotations']) { + $annotation->remove(); + } + } + + if ('' === $docBlock->getContent()) { + $tokens->clearTokenAndMergeSurroundingWhitespace($index); + } else { + $tokens[$index] = new Token([T_DOC_COMMENT, $docBlock->getContent()]); + } + } + } + + private function prepareFixingMap(): void + { + // annotations that map to attribute without parameters + foreach ([ + 'after', + 'afterClass', + 'before', + 'beforeClass', + 'coversNothing', + 'doesNotPerformAssertions', + 'large', + 'medium', + 'runInSeparateProcess', + 'runTestsInSeparateProcesses', + 'small', + 'test', + 'preCondition', + 'postCondition', + ] as $annotation) { + $this->fixingMap[$annotation] = 'fixWithoutParameters'; + } + + // annotations that map to attribute with single string value + foreach (['group', 'testDox', 'ticket'] as $annotation) { + $this->fixingMap[$annotation] = 'fixWithSingleStringValue'; + } + + // annotations that map from 'enabled'/'disabled' value to attribute with boolean value + foreach (['backupGlobals', 'backupStaticAttributes', 'preserveGlobalState'] as $annotation) { + $this->fixingMap[$annotation] = 'fixWithEnabledDisabledValue'; + } + + // annotations that has custom mapping function + $this->fixingMap['covers'] = 'fixCovers'; + $this->fixingMap['dataProvider'] = 'fixDataProvider'; + $this->fixingMap['depends'] = 'fixDepends'; + $this->fixingMap['requires'] = 'fixRequires'; + $this->fixingMap['testWith'] = 'fixTestWith'; + $this->fixingMap['uses'] = 'fixUses'; + } + + private static function shouldBeFixed(string $annotationName, string $annotationScope): bool + { + if ( + 'method' === $annotationScope + && \in_array($annotationName, ['covers', 'large', 'medium', 'runTestsInSeparateProcesses', 'small', 'uses'], true) + ) { + return false; + } + + if ( + 'class' === $annotationScope + && \in_array($annotationName, ['after', 'afterClass', 'before', 'beforeClass', 'dataProvider', 'depends', 'postCondition', 'preCondition', 'runInSeparateProcess', 'test', 'testWith'], true) + ) { + return false; + } + + return true; + } + + /** + * @param list $tokensToInsert + */ + private static function isAttributeAlreadyPresent(Tokens $tokens, int $index, array $tokensToInsert): bool + { + $attributeIndex = $tokens->getNextMeaningfulToken($index); + if (!$tokens[$attributeIndex]->isGivenKind(T_ATTRIBUTE)) { + return false; + } + + $insertedClassName = ''; + foreach (\array_slice($tokensToInsert, 3) as $token) { + if ($token->equals('(') || $token->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { + break; + } + $insertedClassName .= $token->getContent(); + } + + foreach (AttributeAnalyzer::collect($tokens, $attributeIndex) as $attributeAnalysis) { + foreach ($attributeAnalysis->getAttributes() as $attribute) { + $className = ltrim(AttributeAnalyzer::determineAttributeFullyQualifiedName($tokens, $attribute['name'], $attribute['start']), '\\'); + + if ($insertedClassName === $className) { + return true; + } + } + } + + return false; + } + + /** + * @return list + */ + private static function fixWithoutParameters(Tokens $tokens, int $index, Annotation $annotation): array + { + return self::createAttributeTokens($tokens, $index, self::getAttributeNameForAnnotation($annotation)); + } + + /** + * @return list + */ + private static function fixWithSingleStringValue(Tokens $tokens, int $index, Annotation $annotation): array + { + Preg::match( + \sprintf('/@%s\s+(.*\S)(?:\R|\s*\*+\/$)/', $annotation->getTag()->getName()), + $annotation->getContent(), + $matches, + ); + if (!isset($matches[1])) { + return []; + } + + return self::createAttributeTokens( + $tokens, + $index, + self::getAttributeNameForAnnotation($annotation), + self::createEscapedStringToken($matches[1]), + ); + } + + /** + * @return list + */ + private static function fixWithEnabledDisabledValue(Tokens $tokens, int $index, Annotation $annotation): array + { + $matches = self::getMatches($annotation); + if (!isset($matches[1])) { + return []; + } + + return self::createAttributeTokens( + $tokens, + $index, + self::getAttributeNameForAnnotation($annotation), + new Token([T_STRING, isset($matches[1]) && 'enabled' === $matches[1] ? 'true' : 'false']), + ); + } + + /** + * @return list + */ + private static function fixCovers(Tokens $tokens, int $index, Annotation $annotation): array + { + $matches = self::getMatches($annotation); + \assert(isset($matches[1])); + + if (str_starts_with($matches[1], '::')) { + return self::createAttributeTokens($tokens, $index, 'CoversFunction', self::createEscapedStringToken(substr($matches[1], 2))); + } + if (!str_contains($matches[1], '::')) { + return self::createAttributeTokens( + $tokens, + $index, + 'CoversClass', + ...self::toClassConstant($matches[1]), + ); + } + + return []; + } + + /** + * @return list + */ + private static function fixDataProvider(Tokens $tokens, int $index, Annotation $annotation): array + { + $matches = self::getMatches($annotation); + if (!isset($matches[1])) { + return []; + } + + if (str_contains($matches[1], '::')) { + // @phpstan-ignore offsetAccess.notFound + [$class, $method] = explode('::', $matches[1]); + + return self::createAttributeTokens( + $tokens, + $index, + 'DataProviderExternal', + ...[ + ...self::toClassConstant($class), + new Token(','), + new Token([T_WHITESPACE, ' ']), + self::createEscapedStringToken($method), + ], + ); + } + + return self::createAttributeTokens($tokens, $index, 'DataProvider', self::createEscapedStringToken($matches[1])); + } + + /** + * @return list + */ + private static function fixDepends(Tokens $tokens, int $index, Annotation $annotation): array + { + $matches = self::getMatches($annotation); + if (!isset($matches[1])) { + return []; + } + + $nameSuffix = ''; + $depended = $matches[1]; + if (isset($matches[2])) { + if ('clone' === $matches[1]) { + $nameSuffix = 'UsingDeepClone'; + $depended = $matches[2]; + } elseif ('shallowClone' === $matches[1]) { + $nameSuffix = 'UsingShallowClone'; + $depended = $matches[2]; + } + } + + $class = null; + $method = $depended; + if (str_contains($depended, '::')) { + // @phpstan-ignore offsetAccess.notFound + [$class, $method] = explode('::', $depended); + + if ('class' === $method) { + $method = null; + $nameSuffix = '' === $nameSuffix ? 'OnClass' : ('OnClass'.$nameSuffix); + } else { + $nameSuffix = ('External'.$nameSuffix); + } + } + + $attributeTokens = []; + if (null !== $class) { + $attributeTokens = self::toClassConstant($class); + } + if (null !== $method) { + if ([] !== $attributeTokens) { + $attributeTokens[] = new Token(','); + $attributeTokens[] = new Token([T_WHITESPACE, ' ']); + } + $attributeTokens[] = self::createEscapedStringToken($method); + } + + return self::createAttributeTokens($tokens, $index, 'Depends'.$nameSuffix, ...$attributeTokens); + } + + /** + * @return list + */ + private static function fixRequires(Tokens $tokens, int $index, Annotation $annotation): array + { + $matches = self::getMatches($annotation); + if (!isset($matches[1])) { + return []; + } + + $map = [ + 'extension' => 'RequiresPhpExtension', + 'function' => 'RequiresFunction', + 'PHP' => 'RequiresPhp', + 'PHPUnit' => 'RequiresPhpunit', + 'OS' => 'RequiresOperatingSystem', + 'OSFAMILY' => 'RequiresOperatingSystemFamily', + 'setting' => 'RequiresSetting', + ]; + + if (!isset($matches[2]) || !isset($map[$matches[1]])) { + return []; + } + + $attributeName = $map[$matches[1]]; + + if ('RequiresFunction' === $attributeName && str_contains($matches[2], '::')) { + // @phpstan-ignore offsetAccess.notFound + [$class, $method] = explode('::', $matches[2]); + + $attributeName = 'RequiresMethod'; + $attributeTokens = [ + ...self::toClassConstant($class), + new Token(','), + new Token([T_WHITESPACE, ' ']), + self::createEscapedStringToken($method), + ]; + } elseif ('RequiresPhp' === $attributeName && isset($matches[3])) { + $attributeTokens = [self::createEscapedStringToken($matches[2].' '.$matches[3])]; + } else { + $attributeTokens = [self::createEscapedStringToken($matches[2])]; + } + + if (isset($matches[3]) && 'RequiresPhp' !== $attributeName) { + $attributeTokens[] = new Token(','); + $attributeTokens[] = new Token([T_WHITESPACE, ' ']); + $attributeTokens[] = self::createEscapedStringToken($matches[3]); + } + + return self::createAttributeTokens($tokens, $index, $attributeName, ...$attributeTokens); + } + + /** + * @return list + */ + private static function fixTestWith(Tokens $tokens, int $index, Annotation $annotation): array + { + $content = $annotation->getContent(); + $content = Preg::replace('/@testWith\s+/', '', $content); + $content = Preg::replace('/(^|\R)\s+\**\s*/', "\n", $content); + $content = trim($content); + if ('' === $content) { + return []; + } + + $attributeTokens = []; + foreach (explode("\n", $content) as $json) { + $attributeTokens = array_merge( + $attributeTokens, + self::createAttributeTokens($tokens, $index, 'TestWithJson', self::createEscapedStringToken($json)), + ); + } + + return $attributeTokens; + } + + /** + * @return list + */ + private static function fixUses(Tokens $tokens, int $index, Annotation $annotation): array + { + $matches = self::getMatches($annotation); + if (!isset($matches[1])) { + return []; + } + + if (str_starts_with($matches[1], '::')) { + $attributeName = 'UsesFunction'; + $attributeTokens = [self::createEscapedStringToken(substr($matches[1], 2))]; + } elseif (Preg::match('/^[a-zA-Z\d\\\]+$/', $matches[1])) { + $attributeName = 'UsesClass'; + $attributeTokens = self::toClassConstant($matches[1]); + } else { + return []; + } + + return self::createAttributeTokens($tokens, $index, $attributeName, ...$attributeTokens); + } + + /** + * @return list + */ + private static function getMatches(Annotation $annotation): array + { + Preg::match( + \sprintf('/@%s\s+(\S+)(?:\s+(\S+))?(?:\s+(.+\S))?\s*(?:\R|\*+\/$)/', $annotation->getTag()->getName()), + $annotation->getContent(), + $matches, + ); + + \assert(array_is_list($matches)); // preg_match matches is not well typed, it depends on used regex, let's assure the type to instruct SCA + + return $matches; + } + + private static function getAttributeNameForAnnotation(Annotation $annotation): string + { + $annotationName = $annotation->getTag()->getName(); + + return 'backupStaticAttributes' === $annotationName + ? 'BackupStaticProperties' + : ucfirst($annotationName); + } + + /** + * @return list + */ + private static function createAttributeTokens( + Tokens $tokens, + int $index, + string $className, + Token ...$attributeTokens + ): array { + if ([] !== $attributeTokens) { + $attributeTokens = [ + new Token('('), + ...$attributeTokens, + new Token(')'), + ]; + } + + return [ + clone $tokens[$index + 1], + new Token([T_ATTRIBUTE, '#[']), + new Token([T_NS_SEPARATOR, '\\']), + new Token([T_STRING, 'PHPUnit']), + new Token([T_NS_SEPARATOR, '\\']), + new Token([T_STRING, 'Framework']), + new Token([T_NS_SEPARATOR, '\\']), + new Token([T_STRING, 'Attributes']), + new Token([T_NS_SEPARATOR, '\\']), + new Token([T_STRING, $className]), + ...$attributeTokens, + new Token([CT::T_ATTRIBUTE_CLOSE, ']']), + ]; + } + + /** + * @param class-string $name + * + * @return list + */ + private static function toClassConstant(string $name): array + { + return [ + ...ImportProcessor::tokenizeName($name), + new Token([T_DOUBLE_COLON, '::']), + new Token([CT::T_CLASS_CONSTANT, 'class']), + ]; + } + + private static function createEscapedStringToken(string $value): Token + { + return new Token([T_CONSTANT_ENCAPSED_STRING, "'".str_replace("'", "\\'", $value)."'"]); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitConstructFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitConstructFixer.php index 104f97d7..c0b6efae 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitConstructFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitConstructFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -29,30 +30,26 @@ /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * assertions?: list<'assertEquals'|'assertNotEquals'|'assertNotSame'|'assertSame'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * assertions: list<'assertEquals'|'assertNotEquals'|'assertNotSame'|'assertSame'> + * } */ final class PhpUnitConstructFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface { - /** - * @var array - */ - private static array $assertionFixers = [ - 'assertSame' => 'fixAssertPositive', - 'assertEquals' => 'fixAssertPositive', - 'assertNotEquals' => 'fixAssertNegative', - 'assertNotSame' => 'fixAssertNegative', - ]; + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -100,20 +97,24 @@ public function getPriority(): int } /** - * {@inheritdoc} + * @uses fixAssertNegative() + * @uses fixAssertPositive() */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { // no assertions to be fixed - fast return - if (empty($this->configuration['assertions'])) { + if ([] === $this->configuration['assertions']) { return; } foreach ($this->configuration['assertions'] as $assertionMethod) { - $assertionFixer = self::$assertionFixers[$assertionMethod]; - for ($index = $startIndex; $index < $endIndex; ++$index) { - $index = $this->{$assertionFixer}($tokens, $index, $assertionMethod); + $index = \call_user_func_array( + \in_array($assertionMethod, ['assertSame', 'assertEquals'], true) + ? [$this, 'fixAssertPositive'] + : [$this, 'fixAssertNegative'], + [$tokens, $index, $assertionMethod] + ); if (null === $index) { break; @@ -122,21 +123,20 @@ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $en } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { + $assertMethods = [ + 'assertEquals', + 'assertSame', + 'assertNotEquals', + 'assertNotSame', + ]; + return new FixerConfigurationResolver([ (new FixerOptionBuilder('assertions', 'List of assertion methods to fix.')) - ->setAllowedTypes(['array']) - ->setAllowedValues([new AllowedValueSubset(array_keys(self::$assertionFixers))]) - ->setDefault([ - 'assertEquals', - 'assertSame', - 'assertNotEquals', - 'assertNotSame', - ]) + ->setAllowedTypes(['string[]']) + ->setAllowedValues([new AllowedValueSubset($assertMethods)]) + ->setDefault($assertMethods) ->getOption(), ]); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderNameFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderNameFixer.php new file mode 100644 index 00000000..ed3a8d0d --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderNameFixer.php @@ -0,0 +1,199 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\PhpUnit; + +use PhpCsFixer\Fixer\AbstractPhpUnitFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Analyzer\DataProviderAnalyzer; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Kuba Werłos + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * prefix?: string, + * suffix?: string + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * prefix: string, + * suffix: string + * } + */ +final class PhpUnitDataProviderNameFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Data provider names must match the name of the test.', + [ + new CodeSample( + ' 'data_', + 'suffix' => '', + ] + ), + new CodeSample( + ' 'provides', + 'suffix' => 'Data', + ] + ), + ], + null, + 'Fixer could be risky if one is calling data provider by name as function.' + ); + } + + /** + * {@inheritdoc} + * + * Must run before PhpUnitAttributesFixer. + */ + public function getPriority(): int + { + return 9; + } + + public function isRisky(): bool + { + return true; + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('prefix', 'Prefix that replaces "test".')) + ->setAllowedTypes(['string']) + ->setDefault('provide') + ->getOption(), + (new FixerOptionBuilder('suffix', 'Suffix to be present at the end.')) + ->setAllowedTypes(['string']) + ->setDefault('Cases') + ->getOption(), + ]); + } + + protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void + { + $dataProviderAnalyzer = new DataProviderAnalyzer(); + foreach ($dataProviderAnalyzer->getDataProviders($tokens, $startIndex, $endIndex) as $dataProviderAnalysis) { + if (\count($dataProviderAnalysis->getUsageIndices()) > 1) { + continue; + } + + $usageIndex = $dataProviderAnalysis->getUsageIndices()[0][0]; + if (substr_count($tokens[$usageIndex]->getContent(), '@dataProvider') > 1) { + continue; + } + + $dataProviderNewName = $this->getDataProviderNameForUsageIndex($tokens, $usageIndex); + if (null !== $tokens->findSequence([[T_FUNCTION], [T_STRING, $dataProviderNewName]], $startIndex, $endIndex)) { + continue; + } + + $tokens[$dataProviderAnalysis->getNameIndex()] = new Token([T_STRING, $dataProviderNewName]); + + $newCommentContent = Preg::replace( + \sprintf('/(@dataProvider\s+)%s/', $dataProviderAnalysis->getName()), + \sprintf('$1%s', $dataProviderNewName), + $tokens[$usageIndex]->getContent(), + ); + + $tokens[$usageIndex] = new Token([T_DOC_COMMENT, $newCommentContent]); + } + } + + private function getDataProviderNameForUsageIndex(Tokens $tokens, int $index): string + { + do { + if (\defined('T_ATTRIBUTE') && $tokens[$index]->isGivenKind(T_ATTRIBUTE)) { + $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); + } + $index = $tokens->getNextMeaningfulToken($index); + } while (!$tokens[$index]->isGivenKind(T_STRING)); + + $name = $tokens[$index]->getContent(); + + $name = Preg::replace('/^test_*/i', '', $name); + + if ('' === $this->configuration['prefix']) { + $name = lcfirst($name); + } elseif ('_' !== substr($this->configuration['prefix'], -1)) { + $name = ucfirst($name); + } + + return $this->configuration['prefix'].$name.$this->configuration['suffix']; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderReturnTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderReturnTypeFixer.php new file mode 100644 index 00000000..cbeda2c7 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderReturnTypeFixer.php @@ -0,0 +1,120 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\PhpUnit; + +use PhpCsFixer\Fixer\AbstractPhpUnitFixer; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\Analyzer\DataProviderAnalyzer; +use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Kuba Werłos + */ +final class PhpUnitDataProviderReturnTypeFixer extends AbstractPhpUnitFixer +{ + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'The return type of PHPUnit data provider must be `iterable`.', + [ + new CodeSample( + 'getDataProviders($tokens, $startIndex, $endIndex)) as $dataProviderAnalysis) { + $typeAnalysis = $functionsAnalyzer->getFunctionReturnType($tokens, $dataProviderAnalysis->getNameIndex()); + + if (null === $typeAnalysis) { + $argumentsStart = $tokens->getNextTokenOfKind($dataProviderAnalysis->getNameIndex(), ['(']); + $argumentsEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $argumentsStart); + + $tokens->insertAt( + $argumentsEnd + 1, + [ + new Token([CT::T_TYPE_COLON, ':']), + new Token([T_WHITESPACE, ' ']), + new Token([T_STRING, 'iterable']), + ], + ); + + continue; + } + + if ('iterable' === $typeAnalysis->getName()) { + continue; + } + + $typeStartIndex = $tokens->getNextMeaningfulToken($typeAnalysis->getStartIndex() - 1); + $typeEndIndex = $typeAnalysis->getEndIndex(); + + // @TODO: drop condition and it's body when PHP 8+ is required + if ($tokens->generatePartialCode($typeStartIndex, $typeEndIndex) !== $typeAnalysis->getName()) { + continue; + } + + $tokens->overrideRange($typeStartIndex, $typeEndIndex, [new Token([T_STRING, 'iterable'])]); + } + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderStaticFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderStaticFixer.php index 4822b8ca..4f6dd158 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderStaticFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderStaticFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -29,9 +30,21 @@ /** * @author Kuba Werłos + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * force?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * force: bool + * } */ final class PhpUnitDataProviderStaticFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -84,15 +97,19 @@ public function provideSomething2Cases() { self::getData2(); } /** * {@inheritdoc} + * + * Must run before PhpUnitAttributesFixer. */ + public function getPriority(): int + { + return 9; + } + public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -108,9 +125,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { $dataProviderAnalyzer = new DataProviderAnalyzer(); @@ -118,15 +132,17 @@ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $en $inserts = []; foreach ($dataProviderAnalyzer->getDataProviders($tokens, $startIndex, $endIndex) as $dataProviderDefinitionIndex) { - $methodStartIndex = $tokens->getNextTokenOfKind($dataProviderDefinitionIndex, ['{']); + $methodStartIndex = $tokens->getNextTokenOfKind($dataProviderDefinitionIndex->getNameIndex(), ['{']); if (null !== $methodStartIndex) { $methodEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $methodStartIndex); - if (!$this->configuration['force'] && null !== $tokens->findSequence([[T_VARIABLE, '$this']], $methodStartIndex, $methodEndIndex)) { + if (false === $this->configuration['force'] && null !== $tokens->findSequence([[T_VARIABLE, '$this']], $methodStartIndex, $methodEndIndex)) { continue; } } - $functionIndex = $tokens->getPrevTokenOfKind($dataProviderDefinitionIndex, [[T_FUNCTION]]); + + /** @var int $functionIndex */ + $functionIndex = $tokens->getPrevTokenOfKind($dataProviderDefinitionIndex->getNameIndex(), [[T_FUNCTION]]); $methodAttributes = $tokensAnalyzer->getMethodAttributes($functionIndex); if (false !== $methodAttributes['static']) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php index a447470d..0af7856d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -23,20 +24,31 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * target?: '3.0'|'3.5'|'5.0'|'5.6'|'newest' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * target: '3.0'|'3.5'|'5.0'|'5.6'|'newest' + * } */ final class PhpUnitDedicateAssertFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** - * @var array|true> + * @var array */ - private static array $fixMap = [ + private const FIX_MAP = [ 'array_key_exists' => [ 'positive' => 'assertArrayHasKey', 'negative' => 'assertArrayNotHasKey', @@ -109,17 +121,65 @@ final class PhpUnitDedicateAssertFixer extends AbstractPhpUnitFixer implements C ]; /** - * @var string[] + * @var list */ private array $functions = []; + public function isRisky(): bool + { + return true; + } + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'PHPUnit assertions like `assertInternalType`, `assertFileExists`, should be used over `assertTrue`.', + [ + new CodeSample( + 'assertTrue(is_float( $a), "my message"); + $this->assertTrue(is_nan($a)); + } +} +' + ), + new CodeSample( + 'assertTrue(is_dir($a)); + $this->assertTrue(is_writable($a)); + $this->assertTrue(is_readable($a)); + } +} +', + ['target' => PhpUnitTargetVersion::VERSION_5_6] + ), + ], + null, + 'Fixer could be risky if one is overriding PHPUnit\'s native methods.' + ); + } + /** * {@inheritdoc} + * + * Must run before NoUnusedImportsFixer, PhpUnitAssertNewNamesFixer, PhpUnitDedicateAssertInternalTypeFixer. + * Must run after ModernizeStrposFixer, NoAliasFunctionsFixer, PhpUnitConstructFixer. */ - public function configure(array $configuration): void + public function getPriority(): int { - parent::configure($configuration); + return -9; + } + protected function configurePostNormalisation(): void + { // assertions added in 3.0: assertArrayNotHasKey assertArrayHasKey assertFileNotExists assertFileExists assertNotNull, assertNull $this->functions = [ 'array_key_exists', @@ -174,96 +234,28 @@ public function configure(array $configuration): void } } - /** - * {@inheritdoc} - */ - public function isRisky(): bool - { - return true; - } - - /** - * {@inheritdoc} - */ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPUnit assertions like `assertInternalType`, `assertFileExists`, should be used over `assertTrue`.', - [ - new CodeSample( - 'assertTrue(is_float( $a), "my message"); - $this->assertTrue(is_nan($a)); - } -} -' - ), - new CodeSample( - 'assertTrue(is_dir($a)); - $this->assertTrue(is_writable($a)); - $this->assertTrue(is_readable($a)); - } -} -', - ['target' => PhpUnitTargetVersion::VERSION_5_6] - ), - ], - null, - 'Fixer could be risky if one is overriding PHPUnit\'s native methods.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoUnusedImportsFixer, PhpUnitDedicateAssertInternalTypeFixer. - * Must run after ModernizeStrposFixer, NoAliasFunctionsFixer, PhpUnitConstructFixer. - */ - public function getPriority(): int - { - return -9; - } - - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { $argumentsAnalyzer = new ArgumentsAnalyzer(); foreach ($this->getPreviousAssertCall($tokens, $startIndex, $endIndex) as $assertCall) { // test and fix for assertTrue/False to dedicated asserts - if ('asserttrue' === $assertCall['loweredName'] || 'assertfalse' === $assertCall['loweredName']) { + if (\in_array($assertCall['loweredName'], ['asserttrue', 'assertfalse'], true)) { $this->fixAssertTrueFalse($tokens, $argumentsAnalyzer, $assertCall); continue; } - if ( - 'assertsame' === $assertCall['loweredName'] - || 'assertnotsame' === $assertCall['loweredName'] - || 'assertequals' === $assertCall['loweredName'] - || 'assertnotequals' === $assertCall['loweredName'] - ) { + if (\in_array( + $assertCall['loweredName'], + ['assertsame', 'assertnotsame', 'assertequals', 'assertnotequals'], + true + )) { $this->fixAssertSameEquals($tokens, $assertCall); - - continue; } } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -329,8 +321,9 @@ private function fixAssertTrueFalse(Tokens $tokens, ArgumentsAnalyzer $arguments $arguments = $argumentsAnalyzer->getArguments($tokens, $testOpenIndex, $testCloseIndex); $isPositive = 'asserttrue' === $assertCall['loweredName']; - if (\is_array(self::$fixMap[$content])) { - $expectedCount = self::$fixMap[$content]['argument_count'] ?? 1; + if (isset(self::FIX_MAP[$content]) && \is_array(self::FIX_MAP[$content])) { + $fixDetails = self::FIX_MAP[$content]; + $expectedCount = $fixDetails['argument_count'] ?? 1; if ($expectedCount !== \count($arguments)) { return; @@ -338,14 +331,14 @@ private function fixAssertTrueFalse(Tokens $tokens, ArgumentsAnalyzer $arguments $isPositive = $isPositive ? 'positive' : 'negative'; - if (false === self::$fixMap[$content][$isPositive]) { + if (false === $fixDetails[$isPositive]) { return; } - $tokens[$assertCall['index']] = new Token([T_STRING, self::$fixMap[$content][$isPositive]]); + $tokens[$assertCall['index']] = new Token([T_STRING, $fixDetails[$isPositive]]); $this->removeFunctionCall($tokens, $testDefaultNamespaceTokenIndex, $testIndex, $testOpenIndex, $testCloseIndex); - if (self::$fixMap[$content]['swap_arguments'] ?? false) { + if ($fixDetails['swap_arguments'] ?? false) { if (2 !== $expectedCount) { throw new \RuntimeException('Can only swap two arguments, please update map or logic.'); } @@ -499,7 +492,7 @@ private function fixAssertSameEquals(Tokens $tokens, array $assertCall): void $lowerContent = strtolower($tokens[$countCallIndex]->getContent()); - if ('count' !== $lowerContent && 'sizeof' !== $lowerContent) { + if (!\in_array($lowerContent, ['count', 'sizeof'], true)) { return; // not a call to "count" or "sizeOf" } @@ -531,52 +524,6 @@ private function fixAssertSameEquals(Tokens $tokens, array $assertCall): void ]); } - /** - * @return iterable - */ - private function getPreviousAssertCall(Tokens $tokens, int $startIndex, int $endIndex): iterable - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - for ($index = $endIndex; $index > $startIndex; --$index) { - $index = $tokens->getPrevTokenOfKind($index, [[T_STRING]]); - - if (null === $index) { - return; - } - - // test if "assert" something call - $loweredContent = strtolower($tokens[$index]->getContent()); - - if (!str_starts_with($loweredContent, 'assert')) { - continue; - } - - // test candidate for simple calls like: ([\]+'some fixable call'(...)) - $openBraceIndex = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$openBraceIndex]->equals('(')) { - continue; - } - - if (!$functionsAnalyzer->isTheSameClassCall($tokens, $index)) { - continue; - } - - yield [ - 'index' => $index, - 'loweredName' => $loweredContent, - 'openBraceIndex' => $openBraceIndex, - 'closeBraceIndex' => $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openBraceIndex), - ]; - } - } - private function removeFunctionCall(Tokens $tokens, ?int $callNSIndex, int $callIndex, int $openIndex, int $closeIndex): void { $tokens->clearTokenAndMergeSurroundingWhitespace($callIndex); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertInternalTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertInternalTypeFixer.php index 6883bf41..ece43be2 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertInternalTypeFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertInternalTypeFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -28,9 +29,21 @@ /** * @author Filippo Tessarotto + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * target?: '7.5'|'newest' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * target: '7.5'|'newest' + * } */ final class PhpUnitDedicateAssertInternalTypeFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @var array */ @@ -53,9 +66,6 @@ final class PhpUnitDedicateAssertInternalTypeFixer extends AbstractPhpUnitFixer 'iterable' => 'assertIsIterable', ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -92,9 +102,6 @@ public function testMe() ); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; @@ -110,9 +117,6 @@ public function getPriority(): int return -16; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -124,9 +128,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { $anonymousClassIndices = []; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitExpectationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitExpectationFixer.php index 7f2c3530..24ef2b79 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitExpectationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitExpectationFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -30,38 +31,26 @@ /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * target?: '5.2'|'5.6'|'8.4'|'newest' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * target: '5.2'|'5.6'|'8.4'|'newest' + * } */ final class PhpUnitExpectationFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @var array */ private array $methodMap = []; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->methodMap = [ - 'setExpectedException' => 'expectExceptionMessage', - ]; - - if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_5_6)) { - $this->methodMap['setExpectedExceptionRegExp'] = 'expectExceptionMessageRegExp'; - } - - if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_8_4)) { - $this->methodMap['setExpectedExceptionRegExp'] = 'expectExceptionMessageMatches'; - $this->methodMap['expectExceptionMessageRegExp'] = 'expectExceptionMessageMatches'; - } - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -158,17 +147,27 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->methodMap = [ + 'setExpectedException' => 'expectExceptionMessage', + ]; + + if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_5_6)) { + $this->methodMap['setExpectedExceptionRegExp'] = 'expectExceptionMessageRegExp'; + } + + if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_8_4)) { + $this->methodMap['setExpectedExceptionRegExp'] = 'expectExceptionMessageMatches'; + $this->methodMap['expectExceptionMessageRegExp'] = 'expectExceptionMessageMatches'; + } + } + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -180,9 +179,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { foreach (Token::getObjectOperatorKinds() as $objectOperator) { @@ -234,6 +230,10 @@ private function applyPhpUnitClassFixWithObjectOperator(Tokens $tokens, int $sta $argStart = array_keys($arguments)[$cnt]; $argBefore = $tokens->getPrevMeaningfulToken($argStart); + if (!isset($argumentsReplacements[$cnt])) { + throw new \LogicException(\sprintf('Unexpected index %d to find replacement method.', $cnt)); + } + if ('expectExceptionMessage' === $argumentsReplacements[$cnt]) { $paramIndicatorIndex = $tokens->getNextMeaningfulToken($argBefore); $afterParamIndicatorIndex = $tokens->getNextMeaningfulToken($paramIndicatorIndex); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitFqcnAnnotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitFqcnAnnotationFixer.php index dd440ecd..46bb9a7d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitFqcnAnnotationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitFqcnAnnotationFixer.php @@ -27,9 +27,6 @@ */ final class PhpUnitFqcnAnnotationFixer extends AbstractPhpUnitFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -63,9 +60,6 @@ public function getPriority(): int return -9; } - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { $prevDocCommentIndex = $tokens->getPrevTokenOfKind($startIndex, [[T_DOC_COMMENT]]); @@ -83,7 +77,7 @@ private function fixPhpUnitClass(Tokens $tokens, int $startIndex, int $endIndex) if ($tokens[$index]->isGivenKind(T_DOC_COMMENT)) { $tokens[$index] = new Token([T_DOC_COMMENT, Preg::replace( '~^(\s*\*\s*@(?:expectedException|covers|coversDefaultClass|uses)\h+)(?!(?:self|static)::)(\w.*)$~m', - '$1\\\\$2', + '$1\\\$2', $tokens[$index]->getContent() )]); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitInternalClassFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitInternalClassFixer.php index 38ad72a5..1a50197f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitInternalClassFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitInternalClassFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; @@ -29,12 +30,21 @@ /** * @author Gert de Pagter + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * types?: list<'abstract'|'final'|'normal'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * types: list<'abstract'|'final'|'normal'> + * } */ final class PhpUnitInternalClassFixer extends AbstractPhpUnitFixer implements WhitespacesAwareFixerInterface, ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -52,7 +62,7 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before FinalInternalClassFixer. + * Must run before FinalInternalClassFixer, PhpdocSeparationFixer. */ public function getPriority(): int { @@ -66,7 +76,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn return new FixerConfigurationResolver([ (new FixerOptionBuilder('types', 'What types of classes to mark as internal.')) ->setAllowedValues([new AllowedValueSubset($types)]) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setDefault(['normal', 'final']) ->getOption(), ]); @@ -80,13 +90,12 @@ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $en return; } - $this->ensureIsDockBlockWithAnnotation( + $this->ensureIsDocBlockWithAnnotation( $tokens, $classIndex, 'internal', - false, - true, - ['internal'] + ['internal'], + [], ); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMethodCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMethodCasingFixer.php index 91aa38ce..230535c8 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMethodCasingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMethodCasingFixer.php @@ -18,6 +18,7 @@ use PhpCsFixer\DocBlock\Line; use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -32,9 +33,21 @@ /** * @author Filippo Tessarotto + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * case?: 'camel_case'|'snake_case' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * case: 'camel_case'|'snake_case' + * } */ final class PhpUnitMethodCasingFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -45,9 +58,6 @@ final class PhpUnitMethodCasingFixer extends AbstractPhpUnitFixer implements Con */ public const SNAKE_CASE = 'snake_case'; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -55,7 +65,7 @@ public function getDefinition(): FixerDefinitionInterface [ new CodeSample( ' $startIndex; --$index) { @@ -184,14 +188,12 @@ private function updateDocBlock(Tokens $tokens, int $docBlockIndex): void continue; } - $newLineContent = Preg::replaceCallback('/(@depends\s+)(.+)(\b)/', function (array $matches): string { - return sprintf( - '%s%s%s', - $matches[1], - $this->updateMethodCasing($matches[2]), - $matches[3] - ); - }, $lineContent); + $newLineContent = Preg::replaceCallback('/(@depends\s+)(.+)(\b)/', fn (array $matches): string => \sprintf( + '%s%s%s', + $matches[1], + $this->updateMethodCasing($matches[2]), + $matches[3] + ), $lineContent); if ($newLineContent !== $lineContent) { $lines[$inc] = new Line($newLineContent); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockFixer.php index 8c5794e9..6afbf7c4 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -28,17 +29,23 @@ /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * target?: '5.4'|'5.5'|'newest' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * target: '5.4'|'5.5'|'newest' + * } */ final class PhpUnitMockFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface { - /** - * @var bool - */ - private $fixCreatePartialMock; - - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + private bool $fixCreatePartialMock; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -77,27 +84,16 @@ public function testFoo() ); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void + protected function configurePostNormalisation(): void { - parent::configure($configuration); - $this->fixCreatePartialMock = PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_5_5); } - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { $argumentsAnalyzer = new ArgumentsAnalyzer(); @@ -126,9 +122,6 @@ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $en } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixer.php index ed253175..3350b669 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixer.php @@ -37,9 +37,6 @@ final class PhpUnitMockShortWillReturnFixer extends AbstractPhpUnitFixer 'returnvaluemap' => 'willReturnMap', ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -65,17 +62,11 @@ public function testSomeTest() ); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { $functionsAnalyzer = new FunctionsAnalyzer(); @@ -110,10 +101,6 @@ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $en $openingBraceIndex = $tokens->getNextMeaningfulToken($functionToRemoveIndex); - if (!$tokens[$openingBraceIndex]->equals('(')) { - continue; - } - if ($tokens[$tokens->getNextMeaningfulToken($openingBraceIndex)]->isGivenKind(CT::T_FIRST_CLASS_CALLABLE)) { continue; } @@ -126,6 +113,11 @@ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $en $tokens->clearTokenAndMergeSurroundingWhitespace($functionToRemoveIndex); $tokens->clearTokenAndMergeSurroundingWhitespace($openingBraceIndex); $tokens->clearTokenAndMergeSurroundingWhitespace($closingBraceIndex); + + $commaAfterClosingBraceIndex = $tokens->getNextMeaningfulToken($closingBraceIndex); + if ($tokens[$commaAfterClosingBraceIndex]->equals(',')) { + $tokens->clearTokenAndMergeSurroundingWhitespace($commaAfterClosingBraceIndex); + } } } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNamespacedFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNamespacedFixer.php index f374f9c8..9d39640b 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNamespacedFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNamespacedFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -23,18 +24,28 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Analyzer\ClassyAnalyzer; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * target?: '4.8'|'5.7'|'6.0'|'newest' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * target: '4.8'|'5.7'|'6.0'|'newest' + * } */ final class PhpUnitNamespacedFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * @var string - */ - private $originalClassRegEx; + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + private string $originalClassRegEx; /** * Class Mappings. @@ -44,13 +55,10 @@ final class PhpUnitNamespacedFixer extends AbstractFixer implements Configurable * space class and need a dedicated translation table. This trans- * lation table is defined in @see configure. * - * @var array|string[] Class Mappings + * @var array Class Mappings */ - private $classMap; + private array $classMap; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { $codeSample = 'isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void + protected function configurePostNormalisation(): void { - parent::configure($configuration); - if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_6_0)) { $this->originalClassRegEx = '/^PHPUnit_\w+$/i'; // @noinspection ClassConstantCanBeUsedInspection @@ -133,7 +130,7 @@ public function configure(array $configuration): void 'PHPUnit_Util_XML' => 'PHPUnit\Util\Xml', ]; } elseif (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_5_7)) { - $this->originalClassRegEx = '/^PHPUnit_Framework_TestCase|PHPUnit_Framework_Assert|PHPUnit_Framework_BaseTestListener|PHPUnit_Framework_TestListener$/i'; + $this->originalClassRegEx = '/^PHPUnit_Framework_(TestCase|Assert|BaseTestListener|TestListener)+$/i'; $this->classMap = []; } else { $this->originalClassRegEx = '/^PHPUnit_Framework_TestCase$/i'; @@ -141,9 +138,6 @@ public function configure(array $configuration): void } } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $importedOriginalClassesMap = []; @@ -163,8 +157,10 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } $originalClass = $tokens[$currIndex]->getContent(); + $allowedReplacementScenarios = (new ClassyAnalyzer())->isClassyInvocation($tokens, $currIndex) + || $this->isImport($tokens, $currIndex); - if (1 !== Preg::match($this->originalClassRegEx, $originalClass)) { + if (!$allowedReplacementScenarios || !Preg::match($this->originalClassRegEx, $originalClass)) { ++$currIndex; continue; @@ -191,9 +187,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -210,21 +203,33 @@ private function generateReplacement(string $originalClassName): Tokens $delimiter = '_'; $string = $originalClassName; - if (isset($this->classMap[$originalClassName])) { + $map = array_change_key_case($this->classMap); + if (isset($map[strtolower($originalClassName)])) { $delimiter = '\\'; - $string = $this->classMap[$originalClassName]; + $string = $map[strtolower($originalClassName)]; } $parts = explode($delimiter, $string); $tokensArray = []; - while (!empty($parts)) { + while ([] !== $parts) { $tokensArray[] = new Token([T_STRING, array_shift($parts)]); - if (!empty($parts)) { + if ([] !== $parts) { $tokensArray[] = new Token([T_NS_SEPARATOR, '\\']); } } return Tokens::fromArray($tokensArray); } + + private function isImport(Tokens $tokens, int $currIndex): bool + { + $prevIndex = $tokens->getPrevMeaningfulToken($currIndex); + + if ($tokens[$prevIndex]->isGivenKind([T_NS_SEPARATOR])) { + $prevIndex = $tokens->getPrevMeaningfulToken($prevIndex); + } + + return $tokens[$prevIndex]->isGivenKind([T_USE]); + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixer.php index 4e06fda5..8e011368 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixer.php @@ -18,6 +18,7 @@ use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -33,27 +34,25 @@ /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * target?: '3.2'|'4.3'|'newest', + * use_class_const?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * target: '3.2'|'4.3'|'newest', + * use_class_const: bool + * } */ final class PhpUnitNoExpectationAnnotationFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { - /** - * @var bool - */ - private $fixMessageRegExp; - - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; - $this->fixMessageRegExp = PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_4_3); - } + private bool $fixMessageRegExp; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -116,17 +115,16 @@ public function getPriority(): int return 10; } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->fixMessageRegExp = PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_4_3); + } + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -142,9 +140,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { $tokensAnalyzer = new TokensAnalyzer($tokens); @@ -231,7 +226,7 @@ private function extractContentFromAnnotation(Annotation $annotation): string { $tag = $annotation->getTag()->getName(); - if (1 !== Preg::match('/@'.$tag.'\s+(.+)$/s', $annotation->getContent(), $matches)) { + if (!Preg::match('/@'.$tag.'\s+(.+)$/s', $annotation->getContent(), $matches)) { return ''; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixer.php index 3db4a3e0..7ee72545 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixer.php @@ -27,9 +27,6 @@ */ final class PhpUnitSetUpTearDownVisibilityFixer extends AbstractPhpUnitFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -59,59 +56,56 @@ public function tearDown() ); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { $counter = 0; $tokensAnalyzer = new TokensAnalyzer($tokens); - for ($i = $endIndex - 1; $i > $startIndex; --$i) { + $slicesToInsert = []; + + for ($index = $startIndex + 1; $index < $endIndex; ++$index) { if (2 === $counter) { - break; // we've seen both method we are interested in, so stop analyzing this class + break; // we've seen both methods we are interested in, so stop analyzing this class + } + + if ($tokens[$index]->equals('{')) { + $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); + + continue; } - if (!$this->isSetupOrTearDownMethod($tokens, $i)) { + if (!$tokens[$index]->isGivenKind(T_FUNCTION)) { + continue; + } + + $functionNameIndex = $tokens->getNextMeaningfulToken($index); + $functionName = strtolower($tokens[$functionNameIndex]->getContent()); + + if ('setup' !== $functionName && 'teardown' !== $functionName) { continue; } ++$counter; - $visibility = $tokensAnalyzer->getMethodAttributes($i)['visibility']; + + $visibility = $tokensAnalyzer->getMethodAttributes($index)['visibility']; if (T_PUBLIC === $visibility) { - $index = $tokens->getPrevTokenOfKind($i, [[T_PUBLIC]]); - $tokens[$index] = new Token([T_PROTECTED, 'protected']); + $visibilityIndex = $tokens->getPrevTokenOfKind($index, [[T_PUBLIC]]); + $tokens[$visibilityIndex] = new Token([T_PROTECTED, 'protected']); continue; } if (null === $visibility) { - $tokens->insertAt($i, [new Token([T_PROTECTED, 'protected']), new Token([T_WHITESPACE, ' '])]); + $slicesToInsert[$index] = [new Token([T_PROTECTED, 'protected']), new Token([T_WHITESPACE, ' '])]; } } - } - - private function isSetupOrTearDownMethod(Tokens $tokens, int $index): bool - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - $isMethod = $tokens[$index]->isGivenKind(T_FUNCTION) && !$tokensAnalyzer->isLambda($index); - if (!$isMethod) { - return false; - } - - $functionNameIndex = $tokens->getNextMeaningfulToken($index); - $functionName = strtolower($tokens[$functionNameIndex]->getContent()); - return 'setup' === $functionName || 'teardown' === $functionName; + $tokens->insertSlices($slicesToInsert); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSizeClassFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSizeClassFixer.php index aec78b24..669bb78a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSizeClassFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSizeClassFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -27,14 +28,23 @@ /** * @author Jefersson Nathan + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * group?: 'large'|'medium'|'small' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * group: 'large'|'medium'|'small' + * } */ final class PhpUnitSizeClassFixer extends AbstractPhpUnitFixer implements WhitespacesAwareFixerInterface, ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + private const SIZES = ['small', 'medium', 'large']; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -47,6 +57,16 @@ public function getDefinition(): FixerDefinitionInterface ); } + /** + * {@inheritdoc} + * + * Must run before PhpdocSeparationFixer. + */ + public function getPriority(): int + { + return 0; + } + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -65,13 +85,16 @@ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $en return; } - $this->ensureIsDockBlockWithAnnotation( + $this->ensureIsDocBlockWithAnnotation( $tokens, $classIndex, $this->configuration['group'], - false, - true, - self::SIZES + self::SIZES, + [ + 'phpunit\framework\attributes\small', + 'phpunit\framework\attributes\medium', + 'phpunit\framework\attributes\large', + ], ); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitStrictFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitStrictFixer.php index 914e1b0f..f3d8fcc8 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitStrictFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitStrictFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -30,22 +31,31 @@ /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * assertions?: list<'assertAttributeEquals'|'assertAttributeNotEquals'|'assertEquals'|'assertNotEquals'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * assertions: list<'assertAttributeEquals'|'assertAttributeNotEquals'|'assertEquals'|'assertNotEquals'> + * } */ final class PhpUnitStrictFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** - * @var array + * @var array */ - private static array $assertionMap = [ + private const ASSERTION_MAP = [ 'assertAttributeEquals' => 'assertAttributeSame', 'assertAttributeNotEquals' => 'assertAttributeNotSame', 'assertEquals' => 'assertSame', 'assertNotEquals' => 'assertNotSame', ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -86,24 +96,18 @@ public function testSomeTest() ); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { $argumentsAnalyzer = new ArgumentsAnalyzer(); $functionsAnalyzer = new FunctionsAnalyzer(); foreach ($this->configuration['assertions'] as $methodBefore) { - $methodAfter = self::$assertionMap[$methodBefore]; + $methodAfter = self::ASSERTION_MAP[$methodBefore]; for ($index = $startIndex; $index < $endIndex; ++$index) { $methodIndex = $tokens->getNextTokenOfKind($index, [[T_STRING, $methodBefore]]); @@ -132,15 +136,12 @@ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $en } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('assertions', 'List of assertion methods to fix.')) - ->setAllowedTypes(['array']) - ->setAllowedValues([new AllowedValueSubset(array_keys(self::$assertionMap))]) + ->setAllowedTypes(['string[]']) + ->setAllowedValues([new AllowedValueSubset(array_keys(self::ASSERTION_MAP))]) ->setDefault([ 'assertAttributeEquals', 'assertAttributeNotEquals', diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTargetVersion.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTargetVersion.php index c8122c67..8ecc1c2d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTargetVersion.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTargetVersion.php @@ -37,16 +37,15 @@ final class PhpUnitTargetVersion public const VERSION_6_0 = '6.0'; public const VERSION_7_5 = '7.5'; public const VERSION_8_4 = '8.4'; + public const VERSION_9_1 = '9.1'; public const VERSION_NEWEST = 'newest'; - private function __construct() - { - } + private function __construct() {} public static function fulfills(string $candidate, string $target): bool { if (self::VERSION_NEWEST === $target) { - throw new \LogicException(sprintf('Parameter `target` shall not be provided as "%s", determine proper target for tested PHPUnit feature instead.', self::VERSION_NEWEST)); + throw new \LogicException(\sprintf('Parameter `target` shall not be provided as "%s", determine proper target for tested PHPUnit feature instead.', self::VERSION_NEWEST)); } if (self::VERSION_NEWEST === $candidate) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php index 2d83de8c..8b524346 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php @@ -18,6 +18,7 @@ use PhpCsFixer\DocBlock\Line; use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -33,34 +34,40 @@ /** * @author Gert de Pagter + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * style?: 'annotation'|'prefix' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * style: 'annotation'|'prefix' + * } */ final class PhpUnitTestAnnotationFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'Adds or removes @test annotations from tests, following configuration.', [ new CodeSample('whitespacesConfig->getLineEnding()), new CodeSample('whitespacesConfig->getLineEnding(), ['style' => 'annotation']), ], @@ -80,9 +87,6 @@ public function getPriority(): int return 10; } - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { if ('annotation' === $this->configuration['style']) { @@ -92,9 +96,6 @@ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $en } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -205,7 +206,7 @@ private function hasProperTestAnnotation(Tokens $tokens, int $index): bool $docBlockIndex = $this->getDocBlockIndex($tokens, $index); $doc = $tokens[$docBlockIndex]->getContent(); - return 1 === Preg::match('/\*\s+@test\b/', $doc); + return Preg::match('/\*\s+@test\b/', $doc); } private function removeTestPrefix(string $functionName): string @@ -237,7 +238,7 @@ private function createDocBlock(Tokens $tokens, int $docBlockIndex): void } /** - * @return Line[] + * @return list */ private function updateDocBlock(Tokens $tokens, int $docBlockIndex): array { @@ -248,9 +249,9 @@ private function updateDocBlock(Tokens $tokens, int $docBlockIndex): array } /** - * @param Line[] $lines + * @param list $lines * - * @return Line[] + * @return list */ private function updateLines(array $lines, Tokens $tokens, int $docBlockIndex): array { @@ -290,9 +291,9 @@ private function updateLines(array $lines, Tokens $tokens, int $docBlockIndex): /** * Take a one line doc block, and turn it into a multi line doc block. * - * @param Line[] $lines + * @param non-empty-list $lines * - * @return Line[] + * @return list */ private function splitUpDocBlock(array $lines, Tokens $tokens, int $docBlockIndex): array { @@ -310,7 +311,7 @@ private function splitUpDocBlock(array $lines, Tokens $tokens, int $docBlockInde /** * @todo check whether it's doable to use \PhpCsFixer\DocBlock\DocBlock::getSingleLineDocBlockEntry instead * - * @param Line[] $lines + * @param non-empty-list $lines */ private function getSingleLineDocBlockEntry(array $lines): string { @@ -389,9 +390,9 @@ private function findWhereDependsFunctionNameStarts(array $line): int } /** - * @param Line[] $lines + * @param list $lines * - * @return Line[] + * @return list */ private function addTestAnnotation(array $lines, Tokens $tokens, int $docBlockIndex): array { @@ -401,7 +402,8 @@ private function addTestAnnotation(array $lines, Tokens $tokens, int $docBlockIn $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $docBlockIndex); $lineEnd = $this->whitespacesConfig->getLineEnding(); - array_splice($lines, -1, 0, $originalIndent.' *'.$lineEnd.$originalIndent.' * @test'.$lineEnd); + array_splice($lines, -1, 0, [new Line($originalIndent.' *'.$lineEnd.$originalIndent.' * @test'.$lineEnd)]); + \assert(array_is_list($lines)); // we know it's list, but we need to tell PHPStan } return $lines; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixer.php index aeba9411..7e1f026f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\Fixer\AbstractPhpUnitFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -27,13 +28,28 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; +use PhpCsFixer\Utils; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; /** * @author Filippo Tessarotto + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * call_type?: 'self'|'static'|'this', + * methods?: array + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * call_type: 'self'|'static'|'this', + * methods: array + * } */ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -50,22 +66,17 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i public const CALL_TYPE_STATIC = 'static'; /** - * @var array - */ - private array $allowedValues = [ - self::CALL_TYPE_THIS => true, - self::CALL_TYPE_SELF => true, - self::CALL_TYPE_STATIC => true, - ]; - - /** - * @var array + * @var array */ - private array $staticMethods = [ + private const STATIC_METHODS = [ // Assert methods 'anything' => true, 'arrayHasKey' => true, 'assertArrayHasKey' => true, + 'assertArrayIsEqualToArrayIgnoringListOfKeys' => true, + 'assertArrayIsEqualToArrayOnlyConsideringListOfKeys' => true, + 'assertArrayIsIdenticalToArrayIgnoringListOfKeys' => true, + 'assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys' => true, 'assertArrayNotHasKey' => true, 'assertArraySubset' => true, 'assertAttributeContains' => true, @@ -94,8 +105,35 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i 'assertClassNotHasStaticAttribute' => true, 'assertContains' => true, 'assertContainsEquals' => true, + 'assertContainsNotOnlyArray' => true, + 'assertContainsNotOnlyBool' => true, + 'assertContainsNotOnlyCallable' => true, + 'assertContainsNotOnlyClosedResource' => true, + 'assertContainsNotOnlyFloat' => true, + 'assertContainsNotOnlyInstancesOf' => true, + 'assertContainsNotOnlyInt' => true, + 'assertContainsNotOnlyIterable' => true, + 'assertContainsNotOnlyNull' => true, + 'assertContainsNotOnlyNumeric' => true, + 'assertContainsNotOnlyObject' => true, + 'assertContainsNotOnlyResource' => true, + 'assertContainsNotOnlyScalar' => true, + 'assertContainsNotOnlyString' => true, 'assertContainsOnly' => true, + 'assertContainsOnlyArray' => true, + 'assertContainsOnlyBool' => true, + 'assertContainsOnlyCallable' => true, + 'assertContainsOnlyClosedResource' => true, + 'assertContainsOnlyFloat' => true, 'assertContainsOnlyInstancesOf' => true, + 'assertContainsOnlyInt' => true, + 'assertContainsOnlyIterable' => true, + 'assertContainsOnlyNull' => true, + 'assertContainsOnlyNumeric' => true, + 'assertContainsOnlyObject' => true, + 'assertContainsOnlyResource' => true, + 'assertContainsOnlyScalar' => true, + 'assertContainsOnlyString' => true, 'assertCount' => true, 'assertDirectoryDoesNotExist' => true, 'assertDirectoryExists' => true, @@ -108,11 +146,11 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i 'assertDirectoryNotIsWritable' => true, 'assertDoesNotMatchRegularExpression' => true, 'assertEmpty' => true, - 'assertEqualXMLStructure' => true, 'assertEquals' => true, 'assertEqualsCanonicalizing' => true, 'assertEqualsIgnoringCase' => true, 'assertEqualsWithDelta' => true, + 'assertEqualXMLStructure' => true, 'assertFalse' => true, 'assertFileDoesNotExist' => true, 'assertFileEquals' => true, @@ -123,6 +161,8 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i 'assertFileIsNotWritable' => true, 'assertFileIsReadable' => true, 'assertFileIsWritable' => true, + 'assertFileMatchesFormat' => true, + 'assertFileMatchesFormatFile' => true, 'assertFileNotEquals' => true, 'assertFileNotEqualsCanonicalizing' => true, 'assertFileNotEqualsIgnoringCase' => true, @@ -142,6 +182,7 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i 'assertIsFloat' => true, 'assertIsInt' => true, 'assertIsIterable' => true, + 'assertIsList' => true, 'assertIsNotArray' => true, 'assertIsNotBool' => true, 'assertIsNotCallable' => true, @@ -196,17 +237,22 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i 'assertNull' => true, 'assertObjectEquals' => true, 'assertObjectHasAttribute' => true, + 'assertObjectHasProperty' => true, + 'assertObjectNotEquals' => true, 'assertObjectNotHasAttribute' => true, + 'assertObjectNotHasProperty' => true, 'assertRegExp' => true, 'assertSame' => true, 'assertSameSize' => true, 'assertStringContainsString' => true, 'assertStringContainsStringIgnoringCase' => true, + 'assertStringContainsStringIgnoringLineEndings' => true, 'assertStringEndsNotWith' => true, 'assertStringEndsWith' => true, 'assertStringEqualsFile' => true, 'assertStringEqualsFileCanonicalizing' => true, 'assertStringEqualsFileIgnoringCase' => true, + 'assertStringEqualsStringIgnoringLineEndings' => true, 'assertStringMatchesFormat' => true, 'assertStringMatchesFormatFile' => true, 'assertStringNotContainsString' => true, @@ -235,7 +281,20 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i 'containsEqual' => true, 'containsIdentical' => true, 'containsOnly' => true, + 'containsOnlyArray' => true, + 'containsOnlyBool' => true, + 'containsOnlyCallable' => true, + 'containsOnlyClosedResource' => true, + 'containsOnlyFloat' => true, 'containsOnlyInstancesOf' => true, + 'containsOnlyInt' => true, + 'containsOnlyIterable' => true, + 'containsOnlyNull' => true, + 'containsOnlyNumeric' => true, + 'containsOnlyObject' => true, + 'containsOnlyResource' => true, + 'containsOnlyScalar' => true, + 'containsOnlyString' => true, 'countOf' => true, 'directoryExists' => true, 'equalTo' => true, @@ -250,15 +309,28 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i 'greaterThan' => true, 'greaterThanOrEqual' => true, 'identicalTo' => true, + 'isArray' => true, + 'isBool' => true, + 'isCallable' => true, + 'isClosedResource' => true, 'isEmpty' => true, 'isFalse' => true, 'isFinite' => true, + 'isFloat' => true, 'isInfinite' => true, 'isInstanceOf' => true, + 'isInt' => true, + 'isIterable' => true, 'isJson' => true, + 'isList' => true, 'isNan' => true, 'isNull' => true, + 'isNumeric' => true, + 'isObject' => true, 'isReadable' => true, + 'isResource' => true, + 'isScalar' => true, + 'isString' => true, 'isTrue' => true, 'isType' => true, 'isWritable' => true, @@ -278,6 +350,7 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i 'resetCount' => true, 'stringContains' => true, 'stringEndsWith' => true, + 'stringEqualsStringIgnoringLineEndings' => true, 'stringStartsWith' => true, // TestCase methods @@ -286,6 +359,9 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i 'atLeast' => true, 'atLeastOnce' => true, 'atMost' => true, + 'createStub' => true, + 'createConfiguredStub' => true, + 'createStubForIntersectionOfInterfaces' => true, 'exactly' => true, 'never' => true, 'once' => true, @@ -301,7 +377,16 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i ]; /** - * @var array>> + * @var array + */ + private const ALLOWED_VALUES = [ + self::CALL_TYPE_THIS => true, + self::CALL_TYPE_SELF => true, + self::CALL_TYPE_STATIC => true, + ]; + + /** + * @var array> */ private array $conversionMap = [ self::CALL_TYPE_THIS => [[T_OBJECT_OPERATOR, '->'], [T_VARIABLE, '$this']], @@ -309,9 +394,6 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer i self::CALL_TYPE_STATIC => [[T_DOUBLE_COLON, '::'], [T_STATIC, 'static']], ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { $codeSample = 'assertSame(1, 2); self::assertSame(1, 2); static::assertSame(1, 2); + static::assertTrue(false); } } '; @@ -331,6 +414,7 @@ public function testMe() [ new CodeSample($codeSample), new CodeSample($codeSample, ['call_type' => self::CALL_TYPE_THIS]), + new CodeSample($codeSample, ['methods' => ['assertTrue' => self::CALL_TYPE_THIS]]), ], null, 'Risky when PHPUnit methods are overridden or not accessible, or when project has PHPUnit incompatibilities.' @@ -347,47 +431,39 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { - $thisFixer = $this; - return new FixerConfigurationResolver([ (new FixerOptionBuilder('call_type', 'The call type to use for referring to PHPUnit methods.')) ->setAllowedTypes(['string']) - ->setAllowedValues(array_keys($this->allowedValues)) + ->setAllowedValues(array_keys(self::ALLOWED_VALUES)) ->setDefault('static') ->getOption(), (new FixerOptionBuilder('methods', 'Dictionary of `method` => `call_type` values that differ from the default strategy.')) - ->setAllowedTypes(['array']) - ->setAllowedValues([static function (array $option) use ($thisFixer): bool { + ->setAllowedTypes(['array']) + ->setAllowedValues([static function (array $option): bool { foreach ($option as $method => $value) { - if (!isset($thisFixer->staticMethods[$method])) { + if (!isset(self::STATIC_METHODS[$method])) { throw new InvalidOptionsException( - sprintf( - 'Unexpected "methods" key, expected any of "%s", got "%s".', - implode('", "', array_keys($thisFixer->staticMethods)), + \sprintf( + 'Unexpected "methods" key, expected any of %s, got "%s".', + Utils::naturalLanguageJoin(array_keys(self::STATIC_METHODS)), \gettype($method).'#'.$method ) ); } - if (!isset($thisFixer->allowedValues[$value])) { + if (!isset(self::ALLOWED_VALUES[$value])) { throw new InvalidOptionsException( - sprintf( - 'Unexpected value for method "%s", expected any of "%s", got "%s".', + \sprintf( + 'Unexpected value for method "%s", expected any of %s, got "%s".', $method, - implode('", "', array_keys($thisFixer->allowedValues)), + Utils::naturalLanguageJoin(array_keys(self::ALLOWED_VALUES)), \is_object($value) ? \get_class($value) : (null === $value ? 'null' : \gettype($value).'#'.$value) ) ); @@ -401,9 +477,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { $analyzer = new TokensAnalyzer($tokens); @@ -438,7 +511,7 @@ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $en } } - if (!$tokens[$index]->isGivenKind(T_STRING) || !isset($this->staticMethods[$tokens[$index]->getContent()])) { + if (!$tokens[$index]->isGivenKind(T_STRING) || !isset(self::STATIC_METHODS[$tokens[$index]->getContent()])) { continue; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixer.php index 36ecd33a..5e3de5af 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixer.php @@ -27,9 +27,6 @@ */ final class PhpUnitTestClassRequiresCoversFixer extends AbstractPhpUnitFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -50,6 +47,16 @@ public function testSomeTest() ); } + /** + * {@inheritdoc} + * + * Must run before PhpdocSeparationFixer. + */ + public function getPriority(): int + { + return 0; + } + protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void { $classIndex = $tokens->getPrevTokenOfKind($startIndex, [[T_CLASS]]); @@ -61,17 +68,21 @@ protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $en return; // don't add `@covers` annotation for abstract base classes } - $this->ensureIsDockBlockWithAnnotation( + $this->ensureIsDocBlockWithAnnotation( $tokens, $classIndex, 'coversNothing', - true, - false, [ 'covers', 'coversDefaultClass', 'coversNothing', - ] + ], + [ + 'phpunit\framework\attributes\coversclass', + 'phpunit\framework\attributes\coversnothing', + 'phpunit\framework\attributes\coversmethod', + 'phpunit\framework\attributes\coversfunction', + ], ); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php index 16872747..6a92e2e3 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -30,30 +31,26 @@ /** * @author Filippo Tessarotto * @author Julien Falque + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * comment_type?: 'all_multiline'|'phpdocs_like'|'phpdocs_only' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * comment_type: 'all_multiline'|'phpdocs_like'|'phpdocs_only' + * } */ final class AlignMultilineCommentFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { - /** - * @var null|int[] - */ - private $tokenKinds; + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; /** - * {@inheritdoc} + * @var null|list */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->tokenKinds = [T_DOC_COMMENT]; - if ('phpdocs_only' !== $this->configuration['comment_type']) { - $this->tokenKinds[] = T_COMMENT; - } - } + private ?array $tokenKinds = null; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -93,7 +90,7 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. + * Must run before CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocArrayTypeFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. * Must run after ArrayIndentationFixer. */ public function getPriority(): int @@ -101,17 +98,19 @@ public function getPriority(): int return 27; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound($this->tokenKinds); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->tokenKinds = [T_DOC_COMMENT]; + if ('phpdocs_only' !== $this->configuration['comment_type']) { + $this->tokenKinds[] = T_COMMENT; + } + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $lineEnding = $this->whitespacesConfig->getLineEnding(); @@ -132,11 +131,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $whitespace = Preg::replace('/\S/', '', $tokens[$previousIndex]->getContent()).$whitespace; } - if (1 !== Preg::match('/\R(\h*)$/', $whitespace, $matches)) { + if (!Preg::match('/\R(\h*)$/', $whitespace, $matches)) { continue; } - if ($token->isGivenKind(T_COMMENT) && 'all_multiline' !== $this->configuration['comment_type'] && 1 === Preg::match('/\R(?:\R|\s*[^\s\*])/', $token->getContent())) { + if ($token->isGivenKind(T_COMMENT) && 'all_multiline' !== $this->configuration['comment_type'] && Preg::match('/\R(?:\R|\s*[^\s\*])/', $token->getContent())) { continue; } @@ -167,9 +166,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixer.php index f8b7211a..2e5ab520 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixer.php @@ -18,6 +18,7 @@ use PhpCsFixer\DocBlock\Annotation; use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -30,16 +31,27 @@ /** * @author Graham Campbell * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * annotations?: list, + * case_sensitive?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * annotations: list, + * case_sensitive: bool + * } */ final class GeneralPhpdocAnnotationRemoveFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Configured annotations should be omitted from PHPDoc.', + 'Removes configured annotations from PHPDoc.', [ new CodeSample( 'isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { if (0 === \count($this->configuration['annotations'])) { @@ -132,14 +138,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('annotations', 'List of annotations to remove, e.g. `["author"]`.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setDefault([]) ->getOption(), (new FixerOptionBuilder('case_sensitive', 'Should annotations be case sensitive.')) @@ -158,9 +161,7 @@ private function getAnnotationsToRemove(DocBlock $doc): array return $doc->getAnnotationsOfType($this->configuration['annotations']); } - $typesToSearchFor = array_map(function (string $type): string { - return strtolower($type); - }, $this->configuration['annotations']); + $typesToSearchFor = array_map(static fn (string $type): string => strtolower($type), $this->configuration['annotations']); $annotations = []; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php index b2948be3..4926a4b5 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -28,11 +29,27 @@ use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; use Symfony\Component\OptionsResolver\Options; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * case_sensitive?: bool, + * fix_annotation?: bool, + * fix_inline?: bool, + * replacements?: array + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * case_sensitive: bool, + * fix_annotation: bool, + * fix_inline: bool, + * replacements: array + * } + */ final class GeneralPhpdocTagRenameFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -77,17 +94,11 @@ public function getPriority(): int return 11; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -100,8 +111,8 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setDefault(true) ->getOption(), (new FixerOptionBuilder('replacements', 'A map of tags to replace.')) - ->setAllowedTypes(['array']) - ->setNormalizer(static function (Options $options, $value): array { + ->setAllowedTypes(['array']) + ->setNormalizer(static function (Options $options, array $value): array { $normalizedValue = []; foreach ($value as $from => $to) { @@ -109,15 +120,8 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn throw new InvalidOptionsException('Tag to replace must be a string.'); } - if (!\is_string($to)) { - throw new InvalidOptionsException(sprintf( - 'Tag to replace to from "%s" must be a string.', - $from - )); - } - - if (1 !== Preg::match('#^\S+$#', $to) || str_contains($to, '*/')) { - throw new InvalidOptionsException(sprintf( + if (!Preg::match('#^\S+$#', $to) || str_contains($to, '*/')) { + throw new InvalidOptionsException(\sprintf( 'Tag "%s" cannot be replaced by invalid tag "%s".', $from, $to @@ -127,11 +131,11 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn $from = trim($from); $to = trim($to); - if (!$options['case_sensitive']) { + if (false === $options['case_sensitive']) { $lowercaseFrom = strtolower($from); if (isset($normalizedValue[$lowercaseFrom]) && $normalizedValue[$lowercaseFrom] !== $to) { - throw new InvalidOptionsException(sprintf( + throw new InvalidOptionsException(\sprintf( 'Tag "%s" cannot be configured to be replaced with several different tags when case sensitivity is off.', $from )); @@ -145,7 +149,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn foreach ($normalizedValue as $from => $to) { if (isset($normalizedValue[$to]) && $normalizedValue[$to] !== $to) { - throw new InvalidOptionsException(sprintf( + throw new InvalidOptionsException(\sprintf( 'Cannot change tag "%1$s" to tag "%2$s", as the tag "%2$s" is configured to be replaced to "%3$s".', $from, $to, @@ -165,9 +169,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { if (0 === \count($this->configuration['replacements'])) { @@ -175,18 +176,16 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } if (true === $this->configuration['fix_annotation']) { - if ($this->configuration['fix_inline']) { - $regex = '/"[^"]*"(*SKIP)(*FAIL)|\b(?<=@)(%s)\b/'; - } else { - $regex = '/"[^"]*"(*SKIP)(*FAIL)|(?configuration['fix_inline'] + ? '/"[^"]*"(*SKIP)(*FAIL)|\b(?<=@)(%s)\b/' + : '/"[^"]*"(*SKIP)(*FAIL)|(?configuration['case_sensitive']; $replacements = $this->configuration['replacements']; - $regex = sprintf($regex, implode('|', array_keys($replacements))); + $regex = \sprintf($regex, implode('|', array_keys($replacements))); if ($caseInsensitive) { $regex .= 'i'; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixer.php index ec3dadda..33fb2d0e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixer.php @@ -26,17 +26,11 @@ */ final class NoBlankLinesAfterPhpdocFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -68,9 +62,6 @@ public function getPriority(): int return -20; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { static $forbiddenSuccessors = [ @@ -80,7 +71,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void T_DECLARE, T_DOC_COMMENT, T_GOTO, + T_INCLUDE, + T_INCLUDE_ONCE, T_NAMESPACE, + T_REQUIRE, + T_REQUIRE_ONCE, T_RETURN, T_THROW, T_USE, diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php index 843bf01d..27d7af64 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php @@ -19,13 +19,11 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; final class NoEmptyPhpdocFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -37,25 +35,19 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer, PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, NoSuperfluousPhpdocTagsFixer, PhpUnitNoExpectationAnnotationFixer, PhpUnitTestAnnotationFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocIndentFixer, PhpdocNoAccessFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. + * Must run before NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer, PhpdocAlignFixer. + * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, NoSuperfluousPhpdocTagsFixer, PhpUnitNoExpectationAnnotationFixer, PhpUnitTestAnnotationFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocIndentFixer, PhpdocNoAccessFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. */ public function getPriority(): int { return 3; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -63,9 +55,30 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - if (Preg::match('#^/\*\*[\s\*]*\*/$#', $token->getContent())) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); + if (!Preg::match('#^/\*\*[\s\*]*\*/$#', $token->getContent())) { + continue; } + + if ( + $tokens[$index - 1]->isGivenKind([T_OPEN_TAG, T_WHITESPACE]) + && substr_count($tokens[$index - 1]->getContent(), "\n") > 0 + && $tokens[$index + 1]->isGivenKind(T_WHITESPACE) + && Preg::match('/^\R/', $tokens[$index + 1]->getContent()) + ) { + $tokens[$index - 1] = new Token([ + $tokens[$index - 1]->getId(), + Preg::replace('/\h*$/', '', $tokens[$index - 1]->getContent()), + ]); + + $newContent = Preg::replace('/^\R/', '', $tokens[$index + 1]->getContent()); + if ('' === $newContent) { + $tokens->clearAt($index + 1); + } else { + $tokens[$index + 1] = new Token([T_WHITESPACE, $newContent]); + } + } + + $tokens->clearTokenAndMergeSurroundingWhitespace($index); } } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php index 631c9e80..466acbdd 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php @@ -19,6 +19,7 @@ use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\DocBlock\TypeExpression; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -26,28 +27,59 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; +/** + * @phpstan-type _TypeInfo array{ + * types: list, + * allows_null: bool, + * } + * @phpstan-type _DocumentElement array{ + * index: int, + * type: 'classy'|'function'|'property', + * modifiers: array, + * types: array, + * } + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * allow_hidden_params?: bool, + * allow_mixed?: bool, + * allow_unused_params?: bool, + * remove_inheritdoc?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * allow_hidden_params: bool, + * allow_mixed: bool, + * allow_unused_params: bool, + * remove_inheritdoc: bool + * } + */ final class NoSuperfluousPhpdocTagsFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + /** @var _TypeInfo */ private const NO_TYPE_INFO = [ 'types' => [], 'allows_null' => true, ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'Removes `@param`, `@return` and `@var` tags that don\'t provide any useful information.', [ - new CodeSample(' true]), - new CodeSample(' true], + ), + new CodeSample( + ' true]), - new CodeSample(' true], + ), + new CodeSample( + ' true]), +', + ['allow_hidden_params' => true], + ), + new CodeSample( + ' true], + ), ] ); } @@ -100,17 +157,11 @@ public function getPriority(): int return 6; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); @@ -121,7 +172,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $currentSymbolEndIndex = null; foreach ($namespaceUseAnalyzer->getDeclarationsFromTokens($tokens) as $namespaceUseAnalysis) { - $shortNames[strtolower($namespaceUseAnalysis->getShortName())] = '\\'.strtolower($namespaceUseAnalysis->getFullName()); + $shortNames[strtolower($namespaceUseAnalysis->getShortName())] = strtolower($namespaceUseAnalysis->getFullName()); } $symbolKinds = [T_CLASS, T_INTERFACE]; @@ -167,10 +218,15 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $content = $this->removeSuperfluousInheritDoc($content); } + $namespace = (new NamespacesAnalyzer())->getNamespaceAt($tokens, $index)->getFullName(); + if ('' === $namespace) { + $namespace = null; + } + if ('function' === $documentedElement['type']) { - $content = $this->fixFunctionDocComment($content, $tokens, $documentedElement, $currentSymbol, $shortNames); + $content = $this->fixFunctionDocComment($content, $tokens, $documentedElement, $namespace, $currentSymbol, $shortNames); } elseif ('property' === $documentedElement['type']) { - $content = $this->fixPropertyDocComment($content, $tokens, $documentedElement, $currentSymbol, $shortNames); + $content = $this->fixPropertyDocComment($content, $tokens, $documentedElement, $namespace, $currentSymbol, $shortNames); } elseif ('classy' === $documentedElement['type']) { $content = $this->fixClassDocComment($content, $documentedElement); } else { @@ -187,9 +243,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -201,6 +254,10 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setAllowedTypes(['bool']) ->setDefault(false) ->getOption(), + (new FixerOptionBuilder('allow_hidden_params', 'Whether `param` annotation for hidden params in method signature are allowed.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) // @TODO set to `true` on 4.0 + ->getOption(), (new FixerOptionBuilder('allow_unused_params', 'Whether `param` annotation without actual signature is allowed (`true`) or considered superfluous (`false`).')) ->setAllowedTypes(['bool']) ->setDefault(false) @@ -209,12 +266,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn } /** - * @return null|array{ - * index: int, - * type: 'classy'|'function'|'property', - * modifiers: array, - * types: array, - * } + * @return null|_DocumentElement */ private function findDocumentedElement(Tokens $tokens, int $docCommentIndex): ?array { @@ -267,7 +319,7 @@ private function findDocumentedElement(Tokens $tokens, int $docCommentIndex): ?a return $element; } - if ($tokens[$index]->isGivenKind(T_FUNCTION)) { + if ($tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) { $element['index'] = $index; $element['type'] = 'function'; @@ -296,18 +348,15 @@ private function findDocumentedElement(Tokens $tokens, int $docCommentIndex): ?a } /** - * @param array{ - * index: int, - * type: 'function', - * modifiers: array, - * types: array, - * } $element - * @param array $shortNames + * @param _DocumentElement&array{type: 'function'} $element + * @param null|non-empty-string $namespace + * @param array $shortNames */ private function fixFunctionDocComment( string $content, Tokens $tokens, array $element, + ?string $namespace, ?string $currentSymbol, array $shortNames ): string { @@ -326,7 +375,7 @@ private function fixFunctionDocComment( $argumentName = $annotation->getVariableName(); if (null === $argumentName) { - if ($this->annotationIsSuperfluous($annotation, self::NO_TYPE_INFO, $currentSymbol, $shortNames)) { + if ($this->annotationIsSuperfluous($annotation, self::NO_TYPE_INFO, $namespace, $currentSymbol, $shortNames)) { $annotation->remove(); } @@ -337,7 +386,7 @@ private function fixFunctionDocComment( continue; } - if (!isset($argumentsInfo[$argumentName]) || $this->annotationIsSuperfluous($annotation, $argumentsInfo[$argumentName], $currentSymbol, $shortNames)) { + if (!isset($argumentsInfo[$argumentName]) || $this->annotationIsSuperfluous($annotation, $argumentsInfo[$argumentName], $namespace, $currentSymbol, $shortNames)) { $annotation->remove(); } } @@ -345,7 +394,7 @@ private function fixFunctionDocComment( $returnTypeInfo = $this->getReturnTypeInfo($tokens, $closingParenthesisIndex); foreach ($docBlock->getAnnotationsOfType('return') as $annotation) { - if ($this->annotationIsSuperfluous($annotation, $returnTypeInfo, $currentSymbol, $shortNames)) { + if ($this->annotationIsSuperfluous($annotation, $returnTypeInfo, $namespace, $currentSymbol, $shortNames)) { $annotation->remove(); } } @@ -356,18 +405,15 @@ private function fixFunctionDocComment( } /** - * @param array{ - * index: int, - * type: 'property', - * modifiers: array, - * types: array, - * } $element - * @param array $shortNames + * @param _DocumentElement&array{type: 'property'} $element + * @param null|non-empty-string $namespace + * @param array $shortNames */ private function fixPropertyDocComment( string $content, Tokens $tokens, array $element, + ?string $namespace, ?string $currentSymbol, array $shortNames ): string { @@ -380,7 +426,7 @@ private function fixPropertyDocComment( $docBlock = new DocBlock($content); foreach ($docBlock->getAnnotationsOfType('var') as $annotation) { - if ($this->annotationIsSuperfluous($annotation, $propertyTypeInfo, $currentSymbol, $shortNames)) { + if ($this->annotationIsSuperfluous($annotation, $propertyTypeInfo, $namespace, $currentSymbol, $shortNames)) { $annotation->remove(); } } @@ -389,12 +435,7 @@ private function fixPropertyDocComment( } /** - * @param array{ - * index: int, - * type: 'classy', - * modifiers: array, - * types: array, - * } $element + * @param _DocumentElement&array{type: 'classy'} $element */ private function fixClassDocComment(string $content, array $element): string { @@ -406,7 +447,7 @@ private function fixClassDocComment(string $content, array $element): string } /** - * @return array, allows_null: bool}> + * @return array */ private function getArgumentsInfo(Tokens $tokens, int $start, int $end): array { @@ -419,7 +460,7 @@ private function getArgumentsInfo(Tokens $tokens, int $start, int $end): array continue; } - $beforeArgumentIndex = $tokens->getPrevTokenOfKind($index, ['(', ',']); + $beforeArgumentIndex = $tokens->getPrevTokenOfKind($index, ['(', ',', [CT::T_ATTRIBUTE_CLOSE]]); $typeIndex = $tokens->getNextMeaningfulToken($beforeArgumentIndex); if ($typeIndex !== $index) { @@ -441,11 +482,22 @@ private function getArgumentsInfo(Tokens $tokens, int $start, int $end): array $argumentsInfo[$token->getContent()] = $info; } + // virtualise "hidden params" as if they would be regular ones + if (true === $this->configuration['allow_hidden_params']) { + $paramsString = $tokens->generatePartialCode($start, $end); + Preg::matchAll('|/\*[^$]*(\$\w+)[^*]*\*/|', $paramsString, $matches); + + /** @var non-empty-string $match */ + foreach ($matches[1] as $match) { + $argumentsInfo[$match] = self::NO_TYPE_INFO; // HINT: one could try to extract actual type for hidden param, for now we only indicate it's existence + } + } + return $argumentsInfo; } /** - * @return array{types: list, allows_null: bool} + * @return _TypeInfo */ private function getReturnTypeInfo(Tokens $tokens, int $closingParenthesisIndex): array { @@ -459,7 +511,7 @@ private function getReturnTypeInfo(Tokens $tokens, int $closingParenthesisIndex) /** * @param int $index The index of the first token of the type hint * - * @return array{types: list, allows_null: bool} + * @return _TypeInfo */ private function parseTypeHint(Tokens $tokens, int $index): array { @@ -510,23 +562,26 @@ private function parseTypeHint(Tokens $tokens, int $index): array } /** + * @param _TypeInfo $info + * @param null|non-empty-string $namespace * @param array $symbolShortNames */ private function annotationIsSuperfluous( Annotation $annotation, array $info, + ?string $namespace, ?string $currentSymbol, array $symbolShortNames ): bool { if ('param' === $annotation->getTag()->getName()) { - $regex = '{@param(?:\s+'.TypeExpression::REGEX_TYPES.')?(?:\s+(?:\&\s*)?(?:\.{3}\s*)?\$\S+)?(?:\s+(?(?!\*+\/)\S+))?}sx'; + $regex = '{\*\h*@param(?:\h+'.TypeExpression::REGEX_TYPES.')?(?!\S)(?:\h+(?:\&\h*)?(?:\.{3}\h*)?\$\S+)?(?:\s+(?(?!\*+\/)\S+))?}s'; } elseif ('var' === $annotation->getTag()->getName()) { - $regex = '{@var(?:\s+'.TypeExpression::REGEX_TYPES.')?(?:\s+\$\S+)?(?:\s+(?(?!\*\/)\S+))?}sx'; + $regex = '{\*\h*@var(?:\h+'.TypeExpression::REGEX_TYPES.')?(?!\S)(?:\h+\$\S+)?(?:\s+(?(?!\*\/)\S+))?}s'; } else { - $regex = '{@return(?:\s+'.TypeExpression::REGEX_TYPES.')?(?:\s+(?(?!\*\/)\S+))?}sx'; + $regex = '{\*\h*@return(?:\h+'.TypeExpression::REGEX_TYPES.')?(?!\S)(?:\s+(?(?!\*\/)\S+))?}s'; } - if (1 !== Preg::match($regex, $annotation->getContent(), $matches)) { + if (!Preg::match($regex, $annotation->getContent(), $matches)) { // Unable to match the annotation, it must be malformed or has unsupported format. // Either way we don't want to tinker with it. return false; @@ -541,9 +596,9 @@ private function annotationIsSuperfluous( return true; } - $annotationTypes = $this->toComparableNames($annotation->getTypes(), $currentSymbol, $symbolShortNames); + $annotationTypes = $this->toComparableNames($annotation->getTypes(), $namespace, $currentSymbol, $symbolShortNames); - if (['null'] === $annotationTypes) { + if (['null'] === $annotationTypes && ['null'] !== $info['types']) { return false; } @@ -557,7 +612,18 @@ private function annotationIsSuperfluous( $actualTypes[] = 'null'; } - return $annotationTypes === $this->toComparableNames($actualTypes, $currentSymbol, $symbolShortNames); + $actualTypes = $this->toComparableNames($actualTypes, $namespace, $currentSymbol, $symbolShortNames); + + if ($annotationTypes === $actualTypes) { + return true; + } + + // retry comparison with annotation type unioned with null + // phpstan implies the null presence from the native type + $annotationTypes = array_merge($annotationTypes, ['null']); + sort($annotationTypes); + + return $actualTypes === $annotationTypes; } /** @@ -566,29 +632,50 @@ private function annotationIsSuperfluous( * Converts given types to lowercase, replaces imports aliases with * their matching FQCN, and finally sorts the result. * - * @param string[] $types The types to normalize + * @param list $types The types to normalize + * @param null|non-empty-string $namespace * @param array $symbolShortNames The imports aliases * - * @return array The normalized types + * @return list The normalized types */ - private function toComparableNames(array $types, ?string $currentSymbol, array $symbolShortNames): array + private function toComparableNames(array $types, ?string $namespace, ?string $currentSymbol, array $symbolShortNames): array { + if (isset($types[0][0]) && '?' === $types[0][0]) { + $types = [ + substr($types[0], 1), + 'null', + ]; + } + $normalized = array_map( - static function (string $type) use ($currentSymbol, $symbolShortNames): string { + function (string $type) use ($namespace, $currentSymbol, $symbolShortNames): string { + if (str_contains($type, '&')) { + $intersects = explode('&', $type); + + $intersects = $this->toComparableNames($intersects, $namespace, $currentSymbol, $symbolShortNames); + + return implode('&', $intersects); + } + if ('self' === $type && null !== $currentSymbol) { $type = $currentSymbol; } $type = strtolower($type); - if (str_contains($type, '&')) { - $intersects = explode('&', $type); - sort($intersects); + if (isset($symbolShortNames[$type])) { + return $symbolShortNames[$type]; // always FQCN /wo leading backslash and in lower-case + } - return implode('&', $intersects); + if (str_starts_with($type, '\\')) { + return substr($type, 1); + } + + if (null !== $namespace && !(new TypeAnalysis($type))->isReservedType()) { + $type = strtolower($namespace).'\\'.$type; } - return $symbolShortNames[$type] ?? $type; + return $type; }, $types ); @@ -649,6 +736,9 @@ private function removeSuperfluousInheritDoc(string $docComment): string ~ix', '$1$2', $docComment); } + /** + * @param _DocumentElement $element + */ private function removeSuperfluousModifierAnnotation(DocBlock $docBlock, array $element): void { foreach (['abstract' => T_ABSTRACT, 'final' => T_FINAL] as $annotationType => $modifierToken) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixer.php index 8ac425b5..12e74bee 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixer.php @@ -18,6 +18,7 @@ use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\DocBlock\Line; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -27,17 +28,27 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; +use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * only_untyped?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * only_untyped: bool + * } */ final class PhpdocAddMissingParamAnnotationFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -90,17 +101,11 @@ public function getPriority(): int return 10; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $argumentsAnalyzer = new ArgumentsAnalyzer(); @@ -114,7 +119,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $tokenContent = $token->getContent(); - if (false !== stripos($tokenContent, 'inheritdoc')) { + if (str_contains(strtolower($tokenContent), strtolower('inheritdoc'))) { continue; } @@ -137,7 +142,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void T_PROTECTED, T_PUBLIC, T_STATIC, - T_VAR, ])) { $index = $tokens->getNextMeaningfulToken($index); } @@ -169,7 +173,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void foreach ($doc->getAnnotationsOfType('param') as $annotation) { $pregMatched = Preg::match('/^[^$]+(\$\w+).*$/s', $annotation->getContent(), $matches); - if (1 === $pregMatched) { + if ($pregMatched) { unset($arguments[$matches[1]]); } @@ -189,13 +193,13 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $newLines = []; foreach ($arguments as $argument) { - $type = $argument['type'] ?: 'mixed'; + $type = '' !== $argument['type'] ? $argument['type'] : 'mixed'; if (!str_starts_with($type, '?') && 'null' === strtolower($argument['default'])) { $type = 'null|'.$type; } - $newLines[] = new Line(sprintf( + $newLines[] = new Line(\sprintf( '%s* @param %s %s%s', $indent, $type, @@ -206,7 +210,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void array_splice( $lines, - $lastParamLine ? $lastParamLine + 1 : $linesCount - 1, + $lastParamLine > 0 ? $lastParamLine + 1 : $linesCount - 1, 0, $newLines ); @@ -215,9 +219,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -244,7 +245,16 @@ private function prepareArgumentInformation(Tokens $tokens, int $start, int $end for ($index = $start; $index <= $end; ++$index) { $token = $tokens[$index]; - if ($token->isComment() || $token->isWhitespace()) { + if ( + $token->isComment() + || $token->isWhitespace() + || $token->isGivenKind([ + CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE, + CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, + CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, + ]) + || (\defined('T_READONLY') && $token->isGivenKind(T_READONLY)) + ) { continue; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAlignFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAlignFixer.php index 01d3a426..ba54d90a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAlignFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAlignFixer.php @@ -18,8 +18,8 @@ use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\DocBlock\TypeExpression; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -29,6 +29,7 @@ use PhpCsFixer\Preg; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; /** * @author Fabien Potencier @@ -36,9 +37,26 @@ * @author Sebastiaan Stok * @author Graham Campbell * @author Dariusz Rumiński + * @author Jakub Kwaśniewski + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * align?: 'left'|'vertical', + * spacing?: array|int, + * tags?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * align: 'left'|'vertical', + * spacing: array|int, + * tags: list + * } */ final class PhpdocAlignFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -49,16 +67,14 @@ final class PhpdocAlignFixer extends AbstractFixer implements ConfigurableFixerI */ public const ALIGN_VERTICAL = 'vertical'; - private const ALIGNABLE_TAGS = [ + private const DEFAULT_TAGS = [ + 'method', 'param', 'property', - 'property-read', - 'property-write', 'return', 'throws', 'type', 'var', - 'method', ]; private const TAGS_WITH_NAME = [ @@ -66,95 +82,82 @@ final class PhpdocAlignFixer extends AbstractFixer implements ConfigurableFixerI 'property', 'property-read', 'property-write', + 'phpstan-param', + 'phpstan-property', + 'phpstan-property-read', + 'phpstan-property-write', + 'phpstan-assert', + 'phpstan-assert-if-true', + 'phpstan-assert-if-false', + 'psalm-param', + 'psalm-param-out', + 'psalm-property', + 'psalm-property-read', + 'psalm-property-write', + 'psalm-assert', + 'psalm-assert-if-true', + 'psalm-assert-if-false', ]; private const TAGS_WITH_METHOD_SIGNATURE = [ 'method', + 'phpstan-method', + 'psalm-method', ]; - /** - * @var string - */ - private $regex; - - /** - * @var string - */ - private $regexCommentLine; - - /** - * @var string - */ - private $align; + private const DEFAULT_SPACING = 1; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); + private const DEFAULT_SPACING_KEY = '_default'; - $tagsWithNameToAlign = array_intersect($this->configuration['tags'], self::TAGS_WITH_NAME); - $tagsWithMethodSignatureToAlign = array_intersect($this->configuration['tags'], self::TAGS_WITH_METHOD_SIGNATURE); - $tagsWithoutNameToAlign = array_diff($this->configuration['tags'], $tagsWithNameToAlign, $tagsWithMethodSignatureToAlign); - $types = []; + private string $regex; - $indent = '(?P(?:\ {2}|\t)*)'; + private string $regexCommentLine; - // e.g. @param <$var> - if ([] !== $tagsWithNameToAlign) { - $types[] = '(?P'.implode('|', $tagsWithNameToAlign).')\s+(?P(?:'.TypeExpression::REGEX_TYPES.')?)\s+(?P(?:&|\.{3})?\$\S+)'; - } - - // e.g. @return - if ([] !== $tagsWithoutNameToAlign) { - $types[] = '(?P'.implode('|', $tagsWithoutNameToAlign).')\s+(?P(?:'.TypeExpression::REGEX_TYPES.')?)'; - } - - // e.g. @method - if ([] !== $tagsWithMethodSignatureToAlign) { - $types[] = '(?P'.implode('|', $tagsWithMethodSignatureToAlign).')(\s+(?Pstatic))?(\s+(?P[^\s(]+)|)\s+(?P.+\))'; - } - - // optional - $desc = '(?:\s+(?P\V*))'; - - $this->regex = '/^'.$indent.'\ \*\ @(?J)(?:'.implode('|', $types).')'.$desc.'\s*$/ux'; - $this->regexCommentLine = '/^'.$indent.' \*(?! @)(?:\s+(?P\V+))(?align = $this->configuration['align']; - } + private string $align; /** - * {@inheritdoc} + * same spacing for all or specific for different tags. + * + * @var array|int */ + private $spacing = 1; + public function getDefinition(): FixerDefinitionInterface { $code = <<<'EOF' - self::ALIGN_VERTICAL]), new CodeSample($code, ['align' => self::ALIGN_LEFT]), - ] + new CodeSample($code, ['align' => self::ALIGN_LEFT, 'spacing' => 2]), + new CodeSample($code, ['align' => self::ALIGN_LEFT, 'spacing' => ['param' => 2]]), + ], ); } /** * {@inheritdoc} * - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAnnotationWithoutDotFixer, PhpdocIndentFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocReturnSelfReferenceFixer, PhpdocScalarFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. + * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAnnotationWithoutDotFixer, PhpdocArrayTypeFixer, PhpdocIndentFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocScalarFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. */ public function getPriority(): int { @@ -168,17 +171,45 @@ public function getPriority(): int return -42; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $tagsWithNameToAlign = array_intersect($this->configuration['tags'], self::TAGS_WITH_NAME); + $tagsWithMethodSignatureToAlign = array_intersect($this->configuration['tags'], self::TAGS_WITH_METHOD_SIGNATURE); + $tagsWithoutNameToAlign = array_diff($this->configuration['tags'], $tagsWithNameToAlign, $tagsWithMethodSignatureToAlign); + + $indentRegex = '^(?P(?:\ {2}|\t)*)\ ?'; + + $types = []; + + // e.g. @param <$var> + if ([] !== $tagsWithNameToAlign) { + $types[] = '(?P'.implode('|', $tagsWithNameToAlign).')\s+(?P(?:'.TypeExpression::REGEX_TYPES.')?)\s*(?P(?:&|\.{3})?\$\S+)'; + } + + // e.g. @return + if ([] !== $tagsWithoutNameToAlign) { + $types[] = '(?P'.implode('|', $tagsWithoutNameToAlign).')\s+(?P(?:'.TypeExpression::REGEX_TYPES.')?)'; + } + + // e.g. @method + if ([] !== $tagsWithMethodSignatureToAlign) { + $types[] = '(?P'.implode('|', $tagsWithMethodSignatureToAlign).')(\s+(?Pstatic))?(\s+(?P(?:'.TypeExpression::REGEX_TYPES.')?))\s+(?P.+\))'; + } + + // optional + $desc = '(?:\s+(?P\V*))'; + + $this->regex = '/'.$indentRegex.'\*\h*@(?J)(?:'.implode('|', $types).')'.$desc.'\h*\r?$/'; + $this->regexCommentLine = '/'.$indentRegex.'\*(?!\h?+@)(?:\s+(?P\V+))(?align = $this->configuration['align']; + $this->spacing = $this->configuration['spacing']; + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -196,24 +227,26 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { - $tags = new FixerOptionBuilder('tags', 'The tags that should be aligned.'); + $allowPositiveIntegers = static function ($value) { + $spacings = \is_array($value) ? $value : [$value]; + foreach ($spacings as $val) { + if (\is_int($val) && $val <= 0) { + throw new InvalidOptionsException('The option "spacing" is invalid. All spacings must be greater than zero.'); + } + } + + return true; + }; + + $tags = new FixerOptionBuilder( + 'tags', + 'The tags that should be aligned. Allowed values are tags with name (`\''.implode('\', \'', self::TAGS_WITH_NAME).'\'`), tags with method signature (`\''.implode('\', \'', self::TAGS_WITH_METHOD_SIGNATURE).'\'`) and any custom tag with description (e.g. `@tag `).' + ); $tags - ->setAllowedTypes(['array']) - ->setAllowedValues([new AllowedValueSubset(self::ALIGNABLE_TAGS)]) - ->setDefault([ - 'method', - 'param', - 'property', - 'return', - 'throws', - 'type', - 'var', - ]) + ->setAllowedTypes(['string[]']) + ->setDefault(self::DEFAULT_TAGS) ; $align = new FixerOptionBuilder('align', 'How comments should be aligned.'); @@ -223,7 +256,16 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setDefault(self::ALIGN_VERTICAL) ; - return new FixerConfigurationResolver([$tags->getOption(), $align->getOption()]); + $spacing = new FixerOptionBuilder( + 'spacing', + 'Spacing between tag, hint, comment, signature, etc. You can set same spacing for all tags using a positive integer or different spacings for different tags using an associative array of positive integers `[\'tagA\' => spacingForA, \'tagB\' => spacingForB]`. If you want to define default spacing to more than 1 space use `_default` key in config array, e.g.: `[\'tagA\' => spacingForA, \'tagB\' => spacingForB, \'_default\' => spacingForAllOthers]`.' + ); + $spacing->setAllowedTypes(['int', 'array']) + ->setAllowedValues([$allowPositiveIntegers]) + ->setDefault(self::DEFAULT_SPACING) + ; + + return new FixerConfigurationResolver([$tags->getOption(), $align->getOption(), $spacing->getOption()]); } private function fixDocBlock(DocBlock $docBlock): void @@ -264,27 +306,31 @@ private function fixDocBlock(DocBlock $docBlock): void continue; } - $hasStatic = $hasStatic || $item['static']; + $hasStatic = $hasStatic || '' !== $item['static']; $tagMax = max($tagMax, \strlen($item['tag'])); $hintMax = max($hintMax, \strlen($item['hint'])); $varMax = max($varMax, \strlen($item['var'])); } + $itemOpeningLine = null; + $currTag = null; + $spacingForTag = $this->spacingForTag($currTag); // update foreach ($items as $j => $item) { if (null === $item['tag']) { if ('@' === $item['desc'][0]) { - $docBlock->getLine($current + $j)->setContent($item['indent'].' * '.$item['desc'].$lineEnding); + $line = $item['indent'].' * '.$item['desc']; + $docBlock->getLine($current + $j)->setContent($line.$lineEnding); continue; } - $extraIndent = 2; + $extraIndent = 2 * $spacingForTag; - if (\in_array($currTag, self::TAGS_WITH_NAME, true) || \in_array($currTag, self::TAGS_WITH_METHOD_SIGNATURE, true)) { - $extraIndent = 3; + if (\in_array($itemOpeningLine['tag'], self::TAGS_WITH_NAME, true) || \in_array($itemOpeningLine['tag'], self::TAGS_WITH_METHOD_SIGNATURE, true)) { + $extraIndent += $varMax + $spacingForTag; } if ($hasStatic) { @@ -293,21 +339,25 @@ private function fixDocBlock(DocBlock $docBlock): void $line = $item['indent'] - .' * ' + .' * ' + .('' !== $itemOpeningLine['hint'] ? ' ' : '') .$this->getIndent( - $tagMax + $hintMax + $varMax + $extraIndent, + $tagMax + $hintMax + $extraIndent, $this->getLeftAlignedDescriptionIndent($items, $j) ) - .$item['desc'] - .$lineEnding; + .$item['desc']; - $docBlock->getLine($current + $j)->setContent($line); + $docBlock->getLine($current + $j)->setContent($line.$lineEnding); continue; } $currTag = $item['tag']; + $spacingForTag = $this->spacingForTag($currTag); + + $itemOpeningLine = $item; + $line = $item['indent'] .' * @' @@ -316,55 +366,62 @@ private function fixDocBlock(DocBlock $docBlock): void if ($hasStatic) { $line .= $this->getIndent( - $tagMax - \strlen($item['tag']) + 1, - $item['static'] ? 1 : 0 + $tagMax - \strlen($item['tag']) + $spacingForTag, + '' !== $item['static'] ? $spacingForTag : 0 ) - .($item['static'] ?: $this->getIndent(6 /* \strlen('static') */, 0)); - $hintVerticalAlignIndent = 1; + .('' !== $item['static'] ? $item['static'] : $this->getIndent(6 /* \strlen('static') */, 0)); + $hintVerticalAlignIndent = $spacingForTag; } else { - $hintVerticalAlignIndent = $tagMax - \strlen($item['tag']) + 1; + $hintVerticalAlignIndent = $tagMax - \strlen($item['tag']) + $spacingForTag; } $line .= $this->getIndent( $hintVerticalAlignIndent, - $item['hint'] ? 1 : 0 + '' !== $item['hint'] ? $spacingForTag : 0 ) .$item['hint']; - if (!empty($item['var'])) { + if ('' !== $item['var']) { $line .= - $this->getIndent(($hintMax ?: -1) - \strlen($item['hint']) + 1) + $this->getIndent((0 !== $hintMax ? $hintMax : -1) - \strlen($item['hint']) + $spacingForTag, $spacingForTag) .$item['var'] .( - !empty($item['desc']) - ? $this->getIndent($varMax - \strlen($item['var']) + 1).$item['desc'].$lineEnding - : $lineEnding + '' !== $item['desc'] + ? $this->getIndent($varMax - \strlen($item['var']) + $spacingForTag, $spacingForTag).$item['desc'] + : '' ); - } elseif (!empty($item['desc'])) { - $line .= $this->getIndent($hintMax - \strlen($item['hint']) + 1).$item['desc'].$lineEnding; - } else { - $line .= $lineEnding; + } elseif ('' !== $item['desc']) { + $line .= $this->getIndent($hintMax - \strlen($item['hint']) + $spacingForTag, $spacingForTag).$item['desc']; } - $docBlock->getLine($current + $j)->setContent($line); + $docBlock->getLine($current + $j)->setContent($line.$lineEnding); } } } + private function spacingForTag(?string $tag): int + { + return (\is_int($this->spacing)) + ? $this->spacing + : ($this->spacing[$tag] ?? $this->spacing[self::DEFAULT_SPACING_KEY] ?? self::DEFAULT_SPACING); + } + /** - * @return null|array + * @TODO Introduce proper DTO instead of an array + * + * @return null|array{indent: null|string, tag: null|string, hint: string, var: null|string, static: string, desc?: null|string} */ private function getMatches(string $line, bool $matchCommentOnly = false): ?array { if (Preg::match($this->regex, $line, $matches)) { - if (!empty($matches['tag2'])) { + if (isset($matches['tag2']) && '' !== $matches['tag2']) { $matches['tag'] = $matches['tag2']; $matches['hint'] = $matches['hint2']; $matches['var'] = ''; } - if (!empty($matches['tag3'])) { + if (isset($matches['tag3']) && '' !== $matches['tag3']) { $matches['tag'] = $matches['tag3']; $matches['hint'] = $matches['hint3']; $matches['var'] = $matches['signature']; @@ -381,9 +438,7 @@ private function getMatches(string $line, bool $matchCommentOnly = false): ?arra $matches['hint'] = trim($matches['hint']); } - if (!isset($matches['static'])) { - $matches['static'] = ''; - } + $matches['static'] ??= ''; return $matches; } @@ -408,7 +463,7 @@ private function getIndent(int $verticalAlignIndent, int $leftAlignIndent = 1): } /** - * @param array[] $items + * @param non-empty-list $items */ private function getLeftAlignedDescriptionIndent(array $items, int $index): int { @@ -430,18 +485,20 @@ private function getLeftAlignedDescriptionIndent(array $items, int $index): int return 0; } + $spacingForTag = $this->spacingForTag($item['tag']); + // Indent according to existing values: return - $this->getSentenceIndent($item['static']) + - $this->getSentenceIndent($item['tag']) + - $this->getSentenceIndent($item['hint']) + - $this->getSentenceIndent($item['var']); + $this->getSentenceIndent($item['static'], $spacingForTag) + + $this->getSentenceIndent($item['tag'], $spacingForTag) + + $this->getSentenceIndent($item['hint'], $spacingForTag) + + $this->getSentenceIndent($item['var'], $spacingForTag); } /** * Get indent for sentence. */ - private function getSentenceIndent(?string $sentence): int + private function getSentenceIndent(?string $sentence, int $spacingForTag = 1): int { if (null === $sentence) { return 0; @@ -449,6 +506,6 @@ private function getSentenceIndent(?string $sentence): int $length = \strlen($sentence); - return 0 === $length ? 0 : $length + 1; + return 0 === $length ? 0 : $length + $spacingForTag; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixer.php index 02451992..756086b5 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixer.php @@ -29,13 +29,10 @@ final class PhpdocAnnotationWithoutDotFixer extends AbstractFixer { /** - * @var string[] + * @var list */ private array $tags = ['throws', 'return', 'param', 'internal', 'deprecated', 'var', 'type']; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -52,7 +49,7 @@ function foo ($bar) {} /** * {@inheritdoc} * - * Must run before PhpdocAlignFixer, PhpdocTypesFixer, PhpdocTypesOrderFixer. + * Must run before PhpdocAlignFixer. * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocToCommentFixer. */ public function getPriority(): int @@ -60,17 +57,11 @@ public function getPriority(): int return 17; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -104,8 +95,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $content = $annotation->getContent(); if ( - 1 !== Preg::match('/[.。]\h*$/u', $content) - || 0 !== Preg::match('/[.。](?!\h*$)/u', $content, $matches) + !Preg::match('/[.。]\h*$/u', $content) + || Preg::match('/[.。](?!\h*$)/u', $content, $matches) ) { continue; } @@ -115,13 +106,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $startLine = $doc->getLine($annotation->getStart()); $optionalTypeRegEx = $annotation->supportTypes() - ? sprintf('(?:%s\s+(?:\$\w+\s+)?)?', preg_quote(implode('|', $annotation->getTypes()), '/')) + ? \sprintf('(?:%s\s+(?:\$\w+\s+)?)?', preg_quote(implode('|', $annotation->getTypes()), '/')) : ''; $content = Preg::replaceCallback( '/^(\s*\*\s*@\w+\s+'.$optionalTypeRegEx.')(\p{Lu}?(?=\p{Ll}|\p{Zs}))(.*)$/', - static function (array $matches): string { - return $matches[1].mb_strtolower($matches[2]).$matches[3]; - }, + static fn (array $matches): string => $matches[1].mb_strtolower($matches[2]).$matches[3], $startLine->getContent(), 1 ); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php new file mode 100644 index 00000000..f3f64c11 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php @@ -0,0 +1,92 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Phpdoc; + +use PhpCsFixer\AbstractPhpdocTypesFixer; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Tokens; + +final class PhpdocArrayTypeFixer extends AbstractPhpdocTypesFixer +{ + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isTokenKindFound(T_DOC_COMMENT); + } + + public function isRisky(): bool + { + return true; + } + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'PHPDoc `array` type must be used instead of `T[]`.', + [ + new CodeSample(<<<'PHP' + ', $level); + }, + $type, + ); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocIndentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocIndentFixer.php index d926dbbf..818595d2 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocIndentFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocIndentFixer.php @@ -29,9 +29,6 @@ */ final class PhpdocIndentFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -51,7 +48,7 @@ class DocBlocks /** * {@inheritdoc} * - * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. + * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocArrayTypeFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. * Must run after IndentationTypeFixer, PhpdocToCommentFixer. */ public function getPriority(): int @@ -59,20 +56,16 @@ public function getPriority(): int return 20; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - foreach ($tokens as $index => $token) { + for ($index = $tokens->count() - 1; 0 <= $index; --$index) { + $token = $tokens[$index]; + if (!$token->isGivenKind(T_DOC_COMMENT)) { continue; } @@ -104,7 +97,13 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $newPrevContent = $this->fixWhitespaceBeforeDocblock($prevToken->getContent(), $indent); - if ('' !== $newPrevContent) { + $tokens[$index] = new Token([T_DOC_COMMENT, $this->fixDocBlock($token->getContent(), $indent)]); + + if (!$prevToken->isWhitespace()) { + if ('' !== $indent) { + $tokens->insertAt($index, new Token([T_WHITESPACE, $indent])); + } + } elseif ('' !== $newPrevContent) { if ($prevToken->isArray()) { $tokens[$prevIndex] = new Token([$prevToken->getId(), $newPrevContent]); } else { @@ -113,8 +112,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } else { $tokens->clearAt($prevIndex); } - - $tokens[$index] = new Token([T_DOC_COMMENT, $this->fixDocBlock($token->getContent(), $indent)]); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixer.php index 20474b20..a37b9b83 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -26,19 +27,26 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * tags?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * tags: list + * } + */ final class PhpdocInlineTagNormalizerFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -66,9 +74,6 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { if (0 === \count($this->configuration['tags'])) { @@ -84,11 +89,9 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void // remove spaces between '{' and '@', remove white space between end // of text and closing bracket and between the tag and inline comment. $content = Preg::replaceCallback( - sprintf( - '#(?:@{+|{+\h*@)\h*(%s)s?([^}]*)(?:}+)#i', - implode('|', array_map(static function (string $tag): string { - return preg_quote($tag, '/'); - }, $this->configuration['tags'])) + \sprintf( + '#(?:@{+|{+\h*@)\h*(%s)\b([^}]*)(?:}+)#i', + implode('|', array_map(static fn (string $tag): string => preg_quote($tag, '/'), $this->configuration['tags'])) ), static function (array $matches): string { $doc = trim($matches[2]); @@ -106,14 +109,11 @@ static function (array $matches): string { } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('tags', 'The list of tags to normalize.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setDefault(['example', 'id', 'internal', 'inheritdoc', 'inheritdocs', 'link', 'source', 'toc', 'tutorial']) ->getOption(), ]); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocLineSpanFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocLineSpanFixer.php index 167ac034..9a639ae1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocLineSpanFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocLineSpanFixer.php @@ -17,6 +17,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -32,12 +33,25 @@ /** * @author Gert de Pagter + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * const?: 'multi'|'single'|null, + * method?: 'multi'|'single'|null, + * property?: 'multi'|'single'|null + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * const: 'multi'|'single'|null, + * method: 'multi'|'single'|null, + * property: 'multi'|'single'|null + * } */ final class PhpdocLineSpanFixer extends AbstractFixer implements WhitespacesAwareFixerInterface, ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -63,17 +77,11 @@ public function getPriority(): int return 7; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocListTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocListTypeFixer.php new file mode 100644 index 00000000..9d2cdff9 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocListTypeFixer.php @@ -0,0 +1,70 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Phpdoc; + +use PhpCsFixer\AbstractPhpdocTypesFixer; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Tokens; + +final class PhpdocListTypeFixer extends AbstractPhpdocTypesFixer +{ + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isTokenKindFound(T_DOC_COMMENT); + } + + public function isRisky(): bool + { + return true; + } + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'PHPDoc `list` type must be used instead of `array` without a key.', + [ + new CodeSample(<<<'PHP' + $x + * @param array> $y + */ + + PHP), + ], + null, + 'Risky when `array` key should be present, but is missing.' + ); + } + + /** + * {@inheritdoc} + * + * Must run before PhpdocAlignFixer, PhpdocTypesOrderFixer. + * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocArrayTypeFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. + */ + public function getPriority(): int + { + return 1; + } + + protected function normalize(string $type): string + { + return Preg::replace('/array(?=<(?:[^,<]|<[^>]+>)+(>|{|\())/i', 'list', $type); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAccessFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAccessFixer.php index a168a913..d2f959a1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAccessFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAccessFixer.php @@ -25,13 +25,10 @@ */ final class PhpdocNoAccessFixer extends AbstractProxyFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - '`@access` annotations should be omitted from PHPDoc.', + '`@access` annotations must be removed from PHPDoc.', [ new CodeSample( 'configure(['annotations' => ['access']]); + $fixer->configure( + ['annotations' => ['access'], + 'case_sensitive' => true, + ] + ); return [$fixer]; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php index c4ec3689..d50e42d1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php @@ -18,6 +18,7 @@ use PhpCsFixer\ConfigurationException\InvalidConfigurationException; use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -31,12 +32,21 @@ * * @author Graham Campbell * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * replacements?: array + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * replacements: array + * } */ final class PhpdocNoAliasTagFixer extends AbstractProxyFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -84,10 +94,8 @@ public function getPriority(): int return parent::getPriority(); } - public function configure(array $configuration): void + protected function configurePostNormalisation(): void { - parent::configure($configuration); - /** @var GeneralPhpdocTagRenameFixer $generalPhpdocTagRenameFixer */ $generalPhpdocTagRenameFixer = $this->proxyFixers['general_phpdoc_tag_rename']; @@ -107,14 +115,11 @@ public function configure(array $configuration): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('replacements', 'Mapping between replaced annotations with new ones.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['array']) ->setDefault([ 'property-read' => 'property', 'property-write' => 'property', @@ -125,9 +130,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function createProxyFixers(): array { return [new GeneralPhpdocTagRenameFixer()]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php index b318aa69..c591c67a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php @@ -28,21 +28,15 @@ */ final class PhpdocNoEmptyReturnFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - '`@return void` and `@return null` annotations should be omitted from PHPDoc.', + '`@return void` and `@return null` annotations must be removed from PHPDoc.', [ new CodeSample( ' $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoPackageFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoPackageFixer.php index d7da1d1a..2f927849 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoPackageFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoPackageFixer.php @@ -25,13 +25,10 @@ */ final class PhpdocNoPackageFixer extends AbstractProxyFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - '`@package` and `@subpackage` annotations should be omitted from PHPDoc.', + '`@package` and `@subpackage` annotations must be removed from PHPDoc.', [ new CodeSample( 'configure(['annotations' => ['package', 'subpackage']]); + $fixer->configure([ + 'annotations' => ['package', 'subpackage'], + 'case_sensitive' => true, + ]); return [$fixer]; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixer.php index 65d420fa..b1e88a3a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixer.php @@ -28,9 +28,6 @@ */ final class PhpdocNoUselessInheritdocFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -53,17 +50,11 @@ public function getPriority(): int return 6; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT) && $tokens->isAnyTokenKindsFound([T_CLASS, T_INTERFACE]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { // min. offset 4 as minimal candidate is @: ' '.$matches[2], $tokens[$tokenIndex]->getContent(), -1, $count ); - if ($count) { + if ($count > 0) { $tokens[$tokenIndex] = new Token([T_DOC_COMMENT, $content]); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderByValueFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderByValueFixer.php index 38a476df..74f0eb40 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderByValueFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderByValueFixer.php @@ -17,6 +17,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -32,16 +33,25 @@ /** * @author Filippo Tessarotto * @author Andreas Möller + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * annotations?: list<'author'|'covers'|'coversNothing'|'dataProvider'|'depends'|'group'|'internal'|'method'|'mixin'|'property'|'property-read'|'property-write'|'requires'|'throws'|'uses'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * annotations: array{'author'?: 'author', 'covers'?: 'covers', 'coversNothing'?: 'coversnothing', 'dataProvider'?: 'dataprovider', 'depends'?: 'depends', 'group'?: 'group', 'internal'?: 'internal', 'method'?: 'method', 'mixin'?: 'mixin', 'property'?: 'property', 'property-read'?: 'property-read', 'property-write'?: 'property-write', 'requires'?: 'requires', 'throws'?: 'throws', 'uses'?: 'uses'} + * } */ final class PhpdocOrderByValueFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Order phpdoc tags by value.', + 'Order PHPDoc tags by value.', [ new CodeSample( 'isAllTokenKindsFound([T_CLASS, T_DOC_COMMENT]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { if ([] === $this->configuration['annotations']) { @@ -102,7 +106,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void for ($index = $tokens->count() - 1; $index > 0; --$index) { foreach ($this->configuration['annotations'] as $type => $typeLowerCase) { - $findPattern = sprintf( + $findPattern = \sprintf( '/@%s\s.+@%s\s/s', $type, $type @@ -110,7 +114,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void if ( !$tokens[$index]->isGivenKind(T_DOC_COMMENT) - || 0 === Preg::match($findPattern, $tokens[$index]->getContent()) + || !Preg::match($findPattern, $tokens[$index]->getContent()) ) { continue; } @@ -121,8 +125,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $annotationMap = []; if (\in_array($type, ['property', 'property-read', 'property-write'], true)) { - $replacePattern = sprintf( - '/(?s)\*\s*@%s\s+(?P.+\s+)?\$(?P[^\s]+).*/', + $replacePattern = \sprintf( + '/(?s)\*\s*@%s\s+(?P.+\s+)?\$(?P\S+).*/', $type ); @@ -131,7 +135,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $replacePattern = '/(?s)\*\s*@method\s+(?P.+\s+)?(?P.+)\(.*/'; $replacement = '\2'; } else { - $replacePattern = sprintf( + $replacePattern = \sprintf( '/\*\s*@%s\s+(?P.+)/', $typeLowerCase ); @@ -197,13 +201,11 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn return new FixerConfigurationResolver([ (new FixerOptionBuilder('annotations', 'List of annotations to order, e.g. `["covers"]`.')) - ->setAllowedTypes([ - 'array', - ]) + ->setAllowedTypes(['string[]']) ->setAllowedValues([ new AllowedValueSubset($allowedValues), ]) - ->setNormalizer(static function (Options $options, $value): array { + ->setNormalizer(static function (Options $options, array $value): array { $normalized = []; foreach ($value as $annotation) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderFixer.php index 71dd83c9..d7423f5e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderFixer.php @@ -17,6 +17,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -30,9 +31,21 @@ /** * @author Graham Campbell * @author Jakub Kwaśniewski + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * order?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * order: list + * } */ final class PhpdocOrderFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @const string[] * @@ -40,24 +53,21 @@ final class PhpdocOrderFixer extends AbstractFixer implements ConfigurableFixerI */ private const ORDER_DEFAULT = ['param', 'throws', 'return']; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { $code = <<<'EOF' -isTokenKindFound(T_DOC_COMMENT); @@ -89,15 +96,12 @@ public function getPriority(): int return -2; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('order', 'Sequence in which annotations in PHPDoc should be ordered.')) ->setAllowedTypes(['string[]']) - ->setAllowedValues([function ($order) { + ->setAllowedValues([static function (array $order): bool { if (\count($order) < 2) { throw new InvalidOptionsException('The option "order" value is invalid. Minimum two tags are required.'); } @@ -109,9 +113,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -123,6 +124,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $content = $token->getContent(); // sort annotations + /** @var list */ $successors = $this->configuration['order']; while (\count($successors) >= 3) { $predecessor = array_shift($successors); @@ -131,6 +133,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void // we're parsing the content last time to make sure the internal // state of the docblock is correct after the modifications + /** @var list */ $predecessors = $this->configuration['order']; $last = array_pop($predecessors); $content = $this->moveAnnotationsAfter($last, $predecessors, $content); @@ -143,8 +146,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void /** * Move all given annotations in before given set of annotations. * - * @param string $move Tag of annotations that should be moved - * @param string[] $before Tags of annotations that should moved annotations be placed before + * @param string $move Tag of annotations that should be moved + * @param list $before Tags of annotations that should moved annotations be placed before */ private function moveAnnotationsBefore(string $move, array $before, string $content): string { @@ -182,8 +185,8 @@ private function moveAnnotationsBefore(string $move, array $before, string $cont /** * Move all given annotations after given set of annotations. * - * @param string $move Tag of annotations that should be moved - * @param string[] $after Tags of annotations that should moved annotations be placed after + * @param string $move Tag of annotations that should be moved + * @param list $after Tags of annotations that should moved annotations be placed after */ private function moveAnnotationsAfter(string $move, array $after, string $content): string { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocParamOrderFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocParamOrderFixer.php new file mode 100644 index 00000000..dbed46eb --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocParamOrderFixer.php @@ -0,0 +1,273 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Phpdoc; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\DocBlock\Annotation; +use PhpCsFixer\DocBlock\DocBlock; +use PhpCsFixer\DocBlock\TypeExpression; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Jonathan Gruber + */ +final class PhpdocParamOrderFixer extends AbstractFixer +{ + private const PARAM_TAG = 'param'; + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isTokenKindFound(T_DOC_COMMENT); + } + + /** + * {@inheritdoc} + * + * Must run before PhpdocAlignFixer. + * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. + */ + public function getPriority(): int + { + return parent::getPriority(); + } + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Orders all `@param` annotations in DocBlocks according to method signature.', + [ + new CodeSample( + ' $token) { + if (!$token->isGivenKind(T_DOC_COMMENT)) { + continue; + } + + // Check for function / closure token + $nextFunctionToken = $tokens->getNextTokenOfKind($index, [[T_FUNCTION], [T_FN]]); + if (null === $nextFunctionToken) { + return; + } + + // Find start index of param block (opening parenthesis) + $paramBlockStart = $tokens->getNextTokenOfKind($index, ['(']); + if (null === $paramBlockStart) { + return; + } + + $doc = new DocBlock($tokens[$index]->getContent()); + $paramAnnotations = $doc->getAnnotationsOfType(self::PARAM_TAG); + + if ([] === $paramAnnotations) { + continue; + } + + $paramNames = $this->getFunctionParamNames($tokens, $paramBlockStart); + $doc = $this->rewriteDocBlock($doc, $paramNames, $paramAnnotations); + + $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); + } + } + + /** + * @return list + */ + private function getFunctionParamNames(Tokens $tokens, int $paramBlockStart): array + { + $paramBlockEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $paramBlockStart); + + $paramNames = []; + for ( + $i = $tokens->getNextTokenOfKind($paramBlockStart, [[T_VARIABLE]]); + null !== $i && $i < $paramBlockEnd; + $i = $tokens->getNextTokenOfKind($i, [[T_VARIABLE]]) + ) { + $paramNames[] = $tokens[$i]; + } + + return $paramNames; + } + + /** + * Overwrite the param annotations in order. + * + * @param list $paramNames + * @param list $paramAnnotations + */ + private function rewriteDocBlock(DocBlock $doc, array $paramNames, array $paramAnnotations): DocBlock + { + $orderedAnnotations = $this->sortParamAnnotations($paramNames, $paramAnnotations); + $otherAnnotations = $this->getOtherAnnotationsBetweenParams($doc, $paramAnnotations); + + // Append annotations found between param ones + if ([] !== $otherAnnotations) { + array_push($orderedAnnotations, ...$otherAnnotations); + } + + // Overwrite all annotations between first and last @param tag in order + $paramsStart = reset($paramAnnotations)->getStart(); + $paramsEnd = end($paramAnnotations)->getEnd(); + + foreach ($doc->getAnnotations() as $annotation) { + if ($annotation->getStart() < $paramsStart || $annotation->getEnd() > $paramsEnd) { + continue; + } + + $annotation->remove(); + $doc + ->getLine($annotation->getStart()) + ->setContent(current($orderedAnnotations)) + ; + + next($orderedAnnotations); + } + + return $doc; + } + + /** + * Sort the param annotations according to the function parameters. + * + * @param list $funcParamNames + * @param list $paramAnnotations + * + * @return list + */ + private function sortParamAnnotations(array $funcParamNames, array $paramAnnotations): array + { + $validParams = []; + foreach ($funcParamNames as $paramName) { + $indices = $this->findParamAnnotationByIdentifier($paramAnnotations, $paramName->getContent()); + + // Found an exactly matching @param annotation + if (\is_array($indices)) { + foreach ($indices as $index) { + $validParams[$index] = $paramAnnotations[$index]->getContent(); + } + } + } + + // Detect superfluous annotations + /** @var list $invalidParams */ + $invalidParams = array_values( + array_diff_key($paramAnnotations, $validParams) + ); + + // Append invalid parameters to the (ordered) valid ones + $orderedParams = array_values($validParams); + foreach ($invalidParams as $params) { + $orderedParams[] = $params->getContent(); + } + + return $orderedParams; + } + + /** + * Fetch all annotations except the param ones. + * + * @param list $paramAnnotations + * + * @return list + */ + private function getOtherAnnotationsBetweenParams(DocBlock $doc, array $paramAnnotations): array + { + if (0 === \count($paramAnnotations)) { + return []; + } + + $paramsStart = reset($paramAnnotations)->getStart(); + $paramsEnd = end($paramAnnotations)->getEnd(); + + $otherAnnotations = []; + foreach ($doc->getAnnotations() as $annotation) { + if ($annotation->getStart() < $paramsStart || $annotation->getEnd() > $paramsEnd) { + continue; + } + + if (self::PARAM_TAG !== $annotation->getTag()->getName()) { + $otherAnnotations[] = $annotation->getContent(); + } + } + + return $otherAnnotations; + } + + /** + * Return the indices of the lines of a specific parameter annotation. + * + * @param list $paramAnnotations + * + * @return ?list + */ + private function findParamAnnotationByIdentifier(array $paramAnnotations, string $identifier): ?array + { + $blockLevel = 0; + $blockMatch = false; + $blockIndices = []; + + $paramRegex = '/\*\h*@param\h*(?:|'.TypeExpression::REGEX_TYPES.'\h*)&?(?=\$\b)'.preg_quote($identifier).'\b/'; + + foreach ($paramAnnotations as $i => $param) { + $blockStart = Preg::match('/\s*{\s*/', $param->getContent()); + $blockEndMatches = Preg::matchAll('/}[\*\s\n]*/', $param->getContent()); + + if (0 === $blockLevel && Preg::match($paramRegex, $param->getContent())) { + if ($blockStart) { + $blockMatch = true; // Start of a nested block + } else { + return [$i]; // Top level match + } + } + + if ($blockStart) { + ++$blockLevel; + } + + if (0 !== $blockEndMatches) { + $blockLevel -= $blockEndMatches; + } + + if ($blockMatch) { + $blockIndices[] = $i; + if (0 === $blockLevel) { + return $blockIndices; + } + } + } + + return null; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php index ea323096..a8eb6aef 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php @@ -17,6 +17,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -26,23 +27,34 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; +use PhpCsFixer\Utils; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; use Symfony\Component\OptionsResolver\Options; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * replacements?: array + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * replacements: array + * } + */ final class PhpdocReturnSelfReferenceFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** - * @var string[] + * @var list */ - private static array $toTypes = [ + private const TO_TYPES = [ '$this', 'static', 'self', ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -97,9 +109,6 @@ public function test2() ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return \count($tokens) > 10 && $tokens->isAllTokenKindsFound([T_DOC_COMMENT, T_FUNCTION]) && $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); @@ -116,9 +125,6 @@ public function getPriority(): int return 10; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); @@ -130,9 +136,6 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $default = [ @@ -146,7 +149,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn return new FixerConfigurationResolver([ (new FixerOptionBuilder('replacements', 'Mapping between replaced return types with new ones.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['array']) ->setNormalizer(static function (Options $options, array $value) use ($default): array { $normalizedValue = []; @@ -156,18 +159,18 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn } if (!isset($default[$from])) { - throw new InvalidOptionsException(sprintf( - 'Unknown key "%s", expected any of "%s".', + throw new InvalidOptionsException(\sprintf( + 'Unknown key "%s", expected any of %s.', \gettype($from).'#'.$from, - implode('", "', array_keys($default)) + Utils::naturalLanguageJoin(array_keys($default)) )); } - if (!\in_array($to, self::$toTypes, true)) { - throw new InvalidOptionsException(sprintf( - 'Unknown value "%s", expected any of "%s".', + if (!\in_array($to, self::TO_TYPES, true)) { + throw new InvalidOptionsException(\sprintf( + 'Unknown value "%s", expected any of %s.', \is_object($to) ? \get_class($to) : \gettype($to).(\is_resource($to) ? '' : '#'.$to), - implode('", "', self::$toTypes) + Utils::naturalLanguageJoin(self::TO_TYPES) )); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocScalarFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocScalarFixer.php index b603912e..d047b457 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocScalarFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocScalarFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractPhpdocTypesFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -26,15 +27,25 @@ /** * @author Graham Campbell + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * types?: list<'boolean'|'callback'|'double'|'integer'|'real'|'str'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * types: list<'boolean'|'callback'|'double'|'integer'|'real'|'str'> + * } */ final class PhpdocScalarFixer extends AbstractPhpdocTypesFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * The types to fix. - * - * @var array */ - private static array $types = [ + private const TYPES_MAP = [ 'boolean' => 'bool', 'callback' => 'callable', 'double' => 'float', @@ -43,9 +54,6 @@ final class PhpdocScalarFixer extends AbstractPhpdocTypesFixer implements Config 'str' => 'string', ]; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -85,7 +93,7 @@ function sample($a, $b, $c) /** * {@inheritdoc} * - * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. + * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocArrayTypeFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. * Must run after PhpdocTypesFixer. */ public function getPriority(): int @@ -102,12 +110,9 @@ public function getPriority(): int return 15; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { - $types = array_keys(self::$types); + $types = array_keys(self::TYPES_MAP); return new FixerConfigurationResolver([ (new FixerOptionBuilder('types', 'A list of types to fix.')) @@ -117,15 +122,18 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function normalize(string $type): string { + $suffix = ''; + while (str_ends_with($type, '[]')) { + $type = substr($type, 0, -2); + $suffix .= '[]'; + } + if (\in_array($type, $this->configuration['types'], true)) { - return self::$types[$type]; + $type = self::TYPES_MAP[$type]; } - return $type; + return $type.$suffix; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSeparationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSeparationFixer.php index b5275ea6..7c2f1d91 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSeparationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSeparationFixer.php @@ -18,6 +18,7 @@ use PhpCsFixer\DocBlock\Annotation; use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -32,35 +33,58 @@ /** * @author Graham Campbell * @author Jakub Kwaśniewski + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * groups?: list>, + * skip_unlisted_annotations?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * groups: list>, + * skip_unlisted_annotations: bool + * } */ final class PhpdocSeparationFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** - * @var string[][] + * @internal + * + * @var list> */ - private array $groups; + public const OPTION_GROUPS_DEFAULT = [ + ['author', 'copyright', 'license'], + ['category', 'package', 'subpackage'], + ['property', 'property-read', 'property-write'], + ['deprecated', 'link', 'see', 'since'], + ]; /** - * {@inheritdoc} + * @var list> */ + private array $groups; + public function getDefinition(): FixerDefinitionInterface { $code = <<<'EOF' - [['ORM\*'], ['Assert\*']]], ), new CodeSample($code, ['skip_unlisted_annotations' => true]), @@ -97,38 +121,27 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->groups = $this->configuration['groups']; - } - /** * {@inheritdoc} * * Must run before PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, PhpdocIndentFixer, PhpdocNoAccessFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocOrderFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. + * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, PhpUnitAttributesFixer, PhpUnitInternalClassFixer, PhpUnitSizeClassFixer, PhpUnitTestClassRequiresCoversFixer, PhpdocIndentFixer, PhpdocNoAccessFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocOrderFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. */ public function getPriority(): int { return -3; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $this->groups = $this->configuration['groups']; + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -144,12 +157,9 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { - $allowTagToBelongToOnlyOneGroup = function ($groups) { + $allowTagToBelongToOnlyOneGroup = static function (array $groups): bool { $tags = []; foreach ($groups as $groupIndex => $group) { foreach ($group as $member) { @@ -176,12 +186,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn return new FixerConfigurationResolver([ (new FixerOptionBuilder('groups', 'Sets of annotation types to be grouped together. Use `*` to match any tag character.')) ->setAllowedTypes(['string[][]']) - ->setDefault([ - ['deprecated', 'link', 'see', 'since'], - ['author', 'copyright', 'license'], - ['category', 'package', 'subpackage'], - ['property', 'property-read', 'property-write'], - ]) + ->setDefault(self::OPTION_GROUPS_DEFAULT) ->setAllowedValues([$allowTagToBelongToOnlyOneGroup]) ->getOption(), (new FixerOptionBuilder('skip_unlisted_annotations', 'Whether to skip annotations that are not listed in any group.')) @@ -229,7 +234,7 @@ private function fixAnnotations(DocBlock $doc): void if (true === $shouldBeTogether) { $this->ensureAreTogether($doc, $annotation, $next); - } elseif (false === $shouldBeTogether || !$this->configuration['skip_unlisted_annotations']) { + } elseif (false === $shouldBeTogether || false === $this->configuration['skip_unlisted_annotations']) { $this->ensureAreSeparate($doc, $annotation, $next); } } @@ -243,7 +248,7 @@ private function ensureAreTogether(DocBlock $doc, Annotation $first, Annotation $pos = $first->getEnd(); $final = $second->getStart(); - for ($pos = $pos + 1; $pos < $final; ++$pos) { + for (++$pos; $pos < $final; ++$pos) { $doc->getLine($pos)->remove(); } } @@ -263,7 +268,7 @@ private function ensureAreSeparate(DocBlock $doc, Annotation $first, Annotation return; } - for ($pos = $pos + 1; $pos < $final; ++$pos) { + for (++$pos; $pos < $final; ++$pos) { $doc->getLine($pos)->remove(); } } @@ -303,7 +308,7 @@ private function shouldBeTogether(Annotation $first, Annotation $second, array $ private function tagName(Annotation $annotation): ?string { - Preg::match('/@([a-zA-Z0-9_\\\\-]+(?=\s|$|\())/', $annotation->getContent(), $matches); + Preg::match('/@([a-zA-Z0-9_\\\-]+(?=\s|$|\())/', $annotation->getContent(), $matches); return $matches[1] ?? null; } @@ -318,7 +323,7 @@ private function isInGroup(string $tag, array $group): bool $tagInGroup = preg_quote($tagInGroup, '/'); $tagInGroup = str_replace('\\\\\*', '.*?', $tagInGroup); - if (1 === Preg::match("/^{$tagInGroup}$/", $tag)) { + if (Preg::match("/^{$tagInGroup}$/", $tag)) { return true; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixer.php index 8ccd3d74..9c2bda1d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixer.php @@ -27,9 +27,6 @@ */ final class PhpdocSingleLineVarSpacingFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -49,17 +46,11 @@ public function getPriority(): int return -10; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_COMMENT, T_DOC_COMMENT]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { /** @var Token $token */ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSummaryFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSummaryFixer.php index 090ac88f..034be5c9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSummaryFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSummaryFixer.php @@ -29,9 +29,6 @@ */ final class PhpdocSummaryFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -56,17 +53,11 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -81,7 +72,12 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $line = $doc->getLine($end); $content = rtrim($line->getContent()); - if (!$this->isCorrectlyFormatted($content)) { + if ( + // final line of Description is NOT properly formatted + !$this->isCorrectlyFormatted($content) + // and first line of Description, if different than final line, does NOT indicate a list + && (1 === $end || ($doc->isMultiLine() && ':' !== substr(rtrim($doc->getLine(1)->getContent()), -1))) + ) { $line->setContent($content.'.'.$this->whitespacesConfig->getLineEnding()); $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); } @@ -94,10 +90,10 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void */ private function isCorrectlyFormatted(string $content): bool { - if (false !== stripos($content, '{@inheritdoc}')) { + if (str_contains(strtolower($content), strtolower('{@inheritdoc}'))) { return true; } - return $content !== rtrim($content, '.。!?¡¿!?'); + return $content !== rtrim($content, '.:。!?¡¿!?'); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagCasingFixer.php index b9608320..16ef2e88 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagCasingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagCasingFixer.php @@ -18,6 +18,7 @@ use PhpCsFixer\ConfigurationException\InvalidConfigurationException; use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -26,11 +27,21 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * tags?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * tags: list + * } + */ final class PhpdocTagCasingFixer extends AbstractProxyFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -55,10 +66,8 @@ public function getPriority(): int return parent::getPriority(); } - public function configure(array $configuration): void + protected function configurePostNormalisation(): void { - parent::configure($configuration); - $replacements = []; foreach ($this->configuration['tags'] as $tag) { $replacements[$tag] = $tag; @@ -69,10 +78,10 @@ public function configure(array $configuration): void try { $generalPhpdocTagRenameFixer->configure([ + 'case_sensitive' => false, 'fix_annotation' => true, 'fix_inline' => true, 'replacements' => $replacements, - 'case_sensitive' => false, ]); } catch (InvalidConfigurationException $exception) { throw new InvalidFixerConfigurationException( @@ -83,22 +92,16 @@ public function configure(array $configuration): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('tags', 'List of tags to fix with their expected casing.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setDefault(['inheritDoc']) ->getOption(), ]); } - /** - * {@inheritdoc} - */ protected function createProxyFixers(): array { return [new GeneralPhpdocTagRenameFixer()]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php index fd9b73ba..150115c6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -28,8 +29,21 @@ use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; use Symfony\Component\OptionsResolver\Options; +/** + * @phpstan-type _AutogeneratedInputConfiguration array{ + * tags?: array + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * tags: array + * } + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + */ final class PhpdocTagTypeFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + private const TAG_REGEX = '/^(?: (? (?:@(?.+?)(?:\s.+)?) @@ -40,17 +54,11 @@ final class PhpdocTagTypeFixer extends AbstractFixer implements ConfigurableFixe )} )$/x'; - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -78,21 +86,16 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { if (0 === \count($this->configuration['tags'])) { return; } - $regularExpression = sprintf( + $regularExpression = \sprintf( '/({?@(?:%s).*?(?:(?=\s\*\/)|(?=\n)}?))/i', implode('|', array_map( - static function (string $tag): string { - return preg_quote($tag, '/'); - }, + static fn (string $tag): string => preg_quote($tag, '/'), array_keys($this->configuration['tags']) )) ); @@ -142,14 +145,11 @@ static function (string $tag): string { } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('tags', 'The list of tags to fix.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(["array"]) ->setAllowedValues([static function (array $value): bool { foreach ($value as $type) { if (!\in_array($type, ['annotation', 'inline'], true)) { @@ -182,7 +182,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn 'var' => 'annotation', 'version' => 'annotation', ]) - ->setNormalizer(static function (Options $options, $value): array { + ->setNormalizer(static function (Options $options, array $value): array { $normalized = []; foreach ($value as $tag => $type) { @@ -196,7 +196,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn } /** - * @param list $parts + * @param array $parts */ private function tagIsSurroundedByText(array $parts, int $index): bool { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocToCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocToCommentFixer.php index ee746b7a..08e35740 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocToCommentFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocToCommentFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -30,17 +31,29 @@ /** * @author Ceeram * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * allow_before_return_statement?: bool, + * ignored_tags?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * allow_before_return_statement: bool, + * ignored_tags: list + * } */ final class PhpdocToCommentFixer extends AbstractFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** - * @var string[] + * @var list */ private array $ignoredTags = []; + private bool $allowBeforeReturnStatement = false; - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); @@ -49,7 +62,7 @@ public function isCandidate(Tokens $tokens): bool /** * {@inheritdoc} * - * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyCommentFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocIndentFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer, SingleLineCommentSpacingFixer, SingleLineCommentStyleFixer. + * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyCommentFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocArrayTypeFixer, PhpdocIndentFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer, SingleLineCommentSpacingFixer, SingleLineCommentStyleFixer. * Must run after CommentToPhpdocFixer. */ public function getPriority(): int @@ -62,9 +75,6 @@ public function getPriority(): int return 25; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -96,41 +106,50 @@ public function getDefinition(): FixerDefinitionInterface ', ['ignored_tags' => ['todo']] ), + new CodeSample( + ' $sqlite) { + $sqlite->open($path); +} + +function returnClassName() { + /** @var class-string */ + return \StdClass::class; +} +', + ['allow_before_return_statement' => true] + ), ] ); } - /** - * {@inheritdoc} - */ - public function configure(array $configuration = null): void + protected function configurePostNormalisation(): void { - parent::configure($configuration); - $this->ignoredTags = array_map( - static function (string $tag): string { - return strtolower($tag); - }, + static fn (string $tag): string => strtolower($tag), $this->configuration['ignored_tags'] ); + + $this->allowBeforeReturnStatement = true === $this->configuration['allow_before_return_statement']; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('ignored_tags', 'List of ignored tags (matched case insensitively).')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setDefault([]) ->getOption(), + (new FixerOptionBuilder('allow_before_return_statement', 'Whether to allow PHPDoc before return statement.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) // @TODO 4.0: set to `true` + ->getOption(), ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $commentsAnalyzer = new CommentsAnalyzer(); @@ -144,11 +163,15 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } + if ($this->allowBeforeReturnStatement && $commentsAnalyzer->isBeforeReturn($tokens, $index)) { + continue; + } + if ($commentsAnalyzer->isBeforeStructuralElement($tokens, $index)) { continue; } - if (0 < Preg::matchAll('~\@([a-zA-Z0-9_\\\\-]+)\b~', $token->getContent(), $matches)) { + if (0 < Preg::matchAll('~\@([a-zA-Z0-9_\\\-]+)\b~', $token->getContent(), $matches)) { foreach ($matches[1] as $match) { if (\in_array(strtolower($match), $this->ignoredTags, true)) { continue 2; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php index 3d41bdb8..6b107af1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php @@ -30,9 +30,6 @@ */ final class PhpdocTrimConsecutiveBlankLineSeparationFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -66,24 +63,18 @@ function fnc($foo) {} * {@inheritdoc} * * Must run before PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. + * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpUnitAttributesFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. */ public function getPriority(): int { return -41; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -174,13 +165,16 @@ private function findNonBlankLine(DocBlock $doc, int $after): ?int private function findFirstAnnotationOrEnd(DocBlock $doc): int { - $index = null; foreach ($doc->getLines() as $index => $line) { if ($line->containsATag()) { return $index; } } + if (!isset($index)) { + throw new \LogicException('PHPDoc has empty lines collection.'); + } + return $index; // no Annotation, return the last line } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimFixer.php index d835fb33..d6b2391e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimFixer.php @@ -27,9 +27,6 @@ */ final class PhpdocTrimFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -50,24 +47,18 @@ final class Foo {} * {@inheritdoc} * * Must run before PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, PhpUnitTestAnnotationFixer, PhpdocIndentFixer, PhpdocNoAccessFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocOrderFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. + * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, PhpUnitAttributesFixer, PhpUnitTestAnnotationFixer, PhpdocIndentFixer, PhpdocNoAccessFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocOrderFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. */ public function getPriority(): int { return -5; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesFixer.php index ab39f108..187ed319 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesFixer.php @@ -15,7 +15,9 @@ namespace PhpCsFixer\Fixer\Phpdoc; use PhpCsFixer\AbstractPhpdocTypesFixer; +use PhpCsFixer\DocBlock\TypeExpression; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -23,18 +25,29 @@ use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; /** * @author Graham Campbell * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * groups?: list<'alias'|'meta'|'simple'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * groups: list<'alias'|'meta'|'simple'> + * } */ final class PhpdocTypesFixer extends AbstractPhpdocTypesFixer implements ConfigurableFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * Available types, grouped. * - * @var array + * @var array> */ private const POSSIBLE_TYPES = [ 'simple' => [ @@ -50,10 +63,8 @@ final class PhpdocTypesFixer extends AbstractPhpdocTypesFixer implements Configu ], 'alias' => [ 'boolean', - 'callback', 'double', 'integer', - 'real', ], 'meta' => [ '$this', @@ -69,36 +80,9 @@ final class PhpdocTypesFixer extends AbstractPhpdocTypesFixer implements Configu ], ]; - private string $patternToFix = ''; - - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - $typesToFix = array_merge(...array_map(static function (string $group): array { - return self::POSSIBLE_TYPES[$group]; - }, $this->configuration['groups'])); - - $this->patternToFix = sprintf( - '/(? */ + private array $typesSetToFix; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -130,8 +114,8 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocReturnSelfReferenceFixer, PhpdocScalarFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. - * Must run after PhpdocAnnotationWithoutDotFixer, PhpdocIndentFixer. + * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocArrayTypeFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocScalarFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. + * Must run after PhpdocIndentFixer. */ public function getPriority(): int { @@ -146,30 +130,41 @@ public function getPriority(): int return 16; } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $typesToFix = array_merge(...array_map(static fn (string $group): array => self::POSSIBLE_TYPES[$group], $this->configuration['groups'])); + + $this->typesSetToFix = array_combine($typesToFix, array_fill(0, \count($typesToFix), true)); + } + protected function normalize(string $type): string { - return Preg::replaceCallback( - $this->patternToFix, - function (array $matches): string { - return strtolower($matches[0]); - }, - $type - ); + $typeExpression = new TypeExpression($type, null, []); + + $newTypeExpression = $typeExpression->mapTypes(function (TypeExpression $type) { + if ($type->isUnionType()) { + return $type; + } + + $value = $type->toString(); + $valueLower = strtolower($value); + if (isset($this->typesSetToFix[$valueLower])) { + return new TypeExpression($valueLower, null, []); + } + + return $type; + }); + + return $newTypeExpression->toString(); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $possibleGroups = array_keys(self::POSSIBLE_TYPES); return new FixerConfigurationResolver([ (new FixerOptionBuilder('groups', 'Type groups to fix.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset($possibleGroups)]) ->setDefault($possibleGroups) ->getOption(), diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesOrderFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesOrderFixer.php index 6cff3474..1462e933 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesOrderFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesOrderFixer.php @@ -19,6 +19,7 @@ use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\DocBlock\TypeExpression; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -29,11 +30,25 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * case_sensitive?: bool, + * null_adjustment?: 'always_first'|'always_last'|'none', + * sort_algorithm?: 'alpha'|'none' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * case_sensitive: bool, + * null_adjustment: 'always_first'|'always_last'|'none', + * sort_algorithm: 'alpha'|'none' + * } + */ final class PhpdocTypesOrderFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -84,6 +99,14 @@ public function getDefinition(): FixerDefinitionInterface 'null_adjustment' => 'none', ] ), + new CodeSample( + ' true] + ), ] ); } @@ -92,24 +115,18 @@ public function getDefinition(): FixerDefinitionInterface * {@inheritdoc} * * Must run before PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocAnnotationWithoutDotFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. + * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocArrayTypeFixer, PhpdocIndentFixer, PhpdocListTypeFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. */ public function getPriority(): int { return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -121,6 +138,10 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ->setAllowedValues(['always_first', 'always_last', 'none']) ->setDefault('always_first') ->getOption(), + (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), ]); } @@ -140,20 +161,20 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void foreach ($annotations as $annotation) { // fix main types - $annotation->setTypes( - $this->sortTypes( - $annotation->getTypeExpression() - ) - ); + if (null !== $annotation->getTypeExpression()) { + $annotation->setTypes( + $this->sortTypes( + $annotation->getTypeExpression() + ) + ); + } // fix @method parameters types $line = $doc->getLine($annotation->getStart()); - $line->setContent(Preg::replaceCallback('/(@method\s+.+?\s+\w+\()(.*)\)/', function (array $matches) { - $sorted = Preg::replaceCallback('/([^\s,]+)([\s]+\$[^\s,]+)/', function (array $matches): string { - return $this->sortJoinedTypes($matches[1]).$matches[2]; - }, $matches[2]); + $line->setContent(Preg::replaceCallback('/\*\h*@method\h+'.TypeExpression::REGEX_TYPES.'\h+\K(?&callable)/', function (array $matches) { + $typeExpression = new TypeExpression($matches[0], null, []); - return $matches[1].$sorted.')'; + return implode('|', $this->sortTypes($typeExpression)); }, $line->getContent())); } @@ -162,15 +183,13 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @return string[] + * @return list */ private function sortTypes(TypeExpression $typeExpression): array { - $normalizeType = static function (string $type): string { - return Preg::replace('/^\\??\\\?/', '', $type); - }; + $normalizeType = static fn (string $type): string => Preg::replace('/^\(*\??\\\?/', '', $type); - $typeExpression->sortTypes( + $sortedTypeExpression = $typeExpression->sortTypes( function (TypeExpression $a, TypeExpression $b) use ($normalizeType): int { $a = $normalizeType($a->toString()); $b = $normalizeType($b->toString()); @@ -187,20 +206,13 @@ function (TypeExpression $a, TypeExpression $b) use ($normalizeType): int { } if ('alpha' === $this->configuration['sort_algorithm']) { - return strcasecmp($a, $b); + return true === $this->configuration['case_sensitive'] ? $a <=> $b : strcasecmp($a, $b); } return 0; } ); - return $typeExpression->getTypes(); - } - - private function sortJoinedTypes(string $types): string - { - $typeExpression = new TypeExpression($types, null, []); - - return implode('|', $this->sortTypes($typeExpression)); + return $sortedTypeExpression->getTypes(); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarAnnotationCorrectOrderFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarAnnotationCorrectOrderFixer.php index 400f8dd7..441710ae 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarAnnotationCorrectOrderFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarAnnotationCorrectOrderFixer.php @@ -61,7 +61,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - if (false === stripos($token->getContent(), '@var') && false === stripos($token->getContent(), '@type')) { + if (!str_contains(strtolower($token->getContent()), strtolower('@var')) && !str_contains(strtolower($token->getContent()), strtolower('@type'))) { continue; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarWithoutNameFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarWithoutNameFixer.php index 80200cf9..d6e9675c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarWithoutNameFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarWithoutNameFixer.php @@ -17,6 +17,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\DocBlock\DocBlock; use PhpCsFixer\DocBlock\Line; +use PhpCsFixer\DocBlock\TypeExpression; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; @@ -30,9 +31,6 @@ */ final class PhpdocVarWithoutNameFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -65,17 +63,11 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_DOC_COMMENT) && $tokens->isAnyTokenKindsFound([T_CLASS, T_TRAIT]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -122,17 +114,15 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void private function fixLine(Line $line): void { - $content = $line->getContent(); - - Preg::matchAll('/ \$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $content, $matches); + Preg::matchAll('/ \$'.TypeExpression::REGEX_IDENTIFIER.'(?getContent(), $matches); - if (isset($matches[0][0])) { - $line->setContent(str_replace($matches[0][0], '', $content)); + foreach ($matches[0] as $match) { + $line->setContent(str_replace($match, '', $line->getContent())); } } /** - * @return Line[] + * @return array */ private function getFirstLevelLines(DocBlock $docBlock): array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/NoUselessReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/NoUselessReturnFixer.php index 7656f950..aba3072c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/NoUselessReturnFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/NoUselessReturnFixer.php @@ -22,17 +22,11 @@ final class NoUselessReturnFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_FUNCTION, T_RETURN]); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -55,17 +49,14 @@ function example($b) { /** * {@inheritdoc} * - * Must run before BlankLineBeforeStatementFixer, NoExtraBlankLinesFixer, NoWhitespaceInBlankLineFixer, SingleLineCommentStyleFixer. - * Must run after NoEmptyStatementFixer, NoUnneededCurlyBracesFixer, NoUselessElseFixer, SimplifiedNullReturnFixer. + * Must run before BlankLineBeforeStatementFixer, NoExtraBlankLinesFixer, NoWhitespaceInBlankLineFixer, SingleLineCommentStyleFixer, SingleLineEmptyBodyFixer. + * Must run after NoEmptyStatementFixer, NoUnneededBracesFixer, NoUnneededCurlyBracesFixer, NoUselessElseFixer, SimplifiedNullReturnFixer. */ public function getPriority(): int { return -18; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/ReturnAssignmentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/ReturnAssignmentFixer.php index 1f7d21de..1e883382 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/ReturnAssignmentFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/ReturnAssignmentFixer.php @@ -25,14 +25,8 @@ final class ReturnAssignmentFixer extends AbstractFixer { - /** - * @var TokensAnalyzer - */ - private $tokensAnalyzer; + private TokensAnalyzer $tokensAnalyzer; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -45,24 +39,18 @@ public function getDefinition(): FixerDefinitionInterface * {@inheritdoc} * * Must run before BlankLineBeforeStatementFixer. - * Must run after NoEmptyStatementFixer, NoUnneededCurlyBracesFixer. + * Must run after NoEmptyStatementFixer, NoUnneededBracesFixer, NoUnneededCurlyBracesFixer. */ public function getPriority(): int { return -15; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAllTokenKindsFound([T_FUNCTION, T_RETURN, T_VARIABLE]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokenCount = \count($tokens); @@ -96,10 +84,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $functionCloseIndex ); + $functionCloseIndex += $tokensAdded; $totalTokensAdded += $tokensAdded; } while ($tokensAdded > 0); - $index = $functionCloseIndex + $totalTokensAdded; + $index = $functionCloseIndex; $tokenCount += $totalTokensAdded; } } @@ -287,6 +276,11 @@ private function fixFunction(Tokens $tokens, int $functionIndex, int $functionOp continue; } + // Check if there is a `catch` or `finally` block between the assignment and the return + if ($this->isUsedInCatchOrFinally($tokens, $returnVarIndex, $functionOpenIndex, $functionCloseIndex)) { + continue; + } + // Note: here we are @ "[;{}] $a = [^;{] ; return $a;" $inserted += $this->simplifyReturnStatement( $tokens, @@ -404,20 +398,18 @@ private function isOpenBraceOfAnonymousClass(Tokens $tokens, int $index): ?int { do { $index = $tokens->getPrevMeaningfulToken($index); - } while ($tokens[$index]->equalsAny([',', [T_STRING], [T_IMPLEMENTS], [T_EXTENDS]])); + } while ($tokens[$index]->equalsAny([',', [T_STRING], [T_IMPLEMENTS], [T_EXTENDS], [T_NS_SEPARATOR]])); - if ($tokens[$index]->equals(')')) { + if ($tokens[$index]->equals(')')) { // skip constructor braces and content within $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); $index = $tokens->getPrevMeaningfulToken($index); } - if (!$tokens[$index]->isGivenKind(T_CLASS)) { + if (!$tokens[$index]->isGivenKind(T_CLASS) || !$this->tokensAnalyzer->isAnonymousClass($index)) { return null; } - $index = $tokens->getPrevMeaningfulToken($index); - - return $tokens[$index]->isGivenKind(T_NEW) ? $index : null; + return $tokens->getPrevTokenOfKind($index, [[T_NEW]]); } /** @@ -477,4 +469,59 @@ private function isOpenBraceOfMatch(Tokens $tokens, int $index): ?int return $tokens[$index]->isGivenKind(T_MATCH) ? $index : null; } + + private function isUsedInCatchOrFinally(Tokens $tokens, int $returnVarIndex, int $functionOpenIndex, int $functionCloseIndex): bool + { + // Find try + $tryIndex = $tokens->getPrevTokenOfKind($returnVarIndex, [[T_TRY]]); + if (null === $tryIndex || $tryIndex <= $functionOpenIndex) { + return false; + } + $tryOpenIndex = $tokens->getNextTokenOfKind($tryIndex, ['{']); + $tryCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $tryOpenIndex); + + // Find catch or finally + $nextIndex = $tokens->getNextMeaningfulToken($tryCloseIndex); + if (null === $nextIndex) { + return false; + } + + // Find catches + while ($tokens[$nextIndex]->isGivenKind(T_CATCH)) { + $catchOpenIndex = $tokens->getNextTokenOfKind($nextIndex, ['{']); + $catchCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $catchOpenIndex); + + if ($catchCloseIndex >= $functionCloseIndex) { + return false; + } + $varIndex = $tokens->getNextTokenOfKind($catchOpenIndex, [$tokens[$returnVarIndex]]); + // Check if the variable is used in the finally block + if (null !== $varIndex && $varIndex < $catchCloseIndex) { + return true; + } + + $nextIndex = $tokens->getNextMeaningfulToken($catchCloseIndex); + if (null === $nextIndex) { + return false; + } + } + + if (!$tokens[$nextIndex]->isGivenKind(T_FINALLY)) { + return false; + } + + $finallyIndex = $nextIndex; + if ($finallyIndex >= $functionCloseIndex) { + return false; + } + $finallyOpenIndex = $tokens->getNextTokenOfKind($finallyIndex, ['{']); + $finallyCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $finallyOpenIndex); + $varIndex = $tokens->getNextTokenOfKind($finallyOpenIndex, [$tokens[$returnVarIndex]]); + // Check if the variable is used in the finally block + if (null !== $varIndex && $varIndex < $finallyCloseIndex) { + return true; + } + + return false; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/SimplifiedNullReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/SimplifiedNullReturnFixer.php index 800c21c1..38d13393 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/SimplifiedNullReturnFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/SimplifiedNullReturnFixer.php @@ -26,9 +26,6 @@ */ final class SimplifiedNullReturnFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -37,13 +34,13 @@ public function getDefinition(): FixerDefinitionInterface new CodeSample("isTokenKindFound(T_RETURN); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -88,7 +79,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void */ private function clear(Tokens $tokens, int $index): void { - while (!$tokens[++$index]->equals(';')) { + while (!$tokens[++$index]->equalsAny([';', [T_CLOSE_TAG]])) { if ($this->shouldClearToken($tokens, $index)) { $tokens->clearAt($index); } @@ -105,13 +96,16 @@ private function needFixing(Tokens $tokens, int $index): bool } $content = ''; - while (!$tokens[$index]->equals(';')) { + while (!$tokens[$index]->equalsAny([';', [T_CLOSE_TAG]])) { $index = $tokens->getNextMeaningfulToken($index); $content .= $tokens[$index]->getContent(); } + $lastTokenContent = $tokens[$index]->getContent(); + $content = substr($content, 0, -\strlen($lastTokenContent)); + $content = ltrim($content, '('); - $content = rtrim($content, ');'); + $content = rtrim($content, ')'); return 'null' === strtolower($content); } @@ -134,7 +128,8 @@ private function isStrictOrNullableReturnTypeFunction(Tokens $tokens, int $retur } while ($closingCurlyBraceIndex < $returnIndex); $possibleVoidIndex = $tokens->getPrevMeaningfulToken($openingCurlyBraceIndex); - $isStrictReturnType = $tokens[$possibleVoidIndex]->isGivenKind(T_STRING) && 'void' !== $tokens[$possibleVoidIndex]->getContent(); + $isStrictReturnType = $tokens[$possibleVoidIndex]->isGivenKind([T_STRING, CT::T_ARRAY_TYPEHINT]) + && 'void' !== $tokens[$possibleVoidIndex]->getContent(); $nullableTypeIndex = $tokens->getNextTokenOfKind($functionIndex, [[CT::T_NULLABLE_TYPE]]); $isNullableReturnType = null !== $nullableTypeIndex && $nullableTypeIndex < $openingCurlyBraceIndex; @@ -145,13 +140,32 @@ private function isStrictOrNullableReturnTypeFunction(Tokens $tokens, int $retur /** * Should we clear the specific token? * - * If the token is a comment, or is whitespace that is immediately before a - * comment, then we'll leave it alone. + * We'll leave it alone if + * - token is a comment + * - token is whitespace that is immediately before a comment + * - token is whitespace that is immediately before the PHP close tag + * - token is whitespace that is immediately after a comment and before a semicolon */ private function shouldClearToken(Tokens $tokens, int $index): bool { $token = $tokens[$index]; - return !$token->isComment() && !($token->isWhitespace() && $tokens[$index + 1]->isComment()); + if ($token->isComment()) { + return false; + } + + if (!$token->isWhitespace()) { + return true; + } + + if ( + $tokens[$index + 1]->isComment() + || $tokens[$index + 1]->equals([T_CLOSE_TAG]) + || ($tokens[$index - 1]->isComment() && $tokens[$index + 1]->equals(';')) + ) { + return false; + } + + return true; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php index d245196d..7931fda0 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -23,17 +24,28 @@ use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; /** * @author Graham Campbell * @author Egidijus Girčys + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * strategy?: 'new_line_for_chained_calls'|'no_multi_line' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * strategy: 'new_line_for_chained_calls'|'no_multi_line' + * } */ final class MultilineWhitespaceBeforeSemicolonsFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @internal */ @@ -44,9 +56,6 @@ final class MultilineWhitespaceBeforeSemicolonsFixer extends AbstractFixer imple */ public const STRATEGY_NEW_LINE_FOR_CHAINED_CALLS = 'new_line_for_chained_calls'; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -54,7 +63,7 @@ public function getDefinition(): FixerDefinitionInterface [ new CodeSample( 'method1() - ->method2() - ->method(3); - ?> +$object->method1() + ->method2() + ->method(3); ', ['strategy' => self::STRATEGY_NEW_LINE_FOR_CHAINED_CALLS] ), @@ -84,17 +92,11 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(';'); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -108,9 +110,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $lineEnding = $this->whitespacesConfig->getLineEnding(); @@ -123,7 +122,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $previousIndex = $index - 1; $previous = $tokens[$previousIndex]; - $indent = $this->findWhitespaceBeforeFirstCall($index - 1, $tokens); + $indent = $this->findWhitespaceBeforeFirstCall($index, $tokens); if (self::STRATEGY_NEW_LINE_FOR_CHAINED_CALLS === $this->configuration['strategy'] && null !== $indent) { if ($previous->isWhitespace() && $previous->getContent() === $lineEnding.$indent) { continue; @@ -150,7 +149,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $content = $previous->getContent(); if (str_starts_with($content, $lineEnding) && $tokens[$index - 2]->isComment()) { - // if there is comment between closing bracket and semicolon + // if there is comment between closing parenthesis and semicolon // unset whitespace and semicolon $tokens->clearAt($previousIndex); @@ -177,6 +176,9 @@ private function getNewLineIndex(int $index, Tokens $tokens): int $lineEnding = $this->whitespacesConfig->getLineEnding(); for ($index, $count = \count($tokens); $index < $count; ++$index) { + if (!$tokens[$index]->isWhitespace() && !$tokens[$index]->isComment()) { + break; + } if (false !== strstr($tokens[$index]->getContent(), $lineEnding)) { return $index; } @@ -207,7 +209,7 @@ private function getPreviousSignificantTokenIndex(int $index, Tokens $tokens): i } /** - * Checks if the semicolon closes a chained call and returns the whitespace of the first call at $index. + * Checks if the semicolon closes a multiline call and returns the whitespace of the first call at $index. * i.e. it will return the whitespace marked with '____' in the example underneath. * * .. @@ -217,102 +219,26 @@ private function getPreviousSignificantTokenIndex(int $index, Tokens $tokens): i */ private function findWhitespaceBeforeFirstCall(int $index, Tokens $tokens): ?string { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - $chained = false; - - // skip whitespace between semicolon and closed bracket - while ($tokens[$index]->isWhitespace() || $tokens[$index]->isComment()) { - --$index; - } - do { - // semicolon followed by a closing bracket? - if ($tokens[$index]->equals(')')) { - // find opening bracket - $openingBrackets = 1; - for (--$index; $index > 0; --$index) { - if ($tokens[$index]->equals(')')) { - ++$openingBrackets; - - continue; - } - - if ($tokens[$index]->equals('(')) { - if (1 === $openingBrackets) { - break; - } - --$openingBrackets; - } - } - --$index; - } + $isMultilineCall = false; + $prevIndex = $tokens->getPrevMeaningfulToken($index); - // method name - if (!$tokens[$index]->isGivenKind(T_STRING)) { - if (!$tokens[$index]->isGivenKind(CT::T_DYNAMIC_PROP_BRACE_CLOSE)) { - return null; - } - // find opening curly bracket - $openingCurlyBrackets = 1; - for (--$index; $index > 0; --$index) { - if ($tokens[$index]->isGivenKind(CT::T_DYNAMIC_PROP_BRACE_CLOSE)) { - ++$openingCurlyBrackets; - - continue; - } - - if ($tokens[$index]->isGivenKind(CT::T_DYNAMIC_PROP_BRACE_OPEN)) { - if (1 === $openingCurlyBrackets) { - break; - } - --$openingCurlyBrackets; - } - } - } + while (!$tokens[$prevIndex]->equalsAny([';', ':', '{', '}', [T_OPEN_TAG], [T_OPEN_TAG_WITH_ECHO], [T_ELSE]])) { + $index = $prevIndex; + $prevIndex = $tokens->getPrevMeaningfulToken($index); - // ->, ?-> or :: - if (!$tokens[--$index]->isObjectOperator() && !$tokens[$index]->isGivenKind(T_DOUBLE_COLON)) { - return null; - } + $blockType = Tokens::detectBlockType($tokens[$index]); + if (null !== $blockType && !$blockType['isStart']) { + $prevIndex = $tokens->findBlockStart($blockType['type'], $index); - while ($tokens[--$index]->isWhitespace() || $tokens[$index]->isComment()) { - if (false !== strstr($tokens[$index]->getContent(), $lineEnding)) { - $chained = true; - } - } - - while ($tokens[$index]->isGivenKind(T_STRING) && $tokens[$index - 1]->isGivenKind(T_NS_SEPARATOR) || $tokens[$index]->isGivenKind(T_NS_SEPARATOR) && $tokens[$index - 1]->isGivenKind(T_STRING)) { - --$index; + continue; } - } while (!($tokens[$index]->isGivenKind([T_VARIABLE, T_STRING, T_NS_SEPARATOR]) && $tokens[$index - 1]->isGivenKind([T_WHITESPACE, T_OPEN_TAG]) || $tokens[$index]->isGivenKind([CT::T_BRACE_CLASS_INSTANTIATION_CLOSE]))); - - return $chained ? $this->getIndentAt($tokens, $index) : null; - } - - private function getIndentAt(Tokens $tokens, int $index): ?string - { - $content = ''; - $lineEnding = $this->whitespacesConfig->getLineEnding(); - // find line ending token - for ($index; $index > 0; --$index) { - if (false !== strstr($tokens[$index]->getContent(), $lineEnding)) { - break; + if ($tokens[$index]->isObjectOperator() || $tokens[$index]->isGivenKind(T_DOUBLE_COLON)) { + $prevIndex = $tokens->getPrevMeaningfulToken($index); + $isMultilineCall = $isMultilineCall || $tokens->isPartialCodeMultiline($prevIndex, $index); } } - if ($tokens[$index]->isWhitespace()) { - $content = $tokens[$index]->getContent(); - --$index; - } - - if ($tokens[$index]->isGivenKind(T_OPEN_TAG)) { - $content = $tokens[$index]->getContent().$content; - } - - if (1 === Preg::match('/\R{1}(\h*)$/', $content, $matches)) { - return $matches[1]; - } - - return null; + return $isMultilineCall ? WhitespacesAnalyzer::detectIndent($tokens, $index) : null; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoEmptyStatementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoEmptyStatementFixer.php index 11b23f0d..15c1e670 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoEmptyStatementFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoEmptyStatementFixer.php @@ -26,9 +26,6 @@ */ final class NoEmptyStatementFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -52,17 +49,11 @@ public function getPriority(): int return 40; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(';'); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = 0, $count = $tokens->count(); $index < $count; ++$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixer.php index c3f0d135..f06d9d73 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixer.php @@ -25,9 +25,6 @@ */ final class NoSinglelineWhitespaceBeforeSemicolonsFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -39,24 +36,18 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run after CombineConsecutiveIssetsFixer, FunctionToConstantFixer, NoEmptyStatementFixer, NoUnneededImportAliasFixer, SimplifiedIfReturnFixer, SingleImportPerStatementFixer. + * Must run after CombineConsecutiveIssetsFixer, FunctionToConstantFixer, LongToShorthandOperatorFixer, NoEmptyStatementFixer, NoUnneededImportAliasFixer, SimplifiedIfReturnFixer, SingleImportPerStatementFixer. */ public function getPriority(): int { return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(';'); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SemicolonAfterInstructionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SemicolonAfterInstructionFixer.php index c9a9131f..2fe9ab07 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SemicolonAfterInstructionFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SemicolonAfterInstructionFixer.php @@ -23,9 +23,6 @@ final class SemicolonAfterInstructionFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -44,17 +41,11 @@ public function getPriority(): int return 2; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_CLOSE_TAG); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = \count($tokens) - 1; $index > 1; --$index) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SpaceAfterSemicolonFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SpaceAfterSemicolonFixer.php index 799ee5a8..f8e4084e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SpaceAfterSemicolonFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SpaceAfterSemicolonFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -26,11 +27,21 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * remove_in_empty_for_expressions?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * remove_in_empty_for_expressions: bool + * } + */ final class SpaceAfterSemicolonFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -60,17 +71,11 @@ public function getPriority(): int return -1; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(';'); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -81,9 +86,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $insideForParenthesesUntil = null; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/DeclareStrictTypesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/DeclareStrictTypesFixer.php index 76e26b47..b0ff7180 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/DeclareStrictTypesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/DeclareStrictTypesFixer.php @@ -27,13 +27,10 @@ */ final class DeclareStrictTypesFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Force strict types declaration in all files. Requires PHP >= 7.0.', + 'Force strict types declaration in all files.', [ new CodeSample( "isGivenKind(T_OPEN_TAG); + return $tokens->isMonolithicPhp() && !$tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { - // check if the declaration is already done - $searchIndex = $tokens->getNextMeaningfulToken(0); - if (null === $searchIndex) { - $this->insertSequence($tokens); // declaration not found, insert one + $openTagIndex = $tokens[0]->isGivenKind(T_INLINE_HTML) ? 1 : 0; - return; - } - - $sequenceLocation = $tokens->findSequence([[T_DECLARE, 'declare'], '(', [T_STRING, 'strict_types'], '=', [T_LNUMBER], ')'], $searchIndex, null, false); + $sequenceLocation = $tokens->findSequence([[T_DECLARE, 'declare'], '(', [T_STRING, 'strict_types'], '=', [T_LNUMBER], ')'], $openTagIndex, null, false); if (null === $sequenceLocation) { - $this->insertSequence($tokens); // declaration not found, insert one + $this->insertSequence($openTagIndex, $tokens); // declaration not found, insert one return; } @@ -114,7 +96,7 @@ private function fixStrictTypesCasingAndValue(Tokens $tokens, array $sequence): } } - private function insertSequence(Tokens $tokens): void + private function insertSequence(int $openTagIndex, Tokens $tokens): void { $sequence = [ new Token([T_DECLARE, 'declare']), @@ -125,28 +107,26 @@ private function insertSequence(Tokens $tokens): void new Token(')'), new Token(';'), ]; - $endIndex = \count($sequence); + $nextIndex = $openTagIndex + \count($sequence) + 1; - $tokens->insertAt(1, $sequence); + $tokens->insertAt($openTagIndex + 1, $sequence); - // start index of the sequence is always 1 here, 0 is always open tag - // transform "getContent(), "\n")) { - $tokens[0] = new Token([$tokens[0]->getId(), trim($tokens[0]->getContent()).' ']); + // transform "getContent(); + if (!str_contains($content, ' ') || str_contains($content, "\n")) { + $tokens[$openTagIndex] = new Token([$tokens[$openTagIndex]->getId(), trim($tokens[$openTagIndex]->getContent()).' ']); } - if ($endIndex === \count($tokens) - 1) { + if (\count($tokens) === $nextIndex) { return; // no more tokens after sequence, single_blank_line_at_eof might add a line } $lineEnding = $this->whitespacesConfig->getLineEnding(); - if (!$tokens[1 + $endIndex]->isWhitespace()) { - $tokens->insertAt(1 + $endIndex, new Token([T_WHITESPACE, $lineEnding])); - - return; + if ($tokens[$nextIndex]->isWhitespace()) { + $content = $tokens[$nextIndex]->getContent(); + $tokens[$nextIndex] = new Token([T_WHITESPACE, $lineEnding.ltrim($content, " \t")]); + } else { + $tokens->insertAt($nextIndex, new Token([T_WHITESPACE, $lineEnding])); } - - $content = $tokens[1 + $endIndex]->getContent(); - $tokens[1 + $endIndex] = new Token([T_WHITESPACE, $lineEnding.ltrim($content, " \t")]); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictComparisonFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictComparisonFixer.php index b60e98b3..18222c59 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictComparisonFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictComparisonFixer.php @@ -46,25 +46,16 @@ public function getPriority(): int return 38; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_IS_EQUAL, T_IS_NOT_EQUAL]); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { static $map = [ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictParamFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictParamFixer.php index fd269421..e0f12f33 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictParamFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictParamFixer.php @@ -28,9 +28,6 @@ */ final class StrictParamFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -41,17 +38,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_STRING); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; @@ -67,9 +58,6 @@ public function getPriority(): int return 31; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $functionsAnalyzer = new FunctionsAnalyzer(); @@ -103,6 +91,9 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } + /** + * @param list $functionParams + */ private function fixFunction(Tokens $tokens, int $functionIndex, array $functionParams): void { $startBraceIndex = $tokens->getNextTokenOfKind($functionIndex, ['(']); @@ -147,7 +138,7 @@ private function fixFunction(Tokens $tokens, int $functionIndex, array $function for ($i = $paramsQuantity; $i < $functionParamsQuantity; ++$i) { // function call do not have all params that are required to set useStrict flag, exit from method! - if (!$functionParams[$i]) { + if (null === $functionParams[$i]) { return; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/EscapeImplicitBackslashesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/EscapeImplicitBackslashesFixer.php index 4c53eba5..03a2e682 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/EscapeImplicitBackslashesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/EscapeImplicitBackslashesFixer.php @@ -14,40 +14,60 @@ namespace PhpCsFixer\Fixer\StringNotation; -use PhpCsFixer\AbstractFixer; +use PhpCsFixer\AbstractProxyFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\Fixer\DeprecatedFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; /** * @author Filippo Tessarotto + * @author Michael Vorisek + * + * @deprecated Use `string_implicit_backslashes` with config: ['single_quoted' => 'ignore', 'double_quoted' => 'escape', 'heredoc' => 'escape'] (default) + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * double_quoted?: bool, + * heredoc_syntax?: bool, + * single_quoted?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * double_quoted: bool, + * heredoc_syntax: bool, + * single_quoted: bool + * } */ -final class EscapeImplicitBackslashesFixer extends AbstractFixer implements ConfigurableFixerInterface +final class EscapeImplicitBackslashesFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public function getSuccessorsNames(): array + { + return array_keys($this->proxyFixers); + } + public function getDefinition(): FixerDefinitionInterface { $codeSample = <<<'EOF' -isAnyTokenKindsFound([T_ENCAPSED_AND_WHITESPACE, T_CONSTANT_ENCAPSED_STRING]); - } - /** * {@inheritdoc} * * Must run before HeredocToNowdocFixer, SingleQuoteFixer. - * Must run after BacktickToShellExecFixer. + * Must run after MultilineStringToHeredocFixer. */ public function getPriority(): int { - return 15; + return parent::getPriority(); } - /** - * {@inheritdoc} - */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + protected function configurePostNormalisation(): void { - static $singleQuotedRegex = '/(? $token) { - $content = $token->getContent(); - if ($token->equalsAny(['"', 'b"', 'B"'])) { - $doubleQuoteOpened = !$doubleQuoteOpened; - } - if (!$token->isGivenKind([T_ENCAPSED_AND_WHITESPACE, T_CONSTANT_ENCAPSED_STRING]) || !str_contains($content, '\\')) { - continue; - } - - // Nowdoc syntax - if ($token->isGivenKind(T_ENCAPSED_AND_WHITESPACE) && '\'' === substr(rtrim($tokens[$index - 1]->getContent()), -1)) { - continue; - } - - $firstTwoCharacters = strtolower(substr($content, 0, 2)); - $isSingleQuotedString = $token->isGivenKind(T_CONSTANT_ENCAPSED_STRING) && ('\'' === $content[0] || 'b\'' === $firstTwoCharacters); - $isDoubleQuotedString = - ($token->isGivenKind(T_CONSTANT_ENCAPSED_STRING) && ('"' === $content[0] || 'b"' === $firstTwoCharacters)) - || ($token->isGivenKind(T_ENCAPSED_AND_WHITESPACE) && $doubleQuoteOpened); - $isHeredocSyntax = !$isSingleQuotedString && !$isDoubleQuotedString; - if ( - (false === $this->configuration['single_quoted'] && $isSingleQuotedString) - || (false === $this->configuration['double_quoted'] && $isDoubleQuotedString) - || (false === $this->configuration['heredoc_syntax'] && $isHeredocSyntax) - ) { - continue; - } - - $regex = $heredocSyntaxRegex; - if ($isSingleQuotedString) { - $regex = $singleQuotedRegex; - } elseif ($isDoubleQuotedString) { - $regex = $doubleQuotedRegex; - } - - $newContent = Preg::replace($regex, '\\\\\\\\$1', $content); - if ($newContent !== $content) { - $tokens[$index] = new Token([$token->getId(), $newContent]); - } - } + /** @var StringImplicitBackslashesFixer */ + $stringImplicitBackslashesFixer = $this->proxyFixers['string_implicit_backslashes']; + + $stringImplicitBackslashesFixer->configure([ + 'single_quoted' => true === $this->configuration['single_quoted'] ? 'escape' : 'ignore', + 'double_quoted' => true === $this->configuration['double_quoted'] ? 'escape' : 'ignore', + 'heredoc' => true === $this->configuration['heredoc_syntax'] ? 'escape' : 'ignore', + ]); + } + + protected function createProxyFixers(): array + { + $stringImplicitBackslashesFixer = new StringImplicitBackslashesFixer(); + $stringImplicitBackslashesFixer->configure([ + 'single_quoted' => 'ignore', + 'double_quoted' => 'escape', + 'heredoc' => 'escape', + ]); + + return [ + $stringImplicitBackslashesFixer, + ]; } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/ExplicitStringVariableFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/ExplicitStringVariableFixer.php index 43fc2d90..1671940c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/ExplicitStringVariableFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/ExplicitStringVariableFixer.php @@ -27,52 +27,44 @@ */ final class ExplicitStringVariableFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'Converts implicit variables into explicit ones in double-quoted strings or heredoc syntax.', [new CodeSample( <<<'EOT' -country !"; -$c = "I have $farm[0] chickens !"; + country !"; + $c = "I have $farm[0] chickens !"; -EOT + EOT )], 'The reasoning behind this rule is the following:' - ."\n".'- When there are two valid ways of doing the same thing, using both is confusing, there should be a coding standard to follow' - ."\n".'- PHP manual marks `"$var"` syntax as implicit and `"${var}"` syntax as explicit: explicit code should always be preferred' - ."\n".'- Explicit syntax allows word concatenation inside strings, e.g. `"${var}IsAVar"`, implicit doesn\'t' - ."\n".'- Explicit syntax is easier to detect for IDE/editors and therefore has colors/highlight with higher contrast, which is easier to read' - ."\n".'Backtick operator is skipped because it is harder to handle; you can use `backtick_to_shell_exec` fixer to normalize backticks to strings' + ."\n".'- When there are two valid ways of doing the same thing, using both is confusing, there should be a coding standard to follow.' + ."\n".'- PHP manual marks `"$var"` syntax as implicit and `"{$var}"` syntax as explicit: explicit code should always be preferred.' + ."\n".'- Explicit syntax allows word concatenation inside strings, e.g. `"{$var}IsAVar"`, implicit doesn\'t.' + ."\n".'- Explicit syntax is easier to detect for IDE/editors and therefore has colors/highlight with higher contrast, which is easier to read.' + ."\n".'Backtick operator is skipped because it is harder to handle; you can use `backtick_to_shell_exec` fixer to normalize backticks to strings.' ); } /** * {@inheritdoc} * + * Must run before NoUselessConcatOperatorFixer. * Must run after BacktickToShellExecFixer. */ public function getPriority(): int { - return 0; + return 6; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_VARIABLE); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $backtickStarted = false; @@ -132,7 +124,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void foreach ($variableTokens as $distinctVariableSet) { if (1 === \count($distinctVariableSet['tokens'])) { - $singleVariableIndex = key($distinctVariableSet['tokens']); + $singleVariableIndex = array_key_first($distinctVariableSet['tokens']); $singleVariableToken = current($distinctVariableSet['tokens']); $tokens->overrideRange($singleVariableIndex, $singleVariableIndex, [ new Token([T_CURLY_OPEN, '{']), diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocClosingMarkerFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocClosingMarkerFixer.php new file mode 100644 index 00000000..dda5025d --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocClosingMarkerFixer.php @@ -0,0 +1,205 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\StringNotation; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Michael Vorisek + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * closing_marker?: string, + * explicit_heredoc_style?: bool, + * reserved_closing_markers?: list + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * closing_marker: string, + * explicit_heredoc_style: bool, + * reserved_closing_markers: list + * } + */ +final class HeredocClosingMarkerFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + /** + * @var list + */ + public const RESERVED_CLOSING_MARKERS = [ + 'CSS', + 'DIFF', + 'HTML', + 'JS', + 'JSON', + 'MD', + 'PHP', + 'PYTHON', + 'RST', + 'TS', + 'SQL', + 'XML', + 'YAML', + ]; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Unify `heredoc` or `nowdoc` closing marker.', + [ + new CodeSample( + <<<'EOD' + 'EOF'] + ), + new CodeSample( + <<<'EOD_' + true] + ), + ] + ); + } + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isTokenKindFound(T_START_HEREDOC); + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder( + 'closing_marker', + 'Preferred closing marker.' + )) + ->setAllowedTypes(['string']) + ->setDefault('EOD') + ->getOption(), + (new FixerOptionBuilder( + 'reserved_closing_markers', + 'Reserved closing markers to be kept unchanged.' + )) + ->setAllowedTypes(['string[]']) + ->setDefault(self::RESERVED_CLOSING_MARKERS) + ->getOption(), + (new FixerOptionBuilder( + 'explicit_heredoc_style', + 'Whether the closing marker should be wrapped in double quotes.' + )) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + ]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $reservedClosingMarkersMap = null; + + $startIndex = null; + foreach ($tokens as $index => $token) { + if ($token->isGivenKind(T_START_HEREDOC)) { + $startIndex = $index; + + continue; + } + + if (null !== $startIndex && $token->isGivenKind(T_END_HEREDOC)) { + $existingClosingMarker = trim($token->getContent()); + + if (null === $reservedClosingMarkersMap) { + $reservedClosingMarkersMap = []; + foreach ($this->configuration['reserved_closing_markers'] as $v) { + $reservedClosingMarkersMap[mb_strtoupper($v)] = $v; + } + } + + $existingClosingMarker = mb_strtoupper($existingClosingMarker); + do { + $newClosingMarker = $reservedClosingMarkersMap[$existingClosingMarker] ?? null; + if (!str_ends_with($existingClosingMarker, '_')) { + break; + } + $existingClosingMarker = substr($existingClosingMarker, 0, -1); + } while (null === $newClosingMarker); + + if (null === $newClosingMarker) { + $newClosingMarker = $this->configuration['closing_marker']; + } + + $content = $tokens->generatePartialCode($startIndex + 1, $index - 1); + while (Preg::match('~(^|[\r\n])\s*'.preg_quote($newClosingMarker, '~').'(?!\w)~', $content)) { + $newClosingMarker .= '_'; + } + + [$tokens[$startIndex], $tokens[$index]] = $this->convertClosingMarker($tokens[$startIndex], $token, $newClosingMarker); + + $startIndex = null; + + continue; + } + } + } + + /** + * @return array{Token, Token} + */ + private function convertClosingMarker(Token $startToken, Token $endToken, string $newClosingMarker): array + { + $isNowdoc = str_contains($startToken->getContent(), '\''); + + $markerQuote = $isNowdoc + ? '\'' + : (true === $this->configuration['explicit_heredoc_style'] ? '"' : ''); + + return [new Token([ + $startToken->getId(), + Preg::replace('/<<<\h*\K["\']?[^\s"\']+["\']?/', $markerQuote.$newClosingMarker.$markerQuote, $startToken->getContent()), + ]), new Token([ + $endToken->getId(), + Preg::replace('/\S+/', $newClosingMarker, $endToken->getContent()), + ])]; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocToNowdocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocToNowdocFixer.php index 185cc8bc..9c736c14 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocToNowdocFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocToNowdocFixer.php @@ -27,9 +27,6 @@ */ final class HeredocToNowdocFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -37,11 +34,11 @@ public function getDefinition(): FixerDefinitionInterface [ new CodeSample( <<<'EOF' -isTokenKindFound(T_START_HEREDOC); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -90,12 +81,12 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $content = $tokens[$index + 1]->getContent(); // regex: odd number of backslashes, not followed by dollar - if (Preg::match('/(?convertToNowdoc($token); - $content = str_replace(['\\\\', '\\$'], ['\\', '$'], $content); + $content = str_replace(['\\\\', '\$'], ['\\', '$'], $content); $tokens[$index + 1] = new Token([ $tokens[$index + 1]->getId(), $content, diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/MultilineStringToHeredocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/MultilineStringToHeredocFixer.php new file mode 100644 index 00000000..1a6790e6 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/MultilineStringToHeredocFixer.php @@ -0,0 +1,166 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\StringNotation; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Michael Vorisek + */ +final class MultilineStringToHeredocFixer extends AbstractFixer +{ + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Convert multiline string to `heredoc` or `nowdoc`.', + [ + new CodeSample( + <<<'EOD' + getName()}"; + EOD."\n" + ), + ] + ); + } + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isAnyTokenKindsFound([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE]); + } + + /** + * {@inheritdoc} + * + * Must run before EscapeImplicitBackslashesFixer, HeredocIndentationFixer, StringImplicitBackslashesFixer. + */ + public function getPriority(): int + { + return 16; + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $inHeredoc = false; + $complexStringStartIndex = null; + foreach ($tokens as $index => $token) { + if ($token->isGivenKind([T_START_HEREDOC, T_END_HEREDOC])) { + $inHeredoc = $token->isGivenKind(T_START_HEREDOC) || !$token->isGivenKind(T_END_HEREDOC); + + continue; + } + + if (null === $complexStringStartIndex) { + if ($token->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { + $this->convertStringToHeredoc($tokens, $index, $index); + + // skip next 2 added tokens if replaced + if ($tokens[$index]->isGivenKind(T_START_HEREDOC)) { + $inHeredoc = true; + } + } elseif ($token->equalsAny(['"', 'b"', 'B"'])) { + $complexStringStartIndex = $index; + } + } elseif ($token->equals('"')) { + $this->convertStringToHeredoc($tokens, $complexStringStartIndex, $index); + + $complexStringStartIndex = null; + } + } + } + + private function convertStringToHeredoc(Tokens $tokens, int $stringStartIndex, int $stringEndIndex): void + { + $closingMarker = 'EOD'; + + if ($tokens[$stringStartIndex]->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { + $content = $tokens[$stringStartIndex]->getContent(); + if ('b' === strtolower(substr($content, 0, 1))) { + $content = substr($content, 1); + } + $isSingleQuoted = str_starts_with($content, '\''); + $content = substr($content, 1, -1); + + if ($isSingleQuoted) { + $content = Preg::replace('~\\\([\\\\\'])~', '$1', $content); + } else { + $content = Preg::replace('~(\\\\\\\)|\\\(")~', '$1$2', $content); + } + + $constantStringToken = new Token([T_ENCAPSED_AND_WHITESPACE, $content."\n"]); + } else { + $content = $tokens->generatePartialCode($stringStartIndex + 1, $stringEndIndex - 1); + $isSingleQuoted = false; + $constantStringToken = null; + } + + if (!str_contains($content, "\n") && !str_contains($content, "\r")) { + return; + } + + while (Preg::match('~(^|[\r\n])\s*'.preg_quote($closingMarker, '~').'(?!\w)~', $content)) { + $closingMarker .= '_'; + } + + $quoting = $isSingleQuoted ? '\'' : ''; + $heredocStartToken = new Token([T_START_HEREDOC, '<<<'.$quoting.$closingMarker.$quoting."\n"]); + $heredocEndToken = new Token([T_END_HEREDOC, $closingMarker]); + + if (null !== $constantStringToken) { + $tokens->overrideRange($stringStartIndex, $stringEndIndex, [ + $heredocStartToken, + $constantStringToken, + $heredocEndToken, + ]); + } else { + for ($i = $stringStartIndex + 1; $i < $stringEndIndex; ++$i) { + if ($tokens[$i]->isGivenKind(T_ENCAPSED_AND_WHITESPACE)) { + $tokens[$i] = new Token([ + $tokens[$i]->getId(), + Preg::replace('~(\\\\\\\)|\\\(")~', '$1$2', $tokens[$i]->getContent()), + ]); + } + } + + $tokens[$stringStartIndex] = $heredocStartToken; + $tokens[$stringEndIndex] = $heredocEndToken; + if ($tokens[$stringEndIndex - 1]->isGivenKind(T_ENCAPSED_AND_WHITESPACE)) { + $tokens[$stringEndIndex - 1] = new Token([ + $tokens[$stringEndIndex - 1]->getId(), + $tokens[$stringEndIndex - 1]->getContent()."\n", + ]); + } else { + $tokens->insertAt($stringEndIndex, new Token([ + T_ENCAPSED_AND_WHITESPACE, + "\n", + ])); + } + } + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoBinaryStringFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoBinaryStringFixer.php index ccb8bb5a..3c41ab5b 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoBinaryStringFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoBinaryStringFixer.php @@ -26,9 +26,6 @@ */ final class NoBinaryStringFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound( @@ -40,9 +37,6 @@ public function isCandidate(Tokens $tokens): bool ); } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -64,9 +58,6 @@ public function getPriority(): int return 40; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoTrailingWhitespaceInStringFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoTrailingWhitespaceInStringFixer.php index 8ba97ff1..5e046073 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoTrailingWhitespaceInStringFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoTrailingWhitespaceInStringFixer.php @@ -27,25 +27,16 @@ */ final class NoTrailingWhitespaceInStringFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE, T_INLINE_HTML]); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -60,9 +51,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = $tokens->count() - 1, $last = true; $index >= 0; --$index, $last = false) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SimpleToComplexStringVariableFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SimpleToComplexStringVariableFixer.php index 53ccabae..9c6b4852 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SimpleToComplexStringVariableFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SimpleToComplexStringVariableFixer.php @@ -27,9 +27,6 @@ */ final class SimpleToComplexStringVariableFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -37,21 +34,21 @@ public function getDefinition(): FixerDefinitionInterface [ new CodeSample( <<<'EOT' -isTokenKindFound(T_DOLLAR_OPEN_CURLY_BRACES); @@ -79,38 +73,24 @@ public function isCandidate(Tokens $tokens): bool protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = \count($tokens) - 3; $index > 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_DOLLAR_OPEN_CURLY_BRACES)) { + if (!$tokens[$index]->isGivenKind(T_DOLLAR_OPEN_CURLY_BRACES)) { continue; } - $varnameToken = $tokens[$index + 1]; if (!$varnameToken->isGivenKind(T_STRING_VARNAME)) { continue; } - $dollarCloseToken = $tokens[$index + 2]; + $dollarCloseToken = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_COMPLEX_STRING_VARIABLE, $index); - if (!$dollarCloseToken->isGivenKind(CT::T_DOLLAR_CLOSE_CURLY_BRACES)) { - continue; + $prevTokenContent = $tokens[$index - 1]->getContent(); + if (str_ends_with($prevTokenContent, '$') && !str_ends_with($prevTokenContent, '\$')) { + $tokens[$index - 1] = new Token([T_ENCAPSED_AND_WHITESPACE, substr($prevTokenContent, 0, -1).'\$']); } - - $tokenOfStringBeforeToken = $tokens[$index - 1]; - $stringContent = $tokenOfStringBeforeToken->getContent(); - - if (str_ends_with($stringContent, '$') && !str_ends_with($stringContent, '\\$')) { - $newContent = substr($stringContent, 0, -1).'\\$'; - $tokenOfStringBeforeToken = new Token([T_ENCAPSED_AND_WHITESPACE, $newContent]); - } - - $tokens->overrideRange($index - 1, $index + 2, [ - $tokenOfStringBeforeToken, - new Token([T_CURLY_OPEN, '{']), - new Token([T_VARIABLE, '$'.$varnameToken->getContent()]), - new Token([CT::T_CURLY_CLOSE, '}']), - ]); + $tokens[$index] = new Token([T_CURLY_OPEN, '{']); + $tokens[$index + 1] = new Token([T_VARIABLE, '$'.$varnameToken->getContent()]); + $tokens[$dollarCloseToken] = new Token([CT::T_CURLY_CLOSE, '}']); } } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SingleQuoteFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SingleQuoteFixer.php index 21a565c8..6541699c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SingleQuoteFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SingleQuoteFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -28,21 +29,30 @@ /** * @author Gregor Harlan + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * strings_containing_single_quote_chars?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * strings_containing_single_quote_chars: bool + * } */ final class SingleQuoteFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { $codeSample = <<<'EOF' -isTokenKindFound(T_CONSTANT_ENCAPSED_STRING); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -97,18 +101,15 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void '"' === $content[0] && (true === $this->configuration['strings_containing_single_quote_chars'] || !str_contains($content, "'")) // regex: odd number of backslashes, not followed by double quote or dollar - && !Preg::match('/(? + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\StringNotation; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Filippo Tessarotto + * @author Michael Vorisek + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * double_quoted?: 'escape'|'ignore'|'unescape', + * heredoc?: 'escape'|'ignore'|'unescape', + * single_quoted?: 'escape'|'ignore'|'unescape' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * double_quoted: 'escape'|'ignore'|'unescape', + * heredoc: 'escape'|'ignore'|'unescape', + * single_quoted: 'escape'|'ignore'|'unescape' + * } + */ +final class StringImplicitBackslashesFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public function getDefinition(): FixerDefinitionInterface + { + $codeSample = <<<'EOF' + 'escape'] + ), + new CodeSample( + $codeSample, + ['double_quoted' => 'unescape'] + ), + new CodeSample( + $codeSample, + ['heredoc' => 'unescape'] + ), + ], + 'In PHP double-quoted strings and heredocs some chars like `n`, `$` or `u` have special meanings if preceded by a backslash ' + .'(and some are special only if followed by other special chars), while a backslash preceding other chars are interpreted like a plain ' + .'backslash. The precise list of those special chars is hard to remember and to identify quickly: this fixer escapes backslashes ' + ."that do not start a special interpretation with the char after them.\n" + .'It is possible to fix also single-quoted strings: in this case there is no special chars apart from single-quote and backslash ' + .'itself, so the fixer simply ensure that all backslashes are escaped. Both single and double backslashes are allowed in single-quoted ' + .'strings, so the purpose in this context is mainly to have a uniformed way to have them written all over the codebase.' + ); + } + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isAnyTokenKindsFound([T_ENCAPSED_AND_WHITESPACE, T_CONSTANT_ENCAPSED_STRING]); + } + + /** + * {@inheritdoc} + * + * Must run before HeredocToNowdocFixer, SingleQuoteFixer. + * Must run after MultilineStringToHeredocFixer. + */ + public function getPriority(): int + { + return 15; + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $singleQuotedReservedRegex = '[\'\\\]'; + $doubleQuotedReservedRegex = '(?:[efnrtv$"\\\0-7]|x[0-9A-Fa-f]|u{|$)'; + $heredocSyntaxReservedRegex = '(?:[efnrtv$\\\0-7]|x[0-9A-Fa-f]|u{|$)'; + + $doubleQuoteOpened = false; + foreach ($tokens as $index => $token) { + if ($token->equalsAny(['"', 'b"', 'B"'])) { + $doubleQuoteOpened = !$doubleQuoteOpened; + } + + if (!$token->isGivenKind([T_ENCAPSED_AND_WHITESPACE, T_CONSTANT_ENCAPSED_STRING])) { + continue; + } + + $content = $token->getContent(); + if (!str_contains($content, '\\')) { + continue; + } + + // nowdoc syntax + if ($token->isGivenKind(T_ENCAPSED_AND_WHITESPACE) && '\'' === substr(rtrim($tokens[$index - 1]->getContent()), -1)) { + continue; + } + + $firstTwoCharacters = strtolower(substr($content, 0, 2)); + $isSingleQuotedString = $token->isGivenKind(T_CONSTANT_ENCAPSED_STRING) && ('\'' === $content[0] || 'b\'' === $firstTwoCharacters); + $isDoubleQuotedString = + ($token->isGivenKind(T_CONSTANT_ENCAPSED_STRING) && ('"' === $content[0] || 'b"' === $firstTwoCharacters)) + || ($token->isGivenKind(T_ENCAPSED_AND_WHITESPACE) && $doubleQuoteOpened); + + if ($isSingleQuotedString + ? 'ignore' === $this->configuration['single_quoted'] + : ($isDoubleQuotedString + ? 'ignore' === $this->configuration['double_quoted'] + : 'ignore' === $this->configuration['heredoc']) + ) { + continue; + } + + $escapeBackslashes = $isSingleQuotedString + ? 'escape' === $this->configuration['single_quoted'] + : ($isDoubleQuotedString + ? 'escape' === $this->configuration['double_quoted'] + : 'escape' === $this->configuration['heredoc']); + + $reservedRegex = $isSingleQuotedString + ? $singleQuotedReservedRegex + : ($isDoubleQuotedString + ? $doubleQuotedReservedRegex + : $heredocSyntaxReservedRegex); + + if ($escapeBackslashes) { + $regex = '/(?getId(), $newContent]); + } + } + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('single_quoted', 'Whether to escape backslashes in single-quoted strings.')) + ->setAllowedValues(['escape', 'unescape', 'ignore']) + ->setDefault('unescape') + ->getOption(), + (new FixerOptionBuilder('double_quoted', 'Whether to escape backslashes in double-quoted strings.')) + ->setAllowedValues(['escape', 'unescape', 'ignore']) + ->setDefault('escape') + ->getOption(), + (new FixerOptionBuilder('heredoc', 'Whether to escape backslashes in heredoc syntax.')) + ->setAllowedValues(['escape', 'unescape', 'ignore']) + ->setDefault('escape') + ->getOption(), + ]); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLengthToEmptyFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLengthToEmptyFixer.php index 8ea1447a..361cc73c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLengthToEmptyFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLengthToEmptyFixer.php @@ -24,9 +24,6 @@ final class StringLengthToEmptyFixer extends AbstractFunctionReferenceFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -41,16 +38,13 @@ public function getDefinition(): FixerDefinitionInterface * {@inheritdoc} * * Must run before NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer. - * Must run after NoSpacesInsideParenthesisFixer. + * Must run after NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. */ public function getPriority(): int { return 1; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $argumentsAnalyzer = new ArgumentsAnalyzer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLineEndingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLineEndingFixer.php index 7e50c736..aae69262 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLineEndingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLineEndingFixer.php @@ -30,25 +30,16 @@ */ final class StringLineEndingFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE, T_INLINE_HTML]); } - /** - * {@inheritdoc} - */ public function isRisky(): bool { return true; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -63,9 +54,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $ending = $this->whitespacesConfig->getLineEnding(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/ArrayIndentationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/ArrayIndentationFixer.php index e6d02002..80ef9ef9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/ArrayIndentationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/ArrayIndentationFixer.php @@ -29,9 +29,6 @@ final class ArrayIndentationFixer extends AbstractFixer implements WhitespacesAw { use Indentation; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -42,12 +39,9 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { - return $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN]); + return $tokens->isAnyTokenKindsFound([T_ARRAY, T_LIST, CT::T_ARRAY_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN]); } /** @@ -76,13 +70,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } if ( - $token->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN) - || ($token->equals('(') && $tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(T_ARRAY)) + $token->isGivenKind([CT::T_ARRAY_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN]) + || ($token->equals('(') && $tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind([T_ARRAY, T_LIST])) ) { - $endIndex = $tokens->findBlockEnd( - $token->equals('(') ? Tokens::BLOCK_TYPE_PARENTHESIS_BRACE : Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, - $index - ); + $blockType = Tokens::detectBlockType($token); + $endIndex = $tokens->findBlockEnd($blockType['type'], $index); $scopes[] = [ 'type' => 'array', @@ -181,7 +173,9 @@ private function findExpressionEndIndex(Tokens $tokens, int $index, int $parentS for ($searchEndIndex = $index + 1; $searchEndIndex < $parentScopeEndIndex; ++$searchEndIndex) { $searchEndToken = $tokens[$searchEndIndex]; - if ($searchEndToken->equalsAny(['(', '{']) || $searchEndToken->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { + if ($searchEndToken->equalsAny(['(', '{']) + || $searchEndToken->isGivenKind([CT::T_ARRAY_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN]) + ) { $type = Tokens::detectBlockType($searchEndToken); $searchEndIndex = $tokens->findBlockEnd( $type['type'], diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBeforeStatementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBeforeStatementFixer.php index 87b18997..9256de3b 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBeforeStatementFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBeforeStatementFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; @@ -31,13 +32,25 @@ /** * @author Dariusz Rumiński * @author Andreas Möller + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * statements?: list<'break'|'case'|'continue'|'declare'|'default'|'do'|'exit'|'for'|'foreach'|'goto'|'if'|'include'|'include_once'|'phpdoc'|'require'|'require_once'|'return'|'switch'|'throw'|'try'|'while'|'yield'|'yield_from'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * statements: list<'break'|'case'|'continue'|'declare'|'default'|'do'|'exit'|'for'|'foreach'|'goto'|'if'|'include'|'include_once'|'phpdoc'|'require'|'require_once'|'return'|'switch'|'throw'|'try'|'while'|'yield'|'yield_from'> + * } */ final class BlankLineBeforeStatementFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** * @var array */ - private static array $tokenMap = [ + private const TOKEN_MAP = [ 'break' => T_BREAK, 'case' => T_CASE, 'continue' => T_CONTINUE, @@ -68,25 +81,6 @@ final class BlankLineBeforeStatementFixer extends AbstractFixer implements Confi */ private array $fixTokenMap = []; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - parent::configure($configuration); - - $this->fixTokenMap = []; - - foreach ($this->configuration['statements'] as $key) { - $this->fixTokenMap[$key] = self::$tokenMap[$key]; - } - - $this->fixTokenMap = array_values($this->fixTokenMap); - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -227,10 +221,11 @@ function A() { ), new CodeSample( 'isAnyTokenKindsFound($this->fixTokenMap); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + $fixTokenMap = []; + + foreach ($this->configuration['statements'] as $key) { + $fixTokenMap[$key] = self::TOKEN_MAP[$key]; + } + + $this->fixTokenMap = array_values($fixTokenMap); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $analyzer = new TokensAnalyzer($tokens); @@ -277,25 +277,27 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - $prevNonWhitespace = $tokens->getPrevNonWhitespace($index); + if ($token->isGivenKind(T_CASE) && $analyzer->isEnumCase($index)) { + continue; + } + + $insertBlankLineIndex = $this->getInsertBlankLineIndex($tokens, $index); + $prevNonWhitespace = $tokens->getPrevNonWhitespace($insertBlankLineIndex); if ($this->shouldAddBlankLine($tokens, $prevNonWhitespace)) { - $this->insertBlankLine($tokens, $index); + $this->insertBlankLine($tokens, $insertBlankLineIndex); } $index = $prevNonWhitespace; } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('statements', 'List of statements which must be preceded by an empty line.')) - ->setAllowedTypes(['array']) - ->setAllowedValues([new AllowedValueSubset(array_keys(self::$tokenMap))]) + ->setAllowedTypes(['string[]']) + ->setAllowedValues([new AllowedValueSubset(array_keys(self::TOKEN_MAP))]) ->setDefault([ 'break', 'continue', @@ -308,6 +310,33 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn ]); } + private function getInsertBlankLineIndex(Tokens $tokens, int $index): int + { + while ($index > 0) { + if ($tokens[$index - 1]->isWhitespace() && substr_count($tokens[$index - 1]->getContent(), "\n") > 1) { + break; + } + + $prevIndex = $tokens->getPrevNonWhitespace($index); + + if (!$tokens[$prevIndex]->isComment()) { + break; + } + + if (!$tokens[$prevIndex - 1]->isWhitespace()) { + break; + } + + if (1 !== substr_count($tokens[$prevIndex - 1]->getContent(), "\n")) { + break; + } + + $index = $prevIndex; + } + + return $index; + } + private function shouldAddBlankLine(Tokens $tokens, int $prevNonWhitespace): bool { $prevNonWhitespaceToken = $tokens[$prevNonWhitespace]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBetweenImportGroupsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBetweenImportGroupsFixer.php index e5e0de0e..7bd48ca6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBetweenImportGroupsFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBetweenImportGroupsFixer.php @@ -19,8 +19,8 @@ use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Tokenizer\TokensAnalyzer; @@ -35,9 +35,6 @@ final class BlankLineBetweenImportGroupsFixer extends AbstractFixer implements W private const IMPORT_TYPE_FUNCTION = 'function'; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -98,17 +95,11 @@ public function getPriority(): int return -40; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_USE); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $tokensAnalyzer = new TokensAnalyzer($tokens); @@ -120,7 +111,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } /** - * @param int[] $uses + * @param list $uses */ private function walkOverUses(Tokens $tokens, array $uses): void { @@ -163,12 +154,9 @@ private function ensureLine(Tokens $tokens, int $index): void } $index = $this->getInsertIndex($tokens, $index); + $indent = WhitespacesAnalyzer::detectIndent($tokens, $index); - if ($tokens[$index]->isWhitespace()) { - $tokens[$index] = new Token([T_WHITESPACE, $lineEnding]); - } else { - $tokens->insertSlices([$index + 1 => [new Token([T_WHITESPACE, $lineEnding])]]); - } + $tokens->ensureWhitespaceAtIndex($index, 1, $lineEnding.$indent); } private function getInsertIndex(Tokens $tokens, int $index): int diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypeDeclarationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypeDeclarationFixer.php new file mode 100644 index 00000000..e1af647e --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypeDeclarationFixer.php @@ -0,0 +1,72 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Whitespace; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @author Jack Cherng + */ +final class CompactNullableTypeDeclarationFixer extends AbstractFixer +{ + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Remove extra spaces in a nullable type declaration.', + [ + new CodeSample( + "isTokenKindFound(CT::T_NULLABLE_TYPE); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + static $typehintKinds = [ + CT::T_ARRAY_TYPEHINT, + T_CALLABLE, + T_NS_SEPARATOR, + T_STATIC, + T_STRING, + ]; + + for ($index = $tokens->count() - 1; $index >= 0; --$index) { + if (!$tokens[$index]->isGivenKind(CT::T_NULLABLE_TYPE)) { + continue; + } + + // remove whitespaces only if there are only whitespaces + // between '?' and the variable type + if ( + $tokens[$index + 1]->isWhitespace() + && $tokens[$index + 2]->isGivenKind($typehintKinds) + ) { + $tokens->removeTrailingWhitespace($index); + } + } + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypehintFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypehintFixer.php index 042d8284..89c4ec65 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypehintFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypehintFixer.php @@ -14,67 +14,50 @@ namespace PhpCsFixer\Fixer\Whitespace; -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\AbstractProxyFixer; +use PhpCsFixer\Fixer\DeprecatedFixerInterface; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; /** * @author Jack Cherng + * + * @deprecated */ -final class CompactNullableTypehintFixer extends AbstractFixer +final class CompactNullableTypehintFixer extends AbstractProxyFixer implements DeprecatedFixerInterface { - /** - * {@inheritdoc} - */ + private CompactNullableTypeDeclarationFixer $compactNullableTypeDeclarationFixer; + + public function __construct() + { + $this->compactNullableTypeDeclarationFixer = new CompactNullableTypeDeclarationFixer(); + + parent::__construct(); + } + public function getDefinition(): FixerDefinitionInterface { + $fixerDefinition = $this->compactNullableTypeDeclarationFixer->getDefinition(); + return new FixerDefinition( 'Remove extra spaces in a nullable typehint.', - [ - new CodeSample( - "getCodeSamples(), + $fixerDefinition->getDescription(), + $fixerDefinition->getRiskyDescription(), ); } - /** - * {@inheritdoc} - */ - public function isCandidate(Tokens $tokens): bool + public function getSuccessorsNames(): array { - return $tokens->isTokenKindFound(CT::T_NULLABLE_TYPE); + return [ + $this->compactNullableTypeDeclarationFixer->getName(), + ]; } - /** - * {@inheritdoc} - */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + protected function createProxyFixers(): array { - static $typehintKinds = [ - CT::T_ARRAY_TYPEHINT, - T_CALLABLE, - T_NS_SEPARATOR, - T_STRING, + return [ + $this->compactNullableTypeDeclarationFixer, ]; - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if (!$tokens[$index]->isGivenKind(CT::T_NULLABLE_TYPE)) { - continue; - } - - // remove whitespaces only if there are only whitespaces - // between '?' and the variable type - if ( - $tokens[$index + 1]->isWhitespace() - && $tokens[$index + 2]->isGivenKind($typehintKinds) - ) { - $tokens->removeTrailingWhitespace($index); - } - } } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/HeredocIndentationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/HeredocIndentationFixer.php index 37a1916a..67b9d283 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/HeredocIndentationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/HeredocIndentationFixer.php @@ -16,14 +16,14 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; use PhpCsFixer\Preg; use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; use PhpCsFixer\Tokenizer\Token; @@ -31,52 +31,51 @@ /** * @author Gregor Harlan + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * indentation?: 'same_as_start'|'start_plus_one' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * indentation: 'same_as_start'|'start_plus_one' + * } */ final class HeredocIndentationFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( - 'Heredoc/nowdoc content must be properly indented. Requires PHP >= 7.3.', + 'Heredoc/nowdoc content must be properly indented.', [ - new VersionSpecificCodeSample( - <<<'SAMPLE' - 'same_as_start'] ), ] @@ -86,24 +85,18 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run after BracesFixer, StatementIndentationFixer. + * Must run after BracesFixer, MultilineStringToHeredocFixer, StatementIndentationFixer. */ public function getPriority(): int { return -26; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isTokenKindFound(T_START_HEREDOC); } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -147,7 +140,9 @@ private function fixIndentation(Tokens $tokens, int $start, int $end): void return; } - for ($index = $end - 1, $last = true; $index > $start; --$index, $last = false) { + $index = $end - 1; + + for ($last = true; $index > $start; --$index, $last = false) { if (!$tokens[$index]->isGivenKind([T_ENCAPSED_AND_WHITESPACE, T_WHITESPACE])) { continue; } @@ -158,7 +153,7 @@ private function fixIndentation(Tokens $tokens, int $start, int $end): void $content = Preg::replace('/(?<=\v)(?!'.$currentIndent.')\h+/', '', $content); } - $regexEnd = $last && !$currentIndent ? '(?!\v|$)' : '(?!\v)'; + $regexEnd = $last && '' === $currentIndent ? '(?!\v|$)' : '(?!\v)'; $content = Preg::replace('/(?<=\v)'.$currentIndent.$regexEnd.'/', $indent, $content); $tokens[$index] = new Token([$tokens[$index]->getId(), $content]); @@ -174,9 +169,9 @@ private function fixIndentation(Tokens $tokens, int $start, int $end): void $content = $tokens[$index]->getContent(); - if (!\in_array($content[0], ["\r", "\n"], true) && (!$currentIndent || str_starts_with($content, $currentIndent))) { + if (!\in_array($content[0], ["\r", "\n"], true) && ('' === $currentIndent || str_starts_with($content, $currentIndent))) { $content = $indent.substr($content, $currentIndentLength); - } elseif ($currentIndent) { + } elseif ('' !== $currentIndent) { $content = Preg::replace('/^(?!'.$currentIndent.')\h+/', '', $content); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/IndentationTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/IndentationTypeFixer.php index 14a1d29e..4d332cc1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/IndentationTypeFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/IndentationTypeFixer.php @@ -30,14 +30,8 @@ */ final class IndentationTypeFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * @var string - */ - private $indent; + private string $indent; - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -59,17 +53,11 @@ public function getPriority(): int return 50; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([T_COMMENT, T_DOC_COMMENT, T_WHITESPACE]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $this->indent = $this->whitespacesConfig->getIndent(); @@ -101,9 +89,7 @@ private function fixIndentInComment(Tokens $tokens, int $index): Token $indent = $this->indent; // change indent to expected one - $content = Preg::replaceCallback('/^(?: )+/m', function (array $matches) use ($indent): string { - return $this->getExpectedIndent($matches[0], $indent); - }, $content); + $content = Preg::replaceCallback('/^(?: )+/m', fn (array $matches): string => $this->getExpectedIndent($matches[0], $indent), $content); return new Token([$tokens[$index]->getId(), $content]); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/LineEndingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/LineEndingFixer.php index d482eebd..adc2016f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/LineEndingFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/LineEndingFixer.php @@ -31,17 +31,11 @@ */ final class LineEndingFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return true; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -54,9 +48,6 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $ending = $this->whitespacesConfig->getLineEnding(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/MethodChainingIndentationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/MethodChainingIndentationFixer.php index 7a95efc3..58725fbe 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/MethodChainingIndentationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/MethodChainingIndentationFixer.php @@ -28,9 +28,6 @@ */ final class MethodChainingIndentationFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -41,15 +38,19 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} + * + * Must run after NoSpaceAroundDoubleColonFixer. */ + public function getPriority(): int + { + return 0; + } + public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(Token::getObjectOperatorKinds()); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $lineEnding = $this->whitespacesConfig->getLineEnding(); @@ -60,8 +61,12 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } $endParenthesisIndex = $tokens->getNextTokenOfKind($index, ['(', ';', ',', [T_CLOSE_TAG]]); + $previousEndParenthesisIndex = $tokens->getPrevTokenOfKind($index, [')']); - if (null === $endParenthesisIndex || !$tokens[$endParenthesisIndex]->equals('(')) { + if ( + null === $endParenthesisIndex + || !$tokens[$endParenthesisIndex]->equals('(') && null === $previousEndParenthesisIndex + ) { continue; } @@ -89,6 +94,10 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $tokens[$index - 1] = new Token([T_WHITESPACE, $lineEnding.$expectedIndent]); } + if (!$tokens[$endParenthesisIndex]->equals('(')) { + continue; + } + $endParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $endParenthesisIndex); for ($searchIndex = $index + 1; $searchIndex < $endParenthesisIndex; ++$searchIndex) { @@ -158,7 +167,7 @@ private function canBeMovedToNextLine(int $index, Tokens $tokens): bool continue; } - if ($tokens[$i]->isWhitespace() && 1 === Preg::match('/\R/', $tokens[$i]->getContent())) { + if ($tokens[$i]->isWhitespace() && Preg::match('/\R/', $tokens[$i]->getContent())) { return $hasCommentBefore; } } @@ -171,7 +180,7 @@ private function canBeMovedToNextLine(int $index, Tokens $tokens): bool */ private function getIndentAt(Tokens $tokens, int $index): ?string { - if (1 === Preg::match('/\R{1}(\h*)$/', $this->getIndentContentAt($tokens, $index), $matches)) { + if (Preg::match('/\R{1}(\h*)$/', $this->getIndentContentAt($tokens, $index), $matches)) { return $matches[1]; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoExtraBlankLinesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoExtraBlankLinesFixer.php index b9b9cf02..8f0555b5 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoExtraBlankLinesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoExtraBlankLinesFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; @@ -25,6 +26,7 @@ use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Analyzer\SwitchAnalyzer; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; @@ -33,13 +35,25 @@ /** * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * tokens?: list<'attribute'|'break'|'case'|'continue'|'curly_brace_block'|'default'|'extra'|'parenthesis_brace_block'|'return'|'square_brace_block'|'switch'|'throw'|'use'|'use_trait'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * tokens: list<'attribute'|'break'|'case'|'continue'|'curly_brace_block'|'default'|'extra'|'parenthesis_brace_block'|'return'|'square_brace_block'|'switch'|'throw'|'use'|'use_trait'> + * } */ final class NoExtraBlankLinesFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + /** - * @var string[] + * @var list */ - private static array $availableTokens = [ + private const AVAILABLE_TOKENS = [ 'attribute', 'break', 'case', @@ -57,12 +71,12 @@ final class NoExtraBlankLinesFixer extends AbstractFixer implements Configurable ]; /** - * @var array key is token id, value is name of callback + * @var array key is token id */ private array $tokenKindCallbackMap; /** - * @var array token prototype, value is name of callback + * @var array key is token's content */ private array $tokenEqualsMap; @@ -70,56 +84,6 @@ final class NoExtraBlankLinesFixer extends AbstractFixer implements Configurable private TokensAnalyzer $tokensAnalyzer; - /** - * {@inheritdoc} - */ - public function configure(array $configuration): void - { - if (isset($configuration['tokens']) && \in_array('use_trait', $configuration['tokens'], true)) { - Utils::triggerDeprecation(new \RuntimeException('Option "tokens: use_trait" used in `no_extra_blank_lines` rule is deprecated, use the rule `class_attributes_separation` with `elements: trait_import` instead.')); - } - - parent::configure($configuration); - - $tokensConfiguration = $this->configuration['tokens']; - - $this->tokenEqualsMap = []; - - if (\in_array('curly_brace_block', $tokensConfiguration, true)) { - $this->tokenEqualsMap['{'] = 'fixStructureOpenCloseIfMultiLine'; // i.e. not: CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN - } - - if (\in_array('parenthesis_brace_block', $tokensConfiguration, true)) { - $this->tokenEqualsMap['('] = 'fixStructureOpenCloseIfMultiLine'; // i.e. not: CT::T_BRACE_CLASS_INSTANTIATION_OPEN - } - - static $configMap = [ - 'attribute' => [CT::T_ATTRIBUTE_CLOSE, 'fixAfterToken'], - 'break' => [T_BREAK, 'fixAfterToken'], - 'case' => [T_CASE, 'fixAfterCaseToken'], - 'continue' => [T_CONTINUE, 'fixAfterToken'], - 'default' => [T_DEFAULT, 'fixAfterToken'], - 'extra' => [T_WHITESPACE, 'removeMultipleBlankLines'], - 'return' => [T_RETURN, 'fixAfterToken'], - 'square_brace_block' => [CT::T_ARRAY_SQUARE_BRACE_OPEN, 'fixStructureOpenCloseIfMultiLine'], - 'switch' => [T_SWITCH, 'fixAfterToken'], - 'throw' => [T_THROW, 'fixAfterThrowToken'], - 'use' => [T_USE, 'removeBetweenUse'], - 'use_trait' => [CT::T_USE_TRAIT, 'removeBetweenUse'], - ]; - - $this->tokenKindCallbackMap = []; - - foreach ($tokensConfiguration as $config) { - if (isset($configMap[$config])) { - $this->tokenKindCallbackMap[$configMap[$config][0]] = $configMap[$config][1]; - } - } - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -261,24 +225,67 @@ class Bar * {@inheritdoc} * * Must run before BlankLineBeforeStatementFixer. - * Must run after ClassAttributesSeparationFixer, CombineConsecutiveUnsetsFixer, EmptyLoopBodyFixer, EmptyLoopConditionFixer, FunctionToConstantFixer, ModernizeStrposFixer, NoEmptyCommentFixer, NoEmptyPhpdocFixer, NoEmptyStatementFixer, NoUnusedImportsFixer, NoUselessElseFixer, NoUselessReturnFixer, NoUselessSprintfFixer, StringLengthToEmptyFixer. + * Must run after ClassAttributesSeparationFixer, CombineConsecutiveUnsetsFixer, EmptyLoopBodyFixer, EmptyLoopConditionFixer, FunctionToConstantFixer, LongToShorthandOperatorFixer, ModernizeStrposFixer, NoEmptyCommentFixer, NoEmptyPhpdocFixer, NoEmptyStatementFixer, NoUnusedImportsFixer, NoUselessElseFixer, NoUselessReturnFixer, NoUselessSprintfFixer, PhpdocReadonlyClassCommentToKeywordFixer, StringLengthToEmptyFixer, YieldFromArrayToYieldsFixer. */ public function getPriority(): int { return -20; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return true; } /** - * {@inheritdoc} + * @param _AutogeneratedInputConfiguration $configuration */ + protected function configurePreNormalisation(array $configuration): void + { + if (isset($configuration['tokens']) && \in_array('use_trait', $configuration['tokens'], true)) { + Utils::triggerDeprecation(new \RuntimeException('Option "tokens: use_trait" used in `no_extra_blank_lines` rule is deprecated, use the rule `class_attributes_separation` with `elements: trait_import` instead.')); + } + } + + protected function configurePostNormalisation(): void + { + $tokensConfiguration = $this->configuration['tokens']; + + $this->tokenEqualsMap = []; + + if (\in_array('curly_brace_block', $tokensConfiguration, true)) { + $this->tokenEqualsMap['{'] = [$this, 'fixStructureOpenCloseIfMultiLine']; // i.e. not: CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN + } + + if (\in_array('parenthesis_brace_block', $tokensConfiguration, true)) { + $this->tokenEqualsMap['('] = [$this, 'fixStructureOpenCloseIfMultiLine']; // i.e. not: CT::T_BRACE_CLASS_INSTANTIATION_OPEN + } + + // Each item requires explicit array-like callable, otherwise PHPStan will complain about unused private methods. + $configMap = [ + 'attribute' => [CT::T_ATTRIBUTE_CLOSE, [$this, 'fixAfterToken']], + 'break' => [T_BREAK, [$this, 'fixAfterToken']], + 'case' => [T_CASE, [$this, 'fixAfterCaseToken']], + 'continue' => [T_CONTINUE, [$this, 'fixAfterToken']], + 'default' => [T_DEFAULT, [$this, 'fixAfterToken']], + 'extra' => [T_WHITESPACE, [$this, 'removeMultipleBlankLines']], + 'return' => [T_RETURN, [$this, 'fixAfterToken']], + 'square_brace_block' => [CT::T_ARRAY_SQUARE_BRACE_OPEN, [$this, 'fixStructureOpenCloseIfMultiLine']], + 'switch' => [T_SWITCH, [$this, 'fixAfterToken']], + 'throw' => [T_THROW, [$this, 'fixAfterThrowToken']], + 'use' => [T_USE, [$this, 'removeBetweenUse']], + 'use_trait' => [CT::T_USE_TRAIT, [$this, 'removeBetweenUse']], + ]; + + $this->tokenKindCallbackMap = []; + + foreach ($tokensConfiguration as $config) { + if (isset($configMap[$config])) { + $this->tokenKindCallbackMap[$configMap[$config][0]] = $configMap[$config][1]; + } + } + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $this->tokens = $tokens; @@ -289,20 +296,25 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ (new FixerOptionBuilder('tokens', 'List of tokens to fix.')) - ->setAllowedTypes(['array']) - ->setAllowedValues([new AllowedValueSubset(self::$availableTokens)]) + ->setAllowedTypes(['string[]']) + ->setAllowedValues([new AllowedValueSubset(self::AVAILABLE_TOKENS)]) ->setDefault(['extra']) ->getOption(), ]); } + /** + * @uses fixAfterToken() + * @uses fixAfterCaseToken() + * @uses fixAfterThrowToken() + * @uses fixStructureOpenCloseIfMultiLine() + * @uses removeBetweenUse() + * @uses removeMultipleBlankLines() + */ private function fixByToken(Token $token, int $index): void { foreach ($this->tokenKindCallbackMap as $kind => $callback) { @@ -310,7 +322,7 @@ private function fixByToken(Token $token, int $index): void continue; } - $this->{$callback}($index); + \call_user_func_array($this->tokenKindCallbackMap[$token->getId()], [$index]); return; } @@ -320,7 +332,7 @@ private function fixByToken(Token $token, int $index): void continue; } - $this->{$callback}($index); + \call_user_func_array($this->tokenEqualsMap[$token->getContent()], [$index]); return; } @@ -345,7 +357,7 @@ private function removeBetweenUse(int $index): void private function removeMultipleBlankLines(int $index): void { - $expected = $this->tokens[$index - 1]->isGivenKind(T_OPEN_TAG) && 1 === Preg::match('/\R$/', $this->tokens[$index - 1]->getContent()) ? 1 : 2; + $expected = $this->tokens[$index - 1]->isGivenKind(T_OPEN_TAG) && Preg::match('/\R$/', $this->tokens[$index - 1]->getContent()) ? 1 : 2; $parts = Preg::split('/(.*\R)/', $this->tokens[$index]->getContent(), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); $count = \count($parts); @@ -389,9 +401,17 @@ private function fixAfterCaseToken(int $index): void private function fixAfterThrowToken(int $index): void { - if ($this->tokens[$this->tokens->getPrevMeaningfulToken($index)]->equalsAny([';', '{', '}', ':', [T_OPEN_TAG]])) { - $this->fixAfterToken($index); + $prevIndex = $this->tokens->getPrevMeaningfulToken($index); + + if (!$this->tokens[$prevIndex]->equalsAny([';', '{', '}', ':', [T_OPEN_TAG]])) { + return; } + + if ($this->tokens[$prevIndex]->equals(':') && !SwitchAnalyzer::belongsToSwitch($this->tokens, $prevIndex)) { + return; + } + + $this->fixAfterToken($index); } /** @@ -418,8 +438,24 @@ private function fixStructureOpenCloseIfMultiLine(int $index): void private function removeEmptyLinesAfterLineWithTokenAt(int $index): void { // find the line break + $parenthesesDepth = 0; $tokenCount = \count($this->tokens); for ($end = $index; $end < $tokenCount; ++$end) { + if ($this->tokens[$end]->equals('(')) { + ++$parenthesesDepth; + + continue; + } + + if ($this->tokens[$end]->equals(')')) { + --$parenthesesDepth; + if ($parenthesesDepth < 0) { + return; + } + + continue; + } + if ( $this->tokens[$end]->equals('}') || str_contains($this->tokens[$end]->getContent(), "\n") diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesAroundOffsetFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesAroundOffsetFixer.php index a9f69617..1d8156ca 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesAroundOffsetFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesAroundOffsetFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\AllowedValueSubset; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; @@ -28,12 +29,21 @@ /** * @author Javier Spagnoletti + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * positions?: list<'inside'|'outside'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * positions: list<'inside'|'outside'> + * } */ final class NoSpacesAroundOffsetFixer extends AbstractFixer implements ConfigurableFixerInterface { - /** - * {@inheritdoc} - */ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -46,17 +56,11 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound(['[', CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN]); } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { foreach ($tokens as $index => $token) { @@ -93,16 +97,13 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - /** - * {@inheritdoc} - */ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { $values = ['inside', 'outside']; return new FixerConfigurationResolver([ (new FixerOptionBuilder('positions', 'Whether spacing should be fixed inside and/or outside the offset braces.')) - ->setAllowedTypes(['array']) + ->setAllowedTypes(['string[]']) ->setAllowedValues([new AllowedValueSubset($values)]) ->setDefault($values) ->getOption(), diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesInsideParenthesisFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesInsideParenthesisFixer.php index caaf2301..d8507512 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesInsideParenthesisFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesInsideParenthesisFixer.php @@ -14,7 +14,8 @@ namespace PhpCsFixer\Fixer\Whitespace; -use PhpCsFixer\AbstractFixer; +use PhpCsFixer\AbstractProxyFixer; +use PhpCsFixer\Fixer\DeprecatedFixerInterface; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; @@ -25,12 +26,11 @@ * * @author Marc Aubé * @author Dariusz Rumiński + * + * @deprecated in favor of SpacesInsideParenthesisFixer */ -final class NoSpacesInsideParenthesisFixer extends AbstractFixer +final class NoSpacesInsideParenthesisFixer extends AbstractProxyFixer implements DeprecatedFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -55,57 +55,21 @@ function foo( \$bar, \$baz ) */ public function getPriority(): int { - return 2; + return 3; } - /** - * {@inheritdoc} - */ - public function isCandidate(Tokens $tokens): bool + public function getSuccessorsNames(): array { - return $tokens->isTokenKindFound('('); + return array_keys($this->proxyFixers); } - /** - * {@inheritdoc} - */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + public function isCandidate(Tokens $tokens): bool { - foreach ($tokens as $index => $token) { - if (!$token->equals('(')) { - continue; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - // ignore parenthesis for T_ARRAY - if (null !== $prevIndex && $tokens[$prevIndex]->isGivenKind(T_ARRAY)) { - continue; - } - - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - - // remove space after opening `(` - if (!$tokens[$tokens->getNextNonWhitespace($index)]->isComment()) { - $this->removeSpaceAroundToken($tokens, $index + 1); - } - - // remove space before closing `)` if it is not `list($a, $b, )` case - if (!$tokens[$tokens->getPrevMeaningfulToken($endIndex)]->equals(',')) { - $this->removeSpaceAroundToken($tokens, $endIndex - 1); - } - } + return $tokens->isTokenKindFound('('); } - /** - * Remove spaces from token at a given index. - */ - private function removeSpaceAroundToken(Tokens $tokens, int $index): void + protected function createProxyFixers(): array { - $token = $tokens[$index]; - - if ($token->isWhitespace() && !str_contains($token->getContent(), "\n")) { - $tokens->clearAt($index); - } + return [new SpacesInsideParenthesesFixer()]; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoTrailingWhitespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoTrailingWhitespaceFixer.php index 5e7d6a81..e05a9fdd 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoTrailingWhitespaceFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoTrailingWhitespaceFixer.php @@ -32,9 +32,6 @@ */ final class NoTrailingWhitespaceFixer extends AbstractFixer { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -53,17 +50,11 @@ public function getPriority(): int return 0; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { for ($index = \count($tokens) - 1; $index >= 0; --$index) { @@ -72,8 +63,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $token->isGivenKind(T_OPEN_TAG) && $tokens->offsetExists($index + 1) && $tokens[$index + 1]->isWhitespace() - && 1 === Preg::match('/(.*)\h$/', $token->getContent(), $openTagMatches) - && 1 === Preg::match('/^(\R)(.*)$/s', $tokens[$index + 1]->getContent(), $whitespaceMatches) + && Preg::match('/(.*)\h$/', $token->getContent(), $openTagMatches) + && Preg::match('/^(\R)(.*)$/s', $tokens[$index + 1]->getContent(), $whitespaceMatches) ) { $tokens[$index] = new Token([T_OPEN_TAG, $openTagMatches[1].$whitespaceMatches[1]]); $tokens->ensureWhitespaceAtIndex($index + 1, 0, $whitespaceMatches[2]); @@ -85,12 +76,12 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - $lines = Preg::split('/(\\R+)/', $token->getContent(), -1, PREG_SPLIT_DELIM_CAPTURE); + $lines = Preg::split('/(\R+)/', $token->getContent(), -1, PREG_SPLIT_DELIM_CAPTURE); $linesSize = \count($lines); // fix only multiline whitespaces or singleline whitespaces at the end of file if ($linesSize > 1 || !isset($tokens[$index + 1])) { - if (!$tokens[$index - 1]->isGivenKind(T_OPEN_TAG) || 1 !== Preg::match('/(.*)\R$/', $tokens[$index - 1]->getContent())) { + if (!$tokens[$index - 1]->isGivenKind(T_OPEN_TAG) || !Preg::match('/(.*)\R$/', $tokens[$index - 1]->getContent())) { $lines[0] = rtrim($lines[0], " \t"); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoWhitespaceInBlankLineFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoWhitespaceInBlankLineFixer.php index 52872486..352ce7a8 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoWhitespaceInBlankLineFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoWhitespaceInBlankLineFixer.php @@ -27,9 +27,6 @@ */ final class NoWhitespaceInBlankLineFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -41,24 +38,18 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} * - * Must run after AssignNullCoalescingToCoalesceEqualFixer, CombineConsecutiveIssetsFixer, CombineConsecutiveUnsetsFixer, FunctionToConstantFixer, NoEmptyCommentFixer, NoEmptyPhpdocFixer, NoEmptyStatementFixer, NoUselessElseFixer, NoUselessReturnFixer. + * Must run after AssignNullCoalescingToCoalesceEqualFixer, CombineConsecutiveIssetsFixer, CombineConsecutiveUnsetsFixer, FunctionToConstantFixer, NoEmptyCommentFixer, NoEmptyStatementFixer, NoUselessElseFixer, NoUselessReturnFixer, YieldFromArrayToYieldsFixer. */ public function getPriority(): int { - return -19; + return -99; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { // skip first as it cannot be a white space token diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SingleBlankLineAtEofFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SingleBlankLineAtEofFixer.php index af7fa873..6fbea69d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SingleBlankLineAtEofFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SingleBlankLineAtEofFixer.php @@ -31,9 +31,6 @@ */ final class SingleBlankLineAtEofFixer extends AbstractFixer implements WhitespacesAwareFixerInterface { - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -45,26 +42,17 @@ public function getDefinition(): FixerDefinitionInterface ); } - /** - * {@inheritdoc} - */ public function getPriority(): int { // must run last to be sure the file is properly formatted before it runs - return -50; + return -100; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return true; } - /** - * {@inheritdoc} - */ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $count = $tokens->count(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SpacesInsideParenthesesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SpacesInsideParenthesesFixer.php new file mode 100644 index 00000000..f5078c2b --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SpacesInsideParenthesesFixer.php @@ -0,0 +1,223 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Whitespace; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * Fixer for rules defined in PSR2 ¶4.3, ¶4.6, ¶5. + * + * @author Marc Aubé + * @author Dariusz Rumiński + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * space?: 'none'|'single' + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * space: 'none'|'single' + * } + */ +final class SpacesInsideParenthesesFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Parentheses must be declared using the configured whitespace.', + [ + new CodeSample(" 'none'] + ), + new CodeSample( + " 'single'] + ), + new CodeSample( + " 'single'] + ), + ], + 'By default there are not any additional spaces inside parentheses, however with `space=single` configuration option whitespace inside parentheses will be unified to single space.' + ); + } + + /** + * {@inheritdoc} + * + * Must run before FunctionToConstantFixer, GetClassToClassKeywordFixer, StringLengthToEmptyFixer. + * Must run after CombineConsecutiveIssetsFixer, CombineNestedDirnameFixer, IncrementStyleFixer, LambdaNotUsedImportFixer, ModernizeStrposFixer, NoUselessSprintfFixer, PowToExponentiationFixer. + */ + public function getPriority(): int + { + return 3; + } + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isAnyTokenKindsFound(['(', CT::T_BRACE_CLASS_INSTANTIATION_OPEN]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + if ('none' === $this->configuration['space']) { + foreach ($tokens as $index => $token) { + if (!$token->equalsAny(['(', [CT::T_BRACE_CLASS_INSTANTIATION_OPEN]])) { + continue; + } + + $prevIndex = $tokens->getPrevMeaningfulToken($index); + + // ignore parenthesis for T_ARRAY + if (null !== $prevIndex && $tokens[$prevIndex]->isGivenKind(T_ARRAY)) { + continue; + } + + $blockType = Tokens::detectBlockType($tokens[$index]); + $endIndex = $tokens->findBlockEnd($blockType['type'], $index); + + // remove space after opening `(` + if (!$tokens[$tokens->getNextNonWhitespace($index)]->isComment()) { + $this->removeSpaceAroundToken($tokens, $index + 1); + } + + // remove space before closing `)` if it is not `list($a, $b, )` case + if (!$tokens[$tokens->getPrevMeaningfulToken($endIndex)]->equals(',')) { + $this->removeSpaceAroundToken($tokens, $endIndex - 1); + } + } + } + + if ('single' === $this->configuration['space']) { + foreach ($tokens as $index => $token) { + if (!$token->equalsAny(['(', [CT::T_BRACE_CLASS_INSTANTIATION_OPEN]])) { + continue; + } + + $blockType = Tokens::detectBlockType($tokens[$index]); + $endParenthesisIndex = $tokens->findBlockEnd($blockType['type'], $index); + + // if not other content than spaces in block remove spaces + $blockContent = $this->getBlockContent($index, $endParenthesisIndex, $tokens); + if (1 === \count($blockContent) && \in_array(' ', $blockContent, true)) { + $this->removeSpaceAroundToken($tokens, $index + 1); + + continue; + } + + // don't process if the next token is `)` + $nextMeaningfulTokenIndex = $tokens->getNextMeaningfulToken($index); + if (')' === $tokens[$nextMeaningfulTokenIndex]->getContent()) { + continue; + } + + $afterParenthesisIndex = $tokens->getNextNonWhitespace($endParenthesisIndex); + $afterParenthesisToken = $tokens[$afterParenthesisIndex]; + + if ($afterParenthesisToken->isGivenKind(CT::T_USE_LAMBDA)) { + $useStartParenthesisIndex = $tokens->getNextTokenOfKind($afterParenthesisIndex, ['(']); + $useEndParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $useStartParenthesisIndex); + + // add single-line edge whitespaces inside use parentheses + $this->fixParenthesisInnerEdge($tokens, $useStartParenthesisIndex, $useEndParenthesisIndex); + } + + // add single-line edge whitespaces inside parameters list parentheses + $this->fixParenthesisInnerEdge($tokens, $index, $endParenthesisIndex); + } + } + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('space', 'Whether to have `single` or `none` space inside parentheses.')) + ->setAllowedValues(['none', 'single']) + ->setDefault('none') + ->getOption(), + ]); + } + + /** + * Remove spaces from token at a given index. + */ + private function removeSpaceAroundToken(Tokens $tokens, int $index): void + { + $token = $tokens[$index]; + + if ($token->isWhitespace() && !str_contains($token->getContent(), "\n")) { + $tokens->clearAt($index); + } + } + + private function fixParenthesisInnerEdge(Tokens $tokens, int $start, int $end): void + { + // fix white space before ')' + if ($tokens[$end - 1]->isWhitespace()) { + $content = $tokens[$end - 1]->getContent(); + if (' ' !== $content && !str_contains($content, "\n") && !$tokens[$tokens->getPrevNonWhitespace($end - 1)]->isComment()) { + $tokens[$end - 1] = new Token([T_WHITESPACE, ' ']); + } + } else { + $tokens->insertAt($end, new Token([T_WHITESPACE, ' '])); + } + + // fix white space after '(' + if ($tokens[$start + 1]->isWhitespace()) { + $content = $tokens[$start + 1]->getContent(); + if (' ' !== $content && !str_contains($content, "\n") && !$tokens[$tokens->getNextNonWhitespace($start + 1)]->isComment()) { + $tokens[$start + 1] = new Token([T_WHITESPACE, ' ']); + } + } else { + $tokens->insertAt($start + 1, new Token([T_WHITESPACE, ' '])); + } + } + + /** + * @return list + */ + private function getBlockContent(int $startIndex, int $endIndex, Tokens $tokens): array + { + // + 1 for ( + $contents = []; + for ($i = ($startIndex + 1); $i < $endIndex; ++$i) { + $contents[] = $tokens[$i]->getContent(); + } + + return $contents; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/StatementIndentationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/StatementIndentationFixer.php index dc7a21b2..db33fa53 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/StatementIndentationFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/StatementIndentationFixer.php @@ -15,8 +15,13 @@ namespace PhpCsFixer\Fixer\Whitespace; use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\Fixer\Indentation; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; use PhpCsFixer\FixerDefinition\CodeSample; use PhpCsFixer\FixerDefinition\FixerDefinition; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; @@ -26,8 +31,21 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; -final class StatementIndentationFixer extends AbstractFixer implements WhitespacesAwareFixerInterface +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * stick_comment_to_next_continuous_control_statement?: bool + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * stick_comment_to_next_continuous_control_statement: bool + * } + */ +final class StatementIndentationFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface { + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + use Indentation; private AlternativeSyntaxAnalyzer $alternativeSyntaxAnalyzer; @@ -41,9 +59,6 @@ public function __construct(bool $bracesFixerCompatibility = false) $this->bracesFixerCompatibility = $bracesFixerCompatibility; } - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -59,6 +74,35 @@ public function getDefinition(): FixerDefinitionInterface } ' ), + new CodeSample( + ' false] + ), + new CodeSample( + ' true] + ), ] ); } @@ -67,21 +111,28 @@ public function getDefinition(): FixerDefinitionInterface * {@inheritdoc} * * Must run before HeredocIndentationFixer. - * Must run after ClassAttributesSeparationFixer. + * Must run after BracesPositionFixer, ClassAttributesSeparationFixer, CurlyBracesPositionFixer, FullyQualifiedStrictTypesFixer, GlobalNamespaceImportFixer, MethodArgumentSpaceFixer, NoUselessElseFixer, YieldFromArrayToYieldsFixer. */ public function getPriority(): int { - return parent::getPriority(); + return -3; } - /** - * {@inheritdoc} - */ public function isCandidate(Tokens $tokens): bool { return true; } + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('stick_comment_to_next_continuous_control_statement', 'Last comment of code block counts as comment for next block.')) + ->setAllowedTypes(['bool']) + ->setDefault(false) + ->getOption(), + ]); + } + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { $this->alternativeSyntaxAnalyzer = new AlternativeSyntaxAnalyzer(); @@ -94,16 +145,26 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void T_FOR, T_FOREACH, T_WHILE, + T_DO, T_SWITCH, T_CASE, T_DEFAULT, T_TRY, - T_FUNCTION, T_CLASS, T_INTERFACE, T_TRAIT, T_EXTENDS, T_IMPLEMENTS, + T_CONST, + ]; + $controlStructurePossibiblyWithoutBracesTokens = [ + T_IF, + T_ELSE, + T_ELSEIF, + T_FOR, + T_FOREACH, + T_WHILE, + T_DO, ]; if (\defined('T_MATCH')) { // @TODO: drop condition when PHP 8.0+ is required $blockSignatureFirstTokens[] = T_MATCH; @@ -132,6 +193,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void * end_index: int, * end_index_inclusive: bool, * initial_indent: string, + * new_indent?: string, * is_indented_block: bool, * }> $scopes */ @@ -148,12 +210,25 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void $previousLineInitialIndent = ''; $previousLineNewIndent = ''; + $noBracesBlockStarts = []; $alternativeBlockStarts = []; $caseBlockStarts = []; foreach ($tokens as $index => $token) { $currentScope = \count($scopes) - 1; + if (isset($noBracesBlockStarts[$index])) { + $scopes[] = [ + 'type' => 'block', + 'skip' => false, + 'end_index' => $this->findStatementEndIndex($tokens, $index, \count($tokens) - 1), + 'end_index_inclusive' => true, + 'initial_indent' => $this->getLineIndentationWithBracesCompatibility($tokens, $index, $lastIndent), + 'is_indented_block' => true, + ]; + ++$currentScope; + } + if ( $token->equalsAny($blockFirstTokens) || ($token->equals('(') && !$tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(T_ARRAY)) @@ -169,7 +244,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } elseif ($token->equals(':')) { if (isset($caseBlockStarts[$index])) { [$endIndex, $endIndexInclusive] = $this->findCaseBlockEnd($tokens, $index); - } else { + } elseif ($this->alternativeSyntaxAnalyzer->belongsToAlternativeSyntax($tokens, $index)) { $endIndex = $this->alternativeSyntaxAnalyzer->findAlternativeSyntaxBlockEnd($tokens, $alternativeBlockStarts[$index]); } } elseif ($token->isGivenKind(CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN)) { @@ -220,19 +295,45 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void continue; } - if ($token->isGivenKind($blockSignatureFirstTokens)) { + if ( + $token->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN) + || ($token->equals('(') && $tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(T_ARRAY)) + ) { + $blockType = $token->equals('(') ? Tokens::BLOCK_TYPE_PARENTHESIS_BRACE : Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE; + + $scopes[] = [ + 'type' => 'statement', + 'skip' => true, + 'end_index' => $tokens->findBlockEnd($blockType, $index), + 'end_index_inclusive' => true, + 'initial_indent' => $previousLineInitialIndent, + 'new_indent' => $previousLineNewIndent, + 'is_indented_block' => false, + ]; + + continue; + } + + $isPropertyStart = $this->isPropertyStart($tokens, $index); + if ($isPropertyStart || $token->isGivenKind($blockSignatureFirstTokens)) { + $lastWhitespaceIndex = null; + $closingParenthesisIndex = null; + for ($endIndex = $index + 1, $max = \count($tokens); $endIndex < $max; ++$endIndex) { - if ($tokens[$endIndex]->equals('(')) { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $endIndex); + $endToken = $tokens[$endIndex]; + + if ($endToken->equals('(')) { + $closingParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $endIndex); + $endIndex = $closingParenthesisIndex; continue; } - if ($tokens[$endIndex]->equalsAny(['{', ';', [T_DOUBLE_ARROW], [T_IMPLEMENTS]])) { + if ($endToken->equalsAny(['{', ';', [T_DOUBLE_ARROW], [T_IMPLEMENTS]])) { break; } - if ($tokens[$endIndex]->equals(':')) { + if ($endToken->equals(':')) { if ($token->isGivenKind([T_CASE, T_DEFAULT])) { $caseBlockStarts[$endIndex] = $index; } else { @@ -241,6 +342,25 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void break; } + + if (!$token->isGivenKind($controlStructurePossibiblyWithoutBracesTokens)) { + continue; + } + + if ($endToken->isWhitespace()) { + $lastWhitespaceIndex = $endIndex; + + continue; + } + + if (!$endToken->isComment()) { + $noBraceBlockStartIndex = $lastWhitespaceIndex ?? $endIndex; + $noBracesBlockStarts[$noBraceBlockStartIndex] = true; + + $endIndex = $closingParenthesisIndex ?? $index; + + break; + } } $scopes[] = [ @@ -249,7 +369,34 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void 'end_index' => $endIndex, 'end_index_inclusive' => true, 'initial_indent' => $this->getLineIndentationWithBracesCompatibility($tokens, $index, $lastIndent), - 'is_indented_block' => $token->isGivenKind([T_EXTENDS, T_IMPLEMENTS]), + 'is_indented_block' => $isPropertyStart || $token->isGivenKind([T_EXTENDS, T_IMPLEMENTS, T_CONST]), + ]; + + continue; + } + + if ($token->isGivenKind(T_FUNCTION)) { + $endIndex = $index + 1; + + for ($max = \count($tokens); $endIndex < $max; ++$endIndex) { + if ($tokens[$endIndex]->equals('(')) { + $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $endIndex); + + continue; + } + + if ($tokens[$endIndex]->equalsAny(['{', ';'])) { + break; + } + } + + $scopes[] = [ + 'type' => 'block_signature', + 'skip' => false, + 'end_index' => $endIndex, + 'end_index_inclusive' => true, + 'initial_indent' => $this->getLineIndentationWithBracesCompatibility($tokens, $index, $lastIndent), + 'is_indented_block' => false, ]; continue; @@ -304,17 +451,40 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void } } - if (!$this->isCommentForControlSructureContinuation($tokens, $index + 1)) { - $endIndex = $scopes[$currentScope]['end_index']; + $endIndex = $scopes[$currentScope]['end_index']; - if (!$scopes[$currentScope]['end_index_inclusive']) { - ++$endIndex; - } + if (!$scopes[$currentScope]['end_index_inclusive']) { + ++$endIndex; + } + if ( + (null !== $firstNonWhitespaceTokenIndex && $firstNonWhitespaceTokenIndex < $endIndex) + || (null !== $nextNewlineIndex && $nextNewlineIndex < $endIndex) + ) { if ( - (null !== $firstNonWhitespaceTokenIndex && $firstNonWhitespaceTokenIndex < $endIndex) - || (null !== $nextNewlineIndex && $nextNewlineIndex < $endIndex) + // do we touch whitespace directly before comment... + $tokens[$firstNonWhitespaceTokenIndex]->isGivenKind(T_COMMENT) + // ...and afterwards, there is only comment or `}` + && $tokens[$tokens->getNextMeaningfulToken($firstNonWhitespaceTokenIndex)]->equals('}') ) { + if ( + // ... and the comment was only content in docblock + $tokens[$tokens->getPrevMeaningfulToken($firstNonWhitespaceTokenIndex)]->equals('{') + ) { + $indent = true; + } else { + // or it was dedicated comment for next control loop + // ^^ we need to check if there is a control group afterwards, and in that case don't make extra indent level + $nextIndex = $tokens->getNextMeaningfulToken($firstNonWhitespaceTokenIndex); + $nextNextIndex = $tokens->getNextMeaningfulToken($nextIndex); + + if (null !== $nextNextIndex && $tokens[$nextNextIndex]->isGivenKind([T_ELSE, T_ELSEIF])) { + $indent = true !== $this->configuration['stick_comment_to_next_continuous_control_statement']; + } else { + $indent = true; + } + } + } else { $indent = true; } } @@ -403,6 +573,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void 'end_index_inclusive' => false, 'initial_indent' => $previousLineInitialIndent, 'new_indent' => $previousLineNewIndent, + 'is_indented_block' => true, ]; } } @@ -412,9 +583,26 @@ private function findStatementEndIndex(Tokens $tokens, int $index, int $parentSc { $endIndex = null; + $ifLevel = 0; + $doWhileLevel = 0; for ($searchEndIndex = $index; $searchEndIndex <= $parentScopeEndIndex; ++$searchEndIndex) { $searchEndToken = $tokens[$searchEndIndex]; + if ( + $searchEndToken->isGivenKind(T_IF) + && !$tokens[$tokens->getPrevMeaningfulToken($searchEndIndex)]->isGivenKind(T_ELSE) + ) { + ++$ifLevel; + + continue; + } + + if ($searchEndToken->isGivenKind(T_DO)) { + ++$doWhileLevel; + + continue; + } + if ($searchEndToken->equalsAny(['(', '{', [CT::T_ARRAY_SQUARE_BRACE_OPEN]])) { if ($searchEndToken->equals('(')) { $blockType = Tokens::BLOCK_TYPE_PARENTHESIS_BRACE; @@ -425,15 +613,46 @@ private function findStatementEndIndex(Tokens $tokens, int $index, int $parentSc } $searchEndIndex = $tokens->findBlockEnd($blockType, $searchEndIndex); + $searchEndToken = $tokens[$searchEndIndex]; + } + if (!$searchEndToken->equalsAny([';', ',', '}', [T_CLOSE_TAG]])) { continue; } - if ($searchEndToken->equalsAny([';', ',', '}', [T_CLOSE_TAG]])) { - $endIndex = $tokens->getPrevNonWhitespace($searchEndIndex); + $controlStructureContinuationIndex = $tokens->getNextMeaningfulToken($searchEndIndex); - break; + if ( + $ifLevel > 0 + && null !== $controlStructureContinuationIndex + && $tokens[$controlStructureContinuationIndex]->isGivenKind([T_ELSE, T_ELSEIF]) + ) { + if ( + $tokens[$controlStructureContinuationIndex]->isGivenKind(T_ELSE) + && !$tokens[$tokens->getNextMeaningfulToken($controlStructureContinuationIndex)]->isGivenKind(T_IF) + ) { + --$ifLevel; + } + + $searchEndIndex = $controlStructureContinuationIndex; + + continue; + } + + if ( + $doWhileLevel > 0 + && null !== $controlStructureContinuationIndex + && $tokens[$controlStructureContinuationIndex]->isGivenKind([T_WHILE]) + ) { + --$doWhileLevel; + $searchEndIndex = $controlStructureContinuationIndex; + + continue; } + + $endIndex = $tokens->getPrevNonWhitespace($searchEndIndex); + + break; } return $endIndex ?? $tokens->getPrevMeaningfulToken($parentScopeEndIndex); @@ -496,34 +715,35 @@ private function getLineIndentationWithBracesCompatibility(Tokens $tokens, int $ return $regularIndent; } - private function isCommentForControlSructureContinuation(Tokens $tokens, int $index): bool + /** + * Returns whether the token at given index is the last token in a property + * declaration before the type or the name of that property. + */ + private function isPropertyStart(Tokens $tokens, int $index): bool { - if (!isset($tokens[$index], $tokens[$index + 1])) { - return false; - } - - if (!$tokens[$index]->isComment() || 1 !== Preg::match('~^(//|#)~', $tokens[$index]->getContent())) { - return false; + $propertyKeywords = [T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_STATIC]; + if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required + $propertyKeywords[] = T_READONLY; } - if (!$tokens[$index + 1]->isWhitespace() || 1 !== Preg::match('/\R/', $tokens[$index + 1]->getContent())) { - return false; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if (null !== $prevIndex && $tokens[$prevIndex]->equals('{')) { + $nextIndex = $tokens->getNextMeaningfulToken($index); + if ( + null === $nextIndex + || $tokens[$nextIndex]->isGivenKind($propertyKeywords) + || $tokens[$nextIndex]->isGivenKind([T_CONST, T_FUNCTION]) + ) { return false; } - $index = $tokens->getNextMeaningfulToken($index + 1); + while ($tokens[$index]->isGivenKind($propertyKeywords)) { + if ($tokens[$index]->isGivenKind([T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE])) { + return true; + } - if (null === $index || !$tokens[$index]->equals('}')) { - return false; + $index = $tokens->getPrevMeaningfulToken($index); } - $index = $tokens->getNextMeaningfulToken($index); - - return null !== $index && $tokens[$index]->isGivenKind([T_ELSE, T_ELSEIF]); + return false; } /** @@ -546,28 +766,28 @@ private function isCommentWithFixableIndentation(Tokens $tokens, int $index): bo $indent = preg_quote($this->whitespacesConfig->getIndent(), '~'); - if (1 === Preg::match("~^(//|#)({$indent}.*)?$~", $tokens[$index]->getContent())) { + if (Preg::match("~^(//|#)({$indent}.*)?$~", $tokens[$index]->getContent())) { return false; } $firstCommentIndex = $index; while (true) { - $i = $this->getSiblingContinuousSingleLineComment($tokens, $firstCommentIndex, false); - if (null === $i) { + $firstCommentCandidateIndex = $this->getSiblingContinuousSingleLineComment($tokens, $firstCommentIndex, false); + if (null === $firstCommentCandidateIndex) { break; } - $firstCommentIndex = $i; + $firstCommentIndex = $firstCommentCandidateIndex; } $lastCommentIndex = $index; while (true) { - $i = $this->getSiblingContinuousSingleLineComment($tokens, $lastCommentIndex, true); - if (null === $i) { + $lastCommentCandidateIndex = $this->getSiblingContinuousSingleLineComment($tokens, $lastCommentIndex, true); + if (null === $lastCommentCandidateIndex) { break; } - $lastCommentIndex = $i; + $lastCommentIndex = $lastCommentCandidateIndex; } if ($firstCommentIndex === $lastCommentIndex) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypeDeclarationSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypeDeclarationSpacesFixer.php new file mode 100644 index 00000000..b07514e1 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypeDeclarationSpacesFixer.php @@ -0,0 +1,212 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Fixer\Whitespace; + +use PhpCsFixer\AbstractFixer; +use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; +use PhpCsFixer\FixerConfiguration\AllowedValueSubset; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; +use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; +use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; +use PhpCsFixer\FixerDefinition\CodeSample; +use PhpCsFixer\FixerDefinition\FixerDefinition; +use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; +use PhpCsFixer\Tokenizer\TokensAnalyzer; + +/** + * @author Dariusz Rumiński + * @author John Paul E. Balandan, CPA + * + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * elements?: list<'function'|'property'> + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * elements: list<'function'|'property'> + * } + */ +final class TypeDeclarationSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface +{ + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; + + public function getDefinition(): FixerDefinitionInterface + { + return new FixerDefinition( + 'Ensure single space between a variable and its type declaration in function arguments and properties.', + [ + new CodeSample( + ' (string) $c; + } +} +', + ['elements' => ['function']] + ), + new CodeSample( + ' ['property']] + ), + ] + ); + } + + public function isCandidate(Tokens $tokens): bool + { + return $tokens->isAnyTokenKindsFound([...Token::getClassyTokenKinds(), T_FN, T_FUNCTION]); + } + + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface + { + return new FixerConfigurationResolver([ + (new FixerOptionBuilder('elements', 'Structural elements where the spacing after the type declaration should be fixed.')) + ->setAllowedTypes(['string[]']) + ->setAllowedValues([new AllowedValueSubset(['function', 'property'])]) + ->setDefault(['function', 'property']) + ->getOption(), + ]); + } + + protected function applyFix(\SplFileInfo $file, Tokens $tokens): void + { + $functionsAnalyzer = new FunctionsAnalyzer(); + + foreach (array_reverse($this->getElements($tokens), true) as $index => $type) { + if ('property' === $type && \in_array('property', $this->configuration['elements'], true)) { + $this->ensureSingleSpaceAtPropertyTypehint($tokens, $index); + + continue; + } + + if ('method' === $type && \in_array('function', $this->configuration['elements'], true)) { + $this->ensureSingleSpaceAtFunctionArgumentTypehint($functionsAnalyzer, $tokens, $index); + + // implicit continue; + } + } + } + + /** + * @return array + * + * @phpstan-return array + */ + private function getElements(Tokens $tokens): array + { + $tokensAnalyzer = new TokensAnalyzer($tokens); + + $elements = array_map( + static fn (array $element): string => $element['type'], + array_filter( + $tokensAnalyzer->getClassyElements(), + static fn (array $element): bool => \in_array($element['type'], ['method', 'property'], true) + ) + ); + + foreach ($tokens as $index => $token) { + if ( + $token->isGivenKind(T_FN) + || ($token->isGivenKind(T_FUNCTION) && !isset($elements[$index])) + ) { + $elements[$index] = 'method'; + } + } + + return $elements; + } + + private function ensureSingleSpaceAtFunctionArgumentTypehint(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index): void + { + foreach (array_reverse($functionsAnalyzer->getFunctionArguments($tokens, $index)) as $argumentInfo) { + $argumentType = $argumentInfo->getTypeAnalysis(); + + if (null === $argumentType) { + continue; + } + + $tokens->ensureWhitespaceAtIndex($argumentType->getEndIndex() + 1, 0, ' '); + } + } + + private function ensureSingleSpaceAtPropertyTypehint(Tokens $tokens, int $index): void + { + $propertyIndex = $index; + $propertyModifiers = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_STATIC, T_VAR]; + + if (\defined('T_READONLY')) { + $propertyModifiers[] = T_READONLY; // @TODO drop condition when PHP 8.1 is supported + } + + do { + $index = $tokens->getPrevMeaningfulToken($index); + } while (!$tokens[$index]->isGivenKind($propertyModifiers)); + + $propertyType = $this->collectTypeAnalysis($tokens, $index, $propertyIndex); + + if (null === $propertyType) { + return; + } + + $tokens->ensureWhitespaceAtIndex($propertyType->getEndIndex() + 1, 0, ' '); + } + + private function collectTypeAnalysis(Tokens $tokens, int $startIndex, int $endIndex): ?TypeAnalysis + { + $type = ''; + $typeStartIndex = $tokens->getNextMeaningfulToken($startIndex); + $typeEndIndex = $typeStartIndex; + + for ($i = $typeStartIndex; $i < $endIndex; ++$i) { + if ($tokens[$i]->isWhitespace() || $tokens[$i]->isComment()) { + continue; + } + + $type .= $tokens[$i]->getContent(); + $typeEndIndex = $i; + } + + return '' !== $type ? new TypeAnalysis($type, $typeStartIndex, $typeEndIndex) : null; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypesSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypesSpacesFixer.php index 4020fbf0..538c221f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypesSpacesFixer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypesSpacesFixer.php @@ -16,6 +16,7 @@ use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\ConfigurableFixerInterface; +use PhpCsFixer\Fixer\ConfigurableFixerTrait; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; @@ -29,20 +30,23 @@ use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; +/** + * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> + * + * @phpstan-type _AutogeneratedInputConfiguration array{ + * space?: 'none'|'single', + * space_multiple_catch?: 'none'|'single'|null + * } + * @phpstan-type _AutogeneratedComputedConfiguration array{ + * space: 'none'|'single', + * space_multiple_catch: 'none'|'single'|null + * } + */ final class TypesSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface { - public function configure(array $configuration): void - { - parent::configure($configuration); + /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ + use ConfigurableFixerTrait; - if (!isset($this->configuration['space_multiple_catch'])) { - $this->configuration['space_multiple_catch'] = $this->configuration['space']; - } - } - - /** - * {@inheritdoc} - */ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( @@ -65,15 +69,29 @@ public function getDefinition(): FixerDefinitionInterface /** * {@inheritdoc} + * + * Must run after NullableTypeDeclarationFixer, OrderedTypesFixer. */ + public function getPriority(): int + { + return -1; + } + public function isCandidate(Tokens $tokens): bool { return $tokens->isAnyTokenKindsFound([CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION]); } - /** - * {@inheritdoc} - */ + protected function configurePostNormalisation(): void + { + if (!isset($this->configuration['space_multiple_catch'])) { + $this->configuration = [ + 'space' => $this->configuration['space'], + 'space_multiple_catch' => $this->configuration['space'], + ]; + } + } + protected function createConfigurationDefinition(): FixerConfigurationResolverInterface { return new FixerConfigurationResolver([ @@ -139,7 +157,7 @@ private function ensureSingleSpace(Tokens $tokens, int $index, int $offset): int return 1; } - if (' ' !== $tokens[$index]->getContent() && 1 !== Preg::match('/\R/', $tokens[$index]->getContent())) { + if (' ' !== $tokens[$index]->getContent() && !Preg::match('/\R/', $tokens[$index]->getContent())) { $tokens[$index] = new Token([T_WHITESPACE, ' ']); } @@ -148,7 +166,7 @@ private function ensureSingleSpace(Tokens $tokens, int $index, int $offset): int private function ensureNoSpace(Tokens $tokens, int $index): void { - if ($tokens[$index]->isWhitespace() && 1 !== Preg::match('/\R/', $tokens[$index]->getContent())) { + if ($tokens[$index]->isWhitespace() && !Preg::match('/\R/', $tokens[$index]->getContent())) { $tokens->clearAt($index); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOption.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOption.php index 8170e9ef..87f2eac4 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOption.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOption.php @@ -17,6 +17,8 @@ /** * @author ntzm * + * @readonly + * * @internal */ final class AliasedFixerOption implements FixerOptionInterface @@ -36,57 +38,36 @@ public function getAlias(): string return $this->alias; } - /** - * {@inheritdoc} - */ public function getName(): string { return $this->fixerOption->getName(); } - /** - * {@inheritdoc} - */ public function getDescription(): string { return $this->fixerOption->getDescription(); } - /** - * {@inheritdoc} - */ public function hasDefault(): bool { return $this->fixerOption->hasDefault(); } - /** - * {@inheritdoc} - */ public function getDefault() { return $this->fixerOption->getDefault(); } - /** - * {@inheritdoc} - */ public function getAllowedTypes(): ?array { return $this->fixerOption->getAllowedTypes(); } - /** - * {@inheritdoc} - */ public function getAllowedValues(): ?array { return $this->fixerOption->getAllowedValues(); } - /** - * {@inheritdoc} - */ public function getNormalizer(): ?\Closure { return $this->fixerOption->getNormalizer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOptionBuilder.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOptionBuilder.php index 1020d139..13bb3faa 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOptionBuilder.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOptionBuilder.php @@ -52,7 +52,7 @@ public function setAllowedTypes(array $allowedTypes): self } /** - * @param list<(callable(mixed): bool)|null|scalar> $allowedValues + * @param list $allowedValues */ public function setAllowedValues(array $allowedValues): self { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AllowedValueSubset.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AllowedValueSubset.php index fad56516..4f328974 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AllowedValueSubset.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AllowedValueSubset.php @@ -15,6 +15,8 @@ namespace PhpCsFixer\FixerConfiguration; /** + * @readonly + * * @internal */ final class AllowedValueSubset @@ -29,8 +31,8 @@ final class AllowedValueSubset */ public function __construct(array $allowedValues) { + sort($allowedValues, SORT_FLAG_CASE | SORT_STRING); $this->allowedValues = $allowedValues; - sort($this->allowedValues, SORT_FLAG_CASE | SORT_STRING); } /** diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOption.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOption.php index 607aba39..c2ea366a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOption.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOption.php @@ -14,6 +14,9 @@ namespace PhpCsFixer\FixerConfiguration; +/** + * @readonly + */ final class DeprecatedFixerOption implements DeprecatedFixerOptionInterface { private FixerOptionInterface $option; @@ -26,57 +29,39 @@ public function __construct(FixerOptionInterface $option, string $deprecationMes $this->deprecationMessage = $deprecationMessage; } - /** - * {@inheritdoc} - */ public function getName(): string { return $this->option->getName(); } - /** - * {@inheritdoc} - */ public function getDescription(): string { return $this->option->getDescription(); } - /** - * {@inheritdoc} - */ public function hasDefault(): bool { return $this->option->hasDefault(); } /** - * {@inheritdoc} + * @return mixed */ public function getDefault() { return $this->option->getDefault(); } - /** - * {@inheritdoc} - */ public function getAllowedTypes(): ?array { return $this->option->getAllowedTypes(); } - /** - * {@inheritdoc} - */ public function getAllowedValues(): ?array { return $this->option->getAllowedValues(); } - /** - * {@inheritdoc} - */ public function getNormalizer(): ?\Closure { return $this->option->getNormalizer(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolver.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolver.php index 2517f290..24611144 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolver.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolver.php @@ -14,47 +14,43 @@ namespace PhpCsFixer\FixerConfiguration; +use PhpCsFixer\Preg; use PhpCsFixer\Utils; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * @readonly + */ final class FixerConfigurationResolver implements FixerConfigurationResolverInterface { /** * @var list + * + * @readonly */ - private array $options = []; - - /** - * @var list - */ - private array $registeredNames = []; + private array $options; /** * @param iterable $options */ public function __construct(iterable $options) { - foreach ($options as $option) { - $this->addOption($option); - } + $fixerOptionSorter = new FixerOptionSorter(); + $this->validateOptions($options); + + $this->options = $fixerOptionSorter->sort($options); - if (0 === \count($this->registeredNames)) { + if (0 === \count($this->options)) { throw new \LogicException('Options cannot be empty.'); } } - /** - * {@inheritdoc} - */ public function getOptions(): array { return $this->options; } - /** - * {@inheritdoc} - */ public function resolve(array $configuration): array { $resolver = new OptionsResolver(); @@ -67,10 +63,10 @@ public function resolve(array $configuration): array if (\array_key_exists($alias, $configuration)) { if (\array_key_exists($name, $configuration)) { - throw new InvalidOptionsException(sprintf('Aliased option "%s"/"%s" is passed multiple times.', $name, $alias)); + throw new InvalidOptionsException(\sprintf('Aliased option "%s"/"%s" is passed multiple times.', $name, $alias)); } - Utils::triggerDeprecation(new \RuntimeException(sprintf( + Utils::triggerDeprecation(new \RuntimeException(\sprintf( 'Option "%s" is deprecated, use "%s" instead.', $alias, $name @@ -91,9 +87,7 @@ public function resolve(array $configuration): array if (null !== $allowedValues) { foreach ($allowedValues as &$allowedValue) { if (\is_object($allowedValue) && \is_callable($allowedValue)) { - $allowedValue = static function (/* mixed */ $values) use ($allowedValue) { - return $allowedValue($values); - }; + $allowedValue = static fn (/* mixed */ $values) => $allowedValue($values); } } @@ -102,7 +96,29 @@ public function resolve(array $configuration): array $allowedTypes = $option->getAllowedTypes(); if (null !== $allowedTypes) { - $resolver->setAllowedTypes($name, $allowedTypes); + $allowedTypesNormalised = array_map( + static function (string $type): string { + // Symfony OptionsResolver doesn't support `array` natively, let's simplify the type + $matches = []; + if (true === Preg::match('/array<\w+,\s*(\??[\w\'|]+)>/', $type, $matches)) { + if ('?' === $matches[1][0]) { + return 'array'; + } + + if ("'" === $matches[1][0]) { + return 'string[]'; + } + + return $matches[1].'[]'; + } + + // Symfony OptionsResolver doesn't support 'class-string' natively, let's simplify the type + return str_replace('class-string', 'string', $type); + }, + $allowedTypes, + ); + + $resolver->setAllowedTypes($name, $allowedTypesNormalised); } $normalizer = $option->getNormalizer(); @@ -115,17 +131,22 @@ public function resolve(array $configuration): array } /** + * @param iterable $options + * * @throws \LogicException when the option is already defined */ - private function addOption(FixerOptionInterface $option): void + private function validateOptions(iterable $options): void { - $name = $option->getName(); + $names = []; - if (\in_array($name, $this->registeredNames, true)) { - throw new \LogicException(sprintf('The "%s" option is defined multiple times.', $name)); - } + foreach ($options as $option) { + $name = $option->getName(); + + if (\in_array($name, $names, true)) { + throw new \LogicException(\sprintf('The "%s" option is defined multiple times.', $name)); + } - $this->options[] = $option; - $this->registeredNames[] = $name; + $names[] = $name; + } } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOption.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOption.php index db6556ec..97edd4eb 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOption.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOption.php @@ -14,6 +14,9 @@ namespace PhpCsFixer\FixerConfiguration; +/** + * @readonly + */ final class FixerOption implements FixerOptionInterface { private string $name; @@ -30,22 +33,19 @@ final class FixerOption implements FixerOptionInterface /** * @var null|list */ - private $allowedTypes; + private ?array $allowedTypes; /** - * @var null|list<(callable(mixed): bool)|null|scalar> + * @var null|list */ - private $allowedValues; + private ?array $allowedValues; - /** - * @var null|\Closure - */ - private $normalizer; + private ?\Closure $normalizer; /** - * @param mixed $default - * @param null|list $allowedTypes - * @param null|list<(callable(mixed): bool)|null|scalar> $allowedValues + * @param mixed $default + * @param null|list $allowedTypes + * @param null|list $allowedValues */ public function __construct( string $name, @@ -77,35 +77,28 @@ public function __construct( if (null !== $normalizer) { $this->normalizer = $this->unbind($normalizer); + } else { + $this->normalizer = null; } } - /** - * {@inheritdoc} - */ public function getName(): string { return $this->name; } - /** - * {@inheritdoc} - */ public function getDescription(): string { return $this->description; } - /** - * {@inheritdoc} - */ public function hasDefault(): bool { return !$this->isRequired; } /** - * {@inheritdoc} + * @return mixed */ public function getDefault() { @@ -116,25 +109,16 @@ public function getDefault() return $this->default; } - /** - * {@inheritdoc} - */ public function getAllowedTypes(): ?array { return $this->allowedTypes; } - /** - * {@inheritdoc} - */ public function getAllowedValues(): ?array { return $this->allowedValues; } - /** - * {@inheritdoc} - */ public function getNormalizer(): ?\Closure { return $this->normalizer; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionBuilder.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionBuilder.php index ef297164..8f8a4ea5 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionBuilder.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionBuilder.php @@ -21,7 +21,7 @@ final class FixerOptionBuilder private string $description; /** - * @var mixed + * @var null|mixed */ private $default; @@ -30,27 +30,22 @@ final class FixerOptionBuilder /** * @var null|list */ - private $allowedTypes; + private ?array $allowedTypes = null; /** - * @var null|list<(callable(mixed): bool)|null|scalar> + * @var null|list */ - private $allowedValues; + private ?array $allowedValues = null; - /** - * @var null|\Closure - */ - private $normalizer; + private ?\Closure $normalizer = null; - /** - * @var null|string - */ - private $deprecationMessage; + private ?string $deprecationMessage = null; public function __construct(string $name, string $description) { $this->name = $name; $this->description = $description; + $this->default = null; } /** @@ -79,7 +74,7 @@ public function setAllowedTypes(array $allowedTypes): self } /** - * @param list<(callable(mixed): bool)|null|scalar> $allowedValues + * @param list $allowedValues * * @return $this */ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionInterface.php index 9ff7c5dc..d760e4df 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionInterface.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionInterface.php @@ -35,7 +35,7 @@ public function getDefault(); public function getAllowedTypes(): ?array; /** - * @return null|list<(callable(mixed): bool)|null|scalar> + * @return null|list */ public function getAllowedValues(): ?array; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionSorter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionSorter.php new file mode 100644 index 00000000..bb526874 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionSorter.php @@ -0,0 +1,37 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\FixerConfiguration; + +/** + * @internal + */ +final class FixerOptionSorter +{ + /** + * @param iterable $options + * + * @return list + */ + public function sort(iterable $options): array + { + if (!\is_array($options)) { + $options = iterator_to_array($options, false); + } + + usort($options, static fn (FixerOptionInterface $a, FixerOptionInterface $b): int => $a->getName() <=> $b->getName()); + + return $options; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/InvalidOptionsForEnvException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/InvalidOptionsForEnvException.php index e1957ac6..4c12d5da 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/InvalidOptionsForEnvException.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/InvalidOptionsForEnvException.php @@ -21,6 +21,4 @@ * * @internal */ -final class InvalidOptionsForEnvException extends InvalidOptionsException -{ -} +final class InvalidOptionsForEnvException extends InvalidOptionsException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSample.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSample.php index b0dd2fed..b705bb66 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSample.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSample.php @@ -16,6 +16,8 @@ /** * @author Dariusz Rumiński + * + * @readonly */ final class CodeSample implements CodeSampleInterface { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSample.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSample.php index 833d94c1..8547737c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSample.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSample.php @@ -17,6 +17,8 @@ /** * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class FileSpecificCodeSample implements FileSpecificCodeSampleInterface @@ -37,25 +39,16 @@ public function __construct( $this->splFileInfo = $splFileInfo; } - /** - * {@inheritdoc} - */ public function getCode(): string { return $this->codeSample->getCode(); } - /** - * {@inheritdoc} - */ public function getConfiguration(): ?array { return $this->codeSample->getConfiguration(); } - /** - * {@inheritdoc} - */ public function getSplFileInfo(): \SplFileInfo { return $this->splFileInfo; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinition.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinition.php index cd1e4779..8da7f3d1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinition.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinition.php @@ -16,6 +16,8 @@ /** * @author Dariusz Rumiński + * + * @readonly */ final class FixerDefinition implements FixerDefinitionInterface { @@ -26,8 +28,14 @@ final class FixerDefinition implements FixerDefinitionInterface */ private array $codeSamples; + /** + * Description of Fixer and benefit of using it. + */ private ?string $description; + /** + * Description why Fixer is risky. + */ private ?string $riskyDescription; /** diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSample.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSample.php index c5d3dc1f..c27a8748 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSample.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSample.php @@ -16,6 +16,8 @@ /** * @author Andreas Möller + * + * @readonly */ final class VersionSpecificCodeSample implements VersionSpecificCodeSampleInterface { @@ -35,25 +37,16 @@ public function __construct( $this->versionSpecification = $versionSpecification; } - /** - * {@inheritdoc} - */ public function getCode(): string { return $this->codeSample->getCode(); } - /** - * {@inheritdoc} - */ public function getConfiguration(): ?array { return $this->codeSample->getConfiguration(); } - /** - * {@inheritdoc} - */ public function isSuitableFor(int $version): bool { return $this->versionSpecification->isSatisfiedBy($version); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecification.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecification.php index d8923b29..e33fa4aa 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecification.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecification.php @@ -16,6 +16,8 @@ /** * @author Andreas Möller + * + * @readonly */ final class VersionSpecification implements VersionSpecificationInterface { @@ -59,9 +61,6 @@ public function __construct(?int $minimum = null, ?int $maximum = null) $this->maximum = $maximum; } - /** - * {@inheritdoc} - */ public function isSatisfiedBy(int $version): bool { if (null !== $this->minimum && $version < $this->minimum) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerFactory.php index b9dbd4e5..8b422396 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerFactory.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerFactory.php @@ -83,25 +83,35 @@ public function registerBuiltInFixers(): self static $builtInFixers = null; if (null === $builtInFixers) { + /** @var list> */ $builtInFixers = []; + $finder = SymfonyFinder::create()->files() + ->in(__DIR__.'/Fixer') + ->exclude(['Internal']) + ->name('*Fixer.php') + ->depth(1) + ; + /** @var SplFileInfo $file */ - foreach (SymfonyFinder::create()->files()->in(__DIR__.'/Fixer')->name('*Fixer.php')->depth(1) as $file) { + foreach ($finder as $file) { $relativeNamespace = $file->getRelativePath(); - $fixerClass = 'PhpCsFixer\\Fixer\\'.($relativeNamespace ? $relativeNamespace.'\\' : '').$file->getBasename('.php'); + $fixerClass = 'PhpCsFixer\Fixer\\'.('' !== $relativeNamespace ? $relativeNamespace.'\\' : '').$file->getBasename('.php'); $builtInFixers[] = $fixerClass; } } foreach ($builtInFixers as $class) { - $this->registerFixer(new $class(), false); + /** @var FixerInterface */ + $fixer = new $class(); + $this->registerFixer($fixer, false); } return $this; } /** - * @param FixerInterface[] $fixers + * @param iterable $fixers * * @return $this */ @@ -122,11 +132,11 @@ public function registerFixer(FixerInterface $fixer, bool $isCustom): self $name = $fixer->getName(); if (isset($this->fixersByName[$name])) { - throw new \UnexpectedValueException(sprintf('Fixer named "%s" is already registered.', $name)); + throw new \UnexpectedValueException(\sprintf('Fixer named "%s" is already registered.', $name)); } if (!$this->nameValidator->isValid($name, $isCustom)) { - throw new \UnexpectedValueException(sprintf('Fixer named "%s" has invalid name.', $name)); + throw new \UnexpectedValueException(\sprintf('Fixer named "%s" has invalid name.', $name)); } $this->fixers[] = $fixer; @@ -149,7 +159,7 @@ public function useRuleSet(RuleSetInterface $ruleSet): self $fixerNames = array_keys($ruleSet->getRules()); foreach ($fixerNames as $name) { if (!\array_key_exists($name, $this->fixersByName)) { - throw new \UnexpectedValueException(sprintf('Rule "%s" does not exist.', $name)); + throw new \UnexpectedValueException(\sprintf('Rule "%s" does not exist.', $name)); } $fixer = $this->fixersByName[$name]; @@ -195,11 +205,15 @@ public function hasRule(string $name): bool } /** - * @return null|string[] + * @return list */ - private function getFixersConflicts(FixerInterface $fixer): ?array + private function getFixersConflicts(FixerInterface $fixer): array { static $conflictMap = [ + 'blank_lines_before_namespace' => [ + 'no_blank_lines_before_namespace', + 'single_blank_line_before_namespace', + ], 'no_blank_lines_before_namespace' => ['single_blank_line_before_namespace'], 'single_import_per_statement' => ['group_import'], ]; @@ -210,7 +224,7 @@ private function getFixersConflicts(FixerInterface $fixer): ?array } /** - * @param array $fixerConflicts + * @param array> $fixerConflicts */ private function generateConflictMessage(array $fixerConflicts): string { @@ -221,13 +235,11 @@ private function generateConflictMessage(array $fixerConflicts): string // filter mutual conflicts $report[$fixer] = array_filter( $fixers, - static function (string $candidate) use ($report, $fixer): bool { - return !\array_key_exists($candidate, $report) || !\in_array($fixer, $report[$candidate], true); - } + static fn (string $candidate): bool => !\array_key_exists($candidate, $report) || !\in_array($fixer, $report[$candidate], true) ); if (\count($report[$fixer]) > 0) { - $message .= sprintf("\n- \"%s\" with \"%s\"", $fixer, implode('", "', $report[$fixer])); + $message .= \sprintf("\n- \"%s\" with %s", $fixer, Utils::naturalLanguageJoin($report[$fixer])); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerNameValidator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerNameValidator.php index ce2697d3..8f19cb06 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerNameValidator.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerNameValidator.php @@ -24,9 +24,9 @@ final class FixerNameValidator public function isValid(string $name, bool $isCustom): bool { if (!$isCustom) { - return 1 === Preg::match('/^[a-z][a-z0-9_]*$/', $name); + return Preg::match('/^[a-z][a-z0-9_]*$/', $name); } - return 1 === Preg::match('/^[A-Z][a-zA-Z0-9]*\/[a-z][a-z0-9_]*$/', $name); + return Preg::match('/^[A-Z][a-zA-Z0-9]*\/[a-z][a-z0-9_]*$/', $name); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Indicator/PhpUnitTestCaseIndicator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Indicator/PhpUnitTestCaseIndicator.php index 543bbf1b..ed82aaa2 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Indicator/PhpUnitTestCaseIndicator.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Indicator/PhpUnitTestCaseIndicator.php @@ -25,7 +25,7 @@ final class PhpUnitTestCaseIndicator public function isPhpUnitClass(Tokens $tokens, int $index): bool { if (!$tokens[$index]->isGivenKind(T_CLASS)) { - throw new \LogicException(sprintf('No "T_CLASS" at given index %d, got "%s".', $index, $tokens[$index]->getName())); + throw new \LogicException(\sprintf('No "T_CLASS" at given index %d, got "%s".', $index, $tokens[$index]->getName())); } $index = $tokens->getNextMeaningfulToken($index); @@ -40,7 +40,7 @@ public function isPhpUnitClass(Tokens $tokens, int $index): bool return false; } - if (0 !== Preg::match('/(?:Test|TestCase)$/', $tokens[$index]->getContent())) { + if (Preg::match('/(?:Test|TestCase)$/', $tokens[$index]->getContent())) { return true; } @@ -53,7 +53,7 @@ public function isPhpUnitClass(Tokens $tokens, int $index): bool continue; // not part of extends nor part of implements; so continue } - if (0 !== Preg::match('/(?:Test|TestCase)(?:Interface)?$/', $tokens[$index]->getContent())) { + if (Preg::match('/(?:Test|TestCase)(?:Interface)?$/', $tokens[$index]->getContent())) { return true; } } @@ -65,7 +65,7 @@ public function isPhpUnitClass(Tokens $tokens, int $index): bool * Returns an indices of PHPUnit classes in reverse appearance order. * Order is important - it's reverted, so if we inject tokens into collection, * we do it for bottom of file first, and then to the top of the file, so we - * mitigate risk of not visiting whole collcetion (final indices). + * mitigate risk of not visiting whole collections (final indices). * * @return iterable array of [int start, int end] indices from later to earlier classes */ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/CachingLinter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/CachingLinter.php index 8140824b..7d6813fe 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/CachingLinter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/CachingLinter.php @@ -33,39 +33,22 @@ public function __construct(LinterInterface $linter) $this->sublinter = $linter; } - /** - * {@inheritdoc} - */ public function isAsync(): bool { return $this->sublinter->isAsync(); } - /** - * {@inheritdoc} - */ public function lintFile(string $path): LintingResultInterface { $checksum = md5(file_get_contents($path)); - if (!isset($this->cache[$checksum])) { - $this->cache[$checksum] = $this->sublinter->lintFile($path); - } - - return $this->cache[$checksum]; + return $this->cache[$checksum] ??= $this->sublinter->lintFile($path); } - /** - * {@inheritdoc} - */ public function lintSource(string $source): LintingResultInterface { $checksum = md5($source); - if (!isset($this->cache[$checksum])) { - $this->cache[$checksum] = $this->sublinter->lintSource($source); - } - - return $this->cache[$checksum]; + return $this->cache[$checksum] ??= $this->sublinter->lintSource($source); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/Linter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/Linter.php index 4139e1e1..86129ab4 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/Linter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/Linter.php @@ -19,6 +19,8 @@ * * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class Linter implements LinterInterface @@ -30,25 +32,16 @@ public function __construct() $this->subLinter = new TokenizerLinter(); } - /** - * {@inheritdoc} - */ public function isAsync(): bool { return $this->subLinter->isAsync(); } - /** - * {@inheritdoc} - */ public function lintFile(string $path): LintingResultInterface { return $this->subLinter->lintFile($path); } - /** - * {@inheritdoc} - */ public function lintSource(string $source): LintingResultInterface { return $this->subLinter->lintSource($source); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingException.php index b4adb7e8..1874bac1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingException.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingException.php @@ -21,6 +21,4 @@ * * @TODO 4.0 make class "final" */ -class LintingException extends \RuntimeException -{ -} +class LintingException extends \RuntimeException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinter.php index edd2ca87..74d276a6 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinter.php @@ -35,10 +35,8 @@ final class ProcessLinter implements LinterInterface /** * Temporary file for code linting. - * - * @var null|string */ - private $temporaryFile; + private ?string $temporaryFile = null; /** * @param null|string $executable PHP executable, null for autodetection @@ -84,7 +82,7 @@ public function __destruct() */ public function __sleep(): array { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); + throw new \BadMethodCallException('Cannot serialize '.self::class); } /** @@ -95,28 +93,19 @@ public function __sleep(): array */ public function __wakeup(): void { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); + throw new \BadMethodCallException('Cannot unserialize '.self::class); } - /** - * {@inheritdoc} - */ public function isAsync(): bool { return true; } - /** - * {@inheritdoc} - */ public function lintFile(string $path): LintingResultInterface { return new ProcessLintingResult($this->createProcessForFile($path), $path); } - /** - * {@inheritdoc} - */ public function lintSource(string $source): LintingResultInterface { return new ProcessLintingResult($this->createProcessForSource($source), $this->temporaryFile); @@ -152,7 +141,7 @@ private function createProcessForSource(string $source): Process } if (false === @file_put_contents($this->temporaryFile, $source)) { - throw new IOException(sprintf('Failed to write file "%s".', $this->temporaryFile), 0, null, $this->temporaryFile); + throw new IOException(\sprintf('Failed to write file "%s".', $this->temporaryFile), 0, null, $this->temporaryFile); } return $this->createProcessForFile($this->temporaryFile); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinterProcessBuilder.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinterProcessBuilder.php index ee9a555e..2dd24e17 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinterProcessBuilder.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinterProcessBuilder.php @@ -19,6 +19,8 @@ /** * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class ProcessLinterProcessBuilder diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLintingResult.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLintingResult.php index 985869ea..bbdd78c9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLintingResult.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLintingResult.php @@ -35,9 +35,6 @@ public function __construct(Process $process, ?string $path = null) $this->path = $path; } - /** - * {@inheritdoc} - */ public function check(): void { if (!$this->isSuccessful()) { @@ -48,32 +45,33 @@ public function check(): void private function getProcessErrorMessage(): string { - $output = strtok(ltrim($this->process->getErrorOutput() ?: $this->process->getOutput()), "\n"); + $errorOutput = $this->process->getErrorOutput(); + $output = strtok(ltrim('' !== $errorOutput ? $errorOutput : $this->process->getOutput()), "\n"); if (false === $output) { return 'Fatal error: Unable to lint file.'; } if (null !== $this->path) { - $needle = sprintf('in %s ', $this->path); + $needle = \sprintf('in %s ', $this->path); $pos = strrpos($output, $needle); if (false !== $pos) { - $output = sprintf('%s%s', substr($output, 0, $pos), substr($output, $pos + \strlen($needle))); + $output = \sprintf('%s%s', substr($output, 0, $pos), substr($output, $pos + \strlen($needle))); } } $prefix = substr($output, 0, 18); if ('PHP Parse error: ' === $prefix) { - return sprintf('Parse error: %s.', substr($output, 18)); + return \sprintf('Parse error: %s.', substr($output, 18)); } if ('PHP Fatal error: ' === $prefix) { - return sprintf('Fatal error: %s.', substr($output, 18)); + return \sprintf('Fatal error: %s.', substr($output, 18)); } - return sprintf('%s.', $output); + return \sprintf('%s.', $output); } private function isSuccessful(): bool diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLinter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLinter.php index d4ba1182..fec0b674 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLinter.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLinter.php @@ -23,29 +23,22 @@ * * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class TokenizerLinter implements LinterInterface { - /** - * {@inheritdoc} - */ public function isAsync(): bool { return false; } - /** - * {@inheritdoc} - */ public function lintFile(string $path): LintingResultInterface { return $this->lintSource(FileReader::createSingleton()->read($path)); } - /** - * {@inheritdoc} - */ public function lintSource(string $source): LintingResultInterface { try { @@ -58,7 +51,7 @@ public function lintSource(string $source): LintingResultInterface Tokens::fromCode($source); return new TokenizerLintingResult(); - } catch (\ParseError|\CompileError $e) { + } catch (\CompileError|\ParseError $e) { return new TokenizerLintingResult($e); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLintingResult.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLintingResult.php index d233437e..469f2dfd 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLintingResult.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLintingResult.php @@ -17,6 +17,8 @@ /** * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class TokenizerLintingResult implements LintingResultInterface @@ -28,14 +30,11 @@ public function __construct(?\Error $error = null) $this->error = $error; } - /** - * {@inheritdoc} - */ public function check(): void { if (null !== $this->error) { throw new LintingException( - sprintf('%s: %s on line %d.', $this->getMessagePrefix(), $this->error->getMessage(), $this->error->getLine()), + \sprintf('%s: %s on line %d.', $this->getMessagePrefix(), $this->error->getMessage(), $this->error->getLine()), $this->error->getCode(), $this->error ); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/UnavailableLinterException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/UnavailableLinterException.php index 20cefbbf..df67b5f0 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/UnavailableLinterException.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/UnavailableLinterException.php @@ -23,6 +23,4 @@ * * @TODO 4.0 make class "final" */ -class UnavailableLinterException extends \RuntimeException -{ -} +class UnavailableLinterException extends \RuntimeException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ParallelAwareConfigInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ParallelAwareConfigInterface.php new file mode 100644 index 00000000..6716cf3c --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ParallelAwareConfigInterface.php @@ -0,0 +1,29 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer; + +use PhpCsFixer\Runner\Parallel\ParallelConfig; + +/** + * @author Greg Korba + * + * @TODO 4.0 Include parallel runner config in main ConfigInterface + */ +interface ParallelAwareConfigInterface extends ConfigInterface +{ + public function getParallelConfig(): ParallelConfig; + + public function setParallelConfig(ParallelConfig $config): ConfigInterface; +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharChecker.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharChecker.php index fb352420..b7cb356c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharChecker.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharChecker.php @@ -19,9 +19,6 @@ */ final class PharChecker implements PharCheckerInterface { - /** - * {@inheritdoc} - */ public function checkFileValidity(string $filename): ?string { try { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Preg.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Preg.php index 42456035..a88db938 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Preg.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Preg.php @@ -25,28 +25,63 @@ final class Preg { /** - * @param null|string[] $matches - * @param int-mask<0, 256, 512> $flags + * @param array $matches + * @param int-mask $flags + * + * @param-out ($flags is PREG_OFFSET_CAPTURE + * ? array + * : ($flags is PREG_UNMATCHED_AS_NULL + * ? array + * : ($flags is int-mask&768 + * ? array + * : array + * ) + * ) + * ) $matches * * @throws PregException */ - public static function match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int + public static function match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool { $result = @preg_match(self::addUtf8Modifier($pattern), $subject, $matches, $flags, $offset); if (false !== $result && PREG_NO_ERROR === preg_last_error()) { - return $result; + return 1 === $result; } $result = @preg_match(self::removeUtf8Modifier($pattern), $subject, $matches, $flags, $offset); if (false !== $result && PREG_NO_ERROR === preg_last_error()) { - return $result; + return 1 === $result; } - throw self::newPregException(preg_last_error(), __METHOD__, (array) $pattern); + throw self::newPregException(preg_last_error(), preg_last_error_msg(), __METHOD__, $pattern); } /** - * @param null|string[] $matches + * @param array $matches + * @param int-mask $flags + * + * @param-out ($flags is PREG_PATTERN_ORDER + * ? array> + * : ($flags is PREG_SET_ORDER + * ? list> + * : ($flags is int-mask&(256|257) + * ? array> + * : ($flags is int-mask&258 + * ? list> + * : ($flags is int-mask&(512|513) + * ? array> + * : ($flags is int-mask&514 + * ? list> + * : ($flags is int-mask&770 + * ? list> + * : ($flags is 0 ? array> : array) + * ) + * ) + * ) + * ) + * ) + * ) + * ) $matches * * @throws PregException */ @@ -62,11 +97,13 @@ public static function matchAll(string $pattern, string $subject, ?array &$match return $result; } - throw self::newPregException(preg_last_error(), __METHOD__, (array) $pattern); + throw self::newPregException(preg_last_error(), preg_last_error_msg(), __METHOD__, $pattern); } /** - * @param string|string[] $subject + * @param array|string $subject + * + * @param-out int $count * * @throws PregException */ @@ -82,10 +119,12 @@ public static function replace(string $pattern, string $replacement, $subject, i return $result; } - throw self::newPregException(preg_last_error(), __METHOD__, (array) $pattern); + throw self::newPregException(preg_last_error(), preg_last_error_msg(), __METHOD__, $pattern); } /** + * @param-out int $count + * * @throws PregException */ public static function replaceCallback(string $pattern, callable $callback, string $subject, int $limit = -1, ?int &$count = null): string @@ -100,11 +139,11 @@ public static function replaceCallback(string $pattern, callable $callback, stri return $result; } - throw self::newPregException(preg_last_error(), __METHOD__, (array) $pattern); + throw self::newPregException(preg_last_error(), preg_last_error_msg(), __METHOD__, $pattern); } /** - * @return string[] + * @return list * * @throws PregException */ @@ -120,34 +159,16 @@ public static function split(string $pattern, string $subject, int $limit = -1, return $result; } - throw self::newPregException(preg_last_error(), __METHOD__, (array) $pattern); + throw self::newPregException(preg_last_error(), preg_last_error_msg(), __METHOD__, $pattern); } - /** - * @param string|string[] $pattern - * - * @return string|string[] - */ - private static function addUtf8Modifier($pattern) + private static function addUtf8Modifier(string $pattern): string { - if (\is_array($pattern)) { - return array_map(__METHOD__, $pattern); - } - return $pattern.'u'; } - /** - * @param string|string[] $pattern - * - * @return string|string[] - */ - private static function removeUtf8Modifier($pattern) + private static function removeUtf8Modifier(string $pattern): string { - if (\is_array($pattern)) { - return array_map(__METHOD__, $pattern); - } - if ('' === $pattern) { return ''; } @@ -160,42 +181,35 @@ private static function removeUtf8Modifier($pattern) } /** - * Create PregException. - * - * Create the generic PregException message and if possible due to finding - * an invalid pattern, tell more about such kind of error in the message. - * - * @param string[] $patterns + * Create the generic PregException message and tell more about such kind of error in the message. */ - private static function newPregException(int $error, string $method, array $patterns): PregException + private static function newPregException(int $error, string $errorMsg, string $method, string $pattern): PregException { - foreach ($patterns as $pattern) { - $last = error_get_last(); - $result = @preg_match($pattern, ''); - - if (false !== $result) { - continue; - } - - $code = preg_last_error(); - $next = error_get_last(); - - if ($last !== $next) { - $message = sprintf( - '(code: %d) %s', - $code, - preg_replace('~preg_[a-z_]+[()]{2}: ~', '', $next['message']) - ); - } else { - $message = sprintf('(code: %d)', $code); - } - - return new PregException( - sprintf('%s(): Invalid PCRE pattern "%s": %s (version: %s)', $method, $pattern, $message, PCRE_VERSION), - $code - ); + $result = null; + $errorMessage = null; + + try { + $result = ExecutorWithoutErrorHandler::execute(static fn () => preg_match($pattern, '')); + } catch (ExecutorWithoutErrorHandlerException $e) { + $result = false; + $errorMessage = $e->getMessage(); + } + + if (false !== $result) { + return new PregException(\sprintf('Unknown error occurred when calling %s: %s.', $method, $errorMsg), $error); } - return new PregException(sprintf('Error occurred when calling %s.', $method), $error); + $code = preg_last_error(); + + $message = \sprintf( + '(code: %d) %s', + $code, + preg_replace('~preg_[a-z_]+[()]{2}: ~', '', $errorMessage) + ); + + return new PregException( + \sprintf('%s(): Invalid PCRE pattern "%s": %s (version: %s)', $method, $pattern, $message, PCRE_VERSION), + $code + ); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PregException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PregException.php index c91b86ce..57519e8a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PregException.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PregException.php @@ -21,6 +21,4 @@ * * @internal */ -final class PregException extends \RuntimeException -{ -} +final class PregException extends \RuntimeException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMigrationSetDescription.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMigrationSetDescription.php index 02138fe0..397c6873 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMigrationSetDescription.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMigrationSetDescription.php @@ -25,14 +25,14 @@ public function getDescription(): string { $name = $this->getName(); - if (0 !== Preg::match('#^@PHPUnit(\d+)(\d)Migration.*$#', $name, $matches)) { - return sprintf('Rules to improve tests code for PHPUnit %d.%d compatibility.', $matches[1], $matches[2]); + if (Preg::match('#^@PHPUnit(\d+)(\d)Migration.*$#', $name, $matches)) { + return \sprintf('Rules to improve tests code for PHPUnit %d.%d compatibility.', $matches[1], $matches[2]); } - if (0 !== Preg::match('#^@PHP([\d]{2})Migration.*$#', $name, $matches)) { - return sprintf('Rules to improve code for PHP %d.%d compatibility.', $matches[1][0], $matches[1][1]); + if (Preg::match('#^@PHP([\d]{2})Migration.*$#', $name, $matches)) { + return \sprintf('Rules to improve code for PHP %d.%d compatibility.', $matches[1][0], $matches[1][1]); } - throw new \RuntimeException(sprintf('Cannot generate description for "%s" "%s".', static::class, $name)); + throw new \RuntimeException(\sprintf('Cannot generate description for "%s" "%s".', static::class, $name)); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractRuleSetDescription.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractRuleSetDescription.php index d822ffcc..db565b41 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractRuleSetDescription.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractRuleSetDescription.php @@ -19,9 +19,7 @@ */ abstract class AbstractRuleSetDescription implements RuleSetDescriptionInterface { - public function __construct() - { - } + public function __construct() {} public function getName(): string { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/DeprecatedRuleSetDescriptionInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/DeprecatedRuleSetDescriptionInterface.php new file mode 100644 index 00000000..ae52441d --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/DeprecatedRuleSetDescriptionInterface.php @@ -0,0 +1,28 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\RuleSet; + +/** + * @author Greg Korba + */ +interface DeprecatedRuleSetDescriptionInterface extends RuleSetDescriptionInterface +{ + /** + * Returns names of rule sets to use instead, if any. + * + * @return list + */ + public function getSuccessorsNames(): array; +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSet.php index ef2eda55..79286c9f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSet.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSet.php @@ -15,12 +15,15 @@ namespace PhpCsFixer\RuleSet; use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; +use PhpCsFixer\Utils; /** * Set of rules to be used by fixer. * * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class RuleSet implements RuleSetInterface @@ -28,10 +31,10 @@ final class RuleSet implements RuleSetInterface /** * Group of rules generated from input set. * - * The key is name of rule, value is bool if the rule/set should be used. + * The key is name of rule, value is configuration array or true. * The key must not point to any set. * - * @var array|bool> + * @var array|true> */ private array $rules; @@ -43,7 +46,7 @@ public function __construct(array $set = []) } if (\is_int($name)) { - throw new \InvalidArgumentException(sprintf('Missing value for "%s" rule/set.', $value)); + throw new \InvalidArgumentException(\sprintf('Missing value for "%s" rule/set.', $value)); } if (!\is_bool($value) && !\is_array($value)) { @@ -57,24 +60,18 @@ public function __construct(array $set = []) } } - $this->resolveSet($set); + $this->rules = $this->resolveSet($set); } - /** - * {@inheritdoc} - */ public function hasRule(string $rule): bool { return \array_key_exists($rule, $this->rules); } - /** - * {@inheritdoc} - */ public function getRuleConfiguration(string $rule): ?array { if (!$this->hasRule($rule)) { - throw new \InvalidArgumentException(sprintf('Rule "%s" is not in the set.', $rule)); + throw new \InvalidArgumentException(\sprintf('Rule "%s" is not in the set.', $rule)); } if (true === $this->rules[$rule]) { @@ -84,9 +81,6 @@ public function getRuleConfiguration(string $rule): ?array return $this->rules[$rule]; } - /** - * {@inheritdoc} - */ public function getRules(): array { return $this->rules; @@ -96,8 +90,10 @@ public function getRules(): array * Resolve input set into group of rules. * * @param array|bool> $rules + * + * @return array|true> */ - private function resolveSet(array $rules): void + private function resolveSet(array $rules): array { $resolvedRules = []; @@ -105,7 +101,7 @@ private function resolveSet(array $rules): void foreach ($rules as $name => $value) { if (str_starts_with($name, '@')) { if (!\is_bool($value)) { - throw new \UnexpectedValueException(sprintf('Nested rule set "%s" configuration must be a boolean.', $name)); + throw new \UnexpectedValueException(\sprintf('Nested rule set "%s" configuration must be a boolean.', $name)); } $set = $this->resolveSubset($name, $value); @@ -116,9 +112,12 @@ private function resolveSet(array $rules): void } // filter out all resolvedRules that are off - $resolvedRules = array_filter($resolvedRules); + $resolvedRules = array_filter( + $resolvedRules, + static fn ($value): bool => false !== $value + ); - $this->rules = $resolvedRules; + return $resolvedRules; } /** @@ -131,7 +130,17 @@ private function resolveSet(array $rules): void */ private function resolveSubset(string $setName, bool $setValue): array { - $rules = RuleSets::getSetDefinition($setName)->getRules(); + $ruleSet = RuleSets::getSetDefinition($setName); + + if ($ruleSet instanceof DeprecatedRuleSetDescriptionInterface) { + $messageEnd = [] === $ruleSet->getSuccessorsNames() + ? 'No replacement available' + : \sprintf('Use %s instead', Utils::naturalLanguageJoin($ruleSet->getSuccessorsNames())); + + Utils::triggerDeprecation(new \RuntimeException("Rule set \"{$setName}\" is deprecated. {$messageEnd}.")); + } + + $rules = $ruleSet->getRules(); foreach ($rules as $name => $value) { if (str_starts_with($name, '@')) { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetInterface.php index eb83b6b4..02424825 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetInterface.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetInterface.php @@ -38,7 +38,7 @@ public function getRuleConfiguration(string $rule): ?array; /** * Get all rules from rules set. * - * @return array|bool> + * @return array|true> */ public function getRules(): array; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSets.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSets.php index d10ff8c6..e66ced99 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSets.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSets.php @@ -24,9 +24,9 @@ final class RuleSets { /** - * @var array + * @var null|array */ - private static $setDefinitions; + private static ?array $setDefinitions = null; /** * @return array @@ -38,6 +38,8 @@ public static function getSetDefinitions(): array foreach (Finder::create()->files()->in(__DIR__.'/Sets') as $file) { $class = 'PhpCsFixer\RuleSet\Sets\\'.$file->getBasename('.php'); + + /** @var RuleSetDescriptionInterface */ $set = new $class(); self::$setDefinitions[$set->getName()] = $set; @@ -50,7 +52,7 @@ public static function getSetDefinitions(): array } /** - * @return string[] + * @return list */ public static function getSetDefinitionNames(): array { @@ -62,7 +64,7 @@ public static function getSetDefinition(string $name): RuleSetDescriptionInterfa $definitions = self::getSetDefinitions(); if (!isset($definitions[$name])) { - throw new \InvalidArgumentException(sprintf('Set "%s" does not exist.', $name)); + throw new \InvalidArgumentException(\sprintf('Set "%s" does not exist.', $name)); } return $definitions[$name]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0RiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0RiskySet.php new file mode 100644 index 00000000..3e446037 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0RiskySet.php @@ -0,0 +1,44 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\RuleSet\Sets; + +use PhpCsFixer\RuleSet\AbstractRuleSetDescription; + +/** + * @internal + * + * PER Coding Style v1.0. + * + * @see https://github.com/php-fig/per-coding-style/blob/1.0.0/spec.md + */ +final class PERCS1x0RiskySet extends AbstractRuleSetDescription +{ + public function getName(): string + { + return '@PER-CS1.0:risky'; + } + + public function getRules(): array + { + return [ + '@PSR12:risky' => true, + ]; + } + + public function getDescription(): string + { + return 'Rules that follow `PER Coding Style 1.0 `_.'; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0Set.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0Set.php new file mode 100644 index 00000000..3ad0a6fc --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0Set.php @@ -0,0 +1,44 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\RuleSet\Sets; + +use PhpCsFixer\RuleSet\AbstractRuleSetDescription; + +/** + * @internal + * + * PER Coding Style v1.0. + * + * @see https://github.com/php-fig/per-coding-style/blob/1.0.0/spec.md + */ +final class PERCS1x0Set extends AbstractRuleSetDescription +{ + public function getName(): string + { + return '@PER-CS1.0'; + } + + public function getRules(): array + { + return [ + '@PSR12' => true, + ]; + } + + public function getDescription(): string + { + return 'Rules that follow `PER Coding Style 1.0 `_.'; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0RiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0RiskySet.php new file mode 100644 index 00000000..4a75a93d --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0RiskySet.php @@ -0,0 +1,44 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\RuleSet\Sets; + +use PhpCsFixer\RuleSet\AbstractRuleSetDescription; + +/** + * @internal + * + * PER Coding Style v2.0. + * + * @see https://github.com/php-fig/per-coding-style/blob/2.0.0/spec.md + */ +final class PERCS2x0RiskySet extends AbstractRuleSetDescription +{ + public function getName(): string + { + return '@PER-CS2.0:risky'; + } + + public function getRules(): array + { + return [ + '@PER-CS1.0:risky' => true, + ]; + } + + public function getDescription(): string + { + return 'Rules that follow `PER Coding Style 2.0 `_.'; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0Set.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0Set.php new file mode 100644 index 00000000..7acf8e96 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0Set.php @@ -0,0 +1,112 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\RuleSet\Sets; + +use PhpCsFixer\RuleSet\AbstractRuleSetDescription; + +/** + * @internal + * + * PER Coding Style v2.0. + * + * @see https://github.com/php-fig/per-coding-style/blob/2.0.0/spec.md + */ +final class PERCS2x0Set extends AbstractRuleSetDescription +{ + public function getName(): string + { + return '@PER-CS2.0'; + } + + public function getRules(): array + { + return [ + '@PER-CS1.0' => true, + 'array_indentation' => true, + 'array_syntax' => true, + 'cast_spaces' => true, + 'concat_space' => ['spacing' => 'one'], + 'function_declaration' => [ + 'closure_fn_spacing' => 'none', + ], + 'method_argument_space' => true, + 'new_with_parentheses' => [ + 'anonymous_class' => false, + ], + 'single_line_empty_body' => true, + 'single_space_around_construct' => [ + 'constructs_followed_by_a_single_space' => [ + 'abstract', + 'as', + 'case', + 'catch', + 'class', + 'const', + 'const_import', + 'do', + 'else', + 'elseif', + 'enum', + 'final', + 'finally', + 'for', + 'foreach', + 'function', + 'function_import', + 'if', + 'insteadof', + 'interface', + 'match', + 'named_argument', + 'namespace', + 'new', + 'private', + 'protected', + 'public', + 'readonly', + 'static', + 'switch', + 'trait', + 'try', + 'type_colon', + 'use', + 'use_lambda', + 'while', + ], + 'constructs_preceded_by_a_single_space' => [ + 'as', + 'else', + 'elseif', + 'use_lambda', + ], + ], + 'trailing_comma_in_multiline' => [ + 'after_heredoc' => true, + 'elements' => [ + 'arguments', + 'array_destructuring', + 'arrays', + 'match', + 'parameters', + ], + ], + ]; + } + + public function getDescription(): string + { + return 'Rules that follow `PER Coding Style 2.0 `_.'; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSRiskySet.php new file mode 100644 index 00000000..6e6f7908 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSRiskySet.php @@ -0,0 +1,40 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\RuleSet\Sets; + +use PhpCsFixer\RuleSet\AbstractRuleSetDescription; + +/** + * @internal + */ +final class PERCSRiskySet extends AbstractRuleSetDescription +{ + public function getName(): string + { + return '@PER-CS:risky'; + } + + public function getRules(): array + { + return [ + '@PER-CS2.0:risky' => true, + ]; + } + + public function getDescription(): string + { + return 'Alias for the latest revision of PER-CS risky rules. Use it if you always want to be in sync with newest PER-CS standard.'; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSSet.php new file mode 100644 index 00000000..0fe59349 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSSet.php @@ -0,0 +1,40 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\RuleSet\Sets; + +use PhpCsFixer\RuleSet\AbstractRuleSetDescription; + +/** + * @internal + */ +final class PERCSSet extends AbstractRuleSetDescription +{ + public function getName(): string + { + return '@PER-CS'; + } + + public function getRules(): array + { + return [ + '@PER-CS2.0' => true, + ]; + } + + public function getDescription(): string + { + return 'Alias for the latest revision of PER-CS rules. Use it if you always want to be in sync with newest PER-CS standard.'; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERRiskySet.php index 05d89b20..9f156c28 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERRiskySet.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERRiskySet.php @@ -15,23 +15,38 @@ namespace PhpCsFixer\RuleSet\Sets; use PhpCsFixer\RuleSet\AbstractRuleSetDescription; +use PhpCsFixer\RuleSet\DeprecatedRuleSetDescriptionInterface; /** * @internal * - * Last updated to PER Coding Style v1.0.0. + * @deprecated use `@PER-CS:risky` instead + * + * @TODO 4.0 remove me + * + * Last updated to PER Coding Style v2.0. */ -final class PERRiskySet extends AbstractRuleSetDescription +final class PERRiskySet extends AbstractRuleSetDescription implements DeprecatedRuleSetDescriptionInterface { + public function getName(): string + { + return '@PER:risky'; + } + public function getRules(): array { return [ - '@PSR12:risky' => true, + '@PER-CS:risky' => true, ]; } public function getDescription(): string { - return 'Rules that follow `PER Coding Style `_.'; + return 'Alias for the newest PER-CS risky rules. It is recommended you use ``@PER-CS2.0:risky`` instead if you want to stick with stable ruleset.'; + } + + public function getSuccessorsNames(): array + { + return ['@PER-CS:risky']; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERSet.php index e5594032..81de37de 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERSet.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERSet.php @@ -15,23 +15,33 @@ namespace PhpCsFixer\RuleSet\Sets; use PhpCsFixer\RuleSet\AbstractRuleSetDescription; +use PhpCsFixer\RuleSet\DeprecatedRuleSetDescriptionInterface; /** * @internal * - * Last updated to PER Coding Style v1.0.0. + * @deprecated use `@PER-CS` instead + * + * @TODO 4.0 remove me + * + * Last updated to PER Coding Style v2.0. */ -final class PERSet extends AbstractRuleSetDescription +final class PERSet extends AbstractRuleSetDescription implements DeprecatedRuleSetDescriptionInterface { public function getRules(): array { return [ - '@PSR12' => true, + '@PER-CS' => true, ]; } public function getDescription(): string { - return 'Rules that follow `PER Coding Style `_.'; + return 'Alias for the newest PER-CS rules. It is recommended you use ``@PER-CS2.0`` instead if you want to stick with stable ruleset.'; + } + + public function getSuccessorsNames(): array + { + return ['@PER-CS']; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationRiskySet.php new file mode 100644 index 00000000..3bdbfdfc --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationRiskySet.php @@ -0,0 +1,31 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\RuleSet\Sets; + +use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; + +/** + * @internal + */ +final class PHP82MigrationRiskySet extends AbstractMigrationSetDescription +{ + public function getRules(): array + { + return [ + '@PHP80Migration:risky' => true, + 'phpdoc_readonly_class_comment_to_keyword' => true, + ]; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP83MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP83MigrationSet.php new file mode 100644 index 00000000..a2bdfbd9 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP83MigrationSet.php @@ -0,0 +1,30 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\RuleSet\Sets; + +use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; + +/** + * @internal + */ +final class PHP83MigrationSet extends AbstractMigrationSetDescription +{ + public function getRules(): array + { + return [ + '@PHP82Migration' => true, + ]; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP84MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP84MigrationSet.php new file mode 100644 index 00000000..480391bd --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP84MigrationSet.php @@ -0,0 +1,31 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\RuleSet\Sets; + +use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; + +/** + * @internal + */ +final class PHP84MigrationSet extends AbstractMigrationSetDescription +{ + public function getRules(): array + { + return [ + '@PHP83Migration' => true, + 'nullable_type_declaration_for_default_null_value' => true, + ]; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit100MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit100MigrationRiskySet.php index 815a2a07..f2092648 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit100MigrationRiskySet.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit100MigrationRiskySet.php @@ -24,8 +24,8 @@ final class PHPUnit100MigrationRiskySet extends AbstractMigrationSetDescription public function getRules(): array { return [ - '@PHPUnit84Migration:risky' => true, - 'php_unit_data_provider_static' => true, + '@PHPUnit91Migration:risky' => true, + 'php_unit_data_provider_static' => ['force' => true], ]; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit91MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit91MigrationRiskySet.php new file mode 100644 index 00000000..5f0736d9 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit91MigrationRiskySet.php @@ -0,0 +1,31 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\RuleSet\Sets; + +use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; + +/** + * @internal + */ +final class PHPUnit91MigrationRiskySet extends AbstractMigrationSetDescription +{ + public function getRules(): array + { + return [ + '@PHPUnit84Migration:risky' => true, + 'php_unit_assert_new_names' => true, + ]; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12Set.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12Set.php index f83221e8..a9f7b5ff 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12Set.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12Set.php @@ -25,21 +25,30 @@ public function getRules(): array { return [ '@PSR2' => true, + 'binary_operator_spaces' => [ + 'default' => 'at_least_single_space', + ], 'blank_line_after_opening_tag' => true, 'blank_line_between_import_groups' => true, + 'blank_lines_before_namespace' => true, + 'braces_position' => [ + 'allow_single_line_empty_anonymous_classes' => true, + ], 'class_definition' => [ 'inline_constructor_arguments' => false, // handled by method_argument_space fixer 'space_before_parenthesis' => true, // defined in PSR12 ¶8. Anonymous Classes ], - 'compact_nullable_typehint' => true, - 'curly_braces_position' => [ - 'allow_single_line_empty_anonymous_classes' => true, - ], + 'compact_nullable_type_declaration' => true, 'declare_equal_normalize' => true, 'lowercase_cast' => true, 'lowercase_static_reference' => true, - 'new_with_braces' => true, + 'new_with_parentheses' => true, 'no_blank_lines_after_class_opening' => true, + 'no_extra_blank_lines' => [ + 'tokens' => [ + 'use', // defined in PSR12 ¶3. Declare Statements, Namespace, and Import Statements + ], + ], 'no_leading_import_slash' => true, 'no_whitespace_in_blank_line' => true, 'ordered_class_elements' => [ @@ -57,10 +66,52 @@ public function getRules(): array ], 'return_type_declaration' => true, 'short_scalar_cast' => true, - 'single_blank_line_before_namespace' => true, 'single_import_per_statement' => ['group_to_single_imports' => false], + 'single_space_around_construct' => [ + 'constructs_followed_by_a_single_space' => [ + 'abstract', + 'as', + 'case', + 'catch', + 'class', + 'const_import', + 'do', + 'else', + 'elseif', + 'final', + 'finally', + 'for', + 'foreach', + 'function', + 'function_import', + 'if', + 'insteadof', + 'interface', + 'namespace', + 'new', + 'private', + 'protected', + 'public', + 'static', + 'switch', + 'trait', + 'try', + 'use', + 'use_lambda', + 'while', + ], + 'constructs_preceded_by_a_single_space' => [ + 'as', + 'else', + 'elseif', + 'use_lambda', + ], + ], 'single_trait_insert_per_statement' => true, 'ternary_operator_spaces' => true, + 'unary_operator_spaces' => [ + 'only_dec_inc' => true, + ], 'visibility_required' => true, ]; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR2Set.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR2Set.php index 1bbe1fd2..a386da47 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR2Set.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR2Set.php @@ -26,17 +26,18 @@ public function getRules(): array return [ '@PSR1' => true, 'blank_line_after_namespace' => true, + 'braces_position' => true, 'class_definition' => true, 'constant_case' => true, 'control_structure_braces' => true, 'control_structure_continuation_position' => true, - 'curly_braces_position' => true, 'elseif' => true, 'function_declaration' => true, 'indentation_type' => true, 'line_ending' => true, 'lowercase_keywords' => true, 'method_argument_space' => [ + 'attribute_placement' => 'ignore', 'on_multiline' => 'ensure_fully_multiline', ], 'no_break_comment' => true, @@ -44,7 +45,6 @@ public function getRules(): array 'no_multiple_statements_per_line' => true, 'no_space_around_double_colon' => true, 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, 'no_trailing_whitespace' => true, 'no_trailing_whitespace_in_comment' => true, 'single_blank_line_at_eof' => true, @@ -55,6 +55,41 @@ public function getRules(): array ], 'single_import_per_statement' => true, 'single_line_after_imports' => true, + 'single_space_around_construct' => [ + 'constructs_followed_by_a_single_space' => [ + 'abstract', + 'as', + 'case', + 'catch', + 'class', + 'do', + 'else', + 'elseif', + 'final', + 'for', + 'foreach', + 'function', + 'if', + 'interface', + 'namespace', + 'private', + 'protected', + 'public', + 'static', + 'switch', + 'trait', + 'try', + 'use_lambda', + 'while', + ], + 'constructs_preceded_by_a_single_space' => [ + 'as', + 'else', + 'elseif', + 'use_lambda', + ], + ], + 'spaces_inside_parentheses' => true, 'statement_indentation' => true, 'switch_case_semicolon_to_colon' => true, 'switch_case_space' => true, diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerRiskySet.php index f4402608..9048d242 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerRiskySet.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerRiskySet.php @@ -24,10 +24,12 @@ final class PhpCsFixerRiskySet extends AbstractRuleSetDescription public function getRules(): array { return [ - '@PER:risky' => true, + '@PER-CS:risky' => true, '@Symfony:risky' => true, 'comment_to_phpdoc' => true, 'final_internal_class' => true, + 'get_class_to_class_keyword' => false, + 'modernize_strpos' => false, // @TODO: consider switching to `true`, like in @Symfony 'native_constant_invocation' => [ 'fix_built_in' => false, @@ -45,17 +47,21 @@ public function getRules(): array '@all', ], ], - 'no_unreachable_default_argument_value' => true, 'no_unset_on_property' => true, + 'php_unit_data_provider_name' => true, + 'php_unit_data_provider_return_type' => true, + 'php_unit_data_provider_static' => ['force' => true], 'php_unit_strict' => true, - 'php_unit_test_case_static_method_calls' => true, + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'static_lambda' => true, 'strict_comparison' => true, 'strict_param' => true, + 'yield_from_array_to_yields' => true, ]; } public function getDescription(): string { - return 'Rule set as used by the PHP-CS-Fixer docker team, highly opinionated.'; + return 'Rule set as used by the PHP-CS-Fixer development team, highly opinionated.'; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerSet.php index f858ebb5..4e62c98a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerSet.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerSet.php @@ -24,10 +24,8 @@ final class PhpCsFixerSet extends AbstractRuleSetDescription public function getRules(): array { return [ - '@PER' => true, + '@PER-CS' => true, '@Symfony' => true, - 'align_multiline_comment' => true, - 'array_indentation' => true, 'blank_line_before_statement' => [ 'statements' => [ 'break', @@ -53,9 +51,11 @@ public function getRules(): array 'combine_consecutive_issets' => true, 'combine_consecutive_unsets' => true, 'empty_loop_body' => true, - 'escape_implicit_backslashes' => true, 'explicit_indirect_variable' => true, 'explicit_string_variable' => true, + 'fully_qualified_strict_types' => [ + 'import_symbols' => true, + ], 'heredoc_to_nowdoc' => true, 'method_argument_space' => [ 'on_multiline' => 'ensure_fully_multiline', @@ -82,8 +82,11 @@ public function getRules(): array 'use', ], ], - 'no_null_property_initialization' => true, 'no_superfluous_elseif' => true, + 'no_superfluous_phpdoc_tags' => [ + 'allow_mixed' => true, + 'remove_inheritdoc' => true, + ], 'no_unneeded_control_parentheses' => [ 'statements' => [ 'break', @@ -100,10 +103,9 @@ public function getRules(): array ], 'no_useless_else' => true, 'no_useless_return' => true, - 'operator_linebreak' => [ - 'only_booleans' => true, - ], + 'no_whitespace_before_comma_in_array' => ['after_heredoc' => true], 'ordered_class_elements' => true, + 'ordered_types' => true, 'php_unit_internal_class' => true, 'php_unit_test_class_requires_covers' => true, 'phpdoc_add_missing_param_annotation' => true, @@ -111,15 +113,20 @@ public function getRules(): array 'phpdoc_order_by_value' => true, 'phpdoc_types_order' => true, 'phpdoc_var_annotation_correct_order' => true, + 'protected_to_private' => true, 'return_assignment' => true, + 'self_static_accessor' => true, 'single_line_comment_style' => true, + 'single_line_empty_body' => true, 'single_line_throw' => false, + 'string_implicit_backslashes' => true, + 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays']], 'whitespace_after_comma_in_array' => ['ensure_single_space' => true], ]; } public function getDescription(): string { - return 'Rule set as used by the PHP-CS-Fixer docker team, highly opinionated.'; + return 'Rule set as used by the PHP-CS-Fixer development team, highly opinionated.'; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonyRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonyRiskySet.php index e07ae342..f60d9cac 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonyRiskySet.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonyRiskySet.php @@ -36,11 +36,14 @@ public function getRules(): array 'b_mode' => false, ], 'function_to_constant' => true, + 'get_class_to_class_keyword' => true, 'implode_call' => true, 'is_null' => true, 'logical_operators' => true, + 'long_to_shorthand_operator' => true, + 'modernize_strpos' => true, 'modernize_types_casting' => true, - 'native_constant_invocation' => true, + 'native_constant_invocation' => ['strict' => false], 'native_function_invocation' => [ 'include' => [ '@compiler_optimized', @@ -52,7 +55,6 @@ public function getRules(): array 'no_homoglyph_names' => true, 'no_php4_constructor' => true, 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => false, 'no_useless_sprintf' => true, 'non_printable_character' => true, 'ordered_traits' => true, diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonySet.php index dac1aedf..28af540d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonySet.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonySet.php @@ -14,6 +14,7 @@ namespace PhpCsFixer\RuleSet\Sets; +use PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer; use PhpCsFixer\RuleSet\AbstractRuleSetDescription; /** @@ -24,8 +25,8 @@ final class SymfonySet extends AbstractRuleSetDescription public function getRules(): array { return [ - '@PSR12' => true, - 'array_syntax' => true, + '@PER-CS2.0' => true, + 'align_multiline_comment' => true, 'backtick_to_shell_exec' => true, 'binary_operator_spaces' => true, 'blank_line_before_statement' => [ @@ -33,7 +34,10 @@ public function getRules(): array 'return', ], ], - 'cast_spaces' => true, + 'braces_position' => [ + 'allow_single_line_anonymous_functions' => true, + 'allow_single_line_empty_anonymous_classes' => true, + ], 'class_attributes_separation' => [ 'elements' => [ 'method' => 'one', @@ -44,17 +48,13 @@ public function getRules(): array ], 'class_reference_name_casing' => true, 'clean_namespace' => true, - 'concat_space' => true, - 'curly_braces_position' => [ - 'allow_single_line_anonymous_functions' => true, - 'allow_single_line_empty_anonymous_classes' => true, - ], + 'concat_space' => true, // overrides @PER-CS2.0 'declare_parentheses' => true, 'echo_tag_syntax' => true, 'empty_loop_body' => ['style' => 'braces'], 'empty_loop_condition' => true, 'fully_qualified_strict_types' => true, - 'function_typehint_space' => true, + 'function_declaration' => true, // overrides @PER-CS2.0 'general_phpdoc_tag_rename' => [ 'replacements' => [ 'inheritDocs' => 'inheritDoc', @@ -72,11 +72,11 @@ public function getRules(): array 'linebreak_after_opening_tag' => true, 'magic_constant_casing' => true, 'magic_method_casing' => true, - 'method_argument_space' => [ + 'method_argument_space' => [ // overrides @PER-CS2.0 'on_multiline' => 'ignore', ], 'native_function_casing' => true, - 'native_function_type_declaration_casing' => true, + 'native_type_declaration_casing' => true, 'no_alias_language_construct_call' => true, 'no_alternative_syntax' => true, 'no_binary_string' => true, @@ -102,14 +102,18 @@ public function getRules(): array 'no_leading_namespace_whitespace' => true, 'no_mixed_echo_print' => true, 'no_multiline_whitespace_around_double_arrow' => true, + 'no_null_property_initialization' => true, 'no_short_bool_cast' => true, 'no_singleline_whitespace_before_semicolons' => true, 'no_spaces_around_offset' => true, 'no_superfluous_phpdoc_tags' => [ - 'allow_mixed' => true, - 'allow_unused_params' => true, + 'allow_hidden_params' => true, + 'remove_inheritdoc' => true, ], 'no_trailing_comma_in_singleline' => true, + 'no_unneeded_braces' => [ + 'namespaces' => true, + ], 'no_unneeded_control_parentheses' => [ 'statements' => [ 'break', @@ -123,9 +127,6 @@ public function getRules(): array 'yield_from', ], ], - 'no_unneeded_curly_braces' => [ - 'namespaces' => true, - ], 'no_unneeded_import_alias' => true, 'no_unset_cast' => true, 'no_unused_imports' => true, @@ -133,7 +134,12 @@ public function getRules(): array 'no_useless_nullsafe_operator' => true, 'no_whitespace_before_comma_in_array' => true, 'normalize_index_brace' => true, + 'nullable_type_declaration' => true, + 'nullable_type_declaration_for_default_null_value' => true, 'object_operator_without_whitespace' => true, + 'operator_linebreak' => [ + 'only_booleans' => true, + ], 'ordered_imports' => [ 'imports_order' => [ 'class', @@ -142,6 +148,10 @@ public function getRules(): array ], 'sort_algorithm' => 'alpha', ], + 'ordered_types' => [ + 'null_adjustment' => 'always_last', + 'sort_algorithm' => 'none', + ], 'php_unit_fqcn_annotation' => true, 'php_unit_method_casing' => true, 'phpdoc_align' => true, @@ -161,7 +171,12 @@ public function getRules(): array ], 'phpdoc_return_self_reference' => true, 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, + 'phpdoc_separation' => [ + 'groups' => [ + ['Annotation', 'NamedArgumentConstructor', 'Target'], + ...PhpdocSeparationFixer::OPTION_GROUPS_DEFAULT, + ], + ], 'phpdoc_single_line_var_spacing' => true, 'phpdoc_summary' => true, 'phpdoc_tag_type' => [ @@ -178,7 +193,6 @@ public function getRules(): array 'sort_algorithm' => 'none', ], 'phpdoc_var_without_name' => true, - 'protected_to_private' => true, 'semicolon_after_instruction' => true, 'simple_to_complex_string_variable' => true, 'single_class_element_per_statement' => true, @@ -189,6 +203,7 @@ public function getRules(): array 'hash', ], ], + 'single_line_empty_body' => false, // overrides @PER-CS2.0 'single_line_throw' => true, 'single_quote' => true, 'single_space_around_construct' => true, @@ -197,9 +212,21 @@ public function getRules(): array ], 'standardize_increment' => true, 'standardize_not_equals' => true, + 'statement_indentation' => [ + 'stick_comment_to_next_continuous_control_statement' => true, + ], 'switch_continue_to_break' => true, - 'trailing_comma_in_multiline' => true, + 'trailing_comma_in_multiline' => [ + 'after_heredoc' => true, + 'elements' => [ // explicitly omit 'arguments' + 'array_destructuring', + 'arrays', + 'match', + 'parameters', + ], + ], 'trim_array_spaces' => true, + 'type_declaration_spaces' => true, 'types_spaces' => true, 'unary_operator_spaces' => true, 'whitespace_after_comma_in_array' => true, diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/AnalysisStarted.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/AnalysisStarted.php new file mode 100644 index 00000000..75c9ff7b --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/AnalysisStarted.php @@ -0,0 +1,54 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner\Event; + +use Symfony\Contracts\EventDispatcher\Event; + +/** + * Event that is fired when Fixer starts analysis. + * + * @author Greg Korba + * + * @internal + */ +final class AnalysisStarted extends Event +{ + public const NAME = 'fixer.analysis_started'; + public const MODE_SEQUENTIAL = 'sequential'; + public const MODE_PARALLEL = 'parallel'; + + /** @var self::MODE_* */ + private string $mode; + private bool $dryRun; + + /** + * @param self::MODE_* $mode + */ + public function __construct(string $mode, bool $dryRun) + { + $this->mode = $mode; + $this->dryRun = $dryRun; + } + + public function getMode(): string + { + return $this->mode; + } + + public function isDryRun(): bool + { + return $this->dryRun; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerFileProcessedEvent.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/FileProcessed.php similarity index 58% rename from tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerFileProcessedEvent.php rename to tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/FileProcessed.php index b609da49..b9d4bcda 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerFileProcessedEvent.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/FileProcessed.php @@ -12,7 +12,7 @@ * with this source code in the file LICENSE. */ -namespace PhpCsFixer; +namespace PhpCsFixer\Runner\Event; use Symfony\Contracts\EventDispatcher\Event; @@ -23,7 +23,7 @@ * * @internal */ -final class FixerFileProcessedEvent extends Event +final class FileProcessed extends Event { /** * Event name. @@ -37,15 +37,39 @@ final class FixerFileProcessedEvent extends Event public const STATUS_EXCEPTION = 5; public const STATUS_LINT = 6; + /** + * @var self::STATUS_* + */ private int $status; - public function __construct(int $status) + private ?string $fileRelativePath; + private ?string $fileHash; + + /** + * @param self::STATUS_* $status + */ + public function __construct(int $status, ?string $fileRelativePath = null, ?string $fileHash = null) { $this->status = $status; + $this->fileRelativePath = $fileRelativePath; + $this->fileHash = $fileHash; } + /** + * @return self::STATUS_* + */ public function getStatus(): int { return $this->status; } + + public function getFileRelativePath(): ?string + { + return $this->fileRelativePath; + } + + public function getFileHash(): ?string + { + return $this->fileHash; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileCachingLintingIterator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileCachingLintingFileIterator.php similarity index 84% rename from tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileCachingLintingIterator.php rename to tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileCachingLintingFileIterator.php index c07dbbd2..c46cf3d3 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileCachingLintingIterator.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileCachingLintingFileIterator.php @@ -24,19 +24,11 @@ * * @extends \CachingIterator> */ -final class FileCachingLintingIterator extends \CachingIterator +final class FileCachingLintingFileIterator extends \CachingIterator implements LintingResultAwareFileIteratorInterface { private LinterInterface $linter; - - /** - * @var LintingResultInterface - */ - private $currentResult; - - /** - * @var LintingResultInterface - */ - private $nextResult; + private ?LintingResultInterface $currentResult = null; + private ?LintingResultInterface $nextResult = null; /** * @param \Iterator $iterator @@ -48,7 +40,7 @@ public function __construct(\Iterator $iterator, LinterInterface $linter) $this->linter = $linter; } - public function currentLintingResult(): LintingResultInterface + public function currentLintingResult(): ?LintingResultInterface { return $this->currentResult; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileFilterIterator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileFilterIterator.php index c0f736fd..8a597218 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileFilterIterator.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileFilterIterator.php @@ -16,7 +16,7 @@ use PhpCsFixer\Cache\CacheManagerInterface; use PhpCsFixer\FileReader; -use PhpCsFixer\FixerFileProcessedEvent; +use PhpCsFixer\Runner\Event\FileProcessed; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Contracts\EventDispatcher\Event; @@ -61,7 +61,7 @@ public function accept(): bool $file = $this->current(); if (!$file instanceof \SplFileInfo) { throw new \RuntimeException( - sprintf( + \sprintf( 'Expected instance of "\SplFileInfo", got "%s".', get_debug_type($file) ) @@ -89,10 +89,7 @@ public function accept(): bool // file that does not need fixing due to cache || !$this->cacheManager->needFixing($file->getPathname(), $content) ) { - $this->dispatchEvent( - FixerFileProcessedEvent::NAME, - new FixerFileProcessedEvent(FixerFileProcessedEvent::STATUS_SKIPPED) - ); + $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_SKIPPED)); return false; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileLintingIterator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingFileIterator.php similarity index 89% rename from tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileLintingIterator.php rename to tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingFileIterator.php index 09f5913e..19bd6771 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileLintingIterator.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingFileIterator.php @@ -24,12 +24,9 @@ * * @extends \IteratorIterator> */ -final class FileLintingIterator extends \IteratorIterator +final class LintingFileIterator extends \IteratorIterator implements LintingResultAwareFileIteratorInterface { - /** - * @var LintingResultInterface - */ - private $currentResult; + private ?LintingResultInterface $currentResult = null; private LinterInterface $linter; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingResultAwareFileIteratorInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingResultAwareFileIteratorInterface.php new file mode 100644 index 00000000..1c05bf29 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingResultAwareFileIteratorInterface.php @@ -0,0 +1,29 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner; + +use PhpCsFixer\Linter\LintingResultInterface; + +/** + * @author Greg Korba + * + * @internal + * + * @extends \Iterator + */ +interface LintingResultAwareFileIteratorInterface extends \Iterator +{ + public function currentLintingResult(): ?LintingResultInterface; +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelAction.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelAction.php new file mode 100644 index 00000000..42585ee2 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelAction.php @@ -0,0 +1,35 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner\Parallel; + +/** + * @author Greg Korba + * + * @internal + */ +final class ParallelAction +{ + // Actions executed by the runner (main process) + public const RUNNER_REQUEST_ANALYSIS = 'requestAnalysis'; + public const RUNNER_THANK_YOU = 'thankYou'; + + // Actions executed by the worker + public const WORKER_ERROR_REPORT = 'errorReport'; + public const WORKER_GET_FILE_CHUNK = 'getFileChunk'; + public const WORKER_HELLO = 'hello'; + public const WORKER_RESULT = 'result'; + + private function __construct() {} +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfig.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfig.php new file mode 100644 index 00000000..b4886c6b --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfig.php @@ -0,0 +1,67 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner\Parallel; + +/** + * @author Greg Korba + * + * @readonly + */ +final class ParallelConfig +{ + /** @internal */ + public const DEFAULT_FILES_PER_PROCESS = 10; + + /** @internal */ + public const DEFAULT_PROCESS_TIMEOUT = 120; + + private int $filesPerProcess; + private int $maxProcesses; + private int $processTimeout; + + /** + * @param positive-int $maxProcesses + * @param positive-int $filesPerProcess + * @param positive-int $processTimeout + */ + public function __construct( + int $maxProcesses = 2, + int $filesPerProcess = self::DEFAULT_FILES_PER_PROCESS, + int $processTimeout = self::DEFAULT_PROCESS_TIMEOUT + ) { + if ($maxProcesses <= 0 || $filesPerProcess <= 0 || $processTimeout <= 0) { + throw new \InvalidArgumentException('Invalid parallelisation configuration: only positive integers are allowed'); + } + + $this->maxProcesses = $maxProcesses; + $this->filesPerProcess = $filesPerProcess; + $this->processTimeout = $processTimeout; + } + + public function getFilesPerProcess(): int + { + return $this->filesPerProcess; + } + + public function getMaxProcesses(): int + { + return $this->maxProcesses; + } + + public function getProcessTimeout(): int + { + return $this->processTimeout; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfigFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfigFactory.php new file mode 100644 index 00000000..5d306d45 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfigFactory.php @@ -0,0 +1,61 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner\Parallel; + +use Fidry\CpuCoreCounter\CpuCoreCounter; +use Fidry\CpuCoreCounter\Finder\DummyCpuCoreFinder; +use Fidry\CpuCoreCounter\Finder\FinderRegistry; + +/** + * @author Dariusz Rumiński + */ +final class ParallelConfigFactory +{ + private static ?CpuCoreCounter $cpuDetector = null; + + private function __construct() {} + + public static function sequential(): ParallelConfig + { + return new ParallelConfig(1); + } + + /** + * @param null|positive-int $filesPerProcess + * @param null|positive-int $processTimeout + * @param null|positive-int $maxProcesses + */ + public static function detect( + ?int $filesPerProcess = null, + ?int $processTimeout = null, + ?int $maxProcesses = null + ): ParallelConfig { + if (null === self::$cpuDetector) { + self::$cpuDetector = new CpuCoreCounter([ + ...FinderRegistry::getDefaultLogicalFinders(), + new DummyCpuCoreFinder(1), + ]); + } + + // Reserve 1 core for the main orchestrating process + $available = self::$cpuDetector->getAvailableForParallelisation(1, $maxProcesses); + + return new ParallelConfig( + $available->availableCpus, + $filesPerProcess ?? ParallelConfig::DEFAULT_FILES_PER_PROCESS, + $processTimeout ?? ParallelConfig::DEFAULT_PROCESS_TIMEOUT + ); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelisationException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelisationException.php new file mode 100644 index 00000000..8c24e6a4 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelisationException.php @@ -0,0 +1,30 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner\Parallel; + +/** + * Common exception for all the errors related to parallelisation. + * + * @author Greg Korba + * + * @internal + */ +final class ParallelisationException extends \RuntimeException +{ + public static function forUnknownIdentifier(ProcessIdentifier $identifier): self + { + return new self('Unknown process identifier: '.$identifier->toString()); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/Process.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/Process.php new file mode 100644 index 00000000..0d5ce588 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/Process.php @@ -0,0 +1,189 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner\Parallel; + +use React\ChildProcess\Process as ReactProcess; +use React\EventLoop\LoopInterface; +use React\EventLoop\TimerInterface; +use React\Stream\ReadableStreamInterface; +use React\Stream\WritableStreamInterface; + +/** + * Represents single process that is handled within parallel run. + * Inspired by: + * - https://github.com/phpstan/phpstan-src/blob/9ce425bca5337039fb52c0acf96a20a2b8ace490/src/Parallel/Process.php + * - https://github.com/phpstan/phpstan-src/blob/1477e752b4b5893f323b6d2c43591e68b3d85003/src/Process/ProcessHelper.php. + * + * @author Greg Korba + * + * @internal + */ +final class Process +{ + // Properties required for process instantiation + private string $command; + private LoopInterface $loop; + private int $timeoutSeconds; + + // Properties required for process execution + private ?ReactProcess $process = null; + private ?WritableStreamInterface $in = null; + + /** @var resource */ + private $stdErr; + + /** @var resource */ + private $stdOut; + + /** @var callable(array): void */ + private $onData; + + /** @var callable(\Throwable): void */ + private $onError; + + private ?TimerInterface $timer = null; + + public function __construct(string $command, LoopInterface $loop, int $timeoutSeconds) + { + $this->command = $command; + $this->loop = $loop; + $this->timeoutSeconds = $timeoutSeconds; + } + + /** + * @param callable(array $json): void $onData callback to be called when data is received from the parallelisation operator + * @param callable(\Throwable $exception): void $onError callback to be called when an exception occurs + * @param callable(?int $exitCode, string $output): void $onExit callback to be called when the process exits + */ + public function start(callable $onData, callable $onError, callable $onExit): void + { + $stdOut = tmpfile(); + if (false === $stdOut) { + throw new ParallelisationException('Failed creating temp file for stdOut.'); + } + $this->stdOut = $stdOut; + + $stdErr = tmpfile(); + if (false === $stdErr) { + throw new ParallelisationException('Failed creating temp file for stdErr.'); + } + $this->stdErr = $stdErr; + + $this->onData = $onData; + $this->onError = $onError; + + $this->process = new ReactProcess($this->command, null, null, [ + 1 => $this->stdOut, + 2 => $this->stdErr, + ]); + $this->process->start($this->loop); + $this->process->on('exit', function ($exitCode) use ($onExit): void { + $this->cancelTimer(); + + $output = ''; + rewind($this->stdOut); + $stdOut = stream_get_contents($this->stdOut); + if (\is_string($stdOut)) { + $output .= $stdOut; + } + + rewind($this->stdErr); + $stdErr = stream_get_contents($this->stdErr); + if (\is_string($stdErr)) { + $output .= $stdErr; + } + + $onExit($exitCode, $output); + + fclose($this->stdOut); + fclose($this->stdErr); + }); + } + + /** + * Handles requests from parallelisation operator to its worker (spawned process). + * + * @param array $data + */ + public function request(array $data): void + { + $this->cancelTimer(); // Configured process timeout actually means "chunk timeout" (each request resets timer) + + if (null === $this->in) { + throw new ParallelisationException( + 'Process not connected with parallelisation operator, ensure `bindConnection()` was called' + ); + } + + $this->in->write($data); + $this->timer = $this->loop->addTimer($this->timeoutSeconds, function (): void { + ($this->onError)( + new \Exception( + \sprintf( + 'Child process timed out after %d seconds. Try making it longer using `ParallelConfig`.', + $this->timeoutSeconds + ) + ) + ); + }); + } + + public function quit(): void + { + $this->cancelTimer(); + if (null === $this->process || !$this->process->isRunning()) { + return; + } + + foreach ($this->process->pipes as $pipe) { + $pipe->close(); + } + + if (null === $this->in) { + return; + } + + $this->in->end(); + } + + public function bindConnection(ReadableStreamInterface $out, WritableStreamInterface $in): void + { + $this->in = $in; + + $in->on('error', function (\Throwable $error): void { + ($this->onError)($error); + }); + + $out->on('data', function (array $json): void { + $this->cancelTimer(); + + // Pass everything to the parallelisation operator, it should decide how to handle the data + ($this->onData)($json); + }); + $out->on('error', function (\Throwable $error): void { + ($this->onError)($error); + }); + } + + private function cancelTimer(): void + { + if (null === $this->timer) { + return; + } + + $this->loop->cancelTimer($this->timer); + $this->timer = null; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessFactory.php new file mode 100644 index 00000000..5649e251 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessFactory.php @@ -0,0 +1,111 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner\Parallel; + +use PhpCsFixer\Runner\RunnerConfig; +use React\EventLoop\LoopInterface; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Process\PhpExecutableFinder; + +/** + * @author Greg Korba + * + * @readonly + * + * @internal + */ +final class ProcessFactory +{ + private InputInterface $input; + + public function __construct(InputInterface $input) + { + $this->input = $input; + } + + public function create( + LoopInterface $loop, + RunnerConfig $runnerConfig, + ProcessIdentifier $identifier, + int $serverPort + ): Process { + $commandArgs = $this->getCommandArgs($serverPort, $identifier, $runnerConfig); + + return new Process( + implode(' ', $commandArgs), + $loop, + $runnerConfig->getParallelConfig()->getProcessTimeout() + ); + } + + /** + * @private + * + * @return list + */ + public function getCommandArgs(int $serverPort, ProcessIdentifier $identifier, RunnerConfig $runnerConfig): array + { + $phpBinary = (new PhpExecutableFinder())->find(false); + + if (false === $phpBinary) { + throw new ParallelisationException('Cannot find PHP executable.'); + } + + $mainScript = realpath(__DIR__.'/../../../php-cs-fixer'); + if (false === $mainScript + && isset($_SERVER['argv'][0]) + && str_contains($_SERVER['argv'][0], 'php-cs-fixer') + ) { + $mainScript = $_SERVER['argv'][0]; + } + + if (!is_file($mainScript)) { + throw new ParallelisationException('Cannot determine Fixer executable.'); + } + + $commandArgs = [ + escapeshellarg($phpBinary), + escapeshellarg($mainScript), + 'worker', + '--port', + (string) $serverPort, + '--identifier', + escapeshellarg($identifier->toString()), + ]; + + if ($runnerConfig->isDryRun()) { + $commandArgs[] = '--dry-run'; + } + + if (filter_var($this->input->getOption('diff'), FILTER_VALIDATE_BOOLEAN)) { + $commandArgs[] = '--diff'; + } + + if (filter_var($this->input->getOption('stop-on-violation'), FILTER_VALIDATE_BOOLEAN)) { + $commandArgs[] = '--stop-on-violation'; + } + + foreach (['allow-risky', 'config', 'rules', 'using-cache', 'cache-file'] as $option) { + $optionValue = $this->input->getOption($option); + + if (null !== $optionValue) { + $commandArgs[] = "--{$option}"; + $commandArgs[] = escapeshellarg($optionValue); + } + } + + return $commandArgs; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessIdentifier.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessIdentifier.php new file mode 100644 index 00000000..20df38d8 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessIdentifier.php @@ -0,0 +1,55 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner\Parallel; + +/** + * Represents identifier of single process that is handled within parallel run. + * + * @author Greg Korba + * + * @readonly + * + * @internal + */ +final class ProcessIdentifier +{ + private const IDENTIFIER_PREFIX = 'php-cs-fixer_parallel_'; + + private string $identifier; + + private function __construct(string $identifier) + { + $this->identifier = $identifier; + } + + public function toString(): string + { + return $this->identifier; + } + + public static function create(): self + { + return new self(uniqid(self::IDENTIFIER_PREFIX, true)); + } + + public static function fromRaw(string $identifier): self + { + if (!str_starts_with($identifier, self::IDENTIFIER_PREFIX)) { + throw new ParallelisationException(\sprintf('Invalid process identifier "%s".', $identifier)); + } + + return new self($identifier); + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessPool.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessPool.php new file mode 100644 index 00000000..215023f2 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessPool.php @@ -0,0 +1,99 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner\Parallel; + +use React\Socket\ServerInterface; + +/** + * Represents collection of active processes that are being run in parallel. + * Inspired by {@see https://github.com/phpstan/phpstan-src/blob/ed68345a82992775112acc2c2bd639d1bd3a1a02/src/Parallel/ProcessPool.php}. + * + * @author Greg Korba + * + * @internal + */ +final class ProcessPool +{ + /** + * @readonly + */ + private ServerInterface $server; + + /** + * @var null|(callable(): void) + * + * @readonly + */ + private $onServerClose; + + /** + * @var array + */ + private array $processes = []; + + /** + * @param null|(callable(): void) $onServerClose + */ + public function __construct(ServerInterface $server, ?callable $onServerClose = null) + { + $this->server = $server; + $this->onServerClose = $onServerClose; + } + + public function getProcess(ProcessIdentifier $identifier): Process + { + if (!isset($this->processes[$identifier->toString()])) { + throw ParallelisationException::forUnknownIdentifier($identifier); + } + + return $this->processes[$identifier->toString()]; + } + + public function addProcess(ProcessIdentifier $identifier, Process $process): void + { + $this->processes[$identifier->toString()] = $process; + } + + public function endProcessIfKnown(ProcessIdentifier $identifier): void + { + if (!isset($this->processes[$identifier->toString()])) { + return; + } + + $this->endProcess($identifier); + } + + public function endAll(): void + { + foreach (array_keys($this->processes) as $identifier) { + $this->endProcessIfKnown(ProcessIdentifier::fromRaw($identifier)); + } + } + + private function endProcess(ProcessIdentifier $identifier): void + { + $this->getProcess($identifier)->quit(); + + unset($this->processes[$identifier->toString()]); + + if (0 === \count($this->processes)) { + $this->server->close(); + + if (null !== $this->onServerClose) { + ($this->onServerClose)(); + } + } + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/WorkerException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/WorkerException.php new file mode 100644 index 00000000..714306d3 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/WorkerException.php @@ -0,0 +1,66 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner\Parallel; + +use Throwable; + +/** + * @author Greg Korba + * + * @internal + */ +final class WorkerException extends \RuntimeException +{ + private string $originalTraceAsString; + + private function __construct(string $message, int $code) + { + parent::__construct($message, $code); + } + + /** + * @param array{ + * class: class-string, + * message: string, + * file: string, + * line: int, + * code: int, + * trace: string + * } $data + */ + public static function fromRaw(array $data): self + { + $exception = new self( + \sprintf('[%s] %s', $data['class'], $data['message']), + $data['code'] + ); + $exception->file = $data['file']; + $exception->line = $data['line']; + $exception->originalTraceAsString = \sprintf( + '## %s(%d)%s%s', + $data['file'], + $data['line'], + PHP_EOL, + $data['trace'] + ); + + return $exception; + } + + public function getOriginalTraceAsString(): string + { + return $this->originalTraceAsString; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php index b8133c94..9b022572 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php @@ -14,32 +14,60 @@ namespace PhpCsFixer\Runner; +use Clue\React\NDJson\Decoder; +use Clue\React\NDJson\Encoder; use PhpCsFixer\AbstractFixer; use PhpCsFixer\Cache\CacheManagerInterface; use PhpCsFixer\Cache\Directory; use PhpCsFixer\Cache\DirectoryInterface; +use PhpCsFixer\Console\Command\WorkerCommand; use PhpCsFixer\Differ\DifferInterface; use PhpCsFixer\Error\Error; use PhpCsFixer\Error\ErrorsManager; +use PhpCsFixer\Error\SourceExceptionFactory; use PhpCsFixer\FileReader; use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\FixerFileProcessedEvent; use PhpCsFixer\Linter\LinterInterface; use PhpCsFixer\Linter\LintingException; use PhpCsFixer\Linter\LintingResultInterface; +use PhpCsFixer\Preg; +use PhpCsFixer\Runner\Event\AnalysisStarted; +use PhpCsFixer\Runner\Event\FileProcessed; +use PhpCsFixer\Runner\Parallel\ParallelAction; +use PhpCsFixer\Runner\Parallel\ParallelConfig; +use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; +use PhpCsFixer\Runner\Parallel\ParallelisationException; +use PhpCsFixer\Runner\Parallel\ProcessFactory; +use PhpCsFixer\Runner\Parallel\ProcessIdentifier; +use PhpCsFixer\Runner\Parallel\ProcessPool; +use PhpCsFixer\Runner\Parallel\WorkerException; use PhpCsFixer\Tokenizer\Tokens; +use React\EventLoop\StreamSelectLoop; +use React\Socket\ConnectionInterface; +use React\Socket\TcpServer; +use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Contracts\EventDispatcher\Event; /** * @author Dariusz Rumiński + * @author Greg Korba + * + * @phpstan-type _RunResult array, diff: string}> */ final class Runner { + /** + * Buffer size used in the NDJSON decoder for communication between main process and workers. + * + * @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8068 + */ + private const PARALLEL_BUFFER_SIZE = 16 * (1_024 * 1_024 /* 1MB */); + private DifferInterface $differ; - private ?DirectoryInterface $directory; + private DirectoryInterface $directory; private ?EventDispatcherInterface $eventDispatcher; @@ -52,9 +80,11 @@ final class Runner private LinterInterface $linter; /** - * @var \Traversable<\SplFileInfo> + * @var null|\Traversable */ - private $finder; + private ?\Traversable $fileIterator = null; + + private int $fileCount; /** * @var list @@ -63,12 +93,18 @@ final class Runner private bool $stopOnViolation; + private ParallelConfig $parallelConfig; + + private ?InputInterface $input; + + private ?string $configFile; + /** - * @param \Traversable<\SplFileInfo> $finder - * @param list $fixers + * @param null|\Traversable $fileIterator + * @param list $fixers */ public function __construct( - \Traversable $finder, + ?\Traversable $fileIterator, array $fixers, DifferInterface $differ, ?EventDispatcherInterface $eventDispatcher, @@ -77,9 +113,16 @@ public function __construct( bool $isDryRun, CacheManagerInterface $cacheManager, ?DirectoryInterface $directory = null, - bool $stopOnViolation = false + bool $stopOnViolation = false, + // @TODO Make these arguments required in 4.0 + ?ParallelConfig $parallelConfig = null, + ?InputInterface $input = null, + ?string $configFile = null ) { - $this->finder = $finder; + // Required only for main process (calculating workers count) + $this->fileCount = null !== $fileIterator ? \count(iterator_to_array($fileIterator)) : 0; + + $this->fileIterator = $fileIterator; $this->fixers = $fixers; $this->differ = $differ; $this->eventDispatcher = $eventDispatcher; @@ -87,28 +130,259 @@ public function __construct( $this->linter = $linter; $this->isDryRun = $isDryRun; $this->cacheManager = $cacheManager; - $this->directory = $directory ?: new Directory(''); + $this->directory = $directory ?? new Directory(''); $this->stopOnViolation = $stopOnViolation; + $this->parallelConfig = $parallelConfig ?? ParallelConfigFactory::sequential(); + $this->input = $input; + $this->configFile = $configFile; } /** - * @return array, diff: string}> + * @TODO consider to drop this method and make iterator parameter obligatory in constructor, + * more in https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777/files#r1590447581 + * + * @param \Traversable $fileIterator + */ + public function setFileIterator(iterable $fileIterator): void + { + $this->fileIterator = $fileIterator; + + // Required only for main process (calculating workers count) + $this->fileCount = \count(iterator_to_array($fileIterator)); + } + + /** + * @return _RunResult */ public function fix(): array { + if (0 === $this->fileCount) { + return []; + } + + // @TODO 4.0: Remove condition and its body, as no longer needed when param will be required in the constructor. + // This is a fallback only in case someone calls `new Runner()` in a custom repo and does not provide v4-ready params in v3-codebase. + if (null === $this->input) { + return $this->fixSequential(); + } + + if ( + 1 === $this->parallelConfig->getMaxProcesses() + || $this->fileCount <= $this->parallelConfig->getFilesPerProcess() + ) { + return $this->fixSequential(); + } + + return $this->fixParallel(); + } + + /** + * Heavily inspired by {@see https://github.com/phpstan/phpstan-src/blob/9ce425bca5337039fb52c0acf96a20a2b8ace490/src/Parallel/ParallelAnalyser.php}. + * + * @return _RunResult + */ + private function fixParallel(): array + { + $this->dispatchEvent(AnalysisStarted::NAME, new AnalysisStarted(AnalysisStarted::MODE_PARALLEL, $this->isDryRun)); + $changed = []; + $streamSelectLoop = new StreamSelectLoop(); + $server = new TcpServer('127.0.0.1:0', $streamSelectLoop); + $serverPort = parse_url($server->getAddress() ?? '', PHP_URL_PORT); + + if (!is_numeric($serverPort)) { + throw new ParallelisationException(\sprintf( + 'Unable to parse server port from "%s"', + $server->getAddress() ?? '' + )); + } - $finder = $this->finder; - $finderIterator = $finder instanceof \IteratorAggregate ? $finder->getIterator() : $finder; - $fileFilteredFileIterator = new FileFilterIterator( - $finderIterator, - $this->eventDispatcher, - $this->cacheManager + $processPool = new ProcessPool($server); + $maxFilesPerProcess = $this->parallelConfig->getFilesPerProcess(); + $fileIterator = $this->getFilteringFileIterator(); + $fileIterator->rewind(); + + $getFileChunk = static function () use ($fileIterator, $maxFilesPerProcess): array { + $files = []; + + while (\count($files) < $maxFilesPerProcess) { + $current = $fileIterator->current(); + + if (null === $current) { + break; + } + + $files[] = $current->getRealPath(); + + $fileIterator->next(); + } + + return $files; + }; + + // [REACT] Handle worker's handshake (init connection) + $server->on('connection', static function (ConnectionInterface $connection) use ($processPool, $getFileChunk): void { + $jsonInvalidUtf8Ignore = \defined('JSON_INVALID_UTF8_IGNORE') ? JSON_INVALID_UTF8_IGNORE : 0; + $decoder = new Decoder( + $connection, + true, + 512, + $jsonInvalidUtf8Ignore, + self::PARALLEL_BUFFER_SIZE + ); + $encoder = new Encoder($connection, $jsonInvalidUtf8Ignore); + + // [REACT] Bind connection when worker's process requests "hello" action (enables 2-way communication) + $decoder->on('data', static function (array $data) use ($processPool, $getFileChunk, $decoder, $encoder): void { + if (ParallelAction::WORKER_HELLO !== $data['action']) { + return; + } + + $identifier = ProcessIdentifier::fromRaw($data['identifier']); + $process = $processPool->getProcess($identifier); + $process->bindConnection($decoder, $encoder); + $fileChunk = $getFileChunk(); + + if (0 === \count($fileChunk)) { + $process->request(['action' => ParallelAction::RUNNER_THANK_YOU]); + $processPool->endProcessIfKnown($identifier); + + return; + } + + $process->request(['action' => ParallelAction::RUNNER_REQUEST_ANALYSIS, 'files' => $fileChunk]); + }); + }); + + $processesToSpawn = min( + $this->parallelConfig->getMaxProcesses(), + max( + 1, + (int) ceil($this->fileCount / $this->parallelConfig->getFilesPerProcess()), + ) ); + $processFactory = new ProcessFactory($this->input); + + for ($i = 0; $i < $processesToSpawn; ++$i) { + $identifier = ProcessIdentifier::create(); + $process = $processFactory->create( + $streamSelectLoop, + new RunnerConfig( + $this->isDryRun, + $this->stopOnViolation, + $this->parallelConfig, + $this->configFile + ), + $identifier, + $serverPort, + ); + $processPool->addProcess($identifier, $process); + $process->start( + // [REACT] Handle workers' responses (multiple actions possible) + function (array $workerResponse) use ($processPool, $process, $identifier, $getFileChunk, &$changed): void { + // File analysis result (we want close-to-realtime progress with frequent cache savings) + if (ParallelAction::WORKER_RESULT === $workerResponse['action']) { + $fileAbsolutePath = $workerResponse['file']; + $fileRelativePath = $this->directory->getRelativePathTo($fileAbsolutePath); + + // Dispatch an event for each file processed and dispatch its status (required for progress output) + $this->dispatchEvent(FileProcessed::NAME, new FileProcessed($workerResponse['status'])); + + if (isset($workerResponse['fileHash'])) { + $this->cacheManager->setFileHash($fileRelativePath, $workerResponse['fileHash']); + } + + foreach ($workerResponse['errors'] ?? [] as $error) { + $this->errorsManager->report(new Error( + $error['type'], + $error['filePath'], + null !== $error['source'] + ? SourceExceptionFactory::fromArray($error['source']) + : null, + $error['appliedFixers'], + $error['diff'] + )); + } + + // Pass-back information about applied changes (only if there are any) + if (isset($workerResponse['fixInfo'])) { + $changed[$fileRelativePath] = $workerResponse['fixInfo']; + + if ($this->stopOnViolation) { + $processPool->endAll(); + + return; + } + } + + return; + } + + if (ParallelAction::WORKER_GET_FILE_CHUNK === $workerResponse['action']) { + // Request another chunk of files, if still available + $fileChunk = $getFileChunk(); + + if (0 === \count($fileChunk)) { + $process->request(['action' => ParallelAction::RUNNER_THANK_YOU]); + $processPool->endProcessIfKnown($identifier); + + return; + } + + $process->request(['action' => ParallelAction::RUNNER_REQUEST_ANALYSIS, 'files' => $fileChunk]); + + return; + } + + if (ParallelAction::WORKER_ERROR_REPORT === $workerResponse['action']) { + throw WorkerException::fromRaw($workerResponse); // @phpstan-ignore-line + } + + throw new ParallelisationException('Unsupported action: '.($workerResponse['action'] ?? 'n/a')); + }, + + // [REACT] Handle errors encountered during worker's execution + static function (\Throwable $error) use ($processPool): void { + $processPool->endAll(); + + throw new ParallelisationException($error->getMessage(), $error->getCode(), $error); + }, + + // [REACT] Handle worker's shutdown + static function ($exitCode, string $output) use ($processPool, $identifier): void { + $processPool->endProcessIfKnown($identifier); + + if (0 === $exitCode || null === $exitCode) { + return; + } + + $errorsReported = Preg::matchAll( + \sprintf('/^(?:%s)([^\n]+)+/m', WorkerCommand::ERROR_PREFIX), + $output, + $matches + ); + + if ($errorsReported > 0) { + throw WorkerException::fromRaw(json_decode($matches[1][0], true)); + } + } + ); + } + + $streamSelectLoop->run(); + + return $changed; + } + + /** + * @return _RunResult + */ + private function fixSequential(): array + { + $this->dispatchEvent(AnalysisStarted::NAME, new AnalysisStarted(AnalysisStarted::MODE_SEQUENTIAL, $this->isDryRun)); - $collection = $this->linter->isAsync() - ? new FileCachingLintingIterator($fileFilteredFileIterator, $this->linter) - : new FileLintingIterator($fileFilteredFileIterator, $this->linter); + $changed = []; + $collection = $this->getLintingFileIterator(); foreach ($collection as $file) { $fixInfo = $this->fixFile($file, $collection->currentLintingResult()); @@ -140,8 +414,8 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu $lintingResult->check(); } catch (LintingException $e) { $this->dispatchEvent( - FixerFileProcessedEvent::NAME, - new FixerFileProcessedEvent(FixerFileProcessedEvent::STATUS_INVALID) + FileProcessed::NAME, + new FileProcessed(FileProcessed::STATUS_INVALID) ); $this->errorsManager->report(new Error(Error::TYPE_INVALID, $name, $e)); @@ -154,8 +428,8 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu $tokens = Tokens::fromCode($old); $oldHash = $tokens->getCodeHash(); - $newHash = $oldHash; $new = $old; + $newHash = $oldHash; $appliedFixers = []; @@ -179,10 +453,7 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu } } } catch (\ParseError $e) { - $this->dispatchEvent( - FixerFileProcessedEvent::NAME, - new FixerFileProcessedEvent(FixerFileProcessedEvent::STATUS_LINT) - ); + $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_LINT)); $this->errorsManager->report(new Error(Error::TYPE_LINT, $name, $e)); @@ -195,7 +466,7 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu $fixInfo = null; - if (!empty($appliedFixers)) { + if ([] !== $appliedFixers) { $new = $tokens->generateCode(); $newHash = $tokens->getCodeHash(); } @@ -213,10 +484,7 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu try { $this->linter->lintSource($new)->check(); } catch (LintingException $e) { - $this->dispatchEvent( - FixerFileProcessedEvent::NAME, - new FixerFileProcessedEvent(FixerFileProcessedEvent::STATUS_LINT) - ); + $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_LINT)); $this->errorsManager->report(new Error(Error::TYPE_LINT, $name, $e, $fixInfo['appliedFixers'], $fixInfo['diff'])); @@ -228,7 +496,7 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu if (!file_exists($fileName)) { throw new IOException( - sprintf('Failed to write file "%s" (no longer) exists.', $file->getPathname()), + \sprintf('Failed to write file "%s" (no longer) exists.', $file->getPathname()), 0, null, $file->getPathname() @@ -237,7 +505,7 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu if (is_dir($fileName)) { throw new IOException( - sprintf('Cannot write file "%s" as the location exists as directory.', $fileName), + \sprintf('Cannot write file "%s" as the location exists as directory.', $fileName), 0, null, $fileName @@ -246,7 +514,7 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu if (!is_writable($fileName)) { throw new IOException( - sprintf('Cannot write to file "%s" as it is not writable.', $fileName), + \sprintf('Cannot write to file "%s" as it is not writable.', $fileName), 0, null, $fileName @@ -257,7 +525,7 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu $error = error_get_last(); throw new IOException( - sprintf('Failed to write file "%s", "%s".', $fileName, $error ? $error['message'] : 'no reason available'), + \sprintf('Failed to write file "%s", "%s".', $fileName, null !== $error ? $error['message'] : 'no reason available'), 0, null, $fileName @@ -266,11 +534,11 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu } } - $this->cacheManager->setFile($name, $new); + $this->cacheManager->setFileHash($name, $newHash); $this->dispatchEvent( - FixerFileProcessedEvent::NAME, - new FixerFileProcessedEvent($fixInfo ? FixerFileProcessedEvent::STATUS_FIXED : FixerFileProcessedEvent::STATUS_NO_CHANGES) + FileProcessed::NAME, + new FileProcessed(null !== $fixInfo ? FileProcessed::STATUS_FIXED : FileProcessed::STATUS_NO_CHANGES, $name, $newHash) ); return $fixInfo; @@ -281,10 +549,7 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu */ private function processException(string $name, \Throwable $e): void { - $this->dispatchEvent( - FixerFileProcessedEvent::NAME, - new FixerFileProcessedEvent(FixerFileProcessedEvent::STATUS_EXCEPTION) - ); + $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_EXCEPTION)); $this->errorsManager->report(new Error(Error::TYPE_EXCEPTION, $name, $e)); } @@ -297,4 +562,28 @@ private function dispatchEvent(string $name, Event $event): void $this->eventDispatcher->dispatch($event, $name); } + + private function getLintingFileIterator(): LintingResultAwareFileIteratorInterface + { + $fileFilterIterator = $this->getFilteringFileIterator(); + + return $this->linter->isAsync() + ? new FileCachingLintingFileIterator($fileFilterIterator, $this->linter) + : new LintingFileIterator($fileFilterIterator, $this->linter); + } + + private function getFilteringFileIterator(): FileFilterIterator + { + if (null === $this->fileIterator) { + throw new \RuntimeException('File iterator is not configured. Pass paths during Runner initialisation or set them after with `setFileIterator()`.'); + } + + return new FileFilterIterator( + $this->fileIterator instanceof \IteratorAggregate + ? $this->fileIterator->getIterator() + : $this->fileIterator, + $this->eventDispatcher, + $this->cacheManager + ); + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/RunnerConfig.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/RunnerConfig.php new file mode 100644 index 00000000..f95b16ca --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/RunnerConfig.php @@ -0,0 +1,64 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Runner; + +use PhpCsFixer\Runner\Parallel\ParallelConfig; + +/** + * @author Greg Korba + * + * @readonly + * + * @internal + */ +final class RunnerConfig +{ + private bool $isDryRun; + private bool $stopOnViolation; + private ParallelConfig $parallelConfig; + private ?string $configFile; + + public function __construct( + bool $isDryRun, + bool $stopOnViolation, + ParallelConfig $parallelConfig, + ?string $configFile = null + ) { + $this->isDryRun = $isDryRun; + $this->stopOnViolation = $stopOnViolation; + $this->parallelConfig = $parallelConfig; + $this->configFile = $configFile; + } + + public function isDryRun(): bool + { + return $this->isDryRun; + } + + public function shouldStopOnViolation(): bool + { + return $this->stopOnViolation; + } + + public function getParallelConfig(): ParallelConfig + { + return $this->parallelConfig; + } + + public function getConfigFile(): ?string + { + return $this->configFile; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/StdinFileInfo.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/StdinFileInfo.php index bbb66acf..d7cdccdd 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/StdinFileInfo.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/StdinFileInfo.php @@ -23,6 +23,7 @@ final class StdinFileInfo extends \SplFileInfo { public function __construct() { + parent::__construct(__FILE__); } public function __toString(): string @@ -57,9 +58,12 @@ public function getExtension(): string return '.php'; } - public function getFileInfo($className = null): \SplFileInfo + /** + * @param null|class-string<\SplFileInfo> $class + */ + public function getFileInfo($class = null): \SplFileInfo { - throw new \BadMethodCallException(sprintf('Method "%s" is not implemented.', __METHOD__)); + throw new \BadMethodCallException(\sprintf('Method "%s" is not implemented.', __METHOD__)); } public function getFilename(): string @@ -104,9 +108,12 @@ public function getPath(): string return ''; } - public function getPathInfo($className = null): \SplFileInfo + /** + * @param null|class-string<\SplFileInfo> $class + */ + public function getPathInfo($class = null): \SplFileInfo { - throw new \BadMethodCallException(sprintf('Method "%s" is not implemented.', __METHOD__)); + throw new \BadMethodCallException(\sprintf('Method "%s" is not implemented.', __METHOD__)); } public function getPathname(): string @@ -161,14 +168,6 @@ public function isWritable(): bool public function openFile($openMode = 'r', $useIncludePath = false, $context = null): \SplFileObject { - throw new \BadMethodCallException(sprintf('Method "%s" is not implemented.', __METHOD__)); - } - - public function setFileClass($className = null): void - { - } - - public function setInfoClass($className = null): void - { + throw new \BadMethodCallException(\sprintf('Method "%s" is not implemented.', __METHOD__)); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTransformer.php index 8b0fae82..5c8de2eb 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTransformer.php @@ -23,9 +23,6 @@ */ abstract class AbstractTransformer implements TransformerInterface { - /** - * {@inheritdoc} - */ public function getName(): string { $nameParts = explode('\\', static::class); @@ -34,16 +31,10 @@ public function getName(): string return Utils::camelCaseToUnderscore($name); } - /** - * {@inheritdoc} - */ public function getPriority(): int { return 0; } - /** - * {@inheritdoc} - */ abstract public function getCustomTokens(): array; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTypeTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTypeTransformer.php index 022473d7..8c5476b4 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTypeTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTypeTransformer.php @@ -52,7 +52,7 @@ private function isPartOfType(Tokens $tokens, int $index): bool { // return types and non-capturing catches $typeColonIndex = $tokens->getTokenNotOfKindSibling($index, -1, self::TYPE_TOKENS); - if ($tokens[$typeColonIndex]->isGivenKind([T_CATCH, CT::T_TYPE_COLON])) { + if ($tokens[$typeColonIndex]->isGivenKind([T_CATCH, CT::T_TYPE_COLON, T_CONST])) { return true; } @@ -69,7 +69,17 @@ private function isPartOfType(Tokens $tokens, int $index): bool $beforeVariableIndex = $tokens->getPrevMeaningfulToken($afterTypeIndex); if ($tokens[$beforeVariableIndex]->equals('&')) { - $prevIndex = $tokens->getPrevTokenOfKind($index, ['{', '}', ';', [T_FN], [T_FUNCTION]]); + $prevIndex = $tokens->getPrevTokenOfKind( + $index, + [ + '{', + '}', + ';', + [T_CLOSE_TAG], + [T_FN], + [T_FUNCTION], + ], + ); return null !== $prevIndex && $tokens[$prevIndex]->isGivenKind([T_FN, T_FUNCTION]); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AlternativeSyntaxAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AlternativeSyntaxAnalyzer.php index 723d4c95..242aedd7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AlternativeSyntaxAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AlternativeSyntaxAnalyzer.php @@ -74,6 +74,11 @@ public function findAlternativeSyntaxBlockEnd(Tokens $tokens, int $index): int } $startTokenKind = $tokens[$index]->getId(); + + if (!isset(self::ALTERNATIVE_SYNTAX_BLOCK_EDGES[$startTokenKind])) { + throw new \LogicException(\sprintf('Unknown startTokenKind: %s', $tokens[$index]->toJson())); + } + $endTokenKinds = self::ALTERNATIVE_SYNTAX_BLOCK_EDGES[$startTokenKind]; $findKinds = [[$startTokenKind]]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AbstractControlCaseStructuresAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AbstractControlCaseStructuresAnalysis.php index a2bc675f..92efc074 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AbstractControlCaseStructuresAnalysis.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AbstractControlCaseStructuresAnalysis.php @@ -15,6 +15,8 @@ namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; /** + * @readonly + * * @internal */ abstract class AbstractControlCaseStructuresAnalysis diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/ArgumentAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/ArgumentAnalysis.php index b5c3030a..591c3ee9 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/ArgumentAnalysis.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/ArgumentAnalysis.php @@ -15,6 +15,8 @@ namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; /** + * @readonly + * * @internal */ final class ArgumentAnalysis @@ -22,12 +24,12 @@ final class ArgumentAnalysis /** * The name of the argument. */ - private string $name; + private ?string $name; /** * The index where the name is located in the supplied Tokens object. */ - private int $nameIndex; + private ?int $nameIndex; /** * The default value of the argument. @@ -39,12 +41,12 @@ final class ArgumentAnalysis */ private ?TypeAnalysis $typeAnalysis; - public function __construct(string $name, int $nameIndex, ?string $default, ?TypeAnalysis $typeAnalysis = null) + public function __construct(?string $name, ?int $nameIndex, ?string $default, ?TypeAnalysis $typeAnalysis = null) { $this->name = $name; $this->nameIndex = $nameIndex; - $this->default = $default ?: null; - $this->typeAnalysis = $typeAnalysis ?: null; + $this->default = $default ?? null; + $this->typeAnalysis = $typeAnalysis ?? null; } public function getDefault(): ?string @@ -57,12 +59,12 @@ public function hasDefault(): bool return null !== $this->default; } - public function getName(): string + public function getName(): ?string { return $this->name; } - public function getNameIndex(): int + public function getNameIndex(): ?int { return $this->nameIndex; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AttributeAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AttributeAnalysis.php new file mode 100644 index 00000000..184015fa --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AttributeAnalysis.php @@ -0,0 +1,76 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; + +/** + * @readonly + * + * @internal + * + * @phpstan-type _AttributeItem array{start: int, end: int, name: string} + * @phpstan-type _AttributeItems non-empty-list<_AttributeItem> + */ +final class AttributeAnalysis +{ + private int $startIndex; + private int $endIndex; + private int $openingBracketIndex; + private int $closingBracketIndex; + + /** + * @var _AttributeItems + */ + private array $attributes; + + /** + * @param _AttributeItems $attributes + */ + public function __construct(int $startIndex, int $endIndex, int $openingBracketIndex, int $closingBracketIndex, array $attributes) + { + $this->startIndex = $startIndex; + $this->endIndex = $endIndex; + $this->openingBracketIndex = $openingBracketIndex; + $this->closingBracketIndex = $closingBracketIndex; + $this->attributes = $attributes; + } + + public function getStartIndex(): int + { + return $this->startIndex; + } + + public function getEndIndex(): int + { + return $this->endIndex; + } + + public function getOpeningBracketIndex(): int + { + return $this->openingBracketIndex; + } + + public function getClosingBracketIndex(): int + { + return $this->closingBracketIndex; + } + + /** + * @return _AttributeItems + */ + public function getAttributes(): array + { + return $this->attributes; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/CaseAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/CaseAnalysis.php index df8c0dc3..e500bf44 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/CaseAnalysis.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/CaseAnalysis.php @@ -17,6 +17,8 @@ /** * @author Kuba Werłos * + * @readonly + * * @internal */ final class CaseAnalysis diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DataProviderAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DataProviderAnalysis.php new file mode 100644 index 00000000..aab64c3f --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DataProviderAnalysis.php @@ -0,0 +1,68 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; + +use PhpCsFixer\Console\Application; +use PhpCsFixer\Utils; + +/** + * @internal + * + * @readonly + */ +final class DataProviderAnalysis +{ + private string $name; + + private int $nameIndex; + + /** @var non-empty-list */ + private array $usageIndices; + + /** + * @param non-empty-list $usageIndices + */ + public function __construct(string $name, int $nameIndex, array $usageIndices) + { + if ([] === $usageIndices || !array_is_list($usageIndices)) { + Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( + 'Parameter "usageIndices" should be a non-empty-list. This will be enforced in version %d.0.', + Application::getMajorVersion() + 1 + ))); + } + + $this->name = $name; + $this->nameIndex = $nameIndex; + $this->usageIndices = $usageIndices; + } + + public function getName(): string + { + return $this->name; + } + + public function getNameIndex(): int + { + return $this->nameIndex; + } + + /** + * @return non-empty-list + */ + public function getUsageIndices(): array + { + return $this->usageIndices; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DefaultAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DefaultAnalysis.php index b742b29a..6ca02898 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DefaultAnalysis.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DefaultAnalysis.php @@ -15,6 +15,8 @@ namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; /** + * @readonly + * * @internal */ final class DefaultAnalysis diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/EnumAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/EnumAnalysis.php index 6260cca1..9c1aa5c5 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/EnumAnalysis.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/EnumAnalysis.php @@ -15,6 +15,8 @@ namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; /** + * @readonly + * * @internal */ final class EnumAnalysis extends AbstractControlCaseStructuresAnalysis diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/MatchAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/MatchAnalysis.php index 2ac1b977..5a3ecf30 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/MatchAnalysis.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/MatchAnalysis.php @@ -15,6 +15,8 @@ namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; /** + * @readonly + * * @internal */ final class MatchAnalysis extends AbstractControlCaseStructuresAnalysis diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceAnalysis.php index 6702a122..7721e270 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceAnalysis.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceAnalysis.php @@ -15,6 +15,8 @@ namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; /** + * @readonly + * * @internal */ final class NamespaceAnalysis implements StartEndTokenAwareAnalysis diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceUseAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceUseAnalysis.php index 59127b2f..475fa6c0 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceUseAnalysis.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceUseAnalysis.php @@ -15,7 +15,14 @@ namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; /** + * @author VeeWee + * @author Greg Korba + * + * @readonly + * * @internal + * + * @phpstan-type _ImportType 'class'|'constant'|'function' */ final class NamespaceUseAnalysis implements StartEndTokenAwareAnalysis { @@ -25,6 +32,8 @@ final class NamespaceUseAnalysis implements StartEndTokenAwareAnalysis /** * The fully qualified use namespace. + * + * @var class-string */ private string $fullName; @@ -33,6 +42,11 @@ final class NamespaceUseAnalysis implements StartEndTokenAwareAnalysis */ private string $shortName; + /** + * Is the use statement part of multi-use (`use A, B, C;`, `use A\{B, C};`)? + */ + private bool $isInMulti; + /** * Is the use statement being aliased? */ @@ -48,21 +62,56 @@ final class NamespaceUseAnalysis implements StartEndTokenAwareAnalysis */ private int $endIndex; + /** + * The start index of the single import in the multi-use statement. + */ + private ?int $chunkStartIndex; + + /** + * The end index of the single import in the multi-use statement. + */ + private ?int $chunkEndIndex; + /** * The type of import: class, function or constant. + * + * @var self::TYPE_* */ private int $type; - public function __construct(string $fullName, string $shortName, bool $isAliased, int $startIndex, int $endIndex, int $type) - { + /** + * @param self::TYPE_* $type + * @param class-string $fullName + */ + public function __construct( + int $type, + string $fullName, + string $shortName, + bool $isAliased, + bool $isInMulti, + int $startIndex, + int $endIndex, + ?int $chunkStartIndex = null, + ?int $chunkEndIndex = null + ) { + if (true === $isInMulti && (null === $chunkStartIndex || null === $chunkEndIndex)) { + throw new \LogicException('Chunk start and end index must be set when the import is part of a multi-use statement.'); + } + + $this->type = $type; $this->fullName = $fullName; $this->shortName = $shortName; $this->isAliased = $isAliased; + $this->isInMulti = $isInMulti; $this->startIndex = $startIndex; $this->endIndex = $endIndex; - $this->type = $type; + $this->chunkStartIndex = $chunkStartIndex; + $this->chunkEndIndex = $chunkEndIndex; } + /** + * @return class-string + */ public function getFullName(): string { return $this->fullName; @@ -78,6 +127,11 @@ public function isAliased(): bool return $this->isAliased; } + public function isInMulti(): bool + { + return $this->isInMulti; + } + public function getStartIndex(): int { return $this->startIndex; @@ -88,11 +142,36 @@ public function getEndIndex(): int return $this->endIndex; } + public function getChunkStartIndex(): ?int + { + return $this->chunkStartIndex; + } + + public function getChunkEndIndex(): ?int + { + return $this->chunkEndIndex; + } + + /** + * @return self::TYPE_* + */ public function getType(): int { return $this->type; } + /** + * @return _ImportType + */ + public function getHumanFriendlyType(): string + { + return [ + self::TYPE_CLASS => 'class', + self::TYPE_FUNCTION => 'function', + self::TYPE_CONSTANT => 'constant', + ][$this->type]; + } + public function isClass(): bool { return self::TYPE_CLASS === $this->type; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/StartEndTokenAwareAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/StartEndTokenAwareAnalysis.php index 0b2f318b..c00b1777 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/StartEndTokenAwareAnalysis.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/StartEndTokenAwareAnalysis.php @@ -14,6 +14,11 @@ namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; +/** + * @internal + * + * @readonly + */ interface StartEndTokenAwareAnalysis { /** diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/SwitchAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/SwitchAnalysis.php index f81b48e2..ff4f5717 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/SwitchAnalysis.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/SwitchAnalysis.php @@ -15,6 +15,8 @@ namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; /** + * @readonly + * * @internal */ final class SwitchAnalysis extends AbstractControlCaseStructuresAnalysis diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php index 7fe14158..fd76075c 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php @@ -15,6 +15,8 @@ namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; /** + * @readonly + * * @internal */ final class TypeAnalysis implements StartEndTokenAwareAnalysis @@ -26,43 +28,53 @@ final class TypeAnalysis implements StartEndTokenAwareAnalysis * * @see https://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration.types * @see https://php.net/manual/en/reserved.other-reserved-words.php - * @see https://php.net/manual/en/language.pseudo-types.php * * @var list */ - private static array $reservedTypes = [ + private const RESERVED_TYPES = [ 'array', 'bool', 'callable', + 'false', 'float', 'int', 'iterable', + 'list', 'mixed', 'never', - 'numeric', + 'null', 'object', + 'parent', 'resource', 'self', + 'static', 'string', + 'true', 'void', ]; private string $name; - private int $startIndex; + private ?int $startIndex; - private int $endIndex; + private ?int $endIndex; private bool $nullable; - public function __construct(string $name, int $startIndex, int $endIndex) + /** + * @param ($startIndex is null ? null : int) $endIndex + */ + public function __construct(string $name, ?int $startIndex = null, ?int $endIndex = null) { - $this->name = $name; - $this->nullable = false; - if (str_starts_with($name, '?')) { $this->name = substr($name, 1); $this->nullable = true; + } elseif (\PHP_VERSION_ID >= 8_00_00) { + $this->name = $name; + $this->nullable = \in_array('null', array_map('trim', explode('|', strtolower($name))), true); + } else { + $this->name = $name; + $this->nullable = false; } $this->startIndex = $startIndex; @@ -76,17 +88,25 @@ public function getName(): string public function getStartIndex(): int { + if (null === $this->startIndex) { + throw new \RuntimeException('TypeAnalysis: no start index.'); + } + return $this->startIndex; } public function getEndIndex(): int { + if (null === $this->endIndex) { + throw new \RuntimeException('TypeAnalysis: no end index.'); + } + return $this->endIndex; } public function isReservedType(): bool { - return \in_array($this->name, self::$reservedTypes, true); + return \in_array(strtolower($this->name), self::RESERVED_TYPES, true); } public function isNullable(): bool diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ArgumentsAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ArgumentsAnalyzer.php index 39d9c892..94322071 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ArgumentsAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ArgumentsAnalyzer.php @@ -147,11 +147,15 @@ public function getArgumentInfo(Tokens $tokens, int $argumentStart, int $argumen } } + if (null === $info['name']) { + $info['type'] = null; + } + return new ArgumentAnalysis( $info['name'], $info['name_index'], $info['default'], - $info['type'] ? new TypeAnalysis($info['type'], $info['type_index_start'], $info['type_index_end']) : null + null !== $info['type'] ? new TypeAnalysis($info['type'], $info['type_index_start'], $info['type_index_end']) : null ); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AttributeAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AttributeAnalyzer.php index c67b76bc..709f8321 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AttributeAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AttributeAnalyzer.php @@ -14,11 +14,16 @@ namespace PhpCsFixer\Tokenizer\Analyzer; +use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\AttributeAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; use PhpCsFixer\Tokenizer\CT; use PhpCsFixer\Tokenizer\Tokens; /** * @internal + * + * @phpstan-import-type _AttributeItems from AttributeAnalysis */ final class AttributeAnalyzer { @@ -67,4 +72,140 @@ public static function isAttribute(Tokens $tokens, int $index): bool return 0 === $count; } + + /** + * Find all consecutive elements that start with #[ and end with ] and the attributes inside. + * + * @return list + */ + public static function collect(Tokens $tokens, int $index): array + { + if (!$tokens[$index]->isGivenKind(T_ATTRIBUTE)) { + throw new \InvalidArgumentException('Given index must point to an attribute.'); + } + + // Rewind to first attribute in group + while ($tokens[$prevIndex = $tokens->getPrevMeaningfulToken($index)]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { + $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $prevIndex); + } + + /** @var list $elements */ + $elements = []; + + $openingIndex = $index; + do { + $elements[] = $element = self::collectOne($tokens, $openingIndex); + $openingIndex = $tokens->getNextMeaningfulToken($element->getEndIndex()); + } while ($tokens[$openingIndex]->isGivenKind(T_ATTRIBUTE)); + + return $elements; + } + + /** + * Find one element that starts with #[ and ends with ] and the attributes inside. + */ + public static function collectOne(Tokens $tokens, int $index): AttributeAnalysis + { + if (!$tokens[$index]->isGivenKind(T_ATTRIBUTE)) { + throw new \InvalidArgumentException('Given index must point to an attribute.'); + } + + $startIndex = $index; + $prevIndex = $tokens->getPrevMeaningfulToken($index); + + if ($tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { + // Include comments/PHPDoc if they are present + $startIndex = $tokens->getNextNonWhitespace($prevIndex); + } + + $closingIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); + $endIndex = $tokens->getNextNonWhitespace($closingIndex); + + return new AttributeAnalysis( + $startIndex, + $endIndex - 1, + $index, + $closingIndex, + self::collectAttributes($tokens, $index, $closingIndex), + ); + } + + public static function determineAttributeFullyQualifiedName(Tokens $tokens, string $name, int $index): string + { + if ('\\' === $name[0]) { + return $name; + } + + if (!$tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR])) { + $index = $tokens->getNextTokenOfKind($index, [[T_STRING], [T_NS_SEPARATOR]]); + } + + [$namespaceAnalysis, $namespaceUseAnalyses] = NamespacesAnalyzer::collectNamespaceAnalysis($tokens, $index); + $namespace = $namespaceAnalysis->getFullName(); + $firstTokenOfName = $tokens[$index]->getContent(); + $namespaceUseAnalysis = $namespaceUseAnalyses[$firstTokenOfName] ?? false; + + if ($namespaceUseAnalysis instanceof NamespaceUseAnalysis) { + $namespace = $namespaceUseAnalysis->getFullName(); + + if ($name === $firstTokenOfName) { + return $namespace; + } + + $name = substr((string) strstr($name, '\\'), 1); + } + + return $namespace.'\\'.$name; + } + + /** + * @return _AttributeItems + */ + private static function collectAttributes(Tokens $tokens, int $index, int $closingIndex): array + { + $elements = []; + + do { + $attributeStartIndex = $index + 1; + + $nameStartIndex = $tokens->getNextTokenOfKind($index, [[T_STRING], [T_NS_SEPARATOR]]); + $index = $tokens->getNextTokenOfKind($attributeStartIndex, ['(', ',', [CT::T_ATTRIBUTE_CLOSE]]); + $attributeName = $tokens->generatePartialCode($nameStartIndex, $tokens->getPrevMeaningfulToken($index)); + + // Find closing parentheses, we need to do this in case there's a comma inside the parentheses + if ($tokens[$index]->equals('(')) { + $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); + $index = $tokens->getNextTokenOfKind($index, [',', [CT::T_ATTRIBUTE_CLOSE]]); + } + + $elements[] = [ + 'start' => $attributeStartIndex, + 'end' => $index - 1, + 'name' => $attributeName, + ]; + + $nextIndex = $index; + + // In case there's a comma right before T_ATTRIBUTE_CLOSE + if ($nextIndex < $closingIndex) { + $nextIndex = $tokens->getNextMeaningfulToken($index); + } + } while ($nextIndex < $closingIndex); + + // End last element at newline if it exists and there's no trailing comma + --$index; + while ($tokens[$index]->isWhitespace()) { + if (Preg::match('/\R/', $tokens[$index]->getContent())) { + $lastElementKey = array_key_last($elements); + $elements[$lastElementKey]['end'] = $index - 1; + + break; + } + --$index; + } + + \assert(array_is_list($elements)); + + return $elements; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/BlocksAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/BlocksAnalyzer.php index 492d7049..0f2f7735 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/BlocksAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/BlocksAnalyzer.php @@ -24,18 +24,14 @@ */ final class BlocksAnalyzer { - public function isBlock(Tokens $tokens, ?int $openIndex, ?int $closeIndex): bool + public function isBlock(Tokens $tokens, int $openIndex, int $closeIndex): bool { - if (null === $openIndex || null === $closeIndex) { - return false; - } - if (!$tokens->offsetExists($openIndex)) { - return false; + throw new \InvalidArgumentException(\sprintf('Tokex index %d for potential block opening does not exist.', $openIndex)); } if (!$tokens->offsetExists($closeIndex)) { - return false; + throw new \InvalidArgumentException(\sprintf('Token index %d for potential block closure does not exist.', $closeIndex)); } $blockType = $this->getBlockType($tokens[$openIndex]); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ClassyAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ClassyAnalyzer.php index 8a68d91c..31e0b051 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ClassyAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ClassyAnalyzer.php @@ -27,10 +27,10 @@ public function isClassyInvocation(Tokens $tokens, int $index): bool $token = $tokens[$index]; if (!$token->isGivenKind(T_STRING)) { - throw new \LogicException(sprintf('No T_STRING at given index %d, got "%s".', $index, $tokens[$index]->getName())); + throw new \LogicException(\sprintf('No T_STRING at given index %d, got "%s".', $index, $tokens[$index]->getName())); } - if (\in_array(strtolower($token->getContent()), ['bool', 'float', 'int', 'iterable', 'object', 'parent', 'self', 'string', 'void', 'null', 'false', 'never'], true)) { + if ((new Analysis\TypeAnalysis($token->getContent()))->isReservedType()) { return false; } @@ -57,6 +57,10 @@ public function isClassyInvocation(Tokens $tokens, int $index): bool return true; } + if (\PHP_VERSION_ID >= 8_00_00 && $nextToken->equals(')') && $prevToken->equals('(') && $tokens[$tokens->getPrevMeaningfulToken($prev)]->isGivenKind(T_CATCH)) { + return true; + } + if (AttributeAnalyzer::isAttribute($tokens, $index)) { return true; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/CommentsAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/CommentsAnalyzer.php index 0666a21d..c2822c60 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/CommentsAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/CommentsAnalyzer.php @@ -73,18 +73,7 @@ public function isBeforeStructuralElement(Tokens $tokens, int $index): bool throw new \InvalidArgumentException('Given index must point to a comment.'); } - $nextIndex = $index; - do { - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - - // @TODO: drop condition when PHP 8.0+ is required - if (\defined('T_ATTRIBUTE')) { - while (null !== $nextIndex && $tokens[$nextIndex]->isGivenKind(T_ATTRIBUTE)) { - $nextIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $nextIndex); - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - } - } - } while (null !== $nextIndex && $tokens[$nextIndex]->equals('(')); + $nextIndex = $this->getNextTokenIndex($tokens, $index); if (null === $nextIndex || $tokens[$nextIndex]->equals('}')) { return false; @@ -102,7 +91,7 @@ public function isBeforeStructuralElement(Tokens $tokens, int $index): bool return true; } - if ($this->isValidLanguageConstruct($tokens, $token, $nextIndex)) { + if ($this->isValidVariableAssignment($tokens, $token, $nextIndex)) { return true; } @@ -113,12 +102,30 @@ public function isBeforeStructuralElement(Tokens $tokens, int $index): bool return false; } + /** + * Check if comment at given index precedes return statement. + */ + public function isBeforeReturn(Tokens $tokens, int $index): bool + { + if (!$tokens[$index]->isGivenKind([T_COMMENT, T_DOC_COMMENT])) { + throw new \InvalidArgumentException('Given index must point to a comment.'); + } + + $nextIndex = $this->getNextTokenIndex($tokens, $index); + + if (null === $nextIndex || $tokens[$nextIndex]->equals('}')) { + return false; + } + + return $tokens[$nextIndex]->isGivenKind(T_RETURN); + } + /** * Return array of indices that are part of a comment started at given index. * * @param int $index T_COMMENT index * - * @return list + * @return non-empty-list */ public function getCommentBlockIndices(Tokens $tokens, int $index): array { @@ -169,6 +176,7 @@ private function isStructuralElement(Tokens $tokens, int $index): bool T_PUBLIC, T_VAR, T_FUNCTION, + T_FN, T_ABSTRACT, T_CONST, T_NAMESPACE, @@ -193,6 +201,12 @@ private function isStructuralElement(Tokens $tokens, int $index): bool return true; } + if ($token->isGivenKind(T_CASE) && \defined('T_ENUM')) { + $caseParent = $tokens->getPrevTokenOfKind($index, [[T_ENUM], [T_SWITCH]]); + + return $tokens[$caseParent]->isGivenKind([T_ENUM]); + } + if ($token->isGivenKind(T_STATIC)) { return !$tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(T_DOUBLE_COLON); } @@ -220,11 +234,11 @@ private function isValidControl(Tokens $tokens, Token $docsToken, int $controlIn return false; } - $index = $tokens->getNextMeaningfulToken($controlIndex); - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); + $openParenthesisIndex = $tokens->getNextMeaningfulToken($controlIndex); + $closeParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openParenthesisIndex); $docsContent = $docsToken->getContent(); - for ($index = $index + 1; $index < $endIndex; ++$index) { + for ($index = $openParenthesisIndex + 1; $index < $closeParenthesisIndex; ++$index) { $token = $tokens[$index]; if ( @@ -244,7 +258,7 @@ private function isValidControl(Tokens $tokens, Token $docsToken, int $controlIn * @param Token $docsToken docs Token * @param int $languageConstructIndex index of variable Token */ - private function isValidLanguageConstruct(Tokens $tokens, Token $docsToken, int $languageConstructIndex): bool + private function isValidVariableAssignment(Tokens $tokens, Token $docsToken, int $languageConstructIndex): bool { static $languageStructures = [ T_LIST, @@ -314,4 +328,23 @@ private function getLineBreakCount(Tokens $tokens, int $whiteStart, int $whiteEn return $lineCount; } + + private function getNextTokenIndex(Tokens $tokens, int $startIndex): ?int + { + $nextIndex = $startIndex; + + do { + $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); + + // @TODO: drop condition when PHP 8.0+ is required + if (\defined('T_ATTRIBUTE')) { + while (null !== $nextIndex && $tokens[$nextIndex]->isGivenKind(T_ATTRIBUTE)) { + $nextIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $nextIndex); + $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); + } + } + } while (null !== $nextIndex && $tokens[$nextIndex]->equals('(')); + + return $nextIndex; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ControlCaseStructuresAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ControlCaseStructuresAnalyzer.php index cb7cf9c4..6c9f2543 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ControlCaseStructuresAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ControlCaseStructuresAnalyzer.php @@ -39,7 +39,7 @@ public static function findControlStructures(Tokens $tokens, array $types): \Gen foreach ($types as $type) { if (!\in_array($type, $typesWithCaseOrDefault, true)) { - throw new \InvalidArgumentException(sprintf('Unexpected type "%d".', $type)); + throw new \InvalidArgumentException(\sprintf('Unexpected type "%d".', $type)); } } @@ -235,7 +235,7 @@ private static function buildControlCaseStructureAnalysis(array $analysis): Abst ); } - throw new \InvalidArgumentException(sprintf('Unexpected type "%d".', $analysis['kind'])); + throw new \InvalidArgumentException(\sprintf('Unexpected type "%d".', $analysis['kind'])); } private static function findCaseOpen(Tokens $tokens, int $kind, int $index): int @@ -273,7 +273,7 @@ private static function findCaseOpen(Tokens $tokens, int $kind, int $index): int return $tokens->getNextTokenOfKind($index, ['=', ';']); } - throw new \InvalidArgumentException(sprintf('Unexpected case for type "%d".', $kind)); + throw new \InvalidArgumentException(\sprintf('Unexpected case for type "%d".', $kind)); } private static function findDefaultOpen(Tokens $tokens, int $kind, int $index): int @@ -286,7 +286,7 @@ private static function findDefaultOpen(Tokens $tokens, int $kind, int $index): return $tokens->getNextTokenOfKind($index, [[T_DOUBLE_ARROW]]); } - throw new \InvalidArgumentException(sprintf('Unexpected default for type "%d".', $kind)); + throw new \InvalidArgumentException(\sprintf('Unexpected default for type "%d".', $kind)); } /** diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/DataProviderAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/DataProviderAnalyzer.php index 8c811b90..5fb06f3a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/DataProviderAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/DataProviderAnalyzer.php @@ -14,7 +14,9 @@ namespace PhpCsFixer\Tokenizer\Analyzer; +use PhpCsFixer\DocBlock\TypeExpression; use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\DataProviderAnalysis; use PhpCsFixer\Tokenizer\Tokens; /** @@ -24,8 +26,11 @@ */ final class DataProviderAnalyzer { + private const REGEX_CLASS = '(?:\\\?+'.TypeExpression::REGEX_IDENTIFIER + .'(\\\\'.TypeExpression::REGEX_IDENTIFIER.')*+)'; + /** - * @return array indices of data provider definitions + * @return list */ public function getDataProviders(Tokens $tokens, int $startIndex, int $endIndex): array { @@ -33,38 +38,40 @@ public function getDataProviders(Tokens $tokens, int $startIndex, int $endIndex) $dataProviders = []; foreach ($methods as $methodIndex) { - $docCommentIndex = $tokens->getTokenNotOfKindSibling( - $methodIndex, - -1, - [[T_ABSTRACT], [T_COMMENT], [T_FINAL], [T_FUNCTION], [T_PRIVATE], [T_PROTECTED], [T_PUBLIC], [T_STATIC], [T_WHITESPACE]] - ); + $docCommentIndex = $this->getDocCommentIndex($tokens, $methodIndex); - if (!$tokens[$docCommentIndex]->isGivenKind(T_DOC_COMMENT)) { - continue; - } + if (null !== $docCommentIndex) { + Preg::matchAll( + '/@dataProvider\h+(('.self::REGEX_CLASS.'::)?'.TypeExpression::REGEX_IDENTIFIER.')/', + $tokens[$docCommentIndex]->getContent(), + $matches, + PREG_OFFSET_CAPTURE + ); - Preg::matchAll('/@dataProvider\s+([a-zA-Z0-9._:-\\\\x7f-\xff]+)/', $tokens[$docCommentIndex]->getContent(), $matches); + foreach ($matches[1] as $k => [$matchName]) { + \assert(isset($matches[0][$k])); - /** @var array $matches */ - $matches = $matches[1]; - - foreach ($matches as $dataProviderName) { - $dataProviders[$dataProviderName][] = $docCommentIndex; + $dataProviders[$matchName][] = [$docCommentIndex, $matches[0][$k][1]]; + } } } - $dataProviderDefinitions = []; + $dataProviderAnalyses = []; foreach ($dataProviders as $dataProviderName => $dataProviderUsages) { $lowercaseDataProviderName = strtolower($dataProviderName); if (!\array_key_exists($lowercaseDataProviderName, $methods)) { continue; } - $dataProviderDefinitions[$methods[$lowercaseDataProviderName]] = $methods[$lowercaseDataProviderName]; + $dataProviderAnalyses[$methods[$lowercaseDataProviderName]] = new DataProviderAnalysis( + $tokens[$methods[$lowercaseDataProviderName]]->getContent(), + $methods[$lowercaseDataProviderName], + $dataProviderUsages, + ); } - ksort($dataProviderDefinitions); + ksort($dataProviderAnalyses); - return array_values($dataProviderDefinitions); + return array_values($dataProviderAnalyses); } /** @@ -89,4 +96,20 @@ private function getMethods(Tokens $tokens, int $startIndex, int $endIndex): arr return $functions; } + + private function getDocCommentIndex(Tokens $tokens, int $index): ?int + { + $docCommentIndex = null; + while (!$tokens[$index]->equalsAny([';', '{', '}', [T_OPEN_TAG]])) { + --$index; + + if ($tokens[$index]->isGivenKind(T_DOC_COMMENT)) { + $docCommentIndex = $index; + + break; + } + } + + return $docCommentIndex; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/FunctionsAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/FunctionsAnalyzer.php index b2cea1f7..65d0e6ac 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/FunctionsAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/FunctionsAnalyzer.php @@ -54,7 +54,10 @@ public function isGlobalFunctionCall(Tokens $tokens, int $index): bool $prevIndex = $tokens->getPrevMeaningfulToken($prevIndex); } - $possibleKind = array_merge([T_DOUBLE_COLON, T_FUNCTION, CT::T_NAMESPACE_OPERATOR, T_NEW, CT::T_RETURN_REF, T_STRING], Token::getObjectOperatorKinds()); + $possibleKind = [ + T_DOUBLE_COLON, T_FUNCTION, CT::T_NAMESPACE_OPERATOR, T_NEW, CT::T_RETURN_REF, T_STRING, + ...Token::getObjectOperatorKinds(), + ]; // @TODO: drop condition when PHP 8.0+ is required if (\defined('T_ATTRIBUTE')) { @@ -78,14 +81,11 @@ public function isGlobalFunctionCall(Tokens $tokens, int $index): bool } // figure out in which namespace we are - $namespaceAnalyzer = new NamespacesAnalyzer(); - - $declarations = $namespaceAnalyzer->getDeclarations($tokens); $scopeStartIndex = 0; $scopeEndIndex = \count($tokens) - 1; $inGlobalNamespace = false; - foreach ($declarations as $declaration) { + foreach ($tokens->getNamespaceDeclarations() as $declaration) { $scopeStartIndex = $declaration->getScopeStartIndex(); $scopeEndIndex = $declaration->getScopeEndIndex(); @@ -184,7 +184,7 @@ public function getFunctionReturnType(Tokens $tokens, int $methodIndex): ?TypeAn public function isTheSameClassCall(Tokens $tokens, int $index): bool { if (!$tokens->offsetExists($index)) { - return false; + throw new \InvalidArgumentException(\sprintf('Token index %d does not exist.', $index)); } $operatorIndex = $tokens->getPrevMeaningfulToken($index); @@ -203,7 +203,11 @@ public function isTheSameClassCall(Tokens $tokens, int $index): bool return false; } - return $tokens[$referenceIndex]->equalsAny([[T_VARIABLE, '$this'], [T_STRING, 'self'], [T_STATIC, 'static']], false); + if (!$tokens[$referenceIndex]->equalsAny([[T_VARIABLE, '$this'], [T_STRING, 'self'], [T_STATIC, 'static']], false)) { + return false; + } + + return $tokens[$tokens->getNextMeaningfulToken($index)]->equals('('); } private function buildFunctionsAnalysis(Tokens $tokens): void diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespaceUsesAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespaceUsesAnalyzer.php index 40e9053a..fea85906 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespaceUsesAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespaceUsesAnalyzer.php @@ -21,29 +21,34 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer; /** + * @author VeeWee + * @author Greg Korba + * * @internal + * + * @TODO Drop `allowMultiUses` opt-in flag when all fixers are updated and can handle multi-use statements. */ final class NamespaceUsesAnalyzer { /** * @return list */ - public function getDeclarationsFromTokens(Tokens $tokens): array + public function getDeclarationsFromTokens(Tokens $tokens, bool $allowMultiUses = false): array { $tokenAnalyzer = new TokensAnalyzer($tokens); $useIndices = $tokenAnalyzer->getImportUseIndexes(); - return $this->getDeclarations($tokens, $useIndices); + return $this->getDeclarations($tokens, $useIndices, $allowMultiUses); } /** * @return list */ - public function getDeclarationsInNamespace(Tokens $tokens, NamespaceAnalysis $namespace): array + public function getDeclarationsInNamespace(Tokens $tokens, NamespaceAnalysis $namespace, bool $allowMultiUses = false): array { $namespaceUses = []; - foreach ($this->getDeclarationsFromTokens($tokens) as $namespaceUse) { + foreach ($this->getDeclarationsFromTokens($tokens, $allowMultiUses) as $namespaceUse) { if ($namespaceUse->getStartIndex() >= $namespace->getScopeStartIndex() && $namespaceUse->getStartIndex() <= $namespace->getScopeEndIndex()) { $namespaceUses[] = $namespaceUse; } @@ -57,45 +62,124 @@ public function getDeclarationsInNamespace(Tokens $tokens, NamespaceAnalysis $na * * @return list */ - private function getDeclarations(Tokens $tokens, array $useIndices): array + private function getDeclarations(Tokens $tokens, array $useIndices, bool $allowMultiUses = false): array { $uses = []; foreach ($useIndices as $index) { $endIndex = $tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]); - $analysis = $this->parseDeclaration($tokens, $index, $endIndex); - if (null !== $analysis) { - $uses[] = $analysis; + $declarations = $this->parseDeclarations($index, $endIndex, $tokens); + if (false === $allowMultiUses) { + $declarations = array_filter($declarations, static fn (NamespaceUseAnalysis $declaration) => !$declaration->isInMulti()); + } + + if ([] !== $declarations) { + $uses = array_merge($uses, $declarations); } } return $uses; } - private function parseDeclaration(Tokens $tokens, int $startIndex, int $endIndex): ?NamespaceUseAnalysis + /** + * @return list + */ + private function parseDeclarations(int $startIndex, int $endIndex, Tokens $tokens): array { - $fullName = $shortName = ''; - $aliased = false; + $type = $this->determineImportType($tokens, $startIndex); + $potentialMulti = $tokens->getNextTokenOfKind($startIndex, [',', [CT::T_GROUP_IMPORT_BRACE_OPEN]]); + $multi = null !== $potentialMulti && $potentialMulti < $endIndex; + $index = $tokens->getNextTokenOfKind($startIndex, [[T_STRING], [T_NS_SEPARATOR]]); + $imports = []; + + while (null !== $index && $index <= $endIndex) { + $qualifiedName = $this->getNearestQualifiedName($tokens, $index); + $token = $tokens[$qualifiedName['afterIndex']]; + + if ($token->isGivenKind(CT::T_GROUP_IMPORT_BRACE_OPEN)) { + $groupStart = $groupIndex = $qualifiedName['afterIndex']; + $groupEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_GROUP_IMPORT_BRACE, $groupStart); + + while ($groupIndex < $groupEnd) { + $chunkStart = $tokens->getNextMeaningfulToken($groupIndex); + + // Finish parsing on trailing comma (no more chunks there) + if ($tokens[$chunkStart]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_CLOSE)) { + break; + } + + $groupQualifiedName = $this->getNearestQualifiedName($tokens, $chunkStart); + $imports[] = new NamespaceUseAnalysis( + $type, + $qualifiedName['fullName'].$groupQualifiedName['fullName'], // @phpstan-ignore argument.type + $groupQualifiedName['shortName'], + $groupQualifiedName['aliased'], + true, + $startIndex, + $endIndex, + $chunkStart, + $tokens->getPrevMeaningfulToken($groupQualifiedName['afterIndex']) + ); + + $groupIndex = $groupQualifiedName['afterIndex']; + } - $type = NamespaceUseAnalysis::TYPE_CLASS; - for ($i = $startIndex; $i <= $endIndex; ++$i) { - $token = $tokens[$i]; - if ($token->equals(',') || $token->isGivenKind(CT::T_GROUP_IMPORT_BRACE_CLOSE)) { - // do not touch group use declarations until the logic of this is added (for example: `use some\a\{ClassD};`) - // ignore multiple use statements that should be split into few separate statements (for example: `use BarB, BarC as C;`) - return null; - } + $index = $groupIndex; + } elseif ($token->equalsAny([',', ';', [T_CLOSE_TAG]])) { + $previousToken = $tokens->getPrevMeaningfulToken($qualifiedName['afterIndex']); + + if (!$tokens[$previousToken]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_CLOSE)) { + $imports[] = new NamespaceUseAnalysis( + $type, + $qualifiedName['fullName'], + $qualifiedName['shortName'], + $qualifiedName['aliased'], + $multi, + $startIndex, + $endIndex, + $multi ? $index : null, + $multi ? $previousToken : null + ); + } - if ($token->isGivenKind(CT::T_FUNCTION_IMPORT)) { - $type = NamespaceUseAnalysis::TYPE_FUNCTION; - } elseif ($token->isGivenKind(CT::T_CONST_IMPORT)) { - $type = NamespaceUseAnalysis::TYPE_CONSTANT; + $index = $qualifiedName['afterIndex']; } - if ($token->isWhitespace() || $token->isComment() || $token->isGivenKind(T_USE)) { - continue; - } + $index = $tokens->getNextMeaningfulToken($index); + } + + return $imports; + } + + /** + * @return NamespaceUseAnalysis::TYPE_* + */ + private function determineImportType(Tokens $tokens, int $startIndex): int + { + $potentialType = $tokens[$tokens->getNextMeaningfulToken($startIndex)]; + + if ($potentialType->isGivenKind(CT::T_FUNCTION_IMPORT)) { + return NamespaceUseAnalysis::TYPE_FUNCTION; + } + + if ($potentialType->isGivenKind(CT::T_CONST_IMPORT)) { + return NamespaceUseAnalysis::TYPE_CONSTANT; + } + + return NamespaceUseAnalysis::TYPE_CLASS; + } + + /** + * @return array{fullName: class-string, shortName: string, aliased: bool, afterIndex: int} + */ + private function getNearestQualifiedName(Tokens $tokens, int $index): array + { + $fullName = $shortName = ''; + $aliased = false; + + while (null !== $index) { + $token = $tokens[$index]; if ($token->isGivenKind(T_STRING)) { $shortName = $token->getContent(); @@ -106,16 +190,27 @@ private function parseDeclaration(Tokens $tokens, int $startIndex, int $endIndex $fullName .= $token->getContent(); } elseif ($token->isGivenKind(T_AS)) { $aliased = true; + } elseif ($token->equalsAny([ + ',', + ';', + [CT::T_GROUP_IMPORT_BRACE_OPEN], + [CT::T_GROUP_IMPORT_BRACE_CLOSE], + [T_CLOSE_TAG], + ])) { + break; } + + $index = $tokens->getNextMeaningfulToken($index); } - return new NamespaceUseAnalysis( - trim($fullName), - $shortName, - $aliased, - $startIndex, - $endIndex, - $type - ); + /** @var class-string $fqn */ + $fqn = $fullName; + + return [ + 'fullName' => $fqn, + 'shortName' => $shortName, + 'aliased' => $aliased, + 'afterIndex' => $index, + ]; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespacesAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespacesAnalyzer.php index 3890523a..ed1dacd4 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespacesAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespacesAnalyzer.php @@ -15,6 +15,7 @@ namespace PhpCsFixer\Tokenizer\Analyzer; use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; use PhpCsFixer\Tokenizer\Tokens; /** @@ -64,8 +65,15 @@ public function getDeclarations(Tokens $tokens): array $index = $scopeEndIndex; } - if (0 === \count($namespaces)) { - $namespaces[] = new NamespaceAnalysis('', '', 0, 0, 0, \count($tokens) - 1); + if (0 === \count($namespaces) && $tokens->isTokenKindFound(T_OPEN_TAG)) { + $namespaces[] = new NamespaceAnalysis( + '', + '', + $openTagIndex = $tokens[0]->isGivenKind(T_INLINE_HTML) ? 1 : 0, + $openTagIndex, + $openTagIndex, + \count($tokens) - 1, + ); } return $namespaces; @@ -74,7 +82,7 @@ public function getDeclarations(Tokens $tokens): array public function getNamespaceAt(Tokens $tokens, int $index): NamespaceAnalysis { if (!$tokens->offsetExists($index)) { - throw new \InvalidArgumentException(sprintf('Token index %d does not exist.', $index)); + throw new \InvalidArgumentException(\sprintf('Token index %d does not exist.', $index)); } foreach ($this->getDeclarations($tokens) as $namespace) { @@ -83,6 +91,26 @@ public function getNamespaceAt(Tokens $tokens, int $index): NamespaceAnalysis } } - throw new \LogicException(sprintf('Unable to get the namespace at index %d.', $index)); + throw new \LogicException(\sprintf('Unable to get the namespace at index %d.', $index)); + } + + /** + * @return array{NamespaceAnalysis, array} + */ + public static function collectNamespaceAnalysis(Tokens $tokens, int $startIndex): array + { + $namespaceAnalysis = (new self())->getNamespaceAt($tokens, $startIndex); + $namespaceUseAnalyses = (new NamespaceUsesAnalyzer())->getDeclarationsInNamespace($tokens, $namespaceAnalysis); + + $uses = []; + foreach ($namespaceUseAnalyses as $use) { + if (!$use->isClass()) { + continue; + } + + $uses[$use->getShortName()] = $use; + } + + return [$namespaceAnalysis, $uses]; } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/SwitchAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/SwitchAnalyzer.php new file mode 100644 index 00000000..fce1f9e3 --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/SwitchAnalyzer.php @@ -0,0 +1,69 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Tokenizer\Analyzer; + +use PhpCsFixer\Tokenizer\Analyzer\Analysis\SwitchAnalysis; +use PhpCsFixer\Tokenizer\Tokens; + +/** + * @internal + */ +final class SwitchAnalyzer +{ + /** @var array> */ + private static array $cache = []; + + public static function belongsToSwitch(Tokens $tokens, int $index): bool + { + if (!$tokens[$index]->equals(':')) { + return false; + } + + $tokensHash = md5(serialize($tokens->toArray())); + + if (!\array_key_exists($tokensHash, self::$cache)) { + self::$cache[$tokensHash] = self::getColonIndicesForSwitch(clone $tokens); + } + + return \in_array($index, self::$cache[$tokensHash], true); + } + + /** + * @return list + */ + private static function getColonIndicesForSwitch(Tokens $tokens): array + { + $colonIndices = []; + + /** @var SwitchAnalysis $analysis */ + foreach (ControlCaseStructuresAnalyzer::findControlStructures($tokens, [T_SWITCH]) as $analysis) { + if ($tokens[$analysis->getOpenIndex()]->equals(':')) { + $colonIndices[] = $analysis->getOpenIndex(); + } + + foreach ($analysis->getCases() as $case) { + $colonIndices[] = $case->getColonIndex(); + } + + $defaultAnalysis = $analysis->getDefaultAnalysis(); + + if (null !== $defaultAnalysis) { + $colonIndices[] = $defaultAnalysis->getColonIndex(); + } + } + + return $colonIndices; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CT.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CT.php index b6451524..eefe46d3 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CT.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CT.php @@ -19,61 +19,67 @@ */ final class CT { - public const T_ARRAY_INDEX_CURLY_BRACE_CLOSE = 10001; - public const T_ARRAY_INDEX_CURLY_BRACE_OPEN = 10002; - public const T_ARRAY_SQUARE_BRACE_CLOSE = 10003; - public const T_ARRAY_SQUARE_BRACE_OPEN = 10004; - public const T_ARRAY_TYPEHINT = 10005; - public const T_BRACE_CLASS_INSTANTIATION_CLOSE = 10006; - public const T_BRACE_CLASS_INSTANTIATION_OPEN = 10007; - public const T_CLASS_CONSTANT = 10008; - public const T_CONST_IMPORT = 10009; - public const T_CURLY_CLOSE = 10010; - public const T_DESTRUCTURING_SQUARE_BRACE_CLOSE = 10011; - public const T_DESTRUCTURING_SQUARE_BRACE_OPEN = 10012; - public const T_DOLLAR_CLOSE_CURLY_BRACES = 10013; - public const T_DYNAMIC_PROP_BRACE_CLOSE = 10014; - public const T_DYNAMIC_PROP_BRACE_OPEN = 10015; - public const T_DYNAMIC_VAR_BRACE_CLOSE = 10016; - public const T_DYNAMIC_VAR_BRACE_OPEN = 10017; - public const T_FUNCTION_IMPORT = 10018; - public const T_GROUP_IMPORT_BRACE_CLOSE = 10019; - public const T_GROUP_IMPORT_BRACE_OPEN = 10020; - public const T_NAMESPACE_OPERATOR = 10021; - public const T_NULLABLE_TYPE = 10022; - public const T_RETURN_REF = 10023; - public const T_TYPE_ALTERNATION = 10024; - public const T_TYPE_COLON = 10025; - public const T_USE_LAMBDA = 10026; - public const T_USE_TRAIT = 10027; - public const T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC = 10028; - public const T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED = 10029; - public const T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE = 10030; - public const T_ATTRIBUTE_CLOSE = 10031; - public const T_NAMED_ARGUMENT_NAME = 10032; - public const T_NAMED_ARGUMENT_COLON = 10033; - public const T_FIRST_CLASS_CALLABLE = 10034; - public const T_TYPE_INTERSECTION = 10035; - public const T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN = 10036; - public const T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE = 10037; + public const T_ARRAY_INDEX_CURLY_BRACE_CLOSE = 10_001; + public const T_ARRAY_INDEX_CURLY_BRACE_OPEN = 10_002; + public const T_ARRAY_SQUARE_BRACE_CLOSE = 10_003; + public const T_ARRAY_SQUARE_BRACE_OPEN = 10_004; + public const T_ARRAY_TYPEHINT = 10_005; + public const T_BRACE_CLASS_INSTANTIATION_CLOSE = 10_006; + public const T_BRACE_CLASS_INSTANTIATION_OPEN = 10_007; + public const T_CLASS_CONSTANT = 10_008; + public const T_CONST_IMPORT = 10_009; + public const T_CURLY_CLOSE = 10_010; + public const T_DESTRUCTURING_SQUARE_BRACE_CLOSE = 10_011; + public const T_DESTRUCTURING_SQUARE_BRACE_OPEN = 10_012; + public const T_DOLLAR_CLOSE_CURLY_BRACES = 10_013; + public const T_DYNAMIC_PROP_BRACE_CLOSE = 10_014; + public const T_DYNAMIC_PROP_BRACE_OPEN = 10_015; + public const T_DYNAMIC_VAR_BRACE_CLOSE = 10_016; + public const T_DYNAMIC_VAR_BRACE_OPEN = 10_017; + public const T_FUNCTION_IMPORT = 10_018; + public const T_GROUP_IMPORT_BRACE_CLOSE = 10_019; + public const T_GROUP_IMPORT_BRACE_OPEN = 10_020; + public const T_NAMESPACE_OPERATOR = 10_021; + public const T_NULLABLE_TYPE = 10_022; + public const T_RETURN_REF = 10_023; + public const T_TYPE_ALTERNATION = 10_024; + public const T_TYPE_COLON = 10_025; + public const T_USE_LAMBDA = 10_026; + public const T_USE_TRAIT = 10_027; + public const T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC = 10_028; + public const T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED = 10_029; + public const T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE = 10_030; + public const T_ATTRIBUTE_CLOSE = 10_031; + public const T_NAMED_ARGUMENT_NAME = 10_032; + public const T_NAMED_ARGUMENT_COLON = 10_033; + public const T_FIRST_CLASS_CALLABLE = 10_034; + public const T_TYPE_INTERSECTION = 10_035; + public const T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN = 10_036; + public const T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE = 10_037; + public const T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_OPEN = 10_038; + public const T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_CLOSE = 10_039; + public const T_PROPERTY_HOOK_BRACE_OPEN = 10_040; + public const T_PROPERTY_HOOK_BRACE_CLOSE = 10_041; - private function __construct() - { - } + private function __construct() {} /** * Get name for custom token. * * @param int $value custom token value + * + * @return non-empty-string */ public static function getName(int $value): string { if (!self::has($value)) { - throw new \InvalidArgumentException(sprintf('No custom token was found for "%s".', $value)); + throw new \InvalidArgumentException(\sprintf('No custom token was found for "%s".', $value)); } $tokens = self::getMapById(); + \assert(isset($tokens[$value])); + return 'CT::'.$tokens[$value]; } @@ -90,14 +96,14 @@ public static function has(int $value): bool } /** - * @return array + * @return array */ private static function getMapById(): array { static $constants; if (null === $constants) { - $reflection = new \ReflectionClass(__CLASS__); + $reflection = new \ReflectionClass(self::class); $constants = array_flip($reflection->getConstants()); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CodeHasher.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CodeHasher.php index ec316615..86a4a68a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CodeHasher.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CodeHasher.php @@ -28,6 +28,8 @@ private function __construct() /** * Calculate hash for code. + * + * @return non-empty-string */ public static function calculateCodeHash(string $code): string { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Processor/ImportProcessor.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Processor/ImportProcessor.php new file mode 100644 index 00000000..46bfe06e --- /dev/null +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Processor/ImportProcessor.php @@ -0,0 +1,103 @@ + + * Dariusz Rumiński + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace PhpCsFixer\Tokenizer\Processor; + +use PhpCsFixer\Tokenizer\CT; +use PhpCsFixer\Tokenizer\Token; +use PhpCsFixer\Tokenizer\Tokens; +use PhpCsFixer\WhitespacesFixerConfig; + +/** + * @author Greg Korba + * + * @readonly + */ +final class ImportProcessor +{ + private WhitespacesFixerConfig $whitespacesConfig; + + public function __construct(WhitespacesFixerConfig $whitespacesConfig) + { + $this->whitespacesConfig = $whitespacesConfig; + } + + /** + * @param array{ + * const?: array, + * class?: array, + * function?: array + * } $imports + */ + public function insertImports(Tokens $tokens, array $imports, int $atIndex): void + { + $lineEnding = $this->whitespacesConfig->getLineEnding(); + + if (!$tokens[$atIndex]->isWhitespace() || !str_contains($tokens[$atIndex]->getContent(), "\n")) { + $tokens->insertAt($atIndex, new Token([T_WHITESPACE, $lineEnding])); + } + + foreach ($imports as $type => $typeImports) { + sort($typeImports); + + $items = []; + + foreach ($typeImports as $name) { + $items = array_merge($items, [ + new Token([T_WHITESPACE, $lineEnding]), + new Token([T_USE, 'use']), + new Token([T_WHITESPACE, ' ']), + ]); + + if ('const' === $type) { + $items[] = new Token([CT::T_CONST_IMPORT, 'const']); + $items[] = new Token([T_WHITESPACE, ' ']); + } elseif ('function' === $type) { + $items[] = new Token([CT::T_FUNCTION_IMPORT, 'function']); + $items[] = new Token([T_WHITESPACE, ' ']); + } + + $items = array_merge($items, self::tokenizeName($name)); + $items[] = new Token(';'); + } + + $tokens->insertAt($atIndex, $items); + } + } + + /** + * @param class-string $name + * + * @return list + */ + public static function tokenizeName(string $name): array + { + $parts = explode('\\', $name); + $newTokens = []; + + if ('' === $parts[0]) { + $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); + array_shift($parts); + } + + foreach ($parts as $part) { + $newTokens[] = new Token([T_STRING, $part]); + $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); + } + + array_pop($newTokens); + + return $newTokens; + } +} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Token.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Token.php index 0c5e8de6..57ad192d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Token.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Token.php @@ -14,11 +14,15 @@ namespace PhpCsFixer\Tokenizer; +use PhpCsFixer\Utils; + /** * Representation of single token. * As a token prototype you should understand a single element generated by token_get_all. * * @author Dariusz Rumiński + * + * @readonly */ final class Token { @@ -30,18 +34,13 @@ final class Token /** * ID of token prototype, if available. */ - private ?int $id = null; + private ?int $id; /** * If token prototype is an array. */ private bool $isArray; - /** - * Flag is token was changed. - */ - private bool $changed = false; - /** * @param array{int, string}|string $token token prototype */ @@ -49,14 +48,14 @@ public function __construct($token) { if (\is_array($token)) { if (!\is_int($token[0])) { - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException(\sprintf( 'Id must be an int, got "%s".', get_debug_type($token[0]) )); } if (!\is_string($token[1])) { - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException(\sprintf( 'Content must be a string, got "%s".', get_debug_type($token[1]) )); @@ -71,9 +70,10 @@ public function __construct($token) $this->content = $token[1]; } elseif (\is_string($token)) { $this->isArray = false; + $this->id = null; $this->content = $token; } else { - throw new \InvalidArgumentException(sprintf('Cannot recognize input value as valid Token prototype, got "%s".', get_debug_type($token))); + throw new \InvalidArgumentException(\sprintf('Cannot recognize input value as valid Token prototype, got "%s".', get_debug_type($token))); } } @@ -136,7 +136,7 @@ public static function getObjectOperatorKinds(): array */ public function equals($other, bool $caseSensitive = true): bool { - if (\defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG')) { // @TODO: drop condition with new MAJOR release 4.0 + if (\defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG')) { // @TODO: drop condition when PHP 8.1+ is required if ('&' === $other) { return '&' === $this->content && (null === $this->id || $this->isGivenKind([T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG, T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG])); } @@ -186,12 +186,7 @@ public function equals($other, bool $caseSensitive = true): bool // detect unknown keys unset($otherPrototype[0], $otherPrototype[1]); - /* - * @phpstan-ignore-next-line This validation is required when the method - * is called in a codebase that does not use - * static analysis. - */ - return empty($otherPrototype); + return [] === $otherPrototype; } /** @@ -214,13 +209,20 @@ public function equalsAny(array $others, bool $caseSensitive = true): bool /** * A helper method used to find out whether a certain input token has to be case-sensitively matched. * - * @param bool|list $caseSensitive global case sensitiveness or an array of booleans, whose keys should match - * the ones used in $sequence. If any is missing, the default case-sensitive - * comparison is used - * @param int $key the key of the token that has to be looked up + * @param array|bool $caseSensitive global case sensitiveness or an array of booleans, whose keys should match + * the ones used in $sequence. If any is missing, the default case-sensitive + * comparison is used + * @param int $key the key of the token that has to be looked up + * + * @deprecated */ public static function isKeyCaseSensitive($caseSensitive, int $key): bool { + Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( + 'Method "%s" is deprecated and will be removed in the next major version.', + __METHOD__ + ))); + if (\is_array($caseSensitive)) { return $caseSensitive[$key] ?? true; } @@ -229,7 +231,7 @@ public static function isKeyCaseSensitive($caseSensitive, int $key): bool } /** - * @return array{int, string}|string + * @return array{int, non-empty-string}|string */ public function getPrototype() { @@ -237,6 +239,8 @@ public function getPrototype() return $this->content; } + \assert('' !== $this->content); + return [ $this->id, $this->content, @@ -268,7 +272,7 @@ public function getId(): ?int * * It shall be used only for getting the name of token, not for checking it against excepted value. * - * @return null|string token name + * @return null|non-empty-string token name */ public function getName(): ?string { @@ -284,7 +288,7 @@ public function getName(): ?string * * It shall be used only for getting the name of token, not for checking it against excepted value. * - * @return null|string token name + * @return null|non-empty-string token name */ public static function getNameForId(int $id): ?string { @@ -300,7 +304,7 @@ public static function getNameForId(int $id): ?string /** * Generate array containing all keywords that exists in PHP version in use. * - * @return array + * @return list */ public static function getKeywords(): array { @@ -356,6 +360,9 @@ public static function getMagicConstants(): array * Check if token prototype is an array. * * @return bool is array + * + * @phpstan-assert-if-true !=null $this->getId() + * @phpstan-assert-if-true !='' $this->getContent() */ public function isArray(): bool { @@ -364,6 +371,8 @@ public function isArray(): bool /** * Check if token is one of type cast tokens. + * + * @phpstan-assert-if-true !='' $this->getContent() */ public function isCast(): bool { @@ -372,6 +381,8 @@ public function isCast(): bool /** * Check if token is one of classy tokens: T_CLASS, T_INTERFACE, T_TRAIT or T_ENUM. + * + * @phpstan-assert-if-true !='' $this->getContent() */ public function isClassy(): bool { @@ -380,6 +391,8 @@ public function isClassy(): bool /** * Check if token is one of comment tokens: T_COMMENT or T_DOC_COMMENT. + * + * @phpstan-assert-if-true !='' $this->getContent() */ public function isComment(): bool { @@ -390,6 +403,8 @@ public function isComment(): bool /** * Check if token is one of object operator tokens: T_OBJECT_OPERATOR or T_NULLSAFE_OBJECT_OPERATOR. + * + * @phpstan-assert-if-true !='' $this->getContent() */ public function isObjectOperator(): bool { @@ -400,6 +415,8 @@ public function isObjectOperator(): bool * Check if token is one of given kind. * * @param int|list $possibleKind kind or array of kinds + * + * @phpstan-assert-if-true !='' $this->getContent() */ public function isGivenKind($possibleKind): bool { @@ -408,16 +425,20 @@ public function isGivenKind($possibleKind): bool /** * Check if token is a keyword. + * + * @phpstan-assert-if-true !='' $this->getContent() */ public function isKeyword(): bool { - $keywords = static::getKeywords(); + $keywords = self::getKeywords(); return $this->isArray && isset($keywords[$this->id]); } /** * Check if token is a native PHP constant: true, false or null. + * + * @phpstan-assert-if-true !='' $this->getContent() */ public function isNativeConstant(): bool { @@ -429,11 +450,13 @@ public function isNativeConstant(): bool /** * Returns if the token is of a Magic constants type. * + * @phpstan-assert-if-true !='' $this->getContent() + * * @see https://php.net/manual/en/language.constants.predefined.php */ public function isMagicConstant(): bool { - $magicConstants = static::getMagicConstants(); + $magicConstants = self::getMagicConstants(); return $this->isArray && isset($magicConstants[$this->id]); } @@ -459,7 +482,7 @@ public function isWhitespace(?string $whitespaces = " \t\n\r\0\x0B"): bool /** * @return array{ * id: int|null, - * name: string|null, + * name: non-empty-string|null, * content: string, * isArray: bool, * changed: bool, @@ -472,10 +495,13 @@ public function toArray(): array 'name' => $this->getName(), 'content' => $this->content, 'isArray' => $this->isArray, - 'changed' => $this->changed, + 'changed' => false, // @TODO v4: remove index ]; } + /** + * @return non-empty-string + */ public function toJson(): string { $jsonResult = json_encode($this->toArray(), JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK); @@ -490,6 +516,8 @@ public function toJson(): string ); } + \assert(false !== $jsonResult); + return $jsonResult; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Tokens.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Tokens.php index 366c4a27..62d55672 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Tokens.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Tokens.php @@ -14,7 +14,11 @@ namespace PhpCsFixer\Tokenizer; +use PhpCsFixer\Console\Application; use PhpCsFixer\Preg; +use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; +use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; +use PhpCsFixer\Utils; /** * Collection of code tokens. @@ -45,11 +49,14 @@ class Tokens extends \SplFixedArray public const BLOCK_TYPE_BRACE_CLASS_INSTANTIATION = 10; public const BLOCK_TYPE_ATTRIBUTE = 11; public const BLOCK_TYPE_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS = 12; + public const BLOCK_TYPE_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE = 13; + public const BLOCK_TYPE_COMPLEX_STRING_VARIABLE = 14; + public const BLOCK_TYPE_PROPERTY_HOOK = 15; /** * Static class cache. * - * @var array + * @var array */ private static array $cache = []; @@ -69,6 +76,8 @@ class Tokens extends \SplFixedArray /** * A MD5 hash of the code string. + * + * @var ?non-empty-string */ private ?string $codeHash = null; @@ -84,12 +93,17 @@ class Tokens extends \SplFixedArray * * When the token kind is present in this set it means that given token kind * was ever seen inside the collection (but may not be part of it any longer). - * The key is token kind and the value is always true. + * The key is token kind and the value is the number of occurrences. * - * @var array + * @var array> */ private array $foundTokenKinds = []; + /** + * @var null|list + */ + private ?array $namespaceDeclarations = null; + /** * Clone tokens collection. */ @@ -103,7 +117,7 @@ public function __clone() /** * Clear cache - one position or all of them. * - * @param null|string $key position to clear, when null clear all + * @param null|non-empty-string $key position to clear, when null clear all */ public static function clearCache(?string $key = null): void { @@ -119,42 +133,51 @@ public static function clearCache(?string $key = null): void /** * Detect type of block. * - * @param Token $token token - * * @return null|array{type: self::BLOCK_TYPE_*, isStart: bool} */ public static function detectBlockType(Token $token): ?array { - foreach (self::getBlockEdgeDefinitions() as $type => $definition) { - if ($token->equals($definition['start'])) { - return ['type' => $type, 'isStart' => true]; - } - - if ($token->equals($definition['end'])) { - return ['type' => $type, 'isStart' => false]; + static $blockEdgeKinds = null; + + if (null === $blockEdgeKinds) { + $blockEdgeKinds = []; + foreach (self::getBlockEdgeDefinitions() as $type => $definition) { + $blockEdgeKinds[ + \is_string($definition['start']) ? $definition['start'] : $definition['start'][0] + ] = ['type' => $type, 'isStart' => true]; + $blockEdgeKinds[ + \is_string($definition['end']) ? $definition['end'] : $definition['end'][0] + ] = ['type' => $type, 'isStart' => false]; } } - return null; + // inlined extractTokenKind() call on the hot path + $tokenKind = $token->isArray() ? $token->getId() : $token->getContent(); + + return $blockEdgeKinds[$tokenKind] ?? null; } /** * Create token collection from array. * - * @param Token[] $array the array to import - * @param ?bool $saveIndices save the numeric indices used in the original array, default is yes + * @param array $array the array to import + * @param ?bool $saveIndices save the numeric indices used in the original array, default is yes */ public static function fromArray($array, $saveIndices = null): self { $tokens = new self(\count($array)); - if ($saveIndices ?? true) { + if (false !== $saveIndices && !array_is_list($array)) { + Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( + 'Parameter "array" should be a list. This will be enforced in version %d.0.', + Application::getMajorVersion() + 1 + ))); + foreach ($array as $key => $val) { $tokens[$key] = $val; } } else { $index = 0; - foreach ($array as $val) { $tokens[$index++] = $val; } @@ -197,63 +220,78 @@ public static function fromCode(string $code): self } /** - * @return array> + * @return array */ public static function getBlockEdgeDefinitions(): array { - $definitions = [ - self::BLOCK_TYPE_CURLY_BRACE => [ - 'start' => '{', - 'end' => '}', - ], - self::BLOCK_TYPE_PARENTHESIS_BRACE => [ - 'start' => '(', - 'end' => ')', - ], - self::BLOCK_TYPE_INDEX_SQUARE_BRACE => [ - 'start' => '[', - 'end' => ']', - ], - self::BLOCK_TYPE_ARRAY_SQUARE_BRACE => [ - 'start' => [CT::T_ARRAY_SQUARE_BRACE_OPEN, '['], - 'end' => [CT::T_ARRAY_SQUARE_BRACE_CLOSE, ']'], - ], - self::BLOCK_TYPE_DYNAMIC_PROP_BRACE => [ - 'start' => [CT::T_DYNAMIC_PROP_BRACE_OPEN, '{'], - 'end' => [CT::T_DYNAMIC_PROP_BRACE_CLOSE, '}'], - ], - self::BLOCK_TYPE_DYNAMIC_VAR_BRACE => [ - 'start' => [CT::T_DYNAMIC_VAR_BRACE_OPEN, '{'], - 'end' => [CT::T_DYNAMIC_VAR_BRACE_CLOSE, '}'], - ], - self::BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE => [ - 'start' => [CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN, '{'], - 'end' => [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE, '}'], - ], - self::BLOCK_TYPE_GROUP_IMPORT_BRACE => [ - 'start' => [CT::T_GROUP_IMPORT_BRACE_OPEN, '{'], - 'end' => [CT::T_GROUP_IMPORT_BRACE_CLOSE, '}'], - ], - self::BLOCK_TYPE_DESTRUCTURING_SQUARE_BRACE => [ - 'start' => [CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN, '['], - 'end' => [CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE, ']'], - ], - self::BLOCK_TYPE_BRACE_CLASS_INSTANTIATION => [ - 'start' => [CT::T_BRACE_CLASS_INSTANTIATION_OPEN, '('], - 'end' => [CT::T_BRACE_CLASS_INSTANTIATION_CLOSE, ')'], - ], - self::BLOCK_TYPE_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS => [ - 'start' => [CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, '('], - 'end' => [CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, ')'], - ], - ]; - - // @TODO: drop condition when PHP 8.0+ is required - if (\defined('T_ATTRIBUTE')) { - $definitions[self::BLOCK_TYPE_ATTRIBUTE] = [ - 'start' => [T_ATTRIBUTE, '#['], - 'end' => [CT::T_ATTRIBUTE_CLOSE, ']'], + static $definitions = null; + if (null === $definitions) { + $definitions = [ + self::BLOCK_TYPE_CURLY_BRACE => [ + 'start' => '{', + 'end' => '}', + ], + self::BLOCK_TYPE_PARENTHESIS_BRACE => [ + 'start' => '(', + 'end' => ')', + ], + self::BLOCK_TYPE_INDEX_SQUARE_BRACE => [ + 'start' => '[', + 'end' => ']', + ], + self::BLOCK_TYPE_ARRAY_SQUARE_BRACE => [ + 'start' => [CT::T_ARRAY_SQUARE_BRACE_OPEN, '['], + 'end' => [CT::T_ARRAY_SQUARE_BRACE_CLOSE, ']'], + ], + self::BLOCK_TYPE_DYNAMIC_PROP_BRACE => [ + 'start' => [CT::T_DYNAMIC_PROP_BRACE_OPEN, '{'], + 'end' => [CT::T_DYNAMIC_PROP_BRACE_CLOSE, '}'], + ], + self::BLOCK_TYPE_DYNAMIC_VAR_BRACE => [ + 'start' => [CT::T_DYNAMIC_VAR_BRACE_OPEN, '{'], + 'end' => [CT::T_DYNAMIC_VAR_BRACE_CLOSE, '}'], + ], + self::BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE => [ + 'start' => [CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN, '{'], + 'end' => [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE, '}'], + ], + self::BLOCK_TYPE_GROUP_IMPORT_BRACE => [ + 'start' => [CT::T_GROUP_IMPORT_BRACE_OPEN, '{'], + 'end' => [CT::T_GROUP_IMPORT_BRACE_CLOSE, '}'], + ], + self::BLOCK_TYPE_DESTRUCTURING_SQUARE_BRACE => [ + 'start' => [CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN, '['], + 'end' => [CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE, ']'], + ], + self::BLOCK_TYPE_BRACE_CLASS_INSTANTIATION => [ + 'start' => [CT::T_BRACE_CLASS_INSTANTIATION_OPEN, '('], + 'end' => [CT::T_BRACE_CLASS_INSTANTIATION_CLOSE, ')'], + ], + self::BLOCK_TYPE_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS => [ + 'start' => [CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, '('], + 'end' => [CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, ')'], + ], + self::BLOCK_TYPE_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE => [ + 'start' => [CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_OPEN, '{'], + 'end' => [CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_CLOSE, '}'], + ], + self::BLOCK_TYPE_COMPLEX_STRING_VARIABLE => [ + 'start' => [T_DOLLAR_OPEN_CURLY_BRACES, '${'], + 'end' => [CT::T_DOLLAR_CLOSE_CURLY_BRACES, '}'], + ], + self::BLOCK_TYPE_PROPERTY_HOOK => [ + 'start' => [CT::T_PROPERTY_HOOK_BRACE_OPEN, '{'], + 'end' => [CT::T_PROPERTY_HOOK_BRACE_CLOSE, '}'], + ], ]; + + // @TODO: drop condition when PHP 8.0+ is required + if (\defined('T_ATTRIBUTE')) { + $definitions[self::BLOCK_TYPE_ATTRIBUTE] = [ + 'start' => [T_ATTRIBUTE, '#['], + 'end' => [CT::T_ATTRIBUTE_CLOSE, ']'], + ]; + } } return $definitions; @@ -264,15 +302,10 @@ public static function getBlockEdgeDefinitions(): array * * @param int $size */ + #[\ReturnTypeWillChange] public function setSize($size): bool { - if ($this->getSize() !== $size) { - $this->changed = true; - - return parent::setSize($size); - } - - return true; + throw new \RuntimeException('Changing tokens collection size explicitly is not allowed.'); } /** @@ -282,8 +315,26 @@ public function setSize($size): bool */ public function offsetUnset($index): void { - $this->changed = true; - $this->unregisterFoundToken($this[$index]); + if (\count($this) - 1 !== $index) { + Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( + 'Tokens should be a list - only the last index can be unset. This will be enforced in version %d.0.', + Application::getMajorVersion() + 1 + ))); + } + + if (isset($this[$index])) { + if (isset($this->blockStartCache[$index])) { + unset($this->blockEndCache[$this->blockStartCache[$index]], $this->blockStartCache[$index]); + } + if (isset($this->blockEndCache[$index])) { + unset($this->blockStartCache[$this->blockEndCache[$index]], $this->blockEndCache[$index]); + } + + $this->unregisterFoundToken($this[$index]); + + $this->changed = true; + $this->namespaceDeclarations = null; + } parent::offsetUnset($index); } @@ -298,16 +349,30 @@ public function offsetUnset($index): void */ public function offsetSet($index, $newval): void { - $this->blockStartCache = []; - $this->blockEndCache = []; + if (0 > $index || \count($this) <= $index) { + Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( + 'Tokens should be a list - index must be within the existing range. This will be enforced in version %d.0.', + Application::getMajorVersion() + 1 + ))); + } - if (!isset($this[$index]) || !$this[$index]->equals($newval)) { - $this->changed = true; + if (isset($this[$index])) { + if (isset($this->blockStartCache[$index])) { + unset($this->blockEndCache[$this->blockStartCache[$index]], $this->blockStartCache[$index]); + } + if (isset($this->blockEndCache[$index])) { + unset($this->blockStartCache[$this->blockEndCache[$index]], $this->blockEndCache[$index]); + } + } + if (!isset($this[$index]) || !$this[$index]->equals($newval)) { if (isset($this[$index])) { $this->unregisterFoundToken($this[$index]); } + $this->changed = true; + $this->namespaceDeclarations = null; + $this->registerFoundToken($newval); } @@ -329,7 +394,12 @@ public function clearChanged(): void */ public function clearEmptyTokens(): void { - $limit = $this->count(); + // no empty token found, therefore there is no need to override collection + if (!$this->isTokenKindFound('')) { + return; + } + + $limit = \count($this); for ($index = 0; $index < $limit; ++$index) { if ($this->isEmptyAt($index)) { @@ -337,23 +407,36 @@ public function clearEmptyTokens(): void } } - // no empty token found, therefore there is no need to override collection - if ($limit === $index) { - return; - } - for ($count = $index; $index < $limit; ++$index) { if (!$this->isEmptyAt($index)) { // use directly for speed, skip the register of token kinds found etc. - parent::offsetSet($count++, $this[$index]); + $buffer = $this[$count]; + parent::offsetSet($count, $this[$index]); + parent::offsetSet($index, $buffer); + + if (isset($this->blockStartCache[$index])) { + $otherEndIndex = $this->blockStartCache[$index]; + unset($this->blockStartCache[$index]); + $this->blockStartCache[$count] = $otherEndIndex; + $this->blockEndCache[$otherEndIndex] = $count; + } + + if (isset($this->blockEndCache[$index])) { + $otherEndIndex = $this->blockEndCache[$index]; + unset($this->blockEndCache[$index]); + $this->blockStartCache[$otherEndIndex] = $count; + $this->blockEndCache[$count] = $otherEndIndex; + } + + ++$count; } } - // we are moving the tokens, we need to clear the indices Cache - $this->blockStartCache = []; - $this->blockEndCache = []; + // we are moving the tokens, we need to clear the index-based Cache + $this->namespaceDeclarations = null; + $this->foundTokenKinds[''] = 0; - $this->setSize($count); + $this->updateSize($count); } /** @@ -422,7 +505,7 @@ public function ensureWhitespaceAtIndex(int $index, int $indexOffset, string $wh * @param self::BLOCK_TYPE_* $type type of block * @param int $searchIndex index of opening brace * - * @return int index of closing brace + * @return int<0, max> index of closing brace */ public function findBlockEnd(int $type, int $searchIndex): int { @@ -433,7 +516,7 @@ public function findBlockEnd(int $type, int $searchIndex): int * @param self::BLOCK_TYPE_* $type type of block * @param int $searchIndex index of closing brace * - * @return int index of opening brace + * @return int<0, max> index of opening brace */ public function findBlockStart(int $type, int $searchIndex): int { @@ -441,16 +524,16 @@ public function findBlockStart(int $type, int $searchIndex): int } /** - * @param int|list $possibleKind kind or array of kinds - * @param int $start optional offset - * @param null|int $end optional limit + * @param int|non-empty-list $possibleKind kind or array of kinds + * @param int $start optional offset + * @param null|int $end optional limit * - * @return array>|array + * @return ($possibleKind is int ? array, Token> : array, Token>>) */ public function findGivenKind($possibleKind, int $start = 0, ?int $end = null): array { if (null === $end) { - $end = $this->count(); + $end = \count($this); } $elements = []; @@ -525,9 +608,9 @@ public function getNextNonWhitespace(int $index, ?string $whitespaces = null): ? * * This method is shorthand for getTokenOfKindSibling method. * - * @param int $index token index + * @param int $index token index * @param list $tokens possible tokens - * @param bool $caseSensitive perform a case sensitive comparison + * @param bool $caseSensitive perform a case sensitive comparison */ public function getNextTokenOfKind(int $index, array $tokens = [], bool $caseSensitive = true): ?int { @@ -545,7 +628,6 @@ public function getNonWhitespaceSibling(int $index, int $direction, ?string $whi { while (true) { $index += $direction; - if (!$this->offsetExists($index)) { return null; } @@ -573,9 +655,9 @@ public function getPrevNonWhitespace(int $index, ?string $whitespaces = null): ? * Get index for closest previous token of given kind. * This method is shorthand for getTokenOfKindSibling method. * - * @param int $index token index + * @param int $index token index * @param list $tokens possible tokens - * @param bool $caseSensitive perform a case sensitive comparison + * @param bool $caseSensitive perform a case sensitive comparison */ public function getPrevTokenOfKind(int $index, array $tokens = [], bool $caseSensitive = true): ?int { @@ -585,16 +667,14 @@ public function getPrevTokenOfKind(int $index, array $tokens = [], bool $caseSen /** * Get index for closest sibling token of given kind. * - * @param int $index token index - * @param -1|1 $direction - * @param list $tokens possible tokens - * @param bool $caseSensitive perform a case sensitive comparison + * @param int $index token index + * @param -1|1 $direction + * @param list $tokens possible tokens + * @param bool $caseSensitive perform a case sensitive comparison */ public function getTokenOfKindSibling(int $index, int $direction, array $tokens = [], bool $caseSensitive = true): ?int { - $tokens = array_filter($tokens, function ($token): bool { - return $this->isTokenKindFound($this->extractTokenKind($token)); - }); + $tokens = array_filter($tokens, fn ($token): bool => $this->isTokenKindFound($this->extractTokenKind($token))); if (0 === \count($tokens)) { return null; @@ -602,7 +682,6 @@ public function getTokenOfKindSibling(int $index, int $direction, array $tokens while (true) { $index += $direction; - if (!$this->offsetExists($index)) { return null; } @@ -616,9 +695,9 @@ public function getTokenOfKindSibling(int $index, int $direction, array $tokens /** * Get index for closest sibling token not of given kind. * - * @param int $index token index - * @param -1|1 $direction - * @param list $tokens possible tokens + * @param int $index token index + * @param -1|1 $direction + * @param list $tokens possible tokens */ public function getTokenNotOfKindSibling(int $index, int $direction, array $tokens = []): ?int { @@ -670,7 +749,6 @@ public function getNonEmptySibling(int $index, int $direction): ?int { while (true) { $index += $direction; - if (!$this->offsetExists($index)) { return null; } @@ -704,14 +782,14 @@ public function getPrevMeaningfulToken(int $index): ?int /** * Find a sequence of meaningful tokens and returns the array of their locations. * - * @param list $sequence an array of token (kinds) - * @param int $start start index, defaulting to the start of the file - * @param null|int $end end index, defaulting to the end of the file - * @param array|bool $caseSensitive global case sensitiveness or a list of booleans, whose keys should match - * the ones used in $sequence. If any is missing, the default case-sensitive - * comparison is used + * @param non-empty-list $sequence an array of token (kinds) + * @param int $start start index, defaulting to the start of the file + * @param null|int $end end index, defaulting to the end of the file + * @param array|bool $caseSensitive global case sensitiveness or a list of booleans, whose keys should match + * the ones used in $sequence. If any is missing, the default case-sensitive + * comparison is used * - * @return null|array an array containing the tokens matching the sequence elements, indexed by their position + * @return null|non-empty-array, Token> an array containing the tokens matching the sequence elements, indexed by their position */ public function findSequence(array $sequence, int $start = 0, ?int $end = null, $caseSensitive = true): ?array { @@ -743,11 +821,11 @@ public function findSequence(array $sequence, int $start = 0, ?int $end = null, } if ($token->isGivenKind($nonMeaningFullKind)) { - throw new \InvalidArgumentException(sprintf('Non-meaningful token at position: "%s".', $key)); + throw new \InvalidArgumentException(\sprintf('Non-meaningful token at position: "%s".', $key)); } if ('' === $token->getContent()) { - throw new \InvalidArgumentException(sprintf('Non-meaningful (empty) token at position: "%s".', $key)); + throw new \InvalidArgumentException(\sprintf('Non-meaningful (empty) token at position: "%s".', $key)); } } @@ -759,10 +837,10 @@ public function findSequence(array $sequence, int $start = 0, ?int $end = null, // remove the first token from the sequence, so we can freely iterate through the sequence after a match to // the first one is found - $key = key($sequence); - $firstCs = Token::isKeyCaseSensitive($caseSensitive, $key); - $firstToken = $sequence[$key]; - unset($sequence[$key]); + $firstKey = array_key_first($sequence); + $firstCs = self::isKeyCaseSensitive($caseSensitive, $firstKey); + $firstToken = $sequence[$firstKey]; + unset($sequence[$firstKey]); // begin searching for the first token in the sequence (start included) $index = $start - 1; @@ -789,7 +867,7 @@ public function findSequence(array $sequence, int $start = 0, ?int $end = null, return null; } - if (!$this[$currIdx]->equals($token, Token::isKeyCaseSensitive($caseSensitive, $key))) { + if (!$this[$currIdx]->equals($token, self::isKeyCaseSensitive($caseSensitive, $key))) { // not a match, restart the outer loop continue 2; } @@ -852,16 +930,17 @@ public function insertSlices(array $slices): void $oldSize = \count($this); $this->changed = true; + $this->namespaceDeclarations = null; $this->blockStartCache = []; $this->blockEndCache = []; - $this->setSize($oldSize + $itemsCount); + $this->updateSize($oldSize + $itemsCount); krsort($slices); - $farthestSliceIndex = key($slices); + $farthestSliceIndex = array_key_first($slices); // We check only the farthest index, if it's within the size of collection, other indices will be valid too. if (!\is_int($farthestSliceIndex) || $farthestSliceIndex > $oldSize) { - throw new \OutOfBoundsException(sprintf('Cannot insert index "%s" outside of collection.', $farthestSliceIndex)); + throw new \OutOfBoundsException(\sprintf('Cannot insert index "%s" outside of collection.', $farthestSliceIndex)); } $previousSliceIndex = $oldSize; @@ -870,14 +949,14 @@ public function insertSlices(array $slices): void // that way we get around additional overhead this class adds with overridden offset* methods. foreach ($slices as $index => $slice) { if (!\is_int($index) || $index < 0) { - throw new \OutOfBoundsException(sprintf('Invalid index "%s".', $index)); + throw new \OutOfBoundsException(\sprintf('Invalid index "%s".', $index)); } $slice = \is_array($slice) || $slice instanceof self ? $slice : [$slice]; $sliceCount = \count($slice); for ($i = $previousSliceIndex - 1; $i >= $index; --$i) { - parent::offsetSet($i + $itemsCount, parent::offsetGet($i)); + parent::offsetSet($i + $itemsCount, $this[$i]); } $previousSliceIndex = $index; @@ -982,11 +1061,13 @@ public function setCode(string $code): void } // clear memory - $this->setSize(0); + $this->updateSize(0); + $this->blockStartCache = []; + $this->blockEndCache = []; $tokens = token_get_all($code, TOKEN_PARSE); - $this->setSize(\count($tokens)); + $this->updateSize(\count($tokens)); foreach ($tokens as $index => $token) { $this[$index] = new Token($token); @@ -994,18 +1075,13 @@ public function setCode(string $code): void $this->applyTransformers(); - $this->foundTokenKinds = []; - - foreach ($this as $token) { - $this->registerFoundToken($token); - } - if (\PHP_VERSION_ID < 8_00_00) { $this->rewind(); } $this->changeCodeHash(self::calculateCodeHash($code)); $this->changed = true; + $this->namespaceDeclarations = null; } public function toJson(): string @@ -1020,7 +1096,7 @@ public function toJson(): string $this->rewind(); } - return json_encode($output, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK); + return json_encode($output, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK); } /** @@ -1031,7 +1107,7 @@ public function toJson(): string public function isAllTokenKindsFound(array $tokenKinds): bool { foreach ($tokenKinds as $tokenKind) { - if (empty($this->foundTokenKinds[$tokenKind])) { + if (0 === ($this->foundTokenKinds[$tokenKind] ?? 0)) { return false; } } @@ -1047,7 +1123,7 @@ public function isAllTokenKindsFound(array $tokenKinds): bool public function isAnyTokenKindsFound(array $tokenKinds): bool { foreach ($tokenKinds as $tokenKind) { - if (!empty($this->foundTokenKinds[$tokenKind])) { + if (0 !== ($this->foundTokenKinds[$tokenKind] ?? 0)) { return true; } } @@ -1062,7 +1138,7 @@ public function isAnyTokenKindsFound(array $tokenKinds): bool */ public function isTokenKindFound($tokenKind): bool { - return !empty($this->foundTokenKinds[$tokenKind]); + return 0 !== ($this->foundTokenKinds[$tokenKind] ?? 0); } /** @@ -1091,19 +1167,12 @@ public function clearRange(int $indexStart, int $indexEnd): void */ public function isMonolithicPhp(): bool { - if (0 === $this->count()) { + if (1 !== ($this->countTokenKind(T_OPEN_TAG) + $this->countTokenKind(T_OPEN_TAG_WITH_ECHO))) { return false; } - if ($this->countTokenKind(T_INLINE_HTML) > 1) { - return false; - } - - if (1 === $this->countTokenKind(T_INLINE_HTML)) { - return 1 === Preg::match('/^#!.+$/', $this[0]->getContent()); - } - - return 1 === ($this->countTokenKind(T_OPEN_TAG) + $this->countTokenKind(T_OPEN_TAG_WITH_ECHO)); + return 0 === $this->countTokenKind(T_INLINE_HTML) + || (1 === $this->countTokenKind(T_INLINE_HTML) && Preg::match('/^#!.+$/', $this[0]->getContent())); } /** @@ -1159,6 +1228,20 @@ public function clearTokenAndMergeSurroundingWhitespace(int $index): void $this->clearAt($nextIndex); } + /** + * @internal This is performance-related workaround for lack of proper DI, may be removed at some point + * + * @return list + */ + public function getNamespaceDeclarations(): array + { + if (null === $this->namespaceDeclarations) { + $this->namespaceDeclarations = (new NamespacesAnalyzer())->getDeclarations($this); + } + + return $this->namespaceDeclarations; + } + /** * @internal */ @@ -1168,6 +1251,16 @@ protected function applyTransformers(): void $transformers->transform($this); } + private function updateSize(int $size): void + { + if (\count($this) !== $size) { + $this->changed = true; + $this->namespaceDeclarations = null; + + parent::setSize($size); + } + } + /** * @param -1|1 $direction */ @@ -1206,14 +1299,14 @@ private function removeWhitespaceSafely(int $index, int $direction, ?string $whi * @param int $searchIndex index of starting brace * @param bool $findEnd if method should find block's end or start * - * @return int index of opposite brace + * @return int<0, max> index of opposite brace */ private function findOppositeBlockEdge(int $type, int $searchIndex, bool $findEnd): int { $blockEdgeDefinitions = self::getBlockEdgeDefinitions(); if (!isset($blockEdgeDefinitions[$type])) { - throw new \InvalidArgumentException(sprintf('Invalid param type: "%s".', $type)); + throw new \InvalidArgumentException(\sprintf('Invalid param type: "%s".', $type)); } if ($findEnd && isset($this->blockStartCache[$searchIndex])) { @@ -1227,7 +1320,7 @@ private function findOppositeBlockEdge(int $type, int $searchIndex, bool $findEn $startEdge = $blockEdgeDefinitions[$type]['start']; $endEdge = $blockEdgeDefinitions[$type]['end']; $startIndex = $searchIndex; - $endIndex = $this->count() - 1; + $endIndex = \count($this) - 1; $indexOffset = 1; if (!$findEnd) { @@ -1237,7 +1330,7 @@ private function findOppositeBlockEdge(int $type, int $searchIndex, bool $findEn } if (!$this[$startIndex]->equals($startEdge)) { - throw new \InvalidArgumentException(sprintf('Invalid param $startIndex - not a proper block "%s".', $findEnd ? 'start' : 'end')); + throw new \InvalidArgumentException(\sprintf('Invalid param $startIndex - not a proper block "%s".', $findEnd ? 'start' : 'end')); } $blockLevel = 0; @@ -1261,7 +1354,7 @@ private function findOppositeBlockEdge(int $type, int $searchIndex, bool $findEn } if (!$this[$index]->equals($endEdge)) { - throw new \UnexpectedValueException(sprintf('Missing block "%s".', $findEnd ? 'end' : 'start')); + throw new \UnexpectedValueException(\sprintf('Missing block "%s".', $findEnd ? 'end' : 'start')); } if ($startIndex < $index) { @@ -1277,6 +1370,8 @@ private function findOppositeBlockEdge(int $type, int $searchIndex, bool $findEn /** * Calculate hash for code. + * + * @return non-empty-string */ private static function calculateCodeHash(string $code): string { @@ -1286,12 +1381,12 @@ private static function calculateCodeHash(string $code): string /** * Get cache value for given key. * - * @param string $key item key + * @param non-empty-string $key item key */ private static function getCache(string $key): self { if (!self::hasCache($key)) { - throw new \OutOfBoundsException(sprintf('Unknown cache key: "%s".', $key)); + throw new \OutOfBoundsException(\sprintf('Unknown cache key: "%s".', $key)); } return self::$cache[$key]; @@ -1300,7 +1395,7 @@ private static function getCache(string $key): self /** * Check if given key exists in cache. * - * @param string $key item key + * @param non-empty-string $key item key */ private static function hasCache(string $key): bool { @@ -1308,8 +1403,8 @@ private static function hasCache(string $key): bool } /** - * @param string $key item key - * @param Tokens $value item value + * @param non-empty-string $key item key + * @param Tokens $value item value */ private static function setCache(string $key, self $value): void { @@ -1321,7 +1416,7 @@ private static function setCache(string $key, self $value): void * * Remove old cache and set new one. * - * @param string $codeHash new code hash + * @param non-empty-string $codeHash new code hash */ private function changeCodeHash(string $codeHash): void { @@ -1335,36 +1430,25 @@ private function changeCodeHash(string $codeHash): void /** * Register token as found. - * - * @param array{int}|string|Token $token token prototype */ - private function registerFoundToken($token): void + private function registerFoundToken(Token $token): void { // inlined extractTokenKind() call on the hot path - $tokenKind = $token instanceof Token - ? ($token->isArray() ? $token->getId() : $token->getContent()) - : (\is_array($token) ? $token[0] : $token); + $tokenKind = $token->isArray() ? $token->getId() : $token->getContent(); $this->foundTokenKinds[$tokenKind] ??= 0; ++$this->foundTokenKinds[$tokenKind]; } /** - * Register token as found. - * - * @param array{int}|string|Token $token token prototype + * Unregister token as not found. */ - private function unregisterFoundToken($token): void + private function unregisterFoundToken(Token $token): void { // inlined extractTokenKind() call on the hot path - $tokenKind = $token instanceof Token - ? ($token->isArray() ? $token->getId() : $token->getContent()) - : (\is_array($token) ? $token[0] : $token); - - if (!isset($this->foundTokenKinds[$tokenKind])) { - return; - } + $tokenKind = $token->isArray() ? $token->getId() : $token->getContent(); + \assert(($this->foundTokenKinds[$tokenKind] ?? 0) > 0); --$this->foundTokenKinds[$tokenKind]; } @@ -1389,7 +1473,6 @@ private function getTokenNotOfKind(int $index, int $direction, callable $filter) { while (true) { $index += $direction; - if (!$this->offsetExists($index)) { return null; } @@ -1401,4 +1484,21 @@ private function getTokenNotOfKind(int $index, int $direction, callable $filter) return $index; } } + + /** + * A helper method used to find out whether a certain input token has to be case-sensitively matched. + * + * @param array|bool $caseSensitive global case sensitiveness or an array of booleans, whose keys should match + * the ones used in $sequence. If any is missing, the default case-sensitive + * comparison is used + * @param int $key the key of the token that has to be looked up + */ + private static function isKeyCaseSensitive($caseSensitive, int $key): bool + { + if (\is_array($caseSensitive)) { + return $caseSensitive[$key] ?? true; + } + + return $caseSensitive; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TokensAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TokensAnalyzer.php index 9855f1a5..63048f98 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TokensAnalyzer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TokensAnalyzer.php @@ -26,6 +26,8 @@ * @author Gregor Harlan * * @internal + * + * @phpstan-type _ClassyElementType 'case'|'const'|'method'|'property'|'trait_import' */ final class TokensAnalyzer { @@ -34,17 +36,21 @@ final class TokensAnalyzer */ private Tokens $tokens; - private ?GotoLabelAnalyzer $gotoLabelAnalyzer = null; + /** + * @readonly + */ + private GotoLabelAnalyzer $gotoLabelAnalyzer; public function __construct(Tokens $tokens) { $this->tokens = $tokens; + $this->gotoLabelAnalyzer = new GotoLabelAnalyzer(); } /** * Get indices of methods and properties in classy code (classes, interfaces and traits). * - * @return array + * @return array */ public function getClassyElements(): array { @@ -74,7 +80,7 @@ public function getClassyElements(): array public function getClassyModifiers(int $index): array { if (!$this->tokens[$index]->isClassy()) { - throw new \InvalidArgumentException(sprintf('Not an "classy" at given index %d.', $index)); + throw new \InvalidArgumentException(\sprintf('Not an "classy" at given index %d.', $index)); } $readOnlyPossible = \defined('T_READONLY'); // @TODO: drop condition when PHP 8.2+ is required @@ -157,7 +163,7 @@ public function isArray(int $index): bool public function isArrayMultiLine(int $index): bool { if (!$this->isArray($index)) { - throw new \InvalidArgumentException(sprintf('Not an array at given index %d.', $index)); + throw new \InvalidArgumentException(\sprintf('Not an array at given index %d.', $index)); } $tokens = $this->tokens; @@ -176,7 +182,7 @@ public function isBlockMultiline(Tokens $tokens, int $index): bool $blockType = Tokens::detectBlockType($tokens[$index]); if (null === $blockType || !$blockType['isStart']) { - throw new \InvalidArgumentException(sprintf('Not an block start at given index %d.', $index)); + throw new \InvalidArgumentException(\sprintf('Not an block start at given index %d.', $index)); } $endIndex = $tokens->findBlockEnd($blockType['type'], $index); @@ -211,7 +217,7 @@ public function isBlockMultiline(Tokens $tokens, int $index): bool public function getMethodAttributes(int $index): array { if (!$this->tokens[$index]->isGivenKind(T_FUNCTION)) { - throw new \LogicException(sprintf('No T_FUNCTION at given index %d, got "%s".', $index, $this->tokens[$index]->getName())); + throw new \LogicException(\sprintf('No T_FUNCTION at given index %d, got "%s".', $index, $this->tokens[$index]->getName())); } $attributes = [ @@ -277,7 +283,7 @@ public function getMethodAttributes(int $index): array public function isAnonymousClass(int $index): bool { if (!$this->tokens[$index]->isClassy()) { - throw new \LogicException(sprintf('No classy token at given index %d.', $index)); + throw new \LogicException(\sprintf('No classy token at given index %d.', $index)); } if (!$this->tokens[$index]->isGivenKind(T_CLASS)) { @@ -286,6 +292,10 @@ public function isAnonymousClass(int $index): bool $index = $this->tokens->getPrevMeaningfulToken($index); + if (\defined('T_READONLY') && $this->tokens[$index]->isGivenKind(T_READONLY)) { // @TODO: drop condition when PHP 8.1+ is required + $index = $this->tokens->getPrevMeaningfulToken($index); + } + while ($this->tokens[$index]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { $index = $this->tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); $index = $this->tokens->getPrevMeaningfulToken($index); @@ -300,7 +310,7 @@ public function isAnonymousClass(int $index): bool public function isLambda(int $index): bool { if (!$this->tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) { - throw new \LogicException(sprintf('No T_FUNCTION or T_FN at given index %d, got "%s".', $index, $this->tokens[$index]->getName())); + throw new \LogicException(\sprintf('No T_FUNCTION or T_FN at given index %d, got "%s".', $index, $this->tokens[$index]->getName())); } $startParenthesisIndex = $this->tokens->getNextMeaningfulToken($index); @@ -315,35 +325,94 @@ public function isLambda(int $index): bool return $startParenthesisToken->equals('('); } + public function getLastTokenIndexOfArrowFunction(int $index): int + { + if (!$this->tokens[$index]->isGivenKind(T_FN)) { + throw new \InvalidArgumentException(\sprintf('Not an "arrow function" at given index %d.', $index)); + } + + $stopTokens = [')', ']', ',', ';', [T_CLOSE_TAG]]; + $index = $this->tokens->getNextTokenOfKind($index, [[T_DOUBLE_ARROW]]); + + while (true) { + $index = $this->tokens->getNextMeaningfulToken($index); + + if ($this->tokens[$index]->equalsAny($stopTokens)) { + break; + } + + $blockType = Tokens::detectBlockType($this->tokens[$index]); + + if (null === $blockType) { + continue; + } + + if ($blockType['isStart']) { + $index = $this->tokens->findBlockEnd($blockType['type'], $index); + + continue; + } + + break; + } + + return $this->tokens->getPrevMeaningfulToken($index); + } + /** * Check if the T_STRING under given index is a constant invocation. */ public function isConstantInvocation(int $index): bool { if (!$this->tokens[$index]->isGivenKind(T_STRING)) { - throw new \LogicException(sprintf('No T_STRING at given index %d, got "%s".', $index, $this->tokens[$index]->getName())); + throw new \LogicException(\sprintf('No T_STRING at given index %d, got "%s".', $index, $this->tokens[$index]->getName())); } $nextIndex = $this->tokens->getNextMeaningfulToken($index); if ( $this->tokens[$nextIndex]->equalsAny(['(', '{']) - || $this->tokens[$nextIndex]->isGivenKind([T_AS, T_DOUBLE_COLON, T_ELLIPSIS, T_NS_SEPARATOR, CT::T_RETURN_REF, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, T_VARIABLE]) + || $this->tokens[$nextIndex]->isGivenKind([T_DOUBLE_COLON, T_ELLIPSIS, T_NS_SEPARATOR, CT::T_RETURN_REF, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, T_VARIABLE]) ) { return false; } + // handle foreach( FOO as $_ ) {} + if ($this->tokens[$nextIndex]->isGivenKind(T_AS)) { + $prevIndex = $this->tokens->getPrevMeaningfulToken($index); + + if (!$this->tokens[$prevIndex]->equals('(')) { + return false; + } + } + $prevIndex = $this->tokens->getPrevMeaningfulToken($index); - if ($this->tokens[$prevIndex]->isGivenKind([T_AS, T_CLASS, T_CONST, T_DOUBLE_COLON, T_FUNCTION, T_GOTO, CT::T_GROUP_IMPORT_BRACE_OPEN, T_INTERFACE, T_TRAIT, CT::T_TYPE_COLON, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION]) || $this->tokens[$prevIndex]->isObjectOperator()) { + if ($this->tokens[$prevIndex]->isGivenKind(Token::getClassyTokenKinds())) { return false; } - while ($this->tokens[$prevIndex]->isGivenKind([CT::T_NAMESPACE_OPERATOR, T_NS_SEPARATOR, T_STRING])) { + if ($this->tokens[$prevIndex]->isGivenKind([T_AS, T_CONST, T_DOUBLE_COLON, T_FUNCTION, T_GOTO, CT::T_GROUP_IMPORT_BRACE_OPEN, CT::T_TYPE_COLON, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION]) || $this->tokens[$prevIndex]->isObjectOperator()) { + return false; + } + + if ( + $this->tokens[$prevIndex]->isGivenKind(T_CASE) + && \defined('T_ENUM') + && $this->tokens->isAllTokenKindsFound([T_ENUM]) + ) { + $enumSwitchIndex = $this->tokens->getPrevTokenOfKind($index, [[T_SWITCH], [T_ENUM]]); + + if (!$this->tokens[$enumSwitchIndex]->isGivenKind(T_SWITCH)) { + return false; + } + } + + while ($this->tokens[$prevIndex]->isGivenKind([CT::T_NAMESPACE_OPERATOR, T_NS_SEPARATOR, T_STRING, CT::T_ARRAY_TYPEHINT])) { $prevIndex = $this->tokens->getPrevMeaningfulToken($prevIndex); } - if ($this->tokens[$prevIndex]->isGivenKind([CT::T_CONST_IMPORT, T_EXTENDS, CT::T_FUNCTION_IMPORT, T_IMPLEMENTS, T_INSTANCEOF, T_INSTEADOF, T_NAMESPACE, T_NEW, CT::T_NULLABLE_TYPE, CT::T_TYPE_COLON, T_USE, CT::T_USE_TRAIT])) { + if ($this->tokens[$prevIndex]->isGivenKind([CT::T_CONST_IMPORT, T_EXTENDS, CT::T_FUNCTION_IMPORT, T_IMPLEMENTS, T_INSTANCEOF, T_INSTEADOF, T_NAMESPACE, T_NEW, CT::T_NULLABLE_TYPE, CT::T_TYPE_COLON, T_USE, CT::T_USE_TRAIT, CT::T_TYPE_INTERSECTION, CT::T_TYPE_ALTERNATION, T_CONST, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE])) { return false; } @@ -387,10 +456,6 @@ public function isConstantInvocation(int $index): bool // check for goto label if ($this->tokens[$nextIndex]->equals(':')) { - if (null === $this->gotoLabelAnalyzer) { - $this->gotoLabelAnalyzer = new GotoLabelAnalyzer(); - } - if ($this->gotoLabelAnalyzer->belongsToGoToLabel($this->tokens, $nextIndex)) { return false; } @@ -514,13 +579,15 @@ public function isUnaryPredecessorOperator(int $index): bool ';', '{', '}', + [T_DOUBLE_ARROW], + [T_FN], [T_FUNCTION], [T_OPEN_TAG], [T_OPEN_TAG_WITH_ECHO], ]; $prevToken = $tokens[$tokens->getPrevTokenOfKind($index, $searchTokens)]; - return $prevToken->isGivenKind(T_FUNCTION); + return $prevToken->isGivenKind([T_FN, T_FUNCTION]); } /** @@ -615,7 +682,7 @@ public function isWhilePartOfDoWhile(int $index): bool $token = $tokens[$index]; if (!$token->isGivenKind(T_WHILE)) { - throw new \LogicException(sprintf('No T_WHILE at given index %d, got "%s".', $index, $token->getName())); + throw new \LogicException(\sprintf('No T_WHILE at given index %d, got "%s".', $index, $token->getName())); } $endIndex = $tokens->getPrevMeaningfulToken($index); @@ -629,6 +696,31 @@ public function isWhilePartOfDoWhile(int $index): bool return $tokens[$beforeStartIndex]->isGivenKind(T_DO); } + /** + * @throws \LogicException when provided index does not point to token containing T_CASE + */ + public function isEnumCase(int $caseIndex): bool + { + $tokens = $this->tokens; + $token = $tokens[$caseIndex]; + + if (!$token->isGivenKind(T_CASE)) { + throw new \LogicException(\sprintf( + 'No T_CASE given at index %d, got %s instead.', + $caseIndex, + $token->getName() ?? $token->getContent() + )); + } + + if (!\defined('T_ENUM') || !$tokens->isTokenKindFound(T_ENUM)) { + return false; + } + + $prevIndex = $tokens->getPrevTokenOfKind($caseIndex, [[T_ENUM], [T_SWITCH]]); + + return null !== $prevIndex && $tokens[$prevIndex]->isGivenKind(T_ENUM); + } + public function isSuperGlobal(int $index): bool { static $superNames = [ @@ -660,7 +752,7 @@ public function isSuperGlobal(int $index): bool * * @param int $classIndex classy index * - * @return array{int, array} + * @return array{int, array} */ private function findClassyElements(int $classIndex, int $index): array { diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ArrayTypehintTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ArrayTypehintTransformer.php index 0fe47527..8e5b9bf1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ArrayTypehintTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ArrayTypehintTransformer.php @@ -28,17 +28,11 @@ */ final class ArrayTypehintTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 5_00_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if (!$token->isGivenKind(T_ARRAY)) { @@ -53,9 +47,6 @@ public function process(Tokens $tokens, Token $token, int $index): void } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [CT::T_ARRAY_TYPEHINT]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/AttributeTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/AttributeTransformer.php index e4355203..d19d3b88 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/AttributeTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/AttributeTransformer.php @@ -26,26 +26,17 @@ */ final class AttributeTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // must run before all other transformers that might touch attributes return 200; } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 8_00_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if (!$tokens[$index]->isGivenKind(T_ATTRIBUTE)) { @@ -67,9 +58,6 @@ public function process(Tokens $tokens, Token $token, int $index): void $tokens[$index] = new Token([CT::T_ATTRIBUTE_CLOSE, ']']); } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceClassInstantiationTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceClassInstantiationTransformer.php index 3f5f2555..1a690b89 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceClassInstantiationTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceClassInstantiationTransformer.php @@ -29,26 +29,17 @@ */ final class BraceClassInstantiationTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // must run after CurlyBraceTransformer and SquareBraceTransformer return -2; } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 5_00_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if (!$tokens[$index]->equals('(') || !$tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(T_NEW)) { @@ -56,9 +47,11 @@ public function process(Tokens $tokens, Token $token, int $index): void } if ($tokens[$tokens->getPrevMeaningfulToken($index)]->equalsAny([ + ')', ']', [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], [CT::T_ARRAY_SQUARE_BRACE_CLOSE], + [CT::T_BRACE_CLASS_INSTANTIATION_CLOSE], [T_ARRAY], [T_CLASS], [T_ELSEIF], @@ -80,9 +73,6 @@ public function process(Tokens $tokens, Token $token, int $index): void $tokens[$closeIndex] = new Token([CT::T_BRACE_CLASS_INSTANTIATION_CLOSE, ')']); } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [CT::T_BRACE_CLASS_INSTANTIATION_OPEN, CT::T_BRACE_CLASS_INSTANTIATION_CLOSE]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/CurlyBraceTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceTransformer.php similarity index 57% rename from tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/CurlyBraceTransformer.php rename to tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceTransformer.php index 4660d02d..1f273159 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/CurlyBraceTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceTransformer.php @@ -28,38 +28,32 @@ * - in `$foo->{$bar}` into CT::T_DYNAMIC_PROP_BRACE_OPEN and CT::T_DYNAMIC_PROP_BRACE_CLOSE, * - in `${$foo}` into CT::T_DYNAMIC_VAR_BRACE_OPEN and CT::T_DYNAMIC_VAR_BRACE_CLOSE, * - in `$array{$index}` into CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN and CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE, - * - in `use some\a\{ClassA, ClassB, ClassC as C}` into CT::T_GROUP_IMPORT_BRACE_OPEN, CT::T_GROUP_IMPORT_BRACE_CLOSE. + * - in `use some\a\{ClassA, ClassB, ClassC as C}` into CT::T_GROUP_IMPORT_BRACE_OPEN, CT::T_GROUP_IMPORT_BRACE_CLOSE, + * - in `class PropertyHooks { public string $bar _{_ set(string $value) { } _}_` into CT::T_PROPERTY_HOOK_BRACE_OPEN, CT::T_PROPERTY_HOOK_BRACE_CLOSE. * * @author Dariusz Rumiński * * @internal */ -final class CurlyBraceTransformer extends AbstractTransformer +final class BraceTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 5_00_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { - $this->transformIntoCurlyCloseBrace($tokens, $token, $index); - $this->transformIntoDollarCloseBrace($tokens, $token, $index); - $this->transformIntoDynamicPropBraces($tokens, $token, $index); - $this->transformIntoDynamicVarBraces($tokens, $token, $index); - $this->transformIntoCurlyIndexBraces($tokens, $token, $index); - $this->transformIntoGroupUseBraces($tokens, $token, $index); + $this->transformIntoCurlyCloseBrace($tokens, $index); + $this->transformIntoDollarCloseBrace($tokens, $index); + $this->transformIntoDynamicPropBraces($tokens, $index); + $this->transformIntoDynamicVarBraces($tokens, $index); + $this->transformIntoPropertyHookBraces($tokens, $index); + $this->transformIntoCurlyIndexBraces($tokens, $index); + $this->transformIntoGroupUseBraces($tokens, $index); + $this->transformIntoDynamicClassConstantFetchBraces($tokens, $index); } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [ @@ -73,6 +67,10 @@ public function getCustomTokens(): array CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE, CT::T_GROUP_IMPORT_BRACE_OPEN, CT::T_GROUP_IMPORT_BRACE_CLOSE, + CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_OPEN, + CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_CLOSE, + CT::T_PROPERTY_HOOK_BRACE_OPEN, + CT::T_PROPERTY_HOOK_BRACE_CLOSE, ]; } @@ -81,8 +79,10 @@ public function getCustomTokens(): array * * This should be done at very beginning of curly braces transformations. */ - private function transformIntoCurlyCloseBrace(Tokens $tokens, Token $token, int $index): void + private function transformIntoCurlyCloseBrace(Tokens $tokens, int $index): void { + $token = $tokens[$index]; + if (!$token->isGivenKind(T_CURLY_OPEN)) { return; } @@ -102,16 +102,20 @@ private function transformIntoCurlyCloseBrace(Tokens $tokens, Token $token, int $tokens[$index] = new Token([CT::T_CURLY_CLOSE, '}']); } - private function transformIntoDollarCloseBrace(Tokens $tokens, Token $token, int $index): void + private function transformIntoDollarCloseBrace(Tokens $tokens, int $index): void { + $token = $tokens[$index]; + if ($token->isGivenKind(T_DOLLAR_OPEN_CURLY_BRACES)) { $nextIndex = $tokens->getNextTokenOfKind($index, ['}']); $tokens[$nextIndex] = new Token([CT::T_DOLLAR_CLOSE_CURLY_BRACES, '}']); } } - private function transformIntoDynamicPropBraces(Tokens $tokens, Token $token, int $index): void + private function transformIntoDynamicPropBraces(Tokens $tokens, int $index): void { + $token = $tokens[$index]; + if (!$token->isObjectOperator()) { return; } @@ -127,8 +131,10 @@ private function transformIntoDynamicPropBraces(Tokens $tokens, Token $token, in $tokens[$closeIndex] = new Token([CT::T_DYNAMIC_PROP_BRACE_CLOSE, '}']); } - private function transformIntoDynamicVarBraces(Tokens $tokens, Token $token, int $index): void + private function transformIntoDynamicVarBraces(Tokens $tokens, int $index): void { + $token = $tokens[$index]; + if (!$token->equals('$')) { return; } @@ -151,8 +157,55 @@ private function transformIntoDynamicVarBraces(Tokens $tokens, Token $token, int $tokens[$closeIndex] = new Token([CT::T_DYNAMIC_VAR_BRACE_CLOSE, '}']); } - private function transformIntoCurlyIndexBraces(Tokens $tokens, Token $token, int $index): void + private function transformIntoPropertyHookBraces(Tokens $tokens, int $index): void + { + if (\PHP_VERSION_ID < 8_04_00) { + return; // @TODO: drop condition when PHP 8.4+ is required or majority of the users are using 8.4+ + } + + $token = $tokens[$index]; + + if (!$token->equals('{')) { + return; + } + + $nextIndex = $tokens->getNextMeaningfulToken($index); + + // @TODO: drop condition when PHP 8.0+ is required + if (\defined('T_ATTRIBUTE')) { + // skip attributes + while ($tokens[$nextIndex]->isGivenKind(T_ATTRIBUTE)) { + $nextIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $nextIndex); + $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); + } + } + + if (!$tokens[$nextIndex]->equalsAny([ + [T_STRING, 'get'], + [T_STRING, 'set'], + ])) { + return; + } + + $closeIndex = $this->naivelyFindCurlyBlockEnd($tokens, $index); + + $tokens[$index] = new Token([CT::T_PROPERTY_HOOK_BRACE_OPEN, '{']); + $tokens[$closeIndex] = new Token([CT::T_PROPERTY_HOOK_BRACE_CLOSE, '}']); + } + + private function transformIntoCurlyIndexBraces(Tokens $tokens, int $index): void { + // Support for fetching array index with braces syntax (`$arr{$index}`) + // was deprecated in 7.4 and removed in 8.0. However, the PHP's behaviour + // differs between 8.0-8.3 (fatal error in runtime) and 8.4 (parse error). + // + // @TODO Do not replace `CT::T_ARRAY_INDEX_CURLY_BRACE_*` for 8.0-8.3, as further optimization + if (\PHP_VERSION_ID >= 8_04_00) { + return; + } + + $token = $tokens[$index]; + if (!$token->equals('{')) { return; } @@ -191,8 +244,10 @@ private function transformIntoCurlyIndexBraces(Tokens $tokens, Token $token, int $tokens[$closeIndex] = new Token([CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE, '}']); } - private function transformIntoGroupUseBraces(Tokens $tokens, Token $token, int $index): void + private function transformIntoGroupUseBraces(Tokens $tokens, int $index): void { + $token = $tokens[$index]; + if (!$token->equals('{')) { return; } @@ -209,6 +264,47 @@ private function transformIntoGroupUseBraces(Tokens $tokens, Token $token, int $ $tokens[$closeIndex] = new Token([CT::T_GROUP_IMPORT_BRACE_CLOSE, '}']); } + private function transformIntoDynamicClassConstantFetchBraces(Tokens $tokens, int $index): void + { + if (\PHP_VERSION_ID < 8_03_00) { + return; // @TODO: drop condition when PHP 8.3+ is required or majority of the users are using 8.3+ + } + + $token = $tokens[$index]; + + if (!$token->equals('{')) { + return; + } + + $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($index); + + while (!$tokens[$prevMeaningfulTokenIndex]->isGivenKind(T_DOUBLE_COLON)) { + if (!$tokens[$prevMeaningfulTokenIndex]->equals(')')) { + return; + } + + $prevMeaningfulTokenIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $prevMeaningfulTokenIndex); + $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($prevMeaningfulTokenIndex); + + if (!$tokens[$prevMeaningfulTokenIndex]->equals('}')) { + return; + } + + $prevMeaningfulTokenIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $prevMeaningfulTokenIndex); + $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($prevMeaningfulTokenIndex); + } + + $closeIndex = $this->naivelyFindCurlyBlockEnd($tokens, $index); + $nextMeaningfulTokenIndexAfterCloseIndex = $tokens->getNextMeaningfulToken($closeIndex); + + if (!$tokens[$nextMeaningfulTokenIndexAfterCloseIndex]->equalsAny([';', [T_CLOSE_TAG], [T_DOUBLE_COLON]])) { + return; + } + + $tokens[$index] = new Token([CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_OPEN, '{']); + $tokens[$closeIndex] = new Token([CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_CLOSE, '}']); + } + /** * We do not want to rely on `$tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index)` here, * as it relies on block types that are assuming that `}` tokens are already transformed to Custom Tokens that are allowing to distinguish different block types. @@ -217,11 +313,11 @@ private function transformIntoGroupUseBraces(Tokens $tokens, Token $token, int $ private function naivelyFindCurlyBlockEnd(Tokens $tokens, int $startIndex): int { if (!$tokens->offsetExists($startIndex)) { - throw new \OutOfBoundsException(sprintf('Unavailable index: "%s".', $startIndex)); + throw new \OutOfBoundsException(\sprintf('Unavailable index: "%s".', $startIndex)); } if ('{' !== $tokens[$startIndex]->getContent()) { - throw new \InvalidArgumentException(sprintf('Wrong start index: "%s".', $startIndex)); + throw new \InvalidArgumentException(\sprintf('Wrong start index: "%s".', $startIndex)); } $blockLevel = 1; @@ -240,7 +336,7 @@ private function naivelyFindCurlyBlockEnd(Tokens $tokens, int $startIndex): int if (0 === $blockLevel) { if (!$token->equals('}')) { - throw new \UnexpectedValueException(sprintf('Detected block end for index: "%s" was already transformed into other token type: "%s".', $startIndex, $token->getName())); + throw new \UnexpectedValueException(\sprintf('Detected block end for index: "%s" was already transformed into other token type: "%s".', $startIndex, $token->getName())); } return $index; @@ -248,6 +344,6 @@ private function naivelyFindCurlyBlockEnd(Tokens $tokens, int $startIndex): int } } - throw new \UnexpectedValueException(sprintf('Missing block end for index: "%s".', $startIndex)); + throw new \UnexpectedValueException(\sprintf('Missing block end for index: "%s".', $startIndex)); } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ClassConstantTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ClassConstantTransformer.php index 8198edc3..bb75b727 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ClassConstantTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ClassConstantTransformer.php @@ -28,17 +28,11 @@ */ final class ClassConstantTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 5_05_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if (!$token->equalsAny([ @@ -56,9 +50,6 @@ public function process(Tokens $tokens, Token $token, int $index): void } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [CT::T_CLASS_CONSTANT]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ConstructorPromotionTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ConstructorPromotionTransformer.php index 2932fe9d..cdb282d3 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ConstructorPromotionTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ConstructorPromotionTransformer.php @@ -28,47 +28,38 @@ */ final class ConstructorPromotionTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 8_00_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if (!$tokens[$index]->isGivenKind(T_FUNCTION)) { return; } - $index = $tokens->getNextMeaningfulToken($index); + $functionNameIndex = $tokens->getNextMeaningfulToken($index); - if (!$tokens[$index]->isGivenKind(T_STRING) || '__construct' !== strtolower($tokens[$index]->getContent())) { + if (!$tokens[$functionNameIndex]->isGivenKind(T_STRING) || '__construct' !== strtolower($tokens[$functionNameIndex]->getContent())) { return; } - /** @var int $openIndex */ - $openIndex = $tokens->getNextMeaningfulToken($index); // we are @ '(' now - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); + /** @var int $openParenthesisIndex */ + $openParenthesisIndex = $tokens->getNextMeaningfulToken($functionNameIndex); // we are @ '(' now + $closeParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openParenthesisIndex); - for ($index = $openIndex; $index < $closeIndex; ++$index) { - if ($tokens[$index]->isGivenKind(T_PUBLIC)) { - $tokens[$index] = new Token([CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, $tokens[$index]->getContent()]); - } elseif ($tokens[$index]->isGivenKind(T_PROTECTED)) { - $tokens[$index] = new Token([CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, $tokens[$index]->getContent()]); - } elseif ($tokens[$index]->isGivenKind(T_PRIVATE)) { - $tokens[$index] = new Token([CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE, $tokens[$index]->getContent()]); + for ($argsIndex = $openParenthesisIndex; $argsIndex < $closeParenthesisIndex; ++$argsIndex) { + if ($tokens[$argsIndex]->isGivenKind(T_PUBLIC)) { + $tokens[$argsIndex] = new Token([CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, $tokens[$argsIndex]->getContent()]); + } elseif ($tokens[$argsIndex]->isGivenKind(T_PROTECTED)) { + $tokens[$argsIndex] = new Token([CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, $tokens[$argsIndex]->getContent()]); + } elseif ($tokens[$argsIndex]->isGivenKind(T_PRIVATE)) { + $tokens[$argsIndex] = new Token([CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE, $tokens[$argsIndex]->getContent()]); } } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/DisjunctiveNormalFormTypeParenthesisTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/DisjunctiveNormalFormTypeParenthesisTransformer.php index 4114e08d..21d062b0 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/DisjunctiveNormalFormTypeParenthesisTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/DisjunctiveNormalFormTypeParenthesisTransformer.php @@ -28,26 +28,17 @@ */ final class DisjunctiveNormalFormTypeParenthesisTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // needs to run after TypeAlternationTransformer return -16; } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 8_02_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if ($token->equals('(') && $tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(CT::T_TYPE_ALTERNATION)) { @@ -64,9 +55,6 @@ public function process(Tokens $tokens, Token $token, int $index): void $tokens[$closeIndex] = new Token([CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, ')']); } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/FirstClassCallableTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/FirstClassCallableTransformer.php index 913e689b..4781e7b8 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/FirstClassCallableTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/FirstClassCallableTransformer.php @@ -24,17 +24,11 @@ */ final class FirstClassCallableTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 8_01_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if ( @@ -46,9 +40,6 @@ public function process(Tokens $tokens, Token $token, int $index): void } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ImportTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ImportTransformer.php index 5c667e88..1a5b0107 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ImportTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ImportTransformer.php @@ -32,26 +32,17 @@ */ final class ImportTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // Should run after CurlyBraceTransformer and ReturnRefTransformer return -1; } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 5_06_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if (!$token->isGivenKind([T_CONST, T_FUNCTION])) { @@ -74,9 +65,6 @@ public function process(Tokens $tokens, Token $token, int $index): void ]); } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [CT::T_CONST_IMPORT, CT::T_FUNCTION_IMPORT]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NameQualifiedTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NameQualifiedTransformer.php index 18c37e20..ed8353c8 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NameQualifiedTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NameQualifiedTransformer.php @@ -15,6 +15,7 @@ namespace PhpCsFixer\Tokenizer\Transformer; use PhpCsFixer\Tokenizer\AbstractTransformer; +use PhpCsFixer\Tokenizer\Processor\ImportProcessor; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; @@ -25,25 +26,16 @@ */ final class NameQualifiedTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { return 1; // must run before NamespaceOperatorTransformer } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 8_00_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if ($token->isGivenKind([T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED])) { @@ -53,9 +45,6 @@ public function process(Tokens $tokens, Token $token, int $index): void } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return []; @@ -63,38 +52,15 @@ public function getCustomTokens(): array private function transformQualified(Tokens $tokens, Token $token, int $index): void { - $parts = explode('\\', $token->getContent()); - $newTokens = []; - - if ('' === $parts[0]) { - $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); - array_shift($parts); - } - - foreach ($parts as $part) { - $newTokens[] = new Token([T_STRING, $part]); - $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); - } - - array_pop($newTokens); + $newTokens = ImportProcessor::tokenizeName($token->getContent()); $tokens->overrideRange($index, $index, $newTokens); } private function transformRelative(Tokens $tokens, Token $token, int $index): void { - $parts = explode('\\', $token->getContent()); - $newTokens = [ - new Token([T_NAMESPACE, array_shift($parts)]), - new Token([T_NS_SEPARATOR, '\\']), - ]; - - foreach ($parts as $part) { - $newTokens[] = new Token([T_STRING, $part]); - $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); - } - - array_pop($newTokens); + $newTokens = ImportProcessor::tokenizeName($token->getContent()); + $newTokens[0] = new Token([T_NAMESPACE, 'namespace']); $tokens->overrideRange($index, $index, $newTokens); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamedArgumentTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamedArgumentTransformer.php index bcead9e0..0f64717b 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamedArgumentTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamedArgumentTransformer.php @@ -26,26 +26,17 @@ */ final class NamedArgumentTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // needs to run after TypeColonTransformer return -15; } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 8_00_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if (!$tokens[$index]->equals(':')) { @@ -72,9 +63,6 @@ public function process(Tokens $tokens, Token $token, int $index): void $tokens[$index] = new Token([CT::T_NAMED_ARGUMENT_COLON, ':']); } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamespaceOperatorTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamespaceOperatorTransformer.php index 28808010..5244481a 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamespaceOperatorTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamespaceOperatorTransformer.php @@ -28,17 +28,11 @@ */ final class NamespaceOperatorTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 5_03_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if (!$token->isGivenKind(T_NAMESPACE)) { @@ -52,9 +46,6 @@ public function process(Tokens $tokens, Token $token, int $index): void } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [CT::T_NAMESPACE_OPERATOR]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NullableTypeTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NullableTypeTransformer.php index e8e55192..07f481f4 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NullableTypeTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NullableTypeTransformer.php @@ -28,26 +28,17 @@ */ final class NullableTypeTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // needs to run after TypeColonTransformer return -20; } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 7_01_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if (!$token->equals('?')) { @@ -70,6 +61,7 @@ public function process(Tokens $tokens, Token $token, int $index): void [T_PUBLIC], [T_VAR], [T_STATIC], + [T_CONST], ]; if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required @@ -84,9 +76,6 @@ public function process(Tokens $tokens, Token $token, int $index): void } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [CT::T_NULLABLE_TYPE]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ReturnRefTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ReturnRefTransformer.php index ca6ff6af..13f26d05 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ReturnRefTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ReturnRefTransformer.php @@ -28,17 +28,11 @@ */ final class ReturnRefTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 5_00_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if ($token->equals('&') && $tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind([T_FUNCTION, T_FN])) { @@ -46,9 +40,6 @@ public function process(Tokens $tokens, Token $token, int $index): void } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [CT::T_RETURN_REF]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/SquareBraceTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/SquareBraceTransformer.php index 5e08b85b..46e5b12d 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/SquareBraceTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/SquareBraceTransformer.php @@ -32,18 +32,12 @@ */ final class SquareBraceTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // must run after CurlyBraceTransformer and AttributeTransformer return -1; } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { // Short array syntax was introduced in PHP 5.4, but the fixer is smart @@ -52,9 +46,6 @@ public function getRequiredPhpVersionId(): int return 5_00_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if ($this->isArrayDestructing($tokens, $index)) { @@ -68,9 +59,6 @@ public function process(Tokens $tokens, Token $token, int $index): void } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [ diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeAlternationTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeAlternationTransformer.php index d930f936..91035f90 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeAlternationTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeAlternationTransformer.php @@ -29,34 +29,22 @@ */ final class TypeAlternationTransformer extends AbstractTypeTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // needs to run after ArrayTypehintTransformer, TypeColonTransformer and AttributeTransformer return -15; } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 7_01_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { $this->doProcess($tokens, $index, '|'); } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [CT::T_TYPE_ALTERNATION]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeColonTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeColonTransformer.php index 1c5b87ad..7fed9de2 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeColonTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeColonTransformer.php @@ -28,9 +28,6 @@ */ final class TypeColonTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // needs to run after ReturnRefTransformer and UseTransformer @@ -38,17 +35,11 @@ public function getPriority(): int return -10; } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 7_00_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if (!$token->equals(':')) { @@ -85,9 +76,6 @@ public function process(Tokens $tokens, Token $token, int $index): void } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [CT::T_TYPE_COLON]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeIntersectionTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeIntersectionTransformer.php index 8d5c6876..8018155e 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeIntersectionTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeIntersectionTransformer.php @@ -27,34 +27,22 @@ */ final class TypeIntersectionTransformer extends AbstractTypeTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // needs to run after ArrayTypehintTransformer, TypeColonTransformer and AttributeTransformer return -15; } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 8_01_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { $this->doProcess($tokens, $index, [T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG, '&']); } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [CT::T_TYPE_INTERSECTION]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/UseTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/UseTransformer.php index f3ceda30..5aa0c027 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/UseTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/UseTransformer.php @@ -30,26 +30,17 @@ */ final class UseTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getPriority(): int { // Should run after CurlyBraceTransformer and before TypeColonTransformer return -5; } - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 5_03_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if ($token->isGivenKind(T_USE) && $this->isUseForLambda($tokens, $index)) { @@ -93,9 +84,6 @@ public function process(Tokens $tokens, Token $token, int $index): void } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return [CT::T_USE_TRAIT, CT::T_USE_LAMBDA]; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/WhitespacyCommentTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/WhitespacyCommentTransformer.php index 6e3bb598..91ab4cf2 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/WhitespacyCommentTransformer.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/WhitespacyCommentTransformer.php @@ -27,17 +27,11 @@ */ final class WhitespacyCommentTransformer extends AbstractTransformer { - /** - * {@inheritdoc} - */ public function getRequiredPhpVersionId(): int { return 5_00_00; } - /** - * {@inheritdoc} - */ public function process(Tokens $tokens, Token $token, int $index): void { if (!$token->isComment()) { @@ -63,9 +57,6 @@ public function process(Tokens $tokens, Token $token, int $index): void } } - /** - * {@inheritdoc} - */ public function getCustomTokens(): array { return []; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformers.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformers.php index 7cec5a06..e5650659 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformers.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformers.php @@ -40,9 +40,7 @@ private function __construct() { $this->registerBuiltInTransformers(); - usort($this->items, static function (TransformerInterface $a, TransformerInterface $b): int { - return $b->getPriority() <=> $a->getPriority(); - }); + usort($this->items, static fn (TransformerInterface $a, TransformerInterface $b): int => $b->getPriority() <=> $a->getPriority()); } public static function createSingleton(): self @@ -103,7 +101,7 @@ private function findBuiltInTransformers(): iterable /** @var SplFileInfo $file */ foreach (Finder::create()->files()->in(__DIR__.'/Transformer') as $file) { $relativeNamespace = $file->getRelativePath(); - $class = __NAMESPACE__.'\\Transformer\\'.($relativeNamespace ? $relativeNamespace.'\\' : '').$file->getBasename('.php'); + $class = __NAMESPACE__.'\Transformer\\'.('' !== $relativeNamespace ? $relativeNamespace.'\\' : '').$file->getBasename('.php'); yield new $class(); } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfo.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfo.php index 36b2c1e6..885069f7 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfo.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfo.php @@ -32,12 +32,9 @@ final class ToolInfo implements ToolInfoInterface /** * @var null|array{name: string, version: string, dist: array{reference?: string}} */ - private $composerInstallationDetails; + private ?array $composerInstallationDetails = null; - /** - * @var null|bool - */ - private $isInstalledByComposer; + private ?bool $isInstalledByComposer = null; public function getComposerInstallationDetails(): array { @@ -46,7 +43,7 @@ public function getComposerInstallationDetails(): array } if (null === $this->composerInstallationDetails) { - $composerInstalled = json_decode(file_get_contents($this->getComposerInstalledFile()), true); + $composerInstalled = json_decode(file_get_contents($this->getComposerInstalledFile()), true, 512, JSON_THROW_ON_ERROR); $packages = $composerInstalled['packages'] ?? $composerInstalled; @@ -98,9 +95,18 @@ public function isInstalledByComposer(): bool return $this->isInstalledByComposer; } + /** + * Determines if the tool is run inside our pre-built Docker image. + * The `/fixer/` path comes from our Dockerfile, tool is installed there and added to global PATH via symlinked binary. + */ + public function isRunInsideDocker(): bool + { + return str_starts_with(__FILE__, '/fixer/') && is_file('/.dockerenv'); + } + public function getPharDownloadUri(string $version): string { - return sprintf( + return \sprintf( 'https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/%s/php-cs-fixer.phar', $version ); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfoInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfoInterface.php index 5124292b..bc2a5e0b 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfoInterface.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfoInterface.php @@ -32,5 +32,7 @@ public function isInstalledAsPhar(): bool; public function isInstalledByComposer(): bool; + public function isRunInsideDocker(): bool; + public function getPharDownloadUri(string $version): string; } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Utils.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Utils.php index fc68cf23..89f6c43f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Utils.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Utils.php @@ -23,6 +23,8 @@ * @author Odín del Río * * @internal + * + * @deprecated This is a God Class anti-pattern. Don't expand it. It is fine to use logic that is already here (that's why we don't trigger deprecation warnings), but over time logic should be moved to dedicated, single-responsibility classes. */ final class Utils { @@ -41,7 +43,7 @@ private function __construct() */ public static function camelCaseToUnderscore(string $string): string { - return mb_strtolower(Preg::replace('/(?isWhitespace()) { - throw new \InvalidArgumentException(sprintf('The given token must be whitespace, got "%s".', $token->getName())); + throw new \InvalidArgumentException(\sprintf('The given token must be whitespace, got "%s".', $token->getName())); } $str = strrchr( @@ -72,11 +74,14 @@ public static function calculateTrailingWhitespaceIndent(Token $token): string * * Stability is ensured by using Schwartzian transform. * - * @param mixed[] $elements - * @param callable $getComparedValue a callable that takes a single element and returns the value to compare - * @param callable $compareValues a callable that compares two values + * @template T + * @template R + * + * @param list $elements + * @param callable(T): R $getComparedValue a callable that takes a single element and returns the value to compare + * @param callable(R, R): int $compareValues a callable that compares two values * - * @return mixed[] + * @return list */ public static function stableSort(array $elements, callable $getComparedValue, callable $compareValues): array { @@ -94,17 +99,15 @@ public static function stableSort(array $elements, callable $getComparedValue, c return $a[1] <=> $b[1]; }); - return array_map(static function (array $item) { - return $item[0]; - }, $elements); + return array_map(static fn (array $item) => $item[0], $elements); } /** * Sort fixers by their priorities. * - * @param FixerInterface[] $fixers + * @param list $fixers * - * @return FixerInterface[] + * @return list */ public static function sortFixers(array $fixers): array { @@ -112,31 +115,29 @@ public static function sortFixers(array $fixers): array // `usort(): Array was modified by the user comparison function` warning for mocked objects. return self::stableSort( $fixers, - static function (FixerInterface $fixer): int { - return $fixer->getPriority(); - }, - static function (int $a, int $b): int { - return $b <=> $a; - } + static fn (FixerInterface $fixer): int => $fixer->getPriority(), + static fn (int $a, int $b): int => $b <=> $a ); } /** - * Join names in natural language wrapped in backticks, e.g. `a`, `b` and `c`. + * Join names in natural language using specified wrapper (double quote by default). * - * @param string[] $names + * @param list $names * * @throws \InvalidArgumentException */ - public static function naturalLanguageJoinWithBackticks(array $names): string + public static function naturalLanguageJoin(array $names, string $wrapper = '"'): string { if (0 === \count($names)) { throw new \InvalidArgumentException('Array of names cannot be empty.'); } - $names = array_map(static function (string $name): string { - return sprintf('`%s`', $name); - }, $names); + if (\strlen($wrapper) > 1) { + throw new \InvalidArgumentException('Wrapper should be a single-char string or empty.'); + } + + $names = array_map(static fn (string $name): string => \sprintf('%2$s%1$s%2$s', $name, $wrapper), $names); $last = array_pop($names); @@ -147,9 +148,29 @@ public static function naturalLanguageJoinWithBackticks(array $names): string return $last; } + /** + * Join names in natural language wrapped in backticks, e.g. `a`, `b` and `c`. + * + * @param list $names + * + * @throws \InvalidArgumentException + */ + public static function naturalLanguageJoinWithBackticks(array $names): string + { + return self::naturalLanguageJoin($names, '`'); + } + + public static function isFutureModeEnabled(): bool + { + return filter_var( + getenv('PHP_CS_FIXER_FUTURE_MODE'), + FILTER_VALIDATE_BOOL + ); + } + public static function triggerDeprecation(\Exception $futureException): void { - if (getenv('PHP_CS_FIXER_FUTURE_MODE')) { + if (self::isFutureModeEnabled()) { throw new \RuntimeException( 'Your are using something deprecated, see previous exception. Aborting execution because `PHP_CS_FIXER_FUTURE_MODE` environment variable is set.', 0, @@ -173,4 +194,57 @@ public static function getTriggeredDeprecations(): array return $triggeredDeprecations; } + + public static function convertArrayTypeToList(string $type): string + { + $parts = explode('[]', $type); + $count = \count($parts) - 1; + + return str_repeat('list<', $count).$parts[0].str_repeat('>', $count); + } + + /** + * @param mixed $value + */ + public static function toString($value): string + { + return \is_array($value) + ? self::arrayToString($value) + : self::scalarToString($value); + } + + /** + * @param mixed $value + */ + private static function scalarToString($value): string + { + $str = var_export($value, true); + + return Preg::replace('/\bNULL\b/', 'null', $str); + } + + /** + * @param array $value + */ + private static function arrayToString(array $value): string + { + if (0 === \count($value)) { + return '[]'; + } + + $isHash = !array_is_list($value); + $str = '['; + + foreach ($value as $k => $v) { + if ($isHash) { + $str .= self::scalarToString($k).' => '; + } + + $str .= \is_array($v) + ? self::arrayToString($v).', ' + : self::scalarToString($v).', '; + } + + return substr($str, 0, -2).']'; + } } diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WhitespacesFixerConfig.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WhitespacesFixerConfig.php index e558fd6b..c908c4f1 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WhitespacesFixerConfig.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WhitespacesFixerConfig.php @@ -16,13 +16,21 @@ /** * @author Dariusz Rumiński + * + * @readonly */ final class WhitespacesFixerConfig { + /** @var non-empty-string */ private string $indent; + /** @var non-empty-string */ private string $lineEnding; + /** + * @param non-empty-string $indent + * @param non-empty-string $lineEnding + */ public function __construct(string $indent = ' ', string $lineEnding = "\n") { if (!\in_array($indent, [' ', ' ', "\t"], true)) { @@ -37,11 +45,17 @@ public function __construct(string $indent = ' ', string $lineEnding = "\n") $this->lineEnding = $lineEnding; } + /** + * @return non-empty-string + */ public function getIndent(): string { return $this->indent; } + /** + * @return non-empty-string + */ public function getLineEnding(): string { return $this->lineEnding; diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WordMatcher.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WordMatcher.php index 36265a88..b54dae5f 100644 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WordMatcher.php +++ b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WordMatcher.php @@ -17,17 +17,19 @@ /** * @author Dariusz Rumiński * + * @readonly + * * @internal */ final class WordMatcher { /** - * @var string[] + * @var list */ private array $candidates; /** - * @param string[] $candidates + * @param list $candidates */ public function __construct(array $candidates) { diff --git a/tools/php-cs-fixer/vendor/psr/cache/CHANGELOG.md b/tools/php-cs-fixer/vendor/psr/cache/CHANGELOG.md deleted file mode 100644 index 58ddab05..00000000 --- a/tools/php-cs-fixer/vendor/psr/cache/CHANGELOG.md +++ /dev/null @@ -1,16 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 1.0.1 - 2016-08-06 - -### Fixed - -- Make spacing consistent in phpdoc annotations php-fig/cache#9 - chalasr -- Fix grammar in phpdoc annotations php-fig/cache#10 - chalasr -- Be more specific in docblocks that `getItems()` and `deleteItems()` take an array of strings (`string[]`) compared to just `array` php-fig/cache#8 - GrahamCampbell -- For `expiresAt()` and `expiresAfter()` in CacheItemInterface fix docblock to specify null as a valid parameters as well as an implementation of DateTimeInterface php-fig/cache#7 - GrahamCampbell - -## 1.0.0 - 2015-12-11 - -Initial stable release; reflects accepted PSR-6 specification diff --git a/tools/php-cs-fixer/vendor/psr/cache/README.md b/tools/php-cs-fixer/vendor/psr/cache/README.md deleted file mode 100644 index 9855a318..00000000 --- a/tools/php-cs-fixer/vendor/psr/cache/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Caching Interface -============== - -This repository holds all interfaces related to [PSR-6 (Caching Interface)][psr-url]. - -Note that this is not a Caching implementation of its own. It is merely interfaces that describe the components of a Caching mechanism. - -The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. - -[psr-url]: https://www.php-fig.org/psr/psr-6/ -[package-url]: https://packagist.org/packages/psr/cache -[implementation-url]: https://packagist.org/providers/psr/cache-implementation diff --git a/tools/php-cs-fixer/vendor/psr/cache/composer.json b/tools/php-cs-fixer/vendor/psr/cache/composer.json deleted file mode 100644 index 4b687971..00000000 --- a/tools/php-cs-fixer/vendor/psr/cache/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "psr/cache", - "description": "Common interface for caching libraries", - "keywords": ["psr", "psr-6", "cache"], - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=8.0.0" - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/tools/php-cs-fixer/vendor/psr/cache/src/CacheException.php b/tools/php-cs-fixer/vendor/psr/cache/src/CacheException.php deleted file mode 100644 index bb785f46..00000000 --- a/tools/php-cs-fixer/vendor/psr/cache/src/CacheException.php +++ /dev/null @@ -1,10 +0,0 @@ - Contains no other changes, so it's actually fully compatible with the v0.6.0 release. + +## 0.6.0 (2019-07-04) + +* Feature / BC break: Add support for `getMultiple()`, `setMultiple()`, `deleteMultiple()`, `clear()` and `has()` + supporting multiple cache items (inspired by PSR-16). + (#32 by @krlv and #37 by @clue) + +* Documentation for TTL precision with millisecond accuracy or below and + use high-resolution timer for cache TTL on PHP 7.3+. + (#35 and #38 by @clue) + +* Improve API documentation and allow legacy HHVM to fail in Travis CI config. + (#34 and #36 by @clue) + +* Prefix all global functions calls with \ to skip the look up and resolve process and go straight to the global function. + (#31 by @WyriHaximus) + +## 0.5.0 (2018-06-25) + +* Improve documentation by describing what is expected of a class implementing `CacheInterface`. + (#21, #22, #23, #27 by @WyriHaximus) + +* Implemented (optional) Least Recently Used (LRU) cache algorithm for `ArrayCache`. + (#26 by @clue) + +* Added support for cache expiration (TTL). + (#29 by @clue and @WyriHaximus) + +* Renamed `remove` to `delete` making it more in line with `PSR-16`. + (#30 by @clue) + +## 0.4.2 (2017-12-20) + +* Improve documentation with usage and installation instructions + (#10 by @clue) + +* Improve test suite by adding PHPUnit to `require-dev` and + add forward compatibility with PHPUnit 5 and PHPUnit 6 and + sanitize Composer autoload paths + (#14 by @shaunbramley and #12 and #18 by @clue) + +## 0.4.1 (2016-02-25) + +* Repository maintenance, split off from main repo, improve test suite and documentation +* First class support for PHP7 and HHVM (#9 by @clue) +* Adjust compatibility to 5.3 (#7 by @clue) + +## 0.4.0 (2014-02-02) + +* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks +* BC break: Update to React/Promise 2.0 +* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0 + +## 0.3.2 (2013-05-10) + +* Version bump + +## 0.3.0 (2013-04-14) + +* Version bump + +## 0.2.6 (2012-12-26) + +* Feature: New cache component, used by DNS diff --git a/tools/php-cs-fixer/vendor/doctrine/lexer/LICENSE b/tools/php-cs-fixer/vendor/react/cache/LICENSE similarity index 55% rename from tools/php-cs-fixer/vendor/doctrine/lexer/LICENSE rename to tools/php-cs-fixer/vendor/react/cache/LICENSE index e8fdec4a..d6f8901f 100644 --- a/tools/php-cs-fixer/vendor/doctrine/lexer/LICENSE +++ b/tools/php-cs-fixer/vendor/react/cache/LICENSE @@ -1,11 +1,13 @@ -Copyright (c) 2006-2018 Doctrine Project +The MIT License (MIT) -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: +Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. @@ -15,5 +17,5 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/cache/README.md b/tools/php-cs-fixer/vendor/react/cache/README.md new file mode 100644 index 00000000..7a86be9c --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/cache/README.md @@ -0,0 +1,367 @@ +# Cache + +[![CI status](https://github.com/reactphp/cache/actions/workflows/ci.yml/badge.svg)](https://github.com/reactphp/cache/actions) +[![installs on Packagist](https://img.shields.io/packagist/dt/react/cache?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/cache) + +Async, [Promise](https://github.com/reactphp/promise)-based cache interface +for [ReactPHP](https://reactphp.org/). + +The cache component provides a +[Promise](https://github.com/reactphp/promise)-based +[`CacheInterface`](#cacheinterface) and an in-memory [`ArrayCache`](#arraycache) +implementation of that. +This allows consumers to type hint against the interface and third parties to +provide alternate implementations. +This project is heavily inspired by +[PSR-16: Common Interface for Caching Libraries](https://www.php-fig.org/psr/psr-16/), +but uses an interface more suited for async, non-blocking applications. + +**Table of Contents** + +* [Usage](#usage) + * [CacheInterface](#cacheinterface) + * [get()](#get) + * [set()](#set) + * [delete()](#delete) + * [getMultiple()](#getmultiple) + * [setMultiple()](#setmultiple) + * [deleteMultiple()](#deletemultiple) + * [clear()](#clear) + * [has()](#has) + * [ArrayCache](#arraycache) +* [Common usage](#common-usage) + * [Fallback get](#fallback-get) + * [Fallback-get-and-set](#fallback-get-and-set) +* [Install](#install) +* [Tests](#tests) +* [License](#license) + +## Usage + +### CacheInterface + +The `CacheInterface` describes the main interface of this component. +This allows consumers to type hint against the interface and third parties to +provide alternate implementations. + +#### get() + +The `get(string $key, mixed $default = null): PromiseInterface` method can be used to +retrieve an item from the cache. + +This method will resolve with the cached value on success or with the +given `$default` value when no item can be found or when an error occurs. +Similarly, an expired cache item (once the time-to-live is expired) is +considered a cache miss. + +```php +$cache + ->get('foo') + ->then('var_dump'); +``` + +This example fetches the value of the key `foo` and passes it to the +`var_dump` function. You can use any of the composition provided by +[promises](https://github.com/reactphp/promise). + +#### set() + +The `set(string $key, mixed $value, ?float $ttl = null): PromiseInterface` method can be used to +store an item in the cache. + +This method will resolve with `true` on success or `false` when an error +occurs. If the cache implementation has to go over the network to store +it, it may take a while. + +The optional `$ttl` parameter sets the maximum time-to-live in seconds +for this cache item. If this parameter is omitted (or `null`), the item +will stay in the cache for as long as the underlying implementation +supports. Trying to access an expired cache item results in a cache miss, +see also [`get()`](#get). + +```php +$cache->set('foo', 'bar', 60); +``` + +This example eventually sets the value of the key `foo` to `bar`. If it +already exists, it is overridden. + +This interface does not enforce any particular TTL resolution, so special +care may have to be taken if you rely on very high precision with +millisecond accuracy or below. Cache implementations SHOULD work on a +best effort basis and SHOULD provide at least second accuracy unless +otherwise noted. Many existing cache implementations are known to provide +microsecond or millisecond accuracy, but it's generally not recommended +to rely on this high precision. + +This interface suggests that cache implementations SHOULD use a monotonic +time source if available. Given that a monotonic time source is only +available as of PHP 7.3 by default, cache implementations MAY fall back +to using wall-clock time. +While this does not affect many common use cases, this is an important +distinction for programs that rely on a high time precision or on systems +that are subject to discontinuous time adjustments (time jumps). +This means that if you store a cache item with a TTL of 30s and then +adjust your system time forward by 20s, the cache item SHOULD still +expire in 30s. + +#### delete() + +The `delete(string $key): PromiseInterface` method can be used to +delete an item from the cache. + +This method will resolve with `true` on success or `false` when an error +occurs. When no item for `$key` is found in the cache, it also resolves +to `true`. If the cache implementation has to go over the network to +delete it, it may take a while. + +```php +$cache->delete('foo'); +``` + +This example eventually deletes the key `foo` from the cache. As with +`set()`, this may not happen instantly and a promise is returned to +provide guarantees whether or not the item has been removed from cache. + +#### getMultiple() + +The `getMultiple(string[] $keys, mixed $default = null): PromiseInterface` method can be used to +retrieve multiple cache items by their unique keys. + +This method will resolve with an array of cached values on success or with the +given `$default` value when an item can not be found or when an error occurs. +Similarly, an expired cache item (once the time-to-live is expired) is +considered a cache miss. + +```php +$cache->getMultiple(array('name', 'age'))->then(function (array $values) { + $name = $values['name'] ?? 'User'; + $age = $values['age'] ?? 'n/a'; + + echo $name . ' is ' . $age . PHP_EOL; +}); +``` + +This example fetches the cache items for the `name` and `age` keys and +prints some example output. You can use any of the composition provided +by [promises](https://github.com/reactphp/promise). + +#### setMultiple() + +The `setMultiple(array $values, ?float $ttl = null): PromiseInterface` method can be used to +persist a set of key => value pairs in the cache, with an optional TTL. + +This method will resolve with `true` on success or `false` when an error +occurs. If the cache implementation has to go over the network to store +it, it may take a while. + +The optional `$ttl` parameter sets the maximum time-to-live in seconds +for these cache items. If this parameter is omitted (or `null`), these items +will stay in the cache for as long as the underlying implementation +supports. Trying to access an expired cache items results in a cache miss, +see also [`getMultiple()`](#getmultiple). + +```php +$cache->setMultiple(array('foo' => 1, 'bar' => 2), 60); +``` + +This example eventually sets the list of values - the key `foo` to `1` value +and the key `bar` to `2`. If some of the keys already exist, they are overridden. + +#### deleteMultiple() + +The `setMultiple(string[] $keys): PromiseInterface` method can be used to +delete multiple cache items in a single operation. + +This method will resolve with `true` on success or `false` when an error +occurs. When no items for `$keys` are found in the cache, it also resolves +to `true`. If the cache implementation has to go over the network to +delete it, it may take a while. + +```php +$cache->deleteMultiple(array('foo', 'bar, 'baz')); +``` + +This example eventually deletes keys `foo`, `bar` and `baz` from the cache. +As with `setMultiple()`, this may not happen instantly and a promise is returned to +provide guarantees whether or not the item has been removed from cache. + +#### clear() + +The `clear(): PromiseInterface` method can be used to +wipe clean the entire cache. + +This method will resolve with `true` on success or `false` when an error +occurs. If the cache implementation has to go over the network to +delete it, it may take a while. + +```php +$cache->clear(); +``` + +This example eventually deletes all keys from the cache. As with `deleteMultiple()`, +this may not happen instantly and a promise is returned to provide guarantees +whether or not all the items have been removed from cache. + +#### has() + +The `has(string $key): PromiseInterface` method can be used to +determine whether an item is present in the cache. + +This method will resolve with `true` on success or `false` when no item can be found +or when an error occurs. Similarly, an expired cache item (once the time-to-live +is expired) is considered a cache miss. + +```php +$cache + ->has('foo') + ->then('var_dump'); +``` + +This example checks if the value of the key `foo` is set in the cache and passes +the result to the `var_dump` function. You can use any of the composition provided by +[promises](https://github.com/reactphp/promise). + +NOTE: It is recommended that has() is only to be used for cache warming type purposes +and not to be used within your live applications operations for get/set, as this method +is subject to a race condition where your has() will return true and immediately after, +another script can remove it making the state of your app out of date. + +### ArrayCache + +The `ArrayCache` provides an in-memory implementation of the [`CacheInterface`](#cacheinterface). + +```php +$cache = new ArrayCache(); + +$cache->set('foo', 'bar'); +``` + +Its constructor accepts an optional `?int $limit` parameter to limit the +maximum number of entries to store in the LRU cache. If you add more +entries to this instance, it will automatically take care of removing +the one that was least recently used (LRU). + +For example, this snippet will overwrite the first value and only store +the last two entries: + +```php +$cache = new ArrayCache(2); + +$cache->set('foo', '1'); +$cache->set('bar', '2'); +$cache->set('baz', '3'); +``` + +This cache implementation is known to rely on wall-clock time to schedule +future cache expiration times when using any version before PHP 7.3, +because a monotonic time source is only available as of PHP 7.3 (`hrtime()`). +While this does not affect many common use cases, this is an important +distinction for programs that rely on a high time precision or on systems +that are subject to discontinuous time adjustments (time jumps). +This means that if you store a cache item with a TTL of 30s on PHP < 7.3 +and then adjust your system time forward by 20s, the cache item may +expire in 10s. See also [`set()`](#set) for more details. + +## Common usage + +### Fallback get + +A common use case of caches is to attempt fetching a cached value and as a +fallback retrieve it from the original data source if not found. Here is an +example of that: + +```php +$cache + ->get('foo') + ->then(function ($result) { + if ($result === null) { + return getFooFromDb(); + } + + return $result; + }) + ->then('var_dump'); +``` + +First an attempt is made to retrieve the value of `foo`. A callback function is +registered that will call `getFooFromDb` when the resulting value is null. +`getFooFromDb` is a function (can be any PHP callable) that will be called if the +key does not exist in the cache. + +`getFooFromDb` can handle the missing key by returning a promise for the +actual value from the database (or any other data source). As a result, this +chain will correctly fall back, and provide the value in both cases. + +### Fallback get and set + +To expand on the fallback get example, often you want to set the value on the +cache after fetching it from the data source. + +```php +$cache + ->get('foo') + ->then(function ($result) { + if ($result === null) { + return $this->getAndCacheFooFromDb(); + } + + return $result; + }) + ->then('var_dump'); + +public function getAndCacheFooFromDb() +{ + return $this->db + ->get('foo') + ->then(array($this, 'cacheFooFromDb')); +} + +public function cacheFooFromDb($foo) +{ + $this->cache->set('foo', $foo); + + return $foo; +} +``` + +By using chaining you can easily conditionally cache the value if it is +fetched from the database. + +## Install + +The recommended way to install this library is [through Composer](https://getcomposer.org). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) + +This project follows [SemVer](https://semver.org/). +This will install the latest supported version: + +```bash +composer require react/cache:^1.2 +``` + +See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. + +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.3 through current PHP 8+ and +HHVM. +It's *highly recommended to use PHP 7+* for this project. + +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org): + +```bash +composer install +``` + +To run the test suite, go to the project root and run: + +```bash +vendor/bin/phpunit +``` + +## License + +MIT, see [LICENSE file](LICENSE). diff --git a/tools/php-cs-fixer/vendor/react/cache/composer.json b/tools/php-cs-fixer/vendor/react/cache/composer.json new file mode 100644 index 00000000..153439a2 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/cache/composer.json @@ -0,0 +1,45 @@ +{ + "name": "react/cache", + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": ["cache", "caching", "promise", "ReactPHP"], + "license": "MIT", + "authors": [ + { + "name": "Christian Lück", + "homepage": "https://clue.engineering/", + "email": "christian@clue.engineering" + }, + { + "name": "Cees-Jan Kiewiet", + "homepage": "https://wyrihaximus.net/", + "email": "reactphp@ceesjankiewiet.nl" + }, + { + "name": "Jan Sorgalla", + "homepage": "https://sorgalla.com/", + "email": "jsorgalla@gmail.com" + }, + { + "name": "Chris Boden", + "homepage": "https://cboden.dev/", + "email": "cboden@gmail.com" + } + ], + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "React\\Tests\\Cache\\": "tests/" + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/cache/src/ArrayCache.php b/tools/php-cs-fixer/vendor/react/cache/src/ArrayCache.php new file mode 100644 index 00000000..81f25eff --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/cache/src/ArrayCache.php @@ -0,0 +1,181 @@ +set('foo', 'bar'); + * ``` + * + * Its constructor accepts an optional `?int $limit` parameter to limit the + * maximum number of entries to store in the LRU cache. If you add more + * entries to this instance, it will automatically take care of removing + * the one that was least recently used (LRU). + * + * For example, this snippet will overwrite the first value and only store + * the last two entries: + * + * ```php + * $cache = new ArrayCache(2); + * + * $cache->set('foo', '1'); + * $cache->set('bar', '2'); + * $cache->set('baz', '3'); + * ``` + * + * This cache implementation is known to rely on wall-clock time to schedule + * future cache expiration times when using any version before PHP 7.3, + * because a monotonic time source is only available as of PHP 7.3 (`hrtime()`). + * While this does not affect many common use cases, this is an important + * distinction for programs that rely on a high time precision or on systems + * that are subject to discontinuous time adjustments (time jumps). + * This means that if you store a cache item with a TTL of 30s on PHP < 7.3 + * and then adjust your system time forward by 20s, the cache item may + * expire in 10s. See also [`set()`](#set) for more details. + * + * @param int|null $limit maximum number of entries to store in the LRU cache + */ + public function __construct($limit = null) + { + $this->limit = $limit; + + // prefer high-resolution timer, available as of PHP 7.3+ + $this->supportsHighResolution = \function_exists('hrtime'); + } + + public function get($key, $default = null) + { + // delete key if it is already expired => below will detect this as a cache miss + if (isset($this->expires[$key]) && $this->now() - $this->expires[$key] > 0) { + unset($this->data[$key], $this->expires[$key]); + } + + if (!\array_key_exists($key, $this->data)) { + return Promise\resolve($default); + } + + // remove and append to end of array to keep track of LRU info + $value = $this->data[$key]; + unset($this->data[$key]); + $this->data[$key] = $value; + + return Promise\resolve($value); + } + + public function set($key, $value, $ttl = null) + { + // unset before setting to ensure this entry will be added to end of array (LRU info) + unset($this->data[$key]); + $this->data[$key] = $value; + + // sort expiration times if TTL is given (first will expire first) + unset($this->expires[$key]); + if ($ttl !== null) { + $this->expires[$key] = $this->now() + $ttl; + \asort($this->expires); + } + + // ensure size limit is not exceeded or remove first entry from array + if ($this->limit !== null && \count($this->data) > $this->limit) { + // first try to check if there's any expired entry + // expiration times are sorted, so we can simply look at the first one + \reset($this->expires); + $key = \key($this->expires); + + // check to see if the first in the list of expiring keys is already expired + // if the first key is not expired, we have to overwrite by using LRU info + if ($key === null || $this->now() - $this->expires[$key] < 0) { + \reset($this->data); + $key = \key($this->data); + } + unset($this->data[$key], $this->expires[$key]); + } + + return Promise\resolve(true); + } + + public function delete($key) + { + unset($this->data[$key], $this->expires[$key]); + + return Promise\resolve(true); + } + + public function getMultiple(array $keys, $default = null) + { + $values = array(); + + foreach ($keys as $key) { + $values[$key] = $this->get($key, $default); + } + + return Promise\all($values); + } + + public function setMultiple(array $values, $ttl = null) + { + foreach ($values as $key => $value) { + $this->set($key, $value, $ttl); + } + + return Promise\resolve(true); + } + + public function deleteMultiple(array $keys) + { + foreach ($keys as $key) { + unset($this->data[$key], $this->expires[$key]); + } + + return Promise\resolve(true); + } + + public function clear() + { + $this->data = array(); + $this->expires = array(); + + return Promise\resolve(true); + } + + public function has($key) + { + // delete key if it is already expired + if (isset($this->expires[$key]) && $this->now() - $this->expires[$key] > 0) { + unset($this->data[$key], $this->expires[$key]); + } + + if (!\array_key_exists($key, $this->data)) { + return Promise\resolve(false); + } + + // remove and append to end of array to keep track of LRU info + $value = $this->data[$key]; + unset($this->data[$key]); + $this->data[$key] = $value; + + return Promise\resolve(true); + } + + /** + * @return float + */ + private function now() + { + return $this->supportsHighResolution ? \hrtime(true) * 1e-9 : \microtime(true); + } +} diff --git a/tools/php-cs-fixer/vendor/react/cache/src/CacheInterface.php b/tools/php-cs-fixer/vendor/react/cache/src/CacheInterface.php new file mode 100644 index 00000000..8e51c190 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/cache/src/CacheInterface.php @@ -0,0 +1,194 @@ +get('foo') + * ->then('var_dump'); + * ``` + * + * This example fetches the value of the key `foo` and passes it to the + * `var_dump` function. You can use any of the composition provided by + * [promises](https://github.com/reactphp/promise). + * + * @param string $key + * @param mixed $default Default value to return for cache miss or null if not given. + * @return PromiseInterface + */ + public function get($key, $default = null); + + /** + * Stores an item in the cache. + * + * This method will resolve with `true` on success or `false` when an error + * occurs. If the cache implementation has to go over the network to store + * it, it may take a while. + * + * The optional `$ttl` parameter sets the maximum time-to-live in seconds + * for this cache item. If this parameter is omitted (or `null`), the item + * will stay in the cache for as long as the underlying implementation + * supports. Trying to access an expired cache item results in a cache miss, + * see also [`get()`](#get). + * + * ```php + * $cache->set('foo', 'bar', 60); + * ``` + * + * This example eventually sets the value of the key `foo` to `bar`. If it + * already exists, it is overridden. + * + * This interface does not enforce any particular TTL resolution, so special + * care may have to be taken if you rely on very high precision with + * millisecond accuracy or below. Cache implementations SHOULD work on a + * best effort basis and SHOULD provide at least second accuracy unless + * otherwise noted. Many existing cache implementations are known to provide + * microsecond or millisecond accuracy, but it's generally not recommended + * to rely on this high precision. + * + * This interface suggests that cache implementations SHOULD use a monotonic + * time source if available. Given that a monotonic time source is only + * available as of PHP 7.3 by default, cache implementations MAY fall back + * to using wall-clock time. + * While this does not affect many common use cases, this is an important + * distinction for programs that rely on a high time precision or on systems + * that are subject to discontinuous time adjustments (time jumps). + * This means that if you store a cache item with a TTL of 30s and then + * adjust your system time forward by 20s, the cache item SHOULD still + * expire in 30s. + * + * @param string $key + * @param mixed $value + * @param ?float $ttl + * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error + */ + public function set($key, $value, $ttl = null); + + /** + * Deletes an item from the cache. + * + * This method will resolve with `true` on success or `false` when an error + * occurs. When no item for `$key` is found in the cache, it also resolves + * to `true`. If the cache implementation has to go over the network to + * delete it, it may take a while. + * + * ```php + * $cache->delete('foo'); + * ``` + * + * This example eventually deletes the key `foo` from the cache. As with + * `set()`, this may not happen instantly and a promise is returned to + * provide guarantees whether or not the item has been removed from cache. + * + * @param string $key + * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error + */ + public function delete($key); + + /** + * Retrieves multiple cache items by their unique keys. + * + * This method will resolve with an array of cached values on success or with the + * given `$default` value when an item can not be found or when an error occurs. + * Similarly, an expired cache item (once the time-to-live is expired) is + * considered a cache miss. + * + * ```php + * $cache->getMultiple(array('name', 'age'))->then(function (array $values) { + * $name = $values['name'] ?? 'User'; + * $age = $values['age'] ?? 'n/a'; + * + * echo $name . ' is ' . $age . PHP_EOL; + * }); + * ``` + * + * This example fetches the cache items for the `name` and `age` keys and + * prints some example output. You can use any of the composition provided + * by [promises](https://github.com/reactphp/promise). + * + * @param string[] $keys A list of keys that can obtained in a single operation. + * @param mixed $default Default value to return for keys that do not exist. + * @return PromiseInterface Returns a promise which resolves to an `array` of cached values + */ + public function getMultiple(array $keys, $default = null); + + /** + * Persists a set of key => value pairs in the cache, with an optional TTL. + * + * This method will resolve with `true` on success or `false` when an error + * occurs. If the cache implementation has to go over the network to store + * it, it may take a while. + * + * The optional `$ttl` parameter sets the maximum time-to-live in seconds + * for these cache items. If this parameter is omitted (or `null`), these items + * will stay in the cache for as long as the underlying implementation + * supports. Trying to access an expired cache items results in a cache miss, + * see also [`get()`](#get). + * + * ```php + * $cache->setMultiple(array('foo' => 1, 'bar' => 2), 60); + * ``` + * + * This example eventually sets the list of values - the key `foo` to 1 value + * and the key `bar` to 2. If some of the keys already exist, they are overridden. + * + * @param array $values A list of key => value pairs for a multiple-set operation. + * @param ?float $ttl Optional. The TTL value of this item. + * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error + */ + public function setMultiple(array $values, $ttl = null); + + /** + * Deletes multiple cache items in a single operation. + * + * @param string[] $keys A list of string-based keys to be deleted. + * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error + */ + public function deleteMultiple(array $keys); + + /** + * Wipes clean the entire cache. + * + * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error + */ + public function clear(); + + /** + * Determines whether an item is present in the cache. + * + * This method will resolve with `true` on success or `false` when no item can be found + * or when an error occurs. Similarly, an expired cache item (once the time-to-live + * is expired) is considered a cache miss. + * + * ```php + * $cache + * ->has('foo') + * ->then('var_dump'); + * ``` + * + * This example checks if the value of the key `foo` is set in the cache and passes + * the result to the `var_dump` function. You can use any of the composition provided by + * [promises](https://github.com/reactphp/promise). + * + * NOTE: It is recommended that has() is only to be used for cache warming type purposes + * and not to be used within your live applications operations for get/set, as this method + * is subject to a race condition where your has() will return true and immediately after, + * another script can remove it making the state of your app out of date. + * + * @param string $key The cache item key. + * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error + */ + public function has($key); +} diff --git a/tools/php-cs-fixer/vendor/react/child-process/CHANGELOG.md b/tools/php-cs-fixer/vendor/react/child-process/CHANGELOG.md new file mode 100644 index 00000000..5ad759d4 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/child-process/CHANGELOG.md @@ -0,0 +1,176 @@ +# Changelog + +## 0.6.6 (2025-01-01) + +This is a compatibility release that contains backported features from the `0.7.x` branch. +Once v0.7 is released, it will be the way forward for this project. + +* Feature: Improve PHP 8.4+ support by avoiding implicitly nullable types. + (#114 by @clue) + +* Improve test suite to run tests on latest PHP versions and report failed assertions. + (#113 by @clue) + +## 0.6.5 (2022-09-16) + +* Feature: Full support for PHP 8.1 and PHP 8.2 release. + (#91 by @SimonFrings and #99 by @WyriHaximus) + +* Feature / Fix: Improve error reporting when custom error handler is used. + (#94 by @clue) + +* Minor documentation improvements. + (#92 by @SimonFrings and #95 by @nhedger) + +* Improve test suite, skip failing tests on bugged versions and fix legacy HHVM build. + (#96 and #98 by @clue and #93 by @SimonFrings) + +## 0.6.4 (2021-10-12) + +* Feature / Fix: Skip sigchild check if `phpinfo()` has been disabled. + (#89 by @clue) + +* Fix: Fix detecting closed socket pipes on PHP 8. + (#90 by @clue) + +## 0.6.3 (2021-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). + +* Feature: Simplify usage by supporting new [default loop](https://reactphp.org/event-loop/#loop). + (#87 by @clue) + + ```php + // old (still supported) + $process = new React\ChildProcess\Process($command); + $process->start($loop); + + // new (using default loop) + $process = new React\ChildProcess\Process($command); + $process->start(); + ``` + +## 0.6.2 (2021-02-05) + +* Feature: Support PHP 8 and add non-blocking I/O support on Windows with PHP 8. + (#85 by @clue) + +* Minor documentation improvements. + (#78 by @WyriHaximus and #80 by @gdejong) + +* Improve test suite and add `.gitattributes` to exclude dev files from exports. + Run tests on PHPUnit 9, switch to GitHub actions and clean up test suite. + (#75 by @reedy, #81 by @gdejong, #82 by @SimonFrings and #84 by @clue) + +## 0.6.1 (2019-02-15) + +* Feature / Fix: Improve error reporting when spawning child process fails. + (#73 by @clue) + +## 0.6.0 (2019-01-14) + +A major feature release with some minor API improvements! +This project now has limited Windows support and supports passing custom pipes +and file descriptors to the child process. + +This update involves a few minor BC breaks. We've tried hard to avoid BC breaks +where possible and minimize impact otherwise. We expect that most consumers of +this package will actually not be affected by any BC breaks, see below for more +details. + +* Feature / BC break: Support passing custom pipes and file descriptors to child process, + expose all standard I/O pipes in an array and remove unused Windows-only options. + (#62, #64 and #65 by @clue) + + > BC note: The optional `$options` parameter in the `Process` constructor + has been removed and a new `$fds` parameter has been added instead. The + previous `$options` parameter was Windows-only, available options were not + documented or referenced anywhere else in this library, so its actual + impact is expected to be relatively small. See the documentation and the + following changelog entry if you're looking for Windows support. + +* Feature: Support spawning child process on Windows without process I/O pipes. + (#67 by @clue) + +* Feature / BC break: Improve sigchild compatibility and support explicit configuration. + (#63 by @clue) + + ```php + // advanced: not recommended by default + Process::setSigchildEnabled(true); + ``` + + > BC note: The old public sigchild methods have been removed, but its + practical impact is believed to be relatively small due to the automatic detection. + +* Improve performance by prefixing all global functions calls with \ to skip + the look up and resolve process and go straight to the global function. + (#68 by @WyriHaximus) + +* Minor documentation improvements and docblock updates. + (#59 by @iamluc and #69 by @CharlotteDunois) + +* Improve test suite to test against PHP7.2 and PHP 7.3, improve HHVM compatibility, + add forward compatibility with PHPUnit 7 and run tests on Windows via Travis CI. + (#66 and #71 by @clue) + +## 0.5.2 (2018-01-18) + +* Feature: Detect "exit" immediately if last process pipe is closed + (#58 by @clue) + + This introduces a simple check to see if the program is already known to be + closed when the last process pipe is closed instead of relying on a periodic + timer. This simple change improves "exit" detection significantly for most + programs and does not cause a noticeable penalty for more advanced use cases. + +* Fix forward compatibility with upcoming EventLoop releases + (#56 by @clue) + +## 0.5.1 (2017-12-22) + +* Fix: Update Stream dependency to work around SEGFAULT in legacy PHP < 5.4.28 + and PHP < 5.5.12 + (#50 and #52 by @clue) + +* Improve test suite by simplifying test bootstrapping logic via Composer and + adding forward compatibility with PHPUnit 6 + (#53, #54 and #55 by @clue) + +## 0.5.0 (2017-08-15) + +* Forward compatibility: react/event-loop 1.0 and 0.5, react/stream 0.7.2 and 1.0, and Événement 3.0 + (#38 and #44 by @WyriHaximus, and #46 by @clue) +* Windows compatibility: Documentate that windows isn't supported in 0.5 unless used from within WSL + (#41 and #47 by @WyriHaximus) +* Documentation: Termination examples + (#42 by @clue) +* BC: Throw LogicException in Process instanciating when on Windows or when proc_open is missing (was `RuntimeException`) + (#49 by @mdrost) + +## 0.4.3 (2017-03-14) + +* Ease getting started by improving documentation and adding examples + (#33 and #34 by @clue) + +* First class support for PHP 5.3 through PHP 7.1 and HHVM + (#29 by @clue and #32 by @WyriHaximus) + +## 0.4.2 (2017-03-10) + +* Feature: Forward compatibility with Stream v0.5 + (#26 by @clue) + +* Improve test suite by removing AppVeyor and adding PHPUnit to `require-dev` + (#27 and #28 by @clue) + +## 0.4.1 (2016-08-01) + +* Standalone component +* Test against PHP 7 and HHVM, report test coverage, AppVeyor tests +* Wait for stdout and stderr to close before watching for process exit + (#18 by @mbonneau) + +## 0.4.0 (2014-02-02) + +* Feature: Added ChildProcess to run async child processes within the event loop (@jmikola) diff --git a/tools/php-cs-fixer/vendor/react/child-process/LICENSE b/tools/php-cs-fixer/vendor/react/child-process/LICENSE new file mode 100644 index 00000000..d6f8901f --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/child-process/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/child-process/README.md b/tools/php-cs-fixer/vendor/react/child-process/README.md new file mode 100644 index 00000000..bea72041 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/child-process/README.md @@ -0,0 +1,619 @@ +# ChildProcess + +[![CI status](https://github.com/reactphp/child-process/actions/workflows/ci.yml/badge.svg)](https://github.com/reactphp/child-process/actions) +[![installs on Packagist](https://img.shields.io/packagist/dt/react/child-process?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/child-process) + +Event-driven library for executing child processes with +[ReactPHP](https://reactphp.org/). + +This library integrates [Program Execution](http://php.net/manual/en/book.exec.php) +with the [EventLoop](https://github.com/reactphp/event-loop). +Child processes launched may be signaled and will emit an +`exit` event upon termination. +Additionally, process I/O streams (i.e. STDIN, STDOUT, STDERR) are exposed +as [Streams](https://github.com/reactphp/stream). + +**Table of contents** + +* [Quickstart example](#quickstart-example) +* [Process](#process) + * [Stream Properties](#stream-properties) + * [Command](#command) + * [Termination](#termination) + * [Custom pipes](#custom-pipes) + * [Sigchild Compatibility](#sigchild-compatibility) + * [Windows Compatibility](#windows-compatibility) +* [Install](#install) +* [Tests](#tests) +* [License](#license) + +## Quickstart example + +```php +$process = new React\ChildProcess\Process('echo foo'); +$process->start(); + +$process->stdout->on('data', function ($chunk) { + echo $chunk; +}); + +$process->on('exit', function($exitCode, $termSignal) { + echo 'Process exited with code ' . $exitCode . PHP_EOL; +}); +``` + +See also the [examples](examples). + +## Process + +### Stream Properties + +Once a process is started, its I/O streams will be constructed as instances of +`React\Stream\ReadableStreamInterface` and `React\Stream\WritableStreamInterface`. +Before `start()` is called, these properties are not set. Once a process terminates, +the streams will become closed but not unset. + +Following common Unix conventions, this library will start each child process +with the three pipes matching the standard I/O streams as given below by default. +You can use the named references for common use cases or access these as an +array with all three pipes. + +* `$stdin` or `$pipes[0]` is a `WritableStreamInterface` +* `$stdout` or `$pipes[1]` is a `ReadableStreamInterface` +* `$stderr` or `$pipes[2]` is a `ReadableStreamInterface` + +Note that this default configuration may be overridden by explicitly passing +[custom pipes](#custom-pipes), in which case they may not be set or be assigned +different values. In particular, note that [Windows support](#windows-compatibility) +is limited in that it doesn't support non-blocking STDIO pipes. The `$pipes` +array will always contain references to all pipes as configured and the standard +I/O references will always be set to reference the pipes matching the above +conventions. See [custom pipes](#custom-pipes) for more details. + +Because each of these implement the underlying +[`ReadableStreamInterface`](https://github.com/reactphp/stream#readablestreaminterface) or +[`WritableStreamInterface`](https://github.com/reactphp/stream#writablestreaminterface), +you can use any of their events and methods as usual: + +```php +$process = new Process($command); +$process->start(); + +$process->stdout->on('data', function ($chunk) { + echo $chunk; +}); + +$process->stdout->on('end', function () { + echo 'ended'; +}); + +$process->stdout->on('error', function (Exception $e) { + echo 'error: ' . $e->getMessage(); +}); + +$process->stdout->on('close', function () { + echo 'closed'; +}); + +$process->stdin->write($data); +$process->stdin->end($data = null); +// … +``` + +For more details, see the +[`ReadableStreamInterface`](https://github.com/reactphp/stream#readablestreaminterface) and +[`WritableStreamInterface`](https://github.com/reactphp/stream#writablestreaminterface). + +### Command + +The `Process` class allows you to pass any kind of command line string: + +```php +$process = new Process('echo test'); +$process->start(); +``` + +The command line string usually consists of a whitespace-separated list with +your main executable bin and any number of arguments. Special care should be +taken to escape or quote any arguments, escpecially if you pass any user input +along. Likewise, keep in mind that especially on Windows, it is rather common to +have path names containing spaces and other special characters. If you want to +run a binary like this, you will have to ensure this is quoted as a single +argument using `escapeshellarg()` like this: + +```php +$bin = 'C:\\Program files (x86)\\PHP\\php.exe'; +$file = 'C:\\Users\\me\\Desktop\\Application\\main.php'; + +$process = new Process(escapeshellarg($bin) . ' ' . escapeshellarg($file)); +$process->start(); +``` + +By default, PHP will launch processes by wrapping the given command line string +in a `sh` command on Unix, so that the first example will actually execute +`sh -c echo test` under the hood on Unix. On Windows, it will not launch +processes by wrapping them in a shell. + +This is a very useful feature because it does not only allow you to pass single +commands, but actually allows you to pass any kind of shell command line and +launch multiple sub-commands using command chains (with `&&`, `||`, `;` and +others) and allows you to redirect STDIO streams (with `2>&1` and family). +This can be used to pass complete command lines and receive the resulting STDIO +streams from the wrapping shell command like this: + +```php +$process = new Process('echo run && demo || echo failed'); +$process->start(); +``` + +> Note that [Windows support](#windows-compatibility) is limited in that it + doesn't support STDIO streams at all and also that processes will not be run + in a wrapping shell by default. If you want to run a shell built-in function + such as `echo hello` or `sleep 10`, you may have to prefix your command line + with an explicit shell like `cmd /c echo hello`. + +In other words, the underlying shell is responsible for managing this command +line and launching the individual sub-commands and connecting their STDIO +streams as appropriate. +This implies that the `Process` class will only receive the resulting STDIO +streams from the wrapping shell, which will thus contain the complete +input/output with no way to discern the input/output of single sub-commands. + +If you want to discern the output of single sub-commands, you may want to +implement some higher-level protocol logic, such as printing an explicit +boundary between each sub-command like this: + +```php +$process = new Process('cat first && echo --- && cat second'); +$process->start(); +``` + +As an alternative, considering launching one process at a time and listening on +its `exit` event to conditionally start the next process in the chain. +This will give you an opportunity to configure the subsequent process I/O streams: + +```php +$first = new Process('cat first'); +$first->start(); + +$first->on('exit', function () { + $second = new Process('cat second'); + $second->start(); +}); +``` + +Keep in mind that PHP uses the shell wrapper for ALL command lines on Unix. +While this may seem reasonable for more complex command lines, this actually +also applies to running the most simple single command: + +```php +$process = new Process('yes'); +$process->start(); +``` + +This will actually spawn a command hierarchy similar to this on Unix: + +``` +5480 … \_ php example.php +5481 … \_ sh -c yes +5482 … \_ yes +``` + +This means that trying to get the underlying process PID or sending signals +will actually target the wrapping shell, which may not be the desired result +in many cases. + +If you do not want this wrapping shell process to show up, you can simply +prepend the command string with `exec` on Unix platforms, which will cause the +wrapping shell process to be replaced by our process: + +```php +$process = new Process('exec yes'); +$process->start(); +``` + +This will show a resulting command hierarchy similar to this: + +``` +5480 … \_ php example.php +5481 … \_ yes +``` + +This means that trying to get the underlying process PID and sending signals +will now target the actual command as expected. + +Note that in this case, the command line will not be run in a wrapping shell. +This implies that when using `exec`, there's no way to pass command lines such +as those containing command chains or redirected STDIO streams. + +As a rule of thumb, most commands will likely run just fine with the wrapping +shell. +If you pass a complete command line (or are unsure), you SHOULD most likely keep +the wrapping shell. +If you're running on Unix and you want to pass an invidual command only, you MAY +want to consider prepending the command string with `exec` to avoid the wrapping shell. + +### Termination + +The `exit` event will be emitted whenever the process is no longer running. +Event listeners will receive the exit code and termination signal as two +arguments: + +```php +$process = new Process('sleep 10'); +$process->start(); + +$process->on('exit', function ($code, $term) { + if ($term === null) { + echo 'exit with code ' . $code . PHP_EOL; + } else { + echo 'terminated with signal ' . $term . PHP_EOL; + } +}); +``` + +Note that `$code` is `null` if the process has terminated, but the exit +code could not be determined (for example +[sigchild compatibility](#sigchild-compatibility) was disabled). +Similarly, `$term` is `null` unless the process has terminated in response to +an uncaught signal sent to it. +This is not a limitation of this project, but actual how exit codes and signals +are exposed on POSIX systems, for more details see also +[here](https://unix.stackexchange.com/questions/99112/default-exit-code-when-process-is-terminated). + +It's also worth noting that process termination depends on all file descriptors +being closed beforehand. +This means that all [process pipes](#stream-properties) will emit a `close` +event before the `exit` event and that no more `data` events will arrive after +the `exit` event. +Accordingly, if either of these pipes is in a paused state (`pause()` method +or internally due to a `pipe()` call), this detection may not trigger. + +The `terminate(?int $signal = null): bool` method can be used to send the +process a signal (SIGTERM by default). +Depending on which signal you send to the process and whether it has a signal +handler registered, this can be used to either merely signal a process or even +forcefully terminate it. + +```php +$process->terminate(SIGUSR1); +``` + +Keep the above section in mind if you want to forcefully terminate a process. +If your process spawn sub-processes or implicitly uses the +[wrapping shell mentioned above](#command), its file descriptors may be +inherited to child processes and terminating the main process may not +necessarily terminate the whole process tree. +It is highly suggested that you explicitly `close()` all process pipes +accordingly when terminating a process: + +```php +$process = new Process('sleep 10'); +$process->start(); + +Loop::addTimer(2.0, function () use ($process) { + foreach ($process->pipes as $pipe) { + $pipe->close(); + } + $process->terminate(); +}); +``` + +For many simple programs these seamingly complicated steps can also be avoided +by prefixing the command line with `exec` to avoid the wrapping shell and its +inherited process pipes as [mentioned above](#command). + +```php +$process = new Process('exec sleep 10'); +$process->start(); + +Loop::addTimer(2.0, function () use ($process) { + $process->terminate(); +}); +``` + +Many command line programs also wait for data on `STDIN` and terminate cleanly +when this pipe is closed. +For example, the following can be used to "soft-close" a `cat` process: + +```php +$process = new Process('cat'); +$process->start(); + +Loop::addTimer(2.0, function () use ($process) { + $process->stdin->end(); +}); +``` + +While process pipes and termination may seem confusing to newcomers, the above +properties actually allow some fine grained control over process termination, +such as first trying a soft-close and then applying a force-close after a +timeout. + +### Custom pipes + +Following common Unix conventions, this library will start each child process +with the three pipes matching the standard I/O streams by default. For more +advanced use cases it may be useful to pass in custom pipes, such as explicitly +passing additional file descriptors (FDs) or overriding default process pipes. + +Note that passing custom pipes is considered advanced usage and requires a +more in-depth understanding of Unix file descriptors and how they are inherited +to child processes and shared in multi-processing applications. + +If you do not want to use the default standard I/O pipes, you can explicitly +pass an array containing the file descriptor specification to the constructor +like this: + +```php +$fds = array( + // standard I/O pipes for stdin/stdout/stderr + 0 => array('pipe', 'r'), + 1 => array('pipe', 'w'), + 2 => array('pipe', 'w'), + + // example FDs for files or open resources + 4 => array('file', '/dev/null', 'r'), + 6 => fopen('log.txt','a'), + 8 => STDERR, + + // example FDs for sockets + 10 => fsockopen('localhost', 8080), + 12 => stream_socket_server('tcp://0.0.0.0:4711') +); + +$process = new Process($cmd, null, null, $fds); +$process->start(); +``` + +Unless your use case has special requirements that demand otherwise, you're +highly recommended to (at least) pass in the standard I/O pipes as given above. +The file descriptor specification accepts arguments in the exact same format +as the underlying [`proc_open()`](http://php.net/proc_open) function. + +Once the process is started, the `$pipes` array will always contain references to +all pipes as configured and the standard I/O references will always be set to +reference the pipes matching common Unix conventions. This library supports any +number of pipes and additional file descriptors, but many common applications +being run as a child process will expect that the parent process properly +assigns these file descriptors. + +### Sigchild Compatibility + +Internally, this project uses a work-around to improve compatibility when PHP +has been compiled with the `--enable-sigchild` option. This should not affect most +installations as this configure option is not used by default and many +distributions (such as Debian and Ubuntu) are known to not use this by default. +Some installations that use [Oracle OCI8](http://php.net/manual/en/book.oci8.php) +may use this configure option to circumvent `defunct` processes. + +When PHP has been compiled with the `--enable-sigchild` option, a child process' +exit code cannot be reliably determined via `proc_close()` or `proc_get_status()`. +To work around this, we execute the child process with an additional pipe and +use that to retrieve its exit code. + +This work-around incurs some overhead, so we only trigger this when necessary +and when we detect that PHP has been compiled with the `--enable-sigchild` option. +Because PHP does not provide a way to reliably detect this option, we try to +inspect output of PHP's configure options from the `phpinfo()` function. + +The static `setSigchildEnabled(bool $sigchild): void` method can be used to +explicitly enable or disable this behavior like this: + +```php +// advanced: not recommended by default +Process::setSigchildEnabled(true); +``` + +Note that all processes instantiated after this method call will be affected. +If this work-around is disabled on an affected PHP installation, the `exit` +event may receive `null` instead of the actual exit code as described above. +Similarly, some distributions are known to omit the configure options from +`phpinfo()`, so automatic detection may fail to enable this work-around in some +cases. You may then enable this explicitly as given above. + +**Note:** The original functionality was taken from Symfony's +[Process](https://github.com/symfony/process) compoment. + +### Windows Compatibility + +Due to platform constraints, this library provides only limited support for +spawning child processes on Windows. In particular, PHP does not allow accessing +standard I/O pipes on Windows without blocking. As such, this project will not +allow constructing a child process with the default process pipes and will +instead throw a `LogicException` on Windows by default: + +```php +// throws LogicException on Windows +$process = new Process('ping example.com'); +$process->start(); +``` + +There are a number of alternatives and workarounds as detailed below if you want +to run a child process on Windows, each with its own set of pros and cons: + +* As of PHP 8, you can start the child process with `socket` pair descriptors + in place of normal standard I/O pipes like this: + + ```php + $process = new Process( + 'ping example.com', + null, + null, + [ + ['socket'], + ['socket'], + ['socket'] + ] + ); + $process->start(); + + $process->stdout->on('data', function ($chunk) { + echo $chunk; + }); + ``` + + These `socket` pairs support non-blocking process I/O on any platform, + including Windows. However, not all programs accept stdio sockets. + +* This package does work on + [`Windows Subsystem for Linux`](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) + (or WSL) without issues. When you are in control over how your application is + deployed, we recommend [installing WSL](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide) + when you want to run this package on Windows. + +* If you only care about the exit code of a child process to check if its + execution was successful, you can use [custom pipes](#custom-pipes) to omit + any standard I/O pipes like this: + + ```php + $process = new Process('ping example.com', null, null, array()); + $process->start(); + + $process->on('exit', function ($exitcode) { + echo 'exit with ' . $exitcode . PHP_EOL; + }); + ``` + + Similarly, this is also useful if your child process communicates over + sockets with remote servers or even your parent process using the + [Socket component](https://github.com/reactphp/socket). This is usually + considered the best alternative if you have control over how your child + process communicates with the parent process. + +* If you only care about command output after the child process has been + executed, you can use [custom pipes](#custom-pipes) to configure file + handles to be passed to the child process instead of pipes like this: + + ```php + $process = new Process('ping example.com', null, null, array( + array('file', 'nul', 'r'), + $stdout = tmpfile(), + array('file', 'nul', 'w') + )); + $process->start(); + + $process->on('exit', function ($exitcode) use ($stdout) { + echo 'exit with ' . $exitcode . PHP_EOL; + + // rewind to start and then read full file (demo only, this is blocking). + // reading from shared file is only safe if you have some synchronization in place + // or after the child process has terminated. + rewind($stdout); + echo stream_get_contents($stdout); + fclose($stdout); + }); + ``` + + Note that this example uses `tmpfile()`/`fopen()` for illustration purposes only. + This should not be used in a truly async program because the filesystem is + inherently blocking and each call could potentially take several seconds. + See also the [Filesystem component](https://github.com/reactphp/filesystem) as an + alternative. + +* If you want to access command output as it happens in a streaming fashion, + you can use redirection to spawn an additional process to forward your + standard I/O streams to a socket and use [custom pipes](#custom-pipes) to + omit any actual standard I/O pipes like this: + + ```php + $server = new React\Socket\Server('127.0.0.1:0'); + $server->on('connection', function (React\Socket\ConnectionInterface $connection) { + $connection->on('data', function ($chunk) { + echo $chunk; + }); + }); + + $command = 'ping example.com | foobar ' . escapeshellarg($server->getAddress()); + $process = new Process($command, null, null, array()); + $process->start(); + + $process->on('exit', function ($exitcode) use ($server) { + $server->close(); + echo 'exit with ' . $exitcode . PHP_EOL; + }); + ``` + + Note how this will spawn another fictional `foobar` helper program to consume + the standard output from the actual child process. This is in fact similar + to the above recommendation of using socket connections in the child process, + but in this case does not require modification of the actual child process. + + In this example, the fictional `foobar` helper program can be implemented by + simply consuming all data from standard input and forwarding it to a socket + connection like this: + + ```php + $socket = stream_socket_client($argv[1]); + do { + fwrite($socket, $data = fread(STDIN, 8192)); + } while (isset($data[0])); + ``` + + Accordingly, this example can also be run with plain PHP without having to + rely on any external helper program like this: + + ```php + $code = '$s=stream_socket_client($argv[1]);do{fwrite($s,$d=fread(STDIN, 8192));}while(isset($d[0]));'; + $command = 'ping example.com | php -r ' . escapeshellarg($code) . ' ' . escapeshellarg($server->getAddress()); + $process = new Process($command, null, null, array()); + $process->start(); + ``` + + See also [example #23](examples/23-forward-socket.php). + + Note that this is for illustration purposes only and you may want to implement + some proper error checks and/or socket verification in actual production use + if you do not want to risk other processes connecting to the server socket. + In this case, we suggest looking at the excellent + [createprocess-windows](https://github.com/cubiclesoft/createprocess-windows). + +Additionally, note that the [command](#command) given to the `Process` will be +passed to the underlying Windows-API +([`CreateProcess`](https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa)) +as-is and the process will not be launched in a wrapping shell by default. In +particular, this means that shell built-in functions such as `echo hello` or +`sleep 10` may have to be prefixed with an explicit shell command like this: + +```php +$process = new Process('cmd /c echo hello', null, null, $pipes); +$process->start(); +``` + +## Install + +The recommended way to install this library is [through Composer](https://getcomposer.org/). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) + +This will install the latest supported version: + +```bash +composer require react/child-process:^0.6.6 +``` + +See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. + +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.3 through current PHP 8+ and HHVM. +It's *highly recommended to use the latest supported PHP version* for this project. + +See above note for limited [Windows Compatibility](#windows-compatibility). + +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org/): + +```bash +composer install +``` + +To run the test suite, go to the project root and run: + +```bash +vendor/bin/phpunit +``` + +## License + +MIT, see [LICENSE file](LICENSE). diff --git a/tools/php-cs-fixer/vendor/react/child-process/composer.json b/tools/php-cs-fixer/vendor/react/child-process/composer.json new file mode 100644 index 00000000..fba70b88 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/child-process/composer.json @@ -0,0 +1,49 @@ +{ + "name": "react/child-process", + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": ["process", "event-driven", "ReactPHP"], + "license": "MIT", + "authors": [ + { + "name": "Christian Lück", + "homepage": "https://clue.engineering/", + "email": "christian@clue.engineering" + }, + { + "name": "Cees-Jan Kiewiet", + "homepage": "https://wyrihaximus.net/", + "email": "reactphp@ceesjankiewiet.nl" + }, + { + "name": "Jan Sorgalla", + "homepage": "https://sorgalla.com/", + "email": "jsorgalla@gmail.com" + }, + { + "name": "Chris Boden", + "homepage": "https://cboden.dev/", + "email": "cboden@gmail.com" + } + ], + "require": { + "php": ">=5.3.0", + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "React\\Tests\\ChildProcess\\": "tests/" + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/child-process/src/Process.php b/tools/php-cs-fixer/vendor/react/child-process/src/Process.php new file mode 100644 index 00000000..7af5de75 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/child-process/src/Process.php @@ -0,0 +1,585 @@ +start(); + * + * $process->on('exit', function ($code, $term) { + * if ($term === null) { + * echo 'exit with code ' . $code . PHP_EOL; + * } else { + * echo 'terminated with signal ' . $term . PHP_EOL; + * } + * }); + * ``` + * + * Note that `$code` is `null` if the process has terminated, but the exit + * code could not be determined (for example + * [sigchild compatibility](#sigchild-compatibility) was disabled). + * Similarly, `$term` is `null` unless the process has terminated in response to + * an uncaught signal sent to it. + * This is not a limitation of this project, but actual how exit codes and signals + * are exposed on POSIX systems, for more details see also + * [here](https://unix.stackexchange.com/questions/99112/default-exit-code-when-process-is-terminated). + * + * It's also worth noting that process termination depends on all file descriptors + * being closed beforehand. + * This means that all [process pipes](#stream-properties) will emit a `close` + * event before the `exit` event and that no more `data` events will arrive after + * the `exit` event. + * Accordingly, if either of these pipes is in a paused state (`pause()` method + * or internally due to a `pipe()` call), this detection may not trigger. + */ +class Process extends EventEmitter +{ + /** + * @var WritableStreamInterface|null|DuplexStreamInterface|ReadableStreamInterface + */ + public $stdin; + + /** + * @var ReadableStreamInterface|null|DuplexStreamInterface|WritableStreamInterface + */ + public $stdout; + + /** + * @var ReadableStreamInterface|null|DuplexStreamInterface|WritableStreamInterface + */ + public $stderr; + + /** + * Array with all process pipes (once started) + * + * Unless explicitly configured otherwise during construction, the following + * standard I/O pipes will be assigned by default: + * - 0: STDIN (`WritableStreamInterface`) + * - 1: STDOUT (`ReadableStreamInterface`) + * - 2: STDERR (`ReadableStreamInterface`) + * + * @var array + */ + public $pipes = array(); + + private $cmd; + private $cwd; + private $env; + private $fds; + + private $enhanceSigchildCompatibility; + private $sigchildPipe; + + private $process; + private $status; + private $exitCode; + private $fallbackExitCode; + private $stopSignal; + private $termSignal; + + private static $sigchild; + + /** + * Constructor. + * + * @param string $cmd Command line to run + * @param null|string $cwd Current working directory or null to inherit + * @param null|array $env Environment variables or null to inherit + * @param null|array $fds File descriptors to allocate for this process (or null = default STDIO streams) + * @throws \LogicException On windows or when proc_open() is not installed + */ + public function __construct($cmd, $cwd = null, $env = null, $fds = null) + { + if ($env !== null && !\is_array($env)) { // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #3 ($env) expected null|array'); + } + if ($fds !== null && !\is_array($fds)) { // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #4 ($fds) expected null|array'); + } + if (!\function_exists('proc_open')) { + throw new \LogicException('The Process class relies on proc_open(), which is not available on your PHP installation.'); + } + + $this->cmd = $cmd; + $this->cwd = $cwd; + + if (null !== $env) { + $this->env = array(); + foreach ($env as $key => $value) { + $this->env[(binary) $key] = (binary) $value; + } + } + + if ($fds === null) { + $fds = array( + array('pipe', 'r'), // stdin + array('pipe', 'w'), // stdout + array('pipe', 'w'), // stderr + ); + } + + if (\DIRECTORY_SEPARATOR === '\\') { + foreach ($fds as $fd) { + if (isset($fd[0]) && $fd[0] === 'pipe') { + throw new \LogicException('Process pipes are not supported on Windows due to their blocking nature on Windows'); + } + } + } + + $this->fds = $fds; + $this->enhanceSigchildCompatibility = self::isSigchildEnabled(); + } + + /** + * Start the process. + * + * After the process is started, the standard I/O streams will be constructed + * and available via public properties. + * + * This method takes an optional `LoopInterface|null $loop` parameter that can be used to + * pass the event loop instance to use for this process. You can use a `null` value + * here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). + * This value SHOULD NOT be given unless you're sure you want to explicitly use a + * given event loop instance. + * + * @param ?LoopInterface $loop Loop interface for stream construction + * @param float $interval Interval to periodically monitor process state (seconds) + * @throws \RuntimeException If the process is already running or fails to start + */ + public function start($loop = null, $interval = 0.1) + { + if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #1 ($loop) expected null|React\EventLoop\LoopInterface'); + } + if ($this->isRunning()) { + throw new \RuntimeException('Process is already running'); + } + + $loop = $loop ?: Loop::get(); + $cmd = $this->cmd; + $fdSpec = $this->fds; + $sigchild = null; + + // Read exit code through fourth pipe to work around --enable-sigchild + if ($this->enhanceSigchildCompatibility) { + $fdSpec[] = array('pipe', 'w'); + \end($fdSpec); + $sigchild = \key($fdSpec); + + // make sure this is fourth or higher (do not mess with STDIO) + if ($sigchild < 3) { + $fdSpec[3] = $fdSpec[$sigchild]; + unset($fdSpec[$sigchild]); + $sigchild = 3; + } + + $cmd = \sprintf('(%s) ' . $sigchild . '>/dev/null; code=$?; echo $code >&' . $sigchild . '; exit $code', $cmd); + } + + // on Windows, we do not launch the given command line in a shell (cmd.exe) by default and omit any error dialogs + // the cmd.exe shell can explicitly be given as part of the command as detailed in both documentation and tests + $options = array(); + if (\DIRECTORY_SEPARATOR === '\\') { + $options['bypass_shell'] = true; + $options['suppress_errors'] = true; + } + + $errstr = ''; + \set_error_handler(function ($_, $error) use (&$errstr) { + // Match errstr from PHP's warning message. + // proc_open(/dev/does-not-exist): Failed to open stream: No such file or directory + $errstr = $error; + }); + + $pipes = array(); + $this->process = @\proc_open($cmd, $fdSpec, $pipes, $this->cwd, $this->env, $options); + + \restore_error_handler(); + + if (!\is_resource($this->process)) { + throw new \RuntimeException('Unable to launch a new process: ' . $errstr); + } + + // count open process pipes and await close event for each to drain buffers before detecting exit + $that = $this; + $closeCount = 0; + $streamCloseHandler = function () use (&$closeCount, $loop, $interval, $that) { + $closeCount--; + + if ($closeCount > 0) { + return; + } + + // process already closed => report immediately + if (!$that->isRunning()) { + $that->close(); + $that->emit('exit', array($that->getExitCode(), $that->getTermSignal())); + return; + } + + // close not detected immediately => check regularly + $loop->addPeriodicTimer($interval, function ($timer) use ($that, $loop) { + if (!$that->isRunning()) { + $loop->cancelTimer($timer); + $that->close(); + $that->emit('exit', array($that->getExitCode(), $that->getTermSignal())); + } + }); + }; + + if ($sigchild !== null) { + $this->sigchildPipe = $pipes[$sigchild]; + unset($pipes[$sigchild]); + } + + foreach ($pipes as $n => $fd) { + // use open mode from stream meta data or fall back to pipe open mode for legacy HHVM + $meta = \stream_get_meta_data($fd); + $mode = $meta['mode'] === '' ? ($this->fds[$n][1] === 'r' ? 'w' : 'r') : $meta['mode']; + + if ($mode === 'r+') { + $stream = new DuplexResourceStream($fd, $loop); + $stream->on('close', $streamCloseHandler); + $closeCount++; + } elseif ($mode === 'w') { + $stream = new WritableResourceStream($fd, $loop); + } else { + $stream = new ReadableResourceStream($fd, $loop); + $stream->on('close', $streamCloseHandler); + $closeCount++; + } + $this->pipes[$n] = $stream; + } + + $this->stdin = isset($this->pipes[0]) ? $this->pipes[0] : null; + $this->stdout = isset($this->pipes[1]) ? $this->pipes[1] : null; + $this->stderr = isset($this->pipes[2]) ? $this->pipes[2] : null; + + // immediately start checking for process exit when started without any I/O pipes + if (!$closeCount) { + $streamCloseHandler(); + } + } + + /** + * Close the process. + * + * This method should only be invoked via the periodic timer that monitors + * the process state. + */ + public function close() + { + if ($this->process === null) { + return; + } + + foreach ($this->pipes as $pipe) { + $pipe->close(); + } + + if ($this->enhanceSigchildCompatibility) { + $this->pollExitCodePipe(); + $this->closeExitCodePipe(); + } + + $exitCode = \proc_close($this->process); + $this->process = null; + + if ($this->exitCode === null && $exitCode !== -1) { + $this->exitCode = $exitCode; + } + + if ($this->exitCode === null && $this->status['exitcode'] !== -1) { + $this->exitCode = $this->status['exitcode']; + } + + if ($this->exitCode === null && $this->fallbackExitCode !== null) { + $this->exitCode = $this->fallbackExitCode; + $this->fallbackExitCode = null; + } + } + + /** + * Terminate the process with an optional signal. + * + * @param int $signal Optional signal (default: SIGTERM) + * @return bool Whether the signal was sent successfully + */ + public function terminate($signal = null) + { + if ($this->process === null) { + return false; + } + + if ($signal !== null) { + return \proc_terminate($this->process, $signal); + } + + return \proc_terminate($this->process); + } + + /** + * Get the command string used to launch the process. + * + * @return string + */ + public function getCommand() + { + return $this->cmd; + } + + /** + * Get the exit code returned by the process. + * + * This value is only meaningful if isRunning() has returned false. Null + * will be returned if the process is still running. + * + * Null may also be returned if the process has terminated, but the exit + * code could not be determined (e.g. sigchild compatibility was disabled). + * + * @return int|null + */ + public function getExitCode() + { + return $this->exitCode; + } + + /** + * Get the process ID. + * + * @return int|null + */ + public function getPid() + { + $status = $this->getCachedStatus(); + + return $status !== null ? $status['pid'] : null; + } + + /** + * Get the signal that caused the process to stop its execution. + * + * This value is only meaningful if isStopped() has returned true. Null will + * be returned if the process was never stopped. + * + * @return int|null + */ + public function getStopSignal() + { + return $this->stopSignal; + } + + /** + * Get the signal that caused the process to terminate its execution. + * + * This value is only meaningful if isTerminated() has returned true. Null + * will be returned if the process was never terminated. + * + * @return int|null + */ + public function getTermSignal() + { + return $this->termSignal; + } + + /** + * Return whether the process is still running. + * + * @return bool + */ + public function isRunning() + { + if ($this->process === null) { + return false; + } + + $status = $this->getFreshStatus(); + + return $status !== null ? $status['running'] : false; + } + + /** + * Return whether the process has been stopped by a signal. + * + * @return bool + */ + public function isStopped() + { + $status = $this->getFreshStatus(); + + return $status !== null ? $status['stopped'] : false; + } + + /** + * Return whether the process has been terminated by an uncaught signal. + * + * @return bool + */ + public function isTerminated() + { + $status = $this->getFreshStatus(); + + return $status !== null ? $status['signaled'] : false; + } + + /** + * Return whether PHP has been compiled with the '--enable-sigchild' option. + * + * @see \Symfony\Component\Process\Process::isSigchildEnabled() + * @return bool + */ + public final static function isSigchildEnabled() + { + if (null !== self::$sigchild) { + return self::$sigchild; + } + + if (!\function_exists('phpinfo')) { + return self::$sigchild = false; // @codeCoverageIgnore + } + + \ob_start(); + \phpinfo(INFO_GENERAL); + + return self::$sigchild = false !== \strpos(\ob_get_clean(), '--enable-sigchild'); + } + + /** + * Enable or disable sigchild compatibility mode. + * + * Sigchild compatibility mode is required to get the exit code and + * determine the success of a process when PHP has been compiled with + * the --enable-sigchild option. + * + * @param bool $sigchild + * @return void + */ + public final static function setSigchildEnabled($sigchild) + { + self::$sigchild = (bool) $sigchild; + } + + /** + * Check the fourth pipe for an exit code. + * + * This should only be used if --enable-sigchild compatibility was enabled. + */ + private function pollExitCodePipe() + { + if ($this->sigchildPipe === null) { + return; + } + + $r = array($this->sigchildPipe); + $w = $e = null; + + $n = @\stream_select($r, $w, $e, 0); + + if (1 !== $n) { + return; + } + + $data = \fread($r[0], 8192); + + if (\strlen($data) > 0) { + $this->fallbackExitCode = (int) $data; + } + } + + /** + * Close the fourth pipe used to relay an exit code. + * + * This should only be used if --enable-sigchild compatibility was enabled. + */ + private function closeExitCodePipe() + { + if ($this->sigchildPipe === null) { + return; + } + + \fclose($this->sigchildPipe); + $this->sigchildPipe = null; + } + + /** + * Return the cached process status. + * + * @return array + */ + private function getCachedStatus() + { + if ($this->status === null) { + $this->updateStatus(); + } + + return $this->status; + } + + /** + * Return the updated process status. + * + * @return array + */ + private function getFreshStatus() + { + $this->updateStatus(); + + return $this->status; + } + + /** + * Update the process status, stop/term signals, and exit code. + * + * Stop/term signals are only updated if the process is currently stopped or + * signaled, respectively. Otherwise, signal values will remain as-is so the + * corresponding getter methods may be used at a later point in time. + */ + private function updateStatus() + { + if ($this->process === null) { + return; + } + + $this->status = \proc_get_status($this->process); + + if ($this->status === false) { + throw new \UnexpectedValueException('proc_get_status() failed'); + } + + if ($this->status['stopped']) { + $this->stopSignal = $this->status['stopsig']; + } + + if ($this->status['signaled']) { + $this->termSignal = $this->status['termsig']; + } + + if (!$this->status['running'] && -1 !== $this->status['exitcode']) { + $this->exitCode = $this->status['exitcode']; + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/CHANGELOG.md b/tools/php-cs-fixer/vendor/react/dns/CHANGELOG.md new file mode 100644 index 00000000..bc1055fc --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/CHANGELOG.md @@ -0,0 +1,452 @@ +# Changelog + +## 1.13.0 (2024-06-13) + +* Feature: Improve PHP 8.4+ support by avoiding implicitly nullable type declarations. + (#224 by @WyriHaximus) + +## 1.12.0 (2023-11-29) + +* Feature: Full PHP 8.3 compatibility. + (#217 by @sergiy-petrov) + +* Update test environment and avoid unhandled promise rejections. + (#215, #216 and #218 by @clue) + +## 1.11.0 (2023-06-02) + +* Feature: Include timeout logic to avoid dependency on reactphp/promise-timer. + (#213 by @clue) + +* Improve test suite and project setup and report failed assertions. + (#210 by @clue, #212 by @WyriHaximus and #209 and #211 by @SimonFrings) + +## 1.10.0 (2022-09-08) + +* Feature: Full support for PHP 8.2 release. + (#201 by @clue and #207 by @WyriHaximus) + +* Feature: Optimize forward compatibility with Promise v3, avoid hitting autoloader. + (#202 by @clue) + +* Feature / Fix: Improve error reporting when custom error handler is used. + (#197 by @clue) + +* Fix: Fix invalid references in exception stack trace. + (#191 by @clue) + +* Minor documentation improvements. + (#195 by @SimonFrings and #203 by @nhedger) + +* Improve test suite, update to use default loop and new reactphp/async package. + (#204, #205 and #206 by @clue and #196 by @SimonFrings) + +## 1.9.0 (2021-12-20) + +* Feature: Full support for PHP 8.1 release and prepare PHP 8.2 compatibility + by refactoring `Parser` to avoid assigning dynamic properties. + (#188 and #186 by @clue and #184 by @SimonFrings) + +* Feature: Avoid dependency on `ext-filter`. + (#185 by @clue) + +* Feature / Fix: Skip invalid nameserver entries from `resolv.conf` and ignore IPv6 zone IDs. + (#187 by @clue) + +* Feature / Fix: Reduce socket read chunk size for queries over TCP/IP. + (#189 by @clue) + +## 1.8.0 (2021-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). + +* Feature: Simplify usage by supporting new [default loop](https://reactphp.org/event-loop/#loop). + (#182 by @clue) + + ```php + // old (still supported) + $factory = new React\Dns\Resolver\Factory(); + $resolver = $factory->create($config, $loop); + + // new (using default loop) + $factory = new React\Dns\Resolver\Factory(); + $resolver = $factory->create($config); + ``` + +## 1.7.0 (2021-06-25) + +* Feature: Update DNS `Factory` to accept complete `Config` object. + Add new `FallbackExecutor` and use fallback DNS servers when `Config` lists multiple servers. + (#179 and #180 by @clue) + + ```php + // old (still supported) + $config = React\Dns\Config\Config::loadSystemConfigBlocking(); + $server = $config->nameservers ? reset($config->nameservers) : '8.8.8.8'; + $resolver = $factory->create($server, $loop); + + // new + $config = React\Dns\Config\Config::loadSystemConfigBlocking(); + if (!$config->nameservers) { + $config->nameservers[] = '8.8.8.8'; + } + $resolver = $factory->create($config, $loop); + ``` + +## 1.6.0 (2021-06-21) + +* Feature: Add support for legacy `SPF` record type. + (#178 by @akondas and @clue) + +* Fix: Fix integer overflow for TCP/IP chunk size on 32 bit platforms. + (#177 by @clue) + +## 1.5.0 (2021-03-05) + +* Feature: Improve error reporting when query fails, include domain and query type and DNS server address where applicable. + (#174 by @clue) + +* Feature: Improve error handling when sending data to DNS server fails (macOS). + (#171 and #172 by @clue) + +* Fix: Improve DNS response parser to limit recursion for compressed labels. + (#169 by @clue) + +* Improve test suite, use GitHub actions for continuous integration (CI). + (#170 by @SimonFrings) + +## 1.4.0 (2020-09-18) + +* Feature: Support upcoming PHP 8. + (#168 by @clue) + +* Improve test suite and update to PHPUnit 9.3. + (#164 by @clue, #165 and #166 by @SimonFrings and #167 by @WyriHaximus) + +## 1.3.0 (2020-07-10) + +* Feature: Forward compatibility with react/promise v3. + (#153 by @WyriHaximus) + +* Feature: Support parsing `OPT` records (EDNS0). + (#157 by @clue) + +* Fix: Avoid PHP warnings due to lack of args in exception trace on PHP 7.4. + (#160 by @clue) + +* Improve test suite and add `.gitattributes` to exclude dev files from exports. + Run tests on PHPUnit 9 and PHP 7.4 and clean up test suite. + (#154 by @reedy, #156 by @clue and #163 by @SimonFrings) + +## 1.2.0 (2019-08-15) + +* Feature: Add `TcpTransportExecutor` to send DNS queries over TCP/IP connection, + add `SelectiveTransportExecutor` to retry with TCP if UDP is truncated and + automatically select transport protocol when no explicit `udp://` or `tcp://` scheme is given in `Factory`. + (#145, #146, #147 and #148 by @clue) + +* Feature: Support escaping literal dots and special characters in domain names. + (#144 by @clue) + +## 1.1.0 (2019-07-18) + +* Feature: Support parsing `CAA` and `SSHFP` records. + (#141 and #142 by @clue) + +* Feature: Add `ResolverInterface` as common interface for `Resolver` class. + (#139 by @clue) + +* Fix: Add missing private property definitions and + remove unneeded dependency on `react/stream`. + (#140 and #143 by @clue) + +## 1.0.0 (2019-07-11) + +* First stable LTS release, now following [SemVer](https://semver.org/). + We'd like to emphasize that this component is production ready and battle-tested. + We plan to support all long-term support (LTS) releases for at least 24 months, + so you have a rock-solid foundation to build on top of. + +This update involves a number of BC breaks due to dropped support for +deprecated functionality and some internal API cleanup. We've tried hard to +avoid BC breaks where possible and minimize impact otherwise. We expect that +most consumers of this package will actually not be affected by any BC +breaks, see below for more details: + +* BC break: Delete all deprecated APIs, use `Query` objects for `Message` questions + instead of nested arrays and increase code coverage to 100%. + (#130 by @clue) + +* BC break: Move `$nameserver` from `ExecutorInterface` to `UdpTransportExecutor`, + remove advanced/internal `UdpTransportExecutor` args for `Parser`/`BinaryDumper` and + add API documentation for `ExecutorInterface`. + (#135, #137 and #138 by @clue) + +* BC break: Replace `HeaderBag` attributes with simple `Message` properties. + (#132 by @clue) + +* BC break: Mark all `Record` attributes as required, add documentation vs `Query`. + (#136 by @clue) + +* BC break: Mark all classes as final to discourage inheritance + (#134 by @WyriHaximus) + +## 0.4.19 (2019-07-10) + +* Feature: Avoid garbage references when DNS resolution rejects on legacy PHP <= 5.6. + (#133 by @clue) + +## 0.4.18 (2019-09-07) + +* Feature / Fix: Implement `CachingExecutor` using cache TTL, deprecate old `CachedExecutor`, + respect TTL from response records when caching and do not cache truncated responses. + (#129 by @clue) + +* Feature: Limit cache size to 256 last responses by default. + (#127 by @clue) + +* Feature: Cooperatively resolve hosts to avoid running same query concurrently. + (#125 by @clue) + +## 0.4.17 (2019-04-01) + +* Feature: Support parsing `authority` and `additional` records from DNS response. + (#123 by @clue) + +* Feature: Support dumping records as part of outgoing binary DNS message. + (#124 by @clue) + +* Feature: Forward compatibility with upcoming Cache v0.6 and Cache v1.0 + (#121 by @clue) + +* Improve test suite to add forward compatibility with PHPUnit 7, + test against PHP 7.3 and use legacy PHPUnit 5 on legacy HHVM. + (#122 by @clue) + +## 0.4.16 (2018-11-11) + +* Feature: Improve promise cancellation for DNS lookup retries and clean up any garbage references. + (#118 by @clue) + +* Fix: Reject parsing malformed DNS response messages such as incomplete DNS response messages, + malformed record data or malformed compressed domain name labels. + (#115 and #117 by @clue) + +* Fix: Fix interpretation of TTL as UINT32 with most significant bit unset. + (#116 by @clue) + +* Fix: Fix caching advanced MX/SRV/TXT/SOA structures. + (#112 by @clue) + +## 0.4.15 (2018-07-02) + +* Feature: Add `resolveAll()` method to support custom query types in `Resolver`. + (#110 by @clue and @WyriHaximus) + + ```php + $resolver->resolveAll('reactphp.org', Message::TYPE_AAAA)->then(function ($ips) { + echo 'IPv6 addresses for reactphp.org ' . implode(', ', $ips) . PHP_EOL; + }); + ``` + +* Feature: Support parsing `NS`, `TXT`, `MX`, `SOA` and `SRV` records. + (#104, #105, #106, #107 and #108 by @clue) + +* Feature: Add support for `Message::TYPE_ANY` and parse unknown types as binary data. + (#104 by @clue) + +* Feature: Improve error messages for failed queries and improve documentation. + (#109 by @clue) + +* Feature: Add reverse DNS lookup example. + (#111 by @clue) + +## 0.4.14 (2018-06-26) + +* Feature: Add `UdpTransportExecutor`, validate incoming DNS response messages + to avoid cache poisoning attacks and deprecate legacy `Executor`. + (#101 and #103 by @clue) + +* Feature: Forward compatibility with Cache 0.5 + (#102 by @clue) + +* Deprecate legacy `Query::$currentTime` and binary parser data attributes to clean up and simplify API. + (#99 by @clue) + +## 0.4.13 (2018-02-27) + +* Add `Config::loadSystemConfigBlocking()` to load default system config + and support parsing DNS config on all supported platforms + (`/etc/resolv.conf` on Unix/Linux/Mac and WMIC on Windows) + (#92, #93, #94 and #95 by @clue) + + ```php + $config = Config::loadSystemConfigBlocking(); + $server = $config->nameservers ? reset($config->nameservers) : '8.8.8.8'; + ``` + +* Remove unneeded cyclic dependency on react/socket + (#96 by @clue) + +## 0.4.12 (2018-01-14) + +* Improve test suite by adding forward compatibility with PHPUnit 6, + test against PHP 7.2, fix forward compatibility with upcoming EventLoop releases, + add test group to skip integration tests relying on internet connection + and add minor documentation improvements. + (#85 and #87 by @carusogabriel, #88 and #89 by @clue and #83 by @jsor) + +## 0.4.11 (2017-08-25) + +* Feature: Support resolving from default hosts file + (#75, #76 and #77 by @clue) + + This means that resolving hosts such as `localhost` will now work as + expected across all platforms with no changes required: + + ```php + $resolver->resolve('localhost')->then(function ($ip) { + echo 'IP: ' . $ip; + }); + ``` + + The new `HostsExecutor` exists for advanced usage and is otherwise used + internally for this feature. + +## 0.4.10 (2017-08-10) + +* Feature: Forward compatibility with EventLoop v1.0 and v0.5 and + lock minimum dependencies and work around circular dependency for tests + (#70 and #71 by @clue) + +* Fix: Work around DNS timeout issues for Windows users + (#74 by @clue) + +* Documentation and examples for advanced usage + (#66 by @WyriHaximus) + +* Remove broken TCP code, do not retry with invalid TCP query + (#73 by @clue) + +* Improve test suite by fixing HHVM build for now again and ignore future HHVM build errors and + lock Travis distro so new defaults will not break the build and + fix failing tests for PHP 7.1 + (#68 by @WyriHaximus and #69 and #72 by @clue) + +## 0.4.9 (2017-05-01) + +* Feature: Forward compatibility with upcoming Socket v1.0 and v0.8 + (#61 by @clue) + +## 0.4.8 (2017-04-16) + +* Feature: Add support for the AAAA record type to the protocol parser + (#58 by @othillo) + +* Feature: Add support for the PTR record type to the protocol parser + (#59 by @othillo) + +## 0.4.7 (2017-03-31) + +* Feature: Forward compatibility with upcoming Socket v0.6 and v0.7 component + (#57 by @clue) + +## 0.4.6 (2017-03-11) + +* Fix: Fix DNS timeout issues for Windows users and add forward compatibility + with Stream v0.5 and upcoming v0.6 + (#53 by @clue) + +* Improve test suite by adding PHPUnit to `require-dev` + (#54 by @clue) + +## 0.4.5 (2017-03-02) + +* Fix: Ensure we ignore the case of the answer + (#51 by @WyriHaximus) + +* Feature: Add `TimeoutExecutor` and simplify internal APIs to allow internal + code re-use for upcoming versions. + (#48 and #49 by @clue) + +## 0.4.4 (2017-02-13) + +* Fix: Fix handling connection and stream errors + (#45 by @clue) + +* Feature: Add examples and forward compatibility with upcoming Socket v0.5 component + (#46 and #47 by @clue) + +## 0.4.3 (2016-07-31) + +* Feature: Allow for cache adapter injection (#38 by @WyriHaximus) + + ```php + $factory = new React\Dns\Resolver\Factory(); + + $cache = new MyCustomCacheInstance(); + $resolver = $factory->createCached('8.8.8.8', $loop, $cache); + ``` + +* Feature: Support Promise cancellation (#35 by @clue) + + ```php + $promise = $resolver->resolve('reactphp.org'); + + $promise->cancel(); + ``` + +## 0.4.2 (2016-02-24) + +* Repository maintenance, split off from main repo, improve test suite and documentation +* First class support for PHP7 and HHVM (#34 by @clue) +* Adjust compatibility to 5.3 (#30 by @clue) + +## 0.4.1 (2014-04-13) + +* Bug fix: Fixed PSR-4 autoload path (@marcj/WyriHaximus) + +## 0.4.0 (2014-02-02) + +* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks +* BC break: Update to React/Promise 2.0 +* Bug fix: Properly resolve CNAME aliases +* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0 +* Bump React dependencies to v0.4 + +## 0.3.2 (2013-05-10) + +* Feature: Support default port for IPv6 addresses (@clue) + +## 0.3.0 (2013-04-14) + +* Bump React dependencies to v0.3 + +## 0.2.6 (2012-12-26) + +* Feature: New cache component, used by DNS + +## 0.2.5 (2012-11-26) + +* Version bump + +## 0.2.4 (2012-11-18) + +* Feature: Change to promise-based API (@jsor) + +## 0.2.3 (2012-11-14) + +* Version bump + +## 0.2.2 (2012-10-28) + +* Feature: DNS executor timeout handling (@arnaud-lb) +* Feature: DNS retry executor (@arnaud-lb) + +## 0.2.1 (2012-10-14) + +* Minor adjustments to DNS parser + +## 0.2.0 (2012-09-10) + +* Feature: DNS resolver diff --git a/tools/php-cs-fixer/vendor/react/dns/LICENSE b/tools/php-cs-fixer/vendor/react/dns/LICENSE new file mode 100644 index 00000000..d6f8901f --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/dns/README.md b/tools/php-cs-fixer/vendor/react/dns/README.md new file mode 100644 index 00000000..9f83a944 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/README.md @@ -0,0 +1,453 @@ +# DNS + +[![CI status](https://github.com/reactphp/dns/actions/workflows/ci.yml/badge.svg)](https://github.com/reactphp/dns/actions) +[![installs on Packagist](https://img.shields.io/packagist/dt/react/dns?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/dns) + +Async DNS resolver for [ReactPHP](https://reactphp.org/). + +The main point of the DNS component is to provide async DNS resolution. +However, it is really a toolkit for working with DNS messages, and could +easily be used to create a DNS server. + +**Table of contents** + +* [Basic usage](#basic-usage) +* [Caching](#caching) + * [Custom cache adapter](#custom-cache-adapter) +* [ResolverInterface](#resolverinterface) + * [resolve()](#resolve) + * [resolveAll()](#resolveall) +* [Advanced usage](#advanced-usage) + * [UdpTransportExecutor](#udptransportexecutor) + * [TcpTransportExecutor](#tcptransportexecutor) + * [SelectiveTransportExecutor](#selectivetransportexecutor) + * [HostsFileExecutor](#hostsfileexecutor) +* [Install](#install) +* [Tests](#tests) +* [License](#license) +* [References](#references) + +## Basic usage + +The most basic usage is to just create a resolver through the resolver +factory. All you need to give it is a nameserver, then you can start resolving +names, baby! + +```php +$config = React\Dns\Config\Config::loadSystemConfigBlocking(); +if (!$config->nameservers) { + $config->nameservers[] = '8.8.8.8'; +} + +$factory = new React\Dns\Resolver\Factory(); +$dns = $factory->create($config); + +$dns->resolve('igor.io')->then(function ($ip) { + echo "Host: $ip\n"; +}); +``` + +See also the [first example](examples). + +The `Config` class can be used to load the system default config. This is an +operation that may access the filesystem and block. Ideally, this method should +thus be executed only once before the loop starts and not repeatedly while it is +running. +Note that this class may return an *empty* configuration if the system config +can not be loaded. As such, you'll likely want to apply a default nameserver +as above if none can be found. + +> Note that the factory loads the hosts file from the filesystem once when + creating the resolver instance. + Ideally, this method should thus be executed only once before the loop starts + and not repeatedly while it is running. + +But there's more. + +## Caching + +You can cache results by configuring the resolver to use a `CachedExecutor`: + +```php +$config = React\Dns\Config\Config::loadSystemConfigBlocking(); +if (!$config->nameservers) { + $config->nameservers[] = '8.8.8.8'; +} + +$factory = new React\Dns\Resolver\Factory(); +$dns = $factory->createCached($config); + +$dns->resolve('igor.io')->then(function ($ip) { + echo "Host: $ip\n"; +}); + +... + +$dns->resolve('igor.io')->then(function ($ip) { + echo "Host: $ip\n"; +}); +``` + +If the first call returns before the second, only one query will be executed. +The second result will be served from an in memory cache. +This is particularly useful for long running scripts where the same hostnames +have to be looked up multiple times. + +See also the [third example](examples). + +### Custom cache adapter + +By default, the above will use an in memory cache. + +You can also specify a custom cache implementing [`CacheInterface`](https://github.com/reactphp/cache) to handle the record cache instead: + +```php +$cache = new React\Cache\ArrayCache(); +$factory = new React\Dns\Resolver\Factory(); +$dns = $factory->createCached('8.8.8.8', null, $cache); +``` + +See also the wiki for possible [cache implementations](https://github.com/reactphp/react/wiki/Users#cache-implementations). + +## ResolverInterface + + + +### resolve() + +The `resolve(string $domain): PromiseInterface` method can be used to +resolve the given $domain name to a single IPv4 address (type `A` query). + +```php +$resolver->resolve('reactphp.org')->then(function ($ip) { + echo 'IP for reactphp.org is ' . $ip . PHP_EOL; +}); +``` + +This is one of the main methods in this package. It sends a DNS query +for the given $domain name to your DNS server and returns a single IP +address on success. + +If the DNS server sends a DNS response message that contains more than +one IP address for this query, it will randomly pick one of the IP +addresses from the response. If you want the full list of IP addresses +or want to send a different type of query, you should use the +[`resolveAll()`](#resolveall) method instead. + +If the DNS server sends a DNS response message that indicates an error +code, this method will reject with a `RecordNotFoundException`. Its +message and code can be used to check for the response code. + +If the DNS communication fails and the server does not respond with a +valid response message, this message will reject with an `Exception`. + +Pending DNS queries can be cancelled by cancelling its pending promise like so: + +```php +$promise = $resolver->resolve('reactphp.org'); + +$promise->cancel(); +``` + +### resolveAll() + +The `resolveAll(string $host, int $type): PromiseInterface` method can be used to +resolve all record values for the given $domain name and query $type. + +```php +$resolver->resolveAll('reactphp.org', Message::TYPE_A)->then(function ($ips) { + echo 'IPv4 addresses for reactphp.org ' . implode(', ', $ips) . PHP_EOL; +}); + +$resolver->resolveAll('reactphp.org', Message::TYPE_AAAA)->then(function ($ips) { + echo 'IPv6 addresses for reactphp.org ' . implode(', ', $ips) . PHP_EOL; +}); +``` + +This is one of the main methods in this package. It sends a DNS query +for the given $domain name to your DNS server and returns a list with all +record values on success. + +If the DNS server sends a DNS response message that contains one or more +records for this query, it will return a list with all record values +from the response. You can use the `Message::TYPE_*` constants to control +which type of query will be sent. Note that this method always returns a +list of record values, but each record value type depends on the query +type. For example, it returns the IPv4 addresses for type `A` queries, +the IPv6 addresses for type `AAAA` queries, the hostname for type `NS`, +`CNAME` and `PTR` queries and structured data for other queries. See also +the `Record` documentation for more details. + +If the DNS server sends a DNS response message that indicates an error +code, this method will reject with a `RecordNotFoundException`. Its +message and code can be used to check for the response code. + +If the DNS communication fails and the server does not respond with a +valid response message, this message will reject with an `Exception`. + +Pending DNS queries can be cancelled by cancelling its pending promise like so: + +```php +$promise = $resolver->resolveAll('reactphp.org', Message::TYPE_AAAA); + +$promise->cancel(); +``` + +## Advanced Usage + +### UdpTransportExecutor + +The `UdpTransportExecutor` can be used to +send DNS queries over a UDP transport. + +This is the main class that sends a DNS query to your DNS server and is used +internally by the `Resolver` for the actual message transport. + +For more advanced usages one can utilize this class directly. +The following example looks up the `IPv6` address for `igor.io`. + +```php +$executor = new UdpTransportExecutor('8.8.8.8:53'); + +$executor->query( + new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) +)->then(function (Message $message) { + foreach ($message->answers as $answer) { + echo 'IPv6: ' . $answer->data . PHP_EOL; + } +}, 'printf'); +``` + +See also the [fourth example](examples). + +Note that this executor does not implement a timeout, so you will very likely +want to use this in combination with a `TimeoutExecutor` like this: + +```php +$executor = new TimeoutExecutor( + new UdpTransportExecutor($nameserver), + 3.0 +); +``` + +Also note that this executor uses an unreliable UDP transport and that it +does not implement any retry logic, so you will likely want to use this in +combination with a `RetryExecutor` like this: + +```php +$executor = new RetryExecutor( + new TimeoutExecutor( + new UdpTransportExecutor($nameserver), + 3.0 + ) +); +``` + +Note that this executor is entirely async and as such allows you to execute +any number of queries concurrently. You should probably limit the number of +concurrent queries in your application or you're very likely going to face +rate limitations and bans on the resolver end. For many common applications, +you may want to avoid sending the same query multiple times when the first +one is still pending, so you will likely want to use this in combination with +a `CoopExecutor` like this: + +```php +$executor = new CoopExecutor( + new RetryExecutor( + new TimeoutExecutor( + new UdpTransportExecutor($nameserver), + 3.0 + ) + ) +); +``` + +> Internally, this class uses PHP's UDP sockets and does not take advantage + of [react/datagram](https://github.com/reactphp/datagram) purely for + organizational reasons to avoid a cyclic dependency between the two + packages. Higher-level components should take advantage of the Datagram + component instead of reimplementing this socket logic from scratch. + +### TcpTransportExecutor + +The `TcpTransportExecutor` class can be used to +send DNS queries over a TCP/IP stream transport. + +This is one of the main classes that send a DNS query to your DNS server. + +For more advanced usages one can utilize this class directly. +The following example looks up the `IPv6` address for `reactphp.org`. + +```php +$executor = new TcpTransportExecutor('8.8.8.8:53'); + +$executor->query( + new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) +)->then(function (Message $message) { + foreach ($message->answers as $answer) { + echo 'IPv6: ' . $answer->data . PHP_EOL; + } +}, 'printf'); +``` + +See also [example #92](examples). + +Note that this executor does not implement a timeout, so you will very likely +want to use this in combination with a `TimeoutExecutor` like this: + +```php +$executor = new TimeoutExecutor( + new TcpTransportExecutor($nameserver), + 3.0 +); +``` + +Unlike the `UdpTransportExecutor`, this class uses a reliable TCP/IP +transport, so you do not necessarily have to implement any retry logic. + +Note that this executor is entirely async and as such allows you to execute +queries concurrently. The first query will establish a TCP/IP socket +connection to the DNS server which will be kept open for a short period. +Additional queries will automatically reuse this existing socket connection +to the DNS server, will pipeline multiple requests over this single +connection and will keep an idle connection open for a short period. The +initial TCP/IP connection overhead may incur a slight delay if you only send +occasional queries – when sending a larger number of concurrent queries over +an existing connection, it becomes increasingly more efficient and avoids +creating many concurrent sockets like the UDP-based executor. You may still +want to limit the number of (concurrent) queries in your application or you +may be facing rate limitations and bans on the resolver end. For many common +applications, you may want to avoid sending the same query multiple times +when the first one is still pending, so you will likely want to use this in +combination with a `CoopExecutor` like this: + +```php +$executor = new CoopExecutor( + new TimeoutExecutor( + new TcpTransportExecutor($nameserver), + 3.0 + ) +); +``` + +> Internally, this class uses PHP's TCP/IP sockets and does not take advantage + of [react/socket](https://github.com/reactphp/socket) purely for + organizational reasons to avoid a cyclic dependency between the two + packages. Higher-level components should take advantage of the Socket + component instead of reimplementing this socket logic from scratch. + +### SelectiveTransportExecutor + +The `SelectiveTransportExecutor` class can be used to +Send DNS queries over a UDP or TCP/IP stream transport. + +This class will automatically choose the correct transport protocol to send +a DNS query to your DNS server. It will always try to send it over the more +efficient UDP transport first. If this query yields a size related issue +(truncated messages), it will retry over a streaming TCP/IP transport. + +For more advanced usages one can utilize this class directly. +The following example looks up the `IPv6` address for `reactphp.org`. + +```php +$executor = new SelectiveTransportExecutor($udpExecutor, $tcpExecutor); + +$executor->query( + new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) +)->then(function (Message $message) { + foreach ($message->answers as $answer) { + echo 'IPv6: ' . $answer->data . PHP_EOL; + } +}, 'printf'); +``` + +Note that this executor only implements the logic to select the correct +transport for the given DNS query. Implementing the correct transport logic, +implementing timeouts and any retry logic is left up to the given executors, +see also [`UdpTransportExecutor`](#udptransportexecutor) and +[`TcpTransportExecutor`](#tcptransportexecutor) for more details. + +Note that this executor is entirely async and as such allows you to execute +any number of queries concurrently. You should probably limit the number of +concurrent queries in your application or you're very likely going to face +rate limitations and bans on the resolver end. For many common applications, +you may want to avoid sending the same query multiple times when the first +one is still pending, so you will likely want to use this in combination with +a `CoopExecutor` like this: + +```php +$executor = new CoopExecutor( + new SelectiveTransportExecutor( + $datagramExecutor, + $streamExecutor + ) +); +``` + +### HostsFileExecutor + +Note that the above `UdpTransportExecutor` class always performs an actual DNS query. +If you also want to take entries from your hosts file into account, you may +use this code: + +```php +$hosts = \React\Dns\Config\HostsFile::loadFromPathBlocking(); + +$executor = new UdpTransportExecutor('8.8.8.8:53'); +$executor = new HostsFileExecutor($hosts, $executor); + +$executor->query( + new Query('localhost', Message::TYPE_A, Message::CLASS_IN) +); +``` + +## Install + +The recommended way to install this library is [through Composer](https://getcomposer.org/). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) + +This project follows [SemVer](https://semver.org/). +This will install the latest supported version: + +```bash +composer require react/dns:^1.13 +``` + +See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. + +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.3 through current PHP 8+ and +HHVM. +It's *highly recommended to use the latest supported PHP version* for this project. + +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org/): + +```bash +composer install +``` + +To run the test suite, go to the project root and run: + +```bash +vendor/bin/phpunit +``` + +The test suite also contains a number of functional integration tests that rely +on a stable internet connection. +If you do not want to run these, they can simply be skipped like this: + +```bash +vendor/bin/phpunit --exclude-group internet +``` + +## License + +MIT, see [LICENSE file](LICENSE). + +## References + +* [RFC 1034](https://tools.ietf.org/html/rfc1034) Domain Names - Concepts and Facilities +* [RFC 1035](https://tools.ietf.org/html/rfc1035) Domain Names - Implementation and Specification diff --git a/tools/php-cs-fixer/vendor/react/dns/composer.json b/tools/php-cs-fixer/vendor/react/dns/composer.json new file mode 100644 index 00000000..4fe5c0da --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/composer.json @@ -0,0 +1,49 @@ +{ + "name": "react/dns", + "description": "Async DNS resolver for ReactPHP", + "keywords": ["dns", "dns-resolver", "ReactPHP", "async"], + "license": "MIT", + "authors": [ + { + "name": "Christian Lück", + "homepage": "https://clue.engineering/", + "email": "christian@clue.engineering" + }, + { + "name": "Cees-Jan Kiewiet", + "homepage": "https://wyrihaximus.net/", + "email": "reactphp@ceesjankiewiet.nl" + }, + { + "name": "Jan Sorgalla", + "homepage": "https://sorgalla.com/", + "email": "jsorgalla@gmail.com" + }, + { + "name": "Chris Boden", + "homepage": "https://cboden.dev/", + "email": "cboden@gmail.com" + } + ], + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "React\\Tests\\Dns\\": "tests/" + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/BadServerException.php b/tools/php-cs-fixer/vendor/react/dns/src/BadServerException.php new file mode 100644 index 00000000..3d95213f --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/BadServerException.php @@ -0,0 +1,7 @@ + `fe80:1`) + if (strpos($ip, ':') !== false && ($pos = strpos($ip, '%')) !== false) { + $ip = substr($ip, 0, $pos); + } + + if (@inet_pton($ip) !== false) { + $config->nameservers[] = $ip; + } + } + + return $config; + } + + /** + * Loads the DNS configurations from Windows's WMIC (from the given command or default command) + * + * Note that this method blocks while loading the given command and should + * thus be used with care! While this should be relatively fast for normal + * WMIC commands, it remains unknown if this may block under certain + * circumstances. In particular, this method should only be executed before + * the loop starts, not while it is running. + * + * Note that this method will only try to execute the given command try to + * parse its output, irrespective of whether this command exists. In + * particular, this command is only available on Windows. Currently, this + * will only parse valid nameserver entries from the command output and will + * ignore all other output without complaining. + * + * Note that the previous section implies that this may return an empty + * `Config` object if no valid nameserver entries can be found. + * + * @param ?string $command (advanced) should not be given (NULL) unless you know what you're doing + * @return self + * @link https://ss64.com/nt/wmic.html + */ + public static function loadWmicBlocking($command = null) + { + $contents = shell_exec($command === null ? 'wmic NICCONFIG get "DNSServerSearchOrder" /format:CSV' : $command); + preg_match_all('/(?<=[{;,"])([\da-f.:]{4,})(?=[};,"])/i', $contents, $matches); + + $config = new self(); + $config->nameservers = $matches[1]; + + return $config; + } + + public $nameservers = array(); +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Config/HostsFile.php b/tools/php-cs-fixer/vendor/react/dns/src/Config/HostsFile.php new file mode 100644 index 00000000..1060231a --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Config/HostsFile.php @@ -0,0 +1,153 @@ +contents = $contents; + } + + /** + * Returns all IPs for the given hostname + * + * @param string $name + * @return string[] + */ + public function getIpsForHost($name) + { + $name = strtolower($name); + + $ips = array(); + foreach (preg_split('/\r?\n/', $this->contents) as $line) { + $parts = preg_split('/\s+/', $line); + $ip = array_shift($parts); + if ($parts && array_search($name, $parts) !== false) { + // remove IPv6 zone ID (`fe80::1%lo0` => `fe80:1`) + if (strpos($ip, ':') !== false && ($pos = strpos($ip, '%')) !== false) { + $ip = substr($ip, 0, $pos); + } + + if (@inet_pton($ip) !== false) { + $ips[] = $ip; + } + } + } + + return $ips; + } + + /** + * Returns all hostnames for the given IPv4 or IPv6 address + * + * @param string $ip + * @return string[] + */ + public function getHostsForIp($ip) + { + // check binary representation of IP to avoid string case and short notation + $ip = @inet_pton($ip); + if ($ip === false) { + return array(); + } + + $names = array(); + foreach (preg_split('/\r?\n/', $this->contents) as $line) { + $parts = preg_split('/\s+/', $line, -1, PREG_SPLIT_NO_EMPTY); + $addr = (string) array_shift($parts); + + // remove IPv6 zone ID (`fe80::1%lo0` => `fe80:1`) + if (strpos($addr, ':') !== false && ($pos = strpos($addr, '%')) !== false) { + $addr = substr($addr, 0, $pos); + } + + if (@inet_pton($addr) === $ip) { + foreach ($parts as $part) { + $names[] = $part; + } + } + } + + return $names; + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Model/Message.php b/tools/php-cs-fixer/vendor/react/dns/src/Model/Message.php new file mode 100644 index 00000000..bac2b10d --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Model/Message.php @@ -0,0 +1,230 @@ +id = self::generateId(); + $request->rd = true; + $request->questions[] = $query; + + return $request; + } + + /** + * Creates a new response message for the given query with the given answer records + * + * @param Query $query + * @param Record[] $answers + * @return self + */ + public static function createResponseWithAnswersForQuery(Query $query, array $answers) + { + $response = new Message(); + $response->id = self::generateId(); + $response->qr = true; + $response->rd = true; + + $response->questions[] = $query; + + foreach ($answers as $record) { + $response->answers[] = $record; + } + + return $response; + } + + /** + * generates a random 16 bit message ID + * + * This uses a CSPRNG so that an outside attacker that is sending spoofed + * DNS response messages can not guess the message ID to avoid possible + * cache poisoning attacks. + * + * The `random_int()` function is only available on PHP 7+ or when + * https://github.com/paragonie/random_compat is installed. As such, using + * the latest supported PHP version is highly recommended. This currently + * falls back to a less secure random number generator on older PHP versions + * in the hope that this system is properly protected against outside + * attackers, for example by using one of the common local DNS proxy stubs. + * + * @return int + * @see self::getId() + * @codeCoverageIgnore + */ + private static function generateId() + { + if (function_exists('random_int')) { + return random_int(0, 0xffff); + } + return mt_rand(0, 0xffff); + } + + /** + * The 16 bit message ID + * + * The response message ID has to match the request message ID. This allows + * the receiver to verify this is the correct response message. An outside + * attacker may try to inject fake responses by "guessing" the message ID, + * so this should use a proper CSPRNG to avoid possible cache poisoning. + * + * @var int 16 bit message ID + * @see self::generateId() + */ + public $id = 0; + + /** + * @var bool Query/Response flag, query=false or response=true + */ + public $qr = false; + + /** + * @var int specifies the kind of query (4 bit), see self::OPCODE_* constants + * @see self::OPCODE_QUERY + */ + public $opcode = self::OPCODE_QUERY; + + /** + * + * @var bool Authoritative Answer + */ + public $aa = false; + + /** + * @var bool TrunCation + */ + public $tc = false; + + /** + * @var bool Recursion Desired + */ + public $rd = false; + + /** + * @var bool Recursion Available + */ + public $ra = false; + + /** + * @var int response code (4 bit), see self::RCODE_* constants + * @see self::RCODE_OK + */ + public $rcode = Message::RCODE_OK; + + /** + * An array of Query objects + * + * ```php + * $questions = array( + * new Query( + * 'reactphp.org', + * Message::TYPE_A, + * Message::CLASS_IN + * ) + * ); + * ``` + * + * @var Query[] + */ + public $questions = array(); + + /** + * @var Record[] + */ + public $answers = array(); + + /** + * @var Record[] + */ + public $authority = array(); + + /** + * @var Record[] + */ + public $additional = array(); +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Model/Record.php b/tools/php-cs-fixer/vendor/react/dns/src/Model/Record.php new file mode 100644 index 00000000..c20403f5 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Model/Record.php @@ -0,0 +1,153 @@ +name = $name; + $this->type = $type; + $this->class = $class; + $this->ttl = $ttl; + $this->data = $data; + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Protocol/BinaryDumper.php b/tools/php-cs-fixer/vendor/react/dns/src/Protocol/BinaryDumper.php new file mode 100644 index 00000000..6f4030f6 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Protocol/BinaryDumper.php @@ -0,0 +1,199 @@ +headerToBinary($message); + $data .= $this->questionToBinary($message->questions); + $data .= $this->recordsToBinary($message->answers); + $data .= $this->recordsToBinary($message->authority); + $data .= $this->recordsToBinary($message->additional); + + return $data; + } + + /** + * @param Message $message + * @return string + */ + private function headerToBinary(Message $message) + { + $data = ''; + + $data .= pack('n', $message->id); + + $flags = 0x00; + $flags = ($flags << 1) | ($message->qr ? 1 : 0); + $flags = ($flags << 4) | $message->opcode; + $flags = ($flags << 1) | ($message->aa ? 1 : 0); + $flags = ($flags << 1) | ($message->tc ? 1 : 0); + $flags = ($flags << 1) | ($message->rd ? 1 : 0); + $flags = ($flags << 1) | ($message->ra ? 1 : 0); + $flags = ($flags << 3) | 0; // skip unused zero bit + $flags = ($flags << 4) | $message->rcode; + + $data .= pack('n', $flags); + + $data .= pack('n', count($message->questions)); + $data .= pack('n', count($message->answers)); + $data .= pack('n', count($message->authority)); + $data .= pack('n', count($message->additional)); + + return $data; + } + + /** + * @param Query[] $questions + * @return string + */ + private function questionToBinary(array $questions) + { + $data = ''; + + foreach ($questions as $question) { + $data .= $this->domainNameToBinary($question->name); + $data .= pack('n*', $question->type, $question->class); + } + + return $data; + } + + /** + * @param Record[] $records + * @return string + */ + private function recordsToBinary(array $records) + { + $data = ''; + + foreach ($records as $record) { + /* @var $record Record */ + switch ($record->type) { + case Message::TYPE_A: + case Message::TYPE_AAAA: + $binary = \inet_pton($record->data); + break; + case Message::TYPE_CNAME: + case Message::TYPE_NS: + case Message::TYPE_PTR: + $binary = $this->domainNameToBinary($record->data); + break; + case Message::TYPE_TXT: + case Message::TYPE_SPF: + $binary = $this->textsToBinary($record->data); + break; + case Message::TYPE_MX: + $binary = \pack( + 'n', + $record->data['priority'] + ); + $binary .= $this->domainNameToBinary($record->data['target']); + break; + case Message::TYPE_SRV: + $binary = \pack( + 'n*', + $record->data['priority'], + $record->data['weight'], + $record->data['port'] + ); + $binary .= $this->domainNameToBinary($record->data['target']); + break; + case Message::TYPE_SOA: + $binary = $this->domainNameToBinary($record->data['mname']); + $binary .= $this->domainNameToBinary($record->data['rname']); + $binary .= \pack( + 'N*', + $record->data['serial'], + $record->data['refresh'], + $record->data['retry'], + $record->data['expire'], + $record->data['minimum'] + ); + break; + case Message::TYPE_CAA: + $binary = \pack( + 'C*', + $record->data['flag'], + \strlen($record->data['tag']) + ); + $binary .= $record->data['tag']; + $binary .= $record->data['value']; + break; + case Message::TYPE_SSHFP: + $binary = \pack( + 'CCH*', + $record->data['algorithm'], + $record->data['type'], + $record->data['fingerprint'] + ); + break; + case Message::TYPE_OPT: + $binary = ''; + foreach ($record->data as $opt => $value) { + if ($opt === Message::OPT_TCP_KEEPALIVE && $value !== null) { + $value = \pack('n', round($value * 10)); + } + $binary .= \pack('n*', $opt, \strlen((string) $value)) . $value; + } + break; + default: + // RDATA is already stored as binary value for unknown record types + $binary = $record->data; + } + + $data .= $this->domainNameToBinary($record->name); + $data .= \pack('nnNn', $record->type, $record->class, $record->ttl, \strlen($binary)); + $data .= $binary; + } + + return $data; + } + + /** + * @param string[] $texts + * @return string + */ + private function textsToBinary(array $texts) + { + $data = ''; + foreach ($texts as $text) { + $data .= \chr(\strlen($text)) . $text; + } + return $data; + } + + /** + * @param string $host + * @return string + */ + private function domainNameToBinary($host) + { + if ($host === '') { + return "\0"; + } + + // break up domain name at each dot that is not preceeded by a backslash (escaped notation) + return $this->textsToBinary( + \array_map( + 'stripcslashes', + \preg_split( + '/(?parse($data, 0); + if ($message === null) { + throw new InvalidArgumentException('Unable to parse binary message'); + } + + return $message; + } + + /** + * @param string $data + * @param int $consumed + * @return ?Message + */ + private function parse($data, $consumed) + { + if (!isset($data[12 - 1])) { + return null; + } + + list($id, $fields, $qdCount, $anCount, $nsCount, $arCount) = array_values(unpack('n*', substr($data, 0, 12))); + + $message = new Message(); + $message->id = $id; + $message->rcode = $fields & 0xf; + $message->ra = (($fields >> 7) & 1) === 1; + $message->rd = (($fields >> 8) & 1) === 1; + $message->tc = (($fields >> 9) & 1) === 1; + $message->aa = (($fields >> 10) & 1) === 1; + $message->opcode = ($fields >> 11) & 0xf; + $message->qr = (($fields >> 15) & 1) === 1; + $consumed += 12; + + // parse all questions + for ($i = $qdCount; $i > 0; --$i) { + list($question, $consumed) = $this->parseQuestion($data, $consumed); + if ($question === null) { + return null; + } else { + $message->questions[] = $question; + } + } + + // parse all answer records + for ($i = $anCount; $i > 0; --$i) { + list($record, $consumed) = $this->parseRecord($data, $consumed); + if ($record === null) { + return null; + } else { + $message->answers[] = $record; + } + } + + // parse all authority records + for ($i = $nsCount; $i > 0; --$i) { + list($record, $consumed) = $this->parseRecord($data, $consumed); + if ($record === null) { + return null; + } else { + $message->authority[] = $record; + } + } + + // parse all additional records + for ($i = $arCount; $i > 0; --$i) { + list($record, $consumed) = $this->parseRecord($data, $consumed); + if ($record === null) { + return null; + } else { + $message->additional[] = $record; + } + } + + return $message; + } + + /** + * @param string $data + * @param int $consumed + * @return array + */ + private function parseQuestion($data, $consumed) + { + list($labels, $consumed) = $this->readLabels($data, $consumed); + + if ($labels === null || !isset($data[$consumed + 4 - 1])) { + return array(null, null); + } + + list($type, $class) = array_values(unpack('n*', substr($data, $consumed, 4))); + $consumed += 4; + + return array( + new Query( + implode('.', $labels), + $type, + $class + ), + $consumed + ); + } + + /** + * @param string $data + * @param int $consumed + * @return array An array with a parsed Record on success or array with null if data is invalid/incomplete + */ + private function parseRecord($data, $consumed) + { + list($name, $consumed) = $this->readDomain($data, $consumed); + + if ($name === null || !isset($data[$consumed + 10 - 1])) { + return array(null, null); + } + + list($type, $class) = array_values(unpack('n*', substr($data, $consumed, 4))); + $consumed += 4; + + list($ttl) = array_values(unpack('N', substr($data, $consumed, 4))); + $consumed += 4; + + // TTL is a UINT32 that must not have most significant bit set for BC reasons + if ($ttl < 0 || $ttl >= 1 << 31) { + $ttl = 0; + } + + list($rdLength) = array_values(unpack('n', substr($data, $consumed, 2))); + $consumed += 2; + + if (!isset($data[$consumed + $rdLength - 1])) { + return array(null, null); + } + + $rdata = null; + $expected = $consumed + $rdLength; + + if (Message::TYPE_A === $type) { + if ($rdLength === 4) { + $rdata = inet_ntop(substr($data, $consumed, $rdLength)); + $consumed += $rdLength; + } + } elseif (Message::TYPE_AAAA === $type) { + if ($rdLength === 16) { + $rdata = inet_ntop(substr($data, $consumed, $rdLength)); + $consumed += $rdLength; + } + } elseif (Message::TYPE_CNAME === $type || Message::TYPE_PTR === $type || Message::TYPE_NS === $type) { + list($rdata, $consumed) = $this->readDomain($data, $consumed); + } elseif (Message::TYPE_TXT === $type || Message::TYPE_SPF === $type) { + $rdata = array(); + while ($consumed < $expected) { + $len = ord($data[$consumed]); + $rdata[] = (string)substr($data, $consumed + 1, $len); + $consumed += $len + 1; + } + } elseif (Message::TYPE_MX === $type) { + if ($rdLength > 2) { + list($priority) = array_values(unpack('n', substr($data, $consumed, 2))); + list($target, $consumed) = $this->readDomain($data, $consumed + 2); + + $rdata = array( + 'priority' => $priority, + 'target' => $target + ); + } + } elseif (Message::TYPE_SRV === $type) { + if ($rdLength > 6) { + list($priority, $weight, $port) = array_values(unpack('n*', substr($data, $consumed, 6))); + list($target, $consumed) = $this->readDomain($data, $consumed + 6); + + $rdata = array( + 'priority' => $priority, + 'weight' => $weight, + 'port' => $port, + 'target' => $target + ); + } + } elseif (Message::TYPE_SSHFP === $type) { + if ($rdLength > 2) { + list($algorithm, $hash) = \array_values(\unpack('C*', \substr($data, $consumed, 2))); + $fingerprint = \bin2hex(\substr($data, $consumed + 2, $rdLength - 2)); + $consumed += $rdLength; + + $rdata = array( + 'algorithm' => $algorithm, + 'type' => $hash, + 'fingerprint' => $fingerprint + ); + } + } elseif (Message::TYPE_SOA === $type) { + list($mname, $consumed) = $this->readDomain($data, $consumed); + list($rname, $consumed) = $this->readDomain($data, $consumed); + + if ($mname !== null && $rname !== null && isset($data[$consumed + 20 - 1])) { + list($serial, $refresh, $retry, $expire, $minimum) = array_values(unpack('N*', substr($data, $consumed, 20))); + $consumed += 20; + + $rdata = array( + 'mname' => $mname, + 'rname' => $rname, + 'serial' => $serial, + 'refresh' => $refresh, + 'retry' => $retry, + 'expire' => $expire, + 'minimum' => $minimum + ); + } + } elseif (Message::TYPE_OPT === $type) { + $rdata = array(); + while (isset($data[$consumed + 4 - 1])) { + list($code, $length) = array_values(unpack('n*', substr($data, $consumed, 4))); + $value = (string) substr($data, $consumed + 4, $length); + if ($code === Message::OPT_TCP_KEEPALIVE && $value === '') { + $value = null; + } elseif ($code === Message::OPT_TCP_KEEPALIVE && $length === 2) { + list($value) = array_values(unpack('n', $value)); + $value = round($value * 0.1, 1); + } elseif ($code === Message::OPT_TCP_KEEPALIVE) { + break; + } + $rdata[$code] = $value; + $consumed += 4 + $length; + } + } elseif (Message::TYPE_CAA === $type) { + if ($rdLength > 3) { + list($flag, $tagLength) = array_values(unpack('C*', substr($data, $consumed, 2))); + + if ($tagLength > 0 && $rdLength - 2 - $tagLength > 0) { + $tag = substr($data, $consumed + 2, $tagLength); + $value = substr($data, $consumed + 2 + $tagLength, $rdLength - 2 - $tagLength); + $consumed += $rdLength; + + $rdata = array( + 'flag' => $flag, + 'tag' => $tag, + 'value' => $value + ); + } + } + } else { + // unknown types simply parse rdata as an opaque binary string + $rdata = substr($data, $consumed, $rdLength); + $consumed += $rdLength; + } + + // ensure parsing record data consumes expact number of bytes indicated in record length + if ($consumed !== $expected || $rdata === null) { + return array(null, null); + } + + return array( + new Record($name, $type, $class, $ttl, $rdata), + $consumed + ); + } + + private function readDomain($data, $consumed) + { + list ($labels, $consumed) = $this->readLabels($data, $consumed); + + if ($labels === null) { + return array(null, null); + } + + // use escaped notation for each label part, then join using dots + return array( + \implode( + '.', + \array_map( + function ($label) { + return \addcslashes($label, "\0..\40.\177"); + }, + $labels + ) + ), + $consumed + ); + } + + /** + * @param string $data + * @param int $consumed + * @param int $compressionDepth maximum depth for compressed labels to avoid unreasonable recursion + * @return array + */ + private function readLabels($data, $consumed, $compressionDepth = 127) + { + $labels = array(); + + while (true) { + if (!isset($data[$consumed])) { + return array(null, null); + } + + $length = \ord($data[$consumed]); + + // end of labels reached + if ($length === 0) { + $consumed += 1; + break; + } + + // first two bits set? this is a compressed label (14 bit pointer offset) + if (($length & 0xc0) === 0xc0 && isset($data[$consumed + 1]) && $compressionDepth) { + $offset = ($length & ~0xc0) << 8 | \ord($data[$consumed + 1]); + if ($offset >= $consumed) { + return array(null, null); + } + + $consumed += 2; + list($newLabels) = $this->readLabels($data, $offset, $compressionDepth - 1); + + if ($newLabels === null) { + return array(null, null); + } + + $labels = array_merge($labels, $newLabels); + break; + } + + // length MUST be 0-63 (6 bits only) and data has to be large enough + if ($length & 0xc0 || !isset($data[$consumed + $length - 1])) { + return array(null, null); + } + + $labels[] = substr($data, $consumed + 1, $length); + $consumed += $length + 1; + } + + return array($labels, $consumed); + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/CachingExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/CachingExecutor.php new file mode 100644 index 00000000..e530b24c --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Query/CachingExecutor.php @@ -0,0 +1,88 @@ +executor = $executor; + $this->cache = $cache; + } + + public function query(Query $query) + { + $id = $query->name . ':' . $query->type . ':' . $query->class; + $cache = $this->cache; + $that = $this; + $executor = $this->executor; + + $pending = $cache->get($id); + return new Promise(function ($resolve, $reject) use ($query, $id, $cache, $executor, &$pending, $that) { + $pending->then( + function ($message) use ($query, $id, $cache, $executor, &$pending, $that) { + // return cached response message on cache hit + if ($message !== null) { + return $message; + } + + // perform DNS lookup if not already cached + return $pending = $executor->query($query)->then( + function (Message $message) use ($cache, $id, $that) { + // DNS response message received => store in cache when not truncated and return + if (!$message->tc) { + $cache->set($id, $message, $that->ttl($message)); + } + + return $message; + } + ); + } + )->then($resolve, function ($e) use ($reject, &$pending) { + $reject($e); + $pending = null; + }); + }, function ($_, $reject) use (&$pending, $query) { + $reject(new \RuntimeException('DNS query for ' . $query->describe() . ' has been cancelled')); + $pending->cancel(); + $pending = null; + }); + } + + /** + * @param Message $message + * @return int + * @internal + */ + public function ttl(Message $message) + { + // select TTL from answers (should all be the same), use smallest value if available + // @link https://tools.ietf.org/html/rfc2181#section-5.2 + $ttl = null; + foreach ($message->answers as $answer) { + if ($ttl === null || $answer->ttl < $ttl) { + $ttl = $answer->ttl; + } + } + + if ($ttl === null) { + $ttl = self::TTL; + } + + return $ttl; + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/CancellationException.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/CancellationException.php new file mode 100644 index 00000000..5432b36f --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Query/CancellationException.php @@ -0,0 +1,7 @@ +executor = $base; + } + + public function query(Query $query) + { + $key = $this->serializeQueryToIdentity($query); + if (isset($this->pending[$key])) { + // same query is already pending, so use shared reference to pending query + $promise = $this->pending[$key]; + ++$this->counts[$key]; + } else { + // no such query pending, so start new query and keep reference until it's fulfilled or rejected + $promise = $this->executor->query($query); + $this->pending[$key] = $promise; + $this->counts[$key] = 1; + + $pending =& $this->pending; + $counts =& $this->counts; + $promise->then(function () use ($key, &$pending, &$counts) { + unset($pending[$key], $counts[$key]); + }, function () use ($key, &$pending, &$counts) { + unset($pending[$key], $counts[$key]); + }); + } + + // Return a child promise awaiting the pending query. + // Cancelling this child promise should only cancel the pending query + // when no other child promise is awaiting the same query. + $pending =& $this->pending; + $counts =& $this->counts; + return new Promise(function ($resolve, $reject) use ($promise) { + $promise->then($resolve, $reject); + }, function () use (&$promise, $key, $query, &$pending, &$counts) { + if (--$counts[$key] < 1) { + unset($pending[$key], $counts[$key]); + $promise->cancel(); + $promise = null; + } + throw new \RuntimeException('DNS query for ' . $query->describe() . ' has been cancelled'); + }); + } + + private function serializeQueryToIdentity(Query $query) + { + return sprintf('%s:%s:%s', $query->name, $query->type, $query->class); + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/ExecutorInterface.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/ExecutorInterface.php new file mode 100644 index 00000000..0bc3945f --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Query/ExecutorInterface.php @@ -0,0 +1,43 @@ +query($query)->then( + * function (React\Dns\Model\Message $response) { + * // response message successfully received + * var_dump($response->rcode, $response->answers); + * }, + * function (Exception $error) { + * // failed to query due to $error + * } + * ); + * ``` + * + * The returned Promise MUST be implemented in such a way that it can be + * cancelled when it is still pending. Cancelling a pending promise MUST + * reject its value with an Exception. It SHOULD clean up any underlying + * resources and references as applicable. + * + * ```php + * $promise = $executor->query($query); + * + * $promise->cancel(); + * ``` + * + * @param Query $query + * @return \React\Promise\PromiseInterface<\React\Dns\Model\Message> + * resolves with response message on success or rejects with an Exception on error + */ + public function query(Query $query); +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/FallbackExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/FallbackExecutor.php new file mode 100644 index 00000000..83bd360b --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Query/FallbackExecutor.php @@ -0,0 +1,49 @@ +executor = $executor; + $this->fallback = $fallback; + } + + public function query(Query $query) + { + $cancelled = false; + $fallback = $this->fallback; + $promise = $this->executor->query($query); + + return new Promise(function ($resolve, $reject) use (&$promise, $fallback, $query, &$cancelled) { + $promise->then($resolve, function (\Exception $e1) use ($fallback, $query, $resolve, $reject, &$cancelled, &$promise) { + // reject if primary resolution rejected due to cancellation + if ($cancelled) { + $reject($e1); + return; + } + + // start fallback query if primary query rejected + $promise = $fallback->query($query)->then($resolve, function (\Exception $e2) use ($e1, $reject) { + $append = $e2->getMessage(); + if (($pos = strpos($append, ':')) !== false) { + $append = substr($append, $pos + 2); + } + + // reject with combined error message if both queries fail + $reject(new \RuntimeException($e1->getMessage() . '. ' . $append)); + }); + }); + }, function () use (&$promise, &$cancelled) { + // cancel pending query (primary or fallback) + $cancelled = true; + $promise->cancel(); + }); + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/HostsFileExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/HostsFileExecutor.php new file mode 100644 index 00000000..d6e2d934 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Query/HostsFileExecutor.php @@ -0,0 +1,89 @@ +hosts = $hosts; + $this->fallback = $fallback; + } + + public function query(Query $query) + { + if ($query->class === Message::CLASS_IN && ($query->type === Message::TYPE_A || $query->type === Message::TYPE_AAAA)) { + // forward lookup for type A or AAAA + $records = array(); + $expectsColon = $query->type === Message::TYPE_AAAA; + foreach ($this->hosts->getIpsForHost($query->name) as $ip) { + // ensure this is an IPv4/IPV6 address according to query type + if ((strpos($ip, ':') !== false) === $expectsColon) { + $records[] = new Record($query->name, $query->type, $query->class, 0, $ip); + } + } + + if ($records) { + return Promise\resolve( + Message::createResponseWithAnswersForQuery($query, $records) + ); + } + } elseif ($query->class === Message::CLASS_IN && $query->type === Message::TYPE_PTR) { + // reverse lookup: extract IPv4 or IPv6 from special `.arpa` domain + $ip = $this->getIpFromHost($query->name); + + if ($ip !== null) { + $records = array(); + foreach ($this->hosts->getHostsForIp($ip) as $host) { + $records[] = new Record($query->name, $query->type, $query->class, 0, $host); + } + + if ($records) { + return Promise\resolve( + Message::createResponseWithAnswersForQuery($query, $records) + ); + } + } + } + + return $this->fallback->query($query); + } + + private function getIpFromHost($host) + { + if (substr($host, -13) === '.in-addr.arpa') { + // IPv4: read as IP and reverse bytes + $ip = @inet_pton(substr($host, 0, -13)); + if ($ip === false || isset($ip[4])) { + return null; + } + + return inet_ntop(strrev($ip)); + } elseif (substr($host, -9) === '.ip6.arpa') { + // IPv6: replace dots, reverse nibbles and interpret as hexadecimal string + $ip = @inet_ntop(pack('H*', strrev(str_replace('.', '', substr($host, 0, -9))))); + if ($ip === false) { + return null; + } + + return $ip; + } else { + return null; + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/Query.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/Query.php new file mode 100644 index 00000000..a3dcfb58 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Query/Query.php @@ -0,0 +1,69 @@ +name = $name; + $this->type = $type; + $this->class = $class; + } + + /** + * Describes the hostname and query type/class for this query + * + * The output format is supposed to be human readable and is subject to change. + * The format is inspired by RFC 3597 when handling unkown types/classes. + * + * @return string "example.com (A)" or "example.com (CLASS0 TYPE1234)" + * @link https://tools.ietf.org/html/rfc3597 + */ + public function describe() + { + $class = $this->class !== Message::CLASS_IN ? 'CLASS' . $this->class . ' ' : ''; + + $type = 'TYPE' . $this->type; + $ref = new \ReflectionClass('React\Dns\Model\Message'); + foreach ($ref->getConstants() as $name => $value) { + if ($value === $this->type && \strpos($name, 'TYPE_') === 0) { + $type = \substr($name, 5); + break; + } + } + + return $this->name . ' (' . $class . $type . ')'; + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/RetryExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/RetryExecutor.php new file mode 100644 index 00000000..880609b2 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Query/RetryExecutor.php @@ -0,0 +1,85 @@ +executor = $executor; + $this->retries = $retries; + } + + public function query(Query $query) + { + return $this->tryQuery($query, $this->retries); + } + + public function tryQuery(Query $query, $retries) + { + $deferred = new Deferred(function () use (&$promise) { + if ($promise instanceof PromiseInterface && \method_exists($promise, 'cancel')) { + $promise->cancel(); + } + }); + + $success = function ($value) use ($deferred, &$errorback) { + $errorback = null; + $deferred->resolve($value); + }; + + $executor = $this->executor; + $errorback = function ($e) use ($deferred, &$promise, $query, $success, &$errorback, &$retries, $executor) { + if (!$e instanceof TimeoutException) { + $errorback = null; + $deferred->reject($e); + } elseif ($retries <= 0) { + $errorback = null; + $deferred->reject($e = new \RuntimeException( + 'DNS query for ' . $query->describe() . ' failed: too many retries', + 0, + $e + )); + + // avoid garbage references by replacing all closures in call stack. + // what a lovely piece of code! + $r = new \ReflectionProperty('Exception', 'trace'); + $r->setAccessible(true); + $trace = $r->getValue($e); + + // Exception trace arguments are not available on some PHP 7.4 installs + // @codeCoverageIgnoreStart + foreach ($trace as $ti => $one) { + if (isset($one['args'])) { + foreach ($one['args'] as $ai => $arg) { + if ($arg instanceof \Closure) { + $trace[$ti]['args'][$ai] = 'Object(' . \get_class($arg) . ')'; + } + } + } + } + // @codeCoverageIgnoreEnd + $r->setValue($e, $trace); + } else { + --$retries; + $promise = $executor->query($query)->then( + $success, + $errorback + ); + } + }; + + $promise = $this->executor->query($query)->then( + $success, + $errorback + ); + + return $deferred->promise(); + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/SelectiveTransportExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/SelectiveTransportExecutor.php new file mode 100644 index 00000000..0f0ca5d0 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Query/SelectiveTransportExecutor.php @@ -0,0 +1,85 @@ +query( + * new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) + * )->then(function (Message $message) { + * foreach ($message->answers as $answer) { + * echo 'IPv6: ' . $answer->data . PHP_EOL; + * } + * }, 'printf'); + * ``` + * + * Note that this executor only implements the logic to select the correct + * transport for the given DNS query. Implementing the correct transport logic, + * implementing timeouts and any retry logic is left up to the given executors, + * see also [`UdpTransportExecutor`](#udptransportexecutor) and + * [`TcpTransportExecutor`](#tcptransportexecutor) for more details. + * + * Note that this executor is entirely async and as such allows you to execute + * any number of queries concurrently. You should probably limit the number of + * concurrent queries in your application or you're very likely going to face + * rate limitations and bans on the resolver end. For many common applications, + * you may want to avoid sending the same query multiple times when the first + * one is still pending, so you will likely want to use this in combination with + * a `CoopExecutor` like this: + * + * ```php + * $executor = new CoopExecutor( + * new SelectiveTransportExecutor( + * $datagramExecutor, + * $streamExecutor + * ) + * ); + * ``` + */ +class SelectiveTransportExecutor implements ExecutorInterface +{ + private $datagramExecutor; + private $streamExecutor; + + public function __construct(ExecutorInterface $datagramExecutor, ExecutorInterface $streamExecutor) + { + $this->datagramExecutor = $datagramExecutor; + $this->streamExecutor = $streamExecutor; + } + + public function query(Query $query) + { + $stream = $this->streamExecutor; + $pending = $this->datagramExecutor->query($query); + + return new Promise(function ($resolve, $reject) use (&$pending, $stream, $query) { + $pending->then( + $resolve, + function ($e) use (&$pending, $stream, $query, $resolve, $reject) { + if ($e->getCode() === (\defined('SOCKET_EMSGSIZE') ? \SOCKET_EMSGSIZE : 90)) { + $pending = $stream->query($query)->then($resolve, $reject); + } else { + $reject($e); + } + } + ); + }, function () use (&$pending) { + $pending->cancel(); + $pending = null; + }); + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/TcpTransportExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/TcpTransportExecutor.php new file mode 100644 index 00000000..669fd012 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Query/TcpTransportExecutor.php @@ -0,0 +1,382 @@ +query( + * new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) + * )->then(function (Message $message) { + * foreach ($message->answers as $answer) { + * echo 'IPv6: ' . $answer->data . PHP_EOL; + * } + * }, 'printf'); + * ``` + * + * See also [example #92](examples). + * + * Note that this executor does not implement a timeout, so you will very likely + * want to use this in combination with a `TimeoutExecutor` like this: + * + * ```php + * $executor = new TimeoutExecutor( + * new TcpTransportExecutor($nameserver), + * 3.0 + * ); + * ``` + * + * Unlike the `UdpTransportExecutor`, this class uses a reliable TCP/IP + * transport, so you do not necessarily have to implement any retry logic. + * + * Note that this executor is entirely async and as such allows you to execute + * queries concurrently. The first query will establish a TCP/IP socket + * connection to the DNS server which will be kept open for a short period. + * Additional queries will automatically reuse this existing socket connection + * to the DNS server, will pipeline multiple requests over this single + * connection and will keep an idle connection open for a short period. The + * initial TCP/IP connection overhead may incur a slight delay if you only send + * occasional queries – when sending a larger number of concurrent queries over + * an existing connection, it becomes increasingly more efficient and avoids + * creating many concurrent sockets like the UDP-based executor. You may still + * want to limit the number of (concurrent) queries in your application or you + * may be facing rate limitations and bans on the resolver end. For many common + * applications, you may want to avoid sending the same query multiple times + * when the first one is still pending, so you will likely want to use this in + * combination with a `CoopExecutor` like this: + * + * ```php + * $executor = new CoopExecutor( + * new TimeoutExecutor( + * new TcpTransportExecutor($nameserver), + * 3.0 + * ) + * ); + * ``` + * + * > Internally, this class uses PHP's TCP/IP sockets and does not take advantage + * of [react/socket](https://github.com/reactphp/socket) purely for + * organizational reasons to avoid a cyclic dependency between the two + * packages. Higher-level components should take advantage of the Socket + * component instead of reimplementing this socket logic from scratch. + */ +class TcpTransportExecutor implements ExecutorInterface +{ + private $nameserver; + private $loop; + private $parser; + private $dumper; + + /** + * @var ?resource + */ + private $socket; + + /** + * @var Deferred[] + */ + private $pending = array(); + + /** + * @var string[] + */ + private $names = array(); + + /** + * Maximum idle time when socket is current unused (i.e. no pending queries outstanding) + * + * If a new query is to be sent during the idle period, we can reuse the + * existing socket without having to wait for a new socket connection. + * This uses a rather small, hard-coded value to not keep any unneeded + * sockets open and to not keep the loop busy longer than needed. + * + * A future implementation may take advantage of `edns-tcp-keepalive` to keep + * the socket open for longer periods. This will likely require explicit + * configuration because this may consume additional resources and also keep + * the loop busy for longer than expected in some applications. + * + * @var float + * @link https://tools.ietf.org/html/rfc7766#section-6.2.1 + * @link https://tools.ietf.org/html/rfc7828 + */ + private $idlePeriod = 0.001; + + /** + * @var ?\React\EventLoop\TimerInterface + */ + private $idleTimer; + + private $writeBuffer = ''; + private $writePending = false; + + private $readBuffer = ''; + private $readPending = false; + + /** @var string */ + private $readChunk = 0xffff; + + /** + * @param string $nameserver + * @param ?LoopInterface $loop + */ + public function __construct($nameserver, $loop = null) + { + if (\strpos($nameserver, '[') === false && \substr_count($nameserver, ':') >= 2 && \strpos($nameserver, '://') === false) { + // several colons, but not enclosed in square brackets => enclose IPv6 address in square brackets + $nameserver = '[' . $nameserver . ']'; + } + + $parts = \parse_url((\strpos($nameserver, '://') === false ? 'tcp://' : '') . $nameserver); + if (!isset($parts['scheme'], $parts['host']) || $parts['scheme'] !== 'tcp' || @\inet_pton(\trim($parts['host'], '[]')) === false) { + throw new \InvalidArgumentException('Invalid nameserver address given'); + } + + if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); + } + + $this->nameserver = 'tcp://' . $parts['host'] . ':' . (isset($parts['port']) ? $parts['port'] : 53); + $this->loop = $loop ?: Loop::get(); + $this->parser = new Parser(); + $this->dumper = new BinaryDumper(); + } + + public function query(Query $query) + { + $request = Message::createRequestForQuery($query); + + // keep shuffing message ID to avoid using the same message ID for two pending queries at the same time + while (isset($this->pending[$request->id])) { + $request->id = \mt_rand(0, 0xffff); // @codeCoverageIgnore + } + + $queryData = $this->dumper->toBinary($request); + $length = \strlen($queryData); + if ($length > 0xffff) { + return \React\Promise\reject(new \RuntimeException( + 'DNS query for ' . $query->describe() . ' failed: Query too large for TCP transport' + )); + } + + $queryData = \pack('n', $length) . $queryData; + + if ($this->socket === null) { + // create async TCP/IP connection (may take a while) + $socket = @\stream_socket_client($this->nameserver, $errno, $errstr, 0, \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT); + if ($socket === false) { + return \React\Promise\reject(new \RuntimeException( + 'DNS query for ' . $query->describe() . ' failed: Unable to connect to DNS server ' . $this->nameserver . ' (' . $errstr . ')', + $errno + )); + } + + // set socket to non-blocking and wait for it to become writable (connection success/rejected) + \stream_set_blocking($socket, false); + if (\function_exists('stream_set_chunk_size')) { + \stream_set_chunk_size($socket, $this->readChunk); // @codeCoverageIgnore + } + $this->socket = $socket; + } + + if ($this->idleTimer !== null) { + $this->loop->cancelTimer($this->idleTimer); + $this->idleTimer = null; + } + + // wait for socket to become writable to actually write out data + $this->writeBuffer .= $queryData; + if (!$this->writePending) { + $this->writePending = true; + $this->loop->addWriteStream($this->socket, array($this, 'handleWritable')); + } + + $names =& $this->names; + $that = $this; + $deferred = new Deferred(function () use ($that, &$names, $request) { + // remove from list of pending names, but remember pending query + $name = $names[$request->id]; + unset($names[$request->id]); + $that->checkIdle(); + + throw new CancellationException('DNS query for ' . $name . ' has been cancelled'); + }); + + $this->pending[$request->id] = $deferred; + $this->names[$request->id] = $query->describe(); + + return $deferred->promise(); + } + + /** + * @internal + */ + public function handleWritable() + { + if ($this->readPending === false) { + $name = @\stream_socket_get_name($this->socket, true); + if ($name === false) { + // Connection failed? Check socket error if available for underlying errno/errstr. + // @codeCoverageIgnoreStart + if (\function_exists('socket_import_stream')) { + $socket = \socket_import_stream($this->socket); + $errno = \socket_get_option($socket, \SOL_SOCKET, \SO_ERROR); + $errstr = \socket_strerror($errno); + } else { + $errno = \defined('SOCKET_ECONNREFUSED') ? \SOCKET_ECONNREFUSED : 111; + $errstr = 'Connection refused'; + } + // @codeCoverageIgnoreEnd + + $this->closeError('Unable to connect to DNS server ' . $this->nameserver . ' (' . $errstr . ')', $errno); + return; + } + + $this->readPending = true; + $this->loop->addReadStream($this->socket, array($this, 'handleRead')); + } + + $errno = 0; + $errstr = ''; + \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { + // Match errstr from PHP's warning message. + // fwrite(): Send of 327712 bytes failed with errno=32 Broken pipe + \preg_match('/errno=(\d+) (.+)/', $error, $m); + $errno = isset($m[1]) ? (int) $m[1] : 0; + $errstr = isset($m[2]) ? $m[2] : $error; + }); + + $written = \fwrite($this->socket, $this->writeBuffer); + + \restore_error_handler(); + + if ($written === false || $written === 0) { + $this->closeError( + 'Unable to send query to DNS server ' . $this->nameserver . ' (' . $errstr . ')', + $errno + ); + return; + } + + if (isset($this->writeBuffer[$written])) { + $this->writeBuffer = \substr($this->writeBuffer, $written); + } else { + $this->loop->removeWriteStream($this->socket); + $this->writePending = false; + $this->writeBuffer = ''; + } + } + + /** + * @internal + */ + public function handleRead() + { + // read one chunk of data from the DNS server + // any error is fatal, this is a stream of TCP/IP data + $chunk = @\fread($this->socket, $this->readChunk); + if ($chunk === false || $chunk === '') { + $this->closeError('Connection to DNS server ' . $this->nameserver . ' lost'); + return; + } + + // reassemble complete message by concatenating all chunks. + $this->readBuffer .= $chunk; + + // response message header contains at least 12 bytes + while (isset($this->readBuffer[11])) { + // read response message length from first 2 bytes and ensure we have length + data in buffer + list(, $length) = \unpack('n', $this->readBuffer); + if (!isset($this->readBuffer[$length + 1])) { + return; + } + + $data = \substr($this->readBuffer, 2, $length); + $this->readBuffer = (string)substr($this->readBuffer, $length + 2); + + try { + $response = $this->parser->parseMessage($data); + } catch (\Exception $e) { + // reject all pending queries if we received an invalid message from remote server + $this->closeError('Invalid message received from DNS server ' . $this->nameserver); + return; + } + + // reject all pending queries if we received an unexpected response ID or truncated response + if (!isset($this->pending[$response->id]) || $response->tc) { + $this->closeError('Invalid response message received from DNS server ' . $this->nameserver); + return; + } + + $deferred = $this->pending[$response->id]; + unset($this->pending[$response->id], $this->names[$response->id]); + + $deferred->resolve($response); + + $this->checkIdle(); + } + } + + /** + * @internal + * @param string $reason + * @param int $code + */ + public function closeError($reason, $code = 0) + { + $this->readBuffer = ''; + if ($this->readPending) { + $this->loop->removeReadStream($this->socket); + $this->readPending = false; + } + + $this->writeBuffer = ''; + if ($this->writePending) { + $this->loop->removeWriteStream($this->socket); + $this->writePending = false; + } + + if ($this->idleTimer !== null) { + $this->loop->cancelTimer($this->idleTimer); + $this->idleTimer = null; + } + + @\fclose($this->socket); + $this->socket = null; + + foreach ($this->names as $id => $name) { + $this->pending[$id]->reject(new \RuntimeException( + 'DNS query for ' . $name . ' failed: ' . $reason, + $code + )); + } + $this->pending = $this->names = array(); + } + + /** + * @internal + */ + public function checkIdle() + { + if ($this->idleTimer === null && !$this->names) { + $that = $this; + $this->idleTimer = $this->loop->addTimer($this->idlePeriod, function () use ($that) { + $that->closeError('Idle timeout'); + }); + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/TimeoutException.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/TimeoutException.php new file mode 100644 index 00000000..109b0a9d --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Query/TimeoutException.php @@ -0,0 +1,7 @@ +executor = $executor; + $this->loop = $loop ?: Loop::get(); + $this->timeout = $timeout; + } + + public function query(Query $query) + { + $promise = $this->executor->query($query); + + $loop = $this->loop; + $time = $this->timeout; + return new Promise(function ($resolve, $reject) use ($loop, $time, $promise, $query) { + $timer = null; + $promise = $promise->then(function ($v) use (&$timer, $loop, $resolve) { + if ($timer) { + $loop->cancelTimer($timer); + } + $timer = false; + $resolve($v); + }, function ($v) use (&$timer, $loop, $reject) { + if ($timer) { + $loop->cancelTimer($timer); + } + $timer = false; + $reject($v); + }); + + // promise already resolved => no need to start timer + if ($timer === false) { + return; + } + + // start timeout timer which will cancel the pending promise + $timer = $loop->addTimer($time, function () use ($time, &$promise, $reject, $query) { + $reject(new TimeoutException( + 'DNS query for ' . $query->describe() . ' timed out' + )); + + // Cancel pending query to clean up any underlying resources and references. + // Avoid garbage references in call stack by passing pending promise by reference. + assert(\method_exists($promise, 'cancel')); + $promise->cancel(); + $promise = null; + }); + }, function () use (&$promise) { + // Cancelling this promise will cancel the pending query, thus triggering the rejection logic above. + // Avoid garbage references in call stack by passing pending promise by reference. + assert(\method_exists($promise, 'cancel')); + $promise->cancel(); + $promise = null; + }); + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/UdpTransportExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/UdpTransportExecutor.php new file mode 100644 index 00000000..a8cbfafa --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Query/UdpTransportExecutor.php @@ -0,0 +1,221 @@ +query( + * new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) + * )->then(function (Message $message) { + * foreach ($message->answers as $answer) { + * echo 'IPv6: ' . $answer->data . PHP_EOL; + * } + * }, 'printf'); + * ``` + * + * See also the [fourth example](examples). + * + * Note that this executor does not implement a timeout, so you will very likely + * want to use this in combination with a `TimeoutExecutor` like this: + * + * ```php + * $executor = new TimeoutExecutor( + * new UdpTransportExecutor($nameserver), + * 3.0 + * ); + * ``` + * + * Also note that this executor uses an unreliable UDP transport and that it + * does not implement any retry logic, so you will likely want to use this in + * combination with a `RetryExecutor` like this: + * + * ```php + * $executor = new RetryExecutor( + * new TimeoutExecutor( + * new UdpTransportExecutor($nameserver), + * 3.0 + * ) + * ); + * ``` + * + * Note that this executor is entirely async and as such allows you to execute + * any number of queries concurrently. You should probably limit the number of + * concurrent queries in your application or you're very likely going to face + * rate limitations and bans on the resolver end. For many common applications, + * you may want to avoid sending the same query multiple times when the first + * one is still pending, so you will likely want to use this in combination with + * a `CoopExecutor` like this: + * + * ```php + * $executor = new CoopExecutor( + * new RetryExecutor( + * new TimeoutExecutor( + * new UdpTransportExecutor($nameserver), + * 3.0 + * ) + * ) + * ); + * ``` + * + * > Internally, this class uses PHP's UDP sockets and does not take advantage + * of [react/datagram](https://github.com/reactphp/datagram) purely for + * organizational reasons to avoid a cyclic dependency between the two + * packages. Higher-level components should take advantage of the Datagram + * component instead of reimplementing this socket logic from scratch. + */ +final class UdpTransportExecutor implements ExecutorInterface +{ + private $nameserver; + private $loop; + private $parser; + private $dumper; + + /** + * maximum UDP packet size to send and receive + * + * @var int + */ + private $maxPacketSize = 512; + + /** + * @param string $nameserver + * @param ?LoopInterface $loop + */ + public function __construct($nameserver, $loop = null) + { + if (\strpos($nameserver, '[') === false && \substr_count($nameserver, ':') >= 2 && \strpos($nameserver, '://') === false) { + // several colons, but not enclosed in square brackets => enclose IPv6 address in square brackets + $nameserver = '[' . $nameserver . ']'; + } + + $parts = \parse_url((\strpos($nameserver, '://') === false ? 'udp://' : '') . $nameserver); + if (!isset($parts['scheme'], $parts['host']) || $parts['scheme'] !== 'udp' || @\inet_pton(\trim($parts['host'], '[]')) === false) { + throw new \InvalidArgumentException('Invalid nameserver address given'); + } + + if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); + } + + $this->nameserver = 'udp://' . $parts['host'] . ':' . (isset($parts['port']) ? $parts['port'] : 53); + $this->loop = $loop ?: Loop::get(); + $this->parser = new Parser(); + $this->dumper = new BinaryDumper(); + } + + public function query(Query $query) + { + $request = Message::createRequestForQuery($query); + + $queryData = $this->dumper->toBinary($request); + if (isset($queryData[$this->maxPacketSize])) { + return \React\Promise\reject(new \RuntimeException( + 'DNS query for ' . $query->describe() . ' failed: Query too large for UDP transport', + \defined('SOCKET_EMSGSIZE') ? \SOCKET_EMSGSIZE : 90 + )); + } + + // UDP connections are instant, so try connection without a loop or timeout + $errno = 0; + $errstr = ''; + $socket = @\stream_socket_client($this->nameserver, $errno, $errstr, 0); + if ($socket === false) { + return \React\Promise\reject(new \RuntimeException( + 'DNS query for ' . $query->describe() . ' failed: Unable to connect to DNS server ' . $this->nameserver . ' (' . $errstr . ')', + $errno + )); + } + + // set socket to non-blocking and immediately try to send (fill write buffer) + \stream_set_blocking($socket, false); + + \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { + // Write may potentially fail, but most common errors are already caught by connection check above. + // Among others, macOS is known to report here when trying to send to broadcast address. + // This can also be reproduced by writing data exceeding `stream_set_chunk_size()` to a server refusing UDP data. + // fwrite(): send of 8192 bytes failed with errno=111 Connection refused + \preg_match('/errno=(\d+) (.+)/', $error, $m); + $errno = isset($m[1]) ? (int) $m[1] : 0; + $errstr = isset($m[2]) ? $m[2] : $error; + }); + + $written = \fwrite($socket, $queryData); + + \restore_error_handler(); + + if ($written !== \strlen($queryData)) { + return \React\Promise\reject(new \RuntimeException( + 'DNS query for ' . $query->describe() . ' failed: Unable to send query to DNS server ' . $this->nameserver . ' (' . $errstr . ')', + $errno + )); + } + + $loop = $this->loop; + $deferred = new Deferred(function () use ($loop, $socket, $query) { + // cancellation should remove socket from loop and close socket + $loop->removeReadStream($socket); + \fclose($socket); + + throw new CancellationException('DNS query for ' . $query->describe() . ' has been cancelled'); + }); + + $max = $this->maxPacketSize; + $parser = $this->parser; + $nameserver = $this->nameserver; + $loop->addReadStream($socket, function ($socket) use ($loop, $deferred, $query, $parser, $request, $max, $nameserver) { + // try to read a single data packet from the DNS server + // ignoring any errors, this is uses UDP packets and not a stream of data + $data = @\fread($socket, $max); + if ($data === false) { + return; + } + + try { + $response = $parser->parseMessage($data); + } catch (\Exception $e) { + // ignore and await next if we received an invalid message from remote server + // this may as well be a fake response from an attacker (possible DOS) + return; + } + + // ignore and await next if we received an unexpected response ID + // this may as well be a fake response from an attacker (possible cache poisoning) + if ($response->id !== $request->id) { + return; + } + + // we only react to the first valid message, so remove socket from loop and close + $loop->removeReadStream($socket); + \fclose($socket); + + if ($response->tc) { + $deferred->reject(new \RuntimeException( + 'DNS query for ' . $query->describe() . ' failed: The DNS server ' . $nameserver . ' returned a truncated result for a UDP query', + \defined('SOCKET_EMSGSIZE') ? \SOCKET_EMSGSIZE : 90 + )); + return; + } + + $deferred->resolve($response); + }); + + return $deferred->promise(); + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/RecordNotFoundException.php b/tools/php-cs-fixer/vendor/react/dns/src/RecordNotFoundException.php new file mode 100644 index 00000000..3b702742 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/RecordNotFoundException.php @@ -0,0 +1,7 @@ +decorateHostsFileExecutor($this->createExecutor($config, $loop ?: Loop::get())); + + return new Resolver($executor); + } + + /** + * Creates a cached DNS resolver instance for the given DNS config and cache + * + * As of v1.7.0 it's recommended to pass a `Config` object instead of a + * single nameserver address. If the given config contains more than one DNS + * nameserver, all DNS nameservers will be used in order. The primary DNS + * server will always be used first before falling back to the secondary or + * tertiary DNS server. + * + * @param Config|string $config DNS Config object (recommended) or single nameserver address + * @param ?LoopInterface $loop + * @param ?CacheInterface $cache + * @return \React\Dns\Resolver\ResolverInterface + * @throws \InvalidArgumentException for invalid DNS server address + * @throws \UnderflowException when given DNS Config object has an empty list of nameservers + */ + public function createCached($config, $loop = null, $cache = null) + { + if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); + } + + if ($cache !== null && !$cache instanceof CacheInterface) { // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #3 ($cache) expected null|React\Cache\CacheInterface'); + } + + // default to keeping maximum of 256 responses in cache unless explicitly given + if (!($cache instanceof CacheInterface)) { + $cache = new ArrayCache(256); + } + + $executor = $this->createExecutor($config, $loop ?: Loop::get()); + $executor = new CachingExecutor($executor, $cache); + $executor = $this->decorateHostsFileExecutor($executor); + + return new Resolver($executor); + } + + /** + * Tries to load the hosts file and decorates the given executor on success + * + * @param ExecutorInterface $executor + * @return ExecutorInterface + * @codeCoverageIgnore + */ + private function decorateHostsFileExecutor(ExecutorInterface $executor) + { + try { + $executor = new HostsFileExecutor( + HostsFile::loadFromPathBlocking(), + $executor + ); + } catch (\RuntimeException $e) { + // ignore this file if it can not be loaded + } + + // Windows does not store localhost in hosts file by default but handles this internally + // To compensate for this, we explicitly use hard-coded defaults for localhost + if (DIRECTORY_SEPARATOR === '\\') { + $executor = new HostsFileExecutor( + new HostsFile("127.0.0.1 localhost\n::1 localhost"), + $executor + ); + } + + return $executor; + } + + /** + * @param Config|string $nameserver + * @param LoopInterface $loop + * @return CoopExecutor + * @throws \InvalidArgumentException for invalid DNS server address + * @throws \UnderflowException when given DNS Config object has an empty list of nameservers + */ + private function createExecutor($nameserver, LoopInterface $loop) + { + if ($nameserver instanceof Config) { + if (!$nameserver->nameservers) { + throw new \UnderflowException('Empty config with no DNS servers'); + } + + // Hard-coded to check up to 3 DNS servers to match default limits in place in most systems (see MAXNS config). + // Note to future self: Recursion isn't too hard, but how deep do we really want to go? + $primary = reset($nameserver->nameservers); + $secondary = next($nameserver->nameservers); + $tertiary = next($nameserver->nameservers); + + if ($tertiary !== false) { + // 3 DNS servers given => nest first with fallback for second and third + return new CoopExecutor( + new RetryExecutor( + new FallbackExecutor( + $this->createSingleExecutor($primary, $loop), + new FallbackExecutor( + $this->createSingleExecutor($secondary, $loop), + $this->createSingleExecutor($tertiary, $loop) + ) + ) + ) + ); + } elseif ($secondary !== false) { + // 2 DNS servers given => fallback from first to second + return new CoopExecutor( + new RetryExecutor( + new FallbackExecutor( + $this->createSingleExecutor($primary, $loop), + $this->createSingleExecutor($secondary, $loop) + ) + ) + ); + } else { + // 1 DNS server given => use single executor + $nameserver = $primary; + } + } + + return new CoopExecutor(new RetryExecutor($this->createSingleExecutor($nameserver, $loop))); + } + + /** + * @param string $nameserver + * @param LoopInterface $loop + * @return ExecutorInterface + * @throws \InvalidArgumentException for invalid DNS server address + */ + private function createSingleExecutor($nameserver, LoopInterface $loop) + { + $parts = \parse_url($nameserver); + + if (isset($parts['scheme']) && $parts['scheme'] === 'tcp') { + $executor = $this->createTcpExecutor($nameserver, $loop); + } elseif (isset($parts['scheme']) && $parts['scheme'] === 'udp') { + $executor = $this->createUdpExecutor($nameserver, $loop); + } else { + $executor = new SelectiveTransportExecutor( + $this->createUdpExecutor($nameserver, $loop), + $this->createTcpExecutor($nameserver, $loop) + ); + } + + return $executor; + } + + /** + * @param string $nameserver + * @param LoopInterface $loop + * @return TimeoutExecutor + * @throws \InvalidArgumentException for invalid DNS server address + */ + private function createTcpExecutor($nameserver, LoopInterface $loop) + { + return new TimeoutExecutor( + new TcpTransportExecutor($nameserver, $loop), + 5.0, + $loop + ); + } + + /** + * @param string $nameserver + * @param LoopInterface $loop + * @return TimeoutExecutor + * @throws \InvalidArgumentException for invalid DNS server address + */ + private function createUdpExecutor($nameserver, LoopInterface $loop) + { + return new TimeoutExecutor( + new UdpTransportExecutor( + $nameserver, + $loop + ), + 5.0, + $loop + ); + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Resolver/Resolver.php b/tools/php-cs-fixer/vendor/react/dns/src/Resolver/Resolver.php new file mode 100644 index 00000000..92926f3f --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Resolver/Resolver.php @@ -0,0 +1,147 @@ +executor = $executor; + } + + public function resolve($domain) + { + return $this->resolveAll($domain, Message::TYPE_A)->then(function (array $ips) { + return $ips[array_rand($ips)]; + }); + } + + public function resolveAll($domain, $type) + { + $query = new Query($domain, $type, Message::CLASS_IN); + $that = $this; + + return $this->executor->query( + $query + )->then(function (Message $response) use ($query, $that) { + return $that->extractValues($query, $response); + }); + } + + /** + * [Internal] extract all resource record values from response for this query + * + * @param Query $query + * @param Message $response + * @return array + * @throws RecordNotFoundException when response indicates an error or contains no data + * @internal + */ + public function extractValues(Query $query, Message $response) + { + // reject if response code indicates this is an error response message + $code = $response->rcode; + if ($code !== Message::RCODE_OK) { + switch ($code) { + case Message::RCODE_FORMAT_ERROR: + $message = 'Format Error'; + break; + case Message::RCODE_SERVER_FAILURE: + $message = 'Server Failure'; + break; + case Message::RCODE_NAME_ERROR: + $message = 'Non-Existent Domain / NXDOMAIN'; + break; + case Message::RCODE_NOT_IMPLEMENTED: + $message = 'Not Implemented'; + break; + case Message::RCODE_REFUSED: + $message = 'Refused'; + break; + default: + $message = 'Unknown error response code ' . $code; + } + throw new RecordNotFoundException( + 'DNS query for ' . $query->describe() . ' returned an error response (' . $message . ')', + $code + ); + } + + $answers = $response->answers; + $addresses = $this->valuesByNameAndType($answers, $query->name, $query->type); + + // reject if we did not receive a valid answer (domain is valid, but no record for this type could be found) + if (0 === count($addresses)) { + throw new RecordNotFoundException( + 'DNS query for ' . $query->describe() . ' did not return a valid answer (NOERROR / NODATA)' + ); + } + + return array_values($addresses); + } + + /** + * @param \React\Dns\Model\Record[] $answers + * @param string $name + * @param int $type + * @return array + */ + private function valuesByNameAndType(array $answers, $name, $type) + { + // return all record values for this name and type (if any) + $named = $this->filterByName($answers, $name); + $records = $this->filterByType($named, $type); + if ($records) { + return $this->mapRecordData($records); + } + + // no matching records found? check if there are any matching CNAMEs instead + $cnameRecords = $this->filterByType($named, Message::TYPE_CNAME); + if ($cnameRecords) { + $cnames = $this->mapRecordData($cnameRecords); + foreach ($cnames as $cname) { + $records = array_merge( + $records, + $this->valuesByNameAndType($answers, $cname, $type) + ); + } + } + + return $records; + } + + private function filterByName(array $answers, $name) + { + return $this->filterByField($answers, 'name', $name); + } + + private function filterByType(array $answers, $type) + { + return $this->filterByField($answers, 'type', $type); + } + + private function filterByField(array $answers, $field, $value) + { + $value = strtolower($value); + return array_filter($answers, function ($answer) use ($field, $value) { + return $value === strtolower($answer->$field); + }); + } + + private function mapRecordData(array $records) + { + return array_map(function ($record) { + return $record->data; + }, $records); + } +} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Resolver/ResolverInterface.php b/tools/php-cs-fixer/vendor/react/dns/src/Resolver/ResolverInterface.php new file mode 100644 index 00000000..555a1cb1 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/dns/src/Resolver/ResolverInterface.php @@ -0,0 +1,94 @@ +resolve('reactphp.org')->then(function ($ip) { + * echo 'IP for reactphp.org is ' . $ip . PHP_EOL; + * }); + * ``` + * + * This is one of the main methods in this package. It sends a DNS query + * for the given $domain name to your DNS server and returns a single IP + * address on success. + * + * If the DNS server sends a DNS response message that contains more than + * one IP address for this query, it will randomly pick one of the IP + * addresses from the response. If you want the full list of IP addresses + * or want to send a different type of query, you should use the + * [`resolveAll()`](#resolveall) method instead. + * + * If the DNS server sends a DNS response message that indicates an error + * code, this method will reject with a `RecordNotFoundException`. Its + * message and code can be used to check for the response code. + * + * If the DNS communication fails and the server does not respond with a + * valid response message, this message will reject with an `Exception`. + * + * Pending DNS queries can be cancelled by cancelling its pending promise like so: + * + * ```php + * $promise = $resolver->resolve('reactphp.org'); + * + * $promise->cancel(); + * ``` + * + * @param string $domain + * @return \React\Promise\PromiseInterface + * resolves with a single IP address on success or rejects with an Exception on error. + */ + public function resolve($domain); + + /** + * Resolves all record values for the given $domain name and query $type. + * + * ```php + * $resolver->resolveAll('reactphp.org', Message::TYPE_A)->then(function ($ips) { + * echo 'IPv4 addresses for reactphp.org ' . implode(', ', $ips) . PHP_EOL; + * }); + * + * $resolver->resolveAll('reactphp.org', Message::TYPE_AAAA)->then(function ($ips) { + * echo 'IPv6 addresses for reactphp.org ' . implode(', ', $ips) . PHP_EOL; + * }); + * ``` + * + * This is one of the main methods in this package. It sends a DNS query + * for the given $domain name to your DNS server and returns a list with all + * record values on success. + * + * If the DNS server sends a DNS response message that contains one or more + * records for this query, it will return a list with all record values + * from the response. You can use the `Message::TYPE_*` constants to control + * which type of query will be sent. Note that this method always returns a + * list of record values, but each record value type depends on the query + * type. For example, it returns the IPv4 addresses for type `A` queries, + * the IPv6 addresses for type `AAAA` queries, the hostname for type `NS`, + * `CNAME` and `PTR` queries and structured data for other queries. See also + * the `Record` documentation for more details. + * + * If the DNS server sends a DNS response message that indicates an error + * code, this method will reject with a `RecordNotFoundException`. Its + * message and code can be used to check for the response code. + * + * If the DNS communication fails and the server does not respond with a + * valid response message, this message will reject with an `Exception`. + * + * Pending DNS queries can be cancelled by cancelling its pending promise like so: + * + * ```php + * $promise = $resolver->resolveAll('reactphp.org', Message::TYPE_AAAA); + * + * $promise->cancel(); + * ``` + * + * @param string $domain + * @return \React\Promise\PromiseInterface + * Resolves with all record values on success or rejects with an Exception on error. + */ + public function resolveAll($domain, $type); +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/CHANGELOG.md b/tools/php-cs-fixer/vendor/react/event-loop/CHANGELOG.md new file mode 100644 index 00000000..e634b12e --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/CHANGELOG.md @@ -0,0 +1,468 @@ +# Changelog + +## 1.5.0 (2023-11-13) + +* Feature: Improve performance by using `spl_object_id()` on PHP 7.2+. + (#267 by @samsonasik) + +* Feature: Full PHP 8.3 compatibility. + (#269 by @clue) + +* Update tests for `ext-uv` on PHP 8+ and legacy PHP. + (#270 by @clue and #268 by @SimonFrings) + +## 1.4.0 (2023-05-05) + +* Feature: Improve performance of `Loop` by avoiding unneeded method calls. + (#266 by @clue) + +* Feature: Support checking `EINTR` constant from `ext-pcntl` without `ext-sockets`. + (#265 by @clue) + +* Minor documentation improvements. + (#254 by @nhedger) + +* Improve test suite, run tests on PHP 8.2 and report failed assertions. + (#258 by @WyriHaximus, #264 by @clue and #251, #261 and #262 by @SimonFrings) + +## 1.3.0 (2022-03-17) + +* Feature: Improve default `StreamSelectLoop` to report any warnings for invalid streams. + (#245 by @clue) + +* Feature: Improve performance of `StreamSelectLoop` when no timers are scheduled. + (#246 by @clue) + +* Fix: Fix periodic timer with zero interval for `ExtEvLoop` and legacy `ExtLibevLoop`. + (#243 by @lucasnetau) + +* Minor documentation improvements, update PHP version references. + (#240, #248 and #250 by @SimonFrings, #241 by @dbu and #249 by @clue) + +* Improve test suite and test against PHP 8.1. + (#238 by @WyriHaximus and #242 by @clue) + +## 1.2.0 (2021-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). + +* Feature: Introduce new concept of default loop with the new `Loop` class. + (#226 by @WyriHaximus, #229, #231 and #232 by @clue) + + The `Loop` class exists as a convenient global accessor for the event loop. + It provides all methods that exist on the `LoopInterface` as static methods and + will automatically execute the loop at the end of the program: + + ```php + $timer = Loop::addPeriodicTimer(0.1, function () { + echo 'Tick' . PHP_EOL; + }); + + Loop::addTimer(1.0, function () use ($timer) { + Loop::cancelTimer($timer); + echo 'Done' . PHP_EOL; + }); + ``` + + The explicit loop instructions are still valid and may still be useful in some applications, + especially for a transition period towards the more concise style. + The `Loop::get()` method can be used to get the currently active event loop instance. + + ```php + // deprecated + $loop = React\EventLoop\Factory::create(); + + // new + $loop = React\EventLoop\Loop::get(); + ``` + +* Minor documentation improvements and mark legacy extensions as deprecated. + (#234 by @SimonFrings, #214 by @WyriHaximus and #233 and #235 by @nhedger) + +* Improve test suite, use GitHub actions for continuous integration (CI), + update PHPUnit config and run tests on PHP 8. + (#212 and #215 by @SimonFrings and #230 by @clue) + +## 1.1.1 (2020-01-01) + +* Fix: Fix reporting connection refused errors with `ExtUvLoop` on Linux and `StreamSelectLoop` on Windows. + (#207 and #208 by @clue) + +* Fix: Fix unsupported EventConfig and `SEGFAULT` on shutdown with `ExtEventLoop` on Windows. + (#205 by @clue) + +* Fix: Prevent interval overflow for timers very far in the future with `ExtUvLoop`. + (#196 by @PabloKowalczyk) + +* Fix: Check PCNTL functions for signal support instead of PCNTL extension with `StreamSelectLoop`. + (#195 by @clue) + +* Add `.gitattributes` to exclude dev files from exports. + (#201 by @reedy) + +* Improve test suite to fix testing `ExtUvLoop` on Travis, + fix Travis CI builds, do not install `libuv` on legacy PHP setups, + fix failing test cases due to inaccurate timers, + run tests on Windows via Travis CI and + run tests on PHP 7.4 and simplify test matrix and test setup. + (#197 by @WyriHaximus and #202, #203, #204 and #209 by @clue) + +## 1.1.0 (2019-02-07) + +* New UV based event loop (ext-uv). + (#112 by @WyriHaximus) + +* Use high resolution timer on PHP 7.3+. + (#182 by @clue) + +* Improve PCNTL signals by using async signal dispatching if available. + (#179 by @CharlotteDunois) + +* Improve test suite and test suite set up. + (#174 by @WyriHaximus, #181 by @clue) + +* Fix PCNTL signals edge case. + (#183 by @clue) + +## 1.0.0 (2018-07-11) + +* First stable LTS release, now following [SemVer](https://semver.org/). + We'd like to emphasize that this component is production ready and battle-tested. + We plan to support all long-term support (LTS) releases for at least 24 months, + so you have a rock-solid foundation to build on top of. + +> Contains no other changes, so it's actually fully compatible with the v0.5.3 release. + +## 0.5.3 (2018-07-09) + +* Improve performance by importing global functions. + (#167 by @Ocramius) + +* Improve test suite by simplifying test bootstrap by using dev autoloader. + (#169 by @lcobucci) + +* Minor internal changes to improved backward compatibility with PHP 5.3. + (#166 by @Donatello-za) + +## 0.5.2 (2018-04-24) + +* Feature: Improve memory consumption and runtime performance for `StreamSelectLoop` timers. + (#164 by @clue) + +* Improve test suite by removing I/O dependency at `StreamSelectLoopTest` to fix Mac OS X tests. + (#161 by @nawarian) + +## 0.5.1 (2018-04-09) + +* Feature: New `ExtEvLoop` (PECL ext-ev) (#148 by @kaduev13) + +## 0.5.0 (2018-04-05) + +A major feature release with a significant documentation overhaul and long overdue API cleanup! + +This update involves a number of BC breaks due to dropped support for deprecated +functionality. We've tried hard to avoid BC breaks where possible and minimize +impact otherwise. We expect that most consumers of this package will actually +not be affected by any BC breaks, see below for more details. + +We realize that the changes listed below may seem overwhelming, but we've tried +to be very clear about any possible BC breaks. Don't worry: In fact, all ReactPHP +components are already compatible and support both this new release as well as +providing backwards compatibility with the last release. + +* Feature / BC break: Add support for signal handling via new + `LoopInterface::addSignal()` and `LoopInterface::removeSignal()` methods. + (#104 by @WyriHaximus and #111 and #150 by @clue) + + ```php + $loop->addSignal(SIGINT, function () { + echo 'CTRL-C'; + }); + ``` + +* Feature: Significant documentation updates for `LoopInterface` and `Factory`. + (#100, #119, #126, #127, #159 and #160 by @clue, #113 by @WyriHaximus and #81 and #91 by @jsor) + +* Feature: Add examples to ease getting started + (#99, #100 and #125 by @clue, #59 by @WyriHaximus and #143 by @jsor) + +* Feature: Documentation for advanced timer concepts, such as monotonic time source vs wall-clock time + and high precision timers with millisecond accuracy or below. + (#130 and #157 by @clue) + +* Feature: Documentation for advanced stream concepts, such as edge-triggered event listeners + and stream buffers and allow throwing Exception if stream resource is not supported. + (#129 and #158 by @clue) + +* Feature: Throw `BadMethodCallException` on manual loop creation when required extension isn't installed. + (#153 by @WyriHaximus) + +* Feature / BC break: First class support for legacy PHP 5.3 through PHP 7.2 and HHVM + and remove all `callable` type hints for consistency reasons. + (#141 and #151 by @clue) + +* BC break: Documentation for timer API and clean up unneeded timer API. + (#102 by @clue) + + Remove `TimerInterface::cancel()`, use `LoopInterface::cancelTimer()` instead: + + ```php + // old (method invoked on timer instance) + $timer->cancel(); + + // already supported before: invoke method on loop instance + $loop->cancelTimer($timer); + ``` + + Remove unneeded `TimerInterface::setData()` and `TimerInterface::getData()`, + use closure binding to add arbitrary data to timer instead: + + ```php + // old (limited setData() and getData() only allows single variable) + $name = 'Tester'; + $timer = $loop->addTimer(1.0, function ($timer) { + echo 'Hello ' . $timer->getData() . PHP_EOL; + }); + $timer->setData($name); + + // already supported before: closure binding allows any number of variables + $name = 'Tester'; + $loop->addTimer(1.0, function () use ($name) { + echo 'Hello ' . $name . PHP_EOL; + }); + ``` + + Remove unneeded `TimerInterface::getLoop()`, use closure binding instead: + + ```php + // old (getLoop() called on timer instance) + $loop->addTimer(0.1, function ($timer) { + $timer->getLoop()->stop(); + }); + + // already supported before: use closure binding as usual + $loop->addTimer(0.1, function () use ($loop) { + $loop->stop(); + }); + ``` + +* BC break: Remove unneeded `LoopInterface::isTimerActive()` and + `TimerInterface::isActive()` to reduce API surface. + (#133 by @clue) + + ```php + // old (method on timer instance or on loop instance) + $timer->isActive(); + $loop->isTimerActive($timer); + ``` + +* BC break: Move `TimerInterface` one level up to `React\EventLoop\TimerInterface`. + (#138 by @WyriHaximus) + + ```php + // old (notice obsolete "Timer" namespace) + assert($timer instanceof React\EventLoop\Timer\TimerInterface); + + // new + assert($timer instanceof React\EventLoop\TimerInterface); + ``` + +* BC break: Remove unneeded `LoopInterface::nextTick()` (and internal `NextTickQueue`), + use `LoopInterface::futureTick()` instead. + (#30 by @clue) + + ```php + // old (removed) + $loop->nextTick(function () { + echo 'tick'; + }); + + // already supported before + $loop->futureTick(function () { + echo 'tick'; + }); + ``` + +* BC break: Remove unneeded `$loop` argument for `LoopInterface::futureTick()` + (and fix internal cyclic dependency). + (#103 by @clue) + + ```php + // old ($loop gets passed by default) + $loop->futureTick(function ($loop) { + $loop->stop(); + }); + + // already supported before: use closure binding as usual + $loop->futureTick(function () use ($loop) { + $loop->stop(); + }); + ``` + +* BC break: Remove unneeded `LoopInterface::tick()`. + (#72 by @jsor) + + ```php + // old (removed) + $loop->tick(); + + // suggested work around for testing purposes only + $loop->futureTick(function () use ($loop) { + $loop->stop(); + }); + ``` + +* BC break: Documentation for advanced stream API and clean up unneeded stream API. + (#110 by @clue) + + Remove unneeded `$loop` argument for `LoopInterface::addReadStream()` + and `LoopInterface::addWriteStream()`, use closure binding instead: + + ```php + // old ($loop gets passed by default) + $loop->addReadStream($stream, function ($stream, $loop) { + $loop->removeReadStream($stream); + }); + + // already supported before: use closure binding as usual + $loop->addReadStream($stream, function ($stream) use ($loop) { + $loop->removeReadStream($stream); + }); + ``` + +* BC break: Remove unneeded `LoopInterface::removeStream()` method, + use `LoopInterface::removeReadStream()` and `LoopInterface::removeWriteStream()` instead. + (#118 by @clue) + + ```php + // old + $loop->removeStream($stream); + + // already supported before + $loop->removeReadStream($stream); + $loop->removeWriteStream($stream); + ``` + +* BC break: Rename `LibEventLoop` to `ExtLibeventLoop` and `LibEvLoop` to `ExtLibevLoop` + for consistent naming for event loop implementations. + (#128 by @clue) + +* BC break: Remove optional `EventBaseConfig` argument from `ExtEventLoop` + and make its `FEATURE_FDS` enabled by default. + (#156 by @WyriHaximus) + +* BC break: Mark all classes as final to discourage inheritance. + (#131 by @clue) + +* Fix: Fix `ExtEventLoop` to keep track of stream resources (refcount) + (#123 by @clue) + +* Fix: Ensure large timer interval does not overflow on 32bit systems + (#132 by @clue) + +* Fix: Fix separately removing readable and writable side of stream when closing + (#139 by @clue) + +* Fix: Properly clean up event watchers for `ext-event` and `ext-libev` + (#149 by @clue) + +* Fix: Minor code cleanup and remove unneeded references + (#145 by @seregazhuk) + +* Fix: Discourage outdated `ext-libevent` on PHP 7 + (#62 by @cboden) + +* Improve test suite by adding forward compatibility with PHPUnit 6 and PHPUnit 5, + lock Travis distro so new defaults will not break the build, + improve test suite to be less fragile and increase test timeouts, + test against PHP 7.2 and reduce fwrite() call length to one chunk. + (#106 and #144 by @clue, #120 and #124 by @carusogabriel, #147 by nawarian and #92 by @kelunik) + +* A number of changes were originally planned for this release but have been backported + to the last `v0.4.3` already: #74, #76, #79, #81 (refs #65, #66, #67), #88 and #93 + +## 0.4.3 (2017-04-27) + +* Bug fix: Bugfix in the usage sample code #57 (@dandelionred) +* Improvement: Remove branch-alias definition #53 (@WyriHaximus) +* Improvement: StreamSelectLoop: Use fresh time so Timers added during stream events are accurate #51 (@andrewminerd) +* Improvement: Avoid deprecation warnings in test suite due to deprecation of getMock() in PHPUnit #68 (@martinschroeder) +* Improvement: Add PHPUnit 4.8 to require-dev #69 (@shaunbramley) +* Improvement: Increase test timeouts for HHVM and unify timeout handling #70 (@clue) +* Improvement: Travis improvements (backported from #74) #75 (@clue) +* Improvement: Test suite now uses socket pairs instead of memory streams #66 (@martinschroeder) +* Improvement: StreamSelectLoop: Test suite uses signal constant names in data provider #67 (@martinschroeder) +* Improvement: ExtEventLoop: No longer suppress all errors #65 (@mamciek) +* Improvement: Readme cleanup #89 (@jsor) +* Improvement: Restructure and improve README #90 (@jsor) +* Bug fix: StreamSelectLoop: Fix erroneous zero-time sleep (backport to 0.4) #94 (@jsor) + +## 0.4.2 (2016-03-07) + +* Bug fix: No longer error when signals sent to StreamSelectLoop +* Support HHVM and PHP7 (@ondrejmirtes, @cebe) +* Feature: Added support for EventConfig for ExtEventLoop (@steverhoades) +* Bug fix: Fixed an issue loading loop extension libs via autoloader (@czarpino) + +## 0.4.1 (2014-04-13) + +* Bug fix: null timeout in StreamSelectLoop causing 100% CPU usage (@clue) +* Bug fix: v0.3.4 changes merged for v0.4.1 + +## 0.4.0 (2014-02-02) + +* Feature: Added `EventLoopInterface::nextTick()`, implemented in all event loops (@jmalloc) +* Feature: Added `EventLoopInterface::futureTick()`, implemented in all event loops (@jmalloc) +* Feature: Added `ExtEventLoop` implementation using pecl/event (@jmalloc) +* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks +* BC break: New method: `EventLoopInterface::nextTick()` +* BC break: New method: `EventLoopInterface::futureTick()` +* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0 + +## 0.3.5 (2016-12-28) + +This is a compatibility release that eases upgrading to the v0.4 release branch. +You should consider upgrading to the v0.4 release branch. + +* Feature: Cap min timer interval at 1µs, thus improving compatibility with v0.4 + (#47 by @clue) + +## 0.3.4 (2014-03-30) + +* Bug fix: Changed StreamSelectLoop to use non-blocking behavior on tick() (@astephens25) + +## 0.3.3 (2013-07-08) + +* Bug fix: No error on removing non-existent streams (@clue) +* Bug fix: Do not silently remove feof listeners in `LibEvLoop` + +## 0.3.0 (2013-04-14) + +* BC break: New timers API (@nrk) +* BC break: Remove check on return value from stream callbacks (@nrk) + +## 0.2.7 (2013-01-05) + +* Bug fix: Fix libevent timers with PHP 5.3 +* Bug fix: Fix libevent timer cancellation (@nrk) + +## 0.2.6 (2012-12-26) + +* Bug fix: Plug memory issue in libevent timers (@cameronjacobson) +* Bug fix: Correctly pause LibEvLoop on stop() + +## 0.2.3 (2012-11-14) + +* Feature: LibEvLoop, integration of `php-libev` + +## 0.2.0 (2012-09-10) + +* Version bump + +## 0.1.1 (2012-07-12) + +* Version bump + +## 0.1.0 (2012-07-11) + +* First tagged release diff --git a/tools/php-cs-fixer/vendor/react/event-loop/LICENSE b/tools/php-cs-fixer/vendor/react/event-loop/LICENSE new file mode 100644 index 00000000..d6f8901f --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/event-loop/README.md b/tools/php-cs-fixer/vendor/react/event-loop/README.md new file mode 100644 index 00000000..88a3e18b --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/README.md @@ -0,0 +1,930 @@ +# EventLoop + +[![CI status](https://github.com/reactphp/event-loop/actions/workflows/ci.yml/badge.svg)](https://github.com/reactphp/event-loop/actions) +[![installs on Packagist](https://img.shields.io/packagist/dt/react/event-loop?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/event-loop) + +[ReactPHP](https://reactphp.org/)'s core reactor event loop that libraries can use for evented I/O. + +In order for async based libraries to be interoperable, they need to use the +same event loop. This component provides a common `LoopInterface` that any +library can target. This allows them to be used in the same loop, with one +single [`run()`](#run) call that is controlled by the user. + +**Table of contents** + +* [Quickstart example](#quickstart-example) +* [Usage](#usage) + * [Loop](#loop) + * [Loop methods](#loop-methods) + * [Loop autorun](#loop-autorun) + * [get()](#get) + * [~~Factory~~](#factory) + * [~~create()~~](#create) + * [Loop implementations](#loop-implementations) + * [StreamSelectLoop](#streamselectloop) + * [ExtEventLoop](#exteventloop) + * [ExtEvLoop](#extevloop) + * [ExtUvLoop](#extuvloop) + * [~~ExtLibeventLoop~~](#extlibeventloop) + * [~~ExtLibevLoop~~](#extlibevloop) + * [LoopInterface](#loopinterface) + * [run()](#run) + * [stop()](#stop) + * [addTimer()](#addtimer) + * [addPeriodicTimer()](#addperiodictimer) + * [cancelTimer()](#canceltimer) + * [futureTick()](#futuretick) + * [addSignal()](#addsignal) + * [removeSignal()](#removesignal) + * [addReadStream()](#addreadstream) + * [addWriteStream()](#addwritestream) + * [removeReadStream()](#removereadstream) + * [removeWriteStream()](#removewritestream) +* [Install](#install) +* [Tests](#tests) +* [License](#license) +* [More](#more) + +## Quickstart example + +Here is an async HTTP server built with just the event loop. + +```php +addPeriodicTimer(0.1, function () { + echo 'Tick' . PHP_EOL; +}); + +$loop->addTimer(1.0, function () use ($loop, $timer) { + $loop->cancelTimer($timer); + echo 'Done' . PHP_EOL; +}); + +$loop->run(); +``` + +While the former is more concise, the latter is more explicit. +In both cases, the program would perform the exact same steps. + +1. The event loop instance is created at the beginning of the program. This is + implicitly done the first time you call the [`Loop` class](#loop) or + explicitly when using the deprecated [`Factory::create()` method](#create) + (or manually instantiating any of the [loop implementations](#loop-implementations)). +2. The event loop is used directly or passed as an instance to library and + application code. In this example, a periodic timer is registered with the + event loop which simply outputs `Tick` every fraction of a second until another + timer stops the periodic timer after a second. +3. The event loop is run at the end of the program. This is automatically done + when using the [`Loop` class](#loop) or explicitly with a single [`run()`](#run) + call at the end of the program. + +As of `v1.2.0`, we highly recommend using the [`Loop` class](#loop). +The explicit loop instructions are still valid and may still be useful in some +applications, especially for a transition period towards the more concise style. + +### Loop + +The `Loop` class exists as a convenient global accessor for the event loop. + +#### Loop methods + +The `Loop` class provides all methods that exist on the [`LoopInterface`](#loopinterface) +as static methods: + +* [run()](#run) +* [stop()](#stop) +* [addTimer()](#addtimer) +* [addPeriodicTimer()](#addperiodictimer) +* [cancelTimer()](#canceltimer) +* [futureTick()](#futuretick) +* [addSignal()](#addsignal) +* [removeSignal()](#removesignal) +* [addReadStream()](#addreadstream) +* [addWriteStream()](#addwritestream) +* [removeReadStream()](#removereadstream) +* [removeWriteStream()](#removewritestream) + +If you're working with the event loop in your application code, it's often +easiest to directly interface with the static methods defined on the `Loop` class +like this: + +```php +use React\EventLoop\Loop; + +$timer = Loop::addPeriodicTimer(0.1, function () { + echo 'Tick' . PHP_EOL; +}); + +Loop::addTimer(1.0, function () use ($timer) { + Loop::cancelTimer($timer); + echo 'Done' . PHP_EOL; +}); +``` + +On the other hand, if you're familiar with object-oriented programming (OOP) and +dependency injection (DI), you may want to inject an event loop instance and +invoke instance methods on the `LoopInterface` like this: + +```php +use React\EventLoop\Loop; +use React\EventLoop\LoopInterface; + +class Greeter +{ + private $loop; + + public function __construct(LoopInterface $loop) + { + $this->loop = $loop; + } + + public function greet(string $name) + { + $this->loop->addTimer(1.0, function () use ($name) { + echo 'Hello ' . $name . '!' . PHP_EOL; + }); + } +} + +$greeter = new Greeter(Loop::get()); +$greeter->greet('Alice'); +$greeter->greet('Bob'); +``` + +Each static method call will be forwarded as-is to the underlying event loop +instance by using the [`Loop::get()`](#get) call internally. +See [`LoopInterface`](#loopinterface) for more details about available methods. + +#### Loop autorun + +When using the `Loop` class, it will automatically execute the loop at the end of +the program. This means the following example will schedule a timer and will +automatically execute the program until the timer event fires: + +```php +use React\EventLoop\Loop; + +Loop::addTimer(1.0, function () { + echo 'Hello' . PHP_EOL; +}); +``` + +As of `v1.2.0`, we highly recommend using the `Loop` class this way and omitting any +explicit [`run()`](#run) calls. For BC reasons, the explicit [`run()`](#run) +method is still valid and may still be useful in some applications, especially +for a transition period towards the more concise style. + +If you don't want the `Loop` to run automatically, you can either explicitly +[`run()`](#run) or [`stop()`](#stop) it. This can be useful if you're using +a global exception handler like this: + +```php +use React\EventLoop\Loop; + +Loop::addTimer(10.0, function () { + echo 'Never happens'; +}); + +set_exception_handler(function (Throwable $e) { + echo 'Error: ' . $e->getMessage() . PHP_EOL; + Loop::stop(); +}); + +throw new RuntimeException('Demo'); +``` + +#### get() + +The `get(): LoopInterface` method can be used to +get the currently active event loop instance. + +This method will always return the same event loop instance throughout the +lifetime of your application. + +```php +use React\EventLoop\Loop; +use React\EventLoop\LoopInterface; + +$loop = Loop::get(); + +assert($loop instanceof LoopInterface); +assert($loop === Loop::get()); +``` + +This is particularly useful if you're using object-oriented programming (OOP) +and dependency injection (DI). In this case, you may want to inject an event +loop instance and invoke instance methods on the `LoopInterface` like this: + +```php +use React\EventLoop\Loop; +use React\EventLoop\LoopInterface; + +class Greeter +{ + private $loop; + + public function __construct(LoopInterface $loop) + { + $this->loop = $loop; + } + + public function greet(string $name) + { + $this->loop->addTimer(1.0, function () use ($name) { + echo 'Hello ' . $name . '!' . PHP_EOL; + }); + } +} + +$greeter = new Greeter(Loop::get()); +$greeter->greet('Alice'); +$greeter->greet('Bob'); +``` + +See [`LoopInterface`](#loopinterface) for more details about available methods. + +### ~~Factory~~ + +> Deprecated since v1.2.0, see [`Loop` class](#loop) instead. + +The deprecated `Factory` class exists as a convenient way to pick the best available +[event loop implementation](#loop-implementations). + +#### ~~create()~~ + +> Deprecated since v1.2.0, see [`Loop::get()`](#get) instead. + +The deprecated `create(): LoopInterface` method can be used to +create a new event loop instance: + +```php +// deprecated +$loop = React\EventLoop\Factory::create(); + +// new +$loop = React\EventLoop\Loop::get(); +``` + +This method always returns an instance implementing [`LoopInterface`](#loopinterface), +the actual [event loop implementation](#loop-implementations) is an implementation detail. + +This method should usually only be called once at the beginning of the program. + +### Loop implementations + +In addition to the [`LoopInterface`](#loopinterface), there are a number of +event loop implementations provided. + +All of the event loops support these features: + +* File descriptor polling +* One-off timers +* Periodic timers +* Deferred execution on future loop tick + +For most consumers of this package, the underlying event loop implementation is +an implementation detail. +You should use the [`Loop` class](#loop) to automatically create a new instance. + +Advanced! If you explicitly need a certain event loop implementation, you can +manually instantiate one of the following classes. +Note that you may have to install the required PHP extensions for the respective +event loop implementation first or they will throw a `BadMethodCallException` on creation. + +#### StreamSelectLoop + +A `stream_select()` based event loop. + +This uses the [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php) +function and is the only implementation that works out of the box with PHP. + +This event loop works out of the box on PHP 5.3 through PHP 8+ and HHVM. +This means that no installation is required and this library works on all +platforms and supported PHP versions. +Accordingly, the [`Loop` class](#loop) and the deprecated [`Factory`](#factory) +will use this event loop by default if you do not install any of the event loop +extensions listed below. + +Under the hood, it does a simple `select` system call. +This system call is limited to the maximum file descriptor number of +`FD_SETSIZE` (platform dependent, commonly 1024) and scales with `O(m)` +(`m` being the maximum file descriptor number passed). +This means that you may run into issues when handling thousands of streams +concurrently and you may want to look into using one of the alternative +event loop implementations listed below in this case. +If your use case is among the many common use cases that involve handling only +dozens or a few hundred streams at once, then this event loop implementation +performs really well. + +If you want to use signal handling (see also [`addSignal()`](#addsignal) below), +this event loop implementation requires `ext-pcntl`. +This extension is only available for Unix-like platforms and does not support +Windows. +It is commonly installed as part of many PHP distributions. +If this extension is missing (or you're running on Windows), signal handling is +not supported and throws a `BadMethodCallException` instead. + +This event loop is known to rely on wall-clock time to schedule future timers +when using any version before PHP 7.3, because a monotonic time source is +only available as of PHP 7.3 (`hrtime()`). +While this does not affect many common use cases, this is an important +distinction for programs that rely on a high time precision or on systems +that are subject to discontinuous time adjustments (time jumps). +This means that if you schedule a timer to trigger in 30s on PHP < 7.3 and +then adjust your system time forward by 20s, the timer may trigger in 10s. +See also [`addTimer()`](#addtimer) for more details. + +#### ExtEventLoop + +An `ext-event` based event loop. + +This uses the [`event` PECL extension](https://pecl.php.net/package/event), +that provides an interface to `libevent` library. +`libevent` itself supports a number of system-specific backends (epoll, kqueue). + +This loop is known to work with PHP 5.4 through PHP 8+. + +#### ExtEvLoop + +An `ext-ev` based event loop. + +This loop uses the [`ev` PECL extension](https://pecl.php.net/package/ev), +that provides an interface to `libev` library. +`libev` itself supports a number of system-specific backends (epoll, kqueue). + + +This loop is known to work with PHP 5.4 through PHP 8+. + +#### ExtUvLoop + +An `ext-uv` based event loop. + +This loop uses the [`uv` PECL extension](https://pecl.php.net/package/uv), +that provides an interface to `libuv` library. +`libuv` itself supports a number of system-specific backends (epoll, kqueue). + +This loop is known to work with PHP 7+. + +#### ~~ExtLibeventLoop~~ + +> Deprecated since v1.2.0, use [`ExtEventLoop`](#exteventloop) instead. + +An `ext-libevent` based event loop. + +This uses the [`libevent` PECL extension](https://pecl.php.net/package/libevent), +that provides an interface to `libevent` library. +`libevent` itself supports a number of system-specific backends (epoll, kqueue). + +This event loop does only work with PHP 5. +An [unofficial update](https://github.com/php/pecl-event-libevent/pull/2) for +PHP 7 does exist, but it is known to cause regular crashes due to `SEGFAULT`s. +To reiterate: Using this event loop on PHP 7 is not recommended. +Accordingly, neither the [`Loop` class](#loop) nor the deprecated +[`Factory` class](#factory) will try to use this event loop on PHP 7. + +This event loop is known to trigger a readable listener only if +the stream *becomes* readable (edge-triggered) and may not trigger if the +stream has already been readable from the beginning. +This also implies that a stream may not be recognized as readable when data +is still left in PHP's internal stream buffers. +As such, it's recommended to use `stream_set_read_buffer($stream, 0);` +to disable PHP's internal read buffer in this case. +See also [`addReadStream()`](#addreadstream) for more details. + +#### ~~ExtLibevLoop~~ + +> Deprecated since v1.2.0, use [`ExtEvLoop`](#extevloop) instead. + +An `ext-libev` based event loop. + +This uses an [unofficial `libev` extension](https://github.com/m4rw3r/php-libev), +that provides an interface to `libev` library. +`libev` itself supports a number of system-specific backends (epoll, kqueue). + +This loop does only work with PHP 5. +An update for PHP 7 is [unlikely](https://github.com/m4rw3r/php-libev/issues/8) +to happen any time soon. + +### LoopInterface + +#### run() + +The `run(): void` method can be used to +run the event loop until there are no more tasks to perform. + +For many applications, this method is the only directly visible +invocation on the event loop. +As a rule of thumb, it is usually recommended to attach everything to the +same loop instance and then run the loop once at the bottom end of the +application. + +```php +$loop->run(); +``` + +This method will keep the loop running until there are no more tasks +to perform. In other words: This method will block until the last +timer, stream and/or signal has been removed. + +Likewise, it is imperative to ensure the application actually invokes +this method once. Adding listeners to the loop and missing to actually +run it will result in the application exiting without actually waiting +for any of the attached listeners. + +This method MUST NOT be called while the loop is already running. +This method MAY be called more than once after it has explicitly been +[`stop()`ped](#stop) or after it automatically stopped because it +previously did no longer have anything to do. + +#### stop() + +The `stop(): void` method can be used to +instruct a running event loop to stop. + +This method is considered advanced usage and should be used with care. +As a rule of thumb, it is usually recommended to let the loop stop +only automatically when it no longer has anything to do. + +This method can be used to explicitly instruct the event loop to stop: + +```php +$loop->addTimer(3.0, function () use ($loop) { + $loop->stop(); +}); +``` + +Calling this method on a loop instance that is not currently running or +on a loop instance that has already been stopped has no effect. + +#### addTimer() + +The `addTimer(float $interval, callable $callback): TimerInterface` method can be used to +enqueue a callback to be invoked once after the given interval. + +The second parameter MUST be a timer callback function that accepts +the timer instance as its only parameter. +If you don't use the timer instance inside your timer callback function +you MAY use a function which has no parameters at all. + +The timer callback function MUST NOT throw an `Exception`. +The return value of the timer callback function will be ignored and has +no effect, so for performance reasons you're recommended to not return +any excessive data structures. + +This method returns a timer instance. The same timer instance will also be +passed into the timer callback function as described above. +You can invoke [`cancelTimer`](#canceltimer) to cancel a pending timer. +Unlike [`addPeriodicTimer()`](#addperiodictimer), this method will ensure +the callback will be invoked only once after the given interval. + +```php +$loop->addTimer(0.8, function () { + echo 'world!' . PHP_EOL; +}); + +$loop->addTimer(0.3, function () { + echo 'hello '; +}); +``` + +See also [example #1](examples). + +If you want to access any variables within your callback function, you +can bind arbitrary data to a callback closure like this: + +```php +function hello($name, LoopInterface $loop) +{ + $loop->addTimer(1.0, function () use ($name) { + echo "hello $name\n"; + }); +} + +hello('Tester', $loop); +``` + +This interface does not enforce any particular timer resolution, so +special care may have to be taken if you rely on very high precision with +millisecond accuracy or below. Event loop implementations SHOULD work on +a best effort basis and SHOULD provide at least millisecond accuracy +unless otherwise noted. Many existing event loop implementations are +known to provide microsecond accuracy, but it's generally not recommended +to rely on this high precision. + +Similarly, the execution order of timers scheduled to execute at the +same time (within its possible accuracy) is not guaranteed. + +This interface suggests that event loop implementations SHOULD use a +monotonic time source if available. Given that a monotonic time source is +only available as of PHP 7.3 by default, event loop implementations MAY +fall back to using wall-clock time. +While this does not affect many common use cases, this is an important +distinction for programs that rely on a high time precision or on systems +that are subject to discontinuous time adjustments (time jumps). +This means that if you schedule a timer to trigger in 30s and then adjust +your system time forward by 20s, the timer SHOULD still trigger in 30s. +See also [event loop implementations](#loop-implementations) for more details. + +#### addPeriodicTimer() + +The `addPeriodicTimer(float $interval, callable $callback): TimerInterface` method can be used to +enqueue a callback to be invoked repeatedly after the given interval. + +The second parameter MUST be a timer callback function that accepts +the timer instance as its only parameter. +If you don't use the timer instance inside your timer callback function +you MAY use a function which has no parameters at all. + +The timer callback function MUST NOT throw an `Exception`. +The return value of the timer callback function will be ignored and has +no effect, so for performance reasons you're recommended to not return +any excessive data structures. + +This method returns a timer instance. The same timer instance will also be +passed into the timer callback function as described above. +Unlike [`addTimer()`](#addtimer), this method will ensure the callback +will be invoked infinitely after the given interval or until you invoke +[`cancelTimer`](#canceltimer). + +```php +$timer = $loop->addPeriodicTimer(0.1, function () { + echo 'tick!' . PHP_EOL; +}); + +$loop->addTimer(1.0, function () use ($loop, $timer) { + $loop->cancelTimer($timer); + echo 'Done' . PHP_EOL; +}); +``` + +See also [example #2](examples). + +If you want to limit the number of executions, you can bind +arbitrary data to a callback closure like this: + +```php +function hello($name, LoopInterface $loop) +{ + $n = 3; + $loop->addPeriodicTimer(1.0, function ($timer) use ($name, $loop, &$n) { + if ($n > 0) { + --$n; + echo "hello $name\n"; + } else { + $loop->cancelTimer($timer); + } + }); +} + +hello('Tester', $loop); +``` + +This interface does not enforce any particular timer resolution, so +special care may have to be taken if you rely on very high precision with +millisecond accuracy or below. Event loop implementations SHOULD work on +a best effort basis and SHOULD provide at least millisecond accuracy +unless otherwise noted. Many existing event loop implementations are +known to provide microsecond accuracy, but it's generally not recommended +to rely on this high precision. + +Similarly, the execution order of timers scheduled to execute at the +same time (within its possible accuracy) is not guaranteed. + +This interface suggests that event loop implementations SHOULD use a +monotonic time source if available. Given that a monotonic time source is +only available as of PHP 7.3 by default, event loop implementations MAY +fall back to using wall-clock time. +While this does not affect many common use cases, this is an important +distinction for programs that rely on a high time precision or on systems +that are subject to discontinuous time adjustments (time jumps). +This means that if you schedule a timer to trigger in 30s and then adjust +your system time forward by 20s, the timer SHOULD still trigger in 30s. +See also [event loop implementations](#loop-implementations) for more details. + +Additionally, periodic timers may be subject to timer drift due to +re-scheduling after each invocation. As such, it's generally not +recommended to rely on this for high precision intervals with millisecond +accuracy or below. + +#### cancelTimer() + +The `cancelTimer(TimerInterface $timer): void` method can be used to +cancel a pending timer. + +See also [`addPeriodicTimer()`](#addperiodictimer) and [example #2](examples). + +Calling this method on a timer instance that has not been added to this +loop instance or on a timer that has already been cancelled has no effect. + +#### futureTick() + +The `futureTick(callable $listener): void` method can be used to +schedule a callback to be invoked on a future tick of the event loop. + +This works very much similar to timers with an interval of zero seconds, +but does not require the overhead of scheduling a timer queue. + +The tick callback function MUST be able to accept zero parameters. + +The tick callback function MUST NOT throw an `Exception`. +The return value of the tick callback function will be ignored and has +no effect, so for performance reasons you're recommended to not return +any excessive data structures. + +If you want to access any variables within your callback function, you +can bind arbitrary data to a callback closure like this: + +```php +function hello($name, LoopInterface $loop) +{ + $loop->futureTick(function () use ($name) { + echo "hello $name\n"; + }); +} + +hello('Tester', $loop); +``` + +Unlike timers, tick callbacks are guaranteed to be executed in the order +they are enqueued. +Also, once a callback is enqueued, there's no way to cancel this operation. + +This is often used to break down bigger tasks into smaller steps (a form +of cooperative multitasking). + +```php +$loop->futureTick(function () { + echo 'b'; +}); +$loop->futureTick(function () { + echo 'c'; +}); +echo 'a'; +``` + +See also [example #3](examples). + +#### addSignal() + +The `addSignal(int $signal, callable $listener): void` method can be used to +register a listener to be notified when a signal has been caught by this process. + +This is useful to catch user interrupt signals or shutdown signals from +tools like `supervisor` or `systemd`. + +The second parameter MUST be a listener callback function that accepts +the signal as its only parameter. +If you don't use the signal inside your listener callback function +you MAY use a function which has no parameters at all. + +The listener callback function MUST NOT throw an `Exception`. +The return value of the listener callback function will be ignored and has +no effect, so for performance reasons you're recommended to not return +any excessive data structures. + +```php +$loop->addSignal(SIGINT, function (int $signal) { + echo 'Caught user interrupt signal' . PHP_EOL; +}); +``` + +See also [example #4](examples). + +Signaling is only available on Unix-like platforms, Windows isn't +supported due to operating system limitations. +This method may throw a `BadMethodCallException` if signals aren't +supported on this platform, for example when required extensions are +missing. + +**Note: A listener can only be added once to the same signal, any +attempts to add it more than once will be ignored.** + +#### removeSignal() + +The `removeSignal(int $signal, callable $listener): void` method can be used to +remove a previously added signal listener. + +```php +$loop->removeSignal(SIGINT, $listener); +``` + +Any attempts to remove listeners that aren't registered will be ignored. + +#### addReadStream() + +> Advanced! Note that this low-level API is considered advanced usage. + Most use cases should probably use the higher-level + [readable Stream API](https://github.com/reactphp/stream#readablestreaminterface) + instead. + +The `addReadStream(resource $stream, callable $callback): void` method can be used to +register a listener to be notified when a stream is ready to read. + +The first parameter MUST be a valid stream resource that supports +checking whether it is ready to read by this loop implementation. +A single stream resource MUST NOT be added more than once. +Instead, either call [`removeReadStream()`](#removereadstream) first or +react to this event with a single listener and then dispatch from this +listener. This method MAY throw an `Exception` if the given resource type +is not supported by this loop implementation. + +The second parameter MUST be a listener callback function that accepts +the stream resource as its only parameter. +If you don't use the stream resource inside your listener callback function +you MAY use a function which has no parameters at all. + +The listener callback function MUST NOT throw an `Exception`. +The return value of the listener callback function will be ignored and has +no effect, so for performance reasons you're recommended to not return +any excessive data structures. + +If you want to access any variables within your callback function, you +can bind arbitrary data to a callback closure like this: + +```php +$loop->addReadStream($stream, function ($stream) use ($name) { + echo $name . ' said: ' . fread($stream); +}); +``` + +See also [example #11](examples). + +You can invoke [`removeReadStream()`](#removereadstream) to remove the +read event listener for this stream. + +The execution order of listeners when multiple streams become ready at +the same time is not guaranteed. + +Some event loop implementations are known to only trigger the listener if +the stream *becomes* readable (edge-triggered) and may not trigger if the +stream has already been readable from the beginning. +This also implies that a stream may not be recognized as readable when data +is still left in PHP's internal stream buffers. +As such, it's recommended to use `stream_set_read_buffer($stream, 0);` +to disable PHP's internal read buffer in this case. + +#### addWriteStream() + +> Advanced! Note that this low-level API is considered advanced usage. + Most use cases should probably use the higher-level + [writable Stream API](https://github.com/reactphp/stream#writablestreaminterface) + instead. + +The `addWriteStream(resource $stream, callable $callback): void` method can be used to +register a listener to be notified when a stream is ready to write. + +The first parameter MUST be a valid stream resource that supports +checking whether it is ready to write by this loop implementation. +A single stream resource MUST NOT be added more than once. +Instead, either call [`removeWriteStream()`](#removewritestream) first or +react to this event with a single listener and then dispatch from this +listener. This method MAY throw an `Exception` if the given resource type +is not supported by this loop implementation. + +The second parameter MUST be a listener callback function that accepts +the stream resource as its only parameter. +If you don't use the stream resource inside your listener callback function +you MAY use a function which has no parameters at all. + +The listener callback function MUST NOT throw an `Exception`. +The return value of the listener callback function will be ignored and has +no effect, so for performance reasons you're recommended to not return +any excessive data structures. + +If you want to access any variables within your callback function, you +can bind arbitrary data to a callback closure like this: + +```php +$loop->addWriteStream($stream, function ($stream) use ($name) { + fwrite($stream, 'Hello ' . $name); +}); +``` + +See also [example #12](examples). + +You can invoke [`removeWriteStream()`](#removewritestream) to remove the +write event listener for this stream. + +The execution order of listeners when multiple streams become ready at +the same time is not guaranteed. + +#### removeReadStream() + +The `removeReadStream(resource $stream): void` method can be used to +remove the read event listener for the given stream. + +Removing a stream from the loop that has already been removed or trying +to remove a stream that was never added or is invalid has no effect. + +#### removeWriteStream() + +The `removeWriteStream(resource $stream): void` method can be used to +remove the write event listener for the given stream. + +Removing a stream from the loop that has already been removed or trying +to remove a stream that was never added or is invalid has no effect. + +## Install + +The recommended way to install this library is [through Composer](https://getcomposer.org/). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) + +This project follows [SemVer](https://semver.org/). +This will install the latest supported version: + +```bash +composer require react/event-loop:^1.5 +``` + +See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. + +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.3 through current PHP 8+ and +HHVM. +It's *highly recommended to use the latest supported PHP version* for this project. + +Installing any of the event loop extensions is suggested, but entirely optional. +See also [event loop implementations](#loop-implementations) for more details. + +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org/): + +```bash +composer install +``` + +To run the test suite, go to the project root and run: + +```bash +vendor/bin/phpunit +``` + +## License + +MIT, see [LICENSE file](LICENSE). + +## More + +* See our [Stream component](https://github.com/reactphp/stream) for more + information on how streams are used in real-world applications. +* See our [users wiki](https://github.com/reactphp/react/wiki/Users) and the + [dependents on Packagist](https://packagist.org/packages/react/event-loop/dependents) + for a list of packages that use the EventLoop in real-world applications. diff --git a/tools/php-cs-fixer/vendor/react/event-loop/composer.json b/tools/php-cs-fixer/vendor/react/event-loop/composer.json new file mode 100644 index 00000000..25a41fe1 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/composer.json @@ -0,0 +1,47 @@ +{ + "name": "react/event-loop", + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": ["event-loop", "asynchronous"], + "license": "MIT", + "authors": [ + { + "name": "Christian Lück", + "homepage": "https://clue.engineering/", + "email": "christian@clue.engineering" + }, + { + "name": "Cees-Jan Kiewiet", + "homepage": "https://wyrihaximus.net/", + "email": "reactphp@ceesjankiewiet.nl" + }, + { + "name": "Jan Sorgalla", + "homepage": "https://sorgalla.com/", + "email": "jsorgalla@gmail.com" + }, + { + "name": "Chris Boden", + "homepage": "https://cboden.dev/", + "email": "cboden@gmail.com" + } + ], + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "React\\Tests\\EventLoop\\": "tests/" + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEvLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEvLoop.php new file mode 100644 index 00000000..a3fcec68 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEvLoop.php @@ -0,0 +1,253 @@ +loop = new EvLoop(); + $this->futureTickQueue = new FutureTickQueue(); + $this->timers = new SplObjectStorage(); + $this->signals = new SignalsHandler(); + } + + public function addReadStream($stream, $listener) + { + $key = (int)$stream; + + if (isset($this->readStreams[$key])) { + return; + } + + $callback = $this->getStreamListenerClosure($stream, $listener); + $event = $this->loop->io($stream, Ev::READ, $callback); + $this->readStreams[$key] = $event; + } + + /** + * @param resource $stream + * @param callable $listener + * + * @return \Closure + */ + private function getStreamListenerClosure($stream, $listener) + { + return function () use ($stream, $listener) { + \call_user_func($listener, $stream); + }; + } + + public function addWriteStream($stream, $listener) + { + $key = (int)$stream; + + if (isset($this->writeStreams[$key])) { + return; + } + + $callback = $this->getStreamListenerClosure($stream, $listener); + $event = $this->loop->io($stream, Ev::WRITE, $callback); + $this->writeStreams[$key] = $event; + } + + public function removeReadStream($stream) + { + $key = (int)$stream; + + if (!isset($this->readStreams[$key])) { + return; + } + + $this->readStreams[$key]->stop(); + unset($this->readStreams[$key]); + } + + public function removeWriteStream($stream) + { + $key = (int)$stream; + + if (!isset($this->writeStreams[$key])) { + return; + } + + $this->writeStreams[$key]->stop(); + unset($this->writeStreams[$key]); + } + + public function addTimer($interval, $callback) + { + $timer = new Timer($interval, $callback, false); + + $that = $this; + $timers = $this->timers; + $callback = function () use ($timer, $timers, $that) { + \call_user_func($timer->getCallback(), $timer); + + if ($timers->contains($timer)) { + $that->cancelTimer($timer); + } + }; + + $event = $this->loop->timer($timer->getInterval(), 0.0, $callback); + $this->timers->attach($timer, $event); + + return $timer; + } + + public function addPeriodicTimer($interval, $callback) + { + $timer = new Timer($interval, $callback, true); + + $callback = function () use ($timer) { + \call_user_func($timer->getCallback(), $timer); + }; + + $event = $this->loop->timer($timer->getInterval(), $timer->getInterval(), $callback); + $this->timers->attach($timer, $event); + + return $timer; + } + + public function cancelTimer(TimerInterface $timer) + { + if (!isset($this->timers[$timer])) { + return; + } + + $event = $this->timers[$timer]; + $event->stop(); + $this->timers->detach($timer); + } + + public function futureTick($listener) + { + $this->futureTickQueue->add($listener); + } + + public function run() + { + $this->running = true; + + while ($this->running) { + $this->futureTickQueue->tick(); + + $hasPendingCallbacks = !$this->futureTickQueue->isEmpty(); + $wasJustStopped = !$this->running; + $nothingLeftToDo = !$this->readStreams + && !$this->writeStreams + && !$this->timers->count() + && $this->signals->isEmpty(); + + $flags = Ev::RUN_ONCE; + if ($wasJustStopped || $hasPendingCallbacks) { + $flags |= Ev::RUN_NOWAIT; + } elseif ($nothingLeftToDo) { + break; + } + + $this->loop->run($flags); + } + } + + public function stop() + { + $this->running = false; + } + + public function __destruct() + { + /** @var TimerInterface $timer */ + foreach ($this->timers as $timer) { + $this->cancelTimer($timer); + } + + foreach ($this->readStreams as $key => $stream) { + $this->removeReadStream($key); + } + + foreach ($this->writeStreams as $key => $stream) { + $this->removeWriteStream($key); + } + } + + public function addSignal($signal, $listener) + { + $this->signals->add($signal, $listener); + + if (!isset($this->signalEvents[$signal])) { + $this->signalEvents[$signal] = $this->loop->signal($signal, function() use ($signal) { + $this->signals->call($signal); + }); + } + } + + public function removeSignal($signal, $listener) + { + $this->signals->remove($signal, $listener); + + if (isset($this->signalEvents[$signal])) { + $this->signalEvents[$signal]->stop(); + unset($this->signalEvents[$signal]); + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEventLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEventLoop.php new file mode 100644 index 00000000..b162a402 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEventLoop.php @@ -0,0 +1,275 @@ +requireFeatures(\EventConfig::FEATURE_FDS); + } + + $this->eventBase = new EventBase($config); + $this->futureTickQueue = new FutureTickQueue(); + $this->timerEvents = new SplObjectStorage(); + $this->signals = new SignalsHandler(); + + $this->createTimerCallback(); + $this->createStreamCallback(); + } + + public function __destruct() + { + // explicitly clear all references to Event objects to prevent SEGFAULTs on Windows + foreach ($this->timerEvents as $timer) { + $this->timerEvents->detach($timer); + } + + $this->readEvents = array(); + $this->writeEvents = array(); + } + + public function addReadStream($stream, $listener) + { + $key = (int) $stream; + if (isset($this->readListeners[$key])) { + return; + } + + $event = new Event($this->eventBase, $stream, Event::PERSIST | Event::READ, $this->streamCallback); + $event->add(); + $this->readEvents[$key] = $event; + $this->readListeners[$key] = $listener; + + // ext-event does not increase refcount on stream resources for PHP 7+ + // manually keep track of stream resource to prevent premature garbage collection + if (\PHP_VERSION_ID >= 70000) { + $this->readRefs[$key] = $stream; + } + } + + public function addWriteStream($stream, $listener) + { + $key = (int) $stream; + if (isset($this->writeListeners[$key])) { + return; + } + + $event = new Event($this->eventBase, $stream, Event::PERSIST | Event::WRITE, $this->streamCallback); + $event->add(); + $this->writeEvents[$key] = $event; + $this->writeListeners[$key] = $listener; + + // ext-event does not increase refcount on stream resources for PHP 7+ + // manually keep track of stream resource to prevent premature garbage collection + if (\PHP_VERSION_ID >= 70000) { + $this->writeRefs[$key] = $stream; + } + } + + public function removeReadStream($stream) + { + $key = (int) $stream; + + if (isset($this->readEvents[$key])) { + $this->readEvents[$key]->free(); + unset( + $this->readEvents[$key], + $this->readListeners[$key], + $this->readRefs[$key] + ); + } + } + + public function removeWriteStream($stream) + { + $key = (int) $stream; + + if (isset($this->writeEvents[$key])) { + $this->writeEvents[$key]->free(); + unset( + $this->writeEvents[$key], + $this->writeListeners[$key], + $this->writeRefs[$key] + ); + } + } + + public function addTimer($interval, $callback) + { + $timer = new Timer($interval, $callback, false); + + $this->scheduleTimer($timer); + + return $timer; + } + + public function addPeriodicTimer($interval, $callback) + { + $timer = new Timer($interval, $callback, true); + + $this->scheduleTimer($timer); + + return $timer; + } + + public function cancelTimer(TimerInterface $timer) + { + if ($this->timerEvents->contains($timer)) { + $this->timerEvents[$timer]->free(); + $this->timerEvents->detach($timer); + } + } + + public function futureTick($listener) + { + $this->futureTickQueue->add($listener); + } + + public function addSignal($signal, $listener) + { + $this->signals->add($signal, $listener); + + if (!isset($this->signalEvents[$signal])) { + $this->signalEvents[$signal] = Event::signal($this->eventBase, $signal, array($this->signals, 'call')); + $this->signalEvents[$signal]->add(); + } + } + + public function removeSignal($signal, $listener) + { + $this->signals->remove($signal, $listener); + + if (isset($this->signalEvents[$signal]) && $this->signals->count($signal) === 0) { + $this->signalEvents[$signal]->free(); + unset($this->signalEvents[$signal]); + } + } + + public function run() + { + $this->running = true; + + while ($this->running) { + $this->futureTickQueue->tick(); + + $flags = EventBase::LOOP_ONCE; + if (!$this->running || !$this->futureTickQueue->isEmpty()) { + $flags |= EventBase::LOOP_NONBLOCK; + } elseif (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { + break; + } + + $this->eventBase->loop($flags); + } + } + + public function stop() + { + $this->running = false; + } + + /** + * Schedule a timer for execution. + * + * @param TimerInterface $timer + */ + private function scheduleTimer(TimerInterface $timer) + { + $flags = Event::TIMEOUT; + + if ($timer->isPeriodic()) { + $flags |= Event::PERSIST; + } + + $event = new Event($this->eventBase, -1, $flags, $this->timerCallback, $timer); + $this->timerEvents[$timer] = $event; + + $event->add($timer->getInterval()); + } + + /** + * Create a callback used as the target of timer events. + * + * A reference is kept to the callback for the lifetime of the loop + * to prevent "Cannot destroy active lambda function" fatal error from + * the event extension. + */ + private function createTimerCallback() + { + $timers = $this->timerEvents; + $this->timerCallback = function ($_, $__, $timer) use ($timers) { + \call_user_func($timer->getCallback(), $timer); + + if (!$timer->isPeriodic() && $timers->contains($timer)) { + $this->cancelTimer($timer); + } + }; + } + + /** + * Create a callback used as the target of stream events. + * + * A reference is kept to the callback for the lifetime of the loop + * to prevent "Cannot destroy active lambda function" fatal error from + * the event extension. + */ + private function createStreamCallback() + { + $read =& $this->readListeners; + $write =& $this->writeListeners; + $this->streamCallback = function ($stream, $flags) use (&$read, &$write) { + $key = (int) $stream; + + if (Event::READ === (Event::READ & $flags) && isset($read[$key])) { + \call_user_func($read[$key], $stream); + } + + if (Event::WRITE === (Event::WRITE & $flags) && isset($write[$key])) { + \call_user_func($write[$key], $stream); + } + }; + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibevLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibevLoop.php new file mode 100644 index 00000000..c303fdd5 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibevLoop.php @@ -0,0 +1,201 @@ +loop = new EventLoop(); + $this->futureTickQueue = new FutureTickQueue(); + $this->timerEvents = new SplObjectStorage(); + $this->signals = new SignalsHandler(); + } + + public function addReadStream($stream, $listener) + { + if (isset($this->readEvents[(int) $stream])) { + return; + } + + $callback = function () use ($stream, $listener) { + \call_user_func($listener, $stream); + }; + + $event = new IOEvent($callback, $stream, IOEvent::READ); + $this->loop->add($event); + + $this->readEvents[(int) $stream] = $event; + } + + public function addWriteStream($stream, $listener) + { + if (isset($this->writeEvents[(int) $stream])) { + return; + } + + $callback = function () use ($stream, $listener) { + \call_user_func($listener, $stream); + }; + + $event = new IOEvent($callback, $stream, IOEvent::WRITE); + $this->loop->add($event); + + $this->writeEvents[(int) $stream] = $event; + } + + public function removeReadStream($stream) + { + $key = (int) $stream; + + if (isset($this->readEvents[$key])) { + $this->readEvents[$key]->stop(); + $this->loop->remove($this->readEvents[$key]); + unset($this->readEvents[$key]); + } + } + + public function removeWriteStream($stream) + { + $key = (int) $stream; + + if (isset($this->writeEvents[$key])) { + $this->writeEvents[$key]->stop(); + $this->loop->remove($this->writeEvents[$key]); + unset($this->writeEvents[$key]); + } + } + + public function addTimer($interval, $callback) + { + $timer = new Timer( $interval, $callback, false); + + $that = $this; + $timers = $this->timerEvents; + $callback = function () use ($timer, $timers, $that) { + \call_user_func($timer->getCallback(), $timer); + + if ($timers->contains($timer)) { + $that->cancelTimer($timer); + } + }; + + $event = new TimerEvent($callback, $timer->getInterval()); + $this->timerEvents->attach($timer, $event); + $this->loop->add($event); + + return $timer; + } + + public function addPeriodicTimer($interval, $callback) + { + $timer = new Timer($interval, $callback, true); + + $callback = function () use ($timer) { + \call_user_func($timer->getCallback(), $timer); + }; + + $event = new TimerEvent($callback, $timer->getInterval(), $timer->getInterval()); + $this->timerEvents->attach($timer, $event); + $this->loop->add($event); + + return $timer; + } + + public function cancelTimer(TimerInterface $timer) + { + if (isset($this->timerEvents[$timer])) { + $this->loop->remove($this->timerEvents[$timer]); + $this->timerEvents->detach($timer); + } + } + + public function futureTick($listener) + { + $this->futureTickQueue->add($listener); + } + + public function addSignal($signal, $listener) + { + $this->signals->add($signal, $listener); + + if (!isset($this->signalEvents[$signal])) { + $signals = $this->signals; + $this->signalEvents[$signal] = new SignalEvent(function () use ($signals, $signal) { + $signals->call($signal); + }, $signal); + $this->loop->add($this->signalEvents[$signal]); + } + } + + public function removeSignal($signal, $listener) + { + $this->signals->remove($signal, $listener); + + if (isset($this->signalEvents[$signal]) && $this->signals->count($signal) === 0) { + $this->signalEvents[$signal]->stop(); + $this->loop->remove($this->signalEvents[$signal]); + unset($this->signalEvents[$signal]); + } + } + + public function run() + { + $this->running = true; + + while ($this->running) { + $this->futureTickQueue->tick(); + + $flags = EventLoop::RUN_ONCE; + if (!$this->running || !$this->futureTickQueue->isEmpty()) { + $flags |= EventLoop::RUN_NOWAIT; + } elseif (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { + break; + } + + $this->loop->run($flags); + } + } + + public function stop() + { + $this->running = false; + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibeventLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibeventLoop.php new file mode 100644 index 00000000..099293a4 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibeventLoop.php @@ -0,0 +1,285 @@ +eventBase = \event_base_new(); + $this->futureTickQueue = new FutureTickQueue(); + $this->timerEvents = new SplObjectStorage(); + $this->signals = new SignalsHandler(); + + $this->createTimerCallback(); + $this->createStreamCallback(); + } + + public function addReadStream($stream, $listener) + { + $key = (int) $stream; + if (isset($this->readListeners[$key])) { + return; + } + + $event = \event_new(); + \event_set($event, $stream, \EV_PERSIST | \EV_READ, $this->streamCallback); + \event_base_set($event, $this->eventBase); + \event_add($event); + + $this->readEvents[$key] = $event; + $this->readListeners[$key] = $listener; + } + + public function addWriteStream($stream, $listener) + { + $key = (int) $stream; + if (isset($this->writeListeners[$key])) { + return; + } + + $event = \event_new(); + \event_set($event, $stream, \EV_PERSIST | \EV_WRITE, $this->streamCallback); + \event_base_set($event, $this->eventBase); + \event_add($event); + + $this->writeEvents[$key] = $event; + $this->writeListeners[$key] = $listener; + } + + public function removeReadStream($stream) + { + $key = (int) $stream; + + if (isset($this->readListeners[$key])) { + $event = $this->readEvents[$key]; + \event_del($event); + \event_free($event); + + unset( + $this->readEvents[$key], + $this->readListeners[$key] + ); + } + } + + public function removeWriteStream($stream) + { + $key = (int) $stream; + + if (isset($this->writeListeners[$key])) { + $event = $this->writeEvents[$key]; + \event_del($event); + \event_free($event); + + unset( + $this->writeEvents[$key], + $this->writeListeners[$key] + ); + } + } + + public function addTimer($interval, $callback) + { + $timer = new Timer($interval, $callback, false); + + $this->scheduleTimer($timer); + + return $timer; + } + + public function addPeriodicTimer($interval, $callback) + { + $timer = new Timer($interval, $callback, true); + + $this->scheduleTimer($timer); + + return $timer; + } + + public function cancelTimer(TimerInterface $timer) + { + if ($this->timerEvents->contains($timer)) { + $event = $this->timerEvents[$timer]; + \event_del($event); + \event_free($event); + + $this->timerEvents->detach($timer); + } + } + + public function futureTick($listener) + { + $this->futureTickQueue->add($listener); + } + + public function addSignal($signal, $listener) + { + $this->signals->add($signal, $listener); + + if (!isset($this->signalEvents[$signal])) { + $this->signalEvents[$signal] = \event_new(); + \event_set($this->signalEvents[$signal], $signal, \EV_PERSIST | \EV_SIGNAL, array($this->signals, 'call')); + \event_base_set($this->signalEvents[$signal], $this->eventBase); + \event_add($this->signalEvents[$signal]); + } + } + + public function removeSignal($signal, $listener) + { + $this->signals->remove($signal, $listener); + + if (isset($this->signalEvents[$signal]) && $this->signals->count($signal) === 0) { + \event_del($this->signalEvents[$signal]); + \event_free($this->signalEvents[$signal]); + unset($this->signalEvents[$signal]); + } + } + + public function run() + { + $this->running = true; + + while ($this->running) { + $this->futureTickQueue->tick(); + + $flags = \EVLOOP_ONCE; + if (!$this->running || !$this->futureTickQueue->isEmpty()) { + $flags |= \EVLOOP_NONBLOCK; + } elseif (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { + break; + } + + \event_base_loop($this->eventBase, $flags); + } + } + + public function stop() + { + $this->running = false; + } + + /** + * Schedule a timer for execution. + * + * @param TimerInterface $timer + */ + private function scheduleTimer(TimerInterface $timer) + { + $this->timerEvents[$timer] = $event = \event_timer_new(); + + \event_timer_set($event, $this->timerCallback, $timer); + \event_base_set($event, $this->eventBase); + \event_add($event, $timer->getInterval() * self::MICROSECONDS_PER_SECOND); + } + + /** + * Create a callback used as the target of timer events. + * + * A reference is kept to the callback for the lifetime of the loop + * to prevent "Cannot destroy active lambda function" fatal error from + * the event extension. + */ + private function createTimerCallback() + { + $that = $this; + $timers = $this->timerEvents; + $this->timerCallback = function ($_, $__, $timer) use ($timers, $that) { + \call_user_func($timer->getCallback(), $timer); + + // Timer already cancelled ... + if (!$timers->contains($timer)) { + return; + } + + // Reschedule periodic timers ... + if ($timer->isPeriodic()) { + \event_add( + $timers[$timer], + $timer->getInterval() * ExtLibeventLoop::MICROSECONDS_PER_SECOND + ); + + // Clean-up one shot timers ... + } else { + $that->cancelTimer($timer); + } + }; + } + + /** + * Create a callback used as the target of stream events. + * + * A reference is kept to the callback for the lifetime of the loop + * to prevent "Cannot destroy active lambda function" fatal error from + * the event extension. + */ + private function createStreamCallback() + { + $read =& $this->readListeners; + $write =& $this->writeListeners; + $this->streamCallback = function ($stream, $flags) use (&$read, &$write) { + $key = (int) $stream; + + if (\EV_READ === (\EV_READ & $flags) && isset($read[$key])) { + \call_user_func($read[$key], $stream); + } + + if (\EV_WRITE === (\EV_WRITE & $flags) && isset($write[$key])) { + \call_user_func($write[$key], $stream); + } + }; + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtUvLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtUvLoop.php new file mode 100644 index 00000000..4434720d --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtUvLoop.php @@ -0,0 +1,342 @@ +uv = \uv_loop_new(); + $this->futureTickQueue = new FutureTickQueue(); + $this->timers = new SplObjectStorage(); + $this->streamListener = $this->createStreamListener(); + $this->signals = new SignalsHandler(); + } + + /** + * Returns the underlying ext-uv event loop. (Internal ReactPHP use only.) + * + * @internal + * + * @return resource + */ + public function getUvLoop() + { + return $this->uv; + } + + /** + * {@inheritdoc} + */ + public function addReadStream($stream, $listener) + { + if (isset($this->readStreams[(int) $stream])) { + return; + } + + $this->readStreams[(int) $stream] = $listener; + $this->addStream($stream); + } + + /** + * {@inheritdoc} + */ + public function addWriteStream($stream, $listener) + { + if (isset($this->writeStreams[(int) $stream])) { + return; + } + + $this->writeStreams[(int) $stream] = $listener; + $this->addStream($stream); + } + + /** + * {@inheritdoc} + */ + public function removeReadStream($stream) + { + if (!isset($this->streamEvents[(int) $stream])) { + return; + } + + unset($this->readStreams[(int) $stream]); + $this->removeStream($stream); + } + + /** + * {@inheritdoc} + */ + public function removeWriteStream($stream) + { + if (!isset($this->streamEvents[(int) $stream])) { + return; + } + + unset($this->writeStreams[(int) $stream]); + $this->removeStream($stream); + } + + /** + * {@inheritdoc} + */ + public function addTimer($interval, $callback) + { + $timer = new Timer($interval, $callback, false); + + $that = $this; + $timers = $this->timers; + $callback = function () use ($timer, $timers, $that) { + \call_user_func($timer->getCallback(), $timer); + + if ($timers->contains($timer)) { + $that->cancelTimer($timer); + } + }; + + $event = \uv_timer_init($this->uv); + $this->timers->attach($timer, $event); + \uv_timer_start( + $event, + $this->convertFloatSecondsToMilliseconds($interval), + 0, + $callback + ); + + return $timer; + } + + /** + * {@inheritdoc} + */ + public function addPeriodicTimer($interval, $callback) + { + $timer = new Timer($interval, $callback, true); + + $callback = function () use ($timer) { + \call_user_func($timer->getCallback(), $timer); + }; + + $interval = $this->convertFloatSecondsToMilliseconds($interval); + $event = \uv_timer_init($this->uv); + $this->timers->attach($timer, $event); + \uv_timer_start( + $event, + $interval, + (int) $interval === 0 ? 1 : $interval, + $callback + ); + + return $timer; + } + + /** + * {@inheritdoc} + */ + public function cancelTimer(TimerInterface $timer) + { + if (isset($this->timers[$timer])) { + @\uv_timer_stop($this->timers[$timer]); + $this->timers->detach($timer); + } + } + + /** + * {@inheritdoc} + */ + public function futureTick($listener) + { + $this->futureTickQueue->add($listener); + } + + public function addSignal($signal, $listener) + { + $this->signals->add($signal, $listener); + + if (!isset($this->signalEvents[$signal])) { + $signals = $this->signals; + $this->signalEvents[$signal] = \uv_signal_init($this->uv); + \uv_signal_start($this->signalEvents[$signal], function () use ($signals, $signal) { + $signals->call($signal); + }, $signal); + } + } + + public function removeSignal($signal, $listener) + { + $this->signals->remove($signal, $listener); + + if (isset($this->signalEvents[$signal]) && $this->signals->count($signal) === 0) { + \uv_signal_stop($this->signalEvents[$signal]); + unset($this->signalEvents[$signal]); + } + } + + /** + * {@inheritdoc} + */ + public function run() + { + $this->running = true; + + while ($this->running) { + $this->futureTickQueue->tick(); + + $hasPendingCallbacks = !$this->futureTickQueue->isEmpty(); + $wasJustStopped = !$this->running; + $nothingLeftToDo = !$this->readStreams + && !$this->writeStreams + && !$this->timers->count() + && $this->signals->isEmpty(); + + // Use UV::RUN_ONCE when there are only I/O events active in the loop and block until one of those triggers, + // otherwise use UV::RUN_NOWAIT. + // @link http://docs.libuv.org/en/v1.x/loop.html#c.uv_run + $flags = \UV::RUN_ONCE; + if ($wasJustStopped || $hasPendingCallbacks) { + $flags = \UV::RUN_NOWAIT; + } elseif ($nothingLeftToDo) { + break; + } + + \uv_run($this->uv, $flags); + } + } + + /** + * {@inheritdoc} + */ + public function stop() + { + $this->running = false; + } + + private function addStream($stream) + { + if (!isset($this->streamEvents[(int) $stream])) { + $this->streamEvents[(int)$stream] = \uv_poll_init_socket($this->uv, $stream); + } + + if ($this->streamEvents[(int) $stream] !== false) { + $this->pollStream($stream); + } + } + + private function removeStream($stream) + { + if (!isset($this->streamEvents[(int) $stream])) { + return; + } + + if (!isset($this->readStreams[(int) $stream]) + && !isset($this->writeStreams[(int) $stream])) { + \uv_poll_stop($this->streamEvents[(int) $stream]); + \uv_close($this->streamEvents[(int) $stream]); + unset($this->streamEvents[(int) $stream]); + return; + } + + $this->pollStream($stream); + } + + private function pollStream($stream) + { + if (!isset($this->streamEvents[(int) $stream])) { + return; + } + + $flags = 0; + if (isset($this->readStreams[(int) $stream])) { + $flags |= \UV::READABLE; + } + + if (isset($this->writeStreams[(int) $stream])) { + $flags |= \UV::WRITABLE; + } + + \uv_poll_start($this->streamEvents[(int) $stream], $flags, $this->streamListener); + } + + /** + * Create a stream listener + * + * @return callable Returns a callback + */ + private function createStreamListener() + { + $callback = function ($event, $status, $events, $stream) { + // libuv automatically stops polling on error, re-enable polling to match other loop implementations + if ($status !== 0) { + $this->pollStream($stream); + + // libuv may report no events on error, but this should still invoke stream listeners to report closed connections + // re-enable both readable and writable, correct listeners will be checked below anyway + if ($events === 0) { + $events = \UV::READABLE | \UV::WRITABLE; + } + } + + if (isset($this->readStreams[(int) $stream]) && ($events & \UV::READABLE)) { + \call_user_func($this->readStreams[(int) $stream], $stream); + } + + if (isset($this->writeStreams[(int) $stream]) && ($events & \UV::WRITABLE)) { + \call_user_func($this->writeStreams[(int) $stream], $stream); + } + }; + + return $callback; + } + + /** + * @param float $interval + * @return int + */ + private function convertFloatSecondsToMilliseconds($interval) + { + if ($interval < 0) { + return 0; + } + + $maxValue = (int) (\PHP_INT_MAX / 1000); + $intInterval = (int) $interval; + + if (($intInterval <= 0 && $interval > 1) || $intInterval >= $maxValue) { + throw new \InvalidArgumentException( + "Interval overflow, value must be lower than '{$maxValue}', but '{$interval}' passed." + ); + } + + return (int) \floor($interval * 1000); + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/Factory.php b/tools/php-cs-fixer/vendor/react/event-loop/src/Factory.php new file mode 100644 index 00000000..30bbfd7c --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/Factory.php @@ -0,0 +1,75 @@ +futureTick(function () use (&$hasRun) { + $hasRun = true; + }); + + $stopped =& self::$stopped; + register_shutdown_function(function () use ($loop, &$hasRun, &$stopped) { + // Don't run if we're coming from a fatal error (uncaught exception). + $error = error_get_last(); + if ((isset($error['type']) ? $error['type'] : 0) & (E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR)) { + return; + } + + if (!$hasRun && !$stopped) { + $loop->run(); + } + }); + // @codeCoverageIgnoreEnd + + return self::$instance; + } + + /** + * Internal undocumented method, behavior might change or throw in the + * future. Use with caution and at your own risk. + * + * @internal + * @return void + */ + public static function set(LoopInterface $loop) + { + self::$instance = $loop; + } + + /** + * [Advanced] Register a listener to be notified when a stream is ready to read. + * + * @param resource $stream + * @param callable $listener + * @return void + * @throws \Exception + * @see LoopInterface::addReadStream() + */ + public static function addReadStream($stream, $listener) + { + // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) + if (self::$instance === null) { + self::get(); + } + self::$instance->addReadStream($stream, $listener); + } + + /** + * [Advanced] Register a listener to be notified when a stream is ready to write. + * + * @param resource $stream + * @param callable $listener + * @return void + * @throws \Exception + * @see LoopInterface::addWriteStream() + */ + public static function addWriteStream($stream, $listener) + { + // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) + if (self::$instance === null) { + self::get(); + } + self::$instance->addWriteStream($stream, $listener); + } + + /** + * Remove the read event listener for the given stream. + * + * @param resource $stream + * @return void + * @see LoopInterface::removeReadStream() + */ + public static function removeReadStream($stream) + { + if (self::$instance !== null) { + self::$instance->removeReadStream($stream); + } + } + + /** + * Remove the write event listener for the given stream. + * + * @param resource $stream + * @return void + * @see LoopInterface::removeWriteStream() + */ + public static function removeWriteStream($stream) + { + if (self::$instance !== null) { + self::$instance->removeWriteStream($stream); + } + } + + /** + * Enqueue a callback to be invoked once after the given interval. + * + * @param float $interval + * @param callable $callback + * @return TimerInterface + * @see LoopInterface::addTimer() + */ + public static function addTimer($interval, $callback) + { + // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) + if (self::$instance === null) { + self::get(); + } + return self::$instance->addTimer($interval, $callback); + } + + /** + * Enqueue a callback to be invoked repeatedly after the given interval. + * + * @param float $interval + * @param callable $callback + * @return TimerInterface + * @see LoopInterface::addPeriodicTimer() + */ + public static function addPeriodicTimer($interval, $callback) + { + // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) + if (self::$instance === null) { + self::get(); + } + return self::$instance->addPeriodicTimer($interval, $callback); + } + + /** + * Cancel a pending timer. + * + * @param TimerInterface $timer + * @return void + * @see LoopInterface::cancelTimer() + */ + public static function cancelTimer(TimerInterface $timer) + { + if (self::$instance !== null) { + self::$instance->cancelTimer($timer); + } + } + + /** + * Schedule a callback to be invoked on a future tick of the event loop. + * + * @param callable $listener + * @return void + * @see LoopInterface::futureTick() + */ + public static function futureTick($listener) + { + // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) + if (self::$instance === null) { + self::get(); + } + + self::$instance->futureTick($listener); + } + + /** + * Register a listener to be notified when a signal has been caught by this process. + * + * @param int $signal + * @param callable $listener + * @return void + * @see LoopInterface::addSignal() + */ + public static function addSignal($signal, $listener) + { + // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) + if (self::$instance === null) { + self::get(); + } + + self::$instance->addSignal($signal, $listener); + } + + /** + * Removes a previously added signal listener. + * + * @param int $signal + * @param callable $listener + * @return void + * @see LoopInterface::removeSignal() + */ + public static function removeSignal($signal, $listener) + { + if (self::$instance !== null) { + self::$instance->removeSignal($signal, $listener); + } + } + + /** + * Run the event loop until there are no more tasks to perform. + * + * @return void + * @see LoopInterface::run() + */ + public static function run() + { + // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) + if (self::$instance === null) { + self::get(); + } + + self::$instance->run(); + } + + /** + * Instruct a running event loop to stop. + * + * @return void + * @see LoopInterface::stop() + */ + public static function stop() + { + self::$stopped = true; + if (self::$instance !== null) { + self::$instance->stop(); + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/LoopInterface.php b/tools/php-cs-fixer/vendor/react/event-loop/src/LoopInterface.php new file mode 100644 index 00000000..9266f718 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/LoopInterface.php @@ -0,0 +1,472 @@ +addReadStream($stream, function ($stream) use ($name) { + * echo $name . ' said: ' . fread($stream); + * }); + * ``` + * + * See also [example #11](examples). + * + * You can invoke [`removeReadStream()`](#removereadstream) to remove the + * read event listener for this stream. + * + * The execution order of listeners when multiple streams become ready at + * the same time is not guaranteed. + * + * @param resource $stream The PHP stream resource to check. + * @param callable $listener Invoked when the stream is ready. + * @throws \Exception if the given resource type is not supported by this loop implementation + * @see self::removeReadStream() + */ + public function addReadStream($stream, $listener); + + /** + * [Advanced] Register a listener to be notified when a stream is ready to write. + * + * Note that this low-level API is considered advanced usage. + * Most use cases should probably use the higher-level + * [writable Stream API](https://github.com/reactphp/stream#writablestreaminterface) + * instead. + * + * The first parameter MUST be a valid stream resource that supports + * checking whether it is ready to write by this loop implementation. + * A single stream resource MUST NOT be added more than once. + * Instead, either call [`removeWriteStream()`](#removewritestream) first or + * react to this event with a single listener and then dispatch from this + * listener. This method MAY throw an `Exception` if the given resource type + * is not supported by this loop implementation. + * + * The second parameter MUST be a listener callback function that accepts + * the stream resource as its only parameter. + * If you don't use the stream resource inside your listener callback function + * you MAY use a function which has no parameters at all. + * + * The listener callback function MUST NOT throw an `Exception`. + * The return value of the listener callback function will be ignored and has + * no effect, so for performance reasons you're recommended to not return + * any excessive data structures. + * + * If you want to access any variables within your callback function, you + * can bind arbitrary data to a callback closure like this: + * + * ```php + * $loop->addWriteStream($stream, function ($stream) use ($name) { + * fwrite($stream, 'Hello ' . $name); + * }); + * ``` + * + * See also [example #12](examples). + * + * You can invoke [`removeWriteStream()`](#removewritestream) to remove the + * write event listener for this stream. + * + * The execution order of listeners when multiple streams become ready at + * the same time is not guaranteed. + * + * Some event loop implementations are known to only trigger the listener if + * the stream *becomes* readable (edge-triggered) and may not trigger if the + * stream has already been readable from the beginning. + * This also implies that a stream may not be recognized as readable when data + * is still left in PHP's internal stream buffers. + * As such, it's recommended to use `stream_set_read_buffer($stream, 0);` + * to disable PHP's internal read buffer in this case. + * + * @param resource $stream The PHP stream resource to check. + * @param callable $listener Invoked when the stream is ready. + * @throws \Exception if the given resource type is not supported by this loop implementation + * @see self::removeWriteStream() + */ + public function addWriteStream($stream, $listener); + + /** + * Remove the read event listener for the given stream. + * + * Removing a stream from the loop that has already been removed or trying + * to remove a stream that was never added or is invalid has no effect. + * + * @param resource $stream The PHP stream resource. + */ + public function removeReadStream($stream); + + /** + * Remove the write event listener for the given stream. + * + * Removing a stream from the loop that has already been removed or trying + * to remove a stream that was never added or is invalid has no effect. + * + * @param resource $stream The PHP stream resource. + */ + public function removeWriteStream($stream); + + /** + * Enqueue a callback to be invoked once after the given interval. + * + * The second parameter MUST be a timer callback function that accepts + * the timer instance as its only parameter. + * If you don't use the timer instance inside your timer callback function + * you MAY use a function which has no parameters at all. + * + * The timer callback function MUST NOT throw an `Exception`. + * The return value of the timer callback function will be ignored and has + * no effect, so for performance reasons you're recommended to not return + * any excessive data structures. + * + * This method returns a timer instance. The same timer instance will also be + * passed into the timer callback function as described above. + * You can invoke [`cancelTimer`](#canceltimer) to cancel a pending timer. + * Unlike [`addPeriodicTimer()`](#addperiodictimer), this method will ensure + * the callback will be invoked only once after the given interval. + * + * ```php + * $loop->addTimer(0.8, function () { + * echo 'world!' . PHP_EOL; + * }); + * + * $loop->addTimer(0.3, function () { + * echo 'hello '; + * }); + * ``` + * + * See also [example #1](examples). + * + * If you want to access any variables within your callback function, you + * can bind arbitrary data to a callback closure like this: + * + * ```php + * function hello($name, LoopInterface $loop) + * { + * $loop->addTimer(1.0, function () use ($name) { + * echo "hello $name\n"; + * }); + * } + * + * hello('Tester', $loop); + * ``` + * + * This interface does not enforce any particular timer resolution, so + * special care may have to be taken if you rely on very high precision with + * millisecond accuracy or below. Event loop implementations SHOULD work on + * a best effort basis and SHOULD provide at least millisecond accuracy + * unless otherwise noted. Many existing event loop implementations are + * known to provide microsecond accuracy, but it's generally not recommended + * to rely on this high precision. + * + * Similarly, the execution order of timers scheduled to execute at the + * same time (within its possible accuracy) is not guaranteed. + * + * This interface suggests that event loop implementations SHOULD use a + * monotonic time source if available. Given that a monotonic time source is + * only available as of PHP 7.3 by default, event loop implementations MAY + * fall back to using wall-clock time. + * While this does not affect many common use cases, this is an important + * distinction for programs that rely on a high time precision or on systems + * that are subject to discontinuous time adjustments (time jumps). + * This means that if you schedule a timer to trigger in 30s and then adjust + * your system time forward by 20s, the timer SHOULD still trigger in 30s. + * See also [event loop implementations](#loop-implementations) for more details. + * + * @param int|float $interval The number of seconds to wait before execution. + * @param callable $callback The callback to invoke. + * + * @return TimerInterface + */ + public function addTimer($interval, $callback); + + /** + * Enqueue a callback to be invoked repeatedly after the given interval. + * + * The second parameter MUST be a timer callback function that accepts + * the timer instance as its only parameter. + * If you don't use the timer instance inside your timer callback function + * you MAY use a function which has no parameters at all. + * + * The timer callback function MUST NOT throw an `Exception`. + * The return value of the timer callback function will be ignored and has + * no effect, so for performance reasons you're recommended to not return + * any excessive data structures. + * + * This method returns a timer instance. The same timer instance will also be + * passed into the timer callback function as described above. + * Unlike [`addTimer()`](#addtimer), this method will ensure the callback + * will be invoked infinitely after the given interval or until you invoke + * [`cancelTimer`](#canceltimer). + * + * ```php + * $timer = $loop->addPeriodicTimer(0.1, function () { + * echo 'tick!' . PHP_EOL; + * }); + * + * $loop->addTimer(1.0, function () use ($loop, $timer) { + * $loop->cancelTimer($timer); + * echo 'Done' . PHP_EOL; + * }); + * ``` + * + * See also [example #2](examples). + * + * If you want to limit the number of executions, you can bind + * arbitrary data to a callback closure like this: + * + * ```php + * function hello($name, LoopInterface $loop) + * { + * $n = 3; + * $loop->addPeriodicTimer(1.0, function ($timer) use ($name, $loop, &$n) { + * if ($n > 0) { + * --$n; + * echo "hello $name\n"; + * } else { + * $loop->cancelTimer($timer); + * } + * }); + * } + * + * hello('Tester', $loop); + * ``` + * + * This interface does not enforce any particular timer resolution, so + * special care may have to be taken if you rely on very high precision with + * millisecond accuracy or below. Event loop implementations SHOULD work on + * a best effort basis and SHOULD provide at least millisecond accuracy + * unless otherwise noted. Many existing event loop implementations are + * known to provide microsecond accuracy, but it's generally not recommended + * to rely on this high precision. + * + * Similarly, the execution order of timers scheduled to execute at the + * same time (within its possible accuracy) is not guaranteed. + * + * This interface suggests that event loop implementations SHOULD use a + * monotonic time source if available. Given that a monotonic time source is + * only available as of PHP 7.3 by default, event loop implementations MAY + * fall back to using wall-clock time. + * While this does not affect many common use cases, this is an important + * distinction for programs that rely on a high time precision or on systems + * that are subject to discontinuous time adjustments (time jumps). + * This means that if you schedule a timer to trigger in 30s and then adjust + * your system time forward by 20s, the timer SHOULD still trigger in 30s. + * See also [event loop implementations](#loop-implementations) for more details. + * + * Additionally, periodic timers may be subject to timer drift due to + * re-scheduling after each invocation. As such, it's generally not + * recommended to rely on this for high precision intervals with millisecond + * accuracy or below. + * + * @param int|float $interval The number of seconds to wait before execution. + * @param callable $callback The callback to invoke. + * + * @return TimerInterface + */ + public function addPeriodicTimer($interval, $callback); + + /** + * Cancel a pending timer. + * + * See also [`addPeriodicTimer()`](#addperiodictimer) and [example #2](examples). + * + * Calling this method on a timer instance that has not been added to this + * loop instance or on a timer that has already been cancelled has no effect. + * + * @param TimerInterface $timer The timer to cancel. + * + * @return void + */ + public function cancelTimer(TimerInterface $timer); + + /** + * Schedule a callback to be invoked on a future tick of the event loop. + * + * This works very much similar to timers with an interval of zero seconds, + * but does not require the overhead of scheduling a timer queue. + * + * The tick callback function MUST be able to accept zero parameters. + * + * The tick callback function MUST NOT throw an `Exception`. + * The return value of the tick callback function will be ignored and has + * no effect, so for performance reasons you're recommended to not return + * any excessive data structures. + * + * If you want to access any variables within your callback function, you + * can bind arbitrary data to a callback closure like this: + * + * ```php + * function hello($name, LoopInterface $loop) + * { + * $loop->futureTick(function () use ($name) { + * echo "hello $name\n"; + * }); + * } + * + * hello('Tester', $loop); + * ``` + * + * Unlike timers, tick callbacks are guaranteed to be executed in the order + * they are enqueued. + * Also, once a callback is enqueued, there's no way to cancel this operation. + * + * This is often used to break down bigger tasks into smaller steps (a form + * of cooperative multitasking). + * + * ```php + * $loop->futureTick(function () { + * echo 'b'; + * }); + * $loop->futureTick(function () { + * echo 'c'; + * }); + * echo 'a'; + * ``` + * + * See also [example #3](examples). + * + * @param callable $listener The callback to invoke. + * + * @return void + */ + public function futureTick($listener); + + /** + * Register a listener to be notified when a signal has been caught by this process. + * + * This is useful to catch user interrupt signals or shutdown signals from + * tools like `supervisor` or `systemd`. + * + * The second parameter MUST be a listener callback function that accepts + * the signal as its only parameter. + * If you don't use the signal inside your listener callback function + * you MAY use a function which has no parameters at all. + * + * The listener callback function MUST NOT throw an `Exception`. + * The return value of the listener callback function will be ignored and has + * no effect, so for performance reasons you're recommended to not return + * any excessive data structures. + * + * ```php + * $loop->addSignal(SIGINT, function (int $signal) { + * echo 'Caught user interrupt signal' . PHP_EOL; + * }); + * ``` + * + * See also [example #4](examples). + * + * Signaling is only available on Unix-like platforms, Windows isn't + * supported due to operating system limitations. + * This method may throw a `BadMethodCallException` if signals aren't + * supported on this platform, for example when required extensions are + * missing. + * + * **Note: A listener can only be added once to the same signal, any + * attempts to add it more than once will be ignored.** + * + * @param int $signal + * @param callable $listener + * + * @throws \BadMethodCallException when signals aren't supported on this + * platform, for example when required extensions are missing. + * + * @return void + */ + public function addSignal($signal, $listener); + + /** + * Removes a previously added signal listener. + * + * ```php + * $loop->removeSignal(SIGINT, $listener); + * ``` + * + * Any attempts to remove listeners that aren't registered will be ignored. + * + * @param int $signal + * @param callable $listener + * + * @return void + */ + public function removeSignal($signal, $listener); + + /** + * Run the event loop until there are no more tasks to perform. + * + * For many applications, this method is the only directly visible + * invocation on the event loop. + * As a rule of thumb, it is usually recommended to attach everything to the + * same loop instance and then run the loop once at the bottom end of the + * application. + * + * ```php + * $loop->run(); + * ``` + * + * This method will keep the loop running until there are no more tasks + * to perform. In other words: This method will block until the last + * timer, stream and/or signal has been removed. + * + * Likewise, it is imperative to ensure the application actually invokes + * this method once. Adding listeners to the loop and missing to actually + * run it will result in the application exiting without actually waiting + * for any of the attached listeners. + * + * This method MUST NOT be called while the loop is already running. + * This method MAY be called more than once after it has explicitly been + * [`stop()`ped](#stop) or after it automatically stopped because it + * previously did no longer have anything to do. + * + * @return void + */ + public function run(); + + /** + * Instruct a running event loop to stop. + * + * This method is considered advanced usage and should be used with care. + * As a rule of thumb, it is usually recommended to let the loop stop + * only automatically when it no longer has anything to do. + * + * This method can be used to explicitly instruct the event loop to stop: + * + * ```php + * $loop->addTimer(3.0, function () use ($loop) { + * $loop->stop(); + * }); + * ``` + * + * Calling this method on a loop instance that is not currently running or + * on a loop instance that has already been stopped has no effect. + * + * @return void + */ + public function stop(); +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/SignalsHandler.php b/tools/php-cs-fixer/vendor/react/event-loop/src/SignalsHandler.php new file mode 100644 index 00000000..10d125df --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/SignalsHandler.php @@ -0,0 +1,63 @@ +signals[$signal])) { + $this->signals[$signal] = array(); + } + + if (\in_array($listener, $this->signals[$signal])) { + return; + } + + $this->signals[$signal][] = $listener; + } + + public function remove($signal, $listener) + { + if (!isset($this->signals[$signal])) { + return; + } + + $index = \array_search($listener, $this->signals[$signal], true); + unset($this->signals[$signal][$index]); + + if (isset($this->signals[$signal]) && \count($this->signals[$signal]) === 0) { + unset($this->signals[$signal]); + } + } + + public function call($signal) + { + if (!isset($this->signals[$signal])) { + return; + } + + foreach ($this->signals[$signal] as $listener) { + \call_user_func($listener, $signal); + } + } + + public function count($signal) + { + if (!isset($this->signals[$signal])) { + return 0; + } + + return \count($this->signals[$signal]); + } + + public function isEmpty() + { + return !$this->signals; + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/StreamSelectLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/StreamSelectLoop.php new file mode 100644 index 00000000..1686fd74 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/StreamSelectLoop.php @@ -0,0 +1,330 @@ +futureTickQueue = new FutureTickQueue(); + $this->timers = new Timers(); + $this->pcntl = \function_exists('pcntl_signal') && \function_exists('pcntl_signal_dispatch'); + $this->pcntlPoll = $this->pcntl && !\function_exists('pcntl_async_signals'); + $this->signals = new SignalsHandler(); + + // prefer async signals if available (PHP 7.1+) or fall back to dispatching on each tick + if ($this->pcntl && !$this->pcntlPoll) { + \pcntl_async_signals(true); + } + } + + public function addReadStream($stream, $listener) + { + $key = (int) $stream; + + if (!isset($this->readStreams[$key])) { + $this->readStreams[$key] = $stream; + $this->readListeners[$key] = $listener; + } + } + + public function addWriteStream($stream, $listener) + { + $key = (int) $stream; + + if (!isset($this->writeStreams[$key])) { + $this->writeStreams[$key] = $stream; + $this->writeListeners[$key] = $listener; + } + } + + public function removeReadStream($stream) + { + $key = (int) $stream; + + unset( + $this->readStreams[$key], + $this->readListeners[$key] + ); + } + + public function removeWriteStream($stream) + { + $key = (int) $stream; + + unset( + $this->writeStreams[$key], + $this->writeListeners[$key] + ); + } + + public function addTimer($interval, $callback) + { + $timer = new Timer($interval, $callback, false); + + $this->timers->add($timer); + + return $timer; + } + + public function addPeriodicTimer($interval, $callback) + { + $timer = new Timer($interval, $callback, true); + + $this->timers->add($timer); + + return $timer; + } + + public function cancelTimer(TimerInterface $timer) + { + $this->timers->cancel($timer); + } + + public function futureTick($listener) + { + $this->futureTickQueue->add($listener); + } + + public function addSignal($signal, $listener) + { + if ($this->pcntl === false) { + throw new \BadMethodCallException('Event loop feature "signals" isn\'t supported by the "StreamSelectLoop"'); + } + + $first = $this->signals->count($signal) === 0; + $this->signals->add($signal, $listener); + + if ($first) { + \pcntl_signal($signal, array($this->signals, 'call')); + } + } + + public function removeSignal($signal, $listener) + { + if (!$this->signals->count($signal)) { + return; + } + + $this->signals->remove($signal, $listener); + + if ($this->signals->count($signal) === 0) { + \pcntl_signal($signal, \SIG_DFL); + } + } + + public function run() + { + $this->running = true; + + while ($this->running) { + $this->futureTickQueue->tick(); + + $this->timers->tick(); + + // Future-tick queue has pending callbacks ... + if (!$this->running || !$this->futureTickQueue->isEmpty()) { + $timeout = 0; + + // There is a pending timer, only block until it is due ... + } elseif ($scheduledAt = $this->timers->getFirst()) { + $timeout = $scheduledAt - $this->timers->getTime(); + if ($timeout < 0) { + $timeout = 0; + } else { + // Convert float seconds to int microseconds. + // Ensure we do not exceed maximum integer size, which may + // cause the loop to tick once every ~35min on 32bit systems. + $timeout *= self::MICROSECONDS_PER_SECOND; + $timeout = $timeout > \PHP_INT_MAX ? \PHP_INT_MAX : (int)$timeout; + } + + // The only possible event is stream or signal activity, so wait forever ... + } elseif ($this->readStreams || $this->writeStreams || !$this->signals->isEmpty()) { + $timeout = null; + + // There's nothing left to do ... + } else { + break; + } + + $this->waitForStreamActivity($timeout); + } + } + + public function stop() + { + $this->running = false; + } + + /** + * Wait/check for stream activity, or until the next timer is due. + * + * @param integer|null $timeout Activity timeout in microseconds, or null to wait forever. + */ + private function waitForStreamActivity($timeout) + { + $read = $this->readStreams; + $write = $this->writeStreams; + + $available = $this->streamSelect($read, $write, $timeout); + if ($this->pcntlPoll) { + \pcntl_signal_dispatch(); + } + if (false === $available) { + // if a system call has been interrupted, + // we cannot rely on it's outcome + return; + } + + foreach ($read as $stream) { + $key = (int) $stream; + + if (isset($this->readListeners[$key])) { + \call_user_func($this->readListeners[$key], $stream); + } + } + + foreach ($write as $stream) { + $key = (int) $stream; + + if (isset($this->writeListeners[$key])) { + \call_user_func($this->writeListeners[$key], $stream); + } + } + } + + /** + * Emulate a stream_select() implementation that does not break when passed + * empty stream arrays. + * + * @param array $read An array of read streams to select upon. + * @param array $write An array of write streams to select upon. + * @param int|null $timeout Activity timeout in microseconds, or null to wait forever. + * + * @return int|false The total number of streams that are ready for read/write. + * Can return false if stream_select() is interrupted by a signal. + */ + private function streamSelect(array &$read, array &$write, $timeout) + { + if ($read || $write) { + // We do not usually use or expose the `exceptfds` parameter passed to the underlying `select`. + // However, Windows does not report failed connection attempts in `writefds` passed to `select` like most other platforms. + // Instead, it uses `writefds` only for successful connection attempts and `exceptfds` for failed connection attempts. + // We work around this by adding all sockets that look like a pending connection attempt to `exceptfds` automatically on Windows and merge it back later. + // This ensures the public API matches other loop implementations across all platforms (see also test suite or rather test matrix). + // Lacking better APIs, every write-only socket that has not yet read any data is assumed to be in a pending connection attempt state. + // @link https://docs.microsoft.com/de-de/windows/win32/api/winsock2/nf-winsock2-select + $except = null; + if (\DIRECTORY_SEPARATOR === '\\') { + $except = array(); + foreach ($write as $key => $socket) { + if (!isset($read[$key]) && @\ftell($socket) === 0) { + $except[$key] = $socket; + } + } + } + + /** @var ?callable $previous */ + $previous = \set_error_handler(function ($errno, $errstr) use (&$previous) { + // suppress warnings that occur when `stream_select()` is interrupted by a signal + // PHP defines `EINTR` through `ext-sockets` or `ext-pcntl`, otherwise use common default (Linux & Mac) + $eintr = \defined('SOCKET_EINTR') ? \SOCKET_EINTR : (\defined('PCNTL_EINTR') ? \PCNTL_EINTR : 4); + if ($errno === \E_WARNING && \strpos($errstr, '[' . $eintr .']: ') !== false) { + return; + } + + // forward any other error to registered error handler or print warning + return ($previous !== null) ? \call_user_func_array($previous, \func_get_args()) : false; + }); + + try { + $ret = \stream_select($read, $write, $except, $timeout === null ? null : 0, $timeout); + \restore_error_handler(); + } catch (\Throwable $e) { // @codeCoverageIgnoreStart + \restore_error_handler(); + throw $e; + } catch (\Exception $e) { + \restore_error_handler(); + throw $e; + } // @codeCoverageIgnoreEnd + + if ($except) { + $write = \array_merge($write, $except); + } + return $ret; + } + + if ($timeout > 0) { + \usleep($timeout); + } elseif ($timeout === null) { + // wait forever (we only reach this if we're only awaiting signals) + // this may be interrupted and return earlier when a signal is received + \sleep(PHP_INT_MAX); + } + + return 0; + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/Tick/FutureTickQueue.php b/tools/php-cs-fixer/vendor/react/event-loop/src/Tick/FutureTickQueue.php new file mode 100644 index 00000000..efabcbc5 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/Tick/FutureTickQueue.php @@ -0,0 +1,60 @@ +queue = new SplQueue(); + } + + /** + * Add a callback to be invoked on a future tick of the event loop. + * + * Callbacks are guaranteed to be executed in the order they are enqueued. + * + * @param callable $listener The callback to invoke. + */ + public function add($listener) + { + $this->queue->enqueue($listener); + } + + /** + * Flush the callback queue. + */ + public function tick() + { + // Only invoke as many callbacks as were on the queue when tick() was called. + $count = $this->queue->count(); + + while ($count--) { + \call_user_func( + $this->queue->dequeue() + ); + } + } + + /** + * Check if the next tick queue is empty. + * + * @return boolean + */ + public function isEmpty() + { + return $this->queue->isEmpty(); + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timer.php b/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timer.php new file mode 100644 index 00000000..da3602a3 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timer.php @@ -0,0 +1,55 @@ +interval = (float) $interval; + $this->callback = $callback; + $this->periodic = (bool) $periodic; + } + + public function getInterval() + { + return $this->interval; + } + + public function getCallback() + { + return $this->callback; + } + + public function isPeriodic() + { + return $this->periodic; + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timers.php b/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timers.php new file mode 100644 index 00000000..53c46d03 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timers.php @@ -0,0 +1,113 @@ +useHighResolution = \function_exists('hrtime'); + } + + public function updateTime() + { + return $this->time = $this->useHighResolution ? \hrtime(true) * 1e-9 : \microtime(true); + } + + public function getTime() + { + return $this->time ?: $this->updateTime(); + } + + public function add(TimerInterface $timer) + { + $id = \PHP_VERSION_ID < 70200 ? \spl_object_hash($timer) : \spl_object_id($timer); + $this->timers[$id] = $timer; + $this->schedule[$id] = $timer->getInterval() + $this->updateTime(); + $this->sorted = false; + } + + public function contains(TimerInterface $timer) + { + $id = \PHP_VERSION_ID < 70200 ? \spl_object_hash($timer) : \spl_object_id($timer); + return isset($this->timers[$id]); + } + + public function cancel(TimerInterface $timer) + { + $id = \PHP_VERSION_ID < 70200 ? \spl_object_hash($timer) : \spl_object_id($timer); + unset($this->timers[$id], $this->schedule[$id]); + } + + public function getFirst() + { + // ensure timers are sorted to simply accessing next (first) one + if (!$this->sorted) { + $this->sorted = true; + \asort($this->schedule); + } + + return \reset($this->schedule); + } + + public function isEmpty() + { + return \count($this->timers) === 0; + } + + public function tick() + { + // hot path: skip timers if nothing is scheduled + if (!$this->schedule) { + return; + } + + // ensure timers are sorted so we can execute in order + if (!$this->sorted) { + $this->sorted = true; + \asort($this->schedule); + } + + $time = $this->updateTime(); + + foreach ($this->schedule as $id => $scheduled) { + // schedule is ordered, so loop until first timer that is not scheduled for execution now + if ($scheduled >= $time) { + break; + } + + // skip any timers that are removed while we process the current schedule + if (!isset($this->schedule[$id]) || $this->schedule[$id] !== $scheduled) { + continue; + } + + $timer = $this->timers[$id]; + \call_user_func($timer->getCallback(), $timer); + + // re-schedule if this is a periodic timer and it has not been cancelled explicitly already + if ($timer->isPeriodic() && isset($this->timers[$id])) { + $this->schedule[$id] = $timer->getInterval() + $time; + $this->sorted = false; + } else { + unset($this->timers[$id], $this->schedule[$id]); + } + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/TimerInterface.php b/tools/php-cs-fixer/vendor/react/event-loop/src/TimerInterface.php new file mode 100644 index 00000000..cdcf7732 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/event-loop/src/TimerInterface.php @@ -0,0 +1,27 @@ +` and `reject(Throwable $reason): PromiseInterface`. + It is no longer possible to resolve a promise without a value (use `null` instead) or reject a promise without a reason (use `Throwable` instead). + (#93, #141 and #142 by @jsor, #138, #149 and #247 by @WyriHaximus and #213 and #246 by @clue) + + ```php + // old (arguments used to be optional) + $promise = resolve(); + $promise = reject(); + + // new (already supported before) + $promise = resolve(null); + $promise = reject(new RuntimeException()); + ``` + +* Feature / BC break: Report all unhandled rejections by default and remove ~~`done()`~~ method. + Add new `set_rejection_handler()` function to set the global rejection handler for unhandled promise rejections. + (#248, #249 and #224 by @clue) + + ```php + // Unhandled promise rejection with RuntimeException: Unhandled in example.php:2 + reject(new RuntimeException('Unhandled')); + ``` + +* BC break: Remove all deprecated APIs and reduce API surface. + Remove ~~`some()`~~, ~~`map()`~~, ~~`reduce()`~~ functions, use `any()` and `all()` functions instead. + Remove internal ~~`FulfilledPromise`~~ and ~~`RejectedPromise`~~ classes, use `resolve()` and `reject()` functions instead. + Remove legacy promise progress API (deprecated third argument to `then()` method) and deprecated ~~`LazyPromise`~~ class. + (#32 and #98 by @jsor and #164, #219 and #220 by @clue) + +* BC break: Make all classes final to encourage composition over inheritance. + (#80 by @jsor) + +* Feature / BC break: Require `array` (or `iterable`) type for `all()` + `race()` + `any()` functions and bring in line with ES6 specification. + These functions now require a single argument with a variable number of promises or values as input. + (#225 by @clue and #35 by @jsor) + +* Fix / BC break: Fix `race()` to return a forever pending promise when called with an empty `array` (or `iterable`) and bring in line with ES6 specification. + (#83 by @jsor and #225 by @clue) + +* Minor performance improvements by initializing `Deferred` in the constructor and avoiding `call_user_func()` calls. + (#151 by @WyriHaximus and #171 by @Kubo2) + +* Minor documentation improvements. + (#110 by @seregazhuk, #132 by @CharlotteDunois, #145 by @danielecr, #178 by @WyriHaximus, #189 by @srdante, #212 by @clue, #214, #239 and #243 by @SimonFrings and #231 by @nhedger) + +The following changes had to be ported to this release due to our branching +strategy, but also appeared in the [`2.x` branch](https://github.com/reactphp/promise/tree/2.x): + +* Feature: Support union types and address deprecation of `ReflectionType::getClass()` (PHP 8+). + (#197 by @cdosoftei and @SimonFrings) + +* Feature: Support intersection types (PHP 8.1+). + (#209 by @bzikarsky) + +* Feature: Support DNS types (PHP 8.2+). + (#236 by @nhedger) + +* Feature: Port all memory improvements from `2.x` to `3.x`. + (#150 by @clue and @WyriHaximus) + +* Fix: Fix checking whether cancellable promise is an object and avoid possible warning. + (#161 by @smscr) + +* Improve performance by prefixing all global functions calls with \ to skip the look up and resolve process and go straight to the global function. + (#134 by @WyriHaximus) + +* Improve test suite, update PHPUnit and PHP versions and add `.gitattributes` to exclude dev files from exports. + (#107 by @carusogabriel, #148 and #234 by @WyriHaximus, #153 by @reedy, #162, #230 and #240 by @clue, #173, #177, #185 and #199 by @SimonFrings, #193 by @woodongwong and #210 by @bzikarsky) + +The following changes were originally planned for this release but later reverted +and are not part of the final release: + +* Add iterative callback queue handler to avoid recursion (later removed to improve Fiber support). + (#28, #82 and #86 by @jsor, #158 by @WyriHaximus and #229 and #238 by @clue) + +* Trigger an `E_USER_ERROR` instead of throwing an exception from `done()` (later removed entire `done()` method to globally report unhandled rejections). + (#97 by @jsor and #224 and #248 by @clue) + +* Add type declarations for `some()` (later removed entire `some()` function). + (#172 by @WyriHaximus and #219 by @clue) + +## 2.0.0 (2013-12-10) + +See [`2.x` CHANGELOG](https://github.com/reactphp/promise/blob/2.x/CHANGELOG.md) for more details. + +## 1.0.0 (2012-11-07) + +See [`1.x` CHANGELOG](https://github.com/reactphp/promise/blob/1.x/CHANGELOG.md) for more details. diff --git a/tools/php-cs-fixer/vendor/react/promise/LICENSE b/tools/php-cs-fixer/vendor/react/promise/LICENSE new file mode 100644 index 00000000..21c1357b --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/LICENSE @@ -0,0 +1,24 @@ +The MIT License (MIT) + +Copyright (c) 2012 Jan Sorgalla, Christian Lück, Cees-Jan Kiewiet, Chris Boden + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/promise/README.md b/tools/php-cs-fixer/vendor/react/promise/README.md new file mode 100644 index 00000000..2108d982 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/README.md @@ -0,0 +1,722 @@ +Promise +======= + +A lightweight implementation of +[CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP. + +[![CI status](https://github.com/reactphp/promise/workflows/CI/badge.svg)](https://github.com/reactphp/promise/actions) +[![installs on Packagist](https://img.shields.io/packagist/dt/react/promise?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/promise) + +Table of Contents +----------------- + +1. [Introduction](#introduction) +2. [Concepts](#concepts) + * [Deferred](#deferred) + * [Promise](#promise-1) +3. [API](#api) + * [Deferred](#deferred-1) + * [Deferred::promise()](#deferredpromise) + * [Deferred::resolve()](#deferredresolve) + * [Deferred::reject()](#deferredreject) + * [PromiseInterface](#promiseinterface) + * [PromiseInterface::then()](#promiseinterfacethen) + * [PromiseInterface::catch()](#promiseinterfacecatch) + * [PromiseInterface::finally()](#promiseinterfacefinally) + * [PromiseInterface::cancel()](#promiseinterfacecancel) + * [~~PromiseInterface::otherwise()~~](#promiseinterfaceotherwise) + * [~~PromiseInterface::always()~~](#promiseinterfacealways) + * [Promise](#promise-2) + * [Functions](#functions) + * [resolve()](#resolve) + * [reject()](#reject) + * [all()](#all) + * [race()](#race) + * [any()](#any) + * [set_rejection_handler()](#set_rejection_handler) +4. [Examples](#examples) + * [How to use Deferred](#how-to-use-deferred) + * [How promise forwarding works](#how-promise-forwarding-works) + * [Resolution forwarding](#resolution-forwarding) + * [Rejection forwarding](#rejection-forwarding) + * [Mixed resolution and rejection forwarding](#mixed-resolution-and-rejection-forwarding) +5. [Install](#install) +6. [Tests](#tests) +7. [Credits](#credits) +8. [License](#license) + +Introduction +------------ + +Promise is a library implementing +[CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP. + +It also provides several other useful promise-related concepts, such as joining +multiple promises and mapping and reducing collections of promises. + +If you've never heard about promises before, +[read this first](https://gist.github.com/domenic/3889970). + +Concepts +-------- + +### Deferred + +A **Deferred** represents a computation or unit of work that may not have +completed yet. Typically (but not always), that computation will be something +that executes asynchronously and completes at some point in the future. + +### Promise + +While a deferred represents the computation itself, a **Promise** represents +the result of that computation. Thus, each deferred has a promise that acts as +a placeholder for its actual result. + +API +--- + +### Deferred + +A deferred represents an operation whose resolution is pending. It has separate +promise and resolver parts. + +```php +$deferred = new React\Promise\Deferred(); + +$promise = $deferred->promise(); + +$deferred->resolve(mixed $value); +$deferred->reject(\Throwable $reason); +``` + +The `promise` method returns the promise of the deferred. + +The `resolve` and `reject` methods control the state of the deferred. + +The constructor of the `Deferred` accepts an optional `$canceller` argument. +See [Promise](#promise-2) for more information. + +#### Deferred::promise() + +```php +$promise = $deferred->promise(); +``` + +Returns the promise of the deferred, which you can hand out to others while +keeping the authority to modify its state to yourself. + +#### Deferred::resolve() + +```php +$deferred->resolve(mixed $value); +``` + +Resolves the promise returned by `promise()`. All consumers are notified by +having `$onFulfilled` (which they registered via `$promise->then()`) called with +`$value`. + +If `$value` itself is a promise, the promise will transition to the state of +this promise once it is resolved. + +See also the [`resolve()` function](#resolve). + +#### Deferred::reject() + +```php +$deferred->reject(\Throwable $reason); +``` + +Rejects the promise returned by `promise()`, signalling that the deferred's +computation failed. +All consumers are notified by having `$onRejected` (which they registered via +`$promise->then()`) called with `$reason`. + +See also the [`reject()` function](#reject). + +### PromiseInterface + +The promise interface provides the common interface for all promise +implementations. +See [Promise](#promise-2) for the only public implementation exposed by this +package. + +A promise represents an eventual outcome, which is either fulfillment (success) +and an associated value, or rejection (failure) and an associated reason. + +Once in the fulfilled or rejected state, a promise becomes immutable. +Neither its state nor its result (or error) can be modified. + +#### PromiseInterface::then() + +```php +$transformedPromise = $promise->then(callable $onFulfilled = null, callable $onRejected = null); +``` + +Transforms a promise's value by applying a function to the promise's fulfillment +or rejection value. Returns a new promise for the transformed result. + +The `then()` method registers new fulfilled and rejection handlers with a promise +(all parameters are optional): + + * `$onFulfilled` will be invoked once the promise is fulfilled and passed + the result as the first argument. + * `$onRejected` will be invoked once the promise is rejected and passed the + reason as the first argument. + +It returns a new promise that will fulfill with the return value of either +`$onFulfilled` or `$onRejected`, whichever is called, or will reject with +the thrown exception if either throws. + +A promise makes the following guarantees about handlers registered in +the same call to `then()`: + + 1. Only one of `$onFulfilled` or `$onRejected` will be called, + never both. + 2. `$onFulfilled` and `$onRejected` will never be called more + than once. + +#### See also + +* [resolve()](#resolve) - Creating a resolved promise +* [reject()](#reject) - Creating a rejected promise + +#### PromiseInterface::catch() + +```php +$promise->catch(callable $onRejected); +``` + +Registers a rejection handler for promise. It is a shortcut for: + +```php +$promise->then(null, $onRejected); +``` + +Additionally, you can type hint the `$reason` argument of `$onRejected` to catch +only specific errors. + +```php +$promise + ->catch(function (\RuntimeException $reason) { + // Only catch \RuntimeException instances + // All other types of errors will propagate automatically + }) + ->catch(function (\Throwable $reason) { + // Catch other errors + }); +``` + +#### PromiseInterface::finally() + +```php +$newPromise = $promise->finally(callable $onFulfilledOrRejected); +``` + +Allows you to execute "cleanup" type tasks in a promise chain. + +It arranges for `$onFulfilledOrRejected` to be called, with no arguments, +when the promise is either fulfilled or rejected. + +* If `$promise` fulfills, and `$onFulfilledOrRejected` returns successfully, + `$newPromise` will fulfill with the same value as `$promise`. +* If `$promise` fulfills, and `$onFulfilledOrRejected` throws or returns a + rejected promise, `$newPromise` will reject with the thrown exception or + rejected promise's reason. +* If `$promise` rejects, and `$onFulfilledOrRejected` returns successfully, + `$newPromise` will reject with the same reason as `$promise`. +* If `$promise` rejects, and `$onFulfilledOrRejected` throws or returns a + rejected promise, `$newPromise` will reject with the thrown exception or + rejected promise's reason. + +`finally()` behaves similarly to the synchronous finally statement. When combined +with `catch()`, `finally()` allows you to write code that is similar to the familiar +synchronous catch/finally pair. + +Consider the following synchronous code: + +```php +try { + return doSomething(); +} catch (\Throwable $e) { + return handleError($e); +} finally { + cleanup(); +} +``` + +Similar asynchronous code (with `doSomething()` that returns a promise) can be +written: + +```php +return doSomething() + ->catch('handleError') + ->finally('cleanup'); +``` + +#### PromiseInterface::cancel() + +``` php +$promise->cancel(); +``` + +The `cancel()` method notifies the creator of the promise that there is no +further interest in the results of the operation. + +Once a promise is settled (either fulfilled or rejected), calling `cancel()` on +a promise has no effect. + +#### ~~PromiseInterface::otherwise()~~ + +> Deprecated since v3.0.0, see [`catch()`](#promiseinterfacecatch) instead. + +The `otherwise()` method registers a rejection handler for a promise. + +This method continues to exist only for BC reasons and to ease upgrading +between versions. It is an alias for: + +```php +$promise->catch($onRejected); +``` + +#### ~~PromiseInterface::always()~~ + +> Deprecated since v3.0.0, see [`finally()`](#promiseinterfacefinally) instead. + +The `always()` method allows you to execute "cleanup" type tasks in a promise chain. + +This method continues to exist only for BC reasons and to ease upgrading +between versions. It is an alias for: + +```php +$promise->finally($onFulfilledOrRejected); +``` + +### Promise + +Creates a promise whose state is controlled by the functions passed to +`$resolver`. + +```php +$resolver = function (callable $resolve, callable $reject) { + // Do some work, possibly asynchronously, and then + // resolve or reject. + + $resolve($awesomeResult); + // or throw new Exception('Promise rejected'); + // or $resolve($anotherPromise); + // or $reject($nastyError); +}; + +$canceller = function () { + // Cancel/abort any running operations like network connections, streams etc. + + // Reject promise by throwing an exception + throw new Exception('Promise cancelled'); +}; + +$promise = new React\Promise\Promise($resolver, $canceller); +``` + +The promise constructor receives a resolver function and an optional canceller +function which both will be called with two arguments: + + * `$resolve($value)` - Primary function that seals the fate of the + returned promise. Accepts either a non-promise value, or another promise. + When called with a non-promise value, fulfills promise with that value. + When called with another promise, e.g. `$resolve($otherPromise)`, promise's + fate will be equivalent to that of `$otherPromise`. + * `$reject($reason)` - Function that rejects the promise. It is recommended to + just throw an exception instead of using `$reject()`. + +If the resolver or canceller throw an exception, the promise will be rejected +with that thrown exception as the rejection reason. + +The resolver function will be called immediately, the canceller function only +once all consumers called the `cancel()` method of the promise. + +### Functions + +Useful functions for creating and joining collections of promises. + +All functions working on promise collections (like `all()`, `race()`, +etc.) support cancellation. This means, if you call `cancel()` on the returned +promise, all promises in the collection are cancelled. + +#### resolve() + +```php +$promise = React\Promise\resolve(mixed $promiseOrValue); +``` + +Creates a promise for the supplied `$promiseOrValue`. + +If `$promiseOrValue` is a value, it will be the resolution value of the +returned promise. + +If `$promiseOrValue` is a thenable (any object that provides a `then()` method), +a trusted promise that follows the state of the thenable is returned. + +If `$promiseOrValue` is a promise, it will be returned as is. + +The resulting `$promise` implements the [`PromiseInterface`](#promiseinterface) +and can be consumed like any other promise: + +```php +$promise = React\Promise\resolve(42); + +$promise->then(function (int $result): void { + var_dump($result); +}, function (\Throwable $e): void { + echo 'Error: ' . $e->getMessage() . PHP_EOL; +}); +``` + +#### reject() + +```php +$promise = React\Promise\reject(\Throwable $reason); +``` + +Creates a rejected promise for the supplied `$reason`. + +Note that the [`\Throwable`](https://www.php.net/manual/en/class.throwable.php) interface introduced in PHP 7 covers +both user land [`\Exception`](https://www.php.net/manual/en/class.exception.php)'s and +[`\Error`](https://www.php.net/manual/en/class.error.php) internal PHP errors. By enforcing `\Throwable` as reason to +reject a promise, any language error or user land exception can be used to reject a promise. + +The resulting `$promise` implements the [`PromiseInterface`](#promiseinterface) +and can be consumed like any other promise: + +```php +$promise = React\Promise\reject(new RuntimeException('Request failed')); + +$promise->then(function (int $result): void { + var_dump($result); +}, function (\Throwable $e): void { + echo 'Error: ' . $e->getMessage() . PHP_EOL; +}); +``` + +Note that rejected promises should always be handled similar to how any +exceptions should always be caught in a `try` + `catch` block. If you remove the +last reference to a rejected promise that has not been handled, it will +report an unhandled promise rejection: + +```php +function incorrect(): int +{ + $promise = React\Promise\reject(new RuntimeException('Request failed')); + + // Commented out: No rejection handler registered here. + // $promise->then(null, function (\Throwable $e): void { /* ignore */ }); + + // Returning from a function will remove all local variable references, hence why + // this will report an unhandled promise rejection here. + return 42; +} + +// Calling this function will log an error message plus its stack trace: +// Unhandled promise rejection with RuntimeException: Request failed in example.php:10 +incorrect(); +``` + +A rejected promise will be considered "handled" if you catch the rejection +reason with either the [`then()` method](#promiseinterfacethen), the +[`catch()` method](#promiseinterfacecatch), or the +[`finally()` method](#promiseinterfacefinally). Note that each of these methods +return a new promise that may again be rejected if you re-throw an exception. + +A rejected promise will also be considered "handled" if you abort the operation +with the [`cancel()` method](#promiseinterfacecancel) (which in turn would +usually reject the promise if it is still pending). + +See also the [`set_rejection_handler()` function](#set_rejection_handler). + +#### all() + +```php +$promise = React\Promise\all(iterable $promisesOrValues); +``` + +Returns a promise that will resolve only once all the items in +`$promisesOrValues` have resolved. The resolution value of the returned promise +will be an array containing the resolution values of each of the items in +`$promisesOrValues`. + +#### race() + +```php +$promise = React\Promise\race(iterable $promisesOrValues); +``` + +Initiates a competitive race that allows one winner. Returns a promise which is +resolved in the same way the first settled promise resolves. + +The returned promise will become **infinitely pending** if `$promisesOrValues` +contains 0 items. + +#### any() + +```php +$promise = React\Promise\any(iterable $promisesOrValues); +``` + +Returns a promise that will resolve when any one of the items in +`$promisesOrValues` resolves. The resolution value of the returned promise +will be the resolution value of the triggering item. + +The returned promise will only reject if *all* items in `$promisesOrValues` are +rejected. The rejection value will be a `React\Promise\Exception\CompositeException` +which holds all rejection reasons. The rejection reasons can be obtained with +`CompositeException::getThrowables()`. + +The returned promise will also reject with a `React\Promise\Exception\LengthException` +if `$promisesOrValues` contains 0 items. + +#### set_rejection_handler() + +```php +React\Promise\set_rejection_handler(?callable $callback): ?callable; +``` + +Sets the global rejection handler for unhandled promise rejections. + +Note that rejected promises should always be handled similar to how any +exceptions should always be caught in a `try` + `catch` block. If you remove +the last reference to a rejected promise that has not been handled, it will +report an unhandled promise rejection. See also the [`reject()` function](#reject) +for more details. + +The `?callable $callback` argument MUST be a valid callback function that +accepts a single `Throwable` argument or a `null` value to restore the +default promise rejection handler. The return value of the callback function +will be ignored and has no effect, so you SHOULD return a `void` value. The +callback function MUST NOT throw or the program will be terminated with a +fatal error. + +The function returns the previous rejection handler or `null` if using the +default promise rejection handler. + +The default promise rejection handler will log an error message plus its stack +trace: + +```php +// Unhandled promise rejection with RuntimeException: Unhandled in example.php:2 +React\Promise\reject(new RuntimeException('Unhandled')); +``` + +The promise rejection handler may be used to use customize the log message or +write to custom log targets. As a rule of thumb, this function should only be +used as a last resort and promise rejections are best handled with either the +[`then()` method](#promiseinterfacethen), the +[`catch()` method](#promiseinterfacecatch), or the +[`finally()` method](#promiseinterfacefinally). +See also the [`reject()` function](#reject) for more details. + +Examples +-------- + +### How to use Deferred + +```php +function getAwesomeResultPromise() +{ + $deferred = new React\Promise\Deferred(); + + // Execute a Node.js-style function using the callback pattern + computeAwesomeResultAsynchronously(function (\Throwable $error, $result) use ($deferred) { + if ($error) { + $deferred->reject($error); + } else { + $deferred->resolve($result); + } + }); + + // Return the promise + return $deferred->promise(); +} + +getAwesomeResultPromise() + ->then( + function ($value) { + // Deferred resolved, do something with $value + }, + function (\Throwable $reason) { + // Deferred rejected, do something with $reason + } + ); +``` + +### How promise forwarding works + +A few simple examples to show how the mechanics of Promises/A forwarding works. +These examples are contrived, of course, and in real usage, promise chains will +typically be spread across several function calls, or even several levels of +your application architecture. + +#### Resolution forwarding + +Resolved promises forward resolution values to the next promise. +The first promise, `$deferred->promise()`, will resolve with the value passed +to `$deferred->resolve()` below. + +Each call to `then()` returns a new promise that will resolve with the return +value of the previous handler. This creates a promise "pipeline". + +```php +$deferred = new React\Promise\Deferred(); + +$deferred->promise() + ->then(function ($x) { + // $x will be the value passed to $deferred->resolve() below + // and returns a *new promise* for $x + 1 + return $x + 1; + }) + ->then(function ($x) { + // $x === 2 + // This handler receives the return value of the + // previous handler. + return $x + 1; + }) + ->then(function ($x) { + // $x === 3 + // This handler receives the return value of the + // previous handler. + return $x + 1; + }) + ->then(function ($x) { + // $x === 4 + // This handler receives the return value of the + // previous handler. + echo 'Resolve ' . $x; + }); + +$deferred->resolve(1); // Prints "Resolve 4" +``` + +#### Rejection forwarding + +Rejected promises behave similarly, and also work similarly to try/catch: +When you catch an exception, you must rethrow for it to propagate. + +Similarly, when you handle a rejected promise, to propagate the rejection, +"rethrow" it by either returning a rejected promise, or actually throwing +(since promise translates thrown exceptions into rejections) + +```php +$deferred = new React\Promise\Deferred(); + +$deferred->promise() + ->then(function ($x) { + throw new \Exception($x + 1); + }) + ->catch(function (\Exception $x) { + // Propagate the rejection + throw $x; + }) + ->catch(function (\Exception $x) { + // Can also propagate by returning another rejection + return React\Promise\reject( + new \Exception($x->getMessage() + 1) + ); + }) + ->catch(function ($x) { + echo 'Reject ' . $x->getMessage(); // 3 + }); + +$deferred->resolve(1); // Prints "Reject 3" +``` + +#### Mixed resolution and rejection forwarding + +Just like try/catch, you can choose to propagate or not. Mixing resolutions and +rejections will still forward handler results in a predictable way. + +```php +$deferred = new React\Promise\Deferred(); + +$deferred->promise() + ->then(function ($x) { + return $x + 1; + }) + ->then(function ($x) { + throw new \Exception($x + 1); + }) + ->catch(function (\Exception $x) { + // Handle the rejection, and don't propagate. + // This is like catch without a rethrow + return $x->getMessage() + 1; + }) + ->then(function ($x) { + echo 'Mixed ' . $x; // 4 + }); + +$deferred->resolve(1); // Prints "Mixed 4" +``` + +Install +------- + +The recommended way to install this library is [through Composer](https://getcomposer.org/). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) + +This project follows [SemVer](https://semver.org/). +This will install the latest supported version from this branch: + +```bash +composer require react/promise:^3.2 +``` + +See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. + +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on PHP 7.1 through current PHP 8+. +It's *highly recommended to use the latest supported PHP version* for this project. + +We're committed to providing long-term support (LTS) options and to provide a +smooth upgrade path. If you're using an older PHP version, you may use the +[`2.x` branch](https://github.com/reactphp/promise/tree/2.x) (PHP 5.4+) or +[`1.x` branch](https://github.com/reactphp/promise/tree/1.x) (PHP 5.3+) which both +provide a compatible API but do not take advantage of newer language features. +You may target multiple versions at the same time to support a wider range of +PHP versions like this: + +```bash +composer require "react/promise:^3 || ^2 || ^1" +``` + +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org/): + +```bash +composer install +``` + +To run the test suite, go to the project root and run: + +```bash +vendor/bin/phpunit +``` + +On top of this, we use PHPStan on max level to ensure type safety across the project: + +```bash +vendor/bin/phpstan +``` + +Credits +------- + +Promise is a port of [when.js](https://github.com/cujojs/when) +by [Brian Cavalier](https://github.com/briancavalier). + +Also, large parts of the documentation have been ported from the when.js +[Wiki](https://github.com/cujojs/when/wiki) and the +[API docs](https://github.com/cujojs/when/blob/master/docs/api.md). + +License +------- + +Released under the [MIT](LICENSE) license. diff --git a/tools/php-cs-fixer/vendor/react/promise/composer.json b/tools/php-cs-fixer/vendor/react/promise/composer.json new file mode 100644 index 00000000..5d1e2771 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/composer.json @@ -0,0 +1,57 @@ +{ + "name": "react/promise", + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "license": "MIT", + "authors": [ + { + "name": "Jan Sorgalla", + "homepage": "https://sorgalla.com/", + "email": "jsorgalla@gmail.com" + }, + { + "name": "Christian Lück", + "homepage": "https://clue.engineering/", + "email": "christian@clue.engineering" + }, + { + "name": "Cees-Jan Kiewiet", + "homepage": "https://wyrihaximus.net/", + "email": "reactphp@ceesjankiewiet.nl" + }, + { + "name": "Chris Boden", + "homepage": "https://cboden.dev/", + "email": "cboden@gmail.com" + } + ], + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "autoload-dev": { + "psr-4": { + "React\\Promise\\": [ + "tests/fixtures/", + "tests/" + ] + }, + "files": [ + "tests/Fiber.php" + ] + }, + "keywords": [ + "promise", + "promises" + ] +} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Deferred.php b/tools/php-cs-fixer/vendor/react/promise/src/Deferred.php new file mode 100644 index 00000000..80b8fcfb --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/src/Deferred.php @@ -0,0 +1,52 @@ + + */ + private $promise; + + /** @var callable(T):void */ + private $resolveCallback; + + /** @var callable(\Throwable):void */ + private $rejectCallback; + + /** + * @param (callable(callable(T):void,callable(\Throwable):void):void)|null $canceller + */ + public function __construct(?callable $canceller = null) + { + $this->promise = new Promise(function ($resolve, $reject): void { + $this->resolveCallback = $resolve; + $this->rejectCallback = $reject; + }, $canceller); + } + + /** + * @return PromiseInterface + */ + public function promise(): PromiseInterface + { + return $this->promise; + } + + /** + * @param T $value + */ + public function resolve($value): void + { + ($this->resolveCallback)($value); + } + + public function reject(\Throwable $reason): void + { + ($this->rejectCallback)($reason); + } +} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Exception/CompositeException.php b/tools/php-cs-fixer/vendor/react/promise/src/Exception/CompositeException.php new file mode 100644 index 00000000..2e672a04 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/src/Exception/CompositeException.php @@ -0,0 +1,32 @@ +throwables = $throwables; + } + + /** + * @return \Throwable[] + */ + public function getThrowables(): array + { + return $this->throwables; + } +} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Exception/LengthException.php b/tools/php-cs-fixer/vendor/react/promise/src/Exception/LengthException.php new file mode 100644 index 00000000..775c48db --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/src/Exception/LengthException.php @@ -0,0 +1,7 @@ +started) { + return; + } + + $this->started = true; + $this->drain(); + } + + /** + * @param mixed $cancellable + */ + public function enqueue($cancellable): void + { + if (!\is_object($cancellable) || !\method_exists($cancellable, 'then') || !\method_exists($cancellable, 'cancel')) { + return; + } + + $length = \array_push($this->queue, $cancellable); + + if ($this->started && 1 === $length) { + $this->drain(); + } + } + + private function drain(): void + { + for ($i = \key($this->queue); isset($this->queue[$i]); $i++) { + $cancellable = $this->queue[$i]; + assert(\method_exists($cancellable, 'cancel')); + + $exception = null; + + try { + $cancellable->cancel(); + } catch (\Throwable $exception) { + } + + unset($this->queue[$i]); + + if ($exception) { + throw $exception; + } + } + + $this->queue = []; + } +} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Internal/FulfilledPromise.php b/tools/php-cs-fixer/vendor/react/promise/src/Internal/FulfilledPromise.php new file mode 100644 index 00000000..8664ffdb --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/src/Internal/FulfilledPromise.php @@ -0,0 +1,89 @@ + + */ +final class FulfilledPromise implements PromiseInterface +{ + /** @var T */ + private $value; + + /** + * @param T $value + * @throws \InvalidArgumentException + */ + public function __construct($value = null) + { + if ($value instanceof PromiseInterface) { + throw new \InvalidArgumentException('You cannot create React\Promise\FulfilledPromise with a promise. Use React\Promise\resolve($promiseOrValue) instead.'); + } + + $this->value = $value; + } + + /** + * @template TFulfilled + * @param ?(callable((T is void ? null : T)): (PromiseInterface|TFulfilled)) $onFulfilled + * @return PromiseInterface<($onFulfilled is null ? T : TFulfilled)> + */ + public function then(?callable $onFulfilled = null, ?callable $onRejected = null): PromiseInterface + { + if (null === $onFulfilled) { + return $this; + } + + try { + /** + * @var PromiseInterface|T $result + */ + $result = $onFulfilled($this->value); + return resolve($result); + } catch (\Throwable $exception) { + return new RejectedPromise($exception); + } + } + + public function catch(callable $onRejected): PromiseInterface + { + return $this; + } + + public function finally(callable $onFulfilledOrRejected): PromiseInterface + { + return $this->then(function ($value) use ($onFulfilledOrRejected): PromiseInterface { + return resolve($onFulfilledOrRejected())->then(function () use ($value) { + return $value; + }); + }); + } + + public function cancel(): void + { + } + + /** + * @deprecated 3.0.0 Use `catch()` instead + * @see self::catch() + */ + public function otherwise(callable $onRejected): PromiseInterface + { + return $this->catch($onRejected); + } + + /** + * @deprecated 3.0.0 Use `finally()` instead + * @see self::finally() + */ + public function always(callable $onFulfilledOrRejected): PromiseInterface + { + return $this->finally($onFulfilledOrRejected); + } +} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Internal/RejectedPromise.php b/tools/php-cs-fixer/vendor/react/promise/src/Internal/RejectedPromise.php new file mode 100644 index 00000000..aa1dff30 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/src/Internal/RejectedPromise.php @@ -0,0 +1,128 @@ + + */ +final class RejectedPromise implements PromiseInterface +{ + /** @var \Throwable */ + private $reason; + + /** @var bool */ + private $handled = false; + + /** + * @param \Throwable $reason + */ + public function __construct(\Throwable $reason) + { + $this->reason = $reason; + } + + /** @throws void */ + public function __destruct() + { + if ($this->handled) { + return; + } + + $handler = set_rejection_handler(null); + if ($handler === null) { + $message = 'Unhandled promise rejection with ' . $this->reason; + + \error_log($message); + return; + } + + try { + $handler($this->reason); + } catch (\Throwable $e) { + \preg_match('/^([^:\s]++)(.*+)$/sm', (string) $e, $match); + \assert(isset($match[1], $match[2])); + $message = 'Fatal error: Uncaught ' . $match[1] . ' from unhandled promise rejection handler' . $match[2]; + + \error_log($message); + exit(255); + } + } + + /** + * @template TRejected + * @param ?callable $onFulfilled + * @param ?(callable(\Throwable): (PromiseInterface|TRejected)) $onRejected + * @return PromiseInterface<($onRejected is null ? never : TRejected)> + */ + public function then(?callable $onFulfilled = null, ?callable $onRejected = null): PromiseInterface + { + if (null === $onRejected) { + return $this; + } + + $this->handled = true; + + try { + return resolve($onRejected($this->reason)); + } catch (\Throwable $exception) { + return new RejectedPromise($exception); + } + } + + /** + * @template TThrowable of \Throwable + * @template TRejected + * @param callable(TThrowable): (PromiseInterface|TRejected) $onRejected + * @return PromiseInterface + */ + public function catch(callable $onRejected): PromiseInterface + { + if (!_checkTypehint($onRejected, $this->reason)) { + return $this; + } + + /** + * @var callable(\Throwable):(PromiseInterface|TRejected) $onRejected + */ + return $this->then(null, $onRejected); + } + + public function finally(callable $onFulfilledOrRejected): PromiseInterface + { + return $this->then(null, function (\Throwable $reason) use ($onFulfilledOrRejected): PromiseInterface { + return resolve($onFulfilledOrRejected())->then(function () use ($reason): PromiseInterface { + return new RejectedPromise($reason); + }); + }); + } + + public function cancel(): void + { + $this->handled = true; + } + + /** + * @deprecated 3.0.0 Use `catch()` instead + * @see self::catch() + */ + public function otherwise(callable $onRejected): PromiseInterface + { + return $this->catch($onRejected); + } + + /** + * @deprecated 3.0.0 Use `always()` instead + * @see self::always() + */ + public function always(callable $onFulfilledOrRejected): PromiseInterface + { + return $this->finally($onFulfilledOrRejected); + } +} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Promise.php b/tools/php-cs-fixer/vendor/react/promise/src/Promise.php new file mode 100644 index 00000000..4ac27007 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/src/Promise.php @@ -0,0 +1,303 @@ + + */ +final class Promise implements PromiseInterface +{ + /** @var (callable(callable(T):void,callable(\Throwable):void):void)|null */ + private $canceller; + + /** @var ?PromiseInterface */ + private $result; + + /** @var list):void> */ + private $handlers = []; + + /** @var int */ + private $requiredCancelRequests = 0; + + /** @var bool */ + private $cancelled = false; + + /** + * @param callable(callable(T):void,callable(\Throwable):void):void $resolver + * @param (callable(callable(T):void,callable(\Throwable):void):void)|null $canceller + */ + public function __construct(callable $resolver, ?callable $canceller = null) + { + $this->canceller = $canceller; + + // Explicitly overwrite arguments with null values before invoking + // resolver function. This ensure that these arguments do not show up + // in the stack trace in PHP 7+ only. + $cb = $resolver; + $resolver = $canceller = null; + $this->call($cb); + } + + public function then(?callable $onFulfilled = null, ?callable $onRejected = null): PromiseInterface + { + if (null !== $this->result) { + return $this->result->then($onFulfilled, $onRejected); + } + + if (null === $this->canceller) { + return new static($this->resolver($onFulfilled, $onRejected)); + } + + // This promise has a canceller, so we create a new child promise which + // has a canceller that invokes the parent canceller if all other + // followers are also cancelled. We keep a reference to this promise + // instance for the static canceller function and clear this to avoid + // keeping a cyclic reference between parent and follower. + $parent = $this; + ++$parent->requiredCancelRequests; + + return new static( + $this->resolver($onFulfilled, $onRejected), + static function () use (&$parent): void { + assert($parent instanceof self); + --$parent->requiredCancelRequests; + + if ($parent->requiredCancelRequests <= 0) { + $parent->cancel(); + } + + $parent = null; + } + ); + } + + /** + * @template TThrowable of \Throwable + * @template TRejected + * @param callable(TThrowable): (PromiseInterface|TRejected) $onRejected + * @return PromiseInterface + */ + public function catch(callable $onRejected): PromiseInterface + { + return $this->then(null, static function (\Throwable $reason) use ($onRejected) { + if (!_checkTypehint($onRejected, $reason)) { + return new RejectedPromise($reason); + } + + /** + * @var callable(\Throwable):(PromiseInterface|TRejected) $onRejected + */ + return $onRejected($reason); + }); + } + + public function finally(callable $onFulfilledOrRejected): PromiseInterface + { + return $this->then(static function ($value) use ($onFulfilledOrRejected): PromiseInterface { + return resolve($onFulfilledOrRejected())->then(function () use ($value) { + return $value; + }); + }, static function (\Throwable $reason) use ($onFulfilledOrRejected): PromiseInterface { + return resolve($onFulfilledOrRejected())->then(function () use ($reason): RejectedPromise { + return new RejectedPromise($reason); + }); + }); + } + + public function cancel(): void + { + $this->cancelled = true; + $canceller = $this->canceller; + $this->canceller = null; + + $parentCanceller = null; + + if (null !== $this->result) { + // Forward cancellation to rejected promise to avoid reporting unhandled rejection + if ($this->result instanceof RejectedPromise) { + $this->result->cancel(); + } + + // Go up the promise chain and reach the top most promise which is + // itself not following another promise + $root = $this->unwrap($this->result); + + // Return if the root promise is already resolved or a + // FulfilledPromise or RejectedPromise + if (!$root instanceof self || null !== $root->result) { + return; + } + + $root->requiredCancelRequests--; + + if ($root->requiredCancelRequests <= 0) { + $parentCanceller = [$root, 'cancel']; + } + } + + if (null !== $canceller) { + $this->call($canceller); + } + + // For BC, we call the parent canceller after our own canceller + if ($parentCanceller) { + $parentCanceller(); + } + } + + /** + * @deprecated 3.0.0 Use `catch()` instead + * @see self::catch() + */ + public function otherwise(callable $onRejected): PromiseInterface + { + return $this->catch($onRejected); + } + + /** + * @deprecated 3.0.0 Use `finally()` instead + * @see self::finally() + */ + public function always(callable $onFulfilledOrRejected): PromiseInterface + { + return $this->finally($onFulfilledOrRejected); + } + + private function resolver(?callable $onFulfilled = null, ?callable $onRejected = null): callable + { + return function (callable $resolve, callable $reject) use ($onFulfilled, $onRejected): void { + $this->handlers[] = static function (PromiseInterface $promise) use ($onFulfilled, $onRejected, $resolve, $reject): void { + $promise = $promise->then($onFulfilled, $onRejected); + + if ($promise instanceof self && $promise->result === null) { + $promise->handlers[] = static function (PromiseInterface $promise) use ($resolve, $reject): void { + $promise->then($resolve, $reject); + }; + } else { + $promise->then($resolve, $reject); + } + }; + }; + } + + private function reject(\Throwable $reason): void + { + if (null !== $this->result) { + return; + } + + $this->settle(reject($reason)); + } + + /** + * @param PromiseInterface $result + */ + private function settle(PromiseInterface $result): void + { + $result = $this->unwrap($result); + + if ($result === $this) { + $result = new RejectedPromise( + new \LogicException('Cannot resolve a promise with itself.') + ); + } + + if ($result instanceof self) { + $result->requiredCancelRequests++; + } else { + // Unset canceller only when not following a pending promise + $this->canceller = null; + } + + $handlers = $this->handlers; + + $this->handlers = []; + $this->result = $result; + + foreach ($handlers as $handler) { + $handler($result); + } + + // Forward cancellation to rejected promise to avoid reporting unhandled rejection + if ($this->cancelled && $result instanceof RejectedPromise) { + $result->cancel(); + } + } + + /** + * @param PromiseInterface $promise + * @return PromiseInterface + */ + private function unwrap(PromiseInterface $promise): PromiseInterface + { + while ($promise instanceof self && null !== $promise->result) { + /** @var PromiseInterface $promise */ + $promise = $promise->result; + } + + return $promise; + } + + /** + * @param callable(callable(mixed):void,callable(\Throwable):void):void $cb + */ + private function call(callable $cb): void + { + // Explicitly overwrite argument with null value. This ensure that this + // argument does not show up in the stack trace in PHP 7+ only. + $callback = $cb; + $cb = null; + + // Use reflection to inspect number of arguments expected by this callback. + // We did some careful benchmarking here: Using reflection to avoid unneeded + // function arguments is actually faster than blindly passing them. + // Also, this helps avoiding unnecessary function arguments in the call stack + // if the callback creates an Exception (creating garbage cycles). + if (\is_array($callback)) { + $ref = new \ReflectionMethod($callback[0], $callback[1]); + } elseif (\is_object($callback) && !$callback instanceof \Closure) { + $ref = new \ReflectionMethod($callback, '__invoke'); + } else { + assert($callback instanceof \Closure || \is_string($callback)); + $ref = new \ReflectionFunction($callback); + } + $args = $ref->getNumberOfParameters(); + + try { + if ($args === 0) { + $callback(); + } else { + // Keep references to this promise instance for the static resolve/reject functions. + // By using static callbacks that are not bound to this instance + // and passing the target promise instance by reference, we can + // still execute its resolving logic and still clear this + // reference when settling the promise. This helps avoiding + // garbage cycles if any callback creates an Exception. + // These assumptions are covered by the test suite, so if you ever feel like + // refactoring this, go ahead, any alternative suggestions are welcome! + $target =& $this; + + $callback( + static function ($value) use (&$target): void { + if ($target !== null) { + $target->settle(resolve($value)); + $target = null; + } + }, + static function (\Throwable $reason) use (&$target): void { + if ($target !== null) { + $target->reject($reason); + $target = null; + } + } + ); + } + } catch (\Throwable $e) { + $target = null; + $this->reject($e); + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/PromiseInterface.php b/tools/php-cs-fixer/vendor/react/promise/src/PromiseInterface.php new file mode 100644 index 00000000..5869f76b --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/src/PromiseInterface.php @@ -0,0 +1,152 @@ +|TFulfilled)) $onFulfilled + * @param ?(callable(\Throwable): (PromiseInterface|TRejected)) $onRejected + * @return PromiseInterface<($onRejected is null ? ($onFulfilled is null ? T : TFulfilled) : ($onFulfilled is null ? T|TRejected : TFulfilled|TRejected))> + */ + public function then(?callable $onFulfilled = null, ?callable $onRejected = null): PromiseInterface; + + /** + * Registers a rejection handler for promise. It is a shortcut for: + * + * ```php + * $promise->then(null, $onRejected); + * ``` + * + * Additionally, you can type hint the `$reason` argument of `$onRejected` to catch + * only specific errors. + * + * @template TThrowable of \Throwable + * @template TRejected + * @param callable(TThrowable): (PromiseInterface|TRejected) $onRejected + * @return PromiseInterface + */ + public function catch(callable $onRejected): PromiseInterface; + + /** + * Allows you to execute "cleanup" type tasks in a promise chain. + * + * It arranges for `$onFulfilledOrRejected` to be called, with no arguments, + * when the promise is either fulfilled or rejected. + * + * * If `$promise` fulfills, and `$onFulfilledOrRejected` returns successfully, + * `$newPromise` will fulfill with the same value as `$promise`. + * * If `$promise` fulfills, and `$onFulfilledOrRejected` throws or returns a + * rejected promise, `$newPromise` will reject with the thrown exception or + * rejected promise's reason. + * * If `$promise` rejects, and `$onFulfilledOrRejected` returns successfully, + * `$newPromise` will reject with the same reason as `$promise`. + * * If `$promise` rejects, and `$onFulfilledOrRejected` throws or returns a + * rejected promise, `$newPromise` will reject with the thrown exception or + * rejected promise's reason. + * + * `finally()` behaves similarly to the synchronous finally statement. When combined + * with `catch()`, `finally()` allows you to write code that is similar to the familiar + * synchronous catch/finally pair. + * + * Consider the following synchronous code: + * + * ```php + * try { + * return doSomething(); + * } catch(\Exception $e) { + * return handleError($e); + * } finally { + * cleanup(); + * } + * ``` + * + * Similar asynchronous code (with `doSomething()` that returns a promise) can be + * written: + * + * ```php + * return doSomething() + * ->catch('handleError') + * ->finally('cleanup'); + * ``` + * + * @param callable(): (void|PromiseInterface) $onFulfilledOrRejected + * @return PromiseInterface + */ + public function finally(callable $onFulfilledOrRejected): PromiseInterface; + + /** + * The `cancel()` method notifies the creator of the promise that there is no + * further interest in the results of the operation. + * + * Once a promise is settled (either fulfilled or rejected), calling `cancel()` on + * a promise has no effect. + * + * @return void + */ + public function cancel(): void; + + /** + * [Deprecated] Registers a rejection handler for a promise. + * + * This method continues to exist only for BC reasons and to ease upgrading + * between versions. It is an alias for: + * + * ```php + * $promise->catch($onRejected); + * ``` + * + * @template TThrowable of \Throwable + * @template TRejected + * @param callable(TThrowable): (PromiseInterface|TRejected) $onRejected + * @return PromiseInterface + * @deprecated 3.0.0 Use catch() instead + * @see self::catch() + */ + public function otherwise(callable $onRejected): PromiseInterface; + + /** + * [Deprecated] Allows you to execute "cleanup" type tasks in a promise chain. + * + * This method continues to exist only for BC reasons and to ease upgrading + * between versions. It is an alias for: + * + * ```php + * $promise->finally($onFulfilledOrRejected); + * ``` + * + * @param callable(): (void|PromiseInterface) $onFulfilledOrRejected + * @return PromiseInterface + * @deprecated 3.0.0 Use finally() instead + * @see self::finally() + */ + public function always(callable $onFulfilledOrRejected): PromiseInterface; +} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/functions.php b/tools/php-cs-fixer/vendor/react/promise/src/functions.php new file mode 100644 index 00000000..2aab877e --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/src/functions.php @@ -0,0 +1,345 @@ +|T $promiseOrValue + * @return PromiseInterface + */ +function resolve($promiseOrValue): PromiseInterface +{ + if ($promiseOrValue instanceof PromiseInterface) { + return $promiseOrValue; + } + + if (\is_object($promiseOrValue) && \method_exists($promiseOrValue, 'then')) { + $canceller = null; + + if (\method_exists($promiseOrValue, 'cancel')) { + $canceller = [$promiseOrValue, 'cancel']; + assert(\is_callable($canceller)); + } + + /** @var Promise */ + return new Promise(function (callable $resolve, callable $reject) use ($promiseOrValue): void { + $promiseOrValue->then($resolve, $reject); + }, $canceller); + } + + return new FulfilledPromise($promiseOrValue); +} + +/** + * Creates a rejected promise for the supplied `$reason`. + * + * If `$reason` is a value, it will be the rejection value of the + * returned promise. + * + * If `$reason` is a promise, its completion value will be the rejected + * value of the returned promise. + * + * This can be useful in situations where you need to reject a promise without + * throwing an exception. For example, it allows you to propagate a rejection with + * the value of another promise. + * + * @return PromiseInterface + */ +function reject(\Throwable $reason): PromiseInterface +{ + return new RejectedPromise($reason); +} + +/** + * Returns a promise that will resolve only once all the items in + * `$promisesOrValues` have resolved. The resolution value of the returned promise + * will be an array containing the resolution values of each of the items in + * `$promisesOrValues`. + * + * @template T + * @param iterable|T> $promisesOrValues + * @return PromiseInterface> + */ +function all(iterable $promisesOrValues): PromiseInterface +{ + $cancellationQueue = new Internal\CancellationQueue(); + + /** @var Promise> */ + return new Promise(function (callable $resolve, callable $reject) use ($promisesOrValues, $cancellationQueue): void { + $toResolve = 0; + /** @var bool */ + $continue = true; + $values = []; + + foreach ($promisesOrValues as $i => $promiseOrValue) { + $cancellationQueue->enqueue($promiseOrValue); + $values[$i] = null; + ++$toResolve; + + resolve($promiseOrValue)->then( + function ($value) use ($i, &$values, &$toResolve, &$continue, $resolve): void { + $values[$i] = $value; + + if (0 === --$toResolve && !$continue) { + $resolve($values); + } + }, + function (\Throwable $reason) use (&$continue, $reject): void { + $continue = false; + $reject($reason); + } + ); + + if (!$continue && !\is_array($promisesOrValues)) { + break; + } + } + + $continue = false; + if ($toResolve === 0) { + $resolve($values); + } + }, $cancellationQueue); +} + +/** + * Initiates a competitive race that allows one winner. Returns a promise which is + * resolved in the same way the first settled promise resolves. + * + * The returned promise will become **infinitely pending** if `$promisesOrValues` + * contains 0 items. + * + * @template T + * @param iterable|T> $promisesOrValues + * @return PromiseInterface + */ +function race(iterable $promisesOrValues): PromiseInterface +{ + $cancellationQueue = new Internal\CancellationQueue(); + + /** @var Promise */ + return new Promise(function (callable $resolve, callable $reject) use ($promisesOrValues, $cancellationQueue): void { + $continue = true; + + foreach ($promisesOrValues as $promiseOrValue) { + $cancellationQueue->enqueue($promiseOrValue); + + resolve($promiseOrValue)->then($resolve, $reject)->finally(function () use (&$continue): void { + $continue = false; + }); + + if (!$continue && !\is_array($promisesOrValues)) { + break; + } + } + }, $cancellationQueue); +} + +/** + * Returns a promise that will resolve when any one of the items in + * `$promisesOrValues` resolves. The resolution value of the returned promise + * will be the resolution value of the triggering item. + * + * The returned promise will only reject if *all* items in `$promisesOrValues` are + * rejected. The rejection value will be an array of all rejection reasons. + * + * The returned promise will also reject with a `React\Promise\Exception\LengthException` + * if `$promisesOrValues` contains 0 items. + * + * @template T + * @param iterable|T> $promisesOrValues + * @return PromiseInterface + */ +function any(iterable $promisesOrValues): PromiseInterface +{ + $cancellationQueue = new Internal\CancellationQueue(); + + /** @var Promise */ + return new Promise(function (callable $resolve, callable $reject) use ($promisesOrValues, $cancellationQueue): void { + $toReject = 0; + $continue = true; + $reasons = []; + + foreach ($promisesOrValues as $i => $promiseOrValue) { + $cancellationQueue->enqueue($promiseOrValue); + ++$toReject; + + resolve($promiseOrValue)->then( + function ($value) use ($resolve, &$continue): void { + $continue = false; + $resolve($value); + }, + function (\Throwable $reason) use ($i, &$reasons, &$toReject, $reject, &$continue): void { + $reasons[$i] = $reason; + + if (0 === --$toReject && !$continue) { + $reject(new CompositeException( + $reasons, + 'All promises rejected.' + )); + } + } + ); + + if (!$continue && !\is_array($promisesOrValues)) { + break; + } + } + + $continue = false; + if ($toReject === 0 && !$reasons) { + $reject(new Exception\LengthException( + 'Must contain at least 1 item but contains only 0 items.' + )); + } elseif ($toReject === 0) { + $reject(new CompositeException( + $reasons, + 'All promises rejected.' + )); + } + }, $cancellationQueue); +} + +/** + * Sets the global rejection handler for unhandled promise rejections. + * + * Note that rejected promises should always be handled similar to how any + * exceptions should always be caught in a `try` + `catch` block. If you remove + * the last reference to a rejected promise that has not been handled, it will + * report an unhandled promise rejection. See also the [`reject()` function](#reject) + * for more details. + * + * The `?callable $callback` argument MUST be a valid callback function that + * accepts a single `Throwable` argument or a `null` value to restore the + * default promise rejection handler. The return value of the callback function + * will be ignored and has no effect, so you SHOULD return a `void` value. The + * callback function MUST NOT throw or the program will be terminated with a + * fatal error. + * + * The function returns the previous rejection handler or `null` if using the + * default promise rejection handler. + * + * The default promise rejection handler will log an error message plus its + * stack trace: + * + * ```php + * // Unhandled promise rejection with RuntimeException: Unhandled in example.php:2 + * React\Promise\reject(new RuntimeException('Unhandled')); + * ``` + * + * The promise rejection handler may be used to use customize the log message or + * write to custom log targets. As a rule of thumb, this function should only be + * used as a last resort and promise rejections are best handled with either the + * [`then()` method](#promiseinterfacethen), the + * [`catch()` method](#promiseinterfacecatch), or the + * [`finally()` method](#promiseinterfacefinally). + * See also the [`reject()` function](#reject) for more details. + * + * @param callable(\Throwable):void|null $callback + * @return callable(\Throwable):void|null + */ +function set_rejection_handler(?callable $callback): ?callable +{ + static $current = null; + $previous = $current; + $current = $callback; + + return $previous; +} + +/** + * @internal + */ +function _checkTypehint(callable $callback, \Throwable $reason): bool +{ + if (\is_array($callback)) { + $callbackReflection = new \ReflectionMethod($callback[0], $callback[1]); + } elseif (\is_object($callback) && !$callback instanceof \Closure) { + $callbackReflection = new \ReflectionMethod($callback, '__invoke'); + } else { + assert($callback instanceof \Closure || \is_string($callback)); + $callbackReflection = new \ReflectionFunction($callback); + } + + $parameters = $callbackReflection->getParameters(); + + if (!isset($parameters[0])) { + return true; + } + + $expectedException = $parameters[0]; + + // Extract the type of the argument and handle different possibilities + $type = $expectedException->getType(); + + $isTypeUnion = true; + $types = []; + + switch (true) { + case $type === null: + break; + case $type instanceof \ReflectionNamedType: + $types = [$type]; + break; + case $type instanceof \ReflectionIntersectionType: + $isTypeUnion = false; + case $type instanceof \ReflectionUnionType; + $types = $type->getTypes(); + break; + default: + throw new \LogicException('Unexpected return value of ReflectionParameter::getType'); + } + + // If there is no type restriction, it matches + if (empty($types)) { + return true; + } + + foreach ($types as $type) { + + if ($type instanceof \ReflectionIntersectionType) { + foreach ($type->getTypes() as $typeToMatch) { + assert($typeToMatch instanceof \ReflectionNamedType); + $name = $typeToMatch->getName(); + if (!($matches = (!$typeToMatch->isBuiltin() && $reason instanceof $name))) { + break; + } + } + assert(isset($matches)); + } else { + assert($type instanceof \ReflectionNamedType); + $name = $type->getName(); + $matches = !$type->isBuiltin() && $reason instanceof $name; + } + + // If we look for a single match (union), we can return early on match + // If we look for a full match (intersection), we can return early on mismatch + if ($matches) { + if ($isTypeUnion) { + return true; + } + } else { + if (!$isTypeUnion) { + return false; + } + } + } + + // If we look for a single match (union) and did not return early, we matched no type and are false + // If we look for a full match (intersection) and did not return early, we matched all types and are true + return $isTypeUnion ? false : true; +} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/functions_include.php b/tools/php-cs-fixer/vendor/react/promise/src/functions_include.php new file mode 100644 index 00000000..bd0c54fd --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/promise/src/functions_include.php @@ -0,0 +1,5 @@ +connect($uri)->then(function (React\Socket\ConnectionInterface $conn) { + // … + }, function (Exception $e) { + echo 'Error:' . $e->getMessage() . PHP_EOL; + }); + ``` + +* Improve test suite, test against PHP 8.1 release. + (#274 by @SimonFrings) + +## 1.9.0 (2021-08-03) + +* Feature: Add new `SocketServer` and deprecate `Server` to avoid class name collisions. + (#263 by @clue) + + The new `SocketServer` class has been added with an improved constructor signature + as a replacement for the previous `Server` class in order to avoid any ambiguities. + The previous name has been deprecated and should not be used anymore. + In its most basic form, the deprecated `Server` can now be considered an alias for new `SocketServer`. + + ```php + // deprecated + $socket = new React\Socket\Server(0); + $socket = new React\Socket\Server('127.0.0.1:8000'); + $socket = new React\Socket\Server('127.0.0.1:8000', null, $context); + $socket = new React\Socket\Server('127.0.0.1:8000', $loop, $context); + + // new + $socket = new React\Socket\SocketServer('127.0.0.1:0'); + $socket = new React\Socket\SocketServer('127.0.0.1:8000'); + $socket = new React\Socket\SocketServer('127.0.0.1:8000', $context); + $socket = new React\Socket\SocketServer('127.0.0.1:8000', $context, $loop); + ``` + +* Feature: Update `Connector` signature to take optional `$context` as first argument. + (#264 by @clue) + + The new signature has been added to match the new `SocketServer` and + consistently move the now commonly unneeded loop argument to the last argument. + The previous signature has been deprecated and should not be used anymore. + In its most basic form, both signatures are compatible. + + ```php + // deprecated + $connector = new React\Socket\Connector(null, $context); + $connector = new React\Socket\Connector($loop, $context); + + // new + $connector = new React\Socket\Connector($context); + $connector = new React\Socket\Connector($context, $loop); + ``` + +## 1.8.0 (2021-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). + +* Feature: Simplify usage by supporting new [default loop](https://reactphp.org/event-loop/#loop). + (#260 by @clue) + + ```php + // old (still supported) + $socket = new React\Socket\Server('127.0.0.1:8080', $loop); + $connector = new React\Socket\Connector($loop); + + // new (using default loop) + $socket = new React\Socket\Server('127.0.0.1:8080'); + $connector = new React\Socket\Connector(); + ``` + +## 1.7.0 (2021-06-25) + +* Feature: Support falling back to multiple DNS servers from DNS config. + (#257 by @clue) + + If you're using the default `Connector`, it will now use all DNS servers + configured on your system. If you have multiple DNS servers configured and + connectivity to the primary DNS server is broken, it will now fall back to + your other DNS servers, thus providing improved connectivity and redundancy + for broken DNS configurations. + +* Feature: Use round robin for happy eyeballs DNS responses (load balancing). + (#247 by @clue) + + If you're using the default `Connector`, it will now randomize the order of + the IP addresses resolved via DNS when connecting. This allows the load to + be distributed more evenly across all returned IP addresses. This can be + used as a very basic DNS load balancing mechanism. + +* Internal improvement to avoid unhandled rejection for future Promise API. + (#258 by @clue) + +* Improve test suite, use GitHub actions for continuous integration (CI). + (#254 by @SimonFrings) + +## 1.6.0 (2020-08-28) + +* Feature: Support upcoming PHP 8 release. + (#246 by @clue) + +* Feature: Change default socket backlog size to 511. + (#242 by @clue) + +* Fix: Fix closing connection when cancelling during TLS handshake. + (#241 by @clue) + +* Fix: Fix blocking during possible `accept()` race condition + when multiple socket servers listen on same socket address. + (#244 by @clue) + +* Improve test suite, update PHPUnit config and add full core team to the license. + (#243 by @SimonFrings and #245 by @WyriHaximus) + +## 1.5.0 (2020-07-01) + +* Feature / Fix: Improve error handling and reporting for happy eyeballs and + immediately try next connection when one connection attempt fails. + (#230, #231, #232 and #233 by @clue) + + Error messages for failed connection attempts now include more details to + ease debugging. Additionally, the happy eyeballs algorithm has been improved + to avoid having to wait for some timers to expire which significantly + improves connection setup times (in particular when IPv6 isn't available). + +* Improve test suite, minor code cleanup and improve code coverage to 100%. + Update to PHPUnit 9 and skip legacy TLS 1.0 / TLS 1.1 tests if disabled by + system. Run tests on Windows and simplify Travis CI test matrix for Mac OS X + setup and skip all TLS tests on legacy HHVM. + (#229, #235, #236 and #238 by @clue and #239 by @SimonFrings) + +## 1.4.0 (2020-03-12) + +A major new feature release, see [**release announcement**](https://clue.engineering/2020/introducing-ipv6-for-reactphp). + +* Feature: Add IPv6 support to `Connector` (implement "Happy Eyeballs" algorithm to support IPv6 probing). + IPv6 support is turned on by default, use new `happy_eyeballs` option in `Connector` to toggle behavior. + (#196, #224 and #225 by @WyriHaximus and @clue) + +* Feature: Default to using DNS cache (with max 256 entries) for `Connector`. + (#226 by @clue) + +* Add `.gitattributes` to exclude dev files from exports and some minor code style fixes. + (#219 by @reedy and #218 by @mmoreram) + +* Improve test suite to fix failing test cases when using new DNS component, + significantly improve test performance by awaiting events instead of sleeping, + exclude TLS 1.3 test on PHP 7.3, run tests on PHP 7.4 and simplify test matrix. + (#208, #209, #210, #217 and #223 by @clue) + +## 1.3.0 (2019-07-10) + +* Feature: Forward compatibility with upcoming stable DNS component. + (#206 by @clue) + +## 1.2.1 (2019-06-03) + +* Avoid uneeded fragmented TLS work around for PHP 7.3.3+ and + work around failing test case detecting EOF on TLS 1.3 socket streams. + (#201 and #202 by @clue) + +* Improve TLS certificate/passphrase example. + (#190 by @jsor) + +## 1.2.0 (2019-01-07) + +* Feature / Fix: Improve TLS 1.3 support. + (#186 by @clue) + + TLS 1.3 is now an official standard as of August 2018! :tada: + The protocol has major improvements in the areas of security, performance, and privacy. + TLS 1.3 is supported by default as of [OpenSSL 1.1.1](https://www.openssl.org/blog/blog/2018/09/11/release111/). + For example, this version ships with Ubuntu 18.10 (and newer) by default, meaning that recent installations support TLS 1.3 out of the box :shipit: + +* Fix: Avoid possibility of missing remote address when TLS handshake fails. + (#188 by @clue) + +* Improve performance by prefixing all global functions calls with `\` to skip the look up and resolve process and go straight to the global function. + (#183 by @WyriHaximus) + +* Update documentation to use full class names with namespaces. + (#187 by @clue) + +* Improve test suite to avoid some possible race conditions, + test against PHP 7.3 on Travis and + use dedicated `assertInstanceOf()` assertions. + (#185 by @clue, #178 by @WyriHaximus and #181 by @carusogabriel) + +## 1.1.0 (2018-10-01) + +* Feature: Improve error reporting for failed connection attempts and improve + cancellation forwarding during DNS lookup, TCP/IP connection or TLS handshake. + (#168, #169, #170, #171, #176 and #177 by @clue) + + All error messages now always contain a reference to the remote URI to give + more details which connection actually failed and the reason for this error. + Accordingly, failures during DNS lookup will now mention both the remote URI + as well as the DNS error reason. TCP/IP connection issues and errors during + a secure TLS handshake will both mention the remote URI as well as the + underlying socket error. Similarly, lost/dropped connections during a TLS + handshake will now report a lost connection instead of an empty error reason. + + For most common use cases this means that simply reporting the `Exception` + message should give the most relevant details for any connection issues: + + ```php + $promise = $connector->connect('tls://example.com:443'); + $promise->then(function (ConnectionInterface $conn) use ($loop) { + // … + }, function (Exception $e) { + echo $e->getMessage(); + }); + ``` + +## 1.0.0 (2018-07-11) + +* First stable LTS release, now following [SemVer](https://semver.org/). + We'd like to emphasize that this component is production ready and battle-tested. + We plan to support all long-term support (LTS) releases for at least 24 months, + so you have a rock-solid foundation to build on top of. + +> Contains no other changes, so it's actually fully compatible with the v0.8.12 release. + +## 0.8.12 (2018-06-11) + +* Feature: Improve memory consumption for failed and cancelled connection attempts. + (#161 by @clue) + +* Improve test suite to fix Travis config to test against legacy PHP 5.3 again. + (#162 by @clue) + +## 0.8.11 (2018-04-24) + +* Feature: Improve memory consumption for cancelled connection attempts and + simplify skipping DNS lookup when connecting to IP addresses. + (#159 and #160 by @clue) + +## 0.8.10 (2018-02-28) + +* Feature: Update DNS dependency to support loading system default DNS + nameserver config on all supported platforms + (`/etc/resolv.conf` on Unix/Linux/Mac/Docker/WSL and WMIC on Windows) + (#152 by @clue) + + This means that connecting to hosts that are managed by a local DNS server, + such as a corporate DNS server or when using Docker containers, will now + work as expected across all platforms with no changes required: + + ```php + $connector = new Connector($loop); + $connector->connect('intranet.example:80')->then(function ($connection) { + // … + }); + ``` + +## 0.8.9 (2018-01-18) + +* Feature: Support explicitly choosing TLS version to negotiate with remote side + by respecting `crypto_method` context parameter for all classes. + (#149 by @clue) + + By default, all connector and server classes support TLSv1.0+ and exclude + support for legacy SSLv2/SSLv3. As of PHP 5.6+ you can also explicitly + choose the TLS version you want to negotiate with the remote side: + + ```php + // new: now supports 'crypto_method` context parameter for all classes + $connector = new Connector($loop, array( + 'tls' => array( + 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + ) + )); + ``` + +* Minor internal clean up to unify class imports + (#148 by @clue) + +## 0.8.8 (2018-01-06) + +* Improve test suite by adding test group to skip integration tests relying on + internet connection and fix minor documentation typo. + (#146 by @clue and #145 by @cn007b) + +## 0.8.7 (2017-12-24) + +* Fix: Fix closing socket resource before removing from loop + (#141 by @clue) + + This fixes the root cause of an uncaught `Exception` that only manifested + itself after the recent Stream v0.7.4 component update and only if you're + using `ext-event` (`ExtEventLoop`). + +* Improve test suite by testing against PHP 7.2 + (#140 by @carusogabriel) + +## 0.8.6 (2017-11-18) + +* Feature: Add Unix domain socket (UDS) support to `Server` with `unix://` URI scheme + and add advanced `UnixServer` class. + (#120 by @andig) + + ```php + // new: Server now supports "unix://" scheme + $server = new Server('unix:///tmp/server.sock', $loop); + + // new: advanced usage + $server = new UnixServer('/tmp/server.sock', $loop); + ``` + +* Restructure examples to ease getting started + (#136 by @clue) + +* Improve test suite by adding forward compatibility with PHPUnit 6 and + ignore Mac OS X test failures for now until Travis tests work again + (#133 by @gabriel-caruso and #134 by @clue) + +## 0.8.5 (2017-10-23) + +* Fix: Work around PHP bug with Unix domain socket (UDS) paths for Mac OS X + (#123 by @andig) + +* Fix: Fix `SecureServer` to return `null` URI if server socket is already closed + (#129 by @clue) + +* Improve test suite by adding forward compatibility with PHPUnit v5 and + forward compatibility with upcoming EventLoop releases in tests and + test Mac OS X on Travis + (#122 by @andig and #125, #127 and #130 by @clue) + +* Readme improvements + (#118 by @jsor) + +## 0.8.4 (2017-09-16) + +* Feature: Add `FixedUriConnector` decorator to use fixed, preconfigured URI instead + (#117 by @clue) + + This can be useful for consumers that do not support certain URIs, such as + when you want to explicitly connect to a Unix domain socket (UDS) path + instead of connecting to a default address assumed by an higher-level API: + + ```php + $connector = new FixedUriConnector( + 'unix:///var/run/docker.sock', + new UnixConnector($loop) + ); + + // destination will be ignored, actually connects to Unix domain socket + $promise = $connector->connect('localhost:80'); + ``` + +## 0.8.3 (2017-09-08) + +* Feature: Reduce memory consumption for failed connections + (#113 by @valga) + +* Fix: Work around write chunk size for TLS streams for PHP < 7.1.14 + (#114 by @clue) + +## 0.8.2 (2017-08-25) + +* Feature: Update DNS dependency to support hosts file on all platforms + (#112 by @clue) + + This means that connecting to hosts such as `localhost` will now work as + expected across all platforms with no changes required: + + ```php + $connector = new Connector($loop); + $connector->connect('localhost:8080')->then(function ($connection) { + // … + }); + ``` + +## 0.8.1 (2017-08-15) + +* Feature: Forward compatibility with upcoming EventLoop v1.0 and v0.5 and + target evenement 3.0 a long side 2.0 and 1.0 + (#104 by @clue and #111 by @WyriHaximus) + +* Improve test suite by locking Travis distro so new defaults will not break the build and + fix HHVM build for now again and ignore future HHVM build errors + (#109 and #110 by @clue) + +* Minor documentation fixes + (#103 by @christiaan and #108 by @hansott) + +## 0.8.0 (2017-05-09) + +* Feature: New `Server` class now acts as a facade for existing server classes + and renamed old `Server` to `TcpServer` for advanced usage. + (#96 and #97 by @clue) + + The `Server` class is now the main class in this package that implements the + `ServerInterface` and allows you to accept incoming streaming connections, + such as plaintext TCP/IP or secure TLS connection streams. + + > This is not a BC break and consumer code does not have to be updated. + +* Feature / BC break: All addresses are now URIs that include the URI scheme + (#98 by @clue) + + ```diff + - $parts = parse_url('tcp://' . $conn->getRemoteAddress()); + + $parts = parse_url($conn->getRemoteAddress()); + ``` + +* Fix: Fix `unix://` addresses for Unix domain socket (UDS) paths + (#100 by @clue) + +* Feature: Forward compatibility with Stream v1.0 and v0.7 + (#99 by @clue) + +## 0.7.2 (2017-04-24) + +* Fix: Work around latest PHP 7.0.18 and 7.1.4 no longer accepting full URIs + (#94 by @clue) + +## 0.7.1 (2017-04-10) + +* Fix: Ignore HHVM errors when closing connection that is already closing + (#91 by @clue) + +## 0.7.0 (2017-04-10) + +* Feature: Merge SocketClient component into this component + (#87 by @clue) + + This means that this package now provides async, streaming plaintext TCP/IP + and secure TLS socket server and client connections for ReactPHP. + + ``` + $connector = new React\Socket\Connector($loop); + $connector->connect('google.com:80')->then(function (ConnectionInterface $conn) { + $connection->write('…'); + }); + ``` + + Accordingly, the `ConnectionInterface` is now used to represent both incoming + server side connections as well as outgoing client side connections. + + If you've previously used the SocketClient component to establish outgoing + client connections, upgrading should take no longer than a few minutes. + All classes have been merged as-is from the latest `v0.7.0` release with no + other changes, so you can simply update your code to use the updated namespace + like this: + + ```php + // old from SocketClient component and namespace + $connector = new React\SocketClient\Connector($loop); + $connector->connect('google.com:80')->then(function (ConnectionInterface $conn) { + $connection->write('…'); + }); + + // new + $connector = new React\Socket\Connector($loop); + $connector->connect('google.com:80')->then(function (ConnectionInterface $conn) { + $connection->write('…'); + }); + ``` + +## 0.6.0 (2017-04-04) + +* Feature: Add `LimitingServer` to limit and keep track of open connections + (#86 by @clue) + + ```php + $server = new Server(0, $loop); + $server = new LimitingServer($server, 100); + + $server->on('connection', function (ConnectionInterface $connection) { + $connection->write('hello there!' . PHP_EOL); + … + }); + ``` + +* Feature / BC break: Add `pause()` and `resume()` methods to limit active + connections + (#84 by @clue) + + ```php + $server = new Server(0, $loop); + $server->pause(); + + $loop->addTimer(1.0, function() use ($server) { + $server->resume(); + }); + ``` + +## 0.5.1 (2017-03-09) + +* Feature: Forward compatibility with Stream v0.5 and upcoming v0.6 + (#79 by @clue) + +## 0.5.0 (2017-02-14) + +* Feature / BC break: Replace `listen()` call with URIs passed to constructor + and reject listening on hostnames with `InvalidArgumentException` + and replace `ConnectionException` with `RuntimeException` for consistency + (#61, #66 and #72 by @clue) + + ```php + // old + $server = new Server($loop); + $server->listen(8080); + + // new + $server = new Server(8080, $loop); + ``` + + Similarly, you can now pass a full listening URI to the constructor to change + the listening host: + + ```php + // old + $server = new Server($loop); + $server->listen(8080, '127.0.0.1'); + + // new + $server = new Server('127.0.0.1:8080', $loop); + ``` + + Trying to start listening on (DNS) host names will now throw an + `InvalidArgumentException`, use IP addresses instead: + + ```php + // old + $server = new Server($loop); + $server->listen(8080, 'localhost'); + + // new + $server = new Server('127.0.0.1:8080', $loop); + ``` + + If trying to listen fails (such as if port is already in use or port below + 1024 may require root access etc.), it will now throw a `RuntimeException`, + the `ConnectionException` class has been removed: + + ```php + // old: throws React\Socket\ConnectionException + $server = new Server($loop); + $server->listen(80); + + // new: throws RuntimeException + $server = new Server(80, $loop); + ``` + +* Feature / BC break: Rename `shutdown()` to `close()` for consistency throughout React + (#62 by @clue) + + ```php + // old + $server->shutdown(); + + // new + $server->close(); + ``` + +* Feature / BC break: Replace `getPort()` with `getAddress()` + (#67 by @clue) + + ```php + // old + echo $server->getPort(); // 8080 + + // new + echo $server->getAddress(); // 127.0.0.1:8080 + ``` + +* Feature / BC break: `getRemoteAddress()` returns full address instead of only IP + (#65 by @clue) + + ```php + // old + echo $connection->getRemoteAddress(); // 192.168.0.1 + + // new + echo $connection->getRemoteAddress(); // 192.168.0.1:51743 + ``` + +* Feature / BC break: Add `getLocalAddress()` method + (#68 by @clue) + + ```php + echo $connection->getLocalAddress(); // 127.0.0.1:8080 + ``` + +* BC break: The `Server` and `SecureServer` class are now marked `final` + and you can no longer `extend` them + (which was never documented or recommended anyway). + Public properties and event handlers are now internal only. + Please use composition instead of extension. + (#71, #70 and #69 by @clue) + +## 0.4.6 (2017-01-26) + +* Feature: Support socket context options passed to `Server` + (#64 by @clue) + +* Fix: Properly return `null` for unknown addresses + (#63 by @clue) + +* Improve documentation for `ServerInterface` and lock test suite requirements + (#60 by @clue, #57 by @shaunbramley) + +## 0.4.5 (2017-01-08) + +* Feature: Add `SecureServer` for secure TLS connections + (#55 by @clue) + +* Add functional integration tests + (#54 by @clue) + +## 0.4.4 (2016-12-19) + +* Feature / Fix: `ConnectionInterface` should extend `DuplexStreamInterface` + documentation + (#50 by @clue) + +* Feature / Fix: Improve test suite and switch to normal stream handler + (#51 by @clue) + +* Feature: Add examples + (#49 by @clue) + +## 0.4.3 (2016-03-01) + +* Bug fix: Suppress errors on stream_socket_accept to prevent PHP from crashing +* Support for PHP7 and HHVM +* Support PHP 5.3 again + +## 0.4.2 (2014-05-25) + +* Verify stream is a valid resource in Connection + +## 0.4.1 (2014-04-13) + +* Bug fix: Check read buffer for data before shutdown signal and end emit (@ArtyDev) +* Bug fix: v0.3.4 changes merged for v0.4.1 + +## 0.3.4 (2014-03-30) + +* Bug fix: Reset socket to non-blocking after shutting down (PHP bug) + +## 0.4.0 (2014-02-02) + +* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks +* BC break: Update to React/Promise 2.0 +* BC break: Update to Evenement 2.0 +* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0 +* Bump React dependencies to v0.4 + +## 0.3.3 (2013-07-08) + +* Version bump + +## 0.3.2 (2013-05-10) + +* Version bump + +## 0.3.1 (2013-04-21) + +* Feature: Support binding to IPv6 addresses (@clue) + +## 0.3.0 (2013-04-14) + +* Bump React dependencies to v0.3 + +## 0.2.6 (2012-12-26) + +* Version bump + +## 0.2.3 (2012-11-14) + +* Version bump + +## 0.2.0 (2012-09-10) + +* Bump React dependencies to v0.2 + +## 0.1.1 (2012-07-12) + +* Version bump + +## 0.1.0 (2012-07-11) + +* First tagged release diff --git a/tools/php-cs-fixer/vendor/react/socket/LICENSE b/tools/php-cs-fixer/vendor/react/socket/LICENSE new file mode 100644 index 00000000..d6f8901f --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/socket/README.md b/tools/php-cs-fixer/vendor/react/socket/README.md new file mode 100644 index 00000000..e77e6764 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/README.md @@ -0,0 +1,1564 @@ +# Socket + +[![CI status](https://github.com/reactphp/socket/workflows/CI/badge.svg)](https://github.com/reactphp/socket/actions) +[![installs on Packagist](https://img.shields.io/packagist/dt/react/socket?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/socket) + +Async, streaming plaintext TCP/IP and secure TLS socket server and client +connections for [ReactPHP](https://reactphp.org/). + +The socket library provides re-usable interfaces for a socket-layer +server and client based on the [`EventLoop`](https://github.com/reactphp/event-loop) +and [`Stream`](https://github.com/reactphp/stream) components. +Its server component allows you to build networking servers that accept incoming +connections from networking clients (such as an HTTP server). +Its client component allows you to build networking clients that establish +outgoing connections to networking servers (such as an HTTP or database client). +This library provides async, streaming means for all of this, so you can +handle multiple concurrent connections without blocking. + +**Table of Contents** + +* [Quickstart example](#quickstart-example) +* [Connection usage](#connection-usage) + * [ConnectionInterface](#connectioninterface) + * [getRemoteAddress()](#getremoteaddress) + * [getLocalAddress()](#getlocaladdress) +* [Server usage](#server-usage) + * [ServerInterface](#serverinterface) + * [connection event](#connection-event) + * [error event](#error-event) + * [getAddress()](#getaddress) + * [pause()](#pause) + * [resume()](#resume) + * [close()](#close) + * [SocketServer](#socketserver) + * [Advanced server usage](#advanced-server-usage) + * [TcpServer](#tcpserver) + * [SecureServer](#secureserver) + * [UnixServer](#unixserver) + * [LimitingServer](#limitingserver) + * [getConnections()](#getconnections) +* [Client usage](#client-usage) + * [ConnectorInterface](#connectorinterface) + * [connect()](#connect) + * [Connector](#connector) + * [Advanced client usage](#advanced-client-usage) + * [TcpConnector](#tcpconnector) + * [HappyEyeBallsConnector](#happyeyeballsconnector) + * [DnsConnector](#dnsconnector) + * [SecureConnector](#secureconnector) + * [TimeoutConnector](#timeoutconnector) + * [UnixConnector](#unixconnector) + * [FixUriConnector](#fixeduriconnector) +* [Install](#install) +* [Tests](#tests) +* [License](#license) + +## Quickstart example + +Here is a server that closes the connection if you send it anything: + +```php +$socket = new React\Socket\SocketServer('127.0.0.1:8080'); + +$socket->on('connection', function (React\Socket\ConnectionInterface $connection) { + $connection->write("Hello " . $connection->getRemoteAddress() . "!\n"); + $connection->write("Welcome to this amazing server!\n"); + $connection->write("Here's a tip: don't say anything.\n"); + + $connection->on('data', function ($data) use ($connection) { + $connection->close(); + }); +}); +``` + +See also the [examples](examples). + +Here's a client that outputs the output of said server and then attempts to +send it a string: + +```php +$connector = new React\Socket\Connector(); + +$connector->connect('127.0.0.1:8080')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->pipe(new React\Stream\WritableResourceStream(STDOUT)); + $connection->write("Hello World!\n"); +}, function (Exception $e) { + echo 'Error: ' . $e->getMessage() . PHP_EOL; +}); +``` + +## Connection usage + +### ConnectionInterface + +The `ConnectionInterface` is used to represent any incoming and outgoing +connection, such as a normal TCP/IP connection. + +An incoming or outgoing connection is a duplex stream (both readable and +writable) that implements React's +[`DuplexStreamInterface`](https://github.com/reactphp/stream#duplexstreaminterface). +It contains additional properties for the local and remote address (client IP) +where this connection has been established to/from. + +Most commonly, instances implementing this `ConnectionInterface` are emitted +by all classes implementing the [`ServerInterface`](#serverinterface) and +used by all classes implementing the [`ConnectorInterface`](#connectorinterface). + +Because the `ConnectionInterface` implements the underlying +[`DuplexStreamInterface`](https://github.com/reactphp/stream#duplexstreaminterface) +you can use any of its events and methods as usual: + +```php +$connection->on('data', function ($chunk) { + echo $chunk; +}); + +$connection->on('end', function () { + echo 'ended'; +}); + +$connection->on('error', function (Exception $e) { + echo 'error: ' . $e->getMessage(); +}); + +$connection->on('close', function () { + echo 'closed'; +}); + +$connection->write($data); +$connection->end($data = null); +$connection->close(); +// … +``` + +For more details, see the +[`DuplexStreamInterface`](https://github.com/reactphp/stream#duplexstreaminterface). + +#### getRemoteAddress() + +The `getRemoteAddress(): ?string` method returns the full remote address +(URI) where this connection has been established with. + +```php +$address = $connection->getRemoteAddress(); +echo 'Connection with ' . $address . PHP_EOL; +``` + +If the remote address can not be determined or is unknown at this time (such as +after the connection has been closed), it MAY return a `NULL` value instead. + +Otherwise, it will return the full address (URI) as a string value, such +as `tcp://127.0.0.1:8080`, `tcp://[::1]:80`, `tls://127.0.0.1:443`, +`unix://example.sock` or `unix:///path/to/example.sock`. +Note that individual URI components are application specific and depend +on the underlying transport protocol. + +If this is a TCP/IP based connection and you only want the remote IP, you may +use something like this: + +```php +$address = $connection->getRemoteAddress(); +$ip = trim(parse_url($address, PHP_URL_HOST), '[]'); +echo 'Connection with ' . $ip . PHP_EOL; +``` + +#### getLocalAddress() + +The `getLocalAddress(): ?string` method returns the full local address +(URI) where this connection has been established with. + +```php +$address = $connection->getLocalAddress(); +echo 'Connection with ' . $address . PHP_EOL; +``` + +If the local address can not be determined or is unknown at this time (such as +after the connection has been closed), it MAY return a `NULL` value instead. + +Otherwise, it will return the full address (URI) as a string value, such +as `tcp://127.0.0.1:8080`, `tcp://[::1]:80`, `tls://127.0.0.1:443`, +`unix://example.sock` or `unix:///path/to/example.sock`. +Note that individual URI components are application specific and depend +on the underlying transport protocol. + +This method complements the [`getRemoteAddress()`](#getremoteaddress) method, +so they should not be confused. + +If your `TcpServer` instance is listening on multiple interfaces (e.g. using +the address `0.0.0.0`), you can use this method to find out which interface +actually accepted this connection (such as a public or local interface). + +If your system has multiple interfaces (e.g. a WAN and a LAN interface), +you can use this method to find out which interface was actually +used for this connection. + +## Server usage + +### ServerInterface + +The `ServerInterface` is responsible for providing an interface for accepting +incoming streaming connections, such as a normal TCP/IP connection. + +Most higher-level components (such as a HTTP server) accept an instance +implementing this interface to accept incoming streaming connections. +This is usually done via dependency injection, so it's fairly simple to actually +swap this implementation against any other implementation of this interface. +This means that you SHOULD typehint against this interface instead of a concrete +implementation of this interface. + +Besides defining a few methods, this interface also implements the +[`EventEmitterInterface`](https://github.com/igorw/evenement) +which allows you to react to certain events. + +#### connection event + +The `connection` event will be emitted whenever a new connection has been +established, i.e. a new client connects to this server socket: + +```php +$socket->on('connection', function (React\Socket\ConnectionInterface $connection) { + echo 'new connection' . PHP_EOL; +}); +``` + +See also the [`ConnectionInterface`](#connectioninterface) for more details +about handling the incoming connection. + +#### error event + +The `error` event will be emitted whenever there's an error accepting a new +connection from a client. + +```php +$socket->on('error', function (Exception $e) { + echo 'error: ' . $e->getMessage() . PHP_EOL; +}); +``` + +Note that this is not a fatal error event, i.e. the server keeps listening for +new connections even after this event. + +#### getAddress() + +The `getAddress(): ?string` method can be used to +return the full address (URI) this server is currently listening on. + +```php +$address = $socket->getAddress(); +echo 'Server listening on ' . $address . PHP_EOL; +``` + +If the address can not be determined or is unknown at this time (such as +after the socket has been closed), it MAY return a `NULL` value instead. + +Otherwise, it will return the full address (URI) as a string value, such +as `tcp://127.0.0.1:8080`, `tcp://[::1]:80`, `tls://127.0.0.1:443` +`unix://example.sock` or `unix:///path/to/example.sock`. +Note that individual URI components are application specific and depend +on the underlying transport protocol. + +If this is a TCP/IP based server and you only want the local port, you may +use something like this: + +```php +$address = $socket->getAddress(); +$port = parse_url($address, PHP_URL_PORT); +echo 'Server listening on port ' . $port . PHP_EOL; +``` + +#### pause() + +The `pause(): void` method can be used to +pause accepting new incoming connections. + +Removes the socket resource from the EventLoop and thus stop accepting +new connections. Note that the listening socket stays active and is not +closed. + +This means that new incoming connections will stay pending in the +operating system backlog until its configurable backlog is filled. +Once the backlog is filled, the operating system may reject further +incoming connections until the backlog is drained again by resuming +to accept new connections. + +Once the server is paused, no futher `connection` events SHOULD +be emitted. + +```php +$socket->pause(); + +$socket->on('connection', assertShouldNeverCalled()); +``` + +This method is advisory-only, though generally not recommended, the +server MAY continue emitting `connection` events. + +Unless otherwise noted, a successfully opened server SHOULD NOT start +in paused state. + +You can continue processing events by calling `resume()` again. + +Note that both methods can be called any number of times, in particular +calling `pause()` more than once SHOULD NOT have any effect. +Similarly, calling this after `close()` is a NO-OP. + +#### resume() + +The `resume(): void` method can be used to +resume accepting new incoming connections. + +Re-attach the socket resource to the EventLoop after a previous `pause()`. + +```php +$socket->pause(); + +Loop::addTimer(1.0, function () use ($socket) { + $socket->resume(); +}); +``` + +Note that both methods can be called any number of times, in particular +calling `resume()` without a prior `pause()` SHOULD NOT have any effect. +Similarly, calling this after `close()` is a NO-OP. + +#### close() + +The `close(): void` method can be used to +shut down this listening socket. + +This will stop listening for new incoming connections on this socket. + +```php +echo 'Shutting down server socket' . PHP_EOL; +$socket->close(); +``` + +Calling this method more than once on the same instance is a NO-OP. + +### SocketServer + + + +The `SocketServer` class is the main class in this package that implements the +[`ServerInterface`](#serverinterface) and allows you to accept incoming +streaming connections, such as plaintext TCP/IP or secure TLS connection streams. + +In order to accept plaintext TCP/IP connections, you can simply pass a host +and port combination like this: + +```php +$socket = new React\Socket\SocketServer('127.0.0.1:8080'); +``` + +Listening on the localhost address `127.0.0.1` means it will not be reachable from +outside of this system. +In order to change the host the socket is listening on, you can provide an IP +address of an interface or use the special `0.0.0.0` address to listen on all +interfaces: + +```php +$socket = new React\Socket\SocketServer('0.0.0.0:8080'); +``` + +If you want to listen on an IPv6 address, you MUST enclose the host in square +brackets: + +```php +$socket = new React\Socket\SocketServer('[::1]:8080'); +``` + +In order to use a random port assignment, you can use the port `0`: + +```php +$socket = new React\Socket\SocketServer('127.0.0.1:0'); +$address = $socket->getAddress(); +``` + +To listen on a Unix domain socket (UDS) path, you MUST prefix the URI with the +`unix://` scheme: + +```php +$socket = new React\Socket\SocketServer('unix:///tmp/server.sock'); +``` + +In order to listen on an existing file descriptor (FD) number, you MUST prefix +the URI with `php://fd/` like this: + +```php +$socket = new React\Socket\SocketServer('php://fd/3'); +``` + +If the given URI is invalid, does not contain a port, any other scheme or if it +contains a hostname, it will throw an `InvalidArgumentException`: + +```php +// throws InvalidArgumentException due to missing port +$socket = new React\Socket\SocketServer('127.0.0.1'); +``` + +If the given URI appears to be valid, but listening on it fails (such as if port +is already in use or port below 1024 may require root access etc.), it will +throw a `RuntimeException`: + +```php +$first = new React\Socket\SocketServer('127.0.0.1:8080'); + +// throws RuntimeException because port is already in use +$second = new React\Socket\SocketServer('127.0.0.1:8080'); +``` + +> Note that these error conditions may vary depending on your system and/or + configuration. + See the exception message and code for more details about the actual error + condition. + +Optionally, you can specify [TCP socket context options](https://www.php.net/manual/en/context.socket.php) +for the underlying stream socket resource like this: + +```php +$socket = new React\Socket\SocketServer('[::1]:8080', array( + 'tcp' => array( + 'backlog' => 200, + 'so_reuseport' => true, + 'ipv6_v6only' => true + ) +)); +``` + +> Note that available [socket context options](https://www.php.net/manual/en/context.socket.php), + their defaults and effects of changing these may vary depending on your system + and/or PHP version. + Passing unknown context options has no effect. + The `backlog` context option defaults to `511` unless given explicitly. + +You can start a secure TLS (formerly known as SSL) server by simply prepending +the `tls://` URI scheme. +Internally, it will wait for plaintext TCP/IP connections and then performs a +TLS handshake for each connection. +It thus requires valid [TLS context options](https://www.php.net/manual/en/context.ssl.php), +which in its most basic form may look something like this if you're using a +PEM encoded certificate file: + +```php +$socket = new React\Socket\SocketServer('tls://127.0.0.1:8080', array( + 'tls' => array( + 'local_cert' => 'server.pem' + ) +)); +``` + +> Note that the certificate file will not be loaded on instantiation but when an + incoming connection initializes its TLS context. + This implies that any invalid certificate file paths or contents will only cause + an `error` event at a later time. + +If your private key is encrypted with a passphrase, you have to specify it +like this: + +```php +$socket = new React\Socket\SocketServer('tls://127.0.0.1:8000', array( + 'tls' => array( + 'local_cert' => 'server.pem', + 'passphrase' => 'secret' + ) +)); +``` + +By default, this server supports TLSv1.0+ and excludes support for legacy +SSLv2/SSLv3. As of PHP 5.6+ you can also explicitly choose the TLS version you +want to negotiate with the remote side: + +```php +$socket = new React\Socket\SocketServer('tls://127.0.0.1:8000', array( + 'tls' => array( + 'local_cert' => 'server.pem', + 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_SERVER + ) +)); +``` + +> Note that available [TLS context options](https://www.php.net/manual/en/context.ssl.php), + their defaults and effects of changing these may vary depending on your system + and/or PHP version. + The outer context array allows you to also use `tcp` (and possibly more) + context options at the same time. + Passing unknown context options has no effect. + If you do not use the `tls://` scheme, then passing `tls` context options + has no effect. + +Whenever a client connects, it will emit a `connection` event with a connection +instance implementing [`ConnectionInterface`](#connectioninterface): + +```php +$socket->on('connection', function (React\Socket\ConnectionInterface $connection) { + echo 'Plaintext connection from ' . $connection->getRemoteAddress() . PHP_EOL; + + $connection->write('hello there!' . PHP_EOL); + … +}); +``` + +See also the [`ServerInterface`](#serverinterface) for more details. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +> Note that the `SocketServer` class is a concrete implementation for TCP/IP sockets. + If you want to typehint in your higher-level protocol implementation, you SHOULD + use the generic [`ServerInterface`](#serverinterface) instead. + +> Changelog v1.9.0: This class has been added with an improved constructor signature + as a replacement for the previous `Server` class in order to avoid any ambiguities. + The previous name has been deprecated and should not be used anymore. + +### Advanced server usage + +#### TcpServer + +The `TcpServer` class implements the [`ServerInterface`](#serverinterface) and +is responsible for accepting plaintext TCP/IP connections. + +```php +$server = new React\Socket\TcpServer(8080); +``` + +As above, the `$uri` parameter can consist of only a port, in which case the +server will default to listening on the localhost address `127.0.0.1`, +which means it will not be reachable from outside of this system. + +In order to use a random port assignment, you can use the port `0`: + +```php +$server = new React\Socket\TcpServer(0); +$address = $server->getAddress(); +``` + +In order to change the host the socket is listening on, you can provide an IP +address through the first parameter provided to the constructor, optionally +preceded by the `tcp://` scheme: + +```php +$server = new React\Socket\TcpServer('192.168.0.1:8080'); +``` + +If you want to listen on an IPv6 address, you MUST enclose the host in square +brackets: + +```php +$server = new React\Socket\TcpServer('[::1]:8080'); +``` + +If the given URI is invalid, does not contain a port, any other scheme or if it +contains a hostname, it will throw an `InvalidArgumentException`: + +```php +// throws InvalidArgumentException due to missing port +$server = new React\Socket\TcpServer('127.0.0.1'); +``` + +If the given URI appears to be valid, but listening on it fails (such as if port +is already in use or port below 1024 may require root access etc.), it will +throw a `RuntimeException`: + +```php +$first = new React\Socket\TcpServer(8080); + +// throws RuntimeException because port is already in use +$second = new React\Socket\TcpServer(8080); +``` + +> Note that these error conditions may vary depending on your system and/or +configuration. +See the exception message and code for more details about the actual error +condition. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +Optionally, you can specify [socket context options](https://www.php.net/manual/en/context.socket.php) +for the underlying stream socket resource like this: + +```php +$server = new React\Socket\TcpServer('[::1]:8080', null, array( + 'backlog' => 200, + 'so_reuseport' => true, + 'ipv6_v6only' => true +)); +``` + +> Note that available [socket context options](https://www.php.net/manual/en/context.socket.php), +their defaults and effects of changing these may vary depending on your system +and/or PHP version. +Passing unknown context options has no effect. +The `backlog` context option defaults to `511` unless given explicitly. + +Whenever a client connects, it will emit a `connection` event with a connection +instance implementing [`ConnectionInterface`](#connectioninterface): + +```php +$server->on('connection', function (React\Socket\ConnectionInterface $connection) { + echo 'Plaintext connection from ' . $connection->getRemoteAddress() . PHP_EOL; + + $connection->write('hello there!' . PHP_EOL); + … +}); +``` + +See also the [`ServerInterface`](#serverinterface) for more details. + +#### SecureServer + +The `SecureServer` class implements the [`ServerInterface`](#serverinterface) +and is responsible for providing a secure TLS (formerly known as SSL) server. + +It does so by wrapping a [`TcpServer`](#tcpserver) instance which waits for plaintext +TCP/IP connections and then performs a TLS handshake for each connection. +It thus requires valid [TLS context options](https://www.php.net/manual/en/context.ssl.php), +which in its most basic form may look something like this if you're using a +PEM encoded certificate file: + +```php +$server = new React\Socket\TcpServer(8000); +$server = new React\Socket\SecureServer($server, null, array( + 'local_cert' => 'server.pem' +)); +``` + +> Note that the certificate file will not be loaded on instantiation but when an +incoming connection initializes its TLS context. +This implies that any invalid certificate file paths or contents will only cause +an `error` event at a later time. + +If your private key is encrypted with a passphrase, you have to specify it +like this: + +```php +$server = new React\Socket\TcpServer(8000); +$server = new React\Socket\SecureServer($server, null, array( + 'local_cert' => 'server.pem', + 'passphrase' => 'secret' +)); +``` + +By default, this server supports TLSv1.0+ and excludes support for legacy +SSLv2/SSLv3. As of PHP 5.6+ you can also explicitly choose the TLS version you +want to negotiate with the remote side: + +```php +$server = new React\Socket\TcpServer(8000); +$server = new React\Socket\SecureServer($server, null, array( + 'local_cert' => 'server.pem', + 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_SERVER +)); +``` + +> Note that available [TLS context options](https://www.php.net/manual/en/context.ssl.php), +their defaults and effects of changing these may vary depending on your system +and/or PHP version. +Passing unknown context options has no effect. + +Whenever a client completes the TLS handshake, it will emit a `connection` event +with a connection instance implementing [`ConnectionInterface`](#connectioninterface): + +```php +$server->on('connection', function (React\Socket\ConnectionInterface $connection) { + echo 'Secure connection from' . $connection->getRemoteAddress() . PHP_EOL; + + $connection->write('hello there!' . PHP_EOL); + … +}); +``` + +Whenever a client fails to perform a successful TLS handshake, it will emit an +`error` event and then close the underlying TCP/IP connection: + +```php +$server->on('error', function (Exception $e) { + echo 'Error' . $e->getMessage() . PHP_EOL; +}); +``` + +See also the [`ServerInterface`](#serverinterface) for more details. + +Note that the `SecureServer` class is a concrete implementation for TLS sockets. +If you want to typehint in your higher-level protocol implementation, you SHOULD +use the generic [`ServerInterface`](#serverinterface) instead. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +> Advanced usage: Despite allowing any `ServerInterface` as first parameter, +you SHOULD pass a `TcpServer` instance as first parameter, unless you +know what you're doing. +Internally, the `SecureServer` has to set the required TLS context options on +the underlying stream resources. +These resources are not exposed through any of the interfaces defined in this +package, but only through the internal `Connection` class. +The `TcpServer` class is guaranteed to emit connections that implement +the `ConnectionInterface` and uses the internal `Connection` class in order to +expose these underlying resources. +If you use a custom `ServerInterface` and its `connection` event does not +meet this requirement, the `SecureServer` will emit an `error` event and +then close the underlying connection. + +#### UnixServer + +The `UnixServer` class implements the [`ServerInterface`](#serverinterface) and +is responsible for accepting connections on Unix domain sockets (UDS). + +```php +$server = new React\Socket\UnixServer('/tmp/server.sock'); +``` + +As above, the `$uri` parameter can consist of only a socket path or socket path +prefixed by the `unix://` scheme. + +If the given URI appears to be valid, but listening on it fails (such as if the +socket is already in use or the file not accessible etc.), it will throw a +`RuntimeException`: + +```php +$first = new React\Socket\UnixServer('/tmp/same.sock'); + +// throws RuntimeException because socket is already in use +$second = new React\Socket\UnixServer('/tmp/same.sock'); +``` + +> Note that these error conditions may vary depending on your system and/or + configuration. + In particular, Zend PHP does only report "Unknown error" when the UDS path + already exists and can not be bound. You may want to check `is_file()` on the + given UDS path to report a more user-friendly error message in this case. + See the exception message and code for more details about the actual error + condition. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +Whenever a client connects, it will emit a `connection` event with a connection +instance implementing [`ConnectionInterface`](#connectioninterface): + +```php +$server->on('connection', function (React\Socket\ConnectionInterface $connection) { + echo 'New connection' . PHP_EOL; + + $connection->write('hello there!' . PHP_EOL); + … +}); +``` + +See also the [`ServerInterface`](#serverinterface) for more details. + +#### LimitingServer + +The `LimitingServer` decorator wraps a given `ServerInterface` and is responsible +for limiting and keeping track of open connections to this server instance. + +Whenever the underlying server emits a `connection` event, it will check its +limits and then either + - keep track of this connection by adding it to the list of + open connections and then forward the `connection` event + - or reject (close) the connection when its limits are exceeded and will + forward an `error` event instead. + +Whenever a connection closes, it will remove this connection from the list of +open connections. + +```php +$server = new React\Socket\LimitingServer($server, 100); +$server->on('connection', function (React\Socket\ConnectionInterface $connection) { + $connection->write('hello there!' . PHP_EOL); + … +}); +``` + +See also the [second example](examples) for more details. + +You have to pass a maximum number of open connections to ensure +the server will automatically reject (close) connections once this limit +is exceeded. In this case, it will emit an `error` event to inform about +this and no `connection` event will be emitted. + +```php +$server = new React\Socket\LimitingServer($server, 100); +$server->on('connection', function (React\Socket\ConnectionInterface $connection) { + $connection->write('hello there!' . PHP_EOL); + … +}); +``` + +You MAY pass a `null` limit in order to put no limit on the number of +open connections and keep accepting new connection until you run out of +operating system resources (such as open file handles). This may be +useful if you do not want to take care of applying a limit but still want +to use the `getConnections()` method. + +You can optionally configure the server to pause accepting new +connections once the connection limit is reached. In this case, it will +pause the underlying server and no longer process any new connections at +all, thus also no longer closing any excessive connections. +The underlying operating system is responsible for keeping a backlog of +pending connections until its limit is reached, at which point it will +start rejecting further connections. +Once the server is below the connection limit, it will continue consuming +connections from the backlog and will process any outstanding data on +each connection. +This mode may be useful for some protocols that are designed to wait for +a response message (such as HTTP), but may be less useful for other +protocols that demand immediate responses (such as a "welcome" message in +an interactive chat). + +```php +$server = new React\Socket\LimitingServer($server, 100, true); +$server->on('connection', function (React\Socket\ConnectionInterface $connection) { + $connection->write('hello there!' . PHP_EOL); + … +}); +``` + +##### getConnections() + +The `getConnections(): ConnectionInterface[]` method can be used to +return an array with all currently active connections. + +```php +foreach ($server->getConnection() as $connection) { + $connection->write('Hi!'); +} +``` + +## Client usage + +### ConnectorInterface + +The `ConnectorInterface` is responsible for providing an interface for +establishing streaming connections, such as a normal TCP/IP connection. + +This is the main interface defined in this package and it is used throughout +React's vast ecosystem. + +Most higher-level components (such as HTTP, database or other networking +service clients) accept an instance implementing this interface to create their +TCP/IP connection to the underlying networking service. +This is usually done via dependency injection, so it's fairly simple to actually +swap this implementation against any other implementation of this interface. + +The interface only offers a single method: + +#### connect() + +The `connect(string $uri): PromiseInterface` method can be used to +create a streaming connection to the given remote address. + +It returns a [Promise](https://github.com/reactphp/promise) which either +fulfills with a stream implementing [`ConnectionInterface`](#connectioninterface) +on success or rejects with an `Exception` if the connection is not successful: + +```php +$connector->connect('google.com:443')->then( + function (React\Socket\ConnectionInterface $connection) { + // connection successfully established + }, + function (Exception $error) { + // failed to connect due to $error + } +); +``` + +See also [`ConnectionInterface`](#connectioninterface) for more details. + +The returned Promise MUST be implemented in such a way that it can be +cancelled when it is still pending. Cancelling a pending promise MUST +reject its value with an `Exception`. It SHOULD clean up any underlying +resources and references as applicable: + +```php +$promise = $connector->connect($uri); + +$promise->cancel(); +``` + +### Connector + +The `Connector` class is the main class in this package that implements the +[`ConnectorInterface`](#connectorinterface) and allows you to create streaming connections. + +You can use this connector to create any kind of streaming connections, such +as plaintext TCP/IP, secure TLS or local Unix connection streams. + +It binds to the main event loop and can be used like this: + +```php +$connector = new React\Socket\Connector(); + +$connector->connect($uri)->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}, function (Exception $e) { + echo 'Error: ' . $e->getMessage() . PHP_EOL; +}); +``` + +In order to create a plaintext TCP/IP connection, you can simply pass a host +and port combination like this: + +```php +$connector->connect('www.google.com:80')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +> If you do no specify a URI scheme in the destination URI, it will assume + `tcp://` as a default and establish a plaintext TCP/IP connection. + Note that TCP/IP connections require a host and port part in the destination + URI like above, all other URI components are optional. + +In order to create a secure TLS connection, you can use the `tls://` URI scheme +like this: + +```php +$connector->connect('tls://www.google.com:443')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +In order to create a local Unix domain socket connection, you can use the +`unix://` URI scheme like this: + +```php +$connector->connect('unix:///tmp/demo.sock')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +> The [`getRemoteAddress()`](#getremoteaddress) method will return the target + Unix domain socket (UDS) path as given to the `connect()` method, including + the `unix://` scheme, for example `unix:///tmp/demo.sock`. + The [`getLocalAddress()`](#getlocaladdress) method will most likely return a + `null` value as this value is not applicable to UDS connections here. + +Under the hood, the `Connector` is implemented as a *higher-level facade* +for the lower-level connectors implemented in this package. This means it +also shares all of their features and implementation details. +If you want to typehint in your higher-level protocol implementation, you SHOULD +use the generic [`ConnectorInterface`](#connectorinterface) instead. + +As of `v1.4.0`, the `Connector` class defaults to using the +[happy eyeballs algorithm](https://en.wikipedia.org/wiki/Happy_Eyeballs) to +automatically connect over IPv4 or IPv6 when a hostname is given. +This automatically attempts to connect using both IPv4 and IPv6 at the same time +(preferring IPv6), thus avoiding the usual problems faced by users with imperfect +IPv6 connections or setups. +If you want to revert to the old behavior of only doing an IPv4 lookup and +only attempt a single IPv4 connection, you can set up the `Connector` like this: + +```php +$connector = new React\Socket\Connector(array( + 'happy_eyeballs' => false +)); +``` + +Similarly, you can also affect the default DNS behavior as follows. +The `Connector` class will try to detect your system DNS settings (and uses +Google's public DNS server `8.8.8.8` as a fallback if unable to determine your +system settings) to resolve all public hostnames into underlying IP addresses by +default. +If you explicitly want to use a custom DNS server (such as a local DNS relay or +a company wide DNS server), you can set up the `Connector` like this: + +```php +$connector = new React\Socket\Connector(array( + 'dns' => '127.0.1.1' +)); + +$connector->connect('localhost:80')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +If you do not want to use a DNS resolver at all and want to connect to IP +addresses only, you can also set up your `Connector` like this: + +```php +$connector = new React\Socket\Connector(array( + 'dns' => false +)); + +$connector->connect('127.0.0.1:80')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +Advanced: If you need a custom DNS `React\Dns\Resolver\ResolverInterface` instance, you +can also set up your `Connector` like this: + +```php +$dnsResolverFactory = new React\Dns\Resolver\Factory(); +$resolver = $dnsResolverFactory->createCached('127.0.1.1'); + +$connector = new React\Socket\Connector(array( + 'dns' => $resolver +)); + +$connector->connect('localhost:80')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +By default, the `tcp://` and `tls://` URI schemes will use timeout value that +respects your `default_socket_timeout` ini setting (which defaults to 60s). +If you want a custom timeout value, you can simply pass this like this: + +```php +$connector = new React\Socket\Connector(array( + 'timeout' => 10.0 +)); +``` + +Similarly, if you do not want to apply a timeout at all and let the operating +system handle this, you can pass a boolean flag like this: + +```php +$connector = new React\Socket\Connector(array( + 'timeout' => false +)); +``` + +By default, the `Connector` supports the `tcp://`, `tls://` and `unix://` +URI schemes. If you want to explicitly prohibit any of these, you can simply +pass boolean flags like this: + +```php +// only allow secure TLS connections +$connector = new React\Socket\Connector(array( + 'tcp' => false, + 'tls' => true, + 'unix' => false, +)); + +$connector->connect('tls://google.com:443')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +The `tcp://` and `tls://` also accept additional context options passed to +the underlying connectors. +If you want to explicitly pass additional context options, you can simply +pass arrays of context options like this: + +```php +// allow insecure TLS connections +$connector = new React\Socket\Connector(array( + 'tcp' => array( + 'bindto' => '192.168.0.1:0' + ), + 'tls' => array( + 'verify_peer' => false, + 'verify_peer_name' => false + ), +)); + +$connector->connect('tls://localhost:443')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +By default, this connector supports TLSv1.0+ and excludes support for legacy +SSLv2/SSLv3. As of PHP 5.6+ you can also explicitly choose the TLS version you +want to negotiate with the remote side: + +```php +$connector = new React\Socket\Connector(array( + 'tls' => array( + 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + ) +)); +``` + +> For more details about context options, please refer to the PHP documentation + about [socket context options](https://www.php.net/manual/en/context.socket.php) + and [SSL context options](https://www.php.net/manual/en/context.ssl.php). + +Advanced: By default, the `Connector` supports the `tcp://`, `tls://` and +`unix://` URI schemes. +For this, it sets up the required connector classes automatically. +If you want to explicitly pass custom connectors for any of these, you can simply +pass an instance implementing the `ConnectorInterface` like this: + +```php +$dnsResolverFactory = new React\Dns\Resolver\Factory(); +$resolver = $dnsResolverFactory->createCached('127.0.1.1'); +$tcp = new React\Socket\HappyEyeBallsConnector(null, new React\Socket\TcpConnector(), $resolver); + +$tls = new React\Socket\SecureConnector($tcp); + +$unix = new React\Socket\UnixConnector(); + +$connector = new React\Socket\Connector(array( + 'tcp' => $tcp, + 'tls' => $tls, + 'unix' => $unix, + + 'dns' => false, + 'timeout' => false, +)); + +$connector->connect('google.com:80')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +> Internally, the `tcp://` connector will always be wrapped by the DNS resolver, + unless you disable DNS like in the above example. In this case, the `tcp://` + connector receives the actual hostname instead of only the resolved IP address + and is thus responsible for performing the lookup. + Internally, the automatically created `tls://` connector will always wrap the + underlying `tcp://` connector for establishing the underlying plaintext + TCP/IP connection before enabling secure TLS mode. If you want to use a custom + underlying `tcp://` connector for secure TLS connections only, you may + explicitly pass a `tls://` connector like above instead. + Internally, the `tcp://` and `tls://` connectors will always be wrapped by + `TimeoutConnector`, unless you disable timeouts like in the above example. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +> Changelog v1.9.0: The constructur signature has been updated to take the +> optional `$context` as the first parameter and the optional `$loop` as a second +> argument. The previous signature has been deprecated and should not be used anymore. +> +> ```php +> // constructor signature as of v1.9.0 +> $connector = new React\Socket\Connector(array $context = [], ?LoopInterface $loop = null); +> +> // legacy constructor signature before v1.9.0 +> $connector = new React\Socket\Connector(?LoopInterface $loop = null, array $context = []); +> ``` + +### Advanced client usage + +#### TcpConnector + +The `TcpConnector` class implements the +[`ConnectorInterface`](#connectorinterface) and allows you to create plaintext +TCP/IP connections to any IP-port-combination: + +```php +$tcpConnector = new React\Socket\TcpConnector(); + +$tcpConnector->connect('127.0.0.1:80')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +See also the [examples](examples). + +Pending connection attempts can be cancelled by cancelling its pending promise like so: + +```php +$promise = $tcpConnector->connect('127.0.0.1:80'); + +$promise->cancel(); +``` + +Calling `cancel()` on a pending promise will close the underlying socket +resource, thus cancelling the pending TCP/IP connection, and reject the +resulting promise. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +You can optionally pass additional +[socket context options](https://www.php.net/manual/en/context.socket.php) +to the constructor like this: + +```php +$tcpConnector = new React\Socket\TcpConnector(null, array( + 'bindto' => '192.168.0.1:0' +)); +``` + +Note that this class only allows you to connect to IP-port-combinations. +If the given URI is invalid, does not contain a valid IP address and port +or contains any other scheme, it will reject with an +`InvalidArgumentException`: + +If the given URI appears to be valid, but connecting to it fails (such as if +the remote host rejects the connection etc.), it will reject with a +`RuntimeException`. + +If you want to connect to hostname-port-combinations, see also the following chapter. + +> Advanced usage: Internally, the `TcpConnector` allocates an empty *context* +resource for each stream resource. +If the destination URI contains a `hostname` query parameter, its value will +be used to set up the TLS peer name. +This is used by the `SecureConnector` and `DnsConnector` to verify the peer +name and can also be used if you want a custom TLS peer name. + +#### HappyEyeBallsConnector + +The `HappyEyeBallsConnector` class implements the +[`ConnectorInterface`](#connectorinterface) and allows you to create plaintext +TCP/IP connections to any hostname-port-combination. Internally it implements the +happy eyeballs algorithm from [`RFC6555`](https://tools.ietf.org/html/rfc6555) and +[`RFC8305`](https://tools.ietf.org/html/rfc8305) to support IPv6 and IPv4 hostnames. + +It does so by decorating a given `TcpConnector` instance so that it first +looks up the given domain name via DNS (if applicable) and then establishes the +underlying TCP/IP connection to the resolved target IP address. + +Make sure to set up your DNS resolver and underlying TCP connector like this: + +```php +$dnsResolverFactory = new React\Dns\Resolver\Factory(); +$dns = $dnsResolverFactory->createCached('8.8.8.8'); + +$dnsConnector = new React\Socket\HappyEyeBallsConnector(null, $tcpConnector, $dns); + +$dnsConnector->connect('www.google.com:80')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +See also the [examples](examples). + +Pending connection attempts can be cancelled by cancelling its pending promise like so: + +```php +$promise = $dnsConnector->connect('www.google.com:80'); + +$promise->cancel(); +``` + +Calling `cancel()` on a pending promise will cancel the underlying DNS lookups +and/or the underlying TCP/IP connection(s) and reject the resulting promise. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +> Advanced usage: Internally, the `HappyEyeBallsConnector` relies on a `Resolver` to +look up the IP addresses for the given hostname. +It will then replace the hostname in the destination URI with this IP's and +append a `hostname` query parameter and pass this updated URI to the underlying +connector. +The Happy Eye Balls algorithm describes looking the IPv6 and IPv4 address for +the given hostname so this connector sends out two DNS lookups for the A and +AAAA records. It then uses all IP addresses (both v6 and v4) and tries to +connect to all of them with a 50ms interval in between. Alterating between IPv6 +and IPv4 addresses. When a connection is established all the other DNS lookups +and connection attempts are cancelled. + +#### DnsConnector + +The `DnsConnector` class implements the +[`ConnectorInterface`](#connectorinterface) and allows you to create plaintext +TCP/IP connections to any hostname-port-combination. + +It does so by decorating a given `TcpConnector` instance so that it first +looks up the given domain name via DNS (if applicable) and then establishes the +underlying TCP/IP connection to the resolved target IP address. + +Make sure to set up your DNS resolver and underlying TCP connector like this: + +```php +$dnsResolverFactory = new React\Dns\Resolver\Factory(); +$dns = $dnsResolverFactory->createCached('8.8.8.8'); + +$dnsConnector = new React\Socket\DnsConnector($tcpConnector, $dns); + +$dnsConnector->connect('www.google.com:80')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write('...'); + $connection->end(); +}); +``` + +See also the [examples](examples). + +Pending connection attempts can be cancelled by cancelling its pending promise like so: + +```php +$promise = $dnsConnector->connect('www.google.com:80'); + +$promise->cancel(); +``` + +Calling `cancel()` on a pending promise will cancel the underlying DNS lookup +and/or the underlying TCP/IP connection and reject the resulting promise. + +> Advanced usage: Internally, the `DnsConnector` relies on a `React\Dns\Resolver\ResolverInterface` +to look up the IP address for the given hostname. +It will then replace the hostname in the destination URI with this IP and +append a `hostname` query parameter and pass this updated URI to the underlying +connector. +The underlying connector is thus responsible for creating a connection to the +target IP address, while this query parameter can be used to check the original +hostname and is used by the `TcpConnector` to set up the TLS peer name. +If a `hostname` is given explicitly, this query parameter will not be modified, +which can be useful if you want a custom TLS peer name. + +#### SecureConnector + +The `SecureConnector` class implements the +[`ConnectorInterface`](#connectorinterface) and allows you to create secure +TLS (formerly known as SSL) connections to any hostname-port-combination. + +It does so by decorating a given `DnsConnector` instance so that it first +creates a plaintext TCP/IP connection and then enables TLS encryption on this +stream. + +```php +$secureConnector = new React\Socket\SecureConnector($dnsConnector); + +$secureConnector->connect('www.google.com:443')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write("GET / HTTP/1.0\r\nHost: www.google.com\r\n\r\n"); + ... +}); +``` + +See also the [examples](examples). + +Pending connection attempts can be cancelled by cancelling its pending promise like so: + +```php +$promise = $secureConnector->connect('www.google.com:443'); + +$promise->cancel(); +``` + +Calling `cancel()` on a pending promise will cancel the underlying TCP/IP +connection and/or the SSL/TLS negotiation and reject the resulting promise. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +You can optionally pass additional +[SSL context options](https://www.php.net/manual/en/context.ssl.php) +to the constructor like this: + +```php +$secureConnector = new React\Socket\SecureConnector($dnsConnector, null, array( + 'verify_peer' => false, + 'verify_peer_name' => false +)); +``` + +By default, this connector supports TLSv1.0+ and excludes support for legacy +SSLv2/SSLv3. As of PHP 5.6+ you can also explicitly choose the TLS version you +want to negotiate with the remote side: + +```php +$secureConnector = new React\Socket\SecureConnector($dnsConnector, null, array( + 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT +)); +``` + +> Advanced usage: Internally, the `SecureConnector` relies on setting up the +required *context options* on the underlying stream resource. +It should therefor be used with a `TcpConnector` somewhere in the connector +stack so that it can allocate an empty *context* resource for each stream +resource and verify the peer name. +Failing to do so may result in a TLS peer name mismatch error or some hard to +trace race conditions, because all stream resources will use a single, shared +*default context* resource otherwise. + +#### TimeoutConnector + +The `TimeoutConnector` class implements the +[`ConnectorInterface`](#connectorinterface) and allows you to add timeout +handling to any existing connector instance. + +It does so by decorating any given [`ConnectorInterface`](#connectorinterface) +instance and starting a timer that will automatically reject and abort any +underlying connection attempt if it takes too long. + +```php +$timeoutConnector = new React\Socket\TimeoutConnector($connector, 3.0); + +$timeoutConnector->connect('google.com:80')->then(function (React\Socket\ConnectionInterface $connection) { + // connection succeeded within 3.0 seconds +}); +``` + +See also any of the [examples](examples). + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +Pending connection attempts can be cancelled by cancelling its pending promise like so: + +```php +$promise = $timeoutConnector->connect('google.com:80'); + +$promise->cancel(); +``` + +Calling `cancel()` on a pending promise will cancel the underlying connection +attempt, abort the timer and reject the resulting promise. + +#### UnixConnector + +The `UnixConnector` class implements the +[`ConnectorInterface`](#connectorinterface) and allows you to connect to +Unix domain socket (UDS) paths like this: + +```php +$connector = new React\Socket\UnixConnector(); + +$connector->connect('/tmp/demo.sock')->then(function (React\Socket\ConnectionInterface $connection) { + $connection->write("HELLO\n"); +}); +``` + +Connecting to Unix domain sockets is an atomic operation, i.e. its promise will +settle (either resolve or reject) immediately. +As such, calling `cancel()` on the resulting promise has no effect. + +> The [`getRemoteAddress()`](#getremoteaddress) method will return the target + Unix domain socket (UDS) path as given to the `connect()` method, prepended + with the `unix://` scheme, for example `unix:///tmp/demo.sock`. + The [`getLocalAddress()`](#getlocaladdress) method will most likely return a + `null` value as this value is not applicable to UDS connections here. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +#### FixedUriConnector + +The `FixedUriConnector` class implements the +[`ConnectorInterface`](#connectorinterface) and decorates an existing Connector +to always use a fixed, preconfigured URI. + +This can be useful for consumers that do not support certain URIs, such as +when you want to explicitly connect to a Unix domain socket (UDS) path +instead of connecting to a default address assumed by an higher-level API: + +```php +$connector = new React\Socket\FixedUriConnector( + 'unix:///var/run/docker.sock', + new React\Socket\UnixConnector() +); + +// destination will be ignored, actually connects to Unix domain socket +$promise = $connector->connect('localhost:80'); +``` + +## Install + +The recommended way to install this library is [through Composer](https://getcomposer.org/). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) + +This project follows [SemVer](https://semver.org/). +This will install the latest supported version: + +```bash +composer require react/socket:^1.16 +``` + +See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. + +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.3 through current PHP 8+ and HHVM. +It's *highly recommended to use the latest supported PHP version* for this project, +partly due to its vast performance improvements and partly because legacy PHP +versions require several workarounds as described below. + +Secure TLS connections received some major upgrades starting with PHP 5.6, with +the defaults now being more secure, while older versions required explicit +context options. +This library does not take responsibility over these context options, so it's +up to consumers of this library to take care of setting appropriate context +options as described above. + +PHP < 7.3.3 (and PHP < 7.2.15) suffers from a bug where feof() might +block with 100% CPU usage on fragmented TLS records. +We try to work around this by always consuming the complete receive +buffer at once to avoid stale data in TLS buffers. This is known to +work around high CPU usage for well-behaving peers, but this may +cause very large data chunks for high throughput scenarios. The buggy +behavior can still be triggered due to network I/O buffers or +malicious peers on affected versions, upgrading is highly recommended. + +PHP < 7.1.4 (and PHP < 7.0.18) suffers from a bug when writing big +chunks of data over TLS streams at once. +We try to work around this by limiting the write chunk size to 8192 +bytes for older PHP versions only. +This is only a work-around and has a noticable performance penalty on +affected versions. + +This project also supports running on HHVM. +Note that really old HHVM < 3.8 does not support secure TLS connections, as it +lacks the required `stream_socket_enable_crypto()` function. +As such, trying to create a secure TLS connections on affected versions will +return a rejected promise instead. +This issue is also covered by our test suite, which will skip related tests +on affected versions. + +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org/): + +```bash +composer install +``` + +To run the test suite, go to the project root and run: + +```bash +vendor/bin/phpunit +``` + +The test suite also contains a number of functional integration tests that rely +on a stable internet connection. +If you do not want to run these, they can simply be skipped like this: + +```bash +vendor/bin/phpunit --exclude-group internet +``` + +## License + +MIT, see [LICENSE file](LICENSE). diff --git a/tools/php-cs-fixer/vendor/react/socket/composer.json b/tools/php-cs-fixer/vendor/react/socket/composer.json new file mode 100644 index 00000000..b1e1d253 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/composer.json @@ -0,0 +1,52 @@ +{ + "name": "react/socket", + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": ["async", "socket", "stream", "connection", "ReactPHP"], + "license": "MIT", + "authors": [ + { + "name": "Christian Lück", + "homepage": "https://clue.engineering/", + "email": "christian@clue.engineering" + }, + { + "name": "Cees-Jan Kiewiet", + "homepage": "https://wyrihaximus.net/", + "email": "reactphp@ceesjankiewiet.nl" + }, + { + "name": "Jan Sorgalla", + "homepage": "https://sorgalla.com/", + "email": "jsorgalla@gmail.com" + }, + { + "name": "Chris Boden", + "homepage": "https://cboden.dev/", + "email": "cboden@gmail.com" + } + ], + "require": { + "php": ">=5.3.0", + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" + }, + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "React\\Tests\\Socket\\": "tests/" + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/Connection.php b/tools/php-cs-fixer/vendor/react/socket/src/Connection.php new file mode 100644 index 00000000..65ae26b4 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/Connection.php @@ -0,0 +1,183 @@ += 70300 && \PHP_VERSION_ID < 70303); + + // PHP < 7.1.4 (and PHP < 7.0.18) suffers from a bug when writing big + // chunks of data over TLS streams at once. + // We try to work around this by limiting the write chunk size to 8192 + // bytes for older PHP versions only. + // This is only a work-around and has a noticable performance penalty on + // affected versions. Please update your PHP version. + // This applies to all streams because TLS may be enabled later on. + // See https://github.com/reactphp/socket/issues/105 + $limitWriteChunks = (\PHP_VERSION_ID < 70018 || (\PHP_VERSION_ID >= 70100 && \PHP_VERSION_ID < 70104)); + + $this->input = new DuplexResourceStream( + $resource, + $loop, + $clearCompleteBuffer ? -1 : null, + new WritableResourceStream($resource, $loop, null, $limitWriteChunks ? 8192 : null) + ); + + $this->stream = $resource; + + Util::forwardEvents($this->input, $this, array('data', 'end', 'error', 'close', 'pipe', 'drain')); + + $this->input->on('close', array($this, 'close')); + } + + public function isReadable() + { + return $this->input->isReadable(); + } + + public function isWritable() + { + return $this->input->isWritable(); + } + + public function pause() + { + $this->input->pause(); + } + + public function resume() + { + $this->input->resume(); + } + + public function pipe(WritableStreamInterface $dest, array $options = array()) + { + return $this->input->pipe($dest, $options); + } + + public function write($data) + { + return $this->input->write($data); + } + + public function end($data = null) + { + $this->input->end($data); + } + + public function close() + { + $this->input->close(); + $this->handleClose(); + $this->removeAllListeners(); + } + + public function handleClose() + { + if (!\is_resource($this->stream)) { + return; + } + + // Try to cleanly shut down socket and ignore any errors in case other + // side already closed. Underlying Stream implementation will take care + // of closing stream resource, so we otherwise keep this open here. + @\stream_socket_shutdown($this->stream, \STREAM_SHUT_RDWR); + } + + public function getRemoteAddress() + { + if (!\is_resource($this->stream)) { + return null; + } + + return $this->parseAddress(\stream_socket_get_name($this->stream, true)); + } + + public function getLocalAddress() + { + if (!\is_resource($this->stream)) { + return null; + } + + return $this->parseAddress(\stream_socket_get_name($this->stream, false)); + } + + private function parseAddress($address) + { + if ($address === false) { + return null; + } + + if ($this->unix) { + // remove trailing colon from address for HHVM < 3.19: https://3v4l.org/5C1lo + // note that technically ":" is a valid address, so keep this in place otherwise + if (\substr($address, -1) === ':' && \defined('HHVM_VERSION_ID') && \HHVM_VERSION_ID < 31900) { + $address = (string)\substr($address, 0, -1); // @codeCoverageIgnore + } + + // work around unknown addresses should return null value: https://3v4l.org/5C1lo and https://bugs.php.net/bug.php?id=74556 + // PHP uses "\0" string and HHVM uses empty string (colon removed above) + if ($address === '' || $address[0] === "\x00" ) { + return null; // @codeCoverageIgnore + } + + return 'unix://' . $address; + } + + // check if this is an IPv6 address which includes multiple colons but no square brackets + $pos = \strrpos($address, ':'); + if ($pos !== false && \strpos($address, ':') < $pos && \substr($address, 0, 1) !== '[') { + $address = '[' . \substr($address, 0, $pos) . ']:' . \substr($address, $pos + 1); // @codeCoverageIgnore + } + + return ($this->encryptionEnabled ? 'tls' : 'tcp') . '://' . $address; + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/ConnectionInterface.php b/tools/php-cs-fixer/vendor/react/socket/src/ConnectionInterface.php new file mode 100644 index 00000000..64613b58 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/ConnectionInterface.php @@ -0,0 +1,119 @@ +on('data', function ($chunk) { + * echo $chunk; + * }); + * + * $connection->on('end', function () { + * echo 'ended'; + * }); + * + * $connection->on('error', function (Exception $e) { + * echo 'error: ' . $e->getMessage(); + * }); + * + * $connection->on('close', function () { + * echo 'closed'; + * }); + * + * $connection->write($data); + * $connection->end($data = null); + * $connection->close(); + * // … + * ``` + * + * For more details, see the + * [`DuplexStreamInterface`](https://github.com/reactphp/stream#duplexstreaminterface). + * + * @see DuplexStreamInterface + * @see ServerInterface + * @see ConnectorInterface + */ +interface ConnectionInterface extends DuplexStreamInterface +{ + /** + * Returns the full remote address (URI) where this connection has been established with + * + * ```php + * $address = $connection->getRemoteAddress(); + * echo 'Connection with ' . $address . PHP_EOL; + * ``` + * + * If the remote address can not be determined or is unknown at this time (such as + * after the connection has been closed), it MAY return a `NULL` value instead. + * + * Otherwise, it will return the full address (URI) as a string value, such + * as `tcp://127.0.0.1:8080`, `tcp://[::1]:80`, `tls://127.0.0.1:443`, + * `unix://example.sock` or `unix:///path/to/example.sock`. + * Note that individual URI components are application specific and depend + * on the underlying transport protocol. + * + * If this is a TCP/IP based connection and you only want the remote IP, you may + * use something like this: + * + * ```php + * $address = $connection->getRemoteAddress(); + * $ip = trim(parse_url($address, PHP_URL_HOST), '[]'); + * echo 'Connection with ' . $ip . PHP_EOL; + * ``` + * + * @return ?string remote address (URI) or null if unknown + */ + public function getRemoteAddress(); + + /** + * Returns the full local address (full URI with scheme, IP and port) where this connection has been established with + * + * ```php + * $address = $connection->getLocalAddress(); + * echo 'Connection with ' . $address . PHP_EOL; + * ``` + * + * If the local address can not be determined or is unknown at this time (such as + * after the connection has been closed), it MAY return a `NULL` value instead. + * + * Otherwise, it will return the full address (URI) as a string value, such + * as `tcp://127.0.0.1:8080`, `tcp://[::1]:80`, `tls://127.0.0.1:443`, + * `unix://example.sock` or `unix:///path/to/example.sock`. + * Note that individual URI components are application specific and depend + * on the underlying transport protocol. + * + * This method complements the [`getRemoteAddress()`](#getremoteaddress) method, + * so they should not be confused. + * + * If your `TcpServer` instance is listening on multiple interfaces (e.g. using + * the address `0.0.0.0`), you can use this method to find out which interface + * actually accepted this connection (such as a public or local interface). + * + * If your system has multiple interfaces (e.g. a WAN and a LAN interface), + * you can use this method to find out which interface was actually + * used for this connection. + * + * @return ?string local address (URI) or null if unknown + * @see self::getRemoteAddress() + */ + public function getLocalAddress(); +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/Connector.php b/tools/php-cs-fixer/vendor/react/socket/src/Connector.php new file mode 100644 index 00000000..15faa469 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/Connector.php @@ -0,0 +1,236 @@ + true, + 'tls' => true, + 'unix' => true, + + 'dns' => true, + 'timeout' => true, + 'happy_eyeballs' => true, + ); + + if ($context['timeout'] === true) { + $context['timeout'] = (float)\ini_get("default_socket_timeout"); + } + + if ($context['tcp'] instanceof ConnectorInterface) { + $tcp = $context['tcp']; + } else { + $tcp = new TcpConnector( + $loop, + \is_array($context['tcp']) ? $context['tcp'] : array() + ); + } + + if ($context['dns'] !== false) { + if ($context['dns'] instanceof ResolverInterface) { + $resolver = $context['dns']; + } else { + if ($context['dns'] !== true) { + $config = $context['dns']; + } else { + // try to load nameservers from system config or default to Google's public DNS + $config = DnsConfig::loadSystemConfigBlocking(); + if (!$config->nameservers) { + $config->nameservers[] = '8.8.8.8'; // @codeCoverageIgnore + } + } + + $factory = new DnsFactory(); + $resolver = $factory->createCached( + $config, + $loop + ); + } + + if ($context['happy_eyeballs'] === true) { + $tcp = new HappyEyeBallsConnector($loop, $tcp, $resolver); + } else { + $tcp = new DnsConnector($tcp, $resolver); + } + } + + if ($context['tcp'] !== false) { + $context['tcp'] = $tcp; + + if ($context['timeout'] !== false) { + $context['tcp'] = new TimeoutConnector( + $context['tcp'], + $context['timeout'], + $loop + ); + } + + $this->connectors['tcp'] = $context['tcp']; + } + + if ($context['tls'] !== false) { + if (!$context['tls'] instanceof ConnectorInterface) { + $context['tls'] = new SecureConnector( + $tcp, + $loop, + \is_array($context['tls']) ? $context['tls'] : array() + ); + } + + if ($context['timeout'] !== false) { + $context['tls'] = new TimeoutConnector( + $context['tls'], + $context['timeout'], + $loop + ); + } + + $this->connectors['tls'] = $context['tls']; + } + + if ($context['unix'] !== false) { + if (!$context['unix'] instanceof ConnectorInterface) { + $context['unix'] = new UnixConnector($loop); + } + $this->connectors['unix'] = $context['unix']; + } + } + + public function connect($uri) + { + $scheme = 'tcp'; + if (\strpos($uri, '://') !== false) { + $scheme = (string)\substr($uri, 0, \strpos($uri, '://')); + } + + if (!isset($this->connectors[$scheme])) { + return \React\Promise\reject(new \RuntimeException( + 'No connector available for URI scheme "' . $scheme . '" (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + )); + } + + return $this->connectors[$scheme]->connect($uri); + } + + + /** + * [internal] Builds on URI from the given URI parts and ip address with original hostname as query + * + * @param array $parts + * @param string $host + * @param string $ip + * @return string + * @internal + */ + public static function uri(array $parts, $host, $ip) + { + $uri = ''; + + // prepend original scheme if known + if (isset($parts['scheme'])) { + $uri .= $parts['scheme'] . '://'; + } + + if (\strpos($ip, ':') !== false) { + // enclose IPv6 addresses in square brackets before appending port + $uri .= '[' . $ip . ']'; + } else { + $uri .= $ip; + } + + // append original port if known + if (isset($parts['port'])) { + $uri .= ':' . $parts['port']; + } + + // append orignal path if known + if (isset($parts['path'])) { + $uri .= $parts['path']; + } + + // append original query if known + if (isset($parts['query'])) { + $uri .= '?' . $parts['query']; + } + + // append original hostname as query if resolved via DNS and if + // destination URI does not contain "hostname" query param already + $args = array(); + \parse_str(isset($parts['query']) ? $parts['query'] : '', $args); + if ($host !== $ip && !isset($args['hostname'])) { + $uri .= (isset($parts['query']) ? '&' : '?') . 'hostname=' . \rawurlencode($host); + } + + // append original fragment if known + if (isset($parts['fragment'])) { + $uri .= '#' . $parts['fragment']; + } + + return $uri; + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/ConnectorInterface.php b/tools/php-cs-fixer/vendor/react/socket/src/ConnectorInterface.php new file mode 100644 index 00000000..1f07b753 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/ConnectorInterface.php @@ -0,0 +1,59 @@ +connect('google.com:443')->then( + * function (React\Socket\ConnectionInterface $connection) { + * // connection successfully established + * }, + * function (Exception $error) { + * // failed to connect due to $error + * } + * ); + * ``` + * + * The returned Promise MUST be implemented in such a way that it can be + * cancelled when it is still pending. Cancelling a pending promise MUST + * reject its value with an Exception. It SHOULD clean up any underlying + * resources and references as applicable. + * + * ```php + * $promise = $connector->connect($uri); + * + * $promise->cancel(); + * ``` + * + * @param string $uri + * @return \React\Promise\PromiseInterface + * Resolves with a `ConnectionInterface` on success or rejects with an `Exception` on error. + * @see ConnectionInterface + */ + public function connect($uri); +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/DnsConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/DnsConnector.php new file mode 100644 index 00000000..d2fb2c7d --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/DnsConnector.php @@ -0,0 +1,117 @@ +connector = $connector; + $this->resolver = $resolver; + } + + public function connect($uri) + { + $original = $uri; + if (\strpos($uri, '://') === false) { + $uri = 'tcp://' . $uri; + $parts = \parse_url($uri); + if (isset($parts['scheme'])) { + unset($parts['scheme']); + } + } else { + $parts = \parse_url($uri); + } + + if (!$parts || !isset($parts['host'])) { + return Promise\reject(new \InvalidArgumentException( + 'Given URI "' . $original . '" is invalid (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + )); + } + + $host = \trim($parts['host'], '[]'); + $connector = $this->connector; + + // skip DNS lookup / URI manipulation if this URI already contains an IP + if (@\inet_pton($host) !== false) { + return $connector->connect($original); + } + + $promise = $this->resolver->resolve($host); + $resolved = null; + + return new Promise\Promise( + function ($resolve, $reject) use (&$promise, &$resolved, $uri, $connector, $host, $parts) { + // resolve/reject with result of DNS lookup + $promise->then(function ($ip) use (&$promise, &$resolved, $uri, $connector, $host, $parts) { + $resolved = $ip; + + return $promise = $connector->connect( + Connector::uri($parts, $host, $ip) + )->then(null, function (\Exception $e) use ($uri) { + if ($e instanceof \RuntimeException) { + $message = \preg_replace('/^(Connection to [^ ]+)[&?]hostname=[^ &]+/', '$1', $e->getMessage()); + $e = new \RuntimeException( + 'Connection to ' . $uri . ' failed: ' . $message, + $e->getCode(), + $e + ); + + // avoid garbage references by replacing all closures in call stack. + // what a lovely piece of code! + $r = new \ReflectionProperty('Exception', 'trace'); + $r->setAccessible(true); + $trace = $r->getValue($e); + + // Exception trace arguments are not available on some PHP 7.4 installs + // @codeCoverageIgnoreStart + foreach ($trace as $ti => $one) { + if (isset($one['args'])) { + foreach ($one['args'] as $ai => $arg) { + if ($arg instanceof \Closure) { + $trace[$ti]['args'][$ai] = 'Object(' . \get_class($arg) . ')'; + } + } + } + } + // @codeCoverageIgnoreEnd + $r->setValue($e, $trace); + } + + throw $e; + }); + }, function ($e) use ($uri, $reject) { + $reject(new \RuntimeException('Connection to ' . $uri .' failed during DNS lookup: ' . $e->getMessage(), 0, $e)); + })->then($resolve, $reject); + }, + function ($_, $reject) use (&$promise, &$resolved, $uri) { + // cancellation should reject connection attempt + // reject DNS resolution with custom reason, otherwise rely on connection cancellation below + if ($resolved === null) { + $reject(new \RuntimeException( + 'Connection to ' . $uri . ' cancelled during DNS lookup (ECONNABORTED)', + \defined('SOCKET_ECONNABORTED') ? \SOCKET_ECONNABORTED : 103 + )); + } + + // (try to) cancel pending DNS lookup / connection attempt + if ($promise instanceof PromiseInterface && \method_exists($promise, 'cancel')) { + // overwrite callback arguments for PHP7+ only, so they do not show + // up in the Exception trace and do not cause a possible cyclic reference. + $_ = $reject = null; + + $promise->cancel(); + $promise = null; + } + } + ); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/FdServer.php b/tools/php-cs-fixer/vendor/react/socket/src/FdServer.php new file mode 100644 index 00000000..8e46719a --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/FdServer.php @@ -0,0 +1,222 @@ +on('connection', function (ConnectionInterface $connection) { + * echo 'Plaintext connection from ' . $connection->getRemoteAddress() . PHP_EOL; + * $connection->write('hello there!' . PHP_EOL); + * … + * }); + * ``` + * + * See also the `ServerInterface` for more details. + * + * @see ServerInterface + * @see ConnectionInterface + * @internal + */ +final class FdServer extends EventEmitter implements ServerInterface +{ + private $master; + private $loop; + private $unix = false; + private $listening = false; + + /** + * Creates a socket server and starts listening on the given file descriptor + * + * This starts accepting new incoming connections on the given file descriptor. + * See also the `connection event` documented in the `ServerInterface` + * for more details. + * + * ```php + * $socket = new React\Socket\FdServer(3); + * ``` + * + * If the given FD is invalid or out of range, it will throw an `InvalidArgumentException`: + * + * ```php + * // throws InvalidArgumentException + * $socket = new React\Socket\FdServer(-1); + * ``` + * + * If the given FD appears to be valid, but listening on it fails (such as + * if the FD does not exist or does not refer to a socket server), it will + * throw a `RuntimeException`: + * + * ```php + * // throws RuntimeException because FD does not reference a socket server + * $socket = new React\Socket\FdServer(0, $loop); + * ``` + * + * Note that these error conditions may vary depending on your system and/or + * configuration. + * See the exception message and code for more details about the actual error + * condition. + * + * @param int|string $fd FD number such as `3` or as URL in the form of `php://fd/3` + * @param ?LoopInterface $loop + * @throws \InvalidArgumentException if the listening address is invalid + * @throws \RuntimeException if listening on this address fails (already in use etc.) + */ + public function __construct($fd, $loop = null) + { + if (\preg_match('#^php://fd/(\d+)$#', $fd, $m)) { + $fd = (int) $m[1]; + } + if (!\is_int($fd) || $fd < 0 || $fd >= \PHP_INT_MAX) { + throw new \InvalidArgumentException( + 'Invalid FD number given (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + ); + } + + if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); + } + + $this->loop = $loop ?: Loop::get(); + + $errno = 0; + $errstr = ''; + \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { + // Match errstr from PHP's warning message. + // fopen(php://fd/3): Failed to open stream: Error duping file descriptor 3; possibly it doesn't exist: [9]: Bad file descriptor + \preg_match('/\[(\d+)\]: (.*)/', $error, $m); + $errno = isset($m[1]) ? (int) $m[1] : 0; + $errstr = isset($m[2]) ? $m[2] : $error; + }); + + $this->master = \fopen('php://fd/' . $fd, 'r+'); + + \restore_error_handler(); + + if (false === $this->master) { + throw new \RuntimeException( + 'Failed to listen on FD ' . $fd . ': ' . $errstr . SocketServer::errconst($errno), + $errno + ); + } + + $meta = \stream_get_meta_data($this->master); + if (!isset($meta['stream_type']) || $meta['stream_type'] !== 'tcp_socket') { + \fclose($this->master); + + $errno = \defined('SOCKET_ENOTSOCK') ? \SOCKET_ENOTSOCK : 88; + $errstr = \function_exists('socket_strerror') ? \socket_strerror($errno) : 'Not a socket'; + + throw new \RuntimeException( + 'Failed to listen on FD ' . $fd . ': ' . $errstr . ' (ENOTSOCK)', + $errno + ); + } + + // Socket should not have a peer address if this is a listening socket. + // Looks like this work-around is the closest we can get because PHP doesn't expose SO_ACCEPTCONN even with ext-sockets. + if (\stream_socket_get_name($this->master, true) !== false) { + \fclose($this->master); + + $errno = \defined('SOCKET_EISCONN') ? \SOCKET_EISCONN : 106; + $errstr = \function_exists('socket_strerror') ? \socket_strerror($errno) : 'Socket is connected'; + + throw new \RuntimeException( + 'Failed to listen on FD ' . $fd . ': ' . $errstr . ' (EISCONN)', + $errno + ); + } + + // Assume this is a Unix domain socket (UDS) when its listening address doesn't parse as a valid URL with a port. + // Looks like this work-around is the closest we can get because PHP doesn't expose SO_DOMAIN even with ext-sockets. + $this->unix = \parse_url($this->getAddress(), \PHP_URL_PORT) === false; + + \stream_set_blocking($this->master, false); + + $this->resume(); + } + + public function getAddress() + { + if (!\is_resource($this->master)) { + return null; + } + + $address = \stream_socket_get_name($this->master, false); + + if ($this->unix === true) { + return 'unix://' . $address; + } + + // check if this is an IPv6 address which includes multiple colons but no square brackets + $pos = \strrpos($address, ':'); + if ($pos !== false && \strpos($address, ':') < $pos && \substr($address, 0, 1) !== '[') { + $address = '[' . \substr($address, 0, $pos) . ']:' . \substr($address, $pos + 1); // @codeCoverageIgnore + } + + return 'tcp://' . $address; + } + + public function pause() + { + if (!$this->listening) { + return; + } + + $this->loop->removeReadStream($this->master); + $this->listening = false; + } + + public function resume() + { + if ($this->listening || !\is_resource($this->master)) { + return; + } + + $that = $this; + $this->loop->addReadStream($this->master, function ($master) use ($that) { + try { + $newSocket = SocketServer::accept($master); + } catch (\RuntimeException $e) { + $that->emit('error', array($e)); + return; + } + $that->handleConnection($newSocket); + }); + $this->listening = true; + } + + public function close() + { + if (!\is_resource($this->master)) { + return; + } + + $this->pause(); + \fclose($this->master); + $this->removeAllListeners(); + } + + /** @internal */ + public function handleConnection($socket) + { + $connection = new Connection($socket, $this->loop); + $connection->unix = $this->unix; + + $this->emit('connection', array($connection)); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/FixedUriConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/FixedUriConnector.php new file mode 100644 index 00000000..f83241d6 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/FixedUriConnector.php @@ -0,0 +1,41 @@ +connect('localhost:80'); + * ``` + */ +class FixedUriConnector implements ConnectorInterface +{ + private $uri; + private $connector; + + /** + * @param string $uri + * @param ConnectorInterface $connector + */ + public function __construct($uri, ConnectorInterface $connector) + { + $this->uri = $uri; + $this->connector = $connector; + } + + public function connect($_) + { + return $this->connector->connect($this->uri); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnectionBuilder.php b/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnectionBuilder.php new file mode 100644 index 00000000..d4f05e85 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnectionBuilder.php @@ -0,0 +1,334 @@ + false, + Message::TYPE_AAAA => false, + ); + public $resolverPromises = array(); + public $connectionPromises = array(); + public $connectQueue = array(); + public $nextAttemptTimer; + public $parts; + public $ipsCount = 0; + public $failureCount = 0; + public $resolve; + public $reject; + + public $lastErrorFamily; + public $lastError6; + public $lastError4; + + public function __construct(LoopInterface $loop, ConnectorInterface $connector, ResolverInterface $resolver, $uri, $host, $parts) + { + $this->loop = $loop; + $this->connector = $connector; + $this->resolver = $resolver; + $this->uri = $uri; + $this->host = $host; + $this->parts = $parts; + } + + public function connect() + { + $that = $this; + return new Promise\Promise(function ($resolve, $reject) use ($that) { + $lookupResolve = function ($type) use ($that, $resolve, $reject) { + return function (array $ips) use ($that, $type, $resolve, $reject) { + unset($that->resolverPromises[$type]); + $that->resolved[$type] = true; + + $that->mixIpsIntoConnectQueue($ips); + + // start next connection attempt if not already awaiting next + if ($that->nextAttemptTimer === null && $that->connectQueue) { + $that->check($resolve, $reject); + } + }; + }; + + $that->resolverPromises[Message::TYPE_AAAA] = $that->resolve(Message::TYPE_AAAA, $reject)->then($lookupResolve(Message::TYPE_AAAA)); + $that->resolverPromises[Message::TYPE_A] = $that->resolve(Message::TYPE_A, $reject)->then(function (array $ips) use ($that) { + // happy path: IPv6 has resolved already (or could not resolve), continue with IPv4 addresses + if ($that->resolved[Message::TYPE_AAAA] === true || !$ips) { + return $ips; + } + + // Otherwise delay processing IPv4 lookup until short timer passes or IPv6 resolves in the meantime + $deferred = new Promise\Deferred(function () use (&$ips) { + // discard all IPv4 addresses if cancelled + $ips = array(); + }); + $timer = $that->loop->addTimer($that::RESOLUTION_DELAY, function () use ($deferred, $ips) { + $deferred->resolve($ips); + }); + + $that->resolverPromises[Message::TYPE_AAAA]->then(function () use ($that, $timer, $deferred, &$ips) { + $that->loop->cancelTimer($timer); + $deferred->resolve($ips); + }); + + return $deferred->promise(); + })->then($lookupResolve(Message::TYPE_A)); + }, function ($_, $reject) use ($that) { + $reject(new \RuntimeException( + 'Connection to ' . $that->uri . ' cancelled' . (!$that->connectionPromises ? ' during DNS lookup' : '') . ' (ECONNABORTED)', + \defined('SOCKET_ECONNABORTED') ? \SOCKET_ECONNABORTED : 103 + )); + $_ = $reject = null; + + $that->cleanUp(); + }); + } + + /** + * @internal + * @param int $type DNS query type + * @param callable $reject + * @return \React\Promise\PromiseInterface Returns a promise that + * always resolves with a list of IP addresses on success or an empty + * list on error. + */ + public function resolve($type, $reject) + { + $that = $this; + return $that->resolver->resolveAll($that->host, $type)->then(null, function (\Exception $e) use ($type, $reject, $that) { + unset($that->resolverPromises[$type]); + $that->resolved[$type] = true; + + if ($type === Message::TYPE_A) { + $that->lastError4 = $e->getMessage(); + $that->lastErrorFamily = 4; + } else { + $that->lastError6 = $e->getMessage(); + $that->lastErrorFamily = 6; + } + + // cancel next attempt timer when there are no more IPs to connect to anymore + if ($that->nextAttemptTimer !== null && !$that->connectQueue) { + $that->loop->cancelTimer($that->nextAttemptTimer); + $that->nextAttemptTimer = null; + } + + if ($that->hasBeenResolved() && $that->ipsCount === 0) { + $reject(new \RuntimeException( + $that->error(), + 0, + $e + )); + } + + // Exception already handled above, so don't throw an unhandled rejection here + return array(); + }); + } + + /** + * @internal + */ + public function check($resolve, $reject) + { + $ip = \array_shift($this->connectQueue); + + // start connection attempt and remember array position to later unset again + $this->connectionPromises[] = $this->attemptConnection($ip); + \end($this->connectionPromises); + $index = \key($this->connectionPromises); + + $that = $this; + $that->connectionPromises[$index]->then(function ($connection) use ($that, $index, $resolve) { + unset($that->connectionPromises[$index]); + + $that->cleanUp(); + + $resolve($connection); + }, function (\Exception $e) use ($that, $index, $ip, $resolve, $reject) { + unset($that->connectionPromises[$index]); + + $that->failureCount++; + + $message = \preg_replace('/^(Connection to [^ ]+)[&?]hostname=[^ &]+/', '$1', $e->getMessage()); + if (\strpos($ip, ':') === false) { + $that->lastError4 = $message; + $that->lastErrorFamily = 4; + } else { + $that->lastError6 = $message; + $that->lastErrorFamily = 6; + } + + // start next connection attempt immediately on error + if ($that->connectQueue) { + if ($that->nextAttemptTimer !== null) { + $that->loop->cancelTimer($that->nextAttemptTimer); + $that->nextAttemptTimer = null; + } + + $that->check($resolve, $reject); + } + + if ($that->hasBeenResolved() === false) { + return; + } + + if ($that->ipsCount === $that->failureCount) { + $that->cleanUp(); + + $reject(new \RuntimeException( + $that->error(), + $e->getCode(), + $e + )); + } + }); + + // Allow next connection attempt in 100ms: https://tools.ietf.org/html/rfc8305#section-5 + // Only start timer when more IPs are queued or when DNS query is still pending (might add more IPs) + if ($this->nextAttemptTimer === null && (\count($this->connectQueue) > 0 || $this->resolved[Message::TYPE_A] === false || $this->resolved[Message::TYPE_AAAA] === false)) { + $this->nextAttemptTimer = $this->loop->addTimer(self::CONNECTION_ATTEMPT_DELAY, function () use ($that, $resolve, $reject) { + $that->nextAttemptTimer = null; + + if ($that->connectQueue) { + $that->check($resolve, $reject); + } + }); + } + } + + /** + * @internal + */ + public function attemptConnection($ip) + { + $uri = Connector::uri($this->parts, $this->host, $ip); + + return $this->connector->connect($uri); + } + + /** + * @internal + */ + public function cleanUp() + { + // clear list of outstanding IPs to avoid creating new connections + $this->connectQueue = array(); + + // cancel pending connection attempts + foreach ($this->connectionPromises as $connectionPromise) { + if ($connectionPromise instanceof PromiseInterface && \method_exists($connectionPromise, 'cancel')) { + $connectionPromise->cancel(); + } + } + + // cancel pending DNS resolution (cancel IPv4 first in case it is awaiting IPv6 resolution delay) + foreach (\array_reverse($this->resolverPromises) as $resolverPromise) { + if ($resolverPromise instanceof PromiseInterface && \method_exists($resolverPromise, 'cancel')) { + $resolverPromise->cancel(); + } + } + + if ($this->nextAttemptTimer instanceof TimerInterface) { + $this->loop->cancelTimer($this->nextAttemptTimer); + $this->nextAttemptTimer = null; + } + } + + /** + * @internal + */ + public function hasBeenResolved() + { + foreach ($this->resolved as $typeHasBeenResolved) { + if ($typeHasBeenResolved === false) { + return false; + } + } + + return true; + } + + /** + * Mixes an array of IP addresses into the connect queue in such a way they alternate when attempting to connect. + * The goal behind it is first attempt to connect to IPv6, then to IPv4, then to IPv6 again until one of those + * attempts succeeds. + * + * @link https://tools.ietf.org/html/rfc8305#section-4 + * + * @internal + */ + public function mixIpsIntoConnectQueue(array $ips) + { + \shuffle($ips); + $this->ipsCount += \count($ips); + $connectQueueStash = $this->connectQueue; + $this->connectQueue = array(); + while (\count($connectQueueStash) > 0 || \count($ips) > 0) { + if (\count($ips) > 0) { + $this->connectQueue[] = \array_shift($ips); + } + if (\count($connectQueueStash) > 0) { + $this->connectQueue[] = \array_shift($connectQueueStash); + } + } + } + + /** + * @internal + * @return string + */ + public function error() + { + if ($this->lastError4 === $this->lastError6) { + $message = $this->lastError6; + } elseif ($this->lastErrorFamily === 6) { + $message = 'Last error for IPv6: ' . $this->lastError6 . '. Previous error for IPv4: ' . $this->lastError4; + } else { + $message = 'Last error for IPv4: ' . $this->lastError4 . '. Previous error for IPv6: ' . $this->lastError6; + } + + if ($this->hasBeenResolved() && $this->ipsCount === 0) { + if ($this->lastError6 === $this->lastError4) { + $message = ' during DNS lookup: ' . $this->lastError6; + } else { + $message = ' during DNS lookup. ' . $message; + } + } else { + $message = ': ' . $message; + } + + return 'Connection to ' . $this->uri . ' failed' . $message; + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnector.php new file mode 100644 index 00000000..a5511ac9 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnector.php @@ -0,0 +1,80 @@ +loop = $loop ?: Loop::get(); + $this->connector = $connector; + $this->resolver = $resolver; + } + + public function connect($uri) + { + $original = $uri; + if (\strpos($uri, '://') === false) { + $uri = 'tcp://' . $uri; + $parts = \parse_url($uri); + if (isset($parts['scheme'])) { + unset($parts['scheme']); + } + } else { + $parts = \parse_url($uri); + } + + if (!$parts || !isset($parts['host'])) { + return Promise\reject(new \InvalidArgumentException( + 'Given URI "' . $original . '" is invalid (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + )); + } + + $host = \trim($parts['host'], '[]'); + + // skip DNS lookup / URI manipulation if this URI already contains an IP + if (@\inet_pton($host) !== false) { + return $this->connector->connect($original); + } + + $builder = new HappyEyeBallsConnectionBuilder( + $this->loop, + $this->connector, + $this->resolver, + $uri, + $host, + $parts + ); + return $builder->connect(); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/LimitingServer.php b/tools/php-cs-fixer/vendor/react/socket/src/LimitingServer.php new file mode 100644 index 00000000..d19000b3 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/LimitingServer.php @@ -0,0 +1,203 @@ +on('connection', function (React\Socket\ConnectionInterface $connection) { + * $connection->write('hello there!' . PHP_EOL); + * … + * }); + * ``` + * + * See also the `ServerInterface` for more details. + * + * @see ServerInterface + * @see ConnectionInterface + */ +class LimitingServer extends EventEmitter implements ServerInterface +{ + private $connections = array(); + private $server; + private $limit; + + private $pauseOnLimit = false; + private $autoPaused = false; + private $manuPaused = false; + + /** + * Instantiates a new LimitingServer. + * + * You have to pass a maximum number of open connections to ensure + * the server will automatically reject (close) connections once this limit + * is exceeded. In this case, it will emit an `error` event to inform about + * this and no `connection` event will be emitted. + * + * ```php + * $server = new React\Socket\LimitingServer($server, 100); + * $server->on('connection', function (React\Socket\ConnectionInterface $connection) { + * $connection->write('hello there!' . PHP_EOL); + * … + * }); + * ``` + * + * You MAY pass a `null` limit in order to put no limit on the number of + * open connections and keep accepting new connection until you run out of + * operating system resources (such as open file handles). This may be + * useful if you do not want to take care of applying a limit but still want + * to use the `getConnections()` method. + * + * You can optionally configure the server to pause accepting new + * connections once the connection limit is reached. In this case, it will + * pause the underlying server and no longer process any new connections at + * all, thus also no longer closing any excessive connections. + * The underlying operating system is responsible for keeping a backlog of + * pending connections until its limit is reached, at which point it will + * start rejecting further connections. + * Once the server is below the connection limit, it will continue consuming + * connections from the backlog and will process any outstanding data on + * each connection. + * This mode may be useful for some protocols that are designed to wait for + * a response message (such as HTTP), but may be less useful for other + * protocols that demand immediate responses (such as a "welcome" message in + * an interactive chat). + * + * ```php + * $server = new React\Socket\LimitingServer($server, 100, true); + * $server->on('connection', function (React\Socket\ConnectionInterface $connection) { + * $connection->write('hello there!' . PHP_EOL); + * … + * }); + * ``` + * + * @param ServerInterface $server + * @param int|null $connectionLimit + * @param bool $pauseOnLimit + */ + public function __construct(ServerInterface $server, $connectionLimit, $pauseOnLimit = false) + { + $this->server = $server; + $this->limit = $connectionLimit; + if ($connectionLimit !== null) { + $this->pauseOnLimit = $pauseOnLimit; + } + + $this->server->on('connection', array($this, 'handleConnection')); + $this->server->on('error', array($this, 'handleError')); + } + + /** + * Returns an array with all currently active connections + * + * ```php + * foreach ($server->getConnection() as $connection) { + * $connection->write('Hi!'); + * } + * ``` + * + * @return ConnectionInterface[] + */ + public function getConnections() + { + return $this->connections; + } + + public function getAddress() + { + return $this->server->getAddress(); + } + + public function pause() + { + if (!$this->manuPaused) { + $this->manuPaused = true; + + if (!$this->autoPaused) { + $this->server->pause(); + } + } + } + + public function resume() + { + if ($this->manuPaused) { + $this->manuPaused = false; + + if (!$this->autoPaused) { + $this->server->resume(); + } + } + } + + public function close() + { + $this->server->close(); + } + + /** @internal */ + public function handleConnection(ConnectionInterface $connection) + { + // close connection if limit exceeded + if ($this->limit !== null && \count($this->connections) >= $this->limit) { + $this->handleError(new \OverflowException('Connection closed because server reached connection limit')); + $connection->close(); + return; + } + + $this->connections[] = $connection; + $that = $this; + $connection->on('close', function () use ($that, $connection) { + $that->handleDisconnection($connection); + }); + + // pause accepting new connections if limit exceeded + if ($this->pauseOnLimit && !$this->autoPaused && \count($this->connections) >= $this->limit) { + $this->autoPaused = true; + + if (!$this->manuPaused) { + $this->server->pause(); + } + } + + $this->emit('connection', array($connection)); + } + + /** @internal */ + public function handleDisconnection(ConnectionInterface $connection) + { + unset($this->connections[\array_search($connection, $this->connections)]); + + // continue accepting new connection if below limit + if ($this->autoPaused && \count($this->connections) < $this->limit) { + $this->autoPaused = false; + + if (!$this->manuPaused) { + $this->server->resume(); + } + } + } + + /** @internal */ + public function handleError(\Exception $error) + { + $this->emit('error', array($error)); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/SecureConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/SecureConnector.php new file mode 100644 index 00000000..08255ac9 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/SecureConnector.php @@ -0,0 +1,132 @@ +connector = $connector; + $this->streamEncryption = new StreamEncryption($loop ?: Loop::get(), false); + $this->context = $context; + } + + public function connect($uri) + { + if (!\function_exists('stream_socket_enable_crypto')) { + return Promise\reject(new \BadMethodCallException('Encryption not supported on your platform (HHVM < 3.8?)')); // @codeCoverageIgnore + } + + if (\strpos($uri, '://') === false) { + $uri = 'tls://' . $uri; + } + + $parts = \parse_url($uri); + if (!$parts || !isset($parts['scheme']) || $parts['scheme'] !== 'tls') { + return Promise\reject(new \InvalidArgumentException( + 'Given URI "' . $uri . '" is invalid (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + )); + } + + $context = $this->context; + $encryption = $this->streamEncryption; + $connected = false; + /** @var \React\Promise\PromiseInterface $promise */ + $promise = $this->connector->connect( + \str_replace('tls://', '', $uri) + )->then(function (ConnectionInterface $connection) use ($context, $encryption, $uri, &$promise, &$connected) { + // (unencrypted) TCP/IP connection succeeded + $connected = true; + + if (!$connection instanceof Connection) { + $connection->close(); + throw new \UnexpectedValueException('Base connector does not use internal Connection class exposing stream resource'); + } + + // set required SSL/TLS context options + foreach ($context as $name => $value) { + \stream_context_set_option($connection->stream, 'ssl', $name, $value); + } + + // try to enable encryption + return $promise = $encryption->enable($connection)->then(null, function ($error) use ($connection, $uri) { + // establishing encryption failed => close invalid connection and return error + $connection->close(); + + throw new \RuntimeException( + 'Connection to ' . $uri . ' failed during TLS handshake: ' . $error->getMessage(), + $error->getCode() + ); + }); + }, function (\Exception $e) use ($uri) { + if ($e instanceof \RuntimeException) { + $message = \preg_replace('/^Connection to [^ ]+/', '', $e->getMessage()); + $e = new \RuntimeException( + 'Connection to ' . $uri . $message, + $e->getCode(), + $e + ); + + // avoid garbage references by replacing all closures in call stack. + // what a lovely piece of code! + $r = new \ReflectionProperty('Exception', 'trace'); + $r->setAccessible(true); + $trace = $r->getValue($e); + + // Exception trace arguments are not available on some PHP 7.4 installs + // @codeCoverageIgnoreStart + foreach ($trace as $ti => $one) { + if (isset($one['args'])) { + foreach ($one['args'] as $ai => $arg) { + if ($arg instanceof \Closure) { + $trace[$ti]['args'][$ai] = 'Object(' . \get_class($arg) . ')'; + } + } + } + } + // @codeCoverageIgnoreEnd + $r->setValue($e, $trace); + } + + throw $e; + }); + + return new \React\Promise\Promise( + function ($resolve, $reject) use ($promise) { + $promise->then($resolve, $reject); + }, + function ($_, $reject) use (&$promise, $uri, &$connected) { + if ($connected) { + $reject(new \RuntimeException( + 'Connection to ' . $uri . ' cancelled during TLS handshake (ECONNABORTED)', + \defined('SOCKET_ECONNABORTED') ? \SOCKET_ECONNABORTED : 103 + )); + } + + $promise->cancel(); + $promise = null; + } + ); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/SecureServer.php b/tools/php-cs-fixer/vendor/react/socket/src/SecureServer.php new file mode 100644 index 00000000..5a202d27 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/SecureServer.php @@ -0,0 +1,210 @@ +on('connection', function (React\Socket\ConnectionInterface $connection) { + * echo 'Secure connection from' . $connection->getRemoteAddress() . PHP_EOL; + * + * $connection->write('hello there!' . PHP_EOL); + * … + * }); + * ``` + * + * Whenever a client fails to perform a successful TLS handshake, it will emit an + * `error` event and then close the underlying TCP/IP connection: + * + * ```php + * $server->on('error', function (Exception $e) { + * echo 'Error' . $e->getMessage() . PHP_EOL; + * }); + * ``` + * + * See also the `ServerInterface` for more details. + * + * Note that the `SecureServer` class is a concrete implementation for TLS sockets. + * If you want to typehint in your higher-level protocol implementation, you SHOULD + * use the generic `ServerInterface` instead. + * + * @see ServerInterface + * @see ConnectionInterface + */ +final class SecureServer extends EventEmitter implements ServerInterface +{ + private $tcp; + private $encryption; + private $context; + + /** + * Creates a secure TLS server and starts waiting for incoming connections + * + * It does so by wrapping a `TcpServer` instance which waits for plaintext + * TCP/IP connections and then performs a TLS handshake for each connection. + * It thus requires valid [TLS context options], + * which in its most basic form may look something like this if you're using a + * PEM encoded certificate file: + * + * ```php + * $server = new React\Socket\TcpServer(8000); + * $server = new React\Socket\SecureServer($server, null, array( + * 'local_cert' => 'server.pem' + * )); + * ``` + * + * Note that the certificate file will not be loaded on instantiation but when an + * incoming connection initializes its TLS context. + * This implies that any invalid certificate file paths or contents will only cause + * an `error` event at a later time. + * + * If your private key is encrypted with a passphrase, you have to specify it + * like this: + * + * ```php + * $server = new React\Socket\TcpServer(8000); + * $server = new React\Socket\SecureServer($server, null, array( + * 'local_cert' => 'server.pem', + * 'passphrase' => 'secret' + * )); + * ``` + * + * Note that available [TLS context options], + * their defaults and effects of changing these may vary depending on your system + * and/or PHP version. + * Passing unknown context options has no effect. + * + * This class takes an optional `LoopInterface|null $loop` parameter that can be used to + * pass the event loop instance to use for this object. You can use a `null` value + * here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). + * This value SHOULD NOT be given unless you're sure you want to explicitly use a + * given event loop instance. + * + * Advanced usage: Despite allowing any `ServerInterface` as first parameter, + * you SHOULD pass a `TcpServer` instance as first parameter, unless you + * know what you're doing. + * Internally, the `SecureServer` has to set the required TLS context options on + * the underlying stream resources. + * These resources are not exposed through any of the interfaces defined in this + * package, but only through the internal `Connection` class. + * The `TcpServer` class is guaranteed to emit connections that implement + * the `ConnectionInterface` and uses the internal `Connection` class in order to + * expose these underlying resources. + * If you use a custom `ServerInterface` and its `connection` event does not + * meet this requirement, the `SecureServer` will emit an `error` event and + * then close the underlying connection. + * + * @param ServerInterface|TcpServer $tcp + * @param ?LoopInterface $loop + * @param array $context + * @throws BadMethodCallException for legacy HHVM < 3.8 due to lack of support + * @see TcpServer + * @link https://www.php.net/manual/en/context.ssl.php for TLS context options + */ + public function __construct(ServerInterface $tcp, $loop = null, array $context = array()) + { + if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); + } + + if (!\function_exists('stream_socket_enable_crypto')) { + throw new \BadMethodCallException('Encryption not supported on your platform (HHVM < 3.8?)'); // @codeCoverageIgnore + } + + // default to empty passphrase to suppress blocking passphrase prompt + $context += array( + 'passphrase' => '' + ); + + $this->tcp = $tcp; + $this->encryption = new StreamEncryption($loop ?: Loop::get()); + $this->context = $context; + + $that = $this; + $this->tcp->on('connection', function ($connection) use ($that) { + $that->handleConnection($connection); + }); + $this->tcp->on('error', function ($error) use ($that) { + $that->emit('error', array($error)); + }); + } + + public function getAddress() + { + $address = $this->tcp->getAddress(); + if ($address === null) { + return null; + } + + return \str_replace('tcp://' , 'tls://', $address); + } + + public function pause() + { + $this->tcp->pause(); + } + + public function resume() + { + $this->tcp->resume(); + } + + public function close() + { + return $this->tcp->close(); + } + + /** @internal */ + public function handleConnection(ConnectionInterface $connection) + { + if (!$connection instanceof Connection) { + $this->emit('error', array(new \UnexpectedValueException('Base server does not use internal Connection class exposing stream resource'))); + $connection->close(); + return; + } + + foreach ($this->context as $name => $value) { + \stream_context_set_option($connection->stream, 'ssl', $name, $value); + } + + // get remote address before starting TLS handshake in case connection closes during handshake + $remote = $connection->getRemoteAddress(); + $that = $this; + + $this->encryption->enable($connection)->then( + function ($conn) use ($that) { + $that->emit('connection', array($conn)); + }, + function ($error) use ($that, $connection, $remote) { + $error = new \RuntimeException( + 'Connection from ' . $remote . ' failed during TLS handshake: ' . $error->getMessage(), + $error->getCode() + ); + + $that->emit('error', array($error)); + $connection->close(); + } + ); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/Server.php b/tools/php-cs-fixer/vendor/react/socket/src/Server.php new file mode 100644 index 00000000..b24c5564 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/Server.php @@ -0,0 +1,118 @@ + $context); + } + + // apply default options if not explicitly given + $context += array( + 'tcp' => array(), + 'tls' => array(), + 'unix' => array() + ); + + $scheme = 'tcp'; + $pos = \strpos($uri, '://'); + if ($pos !== false) { + $scheme = \substr($uri, 0, $pos); + } + + if ($scheme === 'unix') { + $server = new UnixServer($uri, $loop, $context['unix']); + } else { + $server = new TcpServer(str_replace('tls://', '', $uri), $loop, $context['tcp']); + + if ($scheme === 'tls') { + $server = new SecureServer($server, $loop, $context['tls']); + } + } + + $this->server = $server; + + $that = $this; + $server->on('connection', function (ConnectionInterface $conn) use ($that) { + $that->emit('connection', array($conn)); + }); + $server->on('error', function (Exception $error) use ($that) { + $that->emit('error', array($error)); + }); + } + + public function getAddress() + { + return $this->server->getAddress(); + } + + public function pause() + { + $this->server->pause(); + } + + public function resume() + { + $this->server->resume(); + } + + public function close() + { + $this->server->close(); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/ServerInterface.php b/tools/php-cs-fixer/vendor/react/socket/src/ServerInterface.php new file mode 100644 index 00000000..aa79fa17 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/ServerInterface.php @@ -0,0 +1,151 @@ +on('connection', function (React\Socket\ConnectionInterface $connection) { + * echo 'new connection' . PHP_EOL; + * }); + * ``` + * + * See also the `ConnectionInterface` for more details about handling the + * incoming connection. + * + * error event: + * The `error` event will be emitted whenever there's an error accepting a new + * connection from a client. + * + * ```php + * $socket->on('error', function (Exception $e) { + * echo 'error: ' . $e->getMessage() . PHP_EOL; + * }); + * ``` + * + * Note that this is not a fatal error event, i.e. the server keeps listening for + * new connections even after this event. + * + * @see ConnectionInterface + */ +interface ServerInterface extends EventEmitterInterface +{ + /** + * Returns the full address (URI) this server is currently listening on + * + * ```php + * $address = $socket->getAddress(); + * echo 'Server listening on ' . $address . PHP_EOL; + * ``` + * + * If the address can not be determined or is unknown at this time (such as + * after the socket has been closed), it MAY return a `NULL` value instead. + * + * Otherwise, it will return the full address (URI) as a string value, such + * as `tcp://127.0.0.1:8080`, `tcp://[::1]:80` or `tls://127.0.0.1:443`. + * Note that individual URI components are application specific and depend + * on the underlying transport protocol. + * + * If this is a TCP/IP based server and you only want the local port, you may + * use something like this: + * + * ```php + * $address = $socket->getAddress(); + * $port = parse_url($address, PHP_URL_PORT); + * echo 'Server listening on port ' . $port . PHP_EOL; + * ``` + * + * @return ?string the full listening address (URI) or NULL if it is unknown (not applicable to this server socket or already closed) + */ + public function getAddress(); + + /** + * Pauses accepting new incoming connections. + * + * Removes the socket resource from the EventLoop and thus stop accepting + * new connections. Note that the listening socket stays active and is not + * closed. + * + * This means that new incoming connections will stay pending in the + * operating system backlog until its configurable backlog is filled. + * Once the backlog is filled, the operating system may reject further + * incoming connections until the backlog is drained again by resuming + * to accept new connections. + * + * Once the server is paused, no futher `connection` events SHOULD + * be emitted. + * + * ```php + * $socket->pause(); + * + * $socket->on('connection', assertShouldNeverCalled()); + * ``` + * + * This method is advisory-only, though generally not recommended, the + * server MAY continue emitting `connection` events. + * + * Unless otherwise noted, a successfully opened server SHOULD NOT start + * in paused state. + * + * You can continue processing events by calling `resume()` again. + * + * Note that both methods can be called any number of times, in particular + * calling `pause()` more than once SHOULD NOT have any effect. + * Similarly, calling this after `close()` is a NO-OP. + * + * @see self::resume() + * @return void + */ + public function pause(); + + /** + * Resumes accepting new incoming connections. + * + * Re-attach the socket resource to the EventLoop after a previous `pause()`. + * + * ```php + * $socket->pause(); + * + * Loop::addTimer(1.0, function () use ($socket) { + * $socket->resume(); + * }); + * ``` + * + * Note that both methods can be called any number of times, in particular + * calling `resume()` without a prior `pause()` SHOULD NOT have any effect. + * Similarly, calling this after `close()` is a NO-OP. + * + * @see self::pause() + * @return void + */ + public function resume(); + + /** + * Shuts down this listening socket + * + * This will stop listening for new incoming connections on this socket. + * + * Calling this method more than once on the same instance is a NO-OP. + * + * @return void + */ + public function close(); +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/SocketServer.php b/tools/php-cs-fixer/vendor/react/socket/src/SocketServer.php new file mode 100644 index 00000000..e987f5f6 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/SocketServer.php @@ -0,0 +1,215 @@ + array(), + 'tls' => array(), + 'unix' => array() + ); + + $scheme = 'tcp'; + $pos = \strpos($uri, '://'); + if ($pos !== false) { + $scheme = \substr($uri, 0, $pos); + } + + if ($scheme === 'unix') { + $server = new UnixServer($uri, $loop, $context['unix']); + } elseif ($scheme === 'php') { + $server = new FdServer($uri, $loop); + } else { + if (preg_match('#^(?:\w+://)?\d+$#', $uri)) { + throw new \InvalidArgumentException( + 'Invalid URI given (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + ); + } + + $server = new TcpServer(str_replace('tls://', '', $uri), $loop, $context['tcp']); + + if ($scheme === 'tls') { + $server = new SecureServer($server, $loop, $context['tls']); + } + } + + $this->server = $server; + + $that = $this; + $server->on('connection', function (ConnectionInterface $conn) use ($that) { + $that->emit('connection', array($conn)); + }); + $server->on('error', function (\Exception $error) use ($that) { + $that->emit('error', array($error)); + }); + } + + public function getAddress() + { + return $this->server->getAddress(); + } + + public function pause() + { + $this->server->pause(); + } + + public function resume() + { + $this->server->resume(); + } + + public function close() + { + $this->server->close(); + } + + /** + * [internal] Internal helper method to accept new connection from given server socket + * + * @param resource $socket server socket to accept connection from + * @return resource new client socket if any + * @throws \RuntimeException if accepting fails + * @internal + */ + public static function accept($socket) + { + $errno = 0; + $errstr = ''; + \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { + // Match errstr from PHP's warning message. + // stream_socket_accept(): accept failed: Connection timed out + $errstr = \preg_replace('#.*: #', '', $error); + $errno = SocketServer::errno($errstr); + }); + + $newSocket = \stream_socket_accept($socket, 0); + + \restore_error_handler(); + + if (false === $newSocket) { + throw new \RuntimeException( + 'Unable to accept new connection: ' . $errstr . self::errconst($errno), + $errno + ); + } + + return $newSocket; + } + + /** + * [Internal] Returns errno value for given errstr + * + * The errno and errstr values describes the type of error that has been + * encountered. This method tries to look up the given errstr and find a + * matching errno value which can be useful to provide more context to error + * messages. It goes through the list of known errno constants when either + * `ext-sockets`, `ext-posix` or `ext-pcntl` is available to find an errno + * matching the given errstr. + * + * @param string $errstr + * @return int errno value (e.g. value of `SOCKET_ECONNREFUSED`) or 0 if not found + * @internal + * @copyright Copyright (c) 2023 Christian Lück, taken from https://github.com/clue/errno with permission + * @codeCoverageIgnore + */ + public static function errno($errstr) + { + // PHP defines the required `strerror()` function through either `ext-sockets`, `ext-posix` or `ext-pcntl` + $strerror = \function_exists('socket_strerror') ? 'socket_strerror' : (\function_exists('posix_strerror') ? 'posix_strerror' : (\function_exists('pcntl_strerror') ? 'pcntl_strerror' : null)); + if ($strerror !== null) { + assert(\is_string($strerror) && \is_callable($strerror)); + + // PHP defines most useful errno constants like `ECONNREFUSED` through constants in `ext-sockets` like `SOCKET_ECONNREFUSED` + // PHP also defines a hand full of errno constants like `EMFILE` through constants in `ext-pcntl` like `PCNTL_EMFILE` + // go through list of all defined constants like `SOCKET_E*` and `PCNTL_E*` and see if they match the given `$errstr` + foreach (\get_defined_constants(false) as $name => $value) { + if (\is_int($value) && (\strpos($name, 'SOCKET_E') === 0 || \strpos($name, 'PCNTL_E') === 0) && $strerror($value) === $errstr) { + return $value; + } + } + + // if we reach this, no matching errno constant could be found (unlikely when `ext-sockets` is available) + // go through list of all possible errno values from 1 to `MAX_ERRNO` and see if they match the given `$errstr` + for ($errno = 1, $max = \defined('MAX_ERRNO') ? \MAX_ERRNO : 4095; $errno <= $max; ++$errno) { + if ($strerror($errno) === $errstr) { + return $errno; + } + } + } + + // if we reach this, no matching errno value could be found (unlikely when either `ext-sockets`, `ext-posix` or `ext-pcntl` is available) + return 0; + } + + /** + * [Internal] Returns errno constant name for given errno value + * + * The errno value describes the type of error that has been encountered. + * This method tries to look up the given errno value and find a matching + * errno constant name which can be useful to provide more context and more + * descriptive error messages. It goes through the list of known errno + * constants when either `ext-sockets` or `ext-pcntl` is available to find + * the matching errno constant name. + * + * Because this method is used to append more context to error messages, the + * constant name will be prefixed with a space and put between parenthesis + * when found. + * + * @param int $errno + * @return string e.g. ` (ECONNREFUSED)` or empty string if no matching const for the given errno could be found + * @internal + * @copyright Copyright (c) 2023 Christian Lück, taken from https://github.com/clue/errno with permission + * @codeCoverageIgnore + */ + public static function errconst($errno) + { + // PHP defines most useful errno constants like `ECONNREFUSED` through constants in `ext-sockets` like `SOCKET_ECONNREFUSED` + // PHP also defines a hand full of errno constants like `EMFILE` through constants in `ext-pcntl` like `PCNTL_EMFILE` + // go through list of all defined constants like `SOCKET_E*` and `PCNTL_E*` and see if they match the given `$errno` + foreach (\get_defined_constants(false) as $name => $value) { + if ($value === $errno && (\strpos($name, 'SOCKET_E') === 0 || \strpos($name, 'PCNTL_E') === 0)) { + return ' (' . \substr($name, \strpos($name, '_') + 1) . ')'; + } + } + + // if we reach this, no matching errno constant could be found (unlikely when `ext-sockets` is available) + return ''; + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/StreamEncryption.php b/tools/php-cs-fixer/vendor/react/socket/src/StreamEncryption.php new file mode 100644 index 00000000..f91a3597 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/StreamEncryption.php @@ -0,0 +1,158 @@ +loop = $loop; + $this->server = $server; + + // support TLSv1.0+ by default and exclude legacy SSLv2/SSLv3. + // As of PHP 7.2+ the main crypto method constant includes all TLS versions. + // As of PHP 5.6+ the crypto method is a bitmask, so we explicitly include all TLS versions. + // For legacy PHP < 5.6 the crypto method is a single value only and this constant includes all TLS versions. + // @link https://3v4l.org/9PSST + if ($server) { + $this->method = \STREAM_CRYPTO_METHOD_TLS_SERVER; + + if (\PHP_VERSION_ID < 70200 && \PHP_VERSION_ID >= 50600) { + $this->method |= \STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | \STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | \STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; // @codeCoverageIgnore + } + } else { + $this->method = \STREAM_CRYPTO_METHOD_TLS_CLIENT; + + if (\PHP_VERSION_ID < 70200 && \PHP_VERSION_ID >= 50600) { + $this->method |= \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; // @codeCoverageIgnore + } + } + } + + /** + * @param Connection $stream + * @return \React\Promise\PromiseInterface + */ + public function enable(Connection $stream) + { + return $this->toggle($stream, true); + } + + /** + * @param Connection $stream + * @param bool $toggle + * @return \React\Promise\PromiseInterface + */ + public function toggle(Connection $stream, $toggle) + { + // pause actual stream instance to continue operation on raw stream socket + $stream->pause(); + + // TODO: add write() event to make sure we're not sending any excessive data + + // cancelling this leaves this stream in an inconsistent state… + $deferred = new Deferred(function () { + throw new \RuntimeException(); + }); + + // get actual stream socket from stream instance + $socket = $stream->stream; + + // get crypto method from context options or use global setting from constructor + $method = $this->method; + $context = \stream_context_get_options($socket); + if (isset($context['ssl']['crypto_method'])) { + $method = $context['ssl']['crypto_method']; + } + + $that = $this; + $toggleCrypto = function () use ($socket, $deferred, $toggle, $method, $that) { + $that->toggleCrypto($socket, $deferred, $toggle, $method); + }; + + $this->loop->addReadStream($socket, $toggleCrypto); + + if (!$this->server) { + $toggleCrypto(); + } + + $loop = $this->loop; + + return $deferred->promise()->then(function () use ($stream, $socket, $loop, $toggle) { + $loop->removeReadStream($socket); + + $stream->encryptionEnabled = $toggle; + $stream->resume(); + + return $stream; + }, function($error) use ($stream, $socket, $loop) { + $loop->removeReadStream($socket); + $stream->resume(); + throw $error; + }); + } + + /** + * @internal + * @param resource $socket + * @param Deferred $deferred + * @param bool $toggle + * @param int $method + * @return void + */ + public function toggleCrypto($socket, Deferred $deferred, $toggle, $method) + { + $error = null; + \set_error_handler(function ($_, $errstr) use (&$error) { + $error = \str_replace(array("\r", "\n"), ' ', $errstr); + + // remove useless function name from error message + if (($pos = \strpos($error, "): ")) !== false) { + $error = \substr($error, $pos + 3); + } + }); + + $result = \stream_socket_enable_crypto($socket, $toggle, $method); + + \restore_error_handler(); + + if (true === $result) { + $deferred->resolve(null); + } else if (false === $result) { + // overwrite callback arguments for PHP7+ only, so they do not show + // up in the Exception trace and do not cause a possible cyclic reference. + $d = $deferred; + $deferred = null; + + if (\feof($socket) || $error === null) { + // EOF or failed without error => connection closed during handshake + $d->reject(new \UnexpectedValueException( + 'Connection lost during TLS handshake (ECONNRESET)', + \defined('SOCKET_ECONNRESET') ? \SOCKET_ECONNRESET : 104 + )); + } else { + // handshake failed with error message + $d->reject(new \UnexpectedValueException( + $error + )); + } + } else { + // need more data, will retry + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/TcpConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/TcpConnector.php new file mode 100644 index 00000000..9d2599e8 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/TcpConnector.php @@ -0,0 +1,173 @@ +loop = $loop ?: Loop::get(); + $this->context = $context; + } + + public function connect($uri) + { + if (\strpos($uri, '://') === false) { + $uri = 'tcp://' . $uri; + } + + $parts = \parse_url($uri); + if (!$parts || !isset($parts['scheme'], $parts['host'], $parts['port']) || $parts['scheme'] !== 'tcp') { + return Promise\reject(new \InvalidArgumentException( + 'Given URI "' . $uri . '" is invalid (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + )); + } + + $ip = \trim($parts['host'], '[]'); + if (@\inet_pton($ip) === false) { + return Promise\reject(new \InvalidArgumentException( + 'Given URI "' . $uri . '" does not contain a valid host IP (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + )); + } + + // use context given in constructor + $context = array( + 'socket' => $this->context + ); + + // parse arguments from query component of URI + $args = array(); + if (isset($parts['query'])) { + \parse_str($parts['query'], $args); + } + + // If an original hostname has been given, use this for TLS setup. + // This can happen due to layers of nested connectors, such as a + // DnsConnector reporting its original hostname. + // These context options are here in case TLS is enabled later on this stream. + // If TLS is not enabled later, this doesn't hurt either. + if (isset($args['hostname'])) { + $context['ssl'] = array( + 'SNI_enabled' => true, + 'peer_name' => $args['hostname'] + ); + + // Legacy PHP < 5.6 ignores peer_name and requires legacy context options instead. + // The SNI_server_name context option has to be set here during construction, + // as legacy PHP ignores any values set later. + // @codeCoverageIgnoreStart + if (\PHP_VERSION_ID < 50600) { + $context['ssl'] += array( + 'SNI_server_name' => $args['hostname'], + 'CN_match' => $args['hostname'] + ); + } + // @codeCoverageIgnoreEnd + } + + // latest versions of PHP no longer accept any other URI components and + // HHVM fails to parse URIs with a query but no path, so let's simplify our URI here + $remote = 'tcp://' . $parts['host'] . ':' . $parts['port']; + + $stream = @\stream_socket_client( + $remote, + $errno, + $errstr, + 0, + \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT, + \stream_context_create($context) + ); + + if (false === $stream) { + return Promise\reject(new \RuntimeException( + 'Connection to ' . $uri . ' failed: ' . $errstr . SocketServer::errconst($errno), + $errno + )); + } + + // wait for connection + $loop = $this->loop; + return new Promise\Promise(function ($resolve, $reject) use ($loop, $stream, $uri) { + $loop->addWriteStream($stream, function ($stream) use ($loop, $resolve, $reject, $uri) { + $loop->removeWriteStream($stream); + + // The following hack looks like the only way to + // detect connection refused errors with PHP's stream sockets. + if (false === \stream_socket_get_name($stream, true)) { + // If we reach this point, we know the connection is dead, but we don't know the underlying error condition. + // @codeCoverageIgnoreStart + if (\function_exists('socket_import_stream')) { + // actual socket errno and errstr can be retrieved with ext-sockets on PHP 5.4+ + $socket = \socket_import_stream($stream); + $errno = \socket_get_option($socket, \SOL_SOCKET, \SO_ERROR); + $errstr = \socket_strerror($errno); + } elseif (\PHP_OS === 'Linux') { + // Linux reports socket errno and errstr again when trying to write to the dead socket. + // Suppress error reporting to get error message below and close dead socket before rejecting. + // This is only known to work on Linux, Mac and Windows are known to not support this. + $errno = 0; + $errstr = ''; + \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { + // Match errstr from PHP's warning message. + // fwrite(): send of 1 bytes failed with errno=111 Connection refused + \preg_match('/errno=(\d+) (.+)/', $error, $m); + $errno = isset($m[1]) ? (int) $m[1] : 0; + $errstr = isset($m[2]) ? $m[2] : $error; + }); + + \fwrite($stream, \PHP_EOL); + + \restore_error_handler(); + } else { + // Not on Linux and ext-sockets not available? Too bad. + $errno = \defined('SOCKET_ECONNREFUSED') ? \SOCKET_ECONNREFUSED : 111; + $errstr = 'Connection refused?'; + } + // @codeCoverageIgnoreEnd + + \fclose($stream); + $reject(new \RuntimeException( + 'Connection to ' . $uri . ' failed: ' . $errstr . SocketServer::errconst($errno), + $errno + )); + } else { + $resolve(new Connection($stream, $loop)); + } + }); + }, function () use ($loop, $stream, $uri) { + $loop->removeWriteStream($stream); + \fclose($stream); + + // @codeCoverageIgnoreStart + // legacy PHP 5.3 sometimes requires a second close call (see tests) + if (\PHP_VERSION_ID < 50400 && \is_resource($stream)) { + \fclose($stream); + } + // @codeCoverageIgnoreEnd + + throw new \RuntimeException( + 'Connection to ' . $uri . ' cancelled during TCP/IP handshake (ECONNABORTED)', + \defined('SOCKET_ECONNABORTED') ? \SOCKET_ECONNABORTED : 103 + ); + }); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/TcpServer.php b/tools/php-cs-fixer/vendor/react/socket/src/TcpServer.php new file mode 100644 index 00000000..01b2b46d --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/TcpServer.php @@ -0,0 +1,262 @@ +on('connection', function (React\Socket\ConnectionInterface $connection) { + * echo 'Plaintext connection from ' . $connection->getRemoteAddress() . PHP_EOL; + * $connection->write('hello there!' . PHP_EOL); + * … + * }); + * ``` + * + * See also the `ServerInterface` for more details. + * + * @see ServerInterface + * @see ConnectionInterface + */ +final class TcpServer extends EventEmitter implements ServerInterface +{ + private $master; + private $loop; + private $listening = false; + + /** + * Creates a plaintext TCP/IP socket server and starts listening on the given address + * + * This starts accepting new incoming connections on the given address. + * See also the `connection event` documented in the `ServerInterface` + * for more details. + * + * ```php + * $server = new React\Socket\TcpServer(8080); + * ``` + * + * As above, the `$uri` parameter can consist of only a port, in which case the + * server will default to listening on the localhost address `127.0.0.1`, + * which means it will not be reachable from outside of this system. + * + * In order to use a random port assignment, you can use the port `0`: + * + * ```php + * $server = new React\Socket\TcpServer(0); + * $address = $server->getAddress(); + * ``` + * + * In order to change the host the socket is listening on, you can provide an IP + * address through the first parameter provided to the constructor, optionally + * preceded by the `tcp://` scheme: + * + * ```php + * $server = new React\Socket\TcpServer('192.168.0.1:8080'); + * ``` + * + * If you want to listen on an IPv6 address, you MUST enclose the host in square + * brackets: + * + * ```php + * $server = new React\Socket\TcpServer('[::1]:8080'); + * ``` + * + * If the given URI is invalid, does not contain a port, any other scheme or if it + * contains a hostname, it will throw an `InvalidArgumentException`: + * + * ```php + * // throws InvalidArgumentException due to missing port + * $server = new React\Socket\TcpServer('127.0.0.1'); + * ``` + * + * If the given URI appears to be valid, but listening on it fails (such as if port + * is already in use or port below 1024 may require root access etc.), it will + * throw a `RuntimeException`: + * + * ```php + * $first = new React\Socket\TcpServer(8080); + * + * // throws RuntimeException because port is already in use + * $second = new React\Socket\TcpServer(8080); + * ``` + * + * Note that these error conditions may vary depending on your system and/or + * configuration. + * See the exception message and code for more details about the actual error + * condition. + * + * This class takes an optional `LoopInterface|null $loop` parameter that can be used to + * pass the event loop instance to use for this object. You can use a `null` value + * here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). + * This value SHOULD NOT be given unless you're sure you want to explicitly use a + * given event loop instance. + * + * Optionally, you can specify [socket context options](https://www.php.net/manual/en/context.socket.php) + * for the underlying stream socket resource like this: + * + * ```php + * $server = new React\Socket\TcpServer('[::1]:8080', null, array( + * 'backlog' => 200, + * 'so_reuseport' => true, + * 'ipv6_v6only' => true + * )); + * ``` + * + * Note that available [socket context options](https://www.php.net/manual/en/context.socket.php), + * their defaults and effects of changing these may vary depending on your system + * and/or PHP version. + * Passing unknown context options has no effect. + * The `backlog` context option defaults to `511` unless given explicitly. + * + * @param string|int $uri + * @param ?LoopInterface $loop + * @param array $context + * @throws InvalidArgumentException if the listening address is invalid + * @throws RuntimeException if listening on this address fails (already in use etc.) + */ + public function __construct($uri, $loop = null, array $context = array()) + { + if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); + } + + $this->loop = $loop ?: Loop::get(); + + // a single port has been given => assume localhost + if ((string)(int)$uri === (string)$uri) { + $uri = '127.0.0.1:' . $uri; + } + + // assume default scheme if none has been given + if (\strpos($uri, '://') === false) { + $uri = 'tcp://' . $uri; + } + + // parse_url() does not accept null ports (random port assignment) => manually remove + if (\substr($uri, -2) === ':0') { + $parts = \parse_url(\substr($uri, 0, -2)); + if ($parts) { + $parts['port'] = 0; + } + } else { + $parts = \parse_url($uri); + } + + // ensure URI contains TCP scheme, host and port + if (!$parts || !isset($parts['scheme'], $parts['host'], $parts['port']) || $parts['scheme'] !== 'tcp') { + throw new \InvalidArgumentException( + 'Invalid URI "' . $uri . '" given (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + ); + } + + if (@\inet_pton(\trim($parts['host'], '[]')) === false) { + throw new \InvalidArgumentException( + 'Given URI "' . $uri . '" does not contain a valid host IP (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + ); + } + + $this->master = @\stream_socket_server( + $uri, + $errno, + $errstr, + \STREAM_SERVER_BIND | \STREAM_SERVER_LISTEN, + \stream_context_create(array('socket' => $context + array('backlog' => 511))) + ); + if (false === $this->master) { + if ($errno === 0) { + // PHP does not seem to report errno, so match errno from errstr + // @link https://3v4l.org/3qOBl + $errno = SocketServer::errno($errstr); + } + + throw new \RuntimeException( + 'Failed to listen on "' . $uri . '": ' . $errstr . SocketServer::errconst($errno), + $errno + ); + } + \stream_set_blocking($this->master, false); + + $this->resume(); + } + + public function getAddress() + { + if (!\is_resource($this->master)) { + return null; + } + + $address = \stream_socket_get_name($this->master, false); + + // check if this is an IPv6 address which includes multiple colons but no square brackets + $pos = \strrpos($address, ':'); + if ($pos !== false && \strpos($address, ':') < $pos && \substr($address, 0, 1) !== '[') { + $address = '[' . \substr($address, 0, $pos) . ']:' . \substr($address, $pos + 1); // @codeCoverageIgnore + } + + return 'tcp://' . $address; + } + + public function pause() + { + if (!$this->listening) { + return; + } + + $this->loop->removeReadStream($this->master); + $this->listening = false; + } + + public function resume() + { + if ($this->listening || !\is_resource($this->master)) { + return; + } + + $that = $this; + $this->loop->addReadStream($this->master, function ($master) use ($that) { + try { + $newSocket = SocketServer::accept($master); + } catch (\RuntimeException $e) { + $that->emit('error', array($e)); + return; + } + $that->handleConnection($newSocket); + }); + $this->listening = true; + } + + public function close() + { + if (!\is_resource($this->master)) { + return; + } + + $this->pause(); + \fclose($this->master); + $this->removeAllListeners(); + } + + /** @internal */ + public function handleConnection($socket) + { + $this->emit('connection', array( + new Connection($socket, $this->loop) + )); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/TimeoutConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/TimeoutConnector.php new file mode 100644 index 00000000..9ef252f7 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/TimeoutConnector.php @@ -0,0 +1,79 @@ +connector = $connector; + $this->timeout = $timeout; + $this->loop = $loop ?: Loop::get(); + } + + public function connect($uri) + { + $promise = $this->connector->connect($uri); + + $loop = $this->loop; + $time = $this->timeout; + return new Promise(function ($resolve, $reject) use ($loop, $time, $promise, $uri) { + $timer = null; + $promise = $promise->then(function ($v) use (&$timer, $loop, $resolve) { + if ($timer) { + $loop->cancelTimer($timer); + } + $timer = false; + $resolve($v); + }, function ($v) use (&$timer, $loop, $reject) { + if ($timer) { + $loop->cancelTimer($timer); + } + $timer = false; + $reject($v); + }); + + // promise already resolved => no need to start timer + if ($timer === false) { + return; + } + + // start timeout timer which will cancel the pending promise + $timer = $loop->addTimer($time, function () use ($time, &$promise, $reject, $uri) { + $reject(new \RuntimeException( + 'Connection to ' . $uri . ' timed out after ' . $time . ' seconds (ETIMEDOUT)', + \defined('SOCKET_ETIMEDOUT') ? \SOCKET_ETIMEDOUT : 110 + )); + + // Cancel pending connection to clean up any underlying resources and references. + // Avoid garbage references in call stack by passing pending promise by reference. + assert(\method_exists($promise, 'cancel')); + $promise->cancel(); + $promise = null; + }); + }, function () use (&$promise) { + // Cancelling this promise will cancel the pending connection, thus triggering the rejection logic above. + // Avoid garbage references in call stack by passing pending promise by reference. + assert(\method_exists($promise, 'cancel')); + $promise->cancel(); + $promise = null; + }); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/UnixConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/UnixConnector.php new file mode 100644 index 00000000..95f932cb --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/UnixConnector.php @@ -0,0 +1,58 @@ +loop = $loop ?: Loop::get(); + } + + public function connect($path) + { + if (\strpos($path, '://') === false) { + $path = 'unix://' . $path; + } elseif (\substr($path, 0, 7) !== 'unix://') { + return Promise\reject(new \InvalidArgumentException( + 'Given URI "' . $path . '" is invalid (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + )); + } + + $resource = @\stream_socket_client($path, $errno, $errstr, 1.0); + + if (!$resource) { + return Promise\reject(new \RuntimeException( + 'Unable to connect to unix domain socket "' . $path . '": ' . $errstr . SocketServer::errconst($errno), + $errno + )); + } + + $connection = new Connection($resource, $this->loop); + $connection->unix = true; + + return Promise\resolve($connection); + } +} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/UnixServer.php b/tools/php-cs-fixer/vendor/react/socket/src/UnixServer.php new file mode 100644 index 00000000..27b014d1 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/socket/src/UnixServer.php @@ -0,0 +1,162 @@ +loop = $loop ?: Loop::get(); + + if (\strpos($path, '://') === false) { + $path = 'unix://' . $path; + } elseif (\substr($path, 0, 7) !== 'unix://') { + throw new \InvalidArgumentException( + 'Given URI "' . $path . '" is invalid (EINVAL)', + \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) + ); + } + + $errno = 0; + $errstr = ''; + \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { + // PHP does not seem to report errno/errstr for Unix domain sockets (UDS) right now. + // This only applies to UDS server sockets, see also https://3v4l.org/NAhpr. + // Parse PHP warning message containing unknown error, HHVM reports proper info at least. + if (\preg_match('/\(([^\)]+)\)|\[(\d+)\]: (.*)/', $error, $match)) { + $errstr = isset($match[3]) ? $match['3'] : $match[1]; + $errno = isset($match[2]) ? (int)$match[2] : 0; + } + }); + + $this->master = \stream_socket_server( + $path, + $errno, + $errstr, + \STREAM_SERVER_BIND | \STREAM_SERVER_LISTEN, + \stream_context_create(array('socket' => $context)) + ); + + \restore_error_handler(); + + if (false === $this->master) { + throw new \RuntimeException( + 'Failed to listen on Unix domain socket "' . $path . '": ' . $errstr . SocketServer::errconst($errno), + $errno + ); + } + \stream_set_blocking($this->master, 0); + + $this->resume(); + } + + public function getAddress() + { + if (!\is_resource($this->master)) { + return null; + } + + return 'unix://' . \stream_socket_get_name($this->master, false); + } + + public function pause() + { + if (!$this->listening) { + return; + } + + $this->loop->removeReadStream($this->master); + $this->listening = false; + } + + public function resume() + { + if ($this->listening || !is_resource($this->master)) { + return; + } + + $that = $this; + $this->loop->addReadStream($this->master, function ($master) use ($that) { + try { + $newSocket = SocketServer::accept($master); + } catch (\RuntimeException $e) { + $that->emit('error', array($e)); + return; + } + $that->handleConnection($newSocket); + }); + $this->listening = true; + } + + public function close() + { + if (!\is_resource($this->master)) { + return; + } + + $this->pause(); + \fclose($this->master); + $this->removeAllListeners(); + } + + /** @internal */ + public function handleConnection($socket) + { + $connection = new Connection($socket, $this->loop); + $connection->unix = true; + + $this->emit('connection', array( + $connection + )); + } +} diff --git a/tools/php-cs-fixer/vendor/react/stream/CHANGELOG.md b/tools/php-cs-fixer/vendor/react/stream/CHANGELOG.md new file mode 100644 index 00000000..639db658 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/CHANGELOG.md @@ -0,0 +1,460 @@ +# Changelog + +## 1.4.0 (2024-06-11) + +* Feature: Improve PHP 8.4+ support by avoiding implicitly nullable type declarations. + (#179 by @clue) + +* Feature: Full PHP 8.3 compatibility. + (#172 by @clue) + +* Fix: Fix `drain` event of `ThroughStream` to handle potential race condition. + (#171 by @clue) + +## 1.3.0 (2023-06-16) + +* Feature: Full PHP 8.1 and PHP 8.2 compatibility. + (#160 by @SimonFrings, #165 by @clue and #169 by @WyriHaximus) + +* Feature: Avoid unneeded syscall when creating non-blocking `DuplexResourceStream`. + (#164 by @clue) + +* Minor documentation improvements. + (#161 by @mrsimonbennett, #162 by @SimonFrings and #166 by @nhedger) + +* Improve test suite and project setup and report failed assertions. + (#168 and #170 by @clue and #163 by @SimonFrings) + +## 1.2.0 (2021-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). + +* Feature: Simplify usage by supporting new [default loop](https://reactphp.org/event-loop/#loop). + (#159 by @clue) + + ```php + // old (still supported) + $stream = new ReadableResourceStream($resource, $loop); + $stream = new WritabeResourceStream($resource, $loop); + $stream = new DuplexResourceStream($resource, $loop); + + // new (using default loop) + $stream = new ReadableResourceStream($resource); + $stream = new WritabeResourceStream($resource); + $stream = new DuplexResourceStream($resource); + ``` + +* Improve test suite, use GitHub actions for continuous integration (CI), + update PHPUnit config, run tests on PHP 8 and add full core team to the license. + (#153, #156 and #157 by @SimonFrings and #154 by @WyriHaximus) + +## 1.1.1 (2020-05-04) + +* Fix: Fix faulty write buffer behavior when sending large data chunks over TLS (Mac OS X only). + (#150 by @clue) + +* Minor code style improvements to fix phpstan analysis warnings and + add `.gitattributes` to exclude dev files from exports. + (#140 by @flow-control and #144 by @reedy) + +* Improve test suite to run tests on PHP 7.4 and simplify test matrix. + (#147 by @clue) + +## 1.1.0 (2019-01-01) + +* Improvement: Increase performance by optimizing global function and constant look ups. + (#137 by @WyriHaximus) + +* Travis: Test against PHP 7.3. + (#138 by @WyriHaximus) + +* Fix: Ignore empty reads. + (#139 by @WyriHaximus) + +## 1.0.0 (2018-07-11) + +* First stable LTS release, now following [SemVer](https://semver.org/). + We'd like to emphasize that this component is production ready and battle-tested. + We plan to support all long-term support (LTS) releases for at least 24 months, + so you have a rock-solid foundation to build on top of. + +> Contains no other changes, so it's actually fully compatible with the v0.7.7 release. + +## 0.7.7 (2018-01-19) + +* Improve test suite by fixing forward compatibility with upcoming EventLoop + releases, avoid risky tests and add test group to skip integration tests + relying on internet connection and apply appropriate test timeouts. + (#128, #131 and #132 by @clue) + +## 0.7.6 (2017-12-21) + +* Fix: Work around reading from unbuffered pipe stream in legacy PHP < 5.4.28 and PHP < 5.5.12 + (#126 by @clue) + +* Improve test suite by simplifying test bootstrapping logic via Composer and + test against PHP 7.2 + (#127 by @clue and #124 by @carusogabriel) + +## 0.7.5 (2017-11-20) + +* Fix: Igore excessive `fopen()` mode flags for `WritableResourceStream` + (#119 by @clue) + +* Fix: Fix forward compatibility with upcoming EventLoop releases + (#121 by @clue) + +* Restructure examples to ease getting started + (#123 by @clue) + +* Improve test suite by adding forward compatibility with PHPUnit 6 and + ignore Mac OS X test failures for now until Travis tests work again + (#122 by @gabriel-caruso and #120 by @clue) + +## 0.7.4 (2017-10-11) + +* Fix: Remove event listeners from `CompositeStream` once closed and + remove undocumented left-over `close` event argument + (#116 by @clue) + +* Minor documentation improvements: Fix wrong class name in example, + fix typos in README and + fix forward compatibility with upcoming EventLoop releases in example + (#113 by @docteurklein and #114 and #115 by @clue) + +* Improve test suite by running against Mac OS X on Travis + (#112 by @clue) + +## 0.7.3 (2017-08-05) + +* Improvement: Support Événement 3.0 a long side 2.0 and 1.0 + (#108 by @WyriHaximus) + +* Readme: Corrected loop initialization in usage example + (#109 by @pulyavin) + +* Travis: Lock linux distribution preventing future builds from breaking + (#110 by @clue) + +## 0.7.2 (2017-06-15) + +* Bug fix: WritableResourceStream: Close the underlying stream when closing the stream. + (#107 by @WyriHaximus) + +## 0.7.1 (2017-05-20) + +* Feature: Add optional `$writeChunkSize` parameter to limit maximum number of + bytes to write at once. + (#105 by @clue) + + ```php + $stream = new WritableResourceStream(STDOUT, $loop, null, 8192); + ``` + +* Ignore HHVM test failures for now until Travis tests work again + (#106 by @clue) + +## 0.7.0 (2017-05-04) + +* Removed / BC break: Remove deprecated and unneeded functionality + (#45, #87, #90, #91 and #93 by @clue) + + * Remove deprecated `Stream` class, use `DuplexResourceStream` instead + (#87 by @clue) + + * Remove public `$buffer` property, use new constructor parameters instead + (#91 by @clue) + + * Remove public `$stream` property from all resource streams + (#90 by @clue) + + * Remove undocumented and now unused `ReadableStream` and `WritableStream` + (#93 by @clue) + + * Remove `BufferedSink` + (#45 by @clue) + +* Feature / BC break: Simplify `ThroughStream` by using data callback instead of + inheritance. It is now a direct implementation of `DuplexStreamInterface`. + (#88 and #89 by @clue) + + ```php + $through = new ThroughStream(function ($data) { + return json_encode($data) . PHP_EOL; + }); + $through->on('data', $this->expectCallableOnceWith("[2, true]\n")); + + $through->write(array(2, true)); + ``` + +* Feature / BC break: The `CompositeStream` starts closed if either side is + already closed and forwards pause to pipe source on first write attempt. + (#96 and #103 by @clue) + + If either side of the composite stream closes, it will also close the other + side. We now also ensure that if either side is already closed during + instantiation, it will also close the other side. + +* BC break: Mark all classes as `final` and + mark internal API as `private` to discourage inheritance + (#95 and #99 by @clue) + +* Feature / BC break: Only emit `error` event for fatal errors + (#92 by @clue) + + > The `error` event was previously also allowed to be emitted for non-fatal + errors, but our implementations actually only ever emitted this as a fatal + error and then closed the stream. + +* Feature: Explicitly allow custom events and exclude any semantics + (#97 by @clue) + +* Strict definition for event callback functions + (#101 by @clue) + +* Support legacy PHP 5.3 through PHP 7.1 and HHVM and improve usage documentation + (#100 and #102 by @clue) + +* Actually require all dependencies so this is self-contained and improve + forward compatibility with EventLoop v1.0 and v0.5 + (#94 and #98 by @clue) + +## 0.6.0 (2017-03-26) + +* Feature / Fix / BC break: Add `DuplexResourceStream` and deprecate `Stream` + (#85 by @clue) + + ```php + // old (does still work for BC reasons) + $stream = new Stream($connection, $loop); + + // new + $stream = new DuplexResourceStream($connection, $loop); + ``` + + Note that the `DuplexResourceStream` now rejects read-only or write-only + streams, so this may affect BC. If you want a read-only or write-only + resource, use `ReadableResourceStream` or `WritableResourceStream` instead of + `DuplexResourceStream`. + + > BC note: This class was previously called `Stream`. The `Stream` class still + exists for BC reasons and will be removed in future versions of this package. + +* Feature / BC break: Add `WritableResourceStream` (previously called `Buffer`) + (#84 by @clue) + + ```php + // old + $stream = new Buffer(STDOUT, $loop); + + // new + $stream = new WritableResourceStream(STDOUT, $loop); + ``` + +* Feature: Add `ReadableResourceStream` + (#83 by @clue) + + ```php + $stream = new ReadableResourceStream(STDIN, $loop); + ``` + +* Fix / BC Break: Enforce using non-blocking I/O + (#46 by @clue) + + > BC note: This is known to affect process pipes on Windows which do not + support non-blocking I/O and could thus block the whole EventLoop previously. + +* Feature / Fix / BC break: Consistent semantics for + `DuplexStreamInterface::end()` to ensure it SHOULD also end readable side + (#86 by @clue) + +* Fix: Do not use unbuffered reads on pipe streams for legacy PHP < 5.4 + (#80 by @clue) + +## 0.5.0 (2017-03-08) + +* Feature / BC break: Consistent `end` event semantics (EOF) + (#70 by @clue) + + The `end` event will now only be emitted for a *successful* end, not if the + stream closes due to an unrecoverable `error` event or if you call `close()` + explicitly. + If you want to detect when the stream closes (terminates), use the `close` + event instead. + +* BC break: Remove custom (undocumented) `full-drain` event from `Buffer` + (#63 and #68 by @clue) + + > The `full-drain` event was undocumented and mostly used internally. + Relying on this event has attracted some low-quality code in the past, so + we've removed this from the public API in order to work out a better + solution instead. + If you want to detect when the buffer finishes flushing data to the stream, + you may want to look into its `end()` method or the `close` event instead. + +* Feature / BC break: Consistent event semantics and documentation, + explicitly state *when* events will be emitted and *which* arguments they + receive. + (#73 and #69 by @clue) + + The documentation now explicitly defines each event and its arguments. + Custom events and event arguments are still supported. + Most notably, all defined events only receive inherently required event + arguments and no longer transmit the instance they are emitted on for + consistency and performance reasons. + + ```php + // old (inconsistent and not supported by all implementations) + $stream->on('data', function ($data, $stream) { + // process $data + }); + + // new (consistent throughout the whole ecosystem) + $stream->on('data', function ($data) use ($stream) { + // process $data + }); + ``` + + > This mostly adds documentation (and thus some stricter, consistent + definitions) for the existing behavior, it does NOT define any major + changes otherwise. + Most existing code should be compatible with these changes, unless + it relied on some undocumented/unintended semantics. + +* Feature / BC break: Consistent method semantics and documentation + (#72 by @clue) + + > This mostly adds documentation (and thus some stricter, consistent + definitions) for the existing behavior, it does NOT define any major + changes otherwise. + Most existing code should be compatible with these changes, unless + it relied on some undocumented/unintended semantics. + +* Feature: Consistent `pipe()` semantics for closed and closing streams + (#71 from @clue) + + The source stream will now always be paused via `pause()` when the + destination stream closes. Also, properly stop piping if the source + stream closes and remove all event forwarding. + +* Improve test suite by adding PHPUnit to `require-dev` and improving coverage. + (#74 and #75 by @clue, #66 by @nawarian) + +## 0.4.6 (2017-01-25) + +* Feature: The `Buffer` can now be injected into the `Stream` (or be used standalone) + (#62 by @clue) + +* Fix: Forward `close` event only once for `CompositeStream` and `ThroughStream` + (#60 by @clue) + +* Fix: Consistent `close` event behavior for `Buffer` + (#61 by @clue) + +## 0.4.5 (2016-11-13) + +* Feature: Support setting read buffer size to `null` (infinite) + (#42 by @clue) + +* Fix: Do not emit `full-drain` event if `Buffer` is closed during `drain` event + (#55 by @clue) + +* Vastly improved performance by factor of 10x to 20x. + Raise default buffer sizes to 64 KiB and simplify and improve error handling + and unneeded function calls. + (#53, #55, #56 by @clue) + +## 0.4.4 (2016-08-22) + +* Bug fix: Emit `error` event and close `Stream` when accessing the underlying + stream resource fails with a permanent error. + (#52 and #40 by @clue, #25 by @lysenkobv) + +* Bug fix: Do not emit empty `data` event if nothing has been read (stream reached EOF) + (#39 by @clue) + +* Bug fix: Ignore empty writes to `Buffer` + (#51 by @clue) + +* Add benchmarking script to measure throughput in CI + (#41 by @clue) + +## 0.4.3 (2015-10-07) + +* Bug fix: Read buffer to 0 fixes error with libevent and large quantity of I/O (@mbonneau) +* Bug fix: No double-write during drain call (@arnaud-lb) +* Bug fix: Support HHVM (@clue) +* Adjust compatibility to 5.3 (@clue) + +## 0.4.2 (2014-09-09) + +* Added DuplexStreamInterface +* Stream sets stream resources to non-blocking +* Fixed potential race condition in pipe + +## 0.4.1 (2014-04-13) + +* Bug fix: v0.3.4 changes merged for v0.4.1 + +## 0.3.4 (2014-03-30) + +* Bug fix: [Stream] Fixed 100% CPU spike from non-empty write buffer on closed stream + +## 0.4.0 (2014-02-02) + +* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks +* BC break: Update to Evenement 2.0 +* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0 + +## 0.3.3 (2013-07-08) + +* Bug fix: [Stream] Correctly detect closed connections + +## 0.3.2 (2013-05-10) + +* Bug fix: [Stream] Make sure CompositeStream is closed properly + +## 0.3.1 (2013-04-21) + +* Bug fix: [Stream] Allow any `ReadableStreamInterface` on `BufferedSink::createPromise()` + +## 0.3.0 (2013-04-14) + +* Feature: [Stream] Factory method for BufferedSink + +## 0.2.6 (2012-12-26) + +* Version bump + +## 0.2.5 (2012-11-26) + +* Feature: Make BufferedSink trigger progress events on the promise (@jsor) + +## 0.2.4 (2012-11-18) + +* Feature: Added ThroughStream, CompositeStream, ReadableStream and WritableStream +* Feature: Added BufferedSink + +## 0.2.3 (2012-11-14) + +* Version bump + +## 0.2.2 (2012-10-28) + +* Version bump + +## 0.2.1 (2012-10-14) + +* Bug fix: Check for EOF in `Buffer::write()` + +## 0.2.0 (2012-09-10) + +* Version bump + +## 0.1.1 (2012-07-12) + +* Bug fix: Testing and functional against PHP >= 5.3.3 and <= 5.3.8 + +## 0.1.0 (2012-07-11) + +* First tagged release diff --git a/tools/php-cs-fixer/vendor/react/stream/LICENSE b/tools/php-cs-fixer/vendor/react/stream/LICENSE new file mode 100644 index 00000000..d6f8901f --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/stream/README.md b/tools/php-cs-fixer/vendor/react/stream/README.md new file mode 100644 index 00000000..9c0468a6 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/README.md @@ -0,0 +1,1249 @@ +# Stream + +[![CI status](https://github.com/reactphp/stream/actions/workflows/ci.yml/badge.svg)](https://github.com/reactphp/stream/actions) +[![installs on Packagist](https://img.shields.io/packagist/dt/react/stream?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/stream) + +Event-driven readable and writable streams for non-blocking I/O in [ReactPHP](https://reactphp.org/). + +In order to make the [EventLoop](https://github.com/reactphp/event-loop) +easier to use, this component introduces the powerful concept of "streams". +Streams allow you to efficiently process huge amounts of data (such as a multi +Gigabyte file download) in small chunks without having to store everything in +memory at once. +They are very similar to the streams found in PHP itself, +but have an interface more suited for async, non-blocking I/O. + +**Table of contents** + +* [Stream usage](#stream-usage) + * [ReadableStreamInterface](#readablestreaminterface) + * [data event](#data-event) + * [end event](#end-event) + * [error event](#error-event) + * [close event](#close-event) + * [isReadable()](#isreadable) + * [pause()](#pause) + * [resume()](#resume) + * [pipe()](#pipe) + * [close()](#close) + * [WritableStreamInterface](#writablestreaminterface) + * [drain event](#drain-event) + * [pipe event](#pipe-event) + * [error event](#error-event-1) + * [close event](#close-event-1) + * [isWritable()](#iswritable) + * [write()](#write) + * [end()](#end) + * [close()](#close-1) + * [DuplexStreamInterface](#duplexstreaminterface) +* [Creating streams](#creating-streams) + * [ReadableResourceStream](#readableresourcestream) + * [WritableResourceStream](#writableresourcestream) + * [DuplexResourceStream](#duplexresourcestream) + * [ThroughStream](#throughstream) + * [CompositeStream](#compositestream) +* [Usage](#usage) +* [Install](#install) +* [Tests](#tests) +* [License](#license) +* [More](#more) + +## Stream usage + +ReactPHP uses the concept of "streams" throughout its ecosystem to provide a +consistent higher-level abstraction for processing streams of arbitrary data +contents and size. +While a stream itself is a quite low-level concept, it can be used as a powerful +abstraction to build higher-level components and protocols on top. + +If you're new to this concept, it helps to think of them as a water pipe: +You can consume water from a source or you can produce water and forward (pipe) +it to any destination (sink). + +Similarly, streams can either be + +* readable (such as `STDIN` terminal input) or +* writable (such as `STDOUT` terminal output) or +* duplex (both readable *and* writable, such as a TCP/IP connection) + +Accordingly, this package defines the following three interfaces + +* [`ReadableStreamInterface`](#readablestreaminterface) +* [`WritableStreamInterface`](#writablestreaminterface) +* [`DuplexStreamInterface`](#duplexstreaminterface) + +### ReadableStreamInterface + +The `ReadableStreamInterface` is responsible for providing an interface for +read-only streams and the readable side of duplex streams. + +Besides defining a few methods, this interface also implements the +`EventEmitterInterface` which allows you to react to certain events. + +The event callback functions MUST be a valid `callable` that obeys strict +parameter definitions and MUST accept event parameters exactly as documented. +The event callback functions MUST NOT throw an `Exception`. +The return value of the event callback functions will be ignored and has no +effect, so for performance reasons you're recommended to not return any +excessive data structures. + +Every implementation of this interface MUST follow these event semantics in +order to be considered a well-behaving stream. + +> Note that higher-level implementations of this interface may choose to + define additional events with dedicated semantics not defined as part of + this low-level stream specification. Conformance with these event semantics + is out of scope for this interface, so you may also have to refer to the + documentation of such a higher-level implementation. + +#### data event + +The `data` event will be emitted whenever some data was read/received +from this source stream. +The event receives a single mixed argument for incoming data. + +```php +$stream->on('data', function ($data) { + echo $data; +}); +``` + +This event MAY be emitted any number of times, which may be zero times if +this stream does not send any data at all. +It SHOULD not be emitted after an `end` or `close` event. + +The given `$data` argument may be of mixed type, but it's usually +recommended it SHOULD be a `string` value or MAY use a type that allows +representation as a `string` for maximum compatibility. + +Many common streams (such as a TCP/IP connection or a file-based stream) +will emit the raw (binary) payload data that is received over the wire as +chunks of `string` values. + +Due to the stream-based nature of this, the sender may send any number +of chunks with varying sizes. There are no guarantees that these chunks +will be received with the exact same framing the sender intended to send. +In other words, many lower-level protocols (such as TCP/IP) transfer the +data in chunks that may be anywhere between single-byte values to several +dozens of kilobytes. You may want to apply a higher-level protocol to +these low-level data chunks in order to achieve proper message framing. + +#### end event + +The `end` event will be emitted once the source stream has successfully +reached the end of the stream (EOF). + +```php +$stream->on('end', function () { + echo 'END'; +}); +``` + +This event SHOULD be emitted once or never at all, depending on whether +a successful end was detected. +It SHOULD NOT be emitted after a previous `end` or `close` event. +It MUST NOT be emitted if the stream closes due to a non-successful +end, such as after a previous `error` event. + +After the stream is ended, it MUST switch to non-readable mode, +see also `isReadable()`. + +This event will only be emitted if the *end* was reached successfully, +not if the stream was interrupted by an unrecoverable error or explicitly +closed. Not all streams know this concept of a "successful end". +Many use-cases involve detecting when the stream closes (terminates) +instead, in this case you should use the `close` event. +After the stream emits an `end` event, it SHOULD usually be followed by a +`close` event. + +Many common streams (such as a TCP/IP connection or a file-based stream) +will emit this event if either the remote side closes the connection or +a file handle was successfully read until reaching its end (EOF). + +Note that this event should not be confused with the `end()` method. +This event defines a successful end *reading* from a source stream, while +the `end()` method defines *writing* a successful end to a destination +stream. + +#### error event + +The `error` event will be emitted once a fatal error occurs, usually while +trying to read from this stream. +The event receives a single `Exception` argument for the error instance. + +```php +$server->on('error', function (Exception $e) { + echo 'Error: ' . $e->getMessage() . PHP_EOL; +}); +``` + +This event SHOULD be emitted once the stream detects a fatal error, such +as a fatal transmission error or after an unexpected `data` or premature +`end` event. +It SHOULD NOT be emitted after a previous `error`, `end` or `close` event. +It MUST NOT be emitted if this is not a fatal error condition, such as +a temporary network issue that did not cause any data to be lost. + +After the stream errors, it MUST close the stream and SHOULD thus be +followed by a `close` event and then switch to non-readable mode, see +also `close()` and `isReadable()`. + +Many common streams (such as a TCP/IP connection or a file-based stream) +only deal with data transmission and do not make assumption about data +boundaries (such as unexpected `data` or premature `end` events). +In other words, many lower-level protocols (such as TCP/IP) may choose +to only emit this for a fatal transmission error once and will then +close (terminate) the stream in response. + +If this stream is a `DuplexStreamInterface`, you should also notice +how the writable side of the stream also implements an `error` event. +In other words, an error may occur while either reading or writing the +stream which should result in the same error processing. + +#### close event + +The `close` event will be emitted once the stream closes (terminates). + +```php +$stream->on('close', function () { + echo 'CLOSED'; +}); +``` + +This event SHOULD be emitted once or never at all, depending on whether +the stream ever terminates. +It SHOULD NOT be emitted after a previous `close` event. + +After the stream is closed, it MUST switch to non-readable mode, +see also `isReadable()`. + +Unlike the `end` event, this event SHOULD be emitted whenever the stream +closes, irrespective of whether this happens implicitly due to an +unrecoverable error or explicitly when either side closes the stream. +If you only want to detect a *successful* end, you should use the `end` +event instead. + +Many common streams (such as a TCP/IP connection or a file-based stream) +will likely choose to emit this event after reading a *successful* `end` +event or after a fatal transmission `error` event. + +If this stream is a `DuplexStreamInterface`, you should also notice +how the writable side of the stream also implements a `close` event. +In other words, after receiving this event, the stream MUST switch into +non-writable AND non-readable mode, see also `isWritable()`. +Note that this event should not be confused with the `end` event. + +#### isReadable() + +The `isReadable(): bool` method can be used to +check whether this stream is in a readable state (not closed already). + +This method can be used to check if the stream still accepts incoming +data events or if it is ended or closed already. +Once the stream is non-readable, no further `data` or `end` events SHOULD +be emitted. + +```php +assert($stream->isReadable() === false); + +$stream->on('data', assertNeverCalled()); +$stream->on('end', assertNeverCalled()); +``` + +A successfully opened stream always MUST start in readable mode. + +Once the stream ends or closes, it MUST switch to non-readable mode. +This can happen any time, explicitly through `close()` or +implicitly due to a remote close or an unrecoverable transmission error. +Once a stream has switched to non-readable mode, it MUST NOT transition +back to readable mode. + +If this stream is a `DuplexStreamInterface`, you should also notice +how the writable side of the stream also implements an `isWritable()` +method. Unless this is a half-open duplex stream, they SHOULD usually +have the same return value. + +#### pause() + +The `pause(): void` method can be used to +pause reading incoming data events. + +Removes the data source file descriptor from the event loop. This +allows you to throttle incoming data. + +Unless otherwise noted, a successfully opened stream SHOULD NOT start +in paused state. + +Once the stream is paused, no futher `data` or `end` events SHOULD +be emitted. + +```php +$stream->pause(); + +$stream->on('data', assertShouldNeverCalled()); +$stream->on('end', assertShouldNeverCalled()); +``` + +This method is advisory-only, though generally not recommended, the +stream MAY continue emitting `data` events. + +You can continue processing events by calling `resume()` again. + +Note that both methods can be called any number of times, in particular +calling `pause()` more than once SHOULD NOT have any effect. + +See also `resume()`. + +#### resume() + +The `resume(): void` method can be used to +resume reading incoming data events. + +Re-attach the data source after a previous `pause()`. + +```php +$stream->pause(); + +Loop::addTimer(1.0, function () use ($stream) { + $stream->resume(); +}); +``` + +Note that both methods can be called any number of times, in particular +calling `resume()` without a prior `pause()` SHOULD NOT have any effect. + +See also `pause()`. + +#### pipe() + +The `pipe(WritableStreamInterface $dest, array $options = [])` method can be used to +pipe all the data from this readable source into the given writable destination. + +Automatically sends all incoming data to the destination. +Automatically throttles the source based on what the destination can handle. + +```php +$source->pipe($dest); +``` + +Similarly, you can also pipe an instance implementing `DuplexStreamInterface` +into itself in order to write back all the data that is received. +This may be a useful feature for a TCP/IP echo service: + +```php +$connection->pipe($connection); +``` + +This method returns the destination stream as-is, which can be used to +set up chains of piped streams: + +```php +$source->pipe($decodeGzip)->pipe($filterBadWords)->pipe($dest); +``` + +By default, this will call `end()` on the destination stream once the +source stream emits an `end` event. This can be disabled like this: + +```php +$source->pipe($dest, array('end' => false)); +``` + +Note that this only applies to the `end` event. +If an `error` or explicit `close` event happens on the source stream, +you'll have to manually close the destination stream: + +```php +$source->pipe($dest); +$source->on('close', function () use ($dest) { + $dest->end('BYE!'); +}); +``` + +If the source stream is not readable (closed state), then this is a NO-OP. + +```php +$source->close(); +$source->pipe($dest); // NO-OP +``` + +If the destinantion stream is not writable (closed state), then this will simply +throttle (pause) the source stream: + +```php +$dest->close(); +$source->pipe($dest); // calls $source->pause() +``` + +Similarly, if the destination stream is closed while the pipe is still +active, it will also throttle (pause) the source stream: + +```php +$source->pipe($dest); +$dest->close(); // calls $source->pause() +``` + +Once the pipe is set up successfully, the destination stream MUST emit +a `pipe` event with this source stream an event argument. + +#### close() + +The `close(): void` method can be used to +close the stream (forcefully). + +This method can be used to (forcefully) close the stream. + +```php +$stream->close(); +``` + +Once the stream is closed, it SHOULD emit a `close` event. +Note that this event SHOULD NOT be emitted more than once, in particular +if this method is called multiple times. + +After calling this method, the stream MUST switch into a non-readable +mode, see also `isReadable()`. +This means that no further `data` or `end` events SHOULD be emitted. + +```php +$stream->close(); +assert($stream->isReadable() === false); + +$stream->on('data', assertNeverCalled()); +$stream->on('end', assertNeverCalled()); +``` + +If this stream is a `DuplexStreamInterface`, you should also notice +how the writable side of the stream also implements a `close()` method. +In other words, after calling this method, the stream MUST switch into +non-writable AND non-readable mode, see also `isWritable()`. +Note that this method should not be confused with the `end()` method. + +### WritableStreamInterface + +The `WritableStreamInterface` is responsible for providing an interface for +write-only streams and the writable side of duplex streams. + +Besides defining a few methods, this interface also implements the +`EventEmitterInterface` which allows you to react to certain events. + +The event callback functions MUST be a valid `callable` that obeys strict +parameter definitions and MUST accept event parameters exactly as documented. +The event callback functions MUST NOT throw an `Exception`. +The return value of the event callback functions will be ignored and has no +effect, so for performance reasons you're recommended to not return any +excessive data structures. + +Every implementation of this interface MUST follow these event semantics in +order to be considered a well-behaving stream. + +> Note that higher-level implementations of this interface may choose to + define additional events with dedicated semantics not defined as part of + this low-level stream specification. Conformance with these event semantics + is out of scope for this interface, so you may also have to refer to the + documentation of such a higher-level implementation. + +#### drain event + +The `drain` event will be emitted whenever the write buffer became full +previously and is now ready to accept more data. + +```php +$stream->on('drain', function () use ($stream) { + echo 'Stream is now ready to accept more data'; +}); +``` + +This event SHOULD be emitted once every time the buffer became full +previously and is now ready to accept more data. +In other words, this event MAY be emitted any number of times, which may +be zero times if the buffer never became full in the first place. +This event SHOULD NOT be emitted if the buffer has not become full +previously. + +This event is mostly used internally, see also `write()` for more details. + +#### pipe event + +The `pipe` event will be emitted whenever a readable stream is `pipe()`d +into this stream. +The event receives a single `ReadableStreamInterface` argument for the +source stream. + +```php +$stream->on('pipe', function (ReadableStreamInterface $source) use ($stream) { + echo 'Now receiving piped data'; + + // explicitly close target if source emits an error + $source->on('error', function () use ($stream) { + $stream->close(); + }); +}); + +$source->pipe($stream); +``` + +This event MUST be emitted once for each readable stream that is +successfully piped into this destination stream. +In other words, this event MAY be emitted any number of times, which may +be zero times if no stream is ever piped into this stream. +This event MUST NOT be emitted if either the source is not readable +(closed already) or this destination is not writable (closed already). + +This event is mostly used internally, see also `pipe()` for more details. + +#### error event + +The `error` event will be emitted once a fatal error occurs, usually while +trying to write to this stream. +The event receives a single `Exception` argument for the error instance. + +```php +$stream->on('error', function (Exception $e) { + echo 'Error: ' . $e->getMessage() . PHP_EOL; +}); +``` + +This event SHOULD be emitted once the stream detects a fatal error, such +as a fatal transmission error. +It SHOULD NOT be emitted after a previous `error` or `close` event. +It MUST NOT be emitted if this is not a fatal error condition, such as +a temporary network issue that did not cause any data to be lost. + +After the stream errors, it MUST close the stream and SHOULD thus be +followed by a `close` event and then switch to non-writable mode, see +also `close()` and `isWritable()`. + +Many common streams (such as a TCP/IP connection or a file-based stream) +only deal with data transmission and may choose +to only emit this for a fatal transmission error once and will then +close (terminate) the stream in response. + +If this stream is a `DuplexStreamInterface`, you should also notice +how the readable side of the stream also implements an `error` event. +In other words, an error may occur while either reading or writing the +stream which should result in the same error processing. + +#### close event + +The `close` event will be emitted once the stream closes (terminates). + +```php +$stream->on('close', function () { + echo 'CLOSED'; +}); +``` + +This event SHOULD be emitted once or never at all, depending on whether +the stream ever terminates. +It SHOULD NOT be emitted after a previous `close` event. + +After the stream is closed, it MUST switch to non-writable mode, +see also `isWritable()`. + +This event SHOULD be emitted whenever the stream closes, irrespective of +whether this happens implicitly due to an unrecoverable error or +explicitly when either side closes the stream. + +Many common streams (such as a TCP/IP connection or a file-based stream) +will likely choose to emit this event after flushing the buffer from +the `end()` method, after receiving a *successful* `end` event or after +a fatal transmission `error` event. + +If this stream is a `DuplexStreamInterface`, you should also notice +how the readable side of the stream also implements a `close` event. +In other words, after receiving this event, the stream MUST switch into +non-writable AND non-readable mode, see also `isReadable()`. +Note that this event should not be confused with the `end` event. + +#### isWritable() + +The `isWritable(): bool` method can be used to +check whether this stream is in a writable state (not closed already). + +This method can be used to check if the stream still accepts writing +any data or if it is ended or closed already. +Writing any data to a non-writable stream is a NO-OP: + +```php +assert($stream->isWritable() === false); + +$stream->write('end'); // NO-OP +$stream->end('end'); // NO-OP +``` + +A successfully opened stream always MUST start in writable mode. + +Once the stream ends or closes, it MUST switch to non-writable mode. +This can happen any time, explicitly through `end()` or `close()` or +implicitly due to a remote close or an unrecoverable transmission error. +Once a stream has switched to non-writable mode, it MUST NOT transition +back to writable mode. + +If this stream is a `DuplexStreamInterface`, you should also notice +how the readable side of the stream also implements an `isReadable()` +method. Unless this is a half-open duplex stream, they SHOULD usually +have the same return value. + +#### write() + +The `write(mixed $data): bool` method can be used to +write some data into the stream. + +A successful write MUST be confirmed with a boolean `true`, which means +that either the data was written (flushed) immediately or is buffered and +scheduled for a future write. Note that this interface gives you no +control over explicitly flushing the buffered data, as finding the +appropriate time for this is beyond the scope of this interface and left +up to the implementation of this interface. + +Many common streams (such as a TCP/IP connection or file-based stream) +may choose to buffer all given data and schedule a future flush by using +an underlying EventLoop to check when the resource is actually writable. + +If a stream cannot handle writing (or flushing) the data, it SHOULD emit +an `error` event and MAY `close()` the stream if it can not recover from +this error. + +If the internal buffer is full after adding `$data`, then `write()` +SHOULD return `false`, indicating that the caller should stop sending +data until the buffer drains. +The stream SHOULD send a `drain` event once the buffer is ready to accept +more data. + +Similarly, if the stream is not writable (already in a closed state) +it MUST NOT process the given `$data` and SHOULD return `false`, +indicating that the caller should stop sending data. + +The given `$data` argument MAY be of mixed type, but it's usually +recommended it SHOULD be a `string` value or MAY use a type that allows +representation as a `string` for maximum compatibility. + +Many common streams (such as a TCP/IP connection or a file-based stream) +will only accept the raw (binary) payload data that is transferred over +the wire as chunks of `string` values. + +Due to the stream-based nature of this, the sender may send any number +of chunks with varying sizes. There are no guarantees that these chunks +will be received with the exact same framing the sender intended to send. +In other words, many lower-level protocols (such as TCP/IP) transfer the +data in chunks that may be anywhere between single-byte values to several +dozens of kilobytes. You may want to apply a higher-level protocol to +these low-level data chunks in order to achieve proper message framing. + +#### end() + +The `end(mixed $data = null): void` method can be used to +successfully end the stream (after optionally sending some final data). + +This method can be used to successfully end the stream, i.e. close +the stream after sending out all data that is currently buffered. + +```php +$stream->write('hello'); +$stream->write('world'); +$stream->end(); +``` + +If there's no data currently buffered and nothing to be flushed, then +this method MAY `close()` the stream immediately. + +If there's still data in the buffer that needs to be flushed first, then +this method SHOULD try to write out this data and only then `close()` +the stream. +Once the stream is closed, it SHOULD emit a `close` event. + +Note that this interface gives you no control over explicitly flushing +the buffered data, as finding the appropriate time for this is beyond the +scope of this interface and left up to the implementation of this +interface. + +Many common streams (such as a TCP/IP connection or file-based stream) +may choose to buffer all given data and schedule a future flush by using +an underlying EventLoop to check when the resource is actually writable. + +You can optionally pass some final data that is written to the stream +before ending the stream. If a non-`null` value is given as `$data`, then +this method will behave just like calling `write($data)` before ending +with no data. + +```php +// shorter version +$stream->end('bye'); + +// same as longer version +$stream->write('bye'); +$stream->end(); +``` + +After calling this method, the stream MUST switch into a non-writable +mode, see also `isWritable()`. +This means that no further writes are possible, so any additional +`write()` or `end()` calls have no effect. + +```php +$stream->end(); +assert($stream->isWritable() === false); + +$stream->write('nope'); // NO-OP +$stream->end(); // NO-OP +``` + +If this stream is a `DuplexStreamInterface`, calling this method SHOULD +also end its readable side, unless the stream supports half-open mode. +In other words, after calling this method, these streams SHOULD switch +into non-writable AND non-readable mode, see also `isReadable()`. +This implies that in this case, the stream SHOULD NOT emit any `data` +or `end` events anymore. +Streams MAY choose to use the `pause()` method logic for this, but +special care may have to be taken to ensure a following call to the +`resume()` method SHOULD NOT continue emitting readable events. + +Note that this method should not be confused with the `close()` method. + +#### close() + +The `close(): void` method can be used to +close the stream (forcefully). + +This method can be used to forcefully close the stream, i.e. close +the stream without waiting for any buffered data to be flushed. +If there's still data in the buffer, this data SHOULD be discarded. + +```php +$stream->close(); +``` + +Once the stream is closed, it SHOULD emit a `close` event. +Note that this event SHOULD NOT be emitted more than once, in particular +if this method is called multiple times. + +After calling this method, the stream MUST switch into a non-writable +mode, see also `isWritable()`. +This means that no further writes are possible, so any additional +`write()` or `end()` calls have no effect. + +```php +$stream->close(); +assert($stream->isWritable() === false); + +$stream->write('nope'); // NO-OP +$stream->end(); // NO-OP +``` + +Note that this method should not be confused with the `end()` method. +Unlike the `end()` method, this method does not take care of any existing +buffers and simply discards any buffer contents. +Likewise, this method may also be called after calling `end()` on a +stream in order to stop waiting for the stream to flush its final data. + +```php +$stream->end(); +Loop::addTimer(1.0, function () use ($stream) { + $stream->close(); +}); +``` + +If this stream is a `DuplexStreamInterface`, you should also notice +how the readable side of the stream also implements a `close()` method. +In other words, after calling this method, the stream MUST switch into +non-writable AND non-readable mode, see also `isReadable()`. + +### DuplexStreamInterface + +The `DuplexStreamInterface` is responsible for providing an interface for +duplex streams (both readable and writable). + +It builds on top of the existing interfaces for readable and writable streams +and follows the exact same method and event semantics. +If you're new to this concept, you should look into the +`ReadableStreamInterface` and `WritableStreamInterface` first. + +Besides defining a few methods, this interface also implements the +`EventEmitterInterface` which allows you to react to the same events defined +on the `ReadbleStreamInterface` and `WritableStreamInterface`. + +The event callback functions MUST be a valid `callable` that obeys strict +parameter definitions and MUST accept event parameters exactly as documented. +The event callback functions MUST NOT throw an `Exception`. +The return value of the event callback functions will be ignored and has no +effect, so for performance reasons you're recommended to not return any +excessive data structures. + +Every implementation of this interface MUST follow these event semantics in +order to be considered a well-behaving stream. + +> Note that higher-level implementations of this interface may choose to + define additional events with dedicated semantics not defined as part of + this low-level stream specification. Conformance with these event semantics + is out of scope for this interface, so you may also have to refer to the + documentation of such a higher-level implementation. + +See also [`ReadableStreamInterface`](#readablestreaminterface) and +[`WritableStreamInterface`](#writablestreaminterface) for more details. + +## Creating streams + +ReactPHP uses the concept of "streams" throughout its ecosystem, so that +many higher-level consumers of this package only deal with +[stream usage](#stream-usage). +This implies that stream instances are most often created within some +higher-level components and many consumers never actually have to deal with +creating a stream instance. + +* Use [react/socket](https://github.com/reactphp/socket) + if you want to accept incoming or establish outgoing plaintext TCP/IP or + secure TLS socket connection streams. +* Use [react/http](https://github.com/reactphp/http) + if you want to receive an incoming HTTP request body streams. +* Use [react/child-process](https://github.com/reactphp/child-process) + if you want to communicate with child processes via process pipes such as + STDIN, STDOUT, STDERR etc. +* Use experimental [react/filesystem](https://github.com/reactphp/filesystem) + if you want to read from / write to the filesystem. +* See also the last chapter for [more real-world applications](#more). + +However, if you are writing a lower-level component or want to create a stream +instance from a stream resource, then the following chapter is for you. + +> Note that the following examples use `fopen()` and `stream_socket_client()` + for illustration purposes only. + These functions SHOULD NOT be used in a truly async program because each call + may take several seconds to complete and would block the EventLoop otherwise. + Additionally, the `fopen()` call will return a file handle on some platforms + which may or may not be supported by all EventLoop implementations. + As an alternative, you may want to use higher-level libraries listed above. + +### ReadableResourceStream + +The `ReadableResourceStream` is a concrete implementation of the +[`ReadableStreamInterface`](#readablestreaminterface) for PHP's stream resources. + +This can be used to represent a read-only resource like a file stream opened in +readable mode or a stream such as `STDIN`: + +```php +$stream = new ReadableResourceStream(STDIN); +$stream->on('data', function ($chunk) { + echo $chunk; +}); +$stream->on('end', function () { + echo 'END'; +}); +``` + +See also [`ReadableStreamInterface`](#readablestreaminterface) for more details. + +The first parameter given to the constructor MUST be a valid stream resource +that is opened in reading mode (e.g. `fopen()` mode `r`). +Otherwise, it will throw an `InvalidArgumentException`: + +```php +// throws InvalidArgumentException +$stream = new ReadableResourceStream(false); +``` + +See also the [`DuplexResourceStream`](#readableresourcestream) for read-and-write +stream resources otherwise. + +Internally, this class tries to enable non-blocking mode on the stream resource +which may not be supported for all stream resources. +Most notably, this is not supported by pipes on Windows (STDIN etc.). +If this fails, it will throw a `RuntimeException`: + +```php +// throws RuntimeException on Windows +$stream = new ReadableResourceStream(STDIN); +``` + +Once the constructor is called with a valid stream resource, this class will +take care of the underlying stream resource. +You SHOULD only use its public API and SHOULD NOT interfere with the underlying +stream resource manually. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +This class takes an optional `int|null $readChunkSize` parameter that controls +the maximum buffer size in bytes to read at once from the stream. +You can use a `null` value here in order to apply its default value. +This value SHOULD NOT be changed unless you know what you're doing. +This can be a positive number which means that up to X bytes will be read +at once from the underlying stream resource. Note that the actual number +of bytes read may be lower if the stream resource has less than X bytes +currently available. +This can be `-1` which means "read everything available" from the +underlying stream resource. +This should read until the stream resource is not readable anymore +(i.e. underlying buffer drained), note that this does not neccessarily +mean it reached EOF. + +```php +$stream = new ReadableResourceStream(STDIN, null, 8192); +``` + +> PHP bug warning: If the PHP process has explicitly been started without a + `STDIN` stream, then trying to read from `STDIN` may return data from + another stream resource. This does not happen if you start this with an empty + stream like `php test.php < /dev/null` instead of `php test.php <&-`. + See [#81](https://github.com/reactphp/stream/issues/81) for more details. + +> Changelog: As of v1.2.0 the `$loop` parameter can be omitted (or skipped with a + `null` value) to use the [default loop](https://github.com/reactphp/event-loop#loop). + +### WritableResourceStream + +The `WritableResourceStream` is a concrete implementation of the +[`WritableStreamInterface`](#writablestreaminterface) for PHP's stream resources. + +This can be used to represent a write-only resource like a file stream opened in +writable mode or a stream such as `STDOUT` or `STDERR`: + +```php +$stream = new WritableResourceStream(STDOUT); +$stream->write('hello!'); +$stream->end(); +``` + +See also [`WritableStreamInterface`](#writablestreaminterface) for more details. + +The first parameter given to the constructor MUST be a valid stream resource +that is opened for writing. +Otherwise, it will throw an `InvalidArgumentException`: + +```php +// throws InvalidArgumentException +$stream = new WritableResourceStream(false); +``` + +See also the [`DuplexResourceStream`](#readableresourcestream) for read-and-write +stream resources otherwise. + +Internally, this class tries to enable non-blocking mode on the stream resource +which may not be supported for all stream resources. +Most notably, this is not supported by pipes on Windows (STDOUT, STDERR etc.). +If this fails, it will throw a `RuntimeException`: + +```php +// throws RuntimeException on Windows +$stream = new WritableResourceStream(STDOUT); +``` + +Once the constructor is called with a valid stream resource, this class will +take care of the underlying stream resource. +You SHOULD only use its public API and SHOULD NOT interfere with the underlying +stream resource manually. + +Any `write()` calls to this class will not be performed instantly, but will +be performed asynchronously, once the EventLoop reports the stream resource is +ready to accept data. +For this, it uses an in-memory buffer string to collect all outstanding writes. +This buffer has a soft-limit applied which defines how much data it is willing +to accept before the caller SHOULD stop sending further data. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +This class takes an optional `int|null $writeBufferSoftLimit` parameter that controls +this maximum buffer size in bytes. +You can use a `null` value here in order to apply its default value. +This value SHOULD NOT be changed unless you know what you're doing. + +```php +$stream = new WritableResourceStream(STDOUT, null, 8192); +``` + +This class takes an optional `int|null $writeChunkSize` parameter that controls +this maximum buffer size in bytes to write at once to the stream. +You can use a `null` value here in order to apply its default value. +This value SHOULD NOT be changed unless you know what you're doing. +This can be a positive number which means that up to X bytes will be written +at once to the underlying stream resource. Note that the actual number +of bytes written may be lower if the stream resource has less than X bytes +currently available. +This can be `-1` which means "write everything available" to the +underlying stream resource. + +```php +$stream = new WritableResourceStream(STDOUT, null, null, 8192); +``` + +See also [`write()`](#write) for more details. + +> Changelog: As of v1.2.0 the `$loop` parameter can be omitted (or skipped with a + `null` value) to use the [default loop](https://github.com/reactphp/event-loop#loop). + +### DuplexResourceStream + +The `DuplexResourceStream` is a concrete implementation of the +[`DuplexStreamInterface`](#duplexstreaminterface) for PHP's stream resources. + +This can be used to represent a read-and-write resource like a file stream opened +in read and write mode mode or a stream such as a TCP/IP connection: + +```php +$conn = stream_socket_client('tcp://google.com:80'); +$stream = new DuplexResourceStream($conn); +$stream->write('hello!'); +$stream->end(); +``` + +See also [`DuplexStreamInterface`](#duplexstreaminterface) for more details. + +The first parameter given to the constructor MUST be a valid stream resource +that is opened for reading *and* writing. +Otherwise, it will throw an `InvalidArgumentException`: + +```php +// throws InvalidArgumentException +$stream = new DuplexResourceStream(false); +``` + +See also the [`ReadableResourceStream`](#readableresourcestream) for read-only +and the [`WritableResourceStream`](#writableresourcestream) for write-only +stream resources otherwise. + +Internally, this class tries to enable non-blocking mode on the stream resource +which may not be supported for all stream resources. +Most notably, this is not supported by pipes on Windows (STDOUT, STDERR etc.). +If this fails, it will throw a `RuntimeException`: + +```php +// throws RuntimeException on Windows +$stream = new DuplexResourceStream(STDOUT); +``` + +Once the constructor is called with a valid stream resource, this class will +take care of the underlying stream resource. +You SHOULD only use its public API and SHOULD NOT interfere with the underlying +stream resource manually. + +This class takes an optional `LoopInterface|null $loop` parameter that can be used to +pass the event loop instance to use for this object. You can use a `null` value +here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). +This value SHOULD NOT be given unless you're sure you want to explicitly use a +given event loop instance. + +This class takes an optional `int|null $readChunkSize` parameter that controls +the maximum buffer size in bytes to read at once from the stream. +You can use a `null` value here in order to apply its default value. +This value SHOULD NOT be changed unless you know what you're doing. +This can be a positive number which means that up to X bytes will be read +at once from the underlying stream resource. Note that the actual number +of bytes read may be lower if the stream resource has less than X bytes +currently available. +This can be `-1` which means "read everything available" from the +underlying stream resource. +This should read until the stream resource is not readable anymore +(i.e. underlying buffer drained), note that this does not neccessarily +mean it reached EOF. + +```php +$conn = stream_socket_client('tcp://google.com:80'); +$stream = new DuplexResourceStream($conn, null, 8192); +``` + +Any `write()` calls to this class will not be performed instantly, but will +be performed asynchronously, once the EventLoop reports the stream resource is +ready to accept data. +For this, it uses an in-memory buffer string to collect all outstanding writes. +This buffer has a soft-limit applied which defines how much data it is willing +to accept before the caller SHOULD stop sending further data. + +This class takes another optional `WritableStreamInterface|null $buffer` parameter +that controls this write behavior of this stream. +You can use a `null` value here in order to apply its default value. +This value SHOULD NOT be changed unless you know what you're doing. + +If you want to change the write buffer soft limit, you can pass an instance of +[`WritableResourceStream`](#writableresourcestream) like this: + +```php +$conn = stream_socket_client('tcp://google.com:80'); +$buffer = new WritableResourceStream($conn, null, 8192); +$stream = new DuplexResourceStream($conn, null, null, $buffer); +``` + +See also [`WritableResourceStream`](#writableresourcestream) for more details. + +> Changelog: As of v1.2.0 the `$loop` parameter can be omitted (or skipped with a + `null` value) to use the [default loop](https://github.com/reactphp/event-loop#loop). + +### ThroughStream + +The `ThroughStream` implements the +[`DuplexStreamInterface`](#duplexstreaminterface) and will simply pass any data +you write to it through to its readable end. + +```php +$through = new ThroughStream(); +$through->on('data', $this->expectCallableOnceWith('hello')); + +$through->write('hello'); +``` + +Similarly, the [`end()` method](#end) will end the stream and emit an +[`end` event](#end-event) and then [`close()`](#close-1) the stream. +The [`close()` method](#close-1) will close the stream and emit a +[`close` event](#close-event). +Accordingly, this is can also be used in a [`pipe()`](#pipe) context like this: + +```php +$through = new ThroughStream(); +$source->pipe($through)->pipe($dest); +``` + +Optionally, its constructor accepts any callable function which will then be +used to *filter* any data written to it. This function receives a single data +argument as passed to the writable side and must return the data as it will be +passed to its readable end: + +```php +$through = new ThroughStream('strtoupper'); +$source->pipe($through)->pipe($dest); +``` + +Note that this class makes no assumptions about any data types. This can be +used to convert data, for example for transforming any structured data into +a newline-delimited JSON (NDJSON) stream like this: + +```php +$through = new ThroughStream(function ($data) { + return json_encode($data) . PHP_EOL; +}); +$through->on('data', $this->expectCallableOnceWith("[2, true]\n")); + +$through->write(array(2, true)); +``` + +The callback function is allowed to throw an `Exception`. In this case, +the stream will emit an `error` event and then [`close()`](#close-1) the stream. + +```php +$through = new ThroughStream(function ($data) { + if (!is_string($data)) { + throw new \UnexpectedValueException('Only strings allowed'); + } + return $data; +}); +$through->on('error', $this->expectCallableOnce())); +$through->on('close', $this->expectCallableOnce())); +$through->on('data', $this->expectCallableNever())); + +$through->write(2); +``` + +### CompositeStream + +The `CompositeStream` implements the +[`DuplexStreamInterface`](#duplexstreaminterface) and can be used to create a +single duplex stream from two individual streams implementing +[`ReadableStreamInterface`](#readablestreaminterface) and +[`WritableStreamInterface`](#writablestreaminterface) respectively. + +This is useful for some APIs which may require a single +[`DuplexStreamInterface`](#duplexstreaminterface) or simply because it's often +more convenient to work with a single stream instance like this: + +```php +$stdin = new ReadableResourceStream(STDIN); +$stdout = new WritableResourceStream(STDOUT); + +$stdio = new CompositeStream($stdin, $stdout); + +$stdio->on('data', function ($chunk) use ($stdio) { + $stdio->write('You said: ' . $chunk); +}); +``` + +This is a well-behaving stream which forwards all stream events from the +underlying streams and forwards all streams calls to the underlying streams. + +If you `write()` to the duplex stream, it will simply `write()` to the +writable side and return its status. + +If you `end()` the duplex stream, it will `end()` the writable side and will +`pause()` the readable side. + +If you `close()` the duplex stream, both input streams will be closed. +If either of the two input streams emits a `close` event, the duplex stream +will also close. +If either of the two input streams is already closed while constructing the +duplex stream, it will `close()` the other side and return a closed stream. + +## Usage + +The following example can be used to pipe the contents of a source file into +a destination file without having to ever read the whole file into memory: + +```php +$source = new React\Stream\ReadableResourceStream(fopen('source.txt', 'r')); +$dest = new React\Stream\WritableResourceStream(fopen('destination.txt', 'w')); + +$source->pipe($dest); +``` + +> Note that this example uses `fopen()` for illustration purposes only. + This should not be used in a truly async program because the filesystem is + inherently blocking and each call could potentially take several seconds. + See also [creating streams](#creating-streams) for more sophisticated + examples. + +## Install + +The recommended way to install this library is [through Composer](https://getcomposer.org). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) + +This project follows [SemVer](https://semver.org/). +This will install the latest supported version: + +```bash +composer require react/stream:^1.4 +``` + +See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. + +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.3 through current PHP 8+ and HHVM. +It's *highly recommended to use PHP 7+* for this project due to its vast +performance improvements. + +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org): + +```bash +composer install +``` + +To run the test suite, go to the project root and run: + +```bash +vendor/bin/phpunit +``` + +The test suite also contains a number of functional integration tests that rely +on a stable internet connection. +If you do not want to run these, they can simply be skipped like this: + +```bash +vendor/bin/phpunit --exclude-group internet +``` + +## License + +MIT, see [LICENSE file](LICENSE). + +## More + +* See [creating streams](#creating-streams) for more information on how streams + are created in real-world applications. +* See our [users wiki](https://github.com/reactphp/react/wiki/Users) and the + [dependents on Packagist](https://packagist.org/packages/react/stream/dependents) + for a list of packages that use streams in real-world applications. diff --git a/tools/php-cs-fixer/vendor/react/stream/composer.json b/tools/php-cs-fixer/vendor/react/stream/composer.json new file mode 100644 index 00000000..09d8b71e --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/composer.json @@ -0,0 +1,47 @@ +{ + "name": "react/stream", + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": ["event-driven", "readable", "writable", "stream", "non-blocking", "io", "pipe", "ReactPHP"], + "license": "MIT", + "authors": [ + { + "name": "Christian Lück", + "homepage": "https://clue.engineering/", + "email": "christian@clue.engineering" + }, + { + "name": "Cees-Jan Kiewiet", + "homepage": "https://wyrihaximus.net/", + "email": "reactphp@ceesjankiewiet.nl" + }, + { + "name": "Jan Sorgalla", + "homepage": "https://sorgalla.com/", + "email": "jsorgalla@gmail.com" + }, + { + "name": "Chris Boden", + "homepage": "https://cboden.dev/", + "email": "cboden@gmail.com" + } + ], + "require": { + "php": ">=5.3.8", + "react/event-loop": "^1.2", + "evenement/evenement": "^3.0 || ^2.0 || ^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "clue/stream-filter": "~1.2" + }, + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "React\\Tests\\Stream\\": "tests/" + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/CompositeStream.php b/tools/php-cs-fixer/vendor/react/stream/src/CompositeStream.php new file mode 100644 index 00000000..dde091de --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/src/CompositeStream.php @@ -0,0 +1,83 @@ +readable = $readable; + $this->writable = $writable; + + if (!$readable->isReadable() || !$writable->isWritable()) { + $this->close(); + return; + } + + Util::forwardEvents($this->readable, $this, array('data', 'end', 'error')); + Util::forwardEvents($this->writable, $this, array('drain', 'error', 'pipe')); + + $this->readable->on('close', array($this, 'close')); + $this->writable->on('close', array($this, 'close')); + } + + public function isReadable() + { + return $this->readable->isReadable(); + } + + public function pause() + { + $this->readable->pause(); + } + + public function resume() + { + if (!$this->writable->isWritable()) { + return; + } + + $this->readable->resume(); + } + + public function pipe(WritableStreamInterface $dest, array $options = array()) + { + return Util::pipe($this, $dest, $options); + } + + public function isWritable() + { + return $this->writable->isWritable(); + } + + public function write($data) + { + return $this->writable->write($data); + } + + public function end($data = null) + { + $this->readable->pause(); + $this->writable->end($data); + } + + public function close() + { + if ($this->closed) { + return; + } + + $this->closed = true; + $this->readable->close(); + $this->writable->close(); + + $this->emit('close'); + $this->removeAllListeners(); + } +} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/DuplexResourceStream.php b/tools/php-cs-fixer/vendor/react/stream/src/DuplexResourceStream.php new file mode 100644 index 00000000..d6de55c0 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/src/DuplexResourceStream.php @@ -0,0 +1,240 @@ +isLegacyPipe($stream)) { + \stream_set_read_buffer($stream, 0); + } + + if ($buffer === null) { + $buffer = new WritableResourceStream($stream, $loop); + } + + $this->stream = $stream; + $this->loop = $loop ?: Loop::get(); + $this->bufferSize = ($readChunkSize === null) ? 65536 : (int)$readChunkSize; + $this->buffer = $buffer; + + $that = $this; + + $this->buffer->on('error', function ($error) use ($that) { + $that->emit('error', array($error)); + }); + + $this->buffer->on('close', array($this, 'close')); + + $this->buffer->on('drain', function () use ($that) { + $that->emit('drain'); + }); + + $this->resume(); + } + + public function isReadable() + { + return $this->readable; + } + + public function isWritable() + { + return $this->writable; + } + + public function pause() + { + if ($this->listening) { + $this->loop->removeReadStream($this->stream); + $this->listening = false; + } + } + + public function resume() + { + if (!$this->listening && $this->readable) { + $this->loop->addReadStream($this->stream, array($this, 'handleData')); + $this->listening = true; + } + } + + public function write($data) + { + if (!$this->writable) { + return false; + } + + return $this->buffer->write($data); + } + + public function close() + { + if (!$this->writable && !$this->closing) { + return; + } + + $this->closing = false; + + $this->readable = false; + $this->writable = false; + + $this->emit('close'); + $this->pause(); + $this->buffer->close(); + $this->removeAllListeners(); + + if (\is_resource($this->stream)) { + \fclose($this->stream); + } + } + + public function end($data = null) + { + if (!$this->writable) { + return; + } + + $this->closing = true; + + $this->readable = false; + $this->writable = false; + $this->pause(); + + $this->buffer->end($data); + } + + public function pipe(WritableStreamInterface $dest, array $options = array()) + { + return Util::pipe($this, $dest, $options); + } + + /** @internal */ + public function handleData($stream) + { + $error = null; + \set_error_handler(function ($errno, $errstr, $errfile, $errline) use (&$error) { + $error = new \ErrorException( + $errstr, + 0, + $errno, + $errfile, + $errline + ); + }); + + $data = \stream_get_contents($stream, $this->bufferSize); + + \restore_error_handler(); + + if ($error !== null) { + $this->emit('error', array(new \RuntimeException('Unable to read from stream: ' . $error->getMessage(), 0, $error))); + $this->close(); + return; + } + + if ($data !== '') { + $this->emit('data', array($data)); + } elseif (\feof($this->stream)) { + // no data read => we reached the end and close the stream + $this->emit('end'); + $this->close(); + } + } + + /** + * Returns whether this is a pipe resource in a legacy environment + * + * This works around a legacy PHP bug (#61019) that was fixed in PHP 5.4.28+ + * and PHP 5.5.12+ and newer. + * + * @param resource $resource + * @return bool + * @link https://github.com/reactphp/child-process/issues/40 + * + * @codeCoverageIgnore + */ + private function isLegacyPipe($resource) + { + if (\PHP_VERSION_ID < 50428 || (\PHP_VERSION_ID >= 50500 && \PHP_VERSION_ID < 50512)) { + $meta = \stream_get_meta_data($resource); + + if (isset($meta['stream_type']) && $meta['stream_type'] === 'STDIO') { + return true; + } + } + return false; + } +} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/DuplexStreamInterface.php b/tools/php-cs-fixer/vendor/react/stream/src/DuplexStreamInterface.php new file mode 100644 index 00000000..631ce31e --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/src/DuplexStreamInterface.php @@ -0,0 +1,39 @@ + Note that higher-level implementations of this interface may choose to + * define additional events with dedicated semantics not defined as part of + * this low-level stream specification. Conformance with these event semantics + * is out of scope for this interface, so you may also have to refer to the + * documentation of such a higher-level implementation. + * + * @see ReadableStreamInterface + * @see WritableStreamInterface + */ +interface DuplexStreamInterface extends ReadableStreamInterface, WritableStreamInterface +{ +} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/ReadableResourceStream.php b/tools/php-cs-fixer/vendor/react/stream/src/ReadableResourceStream.php new file mode 100644 index 00000000..823360a6 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/src/ReadableResourceStream.php @@ -0,0 +1,188 @@ +isLegacyPipe($stream)) { + \stream_set_read_buffer($stream, 0); + } + + $this->stream = $stream; + $this->loop = $loop ?: Loop::get(); + $this->bufferSize = ($readChunkSize === null) ? 65536 : (int)$readChunkSize; + + $this->resume(); + } + + public function isReadable() + { + return !$this->closed; + } + + public function pause() + { + if ($this->listening) { + $this->loop->removeReadStream($this->stream); + $this->listening = false; + } + } + + public function resume() + { + if (!$this->listening && !$this->closed) { + $this->loop->addReadStream($this->stream, array($this, 'handleData')); + $this->listening = true; + } + } + + public function pipe(WritableStreamInterface $dest, array $options = array()) + { + return Util::pipe($this, $dest, $options); + } + + public function close() + { + if ($this->closed) { + return; + } + + $this->closed = true; + + $this->emit('close'); + $this->pause(); + $this->removeAllListeners(); + + if (\is_resource($this->stream)) { + \fclose($this->stream); + } + } + + /** @internal */ + public function handleData() + { + $error = null; + \set_error_handler(function ($errno, $errstr, $errfile, $errline) use (&$error) { + $error = new \ErrorException( + $errstr, + 0, + $errno, + $errfile, + $errline + ); + }); + + $data = \stream_get_contents($this->stream, $this->bufferSize); + + \restore_error_handler(); + + if ($error !== null) { + $this->emit('error', array(new \RuntimeException('Unable to read from stream: ' . $error->getMessage(), 0, $error))); + $this->close(); + return; + } + + if ($data !== '') { + $this->emit('data', array($data)); + } elseif (\feof($this->stream)) { + // no data read => we reached the end and close the stream + $this->emit('end'); + $this->close(); + } + } + + /** + * Returns whether this is a pipe resource in a legacy environment + * + * This works around a legacy PHP bug (#61019) that was fixed in PHP 5.4.28+ + * and PHP 5.5.12+ and newer. + * + * @param resource $resource + * @return bool + * @link https://github.com/reactphp/child-process/issues/40 + * + * @codeCoverageIgnore + */ + private function isLegacyPipe($resource) + { + if (\PHP_VERSION_ID < 50428 || (\PHP_VERSION_ID >= 50500 && \PHP_VERSION_ID < 50512)) { + $meta = \stream_get_meta_data($resource); + + if (isset($meta['stream_type']) && $meta['stream_type'] === 'STDIO') { + return true; + } + } + return false; + } +} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/ReadableStreamInterface.php b/tools/php-cs-fixer/vendor/react/stream/src/ReadableStreamInterface.php new file mode 100644 index 00000000..fa3d59cd --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/src/ReadableStreamInterface.php @@ -0,0 +1,362 @@ +on('data', function ($data) { + * echo $data; + * }); + * ``` + * + * This event MAY be emitted any number of times, which may be zero times if + * this stream does not send any data at all. + * It SHOULD not be emitted after an `end` or `close` event. + * + * The given `$data` argument may be of mixed type, but it's usually + * recommended it SHOULD be a `string` value or MAY use a type that allows + * representation as a `string` for maximum compatibility. + * + * Many common streams (such as a TCP/IP connection or a file-based stream) + * will emit the raw (binary) payload data that is received over the wire as + * chunks of `string` values. + * + * Due to the stream-based nature of this, the sender may send any number + * of chunks with varying sizes. There are no guarantees that these chunks + * will be received with the exact same framing the sender intended to send. + * In other words, many lower-level protocols (such as TCP/IP) transfer the + * data in chunks that may be anywhere between single-byte values to several + * dozens of kilobytes. You may want to apply a higher-level protocol to + * these low-level data chunks in order to achieve proper message framing. + * + * end event: + * The `end` event will be emitted once the source stream has successfully + * reached the end of the stream (EOF). + * + * ```php + * $stream->on('end', function () { + * echo 'END'; + * }); + * ``` + * + * This event SHOULD be emitted once or never at all, depending on whether + * a successful end was detected. + * It SHOULD NOT be emitted after a previous `end` or `close` event. + * It MUST NOT be emitted if the stream closes due to a non-successful + * end, such as after a previous `error` event. + * + * After the stream is ended, it MUST switch to non-readable mode, + * see also `isReadable()`. + * + * This event will only be emitted if the *end* was reached successfully, + * not if the stream was interrupted by an unrecoverable error or explicitly + * closed. Not all streams know this concept of a "successful end". + * Many use-cases involve detecting when the stream closes (terminates) + * instead, in this case you should use the `close` event. + * After the stream emits an `end` event, it SHOULD usually be followed by a + * `close` event. + * + * Many common streams (such as a TCP/IP connection or a file-based stream) + * will emit this event if either the remote side closes the connection or + * a file handle was successfully read until reaching its end (EOF). + * + * Note that this event should not be confused with the `end()` method. + * This event defines a successful end *reading* from a source stream, while + * the `end()` method defines *writing* a successful end to a destination + * stream. + * + * error event: + * The `error` event will be emitted once a fatal error occurs, usually while + * trying to read from this stream. + * The event receives a single `Exception` argument for the error instance. + * + * ```php + * $stream->on('error', function (Exception $e) { + * echo 'Error: ' . $e->getMessage() . PHP_EOL; + * }); + * ``` + * + * This event SHOULD be emitted once the stream detects a fatal error, such + * as a fatal transmission error or after an unexpected `data` or premature + * `end` event. + * It SHOULD NOT be emitted after a previous `error`, `end` or `close` event. + * It MUST NOT be emitted if this is not a fatal error condition, such as + * a temporary network issue that did not cause any data to be lost. + * + * After the stream errors, it MUST close the stream and SHOULD thus be + * followed by a `close` event and then switch to non-readable mode, see + * also `close()` and `isReadable()`. + * + * Many common streams (such as a TCP/IP connection or a file-based stream) + * only deal with data transmission and do not make assumption about data + * boundaries (such as unexpected `data` or premature `end` events). + * In other words, many lower-level protocols (such as TCP/IP) may choose + * to only emit this for a fatal transmission error once and will then + * close (terminate) the stream in response. + * + * If this stream is a `DuplexStreamInterface`, you should also notice + * how the writable side of the stream also implements an `error` event. + * In other words, an error may occur while either reading or writing the + * stream which should result in the same error processing. + * + * close event: + * The `close` event will be emitted once the stream closes (terminates). + * + * ```php + * $stream->on('close', function () { + * echo 'CLOSED'; + * }); + * ``` + * + * This event SHOULD be emitted once or never at all, depending on whether + * the stream ever terminates. + * It SHOULD NOT be emitted after a previous `close` event. + * + * After the stream is closed, it MUST switch to non-readable mode, + * see also `isReadable()`. + * + * Unlike the `end` event, this event SHOULD be emitted whenever the stream + * closes, irrespective of whether this happens implicitly due to an + * unrecoverable error or explicitly when either side closes the stream. + * If you only want to detect a *successful* end, you should use the `end` + * event instead. + * + * Many common streams (such as a TCP/IP connection or a file-based stream) + * will likely choose to emit this event after reading a *successful* `end` + * event or after a fatal transmission `error` event. + * + * If this stream is a `DuplexStreamInterface`, you should also notice + * how the writable side of the stream also implements a `close` event. + * In other words, after receiving this event, the stream MUST switch into + * non-writable AND non-readable mode, see also `isWritable()`. + * Note that this event should not be confused with the `end` event. + * + * The event callback functions MUST be a valid `callable` that obeys strict + * parameter definitions and MUST accept event parameters exactly as documented. + * The event callback functions MUST NOT throw an `Exception`. + * The return value of the event callback functions will be ignored and has no + * effect, so for performance reasons you're recommended to not return any + * excessive data structures. + * + * Every implementation of this interface MUST follow these event semantics in + * order to be considered a well-behaving stream. + * + * > Note that higher-level implementations of this interface may choose to + * define additional events with dedicated semantics not defined as part of + * this low-level stream specification. Conformance with these event semantics + * is out of scope for this interface, so you may also have to refer to the + * documentation of such a higher-level implementation. + * + * @see EventEmitterInterface + */ +interface ReadableStreamInterface extends EventEmitterInterface +{ + /** + * Checks whether this stream is in a readable state (not closed already). + * + * This method can be used to check if the stream still accepts incoming + * data events or if it is ended or closed already. + * Once the stream is non-readable, no further `data` or `end` events SHOULD + * be emitted. + * + * ```php + * assert($stream->isReadable() === false); + * + * $stream->on('data', assertNeverCalled()); + * $stream->on('end', assertNeverCalled()); + * ``` + * + * A successfully opened stream always MUST start in readable mode. + * + * Once the stream ends or closes, it MUST switch to non-readable mode. + * This can happen any time, explicitly through `close()` or + * implicitly due to a remote close or an unrecoverable transmission error. + * Once a stream has switched to non-readable mode, it MUST NOT transition + * back to readable mode. + * + * If this stream is a `DuplexStreamInterface`, you should also notice + * how the writable side of the stream also implements an `isWritable()` + * method. Unless this is a half-open duplex stream, they SHOULD usually + * have the same return value. + * + * @return bool + */ + public function isReadable(); + + /** + * Pauses reading incoming data events. + * + * Removes the data source file descriptor from the event loop. This + * allows you to throttle incoming data. + * + * Unless otherwise noted, a successfully opened stream SHOULD NOT start + * in paused state. + * + * Once the stream is paused, no futher `data` or `end` events SHOULD + * be emitted. + * + * ```php + * $stream->pause(); + * + * $stream->on('data', assertShouldNeverCalled()); + * $stream->on('end', assertShouldNeverCalled()); + * ``` + * + * This method is advisory-only, though generally not recommended, the + * stream MAY continue emitting `data` events. + * + * You can continue processing events by calling `resume()` again. + * + * Note that both methods can be called any number of times, in particular + * calling `pause()` more than once SHOULD NOT have any effect. + * + * @see self::resume() + * @return void + */ + public function pause(); + + /** + * Resumes reading incoming data events. + * + * Re-attach the data source after a previous `pause()`. + * + * ```php + * $stream->pause(); + * + * Loop::addTimer(1.0, function () use ($stream) { + * $stream->resume(); + * }); + * ``` + * + * Note that both methods can be called any number of times, in particular + * calling `resume()` without a prior `pause()` SHOULD NOT have any effect. + * + * @see self::pause() + * @return void + */ + public function resume(); + + /** + * Pipes all the data from this readable source into the given writable destination. + * + * Automatically sends all incoming data to the destination. + * Automatically throttles the source based on what the destination can handle. + * + * ```php + * $source->pipe($dest); + * ``` + * + * Similarly, you can also pipe an instance implementing `DuplexStreamInterface` + * into itself in order to write back all the data that is received. + * This may be a useful feature for a TCP/IP echo service: + * + * ```php + * $connection->pipe($connection); + * ``` + * + * This method returns the destination stream as-is, which can be used to + * set up chains of piped streams: + * + * ```php + * $source->pipe($decodeGzip)->pipe($filterBadWords)->pipe($dest); + * ``` + * + * By default, this will call `end()` on the destination stream once the + * source stream emits an `end` event. This can be disabled like this: + * + * ```php + * $source->pipe($dest, array('end' => false)); + * ``` + * + * Note that this only applies to the `end` event. + * If an `error` or explicit `close` event happens on the source stream, + * you'll have to manually close the destination stream: + * + * ```php + * $source->pipe($dest); + * $source->on('close', function () use ($dest) { + * $dest->end('BYE!'); + * }); + * ``` + * + * If the source stream is not readable (closed state), then this is a NO-OP. + * + * ```php + * $source->close(); + * $source->pipe($dest); // NO-OP + * ``` + * + * If the destinantion stream is not writable (closed state), then this will simply + * throttle (pause) the source stream: + * + * ```php + * $dest->close(); + * $source->pipe($dest); // calls $source->pause() + * ``` + * + * Similarly, if the destination stream is closed while the pipe is still + * active, it will also throttle (pause) the source stream: + * + * ```php + * $source->pipe($dest); + * $dest->close(); // calls $source->pause() + * ``` + * + * Once the pipe is set up successfully, the destination stream MUST emit + * a `pipe` event with this source stream an event argument. + * + * @param WritableStreamInterface $dest + * @param array $options + * @return WritableStreamInterface $dest stream as-is + */ + public function pipe(WritableStreamInterface $dest, array $options = array()); + + /** + * Closes the stream (forcefully). + * + * This method can be used to (forcefully) close the stream. + * + * ```php + * $stream->close(); + * ``` + * + * Once the stream is closed, it SHOULD emit a `close` event. + * Note that this event SHOULD NOT be emitted more than once, in particular + * if this method is called multiple times. + * + * After calling this method, the stream MUST switch into a non-readable + * mode, see also `isReadable()`. + * This means that no further `data` or `end` events SHOULD be emitted. + * + * ```php + * $stream->close(); + * assert($stream->isReadable() === false); + * + * $stream->on('data', assertNeverCalled()); + * $stream->on('end', assertNeverCalled()); + * ``` + * + * If this stream is a `DuplexStreamInterface`, you should also notice + * how the writable side of the stream also implements a `close()` method. + * In other words, after calling this method, the stream MUST switch into + * non-writable AND non-readable mode, see also `isWritable()`. + * Note that this method should not be confused with the `end()` method. + * + * @return void + * @see WritableStreamInterface::close() + */ + public function close(); +} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/ThroughStream.php b/tools/php-cs-fixer/vendor/react/stream/src/ThroughStream.php new file mode 100644 index 00000000..3b4fbb78 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/src/ThroughStream.php @@ -0,0 +1,195 @@ +on('data', $this->expectCallableOnceWith('hello')); + * + * $through->write('hello'); + * ``` + * + * Similarly, the [`end()` method](#end) will end the stream and emit an + * [`end` event](#end-event) and then [`close()`](#close-1) the stream. + * The [`close()` method](#close-1) will close the stream and emit a + * [`close` event](#close-event). + * Accordingly, this is can also be used in a [`pipe()`](#pipe) context like this: + * + * ```php + * $through = new ThroughStream(); + * $source->pipe($through)->pipe($dest); + * ``` + * + * Optionally, its constructor accepts any callable function which will then be + * used to *filter* any data written to it. This function receives a single data + * argument as passed to the writable side and must return the data as it will be + * passed to its readable end: + * + * ```php + * $through = new ThroughStream('strtoupper'); + * $source->pipe($through)->pipe($dest); + * ``` + * + * Note that this class makes no assumptions about any data types. This can be + * used to convert data, for example for transforming any structured data into + * a newline-delimited JSON (NDJSON) stream like this: + * + * ```php + * $through = new ThroughStream(function ($data) { + * return json_encode($data) . PHP_EOL; + * }); + * $through->on('data', $this->expectCallableOnceWith("[2, true]\n")); + * + * $through->write(array(2, true)); + * ``` + * + * The callback function is allowed to throw an `Exception`. In this case, + * the stream will emit an `error` event and then [`close()`](#close-1) the stream. + * + * ```php + * $through = new ThroughStream(function ($data) { + * if (!is_string($data)) { + * throw new \UnexpectedValueException('Only strings allowed'); + * } + * return $data; + * }); + * $through->on('error', $this->expectCallableOnce())); + * $through->on('close', $this->expectCallableOnce())); + * $through->on('data', $this->expectCallableNever())); + * + * $through->write(2); + * ``` + * + * @see WritableStreamInterface::write() + * @see WritableStreamInterface::end() + * @see DuplexStreamInterface::close() + * @see WritableStreamInterface::pipe() + */ +final class ThroughStream extends EventEmitter implements DuplexStreamInterface +{ + private $readable = true; + private $writable = true; + private $closed = false; + private $paused = false; + private $drain = false; + private $callback; + + public function __construct($callback = null) + { + if ($callback !== null && !\is_callable($callback)) { + throw new InvalidArgumentException('Invalid transformation callback given'); + } + + $this->callback = $callback; + } + + public function pause() + { + // only allow pause if still readable, false otherwise + $this->paused = $this->readable; + } + + public function resume() + { + $this->paused = false; + + // emit drain event if previous write was paused (throttled) + if ($this->drain) { + $this->drain = false; + $this->emit('drain'); + } + } + + public function pipe(WritableStreamInterface $dest, array $options = array()) + { + return Util::pipe($this, $dest, $options); + } + + public function isReadable() + { + return $this->readable; + } + + public function isWritable() + { + return $this->writable; + } + + public function write($data) + { + if (!$this->writable) { + return false; + } + + if ($this->callback !== null) { + try { + $data = \call_user_func($this->callback, $data); + } catch (\Exception $e) { + $this->emit('error', array($e)); + $this->close(); + + return false; + } + } + + $this->emit('data', array($data)); + + // emit drain event on next resume if currently paused (throttled) + if ($this->paused) { + $this->drain = true; + } + + // continue writing if still writable and not paused (throttled), false otherwise + return $this->writable && !$this->paused; + } + + public function end($data = null) + { + if (!$this->writable) { + return; + } + + if (null !== $data) { + $this->write($data); + + // return if write() already caused the stream to close + if (!$this->writable) { + return; + } + } + + $this->readable = false; + $this->writable = false; + $this->paused = false; + $this->drain = false; + + $this->emit('end'); + $this->close(); + } + + public function close() + { + if ($this->closed) { + return; + } + + $this->readable = false; + $this->writable = false; + $this->paused = false; + $this->drain = false; + + $this->closed = true; + $this->callback = null; + + $this->emit('close'); + $this->removeAllListeners(); + } +} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/Util.php b/tools/php-cs-fixer/vendor/react/stream/src/Util.php new file mode 100644 index 00000000..056b0377 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/src/Util.php @@ -0,0 +1,75 @@ + NO-OP + if (!$source->isReadable()) { + return $dest; + } + + // destination not writable => just pause() source + if (!$dest->isWritable()) { + $source->pause(); + + return $dest; + } + + $dest->emit('pipe', array($source)); + + // forward all source data events as $dest->write() + $source->on('data', $dataer = function ($data) use ($source, $dest) { + $feedMore = $dest->write($data); + + if (false === $feedMore) { + $source->pause(); + } + }); + $dest->on('close', function () use ($source, $dataer) { + $source->removeListener('data', $dataer); + $source->pause(); + }); + + // forward destination drain as $source->resume() + $dest->on('drain', $drainer = function () use ($source) { + $source->resume(); + }); + $source->on('close', function () use ($dest, $drainer) { + $dest->removeListener('drain', $drainer); + }); + + // forward end event from source as $dest->end() + $end = isset($options['end']) ? $options['end'] : true; + if ($end) { + $source->on('end', $ender = function () use ($dest) { + $dest->end(); + }); + $dest->on('close', function () use ($source, $ender) { + $source->removeListener('end', $ender); + }); + } + + return $dest; + } + + public static function forwardEvents($source, $target, array $events) + { + foreach ($events as $event) { + $source->on($event, function () use ($event, $target) { + $target->emit($event, \func_get_args()); + }); + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/WritableResourceStream.php b/tools/php-cs-fixer/vendor/react/stream/src/WritableResourceStream.php new file mode 100644 index 00000000..e3a7e74d --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/src/WritableResourceStream.php @@ -0,0 +1,178 @@ +stream = $stream; + $this->loop = $loop ?: Loop::get(); + $this->softLimit = ($writeBufferSoftLimit === null) ? 65536 : (int)$writeBufferSoftLimit; + $this->writeChunkSize = ($writeChunkSize === null) ? -1 : (int)$writeChunkSize; + } + + public function isWritable() + { + return $this->writable; + } + + public function write($data) + { + if (!$this->writable) { + return false; + } + + $this->data .= $data; + + if (!$this->listening && $this->data !== '') { + $this->listening = true; + + $this->loop->addWriteStream($this->stream, array($this, 'handleWrite')); + } + + return !isset($this->data[$this->softLimit - 1]); + } + + public function end($data = null) + { + if (null !== $data) { + $this->write($data); + } + + $this->writable = false; + + // close immediately if buffer is already empty + // otherwise wait for buffer to flush first + if ($this->data === '') { + $this->close(); + } + } + + public function close() + { + if ($this->closed) { + return; + } + + if ($this->listening) { + $this->listening = false; + $this->loop->removeWriteStream($this->stream); + } + + $this->closed = true; + $this->writable = false; + $this->data = ''; + + $this->emit('close'); + $this->removeAllListeners(); + + if (\is_resource($this->stream)) { + \fclose($this->stream); + } + } + + /** @internal */ + public function handleWrite() + { + $error = null; + \set_error_handler(function ($_, $errstr) use (&$error) { + $error = $errstr; + }); + + if ($this->writeChunkSize === -1) { + $sent = \fwrite($this->stream, $this->data); + } else { + $sent = \fwrite($this->stream, $this->data, $this->writeChunkSize); + } + + \restore_error_handler(); + + // Only report errors if *nothing* could be sent and an error has been raised. + // Ignore non-fatal warnings if *some* data could be sent. + // Any hard (permanent) error will fail to send any data at all. + // Sending excessive amounts of data will only flush *some* data and then + // report a temporary error (EAGAIN) which we do not raise here in order + // to keep the stream open for further tries to write. + // Should this turn out to be a permanent error later, it will eventually + // send *nothing* and we can detect this. + if (($sent === 0 || $sent === false) && $error !== null) { + $this->emit('error', array(new \RuntimeException('Unable to write to stream: ' . $error))); + $this->close(); + + return; + } + + $exceeded = isset($this->data[$this->softLimit - 1]); + $this->data = (string) \substr($this->data, $sent); + + // buffer has been above limit and is now below limit + if ($exceeded && !isset($this->data[$this->softLimit - 1])) { + $this->emit('drain'); + } + + // buffer is now completely empty => stop trying to write + if ($this->data === '') { + // stop waiting for resource to be writable + if ($this->listening) { + $this->loop->removeWriteStream($this->stream); + $this->listening = false; + } + + // buffer is end()ing and now completely empty => close buffer + if (!$this->writable) { + $this->close(); + } + } + } +} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/WritableStreamInterface.php b/tools/php-cs-fixer/vendor/react/stream/src/WritableStreamInterface.php new file mode 100644 index 00000000..e2625928 --- /dev/null +++ b/tools/php-cs-fixer/vendor/react/stream/src/WritableStreamInterface.php @@ -0,0 +1,347 @@ +on('drain', function () use ($stream) { + * echo 'Stream is now ready to accept more data'; + * }); + * ``` + * + * This event SHOULD be emitted once every time the buffer became full + * previously and is now ready to accept more data. + * In other words, this event MAY be emitted any number of times, which may + * be zero times if the buffer never became full in the first place. + * This event SHOULD NOT be emitted if the buffer has not become full + * previously. + * + * This event is mostly used internally, see also `write()` for more details. + * + * pipe event: + * The `pipe` event will be emitted whenever a readable stream is `pipe()`d + * into this stream. + * The event receives a single `ReadableStreamInterface` argument for the + * source stream. + * + * ```php + * $stream->on('pipe', function (ReadableStreamInterface $source) use ($stream) { + * echo 'Now receiving piped data'; + * + * // explicitly close target if source emits an error + * $source->on('error', function () use ($stream) { + * $stream->close(); + * }); + * }); + * + * $source->pipe($stream); + * ``` + * + * This event MUST be emitted once for each readable stream that is + * successfully piped into this destination stream. + * In other words, this event MAY be emitted any number of times, which may + * be zero times if no stream is ever piped into this stream. + * This event MUST NOT be emitted if either the source is not readable + * (closed already) or this destination is not writable (closed already). + * + * This event is mostly used internally, see also `pipe()` for more details. + * + * error event: + * The `error` event will be emitted once a fatal error occurs, usually while + * trying to write to this stream. + * The event receives a single `Exception` argument for the error instance. + * + * ```php + * $stream->on('error', function (Exception $e) { + * echo 'Error: ' . $e->getMessage() . PHP_EOL; + * }); + * ``` + * + * This event SHOULD be emitted once the stream detects a fatal error, such + * as a fatal transmission error. + * It SHOULD NOT be emitted after a previous `error` or `close` event. + * It MUST NOT be emitted if this is not a fatal error condition, such as + * a temporary network issue that did not cause any data to be lost. + * + * After the stream errors, it MUST close the stream and SHOULD thus be + * followed by a `close` event and then switch to non-writable mode, see + * also `close()` and `isWritable()`. + * + * Many common streams (such as a TCP/IP connection or a file-based stream) + * only deal with data transmission and may choose + * to only emit this for a fatal transmission error once and will then + * close (terminate) the stream in response. + * + * If this stream is a `DuplexStreamInterface`, you should also notice + * how the readable side of the stream also implements an `error` event. + * In other words, an error may occur while either reading or writing the + * stream which should result in the same error processing. + * + * close event: + * The `close` event will be emitted once the stream closes (terminates). + * + * ```php + * $stream->on('close', function () { + * echo 'CLOSED'; + * }); + * ``` + * + * This event SHOULD be emitted once or never at all, depending on whether + * the stream ever terminates. + * It SHOULD NOT be emitted after a previous `close` event. + * + * After the stream is closed, it MUST switch to non-writable mode, + * see also `isWritable()`. + * + * This event SHOULD be emitted whenever the stream closes, irrespective of + * whether this happens implicitly due to an unrecoverable error or + * explicitly when either side closes the stream. + * + * Many common streams (such as a TCP/IP connection or a file-based stream) + * will likely choose to emit this event after flushing the buffer from + * the `end()` method, after receiving a *successful* `end` event or after + * a fatal transmission `error` event. + * + * If this stream is a `DuplexStreamInterface`, you should also notice + * how the readable side of the stream also implements a `close` event. + * In other words, after receiving this event, the stream MUST switch into + * non-writable AND non-readable mode, see also `isReadable()`. + * Note that this event should not be confused with the `end` event. + * + * The event callback functions MUST be a valid `callable` that obeys strict + * parameter definitions and MUST accept event parameters exactly as documented. + * The event callback functions MUST NOT throw an `Exception`. + * The return value of the event callback functions will be ignored and has no + * effect, so for performance reasons you're recommended to not return any + * excessive data structures. + * + * Every implementation of this interface MUST follow these event semantics in + * order to be considered a well-behaving stream. + * + * > Note that higher-level implementations of this interface may choose to + * define additional events with dedicated semantics not defined as part of + * this low-level stream specification. Conformance with these event semantics + * is out of scope for this interface, so you may also have to refer to the + * documentation of such a higher-level implementation. + * + * @see EventEmitterInterface + * @see DuplexStreamInterface + */ +interface WritableStreamInterface extends EventEmitterInterface +{ + /** + * Checks whether this stream is in a writable state (not closed already). + * + * This method can be used to check if the stream still accepts writing + * any data or if it is ended or closed already. + * Writing any data to a non-writable stream is a NO-OP: + * + * ```php + * assert($stream->isWritable() === false); + * + * $stream->write('end'); // NO-OP + * $stream->end('end'); // NO-OP + * ``` + * + * A successfully opened stream always MUST start in writable mode. + * + * Once the stream ends or closes, it MUST switch to non-writable mode. + * This can happen any time, explicitly through `end()` or `close()` or + * implicitly due to a remote close or an unrecoverable transmission error. + * Once a stream has switched to non-writable mode, it MUST NOT transition + * back to writable mode. + * + * If this stream is a `DuplexStreamInterface`, you should also notice + * how the readable side of the stream also implements an `isReadable()` + * method. Unless this is a half-open duplex stream, they SHOULD usually + * have the same return value. + * + * @return bool + */ + public function isWritable(); + + /** + * Write some data into the stream. + * + * A successful write MUST be confirmed with a boolean `true`, which means + * that either the data was written (flushed) immediately or is buffered and + * scheduled for a future write. Note that this interface gives you no + * control over explicitly flushing the buffered data, as finding the + * appropriate time for this is beyond the scope of this interface and left + * up to the implementation of this interface. + * + * Many common streams (such as a TCP/IP connection or file-based stream) + * may choose to buffer all given data and schedule a future flush by using + * an underlying EventLoop to check when the resource is actually writable. + * + * If a stream cannot handle writing (or flushing) the data, it SHOULD emit + * an `error` event and MAY `close()` the stream if it can not recover from + * this error. + * + * If the internal buffer is full after adding `$data`, then `write()` + * SHOULD return `false`, indicating that the caller should stop sending + * data until the buffer drains. + * The stream SHOULD send a `drain` event once the buffer is ready to accept + * more data. + * + * Similarly, if the stream is not writable (already in a closed state) + * it MUST NOT process the given `$data` and SHOULD return `false`, + * indicating that the caller should stop sending data. + * + * The given `$data` argument MAY be of mixed type, but it's usually + * recommended it SHOULD be a `string` value or MAY use a type that allows + * representation as a `string` for maximum compatibility. + * + * Many common streams (such as a TCP/IP connection or a file-based stream) + * will only accept the raw (binary) payload data that is transferred over + * the wire as chunks of `string` values. + * + * Due to the stream-based nature of this, the sender may send any number + * of chunks with varying sizes. There are no guarantees that these chunks + * will be received with the exact same framing the sender intended to send. + * In other words, many lower-level protocols (such as TCP/IP) transfer the + * data in chunks that may be anywhere between single-byte values to several + * dozens of kilobytes. You may want to apply a higher-level protocol to + * these low-level data chunks in order to achieve proper message framing. + * + * @param mixed|string $data + * @return bool + */ + public function write($data); + + /** + * Successfully ends the stream (after optionally sending some final data). + * + * This method can be used to successfully end the stream, i.e. close + * the stream after sending out all data that is currently buffered. + * + * ```php + * $stream->write('hello'); + * $stream->write('world'); + * $stream->end(); + * ``` + * + * If there's no data currently buffered and nothing to be flushed, then + * this method MAY `close()` the stream immediately. + * + * If there's still data in the buffer that needs to be flushed first, then + * this method SHOULD try to write out this data and only then `close()` + * the stream. + * Once the stream is closed, it SHOULD emit a `close` event. + * + * Note that this interface gives you no control over explicitly flushing + * the buffered data, as finding the appropriate time for this is beyond the + * scope of this interface and left up to the implementation of this + * interface. + * + * Many common streams (such as a TCP/IP connection or file-based stream) + * may choose to buffer all given data and schedule a future flush by using + * an underlying EventLoop to check when the resource is actually writable. + * + * You can optionally pass some final data that is written to the stream + * before ending the stream. If a non-`null` value is given as `$data`, then + * this method will behave just like calling `write($data)` before ending + * with no data. + * + * ```php + * // shorter version + * $stream->end('bye'); + * + * // same as longer version + * $stream->write('bye'); + * $stream->end(); + * ``` + * + * After calling this method, the stream MUST switch into a non-writable + * mode, see also `isWritable()`. + * This means that no further writes are possible, so any additional + * `write()` or `end()` calls have no effect. + * + * ```php + * $stream->end(); + * assert($stream->isWritable() === false); + * + * $stream->write('nope'); // NO-OP + * $stream->end(); // NO-OP + * ``` + * + * If this stream is a `DuplexStreamInterface`, calling this method SHOULD + * also end its readable side, unless the stream supports half-open mode. + * In other words, after calling this method, these streams SHOULD switch + * into non-writable AND non-readable mode, see also `isReadable()`. + * This implies that in this case, the stream SHOULD NOT emit any `data` + * or `end` events anymore. + * Streams MAY choose to use the `pause()` method logic for this, but + * special care may have to be taken to ensure a following call to the + * `resume()` method SHOULD NOT continue emitting readable events. + * + * Note that this method should not be confused with the `close()` method. + * + * @param mixed|string|null $data + * @return void + */ + public function end($data = null); + + /** + * Closes the stream (forcefully). + * + * This method can be used to forcefully close the stream, i.e. close + * the stream without waiting for any buffered data to be flushed. + * If there's still data in the buffer, this data SHOULD be discarded. + * + * ```php + * $stream->close(); + * ``` + * + * Once the stream is closed, it SHOULD emit a `close` event. + * Note that this event SHOULD NOT be emitted more than once, in particular + * if this method is called multiple times. + * + * After calling this method, the stream MUST switch into a non-writable + * mode, see also `isWritable()`. + * This means that no further writes are possible, so any additional + * `write()` or `end()` calls have no effect. + * + * ```php + * $stream->close(); + * assert($stream->isWritable() === false); + * + * $stream->write('nope'); // NO-OP + * $stream->end(); // NO-OP + * ``` + * + * Note that this method should not be confused with the `end()` method. + * Unlike the `end()` method, this method does not take care of any existing + * buffers and simply discards any buffer contents. + * Likewise, this method may also be called after calling `end()` on a + * stream in order to stop waiting for the stream to flush its final data. + * + * ```php + * $stream->end(); + * Loop::addTimer(1.0, function () use ($stream) { + * $stream->close(); + * }); + * ``` + * + * If this stream is a `DuplexStreamInterface`, you should also notice + * how the readable side of the stream also implements a `close()` method. + * In other words, after calling this method, the stream MUST switch into + * non-writable AND non-readable mode, see also `isReadable()`. + * + * @return void + * @see ReadableStreamInterface::close() + */ + public function close(); +} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/ChangeLog.md b/tools/php-cs-fixer/vendor/sebastian/diff/ChangeLog.md index 9142e50f..b12b9932 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/ChangeLog.md +++ b/tools/php-cs-fixer/vendor/sebastian/diff/ChangeLog.md @@ -2,6 +2,53 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [6.0.2] - 2024-07-03 + +### Changed + +* This project now uses PHPStan instead of Psalm for static analysis + +## [6.0.1] - 2024-03-02 + +### Changed + +* Do not use implicitly nullable parameters + +## [6.0.0] - 2024-02-02 + +### Removed + +* `SebastianBergmann\Diff\Chunk::getStart()`, `SebastianBergmann\Diff\Chunk::getStartRange()`, `SebastianBergmann\Diff\Chunk::getEnd()`, `SebastianBergmann\Diff\Chunk::getEndRange()`, and `SebastianBergmann\Diff\Chunk::getLines()` +* `SebastianBergmann\Diff\Diff::getFrom()`, `SebastianBergmann\Diff\Diff::getTo()`, and `SebastianBergmann\Diff\Diff::getChunks()` +* `SebastianBergmann\Diff\Line::getContent()` and `SebastianBergmann\Diff\Diff::getType()` +* Removed support for PHP 8.1 + +## [5.1.1] - 2024-03-02 + +### Changed + +* Do not use implicitly nullable parameters + +## [5.1.0] - 2023-12-22 + +### Added + +* `SebastianBergmann\Diff\Chunk::start()`, `SebastianBergmann\Diff\Chunk::startRange()`, `SebastianBergmann\Diff\Chunk::end()`, `SebastianBergmann\Diff\Chunk::endRange()`, and `SebastianBergmann\Diff\Chunk::lines()` +* `SebastianBergmann\Diff\Diff::from()`, `SebastianBergmann\Diff\Diff::to()`, and `SebastianBergmann\Diff\Diff::chunks()` +* `SebastianBergmann\Diff\Line::content()` and `SebastianBergmann\Diff\Diff::type()` +* `SebastianBergmann\Diff\Line::isAdded()`,`SebastianBergmann\Diff\Line::isRemoved()`, and `SebastianBergmann\Diff\Line::isUnchanged()` + +### Changed + +* `SebastianBergmann\Diff\Diff` now implements `IteratorAggregate`, iterating over it yields the aggregated `SebastianBergmann\Diff\Chunk` objects +* `SebastianBergmann\Diff\Chunk` now implements `IteratorAggregate`, iterating over it yields the aggregated `SebastianBergmann\Diff\Line` objects + +### Deprecated + +* `SebastianBergmann\Diff\Chunk::getStart()`, `SebastianBergmann\Diff\Chunk::getStartRange()`, `SebastianBergmann\Diff\Chunk::getEnd()`, `SebastianBergmann\Diff\Chunk::getEndRange()`, and `SebastianBergmann\Diff\Chunk::getLines()` +* `SebastianBergmann\Diff\Diff::getFrom()`, `SebastianBergmann\Diff\Diff::getTo()`, and `SebastianBergmann\Diff\Diff::getChunks()` +* `SebastianBergmann\Diff\Line::getContent()` and `SebastianBergmann\Diff\Diff::getType()` + ## [5.0.3] - 2023-05-01 ### Changed @@ -104,6 +151,11 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 5.6 +[6.0.2]: https://github.com/sebastianbergmann/diff/compare/6.0.1...6.0.2 +[6.0.1]: https://github.com/sebastianbergmann/diff/compare/6.0.0...6.0.1 +[6.0.0]: https://github.com/sebastianbergmann/diff/compare/5.1...6.0.0 +[5.1.1]: https://github.com/sebastianbergmann/diff/compare/5.1.0...5.1.1 +[5.1.0]: https://github.com/sebastianbergmann/diff/compare/5.0.3...5.1.0 [5.0.3]: https://github.com/sebastianbergmann/diff/compare/5.0.2...5.0.3 [5.0.2]: https://github.com/sebastianbergmann/diff/compare/5.0.1...5.0.2 [5.0.1]: https://github.com/sebastianbergmann/diff/compare/5.0.0...5.0.1 diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/LICENSE b/tools/php-cs-fixer/vendor/sebastian/diff/LICENSE index a453252d..5b4705a4 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/LICENSE +++ b/tools/php-cs-fixer/vendor/sebastian/diff/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2002-2023, Sebastian Bergmann +Copyright (c) 2002-2024, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/README.md b/tools/php-cs-fixer/vendor/sebastian/diff/README.md index 539dc59e..7b710249 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/README.md +++ b/tools/php-cs-fixer/vendor/sebastian/diff/README.md @@ -1,6 +1,5 @@ [![Latest Stable Version](https://poser.pugx.org/sebastian/diff/v/stable.png)](https://packagist.org/packages/sebastian/diff) [![CI Status](https://github.com/sebastianbergmann/diff/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/diff/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/diff/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/diff) [![codecov](https://codecov.io/gh/sebastianbergmann/diff/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/diff) # sebastian/diff diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/composer.json b/tools/php-cs-fixer/vendor/sebastian/diff/composer.json index cd37ef6b..7e19a7d9 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/composer.json +++ b/tools/php-cs-fixer/vendor/sebastian/diff/composer.json @@ -21,16 +21,16 @@ "prefer-stable": true, "config": { "platform": { - "php": "8.1.0" + "php": "8.2.0" }, "optimize-autoloader": true, "sort-packages": true }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.0", "symfony/process": "^4.2 || ^5" }, "autoload": { @@ -45,7 +45,7 @@ }, "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } } } diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Chunk.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Chunk.php index cdfdf00b..8d1854e0 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Chunk.php +++ b/tools/php-cs-fixer/vendor/sebastian/diff/src/Chunk.php @@ -9,14 +9,28 @@ */ namespace SebastianBergmann\Diff; -final class Chunk +use ArrayIterator; +use IteratorAggregate; +use Traversable; + +/** + * @template-implements IteratorAggregate + */ +final class Chunk implements IteratorAggregate { private int $start; private int $startRange; private int $end; private int $endRange; + + /** + * @var list + */ private array $lines; + /** + * @param list $lines + */ public function __construct(int $start = 0, int $startRange = 1, int $end = 0, int $endRange = 1, array $lines = []) { $this->start = $start; @@ -26,36 +40,36 @@ public function __construct(int $start = 0, int $startRange = 1, int $end = 0, i $this->lines = $lines; } - public function getStart(): int + public function start(): int { return $this->start; } - public function getStartRange(): int + public function startRange(): int { return $this->startRange; } - public function getEnd(): int + public function end(): int { return $this->end; } - public function getEndRange(): int + public function endRange(): int { return $this->endRange; } /** - * @psalm-return list + * @return list */ - public function getLines(): array + public function lines(): array { return $this->lines; } /** - * @psalm-param list $lines + * @param list $lines */ public function setLines(array $lines): void { @@ -67,4 +81,9 @@ public function setLines(array $lines): void $this->lines = $lines; } + + public function getIterator(): Traversable + { + return new ArrayIterator($this->lines); + } } diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Diff.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Diff.php index 3376b723..372eb3d5 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Diff.php +++ b/tools/php-cs-fixer/vendor/sebastian/diff/src/Diff.php @@ -9,18 +9,34 @@ */ namespace SebastianBergmann\Diff; -final class Diff +use ArrayIterator; +use IteratorAggregate; +use Traversable; + +/** + * @template-implements IteratorAggregate + */ +final class Diff implements IteratorAggregate { + /** + * @var non-empty-string + */ private string $from; + + /** + * @var non-empty-string + */ private string $to; /** - * @psalm-var list + * @var list */ private array $chunks; /** - * @psalm-param list $chunks + * @param non-empty-string $from + * @param non-empty-string $to + * @param list $chunks */ public function __construct(string $from, string $to, array $chunks = []) { @@ -29,29 +45,40 @@ public function __construct(string $from, string $to, array $chunks = []) $this->chunks = $chunks; } - public function getFrom(): string + /** + * @return non-empty-string + */ + public function from(): string { return $this->from; } - public function getTo(): string + /** + * @return non-empty-string + */ + public function to(): string { return $this->to; } /** - * @psalm-return list + * @return list */ - public function getChunks(): array + public function chunks(): array { return $this->chunks; } /** - * @psalm-param list $chunks + * @param list $chunks */ public function setChunks(array $chunks): void { $this->chunks = $chunks; } + + public function getIterator(): Traversable + { + return new ArrayIterator($this->chunks); + } } diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Differ.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Differ.php index 19ccf97c..86bd96c7 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Differ.php +++ b/tools/php-cs-fixer/vendor/sebastian/diff/src/Differ.php @@ -42,14 +42,22 @@ public function __construct(DiffOutputBuilderInterface $outputBuilder) $this->outputBuilder = $outputBuilder; } - public function diff(array|string $from, array|string $to, LongestCommonSubsequenceCalculator $lcs = null): string + /** + * @param list|string $from + * @param list|string $to + */ + public function diff(array|string $from, array|string $to, ?LongestCommonSubsequenceCalculator $lcs = null): string { $diff = $this->diffToArray($from, $to, $lcs); return $this->outputBuilder->getDiff($diff); } - public function diffToArray(array|string $from, array|string $to, LongestCommonSubsequenceCalculator $lcs = null): array + /** + * @param list|string $from + * @param list|string $to + */ + public function diffToArray(array|string $from, array|string $to, ?LongestCommonSubsequenceCalculator $lcs = null): array { if (is_string($from)) { $from = $this->splitStringByLines($from); diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/ConfigurationException.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/ConfigurationException.php index 85f066c2..4bd25d89 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/ConfigurationException.php +++ b/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/ConfigurationException.php @@ -16,22 +16,17 @@ final class ConfigurationException extends InvalidArgumentException { - public function __construct( - string $option, - string $expected, - $value, - int $code = 0, - Exception $previous = null - ) { + public function __construct(string $option, string $expected, mixed $value, int $code = 0, ?Exception $previous = null) + { parent::__construct( sprintf( 'Option "%s" must be %s, got "%s".', $option, $expected, - is_object($value) ? $value::class : (null === $value ? '' : gettype($value) . '#' . $value) + is_object($value) ? $value::class : (null === $value ? '' : gettype($value) . '#' . $value), ), $code, - $previous + $previous, ); } } diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Line.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Line.php index a9106a25..be544f05 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Line.php +++ b/tools/php-cs-fixer/vendor/sebastian/diff/src/Line.php @@ -23,13 +23,28 @@ public function __construct(int $type = self::UNCHANGED, string $content = '') $this->content = $content; } - public function getContent(): string + public function content(): string { return $this->content; } - public function getType(): int + public function type(): int { return $this->type; } + + public function isAdded(): bool + { + return $this->type === self::ADDED; + } + + public function isRemoved(): bool + { + return $this->type === self::REMOVED; + } + + public function isUnchanged(): bool + { + return $this->type === self::UNCHANGED; + } } diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php index a46de07d..b9846c37 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php +++ b/tools/php-cs-fixer/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php @@ -61,7 +61,7 @@ public function calculate(array $from, array $to): array return array_merge( $this->calculate($fromStart, $toStart), - $this->calculate($fromEnd, $toEnd) + $this->calculate($fromEnd, $toEnd), ); } @@ -78,7 +78,11 @@ private function length(array $from, array $to): array if ($from[$i] === $to[$j]) { $current[$j + 1] = $prev[$j] + 1; } else { - // don't use max() to avoid function call overhead + /** + * @noinspection PhpConditionCanBeReplacedWithMinMaxCallInspection + * + * We do not use max() here to avoid the function call overhead + */ if ($current[$j] > $prev[$j + 1]) { $current[$j + 1] = $current[$j]; } else { diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php index 3eb7428d..3bb5e0de 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php +++ b/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php @@ -46,13 +46,13 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface private bool $collapseRanges; /** - * @psalm-var positive-int + * @var positive-int */ private int $commonLineThreshold; private string $header; /** - * @psalm-var positive-int + * @var positive-int */ private int $contextLines; @@ -82,7 +82,7 @@ public function __construct(array $options = []) $options['fromFile'], null === $options['fromFileDate'] ? '' : "\t" . $options['fromFileDate'], $options['toFile'], - null === $options['toFileDate'] ? '' : "\t" . $options['toFileDate'] + null === $options['toFileDate'] ? '' : "\t" . $options['toFileDate'], ); $this->collapseRanges = $options['collapseRanges']; @@ -201,11 +201,11 @@ private function writeDiffHunks($output, array $diff): void $fromRange - $cutOff + $contextStartOffset + $this->contextLines, $toStart - $contextStartOffset, $toRange - $cutOff + $contextStartOffset + $this->contextLines, - $output + $output, ); $fromStart += $fromRange; - $toStart += $toRange; + $toStart += $toRange; $hunkCapture = false; $sameCount = $toRange = $fromRange = 0; @@ -251,7 +251,7 @@ private function writeDiffHunks($output, array $diff): void $contextEndOffset = min($sameCount, $this->contextLines); $fromRange -= $sameCount; - $toRange -= $sameCount; + $toRange -= $sameCount; $this->writeHunk( $diff, @@ -261,7 +261,7 @@ private function writeDiffHunks($output, array $diff): void $fromRange + $contextStartOffset + $contextEndOffset, $toStart - $contextStartOffset, $toRange + $contextStartOffset + $contextEndOffset, - $output + $output, ); } @@ -302,11 +302,11 @@ private function writeHunk( $this->changed = true; fwrite($output, $diff[$i][0]); } - //} elseif ($diff[$i][1] === Differ::DIFF_LINE_END_WARNING) { // custom comment inserted by PHPUnit/diff package + // } elseif ($diff[$i][1] === Differ::DIFF_LINE_END_WARNING) { // custom comment inserted by PHPUnit/diff package // skip - //} else { + // } else { // unknown/invalid - //} + // } } } diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php index 1483b3af..fa6ae7a1 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php +++ b/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php @@ -18,7 +18,6 @@ use function min; use function str_ends_with; use function stream_get_contents; -use function strlen; use function substr; use SebastianBergmann\Diff\Differ; @@ -31,7 +30,7 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder private int $commonLineThreshold = 6; /** - * @psalm-var positive-int + * @var positive-int */ private int $contextLines = 3; private string $header; @@ -67,7 +66,7 @@ public function getDiff(array $diff): string // This might happen when both the `from` and `to` do not have a trailing linebreak $last = substr($diff, -1); - return 0 !== strlen($diff) && "\n" !== $last && "\r" !== $last + return '' !== $diff && "\n" !== $last && "\r" !== $last ? $diff . "\n" : $diff; } @@ -151,11 +150,11 @@ private function writeDiffHunks($output, array $diff): void $fromRange - $cutOff + $contextStartOffset + $this->contextLines, $toStart - $contextStartOffset, $toRange - $cutOff + $contextStartOffset + $this->contextLines, - $output + $output, ); $fromStart += $fromRange; - $toStart += $toRange; + $toStart += $toRange; $hunkCapture = false; $sameCount = $toRange = $fromRange = 0; @@ -199,7 +198,7 @@ private function writeDiffHunks($output, array $diff): void $contextEndOffset = min($sameCount, $this->contextLines); $fromRange -= $sameCount; - $toRange -= $sameCount; + $toRange -= $sameCount; $this->writeHunk( $diff, @@ -209,7 +208,7 @@ private function writeDiffHunks($output, array $diff): void $fromRange + $contextStartOffset + $contextEndOffset, $toStart - $contextStartOffset, $toRange + $contextStartOffset + $contextEndOffset, - $output + $output, ); } diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Parser.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Parser.php index 698b815c..9293fc91 100644 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Parser.php +++ b/tools/php-cs-fixer/vendor/sebastian/diff/src/Parser.php @@ -10,6 +10,7 @@ namespace SebastianBergmann\Diff; use function array_pop; +use function assert; use function count; use function max; use function preg_match; @@ -46,6 +47,9 @@ public function parse(string $string): array $collected = []; } + assert(!empty($fromMatch['file'])); + assert(!empty($toMatch['file'])); + $diff = new Diff($fromMatch['file'], $toMatch['file']); $i++; @@ -79,7 +83,7 @@ private function parseFileDiff(Diff $diff, array $lines): void (int) $match['start'], isset($match['startrange']) ? max(0, (int) $match['startrange']) : 1, (int) $match['end'], - isset($match['endrange']) ? max(0, (int) $match['endrange']) : 1 + isset($match['endrange']) ? max(0, (int) $match['endrange']) : 1, ); $chunks[] = $chunk; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Application.php b/tools/php-cs-fixer/vendor/symfony/console/Application.php index 41548a3e..78d885d2 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Application.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Application.php @@ -22,6 +22,7 @@ use Symfony\Component\Console\Completion\CompletionInput; use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Completion\Suggestion; +use Symfony\Component\Console\Event\ConsoleAlarmEvent; use Symfony\Component\Console\Event\ConsoleCommandEvent; use Symfony\Component\Console\Event\ConsoleErrorEvent; use Symfony\Component\Console\Event\ConsoleSignalEvent; @@ -75,10 +76,9 @@ class Application implements ResetInterface private array $commands = []; private bool $wantHelps = false; private ?Command $runningCommand = null; - private string $name; - private string $version; private ?CommandLoaderInterface $commandLoader = null; private bool $catchExceptions = true; + private bool $catchErrors = false; private bool $autoExit = true; private InputDefinition $definition; private HelperSet $helperSet; @@ -89,28 +89,29 @@ class Application implements ResetInterface private bool $initialized = false; private ?SignalRegistry $signalRegistry = null; private array $signalsToDispatchEvent = []; + private ?int $alarmInterval = null; - public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') - { - $this->name = $name; - $this->version = $version; + public function __construct( + private string $name = 'UNKNOWN', + private string $version = 'UNKNOWN', + ) { $this->terminal = new Terminal(); $this->defaultCommand = 'list'; if (\defined('SIGINT') && SignalRegistry::isSupported()) { $this->signalRegistry = new SignalRegistry(); - $this->signalsToDispatchEvent = [\SIGINT, \SIGTERM, \SIGUSR1, \SIGUSR2]; + $this->signalsToDispatchEvent = [\SIGINT, \SIGQUIT, \SIGTERM, \SIGUSR1, \SIGUSR2, \SIGALRM]; } } /** * @final */ - public function setDispatcher(EventDispatcherInterface $dispatcher) + public function setDispatcher(EventDispatcherInterface $dispatcher): void { $this->dispatcher = $dispatcher; } - public function setCommandLoader(CommandLoaderInterface $commandLoader) + public function setCommandLoader(CommandLoaderInterface $commandLoader): void { $this->commandLoader = $commandLoader; } @@ -118,17 +119,41 @@ public function setCommandLoader(CommandLoaderInterface $commandLoader) public function getSignalRegistry(): SignalRegistry { if (!$this->signalRegistry) { - throw new RuntimeException('Signals are not supported. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); + throw new RuntimeException('Signals are not supported. Make sure that the "pcntl" extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); } return $this->signalRegistry; } - public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) + public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent): void { $this->signalsToDispatchEvent = $signalsToDispatchEvent; } + /** + * Sets the interval to schedule a SIGALRM signal in seconds. + */ + public function setAlarmInterval(?int $seconds): void + { + $this->alarmInterval = $seconds; + $this->scheduleAlarm(); + } + + /** + * Gets the interval in seconds on which a SIGALRM signal is dispatched. + */ + public function getAlarmInterval(): ?int + { + return $this->alarmInterval; + } + + private function scheduleAlarm(): void + { + if (null !== $this->alarmInterval) { + $this->getSignalRegistry()->scheduleAlarm($this->alarmInterval); + } + } + /** * Runs the current application. * @@ -136,7 +161,7 @@ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) * * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. */ - public function run(InputInterface $input = null, OutputInterface $output = null): int + public function run(?InputInterface $input = null, ?OutputInterface $output = null): int { if (\function_exists('putenv')) { @putenv('LINES='.$this->terminal->getHeight()); @@ -162,12 +187,15 @@ public function run(InputInterface $input = null, OutputInterface $output = null } } - $this->configureIO($input, $output); - try { + $this->configureIO($input, $output); + $exitCode = $this->doRun($input, $output); - } catch (\Exception $e) { - if (!$this->catchExceptions) { + } catch (\Throwable $e) { + if ($e instanceof \Exception && !$this->catchExceptions) { + throw $e; + } + if (!$e instanceof \Exception && !$this->catchErrors) { throw $e; } @@ -214,7 +242,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null * * @return int 0 if everything went fine, or an error code */ - public function doRun(InputInterface $input, OutputInterface $output) + public function doRun(InputInterface $input, OutputInterface $output): int { if (true === $input->hasParameterOption(['--version', '-V'], true)) { $output->writeln($this->getLongVersion()); @@ -260,9 +288,9 @@ public function doRun(InputInterface $input, OutputInterface $output) $style = new SymfonyStyle($input, $output); $output->writeln(''); - $formattedBlock = (new FormatterHelper())->formatBlock(sprintf('Command "%s" is not defined.', $name), 'error', true); + $formattedBlock = (new FormatterHelper())->formatBlock(\sprintf('Command "%s" is not defined.', $name), 'error', true); $output->writeln($formattedBlock); - if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { + if (!$style->confirm(\sprintf('Do you want to run "%s" instead? ', $alternative), false)) { if (null !== $this->dispatcher) { $event = new ConsoleErrorEvent($input, $output, $e); $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); @@ -317,11 +345,11 @@ public function doRun(InputInterface $input, OutputInterface $output) return $exitCode; } - public function reset() + public function reset(): void { } - public function setHelperSet(HelperSet $helperSet) + public function setHelperSet(HelperSet $helperSet): void { $this->helperSet = $helperSet; } @@ -334,7 +362,7 @@ public function getHelperSet(): HelperSet return $this->helperSet ??= $this->getDefaultHelperSet(); } - public function setDefinition(InputDefinition $definition) + public function setDefinition(InputDefinition $definition): void { $this->definition = $definition; } @@ -381,8 +409,6 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti if (CompletionInput::TYPE_OPTION_NAME === $input->getCompletionType()) { $suggestions->suggestOptions($this->getDefinition()->getOptions()); - - return; } } @@ -405,11 +431,19 @@ public function areExceptionsCaught(): bool /** * Sets whether to catch exceptions or not during commands execution. */ - public function setCatchExceptions(bool $boolean) + public function setCatchExceptions(bool $boolean): void { $this->catchExceptions = $boolean; } + /** + * Sets whether to catch errors or not during commands execution. + */ + public function setCatchErrors(bool $catchErrors = true): void + { + $this->catchErrors = $catchErrors; + } + /** * Gets whether to automatically exit after a command execution or not. */ @@ -421,7 +455,7 @@ public function isAutoExitEnabled(): bool /** * Sets whether to automatically exit after a command execution or not. */ - public function setAutoExit(bool $boolean) + public function setAutoExit(bool $boolean): void { $this->autoExit = $boolean; } @@ -436,8 +470,8 @@ public function getName(): string /** * Sets the application name. - **/ - public function setName(string $name) + */ + public function setName(string $name): void { $this->name = $name; } @@ -453,21 +487,19 @@ public function getVersion(): string /** * Sets the application version. */ - public function setVersion(string $version) + public function setVersion(string $version): void { $this->version = $version; } /** * Returns the long version of the application. - * - * @return string */ - public function getLongVersion() + public function getLongVersion(): string { if ('UNKNOWN' !== $this->getName()) { if ('UNKNOWN' !== $this->getVersion()) { - return sprintf('%s %s', $this->getName(), $this->getVersion()); + return \sprintf('%s %s', $this->getName(), $this->getVersion()); } return $this->getName(); @@ -491,7 +523,7 @@ public function register(string $name): Command * * @param Command[] $commands An array of commands */ - public function addCommands(array $commands) + public function addCommands(array $commands): void { foreach ($commands as $command) { $this->add($command); @@ -503,10 +535,8 @@ public function addCommands(array $commands) * * If a command with the same name already exists, it will be overridden. * If the command is not enabled it will not be added. - * - * @return Command|null */ - public function add(Command $command) + public function add(Command $command): ?Command { $this->init(); @@ -524,7 +554,7 @@ public function add(Command $command) } if (!$command->getName()) { - throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command))); + throw new LogicException(\sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command))); } $this->commands[$command->getName()] = $command; @@ -539,21 +569,19 @@ public function add(Command $command) /** * Returns a registered command by name or alias. * - * @return Command - * * @throws CommandNotFoundException When given command name does not exist */ - public function get(string $name) + public function get(string $name): Command { $this->init(); if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); + throw new CommandNotFoundException(\sprintf('The command "%s" does not exist.', $name)); } // When the command has a different name than the one used at the command loader level if (!isset($this->commands[$name])) { - throw new CommandNotFoundException(sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name)); + throw new CommandNotFoundException(\sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name)); } $command = $this->commands[$name]; @@ -616,8 +644,8 @@ public function findNamespace(string $namespace): string $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*'; $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); - if (empty($namespaces)) { - $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); + if (!$namespaces) { + $message = \sprintf('There are no commands defined in the "%s" namespace.', $namespace); if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) { if (1 == \count($alternatives)) { @@ -634,7 +662,7 @@ public function findNamespace(string $namespace): string $exact = \in_array($namespace, $namespaces, true); if (\count($namespaces) > 1 && !$exact) { - throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); + throw new NamespaceNotFoundException(\sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); } return $exact ? $namespace : reset($namespaces); @@ -646,11 +674,9 @@ public function findNamespace(string $namespace): string * Contrary to get, this command tries to find the best * match if you give it an abbreviation of a name or alias. * - * @return Command - * * @throws CommandNotFoundException When command name is incorrect or ambiguous */ - public function find(string $name) + public function find(string $name): Command { $this->init(); @@ -672,24 +698,22 @@ public function find(string $name) $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $name))).'[^:]*'; $commands = preg_grep('{^'.$expr.'}', $allCommands); - if (empty($commands)) { + if (!$commands) { $commands = preg_grep('{^'.$expr.'}i', $allCommands); } // if no commands matched or we just matched namespaces - if (empty($commands) || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) { + if (!$commands || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) { if (false !== $pos = strrpos($name, ':')) { // check if a namespace exists and contains commands $this->findNamespace(substr($name, 0, $pos)); } - $message = sprintf('Command "%s" is not defined.', $name); + $message = \sprintf('Command "%s" is not defined.', $name); if ($alternatives = $this->findAlternatives($name, $allCommands)) { // remove hidden commands - $alternatives = array_filter($alternatives, function ($name) { - return !$this->get($name)->isHidden(); - }); + $alternatives = array_filter($alternatives, fn ($name) => !$this->get($name)->isHidden()); if (1 == \count($alternatives)) { $message .= "\n\nDid you mean this?\n "; @@ -714,7 +738,7 @@ public function find(string $name) $aliases[$nameOrAlias] = $commandName; - return $commandName === $nameOrAlias || !\in_array($commandName, $commands); + return $commandName === $nameOrAlias || !\in_array($commandName, $commands, true); })); } @@ -740,14 +764,14 @@ public function find(string $name) if (\count($commands) > 1) { $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs)); - throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); + throw new CommandNotFoundException(\sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); } } $command = $this->get(reset($commands)); if ($command->isHidden()) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); + throw new CommandNotFoundException(\sprintf('The command "%s" does not exist.', $name)); } return $command; @@ -760,7 +784,7 @@ public function find(string $name) * * @return Command[] */ - public function all(string $namespace = null) + public function all(?string $namespace = null): array { $this->init(); @@ -822,7 +846,7 @@ public function renderThrowable(\Throwable $e, OutputInterface $output): void $this->doRenderThrowable($e, $output); if (null !== $this->runningCommand) { - $output->writeln(sprintf('%s', OutputFormatter::escape(sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET); + $output->writeln(\sprintf('%s', OutputFormatter::escape(\sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET); $output->writeln('', OutputInterface::VERBOSITY_QUIET); } } @@ -833,16 +857,14 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo $message = trim($e->getMessage()); if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { $class = get_debug_type($e); - $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); + $title = \sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); $len = Helper::width($title); } else { $len = 0; } if (str_contains($message, "@anonymous\0")) { - $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $message); + $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)?[0-9a-fA-F]++/', fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0], $message); } $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX; @@ -859,14 +881,14 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo $messages = []; if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a'))); + $messages[] = \sprintf('%s', OutputFormatter::escape(\sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a'))); } - $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len)); + $messages[] = $emptyLine = \sprintf('%s', str_repeat(' ', $len)); if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::width($title)))); + $messages[] = \sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::width($title)))); } foreach ($lines as $line) { - $messages[] = sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); + $messages[] = \sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); } $messages[] = $emptyLine; $messages[] = ''; @@ -893,7 +915,7 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo $file = $trace[$i]['file'] ?? 'n/a'; $line = $trace[$i]['line'] ?? 'n/a'; - $output->writeln(sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); + $output->writeln(\sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); } $output->writeln('', OutputInterface::VERBOSITY_QUIET); @@ -904,7 +926,7 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo /** * Configures the input and output instances based on the user arguments and options. */ - protected function configureIO(InputInterface $input, OutputInterface $output) + protected function configureIO(InputInterface $input, OutputInterface $output): void { if (true === $input->hasParameterOption(['--ansi'], true)) { $output->setDecorated(true); @@ -917,6 +939,9 @@ protected function configureIO(InputInterface $input, OutputInterface $output) } switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { + case -2: + $output->setVerbosity(OutputInterface::VERBOSITY_SILENT); + break; case -1: $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); break; @@ -934,7 +959,10 @@ protected function configureIO(InputInterface $input, OutputInterface $output) break; } - if (true === $input->hasParameterOption(['--quiet', '-q'], true)) { + if (true === $input->hasParameterOption(['--silent'], true)) { + $output->setVerbosity(OutputInterface::VERBOSITY_SILENT); + $shellVerbosity = -2; + } elseif (true === $input->hasParameterOption(['--quiet', '-q'], true)) { $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); $shellVerbosity = -1; } else { @@ -950,7 +978,7 @@ protected function configureIO(InputInterface $input, OutputInterface $output) } } - if (-1 === $shellVerbosity) { + if (0 > $shellVerbosity) { $input->setInteractive(false); } @@ -969,7 +997,7 @@ protected function configureIO(InputInterface $input, OutputInterface $output) * * @return int 0 if everything went fine, or an error code */ - protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) + protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output): int { foreach ($command->getHelperSet() as $helper) { if ($helper instanceof InputAwareInterface) { @@ -977,44 +1005,70 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI } } - if ($this->signalsToDispatchEvent) { - $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; + $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; + if ($commandSignals || $this->dispatcher && $this->signalsToDispatchEvent) { + $signalRegistry = $this->getSignalRegistry(); - if ($commandSignals || null !== $this->dispatcher) { - if (!$this->signalRegistry) { - throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } - - if (Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); + if (Terminal::hasSttyAvailable()) { + $sttyMode = shell_exec('stty -g'); - foreach ([\SIGINT, \SIGTERM] as $signal) { - $this->signalRegistry->register($signal, static function () use ($sttyMode) { - shell_exec('stty '.$sttyMode); - }); - } + foreach ([\SIGINT, \SIGQUIT, \SIGTERM] as $signal) { + $signalRegistry->register($signal, static fn () => shell_exec('stty '.$sttyMode)); } } - if (null !== $this->dispatcher) { + if ($this->dispatcher) { + // We register application signals, so that we can dispatch the event foreach ($this->signalsToDispatchEvent as $signal) { - $event = new ConsoleSignalEvent($command, $input, $output, $signal); + $signalEvent = new ConsoleSignalEvent($command, $input, $output, $signal); + $alarmEvent = \SIGALRM === $signal ? new ConsoleAlarmEvent($command, $input, $output) : null; + + $signalRegistry->register($signal, function ($signal) use ($signalEvent, $alarmEvent, $command, $commandSignals, $input, $output) { + $this->dispatcher->dispatch($signalEvent, ConsoleEvents::SIGNAL); + $exitCode = $signalEvent->getExitCode(); + + if (null !== $alarmEvent) { + if (false !== $exitCode) { + $alarmEvent->setExitCode($exitCode); + } else { + $alarmEvent->abortExit(); + } + $this->dispatcher->dispatch($alarmEvent); + $exitCode = $alarmEvent->getExitCode(); + } + + // If the command is signalable, we call the handleSignal() method + if (\in_array($signal, $commandSignals, true)) { + $exitCode = $command->handleSignal($signal, $exitCode); + } - $this->signalRegistry->register($signal, function ($signal, $hasNext) use ($event) { - $this->dispatcher->dispatch($event, ConsoleEvents::SIGNAL); + if (\SIGALRM === $signal) { + $this->scheduleAlarm(); + } - // No more handlers, we try to simulate PHP default behavior - if (!$hasNext) { - if (!\in_array($signal, [\SIGUSR1, \SIGUSR2], true)) { - exit(0); - } + if (false !== $exitCode) { + $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode, $signal); + $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE); + + exit($event->getExitCode()); } }); } + + // then we register command signals, but not if already handled after the dispatcher + $commandSignals = array_diff($commandSignals, $this->signalsToDispatchEvent); } foreach ($commandSignals as $signal) { - $this->signalRegistry->register($signal, [$command, 'handleSignal']); + $signalRegistry->register($signal, function (int $signal) use ($command): void { + if (\SIGALRM === $signal) { + $this->scheduleAlarm(); + } + + if (false !== $exitCode = $command->handleSignal($signal)) { + exit($exitCode); + } + }); } } @@ -1077,7 +1131,8 @@ protected function getDefaultInputDefinition(): InputDefinition return new InputDefinition([ new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the '.$this->defaultCommand.' command'), - new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), + new InputOption('--silent', null, InputOption::VALUE_NONE, 'Do not output any message'), + new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Only errors are displayed. All other output is suppressed'), new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', null), @@ -1121,7 +1176,7 @@ private function getAbbreviationSuggestions(array $abbrevs): string * * This method is not part of public API and should not be used directly. */ - public function extractNamespace(string $name, int $limit = null): string + public function extractNamespace(string $name, ?int $limit = null): string { $parts = explode(':', $name, -1); @@ -1170,7 +1225,7 @@ private function findAlternatives(string $name, iterable $collection): array } } - $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; }); + $alternatives = array_filter($alternatives, fn ($lev) => $lev < 2 * $threshold); ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE); return array_keys($alternatives); @@ -1261,7 +1316,7 @@ private function extractAllNamespaces(string $name): array return $namespaces; } - private function init() + private function init(): void { if ($this->initialized) { return; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Attribute/AsCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Attribute/AsCommand.php index b337f548..6066d7c5 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Attribute/AsCommand.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Attribute/AsCommand.php @@ -17,6 +17,12 @@ #[\Attribute(\Attribute::TARGET_CLASS)] class AsCommand { + /** + * @param string $name The name of the command, used when calling it (i.e. "cache:clear") + * @param string|null $description The description of the command, displayed with the help page + * @param string[] $aliases The list of aliases of the command. The command will be executed when using one of them (i.e. "cache:clean") + * @param bool $hidden If true, the command won't be shown when listing all the available commands, but it can still be run as any other command + */ public function __construct( public string $name, public ?string $description = null, diff --git a/tools/php-cs-fixer/vendor/symfony/console/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/console/CHANGELOG.md index 61c36b0e..2c963568 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/CHANGELOG.md +++ b/tools/php-cs-fixer/vendor/symfony/console/CHANGELOG.md @@ -1,6 +1,45 @@ CHANGELOG ========= +7.2 +--- + + * Add support for `FORCE_COLOR` environment variable + * Add `verbosity` argument to `mustRun` process helper method + * [BC BREAK] Add silent verbosity (`--silent`/`SHELL_VERBOSITY=-2`) to suppress all output, including errors + * Add `OutputInterface::isSilent()`, `Output::isSilent()`, `OutputStyle::isSilent()` methods + * Add a configurable finished indicator to the progress indicator to show that the progress is finished + * Add ability to schedule alarm signals and a `ConsoleAlarmEvent` + +7.1 +--- + + * Add `ArgvInput::getRawTokens()` + +7.0 +--- + + * Add method `__toString()` to `InputInterface` + * Remove `Command::$defaultName` and `Command::$defaultDescription`, use the `AsCommand` attribute instead + * Require explicit argument when calling `*Command::setApplication()`, `*FormatterStyle::setForeground/setBackground()`, `Helper::setHelpSet()`, `Input*::setDefault()` and `Question::setAutocompleterCallback/setValidator()` + * Remove `StringInput::REGEX_STRING` + +6.4 +--- + + * Add `SignalMap` to map signal value to its name + * Multi-line text in vertical tables is aligned properly + * The application can also catch errors with `Application::setCatchErrors(true)` + * Add `RunCommandMessage` and `RunCommandMessageHandler` + * Dispatch `ConsoleTerminateEvent` after an exit on signal handling and add `ConsoleTerminateEvent::getInterruptingSignal()` + +6.3 +--- + + * Add support for choosing exit code while handling signal, or to not exit at all + * Add `ProgressBar::setPlaceholderFormatter` to set a placeholder attached to a instance, instead of being global. + * Add `ReStructuredTextDescriptor` + 6.2 --- diff --git a/tools/php-cs-fixer/vendor/symfony/console/CI/GithubActionReporter.php b/tools/php-cs-fixer/vendor/symfony/console/CI/GithubActionReporter.php index 7e556546..952d380d 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/CI/GithubActionReporter.php +++ b/tools/php-cs-fixer/vendor/symfony/console/CI/GithubActionReporter.php @@ -20,8 +20,6 @@ */ class GithubActionReporter { - private OutputInterface $output; - /** * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L80-L85 */ @@ -42,9 +40,9 @@ class GithubActionReporter ',' => '%2C', ]; - public function __construct(OutputInterface $output) - { - $this->output = $output; + public function __construct( + private OutputInterface $output, + ) { } public static function isGithubActionEnvironment(): bool @@ -57,7 +55,7 @@ public static function isGithubActionEnvironment(): bool * * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message */ - public function error(string $message, string $file = null, int $line = null, int $col = null): void + public function error(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { $this->log('error', $message, $file, $line, $col); } @@ -67,7 +65,7 @@ public function error(string $message, string $file = null, int $line = null, in * * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message */ - public function warning(string $message, string $file = null, int $line = null, int $col = null): void + public function warning(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { $this->log('warning', $message, $file, $line, $col); } @@ -77,23 +75,23 @@ public function warning(string $message, string $file = null, int $line = null, * * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message */ - public function debug(string $message, string $file = null, int $line = null, int $col = null): void + public function debug(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { $this->log('debug', $message, $file, $line, $col); } - private function log(string $type, string $message, string $file = null, int $line = null, int $col = null): void + private function log(string $type, string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { // Some values must be encoded. $message = strtr($message, self::ESCAPED_DATA); if (!$file) { // No file provided, output the message solely: - $this->output->writeln(sprintf('::%s::%s', $type, $message)); + $this->output->writeln(\sprintf('::%s::%s', $type, $message)); return; } - $this->output->writeln(sprintf('::%s file=%s,line=%s,col=%s::%s', $type, strtr($file, self::ESCAPED_PROPERTIES), strtr($line ?? 1, self::ESCAPED_PROPERTIES), strtr($col ?? 0, self::ESCAPED_PROPERTIES), $message)); + $this->output->writeln(\sprintf('::%s file=%s,line=%s,col=%s::%s', $type, strtr($file, self::ESCAPED_PROPERTIES), strtr($line ?? 1, self::ESCAPED_PROPERTIES), strtr($col ?? 0, self::ESCAPED_PROPERTIES), $message)); } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Color.php b/tools/php-cs-fixer/vendor/symfony/console/Color.php index 60ed046a..b1914c19 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Color.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Color.php @@ -60,7 +60,7 @@ public function __construct(string $foreground = '', string $background = '', ar foreach ($options as $option) { if (!isset(self::AVAILABLE_OPTIONS[$option])) { - throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(self::AVAILABLE_OPTIONS)))); + throw new InvalidArgumentException(\sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(self::AVAILABLE_OPTIONS)))); } $this->options[$option] = self::AVAILABLE_OPTIONS[$option]; @@ -88,7 +88,7 @@ public function set(): string return ''; } - return sprintf("\033[%sm", implode(';', $setCodes)); + return \sprintf("\033[%sm", implode(';', $setCodes)); } public function unset(): string @@ -107,7 +107,7 @@ public function unset(): string return ''; } - return sprintf("\033[%sm", implode(';', $unsetCodes)); + return \sprintf("\033[%sm", implode(';', $unsetCodes)); } private function parseColor(string $color, bool $background = false): string @@ -128,6 +128,6 @@ private function parseColor(string $color, bool $background = false): string return ($background ? '10' : '9').self::BRIGHT_COLORS[$color]; } - throw new InvalidArgumentException(sprintf('Invalid "%s" color; expected one of (%s).', $color, implode(', ', array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS))))); + throw new InvalidArgumentException(\sprintf('Invalid "%s" color; expected one of (%s).', $color, implode(', ', array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS))))); } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/Command.php b/tools/php-cs-fixer/vendor/symfony/console/Command/Command.php index 1e3c1a5a..244a419f 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/Command.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Command/Command.php @@ -39,20 +39,6 @@ class Command public const FAILURE = 1; public const INVALID = 2; - /** - * @var string|null The default command name - * - * @deprecated since Symfony 6.1, use the AsCommand attribute instead - */ - protected static $defaultName; - - /** - * @var string|null The default command description - * - * @deprecated since Symfony 6.1, use the AsCommand attribute instead - */ - protected static $defaultDescription; - private ?Application $application = null; private ?string $name = null; private ?string $processTitle = null; @@ -70,40 +56,20 @@ class Command public static function getDefaultName(): ?string { - $class = static::class; - - if ($attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { + if ($attribute = (new \ReflectionClass(static::class))->getAttributes(AsCommand::class)) { return $attribute[0]->newInstance()->name; } - $r = new \ReflectionProperty($class, 'defaultName'); - - if ($class !== $r->class || null === static::$defaultName) { - return null; - } - - trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultName" for setting a command name is deprecated. Add the "%s" attribute to the "%s" class instead.', AsCommand::class, static::class); - - return static::$defaultName; + return null; } public static function getDefaultDescription(): ?string { - $class = static::class; - - if ($attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { + if ($attribute = (new \ReflectionClass(static::class))->getAttributes(AsCommand::class)) { return $attribute[0]->newInstance()->description; } - $r = new \ReflectionProperty($class, 'defaultDescription'); - - if ($class !== $r->class || null === static::$defaultDescription) { - return null; - } - - trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultDescription" for setting a command description is deprecated. Add the "%s" attribute to the "%s" class instead.', AsCommand::class, static::class); - - return static::$defaultDescription; + return null; } /** @@ -111,7 +77,7 @@ public static function getDefaultDescription(): ?string * * @throws LogicException When the command name is empty */ - public function __construct(string $name = null) + public function __construct(?string $name = null) { $this->definition = new InputDefinition(); @@ -142,16 +108,13 @@ public function __construct(string $name = null) * * This is mainly useful for the help command. */ - public function ignoreValidationErrors() + public function ignoreValidationErrors(): void { $this->ignoreValidationErrors = true; } - public function setApplication(Application $application = null) + public function setApplication(?Application $application): void { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } $this->application = $application; if ($application) { $this->setHelperSet($application->getHelperSet()); @@ -162,7 +125,7 @@ public function setApplication(Application $application = null) $this->fullDefinition = null; } - public function setHelperSet(HelperSet $helperSet) + public function setHelperSet(HelperSet $helperSet): void { $this->helperSet = $helperSet; } @@ -188,16 +151,16 @@ public function getApplication(): ?Application * * Override this to check for x or y and return false if the command cannot * run properly under the current conditions. - * - * @return bool */ - public function isEnabled() + public function isEnabled(): bool { return true; } /** * Configures the current command. + * + * @return void */ protected function configure() { @@ -217,7 +180,7 @@ protected function configure() * * @see setCode() */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { throw new LogicException('You must override the execute() method in the concrete command class.'); } @@ -228,6 +191,8 @@ protected function execute(InputInterface $input, OutputInterface $output) * This method is executed before the InputDefinition is validated. * This means that this is the only place where the command can * interactively ask for values of missing required arguments. + * + * @return void */ protected function interact(InputInterface $input, OutputInterface $output) { @@ -242,6 +207,8 @@ protected function interact(InputInterface $input, OutputInterface $output) * * @see InputInterface::bind() * @see InputInterface::validate() + * + * @return void */ protected function initialize(InputInterface $input, OutputInterface $output) { @@ -310,17 +277,13 @@ public function run(InputInterface $input, OutputInterface $output): int $statusCode = ($this->code)($input, $output); } else { $statusCode = $this->execute($input, $output); - - if (!\is_int($statusCode)) { - throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, "%s" returned.', static::class, get_debug_type($statusCode))); - } } return is_numeric($statusCode) ? (int) $statusCode : 0; } /** - * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). + * Supplies suggestions when resolving possible completion options for input (e.g. option or argument). */ public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void { @@ -378,7 +341,7 @@ public function setCode(callable $code): static * * @internal */ - public function mergeApplicationDefinition(bool $mergeArgs = true) + public function mergeApplicationDefinition(bool $mergeArgs = true): void { if (null === $this->application) { return; @@ -432,26 +395,22 @@ public function getDefinition(): InputDefinition */ public function getNativeDefinition(): InputDefinition { - return $this->definition ?? throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); + return $this->definition ?? throw new LogicException(\sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); } /** * Adds an argument. * - * @param $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL - * @param $default The default value (for InputArgument::OPTIONAL mode only) + * @param $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL + * @param $default The default value (for InputArgument::OPTIONAL mode only) * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @return $this * * @throws InvalidArgumentException When argument mode is not valid */ - public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = null */): static + public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static { - $suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : []; - if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) { - throw new \TypeError(sprintf('Argument 5 passed to "%s()" must be array or \Closure, "%s" given.', __METHOD__, get_debug_type($suggestedValues))); - } $this->definition->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues)); $this->fullDefinition?->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues)); @@ -461,21 +420,17 @@ public function addArgument(string $name, int $mode = null, string $description /** * Adds an option. * - * @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param $mode The option mode: One of the InputOption::VALUE_* constants - * @param $default The default value (must be null for InputOption::VALUE_NONE) + * @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param $mode The option mode: One of the InputOption::VALUE_* constants + * @param $default The default value (must be null for InputOption::VALUE_NONE) * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @return $this * * @throws InvalidArgumentException If option mode is invalid or incompatible */ - public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static + public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static { - $suggestedValues = 6 <= \func_num_args() ? func_get_arg(5) : []; - if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) { - throw new \TypeError(sprintf('Argument 5 passed to "%s()" must be array or \Closure, "%s" given.', __METHOD__, get_debug_type($suggestedValues))); - } $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues)); $this->fullDefinition?->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues)); @@ -648,7 +603,7 @@ public function getSynopsis(bool $short = false): string $key = $short ? 'short' : 'long'; if (!isset($this->synopsis[$key])) { - $this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short))); + $this->synopsis[$key] = trim(\sprintf('%s %s', $this->name, $this->definition->getSynopsis($short))); } return $this->synopsis[$key]; @@ -662,7 +617,7 @@ public function getSynopsis(bool $short = false): string public function addUsage(string $usage): static { if (!str_starts_with($usage, $this->name)) { - $usage = sprintf('%s %s', $this->name, $usage); + $usage = \sprintf('%s %s', $this->name, $usage); } $this->usages[] = $usage; @@ -681,15 +636,13 @@ public function getUsages(): array /** * Gets a helper instance by name. * - * @return HelperInterface - * * @throws LogicException if no HelperSet is defined * @throws InvalidArgumentException if the helper is not defined */ - public function getHelper(string $name): mixed + public function getHelper(string $name): HelperInterface { if (null === $this->helperSet) { - throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); + throw new LogicException(\sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); } return $this->helperSet->get($name); @@ -702,10 +655,10 @@ public function getHelper(string $name): mixed * * @throws InvalidArgumentException When the name is invalid */ - private function validateName(string $name) + private function validateName(string $name): void { if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { - throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); + throw new InvalidArgumentException(\sprintf('Command name "%s" is invalid.', $name)); } } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/CompleteCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/CompleteCommand.php index e65b334c..15eeea16 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/CompleteCommand.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Command/CompleteCommand.php @@ -34,19 +34,8 @@ final class CompleteCommand extends Command { public const COMPLETION_API_VERSION = '1'; - /** - * @deprecated since Symfony 6.1 - */ - protected static $defaultName = '|_complete'; - - /** - * @deprecated since Symfony 6.1 - */ - protected static $defaultDescription = 'Internal command to provide shell completion suggestions'; - - private $completionOutputs; - - private $isDebug = false; + private array $completionOutputs; + private bool $isDebug = false; /** * @param array> $completionOutputs A list of additional completion outputs, with shell name as key and FQCN as value @@ -74,7 +63,7 @@ protected function configure(): void ; } - protected function initialize(InputInterface $input, OutputInterface $output) + protected function initialize(InputInterface $input, OutputInterface $output): void { $this->isDebug = filter_var(getenv('SYMFONY_COMPLETION_DEBUG'), \FILTER_VALIDATE_BOOL); } @@ -85,7 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int // "symfony" must be kept for compat with the shell scripts generated by Symfony Console 5.4 - 6.1 $version = $input->getOption('symfony') ? '1' : $input->getOption('api-version'); if ($version && version_compare($version, self::COMPLETION_API_VERSION, '<')) { - $message = sprintf('Completion script version is not supported ("%s" given, ">=%s" required).', $version, self::COMPLETION_API_VERSION); + $message = \sprintf('Completion script version is not supported ("%s" given, ">=%s" required).', $version, self::COMPLETION_API_VERSION); $this->log($message); $output->writeln($message.' Install the Symfony completion script again by using the "completion" command.'); @@ -99,7 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } if (!$completionOutput = $this->completionOutputs[$shell] ?? false) { - throw new \RuntimeException(sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs)))); + throw new \RuntimeException(\sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs)))); } $completionInput = $this->createCompletionInput($input); @@ -109,13 +98,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int '', ''.date('Y-m-d H:i:s').'', 'Input: ("|" indicates the cursor position)', - ' '.(string) $completionInput, + ' '.$completionInput, 'Command:', - ' '.(string) implode(' ', $_SERVER['argv']), + ' '.implode(' ', $_SERVER['argv']), 'Messages:', ]); - $command = $this->findCommand($completionInput, $output); + $command = $this->findCommand($completionInput); if (null === $command) { $this->log(' No command found, completing using the Application class.'); @@ -134,12 +123,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int $completionInput->bind($command->getDefinition()); if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) { - $this->log(' Completing option names for the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' command.'); + $this->log(' Completing option names for the '.($command instanceof LazyCommand ? $command->getCommand() : $command)::class.' command.'); $suggestions->suggestOptions($command->getDefinition()->getOptions()); } else { $this->log([ - ' Completing using the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' class.', + ' Completing using the '.($command instanceof LazyCommand ? $command->getCommand() : $command)::class.' class.', ' Completing '.$completionInput->getCompletionType().' for '.$completionInput->getCompletionName().'', ]); if (null !== $compval = $completionInput->getCompletionValue()) { @@ -155,7 +144,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->log('Suggestions:'); if ($options = $suggestions->getOptionSuggestions()) { - $this->log(' --'.implode(' --', array_map(function ($o) { return $o->getName(); }, $options))); + $this->log(' --'.implode(' --', array_map(fn ($o) => $o->getName(), $options))); } elseif ($values = $suggestions->getValueSuggestions()) { $this->log(' '.implode(' ', $values)); } else { @@ -173,10 +162,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int throw $e; } - return self::FAILURE; + return 2; } - return self::SUCCESS; + return 0; } private function createCompletionInput(InputInterface $input): CompletionInput @@ -196,7 +185,7 @@ private function createCompletionInput(InputInterface $input): CompletionInput return $completionInput; } - private function findCommand(CompletionInput $completionInput, OutputInterface $output): ?Command + private function findCommand(CompletionInput $completionInput): ?Command { try { $inputName = $completionInput->getFirstArgument(); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/DumpCompletionCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/DumpCompletionCommand.php index 10280f73..2853fc5f 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/DumpCompletionCommand.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Command/DumpCompletionCommand.php @@ -27,25 +27,15 @@ #[AsCommand(name: 'completion', description: 'Dump the shell completion script')] final class DumpCompletionCommand extends Command { - /** - * @deprecated since Symfony 6.1 - */ - protected static $defaultName = 'completion'; - - /** - * @deprecated since Symfony 6.1 - */ - protected static $defaultDescription = 'Dump the shell completion script'; - private array $supportedShells; - protected function configure() + protected function configure(): void { $fullCommand = $_SERVER['PHP_SELF']; $commandName = basename($fullCommand); $fullCommand = @realpath($fullCommand) ?: $fullCommand; - $shell = $this->guessShell(); + $shell = self::guessShell(); [$rcFile, $completionFile] = match ($shell) { 'fish' => ['~/.config/fish/config.fish', "/etc/fish/completions/$commandName.fish"], 'zsh' => ['~/.zshrc', '$fpath[1]/_'.$commandName], @@ -96,7 +86,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($input->getOption('debug')) { $this->tailDebugLog($commandName, $output); - return self::SUCCESS; + return 0; } $shell = $input->getArgument('shell') ?? self::guessShell(); @@ -108,17 +98,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output = $output->getErrorOutput(); } if ($shell) { - $output->writeln(sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); + $output->writeln(\sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); } else { - $output->writeln(sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); + $output->writeln(\sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); } - return self::INVALID; + return 2; } $output->write(str_replace(['{{ COMMAND_NAME }}', '{{ VERSION }}'], [$commandName, CompleteCommand::COMPLETION_API_VERSION], file_get_contents($completionFile))); - return self::SUCCESS; + return 0; } private static function guessShell(): string diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/HelpCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/HelpCommand.php index d4134e17..a2a72dab 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/HelpCommand.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Command/HelpCommand.php @@ -27,19 +27,15 @@ class HelpCommand extends Command { private Command $command; - protected function configure() + protected function configure(): void { $this->ignoreValidationErrors(); $this ->setName('help') ->setDefinition([ - new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help', function () { - return array_keys((new ApplicationDescription($this->getApplication()))->getCommands()); - }), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', function () { - return (new DescriptorHelper())->getFormats(); - }), + new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help', fn () => array_keys((new ApplicationDescription($this->getApplication()))->getCommands())), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', fn () => (new DescriptorHelper())->getFormats()), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), ]) ->setDescription('Display help for a command') @@ -58,7 +54,7 @@ protected function configure() ; } - public function setCommand(Command $command) + public function setCommand(Command $command): void { $this->command = $command; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/LazyCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/LazyCommand.php index d5605822..fd2c300d 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/LazyCommand.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Command/LazyCommand.php @@ -27,17 +27,21 @@ final class LazyCommand extends Command { private \Closure|Command $command; - private ?bool $isEnabled; - public function __construct(string $name, array $aliases, string $description, bool $isHidden, \Closure $commandFactory, ?bool $isEnabled = true) - { + public function __construct( + string $name, + array $aliases, + string $description, + bool $isHidden, + \Closure $commandFactory, + private ?bool $isEnabled = true, + ) { $this->setName($name) ->setAliases($aliases) ->setHidden($isHidden) ->setDescription($description); $this->command = $commandFactory; - $this->isEnabled = $isEnabled; } public function ignoreValidationErrors(): void @@ -45,11 +49,8 @@ public function ignoreValidationErrors(): void $this->getCommand()->ignoreValidationErrors(); } - public function setApplication(Application $application = null): void + public function setApplication(?Application $application): void { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } if ($this->command instanceof parent) { $this->command->setApplication($application); } @@ -116,9 +117,8 @@ public function getNativeDefinition(): InputDefinition /** * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion */ - public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static + public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static { - $suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : []; $this->getCommand()->addArgument($name, $mode, $description, $default, $suggestedValues); return $this; @@ -127,9 +127,8 @@ public function addArgument(string $name, int $mode = null, string $description /** * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion */ - public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static + public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static { - $suggestedValues = 6 <= \func_num_args() ? func_get_arg(5) : []; $this->getCommand()->addOption($name, $shortcut, $mode, $description, $default, $suggestedValues); return $this; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/ListCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/ListCommand.php index cab88b43..61b4b1b3 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/ListCommand.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Command/ListCommand.php @@ -25,18 +25,14 @@ */ class ListCommand extends Command { - protected function configure() + protected function configure(): void { $this ->setName('list') ->setDefinition([ - new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name', null, function () { - return array_keys((new ApplicationDescription($this->getApplication()))->getNamespaces()); - }), + new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name', null, fn () => array_keys((new ApplicationDescription($this->getApplication()))->getNamespaces())), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', function () { - return (new DescriptorHelper())->getFormats(); - }), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', fn () => (new DescriptorHelper())->getFormats()), new InputOption('short', null, InputOption::VALUE_NONE, 'To skip describing commands\' arguments'), ]) ->setDescription('List commands') diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/LockableTrait.php b/tools/php-cs-fixer/vendor/symfony/console/Command/LockableTrait.php index 67923a9e..f0001cc5 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/LockableTrait.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Command/LockableTrait.php @@ -26,26 +26,32 @@ trait LockableTrait { private ?LockInterface $lock = null; + private ?LockFactory $lockFactory = null; + /** * Locks a command. */ - private function lock(string $name = null, bool $blocking = false): bool + private function lock(?string $name = null, bool $blocking = false): bool { if (!class_exists(SemaphoreStore::class)) { - throw new LogicException('To enable the locking feature you must install the symfony/lock component.'); + throw new LogicException('To enable the locking feature you must install the symfony/lock component. Try running "composer require symfony/lock".'); } if (null !== $this->lock) { throw new LogicException('A lock is already in place.'); } - if (SemaphoreStore::isSupported()) { - $store = new SemaphoreStore(); - } else { - $store = new FlockStore(); + if (null === $this->lockFactory) { + if (SemaphoreStore::isSupported()) { + $store = new SemaphoreStore(); + } else { + $store = new FlockStore(); + } + + $this->lockFactory = (new LockFactory($store)); } - $this->lock = (new LockFactory($store))->createLock($name ?: $this->getName()); + $this->lock = $this->lockFactory->createLock($name ?: $this->getName()); if (!$this->lock->acquire($blocking)) { $this->lock = null; @@ -58,7 +64,7 @@ private function lock(string $name = null, bool $blocking = false): bool /** * Releases the command lock if there is one. */ - private function release() + private function release(): void { if ($this->lock) { $this->lock->release(); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/SignalableCommandInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Command/SignalableCommandInterface.php index d439728b..40b301d1 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/SignalableCommandInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Command/SignalableCommandInterface.php @@ -25,6 +25,8 @@ public function getSubscribedSignals(): array; /** * The method will be called when the application is signaled. + * + * @return int|false The exit code to return or false to continue the normal execution */ - public function handleSignal(int $signal): void; + public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/TraceableCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/TraceableCommand.php new file mode 100644 index 00000000..9ffb68da --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/console/Command/TraceableCommand.php @@ -0,0 +1,356 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Helper\HelperInterface; +use Symfony\Component\Console\Helper\HelperSet; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Stopwatch\Stopwatch; + +/** + * @internal + * + * @author Jules Pietri + */ +final class TraceableCommand extends Command implements SignalableCommandInterface +{ + public readonly Command $command; + public int $exitCode; + public ?int $interruptedBySignal = null; + public bool $ignoreValidation; + public bool $isInteractive = false; + public string $duration = 'n/a'; + public string $maxMemoryUsage = 'n/a'; + public InputInterface $input; + public OutputInterface $output; + /** @var array */ + public array $arguments; + /** @var array */ + public array $options; + /** @var array */ + public array $interactiveInputs = []; + public array $handledSignals = []; + + public function __construct( + Command $command, + private readonly Stopwatch $stopwatch, + ) { + if ($command instanceof LazyCommand) { + $command = $command->getCommand(); + } + + $this->command = $command; + + // prevent call to self::getDefaultDescription() + $this->setDescription($command->getDescription()); + + parent::__construct($command->getName()); + + // init below enables calling {@see parent::run()} + [$code, $processTitle, $ignoreValidationErrors] = \Closure::bind(function () { + return [$this->code, $this->processTitle, $this->ignoreValidationErrors]; + }, $command, Command::class)(); + + if (\is_callable($code)) { + $this->setCode($code); + } + + if ($processTitle) { + parent::setProcessTitle($processTitle); + } + + if ($ignoreValidationErrors) { + parent::ignoreValidationErrors(); + } + + $this->ignoreValidation = $ignoreValidationErrors; + } + + public function __call(string $name, array $arguments): mixed + { + return $this->command->{$name}(...$arguments); + } + + public function getSubscribedSignals(): array + { + return $this->command instanceof SignalableCommandInterface ? $this->command->getSubscribedSignals() : []; + } + + public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false + { + if (!$this->command instanceof SignalableCommandInterface) { + return false; + } + + $event = $this->stopwatch->start($this->getName().'.handle_signal'); + + $exit = $this->command->handleSignal($signal, $previousExitCode); + + $event->stop(); + + if (!isset($this->handledSignals[$signal])) { + $this->handledSignals[$signal] = [ + 'handled' => 0, + 'duration' => 0, + 'memory' => 0, + ]; + } + + ++$this->handledSignals[$signal]['handled']; + $this->handledSignals[$signal]['duration'] += $event->getDuration(); + $this->handledSignals[$signal]['memory'] = max( + $this->handledSignals[$signal]['memory'], + $event->getMemory() >> 20 + ); + + return $exit; + } + + /** + * {@inheritdoc} + * + * Calling parent method is required to be used in {@see parent::run()}. + */ + public function ignoreValidationErrors(): void + { + $this->ignoreValidation = true; + $this->command->ignoreValidationErrors(); + + parent::ignoreValidationErrors(); + } + + public function setApplication(?Application $application = null): void + { + $this->command->setApplication($application); + } + + public function getApplication(): ?Application + { + return $this->command->getApplication(); + } + + public function setHelperSet(HelperSet $helperSet): void + { + $this->command->setHelperSet($helperSet); + } + + public function getHelperSet(): ?HelperSet + { + return $this->command->getHelperSet(); + } + + public function isEnabled(): bool + { + return $this->command->isEnabled(); + } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + $this->command->complete($input, $suggestions); + } + + /** + * {@inheritdoc} + * + * Calling parent method is required to be used in {@see parent::run()}. + */ + public function setCode(callable $code): static + { + $this->command->setCode($code); + + return parent::setCode(function (InputInterface $input, OutputInterface $output) use ($code): int { + $event = $this->stopwatch->start($this->getName().'.code'); + + $this->exitCode = $code($input, $output); + + $event->stop(); + + return $this->exitCode; + }); + } + + /** + * @internal + */ + public function mergeApplicationDefinition(bool $mergeArgs = true): void + { + $this->command->mergeApplicationDefinition($mergeArgs); + } + + public function setDefinition(array|InputDefinition $definition): static + { + $this->command->setDefinition($definition); + + return $this; + } + + public function getDefinition(): InputDefinition + { + return $this->command->getDefinition(); + } + + public function getNativeDefinition(): InputDefinition + { + return $this->command->getNativeDefinition(); + } + + public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static + { + $this->command->addArgument($name, $mode, $description, $default, $suggestedValues); + + return $this; + } + + public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static + { + $this->command->addOption($name, $shortcut, $mode, $description, $default, $suggestedValues); + + return $this; + } + + /** + * {@inheritdoc} + * + * Calling parent method is required to be used in {@see parent::run()}. + */ + public function setProcessTitle(string $title): static + { + $this->command->setProcessTitle($title); + + return parent::setProcessTitle($title); + } + + public function setHelp(string $help): static + { + $this->command->setHelp($help); + + return $this; + } + + public function getHelp(): string + { + return $this->command->getHelp(); + } + + public function getProcessedHelp(): string + { + return $this->command->getProcessedHelp(); + } + + public function getSynopsis(bool $short = false): string + { + return $this->command->getSynopsis($short); + } + + public function addUsage(string $usage): static + { + $this->command->addUsage($usage); + + return $this; + } + + public function getUsages(): array + { + return $this->command->getUsages(); + } + + public function getHelper(string $name): HelperInterface + { + return $this->command->getHelper($name); + } + + public function run(InputInterface $input, OutputInterface $output): int + { + $this->input = $input; + $this->output = $output; + $this->arguments = $input->getArguments(); + $this->options = $input->getOptions(); + $event = $this->stopwatch->start($this->getName(), 'command'); + + try { + $this->exitCode = parent::run($input, $output); + } finally { + $event->stop(); + + if ($output instanceof ConsoleOutputInterface && $output->isDebug()) { + $output->getErrorOutput()->writeln((string) $event); + } + + $this->duration = $event->getDuration().' ms'; + $this->maxMemoryUsage = ($event->getMemory() >> 20).' MiB'; + + if ($this->isInteractive) { + $this->extractInteractiveInputs($input->getArguments(), $input->getOptions()); + } + } + + return $this->exitCode; + } + + protected function initialize(InputInterface $input, OutputInterface $output): void + { + $event = $this->stopwatch->start($this->getName().'.init', 'command'); + + $this->command->initialize($input, $output); + + $event->stop(); + } + + protected function interact(InputInterface $input, OutputInterface $output): void + { + if (!$this->isInteractive = Command::class !== (new \ReflectionMethod($this->command, 'interact'))->getDeclaringClass()->getName()) { + return; + } + + $event = $this->stopwatch->start($this->getName().'.interact', 'command'); + + $this->command->interact($input, $output); + + $event->stop(); + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $event = $this->stopwatch->start($this->getName().'.execute', 'command'); + + $exitCode = $this->command->execute($input, $output); + + $event->stop(); + + return $exitCode; + } + + private function extractInteractiveInputs(array $arguments, array $options): void + { + foreach ($arguments as $argName => $argValue) { + if (\array_key_exists($argName, $this->arguments) && $this->arguments[$argName] === $argValue) { + continue; + } + + $this->interactiveInputs[$argName] = $argValue; + } + + foreach ($options as $optName => $optValue) { + if (\array_key_exists($optName, $this->options) && $this->options[$optName] === $optValue) { + continue; + } + + $this->interactiveInputs['--'.$optName] = $optValue; + } + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php index bfa0ac46..eb494513 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php +++ b/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php @@ -22,22 +22,19 @@ */ class ContainerCommandLoader implements CommandLoaderInterface { - private ContainerInterface $container; - private array $commandMap; - /** * @param array $commandMap An array with command names as keys and service ids as values */ - public function __construct(ContainerInterface $container, array $commandMap) - { - $this->container = $container; - $this->commandMap = $commandMap; + public function __construct( + private ContainerInterface $container, + private array $commandMap, + ) { } public function get(string $name): Command { if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); + throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name)); } return $this->container->get($this->commandMap[$name]); diff --git a/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php index 9ced75ae..2d13139c 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php +++ b/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php @@ -21,14 +21,12 @@ */ class FactoryCommandLoader implements CommandLoaderInterface { - private array $factories; - /** * @param callable[] $factories Indexed by command names */ - public function __construct(array $factories) - { - $this->factories = $factories; + public function __construct( + private array $factories, + ) { } public function has(string $name): bool @@ -39,7 +37,7 @@ public function has(string $name): bool public function get(string $name): Command { if (!isset($this->factories[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); + throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name)); } $factory = $this->factories[$name]; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionInput.php b/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionInput.php index 3ef8db5d..9f9619e1 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionInput.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionInput.php @@ -31,11 +31,11 @@ final class CompletionInput extends ArgvInput public const TYPE_OPTION_NAME = 'option_name'; public const TYPE_NONE = 'none'; - private $tokens; - private $currentIndex; - private $completionType; - private $completionName = null; - private $completionValue = ''; + private array $tokens; + private int $currentIndex; + private string $completionType; + private ?string $completionName = null; + private string $completionValue = ''; /** * Converts a terminal string into tokens. @@ -53,7 +53,7 @@ public static function fromString(string $inputStr, int $currentIndex): self * Create an input based on an COMP_WORDS token list. * * @param string[] $tokens the set of split tokens (e.g. COMP_WORDS or argv) - * @param $currentIndex the index of the cursor (e.g. COMP_CWORD) + * @param int $currentIndex the index of the cursor (e.g. COMP_CWORD) */ public static function fromTokens(array $tokens, int $currentIndex): self { @@ -123,13 +123,13 @@ public function bind(InputDefinition $definition): void if ($this->currentIndex >= \count($this->tokens)) { if (!isset($this->arguments[$argumentName]) || $this->definition->getArgument($argumentName)->isArray()) { $this->completionName = $argumentName; - $this->completionValue = ''; } else { // we've reached the end $this->completionType = self::TYPE_NONE; $this->completionName = null; - $this->completionValue = ''; } + + $this->completionValue = ''; } } @@ -141,7 +141,9 @@ public function bind(InputDefinition $definition): void * TYPE_OPTION_NAME when completing the name of an input option * TYPE_NONE when nothing should be completed * - * @return string One of self::TYPE_* constants. TYPE_OPTION_NAME and TYPE_NONE are already implemented by the Console component + * TYPE_OPTION_NAME and TYPE_NONE are already implemented by the Console component. + * + * @return self::TYPE_* */ public function getCompletionType(): string { @@ -224,7 +226,7 @@ private function isCursorFree(): bool return $this->currentIndex >= $nrOfTokens; } - public function __toString() + public function __toString(): string { $str = ''; foreach ($this->tokens as $i => $token) { diff --git a/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionSuggestions.php b/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionSuggestions.php index 71911817..549bbafb 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionSuggestions.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionSuggestions.php @@ -20,8 +20,8 @@ */ final class CompletionSuggestions { - private $valueSuggestions = []; - private $optionSuggestions = []; + private array $valueSuggestions = []; + private array $optionSuggestions = []; /** * Add a suggested value for an input option or argument. diff --git a/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/FishCompletionOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/FishCompletionOutput.php index d2c414e4..356a974e 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/FishCompletionOutput.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/FishCompletionOutput.php @@ -21,11 +21,14 @@ class FishCompletionOutput implements CompletionOutputInterface { public function write(CompletionSuggestions $suggestions, OutputInterface $output): void { - $values = $suggestions->getValueSuggestions(); + $values = []; + foreach ($suggestions->getValueSuggestions() as $value) { + $values[] = $value->getValue().($value->getDescription() ? "\t".$value->getDescription() : ''); + } foreach ($suggestions->getOptionSuggestions() as $option) { - $values[] = '--'.$option->getName(); + $values[] = '--'.$option->getName().($option->getDescription() ? "\t".$option->getDescription() : ''); if ($option->isNegatable()) { - $values[] = '--no-'.$option->getName(); + $values[] = '--no-'.$option->getName().($option->getDescription() ? "\t".$option->getDescription() : ''); } } $output->write(implode("\n", $values)); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Completion/Suggestion.php b/tools/php-cs-fixer/vendor/symfony/console/Completion/Suggestion.php index 7392965a..3251b079 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Completion/Suggestion.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Completion/Suggestion.php @@ -20,7 +20,7 @@ class Suggestion implements \Stringable { public function __construct( private readonly string $value, - private readonly string $description = '' + private readonly string $description = '', ) { } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Cursor.php b/tools/php-cs-fixer/vendor/symfony/console/Cursor.php index b7f5a17e..e2618cf1 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Cursor.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Cursor.php @@ -18,15 +18,16 @@ */ final class Cursor { - private OutputInterface $output; + /** @var resource */ private $input; /** * @param resource|null $input */ - public function __construct(OutputInterface $output, $input = null) - { - $this->output = $output; + public function __construct( + private OutputInterface $output, + $input = null, + ) { $this->input = $input ?? (\defined('STDIN') ? \STDIN : fopen('php://input', 'r+')); } @@ -35,7 +36,7 @@ public function __construct(OutputInterface $output, $input = null) */ public function moveUp(int $lines = 1): static { - $this->output->write(sprintf("\x1b[%dA", $lines)); + $this->output->write(\sprintf("\x1b[%dA", $lines)); return $this; } @@ -45,7 +46,7 @@ public function moveUp(int $lines = 1): static */ public function moveDown(int $lines = 1): static { - $this->output->write(sprintf("\x1b[%dB", $lines)); + $this->output->write(\sprintf("\x1b[%dB", $lines)); return $this; } @@ -55,7 +56,7 @@ public function moveDown(int $lines = 1): static */ public function moveRight(int $columns = 1): static { - $this->output->write(sprintf("\x1b[%dC", $columns)); + $this->output->write(\sprintf("\x1b[%dC", $columns)); return $this; } @@ -65,7 +66,7 @@ public function moveRight(int $columns = 1): static */ public function moveLeft(int $columns = 1): static { - $this->output->write(sprintf("\x1b[%dD", $columns)); + $this->output->write(\sprintf("\x1b[%dD", $columns)); return $this; } @@ -75,7 +76,7 @@ public function moveLeft(int $columns = 1): static */ public function moveToColumn(int $column): static { - $this->output->write(sprintf("\x1b[%dG", $column)); + $this->output->write(\sprintf("\x1b[%dG", $column)); return $this; } @@ -85,7 +86,7 @@ public function moveToColumn(int $column): static */ public function moveToPosition(int $column, int $row): static { - $this->output->write(sprintf("\x1b[%d;%dH", $row + 1, $column)); + $this->output->write(\sprintf("\x1b[%d;%dH", $row + 1, $column)); return $this; } @@ -194,7 +195,7 @@ public function getCurrentPosition(): array $code = trim(fread($this->input, 1024)); - shell_exec(sprintf('stty %s', $sttyMode)); + shell_exec(\sprintf('stty %s', $sttyMode)); sscanf($code, "\033[%d;%dR", $row, $col); diff --git a/tools/php-cs-fixer/vendor/symfony/console/DataCollector/CommandDataCollector.php b/tools/php-cs-fixer/vendor/symfony/console/DataCollector/CommandDataCollector.php new file mode 100644 index 00000000..3cbe72b5 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/console/DataCollector/CommandDataCollector.php @@ -0,0 +1,234 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\DataCollector; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Debug\CliRequest; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\SignalRegistry\SignalMap; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\DataCollector\DataCollector; +use Symfony\Component\VarDumper\Cloner\Data; + +/** + * @internal + * + * @author Jules Pietri + */ +final class CommandDataCollector extends DataCollector +{ + public function collect(Request $request, Response $response, ?\Throwable $exception = null): void + { + if (!$request instanceof CliRequest) { + return; + } + + $command = $request->command; + $application = $command->getApplication(); + + $this->data = [ + 'command' => $this->cloneVar($command->command), + 'exit_code' => $command->exitCode, + 'interrupted_by_signal' => $command->interruptedBySignal, + 'duration' => $command->duration, + 'max_memory_usage' => $command->maxMemoryUsage, + 'verbosity_level' => match ($command->output->getVerbosity()) { + OutputInterface::VERBOSITY_QUIET => 'quiet', + OutputInterface::VERBOSITY_NORMAL => 'normal', + OutputInterface::VERBOSITY_VERBOSE => 'verbose', + OutputInterface::VERBOSITY_VERY_VERBOSE => 'very verbose', + OutputInterface::VERBOSITY_DEBUG => 'debug', + }, + 'interactive' => $command->isInteractive, + 'validate_input' => !$command->ignoreValidation, + 'enabled' => $command->isEnabled(), + 'visible' => !$command->isHidden(), + 'input' => $this->cloneVar($command->input), + 'output' => $this->cloneVar($command->output), + 'interactive_inputs' => array_map($this->cloneVar(...), $command->interactiveInputs), + 'signalable' => $command->getSubscribedSignals(), + 'handled_signals' => $command->handledSignals, + 'helper_set' => array_map($this->cloneVar(...), iterator_to_array($command->getHelperSet())), + ]; + + $baseDefinition = $application->getDefinition(); + + foreach ($command->arguments as $argName => $argValue) { + if ($baseDefinition->hasArgument($argName)) { + $this->data['application_inputs'][$argName] = $this->cloneVar($argValue); + } else { + $this->data['arguments'][$argName] = $this->cloneVar($argValue); + } + } + + foreach ($command->options as $optName => $optValue) { + if ($baseDefinition->hasOption($optName)) { + $this->data['application_inputs']['--'.$optName] = $this->cloneVar($optValue); + } else { + $this->data['options'][$optName] = $this->cloneVar($optValue); + } + } + } + + public function getName(): string + { + return 'command'; + } + + /** + * @return array{ + * class?: class-string, + * executor?: string, + * file: string, + * line: int, + * } + */ + public function getCommand(): array + { + $class = $this->data['command']->getType(); + $r = new \ReflectionMethod($class, 'execute'); + + if (Command::class !== $r->getDeclaringClass()) { + return [ + 'executor' => $class.'::'.$r->name, + 'file' => $r->getFileName(), + 'line' => $r->getStartLine(), + ]; + } + + $r = new \ReflectionClass($class); + + return [ + 'class' => $class, + 'file' => $r->getFileName(), + 'line' => $r->getStartLine(), + ]; + } + + public function getInterruptedBySignal(): ?string + { + if (isset($this->data['interrupted_by_signal'])) { + return \sprintf('%s (%d)', SignalMap::getSignalName($this->data['interrupted_by_signal']), $this->data['interrupted_by_signal']); + } + + return null; + } + + public function getDuration(): string + { + return $this->data['duration']; + } + + public function getMaxMemoryUsage(): string + { + return $this->data['max_memory_usage']; + } + + public function getVerbosityLevel(): string + { + return $this->data['verbosity_level']; + } + + public function getInteractive(): bool + { + return $this->data['interactive']; + } + + public function getValidateInput(): bool + { + return $this->data['validate_input']; + } + + public function getEnabled(): bool + { + return $this->data['enabled']; + } + + public function getVisible(): bool + { + return $this->data['visible']; + } + + public function getInput(): Data + { + return $this->data['input']; + } + + public function getOutput(): Data + { + return $this->data['output']; + } + + /** + * @return Data[] + */ + public function getArguments(): array + { + return $this->data['arguments'] ?? []; + } + + /** + * @return Data[] + */ + public function getOptions(): array + { + return $this->data['options'] ?? []; + } + + /** + * @return Data[] + */ + public function getApplicationInputs(): array + { + return $this->data['application_inputs'] ?? []; + } + + /** + * @return Data[] + */ + public function getInteractiveInputs(): array + { + return $this->data['interactive_inputs'] ?? []; + } + + public function getSignalable(): array + { + return array_map( + static fn (int $signal): string => \sprintf('%s (%d)', SignalMap::getSignalName($signal), $signal), + $this->data['signalable'] + ); + } + + public function getHandledSignals(): array + { + $keys = array_map( + static fn (int $signal): string => \sprintf('%s (%d)', SignalMap::getSignalName($signal), $signal), + array_keys($this->data['handled_signals']) + ); + + return array_combine($keys, array_values($this->data['handled_signals'])); + } + + /** + * @return Data[] + */ + public function getHelperSet(): array + { + return $this->data['helper_set'] ?? []; + } + + public function reset(): void + { + $this->data = []; + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Debug/CliRequest.php b/tools/php-cs-fixer/vendor/symfony/console/Debug/CliRequest.php new file mode 100644 index 00000000..b023db07 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/console/Debug/CliRequest.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Debug; + +use Symfony\Component\Console\Command\TraceableCommand; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * @internal + */ +final class CliRequest extends Request +{ + public function __construct( + public readonly TraceableCommand $command, + ) { + parent::__construct( + attributes: ['_controller' => \get_class($command->command), '_virtual_type' => 'command'], + server: $_SERVER, + ); + } + + // Methods below allow to populate a profile, thus enable search and filtering + public function getUri(): string + { + if ($this->server->has('SYMFONY_CLI_BINARY_NAME')) { + $binary = $this->server->get('SYMFONY_CLI_BINARY_NAME').' console'; + } else { + $binary = $this->server->get('argv')[0]; + } + + return $binary.' '.$this->command->input; + } + + public function getMethod(): string + { + return $this->command->isInteractive ? 'INTERACTIVE' : 'BATCH'; + } + + public function getResponse(): Response + { + return new class($this->command->exitCode) extends Response { + public function __construct(private readonly int $exitCode) + { + parent::__construct(); + } + + public function getStatusCode(): int + { + return $this->exitCode; + } + }; + } + + public function getClientIp(): string + { + $application = $this->command->getApplication(); + + return $application->getName().' '.$application->getVersion(); + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/tools/php-cs-fixer/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php index 62c80c3b..f1521602 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ b/tools/php-cs-fixer/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php @@ -29,7 +29,7 @@ */ class AddConsoleCommandPass implements CompilerPassInterface { - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $commandServices = $container->findTaggedServiceIds('console.command', true); $lazyCommandMap = []; @@ -45,15 +45,15 @@ public function process(ContainerBuilder $container) $aliases = $tags[0]['command']; } else { if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); + throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); } if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); + throw new InvalidArgumentException(\sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); } $aliases = str_replace('%', '%%', $class::getDefaultName() ?? ''); } - $aliases = explode('|', $aliases ?? ''); + $aliases = explode('|', $aliases); $commandName = array_shift($aliases); if ($isHidden = '' === $commandName) { @@ -102,10 +102,10 @@ public function process(ContainerBuilder $container) if (!$description) { if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); + throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); } if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); + throw new InvalidArgumentException(\sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); } $description = str_replace('%', '%%', $class::getDefaultDescription() ?? ''); } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ApplicationDescription.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ApplicationDescription.php index 2158339e..802d6856 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ApplicationDescription.php @@ -24,9 +24,6 @@ class ApplicationDescription { public const GLOBAL_NAMESPACE = '_global'; - private Application $application; - private ?string $namespace; - private bool $showHidden; private array $namespaces; /** @@ -39,11 +36,11 @@ class ApplicationDescription */ private array $aliases = []; - public function __construct(Application $application, string $namespace = null, bool $showHidden = false) - { - $this->application = $application; - $this->namespace = $namespace; - $this->showHidden = $showHidden; + public function __construct( + private Application $application, + private ?string $namespace = null, + private bool $showHidden = false, + ) { } public function getNamespaces(): array @@ -73,13 +70,13 @@ public function getCommands(): array public function getCommand(string $name): Command { if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); + throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name)); } return $this->commands[$name] ?? $this->aliases[$name]; } - private function inspectApplication() + private function inspectApplication(): void { $this->commands = []; $this->namespaces = []; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/Descriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/Descriptor.php index 1476f575..2143a17c 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/Descriptor.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/Descriptor.php @@ -26,12 +26,9 @@ */ abstract class Descriptor implements DescriptorInterface { - /** - * @var OutputInterface - */ - protected $output; + protected OutputInterface $output; - public function describe(OutputInterface $output, object $object, array $options = []) + public function describe(OutputInterface $output, object $object, array $options = []): void { $this->output = $output; @@ -41,14 +38,11 @@ public function describe(OutputInterface $output, object $object, array $options $object instanceof InputDefinition => $this->describeInputDefinition($object, $options), $object instanceof Command => $this->describeCommand($object, $options), $object instanceof Application => $this->describeApplication($object, $options), - default => throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))), + default => throw new InvalidArgumentException(\sprintf('Object of type "%s" is not describable.', get_debug_type($object))), }; } - /** - * Writes content to output. - */ - protected function write(string $content, bool $decorated = false) + protected function write(string $content, bool $decorated = false): void { $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW); } @@ -56,25 +50,25 @@ protected function write(string $content, bool $decorated = false) /** * Describes an InputArgument instance. */ - abstract protected function describeInputArgument(InputArgument $argument, array $options = []); + abstract protected function describeInputArgument(InputArgument $argument, array $options = []): void; /** * Describes an InputOption instance. */ - abstract protected function describeInputOption(InputOption $option, array $options = []); + abstract protected function describeInputOption(InputOption $option, array $options = []): void; /** * Describes an InputDefinition instance. */ - abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []); + abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []): void; /** * Describes a Command instance. */ - abstract protected function describeCommand(Command $command, array $options = []); + abstract protected function describeCommand(Command $command, array $options = []): void; /** * Describes an Application instance. */ - abstract protected function describeApplication(Application $application, array $options = []); + abstract protected function describeApplication(Application $application, array $options = []): void; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/DescriptorInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/DescriptorInterface.php index ebea3036..04e5a7c8 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/DescriptorInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/DescriptorInterface.php @@ -20,5 +20,5 @@ */ interface DescriptorInterface { - public function describe(OutputInterface $output, object $object, array $options = []); + public function describe(OutputInterface $output, object $object, array $options = []): void; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/JsonDescriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/JsonDescriptor.php index 6f79a17a..95630370 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/JsonDescriptor.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/JsonDescriptor.php @@ -26,12 +26,12 @@ */ class JsonDescriptor extends Descriptor { - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { $this->writeData($this->getInputArgumentData($argument), $options); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { $this->writeData($this->getInputOptionData($option), $options); if ($option->isNegatable()) { @@ -39,17 +39,17 @@ protected function describeInputOption(InputOption $option, array $options = []) } } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { $this->writeData($this->getInputDefinitionData($definition), $options); } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { $this->writeData($this->getCommandData($command, $options['short'] ?? false), $options); } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $describedNamespace = $options['namespace'] ?? null; $description = new ApplicationDescription($application, $describedNamespace, true); @@ -81,7 +81,7 @@ protected function describeApplication(Application $application, array $options /** * Writes data as json. */ - private function writeData(array $data, array $options) + private function writeData(array $data, array $options): void { $flags = $options['json_encoding'] ?? 0; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/MarkdownDescriptor.php index fbd9c534..8b707594 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/MarkdownDescriptor.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/MarkdownDescriptor.php @@ -28,7 +28,7 @@ */ class MarkdownDescriptor extends Descriptor { - public function describe(OutputInterface $output, object $object, array $options = []) + public function describe(OutputInterface $output, object $object, array $options = []): void { $decorated = $output->isDecorated(); $output->setDecorated(false); @@ -38,12 +38,12 @@ public function describe(OutputInterface $output, object $object, array $options $output->setDecorated($decorated); } - protected function write(string $content, bool $decorated = true) + protected function write(string $content, bool $decorated = true): void { parent::write($content, $decorated); } - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { $this->write( '#### `'.($argument->getName() ?: '')."`\n\n" @@ -54,7 +54,7 @@ protected function describeInputArgument(InputArgument $argument, array $options ); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { $name = '--'.$option->getName(); if ($option->isNegatable()) { @@ -75,15 +75,13 @@ protected function describeInputOption(InputOption $option, array $options = []) ); } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { if ($showArguments = \count($definition->getArguments()) > 0) { $this->write('### Arguments'); foreach ($definition->getArguments() as $argument) { $this->write("\n\n"); - if (null !== $describeInputArgument = $this->describeInputArgument($argument)) { - $this->write($describeInputArgument); - } + $this->describeInputArgument($argument); } } @@ -95,14 +93,12 @@ protected function describeInputDefinition(InputDefinition $definition, array $o $this->write('### Options'); foreach ($definition->getOptions() as $option) { $this->write("\n\n"); - if (null !== $describeInputOption = $this->describeInputOption($option)) { - $this->write($describeInputOption); - } + $this->describeInputOption($option); } } } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { if ($options['short'] ?? false) { $this->write( @@ -110,9 +106,7 @@ protected function describeCommand(Command $command, array $options = []) .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" .($command->getDescription() ? $command->getDescription()."\n\n" : '') .'### Usage'."\n\n" - .array_reduce($command->getAliases(), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) + .array_reduce($command->getAliases(), fn ($carry, $usage) => $carry.'* `'.$usage.'`'."\n") ); return; @@ -125,9 +119,7 @@ protected function describeCommand(Command $command, array $options = []) .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" .($command->getDescription() ? $command->getDescription()."\n\n" : '') .'### Usage'."\n\n" - .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) + .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), fn ($carry, $usage) => $carry.'* `'.$usage.'`'."\n") ); if ($help = $command->getProcessedHelp()) { @@ -142,7 +134,7 @@ protected function describeCommand(Command $command, array $options = []) } } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $describedNamespace = $options['namespace'] ?? null; $description = new ApplicationDescription($application, $describedNamespace); @@ -157,16 +149,12 @@ protected function describeApplication(Application $application, array $options } $this->write("\n\n"); - $this->write(implode("\n", array_map(function ($commandName) use ($description) { - return sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())); - }, $namespace['commands']))); + $this->write(implode("\n", array_map(fn ($commandName) => \sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())), $namespace['commands']))); } foreach ($description->getCommands() as $command) { $this->write("\n\n"); - if (null !== $describeCommand = $this->describeCommand($command, $options)) { - $this->write($describeCommand); - } + $this->describeCommand($command, $options); } } @@ -174,7 +162,7 @@ private function getApplicationTitle(Application $application): string { if ('UNKNOWN' !== $application->getName()) { if ('UNKNOWN' !== $application->getVersion()) { - return sprintf('%s %s', $application->getName(), $application->getVersion()); + return \sprintf('%s %s', $application->getName(), $application->getVersion()); } return $application->getName(); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php new file mode 100644 index 00000000..d2dde6fb --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php @@ -0,0 +1,273 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Helper\Helper; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\String\UnicodeString; + +class ReStructuredTextDescriptor extends Descriptor +{ + //

+ private string $partChar = '='; + //

+ private string $chapterChar = '-'; + //

+ private string $sectionChar = '~'; + //

+ private string $subsectionChar = '.'; + //

+ private string $subsubsectionChar = '^'; + //
+ private string $paragraphsChar = '"'; + + private array $visibleNamespaces = []; + + public function describe(OutputInterface $output, object $object, array $options = []): void + { + $decorated = $output->isDecorated(); + $output->setDecorated(false); + + parent::describe($output, $object, $options); + + $output->setDecorated($decorated); + } + + /** + * Override parent method to set $decorated = true. + */ + protected function write(string $content, bool $decorated = true): void + { + parent::write($content, $decorated); + } + + protected function describeInputArgument(InputArgument $argument, array $options = []): void + { + $this->write( + $argument->getName() ?: ''."\n".str_repeat($this->paragraphsChar, Helper::width($argument->getName()))."\n\n" + .($argument->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $argument->getDescription())."\n\n" : '') + .'- **Is required**: '.($argument->isRequired() ? 'yes' : 'no')."\n" + .'- **Is array**: '.($argument->isArray() ? 'yes' : 'no')."\n" + .'- **Default**: ``'.str_replace("\n", '', var_export($argument->getDefault(), true)).'``' + ); + } + + protected function describeInputOption(InputOption $option, array $options = []): void + { + $name = '\-\-'.$option->getName(); + if ($option->isNegatable()) { + $name .= '|\-\-no-'.$option->getName(); + } + if ($option->getShortcut()) { + $name .= '|-'.str_replace('|', '|-', $option->getShortcut()); + } + + $optionDescription = $option->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n\n", $option->getDescription())."\n\n" : ''; + $optionDescription = (new UnicodeString($optionDescription))->ascii(); + $this->write( + $name."\n".str_repeat($this->paragraphsChar, Helper::width($name))."\n\n" + .$optionDescription + .'- **Accept value**: '.($option->acceptValue() ? 'yes' : 'no')."\n" + .'- **Is value required**: '.($option->isValueRequired() ? 'yes' : 'no')."\n" + .'- **Is multiple**: '.($option->isArray() ? 'yes' : 'no')."\n" + .'- **Is negatable**: '.($option->isNegatable() ? 'yes' : 'no')."\n" + .'- **Default**: ``'.str_replace("\n", '', var_export($option->getDefault(), true)).'``'."\n" + ); + } + + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void + { + if ($showArguments = ((bool) $definition->getArguments())) { + $this->write("Arguments\n".str_repeat($this->subsubsectionChar, 9)); + foreach ($definition->getArguments() as $argument) { + $this->write("\n\n"); + $this->describeInputArgument($argument); + } + } + + if ($nonDefaultOptions = $this->getNonDefaultOptions($definition)) { + if ($showArguments) { + $this->write("\n\n"); + } + + $this->write("Options\n".str_repeat($this->subsubsectionChar, 7)."\n\n"); + foreach ($nonDefaultOptions as $option) { + $this->describeInputOption($option); + $this->write("\n"); + } + } + } + + protected function describeCommand(Command $command, array $options = []): void + { + if ($options['short'] ?? false) { + $this->write( + '``'.$command->getName()."``\n" + .str_repeat($this->subsectionChar, Helper::width($command->getName()))."\n\n" + .($command->getDescription() ? $command->getDescription()."\n\n" : '') + ."Usage\n".str_repeat($this->paragraphsChar, 5)."\n\n" + .array_reduce($command->getAliases(), static fn ($carry, $usage) => $carry.'- ``'.$usage.'``'."\n") + ); + + return; + } + + $command->mergeApplicationDefinition(false); + + foreach ($command->getAliases() as $alias) { + $this->write('.. _'.$alias.":\n\n"); + } + $this->write( + $command->getName()."\n" + .str_repeat($this->subsectionChar, Helper::width($command->getName()))."\n\n" + .($command->getDescription() ? $command->getDescription()."\n\n" : '') + ."Usage\n".str_repeat($this->subsubsectionChar, 5)."\n\n" + .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), static fn ($carry, $usage) => $carry.'- ``'.$usage.'``'."\n") + ); + + if ($help = $command->getProcessedHelp()) { + $this->write("\n"); + $this->write($help); + } + + $definition = $command->getDefinition(); + if ($definition->getOptions() || $definition->getArguments()) { + $this->write("\n\n"); + $this->describeInputDefinition($definition); + } + } + + protected function describeApplication(Application $application, array $options = []): void + { + $description = new ApplicationDescription($application, $options['namespace'] ?? null); + $title = $this->getApplicationTitle($application); + + $this->write($title."\n".str_repeat($this->partChar, Helper::width($title))); + $this->createTableOfContents($description, $application); + $this->describeCommands($application, $options); + } + + private function getApplicationTitle(Application $application): string + { + if ('UNKNOWN' === $application->getName()) { + return 'Console Tool'; + } + if ('UNKNOWN' !== $application->getVersion()) { + return \sprintf('%s %s', $application->getName(), $application->getVersion()); + } + + return $application->getName(); + } + + private function describeCommands($application, array $options): void + { + $title = 'Commands'; + $this->write("\n\n$title\n".str_repeat($this->chapterChar, Helper::width($title))."\n\n"); + foreach ($this->visibleNamespaces as $namespace) { + if ('_global' === $namespace) { + $commands = $application->all(''); + $this->write('Global'."\n".str_repeat($this->sectionChar, Helper::width('Global'))."\n\n"); + } else { + $commands = $application->all($namespace); + $this->write($namespace."\n".str_repeat($this->sectionChar, Helper::width($namespace))."\n\n"); + } + + foreach ($this->removeAliasesAndHiddenCommands($commands) as $command) { + $this->describeCommand($command, $options); + $this->write("\n\n"); + } + } + } + + private function createTableOfContents(ApplicationDescription $description, Application $application): void + { + $this->setVisibleNamespaces($description); + $chapterTitle = 'Table of Contents'; + $this->write("\n\n$chapterTitle\n".str_repeat($this->chapterChar, Helper::width($chapterTitle))."\n\n"); + foreach ($this->visibleNamespaces as $namespace) { + if ('_global' === $namespace) { + $commands = $application->all(''); + } else { + $commands = $application->all($namespace); + $this->write("\n\n"); + $this->write($namespace."\n".str_repeat($this->sectionChar, Helper::width($namespace))."\n\n"); + } + $commands = $this->removeAliasesAndHiddenCommands($commands); + + $this->write("\n\n"); + $this->write(implode("\n", array_map(static fn ($commandName) => \sprintf('- `%s`_', $commandName), array_keys($commands)))); + } + } + + private function getNonDefaultOptions(InputDefinition $definition): array + { + $globalOptions = [ + 'help', + 'silent', + 'quiet', + 'verbose', + 'version', + 'ansi', + 'no-interaction', + ]; + $nonDefaultOptions = []; + foreach ($definition->getOptions() as $option) { + // Skip global options. + if (!\in_array($option->getName(), $globalOptions, true)) { + $nonDefaultOptions[] = $option; + } + } + + return $nonDefaultOptions; + } + + private function setVisibleNamespaces(ApplicationDescription $description): void + { + $commands = $description->getCommands(); + foreach ($description->getNamespaces() as $namespace) { + try { + $namespaceCommands = $namespace['commands']; + foreach ($namespaceCommands as $key => $commandName) { + if (!\array_key_exists($commandName, $commands)) { + // If the array key does not exist, then this is an alias. + unset($namespaceCommands[$key]); + } elseif ($commands[$commandName]->isHidden()) { + unset($namespaceCommands[$key]); + } + } + if (!$namespaceCommands) { + // If the namespace contained only aliases or hidden commands, skip the namespace. + continue; + } + } catch (\Exception) { + } + $this->visibleNamespaces[] = $namespace['id']; + } + } + + private function removeAliasesAndHiddenCommands(array $commands): array + { + foreach ($commands as $key => $command) { + if ($command->isHidden() || \in_array($key, $command->getAliases(), true)) { + unset($commands[$key]); + } + } + unset($commands['completion']); + + return $commands; + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/TextDescriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/TextDescriptor.php index 48a0b42a..51c411f4 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/TextDescriptor.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/TextDescriptor.php @@ -28,10 +28,10 @@ */ class TextDescriptor extends Descriptor { - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); + $default = \sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); } else { $default = ''; } @@ -39,7 +39,7 @@ protected function describeInputArgument(InputArgument $argument, array $options $totalWidth = $options['total_width'] ?? Helper::width($argument->getName()); $spacingWidth = $totalWidth - \strlen($argument->getName()); - $this->writeText(sprintf(' %s %s%s%s', + $this->writeText(\sprintf(' %s %s%s%s', $argument->getName(), str_repeat(' ', $spacingWidth), // + 4 = 2 spaces before , 2 spaces after @@ -48,10 +48,10 @@ protected function describeInputArgument(InputArgument $argument, array $options ), $options); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); + $default = \sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); } else { $default = ''; } @@ -66,14 +66,14 @@ protected function describeInputOption(InputOption $option, array $options = []) } $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]); - $synopsis = sprintf('%s%s', - $option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ', - sprintf($option->isNegatable() ? '--%1$s|--no-%1$s' : '--%1$s%2$s', $option->getName(), $value) + $synopsis = \sprintf('%s%s', + $option->getShortcut() ? \sprintf('-%s, ', $option->getShortcut()) : ' ', + \sprintf($option->isNegatable() ? '--%1$s|--no-%1$s' : '--%1$s%2$s', $option->getName(), $value) ); $spacingWidth = $totalWidth - Helper::width($synopsis); - $this->writeText(sprintf(' %s %s%s%s%s', + $this->writeText(\sprintf(' %s %s%s%s%s', $synopsis, str_repeat(' ', $spacingWidth), // + 4 = 2 spaces before , 2 spaces after @@ -83,7 +83,7 @@ protected function describeInputOption(InputOption $option, array $options = []) ), $options); } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); foreach ($definition->getArguments() as $argument) { @@ -122,7 +122,7 @@ protected function describeInputDefinition(InputDefinition $definition, array $o } } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { $command->mergeApplicationDefinition(false); @@ -157,7 +157,7 @@ protected function describeCommand(Command $command, array $options = []) } } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $describedNamespace = $options['namespace'] ?? null; $description = new ApplicationDescription($application, $describedNamespace); @@ -166,7 +166,7 @@ protected function describeApplication(Application $application, array $options $width = $this->getColumnWidth($description->getCommands()); foreach ($description->getCommands() as $command) { - $this->writeText(sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options); + $this->writeText(\sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options); $this->writeText("\n"); } } else { @@ -193,20 +193,16 @@ protected function describeApplication(Application $application, array $options } // calculate max. width based on available commands per namespace - $width = $this->getColumnWidth(array_merge(...array_values(array_map(function ($namespace) use ($commands) { - return array_intersect($namespace['commands'], array_keys($commands)); - }, array_values($namespaces))))); + $width = $this->getColumnWidth(array_merge(...array_values(array_map(fn ($namespace) => array_intersect($namespace['commands'], array_keys($commands)), array_values($namespaces))))); if ($describedNamespace) { - $this->writeText(sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); + $this->writeText(\sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); } else { $this->writeText('Available commands:', $options); } foreach ($namespaces as $namespace) { - $namespace['commands'] = array_filter($namespace['commands'], function ($name) use ($commands) { - return isset($commands[$name]); - }); + $namespace['commands'] = array_filter($namespace['commands'], fn ($name) => isset($commands[$name])); if (!$namespace['commands']) { continue; @@ -222,7 +218,7 @@ protected function describeApplication(Application $application, array $options $spacingWidth = $width - Helper::width($name); $command = $commands[$name]; $commandAliases = $name === $command->getName() ? $this->getCommandAliasesText($command) : ''; - $this->writeText(sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options); + $this->writeText(\sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options); } } @@ -230,7 +226,7 @@ protected function describeApplication(Application $application, array $options } } - private function writeText(string $content, array $options = []) + private function writeText(string $content, array $options = []): void { $this->write( isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/XmlDescriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/XmlDescriptor.php index f4643a9a..00055557 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/XmlDescriptor.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/XmlDescriptor.php @@ -79,7 +79,7 @@ public function getCommandDocument(Command $command, bool $short = false): \DOMD return $dom; } - public function getApplicationDocument(Application $application, string $namespace = null, bool $short = false): \DOMDocument + public function getApplicationDocument(Application $application, ?string $namespace = null, bool $short = false): \DOMDocument { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->appendChild($rootXml = $dom->createElement('symfony')); @@ -120,27 +120,27 @@ public function getApplicationDocument(Application $application, string $namespa return $dom; } - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { $this->writeDocument($this->getInputArgumentDocument($argument)); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { $this->writeDocument($this->getInputOptionDocument($option)); } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { $this->writeDocument($this->getInputDefinitionDocument($definition)); } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { $this->writeDocument($this->getCommandDocument($command, $options['short'] ?? false)); } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null, $options['short'] ?? false)); } @@ -148,7 +148,7 @@ protected function describeApplication(Application $application, array $options /** * Appends document children to parent node. */ - private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) + private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent): void { foreach ($importedParent->childNodes as $childNode) { $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true)); @@ -158,7 +158,7 @@ private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) /** * Writes DOM document. */ - private function writeDocument(\DOMDocument $dom) + private function writeDocument(\DOMDocument $dom): void { $dom->formatOutput = true; $this->write($dom->saveXML()); @@ -208,11 +208,9 @@ private function getInputOptionDocument(InputOption $option): \DOMDocument $defaults = \is_array($option->getDefault()) ? $option->getDefault() : (\is_bool($option->getDefault()) ? [var_export($option->getDefault(), true)] : ($option->getDefault() ? [$option->getDefault()] : [])); $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - if (!empty($defaults)) { - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } + foreach ($defaults as $default) { + $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); + $defaultXML->appendChild($dom->createTextNode($default)); } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleAlarmEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleAlarmEvent.php new file mode 100644 index 00000000..876ab59b --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleAlarmEvent.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Event; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +final class ConsoleAlarmEvent extends ConsoleEvent +{ + public function __construct( + Command $command, + InputInterface $input, + OutputInterface $output, + private int|false $exitCode = 0, + ) { + parent::__construct($command, $input, $output); + } + + public function setExitCode(int $exitCode): void + { + if ($exitCode < 0 || $exitCode > 255) { + throw new \InvalidArgumentException('Exit code must be between 0 and 255.'); + } + + $this->exitCode = $exitCode; + } + + public function abortExit(): void + { + $this->exitCode = false; + } + + public function getExitCode(): int|false + { + return $this->exitCode; + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleCommandEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleCommandEvent.php index 31c9ee99..0757a23f 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleCommandEvent.php @@ -12,7 +12,10 @@ namespace Symfony\Component\Console\Event; /** - * Allows to do things before the command is executed, like skipping the command or changing the input. + * Allows to do things before the command is executed, like skipping the command or executing code before the command is + * going to be executed. + * + * Changing the input arguments will have no effect. * * @author Fabien Potencier */ diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleErrorEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleErrorEvent.php index d4a69121..1c0d6265 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleErrorEvent.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleErrorEvent.php @@ -22,14 +22,15 @@ */ final class ConsoleErrorEvent extends ConsoleEvent { - private \Throwable $error; private int $exitCode; - public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null) - { + public function __construct( + InputInterface $input, + OutputInterface $output, + private \Throwable $error, + ?Command $command = null, + ) { parent::__construct($command, $input, $output); - - $this->error = $error; } public function getError(): \Throwable diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleEvent.php index 6ba1615f..2f9f0778 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleEvent.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleEvent.php @@ -23,16 +23,11 @@ */ class ConsoleEvent extends Event { - protected $command; - - private InputInterface $input; - private OutputInterface $output; - - public function __construct(?Command $command, InputInterface $input, OutputInterface $output) - { - $this->command = $command; - $this->input = $input; - $this->output = $output; + public function __construct( + protected ?Command $command, + private InputInterface $input, + private OutputInterface $output, + ) { } /** diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleSignalEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleSignalEvent.php index 766af691..b27f08a1 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleSignalEvent.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleSignalEvent.php @@ -20,16 +20,37 @@ */ final class ConsoleSignalEvent extends ConsoleEvent { - private int $handlingSignal; - - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal) - { + public function __construct( + Command $command, + InputInterface $input, + OutputInterface $output, + private int $handlingSignal, + private int|false $exitCode = 0, + ) { parent::__construct($command, $input, $output); - $this->handlingSignal = $handlingSignal; } public function getHandlingSignal(): int { return $this->handlingSignal; } + + public function setExitCode(int $exitCode): void + { + if ($exitCode < 0 || $exitCode > 255) { + throw new \InvalidArgumentException('Exit code must be between 0 and 255.'); + } + + $this->exitCode = $exitCode; + } + + public function abortExit(): void + { + $this->exitCode = false; + } + + public function getExitCode(): int|false + { + return $this->exitCode; + } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleTerminateEvent.php index de63c8ff..38f7253a 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleTerminateEvent.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleTerminateEvent.php @@ -19,16 +19,18 @@ * Allows to manipulate the exit code of a command after its execution. * * @author Francesco Levorato + * @author Jules Pietri */ final class ConsoleTerminateEvent extends ConsoleEvent { - private int $exitCode; - - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode) - { + public function __construct( + Command $command, + InputInterface $input, + OutputInterface $output, + private int $exitCode, + private readonly ?int $interruptingSignal = null, + ) { parent::__construct($command, $input, $output); - - $this->setExitCode($exitCode); } public function setExitCode(int $exitCode): void @@ -40,4 +42,9 @@ public function getExitCode(): int { return $this->exitCode; } + + public function getInterruptingSignal(): ?int + { + return $this->interruptingSignal; + } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/EventListener/ErrorListener.php b/tools/php-cs-fixer/vendor/symfony/console/EventListener/ErrorListener.php index 773a13a1..9acb0e41 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/EventListener/ErrorListener.php +++ b/tools/php-cs-fixer/vendor/symfony/console/EventListener/ErrorListener.php @@ -24,14 +24,12 @@ */ class ErrorListener implements EventSubscriberInterface { - private ?LoggerInterface $logger; - - public function __construct(LoggerInterface $logger = null) - { - $this->logger = $logger; + public function __construct( + private ?LoggerInterface $logger = null, + ) { } - public function onConsoleError(ConsoleErrorEvent $event) + public function onConsoleError(ConsoleErrorEvent $event): void { if (null === $this->logger) { return; @@ -39,7 +37,7 @@ public function onConsoleError(ConsoleErrorEvent $event) $error = $event->getError(); - if (!$inputString = $this->getInputString($event)) { + if (!$inputString = self::getInputString($event)) { $this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); return; @@ -48,7 +46,7 @@ public function onConsoleError(ConsoleErrorEvent $event) $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); } - public function onConsoleTerminate(ConsoleTerminateEvent $event) + public function onConsoleTerminate(ConsoleTerminateEvent $event): void { if (null === $this->logger) { return; @@ -60,7 +58,7 @@ public function onConsoleTerminate(ConsoleTerminateEvent $event) return; } - if (!$inputString = $this->getInputString($event)) { + if (!$inputString = self::getInputString($event)) { $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]); return; @@ -77,19 +75,15 @@ public static function getSubscribedEvents(): array ]; } - private static function getInputString(ConsoleEvent $event): ?string + private static function getInputString(ConsoleEvent $event): string { $commandName = $event->getCommand()?->getName(); - $input = $event->getInput(); - - if ($input instanceof \Stringable) { - if ($commandName) { - return str_replace(["'$commandName'", "\"$commandName\""], $commandName, (string) $input); - } + $inputString = (string) $event->getInput(); - return (string) $input; + if ($commandName) { + return str_replace(["'$commandName'", "\"$commandName\""], $commandName, $inputString); } - return $commandName; + return $inputString; } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Exception/CommandNotFoundException.php b/tools/php-cs-fixer/vendor/symfony/console/Exception/CommandNotFoundException.php index 1e9f1c79..246f04fa 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Exception/CommandNotFoundException.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Exception/CommandNotFoundException.php @@ -18,19 +18,19 @@ */ class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface { - private array $alternatives; - /** * @param string $message Exception message to throw * @param string[] $alternatives List of similar defined names * @param int $code Exception code * @param \Throwable|null $previous Previous exception used for the exception chaining */ - public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null) - { + public function __construct( + string $message, + private array $alternatives = [], + int $code = 0, + ?\Throwable $previous = null, + ) { parent::__construct($message, $code, $previous); - - $this->alternatives = $alternatives; } /** diff --git a/tools/php-cs-fixer/vendor/symfony/console/Exception/RunCommandFailedException.php b/tools/php-cs-fixer/vendor/symfony/console/Exception/RunCommandFailedException.php new file mode 100644 index 00000000..5d87ec94 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/console/Exception/RunCommandFailedException.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +use Symfony\Component\Console\Messenger\RunCommandContext; + +/** + * @author Kevin Bond + */ +final class RunCommandFailedException extends RuntimeException +{ + public function __construct(\Throwable|string $exception, public readonly RunCommandContext $context) + { + parent::__construct( + $exception instanceof \Throwable ? $exception->getMessage() : $exception, + $exception instanceof \Throwable ? $exception->getCode() : 0, + $exception instanceof \Throwable ? $exception : null, + ); + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php index c2ce7d14..06fa6e40 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php @@ -21,19 +21,13 @@ public function apply(string $text): string return $text; } - public function setBackground(string $color = null): void + public function setBackground(?string $color): void { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } // do nothing } - public function setForeground(string $color = null): void + public function setForeground(?string $color): void { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } // do nothing } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatter.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatter.php index 38e75c31..3c8c287e 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatter.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatter.php @@ -13,6 +13,8 @@ use Symfony\Component\Console\Exception\InvalidArgumentException; +use function Symfony\Component\String\b; + /** * Formatter class for console output. * @@ -21,7 +23,6 @@ */ class OutputFormatter implements WrappableOutputFormatterInterface { - private bool $decorated; private array $styles = []; private OutputFormatterStyleStack $styleStack; @@ -65,10 +66,10 @@ public static function escapeTrailingBackslash(string $text): string * * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances */ - public function __construct(bool $decorated = false, array $styles = []) - { - $this->decorated = $decorated; - + public function __construct( + private bool $decorated = false, + array $styles = [], + ) { $this->setStyle('error', new OutputFormatterStyle('white', 'red')); $this->setStyle('info', new OutputFormatterStyle('green')); $this->setStyle('comment', new OutputFormatterStyle('yellow')); @@ -81,7 +82,7 @@ public function __construct(bool $decorated = false, array $styles = []) $this->styleStack = new OutputFormatterStyleStack(); } - public function setDecorated(bool $decorated) + public function setDecorated(bool $decorated): void { $this->decorated = $decorated; } @@ -91,7 +92,7 @@ public function isDecorated(): bool return $this->decorated; } - public function setStyle(string $name, OutputFormatterStyleInterface $style) + public function setStyle(string $name, OutputFormatterStyleInterface $style): void { $this->styles[strtolower($name)] = $style; } @@ -104,7 +105,7 @@ public function hasStyle(string $name): bool public function getStyle(string $name): OutputFormatterStyleInterface { if (!$this->hasStyle($name)) { - throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name)); + throw new InvalidArgumentException(\sprintf('Undefined style: "%s".', $name)); } return $this->styles[strtolower($name)]; @@ -115,7 +116,7 @@ public function format(?string $message): ?string return $this->formatAndWrap($message, 0); } - public function formatAndWrap(?string $message, int $width) + public function formatAndWrap(?string $message, int $width): string { if (null === $message) { return ''; @@ -232,7 +233,7 @@ private function applyCurrentStyle(string $text, string $current, int $width, in } preg_match('~(\\n)$~', $text, $matches); - $text = $prefix.preg_replace('~([^\\n]{'.$width.'})\\ *~', "\$1\n", $text); + $text = $prefix.$this->addLineBreaks($text, $width); $text = rtrim($text, "\n").($matches[1] ?? ''); if (!$currentLineLength && '' !== $current && !str_ends_with($current, "\n")) { @@ -256,4 +257,11 @@ private function applyCurrentStyle(string $text, string $current, int $width, in return implode("\n", $lines); } + + private function addLineBreaks(string $text, int $width): string + { + $encoding = mb_detect_encoding($text, null, true) ?: 'UTF-8'; + + return b($text)->toCodePointString($encoding)->wordwrap($width, "\n", true)->toByteString($encoding); + } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterInterface.php index b94e51de..947347fa 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterInterface.php @@ -21,7 +21,7 @@ interface OutputFormatterInterface /** * Sets the decorated flag. */ - public function setDecorated(bool $decorated); + public function setDecorated(bool $decorated): void; /** * Whether the output will decorate messages. @@ -31,7 +31,7 @@ public function isDecorated(): bool; /** * Sets a new style. */ - public function setStyle(string $name, OutputFormatterStyleInterface $style); + public function setStyle(string $name, OutputFormatterStyleInterface $style): void; /** * Checks if output formatter has style with specified name. diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyle.php index 3394c9ad..20a65b51 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -33,24 +33,18 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface * @param string|null $foreground The style foreground color name * @param string|null $background The style background color name */ - public function __construct(string $foreground = null, string $background = null, array $options = []) + public function __construct(?string $foreground = null, ?string $background = null, array $options = []) { $this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options); } - public function setForeground(string $color = null) + public function setForeground(?string $color): void { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } $this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options); } - public function setBackground(string $color = null) + public function setBackground(?string $color): void { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } $this->color = new Color($this->foreground, $this->background = $color ?: '', $this->options); } @@ -59,13 +53,13 @@ public function setHref(string $url): void $this->href = $url; } - public function setOption(string $option) + public function setOption(string $option): void { $this->options[] = $option; $this->color = new Color($this->foreground, $this->background, $this->options); } - public function unsetOption(string $option) + public function unsetOption(string $option): void { $pos = array_search($option, $this->options); if (false !== $pos) { @@ -75,7 +69,7 @@ public function unsetOption(string $option) $this->color = new Color($this->foreground, $this->background, $this->options); } - public function setOptions(array $options) + public function setOptions(array $options): void { $this->color = new Color($this->foreground, $this->background, $this->options = $options); } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php index 7ed67d9a..03741927 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php @@ -21,27 +21,27 @@ interface OutputFormatterStyleInterface /** * Sets style foreground color. */ - public function setForeground(?string $color); + public function setForeground(?string $color): void; /** * Sets style background color. */ - public function setBackground(?string $color); + public function setBackground(?string $color): void; /** * Sets some specific style option. */ - public function setOption(string $option); + public function setOption(string $option): void; /** * Unsets some specific style option. */ - public function unsetOption(string $option); + public function unsetOption(string $option): void; /** * Sets multiple style options at once. */ - public function setOptions(array $options); + public function setOptions(array $options): void; /** * Applies the style to a given text. diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php index 2c5cdf9b..4985213a 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php @@ -26,7 +26,7 @@ class OutputFormatterStyleStack implements ResetInterface private OutputFormatterStyleInterface $emptyStyle; - public function __construct(OutputFormatterStyleInterface $emptyStyle = null) + public function __construct(?OutputFormatterStyleInterface $emptyStyle = null) { $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle(); $this->reset(); @@ -35,7 +35,7 @@ public function __construct(OutputFormatterStyleInterface $emptyStyle = null) /** * Resets stack (ie. empty internal arrays). */ - public function reset() + public function reset(): void { $this->styles = []; } @@ -43,7 +43,7 @@ public function reset() /** * Pushes a style in the stack. */ - public function push(OutputFormatterStyleInterface $style) + public function push(OutputFormatterStyleInterface $style): void { $this->styles[] = $style; } @@ -53,7 +53,7 @@ public function push(OutputFormatterStyleInterface $style) * * @throws InvalidArgumentException When style tags incorrectly nested */ - public function pop(OutputFormatterStyleInterface $style = null): OutputFormatterStyleInterface + public function pop(?OutputFormatterStyleInterface $style = null): OutputFormatterStyleInterface { if (!$this->styles) { return $this->emptyStyle; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php index 746cd27e..412d9976 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php @@ -20,8 +20,6 @@ interface WrappableOutputFormatterInterface extends OutputFormatterInterface { /** * Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping). - * - * @return string */ - public function formatAndWrap(?string $message, int $width); + public function formatAndWrap(?string $message, int $width): string; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/DebugFormatterHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/DebugFormatterHelper.php index 9ea7fb91..dfdb8a82 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/DebugFormatterHelper.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/DebugFormatterHelper.php @@ -31,7 +31,7 @@ public function start(string $id, string $message, string $prefix = 'RUN'): stri { $this->started[$id] = ['border' => ++$this->count % \count(self::COLORS)]; - return sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); + return \sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); } /** @@ -47,22 +47,22 @@ public function progress(string $id, string $buffer, bool $error = false, string unset($this->started[$id]['out']); } if (!isset($this->started[$id]['err'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $errorPrefix); + $message .= \sprintf('%s %s ', $this->getBorder($id), $errorPrefix); $this->started[$id]['err'] = true; } - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $errorPrefix), $buffer); + $message .= str_replace("\n", \sprintf("\n%s %s ", $this->getBorder($id), $errorPrefix), $buffer); } else { if (isset($this->started[$id]['err'])) { $message .= "\n"; unset($this->started[$id]['err']); } if (!isset($this->started[$id]['out'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $prefix); + $message .= \sprintf('%s %s ', $this->getBorder($id), $prefix); $this->started[$id]['out'] = true; } - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $prefix), $buffer); + $message .= str_replace("\n", \sprintf("\n%s %s ", $this->getBorder($id), $prefix), $buffer); } return $message; @@ -76,10 +76,10 @@ public function stop(string $id, string $message, bool $successful, string $pref $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : ''; if ($successful) { - return sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); + return \sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); } - $message = sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); + $message = \sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); unset($this->started[$id]['out'], $this->started[$id]['err']); @@ -88,7 +88,7 @@ public function stop(string $id, string $message, bool $successful, string $pref private function getBorder(string $id): string { - return sprintf(' ', self::COLORS[$this->started[$id]['border']]); + return \sprintf(' ', self::COLORS[$this->started[$id]['border']]); } public function getName(): string diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/DescriptorHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/DescriptorHelper.php index 3015ff08..9422271f 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/DescriptorHelper.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/DescriptorHelper.php @@ -14,6 +14,7 @@ use Symfony\Component\Console\Descriptor\DescriptorInterface; use Symfony\Component\Console\Descriptor\JsonDescriptor; use Symfony\Component\Console\Descriptor\MarkdownDescriptor; +use Symfony\Component\Console\Descriptor\ReStructuredTextDescriptor; use Symfony\Component\Console\Descriptor\TextDescriptor; use Symfony\Component\Console\Descriptor\XmlDescriptor; use Symfony\Component\Console\Exception\InvalidArgumentException; @@ -38,6 +39,7 @@ public function __construct() ->register('xml', new XmlDescriptor()) ->register('json', new JsonDescriptor()) ->register('md', new MarkdownDescriptor()) + ->register('rst', new ReStructuredTextDescriptor()) ; } @@ -50,7 +52,7 @@ public function __construct() * * @throws InvalidArgumentException when the given format is not supported */ - public function describe(OutputInterface $output, ?object $object, array $options = []) + public function describe(OutputInterface $output, ?object $object, array $options = []): void { $options = array_merge([ 'raw_text' => false, @@ -58,7 +60,7 @@ public function describe(OutputInterface $output, ?object $object, array $option ], $options); if (!isset($this->descriptors[$options['format']])) { - throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format'])); + throw new InvalidArgumentException(\sprintf('Unsupported format "%s".', $options['format'])); } $descriptor = $this->descriptors[$options['format']]; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/Dumper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/Dumper.php index ac7571ce..0cd01e61 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/Dumper.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/Dumper.php @@ -21,17 +21,13 @@ */ final class Dumper { - private OutputInterface $output; - private ?CliDumper $dumper; - private ?ClonerInterface $cloner; private \Closure $handler; - public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null) - { - $this->output = $output; - $this->dumper = $dumper; - $this->cloner = $cloner; - + public function __construct( + private OutputInterface $output, + private ?CliDumper $dumper = null, + private ?ClonerInterface $cloner = null, + ) { if (class_exists(CliDumper::class)) { $this->handler = function ($var): string { $dumper = $this->dumper ??= new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR); @@ -40,14 +36,12 @@ public function __construct(OutputInterface $output, CliDumper $dumper = null, C return rtrim($dumper->dump(($this->cloner ??= new VarCloner())->cloneVar($var)->withRefHandles(false), true)); }; } else { - $this->handler = function ($var): string { - return match (true) { - null === $var => 'null', - true === $var => 'true', - false === $var => 'false', - \is_string($var) => '"'.$var.'"', - default => rtrim(print_r($var, true)), - }; + $this->handler = fn ($var): string => match (true) { + null === $var => 'null', + true === $var => 'true', + false === $var => 'false', + \is_string($var) => '"'.$var.'"', + default => rtrim(print_r($var, true)), }; } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/FormatterHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/FormatterHelper.php index 279e4c79..3646b3d6 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/FormatterHelper.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/FormatterHelper.php @@ -25,7 +25,7 @@ class FormatterHelper extends Helper */ public function formatSection(string $section, string $message, string $style = 'info'): string { - return sprintf('<%s>[%s] %s', $style, $section, $style, $message); + return \sprintf('<%s>[%s] %s', $style, $section, $style, $message); } /** @@ -41,7 +41,7 @@ public function formatBlock(string|array $messages, string $style, bool $large = $lines = []; foreach ($messages as $message) { $message = OutputFormatter::escape($message); - $lines[] = sprintf($large ? ' %s ' : ' %s ', $message); + $lines[] = \sprintf($large ? ' %s ' : ' %s ', $message); $len = max(self::width($message) + ($large ? 4 : 2), $len); } @@ -54,7 +54,7 @@ public function formatBlock(string|array $messages, string $style, bool $large = } for ($i = 0; isset($messages[$i]); ++$i) { - $messages[$i] = sprintf('<%s>%s', $style, $messages[$i], $style); + $messages[$i] = \sprintf('<%s>%s', $style, $messages[$i], $style); } return implode("\n", $messages); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/Helper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/Helper.php index 920196e0..3981bbf3 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/Helper.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/Helper.php @@ -21,13 +21,10 @@ */ abstract class Helper implements HelperInterface { - protected $helperSet = null; + protected ?HelperSet $helperSet = null; - public function setHelperSet(HelperSet $helperSet = null) + public function setHelperSet(?HelperSet $helperSet): void { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } $this->helperSet = $helperSet; } @@ -77,7 +74,7 @@ public static function length(?string $string): int /** * Returns the subset of a string, using mb_substr if it is available. */ - public static function substr(?string $string, int $from, int $length = null): string + public static function substr(?string $string, int $from, ?int $length = null): string { $string ??= ''; @@ -88,53 +85,64 @@ public static function substr(?string $string, int $from, int $length = null): s return mb_substr($string, $from, $length, $encoding); } - public static function formatTime(int|float $secs) + public static function formatTime(int|float $secs, int $precision = 1): string { + $secs = (int) floor($secs); + + if (0 === $secs) { + return '< 1 sec'; + } + static $timeFormats = [ - [0, '< 1 sec'], - [1, '1 sec'], - [2, 'secs', 1], - [60, '1 min'], - [120, 'mins', 60], - [3600, '1 hr'], - [7200, 'hrs', 3600], - [86400, '1 day'], - [172800, 'days', 86400], + [1, '1 sec', 'secs'], + [60, '1 min', 'mins'], + [3600, '1 hr', 'hrs'], + [86400, '1 day', 'days'], ]; + $times = []; foreach ($timeFormats as $index => $format) { - if ($secs >= $format[0]) { - if ((isset($timeFormats[$index + 1]) && $secs < $timeFormats[$index + 1][0]) - || $index == \count($timeFormats) - 1 - ) { - if (2 == \count($format)) { - return $format[1]; - } - - return floor($secs / $format[2]).' '.$format[1]; - } + $seconds = isset($timeFormats[$index + 1]) ? $secs % $timeFormats[$index + 1][0] : $secs; + + if (isset($times[$index - $precision])) { + unset($times[$index - $precision]); + } + + if (0 === $seconds) { + continue; + } + + $unitCount = ($seconds / $format[0]); + $times[$index] = 1 === $unitCount ? $format[1] : $unitCount.' '.$format[2]; + + if ($secs === $seconds) { + break; } + + $secs -= $seconds; } + + return implode(', ', array_reverse($times)); } - public static function formatMemory(int $memory) + public static function formatMemory(int $memory): string { if ($memory >= 1024 * 1024 * 1024) { - return sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024); + return \sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024); } if ($memory >= 1024 * 1024) { - return sprintf('%.1f MiB', $memory / 1024 / 1024); + return \sprintf('%.1f MiB', $memory / 1024 / 1024); } if ($memory >= 1024) { - return sprintf('%d KiB', $memory / 1024); + return \sprintf('%d KiB', $memory / 1024); } - return sprintf('%d B', $memory); + return \sprintf('%d B', $memory); } - public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string) + public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string): string { $isDecorated = $formatter->isDecorated(); $formatter->setDecorated(false); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperInterface.php index 2762cdf0..8c4da3c9 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperInterface.php @@ -21,7 +21,7 @@ interface HelperInterface /** * Sets the helper set associated with this helper. */ - public function setHelperSet(?HelperSet $helperSet); + public function setHelperSet(?HelperSet $helperSet): void; /** * Gets the helper set associated with this helper. @@ -30,8 +30,6 @@ public function getHelperSet(): ?HelperSet; /** * Returns the canonical name of this helper. - * - * @return string */ - public function getName(); + public function getName(): string; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperSet.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperSet.php index cefe62be..ffe756c9 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperSet.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperSet.php @@ -35,7 +35,7 @@ public function __construct(array $helpers = []) } } - public function set(HelperInterface $helper, string $alias = null) + public function set(HelperInterface $helper, ?string $alias = null): void { $this->helpers[$helper->getName()] = $helper; if (null !== $alias) { @@ -61,7 +61,7 @@ public function has(string $name): bool public function get(string $name): HelperInterface { if (!$this->has($name)) { - throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); + throw new InvalidArgumentException(\sprintf('The helper "%s" is not defined.', $name)); } return $this->helpers[$name]; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/InputAwareHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/InputAwareHelper.php index ba81e377..47126bda 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/InputAwareHelper.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/InputAwareHelper.php @@ -21,9 +21,9 @@ */ abstract class InputAwareHelper extends Helper implements InputAwareInterface { - protected $input; + protected InputInterface $input; - public function setInput(InputInterface $input) + public function setInput(InputInterface $input): void { $this->input = $input; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/OutputWrapper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/OutputWrapper.php index 2ec819c7..a615ed2f 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/OutputWrapper.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/OutputWrapper.php @@ -49,7 +49,7 @@ final class OutputWrapper private const URL_PATTERN = 'https?://\S+'; public function __construct( - private bool $allowCutUrls = false + private bool $allowCutUrls = false, ) { } @@ -59,7 +59,7 @@ public function wrap(string $text, int $width, string $break = "\n"): string return $text; } - $tagPattern = sprintf('<(?:(?:%s)|/(?:%s)?)>', self::TAG_OPEN_REGEX_SEGMENT, self::TAG_CLOSE_REGEX_SEGMENT); + $tagPattern = \sprintf('<(?:(?:%s)|/(?:%s)?)>', self::TAG_OPEN_REGEX_SEGMENT, self::TAG_CLOSE_REGEX_SEGMENT); $limitPattern = "{1,$width}"; $patternBlocks = [$tagPattern]; if (!$this->allowCutUrls) { @@ -68,7 +68,7 @@ public function wrap(string $text, int $width, string $break = "\n"): string $patternBlocks[] = '.'; $blocks = implode('|', $patternBlocks); $rowPattern = "(?:$blocks)$limitPattern"; - $pattern = sprintf('#(?:((?>(%1$s)((?<=[^\S\r\n])[^\S\r\n]?|(?=\r?\n)|$|[^\S\r\n]))|(%1$s))(?:\r?\n)?|(?:\r?\n|$))#imux', $rowPattern); + $pattern = \sprintf('#(?:((?>(%1$s)((?<=[^\S\r\n])[^\S\r\n]?|(?=\r?\n)|$|[^\S\r\n]))|(%1$s))(?:\r?\n)?|(?:\r?\n|$))#imux', $rowPattern); $output = rtrim(preg_replace($pattern, '\\1'.$break, $text), $break); return str_replace(' '.$break, $break, $output); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProcessHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/ProcessHelper.php index 26d35a1a..4a8cfc9d 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProcessHelper.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/ProcessHelper.php @@ -32,7 +32,7 @@ class ProcessHelper extends Helper * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR */ - public function run(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process + public function run(OutputInterface $output, array|Process $cmd, ?string $error = null, ?callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process { if (!class_exists(Process::class)) { throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".'); @@ -55,7 +55,7 @@ public function run(OutputInterface $output, array|Process $cmd, string $error = $process = $cmd[0]; unset($cmd[0]); } else { - throw new \InvalidArgumentException(sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__)); + throw new \InvalidArgumentException(\sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__)); } if ($verbosity <= $output->getVerbosity()) { @@ -69,12 +69,12 @@ public function run(OutputInterface $output, array|Process $cmd, string $error = $process->run($callback, $cmd); if ($verbosity <= $output->getVerbosity()) { - $message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode()); + $message = $process->isSuccessful() ? 'Command ran successfully' : \sprintf('%s Command did not run successfully', $process->getExitCode()); $output->write($formatter->stop(spl_object_hash($process), $message, $process->isSuccessful())); } if (!$process->isSuccessful() && null !== $error) { - $output->writeln(sprintf('%s', $this->escapeString($error))); + $output->writeln(\sprintf('%s', $this->escapeString($error))); } return $process; @@ -94,9 +94,9 @@ public function run(OutputInterface $output, array|Process $cmd, string $error = * * @see run() */ - public function mustRun(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null): Process + public function mustRun(OutputInterface $output, array|Process $cmd, ?string $error = null, ?callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process { - $process = $this->run($output, $cmd, $error, $callback); + $process = $this->run($output, $cmd, $error, $callback, $verbosity); if (!$process->isSuccessful()) { throw new ProcessFailedException($process); @@ -108,7 +108,7 @@ public function mustRun(OutputInterface $output, array|Process $cmd, string $err /** * Wraps a Process callback to add debugging output. */ - public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null): callable + public function wrapCallback(OutputInterface $output, Process $process, ?callable $callback = null): callable { if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressBar.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressBar.php index 0d112609..49e34d8d 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressBar.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressBar.php @@ -59,6 +59,7 @@ final class ProgressBar private Terminal $terminal; private ?string $previousMessage = null; private Cursor $cursor; + private array $placeholders = []; private static array $formatters; private static array $formats; @@ -94,12 +95,12 @@ public function __construct(OutputInterface $output, int $max = 0, float $minSec } /** - * Sets a placeholder formatter for a given name. + * Sets a placeholder formatter for a given name, globally for all instances of ProgressBar. * * This method also allow you to override an existing placeholder. * - * @param string $name The placeholder name (including the delimiter char like %) - * @param callable $callable A PHP callable + * @param string $name The placeholder name (including the delimiter char like %) + * @param callable(ProgressBar):string $callable A PHP callable */ public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void { @@ -120,6 +121,26 @@ public static function getPlaceholderFormatterDefinition(string $name): ?callabl return self::$formatters[$name] ?? null; } + /** + * Sets a placeholder formatter for a given name, for this instance only. + * + * @param callable(ProgressBar):string $callable A PHP callable + */ + public function setPlaceholderFormatter(string $name, callable $callable): void + { + $this->placeholders[$name] = $callable; + } + + /** + * Gets the placeholder formatter for a given name. + * + * @param string $name The placeholder name (including the delimiter char like %) + */ + public function getPlaceholderFormatter(string $name): ?callable + { + return $this->placeholders[$name] ?? $this::getPlaceholderFormatterDefinition($name); + } + /** * Sets a format for a given name. * @@ -157,14 +178,14 @@ public static function getFormatDefinition(string $name): ?string * @param string $message The text to associate with the placeholder * @param string $name The name of the placeholder */ - public function setMessage(string $message, string $name = 'message') + public function setMessage(string $message, string $name = 'message'): void { $this->messages[$name] = $message; } - public function getMessage(string $name = 'message') + public function getMessage(string $name = 'message'): ?string { - return $this->messages[$name]; + return $this->messages[$name] ?? null; } public function getStartTime(): int @@ -174,7 +195,7 @@ public function getStartTime(): int public function getMaxSteps(): int { - return $this->max; + return $this->max ?? 0; } public function getProgress(): int @@ -194,7 +215,7 @@ public function getProgressPercent(): float public function getBarOffset(): float { - return floor($this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth); + return floor(null !== $this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth); } public function getEstimated(): float @@ -208,14 +229,14 @@ public function getEstimated(): float public function getRemaining(): float { - if (!$this->step) { + if (0 === $this->step || $this->step === $this->startingStep) { return 0; } return round((time() - $this->startTime) / ($this->step - $this->startingStep) * ($this->max - $this->step)); } - public function setBarWidth(int $size) + public function setBarWidth(int $size): void { $this->barWidth = max(1, $size); } @@ -225,17 +246,17 @@ public function getBarWidth(): int return $this->barWidth; } - public function setBarCharacter(string $char) + public function setBarCharacter(string $char): void { $this->barChar = $char; } public function getBarCharacter(): string { - return $this->barChar ?? ($this->max ? '=' : $this->emptyBarChar); + return $this->barChar ?? (null !== $this->max ? '=' : $this->emptyBarChar); } - public function setEmptyBarCharacter(string $char) + public function setEmptyBarCharacter(string $char): void { $this->emptyBarChar = $char; } @@ -245,7 +266,7 @@ public function getEmptyBarCharacter(): string return $this->emptyBarChar; } - public function setProgressCharacter(string $char) + public function setProgressCharacter(string $char): void { $this->progressChar = $char; } @@ -255,7 +276,7 @@ public function getProgressCharacter(): string return $this->progressChar; } - public function setFormat(string $format) + public function setFormat(string $format): void { $this->format = null; $this->internalFormat = $format; @@ -266,7 +287,7 @@ public function setFormat(string $format) * * @param int|null $freq The frequency in steps */ - public function setRedrawFrequency(?int $freq) + public function setRedrawFrequency(?int $freq): void { $this->redrawFreq = null !== $freq ? max(1, $freq) : null; } @@ -284,11 +305,31 @@ public function maxSecondsBetweenRedraws(float $seconds): void /** * Returns an iterator that will automatically update the progress bar when iterated. * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable + * @template TKey + * @template TValue + * + * @param iterable $iterable + * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable + * + * @return iterable */ - public function iterate(iterable $iterable, int $max = null): iterable + public function iterate(iterable $iterable, ?int $max = null): iterable { - $this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0)); + if (0 === $max) { + $max = null; + } + + $max ??= is_countable($iterable) ? \count($iterable) : null; + + if (0 === $max) { + $this->max = 0; + $this->stepWidth = 2; + $this->finish(); + + return; + } + + $this->start($max); foreach ($iterable as $key => $value) { yield $key => $value; @@ -305,7 +346,7 @@ public function iterate(iterable $iterable, int $max = null): iterable * @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged * @param int $startAt The starting point of the bar (useful e.g. when resuming a previously started bar) */ - public function start(int $max = null, int $startAt = 0): void + public function start(?int $max = null, int $startAt = 0): void { $this->startTime = time(); $this->step = $startAt; @@ -325,7 +366,7 @@ public function start(int $max = null, int $startAt = 0): void * * @param int $step Number of steps to advance */ - public function advance(int $step = 1) + public function advance(int $step = 1): void { $this->setProgress($this->step + $step); } @@ -333,12 +374,12 @@ public function advance(int $step = 1) /** * Sets whether to overwrite the progressbar, false for new line. */ - public function setOverwrite(bool $overwrite) + public function setOverwrite(bool $overwrite): void { $this->overwrite = $overwrite; } - public function setProgress(int $step) + public function setProgress(int $step): void { if ($this->max && $step > $this->max) { $this->max = $step; @@ -346,11 +387,15 @@ public function setProgress(int $step) $step = 0; } - $redrawFreq = $this->redrawFreq ?? (($this->max ?: 10) / 10); - $prevPeriod = (int) ($this->step / $redrawFreq); - $currPeriod = (int) ($step / $redrawFreq); + $redrawFreq = $this->redrawFreq ?? (($this->max ?? 10) / 10); + $prevPeriod = $redrawFreq ? (int) ($this->step / $redrawFreq) : 0; + $currPeriod = $redrawFreq ? (int) ($step / $redrawFreq) : 0; $this->step = $step; - $this->percent = $this->max ? (float) $this->step / $this->max : 0; + $this->percent = match ($this->max) { + null => 0, + 0 => 1, + default => (float) $this->step / $this->max, + }; $timeInterval = microtime(true) - $this->lastWriteTime; // Draw regardless of other limits @@ -371,11 +416,20 @@ public function setProgress(int $step) } } - public function setMaxSteps(int $max) + public function setMaxSteps(?int $max): void { + if (0 === $max) { + $max = null; + } + $this->format = null; - $this->max = max(0, $max); - $this->stepWidth = $this->max ? Helper::width((string) $this->max) : 4; + if (null === $max) { + $this->max = null; + $this->stepWidth = 4; + } else { + $this->max = max(0, $max); + $this->stepWidth = Helper::width((string) $this->max); + } } /** @@ -383,16 +437,16 @@ public function setMaxSteps(int $max) */ public function finish(): void { - if (!$this->max) { + if (null === $this->max) { $this->max = $this->step; } - if ($this->step === $this->max && !$this->overwrite) { + if (($this->step === $this->max || null === $this->max) && !$this->overwrite) { // prevent double 100% output return; } - $this->setProgress($this->max); + $this->setProgress($this->max ?? $this->step); } /** @@ -431,7 +485,7 @@ public function clear(): void $this->overwrite(''); } - private function setRealFormat(string $format) + private function setRealFormat(string $format): void { // try to use the _nomax variant if available if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) { @@ -513,35 +567,25 @@ private static function initPlaceholderFormatters(): array return $display; }, - 'elapsed' => function (self $bar) { - return Helper::formatTime(time() - $bar->getStartTime()); - }, + 'elapsed' => fn (self $bar) => Helper::formatTime(time() - $bar->getStartTime(), 2), 'remaining' => function (self $bar) { - if (!$bar->getMaxSteps()) { + if (null === $bar->getMaxSteps()) { throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); } - return Helper::formatTime($bar->getRemaining()); + return Helper::formatTime($bar->getRemaining(), 2); }, 'estimated' => function (self $bar) { - if (!$bar->getMaxSteps()) { + if (null === $bar->getMaxSteps()) { throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); } - return Helper::formatTime($bar->getEstimated()); - }, - 'memory' => function (self $bar) { - return Helper::formatMemory(memory_get_usage(true)); - }, - 'current' => function (self $bar) { - return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT); - }, - 'max' => function (self $bar) { - return $bar->getMaxSteps(); - }, - 'percent' => function (self $bar) { - return floor($bar->getProgressPercent() * 100); + return Helper::formatTime($bar->getEstimated(), 2); }, + 'memory' => fn (self $bar) => Helper::formatMemory(memory_get_usage(true)), + 'current' => fn (self $bar) => str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT), + 'max' => fn (self $bar) => $bar->getMaxSteps(), + 'percent' => fn (self $bar) => floor($bar->getProgressPercent() * 100), ]; } @@ -566,9 +610,9 @@ private function buildLine(): string { \assert(null !== $this->format); - $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; + $regex = '{%([a-z\-_]+)(?:\:([^%]+))?%}i'; $callback = function ($matches) { - if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { + if ($formatter = $this->getPlaceholderFormatter($matches[1])) { $text = $formatter($this, $this->output); } elseif (isset($this->messages[$matches[1]])) { $text = $this->messages[$matches[1]]; @@ -577,7 +621,7 @@ private function buildLine(): string } if (isset($matches[2])) { - $text = sprintf('%'.$matches[2], $text); + $text = \sprintf('%'.$matches[2], $text); } return $text; @@ -585,9 +629,7 @@ private function buildLine(): string $line = preg_replace_callback($regex, $callback, $this->format); // gets string length for each sub line with multiline format - $linesLength = array_map(function ($subLine) { - return Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))); - }, explode("\n", $line)); + $linesLength = array_map(fn ($subLine) => Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))), explode("\n", $line)); $linesWidth = max($linesLength); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressIndicator.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressIndicator.php index b5fa24c4..b6bbd0cf 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressIndicator.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressIndicator.php @@ -31,15 +31,15 @@ class ProgressIndicator 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)', ]; - private OutputInterface $output; private int $startTime; private ?string $format = null; private ?string $message = null; private array $indicatorValues; private int $indicatorCurrent; - private int $indicatorChangeInterval; + private string $finishedIndicatorValue; private float $indicatorUpdateTime; private bool $started = false; + private bool $finished = false; /** * @var array @@ -50,28 +50,32 @@ class ProgressIndicator * @param int $indicatorChangeInterval Change interval in milliseconds * @param array|null $indicatorValues Animated indicator characters */ - public function __construct(OutputInterface $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null) - { - $this->output = $output; - + public function __construct( + private OutputInterface $output, + ?string $format = null, + private int $indicatorChangeInterval = 100, + ?array $indicatorValues = null, + ?string $finishedIndicatorValue = null, + ) { $format ??= $this->determineBestFormat(); $indicatorValues ??= ['-', '\\', '|', '/']; $indicatorValues = array_values($indicatorValues); + $finishedIndicatorValue ??= '✔'; if (2 > \count($indicatorValues)) { throw new InvalidArgumentException('Must have at least 2 indicator value characters.'); } $this->format = self::getFormatDefinition($format); - $this->indicatorChangeInterval = $indicatorChangeInterval; $this->indicatorValues = $indicatorValues; + $this->finishedIndicatorValue = $finishedIndicatorValue; $this->startTime = time(); } /** * Sets the current indicator message. */ - public function setMessage(?string $message) + public function setMessage(?string $message): void { $this->message = $message; @@ -81,7 +85,7 @@ public function setMessage(?string $message) /** * Starts the indicator output. */ - public function start(string $message) + public function start(string $message): void { if ($this->started) { throw new LogicException('Progress indicator already started.'); @@ -89,6 +93,7 @@ public function start(string $message) $this->message = $message; $this->started = true; + $this->finished = false; $this->startTime = time(); $this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval; $this->indicatorCurrent = 0; @@ -99,7 +104,7 @@ public function start(string $message) /** * Advances the indicator. */ - public function advance() + public function advance(): void { if (!$this->started) { throw new LogicException('Progress indicator has not yet been started.'); @@ -123,13 +128,25 @@ public function advance() /** * Finish the indicator with message. + * + * @param ?string $finishedIndicator */ - public function finish(string $message) + public function finish(string $message/* , ?string $finishedIndicator = null */): void { + $finishedIndicator = 1 < \func_num_args() ? func_get_arg(1) : null; + if (null !== $finishedIndicator && !\is_string($finishedIndicator)) { + throw new \TypeError(\sprintf('Argument 2 passed to "%s()" must be of the type string or null, "%s" given.', __METHOD__, get_debug_type($finishedIndicator))); + } + if (!$this->started) { throw new LogicException('Progress indicator has not yet been started.'); } + if (null !== $finishedIndicator) { + $this->finishedIndicatorValue = $finishedIndicator; + } + + $this->finished = true; $this->message = $message; $this->display(); $this->output->writeln(''); @@ -149,7 +166,7 @@ public static function getFormatDefinition(string $name): ?string * * This method also allow you to override an existing placeholder. */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable) + public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void { self::$formatters ??= self::initPlaceholderFormatters(); @@ -166,13 +183,13 @@ public static function getPlaceholderFormatterDefinition(string $name): ?callabl return self::$formatters[$name] ?? null; } - private function display() + private function display(): void { if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { return; } - $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) { + $this->overwrite(preg_replace_callback('{%([a-z\-_]+)(?:\:([^%]+))?%}i', function ($matches) { if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) { return $formatter($this); } @@ -195,7 +212,7 @@ private function determineBestFormat(): string /** * Overwrites a previous message to the output. */ - private function overwrite(string $message) + private function overwrite(string $message): void { if ($this->output->isDecorated()) { $this->output->write("\x0D\x1B[2K"); @@ -216,18 +233,10 @@ private function getCurrentTimeInMilliseconds(): float private static function initPlaceholderFormatters(): array { return [ - 'indicator' => function (self $indicator) { - return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)]; - }, - 'message' => function (self $indicator) { - return $indicator->message; - }, - 'elapsed' => function (self $indicator) { - return Helper::formatTime(time() - $indicator->startTime); - }, - 'memory' => function () { - return Helper::formatMemory(memory_get_usage(true)); - }, + 'indicator' => fn (self $indicator) => $indicator->finished ? $indicator->finishedIndicatorValue : $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)], + 'message' => fn (self $indicator) => $indicator->message, + 'elapsed' => fn (self $indicator) => Helper::formatTime(time() - $indicator->startTime, 2), + 'memory' => fn () => Helper::formatMemory(memory_get_usage(true)), ]; } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/QuestionHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/QuestionHelper.php index c345b4af..69afc2a6 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/QuestionHelper.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/QuestionHelper.php @@ -34,11 +34,6 @@ */ class QuestionHelper extends Helper { - /** - * @var resource|null - */ - private $inputStream; - private static bool $stty = true; private static bool $stdinIsInteractive; @@ -59,18 +54,15 @@ public function ask(InputInterface $input, OutputInterface $output, Question $qu return $this->getDefaultAnswer($question); } - if ($input instanceof StreamableInputInterface && $stream = $input->getStream()) { - $this->inputStream = $stream; - } + $inputStream = $input instanceof StreamableInputInterface ? $input->getStream() : null; + $inputStream ??= STDIN; try { if (!$question->getValidator()) { - return $this->doAsk($output, $question); + return $this->doAsk($inputStream, $output, $question); } - $interviewer = function () use ($output, $question) { - return $this->doAsk($output, $question); - }; + $interviewer = fn () => $this->doAsk($inputStream, $output, $question); return $this->validateAttempts($interviewer, $output, $question); } catch (MissingInputException $exception) { @@ -92,7 +84,7 @@ public function getName(): string /** * Prevents usage of stty. */ - public static function disableStty() + public static function disableStty(): void { self::$stty = false; } @@ -100,13 +92,14 @@ public static function disableStty() /** * Asks the question to the user. * + * @param resource $inputStream + * * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden */ - private function doAsk(OutputInterface $output, Question $question): mixed + private function doAsk($inputStream, OutputInterface $output, Question $question): mixed { $this->writePrompt($output, $question); - $inputStream = $this->inputStream ?: \STDIN; $autocomplete = $question->getAutocompleterCallback(); if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) { @@ -123,7 +116,18 @@ private function doAsk(OutputInterface $output, Question $question): mixed } if (false === $ret) { + $isBlocked = stream_get_meta_data($inputStream)['blocked'] ?? true; + + if (!$isBlocked) { + stream_set_blocking($inputStream, true); + } + $ret = $this->readInput($inputStream, $question); + + if (!$isBlocked) { + stream_set_blocking($inputStream, false); + } + if (false === $ret) { throw new MissingInputException('Aborted.'); } @@ -159,7 +163,7 @@ private function getDefaultAnswer(Question $question): mixed } if ($validator = $question->getValidator()) { - return \call_user_func($question->getValidator(), $default); + return \call_user_func($validator, $default); } elseif ($question instanceof ChoiceQuestion) { $choices = $question->getChoices(); @@ -180,7 +184,7 @@ private function getDefaultAnswer(Question $question): mixed /** * Outputs the question prompt. */ - protected function writePrompt(OutputInterface $output, Question $question) + protected function writePrompt(OutputInterface $output, Question $question): void { $message = $question->getQuestion(); @@ -207,7 +211,7 @@ protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string foreach ($choices as $key => $value) { $padding = str_repeat(' ', $maxWidth - self::width($key)); - $messages[] = sprintf(" [<$tag>%s$padding] %s", $key, $value); + $messages[] = \sprintf(" [<$tag>%s$padding] %s", $key, $value); } return $messages; @@ -216,7 +220,7 @@ protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string /** * Outputs an error message. */ - protected function writeError(OutputInterface $output, \Exception $error) + protected function writeError(OutputInterface $output, \Exception $error): void { if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) { $message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error'); @@ -314,9 +318,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu $matches = array_filter( $autocomplete($ret), - function ($match) use ($ret) { - return '' === $ret || str_starts_with($match, $ret); - } + fn ($match) => '' === $ret || str_starts_with($match, $ret) ); $numMatches = \count($matches); $ofs = -1; @@ -488,21 +490,7 @@ private function isInteractiveInput($inputStream): bool return self::$stdinIsInteractive; } - if (\function_exists('stream_isatty')) { - return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); - } - - if (\function_exists('posix_isatty')) { - return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r')); - } - - if (!\function_exists('exec')) { - return self::$stdinIsInteractive = true; - } - - exec('stty 2> /dev/null', $output, $status); - - return self::$stdinIsInteractive = 1 !== $status; + return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); } /** diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/SymfonyQuestionHelper.php index 109045d0..b452bf04 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/SymfonyQuestionHelper.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/SymfonyQuestionHelper.php @@ -25,23 +25,23 @@ */ class SymfonyQuestionHelper extends QuestionHelper { - protected function writePrompt(OutputInterface $output, Question $question) + protected function writePrompt(OutputInterface $output, Question $question): void { $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); $default = $question->getDefault(); if ($question->isMultiline()) { - $text .= sprintf(' (press %s to continue)', $this->getEofShortcut()); + $text .= \sprintf(' (press %s to continue)', $this->getEofShortcut()); } switch (true) { case null === $default: - $text = sprintf(' %s:', $text); + $text = \sprintf(' %s:', $text); break; case $question instanceof ConfirmationQuestion: - $text = sprintf(' %s (yes/no) [%s]:', $text, $default ? 'yes' : 'no'); + $text = \sprintf(' %s (yes/no) [%s]:', $text, $default ? 'yes' : 'no'); break; @@ -53,18 +53,18 @@ protected function writePrompt(OutputInterface $output, Question $question) $default[$key] = $choices[trim($value)]; } - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape(implode(', ', $default))); + $text = \sprintf(' %s [%s]:', $text, OutputFormatter::escape(implode(', ', $default))); break; case $question instanceof ChoiceQuestion: $choices = $question->getChoices(); - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default] ?? $default)); + $text = \sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default] ?? $default)); break; default: - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($default)); + $text = \sprintf(' %s [%s]:', $text, OutputFormatter::escape($default)); } $output->writeln($text); @@ -80,7 +80,7 @@ protected function writePrompt(OutputInterface $output, Question $question) $output->write($prompt); } - protected function writeError(OutputInterface $output, \Exception $error) + protected function writeError(OutputInterface $output, \Exception $error): void { if ($output instanceof SymfonyStyle) { $output->newLine(); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/Table.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/Table.php index 907c9f50..9ff73d2c 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/Table.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/Table.php @@ -45,7 +45,6 @@ class Table private array $rows = []; private array $effectiveColumnWidths = []; private int $numberOfColumns; - private OutputInterface $output; private TableStyle $style; private array $columnStyles = []; private array $columnWidths = []; @@ -55,10 +54,9 @@ class Table private static array $styles; - public function __construct(OutputInterface $output) - { - $this->output = $output; - + public function __construct( + private OutputInterface $output, + ) { self::$styles ??= self::initStyles(); $this->setStyle('default'); @@ -67,7 +65,7 @@ public function __construct(OutputInterface $output) /** * Sets a style definition. */ - public static function setStyleDefinition(string $name, TableStyle $style) + public static function setStyleDefinition(string $name, TableStyle $style): void { self::$styles ??= self::initStyles(); @@ -81,7 +79,7 @@ public static function getStyleDefinition(string $name): TableStyle { self::$styles ??= self::initStyles(); - return self::$styles[$name] ?? throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); + return self::$styles[$name] ?? throw new InvalidArgumentException(\sprintf('Style "%s" is not defined.', $name)); } /** @@ -166,7 +164,7 @@ public function setColumnWidths(array $widths): static public function setColumnMaxWidth(int $columnIndex, int $width): static { if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) { - throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output->getFormatter()))); + throw new \LogicException(\sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output->getFormatter()))); } $this->columnMaxWidths[$columnIndex] = $width; @@ -192,7 +190,7 @@ public function setHeaders(array $headers): static /** * @return $this */ - public function setRows(array $rows) + public function setRows(array $rows): static { $this->rows = []; @@ -235,7 +233,7 @@ public function addRow(TableSeparator|array $row): static public function appendRow(TableSeparator|array $row): static { if (!$this->output instanceof ConsoleSectionOutput) { - throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); + throw new RuntimeException(\sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); } if ($this->rendered) { @@ -311,7 +309,7 @@ public function setVertical(bool $vertical = true): static * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | * +---------------+-----------------------+------------------+ */ - public function render() + public function render(): void { $divider = new TableSeparator(); $isCellWithColspan = static fn ($cell) => $cell instanceof TableCell && $cell->getColspan() >= 2; @@ -360,14 +358,28 @@ public function render() $maxRows = max(\count($headers), \count($row)); for ($i = 0; $i < $maxRows; ++$i) { $cell = (string) ($row[$i] ?? ''); - if ($headers && !$containsColspan) { - $rows[] = [sprintf( - '%s: %s', - str_pad($headers[$i] ?? '', $maxHeaderLength, ' ', \STR_PAD_LEFT), - $cell - )]; - } elseif ('' !== $cell) { - $rows[] = [$cell]; + + $eol = str_contains($cell, "\r\n") ? "\r\n" : "\n"; + $parts = explode($eol, $cell); + foreach ($parts as $idx => $part) { + if ($headers && !$containsColspan) { + if (0 === $idx) { + $rows[] = [\sprintf( + '%s%s: %s', + str_repeat(' ', $maxHeaderLength - Helper::width(Helper::removeDecoration($formatter, $headers[$i] ?? ''))), + $headers[$i] ?? '', + $part + )]; + } else { + $rows[] = [\sprintf( + '%s %s', + str_pad('', $maxHeaderLength, ' ', \STR_PAD_LEFT), + $part + )]; + } + } elseif ('' !== $cell) { + $rows[] = [$part]; + } } } } @@ -407,7 +419,7 @@ public function render() if ($isHeader && !$isHeaderSeparatorRendered) { $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, + self::SEPARATOR_TOP, $hasTitle ? $this->headerTitle : null, $hasTitle ? $this->style->getHeaderTitleFormat() : null ); @@ -417,7 +429,7 @@ public function render() if ($isFirstRow) { $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, + $horizontal ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, $hasTitle ? $this->headerTitle : null, $hasTitle ? $this->style->getHeaderTitleFormat() : null ); @@ -450,7 +462,7 @@ public function render() * * +-----+-----------+-------+ */ - private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null) + private function renderRowSeparator(int $type = self::SEPARATOR_MID, ?string $title = null, ?string $titleFormat = null): void { if (!$count = $this->numberOfColumns) { return; @@ -479,12 +491,12 @@ private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $tit } if (null !== $title) { - $titleLength = Helper::width(Helper::removeDecoration($formatter = $this->output->getFormatter(), $formattedTitle = sprintf($titleFormat, $title))); + $titleLength = Helper::width(Helper::removeDecoration($formatter = $this->output->getFormatter(), $formattedTitle = \sprintf($titleFormat, $title))); $markupLength = Helper::width($markup); if ($titleLength > $limit = $markupLength - 4) { $titleLength = $limit; - $formatLength = Helper::width(Helper::removeDecoration($formatter, sprintf($titleFormat, ''))); - $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); + $formatLength = Helper::width(Helper::removeDecoration($formatter, \sprintf($titleFormat, ''))); + $formattedTitle = \sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); } $titleStart = intdiv($markupLength - $titleLength, 2); @@ -495,7 +507,7 @@ private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $tit } } - $this->output->writeln(sprintf($this->style->getBorderFormat(), $markup)); + $this->output->writeln(\sprintf($this->style->getBorderFormat(), $markup)); } /** @@ -505,7 +517,7 @@ private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string { $borders = $this->style->getBorderChars(); - return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]); + return \sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]); } /** @@ -515,7 +527,7 @@ private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string * * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | */ - private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null) + private function renderRow(array $row, string $cellFormat, ?string $firstCellFormat = null): void { $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE); $columns = $this->getRowColumns($row); @@ -553,11 +565,11 @@ private function renderCell(array $row, int $column, string $cellFormat): string $style = $this->getColumnStyle($column); if ($cell instanceof TableSeparator) { - return sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width)); + return \sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width)); } $width += Helper::length($cell) - Helper::length(Helper::removeDecoration($this->output->getFormatter(), $cell)); - $content = sprintf($style->getCellRowContentFormat(), $cell); + $content = \sprintf($style->getCellRowContentFormat(), $cell); $padType = $style->getPadType(); if ($cell instanceof TableCell && $cell->getStyle() instanceof TableCellStyle) { @@ -582,13 +594,13 @@ private function renderCell(array $row, int $column, string $cellFormat): string $padType = $cell->getStyle()->getPadByAlign(); } - return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $padType)); + return \sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $padType)); } /** * Calculate number of columns for this table. */ - private function calculateNumberOfColumns(array $rows) + private function calculateNumberOfColumns(array $rows): void { $columns = [0]; foreach ($rows as $row) { @@ -620,9 +632,10 @@ private function buildTableRows(array $rows): TableRows if (!str_contains($cell ?? '', "\n")) { continue; } - $escaped = implode("\n", array_map(OutputFormatter::escapeTrailingBackslash(...), explode("\n", $cell))); + $eol = str_contains($cell ?? '', "\r\n") ? "\r\n" : "\n"; + $escaped = implode($eol, array_map(OutputFormatter::escapeTrailingBackslash(...), explode($eol, $cell))); $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; - $lines = explode("\n", str_replace("\n", "\n", $cell)); + $lines = explode($eol, str_replace($eol, ''.$eol, $cell)); foreach ($lines as $lineKey => $line) { if ($colspan > 1) { $line = new TableCell($line, ['colspan' => $colspan]); @@ -678,14 +691,15 @@ private function fillNextRows(array $rows, int $line): array $unmergedRows = []; foreach ($rows[$line] as $column => $cell) { if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !$cell instanceof \Stringable) { - throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); + throw new InvalidArgumentException(\sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); } if ($cell instanceof TableCell && $cell->getRowspan() > 1) { $nbLines = $cell->getRowspan() - 1; $lines = [$cell]; if (str_contains($cell, "\n")) { - $lines = explode("\n", str_replace("\n", "\n", $cell)); - $nbLines = \count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines; + $eol = str_contains($cell, "\r\n") ? "\r\n" : "\n"; + $lines = explode($eol, str_replace($eol, ''.$eol.'', $cell)); + $nbLines = \count($lines) > $nbLines ? substr_count($cell, $eol) : $nbLines; $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); unset($lines[0]); @@ -705,7 +719,7 @@ private function fillNextRows(array $rows, int $line): array foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { // we need to know if $unmergedRow will be merged or inserted into $rows - if (isset($rows[$unmergedRowKey]) && \is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRows[$unmergedRowKey]) <= $this->numberOfColumns)) { + if (isset($rows[$unmergedRowKey]) && \is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRow) <= $this->numberOfColumns)) { foreach ($unmergedRow as $cellKey => $cell) { // insert cell into row at cellKey position array_splice($rows[$unmergedRowKey], $cellKey, 0, [$cell]); @@ -713,8 +727,8 @@ private function fillNextRows(array $rows, int $line): array } else { $row = $this->copyRow($rows, $unmergedRowKey - 1); foreach ($unmergedRow as $column => $cell) { - if (!empty($cell)) { - $row[$column] = $unmergedRow[$column]; + if ($cell) { + $row[$column] = $cell; } } array_splice($rows, $unmergedRowKey, 0, [$row]); @@ -727,7 +741,7 @@ private function fillNextRows(array $rows, int $line): array /** * fill cells for a row that contains colspan > 1. */ - private function fillCells(iterable $row) + private function fillCells(iterable $row): iterable { $newRow = []; @@ -789,7 +803,7 @@ private function getRowColumns(array $row): array /** * Calculates columns widths. */ - private function calculateColumnsWidth(iterable $groups) + private function calculateColumnsWidth(iterable $groups): void { for ($column = 0; $column < $this->numberOfColumns; ++$column) { $lengths = []; @@ -822,7 +836,7 @@ private function calculateColumnsWidth(iterable $groups) private function getColumnSeparatorWidth(): int { - return Helper::width(sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3])); + return Helper::width(\sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3])); } private function getCellWidth(array $row, int $column): int @@ -843,7 +857,7 @@ private function getCellWidth(array $row, int $column): int /** * Called after rendering to cleanup cache data. */ - private function cleanup() + private function cleanup(): void { $this->effectiveColumnWidths = []; unset($this->numberOfColumns); @@ -905,6 +919,6 @@ private function resolveStyle(TableStyle|string $name): TableStyle return $name; } - return self::$styles[$name] ?? throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); + return self::$styles[$name] ?? throw new InvalidArgumentException(\sprintf('Style "%s" is not defined.', $name)); } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCell.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCell.php index 394b2bc9..ab833920 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCell.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCell.php @@ -18,20 +18,19 @@ */ class TableCell { - private string $value; private array $options = [ 'rowspan' => 1, 'colspan' => 1, 'style' => null, ]; - public function __construct(string $value = '', array $options = []) - { - $this->value = $value; - + public function __construct( + private string $value = '', + array $options = [], + ) { // check option names if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); + throw new InvalidArgumentException(\sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); } if (isset($options['style']) && !$options['style'] instanceof TableCellStyle) { diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCellStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCellStyle.php index 65ae9e72..af1a17e9 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCellStyle.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCellStyle.php @@ -43,11 +43,11 @@ class TableCellStyle public function __construct(array $options = []) { if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCellStyle does not support the following options: \'%s\'.', implode('\', \'', $diff))); + throw new InvalidArgumentException(\sprintf('The TableCellStyle does not support the following options: \'%s\'.', implode('\', \'', $diff))); } if (isset($options['align']) && !\array_key_exists($options['align'], self::ALIGN_MAP)) { - throw new InvalidArgumentException(sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys(self::ALIGN_MAP)))); + throw new InvalidArgumentException(\sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys(self::ALIGN_MAP)))); } $this->options = array_merge($this->options, $options); @@ -67,9 +67,7 @@ public function getTagOptions(): array { return array_filter( $this->getOptions(), - function ($key) { - return \in_array($key, self::TAG_OPTIONS) && isset($this->options[$key]); - }, + fn ($key) => \in_array($key, self::TAG_OPTIONS, true) && isset($this->options[$key]), \ARRAY_FILTER_USE_KEY ); } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableRows.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableRows.php index 97d07726..fb2dc278 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableRows.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableRows.php @@ -16,11 +16,9 @@ */ class TableRows implements \IteratorAggregate { - private \Closure $generator; - - public function __construct(\Closure $generator) - { - $this->generator = $generator; + public function __construct( + private \Closure $generator, + ) { } public function getIterator(): \Traversable diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableStyle.php index bbad98e7..be956c10 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableStyle.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableStyle.php @@ -88,7 +88,7 @@ public function getPaddingChar(): string * * @return $this */ - public function setHorizontalBorderChars(string $outside, string $inside = null): static + public function setHorizontalBorderChars(string $outside, ?string $inside = null): static { $this->horizontalOutsideBorderChar = $outside; $this->horizontalInsideBorderChar = $inside ?? $outside; @@ -113,7 +113,7 @@ public function setHorizontalBorderChars(string $outside, string $inside = null) * * @return $this */ - public function setVerticalBorderChars(string $outside, string $inside = null): static + public function setVerticalBorderChars(string $outside, ?string $inside = null): static { $this->verticalOutsideBorderChar = $outside; $this->verticalInsideBorderChar = $inside ?? $outside; @@ -167,7 +167,7 @@ public function getBorderChars(): array * * @return $this */ - public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null): static + public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, ?string $topLeftBottom = null, ?string $topMidBottom = null, ?string $topRightBottom = null): static { $this->crossingChar = $cross; $this->crossingTopLeftChar = $topLeft; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/ArgvInput.php b/tools/php-cs-fixer/vendor/symfony/console/Input/ArgvInput.php index c0c28bb5..fe25b861 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/ArgvInput.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Input/ArgvInput.php @@ -40,13 +40,21 @@ */ class ArgvInput extends Input { + /** @var list */ private array $tokens; private array $parsed; - public function __construct(array $argv = null, InputDefinition $definition = null) + /** @param list|null $argv */ + public function __construct(?array $argv = null, ?InputDefinition $definition = null) { $argv ??= $_SERVER['argv'] ?? []; + foreach ($argv as $arg) { + if (!\is_scalar($arg) && !$arg instanceof \Stringable) { + throw new RuntimeException(\sprintf('Argument values expected to be all scalars, got "%s".', get_debug_type($arg))); + } + } + // strip the application name array_shift($argv); @@ -55,12 +63,13 @@ public function __construct(array $argv = null, InputDefinition $definition = nu parent::__construct($definition); } - protected function setTokens(array $tokens) + /** @param list $tokens */ + protected function setTokens(array $tokens): void { $this->tokens = $tokens; } - protected function parse() + protected function parse(): void { $parseOptions = true; $this->parsed = $this->tokens; @@ -89,7 +98,7 @@ protected function parseToken(string $token, bool $parseOptions): bool /** * Parses a short option. */ - private function parseShortOption(string $token) + private function parseShortOption(string $token): void { $name = substr($token, 1); @@ -110,13 +119,13 @@ private function parseShortOption(string $token) * * @throws RuntimeException When option given doesn't exist */ - private function parseShortOptionSet(string $name) + private function parseShortOptionSet(string $name): void { $len = \strlen($name); for ($i = 0; $i < $len; ++$i) { if (!$this->definition->hasShortcut($name[$i])) { $encoding = mb_detect_encoding($name, null, true); - throw new RuntimeException(sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding))); + throw new RuntimeException(\sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding))); } $option = $this->definition->getOptionForShortcut($name[$i]); @@ -124,16 +133,16 @@ private function parseShortOptionSet(string $name) $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); break; - } else { - $this->addLongOption($option->getName(), null); } + + $this->addLongOption($option->getName(), null); } } /** * Parses a long option. */ - private function parseLongOption(string $token) + private function parseLongOption(string $token): void { $name = substr($token, 2); @@ -152,7 +161,7 @@ private function parseLongOption(string $token) * * @throws RuntimeException When too many arguments are given */ - private function parseArgument(string $token) + private function parseArgument(string $token): void { $c = \count($this->arguments); @@ -177,14 +186,14 @@ private function parseArgument(string $token) if (\count($all)) { if ($symfonyCommandName) { - $message = sprintf('Too many arguments to "%s" command, expected arguments "%s".', $symfonyCommandName, implode('" "', array_keys($all))); + $message = \sprintf('Too many arguments to "%s" command, expected arguments "%s".', $symfonyCommandName, implode('" "', array_keys($all))); } else { - $message = sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))); + $message = \sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))); } } elseif ($symfonyCommandName) { - $message = sprintf('No arguments expected for "%s" command, got "%s".', $symfonyCommandName, $token); + $message = \sprintf('No arguments expected for "%s" command, got "%s".', $symfonyCommandName, $token); } else { - $message = sprintf('No arguments expected, got "%s".', $token); + $message = \sprintf('No arguments expected, got "%s".', $token); } throw new RuntimeException($message); @@ -196,10 +205,10 @@ private function parseArgument(string $token) * * @throws RuntimeException When option given doesn't exist */ - private function addShortOption(string $shortcut, mixed $value) + private function addShortOption(string $shortcut, mixed $value): void { if (!$this->definition->hasShortcut($shortcut)) { - throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); + throw new RuntimeException(\sprintf('The "-%s" option does not exist.', $shortcut)); } $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); @@ -210,16 +219,16 @@ private function addShortOption(string $shortcut, mixed $value) * * @throws RuntimeException When option given doesn't exist */ - private function addLongOption(string $name, mixed $value) + private function addLongOption(string $name, mixed $value): void { if (!$this->definition->hasOption($name)) { if (!$this->definition->hasNegation($name)) { - throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name)); + throw new RuntimeException(\sprintf('The "--%s" option does not exist.', $name)); } $optionName = $this->definition->negationToName($name); if (null !== $value) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); + throw new RuntimeException(\sprintf('The "--%s" option does not accept a value.', $name)); } $this->options[$optionName] = false; @@ -229,7 +238,7 @@ private function addLongOption(string $name, mixed $value) $option = $this->definition->getOption($name); if (null !== $value && !$option->acceptValue()) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); + throw new RuntimeException(\sprintf('The "--%s" option does not accept a value.', $name)); } if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) { @@ -245,7 +254,7 @@ private function addLongOption(string $name, mixed $value) if (null === $value) { if ($option->isValueRequired()) { - throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name)); + throw new RuntimeException(\sprintf('The "--%s" option requires a value.', $name)); } if (!$option->isArray() && !$option->isValueOptional()) { @@ -342,6 +351,35 @@ public function getParameterOption(string|array $values, string|bool|int|float|a return $default; } + /** + * Returns un-parsed and not validated tokens. + * + * @param bool $strip Whether to return the raw parameters (false) or the values after the command name (true) + * + * @return list + */ + public function getRawTokens(bool $strip = false): array + { + if (!$strip) { + return $this->tokens; + } + + $parameters = []; + $keep = false; + foreach ($this->tokens as $value) { + if (!$keep && $value === $this->getFirstArgument()) { + $keep = true; + + continue; + } + if ($keep) { + $parameters[] = $value; + } + } + + return $parameters; + } + /** * Returns a stringified representation of the args passed to the command. */ diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/ArrayInput.php b/tools/php-cs-fixer/vendor/symfony/console/Input/ArrayInput.php index 02fb4e8e..7335632b 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/ArrayInput.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Input/ArrayInput.php @@ -25,12 +25,10 @@ */ class ArrayInput extends Input { - private array $parameters; - - public function __construct(array $parameters, InputDefinition $definition = null) - { - $this->parameters = $parameters; - + public function __construct( + private array $parameters, + ?InputDefinition $definition = null, + ) { parent::__construct($definition); } @@ -113,7 +111,7 @@ public function __toString(): string return implode(' ', $params); } - protected function parse() + protected function parse(): void { foreach ($this->parameters as $key => $value) { if ('--' === $key) { @@ -134,10 +132,10 @@ protected function parse() * * @throws InvalidOptionException When option given doesn't exist */ - private function addShortOption(string $shortcut, mixed $value) + private function addShortOption(string $shortcut, mixed $value): void { if (!$this->definition->hasShortcut($shortcut)) { - throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); + throw new InvalidOptionException(\sprintf('The "-%s" option does not exist.', $shortcut)); } $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); @@ -149,11 +147,11 @@ private function addShortOption(string $shortcut, mixed $value) * @throws InvalidOptionException When option given doesn't exist * @throws InvalidOptionException When a required value is missing */ - private function addLongOption(string $name, mixed $value) + private function addLongOption(string $name, mixed $value): void { if (!$this->definition->hasOption($name)) { if (!$this->definition->hasNegation($name)) { - throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name)); + throw new InvalidOptionException(\sprintf('The "--%s" option does not exist.', $name)); } $optionName = $this->definition->negationToName($name); @@ -166,7 +164,7 @@ private function addLongOption(string $name, mixed $value) if (null === $value) { if ($option->isValueRequired()) { - throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name)); + throw new InvalidOptionException(\sprintf('The "--%s" option requires a value.', $name)); } if (!$option->isValueOptional()) { @@ -182,10 +180,10 @@ private function addLongOption(string $name, mixed $value) * * @throws InvalidArgumentException When argument given doesn't exist */ - private function addArgument(string|int $name, mixed $value) + private function addArgument(string|int $name, mixed $value): void { if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); } $this->arguments[$name] = $value; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/Input.php b/tools/php-cs-fixer/vendor/symfony/console/Input/Input.php index 7b90713c..d2881c60 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/Input.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Input/Input.php @@ -27,13 +27,14 @@ */ abstract class Input implements InputInterface, StreamableInputInterface { - protected $definition; + protected InputDefinition $definition; + /** @var resource */ protected $stream; - protected $options = []; - protected $arguments = []; - protected $interactive = true; + protected array $options = []; + protected array $arguments = []; + protected bool $interactive = true; - public function __construct(InputDefinition $definition = null) + public function __construct(?InputDefinition $definition = null) { if (null === $definition) { $this->definition = new InputDefinition(); @@ -43,7 +44,7 @@ public function __construct(InputDefinition $definition = null) } } - public function bind(InputDefinition $definition) + public function bind(InputDefinition $definition): void { $this->arguments = []; $this->options = []; @@ -55,19 +56,17 @@ public function bind(InputDefinition $definition) /** * Processes command line arguments. */ - abstract protected function parse(); + abstract protected function parse(): void; - public function validate() + public function validate(): void { $definition = $this->definition; $givenArguments = $this->arguments; - $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { - return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); - }); + $missingArguments = array_filter(array_keys($definition->getArguments()), fn ($argument) => !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired()); if (\count($missingArguments) > 0) { - throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); + throw new RuntimeException(\sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); } } @@ -76,7 +75,7 @@ public function isInteractive(): bool return $this->interactive; } - public function setInteractive(bool $interactive) + public function setInteractive(bool $interactive): void { $this->interactive = $interactive; } @@ -89,16 +88,16 @@ public function getArguments(): array public function getArgument(string $name): mixed { if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); } return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault(); } - public function setArgument(string $name, mixed $value) + public function setArgument(string $name, mixed $value): void { if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); } $this->arguments[$name] = $value; @@ -125,20 +124,20 @@ public function getOption(string $name): mixed } if (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" option does not exist.', $name)); } return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); } - public function setOption(string $name, mixed $value) + public function setOption(string $name, mixed $value): void { if ($this->definition->hasNegation($name)) { $this->options[$this->definition->negationToName($name)] = !$value; return; } elseif (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" option does not exist.', $name)); } $this->options[$name] = $value; @@ -157,11 +156,17 @@ public function escapeToken(string $token): string return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); } - public function setStream($stream) + /** + * @param resource $stream + */ + public function setStream($stream): void { $this->stream = $stream; } + /** + * @return resource + */ public function getStream() { return $this->stream; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/InputArgument.php b/tools/php-cs-fixer/vendor/symfony/console/Input/InputArgument.php index a130c412..6fbb64ed 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/InputArgument.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Input/InputArgument.php @@ -25,37 +25,47 @@ */ class InputArgument { + /** + * Providing an argument is required (e.g. just 'app:foo' is not allowed). + */ public const REQUIRED = 1; + + /** + * Providing an argument is optional (e.g. 'app:foo' and 'app:foo bar' are both allowed). This is the default behavior of arguments. + */ public const OPTIONAL = 2; + + /** + * The argument accepts multiple values and turn them into an array (e.g. 'app:foo bar baz' will result in value ['bar', 'baz']). + */ public const IS_ARRAY = 4; - private string $name; private int $mode; - private string|int|bool|array|null|float $default; - private array|\Closure $suggestedValues; - private string $description; + private string|int|bool|array|float|null $default; /** * @param string $name The argument name - * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL + * @param int-mask-of|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY * @param string $description A description text * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @throws InvalidArgumentException When argument mode is not valid */ - public function __construct(string $name, int $mode = null, string $description = '', string|bool|int|float|array $default = null, \Closure|array $suggestedValues = []) - { + public function __construct( + private string $name, + ?int $mode = null, + private string $description = '', + string|bool|int|float|array|null $default = null, + private \Closure|array $suggestedValues = [], + ) { if (null === $mode) { $mode = self::OPTIONAL; - } elseif ($mode > 7 || $mode < 1) { - throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); + } elseif ($mode >= (self::IS_ARRAY << 1) || $mode < 1) { + throw new InvalidArgumentException(\sprintf('Argument mode "%s" is not valid.', $mode)); } - $this->name = $name; $this->mode = $mode; - $this->description = $description; - $this->suggestedValues = $suggestedValues; $this->setDefault($default); } @@ -90,14 +100,9 @@ public function isArray(): bool /** * Sets the default value. - * - * @throws LogicException When incorrect default value is given */ - public function setDefault(string|bool|int|float|array $default = null) + public function setDefault(string|bool|int|float|array|null $default): void { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } if ($this->isRequired() && null !== $default) { throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); } @@ -121,13 +126,16 @@ public function getDefault(): string|bool|int|float|array|null return $this->default; } + /** + * Returns true if the argument has values for input completion. + */ public function hasCompletion(): bool { return [] !== $this->suggestedValues; } /** - * Adds suggestions to $suggestions for the current completion input. + * Supplies suggestions when command resolves possible completion options for input. * * @see Command::complete() */ @@ -135,7 +143,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti { $values = $this->suggestedValues; if ($values instanceof \Closure && !\is_array($values = $values($input))) { - throw new LogicException(sprintf('Closure for argument "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); + throw new LogicException(\sprintf('Closure for argument "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); } if ($values) { $suggestions->suggestValues($values); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/InputAwareInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Input/InputAwareInterface.php index 5a288de5..ba4664cd 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/InputAwareInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Input/InputAwareInterface.php @@ -22,5 +22,5 @@ interface InputAwareInterface /** * Sets the Console Input. */ - public function setInput(InputInterface $input); + public function setInput(InputInterface $input): void; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/InputDefinition.php b/tools/php-cs-fixer/vendor/symfony/console/Input/InputDefinition.php index f4b14a1c..a8b006d4 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/InputDefinition.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Input/InputDefinition.php @@ -47,7 +47,7 @@ public function __construct(array $definition = []) /** * Sets the definition of the input. */ - public function setDefinition(array $definition) + public function setDefinition(array $definition): void { $arguments = []; $options = []; @@ -68,7 +68,7 @@ public function setDefinition(array $definition) * * @param InputArgument[] $arguments An array of InputArgument objects */ - public function setArguments(array $arguments = []) + public function setArguments(array $arguments = []): void { $this->arguments = []; $this->requiredCount = 0; @@ -82,7 +82,7 @@ public function setArguments(array $arguments = []) * * @param InputArgument[] $arguments An array of InputArgument objects */ - public function addArguments(?array $arguments = []) + public function addArguments(?array $arguments = []): void { if (null !== $arguments) { foreach ($arguments as $argument) { @@ -94,18 +94,18 @@ public function addArguments(?array $arguments = []) /** * @throws LogicException When incorrect argument is given */ - public function addArgument(InputArgument $argument) + public function addArgument(InputArgument $argument): void { if (isset($this->arguments[$argument->getName()])) { - throw new LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); + throw new LogicException(\sprintf('An argument with name "%s" already exists.', $argument->getName())); } if (null !== $this->lastArrayArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an array argument "%s".', $argument->getName(), $this->lastArrayArgument->getName())); + throw new LogicException(\sprintf('Cannot add a required argument "%s" after an array argument "%s".', $argument->getName(), $this->lastArrayArgument->getName())); } if ($argument->isRequired() && null !== $this->lastOptionalArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an optional one "%s".', $argument->getName(), $this->lastOptionalArgument->getName())); + throw new LogicException(\sprintf('Cannot add a required argument "%s" after an optional one "%s".', $argument->getName(), $this->lastOptionalArgument->getName())); } if ($argument->isArray()) { @@ -129,7 +129,7 @@ public function addArgument(InputArgument $argument) public function getArgument(string|int $name): InputArgument { if (!$this->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); } $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; @@ -191,7 +191,7 @@ public function getArgumentDefaults(): array * * @param InputOption[] $options An array of InputOption objects */ - public function setOptions(array $options = []) + public function setOptions(array $options = []): void { $this->options = []; $this->shortcuts = []; @@ -204,7 +204,7 @@ public function setOptions(array $options = []) * * @param InputOption[] $options An array of InputOption objects */ - public function addOptions(array $options = []) + public function addOptions(array $options = []): void { foreach ($options as $option) { $this->addOption($option); @@ -214,19 +214,19 @@ public function addOptions(array $options = []) /** * @throws LogicException When option given already exist */ - public function addOption(InputOption $option) + public function addOption(InputOption $option): void { if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); + throw new LogicException(\sprintf('An option named "%s" already exists.', $option->getName())); } if (isset($this->negations[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); + throw new LogicException(\sprintf('An option named "%s" already exists.', $option->getName())); } if ($option->getShortcut()) { foreach (explode('|', $option->getShortcut()) as $shortcut) { if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) { - throw new LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut)); + throw new LogicException(\sprintf('An option with shortcut "%s" already exists.', $shortcut)); } } } @@ -241,7 +241,7 @@ public function addOption(InputOption $option) if ($option->isNegatable()) { $negatedName = 'no-'.$option->getName(); if (isset($this->options[$negatedName])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $negatedName)); + throw new LogicException(\sprintf('An option named "%s" already exists.', $negatedName)); } $this->negations[$negatedName] = $option->getName(); } @@ -255,7 +255,7 @@ public function addOption(InputOption $option) public function getOption(string $name): InputOption { if (!$this->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "--%s" option does not exist.', $name)); } return $this->options[$name]; @@ -329,7 +329,7 @@ public function getOptionDefaults(): array public function shortcutToName(string $shortcut): string { if (!isset($this->shortcuts[$shortcut])) { - throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); + throw new InvalidArgumentException(\sprintf('The "-%s" option does not exist.', $shortcut)); } return $this->shortcuts[$shortcut]; @@ -345,7 +345,7 @@ public function shortcutToName(string $shortcut): string public function negationToName(string $negation): string { if (!isset($this->negations[$negation])) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $negation)); + throw new InvalidArgumentException(\sprintf('The "--%s" option does not exist.', $negation)); } return $this->negations[$negation]; @@ -364,7 +364,7 @@ public function getSynopsis(bool $short = false): string foreach ($this->getOptions() as $option) { $value = ''; if ($option->acceptValue()) { - $value = sprintf( + $value = \sprintf( ' %s%s%s', $option->isValueOptional() ? '[' : '', strtoupper($option->getName()), @@ -372,9 +372,9 @@ public function getSynopsis(bool $short = false): string ); } - $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; - $negation = $option->isNegatable() ? sprintf('|--no-%s', $option->getName()) : ''; - $elements[] = sprintf('[%s--%s%s%s]', $shortcut, $option->getName(), $value, $negation); + $shortcut = $option->getShortcut() ? \sprintf('-%s|', $option->getShortcut()) : ''; + $negation = $option->isNegatable() ? \sprintf('|--no-%s', $option->getName()) : ''; + $elements[] = \sprintf('[%s--%s%s%s]', $shortcut, $option->getName(), $value, $negation); } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/InputInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Input/InputInterface.php index 3af991a7..c177d960 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/InputInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Input/InputInterface.php @@ -18,9 +18,6 @@ * InputInterface is the interface implemented by all input classes. * * @author Fabien Potencier - * - * @method string __toString() Returns a stringified representation of the args passed to the command. - * InputArguments MUST be escaped as well as the InputOption values passed to the command. */ interface InputInterface { @@ -53,24 +50,22 @@ public function hasParameterOption(string|array $values, bool $onlyParams = fals * @param string|array $values The value(s) to look for in the raw parameters (can be an array) * @param string|bool|int|float|array|null $default The default value to return if no result is found * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - * - * @return mixed */ - public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false); + public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed; /** * Binds the current Input instance with the given arguments and options. * * @throws RuntimeException */ - public function bind(InputDefinition $definition); + public function bind(InputDefinition $definition): void; /** * Validates the input. * * @throws RuntimeException When not enough arguments are given */ - public function validate(); + public function validate(): void; /** * Returns all the given arguments merged with the default values. @@ -82,18 +77,16 @@ public function getArguments(): array; /** * Returns the argument value for a given argument name. * - * @return mixed - * * @throws InvalidArgumentException When argument given doesn't exist */ - public function getArgument(string $name); + public function getArgument(string $name): mixed; /** * Sets an argument value by name. * * @throws InvalidArgumentException When argument given doesn't exist */ - public function setArgument(string $name, mixed $value); + public function setArgument(string $name, mixed $value): void; /** * Returns true if an InputArgument object exists by name or position. @@ -110,18 +103,16 @@ public function getOptions(): array; /** * Returns the option value for a given option name. * - * @return mixed - * * @throws InvalidArgumentException When option given doesn't exist */ - public function getOption(string $name); + public function getOption(string $name): mixed; /** * Sets an option value by name. * * @throws InvalidArgumentException When option given doesn't exist */ - public function setOption(string $name, mixed $value); + public function setOption(string $name, mixed $value): void; /** * Returns true if an InputOption object exists by name. @@ -136,5 +127,12 @@ public function isInteractive(): bool; /** * Sets the input interactivity. */ - public function setInteractive(bool $interactive); + public function setInteractive(bool $interactive): void; + + /** + * Returns a stringified representation of the args passed to the command. + * + * InputArguments MUST be escaped as well as the InputOption values passed to the command. + */ + public function __toString(): string; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/InputOption.php b/tools/php-cs-fixer/vendor/symfony/console/Input/InputOption.php index 9a7032a0..25fb9178 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/InputOption.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Input/InputOption.php @@ -46,36 +46,40 @@ class InputOption public const VALUE_IS_ARRAY = 8; /** - * The option may have either positive or negative value (e.g. --ansi or --no-ansi). + * The option allows passing a negated variant (e.g. --ansi or --no-ansi). */ public const VALUE_NEGATABLE = 16; private string $name; - private string|array|null $shortcut; + private ?string $shortcut; private int $mode; - private string|int|bool|array|null|float $default; - private array|\Closure $suggestedValues; - private string $description; + private string|int|bool|array|float|null $default; /** * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the VALUE_* constants + * @param int-mask-of|null $mode The option mode: One of the VALUE_* constants * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @throws InvalidArgumentException If option mode is invalid or incompatible */ - public function __construct(string $name, string|array $shortcut = null, int $mode = null, string $description = '', string|bool|int|float|array $default = null, array|\Closure $suggestedValues = []) - { + public function __construct( + string $name, + string|array|null $shortcut = null, + ?int $mode = null, + private string $description = '', + string|bool|int|float|array|null $default = null, + private array|\Closure $suggestedValues = [], + ) { if (str_starts_with($name, '--')) { $name = substr($name, 2); } - if (empty($name)) { + if (!$name) { throw new InvalidArgumentException('An option name cannot be empty.'); } - if (empty($shortcut)) { + if ('' === $shortcut || [] === $shortcut || false === $shortcut) { $shortcut = null; } @@ -84,10 +88,10 @@ public function __construct(string $name, string|array $shortcut = null, int $mo $shortcut = implode('|', $shortcut); } $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); - $shortcuts = array_filter($shortcuts); + $shortcuts = array_filter($shortcuts, 'strlen'); $shortcut = implode('|', $shortcuts); - if (empty($shortcut)) { + if ('' === $shortcut) { throw new InvalidArgumentException('An option shortcut cannot be empty.'); } } @@ -95,14 +99,12 @@ public function __construct(string $name, string|array $shortcut = null, int $mo if (null === $mode) { $mode = self::VALUE_NONE; } elseif ($mode >= (self::VALUE_NEGATABLE << 1) || $mode < 1) { - throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); + throw new InvalidArgumentException(\sprintf('Option mode "%s" is not valid.', $mode)); } $this->name = $name; $this->shortcut = $shortcut; $this->mode = $mode; - $this->description = $description; - $this->suggestedValues = $suggestedValues; if ($suggestedValues && !$this->acceptValue()) { throw new LogicException('Cannot set suggested values if the option does not accept a value.'); @@ -173,16 +175,21 @@ public function isArray(): bool return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); } + /** + * Returns true if the option allows passing a negated variant. + * + * @return bool true if mode is self::VALUE_NEGATABLE, false otherwise + */ public function isNegatable(): bool { return self::VALUE_NEGATABLE === (self::VALUE_NEGATABLE & $this->mode); } - public function setDefault(string|bool|int|float|array $default = null) + /** + * Sets the default value. + */ + public function setDefault(string|bool|int|float|array|null $default): void { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); } @@ -214,13 +221,16 @@ public function getDescription(): string return $this->description; } + /** + * Returns true if the option has values for input completion. + */ public function hasCompletion(): bool { return [] !== $this->suggestedValues; } /** - * Adds suggestions to $suggestions for the current completion input. + * Supplies suggestions when command resolves possible completion options for input. * * @see Command::complete() */ @@ -228,7 +238,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti { $values = $this->suggestedValues; if ($values instanceof \Closure && !\is_array($values = $values($input))) { - throw new LogicException(sprintf('Closure for option "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); + throw new LogicException(\sprintf('Closure for option "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); } if ($values) { $suggestions->suggestValues($values); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/StreamableInputInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Input/StreamableInputInterface.php index d7e462f2..4a0dc017 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/StreamableInputInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Input/StreamableInputInterface.php @@ -26,7 +26,7 @@ interface StreamableInputInterface extends InputInterface * * @param resource $stream The input stream */ - public function setStream($stream); + public function setStream($stream): void; /** * Returns the input stream. diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/StringInput.php b/tools/php-cs-fixer/vendor/symfony/console/Input/StringInput.php index 82bd2144..a70f048f 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/StringInput.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Input/StringInput.php @@ -24,10 +24,6 @@ */ class StringInput extends ArgvInput { - /** - * @deprecated since Symfony 6.1 - */ - public const REGEX_STRING = '([^\s]+?)(?:\s|(? + * * @throws InvalidArgumentException When unable to parse input (should never happen) */ private function tokenize(string $input): array @@ -72,7 +70,7 @@ private function tokenize(string $input): array $token .= $match[1]; } else { // should never happen - throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ...".', substr($input, $cursor, 10))); + throw new InvalidArgumentException(\sprintf('Unable to parse input near "... %s ...".', substr($input, $cursor, 10))); } $cursor += \strlen($match[0]); diff --git a/tools/php-cs-fixer/vendor/symfony/console/Logger/ConsoleLogger.php b/tools/php-cs-fixer/vendor/symfony/console/Logger/ConsoleLogger.php index fddef50c..a6ef49ea 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Logger/ConsoleLogger.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Logger/ConsoleLogger.php @@ -29,7 +29,6 @@ class ConsoleLogger extends AbstractLogger public const INFO = 'info'; public const ERROR = 'error'; - private OutputInterface $output; private array $verbosityLevelMap = [ LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, @@ -52,9 +51,11 @@ class ConsoleLogger extends AbstractLogger ]; private bool $errored = false; - public function __construct(OutputInterface $output, array $verbosityLevelMap = [], array $formatLevelMap = []) - { - $this->output = $output; + public function __construct( + private OutputInterface $output, + array $verbosityLevelMap = [], + array $formatLevelMap = [], + ) { $this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap; $this->formatLevelMap = $formatLevelMap + $this->formatLevelMap; } @@ -62,7 +63,7 @@ public function __construct(OutputInterface $output, array $verbosityLevelMap = public function log($level, $message, array $context = []): void { if (!isset($this->verbosityLevelMap[$level])) { - throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); + throw new InvalidArgumentException(\sprintf('The log level "%s" does not exist.', $level)); } $output = $this->output; @@ -78,7 +79,7 @@ public function log($level, $message, array $context = []): void // the if condition check isn't necessary -- it's the same one that $output will do internally anyway. // We only do it for efficiency here as the message formatting is relatively expensive. if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) { - $output->writeln(sprintf('<%1$s>[%2$s] %3$s', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]); + $output->writeln(\sprintf('<%1$s>[%2$s] %3$s', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]); } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandContext.php b/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandContext.php new file mode 100644 index 00000000..2ee5415c --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandContext.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Messenger; + +/** + * @author Kevin Bond + */ +final class RunCommandContext +{ + public function __construct( + public readonly RunCommandMessage $message, + public readonly int $exitCode, + public readonly string $output, + ) { + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessage.php b/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessage.php new file mode 100644 index 00000000..b530c438 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessage.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Messenger; + +use Symfony\Component\Console\Exception\RunCommandFailedException; + +/** + * @author Kevin Bond + */ +class RunCommandMessage implements \Stringable +{ + /** + * @param bool $throwOnFailure If the command has a non-zero exit code, throw {@see RunCommandFailedException} + * @param bool $catchExceptions @see Application::setCatchExceptions() + */ + public function __construct( + public readonly string $input, + public readonly bool $throwOnFailure = true, + public readonly bool $catchExceptions = false, + ) { + } + + public function __toString(): string + { + return $this->input; + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessageHandler.php b/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessageHandler.php new file mode 100644 index 00000000..0fdf7d01 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessageHandler.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Messenger; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\RunCommandFailedException; +use Symfony\Component\Console\Input\StringInput; +use Symfony\Component\Console\Output\BufferedOutput; + +/** + * @author Kevin Bond + */ +final class RunCommandMessageHandler +{ + public function __construct( + private readonly Application $application, + ) { + } + + public function __invoke(RunCommandMessage $message): RunCommandContext + { + $input = new StringInput($message->input); + $output = new BufferedOutput(); + + $this->application->setCatchExceptions($message->catchExceptions); + + try { + $exitCode = $this->application->run($input, $output); + } catch (\Throwable $e) { + throw new RunCommandFailedException($e, new RunCommandContext($message, Command::FAILURE, $output->fetch())); + } + + if ($message->throwOnFailure && Command::SUCCESS !== $exitCode) { + throw new RunCommandFailedException(\sprintf('Command "%s" exited with code "%s".', $message->input, $exitCode), new RunCommandContext($message, $exitCode, $output->fetch())); + } + + return new RunCommandContext($message, $exitCode, $output->fetch()); + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/AnsiColorMode.php b/tools/php-cs-fixer/vendor/symfony/console/Output/AnsiColorMode.php index c6cc5c12..0e1422a2 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/AnsiColorMode.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Output/AnsiColorMode.php @@ -26,7 +26,7 @@ enum AnsiColorMode case Ansi4; /* - * 8-bit Ansi colors (240 differents colors + 16 duplicate color codes, ensuring backward compatibility). + * 8-bit Ansi colors (240 different colors + 16 duplicate color codes, ensuring backward compatibility). * Output syntax is: "ESC[38;5;${foreGroundColorcode};48;5;${backGroundColorcode}m" * Should be compatible with most terminals. */ @@ -51,7 +51,7 @@ public function convertFromHexToAnsiColorCode(string $hexColor): string } if (6 !== \strlen($hexColor)) { - throw new InvalidArgumentException(sprintf('Invalid "#%s" color.', $hexColor)); + throw new InvalidArgumentException(\sprintf('Invalid "#%s" color.', $hexColor)); } $color = hexdec($hexColor); @@ -62,8 +62,8 @@ public function convertFromHexToAnsiColorCode(string $hexColor): string return match ($this) { self::Ansi4 => (string) $this->convertFromRGB($r, $g, $b), - self::Ansi8 => '8;5;'.((string) $this->convertFromRGB($r, $g, $b)), - self::Ansi24 => sprintf('8;2;%d;%d;%d', $r, $g, $b) + self::Ansi8 => '8;5;'.$this->convertFromRGB($r, $g, $b), + self::Ansi24 => \sprintf('8;2;%d;%d;%d', $r, $g, $b), }; } @@ -72,31 +72,13 @@ private function convertFromRGB(int $r, int $g, int $b): int return match ($this) { self::Ansi4 => $this->degradeHexColorToAnsi4($r, $g, $b), self::Ansi8 => $this->degradeHexColorToAnsi8($r, $g, $b), - default => throw new InvalidArgumentException("RGB cannot be converted to {$this->name}.") + default => throw new InvalidArgumentException("RGB cannot be converted to {$this->name}."), }; } private function degradeHexColorToAnsi4(int $r, int $g, int $b): int { - if (0 === round($this->getSaturation($r, $g, $b) / 50)) { - return 0; - } - - return (int) ((round($b / 255) << 2) | (round($g / 255) << 1) | round($r / 255)); - } - - private function getSaturation(int $r, int $g, int $b): int - { - $r = $r / 255; - $g = $g / 255; - $b = $b / 255; - $v = max($r, $g, $b); - - if (0 === $diff = $v - min($r, $g, $b)) { - return 0; - } - - return (int) ((int) $diff * 100 / $v); + return round($b / 255) << 2 | (round($g / 255) << 1) | round($r / 255); } /** @@ -114,11 +96,11 @@ private function degradeHexColorToAnsi8(int $r, int $g, int $b): int } return (int) round(($r - 8) / 247 * 24) + 232; - } else { - return 16 + - (36 * (int) round($r / 255 * 5)) + - (6 * (int) round($g / 255 * 5)) + - (int) round($b / 255 * 5); } + + return 16 + + (36 * (int) round($r / 255 * 5)) + + (6 * (int) round($g / 255 * 5)) + + (int) round($b / 255 * 5); } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/BufferedOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/BufferedOutput.php index 94d4e414..3c8d3906 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/BufferedOutput.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Output/BufferedOutput.php @@ -29,7 +29,7 @@ public function fetch(): string return $content; } - protected function doWrite(string $message, bool $newline) + protected function doWrite(string $message, bool $newline): void { $this->buffer .= $message; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutput.php index e3aa92c7..2ad3dbcf 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutput.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutput.php @@ -37,7 +37,7 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) */ - public function __construct(int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) + public function __construct(int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null) { parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter); @@ -64,19 +64,19 @@ public function section(): ConsoleSectionOutput return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); } - public function setDecorated(bool $decorated) + public function setDecorated(bool $decorated): void { parent::setDecorated($decorated); $this->stderr->setDecorated($decorated); } - public function setFormatter(OutputFormatterInterface $formatter) + public function setFormatter(OutputFormatterInterface $formatter): void { parent::setFormatter($formatter); $this->stderr->setFormatter($formatter); } - public function setVerbosity(int $level) + public function setVerbosity(int $level): void { parent::setVerbosity($level); $this->stderr->setVerbosity($level); @@ -87,7 +87,7 @@ public function getErrorOutput(): OutputInterface return $this->stderr; } - public function setErrorOutput(OutputInterface $error) + public function setErrorOutput(OutputInterface $error): void { $this->stderr = $error; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutputInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutputInterface.php index 6b4babc6..1f8f147c 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutputInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutputInterface.php @@ -24,7 +24,7 @@ interface ConsoleOutputInterface extends OutputInterface */ public function getErrorOutput(): OutputInterface; - public function setErrorOutput(OutputInterface $error); + public function setErrorOutput(OutputInterface $error): void; public function section(): ConsoleSectionOutput; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleSectionOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleSectionOutput.php index c813c811..44728dfd 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleSectionOutput.php @@ -48,9 +48,9 @@ public function __construct($stream, array &$sections, int $verbosity, bool $dec public function setMaxHeight(int $maxHeight): void { // when changing max height, clear output of current section and redraw again with the new height - $existingContent = $this->popStreamContentUntilCurrentSection($this->maxHeight ? min($this->maxHeight, $this->lines) : $this->lines); - + $previousMaxHeight = $this->maxHeight; $this->maxHeight = $maxHeight; + $existingContent = $this->popStreamContentUntilCurrentSection($previousMaxHeight ? min($previousMaxHeight, $this->lines) : $this->lines); parent::doWrite($this->getVisibleContent(), false); parent::doWrite($existingContent, false); @@ -61,9 +61,9 @@ public function setMaxHeight(int $maxHeight): void * * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared */ - public function clear(int $lines = null) + public function clear(?int $lines = null): void { - if (empty($this->content) || !$this->isDecorated()) { + if (!$this->content || !$this->isDecorated()) { return; } @@ -82,7 +82,7 @@ public function clear(int $lines = null) /** * Overwrites the previous output with a new message. */ - public function overwrite(string|iterable $message) + public function overwrite(string|iterable $message): void { $this->clear(); $this->writeln($message); @@ -115,8 +115,7 @@ public function addContent(string $input, bool $newline = true): int // re-add the line break (that has been removed in the above `explode()` for // - every line that is not the last line // - if $newline is required, also add it to the last line - // - if it's not new line, but input ending with `\PHP_EOL` - if ($i < $count || $newline || str_ends_with($input, \PHP_EOL)) { + if ($i < $count || $newline) { $lineContent .= \PHP_EOL; } @@ -153,14 +152,20 @@ public function addContent(string $input, bool $newline = true): int /** * @internal */ - public function addNewLineOfInputSubmit() + public function addNewLineOfInputSubmit(): void { $this->content[] = \PHP_EOL; ++$this->lines; } - protected function doWrite(string $message, bool $newline) + protected function doWrite(string $message, bool $newline): void { + // Simulate newline behavior for consistent output formatting, avoiding extra logic + if (!$newline && str_ends_with($message, \PHP_EOL)) { + $message = substr($message, 0, -\strlen(\PHP_EOL)); + $newline = true; + } + if (!$this->isDecorated()) { parent::doWrite($message, $newline); @@ -206,7 +211,7 @@ private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFr break; } - $numberOfLinesToClear += $section->lines; + $numberOfLinesToClear += $section->maxHeight ? min($section->lines, $section->maxHeight) : $section->lines; if ('' !== $sectionContent = $section->getVisibleContent()) { if (!str_ends_with($sectionContent, \PHP_EOL)) { $sectionContent .= \PHP_EOL; @@ -217,7 +222,7 @@ private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFr if ($numberOfLinesToClear > 0) { // move cursor up n lines - parent::doWrite(sprintf("\x1b[%dA", $numberOfLinesToClear), false); + parent::doWrite(\sprintf("\x1b[%dA", $numberOfLinesToClear), false); // erase to end of screen parent::doWrite("\x1b[0J", false); } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/NullOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/NullOutput.php index 4884cbad..8bec706d 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/NullOutput.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Output/NullOutput.php @@ -26,7 +26,7 @@ class NullOutput implements OutputInterface { private NullOutputFormatter $formatter; - public function setFormatter(OutputFormatterInterface $formatter) + public function setFormatter(OutputFormatterInterface $formatter): void { // do nothing } @@ -37,7 +37,7 @@ public function getFormatter(): OutputFormatterInterface return $this->formatter ??= new NullOutputFormatter(); } - public function setDecorated(bool $decorated) + public function setDecorated(bool $decorated): void { // do nothing } @@ -47,21 +47,26 @@ public function isDecorated(): bool return false; } - public function setVerbosity(int $level) + public function setVerbosity(int $level): void { // do nothing } public function getVerbosity(): int { - return self::VERBOSITY_QUIET; + return self::VERBOSITY_SILENT; } - public function isQuiet(): bool + public function isSilent(): bool { return true; } + public function isQuiet(): bool + { + return false; + } + public function isVerbose(): bool { return false; @@ -77,12 +82,12 @@ public function isDebug(): bool return false; } - public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) + public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL): void { // do nothing } - public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) + public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL): void { // do nothing } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/Output.php b/tools/php-cs-fixer/vendor/symfony/console/Output/Output.php index 4cb71acb..32e6cb24 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/Output.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Output/Output.php @@ -17,13 +17,14 @@ /** * Base class for output classes. * - * There are five levels of verbosity: + * There are six levels of verbosity: * * * normal: no option passed (normal output) * * verbose: -v (more output) * * very verbose: -vv (highly extended output) * * debug: -vvv (all debug output) - * * quiet: -q (no output) + * * quiet: -q (only output errors) + * * silent: --silent (no output) * * @author Fabien Potencier */ @@ -37,14 +38,14 @@ abstract class Output implements OutputInterface * @param bool $decorated Whether to decorate messages * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) */ - public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) + public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null) { $this->verbosity = $verbosity ?? self::VERBOSITY_NORMAL; $this->formatter = $formatter ?? new OutputFormatter(); $this->formatter->setDecorated($decorated); } - public function setFormatter(OutputFormatterInterface $formatter) + public function setFormatter(OutputFormatterInterface $formatter): void { $this->formatter = $formatter; } @@ -54,7 +55,7 @@ public function getFormatter(): OutputFormatterInterface return $this->formatter; } - public function setDecorated(bool $decorated) + public function setDecorated(bool $decorated): void { $this->formatter->setDecorated($decorated); } @@ -64,7 +65,7 @@ public function isDecorated(): bool return $this->formatter->isDecorated(); } - public function setVerbosity(int $level) + public function setVerbosity(int $level): void { $this->verbosity = $level; } @@ -74,6 +75,11 @@ public function getVerbosity(): int return $this->verbosity; } + public function isSilent(): bool + { + return self::VERBOSITY_SILENT === $this->verbosity; + } + public function isQuiet(): bool { return self::VERBOSITY_QUIET === $this->verbosity; @@ -94,12 +100,12 @@ public function isDebug(): bool return self::VERBOSITY_DEBUG <= $this->verbosity; } - public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) + public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL): void { $this->write($messages, true, $options); } - public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) + public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL): void { if (!is_iterable($messages)) { $messages = [$messages]; @@ -134,5 +140,5 @@ public function write(string|iterable $messages, bool $newline = false, int $opt /** * Writes a message to the output. */ - abstract protected function doWrite(string $message, bool $newline); + abstract protected function doWrite(string $message, bool $newline): void; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/OutputInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Output/OutputInterface.php index bc927c51..969a3b02 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/OutputInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Output/OutputInterface.php @@ -17,9 +17,12 @@ * OutputInterface is the interface implemented by all Output classes. * * @author Fabien Potencier + * + * @method bool isSilent() */ interface OutputInterface { + public const VERBOSITY_SILENT = 8; public const VERBOSITY_QUIET = 16; public const VERBOSITY_NORMAL = 32; public const VERBOSITY_VERBOSE = 64; @@ -37,7 +40,7 @@ interface OutputInterface * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ - public function write(string|iterable $messages, bool $newline = false, int $options = 0); + public function write(string|iterable $messages, bool $newline = false, int $options = 0): void; /** * Writes a message to the output and adds a newline at the end. @@ -45,15 +48,19 @@ public function write(string|iterable $messages, bool $newline = false, int $opt * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ - public function writeln(string|iterable $messages, int $options = 0); + public function writeln(string|iterable $messages, int $options = 0): void; /** * Sets the verbosity of the output. + * + * @param self::VERBOSITY_* $level */ - public function setVerbosity(int $level); + public function setVerbosity(int $level): void; /** * Gets the current verbosity of the output. + * + * @return self::VERBOSITY_* */ public function getVerbosity(): int; @@ -80,14 +87,14 @@ public function isDebug(): bool; /** * Sets the decorated flag. */ - public function setDecorated(bool $decorated); + public function setDecorated(bool $decorated): void; /** * Gets the decorated flag. */ public function isDecorated(): bool; - public function setFormatter(OutputFormatterInterface $formatter); + public function setFormatter(OutputFormatterInterface $formatter): void; /** * Returns current output formatter instance. diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/StreamOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/StreamOutput.php index 9ec524e4..ce5a825e 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/StreamOutput.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Output/StreamOutput.php @@ -29,6 +29,7 @@ */ class StreamOutput extends Output { + /** @var resource */ private $stream; /** @@ -39,7 +40,7 @@ class StreamOutput extends Output * * @throws InvalidArgumentException When first argument is not a real stream */ - public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) + public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null) { if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); @@ -62,7 +63,7 @@ public function getStream() return $this->stream; } - protected function doWrite(string $message, bool $newline) + protected function doWrite(string $message, bool $newline): void { if ($newline) { $message .= \PHP_EOL; @@ -89,22 +90,38 @@ protected function doWrite(string $message, bool $newline) protected function hasColorSupport(): bool { // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { + if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) { return false; } - if ('Hyper' === getenv('TERM_PROGRAM')) { + // Follow https://force-color.org/ + if ('' !== (($_SERVER['FORCE_COLOR'] ?? getenv('FORCE_COLOR'))[0] ?? '')) { return true; } - if (\DIRECTORY_SEPARATOR === '\\') { - return (\function_exists('sapi_windows_vt100_support') - && @sapi_windows_vt100_support($this->stream)) - || false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); + // Detect msysgit/mingw and assume this is a tty because detection + // does not work correctly, see https://github.com/composer/composer/issues/9690 + if (!@stream_isatty($this->stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) { + return false; + } + + if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($this->stream)) { + return true; + } + + if ('Hyper' === getenv('TERM_PROGRAM') + || false !== getenv('COLORTERM') + || false !== getenv('ANSICON') + || 'ON' === getenv('ConEmuANSI') + ) { + return true; + } + + if ('dumb' === $term = (string) getenv('TERM')) { + return false; } - return stream_isatty($this->stream); + // See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157 + return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term); } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/TrimmedBufferOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/TrimmedBufferOutput.php index 1ca5a13e..33db072c 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Output/TrimmedBufferOutput.php @@ -24,10 +24,10 @@ class TrimmedBufferOutput extends Output private int $maxLength; private string $buffer = ''; - public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) + public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null) { if ($maxLength <= 0) { - throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); + throw new InvalidArgumentException(\sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); } parent::__construct($verbosity, $decorated, $formatter); @@ -45,7 +45,7 @@ public function fetch(): string return $content; } - protected function doWrite(string $message, bool $newline) + protected function doWrite(string $message, bool $newline): void { $this->buffer .= $message; @@ -53,6 +53,6 @@ protected function doWrite(string $message, bool $newline) $this->buffer .= \PHP_EOL; } - $this->buffer = substr($this->buffer, 0 - $this->maxLength); + $this->buffer = substr($this->buffer, -$this->maxLength); } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Question/ChoiceQuestion.php b/tools/php-cs-fixer/vendor/symfony/console/Question/ChoiceQuestion.php index e449ff68..36c240d3 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Question/ChoiceQuestion.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Question/ChoiceQuestion.php @@ -20,25 +20,26 @@ */ class ChoiceQuestion extends Question { - private array $choices; private bool $multiselect = false; private string $prompt = ' > '; private string $errorMessage = 'Value "%s" is invalid'; /** - * @param string $question The question to ask to the user - * @param array $choices The list of available choices - * @param mixed $default The default answer to return + * @param string $question The question to ask to the user + * @param array $choices The list of available choices + * @param string|bool|int|float|null $default The default answer to return */ - public function __construct(string $question, array $choices, mixed $default = null) - { + public function __construct( + string $question, + private array $choices, + string|bool|int|float|null $default = null, + ) { if (!$choices) { throw new \LogicException('Choice question must have at least 1 choice available.'); } parent::__construct($question, $default); - $this->choices = $choices; $this->setValidator($this->getDefaultValidator()); $this->setAutocompleterValues($choices); } @@ -120,7 +121,7 @@ private function getDefaultValidator(): callable if ($multiselect) { // Check for a separated comma values if (!preg_match('/^[^,]+(?:,[^,]+)*$/', (string) $selected, $matches)) { - throw new InvalidArgumentException(sprintf($errorMessage, $selected)); + throw new InvalidArgumentException(\sprintf($errorMessage, $selected)); } $selectedChoices = explode(',', (string) $selected); @@ -144,7 +145,7 @@ private function getDefaultValidator(): callable } if (\count($results) > 1) { - throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results))); + throw new InvalidArgumentException(\sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results))); } $result = array_search($value, $choices); @@ -160,7 +161,7 @@ private function getDefaultValidator(): callable } if (false === $result) { - throw new InvalidArgumentException(sprintf($errorMessage, $value)); + throw new InvalidArgumentException(\sprintf($errorMessage, $value)); } // For associative choices, consistently return the key as string: diff --git a/tools/php-cs-fixer/vendor/symfony/console/Question/ConfirmationQuestion.php b/tools/php-cs-fixer/vendor/symfony/console/Question/ConfirmationQuestion.php index 40eab242..951d6814 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Question/ConfirmationQuestion.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Question/ConfirmationQuestion.php @@ -18,18 +18,18 @@ */ class ConfirmationQuestion extends Question { - private string $trueAnswerRegex; - /** * @param string $question The question to ask to the user * @param bool $default The default answer to return, true or false * @param string $trueAnswerRegex A regex to match the "yes" answer */ - public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i') - { + public function __construct( + string $question, + bool $default = true, + private string $trueAnswerRegex = '/^y/i', + ) { parent::__construct($question, $default); - $this->trueAnswerRegex = $trueAnswerRegex; $this->setNormalizer($this->getDefaultNormalizer()); } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Question/Question.php b/tools/php-cs-fixer/vendor/symfony/console/Question/Question.php index b06db945..46a60c79 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Question/Question.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Question/Question.php @@ -21,13 +21,11 @@ */ class Question { - private string $question; private ?int $attempts = null; private bool $hidden = false; private bool $hiddenFallback = true; private ?\Closure $autocompleterCallback = null; private ?\Closure $validator = null; - private string|int|bool|null|float $default; private ?\Closure $normalizer = null; private bool $trimmable = true; private bool $multiline = false; @@ -36,10 +34,10 @@ class Question * @param string $question The question to ask to the user * @param string|bool|int|float|null $default The default answer to return if the user enters nothing */ - public function __construct(string $question, string|bool|int|float $default = null) - { - $this->question = $question; - $this->default = $default; + public function __construct( + private string $question, + private string|bool|int|float|null $default = null, + ) { } /** @@ -146,12 +144,11 @@ public function setAutocompleterValues(?iterable $values): static if (\is_array($values)) { $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); - $callback = static function () use ($values) { - return $values; - }; + $callback = static fn () => $values; } elseif ($values instanceof \Traversable) { - $valueCache = null; - $callback = static function () use ($values, &$valueCache) { + $callback = static function () use ($values) { + static $valueCache; + return $valueCache ??= iterator_to_array($values, false); }; } else { @@ -176,11 +173,8 @@ public function getAutocompleterCallback(): ?callable * * @return $this */ - public function setAutocompleterCallback(callable $callback = null): static + public function setAutocompleterCallback(?callable $callback): static { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } if ($this->hidden && null !== $callback) { throw new LogicException('A hidden question cannot use the autocompleter.'); } @@ -195,11 +189,8 @@ public function setAutocompleterCallback(callable $callback = null): static * * @return $this */ - public function setValidator(callable $validator = null): static + public function setValidator(?callable $validator): static { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } $this->validator = null === $validator ? null : $validator(...); return $this; @@ -267,7 +258,7 @@ public function getNormalizer(): ?callable return $this->normalizer; } - protected function isAssoc(array $array) + protected function isAssoc(array $array): bool { return (bool) \count(array_filter(array_keys($array), 'is_string')); } diff --git a/tools/php-cs-fixer/vendor/symfony/console/README.md b/tools/php-cs-fixer/vendor/symfony/console/README.md index c89b4a1a..92f70e71 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/README.md +++ b/tools/php-cs-fixer/vendor/symfony/console/README.md @@ -4,6 +4,11 @@ Console Component The Console component eases the creation of beautiful and testable command line interfaces. +Sponsor +------- + +Help Symfony by [sponsoring][1] its development! + Resources --------- @@ -18,3 +23,5 @@ Credits `Resources/bin/hiddeninput.exe` is a third party binary provided within this component. Find sources and license at https://github.com/Seldaek/hidden-input. + +[1]: https://symfony.com/sponsor diff --git a/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.bash b/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.bash index ad69eab0..64c6a338 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.bash +++ b/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.bash @@ -6,8 +6,18 @@ # https://symfony.com/doc/current/contributing/code/license.html _sf_{{ COMMAND_NAME }}() { + + # Use the default completion for shell redirect operators. + for w in '>' '>>' '&>' '<'; do + if [[ $w = "${COMP_WORDS[COMP_CWORD-1]}" ]]; then + compopt -o filenames + COMPREPLY=($(compgen -f -- "${COMP_WORDS[COMP_CWORD]}")) + return 0 + fi + done + # Use newline as only separator to allow space in completion values - IFS=$'\n' + local IFS=$'\n' local sf_cmd="${COMP_WORDS[0]}" # for an alias, get the real script behind it diff --git a/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.fish b/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.fish index 1c34292a..1853dd80 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.fish +++ b/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.fish @@ -19,11 +19,7 @@ function _sf_{{ COMMAND_NAME }} set completecmd $completecmd "-c$c" - set sfcomplete ($completecmd) - - for i in $sfcomplete - echo $i - end + $completecmd end complete -c '{{ COMMAND_NAME }}' -a '(_sf_{{ COMMAND_NAME }})' -f diff --git a/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalMap.php b/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalMap.php new file mode 100644 index 00000000..de419bda --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalMap.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\SignalRegistry; + +/** + * @author Grégoire Pineau + */ +class SignalMap +{ + private static array $map; + + public static function getSignalName(int $signal): ?string + { + if (!\extension_loaded('pcntl')) { + return null; + } + + if (!isset(self::$map)) { + $r = new \ReflectionExtension('pcntl'); + $c = $r->getConstants(); + $map = array_filter($c, fn ($k) => str_starts_with($k, 'SIG') && !str_starts_with($k, 'SIG_'), \ARRAY_FILTER_USE_KEY); + self::$map = array_flip($map); + } + + return self::$map[$signal] ?? null; + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalRegistry.php b/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalRegistry.php index ef2e5f04..8c2939ee 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalRegistry.php +++ b/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalRegistry.php @@ -54,4 +54,12 @@ public function handle(int $signal): void $signalHandler($signal, $hasNext); } } + + /** + * @internal + */ + public function scheduleAlarm(int $seconds): void + { + pcntl_alarm($seconds); + } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/SingleCommandApplication.php b/tools/php-cs-fixer/vendor/symfony/console/SingleCommandApplication.php index 4f0b5ba3..2b54fb87 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/SingleCommandApplication.php +++ b/tools/php-cs-fixer/vendor/symfony/console/SingleCommandApplication.php @@ -46,7 +46,7 @@ public function setAutoExit(bool $autoExit): static return $this; } - public function run(InputInterface $input = null, OutputInterface $output = null): int + public function run(?InputInterface $input = null, ?OutputInterface $output = null): int { if ($this->running) { return parent::run($input, $output); @@ -67,6 +67,6 @@ public function run(InputInterface $input = null, OutputInterface $output = null $this->running = false; } - return $ret ?? 1; + return $ret; } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Style/OutputStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Style/OutputStyle.php index b694bb53..89a3a417 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Style/OutputStyle.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Style/OutputStyle.php @@ -23,14 +23,12 @@ */ abstract class OutputStyle implements OutputInterface, StyleInterface { - private OutputInterface $output; - - public function __construct(OutputInterface $output) - { - $this->output = $output; + public function __construct( + private OutputInterface $output, + ) { } - public function newLine(int $count = 1) + public function newLine(int $count = 1): void { $this->output->write(str_repeat(\PHP_EOL, $count)); } @@ -40,17 +38,17 @@ public function createProgressBar(int $max = 0): ProgressBar return new ProgressBar($this->output, $max); } - public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) + public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL): void { $this->output->write($messages, $newline, $type); } - public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) + public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL): void { $this->output->writeln($messages, $type); } - public function setVerbosity(int $level) + public function setVerbosity(int $level): void { $this->output->setVerbosity($level); } @@ -60,7 +58,7 @@ public function getVerbosity(): int return $this->output->getVerbosity(); } - public function setDecorated(bool $decorated) + public function setDecorated(bool $decorated): void { $this->output->setDecorated($decorated); } @@ -70,7 +68,7 @@ public function isDecorated(): bool return $this->output->isDecorated(); } - public function setFormatter(OutputFormatterInterface $formatter) + public function setFormatter(OutputFormatterInterface $formatter): void { $this->output->setFormatter($formatter); } @@ -80,6 +78,12 @@ public function getFormatter(): OutputFormatterInterface return $this->output->getFormatter(); } + public function isSilent(): bool + { + // @deprecated since Symfony 7.2, change to $this->output->isSilent() in 8.0 + return method_exists($this->output, 'isSilent') ? $this->output->isSilent() : self::VERBOSITY_SILENT === $this->output->getVerbosity(); + } + public function isQuiet(): bool { return $this->output->isQuiet(); @@ -100,7 +104,7 @@ public function isDebug(): bool return $this->output->isDebug(); } - protected function getErrorOutput() + protected function getErrorOutput(): OutputInterface { if (!$this->output instanceof ConsoleOutputInterface) { return $this->output; diff --git a/tools/php-cs-fixer/vendor/symfony/console/Style/StyleInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Style/StyleInterface.php index 0bb12339..fcc5bc77 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Style/StyleInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Style/StyleInterface.php @@ -21,62 +21,62 @@ interface StyleInterface /** * Formats a command title. */ - public function title(string $message); + public function title(string $message): void; /** * Formats a section title. */ - public function section(string $message); + public function section(string $message): void; /** * Formats a list. */ - public function listing(array $elements); + public function listing(array $elements): void; /** * Formats informational text. */ - public function text(string|array $message); + public function text(string|array $message): void; /** * Formats a success result bar. */ - public function success(string|array $message); + public function success(string|array $message): void; /** * Formats an error result bar. */ - public function error(string|array $message); + public function error(string|array $message): void; /** * Formats an warning result bar. */ - public function warning(string|array $message); + public function warning(string|array $message): void; /** * Formats a note admonition. */ - public function note(string|array $message); + public function note(string|array $message): void; /** * Formats a caution admonition. */ - public function caution(string|array $message); + public function caution(string|array $message): void; /** * Formats a table. */ - public function table(array $headers, array $rows); + public function table(array $headers, array $rows): void; /** * Asks a question. */ - public function ask(string $question, string $default = null, callable $validator = null): mixed; + public function ask(string $question, ?string $default = null, ?callable $validator = null): mixed; /** * Asks a question with the user input hidden. */ - public function askHidden(string $question, callable $validator = null): mixed; + public function askHidden(string $question, ?callable $validator = null): mixed; /** * Asks for confirmation. @@ -91,20 +91,20 @@ public function choice(string $question, array $choices, mixed $default = null): /** * Add newline(s). */ - public function newLine(int $count = 1); + public function newLine(int $count = 1): void; /** * Starts the progress output. */ - public function progressStart(int $max = 0); + public function progressStart(int $max = 0): void; /** * Advances the progress output X steps. */ - public function progressAdvance(int $step = 1); + public function progressAdvance(int $step = 1): void; /** * Finishes the progress output. */ - public function progressFinish(); + public function progressFinish(): void; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Style/SymfonyStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Style/SymfonyStyle.php index 8fd6f849..4cf62cdb 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Style/SymfonyStyle.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Style/SymfonyStyle.php @@ -40,28 +40,27 @@ class SymfonyStyle extends OutputStyle { public const MAX_LINE_LENGTH = 120; - private InputInterface $input; - private OutputInterface $output; private SymfonyQuestionHelper $questionHelper; private ProgressBar $progressBar; private int $lineLength; private TrimmedBufferOutput $bufferedOutput; - public function __construct(InputInterface $input, OutputInterface $output) - { - $this->input = $input; + public function __construct( + private InputInterface $input, + private OutputInterface $output, + ) { $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), false, clone $output->getFormatter()); // Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not. $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH; $this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH); - parent::__construct($this->output = $output); + parent::__construct($output); } /** * Formats a message as a block of text. */ - public function block(string|array $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) + public function block(string|array $messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true): void { $messages = \is_array($messages) ? array_values($messages) : [$messages]; @@ -70,71 +69,69 @@ public function block(string|array $messages, string $type = null, string $style $this->newLine(); } - public function title(string $message) + public function title(string $message): void { $this->autoPrependBlock(); $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('=', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), + \sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), + \sprintf('%s', str_repeat('=', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), ]); $this->newLine(); } - public function section(string $message) + public function section(string $message): void { $this->autoPrependBlock(); $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('-', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), + \sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), + \sprintf('%s', str_repeat('-', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), ]); $this->newLine(); } - public function listing(array $elements) + public function listing(array $elements): void { $this->autoPrependText(); - $elements = array_map(function ($element) { - return sprintf(' * %s', $element); - }, $elements); + $elements = array_map(fn ($element) => \sprintf(' * %s', $element), $elements); $this->writeln($elements); $this->newLine(); } - public function text(string|array $message) + public function text(string|array $message): void { $this->autoPrependText(); $messages = \is_array($message) ? array_values($message) : [$message]; foreach ($messages as $message) { - $this->writeln(sprintf(' %s', $message)); + $this->writeln(\sprintf(' %s', $message)); } } /** * Formats a command comment. */ - public function comment(string|array $message) + public function comment(string|array $message): void { $this->block($message, null, null, ' // ', false, false); } - public function success(string|array $message) + public function success(string|array $message): void { $this->block($message, 'OK', 'fg=black;bg=green', ' ', true); } - public function error(string|array $message) + public function error(string|array $message): void { $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true); } - public function warning(string|array $message) + public function warning(string|array $message): void { $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); } - public function note(string|array $message) + public function note(string|array $message): void { $this->block($message, 'NOTE', 'fg=yellow', ' ! '); } @@ -142,17 +139,17 @@ public function note(string|array $message) /** * Formats an info message. */ - public function info(string|array $message) + public function info(string|array $message): void { $this->block($message, 'INFO', 'fg=green', ' ', true); } - public function caution(string|array $message) + public function caution(string|array $message): void { $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true); } - public function table(array $headers, array $rows) + public function table(array $headers, array $rows): void { $this->createTable() ->setHeaders($headers) @@ -166,7 +163,7 @@ public function table(array $headers, array $rows) /** * Formats a horizontal table. */ - public function horizontalTable(array $headers, array $rows) + public function horizontalTable(array $headers, array $rows): void { $this->createTable() ->setHorizontal(true) @@ -186,7 +183,7 @@ public function horizontalTable(array $headers, array $rows) * * ['key' => 'value'] * * new TableSeparator() */ - public function definitionList(string|array|TableSeparator ...$list) + public function definitionList(string|array|TableSeparator ...$list): void { $headers = []; $row = []; @@ -211,7 +208,7 @@ public function definitionList(string|array|TableSeparator ...$list) $this->horizontalTable($headers, [$row]); } - public function ask(string $question, string $default = null, callable $validator = null): mixed + public function ask(string $question, ?string $default = null, ?callable $validator = null): mixed { $question = new Question($question, $default); $question->setValidator($validator); @@ -219,7 +216,7 @@ public function ask(string $question, string $default = null, callable $validato return $this->askQuestion($question); } - public function askHidden(string $question, callable $validator = null): mixed + public function askHidden(string $question, ?callable $validator = null): mixed { $question = new Question($question); @@ -247,18 +244,18 @@ public function choice(string $question, array $choices, mixed $default = null, return $this->askQuestion($questionChoice); } - public function progressStart(int $max = 0) + public function progressStart(int $max = 0): void { $this->progressBar = $this->createProgressBar($max); $this->progressBar->start(); } - public function progressAdvance(int $step = 1) + public function progressAdvance(int $step = 1): void { $this->getProgressBar()->advance($step); } - public function progressFinish() + public function progressFinish(): void { $this->getProgressBar()->finish(); $this->newLine(2); @@ -280,8 +277,16 @@ public function createProgressBar(int $max = 0): ProgressBar /** * @see ProgressBar::iterate() + * + * @template TKey + * @template TValue + * + * @param iterable $iterable + * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable + * + * @return iterable */ - public function progressIterate(iterable $iterable, int $max = null): iterable + public function progressIterate(iterable $iterable, ?int $max = null): iterable { yield from $this->createProgressBar()->iterate($iterable, $max); @@ -311,7 +316,7 @@ public function askQuestion(Question $question): mixed return $answer; } - public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) + public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL): void { if (!is_iterable($messages)) { $messages = [$messages]; @@ -323,7 +328,7 @@ public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORM } } - public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) + public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL): void { if (!is_iterable($messages)) { $messages = [$messages]; @@ -335,7 +340,7 @@ public function write(string|iterable $messages, bool $newline = false, int $typ } } - public function newLine(int $count = 1) + public function newLine(int $count = 1): void { parent::newLine($count); $this->bufferedOutput->write(str_repeat("\n", $count)); @@ -381,7 +386,7 @@ private function autoPrependText(): void { $fetched = $this->bufferedOutput->fetch(); // Prepend new line if last char isn't EOL: - if (!str_ends_with($fetched, "\n")) { + if ($fetched && !str_ends_with($fetched, "\n")) { $this->newLine(); } } @@ -392,14 +397,14 @@ private function writeBuffer(string $message, bool $newLine, int $type): void $this->bufferedOutput->write($message, $newLine, $type); } - private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array + private function createBlock(iterable $messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array { $indentLength = 0; $prefixLength = Helper::width(Helper::removeDecoration($this->getFormatter(), $prefix)); $lines = []; if (null !== $type) { - $type = sprintf('[%s] ', $type); + $type = \sprintf('[%s] ', $type); $indentLength = Helper::width($type); $lineIndentation = str_repeat(' ', $indentLength); } @@ -441,7 +446,7 @@ private function createBlock(iterable $messages, string $type = null, string $st $line .= str_repeat(' ', max($this->lineLength - Helper::width(Helper::removeDecoration($this->getFormatter(), $line)), 0)); if ($style) { - $line = sprintf('<%s>%s', $style, $line); + $line = \sprintf('<%s>%s', $style, $line); } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Terminal.php b/tools/php-cs-fixer/vendor/symfony/console/Terminal.php index 7d10b13a..80f25443 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Terminal.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Terminal.php @@ -123,17 +123,15 @@ public static function hasSttyAvailable(): bool return self::$stty; } - // skip check if exec function is disabled - if (!\function_exists('exec')) { + // skip check if shell_exec function is disabled + if (!\function_exists('shell_exec')) { return false; } - exec('stty 2>&1', $output, $exitcode); - - return self::$stty = 0 === $exitcode; + return self::$stty = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); } - private static function initDimensions() + private static function initDimensions(): void { if ('\\' === \DIRECTORY_SEPARATOR) { $ansicon = getenv('ANSICON'); @@ -142,7 +140,7 @@ private static function initDimensions() // or [w, h] from "wxh" self::$width = (int) $matches[1]; self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2]; - } elseif (!self::hasVt100Support() && self::hasSttyAvailable()) { + } elseif (!sapi_windows_vt100_support(fopen('php://stdout', 'w')) && self::hasSttyAvailable()) { // only use stty on Windows if the terminal does not support vt100 (e.g. Windows 7 + git-bash) // testing for stty in a Windows 10 vt100-enabled console will implicitly disable vt100 support on STDOUT self::initDimensionsUsingStty(); @@ -156,18 +154,10 @@ private static function initDimensions() } } - /** - * Returns whether STDOUT has vt100 support (some Windows 10+ configurations). - */ - private static function hasVt100Support(): bool - { - return \function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout', 'w')); - } - /** * Initializes dimensions using the output of an stty columns line. */ - private static function initDimensionsUsingStty() + private static function initDimensionsUsingStty(): void { if ($sttyString = self::getSttyColumns()) { if (preg_match('/rows.(\d+);.columns.(\d+);/is', $sttyString, $matches)) { @@ -219,8 +209,7 @@ private static function readFromProcess(string|array $command): ?string $cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0; - $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); - if (!\is_resource($process)) { + if (!$process = @proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true])) { return null; } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Tester/ApplicationTester.php b/tools/php-cs-fixer/vendor/symfony/console/Tester/ApplicationTester.php index 58aee54d..cebb6f8e 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Tester/ApplicationTester.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Tester/ApplicationTester.php @@ -28,11 +28,9 @@ class ApplicationTester { use TesterTrait; - private Application $application; - - public function __construct(Application $application) - { - $this->application = $application; + public function __construct( + private Application $application, + ) { } /** diff --git a/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandCompletionTester.php b/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandCompletionTester.php index ade73275..76cbaf14 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandCompletionTester.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandCompletionTester.php @@ -22,11 +22,9 @@ */ class CommandCompletionTester { - private $command; - - public function __construct(Command $command) - { - $this->command = $command; + public function __construct( + private Command $command, + ) { } /** diff --git a/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandTester.php b/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandTester.php index 2ff813b7..d39cde7f 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandTester.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandTester.php @@ -24,11 +24,9 @@ class CommandTester { use TesterTrait; - private Command $command; - - public function __construct(Command $command) - { - $this->command = $command; + public function __construct( + private Command $command, + ) { } /** diff --git a/tools/php-cs-fixer/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php b/tools/php-cs-fixer/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php index 09c6194b..d677c27a 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php @@ -38,6 +38,6 @@ protected function additionalFailureDescription($other): string Command::INVALID => 'Command was invalid.', ]; - return $mapping[$other] ?? sprintf('Command returned exit status %d.', $other); + return $mapping[$other] ?? \sprintf('Command returned exit status %d.', $other); } } diff --git a/tools/php-cs-fixer/vendor/symfony/console/Tester/TesterTrait.php b/tools/php-cs-fixer/vendor/symfony/console/Tester/TesterTrait.php index 9670a496..1ab7a70a 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/Tester/TesterTrait.php +++ b/tools/php-cs-fixer/vendor/symfony/console/Tester/TesterTrait.php @@ -128,9 +128,9 @@ public function setInputs(array $inputs): static * * verbosity: Sets the output verbosity flag * * capture_stderr_separately: Make output of stdOut and stdErr separately available */ - private function initOutput(array $options) + private function initOutput(array $options): void { - $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; + $this->captureStreamsIndependently = $options['capture_stderr_separately'] ?? false; if (!$this->captureStreamsIndependently) { $this->output = new StreamOutput(fopen('php://memory', 'w', false)); if (isset($options['decorated'])) { diff --git a/tools/php-cs-fixer/vendor/symfony/console/composer.json b/tools/php-cs-fixer/vendor/symfony/console/composer.json index 6cc6166d..0ed1bd9a 100644 --- a/tools/php-cs-fixer/vendor/symfony/console/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/console/composer.json @@ -16,36 +16,33 @@ } ], "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" }, "require-dev": { - "symfony/config": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0", + "symfony/config": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0", "psr/log": "^1|^2|^3" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, - "suggest": { - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "", - "psr/log": "For using the console logger" - }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" }, diff --git a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/composer.json b/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/composer.json index 774200fd..ceb6c079 100644 --- a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/composer.json @@ -25,7 +25,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php index 610d6ac0..2d7840d3 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php @@ -29,5 +29,5 @@ interface EventDispatcherInterface extends PsrEventDispatcherInterface * * @return T The passed $event MUST be returned */ - public function dispatch(object $event, string $eventName = null): object; + public function dispatch(object $event, ?string $eventName = null): object; } diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/composer.json b/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/composer.json index 89d7cec9..35956eb8 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/composer.json @@ -19,16 +19,13 @@ "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "autoload": { "psr-4": { "Symfony\\Contracts\\EventDispatcher\\": "" } }, "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php index bb931b82..590ada9e 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php @@ -19,6 +19,12 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class AsEventListener { + /** + * @param string|null $event The event name to listen to + * @param string|null $method The method to run when the listened event is triggered + * @param int $priority The priority of this listener if several are declared for the same event + * @param string|null $dispatcher The service id of the event dispatcher to listen to + */ public function __construct( public ?string $event = null, public ?string $method = null, diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php index d8213781..8330ce15 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php @@ -30,38 +30,33 @@ */ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterface { - protected $logger; - protected $stopwatch; - /** * @var \SplObjectStorage|null */ private ?\SplObjectStorage $callStack = null; - private EventDispatcherInterface $dispatcher; private array $wrappedListeners = []; private array $orphanedEvents = []; - private ?RequestStack $requestStack; private string $currentRequestHash = ''; - public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null, RequestStack $requestStack = null) - { - $this->dispatcher = $dispatcher; - $this->stopwatch = $stopwatch; - $this->logger = $logger; - $this->requestStack = $requestStack; + public function __construct( + private EventDispatcherInterface $dispatcher, + protected Stopwatch $stopwatch, + protected ?LoggerInterface $logger = null, + private ?RequestStack $requestStack = null, + ) { } - public function addListener(string $eventName, callable|array $listener, int $priority = 0) + public function addListener(string $eventName, callable|array $listener, int $priority = 0): void { $this->dispatcher->addListener($eventName, $listener, $priority); } - public function addSubscriber(EventSubscriberInterface $subscriber) + public function addSubscriber(EventSubscriberInterface $subscriber): void { $this->dispatcher->addSubscriber($subscriber); } - public function removeListener(string $eventName, callable|array $listener) + public function removeListener(string $eventName, callable|array $listener): void { if (isset($this->wrappedListeners[$eventName])) { foreach ($this->wrappedListeners[$eventName] as $index => $wrappedListener) { @@ -73,15 +68,15 @@ public function removeListener(string $eventName, callable|array $listener) } } - return $this->dispatcher->removeListener($eventName, $listener); + $this->dispatcher->removeListener($eventName, $listener); } - public function removeSubscriber(EventSubscriberInterface $subscriber) + public function removeSubscriber(EventSubscriberInterface $subscriber): void { - return $this->dispatcher->removeSubscriber($subscriber); + $this->dispatcher->removeSubscriber($subscriber); } - public function getListeners(string $eventName = null): array + public function getListeners(?string $eventName = null): array { return $this->dispatcher->getListeners($eventName); } @@ -101,12 +96,12 @@ public function getListenerPriority(string $eventName, callable|array $listener) return $this->dispatcher->getListenerPriority($eventName, $listener); } - public function hasListeners(string $eventName = null): bool + public function hasListeners(?string $eventName = null): bool { return $this->dispatcher->hasListeners($eventName); } - public function dispatch(object $event, string $eventName = null): object + public function dispatch(object $event, ?string $eventName = null): object { $eventName ??= $event::class; @@ -115,7 +110,7 @@ public function dispatch(object $event, string $eventName = null): object $currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : ''; if (null !== $this->logger && $event instanceof StoppableEventInterface && $event->isPropagationStopped()) { - $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName)); + $this->logger->debug(\sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName)); } $this->preProcess($eventName); @@ -141,7 +136,7 @@ public function dispatch(object $event, string $eventName = null): object return $event; } - public function getCalledListeners(Request $request = null): array + public function getCalledListeners(?Request $request = null): array { if (null === $this->callStack) { return []; @@ -159,7 +154,7 @@ public function getCalledListeners(Request $request = null): array return $called; } - public function getNotCalledListeners(Request $request = null): array + public function getNotCalledListeners(?Request $request = null): array { try { $allListeners = $this->dispatcher instanceof EventDispatcher ? $this->getListenersWithPriority() : $this->getListenersWithoutPriority(); @@ -201,7 +196,7 @@ public function getNotCalledListeners(Request $request = null): array return $notCalled; } - public function getOrphanedEvents(Request $request = null): array + public function getOrphanedEvents(?Request $request = null): array { if ($request) { return $this->orphanedEvents[spl_object_hash($request)] ?? []; @@ -214,7 +209,7 @@ public function getOrphanedEvents(Request $request = null): array return array_merge(...array_values($this->orphanedEvents)); } - public function reset() + public function reset(): void { $this->callStack = null; $this->orphanedEvents = []; @@ -235,14 +230,14 @@ public function __call(string $method, array $arguments): mixed /** * Called before dispatching the event. */ - protected function beforeDispatch(string $eventName, object $event) + protected function beforeDispatch(string $eventName, object $event): void { } /** * Called after dispatching the event. */ - protected function afterDispatch(string $eventName, object $event) + protected function afterDispatch(string $eventName, object $event): void { } @@ -329,7 +324,6 @@ private function getListenersWithPriority(): array $result = []; $allListeners = new \ReflectionProperty(EventDispatcher::class, 'listeners'); - $allListeners->setAccessible(true); foreach ($allListeners->getValue($this->dispatcher) as $eventName => $listenersByPriority) { foreach ($listenersByPriority as $priority => $listeners) { diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/WrappedListener.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/WrappedListener.php index 5871578c..b83115bb 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/WrappedListener.php +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/WrappedListener.php @@ -26,21 +26,20 @@ final class WrappedListener private string $name; private bool $called = false; private bool $stoppedPropagation = false; - private Stopwatch $stopwatch; - private ?EventDispatcherInterface $dispatcher; private string $pretty; private string $callableRef; private ClassStub|string $stub; - private ?int $priority = null; private static bool $hasClassStub; - public function __construct(callable|array $listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null, int $priority = null) - { + public function __construct( + callable|array $listener, + ?string $name, + private Stopwatch $stopwatch, + private ?EventDispatcherInterface $dispatcher = null, + private ?int $priority = null, + ) { $this->listener = $listener; $this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? $listener(...) : null); - $this->stopwatch = $stopwatch; - $this->dispatcher = $dispatcher; - $this->priority = $priority; if (\is_array($listener)) { [$this->name, $this->callableRef] = $this->parseListener($listener); @@ -48,9 +47,9 @@ public function __construct(callable|array $listener, ?string $name, Stopwatch $ $this->callableRef .= '::'.$listener[1]; } elseif ($listener instanceof \Closure) { $r = new \ReflectionFunction($listener); - if (str_contains($r->name, '{closure}')) { + if ($r->isAnonymous()) { $this->pretty = $this->name = 'closure'; - } elseif ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { + } elseif ($class = $r->getClosureCalledClass()) { $this->name = $class->name; $this->pretty = $this->name.'::'.$r->name; } else { @@ -136,7 +135,7 @@ private function parseListener(array $listener): array } if (\is_object($listener[0])) { - return [get_debug_type($listener[0]), \get_class($listener[0])]; + return [get_debug_type($listener[0]), $listener[0]::class]; } return [$listener[0], $listener[0]]; diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php index 13b4336a..53089920 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php @@ -21,11 +21,9 @@ */ class AddEventAliasesPass implements CompilerPassInterface { - private array $eventAliases; - - public function __construct(array $eventAliases) - { - $this->eventAliases = $eventAliases; + public function __construct( + private array $eventAliases, + ) { } public function process(ContainerBuilder $container): void diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php index 57b7bf9b..a0267ce3 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php @@ -48,7 +48,7 @@ public function setNoPreloadEvents(array $noPreloadEvents): static return $this; } - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('event_dispatcher') && !$container->hasAlias('event_dispatcher')) { return; @@ -83,10 +83,14 @@ public function process(ContainerBuilder $container) $event['method'] = 'on'.preg_replace_callback([ '/(?<=\b|_)[a-z]/i', '/[^a-z0-9]/i', - ], function ($matches) { return strtoupper($matches[0]); }, $event['event']); + ], fn ($matches) => strtoupper($matches[0]), $event['event']); $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); - if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method']) && $r->hasMethod('__invoke')) { + if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method'])) { + if (!$r->hasMethod('__invoke')) { + throw new InvalidArgumentException(\sprintf('None of the "%s" or "__invoke" methods exist for the service "%s". Please define the "method" attribute on "kernel.event_listener" tags.', $event['method'], $id)); + } + $event['method'] = '__invoke'; } } @@ -119,10 +123,10 @@ public function process(ContainerBuilder $container) $class = $def->getClass(); if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); + throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); } if (!$r->isSubclassOf(EventSubscriberInterface::class)) { - throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, EventSubscriberInterface::class)); + throw new InvalidArgumentException(\sprintf('Service "%s" must implement interface "%s".', $id, EventSubscriberInterface::class)); } $class = $r->name; @@ -174,7 +178,7 @@ private function getEventFromTypeDeclaration(ContainerBuilder $container, string || $type->isBuiltin() || Event::class === ($name = $type->getName()) ) { - throw new InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "kernel.event_listener" tags.', $id)); + throw new InvalidArgumentException(\sprintf('Service "%s" must define the "event" attribute on "kernel.event_listener" tags.', $id)); } return $name; @@ -191,7 +195,7 @@ class ExtractingEventDispatcher extends EventDispatcher implements EventSubscrib public static array $aliases = []; public static string $subscriber; - public function addListener(string $eventName, callable|array $listener, int $priority = 0) + public function addListener(string $eventName, callable|array $listener, int $priority = 0): void { $this->listeners[] = [$eventName, $listener[1], $priority]; } diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcher.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcher.php index 41f3f7ae..43bc16b8 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcher.php +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcher.php @@ -42,7 +42,7 @@ public function __construct() } } - public function dispatch(object $event, string $eventName = null): object + public function dispatch(object $event, ?string $eventName = null): object { $eventName ??= $event::class; @@ -59,7 +59,7 @@ public function dispatch(object $event, string $eventName = null): object return $event; } - public function getListeners(string $eventName = null): array + public function getListeners(?string $eventName = null): array { if (null !== $eventName) { if (empty($this->listeners[$eventName])) { @@ -108,7 +108,7 @@ public function getListenerPriority(string $eventName, callable|array $listener) return null; } - public function hasListeners(string $eventName = null): bool + public function hasListeners(?string $eventName = null): bool { if (null !== $eventName) { return !empty($this->listeners[$eventName]); @@ -123,13 +123,13 @@ public function hasListeners(string $eventName = null): bool return false; } - public function addListener(string $eventName, callable|array $listener, int $priority = 0) + public function addListener(string $eventName, callable|array $listener, int $priority = 0): void { $this->listeners[$eventName][$priority][] = $listener; unset($this->sorted[$eventName], $this->optimized[$eventName]); } - public function removeListener(string $eventName, callable|array $listener) + public function removeListener(string $eventName, callable|array $listener): void { if (empty($this->listeners[$eventName])) { return; @@ -157,7 +157,7 @@ public function removeListener(string $eventName, callable|array $listener) } } - public function addSubscriber(EventSubscriberInterface $subscriber) + public function addSubscriber(EventSubscriberInterface $subscriber): void { foreach ($subscriber->getSubscribedEvents() as $eventName => $params) { if (\is_string($params)) { @@ -172,7 +172,7 @@ public function addSubscriber(EventSubscriberInterface $subscriber) } } - public function removeSubscriber(EventSubscriberInterface $subscriber) + public function removeSubscriber(EventSubscriberInterface $subscriber): void { foreach ($subscriber->getSubscribedEvents() as $eventName => $params) { if (\is_array($params) && \is_array($params[0])) { @@ -195,7 +195,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber) * @param string $eventName The name of the event to dispatch * @param object $event The event object to pass to the event handlers/listeners */ - protected function callListeners(iterable $listeners, string $eventName, object $event) + protected function callListeners(iterable $listeners, string $eventName, object $event): void { $stoppable = $event instanceof StoppableEventInterface; @@ -210,7 +210,7 @@ protected function callListeners(iterable $listeners, string $eventName, object /** * Sorts the internal list of listeners for the given event by priority. */ - private function sortListeners(string $eventName) + private function sortListeners(string $eventName): void { krsort($this->listeners[$eventName]); $this->sorted[$eventName] = []; diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcherInterface.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcherInterface.php index 97a3017a..99f8b1a0 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcherInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcherInterface.php @@ -28,7 +28,7 @@ interface EventDispatcherInterface extends ContractsEventDispatcherInterface * @param int $priority The higher this value, the earlier an event * listener will be triggered in the chain (defaults to 0) */ - public function addListener(string $eventName, callable $listener, int $priority = 0); + public function addListener(string $eventName, callable $listener, int $priority = 0): void; /** * Adds an event subscriber. @@ -36,21 +36,21 @@ public function addListener(string $eventName, callable $listener, int $priority * The subscriber is asked for all the events it is * interested in and added as a listener for these events. */ - public function addSubscriber(EventSubscriberInterface $subscriber); + public function addSubscriber(EventSubscriberInterface $subscriber): void; /** * Removes an event listener from the specified events. */ - public function removeListener(string $eventName, callable $listener); + public function removeListener(string $eventName, callable $listener): void; - public function removeSubscriber(EventSubscriberInterface $subscriber); + public function removeSubscriber(EventSubscriberInterface $subscriber): void; /** * Gets the listeners of a specific event or all listeners sorted by descending priority. * * @return array */ - public function getListeners(string $eventName = null): array; + public function getListeners(?string $eventName = null): array; /** * Gets the listener priority for a specific event. @@ -62,5 +62,5 @@ public function getListenerPriority(string $eventName, callable $listener): ?int /** * Checks whether an event has any registered listeners. */ - public function hasListeners(string $eventName = null): bool; + public function hasListeners(?string $eventName = null): bool; } diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/GenericEvent.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/GenericEvent.php index 68a20306..87f61ad5 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/GenericEvent.php +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/GenericEvent.php @@ -25,19 +25,16 @@ */ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate { - protected $subject; - protected $arguments; - /** - * Encapsulate an event with $subject and $args. + * Encapsulate an event with $subject and $arguments. * * @param mixed $subject The subject of the event, usually an object or a callable * @param array $arguments Arguments to store in the event */ - public function __construct(mixed $subject = null, array $arguments = []) - { - $this->subject = $subject; - $this->arguments = $arguments; + public function __construct( + protected mixed $subject = null, + protected array $arguments = [], + ) { } /** @@ -59,7 +56,7 @@ public function getArgument(string $key): mixed return $this->arguments[$key]; } - throw new \InvalidArgumentException(sprintf('Argument "%s" not found.', $key)); + throw new \InvalidArgumentException(\sprintf('Argument "%s" not found.', $key)); } /** diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php index 182ba080..a6d078e9 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php @@ -18,39 +18,37 @@ */ class ImmutableEventDispatcher implements EventDispatcherInterface { - private EventDispatcherInterface $dispatcher; - - public function __construct(EventDispatcherInterface $dispatcher) - { - $this->dispatcher = $dispatcher; + public function __construct( + private EventDispatcherInterface $dispatcher, + ) { } - public function dispatch(object $event, string $eventName = null): object + public function dispatch(object $event, ?string $eventName = null): object { return $this->dispatcher->dispatch($event, $eventName); } - public function addListener(string $eventName, callable|array $listener, int $priority = 0) + public function addListener(string $eventName, callable|array $listener, int $priority = 0): never { throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); } - public function addSubscriber(EventSubscriberInterface $subscriber) + public function addSubscriber(EventSubscriberInterface $subscriber): never { throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); } - public function removeListener(string $eventName, callable|array $listener) + public function removeListener(string $eventName, callable|array $listener): never { throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); } - public function removeSubscriber(EventSubscriberInterface $subscriber) + public function removeSubscriber(EventSubscriberInterface $subscriber): never { throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); } - public function getListeners(string $eventName = null): array + public function getListeners(?string $eventName = null): array { return $this->dispatcher->getListeners($eventName); } @@ -60,7 +58,7 @@ public function getListenerPriority(string $eventName, callable|array $listener) return $this->dispatcher->getListenerPriority($eventName, $listener); } - public function hasListeners(string $eventName = null): bool + public function hasListeners(?string $eventName = null): bool { return $this->dispatcher->hasListeners($eventName); } diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/composer.json b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/composer.json index c05373f3..598bbdc5 100644 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/composer.json @@ -16,30 +16,27 @@ } ], "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2|^3" + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "require-dev": { - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0", "psr/log": "^1|^2|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", "symfony/event-dispatcher-implementation": "2.0|3.0" }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, "autoload": { "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" }, "exclude-from-classmap": [ diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/filesystem/CHANGELOG.md index fcb7170c..80818d1b 100644 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/CHANGELOG.md +++ b/tools/php-cs-fixer/vendor/symfony/filesystem/CHANGELOG.md @@ -1,6 +1,16 @@ CHANGELOG ========= +7.1 +--- + + * Add the `Filesystem::readFile()` method + +7.0 +--- + + * Add argument `$lock` to `Filesystem::appendToFile()` + 5.4 --- diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/FileNotFoundException.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/FileNotFoundException.php index 48b64080..d0d27977 100644 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/FileNotFoundException.php +++ b/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/FileNotFoundException.php @@ -19,13 +19,13 @@ */ 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) { $message = 'File could not be found.'; } else { - $message = sprintf('File "%s" could not be found.', $path); + $message = \sprintf('File "%s" could not be found.', $path); } } diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOException.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOException.php index a3c54455..46ab8b4a 100644 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOException.php +++ b/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOException.php @@ -20,12 +20,12 @@ */ class IOException extends \RuntimeException implements IOExceptionInterface { - private ?string $path; - - public function __construct(string $message, int $code = 0, \Throwable $previous = null, string $path = null) - { - $this->path = $path; - + public function __construct( + string $message, + int $code = 0, + ?\Throwable $previous = null, + private ?string $path = null, + ) { parent::__construct($message, $code, $previous); } diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Filesystem.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Filesystem.php index 3b3cf7a1..f97c8b2f 100644 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Filesystem.php +++ b/tools/php-cs-fixer/vendor/symfony/filesystem/Filesystem.php @@ -22,7 +22,7 @@ */ class Filesystem { - private static $lastError; + private static ?string $lastError = null; /** * Copies a file. @@ -34,29 +34,29 @@ class Filesystem * @throws FileNotFoundException When originFile doesn't exist * @throws IOException When copy fails */ - public function copy(string $originFile, string $targetFile, bool $overwriteNewerFiles = false) + public function copy(string $originFile, string $targetFile, bool $overwriteNewerFiles = false): void { $originIsLocal = stream_is_local($originFile) || 0 === stripos($originFile, 'file://'); if ($originIsLocal && !is_file($originFile)) { - throw new FileNotFoundException(sprintf('Failed to copy "%s" because file does not exist.', $originFile), 0, null, $originFile); + throw new FileNotFoundException(\sprintf('Failed to copy "%s" because file does not exist.', $originFile), 0, null, $originFile); } $this->mkdir(\dirname($targetFile)); $doCopy = true; - if (!$overwriteNewerFiles && null === parse_url($originFile, \PHP_URL_HOST) && is_file($targetFile)) { + if (!$overwriteNewerFiles && !parse_url($originFile, \PHP_URL_HOST) && is_file($targetFile)) { $doCopy = filemtime($originFile) > filemtime($targetFile); } if ($doCopy) { // https://bugs.php.net/64634 if (!$source = self::box('fopen', $originFile, 'r')) { - throw new IOException(sprintf('Failed to copy "%s" to "%s" because source file could not be opened for reading: ', $originFile, $targetFile).self::$lastError, 0, null, $originFile); + throw new IOException(\sprintf('Failed to copy "%s" to "%s" because source file could not be opened for reading: ', $originFile, $targetFile).self::$lastError, 0, null, $originFile); } // Stream context created to allow files overwrite when using FTP stream wrapper - disabled by default if (!$target = self::box('fopen', $targetFile, 'w', false, stream_context_create(['ftp' => ['overwrite' => true]]))) { - throw new IOException(sprintf('Failed to copy "%s" to "%s" because target file could not be opened for writing: ', $originFile, $targetFile).self::$lastError, 0, null, $originFile); + throw new IOException(\sprintf('Failed to copy "%s" to "%s" because target file could not be opened for writing: ', $originFile, $targetFile).self::$lastError, 0, null, $originFile); } $bytesCopied = stream_copy_to_stream($source, $target); @@ -65,15 +65,18 @@ public function copy(string $originFile, string $targetFile, bool $overwriteNewe unset($source, $target); if (!is_file($targetFile)) { - throw new IOException(sprintf('Failed to copy "%s" to "%s".', $originFile, $targetFile), 0, null, $originFile); + throw new IOException(\sprintf('Failed to copy "%s" to "%s".', $originFile, $targetFile), 0, null, $originFile); } if ($originIsLocal) { // Like `cp`, preserve executable permission bits self::box('chmod', $targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111)); + // Like `cp`, preserve the file modification time + self::box('touch', $targetFile, filemtime($originFile)); + if ($bytesCopied !== $bytesOrigin = filesize($originFile)) { - throw new IOException(sprintf('Failed to copy the whole content of "%s" to "%s" (%g of %g bytes copied).', $originFile, $targetFile, $bytesCopied, $bytesOrigin), 0, null, $originFile); + throw new IOException(\sprintf('Failed to copy the whole content of "%s" to "%s" (%g of %g bytes copied).', $originFile, $targetFile, $bytesCopied, $bytesOrigin), 0, null, $originFile); } } } @@ -84,7 +87,7 @@ public function copy(string $originFile, string $targetFile, bool $overwriteNewe * * @throws IOException On any directory creation failure */ - public function mkdir(string|iterable $dirs, int $mode = 0777) + public function mkdir(string|iterable $dirs, int $mode = 0777): void { foreach ($this->toIterable($dirs) as $dir) { if (is_dir($dir)) { @@ -92,7 +95,7 @@ public function mkdir(string|iterable $dirs, int $mode = 0777) } if (!self::box('mkdir', $dir, $mode, true) && !is_dir($dir)) { - throw new IOException(sprintf('Failed to create "%s": ', $dir).self::$lastError, 0, null, $dir); + throw new IOException(\sprintf('Failed to create "%s": ', $dir).self::$lastError, 0, null, $dir); } } } @@ -106,7 +109,7 @@ public function exists(string|iterable $files): bool foreach ($this->toIterable($files) as $file) { if (\strlen($file) > $maxPathLength) { - throw new IOException(sprintf('Could not check if file exist because path length exceeds %d characters.', $maxPathLength), 0, null, $file); + throw new IOException(\sprintf('Could not check if file exist because path length exceeds %d characters.', $maxPathLength), 0, null, $file); } if (!file_exists($file)) { @@ -125,11 +128,11 @@ public function exists(string|iterable $files): bool * * @throws IOException When touch fails */ - public function touch(string|iterable $files, int $time = null, int $atime = null) + 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))) { - throw new IOException(sprintf('Failed to touch "%s": ', $file).self::$lastError, 0, null, $file); + throw new IOException(\sprintf('Failed to touch "%s": ', $file).self::$lastError, 0, null, $file); } } } @@ -139,7 +142,7 @@ public function touch(string|iterable $files, int $time = null, int $atime = nul * * @throws IOException When removal fails */ - public function remove(string|iterable $files) + public function remove(string|iterable $files): void { if ($files instanceof \Traversable) { $files = iterator_to_array($files, false); @@ -157,11 +160,11 @@ private static function doRemove(array $files, bool $isRecursive): void if (is_link($file)) { // See https://bugs.php.net/52176 if (!(self::box('unlink', $file) || '\\' !== \DIRECTORY_SEPARATOR || self::box('rmdir', $file)) && file_exists($file)) { - throw new IOException(sprintf('Failed to remove symlink "%s": ', $file).self::$lastError); + throw new IOException(\sprintf('Failed to remove symlink "%s": ', $file).self::$lastError); } } elseif (is_dir($file)) { if (!$isRecursive) { - $tmpName = \dirname(realpath($file)).'/.'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-_')); + $tmpName = \dirname(realpath($file)).'/.!'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-!')); if (file_exists($tmpName)) { try { @@ -188,10 +191,10 @@ private static function doRemove(array $files, bool $isRecursive): void $file = $origFile; } - throw new IOException(sprintf('Failed to remove directory "%s": ', $file).$lastError); + throw new IOException(\sprintf('Failed to remove directory "%s": ', $file).$lastError); } - } elseif (!self::box('unlink', $file) && (str_contains(self::$lastError, 'Permission denied') || file_exists($file))) { - throw new IOException(sprintf('Failed to remove file "%s": ', $file).self::$lastError); + } elseif (!self::box('unlink', $file) && ((self::$lastError && str_contains(self::$lastError, 'Permission denied')) || file_exists($file))) { + throw new IOException(\sprintf('Failed to remove file "%s": ', $file).self::$lastError); } } } @@ -205,11 +208,11 @@ private static function doRemove(array $files, bool $isRecursive): void * * @throws IOException When the change fails */ - public function chmod(string|iterable $files, int $mode, int $umask = 0000, bool $recursive = false) + public function chmod(string|iterable $files, int $mode, int $umask = 0000, bool $recursive = false): void { foreach ($this->toIterable($files) as $file) { - if (\is_int($mode) && !self::box('chmod', $file, $mode & ~$umask)) { - throw new IOException(sprintf('Failed to chmod file "%s": ', $file).self::$lastError, 0, null, $file); + if (!self::box('chmod', $file, $mode & ~$umask)) { + throw new IOException(\sprintf('Failed to chmod file "%s": ', $file).self::$lastError, 0, null, $file); } if ($recursive && is_dir($file) && !is_link($file)) { $this->chmod(new \FilesystemIterator($file), $mode, $umask, true); @@ -220,12 +223,16 @@ public function chmod(string|iterable $files, int $mode, int $umask = 0000, bool /** * Change the owner of an array of files or directories. * + * This method always throws on Windows, as the underlying PHP function is not supported. + * + * @see https://www.php.net/chown + * * @param string|int $user A user name or number * @param bool $recursive Whether change the owner recursively or not * * @throws IOException When the change fails */ - public function chown(string|iterable $files, string|int $user, bool $recursive = false) + public function chown(string|iterable $files, string|int $user, bool $recursive = false): void { foreach ($this->toIterable($files) as $file) { if ($recursive && is_dir($file) && !is_link($file)) { @@ -233,11 +240,11 @@ public function chown(string|iterable $files, string|int $user, bool $recursive } if (is_link($file) && \function_exists('lchown')) { if (!self::box('lchown', $file, $user)) { - throw new IOException(sprintf('Failed to chown file "%s": ', $file).self::$lastError, 0, null, $file); + throw new IOException(\sprintf('Failed to chown file "%s": ', $file).self::$lastError, 0, null, $file); } } else { if (!self::box('chown', $file, $user)) { - throw new IOException(sprintf('Failed to chown file "%s": ', $file).self::$lastError, 0, null, $file); + throw new IOException(\sprintf('Failed to chown file "%s": ', $file).self::$lastError, 0, null, $file); } } } @@ -246,12 +253,16 @@ public function chown(string|iterable $files, string|int $user, bool $recursive /** * Change the group of an array of files or directories. * + * This method always throws on Windows, as the underlying PHP function is not supported. + * + * @see https://www.php.net/chgrp + * * @param string|int $group A group name or number * @param bool $recursive Whether change the group recursively or not * * @throws IOException When the change fails */ - public function chgrp(string|iterable $files, string|int $group, bool $recursive = false) + public function chgrp(string|iterable $files, string|int $group, bool $recursive = false): void { foreach ($this->toIterable($files) as $file) { if ($recursive && is_dir($file) && !is_link($file)) { @@ -259,11 +270,11 @@ public function chgrp(string|iterable $files, string|int $group, bool $recursive } if (is_link($file) && \function_exists('lchgrp')) { if (!self::box('lchgrp', $file, $group)) { - throw new IOException(sprintf('Failed to chgrp file "%s": ', $file).self::$lastError, 0, null, $file); + throw new IOException(\sprintf('Failed to chgrp file "%s": ', $file).self::$lastError, 0, null, $file); } } else { if (!self::box('chgrp', $file, $group)) { - throw new IOException(sprintf('Failed to chgrp file "%s": ', $file).self::$lastError, 0, null, $file); + throw new IOException(\sprintf('Failed to chgrp file "%s": ', $file).self::$lastError, 0, null, $file); } } } @@ -275,11 +286,11 @@ public function chgrp(string|iterable $files, string|int $group, bool $recursive * @throws IOException When target file or directory already exists * @throws IOException When origin cannot be renamed */ - public function rename(string $origin, string $target, bool $overwrite = false) + public function rename(string $origin, string $target, bool $overwrite = false): void { // we check that target does not exist if (!$overwrite && $this->isReadable($target)) { - throw new IOException(sprintf('Cannot rename because the target "%s" already exists.', $target), 0, null, $target); + throw new IOException(\sprintf('Cannot rename because the target "%s" already exists.', $target), 0, null, $target); } if (!self::box('rename', $origin, $target)) { @@ -290,7 +301,7 @@ public function rename(string $origin, string $target, bool $overwrite = false) return; } - throw new IOException(sprintf('Cannot rename "%s" to "%s": ', $origin, $target).self::$lastError, 0, null, $target); + throw new IOException(\sprintf('Cannot rename "%s" to "%s": ', $origin, $target).self::$lastError, 0, null, $target); } } @@ -304,7 +315,7 @@ private function isReadable(string $filename): bool $maxPathLength = \PHP_MAXPATHLEN - 2; if (\strlen($filename) > $maxPathLength) { - throw new IOException(sprintf('Could not check if file is readable because path length exceeds %d characters.', $maxPathLength), 0, null, $filename); + throw new IOException(\sprintf('Could not check if file is readable because path length exceeds %d characters.', $maxPathLength), 0, null, $filename); } return is_readable($filename); @@ -315,7 +326,7 @@ private function isReadable(string $filename): bool * * @throws IOException When symlink fails */ - public function symlink(string $originDir, string $targetDir, bool $copyOnWindows = false) + public function symlink(string $originDir, string $targetDir, bool $copyOnWindows = false): void { self::assertFunctionExists('symlink'); @@ -352,7 +363,7 @@ public function symlink(string $originDir, string $targetDir, bool $copyOnWindow * @throws FileNotFoundException When original file is missing or not a file * @throws IOException When link fails, including if link already exists */ - public function hardlink(string $originFile, string|iterable $targetFiles) + public function hardlink(string $originFile, string|iterable $targetFiles): void { self::assertFunctionExists('link'); @@ -361,7 +372,7 @@ public function hardlink(string $originFile, string|iterable $targetFiles) } if (!is_file($originFile)) { - throw new FileNotFoundException(sprintf('Origin file "%s" is not a file.', $originFile)); + throw new FileNotFoundException(\sprintf('Origin file "%s" is not a file.', $originFile)); } foreach ($this->toIterable($targetFiles) as $targetFile) { @@ -381,14 +392,14 @@ public function hardlink(string $originFile, string|iterable $targetFiles) /** * @param string $linkType Name of the link type, typically 'symbolic' or 'hard' */ - private function linkException(string $origin, string $target, string $linkType) + private function linkException(string $origin, string $target, string $linkType): never { if (self::$lastError) { if ('\\' === \DIRECTORY_SEPARATOR && str_contains(self::$lastError, 'error code(1314)')) { - throw new IOException(sprintf('Unable to create "%s" link due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?', $linkType), 0, null, $target); + throw new IOException(\sprintf('Unable to create "%s" link due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?', $linkType), 0, null, $target); } } - throw new IOException(sprintf('Failed to create "%s" link from "%s" to "%s": ', $linkType, $origin, $target).self::$lastError, 0, null, $target); + throw new IOException(\sprintf('Failed to create "%s" link from "%s" to "%s": ', $linkType, $origin, $target).self::$lastError, 0, null, $target); } /** @@ -425,11 +436,11 @@ public function readlink(string $path, bool $canonicalize = false): ?string public function makePathRelative(string $endPath, string $startPath): string { if (!$this->isAbsolutePath($startPath)) { - throw new InvalidArgumentException(sprintf('The start path "%s" is not absolute.', $startPath)); + throw new InvalidArgumentException(\sprintf('The start path "%s" is not absolute.', $startPath)); } if (!$this->isAbsolutePath($endPath)) { - throw new InvalidArgumentException(sprintf('The end path "%s" is not absolute.', $endPath)); + throw new InvalidArgumentException(\sprintf('The end path "%s" is not absolute.', $endPath)); } // Normalize separators on Windows @@ -438,11 +449,9 @@ public function makePathRelative(string $endPath, string $startPath): string $startPath = str_replace('\\', '/', $startPath); } - $splitDriveLetter = function ($path) { - return (\strlen($path) > 2 && ':' === $path[1] && '/' === $path[2] && ctype_alpha($path[0])) - ? [substr($path, 2), strtoupper($path[0])] - : [$path, null]; - }; + $splitDriveLetter = fn ($path) => (\strlen($path) > 2 && ':' === $path[1] && '/' === $path[2] && ctype_alpha($path[0])) + ? [substr($path, 2), strtoupper($path[0])] + : [$path, null]; $splitPath = function ($path) { $result = []; @@ -510,14 +519,14 @@ 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 = []) + public function mirror(string $originDir, string $targetDir, ?\Traversable $iterator = null, array $options = []): void { $targetDir = rtrim($targetDir, '/\\'); $originDir = rtrim($originDir, '/\\'); $originDirLen = \strlen($originDir); if (!$this->exists($originDir)) { - throw new IOException(sprintf('The origin directory specified "%s" was not found.', $originDir), 0, null, $originDir); + throw new IOException(\sprintf('The origin directory specified "%s" was not found.', $originDir), 0, null, $originDir); } // Iterate in destination folder to remove obsolete entries @@ -561,7 +570,7 @@ public function mirror(string $originDir, string $targetDir, \Traversable $itera } elseif (is_file($file)) { $this->copy($file, $target, $options['override'] ?? false); } else { - throw new IOException(sprintf('Unable to guess "%s" file type.', $file), 0, null, $file); + throw new IOException(\sprintf('Unable to guess "%s" file type.', $file), 0, null, $file); } } } @@ -610,7 +619,7 @@ public function tempnam(string $dir, string $prefix, string $suffix = ''): strin // Loop until we create a valid temp file or have reached 10 attempts for ($i = 0; $i < 10; ++$i) { // Create a unique filename - $tmpFile = $dir.'/'.$prefix.uniqid(mt_rand(), true).$suffix; + $tmpFile = $dir.'/'.$prefix.bin2hex(random_bytes(4)).$suffix; // Use fopen instead of file_exists as some streams do not support stat // Use mode 'x+' to atomically check existence and create to avoid a TOCTOU vulnerability @@ -634,14 +643,20 @@ public function tempnam(string $dir, string $prefix, string $suffix = ''): strin * * @throws IOException if the file cannot be written to */ - public function dumpFile(string $filename, $content) + public function dumpFile(string $filename, $content): void { if (\is_array($content)) { - throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be string or resource, array given.', __METHOD__)); + throw new \TypeError(\sprintf('Argument 2 passed to "%s()" must be string or resource, array given.', __METHOD__)); } $dir = \dirname($filename); + if (is_link($filename) && $linkTarget = $this->readlink($filename)) { + $this->dumpFile(Path::makeAbsolute($linkTarget, $dir), $content); + + return; + } + if (!is_dir($dir)) { $this->mkdir($dir); } @@ -652,14 +667,18 @@ public function dumpFile(string $filename, $content) try { if (false === self::box('file_put_contents', $tmpFile, $content)) { - throw new IOException(sprintf('Failed to write file "%s": ', $filename).self::$lastError, 0, null, $filename); + throw new IOException(\sprintf('Failed to write file "%s": ', $filename).self::$lastError, 0, null, $filename); } - self::box('chmod', $tmpFile, file_exists($filename) ? fileperms($filename) : 0666 & ~umask()); + self::box('chmod', $tmpFile, self::box('fileperms', $filename) ?: 0666 & ~umask()); $this->rename($tmpFile, $filename, true); } finally { if (file_exists($tmpFile)) { + if ('\\' === \DIRECTORY_SEPARATOR && !is_writable($tmpFile)) { + self::box('chmod', $tmpFile, self::box('fileperms', $tmpFile) | 0200); + } + self::box('unlink', $tmpFile); } } @@ -673,10 +692,10 @@ public function dumpFile(string $filename, $content) * * @throws IOException If the file is not writable */ - public function appendToFile(string $filename, $content/* , bool $lock = false */) + public function appendToFile(string $filename, $content, bool $lock = false): void { if (\is_array($content)) { - throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be string or resource, array given.', __METHOD__)); + throw new \TypeError(\sprintf('Argument 2 passed to "%s()" must be string or resource, array given.', __METHOD__)); } $dir = \dirname($filename); @@ -685,13 +704,30 @@ public function appendToFile(string $filename, $content/* , bool $lock = false * $this->mkdir($dir); } - $lock = \func_num_args() > 2 && func_get_arg(2); - if (false === self::box('file_put_contents', $filename, $content, \FILE_APPEND | ($lock ? \LOCK_EX : 0))) { - throw new IOException(sprintf('Failed to write file "%s": ', $filename).self::$lastError, 0, null, $filename); + throw new IOException(\sprintf('Failed to write file "%s": ', $filename).self::$lastError, 0, null, $filename); } } + /** + * Returns the content of a file as a string. + * + * @throws IOException If the file cannot be read + */ + public function readFile(string $filename): string + { + if (is_dir($filename)) { + throw new IOException(\sprintf('Failed to read file "%s": File is a directory.', $filename)); + } + + $content = self::box('file_get_contents', $filename); + if (false === $content) { + throw new IOException(\sprintf('Failed to read file "%s": ', $filename).self::$lastError, 0, null, $filename); + } + + return $content; + } + private function toIterable(string|iterable $files): iterable { return is_iterable($files) ? $files : [$files]; @@ -710,7 +746,7 @@ private function getSchemeAndHierarchy(string $filename): array private static function assertFunctionExists(string $func): void { if (!\function_exists($func)) { - throw new IOException(sprintf('Unable to perform filesystem operation because the "%s()" function has been disabled.', $func)); + throw new IOException(\sprintf('Unable to perform filesystem operation because the "%s()" function has been disabled.', $func)); } } @@ -719,7 +755,7 @@ private static function box(string $func, mixed ...$args): mixed self::assertFunctionExists($func); self::$lastError = null; - set_error_handler(__CLASS__.'::handleError'); + set_error_handler(self::handleError(...)); try { return $func(...$args); } finally { @@ -730,7 +766,7 @@ private static function box(string $func, mixed ...$args): mixed /** * @internal */ - public static function handleError(int $type, string $msg) + public static function handleError(int $type, string $msg): void { self::$lastError = $msg; } diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Path.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Path.php index 8ddbac8f..2f2e8790 100644 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Path.php +++ b/tools/php-cs-fixer/vendor/symfony/filesystem/Path.php @@ -42,12 +42,9 @@ final class Path * * @var array */ - private static $buffer = []; + private static array $buffer = []; - /** - * @var int - */ - private static $bufferSize = 0; + private static int $bufferSize = 0; /** * Canonicalizes the given path. @@ -257,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 ''; @@ -349,13 +346,13 @@ public static function changeExtension(string $path, string $extension): string $extension = ltrim($extension, '.'); // No extension for paths - if ('/' === substr($path, -1)) { + if (str_ends_with($path, '/')) { return $path; } // No actual extension in path - if (empty($actualExtension)) { - return $path.('.' === substr($path, -1) ? '' : '.').$extension; + if (!$actualExtension) { + return $path.(str_ends_with($path, '.') ? '' : '.').$extension; } return substr($path, 0, -\strlen($actualExtension)).$extension; @@ -368,7 +365,7 @@ public static function isAbsolute(string $path): bool } // Strip scheme - if (false !== $schemeSeparatorPosition = strpos($path, '://')) { + if (false !== ($schemeSeparatorPosition = strpos($path, '://')) && 1 !== $schemeSeparatorPosition) { $path = substr($path, $schemeSeparatorPosition + 3); } @@ -440,11 +437,11 @@ public static function isRelative(string $path): bool public static function makeAbsolute(string $path, string $basePath): string { if ('' === $basePath) { - throw new InvalidArgumentException(sprintf('The base path must be a non-empty string. Got: "%s".', $basePath)); + throw new InvalidArgumentException(\sprintf('The base path must be a non-empty string. Got: "%s".', $basePath)); } if (!self::isAbsolute($basePath)) { - throw new InvalidArgumentException(sprintf('The base path "%s" is not an absolute path.', $basePath)); + throw new InvalidArgumentException(\sprintf('The base path "%s" is not an absolute path.', $basePath)); } if (self::isAbsolute($path)) { @@ -534,12 +531,12 @@ public static function makeRelative(string $path, string $basePath): string // If the passed path is absolute, but the base path is not, we // cannot generate a relative path if ('' !== $root && '' === $baseRoot) { - throw new InvalidArgumentException(sprintf('The absolute path "%s" cannot be made relative to the relative path "%s". You should provide an absolute base path instead.', $path, $basePath)); + throw new InvalidArgumentException(\sprintf('The absolute path "%s" cannot be made relative to the relative path "%s". You should provide an absolute base path instead.', $path, $basePath)); } // Fail if the roots of the two paths are different if ($baseRoot && $root !== $baseRoot) { - throw new InvalidArgumentException(sprintf('The path "%s" cannot be made relative to "%s", because they have different roots ("%s" and "%s").', $path, $basePath, $root, $baseRoot)); + throw new InvalidArgumentException(\sprintf('The path "%s" cannot be made relative to "%s", because they have different roots ("%s" and "%s").', $path, $basePath, $root, $baseRoot)); } if ('' === $relativeBasePath) { @@ -671,7 +668,7 @@ public static function join(string ...$paths): string } // Only add slash if previous part didn't end with '/' or '\' - if (!\in_array(substr($finalPath, -1), ['/', '\\'])) { + if (!\in_array(substr($finalPath, -1), ['/', '\\'], true)) { $finalPath .= '/'; } diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/composer.json b/tools/php-cs-fixer/vendor/symfony/filesystem/composer.json index 10a7a531..c781e55b 100644 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/filesystem/composer.json @@ -16,10 +16,13 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, + "require-dev": { + "symfony/process": "^6.4|^7.0" + }, "autoload": { "psr-4": { "Symfony\\Component\\Filesystem\\": "" }, "exclude-from-classmap": [ diff --git a/tools/php-cs-fixer/vendor/symfony/finder/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/finder/CHANGELOG.md index 1a12afe6..e8383024 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/CHANGELOG.md +++ b/tools/php-cs-fixer/vendor/symfony/finder/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +6.4 +--- + + * Add early directory pruning to `Finder::filter()` + 6.2 --- diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/Comparator.php b/tools/php-cs-fixer/vendor/symfony/finder/Comparator/Comparator.php index bd685834..41c02ac6 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/Comparator.php +++ b/tools/php-cs-fixer/vendor/symfony/finder/Comparator/Comparator.php @@ -16,16 +16,16 @@ */ class Comparator { - private string $target; private string $operator; - public function __construct(string $target, string $operator = '==') - { + public function __construct( + private string $target, + string $operator = '==', + ) { if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { - throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); + throw new \InvalidArgumentException(\sprintf('Invalid operator "%s".', $operator)); } - $this->target = $target; $this->operator = $operator; } diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/DateComparator.php b/tools/php-cs-fixer/vendor/symfony/finder/Comparator/DateComparator.php index e0c523d0..bcf93cfb 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/DateComparator.php +++ b/tools/php-cs-fixer/vendor/symfony/finder/Comparator/DateComparator.php @@ -26,17 +26,17 @@ class DateComparator extends Comparator public function __construct(string $test) { if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test)); + throw new \InvalidArgumentException(\sprintf('Don\'t understand "%s" as a date test.', $test)); } try { $date = new \DateTimeImmutable($matches[2]); $target = $date->format('U'); } catch (\Exception) { - throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2])); + throw new \InvalidArgumentException(\sprintf('"%s" is not a valid date.', $matches[2])); } - $operator = $matches[1] ?? '=='; + $operator = $matches[1] ?: '=='; if ('since' === $operator || 'after' === $operator) { $operator = '>'; } diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/NumberComparator.php b/tools/php-cs-fixer/vendor/symfony/finder/Comparator/NumberComparator.php index dd308207..0ec0049f 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/NumberComparator.php +++ b/tools/php-cs-fixer/vendor/symfony/finder/Comparator/NumberComparator.php @@ -19,7 +19,7 @@ * magnitudes. * * The target value may use magnitudes of kilobytes (k, ki), - * megabytes (m, mi), or gigabytes (g, gi). Those suffixed + * megabytes (m, mi), or gigabytes (g, gi). Those suffixed * with an i use the appropriate 2**n version in accordance with the * IEC standard: http://physics.nist.gov/cuu/Units/binary.html * @@ -42,12 +42,12 @@ class NumberComparator extends Comparator public function __construct(?string $test) { if (null === $test || !preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test ?? 'null')); + throw new \InvalidArgumentException(\sprintf('Don\'t understand "%s" as a number test.', $test ?? 'null')); } $target = $matches[2]; if (!is_numeric($target)) { - throw new \InvalidArgumentException(sprintf('Invalid number "%s".', $target)); + throw new \InvalidArgumentException(\sprintf('Invalid number "%s".', $target)); } if (isset($matches[3])) { // magnitude diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Finder.php b/tools/php-cs-fixer/vendor/symfony/finder/Finder.php index 7baecdf9..78673af6 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/Finder.php +++ b/tools/php-cs-fixer/vendor/symfony/finder/Finder.php @@ -50,6 +50,7 @@ class Finder implements \IteratorAggregate, \Countable private array $notNames = []; private array $exclude = []; private array $filters = []; + private array $pruneFilters = []; private array $depths = []; private array $sizes = []; private bool $followLinks = false; @@ -123,7 +124,7 @@ public function files(): static public function depth(string|int|array $levels): static { foreach ((array) $levels as $level) { - $this->depths[] = new Comparator\NumberComparator($level); + $this->depths[] = new NumberComparator($level); } return $this; @@ -151,7 +152,7 @@ public function depth(string|int|array $levels): static public function date(string|array $dates): static { foreach ((array) $dates as $date) { - $this->dates[] = new Comparator\DateComparator($date); + $this->dates[] = new DateComparator($date); } return $this; @@ -162,8 +163,8 @@ public function date(string|array $dates): static * * You can use patterns (delimited with / sign), globs or simple strings. * - * $finder->name('*.php') - * $finder->name('/\.php$/') // same as above + * $finder->name('/\.php$/') + * $finder->name('*.php') // same as above, without dot files * $finder->name('test.php') * $finder->name(['test.py', 'test.php']) * @@ -306,7 +307,7 @@ public function notPath(string|array $patterns): static public function size(string|int|array $sizes): static { foreach ((array) $sizes as $size) { - $this->sizes[] = new Comparator\NumberComparator($size); + $this->sizes[] = new NumberComparator($size); } return $this; @@ -397,7 +398,7 @@ public function ignoreVCSIgnored(bool $ignoreVCSIgnored): static * * @param string|string[] $pattern VCS patterns to ignore */ - public static function addVCSPattern(string|array $pattern) + public static function addVCSPattern(string|array $pattern): void { foreach ((array) $pattern as $p) { self::$vcsPatterns[] = $p; @@ -435,7 +436,7 @@ public function sort(\Closure $closure): static */ public function sortByExtension(): static { - $this->sort = Iterator\SortableIterator::SORT_BY_EXTENSION; + $this->sort = SortableIterator::SORT_BY_EXTENSION; return $this; } @@ -451,7 +452,7 @@ public function sortByExtension(): static */ public function sortByName(bool $useNaturalSort = false): static { - $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME; + $this->sort = $useNaturalSort ? SortableIterator::SORT_BY_NAME_NATURAL : SortableIterator::SORT_BY_NAME; return $this; } @@ -467,7 +468,7 @@ public function sortByName(bool $useNaturalSort = false): static */ public function sortByCaseInsensitiveName(bool $useNaturalSort = false): static { - $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE : Iterator\SortableIterator::SORT_BY_NAME_CASE_INSENSITIVE; + $this->sort = $useNaturalSort ? SortableIterator::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE : SortableIterator::SORT_BY_NAME_CASE_INSENSITIVE; return $this; } @@ -483,7 +484,7 @@ public function sortByCaseInsensitiveName(bool $useNaturalSort = false): static */ public function sortBySize(): static { - $this->sort = Iterator\SortableIterator::SORT_BY_SIZE; + $this->sort = SortableIterator::SORT_BY_SIZE; return $this; } @@ -499,7 +500,7 @@ public function sortBySize(): static */ public function sortByType(): static { - $this->sort = Iterator\SortableIterator::SORT_BY_TYPE; + $this->sort = SortableIterator::SORT_BY_TYPE; return $this; } @@ -517,7 +518,7 @@ public function sortByType(): static */ public function sortByAccessedTime(): static { - $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME; + $this->sort = SortableIterator::SORT_BY_ACCESSED_TIME; return $this; } @@ -549,7 +550,7 @@ public function reverseSorting(): static */ public function sortByChangedTime(): static { - $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME; + $this->sort = SortableIterator::SORT_BY_CHANGED_TIME; return $this; } @@ -567,7 +568,7 @@ public function sortByChangedTime(): static */ public function sortByModifiedTime(): static { - $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME; + $this->sort = SortableIterator::SORT_BY_MODIFIED_TIME; return $this; } @@ -578,14 +579,21 @@ public function sortByModifiedTime(): static * The anonymous function receives a \SplFileInfo and must return false * to remove files. * + * @param \Closure(SplFileInfo): bool $closure + * @param bool $prune Whether to skip traversing directories further + * * @return $this * * @see CustomFilterIterator */ - public function filter(\Closure $closure): static + public function filter(\Closure $closure, bool $prune = false): static { $this->filters[] = $closure; + if ($prune) { + $this->pruneFilters[] = $closure; + } + return $this; } @@ -635,7 +643,7 @@ public function in(string|array $dirs): static sort($glob); $resolvedDirs[] = array_map($this->normalizeDir(...), $glob); } else { - throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir)); + throw new DirectoryNotFoundException(\sprintf('The "%s" directory does not exist.', $dir)); } } @@ -663,7 +671,7 @@ public function getIterator(): \Iterator $iterator = $this->searchInDirectory($this->dirs[0]); if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); + $iterator = (new SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); } return $iterator; @@ -671,9 +679,7 @@ public function getIterator(): \Iterator $iterator = new \AppendIterator(); foreach ($this->dirs as $dir) { - $iterator->append(new \IteratorIterator(new LazyIterator(function () use ($dir) { - return $this->searchInDirectory($dir); - }))); + $iterator->append(new \IteratorIterator(new LazyIterator(fn () => $this->searchInDirectory($dir)))); } foreach ($this->iterators as $it) { @@ -681,7 +687,7 @@ public function getIterator(): \Iterator } if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); + $iterator = (new SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); } return $iterator; @@ -693,8 +699,6 @@ public function getIterator(): \Iterator * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. * * @return $this - * - * @throws \InvalidArgumentException when the given argument is not iterable */ public function append(iterable $iterator): static { @@ -702,15 +706,13 @@ public function append(iterable $iterator): static $this->iterators[] = $iterator->getIterator(); } elseif ($iterator instanceof \Iterator) { $this->iterators[] = $iterator; - } elseif (is_iterable($iterator)) { + } else { $it = new \ArrayIterator(); foreach ($iterator as $file) { $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file); $it[$file->getPathname()] = $file; } $this->iterators[] = $it; - } else { - throw new \InvalidArgumentException('Finder::append() method wrong argument type.'); } return $this; @@ -741,6 +743,10 @@ private function searchInDirectory(string $dir): \Iterator $exclude = $this->exclude; $notPaths = $this->notPaths; + if ($this->pruneFilters) { + $exclude = array_merge($exclude, $this->pruneFilters); + } + if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) { $exclude = array_merge($exclude, self::$vcsPatterns); } @@ -780,13 +786,13 @@ private function searchInDirectory(string $dir): \Iterator $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs); if ($exclude) { - $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $exclude); + $iterator = new ExcludeDirectoryFilterIterator($iterator, $exclude); } $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) { - $iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth); + $iterator = new DepthRangeFilterIterator($iterator, $minDepth, $maxDepth); } if ($this->mode) { @@ -794,23 +800,23 @@ private function searchInDirectory(string $dir): \Iterator } if ($this->names || $this->notNames) { - $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames); + $iterator = new FilenameFilterIterator($iterator, $this->names, $this->notNames); } if ($this->contains || $this->notContains) { - $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains); + $iterator = new FilecontentFilterIterator($iterator, $this->contains, $this->notContains); } if ($this->sizes) { - $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes); + $iterator = new SizeRangeFilterIterator($iterator, $this->sizes); } if ($this->dates) { - $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates); + $iterator = new DateRangeFilterIterator($iterator, $this->dates); } if ($this->filters) { - $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters); + $iterator = new CustomFilterIterator($iterator, $this->filters); } if ($this->paths || $notPaths) { diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Gitignore.php b/tools/php-cs-fixer/vendor/symfony/finder/Gitignore.php index 070074b3..bf05c5b3 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/Gitignore.php +++ b/tools/php-cs-fixer/vendor/symfony/finder/Gitignore.php @@ -79,9 +79,7 @@ private static function lineToRegex(string $gitignoreLine): string } $regex = preg_quote(str_replace('\\', '', $gitignoreLine), '~'); - $regex = preg_replace_callback('~\\\\\[((?:\\\\!)?)([^\[\]]*)\\\\\]~', function (array $matches): string { - return '['.('' !== $matches[1] ? '^' : '').str_replace('\\-', '-', $matches[2]).']'; - }, $regex); + $regex = preg_replace_callback('~\\\\\[((?:\\\\!)?)([^\[\]]*)\\\\\]~', fn (array $matches): string => '['.('' !== $matches[1] ? '^' : '').str_replace('\\-', '-', $matches[2]).']', $regex); $regex = preg_replace('~(?:(?:\\\\\*){2,}(/?))+~', '(?:(?:(?!//).(? */ private \Iterator $iterator; private bool $isRecursive; + /** @var array */ private array $excludedDirs = []; private ?string $excludedPattern = null; + /** @var list */ + private array $pruneFilters = []; /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $directories An array of directories to exclude + * @param \Iterator $iterator The Iterator to filter + * @param list $directories An array of directories to exclude */ public function __construct(\Iterator $iterator, array $directories) { @@ -40,6 +43,16 @@ public function __construct(\Iterator $iterator, array $directories) $this->isRecursive = $iterator instanceof \RecursiveIterator; $patterns = []; foreach ($directories as $directory) { + if (!\is_string($directory)) { + if (!\is_callable($directory)) { + throw new \InvalidArgumentException('Invalid PHP callback.'); + } + + $this->pruneFilters[] = $directory; + + continue; + } + $directory = rtrim($directory, '/'); if (!$this->isRecursive || str_contains($directory, '/')) { $patterns[] = preg_quote($directory, '#'); @@ -70,6 +83,14 @@ public function accept(): bool return !preg_match($this->excludedPattern, $path); } + if ($this->pruneFilters && $this->hasChildren()) { + foreach ($this->pruneFilters as $pruneFilter) { + if (!$pruneFilter($this->current())) { + return false; + } + } + } + return true; } diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php index 21303781..0d4a5fd3 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +++ b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php @@ -23,16 +23,14 @@ class FileTypeFilterIterator extends \FilterIterator public const ONLY_FILES = 1; public const ONLY_DIRECTORIES = 2; - private int $mode; - /** * @param \Iterator $iterator The Iterator to filter * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES) */ - public function __construct(\Iterator $iterator, int $mode) - { - $this->mode = $mode; - + public function __construct( + \Iterator $iterator, + private int $mode, + ) { parent::__construct($iterator); } diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php index 82a9df30..3450c49d 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +++ b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php @@ -23,8 +23,8 @@ */ abstract class MultiplePcreFilterIterator extends \FilterIterator { - protected $matchRegexps = []; - protected $noMatchRegexps = []; + protected array $matchRegexps = []; + protected array $noMatchRegexps = []; /** * @param \Iterator $iterator The Iterator to filter @@ -80,11 +80,7 @@ protected function isAccepted(string $string): bool */ protected function isRegex(string $str): bool { - $availableModifiers = 'imsxuADU'; - - if (\PHP_VERSION_ID >= 80200) { - $availableModifiers .= 'n'; - } + $availableModifiers = 'imsxuADUn'; if (preg_match('/^(.{3,}?)['.$availableModifiers.']*$/', $str, $m)) { $start = substr($m[1], 0, 1); diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php index 3582e6c1..f5fd2d4d 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php @@ -24,7 +24,7 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator { private bool $ignoreUnreadableDirs; - private ?bool $rewindable = null; + private bool $ignoreFirstRewind = true; // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations private string $rootPath; @@ -63,8 +63,9 @@ public function current(): SplFileInfo $subPathname .= $this->directorySeparator; } $subPathname .= $this->getFilename(); + $basePath = $this->rootPath; - if ('/' !== $basePath = $this->rootPath) { + if ('/' !== $basePath && !str_ends_with($basePath, $this->directorySeparator) && !str_ends_with($basePath, '/')) { $basePath .= $this->directorySeparator; } @@ -102,7 +103,6 @@ public function getChildren(): \RecursiveDirectoryIterator $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; // performance optimization to avoid redoing the same work in all children - $children->rewindable = &$this->rewindable; $children->rootPath = $this->rootPath; } @@ -112,36 +112,23 @@ public function getChildren(): \RecursiveDirectoryIterator } } - /** - * Do nothing for non rewindable stream. - */ - public function rewind(): void + public function next(): void { - if (false === $this->isRewindable()) { - return; - } + $this->ignoreFirstRewind = false; - parent::rewind(); + parent::next(); } - /** - * Checks if the stream is rewindable. - */ - public function isRewindable(): bool + public function rewind(): void { - if (null !== $this->rewindable) { - return $this->rewindable; - } - - if (false !== $stream = @opendir($this->getPath())) { - $infos = stream_get_meta_data($stream); - closedir($stream); + // some streams like FTP are not rewindable, ignore the first rewind after creation, + // as newly created DirectoryIterator does not need to be rewound + if ($this->ignoreFirstRewind) { + $this->ignoreFirstRewind = false; - if ($infos['seekable']) { - return $this->rewindable = true; - } + return; } - return $this->rewindable = false; + parent::rewind(); } } diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/SortableIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/SortableIterator.php index e8b55650..177cd0b6 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/SortableIterator.php +++ b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/SortableIterator.php @@ -48,21 +48,13 @@ public function __construct(\Traversable $iterator, int|callable $sort, bool $re $order = $reverseOrder ? -1 : 1; if (self::SORT_BY_NAME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); } elseif (self::SORT_BY_NAME_NATURAL === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); } elseif (self::SORT_BY_NAME_CASE_INSENSITIVE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); } elseif (self::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strnatcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); } elseif (self::SORT_BY_TYPE === $sort) { $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { if ($a->isDir() && $b->isFile()) { @@ -74,29 +66,19 @@ public function __construct(\Traversable $iterator, int|callable $sort, bool $re return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); }; } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getATime() - $b->getATime()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getATime() - $b->getATime()); } elseif (self::SORT_BY_CHANGED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getCTime() - $b->getCTime()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getCTime() - $b->getCTime()); } elseif (self::SORT_BY_MODIFIED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getMTime() - $b->getMTime()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getMTime() - $b->getMTime()); } elseif (self::SORT_BY_EXTENSION === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcmp($a->getExtension(), $b->getExtension()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strnatcmp($a->getExtension(), $b->getExtension()); } elseif (self::SORT_BY_SIZE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getSize() - $b->getSize()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getSize() - $b->getSize()); } elseif (self::SORT_BY_NONE === $sort) { $this->sort = $order; } elseif (\is_callable($sort)) { - $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort(...); + $this->sort = $reverseOrder ? static fn (\SplFileInfo $a, \SplFileInfo $b) => -$sort($a, $b) : $sort(...); } else { throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); } diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php index 29fc2d99..b278706e 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +++ b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php @@ -18,20 +18,17 @@ */ final class VcsIgnoredFilterIterator extends \FilterIterator { - /** - * @var string - */ - private $baseDir; + private string $baseDir; /** * @var array */ - private $gitignoreFilesCache = []; + private array $gitignoreFilesCache = []; /** * @var array */ - private $ignoredPathsCache = []; + private array $ignoredPathsCache = []; /** * @param \Iterator $iterator @@ -40,9 +37,9 @@ public function __construct(\Iterator $iterator, string $baseDir) { $this->baseDir = $this->normalizePath($baseDir); - foreach ($this->parentDirectoriesUpwards($this->baseDir) as $parentDirectory) { - if (@is_dir("{$parentDirectory}/.git")) { - $this->baseDir = $parentDirectory; + foreach ([$this->baseDir, ...$this->parentDirectoriesUpwards($this->baseDir)] as $directory) { + if (@is_dir("{$directory}/.git")) { + $this->baseDir = $directory; break; } } @@ -126,9 +123,7 @@ private function parentDirectoriesUpTo(string $from, string $upTo): array { return array_filter( $this->parentDirectoriesUpwards($from), - static function (string $directory) use ($upTo): bool { - return str_starts_with($directory, $upTo); - } + static fn (string $directory): bool => str_starts_with($directory, $upTo) ); } diff --git a/tools/php-cs-fixer/vendor/symfony/finder/SplFileInfo.php b/tools/php-cs-fixer/vendor/symfony/finder/SplFileInfo.php index 867e8e81..2afc3782 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/SplFileInfo.php +++ b/tools/php-cs-fixer/vendor/symfony/finder/SplFileInfo.php @@ -18,19 +18,17 @@ */ class SplFileInfo extends \SplFileInfo { - private string $relativePath; - private string $relativePathname; - /** * @param string $file The file name * @param string $relativePath The relative path * @param string $relativePathname The relative path name */ - public function __construct(string $file, string $relativePath, string $relativePathname) - { + public function __construct( + string $file, + private string $relativePath, + private string $relativePathname, + ) { parent::__construct($file); - $this->relativePath = $relativePath; - $this->relativePathname = $relativePathname; } /** diff --git a/tools/php-cs-fixer/vendor/symfony/finder/composer.json b/tools/php-cs-fixer/vendor/symfony/finder/composer.json index 06d129c5..2b70600d 100644 --- a/tools/php-cs-fixer/vendor/symfony/finder/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/finder/composer.json @@ -16,10 +16,10 @@ } ], "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "symfony/filesystem": "^6.0" + "symfony/filesystem": "^6.4|^7.0" }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" }, diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/options-resolver/CHANGELOG.md index 791a402f..f4de6d01 100644 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/CHANGELOG.md +++ b/tools/php-cs-fixer/vendor/symfony/options-resolver/CHANGELOG.md @@ -1,6 +1,16 @@ CHANGELOG ========= +6.4 +--- + +* Improve message with full path on invalid type in nested option + +6.3 +--- + + * Add `OptionsResolver::setIgnoreUndefined()` and `OptionConfigurator::ignoreUndefined()` to ignore not defined options while resolving + 6.0 --- diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php index 837fae08..dab741b4 100644 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php +++ b/tools/php-cs-fixer/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php @@ -22,14 +22,14 @@ */ class OptionsResolverIntrospector { - private $get; + private \Closure $get; public function __construct(OptionsResolver $optionsResolver) { $this->get = \Closure::bind(function ($property, $option, $message) { /** @var OptionsResolver $this */ if (!$this->isDefined($option)) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist.', $option)); + throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist.', $option)); } if (!\array_key_exists($option, $this->{$property})) { @@ -45,7 +45,7 @@ public function __construct(OptionsResolver $optionsResolver) */ public function getDefault(string $option): mixed { - return ($this->get)('defaults', $option, sprintf('No default value was set for the "%s" option.', $option)); + return ($this->get)('defaults', $option, \sprintf('No default value was set for the "%s" option.', $option)); } /** @@ -55,7 +55,7 @@ public function getDefault(string $option): mixed */ public function getLazyClosures(string $option): array { - return ($this->get)('lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option)); + return ($this->get)('lazy', $option, \sprintf('No lazy closures were set for the "%s" option.', $option)); } /** @@ -65,7 +65,7 @@ public function getLazyClosures(string $option): array */ public function getAllowedTypes(string $option): array { - return ($this->get)('allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option)); + return ($this->get)('allowedTypes', $option, \sprintf('No allowed types were set for the "%s" option.', $option)); } /** @@ -75,7 +75,7 @@ public function getAllowedTypes(string $option): array */ public function getAllowedValues(string $option): array { - return ($this->get)('allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option)); + return ($this->get)('allowedValues', $option, \sprintf('No allowed values were set for the "%s" option.', $option)); } /** @@ -91,7 +91,7 @@ public function getNormalizer(string $option): \Closure */ public function getNormalizers(string $option): array { - return ($this->get)('normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option)); + return ($this->get)('normalizers', $option, \sprintf('No normalizer was set for the "%s" option.', $option)); } /** @@ -99,6 +99,6 @@ public function getNormalizers(string $option): array */ public function getDeprecation(string $option): array { - return ($this->get)('deprecated', $option, sprintf('No deprecation was set for the "%s" option.', $option)); + return ($this->get)('deprecated', $option, \sprintf('No deprecation was set for the "%s" option.', $option)); } } diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionConfigurator.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionConfigurator.php index 37d51384..e708c2ce 100644 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionConfigurator.php +++ b/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionConfigurator.php @@ -15,13 +15,10 @@ final class OptionConfigurator { - private $name; - private $resolver; - - public function __construct(string $name, OptionsResolver $resolver) - { - $this->name = $name; - $this->resolver = $resolver; + public function __construct( + private string $name, + private OptionsResolver $resolver, + ) { $this->resolver->setDefined($name); } @@ -134,4 +131,16 @@ public function info(string $info): static return $this; } + + /** + * Sets whether ignore undefined options. + * + * @return $this + */ + public function ignoreUndefined(bool $ignore = true): static + { + $this->resolver->setIgnoreUndefined($ignore); + + return $this; + } } diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionsResolver.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionsResolver.php index e22265f1..8d1d8f70 100644 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionsResolver.php +++ b/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionsResolver.php @@ -50,73 +50,73 @@ class OptionsResolver implements Options /** * The names of all defined options. */ - private $defined = []; + private array $defined = []; /** * The default option values. */ - private $defaults = []; + private array $defaults = []; /** * A list of closure for nested options. * * @var \Closure[][] */ - private $nested = []; + private array $nested = []; /** * The names of required options. */ - private $required = []; + private array $required = []; /** * The resolved option values. */ - private $resolved = []; + private array $resolved = []; /** * A list of normalizer closures. * * @var \Closure[][] */ - private $normalizers = []; + private array $normalizers = []; /** * A list of accepted values for each option. */ - private $allowedValues = []; + private array $allowedValues = []; /** * A list of accepted types for each option. */ - private $allowedTypes = []; + private array $allowedTypes = []; /** * A list of info messages for each option. */ - private $info = []; + private array $info = []; /** * A list of closures for evaluating lazy options. */ - private $lazy = []; + private array $lazy = []; /** * A list of lazy options whose closure is currently being called. * * This list helps detecting circular dependencies between lazy options. */ - private $calling = []; + private array $calling = []; /** * A list of deprecated options. */ - private $deprecated = []; + private array $deprecated = []; /** * The list of options provided by the user. */ - private $given = []; + private array $given = []; /** * Whether the instance is locked for reading. @@ -126,19 +126,24 @@ class OptionsResolver implements Options * process. If any option is changed after being read, all evaluated * lazy options that depend on this option would become invalid. */ - private $locked = false; + private bool $locked = false; - private $parentsOptions = []; + private array $parentsOptions = []; /** * Whether the whole options definition is marked as array prototype. */ - private $prototype; + private ?bool $prototype = null; /** * The prototype array's index that is being read. */ - private $prototypeIndex; + private int|string|null $prototypeIndex = null; + + /** + * Whether to ignore undefined options. + */ + private bool $ignoreUndefined = false; /** * Sets the default value of a given option. @@ -227,7 +232,7 @@ public function setDefault(string $option, mixed $value): static return $this; } - if (isset($params[0]) && null !== ($type = $params[0]->getType()) && self::class === $type->getName() && (!isset($params[1]) || (($type = $params[1]->getType()) instanceof \ReflectionNamedType && Options::class === $type->getName()))) { + if (isset($params[0]) && ($type = $params[0]->getType()) instanceof \ReflectionNamedType && self::class === $type->getName() && (!isset($params[1]) || (($type = $params[1]->getType()) instanceof \ReflectionNamedType && Options::class === $type->getName()))) { // Store closure for later evaluation $this->nested[$option][] = $value; $this->defaults[$option] = []; @@ -433,11 +438,11 @@ public function setDeprecated(string $option, string $package, string $version, } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist, defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist, defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } if (!\is_string($message) && !$message instanceof \Closure) { - throw new InvalidArgumentException(sprintf('Invalid type for deprecation message argument, expected string or \Closure, but got "%s".', get_debug_type($message))); + throw new InvalidArgumentException(\sprintf('Invalid type for deprecation message argument, expected string or \Closure, but got "%s".', get_debug_type($message))); } // ignore if empty string @@ -485,14 +490,14 @@ public function isDeprecated(string $option): bool * @throws UndefinedOptionsException If the option is undefined * @throws AccessException If called from a lazy option or normalizer */ - public function setNormalizer(string $option, \Closure $normalizer) + public function setNormalizer(string $option, \Closure $normalizer): static { if ($this->locked) { throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.'); } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } $this->normalizers[$option] = [$normalizer]; @@ -533,7 +538,7 @@ public function addNormalizer(string $option, \Closure $normalizer, bool $forceP } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } if ($forcePrepend) { @@ -569,14 +574,14 @@ public function addNormalizer(string $option, \Closure $normalizer, bool $forceP * @throws UndefinedOptionsException If the option is undefined * @throws AccessException If called from a lazy option or normalizer */ - public function setAllowedValues(string $option, mixed $allowedValues) + public function setAllowedValues(string $option, mixed $allowedValues): static { if ($this->locked) { throw new AccessException('Allowed values cannot be set from a lazy option or normalizer.'); } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } $this->allowedValues[$option] = \is_array($allowedValues) ? $allowedValues : [$allowedValues]; @@ -609,14 +614,14 @@ public function setAllowedValues(string $option, mixed $allowedValues) * @throws UndefinedOptionsException If the option is undefined * @throws AccessException If called from a lazy option or normalizer */ - public function addAllowedValues(string $option, mixed $allowedValues) + public function addAllowedValues(string $option, mixed $allowedValues): static { if ($this->locked) { throw new AccessException('Allowed values cannot be added from a lazy option or normalizer.'); } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } if (!\is_array($allowedValues)) { @@ -649,14 +654,14 @@ public function addAllowedValues(string $option, mixed $allowedValues) * @throws UndefinedOptionsException If the option is undefined * @throws AccessException If called from a lazy option or normalizer */ - public function setAllowedTypes(string $option, string|array $allowedTypes) + public function setAllowedTypes(string $option, string|array $allowedTypes): static { if ($this->locked) { throw new AccessException('Allowed types cannot be set from a lazy option or normalizer.'); } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } $this->allowedTypes[$option] = (array) $allowedTypes; @@ -683,14 +688,14 @@ public function setAllowedTypes(string $option, string|array $allowedTypes) * @throws UndefinedOptionsException If the option is undefined * @throws AccessException If called from a lazy option or normalizer */ - public function addAllowedTypes(string $option, string|array $allowedTypes) + public function addAllowedTypes(string $option, string|array $allowedTypes): static { if ($this->locked) { throw new AccessException('Allowed types cannot be added from a lazy option or normalizer.'); } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } if (!isset($this->allowedTypes[$option])) { @@ -711,7 +716,7 @@ public function addAllowedTypes(string $option, string|array $allowedTypes) public function define(string $option): OptionConfigurator { if (isset($this->defined[$option])) { - throw new OptionDefinitionException(sprintf('The option "%s" is already defined.', $option)); + throw new OptionDefinitionException(\sprintf('The option "%s" is already defined.', $option)); } return new OptionConfigurator($option, $this); @@ -732,7 +737,7 @@ public function setInfo(string $option, string $info): static } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } $this->info[$option] = $info; @@ -746,7 +751,7 @@ public function setInfo(string $option, string $info): static public function getInfo(string $option): ?string { if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } return $this->info[$option] ?? null; @@ -862,17 +867,21 @@ public function resolve(array $options = []): array $clone = clone $this; // Make sure that no unknown options are passed - $diff = array_diff_key($options, $clone->defined); + $diff = $this->ignoreUndefined ? [] : array_diff_key($options, $clone->defined); if (\count($diff) > 0) { ksort($clone->defined); ksort($diff); - throw new UndefinedOptionsException(sprintf((\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".', $this->formatOptions(array_keys($diff)), implode('", "', array_keys($clone->defined)))); + throw new UndefinedOptionsException(\sprintf((\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".', $this->formatOptions(array_keys($diff)), implode('", "', array_keys($clone->defined)))); } // Override options set by the user foreach ($options as $option => $value) { + if ($this->ignoreUndefined && !isset($clone->defined[$option])) { + continue; + } + $clone->given[$option] = true; $clone->defaults[$option] = $value; unset($clone->resolved[$option], $clone->lazy[$option]); @@ -884,7 +893,7 @@ public function resolve(array $options = []): array if (\count($diff) > 0) { ksort($diff); - throw new MissingOptionsException(sprintf(\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.', $this->formatOptions(array_keys($diff)))); + throw new MissingOptionsException(\sprintf(\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.', $this->formatOptions(array_keys($diff)))); } // Lock the container @@ -930,10 +939,10 @@ public function offsetGet(mixed $option, bool $triggerDeprecation = true): mixed // Check whether the option is set at all if (!isset($this->defaults[$option]) && !\array_key_exists($option, $this->defaults)) { if (!isset($this->defined[$option])) { - throw new NoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + throw new NoSuchOptionException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } - throw new NoSuchOptionException(sprintf('The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.', $this->formatOptions([$option]))); + throw new NoSuchOptionException(\sprintf('The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.', $this->formatOptions([$option]))); } $value = $this->defaults[$option]; @@ -942,11 +951,11 @@ public function offsetGet(mixed $option, bool $triggerDeprecation = true): mixed if (isset($this->nested[$option])) { // If the closure is already being called, we have a cyclic dependency if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); + throw new OptionDefinitionException(\sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); } if (!\is_array($value)) { - throw new InvalidOptionsException(sprintf('The nested option "%s" with value %s is expected to be of type array, but is of type "%s".', $this->formatOptions([$option]), $this->formatValue($value), get_debug_type($value))); + throw new InvalidOptionsException(\sprintf('The nested option "%s" with value %s is expected to be of type array, but is of type "%s".', $this->formatOptions([$option]), $this->formatValue($value), get_debug_type($value))); } // The following section must be protected from cyclic calls. @@ -964,7 +973,7 @@ public function offsetGet(mixed $option, bool $triggerDeprecation = true): mixed $values = []; foreach ($value as $index => $prototypeValue) { if (!\is_array($prototypeValue)) { - throw new InvalidOptionsException(sprintf('The value of the option "%s" is expected to be of type array of array, but is of type array of "%s".', $this->formatOptions([$option]), get_debug_type($prototypeValue))); + throw new InvalidOptionsException(\sprintf('The value of the option "%s" is expected to be of type array of array, but is of type array of "%s".', $this->formatOptions([$option]), get_debug_type($prototypeValue))); } $resolver->prototypeIndex = $index; @@ -985,7 +994,7 @@ public function offsetGet(mixed $option, bool $triggerDeprecation = true): mixed // If the closure is already being called, we have a cyclic // dependency if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); + throw new OptionDefinitionException(\sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); } // The following section must be protected from cyclic @@ -1018,15 +1027,13 @@ public function offsetGet(mixed $option, bool $triggerDeprecation = true): mixed $fmtActualValue = $this->formatValue($value); $fmtAllowedTypes = implode('" or "', $this->allowedTypes[$option]); $fmtProvidedTypes = implode('|', array_keys($invalidTypes)); - $allowedContainsArrayType = \count(array_filter($this->allowedTypes[$option], static function ($item) { - return str_ends_with($item, '[]'); - })) > 0; + $allowedContainsArrayType = \count(array_filter($this->allowedTypes[$option], static fn ($item) => str_ends_with($item, '[]'))) > 0; if (\is_array($value) && $allowedContainsArrayType) { - throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but one of the elements is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); + throw new InvalidOptionsException(\sprintf('The option "%s" with value %s is expected to be of type "%s", but one of the elements is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); } - throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); + throw new InvalidOptionsException(\sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); } } @@ -1055,21 +1062,21 @@ public function offsetGet(mixed $option, bool $triggerDeprecation = true): mixed } if (!$success) { - $message = sprintf( + $message = \sprintf( 'The option "%s" with value %s is invalid.', - $option, + $this->formatOptions([$option]), $this->formatValue($value) ); if (\count($printableAllowedValues) > 0) { - $message .= sprintf( + $message .= \sprintf( ' Accepted values are: %s.', $this->formatValues($printableAllowedValues) ); } if (isset($this->info[$option])) { - $message .= sprintf(' Info: %s.', $this->info[$option]); + $message .= \sprintf(' Info: %s.', $this->info[$option]); } throw new InvalidOptionsException($message); @@ -1085,13 +1092,13 @@ public function offsetGet(mixed $option, bool $triggerDeprecation = true): mixed if ($message instanceof \Closure) { // If the closure is already being called, we have a cyclic dependency if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); + throw new OptionDefinitionException(\sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); } $this->calling[$option] = true; try { if (!\is_string($message = $message($this, $value))) { - throw new InvalidOptionsException(sprintf('Invalid type for deprecation message, expected string but got "%s", return an empty string to ignore.', get_debug_type($message))); + throw new InvalidOptionsException(\sprintf('Invalid type for deprecation message, expected string but got "%s", return an empty string to ignore.', get_debug_type($message))); } } finally { unset($this->calling[$option]); @@ -1108,7 +1115,7 @@ public function offsetGet(mixed $option, bool $triggerDeprecation = true): mixed // If the closure is already being called, we have a cyclic // dependency if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); + throw new OptionDefinitionException(\sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); } // The following section must be protected from cyclic @@ -1212,6 +1219,18 @@ public function count(): int return \count($this->defaults); } + /** + * Sets whether ignore undefined options. + * + * @return $this + */ + public function setIgnoreUndefined(bool $ignore = true): static + { + $this->ignoreUndefined = $ignore; + + return $this; + } + /** * Returns a string representation of the value. * @@ -1274,16 +1293,14 @@ private function formatOptions(array $options): string if ($this->parentsOptions) { $prefix = array_shift($this->parentsOptions); if ($this->parentsOptions) { - $prefix .= sprintf('[%s]', implode('][', $this->parentsOptions)); + $prefix .= \sprintf('[%s]', implode('][', $this->parentsOptions)); } if ($this->prototype && null !== $this->prototypeIndex) { - $prefix .= sprintf('[%s]', $this->prototypeIndex); + $prefix .= \sprintf('[%s]', $this->prototypeIndex); } - $options = array_map(static function (string $option) use ($prefix): string { - return sprintf('%s[%s]', $prefix, $option); - }, $options); + $options = array_map(static fn (string $option): string => \sprintf('%s[%s]', $prefix, $option), $options); } return implode('", "', $options); diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/composer.json b/tools/php-cs-fixer/vendor/symfony/options-resolver/composer.json index 3355b24e..e70640d6 100644 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/options-resolver/composer.json @@ -16,8 +16,8 @@ } ], "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" }, "autoload": { "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" }, diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/LICENSE index 3f853aaf..7536caea 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/LICENSE +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2019 Fabien Potencier +Copyright (c) 2018-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/composer.json index 1b3efff5..131ca7ad 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -30,9 +30,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/LICENSE index 4cd8bdd3..6e3afce6 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/LICENSE +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/composer.json index fde5537f..0eea417d 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Intl\\Grapheme\\": "" }, @@ -27,9 +27,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/LICENSE index 4cd8bdd3..6e3afce6 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/LICENSE +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/composer.json index 65f72d64..9bd04e88 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, @@ -28,9 +28,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/LICENSE index 4cd8bdd3..6e3afce6 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/LICENSE +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Mbstring.php b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Mbstring.php index bce5c4a8..3d45c9d9 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -48,6 +48,11 @@ * - mb_strstr - Finds first occurrence of a string within another * - mb_strwidth - Return width of string * - mb_substr_count - Count the number of substring occurrences + * - mb_ucfirst - Make a string's first character uppercase + * - mb_lcfirst - Make a string's first character lowercase + * - mb_trim - Strip whitespace (or other characters) from the beginning and end of a string + * - mb_ltrim - Strip whitespace (or other characters) from the beginning of a string + * - mb_rtrim - Strip whitespace (or other characters) from the end of a string * * Not implemented: * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) @@ -69,7 +74,7 @@ final class Mbstring { public const MB_CASE_FOLD = \PHP_INT_MAX; - private const CASE_FOLD = [ + private const SIMPLE_CASE_FOLD = [ ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], ]; @@ -80,6 +85,15 @@ final class Mbstring public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { + if (\is_array($s)) { + $r = []; + foreach ($s as $str) { + $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); + } + + return $r; + } + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { @@ -301,7 +315,11 @@ public static function mb_convert_case($s, $mode, $encoding = null) $map = $upper; } else { if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); + static $caseFolding = null; + if (null === $caseFolding) { + $caseFolding = self::getData('caseFolding'); + } + $s = strtr($s, $caseFolding); } static $lower = null; @@ -413,7 +431,20 @@ public static function mb_check_encoding($var = null, $encoding = null) $encoding = self::$internalEncoding; } - return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + if (!\is_array($var)) { + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + } + + foreach ($var as $key => $value) { + if (!self::mb_check_encoding($key, $encoding)) { + return false; + } + if (!self::mb_check_encoding($value, $encoding)) { + return false; + } + } + + return true; } public static function mb_detect_encoding($str, $encodingList = null, $strict = false) @@ -638,8 +669,10 @@ public static function mb_substr($s, $start, $length = null, $encoding = null) public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ + self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), + self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), + ]); return self::mb_strpos($haystack, $needle, $offset, $encoding); } @@ -674,8 +707,11 @@ public static function mb_strrichr($haystack, $needle, $part = false, $encoding public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); + $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); + + $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); + $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); return self::mb_strrpos($haystack, $needle, $offset, $encoding); } @@ -798,6 +834,69 @@ public static function mb_ord($s, $encoding = null) return $code; } + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string + { + if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { + throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); + } + + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given'); + } + + if (self::mb_strlen($pad_string, $encoding) <= 0) { + throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); + } + + $paddingRequired = $length - self::mb_strlen($string, $encoding); + + if ($paddingRequired < 1) { + return $string; + } + + switch ($pad_type) { + case \STR_PAD_LEFT: + return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; + case \STR_PAD_RIGHT: + return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); + default: + $leftPaddingLength = floor($paddingRequired / 2); + $rightPaddingLength = $paddingRequired - $leftPaddingLength; + + return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); + } + } + + public static function mb_ucfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + public static function mb_lcfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + private static function getSubpart($pos, $part, $haystack, $encoding) { if (false === $pos) { @@ -871,4 +970,76 @@ private static function getEncoding($encoding) return $encoding; } + + public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{[%s]+$}D', $string, $characters, $encoding, __FUNCTION__); + } + + private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, $function.'(): Argument #3 ($encoding) must be a valid encoding, "%s" given'); + } + + if ('' === $characters) { + return null === $encoding ? $string : self::mb_convert_encoding($string, $encoding); + } + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $string)) { + $string = @iconv('UTF-8', 'UTF-8//IGNORE', $string); + } + if (null !== $characters && !preg_match('//u', $characters)) { + $characters = @iconv('UTF-8', 'UTF-8//IGNORE', $characters); + } + } else { + $string = iconv($encoding, 'UTF-8//IGNORE', $string); + + if (null !== $characters) { + $characters = iconv($encoding, 'UTF-8//IGNORE', $characters); + } + } + + if (null === $characters) { + $characters = "\\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}"; + } else { + $characters = preg_quote($characters); + } + + $string = preg_replace(sprintf($regex, $characters), '', $string); + + if (null === $encoding) { + return $string; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $string); + } + + private static function assertEncoding(string $encoding, string $errorFormat): void + { + try { + $validEncoding = @self::mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(sprintf($errorFormat, $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(sprintf($errorFormat, $encoding)); + } + } } diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php new file mode 100644 index 00000000..512bba0b --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php @@ -0,0 +1,119 @@ + 'i̇', + 'µ' => 'μ', + 'ſ' => 's', + 'ͅ' => 'ι', + 'ς' => 'σ', + 'ϐ' => 'β', + 'ϑ' => 'θ', + 'ϕ' => 'φ', + 'ϖ' => 'π', + 'ϰ' => 'κ', + 'ϱ' => 'ρ', + 'ϵ' => 'ε', + 'ẛ' => 'ṡ', + 'ι' => 'ι', + 'ß' => 'ss', + 'ʼn' => 'ʼn', + 'ǰ' => 'ǰ', + 'ΐ' => 'ΐ', + 'ΰ' => 'ΰ', + 'և' => 'եւ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'ẘ', + 'ẙ' => 'ẙ', + 'ẚ' => 'aʾ', + 'ẞ' => 'ss', + 'ὐ' => 'ὐ', + 'ὒ' => 'ὒ', + 'ὔ' => 'ὔ', + 'ὖ' => 'ὖ', + 'ᾀ' => 'ἀι', + 'ᾁ' => 'ἁι', + 'ᾂ' => 'ἂι', + 'ᾃ' => 'ἃι', + 'ᾄ' => 'ἄι', + 'ᾅ' => 'ἅι', + 'ᾆ' => 'ἆι', + 'ᾇ' => 'ἇι', + 'ᾈ' => 'ἀι', + 'ᾉ' => 'ἁι', + 'ᾊ' => 'ἂι', + 'ᾋ' => 'ἃι', + 'ᾌ' => 'ἄι', + 'ᾍ' => 'ἅι', + 'ᾎ' => 'ἆι', + 'ᾏ' => 'ἇι', + 'ᾐ' => 'ἠι', + 'ᾑ' => 'ἡι', + 'ᾒ' => 'ἢι', + 'ᾓ' => 'ἣι', + 'ᾔ' => 'ἤι', + 'ᾕ' => 'ἥι', + 'ᾖ' => 'ἦι', + 'ᾗ' => 'ἧι', + 'ᾘ' => 'ἠι', + 'ᾙ' => 'ἡι', + 'ᾚ' => 'ἢι', + 'ᾛ' => 'ἣι', + 'ᾜ' => 'ἤι', + 'ᾝ' => 'ἥι', + 'ᾞ' => 'ἦι', + 'ᾟ' => 'ἧι', + 'ᾠ' => 'ὠι', + 'ᾡ' => 'ὡι', + 'ᾢ' => 'ὢι', + 'ᾣ' => 'ὣι', + 'ᾤ' => 'ὤι', + 'ᾥ' => 'ὥι', + 'ᾦ' => 'ὦι', + 'ᾧ' => 'ὧι', + 'ᾨ' => 'ὠι', + 'ᾩ' => 'ὡι', + 'ᾪ' => 'ὢι', + 'ᾫ' => 'ὣι', + 'ᾬ' => 'ὤι', + 'ᾭ' => 'ὥι', + 'ᾮ' => 'ὦι', + 'ᾯ' => 'ὧι', + 'ᾲ' => 'ὰι', + 'ᾳ' => 'αι', + 'ᾴ' => 'άι', + 'ᾶ' => 'ᾶ', + 'ᾷ' => 'ᾶι', + 'ᾼ' => 'αι', + 'ῂ' => 'ὴι', + 'ῃ' => 'ηι', + 'ῄ' => 'ήι', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῆι', + 'ῌ' => 'ηι', + 'ῒ' => 'ῒ', + 'ῖ' => 'ῖ', + 'ῗ' => 'ῗ', + 'ῢ' => 'ῢ', + 'ῤ' => 'ῤ', + 'ῦ' => 'ῦ', + 'ῧ' => 'ῧ', + 'ῲ' => 'ὼι', + 'ῳ' => 'ωι', + 'ῴ' => 'ώι', + 'ῶ' => 'ῶ', + 'ῷ' => 'ῶι', + 'ῼ' => 'ωι', + 'ff' => 'ff', + 'fi' => 'fi', + 'fl' => 'fl', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'ſt' => 'st', + 'st' => 'st', + 'ﬓ' => 'մն', + 'ﬔ' => 'մե', + 'ﬕ' => 'մի', + 'ﬖ' => 'վն', + 'ﬗ' => 'մխ', +]; diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap.php b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap.php index 1fedd1f7..ff51ae07 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -132,6 +132,31 @@ function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } } +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + +if (!function_exists('mb_trim')) { + function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } +} + +if (!function_exists('mb_ltrim')) { + function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } +} + +if (!function_exists('mb_rtrim')) { + function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } +} + + if (extension_loaded('mbstring')) { return; } diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap80.php b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap80.php index 82f5ac4d..5be7d201 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -93,7 +93,7 @@ function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?strin function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } } if (!function_exists('mb_get_info')) { - function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } + function mb_get_info(?string $type = 'all'): array|string|int|false|null { return p\Mbstring::mb_get_info((string) $type); } } if (!function_exists('mb_http_output')) { function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } @@ -128,6 +128,30 @@ function mb_scrub(?string $string, ?string $encoding = null): string { $encoding function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } } +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + +if (!function_exists('mb_trim')) { + function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } +} + +if (!function_exists('mb_ltrim')) { + function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } +} + +if (!function_exists('mb_rtrim')) { + function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } +} + if (extension_loaded('mbstring')) { return; } diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/composer.json index 44895536..4ed241a3 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -30,9 +30,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/LICENSE index 5593b1d8..0ed3a246 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/LICENSE +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020 Fabien Potencier +Copyright (c) 2020-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/composer.json index bd9a3262..a503b039 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/composer.json @@ -20,7 +20,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, @@ -29,9 +29,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/LICENSE index efb17f98..99c6bdf3 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/LICENSE +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2021 Fabien Potencier +Copyright (c) 2021-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/README.md b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/README.md index 7d8dd190..c07ef782 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/README.md +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/README.md @@ -7,6 +7,7 @@ This component provides features added to PHP 8.1 core: - [`enum_exists`](https://php.net/enum-exists) - [`MYSQLI_REFRESH_REPLICA`](https://php.net/mysqli.constants#constantmysqli-refresh-replica) constant - [`ReturnTypeWillChange`](https://wiki.php.net/rfc/internal_method_return_types) +- [`CURLStringFile`](https://php.net/CURLStringFile) (but only if PHP >= 7.4 is used) More information can be found in the [main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php new file mode 100644 index 00000000..5ff93fca --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID >= 70400 && extension_loaded('curl')) { + /** + * @property string $data + */ + class CURLStringFile extends CURLFile + { + private $data; + + public function __construct(string $data, string $postname, string $mime = 'application/octet-stream') + { + $this->data = $data; + parent::__construct('data://application/octet-stream;base64,'.base64_encode($data), $mime, $postname); + } + + public function __set(string $name, $value): void + { + if ('data' !== $name) { + $this->$name = $value; + + return; + } + + if (is_object($value) ? !method_exists($value, '__toString') : !is_scalar($value)) { + throw new TypeError('Cannot assign '.gettype($value).' to property CURLStringFile::$data of type string'); + } + + $this->name = 'data://application/octet-stream;base64,'.base64_encode($value); + } + + public function __isset(string $name): bool + { + return isset($this->$name); + } + + public function &__get(string $name) + { + return $this->$name; + } + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/composer.json index 149b5982..28b6408e 100644 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Php81\\": "" }, @@ -25,9 +25,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/tools/php-cs-fixer/vendor/symfony/process/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/process/CHANGELOG.md index 31b9ee6a..3e33cd0b 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/CHANGELOG.md +++ b/tools/php-cs-fixer/vendor/symfony/process/CHANGELOG.md @@ -1,6 +1,18 @@ CHANGELOG ========= +7.1 +--- + + * Add `Process::setIgnoredSignals()` to disable signal propagation to the child process + +6.4 +--- + + * Add `PhpSubprocess` to handle PHP subprocesses that take over the + configuration from their parent + * Add `RunProcessMessage` and `RunProcessMessageHandler` + 5.2.0 ----- diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessFailedException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessFailedException.php index 328acfde..de8a9e98 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessFailedException.php +++ b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessFailedException.php @@ -20,15 +20,14 @@ */ class ProcessFailedException extends RuntimeException { - private $process; - - public function __construct(Process $process) - { + public function __construct( + private Process $process, + ) { if ($process->isSuccessful()) { throw new InvalidArgumentException('Expected a failed process, but the given process was successful.'); } - $error = sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", + $error = \sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", $process->getCommandLine(), $process->getExitCode(), $process->getExitCodeText(), @@ -36,7 +35,7 @@ public function __construct(Process $process) ); if (!$process->isOutputDisabled()) { - $error .= sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", + $error .= \sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", $process->getOutput(), $process->getErrorOutput() ); @@ -47,7 +46,7 @@ public function __construct(Process $process) $this->process = $process; } - public function getProcess() + public function getProcess(): Process { return $this->process; } diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessSignaledException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessSignaledException.php index d4d32275..3fd13e5d 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessSignaledException.php +++ b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessSignaledException.php @@ -20,13 +20,10 @@ */ final class ProcessSignaledException extends RuntimeException { - private $process; - - public function __construct(Process $process) - { - $this->process = $process; - - parent::__construct(sprintf('The process has been signaled with signal "%s".', $process->getTermSignal())); + public function __construct( + private Process $process, + ) { + parent::__construct(\sprintf('The process has been signaled with signal "%s".', $process->getTermSignal())); } public function getProcess(): Process diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessStartFailedException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessStartFailedException.php new file mode 100644 index 00000000..37254725 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessStartFailedException.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Process\Exception; + +use Symfony\Component\Process\Process; + +/** + * Exception for processes failed during startup. + */ +class ProcessStartFailedException extends ProcessFailedException +{ + public function __construct( + private Process $process, + ?string $message, + ) { + if ($process->isStarted()) { + throw new InvalidArgumentException('Expected a process that failed during startup, but the given process was started successfully.'); + } + + $error = \sprintf('The command "%s" failed.'."\n\nWorking directory: %s\n\nError: %s", + $process->getCommandLine(), + $process->getWorkingDirectory(), + $message ?? 'unknown' + ); + + // Skip parent constructor + RuntimeException::__construct($error); + } + + public function getProcess(): Process + { + return $this->process; + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessTimedOutException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessTimedOutException.php index b052d72c..d3fe4934 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessTimedOutException.php +++ b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessTimedOutException.php @@ -23,42 +23,38 @@ class ProcessTimedOutException extends RuntimeException public const TYPE_GENERAL = 1; public const TYPE_IDLE = 2; - private $process; - private $timeoutType; - - public function __construct(Process $process, int $timeoutType) - { - $this->process = $process; - $this->timeoutType = $timeoutType; - - parent::__construct(sprintf( + public function __construct( + private Process $process, + private int $timeoutType, + ) { + parent::__construct(\sprintf( 'The process "%s" exceeded the timeout of %s seconds.', $process->getCommandLine(), $this->getExceededTimeout() )); } - public function getProcess() + public function getProcess(): Process { return $this->process; } - public function isGeneralTimeout() + public function isGeneralTimeout(): bool { return self::TYPE_GENERAL === $this->timeoutType; } - public function isIdleTimeout() + public function isIdleTimeout(): bool { return self::TYPE_IDLE === $this->timeoutType; } - public function getExceededTimeout() + public function getExceededTimeout(): ?float { return match ($this->timeoutType) { self::TYPE_GENERAL => $this->process->getTimeout(), self::TYPE_IDLE => $this->process->getIdleTimeout(), - default => throw new \LogicException(sprintf('Unknown timeout type "%d".', $this->timeoutType)), + default => throw new \LogicException(\sprintf('Unknown timeout type "%d".', $this->timeoutType)), }; } } diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/RunProcessFailedException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/RunProcessFailedException.php new file mode 100644 index 00000000..e7219d35 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/process/Exception/RunProcessFailedException.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Process\Exception; + +use Symfony\Component\Process\Messenger\RunProcessContext; + +/** + * @author Kevin Bond + */ +final class RunProcessFailedException extends RuntimeException +{ + public function __construct(ProcessFailedException $exception, public readonly RunProcessContext $context) + { + parent::__construct($exception->getMessage(), $exception->getCode()); + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/process/ExecutableFinder.php b/tools/php-cs-fixer/vendor/symfony/process/ExecutableFinder.php index d9d11102..5cc65251 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/ExecutableFinder.php +++ b/tools/php-cs-fixer/vendor/symfony/process/ExecutableFinder.php @@ -19,20 +19,31 @@ */ class ExecutableFinder { - private $suffixes = ['.exe', '.bat', '.cmd', '.com']; + private const CMD_BUILTINS = [ + 'assoc', 'break', 'call', 'cd', 'chdir', 'cls', 'color', 'copy', 'date', + 'del', 'dir', 'echo', 'endlocal', 'erase', 'exit', 'for', 'ftype', 'goto', + 'help', 'if', 'label', 'md', 'mkdir', 'mklink', 'move', 'path', 'pause', + 'popd', 'prompt', 'pushd', 'rd', 'rem', 'ren', 'rename', 'rmdir', 'set', + 'setlocal', 'shift', 'start', 'time', 'title', 'type', 'ver', 'vol', + ]; + + private array $suffixes = []; /** * Replaces default suffixes of executable. */ - public function setSuffixes(array $suffixes) + public function setSuffixes(array $suffixes): void { $this->suffixes = $suffixes; } /** - * Adds new possible suffix to check for executable. + * Adds new possible suffix to check for executable, including the dot (.). + * + * $finder = new ExecutableFinder(); + * $finder->addSuffix('.foo'); */ - public function addSuffix(string $suffix) + public function addSuffix(string $suffix): void { $this->suffixes[] = $suffix; } @@ -44,41 +55,49 @@ public function addSuffix(string $suffix) * @param string|null $default The default to return if no executable is found * @param array $extraDirs Additional dirs to check into */ - public function find(string $name, string $default = null, array $extraDirs = []): ?string + public function find(string $name, ?string $default = null, array $extraDirs = []): ?string { - if (\ini_get('open_basedir')) { - $searchPath = array_merge(explode(\PATH_SEPARATOR, \ini_get('open_basedir')), $extraDirs); - $dirs = []; - foreach ($searchPath as $path) { - // Silencing against https://bugs.php.net/69240 - if (@is_dir($path)) { - $dirs[] = $path; - } else { - if (basename($path) == $name && @is_executable($path)) { - return $path; - } - } - } - } else { - $dirs = array_merge( - explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), - $extraDirs - ); + // windows built-in commands that are present in cmd.exe should not be resolved using PATH as they do not exist as exes + if ('\\' === \DIRECTORY_SEPARATOR && \in_array(strtolower($name), self::CMD_BUILTINS, true)) { + return $name; } - $suffixes = ['']; + $dirs = array_merge( + explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), + $extraDirs + ); + + $suffixes = $this->suffixes; if ('\\' === \DIRECTORY_SEPARATOR) { $pathExt = getenv('PATHEXT'); - $suffixes = array_merge($pathExt ? explode(\PATH_SEPARATOR, $pathExt) : $this->suffixes, $suffixes); + $suffixes = array_merge($suffixes, $pathExt ? explode(\PATH_SEPARATOR, $pathExt) : ['.exe', '.bat', '.cmd', '.com']); } + $suffixes = '' !== pathinfo($name, PATHINFO_EXTENSION) ? array_merge([''], $suffixes) : array_merge($suffixes, ['']); foreach ($suffixes as $suffix) { foreach ($dirs as $dir) { + if ('' === $dir) { + $dir = '.'; + } if (@is_file($file = $dir.\DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === \DIRECTORY_SEPARATOR || @is_executable($file))) { return $file; } + + if (!@is_dir($dir) && basename($dir) === $name.$suffix && @is_executable($dir)) { + return $dir; + } } } + if ('\\' === \DIRECTORY_SEPARATOR || !\function_exists('exec') || \strlen($name) !== strcspn($name, '/'.\DIRECTORY_SEPARATOR)) { + return $default; + } + + $execResult = exec('command -v -- '.escapeshellarg($name)); + + if (($executablePath = substr($execResult, 0, strpos($execResult, \PHP_EOL) ?: null)) && @is_executable($executablePath)) { + return $executablePath; + } + return $default; } } diff --git a/tools/php-cs-fixer/vendor/symfony/process/InputStream.php b/tools/php-cs-fixer/vendor/symfony/process/InputStream.php index b8682bae..586e7429 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/InputStream.php +++ b/tools/php-cs-fixer/vendor/symfony/process/InputStream.php @@ -22,17 +22,16 @@ */ class InputStream implements \IteratorAggregate { - /** @var callable|null */ - private $onEmpty = null; - private $input = []; - private $open = true; + private ?\Closure $onEmpty = null; + private array $input = []; + private bool $open = true; /** * Sets a callback that is called when the write buffer becomes empty. */ - public function onEmpty(callable $onEmpty = null) + public function onEmpty(?callable $onEmpty = null): void { - $this->onEmpty = $onEmpty; + $this->onEmpty = null !== $onEmpty ? $onEmpty(...) : null; } /** @@ -41,13 +40,13 @@ public function onEmpty(callable $onEmpty = null) * @param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar, * stream resource or \Traversable */ - public function write(mixed $input) + public function write(mixed $input): void { if (null === $input) { return; } if ($this->isClosed()) { - throw new RuntimeException(sprintf('"%s" is closed.', static::class)); + throw new RuntimeException(\sprintf('"%s" is closed.', static::class)); } $this->input[] = ProcessUtils::validateInput(__METHOD__, $input); } @@ -55,7 +54,7 @@ public function write(mixed $input) /** * Closes the write buffer. */ - public function close() + public function close(): void { $this->open = false; } @@ -63,7 +62,7 @@ public function close() /** * Tells whether the write buffer is closed or not. */ - public function isClosed() + public function isClosed(): bool { return !$this->open; } diff --git a/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessContext.php b/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessContext.php new file mode 100644 index 00000000..5e223040 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessContext.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Process\Messenger; + +use Symfony\Component\Process\Process; + +/** + * @author Kevin Bond + */ +final class RunProcessContext +{ + public readonly ?int $exitCode; + public readonly ?string $output; + public readonly ?string $errorOutput; + + public function __construct( + public readonly RunProcessMessage $message, + Process $process, + ) { + $this->exitCode = $process->getExitCode(); + $this->output = !$process->isStarted() || $process->isOutputDisabled() ? null : $process->getOutput(); + $this->errorOutput = !$process->isStarted() || $process->isOutputDisabled() ? null : $process->getErrorOutput(); + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessage.php b/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessage.php new file mode 100644 index 00000000..b2c33fe3 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessage.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Process\Messenger; + +/** + * @author Kevin Bond + */ +class RunProcessMessage implements \Stringable +{ + public function __construct( + public readonly array $command, + public readonly ?string $cwd = null, + public readonly ?array $env = null, + public readonly mixed $input = null, + public readonly ?float $timeout = 60.0, + ) { + } + + public function __toString(): string + { + return implode(' ', $this->command); + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessageHandler.php b/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessageHandler.php new file mode 100644 index 00000000..41c1934c --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessageHandler.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Process\Messenger; + +use Symfony\Component\Process\Exception\ProcessFailedException; +use Symfony\Component\Process\Exception\RunProcessFailedException; +use Symfony\Component\Process\Process; + +/** + * @author Kevin Bond + */ +final class RunProcessMessageHandler +{ + public function __invoke(RunProcessMessage $message): RunProcessContext + { + $process = new Process($message->command, $message->cwd, $message->env, $message->input, $message->timeout); + + try { + return new RunProcessContext($message, $process->mustRun()); + } catch (ProcessFailedException $e) { + throw new RunProcessFailedException($e, new RunProcessContext($message, $e->getProcess())); + } + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/process/PhpExecutableFinder.php b/tools/php-cs-fixer/vendor/symfony/process/PhpExecutableFinder.php index 9ab8ac23..9f9218f9 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/PhpExecutableFinder.php +++ b/tools/php-cs-fixer/vendor/symfony/process/PhpExecutableFinder.php @@ -19,7 +19,7 @@ */ class PhpExecutableFinder { - private $executableFinder; + private ExecutableFinder $executableFinder; public function __construct() { @@ -32,15 +32,8 @@ public function __construct() public function find(bool $includeArgs = true): string|false { if ($php = getenv('PHP_BINARY')) { - if (!is_executable($php)) { - $command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v'; - if ($php = strtok(exec($command.' '.escapeshellarg($php)), \PHP_EOL)) { - if (!is_executable($php)) { - return false; - } - } else { - return false; - } + if (!is_executable($php) && !$php = $this->executableFinder->find($php)) { + return false; } if (@is_dir($php)) { @@ -81,6 +74,10 @@ public function find(bool $includeArgs = true): string|false $dirs[] = 'C:\xampp\php\\'; } + if ($herdPath = getenv('HERD_HOME')) { + $dirs[] = $herdPath.\DIRECTORY_SEPARATOR.'bin'; + } + return $this->executableFinder->find('php', false, $dirs); } diff --git a/tools/php-cs-fixer/vendor/symfony/process/PhpProcess.php b/tools/php-cs-fixer/vendor/symfony/process/PhpProcess.php index 486bc1da..0e7ff846 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/PhpProcess.php +++ b/tools/php-cs-fixer/vendor/symfony/process/PhpProcess.php @@ -32,7 +32,7 @@ class PhpProcess extends Process * @param int $timeout The timeout in seconds * @param array|null $php Path to the PHP binary to use with any additional arguments */ - public function __construct(string $script, string $cwd = null, array $env = null, int $timeout = 60, array $php = null) + public function __construct(string $script, ?string $cwd = null, ?array $env = null, int $timeout = 60, ?array $php = null) { if (null === $php) { $executableFinder = new PhpExecutableFinder(); @@ -50,12 +50,12 @@ public function __construct(string $script, string $cwd = null, array $env = nul parent::__construct($php, $cwd, $env, $script, $timeout); } - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static + public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static { - throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); + throw new LogicException(\sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); } - public function start(callable $callback = null, array $env = []) + public function start(?callable $callback = null, array $env = []): void { if (null === $this->getCommandLine()) { throw new RuntimeException('Unable to find the PHP executable.'); diff --git a/tools/php-cs-fixer/vendor/symfony/process/PhpSubprocess.php b/tools/php-cs-fixer/vendor/symfony/process/PhpSubprocess.php new file mode 100644 index 00000000..bdd4173c --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/process/PhpSubprocess.php @@ -0,0 +1,164 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Process; + +use Symfony\Component\Process\Exception\LogicException; +use Symfony\Component\Process\Exception\RuntimeException; + +/** + * PhpSubprocess runs a PHP command as a subprocess while keeping the original php.ini settings. + * + * For this, it generates a temporary php.ini file taking over all the current settings and disables + * loading additional .ini files. Basically, your command gets prefixed using "php -n -c /tmp/temp.ini". + * + * Given your php.ini contains "memory_limit=-1" and you have a "MemoryTest.php" with the following content: + * + * run(); + * print $p->getOutput()."\n"; + * + * This will output "string(2) "-1", because the process is started with the default php.ini settings. + * + * $p = new PhpSubprocess(['MemoryTest.php'], null, null, 60, ['php', '-d', 'memory_limit=256M']); + * $p->run(); + * print $p->getOutput()."\n"; + * + * This will output "string(4) "256M"", because the process is started with the temporarily created php.ini settings. + * + * @author Yanick Witschi + * @author Partially copied and heavily inspired from composer/xdebug-handler by John Stevenson + */ +class PhpSubprocess extends Process +{ + /** + * @param array $command The command to run and its arguments listed as separate entries. They will automatically + * get prefixed with the PHP binary + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to use the same environment as the current PHP process + * @param int $timeout The timeout in seconds + * @param array|null $php Path to the PHP binary to use with any additional arguments + */ + public function __construct(array $command, ?string $cwd = null, ?array $env = null, int $timeout = 60, ?array $php = null) + { + if (null === $php) { + $executableFinder = new PhpExecutableFinder(); + $php = $executableFinder->find(false); + $php = false === $php ? null : array_merge([$php], $executableFinder->findArguments()); + } + + if (null === $php) { + throw new RuntimeException('Unable to find PHP binary.'); + } + + $tmpIni = $this->writeTmpIni($this->getAllIniFiles(), sys_get_temp_dir()); + + $php = array_merge($php, ['-n', '-c', $tmpIni]); + register_shutdown_function('unlink', $tmpIni); + + $command = array_merge($php, $command); + + parent::__construct($command, $cwd, $env, null, $timeout); + } + + public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static + { + throw new LogicException(\sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); + } + + public function start(?callable $callback = null, array $env = []): void + { + if (null === $this->getCommandLine()) { + throw new RuntimeException('Unable to find the PHP executable.'); + } + + parent::start($callback, $env); + } + + private function writeTmpIni(array $iniFiles, string $tmpDir): string + { + if (false === $tmpfile = @tempnam($tmpDir, '')) { + throw new RuntimeException('Unable to create temporary ini file.'); + } + + // $iniFiles has at least one item and it may be empty + if ('' === $iniFiles[0]) { + array_shift($iniFiles); + } + + $content = ''; + + foreach ($iniFiles as $file) { + // Check for inaccessible ini files + if (($data = @file_get_contents($file)) === false) { + throw new RuntimeException('Unable to read ini: '.$file); + } + // Check and remove directives after HOST and PATH sections + if (preg_match('/^\s*\[(?:PATH|HOST)\s*=/mi', $data, $matches, \PREG_OFFSET_CAPTURE)) { + $data = substr($data, 0, $matches[0][1]); + } + + $content .= $data."\n"; + } + + // Merge loaded settings into our ini content, if it is valid + $config = parse_ini_string($content); + $loaded = ini_get_all(null, false); + + if (false === $config || false === $loaded) { + throw new RuntimeException('Unable to parse ini data.'); + } + + $content .= $this->mergeLoadedConfig($loaded, $config); + + // Work-around for https://bugs.php.net/bug.php?id=75932 + $content .= "opcache.enable_cli=0\n"; + + if (false === @file_put_contents($tmpfile, $content)) { + throw new RuntimeException('Unable to write temporary ini file.'); + } + + return $tmpfile; + } + + private function mergeLoadedConfig(array $loadedConfig, array $iniConfig): string + { + $content = ''; + + foreach ($loadedConfig as $name => $value) { + if (!\is_string($value)) { + continue; + } + + if (!isset($iniConfig[$name]) || $iniConfig[$name] !== $value) { + // Double-quote escape each value + $content .= $name.'="'.addcslashes($value, '\\"')."\"\n"; + } + } + + return $content; + } + + private function getAllIniFiles(): array + { + $paths = [(string) php_ini_loaded_file()]; + + if (false !== $scanned = php_ini_scanned_files()) { + $paths = array_merge($paths, array_map('trim', explode(',', $scanned))); + } + + return $paths; + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Pipes/AbstractPipes.php b/tools/php-cs-fixer/vendor/symfony/process/Pipes/AbstractPipes.php index 51d3af0b..51a566f3 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/Pipes/AbstractPipes.php +++ b/tools/php-cs-fixer/vendor/symfony/process/Pipes/AbstractPipes.php @@ -22,26 +22,25 @@ abstract class AbstractPipes implements PipesInterface { public array $pipes = []; - private $inputBuffer = ''; + private string $inputBuffer = ''; + /** @var resource|string|\Iterator */ private $input; - private $blocked = true; - private $lastError; + private bool $blocked = true; + private ?string $lastError = null; /** - * @param resource|string|int|float|bool|\Iterator|null $input + * @param resource|string|\Iterator $input */ - public function __construct(mixed $input) + public function __construct($input) { if (\is_resource($input) || $input instanceof \Iterator) { $this->input = $input; - } elseif (\is_string($input)) { - $this->inputBuffer = $input; } else { $this->inputBuffer = (string) $input; } } - public function close() + public function close(): void { foreach ($this->pipes as $pipe) { if (\is_resource($pipe)) { @@ -66,7 +65,7 @@ protected function hasSystemCallBeenInterrupted(): bool /** * Unblocks streams. */ - protected function unblock() + protected function unblock(): void { if (!$this->blocked) { return; @@ -102,7 +101,7 @@ protected function write(): ?array } elseif (!isset($this->inputBuffer[0])) { if (!\is_string($input)) { if (!\is_scalar($input)) { - throw new InvalidArgumentException(sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', get_debug_type($this->input), get_debug_type($input))); + throw new InvalidArgumentException(\sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', get_debug_type($this->input), get_debug_type($input))); } $input = (string) $input; } @@ -170,7 +169,7 @@ protected function write(): ?array /** * @internal */ - public function handleError(int $type, string $msg) + public function handleError(int $type, string $msg): void { $this->lastError = $msg; } diff --git a/tools/php-cs-fixer/vendor/symfony/process/Pipes/PipesInterface.php b/tools/php-cs-fixer/vendor/symfony/process/Pipes/PipesInterface.php index 50eb5c47..967f8de7 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/Pipes/PipesInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/process/Pipes/PipesInterface.php @@ -57,5 +57,5 @@ public function haveReadSupport(): bool; /** * Closes file handles and pipes. */ - public function close(); + public function close(): void; } diff --git a/tools/php-cs-fixer/vendor/symfony/process/Pipes/UnixPipes.php b/tools/php-cs-fixer/vendor/symfony/process/Pipes/UnixPipes.php index aba0efce..8e95afaa 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/Pipes/UnixPipes.php +++ b/tools/php-cs-fixer/vendor/symfony/process/Pipes/UnixPipes.php @@ -22,16 +22,12 @@ */ class UnixPipes extends AbstractPipes { - private $ttyMode; - private $ptyMode; - private $haveReadSupport; - - public function __construct(?bool $ttyMode, bool $ptyMode, mixed $input, bool $haveReadSupport) - { - $this->ttyMode = $ttyMode; - $this->ptyMode = $ptyMode; - $this->haveReadSupport = $haveReadSupport; - + public function __construct( + private ?bool $ttyMode, + private bool $ptyMode, + mixed $input, + private bool $haveReadSupport, + ) { parent::__construct($input); } @@ -40,7 +36,7 @@ public function __sleep(): array throw new \BadMethodCallException('Cannot serialize '.__CLASS__); } - public function __wakeup() + public function __wakeup(): void { throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); } diff --git a/tools/php-cs-fixer/vendor/symfony/process/Pipes/WindowsPipes.php b/tools/php-cs-fixer/vendor/symfony/process/Pipes/WindowsPipes.php index 9f4dedb2..116b8e30 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/Pipes/WindowsPipes.php +++ b/tools/php-cs-fixer/vendor/symfony/process/Pipes/WindowsPipes.php @@ -26,19 +26,18 @@ */ class WindowsPipes extends AbstractPipes { - private $files = []; - private $fileHandles = []; - private $lockHandles = []; - private $readBytes = [ + private array $files = []; + private array $fileHandles = []; + private array $lockHandles = []; + private array $readBytes = [ Process::STDOUT => 0, Process::STDERR => 0, ]; - private $haveReadSupport; - - public function __construct(mixed $input, bool $haveReadSupport) - { - $this->haveReadSupport = $haveReadSupport; + public function __construct( + mixed $input, + private bool $haveReadSupport, + ) { if ($this->haveReadSupport) { // Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big. // Workaround for this problem is to use temporary files instead of pipes on Windows platform. @@ -53,7 +52,7 @@ public function __construct(mixed $input, bool $haveReadSupport) set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; }); for ($i = 0;; ++$i) { foreach ($pipes as $pipe => $name) { - $file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); + $file = \sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); if (!$h = fopen($file.'.lock', 'w')) { if (file_exists($file.'.lock')) { @@ -93,7 +92,7 @@ public function __sleep(): array throw new \BadMethodCallException('Cannot serialize '.__CLASS__); } - public function __wakeup() + public function __wakeup(): void { throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); } @@ -140,7 +139,7 @@ public function readAndWrite(bool $blocking, bool $close = false): array if ($w) { @stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6); } elseif ($this->fileHandles) { - usleep(Process::TIMEOUT_PRECISION * 1E6); + usleep((int) (Process::TIMEOUT_PRECISION * 1E6)); } } foreach ($this->fileHandles as $type => $fileHandle) { @@ -172,7 +171,7 @@ public function areOpen(): bool return $this->pipes && $this->fileHandles; } - public function close() + public function close(): void { parent::close(); foreach ($this->fileHandles as $type => $handle) { diff --git a/tools/php-cs-fixer/vendor/symfony/process/Process.php b/tools/php-cs-fixer/vendor/symfony/process/Process.php index 63a402a5..03ce70e5 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/Process.php +++ b/tools/php-cs-fixer/vendor/symfony/process/Process.php @@ -15,9 +15,9 @@ use Symfony\Component\Process\Exception\LogicException; use Symfony\Component\Process\Exception\ProcessFailedException; use Symfony\Component\Process\Exception\ProcessSignaledException; +use Symfony\Component\Process\Exception\ProcessStartFailedException; use Symfony\Component\Process\Exception\ProcessTimedOutException; use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Pipes\PipesInterface; use Symfony\Component\Process\Pipes\UnixPipes; use Symfony\Component\Process\Pipes\WindowsPipes; @@ -51,44 +51,48 @@ class Process implements \IteratorAggregate public const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating public const ITER_SKIP_ERR = 8; // Use this flag to skip STDERR while iterating - private $callback; - private $hasCallback = false; - private $commandline; - private $cwd; - private $env = []; + private ?\Closure $callback = null; + private array|string $commandline; + private ?string $cwd; + private array $env = []; + /** @var resource|string|\Iterator|null */ private $input; - private $starttime; - private $lastOutputTime; - private $timeout; - private $idleTimeout; - private $exitcode; - private $fallbackStatus = []; - private $processInformation; - private $outputDisabled = false; + private ?float $starttime = null; + private ?float $lastOutputTime = null; + private ?float $timeout = null; + private ?float $idleTimeout = null; + private ?int $exitcode = null; + private array $fallbackStatus = []; + private array $processInformation; + private bool $outputDisabled = false; + /** @var resource */ private $stdout; + /** @var resource */ private $stderr; + /** @var resource|null */ private $process; - private $status = self::STATUS_READY; - private $incrementalOutputOffset = 0; - private $incrementalErrorOutputOffset = 0; - private $tty = false; - private $pty; - private $options = ['suppress_errors' => true, 'bypass_shell' => true]; + private string $status = self::STATUS_READY; + private int $incrementalOutputOffset = 0; + private int $incrementalErrorOutputOffset = 0; + private bool $tty = false; + private bool $pty; + private array $options = ['suppress_errors' => true, 'bypass_shell' => true]; + private array $ignoredSignals = []; - private $useFileHandles = false; - /** @var PipesInterface */ - private $processPipes; + private WindowsPipes|UnixPipes $processPipes; - private $latestSignal; + private ?int $latestSignal = null; + private ?int $cachedExitCode = null; - private static $sigchild; + private static ?bool $sigchild = null; + private static array $executables = []; /** * Exit codes translation table. * * User-defined errors must use exit codes in the 64-113 range. */ - public static $exitCodes = [ + public static array $exitCodes = [ 0 => 'OK', 1 => 'General error', 2 => 'Misuse of shell builtins', @@ -140,7 +144,7 @@ class Process implements \IteratorAggregate * * @throws LogicException When proc_open is not installed */ - public function __construct(array $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60) + public function __construct(array $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60) { if (!\function_exists('proc_open')) { throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.'); @@ -162,7 +166,6 @@ public function __construct(array $command, string $cwd = null, array $env = nul $this->setInput($input); $this->setTimeout($timeout); - $this->useFileHandles = '\\' === \DIRECTORY_SEPARATOR; $this->pty = false; } @@ -187,7 +190,7 @@ public function __construct(array $command, string $cwd = null, array $env = nul * * @throws LogicException When proc_open is not installed */ - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static + public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static { $process = new static([], $cwd, $env, $input, $timeout); $process->commandline = $command; @@ -200,7 +203,7 @@ public function __sleep(): array throw new \BadMethodCallException('Cannot serialize '.__CLASS__); } - public function __wakeup() + public function __wakeup(): void { throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); } @@ -234,15 +237,15 @@ public function __clone() * * @return int The exit status code * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running - * @throws ProcessTimedOutException When process timed out - * @throws ProcessSignaledException When process stopped after receiving signal - * @throws LogicException In case a callback is provided and output has been disabled + * @throws ProcessStartFailedException When process can't be launched + * @throws RuntimeException When process is already running + * @throws ProcessTimedOutException When process timed out + * @throws ProcessSignaledException When process stopped after receiving signal + * @throws LogicException In case a callback is provided and output has been disabled * * @final */ - public function run(callable $callback = null, array $env = []): int + public function run(?callable $callback = null, array $env = []): int { $this->start($callback, $env); @@ -261,7 +264,7 @@ public function run(callable $callback = null, array $env = []): int * * @final */ - public function mustRun(callable $callback = null, array $env = []): static + public function mustRun(?callable $callback = null, array $env = []): static { if (0 !== $this->run($callback, $env)) { throw new ProcessFailedException($this); @@ -285,11 +288,11 @@ public function mustRun(callable $callback = null, array $env = []): static * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running - * @throws LogicException In case a callback is provided and output has been disabled + * @throws ProcessStartFailedException When process can't be launched + * @throws RuntimeException When process is already running + * @throws LogicException In case a callback is provided and output has been disabled */ - public function start(callable $callback = null, array $env = []) + public function start(?callable $callback = null, array $env = []): void { if ($this->isRunning()) { throw new RuntimeException('Process is already running.'); @@ -298,8 +301,7 @@ public function start(callable $callback = null, array $env = []) $this->resetProcessData(); $this->starttime = $this->lastOutputTime = microtime(true); $this->callback = $this->buildCallback($callback); - $this->hasCallback = null !== $callback; - $descriptors = $this->getDescriptors(); + $descriptors = $this->getDescriptors(null !== $callback); if ($this->env) { $env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->env, $env, 'strcasecmp') : $this->env; @@ -308,29 +310,25 @@ public function start(callable $callback = null, array $env = []) $env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->getDefaultEnv(), $env, 'strcasecmp') : $this->getDefaultEnv(); if (\is_array($commandline = $this->commandline)) { - $commandline = implode(' ', array_map($this->escapeArgument(...), $commandline)); - - if ('\\' !== \DIRECTORY_SEPARATOR) { - // exec is mandatory to deal with sending a signal to the process - $commandline = 'exec '.$commandline; - } + $commandline = array_values(array_map(strval(...), $commandline)); } else { $commandline = $this->replacePlaceholders($commandline, $env); } if ('\\' === \DIRECTORY_SEPARATOR) { $commandline = $this->prepareWindowsCommandLine($commandline, $env); - } elseif (!$this->useFileHandles && $this->isSigchildEnabled()) { + } elseif ($this->isSigchildEnabled()) { // last exit code is output on the fourth pipe and caught to work around --enable-sigchild $descriptors[3] = ['pipe', 'w']; + if (\is_array($commandline)) { + // exec is mandatory to deal with sending a signal to the process + $commandline = 'exec '.$this->buildShellCommandline($commandline); + } + // See https://unix.stackexchange.com/questions/71205/background-process-pipe-input $commandline = '{ ('.$commandline.') <&3 3<&- 3>/dev/null & } 3<&0;'; - $commandline .= 'pid=$!; echo $pid >&3; wait $pid; code=$?; echo $code >&3; exit $code'; - - // Workaround for the bug, when PTS functionality is enabled. - // @see : https://bugs.php.net/69442 - $ptsWorkaround = fopen(__FILE__, 'r'); + $commandline .= 'pid=$!; echo $pid >&3; wait $pid 2>/dev/null; code=$?; echo $code >&3; exit $code'; } $envPairs = []; @@ -341,14 +339,44 @@ public function start(callable $callback = null, array $env = []) } if (!is_dir($this->cwd)) { - throw new RuntimeException(sprintf('The provided cwd "%s" does not exist.', $this->cwd)); + throw new RuntimeException(\sprintf('The provided cwd "%s" does not exist.', $this->cwd)); + } + + $lastError = null; + set_error_handler(function ($type, $msg) use (&$lastError) { + $lastError = $msg; + + return true; + }); + + $oldMask = []; + + if ($this->ignoredSignals && \function_exists('pcntl_sigprocmask')) { + // we block signals we want to ignore, as proc_open will use fork / posix_spawn which will copy the signal mask this allow to block + // signals in the child process + pcntl_sigprocmask(\SIG_BLOCK, $this->ignoredSignals, $oldMask); } - $this->process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options); + try { + $process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options); + + // Ensure array vs string commands behave the same + if (!$process && \is_array($commandline)) { + $process = @proc_open('exec '.$this->buildShellCommandline($commandline), $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options); + } + } finally { + if ($this->ignoredSignals && \function_exists('pcntl_sigprocmask')) { + // we restore the signal mask here to avoid any side effects + pcntl_sigprocmask(\SIG_SETMASK, $oldMask); + } + + restore_error_handler(); + } - if (!\is_resource($this->process)) { - throw new RuntimeException('Unable to launch a new process.'); + if (!$process) { + throw new ProcessStartFailedException($this, $lastError); } + $this->process = $process; $this->status = self::STATUS_STARTED; if (isset($descriptors[3])) { @@ -371,14 +399,14 @@ public function start(callable $callback = null, array $env = []) * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running + * @throws ProcessStartFailedException When process can't be launched + * @throws RuntimeException When process is already running * * @see start() * * @final */ - public function restart(callable $callback = null, array $env = []): static + public function restart(?callable $callback = null, array $env = []): static { if ($this->isRunning()) { throw new RuntimeException('Process is already running.'); @@ -405,7 +433,7 @@ public function restart(callable $callback = null, array $env = []): static * @throws ProcessSignaledException When process stopped after receiving signal * @throws LogicException When process is not yet started */ - public function wait(callable $callback = null): int + public function wait(?callable $callback = null): int { $this->requireProcessIsStarted(__FUNCTION__); @@ -421,7 +449,7 @@ public function wait(callable $callback = null): int do { $this->checkTimeout(); - $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); + $running = $this->isRunning() && ('\\' === \DIRECTORY_SEPARATOR || $this->processPipes->areOpen()); $this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); } while ($running); @@ -878,7 +906,7 @@ public function getStatus(): string * * @return int|null The exit-code of the process or null if it's not running */ - public function stop(float $timeout = 10, int $signal = null): ?int + public function stop(float $timeout = 10, ?int $signal = null): ?int { $timeoutMicro = microtime(true) + $timeout; if ($this->isRunning()) { @@ -912,7 +940,7 @@ public function stop(float $timeout = 10, int $signal = null): ?int * * @internal */ - public function addOutput(string $line) + public function addOutput(string $line): void { $this->lastOutputTime = microtime(true); @@ -926,7 +954,7 @@ public function addOutput(string $line) * * @internal */ - public function addErrorOutput(string $line) + public function addErrorOutput(string $line): void { $this->lastOutputTime = microtime(true); @@ -948,7 +976,7 @@ public function getLastOutputTime(): ?float */ public function getCommandLine(): string { - return \is_array($this->commandline) ? implode(' ', array_map($this->escapeArgument(...), $this->commandline)) : $this->commandline; + return $this->buildShellCommandline($this->commandline); } /** @@ -1117,7 +1145,7 @@ public function getInput() * * This content will be passed to the underlying process standard input. * - * @param string|int|float|bool|resource|\Traversable|null $input The content + * @param string|resource|\Traversable|self|null $input The content * * @return $this * @@ -1142,7 +1170,7 @@ public function setInput(mixed $input): static * * @throws ProcessTimedOutException In case the timeout was reached */ - public function checkTimeout() + public function checkTimeout(): void { if (self::STATUS_STARTED !== $this->status) { return; @@ -1181,7 +1209,7 @@ public function getStartTime(): float * Enabling the "create_new_console" option allows a subprocess to continue * to run after the main process exited, on both Windows and *nix */ - public function setOptions(array $options) + public function setOptions(array $options): void { if ($this->isRunning()) { throw new RuntimeException('Setting options while the process is running is not possible.'); @@ -1193,12 +1221,26 @@ public function setOptions(array $options) foreach ($options as $key => $value) { if (!\in_array($key, $existingOptions)) { $this->options = $defaultOptions; - throw new LogicException(sprintf('Invalid option "%s" passed to "%s()". Supported options are "%s".', $key, __METHOD__, implode('", "', $existingOptions))); + throw new LogicException(\sprintf('Invalid option "%s" passed to "%s()". Supported options are "%s".', $key, __METHOD__, implode('", "', $existingOptions))); } $this->options[$key] = $value; } } + /** + * Defines a list of posix signals that will not be propagated to the process. + * + * @param list<\SIG*> $signals + */ + public function setIgnoredSignals(array $signals): void + { + if ($this->isRunning()) { + throw new RuntimeException('Setting ignored signals while the process is running is not possible.'); + } + + $this->ignoredSignals = $signals; + } + /** * Returns whether TTY is supported on the current operating system. */ @@ -1206,7 +1248,7 @@ public static function isTtySupported(): bool { static $isTtySupported; - return $isTtySupported ??= ('/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT)); + return $isTtySupported ??= ('/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT) && @is_writable('/dev/tty')); } /** @@ -1230,15 +1272,15 @@ public static function isPtySupported(): bool /** * Creates the descriptors needed by the proc_open. */ - private function getDescriptors(): array + private function getDescriptors(bool $hasCallback): array { if ($this->input instanceof \Iterator) { $this->input->rewind(); } if ('\\' === \DIRECTORY_SEPARATOR) { - $this->processPipes = new WindowsPipes($this->input, !$this->outputDisabled || $this->hasCallback); + $this->processPipes = new WindowsPipes($this->input, !$this->outputDisabled || $hasCallback); } else { - $this->processPipes = new UnixPipes($this->isTty(), $this->isPty(), $this->input, !$this->outputDisabled || $this->hasCallback); + $this->processPipes = new UnixPipes($this->isTty(), $this->isPty(), $this->input, !$this->outputDisabled || $hasCallback); } return $this->processPipes->getDescriptors(); @@ -1252,12 +1294,10 @@ private function getDescriptors(): array * * @param callable|null $callback The user defined PHP callback */ - protected function buildCallback(callable $callback = null): \Closure + protected function buildCallback(?callable $callback = null): \Closure { if ($this->outputDisabled) { - return function ($type, $data) use ($callback): bool { - return null !== $callback && $callback($type, $data); - }; + return fn ($type, $data): bool => null !== $callback && $callback($type, $data); } $out = self::OUT; @@ -1278,7 +1318,7 @@ protected function buildCallback(callable $callback = null): \Closure * * @param bool $blocking Whether to use a blocking read call */ - protected function updateStatus(bool $blocking) + protected function updateStatus(bool $blocking): void { if (self::STATUS_STARTED !== $this->status) { return; @@ -1287,6 +1327,19 @@ protected function updateStatus(bool $blocking) $this->processInformation = proc_get_status($this->process); $running = $this->processInformation['running']; + // In PHP < 8.3, "proc_get_status" only returns the correct exit status on the first call. + // Subsequent calls return -1 as the process is discarded. This workaround caches the first + // retrieved exit status for consistent results in later calls, mimicking PHP 8.3 behavior. + if (\PHP_VERSION_ID < 80300) { + if (!isset($this->cachedExitCode) && !$running && -1 !== $this->processInformation['exitcode']) { + $this->cachedExitCode = $this->processInformation['exitcode']; + } + + if (isset($this->cachedExitCode) && !$running && -1 === $this->processInformation['exitcode']) { + $this->processInformation['exitcode'] = $this->cachedExitCode; + } + } + $this->readPipes($running && $blocking, '\\' !== \DIRECTORY_SEPARATOR || !$running); if ($this->fallbackStatus && $this->isSigchildEnabled()) { @@ -1325,7 +1378,7 @@ protected function isSigchildEnabled(): bool * * @throws LogicException in case output has been disabled or process is not started */ - private function readPipesForOutput(string $caller, bool $blocking = false) + private function readPipesForOutput(string $caller, bool $blocking = false): void { if ($this->outputDisabled) { throw new LogicException('Output has been disabled.'); @@ -1360,7 +1413,7 @@ private function validateTimeout(?float $timeout): ?float * @param bool $blocking Whether to use blocking calls or not * @param bool $close Whether to close file handles or not */ - private function readPipes(bool $blocking, bool $close) + private function readPipes(bool $blocking, bool $close): void { $result = $this->processPipes->readAndWrite($blocking, $close); @@ -1382,8 +1435,9 @@ private function readPipes(bool $blocking, bool $close) private function close(): int { $this->processPipes->close(); - if (\is_resource($this->process)) { + if ($this->process) { proc_close($this->process); + $this->process = null; } $this->exitcode = $this->processInformation['exitcode']; $this->status = self::STATUS_TERMINATED; @@ -1409,13 +1463,13 @@ private function close(): int /** * Resets data related to the latest run of the process. */ - private function resetProcessData() + private function resetProcessData(): void { $this->starttime = null; $this->callback = null; $this->exitcode = null; $this->fallbackStatus = []; - $this->processInformation = null; + $this->processInformation = []; $this->stdout = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); $this->stderr = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); $this->process = null; @@ -1437,6 +1491,11 @@ private function resetProcessData() */ private function doSignal(int $signal, bool $throwException): bool { + // Signal seems to be send when sigchild is enable, this allow blocking the signal correctly in this case + if ($this->isSigchildEnabled() && \in_array($signal, $this->ignoredSignals)) { + return false; + } + if (null === $pid = $this->getPid()) { if ($throwException) { throw new LogicException('Cannot send signal on a non running process.'); @@ -1446,10 +1505,10 @@ private function doSignal(int $signal, bool $throwException): bool } if ('\\' === \DIRECTORY_SEPARATOR) { - exec(sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode); + exec(\sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode); if ($exitCode && $this->isRunning()) { if ($throwException) { - throw new RuntimeException(sprintf('Unable to kill the process (%s).', implode(' ', $output))); + throw new RuntimeException(\sprintf('Unable to kill the process (%s).', implode(' ', $output))); } return false; @@ -1459,12 +1518,12 @@ private function doSignal(int $signal, bool $throwException): bool $ok = @proc_terminate($this->process, $signal); } elseif (\function_exists('posix_kill')) { $ok = @posix_kill($pid, $signal); - } elseif ($ok = proc_open(sprintf('kill -%d %d', $signal, $pid), [2 => ['pipe', 'w']], $pipes)) { + } elseif ($ok = proc_open(\sprintf('kill -%d %d', $signal, $pid), [2 => ['pipe', 'w']], $pipes)) { $ok = false === fgets($pipes[2]); } if (!$ok) { if ($throwException) { - throw new RuntimeException(sprintf('Error while sending signal "%s".', $signal)); + throw new RuntimeException(\sprintf('Error while sending signal "%s".', $signal)); } return false; @@ -1479,11 +1538,25 @@ private function doSignal(int $signal, bool $throwException): bool return true; } - private function prepareWindowsCommandLine(string $cmd, array &$env): string + private function buildShellCommandline(string|array $commandline): string { - $uid = uniqid('', true); - $varCount = 0; - $varCache = []; + if (\is_string($commandline)) { + return $commandline; + } + + if ('\\' === \DIRECTORY_SEPARATOR && isset($commandline[0][0]) && \strlen($commandline[0]) === strcspn($commandline[0], ':/\\')) { + // On Windows, we don't rely on the OS to find the executable if possible to avoid lookups + // in the current directory which could be untrusted. Instead we use the ExecutableFinder. + $commandline[0] = (self::$executables[$commandline[0]] ??= (new ExecutableFinder())->find($commandline[0])) ?? $commandline[0]; + } + + return implode(' ', array_map($this->escapeArgument(...), $commandline)); + } + + private function prepareWindowsCommandLine(string|array $cmd, array &$env): string + { + $cmd = $this->buildShellCommandline($cmd); + $uid = bin2hex(random_bytes(4)); $cmd = preg_replace_callback( '/"(?:( [^"%!^]*+ @@ -1492,7 +1565,9 @@ private function prepareWindowsCommandLine(string $cmd, array &$env): string [^"%!^]*+ )++ ) | [^"]*+ )"/x', - function ($m) use (&$env, &$varCache, &$varCount, $uid) { + function ($m) use (&$env, $uid) { + static $varCount = 0; + static $varCache = []; if (!isset($m[1])) { return $m[0]; } @@ -1517,7 +1592,14 @@ function ($m) use (&$env, &$varCache, &$varCount, $uid) { $cmd ); - $cmd = 'cmd /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; + static $comSpec; + + if (!$comSpec && $comSpec = (new ExecutableFinder())->find('cmd.exe')) { + // Escape according to CommandLineToArgvW rules + $comSpec = '"'.preg_replace('{(\\\\*+)"}', '$1$1\"', $comSpec) .'"'; + } + + $cmd = ($comSpec ?? 'cmd').' /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; foreach ($this->processPipes->getFiles() as $offset => $filename) { $cmd .= ' '.$offset.'>"'.$filename.'"'; } @@ -1530,10 +1612,10 @@ function ($m) use (&$env, &$varCache, &$varCount, $uid) { * * @throws LogicException if the process has not run */ - private function requireProcessIsStarted(string $functionName) + private function requireProcessIsStarted(string $functionName): void { if (!$this->isStarted()) { - throw new LogicException(sprintf('Process must be started before calling "%s()".', $functionName)); + throw new LogicException(\sprintf('Process must be started before calling "%s()".', $functionName)); } } @@ -1542,10 +1624,10 @@ private function requireProcessIsStarted(string $functionName) * * @throws LogicException if the process is not yet terminated */ - private function requireProcessIsTerminated(string $functionName) + private function requireProcessIsTerminated(string $functionName): void { if (!$this->isTerminated()) { - throw new LogicException(sprintf('Process must be terminated before calling "%s()".', $functionName)); + throw new LogicException(\sprintf('Process must be terminated before calling "%s()".', $functionName)); } } @@ -1563,7 +1645,7 @@ private function escapeArgument(?string $argument): string if (str_contains($argument, "\0")) { $argument = str_replace("\0", '?', $argument); } - if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) { + if (!preg_match('/[()%!^"<>&|\s]/', $argument)) { return $argument; } $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument); @@ -1571,11 +1653,11 @@ private function escapeArgument(?string $argument): string return '"'.str_replace(['"', '^', '%', '!', "\n"], ['""', '"^^"', '"^%"', '"^!"', '!LF!'], $argument).'"'; } - private function replacePlaceholders(string $commandline, array $env) + private function replacePlaceholders(string $commandline, array $env): string { return preg_replace_callback('/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/', function ($matches) use ($commandline, $env) { if (!isset($env[$matches[1]]) || false === $env[$matches[1]]) { - throw new InvalidArgumentException(sprintf('Command line is missing a value for parameter "%s": ', $matches[1]).$commandline); + throw new InvalidArgumentException(\sprintf('Command line is missing a value for parameter "%s": ', $matches[1]).$commandline); } return $this->escapeArgument($env[$matches[1]]); diff --git a/tools/php-cs-fixer/vendor/symfony/process/ProcessUtils.php b/tools/php-cs-fixer/vendor/symfony/process/ProcessUtils.php index 744399d9..a2dbde9f 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/ProcessUtils.php +++ b/tools/php-cs-fixer/vendor/symfony/process/ProcessUtils.php @@ -43,9 +43,6 @@ public static function validateInput(string $caller, mixed $input): mixed if (\is_resource($input)) { return $input; } - if (\is_string($input)) { - return $input; - } if (\is_scalar($input)) { return (string) $input; } @@ -59,7 +56,7 @@ public static function validateInput(string $caller, mixed $input): mixed return new \IteratorIterator($input); } - throw new InvalidArgumentException(sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller)); + throw new InvalidArgumentException(\sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller)); } return $input; diff --git a/tools/php-cs-fixer/vendor/symfony/process/composer.json b/tools/php-cs-fixer/vendor/symfony/process/composer.json index 317c07e7..dda5575e 100644 --- a/tools/php-cs-fixer/vendor/symfony/process/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/process/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=8.1" + "php": ">=8.2" }, "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" }, diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/SubscribedService.php index d98e1dfd..f850b840 100644 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/SubscribedService.php +++ b/tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/SubscribedService.php @@ -11,15 +11,15 @@ namespace Symfony\Contracts\Service\Attribute; +use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait; use Symfony\Contracts\Service\ServiceSubscriberInterface; -use Symfony\Contracts\Service\ServiceSubscriberTrait; /** * For use as the return value for {@see ServiceSubscriberInterface}. * * @example new SubscribedService('http_client', HttpClientInterface::class, false, new Target('githubApi')) * - * Use with {@see ServiceSubscriberTrait} to mark a method's return type + * Use with {@see ServiceMethodsSubscriberTrait} to mark a method's return type * as a subscribed service. * * @author Kevin Bond diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceCollectionInterface.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceCollectionInterface.php new file mode 100644 index 00000000..2333139c --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceCollectionInterface.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service; + +/** + * A ServiceProviderInterface that is also countable and iterable. + * + * @author Kevin Bond + * + * @template-covariant T of mixed + * + * @extends ServiceProviderInterface + * @extends \IteratorAggregate + */ +interface ServiceCollectionInterface extends ServiceProviderInterface, \Countable, \IteratorAggregate +{ +} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceLocatorTrait.php index 45c8d910..b62ec3e5 100644 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceLocatorTrait.php +++ b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceLocatorTrait.php @@ -31,7 +31,7 @@ trait ServiceLocatorTrait private array $providedTypes; /** - * @param callable[] $factories + * @param array $factories */ public function __construct(array $factories) { diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php new file mode 100644 index 00000000..0d89d9f2 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service; + +use Psr\Container\ContainerInterface; +use Symfony\Contracts\Service\Attribute\Required; +use Symfony\Contracts\Service\Attribute\SubscribedService; + +/** + * Implementation of ServiceSubscriberInterface that determines subscribed services + * from methods that have the #[SubscribedService] attribute. + * + * Service ids are available as "ClassName::methodName" so that the implementation + * of subscriber methods can be just `return $this->container->get(__METHOD__);`. + * + * @author Kevin Bond + */ +trait ServiceMethodsSubscriberTrait +{ + protected ContainerInterface $container; + + public static function getSubscribedServices(): array + { + $services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : []; + + foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { + if (self::class !== $method->getDeclaringClass()->name) { + continue; + } + + if (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) { + continue; + } + + if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { + throw new \LogicException(sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name)); + } + + if (!$returnType = $method->getReturnType()) { + throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); + } + + /* @var SubscribedService $attribute */ + $attribute = $attribute->newInstance(); + $attribute->key ??= self::class.'::'.$method->name; + $attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; + $attribute->nullable = $returnType->allowsNull(); + + if ($attribute->attributes) { + $services[] = $attribute; + } else { + $services[$attribute->key] = ($attribute->nullable ? '?' : '').$attribute->type; + } + } + + return $services; + } + + #[Required] + public function setContainer(ContainerInterface $container): ?ContainerInterface + { + $ret = null; + if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) { + $ret = parent::setContainer($container); + } + + $this->container = $container; + + return $ret; + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceProviderInterface.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceProviderInterface.php index c05e4bfe..2e71f00c 100644 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceProviderInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceProviderInterface.php @@ -39,7 +39,7 @@ public function has(string $id): bool; * * ['foo' => '?'] means the container provides service name "foo" of unspecified type * * ['bar' => '?Bar\Baz'] means the container provides a service "bar" of type Bar\Baz|null * - * @return string[] The provided service types, keyed by service names + * @return array The provided service types, keyed by service names */ public function getProvidedServices(): array; } diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberTrait.php index f3b450cd..cc3bc321 100644 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberTrait.php @@ -15,17 +15,23 @@ use Symfony\Contracts\Service\Attribute\Required; use Symfony\Contracts\Service\Attribute\SubscribedService; +trigger_deprecation('symfony/contracts', 'v3.5', '"%s" is deprecated, use "ServiceMethodsSubscriberTrait" instead.', ServiceSubscriberTrait::class); + /** - * Implementation of ServiceSubscriberInterface that determines subscribed services from - * method return types. Service ids are available as "ClassName::methodName". + * Implementation of ServiceSubscriberInterface that determines subscribed services + * from methods that have the #[SubscribedService] attribute. + * + * Service ids are available as "ClassName::methodName" so that the implementation + * of subscriber methods can be just `return $this->container->get(__METHOD__);`. + * + * @property ContainerInterface $container * * @author Kevin Bond + * + * @deprecated since symfony/contracts v3.5, use ServiceMethodsSubscriberTrait instead */ trait ServiceSubscriberTrait { - /** @var ContainerInterface */ - protected $container; - public static function getSubscribedServices(): array { $services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : []; diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php index 88f6a068..07d12b4a 100644 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ b/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php @@ -11,82 +11,13 @@ namespace Symfony\Contracts\Service\Test; -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\ServiceLocatorTrait; +class_alias(ServiceLocatorTestCase::class, ServiceLocatorTest::class); -abstract class ServiceLocatorTest extends TestCase -{ - protected function getServiceLocator(array $factories): ContainerInterface +if (false) { + /** + * @deprecated since PHPUnit 9.6 + */ + class ServiceLocatorTest { - return new class($factories) implements ContainerInterface { - use ServiceLocatorTrait; - }; - } - - public function testHas() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - function () { return 'dummy'; }, - ]); - - $this->assertTrue($locator->has('foo')); - $this->assertTrue($locator->has('bar')); - $this->assertFalse($locator->has('dummy')); - } - - public function testGet() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('baz', $locator->get('bar')); - } - - public function testGetDoesNotMemoize() - { - $i = 0; - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$i) { - ++$i; - - return 'bar'; - }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame(2, $i); - } - - public function testThrowsOnUndefinedInternalService() - { - if (!$this->getExpectedException()) { - $this->expectException(\Psr\Container\NotFoundExceptionInterface::class); - $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); - } - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } - - public function testThrowsOnCircularReference() - { - $this->expectException(\Psr\Container\ContainerExceptionInterface::class); - $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - 'bar' => function () use (&$locator) { return $locator->get('baz'); }, - 'baz' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); } } diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php new file mode 100644 index 00000000..65a3fe33 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php @@ -0,0 +1,96 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service\Test; + +use PHPUnit\Framework\TestCase; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\ContainerInterface; +use Psr\Container\NotFoundExceptionInterface; +use Symfony\Contracts\Service\ServiceLocatorTrait; + +abstract class ServiceLocatorTestCase extends TestCase +{ + protected function getServiceLocator(array $factories): ContainerInterface + { + return new class($factories) implements ContainerInterface { + use ServiceLocatorTrait; + }; + } + + public function testHas() + { + $locator = $this->getServiceLocator([ + 'foo' => fn () => 'bar', + 'bar' => fn () => 'baz', + fn () => 'dummy', + ]); + + $this->assertTrue($locator->has('foo')); + $this->assertTrue($locator->has('bar')); + $this->assertFalse($locator->has('dummy')); + } + + public function testGet() + { + $locator = $this->getServiceLocator([ + 'foo' => fn () => 'bar', + 'bar' => fn () => 'baz', + ]); + + $this->assertSame('bar', $locator->get('foo')); + $this->assertSame('baz', $locator->get('bar')); + } + + public function testGetDoesNotMemoize() + { + $i = 0; + $locator = $this->getServiceLocator([ + 'foo' => function () use (&$i) { + ++$i; + + return 'bar'; + }, + ]); + + $this->assertSame('bar', $locator->get('foo')); + $this->assertSame('bar', $locator->get('foo')); + $this->assertSame(2, $i); + } + + public function testThrowsOnUndefinedInternalService() + { + $locator = $this->getServiceLocator([ + 'foo' => function () use (&$locator) { return $locator->get('bar'); }, + ]); + + if (!$this->getExpectedException()) { + $this->expectException(NotFoundExceptionInterface::class); + $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); + } + + $locator->get('foo'); + } + + public function testThrowsOnCircularReference() + { + $locator = $this->getServiceLocator([ + 'foo' => function () use (&$locator) { return $locator->get('bar'); }, + 'bar' => function () use (&$locator) { return $locator->get('baz'); }, + 'baz' => function () use (&$locator) { return $locator->get('bar'); }, + ]); + + $this->expectException(ContainerExceptionInterface::class); + $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); + + $locator->get('foo'); + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/composer.json b/tools/php-cs-fixer/vendor/symfony/service-contracts/composer.json index 36b0d95e..fc8674a7 100644 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/service-contracts/composer.json @@ -17,14 +17,12 @@ ], "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" }, "exclude-from-classmap": [ @@ -34,7 +32,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/stopwatch/CHANGELOG.md index f2fd7d0f..4b764039 100644 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/CHANGELOG.md +++ b/tools/php-cs-fixer/vendor/symfony/stopwatch/CHANGELOG.md @@ -1,6 +1,12 @@ CHANGELOG ========= +7.2 +--- + + * Add method `getLastPeriod()` to `StopwatchEvent` + * Add `getRootSectionEvents()` method and `ROOT` constant to `Stopwatch` + 5.2 --- diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/README.md b/tools/php-cs-fixer/vendor/symfony/stopwatch/README.md index 13a9dfa5..824ddfd6 100644 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/README.md +++ b/tools/php-cs-fixer/vendor/symfony/stopwatch/README.md @@ -6,8 +6,8 @@ The Stopwatch component provides a way to profile code. Getting Started --------------- -``` -$ composer require symfony/stopwatch +```bash +composer require symfony/stopwatch ``` ```php diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/Section.php b/tools/php-cs-fixer/vendor/symfony/stopwatch/Section.php index 28003673..07922292 100644 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/Section.php +++ b/tools/php-cs-fixer/vendor/symfony/stopwatch/Section.php @@ -23,8 +23,6 @@ class Section */ private array $events = []; - private ?float $origin; - private bool $morePrecision; private ?string $id = null; /** @@ -36,10 +34,10 @@ class Section * @param float|null $origin Set the origin of the events in this section, use null to set their origin to their start time * @param bool $morePrecision If true, time is stored as float to keep the original microsecond precision */ - public function __construct(float $origin = null, bool $morePrecision = false) - { - $this->origin = $origin; - $this->morePrecision = $morePrecision; + public function __construct( + private ?float $origin = null, + private bool $morePrecision = false, + ) { } /** @@ -115,7 +113,7 @@ public function isEventStarted(string $name): bool public function stopEvent(string $name): StopwatchEvent { if (!isset($this->events[$name])) { - throw new \LogicException(sprintf('Event "%s" is not started.', $name)); + throw new \LogicException(\sprintf('Event "%s" is not started.', $name)); } return $this->events[$name]->stop(); @@ -139,7 +137,7 @@ public function lap(string $name): StopwatchEvent public function getEvent(string $name): StopwatchEvent { if (!isset($this->events[$name])) { - throw new \LogicException(sprintf('Event "%s" is not known.', $name)); + throw new \LogicException(\sprintf('Event "%s" is not known.', $name)); } return $this->events[$name]; diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/Stopwatch.php b/tools/php-cs-fixer/vendor/symfony/stopwatch/Stopwatch.php index 3d6c976b..8961507f 100644 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/Stopwatch.php +++ b/tools/php-cs-fixer/vendor/symfony/stopwatch/Stopwatch.php @@ -23,7 +23,7 @@ class_exists(Section::class); */ class Stopwatch implements ResetInterface { - private bool $morePrecision; + public const ROOT = '__root__'; /** * @var Section[] @@ -38,9 +38,9 @@ class Stopwatch implements ResetInterface /** * @param bool $morePrecision If true, time is stored as float to keep the original microsecond precision */ - public function __construct(bool $morePrecision = false) - { - $this->morePrecision = $morePrecision; + public function __construct( + private bool $morePrecision = false, + ) { $this->reset(); } @@ -59,12 +59,12 @@ public function getSections(): array * * @throws \LogicException When the section to re-open is not reachable */ - public function openSection(string $id = null) + public function openSection(?string $id = null): void { $current = end($this->activeSections); if (null !== $id && null === $current->get($id)) { - throw new \LogicException(sprintf('The section "%s" has been started at an other level and cannot be opened.', $id)); + throw new \LogicException(\sprintf('The section "%s" has been started at an other level and cannot be opened.', $id)); } $this->start('__section__.child', 'section'); @@ -81,7 +81,7 @@ public function openSection(string $id = null) * * @throws \LogicException When there's no started section to be stopped */ - public function stopSection(string $id) + public function stopSection(string $id): void { $this->stop('__section__'); @@ -96,7 +96,7 @@ public function stopSection(string $id) /** * Starts an event. */ - public function start(string $name, string $category = null): StopwatchEvent + public function start(string $name, ?string $category = null): StopwatchEvent { return end($this->activeSections)->startEvent($name, $category); } @@ -143,11 +143,21 @@ public function getSectionEvents(string $id): array return isset($this->sections[$id]) ? $this->sections[$id]->getEvents() : []; } + /** + * Gets all events for the root section. + * + * @return StopwatchEvent[] + */ + public function getRootSectionEvents(): array + { + return $this->sections[self::ROOT]->getEvents() ?? []; + } + /** * Resets the stopwatch to its original state. */ - public function reset() + public function reset(): void { - $this->sections = $this->activeSections = ['__root__' => new Section(null, $this->morePrecision)]; + $this->sections = $this->activeSections = [self::ROOT => new Section(null, $this->morePrecision)]; } } diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchEvent.php b/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchEvent.php index 518937d0..cabe642c 100644 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchEvent.php +++ b/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchEvent.php @@ -25,7 +25,6 @@ class StopwatchEvent private float $origin; private string $category; - private bool $morePrecision; /** * @var float[] @@ -42,11 +41,14 @@ class StopwatchEvent * * @throws \InvalidArgumentException When the raw time is not valid */ - public function __construct(float $origin, string $category = null, bool $morePrecision = false, string $name = null) - { + public function __construct( + float $origin, + ?string $category = null, + private bool $morePrecision = false, + ?string $name = null, + ) { $this->origin = $this->formatTime($origin); $this->category = \is_string($category) ? $category : 'default'; - $this->morePrecision = $morePrecision; $this->name = $name ?? 'default'; } @@ -101,7 +103,7 @@ public function stop(): static */ public function isStarted(): bool { - return !empty($this->started); + return (bool) $this->started; } /** @@ -117,7 +119,7 @@ public function lap(): static /** * Stops all non already stopped periods. */ - public function ensureStopped() + public function ensureStopped(): void { while (\count($this->started)) { $this->stop(); @@ -134,6 +136,18 @@ public function getPeriods(): array return $this->periods; } + /** + * Gets the last event period. + */ + public function getLastPeriod(): ?StopwatchPeriod + { + if ([] === $this->periods) { + return null; + } + + return $this->periods[array_key_last($this->periods)]; + } + /** * Gets the relative time of the start of the first period in milliseconds. */ @@ -223,6 +237,6 @@ public function getName(): string public function __toString(): string { - return sprintf('%s/%s: %.2F MiB - %d ms', $this->getCategory(), $this->getName(), $this->getMemory() / 1024 / 1024, $this->getDuration()); + return \sprintf('%s/%s: %.2F MiB - %d ms', $this->getCategory(), $this->getName(), $this->getMemory() / 1024 / 1024, $this->getDuration()); } } diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchPeriod.php b/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchPeriod.php index 41e8dccb..d80d7e15 100644 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchPeriod.php +++ b/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchPeriod.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Stopwatch; /** - * Represents an Period for an Event. + * Represents a Period for an Event. * * @author Fabien Potencier */ @@ -68,6 +68,6 @@ public function getMemory(): int public function __toString(): string { - return sprintf('%.2F MiB - %d ms', $this->getMemory() / 1024 / 1024, $this->getDuration()); + return \sprintf('%.2F MiB - %d ms', $this->getMemory() / 1024 / 1024, $this->getDuration()); } } diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/composer.json b/tools/php-cs-fixer/vendor/symfony/stopwatch/composer.json index da4c3d2e..35568695 100644 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/stopwatch/composer.json @@ -16,8 +16,8 @@ } ], "require": { - "php": ">=8.1", - "symfony/service-contracts": "^1|^2|^3" + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" }, "autoload": { "psr-4": { "Symfony\\Component\\Stopwatch\\": "" }, diff --git a/tools/php-cs-fixer/vendor/symfony/string/AbstractString.php b/tools/php-cs-fixer/vendor/symfony/string/AbstractString.php index bf491f88..500d7c31 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/AbstractString.php +++ b/tools/php-cs-fixer/vendor/symfony/string/AbstractString.php @@ -39,8 +39,8 @@ abstract class AbstractString implements \Stringable, \JsonSerializable public const PREG_SPLIT_DELIM_CAPTURE = \PREG_SPLIT_DELIM_CAPTURE; public const PREG_SPLIT_OFFSET_CAPTURE = \PREG_SPLIT_OFFSET_CAPTURE; - protected $string = ''; - protected $ignoreCase = false; + protected string $string = ''; + protected ?bool $ignoreCase = false; abstract public function __construct(string $string = ''); @@ -263,7 +263,7 @@ public function containsAny(string|iterable $needle): bool public function endsWith(string|iterable $suffix): bool { if (\is_string($suffix)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } foreach ($suffix as $s) { @@ -312,7 +312,7 @@ public function ensureStart(string $prefix): static public function equalsTo(string|iterable $string): bool { if (\is_string($string)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } foreach ($string as $s) { @@ -340,7 +340,7 @@ public function ignoreCase(): static public function indexOf(string|iterable $needle, int $offset = 0): ?int { if (\is_string($needle)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } $i = \PHP_INT_MAX; @@ -362,7 +362,7 @@ public function indexOf(string|iterable $needle, int $offset = 0): ?int public function indexOfLast(string|iterable $needle, int $offset = 0): ?int { if (\is_string($needle)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } $i = null; @@ -383,7 +383,7 @@ public function isEmpty(): bool return '' === $this->string; } - abstract public function join(array $strings, string $lastGlue = null): static; + abstract public function join(array $strings, ?string $lastGlue = null): static; public function jsonSerialize(): string { @@ -414,7 +414,7 @@ abstract public function prepend(string ...$prefix): static; public function repeat(int $multiplier): static { if (0 > $multiplier) { - throw new InvalidArgumentException(sprintf('Multiplier must be positive, %d given.', $multiplier)); + throw new InvalidArgumentException(\sprintf('Multiplier must be positive, %d given.', $multiplier)); } $str = clone $this; @@ -429,16 +429,21 @@ abstract public function replaceMatches(string $fromRegexp, string|callable $to) abstract public function reverse(): static; - abstract public function slice(int $start = 0, int $length = null): static; + abstract public function slice(int $start = 0, ?int $length = null): static; abstract public function snake(): static; - abstract public function splice(string $replacement, int $start = 0, int $length = null): static; + public function kebab(): static + { + return $this->snake()->replace('_', '-'); + } + + abstract public function splice(string $replacement, int $start = 0, ?int $length = null): static; /** * @return static[] */ - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { if (null === $flags) { throw new \TypeError('Split behavior when $flags is null must be implemented by child classes.'); @@ -448,7 +453,7 @@ public function split(string $delimiter, int $limit = null, int $flags = null): $delimiter .= 'i'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (false === $chunks = preg_split($delimiter, $this->string, $limit, $flags)) { @@ -481,7 +486,7 @@ public function split(string $delimiter, int $limit = null, int $flags = null): public function startsWith(string|iterable $prefix): bool { if (\is_string($prefix)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } foreach ($prefix as $prefix) { @@ -495,7 +500,7 @@ public function startsWith(string|iterable $prefix): bool abstract public function title(bool $allWords = false): static; - public function toByteString(string $toEncoding = null): ByteString + public function toByteString(?string $toEncoding = null): ByteString { $b = new ByteString(); @@ -507,20 +512,14 @@ public function toByteString(string $toEncoding = null): ByteString return $b; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - try { - try { - $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $b->string = iconv('UTF-8', $toEncoding, $this->string); + $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); + } catch (\ValueError $e) { + if (!\function_exists('iconv')) { + throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e); } - } finally { - restore_error_handler(); + + $b->string = iconv('UTF-8', $toEncoding, $this->string); } return $b; @@ -611,7 +610,7 @@ public function trimSuffix($suffix): static return $str; } - public function truncate(int $length, string $ellipsis = '', bool $cut = true): static + public function truncate(int $length, string $ellipsis = '', bool|TruncateMode $cut = TruncateMode::Char): static { $stringLength = $this->length(); @@ -625,16 +624,27 @@ public function truncate(int $length, string $ellipsis = '', bool $cut = true): $ellipsisLength = 0; } - if (!$cut) { + $desiredLength = $length; + if (TruncateMode::WordAfter === $cut || !$cut) { if (null === $length = $this->indexOf([' ', "\r", "\n", "\t"], ($length ?: 1) - 1)) { return clone $this; } + $length += $ellipsisLength; + } elseif (TruncateMode::WordBefore === $cut && null !== $this->indexOf([' ', "\r", "\n", "\t"], ($length ?: 1) - 1)) { $length += $ellipsisLength; } $str = $this->slice(0, $length - $ellipsisLength); + if (TruncateMode::WordBefore === $cut) { + if (0 === $ellipsisLength && $desiredLength === $this->indexOf([' ', "\r", "\n", "\t"], $length)) { + return $str; + } + + $str = $str->beforeLast([' ', "\r", "\n", "\t"]); + } + return $ellipsisLength ? $str->trimEnd()->append($ellipsis) : $str; } diff --git a/tools/php-cs-fixer/vendor/symfony/string/AbstractUnicodeString.php b/tools/php-cs-fixer/vendor/symfony/string/AbstractUnicodeString.php index 2a2bed71..979fcea8 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/AbstractUnicodeString.php +++ b/tools/php-cs-fixer/vendor/symfony/string/AbstractUnicodeString.php @@ -40,17 +40,13 @@ abstract class AbstractUnicodeString extends AbstractString private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; - // the subset of upper case mappings that map one code point to many code points - private const UPPER_FROM = ['ß', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'և', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ', 'ʼn', 'ΐ', 'ΰ', 'ǰ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾶ', 'ῆ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῶ']; - private const UPPER_TO = ['SS', 'FF', 'FI', 'FL', 'FFI', 'FFL', 'ST', 'ST', 'ԵՒ', 'ՄՆ', 'ՄԵ', 'ՄԻ', 'ՎՆ', 'ՄԽ', 'ʼN', 'Ϊ́', 'Ϋ́', 'J̌', 'H̱', 'T̈', 'W̊', 'Y̊', 'Aʾ', 'Υ̓', 'Υ̓̀', 'Υ̓́', 'Υ̓͂', 'Α͂', 'Η͂', 'Ϊ̀', 'Ϊ́', 'Ι͂', 'Ϊ͂', 'Ϋ̀', 'Ϋ́', 'Ρ̓', 'Υ͂', 'Ϋ͂', 'Ω͂']; - // the subset of https://github.com/unicode-org/cldr/blob/master/common/transforms/Latin-ASCII.xml that is not in NFKD private const TRANSLIT_FROM = ['Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ', 'ħ', 'ı', 'ĸ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'ʼn', 'Ŋ', 'ŋ', 'Œ', 'œ', 'Ŧ', 'ŧ', 'ƀ', 'Ɓ', 'Ƃ', 'ƃ', 'Ƈ', 'ƈ', 'Ɖ', 'Ɗ', 'Ƌ', 'ƌ', 'Ɛ', 'Ƒ', 'ƒ', 'Ɠ', 'ƕ', 'Ɩ', 'Ɨ', 'Ƙ', 'ƙ', 'ƚ', 'Ɲ', 'ƞ', 'Ƣ', 'ƣ', 'Ƥ', 'ƥ', 'ƫ', 'Ƭ', 'ƭ', 'Ʈ', 'Ʋ', 'Ƴ', 'ƴ', 'Ƶ', 'ƶ', 'DŽ', 'Dž', 'dž', 'Ǥ', 'ǥ', 'ȡ', 'Ȥ', 'ȥ', 'ȴ', 'ȵ', 'ȶ', 'ȷ', 'ȸ', 'ȹ', 'Ⱥ', 'Ȼ', 'ȼ', 'Ƚ', 'Ⱦ', 'ȿ', 'ɀ', 'Ƀ', 'Ʉ', 'Ɇ', 'ɇ', 'Ɉ', 'ɉ', 'Ɍ', 'ɍ', 'Ɏ', 'ɏ', 'ɓ', 'ɕ', 'ɖ', 'ɗ', 'ɛ', 'ɟ', 'ɠ', 'ɡ', 'ɢ', 'ɦ', 'ɧ', 'ɨ', 'ɪ', 'ɫ', 'ɬ', 'ɭ', 'ɱ', 'ɲ', 'ɳ', 'ɴ', 'ɶ', 'ɼ', 'ɽ', 'ɾ', 'ʀ', 'ʂ', 'ʈ', 'ʉ', 'ʋ', 'ʏ', 'ʐ', 'ʑ', 'ʙ', 'ʛ', 'ʜ', 'ʝ', 'ʟ', 'ʠ', 'ʣ', 'ʥ', 'ʦ', 'ʪ', 'ʫ', 'ᴀ', 'ᴁ', 'ᴃ', 'ᴄ', 'ᴅ', 'ᴆ', 'ᴇ', 'ᴊ', 'ᴋ', 'ᴌ', 'ᴍ', 'ᴏ', 'ᴘ', 'ᴛ', 'ᴜ', 'ᴠ', 'ᴡ', 'ᴢ', 'ᵫ', 'ᵬ', 'ᵭ', 'ᵮ', 'ᵯ', 'ᵰ', 'ᵱ', 'ᵲ', 'ᵳ', 'ᵴ', 'ᵵ', 'ᵶ', 'ᵺ', 'ᵻ', 'ᵽ', 'ᵾ', 'ᶀ', 'ᶁ', 'ᶂ', 'ᶃ', 'ᶄ', 'ᶅ', 'ᶆ', 'ᶇ', 'ᶈ', 'ᶉ', 'ᶊ', 'ᶌ', 'ᶍ', 'ᶎ', 'ᶏ', 'ᶑ', 'ᶒ', 'ᶓ', 'ᶖ', 'ᶙ', 'ẚ', 'ẜ', 'ẝ', 'ẞ', 'Ỻ', 'ỻ', 'Ỽ', 'ỽ', 'Ỿ', 'ỿ', '©', '®', '₠', '₢', '₣', '₤', '₧', '₺', '₹', 'ℌ', '℞', '㎧', '㎮', '㏆', '㏗', '㏞', '㏟', '¼', '½', '¾', '⅓', '⅔', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅛', '⅜', '⅝', '⅞', '⅟', '〇', '‘', '’', '‚', '‛', '“', '”', '„', '‟', '′', '″', '〝', '〞', '«', '»', '‹', '›', '‐', '‑', '‒', '–', '—', '―', '︱', '︲', '﹘', '‖', '⁄', '⁅', '⁆', '⁎', '、', '。', '〈', '〉', '《', '》', '〔', '〕', '〘', '〙', '〚', '〛', '︑', '︒', '︹', '︺', '︽', '︾', '︿', '﹀', '﹑', '﹝', '﹞', '⦅', '⦆', '。', '、', '×', '÷', '−', '∕', '∖', '∣', '∥', '≪', '≫', '⦅', '⦆']; private const TRANSLIT_TO = ['AE', 'D', 'O', 'TH', 'ss', 'ae', 'd', 'o', 'th', 'D', 'd', 'H', 'h', 'i', 'q', 'L', 'l', 'L', 'l', '\'n', 'N', 'n', 'OE', 'oe', 'T', 't', 'b', 'B', 'B', 'b', 'C', 'c', 'D', 'D', 'D', 'd', 'E', 'F', 'f', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'N', 'n', 'OI', 'oi', 'P', 'p', 't', 'T', 't', 'T', 'V', 'Y', 'y', 'Z', 'z', 'DZ', 'Dz', 'dz', 'G', 'g', 'd', 'Z', 'z', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', 'z', 'B', 'U', 'E', 'e', 'J', 'j', 'R', 'r', 'Y', 'y', 'b', 'c', 'd', 'd', 'e', 'j', 'g', 'g', 'G', 'h', 'h', 'i', 'I', 'l', 'l', 'l', 'm', 'n', 'n', 'N', 'OE', 'r', 'r', 'r', 'R', 's', 't', 'u', 'v', 'Y', 'z', 'z', 'B', 'G', 'H', 'j', 'L', 'q', 'dz', 'dz', 'ts', 'ls', 'lz', 'A', 'AE', 'B', 'C', 'D', 'D', 'E', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', 'V', 'W', 'Z', 'ue', 'b', 'd', 'f', 'm', 'n', 'p', 'r', 'r', 's', 't', 'z', 'th', 'I', 'p', 'U', 'b', 'd', 'f', 'g', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'v', 'x', 'z', 'a', 'd', 'e', 'e', 'i', 'u', 'a', 's', 's', 'SS', 'LL', 'll', 'V', 'v', 'Y', 'y', '(C)', '(R)', 'CE', 'Cr', 'Fr.', 'L.', 'Pts', 'TL', 'Rs', 'x', 'Rx', 'm/s', 'rad/s', 'C/kg', 'pH', 'V/m', 'A/m', ' 1/4', ' 1/2', ' 3/4', ' 1/3', ' 2/3', ' 1/5', ' 2/5', ' 3/5', ' 4/5', ' 1/6', ' 5/6', ' 1/8', ' 3/8', ' 5/8', ' 7/8', ' 1/', '0', '\'', '\'', ',', '\'', '"', '"', ',,', '"', '\'', '"', '"', '"', '<<', '>>', '<', '>', '-', '-', '-', '-', '-', '-', '-', '-', '-', '||', '/', '[', ']', '*', ',', '.', '<', '>', '<<', '>>', '[', ']', '[', ']', '[', ']', ',', '.', '[', ']', '<<', '>>', '<', '>', ',', '[', ']', '((', '))', '.', ',', '*', '/', '-', '/', '\\', '|', '||', '<<', '>>', '((', '))']; - private static $transliterators = []; - private static $tableZero; - private static $tableWide; + private static array $transliterators = []; + private static array $tableZero; + private static array $tableWide; public static function fromCodePoints(int ...$codes): static { @@ -128,7 +124,7 @@ public function ascii(array $rules = []): self } if (null === $transliterator) { - throw new InvalidArgumentException(sprintf('Unknown transliteration rule "%s".', $rule)); + throw new InvalidArgumentException(\sprintf('Unknown transliteration rule "%s".', $rule)); } self::$transliterators['any-latin/bgn'] = $transliterator; @@ -143,7 +139,7 @@ public function ascii(array $rules = []): self $c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]); if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) { - throw new \LogicException(sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class)); + throw new \LogicException(\sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class)); } return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?'); @@ -159,7 +155,9 @@ public function ascii(array $rules = []): self public function camel(): static { $str = clone $this; - $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) use (&$i) { + $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?!\p{Lu})/u', static function ($m) { + static $i = 0; + return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); }, preg_replace('/[^\pL0-9]++/u', ' ', $this->string))); @@ -192,7 +190,7 @@ public function folded(bool $compat = true): static if (!$compat || !\defined('Normalizer::NFKC_CF')) { $str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC); - $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $this->string), 'UTF-8'); + $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $str->string), 'UTF-8'); } else { $str->string = normalizer_normalize($str->string, \Normalizer::NFKC_CF); } @@ -200,7 +198,7 @@ public function folded(bool $compat = true): static return $str; } - public function join(array $strings, string $lastGlue = null): static + public function join(array $strings, ?string $lastGlue = null): static { $str = clone $this; @@ -222,6 +220,21 @@ public function lower(): static return $str; } + /** + * @param string $locale In the format language_region (e.g. tr_TR) + */ + public function localeLower(string $locale): static + { + if (null !== $transliterator = $this->getLocaleTransliterator($locale, 'Lower')) { + $str = clone $this; + $str->string = $transliterator->transliterate($str->string); + + return $str; + } + + return $this->lower(); + } + public function match(string $regexp, int $flags = 0, int $offset = 0): array { $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; @@ -230,7 +243,7 @@ public function match(string $regexp, int $flags = 0, int $offset = 0): array $regexp .= 'i'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (false === $match($regexp.'u', $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { @@ -314,7 +327,7 @@ public function replaceMatches(string $fromRegexp, string|callable $to): static $replace = 'preg_replace'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (null === $string = $replace($fromRegexp.'u', $to, $this->string)) { @@ -360,13 +373,26 @@ public function title(bool $allWords = false): static $limit = $allWords ? -1 : 1; - $str->string = preg_replace_callback('/\b./u', static function (array $m): string { - return mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, $str->string, $limit); + $str->string = preg_replace_callback('/\b./u', static fn (array $m): string => mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'), $str->string, $limit); return $str; } + /** + * @param string $locale In the format language_region (e.g. tr_TR) + */ + public function localeTitle(string $locale): static + { + if (null !== $transliterator = $this->getLocaleTransliterator($locale, 'Title')) { + $str = clone $this; + $str->string = $transliterator->transliterate($str->string); + + return $str; + } + + return $this->title(); + } + public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static { if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { @@ -454,6 +480,21 @@ public function upper(): static return $str; } + /** + * @param string $locale In the format language_region (e.g. tr_TR) + */ + public function localeUpper(string $locale): static + { + if (null !== $transliterator = $this->getLocaleTransliterator($locale, 'Upper')) { + $str = clone $this; + $str->string = $transliterator->transliterate($str->string); + + return $str; + } + + return $this->upper(); + } + public function width(bool $ignoreAnsiDecoration = true): int { $width = 0; @@ -591,4 +632,33 @@ private function wcswidth(string $string): int return $width; } + + private function getLocaleTransliterator(string $locale, string $id): ?\Transliterator + { + $rule = $locale.'-'.$id; + if (\array_key_exists($rule, self::$transliterators)) { + return self::$transliterators[$rule]; + } + + if (null !== $transliterator = self::$transliterators[$rule] = \Transliterator::create($rule)) { + return $transliterator; + } + + // Try to find a parent locale (nl_BE -> nl) + if (false === $i = strpos($locale, '_')) { + return null; + } + + $parentRule = substr_replace($locale, '-'.$id, $i); + + // Parent locale was already cached, return and store as current locale + if (\array_key_exists($parentRule, self::$transliterators)) { + return self::$transliterators[$rule] = self::$transliterators[$parentRule]; + } + + // Create transliterator based on parent locale and cache the result on both initial and parent locale values + $transliterator = \Transliterator::create($parentRule); + + return self::$transliterators[$rule] = self::$transliterators[$parentRule] = $transliterator; + } } diff --git a/tools/php-cs-fixer/vendor/symfony/string/ByteString.php b/tools/php-cs-fixer/vendor/symfony/string/ByteString.php index 212290fe..5cbfd6de 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/ByteString.php +++ b/tools/php-cs-fixer/vendor/symfony/string/ByteString.php @@ -11,6 +11,7 @@ namespace Symfony\Component\String; +use Random\Randomizer; use Symfony\Component\String\Exception\ExceptionInterface; use Symfony\Component\String\Exception\InvalidArgumentException; use Symfony\Component\String\Exception\RuntimeException; @@ -42,10 +43,10 @@ public function __construct(string $string = '') * Copyright (c) 2004-2020, Facebook, Inc. (https://www.facebook.com/) */ - public static function fromRandom(int $length = 16, string $alphabet = null): self + public static function fromRandom(int $length = 16, ?string $alphabet = null): self { if ($length <= 0) { - throw new InvalidArgumentException(sprintf('A strictly positive length is expected, "%d" given.', $length)); + throw new InvalidArgumentException(\sprintf('A strictly positive length is expected, "%d" given.', $length)); } $alphabet ??= self::ALPHABET_ALPHANUMERIC; @@ -55,6 +56,10 @@ public static function fromRandom(int $length = 16, string $alphabet = null): se throw new InvalidArgumentException('The length of the alphabet must in the [2^1, 2^56] range.'); } + if (\PHP_VERSION_ID >= 80300) { + return new static((new Randomizer())->getBytesFromString($alphabet, $length)); + } + $ret = ''; while ($length > 0) { $urandomLength = (int) ceil(2 * $length * $bits / 8.0); @@ -205,7 +210,7 @@ public function isUtf8(): bool return '' === $this->string || preg_match('//u', $this->string); } - public function join(array $strings, string $lastGlue = null): static + public function join(array $strings, ?string $lastGlue = null): static { $str = clone $this; @@ -236,7 +241,7 @@ public function match(string $regexp, int $flags = 0, int $offset = 0): array $regexp .= 'i'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (false === $match($regexp, $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { @@ -300,7 +305,7 @@ public function replaceMatches(string $fromRegexp, string|callable $to): static $replace = \is_array($to) || $to instanceof \Closure ? 'preg_replace_callback' : 'preg_replace'; - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (null === $string = $replace($fromRegexp, $to, $this->string)) { @@ -332,10 +337,10 @@ public function reverse(): static return $str; } - public function slice(int $start = 0, int $length = null): static + public function slice(int $start = 0, ?int $length = null): static { $str = clone $this; - $str->string = (string) substr($this->string, $start, $length ?? \PHP_INT_MAX); + $str->string = substr($this->string, $start, $length ?? \PHP_INT_MAX); return $str; } @@ -348,7 +353,7 @@ public function snake(): static return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): static + public function splice(string $replacement, int $start = 0, ?int $length = null): static { $str = clone $this; $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); @@ -356,7 +361,7 @@ public function splice(string $replacement, int $start = 0, int $length = null): return $str; } - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { if (1 > $limit ??= \PHP_INT_MAX) { throw new InvalidArgumentException('Split limit must be a positive integer.'); @@ -402,12 +407,12 @@ public function title(bool $allWords = false): static return $str; } - public function toUnicodeString(string $fromEncoding = null): UnicodeString + public function toUnicodeString(?string $fromEncoding = null): UnicodeString { return new UnicodeString($this->toCodePointString($fromEncoding)->string); } - public function toCodePointString(string $fromEncoding = null): CodePointString + public function toCodePointString(?string $fromEncoding = null): CodePointString { $u = new CodePointString(); @@ -417,7 +422,7 @@ public function toCodePointString(string $fromEncoding = null): CodePointString return $u; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { try { @@ -436,7 +441,7 @@ public function toCodePointString(string $fromEncoding = null): CodePointString } if (!$validEncoding) { - throw new InvalidArgumentException(sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252')); + throw new InvalidArgumentException(\sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252')); } $u->string = mb_convert_encoding($this->string, 'UTF-8', $fromEncoding ?? 'Windows-1252'); diff --git a/tools/php-cs-fixer/vendor/symfony/string/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/string/CHANGELOG.md index 31a3b54d..ff505b14 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/CHANGELOG.md +++ b/tools/php-cs-fixer/vendor/symfony/string/CHANGELOG.md @@ -1,6 +1,17 @@ CHANGELOG ========= +7.2 +--- + + * Add `TruncateMode` enum to handle more truncate methods + * Add the `AbstractString::kebab()` method + +7.1 +--- + + * Add `localeLower()`, `localeUpper()`, `localeTitle()` methods to `AbstractUnicodeString` + 6.2 --- diff --git a/tools/php-cs-fixer/vendor/symfony/string/CodePointString.php b/tools/php-cs-fixer/vendor/symfony/string/CodePointString.php index f5c900fb..337bfc12 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/CodePointString.php +++ b/tools/php-cs-fixer/vendor/symfony/string/CodePointString.php @@ -186,7 +186,7 @@ public function replace(string $from, string $to): static return $str; } - public function slice(int $start = 0, int $length = null): static + public function slice(int $start = 0, ?int $length = null): static { $str = clone $this; $str->string = mb_substr($this->string, $start, $length, 'UTF-8'); @@ -194,7 +194,7 @@ public function slice(int $start = 0, int $length = null): static return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): static + public function splice(string $replacement, int $start = 0, ?int $length = null): static { if (!preg_match('//u', $replacement)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); @@ -208,7 +208,7 @@ public function splice(string $replacement, int $start = 0, int $length = null): return $str; } - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { if (1 > $limit ??= \PHP_INT_MAX) { throw new InvalidArgumentException('Split limit must be a positive integer.'); diff --git a/tools/php-cs-fixer/vendor/symfony/string/Inflector/EnglishInflector.php b/tools/php-cs-fixer/vendor/symfony/string/Inflector/EnglishInflector.php index 2871e4e5..a5be28d6 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/Inflector/EnglishInflector.php +++ b/tools/php-cs-fixer/vendor/symfony/string/Inflector/EnglishInflector.php @@ -21,12 +21,39 @@ final class EnglishInflector implements InflectorInterface private const PLURAL_MAP = [ // First entry: plural suffix, reversed // Second entry: length of plural suffix - // Third entry: Whether the suffix may succeed a vocal + // Third entry: Whether the suffix may succeed a vowel // Fourth entry: Whether the suffix may succeed a consonant // Fifth entry: singular suffix, normal - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['a', 1, true, true, ['on', 'um']], + // bacteria (bacterium) + ['airetcab', 8, true, true, 'bacterium'], + + // corpora (corpus) + ['aroproc', 7, true, true, 'corpus'], + + // criteria (criterion) + ['airetirc', 8, true, true, 'criterion'], + + // curricula (curriculum) + ['alucirruc', 9, true, true, 'curriculum'], + + // quora (quorum) + ['arouq', 5, true, true, 'quorum'], + + // genera (genus) + ['areneg', 6, true, true, 'genus'], + + // media (medium) + ['aidem', 5, true, true, 'medium'], + + // memoranda (memorandum) + ['adnaromem', 9, true, true, 'memorandum'], + + // phenomena (phenomenon) + ['anemonehp', 9, true, true, 'phenomenon'], + + // strata (stratum) + ['atarts', 6, true, true, 'stratum'], // nebulae (nebula) ['ea', 2, true, true, 'a'], @@ -94,6 +121,12 @@ final class EnglishInflector implements InflectorInterface // accesses (access), addresses (address), kisses (kiss) ['sess', 4, true, false, 'ss'], + // statuses (status) + ['sesutats', 8, true, true, 'status'], + + // article (articles), ancle (ancles) + ['sel', 3, true, true, 'le'], + // analyses (analysis), ellipses (ellipsis), fungi (fungus), // neuroses (neurosis), theses (thesis), emphases (emphasis), // oases (oasis), crises (crisis), houses (house), bases (base), @@ -138,6 +171,9 @@ final class EnglishInflector implements InflectorInterface // shoes (shoe) ['se', 2, true, true, ['', 'e']], + // status (status) + ['sutats', 6, true, true, 'status'], + // tags (tag) ['s', 1, true, true, ''], @@ -156,10 +192,13 @@ final class EnglishInflector implements InflectorInterface private const SINGULAR_MAP = [ // First entry: singular suffix, reversed // Second entry: length of singular suffix - // Third entry: Whether the suffix may succeed a vocal + // Third entry: Whether the suffix may succeed a vowel // Fourth entry: Whether the suffix may succeed a consonant // Fifth entry: plural suffix, normal + // axes (axis) + ['sixa', 4, false, false, 'axes'], + // criterion (criteria) ['airetirc', 8, false, false, 'criterion'], @@ -229,7 +268,13 @@ final class EnglishInflector implements InflectorInterface // teeth (tooth) ['htoot', 5, true, true, 'teeth'], - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) + // albums (album) + ['mubla', 5, true, true, 'albums'], + + // quorums (quorum) + ['murouq', 6, true, true, ['quora', 'quorums']], + + // bacteria (bacterium), curricula (curriculum), media (medium), memoranda (memorandum), phenomena (phenomenon), strata (stratum) ['mu', 2, true, true, 'a'], // men (man), women (woman) @@ -238,17 +283,11 @@ final class EnglishInflector implements InflectorInterface // people (person) ['nosrep', 6, true, true, ['persons', 'people']], - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['noi', 3, true, true, 'ions'], - - // coupon (coupons) - ['nop', 3, true, true, 'pons'], + // criteria (criterion) + ['noiretirc', 9, true, true, 'criteria'], - // seasons (season), treasons (treason), poisons (poison), lessons (lesson) - ['nos', 3, true, true, 'sons'], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['no', 2, true, true, 'a'], + // phenomena (phenomenon) + ['nonemonehp', 10, true, true, 'phenomena'], // echoes (echo) ['ohce', 4, true, true, 'echoes'], @@ -259,6 +298,9 @@ final class EnglishInflector implements InflectorInterface // atlases (atlas) ['salta', 5, true, true, 'atlases'], + // aliases (alias) + ['saila', 5, true, true, 'aliases'], + // irises (iris) ['siri', 4, true, true, 'irises'], @@ -279,6 +321,15 @@ final class EnglishInflector implements InflectorInterface // circuses (circus) ['suc', 3, true, true, 'cuses'], + // hippocampi (hippocampus) + ['supmacoppih', 11, false, false, 'hippocampi'], + + // campuses (campus) + ['sup', 3, true, true, 'puses'], + + // status (status) + ['sutats', 6, true, true, ['status', 'statuses']], + // conspectuses (conspectus), prospectuses (prospectus) ['sutcep', 6, true, true, 'pectuses'], @@ -303,14 +354,14 @@ final class EnglishInflector implements InflectorInterface // indices (index) ['xedni', 5, false, true, ['indicies', 'indexes']], + // fax (faxes, faxxes) + ['xaf', 3, true, true, ['faxes', 'faxxes']], + // boxes (box) ['xo', 2, false, true, 'oxes'], - // indexes (index), matrixes (matrix) - ['x', 1, true, false, ['cies', 'xes']], - - // appendices (appendix) - ['xi', 2, false, true, 'ices'], + // indexes (index), matrixes (matrix), appendices (appendix) + ['x', 1, true, false, ['ces', 'xes']], // babies (baby) ['y', 1, false, true, 'ies'], @@ -334,15 +385,30 @@ final class EnglishInflector implements InflectorInterface // deer 'reed', + // equipment + 'tnempiuqe', + // feedback 'kcabdeef', // fish 'hsif', + // health + 'htlaeh', + + // history + 'yrotsih', + // info 'ofni', + // information + 'noitamrofni', + + // money + 'yenom', + // moose 'esoom', @@ -354,6 +420,15 @@ final class EnglishInflector implements InflectorInterface // species 'seiceps', + + // traffic + 'ciffart', + + // aircraft + 'tfarcria', + + // hardware + 'erawdrah', ]; public function singularize(string $plural): array @@ -387,14 +462,14 @@ public function singularize(string $plural): array if ($j === $suffixLength) { // Is there any character preceding the suffix in the plural string? if ($j < $pluralLength) { - $nextIsVocal = str_contains('aeiou', $lowerPluralRev[$j]); + $nextIsVowel = str_contains('aeiou', $lowerPluralRev[$j]); - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one + if (!$map[2] && $nextIsVowel) { + // suffix may not succeed a vowel but next char is one break; } - if (!$map[3] && !$nextIsVocal) { + if (!$map[3] && !$nextIsVowel) { // suffix may not succeed a consonant but next char is one break; } @@ -464,14 +539,14 @@ public function pluralize(string $singular): array if ($j === $suffixLength) { // Is there any character preceding the suffix in the plural string? if ($j < $singularLength) { - $nextIsVocal = str_contains('aeiou', $lowerSingularRev[$j]); + $nextIsVowel = str_contains('aeiou', $lowerSingularRev[$j]); - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one + if (!$map[2] && $nextIsVowel) { + // suffix may not succeed a vowel but next char is one break; } - if (!$map[3] && !$nextIsVocal) { + if (!$map[3] && !$nextIsVowel) { // suffix may not succeed a consonant but next char is one break; } diff --git a/tools/php-cs-fixer/vendor/symfony/string/Inflector/SpanishInflector.php b/tools/php-cs-fixer/vendor/symfony/string/Inflector/SpanishInflector.php new file mode 100644 index 00000000..4b98cb62 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/string/Inflector/SpanishInflector.php @@ -0,0 +1,126 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String\Inflector; + +final class SpanishInflector implements InflectorInterface +{ + /** + * A list of all rules for pluralise. + * + * @see https://www.spanishdict.com/guide/spanish-plural-noun-forms + * @see https://www.rae.es/gram%C3%A1tica/morfolog%C3%ADa/la-formaci%C3%B3n-del-plural-plurales-en-s-y-plurales-en-es-reglas-generales + */ + // First entry: regex + // Second entry: replacement + private const PLURALIZE_REGEXP = [ + // Specials sí, no + ['/(sí|no)$/i', '\1es'], + + // Words ending with vowel must use -s (RAE 3.2a, 3.2c) + ['/(a|e|i|o|u|á|é|í|ó|ú)$/i', '\1s'], + + // Word ending in s or x and the previous letter is accented (RAE 3.2n) + ['/ás$/i', 'ases'], + ['/és$/i', 'eses'], + ['/ís$/i', 'ises'], + ['/ós$/i', 'oses'], + ['/ús$/i', 'uses'], + + // Words ending in -ión must changed to -iones + ['/ión$/i', '\1iones'], + + // Words ending in some consonants must use -es (RAE 3.2k) + ['/(l|r|n|d|j|s|x|ch|y)$/i', '\1es'], + + // Word ending in z, must changed to ces + ['/(z)$/i', 'ces'], + ]; + + /** + * A list of all rules for singularize. + */ + private const SINGULARIZE_REGEXP = [ + // Specials sí, no + ['/(sí|no)es$/i', '\1'], + + // Words ending in -ión must changed to -iones + ['/iones$/i', '\1ión'], + + // Word ending in z, must changed to ces + ['/ces$/i', 'z'], + + // Word ending in s or x and the previous letter is accented (RAE 3.2n) + ['/(\w)ases$/i', '\1ás'], + ['/eses$/i', 'és'], + ['/ises$/i', 'ís'], + ['/(\w{2,})oses$/i', '\1ós'], + ['/(\w)uses$/i', '\1ús'], + + // Words ending in some consonants and -es, must be the consonants + ['/(l|r|n|d|j|s|x|ch|y)e?s$/i', '\1'], + + // Words ended with vowel and s, must be vowel + ['/(a|e|i|o|u|á|é|ó|í|ú)s$/i', '\1'], + ]; + + private const UNINFLECTED_RULES = [ + // Words ending with pies (RAE 3.2n) + '/.*(piés)$/i', + ]; + + private const UNINFLECTED = '/^(lunes|martes|miércoles|jueves|viernes|análisis|torax|yo|pies)$/i'; + + public function singularize(string $plural): array + { + if ($this->isInflectedWord($plural)) { + return [$plural]; + } + + foreach (self::SINGULARIZE_REGEXP as $rule) { + [$regexp, $replace] = $rule; + + if (1 === preg_match($regexp, $plural)) { + return [preg_replace($regexp, $replace, $plural)]; + } + } + + return [$plural]; + } + + public function pluralize(string $singular): array + { + if ($this->isInflectedWord($singular)) { + return [$singular]; + } + + foreach (self::PLURALIZE_REGEXP as $rule) { + [$regexp, $replace] = $rule; + + if (1 === preg_match($regexp, $singular)) { + return [preg_replace($regexp, $replace, $singular)]; + } + } + + return [$singular.'s']; + } + + private function isInflectedWord(string $word): bool + { + foreach (self::UNINFLECTED_RULES as $rule) { + if (1 === preg_match($rule, $word)) { + return true; + } + } + + return 1 === preg_match(self::UNINFLECTED, $word); + } +} diff --git a/tools/php-cs-fixer/vendor/symfony/string/LazyString.php b/tools/php-cs-fixer/vendor/symfony/string/LazyString.php index 9523b8cd..b86d7337 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/LazyString.php +++ b/tools/php-cs-fixer/vendor/symfony/string/LazyString.php @@ -26,18 +26,20 @@ class LazyString implements \Stringable, \JsonSerializable public static function fromCallable(callable|array $callback, mixed ...$arguments): static { if (\is_array($callback) && !\is_callable($callback) && !(($callback[0] ?? null) instanceof \Closure || 2 < \count($callback))) { - throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']')); + throw new \TypeError(\sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']')); } $lazyString = new static(); - $lazyString->value = static function () use (&$callback, &$arguments, &$value): string { + $lazyString->value = static function () use (&$callback, &$arguments): string { + static $value; + if (null !== $arguments) { if (!\is_callable($callback)) { $callback[0] = $callback[0](); $callback[1] ??= '__invoke'; } $value = $callback(...$arguments); - $callback = self::getPrettyName($callback); + $callback = !\is_scalar($value) && !$value instanceof \Stringable ? self::getPrettyName($callback) : 'callable'; $arguments = null; } @@ -92,7 +94,7 @@ public function __toString(): string $r = new \ReflectionFunction($this->value); $callback = $r->getStaticVariables()['callback']; - $e = new \TypeError(sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type)); + $e = new \TypeError(\sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type)); } throw $e; @@ -127,7 +129,7 @@ private static function getPrettyName(callable $callback): string } elseif ($callback instanceof \Closure) { $r = new \ReflectionFunction($callback); - if (str_contains($r->name, '{closure}') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { + if ($r->isAnonymous() || !$class = $r->getClosureCalledClass()) { return $r->name; } diff --git a/tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_wide.php b/tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_wide.php index 5a647e67..6a750942 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_wide.php +++ b/tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_wide.php @@ -3,8 +3,8 @@ /* * This file has been auto-generated by the Symfony String Component for internal use. * - * Unicode version: 15.0.0 - * Date: 2022-10-05T17:16:36+02:00 + * Unicode version: 16.0.0 + * Date: 2024-09-11T08:21:22+00:00 */ return [ @@ -44,6 +44,10 @@ 9748, 9749, ], + [ + 9776, + 9783, + ], [ 9800, 9811, @@ -52,6 +56,10 @@ 9855, 9855, ], + [ + 9866, + 9871, + ], [ 9875, 9875, @@ -166,7 +174,7 @@ ], [ 12272, - 12283, + 12287, ], [ 12288, @@ -394,7 +402,11 @@ ], [ 12736, - 12771, + 12773, + ], + [ + 12783, + 12783, ], [ 12784, @@ -448,6 +460,10 @@ 13312, 19903, ], + [ + 19904, + 19967, + ], [ 19968, 40959, @@ -832,6 +848,10 @@ 101120, 101589, ], + [ + 101631, + 101631, + ], [ 101632, 101640, @@ -876,6 +896,14 @@ 110960, 111355, ], + [ + 119552, + 119638, + ], + [ + 119648, + 119670, + ], [ 126980, 126980, @@ -1050,23 +1078,19 @@ ], [ 129664, - 129672, - ], - [ - 129680, - 129725, + 129673, ], [ - 129727, - 129733, + 129679, + 129734, ], [ 129742, - 129755, + 129756, ], [ - 129760, - 129768, + 129759, + 129769, ], [ 129776, @@ -1110,6 +1134,14 @@ ], [ 191457, + 191471, + ], + [ + 191472, + 192093, + ], + [ + 192094, 194559, ], [ diff --git a/tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_zero.php b/tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_zero.php index 9ae73303..fdd7f3c7 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_zero.php +++ b/tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_zero.php @@ -3,8 +3,8 @@ /* * This file has been auto-generated by the Symfony String Component for internal use. * - * Unicode version: 15.0.0 - * Date: 2022-10-05T17:16:37+02:00 + * Unicode version: 16.0.0 + * Date: 2024-09-11T08:21:22+00:00 */ return [ @@ -109,7 +109,7 @@ 2139, ], [ - 2200, + 2199, 2207, ], [ @@ -916,12 +916,16 @@ 68900, 68903, ], + [ + 68969, + 68973, + ], [ 69291, 69292, ], [ - 69373, + 69372, 69375, ], [ @@ -1044,6 +1048,26 @@ 70512, 70516, ], + [ + 70587, + 70592, + ], + [ + 70606, + 70606, + ], + [ + 70608, + 70608, + ], + [ + 70610, + 70610, + ], + [ + 70625, + 70626, + ], [ 70712, 70719, @@ -1122,6 +1146,10 @@ ], [ 71453, + 71453, + ], + [ + 71455, 71455, ], [ @@ -1276,6 +1304,10 @@ 73538, 73538, ], + [ + 73562, + 73562, + ], [ 78912, 78912, @@ -1284,6 +1316,14 @@ 78919, 78933, ], + [ + 90398, + 90409, + ], + [ + 90413, + 90415, + ], [ 92912, 92916, @@ -1400,6 +1440,10 @@ 124140, 124143, ], + [ + 124398, + 124399, + ], [ 125136, 125142, diff --git a/tools/php-cs-fixer/vendor/symfony/string/Slugger/AsciiSlugger.php b/tools/php-cs-fixer/vendor/symfony/string/Slugger/AsciiSlugger.php index 826d07ca..9d4edf15 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/Slugger/AsciiSlugger.php +++ b/tools/php-cs-fixer/vendor/symfony/string/Slugger/AsciiSlugger.php @@ -11,7 +11,7 @@ namespace Symfony\Component\String\Slugger; -use Symfony\Component\Intl\Transliterator\EmojiTransliterator; +use Symfony\Component\Emoji\EmojiTransliterator; use Symfony\Component\String\AbstractUnicodeString; use Symfony\Component\String\UnicodeString; use Symfony\Contracts\Translation\LocaleAwareInterface; @@ -55,7 +55,6 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface 'zh' => 'Han-Latin', ]; - private ?string $defaultLocale; private \Closure|array $symbolsMap = [ 'en' => ['@' => 'at', '&' => 'and'], ]; @@ -68,13 +67,14 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface */ private array $transliterators = []; - public function __construct(string $defaultLocale = null, array|\Closure $symbolsMap = null) - { - $this->defaultLocale = $defaultLocale; + public function __construct( + private ?string $defaultLocale = null, + array|\Closure|null $symbolsMap = null, + ) { $this->symbolsMap = $symbolsMap ?? $this->symbolsMap; } - public function setLocale(string $locale) + public function setLocale(string $locale): void { $this->defaultLocale = $locale; } @@ -92,7 +92,7 @@ public function getLocale(): string public function withEmoji(bool|string $emoji = true): static { if (false !== $emoji && !class_exists(EmojiTransliterator::class)) { - throw new \LogicException(sprintf('You cannot use the "%s()" method as the "symfony/intl" package is not installed. Try running "composer require symfony/intl".', __METHOD__)); + throw new \LogicException(\sprintf('You cannot use the "%s()" method as the "symfony/emoji" package is not installed. Try running "composer require symfony/emoji".', __METHOD__)); } $new = clone $this; @@ -101,7 +101,7 @@ public function withEmoji(bool|string $emoji = true): static return $new; } - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString + public function slug(string $string, string $separator = '-', ?string $locale = null): AbstractUnicodeString { $locale ??= $this->defaultLocale; @@ -121,9 +121,7 @@ public function slug(string $string, string $separator = '-', string $locale = n // If the symbols map is passed as a closure, there is no need to fallback to the parent locale // as the closure can just provide substitutions for all locales of interest. $symbolsMap = $this->symbolsMap; - array_unshift($transliterator, static function ($s) use ($symbolsMap, $locale) { - return $symbolsMap($s, $locale); - }); + array_unshift($transliterator, static fn ($s) => $symbolsMap($s, $locale)); } $unicodeString = (new UnicodeString($string))->ascii($transliterator); diff --git a/tools/php-cs-fixer/vendor/symfony/string/Slugger/SluggerInterface.php b/tools/php-cs-fixer/vendor/symfony/string/Slugger/SluggerInterface.php index c679ed93..dd0d5810 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/Slugger/SluggerInterface.php +++ b/tools/php-cs-fixer/vendor/symfony/string/Slugger/SluggerInterface.php @@ -23,5 +23,5 @@ interface SluggerInterface /** * Creates a slug for the given string and locale, using appropriate transliteration when needed. */ - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString; + public function slug(string $string, string $separator = '-', ?string $locale = null): AbstractUnicodeString; } diff --git a/tools/php-cs-fixer/vendor/symfony/string/TruncateMode.php b/tools/php-cs-fixer/vendor/symfony/string/TruncateMode.php new file mode 100644 index 00000000..12568cd5 --- /dev/null +++ b/tools/php-cs-fixer/vendor/symfony/string/TruncateMode.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String; + +enum TruncateMode +{ + /** + * Will cut exactly at given length. + * + * Length: 14 + * Source: Lorem ipsum dolor sit amet + * Output: Lorem ipsum do + */ + case Char; + + /** + * Returns the string up to the last complete word containing the specified length. + * + * Length: 14 + * Source: Lorem ipsum dolor sit amet + * Output: Lorem ipsum + */ + case WordBefore; + + /** + * Returns the string up to the complete word after or at the given length. + * + * Length: 14 + * Source: Lorem ipsum dolor sit amet + * Output: Lorem ipsum dolor + */ + case WordAfter; +} diff --git a/tools/php-cs-fixer/vendor/symfony/string/UnicodeString.php b/tools/php-cs-fixer/vendor/symfony/string/UnicodeString.php index a64c6a9d..b458de0c 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/UnicodeString.php +++ b/tools/php-cs-fixer/vendor/symfony/string/UnicodeString.php @@ -34,23 +34,32 @@ class UnicodeString extends AbstractUnicodeString { public function __construct(string $string = '') { - $this->string = normalizer_is_normalized($string) ? $string : normalizer_normalize($string); + if ('' === $string || normalizer_is_normalized($this->string = $string)) { + return; + } - if (false === $this->string) { + if (false === $string = normalizer_normalize($string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + + $this->string = $string; } public function append(string ...$suffix): static { $str = clone $this; $str->string = $this->string.(1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix)); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + $str->string = $string; + return $str; } @@ -176,7 +185,7 @@ public function indexOfLast(string|iterable|AbstractString $needle, int $offset return false === $i ? null : $i; } - public function join(array $strings, string $lastGlue = null): static + public function join(array $strings, ?string $lastGlue = null): static { $str = parent::join($strings, $lastGlue); normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); @@ -209,12 +218,17 @@ public function prepend(string ...$prefix): static { $str = clone $this; $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + $str->string = $string; + return $str; } @@ -235,11 +249,16 @@ public function replace(string $from, string $to): static } $str->string = $result.$tail; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + + $str->string = $string; } return $str; @@ -253,7 +272,7 @@ public function replaceMatches(string $fromRegexp, string|callable $to): static return $str; } - public function slice(int $start = 0, int $length = null): static + public function slice(int $start = 0, ?int $length = null): static { $str = clone $this; @@ -262,23 +281,28 @@ public function slice(int $start = 0, int $length = null): static return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): static + public function splice(string $replacement, int $start = 0, ?int $length = null): static { $str = clone $this; $start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0; - $length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? 2147483647)) : $length; + $length = $length ? \strlen(grapheme_substr($this->string, $start, $length)) : $length; $str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + $str->string = $string; + return $str; } - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { if (1 > $limit ??= 2147483647) { throw new InvalidArgumentException('Split limit must be a positive integer.'); @@ -338,7 +362,7 @@ public function startsWith(string|iterable|AbstractString $prefix): bool return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES); } - public function __wakeup() + public function __wakeup(): void { if (!\is_string($this->string)) { throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); diff --git a/tools/php-cs-fixer/vendor/symfony/string/composer.json b/tools/php-cs-fixer/vendor/symfony/string/composer.json index 44a809d5..10d0ee62 100644 --- a/tools/php-cs-fixer/vendor/symfony/string/composer.json +++ b/tools/php-cs-fixer/vendor/symfony/string/composer.json @@ -16,21 +16,22 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/error-handler": "^6.4|^7.0", + "symfony/emoji": "^7.1", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "autoload": { "psr-4": { "Symfony\\Component\\String\\": "" }, From 654ec801263297559147b98a29f6e3126ca7b71b Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 13:17:26 +0100 Subject: [PATCH 14/52] refactor: install php-cs-fixer as a normal package --- .githooks/pre-commit | 7 +- .github/workflows/lint.yml | 2 +- .php-cs-fixer.php => .php-cs-fixer.dist.php | 1 + composer.json | 1 + composer.lock | 1210 +++- symfony.lock | 12 + tools/php-cs-fixer/composer.json | 5 - tools/php-cs-fixer/composer.lock | 2546 -------- tools/php-cs-fixer/vendor/autoload.php | 25 - tools/php-cs-fixer/vendor/bin/php-cs-fixer | 119 - .../php-cs-fixer/vendor/bin/php-cs-fixer.bat | 5 - .../clue/ndjson-react/.github/FUNDING.yml | 2 - .../vendor/clue/ndjson-react/CHANGELOG.md | 75 - .../vendor/clue/ndjson-react/LICENSE | 21 - .../vendor/clue/ndjson-react/README.md | 365 -- .../vendor/clue/ndjson-react/composer.json | 31 - .../vendor/clue/ndjson-react/src/Decoder.php | 166 - .../vendor/clue/ndjson-react/src/Encoder.php | 144 - .../vendor/composer/ClassLoader.php | 579 -- .../vendor/composer/InstalledVersions.php | 359 - tools/php-cs-fixer/vendor/composer/LICENSE | 19 - .../vendor/composer/autoload_classmap.php | 34 - .../vendor/composer/autoload_files.php | 18 - .../vendor/composer/autoload_namespaces.php | 9 - .../vendor/composer/autoload_psr4.php | 42 - .../vendor/composer/autoload_real.php | 50 - .../vendor/composer/autoload_static.php | 247 - .../vendor/composer/installed.json | 2638 -------- .../vendor/composer/installed.php | 356 - .../php-cs-fixer/vendor/composer/pcre/LICENSE | 19 - .../vendor/composer/pcre/README.md | 189 - .../vendor/composer/pcre/composer.json | 54 - .../vendor/composer/pcre/extension.neon | 22 - .../composer/pcre/src/MatchAllResult.php | 46 - .../pcre/src/MatchAllStrictGroupsResult.php | 46 - .../pcre/src/MatchAllWithOffsetsResult.php | 48 - .../vendor/composer/pcre/src/MatchResult.php | 39 - .../pcre/src/MatchStrictGroupsResult.php | 39 - .../pcre/src/MatchWithOffsetsResult.php | 41 - .../src/PHPStan/InvalidRegexPatternRule.php | 142 - .../pcre/src/PHPStan/PregMatchFlags.php | 70 - .../PregMatchParameterOutTypeExtension.php | 65 - .../PregMatchTypeSpecifyingExtension.php | 119 - ...regReplaceCallbackClosureTypeExtension.php | 91 - .../PHPStan/UnsafeStrictGroupsCallRule.php | 112 - .../composer/pcre/src/PcreException.php | 55 - .../vendor/composer/pcre/src/Preg.php | 430 -- .../vendor/composer/pcre/src/Regex.php | 176 - .../composer/pcre/src/ReplaceResult.php | 43 - .../pcre/src/UnexpectedNullMatchException.php | 20 - .../vendor/composer/platform_check.php | 26 - .../vendor/composer/semver/CHANGELOG.md | 229 - .../vendor/composer/semver/LICENSE | 19 - .../vendor/composer/semver/README.md | 99 - .../vendor/composer/semver/composer.json | 59 - .../vendor/composer/semver/src/Comparator.php | 113 - .../composer/semver/src/CompilingMatcher.php | 94 - .../composer/semver/src/Constraint/Bound.php | 122 - .../semver/src/Constraint/Constraint.php | 435 -- .../src/Constraint/ConstraintInterface.php | 75 - .../src/Constraint/MatchAllConstraint.php | 85 - .../src/Constraint/MatchNoneConstraint.php | 83 - .../semver/src/Constraint/MultiConstraint.php | 325 - .../vendor/composer/semver/src/Interval.php | 98 - .../vendor/composer/semver/src/Intervals.php | 478 -- .../vendor/composer/semver/src/Semver.php | 129 - .../composer/semver/src/VersionParser.php | 591 -- .../composer/xdebug-handler/CHANGELOG.md | 143 - .../vendor/composer/xdebug-handler/LICENSE | 21 - .../vendor/composer/xdebug-handler/README.md | 305 - .../composer/xdebug-handler/composer.json | 44 - .../composer/xdebug-handler/src/PhpConfig.php | 91 - .../composer/xdebug-handler/src/Process.php | 119 - .../composer/xdebug-handler/src/Status.php | 222 - .../xdebug-handler/src/XdebugHandler.php | 722 -- .../vendor/evenement/evenement/.gitattributes | 7 - .../vendor/evenement/evenement/LICENSE | 19 - .../vendor/evenement/evenement/README.md | 64 - .../vendor/evenement/evenement/composer.json | 29 - .../evenement/evenement/src/EventEmitter.php | 17 - .../evenement/src/EventEmitterInterface.php | 22 - .../evenement/src/EventEmitterTrait.php | 154 - .../vendor/fidry/cpu-core-counter/.envrc | 5 - .../vendor/fidry/cpu-core-counter/LICENSE.md | 16 - .../vendor/fidry/cpu-core-counter/README.md | 138 - .../fidry/cpu-core-counter/bin/diagnose.php | 27 - .../fidry/cpu-core-counter/bin/execute.php | 21 - .../fidry/cpu-core-counter/bin/trace.php | 32 - .../fidry/cpu-core-counter/composer.json | 48 - .../cpu-core-counter/src/CpuCoreCounter.php | 268 - .../fidry/cpu-core-counter/src/Diagnoser.php | 101 - .../src/Executor/ProcOpenExecutor.php | 56 - .../src/Executor/ProcessExecutor.php | 22 - .../src/Finder/CmiCmdletLogicalFinder.php | 46 - .../src/Finder/CmiCmdletPhysicalFinder.php | 47 - .../src/Finder/CpuCoreFinder.php | 37 - .../src/Finder/CpuInfoFinder.php | 100 - .../src/Finder/DummyCpuCoreFinder.php | 57 - .../src/Finder/EnvVariableFinder.php | 69 - .../src/Finder/FinderRegistry.php | 91 - .../src/Finder/HwLogicalFinder.php | 33 - .../src/Finder/HwPhysicalFinder.php | 33 - .../src/Finder/LscpuLogicalFinder.php | 52 - .../src/Finder/LscpuPhysicalFinder.php | 66 - .../src/Finder/NProcFinder.php | 59 - .../src/Finder/NProcessorFinder.php | 32 - .../src/Finder/NullCpuCoreFinder.php | 35 - .../src/Finder/OnlyInPowerShellFinder.php | 62 - .../src/Finder/OnlyOnOSFamilyFinder.php | 113 - .../src/Finder/ProcOpenBasedFinder.php | 107 - .../src/Finder/SkipOnOSFamilyFinder.php | 113 - .../Finder/WindowsRegistryLogicalFinder.php | 51 - .../src/Finder/WmicLogicalFinder.php | 47 - .../src/Finder/WmicPhysicalFinder.php | 47 - .../src/Finder/_NProcessorFinder.php | 32 - .../src/NumberOfCpuCoreNotFound.php | 26 - .../src/ParallelisationResult.php | 87 - .../friendsofphp/php-cs-fixer/CHANGELOG.md | 5816 ----------------- .../friendsofphp/php-cs-fixer/CONTRIBUTING.md | 103 - .../vendor/friendsofphp/php-cs-fixer/LICENSE | 19 - .../friendsofphp/php-cs-fixer/README.md | 88 - .../friendsofphp/php-cs-fixer/UPGRADE-v3.md | 162 - .../php-cs-fixer/ci-integration.sh | 8 - .../friendsofphp/php-cs-fixer/composer.json | 209 - .../php-cs-fixer/feature-or-bug.rst | 24 - .../vendor/friendsofphp/php-cs-fixer/logo.md | 3 - .../vendor/friendsofphp/php-cs-fixer/logo.png | Bin 18627 -> 0 bytes .../friendsofphp/php-cs-fixer/php-cs-fixer | 110 - .../src/AbstractDoctrineAnnotationFixer.php | 235 - .../php-cs-fixer/src/AbstractFixer.php | 102 - .../src/AbstractFopenFlagFixer.php | 116 - .../src/AbstractFunctionReferenceFixer.php | 71 - .../src/AbstractNoUselessElseFixer.php | 204 - .../AbstractPhpdocToTypeDeclarationFixer.php | 314 - .../src/AbstractPhpdocTypesFixer.php | 105 - .../php-cs-fixer/src/AbstractProxyFixer.php | 106 - .../php-cs-fixer/src/Cache/Cache.php | 151 - .../php-cs-fixer/src/Cache/CacheInterface.php | 35 - .../src/Cache/CacheManagerInterface.php | 29 - .../php-cs-fixer/src/Cache/Directory.php | 51 - .../src/Cache/DirectoryInterface.php | 23 - .../src/Cache/FileCacheManager.php | 143 - .../php-cs-fixer/src/Cache/FileHandler.php | 184 - .../src/Cache/FileHandlerInterface.php | 29 - .../src/Cache/NullCacheManager.php | 33 - .../php-cs-fixer/src/Cache/Signature.php | 100 - .../src/Cache/SignatureInterface.php | 38 - .../friendsofphp/php-cs-fixer/src/Config.php | 265 - .../php-cs-fixer/src/ConfigInterface.php | 162 - .../InvalidConfigurationException.php | 36 - .../InvalidFixerConfigurationException.php | 45 - ...validForEnvFixerConfigurationException.php | 22 - .../RequiredFixerConfigurationException.php | 22 - .../php-cs-fixer/src/Console/Application.php | 212 - .../src/Console/Command/CheckCommand.php | 64 - .../src/Console/Command/DescribeCommand.php | 476 -- .../Command/DescribeNameNotFoundException.php | 46 - .../Console/Command/DocumentationCommand.php | 123 - .../src/Console/Command/FixCommand.php | 393 -- .../FixCommandExitStatusCalculator.php | 56 - .../src/Console/Command/HelpCommand.php | 76 - .../src/Console/Command/ListFilesCommand.php | 91 - .../src/Console/Command/ListSetsCommand.php | 87 - .../src/Console/Command/SelfUpdateCommand.php | 176 - .../src/Console/Command/WorkerCommand.php | 243 - .../src/Console/ConfigurationResolver.php | 930 --- .../src/Console/Output/ErrorOutput.php | 155 - .../src/Console/Output/OutputContext.php | 54 - .../Console/Output/Progress/DotsOutput.php | 124 - .../Console/Output/Progress/NullOutput.php | 29 - .../Output/Progress/PercentageBarOutput.php | 78 - .../Output/Progress/ProgressOutputFactory.php | 63 - .../Progress/ProgressOutputInterface.php | 27 - .../Output/Progress/ProgressOutputType.php | 37 - .../Report/FixReport/CheckstyleReporter.php | 71 - .../Report/FixReport/GitlabReporter.php | 96 - .../Console/Report/FixReport/JsonReporter.php | 65 - .../Report/FixReport/JunitReporter.php | 145 - .../Report/FixReport/ReportSummary.php | 103 - .../Report/FixReport/ReporterFactory.php | 90 - .../Report/FixReport/ReporterInterface.php | 30 - .../Console/Report/FixReport/TextReporter.php | 104 - .../Console/Report/FixReport/XmlReporter.php | 136 - .../Report/ListSetsReport/JsonReporter.php | 52 - .../Report/ListSetsReport/ReportSummary.php | 48 - .../Report/ListSetsReport/ReporterFactory.php | 89 - .../ListSetsReport/ReporterInterface.php | 30 - .../Report/ListSetsReport/TextReporter.php | 51 - .../src/Console/SelfUpdate/GithubClient.php | 69 - .../SelfUpdate/GithubClientInterface.php | 26 - .../Console/SelfUpdate/NewVersionChecker.php | 102 - .../SelfUpdate/NewVersionCheckerInterface.php | 37 - .../src/Console/WarningsDetector.php | 76 - .../src/Differ/DiffConsoleFormatter.php | 85 - .../src/Differ/DifferInterface.php | 26 - .../php-cs-fixer/src/Differ/FullDiffer.php | 46 - .../php-cs-fixer/src/Differ/NullDiffer.php | 26 - .../php-cs-fixer/src/Differ/UnifiedDiffer.php | 47 - .../php-cs-fixer/src/DocBlock/Annotation.php | 319 - .../php-cs-fixer/src/DocBlock/DocBlock.php | 250 - .../php-cs-fixer/src/DocBlock/Line.php | 128 - .../src/DocBlock/ShortDescription.php | 65 - .../php-cs-fixer/src/DocBlock/Tag.php | 102 - .../src/DocBlock/TagComparator.php | 66 - .../src/DocBlock/TypeExpression.php | 822 --- .../src/Doctrine/Annotation/DocLexer.php | 171 - .../src/Doctrine/Annotation/Token.php | 87 - .../src/Doctrine/Annotation/Tokens.php | 303 - .../Documentation/DocumentationLocator.php | 82 - .../Documentation/FixerDocumentGenerator.php | 415 -- .../src/Documentation/RstUtils.php | 45 - .../RuleSetDocumentationGenerator.php | 174 - .../php-cs-fixer/src/Error/Error.php | 125 - .../php-cs-fixer/src/Error/ErrorsManager.php | 83 - .../src/Error/SourceExceptionFactory.php | 62 - .../src/ExecutorWithoutErrorHandler.php | 58 - .../ExecutorWithoutErrorHandlerException.php | 22 - .../php-cs-fixer/src/FileReader.php | 70 - .../php-cs-fixer/src/FileRemoval.php | 100 - .../friendsofphp/php-cs-fixer/src/Finder.php | 35 - .../Fixer/AbstractIncrementOperatorFixer.php | 58 - .../src/Fixer/AbstractPhpUnitFixer.php | 277 - .../src/Fixer/AbstractShortOperatorFixer.php | 264 - .../src/Fixer/Alias/ArrayPushFixer.php | 207 - .../Fixer/Alias/BacktickToShellExecFixer.php | 149 - .../src/Fixer/Alias/EregToPregFixer.php | 193 - .../src/Fixer/Alias/MbStrFunctionsFixer.php | 141 - .../src/Fixer/Alias/ModernizeStrposFixer.php | 338 - .../src/Fixer/Alias/NoAliasFunctionsFixer.php | 337 - .../NoAliasLanguageConstructCallFixer.php | 59 - .../src/Fixer/Alias/NoMixedEchoPrintFixer.php | 142 - .../Fixer/Alias/PowToExponentiationFixer.php | 219 - .../Fixer/Alias/RandomApiMigrationFixer.php | 153 - .../src/Fixer/Alias/SetTypeToCastFixer.php | 240 - .../Fixer/ArrayNotation/ArraySyntaxFixer.php | 138 - ...tilineWhitespaceAroundDoubleArrowFixer.php | 80 - .../NoTrailingCommaInSinglelineArrayFixer.php | 52 - .../NoWhitespaceBeforeCommaInArrayFixer.php | 153 - .../NormalizeIndexBraceFixer.php | 57 - .../ArrayNotation/ReturnToYieldFromFixer.php | 105 - .../ArrayNotation/TrimArraySpacesFixer.php | 97 - .../WhitespaceAfterCommaInArrayFixer.php | 150 - .../YieldFromArrayToYieldsFixer.php | 189 - .../AttributeEmptyParenthesesFixer.php | 136 - .../GeneralAttributeRemoveFixer.php | 142 - .../OrderedAttributesFixer.php | 271 - .../src/Fixer/Basic/BracesFixer.php | 268 - .../src/Fixer/Basic/BracesPositionFixer.php | 441 -- .../Fixer/Basic/CurlyBracesPositionFixer.php | 126 - .../src/Fixer/Basic/EncodingFixer.php | 80 - .../NoMultipleStatementsPerLineFixer.php | 111 - .../NoTrailingCommaInSinglelineFixer.php | 162 - .../Basic/NonPrintableCharacterFixer.php | 191 - .../Basic/NumericLiteralSeparatorFixer.php | 232 - .../src/Fixer/Basic/OctalNotationFixer.php | 64 - .../src/Fixer/Basic/PsrAutoloadingFixer.php | 291 - .../Fixer/Basic/SingleLineEmptyBodyFixer.php | 83 - .../Casing/ClassReferenceNameCasingFixer.php | 168 - .../src/Fixer/Casing/ConstantCaseFixer.php | 130 - .../Fixer/Casing/IntegerLiteralCaseFixer.php | 62 - .../Fixer/Casing/LowercaseKeywordsFixer.php | 67 - .../Casing/LowercaseStaticReferenceFixer.php | 107 - .../Fixer/Casing/MagicConstantCasingFixer.php | 92 - .../Fixer/Casing/MagicMethodCasingFixer.php | 202 - .../Casing/NativeFunctionCasingFixer.php | 89 - ...tiveFunctionTypeDeclarationCasingFixer.php | 58 - .../NativeTypeDeclarationCasingFixer.php | 360 - .../Fixer/CastNotation/CastSpacesFixer.php | 131 - .../Fixer/CastNotation/LowercaseCastFixer.php | 66 - .../ModernizeTypesCastingFixer.php | 164 - .../CastNotation/NoShortBoolCastFixer.php | 88 - .../Fixer/CastNotation/NoUnsetCastFixer.php | 88 - .../CastNotation/ShortScalarCastFixer.php | 71 - .../ClassAttributesSeparationFixer.php | 599 -- .../ClassNotation/ClassDefinitionFixer.php | 572 -- .../Fixer/ClassNotation/FinalClassFixer.php | 67 - .../ClassNotation/FinalInternalClassFixer.php | 374 -- ...FinalPublicMethodForAbstractClassFixer.php | 160 - .../NoBlankLinesAfterClassOpeningFixer.php | 93 - .../NoNullPropertyInitializationFixer.php | 141 - .../ClassNotation/NoPhp4ConstructorFixer.php | 408 -- .../NoUnneededFinalMethodFixer.php | 215 - .../OrderedClassElementsFixer.php | 601 -- .../ClassNotation/OrderedInterfacesFixer.php | 272 - .../ClassNotation/OrderedTraitsFixer.php | 226 - .../Fixer/ClassNotation/OrderedTypesFixer.php | 453 -- ...pdocReadonlyClassCommentToKeywordFixer.php | 129 - .../ClassNotation/ProtectedToPrivateFixer.php | 168 - .../Fixer/ClassNotation/SelfAccessorFixer.php | 200 - .../ClassNotation/SelfStaticAccessorFixer.php | 224 - .../SingleClassElementPerStatementFixer.php | 241 - .../SingleTraitInsertPerStatementFixer.php | 116 - .../ClassNotation/VisibilityRequiredFixer.php | 212 - .../ClassUsage/DateTimeImmutableFixer.php | 146 - .../Fixer/Comment/CommentToPhpdocFixer.php | 230 - .../src/Fixer/Comment/HeaderCommentFixer.php | 457 -- .../MultilineCommentOpeningClosingFixer.php | 89 - .../src/Fixer/Comment/NoEmptyCommentFixer.php | 162 - .../NoTrailingWhitespaceInCommentFixer.php | 75 - .../Comment/SingleLineCommentSpacingFixer.php | 110 - .../Comment/SingleLineCommentStyleFixer.php | 178 - .../src/Fixer/ConfigurableFixerInterface.php | 50 - .../src/Fixer/ConfigurableFixerTrait.php | 124 - .../NativeConstantInvocationFixer.php | 307 - .../ControlStructureBracesFixer.php | 256 - ...trolStructureContinuationPositionFixer.php | 157 - .../Fixer/ControlStructure/ElseifFixer.php | 98 - .../ControlStructure/EmptyLoopBodyFixer.php | 139 - .../EmptyLoopConditionFixer.php | 202 - .../Fixer/ControlStructure/IncludeFixer.php | 153 - .../NoAlternativeSyntaxFixer.php | 244 - .../ControlStructure/NoBreakCommentFixer.php | 366 -- .../NoSuperfluousElseifFixer.php | 100 - .../NoTrailingCommaInListCallFixer.php | 51 - .../NoUnneededBracesFixer.php | 182 - .../NoUnneededControlParenthesesFixer.php | 760 --- .../NoUnneededCurlyBracesFixer.php | 106 - .../ControlStructure/NoUselessElseFixer.php | 120 - .../SimplifiedIfReturnFixer.php | 138 - .../SwitchCaseSemicolonToColonFixer.php | 87 - .../ControlStructure/SwitchCaseSpaceFixer.php | 85 - .../SwitchContinueToBreakFixer.php | 240 - .../TrailingCommaInMultilineFixer.php | 270 - .../Fixer/ControlStructure/YodaStyleFixer.php | 758 --- .../src/Fixer/DeprecatedFixerInterface.php | 28 - ...DoctrineAnnotationArrayAssignmentFixer.php | 114 - .../DoctrineAnnotationBracesFixer.php | 132 - .../DoctrineAnnotationIndentationFixer.php | 199 - .../DoctrineAnnotationSpacesFixer.php | 320 - .../src/Fixer/ExperimentalFixerInterface.php | 20 - .../php-cs-fixer/src/Fixer/FixerInterface.php | 79 - .../CombineNestedDirnameFixer.php | 224 - .../DateTimeCreateFromFormatCallFixer.php | 164 - .../FunctionNotation/FopenFlagOrderFixer.php | 123 - .../FunctionNotation/FopenFlagsFixer.php | 120 - .../FunctionDeclarationFixer.php | 263 - .../FunctionTypehintSpaceFixer.php | 60 - .../FunctionNotation/ImplodeCallFixer.php | 139 - .../LambdaNotUsedImportFixer.php | 350 - .../MethodArgumentSpaceFixer.php | 509 -- .../NativeFunctionInvocationFixer.php | 420 -- .../NoSpacesAfterFunctionNameFixer.php | 176 - ...lingCommaInSinglelineFunctionCallFixer.php | 59 - ...NoUnreachableDefaultArgumentValueFixer.php | 191 - .../NoUselessSprintfFixer.php | 109 - ...ypeDeclarationForDefaultNullValueFixer.php | 247 - .../PhpdocToParamTypeFixer.php | 244 - .../PhpdocToPropertyTypeFixer.php | 296 - .../PhpdocToReturnTypeFixer.php | 249 - .../RegularCallableCallFixer.php | 256 - .../ReturnTypeDeclarationFixer.php | 132 - .../FunctionNotation/SingleLineThrowFixer.php | 159 - .../FunctionNotation/StaticLambdaFixer.php | 130 - .../UseArrowFunctionsFixer.php | 181 - .../FunctionNotation/VoidReturnFixer.php | 256 - .../Import/FullyQualifiedStrictTypesFixer.php | 987 --- .../Import/GlobalNamespaceImportFixer.php | 726 -- .../src/Fixer/Import/GroupImportFixer.php | 369 -- .../Import/NoLeadingImportSlashFixer.php | 90 - .../Import/NoUnneededImportAliasFixer.php | 88 - .../src/Fixer/Import/NoUnusedImportsFixer.php | 455 -- .../src/Fixer/Import/OrderedImportsFixer.php | 600 -- .../Import/SingleImportPerStatementFixer.php | 274 - .../Import/SingleLineAfterImportsFixer.php | 152 - .../php-cs-fixer/src/Fixer/Indentation.php | 92 - .../src/Fixer/InternalFixerInterface.php | 20 - .../LanguageConstruct/ClassKeywordFixer.php | 100 - .../ClassKeywordRemoveFixer.php | 234 - .../CombineConsecutiveIssetsFixer.php | 163 - .../CombineConsecutiveUnsetsFixer.php | 179 - .../DeclareEqualNormalizeFixer.php | 137 - .../DeclareParenthesesFixer.php | 56 - .../LanguageConstruct/DirConstantFixer.php | 129 - .../ErrorSuppressionFixer.php | 186 - .../ExplicitIndirectVariableFixer.php | 82 - .../FunctionToConstantFixer.php | 311 - .../GetClassToClassKeywordFixer.php | 158 - .../Fixer/LanguageConstruct/IsNullFixer.php | 169 - .../NoUnsetOnPropertyFixer.php | 220 - .../NullableTypeDeclarationFixer.php | 348 - .../SingleSpaceAfterConstructFixer.php | 209 - .../SingleSpaceAroundConstructFixer.php | 515 -- .../Fixer/ListNotation/ListSyntaxFixer.php | 133 - .../BlankLineAfterNamespaceFixer.php | 127 - .../BlankLinesBeforeNamespaceFixer.php | 242 - .../NamespaceNotation/CleanNamespaceFixer.php | 108 - .../NoBlankLinesBeforeNamespaceFixer.php | 76 - .../NoLeadingNamespaceWhitespaceFixer.php | 95 - .../SingleBlankLineBeforeNamespaceFixer.php | 75 - .../Fixer/Naming/NoHomoglyphNamesFixer.php | 230 - ...signNullCoalescingToCoalesceEqualFixer.php | 71 - .../Operator/BinaryOperatorSpacesFixer.php | 951 --- .../src/Fixer/Operator/ConcatSpaceFixer.php | 160 - .../Fixer/Operator/IncrementStyleFixer.php | 179 - .../Fixer/Operator/LogicalOperatorsFixer.php | 67 - .../Operator/LongToShorthandOperatorFixer.php | 140 - .../src/Fixer/Operator/NewWithBracesFixer.php | 103 - .../Operator/NewWithParenthesesFixer.php | 216 - .../NoSpaceAroundDoubleColonFixer.php | 73 - .../Operator/NoUselessConcatOperatorFixer.php | 375 -- .../NoUselessNullsafeOperatorFixer.php | 73 - .../Operator/NotOperatorWithSpaceFixer.php | 75 - .../NotOperatorWithSuccessorSpaceFixer.php | 68 - .../ObjectOperatorWithoutWhitespaceFixer.php | 62 - .../Fixer/Operator/OperatorLinebreakFixer.php | 292 - .../Operator/StandardizeIncrementFixer.php | 122 - .../Operator/StandardizeNotEqualsFixer.php | 60 - .../Operator/TernaryOperatorSpacesFixer.php | 131 - .../Operator/TernaryToElvisOperatorFixer.php | 217 - .../Operator/TernaryToNullCoalescingFixer.php | 224 - .../Operator/UnaryOperatorSpacesFixer.php | 118 - .../PhpTag/BlankLineAfterOpeningTagFixer.php | 92 - .../src/Fixer/PhpTag/EchoTagSyntaxFixer.php | 273 - .../src/Fixer/PhpTag/FullOpeningTagFixer.php | 123 - .../PhpTag/LinebreakAfterOpeningTagFixer.php | 68 - .../src/Fixer/PhpTag/NoClosingTagFixer.php | 59 - .../PhpUnit/PhpUnitAssertNewNamesFixer.php | 107 - .../Fixer/PhpUnit/PhpUnitAttributesFixer.php | 596 -- .../Fixer/PhpUnit/PhpUnitConstructFixer.php | 210 - .../PhpUnit/PhpUnitDataProviderNameFixer.php | 199 - .../PhpUnitDataProviderReturnTypeFixer.php | 120 - .../PhpUnitDataProviderStaticFixer.php | 156 - .../PhpUnit/PhpUnitDedicateAssertFixer.php | 590 -- ...PhpUnitDedicateAssertInternalTypeFixer.php | 204 - .../Fixer/PhpUnit/PhpUnitExpectationFixer.php | 289 - .../PhpUnit/PhpUnitFqcnAnnotationFixer.php | 86 - .../PhpUnit/PhpUnitInternalClassFixer.php | 117 - .../PhpUnit/PhpUnitMethodCasingFixer.php | 209 - .../src/Fixer/PhpUnit/PhpUnitMockFixer.php | 135 - .../PhpUnitMockShortWillReturnFixer.php | 123 - .../Fixer/PhpUnit/PhpUnitNamespacedFixer.php | 235 - .../PhpUnitNoExpectationAnnotationFixer.php | 278 - .../PhpUnitSetUpTearDownVisibilityFixer.php | 111 - .../Fixer/PhpUnit/PhpUnitSizeClassFixer.php | 107 - .../src/Fixer/PhpUnit/PhpUnitStrictFixer.php | 154 - .../Fixer/PhpUnit/PhpUnitTargetVersion.php | 57 - .../PhpUnit/PhpUnitTestAnnotationFixer.php | 416 -- .../PhpUnitTestCaseStaticMethodCallsFixer.php | 564 -- .../PhpUnitTestClassRequiresCoversFixer.php | 88 - .../Phpdoc/AlignMultilineCommentFixer.php | 178 - .../GeneralPhpdocAnnotationRemoveFixer.php | 177 - .../Phpdoc/GeneralPhpdocTagRenameFixer.php | 212 - .../Phpdoc/NoBlankLinesAfterPhpdocFixer.php | 110 - .../src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php | 84 - .../Phpdoc/NoSuperfluousPhpdocTagsFixer.php | 756 --- .../PhpdocAddMissingParamAnnotationFixer.php | 289 - .../src/Fixer/Phpdoc/PhpdocAlignFixer.php | 511 -- .../PhpdocAnnotationWithoutDotFixer.php | 123 - .../src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php | 92 - .../src/Fixer/Phpdoc/PhpdocIndentFixer.php | 141 - .../Phpdoc/PhpdocInlineTagNormalizerFixer.php | 121 - .../src/Fixer/Phpdoc/PhpdocLineSpanFixer.php | 173 - .../src/Fixer/Phpdoc/PhpdocListTypeFixer.php | 70 - .../src/Fixer/Phpdoc/PhpdocNoAccessFixer.php | 71 - .../Fixer/Phpdoc/PhpdocNoAliasTagFixer.php | 137 - .../Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php | 117 - .../src/Fixer/Phpdoc/PhpdocNoPackageFixer.php | 70 - .../Phpdoc/PhpdocNoUselessInheritdocFixer.php | 151 - .../Fixer/Phpdoc/PhpdocOrderByValueFixer.php | 225 - .../src/Fixer/Phpdoc/PhpdocOrderFixer.php | 223 - .../Fixer/Phpdoc/PhpdocParamOrderFixer.php | 273 - .../Phpdoc/PhpdocReturnSelfReferenceFixer.php | 234 - .../src/Fixer/Phpdoc/PhpdocScalarFixer.php | 139 - .../Fixer/Phpdoc/PhpdocSeparationFixer.php | 333 - .../PhpdocSingleLineVarSpacingFixer.php | 89 - .../src/Fixer/Phpdoc/PhpdocSummaryFixer.php | 99 - .../src/Fixer/Phpdoc/PhpdocTagCasingFixer.php | 109 - .../src/Fixer/Phpdoc/PhpdocTagTypeFixer.php | 214 - .../src/Fixer/Phpdoc/PhpdocToCommentFixer.php | 185 - ...rimConsecutiveBlankLineSeparationFixer.php | 191 - .../src/Fixer/Phpdoc/PhpdocTrimFixer.php | 115 - .../src/Fixer/Phpdoc/PhpdocTypesFixer.php | 173 - .../Fixer/Phpdoc/PhpdocTypesOrderFixer.php | 218 - .../PhpdocVarAnnotationCorrectOrderFixer.php | 81 - .../Phpdoc/PhpdocVarWithoutNameFixer.php | 150 - .../ReturnNotation/NoUselessReturnFixer.php | 103 - .../ReturnNotation/ReturnAssignmentFixer.php | 527 -- .../SimplifiedNullReturnFixer.php | 171 - ...ltilineWhitespaceBeforeSemicolonsFixer.php | 244 - .../Fixer/Semicolon/NoEmptyStatementFixer.php | 186 - ...glelineWhitespaceBeforeSemicolonsFixer.php | 66 - .../SemicolonAfterInstructionFixer.php | 64 - .../Semicolon/SpaceAfterSemicolonFixer.php | 148 - .../Fixer/Strict/DeclareStrictTypesFixer.php | 132 - .../Fixer/Strict/StrictComparisonFixer.php | 80 - .../src/Fixer/Strict/StrictParamFixer.php | 168 - .../EscapeImplicitBackslashesFixer.php | 153 - .../ExplicitStringVariableFixer.php | 166 - .../HeredocClosingMarkerFixer.php | 205 - .../StringNotation/HeredocToNowdocFixer.php | 107 - .../MultilineStringToHeredocFixer.php | 166 - .../StringNotation/NoBinaryStringFixer.php | 75 - .../NoTrailingWhitespaceInStringFixer.php | 100 - .../SimpleToComplexStringVariableFixer.php | 96 - .../Fixer/StringNotation/SingleQuoteFixer.php | 122 - .../StringImplicitBackslashesFixer.php | 194 - .../StringLengthToEmptyFixer.php | 322 - .../StringNotation/StringLineEndingFixer.php | 76 - .../Whitespace/ArrayIndentationFixer.php | 197 - .../BlankLineBeforeStatementFixer.php | 379 -- .../BlankLineBetweenImportGroupsFixer.php | 180 - .../CompactNullableTypeDeclarationFixer.php | 72 - .../CompactNullableTypehintFixer.php | 63 - .../Whitespace/HeredocIndentationFixer.php | 180 - .../Fixer/Whitespace/IndentationTypeFixer.php | 139 - .../src/Fixer/Whitespace/LineEndingFixer.php | 85 - .../MethodChainingIndentationFixer.php | 229 - .../Whitespace/NoExtraBlankLinesFixer.php | 496 -- .../Whitespace/NoSpacesAroundOffsetFixer.php | 112 - .../NoSpacesInsideParenthesisFixer.php | 75 - .../Whitespace/NoTrailingWhitespaceFixer.php | 104 - .../NoWhitespaceInBlankLineFixer.php | 89 - .../Whitespace/SingleBlankLineAtEofFixer.php | 64 - .../SpacesInsideParenthesesFixer.php | 223 - .../Whitespace/StatementIndentationFixer.php | 834 --- .../Whitespace/TypeDeclarationSpacesFixer.php | 212 - .../src/Fixer/Whitespace/TypesSpacesFixer.php | 173 - .../Fixer/WhitespacesAwareFixerInterface.php | 25 - .../FixerConfiguration/AliasedFixerOption.php | 75 - .../AliasedFixerOptionBuilder.php | 78 - .../FixerConfiguration/AllowedValueSubset.php | 65 - .../DeprecatedFixerOption.php | 74 - .../DeprecatedFixerOptionInterface.php | 20 - .../FixerConfigurationResolver.php | 152 - .../FixerConfigurationResolverInterface.php | 30 - .../src/FixerConfiguration/FixerOption.php | 146 - .../FixerConfiguration/FixerOptionBuilder.php | 126 - .../FixerOptionInterface.php | 43 - .../FixerConfiguration/FixerOptionSorter.php | 37 - .../InvalidOptionsForEnvException.php | 24 - .../src/FixerDefinition/CodeSample.php | 49 - .../FixerDefinition/CodeSampleInterface.php | 28 - .../FileSpecificCodeSample.php | 56 - .../FileSpecificCodeSampleInterface.php | 25 - .../src/FixerDefinition/FixerDefinition.php | 76 - .../FixerDefinitionInterface.php | 37 - .../VersionSpecificCodeSample.php | 54 - .../VersionSpecificCodeSampleInterface.php | 23 - .../FixerDefinition/VersionSpecification.php | 76 - .../VersionSpecificationInterface.php | 23 - .../php-cs-fixer/src/FixerFactory.php | 248 - .../php-cs-fixer/src/FixerNameValidator.php | 32 - .../Indicator/PhpUnitTestCaseIndicator.php | 90 - .../php-cs-fixer/src/Linter/CachingLinter.php | 54 - .../php-cs-fixer/src/Linter/Linter.php | 49 - .../src/Linter/LinterInterface.php | 35 - .../src/Linter/LintingException.php | 24 - .../src/Linter/LintingResultInterface.php | 26 - .../php-cs-fixer/src/Linter/ProcessLinter.php | 149 - .../Linter/ProcessLinterProcessBuilder.php | 46 - .../src/Linter/ProcessLintingResult.php | 86 - .../src/Linter/TokenizerLinter.php | 58 - .../src/Linter/TokenizerLintingResult.php | 48 - .../src/Linter/UnavailableLinterException.php | 26 - .../src/ParallelAwareConfigInterface.php | 29 - .../php-cs-fixer/src/PharChecker.php | 38 - .../php-cs-fixer/src/PharCheckerInterface.php | 26 - .../friendsofphp/php-cs-fixer/src/Preg.php | 215 - .../php-cs-fixer/src/PregException.php | 24 - .../AbstractMigrationSetDescription.php | 38 - .../RuleSet/AbstractRuleSetDescription.php | 35 - .../DeprecatedRuleSetDescriptionInterface.php | 28 - .../php-cs-fixer/src/RuleSet/RuleSet.php | 159 - .../RuleSet/RuleSetDescriptionInterface.php | 34 - .../src/RuleSet/RuleSetInterface.php | 49 - .../php-cs-fixer/src/RuleSet/RuleSets.php | 72 - .../RuleSet/Sets/DoctrineAnnotationSet.php | 42 - .../src/RuleSet/Sets/PERCS1x0RiskySet.php | 44 - .../src/RuleSet/Sets/PERCS1x0Set.php | 44 - .../src/RuleSet/Sets/PERCS2x0RiskySet.php | 44 - .../src/RuleSet/Sets/PERCS2x0Set.php | 112 - .../src/RuleSet/Sets/PERCSRiskySet.php | 40 - .../src/RuleSet/Sets/PERCSSet.php | 40 - .../src/RuleSet/Sets/PERRiskySet.php | 52 - .../php-cs-fixer/src/RuleSet/Sets/PERSet.php | 47 - .../src/RuleSet/Sets/PHP54MigrationSet.php | 30 - .../RuleSet/Sets/PHP56MigrationRiskySet.php | 30 - .../RuleSet/Sets/PHP70MigrationRiskySet.php | 39 - .../src/RuleSet/Sets/PHP70MigrationSet.php | 31 - .../RuleSet/Sets/PHP71MigrationRiskySet.php | 31 - .../src/RuleSet/Sets/PHP71MigrationSet.php | 32 - .../src/RuleSet/Sets/PHP73MigrationSet.php | 34 - .../RuleSet/Sets/PHP74MigrationRiskySet.php | 33 - .../src/RuleSet/Sets/PHP74MigrationSet.php | 33 - .../RuleSet/Sets/PHP80MigrationRiskySet.php | 40 - .../src/RuleSet/Sets/PHP80MigrationSet.php | 32 - .../src/RuleSet/Sets/PHP81MigrationSet.php | 31 - .../RuleSet/Sets/PHP82MigrationRiskySet.php | 31 - .../src/RuleSet/Sets/PHP82MigrationSet.php | 31 - .../src/RuleSet/Sets/PHP83MigrationSet.php | 30 - .../src/RuleSet/Sets/PHP84MigrationSet.php | 31 - .../Sets/PHPUnit100MigrationRiskySet.php | 31 - .../Sets/PHPUnit30MigrationRiskySet.php | 33 - .../Sets/PHPUnit32MigrationRiskySet.php | 34 - .../Sets/PHPUnit35MigrationRiskySet.php | 34 - .../Sets/PHPUnit43MigrationRiskySet.php | 34 - .../Sets/PHPUnit48MigrationRiskySet.php | 34 - .../Sets/PHPUnit50MigrationRiskySet.php | 34 - .../Sets/PHPUnit52MigrationRiskySet.php | 34 - .../Sets/PHPUnit54MigrationRiskySet.php | 34 - .../Sets/PHPUnit55MigrationRiskySet.php | 34 - .../Sets/PHPUnit56MigrationRiskySet.php | 37 - .../Sets/PHPUnit57MigrationRiskySet.php | 34 - .../Sets/PHPUnit60MigrationRiskySet.php | 34 - .../Sets/PHPUnit75MigrationRiskySet.php | 34 - .../Sets/PHPUnit84MigrationRiskySet.php | 35 - .../Sets/PHPUnit91MigrationRiskySet.php | 31 - .../src/RuleSet/Sets/PSR12RiskySet.php | 36 - .../src/RuleSet/Sets/PSR12Set.php | 123 - .../php-cs-fixer/src/RuleSet/Sets/PSR1Set.php | 36 - .../php-cs-fixer/src/RuleSet/Sets/PSR2Set.php | 104 - .../src/RuleSet/Sets/PhpCsFixerRiskySet.php | 67 - .../src/RuleSet/Sets/PhpCsFixerSet.php | 132 - .../src/RuleSet/Sets/SymfonyRiskySet.php | 78 - .../src/RuleSet/Sets/SymfonySet.php | 241 - .../src/Runner/Event/AnalysisStarted.php | 54 - .../src/Runner/Event/FileProcessed.php | 75 - .../Runner/FileCachingLintingFileIterator.php | 76 - .../src/Runner/FileFilterIterator.php | 108 - .../src/Runner/LintingFileIterator.php | 66 - ...intingResultAwareFileIteratorInterface.php | 29 - .../src/Runner/Parallel/ParallelAction.php | 35 - .../src/Runner/Parallel/ParallelConfig.php | 67 - .../Runner/Parallel/ParallelConfigFactory.php | 61 - .../Parallel/ParallelisationException.php | 30 - .../src/Runner/Parallel/Process.php | 189 - .../src/Runner/Parallel/ProcessFactory.php | 111 - .../src/Runner/Parallel/ProcessIdentifier.php | 55 - .../src/Runner/Parallel/ProcessPool.php | 99 - .../src/Runner/Parallel/WorkerException.php | 66 - .../php-cs-fixer/src/Runner/Runner.php | 589 -- .../php-cs-fixer/src/Runner/RunnerConfig.php | 64 - .../php-cs-fixer/src/StdinFileInfo.php | 173 - .../src/Tokenizer/AbstractTransformer.php | 40 - .../src/Tokenizer/AbstractTypeTransformer.php | 89 - .../Analyzer/AlternativeSyntaxAnalyzer.php | 121 - .../AbstractControlCaseStructuresAnalysis.php | 51 - .../Analyzer/Analysis/ArgumentAnalysis.php | 81 - .../Analyzer/Analysis/AttributeAnalysis.php | 76 - .../Analyzer/Analysis/CaseAnalysis.php | 45 - .../Analysis/DataProviderAnalysis.php | 68 - .../Analyzer/Analysis/DefaultAnalysis.php | 43 - .../Analyzer/Analysis/EnumAnalysis.php | 46 - .../Analyzer/Analysis/MatchAnalysis.php | 37 - .../Analyzer/Analysis/NamespaceAnalysis.php | 98 - .../Analysis/NamespaceUseAnalysis.php | 189 - .../Analysis/StartEndTokenAwareAnalysis.php | 33 - .../Analyzer/Analysis/SwitchAnalysis.php | 54 - .../Analyzer/Analysis/TypeAnalysis.php | 116 - .../Tokenizer/Analyzer/ArgumentsAnalyzer.php | 161 - .../Tokenizer/Analyzer/AttributeAnalyzer.php | 211 - .../src/Tokenizer/Analyzer/BlocksAnalyzer.php | 59 - .../src/Tokenizer/Analyzer/ClassyAnalyzer.php | 87 - .../Tokenizer/Analyzer/CommentsAnalyzer.php | 350 - .../ControlCaseStructuresAnalyzer.php | 309 - .../Analyzer/DataProviderAnalyzer.php | 115 - .../Tokenizer/Analyzer/FunctionsAnalyzer.php | 273 - .../Tokenizer/Analyzer/GotoLabelAnalyzer.php | 40 - .../Analyzer/NamespaceUsesAnalyzer.php | 216 - .../Tokenizer/Analyzer/NamespacesAnalyzer.php | 116 - .../src/Tokenizer/Analyzer/RangeAnalyzer.php | 90 - .../Tokenizer/Analyzer/ReferenceAnalyzer.php | 49 - .../src/Tokenizer/Analyzer/SwitchAnalyzer.php | 69 - .../Analyzer/WhitespacesAnalyzer.php | 52 - .../php-cs-fixer/src/Tokenizer/CT.php | 112 - .../php-cs-fixer/src/Tokenizer/CodeHasher.php | 38 - .../Tokenizer/Processor/ImportProcessor.php | 103 - .../php-cs-fixer/src/Tokenizer/Token.php | 541 -- .../php-cs-fixer/src/Tokenizer/Tokens.php | 1504 ----- .../src/Tokenizer/TokensAnalyzer.php | 888 --- .../Transformer/ArrayTypehintTransformer.php | 54 - .../Transformer/AttributeTransformer.php | 67 - .../BraceClassInstantiationTransformer.php | 80 - .../Transformer/BraceTransformer.php | 349 - .../Transformer/ClassConstantTransformer.php | 57 - .../ConstructorPromotionTransformer.php | 71 - ...veNormalFormTypeParenthesisTransformer.php | 65 - .../FirstClassCallableTransformer.php | 49 - .../Transformer/ImportTransformer.php | 72 - .../Transformer/NameQualifiedTransformer.php | 67 - .../Transformer/NamedArgumentTransformer.php | 73 - .../NamespaceOperatorTransformer.php | 53 - .../Transformer/NullableTypeTransformer.php | 83 - .../Transformer/ReturnRefTransformer.php | 47 - .../Transformer/SquareBraceTransformer.php | 187 - .../TypeAlternationTransformer.php | 57 - .../Transformer/TypeColonTransformer.php | 83 - .../TypeIntersectionTransformer.php | 55 - .../Tokenizer/Transformer/UseTransformer.php | 102 - .../WhitespacyCommentTransformer.php | 64 - .../src/Tokenizer/TransformerInterface.php | 68 - .../src/Tokenizer/Transformers.php | 109 - .../php-cs-fixer/src/ToolInfo.php | 119 - .../php-cs-fixer/src/ToolInfoInterface.php | 38 - .../friendsofphp/php-cs-fixer/src/Utils.php | 250 - .../src/WhitespacesFixerConfig.php | 63 - .../php-cs-fixer/src/WordMatcher.php | 55 - .../vendor/psr/container/.gitignore | 3 - .../php-cs-fixer/vendor/psr/container/LICENSE | 21 - .../vendor/psr/container/README.md | 13 - .../vendor/psr/container/composer.json | 27 - .../src/ContainerExceptionInterface.php | 12 - .../psr/container/src/ContainerInterface.php | 36 - .../src/NotFoundExceptionInterface.php | 10 - .../vendor/psr/event-dispatcher/.editorconfig | 15 - .../vendor/psr/event-dispatcher/.gitignore | 2 - .../vendor/psr/event-dispatcher/LICENSE | 21 - .../vendor/psr/event-dispatcher/README.md | 6 - .../vendor/psr/event-dispatcher/composer.json | 26 - .../src/EventDispatcherInterface.php | 21 - .../src/ListenerProviderInterface.php | 19 - .../src/StoppableEventInterface.php | 26 - tools/php-cs-fixer/vendor/psr/log/LICENSE | 19 - tools/php-cs-fixer/vendor/psr/log/README.md | 58 - .../php-cs-fixer/vendor/psr/log/composer.json | 26 - .../vendor/psr/log/src/AbstractLogger.php | 15 - .../psr/log/src/InvalidArgumentException.php | 7 - .../vendor/psr/log/src/LogLevel.php | 18 - .../psr/log/src/LoggerAwareInterface.php | 14 - .../vendor/psr/log/src/LoggerAwareTrait.php | 22 - .../vendor/psr/log/src/LoggerInterface.php | 98 - .../vendor/psr/log/src/LoggerTrait.php | 98 - .../vendor/psr/log/src/NullLogger.php | 26 - .../vendor/react/cache/CHANGELOG.md | 96 - tools/php-cs-fixer/vendor/react/cache/LICENSE | 21 - .../php-cs-fixer/vendor/react/cache/README.md | 367 -- .../vendor/react/cache/composer.json | 45 - .../vendor/react/cache/src/ArrayCache.php | 181 - .../vendor/react/cache/src/CacheInterface.php | 194 - .../vendor/react/child-process/CHANGELOG.md | 176 - .../vendor/react/child-process/LICENSE | 21 - .../vendor/react/child-process/README.md | 619 -- .../vendor/react/child-process/composer.json | 49 - .../react/child-process/src/Process.php | 585 -- .../vendor/react/dns/CHANGELOG.md | 452 -- tools/php-cs-fixer/vendor/react/dns/LICENSE | 21 - tools/php-cs-fixer/vendor/react/dns/README.md | 453 -- .../vendor/react/dns/composer.json | 49 - .../react/dns/src/BadServerException.php | 7 - .../vendor/react/dns/src/Config/Config.php | 137 - .../vendor/react/dns/src/Config/HostsFile.php | 153 - .../vendor/react/dns/src/Model/Message.php | 230 - .../vendor/react/dns/src/Model/Record.php | 153 - .../react/dns/src/Protocol/BinaryDumper.php | 199 - .../vendor/react/dns/src/Protocol/Parser.php | 356 - .../react/dns/src/Query/CachingExecutor.php | 88 - .../dns/src/Query/CancellationException.php | 7 - .../react/dns/src/Query/CoopExecutor.php | 91 - .../react/dns/src/Query/ExecutorInterface.php | 43 - .../react/dns/src/Query/FallbackExecutor.php | 49 - .../react/dns/src/Query/HostsFileExecutor.php | 89 - .../vendor/react/dns/src/Query/Query.php | 69 - .../react/dns/src/Query/RetryExecutor.php | 85 - .../src/Query/SelectiveTransportExecutor.php | 85 - .../dns/src/Query/TcpTransportExecutor.php | 382 -- .../react/dns/src/Query/TimeoutException.php | 7 - .../react/dns/src/Query/TimeoutExecutor.php | 78 - .../dns/src/Query/UdpTransportExecutor.php | 221 - .../react/dns/src/RecordNotFoundException.php | 7 - .../vendor/react/dns/src/Resolver/Factory.php | 226 - .../react/dns/src/Resolver/Resolver.php | 147 - .../dns/src/Resolver/ResolverInterface.php | 94 - .../vendor/react/event-loop/CHANGELOG.md | 468 -- .../vendor/react/event-loop/LICENSE | 21 - .../vendor/react/event-loop/README.md | 930 --- .../vendor/react/event-loop/composer.json | 47 - .../vendor/react/event-loop/src/ExtEvLoop.php | 253 - .../react/event-loop/src/ExtEventLoop.php | 275 - .../react/event-loop/src/ExtLibevLoop.php | 201 - .../react/event-loop/src/ExtLibeventLoop.php | 285 - .../vendor/react/event-loop/src/ExtUvLoop.php | 342 - .../vendor/react/event-loop/src/Factory.php | 75 - .../vendor/react/event-loop/src/Loop.php | 266 - .../react/event-loop/src/LoopInterface.php | 472 -- .../react/event-loop/src/SignalsHandler.php | 63 - .../react/event-loop/src/StreamSelectLoop.php | 330 - .../event-loop/src/Tick/FutureTickQueue.php | 60 - .../react/event-loop/src/Timer/Timer.php | 55 - .../react/event-loop/src/Timer/Timers.php | 113 - .../react/event-loop/src/TimerInterface.php | 27 - .../vendor/react/promise/CHANGELOG.md | 156 - .../php-cs-fixer/vendor/react/promise/LICENSE | 24 - .../vendor/react/promise/README.md | 722 -- .../vendor/react/promise/composer.json | 57 - .../vendor/react/promise/src/Deferred.php | 52 - .../src/Exception/CompositeException.php | 32 - .../promise/src/Exception/LengthException.php | 7 - .../src/Internal/CancellationQueue.php | 64 - .../promise/src/Internal/FulfilledPromise.php | 89 - .../promise/src/Internal/RejectedPromise.php | 128 - .../vendor/react/promise/src/Promise.php | 303 - .../react/promise/src/PromiseInterface.php | 152 - .../vendor/react/promise/src/functions.php | 345 - .../react/promise/src/functions_include.php | 5 - .../vendor/react/socket/CHANGELOG.md | 785 --- .../php-cs-fixer/vendor/react/socket/LICENSE | 21 - .../vendor/react/socket/README.md | 1564 ----- .../vendor/react/socket/composer.json | 52 - .../vendor/react/socket/src/Connection.php | 183 - .../react/socket/src/ConnectionInterface.php | 119 - .../vendor/react/socket/src/Connector.php | 236 - .../react/socket/src/ConnectorInterface.php | 59 - .../vendor/react/socket/src/DnsConnector.php | 117 - .../vendor/react/socket/src/FdServer.php | 222 - .../react/socket/src/FixedUriConnector.php | 41 - .../src/HappyEyeBallsConnectionBuilder.php | 334 - .../socket/src/HappyEyeBallsConnector.php | 80 - .../react/socket/src/LimitingServer.php | 203 - .../react/socket/src/SecureConnector.php | 132 - .../vendor/react/socket/src/SecureServer.php | 210 - .../vendor/react/socket/src/Server.php | 118 - .../react/socket/src/ServerInterface.php | 151 - .../vendor/react/socket/src/SocketServer.php | 215 - .../react/socket/src/StreamEncryption.php | 158 - .../vendor/react/socket/src/TcpConnector.php | 173 - .../vendor/react/socket/src/TcpServer.php | 262 - .../react/socket/src/TimeoutConnector.php | 79 - .../vendor/react/socket/src/UnixConnector.php | 58 - .../vendor/react/socket/src/UnixServer.php | 162 - .../vendor/react/stream/CHANGELOG.md | 460 -- .../php-cs-fixer/vendor/react/stream/LICENSE | 21 - .../vendor/react/stream/README.md | 1249 ---- .../vendor/react/stream/composer.json | 47 - .../react/stream/src/CompositeStream.php | 83 - .../react/stream/src/DuplexResourceStream.php | 240 - .../stream/src/DuplexStreamInterface.php | 39 - .../stream/src/ReadableResourceStream.php | 188 - .../stream/src/ReadableStreamInterface.php | 362 - .../vendor/react/stream/src/ThroughStream.php | 195 - .../vendor/react/stream/src/Util.php | 75 - .../stream/src/WritableResourceStream.php | 178 - .../stream/src/WritableStreamInterface.php | 347 - .../vendor/sebastian/diff/ChangeLog.md | 172 - .../vendor/sebastian/diff/LICENSE | 29 - .../vendor/sebastian/diff/README.md | 205 - .../vendor/sebastian/diff/SECURITY.md | 30 - .../vendor/sebastian/diff/composer.json | 51 - .../vendor/sebastian/diff/src/Chunk.php | 89 - .../vendor/sebastian/diff/src/Diff.php | 84 - .../vendor/sebastian/diff/src/Differ.php | 247 - .../src/Exception/ConfigurationException.php | 32 - .../diff/src/Exception/Exception.php | 16 - .../Exception/InvalidArgumentException.php | 14 - .../vendor/sebastian/diff/src/Line.php | 50 - .../LongestCommonSubsequenceCalculator.php | 18 - ...ientLongestCommonSubsequenceCalculator.php | 97 - .../src/Output/AbstractChunkOutputBuilder.php | 52 - .../diff/src/Output/DiffOnlyOutputBuilder.php | 70 - .../src/Output/DiffOutputBuilderInterface.php | 19 - .../Output/StrictUnifiedDiffOutputBuilder.php | 326 - .../src/Output/UnifiedDiffOutputBuilder.php | 257 - .../vendor/sebastian/diff/src/Parser.php | 112 - ...ientLongestCommonSubsequenceCalculator.php | 82 - .../vendor/symfony/console/Application.php | 1330 ---- .../symfony/console/Attribute/AsCommand.php | 45 - .../vendor/symfony/console/CHANGELOG.md | 284 - .../console/CI/GithubActionReporter.php | 97 - .../vendor/symfony/console/Color.php | 133 - .../symfony/console/Command/Command.php | 664 -- .../console/Command/CompleteCommand.php | 212 - .../console/Command/DumpCompletionCommand.php | 151 - .../symfony/console/Command/HelpCommand.php | 76 - .../symfony/console/Command/LazyCommand.php | 206 - .../symfony/console/Command/ListCommand.php | 72 - .../symfony/console/Command/LockableTrait.php | 74 - .../Command/SignalableCommandInterface.php | 32 - .../console/Command/TraceableCommand.php | 356 - .../CommandLoader/CommandLoaderInterface.php | 38 - .../CommandLoader/ContainerCommandLoader.php | 52 - .../CommandLoader/FactoryCommandLoader.php | 52 - .../console/Completion/CompletionInput.php | 248 - .../Completion/CompletionSuggestions.php | 97 - .../Output/BashCompletionOutput.php | 33 - .../Output/CompletionOutputInterface.php | 25 - .../Output/FishCompletionOutput.php | 36 - .../Completion/Output/ZshCompletionOutput.php | 36 - .../symfony/console/Completion/Suggestion.php | 41 - .../vendor/symfony/console/ConsoleEvents.php | 72 - .../vendor/symfony/console/Cursor.php | 204 - .../DataCollector/CommandDataCollector.php | 234 - .../symfony/console/Debug/CliRequest.php | 70 - .../AddConsoleCommandPass.php | 131 - .../Descriptor/ApplicationDescription.php | 136 - .../symfony/console/Descriptor/Descriptor.php | 74 - .../Descriptor/DescriptorInterface.php | 24 - .../console/Descriptor/JsonDescriptor.php | 166 - .../console/Descriptor/MarkdownDescriptor.php | 173 - .../Descriptor/ReStructuredTextDescriptor.php | 273 - .../console/Descriptor/TextDescriptor.php | 317 - .../console/Descriptor/XmlDescriptor.php | 230 - .../console/Event/ConsoleAlarmEvent.php | 47 - .../console/Event/ConsoleCommandEvent.php | 54 - .../console/Event/ConsoleErrorEvent.php | 58 - .../symfony/console/Event/ConsoleEvent.php | 56 - .../console/Event/ConsoleSignalEvent.php | 56 - .../console/Event/ConsoleTerminateEvent.php | 50 - .../console/EventListener/ErrorListener.php | 89 - .../Exception/CommandNotFoundException.php | 43 - .../console/Exception/ExceptionInterface.php | 21 - .../Exception/InvalidArgumentException.php | 19 - .../Exception/InvalidOptionException.php | 21 - .../console/Exception/LogicException.php | 19 - .../Exception/MissingInputException.php | 21 - .../Exception/NamespaceNotFoundException.php | 21 - .../Exception/RunCommandFailedException.php | 29 - .../console/Exception/RuntimeException.php | 19 - .../console/Formatter/NullOutputFormatter.php | 51 - .../Formatter/NullOutputFormatterStyle.php | 48 - .../console/Formatter/OutputFormatter.php | 267 - .../Formatter/OutputFormatterInterface.php | 52 - .../Formatter/OutputFormatterStyle.php | 89 - .../OutputFormatterStyleInterface.php | 50 - .../Formatter/OutputFormatterStyleStack.php | 103 - .../WrappableOutputFormatterInterface.php | 25 - .../console/Helper/DebugFormatterHelper.php | 98 - .../console/Helper/DescriptorHelper.php | 91 - .../vendor/symfony/console/Helper/Dumper.php | 53 - .../console/Helper/FormatterHelper.php | 81 - .../vendor/symfony/console/Helper/Helper.php | 159 - .../console/Helper/HelperInterface.php | 35 - .../symfony/console/Helper/HelperSet.php | 74 - .../console/Helper/InputAwareHelper.php | 30 - .../symfony/console/Helper/OutputWrapper.php | 76 - .../symfony/console/Helper/ProcessHelper.php | 137 - .../symfony/console/Helper/ProgressBar.php | 645 -- .../console/Helper/ProgressIndicator.php | 242 - .../symfony/console/Helper/QuestionHelper.php | 589 -- .../console/Helper/SymfonyQuestionHelper.php | 103 - .../vendor/symfony/console/Helper/Table.php | 924 --- .../symfony/console/Helper/TableCell.php | 71 - .../symfony/console/Helper/TableCellStyle.php | 84 - .../symfony/console/Helper/TableRows.php | 28 - .../symfony/console/Helper/TableSeparator.php | 25 - .../symfony/console/Helper/TableStyle.php | 362 - .../symfony/console/Input/ArgvInput.php | 402 -- .../symfony/console/Input/ArrayInput.php | 191 - .../vendor/symfony/console/Input/Input.php | 174 - .../symfony/console/Input/InputArgument.php | 160 - .../console/Input/InputAwareInterface.php | 26 - .../symfony/console/Input/InputDefinition.php | 402 -- .../symfony/console/Input/InputInterface.php | 138 - .../symfony/console/Input/InputOption.php | 262 - .../Input/StreamableInputInterface.php | 37 - .../symfony/console/Input/StringInput.php | 85 - .../vendor/symfony/console/LICENSE | 19 - .../symfony/console/Logger/ConsoleLogger.php | 120 - .../console/Messenger/RunCommandContext.php | 25 - .../console/Messenger/RunCommandMessage.php | 36 - .../Messenger/RunCommandMessageHandler.php | 49 - .../symfony/console/Output/AnsiColorMode.php | 106 - .../symfony/console/Output/BufferedOutput.php | 40 - .../symfony/console/Output/ConsoleOutput.php | 153 - .../console/Output/ConsoleOutputInterface.php | 30 - .../console/Output/ConsoleSectionOutput.php | 237 - .../symfony/console/Output/NullOutput.php | 94 - .../vendor/symfony/console/Output/Output.php | 144 - .../console/Output/OutputInterface.php | 103 - .../symfony/console/Output/StreamOutput.php | 127 - .../console/Output/TrimmedBufferOutput.php | 58 - .../console/Question/ChoiceQuestion.php | 178 - .../console/Question/ConfirmationQuestion.php | 57 - .../symfony/console/Question/Question.php | 280 - .../vendor/symfony/console/README.md | 27 - .../console/Resources/bin/hiddeninput.exe | Bin 9216 -> 0 bytes .../symfony/console/Resources/completion.bash | 94 - .../symfony/console/Resources/completion.fish | 25 - .../symfony/console/Resources/completion.zsh | 82 - .../console/SignalRegistry/SignalMap.php | 36 - .../console/SignalRegistry/SignalRegistry.php | 65 - .../console/SingleCommandApplication.php | 72 - .../symfony/console/Style/OutputStyle.php | 115 - .../symfony/console/Style/StyleInterface.php | 110 - .../symfony/console/Style/SymfonyStyle.php | 455 -- .../vendor/symfony/console/Terminal.php | 227 - .../console/Tester/ApplicationTester.php | 83 - .../Tester/CommandCompletionTester.php | 54 - .../symfony/console/Tester/CommandTester.php | 74 - .../Tester/Constraint/CommandIsSuccessful.php | 43 - .../symfony/console/Tester/TesterTrait.php | 178 - .../vendor/symfony/console/composer.json | 54 - .../deprecation-contracts/CHANGELOG.md | 5 - .../symfony/deprecation-contracts/LICENSE | 19 - .../symfony/deprecation-contracts/README.md | 26 - .../deprecation-contracts/composer.json | 35 - .../deprecation-contracts/function.php | 27 - .../event-dispatcher-contracts/CHANGELOG.md | 5 - .../event-dispatcher-contracts/Event.php | 51 - .../EventDispatcherInterface.php | 33 - .../event-dispatcher-contracts/LICENSE | 19 - .../event-dispatcher-contracts/README.md | 9 - .../event-dispatcher-contracts/composer.json | 35 - .../Attribute/AsEventListener.php | 35 - .../symfony/event-dispatcher/CHANGELOG.md | 96 - .../Debug/TraceableEventDispatcher.php | 351 - .../Debug/WrappedListener.php | 143 - .../AddEventAliasesPass.php | 38 - .../RegisterListenersPass.php | 213 - .../event-dispatcher/EventDispatcher.php | 256 - .../EventDispatcherInterface.php | 66 - .../EventSubscriberInterface.php | 49 - .../symfony/event-dispatcher/GenericEvent.php | 155 - .../ImmutableEventDispatcher.php | 65 - .../vendor/symfony/event-dispatcher/LICENSE | 19 - .../vendor/symfony/event-dispatcher/README.md | 15 - .../symfony/event-dispatcher/composer.json | 47 - .../vendor/symfony/filesystem/CHANGELOG.md | 92 - .../Exception/ExceptionInterface.php | 21 - .../Exception/FileNotFoundException.php | 34 - .../filesystem/Exception/IOException.php | 36 - .../Exception/IOExceptionInterface.php | 25 - .../Exception/InvalidArgumentException.php | 19 - .../filesystem/Exception/RuntimeException.php | 19 - .../vendor/symfony/filesystem/Filesystem.php | 773 --- .../vendor/symfony/filesystem/LICENSE | 19 - .../vendor/symfony/filesystem/Path.php | 816 --- .../vendor/symfony/filesystem/README.md | 13 - .../vendor/symfony/filesystem/composer.json | 33 - .../vendor/symfony/finder/CHANGELOG.md | 103 - .../symfony/finder/Comparator/Comparator.php | 62 - .../finder/Comparator/DateComparator.php | 50 - .../finder/Comparator/NumberComparator.php | 78 - .../Exception/AccessDeniedException.php | 19 - .../Exception/DirectoryNotFoundException.php | 19 - .../vendor/symfony/finder/Finder.php | 852 --- .../vendor/symfony/finder/Gitignore.php | 91 - .../vendor/symfony/finder/Glob.php | 109 - .../finder/Iterator/CustomFilterIterator.php | 61 - .../Iterator/DateRangeFilterIterator.php | 58 - .../Iterator/DepthRangeFilterIterator.php | 48 - .../ExcludeDirectoryFilterIterator.php | 110 - .../Iterator/FileTypeFilterIterator.php | 51 - .../Iterator/FilecontentFilterIterator.php | 58 - .../Iterator/FilenameFilterIterator.php | 45 - .../symfony/finder/Iterator/LazyIterator.php | 32 - .../Iterator/MultiplePcreFilterIterator.php | 107 - .../finder/Iterator/PathFilterIterator.php | 56 - .../Iterator/RecursiveDirectoryIterator.php | 134 - .../Iterator/SizeRangeFilterIterator.php | 57 - .../finder/Iterator/SortableIterator.php | 103 - .../Iterator/VcsIgnoredFilterIterator.php | 173 - .../vendor/symfony/finder/LICENSE | 19 - .../vendor/symfony/finder/README.md | 14 - .../vendor/symfony/finder/SplFileInfo.php | 80 - .../vendor/symfony/finder/composer.json | 31 - .../symfony/options-resolver/CHANGELOG.md | 96 - .../Debug/OptionsResolverIntrospector.php | 104 - .../Exception/AccessException.php | 22 - .../Exception/ExceptionInterface.php | 21 - .../Exception/InvalidArgumentException.php | 21 - .../Exception/InvalidOptionsException.php | 23 - .../Exception/MissingOptionsException.php | 23 - .../Exception/NoConfigurationException.php | 26 - .../Exception/NoSuchOptionException.php | 26 - .../Exception/OptionDefinitionException.php | 21 - .../Exception/UndefinedOptionsException.php | 24 - .../vendor/symfony/options-resolver/LICENSE | 19 - .../options-resolver/OptionConfigurator.php | 146 - .../symfony/options-resolver/Options.php | 22 - .../options-resolver/OptionsResolver.php | 1317 ---- .../vendor/symfony/options-resolver/README.md | 15 - .../symfony/options-resolver/composer.json | 29 - .../vendor/symfony/polyfill-ctype/Ctype.php | 232 - .../vendor/symfony/polyfill-ctype/LICENSE | 19 - .../vendor/symfony/polyfill-ctype/README.md | 12 - .../symfony/polyfill-ctype/bootstrap.php | 50 - .../symfony/polyfill-ctype/bootstrap80.php | 46 - .../symfony/polyfill-ctype/composer.json | 38 - .../polyfill-intl-grapheme/Grapheme.php | 247 - .../symfony/polyfill-intl-grapheme/LICENSE | 19 - .../symfony/polyfill-intl-grapheme/README.md | 31 - .../polyfill-intl-grapheme/bootstrap.php | 58 - .../polyfill-intl-grapheme/bootstrap80.php | 50 - .../polyfill-intl-grapheme/composer.json | 35 - .../symfony/polyfill-intl-normalizer/LICENSE | 19 - .../polyfill-intl-normalizer/Normalizer.php | 310 - .../polyfill-intl-normalizer/README.md | 14 - .../Resources/stubs/Normalizer.php | 17 - .../unidata/canonicalComposition.php | 945 --- .../unidata/canonicalDecomposition.php | 2065 ------ .../Resources/unidata/combiningClass.php | 876 --- .../unidata/compatibilityDecomposition.php | 3695 ----------- .../polyfill-intl-normalizer/bootstrap.php | 23 - .../polyfill-intl-normalizer/bootstrap80.php | 19 - .../polyfill-intl-normalizer/composer.json | 36 - .../vendor/symfony/polyfill-mbstring/LICENSE | 19 - .../symfony/polyfill-mbstring/Mbstring.php | 1045 --- .../symfony/polyfill-mbstring/README.md | 13 - .../Resources/unidata/caseFolding.php | 119 - .../Resources/unidata/lowerCase.php | 1397 ---- .../Resources/unidata/titleCaseRegexp.php | 5 - .../Resources/unidata/upperCase.php | 1489 ----- .../symfony/polyfill-mbstring/bootstrap.php | 172 - .../symfony/polyfill-mbstring/bootstrap80.php | 167 - .../symfony/polyfill-mbstring/composer.json | 38 - .../vendor/symfony/polyfill-php80/LICENSE | 19 - .../vendor/symfony/polyfill-php80/Php80.php | 115 - .../symfony/polyfill-php80/PhpToken.php | 103 - .../vendor/symfony/polyfill-php80/README.md | 25 - .../Resources/stubs/Attribute.php | 31 - .../Resources/stubs/PhpToken.php | 16 - .../Resources/stubs/Stringable.php | 20 - .../Resources/stubs/UnhandledMatchError.php | 16 - .../Resources/stubs/ValueError.php | 16 - .../symfony/polyfill-php80/bootstrap.php | 42 - .../symfony/polyfill-php80/composer.json | 37 - .../vendor/symfony/polyfill-php81/LICENSE | 19 - .../vendor/symfony/polyfill-php81/Php81.php | 37 - .../vendor/symfony/polyfill-php81/README.md | 18 - .../Resources/stubs/CURLStringFile.php | 51 - .../Resources/stubs/ReturnTypeWillChange.php | 20 - .../symfony/polyfill-php81/bootstrap.php | 28 - .../symfony/polyfill-php81/composer.json | 33 - .../vendor/symfony/process/CHANGELOG.md | 128 - .../process/Exception/ExceptionInterface.php | 21 - .../Exception/InvalidArgumentException.php | 21 - .../process/Exception/LogicException.php | 21 - .../Exception/ProcessFailedException.php | 53 - .../Exception/ProcessSignaledException.php | 38 - .../Exception/ProcessStartFailedException.php | 43 - .../Exception/ProcessTimedOutException.php | 60 - .../Exception/RunProcessFailedException.php | 25 - .../process/Exception/RuntimeException.php | 21 - .../symfony/process/ExecutableFinder.php | 103 - .../vendor/symfony/process/InputStream.php | 91 - .../vendor/symfony/process/LICENSE | 19 - .../process/Messenger/RunProcessContext.php | 33 - .../process/Messenger/RunProcessMessage.php | 32 - .../Messenger/RunProcessMessageHandler.php | 33 - .../symfony/process/PhpExecutableFinder.php | 96 - .../vendor/symfony/process/PhpProcess.php | 66 - .../vendor/symfony/process/PhpSubprocess.php | 164 - .../symfony/process/Pipes/AbstractPipes.php | 176 - .../symfony/process/Pipes/PipesInterface.php | 61 - .../symfony/process/Pipes/UnixPipes.php | 144 - .../symfony/process/Pipes/WindowsPipes.php | 185 - .../vendor/symfony/process/Process.php | 1674 ----- .../vendor/symfony/process/ProcessUtils.php | 64 - .../vendor/symfony/process/README.md | 13 - .../vendor/symfony/process/composer.json | 28 - .../service-contracts/Attribute/Required.php | 25 - .../Attribute/SubscribedService.php | 47 - .../symfony/service-contracts/CHANGELOG.md | 5 - .../vendor/symfony/service-contracts/LICENSE | 19 - .../symfony/service-contracts/README.md | 9 - .../service-contracts/ResetInterface.php | 33 - .../ServiceCollectionInterface.php | 26 - .../service-contracts/ServiceLocatorTrait.php | 115 - .../ServiceMethodsSubscriberTrait.php | 80 - .../ServiceProviderInterface.php | 45 - .../ServiceSubscriberInterface.php | 62 - .../ServiceSubscriberTrait.php | 84 - .../Test/ServiceLocatorTest.php | 23 - .../Test/ServiceLocatorTestCase.php | 96 - .../symfony/service-contracts/composer.json | 42 - .../vendor/symfony/stopwatch/CHANGELOG.md | 30 - .../vendor/symfony/stopwatch/LICENSE | 19 - .../vendor/symfony/stopwatch/README.md | 42 - .../vendor/symfony/stopwatch/Section.php | 155 - .../vendor/symfony/stopwatch/Stopwatch.php | 163 - .../symfony/stopwatch/StopwatchEvent.php | 242 - .../symfony/stopwatch/StopwatchPeriod.php | 73 - .../vendor/symfony/stopwatch/composer.json | 29 - .../vendor/symfony/string/AbstractString.php | 718 -- .../symfony/string/AbstractUnicodeString.php | 664 -- .../vendor/symfony/string/ByteString.php | 490 -- .../vendor/symfony/string/CHANGELOG.md | 51 - .../vendor/symfony/string/CodePointString.php | 260 - .../string/Exception/ExceptionInterface.php | 16 - .../Exception/InvalidArgumentException.php | 16 - .../string/Exception/RuntimeException.php | 16 - .../string/Inflector/EnglishInflector.php | 586 -- .../string/Inflector/FrenchInflector.php | 151 - .../string/Inflector/InflectorInterface.php | 33 - .../string/Inflector/SpanishInflector.php | 126 - .../vendor/symfony/string/LICENSE | 19 - .../vendor/symfony/string/LazyString.php | 145 - .../vendor/symfony/string/README.md | 14 - .../Resources/data/wcswidth_table_wide.php | 1175 ---- .../Resources/data/wcswidth_table_zero.php | 1459 ----- .../symfony/string/Resources/functions.php | 38 - .../symfony/string/Slugger/AsciiSlugger.php | 207 - .../string/Slugger/SluggerInterface.php | 27 - .../vendor/symfony/string/TruncateMode.php | 42 - .../vendor/symfony/string/UnicodeString.php | 382 -- .../vendor/symfony/string/composer.json | 44 - 1185 files changed, 1170 insertions(+), 185105 deletions(-) rename .php-cs-fixer.php => .php-cs-fixer.dist.php (94%) delete mode 100644 tools/php-cs-fixer/composer.json delete mode 100644 tools/php-cs-fixer/composer.lock delete mode 100644 tools/php-cs-fixer/vendor/autoload.php delete mode 100755 tools/php-cs-fixer/vendor/bin/php-cs-fixer delete mode 100755 tools/php-cs-fixer/vendor/bin/php-cs-fixer.bat delete mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/.github/FUNDING.yml delete mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/README.md delete mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/composer.json delete mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/src/Decoder.php delete mode 100644 tools/php-cs-fixer/vendor/clue/ndjson-react/src/Encoder.php delete mode 100644 tools/php-cs-fixer/vendor/composer/ClassLoader.php delete mode 100644 tools/php-cs-fixer/vendor/composer/InstalledVersions.php delete mode 100644 tools/php-cs-fixer/vendor/composer/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/composer/autoload_classmap.php delete mode 100644 tools/php-cs-fixer/vendor/composer/autoload_files.php delete mode 100644 tools/php-cs-fixer/vendor/composer/autoload_namespaces.php delete mode 100644 tools/php-cs-fixer/vendor/composer/autoload_psr4.php delete mode 100644 tools/php-cs-fixer/vendor/composer/autoload_real.php delete mode 100644 tools/php-cs-fixer/vendor/composer/autoload_static.php delete mode 100644 tools/php-cs-fixer/vendor/composer/installed.json delete mode 100644 tools/php-cs-fixer/vendor/composer/installed.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/README.md delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/composer.json delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/extension.neon delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllResult.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/MatchResult.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/MatchStrictGroupsResult.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/MatchWithOffsetsResult.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/InvalidRegexPatternRule.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchFlags.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchParameterOutTypeExtension.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchTypeSpecifyingExtension.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregReplaceCallbackClosureTypeExtension.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/UnsafeStrictGroupsCallRule.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/PcreException.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/Preg.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/Regex.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/ReplaceResult.php delete mode 100644 tools/php-cs-fixer/vendor/composer/pcre/src/UnexpectedNullMatchException.php delete mode 100644 tools/php-cs-fixer/vendor/composer/platform_check.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/README.md delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/composer.json delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/Comparator.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/CompilingMatcher.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/Constraint/Bound.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/Constraint/Constraint.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/Constraint/ConstraintInterface.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MatchAllConstraint.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MatchNoneConstraint.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MultiConstraint.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/Interval.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/Intervals.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/Semver.php delete mode 100644 tools/php-cs-fixer/vendor/composer/semver/src/VersionParser.php delete mode 100644 tools/php-cs-fixer/vendor/composer/xdebug-handler/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/composer/xdebug-handler/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/composer/xdebug-handler/README.md delete mode 100644 tools/php-cs-fixer/vendor/composer/xdebug-handler/composer.json delete mode 100644 tools/php-cs-fixer/vendor/composer/xdebug-handler/src/PhpConfig.php delete mode 100644 tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Process.php delete mode 100644 tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Status.php delete mode 100644 tools/php-cs-fixer/vendor/composer/xdebug-handler/src/XdebugHandler.php delete mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/.gitattributes delete mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/README.md delete mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/composer.json delete mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitter.php delete mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterInterface.php delete mode 100644 tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterTrait.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/.envrc delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/LICENSE.md delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/README.md delete mode 100755 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/diagnose.php delete mode 100755 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/execute.php delete mode 100755 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/trace.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/composer.json delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Diagnoser.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuLogicalFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php delete mode 100644 tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/ParallelisationResult.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/README.md delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/ci-integration.sh delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/composer.json delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/feature-or-bug.rst delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/logo.md delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/logo.png delete mode 100755 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/DirectoryInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandlerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/SignatureInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Config.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidConfigurationException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidForEnvFixerConfigurationException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/RequiredFixerConfigurationException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeNameNotFoundException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommandExitStatusCalculator.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/WorkerCommand.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionCheckerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DifferInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/NullDiffer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/ShortDescription.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Tag.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/RstUtils.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/RuleSetDocumentationGenerator.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/SourceExceptionFactory.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileReader.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Finder.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractIncrementOperatorFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractShortOperatorFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ArrayPushFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ModernizeStrposFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasLanguageConstructCallFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/RandomApiMigrationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoMultilineWhitespaceAroundDoubleArrowFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoWhitespaceBeforeCommaInArrayFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NormalizeIndexBraceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ReturnToYieldFromFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/TrimArraySpacesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/AttributeEmptyParenthesesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/GeneralAttributeRemoveFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/CurlyBracesPositionFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/EncodingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoMultipleStatementsPerLineFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/OctalNotationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/SingleLineEmptyBodyFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/IntegerLiteralCaseFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionCasingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/CastSpacesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/LowercaseCastFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ModernizeTypesCastingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoShortBoolCastFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoUnsetCastFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ShortScalarCastFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalClassFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoNullPropertyInitializationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoUnneededFinalMethodFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/PhpdocReadonlyClassCommentToKeywordFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ProtectedToPrivateFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfStaticAccessorFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/VisibilityRequiredFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassUsage/DateTimeImmutableFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoTrailingWhitespaceInCommentFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentSpacingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerTrait.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureBracesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureContinuationPositionFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ElseifFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopBodyFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/IncludeFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoAlternativeSyntaxFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoSuperfluousElseifFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoTrailingCommaInListCallFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededCurlyBracesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUselessElseFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSpaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationArrayAssignmentFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationBracesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FixerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionDeclarationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionTypehintSpaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoTrailingCommaInSinglelineFunctionCallFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUselessSprintfFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ReturnTypeDeclarationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/SingleLineThrowFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/StaticLambdaFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/UseArrowFunctionsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GroupImportFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoLeadingImportSlashFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnneededImportAliasFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnusedImportsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/OrderedImportsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/InternalFixerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveUnsetsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareEqualNormalizeFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareParenthesesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DirConstantFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ErrorSuppressionFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ExplicitIndirectVariableFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/FunctionToConstantFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/GetClassToClassKeywordFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/IsNullFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NoUnsetOnPropertyFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NullableTypeDeclarationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAfterConstructFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ListNotation/ListSyntaxFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLinesBeforeNamespaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/CleanNamespaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoLeadingNamespaceWhitespaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Naming/NoHomoglyphNamesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/AssignNullCoalescingToCoalesceEqualFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/BinaryOperatorSpacesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ConcatSpaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/IncrementStyleFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LogicalOperatorsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LongToShorthandOperatorFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithBracesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithParenthesesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoSpaceAroundDoubleColonFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessConcatOperatorFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessNullsafeOperatorFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSpaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSuccessorSpaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/OperatorLinebreakFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeIncrementFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeNotEqualsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryOperatorSpacesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToElvisOperatorFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToNullCoalescingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/UnaryOperatorSpacesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/BlankLineAfterOpeningTagFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/EchoTagSyntaxFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/FullOpeningTagFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/LinebreakAfterOpeningTagFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/NoClosingTagFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAssertNewNamesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAttributesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitConstructFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderNameFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderReturnTypeFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderStaticFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertInternalTypeFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitExpectationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitFqcnAnnotationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitInternalClassFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMethodCasingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNamespacedFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSizeClassFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitStrictFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTargetVersion.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAlignFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocIndentFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocLineSpanFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocListTypeFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAccessFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoPackageFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderByValueFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocParamOrderFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocScalarFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSeparationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSummaryFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagCasingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocToCommentFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesOrderFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarAnnotationCorrectOrderFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarWithoutNameFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/NoUselessReturnFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/ReturnAssignmentFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/SimplifiedNullReturnFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoEmptyStatementFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SemicolonAfterInstructionFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SpaceAfterSemicolonFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/DeclareStrictTypesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictComparisonFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictParamFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/EscapeImplicitBackslashesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/ExplicitStringVariableFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocClosingMarkerFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocToNowdocFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/MultilineStringToHeredocFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoBinaryStringFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoTrailingWhitespaceInStringFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SimpleToComplexStringVariableFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SingleQuoteFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringImplicitBackslashesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLengthToEmptyFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLineEndingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/ArrayIndentationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBeforeStatementFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBetweenImportGroupsFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypeDeclarationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypehintFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/HeredocIndentationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/IndentationTypeFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/LineEndingFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/MethodChainingIndentationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoExtraBlankLinesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesAroundOffsetFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesInsideParenthesisFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoTrailingWhitespaceFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoWhitespaceInBlankLineFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SingleBlankLineAtEofFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SpacesInsideParenthesesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/StatementIndentationFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypeDeclarationSpacesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypesSpacesFixer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/WhitespacesAwareFixerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOption.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOptionBuilder.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AllowedValueSubset.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOption.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolver.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolverInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOption.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionBuilder.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionSorter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/InvalidOptionsForEnvException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSample.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSampleInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSample.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSampleInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinition.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinitionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSample.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSampleInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecification.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificationInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerFactory.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerNameValidator.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Indicator/PhpUnitTestCaseIndicator.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/CachingLinter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/Linter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LinterInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingResultInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinterProcessBuilder.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLintingResult.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLinter.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLintingResult.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/UnavailableLinterException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ParallelAwareConfigInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharChecker.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharCheckerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Preg.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PregException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMigrationSetDescription.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractRuleSetDescription.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/DeprecatedRuleSetDescriptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetDescriptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSets.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/DoctrineAnnotationSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0RiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0Set.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0RiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0Set.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP54MigrationSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP56MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP70MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP70MigrationSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP71MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP71MigrationSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP73MigrationSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP74MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP74MigrationSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP80MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP80MigrationSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP81MigrationSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP83MigrationSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP84MigrationSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit100MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit30MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit32MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit35MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit43MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit48MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit50MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit52MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit54MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit55MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit56MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit57MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit60MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit75MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit84MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit91MigrationRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12RiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12Set.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR1Set.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR2Set.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerSet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonyRiskySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonySet.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/AnalysisStarted.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/FileProcessed.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileCachingLintingFileIterator.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingFileIterator.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingResultAwareFileIteratorInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelAction.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfig.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfigFactory.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelisationException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/Process.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessFactory.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessIdentifier.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessPool.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/WorkerException.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/RunnerConfig.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/StdinFileInfo.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTypeTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AlternativeSyntaxAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AbstractControlCaseStructuresAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/ArgumentAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AttributeAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/CaseAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DataProviderAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DefaultAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/EnumAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/MatchAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceUseAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/StartEndTokenAwareAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/SwitchAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ArgumentsAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AttributeAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/BlocksAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ClassyAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/CommentsAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ControlCaseStructuresAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/DataProviderAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/FunctionsAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/GotoLabelAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespaceUsesAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespacesAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/RangeAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ReferenceAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/SwitchAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/WhitespacesAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CT.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CodeHasher.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Processor/ImportProcessor.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Token.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Tokens.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TokensAnalyzer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ArrayTypehintTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/AttributeTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceClassInstantiationTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ClassConstantTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ConstructorPromotionTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/DisjunctiveNormalFormTypeParenthesisTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/FirstClassCallableTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ImportTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NameQualifiedTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamedArgumentTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamespaceOperatorTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NullableTypeTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ReturnRefTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/SquareBraceTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeAlternationTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeColonTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeIntersectionTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/UseTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/WhitespacyCommentTransformer.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TransformerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformers.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfo.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfoInterface.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Utils.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WhitespacesFixerConfig.php delete mode 100644 tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WordMatcher.php delete mode 100644 tools/php-cs-fixer/vendor/psr/container/.gitignore delete mode 100644 tools/php-cs-fixer/vendor/psr/container/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/psr/container/README.md delete mode 100644 tools/php-cs-fixer/vendor/psr/container/composer.json delete mode 100644 tools/php-cs-fixer/vendor/psr/container/src/ContainerExceptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/psr/container/src/ContainerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/psr/container/src/NotFoundExceptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/psr/event-dispatcher/.editorconfig delete mode 100644 tools/php-cs-fixer/vendor/psr/event-dispatcher/.gitignore delete mode 100644 tools/php-cs-fixer/vendor/psr/event-dispatcher/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/psr/event-dispatcher/README.md delete mode 100644 tools/php-cs-fixer/vendor/psr/event-dispatcher/composer.json delete mode 100644 tools/php-cs-fixer/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php delete mode 100644 tools/php-cs-fixer/vendor/psr/event-dispatcher/src/ListenerProviderInterface.php delete mode 100644 tools/php-cs-fixer/vendor/psr/event-dispatcher/src/StoppableEventInterface.php delete mode 100644 tools/php-cs-fixer/vendor/psr/log/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/psr/log/README.md delete mode 100644 tools/php-cs-fixer/vendor/psr/log/composer.json delete mode 100644 tools/php-cs-fixer/vendor/psr/log/src/AbstractLogger.php delete mode 100644 tools/php-cs-fixer/vendor/psr/log/src/InvalidArgumentException.php delete mode 100644 tools/php-cs-fixer/vendor/psr/log/src/LogLevel.php delete mode 100644 tools/php-cs-fixer/vendor/psr/log/src/LoggerAwareInterface.php delete mode 100644 tools/php-cs-fixer/vendor/psr/log/src/LoggerAwareTrait.php delete mode 100644 tools/php-cs-fixer/vendor/psr/log/src/LoggerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/psr/log/src/LoggerTrait.php delete mode 100644 tools/php-cs-fixer/vendor/psr/log/src/NullLogger.php delete mode 100644 tools/php-cs-fixer/vendor/react/cache/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/react/cache/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/react/cache/README.md delete mode 100644 tools/php-cs-fixer/vendor/react/cache/composer.json delete mode 100644 tools/php-cs-fixer/vendor/react/cache/src/ArrayCache.php delete mode 100644 tools/php-cs-fixer/vendor/react/cache/src/CacheInterface.php delete mode 100644 tools/php-cs-fixer/vendor/react/child-process/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/react/child-process/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/react/child-process/README.md delete mode 100644 tools/php-cs-fixer/vendor/react/child-process/composer.json delete mode 100644 tools/php-cs-fixer/vendor/react/child-process/src/Process.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/react/dns/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/react/dns/README.md delete mode 100644 tools/php-cs-fixer/vendor/react/dns/composer.json delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/BadServerException.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Config/Config.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Config/HostsFile.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Model/Message.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Model/Record.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Protocol/BinaryDumper.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Protocol/Parser.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/CachingExecutor.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/CancellationException.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/CoopExecutor.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/ExecutorInterface.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/FallbackExecutor.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/HostsFileExecutor.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/Query.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/RetryExecutor.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/SelectiveTransportExecutor.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/TcpTransportExecutor.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/TimeoutException.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/TimeoutExecutor.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Query/UdpTransportExecutor.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/RecordNotFoundException.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Resolver/Factory.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Resolver/Resolver.php delete mode 100644 tools/php-cs-fixer/vendor/react/dns/src/Resolver/ResolverInterface.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/README.md delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/composer.json delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/ExtEvLoop.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/ExtEventLoop.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibevLoop.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibeventLoop.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/ExtUvLoop.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/Factory.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/Loop.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/LoopInterface.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/SignalsHandler.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/StreamSelectLoop.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/Tick/FutureTickQueue.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timer.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timers.php delete mode 100644 tools/php-cs-fixer/vendor/react/event-loop/src/TimerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/react/promise/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/react/promise/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/react/promise/README.md delete mode 100644 tools/php-cs-fixer/vendor/react/promise/composer.json delete mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Deferred.php delete mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Exception/CompositeException.php delete mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Exception/LengthException.php delete mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Internal/CancellationQueue.php delete mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Internal/FulfilledPromise.php delete mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Internal/RejectedPromise.php delete mode 100644 tools/php-cs-fixer/vendor/react/promise/src/Promise.php delete mode 100644 tools/php-cs-fixer/vendor/react/promise/src/PromiseInterface.php delete mode 100644 tools/php-cs-fixer/vendor/react/promise/src/functions.php delete mode 100644 tools/php-cs-fixer/vendor/react/promise/src/functions_include.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/react/socket/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/react/socket/README.md delete mode 100644 tools/php-cs-fixer/vendor/react/socket/composer.json delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/Connection.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/ConnectionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/Connector.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/ConnectorInterface.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/DnsConnector.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/FdServer.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/FixedUriConnector.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnectionBuilder.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnector.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/LimitingServer.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/SecureConnector.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/SecureServer.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/Server.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/ServerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/SocketServer.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/StreamEncryption.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/TcpConnector.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/TcpServer.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/TimeoutConnector.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/UnixConnector.php delete mode 100644 tools/php-cs-fixer/vendor/react/socket/src/UnixServer.php delete mode 100644 tools/php-cs-fixer/vendor/react/stream/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/react/stream/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/react/stream/README.md delete mode 100644 tools/php-cs-fixer/vendor/react/stream/composer.json delete mode 100644 tools/php-cs-fixer/vendor/react/stream/src/CompositeStream.php delete mode 100644 tools/php-cs-fixer/vendor/react/stream/src/DuplexResourceStream.php delete mode 100644 tools/php-cs-fixer/vendor/react/stream/src/DuplexStreamInterface.php delete mode 100644 tools/php-cs-fixer/vendor/react/stream/src/ReadableResourceStream.php delete mode 100644 tools/php-cs-fixer/vendor/react/stream/src/ReadableStreamInterface.php delete mode 100644 tools/php-cs-fixer/vendor/react/stream/src/ThroughStream.php delete mode 100644 tools/php-cs-fixer/vendor/react/stream/src/Util.php delete mode 100644 tools/php-cs-fixer/vendor/react/stream/src/WritableResourceStream.php delete mode 100644 tools/php-cs-fixer/vendor/react/stream/src/WritableStreamInterface.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/ChangeLog.md delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/README.md delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/SECURITY.md delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/composer.json delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Chunk.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Diff.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Differ.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/ConfigurationException.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/Exception.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/InvalidArgumentException.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Line.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/LongestCommonSubsequenceCalculator.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Output/DiffOutputBuilderInterface.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/Parser.php delete mode 100644 tools/php-cs-fixer/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Application.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Attribute/AsCommand.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/CI/GithubActionReporter.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Color.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Command/Command.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Command/CompleteCommand.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Command/DumpCompletionCommand.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Command/HelpCommand.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Command/LazyCommand.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Command/ListCommand.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Command/LockableTrait.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Command/SignalableCommandInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Command/TraceableCommand.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionInput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionSuggestions.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Completion/Output/BashCompletionOutput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Completion/Output/FishCompletionOutput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Completion/Output/ZshCompletionOutput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Completion/Suggestion.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/ConsoleEvents.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Cursor.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/DataCollector/CommandDataCollector.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Debug/CliRequest.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Descriptor/ApplicationDescription.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Descriptor/Descriptor.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Descriptor/DescriptorInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Descriptor/JsonDescriptor.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Descriptor/MarkdownDescriptor.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Descriptor/TextDescriptor.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Descriptor/XmlDescriptor.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleAlarmEvent.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleCommandEvent.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleErrorEvent.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleEvent.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleSignalEvent.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleTerminateEvent.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/EventListener/ErrorListener.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Exception/CommandNotFoundException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Exception/ExceptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Exception/InvalidArgumentException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Exception/InvalidOptionException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Exception/LogicException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Exception/MissingInputException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Exception/NamespaceNotFoundException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Exception/RunCommandFailedException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Exception/RuntimeException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatter.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatter.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyle.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/DebugFormatterHelper.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/DescriptorHelper.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/Dumper.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/FormatterHelper.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/Helper.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/HelperInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/HelperSet.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/InputAwareHelper.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/OutputWrapper.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/ProcessHelper.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressBar.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressIndicator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/QuestionHelper.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/SymfonyQuestionHelper.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/Table.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/TableCell.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/TableCellStyle.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/TableRows.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/TableSeparator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Helper/TableStyle.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Input/ArgvInput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Input/ArrayInput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Input/Input.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Input/InputArgument.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Input/InputAwareInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Input/InputDefinition.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Input/InputInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Input/InputOption.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Input/StreamableInputInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Input/StringInput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Logger/ConsoleLogger.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandContext.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessage.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessageHandler.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Output/AnsiColorMode.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Output/BufferedOutput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutputInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleSectionOutput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Output/NullOutput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Output/Output.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Output/OutputInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Output/StreamOutput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Output/TrimmedBufferOutput.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Question/ChoiceQuestion.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Question/ConfirmationQuestion.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Question/Question.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Resources/bin/hiddeninput.exe delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Resources/completion.bash delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Resources/completion.fish delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Resources/completion.zsh delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalMap.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalRegistry.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/SingleCommandApplication.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Style/OutputStyle.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Style/StyleInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Style/SymfonyStyle.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Terminal.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Tester/ApplicationTester.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Tester/CommandCompletionTester.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Tester/CommandTester.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/Tester/TesterTrait.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/console/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/deprecation-contracts/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/deprecation-contracts/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/deprecation-contracts/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/deprecation-contracts/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/deprecation-contracts/function.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/Event.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/WrappedListener.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcher.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcherInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventSubscriberInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/GenericEvent.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/event-dispatcher/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/Exception/ExceptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/Exception/FileNotFoundException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOExceptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/Exception/InvalidArgumentException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/Exception/RuntimeException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/Filesystem.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/Path.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/filesystem/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Comparator/Comparator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Comparator/DateComparator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Comparator/NumberComparator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Exception/AccessDeniedException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Exception/DirectoryNotFoundException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Finder.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Gitignore.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Glob.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/CustomFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/FilenameFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/LazyIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/PathFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/SortableIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/SplFileInfo.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/finder/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/AccessException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/ExceptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/InvalidArgumentException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/InvalidOptionsException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/MissingOptionsException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/NoConfigurationException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/NoSuchOptionException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/OptionConfigurator.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/Options.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/OptionsResolver.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/options-resolver/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-ctype/Ctype.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-ctype/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-ctype/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-ctype/bootstrap.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-ctype/bootstrap80.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-ctype/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/Grapheme.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/bootstrap.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Normalizer.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalComposition.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/bootstrap.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Mbstring.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap80.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php80/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php80/Php80.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php80/PhpToken.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php80/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php80/bootstrap.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php80/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php81/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php81/Php81.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php81/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php81/bootstrap.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/polyfill-php81/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Exception/ExceptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Exception/InvalidArgumentException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Exception/LogicException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessFailedException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessSignaledException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessStartFailedException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessTimedOutException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Exception/RunProcessFailedException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Exception/RuntimeException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/ExecutableFinder.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/InputStream.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessContext.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessage.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessageHandler.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/PhpExecutableFinder.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/PhpProcess.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/PhpSubprocess.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Pipes/AbstractPipes.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Pipes/PipesInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Pipes/UnixPipes.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Pipes/WindowsPipes.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/Process.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/ProcessUtils.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/process/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/Required.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/SubscribedService.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/ResetInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceCollectionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceLocatorTrait.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceProviderInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberTrait.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/service-contracts/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/stopwatch/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/stopwatch/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/stopwatch/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/stopwatch/Section.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/stopwatch/Stopwatch.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchEvent.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchPeriod.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/stopwatch/composer.json delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/AbstractString.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/AbstractUnicodeString.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/ByteString.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/CHANGELOG.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/CodePointString.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Exception/ExceptionInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Exception/InvalidArgumentException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Exception/RuntimeException.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Inflector/EnglishInflector.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Inflector/FrenchInflector.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Inflector/InflectorInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Inflector/SpanishInflector.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/LICENSE delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/LazyString.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/README.md delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_wide.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_zero.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Resources/functions.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Slugger/AsciiSlugger.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/Slugger/SluggerInterface.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/TruncateMode.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/UnicodeString.php delete mode 100644 tools/php-cs-fixer/vendor/symfony/string/composer.json diff --git a/.githooks/pre-commit b/.githooks/pre-commit index b914a2fb..dfd754ed 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -57,7 +57,7 @@ yarn markdownlint-cli2 '**/*.md' '#node_modules' '#vendor' '#tools' '#CHANGELOG. echo "" echo "Lint PHP Files..." -PHP_CS_FIXER="tools/php-cs-fixer/vendor/bin/php-cs-fixer" +PHP_CS_FIXER="vendor/bin/php-cs-fixer" HAS_PHP_CS_FIXER=false if [ -x $PHP_CS_FIXER ]; then @@ -71,7 +71,7 @@ if $HAS_PHP_CS_FIXER; then echo "No php files found in commit." else echo ${FILES} - $PHP_CS_FIXER fix --config .php-cs-fixer.php --verbose ${FILES} --diff + $PHP_CS_FIXER fix --config .php-cs-fixer.dist.php --verbose ${FILES} --diff git add ${FILES} fi else @@ -80,8 +80,7 @@ else echo "" echo " composer install" echo "or" - echo " mkdir -p tools/php-cs-fixer" - echo " composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer" + echo " composer require friendsofphp/php-cs-fixer" echo "" exit 1 fi diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c2e9a74d..f132574d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -63,7 +63,7 @@ jobs: - name: PHP CS Fixer uses: docker://oskarstark/php-cs-fixer-ga with: - args: --config=.php-cs-fixer.php --dry-run --diff --verbose + args: --config=.php-cs-fixer.dist.php --dry-run --diff --verbose - name: "Install PHP with extensions" uses: shivammathur/setup-php@v2 diff --git a/.php-cs-fixer.php b/.php-cs-fixer.dist.php similarity index 94% rename from .php-cs-fixer.php rename to .php-cs-fixer.dist.php index b502e6b4..2b0b2b79 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.dist.php @@ -2,6 +2,7 @@ $finder = PhpCsFixer\Finder::create() ->in(__DIR__) + ->exclude('var') ; $config = new PhpCsFixer\Config(); diff --git a/composer.json b/composer.json index a1918468..a657d999 100644 --- a/composer.json +++ b/composer.json @@ -48,6 +48,7 @@ "twig/twig": "^2.0 | ^3.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.68", "phpstan/phpstan": "^1.10", "rector/rector": "^0.15.25", "symfony/browser-kit": "6.4.*", diff --git a/composer.lock b/composer.lock index 79a863fb..2fff466b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2bdf851cacea6a98db4e860916c2faa3", + "content-hash": "ecec05e20cc0258731f535cd1afad48a", "packages": [ { "name": "composer/package-versions-deprecated", @@ -9180,36 +9180,882 @@ } ], "packages-dev": [ + { + "name": "clue/ndjson-react", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" + }, + { + "name": "composer/pcre", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" + }, + "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-11-12T16:29:46+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-09-19T14:15:21+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" + }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, + { + "name": "fidry/cpu-core-counter", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2024-08-06T10:04:20+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.68.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b9db2b2ea3cdba7201067acee46f984ef2397cff", + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff", + "shasum": "" + }, + "require": { + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.2", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.1 || ^6.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3.1 || ^2.4", + "infection/infection": "^0.29.8", + "justinrainbow/json-schema": "^5.3 || ^6.0", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", + "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.1" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2025-01-17T09:20:36+00:00" + }, { "name": "masterminds/html5", "version": "2.9.0", "source": { "type": "git", - "url": "https://github.com/Masterminds/html5-php.git", - "reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6" + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f5ac2c0b0a2eefca70b2ce32a5809992227e75a6", + "reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Masterminds\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Butcher", + "email": "technosophos@gmail.com" + }, + { + "name": "Matt Farina", + "email": "matt@mattfarina.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + } + ], + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", + "keywords": [ + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" + ], + "support": { + "issues": "https://github.com/Masterminds/html5-php/issues", + "source": "https://github.com/Masterminds/html5-php/tree/2.9.0" + }, + "time": "2024-03-31T07:05:07+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.12.15", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c91d4e8bc056f46cf653656e6f71004b254574d1", + "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2025-01-05T16:40:22+00:00" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" + }, + { + "name": "react/child-process", + "version": "v0.6.6", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.6" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-01-01T16:37:48+00:00" + }, + { + "name": "react/dns", + "version": "v1.13.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f5ac2c0b0a2eefca70b2ce32a5809992227e75a6", - "reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", "shasum": "" }, "require": { - "ext-dom": "*", - "php": ">=5.3.0" + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } + ], + "time": "2024-06-13T14:18:03+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", "autoload": { "psr-4": { - "Masterminds\\": "src" + "React\\EventLoop\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -9218,92 +10064,273 @@ ], "authors": [ { - "name": "Matt Butcher", - "email": "technosophos@gmail.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" }, { - "name": "Matt Farina", - "email": "matt@mattfarina.com" + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" }, { - "name": "Asmir Mustafic", - "email": "goetas@gmail.com" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "An HTML5 parser and serializer.", - "homepage": "http://masterminds.github.io/html5-php", + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", "keywords": [ - "HTML5", - "dom", - "html", - "parser", - "querypath", - "serializer", - "xml" + "asynchronous", + "event-loop" ], "support": { - "issues": "https://github.com/Masterminds/html5-php/issues", - "source": "https://github.com/Masterminds/html5-php/tree/2.9.0" + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" }, - "time": "2024-03-31T07:05:07+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" }, { - "name": "phpstan/phpstan", - "version": "1.12.15", + "name": "react/promise", + "version": "v3.2.0", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1" + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c91d4e8bc056f46cf653656e6f71004b254574d1", - "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": ">=7.1.0" }, - "conflict": { - "phpstan/phpstan-shim": "*" + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" }, - "bin": [ - "phpstan", - "phpstan.phar" - ], "type": "library", "autoload": { "files": [ - "bootstrap.php" - ] + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPStan - PHP Static Analysis Tool", + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", "keywords": [ - "dev", - "static analysis" + "promise", + "promises" ], "support": { - "docs": "https://phpstan.org/user-guide/getting-started", - "forum": "https://github.com/phpstan/phpstan/discussions", - "issues": "https://github.com/phpstan/phpstan/issues", - "security": "https://github.com/phpstan/phpstan/security/policy", - "source": "https://github.com/phpstan/phpstan-src" + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" }, "funding": [ { - "url": "https://github.com/ondrejmirtes", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-05-24T10:39:05+00:00" + }, + { + "name": "react/socket", + "version": "v1.16.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" }, { - "url": "https://github.com/phpstan", - "type": "github" + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "time": "2025-01-05T16:40:22+00:00" + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.16.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-07-26T10:38:09+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" }, { "name": "rector/rector", @@ -9366,6 +10393,73 @@ ], "time": "2023-04-20T16:07:39+00:00" }, + { + "name": "sebastian/diff", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:53:05+00:00" + }, { "name": "symfony/browser-kit", "version": "v6.4.13", diff --git a/symfony.lock b/symfony.lock index 2a2a9d7f..59912891 100644 --- a/symfony.lock +++ b/symfony.lock @@ -74,6 +74,18 @@ "firebase/php-jwt": { "version": "v4.0.0" }, + "friendsofphp/php-cs-fixer": { + "version": "3.68", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "3.0", + "ref": "be2103eb4a20942e28a6dd87736669b757132435" + }, + "files": [ + ".php-cs-fixer.dist.php" + ] + }, "guzzlehttp/guzzle": { "version": "6.5.5" }, diff --git a/tools/php-cs-fixer/composer.json b/tools/php-cs-fixer/composer.json deleted file mode 100644 index 5e091dd5..00000000 --- a/tools/php-cs-fixer/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": { - "friendsofphp/php-cs-fixer": "^3.16" - } -} diff --git a/tools/php-cs-fixer/composer.lock b/tools/php-cs-fixer/composer.lock deleted file mode 100644 index 4c2178da..00000000 --- a/tools/php-cs-fixer/composer.lock +++ /dev/null @@ -1,2546 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "8e940cfd5a10474f1bb48c5a5b12da94", - "packages": [ - { - "name": "clue/ndjson-react", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/clue/reactphp-ndjson.git", - "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", - "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "react/stream": "^1.2" - }, - "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", - "react/event-loop": "^1.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Clue\\React\\NDJson\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", - "homepage": "https://github.com/clue/reactphp-ndjson", - "keywords": [ - "NDJSON", - "json", - "jsonlines", - "newline", - "reactphp", - "streaming" - ], - "support": { - "issues": "https://github.com/clue/reactphp-ndjson/issues", - "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" - }, - "funding": [ - { - "url": "https://clue.engineering/support", - "type": "custom" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-12-23T10:58:28+00:00" - }, - { - "name": "composer/pcre", - "version": "3.3.2", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<1.11.10" - }, - "require-dev": { - "phpstan/phpstan": "^1.12 || ^2", - "phpstan/phpstan-strict-rules": "^1 || ^2", - "phpunit/phpunit": "^8 || ^9" - }, - "type": "library", - "extra": { - "phpstan": { - "includes": [ - "extension.neon" - ] - }, - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.2" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-11-12T16:29:46+00:00" - }, - { - "name": "composer/semver", - "version": "3.4.3", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.11", - "symfony/phpunit-bridge": "^3 || ^7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.3" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-09-19T14:15:21+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "3.0.5", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", - "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-05-06T16:37:16+00:00" - }, - { - "name": "evenement/evenement", - "version": "v3.0.2", - "source": { - "type": "git", - "url": "https://github.com/igorw/evenement.git", - "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", - "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^9 || ^6" - }, - "type": "library", - "autoload": { - "psr-4": { - "Evenement\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "description": "Événement is a very simple event dispatching library for PHP", - "keywords": [ - "event-dispatcher", - "event-emitter" - ], - "support": { - "issues": "https://github.com/igorw/evenement/issues", - "source": "https://github.com/igorw/evenement/tree/v3.0.2" - }, - "time": "2023-08-08T05:53:35+00:00" - }, - { - "name": "fidry/cpu-core-counter", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "8520451a140d3f46ac33042715115e290cf5785f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", - "reference": "8520451a140d3f46ac33042715115e290cf5785f", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "fidry/makefile": "^0.2.0", - "fidry/php-cs-fixer-config": "^1.1.2", - "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan-phpunit": "^1.2.2", - "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^8.5.31 || ^9.5.26", - "webmozarts/strict-phpunit": "^7.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Fidry\\CpuCoreCounter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com" - } - ], - "description": "Tiny utility to get the number of CPU cores.", - "keywords": [ - "CPU", - "core" - ], - "support": { - "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" - }, - "funding": [ - { - "url": "https://github.com/theofidry", - "type": "github" - } - ], - "time": "2024-08-06T10:04:20+00:00" - }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.68.1", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b9db2b2ea3cdba7201067acee46f984ef2397cff", - "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff", - "shasum": "" - }, - "require": { - "clue/ndjson-react": "^1.0", - "composer/semver": "^3.4", - "composer/xdebug-handler": "^3.0.3", - "ext-filter": "*", - "ext-json": "*", - "ext-tokenizer": "*", - "fidry/cpu-core-counter": "^1.2", - "php": "^7.4 || ^8.0", - "react/child-process": "^0.6.5", - "react/event-loop": "^1.0", - "react/promise": "^2.0 || ^3.0", - "react/socket": "^1.0", - "react/stream": "^1.0", - "sebastian/diff": "^4.0 || ^5.1 || ^6.0", - "symfony/console": "^5.4 || ^6.4 || ^7.0", - "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", - "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", - "symfony/finder": "^5.4 || ^6.4 || ^7.0", - "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", - "symfony/polyfill-mbstring": "^1.31", - "symfony/polyfill-php80": "^1.31", - "symfony/polyfill-php81": "^1.31", - "symfony/process": "^5.4 || ^6.4 || ^7.2", - "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" - }, - "require-dev": { - "facile-it/paraunit": "^1.3.1 || ^2.4", - "infection/infection": "^0.29.8", - "justinrainbow/json-schema": "^5.3 || ^6.0", - "keradus/cli-executor": "^2.1", - "mikey179/vfsstream": "^1.6.12", - "php-coveralls/php-coveralls": "^2.7", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", - "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", - "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", - "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, - "exclude-from-classmap": [ - "src/Fixer/Internal/*" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "keywords": [ - "Static code analysis", - "fixer", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.1" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2025-01-17T09:20:36+00:00" - }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" - }, - "time": "2019-01-08T18:20:26+00:00" - }, - { - "name": "psr/log", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" - }, - "time": "2024-09-11T13:17:53+00:00" - }, - { - "name": "react/cache", - "version": "v1.2.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/cache.git", - "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", - "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "react/promise": "^3.0 || ^2.0 || ^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async, Promise-based cache interface for ReactPHP", - "keywords": [ - "cache", - "caching", - "promise", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/cache/issues", - "source": "https://github.com/reactphp/cache/tree/v1.2.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2022-11-30T15:59:55+00:00" - }, - { - "name": "react/child-process", - "version": "v0.6.6", - "source": { - "type": "git", - "url": "https://github.com/reactphp/child-process.git", - "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", - "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.0", - "react/event-loop": "^1.2", - "react/stream": "^1.4" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/socket": "^1.16", - "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\ChildProcess\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Event-driven library for executing child processes with ReactPHP.", - "keywords": [ - "event-driven", - "process", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/child-process/issues", - "source": "https://github.com/reactphp/child-process/tree/v0.6.6" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2025-01-01T16:37:48+00:00" - }, - { - "name": "react/dns", - "version": "v1.13.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/dns.git", - "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", - "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "react/cache": "^1.0 || ^0.6 || ^0.5", - "react/event-loop": "^1.2", - "react/promise": "^3.2 || ^2.7 || ^1.2.1" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4.3 || ^3 || ^2", - "react/promise-timer": "^1.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Dns\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async DNS resolver for ReactPHP", - "keywords": [ - "async", - "dns", - "dns-resolver", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/dns/issues", - "source": "https://github.com/reactphp/dns/tree/v1.13.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-06-13T14:18:03+00:00" - }, - { - "name": "react/event-loop", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/event-loop.git", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "suggest": { - "ext-pcntl": "For signal handling support when using the StreamSelectLoop" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\EventLoop\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", - "keywords": [ - "asynchronous", - "event-loop" - ], - "support": { - "issues": "https://github.com/reactphp/event-loop/issues", - "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2023-11-13T13:48:05+00:00" - }, - { - "name": "react/promise", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63", - "shasum": "" - }, - "require": { - "php": ">=7.1.0" - }, - "require-dev": { - "phpstan/phpstan": "1.10.39 || 1.4.10", - "phpunit/phpunit": "^9.6 || ^7.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v3.2.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-05-24T10:39:05+00:00" - }, - { - "name": "react/socket", - "version": "v1.16.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/socket.git", - "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", - "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.0", - "react/dns": "^1.13", - "react/event-loop": "^1.2", - "react/promise": "^3.2 || ^2.6 || ^1.2.1", - "react/stream": "^1.4" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4.3 || ^3.3 || ^2", - "react/promise-stream": "^1.4", - "react/promise-timer": "^1.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Socket\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", - "keywords": [ - "Connection", - "Socket", - "async", - "reactphp", - "stream" - ], - "support": { - "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.16.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-07-26T10:38:09+00:00" - }, - { - "name": "react/stream", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/stream.git", - "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", - "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.8", - "react/event-loop": "^1.2" - }, - "require-dev": { - "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", - "keywords": [ - "event-driven", - "io", - "non-blocking", - "pipe", - "reactphp", - "readable", - "stream", - "writable" - ], - "support": { - "issues": "https://github.com/reactphp/stream/issues", - "source": "https://github.com/reactphp/stream/tree/v1.4.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-06-11T12:45:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "6.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", - "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "require-dev": { - "phpunit/phpunit": "^11.0", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "6.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-07-03T04:53:05+00:00" - }, - { - "name": "symfony/console", - "version": "v7.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", - "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^6.4|^7.0" - }, - "conflict": { - "symfony/dependency-injection": "<6.4", - "symfony/dotenv": "<6.4", - "symfony/event-dispatcher": "<6.4", - "symfony/lock": "<6.4", - "symfony/process": "<6.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/event-dispatcher": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^6.4|^7.0", - "symfony/messenger": "^6.4|^7.0", - "symfony/process": "^6.4|^7.0", - "symfony/stopwatch": "^6.4|^7.0", - "symfony/var-dumper": "^6.4|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v7.2.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-12-11T03:49:26+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.5.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", - "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.5-dev" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-25T14:20:29+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v7.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", - "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/event-dispatcher-contracts": "^2.5|^3" - }, - "conflict": { - "symfony/dependency-injection": "<6.4", - "symfony/service-contracts": "<2.5" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/error-handler": "^6.4|^7.0", - "symfony/expression-language": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^6.4|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-25T14:21:43+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v3.5.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", - "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/event-dispatcher": "^1" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.5-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-25T14:20:29+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v7.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", - "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "require-dev": { - "symfony/process": "^6.4|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.2.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-10-25T15:15:23+00:00" - }, - { - "name": "symfony/finder", - "version": "v7.2.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "require-dev": { - "symfony/filesystem": "^6.4|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v7.2.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-12-30T19:00:17+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v7.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-11-20T11:17:29+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "3833d7255cc303546435cb650316bff708a1c75c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", - "reference": "3833d7255cc303546435cb650316bff708a1c75c", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, - { - "name": "symfony/process", - "version": "v7.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", - "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v7.2.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-11-06T14:24:19+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.5.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", - "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.5-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-25T14:20:29+00:00" - }, - { - "name": "symfony/stopwatch", - "version": "v7.2.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e46690d5b9d7164a6d061cab1e8d46141b9f49df", - "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/service-contracts": "^2.5|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.2.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-12-18T14:28:33+00:00" - }, - { - "name": "symfony/string", - "version": "v7.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.5" - }, - "require-dev": { - "symfony/emoji": "^7.1", - "symfony/error-handler": "^6.4|^7.0", - "symfony/http-client": "^6.4|^7.0", - "symfony/intl": "^6.4|^7.0", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v7.2.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-11-13T13:31:26+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.6.0" -} diff --git a/tools/php-cs-fixer/vendor/autoload.php b/tools/php-cs-fixer/vendor/autoload.php deleted file mode 100644 index aaa8907f..00000000 --- a/tools/php-cs-fixer/vendor/autoload.php +++ /dev/null @@ -1,25 +0,0 @@ -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - return include("phpvfscomposer://" . __DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer'); - } -} - -return include __DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer'; diff --git a/tools/php-cs-fixer/vendor/bin/php-cs-fixer.bat b/tools/php-cs-fixer/vendor/bin/php-cs-fixer.bat deleted file mode 100755 index ec8869f1..00000000 --- a/tools/php-cs-fixer/vendor/bin/php-cs-fixer.bat +++ /dev/null @@ -1,5 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/php-cs-fixer -SET COMPOSER_RUNTIME_BIN_DIR=%~dp0 -php "%BIN_TARGET%" %* diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/.github/FUNDING.yml b/tools/php-cs-fixer/vendor/clue/ndjson-react/.github/FUNDING.yml deleted file mode 100644 index 9c09fb87..00000000 --- a/tools/php-cs-fixer/vendor/clue/ndjson-react/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: clue -custom: https://clue.engineering/support diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/CHANGELOG.md b/tools/php-cs-fixer/vendor/clue/ndjson-react/CHANGELOG.md deleted file mode 100644 index bc4faf69..00000000 --- a/tools/php-cs-fixer/vendor/clue/ndjson-react/CHANGELOG.md +++ /dev/null @@ -1,75 +0,0 @@ -# Changelog - -## 1.3.0 (2022-12-23) - -* Feature: Add support for PHP 8.1 and PHP 8.2. - (#31 by @clue and #30 by @SimonFring) - -* Feature: Check type of incoming `data` before trying to decode NDJSON. - (#29 by @SimonFrings) - -* Improve documentation and examples and update to new [default loop](https://reactphp.org/event-loop/#loop). - (#26 by @clue, #27 by @SimonFrings and #25 by @PaulRotmann) - -* Improve test suite, report failed assertions and ensure 100% code coverage. - (#32 and #33 by @clue and #28 by @SimonFrings) - -## 1.2.0 (2020-12-09) - -* Improve test suite and add `.gitattributes` to exclude dev files from exports. - Add PHP 8 support, update to PHPUnit 9 and simplify test setup. - (#18 by @clue and #19, #22 and #23 by @SimonFrings) - -## 1.1.0 (2020-02-04) - -* Feature: Improve error reporting and add parsing error message to Exception and - ignore `JSON_THROW_ON_ERROR` option (available as of PHP 7.3). - (#14 by @clue) - -* Feature: Add bechmarking script and import all global function references. - (#16 by @clue) - -* Improve documentation and add NDJSON format description and - add support / sponsorship info. - (#12 and #17 by @clue) - -* Improve test suite to run tests on PHP 7.4 and simplify test matrix and - apply minor code style adjustments to make phpstan happy. - (#13 and #15 by @clue) - -## 1.0.0 (2018-05-17) - -* First stable release, now following SemVer - -* Improve documentation and usage examples - -> Contains no other changes, so it's actually fully compatible with the v0.1.2 release. - -## 0.1.2 (2018-05-11) - -* Feature: Limit buffer size to 64 KiB by default. - (#10 by @clue) - -* Feature: Forward compatiblity with EventLoop v0.5 and upcoming v1.0. - (#8 by @clue) - -* Fix: Return bool `false` if encoding fails due to invalid value to pause source. - (#9 by @clue) - -* Improve test suite by supporting PHPUnit v6 and test against legacy PHP 5.3 through PHP 7.2. - (#7 by @clue) - -* Update project homepage. - (#11 by @clue) - -## 0.1.1 (2017-05-22) - -* Feature: Forward compatibility with Stream v0.7, v0.6, v0.5 and upcoming v1.0 (while keeping BC) - (#6 by @thklein) - -* Improved test suite by adding PHPUnit to `require-dev` - (#5 by @thklein) - -## 0.1.0 (2016-11-24) - -* First tagged release diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/LICENSE b/tools/php-cs-fixer/vendor/clue/ndjson-react/LICENSE deleted file mode 100644 index 7baae8e9..00000000 --- a/tools/php-cs-fixer/vendor/clue/ndjson-react/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Christian Lück - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/README.md b/tools/php-cs-fixer/vendor/clue/ndjson-react/README.md deleted file mode 100644 index 0ca4eabe..00000000 --- a/tools/php-cs-fixer/vendor/clue/ndjson-react/README.md +++ /dev/null @@ -1,365 +0,0 @@ -# clue/reactphp-ndjson - -[![CI status](https://github.com/clue/reactphp-ndjson/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/reactphp-ndjson/actions) -[![installs on Packagist](https://img.shields.io/packagist/dt/clue/ndjson-react?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/clue/ndjson-react) -[![code coverage](https://img.shields.io/badge/code%20coverage-100%25-success)](#tests) - -Streaming newline-delimited JSON ([NDJSON](http://ndjson.org/)) parser and encoder for [ReactPHP](https://reactphp.org/). - -[NDJSON](http://ndjson.org/) can be used to store multiple JSON records in a -file to store any kind of (uniform) structured data, such as a list of user -objects or log entries. It uses a simple newline character between each -individual record and as such can be both used for efficient persistence and -simple append-style operations. This also allows it to be used in a streaming -context, such as a simple inter-process communication (IPC) protocol or for a -remote procedure call (RPC) mechanism. This library provides a simple -streaming API to process very large NDJSON files with thousands or even millions -of rows efficiently without having to load the whole file into memory at once. - -* **Standard interfaces** - - Allows easy integration with existing higher-level components by implementing - ReactPHP's standard streaming interfaces. -* **Lightweight, SOLID design** - - Provides a thin abstraction that is [*just good enough*](https://en.wikipedia.org/wiki/Principle_of_good_enough) - and does not get in your way. - Builds on top of well-tested components and well-established concepts instead of reinventing the wheel. -* **Good test coverage** - - Comes with an [automated tests suite](#tests) and is regularly tested in the *real world*. - -**Table of contents** - -* [Support us](#support-us) -* [NDJSON format](#ndjson-format) -* [Usage](#usage) - * [Decoder](#decoder) - * [Encoder](#encoder) -* [Install](#install) -* [Tests](#tests) -* [License](#license) -* [More](#more) - -## Support us - -We invest a lot of time developing, maintaining, and updating our awesome -open-source projects. You can help us sustain this high-quality of our work by -[becoming a sponsor on GitHub](https://github.com/sponsors/clue). Sponsors get -numerous benefits in return, see our [sponsoring page](https://github.com/sponsors/clue) -for details. - -Let's take these projects to the next level together! 🚀 - -## NDJSON format - -NDJSON ("Newline-Delimited JSON" or sometimes referred to as "JSON lines") is a -very simple text-based format for storing a large number of records, such as a -list of user records or log entries. - -```JSON -{"name":"Alice","age":30,"comment":"Yes, I like cheese"} -{"name":"Bob","age":50,"comment":"Hello\nWorld!"} -``` - -If you understand JSON and you're now looking at this newline-delimited JSON for -the first time, you should already know everything you need to know to -understand NDJSON: As the name implies, this format essentially consists of -individual lines where each individual line is any valid JSON text and each line -is delimited with a newline character. - -This example uses a list of user objects where each user has some arbitrary -properties. This can easily be adjusted for many different use cases, such as -storing for example products instead of users, assigning additional properties -or having a significantly larger number of records. You can edit NDJSON files in -any text editor or use them in a streaming context where individual records -should be processed. Unlike normal JSON files, adding a new log entry to this -NDJSON file does not require modification of this file's structure (note there's -no "outer array" to be modified). This makes it a perfect fit for a streaming -context, for line-oriented CLI tools (such as `grep` and others) or for a logging -context where you want to append records at a later time. Additionally, this -also allows it to be used in a streaming context, such as a simple inter-process -communication (IPC) protocol or for a remote procedure call (RPC) mechanism. - -The newline character at the end of each line allows for some really simple -*framing* (detecting individual records). While each individual line is valid -JSON, the complete file as a whole is technically no longer valid JSON, because -it contains multiple JSON texts. This implies that for example calling PHP's -`json_decode()` on this complete input would fail because it would try to parse -multiple records at once. Likewise, using "pretty printing" JSON -(`JSON_PRETTY_PRINT`) is not allowed because each JSON text is limited to exactly -one line. On the other hand, values containing newline characters (such as the -`comment` property in the above example) do not cause issues because each newline -within a JSON string will be represented by a `\n` instead. - -One common alternative to NDJSON would be Comma-Separated Values (CSV). -If you want to process CSV files, you may want to take a look at the related -project [clue/reactphp-csv](https://github.com/clue/reactphp-csv) instead: - -``` -name,age,comment -Alice,30,"Yes, I like cheese" -Bob,50,"Hello -World!" -``` - -CSV may look slightly simpler, but this simplicity comes at a price. CSV is -limited to untyped, two-dimensional data, so there's no standard way of storing -any nested structures or to differentiate a boolean value from a string or -integer. Field names are sometimes used, sometimes they're not -(application-dependant). Inconsistent handling for fields that contain -separators such as `,` or spaces or line breaks (see the `comment` field above) -introduce additional complexity and its text encoding is usually undefined, -Unicode (or UTF-8) is unlikely to be supported and CSV files often use ISO -8859-1 encoding or some variant (again application-dependant). - -While NDJSON helps avoiding many of CSV's shortcomings, it is still a -(relatively) young format while CSV files have been used in production systems -for decades. This means that if you want to interface with an existing system, -you may have to rely on the format that's already supported. If you're building -a new system, using NDJSON is an excellent choice as it provides a flexible way -to process individual records using a common text-based format that can include -any kind of structured data. - -## Usage - -### Decoder - -The `Decoder` (parser) class can be used to make sure you only get back -complete, valid JSON elements when reading from a stream. -It wraps a given -[`ReadableStreamInterface`](https://github.com/reactphp/stream#readablestreaminterface) -and exposes its data through the same interface, but emits the JSON elements -as parsed values instead of just chunks of strings: - -``` -{"name":"test","active":true} -{"name":"hello w\u00f6rld","active":true} -``` - -```php -$stdin = new React\Stream\ReadableResourceStream(STDIN); - -$ndjson = new Clue\React\NDJson\Decoder($stdin); - -$ndjson->on('data', function ($data) { - // $data is a parsed element from the JSON stream - // line 1: $data = (object)array('name' => 'test', 'active' => true); - // line 2: $data = (object)array('name' => 'hello wörld', 'active' => true); - var_dump($data); -}); -``` - -ReactPHP's streams emit chunks of data strings and make no assumption about their lengths. -These chunks do not necessarily represent complete JSON elements, as an -element may be broken up into multiple chunks. -This class reassembles these elements by buffering incomplete ones. - -The `Decoder` supports the same optional parameters as the underlying -[`json_decode()`](https://www.php.net/manual/en/function.json-decode.php) function. -This means that, by default, JSON objects will be emitted as a `stdClass`. -This behavior can be controlled through the optional constructor parameters: - -```php -$ndjson = new Clue\React\NDJson\Decoder($stdin, true); - -$ndjson->on('data', function ($data) { - // JSON objects will be emitted as assoc arrays now -}); -``` - -Additionally, the `Decoder` limits the maximum buffer size (maximum line -length) to avoid buffer overflows due to malformed user input. Usually, there -should be no need to change this value, unless you know you're dealing with some -unreasonably long lines. It accepts an additional argument if you want to change -this from the default of 64 KiB: - -```php -$ndjson = new Clue\React\NDJson\Decoder($stdin, false, 512, 0, 64 * 1024); -``` - -If the underlying stream emits an `error` event or the plain stream contains -any data that does not represent a valid NDJson stream, -it will emit an `error` event and then `close` the input stream: - -```php -$ndjson->on('error', function (Exception $error) { - // an error occured, stream will close next -}); -``` - -If the underlying stream emits an `end` event, it will flush any incomplete -data from the buffer, thus either possibly emitting a final `data` event -followed by an `end` event on success or an `error` event for -incomplete/invalid JSON data as above: - -```php -$ndjson->on('end', function () { - // stream successfully ended, stream will close next -}); -``` - -If either the underlying stream or the `Decoder` is closed, it will forward -the `close` event: - -```php -$ndjson->on('close', function () { - // stream closed - // possibly after an "end" event or due to an "error" event -}); -``` - -The `close(): void` method can be used to explicitly close the `Decoder` and -its underlying stream: - -```php -$ndjson->close(); -``` - -The `pipe(WritableStreamInterface $dest, array $options = array(): WritableStreamInterface` -method can be used to forward all data to the given destination stream. -Please note that the `Decoder` emits decoded/parsed data events, while many -(most?) writable streams expect only data chunks: - -```php -$ndjson->pipe($logger); -``` - -For more details, see ReactPHP's -[`ReadableStreamInterface`](https://github.com/reactphp/stream#readablestreaminterface). - -### Encoder - -The `Encoder` (serializer) class can be used to make sure anything you write to -a stream ends up as valid JSON elements in the resulting NDJSON stream. -It wraps a given -[`WritableStreamInterface`](https://github.com/reactphp/stream#writablestreaminterface) -and accepts its data through the same interface, but handles any data as complete -JSON elements instead of just chunks of strings: - -```php -$stdout = new React\Stream\WritableResourceStream(STDOUT); - -$ndjson = new Clue\React\NDJson\Encoder($stdout); - -$ndjson->write(array('name' => 'test', 'active' => true)); -$ndjson->write(array('name' => 'hello wörld', 'active' => true)); -``` -``` -{"name":"test","active":true} -{"name":"hello w\u00f6rld","active":true} -``` - -The `Encoder` supports the same parameters as the underlying -[`json_encode()`](https://www.php.net/manual/en/function.json-encode.php) function. -This means that, by default, Unicode characters will be escaped in the output. -This behavior can be controlled through the optional constructor parameters: - -```php -$ndjson = new Clue\React\NDJson\Encoder($stdout, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - -$ndjson->write('hello wörld'); -``` -``` -"hello wörld" -``` - -Note that trying to pass the `JSON_PRETTY_PRINT` option will yield an -`InvalidArgumentException` because it is not compatible with NDJSON. - -If the underlying stream emits an `error` event or the given data contains -any data that can not be represented as a valid NDJSON stream, -it will emit an `error` event and then `close` the input stream: - -```php -$ndjson->on('error', function (Exception $error) { - // an error occured, stream will close next -}); -``` - -If either the underlying stream or the `Encoder` is closed, it will forward -the `close` event: - -```php -$ndjson->on('close', function () { - // stream closed - // possibly after an "end" event or due to an "error" event -}); -``` - -The `end(mixed $data = null): void` method can be used to optionally emit -any final data and then soft-close the `Encoder` and its underlying stream: - -```php -$ndjson->end(); -``` - -The `close(): void` method can be used to explicitly close the `Encoder` and -its underlying stream: - -```php -$ndjson->close(); -``` - -For more details, see ReactPHP's -[`WritableStreamInterface`](https://github.com/reactphp/stream#writablestreaminterface). - -## Install - -The recommended way to install this library is [through Composer](https://getcomposer.org/). -[New to Composer?](https://getcomposer.org/doc/00-intro.md) - -This project follows [SemVer](https://semver.org/). -This will install the latest supported version: - -```bash -composer require clue/ndjson-react:^1.3 -``` - -See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. - -This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.3 through current PHP 8+ and -HHVM. -It's *highly recommended to use the latest supported PHP version* for this project. - -## Tests - -To run the test suite, you first need to clone this repo and then install all -dependencies [through Composer](https://getcomposer.org/): - -```bash -composer install -``` - -To run the test suite, go to the project root and run: - -```bash -vendor/bin/phpunit -``` - -## License - -This project is released under the permissive [MIT license](LICENSE). - -> Did you know that I offer custom development services and issuing invoices for - sponsorships of releases and for contributions? Contact me (@clue) for details. - -## More - -* If you want to learn more about processing streams of data, refer to the documentation of - the underlying [react/stream](https://github.com/reactphp/stream) component. - -* If you want to process compressed NDJSON files (`.ndjson.gz` file extension), - you may want to use [clue/reactphp-zlib](https://github.com/clue/reactphp-zlib) - on the compressed input stream before passing the decompressed stream to the NDJSON decoder. - -* If you want to create compressed NDJSON files (`.ndjson.gz` file extension), - you may want to use [clue/reactphp-zlib](https://github.com/clue/reactphp-zlib) - on the resulting NDJSON encoder output stream before passing the compressed - stream to the file output stream. - -* If you want to concurrently process the records from your NDJSON stream, - you may want to use [clue/reactphp-flux](https://github.com/clue/reactphp-flux) - to concurrently process many (but not too many) records at once. - -* If you want to process structured data in the more common text-based format, - you may want to use [clue/reactphp-csv](https://github.com/clue/reactphp-csv) - to process Comma-Separated-Values (CSV) files (`.csv` file extension). diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/composer.json b/tools/php-cs-fixer/vendor/clue/ndjson-react/composer.json deleted file mode 100644 index 01a4b859..00000000 --- a/tools/php-cs-fixer/vendor/clue/ndjson-react/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "clue/ndjson-react", - "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", - "keywords": ["NDJSON", "newline", "JSON", "jsonlines", "streaming", "ReactPHP"], - "homepage": "https://github.com/clue/reactphp-ndjson", - "license": "MIT", - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "require": { - "php": ">=5.3", - "react/stream": "^1.2" - }, - "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", - "react/event-loop": "^1.2" - }, - "autoload": { - "psr-4": { - "Clue\\React\\NDJson\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Clue\\Tests\\React\\NDJson\\": "tests/" - } - } -} diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Decoder.php b/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Decoder.php deleted file mode 100644 index 876ff2b1..00000000 --- a/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Decoder.php +++ /dev/null @@ -1,166 +0,0 @@ -input = $input; - - if (!$input->isReadable()) { - $this->close(); - return; - } - - $this->assoc = $assoc; - $this->depth = $depth; - $this->options = $options; - $this->maxlength = $maxlength; - - $this->input->on('data', array($this, 'handleData')); - $this->input->on('end', array($this, 'handleEnd')); - $this->input->on('error', array($this, 'handleError')); - $this->input->on('close', array($this, 'close')); - } - - public function isReadable() - { - return !$this->closed; - } - - public function close() - { - if ($this->closed) { - return; - } - - $this->closed = true; - $this->buffer = ''; - - $this->input->close(); - - $this->emit('close'); - $this->removeAllListeners(); - } - - public function pause() - { - $this->input->pause(); - } - - public function resume() - { - $this->input->resume(); - } - - public function pipe(WritableStreamInterface $dest, array $options = array()) - { - Util::pipe($this, $dest, $options); - - return $dest; - } - - /** @internal */ - public function handleData($data) - { - if (!\is_string($data)) { - $this->handleError(new \UnexpectedValueException('Expected stream to emit string, but got ' . \gettype($data))); - return; - } - - $this->buffer .= $data; - - // keep parsing while a newline has been found - while (($newline = \strpos($this->buffer, "\n")) !== false && $newline <= $this->maxlength) { - // read data up until newline and remove from buffer - $data = (string)\substr($this->buffer, 0, $newline); - $this->buffer = (string)\substr($this->buffer, $newline + 1); - - // decode data with options given in ctor - // @codeCoverageIgnoreStart - if ($this->options === 0) { - $data = \json_decode($data, $this->assoc, $this->depth); - } else { - assert(\PHP_VERSION_ID >= 50400); - $data = \json_decode($data, $this->assoc, $this->depth, $this->options); - } - // @codeCoverageIgnoreEnd - - // abort stream if decoding failed - if ($data === null && \json_last_error() !== \JSON_ERROR_NONE) { - // @codeCoverageIgnoreStart - if (\PHP_VERSION_ID > 50500) { - $errstr = \json_last_error_msg(); - } elseif (\json_last_error() === \JSON_ERROR_SYNTAX) { - $errstr = 'Syntax error'; - } else { - $errstr = 'Unknown error'; - } - // @codeCoverageIgnoreEnd - return $this->handleError(new \RuntimeException('Unable to decode JSON: ' . $errstr, \json_last_error())); - } - - $this->emit('data', array($data)); - } - - if (isset($this->buffer[$this->maxlength])) { - $this->handleError(new \OverflowException('Buffer size exceeded')); - } - } - - /** @internal */ - public function handleEnd() - { - if ($this->buffer !== '') { - $this->handleData("\n"); - } - - if (!$this->closed) { - $this->emit('end'); - $this->close(); - } - } - - /** @internal */ - public function handleError(\Exception $error) - { - $this->emit('error', array($error)); - $this->close(); - } -} diff --git a/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Encoder.php b/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Encoder.php deleted file mode 100644 index 30d5c311..00000000 --- a/tools/php-cs-fixer/vendor/clue/ndjson-react/src/Encoder.php +++ /dev/null @@ -1,144 +0,0 @@ -output = $output; - - if (!$output->isWritable()) { - $this->close(); - return; - } - - $this->options = $options; - $this->depth = $depth; - - $this->output->on('drain', array($this, 'handleDrain')); - $this->output->on('error', array($this, 'handleError')); - $this->output->on('close', array($this, 'close')); - } - - public function write($data) - { - if ($this->closed) { - return false; - } - - // we have to handle PHP warnings for legacy PHP < 5.5 - // certain values (such as INF etc.) emit a warning, but still encode successfully - // @codeCoverageIgnoreStart - if (\PHP_VERSION_ID < 50500) { - $errstr = null; - \set_error_handler(function ($_, $error) use (&$errstr) { - $errstr = $error; - }); - - // encode data with options given in ctor (depth not supported) - $data = \json_encode($data, $this->options); - - // always check error code and match missing error messages - \restore_error_handler(); - $errno = \json_last_error(); - if (\defined('JSON_ERROR_UTF8') && $errno === \JSON_ERROR_UTF8) { - // const JSON_ERROR_UTF8 added in PHP 5.3.3, but no error message assigned in legacy PHP < 5.5 - // this overrides PHP 5.3.14 only: https://3v4l.org/IGP8Z#v5314 - $errstr = 'Malformed UTF-8 characters, possibly incorrectly encoded'; - } elseif ($errno !== \JSON_ERROR_NONE && $errstr === null) { - // error number present, but no error message applicable - $errstr = 'Unknown error'; - } - - // abort stream if encoding fails - if ($errno !== \JSON_ERROR_NONE || $errstr !== null) { - $this->handleError(new \RuntimeException('Unable to encode JSON: ' . $errstr, $errno)); - return false; - } - } else { - // encode data with options given in ctor - $data = \json_encode($data, $this->options, $this->depth); - - // abort stream if encoding fails - if ($data === false && \json_last_error() !== \JSON_ERROR_NONE) { - $this->handleError(new \RuntimeException('Unable to encode JSON: ' . \json_last_error_msg(), \json_last_error())); - return false; - } - } - // @codeCoverageIgnoreEnd - - return $this->output->write($data . "\n"); - } - - public function end($data = null) - { - if ($data !== null) { - $this->write($data); - } - - $this->output->end(); - } - - public function isWritable() - { - return !$this->closed; - } - - public function close() - { - if ($this->closed) { - return; - } - - $this->closed = true; - $this->output->close(); - - $this->emit('close'); - $this->removeAllListeners(); - } - - /** @internal */ - public function handleDrain() - { - $this->emit('drain'); - } - - /** @internal */ - public function handleError(\Exception $error) - { - $this->emit('error', array($error)); - $this->close(); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/ClassLoader.php b/tools/php-cs-fixer/vendor/composer/ClassLoader.php deleted file mode 100644 index 7824d8f7..00000000 --- a/tools/php-cs-fixer/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,579 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - /** @var \Closure(string):void */ - private static $includeFile; - - /** @var string|null */ - private $vendorDir; - - // PSR-4 - /** - * @var array> - */ - private $prefixLengthsPsr4 = array(); - /** - * @var array> - */ - private $prefixDirsPsr4 = array(); - /** - * @var list - */ - private $fallbackDirsPsr4 = array(); - - // PSR-0 - /** - * List of PSR-0 prefixes - * - * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) - * - * @var array>> - */ - private $prefixesPsr0 = array(); - /** - * @var list - */ - private $fallbackDirsPsr0 = array(); - - /** @var bool */ - private $useIncludePath = false; - - /** - * @var array - */ - private $classMap = array(); - - /** @var bool */ - private $classMapAuthoritative = false; - - /** - * @var array - */ - private $missingClasses = array(); - - /** @var string|null */ - private $apcuPrefix; - - /** - * @var array - */ - private static $registeredLoaders = array(); - - /** - * @param string|null $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - self::initializeIncludeClosure(); - } - - /** - * @return array> - */ - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - /** - * @return array> - */ - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - /** - * @return list - */ - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - /** - * @return list - */ - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - /** - * @return array Array of classname => path - */ - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - * - * @return void - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void - */ - public function add($prefix, $paths, $prepend = false) - { - $paths = (array) $paths; - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - $paths = (array) $paths; - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 base directories - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - * - * @return void - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - * - * @return void - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - * - * @return void - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - $includeFile = self::$includeFile; - $includeFile($file); - - return true; - } - - return null; - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders keyed by their corresponding vendor directories. - * - * @return array - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } - - /** - * @return void - */ - private static function initializeIncludeClosure() - { - if (self::$includeFile !== null) { - return; - } - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - self::$includeFile = \Closure::bind(static function($file) { - include $file; - }, null, null); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/InstalledVersions.php b/tools/php-cs-fixer/vendor/composer/InstalledVersions.php deleted file mode 100644 index 51e734a7..00000000 --- a/tools/php-cs-fixer/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,359 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - * - * @final - */ -class InstalledVersions -{ - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints((string) $constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require $vendorDir.'/composer/installed.php'; - $installed[] = self::$installedByVendor[$vendorDir] = $required; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require __DIR__ . '/installed.php'; - self::$installed = $required; - } else { - self::$installed = array(); - } - } - - if (self::$installed !== array()) { - $installed[] = self::$installed; - } - - return $installed; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/LICENSE b/tools/php-cs-fixer/vendor/composer/LICENSE deleted file mode 100644 index 62ecfd8d..00000000 --- a/tools/php-cs-fixer/vendor/composer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/composer/autoload_classmap.php b/tools/php-cs-fixer/vendor/composer/autoload_classmap.php deleted file mode 100644 index 1d1b8341..00000000 --- a/tools/php-cs-fixer/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,34 +0,0 @@ - $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', - 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', - 'SebastianBergmann\\Diff\\Chunk' => $vendorDir . '/sebastian/diff/src/Chunk.php', - 'SebastianBergmann\\Diff\\ConfigurationException' => $vendorDir . '/sebastian/diff/src/Exception/ConfigurationException.php', - 'SebastianBergmann\\Diff\\Diff' => $vendorDir . '/sebastian/diff/src/Diff.php', - 'SebastianBergmann\\Diff\\Differ' => $vendorDir . '/sebastian/diff/src/Differ.php', - 'SebastianBergmann\\Diff\\Exception' => $vendorDir . '/sebastian/diff/src/Exception/Exception.php', - 'SebastianBergmann\\Diff\\InvalidArgumentException' => $vendorDir . '/sebastian/diff/src/Exception/InvalidArgumentException.php', - 'SebastianBergmann\\Diff\\Line' => $vendorDir . '/sebastian/diff/src/Line.php', - 'SebastianBergmann\\Diff\\LongestCommonSubsequenceCalculator' => $vendorDir . '/sebastian/diff/src/LongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\MemoryEfficientLongestCommonSubsequenceCalculator' => $vendorDir . '/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\Output\\AbstractChunkOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOnlyOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOutputBuilderInterface' => $vendorDir . '/sebastian/diff/src/Output/DiffOutputBuilderInterface.php', - 'SebastianBergmann\\Diff\\Output\\StrictUnifiedDiffOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\UnifiedDiffOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Parser' => $vendorDir . '/sebastian/diff/src/Parser.php', - 'SebastianBergmann\\Diff\\TimeEfficientLongestCommonSubsequenceCalculator' => $vendorDir . '/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php', - 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', -); diff --git a/tools/php-cs-fixer/vendor/composer/autoload_files.php b/tools/php-cs-fixer/vendor/composer/autoload_files.php deleted file mode 100644 index 758ec42f..00000000 --- a/tools/php-cs-fixer/vendor/composer/autoload_files.php +++ /dev/null @@ -1,18 +0,0 @@ - $vendorDir . '/react/promise/src/functions_include.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', -); diff --git a/tools/php-cs-fixer/vendor/composer/autoload_namespaces.php b/tools/php-cs-fixer/vendor/composer/autoload_namespaces.php deleted file mode 100644 index 15a2ff3a..00000000 --- a/tools/php-cs-fixer/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ - array($vendorDir . '/symfony/polyfill-php81'), - 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'), - 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), - 'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'), - 'Symfony\\Contracts\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher-contracts'), - 'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'), - 'Symfony\\Component\\Stopwatch\\' => array($vendorDir . '/symfony/stopwatch'), - 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), - 'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'), - 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'), - 'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'), - 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), - 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), - 'React\\Stream\\' => array($vendorDir . '/react/stream/src'), - 'React\\Socket\\' => array($vendorDir . '/react/socket/src'), - 'React\\Promise\\' => array($vendorDir . '/react/promise/src'), - 'React\\EventLoop\\' => array($vendorDir . '/react/event-loop/src'), - 'React\\Dns\\' => array($vendorDir . '/react/dns/src'), - 'React\\ChildProcess\\' => array($vendorDir . '/react/child-process/src'), - 'React\\Cache\\' => array($vendorDir . '/react/cache/src'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), - 'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'), - 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), - 'PhpCsFixer\\' => array($vendorDir . '/friendsofphp/php-cs-fixer/src'), - 'Fidry\\CpuCoreCounter\\' => array($vendorDir . '/fidry/cpu-core-counter/src'), - 'Evenement\\' => array($vendorDir . '/evenement/evenement/src'), - 'Composer\\XdebugHandler\\' => array($vendorDir . '/composer/xdebug-handler/src'), - 'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'), - 'Composer\\Pcre\\' => array($vendorDir . '/composer/pcre/src'), - 'Clue\\React\\NDJson\\' => array($vendorDir . '/clue/ndjson-react/src'), -); diff --git a/tools/php-cs-fixer/vendor/composer/autoload_real.php b/tools/php-cs-fixer/vendor/composer/autoload_real.php deleted file mode 100644 index 79ef3fb8..00000000 --- a/tools/php-cs-fixer/vendor/composer/autoload_real.php +++ /dev/null @@ -1,50 +0,0 @@ -register(true); - - $filesToLoad = \Composer\Autoload\ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74::$files; - $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } - }, null, null); - foreach ($filesToLoad as $fileIdentifier => $file) { - $requireFile($fileIdentifier, $file); - } - - return $loader; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/autoload_static.php b/tools/php-cs-fixer/vendor/composer/autoload_static.php deleted file mode 100644 index 508ac083..00000000 --- a/tools/php-cs-fixer/vendor/composer/autoload_static.php +++ /dev/null @@ -1,247 +0,0 @@ - __DIR__ . '/..' . '/react/promise/src/functions_include.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', - ); - - public static $prefixLengthsPsr4 = array ( - 'S' => - array ( - 'Symfony\\Polyfill\\Php81\\' => 23, - 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => 31, - 'Symfony\\Polyfill\\Ctype\\' => 23, - 'Symfony\\Contracts\\Service\\' => 26, - 'Symfony\\Contracts\\EventDispatcher\\' => 34, - 'Symfony\\Component\\String\\' => 25, - 'Symfony\\Component\\Stopwatch\\' => 28, - 'Symfony\\Component\\Process\\' => 26, - 'Symfony\\Component\\OptionsResolver\\' => 34, - 'Symfony\\Component\\Finder\\' => 25, - 'Symfony\\Component\\Filesystem\\' => 29, - 'Symfony\\Component\\EventDispatcher\\' => 34, - 'Symfony\\Component\\Console\\' => 26, - ), - 'R' => - array ( - 'React\\Stream\\' => 13, - 'React\\Socket\\' => 13, - 'React\\Promise\\' => 14, - 'React\\EventLoop\\' => 16, - 'React\\Dns\\' => 10, - 'React\\ChildProcess\\' => 19, - 'React\\Cache\\' => 12, - ), - 'P' => - array ( - 'Psr\\Log\\' => 8, - 'Psr\\EventDispatcher\\' => 20, - 'Psr\\Container\\' => 14, - 'PhpCsFixer\\' => 11, - ), - 'F' => - array ( - 'Fidry\\CpuCoreCounter\\' => 21, - ), - 'E' => - array ( - 'Evenement\\' => 10, - ), - 'C' => - array ( - 'Composer\\XdebugHandler\\' => 23, - 'Composer\\Semver\\' => 16, - 'Composer\\Pcre\\' => 14, - 'Clue\\React\\NDJson\\' => 18, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'Symfony\\Polyfill\\Php81\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php81', - ), - 'Symfony\\Polyfill\\Php80\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', - ), - 'Symfony\\Polyfill\\Mbstring\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', - ), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', - ), - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme', - ), - 'Symfony\\Polyfill\\Ctype\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', - ), - 'Symfony\\Contracts\\Service\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/service-contracts', - ), - 'Symfony\\Contracts\\EventDispatcher\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/event-dispatcher-contracts', - ), - 'Symfony\\Component\\String\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/string', - ), - 'Symfony\\Component\\Stopwatch\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/stopwatch', - ), - 'Symfony\\Component\\Process\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/process', - ), - 'Symfony\\Component\\OptionsResolver\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/options-resolver', - ), - 'Symfony\\Component\\Finder\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/finder', - ), - 'Symfony\\Component\\Filesystem\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/filesystem', - ), - 'Symfony\\Component\\EventDispatcher\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/event-dispatcher', - ), - 'Symfony\\Component\\Console\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/console', - ), - 'React\\Stream\\' => - array ( - 0 => __DIR__ . '/..' . '/react/stream/src', - ), - 'React\\Socket\\' => - array ( - 0 => __DIR__ . '/..' . '/react/socket/src', - ), - 'React\\Promise\\' => - array ( - 0 => __DIR__ . '/..' . '/react/promise/src', - ), - 'React\\EventLoop\\' => - array ( - 0 => __DIR__ . '/..' . '/react/event-loop/src', - ), - 'React\\Dns\\' => - array ( - 0 => __DIR__ . '/..' . '/react/dns/src', - ), - 'React\\ChildProcess\\' => - array ( - 0 => __DIR__ . '/..' . '/react/child-process/src', - ), - 'React\\Cache\\' => - array ( - 0 => __DIR__ . '/..' . '/react/cache/src', - ), - 'Psr\\Log\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/log/src', - ), - 'Psr\\EventDispatcher\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/event-dispatcher/src', - ), - 'Psr\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/container/src', - ), - 'PhpCsFixer\\' => - array ( - 0 => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src', - ), - 'Fidry\\CpuCoreCounter\\' => - array ( - 0 => __DIR__ . '/..' . '/fidry/cpu-core-counter/src', - ), - 'Evenement\\' => - array ( - 0 => __DIR__ . '/..' . '/evenement/evenement/src', - ), - 'Composer\\XdebugHandler\\' => - array ( - 0 => __DIR__ . '/..' . '/composer/xdebug-handler/src', - ), - 'Composer\\Semver\\' => - array ( - 0 => __DIR__ . '/..' . '/composer/semver/src', - ), - 'Composer\\Pcre\\' => - array ( - 0 => __DIR__ . '/..' . '/composer/pcre/src', - ), - 'Clue\\React\\NDJson\\' => - array ( - 0 => __DIR__ . '/..' . '/clue/ndjson-react/src', - ), - ); - - public static $classMap = array ( - 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'CURLStringFile' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', - 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', - 'SebastianBergmann\\Diff\\Chunk' => __DIR__ . '/..' . '/sebastian/diff/src/Chunk.php', - 'SebastianBergmann\\Diff\\ConfigurationException' => __DIR__ . '/..' . '/sebastian/diff/src/Exception/ConfigurationException.php', - 'SebastianBergmann\\Diff\\Diff' => __DIR__ . '/..' . '/sebastian/diff/src/Diff.php', - 'SebastianBergmann\\Diff\\Differ' => __DIR__ . '/..' . '/sebastian/diff/src/Differ.php', - 'SebastianBergmann\\Diff\\Exception' => __DIR__ . '/..' . '/sebastian/diff/src/Exception/Exception.php', - 'SebastianBergmann\\Diff\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/diff/src/Exception/InvalidArgumentException.php', - 'SebastianBergmann\\Diff\\Line' => __DIR__ . '/..' . '/sebastian/diff/src/Line.php', - 'SebastianBergmann\\Diff\\LongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/sebastian/diff/src/LongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\MemoryEfficientLongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\Output\\AbstractChunkOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOnlyOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOutputBuilderInterface' => __DIR__ . '/..' . '/sebastian/diff/src/Output/DiffOutputBuilderInterface.php', - 'SebastianBergmann\\Diff\\Output\\StrictUnifiedDiffOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\UnifiedDiffOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Parser' => __DIR__ . '/..' . '/sebastian/diff/src/Parser.php', - 'SebastianBergmann\\Diff\\TimeEfficientLongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php', - 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit5d6f4352aed43a8d4e8a161c85a71e74::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/installed.json b/tools/php-cs-fixer/vendor/composer/installed.json deleted file mode 100644 index 642d68a1..00000000 --- a/tools/php-cs-fixer/vendor/composer/installed.json +++ /dev/null @@ -1,2638 +0,0 @@ -{ - "packages": [ - { - "name": "clue/ndjson-react", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/clue/reactphp-ndjson.git", - "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", - "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "react/stream": "^1.2" - }, - "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", - "react/event-loop": "^1.2" - }, - "time": "2022-12-23T10:58:28+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Clue\\React\\NDJson\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", - "homepage": "https://github.com/clue/reactphp-ndjson", - "keywords": [ - "NDJSON", - "json", - "jsonlines", - "newline", - "reactphp", - "streaming" - ], - "support": { - "issues": "https://github.com/clue/reactphp-ndjson/issues", - "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" - }, - "funding": [ - { - "url": "https://clue.engineering/support", - "type": "custom" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "install-path": "../clue/ndjson-react" - }, - { - "name": "composer/pcre", - "version": "3.3.2", - "version_normalized": "3.3.2.0", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<1.11.10" - }, - "require-dev": { - "phpstan/phpstan": "^1.12 || ^2", - "phpstan/phpstan-strict-rules": "^1 || ^2", - "phpunit/phpunit": "^8 || ^9" - }, - "time": "2024-11-12T16:29:46+00:00", - "type": "library", - "extra": { - "phpstan": { - "includes": [ - "extension.neon" - ] - }, - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.2" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "install-path": "./pcre" - }, - { - "name": "composer/semver", - "version": "3.4.3", - "version_normalized": "3.4.3.0", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.11", - "symfony/phpunit-bridge": "^3 || ^7" - }, - "time": "2024-09-19T14:15:21+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.3" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "install-path": "./semver" - }, - { - "name": "composer/xdebug-handler", - "version": "3.0.5", - "version_normalized": "3.0.5.0", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", - "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" - }, - "time": "2024-05-06T16:37:16+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "install-path": "./xdebug-handler" - }, - { - "name": "evenement/evenement", - "version": "v3.0.2", - "version_normalized": "3.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/igorw/evenement.git", - "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", - "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^9 || ^6" - }, - "time": "2023-08-08T05:53:35+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Evenement\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "description": "Événement is a very simple event dispatching library for PHP", - "keywords": [ - "event-dispatcher", - "event-emitter" - ], - "support": { - "issues": "https://github.com/igorw/evenement/issues", - "source": "https://github.com/igorw/evenement/tree/v3.0.2" - }, - "install-path": "../evenement/evenement" - }, - { - "name": "fidry/cpu-core-counter", - "version": "1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "8520451a140d3f46ac33042715115e290cf5785f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", - "reference": "8520451a140d3f46ac33042715115e290cf5785f", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "fidry/makefile": "^0.2.0", - "fidry/php-cs-fixer-config": "^1.1.2", - "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan-phpunit": "^1.2.2", - "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^8.5.31 || ^9.5.26", - "webmozarts/strict-phpunit": "^7.5" - }, - "time": "2024-08-06T10:04:20+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Fidry\\CpuCoreCounter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com" - } - ], - "description": "Tiny utility to get the number of CPU cores.", - "keywords": [ - "CPU", - "core" - ], - "support": { - "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" - }, - "funding": [ - { - "url": "https://github.com/theofidry", - "type": "github" - } - ], - "install-path": "../fidry/cpu-core-counter" - }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.68.1", - "version_normalized": "3.68.1.0", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b9db2b2ea3cdba7201067acee46f984ef2397cff", - "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff", - "shasum": "" - }, - "require": { - "clue/ndjson-react": "^1.0", - "composer/semver": "^3.4", - "composer/xdebug-handler": "^3.0.3", - "ext-filter": "*", - "ext-json": "*", - "ext-tokenizer": "*", - "fidry/cpu-core-counter": "^1.2", - "php": "^7.4 || ^8.0", - "react/child-process": "^0.6.5", - "react/event-loop": "^1.0", - "react/promise": "^2.0 || ^3.0", - "react/socket": "^1.0", - "react/stream": "^1.0", - "sebastian/diff": "^4.0 || ^5.1 || ^6.0", - "symfony/console": "^5.4 || ^6.4 || ^7.0", - "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", - "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", - "symfony/finder": "^5.4 || ^6.4 || ^7.0", - "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", - "symfony/polyfill-mbstring": "^1.31", - "symfony/polyfill-php80": "^1.31", - "symfony/polyfill-php81": "^1.31", - "symfony/process": "^5.4 || ^6.4 || ^7.2", - "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" - }, - "require-dev": { - "facile-it/paraunit": "^1.3.1 || ^2.4", - "infection/infection": "^0.29.8", - "justinrainbow/json-schema": "^5.3 || ^6.0", - "keradus/cli-executor": "^2.1", - "mikey179/vfsstream": "^1.6.12", - "php-coveralls/php-coveralls": "^2.7", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", - "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", - "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", - "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "time": "2025-01-17T09:20:36+00:00", - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "installation-source": "dist", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, - "exclude-from-classmap": [ - "src/Fixer/Internal/*" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "keywords": [ - "Static code analysis", - "fixer", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.1" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "install-path": "../friendsofphp/php-cs-fixer" - }, - { - "name": "psr/container", - "version": "2.0.2", - "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "time": "2021-11-05T16:47:00+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "install-path": "../psr/container" - }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "time": "2019-01-08T18:20:26+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" - }, - "install-path": "../psr/event-dispatcher" - }, - { - "name": "psr/log", - "version": "3.0.2", - "version_normalized": "3.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "time": "2024-09-11T13:17:53+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" - }, - "install-path": "../psr/log" - }, - { - "name": "react/cache", - "version": "v1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/cache.git", - "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", - "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "react/promise": "^3.0 || ^2.0 || ^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" - }, - "time": "2022-11-30T15:59:55+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async, Promise-based cache interface for ReactPHP", - "keywords": [ - "cache", - "caching", - "promise", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/cache/issues", - "source": "https://github.com/reactphp/cache/tree/v1.2.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "install-path": "../react/cache" - }, - { - "name": "react/child-process", - "version": "v0.6.6", - "version_normalized": "0.6.6.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/child-process.git", - "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", - "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.0", - "react/event-loop": "^1.2", - "react/stream": "^1.4" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/socket": "^1.16", - "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" - }, - "time": "2025-01-01T16:37:48+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\ChildProcess\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Event-driven library for executing child processes with ReactPHP.", - "keywords": [ - "event-driven", - "process", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/child-process/issues", - "source": "https://github.com/reactphp/child-process/tree/v0.6.6" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "install-path": "../react/child-process" - }, - { - "name": "react/dns", - "version": "v1.13.0", - "version_normalized": "1.13.0.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/dns.git", - "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", - "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "react/cache": "^1.0 || ^0.6 || ^0.5", - "react/event-loop": "^1.2", - "react/promise": "^3.2 || ^2.7 || ^1.2.1" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4.3 || ^3 || ^2", - "react/promise-timer": "^1.11" - }, - "time": "2024-06-13T14:18:03+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Dns\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async DNS resolver for ReactPHP", - "keywords": [ - "async", - "dns", - "dns-resolver", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/dns/issues", - "source": "https://github.com/reactphp/dns/tree/v1.13.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "install-path": "../react/dns" - }, - { - "name": "react/event-loop", - "version": "v1.5.0", - "version_normalized": "1.5.0.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/event-loop.git", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "suggest": { - "ext-pcntl": "For signal handling support when using the StreamSelectLoop" - }, - "time": "2023-11-13T13:48:05+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\EventLoop\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", - "keywords": [ - "asynchronous", - "event-loop" - ], - "support": { - "issues": "https://github.com/reactphp/event-loop/issues", - "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "install-path": "../react/event-loop" - }, - { - "name": "react/promise", - "version": "v3.2.0", - "version_normalized": "3.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63", - "shasum": "" - }, - "require": { - "php": ">=7.1.0" - }, - "require-dev": { - "phpstan/phpstan": "1.10.39 || 1.4.10", - "phpunit/phpunit": "^9.6 || ^7.5" - }, - "time": "2024-05-24T10:39:05+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v3.2.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "install-path": "../react/promise" - }, - { - "name": "react/socket", - "version": "v1.16.0", - "version_normalized": "1.16.0.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/socket.git", - "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", - "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.0", - "react/dns": "^1.13", - "react/event-loop": "^1.2", - "react/promise": "^3.2 || ^2.6 || ^1.2.1", - "react/stream": "^1.4" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4.3 || ^3.3 || ^2", - "react/promise-stream": "^1.4", - "react/promise-timer": "^1.11" - }, - "time": "2024-07-26T10:38:09+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Socket\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", - "keywords": [ - "Connection", - "Socket", - "async", - "reactphp", - "stream" - ], - "support": { - "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.16.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "install-path": "../react/socket" - }, - { - "name": "react/stream", - "version": "v1.4.0", - "version_normalized": "1.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/stream.git", - "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", - "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.8", - "react/event-loop": "^1.2" - }, - "require-dev": { - "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "time": "2024-06-11T12:45:25+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", - "keywords": [ - "event-driven", - "io", - "non-blocking", - "pipe", - "reactphp", - "readable", - "stream", - "writable" - ], - "support": { - "issues": "https://github.com/reactphp/stream/issues", - "source": "https://github.com/reactphp/stream/tree/v1.4.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "install-path": "../react/stream" - }, - { - "name": "sebastian/diff", - "version": "6.0.2", - "version_normalized": "6.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", - "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "require-dev": { - "phpunit/phpunit": "^11.0", - "symfony/process": "^4.2 || ^5" - }, - "time": "2024-07-03T04:53:05+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "6.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/diff" - }, - { - "name": "symfony/console", - "version": "v7.2.1", - "version_normalized": "7.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", - "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^6.4|^7.0" - }, - "conflict": { - "symfony/dependency-injection": "<6.4", - "symfony/dotenv": "<6.4", - "symfony/event-dispatcher": "<6.4", - "symfony/lock": "<6.4", - "symfony/process": "<6.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/event-dispatcher": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^6.4|^7.0", - "symfony/messenger": "^6.4|^7.0", - "symfony/process": "^6.4|^7.0", - "symfony/stopwatch": "^6.4|^7.0", - "symfony/var-dumper": "^6.4|^7.0" - }, - "time": "2024-12-11T03:49:26+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v7.2.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/console" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.5.1", - "version_normalized": "3.5.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", - "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "time": "2024-09-25T14:20:29+00:00", - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/deprecation-contracts" - }, - { - "name": "symfony/event-dispatcher", - "version": "v7.2.0", - "version_normalized": "7.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", - "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/event-dispatcher-contracts": "^2.5|^3" - }, - "conflict": { - "symfony/dependency-injection": "<6.4", - "symfony/service-contracts": "<2.5" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/error-handler": "^6.4|^7.0", - "symfony/expression-language": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^6.4|^7.0" - }, - "time": "2024-09-25T14:21:43+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/event-dispatcher" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v3.5.1", - "version_normalized": "3.5.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", - "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/event-dispatcher": "^1" - }, - "time": "2024-09-25T14:20:29+00:00", - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/event-dispatcher-contracts" - }, - { - "name": "symfony/filesystem", - "version": "v7.2.0", - "version_normalized": "7.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", - "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "require-dev": { - "symfony/process": "^6.4|^7.0" - }, - "time": "2024-10-25T15:15:23+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.2.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/filesystem" - }, - { - "name": "symfony/finder", - "version": "v7.2.2", - "version_normalized": "7.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "require-dev": { - "symfony/filesystem": "^6.4|^7.0" - }, - "time": "2024-12-30T19:00:17+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v7.2.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/finder" - }, - { - "name": "symfony/options-resolver", - "version": "v7.2.0", - "version_normalized": "7.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "time": "2024-11-20T11:17:29+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/options-resolver" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.31.0", - "version_normalized": "1.31.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "time": "2024-09-09T11:45:10+00:00", - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-ctype" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.31.0", - "version_normalized": "1.31.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2024-09-09T11:45:10+00:00", - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-intl-grapheme" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.31.0", - "version_normalized": "1.31.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "3833d7255cc303546435cb650316bff708a1c75c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", - "reference": "3833d7255cc303546435cb650316bff708a1c75c", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2024-09-09T11:45:10+00:00", - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-intl-normalizer" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", - "version_normalized": "1.31.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2024-09-09T11:45:10+00:00", - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-mbstring" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.31.0", - "version_normalized": "1.31.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "time": "2024-09-09T11:45:10+00:00", - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php80" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.31.0", - "version_normalized": "1.31.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "time": "2024-09-09T11:45:10+00:00", - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php81" - }, - { - "name": "symfony/process", - "version": "v7.2.0", - "version_normalized": "7.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", - "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "time": "2024-11-06T14:24:19+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v7.2.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/process" - }, - { - "name": "symfony/service-contracts", - "version": "v3.5.1", - "version_normalized": "3.5.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", - "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "time": "2024-09-25T14:20:29+00:00", - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/service-contracts" - }, - { - "name": "symfony/stopwatch", - "version": "v7.2.2", - "version_normalized": "7.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e46690d5b9d7164a6d061cab1e8d46141b9f49df", - "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/service-contracts": "^2.5|^3" - }, - "time": "2024-12-18T14:28:33+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.2.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/stopwatch" - }, - { - "name": "symfony/string", - "version": "v7.2.0", - "version_normalized": "7.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.5" - }, - "require-dev": { - "symfony/emoji": "^7.1", - "symfony/error-handler": "^6.4|^7.0", - "symfony/http-client": "^6.4|^7.0", - "symfony/intl": "^6.4|^7.0", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0" - }, - "time": "2024-11-13T13:31:26+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v7.2.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/string" - } - ], - "dev": true, - "dev-package-names": [] -} diff --git a/tools/php-cs-fixer/vendor/composer/installed.php b/tools/php-cs-fixer/vendor/composer/installed.php deleted file mode 100644 index 08936f96..00000000 --- a/tools/php-cs-fixer/vendor/composer/installed.php +++ /dev/null @@ -1,356 +0,0 @@ - array( - 'name' => '__root__', - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'reference' => '2bde5f165e4b817c6a725d0b503c7bfeb01e467f', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev' => true, - ), - 'versions' => array( - '__root__' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'reference' => '2bde5f165e4b817c6a725d0b503c7bfeb01e467f', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'clue/ndjson-react' => array( - 'pretty_version' => 'v1.3.0', - 'version' => '1.3.0.0', - 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../clue/ndjson-react', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'composer/pcre' => array( - 'pretty_version' => '3.3.2', - 'version' => '3.3.2.0', - 'reference' => 'b2bed4734f0cc156ee1fe9c0da2550420d99a21e', - 'type' => 'library', - 'install_path' => __DIR__ . '/./pcre', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'composer/semver' => array( - 'pretty_version' => '3.4.3', - 'version' => '3.4.3.0', - 'reference' => '4313d26ada5e0c4edfbd1dc481a92ff7bff91f12', - 'type' => 'library', - 'install_path' => __DIR__ . '/./semver', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'composer/xdebug-handler' => array( - 'pretty_version' => '3.0.5', - 'version' => '3.0.5.0', - 'reference' => '6c1925561632e83d60a44492e0b344cf48ab85ef', - 'type' => 'library', - 'install_path' => __DIR__ . '/./xdebug-handler', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'evenement/evenement' => array( - 'pretty_version' => 'v3.0.2', - 'version' => '3.0.2.0', - 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', - 'type' => 'library', - 'install_path' => __DIR__ . '/../evenement/evenement', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'fidry/cpu-core-counter' => array( - 'pretty_version' => '1.2.0', - 'version' => '1.2.0.0', - 'reference' => '8520451a140d3f46ac33042715115e290cf5785f', - 'type' => 'library', - 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'friendsofphp/php-cs-fixer' => array( - 'pretty_version' => 'v3.68.1', - 'version' => '3.68.1.0', - 'reference' => 'b9db2b2ea3cdba7201067acee46f984ef2397cff', - 'type' => 'application', - 'install_path' => __DIR__ . '/../friendsofphp/php-cs-fixer', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'psr/container' => array( - 'pretty_version' => '2.0.2', - 'version' => '2.0.2.0', - 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/container', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'psr/event-dispatcher' => array( - 'pretty_version' => '1.0.0', - 'version' => '1.0.0.0', - 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/event-dispatcher', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'psr/event-dispatcher-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/log' => array( - 'pretty_version' => '3.0.2', - 'version' => '3.0.2.0', - 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/log', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'psr/log-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0|2.0|3.0', - ), - ), - 'react/cache' => array( - 'pretty_version' => 'v1.2.0', - 'version' => '1.2.0.0', - 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', - 'type' => 'library', - 'install_path' => __DIR__ . '/../react/cache', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'react/child-process' => array( - 'pretty_version' => 'v0.6.6', - 'version' => '0.6.6.0', - 'reference' => '1721e2b93d89b745664353b9cfc8f155ba8a6159', - 'type' => 'library', - 'install_path' => __DIR__ . '/../react/child-process', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'react/dns' => array( - 'pretty_version' => 'v1.13.0', - 'version' => '1.13.0.0', - 'reference' => 'eb8ae001b5a455665c89c1df97f6fb682f8fb0f5', - 'type' => 'library', - 'install_path' => __DIR__ . '/../react/dns', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'react/event-loop' => array( - 'pretty_version' => 'v1.5.0', - 'version' => '1.5.0.0', - 'reference' => 'bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354', - 'type' => 'library', - 'install_path' => __DIR__ . '/../react/event-loop', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'react/promise' => array( - 'pretty_version' => 'v3.2.0', - 'version' => '3.2.0.0', - 'reference' => '8a164643313c71354582dc850b42b33fa12a4b63', - 'type' => 'library', - 'install_path' => __DIR__ . '/../react/promise', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'react/socket' => array( - 'pretty_version' => 'v1.16.0', - 'version' => '1.16.0.0', - 'reference' => '23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1', - 'type' => 'library', - 'install_path' => __DIR__ . '/../react/socket', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'react/stream' => array( - 'pretty_version' => 'v1.4.0', - 'version' => '1.4.0.0', - 'reference' => '1e5b0acb8fe55143b5b426817155190eb6f5b18d', - 'type' => 'library', - 'install_path' => __DIR__ . '/../react/stream', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'sebastian/diff' => array( - 'pretty_version' => '6.0.2', - 'version' => '6.0.2.0', - 'reference' => 'b4ccd857127db5d41a5b676f24b51371d76d8544', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/diff', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/console' => array( - 'pretty_version' => 'v7.2.1', - 'version' => '7.2.1.0', - 'reference' => 'fefcc18c0f5d0efe3ab3152f15857298868dc2c3', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/console', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.5.1', - 'version' => '3.5.1.0', - 'reference' => '74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/event-dispatcher' => array( - 'pretty_version' => 'v7.2.0', - 'version' => '7.2.0.0', - 'reference' => '910c5db85a5356d0fea57680defec4e99eb9c8c1', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/event-dispatcher', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/event-dispatcher-contracts' => array( - 'pretty_version' => 'v3.5.1', - 'version' => '3.5.1.0', - 'reference' => '7642f5e970b672283b7823222ae8ef8bbc160b9f', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/event-dispatcher-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '2.0|3.0', - ), - ), - 'symfony/filesystem' => array( - 'pretty_version' => 'v7.2.0', - 'version' => '7.2.0.0', - 'reference' => 'b8dce482de9d7c9fe2891155035a7248ab5c7fdb', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/filesystem', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/finder' => array( - 'pretty_version' => 'v7.2.2', - 'version' => '7.2.2.0', - 'reference' => '87a71856f2f56e4100373e92529eed3171695cfb', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/finder', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/options-resolver' => array( - 'pretty_version' => 'v7.2.0', - 'version' => '7.2.0.0', - 'reference' => '7da8fbac9dcfef75ffc212235d76b2754ce0cf50', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/options-resolver', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.31.0', - 'version' => '1.31.0.0', - 'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.31.0', - 'version' => '1.31.0.0', - 'reference' => 'b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.31.0', - 'version' => '1.31.0.0', - 'reference' => '3833d7255cc303546435cb650316bff708a1c75c', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.31.0', - 'version' => '1.31.0.0', - 'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.31.0', - 'version' => '1.31.0.0', - 'reference' => '60328e362d4c2c802a54fcbf04f9d3fb892b4cf8', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php80', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-php81' => array( - 'pretty_version' => 'v1.31.0', - 'version' => '1.31.0.0', - 'reference' => '4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php81', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/process' => array( - 'pretty_version' => 'v7.2.0', - 'version' => '7.2.0.0', - 'reference' => 'd34b22ba9390ec19d2dd966c40aa9e8462f27a7e', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/process', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/service-contracts' => array( - 'pretty_version' => 'v3.5.1', - 'version' => '3.5.1.0', - 'reference' => 'e53260aabf78fb3d63f8d79d69ece59f80d5eda0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/service-contracts', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/stopwatch' => array( - 'pretty_version' => 'v7.2.2', - 'version' => '7.2.2.0', - 'reference' => 'e46690d5b9d7164a6d061cab1e8d46141b9f49df', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/stopwatch', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/string' => array( - 'pretty_version' => 'v7.2.0', - 'version' => '7.2.0.0', - 'reference' => '446e0d146f991dde3e73f45f2c97a9faad773c82', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/string', - 'aliases' => array(), - 'dev_requirement' => false, - ), - ), -); diff --git a/tools/php-cs-fixer/vendor/composer/pcre/LICENSE b/tools/php-cs-fixer/vendor/composer/pcre/LICENSE deleted file mode 100644 index c5a282ff..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2021 Composer - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/composer/pcre/README.md b/tools/php-cs-fixer/vendor/composer/pcre/README.md deleted file mode 100644 index 49065149..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/README.md +++ /dev/null @@ -1,189 +0,0 @@ -composer/pcre -============= - -PCRE wrapping library that offers type-safe `preg_*` replacements. - -This library gives you a way to ensure `preg_*` functions do not fail silently, returning -unexpected `null`s that may not be handled. - -As of 3.0 this library enforces [`PREG_UNMATCHED_AS_NULL`](#preg_unmatched_as_null) usage -for all matching and replaceCallback functions, [read more below](#preg_unmatched_as_null) -to understand the implications. - -It thus makes it easier to work with static analysis tools like PHPStan or Psalm as it -simplifies and reduces the possible return values from all the `preg_*` functions which -are quite packed with edge cases. As of v2.2.0 / v3.2.0 the library also comes with a -[PHPStan extension](#phpstan-extension) for parsing regular expressions and giving you even better output types. - -This library is a thin wrapper around `preg_*` functions with [some limitations](#restrictions--limitations). -If you are looking for a richer API to handle regular expressions have a look at -[rawr/t-regx](https://packagist.org/packages/rawr/t-regx) instead. - -[![Continuous Integration](https://github.com/composer/pcre/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/composer/pcre/actions) - - -Installation ------------- - -Install the latest version with: - -```bash -$ composer require composer/pcre -``` - - -Requirements ------------- - -* PHP 7.4.0 is required for 3.x versions -* PHP 7.2.0 is required for 2.x versions -* PHP 5.3.2 is required for 1.x versions - - -Basic usage ------------ - -Instead of: - -```php -if (preg_match('{fo+}', $string, $matches)) { ... } -if (preg_match('{fo+}', $string, $matches, PREG_OFFSET_CAPTURE)) { ... } -if (preg_match_all('{fo+}', $string, $matches)) { ... } -$newString = preg_replace('{fo+}', 'bar', $string); -$newString = preg_replace_callback('{fo+}', function ($match) { return strtoupper($match[0]); }, $string); -$newString = preg_replace_callback_array(['{fo+}' => fn ($match) => strtoupper($match[0])], $string); -$filtered = preg_grep('{[a-z]}', $elements); -$array = preg_split('{[a-z]+}', $string); -``` - -You can now call these on the `Preg` class: - -```php -use Composer\Pcre\Preg; - -if (Preg::match('{fo+}', $string, $matches)) { ... } -if (Preg::matchWithOffsets('{fo+}', $string, $matches)) { ... } -if (Preg::matchAll('{fo+}', $string, $matches)) { ... } -$newString = Preg::replace('{fo+}', 'bar', $string); -$newString = Preg::replaceCallback('{fo+}', function ($match) { return strtoupper($match[0]); }, $string); -$newString = Preg::replaceCallbackArray(['{fo+}' => fn ($match) => strtoupper($match[0])], $string); -$filtered = Preg::grep('{[a-z]}', $elements); -$array = Preg::split('{[a-z]+}', $string); -``` - -The main difference is if anything fails to match/replace/.., it will throw a `Composer\Pcre\PcreException` -instead of returning `null` (or false in some cases), so you can now use the return values safely relying on -the fact that they can only be strings (for replace), ints (for match) or arrays (for grep/split). - -Additionally the `Preg` class provides match methods that return `bool` rather than `int`, for stricter type safety -when the number of pattern matches is not useful: - -```php -use Composer\Pcre\Preg; - -if (Preg::isMatch('{fo+}', $string, $matches)) // bool -if (Preg::isMatchAll('{fo+}', $string, $matches)) // bool -``` - -Finally the `Preg` class provides a few `*StrictGroups` method variants that ensure match groups -are always present and thus non-nullable, making it easier to write type-safe code: - -```php -use Composer\Pcre\Preg; - -// $matches is guaranteed to be an array of strings, if a subpattern does not match and produces a null it will throw -if (Preg::matchStrictGroups('{fo+}', $string, $matches)) -if (Preg::matchAllStrictGroups('{fo+}', $string, $matches)) -``` - -**Note:** This is generally safe to use as long as you do not have optional subpatterns (i.e. `(something)?` -or `(something)*` or branches with a `|` that result in some groups not being matched at all). -A subpattern that can match an empty string like `(.*)` is **not** optional, it will be present as an -empty string in the matches. A non-matching subpattern, even if optional like `(?:foo)?` will anyway not be present in -matches so it is also not a problem to use these with `*StrictGroups` methods. - -If you would prefer a slightly more verbose usage, replacing by-ref arguments by result objects, you can use the `Regex` class: - -```php -use Composer\Pcre\Regex; - -// this is useful when you are just interested in knowing if something matched -// as it returns a bool instead of int(1/0) for match -$bool = Regex::isMatch('{fo+}', $string); - -$result = Regex::match('{fo+}', $string); -if ($result->matched) { something($result->matches); } - -$result = Regex::matchWithOffsets('{fo+}', $string); -if ($result->matched) { something($result->matches); } - -$result = Regex::matchAll('{fo+}', $string); -if ($result->matched && $result->count > 3) { something($result->matches); } - -$newString = Regex::replace('{fo+}', 'bar', $string)->result; -$newString = Regex::replaceCallback('{fo+}', function ($match) { return strtoupper($match[0]); }, $string)->result; -$newString = Regex::replaceCallbackArray(['{fo+}' => fn ($match) => strtoupper($match[0])], $string)->result; -``` - -Note that `preg_grep` and `preg_split` are only callable via the `Preg` class as they do not have -complex return types warranting a specific result object. - -See the [MatchResult](src/MatchResult.php), [MatchWithOffsetsResult](src/MatchWithOffsetsResult.php), [MatchAllResult](src/MatchAllResult.php), -[MatchAllWithOffsetsResult](src/MatchAllWithOffsetsResult.php), and [ReplaceResult](src/ReplaceResult.php) class sources for more details. - -Restrictions / Limitations --------------------------- - -Due to type safety requirements a few restrictions are in place. - -- matching using `PREG_OFFSET_CAPTURE` is made available via `matchWithOffsets` and `matchAllWithOffsets`. - You cannot pass the flag to `match`/`matchAll`. -- `Preg::split` will also reject `PREG_SPLIT_OFFSET_CAPTURE` and you should use `splitWithOffsets` - instead. -- `matchAll` rejects `PREG_SET_ORDER` as it also changes the shape of the returned matches. There - is no alternative provided as you can fairly easily code around it. -- `preg_filter` is not supported as it has a rather crazy API, most likely you should rather - use `Preg::grep` in combination with some loop and `Preg::replace`. -- `replace`, `replaceCallback` and `replaceCallbackArray` do not support an array `$subject`, - only simple strings. -- As of 2.0, the library always uses `PREG_UNMATCHED_AS_NULL` for matching, which offers [much - saner/more predictable results](#preg_unmatched_as_null). As of 3.0 the flag is also set for - `replaceCallback` and `replaceCallbackArray`. - -#### PREG_UNMATCHED_AS_NULL - -As of 2.0, this library always uses PREG_UNMATCHED_AS_NULL for all `match*` and `isMatch*` -functions. As of 3.0 it is also done for `replaceCallback` and `replaceCallbackArray`. - -This means your matches will always contain all matching groups, either as null if unmatched -or as string if it matched. - -The advantages in clarity and predictability are clearer if you compare the two outputs of -running this with and without PREG_UNMATCHED_AS_NULL in $flags: - -```php -preg_match('/(a)(b)*(c)(d)*/', 'ac', $matches, $flags); -``` - -| no flag | PREG_UNMATCHED_AS_NULL | -| --- | --- | -| array (size=4) | array (size=5) | -| 0 => string 'ac' (length=2) | 0 => string 'ac' (length=2) | -| 1 => string 'a' (length=1) | 1 => string 'a' (length=1) | -| 2 => string '' (length=0) | 2 => null | -| 3 => string 'c' (length=1) | 3 => string 'c' (length=1) | -| | 4 => null | -| group 2 (any unmatched group preceding one that matched) is set to `''`. You cannot tell if it matched an empty string or did not match at all | group 2 is `null` when unmatched and a string if it matched, easy to check for | -| group 4 (any optional group without a matching one following) is missing altogether. So you have to check with `isset()`, but really you want `isset($m[4]) && $m[4] !== ''` for safety unless you are very careful to check that a non-optional group follows it | group 4 is always set, and null in this case as there was no match, easy to check for with `$m[4] !== null` | - -PHPStan Extension ------------------ - -To use the PHPStan extension if you do not use `phpstan/extension-installer` you can include `vendor/composer/pcre/extension.neon` in your PHPStan config. - -The extension provides much better type information for $matches as well as regex validation where possible. - -License -------- - -composer/pcre is licensed under the MIT License, see the LICENSE file for details. diff --git a/tools/php-cs-fixer/vendor/composer/pcre/composer.json b/tools/php-cs-fixer/vendor/composer/pcre/composer.json deleted file mode 100644 index d3a7e67c..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/composer.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "composer/pcre", - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "type": "library", - "license": "MIT", - "keywords": [ - "pcre", - "regex", - "preg", - "regular expression" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^8 || ^9", - "phpstan/phpstan": "^1.12 || ^2", - "phpstan/phpstan-strict-rules": "^1 || ^2" - }, - "conflict": { - "phpstan/phpstan": "<1.11.10" - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Composer\\Pcre\\": "tests" - } - }, - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - }, - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "scripts": { - "test": "@php vendor/bin/phpunit", - "phpstan": "@php phpstan analyse" - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/extension.neon b/tools/php-cs-fixer/vendor/composer/pcre/extension.neon deleted file mode 100644 index b9cea113..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/extension.neon +++ /dev/null @@ -1,22 +0,0 @@ -# composer/pcre PHPStan extensions -# -# These can be reused by third party packages by including 'vendor/composer/pcre/extension.neon' -# in your phpstan config - -services: - - - class: Composer\Pcre\PHPStan\PregMatchParameterOutTypeExtension - tags: - - phpstan.staticMethodParameterOutTypeExtension - - - class: Composer\Pcre\PHPStan\PregMatchTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension - - - class: Composer\Pcre\PHPStan\PregReplaceCallbackClosureTypeExtension - tags: - - phpstan.staticMethodParameterClosureTypeExtension - -rules: - - Composer\Pcre\PHPStan\UnsafeStrictGroupsCallRule - - Composer\Pcre\PHPStan\InvalidRegexPatternRule diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllResult.php b/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllResult.php deleted file mode 100644 index b22b52d6..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllResult.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Pcre; - -final class MatchAllResult -{ - /** - * An array of match group => list of matched strings - * - * @readonly - * @var array> - */ - public $matches; - - /** - * @readonly - * @var 0|positive-int - */ - public $count; - - /** - * @readonly - * @var bool - */ - public $matched; - - /** - * @param 0|positive-int $count - * @param array> $matches - */ - public function __construct(int $count, array $matches) - { - $this->matches = $matches; - $this->matched = (bool) $count; - $this->count = $count; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php b/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php deleted file mode 100644 index b7ec3974..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Pcre; - -final class MatchAllStrictGroupsResult -{ - /** - * An array of match group => list of matched strings - * - * @readonly - * @var array> - */ - public $matches; - - /** - * @readonly - * @var 0|positive-int - */ - public $count; - - /** - * @readonly - * @var bool - */ - public $matched; - - /** - * @param 0|positive-int $count - * @param array> $matches - */ - public function __construct(int $count, array $matches) - { - $this->matches = $matches; - $this->matched = (bool) $count; - $this->count = $count; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php b/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php deleted file mode 100644 index 032a02cd..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Pcre; - -final class MatchAllWithOffsetsResult -{ - /** - * An array of match group => list of matches, every match being a pair of string matched + offset in bytes (or -1 if no match) - * - * @readonly - * @var array> - * @phpstan-var array}>> - */ - public $matches; - - /** - * @readonly - * @var 0|positive-int - */ - public $count; - - /** - * @readonly - * @var bool - */ - public $matched; - - /** - * @param 0|positive-int $count - * @param array> $matches - * @phpstan-param array}>> $matches - */ - public function __construct(int $count, array $matches) - { - $this->matches = $matches; - $this->matched = (bool) $count; - $this->count = $count; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchResult.php b/tools/php-cs-fixer/vendor/composer/pcre/src/MatchResult.php deleted file mode 100644 index e951a5ee..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchResult.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Pcre; - -final class MatchResult -{ - /** - * An array of match group => string matched - * - * @readonly - * @var array - */ - public $matches; - - /** - * @readonly - * @var bool - */ - public $matched; - - /** - * @param 0|positive-int $count - * @param array $matches - */ - public function __construct(int $count, array $matches) - { - $this->matches = $matches; - $this->matched = (bool) $count; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchStrictGroupsResult.php b/tools/php-cs-fixer/vendor/composer/pcre/src/MatchStrictGroupsResult.php deleted file mode 100644 index 126ee629..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchStrictGroupsResult.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Pcre; - -final class MatchStrictGroupsResult -{ - /** - * An array of match group => string matched - * - * @readonly - * @var array - */ - public $matches; - - /** - * @readonly - * @var bool - */ - public $matched; - - /** - * @param 0|positive-int $count - * @param array $matches - */ - public function __construct(int $count, array $matches) - { - $this->matches = $matches; - $this->matched = (bool) $count; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchWithOffsetsResult.php b/tools/php-cs-fixer/vendor/composer/pcre/src/MatchWithOffsetsResult.php deleted file mode 100644 index ba4d4bc4..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/MatchWithOffsetsResult.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Pcre; - -final class MatchWithOffsetsResult -{ - /** - * An array of match group => pair of string matched + offset in bytes (or -1 if no match) - * - * @readonly - * @var array - * @phpstan-var array}> - */ - public $matches; - - /** - * @readonly - * @var bool - */ - public $matched; - - /** - * @param 0|positive-int $count - * @param array $matches - * @phpstan-param array}> $matches - */ - public function __construct(int $count, array $matches) - { - $this->matches = $matches; - $this->matched = (bool) $count; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/InvalidRegexPatternRule.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/InvalidRegexPatternRule.php deleted file mode 100644 index 8a05fb24..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/InvalidRegexPatternRule.php +++ /dev/null @@ -1,142 +0,0 @@ - - */ -class InvalidRegexPatternRule implements Rule -{ - public function getNodeType(): string - { - return StaticCall::class; - } - - public function processNode(Node $node, Scope $scope): array - { - $patterns = $this->extractPatterns($node, $scope); - - $errors = []; - foreach ($patterns as $pattern) { - $errorMessage = $this->validatePattern($pattern); - if ($errorMessage === null) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf('Regex pattern is invalid: %s', $errorMessage))->identifier('regexp.pattern')->build(); - } - - return $errors; - } - - /** - * @return string[] - */ - private function extractPatterns(StaticCall $node, Scope $scope): array - { - if (!$node->class instanceof FullyQualified) { - return []; - } - $isRegex = $node->class->toString() === Regex::class; - $isPreg = $node->class->toString() === Preg::class; - if (!$isRegex && !$isPreg) { - return []; - } - if (!$node->name instanceof Node\Identifier || !Preg::isMatch('{^(match|isMatch|grep|replace|split)}', $node->name->name)) { - return []; - } - - $functionName = $node->name->name; - if (!isset($node->getArgs()[0])) { - return []; - } - - $patternNode = $node->getArgs()[0]->value; - $patternType = $scope->getType($patternNode); - - $patternStrings = []; - - foreach ($patternType->getConstantStrings() as $constantStringType) { - if ($functionName === 'replaceCallbackArray') { - continue; - } - - $patternStrings[] = $constantStringType->getValue(); - } - - foreach ($patternType->getConstantArrays() as $constantArrayType) { - if ( - in_array($functionName, [ - 'replace', - 'replaceCallback', - ], true) - ) { - foreach ($constantArrayType->getValueTypes() as $arrayKeyType) { - foreach ($arrayKeyType->getConstantStrings() as $constantString) { - $patternStrings[] = $constantString->getValue(); - } - } - } - - if ($functionName !== 'replaceCallbackArray') { - continue; - } - - foreach ($constantArrayType->getKeyTypes() as $arrayKeyType) { - foreach ($arrayKeyType->getConstantStrings() as $constantString) { - $patternStrings[] = $constantString->getValue(); - } - } - } - - return $patternStrings; - } - - private function validatePattern(string $pattern): ?string - { - try { - $msg = null; - $prev = set_error_handler(function (int $severity, string $message, string $file) use (&$msg): bool { - $msg = preg_replace("#^preg_match(_all)?\\(.*?\\): #", '', $message); - - return true; - }); - - if ($pattern === '') { - return 'Empty string is not a valid regular expression'; - } - - Preg::match($pattern, ''); - if ($msg !== null) { - return $msg; - } - } catch (PcreException $e) { - if ($e->getCode() === PREG_INTERNAL_ERROR && $msg !== null) { - return $msg; - } - - return preg_replace('{.*? failed executing ".*": }', '', $e->getMessage()); - } finally { - restore_error_handler(); - } - - return null; - } - -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchFlags.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchFlags.php deleted file mode 100644 index aa30ab34..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchFlags.php +++ /dev/null @@ -1,70 +0,0 @@ -getType($flagsArg->value); - - $constantScalars = $flagsType->getConstantScalarValues(); - if ($constantScalars === []) { - return null; - } - - $internalFlagsTypes = []; - foreach ($flagsType->getConstantScalarValues() as $constantScalarValue) { - if (!is_int($constantScalarValue)) { - return null; - } - - $internalFlagsTypes[] = new ConstantIntegerType($constantScalarValue | PREG_UNMATCHED_AS_NULL); - } - return TypeCombinator::union(...$internalFlagsTypes); - } - - static public function removeNullFromMatches(Type $matchesType): Type - { - return TypeTraverser::map($matchesType, static function (Type $type, callable $traverse): Type { - if ($type instanceof UnionType || $type instanceof IntersectionType) { - return $traverse($type); - } - - if ($type instanceof ConstantArrayType) { - return new ConstantArrayType( - $type->getKeyTypes(), - array_map(static function (Type $valueType) use ($traverse): Type { - return $traverse($valueType); - }, $type->getValueTypes()), - $type->getNextAutoIndexes(), - [], - $type->isList() - ); - } - - if ($type instanceof ArrayType) { - return new ArrayType($type->getKeyType(), $traverse($type->getItemType())); - } - - return TypeCombinator::removeNull($type); - }); - } - -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchParameterOutTypeExtension.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchParameterOutTypeExtension.php deleted file mode 100644 index e0d60208..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchParameterOutTypeExtension.php +++ /dev/null @@ -1,65 +0,0 @@ -regexShapeMatcher = $regexShapeMatcher; - } - - public function isStaticMethodSupported(MethodReflection $methodReflection, ParameterReflection $parameter): bool - { - return - $methodReflection->getDeclaringClass()->getName() === Preg::class - && in_array($methodReflection->getName(), [ - 'match', 'isMatch', 'matchStrictGroups', 'isMatchStrictGroups', - 'matchAll', 'isMatchAll', 'matchAllStrictGroups', 'isMatchAllStrictGroups' - ], true) - && $parameter->getName() === 'matches'; - } - - public function getParameterOutTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, ParameterReflection $parameter, Scope $scope): ?Type - { - $args = $methodCall->getArgs(); - $patternArg = $args[0] ?? null; - $matchesArg = $args[2] ?? null; - $flagsArg = $args[3] ?? null; - - if ( - $patternArg === null || $matchesArg === null - ) { - return null; - } - - $flagsType = PregMatchFlags::getType($flagsArg, $scope); - if ($flagsType === null) { - return null; - } - - if (stripos($methodReflection->getName(), 'matchAll') !== false) { - return $this->regexShapeMatcher->matchAllExpr($patternArg->value, $flagsType, TrinaryLogic::createMaybe(), $scope); - } - - return $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createMaybe(), $scope); - } - -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchTypeSpecifyingExtension.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchTypeSpecifyingExtension.php deleted file mode 100644 index 3db0ce06..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregMatchTypeSpecifyingExtension.php +++ /dev/null @@ -1,119 +0,0 @@ -regexShapeMatcher = $regexShapeMatcher; - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - - public function getClass(): string - { - return Preg::class; - } - - public function isStaticMethodSupported(MethodReflection $methodReflection, StaticCall $node, TypeSpecifierContext $context): bool - { - return in_array($methodReflection->getName(), [ - 'match', 'isMatch', 'matchStrictGroups', 'isMatchStrictGroups', - 'matchAll', 'isMatchAll', 'matchAllStrictGroups', 'isMatchAllStrictGroups' - ], true) - && !$context->null(); - } - - public function specifyTypes(MethodReflection $methodReflection, StaticCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - $args = $node->getArgs(); - $patternArg = $args[0] ?? null; - $matchesArg = $args[2] ?? null; - $flagsArg = $args[3] ?? null; - - if ( - $patternArg === null || $matchesArg === null - ) { - return new SpecifiedTypes(); - } - - $flagsType = PregMatchFlags::getType($flagsArg, $scope); - if ($flagsType === null) { - return new SpecifiedTypes(); - } - - if (stripos($methodReflection->getName(), 'matchAll') !== false) { - $matchedType = $this->regexShapeMatcher->matchAllExpr($patternArg->value, $flagsType, TrinaryLogic::createFromBoolean($context->true()), $scope); - } else { - $matchedType = $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createFromBoolean($context->true()), $scope); - } - - if ($matchedType === null) { - return new SpecifiedTypes(); - } - - if ( - in_array($methodReflection->getName(), ['matchStrictGroups', 'isMatchStrictGroups', 'matchAllStrictGroups', 'isMatchAllStrictGroups'], true) - ) { - $matchedType = PregMatchFlags::removeNullFromMatches($matchedType); - } - - $overwrite = false; - if ($context->false()) { - $overwrite = true; - $context = $context->negate(); - } - - // @phpstan-ignore function.alreadyNarrowedType - if (method_exists('PHPStan\Analyser\SpecifiedTypes', 'setRootExpr')) { - $typeSpecifier = $this->typeSpecifier->create( - $matchesArg->value, - $matchedType, - $context, - $scope - )->setRootExpr($node); - - return $overwrite ? $typeSpecifier->setAlwaysOverwriteTypes() : $typeSpecifier; - } - - // @phpstan-ignore arguments.count - return $this->typeSpecifier->create( - $matchesArg->value, - $matchedType, - $context, - // @phpstan-ignore argument.type - $overwrite, - $scope, - $node - ); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregReplaceCallbackClosureTypeExtension.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregReplaceCallbackClosureTypeExtension.php deleted file mode 100644 index 7b953672..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/PregReplaceCallbackClosureTypeExtension.php +++ /dev/null @@ -1,91 +0,0 @@ -regexShapeMatcher = $regexShapeMatcher; - } - - public function isStaticMethodSupported(MethodReflection $methodReflection, ParameterReflection $parameter): bool - { - return in_array($methodReflection->getDeclaringClass()->getName(), [Preg::class, Regex::class], true) - && in_array($methodReflection->getName(), ['replaceCallback', 'replaceCallbackStrictGroups'], true) - && $parameter->getName() === 'replacement'; - } - - public function getTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, ParameterReflection $parameter, Scope $scope): ?Type - { - $args = $methodCall->getArgs(); - $patternArg = $args[0] ?? null; - $flagsArg = $args[5] ?? null; - - if ( - $patternArg === null - ) { - return null; - } - - $flagsType = PregMatchFlags::getType($flagsArg, $scope); - - $matchesType = $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createYes(), $scope); - if ($matchesType === null) { - return null; - } - - if ($methodReflection->getName() === 'replaceCallbackStrictGroups' && count($matchesType->getConstantArrays()) === 1) { - $matchesType = $matchesType->getConstantArrays()[0]; - $matchesType = new ConstantArrayType( - $matchesType->getKeyTypes(), - array_map(static function (Type $valueType): Type { - if (count($valueType->getConstantArrays()) === 1) { - $valueTypeArray = $valueType->getConstantArrays()[0]; - return new ConstantArrayType( - $valueTypeArray->getKeyTypes(), - array_map(static function (Type $valueType): Type { - return TypeCombinator::removeNull($valueType); - }, $valueTypeArray->getValueTypes()), - $valueTypeArray->getNextAutoIndexes(), - [], - $valueTypeArray->isList() - ); - } - return TypeCombinator::removeNull($valueType); - }, $matchesType->getValueTypes()), - $matchesType->getNextAutoIndexes(), - [], - $matchesType->isList() - ); - } - - return new ClosureType( - [ - new NativeParameterReflection($parameter->getName(), $parameter->isOptional(), $matchesType, $parameter->passedByReference(), $parameter->isVariadic(), $parameter->getDefaultValue()), - ], - new StringType() - ); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/UnsafeStrictGroupsCallRule.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/UnsafeStrictGroupsCallRule.php deleted file mode 100644 index 5bced507..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/PHPStan/UnsafeStrictGroupsCallRule.php +++ /dev/null @@ -1,112 +0,0 @@ - - */ -final class UnsafeStrictGroupsCallRule implements Rule -{ - /** - * @var RegexArrayShapeMatcher - */ - private $regexShapeMatcher; - - public function __construct(RegexArrayShapeMatcher $regexShapeMatcher) - { - $this->regexShapeMatcher = $regexShapeMatcher; - } - - public function getNodeType(): string - { - return StaticCall::class; - } - - public function processNode(Node $node, Scope $scope): array - { - if (!$node->class instanceof FullyQualified) { - return []; - } - $isRegex = $node->class->toString() === Regex::class; - $isPreg = $node->class->toString() === Preg::class; - if (!$isRegex && !$isPreg) { - return []; - } - if (!$node->name instanceof Node\Identifier || !in_array($node->name->name, ['matchStrictGroups', 'isMatchStrictGroups', 'matchAllStrictGroups', 'isMatchAllStrictGroups'], true)) { - return []; - } - - $args = $node->getArgs(); - if (!isset($args[0])) { - return []; - } - - $patternArg = $args[0] ?? null; - if ($isPreg) { - if (!isset($args[2])) { // no matches set, skip as the matches won't be used anyway - return []; - } - $flagsArg = $args[3] ?? null; - } else { - $flagsArg = $args[2] ?? null; - } - - if ($patternArg === null) { - return []; - } - - $flagsType = PregMatchFlags::getType($flagsArg, $scope); - if ($flagsType === null) { - return []; - } - - $matchedType = $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createYes(), $scope); - if ($matchedType === null) { - return [ - RuleErrorBuilder::message(sprintf('The %s call is potentially unsafe as $matches\' type could not be inferred.', $node->name->name)) - ->identifier('composerPcre.maybeUnsafeStrictGroups') - ->build(), - ]; - } - - if (count($matchedType->getConstantArrays()) === 1) { - $matchedType = $matchedType->getConstantArrays()[0]; - $nullableGroups = []; - foreach ($matchedType->getValueTypes() as $index => $type) { - if (TypeCombinator::containsNull($type)) { - $nullableGroups[] = $matchedType->getKeyTypes()[$index]->getValue(); - } - } - - if (\count($nullableGroups) > 0) { - return [ - RuleErrorBuilder::message(sprintf( - 'The %s call is unsafe as match group%s "%s" %s optional and may be null.', - $node->name->name, - \count($nullableGroups) > 1 ? 's' : '', - implode('", "', $nullableGroups), - \count($nullableGroups) > 1 ? 'are' : 'is' - ))->identifier('composerPcre.unsafeStrictGroups')->build(), - ]; - } - } - - return []; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/PcreException.php b/tools/php-cs-fixer/vendor/composer/pcre/src/PcreException.php deleted file mode 100644 index 23d93279..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/PcreException.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Pcre; - -class PcreException extends \RuntimeException -{ - /** - * @param string $function - * @param string|string[] $pattern - * @return self - */ - public static function fromFunction($function, $pattern) - { - $code = preg_last_error(); - - if (is_array($pattern)) { - $pattern = implode(', ', $pattern); - } - - return new PcreException($function.'(): failed executing "'.$pattern.'": '.self::pcreLastErrorMessage($code), $code); - } - - /** - * @param int $code - * @return string - */ - private static function pcreLastErrorMessage($code) - { - if (function_exists('preg_last_error_msg')) { - return preg_last_error_msg(); - } - - $constants = get_defined_constants(true); - if (!isset($constants['pcre']) || !is_array($constants['pcre'])) { - return 'UNDEFINED_ERROR'; - } - - foreach ($constants['pcre'] as $const => $val) { - if ($val === $code && substr($const, -6) === '_ERROR') { - return $const; - } - } - - return 'UNDEFINED_ERROR'; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/Preg.php b/tools/php-cs-fixer/vendor/composer/pcre/src/Preg.php deleted file mode 100644 index 400abbfe..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/Preg.php +++ /dev/null @@ -1,430 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Pcre; - -class Preg -{ - /** @internal */ - public const ARRAY_MSG = '$subject as an array is not supported. You can use \'foreach\' instead.'; - /** @internal */ - public const INVALID_TYPE_MSG = '$subject must be a string, %s given.'; - - /** - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * @return 0|1 - * - * @param-out array $matches - */ - public static function match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int - { - self::checkOffsetCapture($flags, 'matchWithOffsets'); - - $result = preg_match($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL, $offset); - if ($result === false) { - throw PcreException::fromFunction('preg_match', $pattern); - } - - return $result; - } - - /** - * Variant of `match()` which outputs non-null matches (or throws) - * - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * @return 0|1 - * @throws UnexpectedNullMatchException - * - * @param-out array $matches - */ - public static function matchStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int - { - $result = self::match($pattern, $subject, $matchesInternal, $flags, $offset); - $matches = self::enforceNonNullMatches($pattern, $matchesInternal, 'match'); - - return $result; - } - - /** - * Runs preg_match with PREG_OFFSET_CAPTURE - * - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_OFFSET_CAPTURE are always set, no other flags are supported - * @return 0|1 - * - * @param-out array}> $matches - */ - public static function matchWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): int - { - $result = preg_match($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL | PREG_OFFSET_CAPTURE, $offset); - if ($result === false) { - throw PcreException::fromFunction('preg_match', $pattern); - } - - return $result; - } - - /** - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * @return 0|positive-int - * - * @param-out array> $matches - */ - public static function matchAll(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int - { - self::checkOffsetCapture($flags, 'matchAllWithOffsets'); - self::checkSetOrder($flags); - - $result = preg_match_all($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL, $offset); - if (!is_int($result)) { // PHP < 8 may return null, 8+ returns int|false - throw PcreException::fromFunction('preg_match_all', $pattern); - } - - return $result; - } - - /** - * Variant of `match()` which outputs non-null matches (or throws) - * - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * @return 0|positive-int - * @throws UnexpectedNullMatchException - * - * @param-out array> $matches - */ - public static function matchAllStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int - { - $result = self::matchAll($pattern, $subject, $matchesInternal, $flags, $offset); - $matches = self::enforceNonNullMatchAll($pattern, $matchesInternal, 'matchAll'); - - return $result; - } - - /** - * Runs preg_match_all with PREG_OFFSET_CAPTURE - * - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_MATCH_OFFSET are always set, no other flags are supported - * @return 0|positive-int - * - * @param-out array}>> $matches - */ - public static function matchAllWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): int - { - self::checkSetOrder($flags); - - $result = preg_match_all($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL | PREG_OFFSET_CAPTURE, $offset); - if (!is_int($result)) { // PHP < 8 may return null, 8+ returns int|false - throw PcreException::fromFunction('preg_match_all', $pattern); - } - - return $result; - } - - /** - * @param string|string[] $pattern - * @param string|string[] $replacement - * @param string $subject - * @param int $count Set by method - * - * @param-out int<0, max> $count - */ - public static function replace($pattern, $replacement, $subject, int $limit = -1, ?int &$count = null): string - { - if (!is_scalar($subject)) { - if (is_array($subject)) { - throw new \InvalidArgumentException(static::ARRAY_MSG); - } - - throw new \TypeError(sprintf(static::INVALID_TYPE_MSG, gettype($subject))); - } - - $result = preg_replace($pattern, $replacement, $subject, $limit, $count); - if ($result === null) { - throw PcreException::fromFunction('preg_replace', $pattern); - } - - return $result; - } - - /** - * @param string|string[] $pattern - * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement - * @param string $subject - * @param int $count Set by method - * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set - * - * @param-out int<0, max> $count - */ - public static function replaceCallback($pattern, callable $replacement, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string - { - if (!is_scalar($subject)) { - if (is_array($subject)) { - throw new \InvalidArgumentException(static::ARRAY_MSG); - } - - throw new \TypeError(sprintf(static::INVALID_TYPE_MSG, gettype($subject))); - } - - $result = preg_replace_callback($pattern, $replacement, $subject, $limit, $count, $flags | PREG_UNMATCHED_AS_NULL); - if ($result === null) { - throw PcreException::fromFunction('preg_replace_callback', $pattern); - } - - return $result; - } - - /** - * Variant of `replaceCallback()` which outputs non-null matches (or throws) - * - * @param string $pattern - * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement - * @param string $subject - * @param int $count Set by method - * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set - * - * @param-out int<0, max> $count - */ - public static function replaceCallbackStrictGroups(string $pattern, callable $replacement, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string - { - return self::replaceCallback($pattern, function (array $matches) use ($pattern, $replacement) { - return $replacement(self::enforceNonNullMatches($pattern, $matches, 'replaceCallback')); - }, $subject, $limit, $count, $flags); - } - - /** - * @param ($flags is PREG_OFFSET_CAPTURE ? (array}>): string>) : array): string>) $pattern - * @param string $subject - * @param int $count Set by method - * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set - * - * @param-out int<0, max> $count - */ - public static function replaceCallbackArray(array $pattern, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string - { - if (!is_scalar($subject)) { - if (is_array($subject)) { - throw new \InvalidArgumentException(static::ARRAY_MSG); - } - - throw new \TypeError(sprintf(static::INVALID_TYPE_MSG, gettype($subject))); - } - - $result = preg_replace_callback_array($pattern, $subject, $limit, $count, $flags | PREG_UNMATCHED_AS_NULL); - if ($result === null) { - $pattern = array_keys($pattern); - throw PcreException::fromFunction('preg_replace_callback_array', $pattern); - } - - return $result; - } - - /** - * @param int-mask $flags PREG_SPLIT_NO_EMPTY or PREG_SPLIT_DELIM_CAPTURE - * @return list - */ - public static function split(string $pattern, string $subject, int $limit = -1, int $flags = 0): array - { - if (($flags & PREG_SPLIT_OFFSET_CAPTURE) !== 0) { - throw new \InvalidArgumentException('PREG_SPLIT_OFFSET_CAPTURE is not supported as it changes the type of $matches, use splitWithOffsets() instead'); - } - - $result = preg_split($pattern, $subject, $limit, $flags); - if ($result === false) { - throw PcreException::fromFunction('preg_split', $pattern); - } - - return $result; - } - - /** - * @param int-mask $flags PREG_SPLIT_NO_EMPTY or PREG_SPLIT_DELIM_CAPTURE, PREG_SPLIT_OFFSET_CAPTURE is always set - * @return list - * @phpstan-return list}> - */ - public static function splitWithOffsets(string $pattern, string $subject, int $limit = -1, int $flags = 0): array - { - $result = preg_split($pattern, $subject, $limit, $flags | PREG_SPLIT_OFFSET_CAPTURE); - if ($result === false) { - throw PcreException::fromFunction('preg_split', $pattern); - } - - return $result; - } - - /** - * @template T of string|\Stringable - * @param string $pattern - * @param array $array - * @param int-mask $flags PREG_GREP_INVERT - * @return array - */ - public static function grep(string $pattern, array $array, int $flags = 0): array - { - $result = preg_grep($pattern, $array, $flags); - if ($result === false) { - throw PcreException::fromFunction('preg_grep', $pattern); - } - - return $result; - } - - /** - * Variant of match() which returns a bool instead of int - * - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * - * @param-out array $matches - */ - public static function isMatch(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool - { - return (bool) static::match($pattern, $subject, $matches, $flags, $offset); - } - - /** - * Variant of `isMatch()` which outputs non-null matches (or throws) - * - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * @throws UnexpectedNullMatchException - * - * @param-out array $matches - */ - public static function isMatchStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool - { - return (bool) self::matchStrictGroups($pattern, $subject, $matches, $flags, $offset); - } - - /** - * Variant of matchAll() which returns a bool instead of int - * - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * - * @param-out array> $matches - */ - public static function isMatchAll(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool - { - return (bool) static::matchAll($pattern, $subject, $matches, $flags, $offset); - } - - /** - * Variant of `isMatchAll()` which outputs non-null matches (or throws) - * - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * - * @param-out array> $matches - */ - public static function isMatchAllStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool - { - return (bool) self::matchAllStrictGroups($pattern, $subject, $matches, $flags, $offset); - } - - /** - * Variant of matchWithOffsets() which returns a bool instead of int - * - * Runs preg_match with PREG_OFFSET_CAPTURE - * - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * - * @param-out array}> $matches - */ - public static function isMatchWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): bool - { - return (bool) static::matchWithOffsets($pattern, $subject, $matches, $flags, $offset); - } - - /** - * Variant of matchAllWithOffsets() which returns a bool instead of int - * - * Runs preg_match_all with PREG_OFFSET_CAPTURE - * - * @param non-empty-string $pattern - * @param array $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * - * @param-out array}>> $matches - */ - public static function isMatchAllWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): bool - { - return (bool) static::matchAllWithOffsets($pattern, $subject, $matches, $flags, $offset); - } - - private static function checkOffsetCapture(int $flags, string $useFunctionName): void - { - if (($flags & PREG_OFFSET_CAPTURE) !== 0) { - throw new \InvalidArgumentException('PREG_OFFSET_CAPTURE is not supported as it changes the type of $matches, use ' . $useFunctionName . '() instead'); - } - } - - private static function checkSetOrder(int $flags): void - { - if (($flags & PREG_SET_ORDER) !== 0) { - throw new \InvalidArgumentException('PREG_SET_ORDER is not supported as it changes the type of $matches'); - } - } - - /** - * @param array $matches - * @return array - * @throws UnexpectedNullMatchException - */ - private static function enforceNonNullMatches(string $pattern, array $matches, string $variantMethod) - { - foreach ($matches as $group => $match) { - if (is_string($match) || (is_array($match) && is_string($match[0]))) { - continue; - } - - throw new UnexpectedNullMatchException('Pattern "'.$pattern.'" had an unexpected unmatched group "'.$group.'", make sure the pattern always matches or use '.$variantMethod.'() instead.'); - } - - /** @var array */ - return $matches; - } - - /** - * @param array> $matches - * @return array> - * @throws UnexpectedNullMatchException - */ - private static function enforceNonNullMatchAll(string $pattern, array $matches, string $variantMethod) - { - foreach ($matches as $group => $groupMatches) { - foreach ($groupMatches as $match) { - if (null === $match) { - throw new UnexpectedNullMatchException('Pattern "'.$pattern.'" had an unexpected unmatched group "'.$group.'", make sure the pattern always matches or use '.$variantMethod.'() instead.'); - } - } - } - - /** @var array> */ - return $matches; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/Regex.php b/tools/php-cs-fixer/vendor/composer/pcre/src/Regex.php deleted file mode 100644 index 038cf069..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/Regex.php +++ /dev/null @@ -1,176 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Pcre; - -class Regex -{ - /** - * @param non-empty-string $pattern - */ - public static function isMatch(string $pattern, string $subject, int $offset = 0): bool - { - return (bool) Preg::match($pattern, $subject, $matches, 0, $offset); - } - - /** - * @param non-empty-string $pattern - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - */ - public static function match(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchResult - { - self::checkOffsetCapture($flags, 'matchWithOffsets'); - - $count = Preg::match($pattern, $subject, $matches, $flags, $offset); - - return new MatchResult($count, $matches); - } - - /** - * Variant of `match()` which returns non-null matches (or throws) - * - * @param non-empty-string $pattern - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * @throws UnexpectedNullMatchException - */ - public static function matchStrictGroups(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchStrictGroupsResult - { - // @phpstan-ignore composerPcre.maybeUnsafeStrictGroups - $count = Preg::matchStrictGroups($pattern, $subject, $matches, $flags, $offset); - - return new MatchStrictGroupsResult($count, $matches); - } - - /** - * Runs preg_match with PREG_OFFSET_CAPTURE - * - * @param non-empty-string $pattern - * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_MATCH_OFFSET are always set, no other flags are supported - */ - public static function matchWithOffsets(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchWithOffsetsResult - { - $count = Preg::matchWithOffsets($pattern, $subject, $matches, $flags, $offset); - - return new MatchWithOffsetsResult($count, $matches); - } - - /** - * @param non-empty-string $pattern - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - */ - public static function matchAll(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchAllResult - { - self::checkOffsetCapture($flags, 'matchAllWithOffsets'); - self::checkSetOrder($flags); - - $count = Preg::matchAll($pattern, $subject, $matches, $flags, $offset); - - return new MatchAllResult($count, $matches); - } - - /** - * Variant of `matchAll()` which returns non-null matches (or throws) - * - * @param non-empty-string $pattern - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported - * @throws UnexpectedNullMatchException - */ - public static function matchAllStrictGroups(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchAllStrictGroupsResult - { - self::checkOffsetCapture($flags, 'matchAllWithOffsets'); - self::checkSetOrder($flags); - - // @phpstan-ignore composerPcre.maybeUnsafeStrictGroups - $count = Preg::matchAllStrictGroups($pattern, $subject, $matches, $flags, $offset); - - return new MatchAllStrictGroupsResult($count, $matches); - } - - /** - * Runs preg_match_all with PREG_OFFSET_CAPTURE - * - * @param non-empty-string $pattern - * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_MATCH_OFFSET are always set, no other flags are supported - */ - public static function matchAllWithOffsets(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchAllWithOffsetsResult - { - self::checkSetOrder($flags); - - $count = Preg::matchAllWithOffsets($pattern, $subject, $matches, $flags, $offset); - - return new MatchAllWithOffsetsResult($count, $matches); - } - /** - * @param string|string[] $pattern - * @param string|string[] $replacement - * @param string $subject - */ - public static function replace($pattern, $replacement, $subject, int $limit = -1): ReplaceResult - { - $result = Preg::replace($pattern, $replacement, $subject, $limit, $count); - - return new ReplaceResult($count, $result); - } - - /** - * @param string|string[] $pattern - * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement - * @param string $subject - * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set - */ - public static function replaceCallback($pattern, callable $replacement, $subject, int $limit = -1, int $flags = 0): ReplaceResult - { - $result = Preg::replaceCallback($pattern, $replacement, $subject, $limit, $count, $flags); - - return new ReplaceResult($count, $result); - } - - /** - * Variant of `replaceCallback()` which outputs non-null matches (or throws) - * - * @param string $pattern - * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement - * @param string $subject - * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set - */ - public static function replaceCallbackStrictGroups($pattern, callable $replacement, $subject, int $limit = -1, int $flags = 0): ReplaceResult - { - $result = Preg::replaceCallbackStrictGroups($pattern, $replacement, $subject, $limit, $count, $flags); - - return new ReplaceResult($count, $result); - } - - /** - * @param ($flags is PREG_OFFSET_CAPTURE ? (array}>): string>) : array): string>) $pattern - * @param string $subject - * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set - */ - public static function replaceCallbackArray(array $pattern, $subject, int $limit = -1, int $flags = 0): ReplaceResult - { - $result = Preg::replaceCallbackArray($pattern, $subject, $limit, $count, $flags); - - return new ReplaceResult($count, $result); - } - - private static function checkOffsetCapture(int $flags, string $useFunctionName): void - { - if (($flags & PREG_OFFSET_CAPTURE) !== 0) { - throw new \InvalidArgumentException('PREG_OFFSET_CAPTURE is not supported as it changes the return type, use '.$useFunctionName.'() instead'); - } - } - - private static function checkSetOrder(int $flags): void - { - if (($flags & PREG_SET_ORDER) !== 0) { - throw new \InvalidArgumentException('PREG_SET_ORDER is not supported as it changes the return type'); - } - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/ReplaceResult.php b/tools/php-cs-fixer/vendor/composer/pcre/src/ReplaceResult.php deleted file mode 100644 index 33847712..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/ReplaceResult.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Pcre; - -final class ReplaceResult -{ - /** - * @readonly - * @var string - */ - public $result; - - /** - * @readonly - * @var 0|positive-int - */ - public $count; - - /** - * @readonly - * @var bool - */ - public $matched; - - /** - * @param 0|positive-int $count - */ - public function __construct(int $count, string $result) - { - $this->count = $count; - $this->matched = (bool) $count; - $this->result = $result; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/pcre/src/UnexpectedNullMatchException.php b/tools/php-cs-fixer/vendor/composer/pcre/src/UnexpectedNullMatchException.php deleted file mode 100644 index f123828b..00000000 --- a/tools/php-cs-fixer/vendor/composer/pcre/src/UnexpectedNullMatchException.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Pcre; - -class UnexpectedNullMatchException extends PcreException -{ - public static function fromFunction($function, $pattern) - { - throw new \LogicException('fromFunction should not be called on '.self::class.', use '.PcreException::class); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/platform_check.php b/tools/php-cs-fixer/vendor/composer/platform_check.php deleted file mode 100644 index d32d90c6..00000000 --- a/tools/php-cs-fixer/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 80200)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 8.2.0". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/CHANGELOG.md b/tools/php-cs-fixer/vendor/composer/semver/CHANGELOG.md deleted file mode 100644 index bad46cd1..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/CHANGELOG.md +++ /dev/null @@ -1,229 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -### [3.4.3] 2024-09-19 - - * Fixed some type annotations - -### [3.4.2] 2024-07-12 - - * Fixed PHP 5.3 syntax error - -### [3.4.1] 2024-07-12 - - * Fixed normalizeStability's return type to enforce valid stabilities - -### [3.4.0] 2023-08-31 - - * Support larger major version numbers (#149) - -### [3.3.2] 2022-04-01 - - * Fixed handling of non-string values (#134) - -### [3.3.1] 2022-03-16 - - * Fixed possible cache key clash in the CompilingMatcher memoization (#132) - -### [3.3.0] 2022-03-15 - - * Improved performance of CompilingMatcher by memoizing more (#131) - * Added CompilingMatcher::clear to clear all memoization caches - -### [3.2.9] 2022-02-04 - - * Revert #129 (Fixed MultiConstraint with MatchAllConstraint) which caused regressions - -### [3.2.8] 2022-02-04 - - * Updates to latest phpstan / CI by @Seldaek in https://github.com/composer/semver/pull/130 - * Fixed MultiConstraint with MatchAllConstraint by @Toflar in https://github.com/composer/semver/pull/129 - -### [3.2.7] 2022-01-04 - - * Fixed: typo in type definition of Intervals class causing issues with Psalm scanning vendors - -### [3.2.6] 2021-10-25 - - * Fixed: type improvements to parseStability - -### [3.2.5] 2021-05-24 - - * Fixed: issue comparing disjunctive MultiConstraints to conjunctive ones (#127) - * Fixed: added complete type information using phpstan annotations - -### [3.2.4] 2020-11-13 - - * Fixed: code clean-up - -### [3.2.3] 2020-11-12 - - * Fixed: constraints in the form of `X || Y, >=Y.1` and other such complex constructs were in some cases being optimized into a more restrictive constraint - -### [3.2.2] 2020-10-14 - - * Fixed: internal code cleanups - -### [3.2.1] 2020-09-27 - - * Fixed: accidental validation of broken constraints combining ^/~ and wildcards, and -dev suffix allowing weird cases - * Fixed: normalization of beta0 and such which was dropping the 0 - -### [3.2.0] 2020-09-09 - - * Added: support for `x || @dev`, not very useful but seen in the wild and failed to validate with 1.5.2/1.6.0 - * Added: support for `foobar-dev` being equal to `dev-foobar`, dev-foobar is the official way to write it but we need to support the other for BC and convenience - -### [3.1.0] 2020-09-08 - - * Added: support for constraints like `^2.x-dev` and `~2.x-dev`, not very useful but seen in the wild and failed to validate with 3.0.1 - * Fixed: invalid aliases will no longer throw, unless explicitly validated by Composer in the root package - -### [3.0.1] 2020-09-08 - - * Fixed: handling of some invalid -dev versions which were seen as valid - -### [3.0.0] 2020-05-26 - - * Break: Renamed `EmptyConstraint`, replace it with `MatchAllConstraint` - * Break: Unlikely to affect anyone but strictly speaking a breaking change, `*.*` and such variants will not match all `dev-*` versions anymore, only `*` does - * Break: ConstraintInterface is now considered internal/private and not meant to be implemented by third parties anymore - * Added `Intervals` class to check if a constraint is a subsets of another one, and allow compacting complex MultiConstraints into simpler ones - * Added `CompilingMatcher` class to speed up constraint matching against simple Constraint instances - * Added `MatchAllConstraint` and `MatchNoneConstraint` which match everything and nothing - * Added more advanced optimization of contiguous constraints inside MultiConstraint - * Added tentative support for PHP 8 - * Fixed ConstraintInterface::matches to be commutative in all cases - -### [2.0.0] 2020-04-21 - - * Break: `dev-master`, `dev-trunk` and `dev-default` now normalize to `dev-master`, `dev-trunk` and `dev-default` instead of `9999999-dev` in 1.x - * Break: Removed the deprecated `AbstractConstraint` - * Added `getUpperBound` and `getLowerBound` to ConstraintInterface. They return `Composer\Semver\Constraint\Bound` instances - * Added `MultiConstraint::create` to create the most-optimal form of ConstraintInterface from an array of constraint strings - -### [1.7.2] 2020-12-03 - - * Fixed: Allow installing on php 8 - -### [1.7.1] 2020-09-27 - - * Fixed: accidental validation of broken constraints combining ^/~ and wildcards, and -dev suffix allowing weird cases - * Fixed: normalization of beta0 and such which was dropping the 0 - -### [1.7.0] 2020-09-09 - - * Added: support for `x || @dev`, not very useful but seen in the wild and failed to validate with 1.5.2/1.6.0 - * Added: support for `foobar-dev` being equal to `dev-foobar`, dev-foobar is the official way to write it but we need to support the other for BC and convenience - -### [1.6.0] 2020-09-08 - - * Added: support for constraints like `^2.x-dev` and `~2.x-dev`, not very useful but seen in the wild and failed to validate with 1.5.2 - * Fixed: invalid aliases will no longer throw, unless explicitly validated by Composer in the root package - -### [1.5.2] 2020-09-08 - - * Fixed: handling of some invalid -dev versions which were seen as valid - * Fixed: some doctypes - -### [1.5.1] 2020-01-13 - - * Fixed: Parsing of aliased version was not validating the alias to be a valid version - -### [1.5.0] 2019-03-19 - - * Added: some support for date versions (e.g. 201903) in `~` operator - * Fixed: support for stabilities in `~` operator was inconsistent - -### [1.4.2] 2016-08-30 - - * Fixed: collapsing of complex constraints lead to buggy constraints - -### [1.4.1] 2016-06-02 - - * Changed: branch-like requirements no longer strip build metadata - [composer/semver#38](https://github.com/composer/semver/pull/38). - -### [1.4.0] 2016-03-30 - - * Added: getters on MultiConstraint - [composer/semver#35](https://github.com/composer/semver/pull/35). - -### [1.3.0] 2016-02-25 - - * Fixed: stability parsing - [composer/composer#1234](https://github.com/composer/composer/issues/4889). - * Changed: collapse contiguous constraints when possible. - -### [1.2.0] 2015-11-10 - - * Changed: allow multiple numerical identifiers in 'pre-release' version part. - * Changed: add more 'v' prefix support. - -### [1.1.0] 2015-11-03 - - * Changed: dropped redundant `test` namespace. - * Changed: minor adjustment in datetime parsing normalization. - * Changed: `ConstraintInterface` relaxed, setPrettyString is not required anymore. - * Changed: `AbstractConstraint` marked deprecated, will be removed in 2.0. - * Changed: `Constraint` is now extensible. - -### [1.0.0] 2015-09-21 - - * Break: `VersionConstraint` renamed to `Constraint`. - * Break: `SpecificConstraint` renamed to `AbstractConstraint`. - * Break: `LinkConstraintInterface` renamed to `ConstraintInterface`. - * Break: `VersionParser::parseNameVersionPairs` was removed. - * Changed: `VersionParser::parseConstraints` allows (but ignores) build metadata now. - * Changed: `VersionParser::parseConstraints` allows (but ignores) prefixing numeric versions with a 'v' now. - * Changed: Fixed namespace(s) of test files. - * Changed: `Comparator::compare` no longer throws `InvalidArgumentException`. - * Changed: `Constraint` now throws `InvalidArgumentException`. - -### [0.1.0] 2015-07-23 - - * Added: `Composer\Semver\Comparator`, various methods to compare versions. - * Added: various documents such as README.md, LICENSE, etc. - * Added: configuration files for Git, Travis, php-cs-fixer, phpunit. - * Break: the following namespaces were renamed: - - Namespace: `Composer\Package\Version` -> `Composer\Semver` - - Namespace: `Composer\Package\LinkConstraint` -> `Composer\Semver\Constraint` - - Namespace: `Composer\Test\Package\Version` -> `Composer\Test\Semver` - - Namespace: `Composer\Test\Package\LinkConstraint` -> `Composer\Test\Semver\Constraint` - * Changed: code style using php-cs-fixer. - -[3.4.3]: https://github.com/composer/semver/compare/3.4.2...3.4.3 -[3.4.2]: https://github.com/composer/semver/compare/3.4.1...3.4.2 -[3.4.1]: https://github.com/composer/semver/compare/3.4.0...3.4.1 -[3.4.0]: https://github.com/composer/semver/compare/3.3.2...3.4.0 -[3.3.2]: https://github.com/composer/semver/compare/3.3.1...3.3.2 -[3.3.1]: https://github.com/composer/semver/compare/3.3.0...3.3.1 -[3.3.0]: https://github.com/composer/semver/compare/3.2.9...3.3.0 -[3.2.9]: https://github.com/composer/semver/compare/3.2.8...3.2.9 -[3.2.8]: https://github.com/composer/semver/compare/3.2.7...3.2.8 -[3.2.7]: https://github.com/composer/semver/compare/3.2.6...3.2.7 -[3.2.6]: https://github.com/composer/semver/compare/3.2.5...3.2.6 -[3.2.5]: https://github.com/composer/semver/compare/3.2.4...3.2.5 -[3.2.4]: https://github.com/composer/semver/compare/3.2.3...3.2.4 -[3.2.3]: https://github.com/composer/semver/compare/3.2.2...3.2.3 -[3.2.2]: https://github.com/composer/semver/compare/3.2.1...3.2.2 -[3.2.1]: https://github.com/composer/semver/compare/3.2.0...3.2.1 -[3.2.0]: https://github.com/composer/semver/compare/3.1.0...3.2.0 -[3.1.0]: https://github.com/composer/semver/compare/3.0.1...3.1.0 -[3.0.1]: https://github.com/composer/semver/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/composer/semver/compare/2.0.0...3.0.0 -[2.0.0]: https://github.com/composer/semver/compare/1.5.1...2.0.0 -[1.7.2]: https://github.com/composer/semver/compare/1.7.1...1.7.2 -[1.7.1]: https://github.com/composer/semver/compare/1.7.0...1.7.1 -[1.7.0]: https://github.com/composer/semver/compare/1.6.0...1.7.0 -[1.6.0]: https://github.com/composer/semver/compare/1.5.2...1.6.0 -[1.5.2]: https://github.com/composer/semver/compare/1.5.1...1.5.2 -[1.5.1]: https://github.com/composer/semver/compare/1.5.0...1.5.1 -[1.5.0]: https://github.com/composer/semver/compare/1.4.2...1.5.0 -[1.4.2]: https://github.com/composer/semver/compare/1.4.1...1.4.2 -[1.4.1]: https://github.com/composer/semver/compare/1.4.0...1.4.1 -[1.4.0]: https://github.com/composer/semver/compare/1.3.0...1.4.0 -[1.3.0]: https://github.com/composer/semver/compare/1.2.0...1.3.0 -[1.2.0]: https://github.com/composer/semver/compare/1.1.0...1.2.0 -[1.1.0]: https://github.com/composer/semver/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/composer/semver/compare/0.1.0...1.0.0 -[0.1.0]: https://github.com/composer/semver/compare/5e0b9a4da...0.1.0 diff --git a/tools/php-cs-fixer/vendor/composer/semver/LICENSE b/tools/php-cs-fixer/vendor/composer/semver/LICENSE deleted file mode 100644 index 46697586..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2015 Composer - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/composer/semver/README.md b/tools/php-cs-fixer/vendor/composer/semver/README.md deleted file mode 100644 index 76778490..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/README.md +++ /dev/null @@ -1,99 +0,0 @@ -composer/semver -=============== - -Semver (Semantic Versioning) library that offers utilities, version constraint parsing and validation. - -Originally written as part of [composer/composer](https://github.com/composer/composer), -now extracted and made available as a stand-alone library. - -[![Continuous Integration](https://github.com/composer/semver/actions/workflows/continuous-integration.yml/badge.svg?branch=main)](https://github.com/composer/semver/actions/workflows/continuous-integration.yml) -[![PHP Lint](https://github.com/composer/semver/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/composer/semver/actions/workflows/lint.yml) -[![PHPStan](https://github.com/composer/semver/actions/workflows/phpstan.yml/badge.svg?branch=main)](https://github.com/composer/semver/actions/workflows/phpstan.yml) - -Installation ------------- - -Install the latest version with: - -```bash -composer require composer/semver -``` - - -Requirements ------------- - -* PHP 5.3.2 is required but using the latest version of PHP is highly recommended. - - -Version Comparison ------------------- - -For details on how versions are compared, refer to the [Versions](https://getcomposer.org/doc/articles/versions.md) -article in the documentation section of the [getcomposer.org](https://getcomposer.org) website. - - -Basic usage ------------ - -### Comparator - -The [`Composer\Semver\Comparator`](https://github.com/composer/semver/blob/main/src/Comparator.php) class provides the following methods for comparing versions: - -* greaterThan($v1, $v2) -* greaterThanOrEqualTo($v1, $v2) -* lessThan($v1, $v2) -* lessThanOrEqualTo($v1, $v2) -* equalTo($v1, $v2) -* notEqualTo($v1, $v2) - -Each function takes two version strings as arguments and returns a boolean. For example: - -```php -use Composer\Semver\Comparator; - -Comparator::greaterThan('1.25.0', '1.24.0'); // 1.25.0 > 1.24.0 -``` - -### Semver - -The [`Composer\Semver\Semver`](https://github.com/composer/semver/blob/main/src/Semver.php) class provides the following methods: - -* satisfies($version, $constraints) -* satisfiedBy(array $versions, $constraint) -* sort($versions) -* rsort($versions) - -### Intervals - -The [`Composer\Semver\Intervals`](https://github.com/composer/semver/blob/main/src/Intervals.php) static class provides -a few utilities to work with complex constraints or read version intervals from a constraint: - -```php -use Composer\Semver\Intervals; - -// Checks whether $candidate is a subset of $constraint -Intervals::isSubsetOf(ConstraintInterface $candidate, ConstraintInterface $constraint); - -// Checks whether $a and $b have any intersection, equivalent to $a->matches($b) -Intervals::haveIntersections(ConstraintInterface $a, ConstraintInterface $b); - -// Optimizes a complex multi constraint by merging all intervals down to the smallest -// possible multi constraint. The drawbacks are this is not very fast, and the resulting -// multi constraint will have no human readable prettyConstraint configured on it -Intervals::compactConstraint(ConstraintInterface $constraint); - -// Creates an array of numeric intervals and branch constraints representing a given constraint -Intervals::get(ConstraintInterface $constraint); - -// Clears the memoization cache when you are done processing constraints -Intervals::clear() -``` - -See the class docblocks for more details. - - -License -------- - -composer/semver is licensed under the MIT License, see the LICENSE file for details. diff --git a/tools/php-cs-fixer/vendor/composer/semver/composer.json b/tools/php-cs-fixer/vendor/composer/semver/composer.json deleted file mode 100644 index 1fad9e54..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/composer.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "composer/semver", - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "type": "library", - "license": "MIT", - "keywords": [ - "semver", - "semantic", - "versioning", - "validation" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^3 || ^7", - "phpstan/phpstan": "^1.11" - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Composer\\Semver\\": "tests" - } - }, - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "scripts": { - "test": "SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 vendor/bin/simple-phpunit", - "phpstan": "@php vendor/bin/phpstan analyse" - } -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/Comparator.php b/tools/php-cs-fixer/vendor/composer/semver/src/Comparator.php deleted file mode 100644 index 38f483aa..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/Comparator.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver; - -use Composer\Semver\Constraint\Constraint; - -class Comparator -{ - /** - * Evaluates the expression: $version1 > $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function greaterThan($version1, $version2) - { - return self::compare($version1, '>', $version2); - } - - /** - * Evaluates the expression: $version1 >= $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function greaterThanOrEqualTo($version1, $version2) - { - return self::compare($version1, '>=', $version2); - } - - /** - * Evaluates the expression: $version1 < $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function lessThan($version1, $version2) - { - return self::compare($version1, '<', $version2); - } - - /** - * Evaluates the expression: $version1 <= $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function lessThanOrEqualTo($version1, $version2) - { - return self::compare($version1, '<=', $version2); - } - - /** - * Evaluates the expression: $version1 == $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function equalTo($version1, $version2) - { - return self::compare($version1, '==', $version2); - } - - /** - * Evaluates the expression: $version1 != $version2. - * - * @param string $version1 - * @param string $version2 - * - * @return bool - */ - public static function notEqualTo($version1, $version2) - { - return self::compare($version1, '!=', $version2); - } - - /** - * Evaluates the expression: $version1 $operator $version2. - * - * @param string $version1 - * @param string $operator - * @param string $version2 - * - * @return bool - * - * @phpstan-param Constraint::STR_OP_* $operator - */ - public static function compare($version1, $operator, $version2) - { - $constraint = new Constraint($operator, $version2); - - return $constraint->matchSpecific(new Constraint('==', $version1), true); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/CompilingMatcher.php b/tools/php-cs-fixer/vendor/composer/semver/src/CompilingMatcher.php deleted file mode 100644 index aea1d3b9..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/CompilingMatcher.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver; - -use Composer\Semver\Constraint\Constraint; -use Composer\Semver\Constraint\ConstraintInterface; - -/** - * Helper class to evaluate constraint by compiling and reusing the code to evaluate - */ -class CompilingMatcher -{ - /** - * @var array - * @phpstan-var array - */ - private static $compiledCheckerCache = array(); - /** - * @var array - * @phpstan-var array - */ - private static $resultCache = array(); - - /** @var bool */ - private static $enabled; - - /** - * @phpstan-var array - */ - private static $transOpInt = array( - Constraint::OP_EQ => Constraint::STR_OP_EQ, - Constraint::OP_LT => Constraint::STR_OP_LT, - Constraint::OP_LE => Constraint::STR_OP_LE, - Constraint::OP_GT => Constraint::STR_OP_GT, - Constraint::OP_GE => Constraint::STR_OP_GE, - Constraint::OP_NE => Constraint::STR_OP_NE, - ); - - /** - * Clears the memoization cache once you are done - * - * @return void - */ - public static function clear() - { - self::$resultCache = array(); - self::$compiledCheckerCache = array(); - } - - /** - * Evaluates the expression: $constraint match $operator $version - * - * @param ConstraintInterface $constraint - * @param int $operator - * @phpstan-param Constraint::OP_* $operator - * @param string $version - * - * @return bool - */ - public static function match(ConstraintInterface $constraint, $operator, $version) - { - $resultCacheKey = $operator.$constraint.';'.$version; - - if (isset(self::$resultCache[$resultCacheKey])) { - return self::$resultCache[$resultCacheKey]; - } - - if (self::$enabled === null) { - self::$enabled = !\in_array('eval', explode(',', (string) ini_get('disable_functions')), true); - } - if (!self::$enabled) { - return self::$resultCache[$resultCacheKey] = $constraint->matches(new Constraint(self::$transOpInt[$operator], $version)); - } - - $cacheKey = $operator.$constraint; - if (!isset(self::$compiledCheckerCache[$cacheKey])) { - $code = $constraint->compile($operator); - self::$compiledCheckerCache[$cacheKey] = $function = eval('return function($v, $b){return '.$code.';};'); - } else { - $function = self::$compiledCheckerCache[$cacheKey]; - } - - return self::$resultCache[$resultCacheKey] = $function($version, strpos($version, 'dev-') === 0); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/Bound.php b/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/Bound.php deleted file mode 100644 index 7effb11a..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/Bound.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver\Constraint; - -class Bound -{ - /** - * @var string - */ - private $version; - - /** - * @var bool - */ - private $isInclusive; - - /** - * @param string $version - * @param bool $isInclusive - */ - public function __construct($version, $isInclusive) - { - $this->version = $version; - $this->isInclusive = $isInclusive; - } - - /** - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * @return bool - */ - public function isInclusive() - { - return $this->isInclusive; - } - - /** - * @return bool - */ - public function isZero() - { - return $this->getVersion() === '0.0.0.0-dev' && $this->isInclusive(); - } - - /** - * @return bool - */ - public function isPositiveInfinity() - { - return $this->getVersion() === PHP_INT_MAX.'.0.0.0' && !$this->isInclusive(); - } - - /** - * Compares a bound to another with a given operator. - * - * @param Bound $other - * @param string $operator - * - * @return bool - */ - public function compareTo(Bound $other, $operator) - { - if (!\in_array($operator, array('<', '>'), true)) { - throw new \InvalidArgumentException('Does not support any other operator other than > or <.'); - } - - // If they are the same it doesn't matter - if ($this == $other) { - return false; - } - - $compareResult = version_compare($this->getVersion(), $other->getVersion()); - - // Not the same version means we don't need to check if the bounds are inclusive or not - if (0 !== $compareResult) { - return (('>' === $operator) ? 1 : -1) === $compareResult; - } - - // Question we're answering here is "am I higher than $other?" - return '>' === $operator ? $other->isInclusive() : !$other->isInclusive(); - } - - public function __toString() - { - return sprintf( - '%s [%s]', - $this->getVersion(), - $this->isInclusive() ? 'inclusive' : 'exclusive' - ); - } - - /** - * @return self - */ - public static function zero() - { - return new Bound('0.0.0.0-dev', true); - } - - /** - * @return self - */ - public static function positiveInfinity() - { - return new Bound(PHP_INT_MAX.'.0.0.0', false); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/Constraint.php b/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/Constraint.php deleted file mode 100644 index dc394829..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/Constraint.php +++ /dev/null @@ -1,435 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver\Constraint; - -/** - * Defines a constraint. - */ -class Constraint implements ConstraintInterface -{ - /* operator integer values */ - const OP_EQ = 0; - const OP_LT = 1; - const OP_LE = 2; - const OP_GT = 3; - const OP_GE = 4; - const OP_NE = 5; - - /* operator string values */ - const STR_OP_EQ = '=='; - const STR_OP_EQ_ALT = '='; - const STR_OP_LT = '<'; - const STR_OP_LE = '<='; - const STR_OP_GT = '>'; - const STR_OP_GE = '>='; - const STR_OP_NE = '!='; - const STR_OP_NE_ALT = '<>'; - - /** - * Operator to integer translation table. - * - * @var array - * @phpstan-var array - */ - private static $transOpStr = array( - '=' => self::OP_EQ, - '==' => self::OP_EQ, - '<' => self::OP_LT, - '<=' => self::OP_LE, - '>' => self::OP_GT, - '>=' => self::OP_GE, - '<>' => self::OP_NE, - '!=' => self::OP_NE, - ); - - /** - * Integer to operator translation table. - * - * @var array - * @phpstan-var array - */ - private static $transOpInt = array( - self::OP_EQ => '==', - self::OP_LT => '<', - self::OP_LE => '<=', - self::OP_GT => '>', - self::OP_GE => '>=', - self::OP_NE => '!=', - ); - - /** - * @var int - * @phpstan-var self::OP_* - */ - protected $operator; - - /** @var string */ - protected $version; - - /** @var string|null */ - protected $prettyString; - - /** @var Bound */ - protected $lowerBound; - - /** @var Bound */ - protected $upperBound; - - /** - * Sets operator and version to compare with. - * - * @param string $operator - * @param string $version - * - * @throws \InvalidArgumentException if invalid operator is given. - * - * @phpstan-param self::STR_OP_* $operator - */ - public function __construct($operator, $version) - { - if (!isset(self::$transOpStr[$operator])) { - throw new \InvalidArgumentException(sprintf( - 'Invalid operator "%s" given, expected one of: %s', - $operator, - implode(', ', self::getSupportedOperators()) - )); - } - - $this->operator = self::$transOpStr[$operator]; - $this->version = $version; - } - - /** - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * @return string - * - * @phpstan-return self::STR_OP_* - */ - public function getOperator() - { - return self::$transOpInt[$this->operator]; - } - - /** - * @param ConstraintInterface $provider - * - * @return bool - */ - public function matches(ConstraintInterface $provider) - { - if ($provider instanceof self) { - return $this->matchSpecific($provider); - } - - // turn matching around to find a match - return $provider->matches($this); - } - - /** - * {@inheritDoc} - */ - public function setPrettyString($prettyString) - { - $this->prettyString = $prettyString; - } - - /** - * {@inheritDoc} - */ - public function getPrettyString() - { - if ($this->prettyString) { - return $this->prettyString; - } - - return $this->__toString(); - } - - /** - * Get all supported comparison operators. - * - * @return array - * - * @phpstan-return list - */ - public static function getSupportedOperators() - { - return array_keys(self::$transOpStr); - } - - /** - * @param string $operator - * @return int - * - * @phpstan-param self::STR_OP_* $operator - * @phpstan-return self::OP_* - */ - public static function getOperatorConstant($operator) - { - return self::$transOpStr[$operator]; - } - - /** - * @param string $a - * @param string $b - * @param string $operator - * @param bool $compareBranches - * - * @throws \InvalidArgumentException if invalid operator is given. - * - * @return bool - * - * @phpstan-param self::STR_OP_* $operator - */ - public function versionCompare($a, $b, $operator, $compareBranches = false) - { - if (!isset(self::$transOpStr[$operator])) { - throw new \InvalidArgumentException(sprintf( - 'Invalid operator "%s" given, expected one of: %s', - $operator, - implode(', ', self::getSupportedOperators()) - )); - } - - $aIsBranch = strpos($a, 'dev-') === 0; - $bIsBranch = strpos($b, 'dev-') === 0; - - if ($operator === '!=' && ($aIsBranch || $bIsBranch)) { - return $a !== $b; - } - - if ($aIsBranch && $bIsBranch) { - return $operator === '==' && $a === $b; - } - - // when branches are not comparable, we make sure dev branches never match anything - if (!$compareBranches && ($aIsBranch || $bIsBranch)) { - return false; - } - - return \version_compare($a, $b, $operator); - } - - /** - * {@inheritDoc} - */ - public function compile($otherOperator) - { - if (strpos($this->version, 'dev-') === 0) { - if (self::OP_EQ === $this->operator) { - if (self::OP_EQ === $otherOperator) { - return sprintf('$b && $v === %s', \var_export($this->version, true)); - } - if (self::OP_NE === $otherOperator) { - return sprintf('!$b || $v !== %s', \var_export($this->version, true)); - } - return 'false'; - } - - if (self::OP_NE === $this->operator) { - if (self::OP_EQ === $otherOperator) { - return sprintf('!$b || $v !== %s', \var_export($this->version, true)); - } - if (self::OP_NE === $otherOperator) { - return 'true'; - } - return '!$b'; - } - - return 'false'; - } - - if (self::OP_EQ === $this->operator) { - if (self::OP_EQ === $otherOperator) { - return sprintf('\version_compare($v, %s, \'==\')', \var_export($this->version, true)); - } - if (self::OP_NE === $otherOperator) { - return sprintf('$b || \version_compare($v, %s, \'!=\')', \var_export($this->version, true)); - } - - return sprintf('!$b && \version_compare(%s, $v, \'%s\')', \var_export($this->version, true), self::$transOpInt[$otherOperator]); - } - - if (self::OP_NE === $this->operator) { - if (self::OP_EQ === $otherOperator) { - return sprintf('$b || (!$b && \version_compare($v, %s, \'!=\'))', \var_export($this->version, true)); - } - - if (self::OP_NE === $otherOperator) { - return 'true'; - } - return '!$b'; - } - - if (self::OP_LT === $this->operator || self::OP_LE === $this->operator) { - if (self::OP_LT === $otherOperator || self::OP_LE === $otherOperator) { - return '!$b'; - } - } else { // $this->operator must be self::OP_GT || self::OP_GE here - if (self::OP_GT === $otherOperator || self::OP_GE === $otherOperator) { - return '!$b'; - } - } - - if (self::OP_NE === $otherOperator) { - return 'true'; - } - - $codeComparison = sprintf('\version_compare($v, %s, \'%s\')', \var_export($this->version, true), self::$transOpInt[$this->operator]); - if ($this->operator === self::OP_LE) { - if ($otherOperator === self::OP_GT) { - return sprintf('!$b && \version_compare($v, %s, \'!=\') && ', \var_export($this->version, true)) . $codeComparison; - } - } elseif ($this->operator === self::OP_GE) { - if ($otherOperator === self::OP_LT) { - return sprintf('!$b && \version_compare($v, %s, \'!=\') && ', \var_export($this->version, true)) . $codeComparison; - } - } - - return sprintf('!$b && %s', $codeComparison); - } - - /** - * @param Constraint $provider - * @param bool $compareBranches - * - * @return bool - */ - public function matchSpecific(Constraint $provider, $compareBranches = false) - { - $noEqualOp = str_replace('=', '', self::$transOpInt[$this->operator]); - $providerNoEqualOp = str_replace('=', '', self::$transOpInt[$provider->operator]); - - $isEqualOp = self::OP_EQ === $this->operator; - $isNonEqualOp = self::OP_NE === $this->operator; - $isProviderEqualOp = self::OP_EQ === $provider->operator; - $isProviderNonEqualOp = self::OP_NE === $provider->operator; - - // '!=' operator is match when other operator is not '==' operator or version is not match - // these kinds of comparisons always have a solution - if ($isNonEqualOp || $isProviderNonEqualOp) { - if ($isNonEqualOp && !$isProviderNonEqualOp && !$isProviderEqualOp && strpos($provider->version, 'dev-') === 0) { - return false; - } - - if ($isProviderNonEqualOp && !$isNonEqualOp && !$isEqualOp && strpos($this->version, 'dev-') === 0) { - return false; - } - - if (!$isEqualOp && !$isProviderEqualOp) { - return true; - } - return $this->versionCompare($provider->version, $this->version, '!=', $compareBranches); - } - - // an example for the condition is <= 2.0 & < 1.0 - // these kinds of comparisons always have a solution - if ($this->operator !== self::OP_EQ && $noEqualOp === $providerNoEqualOp) { - return !(strpos($this->version, 'dev-') === 0 || strpos($provider->version, 'dev-') === 0); - } - - $version1 = $isEqualOp ? $this->version : $provider->version; - $version2 = $isEqualOp ? $provider->version : $this->version; - $operator = $isEqualOp ? $provider->operator : $this->operator; - - if ($this->versionCompare($version1, $version2, self::$transOpInt[$operator], $compareBranches)) { - // special case, e.g. require >= 1.0 and provide < 1.0 - // 1.0 >= 1.0 but 1.0 is outside of the provided interval - - return !(self::$transOpInt[$provider->operator] === $providerNoEqualOp - && self::$transOpInt[$this->operator] !== $noEqualOp - && \version_compare($provider->version, $this->version, '==')); - } - - return false; - } - - /** - * @return string - */ - public function __toString() - { - return self::$transOpInt[$this->operator] . ' ' . $this->version; - } - - /** - * {@inheritDoc} - */ - public function getLowerBound() - { - $this->extractBounds(); - - return $this->lowerBound; - } - - /** - * {@inheritDoc} - */ - public function getUpperBound() - { - $this->extractBounds(); - - return $this->upperBound; - } - - /** - * @return void - */ - private function extractBounds() - { - if (null !== $this->lowerBound) { - return; - } - - // Branches - if (strpos($this->version, 'dev-') === 0) { - $this->lowerBound = Bound::zero(); - $this->upperBound = Bound::positiveInfinity(); - - return; - } - - switch ($this->operator) { - case self::OP_EQ: - $this->lowerBound = new Bound($this->version, true); - $this->upperBound = new Bound($this->version, true); - break; - case self::OP_LT: - $this->lowerBound = Bound::zero(); - $this->upperBound = new Bound($this->version, false); - break; - case self::OP_LE: - $this->lowerBound = Bound::zero(); - $this->upperBound = new Bound($this->version, true); - break; - case self::OP_GT: - $this->lowerBound = new Bound($this->version, false); - $this->upperBound = Bound::positiveInfinity(); - break; - case self::OP_GE: - $this->lowerBound = new Bound($this->version, true); - $this->upperBound = Bound::positiveInfinity(); - break; - case self::OP_NE: - $this->lowerBound = Bound::zero(); - $this->upperBound = Bound::positiveInfinity(); - break; - } - } -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/ConstraintInterface.php b/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/ConstraintInterface.php deleted file mode 100644 index 389b935b..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/ConstraintInterface.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver\Constraint; - -/** - * DO NOT IMPLEMENT this interface. It is only meant for usage as a type hint - * in libraries relying on composer/semver but creating your own constraint class - * that implements this interface is not a supported use case and will cause the - * composer/semver components to return unexpected results. - */ -interface ConstraintInterface -{ - /** - * Checks whether the given constraint intersects in any way with this constraint - * - * @param ConstraintInterface $provider - * - * @return bool - */ - public function matches(ConstraintInterface $provider); - - /** - * Provides a compiled version of the constraint for the given operator - * The compiled version must be a PHP expression. - * Executor of compile version must provide 2 variables: - * - $v = the string version to compare with - * - $b = whether or not the version is a non-comparable branch (starts with "dev-") - * - * @see Constraint::OP_* for the list of available operators. - * @example return '!$b && version_compare($v, '1.0', '>')'; - * - * @param int $otherOperator one Constraint::OP_* - * - * @return string - * - * @phpstan-param Constraint::OP_* $otherOperator - */ - public function compile($otherOperator); - - /** - * @return Bound - */ - public function getUpperBound(); - - /** - * @return Bound - */ - public function getLowerBound(); - - /** - * @return string - */ - public function getPrettyString(); - - /** - * @param string|null $prettyString - * - * @return void - */ - public function setPrettyString($prettyString); - - /** - * @return string - */ - public function __toString(); -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MatchAllConstraint.php b/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MatchAllConstraint.php deleted file mode 100644 index 5e51af95..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MatchAllConstraint.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver\Constraint; - -/** - * Defines the absence of a constraint. - * - * This constraint matches everything. - */ -class MatchAllConstraint implements ConstraintInterface -{ - /** @var string|null */ - protected $prettyString; - - /** - * @param ConstraintInterface $provider - * - * @return bool - */ - public function matches(ConstraintInterface $provider) - { - return true; - } - - /** - * {@inheritDoc} - */ - public function compile($otherOperator) - { - return 'true'; - } - - /** - * {@inheritDoc} - */ - public function setPrettyString($prettyString) - { - $this->prettyString = $prettyString; - } - - /** - * {@inheritDoc} - */ - public function getPrettyString() - { - if ($this->prettyString) { - return $this->prettyString; - } - - return (string) $this; - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - return '*'; - } - - /** - * {@inheritDoc} - */ - public function getUpperBound() - { - return Bound::positiveInfinity(); - } - - /** - * {@inheritDoc} - */ - public function getLowerBound() - { - return Bound::zero(); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MatchNoneConstraint.php b/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MatchNoneConstraint.php deleted file mode 100644 index dadcf622..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MatchNoneConstraint.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver\Constraint; - -/** - * Blackhole of constraints, nothing escapes it - */ -class MatchNoneConstraint implements ConstraintInterface -{ - /** @var string|null */ - protected $prettyString; - - /** - * @param ConstraintInterface $provider - * - * @return bool - */ - public function matches(ConstraintInterface $provider) - { - return false; - } - - /** - * {@inheritDoc} - */ - public function compile($otherOperator) - { - return 'false'; - } - - /** - * {@inheritDoc} - */ - public function setPrettyString($prettyString) - { - $this->prettyString = $prettyString; - } - - /** - * {@inheritDoc} - */ - public function getPrettyString() - { - if ($this->prettyString) { - return $this->prettyString; - } - - return (string) $this; - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - return '[]'; - } - - /** - * {@inheritDoc} - */ - public function getUpperBound() - { - return new Bound('0.0.0.0-dev', false); - } - - /** - * {@inheritDoc} - */ - public function getLowerBound() - { - return new Bound('0.0.0.0-dev', false); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MultiConstraint.php b/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MultiConstraint.php deleted file mode 100644 index 1f4c0061..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/Constraint/MultiConstraint.php +++ /dev/null @@ -1,325 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver\Constraint; - -/** - * Defines a conjunctive or disjunctive set of constraints. - */ -class MultiConstraint implements ConstraintInterface -{ - /** - * @var ConstraintInterface[] - * @phpstan-var non-empty-array - */ - protected $constraints; - - /** @var string|null */ - protected $prettyString; - - /** @var string|null */ - protected $string; - - /** @var bool */ - protected $conjunctive; - - /** @var Bound|null */ - protected $lowerBound; - - /** @var Bound|null */ - protected $upperBound; - - /** - * @param ConstraintInterface[] $constraints A set of constraints - * @param bool $conjunctive Whether the constraints should be treated as conjunctive or disjunctive - * - * @throws \InvalidArgumentException If less than 2 constraints are passed - */ - public function __construct(array $constraints, $conjunctive = true) - { - if (\count($constraints) < 2) { - throw new \InvalidArgumentException( - 'Must provide at least two constraints for a MultiConstraint. Use '. - 'the regular Constraint class for one constraint only or MatchAllConstraint for none. You may use '. - 'MultiConstraint::create() which optimizes and handles those cases automatically.' - ); - } - - $this->constraints = $constraints; - $this->conjunctive = $conjunctive; - } - - /** - * @return ConstraintInterface[] - */ - public function getConstraints() - { - return $this->constraints; - } - - /** - * @return bool - */ - public function isConjunctive() - { - return $this->conjunctive; - } - - /** - * @return bool - */ - public function isDisjunctive() - { - return !$this->conjunctive; - } - - /** - * {@inheritDoc} - */ - public function compile($otherOperator) - { - $parts = array(); - foreach ($this->constraints as $constraint) { - $code = $constraint->compile($otherOperator); - if ($code === 'true') { - if (!$this->conjunctive) { - return 'true'; - } - } elseif ($code === 'false') { - if ($this->conjunctive) { - return 'false'; - } - } else { - $parts[] = '('.$code.')'; - } - } - - if (!$parts) { - return $this->conjunctive ? 'true' : 'false'; - } - - return $this->conjunctive ? implode('&&', $parts) : implode('||', $parts); - } - - /** - * @param ConstraintInterface $provider - * - * @return bool - */ - public function matches(ConstraintInterface $provider) - { - if (false === $this->conjunctive) { - foreach ($this->constraints as $constraint) { - if ($provider->matches($constraint)) { - return true; - } - } - - return false; - } - - // when matching a conjunctive and a disjunctive multi constraint we have to iterate over the disjunctive one - // otherwise we'd return true if different parts of the disjunctive constraint match the conjunctive one - // which would lead to incorrect results, e.g. [>1 and <2] would match [<1 or >2] although they do not intersect - if ($provider instanceof MultiConstraint && $provider->isDisjunctive()) { - return $provider->matches($this); - } - - foreach ($this->constraints as $constraint) { - if (!$provider->matches($constraint)) { - return false; - } - } - - return true; - } - - /** - * {@inheritDoc} - */ - public function setPrettyString($prettyString) - { - $this->prettyString = $prettyString; - } - - /** - * {@inheritDoc} - */ - public function getPrettyString() - { - if ($this->prettyString) { - return $this->prettyString; - } - - return (string) $this; - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - if ($this->string !== null) { - return $this->string; - } - - $constraints = array(); - foreach ($this->constraints as $constraint) { - $constraints[] = (string) $constraint; - } - - return $this->string = '[' . implode($this->conjunctive ? ' ' : ' || ', $constraints) . ']'; - } - - /** - * {@inheritDoc} - */ - public function getLowerBound() - { - $this->extractBounds(); - - if (null === $this->lowerBound) { - throw new \LogicException('extractBounds should have populated the lowerBound property'); - } - - return $this->lowerBound; - } - - /** - * {@inheritDoc} - */ - public function getUpperBound() - { - $this->extractBounds(); - - if (null === $this->upperBound) { - throw new \LogicException('extractBounds should have populated the upperBound property'); - } - - return $this->upperBound; - } - - /** - * Tries to optimize the constraints as much as possible, meaning - * reducing/collapsing congruent constraints etc. - * Does not necessarily return a MultiConstraint instance if - * things can be reduced to a simple constraint - * - * @param ConstraintInterface[] $constraints A set of constraints - * @param bool $conjunctive Whether the constraints should be treated as conjunctive or disjunctive - * - * @return ConstraintInterface - */ - public static function create(array $constraints, $conjunctive = true) - { - if (0 === \count($constraints)) { - return new MatchAllConstraint(); - } - - if (1 === \count($constraints)) { - return $constraints[0]; - } - - $optimized = self::optimizeConstraints($constraints, $conjunctive); - if ($optimized !== null) { - list($constraints, $conjunctive) = $optimized; - if (\count($constraints) === 1) { - return $constraints[0]; - } - } - - return new self($constraints, $conjunctive); - } - - /** - * @param ConstraintInterface[] $constraints - * @param bool $conjunctive - * @return ?array - * - * @phpstan-return array{0: list, 1: bool}|null - */ - private static function optimizeConstraints(array $constraints, $conjunctive) - { - // parse the two OR groups and if they are contiguous we collapse - // them into one constraint - // [>= 1 < 2] || [>= 2 < 3] || [>= 3 < 4] => [>= 1 < 4] - if (!$conjunctive) { - $left = $constraints[0]; - $mergedConstraints = array(); - $optimized = false; - for ($i = 1, $l = \count($constraints); $i < $l; $i++) { - $right = $constraints[$i]; - if ( - $left instanceof self - && $left->conjunctive - && $right instanceof self - && $right->conjunctive - && \count($left->constraints) === 2 - && \count($right->constraints) === 2 - && ($left0 = (string) $left->constraints[0]) - && $left0[0] === '>' && $left0[1] === '=' - && ($left1 = (string) $left->constraints[1]) - && $left1[0] === '<' - && ($right0 = (string) $right->constraints[0]) - && $right0[0] === '>' && $right0[1] === '=' - && ($right1 = (string) $right->constraints[1]) - && $right1[0] === '<' - && substr($left1, 2) === substr($right0, 3) - ) { - $optimized = true; - $left = new MultiConstraint( - array( - $left->constraints[0], - $right->constraints[1], - ), - true); - } else { - $mergedConstraints[] = $left; - $left = $right; - } - } - if ($optimized) { - $mergedConstraints[] = $left; - return array($mergedConstraints, false); - } - } - - // TODO: Here's the place to put more optimizations - - return null; - } - - /** - * @return void - */ - private function extractBounds() - { - if (null !== $this->lowerBound) { - return; - } - - foreach ($this->constraints as $constraint) { - if (null === $this->lowerBound || null === $this->upperBound) { - $this->lowerBound = $constraint->getLowerBound(); - $this->upperBound = $constraint->getUpperBound(); - continue; - } - - if ($constraint->getLowerBound()->compareTo($this->lowerBound, $this->isConjunctive() ? '>' : '<')) { - $this->lowerBound = $constraint->getLowerBound(); - } - - if ($constraint->getUpperBound()->compareTo($this->upperBound, $this->isConjunctive() ? '<' : '>')) { - $this->upperBound = $constraint->getUpperBound(); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/Interval.php b/tools/php-cs-fixer/vendor/composer/semver/src/Interval.php deleted file mode 100644 index 43d5a4f5..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/Interval.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver; - -use Composer\Semver\Constraint\Constraint; - -class Interval -{ - /** @var Constraint */ - private $start; - /** @var Constraint */ - private $end; - - public function __construct(Constraint $start, Constraint $end) - { - $this->start = $start; - $this->end = $end; - } - - /** - * @return Constraint - */ - public function getStart() - { - return $this->start; - } - - /** - * @return Constraint - */ - public function getEnd() - { - return $this->end; - } - - /** - * @return Constraint - */ - public static function fromZero() - { - static $zero; - - if (null === $zero) { - $zero = new Constraint('>=', '0.0.0.0-dev'); - } - - return $zero; - } - - /** - * @return Constraint - */ - public static function untilPositiveInfinity() - { - static $positiveInfinity; - - if (null === $positiveInfinity) { - $positiveInfinity = new Constraint('<', PHP_INT_MAX.'.0.0.0'); - } - - return $positiveInfinity; - } - - /** - * @return self - */ - public static function any() - { - return new self(self::fromZero(), self::untilPositiveInfinity()); - } - - /** - * @return array{'names': string[], 'exclude': bool} - */ - public static function anyDev() - { - // any == exclude nothing - return array('names' => array(), 'exclude' => true); - } - - /** - * @return array{'names': string[], 'exclude': bool} - */ - public static function noDev() - { - // nothing == no names included - return array('names' => array(), 'exclude' => false); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/Intervals.php b/tools/php-cs-fixer/vendor/composer/semver/src/Intervals.php deleted file mode 100644 index d889d0ad..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/Intervals.php +++ /dev/null @@ -1,478 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver; - -use Composer\Semver\Constraint\Constraint; -use Composer\Semver\Constraint\ConstraintInterface; -use Composer\Semver\Constraint\MatchAllConstraint; -use Composer\Semver\Constraint\MatchNoneConstraint; -use Composer\Semver\Constraint\MultiConstraint; - -/** - * Helper class generating intervals from constraints - * - * This contains utilities for: - * - * - compacting an existing constraint which can be used to combine several into one - * by creating a MultiConstraint out of the many constraints you have. - * - * - checking whether one subset is a subset of another. - * - * Note: You should call clear to free memoization memory usage when you are done using this class - */ -class Intervals -{ - /** - * @phpstan-var array - */ - private static $intervalsCache = array(); - - /** - * @phpstan-var array - */ - private static $opSortOrder = array( - '>=' => -3, - '<' => -2, - '>' => 2, - '<=' => 3, - ); - - /** - * Clears the memoization cache once you are done - * - * @return void - */ - public static function clear() - { - self::$intervalsCache = array(); - } - - /** - * Checks whether $candidate is a subset of $constraint - * - * @return bool - */ - public static function isSubsetOf(ConstraintInterface $candidate, ConstraintInterface $constraint) - { - if ($constraint instanceof MatchAllConstraint) { - return true; - } - - if ($candidate instanceof MatchNoneConstraint || $constraint instanceof MatchNoneConstraint) { - return false; - } - - $intersectionIntervals = self::get(new MultiConstraint(array($candidate, $constraint), true)); - $candidateIntervals = self::get($candidate); - if (\count($intersectionIntervals['numeric']) !== \count($candidateIntervals['numeric'])) { - return false; - } - - foreach ($intersectionIntervals['numeric'] as $index => $interval) { - if (!isset($candidateIntervals['numeric'][$index])) { - return false; - } - - if ((string) $candidateIntervals['numeric'][$index]->getStart() !== (string) $interval->getStart()) { - return false; - } - - if ((string) $candidateIntervals['numeric'][$index]->getEnd() !== (string) $interval->getEnd()) { - return false; - } - } - - if ($intersectionIntervals['branches']['exclude'] !== $candidateIntervals['branches']['exclude']) { - return false; - } - if (\count($intersectionIntervals['branches']['names']) !== \count($candidateIntervals['branches']['names'])) { - return false; - } - foreach ($intersectionIntervals['branches']['names'] as $index => $name) { - if ($name !== $candidateIntervals['branches']['names'][$index]) { - return false; - } - } - - return true; - } - - /** - * Checks whether $a and $b have any intersection, equivalent to $a->matches($b) - * - * @return bool - */ - public static function haveIntersections(ConstraintInterface $a, ConstraintInterface $b) - { - if ($a instanceof MatchAllConstraint || $b instanceof MatchAllConstraint) { - return true; - } - - if ($a instanceof MatchNoneConstraint || $b instanceof MatchNoneConstraint) { - return false; - } - - $intersectionIntervals = self::generateIntervals(new MultiConstraint(array($a, $b), true), true); - - return \count($intersectionIntervals['numeric']) > 0 || $intersectionIntervals['branches']['exclude'] || \count($intersectionIntervals['branches']['names']) > 0; - } - - /** - * Attempts to optimize a MultiConstraint - * - * When merging MultiConstraints together they can get very large, this will - * compact it by looking at the real intervals covered by all the constraints - * and then creates a new constraint containing only the smallest amount of rules - * to match the same intervals. - * - * @return ConstraintInterface - */ - public static function compactConstraint(ConstraintInterface $constraint) - { - if (!$constraint instanceof MultiConstraint) { - return $constraint; - } - - $intervals = self::generateIntervals($constraint); - $constraints = array(); - $hasNumericMatchAll = false; - - if (\count($intervals['numeric']) === 1 && (string) $intervals['numeric'][0]->getStart() === (string) Interval::fromZero() && (string) $intervals['numeric'][0]->getEnd() === (string) Interval::untilPositiveInfinity()) { - $constraints[] = $intervals['numeric'][0]->getStart(); - $hasNumericMatchAll = true; - } else { - $unEqualConstraints = array(); - for ($i = 0, $count = \count($intervals['numeric']); $i < $count; $i++) { - $interval = $intervals['numeric'][$i]; - - // if current interval ends with < N and next interval begins with > N we can swap this out for != N - // but this needs to happen as a conjunctive expression together with the start of the current interval - // and end of next interval, so [>=M, N, [>=M, !=N, getEnd()->getOperator() === '<' && $i+1 < $count) { - $nextInterval = $intervals['numeric'][$i+1]; - if ($interval->getEnd()->getVersion() === $nextInterval->getStart()->getVersion() && $nextInterval->getStart()->getOperator() === '>') { - // only add a start if we didn't already do so, can be skipped if we're looking at second - // interval in [>=M, N, P, =M, !=N] already and we only want to add !=P right now - if (\count($unEqualConstraints) === 0 && (string) $interval->getStart() !== (string) Interval::fromZero()) { - $unEqualConstraints[] = $interval->getStart(); - } - $unEqualConstraints[] = new Constraint('!=', $interval->getEnd()->getVersion()); - continue; - } - } - - if (\count($unEqualConstraints) > 0) { - // this is where the end of the following interval of a != constraint is added as explained above - if ((string) $interval->getEnd() !== (string) Interval::untilPositiveInfinity()) { - $unEqualConstraints[] = $interval->getEnd(); - } - - // count is 1 if entire constraint is just one != expression - if (\count($unEqualConstraints) > 1) { - $constraints[] = new MultiConstraint($unEqualConstraints, true); - } else { - $constraints[] = $unEqualConstraints[0]; - } - - $unEqualConstraints = array(); - continue; - } - - // convert back >= x - <= x intervals to == x - if ($interval->getStart()->getVersion() === $interval->getEnd()->getVersion() && $interval->getStart()->getOperator() === '>=' && $interval->getEnd()->getOperator() === '<=') { - $constraints[] = new Constraint('==', $interval->getStart()->getVersion()); - continue; - } - - if ((string) $interval->getStart() === (string) Interval::fromZero()) { - $constraints[] = $interval->getEnd(); - } elseif ((string) $interval->getEnd() === (string) Interval::untilPositiveInfinity()) { - $constraints[] = $interval->getStart(); - } else { - $constraints[] = new MultiConstraint(array($interval->getStart(), $interval->getEnd()), true); - } - } - } - - $devConstraints = array(); - - if (0 === \count($intervals['branches']['names'])) { - if ($intervals['branches']['exclude']) { - if ($hasNumericMatchAll) { - return new MatchAllConstraint; - } - // otherwise constraint should contain a != operator and already cover this - } - } else { - foreach ($intervals['branches']['names'] as $branchName) { - if ($intervals['branches']['exclude']) { - $devConstraints[] = new Constraint('!=', $branchName); - } else { - $devConstraints[] = new Constraint('==', $branchName); - } - } - - // excluded branches, e.g. != dev-foo are conjunctive with the interval, so - // > 2.0 != dev-foo must return a conjunctive constraint - if ($intervals['branches']['exclude']) { - if (\count($constraints) > 1) { - return new MultiConstraint(array_merge( - array(new MultiConstraint($constraints, false)), - $devConstraints - ), true); - } - - if (\count($constraints) === 1 && (string)$constraints[0] === (string)Interval::fromZero()) { - if (\count($devConstraints) > 1) { - return new MultiConstraint($devConstraints, true); - } - return $devConstraints[0]; - } - - return new MultiConstraint(array_merge($constraints, $devConstraints), true); - } - - // otherwise devConstraints contains a list of == operators for branches which are disjunctive with the - // rest of the constraint - $constraints = array_merge($constraints, $devConstraints); - } - - if (\count($constraints) > 1) { - return new MultiConstraint($constraints, false); - } - - if (\count($constraints) === 1) { - return $constraints[0]; - } - - return new MatchNoneConstraint; - } - - /** - * Creates an array of numeric intervals and branch constraints representing a given constraint - * - * if the returned numeric array is empty it means the constraint matches nothing in the numeric range (0 - +inf) - * if the returned branches array is empty it means no dev-* versions are matched - * if a constraint matches all possible dev-* versions, branches will contain Interval::anyDev() - * - * @return array - * @phpstan-return array{'numeric': Interval[], 'branches': array{'names': string[], 'exclude': bool}} - */ - public static function get(ConstraintInterface $constraint) - { - $key = (string) $constraint; - - if (!isset(self::$intervalsCache[$key])) { - self::$intervalsCache[$key] = self::generateIntervals($constraint); - } - - return self::$intervalsCache[$key]; - } - - /** - * @param bool $stopOnFirstValidInterval - * - * @phpstan-return array{'numeric': Interval[], 'branches': array{'names': string[], 'exclude': bool}} - */ - private static function generateIntervals(ConstraintInterface $constraint, $stopOnFirstValidInterval = false) - { - if ($constraint instanceof MatchAllConstraint) { - return array('numeric' => array(new Interval(Interval::fromZero(), Interval::untilPositiveInfinity())), 'branches' => Interval::anyDev()); - } - - if ($constraint instanceof MatchNoneConstraint) { - return array('numeric' => array(), 'branches' => array('names' => array(), 'exclude' => false)); - } - - if ($constraint instanceof Constraint) { - return self::generateSingleConstraintIntervals($constraint); - } - - if (!$constraint instanceof MultiConstraint) { - throw new \UnexpectedValueException('The constraint passed in should be an MatchAllConstraint, Constraint or MultiConstraint instance, got '.\get_class($constraint).'.'); - } - - $constraints = $constraint->getConstraints(); - - $numericGroups = array(); - $constraintBranches = array(); - foreach ($constraints as $c) { - $res = self::get($c); - $numericGroups[] = $res['numeric']; - $constraintBranches[] = $res['branches']; - } - - if ($constraint->isDisjunctive()) { - $branches = Interval::noDev(); - foreach ($constraintBranches as $b) { - if ($b['exclude']) { - if ($branches['exclude']) { - // disjunctive constraint, so only exclude what's excluded in all constraints - // !=a,!=b || !=b,!=c => !=b - $branches['names'] = array_intersect($branches['names'], $b['names']); - } else { - // disjunctive constraint so exclude all names which are not explicitly included in the alternative - // (==b || ==c) || !=a,!=b => !=a - $branches['exclude'] = true; - $branches['names'] = array_diff($b['names'], $branches['names']); - } - } else { - if ($branches['exclude']) { - // disjunctive constraint so exclude all names which are not explicitly included in the alternative - // !=a,!=b || (==b || ==c) => !=a - $branches['names'] = array_diff($branches['names'], $b['names']); - } else { - // disjunctive constraint, so just add all the other branches - // (==a || ==b) || ==c => ==a || ==b || ==c - $branches['names'] = array_merge($branches['names'], $b['names']); - } - } - } - } else { - $branches = Interval::anyDev(); - foreach ($constraintBranches as $b) { - if ($b['exclude']) { - if ($branches['exclude']) { - // conjunctive, so just add all branch names to be excluded - // !=a && !=b => !=a,!=b - $branches['names'] = array_merge($branches['names'], $b['names']); - } else { - // conjunctive, so only keep included names which are not excluded - // (==a||==c) && !=a,!=b => ==c - $branches['names'] = array_diff($branches['names'], $b['names']); - } - } else { - if ($branches['exclude']) { - // conjunctive, so only keep included names which are not excluded - // !=a,!=b && (==a||==c) => ==c - $branches['names'] = array_diff($b['names'], $branches['names']); - $branches['exclude'] = false; - } else { - // conjunctive, so only keep names that are included in both - // (==a||==b) && (==a||==c) => ==a - $branches['names'] = array_intersect($branches['names'], $b['names']); - } - } - } - } - - $branches['names'] = array_unique($branches['names']); - - if (\count($numericGroups) === 1) { - return array('numeric' => $numericGroups[0], 'branches' => $branches); - } - - $borders = array(); - foreach ($numericGroups as $group) { - foreach ($group as $interval) { - $borders[] = array('version' => $interval->getStart()->getVersion(), 'operator' => $interval->getStart()->getOperator(), 'side' => 'start'); - $borders[] = array('version' => $interval->getEnd()->getVersion(), 'operator' => $interval->getEnd()->getOperator(), 'side' => 'end'); - } - } - - $opSortOrder = self::$opSortOrder; - usort($borders, function ($a, $b) use ($opSortOrder) { - $order = version_compare($a['version'], $b['version']); - if ($order === 0) { - return $opSortOrder[$a['operator']] - $opSortOrder[$b['operator']]; - } - - return $order; - }); - - $activeIntervals = 0; - $intervals = array(); - $index = 0; - $activationThreshold = $constraint->isConjunctive() ? \count($numericGroups) : 1; - $start = null; - foreach ($borders as $border) { - if ($border['side'] === 'start') { - $activeIntervals++; - } else { - $activeIntervals--; - } - if (!$start && $activeIntervals >= $activationThreshold) { - $start = new Constraint($border['operator'], $border['version']); - } elseif ($start && $activeIntervals < $activationThreshold) { - // filter out invalid intervals like > x - <= x, or >= x - < x - if ( - version_compare($start->getVersion(), $border['version'], '=') - && ( - ($start->getOperator() === '>' && $border['operator'] === '<=') - || ($start->getOperator() === '>=' && $border['operator'] === '<') - ) - ) { - unset($intervals[$index]); - } else { - $intervals[$index] = new Interval($start, new Constraint($border['operator'], $border['version'])); - $index++; - - if ($stopOnFirstValidInterval) { - break; - } - } - - $start = null; - } - } - - return array('numeric' => $intervals, 'branches' => $branches); - } - - /** - * @phpstan-return array{'numeric': Interval[], 'branches': array{'names': string[], 'exclude': bool}} - */ - private static function generateSingleConstraintIntervals(Constraint $constraint) - { - $op = $constraint->getOperator(); - - // handle branch constraints first - if (strpos($constraint->getVersion(), 'dev-') === 0) { - $intervals = array(); - $branches = array('names' => array(), 'exclude' => false); - - // != dev-foo means any numeric version may match, we treat >/< like != they are not really defined for branches - if ($op === '!=') { - $intervals[] = new Interval(Interval::fromZero(), Interval::untilPositiveInfinity()); - $branches = array('names' => array($constraint->getVersion()), 'exclude' => true); - } elseif ($op === '==') { - $branches['names'][] = $constraint->getVersion(); - } - - return array( - 'numeric' => $intervals, - 'branches' => $branches, - ); - } - - if ($op[0] === '>') { // > & >= - return array('numeric' => array(new Interval($constraint, Interval::untilPositiveInfinity())), 'branches' => Interval::noDev()); - } - if ($op[0] === '<') { // < & <= - return array('numeric' => array(new Interval(Interval::fromZero(), $constraint)), 'branches' => Interval::noDev()); - } - if ($op === '!=') { - // convert !=x to intervals of 0 - x - +inf + dev* - return array('numeric' => array( - new Interval(Interval::fromZero(), new Constraint('<', $constraint->getVersion())), - new Interval(new Constraint('>', $constraint->getVersion()), Interval::untilPositiveInfinity()), - ), 'branches' => Interval::anyDev()); - } - - // convert ==x to an interval of >=x - <=x - return array('numeric' => array( - new Interval(new Constraint('>=', $constraint->getVersion()), new Constraint('<=', $constraint->getVersion())), - ), 'branches' => Interval::noDev()); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/Semver.php b/tools/php-cs-fixer/vendor/composer/semver/src/Semver.php deleted file mode 100644 index 4d6de3c2..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/Semver.php +++ /dev/null @@ -1,129 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver; - -use Composer\Semver\Constraint\Constraint; - -class Semver -{ - const SORT_ASC = 1; - const SORT_DESC = -1; - - /** @var VersionParser */ - private static $versionParser; - - /** - * Determine if given version satisfies given constraints. - * - * @param string $version - * @param string $constraints - * - * @return bool - */ - public static function satisfies($version, $constraints) - { - if (null === self::$versionParser) { - self::$versionParser = new VersionParser(); - } - - $versionParser = self::$versionParser; - $provider = new Constraint('==', $versionParser->normalize($version)); - $parsedConstraints = $versionParser->parseConstraints($constraints); - - return $parsedConstraints->matches($provider); - } - - /** - * Return all versions that satisfy given constraints. - * - * @param string[] $versions - * @param string $constraints - * - * @return string[] - */ - public static function satisfiedBy(array $versions, $constraints) - { - $versions = array_filter($versions, function ($version) use ($constraints) { - return Semver::satisfies($version, $constraints); - }); - - return array_values($versions); - } - - /** - * Sort given array of versions. - * - * @param string[] $versions - * - * @return string[] - */ - public static function sort(array $versions) - { - return self::usort($versions, self::SORT_ASC); - } - - /** - * Sort given array of versions in reverse. - * - * @param string[] $versions - * - * @return string[] - */ - public static function rsort(array $versions) - { - return self::usort($versions, self::SORT_DESC); - } - - /** - * @param string[] $versions - * @param int $direction - * - * @return string[] - */ - private static function usort(array $versions, $direction) - { - if (null === self::$versionParser) { - self::$versionParser = new VersionParser(); - } - - $versionParser = self::$versionParser; - $normalized = array(); - - // Normalize outside of usort() scope for minor performance increase. - // Creates an array of arrays: [[normalized, key], ...] - foreach ($versions as $key => $version) { - $normalizedVersion = $versionParser->normalize($version); - $normalizedVersion = $versionParser->normalizeDefaultBranch($normalizedVersion); - $normalized[] = array($normalizedVersion, $key); - } - - usort($normalized, function (array $left, array $right) use ($direction) { - if ($left[0] === $right[0]) { - return 0; - } - - if (Comparator::lessThan($left[0], $right[0])) { - return -$direction; - } - - return $direction; - }); - - // Recreate input array, using the original indexes which are now in sorted order. - $sorted = array(); - foreach ($normalized as $item) { - $sorted[] = $versions[$item[1]]; - } - - return $sorted; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/semver/src/VersionParser.php b/tools/php-cs-fixer/vendor/composer/semver/src/VersionParser.php deleted file mode 100644 index 305a0fae..00000000 --- a/tools/php-cs-fixer/vendor/composer/semver/src/VersionParser.php +++ /dev/null @@ -1,591 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\Semver; - -use Composer\Semver\Constraint\ConstraintInterface; -use Composer\Semver\Constraint\MatchAllConstraint; -use Composer\Semver\Constraint\MultiConstraint; -use Composer\Semver\Constraint\Constraint; - -/** - * Version parser. - * - * @author Jordi Boggiano - */ -class VersionParser -{ - /** - * Regex to match pre-release data (sort of). - * - * Due to backwards compatibility: - * - Instead of enforcing hyphen, an underscore, dot or nothing at all are also accepted. - * - Only stabilities as recognized by Composer are allowed to precede a numerical identifier. - * - Numerical-only pre-release identifiers are not supported, see tests. - * - * |--------------| - * [major].[minor].[patch] -[pre-release] +[build-metadata] - * - * @var string - */ - private static $modifierRegex = '[._-]?(?:(stable|beta|b|RC|alpha|a|patch|pl|p)((?:[.-]?\d+)*+)?)?([.-]?dev)?'; - - /** @var string */ - private static $stabilitiesRegex = 'stable|RC|beta|alpha|dev'; - - /** - * Returns the stability of a version. - * - * @param string $version - * - * @return string - * @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev' - */ - public static function parseStability($version) - { - $version = (string) preg_replace('{#.+$}', '', (string) $version); - - if (strpos($version, 'dev-') === 0 || '-dev' === substr($version, -4)) { - return 'dev'; - } - - preg_match('{' . self::$modifierRegex . '(?:\+.*)?$}i', strtolower($version), $match); - - if (!empty($match[3])) { - return 'dev'; - } - - if (!empty($match[1])) { - if ('beta' === $match[1] || 'b' === $match[1]) { - return 'beta'; - } - if ('alpha' === $match[1] || 'a' === $match[1]) { - return 'alpha'; - } - if ('rc' === $match[1]) { - return 'RC'; - } - } - - return 'stable'; - } - - /** - * @param string $stability - * - * @return string - * @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev' - */ - public static function normalizeStability($stability) - { - $stability = strtolower((string) $stability); - - if (!in_array($stability, array('stable', 'rc', 'beta', 'alpha', 'dev'), true)) { - throw new \InvalidArgumentException('Invalid stability string "'.$stability.'", expected one of stable, RC, beta, alpha or dev'); - } - - return $stability === 'rc' ? 'RC' : $stability; - } - - /** - * Normalizes a version string to be able to perform comparisons on it. - * - * @param string $version - * @param ?string $fullVersion optional complete version string to give more context - * - * @throws \UnexpectedValueException - * - * @return string - */ - public function normalize($version, $fullVersion = null) - { - $version = trim((string) $version); - $origVersion = $version; - if (null === $fullVersion) { - $fullVersion = $version; - } - - // strip off aliasing - if (preg_match('{^([^,\s]++) ++as ++([^,\s]++)$}', $version, $match)) { - $version = $match[1]; - } - - // strip off stability flag - if (preg_match('{@(?:' . self::$stabilitiesRegex . ')$}i', $version, $match)) { - $version = substr($version, 0, strlen($version) - strlen($match[0])); - } - - // normalize master/trunk/default branches to dev-name for BC with 1.x as these used to be valid constraints - if (\in_array($version, array('master', 'trunk', 'default'), true)) { - $version = 'dev-' . $version; - } - - // if requirement is branch-like, use full name - if (stripos($version, 'dev-') === 0) { - return 'dev-' . substr($version, 4); - } - - // strip off build metadata - if (preg_match('{^([^,\s+]++)\+[^\s]++$}', $version, $match)) { - $version = $match[1]; - } - - // match classical versioning - if (preg_match('{^v?(\d{1,5}+)(\.\d++)?(\.\d++)?(\.\d++)?' . self::$modifierRegex . '$}i', $version, $matches)) { - $version = $matches[1] - . (!empty($matches[2]) ? $matches[2] : '.0') - . (!empty($matches[3]) ? $matches[3] : '.0') - . (!empty($matches[4]) ? $matches[4] : '.0'); - $index = 5; - // match date(time) based versioning - } elseif (preg_match('{^v?(\d{4}(?:[.:-]?\d{2}){1,6}(?:[.:-]?\d{1,3}){0,2})' . self::$modifierRegex . '$}i', $version, $matches)) { - $version = (string) preg_replace('{\D}', '.', $matches[1]); - $index = 2; - } - - // add version modifiers if a version was matched - if (isset($index)) { - if (!empty($matches[$index])) { - if ('stable' === $matches[$index]) { - return $version; - } - $version .= '-' . $this->expandStability($matches[$index]) . (isset($matches[$index + 1]) && '' !== $matches[$index + 1] ? ltrim($matches[$index + 1], '.-') : ''); - } - - if (!empty($matches[$index + 2])) { - $version .= '-dev'; - } - - return $version; - } - - // match dev branches - if (preg_match('{(.*?)[.-]?dev$}i', $version, $match)) { - try { - $normalized = $this->normalizeBranch($match[1]); - // a branch ending with -dev is only valid if it is numeric - // if it gets prefixed with dev- it means the branch name should - // have had a dev- prefix already when passed to normalize - if (strpos($normalized, 'dev-') === false) { - return $normalized; - } - } catch (\Exception $e) { - } - } - - $extraMessage = ''; - if (preg_match('{ +as +' . preg_quote($version) . '(?:@(?:'.self::$stabilitiesRegex.'))?$}', $fullVersion)) { - $extraMessage = ' in "' . $fullVersion . '", the alias must be an exact version'; - } elseif (preg_match('{^' . preg_quote($version) . '(?:@(?:'.self::$stabilitiesRegex.'))? +as +}', $fullVersion)) { - $extraMessage = ' in "' . $fullVersion . '", the alias source must be an exact version, if it is a branch name you should prefix it with dev-'; - } - - throw new \UnexpectedValueException('Invalid version string "' . $origVersion . '"' . $extraMessage); - } - - /** - * Extract numeric prefix from alias, if it is in numeric format, suitable for version comparison. - * - * @param string $branch Branch name (e.g. 2.1.x-dev) - * - * @return string|false Numeric prefix if present (e.g. 2.1.) or false - */ - public function parseNumericAliasPrefix($branch) - { - if (preg_match('{^(?P(\d++\\.)*\d++)(?:\.x)?-dev$}i', (string) $branch, $matches)) { - return $matches['version'] . '.'; - } - - return false; - } - - /** - * Normalizes a branch name to be able to perform comparisons on it. - * - * @param string $name - * - * @return string - */ - public function normalizeBranch($name) - { - $name = trim((string) $name); - - if (preg_match('{^v?(\d++)(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?$}i', $name, $matches)) { - $version = ''; - for ($i = 1; $i < 5; ++$i) { - $version .= isset($matches[$i]) ? str_replace(array('*', 'X'), 'x', $matches[$i]) : '.x'; - } - - return str_replace('x', '9999999', $version) . '-dev'; - } - - return 'dev-' . $name; - } - - /** - * Normalizes a default branch name (i.e. master on git) to 9999999-dev. - * - * @param string $name - * - * @return string - * - * @deprecated No need to use this anymore in theory, Composer 2 does not normalize any branch names to 9999999-dev anymore - */ - public function normalizeDefaultBranch($name) - { - if ($name === 'dev-master' || $name === 'dev-default' || $name === 'dev-trunk') { - return '9999999-dev'; - } - - return (string) $name; - } - - /** - * Parses a constraint string into MultiConstraint and/or Constraint objects. - * - * @param string $constraints - * - * @return ConstraintInterface - */ - public function parseConstraints($constraints) - { - $prettyConstraint = (string) $constraints; - - $orConstraints = preg_split('{\s*\|\|?\s*}', trim((string) $constraints)); - if (false === $orConstraints) { - throw new \RuntimeException('Failed to preg_split string: '.$constraints); - } - $orGroups = array(); - - foreach ($orConstraints as $orConstraint) { - $andConstraints = preg_split('{(?< ,]) *(? 1) { - $constraintObjects = array(); - foreach ($andConstraints as $andConstraint) { - foreach ($this->parseConstraint($andConstraint) as $parsedAndConstraint) { - $constraintObjects[] = $parsedAndConstraint; - } - } - } else { - $constraintObjects = $this->parseConstraint($andConstraints[0]); - } - - if (1 === \count($constraintObjects)) { - $constraint = $constraintObjects[0]; - } else { - $constraint = new MultiConstraint($constraintObjects); - } - - $orGroups[] = $constraint; - } - - $parsedConstraint = MultiConstraint::create($orGroups, false); - - $parsedConstraint->setPrettyString($prettyConstraint); - - return $parsedConstraint; - } - - /** - * @param string $constraint - * - * @throws \UnexpectedValueException - * - * @return array - * - * @phpstan-return non-empty-array - */ - private function parseConstraint($constraint) - { - // strip off aliasing - if (preg_match('{^([^,\s]++) ++as ++([^,\s]++)$}', $constraint, $match)) { - $constraint = $match[1]; - } - - // strip @stability flags, and keep it for later use - if (preg_match('{^([^,\s]*?)@(' . self::$stabilitiesRegex . ')$}i', $constraint, $match)) { - $constraint = '' !== $match[1] ? $match[1] : '*'; - if ($match[2] !== 'stable') { - $stabilityModifier = $match[2]; - } - } - - // get rid of #refs as those are used by composer only - if (preg_match('{^(dev-[^,\s@]+?|[^,\s@]+?\.x-dev)#.+$}i', $constraint, $match)) { - $constraint = $match[1]; - } - - if (preg_match('{^(v)?[xX*](\.[xX*])*$}i', $constraint, $match)) { - if (!empty($match[1]) || !empty($match[2])) { - return array(new Constraint('>=', '0.0.0.0-dev')); - } - - return array(new MatchAllConstraint()); - } - - $versionRegex = 'v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.(\d++))?(?:' . self::$modifierRegex . '|\.([xX*][.-]?dev))(?:\+[^\s]+)?'; - - // Tilde Range - // - // Like wildcard constraints, unsuffixed tilde constraints say that they must be greater than the previous - // version, to ensure that unstable instances of the current version are allowed. However, if a stability - // suffix is added to the constraint, then a >= match on the current version is used instead. - if (preg_match('{^~>?' . $versionRegex . '$}i', $constraint, $matches)) { - if (strpos($constraint, '~>') === 0) { - throw new \UnexpectedValueException( - 'Could not parse version constraint ' . $constraint . ': ' . - 'Invalid operator "~>", you probably meant to use the "~" operator' - ); - } - - // Work out which position in the version we are operating at - if (isset($matches[4]) && '' !== $matches[4] && null !== $matches[4]) { - $position = 4; - } elseif (isset($matches[3]) && '' !== $matches[3] && null !== $matches[3]) { - $position = 3; - } elseif (isset($matches[2]) && '' !== $matches[2] && null !== $matches[2]) { - $position = 2; - } else { - $position = 1; - } - - // when matching 2.x-dev or 3.0.x-dev we have to shift the second or third number, despite no second/third number matching above - if (!empty($matches[8])) { - $position++; - } - - // Calculate the stability suffix - $stabilitySuffix = ''; - if (empty($matches[5]) && empty($matches[7]) && empty($matches[8])) { - $stabilitySuffix .= '-dev'; - } - - $lowVersion = $this->normalize(substr($constraint . $stabilitySuffix, 1)); - $lowerBound = new Constraint('>=', $lowVersion); - - // For upper bound, we increment the position of one more significance, - // but highPosition = 0 would be illegal - $highPosition = max(1, $position - 1); - $highVersion = $this->manipulateVersionString($matches, $highPosition, 1) . '-dev'; - $upperBound = new Constraint('<', $highVersion); - - return array( - $lowerBound, - $upperBound, - ); - } - - // Caret Range - // - // Allows changes that do not modify the left-most non-zero digit in the [major, minor, patch] tuple. - // In other words, this allows patch and minor updates for versions 1.0.0 and above, patch updates for - // versions 0.X >=0.1.0, and no updates for versions 0.0.X - if (preg_match('{^\^' . $versionRegex . '($)}i', $constraint, $matches)) { - // Work out which position in the version we are operating at - if ('0' !== $matches[1] || '' === $matches[2] || null === $matches[2]) { - $position = 1; - } elseif ('0' !== $matches[2] || '' === $matches[3] || null === $matches[3]) { - $position = 2; - } else { - $position = 3; - } - - // Calculate the stability suffix - $stabilitySuffix = ''; - if (empty($matches[5]) && empty($matches[7]) && empty($matches[8])) { - $stabilitySuffix .= '-dev'; - } - - $lowVersion = $this->normalize(substr($constraint . $stabilitySuffix, 1)); - $lowerBound = new Constraint('>=', $lowVersion); - - // For upper bound, we increment the position of one more significance, - // but highPosition = 0 would be illegal - $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev'; - $upperBound = new Constraint('<', $highVersion); - - return array( - $lowerBound, - $upperBound, - ); - } - - // X Range - // - // Any of X, x, or * may be used to "stand in" for one of the numeric values in the [major, minor, patch] tuple. - // A partial version range is treated as an X-Range, so the special character is in fact optional. - if (preg_match('{^v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.[xX*])++$}', $constraint, $matches)) { - if (isset($matches[3]) && '' !== $matches[3] && null !== $matches[3]) { - $position = 3; - } elseif (isset($matches[2]) && '' !== $matches[2] && null !== $matches[2]) { - $position = 2; - } else { - $position = 1; - } - - $lowVersion = $this->manipulateVersionString($matches, $position) . '-dev'; - $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev'; - - if ($lowVersion === '0.0.0.0-dev') { - return array(new Constraint('<', $highVersion)); - } - - return array( - new Constraint('>=', $lowVersion), - new Constraint('<', $highVersion), - ); - } - - // Hyphen Range - // - // Specifies an inclusive set. If a partial version is provided as the first version in the inclusive range, - // then the missing pieces are replaced with zeroes. If a partial version is provided as the second version in - // the inclusive range, then all versions that start with the supplied parts of the tuple are accepted, but - // nothing that would be greater than the provided tuple parts. - if (preg_match('{^(?P' . $versionRegex . ') +- +(?P' . $versionRegex . ')($)}i', $constraint, $matches)) { - // Calculate the stability suffix - $lowStabilitySuffix = ''; - if (empty($matches[6]) && empty($matches[8]) && empty($matches[9])) { - $lowStabilitySuffix = '-dev'; - } - - $lowVersion = $this->normalize($matches['from']); - $lowerBound = new Constraint('>=', $lowVersion . $lowStabilitySuffix); - - $empty = function ($x) { - return ($x === 0 || $x === '0') ? false : empty($x); - }; - - if ((!$empty($matches[12]) && !$empty($matches[13])) || !empty($matches[15]) || !empty($matches[17]) || !empty($matches[18])) { - $highVersion = $this->normalize($matches['to']); - $upperBound = new Constraint('<=', $highVersion); - } else { - $highMatch = array('', $matches[11], $matches[12], $matches[13], $matches[14]); - - // validate to version - $this->normalize($matches['to']); - - $highVersion = $this->manipulateVersionString($highMatch, $empty($matches[12]) ? 1 : 2, 1) . '-dev'; - $upperBound = new Constraint('<', $highVersion); - } - - return array( - $lowerBound, - $upperBound, - ); - } - - // Basic Comparators - if (preg_match('{^(<>|!=|>=?|<=?|==?)?\s*(.*)}', $constraint, $matches)) { - try { - try { - $version = $this->normalize($matches[2]); - } catch (\UnexpectedValueException $e) { - // recover from an invalid constraint like foobar-dev which should be dev-foobar - // except if the constraint uses a known operator, in which case it must be a parse error - if (substr($matches[2], -4) === '-dev' && preg_match('{^[0-9a-zA-Z-./]+$}', $matches[2])) { - $version = $this->normalize('dev-'.substr($matches[2], 0, -4)); - } else { - throw $e; - } - } - - $op = $matches[1] ?: '='; - - if ($op !== '==' && $op !== '=' && !empty($stabilityModifier) && self::parseStability($version) === 'stable') { - $version .= '-' . $stabilityModifier; - } elseif ('<' === $op || '>=' === $op) { - if (!preg_match('/-' . self::$modifierRegex . '$/', strtolower($matches[2]))) { - if (strpos($matches[2], 'dev-') !== 0) { - $version .= '-dev'; - } - } - } - - return array(new Constraint($matches[1] ?: '=', $version)); - } catch (\Exception $e) { - } - } - - $message = 'Could not parse version constraint ' . $constraint; - if (isset($e)) { - $message .= ': ' . $e->getMessage(); - } - - throw new \UnexpectedValueException($message); - } - - /** - * Increment, decrement, or simply pad a version number. - * - * Support function for {@link parseConstraint()} - * - * @param array $matches Array with version parts in array indexes 1,2,3,4 - * @param int $position 1,2,3,4 - which segment of the version to increment/decrement - * @param int $increment - * @param string $pad The string to pad version parts after $position - * - * @return string|null The new version - * - * @phpstan-param string[] $matches - */ - private function manipulateVersionString(array $matches, $position, $increment = 0, $pad = '0') - { - for ($i = 4; $i > 0; --$i) { - if ($i > $position) { - $matches[$i] = $pad; - } elseif ($i === $position && $increment) { - $matches[$i] += $increment; - // If $matches[$i] was 0, carry the decrement - if ($matches[$i] < 0) { - $matches[$i] = $pad; - --$position; - - // Return null on a carry overflow - if ($i === 1) { - return null; - } - } - } - } - - return $matches[1] . '.' . $matches[2] . '.' . $matches[3] . '.' . $matches[4]; - } - - /** - * Expand shorthand stability string to long version. - * - * @param string $stability - * - * @return string - */ - private function expandStability($stability) - { - $stability = strtolower($stability); - - switch ($stability) { - case 'a': - return 'alpha'; - case 'b': - return 'beta'; - case 'p': - case 'pl': - return 'patch'; - case 'rc': - return 'RC'; - default: - return $stability; - } - } -} diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/CHANGELOG.md b/tools/php-cs-fixer/vendor/composer/xdebug-handler/CHANGELOG.md deleted file mode 100644 index 62ebe223..00000000 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/CHANGELOG.md +++ /dev/null @@ -1,143 +0,0 @@ -## [Unreleased] - -## [3.0.5] - 2024-05-06 - * Fixed: fail restart if PHP_BINARY is not available - -## [3.0.4] - 2024-03-26 - * Added: Functional tests. - * Fixed: Incompatibility with PHPUnit 10. - -## [3.0.3] - 2022-02-25 - * Added: support for composer/pcre versions 2 and 3. - -## [3.0.2] - 2022-02-24 - * Fixed: regression in 3.0.1 affecting Xdebug 2 - -## [3.0.1] - 2022-01-04 - * Fixed: error when calling `isXdebugActive` before class instantiation. - -## [3.0.0] - 2021-12-23 - * Removed: support for legacy PHP versions (< PHP 7.2.5). - * Added: type declarations to arguments and return values. - * Added: strict typing to all classes. - -## [2.0.3] - 2021-12-08 - * Added: support, type annotations and refactoring for stricter PHPStan analysis. - -## [2.0.2] - 2021-07-31 - * Added: support for `xdebug_info('mode')` in Xdebug 3.1. - * Added: support for Psr\Log versions 2 and 3. - * Fixed: remove ini directives from non-cli HOST/PATH sections. - -## [2.0.1] - 2021-05-05 - * Fixed: don't restart if the cwd is a UNC path and cmd.exe will be invoked. - -## [2.0.0] - 2021-04-09 - * Break: this is a major release, see [UPGRADE.md](UPGRADE.md) for more information. - * Break: removed optional `$colorOption` constructor param and passthru fallback. - * Break: renamed `requiresRestart` param from `$isLoaded` to `$default`. - * Break: changed `restart` param `$command` from a string to an array. - * Added: support for Xdebug3 to only restart if Xdebug is not running with `xdebug.mode=off`. - * Added: `isXdebugActive()` method to determine if Xdebug is still running in the restart. - * Added: feature to bypass the shell in PHP-7.4+ by giving `proc_open` an array of arguments. - * Added: Process utility class to the API. - -## [1.4.6] - 2021-03-25 - * Fixed: fail restart if `proc_open` has been disabled in `disable_functions`. - * Fixed: enable Windows CTRL event handling in the restarted process. - -## [1.4.5] - 2020-11-13 - * Fixed: use `proc_open` when available for correct FD forwarding to the restarted process. - -## [1.4.4] - 2020-10-24 - * Fixed: exception if 'pcntl_signal' is disabled. - -## [1.4.3] - 2020-08-19 - * Fixed: restore SIGINT to default handler in restarted process if no other handler exists. - -## [1.4.2] - 2020-06-04 - * Fixed: ignore SIGINTs to let the restarted process handle them. - -## [1.4.1] - 2020-03-01 - * Fixed: restart fails if an ini file is empty. - -## [1.4.0] - 2019-11-06 - * Added: support for `NO_COLOR` environment variable: https://no-color.org - * Added: color support for Hyper terminal: https://github.com/zeit/hyper - * Fixed: correct capitalization of Xdebug (apparently). - * Fixed: improved handling for uopz extension. - -## [1.3.3] - 2019-05-27 - * Fixed: add environment changes to `$_ENV` if it is being used. - -## [1.3.2] - 2019-01-28 - * Fixed: exit call being blocked by uopz extension, resulting in application code running twice. - -## [1.3.1] - 2018-11-29 - * Fixed: fail restart if `passthru` has been disabled in `disable_functions`. - * Fixed: fail restart if an ini file cannot be opened, otherwise settings will be missing. - -## [1.3.0] - 2018-08-31 - * Added: `setPersistent` method to use environment variables for the restart. - * Fixed: improved debugging by writing output to stderr. - * Fixed: no restart when `php_ini_scanned_files` is not functional and is needed. - -## [1.2.1] - 2018-08-23 - * Fixed: fatal error with apc, when using `apc.mmap_file_mask`. - -## [1.2.0] - 2018-08-16 - * Added: debug information using `XDEBUG_HANDLER_DEBUG`. - * Added: fluent interface for setters. - * Added: `PhpConfig` helper class for calling PHP sub-processes. - * Added: `PHPRC` original value to restart stettings, for use in a restarted process. - * Changed: internal procedure to disable ini-scanning, using `-n` command-line option. - * Fixed: replaced `escapeshellarg` usage to avoid locale problems. - * Fixed: improved color-option handling to respect double-dash delimiter. - * Fixed: color-option handling regression from main script changes. - * Fixed: improved handling when checking main script. - * Fixed: handling for standard input, that never actually did anything. - * Fixed: fatal error when ctype extension is not available. - -## [1.1.0] - 2018-04-11 - * Added: `getRestartSettings` method for calling PHP processes in a restarted process. - * Added: API definition and @internal class annotations. - * Added: protected `requiresRestart` method for extending classes. - * Added: `setMainScript` method for applications that change the working directory. - * Changed: private `tmpIni` variable to protected for extending classes. - * Fixed: environment variables not available in $_SERVER when restored in the restart. - * Fixed: relative path problems caused by Phar::interceptFileFuncs. - * Fixed: incorrect handling when script file cannot be found. - -## [1.0.0] - 2018-03-08 - * Added: PSR3 logging for optional status output. - * Added: existing ini settings are merged to catch command-line overrides. - * Added: code, tests and other artefacts to decouple from Composer. - * Break: the following class was renamed: - - `Composer\XdebugHandler` -> `Composer\XdebugHandler\XdebugHandler` - -[Unreleased]: https://github.com/composer/xdebug-handler/compare/3.0.5...HEAD -[3.0.5]: https://github.com/composer/xdebug-handler/compare/3.0.4...3.0.5 -[3.0.4]: https://github.com/composer/xdebug-handler/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/composer/xdebug-handler/compare/3.0.2...3.0.3 -[3.0.2]: https://github.com/composer/xdebug-handler/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/composer/xdebug-handler/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/composer/xdebug-handler/compare/2.0.3...3.0.0 -[2.0.3]: https://github.com/composer/xdebug-handler/compare/2.0.2...2.0.3 -[2.0.2]: https://github.com/composer/xdebug-handler/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/composer/xdebug-handler/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/composer/xdebug-handler/compare/1.4.6...2.0.0 -[1.4.6]: https://github.com/composer/xdebug-handler/compare/1.4.5...1.4.6 -[1.4.5]: https://github.com/composer/xdebug-handler/compare/1.4.4...1.4.5 -[1.4.4]: https://github.com/composer/xdebug-handler/compare/1.4.3...1.4.4 -[1.4.3]: https://github.com/composer/xdebug-handler/compare/1.4.2...1.4.3 -[1.4.2]: https://github.com/composer/xdebug-handler/compare/1.4.1...1.4.2 -[1.4.1]: https://github.com/composer/xdebug-handler/compare/1.4.0...1.4.1 -[1.4.0]: https://github.com/composer/xdebug-handler/compare/1.3.3...1.4.0 -[1.3.3]: https://github.com/composer/xdebug-handler/compare/1.3.2...1.3.3 -[1.3.2]: https://github.com/composer/xdebug-handler/compare/1.3.1...1.3.2 -[1.3.1]: https://github.com/composer/xdebug-handler/compare/1.3.0...1.3.1 -[1.3.0]: https://github.com/composer/xdebug-handler/compare/1.2.1...1.3.0 -[1.2.1]: https://github.com/composer/xdebug-handler/compare/1.2.0...1.2.1 -[1.2.0]: https://github.com/composer/xdebug-handler/compare/1.1.0...1.2.0 -[1.1.0]: https://github.com/composer/xdebug-handler/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/composer/xdebug-handler/compare/d66f0d15cb57...1.0.0 diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/LICENSE b/tools/php-cs-fixer/vendor/composer/xdebug-handler/LICENSE deleted file mode 100644 index 963618a1..00000000 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Composer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/README.md b/tools/php-cs-fixer/vendor/composer/xdebug-handler/README.md deleted file mode 100644 index f7f581ac..00000000 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/README.md +++ /dev/null @@ -1,305 +0,0 @@ -# composer/xdebug-handler - -[![packagist](https://img.shields.io/packagist/v/composer/xdebug-handler)](https://packagist.org/packages/composer/xdebug-handler) -[![Continuous Integration](https://github.com/composer/xdebug-handler/actions/workflows/continuous-integration.yml/badge.svg?branch=main)](https://github.com/composer/xdebug-handler/actions?query=branch:main) -![license](https://img.shields.io/github/license/composer/xdebug-handler.svg) -![php](https://img.shields.io/packagist/php-v/composer/xdebug-handler?colorB=8892BF) - -Restart a CLI process without loading the Xdebug extension, unless `xdebug.mode=off`. - -Originally written as part of [composer/composer](https://github.com/composer/composer), -now extracted and made available as a stand-alone library. - -### Version 3 - -Removed support for legacy PHP versions and added type declarations. - -Long term support for version 2 (PHP 5.3.2 - 7.2.4) follows [Composer 2.2 LTS](https://blog.packagist.com/composer-2-2/) policy. - -## Installation - -Install the latest version with: - -```bash -$ composer require composer/xdebug-handler -``` - -## Requirements - -* PHP 7.2.5 minimum, although using the latest PHP version is highly recommended. - -## Basic Usage -```php -use Composer\XdebugHandler\XdebugHandler; - -$xdebug = new XdebugHandler('myapp'); -$xdebug->check(); -unset($xdebug); -``` - -The constructor takes a single parameter, `$envPrefix`, which is upper-cased and prepended to default base values to create two distinct environment variables. The above example enables the use of: - -- `MYAPP_ALLOW_XDEBUG=1` to override automatic restart and allow Xdebug -- `MYAPP_ORIGINAL_INIS` to obtain ini file locations in a restarted process - -## Advanced Usage - -* [How it works](#how-it-works) -* [Limitations](#limitations) -* [Helper methods](#helper-methods) -* [Setter methods](#setter-methods) -* [Process configuration](#process-configuration) -* [Troubleshooting](#troubleshooting) -* [Extending the library](#extending-the-library) -* [Examples](#examples) - -### How it works - -A temporary ini file is created from the loaded (and scanned) ini files, with any references to the Xdebug extension commented out. Current ini settings are merged, so that most ini settings made on the command-line or by the application are included (see [Limitations](#limitations)) - -* `MYAPP_ALLOW_XDEBUG` is set with internal data to flag and use in the restart. -* The command-line and environment are [configured](#process-configuration) for the restart. -* The application is restarted in a new process. - * The restart settings are stored in the environment. - * `MYAPP_ALLOW_XDEBUG` is unset. - * The application runs and exits. -* The main process exits with the exit code from the restarted process. - -See [Examples](#examples) for further information. - -#### Signal handling -Asynchronous signal handling is automatically enabled if the pcntl extension is loaded. `SIGINT` is set to `SIG_IGN` in the parent -process and restored to `SIG_DFL` in the restarted process (if no other handler has been set). - -From PHP 7.4 on Windows, `CTRL+C` and `CTRL+BREAK` handling is automatically enabled in the restarted process and ignored in the parent process. - -### Limitations -There are a few things to be aware of when running inside a restarted process. - -* Extensions set on the command-line will not be loaded. -* Ini file locations will be reported as per the restart - see [getAllIniFiles()](#getallinifiles-array). -* Php sub-processes may be loaded with Xdebug enabled - see [Process configuration](#process-configuration). - -### Helper methods -These static methods provide information from the current process, regardless of whether it has been restarted or not. - -#### _getAllIniFiles(): array_ -Returns an array of the original ini file locations. Use this instead of calling `php_ini_loaded_file` and `php_ini_scanned_files`, which will report the wrong values in a restarted process. - -```php -use Composer\XdebugHandler\XdebugHandler; - -$files = XdebugHandler::getAllIniFiles(); - -# $files[0] always exists, it could be an empty string -$loadedIni = array_shift($files); -$scannedInis = $files; -``` - -These locations are also available in the `MYAPP_ORIGINAL_INIS` environment variable. This is a path-separated string comprising the location returned from `php_ini_loaded_file`, which could be empty, followed by locations parsed from calling `php_ini_scanned_files`. - -#### _getRestartSettings(): ?array_ -Returns an array of settings that can be used with PHP [sub-processes](#sub-processes), or null if the process was not restarted. - -```php -use Composer\XdebugHandler\XdebugHandler; - -$settings = XdebugHandler::getRestartSettings(); -/** - * $settings: array (if the current process was restarted, - * or called with the settings from a previous restart), or null - * - * 'tmpIni' => the temporary ini file used in the restart (string) - * 'scannedInis' => if there were any scanned inis (bool) - * 'scanDir' => the original PHP_INI_SCAN_DIR value (false|string) - * 'phprc' => the original PHPRC value (false|string) - * 'inis' => the original inis from getAllIniFiles (array) - * 'skipped' => the skipped version from getSkippedVersion (string) - */ -``` - -#### _getSkippedVersion(): string_ -Returns the Xdebug version string that was skipped by the restart, or an empty string if there was no restart (or Xdebug is still loaded, perhaps by an extending class restarting for a reason other than removing Xdebug). - -```php -use Composer\XdebugHandler\XdebugHandler; - -$version = XdebugHandler::getSkippedVersion(); -# $version: '3.1.1' (for example), or an empty string -``` - -#### _isXdebugActive(): bool_ -Returns true if Xdebug is loaded and is running in an active mode (if it supports modes). Returns false if Xdebug is not loaded, or it is running with `xdebug.mode=off`. - -### Setter methods -These methods implement a fluent interface and must be called before the main `check()` method. - -#### _setLogger(LoggerInterface $logger): self_ -Enables the output of status messages to an external PSR3 logger. All messages are reported with either `DEBUG` or `WARNING` log levels. For example (showing the level and message): - -``` -// No restart -DEBUG Checking MYAPP_ALLOW_XDEBUG -DEBUG The Xdebug extension is loaded (3.1.1) xdebug.mode=off -DEBUG No restart (APP_ALLOW_XDEBUG=0) Allowed by xdebug.mode - -// Restart overridden -DEBUG Checking MYAPP_ALLOW_XDEBUG -DEBUG The Xdebug extension is loaded (3.1.1) xdebug.mode=coverage,debug,develop -DEBUG No restart (MYAPP_ALLOW_XDEBUG=1) - -// Failed restart -DEBUG Checking MYAPP_ALLOW_XDEBUG -DEBUG The Xdebug extension is loaded (3.1.0) -WARNING No restart (Unable to create temp ini file at: ...) -``` - -Status messages can also be output with `XDEBUG_HANDLER_DEBUG`. See [Troubleshooting](#troubleshooting). - -#### _setMainScript(string $script): self_ -Sets the location of the main script to run in the restart. This is only needed in more esoteric use-cases, or if the `argv[0]` location is inaccessible. The script name `--` is supported for standard input. - -#### _setPersistent(): self_ -Configures the restart using [persistent settings](#persistent-settings), so that Xdebug is not loaded in any sub-process. - -Use this method if your application invokes one or more PHP sub-process and the Xdebug extension is not needed. This avoids the overhead of implementing specific [sub-process](#sub-processes) strategies. - -Alternatively, this method can be used to set up a default _Xdebug-free_ environment which can be changed if a sub-process requires Xdebug, then restored afterwards: - -```php -function SubProcessWithXdebug() -{ - $phpConfig = new Composer\XdebugHandler\PhpConfig(); - - # Set the environment to the original configuration - $phpConfig->useOriginal(); - - # run the process with Xdebug loaded - ... - - # Restore Xdebug-free environment - $phpConfig->usePersistent(); -} -``` - -### Process configuration -The library offers two strategies to invoke a new PHP process without loading Xdebug, using either _standard_ or _persistent_ settings. Note that this is only important if the application calls a PHP sub-process. - -#### Standard settings -Uses command-line options to remove Xdebug from the new process only. - -* The -n option is added to the command-line. This tells PHP not to scan for additional inis. -* The temporary ini is added to the command-line with the -c option. - ->_If the new process calls a PHP sub-process, Xdebug will be loaded in that sub-process (unless it implements xdebug-handler, in which case there will be another restart)._ - -This is the default strategy used in the restart. - -#### Persistent settings -Uses environment variables to remove Xdebug from the new process and persist these settings to any sub-process. - -* `PHP_INI_SCAN_DIR` is set to an empty string. This tells PHP not to scan for additional inis. -* `PHPRC` is set to the temporary ini. - ->_If the new process calls a PHP sub-process, Xdebug will not be loaded in that sub-process._ - -This strategy can be used in the restart by calling [setPersistent()](#setpersistent-self). - -#### Sub-processes -The `PhpConfig` helper class makes it easy to invoke a PHP sub-process (with or without Xdebug loaded), regardless of whether there has been a restart. - -Each of its methods returns an array of PHP options (to add to the command-line) and sets up the environment for the required strategy. The [getRestartSettings()](#getrestartsettings-array) method is used internally. - -* `useOriginal()` - Xdebug will be loaded in the new process. -* `useStandard()` - Xdebug will **not** be loaded in the new process - see [standard settings](#standard-settings). -* `userPersistent()` - Xdebug will **not** be loaded in the new process - see [persistent settings](#persistent-settings) - -If there was no restart, an empty options array is returned and the environment is not changed. - -```php -use Composer\XdebugHandler\PhpConfig; - -$config = new PhpConfig; - -$options = $config->useOriginal(); -# $options: empty array -# environment: PHPRC and PHP_INI_SCAN_DIR set to original values - -$options = $config->useStandard(); -# $options: [-n, -c, tmpIni] -# environment: PHPRC and PHP_INI_SCAN_DIR set to original values - -$options = $config->usePersistent(); -# $options: empty array -# environment: PHPRC=tmpIni, PHP_INI_SCAN_DIR='' -``` - -### Troubleshooting -The following environment settings can be used to troubleshoot unexpected behavior: - -* `XDEBUG_HANDLER_DEBUG=1` Outputs status messages to `STDERR`, if it is defined, irrespective of any PSR3 logger. Each message is prefixed `xdebug-handler[pid]`, where pid is the process identifier. - -* `XDEBUG_HANDLER_DEBUG=2` As above, but additionally saves the temporary ini file and reports its location in a status message. - -### Extending the library -The API is defined by classes and their accessible elements that are not annotated as @internal. The main class has two protected methods that can be overridden to provide additional functionality: - -#### _requiresRestart(bool $default): bool_ -By default the process will restart if Xdebug is loaded and not running with `xdebug.mode=off`. Extending this method allows an application to decide, by returning a boolean (or equivalent) value. -It is only called if `MYAPP_ALLOW_XDEBUG` is empty, so it will not be called in the restarted process (where this variable contains internal data), or if the restart has been overridden. - -Note that the [setMainScript()](#setmainscriptstring-script-self) and [setPersistent()](#setpersistent-self) setters can be used here, if required. - -#### _restart(array $command): void_ -An application can extend this to modify the temporary ini file, its location given in the `tmpIni` property. New settings can be safely appended to the end of the data, which is `PHP_EOL` terminated. - -The `$command` parameter is an array of unescaped command-line arguments that will be used for the new process. - -Remember to finish with `parent::restart($command)`. - -#### Example -This example demonstrates two ways to extend basic functionality: - -* To avoid the overhead of spinning up a new process, the restart is skipped if a simple help command is requested. - -* The application needs write-access to phar files, so it will force a restart if `phar.readonly` is set (regardless of whether Xdebug is loaded) and change this value in the temporary ini file. - -```php -use Composer\XdebugHandler\XdebugHandler; -use MyApp\Command; - -class MyRestarter extends XdebugHandler -{ - private $required; - - protected function requiresRestart(bool $default): bool - { - if (Command::isHelp()) { - # No need to disable Xdebug for this - return false; - } - - $this->required = (bool) ini_get('phar.readonly'); - return $this->required || $default; - } - - protected function restart(array $command): void - { - if ($this->required) { - # Add required ini setting to tmpIni - $content = file_get_contents($this->tmpIni); - $content .= 'phar.readonly=0'.PHP_EOL; - file_put_contents($this->tmpIni, $content); - } - - parent::restart($command); - } -} -``` - -### Examples -The `tests\App` directory contains command-line scripts that demonstrate the internal workings in a variety of scenarios. -See [Functional Test Scripts](./tests/App/README.md). - -## License -composer/xdebug-handler is licensed under the MIT License, see the LICENSE file for details. diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/composer.json b/tools/php-cs-fixer/vendor/composer/xdebug-handler/composer.json deleted file mode 100644 index d205dc10..00000000 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "composer/xdebug-handler", - "description": "Restarts a process without Xdebug.", - "type": "library", - "license": "MIT", - "keywords": [ - "xdebug", - "performance" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/xdebug-handler/issues" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3", - "composer/pcre": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" - }, - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Composer\\XdebugHandler\\Tests\\": "tests" - } - }, - "scripts": { - "test": "@php vendor/bin/phpunit", - "phpstan": "@php vendor/bin/phpstan analyse" - } -} diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/PhpConfig.php b/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/PhpConfig.php deleted file mode 100644 index 7edac888..00000000 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/PhpConfig.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\XdebugHandler; - -/** - * @author John Stevenson - * - * @phpstan-type restartData array{tmpIni: string, scannedInis: bool, scanDir: false|string, phprc: false|string, inis: string[], skipped: string} - */ -class PhpConfig -{ - /** - * Use the original PHP configuration - * - * @return string[] Empty array of PHP cli options - */ - public function useOriginal(): array - { - $this->getDataAndReset(); - return []; - } - - /** - * Use standard restart settings - * - * @return string[] PHP cli options - */ - public function useStandard(): array - { - $data = $this->getDataAndReset(); - if ($data !== null) { - return ['-n', '-c', $data['tmpIni']]; - } - - return []; - } - - /** - * Use environment variables to persist settings - * - * @return string[] Empty array of PHP cli options - */ - public function usePersistent(): array - { - $data = $this->getDataAndReset(); - if ($data !== null) { - $this->updateEnv('PHPRC', $data['tmpIni']); - $this->updateEnv('PHP_INI_SCAN_DIR', ''); - } - - return []; - } - - /** - * Returns restart data if available and resets the environment - * - * @phpstan-return restartData|null - */ - private function getDataAndReset(): ?array - { - $data = XdebugHandler::getRestartSettings(); - if ($data !== null) { - $this->updateEnv('PHPRC', $data['phprc']); - $this->updateEnv('PHP_INI_SCAN_DIR', $data['scanDir']); - } - - return $data; - } - - /** - * Updates a restart settings value in the environment - * - * @param string $name - * @param string|false $value - */ - private function updateEnv(string $name, $value): void - { - Process::setEnv($name, false !== $value ? $value : null); - } -} diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Process.php b/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Process.php deleted file mode 100644 index 4e9f076b..00000000 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Process.php +++ /dev/null @@ -1,119 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Composer\XdebugHandler; - -use Composer\Pcre\Preg; - -/** - * Process utility functions - * - * @author John Stevenson - */ -class Process -{ - /** - * Escapes a string to be used as a shell argument. - * - * From https://github.com/johnstevenson/winbox-args - * MIT Licensed (c) John Stevenson - * - * @param string $arg The argument to be escaped - * @param bool $meta Additionally escape cmd.exe meta characters - * @param bool $module The argument is the module to invoke - */ - public static function escape(string $arg, bool $meta = true, bool $module = false): string - { - if (!defined('PHP_WINDOWS_VERSION_BUILD')) { - return "'".str_replace("'", "'\\''", $arg)."'"; - } - - $quote = strpbrk($arg, " \t") !== false || $arg === ''; - - $arg = Preg::replace('/(\\\\*)"/', '$1$1\\"', $arg, -1, $dquotes); - $dquotes = (bool) $dquotes; - - if ($meta) { - $meta = $dquotes || Preg::isMatch('/%[^%]+%/', $arg); - - if (!$meta) { - $quote = $quote || strpbrk($arg, '^&|<>()') !== false; - } elseif ($module && !$dquotes && $quote) { - $meta = false; - } - } - - if ($quote) { - $arg = '"'.(Preg::replace('/(\\\\*)$/', '$1$1', $arg)).'"'; - } - - if ($meta) { - $arg = Preg::replace('/(["^&|<>()%])/', '^$1', $arg); - } - - return $arg; - } - - /** - * Escapes an array of arguments that make up a shell command - * - * @param string[] $args Argument list, with the module name first - */ - public static function escapeShellCommand(array $args): string - { - $command = ''; - $module = array_shift($args); - - if ($module !== null) { - $command = self::escape($module, true, true); - - foreach ($args as $arg) { - $command .= ' '.self::escape($arg); - } - } - - return $command; - } - - /** - * Makes putenv environment changes available in $_SERVER and $_ENV - * - * @param string $name - * @param ?string $value A null value unsets the variable - */ - public static function setEnv(string $name, ?string $value = null): bool - { - $unset = null === $value; - - if (!putenv($unset ? $name : $name.'='.$value)) { - return false; - } - - if ($unset) { - unset($_SERVER[$name]); - } else { - $_SERVER[$name] = $value; - } - - // Update $_ENV if it is being used - if (false !== stripos((string) ini_get('variables_order'), 'E')) { - if ($unset) { - unset($_ENV[$name]); - } else { - $_ENV[$name] = $value; - } - } - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Status.php b/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Status.php deleted file mode 100644 index 96c5944a..00000000 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/Status.php +++ /dev/null @@ -1,222 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Composer\XdebugHandler; - -use Psr\Log\LoggerInterface; -use Psr\Log\LogLevel; - -/** - * @author John Stevenson - * @internal - */ -class Status -{ - const ENV_RESTART = 'XDEBUG_HANDLER_RESTART'; - const CHECK = 'Check'; - const ERROR = 'Error'; - const INFO = 'Info'; - const NORESTART = 'NoRestart'; - const RESTART = 'Restart'; - const RESTARTING = 'Restarting'; - const RESTARTED = 'Restarted'; - - /** @var bool */ - private $debug; - - /** @var string */ - private $envAllowXdebug; - - /** @var string|null */ - private $loaded; - - /** @var LoggerInterface|null */ - private $logger; - - /** @var bool */ - private $modeOff; - - /** @var float */ - private $time; - - /** - * @param string $envAllowXdebug Prefixed _ALLOW_XDEBUG name - * @param bool $debug Whether debug output is required - */ - public function __construct(string $envAllowXdebug, bool $debug) - { - $start = getenv(self::ENV_RESTART); - Process::setEnv(self::ENV_RESTART); - $this->time = is_numeric($start) ? round((microtime(true) - $start) * 1000) : 0; - - $this->envAllowXdebug = $envAllowXdebug; - $this->debug = $debug && defined('STDERR'); - $this->modeOff = false; - } - - /** - * Activates status message output to a PSR3 logger - * - * @return void - */ - public function setLogger(LoggerInterface $logger): void - { - $this->logger = $logger; - } - - /** - * Calls a handler method to report a message - * - * @throws \InvalidArgumentException If $op is not known - */ - public function report(string $op, ?string $data): void - { - if ($this->logger !== null || $this->debug) { - $param = (string) $data; - - switch($op) { - case self::CHECK: - $this->reportCheck($param); - break; - case self::ERROR: - $this->reportError($param); - break; - case self::INFO: - $this->reportInfo($param); - break; - case self::NORESTART: - $this->reportNoRestart(); - break; - case self::RESTART: - $this->reportRestart(); - break; - case self::RESTARTED: - $this->reportRestarted(); - break; - case self::RESTARTING: - $this->reportRestarting($param); - break; - default: - throw new \InvalidArgumentException('Unknown op handler: '.$op); - } - } - } - - /** - * Outputs a status message - */ - private function output(string $text, ?string $level = null): void - { - if ($this->logger !== null) { - $this->logger->log($level !== null ? $level: LogLevel::DEBUG, $text); - } - - if ($this->debug) { - fwrite(STDERR, sprintf('xdebug-handler[%d] %s', getmypid(), $text.PHP_EOL)); - } - } - - /** - * Checking status message - */ - private function reportCheck(string $loaded): void - { - list($version, $mode) = explode('|', $loaded); - - if ($version !== '') { - $this->loaded = '('.$version.')'.($mode !== '' ? ' xdebug.mode='.$mode : ''); - } - $this->modeOff = $mode === 'off'; - $this->output('Checking '.$this->envAllowXdebug); - } - - /** - * Error status message - */ - private function reportError(string $error): void - { - $this->output(sprintf('No restart (%s)', $error), LogLevel::WARNING); - } - - /** - * Info status message - */ - private function reportInfo(string $info): void - { - $this->output($info); - } - - /** - * No restart status message - */ - private function reportNoRestart(): void - { - $this->output($this->getLoadedMessage()); - - if ($this->loaded !== null) { - $text = sprintf('No restart (%s)', $this->getEnvAllow()); - if (!((bool) getenv($this->envAllowXdebug))) { - $text .= ' Allowed by '.($this->modeOff ? 'xdebug.mode' : 'application'); - } - $this->output($text); - } - } - - /** - * Restart status message - */ - private function reportRestart(): void - { - $this->output($this->getLoadedMessage()); - Process::setEnv(self::ENV_RESTART, (string) microtime(true)); - } - - /** - * Restarted status message - */ - private function reportRestarted(): void - { - $loaded = $this->getLoadedMessage(); - $text = sprintf('Restarted (%d ms). %s', $this->time, $loaded); - $level = $this->loaded !== null ? LogLevel::WARNING : null; - $this->output($text, $level); - } - - /** - * Restarting status message - */ - private function reportRestarting(string $command): void - { - $text = sprintf('Process restarting (%s)', $this->getEnvAllow()); - $this->output($text); - $text = 'Running: '.$command; - $this->output($text); - } - - /** - * Returns the _ALLOW_XDEBUG environment variable as name=value - */ - private function getEnvAllow(): string - { - return $this->envAllowXdebug.'='.getenv($this->envAllowXdebug); - } - - /** - * Returns the Xdebug status and version - */ - private function getLoadedMessage(): string - { - $loaded = $this->loaded !== null ? sprintf('loaded %s', $this->loaded) : 'not loaded'; - return 'The Xdebug extension is '.$loaded; - } -} diff --git a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/XdebugHandler.php b/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/XdebugHandler.php deleted file mode 100644 index a665939d..00000000 --- a/tools/php-cs-fixer/vendor/composer/xdebug-handler/src/XdebugHandler.php +++ /dev/null @@ -1,722 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Composer\XdebugHandler; - -use Composer\Pcre\Preg; -use Psr\Log\LoggerInterface; - -/** - * @author John Stevenson - * - * @phpstan-import-type restartData from PhpConfig - */ -class XdebugHandler -{ - const SUFFIX_ALLOW = '_ALLOW_XDEBUG'; - const SUFFIX_INIS = '_ORIGINAL_INIS'; - const RESTART_ID = 'internal'; - const RESTART_SETTINGS = 'XDEBUG_HANDLER_SETTINGS'; - const DEBUG = 'XDEBUG_HANDLER_DEBUG'; - - /** @var string|null */ - protected $tmpIni; - - /** @var bool */ - private static $inRestart; - - /** @var string */ - private static $name; - - /** @var string|null */ - private static $skipped; - - /** @var bool */ - private static $xdebugActive; - - /** @var string|null */ - private static $xdebugMode; - - /** @var string|null */ - private static $xdebugVersion; - - /** @var bool */ - private $cli; - - /** @var string|null */ - private $debug; - - /** @var string */ - private $envAllowXdebug; - - /** @var string */ - private $envOriginalInis; - - /** @var bool */ - private $persistent; - - /** @var string|null */ - private $script; - - /** @var Status */ - private $statusWriter; - - /** - * Constructor - * - * The $envPrefix is used to create distinct environment variables. It is - * uppercased and prepended to the default base values. For example 'myapp' - * would result in MYAPP_ALLOW_XDEBUG and MYAPP_ORIGINAL_INIS. - * - * @param string $envPrefix Value used in environment variables - * @throws \RuntimeException If the parameter is invalid - */ - public function __construct(string $envPrefix) - { - if ($envPrefix === '') { - throw new \RuntimeException('Invalid constructor parameter'); - } - - self::$name = strtoupper($envPrefix); - $this->envAllowXdebug = self::$name.self::SUFFIX_ALLOW; - $this->envOriginalInis = self::$name.self::SUFFIX_INIS; - - self::setXdebugDetails(); - self::$inRestart = false; - - if ($this->cli = PHP_SAPI === 'cli') { - $this->debug = (string) getenv(self::DEBUG); - } - - $this->statusWriter = new Status($this->envAllowXdebug, (bool) $this->debug); - } - - /** - * Activates status message output to a PSR3 logger - */ - public function setLogger(LoggerInterface $logger): self - { - $this->statusWriter->setLogger($logger); - return $this; - } - - /** - * Sets the main script location if it cannot be called from argv - */ - public function setMainScript(string $script): self - { - $this->script = $script; - return $this; - } - - /** - * Persist the settings to keep Xdebug out of sub-processes - */ - public function setPersistent(): self - { - $this->persistent = true; - return $this; - } - - /** - * Checks if Xdebug is loaded and the process needs to be restarted - * - * This behaviour can be disabled by setting the MYAPP_ALLOW_XDEBUG - * environment variable to 1. This variable is used internally so that - * the restarted process is created only once. - */ - public function check(): void - { - $this->notify(Status::CHECK, self::$xdebugVersion.'|'.self::$xdebugMode); - $envArgs = explode('|', (string) getenv($this->envAllowXdebug)); - - if (!((bool) $envArgs[0]) && $this->requiresRestart(self::$xdebugActive)) { - // Restart required - $this->notify(Status::RESTART); - $command = $this->prepareRestart(); - - if ($command !== null) { - $this->restart($command); - } - return; - } - - if (self::RESTART_ID === $envArgs[0] && count($envArgs) === 5) { - // Restarted, so unset environment variable and use saved values - $this->notify(Status::RESTARTED); - - Process::setEnv($this->envAllowXdebug); - self::$inRestart = true; - - if (self::$xdebugVersion === null) { - // Skipped version is only set if Xdebug is not loaded - self::$skipped = $envArgs[1]; - } - - $this->tryEnableSignals(); - - // Put restart settings in the environment - $this->setEnvRestartSettings($envArgs); - return; - } - - $this->notify(Status::NORESTART); - $settings = self::getRestartSettings(); - - if ($settings !== null) { - // Called with existing settings, so sync our settings - $this->syncSettings($settings); - } - } - - /** - * Returns an array of php.ini locations with at least one entry - * - * The equivalent of calling php_ini_loaded_file then php_ini_scanned_files. - * The loaded ini location is the first entry and may be an empty string. - * - * @return non-empty-list - */ - public static function getAllIniFiles(): array - { - if (self::$name !== null) { - $env = getenv(self::$name.self::SUFFIX_INIS); - - if (false !== $env) { - return explode(PATH_SEPARATOR, $env); - } - } - - $paths = [(string) php_ini_loaded_file()]; - $scanned = php_ini_scanned_files(); - - if ($scanned !== false) { - $paths = array_merge($paths, array_map('trim', explode(',', $scanned))); - } - - return $paths; - } - - /** - * Returns an array of restart settings or null - * - * Settings will be available if the current process was restarted, or - * called with the settings from an existing restart. - * - * @phpstan-return restartData|null - */ - public static function getRestartSettings(): ?array - { - $envArgs = explode('|', (string) getenv(self::RESTART_SETTINGS)); - - if (count($envArgs) !== 6 - || (!self::$inRestart && php_ini_loaded_file() !== $envArgs[0])) { - return null; - } - - return [ - 'tmpIni' => $envArgs[0], - 'scannedInis' => (bool) $envArgs[1], - 'scanDir' => '*' === $envArgs[2] ? false : $envArgs[2], - 'phprc' => '*' === $envArgs[3] ? false : $envArgs[3], - 'inis' => explode(PATH_SEPARATOR, $envArgs[4]), - 'skipped' => $envArgs[5], - ]; - } - - /** - * Returns the Xdebug version that triggered a successful restart - */ - public static function getSkippedVersion(): string - { - return (string) self::$skipped; - } - - /** - * Returns whether Xdebug is loaded and active - * - * true: if Xdebug is loaded and is running in an active mode. - * false: if Xdebug is not loaded, or it is running with xdebug.mode=off. - */ - public static function isXdebugActive(): bool - { - self::setXdebugDetails(); - return self::$xdebugActive; - } - - /** - * Allows an extending class to decide if there should be a restart - * - * The default is to restart if Xdebug is loaded and its mode is not "off". - */ - protected function requiresRestart(bool $default): bool - { - return $default; - } - - /** - * Allows an extending class to access the tmpIni - * - * @param non-empty-list $command - */ - protected function restart(array $command): void - { - $this->doRestart($command); - } - - /** - * Executes the restarted command then deletes the tmp ini - * - * @param non-empty-list $command - * @phpstan-return never - */ - private function doRestart(array $command): void - { - if (PHP_VERSION_ID >= 70400) { - $cmd = $command; - $displayCmd = sprintf('[%s]', implode(', ', $cmd)); - } else { - $cmd = Process::escapeShellCommand($command); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { - // Outer quotes required on cmd string below PHP 8 - $cmd = '"'.$cmd.'"'; - } - $displayCmd = $cmd; - } - - $this->tryEnableSignals(); - $this->notify(Status::RESTARTING, $displayCmd); - - $process = proc_open($cmd, [], $pipes); - if (is_resource($process)) { - $exitCode = proc_close($process); - } - - if (!isset($exitCode)) { - // Unlikely that php or the default shell cannot be invoked - $this->notify(Status::ERROR, 'Unable to restart process'); - $exitCode = -1; - } else { - $this->notify(Status::INFO, 'Restarted process exited '.$exitCode); - } - - if ($this->debug === '2') { - $this->notify(Status::INFO, 'Temp ini saved: '.$this->tmpIni); - } else { - @unlink((string) $this->tmpIni); - } - - exit($exitCode); - } - - /** - * Returns the command line array if everything was written for the restart - * - * If any of the following fails (however unlikely) we must return false to - * stop potential recursion: - * - tmp ini file creation - * - environment variable creation - * - * @return non-empty-list|null - */ - private function prepareRestart(): ?array - { - if (!$this->cli) { - $this->notify(Status::ERROR, 'Unsupported SAPI: '.PHP_SAPI); - return null; - } - - if (($argv = $this->checkServerArgv()) === null) { - $this->notify(Status::ERROR, '$_SERVER[argv] is not as expected'); - return null; - } - - if (!$this->checkConfiguration($info)) { - $this->notify(Status::ERROR, $info); - return null; - } - - $mainScript = (string) $this->script; - if (!$this->checkMainScript($mainScript, $argv)) { - $this->notify(Status::ERROR, 'Unable to access main script: '.$mainScript); - return null; - } - - $tmpDir = sys_get_temp_dir(); - $iniError = 'Unable to create temp ini file at: '.$tmpDir; - - if (($tmpfile = @tempnam($tmpDir, '')) === false) { - $this->notify(Status::ERROR, $iniError); - return null; - } - - $error = null; - $iniFiles = self::getAllIniFiles(); - $scannedInis = count($iniFiles) > 1; - - if (!$this->writeTmpIni($tmpfile, $iniFiles, $error)) { - $this->notify(Status::ERROR, $error ?? $iniError); - @unlink($tmpfile); - return null; - } - - if (!$this->setEnvironment($scannedInis, $iniFiles, $tmpfile)) { - $this->notify(Status::ERROR, 'Unable to set environment variables'); - @unlink($tmpfile); - return null; - } - - $this->tmpIni = $tmpfile; - - return $this->getCommand($argv, $tmpfile, $mainScript); - } - - /** - * Returns true if the tmp ini file was written - * - * @param non-empty-list $iniFiles All ini files used in the current process - */ - private function writeTmpIni(string $tmpFile, array $iniFiles, ?string &$error): bool - { - // $iniFiles has at least one item and it may be empty - if ($iniFiles[0] === '') { - array_shift($iniFiles); - } - - $content = ''; - $sectionRegex = '/^\s*\[(?:PATH|HOST)\s*=/mi'; - $xdebugRegex = '/^\s*(zend_extension\s*=.*xdebug.*)$/mi'; - - foreach ($iniFiles as $file) { - // Check for inaccessible ini files - if (($data = @file_get_contents($file)) === false) { - $error = 'Unable to read ini: '.$file; - return false; - } - // Check and remove directives after HOST and PATH sections - if (Preg::isMatchWithOffsets($sectionRegex, $data, $matches)) { - $data = substr($data, 0, $matches[0][1]); - } - $content .= Preg::replace($xdebugRegex, ';$1', $data).PHP_EOL; - } - - // Merge loaded settings into our ini content, if it is valid - $config = parse_ini_string($content); - $loaded = ini_get_all(null, false); - - if (false === $config || false === $loaded) { - $error = 'Unable to parse ini data'; - return false; - } - - $content .= $this->mergeLoadedConfig($loaded, $config); - - // Work-around for https://bugs.php.net/bug.php?id=75932 - $content .= 'opcache.enable_cli=0'.PHP_EOL; - - return (bool) @file_put_contents($tmpFile, $content); - } - - /** - * Returns the command line arguments for the restart - * - * @param non-empty-list $argv - * @return non-empty-list - */ - private function getCommand(array $argv, string $tmpIni, string $mainScript): array - { - $php = [PHP_BINARY]; - $args = array_slice($argv, 1); - - if (!$this->persistent) { - // Use command-line options - array_push($php, '-n', '-c', $tmpIni); - } - - return array_merge($php, [$mainScript], $args); - } - - /** - * Returns true if the restart environment variables were set - * - * No need to update $_SERVER since this is set in the restarted process. - * - * @param non-empty-list $iniFiles All ini files used in the current process - */ - private function setEnvironment(bool $scannedInis, array $iniFiles, string $tmpIni): bool - { - $scanDir = getenv('PHP_INI_SCAN_DIR'); - $phprc = getenv('PHPRC'); - - // Make original inis available to restarted process - if (!putenv($this->envOriginalInis.'='.implode(PATH_SEPARATOR, $iniFiles))) { - return false; - } - - if ($this->persistent) { - // Use the environment to persist the settings - if (!putenv('PHP_INI_SCAN_DIR=') || !putenv('PHPRC='.$tmpIni)) { - return false; - } - } - - // Flag restarted process and save values for it to use - $envArgs = [ - self::RESTART_ID, - self::$xdebugVersion, - (int) $scannedInis, - false === $scanDir ? '*' : $scanDir, - false === $phprc ? '*' : $phprc, - ]; - - return putenv($this->envAllowXdebug.'='.implode('|', $envArgs)); - } - - /** - * Logs status messages - */ - private function notify(string $op, ?string $data = null): void - { - $this->statusWriter->report($op, $data); - } - - /** - * Returns default, changed and command-line ini settings - * - * @param mixed[] $loadedConfig All current ini settings - * @param mixed[] $iniConfig Settings from user ini files - * - */ - private function mergeLoadedConfig(array $loadedConfig, array $iniConfig): string - { - $content = ''; - - foreach ($loadedConfig as $name => $value) { - // Value will either be null, string or array (HHVM only) - if (!is_string($value) - || strpos($name, 'xdebug') === 0 - || $name === 'apc.mmap_file_mask') { - continue; - } - - if (!isset($iniConfig[$name]) || $iniConfig[$name] !== $value) { - // Double-quote escape each value - $content .= $name.'="'.addcslashes($value, '\\"').'"'.PHP_EOL; - } - } - - return $content; - } - - /** - * Returns true if the script name can be used - * - * @param non-empty-list $argv - */ - private function checkMainScript(string &$mainScript, array $argv): bool - { - if ($mainScript !== '') { - // Allow an application to set -- for standard input - return file_exists($mainScript) || '--' === $mainScript; - } - - if (file_exists($mainScript = $argv[0])) { - return true; - } - - // Use a backtrace to resolve Phar and chdir issues. - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - $main = end($trace); - - if ($main !== false && isset($main['file'])) { - return file_exists($mainScript = $main['file']); - } - - return false; - } - - /** - * Adds restart settings to the environment - * - * @param non-empty-list $envArgs - */ - private function setEnvRestartSettings(array $envArgs): void - { - $settings = [ - php_ini_loaded_file(), - $envArgs[2], - $envArgs[3], - $envArgs[4], - getenv($this->envOriginalInis), - self::$skipped, - ]; - - Process::setEnv(self::RESTART_SETTINGS, implode('|', $settings)); - } - - /** - * Syncs settings and the environment if called with existing settings - * - * @phpstan-param restartData $settings - */ - private function syncSettings(array $settings): void - { - if (false === getenv($this->envOriginalInis)) { - // Called by another app, so make original inis available - Process::setEnv($this->envOriginalInis, implode(PATH_SEPARATOR, $settings['inis'])); - } - - self::$skipped = $settings['skipped']; - $this->notify(Status::INFO, 'Process called with existing restart settings'); - } - - /** - * Returns true if there are no known configuration issues - */ - private function checkConfiguration(?string &$info): bool - { - if (!function_exists('proc_open')) { - $info = 'proc_open function is disabled'; - return false; - } - - if (!file_exists(PHP_BINARY)) { - $info = 'PHP_BINARY is not available'; - return false; - } - - if (extension_loaded('uopz') && !((bool) ini_get('uopz.disable'))) { - // uopz works at opcode level and disables exit calls - if (function_exists('uopz_allow_exit')) { - @uopz_allow_exit(true); - } else { - $info = 'uopz extension is not compatible'; - return false; - } - } - - // Check UNC paths when using cmd.exe - if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 70400) { - $workingDir = getcwd(); - - if ($workingDir === false) { - $info = 'unable to determine working directory'; - return false; - } - - if (0 === strpos($workingDir, '\\\\')) { - $info = 'cmd.exe does not support UNC paths: '.$workingDir; - return false; - } - } - - return true; - } - - /** - * Enables async signals and control interrupts in the restarted process - * - * Available on Unix PHP 7.1+ with the pcntl extension and Windows PHP 7.4+. - */ - private function tryEnableSignals(): void - { - if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) { - pcntl_async_signals(true); - $message = 'Async signals enabled'; - - if (!self::$inRestart) { - // Restarting, so ignore SIGINT in parent - pcntl_signal(SIGINT, SIG_IGN); - } elseif (is_int(pcntl_signal_get_handler(SIGINT))) { - // Restarted, no handler set so force default action - pcntl_signal(SIGINT, SIG_DFL); - } - } - - if (!self::$inRestart && function_exists('sapi_windows_set_ctrl_handler')) { - // Restarting, so set a handler to ignore CTRL events in the parent. - // This ensures that CTRL+C events will be available in the child - // process without having to enable them there, which is unreliable. - sapi_windows_set_ctrl_handler(function ($evt) {}); - } - } - - /** - * Returns $_SERVER['argv'] if it is as expected - * - * @return non-empty-list|null - */ - private function checkServerArgv(): ?array - { - $result = []; - - if (isset($_SERVER['argv']) && is_array($_SERVER['argv'])) { - foreach ($_SERVER['argv'] as $value) { - if (!is_string($value)) { - return null; - } - - $result[] = $value; - } - } - - return count($result) > 0 ? $result : null; - } - - /** - * Sets static properties $xdebugActive, $xdebugVersion and $xdebugMode - */ - private static function setXdebugDetails(): void - { - if (self::$xdebugActive !== null) { - return; - } - - self::$xdebugActive = false; - if (!extension_loaded('xdebug')) { - return; - } - - $version = phpversion('xdebug'); - self::$xdebugVersion = $version !== false ? $version : 'unknown'; - - if (version_compare(self::$xdebugVersion, '3.1', '>=')) { - $modes = xdebug_info('mode'); - self::$xdebugMode = count($modes) === 0 ? 'off' : implode(',', $modes); - self::$xdebugActive = self::$xdebugMode !== 'off'; - return; - } - - // See if xdebug.mode is supported in this version - $iniMode = ini_get('xdebug.mode'); - if ($iniMode === false) { - self::$xdebugActive = true; - return; - } - - // Environment value wins but cannot be empty - $envMode = (string) getenv('XDEBUG_MODE'); - if ($envMode !== '') { - self::$xdebugMode = $envMode; - } else { - self::$xdebugMode = $iniMode !== '' ? $iniMode : 'off'; - } - - // An empty comma-separated list is treated as mode 'off' - if (Preg::isMatch('/^,+$/', str_replace(' ', '', self::$xdebugMode))) { - self::$xdebugMode = 'off'; - } - - self::$xdebugActive = self::$xdebugMode !== 'off'; - } -} diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/.gitattributes b/tools/php-cs-fixer/vendor/evenement/evenement/.gitattributes deleted file mode 100644 index 8e493b8c..00000000 --- a/tools/php-cs-fixer/vendor/evenement/evenement/.gitattributes +++ /dev/null @@ -1,7 +0,0 @@ -/.github export-ignore -/doc export-ignore -/examples export-ignore -/tests export-ignore -/.gitignore export-ignore -/CHANGELOG.md export-ignore -/phpunit.xml.dist export-ignore diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/LICENSE b/tools/php-cs-fixer/vendor/evenement/evenement/LICENSE deleted file mode 100644 index d9a37d0a..00000000 --- a/tools/php-cs-fixer/vendor/evenement/evenement/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Igor Wiedler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/README.md b/tools/php-cs-fixer/vendor/evenement/evenement/README.md deleted file mode 100644 index 455dd22c..00000000 --- a/tools/php-cs-fixer/vendor/evenement/evenement/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Événement - -Événement is a very simple event dispatching library for PHP. - -It has the same design goals as [Silex](https://silex.symfony.com/) and -[Pimple](https://github.com/silexphp/Pimple), to empower the user while staying concise -and simple. - -It is very strongly inspired by the [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) API found in -[node.js](http://nodejs.org). - -![Continuous Integration](https://github.com/igorw/evenement/workflows/CI/badge.svg) -[![Latest Stable Version](https://poser.pugx.org/evenement/evenement/v/stable.png)](https://packagist.org/packages/evenement/evenement) -[![Total Downloads](https://poser.pugx.org/evenement/evenement/downloads.png)](https://packagist.org/packages/evenement/evenement/stats) -[![License](https://poser.pugx.org/evenement/evenement/license.png)](https://packagist.org/packages/evenement/evenement) - -## Fetch - -The recommended way to install Événement is [through composer](http://getcomposer.org). By running the following command: - - $ composer require evenement/evenement - -## Usage - -### Creating an Emitter - -```php -on('user.created', function (User $user) use ($logger) { - $logger->log(sprintf("User '%s' was created.", $user->getLogin())); -}); -``` - -### Removing Listeners - -```php -removeListener('user.created', function (User $user) use ($logger) { - $logger->log(sprintf("User '%s' was created.", $user->getLogin())); -}); -``` - -### Emitting Events - -```php -emit('user.created', [$user]); -``` - -Tests ------ - - $ ./vendor/bin/phpunit - -License -------- -MIT, see LICENSE. diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/composer.json b/tools/php-cs-fixer/vendor/evenement/evenement/composer.json deleted file mode 100644 index 5444d93e..00000000 --- a/tools/php-cs-fixer/vendor/evenement/evenement/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "evenement/evenement", - "description": "Événement is a very simple event dispatching library for PHP", - "keywords": ["event-dispatcher", "event-emitter"], - "license": "MIT", - "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^9 || ^6" - }, - "autoload": { - "psr-4": { - "Evenement\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Evenement\\Tests\\": "tests/" - }, - "files": ["tests/functions.php"] - } -} diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitter.php b/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitter.php deleted file mode 100644 index db189b97..00000000 --- a/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitter.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Evenement; - -class EventEmitter implements EventEmitterInterface -{ - use EventEmitterTrait; -} diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterInterface.php b/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterInterface.php deleted file mode 100644 index 310631a1..00000000 --- a/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Evenement; - -interface EventEmitterInterface -{ - public function on($event, callable $listener); - public function once($event, callable $listener); - public function removeListener($event, callable $listener); - public function removeAllListeners($event = null); - public function listeners($event = null); - public function emit($event, array $arguments = []); -} diff --git a/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterTrait.php b/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterTrait.php deleted file mode 100644 index 15034296..00000000 --- a/tools/php-cs-fixer/vendor/evenement/evenement/src/EventEmitterTrait.php +++ /dev/null @@ -1,154 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Evenement; - -use InvalidArgumentException; - -use function count; -use function array_keys; -use function array_merge; -use function array_search; -use function array_unique; -use function array_values; - -trait EventEmitterTrait -{ - protected $listeners = []; - protected $onceListeners = []; - - public function on($event, callable $listener) - { - if ($event === null) { - throw new InvalidArgumentException('event name must not be null'); - } - - if (!isset($this->listeners[$event])) { - $this->listeners[$event] = []; - } - - $this->listeners[$event][] = $listener; - - return $this; - } - - public function once($event, callable $listener) - { - if ($event === null) { - throw new InvalidArgumentException('event name must not be null'); - } - - if (!isset($this->onceListeners[$event])) { - $this->onceListeners[$event] = []; - } - - $this->onceListeners[$event][] = $listener; - - return $this; - } - - public function removeListener($event, callable $listener) - { - if ($event === null) { - throw new InvalidArgumentException('event name must not be null'); - } - - if (isset($this->listeners[$event])) { - $index = array_search($listener, $this->listeners[$event], true); - if (false !== $index) { - unset($this->listeners[$event][$index]); - if (count($this->listeners[$event]) === 0) { - unset($this->listeners[$event]); - } - } - } - - if (isset($this->onceListeners[$event])) { - $index = array_search($listener, $this->onceListeners[$event], true); - if (false !== $index) { - unset($this->onceListeners[$event][$index]); - if (count($this->onceListeners[$event]) === 0) { - unset($this->onceListeners[$event]); - } - } - } - } - - public function removeAllListeners($event = null) - { - if ($event !== null) { - unset($this->listeners[$event]); - } else { - $this->listeners = []; - } - - if ($event !== null) { - unset($this->onceListeners[$event]); - } else { - $this->onceListeners = []; - } - } - - public function listeners($event = null): array - { - if ($event === null) { - $events = []; - $eventNames = array_unique( - array_merge( - array_keys($this->listeners), - array_keys($this->onceListeners) - ) - ); - foreach ($eventNames as $eventName) { - $events[$eventName] = array_merge( - isset($this->listeners[$eventName]) ? $this->listeners[$eventName] : [], - isset($this->onceListeners[$eventName]) ? $this->onceListeners[$eventName] : [] - ); - } - return $events; - } - - return array_merge( - isset($this->listeners[$event]) ? $this->listeners[$event] : [], - isset($this->onceListeners[$event]) ? $this->onceListeners[$event] : [] - ); - } - - public function emit($event, array $arguments = []) - { - if ($event === null) { - throw new InvalidArgumentException('event name must not be null'); - } - - $listeners = []; - if (isset($this->listeners[$event])) { - $listeners = array_values($this->listeners[$event]); - } - - $onceListeners = []; - if (isset($this->onceListeners[$event])) { - $onceListeners = array_values($this->onceListeners[$event]); - } - - if(empty($listeners) === false) { - foreach ($listeners as $listener) { - $listener(...$arguments); - } - } - - if(empty($onceListeners) === false) { - unset($this->onceListeners[$event]); - foreach ($onceListeners as $listener) { - $listener(...$arguments); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/.envrc b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/.envrc deleted file mode 100644 index a7c02efb..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/.envrc +++ /dev/null @@ -1,5 +0,0 @@ -use nix --packages \ - gnumake \ - yamllint - -source_env_if_exists .envrc.local diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/LICENSE.md b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/LICENSE.md deleted file mode 100644 index 02442130..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/LICENSE.md +++ /dev/null @@ -1,16 +0,0 @@ -# The MIT License (MIT) - -Copyright (c) 2022 Théo FIDRY - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the _Software_), to deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED **AS IS**, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/README.md b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/README.md deleted file mode 100644 index 6b554d2e..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/README.md +++ /dev/null @@ -1,138 +0,0 @@ -# CPU Core Counter - -This package is a tiny utility to get the number of CPU cores. - -```sh -composer require fidry/cpu-core-counter -``` - - -## Usage - -```php -use Fidry\CpuCoreCounter\CpuCoreCounter; -use Fidry\CpuCoreCounter\NumberOfCpuCoreNotFound; -use Fidry\CpuCoreCounter\Finder\DummyCpuCoreFinder; - -$counter = new CpuCoreCounter(); - -// For knowing the number of cores you can use for launching parallel processes: -$counter->getAvailableForParallelisation()->availableCpus; - -// Get the number of CPU cores (by default it will use the logical cores count): -try { - $counter->getCount(); // e.g. 8 -} catch (NumberOfCpuCoreNotFound) { - return 1; // Fallback value -} - -// An alternative form where we not want to catch the exception: - -$counter = new CpuCoreCounter([ - ...CpuCoreCounter::getDefaultFinders(), - new DummyCpuCoreFinder(1), // Fallback value -]); - -// A type-safe alternative form: -$counter->getCountWithFallback(1); - -// Note that the result is memoized. -$counter->getCount(); // e.g. 8 - -``` - - -## Advanced usage - -### Changing the finders - -When creating `CpuCoreCounter`, you may want to change the order of the finders -used or disable a specific finder. You can easily do so by passing the finders -you want - -```php -// Remove WindowsWmicFinder -$finders = array_filter( - CpuCoreCounter::getDefaultFinders(), - static fn (CpuCoreFinder $finder) => !($finder instanceof WindowsWmicFinder) -); - -$cores = (new CpuCoreCounter($finders))->getCount(); -``` - -```php -// Use CPUInfo first & don't use Nproc -$finders = [ - new CpuInfoFinder(), - new WindowsWmicFinder(), - new HwLogicalFinder(), -]; - -$cores = (new CpuCoreCounter($finders))->getCount(); -``` - -### Choosing only logical or physical finders - -`FinderRegistry` provides two helpful entries: - -- `::getDefaultLogicalFinders()`: gives an ordered list of finders that will - look for the _logical_ CPU cores count. -- `::getDefaultPhysicalFinders()`: gives an ordered list of finders that will - look for the _physical_ CPU cores count. - -By default, when using `CpuCoreCounter`, it will use the logical finders since -it is more likely what you are looking for and is what is used by PHP source to -build the PHP binary. - - -### Checks what finders find what on your system - -You have three scrips available that provides insight about what the finders -can find: - -```shell -# Checks what each given finder will find on your system with details about the -# information it had. -make diagnose # From this repository -./vendor/fidry/cpu-core-counter/bin/diagnose.php # From the library -``` - -And: -```shell -# Execute all finders and display the result they found. -make execute # From this repository -./vendor/fidry/cpu-core-counter/bin/execute.php # From the library -``` - - -### Debug the results found - -You have 3 methods available to help you find out what happened: - -1. If you are using the default configuration of finder registries, you can check - the previous section which will provide plenty of information. -2. If what you are interested in is how many CPU cores were found, you can use - the `CpuCoreCounter::trace()` method. -3. If what you are interested in is how the calculation of CPU cores available - for parallelisation was done, you can inspect the values of `ParallelisationResult` - returned by `CpuCoreCounter::getAvailableForParallelisation()`. - - -## Backward Compatibility Promise (BCP) - -The policy is for the major part following the same as [Symfony's one][symfony-bc-policy]. -Note that the code marked as `@private` or `@internal` are excluded from the BCP. - -The following elements are also excluded: - -- The `diagnose` and `execute` commands: those are for debugging/inspection purposes only -- `FinderRegistry::get*Finders()`: new finders may be added or the order of finders changed at any time - - -## License - -This package is licensed using the MIT License. - -Please have a look at [`LICENSE.md`](LICENSE.md). - -[symfony-bc-policy]: https://symfony.com/doc/current/contributing/code/bc.html diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/diagnose.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/diagnose.php deleted file mode 100755 index 7dd894a1..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/diagnose.php +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -use Fidry\CpuCoreCounter\Diagnoser; -use Fidry\CpuCoreCounter\Finder\FinderRegistry; - -require_once __DIR__.'/../vendor/autoload.php'; - -echo 'Running diagnosis...'.PHP_EOL.PHP_EOL; -echo Diagnoser::diagnose(FinderRegistry::getAllVariants()).PHP_EOL; - -echo 'Logical CPU cores finders...'.PHP_EOL.PHP_EOL; -echo Diagnoser::diagnose(FinderRegistry::getDefaultLogicalFinders()).PHP_EOL; - -echo 'Physical CPU cores finders...'.PHP_EOL.PHP_EOL; -echo Diagnoser::diagnose(FinderRegistry::getDefaultPhysicalFinders()).PHP_EOL; diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/execute.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/execute.php deleted file mode 100755 index edadebb1..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/execute.php +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -use Fidry\CpuCoreCounter\Diagnoser; -use Fidry\CpuCoreCounter\Finder\FinderRegistry; - -require_once __DIR__.'/../vendor/autoload.php'; - -echo 'Executing finders...'.PHP_EOL.PHP_EOL; -echo Diagnoser::execute(FinderRegistry::getAllVariants()).PHP_EOL; diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/trace.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/trace.php deleted file mode 100755 index adb52e24..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/bin/trace.php +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -use Fidry\CpuCoreCounter\CpuCoreCounter; -use Fidry\CpuCoreCounter\Finder\FinderRegistry; - -require_once __DIR__.'/../vendor/autoload.php'; - -$separator = str_repeat('–', 80); - -echo 'With all finders...'.PHP_EOL.PHP_EOL; -echo (new CpuCoreCounter(FinderRegistry::getAllVariants()))->trace().PHP_EOL; -echo $separator.PHP_EOL.PHP_EOL; - -echo 'Logical CPU cores finders...'.PHP_EOL.PHP_EOL; -echo (new CpuCoreCounter(FinderRegistry::getDefaultLogicalFinders()))->trace().PHP_EOL; -echo $separator.PHP_EOL.PHP_EOL; - -echo 'Physical CPU cores finders...'.PHP_EOL.PHP_EOL; -echo (new CpuCoreCounter(FinderRegistry::getDefaultPhysicalFinders()))->trace().PHP_EOL; -echo $separator.PHP_EOL.PHP_EOL; diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/composer.json b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/composer.json deleted file mode 100644 index 3f324d19..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/composer.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "fidry/cpu-core-counter", - "description": "Tiny utility to get the number of CPU cores.", - "license": "MIT", - "type": "library", - "keywords": [ - "cpu", - "core" - ], - "authors": [ - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com" - } - ], - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "fidry/makefile": "^0.2.0", - "fidry/php-cs-fixer-config": "^1.1.2", - "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan-phpunit": "^1.2.2", - "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^8.5.31 || ^9.5.26", - "webmozarts/strict-phpunit": "^7.5" - }, - "autoload": { - "psr-4": { - "Fidry\\CpuCoreCounter\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Fidry\\CpuCoreCounter\\Test\\": "tests/" - } - }, - "config": { - "allow-plugins": { - "ergebnis/composer-normalize": true, - "infection/extension-installer": true, - "phpstan/extension-installer": true - }, - "sort-packages": true - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php deleted file mode 100644 index 8c8b55bd..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php +++ /dev/null @@ -1,268 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter; - -use Fidry\CpuCoreCounter\Finder\CpuCoreFinder; -use Fidry\CpuCoreCounter\Finder\EnvVariableFinder; -use Fidry\CpuCoreCounter\Finder\FinderRegistry; -use InvalidArgumentException; -use function implode; -use function max; -use function sprintf; -use function sys_getloadavg; -use const PHP_EOL; - -final class CpuCoreCounter -{ - /** - * @var list - */ - private $finders; - - /** - * @var positive-int|null - */ - private $count; - - /** - * @param list|null $finders - */ - public function __construct(?array $finders = null) - { - $this->finders = $finders ?? FinderRegistry::getDefaultLogicalFinders(); - } - - /** - * @param positive-int|0 $reservedCpus Number of CPUs to reserve. This is useful when you want - * to reserve some CPUs for other processes. If the main - * process is going to be busy still, you may want to set - * this value to 1. - * @param non-zero-int|null $countLimit The maximum number of CPUs to return. If not provided, it - * may look for a limit in the environment variables, e.g. - * KUBERNETES_CPU_LIMIT. If negative, the limit will be - * the total number of cores found minus the absolute value. - * For instance if the system has 10 cores and countLimit=-2, - * then the effective limit considered will be 8. - * @param float|null $loadLimit Element of [0., 1.]. Percentage representing the - * amount of cores that should be used among the available - * resources. For instance, if set to 0.7, it will use 70% - * of the available cores, i.e. if 1 core is reserved, 11 - * cores are available and 5 are busy, it will use 70% - * of (11-1-5)=5 cores, so 3 cores. Set this parameter to null - * to skip this check. Beware that 1 does not mean "no limit", - * but 100% of the _available_ resources, i.e. with the - * previous example, it will return 5 cores. How busy is - * the system is determined by the system load average - * (see $systemLoadAverage). - * @param float|null $systemLoadAverage The system load average. If passed, it will use - * this information to limit the available cores based - * on the _available_ resources. For instance, if there - * is 10 cores but 3 are busy, then only 7 cores will - * be considered for further calculation. If set to - * `null`, it will use `sys_getloadavg()` to check the - * load of the system in the past minute. You can - * otherwise pass an arbitrary value. Should be a - * positive float. - * - * @see https://php.net/manual/en/function.sys-getloadavg.php - */ - public function getAvailableForParallelisation( - int $reservedCpus = 0, - ?int $countLimit = null, - ?float $loadLimit = null, - ?float $systemLoadAverage = 0. - ): ParallelisationResult { - self::checkCountLimit($countLimit); - self::checkLoadLimit($loadLimit); - self::checkSystemLoadAverage($systemLoadAverage); - - $totalCoreCount = $this->getCountWithFallback(1); - $availableCores = max(1, $totalCoreCount - $reservedCpus); - - // Adjust available CPUs based on current load - if (null !== $loadLimit) { - $correctedSystemLoadAverage = null === $systemLoadAverage - ? sys_getloadavg()[0] ?? 0. - : $systemLoadAverage; - - $availableCores = max( - 1, - $loadLimit * ($availableCores - $correctedSystemLoadAverage) - ); - } - - if (null === $countLimit) { - $correctedCountLimit = self::getKubernetesLimit(); - } else { - $correctedCountLimit = $countLimit > 0 - ? $countLimit - : max(1, $totalCoreCount + $countLimit); - } - - if (null !== $correctedCountLimit && $availableCores > $correctedCountLimit) { - $availableCores = $correctedCountLimit; - } - - return new ParallelisationResult( - $reservedCpus, - $countLimit, - $loadLimit, - $systemLoadAverage, - $correctedCountLimit, - $correctedSystemLoadAverage ?? $systemLoadAverage, - $totalCoreCount, - (int) $availableCores - ); - } - - /** - * @throws NumberOfCpuCoreNotFound - * - * @return positive-int - */ - public function getCount(): int - { - // Memoize result - if (null === $this->count) { - $this->count = $this->findCount(); - } - - return $this->count; - } - - /** - * @param positive-int $fallback - * - * @return positive-int - */ - public function getCountWithFallback(int $fallback): int - { - try { - return $this->getCount(); - } catch (NumberOfCpuCoreNotFound $exception) { - return $fallback; - } - } - - /** - * This method is mostly for debugging purposes. - */ - public function trace(): string - { - $output = []; - - foreach ($this->finders as $finder) { - $output[] = sprintf( - 'Executing the finder "%s":', - $finder->toString() - ); - $output[] = $finder->diagnose(); - - $cores = $finder->find(); - - if (null !== $cores) { - $output[] = 'Result found: '.$cores; - - break; - } - - $output[] = '–––'; - } - - return implode(PHP_EOL, $output); - } - - /** - * @throws NumberOfCpuCoreNotFound - * - * @return positive-int - */ - private function findCount(): int - { - foreach ($this->finders as $finder) { - $cores = $finder->find(); - - if (null !== $cores) { - return $cores; - } - } - - throw NumberOfCpuCoreNotFound::create(); - } - - /** - * @throws NumberOfCpuCoreNotFound - * - * @return array{CpuCoreFinder, positive-int} - */ - public function getFinderAndCores(): array - { - foreach ($this->finders as $finder) { - $cores = $finder->find(); - - if (null !== $cores) { - return [$finder, $cores]; - } - } - - throw NumberOfCpuCoreNotFound::create(); - } - - /** - * @return positive-int|null - */ - public static function getKubernetesLimit(): ?int - { - $finder = new EnvVariableFinder('KUBERNETES_CPU_LIMIT'); - - return $finder->find(); - } - - private static function checkCountLimit(?int $countLimit): void - { - if (0 === $countLimit) { - throw new InvalidArgumentException( - 'The count limit must be a non zero integer. Got "0".' - ); - } - } - - private static function checkLoadLimit(?float $loadLimit): void - { - if (null === $loadLimit) { - return; - } - - if ($loadLimit < 0. || $loadLimit > 1.) { - throw new InvalidArgumentException( - sprintf( - 'The load limit must be in the range [0., 1.], got "%s".', - $loadLimit - ) - ); - } - } - - private static function checkSystemLoadAverage(?float $systemLoadAverage): void - { - if (null !== $systemLoadAverage && $systemLoadAverage < 0.) { - throw new InvalidArgumentException( - sprintf( - 'The system load average must be a positive float, got "%s".', - $systemLoadAverage - ) - ); - } - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Diagnoser.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Diagnoser.php deleted file mode 100644 index 872b55f8..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Diagnoser.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter; - -use Fidry\CpuCoreCounter\Finder\CpuCoreFinder; -use function array_map; -use function explode; -use function implode; -use function max; -use function str_repeat; -use const PHP_EOL; - -/** - * Utility to debug. - * - * @private - */ -final class Diagnoser -{ - /** - * Provides an aggregated diagnosis based on each finders diagnosis. - * - * @param list $finders - */ - public static function diagnose(array $finders): string - { - $diagnoses = array_map( - static function (CpuCoreFinder $finder): string { - return self::diagnoseFinder($finder); - }, - $finders - ); - - return implode(PHP_EOL, $diagnoses); - } - - /** - * Executes each finders. - * - * @param list $finders - */ - public static function execute(array $finders): string - { - $diagnoses = array_map( - static function (CpuCoreFinder $finder): string { - $coresCount = $finder->find(); - - return implode( - '', - [ - $finder->toString(), - ': ', - null === $coresCount ? 'NULL' : $coresCount, - ] - ); - }, - $finders - ); - - return implode(PHP_EOL, $diagnoses); - } - - private static function diagnoseFinder(CpuCoreFinder $finder): string - { - $diagnosis = $finder->diagnose(); - - $maxLineLength = max( - array_map( - 'strlen', - explode(PHP_EOL, $diagnosis) - ) - ); - - $separator = str_repeat('-', $maxLineLength); - - return implode( - '', - [ - $finder->toString().':'.PHP_EOL, - $separator.PHP_EOL, - $diagnosis.PHP_EOL, - $separator.PHP_EOL, - ] - ); - } - - private function __construct() - { - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php deleted file mode 100644 index 751a311d..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Executor; - -use function fclose; -use function function_exists; -use function is_resource; -use function proc_close; -use function proc_open; -use function stream_get_contents; - -final class ProcOpenExecutor implements ProcessExecutor -{ - public function execute(string $command): ?array - { - if (!function_exists('proc_open')) { - return null; - } - - $pipes = []; - - $process = @proc_open( - $command, - [ - ['pipe', 'rb'], - ['pipe', 'wb'], // stdout - ['pipe', 'wb'], // stderr - ], - $pipes - ); - - if (!is_resource($process)) { - return null; - } - - fclose($pipes[0]); - - $stdout = (string) stream_get_contents($pipes[1]); - $stderr = (string) stream_get_contents($pipes[2]); - - proc_close($process); - - return [$stdout, $stderr]; - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php deleted file mode 100644 index 287c01e1..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Executor; - -interface ProcessExecutor -{ - /** - * @return array{string, string}|null STDOUT & STDERR tuple - */ - public function execute(string $command): ?array; -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php deleted file mode 100644 index ee5c7d3d..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function preg_match; - -/** - * Find the number of logical CPU cores for Windows leveraging the Get-CimInstance - * cmdlet, which is a newer version that is recommended over Get-WmiObject. - */ -final class CmiCmdletLogicalFinder extends ProcOpenBasedFinder -{ - private const CPU_CORE_COUNT_REGEX = '/NumberOfLogicalProcessors[\s\n]-+[\s\n]+(?\d+)/'; - - protected function getCommand(): string - { - return 'Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property NumberOfLogicalProcessors'; - } - - public function toString(): string - { - return 'CmiCmdletLogicalFinder'; - } - - protected function countCpuCores(string $process): ?int - { - if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) { - return parent::countCpuCores($process); - } - - $count = $matches['count']; - - return parent::countCpuCores($count); - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php deleted file mode 100644 index 85301236..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function preg_match; - -/** - * Find the number of physical CPU cores for Windows. - * - * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L912-L916 - */ -final class CmiCmdletPhysicalFinder extends ProcOpenBasedFinder -{ - private const CPU_CORE_COUNT_REGEX = '/NumberOfCores[\s\n]-+[\s\n]+(?\d+)/'; - - protected function getCommand(): string - { - return 'Get-CimInstance -ClassName Win32_Processor | Select-Object -Property NumberOfCores'; - } - - public function toString(): string - { - return 'CmiCmdletPhysicalFinder'; - } - - protected function countCpuCores(string $process): ?int - { - if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) { - return parent::countCpuCores($process); - } - - $count = $matches['count']; - - return parent::countCpuCores($count); - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php deleted file mode 100644 index edb40e86..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -interface CpuCoreFinder -{ - /** - * Provides an explanation which may offer some insight as to what the finder - * will be able to find. - * - * This is practical to have an idea of what each finder will find collect - * information for the unit tests, since integration tests are quite complicated - * as dependent on complex infrastructures. - */ - public function diagnose(): string; - - /** - * Find the number of CPU cores. If it could not find it, returns null. The - * means used to find the cores are at the implementation discretion. - * - * @return positive-int|null - */ - public function find(): ?int; - - public function toString(): string; -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php deleted file mode 100644 index 8013877d..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function file_get_contents; -use function is_file; -use function sprintf; -use function substr_count; -use const PHP_EOL; - -/** - * Find the number of CPU cores looking up at the cpuinfo file which is available - * on Linux systems and Windows systems with a Linux sub-system. - * - * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L903-L909 - * @see https://unix.stackexchange.com/questions/146051/number-of-processors-in-proc-cpuinfo - */ -final class CpuInfoFinder implements CpuCoreFinder -{ - private const CPU_INFO_PATH = '/proc/cpuinfo'; - - public function diagnose(): string - { - if (!is_file(self::CPU_INFO_PATH)) { - return sprintf( - 'The file "%s" could not be found.', - self::CPU_INFO_PATH - ); - } - - $cpuInfo = file_get_contents(self::CPU_INFO_PATH); - - if (false === $cpuInfo) { - return sprintf( - 'Could not get the content of the file "%s".', - self::CPU_INFO_PATH - ); - } - - return sprintf( - 'Found the file "%s" with the content:%s%s%sWill return "%s".', - self::CPU_INFO_PATH, - PHP_EOL, - $cpuInfo, - PHP_EOL, - self::countCpuCores($cpuInfo) - ); - } - - /** - * @return positive-int|null - */ - public function find(): ?int - { - $cpuInfo = self::getCpuInfo(); - - return null === $cpuInfo ? null : self::countCpuCores($cpuInfo); - } - - public function toString(): string - { - return 'CpuInfoFinder'; - } - - private static function getCpuInfo(): ?string - { - if (!@is_file(self::CPU_INFO_PATH)) { - return null; - } - - $cpuInfo = @file_get_contents(self::CPU_INFO_PATH); - - return false === $cpuInfo - ? null - : $cpuInfo; - } - - /** - * @internal - * - * @return positive-int|null - */ - public static function countCpuCores(string $cpuInfo): ?int - { - $processorCount = substr_count($cpuInfo, 'processor'); - - return $processorCount > 0 ? $processorCount : null; - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php deleted file mode 100644 index 1efa4da6..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function sprintf; - -/** - * This finder returns whatever value you gave to it. This is useful for testing - * or as a fallback to avoid to catch the NumberOfCpuCoreNotFound exception. - */ -final class DummyCpuCoreFinder implements CpuCoreFinder -{ - /** - * @var positive-int - */ - private $count; - - public function diagnose(): string - { - return sprintf( - 'Will return "%d".', - $this->count - ); - } - - /** - * @param positive-int $count - */ - public function __construct(int $count) - { - $this->count = $count; - } - - public function find(): ?int - { - return $this->count; - } - - public function toString(): string - { - return sprintf( - 'DummyCpuCoreFinder(value=%d)', - $this->count - ); - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php deleted file mode 100644 index fa23278f..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function getenv; -use function preg_match; -use function sprintf; -use function var_export; - -final class EnvVariableFinder implements CpuCoreFinder -{ - /** @var string */ - private $environmentVariableName; - - public function __construct(string $environmentVariableName) - { - $this->environmentVariableName = $environmentVariableName; - } - - public function diagnose(): string - { - $value = getenv($this->environmentVariableName); - - return sprintf( - 'parse(getenv(%s)=%s)=%s', - $this->environmentVariableName, - var_export($value, true), - self::isPositiveInteger($value) ? $value : 'null' - ); - } - - public function find(): ?int - { - $value = getenv($this->environmentVariableName); - - return self::isPositiveInteger($value) - ? (int) $value - : null; - } - - public function toString(): string - { - return sprintf( - 'getenv(%s)', - $this->environmentVariableName - ); - } - - /** - * @param string|false $value - */ - private static function isPositiveInteger($value): bool - { - return false !== $value - && 1 === preg_match('/^\d+$/', $value) - && (int) $value > 0; - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php deleted file mode 100644 index ca9b8602..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -final class FinderRegistry -{ - /** - * @return list List of all the known finders with all their variants. - */ - public static function getAllVariants(): array - { - return [ - new CpuInfoFinder(), - new DummyCpuCoreFinder(1), - new HwLogicalFinder(), - new HwPhysicalFinder(), - new LscpuLogicalFinder(), - new LscpuPhysicalFinder(), - new _NProcessorFinder(), - new NProcessorFinder(), - new NProcFinder(true), - new NProcFinder(false), - new NullCpuCoreFinder(), - SkipOnOSFamilyFinder::forWindows( - new DummyCpuCoreFinder(1) - ), - OnlyOnOSFamilyFinder::forWindows( - new DummyCpuCoreFinder(1) - ), - new OnlyInPowerShellFinder(new CmiCmdletLogicalFinder()), - new OnlyInPowerShellFinder(new CmiCmdletPhysicalFinder()), - new WindowsRegistryLogicalFinder(), - new WmicPhysicalFinder(), - new WmicLogicalFinder(), - ]; - } - - /** - * @return list - */ - public static function getDefaultLogicalFinders(): array - { - return [ - OnlyOnOSFamilyFinder::forWindows( - new OnlyInPowerShellFinder( - new CmiCmdletLogicalFinder() - ) - ), - OnlyOnOSFamilyFinder::forWindows(new WindowsRegistryLogicalFinder()), - OnlyOnOSFamilyFinder::forWindows(new WmicLogicalFinder()), - new NProcFinder(), - new HwLogicalFinder(), - new _NProcessorFinder(), - new NProcessorFinder(), - new LscpuLogicalFinder(), - new CpuInfoFinder(), - ]; - } - - /** - * @return list - */ - public static function getDefaultPhysicalFinders(): array - { - return [ - OnlyOnOSFamilyFinder::forWindows( - new OnlyInPowerShellFinder( - new CmiCmdletPhysicalFinder() - ) - ), - OnlyOnOSFamilyFinder::forWindows(new WmicPhysicalFinder()), - new HwPhysicalFinder(), - new LscpuPhysicalFinder(), - ]; - } - - private function __construct() - { - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php deleted file mode 100644 index d1129038..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -/** - * Find the number of logical CPU cores for Linux, BSD and OSX. - * - * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L903-L909 - * @see https://opensource.apple.com/source/xnu/xnu-792.2.4/libkern/libkern/sysctl.h.auto.html - */ -final class HwLogicalFinder extends ProcOpenBasedFinder -{ - protected function getCommand(): string - { - return 'sysctl -n hw.logicalcpu'; - } - - public function toString(): string - { - return 'HwLogicalFinder'; - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php deleted file mode 100644 index 65ca1cfd..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -/** - * Find the number of physical CPU cores for Linux, BSD and OSX. - * - * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L903-L909 - * @see https://opensource.apple.com/source/xnu/xnu-792.2.4/libkern/libkern/sysctl.h.auto.html - */ -final class HwPhysicalFinder extends ProcOpenBasedFinder -{ - protected function getCommand(): string - { - return 'sysctl -n hw.physicalcpu'; - } - - public function toString(): string - { - return 'HwPhysicalFinder'; - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuLogicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuLogicalFinder.php deleted file mode 100644 index bce09ebf..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuLogicalFinder.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function count; -use function explode; -use function is_array; -use function preg_grep; -use const PHP_EOL; - -/** - * The number of logical cores. - * - * @see https://stackoverflow.com/a/23378780/5846754 - */ -final class LscpuLogicalFinder extends ProcOpenBasedFinder -{ - public function getCommand(): string - { - return 'lscpu -p'; - } - - protected function countCpuCores(string $process): ?int - { - $lines = explode(PHP_EOL, $process); - $actualLines = preg_grep('/^\d+,/', $lines); - - if (!is_array($actualLines)) { - return null; - } - - $count = count($actualLines); - - return 0 === $count ? null : $count; - } - - public function toString(): string - { - return 'LscpuLogicalFinder'; - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php deleted file mode 100644 index 58523cee..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function count; -use function explode; -use function is_array; -use function preg_grep; -use function strtok; -use const PHP_EOL; - -/** - * The number of physical processors. - * - * @see https://stackoverflow.com/a/23378780/5846754 - */ -final class LscpuPhysicalFinder extends ProcOpenBasedFinder -{ - public function toString(): string - { - return 'LscpuPhysicalFinder'; - } - - public function getCommand(): string - { - return 'lscpu -p'; - } - - protected function countCpuCores(string $process): ?int - { - $lines = explode(PHP_EOL, $process); - $actualLines = preg_grep('/^\d+/', $lines); - - if (!is_array($actualLines)) { - return null; - } - - $cores = []; - foreach ($actualLines as $line) { - strtok($line, ','); - $core = strtok(','); - - if (false === $core) { - continue; - } - - $cores[$core] = true; - } - unset($cores['-']); - - $count = count($cores); - - return 0 === $count ? null : $count; - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php deleted file mode 100644 index c0f7a6f7..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use Fidry\CpuCoreCounter\Executor\ProcessExecutor; -use function sprintf; - -/** - * The number of (logical) cores. - * - * @see https://github.com/infection/infection/blob/fbd8c44/src/Resource/Processor/CpuCoresCountProvider.php#L69-L82 - * @see https://unix.stackexchange.com/questions/146051/number-of-processors-in-proc-cpuinfo - */ -final class NProcFinder extends ProcOpenBasedFinder -{ - /** - * @var bool - */ - private $all; - - /** - * @param bool $all If disabled will give the number of cores available for the current process - * only. This is disabled by default as it is known to be "buggy" on virtual - * environments as the virtualization tool, e.g. VMWare, might over-commit - * resources by default. - */ - public function __construct( - bool $all = false, - ?ProcessExecutor $executor = null - ) { - parent::__construct($executor); - - $this->all = $all; - } - - public function toString(): string - { - return sprintf( - 'NProcFinder(all=%s)', - $this->all ? 'true' : 'false' - ); - } - - protected function getCommand(): string - { - return 'nproc'.($this->all ? ' --all' : ''); - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php deleted file mode 100644 index 9143e31c..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -/** - * Find the number of logical CPU cores for FreeSBD, Solaris and the likes. - * - * @see https://twitter.com/freebsdfrau/status/1052016199452700678?s=20&t=M2pHkRqmmna-UF68lfL2hw - */ -final class NProcessorFinder extends ProcOpenBasedFinder -{ - protected function getCommand(): string - { - return 'getconf NPROCESSORS_ONLN'; - } - - public function toString(): string - { - return 'NProcessorFinder'; - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php deleted file mode 100644 index 50af2d4d..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -/** - * This finder returns whatever value you gave to it. This is useful for testing. - */ -final class NullCpuCoreFinder implements CpuCoreFinder -{ - public function diagnose(): string - { - return 'Will return "null".'; - } - - public function find(): ?int - { - return null; - } - - public function toString(): string - { - return 'NullCpuCoreFinder'; - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php deleted file mode 100644 index d36d0305..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function getenv; -use function sprintf; - -final class OnlyInPowerShellFinder implements CpuCoreFinder -{ - /** - * @var CpuCoreFinder - */ - private $decoratedFinder; - - public function __construct(CpuCoreFinder $decoratedFinder) - { - $this->decoratedFinder = $decoratedFinder; - } - - public function diagnose(): string - { - $powerShellModulePath = getenv('PSModulePath'); - - return $this->skip() - ? sprintf( - 'Skipped; no power shell module path detected ("%s").', - $powerShellModulePath - ) - : $this->decoratedFinder->diagnose(); - } - - public function find(): ?int - { - return $this->skip() - ? null - : $this->decoratedFinder->find(); - } - - public function toString(): string - { - return sprintf( - 'OnlyInPowerShellFinder(%s)', - $this->decoratedFinder->toString() - ); - } - - private function skip(): bool - { - return false === getenv('PSModulePath'); - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php deleted file mode 100644 index 31478083..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function implode; -use function sprintf; -use const PHP_OS_FAMILY; - -final class OnlyOnOSFamilyFinder implements CpuCoreFinder -{ - /** - * @var list - */ - private $skippedOSFamilies; - - /** - * @var CpuCoreFinder - */ - private $decoratedFinder; - - /** - * @param string|list $skippedOSFamilyOrFamilies - */ - public function __construct( - $skippedOSFamilyOrFamilies, - CpuCoreFinder $decoratedFinder - ) { - $this->skippedOSFamilies = (array) $skippedOSFamilyOrFamilies; - $this->decoratedFinder = $decoratedFinder; - } - - public static function forWindows(CpuCoreFinder $decoratedFinder): self - { - return new self( - 'Windows', - $decoratedFinder - ); - } - - public static function forBSD(CpuCoreFinder $decoratedFinder): self - { - return new self( - 'BSD', - $decoratedFinder - ); - } - - public static function forDarwin(CpuCoreFinder $decoratedFinder): self - { - return new self( - 'Darwin', - $decoratedFinder - ); - } - - public static function forSolaris(CpuCoreFinder $decoratedFinder): self - { - return new self( - 'Solaris', - $decoratedFinder - ); - } - - public static function forLinux(CpuCoreFinder $decoratedFinder): self - { - return new self( - 'Linux', - $decoratedFinder - ); - } - - public function diagnose(): string - { - return $this->skip() - ? sprintf( - 'Skipped platform detected ("%s").', - PHP_OS_FAMILY - ) - : $this->decoratedFinder->diagnose(); - } - - public function find(): ?int - { - return $this->skip() - ? null - : $this->decoratedFinder->find(); - } - - public function toString(): string - { - return sprintf( - 'OnlyOnOSFamilyFinder(only=(%s),%s)', - implode(',', $this->skippedOSFamilies), - $this->decoratedFinder->toString() - ); - } - - private function skip(): bool - { - return !in_array(PHP_OS_FAMILY, $this->skippedOSFamilies, true); - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php deleted file mode 100644 index 4d51f898..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use Fidry\CpuCoreCounter\Executor\ProcessExecutor; -use Fidry\CpuCoreCounter\Executor\ProcOpenExecutor; -use function filter_var; -use function function_exists; -use function is_int; -use function sprintf; -use function trim; -use const FILTER_VALIDATE_INT; -use const PHP_EOL; - -abstract class ProcOpenBasedFinder implements CpuCoreFinder -{ - /** - * @var ProcessExecutor - */ - private $executor; - - public function __construct(?ProcessExecutor $executor = null) - { - $this->executor = $executor ?? new ProcOpenExecutor(); - } - - public function diagnose(): string - { - if (!function_exists('proc_open')) { - return 'The function "proc_open" is not available.'; - } - - $command = $this->getCommand(); - $output = $this->executor->execute($command); - - if (null === $output) { - return sprintf( - 'Failed to execute the command "%s".', - $command - ); - } - - [$stdout, $stderr] = $output; - $failed = '' !== trim($stderr); - - return $failed - ? sprintf( - 'Executed the command "%s" which wrote the following output to the STDERR:%s%s%sWill return "null".', - $command, - PHP_EOL, - $stderr, - PHP_EOL - ) - : sprintf( - 'Executed the command "%s" and got the following (STDOUT) output:%s%s%sWill return "%s".', - $command, - PHP_EOL, - $stdout, - PHP_EOL, - $this->countCpuCores($stdout) ?? 'null' - ); - } - - /** - * @return positive-int|null - */ - public function find(): ?int - { - $output = $this->executor->execute($this->getCommand()); - - if (null === $output) { - return null; - } - - [$stdout, $stderr] = $output; - $failed = '' !== trim($stderr); - - return $failed - ? null - : $this->countCpuCores($stdout); - } - - /** - * @internal - * - * @return positive-int|null - */ - protected function countCpuCores(string $process): ?int - { - $cpuCount = filter_var($process, FILTER_VALIDATE_INT); - - return is_int($cpuCount) && $cpuCount > 0 ? $cpuCount : null; - } - - abstract protected function getCommand(): string; -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php deleted file mode 100644 index 66a50164..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function implode; -use function in_array; -use function sprintf; - -final class SkipOnOSFamilyFinder implements CpuCoreFinder -{ - /** - * @var list - */ - private $skippedOSFamilies; - - /** - * @var CpuCoreFinder - */ - private $decoratedFinder; - - /** - * @param string|list $skippedOSFamilyOrFamilies - */ - public function __construct( - $skippedOSFamilyOrFamilies, - CpuCoreFinder $decoratedFinder - ) { - $this->skippedOSFamilies = (array) $skippedOSFamilyOrFamilies; - $this->decoratedFinder = $decoratedFinder; - } - - public static function forWindows(CpuCoreFinder $decoratedFinder): self - { - return new self( - 'Windows', - $decoratedFinder - ); - } - - public static function forBSD(CpuCoreFinder $decoratedFinder): self - { - return new self( - 'BSD', - $decoratedFinder - ); - } - - public static function forDarwin(CpuCoreFinder $decoratedFinder): self - { - return new self( - 'Darwin', - $decoratedFinder - ); - } - - public static function forSolaris(CpuCoreFinder $decoratedFinder): self - { - return new self( - 'Solaris', - $decoratedFinder - ); - } - - public static function forLinux(CpuCoreFinder $decoratedFinder): self - { - return new self( - 'Linux', - $decoratedFinder - ); - } - - public function diagnose(): string - { - return $this->skip() - ? sprintf( - 'Skipped platform detected ("%s").', - PHP_OS_FAMILY - ) - : $this->decoratedFinder->diagnose(); - } - - public function find(): ?int - { - return $this->skip() - ? null - : $this->decoratedFinder->find(); - } - - public function toString(): string - { - return sprintf( - 'SkipOnOSFamilyFinder(skip=(%s),%s)', - implode(',', $this->skippedOSFamilies), - $this->decoratedFinder->toString() - ); - } - - private function skip(): bool - { - return in_array(PHP_OS_FAMILY, $this->skippedOSFamilies, true); - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php deleted file mode 100644 index b223652b..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function array_filter; -use function count; -use function explode; -use const PHP_EOL; - -/** - * Find the number of logical CPU cores for Windows. - * - * @see https://knowledge.informatica.com/s/article/151521 - */ -final class WindowsRegistryLogicalFinder extends ProcOpenBasedFinder -{ - protected function getCommand(): string - { - return 'reg query HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor'; - } - - public function toString(): string - { - return 'WindowsRegistryLogicalFinder'; - } - - protected function countCpuCores(string $process): ?int - { - $count = count( - array_filter( - explode(PHP_EOL, $process), - static function (string $line): bool { - return '' !== trim($line); - } - ) - ); - - return $count > 0 ? $count : null; - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php deleted file mode 100644 index db576a64..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function preg_match; - -/** - * Find the number of logical CPU cores for Windows. - * - * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L912-L916 - */ -final class WmicLogicalFinder extends ProcOpenBasedFinder -{ - private const CPU_CORE_COUNT_REGEX = '/NumberOfLogicalProcessors[\s\n]+(?\d+)/'; - - protected function getCommand(): string - { - return 'wmic cpu get NumberOfLogicalProcessors'; - } - - public function toString(): string - { - return 'WmicLogicalFinder'; - } - - protected function countCpuCores(string $process): ?int - { - if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) { - return parent::countCpuCores($process); - } - - $count = $matches['count']; - - return parent::countCpuCores($count); - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php deleted file mode 100644 index 140b9fdb..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -use function preg_match; - -/** - * Find the number of physical CPU cores for Windows. - * - * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L912-L916 - */ -final class WmicPhysicalFinder extends ProcOpenBasedFinder -{ - private const CPU_CORE_COUNT_REGEX = '/NumberOfCores[\s\n]+(?\d+)/'; - - protected function getCommand(): string - { - return 'wmic cpu get NumberOfCores'; - } - - public function toString(): string - { - return 'WmicPhysicalFinder'; - } - - protected function countCpuCores(string $process): ?int - { - if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) { - return parent::countCpuCores($process); - } - - $count = $matches['count']; - - return parent::countCpuCores($count); - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php deleted file mode 100644 index 23f452e4..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter\Finder; - -/** - * Find the number of logical CPU cores for Linux and the likes. - * - * @see https://twitter.com/freebsdfrau/status/1052016199452700678?s=20&t=M2pHkRqmmna-UF68lfL2hw - */ -final class _NProcessorFinder extends ProcOpenBasedFinder -{ - protected function getCommand(): string - { - return 'getconf _NPROCESSORS_ONLN'; - } - - public function toString(): string - { - return '_NProcessorFinder'; - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php deleted file mode 100644 index e54f8931..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter; - -use RuntimeException; - -final class NumberOfCpuCoreNotFound extends RuntimeException -{ - public static function create(): self - { - return new self( - 'Could not find the number of CPU cores available.' - ); - } -} diff --git a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/ParallelisationResult.php b/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/ParallelisationResult.php deleted file mode 100644 index 1f294349..00000000 --- a/tools/php-cs-fixer/vendor/fidry/cpu-core-counter/src/ParallelisationResult.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Fidry\CpuCoreCounter; - -/** - * @readonly - */ -final class ParallelisationResult -{ - /** - * @var positive-int|0 - */ - public $passedReservedCpus; - - /** - * @var non-zero-int|null - */ - public $passedCountLimit; - - /** - * @var float|null - */ - public $passedLoadLimit; - - /** - * @var float|null - */ - public $passedSystemLoadAverage; - - /** - * @var non-zero-int|null - */ - public $correctedCountLimit; - - /** - * @var float|null - */ - public $correctedSystemLoadAverage; - - /** - * @var positive-int - */ - public $totalCoresCount; - - /** - * @var positive-int - */ - public $availableCpus; - - /** - * @param positive-int|0 $passedReservedCpus - * @param non-zero-int|null $passedCountLimit - * @param non-zero-int|null $correctedCountLimit - * @param positive-int $totalCoresCount - * @param positive-int $availableCpus - */ - public function __construct( - int $passedReservedCpus, - ?int $passedCountLimit, - ?float $passedLoadLimit, - ?float $passedSystemLoadAverage, - ?int $correctedCountLimit, - ?float $correctedSystemLoadAverage, - int $totalCoresCount, - int $availableCpus - ) { - $this->passedReservedCpus = $passedReservedCpus; - $this->passedCountLimit = $passedCountLimit; - $this->passedLoadLimit = $passedLoadLimit; - $this->passedSystemLoadAverage = $passedSystemLoadAverage; - $this->correctedCountLimit = $correctedCountLimit; - $this->correctedSystemLoadAverage = $correctedSystemLoadAverage; - $this->totalCoresCount = $totalCoresCount; - $this->availableCpus = $availableCpus; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md deleted file mode 100644 index 934f4d58..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md +++ /dev/null @@ -1,5816 +0,0 @@ -CHANGELOG for PHP CS Fixer -========================== - -This file contains changelogs for stable releases only. - -Changelog for v3.68.1 ---------------------- - -* chore: `AutoReview/CiConfigurationTest` - handle failure of reading files (#8375) -* CI: `Docker` - check all `compose` services (#8370) -* deps: bump alpine from 3.18 to 3.21 (#8377) -* deps: bump alpine from 3.18.4 to 3.21.2 (#8362) -* refactor: Tokens::clearEmptyTokens - optimize cache handling (#8335) - -Changelog for v3.68.0 ---------------------- - -* feat: `ModernizeStrposFixer` - support `stripos` (#8019) -* chore: `FullyQualifiedStrictTypesFixer` - reduce conditions count (#8368) -* test: `PhpUnitSetUpTearDownVisibilityFixer` - extend test for anonymous classes (#8369) - -Changelog for v3.67.1 ---------------------- - -* fix: `FullyQualifiedStrictTypesFixer` - fix return types (#8367) -* fix: `PhpUnitSetUpTearDownVisibilityFixer` - do not touch anonymous classes (#8366) -* chore: allow for class-string in doc types of rule options (#8358) -* chore: CS: Move data provider methods after their test method (#8302) -* chore: dependabot integration (#8357) -* chore: `PHPStan` - upgrade to 2.1 (#8355) -* CI: Introduce PHP compatibility check (#7844) -* deps: bump docker/build-push-action from 5 to 6 (#8361) -* docs: update installation instructions (#8356) - -Changelog for v3.67.0 ---------------------- - -* chore: simplify loops using `end`/`prev` functions (#8352) -* feat: Introduce `general_attribute_remove` fixer (#8339) - -Changelog for v3.66.2 ---------------------- - -* chore: do not use bitwise "or" assignment operator (#8346) -* chore: remove extra check, never happening (#8348) -* chore: remove impossible `@throws` annotation (#8353) -* chore: Tokens - cleanup (#8350) -* chore: Tokens - minor performance and types optimizations (#8349) - -Changelog for v3.66.1 ---------------------- - -* chore: fix CI for Windows (#8326) -* chore: `NoMultipleStatementsPerLineFixer` - be aware of PHP 8.4 property hooks (#8344) -* chore: `TernaryToElvisOperatorFixer` - improvements based on PHPStan detections (#8345) -* chore: `PhpUnitTestCaseStaticMethodCallsFixer` - fix type of `methods` option in documemtation and add example with it (#8338) -* chore: update legacy deps (#8342) -* deps: update box (#8336) - -Changelog for v3.66.0 ---------------------- - -* feat: `Tokenizer` - initial support for PHP 8.4 property hooks (#8312) -* feat: `PhpUnitTestCaseStaticMethodCallsFixer` - cover PHPUnit v11.5 methods (#8314) -* feat: `PhpUnitTestCaseStaticMethodCallsFixer` - make sure all static protected methods are handled (#8327) -* feat: `PhpUnitTestCaseStaticMethodCallsFixer` - support createStub (#8319) -* feat: `UseArrowFunctionsFixer` - support multiline statements (#8311) -* fix: `NullableTypeDeclarationFixer` - do not break multi-line declaration (#8331) -* test: `CiConfigurationTest` - drop not needed condition, logic is checked in upcoming assertion (#8303) -* chore: add more typehints (#8325) -* chore: `DotsOutput` - more const, better typing (#8318) -* chore: mark classes as readonly (#8275) -* chore: more const, better typing (#8320) -* chore: temporarily prevent symfony/process 7.2+ (#8322) -* chore: `Tokens` - simplify (un)registerFoundToken types (#8328) -* chore: upgrade PHPStan (#8321) -* chore: `BraceTransformer` - don't touch curly index braces since 8.4, as it's not a valid syntax anymore (#8313) -* CI: enable phpdoc_to_property_type on php-lowest (#8324) -* Create SECURITY.md -* docs: `Tokens` - fix docs (#8332) - -Changelog for v3.65.0 ---------------------- - -* feat: Ability to set upper limit when using CPU auto-detection (#8280) -* feat: create `@PHP82Migration:risky` ruleset (#8277) -* feat: Impl. TypeExpression::mapTypes() (#8077) -* feat: Parse array/generic/nullable type into inner expression (#8106) -* feat: phpdoc_to_property_type - handle virtual types and null initialization, enable in php-highest CI job (#8283) -* feat: Store PHPDoc offset in `DataProviderAnalysis` (#8226) -* feat: Support for complex PHPDoc types in `fully_qualified_strict_types` (#8085) -* fix: check for priority tests correctly (#8221) -* fix: Do not mark with `@coversNothing` if `CoversMethod`/`CoversFunction` attribute is used (#8268) -* fix: enum-case mistaken for const invocation (#8190) -* fix: fix typing of few properties wrongly typed as non-nullable (#8285) -* fix: fix typing property wrongly typed as non-nullable (#8290) -* fix: MethodChainingIndentationFixer does not fix indentation of last chained property (#8080) -* fix: NoSuperfluousPhpdocTagsFixer - Remove superfluous phpdoc of parameter with attribute (#8237) -* fix: parsing mixed `&` and `|` in `TypeExpression` (#8210) -* fix: proper base class used for AbstractDoctrineAnnotationFixer templates generation (#8291) -* fix: Properly recognise constants in foreach loops (#8203) -* fix: Tokens::overrideRange() block cache pruning (#8240) -* fix: `BlankLineAfterOpeningTagFixer` - add blank line in file starting with multi-line comment (#8256) -* fix: `MultilineWhitespaceBeforeSemicolonsFixer` - do not produce syntax error when there is a meaningful token after semicolon (#8230) -* fix: `NullableTypeDeclarationFixer` - do not break syntax when there is no space before `?` (#8224) -* fix: `PhpUnitDataProvider(.+)Fixer` - do not omit when there is an attribute between PHPDoc and test method (#8185) -* fix: `PhpUnitDataProviderNameFixer` - for an attribute between PHPDoc and test method (#8217) -* chore: add todo for PHP v8 (#8274) -* chore: auto-fallback to sequential runner if single CPU would handle it (#8154) -* chore: block changing tokens collection size using `PhpCsFixer\Tokenizer\Tokens::setSize` (#8257) -* chore: bump dev-tools (#8286) -* chore: bump PHPStan (#8245) -* chore: Cheaper file check first (#8252) -* chore: ConfigInterface - better types (#8244) -* chore: do not call `Tokens::setSize` in `GroupImportFixer` (#8253) -* chore: do not use `Reflection*::setAccessible` (#8264) -* chore: fix priority tests (#8223) -* chore: Fix typos in AbstractFixerTestCase (#8247) -* chore: GithubClient - make URL injectable (#8272) -* chore: Implement PHPStan `Preg::match()` extensions (#8103) -* chore: mark remaining Analysis as `@internal` (#8284) -* chore: PHPStan - upgrade to v2 (#8288) -* chore: reduce amount of class mutable properties (#8281) -* chore: remove from priority tests exceptions tests that are not actually exceptions (#8222) -* chore: remove incorrect priority tests (#8231) -* chore: remove not needed PHP version requirements in descriptions (#8265) -* chore: remove unnecessary methods (#8200) -* chore: tests/Tokenizer/Transformer - better typehinting (#8243) -* chore: Token - remove 'changed' property (#8273) -* chore: Token::getContent() phpdoc return type (#8236) -* chore: update dev dependencies in root (#8289) -* chore: update PHPStan to 1.12.9 (#8271) -* chore: update `checkbashisms` to 2.24.1 (#8258) -* chore: use null coalescing assignment operator where possible (#8219) -* CI: allow macos to fail (#8194) -* CI: build phar on PHP 8.3 (#8195) -* CI: drop matrix for single-matrix-entry jobs of SCA and Deployment checks (#8193) -* CI: Ensure php-cs-fixer PHP compatibility /part (#8241) -* CI: Ensure `php-cs-fixer` PHP compatibility (#8235) -* CI: generate and execute code in `assert` (#8207) -* CI: update PHPStan to 1.12.2 (#8198) -* CI: update PHPStan to 1.12.3 (#8204) -* CI: use phpstan-symfony (#8287) -* depr: ConfigInterface::getPhpExecutable() and ConfigInterface::setPhpExecutable() (#8192) -* deps: add `composer-smaller-lock` (#8263) -* deps: Update PHPStan to 1.12.4 (#8215) -* deps: Update PHPStan to 1.12.5 (#8218) -* deps: update PHPStan to 1.12.7 (#8255) -* docs: fix unconsistency in config doc (#8269) -* docs: mention github action example instead of travis-ci (#8250) -* DX: Cover `php-cs-fixer` file with static analysis (#8229) -* DX: Make `TypeExpression` API more explicit about composite types (#8214) -* refactor: change `_AttributeItems` to `non-empty-list<_AttributeItem>` to allow using single attribute item (#8199) -* refactor: Rename newly introduced option (#8293) -* refactor: Runner - Enhance eventing system (#8276) -* refactor: Runner - make 4.0 TODOs easier to understand (#8196) -* refactor: use arrow functions in more places (#8294) -* test: `@PHP82Migration:risky` - add integration tests (#8278) - -Changelog for v3.64.0 ---------------------- - -* feat: Symfony - adjust configuration for sets (#8188) -* feat: Symfony.trailing_comma_in_multiline - adjust configuration (#8161) -* feat: Update PSR2, PSR12 and PER-CS2 with `single_space_around_construct` config (#8171) -* CI: Update PHPStan to 1.12.0 and fix the error that appeared (#8184) - -Changelog for v3.63.2 ---------------------- - -* fix: `FullyQualifiedStrictTypesFixer` - reset cache even if there is no `use` (#8183) - -Changelog for v3.63.1 ---------------------- - -* dummy release - -Changelog for v3.63.0 ---------------------- - -* feat: Add `array_destructuring` as option for `trailing_comma_in_multiline` (#8172) -* feat: remove braces even for single import (#8156) -* feat: TrailingCommaInMultilineFixer - dynamically evaluate config against PHP version (#8167) -* fix: Do not shorten FQN for class resolution if imported symbol is not a class (#7705) -* fix: Ensure PHP binary path is used as a single CLI argument in parallel worker process (#8180) -* fix: `PhpUnitAttributesFixer` - fix priorities with `PhpUnitDataProvider(.+)Fixer` (#8169) -* chore: add tags for data providers that will change PHPStan's baseline (#8178) -* chore: add `@return` tags for data providers already having PHPDoc (#8176) -* chore: add `@return` tags for data providers that do not have array in data (#8179) -* chore: remove duplicates from data providers (#8164) -* chore: remove duplicates from data providers that are copies in code (#8145) -* chore: remove `beStrictAboutTodoAnnotatedTests` from PHPUnit's config (#8160) -* CI: Update PHPStan to 1.11.10 (#8163) -* CI: Update PHPStan to 1.11.11 and fix error that changed (#8174) -* docs: fix indent on rule `date_time_create_from_format_call` (#8173) - -Changelog for v3.62.0 ---------------------- - -* feat: set new_with_parentheses for anonymous_class to false in PER-CS2.0 (#8140) -* chore: NewWithParenthesesFixer - create TODO to change the default configuration to match PER-CS2 (#8148) - -Changelog for v3.61.1 ---------------------- - -* fix: `NoSuperfluousPhpdocTagsFixer` - fix "Undefined array key 0" error (#8150) - -Changelog for v3.61.0 ---------------------- - -* feat: no_superfluous_phpdoc_tags - also cover ?type (#8125) -* feat: support PHPUnit v9.1 naming for some asserts (#7997) -* fix: Do not mangle non-whitespace token in `PhpdocIndentFixer` (#8147) -* DX: add more typehints for `class-string` (#8139) -* DX: refactor `ProjectCodeTest::provideDataProviderMethodCases` (#8138) - -Changelog for v3.60.0 ---------------------- - -* feat: Add sprintf in the list of compiler optimized functions (#8092) -* feat: `PhpUnitAttributesFixer` - add option to keep annotations (#8090) -* chore: cleanup tests that had `@requires PHP 7.4` ages ago (#8122) -* chore: cleanup `TokensAnalyzerTest` (#8123) -* chore: fix example issue reported by reportPossiblyNonexistentGeneralArrayOffset from PHPStan (#8089) -* chore: NoSuperfluousPhpdocTagsFixer - no need to call heavy toComparableNames method to add null type (#8132) -* chore: PHPStan 11 array rules (#8011) -* chore: PhpUnitSizeClassFixerTest - solve PHP 8.4 issues (#8105) -* chore: reduce PHPStan errors in PhpUnitAttributesFixer (#8091) -* chore: reuse test methods (#8119) -* CI: check autoload (#8121) -* CI: Update PHPStan to 1.11.8 (#8133) -* deps: upgrade dev-tools (#8102) -* DX: check for duplicated test data (#8131) -* DX: check for duplicated test methods (#8124) -* DX: check for duplicated test methods (as AutoReview test) (#8134) -* DX: do not exclude duplicates that are clearly mistakes (#8135) -* DX: Dump `offsetAccess.notFound` errors to baseline (#8107) -* fix: Better way of walking types in `TypeExpression` (#8076) -* fix: CI for PHP 8.4 (#8114) -* fix: update `TokensTest` to shrink PHPStan's baseline (#8112) -* fix: `no_useless_concat_operator` - do not break variable (2) (#7927) -* fix: `NullableTypeDeclarationFixer` - don't convert standalone `null` into nullable union type (#8098) -* fix: `NullableTypeDeclarationFixer` - don't convert standalone `NULL` into nullable union type (#8111) -* fix: `NullableTypeDeclarationFixer` - insert correct token (#8118) -* fix: `PhpUnitAttributesFixer` - handle multiple annotations of the same name (#8075) - -Changelog for v3.59.3 ---------------------- - -* refactor: refactor to templated trait+interface (#7988) - -Changelog for v3.59.2 ---------------------- - -* fix: "list" is reserved type (#8087) -* chore: add missing type in method prototype (#8088) -* CI: bump Ubuntu version (#8086) -* deps: bump infection to unblock PHPUnit 11, and few more as chore (#8083) - -Changelog for v3.59.1 ---------------------- - -* fix: Bump React's JSON decoder buffer size (#8068) -* docs: options - handle enums in dicts (#8082) - -Changelog for v3.59.0 ---------------------- - -* feat(Docker): Multi-arch build (support for `arm64`) (#8079) -* feat: `@PhpCsFixer` ruleset - normalise implicit backslashes in single quoted strings (#7965) -* feat: `SimpleToComplexStringVariableFixer` - support variable being an array (#8064) -* fix: Look up for PHPDoc's variable name by only chars allowed in the variables (#8062) -* fix: Update `PhpUnitTestCaseStaticMethodCallsFixer::STATIC_METHODS` (#8073) -* fix: `native_constant_invocation` - array constants with native constant names (#8008) -* chore: update PHPStan (#8060) -* CI: Update PHPStan to 1.11.4 (#8074) -* docs: don't expose list as config type for dicts (#8081) -* docs: Make wording in `final_class` docs less dismissive (#8065) -* docs: Update 1-bug_report.yml (#8067) -* DX: Remove version from Docker Compose files (#8061) - -Changelog for v3.58.1 ---------------------- - -* fix: `ConstantCaseFixer` - do not change class constant usages (#8055) -* fix: `PhpUnitTestClassRequiresCoversFixer` - do not add annotation when attribute with leading slash present (#8054) - -Changelog for v3.58.0 ---------------------- - -* chore(doc): Use FQCN for parallel config in documentation (#8029) -* chore: fix typo in `PhpUnitTestClassRequiresCoversFixerTest` (#8047) -* chore: RandomApiMigrationFixer - do not modify configuration property (#8033) -* chore: Tokens::setCode - further improvements to cache (#8053) -* chore: update PHPStan (#8045) -* docs: Add missing imports in a cookbook about creating custom rules (#8031) -* docs: fix deprecated string interpolation style (#8036) -* docs: global_namespace_import - simplify allowed config types (#8023) -* feat(GroupImportFixer): Ability to configure which type of imports should be grouped (#8046) -* fix: clear `Tokens::$blockStartCache` and `Tokens::$blockEndCache` when calling `Tokens::setCode` (#8051) -* fix: correctly handle PHP closing tag with `simplified_null_return` (#8049) -* fix: `ConstantCaseFixer` - do not change namespace (#8004) -* fix: `PhpUnitAttributesFixer` - do not add attribute if already present (#8043) -* fix: `PhpUnitSizeClassFixer` - do not add annotation when there are attributes (#8044) -* fix: `PhpUnitTestClassRequiresCoversFixer` - attribute detection when class is `readonly` (#8042) - -Changelog for v3.57.2 ---------------------- - -* docs: better ConfigurableFixer allowed types (#8024) -* docs: Improve Docker usage example (#8021) -* feat: Report used memory to 2 decimal digits only (#8017) -* fix: Support named args in `ParallelConfigFactory::detect()` (#8026) -* fix: `php_unit_test_class_requires_covers` Attribute detection when class is final (#8016) - -Changelog for v3.57.1 ---------------------- - -* chore: update PHPDoc in `Preg::matchAll` (#8012) -* fix: Runner - handle no files while in parallel runner (#8015) - -Changelog for v3.57.0 ---------------------- - -* feat: Ability to run Fixer with parallel runner 🎉 (#7777) - -Changelog for v3.56.2 ---------------------- - -* chore: update PHPStan (#8010) -* DX: Fix Mess Detector violations (#8007) -* DX: Install PCov extension for local Docker (#8006) - -Changelog for v3.56.1 ---------------------- - -* chore: improve PHPDoc typehints (#7994) -* CI: Allow any integer in PHPStan error for Token's constructor (#8000) -* fix: Better array shape in `PhpUnitDedicateAssertFixer` (#7999) -* fix: `ConstantCaseFixer` - do not touch typed constants (#7998) - -Changelog for v3.56.0 ---------------------- - -* feat: `TrailingCommaInMultilineFixer` - handle trailing comma in language constructs (#7989) -* fix: `TrailingCommaInMultilineFixer` - language constructs should be covered by arguments, not parameters (#7990) -* chore: remove invalid comment (#7987) -* DX: Cache optimisation (#7985) - -Changelog for v3.55.0 ---------------------- - -* feat: Introduce `OrderedAttributesFixer` (#7395) -* chore: few SCA fixes and dev-tools update (#7969) -* chore: fix phpdoc types (#7977) -* chore: narrow PHPDoc types (#7979) -* chore: Normalize implicit backslahes in single quoted strings internally (#7786) -* chore: phpdoc - rely on strict list/tuple/assoc instead of array (#7978) -* chore: PhpUnitDataProviderNameFixer - follow config creation pattern (#7980) -* chore: Preg - drop half-support for array-pattern (#7976) -* chore: re-use CodeHasher (#7984) -* chore: RuleSetsTest - assert that Fixer is configurable (#7961) -* chore: sugar syntax (#7986) -* chore: Tokens should be always a list (#7698) -* CI: Ad-hoc fix for MacOS jobs (#7970) -* CI: Fix calculating diff between branches in PRs (#7973) -* DX: allow to enforce cache mechanism by env var (#7983) -* DX: do not typehint fixed-length arrays as lists (#7974) -* DX: Prevent having deprecated fixers listed as successors of other deprecated fixers (#7967) -* DX: Resolve/Ignore PHPStan issues on level 6 + bump to level 7 with new baseline (#7971) -* DX: use `list` type in PHPDoc (#7975) -* fix: `PhpUnitAttributesFixer` - fix for `#[RequiresPhp]` exceeding its constructor parameters (#7966) -* test: don't count comment after class as another classy element (#7982) - -Changelog for v3.54.0 ---------------------- - -* feat: introduce `PhpUnitAttributesFixer` (#7831) -* chore: Properly determine self-approval trigger commit (#7936) -* chore: Revert ref for self-approval Git checkout (#7944) -* CI: check if proper array key is declared (#7912) -* DX: cleanup `FullyQualifiedStrictTypesFixerTest` (#7954) -* DX: cleanup `PhpdocNoAccessFixerTest` (#7933) -* DX: cleanup `PhpUnitMethodCasingFixerTest` (#7948) -* DX: cleanup `PhpUnitStrictFixerTest` (#7938) -* DX: Improve internal dist config for Fixer (#7952) -* DX: Improve issue templates (#7942) -* DX: there is no namespace if there is no PHP code (#7953) -* DX: update .gitattributes (#7931) -* fix: Remove Infection during Docker release (#7937) -* fix: `FullyQualifiedStrictTypesFixer` - do not add imports before PHP opening tag (#7955) -* fix: `PhpUnitMethodCasingFixer` - do not double underscore (#7949) -* fix: `PhpUnitTestClassRequiresCoversFixer` - do not add annotation when there are attributes (#7880) -* test: Ignore PHP version related mutations (#7935) - -Changelog for v3.53.0 ---------------------- - -* chore: Use `list` over `array` in more places (#7905) -* CI: allow for self-approvals for maintainers (#7921) -* CI: Improve Infection setup (#7913) -* CI: no need to trigger enable auto-merge when self-approve (#7929) -* DX: reduce `array_filter` function usages (#7923) -* DX: remove duplicated character from `trim` call (#7930) -* DX: update actions producing warnings (#7925) -* DX: update actions producing warnings (#7928) -* DX: update `phpstan/phpstan-strict-rules` (#7924) -* feat: Add trailing comma in multiline to PER-CS 2.0 (#7916) -* feat: Introduce `AttributeAnalysis` (#7909) -* feat: `@PHP84Migration` introduction (#7774) -* fix: Constant invocation detected in typed constants (#7892) -* fix: `PhpdocArrayTypeFixer` - JIT stack limit exhausted (#7895) -* test: Introduce Infection for mutation tests (#7874) - -Changelog for v3.52.1 ---------------------- - -* fix: StatementIndentationFixer - do not crash on ternary operator in class property (#7899) -* fix: `PhpCsFixer\Tokenizer\Tokens::setSize` return type (#7900) - -Changelog for v3.52.0 ---------------------- - -* chore: fix PHP 8.4 deprecations (#7894) -* chore: fix PHPStan 1.10.60 issues (#7873) -* chore: list over array in more places (#7876) -* chore: replace template with variable in Preg class (#7882) -* chore: update PHPStan (#7871) -* depr: `nullable_type_declaration_for_default_null_value` - deprecate option that is against `@PHP84Migration` (#7872) -* docs: Fix typo (#7889) -* feat: Add support for callable template in PHPDoc parser (#7084) -* feat: Add `array_indentation` to `PER-CS2.0` ruleset (#7881) -* feat: `@Symfony:risky` - add `no_unreachable_default_argument_value` (#7863) -* feat: `PhpCsFixer` ruleset - enable `nullable_type_declaration_for_default_null_value` (#7870) -* fix: Constant invocation detected in DNF types (#7869) -* fix: Correctly indent multiline constants and properties (#7875) -* fix: `no_useless_concat_operator` - do not break variable (#7827) -* fix: `TokensAnalyzer` - handle unary operator in arrow functions (#7862) -* fix: `TypeExpression` - fix "JIT stack limit exhausted" error (#7843) - -Changelog for v3.51.0 ---------------------- - -* chore: add missing tests for non-documentation classes (#7848) -* chore: do not perform type analysis in tests (#7852) -* chore: list over array in more places (#7857) -* chore: tests documentation classes (#7855) -* feat: `@Symfony` - add nullable_type_declaration (#7856) -* test: fix wrong type in param annotation (#7858) - -Changelog for v3.50.0 ---------------------- - -* chore: add missing types (#7842) -* chore: BlocksAnalyzer - raise exception on invalid index (#7819) -* chore: DataProviderAnalysis - expect list over array (#7800) -* chore: do not use `@large` on method level (#7832) -* chore: do not use `@medium` on method level (#7833) -* chore: Fix typos (#7835) -* chore: rename variables (#7847) -* chore: some improvements around array typehints (#7799) -* CI: fix PHP 8.4 job (#7829) -* DX: Include `symfony/var-dumper` in dev tools (#7795) -* feat: Ability to remove unused imports from multi-use statements (#7815) -* feat: allow PHPUnit 11 (#7824) -* feat: Allow shortening symbols from multi-use statements (only classes for now) (#7816) -* feat: introduce `PhpdocArrayTypeFixer` (#7812) -* feat: PhpUnitTestCaseStaticMethodCallsFixer - cover PHPUnit v11 methods (#7822) -* feat: Support for multi-use statements in `NamespaceUsesAnalyzer` (#7814) -* feat: `MbStrFunctionsFixer` - add support for `mb_trim`, `mb_ltrim` and `mb_rtrim` functions (#7840) -* feat: `NoEmptyPhpdocFixer` - do not leave empty line after removing PHPDoc (#7820) -* feat: `no_superfluous_phpdoc_tags` - introduce `allow_future_params` option (#7743) -* fix: do not use wrongly named arguments in data providers (#7823) -* fix: Ensure PCNTL extension is always installed in Docker (#7782) -* fix: PhpdocListTypeFixer - support key types containing `<…>` (#7817) -* fix: Proper build target for local Docker Compose (#7834) -* fix: union PHPDoc support in `fully_qualified_strict_types` fixer (#7719) -* fix: `ExecutorWithoutErrorHandler` - remove invalid PHP 7.4 type (#7845) -* fix: `fully_qualified_strict_types` must honor template/local type identifiers (#7724) -* fix: `MethodArgumentSpaceFixer` - do not break heredoc/nowdoc (#7828) -* fix: `NumericLiteralSeparatorFixer` - do not change `float` to `int` when there is nothing after the dot (#7805) -* fix: `PhpUnitStrictFixer` - do not crash on property having the name of method to fix (#7804) -* fix: `SingleSpaceAroundConstructFixer` - correctly recognise multiple constants (#7700) -* fix: `TypeExpression` - handle array shape key with dash (#7841) - -Changelog for v3.49.0 ---------------------- - -* chore(checkbashisms): update to 2.23.7 (#7780) -* chore: add missing key types in PHPDoc types (#7779) -* chore: Exclude `topic/core` issues/PRs from Stale Bot (#7788) -* chore: `DescribeCommand` - better handling of deprecations (#7778) -* docs: docker - use gitlab reporter in GitLab integration example (#7764) -* docs: docker in CI - don't suggest command that overrides path from config file (#7763) -* DX: check deprecations exactly (#7742) -* feat: Add `ordered_types` to `@Symfony` (#7356) -* feat: introduce `PhpdocListTypeFixer` (#7796) -* feat: introduce `string_implicit_backslashes` as `escape_implicit_backslashes` replacement (#7669) -* feat: update `Symfony.nullable_type_declaration_for_default_null_value` config (#7773) -* feat: `@PhpCsFixer` ruleset - enable `php_unit_data_provider_static` (#7685) -* fix: Allow using cache when running in Docker distribution (#7769) -* fix: ClassDefinitionFixer for anonymous class with phpdoc/attribute on separate line (#7546) -* fix: `ClassKeywordFixer` must run before `FullyQualifiedStrictTypesFixer` (#7767) -* fix: `function_to_constant` `get_class()` replacement (#7770) -* fix: `LowercaseStaticReferenceFixer` - do not change typed constants (#7775) -* fix: `PhpdocTypesFixer` - handle more complex types (#7791) -* fix: `TypeExpression` - do not break type using `walkTypes` method (#7785) - -Changelog for v3.48.0 ---------------------- - -* chore: `FullyQualifiedStrictTypesFixer` must run before `OrderedInterfacesFixer` (#7762) -* docs: Add PHP-CS-Fixer integration in a GitHub Action step (#7757) -* feat: `PhpdocTypesOrderFixer` Support DNF types (#7732) -* fix: Support shebang in fixers operating on PHP opening tag (#7687) -* fix: work correctly for a switch/case with ternary operator (#7756) -* fix: `NoUselessConcatOperatorFixer` - do not remove new line (#7759) - -Changelog for v3.47.1 ---------------------- - -* fix: Do not override short name with relative reference (#7752) -* fix: make `BinaryOperatorSpacesFixer` work as pre-v3.47 (#7751) -* fix: Proper Docker image name suffix (#7739) -* fix: `FullyQualifiedStrictTypesFixer` - do not change case of the symbol when there's name collision between imported class and imported function (#7750) -* fix: `FullyQualifiedStrictTypesFixer` - do not modify statements with property fetch and `::` (#7749) - -Changelog for v3.47.0 ---------------------- - -* chore: better identify EXPERIMENTAL rules (#7729) -* chore: fix issue detected by unlocked PHPStan + upgrade dev-tools (#7678) -* chore: handle extract() (#7684) -* chore: Mention contributors in app info (#7668) -* chore: no need to mark private methods as internal (#7715) -* chore: ProjectCodeTests - dry for function usage extractions (#7690) -* chore: reduce PHPStan baseline (#7644) -* chore: use numeric literal separator for PHP version IDs (#7712) -* chore: use numeric_literal_separator for project (#7713) -* chore: Utils::sortElements - better typing (#7646) -* CI: Allow running Stale Bot on demand (#7711) -* CI: Fix PHP 8.4 (#7702) -* CI: Give write permissions to Stale Bot (#7716) -* CI: Use `actions/stale` v9 (#7710) -* docs: Add information about allowing maintainers to update PRs (#7683) -* docs: CONTRIBUTING.md - update Opening a PR (#7691) -* docs: Display/include tool info/version by default in commands and reports (#7733) -* DX: fix deprecation tests warnings for PHP 7.4 (#7725) -* DX: update `host.docker.internal` in Compose override template (#7661) -* DX: `NumericLiteralSeparatorFixer` - change default strategy to `use_separator` (#7730) -* feat: Add support for official Docker images of Fixer (#7555) -* feat: Add `spacing` option to `PhpdocAlignFixer` (#6505) -* feat: Add `union_types` option to `phpdoc_to_param_type`, `phpdoc_to_property_type`, and `phpdoc_to_return_type` fixers (#7672) -* feat: Introduce `heredoc_closing_marker` fixer (#7660) -* feat: Introduce `multiline_string_to_heredoc` fixer (#7665) -* feat: Introduce `NumericLiteralSeparatorFixer` (#6761) -* feat: no_superfluous_phpdoc_tags - support for arrow function (#7666) -* feat: Simplify closing marker when possible in `heredoc_closing_marker` fixer (#7676) -* feat: Support typed properties and attributes in `fully_qualified_strict_types` (#7659) -* feat: `@PhpCsFixer` ruleset - enable no_whitespace_before_comma_in_array.after_heredoc (#7670) -* fix: Improve progress bar visual layer (#7708) -* fix: indentation of control structure body without braces (#7663) -* fix: make sure all PHP extensions required by PHPUnit are installed (#7727) -* fix: PhpdocToReturnTypeFixerTest - support for arrow functions (#7645) -* fix: Several improvements for `fully_qualified_strict_types` (respect declared symbols, relative imports, leading backslash in global namespace) (#7679) -* fix: SimplifiedNullReturnFixer - support array return typehint (#7728) -* fix: Support numeric values without leading zero in `numeric_literal_separator` (#7735) -* fix: `BinaryOperatorSpacesFixer` - align correctly when multiple shifts occurs in single line (#7593) -* fix: `ClassReferenceNameCasingFixer` capitalizes the property name after the nullsafe operator (#7696) -* fix: `fully_qualified_strict_types` with `leading_backslash_in_global_namespace` enabled - handle reserved types in phpDoc (#7648) -* fix: `NoSpaceAroundDoubleColonFixer` must run before `MethodChainingIndentationFixer` (#7723) -* fix: `no_superfluous_phpdoc_tags` must honor multiline docs (#7697) -* fix: `numeric_literal_separator` - Handle zero-leading floats properly (#7737) -* refactor: increase performance by ~7% thanks to `Tokens::block*Cache` hit increased by ~12% (#6176) -* refactor: Tokens - fast check for non-block in 'detectBlockType', evaluate definitions only once in 'getBlockEdgeDefinitions' (#7655) -* refactor: `Tokens::clearEmptyTokens` - play defensive with cache clearing (#7658) -* test: ensure we do not forget to test any short_open_tag test (#7638) - -Changelog for v3.46.0 ---------------------- - -* chore: fix internal typehints in Tokens (#7656) -* chore: reduce PHPStan baseline (#7643) -* docs: Show class with unit tests and BC promise info (#7667) -* feat: change default ruleset to `@PER-CS` (only behind PHP_CS_FIXER_FUTURE_MODE=1) (#7650) -* feat: Support new/instanceof/use trait in `fully_qualified_strict_types` (#7653) -* fix: FQCN parse phpdoc using full grammar regex (#7649) -* fix: Handle FQCN properly with `leading_backslash_in_global_namespace` option enabled (#7654) -* fix: PhpdocToParamTypeFixerTest - support for arrow functions (#7647) -* fix: PHP_CS_FIXER_FUTURE_MODE - proper boolean validation (#7651) - -Changelog for v3.45.0 ---------------------- - -* feat: Enable symbol importing in `@PhpCsFixer` ruleset (#7629) -* fix: NoUnneededBracesFixer - improve handling of global namespace (#7639) -* test: run tests with "short_open_tag" enabled (#7637) - -Changelog for v3.44.0 ---------------------- - -* feat: Introduce percentage bar as new default progress output (#7603) - -Changelog for v3.43.1 ---------------------- - -* fix: Import only unique symbols' short names (#7635) - -Changelog for v3.43.0 ---------------------- - -* chore: change base of `@Symfony` set to `@PER-CS2.0` (#7627) -* chore: PHPUnit - allow for v10 (#7606) -* chore: Preg - rework catching the error (#7616) -* chore: Revert unneeded peer-dep-pin and re-gen lock file (#7618) -* docs: drop extra note about 8.0.0 bug in README.md (#7614) -* feat: add cast_spaces into `@PER-CS2.0` (#7625) -* feat: Configurable phpDoc tags for FQCN processing (#7628) -* feat: StatementIndentationFixer - introduce stick_comment_to_next_continuous_control_statement config (#7624) -* feat: UnaryOperatorSpacesFixer - introduce only_dec_inc config (#7626) -* fix: FullyQualifiedStrictTypesFixer - better support annotations in inline {} (#7633) -* fix: Improve how FQCN is handled in phpDoc (#7622) -* fix: phpdoc_align - fix multiline tag alignment issue (#7630) - -Changelog for v3.42.0 ---------------------- - -* chore: aim to not rely on internal array pointer but use array_key_first (#7613) -* chore: deprecate Token::isKeyCaseSensitive (#7599) -* chore: deprecate Token::isKeyCaseSensitive, 2nd part (#7601) -* chore: do not check PHP_VERSION_ID (#7602) -* chore: FileFilterIteratorTest - more accurate type in docs (#7542) -* chore: minor code cleanup (#7607) -* chore: more types (#7598) -* chore: PHPDoc key-value spacing (#7592) -* chore: PHPUnit - run defects first (#7570) -* chore: ProjectCodeTest - DRY on Tokens creation (#7574) -* chore: ProjectCodeTest - prepare for symfony/console v7 (#7605) -* chore: ProjectCodeTest::provide*ClassCases to return iterable with key for better tests execution log (#7572) -* chore: ProjectCodeTest::testDataProvidersDeclaredReturnType - use better DataProvider to simplify test logic (#7573) -* chore: TokensAnalyzer - string-enum for better typehinting (#7571) -* chore: unify tests not agnostic of PHP version (#7581) -* chore: use ::class more (#7545) -* CI: Introduce `composer-unused` (#7536) -* DX: add types to anonymous functions (#7561) -* DX: Allow running smoke tests within Docker runtime (#7608) -* DX: check fixer's options for wording (#7543) -* DX: cleanup deprecation message (#7576) -* DX: do not allow overriding constructor of `PHPUnit\Framework\TestCase` (#7563) -* DX: do not import ExpectDeprecationTrait in UtilsTest (#7562) -* DX: Enforce consistent naming in tests (#7556) -* DX: fix checking test class extends `PhpCsFixer\Tests\TestCase` (#7567) -* DX: make sure that exceptions in `AbstractFixerTestCase::testProperMethodNaming` are not already fixed (#7588) -* DX: remove recursion from AbstractIntegrationTestCase::testIntegration (#7577) -* DX: remove `PhpUnitNamespacedFixerTest::testClassIsFixed` (#7564) -* DX: remove `symfony/phpunit-bridge` (#7578) -* DX: replace fixture classes with anonymous ones (#7533) -* DX: Unify Docker mount points and paths (#7549) -* DX: unify fixer's test method names - quick wins (#7584) -* DX: unify tests for casing fixers (#7558) -* DX: use anonymous function over concrete classes (#7553) -* feat(EXPERIMENTAL): ClassKeywordFixer (#2918) -* feat(EXPERIMENTAL): ClassKeywordFixer, part 2 (#7550) -* feat(PhpdocToCommentFixer): Add option to handle return as valid docblock usage (#7401) (#7402) -* feat: Ability to import FQCNs found during analysis (#7597) -* feat: add phpDoc support for `fully_qualified_strict_types` fixer (#5620) -* feat: Handle deprecated rule sets similarly to deprecated fixers (#7288) -* feat: PhpUnitTestCaseStaticMethodCallsFixer - cover PHPUnit v10 methods (#7604) -* feat: Support more FQCNs cases in `fully_qualified_strict_types` (#7459) -* fix: AbstractFixerTestCase - fix checking for correct casing (#7540) -* fix: Better OS detection in integration tests (#7547) -* fix: NativeTypeDeclarationCasingFixe - handle static property without type (#7589) -* test: AutoReview - unify data provider returns (#7544) -* test: check to have DataProviders code agnostic of PHP version (#7575) - -Changelog for v3.41.1 ---------------------- - -* DX: Change `@testWith` to `@dataProvider` (#7535) -* DX: Introduce Markdownlint (#7534) -* fix: NativeTypeDeclarationCasingFixer - do not crash on `var` keyword (#7538) - -Changelog for v3.41.0 ---------------------- - -* chore: Move `mb_str_functions` PHP 8.3 cases to separate test (#7505) -* chore: Symfony v7 is now stable (#7469) -* CI: drop PHP 8.3 hacks (#7519) -* docs: Improve docs for `no_spaces_after_function_name` (#7520) -* DX: Ability to run Sphinx linter locally (#7481) -* DX: AbstractFixerTest - use anonymous classes (#7527) -* DX: Add progress output for `cs:check` script (#7514) -* DX: align doubles naming (#7525) -* DX: remove AbstractFixerTestCase::getTestFile() (#7495) -* DX: remove jangregor/phpstan-prophecy (#7524) -* DX: remove Prophecy (#7509) -* DX: replace Prophecy with anonymous classes in CacheTest (#7503) -* DX: replace Prophecy with anonymous classes in ProcessLintingResultTest (#7501) -* DX: Utilise auto-discovery for PHPStan formatter (#7490) -* feat: Support `mb_str_pad` function in `mb_str_functions` rule (#7499) -* fix: BinaryOperatorSpacesFixer - do not add whitespace inside short function (#7523) -* fix: Downgrade PDepend to version not supporting Symfony 7 (#7513) -* fix: GlobalNamespaceImportFixer - key in PHPDoc's array shape matching class name (#7522) -* fix: SpacesInsideParenthesesFixer - handle class instantiation parentheses (#7531) -* Update PHPstan to 1.10.48 (#7532) - -Changelog for v3.40.2 ---------------------- - -* docs: fix link to source classes (#7493) - -Changelog for v3.40.1 ---------------------- - -* chore: Delete stray file x (#7473) -* chore: Fix editorconfig (#7478) -* chore: Fix typos (#7474) -* chore: Fix YAML line length (#7476) -* chore: Indent JSON files with 4 spaces (#7480) -* chore: Make YAML workflow git-based (#7477) -* chore: Use stable XDebug (#7489) -* CI: Lint docs (#7479) -* CI: Use PHPStan's native Github error formatter (#7487) -* DX: fix PHPStan error (#7488) -* DX: PsrAutoloadingFixerTest - do not build mock in data provider (#7491) -* DX: PsrAutoloadingFixerTest - merge all data providers into one (#7492) -* DX: Update PHPStan to 1.10.46 (#7486) -* fix: `NoSpacesAfterFunctionNameFixer` - do not remove space if the opening parenthesis part of an expression (#7430) - -Changelog for v3.40.0 ---------------------- - -* chore: officially support PHP 8.3 (#7466) -* chore: update deps (#7471) -* CI: add --no-update while dropping non-compat `facile-it/paraunit` (#7470) -* CI: automate --ignore-platform-req=PHP (#7467) -* CI: bump actions/github-script to v7 (#7468) -* CI: move humbug/box out of dev-tools/composer.json (#7472) - -Changelog for v3.39.1 ---------------------- - -* DX: introduce SwitchAnalyzer (#7456) -* fix: NoExtraBlankLinesFixer - do not remove blank line after `? : throw` (#7457) -* fix: OrderedInterfacesFixer - do not comment out interface (#7464) -* test: Improve `ExplicitIndirectVariableFixerTest` (#7451) - -Changelog for v3.39.0 ---------------------- - -* chore: Add support for Symfony 7 (#7453) -* chore: IntegrationTest - move support of php< requirement to main Integration classes (#7448) -* CI: drop Symfony ^7 incompat exceptions of php-coveralls and cli-executor (#7455) -* CI: early compatibility checks with Symfony 7 (#7431) -* docs: drop list.rst and code behind it (#7436) -* docs: remove Gitter mentions (#7441) -* DX: Ability to run Fixer on PHP8.3 for development (#7449) -* DX: describe command - for rules, list also sets that are including them (#7419) -* DX: Docker clean up (#7450) -* DX: more usage of spaceship operator (#7438) -* DX: Put `Preg`'s last error message in exception message (#7443) -* feat: Introduce `@PHP83Migration` ruleset and PHP 8.3 integration test (#7439) -* test: Improve `AbstractIntegrationTestCase` description (#7452) - -Changelog for v3.38.2 ---------------------- - -* docs: fix 'Could not lex literal_block as "php". Highlighting skipped.' (#7433) -* docs: small unification between FixerDocumentGenerator and ListDocumentGenerator (#7435) -* docs: unify ../ <> ./../ (#7434) - -Changelog for v3.38.1 ---------------------- - -* chore: ListSetsCommand::execute - add missing return type (#7432) -* chore: PHPStan - add counter to dataProvider exception, so we do not increase the tech debt on it (#7425) -* CI: Use `actions/checkout` v4 (#7423) -* fix: ClassAttributesSeparationFixer - handle Disjunctive Normal Form types parentheses (#7428) -* fix: Remove all variable names in `@var` callable signature (#7429) -* fix: Satisfy `composer normalize` (#7424) - -Changelog for v3.38.0 ---------------------- - -* chore: upgrade phpstan (#7421) -* CI: add curl and mbstring to build php (#7409) -* CI: cache dev-tools/bin (#7416) -* CI: Composer - move prefer-stable to file config (#7406) -* CI: conditionally install flex (#7412) -* CI: dev-tools/build.sh - no need to repeat 'prefer-stable', but let's use '--no-scripts' (#7408) -* CI: Do not run post-autoload-dump on Composer install (#7403) -* CI: general restructure (#7407) -* CI: GitHub Actions - use actions/cache for Composer in composite action (#7415) -* CI: Improve QA process - suplement (#7411) -* CI: prevent Infection plugins during build time, as we do not use it (#7422) -* CI: simplify setup-php config (#7404) -* DX: Do not mark as stale issues/PRs with milestone assigned (#7398) -* DX: Improve QA process (#7366) -* feat: phpDoc to property/return/param Fixer - allow fixing mixed on PHP >= 8 (#6356) -* feat: phpDoc to property/return/param Fixer - allow fixing union types on PHP >= 8 (#6359) -* feat: Support for array destructuring in `array_indentation` (#7405) -* feat: `@Symfony` - keep Annotation,NamedArgumentConstructor,Target annotations as single group (#7399) -* fix(SelfAccessorFixer): do not touch references inside lambda and/or arrow function (#7349) -* fix: long_to_shorthand_operator - mark as risky fixer (#7418) -* fix: OrderedImportsFixer - handle non-grouped list of const/function imports (#7397) - -Changelog for v3.37.1 ---------------------- - -* docs: config file - provide better examples (#7396) -* docs: config file - provide better link to Finder docs (#6992) - -Changelog for v3.37.0 ---------------------- - -* feat: add parallel cache support (#7131) - -Changelog for v3.36.0 ---------------------- - -* chore: disable `infection-installer` plugin, as we do not use `infection/*` yet (#7391) -* chore: Run dev-tools on PHP 8.2 (#7389) -* CI: Run Symfony 6 compat check on PHP 8.1 (#7383) -* CI: use fast-linter when calculating code coverage (#7390) -* docs: extend example for nullable_type_declaration (#7381) -* DX: FixerFactoryTest - make assertion failing msg more descriptive (#7387) -* feat: PhpdocSummaryFixer - support lists in description (#7385) -* feat: PSR12 - configure unary_operator_spaces (#7388) -* feat: StatementIndentationFixer - support comment for continuous control statement (#7384) - -Changelog for v3.35.1 ---------------------- - -* fix: Mark `PhpdocReadonlyClassCommentToKeywordFixer` as risky (#7372) - -Changelog for v3.35.0 ---------------------- - -* chore: Autoreview: test all formats are listed in `usage.rst` (#7357) -* chore: no need for `phpunitgoodpractices/traits` anymore (#7362) -* chore: Rename `indexes` to `indices` (#7368) -* chore: stop using `phpunitgoodpractices/traits` (#7363) -* chore: typo (#7367) -* docs: Sort options in documentation (#7345) -* feat(PhpdocReadonlyClassCommentToKeywordFixer): Introduction (#7353) -* feat: Ability to keep/enforce leading `\` when in global namespace (#7186) -* feat: Update `@PER-CS2.0` to match short closure space (#6970) -* feat: use `ordered_types` in `@PhpCsFixer` (#7361) -* fix(SingleLineThrowFixer): fixer goes out of range on close tag (#7369) - -Changelog for v3.34.1 ---------------------- - -* deps: revert "prevent using PHPCSFixer along with unfinalize package (#7343)" (#7348) - -Changelog for v3.34.0 ---------------------- - -* feat: Introduce `check` command (alias for `fix --dry-run`) (#7322) - -Changelog for v3.33.0 ---------------------- - -* feat: Introduce `native_type_declaration_casing` fixer (#7330) - -Changelog for v3.32.0 ---------------------- - -* deps: Prevent using PHPCSFixer along with `unfinalize` package (#7343) -* feat: Deprecate `CompactNullableTypehintFixer` and proxy to `CompactNullableTypeDeclarationFixer` (#7339) -* feat: Deprecate `CurlyBracesPositionFixer` and proxy to `BracesPositionFixer` (#7334) -* feat: Deprecate `NewWithBracesFixer` and proxy to `NewWithParenthesesFixer` (#7331) -* feat: Deprecate `NoUnneededCurlyBracesFixer` and proxy to `NoUnneededBracesFixer` (#7335) -* feat: Rename `CurlyBraceTransformer` to `BraceTransformer` (#7333) - -Changelog for v3.31.0 ---------------------- - -* chore: Use type declaration instead of type hint (#7338) -* feat: Introduce `attribute_placement` option for `MethodArgumentSpaceFixer` (#7320) -* fix: Adjust wording related to deprecations (#7332) -* fix: Correct deprecation header in rules' docs (#7337) -* fix: Replace mention of bracket with parenthesis (#7336) -* fix: `FunctionToConstantFixer` should run before `NativeConstantInvocationFixer` (#7344) - -Changelog for v3.30.0 ---------------------- - -* feat: Introduce `AttributeEmptyParenthesesFixer` (#7284) -* fix(method_argument_space): inject new line after trailing space on current line (#7327) -* fix(`YodaStyleFixer`): do not touch `require(_once)`, `include(_once)` and `yield from` statements (#7325) -* fix: illegal offset type on file-wide return in `ReturnToYieldFromFixer` (#7318) - -Changelog for v3.29.0 ---------------------- - -* chore: fix TODO tasks about T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG support (#7316) -* feat(`@PhpCsFixer:risky`): use newest `@PER-CS:risky` instead of locked `@PER-CS2.0:risky` (#7323) -* feat: Introduce `@PER-CS` ruleset (#7321) -* fix: priority issue between array_syntax and space after rules (#7324) - -Changelog for v3.28.0 ---------------------- - -* chore(prlint): allow for 'deps' type (#7304) -* CI(prlint): allow for special chars in parentheses (#7308) -* deps(dev-tools): update dev-tools (#7309) -* DX: Bump XDebug version in Docker services (#7300) -* feat(`@PER-CS2.0`): Add `concat_space` to the ruleset (#7302) - -Changelog for v3.27.0 ---------------------- - -* docs: cleanup old mention of `--show-progress=estimating` in docs (#7287) -* DX: add Composer script for applying CS fixes in parallel (#7274) -* feat: Clone PER-CS1.0 to PER-CS2.0 to prepare for adding new rules (#7249) -* feat: Introduce `LongToShorthandOperatorFixer` (#7295) -* feat: Mark PER-CS v1 as deprecated (#7283) -* feat: Move `single_line_empty_body` to `@PER-CS2.0` (#7282) -* fix: Priorities for fixers related to curly braces, empty lines and trailing whitespace (#7296) -* fix: `OrderedTraitsFixer` - better support for multiple traits in one `use` statement (#7289) - -Changelog for v3.26.1 ---------------------- - -* fix: Handle superfluous asterisk in `no_superfluous_phpdoc_tags` (#7279) - -Changelog for v3.26.0 ---------------------- - -* chore(checkbashisms): update to 2.23.6 (#7276) -* chore(phpstan): reduce baseline (#7275) -* feat: Add `single_line_empty_body` to `@PhpCsFixer` (#7266) -* fix(YieldFromArrayToYieldsFixer): mark as Risky (#7272) -* fix(YieldFromArrayToYieldsFixer): skip touching empty array (#7273) -* test: Introduce common way of creating fake Composer project in `InstallViaComposerTest` (#7265) - -Changelog for v3.25.1 ---------------------- - -* fix: PhpdocTypesFixer - do not crash for type followed by braces/brackets/chevrons/parentheses (#7268) - -Changelog for v3.25.0 ---------------------- - -* feat: Remove Doctrine dependencies (#7263) - -Changelog for v3.24.0 ---------------------- - -* chore: apply CS (#7240) -* chore: apply static_lambda rule (#7239) -* chore: Improve template for creating new issue (#7255) -* CI: Conventional Commits support in PRLint config (#7037) -* CI: Remove Travis leftovers (#7259) -* docs: Add information about installing Fixer as dev dependency (#7129) -* docs: document composer script aliases (#7230) -* DX: Add script for running Composer Require Checker (#7252) -* DX: composer script aliases - ensure templated description (#7235) -* DX: composer-script - count PHPMD as static-analysis (#7231) -* DX: do not allow version specific code sample with minimum PHP version lower than the lowest supported one (#7207) -* DX: ensure version specific code samples are suitable for at least 1 supported PHP version (#7212) -* DX: Improve contributing guide (#7241) -* DX: More descriptive stale messages (#7236) -* feat(@PhpCsFixer:risky): add static_lambda rule (#7237) -* feat: Add literal separator support for `integer_literal_case` (#7081) -* feat: Configurable case sensitivity for more ordering fixers (#7021) -* feat: Support for attributes in `method_argument_space` (#7242) -* fix: import detection for attributes at `NoUnusedImportsFixer` (#7246) -* fix: `no_superfluous_phpdoc_tags` with `null` phpdoc (#7234) -* fix: `phpdoc_types` must not lowercase literal types (#7108) -* test: Add static methods from PHPUnit 9.6.11 (#7243) - -Changelog for v3.23.0 ---------------------- - -* bug: BlankLineBeforeStatementFixer - do not enforce/add a blank line when there is a blank line between the comment and the statement already (#7190) -* bug: Fix detecting classy invocation in catch (#7191) -* bug: Fix names resolving in `no_superfluous_phpdoc_tags` fixer (#7189) -* bug: Fix various bugs in `FullyQualifiedStrictTypesFixer` fixer (#7188) -* bug: Fixed line between general script documentation and require (#7177) -* bug: Support annotations with arguments in `FinalInternalClassFixer` (#7160) -* bug: YieldFromArrayToYieldsFixer - fix for `yield from` after `}` (#7169) -* bug: YieldFromArrayToYieldsFixer - fix handling the comment before the first array element (#7193) -* bug: `HeaderCommentFixer` must run before `BlankLinesBeforeNamespaceFixer` (#7205) -* bug: `NoUselessReturnFixer` must run before `SingleLineEmptyBodyFixer` (#7226) -* bug: `PhpdocInlineTagNormalizerFixer` - do not break tags (#7227) -* docs: Add allowed values of tags in the `phpdoc_align` (#7120) -* docs: Add extra information for GitLab reporter's integration with GitLab Code Quality (#7172) -* docs: Change the single backticks to double in description of the rules option (#7173) -* docs: Condensed output for rule sets' list that fixer is included in (#7182) -* docs: Improve contributing guide (#7204) -* docs: `MethodArgumentSpaceFixer` - mention PSR in Fixer definition (#7157) -* DX: add first auto-review tests for composer.json file (#7210) -* DX: add `YieldFromArrayToYieldsFixer` to `PhpCsFixer` set (#7115) -* DX: Allow OS conditions for integration tests (#7161) -* DX: Apply current CS rules (#7178) -* DX: Apply suggestions from PR 7210 (#7213) -* DX: apply `ReturnToYieldFromFixer` (#7181) -* DX: Do not mark "long term ideas" as stale (#7206) -* DX: enable `HeredocIndentationFixer` for the codebase (#7195) -* DX: enable `UseArrowFunctionsFixer` for the codebase (#7194) -* DX: few phpstan fixes (#7208) -* DX: fix contravariant types in PHPDocs (#7167) -* DX: Fix detecting trailing spaces (#7216) -* DX: Fix some PHPStan issues (#7180) -* DX: Get rid of deprecation warnings in Mess Detector (#7215) -* DX: Improve Composer scripts (#7214) -* DX: Improve Mess Detector Integration (#7224) -* DX: Introduce Composer scripts as common DX (#6839) -* DX: refactor `ErrorOutputTest` (#7183) -* DX: remove unnecessary arrays from data providers (#7170) -* DX: update `CurlyBracesPositionFixer` code samples (#7198) -* DX: update `HeredocIndentationFixer` code samples (#7197) -* DX: update `PhpdocToReturnTypeFixer` code samples (#7199) -* feature: add at least one space around binary operators (#7175) -* feature: BlankLineBeforeStatementFixer - take into account comment before statement (#7166) -* feature: Introduce `ReturnToYieldFromFixer` (#7168) -* feature: Introduce `SpacesInsideParenthesesFixer` (#5709) -* feature: Support array destructuring in `trim_array_spaces` (#7218) -* feature: `BlankLineBeforeStatementFixer` - skip enum cases (#7203) -* minor: more arrow function usage (#7223) -* minor: PhpdocAlignFixerTest - convert CUSTOM tags test to not rely on non-custom tag from TAGS_WITH_NAME (#7209) -* minor: use JSON_THROW_ON_ERROR for trivial cases (#7221) -* minor: use more spread operator (#7222) - -Changelog for v3.22.0 ---------------------- - -* DX: add proper test for `SelfAccessorFixer` must run before `SelfAccessorFixer` (#7153) -* DX: FixerFactoryTest - apply CS (#7154) -* feature: Introduce `PhpUnitDataProviderReturnTypeFixer` (#7156) -* feature: Introduce `YieldFromArrayToYieldsFixer` (#7114) - -Changelog for v3.21.3 ---------------------- - -* Revert "DX: encourage to provide wider description" (#7155) - -Changelog for v3.21.2 ---------------------- - -* docs: check format of FixerDefinition::getDescription() (#7127) -* DX: add phpstan/phpstan-strict-rules (#7143) -* DX: allow for progressive cache (#7132) -* DX: Copy-pasteable `class::getPriority` for phpDoc diffs (#7148) -* DX: do not allow linebreak at the beginning of code sample (#7126) -* DX: encourage to provide wider description (#7128) -* DX: fix function calls (#7136) -* DX: fix PHPDoc types issues (#7135) -* DX: improve `Tokens` checking for found tokens (#7139) -* DX: Make `AbstractFixerTestCase::getTestFile()` final (#7116) -* DX: make `array_search` call strict (#7145) -* DX: remove `empty` calls (#7138) -* DX: store cache to file only if content will get modified (#7151) -* DX: unify Preg:match in logical conditions (#7146) -* DX: use booleans in conditions (#7149) -* DX: Use ParaUnit to speed up tests (#6883) -* DX: Use relative fixture path as integration test case's name (#7147) -* DX: use strict assertions (#7144) -* DX: `AbstractIntegrationTestCase::provideIntegrationCases` - yield over array, better typehinting (#7150) - -Changelog for v3.21.1 ---------------------- - -experimental release - -* Require PHP ^8.0.1 - -Changelog for v3.21.0 ---------------------- - -* bug: Fix and enhance Gitlab reporter (#7089) -* bug: Import with different case must not be removed by non-risky fixer (#7095) -* bug: ordered imports fixer top group only (#7023) -* bug: `FinalPublicMethodForAbstractClassFixer` - fix for readonly classes (#7123) -* DX: do not nest ".editorconfig" files (#7112) -* DX: exclude Dockerfile from dist (#7113) -* DX: fix checkbashisms installation (#7102) -* DX: fix Smoke tests for various git default branch name (#7119) -* DX: Fix `FileRemovalTest` (do not fail when running it standalone) (#7104) -* DX: Progress output refactor (#6848) -* DX: Rename abstract test classes to `*TestCase` convention (#7100) -* DX: test all PHPUnit migration sets (#7107) -* DX: [Docker] Distinguish Alpine version between PHP versions (#7105) -* feature: Create cache path if it does not exist (#7109) -* feature: Introduce `NullableTypeDeclarationFixer` (#7002) -* feature: Introduce `TypeDeclarationSpacesFixer` (#7001) -* feature: `BlankLineBetweenImportGroupsFixer` - keep indent (#7122) -* minor: Parse callable using full phpdoc grammar (#7094) -* minor: PHP8.3 const type tokenizing (#7055) - -Changelog for v3.20.0 ---------------------- - -* DX: fix priority of `FinalClassFixer` (#7091) -* DX: use FAST_LINT_TEST_CASES=1 for CI run on macOS (#7092) -* feature: SingleLineEmptyBodyFixer - support interfaces, traits and enums (#7096) -* feature: `NullableTypeDeclarationForDefaultNullValue` - support for nullability in union types (#5819) - -Changelog for v3.19.2 ---------------------- - -* bug: NoMultipleStatementsPerLineFixer must run before CurlyBracesPositionFixer (#7087) -* bug: PhpdocAddMissingParamAnnotationFixer - fix for promoted properties (#7090) -* DX: fix priority of SingleBlankLineBeforeNamespaceFixer (#7088) -* minor: Parse all phpdoc types using full grammar (#7010) - -Changelog for v3.19.1 ---------------------- - -* bug: CurlyBracesPositionFixer must run before StatementIndentationFixer (#7085) - -Changelog for v3.19.0 ---------------------- - -* bug: SelfAccessorFixer - fix for union types (#7080) -* DX: add `php_unit_data_provider_name` to `@PhpCsFixer:risky` set (#7069) -* DX: make data providers return type "iterable" (#7072) -* DX: rename tests and data providers (#7070) -* feature: Introduce `PhpUnitDataProviderNameFixer` (#7057) - -Changelog for v3.18.0 ---------------------- - -* bug: Fix tokenizing of type hints (#7054) -* bug: CompactNullableTypehintFixer - fix for whitespace between `?` and `static` (#6993) -* bug: consider function modifiers for `statement_indentation` (#6978) -* bug: Exclude `$this` from `TernaryToNullCoalescingFixer` (#7052) -* bug: False positive on used imports when docblock includes it with mismatching case (#6909) -* bug: Fix chained calls semicolon indent in switch case (#7045) -* bug: Fix multiline_whitespace_before_semicolons for echo tags (#7019) -* bug: Fix phpDoc align when there is inconsistent spacing after comment star (#7012) -* bug: Fix phpDoc parsing without PCRE JIT (#7031) -* bug: Fix PhpdocVarWithoutNameFixer with Closure with $this (#6979) -* bug: Fix `return_assignment` not formatting when variables are used in `catch` and `finally` (#6960) -* bug: Fix `TypeExpression::allowsNull()` with nullable (#7000) -* bug: Improve definition of conflicting fixers (#7066) -* bug: LambdaNotUsedImportFixer - fix for anonymous class with a string argument (#6972) -* bug: ListFilesCommand - fix computing of relative path (#7028) -* bug: make `php_unit_namespaced` less greedy (#6952) -* bug: PhpdocToCommentFixer - fix for PHPDoc before fn (#6973) -* bug: Restructure PER-CS rule sets (#6707) -* bug: SelfStaticAccessor - fix static access inside enums (#7024) -* bug: SingleSpaceAroundConstructFixer - fix more cases involving `static` (#6995) -* bug: `FullyQualifiedStrictTypesFixer` - fix shortening when namespace is not empty and import exists (#7027) -* bug: `NoUnneededControlParenthesesFixer` PHP8.0 null-safe operator (#7056) -* bug: `PhpdocToCommentFixer` support for enum cases (#7040) -* DX: add more tests to CommentsAnalyzer (#7041) -* DX: Cleanup duplicate files in finder (#7042) -* DX: ControlCaseStructuresAnalyzerTest - cleanup (#6874) -* DX: Fix warning when running test on PHP<8 (#7008) -* DX: handle `@` in PR title (#6982) -* DX: officially deprecate internal Utils anti-pattern class (#7039) -* DX: Remove Fabbot.io conditional configuration (#7038) -* DX: rename data providers (#7058) -* DX: Use `actions/stale` to handle stale issues and pull requests (#5085) -* DX: Use `Utils::naturalLanguageJoin()` in implode calls (#7032) -* feature: Add support for custom method placement in `ordered_class_elements` (#6360) -* feature: Allow case sensitive order for OrderedClassElementsFixer (#7020) -* feature: PHP8.3 - Add CT and block type for `Dynamic class constant fetch` (#7004) -* feature: Support attributes in `FinalClassFixer` (#6893) -* minor: "Callback" must not be fixed to "callback" by default (#7011) -* minor: Add `Util::naturalLanguageJoin()` (#7022) -* minor: ClassDefinitionFixer - handle attributes and `readonly` in anonymous class definitions (#7014) -* minor: FixerFactory::getFixersConflicts - better type hinting (#7044) -* minor: PHP8.3 - Fix TokensAnalyzer::isAnonymousClass support for `readonly` (#7013) -* minor: PHP8.3 - Typed class constants - handle nullable by transformer (#7009) -* minor: Reduce phpDoc type parser complexity from O(n^2) to O(nlog(n)) (#6988) -* minor: ReturnAssignmentFixer - Better handling of anonymous classes (#7015) -* minor: Transfer `HelpCommand::toString()` to `Utils` (#7034) -* minor: Unify "blank lines before namespace" fixers (#7053) -* minor: `SelfStaticAccessorFixer` improvements for enums (#7026) -* minor: `SingleSpaceAroundConstructFixer` - support space before `as` (#7029) -* minor: `UseArrowFunctionsFixer` - run before `FunctionDeclarationFixer` (#7065) - -Changelog for v3.17.0 ---------------------- - -* bug: Allow string quote to be escaped within phpdoc constant (#6798) -* bug: ConfigurationResolver - fix running without cache (#6915) -* bug: Fix array/object shape phpdoc type parse (#6962) -* bug: Fix FullyQualifiedStrictTypesFixer common prefix bug (#6898) -* bug: Fix non-parenthesized callable return type parse (#6961) -* bug: Fix parsing of edge cases phpdoc types (#6977) -* bug: FullyQualifiedStrictTypesFixer - fix for FQCN type with class with the same name being imported (#6923) -* bug: GroupImportFixer - support for aliased imports (#6951) -* bug: MultilineWhitespaceBeforeSemicolonsFixer - fix chained calls (#6926) -* bug: MultilineWhitespaceBeforeSemicolonsFixer - fix for discovering multi line calls (#6938) -* bug: NoBreakCommentFixer - fix for nested match (#6899) -* bug: NoExtraBlankLinesFixer - fix for attribute in abstract function (#6920) -* bug: PhpdocTypesFixer - handle types with no space between type and variable (#6922) -* bug: PhpUnitMockShortWillReturnFixer - fix for trailing commas (#6900) -* bug: StatementIndentationFixer - fix comments at the end of if/elseif/else blocks (#6918) -* bug: StatementIndentationFixer - fix for multiline arguments starting with "new" keyword (#6913) -* bug: StatementIndentationFixer - fix for multiline arguments starting with "new" keyword preceded by class instantiation (#6914) -* bug: VoidReturnFixer - fix for intervening attributes (#6863) -* docs: improve code samples for MultilineWhitespaceBeforeSemicolonsFixer (#6919) -* docs: improve cookbook (#6880) -* DX: add cache related tests (#6916) -* DX: Apply `self_static_accessor` fixer to the project (again) (#6927) -* DX: cancel running builds on subsequent pushes in CI (#6940) -* DX: convert more `static` to `self` assert calls (#6931) -* DX: fix GitHub Actions errors and warnings (#6917) -* DX: fix Unsafe call to private method errors reported by PHPStan (#6879) -* DX: Improve performance of FunctionsAnalyzer (#6939) -* DX: improve test method names to avoid confusion (#6974) -* DX: Include self_static_accessor fixer in PhpCsFixer set (#6882) -* DX: make data providers static with straight-forward changes (#6907) -* DX: Mark Tokens::getNamespaceDeclarations as @internal (#6949) -* DX: PHPStan improvements (#6868) -* DX: refactor PhpdocAlignFixerTest (#6925) -* DX: Remove @inheritdoc PHPDoc (#6955) -* DX: Run AutoReview tests only once (#6889) -* DX: simplify EncodingFixer (#6956) -* DX: update Symfony rule set (#6958) -* DX: Use $tokens->getNamespaceDeclarations() to improve performance (#6942) -* DX: use force option for php_unit_data_provider_static in PHPUnit 10.0 migration set (#6908) -* DX: use only PHP modules that are required (#6954) -* DX: use PHPUnit's "requires" instead of "if" condition (#6975) -* feature: Add align_multiline_comment rule to @Symfony (#6875) -* feature: Add no_null_property_initialization rule to @Symfony (#6876) -* feature: Add operator_linebreak rule to @Symfony (#6877) -* feature: add SingleLineEmptyBodyFixer (#6933) -* feature: DescribeCommand - allow describing custom fixers (#6957) -* feature: Introduce `OrderedTypesFixer` (#6571) -* feature: Order of PHPDoc @param annotations (#3909) -* feature: Parse parenthesized & conditional phpdoc type (#6796) -* feature: PhpUnitInternalClassFixer - add empty line before PHPDoc (#6924) -* feature: [PhpdocAlignFixer] Add support for every tag (#6564) -* minor: align NoSuperfluousPhpdocTagsFixer with actual Symfony configuration (#6953) -* minor: do not add empty line in PHPDoc when adding annotation in PHPUnit class (#6928) -* minor: PhpdocAlignFixer - support cases with type and variable separated with no space (#6921) -* minor: PhpdocSeparationFixer - add integration tests (#6929) -* minor: update PHPStan (to fix CI on master branch) (#6901) -* minor: Use single Dockerfile with multiple build targets (#6840) - -Changelog for v3.16.0 ---------------------- - -* bug: ControlStructureBracesFixer - handle closing tag (#6873) -* bug: CurlyBracesPositionFixer - fix for callable return type (#6855) -* bug: CurlyBracesPositionFixer - fix for DNF types (#6859) -* bug: Fix MultilineWhitespaceBeforeSemicolonsFixer (#5126) -* docs: Fix rule description (#6844) -* DX: fix checkbashisms installation (#6843) -* DX: make data providers static for fixer's tests (#6860) -* DX: refactor PHPUnit fixers adding class-level annotation to use shared code (#6756) -* DX: unify option's descriptions (#6856) -* feature: AbstractPhpUnitFixer - support attribute detection in docblock insertion (#6858) -* feature: add "force" option to PhpUnitDataProviderStaticFixer (#6757) -* feature: introduce single_space_around_construct, deprecate single_space_after_construct (#6857) -* feature: PhpUnitTestClassRequiresCoversFixer - support single-line PHPDocs (#6847) -* minor: Deprecate BracesFixer (#4885) -* minor: Fix autocompletion for `Tokens::offsetGet()` (#6838) -* minor: PHP8.2 Docker runtime (#6833) -* minor: Use Composer binary-only images instead of installer script (#6834) - -Changelog for v3.15.1 ---------------------- - -* bug: BinaryOperatorSpacesFixer - fix for static in type (#6835) -* bug: BinaryOperatorSpacesFixer - fix parameters with union types passed by reference (#6826) -* bug: NoUnusedImportsFixer - fix for splat operator (#6836) -* DX: fix CI (#6837) -* feature: Support for type casing in arrow functions (#6831) -* minor: fix CI on PHP 8.3 (#6827) - -Changelog for v3.15.0 ---------------------- - -* bug: VisibilityRequiredFixer - handle DNF types (#6806) -* DX: officially enable 8.2 support (#6825) - -Changelog for v3.14.5 ---------------------- - -* bug: EmptyLoopBodyFixer must keep comments inside (#6800) -* bug: FunctionsAnalyzer - fix detecting global function (#6792) -* bug: NativeFunctionTypeDeclarationCasingFixer - do not require T_STRING present in code (#6812) -* bug: PhpdocTypesFixer - do not change case of array keys (#6810) -* bug: PhpUnitTestAnnotationFixer - do not break single line @depends (#6824) -* docs: Add supported PHP versions section to the README (#6768) -* docs: drop Atom from readme, due to it's sunsetting (#6778) -* DX: Add composer keywords (#6781) -* DX: update PHPStan to 1.10.3 (#6805) -* feature: [PHP8.2] Support for readonly classes (#6745) -* minor: add custom tokens for Disjunctive Normal Form types parentheses (#6823) -* minor: PHP8.2 - handle union and intersection types for DNF types (#6804) -* minor: PHP8.2 - support property in const expressions (#6803) - -Changelog for v3.14.4 ---------------------- - -* bug: CurlyBracesPositionFixer - fix for open brace not preceded by space and followed by a comment (#6776) -* docs: drop license end year (#6767) -* DX: use numeric_literal_separator (#6766) -* feature: Allow installation of `sebastian/diff:^5.0.0` (#6771) - -Changelog for v3.14.3 ---------------------- - -* DX: Drop doctrine/annotations 1, allow doctrine/lexer 3 (#6730) - -Changelog for v3.14.2 ---------------------- - -* DX: Drop support for doctrine/lexer 1 (#6729) - -Changelog for v3.14.1 ---------------------- - -* DX: Allow doctrine/annotations 2 (#6721) - -Changelog for v3.14.0 ---------------------- - -* bug: Fix indentation for comment at end of function followed by a comma (#6542) -* bug: Fix PHPDoc alignment fixer containing callbacks using `\Closure` (#6746) -* bug: Fix type error when using paths intersection mode (#6734) -* bug: PhpdocSeparationFixer - Make groups handling more flexible (#6668) -* docs: make bug_report.md template more explicit (#6736) -* docs: PhpUnitTestCaseIndicator - fix docs (#6727) -* DX: apply CS (#6759) -* DX: bump doctrine/annotations to prevent installing version with unintentional BC break (#6739) -* DX: update deps (#6760) -* DX: upgrade dev-tools/composer.json (#6737) -* DX: upgrade PHPStan to 1.9.7 (#6741) -* feature: Add php 7.4 types to Cookbook docs (#6763) -* feature: add PhpUnitDataProviderStaticFixer (#6702) -* feature: binary_operator_spaces - Revert change about => alignment and use option instead (#6724) -* feature: make OrderedInterfacesFixer non-risky (#6722) -* feature: OctalNotationFixer - support _ notation (#6762) -* fix: enum case "PARENT" must not be renamed (#6732) -* minor: Follow PSR12 ordered imports in Symfony ruleset (#6712) -* minor: improve rule sets order (#6738) - -Changelog for v3.13.2 ---------------------- - -* bug: Fix type error when using paths intersection mode (#6734) - -Changelog for v3.13.1 ---------------------- - -* bug: Align all the arrows inside the same array (#6590) -* bug: Fix priority between `modernize_types_casting` and `no_unneeded_control_parentheses` (#6687) -* bug: TrailingCommaInMultilineFixer - do not add trailing comma when there is no break line after last element (#6677) -* docs: Fix docs for disabled rules in rulesets (#6679) -* docs: fix the cookbook_fixers.rst (#6672) -* docs: Update installation recommended commands for `mkdir` argument (`-p` insteadof `--parents`). (#6689) -* Make static data providers that are not using dynamic calls (#6696) -* minor: displaying number of checked files (#6674) - -Changelog for v3.13.0 ---------------------- - -* bug: BracesFixer - Fix unexpected extra blank line (#6667) -* bug: fix CI on master branch (#6663) -* bug: IsNullFixer - handle casting (#6661) -* docs: feature or bug (#6652) -* docs: Use case insensitive sorting for options (#6666) -* docs: [DateTimeCreateFromFormatCallFixer] Fix typos in the code sample (#6671) -* DX: update cli-executor (#6664) -* DX: update dev-tools (#6665) -* feature: Add global_namespace_import to @Symfony ruleset (#6662) -* feature: Add separate option for closure_fn_spacing (#6658) -* feature: general_phpdoc_annotation_remove - allow add case_sensitive option (#6660) -* minor: AllowedValueSubset - possible values are sorted (#6651) -* minor: Use md5 for file hashing to reduce possible collisions (#6597) - -Changelog for v3.12.0 ---------------------- - -* bug: SingleLineThrowFixer - Handle throw expression inside block (#6653) -* DX: create TODO to change default ruleset for v4 (#6601) -* DX: Fix SCA findings (#6626) -* DX: HelpCommand - fix docblock (#6584) -* DX: Narrow some docblock types (#6581) -* DX: Remove redundant check for PHP <5.2.7 (#6620) -* DX: Restore PHPDoc to type rules workflow step (#6615) -* DX: SCA - scope down types (#6630) -* DX: Specify value type in iterables in tests (#6594) -* DX: Test on PHP 8.2 (#6558) -* DX: Update GitHub Actions (#6606) -* DX: Update PHPStan (#6616) -* feature: Add `@PHP82Migration` ruleset (#6621) -* feature: ArrayPushFixer now fix short arrays (#6639) -* feature: NoSuperfluousPhpdocTagsFixer - support untyped and empty annotations in phpdoc (#5792) -* feature: NoUselessConcatOperatorFixer - Introduction (#6447) -* feature: Support for constants in traits (#6607) -* feature: [PHP8.2] Support for new standalone types (`null`, `true`, `false`) (#6623) -* minor: GitHub Workflows security hardening (#6644) -* minor: prevent BC break in ErrorOutput (#6633) -* minor: prevent BC break in Runner (#6634) -* minor: Revert "minor: prevent BC break in Runner" (#6637) -* minor: Update dev tools (#6554) - -Changelog for v3.11.0 ---------------------- - -* bug: DateTimeCreateFromFormatCallFixer - Mark as risky (#6575) -* bug: Do not treat implements list comma as array comma (#6595) -* bug: Fix MethodChainingIndentationFixer with arrow functions and class instantiation (#5587) -* bug: MethodChainingIndentationFixer - Fix bug with attribute access (#6573) -* bug: NoMultilineWhitespaceAroundDoubleArrowFixer - fix for single line comment (#6589) -* bug: TypeAlternationTransformer - TypeIntersectionTransformer - Bug: handle attributes (#6579) -* bug: [BinaryOperatorFixer] Fix more issues with scoped operators (#6559) -* docs: Remove `$` from console command snippets (#6600) -* docs: Remove `$` from console command snippets in documentation (#6599) -* DX: AllowedValueSubset::getAllowedValues - fix method prototype (#6585) -* DX: Narrow docblock types in FixerConfiguration (#6580) -* DX: updagte @PhpCsFixer set config for phpdoc_order rule (#6555) -* DX: Update PHPUnit config (#6566) -* feature: Introduce configurability to PhpdocSeparationFixer (#6501) -* feature: Introduce PER set (#6545) -* feature: NoTrailingCommaInSinglelineFixer - Introduction (#6529) -* feature: Support removing superfluous PHPDocs involving `self` (#6583) -* minor: NoUnneededControlParenthesesFixer - Support instanceof static cases (#6587) -* minor: PhpdocToCommentFixer - allow phpdoc comments before trait use statement. Fixes #6092 (#6565) - -Changelog for v3.10.0 ---------------------- - -* bug: Fix error in `regular_callable_call` with static property (#6539) -* bug: Fix indentation for multiline class definition (#6540) -* bug: Fix indentation for switch ending with empty case (#6538) -* bug: Fix indentation of comment at end of switch case (#6493) -* bug: PhpdocAlignFixer - fix static `@method` (#6366) -* bug: SingleSpaceAfterConstructFixer - fix handling open tag (#6549) -* bug: VisibilityRequiredFixer must run before ClassAttributesSeparationFixer (#6548) -* DX: Assert dataproviders of tests of project itself return "array" or "iterable". (#6524) -* feature: Introduce configurability to PhpdocOrderFixer (#6466) -* feature: WhitespaceAfterCommaInArrayFixer - add option "ensure_single_space" (#6527) -* minor: Add test for indentation of trait conflict resolution (#6541) -* minor: Split BracesFixer (#4884) -* minor: TrailingCommaInMultilineFixer - Add comma to multiline `new static` (#6380) - -Changelog for v3.9.6 --------------------- - -* bug: BinaryOperatorSpacesFixer: Solve issues with scoped arrow and equal alignments (#6515) -* bug: Fix 3 weird behavior about BinaryOperatorSpacesFixer (#6450) -* docs: Add intersection type to types_spaces rule description (#6479) -* DX: no need to use forked diff anymore (#6526) -* DX: remove unused FixerFileProcessedEvent::STATUS_UNKNOWN (#6516) -* Improve `statement_indentation` compatibility with `braces` (#6401) -* minor: add test: multi-line comments before else indented correctly. (#3573) -* minor: ReturnAssignmentFixer - Support for anonymous classes, lambda and match (#6391) - -Changelog for v3.9.5 --------------------- - -* bug: AlternativeSyntaxAnalyzer - fix for nested else (#6495) -* bug: Fix cases related to binary strings (#6432) -* bug: Fix trailing whitespace after moving brace (#6489) -* bug: NoUnneededControlParenthesesFixer - Fix some curly close cases (#6502) -* bug: TypeColonTransformer - fix for backed enum types (#6494) -* DX: Add tests for type colon in backed enums (#6497) -* DX: Fix CI static analysis workflow (#6506) -* DX: Fix PHPStan errors (#6504) -* DX: Increase PHPStan level to 6 (#6468) -* DX: Narrow docblock types in Runner and Report (#6465) -* DX: Narrow docblock types in Tokenizer (#6293) -* minor: extract NoMultipleStatementsPerLineFixer from BracesFixer (#6458) -* minor: Let PhpdocLineSpan fixer detect docblocks when separator from token with attribute (#6343) - -Changelog for v3.9.4 --------------------- - -* bug: Fix various indentation issues (#6480) -* bug: Fix wrong brace position after static return type (#6485) -* bug: Prevent breaking functions returning by reference (#6487) - -Changelog for v3.9.3 --------------------- - -* bug: Fix BinaryOperatorSpacesFixer adding whitespace outside PHP blocks (#6476) -* bug: Fix brace location after multiline function signature (#6475) - -Changelog for v3.9.2 --------------------- - -* bug: Fix indentation after control structure in switch (#6473) - -Changelog for v3.9.1 --------------------- - -* bug: Add attributes support to `statement_indentation` (#6429) -* bug: BinaryOperatorSpacesFixer - Allow to align `=` inside array definitions (#6444) -* bug: BinaryOperatorSpacesFixer - Fix align of operator with function declaration (#6445) -* bug: ConstantCaseFixer - Do not touch enum case (#6367) -* bug: CurlyBracesPositionFixer - multiple elseifs (#6459) -* bug: Fix #6439 issue in `StaticLambda` fixer (#6440) -* bug: FullOpeningTagFixer - fix substr check for pre PHP8 (#6388) -* bug: IncrementStyleFixer - NoSpacesInsideParenthesisFixer - prio (#6416) -* bug: LambdaNotUsedImportFixer must run before MethodArgumentSpaceFixer (#6453) -* bug: MethodArgumentSpaceFixer - first element in same line, space before comma and inconsistent indent (#6438) -* bug: NoSuperfluousPhpdocTagsFixer - fix for promoted properties (#6403) -* bug: StatementIndentationFixer - Fix indentation for multiline traits use (#6402) -* bug: StrictComparisonFixer must rune before ModernizeStrposFixer (#6455) -* bug: TokensAnalyzer - fix intersection types considered as binary operator (#6414) -* DX: `ISSUE_TEMPLATE` hints to check applied rules (#6398) -* DX: Add more type hints (#6383) -* DX: Fix CI/CD issues (#6411) -* DX: cleanup test (#6410) -* DX: integrate PRLint (#6406) -* feature: BlankLineBetweenImportGroupsFixer - Introduction (#6365) -* feature: DateTimeCreateFromFormatCallFixer - Add DateTimeImmutable support (#6350) -* feature: Extract StatementIndentationFixer from BracesFixer (#5960) -* feature: ModernizeStrposFixer - fix leading backslash with yoda (#6377) -* feature: NoExtraBlankLinesFixer - Add `attributes` option - Fix support for `enum` `case` (#6426) -* feature: NoUnneededControlParenthesesFixer - Fix more cases (#6409) -* feature: NoUselessNullsafeOperatorFixer - Introduction (#6425) -* feature: OrderedTrait - Move Phpdoc with trait import (#6361) -* feature: PhpdocOrderByValueFixer - Allow sorting of mixin annotations by value (#6446) -* feature: TrailingCommaInMultiline - Add `match` support (#6381) -* minor: Allow Composer Normalize plugin (#6454) -* minor: ExplicitStringVariableFixer - Fix to PHP8.2 compat code (#6424) -* minor: Extract ControlStructureBracesFixer from BracesFixer (#6399) -* minor: NoBinaryStringFixer - Fix more cases (#6442) -* minor: NoSuperfluousPhpdocTagsFixer - Attribute handling (#6382) -* minor: PhpCsFixerSet - Update blank_line_before_statement config (#6389) -* minor: Remove unnecessary PHP version constraints (#6461) -* minor: SingleImportPerStatementFixer - fix PSR12 set (#6415) -* minor: SingleSpaceAfterConstructFixer - add option `type_colon` (#6434) -* minor: SymfonySet - Add SimpleToComplexStringVariableFixer (#6423) -* minor: Update PHPStan (#6467) -* minor: extract CurlyBracesPositionFixer from BracesFixer (#6452) - -Changelog for v3.8.0 --------------------- - -* bug #6322 PhpdocTypesFixer - fix recognizing callable (kubawerlos) -* bug #6331 ClassReferenceNameCasingFixer - Fix false hits (SpacePossum) -* bug #6333 BinaryOperatorSpacesFixer - Fix for alignment in `elseif` (paulbalandan, SpacePossum) -* bug #6337 PhpdocTypesFixer - fix recognising callable without return type (kubawerlos) -* feature #6286 DateTimeCreateFromFormatCallFixer - Introduction (liquid207) -* feature #6312 TypesSpacesFixer - add option for CS of catching multiple types of exceptions (SpacePossum) -* minor #6326 Bump migration sets used to PHP7.4 (SpacePossum) -* minor #6328 DX: .gitignore ASC file (keradus) - -Changelog for v3.7.0 --------------------- - -* bug #6112 [BinaryOperatorSpacesFixer] Fix align of `=` inside calls of methods (VincentLanglet) -* bug #6279 ClassReferenceNameCasingFixer - Fix for double arrow (SpacePossum) -* bug #6280 Fix bunch of enum issues (SpacePossum) -* bug #6283 ClassReferenceNameCasingFixer - detect imports (SpacePossum) -* feature #5892 NewWithBracesFixer - option to remove braces (jrmajor) -* feature #6081 Allow multiline constructor arguments in an anonymous classes (jrmajor, SpacePossum) -* feature #6274 SingleLineCommentSpacingFixer - Introduction (SpacePossum) -* feature #6300 OrderedClassElementsFixer - handle enums (gharlan) -* feature #6304 NoTrailingCommaInSinglelineFunctionCallFixer - Introduction (SpacePossum) -* minor #6277 Add `is_scalar`, `sizeof`, `ini_get` in list of compiled functions (jderusse) -* minor #6284 ClassReferenceNameCasingFixer - Update doc (SpacePossum) -* minor #6289 PHP7.4 - clean up tests (SpacePossum) -* minor #6290 PHP7.4 - properties types (SpacePossum) -* minor #6291 PHP7.4 - remove run time checks (SpacePossum) -* minor #6292 PhpUnitDedicateAssertFixer - Fix more count cases (SpacePossum) -* minor #6294 PhpUnitDedicateAssertFixer - add assertInstanceOf support (SpacePossum) -* minor #6295 PhpUnitTestCaseIndicator - Check if PHPUnit-test class extends anothe… (SpacePossum) -* minor #6298 Fix checkbashisms download ans SCA violations (SpacePossum) -* minor #6301 BracesFixer - handle enums (gharlan) -* minor #6302 Bump checkbashisms version (kubawerlos) -* minor #6303 PHP8 - Utilize "get_debug_type" (SpacePossum) -* minor #6316 bump xdebug-handler (SpacePossum) -* minor #6327 bump polyfills (SpacePossum) - -Changelog for v3.6.0 --------------------- - -* bug #6063 PhpdocTypesOrderFixer - Improve nested types support (ruudk, julienfalque) -* bug #6197 FullyQualifiedStrictTypesFixer - fix same classname is imported from … (SpacePossum) -* bug #6241 NoSuperfluousPhpdocTagsFixer - fix for reference and splat operator (kubawerlos) -* bug #6243 PhpdocTypesOrderFixer - fix for intersection types (kubawerlos) -* bug #6254 PhpUnitDedicateAssertFixer - remove `is_resource`. (drupol) -* bug #6264 TokensAnalyzer - fix isConstantInvocation detection for multiple exce… (SpacePossum) -* bug #6265 NullableTypeDeclarationForDefaultNullValueFixer - handle "readonly" a… (SpacePossum) -* bug #6266 SimplifiedIfReturnFixer - handle statement in loop without braces (SpacePossum) -* feature #6262 ClassReferenceNameCasingFixer - introduction (SpacePossum) -* feature #6267 NoUnneededImportAliasFixer - Introduction (SpacePossum) -* minor #6199 HeaderCommentFixer - support monolithic files with shebang (kubawerlos, keradus) -* minor #6231 Fix priority descriptions and tests. (SpacePossum) -* minor #6237 DX: Application - better display version when displaying gitSha (keradus) -* minor #6242 Annotation - improve on recognising types with reference and splat operator (kubawerlos) -* minor #6250 Tokens - optimize cache clear (SpacePossum) -* minor #6269 Docs: redo warnings in RST docs to fix issue on website docs (keradus) -* minor #6270 ClassReferenceNameCasingFixer - Add missing test cases for catch (SpacePossum) -* minor #6273 Add priority test (SpacePossum) - -Changelog for v3.5.0 --------------------- - -* bug #6058 Fix `Tokens::insertSlices` not moving around all affected tokens (paulbalandan, SpacePossum) -* bug #6160 NonPrintableCharacterFixer - fix for when removing non-printable character break PHP syntax (kubawerlos) -* bug #6165 DeclareEqualNormalizeFixer - fix for declare having multiple directives (kubawerlos) -* bug #6170 NonPrintableCharacterFixer - fix for string in single quotes, having non-breaking space, linebreak, and single quote inside (kubawerlos) -* bug #6181 UseTransformer - Trait import in enum fix (PHP8.1) (SpacePossum) -* bug #6188 `PhpdocTo(Param|Property|Return)TypeFixer` - fix for type intersections (kubawerlos) -* bug #6202 SquareBraceTransformer - fix for destructing square brace after double arrow (kubawerlos) -* bug #6209 OrderedClassElementsFixer - PHP8.0 support abstract private methods in traits (SpacePossum) -* bug #6224 ArgumentsAnalyzer - support PHP8.1 readonly (SpacePossum) -* feature #4571 BlankLineBeforeStatementFixer - can now add blank lines before doc-comments (addiks, SpacePossum) -* feature #5953 GetClassToClassKeywordFixer - introduction (paulbalandan) -* minor #6108 Drop support for Symfony v4 (keradus) -* minor #6163 CI: update used PHP version (keradus) -* minor #6167 SingleSpaceAfterConstructFixer - allow multiline const (y_ahiru, SpacePossum) -* minor #6168 indexes -> indices (SpacePossum) -* minor #6171 Fix tests and CS (SpacePossum) -* minor #6172 DX: Tokens::insertSlices - groom code and fix tests (keradus) -* minor #6174 PhpdocAlignFixer: fix property-read/property-write descriptions not getting aligned (antichris) -* minor #6177 DX: chmod +x for benchmark.sh file (keradus) -* minor #6180 gitlab reporter - add fixed severity to match format (cbourreau) -* minor #6183 Simplify DiffConsoleFormatter (kubawerlos) -* minor #6184 Do not support array of patterns in Preg methods (kubawerlos) -* minor #6185 Upgrade PHPStan (kubawerlos) -* minor #6189 Finder - fix usage of ignoreDotFiles (kubawerlos) -* minor #6190 DX: DiffConsoleFormatter - escape - (keradus) -* minor #6194 Update Docker setup (julienfalque) -* minor #6196 clean ups (SpacePossum) -* minor #6198 DX: format dot files (kubawerlos) -* minor #6200 DX: Composer's branch-alias leftovers cleanup (kubawerlos) -* minor #6203 Bump required PHP to 7.4 (keradus) -* minor #6205 DX: bump PHPUnit to v9, PHPUnit bridge to v6 and Prophecy-PHPUnit to v2 (keradus) -* minor #6210 NullableTypeDeclarationForDefaultNullValueFixer - fix tests (HypeMC) -* minor #6212 bump year 2021 -> 2022 (SpacePossum) -* minor #6215 DX: Doctrine\Annotation\Tokens - fix phpstan violations (keradus) -* minor #6216 DX: Doctrine\Annotation\Tokens - drop unused methods (keradus) -* minor #6217 DX: lock SCA tools for PR builds (keradus) -* minor #6218 Use composer/xdebug-handler v3 (gharlan) -* minor #6222 Show runtime on version command (SpacePossum) -* minor #6229 Simplify Tokens::isMonolithicPhp tests (kubawerlos) -* minor #6232 Use expectNotToPerformAssertions where applicable (SpacePossum) -* minor #6233 Update Tokens::isMonolithicPhp (kubawerlos) -* minor #6236 Annotation - improve getting variable name (kubawerlos) - -Changelog for v3.4.0 --------------------- - -* bug #6117 SingleSpaceAfterConstruct - handle before destructuring close brace (liquid207) -* bug #6122 NoMultilineWhitespaceAroundDoubleArrowFixer - must run before MethodArgumentSpaceFixer (kubawerlos) -* bug #6130 StrictParamFixer - must run before MethodArgumentSpaceFixer (kubawerlos) -* bug #6137 NewWithBracesFixer - must run before ClassDefinitionFixer (kubawerlos) -* bug #6139 PhpdocLineSpanFixer - must run before NoSuperfluousPhpdocTagsFixer (kubawerlos) -* bug #6143 OperatorLinebreakFixer - fix for alternative syntax (kubawerlos) -* bug #6159 ImportTransformer - fix for grouped constant and function imports (kubawerlos) -* bug #6161 NoUnreachableDefaultArgumentValueFixer - fix for attributes (kubawerlos) -* feature #5776 DX: test on PHP 8.1 (kubawerlos) -* feature #6152 PHP8.1 support (SpacePossum) -* minor #6095 Allow Symfony 6 (derrabus, keradus) -* minor #6107 Drop support of PHPUnit v7 dependency (keradus) -* minor #6109 Add return type to `DummyTestSplFileInfo::getRealPath()` (derrabus) -* minor #6115 Remove PHP 7.2 polyfill (derrabus) -* minor #6116 CI: remove installation of mbstring polyfill in build script, it's required dependency now (keradus) -* minor #6119 OrderedClassElementsFixer - PHPUnit `assert(Pre|Post)Conditions` methods support (meyerbaptiste) -* minor #6121 Use Tokens::ensureWhitespaceAtIndex to simplify code (kubawerlos) -* minor #6127 Remove 2nd parameter to XdebugHandler constructor (phil-davis) -* minor #6129 clean ups (SpacePossum) -* minor #6138 PHP8.1 - toString cannot return type hint void (SpacePossum) -* minor #6146 PHP 8.1: add new_in_initializers to PHP 8.1 integration test (keradus) -* minor #6147 DX: update composer-normalize (keradus) -* minor #6156 DX: drop hack for Prophecy incompatibility (keradus) - -Changelog for v3.3.1 --------------------- - -* minor #6067 Bump minimum PHP version to 7.2 (keradus) - -Changelog for v3.3.0 --------------------- - -* bug #6054 Utils - Add multibyte and UTF-8 support (paulbalandan) -* bug #6061 ModernizeStrposFixer - fix for negated with leading slash (kubawerlos) -* bug #6064 SquareBraceTransformer - fix detect array destructing in foreach (SpacePossum) -* bug #6082 PhpUnitDedicateAssertFixer must run before NoUnusedImportsFixer (kubawerlos) -* bug #6089 TokensAnalyzer.php - Fix T_ENCAPSED_AND_WHITESPACE handling in isBina… (SpacePossum) -* feature #5123 PhpdocTypesFixer - support generic types (kubawerlos) -* minor #5775 DX: run static code analysis on PHP 8.0 (kubawerlos) -* minor #6050 DX: TypeIntersectionTransformer - prove to not touch T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG (keradus) -* minor #6051 NoExtraBlankLinesFixer - Improve deprecation message (paulbalandan) -* minor #6060 DX: Add upgrade guide link when next Major is available (keradus) -* minor #6066 Clean ups (SpacePossum, kubawerlos) -* minor #6069 DX: cleanup stub file (keradus) -* minor #6070 Update UPGRADE-v3.md with php_unit_test_annotation/case deprecation (kubawerlos) -* minor #6072 Update usage doc to reflect change to PSR12 default. (hannob, keradus) -* minor #6084 Change: Remove __constructor() from RuleSetDescriptionInterface (niklam) -* minor #6085 Dx: reuse WhitespacesAnalyzer::detectIndent (kubawerlos) -* minor #6087 AbstractProxyFixer - more tests (SpacePossum) - -Changelog for v3.2.1 ---------------------- - -experimental release - -* Require PHP 7.2 - -Changelog for v3.2.0 --------------------- - -* bug #5809 FunctionsAnalyzer - fix for recognizing global functions in attributes (kubawerlos) -* bug #5909 NativeFunctionCasingFixer - fix for attributes and imported functions (kubawerlos) -* bug #5920 ClassAttributesSeparationFixer - fixes & enhancements (SpacePossum) -* bug #5923 TypeAlternationTransformer - fix for promoted properties (kubawerlos) -* bug #5938 NoAliasFunctionsFixer - remove dir -> getdir mapping (SpacePossum) -* bug #5941 TokensAnalyzer - isAnonymousClass bug on PHP8 (SpacePossum) -* bug #5942 TokensAnalyzer - isConstantInvocation PHP 8 issue (SpacePossum) -* bug #5943 NoUnusedImportsFixer - use in attribute (SpacePossum) -* bug #5955 Fixed `class_attributes_separation` processing class with multiple trait imports (GrahamCampbell) -* bug #5977 LowercaseStaticReference - SingleClassElementPerStatement - union types (SpacePossum) -* bug #5984 RegularCallableCallFixer must run before NativeFunctionInvocationFixer (kubawerlos) -* bug #5986 CurlyBraceTransformer - count T_CURLY_OPEN itself as level as well (SpacePossum) -* bug #5989 NoAliasFunctionsFixer - Correct mapping (weshooper) -* bug #6004 SwitchContinueToBreakFixer - Fix candidate check (SpacePossum) -* bug #6005 CommentsAnalyzer - before static call (SpacePossum) -* bug #6007 YodaStyleFixer - PHP8 named arguments support (liquid207) -* bug #6015 CommentsAnalyzer - constructor property promotion support (liquid207) -* bug #6020 RegularCallableCallFixer - case insensitive fixing (SpacePossum) -* bug #6037 PhpdocLineSpanFixer - do not crash on trait imports (SpacePossum) -* feature #4834 AssignNullCoalescingToCoalesceEqualFixer - introduction (SpacePossum) -* feature #5754 ModernizeStrposFixer - introduction (derrabus, SpacePossum, keradus) -* feature #5858 EmptyLoopConditionFixer - introduction (SpacePossum) -* feature #5967 PHP8.1 - type "never" support (SpacePossum) -* feature #5968 PHP8.1 - "readonly" property modifier support (SpacePossum) -* feature #5970 IntegerLiteralCaseFixer - introduction (SpacePossum) -* feature #5971 PHP8.1 - Explicit octal integer literal notation (SpacePossum) -* feature #5997 NoSuperfluousPhpdocTagsFixer - Add union types support (julienfalque) -* feature #6026 TypeIntersectionTransformer - introduction (kubawerlos, SpacePossum) -* feature #6031 NoSpaceAroundDoubleColonFixer - introduction (SpacePossum) -* feature #6047 StringLengthToEmptyFixer - introduction (SpacePossum) -* minor #5773 NoAlternativeSyntaxFixer - Add option to not fix non-monolithic PHP code (paulbalandan) -* minor #5887 Detect renamed rules in configuration resolver (shakaran) -* minor #5901 DX: update PHPStan (kubawerlos) -* minor #5906 Remove references to PHP 7.0 in tests (with updates) (kubawerlos) -* minor #5918 Remove PHP version specific code sample constraint when not needed (kubawerlos) -* minor #5924 PSR12 - ClassDefinition - space_before_parenthesis (SpacePossum) -* minor #5925 DX: ProjectCodeTest - fix detection by testExpectedInputOrder (keradus) -* minor #5926 DX: remove not needed requirements from fixtures (kubawerlos) -* minor #5927 Symfonyset - EmptyLoopBody (SpacePossum) -* minor #5928 PhpdocTo*TypeFixer - add more test cases (keradus) -* minor #5929 Remove not needed PHP version checks (kubawerlos) -* minor #5930 simplify code, more tests (SpacePossum) -* minor #5931 logo copyright - bump year (SpacePossum) -* minor #5932 Extract ControlStructureContinuationPositionFixer from BracesFixer (julienfalque) -* minor #5933 Consistency invalid configuration exception for test (shakaran) -* minor #5934 Add return types (SpacePossum) -* minor #5949 Removed PHP 5 exception catch (GrahamCampbell) -* minor #5952 ClassAttributesSeparationFixer - Re-add omitted `only_if_meta` option (paulbalandan) -* minor #5957 Keep PHPStan cache between Docker runs (julienfalque) -* minor #5958 Fix STDIN test when path is one level deep (julienfalque) -* minor #5959 SymfonySet - add EmptyLoopConditionFixer (SpacePossum) -* minor #5961 Remove duplicated method (julienfalque) -* minor #5962 DX: Add return types (kubawerlos) -* minor #5963 DX: extract config for special CI jobs (keradus) -* minor #5964 DX: use modernize_strpos (keradus) -* minor #5965 CI: don't try to execute jobs with Symfony:^3 (keradus) -* minor #5972 PHP8.1 - FirstClassCallable (SpacePossum) -* minor #5973 PHP8.1 - "final const" support (SpacePossum) -* minor #5975 Tree shake PHP8.1 PRs (SpacePossum) -* minor #5978 PHP8.1 - Enum (start) (SpacePossum) -* minor #5982 Fix test warning (SpacePossum) -* minor #5987 PHP8.1 - Enum (start) (SpacePossum) -* minor #5995 Fix link to Code Climate SPEC.md in GitlabReporter (astehlik) -* minor #5996 Fix URL to Doctrine Annotations documentation (astehlik) -* minor #6000 Prevent PHP CS Fixer from fixing PHPStan cache files (julienfalque) -* minor #6006 SCA/utilize PHP8.1 (SpacePossum) -* minor #6008 SCA (SpacePossum) -* minor #6010 SCA (SpacePossum) -* minor #6011 NoSuperfluousPhpdocTagsFixer - Remove superfluous annotation `@abstract` and `@final` (liquid207, SpacePossum) -* minor #6018 PhpdocLineSpan - Allow certain types to be ignored (devfrey) -* minor #6019 Improve test coverage (SpacePossum) -* minor #6021 Linter/*Exception - Tag as final (SpacePossum) -* minor #6023 OrderedClassElementsFixer - PHP8.1 readonly properties support (SpacePossum) -* minor #6027 MbStrFunctionsFixer - more details about risky (SpacePossum) -* minor #6028 BinaryOperatorSpacesFixer - list all operators in doc (SpacePossum) -* minor #6029 PhpUnitDedicateAssertFixer - add "assertStringContainsString" and "as… (SpacePossum) -* minor #6030 SingleSpaceAfterConstructFixer - Add `switch` support (SpacePossum) -* minor #6033 ArgumentsAnalyzerTest - add more tests (SpacePossum) -* minor #6034 Cleanup tests for PHP 7.0 and 7.1 (SpacePossum) -* minor #6035 Documentation generation split up and add list. (SpacePossum) -* minor #6048 Fix "can not" spelling (mvorisek) - -Changelog for v3.1.0 --------------------- - -* feature #5572 PhpdocToCommentFixer - Add `ignored_tags` option (VincentLanglet) -* feature #5588 NoAliasFunctionsFixer - Add more function aliases (danog) -* feature #5704 ClassAttributesSeparationFixer - Introduce `only_if_meta` spacing option (paulbalandan) -* feature #5734 TypesSpacesFixer - Introduction (kubawerlos) -* feature #5745 EmptyLoopBodyFixer - introduction (SpacePossum, keradus) -* feature #5751 Extract DeclareParenthesesFixer from BracesFixer (julienfalque, keradus) -* feature #5877 ClassDefinitionFixer - PSR12 for anonymous class (SpacePossum) -* minor #5875 EmptyLoopBodyFixer - NoTrailingWhitespaceFixer - priority test (SpacePossum) -* minor #5914 Deprecate ClassKeywordRemoveFixer (kubawerlos) - -Changelog for v3.0.3 --------------------- - -* bug #4927 PhpdocAlignFixer - fix for whitespace in type (kubawerlos) -* bug #5720 NoUnusedImportsFixer - Fix undetected unused imports when type mismatch (julienfalque, SpacePossum) -* bug #5806 DoctrineAnnotationFixer - Add template to ignored_tags (akalineskou) -* bug #5849 PhpdocTagTypeFixer - must not remove inlined tags within other tags (boesing) -* bug #5853 BracesFixer - handle alternative short foreach with if (SpacePossum) -* bug #5855 GlobalNamespaceImportFixer - fix for attributes imported as constants (kubawerlos) -* bug #5881 SelfUpdateCommand - fix link to UPGRADE docs (keradus) -* bug #5884 CurlyBraceTransformer - fix handling dynamic property with string with variable (kubawerlos, keradus) -* bug #5912 TypeAlternationTransformer - fix for "callable" type (kubawerlos) -* bug #5913 SingleSpaceAfterConstructFixer - improve comma handling (keradus) -* minor #5829 DX: Fix SCA with PHPMD (paulbalandan) -* minor #5838 PHP7 - use spaceship (SpacePossum, keradus) -* minor #5848 Docs: update PhpStorm integration link (keradus) -* minor #5856 Add AttributeAnalyzer (kubawerlos) -* minor #5857 DX: PHPMD - exclude fixtures (keradus) -* minor #5859 Various fixes (kubawerlos) -* minor #5864 DX: update dev tools (kubawerlos) -* minor #5876 AttributeTransformerTest - add more tests (SpacePossum) -* minor #5879 Update UPGRADE-v3.md adding relative links (shakaran, keradus) -* minor #5882 Docs: don't use v2 for installation example (keradus) -* minor #5883 Docs: typo (brianteeman, keradus) -* minor #5890 DX: use PHP 8.1 polyfill (keradus) -* minor #5902 Remove references to PHP 7.0 in tests (only removing lines) (kubawerlos) -* minor #5905 DX: Use "yield from" in tests (kubawerlos, keradus) -* minor #5917 Use `@PHP71Migration` rules (kubawerlos, keradus) - -Changelog for v3.0.2 --------------------- - -* bug #5816 FullyQualifiedStrictTypesFixer - fix for union types (kubawerlos, keradus) -* bug #5835 PhpdocTypesOrderFixer: fix for array shapes (kubawerlos) -* bug #5837 SingleImportPerStatementFixer - fix const and function imports (SpacePossum) -* bug #5844 PhpdocTypesOrderFixer: handle callable() type (Slamdunk) -* minor #5839 DX: automate checking 7.0 types on project itself (keradus) -* minor #5840 DX: drop v2 compatible config in project itself (keradus) - -Changelog for v3.0.1 --------------------- - -* bug #5395 PhpdocTagTypeFixer: Do not modify array shapes (localheinz, julienfalque) -* bug #5678 UseArrowFunctionsFixer - fix for return without value (kubawerlos) -* bug #5679 PhpUnitNamespacedFixer - do not try to fix constant usage (kubawerlos) -* bug #5681 RegularCallableCallFixer - fix for function name with escaped slash (kubawerlos) -* bug #5687 FinalInternalClassFixer - fix for annotation with space after "@" (kubawerlos) -* bug #5688 ArrayIndentationFixer - fix for really long arrays (kubawerlos) -* bug #5690 PhpUnitNoExpectationAnnotationFixer - fix "expectedException" annotation with message below (kubawerlos) -* bug #5693 YodaStyleFixer - fix for assignment operators (kubawerlos) -* bug #5697 StrictParamFixer - fix for method definition (kubawerlos) -* bug #5702 CommentToPhpdocFixer - fix for single line comments starting with more than 2 slashes (kubawerlos) -* bug #5703 DateTimeImmutableFixer - fix for method definition (kubawerlos) -* bug #5718 VoidReturnFixer - do not break syntax with magic methods (kubawerlos) -* bug #5727 SingleSpaceAfterConstructFixer - Add support for `namespace` (julienfalque) -* bug #5730 Fix transforming deprecations into exceptions (julienfalque) -* bug #5738 TokensAnalyzer - fix for union types (kubawerlos) -* bug #5741 Fix constant invocation detection cases (kubawerlos) -* bug #5769 Fix priority between `phpdoc_to_property_type` and `no_superfluous_phpdoc_tags` (julienfalque) -* bug #5774 FunctionsAnalyzer::isTheSameClassCall - fix for $this with double colon following (kubawerlos) -* bug #5779 SingleLineThrowFixer - fix for throw in match (kubawerlos) -* bug #5781 ClassDefinition - fix for anonymous class with trailing comma (kubawerlos) -* bug #5783 StaticLambdaFixer - consider parent:: as a possible reference to $this (fancyweb) -* bug #5791 NoBlankLinesAfterPhpdoc - Add T_NAMESPACE in array of forbidden successors (paulbalandan) -* bug #5799 TypeAlternationTransformer - fix for multiple function parameters (kubawerlos) -* bug #5804 NoBreakCommentFixer - fix for "default" in "match" (kubawerlos) -* bug #5805 SingleLineCommentStyleFixer - run after HeaderCommentFixer (kubawerlos) -* bug #5817 NativeFunctionTypeDeclarationCasingFixer - fix for union types (kubawerlos) -* bug #5823 YodaStyleFixer - yield support (SpacePossum) -* minor #4914 Improve PHPDoc types support (julienfalque, keradus) -* minor #5592 Fix checking for default config used in rule sets (kubawerlos) -* minor #5675 Docs: extend Upgrade Guide (keradus) -* minor #5680 DX: benchmark.sh - ensure deps are updated to enable script working across less-similar branches (keradus) -* minor #5689 Calculate code coverage on PHP 8 (kubawerlos) -* minor #5694 DX: fail on risky tests (kubawerlos) -* minor #5695 Utils - save only unique deprecations to avoid memory issues (PetrHeinz) -* minor #5710 [typo] add correct backquotes (PhilETaylor) -* minor #5711 Fix doc, "run-in" show-progress option is no longer present (mvorisek) -* minor #5713 Upgrade-Guide: fix typo (staabm) -* minor #5717 Run migration rules on PHP 8 (kubawerlos, keradus) -* minor #5721 Fix reStructuredText markup (julienfalque) -* minor #5725 Update LICENSE (exussum12) -* minor #5731 CI - Fix checkbashisms installation (julienfalque) -* minor #5736 Remove references to PHP 5.6 (kubawerlos, keradus) -* minor #5739 DX: more typehinting (keradus) -* minor #5740 DX: more type-related docblocks (keradus) -* minor #5746 Config - Improve deprecation message with details (SpacePossum) -* minor #5747 RandomApiMigrationFixer - better docs and better "random_int" support (SpacePossum) -* minor #5748 Updated the link to netbeans plugins page (cyberguroo) -* minor #5750 Test all const are in uppercase (SpacePossum) -* minor #5752 NoNullPropertyInitializationFixer - fix static properties as well (HypeMC) -* minor #5756 Fix rule sets descriptions (kubawerlos) -* minor #5761 Fix links in custom rules documentation (julienfalque) -* minor #5771 doc(config): change set's name (Kocal) -* minor #5777 DX: update PHPStan (kubawerlos) -* minor #5789 DX: update PHPStan (kubawerlos) -* minor #5808 Update PHPStan to 0.12.92 (kubawerlos) -* minor #5813 Docs: point to v3 in installation description (Jimbolino) -* minor #5824 Deprecate v2 (keradus) -* minor #5825 DX: update checkbashisms to v2.21.3 (keradus) -* minor #5826 SCA: check both composer files (keradus) -* minor #5827 ClassAttributesSeparationFixer - Add `trait_import` support (SpacePossum) -* minor #5831 DX: fix SCA violations (keradus) - -Changelog for v3.0.0 --------------------- - -* bug #5164 Differ - surround file name with double quotes if it contains spacing. (SpacePossum) -* bug #5560 PSR2: require visibility only for properties and methods (kubawerlos) -* bug #5576 ClassAttributesSeparationFixer: do not allow using v2 config (kubawerlos) -* feature #4979 Pass file to differ (paulhenri-l, SpacePossum) -* minor #3374 show-progress option: drop run-in and estimating, rename estimating-max to dots (keradus) -* minor #3375 Fixers - stop exposing extra properties/consts (keradus) -* minor #3376 Tokenizer - remove deprecations and legacy mode (keradus) -* minor #3377 rules - change default options (keradus) -* minor #3378 SKIP_LINT_TEST_CASES - drop env (keradus) -* minor #3379 MethodArgumentSpaceFixer - fixSpace is now private (keradus) -* minor #3380 rules - drop rootless configurations (keradus) -* minor #3381 rules - drop deprecated configurations (keradus) -* minor #3382 DefinedFixerInterface - incorporate into FixerInterface (keradus) -* minor #3383 FixerDefinitionInterface - drop getConfigurationDescription and getDefaultConfiguration (keradus) -* minor #3384 diff-format option: drop sbd diff, use udiffer by default, drop SebastianBergmannDiffer and SebastianBergmannShortDiffer classes (keradus) -* minor #3385 ConfigurableFixerInterface::configure - param is now not nullable and not optional (keradus) -* minor #3386 ConfigurationDefinitionFixerInterface - incorporate into ConfigurableFixerInterface (keradus) -* minor #3387 FixCommand - forbid passing 'config' and 'rules' options together (keradus) -* minor #3388 Remove Helpers (keradus) -* minor #3389 AccessibleObject - drop class (keradus) -* minor #3390 Drop deprecated rules: blank_line_before_return, hash_to_slash_comment, method_separation, no_extra_consecutive_blank_lines, no_multiline_whitespace_before_semicolons and pre_increment (keradus) -* minor #3456 AutoReview - drop references to removed rule (keradus) -* minor #3659 use php-cs-fixer/diff ^2.0 (SpacePossum) -* minor #3681 CiIntegrationTest - fix incompatibility from 2.x line (keradus) -* minor #3740 NoUnusedImportsFixer - remove SF exception (SpacePossum) -* minor #3771 UX: always set error_reporting in entry file, not Application (keradus) -* minor #3922 Make some more classes final (ntzm, SpacePossum) -* minor #3995 Change default config of native_function_invocation (dunglas, SpacePossum) -* minor #4432 DX: remove empty sets from RuleSet (kubawerlos) -* minor #4489 Fix ruleset @PHPUnit50Migration:risky (kubawerlos) -* minor #4620 DX: cleanup additional, not used parameters (keradus) -* minor #4666 Remove deprecated rules: lowercase_constants, php_unit_ordered_covers, silenced_deprecation_error (keradus) -* minor #4697 Remove deprecated no_short_echo_tag rule (julienfalque) -* minor #4851 fix phpstan on 3.0 (SpacePossum) -* minor #4901 Fix SCA (SpacePossum) -* minor #5069 Fixed failing tests on 3.0 due to unused import after merge (GrahamCampbell) -* minor #5096 NativeFunctionInvocationFixer - BacktickToShellExecFixer - fix integration test (SpacePossum) -* minor #5171 Fix test (SpacePossum) -* minor #5245 Fix CI for 3.0 line (keradus) -* minor #5351 clean ups (SpacePossum) -* minor #5364 DX: Do not display runtime twice on 3.0 line (keradus) -* minor #5412 3.0 - cleanup (SpacePossum, keradus) -* minor #5417 Further BC cleanup for 3.0 (keradus) -* minor #5418 Drop src/Test namespace (keradus) -* minor #5436 Drop mapping of strings to boolean option other than yes/no (keradus) -* minor #5440 Change default ruleset to PSR-12 (keradus) -* minor #5477 Drop diff-format (keradus) -* minor #5478 Docs: Cleanup UPGRADE markdown files (keradus) -* minor #5479 ArraySyntaxFixer, ListSyntaxFixer - change default syntax to short (keradus) -* minor #5480 Tokens::findBlockEnd - drop deprecated argument (keradus) -* minor #5485 ClassAttributesSeparationFixer - drop deprecated flat list configuration (keradus) -* minor #5486 CI: drop unused env variables (keradus) -* minor #5488 Do not distribute documentation (szepeviktor) -* minor #5513 DX: Tokens::warnPhp8SplFixerArrayChange - drop unused method (keradus) -* minor #5520 DX: Drop IsIdenticalConstraint (keradus) -* minor #5521 DX: apply rules configuration cleanups for PHP 7.1+ (keradus) -* minor #5524 DX: drop support of very old deps (keradus) -* minor #5525 Drop phpunit-legacy-adapter (keradus) -* minor #5527 Bump required PHP to 7.1 (keradus) -* minor #5529 DX: bump required PHPUnit to v7+ (keradus) -* minor #5532 Apply PHP 7.1 typing (keradus) -* minor #5541 RuleSet - disallow null usage to disable the rule (keradus) -* minor #5555 DX: further typing improvements (keradus) -* minor #5562 Fix table row rendering for default values of array_syntax and list_syntax (derrabus) -* minor #5608 DX: new cache filename (keradus) -* minor #5609 Forbid old config filename usage (keradus) -* minor #5638 DX: remove Utils::calculateBitmask (keradus) -* minor #5641 DX: use constants for PHPUnit version on 3.0 line (keradus) -* minor #5643 FixCommand - simplify help (keradus) -* minor #5644 Token::toJson() - remove parameter (keradus) -* minor #5645 DX: YodaStyleFixerTest - fix CI (keradus) -* minor #5649 DX: YodaStyleFixerTest - fix 8.0 compat (keradus) -* minor #5650 DX: FixCommand - drop outdated/duplicated docs (keradus) -* minor #5656 DX: mark some constants as internal or private (keradus) -* minor #5657 DX: convert some properties to constants (keradus) -* minor #5669 Remove TrailingCommaInMultilineArrayFixer (kubawerlos, keradus) - -Changelog for v2.19.3 ---------------------- - -* minor #6060 DX: Add upgrade guide link when next Major is available (keradus) - -Changelog for v2.19.2 ---------------------- - -* bug #5881 SelfUpdateCommand - fix link to UPGRADE docs (keradus) - -Changelog for v2.19.1 ---------------------- - -* bug #5395 PhpdocTagTypeFixer: Do not modify array shapes (localheinz, julienfalque) -* bug #5678 UseArrowFunctionsFixer - fix for return without value (kubawerlos) -* bug #5679 PhpUnitNamespacedFixer - do not try to fix constant usage (kubawerlos) -* bug #5681 RegularCallableCallFixer - fix for function name with escaped slash (kubawerlos) -* bug #5687 FinalInternalClassFixer - fix for annotation with space after "@" (kubawerlos) -* bug #5688 ArrayIndentationFixer - fix for really long arrays (kubawerlos) -* bug #5690 PhpUnitNoExpectationAnnotationFixer - fix "expectedException" annotation with message below (kubawerlos) -* bug #5693 YodaStyleFixer - fix for assignment operators (kubawerlos) -* bug #5697 StrictParamFixer - fix for method definition (kubawerlos) -* bug #5702 CommentToPhpdocFixer - fix for single line comments starting with more than 2 slashes (kubawerlos) -* bug #5703 DateTimeImmutableFixer - fix for method definition (kubawerlos) -* bug #5718 VoidReturnFixer - do not break syntax with magic methods (kubawerlos) -* bug #5727 SingleSpaceAfterConstructFixer - Add support for `namespace` (julienfalque) -* bug #5730 Fix transforming deprecations into exceptions (julienfalque) -* bug #5738 TokensAnalyzer - fix for union types (kubawerlos) -* bug #5741 Fix constant invocation detection cases (kubawerlos) -* bug #5769 Fix priority between `phpdoc_to_property_type` and `no_superfluous_phpdoc_tags` (julienfalque) -* bug #5774 FunctionsAnalyzer::isTheSameClassCall - fix for $this with double colon following (kubawerlos) -* bug #5779 SingleLineThrowFixer - fix for throw in match (kubawerlos) -* bug #5781 ClassDefinition - fix for anonymous class with trailing comma (kubawerlos) -* bug #5783 StaticLambdaFixer - consider parent:: as a possible reference to $this (fancyweb) -* bug #5791 NoBlankLinesAfterPhpdoc - Add T_NAMESPACE in array of forbidden successors (paulbalandan) -* bug #5799 TypeAlternationTransformer - fix for multiple function parameters (kubawerlos) -* bug #5804 NoBreakCommentFixer - fix for "default" in "match" (kubawerlos) -* bug #5805 SingleLineCommentStyleFixer - run after HeaderCommentFixer (kubawerlos) -* bug #5817 NativeFunctionTypeDeclarationCasingFixer - fix for union types (kubawerlos) -* bug #5823 YodaStyleFixer - yield support (SpacePossum) -* minor #4914 Improve PHPDoc types support (julienfalque, keradus) -* minor #5680 DX: benchmark.sh - ensure deps are updated to enable script working across less-similar branches (keradus) -* minor #5689 Calculate code coverage on PHP 8 (kubawerlos) -* minor #5694 DX: fail on risky tests (kubawerlos) -* minor #5695 Utils - save only unique deprecations to avoid memory issues (PetrHeinz) -* minor #5710 [typo] add correct backquotes (PhilETaylor) -* minor #5717 Run migration rules on PHP 8 (kubawerlos, keradus) -* minor #5721 Fix reStructuredText markup (julienfalque) -* minor #5725 Update LICENSE (exussum12) -* minor #5731 CI - Fix checkbashisms installation (julienfalque) -* minor #5740 DX: more type-related docblocks (keradus) -* minor #5746 Config - Improve deprecation message with details (SpacePossum) -* minor #5747 RandomApiMigrationFixer - better docs and better "random_int" support (SpacePossum) -* minor #5748 Updated the link to netbeans plugins page (cyberguroo) -* minor #5750 Test all const are in uppercase (SpacePossum) -* minor #5752 NoNullPropertyInitializationFixer - fix static properties as well (HypeMC) -* minor #5756 Fix rule sets descriptions (kubawerlos) -* minor #5761 Fix links in custom rules documentation (julienfalque) -* minor #5777 DX: update PHPStan (kubawerlos) -* minor #5789 DX: update PHPStan (kubawerlos) -* minor #5808 Update PHPStan to 0.12.92 (kubawerlos) -* minor #5824 Deprecate v2 (keradus) -* minor #5825 DX: update checkbashisms to v2.21.3 (keradus) -* minor #5826 SCA: check both composer files (keradus) -* minor #5827 ClassAttributesSeparationFixer - Add `trait_import` support (SpacePossum) - -Changelog for v2.19.0 ---------------------- - -* feature #4238 TrailingCommaInMultilineFixer - introduction (kubawerlos) -* feature #4592 PhpdocToPropertyTypeFixer - introduction (julienfalque) -* feature #5390 feature #4024 added a `list-files` command (clxmstaab, keradus) -* feature #5635 Add list-sets command (keradus) -* feature #5674 UX: Display deprecations to end-user (keradus) -* minor #5601 Always stop when "PHP_CS_FIXER_FUTURE_MODE" is used (kubawerlos) -* minor #5607 DX: new config filename (keradus) -* minor #5613 DX: UtilsTest - add missing teardown (keradus) -* minor #5631 DX: config deduplication (keradus) -* minor #5633 fix typos (staabm) -* minor #5642 Deprecate parameter of Token::toJson() (keradus) -* minor #5672 DX: do not test deprecated fixer (kubawerlos) - -Changelog for v2.18.7 ---------------------- - -* bug #5593 SingleLineThrowFixer - fix handling anonymous classes (kubawerlos) -* bug #5654 SingleLineThrowFixer - fix for match expression (kubawerlos) -* bug #5660 TypeAlternationTransformer - fix for "array" type in type alternation (kubawerlos) -* bug #5665 NullableTypeDeclarationForDefaultNullValueFixer - fix for nullable with attribute (kubawerlos) -* bug #5670 PhpUnitNamespacedFixer - do not try to fix constant (kubawerlos) -* bug #5671 PhpdocToParamTypeFixer - do not change function call (kubawerlos) -* bug #5673 GroupImportFixer - Fix failing case (julienfalque) -* minor #4591 Refactor conversion of PHPDoc to type declarations (julienfalque, keradus) -* minor #5611 DX: use method expectDeprecation from Symfony Bridge instead of annotation (kubawerlos) -* minor #5658 DX: use constants in tests for Fixer configuration (keradus) -* minor #5661 DX: remove PHPStan exceptions for "tests" from phpstan.neon (kubawerlos) -* minor #5662 Change wording from "merge" to "intersect" (jschaedl) -* minor #5663 DX: do not abuse "inheritdoc" tag (kubawerlos) -* minor #5664 DX: code grooming (keradus) - -Changelog for v2.18.6 ---------------------- - -* bug #5586 Add support for nullsafe object operator ("?->") (kubawerlos) -* bug #5597 Tokens - fix for checking block edges (kubawerlos) -* bug #5604 Custom annotations @type changed into @var (Leprechaunz) -* bug #5606 DoctrineAnnotationBracesFixer false positive (Leprechaunz) -* bug #5610 BracesFixer - fix braces of match expression (Leprechaunz) -* bug #5615 GroupImportFixer severely broken (Leprechaunz) -* bug #5617 ClassAttributesSeparationFixer - fix for using visibility for class elements (kubawerlos) -* bug #5618 GroupImportFixer - fix removal of import type when mixing multiple types (Leprechaunz) -* bug #5622 Exclude Doctrine documents from final fixer (ossinkine) -* bug #5630 PhpdocTypesOrderFixer - handle complex keys (Leprechaunz) -* minor #5554 DX: use tmp file in sys_temp_dir for integration tests (keradus) -* minor #5564 DX: make integration tests matching entries in FixerFactoryTest (kubawerlos) -* minor #5603 DX: DocumentationGenerator - no need to re-configure Differ (keradus) -* minor #5612 DX: use ::class whenever possible (kubawerlos) -* minor #5619 DX: allow XDebugHandler v2 (keradus) -* minor #5623 DX: when displaying app version, don't put extra space if there is no CODENAME available (keradus) -* minor #5626 DX: update PHPStan and way of ignoring flickering PHPStan exception (keradus) -* minor #5629 DX: fix CiIntegrationTest (keradus) -* minor #5636 DX: remove 'create' method in internal classes (keradus) -* minor #5637 DX: do not calculate bitmap via helper anymore (keradus) -* minor #5639 Move fix reports (classes and schemas) (keradus) -* minor #5640 DX: use constants for PHPUnit version (keradus) -* minor #5646 Cleanup YodaStyleFixerTest (kubawerlos) - -Changelog for v2.18.5 ---------------------- - -* bug #5561 NoMixedEchoPrintFixer: fix for conditions without curly brackets (kubawerlos) -* bug #5563 Priority fix: SingleSpaceAfterConstructFixer must run before BracesFixer (kubawerlos) -* bug #5567 Fix order of BracesFixer and ClassDefinitionFixer (Daeroni) -* bug #5596 NullableTypeTransformer - fix for attributes (kubawerlos, jrmajor) -* bug #5598 GroupImportFixer - fix breaking code when fixing root classes (Leprechaunz) -* minor #5571 DX: add test to make sure SingleSpaceAfterConstructFixer runs before FunctionDeclarationFixer (kubawerlos) -* minor #5577 Extend priority test for "class_definition" vs "braces" (kubawerlos) -* minor #5585 DX: make doc examples prettier (kubawerlos) -* minor #5590 Docs: HeaderCommentFixer - document example how to remove header comment (keradus) -* minor #5602 DX: regenerate docs (keradus) - -Changelog for v2.18.4 ---------------------- - -* bug #4085 Priority: AlignMultilineComment should run before every PhpdocFixer (dmvdbrugge) -* bug #5421 PsrAutoloadingFixer - Fix PSR autoloading outside configured directory (kelunik, keradus) -* bug #5464 NativeFunctionInvocationFixer - PHP 8 attributes (HypeMC, keradus) -* bug #5548 NullableTypeDeclarationForDefaultNullValueFixer - fix handling promoted properties (jrmajor, keradus) -* bug #5550 TypeAlternationTransformer - fix for typed static properties (kubawerlos) -* bug #5551 ClassAttributesSeparationFixer - fix for properties with type alternation (kubawerlos, keradus) -* bug #5552 DX: test relation between function_declaration and method_argument_space (keradus) -* minor #5540 DX: RuleSet - convert null handling to soft-warning (keradus) -* minor #5545 DX: update checkbashisms (keradus) - -Changelog for v2.18.3 ---------------------- - -* bug #5484 NullableTypeDeclarationForDefaultNullValueFixer - handle mixed pseudotype (keradus) -* minor #5470 Disable CI fail-fast (mvorisek) -* minor #5491 Support php8 static return type for NoSuperfluousPhpdocTagsFixer (tigitz) -* minor #5494 BinaryOperatorSpacesFixer - extend examples (keradus) -* minor #5499 DX: add TODOs for PHP requirements cleanup (keradus) -* minor #5500 DX: Test that Transformers are adding only CustomTokens that they define and nothing else (keradus) -* minor #5507 Fix quoting in exception message (gquemener) -* minor #5514 DX: PHP 7.0 integration test - solve TODO for random_api_migration usage (keradus) -* minor #5515 DX: do not override getConfigurationDefinition (keradus) -* minor #5516 DX: AbstractDoctrineAnnotationFixer - no need for import aliases (keradus) -* minor #5518 DX: minor typing and validation fixes (keradus) -* minor #5522 Token - add handling json_encode crash (keradus) -* minor #5523 DX: EregToPregFixer - fix sorting (keradus) -* minor #5528 DX: code cleanup (keradus) - -Changelog for v2.18.2 ---------------------- - -* bug #5466 Fix runtime check of PHP version (keradus) -* minor #4250 POC Tokens::insertSlices (keradus) - -Changelog for v2.18.1 ---------------------- - -* bug #5447 switch_case_semicolon_to_colon should skip match/default statements (derrabus) -* bug #5453 SingleSpaceAfterConstructFixer - better handling of closing parenthesis and brace (keradus) -* bug #5454 NullableTypeDeclarationForDefaultNullValueFixer - support property promotion via constructor (keradus) -* bug #5455 PhpdocToCommentFixer - add support for attributes (keradus) -* bug #5462 NullableTypeDeclarationForDefaultNullValueFixer - support union types (keradus) -* minor #5444 Fix PHP version number in PHP54MigrationSet description (jdreesen, keradus) -* minor #5445 DX: update usage of old TraversableContains in tests (keradus) -* minor #5456 DX: Fix CiIntegrationTest (keradus) -* minor #5457 CI: fix params order (keradus) -* minor #5458 CI: fix migration workflow (keradus) -* minor #5459 DX: cleanup PHP Migration rulesets (keradus) - -Changelog for v2.18.0 ---------------------- - -* feature #4943 Add PSR12 ruleset (julienfalque, keradus) -* feature #5426 Update Symfony ruleset (keradus) -* feature #5428 Add/Change PHP.MigrationSet to update array/list syntax to short one (keradus) -* minor #5441 Allow execution under PHP 8 (keradus) - -Changelog for v2.17.5 ---------------------- - -* bug #5447 switch_case_semicolon_to_colon should skip match/default statements (derrabus) -* bug #5453 SingleSpaceAfterConstructFixer - better handling of closing parenthesis and brace (keradus) -* bug #5454 NullableTypeDeclarationForDefaultNullValueFixer - support property promotion via constructor (keradus) -* bug #5455 PhpdocToCommentFixer - add support for attributes (keradus) -* bug #5462 NullableTypeDeclarationForDefaultNullValueFixer - support union types (keradus) -* minor #5445 DX: update usage of old TraversableContains in tests (keradus) -* minor #5456 DX: Fix CiIntegrationTest (keradus) -* minor #5457 CI: fix params order (keradus) -* minor #5459 DX: cleanup PHP Migration rulesets (keradus) - -Changelog for v2.17.4 ---------------------- - -* bug #5379 PhpUnitMethodCasingFixer - Do not modify class name (localheinz) -* bug #5404 NullableTypeTransformer - constructor property promotion support (Wirone) -* bug #5433 PhpUnitTestCaseStaticMethodCallsFixer - fix for abstract static method (kubawerlos) -* minor #5234 DX: Add Docker dev setup (julienfalque, keradus) -* minor #5391 PhpdocOrderByValueFixer - Add additional annotations to sort (localheinz) -* minor #5392 PhpdocScalarFixer - Fix description (localheinz) -* minor #5397 NoExtraBlankLinesFixer - PHP8 throw support (SpacePossum) -* minor #5399 Add PHP8 integration test (keradus) -* minor #5405 TypeAlternationTransformer - add support for PHP8 (SpacePossum) -* minor #5406 SingleSpaceAfterConstructFixer - Attributes, comments and PHPDoc support (SpacePossum) -* minor #5407 TokensAnalyzer::getClassyElements - return trait imports (SpacePossum) -* minor #5410 minors (SpacePossum) -* minor #5411 bump year in LICENSE file (SpacePossum) -* minor #5414 TypeAlternationTransformer - T_FN support (SpacePossum) -* minor #5415 Forbid execution under PHP 8.0.0 (keradus) -* minor #5416 Drop Travis CI (keradus) -* minor #5419 CI: separate SCA checks to dedicated jobs (keradus) -* minor #5420 DX: unblock PHPUnit 9.5 (keradus) -* minor #5423 DX: PHPUnit - disable verbose by default (keradus) -* minor #5425 Cleanup 3.0 todos (keradus) -* minor #5427 Plan changing defaults for array_syntax and list_syntax in 3.0 release (keradus) -* minor #5429 DX: Drop speedtrap PHPUnit listener (keradus) -* minor #5432 Don't allow unserializing classes with a destructor (jderusse) -* minor #5435 DX: PHPUnit - groom configuration of time limits (keradus) -* minor #5439 VisibilityRequiredFixer - support type alternation for properties (keradus) -* minor #5442 DX: FunctionsAnalyzerTest - add missing 7.0 requirement (keradus) - -Changelog for v2.17.3 ---------------------- - -* bug #5384 PsrAutoloadingFixer - do not remove directory structure from the Class name (kubawerlos, keradus) -* bug #5385 SingleLineCommentStyleFixer- run before NoUselessReturnFixer (kubawerlos) -* bug #5387 SingleSpaceAfterConstructFixer - do not touch multi line implements (SpacePossum) -* minor #5329 DX: collect coverage with Github Actions (kubawerlos) -* minor #5380 PhpdocOrderByValueFixer - Allow sorting of throws annotations by value (localheinz, keradus) -* minor #5383 DX: fail PHPUnit tests on warning (kubawerlos) -* minor #5386 DX: remove incorrect priority relations (kubawerlos) - -Changelog for v2.17.2 ---------------------- - -* bug #5345 CleanNamespaceFixer - preserve trailing comments (SpacePossum) -* bug #5348 PsrAutoloadingFixer - fix for class without namespace (kubawerlos) -* bug #5362 SingleSpaceAfterConstructFixer: Do not adjust whitespace before multiple multi-line extends (localheinz, SpacePossum) -* minor #5314 Enable testing with PHPUnit 9.x (sanmai) -* minor #5319 Clean ups (SpacePossum) -* minor #5338 clean ups (SpacePossum) -* minor #5339 NoEmptyStatementFixer - fix more cases (SpacePossum) -* minor #5340 NamedArgumentTransformer - Introduction (SpacePossum) -* minor #5344 Update docs: do not use deprecated create method (SpacePossum) -* minor #5353 Fix typo in issue template (stof) -* minor #5355 OrderedTraitsFixer - mark as risky (SpacePossum) -* minor #5356 RuleSet description fixes (SpacePossum) -* minor #5359 Add application version to "fix" out put when verbosity flag is set (SpacePossum) -* minor #5360 DX: clean up detectIndent methods (kubawerlos) -* minor #5363 Added missing self return type to ConfigInterface::registerCustomFixers() (vudaltsov) -* minor #5366 PhpUnitDedicateAssertInternalTypeFixer - recover target option (keradus) -* minor #5368 DX: PHPUnit 9 compatibility for 2.17 (keradus) -* minor #5370 DX: update PHPUnit usage to use external Prophecy trait and solve warning (keradus) -* minor #5371 Update documentation about PHP_CS_FIXER_IGNORE_ENV (SanderSander, keradus) -* minor #5373 DX: MagicMethodCasingFixerTest - fix test case description (keradus) -* minor #5374 DX: PhpUnitDedicateAssertInternalTypeFixer - add code sample for non-default config (keradus) - -Changelog for v2.17.1 ---------------------- - -* bug #5325 NoBreakCommentFixer - better throw handling (SpacePossum) -* bug #5327 StaticLambdaFixer - fix for arrow function used in class with $this (kubawerlos, SpacePossum) -* bug #5332 Fix file missing for php8 (jderusse) -* bug #5333 Fix file missing for php8 (jderusse) -* minor #5328 Fixed deprecation message version (GrahamCampbell) -* minor #5330 DX: cleanup Github Actions configs (kubawerlos) - -Changelog for v2.17.0 ---------------------- - -* bug #4752 SimpleLambdaCallFixer - bug fixes (SpacePossum) -* bug #4794 TernaryToElvisOperatorFixer - fix open tag with echo (SpacePossum) -* bug #5084 Fix for variables within string interpolation in lambda_not_used_import (GrahamCampbell) -* bug #5094 SwitchContinueToBreakFixer - do not support alternative syntax (SpacePossum) -* feature #2619 PSR-5 @inheritDoc support (julienfalque) -* feature #3253 Add SimplifiedIfReturnFixer (Slamdunk, SpacePossum) -* feature #4005 GroupImportFixer - introduction (greeflas) -* feature #4012 BracesFixer - add "allow_single_line_anonymous_class_with_empty_body" option (kubawerlos) -* feature #4021 OperatorLinebreakFixer - Introduction (kubawerlos, SpacePossum) -* feature #4259 PsrAutoloadingFixer - introduction (kubawerlos) -* feature #4375 extend ruleset "@PHP73Migration" (gharlan) -* feature #4435 SingleSpaceAfterConstructFixer - Introduction (localheinz) -* feature #4493 Add echo_tag_syntax rule (mlocati, kubawerlos) -* feature #4544 SimpleLambdaCallFixer - introduction (keradus) -* feature #4569 PhpdocOrderByValueFixer - Introduction (localheinz) -* feature #4590 SwitchContinueToBreakFixer - Introduction (SpacePossum) -* feature #4679 NativeConstantInvocationFixer - add "strict" flag (kubawerlos) -* feature #4701 OrderedTraitsFixer - introduction (julienfalque) -* feature #4704 LambdaNotUsedImportFixer - introduction (SpacePossum) -* feature #4740 NoAliasLanguageConstructCallFixer - introduction (SpacePossum) -* feature #4741 TernaryToElvisOperatorFixer - introduction (SpacePossum) -* feature #4778 UseArrowFunctionsFixer - introduction (gharlan) -* feature #4790 ArrayPushFixer - introduction (SpacePossum) -* feature #4800 NoUnneededFinalMethodFixer - Add "private_methods" option (SpacePossum) -* feature #4831 BlankLineBeforeStatementFixer - add yield from (SpacePossum) -* feature #4832 NoUnneededControlParenthesesFixer - add yield from (SpacePossum) -* feature #4863 NoTrailingWhitespaceInStringFixer - introduction (gharlan) -* feature #4875 ClassAttributesSeparationFixer - add option for no new lines between properties (adri, ruudk) -* feature #4880 HeredocIndentationFixer - config option for indentation level (gharlan) -* feature #4908 PhpUnitExpectationFixer - update for Phpunit 8.4 (ktomk) -* feature #4942 OrderedClassElementsFixer - added support for abstract method sorting (carlalexander, SpacePossum) -* feature #4947 NativeConstantInvocation - Add "PHP_INT_SIZE" to SF rule set (kubawerlos) -* feature #4953 Add support for custom differ (paulhenri-l, SpacePossum) -* feature #5264 CleanNamespaceFixer - Introduction (SpacePossum) -* feature #5280 NoUselessSprintfFixer - Introduction (SpacePossum) -* minor #4634 Make all options snake_case (kubawerlos) -* minor #4667 PhpUnitOrderedCoversFixer - stop using deprecated fixer (keradus) -* minor #4673 FinalStaticAccessFixer - deprecate (julienfalque) -* minor #4762 Rename simple_lambda_call to regular_callable_call (julienfalque) -* minor #4782 Update RuleSets (SpacePossum) -* minor #4802 Master cleanup (SpacePossum) -* minor #4828 Deprecate Config::create() (DocFX) -* minor #4872 Update RuleSet SF and PHP-CS-Fixer with new config for `no_extra_blan… (SpacePossum) -* minor #4900 Move "no_trailing_whitespace_in_string" to SF ruleset. (SpacePossum) -* minor #4903 Docs: extend regular_callable_call rule docs (keradus, SpacePossum) -* minor #4910 Add use_arrow_functions rule to PHP74Migration:risky set (keradus) -* minor #5025 PhpUnitDedicateAssertInternalTypeFixer - deprecate "target" option (kubawerlos) -* minor #5037 FinalInternalClassFixer- Rename option (SpacePossum) -* minor #5093 LambdaNotUsedImportFixer - add heredoc test (SpacePossum) -* minor #5163 Fix CS (SpacePossum) -* minor #5169 PHP8 care package master (SpacePossum) -* minor #5186 Fix tests (SpacePossum) -* minor #5192 GotoLabelAnalyzer - introduction (SpacePossum) -* minor #5230 Fix: Reference (localheinz) -* minor #5240 PHP8 - Allow trailing comma in parameter list support (SpacePossum) -* minor #5244 Fix 2.17 build (keradus) -* minor #5251 PHP8 - match support (SpacePossum) -* minor #5252 Update RuleSets (SpacePossum) -* minor #5278 PHP8 constructor property promotion support (SpacePossum) -* minor #5284 PHP8 - Attribute support (SpacePossum) -* minor #5323 NoUselessSprintfFixer - Fix test on PHP5.6 (SpacePossum) -* minor #5326 DX: relax composer requirements to not block installation under PHP v8, support for PHP v8 is not yet ready (keradus) - -Changelog for v2.16.10 ----------------------- - -* minor #5314 Enable testing with PHPUnit 9.x (sanmai) -* minor #5338 clean ups (SpacePossum) -* minor #5339 NoEmptyStatementFixer - fix more cases (SpacePossum) -* minor #5340 NamedArgumentTransformer - Introduction (SpacePossum) -* minor #5344 Update docs: do not use deprecated create method (SpacePossum) -* minor #5356 RuleSet description fixes (SpacePossum) -* minor #5360 DX: clean up detectIndent methods (kubawerlos) -* minor #5370 DX: update PHPUnit usage to use external Prophecy trait and solve warning (keradus) -* minor #5373 DX: MagicMethodCasingFixerTest - fix test case description (keradus) -* minor #5374 DX: PhpUnitDedicateAssertInternalTypeFixer - add code sample for non-default config (keradus) - -Changelog for v2.16.9 ---------------------- - -* bug #5095 Annotation - fix for Windows line endings (SpacePossum) -* bug #5221 NoSuperfluousPhpdocTagsFixer - fix for single line PHPDoc (kubawerlos) -* bug #5225 TernaryOperatorSpacesFixer - fix for alternative control structures (kubawerlos) -* bug #5235 ArrayIndentationFixer - fix for nested arrays (kubawerlos) -* bug #5248 NoBreakCommentFixer - fix throw detect (SpacePossum) -* bug #5250 SwitchAnalyzer - fix for semicolon after case/default (kubawerlos) -* bug #5253 IO - fix cache info message (SpacePossum) -* bug #5273 Fix PHPDoc line span fixer when property has array typehint (ossinkine) -* bug #5274 TernaryToNullCoalescingFixer - concat precedence fix (SpacePossum) -* feature #5216 Add RuleSets to docs (SpacePossum) -* minor #5226 Applied CS fixes from 2.17-dev (GrahamCampbell) -* minor #5229 Fixed incorrect phpdoc (GrahamCampbell) -* minor #5231 CS: unify styling with younger branches (keradus) -* minor #5232 PHP8 - throw expression support (SpacePossum) -* minor #5233 DX: simplify check_file_permissions.sh (kubawerlos) -* minor #5236 Improve handling of unavailable code samples (julienfalque, keradus) -* minor #5239 PHP8 - Allow trailing comma in parameter list support (SpacePossum) -* minor #5254 PHP8 - mixed type support (SpacePossum) -* minor #5255 Tests: do not skip documentation test (keradus) -* minor #5256 Docs: phpdoc_to_return_type - add new example in docs (keradus) -* minor #5261 Do not update Composer twice (sanmai) -* minor #5263 PHP8 support (SpacePossum) -* minor #5266 PhpUnitTestCaseStaticMethodCallsFixer - PHPUnit 9.x support (sanmai) -* minor #5267 Improve InstallViaComposerTest (sanmai) -* minor #5268 Add GitHub Workflows CI, including testing on PHP 8 and on macOS/Windows/Ubuntu (sanmai) -* minor #5269 Prep work to migrate to PHPUnit 9.x (sanmai, keradus) -* minor #5275 remove not supported verbose options (SpacePossum) -* minor #5276 PHP8 - add NoUnreachableDefaultArgumentValueFixer to risky set (SpacePossum) -* minor #5277 PHP8 - Constructor Property Promotion support (SpacePossum) -* minor #5292 Disable blank issue template and expose community chat (keradus) -* minor #5293 Add documentation to "yoda_style" sniff to convert Yoda style to non-Yoda style (Luc45) -* minor #5295 Run static code analysis off GitHub Actions (sanmai) -* minor #5298 Add yamllint workflow, validates .yaml files (sanmai) -* minor #5302 SingleLineCommentStyleFixer - do not fix possible attributes (PHP8) (SpacePossum) -* minor #5303 Drop CircleCI and AppVeyor (keradus) -* minor #5304 DX: rename TravisTest, as we no longer test only Travis there (keradus) -* minor #5305 Groom GitHub CI and move some checks from TravisCI to GitHub CI (keradus) -* minor #5308 Only run yamllint when a YAML file is changed (julienfalque, keradus) -* minor #5309 CICD: create yamllint config file (keradus) -* minor #5311 OrderedClassElementsFixer - PHPUnit Bridge support (ktomk) -* minor #5316 PHP8 - Attribute support (SpacePossum) -* minor #5321 DX: little code grooming (keradus) - -Changelog for v2.16.8 ---------------------- - -* bug #5325 NoBreakCommentFixer - better throw handling (SpacePossum) -* bug #5327 StaticLambdaFixer - fix for arrow function used in class with $this (kubawerlos, SpacePossum) -* bug #5333 Fix file missing for php8 (jderusse) -* minor #5328 Fixed deprecation message version (GrahamCampbell) -* minor #5330 DX: cleanup Github Actions configs (kubawerlos) - -Changelog for v2.16.5 ---------------------- - -* bug #4378 PhpUnitNoExpectationAnnotationFixer - annotation in single line doc comment (kubawerlos) -* bug #4936 HeaderCommentFixer - Fix unexpected removal of regular comments (julienfalque) -* bug #5006 PhpdocToParamTypeFixer - fix for breaking PHP syntax for type having reserved name (kubawerlos) -* bug #5016 NoSuperfluousPhpdocTagsFixer - fix for @return with @inheritDoc in description (kubawerlos) -* bug #5017 PhpdocTrimConsecutiveBlankLineSeparationFixer - must run after AlignMultilineCommentFixer (kubawerlos) -* bug #5032 SingleLineAfterImportsFixer - fix for line after import (and before another import) already added using CRLF (kubawerlos) -* bug #5033 VoidReturnFixer - must run after NoSuperfluousPhpdocTagsFixer (kubawerlos) -* bug #5038 HelpCommandTest - toString nested array (SpacePossum) -* bug #5040 LinebreakAfterOpeningTagFixer - do not change code if linebreak already present (kubawerlos) -* bug #5044 StandardizeIncrementFixer - fix handling static properties (kubawerlos) -* bug #5045 BacktickToShellExecFixer - add priority relation to NativeFunctionInvocationFixer and SingleQuoteFixer (kubawerlos) -* bug #5054 PhpdocTypesFixer - fix for multidimensional array (kubawerlos) -* bug #5065 TernaryOperatorSpacesFixer - fix for discovering ":" correctly (kubawerlos) -* bug #5068 Fixed php-cs-fixer crashes on input file syntax error (GrahamCampbell) -* bug #5087 NoAlternativeSyntaxFixer - add support for switch and declare (SpacePossum) -* bug #5092 PhpdocToParamTypeFixer - remove not used option (SpacePossum) -* bug #5105 ClassKeywordRemoveFixer - fix for fully qualified class (kubawerlos) -* bug #5113 TernaryOperatorSpacesFixer - handle goto labels (SpacePossum) -* bug #5124 Fix TernaryToNullCoalescingFixer when dealing with object properties (HypeMC) -* bug #5137 DoctrineAnnotationSpacesFixer - fix for typed properties (kubawerlos) -* bug #5180 Always lint test cases with the stricter process linter (GrahamCampbell) -* bug #5190 PhpUnit*Fixers - Only fix in unit test class scope (SpacePossum) -* bug #5195 YodaStyle - statements in braces should be treated as variables in strict … (SpacePossum) -* bug #5220 NoUnneededFinalMethodFixer - do not fix private constructors (SpacePossum) -* feature #3475 Rework documentation (julienfalque, SpacePossum) -* feature #5166 PHP8 (SpacePossum) -* minor #4878 ArrayIndentationFixer - refactor (julienfalque) -* minor #5031 CI: skip_cleanup: true (keradus) -* minor #5035 PhpdocToParamTypeFixer - Rename attribute (SpacePossum) -* minor #5048 Allow composer/semver ^2.0 and ^3.0 (thomasvargiu) -* minor #5050 DX: moving integration test for braces, indentation_type and no_break_comment into right place (kubawerlos) -* minor #5051 DX: move all tests from AutoReview\FixerTest to Test\AbstractFixerTestCase (kubawerlos) -* minor #5053 DX: cleanup FunctionTypehintSpaceFixer (kubawerlos) -* minor #5056 DX: add missing priority test for indentation_type and phpdoc_indent (kubawerlos) -* minor #5077 DX: add missing priority test between NoUnsetCastFixer and BinaryOperatorSpacesFixer (kubawerlos) -* minor #5083 Update composer.json to prevent issue #5030 (mvorisek) -* minor #5088 NoBreakCommentFixer - NoUselessElseFixer - priority test (SpacePossum) -* minor #5100 Fixed invalid PHP 5.6 syntax (GrahamCampbell) -* minor #5106 Symfony's finder already ignores vcs and dot files by default (GrahamCampbell) -* minor #5112 DX: check file permissions (kubawerlos, SpacePossum) -* minor #5122 Show runtime PHP version (kubawerlos) -* minor #5132 Do not allow assignments in if statements (SpacePossum) -* minor #5133 RuleSetTest - Early return for boolean and detect more defaults (SpacePossum) -* minor #5139 revert some unneeded exclusions (SpacePossum) -* minor #5148 Upgrade Xcode (kubawerlos) -* minor #5149 NoUnsetOnPropertyFixer - risky description tweaks (SpacePossum) -* minor #5161 minors (SpacePossum) -* minor #5170 Fix test on PHP8 (SpacePossum) -* minor #5172 Remove accidentally inserted newlines (GrahamCampbell) -* minor #5173 Fix PHP8 RuleSet inherit (SpacePossum) -* minor #5174 Corrected linting error messages (GrahamCampbell) -* minor #5177 PHP8 (SpacePossum) -* minor #5178 Fix tests (SpacePossum) -* minor #5184 [FinalStaticAccessFixer] Handle new static() in final class (localheinz) -* minor #5188 DX: Update sibling debs to version supporting PHP8/PHPUnit9 (keradus) -* minor #5189 Create temporary linting file in system temp dir (keradus) -* minor #5191 MethodArgumentSpaceFixer - support use/import of anonymous functions. (undefinedor) -* minor #5193 DX: add AbstractPhpUnitFixer (kubawerlos) -* minor #5204 DX: cleanup NullableTypeTransformerTest (kubawerlos) -* minor #5207 Add © for logo (keradus) -* minor #5208 DX: cleanup php-cs-fixer entry file (keradus) -* minor #5210 CICD - temporarily disable problematic test (keradus) -* minor #5211 CICD: fix file permissions (keradus) -* minor #5213 DX: move report schemas to dedicated dir (keradus) -* minor #5214 CICD: fix file permissions (keradus) -* minor #5215 CICD: update checkbashisms (keradus) -* minor #5217 CICD: use Composer v2 and drop hirak/prestissimo plugin (keradus) -* minor #5218 DX: .gitignore - add .phpunit.result.cache (keradus) -* minor #5222 Upgrade Xcode (kubawerlos) -* minor #5223 Docs: regenerate docs on 2.16 line (keradus) - -Changelog for v2.16.4 ---------------------- - -* bug #3893 Fix handling /** and */ on the same line as the first and/or last annotation (dmvdbrugge) -* bug #4919 PhpUnitTestAnnotationFixer - fix function starting with "test" and having lowercase letter after (kubawerlos) -* bug #4929 YodaStyleFixer - handling equals empty array (kubawerlos) -* bug #4934 YodaStyleFixer - fix for conditions weird are (kubawerlos) -* bug #4958 OrderedImportsFixer - fix for trailing comma in group (kubawerlos) -* bug #4959 BlankLineBeforeStatementFixer - handle comment case (SpacePossum) -* bug #4962 MethodArgumentSpaceFixer - must run after MethodChainingIndentationFixer (kubawerlos) -* bug #4963 PhpdocToReturnTypeFixer - fix for breaking PHP syntax for type having reserved name (kubawerlos, Slamdunk) -* bug #4978 ArrayIndentationFixer - must run after MethodArgumentSpaceFixer (kubawerlos) -* bug #4994 FinalInternalClassFixer - must run before ProtectedToPrivateFixer (kubawerlos) -* bug #4996 NoEmptyCommentFixer - handle multiline comments (kubawerlos) -* bug #4999 BlankLineBeforeStatementFixer - better comment handling (SpacePossum) -* bug #5009 NoEmptyCommentFixer - better handle comments sequence (kubawerlos) -* bug #5010 SimplifiedNullReturnFixer - must run before VoidReturnFixer (kubawerlos) -* bug #5011 SingleClassElementPerStatementFixer - must run before ClassAttributesSeparationFixer (kubawerlos) -* bug #5012 StrictParamFixer - must run before NativeFunctionInvocationFixer (kubawerlos) -* bug #5014 PhpdocToParamTypeFixer - fix for void as param (kubawerlos) -* bug #5018 PhpdocScalarFixer - fix for comment with Windows line endings (kubawerlos) -* bug #5029 SingleLineAfterImportsFixer - fix for line after import already added using CRLF (kubawerlos) -* minor #4904 Increase PHPStan level to 8 with strict rules (julienfalque) -* minor #4920 Enhancement: Use DocBlock itself to make it multi-line (localheinz) -* minor #4930 DX: ensure PhpUnitNamespacedFixer handles all classes (kubawerlos) -* minor #4931 DX: add test to ensure each target version in PhpUnitTargetVersion has its set in RuleSet (kubawerlos) -* minor #4932 DX: Travis CI config - fix warnings and infos (kubawerlos) -* minor #4940 Reject empty path (julienfalque) -* minor #4944 Fix grammar (julienfalque) -* minor #4946 Allow "const" option on PHP <7.1 (julienfalque) -* minor #4948 Added describe command to readme (david, 8ctopus) -* minor #4949 Fixed build readme on Windows fails if using Git Bash (Mintty) (8ctopus) -* minor #4954 Config - Trim path (julienfalque) -* minor #4957 DX: Check trailing spaces in project files only (ktomk) -* minor #4961 Assert all project source files are monolithic. (SpacePossum) -* minor #4964 Fix PHPStan baseline (julienfalque) -* minor #4965 Fix PHPStan baseline (julienfalque) -* minor #4973 DX: test "isRisky" method in fixer tests, not as auto review (kubawerlos) -* minor #4974 Minor: Fix typo (ktomk) -* minor #4975 Revert PHPStan level to 5 (julienfalque) -* minor #4976 Add instructions for PHPStan (julienfalque) -* minor #4980 Introduce new issue templates (julienfalque) -* minor #4981 Prevent error in CTTest::testConstants (for PHP8) (guilliamxavier) -* minor #4982 Remove PHIVE (kubawerlos) -* minor #4985 Fix tests with Symfony 5.1 (julienfalque) -* minor #4987 PhpdocAnnotationWithoutDotFixer - handle unicode characters using mb_* (SpacePossum) -* minor #5008 Enhancement: Social justification applied (gbyrka-fingo) -* minor #5023 Fix issue templates (kubawerlos) -* minor #5024 DX: add missing non-default code samples (kubawerlos) - -Changelog for v2.16.3 ---------------------- - -* bug #4915 Fix handling property PHPDocs with unsupported type (julienfalque) -* minor #4916 Fix AppVeyor build (julienfalque) -* minor #4917 CircleCI - Bump xcode to 11.4 (GrahamCampbell) -* minor #4918 DX: do not fix ".phpt" files by default (kubawerlos) - -Changelog for v2.16.2 ---------------------- - -* bug #3820 Braces - (re)indenting comment issues (SpacePossum) -* bug #3911 PhpdocVarWithoutNameFixer - fix for properties only (dmvdbrugge) -* bug #4601 ClassKeywordRemoveFixer - Fix for namespace (yassine-ah, kubawerlos) -* bug #4630 FullyQualifiedStrictTypesFixer - Ignore partial class names which look like FQCNs (localheinz, SpacePossum) -* bug #4661 ExplicitStringVariableFixer - variables pair if one is already explicit (kubawerlos) -* bug #4675 NonPrintableCharacterFixer - fix for backslash and quotes when changing to escape sequences (kubawerlos) -* bug #4678 TokensAnalyzer::isConstantInvocation - fix for importing multiple classes with single "use" (kubawerlos) -* bug #4682 Fix handling array type declaration in properties (julienfalque) -* bug #4685 Improve Symfony 5 compatibility (keradus) -* bug #4688 TokensAnalyzer::isConstantInvocation - Fix detection for fully qualified return type (julienfalque) -* bug #4689 DeclareStrictTypesFixer - fix for "strict_types" set to "0" (kubawerlos) -* bug #4690 PhpdocVarAnnotationCorrectOrderFixer - fix for multiline `@var` without type (kubawerlos) -* bug #4710 SingleTraitInsertPerStatement - fix formatting for multiline "use" (kubawerlos) -* bug #4711 Ensure that files from "tests" directory in release are autoloaded (kubawerlos) -* bug #4749 TokensAnalyze::isUnaryPredecessorOperator fix for CT::T_ARRAY_INDEX_C… (SpacePossum) -* bug #4759 Add more priority cases (SpacePossum) -* bug #4761 NoSuperfluousElseifFixer - handle single line (SpacePossum) -* bug #4783 NoSuperfluousPhpdocTagsFixer - fix for really big PHPDoc (kubawerlos, mvorisek) -* bug #4787 NoUnneededFinalMethodFixer - Mark as risky (SpacePossum) -* bug #4795 OrderedClassElementsFixer - Fix (SpacePossum) -* bug #4801 GlobalNamespaceImportFixer - fix docblock handling (gharlan) -* bug #4804 TokensAnalyzer::isUnarySuccessorOperator fix for array curly braces (SpacePossum) -* bug #4807 IncrementStyleFixer - handle after ")" (SpacePossum) -* bug #4808 Modernize types casting fixer array curly (SpacePossum) -* bug #4809 Fix "braces" and "method_argument_space" priority (julienfalque) -* bug #4813 BracesFixer - fix invalid code generation on alternative syntax (SpacePossum) -* bug #4822 fix 2 bugs in phpdoc_line_span (lmichelin) -* bug #4823 ReturnAssignmentFixer - repeat fix (SpacePossum) -* bug #4824 NoUnusedImportsFixer - SingleLineAfterImportsFixer - fix priority (SpacePossum) -* bug #4825 GlobalNamespaceImportFixer - do not import global into global (SpacePossum) -* bug #4829 YodaStyleFixer - fix precedence for T_MOD_EQUAL and T_COALESCE_EQUAL (SpacePossum) -* bug #4830 TernaryToNullCoalescingFixer - handle yield from (SpacePossum) -* bug #4835 Remove duplicate "function_to_constant" from RuleSet (SpacePossum) -* bug #4840 LineEndingFixer - T_CLOSE_TAG support, StringLineEndingFixer - T_INLI… (SpacePossum) -* bug #4846 FunctionsAnalyzer - better isGlobalFunctionCall detection (SpacePossum) -* bug #4852 Priority issues (SpacePossum) -* bug #4870 HeaderCommentFixer - do not remove class docs (gharlan) -* bug #4871 NoExtraBlankLinesFixer - handle cases on same line (SpacePossum) -* bug #4895 Fix conflict between header_comment and declare_strict_types (BackEndTea, julienfalque) -* bug #4911 PhpdocSeparationFixer - fix regression with lack of next line (keradus) -* feature #4742 FunctionToConstantFixer - get_class($this) support (SpacePossum) -* minor #4377 CommentsAnalyzer - fix for declare before header comment (kubawerlos) -* minor #4636 DX: do not check for PHPDBG when collecting coverage (kubawerlos) -* minor #4644 Docs: add info about "-vv..." (voku) -* minor #4691 Run Travis CI on stable PHP 7.4 (kubawerlos) -* minor #4693 Increase Travis CI Git clone depth (julienfalque) -* minor #4699 LineEndingFixer - handle "\r\r\n" (kubawerlos) -* minor #4703 NoSuperfluousPhpdocTagsFixer,PhpdocAddMissingParamAnnotationFixer - p… (SpacePossum) -* minor #4707 Fix typos (TysonAndre) -* minor #4712 NoBlankLinesAfterPhpdocFixer — Do not strip newline between docblock and use statements (mollierobbert) -* minor #4715 Enhancement: Install ergebnis/composer-normalize via Phive (localheinz) -* minor #4722 Fix Circle CI build (julienfalque) -* minor #4724 DX: Simplify installing PCOV (kubawerlos) -* minor #4736 NoUnusedImportsFixer - do not match variable name as import (SpacePossum) -* minor #4746 NoSuperfluousPhpdocTagsFixer - Remove for typed properties (PHP 7.4) (ruudk) -* minor #4753 Do not apply any text/.git filters to fixtures (mvorisek) -* minor #4757 Test $expected is used before $input (SpacePossum) -* minor #4758 Autoreview the PHPDoc of *Fixer::getPriority based on the priority map (SpacePossum) -* minor #4765 Add test on some return types (SpacePossum) -* minor #4766 Remove false test skip (SpacePossum) -* minor #4767 Remove useless priority comments (kubawerlos) -* minor #4769 DX: add missing priority tests (kubawerlos) -* minor #4772 NoUnneededFinalMethodFixer - update description (kubawerlos) -* minor #4774 DX: simplify Utils::camelCaseToUnderscore (kubawerlos) -* minor #4781 NoUnneededCurlyBracesFixer - handle namespaces (SpacePossum) -* minor #4784 Travis CI - Use multiple keyservers (ktomk) -* minor #4785 Improve static analysis (enumag) -* minor #4788 Configurable fixers code sample (SpacePossum) -* minor #4791 Increase PHPStan level to 3 (julienfalque) -* minor #4797 clean ups (SpacePossum) -* minor #4803 FinalClassFixer - Doctrine\ORM\Mapping as ORM alias should not be required (localheinz) -* minor #4839 2.15 - clean ups (SpacePossum) -* minor #4842 ReturnAssignmentFixer - Support more cases (julienfalque) -* minor #4843 NoSuperfluousPhpdocTagsFixer - fix typo in option description (OndraM) -* minor #4844 Same requirements for descriptions (SpacePossum) -* minor #4849 Increase PHPStan level to 5 (julienfalque) -* minor #4850 Fix phpstan (SpacePossum) -* minor #4857 Fixed the unit tests (GrahamCampbell) -* minor #4865 Use latest xcode image (GrahamCampbell) -* minor #4892 CombineNestedDirnameFixer - Add space after comma (julienfalque) -* minor #4894 DX: PhpdocToParamTypeFixer - improve typing (keradus) -* minor #4898 FixerTest - yield the data in AutoReview (Nyholm) -* minor #4899 Fix exception message format for fabbot.io (SpacePossum) -* minor #4905 Support composer v2 installed.json files (GrahamCampbell) -* minor #4906 CI: use Composer stable release for AppVeyor (kubawerlos) -* minor #4909 DX: HeaderCommentFixer - use non-aliased version of option name in code (keradus) -* minor #4912 CI: Fix AppVeyor integration (keradus) - -Changelog for v2.16.1 ---------------------- - -* bug #4476 FunctionsAnalyzer - add "isTheSameClassCall" for correct verifying of function calls (kubawerlos) -* bug #4605 PhpdocToParamTypeFixer - cover more cases (keradus, julienfalque) -* bug #4626 FinalPublicMethodForAbstractClassFixer - Do not attempt to mark abstract public methods as final (localheinz) -* bug #4632 NullableTypeDeclarationForDefaultNullValueFixer - fix for not lowercase "null" (kubawerlos) -* bug #4638 Ensure compatibility with PHP 7.4 (julienfalque) -* bug #4641 Add typed properties test to VisibilityRequiredFixerTest (GawainLynch, julienfalque) -* bug #4654 ArrayIndentationFixer - Fix array indentation for multiline values (julienfalque) -* bug #4660 TokensAnalyzer::isConstantInvocation - fix for extending multiple interfaces (kubawerlos) -* bug #4668 TokensAnalyzer::isConstantInvocation - fix for interface method return type (kubawerlos) -* minor #4608 Allow Symfony 5 components (l-vo) -* minor #4622 Disallow PHP 7.4 failures on Travis CI (julienfalque) -* minor #4623 README - Mark up as code (localheinz) -* minor #4637 PHP 7.4 integration test (GawainLynch, julienfalque) -* minor #4643 DX: Update .gitattributes and move ci-integration.sh to root of the project (kubawerlos, keradus) -* minor #4645 Check PHP extensions on runtime (kubawerlos) -* minor #4655 Improve docs - README (mvorisek) -* minor #4662 DX: generate headers in README.rst (kubawerlos) -* minor #4669 Enable execution under PHP 7.4 (keradus) -* minor #4670 TravisTest - rewrite tests to allow last supported by tool PHP version to be snapshot (keradus) -* minor #4671 TravisTest - rewrite tests to allow last supported by tool PHP version to be snapshot (keradus) - -Changelog for v2.16.0 ---------------------- - -* feature #3810 PhpdocLineSpanFixer - Introduction (BackEndTea) -* feature #3928 Add FinalPublicMethodForAbstractClassFixer (Slamdunk) -* feature #4000 FinalStaticAccessFixer - Introduction (ntzm) -* feature #4275 Issue #4274: Let lowercase_constants directive to be configurable. (drupol) -* feature #4355 GlobalNamespaceImportFixer - Introduction (gharlan) -* feature #4358 SelfStaticAccessorFixer - Introduction (SpacePossum) -* feature #4385 CommentToPhpdocFixer - allow to ignore tags (kubawerlos) -* feature #4401 Add NullableTypeDeclarationForDefaultNullValueFixer (HypeMC) -* feature #4452 Add SingleLineThrowFixer (kubawerlos) -* feature #4500 NoSuperfluousPhpdocTags - Add remove_inheritdoc option (julienfalque) -* feature #4505 NoSuperfluousPhpdocTagsFixer - allow params that aren't on the signature (azjezz) -* feature #4531 PhpdocAlignFixer - add "property-read" and "property-write" to allowed tags (kubawerlos) -* feature #4583 Phpdoc to param type fixer rebase (jg-development) -* minor #4033 Raise deprecation warnings on usage of deprecated aliases (ntzm) -* minor #4423 DX: update branch alias (keradus) -* minor #4537 SelfStaticAccessor - extend itests (keradus) -* minor #4607 Configure no_superfluous_phpdoc_tags for Symfony (keradus) -* minor #4618 DX: fix usage of deprecated options (0x450x6c) -* minor #4619 Fix PHP 7.3 strict mode warnings (keradus) -* minor #4621 Add single_line_throw to Symfony ruleset (keradus) - -Changelog for v2.15.10 ----------------------- - -* bug #5095 Annotation - fix for Windows line endings (SpacePossum) -* bug #5221 NoSuperfluousPhpdocTagsFixer - fix for single line PHPDoc (kubawerlos) -* bug #5225 TernaryOperatorSpacesFixer - fix for alternative control structures (kubawerlos) -* bug #5235 ArrayIndentationFixer - fix for nested arrays (kubawerlos) -* bug #5248 NoBreakCommentFixer - fix throw detect (SpacePossum) -* bug #5250 SwitchAnalyzer - fix for semicolon after case/default (kubawerlos) -* bug #5253 IO - fix cache info message (SpacePossum) -* bug #5274 TernaryToNullCoalescingFixer - concat precedence fix (SpacePossum) -* feature #5216 Add RuleSets to docs (SpacePossum) -* minor #5226 Applied CS fixes from 2.17-dev (GrahamCampbell) -* minor #5229 Fixed incorrect phpdoc (GrahamCampbell) -* minor #5231 CS: unify styling with younger branches (keradus) -* minor #5232 PHP8 - throw expression support (SpacePossum) -* minor #5233 DX: simplify check_file_permissions.sh (kubawerlos) -* minor #5236 Improve handling of unavailable code samples (julienfalque, keradus) -* minor #5239 PHP8 - Allow trailing comma in parameter list support (SpacePossum) -* minor #5254 PHP8 - mixed type support (SpacePossum) -* minor #5255 Tests: do not skip documentation test (keradus) -* minor #5261 Do not update Composer twice (sanmai) -* minor #5263 PHP8 support (SpacePossum) -* minor #5266 PhpUnitTestCaseStaticMethodCallsFixer - PHPUnit 9.x support (sanmai) -* minor #5267 Improve InstallViaComposerTest (sanmai) -* minor #5276 PHP8 - add NoUnreachableDefaultArgumentValueFixer to risky set (SpacePossum) - -Changelog for v2.15.9 ---------------------- - -* bug #4378 PhpUnitNoExpectationAnnotationFixer - annotation in single line doc comment (kubawerlos) -* bug #4936 HeaderCommentFixer - Fix unexpected removal of regular comments (julienfalque) -* bug #5017 PhpdocTrimConsecutiveBlankLineSeparationFixer - must run after AlignMultilineCommentFixer (kubawerlos) -* bug #5033 VoidReturnFixer - must run after NoSuperfluousPhpdocTagsFixer (kubawerlos) -* bug #5038 HelpCommandTest - toString nested array (SpacePossum) -* bug #5040 LinebreakAfterOpeningTagFixer - do not change code if linebreak already present (kubawerlos) -* bug #5044 StandardizeIncrementFixer - fix handling static properties (kubawerlos) -* bug #5045 BacktickToShellExecFixer - add priority relation to NativeFunctionInvocationFixer and SingleQuoteFixer (kubawerlos) -* bug #5054 PhpdocTypesFixer - fix for multidimensional array (kubawerlos) -* bug #5065 TernaryOperatorSpacesFixer - fix for discovering ":" correctly (kubawerlos) -* bug #5068 Fixed php-cs-fixer crashes on input file syntax error (GrahamCampbell) -* bug #5087 NoAlternativeSyntaxFixer - add support for switch and declare (SpacePossum) -* bug #5105 ClassKeywordRemoveFixer - fix for fully qualified class (kubawerlos) -* bug #5113 TernaryOperatorSpacesFixer - handle goto labels (SpacePossum) -* bug #5124 Fix TernaryToNullCoalescingFixer when dealing with object properties (HypeMC) -* bug #5137 DoctrineAnnotationSpacesFixer - fix for typed properties (kubawerlos) -* bug #5180 Always lint test cases with the stricter process linter (GrahamCampbell) -* bug #5190 PhpUnit*Fixers - Only fix in unit test class scope (SpacePossum) -* bug #5195 YodaStyle - statements in braces should be treated as variables in strict … (SpacePossum) -* bug #5220 NoUnneededFinalMethodFixer - do not fix private constructors (SpacePossum) -* feature #3475 Rework documentation (julienfalque, SpacePossum) -* feature #5166 PHP8 (SpacePossum) -* minor #4878 ArrayIndentationFixer - refactor (julienfalque) -* minor #5031 CI: skip_cleanup: true (keradus) -* minor #5048 Allow composer/semver ^2.0 and ^3.0 (thomasvargiu) -* minor #5050 DX: moving integration test for braces, indentation_type and no_break_comment into right place (kubawerlos) -* minor #5051 DX: move all tests from AutoReview\FixerTest to Test\AbstractFixerTestCase (kubawerlos) -* minor #5053 DX: cleanup FunctionTypehintSpaceFixer (kubawerlos) -* minor #5056 DX: add missing priority test for indentation_type and phpdoc_indent (kubawerlos) -* minor #5077 DX: add missing priority test between NoUnsetCastFixer and BinaryOperatorSpacesFixer (kubawerlos) -* minor #5083 Update composer.json to prevent issue #5030 (mvorisek) -* minor #5088 NoBreakCommentFixer - NoUselessElseFixer - priority test (SpacePossum) -* minor #5100 Fixed invalid PHP 5.6 syntax (GrahamCampbell) -* minor #5106 Symfony's finder already ignores vcs and dot files by default (GrahamCampbell) -* minor #5112 DX: check file permissions (kubawerlos, SpacePossum) -* minor #5122 Show runtime PHP version (kubawerlos) -* minor #5132 Do not allow assignments in if statements (SpacePossum) -* minor #5133 RuleSetTest - Early return for boolean and detect more defaults (SpacePossum) -* minor #5139 revert some unneeded exclusions (SpacePossum) -* minor #5148 Upgrade Xcode (kubawerlos) -* minor #5149 NoUnsetOnPropertyFixer - risky description tweaks (SpacePossum) -* minor #5161 minors (SpacePossum) -* minor #5172 Remove accidentally inserted newlines (GrahamCampbell) -* minor #5173 Fix PHP8 RuleSet inherit (SpacePossum) -* minor #5174 Corrected linting error messages (GrahamCampbell) -* minor #5177 PHP8 (SpacePossum) -* minor #5188 DX: Update sibling debs to version supporting PHP8/PHPUnit9 (keradus) -* minor #5189 Create temporary linting file in system temp dir (keradus) -* minor #5191 MethodArgumentSpaceFixer - support use/import of anonymous functions. (undefinedor) -* minor #5193 DX: add AbstractPhpUnitFixer (kubawerlos) -* minor #5204 DX: cleanup NullableTypeTransformerTest (kubawerlos) -* minor #5207 Add © for logo (keradus) -* minor #5208 DX: cleanup php-cs-fixer entry file (keradus) -* minor #5210 CICD - temporarily disable problematic test (keradus) -* minor #5211 CICD: fix file permissions (keradus) -* minor #5213 DX: move report schemas to dedicated dir (keradus) -* minor #5214 CICD: fix file permissions (keradus) -* minor #5215 CICD: update checkbashisms (keradus) -* minor #5217 CICD: use Composer v2 and drop hirak/prestissimo plugin (keradus) -* minor #5218 DX: .gitignore - add .phpunit.result.cache (keradus) -* minor #5222 Upgrade Xcode (kubawerlos) - -Changelog for v2.15.8 ---------------------- - -* bug #3893 Fix handling /** and */ on the same line as the first and/or last annotation (dmvdbrugge) -* bug #4919 PhpUnitTestAnnotationFixer - fix function starting with "test" and having lowercase letter after (kubawerlos) -* bug #4929 YodaStyleFixer - handling equals empty array (kubawerlos) -* bug #4934 YodaStyleFixer - fix for conditions weird are (kubawerlos) -* bug #4958 OrderedImportsFixer - fix for trailing comma in group (kubawerlos) -* bug #4959 BlankLineBeforeStatementFixer - handle comment case (SpacePossum) -* bug #4962 MethodArgumentSpaceFixer - must run after MethodChainingIndentationFixer (kubawerlos) -* bug #4963 PhpdocToReturnTypeFixer - fix for breaking PHP syntax for type having reserved name (kubawerlos, Slamdunk) -* bug #4978 ArrayIndentationFixer - must run after MethodArgumentSpaceFixer (kubawerlos) -* bug #4994 FinalInternalClassFixer - must run before ProtectedToPrivateFixer (kubawerlos) -* bug #4996 NoEmptyCommentFixer - handle multiline comments (kubawerlos) -* bug #4999 BlankLineBeforeStatementFixer - better comment handling (SpacePossum) -* bug #5009 NoEmptyCommentFixer - better handle comments sequence (kubawerlos) -* bug #5010 SimplifiedNullReturnFixer - must run before VoidReturnFixer (kubawerlos) -* bug #5011 SingleClassElementPerStatementFixer - must run before ClassAttributesSeparationFixer (kubawerlos) -* bug #5012 StrictParamFixer - must run before NativeFunctionInvocationFixer (kubawerlos) -* bug #5029 SingleLineAfterImportsFixer - fix for line after import already added using CRLF (kubawerlos) -* minor #4904 Increase PHPStan level to 8 with strict rules (julienfalque) -* minor #4930 DX: ensure PhpUnitNamespacedFixer handles all classes (kubawerlos) -* minor #4931 DX: add test to ensure each target version in PhpUnitTargetVersion has its set in RuleSet (kubawerlos) -* minor #4932 DX: Travis CI config - fix warnings and infos (kubawerlos) -* minor #4940 Reject empty path (julienfalque) -* minor #4944 Fix grammar (julienfalque) -* minor #4946 Allow "const" option on PHP <7.1 (julienfalque) -* minor #4948 Added describe command to readme (david, 8ctopus) -* minor #4949 Fixed build readme on Windows fails if using Git Bash (Mintty) (8ctopus) -* minor #4954 Config - Trim path (julienfalque) -* minor #4957 DX: Check trailing spaces in project files only (ktomk) -* minor #4961 Assert all project source files are monolithic. (SpacePossum) -* minor #4964 Fix PHPStan baseline (julienfalque) -* minor #4973 DX: test "isRisky" method in fixer tests, not as auto review (kubawerlos) -* minor #4974 Minor: Fix typo (ktomk) -* minor #4975 Revert PHPStan level to 5 (julienfalque) -* minor #4976 Add instructions for PHPStan (julienfalque) -* minor #4980 Introduce new issue templates (julienfalque) -* minor #4981 Prevent error in CTTest::testConstants (for PHP8) (guilliamxavier) -* minor #4982 Remove PHIVE (kubawerlos) -* minor #4985 Fix tests with Symfony 5.1 (julienfalque) -* minor #4987 PhpdocAnnotationWithoutDotFixer - handle unicode characters using mb_* (SpacePossum) -* minor #5008 Enhancement: Social justification applied (gbyrka-fingo) -* minor #5023 Fix issue templates (kubawerlos) -* minor #5024 DX: add missing non-default code samples (kubawerlos) - -Changelog for v2.15.7 ---------------------- - -* bug #4915 Fix handling property PHPDocs with unsupported type (julienfalque) -* minor #4916 Fix AppVeyor build (julienfalque) -* minor #4917 CircleCI - Bump xcode to 11.4 (GrahamCampbell) -* minor #4918 DX: do not fix ".phpt" files by default (kubawerlos) - -Changelog for v2.15.6 ---------------------- - -* bug #3820 Braces - (re)indenting comment issues (SpacePossum) -* bug #3911 PhpdocVarWithoutNameFixer - fix for properties only (dmvdbrugge) -* bug #4601 ClassKeywordRemoveFixer - Fix for namespace (yassine-ah, kubawerlos) -* bug #4630 FullyQualifiedStrictTypesFixer - Ignore partial class names which look like FQCNs (localheinz, SpacePossum) -* bug #4661 ExplicitStringVariableFixer - variables pair if one is already explicit (kubawerlos) -* bug #4675 NonPrintableCharacterFixer - fix for backslash and quotes when changing to escape sequences (kubawerlos) -* bug #4678 TokensAnalyzer::isConstantInvocation - fix for importing multiple classes with single "use" (kubawerlos) -* bug #4682 Fix handling array type declaration in properties (julienfalque) -* bug #4685 Improve Symfony 5 compatibility (keradus) -* bug #4688 TokensAnalyzer::isConstantInvocation - Fix detection for fully qualified return type (julienfalque) -* bug #4689 DeclareStrictTypesFixer - fix for "strict_types" set to "0" (kubawerlos) -* bug #4690 PhpdocVarAnnotationCorrectOrderFixer - fix for multiline `@var` without type (kubawerlos) -* bug #4710 SingleTraitInsertPerStatement - fix formatting for multiline "use" (kubawerlos) -* bug #4711 Ensure that files from "tests" directory in release are autoloaded (kubawerlos) -* bug #4749 TokensAnalyze::isUnaryPredecessorOperator fix for CT::T_ARRAY_INDEX_C… (SpacePossum) -* bug #4759 Add more priority cases (SpacePossum) -* bug #4761 NoSuperfluousElseifFixer - handle single line (SpacePossum) -* bug #4783 NoSuperfluousPhpdocTagsFixer - fix for really big PHPDoc (kubawerlos, mvorisek) -* bug #4787 NoUnneededFinalMethodFixer - Mark as risky (SpacePossum) -* bug #4795 OrderedClassElementsFixer - Fix (SpacePossum) -* bug #4804 TokensAnalyzer::isUnarySuccessorOperator fix for array curly braces (SpacePossum) -* bug #4807 IncrementStyleFixer - handle after ")" (SpacePossum) -* bug #4808 Modernize types casting fixer array curly (SpacePossum) -* bug #4809 Fix "braces" and "method_argument_space" priority (julienfalque) -* bug #4813 BracesFixer - fix invalid code generation on alternative syntax (SpacePossum) -* bug #4823 ReturnAssignmentFixer - repeat fix (SpacePossum) -* bug #4824 NoUnusedImportsFixer - SingleLineAfterImportsFixer - fix priority (SpacePossum) -* bug #4829 YodaStyleFixer - fix precedence for T_MOD_EQUAL and T_COALESCE_EQUAL (SpacePossum) -* bug #4830 TernaryToNullCoalescingFixer - handle yield from (SpacePossum) -* bug #4835 Remove duplicate "function_to_constant" from RuleSet (SpacePossum) -* bug #4840 LineEndingFixer - T_CLOSE_TAG support, StringLineEndingFixer - T_INLI… (SpacePossum) -* bug #4846 FunctionsAnalyzer - better isGlobalFunctionCall detection (SpacePossum) -* bug #4852 Priority issues (SpacePossum) -* bug #4870 HeaderCommentFixer - do not remove class docs (gharlan) -* bug #4871 NoExtraBlankLinesFixer - handle cases on same line (SpacePossum) -* bug #4895 Fix conflict between header_comment and declare_strict_types (BackEndTea, julienfalque) -* bug #4911 PhpdocSeparationFixer - fix regression with lack of next line (keradus) -* feature #4742 FunctionToConstantFixer - get_class($this) support (SpacePossum) -* minor #4377 CommentsAnalyzer - fix for declare before header comment (kubawerlos) -* minor #4636 DX: do not check for PHPDBG when collecting coverage (kubawerlos) -* minor #4644 Docs: add info about "-vv..." (voku) -* minor #4691 Run Travis CI on stable PHP 7.4 (kubawerlos) -* minor #4693 Increase Travis CI Git clone depth (julienfalque) -* minor #4699 LineEndingFixer - handle "\r\r\n" (kubawerlos) -* minor #4703 NoSuperfluousPhpdocTagsFixer,PhpdocAddMissingParamAnnotationFixer - p… (SpacePossum) -* minor #4707 Fix typos (TysonAndre) -* minor #4712 NoBlankLinesAfterPhpdocFixer — Do not strip newline between docblock and use statements (mollierobbert) -* minor #4715 Enhancement: Install ergebnis/composer-normalize via Phive (localheinz) -* minor #4722 Fix Circle CI build (julienfalque) -* minor #4724 DX: Simplify installing PCOV (kubawerlos) -* minor #4736 NoUnusedImportsFixer - do not match variable name as import (SpacePossum) -* minor #4746 NoSuperfluousPhpdocTagsFixer - Remove for typed properties (PHP 7.4) (ruudk) -* minor #4753 Do not apply any text/.git filters to fixtures (mvorisek) -* minor #4757 Test $expected is used before $input (SpacePossum) -* minor #4758 Autoreview the PHPDoc of *Fixer::getPriority based on the priority map (SpacePossum) -* minor #4765 Add test on some return types (SpacePossum) -* minor #4766 Remove false test skip (SpacePossum) -* minor #4767 Remove useless priority comments (kubawerlos) -* minor #4769 DX: add missing priority tests (kubawerlos) -* minor #4772 NoUnneededFinalMethodFixer - update description (kubawerlos) -* minor #4774 DX: simplify Utils::camelCaseToUnderscore (kubawerlos) -* minor #4781 NoUnneededCurlyBracesFixer - handle namespaces (SpacePossum) -* minor #4784 Travis CI - Use multiple keyservers (ktomk) -* minor #4785 Improve static analysis (enumag) -* minor #4788 Configurable fixers code sample (SpacePossum) -* minor #4791 Increase PHPStan level to 3 (julienfalque) -* minor #4797 clean ups (SpacePossum) -* minor #4803 FinalClassFixer - Doctrine\ORM\Mapping as ORM alias should not be required (localheinz) -* minor #4839 2.15 - clean ups (SpacePossum) -* minor #4842 ReturnAssignmentFixer - Support more cases (julienfalque) -* minor #4844 Same requirements for descriptions (SpacePossum) -* minor #4849 Increase PHPStan level to 5 (julienfalque) -* minor #4857 Fixed the unit tests (GrahamCampbell) -* minor #4865 Use latest xcode image (GrahamCampbell) -* minor #4892 CombineNestedDirnameFixer - Add space after comma (julienfalque) -* minor #4898 FixerTest - yield the data in AutoReview (Nyholm) -* minor #4899 Fix exception message format for fabbot.io (SpacePossum) -* minor #4905 Support composer v2 installed.json files (GrahamCampbell) -* minor #4906 CI: use Composer stable release for AppVeyor (kubawerlos) -* minor #4909 DX: HeaderCommentFixer - use non-aliased version of option name in code (keradus) -* minor #4912 CI: Fix AppVeyor integration (keradus) - -Changelog for v2.15.5 ---------------------- - -* bug #4476 FunctionsAnalyzer - add "isTheSameClassCall" for correct verifying of function calls (kubawerlos) -* bug #4641 Add typed properties test to VisibilityRequiredFixerTest (GawainLynch, julienfalque) -* bug #4654 ArrayIndentationFixer - Fix array indentation for multiline values (julienfalque) -* bug #4660 TokensAnalyzer::isConstantInvocation - fix for extending multiple interfaces (kubawerlos) -* bug #4668 TokensAnalyzer::isConstantInvocation - fix for interface method return type (kubawerlos) -* minor #4608 Allow Symfony 5 components (l-vo) -* minor #4622 Disallow PHP 7.4 failures on Travis CI (julienfalque) -* minor #4637 PHP 7.4 integration test (GawainLynch, julienfalque) -* minor #4643 DX: Update .gitattributes and move ci-integration.sh to root of the project (kubawerlos, keradus) -* minor #4645 Check PHP extensions on runtime (kubawerlos) -* minor #4655 Improve docs - README (mvorisek) -* minor #4662 DX: generate headers in README.rst (kubawerlos) -* minor #4669 Enable execution under PHP 7.4 (keradus) -* minor #4671 TravisTest - rewrite tests to allow last supported by tool PHP version to be snapshot (keradus) - -Changelog for v2.15.4 ---------------------- - -* bug #4183 IndentationTypeFixer - fix handling 2 spaces indent (kubawerlos) -* bug #4406 NoSuperfluousElseifFixer - fix invalid escape sequence in character class (remicollet, SpacePossum) -* bug #4416 NoUnusedImports - Fix imports detected as used in namespaces (julienfalque, SpacePossum) -* bug #4518 PhpUnitNoExpectationAnnotationFixer - fix handling expect empty exception message (ktomk) -* bug #4548 HeredocIndentationFixer - remove whitespace in empty lines (gharlan) -* bug #4556 ClassKeywordRemoveFixer - fix for self,static and parent keywords (kubawerlos) -* bug #4572 TokensAnalyzer - handle nested anonymous classes (SpacePossum) -* bug #4573 CombineConsecutiveIssetsFixer - fix stop based on precedence (SpacePossum) -* bug #4577 Fix command exit code on lint error after fixing fix. (SpacePossum) -* bug #4581 FunctionsAnalyzer: fix for comment in type (kubawerlos) -* bug #4586 BracesFixer - handle dynamic static method call (SpacePossum) -* bug #4594 Braces - fix both single line comment styles (SpacePossum) -* bug #4609 PhpdocTypesOrderFixer - Prevent unexpected default value change (laurent35240) -* minor #4458 Add PHPStan (julienfalque) -* minor #4479 IncludeFixer - remove braces when the statement is wrapped in block (kubawerlos) -* minor #4490 Allow running if installed as project specific (ticktackk) -* minor #4517 Verify PCRE pattern before use (ktomk) -* minor #4521 Remove superfluous leading backslash, closes 4520 (ktomk) -* minor #4532 DX: ensure data providers are used (kubawerlos) -* minor #4534 Redo PHP7.4 - Add "str_split" => "mb_str_split" mapping (keradus, Slamdunk) -* minor #4536 DX: use PHIVE for dev tools (keradus) -* minor #4538 Docs: update Cookbook (keradus) -* minor #4541 Enhancement: Use default name property to configure command names (localheinz) -* minor #4546 DX: removing unnecessary variable initialization (kubawerlos) -* minor #4549 DX: use ::class whenever possible (keradus, kubawerlos) -* minor #4550 DX: travis_retry for dev-tools install (ktomk, keradus) -* minor #4559 Allow 7.4snapshot to fail due to a bug on it (kubawerlos) -* minor #4563 GitlabReporter - fix report output (mjanser) -* minor #4564 Move readme-update command to Section 3 (iwasherefirst2) -* minor #4566 Update symfony ruleset (gharlan) -* minor #4570 Command::execute() should always return an integer (derrabus) -* minor #4580 Add support for true/false return type hints. (SpacePossum) -* minor #4584 Increase PHPStan level to 1 (julienfalque) -* minor #4585 Fix deprecation notices (julienfalque) -* minor #4587 Output details - Explain why a file was skipped (SpacePossum) -* minor #4588 Fix STDIN test when path is one level deep (julienfalque) -* minor #4589 PhpdocToReturnType - Add support for Foo[][] (SpacePossum) -* minor #4593 Ensure compatibility with PHP 7.4 typed properties (julienfalque) -* minor #4595 Import cannot be used after `::` so can be removed (SpacePossum) -* minor #4596 Ensure compatibility with PHP 7.4 numeric literal separator (julienfalque) -* minor #4597 Fix PHP 7.4 deprecation notices (julienfalque) -* minor #4600 Ensure compatibility with PHP 7.4 arrow functions (julienfalque) -* minor #4602 Ensure compatibility with PHP 7.4 spread operator in array expression (julienfalque) -* minor #4603 Ensure compatibility with PHP 7.4 null coalescing assignment operator (julienfalque) -* minor #4606 Configure no_superfluous_phpdoc_tags for Symfony (keradus) -* minor #4610 Travis CI - Update known files list (julienfalque) -* minor #4615 Remove workaround for dev-tools install reg. Phive (ktomk) - -Changelog for v2.15.3 ---------------------- - -* bug #4533 Revert PHP7.4 - Add "str_split" => "mb_str_split" mapping (keradus) -* minor #4264 DX: AutoReview - ensure Travis handle all needed PHP versions (keradus) -* minor #4524 MethodArgumentSpaceFixerTest - make explicit configuration to prevent fail on configuration change (keradus) - -Changelog for v2.15.2 ---------------------- - -* bug #4132 BlankLineAfterNamespaceFixer - do not remove indent, handle comments (kubawerlos) -* bug #4384 MethodArgumentSpaceFixer - fix for on_multiline:ensure_fully_multiline with trailing comma in function call (kubawerlos) -* bug #4404 FileLintingIterator - fix current value on end/invalid (SpacePossum) -* bug #4421 FunctionTypehintSpaceFixer - Ensure single space between type declaration and parameter (localheinz) -* bug #4436 MethodArgumentSpaceFixer - handle misplaced ) (keradus) -* bug #4439 NoLeadingImportSlashFixer - Add space if needed (SpacePossum) -* bug #4440 SimpleToComplexStringVariableFixer - Fix $ bug (dmvdbrugge) -* bug #4453 Fix preg_match error on 7.4snapshot (kubawerlos) -* bug #4461 IsNullFixer - fix null coalescing operator handling (linniksa) -* bug #4467 ToolInfo - fix access to reference without checking existence (black-silence) -* bug #4472 Fix non-static closure unbinding this on PHP 7.4 (kelunik) -* minor #3726 Use Box 3 to build the PHAR (theofidry, keradus) -* minor #4412 PHP 7.4 - Tests for support (SpacePossum) -* minor #4431 DX: test that default config is not passed in RuleSet (kubawerlos) -* minor #4433 DX: test to ensure @PHPUnitMigration rule sets are correctly defined (kubawerlos) -* minor #4445 DX: static call of markTestSkippedOrFail (kubawerlos) -* minor #4463 Add apostrophe to possessive "team's" (ChandlerSwift) -* minor #4471 ReadmeCommandTest - use CommandTester (kubawerlos) -* minor #4477 DX: control names of public methods in test's classes (kubawerlos) -* minor #4483 NewWithBracesFixer - Fix object operator and curly brace open cases (SpacePossum) -* minor #4484 fix typos in README (Sven Ludwig) -* minor #4494 DX: Fix shell script syntax in order to fix Travis builds (drupol) -* minor #4516 DX: Lock binary SCA tools versions (keradus) - -Changelog for v2.15.1 ---------------------- - -* bug #4418 PhpUnitNamespacedFixer - properly translate classes which do not follow translation pattern (ktomk) -* bug #4419 PhpUnitTestCaseStaticMethodCallsFixer - skip anonymous classes and lambda (SpacePossum) -* bug #4420 MethodArgumentSpaceFixer - PHP7.3 trailing commas in function calls (SpacePossum) -* minor #4345 Travis: PHP 7.4 isn't allowed to fail anymore (Slamdunk) -* minor #4403 LowercaseStaticReferenceFixer - Fix invalid PHP version in example (HypeMC) -* minor #4424 DX: cleanup of composer.json - no need for branch-alias (keradus) -* minor #4425 DX: assertions are static, adjust custom assertions (keradus) -* minor #4426 DX: handle deprecations of symfony/event-dispatcher:4.3 (keradus) -* minor #4427 DX: stop using reserved T_FN in code samples (keradus) -* minor #4428 DX: update dev-tools (keradus) -* minor #4429 DX: MethodArgumentSpaceFixerTest - fix hidden merge conflict (keradus) - -Changelog for v2.15.0 ---------------------- - -* feature #3927 Add FinalClassFixer (Slamdunk) -* feature #3939 Add PhpUnitSizeClassFixer (Jefersson Nathan) -* feature #3942 SimpleToComplexStringVariableFixer - Introduction (dmvdbrugge, SpacePossum) -* feature #4113 OrderedInterfacesFixer - Introduction (dmvdbrugge) -* feature #4121 SingleTraitInsertPerStatementFixer - Introduction (SpacePossum) -* feature #4126 NativeFunctionTypeDeclarationCasingFixer - Introduction (SpacePossum) -* feature #4167 PhpUnitMockShortWillReturnFixer - Introduction (michadam-pearson) -* feature #4191 [7.3] NoWhitespaceBeforeCommaInArrayFixer - fix comma after heredoc-end (gharlan) -* feature #4288 Add Gitlab Reporter (hco) -* feature #4328 Add PhpUnitDedicateAssertInternalTypeFixer (Slamdunk) -* feature #4341 [7.3] TrailingCommaInMultilineArrayFixer - fix comma after heredoc-end (gharlan) -* feature #4342 [7.3] MethodArgumentSpaceFixer - fix comma after heredoc-end (gharlan) -* minor #4112 NoSuperfluousPhpdocTagsFixer - Add missing code sample, groom tests (keradus, SpacePossum) -* minor #4360 Add gitlab as output format in the README/help doc. (SpacePossum) -* minor #4386 Add PhpUnitMockShortWillReturnFixer to @Symfony:risky rule set (kubawerlos) -* minor #4398 New ruleset "@PHP73Migration" (gharlan) -* minor #4399 Fix 2.15 line (keradus) - -Changelog for v2.14.6 ---------------------- - -* bug #4533 Revert PHP7.4 - Add "str_split" => "mb_str_split" mapping (keradus) -* minor #4264 DX: AutoReview - ensure Travis handle all needed PHP versions (keradus) -* minor #4524 MethodArgumentSpaceFixerTest - make explicit configuration to prevent fail on configuration change (keradus) - -Changelog for v2.14.5 ---------------------- - -* bug #4132 BlankLineAfterNamespaceFixer - do not remove indent, handle comments (kubawerlos) -* bug #4384 MethodArgumentSpaceFixer - fix for on_multiline:ensure_fully_multiline with trailing comma in function call (kubawerlos) -* bug #4404 FileLintingIterator - fix current value on end/invalid (SpacePossum) -* bug #4421 FunctionTypehintSpaceFixer - Ensure single space between type declaration and parameter (localheinz) -* bug #4436 MethodArgumentSpaceFixer - handle misplaced ) (keradus) -* bug #4439 NoLeadingImportSlashFixer - Add space if needed (SpacePossum) -* bug #4453 Fix preg_match error on 7.4snapshot (kubawerlos) -* bug #4461 IsNullFixer - fix null coalescing operator handling (linniksa) -* bug #4467 ToolInfo - fix access to reference without checking existence (black-silence) -* bug #4472 Fix non-static closure unbinding this on PHP 7.4 (kelunik) -* minor #3726 Use Box 3 to build the PHAR (theofidry, keradus) -* minor #4412 PHP 7.4 - Tests for support (SpacePossum) -* minor #4431 DX: test that default config is not passed in RuleSet (kubawerlos) -* minor #4433 DX: test to ensure @PHPUnitMigration rule sets are correctly defined (kubawerlos) -* minor #4445 DX: static call of markTestSkippedOrFail (kubawerlos) -* minor #4463 Add apostrophe to possessive "team's" (ChandlerSwift) -* minor #4471 ReadmeCommandTest - use CommandTester (kubawerlos) -* minor #4477 DX: control names of public methods in test's classes (kubawerlos) -* minor #4483 NewWithBracesFixer - Fix object operator and curly brace open cases (SpacePossum) -* minor #4484 fix typos in README (Sven Ludwig) -* minor #4494 DX: Fix shell script syntax in order to fix Travis builds (drupol) -* minor #4516 DX: Lock binary SCA tools versions (keradus) - -Changelog for v2.14.4 ---------------------- - -* bug #4418 PhpUnitNamespacedFixer - properly translate classes which do not follow translation pattern (ktomk) -* bug #4419 PhpUnitTestCaseStaticMethodCallsFixer - skip anonymous classes and lambda (SpacePossum) -* bug #4420 MethodArgumentSpaceFixer - PHP7.3 trailing commas in function calls (SpacePossum) -* minor #4345 Travis: PHP 7.4 isn't allowed to fail anymore (Slamdunk) -* minor #4403 LowercaseStaticReferenceFixer - Fix invalid PHP version in example (HypeMC) -* minor #4425 DX: assertions are static, adjust custom assertions (keradus) -* minor #4426 DX: handle deprecations of symfony/event-dispatcher:4.3 (keradus) -* minor #4427 DX: stop using reserved T_FN in code samples (keradus) -* minor #4428 DX: update dev-tools (keradus) - -Changelog for v2.14.3 ---------------------- - -* bug #4298 NoTrailingWhitespaceInCommentFixer - fix for non-Unix line separators (kubawerlos) -* bug #4303 FullyQualifiedStrictTypesFixer - Fix the short type detection when a question mark (nullable) is prefixing it. (drupol) -* bug #4313 SelfAccessorFixer - fix for part qualified class name (kubawerlos, SpacePossum) -* bug #4314 PhpUnitTestCaseStaticMethodCallsFixer - fix for having property with name as method to update (kubawerlos, SpacePossum) -* bug #4316 NoUnsetCastFixer - Test for higher-precedence operators (SpacePossum) -* bug #4327 TokensAnalyzer - add concat operator to list of binary operators (SpacePossum) -* bug #4335 Cache - add indent and line ending to cache signature (dmvdbrugge) -* bug #4344 VoidReturnFixer - handle yield from (SpacePossum) -* bug #4346 BracesFixer - Do not pull close tag onto same line as a comment (SpacePossum) -* bug #4350 StrictParamFixer - Don't detect functions in use statements (bolmstedt) -* bug #4357 Fix short list syntax detection. (SpacePossum) -* bug #4365 Fix output escaping of diff for text format when line is not changed (SpacePossum) -* bug #4370 PhpUnitConstructFixer - Fix handle different casing (SpacePossum) -* bug #4379 ExplicitStringVariableFixer - add test case for variable as an array key (kubawerlos, Slamdunk) -* feature #4337 PhpUnitTestCaseStaticMethodCallsFixer - prepare for PHPUnit 8 (kubawerlos) -* minor #3799 DX: php_unit_test_case_static_method_calls - use default config (keradus) -* minor #4103 NoExtraBlankLinesFixer - fix candidate detection (SpacePossum) -* minor #4245 LineEndingFixer - BracesFixer - Priority (dmvdbrugge) -* minor #4325 Use lowercase mikey179/vfsStream in composer.json (lolli42) -* minor #4336 Collect coverage with PCOV (kubawerlos) -* minor #4338 Fix wording (kmvan, kubawerlos) -* minor #4339 Change BracesFixer to avoid indenting PHP inline braces (alecgeatches) -* minor #4340 Travis: build against 7.4snapshot instead of nightly (Slamdunk) -* minor #4351 code grooming (SpacePossum) -* minor #4353 Add more priority tests (SpacePossum) -* minor #4364 DX: MethodChainingIndentationFixer - remove unnecessary loop (Sijun Zhu) -* minor #4366 Unset the auxiliary variable $a (GrahamCampbell) -* minor #4368 Fixed TypeShortNameResolverTest::testResolver (GrahamCampbell) -* minor #4380 PHP7.4 - Add "str_split" => "mb_str_split" mapping. (SpacePossum) -* minor #4381 PHP7.4 - Add support for magic methods (un)serialize. (SpacePossum) -* minor #4393 DX: add missing explicit return types (kubawerlos) - -Changelog for v2.14.2 ---------------------- - -* minor #4306 DX: Drop HHVM conflict on Composer level to help Composer with HHVM compatibility, we still prevent HHVM on runtime (keradus) - -Changelog for v2.14.1 ---------------------- - -* bug #4240 ModernizeTypesCastingFixer - fix for operators with higher precedence (kubawerlos) -* bug #4254 PhpUnitDedicateAssertFixer - fix for count with additional operations (kubawerlos) -* bug #4260 Psr0Fixer and Psr4Fixer - fix for multiple classes in file with anonymous class (kubawerlos) -* bug #4262 FixCommand - fix help (keradus) -* bug #4276 MethodChainingIndentationFixer, ArrayIndentationFixer - Fix priority issue (dmvdbrugge) -* bug #4280 MethodArgumentSpaceFixer - Fix method argument alignment (Billz95) -* bug #4286 IncrementStyleFixer - fix for static statement (kubawerlos) -* bug #4291 ArrayIndentationFixer - Fix indentation after trailing spaces (julienfalque, keradus) -* bug #4292 NoSuperfluousPhpdocTagsFixer - Make null only type not considered superfluous (julienfalque) -* minor #4204 DX: Tokens - do not unregister/register found tokens when collection is not changing (kubawerlos) -* minor #4235 DX: more specific @param types (kubawerlos) -* minor #4263 DX: AppVeyor - bump PHP version (keradus) -* minor #4293 Add official support for PHP 7.3 (keradus) -* minor #4295 DX: MethodArgumentSpaceFixerTest - fix edge case for handling different line ending when only expected code is provided (keradus) -* minor #4296 DX: cleanup testing with fixer config (keradus) -* minor #4299 NativeFunctionInvocationFixer - add array_key_exists (deguif, keradus) -* minor #4300 DX: cleanup testing with fixer config (keradus) - -Changelog for v2.14.0 ---------------------- - -* bug #4220 NativeFunctionInvocationFixer - namespaced strict to remove backslash (kubawerlos) -* feature #3881 Add PhpdocVarAnnotationCorrectOrderFixer (kubawerlos) -* feature #3915 Add HeredocIndentationFixer (gharlan) -* feature #4002 NoSuperfluousPhpdocTagsFixer - Allow `mixed` in superfluous PHPDoc by configuration (MortalFlesh) -* feature #4030 Add get_required_files and user_error aliases (ntzm) -* feature #4043 NativeFunctionInvocationFixer - add option to remove redundant backslashes (kubawerlos) -* feature #4102 Add NoUnsetCastFixer (SpacePossum) -* minor #4025 Add phpdoc_types_order rule to Symfony's ruleset (carusogabriel) -* minor #4213 [7.3] PHP7.3 integration tests (SpacePossum) -* minor #4233 Add official support for PHP 7.3 (keradus) - -Changelog for v2.13.3 ---------------------- - -* bug #4216 Psr4Fixer - fix for multiple classy elements in file (keradus, kubawerlos) -* bug #4217 Psr0Fixer - class with anonymous class (kubawerlos) -* bug #4219 NativeFunctionCasingFixer - handle T_RETURN_REF (kubawerlos) -* bug #4224 FunctionToConstantFixer - handle T_RETURN_REF (SpacePossum) -* bug #4229 IsNullFixer - fix parenthesis not closed (guilliamxavier) -* minor #4193 [7.3] CombineNestedDirnameFixer - support PHP 7.3 (kubawerlos) -* minor #4198 [7.3] PowToExponentiationFixer - adding to PHP7.3 integration test (kubawerlos) -* minor #4199 [7.3] MethodChainingIndentationFixer - add tests for PHP 7.3 (kubawerlos) -* minor #4200 [7.3] ModernizeTypesCastingFixer - support PHP 7.3 (kubawerlos) -* minor #4201 [7.3] MultilineWhitespaceBeforeSemicolonsFixer - add tests for PHP 7.3 (kubawerlos) -* minor #4202 [7.3] ErrorSuppressionFixer - support PHP 7.3 (kubawerlos) -* minor #4205 DX: PhpdocAlignFixer - refactor to use DocBlock (kubawerlos) -* minor #4206 DX: enable multiline_whitespace_before_semicolons (keradus) -* minor #4207 [7.3] RandomApiMigrationFixerTest - tests for 7.3 (SpacePossum) -* minor #4208 [7.3] NativeFunctionCasingFixerTest - tests for 7.3 (SpacePossum) -* minor #4209 [7.3] PhpUnitStrictFixerTest - tests for 7.3 (SpacePossum) -* minor #4210 [7.3] PhpUnitConstructFixer - add test for PHP 7.3 (kubawerlos) -* minor #4211 [7.3] PhpUnitDedicateAssertFixer - support PHP 7.3 (kubawerlos) -* minor #4214 [7.3] NoUnsetOnPropertyFixerTest - tests for 7.3 (SpacePossum) -* minor #4222 [7.3] PhpUnitExpectationFixer - support PHP 7.3 (kubawerlos) -* minor #4223 [7.3] PhpUnitMockFixer - add tests for PHP 7.3 (kubawerlos) -* minor #4230 [7.3] IsNullFixer - fix trailing comma (guilliamxavier) -* minor #4232 DX: remove Utils::splitLines (kubawerlos) -* minor #4234 [7.3] Test that "LITERAL instanceof X" is valid (guilliamxavier) - -Changelog for v2.13.2 ---------------------- - -* bug #3968 SelfAccessorFixer - support FQCN (kubawerlos) -* bug #3974 Psr4Fixer - class with anonymous class (kubawerlos) -* bug #3987 Run HeaderCommentFixer after NoBlankLinesAfterPhpdocFixer (StanAngeloff) -* bug #4009 TypeAlternationTransformer - Fix pipes in function call with constants being classified incorrectly (ntzm, SpacePossum) -* bug #4022 NoUnsetOnPropertyFixer - refactor and bugfixes (kubawerlos) -* bug #4036 ExplicitStringVariableFixer - fixes for backticks and for 2 variables next to each other (kubawerlos, Slamdunk) -* bug #4038 CommentToPhpdocFixer - handling nested PHPDoc (kubawerlos) -* bug #4064 Ignore invalid mode strings, add option to remove the "b" flag. (SpacePossum) -* bug #4071 DX: do not insert Token when calling removeLeadingWhitespace/removeTrailingWhitespace from Tokens (kubawerlos) -* bug #4073 IsNullFixer - fix function detection (kubawerlos) -* bug #4074 FileFilterIterator - do not filter out files that need fixing (SpacePossum) -* bug #4076 EregToPregFixer - fix function detection (kubawerlos) -* bug #4084 MethodChainingIndentation - fix priority with Braces (dmvdbrugge) -* bug #4099 HeaderCommentFixer - throw exception on invalid header configuration (SpacePossum) -* bug #4100 PhpdocAddMissingParamAnnotationFixer - Handle variable number of arguments and pass by reference cases (SpacePossum) -* bug #4101 ReturnAssignmentFixer - do not touch invalid code (SpacePossum) -* bug #4104 Change transformers order, fixing untransformed T_USE (dmvdbrugge) -* bug #4107 Preg::split - fix for non-UTF8 subject (ostrolucky, kubawerlos) -* bug #4109 NoBlankLines*: fix removing lines consisting only of spaces (kubawerlos, keradus) -* bug #4114 VisibilityRequiredFixer - don't remove comments (kubawerlos) -* bug #4116 OrderedImportsFixer - fix sorting without any grouping (SpacePossum) -* bug #4119 PhpUnitNoExpectationAnnotationFixer - fix extracting content from annotation (kubawerlos) -* bug #4127 LowercaseConstantsFixer - Fix case with properties using constants as their name (srathbone) -* bug #4134 [7.3] SquareBraceTransformer - nested array destructuring not handled correctly (SpacePossum) -* bug #4153 PhpUnitFqcnAnnotationFixer - handle only PhpUnit classes (kubawerlos) -* bug #4169 DirConstantFixer - Fixes for PHP7.3 syntax (SpacePossum) -* bug #4181 MultilineCommentOpeningClosingFixer - fix handling empty comment (kubawerlos) -* bug #4186 Tokens - fix removal of leading/trailing whitespace with empty token in collection (kubawerlos) -* minor #3436 Add a handful of integration tests (BackEndTea) -* minor #3774 PhpUnitTestClassRequiresCoversFixer - Remove unneeded loop and use phpunit indicator class (BackEndTea, SpacePossum) -* minor #3778 DX: Throw an exception if FileReader::read fails (ntzm) -* minor #3916 New ruleset "@PhpCsFixer" (gharlan) -* minor #4007 Fixes cookbook for fixers (greeflas) -* minor #4031 Correct FixerOptionBuilder::getOption return type (ntzm) -* minor #4046 Token - Added fast isset() path to token->equals() (staabm) -* minor #4047 Token - inline $other->getPrototype() to speedup equals() (staabm, keradus) -* minor #4048 Tokens - inlined extractTokenKind() call on the hot path (staabm) -* minor #4069 DX: Add dev-tools directory to gitattributes as export-ignore (alexmanno) -* minor #4070 Docs: Add link to a VS Code extension in readme (jakebathman) -* minor #4077 DX: cleanup - NoAliasFunctionsFixer - use FunctionsAnalyzer (kubawerlos) -* minor #4088 Add Travis test with strict types (kubawerlos) -* minor #4091 Adjust misleading sentence in CONTRIBUTING.md (ostrolucky) -* minor #4092 UseTransformer - simplify/optimize (SpacePossum) -* minor #4095 DX: Use ::class (keradus) -* minor #4096 DX: fixing typo (kubawerlos) -* minor #4097 DX: namespace casing (kubawerlos) -* minor #4110 Enhancement: Update localheinz/composer-normalize (localheinz) -* minor #4115 Changes for upcoming Travis' infra migration (sergeyklay) -* minor #4122 DX: AppVeyor - Update Composer download link (SpacePossum) -* minor #4128 DX: cleanup - AbstractFunctionReferenceFixer - use FunctionsAnalyzer (SpacePossum, kubawerlos) -* minor #4129 Fix: Symfony 4.2 deprecations (kubawerlos) -* minor #4139 DX: Fix CircleCI (kubawerlos) -* minor #4142 [7.3] NoAliasFunctionsFixer - mbregex_encoding' => 'mb_regex_encoding (SpacePossum) -* minor #4143 PhpUnitTestCaseStaticMethodCallsFixer - Add PHPUnit 7.5 new assertions (Slamdunk) -* minor #4149 [7.3] ArgumentsAnalyzer - PHP7.3 support (SpacePossum) -* minor #4161 DX: CI - show packages installed via Composer (keradus) -* minor #4162 DX: Drop symfony/lts (keradus) -* minor #4166 DX: do not use AbstractFunctionReferenceFixer when no need to (kubawerlos) -* minor #4168 DX: FopenFlagsFixer - remove useless proxy method (SpacePossum) -* minor #4171 Fix CircleCI cache (kubawerlos) -* minor #4173 [7.3] PowToExponentiationFixer - add support for PHP7.3 (SpacePossum) -* minor #4175 Fixing typo (kubawerlos) -* minor #4177 CI: Check that tag is matching version of PHP CS Fixer during deployment (keradus) -* minor #4180 Fixing typo (kubawerlos) -* minor #4182 DX: update php-cs-fixer file style (kubawerlos) -* minor #4185 [7.3] ImplodeCallFixer - add tests for PHP7.3 (kubawerlos) -* minor #4187 [7.3] IsNullFixer - support PHP 7.3 (kubawerlos) -* minor #4188 DX: cleanup (keradus) -* minor #4189 Travis - add PHP 7.3 job (keradus) -* minor #4190 Travis CI - fix config (kubawerlos) -* minor #4192 [7.3] MagicMethodCasingFixer - add tests for PHP 7.3 (kubawerlos) -* minor #4194 [7.3] NativeFunctionInvocationFixer - add tests for PHP 7.3 (kubawerlos) -* minor #4195 [7.3] SetTypeToCastFixer - support PHP 7.3 (kubawerlos) -* minor #4196 Update website (keradus) -* minor #4197 [7.3] StrictParamFixer - support PHP 7.3 (kubawerlos) - -Changelog for v2.13.1 ---------------------- - -* bug #3977 NoSuperfluousPhpdocTagsFixer - Fix handling of description with variable (julienfalque) -* bug #4027 PhpdocAnnotationWithoutDotFixer - add failing cases (keradus) -* bug #4028 PhpdocNoEmptyReturnFixer - handle single line PHPDoc (kubawerlos) -* bug #4034 PhpUnitTestCaseIndicator - handle anonymous class (kubawerlos) -* bug #4037 NativeFunctionInvocationFixer - fix function detection (kubawerlos) -* feature #4019 PhpdocTypesFixer - allow for configuration (keradus) -* minor #3980 Clarifies allow-risky usage (josephzidell) -* minor #4016 Bump console component due to it's bug (keradus) -* minor #4023 Enhancement: Update localheinz/composer-normalize (localheinz) -* minor #4049 use parent::offset*() methods when moving items around in insertAt() (staabm) - -Changelog for v2.13.0 ---------------------- - -* feature #3739 Add MagicMethodCasingFixer (SpacePossum) -* feature #3812 Add FopenFlagOrderFixer & FopenFlagsFixer (SpacePossum) -* feature #3826 Add CombineNestedDirnameFixer (gharlan) -* feature #3833 BinaryOperatorSpacesFixer - Add "no space" fix strategy (SpacePossum) -* feature #3841 NoAliasFunctionsFixer - add opt in option for ext-mbstring aliases (SpacePossum) -* feature #3876 NativeConstantInvocationFixer - add the scope option (stof, keradus) -* feature #3886 Add PhpUnitMethodCasingFixer (Slamdunk) -* feature #3907 Add ImplodeCallFixer (kubawerlos) -* feature #3914 NoUnreachableDefaultArgumentValueFixer - remove `null` for nullable typehints (gharlan, keradus) -* minor #3813 PhpUnitDedicateAssertFixer - fix "sizeOf" same as "count". (SpacePossum) -* minor #3873 Add the native_function_invocation fixer in the Symfony:risky ruleset (stof) -* minor #3979 DX: enable php_unit_method_casing (keradus) - -Changelog for v2.12.12 ----------------------- - -* bug #4533 Revert PHP7.4 - Add "str_split" => "mb_str_split" mapping (keradus) -* minor #4264 DX: AutoReview - ensure Travis handle all needed PHP versions (keradus) -* minor #4524 MethodArgumentSpaceFixerTest - make explicit configuration to prevent fail on configuration change (keradus) - -Changelog for v2.12.11 ----------------------- - -* bug #4132 BlankLineAfterNamespaceFixer - do not remove indent, handle comments (kubawerlos) -* bug #4384 MethodArgumentSpaceFixer - fix for on_multiline:ensure_fully_multiline with trailing comma in function call (kubawerlos) -* bug #4404 FileLintingIterator - fix current value on end/invalid (SpacePossum) -* bug #4421 FunctionTypehintSpaceFixer - Ensure single space between type declaration and parameter (localheinz) -* bug #4436 MethodArgumentSpaceFixer - handle misplaced ) (keradus) -* bug #4439 NoLeadingImportSlashFixer - Add space if needed (SpacePossum) -* bug #4453 Fix preg_match error on 7.4snapshot (kubawerlos) -* bug #4461 IsNullFixer - fix null coalescing operator handling (linniksa) -* bug #4467 ToolInfo - fix access to reference without checking existence (black-silence) -* bug #4472 Fix non-static closure unbinding this on PHP 7.4 (kelunik) -* minor #3726 Use Box 3 to build the PHAR (theofidry, keradus) -* minor #4412 PHP 7.4 - Tests for support (SpacePossum) -* minor #4431 DX: test that default config is not passed in RuleSet (kubawerlos) -* minor #4433 DX: test to ensure @PHPUnitMigration rule sets are correctly defined (kubawerlos) -* minor #4445 DX: static call of markTestSkippedOrFail (kubawerlos) -* minor #4463 Add apostrophe to possessive "team's" (ChandlerSwift) -* minor #4471 ReadmeCommandTest - use CommandTester (kubawerlos) -* minor #4477 DX: control names of public methods in test's classes (kubawerlos) -* minor #4483 NewWithBracesFixer - Fix object operator and curly brace open cases (SpacePossum) -* minor #4484 fix typos in README (Sven Ludwig) -* minor #4494 DX: Fix shell script syntax in order to fix Travis builds (drupol) -* minor #4516 DX: Lock binary SCA tools versions (keradus) - -Changelog for v2.12.10 ----------------------- - -* bug #4418 PhpUnitNamespacedFixer - properly translate classes which do not follow translation pattern (ktomk) -* bug #4419 PhpUnitTestCaseStaticMethodCallsFixer - skip anonymous classes and lambda (SpacePossum) -* bug #4420 MethodArgumentSpaceFixer - PHP7.3 trailing commas in function calls (SpacePossum) -* minor #4345 Travis: PHP 7.4 isn't allowed to fail anymore (Slamdunk) -* minor #4403 LowercaseStaticReferenceFixer - Fix invalid PHP version in example (HypeMC) -* minor #4425 DX: assertions are static, adjust custom assertions (keradus) -* minor #4426 DX: handle deprecations of symfony/event-dispatcher:4.3 (keradus) -* minor #4427 DX: stop using reserved T_FN in code samples (keradus) - -Changelog for v2.12.9 ---------------------- - -* bug #4298 NoTrailingWhitespaceInCommentFixer - fix for non-Unix line separators (kubawerlos) -* bug #4303 FullyQualifiedStrictTypesFixer - Fix the short type detection when a question mark (nullable) is prefixing it. (drupol) -* bug #4313 SelfAccessorFixer - fix for part qualified class name (kubawerlos, SpacePossum) -* bug #4314 PhpUnitTestCaseStaticMethodCallsFixer - fix for having property with name as method to update (kubawerlos, SpacePossum) -* bug #4327 TokensAnalyzer - add concat operator to list of binary operators (SpacePossum) -* bug #4335 Cache - add indent and line ending to cache signature (dmvdbrugge) -* bug #4344 VoidReturnFixer - handle yield from (SpacePossum) -* bug #4346 BracesFixer - Do not pull close tag onto same line as a comment (SpacePossum) -* bug #4350 StrictParamFixer - Don't detect functions in use statements (bolmstedt) -* bug #4357 Fix short list syntax detection. (SpacePossum) -* bug #4365 Fix output escaping of diff for text format when line is not changed (SpacePossum) -* bug #4370 PhpUnitConstructFixer - Fix handle different casing (SpacePossum) -* bug #4379 ExplicitStringVariableFixer - add test case for variable as an array key (kubawerlos, Slamdunk) -* feature #4337 PhpUnitTestCaseStaticMethodCallsFixer - prepare for PHPUnit 8 (kubawerlos) -* minor #3799 DX: php_unit_test_case_static_method_calls - use default config (keradus) -* minor #4103 NoExtraBlankLinesFixer - fix candidate detection (SpacePossum) -* minor #4245 LineEndingFixer - BracesFixer - Priority (dmvdbrugge) -* minor #4325 Use lowercase mikey179/vfsStream in composer.json (lolli42) -* minor #4336 Collect coverage with PCOV (kubawerlos) -* minor #4338 Fix wording (kmvan, kubawerlos) -* minor #4339 Change BracesFixer to avoid indenting PHP inline braces (alecgeatches) -* minor #4340 Travis: build against 7.4snapshot instead of nightly (Slamdunk) -* minor #4351 code grooming (SpacePossum) -* minor #4353 Add more priority tests (SpacePossum) -* minor #4364 DX: MethodChainingIndentationFixer - remove unnecessary loop (Sijun Zhu) -* minor #4366 Unset the auxiliary variable $a (GrahamCampbell) -* minor #4368 Fixed TypeShortNameResolverTest::testResolver (GrahamCampbell) -* minor #4380 PHP7.4 - Add "str_split" => "mb_str_split" mapping. (SpacePossum) -* minor #4393 DX: add missing explicit return types (kubawerlos) - -Changelog for v2.12.8 ---------------------- - -* minor #4306 DX: Drop HHVM conflict on Composer level to help Composer with HHVM compatibility, we still prevent HHVM on runtime (keradus) - -Changelog for v2.12.7 ---------------------- - -* bug #4240 ModernizeTypesCastingFixer - fix for operators with higher precedence (kubawerlos) -* bug #4254 PhpUnitDedicateAssertFixer - fix for count with additional operations (kubawerlos) -* bug #4260 Psr0Fixer and Psr4Fixer - fix for multiple classes in file with anonymous class (kubawerlos) -* bug #4262 FixCommand - fix help (keradus) -* bug #4276 MethodChainingIndentationFixer, ArrayIndentationFixer - Fix priority issue (dmvdbrugge) -* bug #4280 MethodArgumentSpaceFixer - Fix method argument alignment (Billz95) -* bug #4286 IncrementStyleFixer - fix for static statement (kubawerlos) -* bug #4291 ArrayIndentationFixer - Fix indentation after trailing spaces (julienfalque, keradus) -* bug #4292 NoSuperfluousPhpdocTagsFixer - Make null only type not considered superfluous (julienfalque) -* minor #4204 DX: Tokens - do not unregister/register found tokens when collection is not changing (kubawerlos) -* minor #4235 DX: more specific @param types (kubawerlos) -* minor #4263 DX: AppVeyor - bump PHP version (keradus) -* minor #4293 Add official support for PHP 7.3 (keradus) -* minor #4295 DX: MethodArgumentSpaceFixerTest - fix edge case for handling different line ending when only expected code is provided (keradus) -* minor #4296 DX: cleanup testing with fixer config (keradus) -* minor #4299 NativeFunctionInvocationFixer - add array_key_exists (deguif, keradus) - -Changelog for v2.12.6 ---------------------- - -* bug #4216 Psr4Fixer - fix for multiple classy elements in file (keradus, kubawerlos) -* bug #4217 Psr0Fixer - class with anonymous class (kubawerlos) -* bug #4219 NativeFunctionCasingFixer - handle T_RETURN_REF (kubawerlos) -* bug #4224 FunctionToConstantFixer - handle T_RETURN_REF (SpacePossum) -* bug #4229 IsNullFixer - fix parenthesis not closed (guilliamxavier) -* minor #4198 [7.3] PowToExponentiationFixer - adding to PHP7.3 integration test (kubawerlos) -* minor #4199 [7.3] MethodChainingIndentationFixer - add tests for PHP 7.3 (kubawerlos) -* minor #4200 [7.3] ModernizeTypesCastingFixer - support PHP 7.3 (kubawerlos) -* minor #4201 [7.3] MultilineWhitespaceBeforeSemicolonsFixer - add tests for PHP 7.3 (kubawerlos) -* minor #4202 [7.3] ErrorSuppressionFixer - support PHP 7.3 (kubawerlos) -* minor #4205 DX: PhpdocAlignFixer - refactor to use DocBlock (kubawerlos) -* minor #4206 DX: enable multiline_whitespace_before_semicolons (keradus) -* minor #4207 [7.3] RandomApiMigrationFixerTest - tests for 7.3 (SpacePossum) -* minor #4208 [7.3] NativeFunctionCasingFixerTest - tests for 7.3 (SpacePossum) -* minor #4209 [7.3] PhpUnitStrictFixerTest - tests for 7.3 (SpacePossum) -* minor #4210 [7.3] PhpUnitConstructFixer - add test for PHP 7.3 (kubawerlos) -* minor #4211 [7.3] PhpUnitDedicateAssertFixer - support PHP 7.3 (kubawerlos) -* minor #4214 [7.3] NoUnsetOnPropertyFixerTest - tests for 7.3 (SpacePossum) -* minor #4222 [7.3] PhpUnitExpectationFixer - support PHP 7.3 (kubawerlos) -* minor #4223 [7.3] PhpUnitMockFixer - add tests for PHP 7.3 (kubawerlos) -* minor #4230 [7.3] IsNullFixer - fix trailing comma (guilliamxavier) -* minor #4232 DX: remove Utils::splitLines (kubawerlos) -* minor #4234 [7.3] Test that "LITERAL instanceof X" is valid (guilliamxavier) - -Changelog for v2.12.5 ---------------------- - -* bug #3968 SelfAccessorFixer - support FQCN (kubawerlos) -* bug #3974 Psr4Fixer - class with anonymous class (kubawerlos) -* bug #3987 Run HeaderCommentFixer after NoBlankLinesAfterPhpdocFixer (StanAngeloff) -* bug #4009 TypeAlternationTransformer - Fix pipes in function call with constants being classified incorrectly (ntzm, SpacePossum) -* bug #4022 NoUnsetOnPropertyFixer - refactor and bugfixes (kubawerlos) -* bug #4036 ExplicitStringVariableFixer - fixes for backticks and for 2 variables next to each other (kubawerlos, Slamdunk) -* bug #4038 CommentToPhpdocFixer - handling nested PHPDoc (kubawerlos) -* bug #4071 DX: do not insert Token when calling removeLeadingWhitespace/removeTrailingWhitespace from Tokens (kubawerlos) -* bug #4073 IsNullFixer - fix function detection (kubawerlos) -* bug #4074 FileFilterIterator - do not filter out files that need fixing (SpacePossum) -* bug #4076 EregToPregFixer - fix function detection (kubawerlos) -* bug #4084 MethodChainingIndentation - fix priority with Braces (dmvdbrugge) -* bug #4099 HeaderCommentFixer - throw exception on invalid header configuration (SpacePossum) -* bug #4100 PhpdocAddMissingParamAnnotationFixer - Handle variable number of arguments and pass by reference cases (SpacePossum) -* bug #4101 ReturnAssignmentFixer - do not touch invalid code (SpacePossum) -* bug #4104 Change transformers order, fixing untransformed T_USE (dmvdbrugge) -* bug #4107 Preg::split - fix for non-UTF8 subject (ostrolucky, kubawerlos) -* bug #4109 NoBlankLines*: fix removing lines consisting only of spaces (kubawerlos, keradus) -* bug #4114 VisibilityRequiredFixer - don't remove comments (kubawerlos) -* bug #4116 OrderedImportsFixer - fix sorting without any grouping (SpacePossum) -* bug #4119 PhpUnitNoExpectationAnnotationFixer - fix extracting content from annotation (kubawerlos) -* bug #4127 LowercaseConstantsFixer - Fix case with properties using constants as their name (srathbone) -* bug #4134 [7.3] SquareBraceTransformer - nested array destructuring not handled correctly (SpacePossum) -* bug #4153 PhpUnitFqcnAnnotationFixer - handle only PhpUnit classes (kubawerlos) -* bug #4169 DirConstantFixer - Fixes for PHP7.3 syntax (SpacePossum) -* bug #4181 MultilineCommentOpeningClosingFixer - fix handling empty comment (kubawerlos) -* bug #4186 Tokens - fix removal of leading/trailing whitespace with empty token in collection (kubawerlos) -* minor #3436 Add a handful of integration tests (BackEndTea) -* minor #3774 PhpUnitTestClassRequiresCoversFixer - Remove unneeded loop and use phpunit indicator class (BackEndTea, SpacePossum) -* minor #3778 DX: Throw an exception if FileReader::read fails (ntzm) -* minor #3916 New ruleset "@PhpCsFixer" (gharlan) -* minor #4007 Fixes cookbook for fixers (greeflas) -* minor #4031 Correct FixerOptionBuilder::getOption return type (ntzm) -* minor #4046 Token - Added fast isset() path to token->equals() (staabm) -* minor #4047 Token - inline $other->getPrototype() to speedup equals() (staabm, keradus) -* minor #4048 Tokens - inlined extractTokenKind() call on the hot path (staabm) -* minor #4069 DX: Add dev-tools directory to gitattributes as export-ignore (alexmanno) -* minor #4070 Docs: Add link to a VS Code extension in readme (jakebathman) -* minor #4077 DX: cleanup - NoAliasFunctionsFixer - use FunctionsAnalyzer (kubawerlos) -* minor #4088 Add Travis test with strict types (kubawerlos) -* minor #4091 Adjust misleading sentence in CONTRIBUTING.md (ostrolucky) -* minor #4092 UseTransformer - simplify/optimize (SpacePossum) -* minor #4095 DX: Use ::class (keradus) -* minor #4097 DX: namespace casing (kubawerlos) -* minor #4110 Enhancement: Update localheinz/composer-normalize (localheinz) -* minor #4115 Changes for upcoming Travis' infra migration (sergeyklay) -* minor #4122 DX: AppVeyor - Update Composer download link (SpacePossum) -* minor #4128 DX: cleanup - AbstractFunctionReferenceFixer - use FunctionsAnalyzer (SpacePossum, kubawerlos) -* minor #4129 Fix: Symfony 4.2 deprecations (kubawerlos) -* minor #4139 DX: Fix CircleCI (kubawerlos) -* minor #4143 PhpUnitTestCaseStaticMethodCallsFixer - Add PHPUnit 7.5 new assertions (Slamdunk) -* minor #4149 [7.3] ArgumentsAnalyzer - PHP7.3 support (SpacePossum) -* minor #4161 DX: CI - show packages installed via Composer (keradus) -* minor #4162 DX: Drop symfony/lts (keradus) -* minor #4166 DX: do not use AbstractFunctionReferenceFixer when no need to (kubawerlos) -* minor #4171 Fix CircleCI cache (kubawerlos) -* minor #4173 [7.3] PowToExponentiationFixer - add support for PHP7.3 (SpacePossum) -* minor #4175 Fixing typo (kubawerlos) -* minor #4177 CI: Check that tag is matching version of PHP CS Fixer during deployment (keradus) -* minor #4182 DX: update php-cs-fixer file style (kubawerlos) -* minor #4187 [7.3] IsNullFixer - support PHP 7.3 (kubawerlos) -* minor #4188 DX: cleanup (keradus) -* minor #4189 Travis - add PHP 7.3 job (keradus) -* minor #4190 Travis CI - fix config (kubawerlos) -* minor #4194 [7.3] NativeFunctionInvocationFixer - add tests for PHP 7.3 (kubawerlos) -* minor #4195 [7.3] SetTypeToCastFixer - support PHP 7.3 (kubawerlos) -* minor #4196 Update website (keradus) -* minor #4197 [7.3] StrictParamFixer - support PHP 7.3 (kubawerlos) - -Changelog for v2.12.4 ---------------------- - -* bug #3977 NoSuperfluousPhpdocTagsFixer - Fix handling of description with variable (julienfalque) -* bug #4027 PhpdocAnnotationWithoutDotFixer - add failing cases (keradus) -* bug #4028 PhpdocNoEmptyReturnFixer - handle single line PHPDoc (kubawerlos) -* bug #4034 PhpUnitTestCaseIndicator - handle anonymous class (kubawerlos) -* bug #4037 NativeFunctionInvocationFixer - fix function detection (kubawerlos) -* feature #4019 PhpdocTypesFixer - allow for configuration (keradus) -* minor #3980 Clarifies allow-risky usage (josephzidell) -* minor #4016 Bump console component due to it's bug (keradus) -* minor #4023 Enhancement: Update localheinz/composer-normalize (localheinz) -* minor #4049 use parent::offset*() methods when moving items around in insertAt() (staabm) - -Changelog for v2.12.3 ---------------------- - -* bug #3867 PhpdocAnnotationWithoutDotFixer - Handle trailing whitespaces (kubawerlos) -* bug #3884 NoSuperfluousPhpdocTagsFixer - handle null in every position (dmvdbrugge, julienfalque) -* bug #3885 AlignMultilineCommentFixer - ArrayIndentationFixer - Priority (dmvdbrugge) -* bug #3887 ArrayIndentFixer - Don't indent empty lines (dmvdbrugge) -* bug #3888 NoExtraBlankLinesFixer - remove blank lines after open tag (kubawerlos) -* bug #3890 StrictParamFixer - make it case-insensitive (kubawerlos) -* bug #3895 FunctionsAnalyzer - false positive for constant and function definition (kubawerlos) -* bug #3908 StrictParamFixer - fix edge case (kubawerlos) -* bug #3910 FunctionsAnalyzer - fix isGlobalFunctionCall (gharlan) -* bug #3912 FullyQualifiedStrictTypesFixer - NoSuperfluousPhpdocTagsFixer - adjust priority (dmvdbrugge) -* bug #3913 TokensAnalyzer - fix isConstantInvocation (gharlan, keradus) -* bug #3921 TypeAnalysis - Fix iterable not being detected as a reserved type (ntzm) -* bug #3924 FullyQualifiedStrictTypesFixer - space bug (dmvdbrugge) -* bug #3937 LowercaseStaticReferenceFixer - Fix "Parent" word in namespace (kubawerlos) -* bug #3944 ExplicitStringVariableFixer - fix array handling (gharlan) -* bug #3951 NoSuperfluousPhpdocTagsFixer - do not call strtolower with null (SpacePossum) -* bug #3954 NoSuperfluousPhpdocTagsFixer - Index invalid or out of range (kubawerlos) -* bug #3957 NoTrailingWhitespaceFixer - trim space after opening tag (kubawerlos) -* minor #3798 DX: enable native_function_invocation (keradus) -* minor #3882 PhpdocAnnotationWithoutDotFixer - Handle empty line in comment (kubawerlos) -* minor #3889 DX: Cleanup - remove unused variables (kubawerlos, SpacePossum) -* minor #3891 PhpdocNoEmptyReturnFixer - account for null[] (dmvdbrugge) -* minor #3892 PhpdocNoEmptyReturnFixer - fix docs (keradus) -* minor #3897 DX: FunctionsAnalyzer - simplifying return expression (kubawerlos) -* minor #3903 DX: cleanup - remove special treatment for PHP <5.6 (kubawerlos) -* minor #3905 DX: Upgrade composer-require-checker to stable version (keradus) -* minor #3919 Simplify single uses of Token::isGivenKind (ntzm) -* minor #3920 Docs: Fix typo (ntzm) -* minor #3940 DX: fix phpdoc parameter type (malukenho) -* minor #3948 DX: cleanup - remove redundant @param annotations (kubawerlos) -* minor #3950 Circle CI v2 yml (siad007) -* minor #3952 DX: AbstractFixerTestCase - drop testing method already provided by trait (keradus) -* minor #3973 Bump xdebug-handler (keradus) - -Changelog for v2.12.2 ---------------------- - -* bug #3823 NativeConstantInvocationFixer - better constant detection (gharlan, SpacePossum, keradus) -* bug #3832 "yield from" as keyword (SpacePossum) -* bug #3835 Fix priority between PHPDoc return type fixers (julienfalque, keradus) -* bug #3839 MethodArgumentSpaceFixer - add empty line incorrectly (SpacePossum) -* bug #3866 SpaceAfterSemicolonFixer - loop over all tokens (SpacePossum) -* minor #3817 Update integrations tests (SpacePossum) -* minor #3829 Fix typos in changelog (mnabialek) -* minor #3848 Add install/update instructions for PHIVE to the README (SpacePossum) -* minor #3877 NamespacesAnalyzer - Optimize performance (stof) -* minor #3878 NativeFunctionInvocationFixer - use the NamespacesAnalyzer to remove duplicated code (stof) - -Changelog for v2.12.1 ---------------------- - -* bug #3808 LowercaseStaticReferenceFixer - Fix constants handling (kubawerlos, keradus) -* bug #3815 NoSuperfluousPhpdocTagsFixer - support array/callable type hints (gharlan) -* minor #3824 DX: Support PHPUnit 7.2 (keradus) -* minor #3825 UX: Provide full diff for code samples (keradus) - -Changelog for v2.12.0 ---------------------- - -* feature #2577 Add LogicalOperatorsFixer (hkdobrev, keradus) -* feature #3060 Add ErrorSuppressionFixer (kubawerlos) -* feature #3127 Add NativeConstantInvocationFixer (Slamdunk, keradus) -* feature #3223 NativeFunctionInvocationFixer - add namespace scope and include sets (SpacePossum) -* feature #3453 PhpdocAlignFixer - add align option (robert.ahmerov) -* feature #3476 Add PhpUnitTestCaseStaticMethodCallsFixer (Slamdunk, keradus) -* feature #3524 MethodArgumentSpaceFixer - Add ensure_single_line option (julienfalque, keradus) -* feature #3534 MultilineWhitespaceBeforeSemicolonsFixer - support static calls (ntzm) -* feature #3585 Add ReturnAssignmentFixer (SpacePossum, keradus) -* feature #3640 Add PhpdocToReturnTypeFixer (Slamdunk, keradus) -* feature #3691 Add PhpdocTrimAfterDescriptionFixer (nobuf, keradus) -* feature #3698 YodaStyleFixer - Add always_move_variable option (julienfalque, SpacePossum) -* feature #3709 Add SetTypeToCastFixer (SpacePossum) -* feature #3724 BlankLineBeforeStatementFixer - Add case and default as options (dmvdbrugge) -* feature #3734 Add NoSuperfluousPhpdocTagsFixer (julienfalque) -* feature #3735 Add LowercaseStaticReferenceFixer (kubawerlos, SpacePossum) -* feature #3737 Add NoUnsetOnPropertyFixer (BackEndTea, SpacePossum) -* feature #3745 Add PhpUnitInternalClassFixer (BackEndTea, SpacePossum, keradus) -* feature #3766 Add NoBinaryStringFixer (ntzm, SpacePossum, keradus) -* feature #3780 ShortScalarCastFixer - Change binary cast to string cast as well (ntzm) -* feature #3785 PhpUnitDedicateAssertFixer - fix to assertCount too (SpacePossum) -* feature #3802 Convert PhpdocTrimAfterDescriptionFixer into PhpdocTrimConsecutiveBlankLineSeparationFixer (keradus) -* minor #3738 ReturnAssignmentFixer description update (kubawerlos) -* minor #3761 Application: when run with FUTURE_MODE, error_reporting(-1) is done in entry file instead (keradus) -* minor #3772 DX: use PhpUnitTestCaseIndicator->isPhpUnitClass to discover PHPUnit classes (keradus) -* minor #3783 CI: Split COLLECT_COVERAGE job (keradus) -* minor #3789 DX: ProjectCodeTest.testThatDataProvidersAreCorrectlyNamed - performance optimization (keradus) -* minor #3791 DX: Fix collecting code coverage (keradus) -* minor #3792 DX: Upgrade DX deps (keradus) -* minor #3797 DX: ProjectCodeTest - shall not depends on xdebug/phpdbg anymore (keradus, SpacePossum) -* minor #3800 Symfony:risky ruleset: include set_type_to_cast rule (keradus) -* minor #3801 NativeFunctionInvocationFixer - fix buggy config validation (keradus, SpacePossum) - -Changelog for v2.11.2 ---------------------- - -* bug #3233 PhpdocAlignFixer - Fix linebreak inconsistency (SpacePossum, keradus) -* bug #3445 Rewrite NoUnusedImportsFixer (kubawerlos, julienfalque) -* bug #3528 MethodChainingIndentationFixer - nested params bugfix (Slamdunk) -* bug #3547 MultilineWhitespaceBeforeSemicolonsFixer - chained call for a return fix (egircys, keradus) -* bug #3597 DeclareStrictTypesFixer - fix bug of removing line (kubawerlos, keradus) -* bug #3605 DoctrineAnnotationIndentationFixer - Fix indentation with mixed lines (julienfalque) -* bug #3606 PhpdocToCommentFixer - allow multiple ( (SpacePossum) -* bug #3614 Refactor PhpdocToCommentFixer - extract checking to CommentsAnalyzer (kubawerlos) -* bug #3668 Rewrite NoUnusedImportsFixer (kubawerlos, julienfalque) -* bug #3670 PhpdocTypesOrderFixer - Fix ordering of nested generics (julienfalque) -* bug #3671 ArrayIndentationFixer - Fix indentation in HTML (julienfalque) -* bug #3673 PhpdocScalarFixer - Add "types" option (julienfalque, keradus) -* bug #3674 YodaStyleFixer - Fix variable detection for multidimensional arrays (julienfalque, SpacePossum) -* bug #3684 PhpUnitStrictFixer - Do not fix if not correct # of arguments are used (SpacePossum) -* bug #3708 EscapeImplicitBackslashesFixer - Fix escaping multiple backslashes (julienfalque) -* bug #3715 SingleImportPerStatementFixer - Fix handling whitespace before opening brace (julienfalque) -* bug #3731 PhpdocIndentFixer - crash fix (SpacePossum) -* bug #3755 YodaStyleFixer - handle space between var name and index (SpacePossum) -* bug #3765 Fix binary-prefixed double-quoted strings to single quotes (ntzm) -* bug #3770 Handle binary flags in heredoc_to_nowdoc (ntzm) -* bug #3776 ExplicitStringVariableFixer - handle binary strings (ntzm) -* bug #3777 EscapeImplicitBackslashesFixer - handle binary strings (ntzm) -* bug #3790 ProcessLinter - don't execute external process without timeout! It can freeze! (keradus) -* minor #3188 AppVeyor - add PHP 7.x (keradus, julienfalque) -* minor #3451 Update findPHPUnit functions (BackEndTea, SpacePossum, keradus) -* minor #3548 Make shell scripts POSIX-compatible (EvgenyOrekhov, keradus) -* minor #3568 New Autoreview: Correct option casing (ntzm) -* minor #3578 Add interface for deprecated options (julienfalque, keradus) -* minor #3590 Use XdebugHandler to avoid perormance penalty (AJenbo, keradus) -* minor #3607 PhpdocVarWithoutNameFixer - update sample with @ type (SpacePossum) -* minor #3617 Tests stability patches (Tom Klingenberg, keradus) -* minor #3622 Docs: Update descriptions (localheinz) -* minor #3627 Fix tests execution under phpdbg (keradus) -* minor #3629 ProjectFixerConfigurationTest - test rules are sorted (SpacePossum) -* minor #3639 DX: use benefits of symfony/force-lowest (keradus) -* minor #3641 Update check_trailing_spaces script with upstream (keradus) -* minor #3646 Extract SameStringsConstraint and XmlMatchesXsdConstraint (keradus) -* minor #3647 DX: Add CachingLinter for tests (keradus) -* minor #3649 Update check_trailing_spaces script with upstream (keradus) -* minor #3652 CiIntegrationTest - run tests with POSIX sh, not Bash (keradus) -* minor #3656 DX: Clean ups (SpacePossum) -* minor #3657 update phpunitgoodpractices/traits (SpacePossum, keradus) -* minor #3658 DX: Clean ups (SpacePossum) -* minor #3660 Fix do not rely on order of fixing in CiIntegrationTest (kubawerlos) -* minor #3661 Fix: covers annotation for NoAlternativeSyntaxFixerTest (kubawerlos) -* minor #3662 DX: Add Smoke/InstallViaComposerTest (keradus) -* minor #3663 DX: During deployment, run all smoke tests and don't allow to skip phar-related ones (keradus) -* minor #3665 CircleCI fix (kubawerlos) -* minor #3666 Use "set -eu" in shell scripts (EvgenyOrekhov) -* minor #3669 Document possible values for subset options (julienfalque, keradus) -* minor #3672 Remove SameStringsConstraint and XmlMatchesXsdConstraint (keradus) -* minor #3676 RunnerTest - workaround for failing Symfony v2.8.37 (kubawerlos) -* minor #3680 DX: Tokens - removeLeadingWhitespace and removeTrailingWhitespace must act in same way (SpacePossum) -* minor #3686 README.rst - Format all code-like strings in fixer descriptions (ntzm, keradus) -* minor #3692 DX: Optimize tests (julienfalque) -* minor #3700 README.rst - Format all code-like strings in fixer description (ntzm) -* minor #3701 Use correct casing for "PHPDoc" (ntzm) -* minor #3703 DX: InstallViaComposerTest - groom naming (keradus) -* minor #3704 DX: Tokens - fix naming (keradus) -* minor #3706 Update homebrew installation instructions (ntzm) -* minor #3713 Use HTTPS whenever possible (fabpot) -* minor #3723 Extend tests coverage (ntzm) -* minor #3733 Disable Composer optimized autoloader by default (julienfalque) -* minor #3748 PhpUnitStrictFixer - extend risky note (jnvsor) -* minor #3749 Make sure PHPUnit is cased correctly in fixers descriptions (kubawerlos) -* minor #3768 Improve deprecation messages (julienfalque, SpacePossum) -* minor #3773 AbstractFixerWithAliasedOptionsTestCase - don't export (keradus) -* minor #3775 Add tests for binary strings in string_line_ending (ntzm) -* minor #3779 Misc fixes (ntzm, keradus) -* minor #3796 DX: StdinTest - do not assume name of folder, into which project was cloned (keradus) -* minor #3803 NoEmptyPhpdocFixer/PhpdocAddMissingParamAnnotationFixer - missing priority test (SpacePossum, keradus) -* minor #3804 Cleanup: remove useless constructor comment (kubawerlos) -* minor #3805 Cleanup: add missing @param type (kubawerlos, keradus) - -Changelog for v2.11.1 ---------------------- - -* bug #3626 ArrayIndentationFixer: priority bug with BinaryOperatorSpacesFixer and MethodChainingIndentationFixer (Slamdunk) -* bug #3632 DateTimeImmutableFixer bug with adding tokens while iterating over them (kubawerlos) -* minor #3478 PhpUnitDedicateAssertFixer: handle static calls (Slamdunk) -* minor #3618 DateTimeImmutableFixer - grooming (keradus) - -Changelog for v2.11.0 ---------------------- - -* feature #3135 Add ArrayIndentationFixer (julienfalque) -* feature #3235 Implement StandardizeIncrementFixer (ntzm, SpacePossum) -* feature #3260 Add DateTimeImmutableFixer (kubawerlos) -* feature #3276 Transform Fully Qualified parameters and return types to short version (veewee, keradus) -* feature #3299 SingleQuoteFixer - fix single quote char (Slamdunk) -* feature #3340 Verbose LintingException after fixing (Slamdunk) -* feature #3423 FunctionToConstantFixer - add fix "get_called_class" option (SpacePossum) -* feature #3434 Add PhpUnitSetUpTearDownVisibilityFixer (BackEndTea, SpacePossum) -* feature #3442 Add CommentToPhpdocFixer (kubawerlos, keradus) -* feature #3448 OrderedClassElementsFixer - added sortAlgorithm option (meridius) -* feature #3454 Add StringLineEndingFixer (iluuu1994, SpacePossum, keradus, julienfalque) -* feature #3477 PhpUnitStrictFixer: handle static calls (Slamdunk) -* feature #3479 PhpUnitConstructFixer: handle static calls (Slamdunk) -* feature #3507 Add PhpUnitOrderedCoversFixer (Slamdunk) -* feature #3545 Add the 'none' sort algorithm to OrderedImportsFixer (EvgenyOrekhov) -* feature #3588 Add NoAlternativeSyntaxFixer (eddmash, keradus) -* minor #3414 DescribeCommand: add fixer class when verbose (Slamdunk) -* minor #3432 ConfigurationDefinitionFixerInterface - fix deprecation notice (keradus) -* minor #3527 Deprecate last param of Tokens::findBlockEnd (ntzm, keradus) -* minor #3539 Update UnifiedDiffOutputBuilder from gecko-packages/gecko-diff-output-builder usage after it was incorporated into sebastian/diff (keradus) -* minor #3549 DescribeCommand - use our Differ wrapper class, not external one directly (keradus) -* minor #3592 Support PHPUnit 7 (keradus) -* minor #3619 Travis - extend additional files list (keradus) - -Changelog for v2.10.5 ---------------------- - -* bug #3344 Fix method chaining indentation in HTML (julienfalque) -* bug #3594 ElseifFixer - Bug with alternative syntax (kubawerlos) -* bug #3600 StrictParamFixer - Fix issue when functions are imported (ntzm, keradus) -* minor #3589 FixerFactoryTest - add missing test (SpacePossum, keradus) -* minor #3610 make phar extension optional (Tom Klingenberg, keradus) -* minor #3612 Travis - allow for hhvm failures (keradus) -* minor #3615 Detect fabbot.io (julienfalque, keradus) -* minor #3616 FixerFactoryTest - Don't rely on autovivification (keradus) -* minor #3621 FixerFactoryTest - apply CS (keradus) - -Changelog for v2.10.4 ---------------------- - -* bug #3446 Add PregWrapper (kubawerlos) -* bug #3464 IncludeFixer - fix incorrect order of fixing (kubawerlos, SpacePossum) -* bug #3496 Bug in Tokens::removeLeadingWhitespace (kubawerlos, SpacePossum, keradus) -* bug #3557 AbstractDoctrineAnnotationFixer: edge case bugfix (Slamdunk) -* bug #3574 GeneralPhpdocAnnotationRemoveFixer - remove PHPDoc if no content is left (SpacePossum) -* minor #3563 DX add missing covers annotations (keradus) -* minor #3564 Use ::class keyword when possible (keradus) -* minor #3565 Use EventDispatcherInterface instead of EventDispatcher when possible (keradus) -* minor #3566 Update PHPUnitGoodPractices\Traits (keradus) -* minor #3572 DX: allow for more phpunit-speedtrap versions to support more PHPUnit versions (keradus) -* minor #3576 Fix Doctrine Annotation test cases merging (julienfalque) -* minor #3577 DoctrineAnnotationArrayAssignmentFixer - Add test case (julienfalque) - -Changelog for v2.10.3 ---------------------- - -* bug #3504 NoBlankLinesAfterPhpdocFixer - allow blank line before declare statement (julienfalque) -* bug #3522 Remove LOCK_EX (SpacePossum) -* bug #3560 SelfAccessorFixer is risky (Slamdunk) -* minor #3435 Add tests for general_phpdoc_annotation_remove (BackEndTea) -* minor #3484 Create Tokens::findBlockStart (ntzm) -* minor #3512 Add missing array typehints (ntzm) -* minor #3513 Making AppVeyor happy (kubawerlos) -* minor #3516 Use `null|type` instead of `?type` in PHPDocs (ntzm) -* minor #3518 FixerFactoryTest - Test each priority test file is listed as test (SpacePossum) -* minor #3519 Fix typo (SpacePossum) -* minor #3520 Fix typos: ran vs. run (SpacePossum) -* minor #3521 Use HTTPS (carusogabriel) -* minor #3526 Remove gecko dependency (SpacePossum, keradus, julienfalque) -* minor #3531 Backport PHPMD to LTS version to ease maintainability (keradus) -* minor #3532 Implement Tokens::findOppositeBlockEdge (ntzm) -* minor #3533 DX: SCA - drop src/Resources exclusion (keradus) -* minor #3538 Don't use third parameter of Tokens::findBlockStart (ntzm) -* minor #3542 Enhancement: Run composer-normalize on Travis CI (localheinz, keradus) -* minor #3550 AutoReview\FixerFactoryTest - fix missing priority test, mark not fully valid test as incomplete (keradus) -* minor #3555 DX: composer.json - drop branch-alias, branch is already following the version (keradus) -* minor #3556 DX: Add AutoReview/ComposerTest (keradus) -* minor #3559 Don't expose new files under Test namespace (keradus) -* minor #3561 PHPUnit5 - add in place missing compat layer for PHPUnit6 (keradus) - -Changelog for v2.10.2 ---------------------- - -* bug #3502 Fix missing file in export (keradus) - -Changelog for v2.10.1 ---------------------- - -* bug #3265 YodaFixer - fix problems of block statements followed by ternary statements (weareoutman, keradus, SpacePossum) -* bug #3367 NoUnusedImportsFixer - fix comment handling (SpacePossum, keradus) -* bug #3438 PhpUnitTestAnnotationFixer: Do not prepend with test if method is test() (localheinz, SpacePossum) -* bug #3455 NoEmptyCommentFixer - comment block detection for line ending different than LF (kubawerlos, SpacePossum) -* bug #3458 SilencedDeprecationErrorFixer - fix edge cases (kubawerlos) -* bug #3466 no_whitespace_in_blank_line and no_blank_lines_after_phpdoc fixers bug (kubawerlos, keradus) -* bug #3472 YodaStyleFixer - do not un-Yoda if right side is assignment (SpacePossum, keradus) -* bug #3492 PhpdocScalarFixer - Add callback pesudo-type to callable type (carusogabriel) -* minor #3354 Added missing types to the PhpdocTypesFixer (GrahamCampbell) -* minor #3406 Fix for escaping in README (kubawerlos) -* minor #3430 Fix integration test (SpacePossum) -* minor #3431 Add missing tests (SpacePossum) -* minor #3440 Add a handful of integration tests (BackEndTea) -* minor #3443 ConfigurableFixerInterface - not deprecated but TODO (SpacePossum) -* minor #3444 IntegrationTest - ensure tests in priority dir are priority tests indeed (keradus) -* minor #3494 Add missing PHPDoc param type (ntzm) -* minor #3495 Swap @var type and element (ntzm) -* minor #3498 NoUnusedImportsFixer - fix deprecation (keradus) - -Changelog for v2.10.0 ---------------------- - -* feature #3290 Add PhpdocOpeningClosingFixer (Slamdunk, keradus) -* feature #3327 Add MultilineWhitespaceBeforeSemicolonsFixer (egircys, keradus) -* feature #3351 PhuUnit: migrate getMock to createPartialMock when arguments count is 2 (Slamdunk) -* feature #3362 Add BacktickToShellExecFixer (Slamdunk) -* minor #3285 PHPUnit - use protective traits (keradus) -* minor #3329 ConfigurationResolver - detect deprecated fixers (keradus, SpacePossum) -* minor #3343 Tokens - improve block end lookup (keradus) -* minor #3360 Adjust Symfony ruleset (keradus) -* minor #3361 no_extra_consecutive_blank_lines - rename to no_extra_blank_lines (with BC layer) (keradus) -* minor #3363 progress-type - name main option value 'dots' (keradus) -* minor #3404 Deprecate "use_yoda_style" in IsNullFixer (kubawerlos, keradus) -* minor #3418 ConfigurableFixerInterface, ConfigurationDefinitionFixerInterface - update deprecations (keradus) -* minor #3419 Dont use deprecated fixer in itest (keradus) - -Changelog for v2.9.3 --------------------- - -* bug #3502 Fix missing file in export (keradus) - -Changelog for v2.9.2 --------------------- - -* bug #3265 YodaFixer - fix problems of block statements followed by ternary statements (weareoutman, keradus, SpacePossum) -* bug #3367 NoUnusedImportsFixer - fix comment handling (SpacePossum, keradus) -* bug #3438 PhpUnitTestAnnotationFixer: Do not prepend with test if method is test() (localheinz, SpacePossum) -* bug #3455 NoEmptyCommentFixer - comment block detection for line ending different than LF (kubawerlos, SpacePossum) -* bug #3458 SilencedDeprecationErrorFixer - fix edge cases (kubawerlos) -* bug #3466 no_whitespace_in_blank_line and no_blank_lines_after_phpdoc fixers bug (kubawerlos, keradus) -* bug #3472 YodaStyleFixer - do not un-Yoda if right side is assignment (SpacePossum, keradus) -* minor #3354 Added missing types to the PhpdocTypesFixer (GrahamCampbell) -* minor #3406 Fix for escaping in README (kubawerlos) -* minor #3430 Fix integration test (SpacePossum) -* minor #3431 Add missing tests (SpacePossum) -* minor #3440 Add a handful of integration tests (BackEndTea) -* minor #3444 IntegrationTest - ensure tests in priority dir are priority tests indeed (keradus) -* minor #3494 Add missing PHPDoc param type (ntzm) -* minor #3495 Swap @var type and element (ntzm) -* minor #3498 NoUnusedImportsFixer - fix deprecation (keradus) - -Changelog for v2.9.1 --------------------- - -* bug #3298 DiffConsoleFormatter - fix output escaping. (SpacePossum) -* bug #3312 PhpUnitTestAnnotationFixer: Only remove prefix if it really is a prefix (localheinz) -* bug #3318 SingleLineCommentStyleFixer - fix closing tag inside comment causes an error (kubawerlos) -* bug #3334 ExplicitStringVariableFixer: handle parsed array and object (Slamdunk) -* bug #3337 BracesFixer: nowdoc bug on template files (Slamdunk) -* bug #3349 Fix stdin handling and add tests for it (keradus) -* bug #3350 PhpUnitNoExpectationAnnotationFixer - fix handling of multiline expectedExceptionMessage annotation (Slamdunk) -* bug #3352 FunctionToConstantFixer - bugfix for get_class with leading backslash (kubawerlos) -* bug #3359 BracesFixer - handle comment for content outside of given block (keradus) -* bug #3371 IsNullFixer must be run before YodaStyleFixer (kubawerlos) -* bug #3373 PhpdocAlignFixer - Fix removing of everything after @ when there is a space after the @ (ntzm) -* bug #3415 FileFilterIterator - input checks and utests (SpacePossum, keradus) -* bug #3420 SingleLineCommentStyleFixer - fix 'strpos() expects parameter 1 to be string, boolean given' (keradus, SpacePossum) -* bug #3428 Fix archive analysing (keradus) -* bug #3429 Fix archive analysing (keradus) -* minor #3137 PHPUnit - use common base class (keradus) -* minor #3311 FinalInternalClassFixer - fix typo (localheinz) -* minor #3328 Remove duplicated space in exceptions (keradus) -* minor #3342 PhpUnitDedicateAssertFixer - Remove unexistent method is_boolean (carusogabriel) -* minor #3345 StdinFileInfo - fix __toString (keradus) -* minor #3346 StdinFileInfo - drop getContents (keradus) -* minor #3347 DX: reapply newest CS (keradus) -* minor #3365 COOKBOOK-FIXERS.md - update to provide definition instead of description (keradus) -* minor #3370 AbstractFixer - FQCN in in exceptions (Slamdunk) -* minor #3372 ProjectCodeTest - fix comment (keradus) -* minor #3393 Method call typos (Slamdunk, keradus) -* minor #3402 Always provide delimiter to `preg_quote` calls (ntzm) -* minor #3403 Remove unused import (ntzm) -* minor #3405 Fix `fopen` mode (ntzm) -* minor #3407 CombineConsecutiveIssetsFixer - Improve description (kubawerlos) -* minor #3408 Improving fixers descriptions (kubawerlos) -* minor #3409 move itests from misc to priority (keradus) -* minor #3411 Better type hinting for AbstractFixerTestCase::$fixer (kubawerlos) -* minor #3412 Convert `strtolower` inside `strpos` to just `stripos` (ntzm) -* minor #3421 DX: Use ::class (keradus) -* minor #3424 AbstractFixerTest: fix expectException arguments (Slamdunk, keradus) -* minor #3425 FixerFactoryTest - test that priority pair fixers have itest (keradus, SpacePossum) -* minor #3427 ConfigurationResolver: fix @return annotation (Slamdunk) - -Changelog for v2.9.0 --------------------- - -* feature #3063 Method chaining indentation fixer (boliev, julienfalque) -* feature #3076 Add ExplicitStringVariableFixer (Slamdunk, keradus) -* feature #3098 MethodSeparationFixer - add class elements separation options (SpacePossum, keradus) -* feature #3155 Add EscapeImplicitBackslashesFixer (Slamdunk) -* feature #3164 Add ExplicitIndirectVariableFixer (Slamdunk, keradus) -* feature #3183 FinalInternalClassFixer introduction (keradus, SpacePossum) -* feature #3187 StaticLambdaFixer - introduction (SpacePossum, keradus) -* feature #3209 PhpdocAlignFixer - Make @method alignable (ntzm) -* feature #3275 Add PhpUnitTestAnnotationFixer (BackEndTea, keradus) - -Changelog for v2.8.4 --------------------- - -* bug #3281 SelfAccessorFixer - stop modifying traits (kubawerlos) -* minor #3195 Add self-update command test (julienfalque) -* minor #3287 FileCacheManagerTest - drop duplicated line (keradus) -* minor #3292 PHPUnit - set memory limit (veewee) -* minor #3306 Token - better input validation (keradus) -* minor #3310 Upgrade PHP Coveralls (keradus) - -Changelog for v2.8.3 --------------------- - -* bug #3173 SimplifiedNullReturnFixer - handle nullable return types (Slamdunk) -* bug #3268 PhpUnitNoExpectationAnnotationFixer - add case with backslashes (keradus, Slamdunk) -* bug #3272 PhpdocTrimFixer - unicode support (SpacePossum) - -Changelog for v2.8.2 --------------------- - -* bug #3225 PhpdocTrimFixer - Fix handling of lines without leading asterisk (julienfalque) -* bug #3241 NoExtraConsecutiveBlankLinesFixer - do not crash on ^M LF only (SpacePossum) -* bug #3242 PhpUnitNoExpectationAnnotationFixer - fix ' handling (keradus) -* bug #3243 PhpUnitExpectationFixer - don't create ->expectExceptionMessage(null) (keradus) -* bug #3244 PhpUnitNoExpectationAnnotationFixer - expectation extracted from annotation shall be separated from rest of code with one blank line (keradus) -* bug #3259 PhpUnitNamespacedFixer - fix isCandidate to not rely on class declaration (keradus) -* bug #3261 PhpUnitNamespacedFixer - properly fix next usage of already fixed class (keradus) -* bug #3262 ToolInfo - support installation by branch as well (keradus) -* bug #3263 NoBreakCommentFixer - Fix handling comment text with PCRE characters (julienfalque) -* bug #3266 PhpUnitConstructFixer - multiple asserts bug (kubawerlos) -* minor #3239 Improve contributing guide and issue template (julienfalque) -* minor #3246 Make ToolInfo methods non-static (julienfalque) -* minor #3249 PhpUnitNoExpectationAnnotationFixerTest - fix hidden conflict (keradus) -* minor #3250 Travis: fail early, spare resources, save the Earth (Slamdunk, keradus) -* minor #3251 Create Title for config file docs section (IanEdington) -* minor #3254 AutoReview/FixerFactoryTest::testFixersPriority: verbose assertion message (Slamdunk) -* minor #3255 IntegrationTest: output exception stack trace (Slamdunk) -* minor #3257 README.rst - Fixed bullet list formatting (moebrowne) - -Changelog for v2.8.1 --------------------- - -* bug #3199 TokensAnalyzer - getClassyElements (SpacePossum) -* bug #3208 BracesFixer - Fix for instantiation in control structures (julienfalque, SpacePossum) -* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (ntzm) -* bug #3216 AbstractLinesBeforeNamespaceFixer - add min. and max. option, not only single target count (SpacePossum) -* bug #3217 TokenizerLinter - fix lack of linting when code is cached (SpacePossum, keradus) -* minor #3200 Skip slow test when Xdebug is loaded (julienfalque) -* minor #3211 Use udiff format in CI (julienfalque) -* minor #3212 Handle rulesets unknown to fabbot.io (julienfalque) -* minor #3219 Normalise references to GitHub in docs (ntzm) -* minor #3226 Remove unused imports (ntzm) -* minor #3231 Fix typos (ntzm) -* minor #3234 Simplify Cache\Signature::equals (ntzm) -* minor #3237 UnconfigurableFixer - use only LF (keradus) -* minor #3238 AbstractFixerTest - fix @cover annotation (keradus) - -Changelog for v2.8.0 --------------------- - -* feature #3065 Add IncrementStyleFixer (kubawerlos) -* feature #3119 Feature checkstyle reporter (K-Phoen) -* feature #3162 Add udiff as diff format (SpacePossum, keradus) -* feature #3170 Add CompactNullableTypehintFixer (jfcherng) -* feature #3189 Add PHP_CS_FIXER_FUTURE_MODE env (keradus) -* feature #3201 Add PHPUnit Migration rulesets and fixers (keradus) -* minor #3149 AbstractProxyFixer - Support multiple proxied fixers (julienfalque) -* minor #3160 Add DeprecatedFixerInterface (kubawerlos) -* minor #3185 IndentationTypeFixerTest - clean up (SpacePossum, keradus) -* minor #3198 Cleanup: add test that there is no deprecated fixer in rule set (kubawerlos) - -Changelog for v2.7.5 --------------------- - -* bug #3225 PhpdocTrimFixer - Fix handling of lines without leading asterisk (julienfalque) -* bug #3241 NoExtraConsecutiveBlankLinesFixer - do not crash on ^M LF only (SpacePossum) -* bug #3262 ToolInfo - support installation by branch as well (keradus) -* bug #3263 NoBreakCommentFixer - Fix handling comment text with PCRE characters (julienfalque) -* bug #3266 PhpUnitConstructFixer - multiple asserts bug (kubawerlos) -* minor #3239 Improve contributing guide and issue template (julienfalque) -* minor #3246 Make ToolInfo methods non-static (julienfalque) -* minor #3250 Travis: fail early, spare resources, save the Earth (Slamdunk, keradus) -* minor #3251 Create Title for config file docs section (IanEdington) -* minor #3254 AutoReview/FixerFactoryTest::testFixersPriority: verbose assertion message (Slamdunk) -* minor #3255 IntegrationTest: output exception stack trace (Slamdunk) - -Changelog for v2.7.4 --------------------- - -* bug #3199 TokensAnalyzer - getClassyElements (SpacePossum) -* bug #3208 BracesFixer - Fix for instantiation in control structures (julienfalque, SpacePossum) -* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (ntzm) -* bug #3216 AbstractLinesBeforeNamespaceFixer - add min. and max. option, not only single target count (SpacePossum) -* bug #3217 TokenizerLinter - fix lack of linting when code is cached (SpacePossum, keradus) -* minor #3200 Skip slow test when Xdebug is loaded (julienfalque) -* minor #3219 Normalise references to GitHub in docs (ntzm) -* minor #3226 Remove unused imports (ntzm) -* minor #3231 Fix typos (ntzm) -* minor #3234 Simplify Cache\Signature::equals (ntzm) -* minor #3237 UnconfigurableFixer - use only LF (keradus) -* minor #3238 AbstractFixerTest - fix @cover annotation (keradus) - -Changelog for v2.7.3 --------------------- - -* bug #3114 SelfAccessorFixer - Fix type declarations replacement (julienfalque) - -Changelog for v2.7.2 --------------------- - -* bug #3062 BraceClassInstantiationTransformer - Fix instantiation inside method call braces case (julienfalque, keradus) -* bug #3083 SingleBlankLineBeforeNamespaceFixer - Fix handling namespace right after opening tag (mlocati) -* bug #3109 SwitchCaseSemicolonToColonFixer - Fix bug with nested constructs (SpacePossum) -* bug #3117 Multibyte character in array key makes alignment incorrect (kubawerlos) -* bug #3123 Cache - File permissions (SpacePossum) -* bug #3138 NoHomoglyphNamesFixer - fix crash on non-ascii but not mapped either (SpacePossum) -* bug #3172 IndentationTypeFixer - do not touch whitespace that is not indentation (SpacePossum) -* bug #3176 NoMultilineWhitespaceBeforeSemicolonsFixer - SpaceAfterSemicolonFixer - priority fix (SpacePossum) -* bug #3193 TokensAnalyzer::getClassyElements - sort result before returning (SpacePossum) -* bug #3196 SelfUpdateCommand - fix exit status when can't determine newest version (julienfalque) -* minor #3107 ConfigurationResolver - improve error message when rule is not found (SpacePossum) -* minor #3113 Add WordMatcher (keradus) -* minor #3128 README: remove deprecated rule from CLI examples (chteuchteu) -* minor #3133 Unify Reporter tests (keradus) -* minor #3134 Allow Symfony 4 (keradus, garak) -* minor #3136 PHPUnit - call hooks from parent class as well (keradus) -* minor #3141 Unify description of deprecated fixer (kubawerlos) -* minor #3144 PhpUnitDedicateAssertFixer - Sort map and array by function name (localheinz) -* minor #3145 misc - Typo (localheinz) -* minor #3150 Fix CircleCI (julienfalque) -* minor #3151 Update gitattributes to ignore next file (keradus) -* minor #3156 Update php-coveralls (keradus) -* minor #3166 README - add link to new gitter channel. (SpacePossum) -* minor #3174 Update UPGRADE.md (vitek-rostislav) -* minor #3180 Fix usage of static variables (kubawerlos) -* minor #3182 Add support for PHPUnit 6, drop PHPUnit 4 (keradus) -* minor #3184 Code grooming - sort content of arrays (keradus) -* minor #3191 Travis - add nightly build to allow_failures due to Travis issues (keradus) -* minor #3197 DX groom CS (keradus) - -Changelog for v2.7.1 --------------------- - -* bug #3115 NoUnneededFinalMethodFixer - fix edge case (Slamdunk) - -Changelog for v2.7.0 --------------------- - -* feature #2573 BinaryOperatorSpaces reworked (SpacePossum, keradus) -* feature #3073 SpaceAfterSemicolonFixer - Add option to remove space in empty for expressions (julienfalque) -* feature #3089 NoAliasFunctionsFixer - add imap aliases (Slamdunk) -* feature #3093 NoUnneededFinalMethodFixer - Remove final keyword from private methods (localheinz, keradus) -* minor #3068 Symfony:risky ruleset - add no_homoglyph_names (keradus) -* minor #3074 [IO] Replace Diff with fork version (SpacePossum) - -Changelog for v2.6.1 --------------------- - -* bug #3052 Fix false positive warning about paths overridden by provided as command arguments (kubawerlos) -* bug #3053 CombineConsecutiveIssetsFixer - fix priority (SpacePossum) -* bug #3058 IsNullFixer - fix whitespace handling (roukmoute) -* bug #3069 MethodArgumentSpaceFixer - new test case (keradus) -* bug #3072 IsNullFixer - fix non_yoda_style edge case (keradus) -* bug #3088 Drop dedicated Phar stub (keradus) -* bug #3100 NativeFunctionInvocationFixer - Fix test if previous token is already namespace separator (SpacePossum) -* bug #3104 DoctrineAnnotationIndentationFixer - Fix str_repeat() error (julienfalque) -* minor #3038 Support PHP 7.2 (SpacePossum, keradus) -* minor #3064 Fix couple of typos (KKSzymanowski) -* minor #3070 YodaStyleFixer - Clarify configuration parameters (SteveJobzniak) -* minor #3078 ConfigurationResolver - hide context while including config file (keradus) -* minor #3080 Direct function call instead of by string (kubawerlos) -* minor #3085 CiIntegrationTest - skip when no git is available (keradus) -* minor #3087 phar-stub.php - allow PHP 7.2 (keradus) -* minor #3092 .travis.yml - fix matrix for PHP 7.1 (keradus) -* minor #3094 NoUnneededFinalMethodFixer - Add test cases (julienfalque) -* minor #3111 DoctrineAnnotationIndentationFixer - Restore test case (julienfalque) - -Changelog for v2.6.0 --------------------- - -* bug #3039 YodaStyleFixer - Fix echo case (SpacePossum, keradus) -* feature #2446 Add YodaStyleFixer (SpacePossum) -* feature #2940 Add NoHomoglyphNamesFixer (mcfedr, keradus) -* feature #3012 Add CombineConsecutiveIssetsFixer (SpacePossum) -* minor #3037 Update SF rule set (SpacePossum) - -Changelog for v2.5.1 --------------------- - -* bug #3002 Bugfix braces (mnabialek) -* bug #3010 Fix handling of Github releases (julienfalque, keradus) -* bug #3015 Fix exception arguments (julienfalque) -* bug #3016 Verify phar file (keradus) -* bug #3021 Risky rules cleanup (kubawerlos) -* bug #3023 RandomApiMigrationFixer - "rand();" to "random_int(0, getrandmax());" fixing (SpacePossum) -* bug #3024 ConfigurationResolver - Handle empty "rules" value (SpacePossum, keradus) -* bug #3031 IndentationTypeFixer - fix handling tabs in indented comments (keradus) -* minor #2999 Notice when paths from config file are overridden by command arguments (julienfalque, keradus) -* minor #3007 Add PHP 7.2 to Travis build matrix (Jean85) -* minor #3009 CiIntegrationTest - run local (SpacePossum) -* minor #3013 Adjust phpunit configuration (localheinz) -* minor #3017 Fix: Risky tests (localheinz) -* minor #3018 Fix: Make sure that data providers are named correctly (localheinz, keradus) -* minor #3032 .php_cs.dist - handling UnexpectedValueException (keradus) -* minor #3033 Use ::class (keradus) -* minor #3034 Follow newest CS (keradus) -* minor #3036 Drop not existing Standalone group from PHPUnit configuration and duplicated internal tags (keradus) -* minor #3042 Update gitter address (keradus) - -Changelog for v2.5.0 --------------------- - -* feature #2770 DoctrineAnnotationSpaces - split assignments options (julienfalque) -* feature #2843 Add estimating-max progress output type (julienfalque) -* feature #2885 Add NoSuperfluousElseifFixer (julienfalque) -* feature #2929 Add NoUnneededCurlyBracesFixer (SpacePossum) -* feature #2944 FunctionToConstantFixer - handle get_class() -> __CLASS__ as well (SpacePossum) -* feature #2953 BlankLineBeforeStatementFixer - Add more statements (localheinz, keradus) -* feature #2972 Add NoUnneededFinalMethodFixer (Slamdunk, keradus) -* feature #2992 Add Doctrine Annotation ruleset (julienfalque) -* minor #2926 Token::getNameForId (SpacePossum) - -Changelog for v2.4.2 --------------------- - -* bug #3002 Bugfix braces (mnabialek) -* bug #3010 Fix handling of Github releases (julienfalque, keradus) -* bug #3015 Fix exception arguments (julienfalque) -* bug #3016 Verify phar file (keradus) -* bug #3021 Risky rules cleanup (kubawerlos) -* bug #3023 RandomApiMigrationFixer - "rand();" to "random_int(0, getrandmax());" fixing (SpacePossum) -* bug #3024 ConfigurationResolver - Handle empty "rules" value (SpacePossum, keradus) -* bug #3031 IndentationTypeFixer - fix handling tabs in indented comments (keradus) -* minor #2999 Notice when paths from config file are overridden by command arguments (julienfalque, keradus) -* minor #3007 Add PHP 7.2 to Travis build matrix (Jean85) -* minor #3009 CiIntegrationTest - run local (SpacePossum) -* minor #3013 Adjust phpunit configuration (localheinz) -* minor #3017 Fix: Risky tests (localheinz) -* minor #3018 Fix: Make sure that data providers are named correctly (localheinz, keradus) -* minor #3032 .php_cs.dist - handling UnexpectedValueException (keradus) -* minor #3033 Use ::class (keradus) -* minor #3034 Follow newest CS (keradus) -* minor #3036 Drop not existing Standalone group from PHPUnit configuration and duplicated internal tags (keradus) -* minor #3042 Update gitter address (keradus) - -Changelog for v2.4.1 --------------------- - -* bug #2925 Improve CI integration suggestion (julienfalque) -* bug #2928 TokensAnalyzer::getClassyElements - Anonymous class support (SpacePossum) -* bug #2931 Psr0Fixer, Psr4Fixer - ignore "new class" syntax (dg, keradus) -* bug #2934 Config - fix handling rule without value (keradus, SpacePossum) -* bug #2939 NoUnusedImportsFixer - Fix extra blank line (julienfalque) -* bug #2941 PHP 7.2 - Group imports with trailing comma support (SpacePossum, julienfalque) -* bug #2954 NoBreakCommentFixer - Disable case sensitivity (julienfalque) -* bug #2959 MethodArgumentSpaceFixer - Skip body of fixed function (greg0ire) -* bug #2984 AlignMultilineCommentFixer - handle uni code (SpacePossum) -* bug #2987 Fix incorrect indentation of comments in `braces` fixer (rob006) -* minor #2924 Add missing Token deprecations (julienfalque) -* minor #2927 WhiteSpaceConfig - update message copy and more strict tests (SpacePossum, keradus) -* minor #2930 Trigger website build (keradus) -* minor #2932 Integrate CircleCI (keradus, aidantwoods) -* minor #2933 ProcessLinterTest - Ensure Windows test only runs on Windows, add a Mac test execution (aidantwoods) -* minor #2935 special handling of fabbot.io service if it's using too old PHP CS Fixer version (keradus) -* minor #2937 Travis: execute 5.3 job on precise (keradus) -* minor #2938 Tests fix configuration of project (SpacePossum, keradus) -* minor #2943 FunctionToConstantFixer - test with diff. arguments than fixable (SpacePossum) -* minor #2945 BlankLineBeforeStatementFixerTest - Fix covered class (julienfalque) -* minor #2946 Detect extra old installations (keradus) -* minor #2947 Test suggested CI integration (keradus) -* minor #2951 AccessibleObject - remove most of usage (keradus) -* minor #2952 BlankLineBeforeStatementFixer - Reference fixer instead of test class (localheinz) -* minor #2955 Travis - stop using old TASK_SCA residue (keradus) -* minor #2968 AssertTokensTrait - don't use AccessibleObject (keradus) -* minor #2969 Shrink down AccessibleObject usage (keradus) -* minor #2982 TrailingCommaInMultilineArrayFixer - simplify isMultilineArray condition (TomasVotruba) -* minor #2989 CiIntegrationTest - fix min supported PHP versions (keradus) - -Changelog for v2.4.0 --------------------- - -* bug #2880 NoBreakCommentFixer - fix edge case (julienfalque) -* bug #2900 VoidReturnFixer - handle functions containing anonymous functions/classes (bendavies, keradus) -* bug #2902 Fix test classes constructor (julienfalque) -* feature #2384 Add BlankLineBeforeStatementFixer (localheinz, keradus, SpacePossum) -* feature #2440 MethodArgumentSpaceFixer - add ensure_fully_multiline option (greg0ire) -* feature #2649 PhpdocAlignFixer - make fixer configurable (ntzm) -* feature #2664 Add DoctrineAnnotationArrayAssignmentFixer (julienfalque) -* feature #2667 Add NoBreakCommentFixer (julienfalque) -* feature #2684 BracesFixer - new options for braces position after control structures and anonymous constructs (aidantwoods, keradus) -* feature #2701 NoExtraConsecutiveBlankLinesFixer - Add more configuration options related to switch statements (SpacePossum) -* feature #2740 Add VoidReturnFixer (mrmark) -* feature #2765 DoctrineAnnotationIndentationFixer - add option to indent mixed lines (julienfalque) -* feature #2815 NonPrintableCharacterFixer - Add option to replace with escape sequences (julienfalque, keradus) -* feature #2822 Add NoNullPropertyInitializationFixer (ntzm, julienfalque, SpacePossum) -* feature #2825 Add PhpdocTypesOrderFixer (julienfalque, keradus) -* feature #2856 CastSpacesFixer - add space option (kubawerlos, keradus) -* feature #2857 Add AlignMultilineCommentFixer (Slamdunk, keradus) -* feature #2866 Add SingleLineCommentStyleFixer, deprecate HashToSlashCommentFixer (Slamdunk, keradus) -* minor #2773 Travis - use stages (keradus) -* minor #2794 Drop HHVM support (keradus, julienfalque) -* minor #2801 ProjectCodeTest - Fix typo in deprecation message (SpacePossum) -* minor #2818 Token become immutable, performance optimizations (keradus) -* minor #2877 Fix PHPMD report (julienfalque) -* minor #2894 NonPrintableCharacterFixer - fix handling required PHP version on PHPUnit 4.x (keradus) -* minor #2921 InvalidForEnvFixerConfigurationException - fix handling in tests on 2.4 line (keradus) - -Changelog for v2.3.3 --------------------- - -* bug #2807 NoUselessElseFixer - Fix detection of conditional block (SpacePossum) -* bug #2809 Phar release - fix readme generation (SpacePossum, keradus) -* bug #2827 MethodArgumentSpaceFixer - Always remove trailing spaces (julienfalque) -* bug #2835 SelfAccessorFixer - class property fix (mnabialek) -* bug #2848 PhpdocIndentFixer - fix edge case with inline phpdoc (keradus) -* bug #2849 BracesFixer - Fix indentation issues with comments (julienfalque) -* bug #2851 Tokens - ensureWhitespaceAtIndex (GrahamCampbell, SpacePossum) -* bug #2854 NoLeadingImportSlashFixer - Removing leading slash from import even when in global space (kubawerlos) -* bug #2858 Support generic types (keradus) -* bug #2869 Fix handling required configuration (keradus) -* bug #2881 NoUnusedImportsFixer - Bug when trying to insert empty token (GrahamCampbell, keradus) -* bug #2882 DocBlock\Annotation - Fix parsing of collections with multiple key types (julienfalque) -* bug #2886 NoSpacesInsideParenthesisFixer - Do not remove whitespace if next token is comment (SpacePossum) -* bug #2888 SingleImportPerStatementFixer - Add support for function and const (SpacePossum) -* bug #2901 Add missing files to archive files (keradus) -* bug #2914 HeredocToNowdocFixer - works with CRLF line ending (dg) -* bug #2920 RuleSet - Update deprecated configuration of fixers (SpacePossum, keradus) -* minor #1531 Update docs for few generic types (keradus) -* minor #2793 COOKBOOK-FIXERS.md - update to current version, fix links (keradus) -* minor #2812 ProcessLinter - compatibility with Symfony 3.3 (keradus) -* minor #2816 Tokenizer - better docs and validation (keradus) -* minor #2817 Tokenizer - use future-compatible interface (keradus) -* minor #2819 Fix benchmark (keradus) -* minor #2820 MagicConstantCasingFixer - Remove defined check (SpacePossum) -* minor #2823 Tokenizer - use future-compatible interface (keradus) -* minor #2824 code grooming (keradus) -* minor #2826 Exceptions - provide utests (localheinz) -* minor #2828 Enhancement: Reference phpunit.xsd from phpunit.xml.dist (localheinz) -* minor #2830 Differs - add tests (localheinz) -* minor #2832 Fix: Use all the columns (localheinz) -* minor #2833 Doctrine\Annotation\Token - provide utests (localheinz) -* minor #2839 Use PHP 7.2 polyfill instead of xml one (keradus) -* minor #2842 Move null to first position in PHPDoc types (julienfalque) -* minor #2850 ReadmeCommandTest - Prevent diff output (julienfalque) -* minor #2859 Fixed typo and dead code removal (GrahamCampbell) -* minor #2863 FileSpecificCodeSample - add tests (localheinz) -* minor #2864 WhitespacesAwareFixerInterface clean up (Slamdunk) -* minor #2865 AutoReview\FixerTest - test configuration samples (SpacePossum, keradus) -* minor #2867 VersionSpecification - Fix copy-paste typo (SpacePossum) -* minor #2870 Tokens - ensureWhitespaceAtIndex - Clear tokens before compare. (SpacePossum) -* minor #2874 LineTest - fix typo (keradus) -* minor #2875 HelpCommand - recursive layout fix (SpacePossum) -* minor #2883 DescribeCommand - Show which sample uses the default configuration (SpacePossum) -* minor #2887 Housekeeping - Strict whitespace checks (SpacePossum) -* minor #2895 ProjectCodeTest - check that classes in no-tests exception exist (keradus) -* minor #2896 Move testing related classes from src to tests (keradus) -* minor #2904 Reapply CS (keradus) -* minor #2910 PhpdocAnnotationWithoutDotFixer - Restrict lowercasing (oschwald) -* minor #2913 Tests - tweaks (SpacePossum, keradus) -* minor #2916 FixerFactory - drop return in sortFixers(), never used (TomasVotruba) - -Changelog for v2.3.2 --------------------- - -* bug #2682 DoctrineAnnotationIndentationFixer - fix handling nested annotations (edhgoose, julienfalque) -* bug #2700 Fix Doctrine Annotation end detection (julienfalque) -* bug #2715 OrderedImportsFixer - handle indented groups (pilgerone) -* bug #2732 HeaderCommentFixer - fix handling blank lines (s7b4) -* bug #2745 Fix Doctrine Annotation newlines (julienfalque) -* bug #2752 FixCommand - fix typo in warning message (mnapoli) -* bug #2757 GeckoPHPUnit is not dev dependency (keradus) -* bug #2759 Update gitattributes (SpacePossum) -* bug #2763 Fix describe command with PSR-0 fixer (julienfalque) -* bug #2768 Tokens::ensureWhitespaceAtIndex - clean up comment check, add check for T_OPEN (SpacePossum) -* bug #2783 Tokens::ensureWhitespaceAtIndex - Fix handling line endings (SpacePossum) -* minor #2304 DX: use PHPMD (keradus) -* minor #2663 Use colors for keywords in commands output (julienfalque, keradus) -* minor #2706 Update README (SpacePossum) -* minor #2714 README.rst - fix wrong value in example (mleko) -* minor #2718 Remove old Symfony exception message expectation (julienfalque) -* minor #2721 Update phpstorm article link to a fresh blog post (valeryan) -* minor #2725 Use method chaining for configuration definitions (julienfalque) -* minor #2727 PHPUnit - use speedtrap (keradus) -* minor #2728 SelfUpdateCommand - verify that it's possible to replace current file (keradus) -* minor #2729 DescribeCommand - add decorated output test (julienfalque) -* minor #2731 BracesFixer - properly pass config in utest dataProvider (keradus) -* minor #2738 Upgrade tests to use new, namespaced PHPUnit TestCase class (keradus) -* minor #2742 Code cleanup (GrahamCampbell, keradus) -* minor #2743 Fixing example and description for GeneralPhpdocAnnotationRemoveFixer (kubawerlos) -* minor #2744 AbstractDoctrineAnnotationFixerTestCase - split fixers test cases (julienfalque) -* minor #2755 Fix compatibility with PHPUnit 5.4.x (keradus) -* minor #2758 Readme - improve CI integration guidelines (keradus) -* minor #2769 Psr0Fixer - remove duplicated example (julienfalque) -* minor #2774 AssertTokens Trait (keradus) -* minor #2775 NoExtraConsecutiveBlankLinesFixer - remove duplicate code sample. (SpacePossum) -* minor #2778 AutoReview - watch that code samples are unique (keradus) -* minor #2787 Add warnings about missing dom ext and require json ext (keradus) -* minor #2792 Use composer-require-checker (keradus) -* minor #2796 Update .gitattributes (SpacePossum) -* minor #2797 Update .gitattributes (SpacePossum) -* minor #2800 PhpdocTypesFixerTest - Fix typo in covers annotation (SpacePossum) - -Changelog for v2.3.1 --------------------- - -Port of v2.2.3. - -* bug #2724 Revert #2554 Add short diff. output format (keradus) - -Changelog for v2.3.0 --------------------- - -* feature #2450 Add ListSyntaxFixer (SpacePossum) -* feature #2708 Add PhpUnitTestClassRequiresCoversFixer (keradus) -* minor #2568 Require PHP 5.6+ (keradus) -* minor #2672 Bump symfony/* deps (keradus) - -Changelog for v2.2.20 ---------------------- - -* bug #3233 PhpdocAlignFixer - Fix linebreak inconsistency (SpacePossum, keradus) -* bug #3445 Rewrite NoUnusedImportsFixer (kubawerlos, julienfalque) -* bug #3597 DeclareStrictTypesFixer - fix bug of removing line (kubawerlos, keradus) -* bug #3605 DoctrineAnnotationIndentationFixer - Fix indentation with mixed lines (julienfalque) -* bug #3606 PhpdocToCommentFixer - allow multiple ( (SpacePossum) -* bug #3684 PhpUnitStrictFixer - Do not fix if not correct # of arguments are used (SpacePossum) -* bug #3715 SingleImportPerStatementFixer - Fix handling whitespace before opening brace (julienfalque) -* bug #3731 PhpdocIndentFixer - crash fix (SpacePossum) -* bug #3765 Fix binary-prefixed double-quoted strings to single quotes (ntzm) -* bug #3770 Handle binary flags in heredoc_to_nowdoc (ntzm) -* bug #3790 ProcessLinter - don't execute external process without timeout! It can freeze! (keradus) -* minor #3548 Make shell scripts POSIX-compatible (EvgenyOrekhov, keradus) -* minor #3568 New Autoreview: Correct option casing (ntzm) -* minor #3590 Use XdebugHandler to avoid performance penalty (AJenbo, keradus) -* minor #3607 PhpdocVarWithoutNameFixer - update sample with @ type (SpacePossum) -* minor #3617 Tests stability patches (Tom Klingenberg, keradus) -* minor #3627 Fix tests execution under phpdbg (keradus) -* minor #3629 ProjectFixerConfigurationTest - test rules are sorted (SpacePossum) -* minor #3639 DX: use benefits of symfony/force-lowest (keradus) -* minor #3641 Update check_trailing_spaces script with upstream (keradus) -* minor #3646 Extract SameStringsConstraint and XmlMatchesXsdConstraint (keradus) -* minor #3647 DX: Add CachingLinter for tests (keradus) -* minor #3649 Update check_trailing_spaces script with upstream (keradus) -* minor #3652 CiIntegrationTest - run tests with POSIX sh, not Bash (keradus) -* minor #3656 DX: Clean ups (SpacePossum) -* minor #3660 Fix do not rely on order of fixing in CiIntegrationTest (kubawerlos) -* minor #3662 DX: Add Smoke/InstallViaComposerTest (keradus) -* minor #3663 DX: During deployment, run all smoke tests and don't allow to skip phar-related ones (keradus) -* minor #3665 CircleCI fix (kubawerlos) -* minor #3666 Use "set -eu" in shell scripts (EvgenyOrekhov) -* minor #3669 Document possible values for subset options (julienfalque, keradus) -* minor #3676 RunnerTest - workaround for failing Symfony v2.8.37 (kubawerlos) -* minor #3680 DX: Tokens - removeLeadingWhitespace and removeTrailingWhitespace must act in same way (SpacePossum) -* minor #3686 README.rst - Format all code-like strings in fixer descriptions (ntzm, keradus) -* minor #3692 DX: Optimize tests (julienfalque) -* minor #3701 Use correct casing for "PHPDoc" (ntzm) -* minor #3703 DX: InstallViaComposerTets - groom naming (keradus) -* minor #3704 DX: Tokens - fix naming (keradus) -* minor #3706 Update homebrew installation instructions (ntzm) -* minor #3713 Use HTTPS whenever possible (fabpot) -* minor #3723 Extend tests coverage (ntzm) -* minor #3733 Disable Composer optimized autoloader by default (julienfalque) -* minor #3748 PhpUnitStrictFixer - extend risky note (jnvsor) -* minor #3749 Make sure PHPUnit is cased correctly in fixers descriptions (kubawerlos) -* minor #3773 AbstractFixerWithAliasedOptionsTestCase - don't export (keradus) -* minor #3796 DX: StdinTest - do not assume name of folder, into which project was cloned (keradus) -* minor #3803 NoEmptyPhpdocFixer/PhpdocAddMissingParamAnnotationFixer - missing priority test (SpacePossum, keradus) -* minor #3804 Cleanup: remove useless constructor comment (kubawerlos) - -Changelog for v2.2.19 ---------------------- - -* bug #3594 ElseifFixer - Bug with alternative syntax (kubawerlos) -* bug #3600 StrictParamFixer - Fix issue when functions are imported (ntzm, keradus) -* minor #3589 FixerFactoryTest - add missing test (SpacePossum, keradus) -* minor #3610 make phar extension optional (Tom Klingenberg, keradus) -* minor #3612 Travis - allow for hhvm failures (keradus) -* minor #3615 Detect fabbot.io (julienfalque, keradus) -* minor #3616 FixerFactoryTest - Don't rely on autovivification (keradus) - -Changelog for v2.2.18 ---------------------- - -* bug #3446 Add PregWrapper (kubawerlos) -* bug #3464 IncludeFixer - fix incorrect order of fixing (kubawerlos, SpacePossum) -* bug #3496 Bug in Tokens::removeLeadingWhitespace (kubawerlos, SpacePossum, keradus) -* bug #3557 AbstractDoctrineAnnotationFixer: edge case bugfix (Slamdunk) -* bug #3574 GeneralPhpdocAnnotationRemoveFixer - remove PHPDoc if no content is left (SpacePossum) -* minor #3563 DX add missing covers annotations (keradus) -* minor #3565 Use EventDispatcherInterface instead of EventDispatcher when possible (keradus) -* minor #3572 DX: allow for more phpunit-speedtrap versions to support more PHPUnit versions (keradus) -* minor #3576 Fix Doctrine Annotation test cases merging (julienfalque) - -Changelog for v2.2.17 ---------------------- - -* bug #3504 NoBlankLinesAfterPhpdocFixer - allow blank line before declare statement (julienfalque) -* bug #3522 Remove LOCK_EX (SpacePossum) -* bug #3560 SelfAccessorFixer is risky (Slamdunk) -* minor #3435 Add tests for general_phpdoc_annotation_remove (BackEndTea) -* minor #3484 Create Tokens::findBlockStart (ntzm) -* minor #3512 Add missing array typehints (ntzm) -* minor #3516 Use `null|type` instead of `?type` in PHPDocs (ntzm) -* minor #3518 FixerFactoryTest - Test each priority test file is listed as test (SpacePossum) -* minor #3520 Fix typos: ran vs. run (SpacePossum) -* minor #3521 Use HTTPS (carusogabriel) -* minor #3526 Remove gecko dependency (SpacePossum, keradus, julienfalque) -* minor #3531 Backport PHPMD to LTS version to ease maintainability (keradus) -* minor #3532 Implement Tokens::findOppositeBlockEdge (ntzm) -* minor #3533 DX: SCA - drop src/Resources exclusion (keradus) -* minor #3538 Don't use third parameter of Tokens::findBlockStart (ntzm) -* minor #3542 Enhancement: Run composer-normalize on Travis CI (localheinz, keradus) -* minor #3555 DX: composer.json - drop branch-alias, branch is already following the version (keradus) -* minor #3556 DX: Add AutoReview/ComposerTest (keradus) -* minor #3559 Don't expose new files under Test namespace (keradus) - -Changelog for v2.2.16 ---------------------- - -* bug #3502 Fix missing file in export (keradus) - -Changelog for v2.2.15 ---------------------- - -* bug #3367 NoUnusedImportsFixer - fix comment handling (SpacePossum, keradus) -* bug #3455 NoEmptyCommentFixer - comment block detection for line ending different than LF (kubawerlos, SpacePossum) -* bug #3458 SilencedDeprecationErrorFixer - fix edge cases (kubawerlos) -* bug #3466 no_whitespace_in_blank_line and no_blank_lines_after_phpdoc fixers bug (kubawerlos, keradus) -* minor #3354 Added missing types to the PhpdocTypesFixer (GrahamCampbell) -* minor #3406 Fix for escaping in README (kubawerlos) -* minor #3431 Add missing tests (SpacePossum) -* minor #3440 Add a handful of integration tests (BackEndTea) -* minor #3444 IntegrationTest - ensure tests in priority dir are priority tests indeed (keradus) -* minor #3494 Add missing PHPDoc param type (ntzm) -* minor #3495 Swap @var type and element (ntzm) -* minor #3498 NoUnusedImportsFixer - fix deprecation (keradus) - -Changelog for v2.2.14 ---------------------- - -* bug #3298 DiffConsoleFormatter - fix output escaping. (SpacePossum) -* bug #3337 BracesFixer: nowdoc bug on template files (Slamdunk) -* bug #3349 Fix stdin handling and add tests for it (keradus) -* bug #3359 BracesFixer - handle comment for content outside of given block (keradus) -* bug #3415 FileFilterIterator - input checks and utests (SpacePossum, keradus) -* bug #3429 Fix archive analysing (keradus) -* minor #3137 PHPUnit - use common base class (keradus) -* minor #3342 PhpUnitDedicateAssertFixer - Remove unexistent method is_boolean (carusogabriel) -* minor #3345 StdinFileInfo - fix `__toString` (keradus) -* minor #3346 StdinFileInfo - drop getContents (keradus) -* minor #3347 DX: reapply newest CS (keradus) -* minor #3365 COOKBOOK-FIXERS.md - update to provide definition instead of description (keradus) -* minor #3370 AbstractFixer - FQCN in in exceptions (Slamdunk) -* minor #3372 ProjectCodeTest - fix comment (keradus) -* minor #3402 Always provide delimiter to `preg_quote` calls (ntzm) -* minor #3403 Remove unused import (ntzm) -* minor #3405 Fix `fopen` mode (ntzm) -* minor #3408 Improving fixers descriptions (kubawerlos) -* minor #3409 move itests from misc to priority (keradus) -* minor #3411 Better type hinting for AbstractFixerTestCase::$fixer (kubawerlos) -* minor #3412 Convert `strtolower` inside `strpos` to just `stripos` (ntzm) -* minor #3425 FixerFactoryTest - test that priority pair fixers have itest (keradus, SpacePossum) -* minor #3427 ConfigurationResolver: fix @return annotation (Slamdunk) - -Changelog for v2.2.13 ---------------------- - -* bug #3281 SelfAccessorFixer - stop modifying traits (kubawerlos) -* minor #3195 Add self-update command test (julienfalque) -* minor #3292 PHPUnit - set memory limit (veewee) -* minor #3306 Token - better input validation (keradus) - -Changelog for v2.2.12 ---------------------- - -* bug #3173 SimplifiedNullReturnFixer - handle nullable return types (Slamdunk) -* bug #3272 PhpdocTrimFixer - unicode support (SpacePossum) - -Changelog for v2.2.11 ---------------------- - -* bug #3225 PhpdocTrimFixer - Fix handling of lines without leading asterisk (julienfalque) -* bug #3262 ToolInfo - support installation by branch as well (keradus) -* bug #3266 PhpUnitConstructFixer - multiple asserts bug (kubawerlos) -* minor #3239 Improve contributing guide and issue template (julienfalque) -* minor #3246 Make ToolInfo methods non-static (julienfalque) -* minor #3250 Travis: fail early, spare resources, save the Earth (Slamdunk, keradus) -* minor #3251 Create Title for config file docs section (IanEdington) -* minor #3254 AutoReview/FixerFactoryTest::testFixersPriority: verbose assertion message (Slamdunk) - -Changelog for v2.2.10 ---------------------- - -* bug #3199 TokensAnalyzer - getClassyElements (SpacePossum) -* bug #3208 BracesFixer - Fix for instantiation in control structures (julienfalque, SpacePossum) -* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (ntzm) -* bug #3216 AbstractLinesBeforeNamespaceFixer - add min. and max. option, not only single target count (SpacePossum) -* bug #3217 TokenizerLinter - fix lack of linting when code is cached (SpacePossum, keradus) -* minor #3200 Skip slow test when Xdebug is loaded (julienfalque) -* minor #3219 Normalise references to GitHub in docs (ntzm) -* minor #3226 Remove unused imports (ntzm) -* minor #3231 Fix typos (ntzm) -* minor #3234 Simplify Cache\Signature::equals (ntzm) -* minor #3237 UnconfigurableFixer - use only LF (keradus) -* minor #3238 AbstractFixerTest - fix @cover annotation (keradus) - -Changelog for v2.2.9 --------------------- - -* bug #3062 BraceClassInstantiationTransformer - Fix instantiation inside method call braces case (julienfalque, keradus) -* bug #3083 SingleBlankLineBeforeNamespaceFixer - Fix handling namespace right after opening tag (mlocati) -* bug #3109 SwitchCaseSemicolonToColonFixer - Fix bug with nested constructs (SpacePossum) -* bug #3123 Cache - File permissions (SpacePossum) -* bug #3172 IndentationTypeFixer - do not touch whitespace that is not indentation (SpacePossum) -* bug #3176 NoMultilineWhitespaceBeforeSemicolonsFixer - SpaceAfterSemicolonFixer - priority fix (SpacePossum) -* bug #3193 TokensAnalyzer::getClassyElements - sort result before returning (SpacePossum) -* bug #3196 SelfUpdateCommand - fix exit status when can't determine newest version (julienfalque) -* minor #3107 ConfigurationResolver - improve error message when rule is not found (SpacePossum) -* minor #3113 Add WordMatcher (keradus) -* minor #3133 Unify Reporter tests (keradus) -* minor #3134 Allow Symfony 4 (keradus, garak) -* minor #3136 PHPUnit - call hooks from parent class as well (keradus) -* minor #3145 misc - Typo (localheinz) -* minor #3150 Fix CircleCI (julienfalque) -* minor #3151 Update gitattributes to ignore next file (keradus) -* minor #3156 Update php-coveralls (keradus) -* minor #3166 README - add link to new gitter channel. (SpacePossum) -* minor #3174 Update UPGRADE.md (vitek-rostislav) -* minor #3180 Fix usage of static variables (kubawerlos) -* minor #3184 Code grooming - sort content of arrays (keradus) -* minor #3191 Travis - add nightly build to allow_failures due to Travis issues (keradus) -* minor #3197 DX groom CS (keradus) - -Changelog for v2.2.8 --------------------- - -* bug #3052 Fix false positive warning about paths overridden by provided as command arguments (kubawerlos) -* bug #3058 IsNullFixer - fix whitespace handling (roukmoute) -* bug #3072 IsNullFixer - fix non_yoda_style edge case (keradus) -* bug #3088 Drop dedicated Phar stub (keradus) -* bug #3100 NativeFunctionInvocationFixer - Fix test if previous token is already namespace separator (SpacePossum) -* bug #3104 DoctrineAnnotationIndentationFixer - Fix str_repeat() error (julienfalque) -* minor #3038 Support PHP 7.2 (SpacePossum, keradus) -* minor #3064 Fix couple of typos (KKSzymanowski) -* minor #3078 ConfigurationResolver - hide context while including config file (keradus) -* minor #3080 Direct function call instead of by string (kubawerlos) -* minor #3085 CiIntegrationTest - skip when no git is available (keradus) -* minor #3087 phar-stub.php - allow PHP 7.2 (keradus) - -Changelog for v2.2.7 --------------------- - -* bug #3002 Bugfix braces (mnabialek) -* bug #3010 Fix handling of Github releases (julienfalque, keradus) -* bug #3015 Fix exception arguments (julienfalque) -* bug #3016 Verify phar file (keradus) -* bug #3021 Risky rules cleanup (kubawerlos) -* bug #3023 RandomApiMigrationFixer - "rand();" to "random_int(0, getrandmax());" fixing (SpacePossum) -* bug #3024 ConfigurationResolver - Handle empty "rules" value (SpacePossum, keradus) -* bug #3031 IndentationTypeFixer - fix handling tabs in indented comments (keradus) -* minor #2999 Notice when paths from config file are overridden by command arguments (julienfalque, keradus) -* minor #3007 Add PHP 7.2 to Travis build matrix (Jean85) -* minor #3009 CiIntegrationTest - run local (SpacePossum) -* minor #3013 Adjust phpunit configuration (localheinz) -* minor #3017 Fix: Risky tests (localheinz) -* minor #3018 Fix: Make sure that data providers are named correctly (localheinz, keradus) -* minor #3032 .php_cs.dist - handling UnexpectedValueException (keradus) -* minor #3034 Follow newest CS (keradus) -* minor #3036 Drop not existing Standalone group from PHPUnit configuration and duplicated internal tags (keradus) -* minor #3042 Update gitter address (keradus) - -Changelog for v2.2.6 --------------------- - -* bug #2925 Improve CI integration suggestion (julienfalque) -* bug #2928 TokensAnalyzer::getClassyElements - Anonymous class support (SpacePossum) -* bug #2931 Psr0Fixer, Psr4Fixer - ignore "new class" syntax (dg, keradus) -* bug #2934 Config - fix handling rule without value (keradus, SpacePossum) -* bug #2939 NoUnusedImportsFixer - Fix extra blank line (julienfalque) -* bug #2941 PHP 7.2 - Group imports with trailing comma support (SpacePossum, julienfalque) -* bug #2987 Fix incorrect indentation of comments in `braces` fixer (rob006) -* minor #2927 WhiteSpaceConfig - update message copy and more strict tests (SpacePossum, keradus) -* minor #2930 Trigger website build (keradus) -* minor #2932 Integrate CircleCI (keradus, aidantwoods) -* minor #2933 ProcessLinterTest - Ensure Windows test only runs on Windows, add a Mac test execution (aidantwoods) -* minor #2935 special handling of fabbot.io service if it's using too old PHP CS Fixer version (keradus) -* minor #2937 Travis: execute 5.3 job on precise (keradus) -* minor #2938 Tests fix configuration of project (SpacePossum, keradus) -* minor #2943 FunctionToConstantFixer - test with diff. arguments than fixable (SpacePossum) -* minor #2946 Detect extra old installations (keradus) -* minor #2947 Test suggested CI integration (keradus) -* minor #2951 AccessibleObject - remove most of usage (keradus) -* minor #2969 Shrink down AccessibleObject usage (keradus) -* minor #2982 TrailingCommaInMultilineArrayFixer - simplify isMultilineArray condition (TomasVotruba) - -Changelog for v2.2.5 --------------------- - -* bug #2807 NoUselessElseFixer - Fix detection of conditional block (SpacePossum) -* bug #2809 Phar release - fix readme generation (SpacePossum, keradus) -* bug #2827 MethodArgumentSpaceFixer - Always remove trailing spaces (julienfalque) -* bug #2835 SelfAccessorFixer - class property fix (mnabialek) -* bug #2848 PhpdocIndentFixer - fix edge case with inline phpdoc (keradus) -* bug #2849 BracesFixer - Fix indentation issues with comments (julienfalque) -* bug #2851 Tokens - ensureWhitespaceAtIndex (GrahamCampbell, SpacePossum) -* bug #2854 NoLeadingImportSlashFixer - Removing leading slash from import even when in global space (kubawerlos) -* bug #2858 Support generic types (keradus) -* bug #2869 Fix handling required configuration (keradus) -* bug #2881 NoUnusedImportsFixer - Bug when trying to insert empty token (GrahamCampbell, keradus) -* bug #2882 DocBlock\Annotation - Fix parsing of collections with multiple key types (julienfalque) -* bug #2886 NoSpacesInsideParenthesisFixer - Do not remove whitespace if next token is comment (SpacePossum) -* bug #2888 SingleImportPerStatementFixer - Add support for function and const (SpacePossum) -* bug #2901 Add missing files to archive files (keradus) -* bug #2914 HeredocToNowdocFixer - works with CRLF line ending (dg) -* bug #2920 RuleSet - Update deprecated configuration of fixers (SpacePossum, keradus) -* minor #1531 Update docs for few generic types (keradus) -* minor #2793 COOKBOOK-FIXERS.md - update to current version, fix links (keradus) -* minor #2812 ProcessLinter - compatibility with Symfony 3.3 (keradus) -* minor #2816 Tokenizer - better docs and validation (keradus) -* minor #2817 Tokenizer - use future-compatible interface (keradus) -* minor #2819 Fix benchmark (keradus) -* minor #2824 code grooming (keradus) -* minor #2826 Exceptions - provide utests (localheinz) -* minor #2828 Enhancement: Reference phpunit.xsd from phpunit.xml.dist (localheinz) -* minor #2830 Differs - add tests (localheinz) -* minor #2832 Fix: Use all the columns (localheinz) -* minor #2833 Doctrine\Annotation\Token - provide utests (localheinz) -* minor #2839 Use PHP 7.2 polyfill instead of xml one (keradus) -* minor #2842 Move null to first position in PHPDoc types (julienfalque) -* minor #2850 ReadmeCommandTest - Prevent diff output (julienfalque) -* minor #2859 Fixed typo and dead code removal (GrahamCampbell) -* minor #2863 FileSpecificCodeSample - add tests (localheinz) -* minor #2864 WhitespacesAwareFixerInterface clean up (Slamdunk) -* minor #2865 AutoReview\FixerTest - test configuration samples (SpacePossum, keradus) -* minor #2867 VersionSpecification - Fix copy-paste typo (SpacePossum) -* minor #2874 LineTest - fix typo (keradus) -* minor #2875 HelpCommand - recursive layout fix (SpacePossum) -* minor #2883 DescribeCommand - Show which sample uses the default configuration (SpacePossum) -* minor #2887 Housekeeping - Strict whitespace checks (SpacePossum) -* minor #2895 ProjectCodeTest - check that classes in no-tests exception exist (keradus) -* minor #2896 Move testing related classes from src to tests (keradus) -* minor #2904 Reapply CS (keradus) -* minor #2910 PhpdocAnnotationWithoutDotFixer - Restrict lowercasing (oschwald) -* minor #2913 Tests - tweaks (SpacePossum, keradus) -* minor #2916 FixerFactory - drop return in sortFixers(), never used (TomasVotruba) - -Changelog for v2.2.4 --------------------- - -* bug #2682 DoctrineAnnotationIndentationFixer - fix handling nested annotations (edhgoose, julienfalque) -* bug #2700 Fix Doctrine Annotation end detection (julienfalque) -* bug #2715 OrderedImportsFixer - handle indented groups (pilgerone) -* bug #2732 HeaderCommentFixer - fix handling blank lines (s7b4) -* bug #2745 Fix Doctrine Annotation newlines (julienfalque) -* bug #2752 FixCommand - fix typo in warning message (mnapoli) -* bug #2757 GeckoPHPUnit is not dev dependency (keradus) -* bug #2759 Update gitattributes (SpacePossum) -* bug #2763 Fix describe command with PSR-0 fixer (julienfalque) -* bug #2768 Tokens::ensureWhitespaceAtIndex - clean up comment check, add check for T_OPEN (SpacePossum) -* bug #2783 Tokens::ensureWhitespaceAtIndex - Fix handling line endings (SpacePossum) -* minor #2663 Use colors for keywords in commands output (julienfalque, keradus) -* minor #2706 Update README (SpacePossum) -* minor #2714 README.rst - fix wrong value in example (mleko) -* minor #2721 Update phpstorm article link to a fresh blog post (valeryan) -* minor #2727 PHPUnit - use speedtrap (keradus) -* minor #2728 SelfUpdateCommand - verify that it's possible to replace current file (keradus) -* minor #2729 DescribeCommand - add decorated output test (julienfalque) -* minor #2731 BracesFixer - properly pass config in utest dataProvider (keradus) -* minor #2738 Upgrade tests to use new, namespaced PHPUnit TestCase class (keradus) -* minor #2743 Fixing example and description for GeneralPhpdocAnnotationRemoveFixer (kubawerlos) -* minor #2744 AbstractDoctrineAnnotationFixerTestCase - split fixers test cases (julienfalque) -* minor #2755 Fix compatibility with PHPUnit 5.4.x (keradus) -* minor #2758 Readme - improve CI integration guidelines (keradus) -* minor #2769 Psr0Fixer - remove duplicated example (julienfalque) -* minor #2775 NoExtraConsecutiveBlankLinesFixer - remove duplicate code sample. (SpacePossum) -* minor #2778 AutoReview - watch that code samples are unique (keradus) -* minor #2787 Add warnings about missing dom ext and require json ext (keradus) -* minor #2792 Use composer-require-checker (keradus) -* minor #2796 Update .gitattributes (SpacePossum) -* minor #2800 PhpdocTypesFixerTest - Fix typo in covers annotation (SpacePossum) - -Changelog for v2.2.3 --------------------- - -* bug #2724 Revert #2554 Add short diff. output format (keradus) - -Changelog for v2.2.2 --------------------- - -Warning, this release breaks BC due to introduction of: - -* minor #2554 Add short diff. output format (SpacePossum, keradus) - -That PR was reverted in v2.2.3, which should be used instead of v2.2.2. - -* bug #2545 RuleSet - change resolvement (SpacePossum) -* bug #2686 Commands readme and describe - fix rare casing when not displaying some possible options of configuration (keradus) -* bug #2711 FixCommand - fix diff optional value handling (keradus) -* minor #2688 AppVeyor - Remove github oauth (keradus) -* minor #2703 Clean ups - No mixed annotations (SpacePossum) -* minor #2704 Create PHP70Migration:risky ruleset (keradus) -* minor #2707 Deprecate other than "yes" or "no" for input options (SpacePossum) -* minor #2709 code grooming (keradus) -* minor #2710 Travis - run more rules on TASK_SCA (keradus) - -Changelog for v2.2.1 --------------------- - -* bug #2621 Tokenizer - fix edge cases with empty code, registered found tokens and code hash (SpacePossum, keradus) -* bug #2674 SemicolonAfterInstructionFixer - Fix case where block ends with an opening curly brace (ntzm) -* bug #2675 ProcessOutputTest - update tests to pass on newest Symfony components under Windows (keradus) -* minor #2651 Fix UPGRADE.md table syntax so it works in GitHub (ntzm, keradus) -* minor #2665 Travis - Improve trailing spaces detection (julienfalque) -* minor #2666 TransformersTest - move test to auto-review group (keradus) -* minor #2668 add covers annotation (keradus) -* minor #2669 TokensTest - grooming (SpacePossum) -* minor #2670 AbstractFixer: use applyFix instead of fix (Slamdunk) -* minor #2677 README: Correct progressbar option support (Laurens St�tzel) - -Changelog for v2.2.0 --------------------- - -* bug #2640 NoExtraConsecutiveBlankLinesFixer - Fix single indent characters not working (ntzm) -* feature #2220 Doctrine annotation fixers (julienfalque) -* feature #2431 MethodArgumentSpaceFixer: allow to retain multiple spaces after comma (Slamdunk) -* feature #2459 BracesFixer - Add option for keeping opening brackets on the same line (jtojnar, SpacePossum) -* feature #2486 Add FunctionToConstantFixer (SpacePossum, keradus) -* feature #2505 FunctionDeclarationFixer - Make space after anonymous function configurable (jtojnar, keradus) -* feature #2509 FullOpeningTagFixer - Ensure opening PHP tag is lowercase (jtojnar) -* feature #2532 FixCommand - add stop-on-violation option (keradus) -* feature #2591 Improve process output (julienfalque) -* feature #2603 Add InvisibleSymbols Fixer (ivan1986, keradus) -* feature #2642 Add MagicConstantCasingFixer (ntzm) -* feature #2657 PhpdocToCommentFixer - Allow phpdoc for language constructs (ceeram, SpacePossum) -* minor #2500 Configuration resolver (julienfalque, SpacePossum, keradus) -* minor #2566 Show more details on errors and exceptions. (SpacePossum, julienfalque) -* minor #2597 HHVM - bump required version to 3.18 (keradus) -* minor #2606 FixCommand - fix missing comment close tag (keradus) -* minor #2623 OrderedClassElementsFixer - remove dead code (SpacePossum) -* minor #2625 Update Symfony and Symfony:risky rulesets (keradus) -* minor #2626 TernaryToNullCoalescingFixer - adjust ruleset membership and description (keradus) -* minor #2635 ProjectCodeTest - watch that all classes have dedicated tests (keradus) -* minor #2647 DescribeCommandTest - remove deprecated code usage (julienfalque) -* minor #2648 Move non-code covering tests to AutoReview subnamespace (keradus) -* minor #2652 NoSpacesAroundOffsetFixerTest - fix deprecation (keradus) -* minor #2656 Code grooming (keradus) -* minor #2659 Travis - speed up preparation for phar building (keradus) -* minor #2660 Fixed typo in suggest for ext-mbstring (pascal-hofmann) -* minor #2661 NonPrintableCharacterFixer - include into Symfony:risky ruleset (keradus) - -Changelog for v2.1.3 --------------------- - -* bug #2358 Cache - Deal with signature encoding (keradus, GrahamCampbell) -* bug #2475 Add shorthand array destructing support (SpacePossum, keradus) -* bug #2595 NoUnusedImportsFixer - Fix import usage detection with properties (julienfalque) -* bug #2605 PhpdocAddMissingParamAnnotationFixer, PhpdocOrderFixer - fix priority issue (SpacePossum) -* bug #2607 Fixers - better comments handling (SpacePossum) -* bug #2612 BracesFixer - Fix early bracket close for do-while loop inside an if without brackets (felixgomez) -* bug #2614 Ensure that '*Fixer::fix()' won't crash when running on non-candidate collection (keradus) -* bug #2630 HeaderCommentFixer - Fix trailing whitespace not removed after AliasFunctionsFixer (kalessil) -* feature #1275 Added PhpdocInlineTagFixer (SpacePossum, keradus) -* feature #1292 Added MethodSeparationFixer (SpacePossum) -* feature #1383 Introduce rules and sets (keradus) -* feature #1416 Mark fixers as risky (keradus) -* feature #1440 Made AbstractFixerTestCase and AbstractIntegrationTestCase public (keradus) -* feature #1489 Added Psr4Fixer (GrahamCampbell) -* feature #1497 ExtraEmptyLinesFixer - allow to remove empty blank lines after configured tags (SpacePossum) -* feature #1529 Added PhpdocPropertyFixer, refactored Tag and Annotation (GrahamCampbell) -* feature #1628 Added OrderedClassElementsFixer (gharlan) -* feature #1742 path argument is used to create an intersection with existing finder (keradus, gharlan) -* feature #1779 Added GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocAnnotationRenameFixer (keradus) -* feature #1811 Added NoSpacesInsideOffsetFixer (phansys) -* feature #1819 Added DirConstantFixer, ModernizeTypesCastingFixer, RandomApiMigrationFixer (kalessil, SpacePossum, keradus) -* feature #1825 Added junit format (ekho) -* feature #1862 FixerFactory - Do not allow conflicting fixers (SpacePossum) -* feature #1888 Cache refactoring, better cache handling in dry-run mode (localheinz) -* feature #1889 Added SingleClassElementPerStatementFixer (phansys, SpacePossum) -* feature #1903 FixCommand - allow to pass multiple path argument (keradus) -* feature #1913 Introduce path-mode CLI option (keradus) -* feature #1949 Added DeclareStrictTypesFixer, introduce options for HeaderCommentFixer (Seldaek, SpacePossum, keradus) -* feature #1955 Introduce CT_ARRAY_INDEX_CURLY_BRACE_OPEN and CT_ARRAY_INDEX_CURLY_BRACE_CLOSE (keradus) -* feature #1958 Added NormalizeIndexBraceFixer (keradus) -* feature #2069 Add semicolon after instruction fixer (SpacePossum) -* feature #2089 Add `no_spaces_around_offset` fixer (phansys) -* feature #2179 BinaryOperatorSpacesFixer - add (un)align configuration options (SpacePossum) -* feature #2192 Add PowToExponentiationFixer (SpacePossum, keradus) -* feature #2207 Added ReturnTypeDeclarationFixer (keradus) -* feature #2213 VisibilityRequiredFixer - Add support for class const visibility added in PHP7.1. (SpacePossum) -* feature #2221 Add support for user-defined whitespaces (keradus) -* feature #2244 Config cleanup (keradus, SpacePossum) -* feature #2247 PhpdocAnnotationWithoutDotFixer - support more cases (keradus) -* feature #2289 Add PhpdocAddMissingParamAnnotationFixer (keradus) -* feature #2331 Add DescribeCommand (keradus, SpacePossum) -* feature #2332 New colours of diff on console (keradus) -* feature #829 add support for .php_cs.dist file (keradus) -* feature #998 MethodArgumentSpaceFixer - enhance, now only one space after comma (trilopin, keradus) -* minor #1007 Simplify Transformers (keradus) -* minor #1050 Make Config's setDir() fluent like the rest of methods (gonzaloserrano) -* minor #1062 Added NamespaceOperatorTransformer (gharlan) -* minor #1078 Exit status should be 0 if there are no errors (gharlan) -* minor #1101 CS: fix project itself (localheinz) -* minor #1102 Enhancement: List errors occurred before, during and after fixing (localheinz) -* minor #1105 Token::isStructureAlternativeEnd - remove unused method (keradus) -* minor #1106 readme grooming (SpacePossum, keradus) -* minor #1115 Fixer - simplify flow (keradus) -* minor #1118 Process output refactor (SpacePossum) -* minor #1132 Linter - public methods should be first (keradus) -* minor #1134 Token::isWhitespace - simplify interface (keradus) -* minor #1140 FixerInterface - check if fixer should be applied by isCandidate method (keradus) -* minor #1146 Linter - detect executable (keradus) -* minor #1156 deleted old ConfigurationResolver class (keradus) -* minor #1160 Grammar fix to README (Falkirks) -* minor #1174 DefaultFinder - boost performance by not filtering when files array is empty (keradus) -* minor #1179 Exit with non-zero if invalid files were detected prior to fixing (localheinz) -* minor #1186 Finder - do not search for .xml and .yml files (keradus) -* minor #1206 BracesFixer::getClassyTokens - remove duplicated method (keradus) -* minor #1222 Made fixers final (GrahamCampbell) -* minor #1229 Tokens - Fix PHPDoc (SpacePossum) -* minor #1241 More details on exceptions. (SpacePossum) -* minor #1263 Made internal classes final (GrahamCampbell) -* minor #1272 Readme - Add spaces around PHP-CS-Fixer headers (Soullivaneuh) -* minor #1283 Error - Fixed type phpdoc (GrahamCampbell) -* minor #1284 Token - Fix PHPDoc (SpacePossum) -* minor #1314 Added missing internal annotations (keradus) -* minor #1329 Psr0Fixer - move to contrib level (gharlan) -* minor #1340 Clean ups (SpacePossum) -* minor #1341 Linter - throw exception when write fails (SpacePossum) -* minor #1348 Linter - Prefer error output when throwing a linting exception (GrahamCampbell) -* minor #1350 Add "phpt" as a valid extension (henriquemoody) -* minor #1376 Add time and memory to XML report (junichi11) -* minor #1387 Made all test classes final (keradus) -* minor #1388 Made all tests internal (keradus) -* minor #1390 Added ProjectCodeTest that tests if all classes inside tests are internal and final or abstract (keradus) -* minor #1391 Fixer::getLevelAsString is no longer static (keradus) -* minor #1392 Add report to XML report as the root node (junichi11) -* minor #1394 Stop mixing level from config file and fixers from CLI arg when one of fixers has dash (keradus) -* minor #1426 MethodSeparationFixer - Fix spacing around comments (SpacePossum, keradus) -* minor #1432 Fixer check on factory (Soullivaneuh) -* minor #1434 Add Test\AccessibleObject class (keradus) -* minor #1442 FixerFactory - disallow to register multiple fixers with same name (keradus) -* minor #1477 rename PhpdocShortDescriptionFixer into PhpdocSummaryFixer (keradus) -* minor #1481 Fix running the tests (keradus) -* minor #1482 move AbstractTransformerTestBase class outside Tests dir (keradus) -* minor #1530 Added missing internal annotation (GrahamCampbell) -* minor #1534 Clean ups (SpacePossum) -* minor #1536 Typo fix (fabpot) -* minor #1555 Fixed indentation in composer.json (GrahamCampbell) -* minor #1558 [2.0] Cleanup the tags property in the abstract phpdoc types fixer (GrahamCampbell) -* minor #1567 PrintToEchoFixer - add to symfony rule set (gharlan) -* minor #1607 performance improvement (gharlan) -* minor #1621 Switch to PSR-4 (keradus) -* minor #1631 Configuration exceptions exception cases on master. (SpacePossum) -* minor #1646 Remove non-default Config/Finder classes (keradus) -* minor #1648 Fixer - avoid extra calls to getFileRelativePathname (GrahamCampbell) -* minor #1649 Consider the php version when caching (GrahamCampbell) -* minor #1652 Rename namespace "Symfony\CS" to "PhpCsFixer" (gharlan) -* minor #1666 new Runner, ProcessOutputInterface, DifferInterface and ResultInterface (keradus) -* minor #1674 Config - add addCustomFixers method (PedroTroller) -* minor #1677 Enhance tests (keradus) -* minor #1695 Rename Fixers (keradus) -* minor #1702 Upgrade guide (keradus) -* minor #1707 ExtraEmptyLinesFixer - fix configure docs (keradus) -* minor #1712 NoExtraConsecutiveBlankLinesFixer - Remove blankline after curly brace open (SpacePossum) -* minor #1718 CLI: rename --config-file argument (keradus) -* minor #1722 Renamed not_operators_with_space to not_operator_with_space (GrahamCampbell) -* minor #1728 PhpdocNoSimplifiedNullReturnFixer - rename back to PhpdocNoEmptyReturnFixer (keradus) -* minor #1729 Renamed whitespacy_lines to no_whitespace_in_blank_lines (GrahamCampbell) -* minor #1731 FixCommand - value for config option is required (keradus) -* minor #1732 move fixer classes from level subdirs to thematic subdirs (gharlan, keradus) -* minor #1733 ConfigurationResolver - look for .php_cs file in cwd as well (keradus) -* minor #1737 RuleSet/FixerFactory - sort arrays content (keradus) -* minor #1751 FixerInterface::configure - method should always override configuration, not patch it (keradus) -* minor #1752 Remove unused code (keradus) -* minor #1756 Finder - clean up code (keradus) -* minor #1757 Psr0Fixer - change way of configuring the fixer (keradus) -* minor #1762 Remove ConfigInterface::getDir, ConfigInterface::setDir, Finder::setDir and whole FinderInterface (keradus) -* minor #1764 Remove ConfigAwareInterface (keradus) -* minor #1780 AbstractFixer - throw error on configuring non-configurable Fixer (keradus) -* minor #1782 rename fixers (gharlan) -* minor #1815 NoSpacesInsideParenthesisFixer - simplify implementation (keradus) -* minor #1821 Ensure that PhpUnitDedicateAssertFixer runs after NoAliasFunctionsFixer, clean up NoEmptyCommentFixer (SpacePossum) -* minor #1824 Reporting extracted to separate classes (ekho, keradus, SpacePossum) -* minor #1826 Fixer - remove measuring fixing time per file (keradus) -* minor #1843 FileFilterIterator - add missing import (GrahamCampbell) -* minor #1845 FileCacheManager - Allow linting to determine the cache state too (GrahamCampbell) -* minor #1846 FileFilterIterator - Corrected an iterator typehint (GrahamCampbell) -* minor #1848 DocBlock - Remove some old unused phpdoc tags (GrahamCampbell) -* minor #1856 NoDuplicateSemicolonsFixer - Remove overcomplete fixer (SpacePossum) -* minor #1861 Fix: Offset should be Offset (localheinz) -* minor #1867 Print non-report output to stdErr (SpacePossum, keradus) -* minor #1873 Enhancement: Show path to cache file if it exists (localheinz) -* minor #1875 renamed Composer package (fabpot) -* minor #1882 Runner - Handle throwables too (GrahamCampbell) -* minor #1886 PhpdocScalarFixer - Fix lowercase str to string too (GrahamCampbell) -* minor #1940 README.rst - update CI example (keradus) -* minor #1947 SCA, CS, add more tests (SpacePossum, keradus) -* minor #1954 tests - stop using deprecated method (sebastianbergmann) -* minor #1962 TextDiffTest - tests should not produce cache file (keradus) -* minor #1973 Introduce fast PHP7 based linter (keradus) -* minor #1999 Runner - No need to determine relative file name twice (localheinz) -* minor #2002 FileCacheManagerTest - Adjust name of test and variable (localheinz) -* minor #2010 NoExtraConsecutiveBlankLinesFixer - SF rule set, add 'extra' (SpacePossum) -* minor #2013 no_whitespace_in_blank_lines -> no_whitespace_in_blank_line (SpacePossum) -* minor #2024 AbstractFixerTestCase - check if there is no duplicated Token instance inside Tokens collection (keradus) -* minor #2031 COOKBOOK-FIXERS.md - update calling doTest method (keradus) -* minor #2032 code grooming (keradus) -* minor #2068 Code grooming (keradus) -* minor #2073 DeclareStrictTypesFixer - Remove fix CS fix logic from fixer. (SpacePossum) -* minor #2088 TokenizerLintingResult - expose line number of parsing error (keradus) -* minor #2093 Tokens - add block type BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE (SpacePossum) -* minor #2095 Transformers - add required PHP version (keradus) -* minor #2096 Introduce CT for PHP7 (keradus) -* minor #2119 Create @Symfony:risky ruleset (keradus) -* minor #2163 ClassKeywordRemoveFixerTest - Fix tests (SpacePossum) -* minor #2180 FixCommand - don't refer to renamed rules (keradus) -* minor #2181 Disallow to disable linter (keradus) -* minor #2194 semicolon_after_instruction,no_unneeded_control_parentheses prio issue (SpacePossum) -* minor #2199 make fixers less risky (SpacePossum) -* minor #2206 Add PHP70Migration ruleset (keradus) -* minor #2217 SelfUpdateCommand - Print version of update fixer (SpacePossum) -* minor #2223 update integration test format (keradus) -* minor #2227 Stop polluting global namespace with CT (keradus) -* minor #2237 DX: extend integration tests for PSR2 and Symfony rulesets (keradus) -* minor #2240 Make some objects immutable (keradus) -* minor #2251 ProtectedToPrivateFixer - fix priority, fix comments with new fixer names (SpacePossum) -* minor #2252 ClassDefinitionFixer - Set configuration of the fixer in the RuleSet of SF. (SpacePossum) -* minor #2257 extend Symfony_whitespaces itest (keradus) -* minor #2258 README.rst - indicate configurable rules (keradus) -* minor #2267 RuleSet - validate set (keradus) -* minor #2268 Use strict parameters for PHP functions (keradus) -* minor #2273 fixed typo (fabpot) -* minor #2274 ShortArraySyntaxFixer/LongArraySyntaxFixer - Merge conflicting fixers (SpacePossum) -* minor #2275 Clean ups (SpacePossum) -* minor #2278 Concat*Fixer - unify concat fixers (SpacePossum, keradus) -* minor #2279 Use Prophecy (keradus) -* minor #2284 Code grooming (SpacePossum) -* minor #2285 IntegrationCase is now aware about RuleSet but not Fixers (keradus, SpacePossum) -* minor #2286 Phpdoc*Fixer - unify rename fixers (SpacePossum, keradus) -* minor #2288 FixerInterface::configure(null) reset fixer to use default configuration (keradus) -* minor #2291 Make fixers ready to use directly after creation (keradus) -* minor #2295 Code grooming (keradus) -* minor #2296 ProjectCodeTest - make test part of regular testsuite, not standalone one (keradus) -* minor #2298 ConfigurationResolver - grooming (SpacePossum) -* minor #2300 Simplify rule set (SpacePossum, keradus) -* minor #2306 DeclareStrictTypesFixer - do not move tokens (SpacePossum) -* minor #2312 RuleSet - sort rules (localheinz) -* minor #2313 DX: provide doctyping for tests (keradus) -* minor #2317 Add utests (keradus) -* minor #2318 *TestCase - Reduce visibility of setUp() (localheinz) -* minor #2319 Code grooming (keradus) -* minor #2322 DX: use whitemessy aware assertion (keradus) -* minor #2324 `Echo|Print*Fixer` - unify printing fixers (SpacePossum, keradus) -* minor #2337 Normalize rule naming (keradus) -* minor #2338 Drop hacks for unsupported HHVM (keradus) -* minor #2339 Add some Fixer descriptions (SpacePossum, keradus) -* minor #2343 PowToExponentiationFixer - allow to run on 5.6.0 as well (keradus) -* minor #767 Add @internal tag (keradus) -* minor #807 Tokens::isMethodNameIsMagic - remove unused method (keradus) -* minor #809 Split Tokens into Tokens and TokensAnalyzer (keradus) -* minor #844 Renamed phpdoc_params to phpdoc_align (GrahamCampbell) -* minor #854 Change default level to PSR2 (keradus) -* minor #873 Config - using cache by default (keradus) -* minor #902 change FixerInterface (keradus) -* minor #911 remove Token::$line (keradus) -* minor #914 All Transformer classes should be named with Transformer as suffix (keradus) -* minor #915 add UseTransformer (keradus) -* minor #916 add ArraySquareBraceTransformer (keradus) -* minor #917 clean up Transformer tests (keradus) -* minor #919 CurlyBraceTransformer - one transformer to handle all curly braces transformations (keradus) -* minor #928 remove Token::getLine (keradus) -* minor #929 add WhitespacyCommentTransformer (keradus) -* minor #937 fix docs/typehinting in few classes (keradus) -* minor #958 FileCacheManager - remove code for BC support (keradus) -* minor #979 Improve Tokens::clearEmptyTokens performance (keradus) -* minor #981 Tokens - code grooming (keradus) -* minor #988 Fixers - no need to search for tokens of given kind in extra loop (keradus) -* minor #989 No need for loop in Token::equals (keradus) - -Changelog for v1.13.3 ---------------------- - -* minor #3042 Update gitter address (keradus) - -Changelog for v1.13.2 ---------------------- - -* minor #2946 Detect extra old installations (keradus) - -Changelog for v1.13.1 ---------------------- - -* minor #2342 Application - adjust test to not depend on symfony/console version (keradus) -* minor #2344 AppVeyor: enforce PHP version (keradus) - -Changelog for v1.13.0 ---------------------- - -* bug #2303 ClassDefinitionFixer - Anonymous classes fixing (SpacePossum) -* feature #2208 Added fixer for PHPUnit's @expectedException annotation (ro0NL) -* feature #2249 Added ProtectedToPrivateFixer (Slamdunk, SpacePossum) -* feature #2264 SelfUpdateCommand - Do not update to next major version by default (SpacePossum) -* feature #2328 ClassDefinitionFixer - Anonymous classes format by PSR12 (SpacePossum) -* feature #2333 PhpUnitFqcnAnnotationFixer - support more annotations (keradus) -* minor #2256 EmptyReturnFixer - it's now risky fixer due to null vs void (keradus) -* minor #2281 Add issue template (SpacePossum) -* minor #2307 Update .editorconfig (SpacePossum) -* minor #2310 CI: update AppVeyor to use newest PHP, silence the composer (keradus) -* minor #2315 Token - Deprecate getLine() (SpacePossum) -* minor #2320 Clear up status code on 1.x (SpacePossum) - -Changelog for v1.12.4 ---------------------- - -* bug #2235 OrderedImportsFixer - PHP 7 group imports support (SpacePossum) -* minor #2276 Tokens cleanup (keradus) -* minor #2277 Remove trailing spaces (keradus) -* minor #2294 Improve Travis configuration (keradus) -* minor #2297 Use phpdbg instead of xdebug (keradus) -* minor #2299 Travis: proper xdebug disabling (keradus) -* minor #2301 Travis: update platform adjusting (keradus) - -Changelog for v1.12.3 ---------------------- - -* bug #2155 ClassDefinitionFixer - overhaul (SpacePossum) -* bug #2187 MultipleUseFixer - Fix handling comments (SpacePossum) -* bug #2209 LinefeedFixer - Fix in a safe way (SpacePossum) -* bug #2228 NoEmptyLinesAfterPhpdocs, SingleBlankLineBeforeNamespace - Fix priority (SpacePossum) -* bug #2230 FunctionDeclarationFixer - Fix T_USE case (SpacePossum) -* bug #2232 Add a test for style of variable declaration : var (daiglej) -* bug #2246 Fix itest requirements (keradus) -* minor #2238 .gitattributes - specified line endings (keradus) -* minor #2239 IntegrationCase - no longer internal (keradus) - -Changelog for v1.12.2 ---------------------- - -* bug #2191 PhpdocToCommentFixer - fix false positive for docblock of variable (keradus) -* bug #2193 UnneededControlParenthesesFixer - Fix more return cases. (SpacePossum) -* bug #2198 FileCacheManager - fix exception message and undefined property (j0k3r) -* minor #2170 Add dollar sign prefix for consistency (bcremer) -* minor #2190 .travis.yml - improve Travis speed for tags (keradus) -* minor #2196 PhpdocTypesFixer - support iterable type (GrahamCampbell) -* minor #2197 Update cookbook and readme (g105b, SpacePossum) -* minor #2203 README.rst - change formatting (ro0NL) -* minor #2204 FixCommand - clean unused var (keradus) -* minor #2205 Add integration test for iterable type (keradus) - -Changelog for v1.12.1 ---------------------- - -* bug #2144 Remove temporary files not deleted by destructor on failure (adawolfa) -* bug #2150 SelfUpdateCommand: resolve symlink (julienfalque) -* bug #2162 Fix issue where an exception is thrown if the cache file exists but is empty. (ikari7789) -* bug #2164 OperatorsSpacesFixer - Do not unalign double arrow and equals operators (SpacePossum) -* bug #2167 Rewrite file removal (keradus) -* minor #2152 Code cleanup (keradus) -* minor #2154 ShutdownFileRemoval - Fixed file header (GrahamCampbell) - -Changelog for v1.12.0 ---------------------- - -* feature #1493 Added MethodArgumentDefaultValueFixer (lmanzke) -* feature #1495 BracesFixer - added support for declare (EspadaV8) -* feature #1518 Added ClassDefinitionFixer (SpacePossum) -* feature #1543 [PSR-2] Switch case space fixer (Soullivaneuh) -* feature #1577 Added SpacesAfterSemicolonFixer (SpacePossum) -* feature #1580 Added HeredocToNowdocFixer (gharlan) -* feature #1581 UnneededControlParenthesesFixer - add "break" and "continue" support (gharlan) -* feature #1610 HashToSlashCommentFixer - Add (SpacePossum) -* feature #1613 ScalarCastFixer - LowerCaseCastFixer - Add (SpacePossum) -* feature #1659 NativeFunctionCasingFixer - Add (SpacePossum) -* feature #1661 SwitchCaseSemicolonToColonFixer - Add (SpacePossum) -* feature #1662 Added CombineConsecutiveUnsetsFixer (SpacePossum) -* feature #1671 Added NoEmptyStatementFixer (SpacePossum) -* feature #1705 Added NoUselessReturnFixer (SpacePossum, keradus) -* feature #1735 Added NoTrailingWhitespaceInCommentFixer (keradus) -* feature #1750 Add PhpdocSingleLineVarSpacingFixer (SpacePossum) -* feature #1765 Added NoEmptyPhpdocFixer (SpacePossum) -* feature #1773 Add NoUselessElseFixer (gharlan, SpacePossum) -* feature #1786 Added NoEmptyCommentFixer (SpacePossum) -* feature #1792 Add PhpUnitDedicateAssertFixer. (SpacePossum) -* feature #1894 BracesFixer - correctly fix indents of anonymous functions/classes (gharlan) -* feature #1985 Added ClassKeywordRemoveFixer (Soullivaneuh) -* feature #2020 Added PhpdocAnnotationWithoutDotFixer (keradus) -* feature #2067 Added DeclareEqualNormalizeFixer (keradus) -* feature #2078 Added SilencedDeprecationErrorFixer (HeahDude) -* feature #2082 Added MbStrFunctionsFixer (Slamdunk) -* bug #1657 SwitchCaseSpaceFixer - Fix spacing between 'case' and semicolon (SpacePossum) -* bug #1684 SpacesAfterSemicolonFixer - fix loops handling (SpacePossum, keradus) -* bug #1700 Fixer - resolve import conflict (keradus) -* bug #1836 NoUselessReturnFixer - Do not remove return if last statement in short if statement (SpacePossum) -* bug #1879 HeredocToNowdocFixer - Handle space in heredoc token (SpacePossum) -* bug #1896 FixCommand - Fix escaping of diff output (SpacePossum) -* bug #2034 IncludeFixer - fix support for close tag (SpacePossum) -* bug #2040 PhpdocAnnotationWithoutDotFixer - fix crash on odd character (keradus) -* bug #2041 DefaultFinder should implement FinderInterface (keradus) -* bug #2050 PhpdocAnnotationWithoutDotFixer - handle ellipsis (keradus) -* bug #2051 NativeFunctionCasingFixer - call to constructor with default NS of class with name matching native function name fix (SpacePossum) -* minor #1538 Added possibility to lint tests (gharlan) -* minor #1569 Add sample to get a specific version of the fixer (Soullivaneuh) -* minor #1571 Enhance integration tests (keradus) -* minor #1578 Code grooming (keradus) -* minor #1583 Travis - update matrix (keradus) -* minor #1585 Code grooming - Improve utests code coverage (SpacePossum) -* minor #1586 Add configuration exception classes and exit codes (SpacePossum) -* minor #1594 Fix invalid PHP code samples in utests (SpacePossum) -* minor #1597 MethodArgumentDefaultValueFixer - refactoring and fix closures with "use" clause (gharlan) -* minor #1600 Added more integration tests (SpacePossum, keradus) -* minor #1605 integration tests - swap EXPECT and INPUT (optional INPUT) (gharlan) -* minor #1608 Travis - change matrix order for faster results (gharlan) -* minor #1609 CONTRIBUTING.md - Don't rebase always on master (SpacePossum) -* minor #1616 IncludeFixer - fix and test more cases (SpacePossum) -* minor #1622 AbstractIntegratationTest - fix linting test cases (gharlan) -* minor #1624 fix invalid code in test cases (gharlan) -* minor #1625 Travis - switch to trusty (keradus) -* minor #1627 FixCommand - fix output (keradus) -* minor #1630 Pass along the exception code. (SpacePossum) -* minor #1632 Php Inspections (EA Extended): SCA for 1.12 (kalessil) -* minor #1633 Fix CS for project itself (keradus) -* minor #1634 Backport some minor changes from 2.x line (keradus) -* minor #1637 update PHP Coveralls (keradus) -* minor #1639 Revert "Travis - set dist to trusty" (keradus) -* minor #1641 AppVeyor/Travis - use GITHUB_OAUTH_TOKEN (keradus) -* minor #1642 AppVeyor - install dev deps as well (keradus) -* minor #1647 Deprecate non-default Configs and Finders (keradus) -* minor #1654 Split output to stderr and stdout (SpacePossum) -* minor #1660 update phpunit version (gharlan) -* minor #1663 DuplicateSemicolonFixer - Remove duplicate semicolons even if there are comments between those (SpacePossum) -* minor #1664 IncludeFixer - Add missing test case (SpacePossum) -* minor #1668 Code grooming (keradus) -* minor #1669 NativeFunctionCasingFixer - move to Symfony level (keradus) -* minor #1670 Backport Finder and Config classes from 2.x line (keradus) -* minor #1682 ElseifFixer - handle comments (SpacePossum) -* minor #1689 AbstractIntegrationTest - no need for single-char group and docs grooming (keradus) -* minor #1690 Integration tests - allow to not check priority, introduce IntegrationCase (keradus) -* minor #1701 Fixer - Renamed import alias (GrahamCampbell) -* minor #1708 Update composer.json requirements (keradus) -* minor #1734 Travis: Turn on linting (keradus) -* minor #1736 Integration tests - don't check priority for tests using short_tag fixer (keradus) -* minor #1739 NoTrailingWhitespaceInCommentFixer - move to PSR2 level (keradus) -* minor #1763 Deprecate ConfigInterface::getDir, ConfigInterface::setDir, Finder::setDir (keradus) -* minor #1777 NoTrailingWhitespaceInCommentFixer - fix parent class (keradus) -* minor #1816 PhpUnitDedicateAssertFixer - configuration is not required anymore (keradus) -* minor #1849 DocBlock - The category tag should be together with package (GrahamCampbell) -* minor #1870 Update README.rst (glensc) -* minor #1880 FixCommand - fix stdErr detection (SpacePossum) -* minor #1881 NoEmptyStatementFixer - handle anonymous classes correctly (gharlan) -* minor #1906 .php_cs - use no_useless_else rule (keradus) -* minor #1915 NoEmptyComment - move to Symfony level (SpacePossum) -* minor #1917 BracesFixer - fixed comment handling (gharlan) -* minor #1919 EmptyReturnFixer - move fixer outside of Symfony level (keradus) -* minor #2036 OrderedUseFixer - adjust tests (keradus) -* minor #2056 Travis - run nightly PHP (keradus) -* minor #2061 UnusedUseFixer and LineAfterNamespace - add new integration test (keradus) -* minor #2097 Add lambda tests for 7.0 and 7.1 (SpacePossum) -* minor #2111 .travis.yml - rename PHP 7.1 env (keradus) -* minor #2112 Fix 1.12 line (keradus) -* minor #2118 SilencedDeprecationErrorFixer - adjust level (keradus) -* minor #2132 composer.json - rename package name (keradus) -* minor #2133 Apply ordered_class_elements rule (keradus) -* minor #2138 composer.json - disallow to run on PHP 7.2+ (keradus) - -Changelog for v1.11.8 ---------------------- - -* bug #2143 ReadmeCommand - fix running command on phar file (keradus) -* minor #2129 Add .gitattributes to remove unneeded files (Slamdunk) -* minor #2141 Move phar building to PHP 5.6 job as newest box.phar is no longer working on 5.3 (keradus) - -Changelog for v1.11.7 ---------------------- - -* bug #2108 ShortArraySyntaxFixer, TernarySpacesFixer, UnalignEqualsFixer - fix priority bug (SpacePossum) -* bug #2092 ConcatWithoutSpacesFixer, OperatorsSpacesFixer - fix too many spaces, fix incorrect fixing of lines with comments (SpacePossum) - -Changelog for v1.11.6 ---------------------- - -* bug #2086 Braces - fix bug with comment in method prototype (keradus) -* bug #2077 SingleLineAfterImportsFixer - Do not remove lines between use cases (SpacePossum) -* bug #2079 TernarySpacesFixer - Remove multiple spaces (SpacePossum) -* bug #2087 Fixer - handle PHP7 Errors as well (keradus) -* bug #2072 LowercaseKeywordsFixer - handle CT_CLASS_CONSTANT (tgabi333) -* bug #2066 LineAfterNamespaceFixer - Handle close tag (SpacePossum) -* bug #2057 LineAfterNamespaceFixer - adding too much extra lines where namespace is last statement (keradus) -* bug #2059 OperatorsSpacesFixer - handle declare statement (keradus) -* bug #2060 UnusedUseFixer - fix handling whitespaces around removed import (keradus) -* minor #2071 ShortEchoTagFixer - allow to run tests on PHP 5.3 (keradus) - -Changelog for v1.11.5 ---------------------- - -* bug #2012 Properly build phar file for lowest supported PHP version (keradus) -* bug #2037 BracesFixer - add support for anonymous classes (keradus) -* bug #1989 Add support for PHP 7 namespaces (SpacePossum) -* bug #2019 Fixing newlines added after curly brace string index access (jaydiablo) -* bug #1840 [Bug] BracesFixer - Do add a line before close tag (SpacePossum) -* bug #1994 EchoToPrintFixer - Fix T_OPEN_TAG_WITH_ECHO on hhvm (keradus) -* bug #1970 Tokens - handle semi-reserved PHP 7 keywords (keradus) -* minor #2017 PHP7 integration tests (keradus) -* minor #1465 Bump supported HHVM version, improve ShortEchoTagFixer on HHVM (keradus) -* minor #1995 Rely on own phpunit, not one from CI service (keradus) - -Changelog for v1.11.4 ---------------------- - -* bug #1956 SelfUpdateCommand - don't update to non-stable version (keradus) -* bug #1963 Fix not wanted unneeded_control_parentheses fixer for clone (Soullivaneuh) -* bug #1960 Fix invalid test cases (keradus) -* bug #1939 BracesFixer - fix handling comment around control token (keradus) -* minor #1927 NewWithBracesFixer - remove invalid testcase (keradus) - -Changelog for v1.11.3 ---------------------- - -* bug #1868 NewWithBracesFixer - fix handling more neighbor tokens (keradus) -* bug #1893 BracesFixer - handle comments inside lambda function prototype (keradus) -* bug #1806 SelfAccessorFixer - skip anonymous classes (gharlan) -* bug #1813 BlanklineAfterOpenTagFixer, NoBlankLinesBeforeNamespaceFixer - fix priority (SpacePossum) -* minor #1807 Tokens - simplify isLambda() (gharlan) - -Changelog for v1.11.2 ---------------------- - -* bug #1776 EofEndingFixer - new line on end line comment is allowed (Slamdunk) -* bug #1775 FileCacheManager - ignore corrupted serialized data (keradus) -* bug #1769 FunctionDeclarationFixer - fix more cases (keradus) -* bug #1747 Fixer - Fix ordering of fixer when both level and custom fixers are used (SpacePossum) -* bug #1744 Fixer - fix rare situation when file was visited twice (keradus) -* bug #1710 LowercaseConstantFixer - Fix comment cases. (SpacePossum) -* bug #1711 FunctioncallSpaceFixer - do not touch function declarations. (SpacePossum) -* minor #1798 LintManager - meaningful tempnam (Slamdunk) -* minor #1759 UniqueFileIterator - performance improvement (GrahamCampbell) -* minor #1745 appveyor - fix build (keradus) - -Changelog for v1.11.1 ---------------------- - -* bug #1680 NewWithBracesFixer - End tags (SpacePossum) -* bug #1685 EmptyReturnFixer - Make independent of LowercaseConstantsFixer (SpacePossum) -* bug #1640 IntegrationTest - fix directory separator (keradus) -* bug #1595 ShortTagFixer - fix priority (keradus) -* bug #1576 SpacesBeforeSemicolonFixer - do not remove space before semicolon if that space is after a semicolon (SpacePossum) -* bug #1570 UnneededControlParenthesesFixer - fix test samples (keradus) -* minor #1653 Update license year (gharlan) - -Changelog for v1.11 -------------------- - -* feature #1550 Added UnneededControlParenthesesFixer (Soullivaneuh, keradus) -* feature #1532 Added ShortBoolCastFixer (SpacePossum) -* feature #1523 Added EchoToPrintFixer and PrintToEchoFixer (Soullivaneuh) -* feature #1552 Warn when running with xdebug extension (SpacePossum) -* feature #1484 Added ArrayElementNoSpaceBeforeCommaFixer and ArrayElementWhiteSpaceAfterCommaFixer (amarczuk) -* feature #1449 PhpUnitConstructFixer - Fix more use cases (SpacePossum) -* feature #1382 Added PhpdocTypesFixer (GrahamCampbell) -* feature #1384 Add integration tests (SpacePossum) -* feature #1349 Added FunctionTypehintSpaceFixer (keradus) -* minor #1562 Fix invalid PHP code samples in utests (SpacePossum) -* minor #1560 Fixed project name in xdebug warning (gharlan) -* minor #1545 Fix invalid PHP code samples in utests (SpacePossum) -* minor #1554 Alphabetically sort entries in .gitignore (GrahamCampbell) -* minor #1527 Refactor the way types work on annotations (GrahamCampbell) -* minor #1546 Update coding guide in cookbook (keradus) -* minor #1526 Support more annotations when fixing types in phpdoc (GrahamCampbell) -* minor #1535 clean ups (SpacePossum) -* minor #1510 Added Symfony 3.0 support (Ener-Getick) -* minor #1520 Code grooming (keradus) -* minor #1515 Support property, property-read and property-write tags (GrahamCampbell) -* minor #1488 Added more inline phpdoc tests (GrahamCampbell) -* minor #1496 Add docblock to AbstractFixerTestBase::makeTest (lmanzke) -* minor #1467 PhpdocShortDescriptionFixer - add support for Japanese sentence-ending characters (fritz-c) -* minor #1453 remove calling array_keys in foreach loops (keradus) -* minor #1448 Code grooming (keradus) -* minor #1437 Added import fixers integration test (GrahamCampbell) -* minor #1433 phpunit.xml.dist - disable gc (keradus) -* minor #1427 Change arounded to surrounded in README.rst (36degrees) -* minor #1420 AlignDoubleArrowFixer, AlignEqualsFixer - add integration tests (keradus) -* minor #1423 appveyor.yml - do not cache C:\tools, its internal forAppVeyor (keradus) -* minor #1400 appveyor.yml - add file (keradus) -* minor #1396 AbstractPhpdocTypesFixer - instance method should be called on instance (keradus) -* minor #1395 code grooming (keradus) -* minor #1393 boost .travis.yml file (keradus) -* minor #1372 Don't allow PHP 7 to fail (GrahamCampbell) -* minor #1332 PhpUnitConstructFixer - fix more functions (keradus) -* minor #1339 CONTRIBUTING.md - add link to PSR-5 (keradus) -* minor #1346 Core grooming (SpacePossum) -* minor #1328 Tokens: added typehint for Iterator elements (gharlan) - -Changelog for v1.10.3 ---------------------- - -* bug #1559 WhitespacyLinesFixer - fix bug cases (SpacePossum, keradus) -* bug #1541 Psr0Fixer - Ignore filenames that are a reserved keyword or predefined constant (SpacePossum) -* bug #1537 Psr0Fixer - ignore file without name or with name started by digit (keradus) -* bug #1516 FixCommand - fix wrong message for dry-run (SpacePossum) -* bug #1486 ExtraEmptyLinesFixer - Remove extra lines after comment lines too (SpacePossum) -* bug #1503 Psr0Fixer - fix case with comments lying around (GrahamCampbell) -* bug #1474 PhpdocToCommentFixer - fix not properly fixing for block right after namespace (GrahamCampbell) -* bug #1478 BracesFixer - do not remove empty lines after class opening (keradus) -* bug #1468 Add missing ConfigInterface::getHideProgress() (Eugene Leonovich, rybakit) -* bug #1466 Fix bad indent on align double arrow fixer (Soullivaneuh, keradus) -* bug #1479 Tokens - fix detection of short array (keradus) - -Changelog for v1.10.2 ---------------------- - -* bug #1461 PhpUnitConstructFixer - fix case when first argument is an expression (keradus) -* bug #1460 AlignDoubleArrowFixer - fix handling of nested arrays (Soullivaneuh, keradus) - -Changelog for v1.10.1 ---------------------- - -* bug #1424 Fixed the import fixer priorities (GrahamCampbell) -* bug #1444 OrderedUseFixer - fix next case (keradus) -* bug #1441 BracesFixer - fix next case (keradus) -* bug #1422 AlignDoubleArrowFixer - fix handling of nested array (SpacePossum) -* bug #1425 PhpdocInlineTagFixerTest - fix case when met invalid PHPDoc (keradus) -* bug #1419 AlignDoubleArrowFixer, AlignEqualsFixer - fix priorities (keradus) -* bug #1415 BlanklineAfterOpenTagFixer - Do not add a line break if there is one already. (SpacePossum) -* bug #1410 PhpdocIndentFixer - Fix for open tag (SpacePossum) -* bug #1401 PhpdocVarWithoutNameFixer - Fixed the var without name fixer for inline docs (keradus, GrahamCampbell) -* bug #1369 Fix not well-formed XML output (junichi11) -* bug #1356 Psr0Fixer - disallow run on StdinFileInfo (keradus) - -Changelog for v1.10 -------------------- - -* feature #1306 Added LogicalNotOperatorsWithSuccessorSpaceFixer (phansys) -* feature #1286 Added PhpUnitConstructFixer (keradus) -* feature #1316 Added PhpdocInlineTagFixer (SpacePossum, keradus) -* feature #1303 Added LogicalNotOperatorsWithSpacesFixer (phansys) -* feature #1279 Added PhpUnitStrictFixer (keradus) -* feature #1267 SingleQuoteFixer fix more use cases (SpacePossum) -* minor #1319 PhpUnitConstructFixer - fix performance and add to local .php_cs (keradus) -* minor #1280 Fix non-utf characters in docs (keradus) -* minor #1274 Cookbook - No change auto-test note (Soullivaneuh) - -Changelog for v1.9.3 --------------------- - -* bug #1327 DocBlock\Tag - keep the case of tags (GrahamCampbell) - -Changelog for v1.9.2 --------------------- - -* bug #1313 AlignDoubleArrowFixer - fix aligning after UTF8 chars (keradus) -* bug #1296 PhpdocScalarFixer - fix property annotation too (GrahamCampbell) -* bug #1299 WhitespacyLinesFixer - spaces on next valid line must not be fixed (Slamdunk) - -Changelog for v1.9.1 --------------------- - -* bug #1288 TrimArraySpacesFixer - fix moving first comment (keradus) -* bug #1287 PhpdocParamsFixer - now works on any indentation level (keradus) -* bug #1278 Travis - fix PHP7 build (keradus) -* bug #1277 WhitespacyLinesFixer - stop changing non-whitespacy tokens (SpacePossum, SamBurns-awin, keradus) -* bug #1224 TrailingSpacesFixer - stop changing non-whitespacy tokens (SpacePossum, SamBurns-awin, keradus) -* bug #1266 FunctionCallSpaceFixer - better detection of function call (funivan) -* bug #1255 make sure some phpdoc fixers are run in right order (SpacePossum) - -Changelog for v1.9 ------------------- - -* feature #1097 Added ShortEchoTagFixer (vinkla) -* minor #1238 Fixed error handler to respect current error_reporting (JanJakes) -* minor #1234 Add class to exception message, use sprintf for exceptions (SpacePossum) -* minor #1210 set custom error handler for application run (keradus) -* minor #1214 Tokens::isMonolithicPhp - enhance performance (keradus) -* minor #1207 Update code documentation (keradus) -* minor #1202 Update IDE tool urls (keradus) -* minor #1195 PreIncrementFixer - move to Symfony level (gharlan) - -Changelog for v1.8.1 --------------------- - -* bug #1193 EofEndingFixer - do not add an empty line at EOF if the PHP tags have been closed (SpacePossum) -* bug #1209 PhpdocParamsFixer - fix corrupting following custom annotation (keradus) -* bug #1205 BracesFixer - fix missing indentation fixes for class level (keradus) -* bug #1204 Tag - fix treating complex tag as simple PhpDoc tag (keradus) -* bug #1198 Tokens - fixed unary/binary operator check for type-hinted reference arguments (gharlan) -* bug #1201 Php4ConstructorFixer - fix invalid handling of subnamespaces (gharlan) -* minor #1221 Add more tests (SpacePossum) -* minor #1216 Tokens - Add unit test for array detection (SpacePossum) - -Changelog for v1.8 ------------------- - -* feature #1168 Added UnalignEqualsFixer (keradus) -* feature #1167 Added UnalignDoubleArrowFixer (keradus) -* bug #1169 ToolInfo - Fix way to find script dir (sp-ian-monge) -* minor #1181 composer.json - Update description (SpacePossum) -* minor #1180 create Tokens::overrideAt method (keradus) - -Changelog for v1.7.1 --------------------- - -* bug #1165 BracesFixer - fix bug when comment is a first statement in control structure without braces (keradus) - -Changelog for v1.7 ------------------- - -* feature #1113 Added PreIncrementFixer (gharlan) -* feature #1144 Added PhpdocNoAccessFixer (GrahamCampbell) -* feature #1116 Added SelfAccessorFixer (gharlan) -* feature #1064 OperatorsSpacesFixer enhancements (gharlan) -* bug #1151 Prevent token collection corruption by fixers (stof, keradus) -* bug #1152 LintManager - fix handling of temporary file (keradus) -* bug #1139 NamespaceNoLeadingWhitespaceFixer - remove need for ctype extension (keradus) -* bug #1117 Tokens - fix iterator used with foreach by reference (keradus) -* minor #1148 code grooming (keradus) -* minor #1142 We are actually PSR-4, not PSR-0 (GrahamCampbell) -* minor #1131 Phpdocs and typos (SpacePossum) -* minor #1069 state min HHVM version (keradus) -* minor #1129 [DX] Help developers choose the right branch (SpacePossum) -* minor #1138 PhpClosingTagFixer - simplify flow, no need for loop (keradus) -* minor #1123 Reference mismatches fixed, SCA (kalessil) -* minor #1109 SingleQuoteFixer - made fixer more accurate (gharlan) -* minor #1110 code grooming (kalessil) - -Changelog for v1.6.2 --------------------- - -* bug #1149 UnusedUseFixer - must be run before LineAfterNamespaceFixer, fix token collection corruption (keradus) -* minor #1145 AbstractLinesBeforeNamespaceFixer - fix docs for fixLinesBeforeNamespace (GrahamCampbell) - -Changelog for v1.6.1 --------------------- - -* bug #1108 UnusedUseFixer - fix false positive when name is used as part of another namespace (gharlan) -* bug #1114 Fixed PhpdocParamsFixer with malformed doc block (gharlan) -* minor #1135 PhpdocTrimFixer - fix doc typo (localheinz) -* minor #1093 Travis - test lowest dependencies (boekkooi) - -Changelog for v1.6 ------------------- - -* feature #1089 Added NewlineAfterOpenTagFixer and BlanklineAfterOpenTagFixer (ceeram, keradus) -* feature #1090 Added TrimArraySpacesFixer (jaredh159, keradus) -* feature #1058 Added SingleQuoteFixer (gharlan) -* feature #1059 Added LongArraySyntaxFixer (gharlan) -* feature #1037 Added PhpdocScalarFixer (GrahamCampbell, keradus) -* feature #1028 Add ListCommasFixer (keradus) -* bug #1047 Utils::camelCaseToUnderscore - fix regexp (odin-delrio) -* minor #1073 ShortTagFixer enhancement (gharlan) -* minor #1079 Use LongArraySyntaxFixer for this repo (gharlan) -* minor #1070 Tokens::isMonolithicPhp - remove unused T_CLOSE_TAG search (keradus) -* minor #1049 OrderedUseFixer - grooming (keradus) - -Changelog for v1.5.2 --------------------- - -* bug #1025 Fixer - ignore symlinks (kix) -* bug #1071 Psr0Fixer - fix bug for fixing file with long extension like .class.php (keradus) -* bug #1080 ShortTagFixer - fix false positive (gharlan) -* bug #1066 Php4ConstructorFixer - fix causing infinite recursion (mbeccati) -* bug #1056 VisibilityFixer - fix T_VAR with multiple props (localheinz, keradus) -* bug #1065 Php4ConstructorFixer - fix detection of a PHP4 parent constructor variant (mbeccati) -* bug #1060 Tokens::isShortArray: tests and bugfixes (gharlan) -* bug #1057 unused_use: fix false positive when name is only used as variable name (gharlan) - -Changelog for v1.5.1 --------------------- - -* bug #1054 VisibilityFixer - fix var with array value assigned (localheinz, keradus) -* bug #1048 MultilineArrayTrailingCommaFixer, SingleArrayNoTrailingCommaFixer - using heredoc inside array not causing to treat it as multiline array (keradus) -* bug #1043 PhpdocToCommentFixer - also check other control structures, besides foreach (ceeram) -* bug #1045 OrderedUseFixer - fix namespace order for trailing digits (rusitschka) -* bug #1035 PhpdocToCommentFixer - Add static as valid keyword for structural element (ceeram) -* bug #1020 BracesFixer - fix missing braces for nested if elseif else (malengrin) -* minor #1036 Added php7 to travis build (fonsecas72) -* minor #1026 Fix typo in ShortArraySyntaxFixer (tommygnr) -* minor #1024 code grooming (keradus) - -Changelog for v1.5 ------------------- - -* feature #887 Added More Phpdoc Fixers (GrahamCampbell, keradus) -* feature #1002 Add HeaderCommentFixer (ajgarlag) -* feature #974 Add EregToPregFixer (mbeccati) -* feature #970 Added Php4ConstructorFixer (mbeccati) -* feature #997 Add PhpdocToCommentFixer (ceeram, keradus) -* feature #932 Add NoBlankLinesAfterClassOpeningFixer (ceeram) -* feature #879 Add SingleBlankLineBeforeNamespaceFixer and NoBlankLinesBeforeNamespaceFixer (GrahamCampbell) -* feature #860 Add single_line_after_imports fixer (ceeram) -* minor #1014 Fixed a few file headers (GrahamCampbell) -* minor #1011 Fix HHVM as it works different than PHP (keradus) -* minor #1010 Fix invalid UTF-8 char in docs (ajgarlag) -* minor #1003 Fix header comment in php files (ajgarlag) -* minor #1005 Add Utils::calculateBitmask method (keradus) -* minor #973 Add Tokens::findSequence (mbeccati) -* minor #991 Longer explanation of how to use blacklist (bmitch, networkscraper) -* minor #972 Add case sensitive option to the tokenizer (mbeccati) -* minor #986 Add benchmark script (dericofilho) -* minor #985 Fix typo in COOKBOOK-FIXERS.md (mattleff) -* minor #978 Token - fix docs (keradus) -* minor #957 Fix Fixers methods order (GrahamCampbell) -* minor #944 Enable caching of composer downloads on Travis (stof) -* minor #941 EncodingFixer - enhance tests (keradus) -* minor #938 Psr0Fixer - remove unneeded assignment (keradus) -* minor #936 FixerTest - test description consistency (keradus) -* minor #933 NoEmptyLinesAfterPhpdocsFixer - remove unneeded code, clarify description (ceeram) -* minor #934 StdinFileInfo::getFilename - Replace phpdoc with normal comment and add back empty line before return (ceeram) -* minor #927 Exclude the resources folder from coverage reports (GrahamCampbell) -* minor #926 Update Token::isGivenKind phpdoc (GrahamCampbell) -* minor #925 Improved AbstractFixerTestBase (GrahamCampbell) -* minor #922 AbstractFixerTestBase::makeTest - test if input is different than expected (keradus) -* minor #904 Refactoring Utils (GrahamCampbell) -* minor #901 Improved Readme Formatting (GrahamCampbell) -* minor #898 Tokens::getImportUseIndexes - simplify function (keradus) -* minor #897 phpunit.xml.dist - split testsuite (keradus) - -Changelog for v1.4.2 --------------------- - -* bug #994 Fix detecting of short arrays (keradus) -* bug #995 DuplicateSemicolonFixer - ignore duplicated semicolons inside T_FOR (keradus) - -Changelog for v1.4.1 --------------------- - -* bug #990 MultilineArrayTrailingCommaFixer - fix case with short array on return (keradus) -* bug #975 NoEmptyLinesAfterPhpdocsFixer - fix only when documentation documents sth (keradus) -* bug #976 PhpdocIndentFixer - fix error when there is a comment between docblock and next meaningful token (keradus, ceeram) - -Changelog for v1.4 ------------------- - -* feature #841 PhpdocParamsFixer: added aligning var/type annotations (GrahamCampbell) -* bug #965 Fix detection of lambda function that returns a reference (keradus) -* bug #962 PhpdocIndentFixer - fix bug when documentation is on the end of braces block (keradus) -* bug #961 Fixer - fix handling of empty file (keradus) -* bug #960 IncludeFixer - fix bug when include is part of condition statement (keradus) -* bug #954 AlignDoubleArrowFixer - fix new buggy case (keradus) -* bug #955 ParenthesisFixer - fix case with list call with trailing comma (keradus) -* bug #950 Tokens::isLambda - fix detection near comments (keradus) -* bug #951 Tokens::getImportUseIndexes - fix detection near comments (keradus) -* bug #949 Tokens::isShortArray - fix detection near comments (keradus) -* bug #948 NewWithBracesFixer - fix case with multidimensional array (keradus) -* bug #945 Skip files containing __halt_compiler() on PHP 5.3 (stof) -* bug #946 BracesFixer - fix typo in exception name (keradus) -* bug #940 Tokens::setCode - apply missing transformation (keradus) -* bug #908 BracesFixer - fix invalid inserting brace for control structure without brace and lambda inside of it (keradus) -* bug #903 NoEmptyLinesAfterPhpdocsFixer - fix bug with Windows style lines (GrahamCampbell) -* bug #895 [PSR-2] Preserve blank line after control structure opening brace (marcaube) -* bug #892 Fixed the double arrow multiline whitespace fixer (GrahamCampbell) -* bug #874 BracesFixer - fix bug of removing empty lines after class' opening { (ceeram) -* bug #868 BracesFixer - fix missing braces when statement is not followed by ; (keradus) -* bug #861 Updated PhpdocParamsFixer not to change line endings (keradus, GrahamCampbell) -* bug #837 FixCommand - stop corrupting xml/json format (keradus) -* bug #846 Made phpdoc_params run after phpdoc_indent (GrahamCampbell) -* bug #834 Correctly handle tab indentation (ceeram) -* bug #822 PhpdocIndentFixer - Ignore inline docblocks (ceeram) -* bug #813 MultilineArrayTrailingCommaFixer - do not move array end to new line (keradus) -* bug #817 LowercaseConstantsFixer - ignore class' constants TRUE/FALSE/NULL (keradus) -* bug #821 JoinFunctionFixer - stop changing declaration method name (ceeram) -* minor #963 State the minimum version of PHPUnit in CONTRIBUTING.md (SpacePossum) -* minor #943 Improve the cookbook to use relative links (stof) -* minor #921 Add changelog file (keradus) -* minor #909 BracesFixerTest - no \n line in \r\n test (keradus) -* minor #864 Added NoEmptyLinesAfterPhpdocsFixer (GrahamCampbell) -* minor #871 Added missing author (GrahamCampbell) -* minor #852 Fixed the coveralls version constraint (GrahamCampbell) -* minor #863 Tweaked testRetainsNewLineCharacters (GrahamCampbell) -* minor #849 Removed old alias (GrahamCampbell) -* minor #843 integer should be int (GrahamCampbell) -* minor #830 Remove whitespace before opening tag (ceeram) -* minor #835 code grooming (keradus) -* minor #828 PhpdocIndentFixerTest - code grooming (keradus) -* minor #827 UnusedUseFixer - code grooming (keradus) -* minor #825 improve code coverage (keradus) -* minor #810 improve code coverage (keradus) -* minor #811 ShortArraySyntaxFixer - remove not needed if statement (keradus) - -Changelog for v1.3 ------------------- - -* feature #790 Add docblock indent fixer (ceeram) -* feature #771 Add JoinFunctionFixer (keradus) -* bug #798 Add DynamicVarBrace Transformer for properly handling ${$foo} syntax (keradus) -* bug #796 LowercaseConstantsFixer - rewrite to handle new test cases (keradus) -* bug #789 T_CASE is not succeeded by parentheses (dericofilho) -* minor #814 Minor improvements to the phpdoc_params fixer (GrahamCampbell) -* minor #815 Minor fixes (GrahamCampbell) -* minor #782 Cookbook on how to make a new fixer (dericofilho) -* minor #806 Fix Tokens::detectBlockType call (keradus) -* minor #758 travis - disable sudo (keradus) -* minor #808 Tokens - remove commented code (keradus) -* minor #802 Address Sensiolabs Insight's warning of code cloning. (dericofilho) -* minor #803 README.rst - fix \` into \`\` (keradus) - -Changelog for v1.2 ------------------- - -* feature #706 Remove lead slash (dericofilho) -* feature #740 Add EmptyReturnFixer (GrahamCampbell) -* bug #775 PhpClosingTagFixer - fix case with T_OPEN_TAG_WITH_ECHO (keradus) -* bug #756 Fix broken cases for AlignDoubleArrowFixer (dericofilho) -* bug #763 MethodArgumentSpaceFixer - fix receiving data in list context with omitted values (keradus) -* bug #759 Fix Tokens::isArrayMultiLine (stof, keradus) -* bug #754 LowercaseKeywordsFixer - __HALT_COMPILER must not be lowercased (keradus) -* bug #753 Fix for double arrow misalignment in deeply nested arrays. (dericofilho) -* bug #752 OrderedUseFixer should be case-insensitive (rusitschka) -* minor #779 Fixed a docblock type (GrahamCampbell) -* minor #765 Typehinting in FileCacheManager, remove unused variable in Tokens (keradus) -* minor #764 SelfUpdateCommand - get local version only if remote version was successfully obtained (keradus) -* minor #761 align => (keradus) -* minor #757 Some minor code simplify and extra test (keradus) -* minor #713 Download php-cs-fixer.phar without sudo (michaelsauter) -* minor #742 Various Minor Improvements (GrahamCampbell) - -Changelog for v1.1 ------------------- - -* feature #749 remove the --no-progress option (replaced by the standard -v) (fabpot, keradus) -* feature #728 AlignDoubleArrowFixer - standardize whitespace after => (keradus) -* feature #647 Add DoubleArrowMultilineWhitespacesFixer (dericofilho, keradus) -* bug #746 SpacesBeforeSemicolonFixerTest - fix bug with semicolon after comment (keradus) -* bug #741 Fix caching when composer is installed in custom path (cmodijk) -* bug #725 DuplicateSemicolonFixer - fix clearing whitespace after duplicated semicolon (keradus) -* bug #730 Cache busting when fixers list changes (Seldaek) -* bug #722 Fix lint for STDIN-files (ossinkine) -* bug #715 TrailingSpacesFixer - fix bug with french UTF-8 chars (keradus) -* bug #718 Fix package name for composer cache (Seldaek) -* bug #711 correct vendor name (keradus) -* minor #745 Show progress by default and allow to disable it (keradus) -* minor #731 Add a way to disable all default filters and really provide a whitelist (Seldaek) -* minor #737 Extract tool info into new class, self-update command works now only for PHAR version (keradus) -* minor #739 fix fabbot issues (keradus) -* minor #726 update CONTRIBUTING.md for installing dependencies (keradus) -* minor #736 Fix fabbot issues (GrahamCampbell) -* minor #727 Fixed typos (pborreli) -* minor #719 Add update instructions for composer and caching docs (Seldaek) - -Changelog for v1.0 ------------------- - -First stable release. diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md deleted file mode 100644 index f0f5a429..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md +++ /dev/null @@ -1,103 +0,0 @@ -# Contributions Are Welcome! - -If you need any help, don't hesitate to ask the community using [GitHub Discussions](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/categories/q-a). - -## Glossary - -### Fixer - -A *fixer* is a class that tries to fix a single code style issue (a ``Fixer`` class must implement ``FixerInterface``). - -### Ruleset - -A *ruleset* is a collection of rules (*fixers*) that may be referenced in the config file similarly to a single *fixer*. When you work on existing fixer please keep in mind it can be a part of a *ruleset*(s) and changes may affect many users. When working on new *fixer* please consider if it should be added to some *ruleset*(s). - -### Config - -A *config* knows about the code style rules and the files and directories that must be scanned by the tool when run in the context of your project. It is useful for projects that follow a well-known directory structures, but the tool is not limited to any specific structure, and you can configure it in a very flexible way. - -## How to contribute - -> [!IMPORTANT] -> Before contributing with _really_ significant changes that require a lot of effort or are crucial from this tool's -> architecture perspective, please open [RFC on GitHub Discussion](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/categories/rfc). -> The development effort should start only after the proposal is discussed and the approach aligned. - -### Development - -* [Fork](https://help.github.com/articles/fork-a-repo/) this repository. You can use native Git approach or use [`gh` CLI tool](https://cli.github.com/). -* Create new branch on top of the latest revision of `master` branch (if you already had project locally, then make sure to update this branch before going to next steps). It's good when branch's name reflects intent of the changes, but this is not strict requirement since pull request provides description of the change. However, with good branch naming it's easier to work on multiple changes simultaneously. -* Install dependencies by running `composer update` (since project does not contain `composer.lock` it's better to ensure latest versions of packages by running `update` command instead of `install`). -* Make changes. Please remember that **all** changes have to be covered by tests. - * if you work on a bug fix, please start with reproducing the problem by adding failing test case(s). When you have failing test case(s), you can [create pull request](#opening-a-pull-request) just to reproduce fail in the CI. Then you can provide fix _in the subsequent commits_, it will make code review easier. It's allowed to modify existing test cases in bug fix pull request, but *only if* current behavior is proved to be invalid. - * if you work on existing fixers then don't change existing test cases, because these are contract between the maintainers and users (they ensure how tool works). Add new test cases that cover provided changes - preferred way of defining test cases is with [data provider](https://docs.phpunit.de/en/10.0/writing-tests-for-phpunit.html#data-providers) which uses `yield` with proper case description as a key (e.g. `yield 'Some specific scenario' => ['some', 'example', 'data'];`). Codebase may still contain test cases in different format, and it's totally acceptable to use `yield` approach next to existing `return` usages. -* Update documentation: `composer docs`. This requires the highest version of PHP supported by PHP CS Fixer. If it is not installed on your system, you can run it in a Docker container instead: `docker compose run php-8.2 php dev-tools/doc.php`. -* Run QA suite: `composer qa`. -* Fix project itself (if needed): `composer cs:fix`. - -### Opening a [pull request](https://help.github.com/articles/about-pull-requests/) - -You can do some things to increase the chance that your pull request is accepted without communication ping-pong between you and the reviewers: - -* Submit [single](https://en.wikipedia.org/wiki/Single-responsibility_principle) pull request per fix or feature. -* Keep meaningful commit logs, don't use meaningless messages (e.g. `foo`, `more work`, `more work`, `more work`) and don't push complex PR as a single commit. -* Don't [amend](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---amend) commits because it makes review rounds harder - all commits from your branch will be squashed (without commit messages) during the merge. -* Follow the conventions used in the project. -* Remember about tests and documentation. -* Don't bump `PhpCsFixer\Console\Application::VERSION`, it's done during release. - -> [!IMPORTANT] -> Your pull request will have much higher chance of getting merged if you allow maintainers to push changes to your -> branch. You can do it by ticking "Allow edits and access to secrets by maintainers" checkbox, but please keep in mind -> this option is available only if your PR is created from a user's fork. If your fork is a part of organisation, then -> you can add [Fixer maintainers](https://github.com/orgs/PHP-CS-Fixer/people) as members of that repository. This way -> maintainers will be able to provide required changes or rebase your branch (only up-to-date PRs can be merged). - -## Working With Docker - -This project provides a Docker setup that allows working on it using any of the PHP versions supported by the tool. - -To use it, you first need to install [Docker](https://docs.docker.com/get-docker/) ([Docker Compose](https://docs.docker.com/compose/) is a built-in plugin of the main tool). - -Next, copy [`compose.override.dist.yaml`](./compose.override.dist.yaml) to `compose.override.yaml` and edit it to your needs. The relevant parameters that might require some tweaking have comments to help you. - -You can then build the images: - -```console -docker compose build --parallel -``` - -Now you can run commands needed to work on the project. For example, say you want to run PHPUnit tests on PHP 8.2: - -```console -docker compose run php-8.2 vendor/bin/phpunit -``` - -Sometimes it can be more convenient to have a shell inside the container: - -```console -docker compose run php-7.4 sh -/fixer vendor/bin/phpunit -``` - -The images come with an [`xdebug` script](github.com/julienfalque/xdebug/) that allows running any PHP command with Xdebug enabled to help debug problems. - -```console -docker compose run php-8.2 xdebug vendor/bin/phpunit -``` - -If you're using PhpStorm, you need to create a [server](https://www.jetbrains.com/help/phpstorm/servers.html) with a name that matches the `PHP_IDE_CONFIG` environment variable defined in the Docker Compose configuration files, which is `php-cs-fixer` by default. - -All images use port 9003 for debug connections. - -## Making New Fixers - -There is a [cookbook](doc/cookbook_fixers.rst) with basic instructions on how to build a new fixer. Consider reading it before opening a PR. - -## Project's Standards - -* [PSR-1: Basic Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) -* [PSR-2: Coding Style Guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) -* [PSR-4: Autoloading Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) -* [PSR-5: PHPDoc (draft)](https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md) -* [Symfony Coding Standards](https://symfony.com/doc/current/contributing/code/standards.html) diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/LICENSE b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/LICENSE deleted file mode 100644 index 871def02..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012+ Fabien Potencier, Dariusz Rumiński - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/README.md b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/README.md deleted file mode 100644 index bee2b94e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/README.md +++ /dev/null @@ -1,88 +0,0 @@ -

- - PHP CS Fixer logo - -

- -# PHP Coding Standards Fixer - -The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards; -whether you want to follow PHP coding standards as defined in the PSR-1, PSR-2, etc., -or other community driven ones like the Symfony one. -You can **also** define your (team's) style through configuration. - -It can modernize your code (like converting the ``pow`` function to the ``**`` operator on PHP 5.6) -and (micro) optimize it. - -If you are already using a linter to identify coding standards problems in your -code, you know that fixing them by hand is tedious, especially on large -projects. This tool does not only detect them, but also fixes them for you. - -## Supported PHP Versions - -* PHP 7.4 -* PHP 8.0 -* PHP 8.1 -* PHP 8.2 -* PHP 8.3 - -> **Note** -> Each new PHP version requires a huge effort to support the new syntax. -> That's why the latest PHP version might not be supported yet. If you need it, -> please, consider supporting the project in any convenient way, for example -> with code contribution or reviewing existing PRs. To run PHP CS Fixer on yet -> unsupported versions "at your own risk" - leverage the -> [PHP_CS_FIXER_IGNORE_ENV](./doc/usage.rst#environment-options). - -## Documentation - -### Installation - -The recommended way to install PHP CS Fixer is to use [Composer](https://getcomposer.org/download/): - -```console -composer require --dev friendsofphp/php-cs-fixer -## or when facing conflicts in dependencies: -composer require --dev php-cs-fixer/shim -``` - -For more details and other installation methods (also with Docker or behind CI), see -[installation instructions](./doc/installation.rst). - -### Usage - -Assuming you installed PHP CS Fixer as instructed above, you can run the -following command to fix the PHP files in the `src` directory: - -```console -./vendor/bin/php-cs-fixer fix src -``` - -See [usage](./doc/usage.rst), list of [built-in rules](./doc/rules/index.rst), list of [rule sets](./doc/ruleSets/index.rst) -and [configuration file](./doc/config.rst) documentation for more details. - -If you need to apply code styles that are not supported by the tool, you can -[create custom rules](./doc/custom_rules.rst). - -## Editor Integration - -Dedicated plugins exist for: - -* [NetBeans](https://plugins.netbeans.apache.org/catalogue/?id=36) -* [PhpStorm](https://www.jetbrains.com/help/phpstorm/using-php-cs-fixer.html) -* [Sublime Text](https://github.com/benmatselby/sublime-phpcs) -* [Vim](https://github.com/stephpy/vim-php-cs-fixer) -* [VS Code](https://github.com/junstyle/vscode-php-cs-fixer) - -## Community - -The PHP CS Fixer is maintained on GitHub at . -Bug reports and ideas about new features are welcome there. - -You can reach us in the [GitHub Discussions](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/) regarding the -project, configuration, possible improvements, ideas and questions. Please visit us there! - -## Contribute - -The tool comes with quite a few built-in fixers, but everyone is more than -welcome to [contribute](CONTRIBUTING.md) more of them. diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md deleted file mode 100644 index bea1ff4f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md +++ /dev/null @@ -1,162 +0,0 @@ -# UPGRADE GUIDE FROM 2.x to 3.0 - -This is guide for upgrade from version 2.x to 3.0 for using the CLI tool. - -*Before following this guide, install [v2.19](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/v2.19.0) and run in verbose mode (`php-cs-fixer fix -v`) or in future mode (`PHP_CS_FIXER_FUTURE_MODE=1 php-cs-fixer fix`) to identify deprecations and fix them first.* - -## Rename of files - -| 2.x | 3.0 | Description | -|------------------|--------------------------|----------------------------------------| -| `.php_cs` | `.php-cs-fixer.php` | Configuration file (local) | -| `.php_cs.dist` | `.php-cs-fixer.dist.php` | Configuration file (to be distributed) | -| `.php_cs.cache` | `.php-cs-fixer.cache` | Cache file | - -## CLI options - -| 2.x | 3.0 | Description | Note | -| ---------------- | --------------- | ----------------------------------------------- | -------------------------------------- | -| --diff-format | | Type of differ | Option was removed, all diffs are now | -| | | | `udiff` | -| --show-progress | --show-progress | Type of progress indicator | Allowed values were modified: | -| | | | `run-in` and `estimating` was removed, | -| | | | `estimating-max` was renamed to `dots` | -| --rules | --rules | Default value changed from @PSR2 to @PSR12 | | -| --config --rules | | | No longer allowed to pass both | - -## Changes to rules - -### Renamed rules - -| Old name | New name | Note | -|--------------------------------------------|-----------------------------------------------------------------------------------|------------------------------------------------------| -|`blank_line_before_return` | `blank_line_before_statement` | use configuration `['statements' => ['return']]` | -|`final_static_access` | `self_static_accessor` | | -|`hash_to_slash_comment` | `single_line_comment_style` | use configuration `['comment_types' => ['hash']]` | -|`lowercase_constants` | `constant_case` | use configuration `['case' => 'lower']` | -|`method_separation` | `class_attributes_separation` | use configuration `['elements' => ['method']]` | -|`no_extra_consecutive_blank_lines` | `no_extra_blank_lines` | | -|`no_multiline_whitespace_before_semicolons` | `multiline_whitespace_before_semicolons` | | -|`no_short_echo_tag` | `echo_tag_syntax` | use configuration `['format' => 'long']` | -|`php_unit_ordered_covers` | `phpdoc_order_by_value` | use configuration `['annotations' => [ 'covers' ]]` | -|`phpdoc_inline_tag` | `general_phpdoc_tag_rename`, `phpdoc_inline_tag_normalizer` and `phpdoc_tag_type` | | -|`pre_increment` | `increment_style` | use configuration `['style' => 'pre']` | -|`psr0` | `psr_autoloading` | use configuration `['dir' => x ]` | -|`psr4` | `psr_autoloading` | | -|`silenced_deprecation_error` | `error_suppression` | | -|`trailing_comma_in_multiline_array` | `trailing_comma_in_multiline` | use configuration `['elements' => ['arrays']]` | - -### Removed rootless configuration - -| Rule | Root option | Note | -|--------------------------------------| -------------- |-----------------------------------------------------------| -| `general_phpdoc_annotation_remove` | `annotations` | | -| `no_extra_consecutive_blank_lines` | `tokens` | | -| `no_spaces_around_offset` | `positions` | | -| `no_unneeded_control_parentheses` | `statements` | | -| `ordered_class_elements` | `order` | | -| `php_unit_construct` | `assertions` | | -| `php_unit_dedicate_assert` | `target` | root option works differently than rootless configuration | -| `php_unit_strict` | `assertions` | | -| `phpdoc_no_alias_tag` | `replacements` | | -| `phpdoc_return_self_reference` | `replacements` | | -| `random_api_migration` | `replacements` | | -| `single_class_element_per_statement` | `elements` | | -| `visibility_required` | `elements` | | - -### Changed options - -| Rule | Option | Change | -|------------------------------------|----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `binary_operator_spaces` | `align_double_arrow` | option was removed, use `operators` instead | -| `binary_operator_spaces` | `align_equals` | option was removed use `operators` instead | -| `blank_line_before_statement` | `statements: die` | option `die` was removed from `statements`, use `exit` instead | -| `class_attributes_separation` | `elements` | option does no longer accept flat array as a value, use map instead | -| `class_definition` | `multiLineExtendsEachSingleLine` | option was renamed to `multi_line_extends_each_single_line` | -| `class_definition` | `singleItemSingleLine` | option was renamed to `single_item_single_line` | -| `class_definition` | `singleLine` | option was renamed to `single_line` | -| `doctrine_annotation_spaces` | `around_argument_assignments` | option was removed, use `before_argument_assignments` and `after_argument_assignments` instead | -| `doctrine_annotation_spaces` | `around_array_assignments` | option was removed, use `after_array_assignments_colon`, `after_array_assignments_equals`, `before_array_assignments_colon` and `before_array_assignments_equals` instead | -| `final_internal_class` | `annotation-black-list` | option was renamed, use `annotation_exclude` | -| `final_internal_class` | `annotation-white-list` | option was renamed, use `annotation_include` | -| `final_internal_class` | `consider-absent-docblock-as-internal-class` | option was renamed, use `consider_absent_docblock_as_internal_class` | -| `header_comment` | `commentType` | option was renamed to `comment_type` | -| `is_null` | `use_yoda_style` | option was removed, use `yoda_style` rule instead | -| `no_extra_consecutive_blank_lines` | `tokens` | one of possible values, `useTrait`, was renamed to `use_trait` | -| `ordered_class_elements` | `sortAlgorithm` | option was renamed, use `sort_algorithm` instead | -| `ordered_imports` | `importsOrder` | option was renamed, use `imports_order` | -| `ordered_imports` | `sortAlgorithm` | option was renamed, use `sort_algorithm` | -| `php_unit_dedicate_assert` | `functions` | option was removed, use `target` instead | -| `php_unit_test_annotation` | `case` | option was removed, use `php_unit_method_casing` rule instead | - -### Changed default values of options - -| Rule | Option | Old value | New value | -|------------------------------|-----------------------------------|------------------------------------------------------|--------------------------------------------------------------------------| -| `array_syntax` | `syntax` | `'long'` | `'short'` | -| `function_to_constant` | `functions` | `['get_class', 'php_sapi_name', 'phpversion', 'pi']` | `['get_called_class', 'get_class', 'php_sapi_name', 'phpversion', 'pi']` | -| `list_syntax` | `syntax` | `'long'` | `'short'` | -| `method_argument_space` | `on_multiline` | `'ignore'` | `'ensure_fully_multiline'` | -| `native_constant_invocation` | `strict` | `false` | `true` | -| `native_function_casing` | `include` | `'@internal'` | `'@compiler_optimized'` | -| `native_function_invocation` | `include` | `'@internal'` | `'@compiler_optimized'` | -| `native_function_invocation` | `strict` | `false` | `true` | -| `non_printable_character` | `use_escape_sequences_in_strings` | `false` | `true` (when running on PHP 7.0 and up) | -| `php_unit_dedicate_assert` | `target` | `'5.0'` | `'newest'` | -| `phpdoc_align` | `tags` | `['param', 'return', 'throws', 'type', 'var']` | `['method', 'param', 'property', 'return', 'throws', 'type', 'var']` | -| `phpdoc_scalar` | `types` | `['boolean', 'double', 'integer', 'real', 'str']` | `['boolean', 'callback', 'double', 'integer', 'real', 'str']` | - -### Removed rule sets - -| Rule set | Note | -|-------------------|------------| -| `@PHP56Migration` | was empty | - -### Rule behavior changes - -- `no_unused_imports` now runs all files defined in the configuration (used to exclude some hardcoded directories) - -### Various - -- `udiff` output now includes the file name in the output (if applicable) - -## Code BC changes - -### Removed; various - -- class `AbstractAlignFixerHelper` has been removed -- class `AccessibleObject` has been removed -- class `AlignDoubleArrowFixerHelper` has been removed -- class `AlignEqualsFixerHelper` has been removed -- class `FixerConfigurationResolverRootless` has been removed -- `HeaderCommentFixer` deprecated properties have been removed -- `MethodArgumentSpaceFixer` deprecated methods have been removed -- `NoMixedEchoPrintFixer` the property `$defaultConfig` has been removed -- class `Tokens`, the following methods has been removed: - - `current()` - - `key()` - - `next()` - - `rewind()` - - `valid()` -- namespace `PhpCsFixer\Test\` and each class in it has been removed, as it served pure development purpose and should not be part of production code - reach out to community if you are willing to help building dev package - -### Interface changes - -- `ConfigurableFixerInterface` has been updated -- `ConfigurationDefinitionFixerInterface` has been removed in favor of the updated `ConfigurableFixerInterface` -- `DefinedFixerInterface` has been removed, related methods are now part of the updated `FixerInterface` interface -- `DifferInterface` has been updated -- `FixerInterface` interface has been updated -- `PhpCsFixer\RuleSetInterface` has been removed in favor of `\PhpCsFixer\RuleSet\RuleSetInterface` - -### BC breaks; various - -- class `Token` is now `final` -- class `Tokens` is now `final` -- method `create` of class `Config` has been removed, [use the constructor](./doc/config.rst) -- method `create` of class `RuleSet` has been removed, [use the constructor](./doc/custom_rules.rst) - -### BC breaks; common internal classes - -- method `getClassyElements` of class `TokensAnalyzer` parameter `$returnTraitsImports` has been removed; now always returns trait import information -- method `getSetDefinitionNames` of class `RuleSet` has been removed, use `RuleSets::getSetDefinitionNames()` diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/ci-integration.sh b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/ci-integration.sh deleted file mode 100644 index 39d99955..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/ci-integration.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -set -eu - -IFS=' -' -CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${COMMIT_RANGE}") -if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi -vendor/bin/php-cs-fixer check --config=.php-cs-fixer.dist.php -v --show-progress=dots --stop-on-violation --using-cache=no ${EXTRA_ARGS} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/composer.json b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/composer.json deleted file mode 100644 index a3f667e6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/composer.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "name": "friendsofphp/php-cs-fixer", - "description": "A tool to automatically fix PHP code style", - "license": "MIT", - "type": "application", - "keywords": [ - "fixer", - "standards", - "static analysis", - "static code analysis" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "require": { - "php": "^7.4 || ^8.0", - "ext-filter": "*", - "ext-json": "*", - "ext-tokenizer": "*", - "clue/ndjson-react": "^1.0", - "composer/semver": "^3.4", - "composer/xdebug-handler": "^3.0.3", - "fidry/cpu-core-counter": "^1.2", - "react/child-process": "^0.6.5", - "react/event-loop": "^1.0", - "react/promise": "^2.0 || ^3.0", - "react/socket": "^1.0", - "react/stream": "^1.0", - "sebastian/diff": "^4.0 || ^5.1 || ^6.0", - "symfony/console": "^5.4 || ^6.4 || ^7.0", - "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", - "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", - "symfony/finder": "^5.4 || ^6.4 || ^7.0", - "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", - "symfony/polyfill-mbstring": "^1.31", - "symfony/polyfill-php80": "^1.31", - "symfony/polyfill-php81": "^1.31", - "symfony/process": "^5.4 || ^6.4 || ^7.2", - "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" - }, - "require-dev": { - "facile-it/paraunit": "^1.3.1 || ^2.4", - "infection/infection": "^0.29.8", - "justinrainbow/json-schema": "^5.3 || ^6.0", - "keradus/cli-executor": "^2.1", - "mikey179/vfsstream": "^1.6.12", - "php-coveralls/php-coveralls": "^2.7", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", - "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", - "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", - "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, - "exclude-from-classmap": [ - "src/Fixer/Internal/*" - ] - }, - "autoload-dev": { - "psr-4": { - "PhpCsFixer\\PHPStan\\": "dev-tools/phpstan/src/", - "PhpCsFixer\\Tests\\": "tests/" - }, - "exclude-from-classmap": [ - "tests/Fixtures/" - ] - }, - "bin": [ - "php-cs-fixer" - ], - "config": { - "allow-plugins": { - "ergebnis/composer-normalize": true, - "infection/extension-installer": false - }, - "prefer-stable": true, - "sort-packages": true - }, - "scripts": { - "post-autoload-dump": [ - "@install-tools" - ], - "auto-review": [ - "Composer\\Config::disableProcessTimeout", - "paraunit run --testsuite auto-review" - ], - "cs:check": "@php php-cs-fixer check --verbose --diff", - "cs:fix": "@php php-cs-fixer fix", - "cs:fix:parallel": [ - "echo '⚠️ This script is deprecated! Utilise built-in parallelisation instead.';", - "@cs:fix" - ], - "docs": "@php dev-tools/doc.php", - "infection": "@test:mutation", - "install-tools": "@composer --working-dir=dev-tools install", - "mess-detector": "@php dev-tools/vendor/bin/phpmd . ansi dev-tools/mess-detector/phpmd.xml --exclude vendor/*,dev-tools/vendor/*,dev-tools/phpstan/*,tests/Fixtures/*", - "normalize": [ - "@composer normalize --working-dir=dev-tools --dry-run ../composer.json", - "@composer normalize --working-dir=dev-tools --dry-run composer.json" - ], - "normalize:fix": [ - "@composer normalize --working-dir=dev-tools ../composer.json", - "@composer normalize --working-dir=dev-tools composer.json" - ], - "php-compatibility": "@php dev-tools/vendor/bin/phpcs -p --standard=dev-tools/php-compatibility/phpcs-php-compatibility.xml", - "phpstan": "@php -d memory_limit=512M dev-tools/vendor/bin/phpstan analyse", - "phpstan:baseline": "@php -d memory_limit=512M dev-tools/vendor/bin/phpstan analyse --generate-baseline=./dev-tools/phpstan/baseline.php", - "qa": "@quality-assurance", - "quality-assurance": [ - "Composer\\Config::disableProcessTimeout", - "@install-tools --quiet", - "@self-check", - "@static-analysis", - "@test" - ], - "require-checker": "@php dev-tools/vendor/bin/composer-require-checker check composer.json --config-file .composer-require-checker.json", - "sa": "@static-analysis", - "self-check": [ - "./dev-tools/check_file_permissions.sh", - "./dev-tools/check_trailing_spaces.sh", - "@composer dump-autoload --dry-run --optimize --strict-psr", - "@normalize", - "@unused-deps", - "@require-checker", - "@auto-review" - ], - "static-analysis": [ - "@cs:check", - "@phpstan", - "@mess-detector" - ], - "test": "@test:all", - "test:all": [ - "@test:unit", - "@test:integration" - ], - "test:coverage": [ - "Composer\\Config::disableProcessTimeout", - "@composer show facile-it/paraunit ^2 && (paraunit coverage --testsuite unit --pass-through=--exclude-group=covers-nothing) || (paraunit coverage --testsuite unit --exclude-group covers-nothing)" - ], - "test:integration": [ - "Composer\\Config::disableProcessTimeout", - "paraunit run --testsuite integration" - ], - "test:mutation": [ - "Composer\\Config::disableProcessTimeout", - "infection --threads=max --only-covered --min-covered-msi=80" - ], - "test:short-open-tag": [ - "Composer\\Config::disableProcessTimeout", - "@php -d short_open_tag=1 ./vendor/bin/phpunit --do-not-cache-result --testsuite short-open-tag" - ], - "test:smoke": [ - "Composer\\Config::disableProcessTimeout", - "paraunit run --testsuite smoke" - ], - "test:unit": [ - "Composer\\Config::disableProcessTimeout", - "paraunit run --testsuite unit" - ], - "unused-deps": "@php dev-tools/vendor/bin/composer-unused --excludePackage=composer/xdebug-handler" - }, - "scripts-descriptions": { - "auto-review": "Execute Auto-review", - "cs:check": "Check coding standards", - "cs:fix": "Fix coding standards", - "cs:fix:parallel": "⚠️DEPRECATED! Use cs:fix with proper parallel config", - "docs": "Regenerate docs", - "infection": "Alias for 'test:mutation'", - "install-tools": "Install DEV tools", - "mess-detector": "Analyse code with Mess Detector", - "normalize": "Check normalization for composer.json files", - "normalize:fix": "Run normalization for composer.json files", - "php-compatibility": "Check compatibility with all supported PHP versions", - "phpstan": "Run PHPStan analysis", - "phpstan:baseline": "Dump PHPStan baseline file - use only for updating, do not add new errors when possible", - "post-autoload-dump": "Run additional tasks after installing/updating main dependencies", - "qa": "Alias for 'quality-assurance'", - "quality-assurance": "Run QA suite", - "require-checker": "Verifies if codebase does not contain soft dependencies", - "sa": "Alias for 'static-analysis'", - "self-check": "Run set of self-checks ensuring repository's validity", - "static-analysis": "Run static analysis", - "test": "Alias for 'test:all'", - "test:all": "Run Unit and Integration tests (but *NOT* Smoke tests)", - "test:coverage": "Run tests that provide code coverage", - "test:integration": "Run Integration tests", - "test:mutation": "Run mutation tests", - "test:short-open-tag": "Run tests with \"short_open_tag\" enabled", - "test:smoke": "Run Smoke tests", - "test:unit": "Run Unit tests", - "unused-deps": "Verifies if app has dependencies that are not used" - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/feature-or-bug.rst b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/feature-or-bug.rst deleted file mode 100644 index e5959422..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/feature-or-bug.rst +++ /dev/null @@ -1,24 +0,0 @@ -========================== -Is it a feature or a bug ? -========================== - -Sometimes it's a bit tricky to define if given change proposal or change request is adding new feature or fixing existing issue. This document is providing more clarity about categorisation we use. - -Bug ---- - -Example of bugs: - -- crash during application or rule execution -- wrong changes are applied during "fixing codebase" process -- issue with generated report - -Feature -------- - -Example of features: - -- introduction of new rule -- enhancement of existing rule to cover more cases (for example adding support for newly introduced PHP syntax) -- introduction of new ruleset -- update of existing ruleset (for example adjusting it to match newest style of given community or adding newly implemented rule that was supposed to be followed by style of given community, yet not implemented as a rule before) diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/logo.md b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/logo.md deleted file mode 100644 index 68e03a58..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/logo.md +++ /dev/null @@ -1,3 +0,0 @@ -The logo is © 2010+ Sensio Labs. - -Original resolution can be found at . diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/logo.png b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/logo.png deleted file mode 100644 index 0ee90a821322b4bbb293cb466fd717f8a2ef44df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18627 zcmd2?Wm6nouwL99f(Ccj;6XxQae}+E$l~skRYcl|VKHeu@7}zUH(r=(s$e4`mis>?>l*JtWlg|q8rxL|1a-~43?h~9mQ35W$ zR1aixbI^FMr(a70K|>7l1>oS|qU;=x{r(GAyU*QzHP-E()a@ML*D1vgf*CoW`Dx$kL#23QNT^SAThYVxV&W@sBfQq<@Zd^90ufw3XMAVQm&I{uQxbP zJojO#C*f{8ZF2;%0$+w)miBlj;KE*oxQq)_uKTcz^ZpJv64&SFVJl)u;i>)h_8Tw@ zx&CAh(KQ?Qy21~2TprjP<=xXD+PQEO9{cmfoZmhYn3+apGO zqW4DG9*)e@AXdapK1lBzvHi69B+U_1}PU zFBEYF0LTH-5@M?E%cmV~nbaB{tS{{cnPtbT!ZV2)_55HwETBIC3l%<$$+517mWbFo zXp5*AocVa_6^+%%u?ahXe;OH{5?#S8inLcT?f{~jym2mbUO$gLRuVQUHg{EDUMrRA znx9ZzP<7Loo0;@lN0bQ1q!15A#G?Fvbz|nAuYzd=xj?b=>VU%j3~NpMht~gUEY^`KOh;vk@Fya^5#B|lotFtwFcVaJWO&slac7)(BvI%K$o_k5kKaq|`_p?S#J5V- zxlKZoe`?(@KKB>YjWnfaXA-A0bvU9S2ms)crF>&2Xo7C`sm$TRTKj^f?tA|iBC&lU zL&(M}$3;^}O^F;|Db|h-@O#X5Yj2_BWT2AJgkQhhUx+W=W;32vME+FGjk@#BXhtyB zD#^Y^PTc)hJ19-eAGEJ%IiB-YTy1bJiHuJnPF$n4(t!Sf=1qSZOX zXD1iEDaUN)R&GYbQV6(je~sqwf95s{Chs&S8emH1{8yDUnuDvnT7pUi4`QFBA?;mg z-J>-bkRN-Be!qd7m{WyBVj7{ZzczyL{0*QY6tSt$?VD7Q$#qRr2RuPl%#vT=n|yzB z1$DF0{8j9D{%ltiZjVJ7ya2ZI6h=z0^UvLg9^BE$05L0&>rtux41VyS2u9~96Kjm) ziQw<-5p- z#Xx2;CJ=;b-_x^eQI`mg#DwZT_uf3yA-GX2vb@bGLINoS9p0j@mO}2pADPQ^EvX{0 zGS7k{qC6v&XIh%_sV0e&42$(o`rw)0Ew}~W`rk{2>gp<1WIv`mMOx}(mP}cgw}Ik< zi8V?Bi?uqXM1#O(VAqO7@UPAT8xdKoEy@b5)vGiEp43A(N2C+HHiS0BS!$$i7@1OD zi?fYC6(^Frfg=M>xU3C*<>%&{JLYMqc>jH`uX5p4ARbplOyXQaeRXjvLsB<_$O8bP z#q83P@lXW|FH;+rn*<+Jtzc?*L5yLzB0uanPaR&X<^T00aimqQ2G>Z+t-VN7Yyc5V z9e(IDMqqA>re?)eZ70I+>Nt)_{%I1n#mxpXI?Ls46-3Pa1{*fr+d zRJsshr;-YE{#H7Vf%Tt!J<)!b6qNaH*bxg1ObW2MbY|NTdC;kZ z_;)lE;opXbP-o@EvWdNR`o{)6kOwzAh?ZkNLPWlYv+}e5gRoh@$*r}YEPR32gFDn? zLBM)aK#IFgB;N3~-+oKuzL3{6ynPUw$cLXHL4seOr(nasvJ`03C1E+Pa6NI->P`;g ze1kjv7u|~~y2hlX(F8aAsgc;@$HZFySd-7|$wsu?2qGA!$!~ulA^;rGSFXmafLJ*b z*e-A15n7!o&4%X3TDCS>z){_yk3L zC~8x(a^U+dpwBKrRVUaIIz3~5J9G24XoBF%Ap!hHwdQk)Mh(Xa{3R?_D>kxXEG`GApMPki-e2qEB=XPaLX^t7n9$xCvn^5<)>Orx;lvc|d|vimT|zhq{IEby zOhVTiLBJ6Ub>H`qD4xXlZ)r46Su|VwqL#9oG{h?I&dq^LRh^h#7@4A_O5);J)KD_8 z7|_3Wp-5ryhJi$)0{{sssg{()(jQY}@zR7_LOf>NPZ1X!W;Cdn0T7I_AN8N=co-oW zyIimr`6$m0J*})lSFp$azo=1H~M(8@WUEgsl+GCLEnNm2ec#k$%$cryVo_-mQiOSiwQQPD6~DkwI@*WTW$?ZA%g~hKq5Fh zOOV6C8&RP&Ds*ai+(&yEjz#rh+z@`_&t{kD#Yxv)Z4M9RpYMFtJJ?V*76bUXVqc1Tdh#dRAhj%E&==_RD(9^WGFHTy%0 zxsH;HA4LMx`A-p%iG=r8-|3jpbFYQAxoJNxux)x$OTP2pdwAKSOsiG5e`+$TTppoJoDnl{#EVym^3CZltiQ-*(gE! z+iD#h3Xq%P3P{kCwn9_uTgJYrFm5i^s0(G<`JcaBUR!OpT&7CzE9qe>VN7U$Osy<^ zv40}73mTqDe%RzI)&wPXMo4aTL2K(5tBrU3Nr>G+4Ov%}MS2EDL)`gquV>fhs>lc` zDecd!6fV|3c*pYwYI}^h=g^mcm&O30?@=-m9~i+{OI4v3H9R%C=;~8$X}HT&thtjs z@TBFSt4>HWDw-a;xixti;^5m;j&#EzQU9Ke^L^7EW3-=LBKW`HQH=WS9oIhuyN}QL zaGsP#aA)&etqJ}$wXB{8;m4%vvSb1xqMohkWX!D*ssC*y6&JNo3*$e5qc?m%0H(MHFvFBPm9bWz=TzCJUSB_Znq;L4Rl`Fw)#BQw3ndQFS7_*NWT z=j2YRdvO(=3v)^0BB91*>v!P7`$0GC-$d(uVNvPqtpWZifcH$*`R9iDu72&9e;*YlIU zv&gV9p%7O(?de7U&StEvnSPnx0a@zOw^47~P)uk&ou*zVy(m(lzo>+>xN-}m^4N{( z@mr#N-21dFV9;B_ffvqypqXjjt0$w9et=`x74*Gv>!Jgs8*PZpGxuAj1|h+}N5mat zKEJ`}#{Qa<8`Z3WiLm~pLiM|3OpaGhS~AfBjYk5kKoiCUudS?3l<5`NW8ibY;cf7r z*%ZEEdxjtKj!8VJNHRhk97igl-Q#?6de6@J>`hIfp1zI07*u#Lp5~3&Eh7UXcD#ZX zb%g&F^`a;8hm?teGeYf!73fFU$HvGWTTW~V^vf6MDOVr!Z5Mo!U@yL4J4V(S2N}L) zb;`fOce~Zz1>wzQsv{Gvev>$#OD8i0k)Z--#2ftpu7y7@wNK?wlxlRYUtkYI!yy97 zM1;(Jh8GlQucYJuFuGp0a_ZjRUaPVGGe_Go{0P@nSd_cW{O+DSwtM{Di#0u{Bg{W0!uMb)^;^Bp{k1k+b9!G+=}Jg0XRb zPCayh^v9)$;p%_iP2Qdoyvi(J-f24``s~L#-uxRPQl^D~9<%%nOm_O*)1~cJ2Z9+p zT&}|dm{`2~S_~p>+bxI96ZLRFUsTd|&IxBT z+n&~Lm-`VJat&zmx%+Ji?b86Rd&w@Orc6KR7^y1_HI~tRAcD5C#qQ$+6bafEV6DS(3=Ldt?~RX%&7%{ zE@F{t<<#&F^zMI{w*5)G#YtH!rFE&~SPQSo1n80uZIylQ1kL}s7P6QOyAyu!RkHe4 z(NhtByasQkO(4t>JUvU@a1exu8Q3jHPKk&-Bw4wS1)~aQkGQFm>Jc7ZWqjc!Is~Ic z&Rx$!DB=n^_zz3-{w*Eb$z-qBIYhn=+rOt9wk4p)d|9ws=79mXo)oInPS(?>y>7zp z*(hf%f8`7}DtTBbc6n{!xpw*jU}{E_{WT>p#YGVVF<}v*prA$nqRIzD`+tM|Dk+NG zoe^G=2o-7dv~W=j+ohiN5OM!@CQtG~YqX@xRC?I(zd&u%NHX&mcbQTt$&an}1H320 z&Rf~J^cKD6z;UOCe`YT@PTzab$hRowrl8ui`!52hfOpogND}kc8}el>c13WYzCg;2Ld-A z*6AEhG`@z7^l{Kb1F?Z%QA7Z6p0si%BLQ>T}t%P#$6H8x1NbQ1ni zy&a_7O@9{6cpmp+=W0p*qei_;YdP@ua7eA|wM9!HNa;&g-8KNC@5+E@e1s}A`JHoR zhFnJ!_~%Iv|69MZ7%+FLtldK{dcH0Tv|(XxtG29ZIs&4ntOBVoyg~~iQ<`lRj1O_AiiBk& zAdQ|p-ZENRFd6$JvTW{ zhpUJ-_QrE8AQ#j|{pAa9C*fD_fw0h;`!L?$+KgKXzdDGhsk1u|&`H|QL2)mPwM}^WkgA|(%g+X z0r73=#RJKMgX4&P5-eACS58oJ)j)xmW0Z|h6TkIh!jkx1d?E2Wj7d)`p(yajgjS7p z|82HR99}xmba4+GBpOXX1|~K6J5Kg6UHK7u;%yS(Fr`torb1ks^-Ec*FgDv=`NrA2 z@uSRDK0pA_KiEGGSpru6t0v|Zag#r+kt>L(KLUxKp+}s1Kpsni>Oo#2H}oeYvzQzP zPE0UNn*dNUxE=U=O(Wwq`h)1C$TrMSte4KawI>bpd%Wb{tX(}9SZYb&Qe&AYWL%}F zYvESRwxsane?X?=XVMUcEdWf$g@a>1Vur|&p`rvX_!bSCrEI5glcTS$%d>-!1s)Y& z0AA71Rw5Abx17TpmA6^&ur+Z9N!wd;(hSOsBMeJ}(_?)UBCjw%2MPf(n~TH)mN`^~ zLNoXpd|~2(jC<0?&YRnB+9!6k^Q)XfzxS~!+;Hf|wB+V6 zlvG$KsOvgl3@d-6W(Mmq@|gY%{}2Be5G6^ zQiJSa+d!n73bvQ}32DY3{GMISV8?n+&)`&xwze@T1lbB48MFP9WqR&~#}wrM)MxQm zFOtihP10Xze!*B&_K`tT{z8Td1={MaL9bkCOg!*SfdB<+=fgj>4xz+@X(V)zjx6A0 zqyUG1^>}r+lg&kXx|>oVwgU7Xd4=lXh!(hU(7~FGFw^Xt{Ax*{qMlCM2TC2dC~Xp& zo-b46YHP#F7=%g|pQZcA18I%aP-nC+UaEK?IN%8Da=EI#ic5X-GUw~2+VII8p9mK1Z~Op45OJ>xgV#yt z?r|`w(|2hQGGh^Y zpNK(vP#$P2~5kOw8tj!k84VECEf1*n^+JoE;9><_no$J&2Tc~}d z42%bgrE@%V#yT3oXP?dEBC(W(z&q@hYXuqRU5J^mNWqG_OKhjyv{s&b-y(eFs2yW# zzfN(sLW{5b3|-}{(IiaWTU-EThqO*wjMh(T7wIge;Va-1auu}wFSMMh!6CGL3XqWd(WLj`a}u^^0v^s(YE zJISkptA@fvvESr?O^qLO3j*e9v-XrGfstOXf7`hj<6yZ@EXNViGKEm0nzvtZw-nmD{S&9X++<3pHXS4OGe3;Vwr!&)!mc4zAtBAq#6G!BolOAuf?&`wj z4z0;<==94v0jA(wLvCHYcD|uJIpi$SAa*I(P5*Hk2gSS5 z713QkK_RQyR8a4V*)3;}alKA$vVN2SlT|ro$_&3_upnvjpmhZHi>dsGGmGZuiWT4j za1a(Tw9Z(m2o991%G~X=+Re{N2M$)e6$^AUCGKU|X$9BkBZ9Wic?BLLuszC#HBqI5MQ~LYqr5yo5a2L8r)W27f#4 zbhmG+qdHsY=7Cu2#0G#Z#vCI`KFT_=4@III4Acy?ZcnY>)1}S&IdoT%n#Dw+I~rYN zjFdqx1nN-pzqilYRwiarN_1fjO4Q2;goh`6+xBThP+ z?#}b3|I9`z+|D*XHDmA|x zPoReV5myD5ZD1^^DPDZ%(A=>?vw@_M`2)9zFGKkUM$jwFb>+yT@DmW_K-dtgA`SlL0 z(W74Iyw6RV|M`|FibM-TOjuQs9sP^!T?beiNF#R*kDbrXw$v;}9>^(=$N&XeOm=kI zG&cEbtWp|i!y`T%XWU5rWg$X}JmLD9MNE7p*-hAWFnW!thB?LTIERUmZsJEBjTUdu?rw1FQJ3xF!{+OK=YmsaWU}SgH4*!saSh$a zd<3?(7Y~(TRT-1y>CS2%g|(7KjNvV3E_ zt!tlO;uLOOeBz>uM^m9*zP(TU?zHwzr1N~OzMjj@$+}Gk%wj#*V*Jjf*zvg8Ssc6J z-s{%saLZHO{Fbiq(kDGy=N^(hI`D-mz6#k4T{h42;Oz623?~pvGw*9d*`2rW=qQjH z04+2bG*6oA!Y5yzLi~xEU*+$5RlnDg^Yg;V37;m@m*o>45i53jwXcasTJI~9e!Xpe zsbrexCXbIvvS#_2PT8^oQi%7~i8kwBKt+S39(+DC(Y!CSW3#)}kDXmp_d;5ws<|%g zN!c#!Hc4qd6ua@!I*qS$VPCIKHsp)BzNX|vDEsL}k$LCW3w>?q6mq?>gSwe}{^96u ztYG4a7D%|!gKoIJ%*-q4yP{w^Un%7PLXKT?VH&_74RC$cK37lYB2CRO3H%1B+=9*q zIpul0s#;s7Zk%o0zH|*$udugXkARV>C1e-I{&p4D+f4aQs{bjyjE!_sD+O z@A9*m!HE^Vq6<88iQ@;IPt6-@7Cc+Jo|BNyG87~Mf)CF#b^!Q;SN>}AW_0B1 zXV36iZCawzZxGp`U{yV~%J0D#38nmNSLnx<3d?Cf_sjBr3g|s)G`I;%^KNn@DuZX{ z()4XC%M=(Lp10LBEL2;SeMN)ncI)zZg~ND#SZAYCDLv~vhqUuD&sLaVp>lCWZ~%L2VzFMfbaUk|>Q=b33*%J8|=si%3I4;Mvip# z3W&q^s-rY&RI4)b!-Zob-_L*7N8dz7>HObb0B7^IUsujql*RI20M3(oZtYV)`y1IL zeoB@@q4Stk%F}0(kok2TwBSE>F8B=EG+DpSD8AlRqkk451#@x#T?FA5DYx{n++#ko z@$4KWQqOg$o`@|>S5<9M;5xO3iD|`f2i_f4nFMKtt^3gr%)8^~A4N!jWkXto6-u-M z(r2r#>rcIY!DN=4t*8(X#~2ZI=%hHDEw?D<*K{+cC5-aW{UUCF2TW_LK$KhTefgb- zEh%;XGl)9krVoOPlDiA&yy9m9fAYd&1SqW~!IgbmrYc^HYIp^uZtb3}WdC zqiG~0GXls070`@)Wh%tF6GfS!w^SWlvo(iKJ;2|&aqwUQFA>`&ov>Wy3xNBJfK~fu z8UDsEU{N(O88OR4XPA9gz!Uuje%GNfB6g)pV_LFaW&6;5JBy2kWY3{CGVI^Ebuw(8bNqDX zQapeh;W6R9(XUlu%f#Sk>6X*DlKg&%;HGPTecyGDq0@Apy54TKa{dW9q?mE9ZY8xG z4R#AKPH;GhQ1zHTn2=^NX3YWflOQ9JNV?zMI^ns?<(2pCVl&`1jb>aMBxZY*?oMki zuxD&w^sqT-lJ)ABHM9>ZFtV)}jp4Sk)Nu-&y>$LG!Vbki#0tORLJ=$~umIKD5IFBq z%U74>!4Bq|8_BGnIR!Jo_B1dTIAsBgW-dtZvrouVfD|ipK@tLMs?VaA5ovSS2Yxh2 zNCyR$3=^Dnm3@|VB-bWOzl-m_-u9{Yva@|A`}`PW1$m0^xh4KLWLo!by>d6xX!A=8 z43C9QLi8tlP3L&tRJO}ch27IQiX)?@nqKKvtZ@7Ey7NiV?_F}RcCVC#&ee$Xx85_| zP8zzhI;yL~e%(mla1Qs3UXH@PKx8N$N|~KEhB{}oCMOPNwJ!mvK(Nh7^Kuzz_|cr| zX}6=;YC}&*BT-Hx(OnTMRJHP?Ju#(%DnzALwlr;Pjh8duQe~q5^^?7l!10l_V49Gg zBIB|rg%D`TmJO|08-HSXo|TOnqMTfm9%-ajU>e%SePgmr|2=qq z0p#@g+miJ^FY(e9pGm2`*h>>-M*TfwHL~?eMG?*#7!{_B}1 z3*4{0jVsEZdcrsOzyHWMH!q8>{ld!9Ha&V7&H%@1Z* z#8%{OB^6b<9~RjebXt(aAg0~6*-=rPgEq{?pi8ak00rh@7(Up4++~O^?FN(y>6YTd z;;{Gr;GQ}nDHDYk)xt`@g=)tJFUhnS4tpJ6%QlNp^d6m6^;$NvU-~6T=u=i z{4!{MTRDl|4nSqJ{&`^^<)M+xsFv}wkns!ZT_Y_NClxJ$pfZtH9jPO2FPPb>!DTmK z#n;Trl)g6gx(`@zX8N8Yfre{)@*=xg+1u3zN z=WDa(XLra!R4d8P6Q@oezA1$w<*5##Ea|rWu&G=)ek}-Lg8gG9rOI9L&{fs-V%9Y^ zC1O#%iDFL!zG$5N*P_brfL^lVh-X`hGCLpAIQqTieZtOazhsv(la zQgYsuo`Y=^daS#rw|5cZWU^xj&jF7UCF@9}mB?X)LXwJS@0{4K0I7M-%jj}~OYNsT z;ivY54>NuY*w6^&foFe7U!o5l!wZe|UcJ{UH~r@%PW1cIIfm=e@GaxKl?TH_zE%^a z;sC3VVT%H6zs_rVGC6xCu_J8&yfrQIn~{2QGr08VhN&+yONdg~Nza+fgK~%|S&`{F zTc%kSDinO``{rSMPD3rB{=AM7oa8YYH>5)($VueoNOYn?ltoMRo4^4nHGy47C^Vqc zmU{aWqNtl3RTV*)Ec7#2f>_R?01Z6{_4*>n&D+BGLBcVx5w^05F; zAwq#{-bGM(d4+IZ%>wsI=sZ<+o`q}xFb)Iz4Fdy71Fg-HtJU2Oy4IQ-AL(O&LRH9+ zysDOK$4Ku_7!7|PWK+|&ux6)+xVp;`ipSy$Hf6wAs2)b@=hrT(B%(%aX;H3Jo?z8F zK7P+yooo+3mRN_n5c*Bbd|G@U zriQ<<E;ed&JBye+?4BwQFlXfm={r8g1%Y_l@AGnMM+?dN6D-+Y zTFSUg_$@VK;)jwVV9nv(zG`w-#A*!2yfqTyw^) z@7G=<8CPj;Q3qXnSg}{@^JC7^WBw2uFm|Km%xY?#liAqaDt_z!U>0Knk}|@bTXnyD zSkq3NIl893I5;mT7o68K1NfhrZ(b4#g(tuB1PBby+R${($N(2PntiODH(t#^S(YEY zArmnGJ2eHElT-N{80`#PGq0pV$6^0??LcYt$IWIo%eBE?1>he{Jn6dOGzDINa#JYG zHy(DDMN+hU*aSmVS}50f9_}yyp`ZhM9aUa4?n>Q{aSHQ%x?l%=lanWC$4rTAAyHNi z@U^C)Nk(7vtG|AhTEL4DpK;Z;l}DBz*NVgY8lRa`bZcU!jUY6*E+qK%MyJAsj++Tk zrMe%BaHspIlfmlIbHSh*`b#OlFdQ;_9vSa!!>|h7cx{EzqZwrw8E-9?VB5U=NHw{7 zXNR#^xCE{+4c-6sZJGr8%a63I03(8MH)ms4(-KKO{mn1NhWnHax)zFbn}cS)gNl9`K6Y0(EqhF9<) zQPe)Goj(N8**;m3MhSx`8A{BUafxWv50AyTdaKnp)tQEF(F{R{?(#~|bBGWcLo*t5 zH=EVh+wGghs$##3A;F%C#I)6e{mwztjeW8S5>IC`|E!BlFw<`-1FbB+%MuxoZIqcO zsp5@I>&BR?hzhCjlS-%F8=>)&S@lMp`Y_JKLs9-tl{zX zVxVS5HIL9j$a!lj>DK_&PMoR}I2f*Q@l!t!zCpNGi6| z#cF5?3iOX)^>R4ot>=nUdalZ&WpRU9YHvPNdI`j}F!O^~o3-UryQg?}`ItVZlkvt% z0iob}hwlnT!-0>3tMMUcld^lZs$@!m(iZX3JrBtsl$K?mBYzYbnWXQGWNM4=Y3CD! zUO~}tL+>5wPH&^8!lcRuV{vciS6+&=qPV)N?(2*J-^(HlzFd~j@^u1l*ZI2kP8K=( zLfabv=~5^8a;FP*vV&xkPZU12t=spP>+5I(cp(&2gNPsPNFUGd-8IK0`6;Rr4%QU2 zMM5=hnvWjsI+uNnW1i$bbEN3cVJ${&_4Sy*#NR+*<`|mwQzDANoyt8TMQtG4X#WsI zQ?MhsY}ILB=!bb)>lXK%4L@i%|CtyRMPZt(rL*kT#8+54K1M&Na>POY9Ce^B-=s}w zxN%|(f-$`EA!A$$(P%&CjXyda_}e*Hd*5@u!*l*fKY!j#p#2=DygjV*7Oh*{Du$SV z+sd=uvX0c&3gI1q46m#=G z2`uB)sKS4TYrex8U-TX4pv+P|BU~08|G_kr%E(rp*?%cnU1|>n4^m9CmM;Hj1tm9e z@~uyKfgOxZ*;7XD$~1Mc=u06Ab*{YrOUa>I>=AY6EgYa2%gU*GOS-GqAaY7n>$T`_ zv1>89ihfF1tZ4S-K{Y{`=)ETiF=(ay0KLk|N5J$DG?MU z&g`C2GXF0!&8hQXPbqSHPI?qp9`ifRT!4GkvxsM-uDjRdfDKix=`w%x!-6AHOX>(j zw)5HxZ2{DFr4oPYJZr<>C*j~Y<|rEyFoDwOvr_rVE6ec`nW106C{>IN8-z0k;(8Xb z_{Hn;f(a@fhzFW;_--RE)?fCm@fxp~Ep)TuUmn`LBQcoSJjpAy;^?~C$dP(IRaUrE zxYo^Xh50@_mHR%OVWieJV*td71Uh^dM8-%x>NMJt-Bbr-Is$@)Bu5t6q870zw*tKr zee8t6eqJ3p&=6|FIlP#3VLE)w7Rk>f2ogJnmIqirv>05*WK8|yh!>ruHukf^u$N*u zkxC1dTgNlp3wtc|2Y$H=p0uPKNYM8%BH9x=sW1=Re z=s24}Kp1v0*t94pWO{|z&9pF5STE?m<1H{-abjl@t>R@n)O$&sCSluY6N7caFpB%0 z@RG@dPGyCGJY0_XVZw@TcFVp6zwK&pxx4$)yf?WU*>11vr-klXI2l&7ny^w9s*UGD z%|8P6vTR}XW%j=7rAMNQ356Vn9S6yHzLKKMbBBb&NQ-tg%}7q3G{_K5T2xAr4E3nj z$vQ5NT!MaQ2bXThZEf}K*{|8W_n)jC_zMg)VZ@EK>rB6a3#hpB{1Ywf&FOSV#VaZM z0l|gzkTk_^FuMtY<}+cn_6z2moGfU~Gfk{Jf$8gUi|gQG zyiYaB(z|H_Vked&$*^m+m$%`)Sr|@Q4C6j;i!jy3icQt9!k&{f+te?+b_}yw`2SaXM=4JOw4JLFEW~5jL1>nfB2tOty)EH6u)3-yocAxu@d1 zzk48|HhZQOVUZ<8_PDX@uEb~uW`QSU48e9_$ZECZlVnpYsbG>$lgonX!}W4~V%Eg$ zVWGCyXK^C9gg>+iW|glEtoTove;(lH*Wu?q>3B5z4eyA3$CPHU5%Xn=+%9BKTy-76 zt@U2ZGSoH{1z$r-2P{OwU#&|%v*i1q4IE5>+4ii$peFvdQEQgQeA9OUDM*hntb58f z;`cE8%1aWbOe|l!5X*TFtuELKGkCDQ)NR{2#KExB|B%T!HG&#;&})8!33Ucb*#pqM zjKAz+oUJ$V8sb7DeouN-t;K7+PB9wJ> z>__d_GtfJ1Z9dgt{0|!1k5MHy<>-`8<$g&EpO$YYSTJaRw=4{1UqlmV$^CT0=Fv4C zLFv_q#z2F;WWCcmFYQ+LZ7xxu04qnq#dW+PlbAAfSl5O)QG=y8EA7%o-)x`p%uAXYGnV1)MWFZ8B_ivZ6=C2#|@3YXNy%ouVxQXX7oCWJDF1PJ6<|f z-~xXsPSaC6u3=QK_-+k}=kzx*MO^Jh;6Ef!Ujs|DENODSR6JBF zr`40^K@JKUbk1(e_wX$?d^mb1YwrS0aC*Yf_dR5JY-s9Y3$8jaTq{>DoCP+x3gt%O z0B6q^!itDA9W=PMG<}+-_ui#RHG2gCSvd-cc?%hc{SjLS7@t=cHkJhKa~+gGi(ES= zr+*&Q{zPQ~@9f?X%xHd67l<6_Wy03vK>T94xE#K@xIXMuypF?GO&+sq50AZ${KN>* znux(LP$S@fW5kOjJJRpEjaipp!O*%afa&i2Gb5vM{6jaQtg^^tk3Yl{eQ5UIUGnbt zZ1rxzc01;@E4JsQd%xr1m1;jPm)$_{7Z%w*GR+9=eUc9~r+Lu?#2Pwffl`+{Jq#9rC6k}cp zHJK>jqMBXKX{tS64L)Wc7=NEhs)Z_|kcg?(vBSTizhl>Ow3~Le>2Q`}u8`%v>Gx>= zbM7)-8K(A_Sa2{;vM+A&6-=~RfTxJ~B69wnYB=UaL@|r+s>4Ka-D~c2m`cPX-71mW z!~t>Y5Q2Hf8oJE-d;L^O1}P7>S=&J5XuoQf9DX~3n;`vEnPV`WKV{-8O|r$2d*ODe z7F9e$@V359<*#5)I?ZR+pyUMX#&hCOyz5|9RR0jwYSHy3tO%~-=4gc{CrhJl;#jBxW})6>E0Fk*S>bxs zDFgJmk`ih~t>%C^;L#cxrQ*|(!b0TIV&nb43^xLfYq)F`d0a_!gNXQEJZxj?nW@`? zQ-k-#37ivbl>weiK1t@so}1l zA-s)<_g!XeG`TZ2IX&_~L(?z>Rw(PHQtd}u1ddb!9qDV&;72`F;>;5W%9^gqa4aum z@dS;TRF*6MZICllc#07|T2A(z&y46-Y1pePH%z77K0*aCnNf4`pT1rS|JA1Ivc;LV zS%T_~+B)QlHQDZ?sJY9NlQs96kG5I$ahUtr??$Y?oh^6Yy@)J-lH$-oorF+Xj*3=D zo$52=W)q_MM>v_YYTEPISuI-qA>CX)x!Xysc@7<}Vzxlnk!%AJy*2220E*(nNEL|_uhcQnF&CTqoSGk9=JErPSu;Bat6{3y^9yBP#Z zaE5G;;ob>5voVH9(=$!11qq(LMeEQSM@S%xVu0lVBox|=)+u=wl`FwYtU=`!Fn`3n z9E!E;u#aMp)kTy#R&STnJYVZsC33UP@+(crJih?dKe)~)XlpUij$pC-E3_Dp*XOh?I~{J9&ttnR*R(K2MZpD=PtnbGg2IY^O4or^)?{Q z!FfZ4fd2tiG-|>nqt_tM8k{1-N7smed7C zkmTYfl}zSmzBSzOQ% z8d)WgK-d$}77`c}Aa+x=5#`(nBOceIO)M9E%=1Y(x=6sQlP!6x$>{S1_KFs824)xu zB$7G~WENidqM@ayjt#%5CP1p52s9s2dDI=)vcMZ^Rz4UCoJ3*ZpK5yS8vQNxS@ol? z(7Vczghhu{+7D?&Bp;@H$n_XL6PLZ5yoI1MPAa(c*LA~$N#moXa2C-iAmL7ZJ| ztnPdvJ*?JJLuOd*>CeuWA#t03ZUQHrdvVA7!+iWJobo9dosjfFxbVa7-g~!bA&*J0 zSL46s1>WXMM4$mJ?7T`zNiC0RVW>>q88-MUFwS_%s9 zNsd~9C4yO6tYsvuOogWfE0X*6586r^zOGQ-4)0xDMvE?dRj$r>`==Bqtco#;#BJu0 zbd84{cxg)Hl;{?LSSx`HlhO3sZ|BQHHp)V+(XYsol%F+BG<`VI?BIv&h34Jp-{IPw zzFeWjXuSfg!4>L}Gi**H{l$UpxK;dG#`d62q}KcRZY!Lt4#!1g0SmxsMsqAlv{+R zTNL^dEP*sS=P1TN8VXZrb)gtJbBzn#F{ve1IC*22`ZP8Bek5%~#7Z$`^)dHjqcbnU zVr}1mxcvO>;k15%80KHr0L`?e#0nl5R7;?d2FMX|*D$I_$1?a>J58`?#lV&$&)X;v zi6miu2>C?XT*b4bLg%NQuC9%Q)O-A`stv#Mpy&SMe}sUKf~_i34U-u?4VGe|QEKhu zy)QjgnpO}5!QdHF+dsDlH;NJ-1ra2#9G!7FJEH)p3xX`L6foXcFJC|2w&mRaWmxBh zY-L$%2@h);)WLlzfWyTD!z+{H)A$8H@_EA6KS?T`uNv z>U`JLG9{@E$H{7vZaJZWHJ54fY^mreQ^vGgjRBlmw7Cz5?j>&j`Y`+OeK#0{NI{}A zYX%EcA;hHXR5uckkjf~gI{W@>!zEXJ&-Wa2a_CTh*WlLSC7dKnnUpOzl(G_4keFtz zJCzd9o}JfPIT#m-000KNNklXKxPlV>jp$)4Hg0nhSoafyUu`AMk$uc-QBl!_kS3M3}`h?ww03SyeFM{ zj)`z4y^za$4+Lhfy1__w{18HZ+pm;*wNu>#qMamU2N9WI$VH}KFQ9()R4^Z&=YTc9 zqB&550LO?YpGtRhKP;pnhxb1EPVGAb%CN=;c3l3CJ?pm~TZC+M3N!AMz4S>)HshU7 zxaF~z3W6YbDZ4Ziv*Ky{3^*mu)Y|LWC@MW;#6BCR=RBL9%m$>Dbc|H~HoGwPhssK1 zg)(Nyw2p!C7()|lzk`EDusN_!0g&@mZqAfbFu*=M$7zr;P&$AazH3)6m>D~AWm zDXeN~CJkU@kz+rr=~Qb0XPR()inYaJ-`Jzu%!U(d^jTkqs zT)=`vV~8;|2+>4c)CEyV06}6e9DWau@F*i>KMo)I4Hy5g5HTeHD@5e1H6{=vC2P%)H711E{=t&pw`kc4 zKi22?>$W!@gviD?iqj{L|Gq4aT>HYM@2V4NN;&>ao&UH4u>^#e_il-INgK(RKzs<`OzjvRF}!zhj@}s4CxVZRpk06t0$Tun2SLAq+yZdcw)WNI z(jVoa@>u{KV#L|N&h(XsT@`h>tINy#sdUtQ=78ns&@kuPPa|lww1Y>Ngh};8% z7J3q38Y0JpNCC)@aie!0^nMdyUM5{n+l#M{I0gUZy4Cif7hV|`hr8?XmF(Q`+WUp3 z>~oFThMV^t=t)-{PSZ*q!_^;M-+r3S2AL@olnrcFAgvHi1272BqY$1WI5YGo*Iyhu zH}UYn?j?(szTHtL8I1*yomOnhwXb^i)#=wyc=FBnwk%xR(Rm!e5P)cy_*8(JQr3a< z-MhGSYA`-V&oqD>;djIN4;V)u7w0{?vp9F*{&Ld0oeWQhd3w7HMCktZhN93c5H zj4oJf&Rpf@4lglPLgh`g<&E19oVxS2>B}7)H7_KqJq0Nq46{5m`!5W?MrU39-FAWq+_`MPGD(n zkD}NR+}pN%jn{}MD!4J?=gq5x@N-M0Fd?~BBciC_#*l1dHcPTK3Zv60Bfn@w6cyZ9 z2GyXDByMsXCwqM2`!ym;4V^R@1ESa!qbR!0lWQJ+X0@(SRMg?FAhnyy0f0sTxr0ag z?u(=N$cD{(_Exvo%0emXaLOozCe;|G0ZahU(h%6@hLn9``_BFA-del4h{~#sK>#5t zOQsxZB~X?B9acjyYQYV6xJ)6RNw-WY46OU)s~-l=mxfST*-Z(L$Ev{GFrg`mq9}@@D2k$thCczopJM@zawSXv0000 - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -use Composer\XdebugHandler\XdebugHandler; -use PhpCsFixer\Console\Application; - -error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); - -set_error_handler(static function (int $severity, string $message, string $file, int $line): bool { - if (0 !== ($severity & error_reporting())) { - throw new ErrorException($message, 0, $severity, $file, $line); - } - - return true; -}); - -// check environment requirements -(static function (): void { - if (\PHP_VERSION_ID === (int) '80000') { // TODO use 8_00_00 once only PHP 7.4+ is supported by this entry file - fwrite(STDERR, "PHP CS Fixer is not able run on PHP 8.0.0 due to bug in PHP tokenizer (https://bugs.php.net/bug.php?id=80462).\n"); - fwrite(STDERR, "Update PHP version to unblock execution.\n"); - - exit(1); - } - - if (\PHP_VERSION_ID < (int) '70400' || \PHP_VERSION_ID >= (int) '80400') { - fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.3.*.\n"); - fwrite(STDERR, 'Current PHP version: '.PHP_VERSION.".\n"); - - if (filter_var(getenv('PHP_CS_FIXER_IGNORE_ENV'), FILTER_VALIDATE_BOOLEAN)) { - fwrite(STDERR, "Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.\n"); - } else { - fwrite(STDERR, "To ignore this requirement please set `PHP_CS_FIXER_IGNORE_ENV`.\n"); - fwrite(STDERR, "If you use PHP version higher than supported, you may experience code modified in a wrong way.\n"); - fwrite(STDERR, "Please report such cases at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer .\n"); - - exit(1); - } - } - - foreach (['json', 'tokenizer'] as $extension) { - if (!extension_loaded($extension)) { - fwrite(STDERR, sprintf("PHP extension ext-%s is missing from your system. Install or enable it.\n", $extension)); - - if (filter_var(getenv('PHP_CS_FIXER_IGNORE_ENV'), FILTER_VALIDATE_BOOLEAN)) { - fwrite(STDERR, "Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.\n"); - } else { - exit(1); - } - } - } -})(); - -// load dependencies -(static function (): void { - $require = true; - if (class_exists('Phar')) { - // Maybe this file is used as phar-stub? Let's try! - try { - Phar::mapPhar('php-cs-fixer.phar'); - - /** @phpstan-ignore requireOnce.fileNotFound */ - require_once 'phar://php-cs-fixer.phar/vendor/autoload.php'; - - $require = false; - } catch (PharException $e) { - } - } - - if ($require) { - // OK, it's not, let give Composer autoloader a try! - $possibleFiles = [__DIR__.'/../../autoload.php', __DIR__.'/../autoload.php', __DIR__.'/vendor/autoload.php']; - $file = null; - foreach ($possibleFiles as $possibleFile) { - if (file_exists($possibleFile)) { - $file = $possibleFile; - - break; - } - } - - if (null === $file) { - throw new RuntimeException('Unable to locate autoload.php file.'); - } - - require_once $file; - } -})(); - -// Restart if xdebug is loaded, unless the environment variable PHP_CS_FIXER_ALLOW_XDEBUG is set. -$xdebug = new XdebugHandler('PHP_CS_FIXER'); -$xdebug->check(); -unset($xdebug); - -$application = new Application(); -$application->run(); - -__HALT_COMPILER(); diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php deleted file mode 100644 index 6a2be5f9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php +++ /dev/null @@ -1,235 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\Doctrine\Annotation\Tokens as DoctrineAnnotationTokens; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @internal - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * ignored_tags?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * ignored_tags: list - * } - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - */ -abstract class AbstractDoctrineAnnotationFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** - * @var array - */ - private array $classyElements; - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - // fetch indices one time, this is safe as we never add or remove a token during fixing - $analyzer = new TokensAnalyzer($tokens); - $this->classyElements = $analyzer->getClassyElements(); - - /** @var Token $docCommentToken */ - foreach ($tokens->findGivenKind(T_DOC_COMMENT) as $index => $docCommentToken) { - if (!$this->nextElementAcceptsDoctrineAnnotations($tokens, $index)) { - continue; - } - - $doctrineAnnotationTokens = DoctrineAnnotationTokens::createFromDocComment( - $docCommentToken, - $this->configuration['ignored_tags'] // @phpstan-ignore-line - ); - - $this->fixAnnotations($doctrineAnnotationTokens); - $tokens[$index] = new Token([T_DOC_COMMENT, $doctrineAnnotationTokens->getCode()]); - } - } - - /** - * Fixes Doctrine annotations from the given PHPDoc style comment. - */ - abstract protected function fixAnnotations(DoctrineAnnotationTokens $doctrineAnnotationTokens): void; - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('ignored_tags', 'List of tags that must not be treated as Doctrine Annotations.')) - ->setAllowedTypes(['string[]']) - ->setDefault([ - // PHPDocumentor 1 - 'abstract', - 'access', - 'code', - 'deprec', - 'encode', - 'exception', - 'final', - 'ingroup', - 'inheritdoc', - 'inheritDoc', - 'magic', - 'name', - 'toc', - 'tutorial', - 'private', - 'static', - 'staticvar', - 'staticVar', - 'throw', - - // PHPDocumentor 2 - 'api', - 'author', - 'category', - 'copyright', - 'deprecated', - 'example', - 'filesource', - 'global', - 'ignore', - 'internal', - 'license', - 'link', - 'method', - 'package', - 'param', - 'property', - 'property-read', - 'property-write', - 'return', - 'see', - 'since', - 'source', - 'subpackage', - 'throws', - 'todo', - 'TODO', - 'usedBy', - 'uses', - 'var', - 'version', - - // PHPUnit - 'after', - 'afterClass', - 'backupGlobals', - 'backupStaticAttributes', - 'before', - 'beforeClass', - 'codeCoverageIgnore', - 'codeCoverageIgnoreStart', - 'codeCoverageIgnoreEnd', - 'covers', - 'coversDefaultClass', - 'coversNothing', - 'dataProvider', - 'depends', - 'expectedException', - 'expectedExceptionCode', - 'expectedExceptionMessage', - 'expectedExceptionMessageRegExp', - 'group', - 'large', - 'medium', - 'preserveGlobalState', - 'requires', - 'runTestsInSeparateProcesses', - 'runInSeparateProcess', - 'small', - 'test', - 'testdox', - 'ticket', - 'uses', - - // PHPCheckStyle - 'SuppressWarnings', - - // PHPStorm - 'noinspection', - - // PEAR - 'package_version', - - // PlantUML - 'enduml', - 'startuml', - - // Psalm - 'psalm', - - // PHPStan - 'phpstan', - 'template', - - // other - 'fix', - 'FIXME', - 'fixme', - 'override', - ]) - ->getOption(), - ]); - } - - private function nextElementAcceptsDoctrineAnnotations(Tokens $tokens, int $index): bool - { - $classModifiers = [T_ABSTRACT, T_FINAL]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.2+ is required - $classModifiers[] = T_READONLY; - } - - do { - $index = $tokens->getNextMeaningfulToken($index); - - if (null === $index) { - return false; - } - } while ($tokens[$index]->isGivenKind($classModifiers)); - - if ($tokens[$index]->isGivenKind(T_CLASS)) { - return true; - } - - $modifierKinds = [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_FINAL, T_ABSTRACT, T_NS_SEPARATOR, T_STRING, CT::T_NULLABLE_TYPE]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $modifierKinds[] = T_READONLY; - } - - while ($tokens[$index]->isGivenKind($modifierKinds)) { - $index = $tokens->getNextMeaningfulToken($index); - } - - if (!isset($this->classyElements[$index])) { - return false; - } - - return $tokens[$this->classyElements[$index]['classIndex']]->isGivenKind(T_CLASS); // interface, enums and traits cannot have doctrine annotations - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php deleted file mode 100644 index 878ac3d6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php +++ /dev/null @@ -1,102 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\ConfigurationException\RequiredFixerConfigurationException; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -abstract class AbstractFixer implements FixerInterface -{ - protected WhitespacesFixerConfig $whitespacesConfig; - - public function __construct() - { - if ($this instanceof ConfigurableFixerInterface) { - try { - $this->configure([]); - } catch (RequiredFixerConfigurationException $e) { - // ignore - } - } - - if ($this instanceof WhitespacesAwareFixerInterface) { - $this->whitespacesConfig = $this->getDefaultWhitespacesFixerConfig(); - } - } - - final public function fix(\SplFileInfo $file, Tokens $tokens): void - { - if ($this instanceof ConfigurableFixerInterface && property_exists($this, 'configuration') && null === $this->configuration) { - throw new RequiredFixerConfigurationException($this->getName(), 'Configuration is required.'); - } - - if (0 < $tokens->count() && $this->isCandidate($tokens) && $this->supports($file)) { - $this->applyFix($file, $tokens); - } - } - - public function isRisky(): bool - { - return false; - } - - public function getName(): string - { - $nameParts = explode('\\', static::class); - $name = substr(end($nameParts), 0, -\strlen('Fixer')); - - return Utils::camelCaseToUnderscore($name); - } - - public function getPriority(): int - { - return 0; - } - - public function supports(\SplFileInfo $file): bool - { - return true; - } - - public function setWhitespacesConfig(WhitespacesFixerConfig $config): void - { - if (!$this instanceof WhitespacesAwareFixerInterface) { - throw new \LogicException('Cannot run method for class not implementing "PhpCsFixer\Fixer\WhitespacesAwareFixerInterface".'); - } - - $this->whitespacesConfig = $config; - } - - abstract protected function applyFix(\SplFileInfo $file, Tokens $tokens): void; - - private function getDefaultWhitespacesFixerConfig(): WhitespacesFixerConfig - { - static $defaultWhitespacesFixerConfig = null; - - if (null === $defaultWhitespacesFixerConfig) { - $defaultWhitespacesFixerConfig = new WhitespacesFixerConfig(' ', "\n"); - } - - return $defaultWhitespacesFixerConfig; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php deleted file mode 100644 index da862da7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php +++ /dev/null @@ -1,116 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -abstract class AbstractFopenFlagFixer extends AbstractFunctionReferenceFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAllTokenKindsFound([T_STRING, T_CONSTANT_ENCAPSED_STRING]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - $index = 0; - $end = $tokens->count() - 1; - while (true) { - $candidate = $this->find('fopen', $tokens, $index, $end); - - if (null === $candidate) { - break; - } - - $index = $candidate[1]; // proceed to '(' of `fopen` - - // fetch arguments - $arguments = $argumentsAnalyzer->getArguments( - $tokens, - $index, - $candidate[2] - ); - - $argumentsCount = \count($arguments); // argument count sanity check - - if ($argumentsCount < 2 || $argumentsCount > 4) { - continue; - } - - $argumentStartIndex = array_keys($arguments)[1]; // get second argument index - - $this->fixFopenFlagToken( - $tokens, - $argumentStartIndex, - $arguments[$argumentStartIndex] - ); - } - } - - abstract protected function fixFopenFlagToken(Tokens $tokens, int $argumentStartIndex, int $argumentEndIndex): void; - - protected function isValidModeString(string $mode): bool - { - $modeLength = \strlen($mode); - if ($modeLength < 1 || $modeLength > 13) { // 13 === length 'r+w+a+x+c+etb' - return false; - } - - $validFlags = [ - 'a' => true, - 'b' => true, - 'c' => true, - 'e' => true, - 'r' => true, - 't' => true, - 'w' => true, - 'x' => true, - ]; - - if (!isset($validFlags[$mode[0]])) { - return false; - } - - unset($validFlags[$mode[0]]); - - for ($i = 1; $i < $modeLength; ++$i) { - if (isset($validFlags[$mode[$i]])) { - unset($validFlags[$mode[$i]]); - - continue; - } - - if ('+' !== $mode[$i] - || ( - 'a' !== $mode[$i - 1] // 'a+','c+','r+','w+','x+' - && 'c' !== $mode[$i - 1] - && 'r' !== $mode[$i - 1] - && 'w' !== $mode[$i - 1] - && 'x' !== $mode[$i - 1] - ) - ) { - return false; - } - } - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php deleted file mode 100644 index b919b217..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php +++ /dev/null @@ -1,71 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - * - * @author Vladimir Reznichenko - */ -abstract class AbstractFunctionReferenceFixer extends AbstractFixer -{ - private ?FunctionsAnalyzer $functionsAnalyzer = null; - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - /** - * Looks up Tokens sequence for suitable candidates and delivers boundaries information, - * which can be supplied by other methods in this abstract class. - * - * @return ?array{int, int, int} returns $functionName, $openParenthesis, $closeParenthesis packed into array - */ - protected function find(string $functionNameToSearch, Tokens $tokens, int $start = 0, ?int $end = null): ?array - { - if (null === $this->functionsAnalyzer) { - $this->functionsAnalyzer = new FunctionsAnalyzer(); - } - - // make interface consistent with findSequence - $end ??= $tokens->count(); - - // find raw sequence which we can analyse for context - $candidateSequence = [[T_STRING, $functionNameToSearch], '(']; - $matches = $tokens->findSequence($candidateSequence, $start, $end, false); - - if (null === $matches) { - return null; // not found, simply return without further attempts - } - - // translate results for humans - [$functionName, $openParenthesis] = array_keys($matches); - - if (!$this->functionsAnalyzer->isGlobalFunctionCall($tokens, $functionName)) { - return $this->find($functionNameToSearch, $tokens, $openParenthesis, $end); - } - - return [$functionName, $openParenthesis, $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openParenthesis)]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php deleted file mode 100644 index b45be5ac..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php +++ /dev/null @@ -1,204 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\Tokenizer\Tokens; - -abstract class AbstractNoUselessElseFixer extends AbstractFixer -{ - public function getPriority(): int - { - // should be run before NoWhitespaceInBlankLineFixer, NoExtraBlankLinesFixer, BracesFixer and after NoEmptyStatementFixer. - return 39; - } - - protected function isSuperfluousElse(Tokens $tokens, int $index): bool - { - $previousBlockStart = $index; - - do { - // Check if all 'if', 'else if ' and 'elseif' blocks above this 'else' always end, - // if so this 'else' is overcomplete. - [$previousBlockStart, $previousBlockEnd] = $this->getPreviousBlock($tokens, $previousBlockStart); - - // short 'if' detection - $previous = $previousBlockEnd; - if ($tokens[$previous]->equals('}')) { - $previous = $tokens->getPrevMeaningfulToken($previous); - } - - if ( - !$tokens[$previous]->equals(';') // 'if' block doesn't end with semicolon, keep 'else' - || $tokens[$tokens->getPrevMeaningfulToken($previous)]->equals('{') // empty 'if' block, keep 'else' - ) { - return false; - } - - $candidateIndex = $tokens->getPrevTokenOfKind( - $previous, - [ - ';', - [T_BREAK], - [T_CLOSE_TAG], - [T_CONTINUE], - [T_EXIT], - [T_GOTO], - [T_IF], - [T_RETURN], - [T_THROW], - ] - ); - - if (null === $candidateIndex || $tokens[$candidateIndex]->equalsAny([';', [T_CLOSE_TAG], [T_IF]])) { - return false; - } - - if ($tokens[$candidateIndex]->isGivenKind(T_THROW)) { - $previousIndex = $tokens->getPrevMeaningfulToken($candidateIndex); - - if (!$tokens[$previousIndex]->equalsAny([';', '{'])) { - return false; - } - } - - if ($this->isInConditional($tokens, $candidateIndex, $previousBlockStart) - || $this->isInConditionWithoutBraces($tokens, $candidateIndex, $previousBlockStart) - ) { - return false; - } - - // implicit continue, i.e. delete candidate - } while (!$tokens[$previousBlockStart]->isGivenKind(T_IF)); - - return true; - } - - /** - * Return the first and last token index of the previous block. - * - * [0] First is either T_IF, T_ELSE or T_ELSEIF - * [1] Last is either '}' or ';' / T_CLOSE_TAG for short notation blocks - * - * @param int $index T_IF, T_ELSE, T_ELSEIF - * - * @return array{int, int} - */ - private function getPreviousBlock(Tokens $tokens, int $index): array - { - $close = $previous = $tokens->getPrevMeaningfulToken($index); - // short 'if' detection - if ($tokens[$close]->equals('}')) { - $previous = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $close); - } - - $open = $tokens->getPrevTokenOfKind($previous, [[T_IF], [T_ELSE], [T_ELSEIF]]); - if ($tokens[$open]->isGivenKind(T_IF)) { - $elseCandidate = $tokens->getPrevMeaningfulToken($open); - if ($tokens[$elseCandidate]->isGivenKind(T_ELSE)) { - $open = $elseCandidate; - } - } - - return [$open, $close]; - } - - /** - * @param int $index Index of the token to check - * @param int $lowerLimitIndex Lower limit index. Since the token to check will always be in a conditional we must stop checking at this index - */ - private function isInConditional(Tokens $tokens, int $index, int $lowerLimitIndex): bool - { - $candidateIndex = $tokens->getPrevTokenOfKind($index, [')', ';', ':']); - if ($tokens[$candidateIndex]->equals(':')) { - return true; - } - - if (!$tokens[$candidateIndex]->equals(')')) { - return false; // token is ';' or close tag - } - - // token is always ')' here. - // If it is part of the condition the token is always in, return false. - // If it is not it is a nested condition so return true - $open = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $candidateIndex); - - return $tokens->getPrevMeaningfulToken($open) > $lowerLimitIndex; - } - - /** - * For internal use only, as it is not perfect. - * - * Returns if the token at given index is part of an if/elseif/else statement - * without {}. Assumes not passing the last `;`/close tag of the statement, not - * out of range index, etc. - * - * @param int $index Index of the token to check - */ - private function isInConditionWithoutBraces(Tokens $tokens, int $index, int $lowerLimitIndex): bool - { - do { - if ($tokens[$index]->isComment() || $tokens[$index]->isWhitespace()) { - $index = $tokens->getPrevMeaningfulToken($index); - } - - $token = $tokens[$index]; - if ($token->isGivenKind([T_IF, T_ELSEIF, T_ELSE])) { - return true; - } - - if ($token->equals(';')) { - return false; - } - - if ($token->equals('{')) { - $index = $tokens->getPrevMeaningfulToken($index); - - // OK if belongs to: for, do, while, foreach - // Not OK if belongs to: if, else, elseif - if ($tokens[$index]->isGivenKind(T_DO)) { - --$index; - - continue; - } - - if (!$tokens[$index]->equals(')')) { - return false; // like `else {` - } - - $index = $tokens->findBlockStart( - Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, - $index - ); - - $index = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$index]->isGivenKind([T_IF, T_ELSEIF])) { - return false; - } - } elseif ($token->equals(')')) { - $type = Tokens::detectBlockType($token); - $index = $tokens->findBlockStart( - $type['type'], - $index - ); - - $index = $tokens->getPrevMeaningfulToken($index); - } else { - --$index; - } - } while ($index > $lowerLimitIndex); - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php deleted file mode 100644 index 47dcf2f7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php +++ /dev/null @@ -1,314 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\TypeExpression; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - * - * @phpstan-type _CommonTypeInfo array{commonType: string, isNullable: bool} - * @phpstan-type _AutogeneratedInputConfiguration array{ - * scalar_types?: bool, - * types_map?: array, - * union_types?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * scalar_types: bool, - * types_map: array, - * union_types: bool - * } - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - */ -abstract class AbstractPhpdocToTypeDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const REGEX_CLASS = '(?:\\\?+'.TypeExpression::REGEX_IDENTIFIER - .'(\\\\'.TypeExpression::REGEX_IDENTIFIER.')*+)'; - - /** - * @var array - */ - private array $versionSpecificTypes = [ - 'void' => 7_01_00, - 'iterable' => 7_01_00, - 'object' => 7_02_00, - 'mixed' => 8_00_00, - 'never' => 8_01_00, - ]; - - /** - * @var array - */ - private array $scalarTypes = [ - 'bool' => true, - 'float' => true, - 'int' => true, - 'string' => true, - ]; - - /** - * @var array - */ - private static array $syntaxValidationCache = []; - - public function isRisky(): bool - { - return true; - } - - abstract protected function isSkippedType(string $type): bool; - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('scalar_types', 'Fix also scalar types; may have unexpected behaviour due to PHP bad type coercion system.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('union_types', 'Fix also union types; turned on by default on PHP >= 8.0.0.')) - ->setAllowedTypes(['bool']) - ->setDefault(\PHP_VERSION_ID >= 8_00_00) - ->getOption(), - (new FixerOptionBuilder('types_map', 'Map of custom types, e.g. template types from PHPStan.')) - ->setAllowedTypes(['array']) - ->setDefault([]) - ->getOption(), - ]); - } - - /** - * @param int $index The index of the function token - */ - protected function findFunctionDocComment(Tokens $tokens, int $index): ?int - { - do { - $index = $tokens->getPrevNonWhitespace($index); - } while ($tokens[$index]->isGivenKind([ - T_COMMENT, - T_ABSTRACT, - T_FINAL, - T_PRIVATE, - T_PROTECTED, - T_PUBLIC, - T_STATIC, - ])); - - if ($tokens[$index]->isGivenKind(T_DOC_COMMENT)) { - return $index; - } - - return null; - } - - /** - * @return list - */ - protected function getAnnotationsFromDocComment(string $name, Tokens $tokens, int $docCommentIndex): array - { - $namespacesAnalyzer = new NamespacesAnalyzer(); - $namespace = $namespacesAnalyzer->getNamespaceAt($tokens, $docCommentIndex); - - $namespaceUsesAnalyzer = new NamespaceUsesAnalyzer(); - $namespaceUses = $namespaceUsesAnalyzer->getDeclarationsInNamespace($tokens, $namespace); - - $doc = new DocBlock( - $tokens[$docCommentIndex]->getContent(), - $namespace, - $namespaceUses - ); - - return $doc->getAnnotationsOfType($name); - } - - /** - * @return list - */ - protected function createTypeDeclarationTokens(string $type, bool $isNullable): array - { - $newTokens = []; - - if (true === $isNullable && 'mixed' !== $type) { - $newTokens[] = new Token([CT::T_NULLABLE_TYPE, '?']); - } - - $newTokens = array_merge( - $newTokens, - $this->createTokensFromRawType($type)->toArray() - ); - - // 'scalar's, 'void', 'iterable' and 'object' must be unqualified - foreach ($newTokens as $i => $token) { - if ($token->isGivenKind(T_STRING)) { - $typeUnqualified = $token->getContent(); - - if ( - (isset($this->scalarTypes[$typeUnqualified]) || isset($this->versionSpecificTypes[$typeUnqualified])) - && isset($newTokens[$i - 1]) - && '\\' === $newTokens[$i - 1]->getContent() - ) { - unset($newTokens[$i - 1]); - } - } - } - - return array_values($newTokens); - } - - /** - * Each fixer inheriting from this class must define a way of creating token collection representing type - * gathered from phpDoc, e.g. `Foo|Bar` should be transformed into 3 tokens (`Foo`, `|` and `Bar`). - * This can't be standardised, because some types may be allowed in one place, and invalid in others. - * - * @param string $type Type determined (and simplified) from phpDoc - */ - abstract protected function createTokensFromRawType(string $type): Tokens; - - /** - * @return ?_CommonTypeInfo - */ - protected function getCommonTypeInfo(TypeExpression $typesExpression, bool $isReturnType): ?array - { - $commonType = $typesExpression->getCommonType(); - $isNullable = $typesExpression->allowsNull(); - - if (null === $commonType) { - return null; - } - - if ($isNullable && 'void' === $commonType) { - return null; - } - - if ('static' === $commonType && (!$isReturnType || \PHP_VERSION_ID < 8_00_00)) { - $commonType = 'self'; - } - - if ($this->isSkippedType($commonType)) { - return null; - } - - if (isset($this->versionSpecificTypes[$commonType]) && \PHP_VERSION_ID < $this->versionSpecificTypes[$commonType]) { - return null; - } - - if (\array_key_exists($commonType, $this->configuration['types_map'])) { - $commonType = $this->configuration['types_map'][$commonType]; - } - - if (isset($this->scalarTypes[$commonType])) { - if (false === $this->configuration['scalar_types']) { - return null; - } - } elseif (!Preg::match('/^'.self::REGEX_CLASS.'$/', $commonType)) { - return null; - } - - return ['commonType' => $commonType, 'isNullable' => $isNullable]; - } - - protected function getUnionTypes(TypeExpression $typesExpression, bool $isReturnType): ?string - { - if (\PHP_VERSION_ID < 8_00_00) { - return null; - } - - if (!$typesExpression->isUnionType()) { - return null; - } - - if (false === $this->configuration['union_types']) { - return null; - } - - $types = $typesExpression->getTypes(); - $isNullable = $typesExpression->allowsNull(); - $unionTypes = []; - $containsOtherThanIterableType = false; - $containsOtherThanEmptyType = false; - - foreach ($types as $type) { - if ('null' === $type) { - continue; - } - - if ($this->isSkippedType($type)) { - return null; - } - - if (isset($this->versionSpecificTypes[$type]) && \PHP_VERSION_ID < $this->versionSpecificTypes[$type]) { - return null; - } - - $typeExpression = new TypeExpression($type, null, []); - $commonType = $typeExpression->getCommonType(); - - if (!$containsOtherThanIterableType && !\in_array($commonType, ['array', \Traversable::class, 'iterable'], true)) { - $containsOtherThanIterableType = true; - } - if ($isReturnType && !$containsOtherThanEmptyType && !\in_array($commonType, ['null', 'void', 'never'], true)) { - $containsOtherThanEmptyType = true; - } - - if (!$isNullable && $typesExpression->allowsNull()) { - $isNullable = true; - } - - $unionTypes[] = $commonType; - } - - if (!$containsOtherThanIterableType) { - return null; - } - if ($isReturnType && !$containsOtherThanEmptyType) { - return null; - } - - if ($isNullable) { - $unionTypes[] = 'null'; - } - - return implode($typesExpression->getTypesGlue(), array_unique($unionTypes)); - } - - final protected function isValidSyntax(string $code): bool - { - if (!isset(self::$syntaxValidationCache[$code])) { - try { - Tokens::fromCode($code); - self::$syntaxValidationCache[$code] = true; - } catch (\ParseError $e) { - self::$syntaxValidationCache[$code] = false; - } - } - - return self::$syntaxValidationCache[$code]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php deleted file mode 100644 index fe9ff4e6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php +++ /dev/null @@ -1,105 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\TypeExpression; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * This abstract fixer provides a base for fixers to fix types in PHPDoc. - * - * @author Graham Campbell - * - * @internal - */ -abstract class AbstractPhpdocTypesFixer extends AbstractFixer -{ - /** - * The annotation tags search inside. - * - * @var list - */ - protected array $tags; - - public function __construct() - { - parent::__construct(); - - $this->tags = Annotation::getTagsWithTypes(); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $doc = new DocBlock($token->getContent()); - $annotations = $doc->getAnnotationsOfType($this->tags); - - if (0 === \count($annotations)) { - continue; - } - - foreach ($annotations as $annotation) { - $this->fixType($annotation); - } - - $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - } - - /** - * Actually normalize the given type. - */ - abstract protected function normalize(string $type): string; - - /** - * Fix the type at the given line. - * - * We must be super careful not to modify parts of words. - * - * This will be nicely handled behind the scenes for us by the annotation class. - */ - private function fixType(Annotation $annotation): void - { - $typeExpression = $annotation->getTypeExpression(); - - if (null === $typeExpression) { - return; - } - - $newTypeExpression = $typeExpression->mapTypes(function (TypeExpression $type) { - if (!$type->isCompositeType()) { - $value = $this->normalize($type->toString()); - - return new TypeExpression($value, null, []); - } - - return $type; - }); - - $annotation->setTypes([$newTypeExpression->toString()]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php deleted file mode 100644 index 96eab156..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php +++ /dev/null @@ -1,106 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -abstract class AbstractProxyFixer extends AbstractFixer -{ - /** - * @var array - */ - protected array $proxyFixers = []; - - public function __construct() - { - foreach (Utils::sortFixers($this->createProxyFixers()) as $proxyFixer) { - $this->proxyFixers[$proxyFixer->getName()] = $proxyFixer; - } - - parent::__construct(); - } - - public function isCandidate(Tokens $tokens): bool - { - foreach ($this->proxyFixers as $fixer) { - if ($fixer->isCandidate($tokens)) { - return true; - } - } - - return false; - } - - public function isRisky(): bool - { - foreach ($this->proxyFixers as $fixer) { - if ($fixer->isRisky()) { - return true; - } - } - - return false; - } - - public function getPriority(): int - { - if (\count($this->proxyFixers) > 1) { - throw new \LogicException('You need to override this method to provide the priority of combined fixers.'); - } - - return reset($this->proxyFixers)->getPriority(); - } - - public function supports(\SplFileInfo $file): bool - { - foreach ($this->proxyFixers as $fixer) { - if ($fixer->supports($file)) { - return true; - } - } - - return false; - } - - public function setWhitespacesConfig(WhitespacesFixerConfig $config): void - { - parent::setWhitespacesConfig($config); - - foreach ($this->proxyFixers as $fixer) { - if ($fixer instanceof WhitespacesAwareFixerInterface) { - $fixer->setWhitespacesConfig($config); - } - } - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($this->proxyFixers as $fixer) { - $fixer->fix($file, $tokens); - } - } - - /** - * @return list - */ - abstract protected function createProxyFixers(): array; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php deleted file mode 100644 index 29976749..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php +++ /dev/null @@ -1,151 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Cache; - -use PhpCsFixer\Utils; - -/** - * @author Andreas Möller - * - * @internal - */ -final class Cache implements CacheInterface -{ - private SignatureInterface $signature; - - /** - * @var array - */ - private array $hashes = []; - - public function __construct(SignatureInterface $signature) - { - $this->signature = $signature; - } - - public function getSignature(): SignatureInterface - { - return $this->signature; - } - - public function has(string $file): bool - { - return \array_key_exists($file, $this->hashes); - } - - public function get(string $file): ?string - { - if (!$this->has($file)) { - return null; - } - - return $this->hashes[$file]; - } - - public function set(string $file, string $hash): void - { - $this->hashes[$file] = $hash; - } - - public function clear(string $file): void - { - unset($this->hashes[$file]); - } - - public function toJson(): string - { - $json = json_encode([ - 'php' => $this->getSignature()->getPhpVersion(), - 'version' => $this->getSignature()->getFixerVersion(), - 'indent' => $this->getSignature()->getIndent(), - 'lineEnding' => $this->getSignature()->getLineEnding(), - 'rules' => $this->getSignature()->getRules(), - 'hashes' => $this->hashes, - ]); - - if (JSON_ERROR_NONE !== json_last_error() || false === $json) { - throw new \UnexpectedValueException(\sprintf( - 'Cannot encode cache signature to JSON, error: "%s". If you have non-UTF8 chars in your signature, like in license for `header_comment`, consider enabling `ext-mbstring` or install `symfony/polyfill-mbstring`.', - json_last_error_msg() - )); - } - - return $json; - } - - /** - * @throws \InvalidArgumentException - */ - public static function fromJson(string $json): self - { - $data = json_decode($json, true); - - if (null === $data && JSON_ERROR_NONE !== json_last_error()) { - throw new \InvalidArgumentException(\sprintf( - 'Value needs to be a valid JSON string, got "%s", error: "%s".', - $json, - json_last_error_msg() - )); - } - - $requiredKeys = [ - 'php', - 'version', - 'indent', - 'lineEnding', - 'rules', - 'hashes', - ]; - - $missingKeys = array_diff_key(array_flip($requiredKeys), $data); - - if (\count($missingKeys) > 0) { - throw new \InvalidArgumentException(\sprintf( - 'JSON data is missing keys %s', - Utils::naturalLanguageJoin(array_keys($missingKeys)) - )); - } - - $signature = new Signature( - $data['php'], - $data['version'], - $data['indent'], - $data['lineEnding'], - $data['rules'] - ); - - $cache = new self($signature); - - // before v3.11.1 the hashes were crc32 encoded and saved as integers - // @TODO: remove the to string cast/array_map in v4.0 - $cache->hashes = array_map(static fn ($v): string => \is_int($v) ? (string) $v : $v, $data['hashes']); - - return $cache; - } - - /** - * @internal - */ - public function backfillHashes(self $oldCache): bool - { - if (!$this->getSignature()->equals($oldCache->getSignature())) { - return false; - } - - $this->hashes = array_merge($oldCache->hashes, $this->hashes); - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheInterface.php deleted file mode 100644 index 29ab7197..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Cache; - -/** - * @author Andreas Möller - * - * @internal - */ -interface CacheInterface -{ - public function getSignature(): SignatureInterface; - - public function has(string $file): bool; - - public function get(string $file): ?string; - - public function set(string $file, string $hash): void; - - public function clear(string $file): void; - - public function toJson(): string; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php deleted file mode 100644 index b9fb2ff6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Cache; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -interface CacheManagerInterface -{ - public function needFixing(string $file, string $fileContent): bool; - - public function setFile(string $file, string $fileContent): void; - - public function setFileHash(string $file, string $hash): void; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php deleted file mode 100644 index 396137d9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php +++ /dev/null @@ -1,51 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Cache; - -/** - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class Directory implements DirectoryInterface -{ - private string $directoryName; - - public function __construct(string $directoryName) - { - $this->directoryName = $directoryName; - } - - public function getRelativePathTo(string $file): string - { - $file = $this->normalizePath($file); - - if ( - '' === $this->directoryName - || 0 !== stripos($file, $this->directoryName.\DIRECTORY_SEPARATOR) - ) { - return $file; - } - - return substr($file, \strlen($this->directoryName) + 1); - } - - private function normalizePath(string $path): string - { - return str_replace(['\\', '/'], \DIRECTORY_SEPARATOR, $path); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/DirectoryInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/DirectoryInterface.php deleted file mode 100644 index 2fdce86a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/DirectoryInterface.php +++ /dev/null @@ -1,23 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Cache; - -/** - * @author Dariusz Rumiński - */ -interface DirectoryInterface -{ - public function getRelativePathTo(string $file): string; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php deleted file mode 100644 index 57b9f3b6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php +++ /dev/null @@ -1,143 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Cache; - -use PhpCsFixer\Tokenizer\CodeHasher; - -/** - * Class supports caching information about state of fixing files. - * - * Cache is supported only for phar version and version installed via composer. - * - * File will be processed by PHP CS Fixer only if any of the following conditions is fulfilled: - * - cache is corrupt - * - fixer version changed - * - rules changed - * - file is new - * - file changed - * - * @author Dariusz Rumiński - * - * @internal - */ -final class FileCacheManager implements CacheManagerInterface -{ - public const WRITE_FREQUENCY = 10; - - private FileHandlerInterface $handler; - - private SignatureInterface $signature; - - private bool $isDryRun; - - private DirectoryInterface $cacheDirectory; - - private int $writeCounter = 0; - - private bool $signatureWasUpdated = false; - - private CacheInterface $cache; - - public function __construct( - FileHandlerInterface $handler, - SignatureInterface $signature, - bool $isDryRun = false, - ?DirectoryInterface $cacheDirectory = null - ) { - $this->handler = $handler; - $this->signature = $signature; - $this->isDryRun = $isDryRun; - $this->cacheDirectory = $cacheDirectory ?? new Directory(''); - - $this->readCache(); - } - - public function __destruct() - { - if (true === $this->signatureWasUpdated || 0 !== $this->writeCounter) { - $this->writeCache(); - } - } - - /** - * This class is not intended to be serialized, - * and cannot be deserialized (see __wakeup method). - */ - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - /** - * Disable the deserialization of the class to prevent attacker executing - * code by leveraging the __destruct method. - * - * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection - */ - public function __wakeup(): void - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function needFixing(string $file, string $fileContent): bool - { - $file = $this->cacheDirectory->getRelativePathTo($file); - - return !$this->cache->has($file) || $this->cache->get($file) !== $this->calcHash($fileContent); - } - - public function setFile(string $file, string $fileContent): void - { - $this->setFileHash($file, $this->calcHash($fileContent)); - } - - public function setFileHash(string $file, string $hash): void - { - $file = $this->cacheDirectory->getRelativePathTo($file); - - if ($this->isDryRun && $this->cache->has($file) && $this->cache->get($file) !== $hash) { - $this->cache->clear($file); - } else { - $this->cache->set($file, $hash); - } - - if (self::WRITE_FREQUENCY === ++$this->writeCounter) { - $this->writeCounter = 0; - $this->writeCache(); - } - } - - private function readCache(): void - { - $cache = $this->handler->read(); - - if (null === $cache || !$this->signature->equals($cache->getSignature())) { - $cache = new Cache($this->signature); - $this->signatureWasUpdated = true; - } - - $this->cache = $cache; - } - - private function writeCache(): void - { - $this->handler->write($this->cache); - } - - private function calcHash(string $content): string - { - return CodeHasher::calculateCodeHash($content); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php deleted file mode 100644 index a1b83ed7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php +++ /dev/null @@ -1,184 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Cache; - -use Symfony\Component\Filesystem\Exception\IOException; - -/** - * @author Andreas Möller - * @author Dariusz Rumiński - * - * @internal - */ -final class FileHandler implements FileHandlerInterface -{ - private \SplFileInfo $fileInfo; - - private int $fileMTime = 0; - - public function __construct(string $file) - { - $this->fileInfo = new \SplFileInfo($file); - } - - public function getFile(): string - { - return $this->fileInfo->getPathname(); - } - - public function read(): ?CacheInterface - { - if (!$this->fileInfo->isFile() || !$this->fileInfo->isReadable()) { - return null; - } - - $fileObject = $this->fileInfo->openFile('r'); - - $cache = $this->readFromHandle($fileObject); - $this->fileMTime = $this->getFileCurrentMTime(); - - unset($fileObject); // explicitly close file handler - - return $cache; - } - - public function write(CacheInterface $cache): void - { - $this->ensureFileIsWriteable(); - - $fileObject = $this->fileInfo->openFile('r+'); - - if (method_exists($cache, 'backfillHashes') && $this->fileMTime < $this->getFileCurrentMTime()) { - $resultOfFlock = $fileObject->flock(LOCK_EX); - if (false === $resultOfFlock) { - // Lock failed, OK - we continue without the lock. - // noop - } - - $oldCache = $this->readFromHandle($fileObject); - - $fileObject->rewind(); - - if (null !== $oldCache) { - $cache->backfillHashes($oldCache); - } - } - - $resultOfTruncate = $fileObject->ftruncate(0); - if (false === $resultOfTruncate) { - // Truncate failed. OK - we do not save the cache. - return; - } - - $resultOfWrite = $fileObject->fwrite($cache->toJson()); - if (false === $resultOfWrite) { - // Write failed. OK - we did not save the cache. - return; - } - - $resultOfFlush = $fileObject->fflush(); - if (false === $resultOfFlush) { - // Flush failed. OK - part of cache can be missing, in case this was last chunk in this pid. - // noop - } - - $this->fileMTime = time(); // we could take the fresh `mtime` of file that we just modified with `$this->getFileCurrentMTime()`, but `time()` should be good enough here and reduce IO operation - } - - private function getFileCurrentMTime(): int - { - clearstatcache(true, $this->fileInfo->getPathname()); - - $mtime = $this->fileInfo->getMTime(); - - if (false === $mtime) { - // cannot check mtime? OK - let's pretend file is old. - $mtime = 0; - } - - return $mtime; - } - - private function readFromHandle(\SplFileObject $fileObject): ?CacheInterface - { - try { - $size = $fileObject->getSize(); - if (false === $size || 0 === $size) { - return null; - } - - $content = $fileObject->fread($size); - - if (false === $content) { - return null; - } - - return Cache::fromJson($content); - } catch (\InvalidArgumentException $exception) { - return null; - } - } - - private function ensureFileIsWriteable(): void - { - if ($this->fileInfo->isFile() && $this->fileInfo->isWritable()) { - // all good - return; - } - - if ($this->fileInfo->isDir()) { - throw new IOException( - \sprintf('Cannot write cache file "%s" as the location exists as directory.', $this->fileInfo->getRealPath()), - 0, - null, - $this->fileInfo->getPathname() - ); - } - - if ($this->fileInfo->isFile() && !$this->fileInfo->isWritable()) { - throw new IOException( - \sprintf('Cannot write to file "%s" as it is not writable.', $this->fileInfo->getRealPath()), - 0, - null, - $this->fileInfo->getPathname() - ); - } - - $this->createFile($this->fileInfo->getPathname()); - } - - private function createFile(string $file): void - { - $dir = \dirname($file); - - // Ensure path is created, but ignore if already exists. FYI: ignore EA suggestion in IDE, - // `mkdir()` returns `false` for existing paths, so we can't mix it with `is_dir()` in one condition. - if (!@is_dir($dir)) { - @mkdir($dir, 0777, true); - } - - if (!@is_dir($dir)) { - throw new IOException( - \sprintf('Directory of cache file "%s" does not exists and couldn\'t be created.', $file), - 0, - null, - $file - ); - } - - @touch($file); - @chmod($file, 0666); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandlerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandlerInterface.php deleted file mode 100644 index 464b04cf..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandlerInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Cache; - -/** - * @author Andreas Möller - * - * @internal - */ -interface FileHandlerInterface -{ - public function getFile(): string; - - public function read(): ?CacheInterface; - - public function write(CacheInterface $cache): void; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php deleted file mode 100644 index 3a5fe991..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php +++ /dev/null @@ -1,33 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Cache; - -/** - * @author Andreas Möller - * @author Dariusz Rumiński - * - * @internal - */ -final class NullCacheManager implements CacheManagerInterface -{ - public function needFixing(string $file, string $fileContent): bool - { - return true; - } - - public function setFile(string $file, string $fileContent): void {} - - public function setFileHash(string $file, string $hash): void {} -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php deleted file mode 100644 index 17be5de0..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php +++ /dev/null @@ -1,100 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Cache; - -/** - * @author Andreas Möller - * - * @readonly - * - * @internal - */ -final class Signature implements SignatureInterface -{ - private string $phpVersion; - - private string $fixerVersion; - - private string $indent; - - private string $lineEnding; - - /** - * @var array|bool> - */ - private array $rules; - - /** - * @param array|bool> $rules - */ - public function __construct(string $phpVersion, string $fixerVersion, string $indent, string $lineEnding, array $rules) - { - $this->phpVersion = $phpVersion; - $this->fixerVersion = $fixerVersion; - $this->indent = $indent; - $this->lineEnding = $lineEnding; - $this->rules = self::makeJsonEncodable($rules); - } - - public function getPhpVersion(): string - { - return $this->phpVersion; - } - - public function getFixerVersion(): string - { - return $this->fixerVersion; - } - - public function getIndent(): string - { - return $this->indent; - } - - public function getLineEnding(): string - { - return $this->lineEnding; - } - - public function getRules(): array - { - return $this->rules; - } - - public function equals(SignatureInterface $signature): bool - { - return $this->phpVersion === $signature->getPhpVersion() - && $this->fixerVersion === $signature->getFixerVersion() - && $this->indent === $signature->getIndent() - && $this->lineEnding === $signature->getLineEnding() - && $this->rules === $signature->getRules(); - } - - /** - * @param array|bool> $data - * - * @return array|bool> - */ - private static function makeJsonEncodable(array $data): array - { - array_walk_recursive($data, static function (&$item): void { - if (\is_string($item) && !mb_detect_encoding($item, 'utf-8', true)) { - $item = base64_encode($item); - } - }); - - return $data; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/SignatureInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/SignatureInterface.php deleted file mode 100644 index cc952141..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Cache/SignatureInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Cache; - -/** - * @author Andreas Möller - * - * @internal - */ -interface SignatureInterface -{ - public function getPhpVersion(): string; - - public function getFixerVersion(): string; - - public function getIndent(): string; - - public function getLineEnding(): string; - - /** - * @return array|bool> - */ - public function getRules(): array; - - public function equals(self $signature): bool; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Config.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Config.php deleted file mode 100644 index ac59e143..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Config.php +++ /dev/null @@ -1,265 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\Runner\Parallel\ParallelConfig; -use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; - -/** - * @author Fabien Potencier - * @author Katsuhiro Ogawa - * @author Dariusz Rumiński - */ -class Config implements ConfigInterface, ParallelAwareConfigInterface -{ - /** - * @var non-empty-string - */ - private string $cacheFile = '.php-cs-fixer.cache'; - - /** - * @var list - */ - private array $customFixers = []; - - /** - * @var null|iterable<\SplFileInfo> - */ - private ?iterable $finder = null; - - private string $format = 'txt'; - - private bool $hideProgress = false; - - /** - * @var non-empty-string - */ - private string $indent = ' '; - - private bool $isRiskyAllowed = false; - - /** - * @var non-empty-string - */ - private string $lineEnding = "\n"; - - private string $name; - - private ParallelConfig $parallelConfig; - - private ?string $phpExecutable = null; - - /** - * @TODO: 4.0 - update to @PER - * - * @var array|bool> - */ - private array $rules; - - private bool $usingCache = true; - - public function __construct(string $name = 'default') - { - // @TODO 4.0 cleanup - if (Utils::isFutureModeEnabled()) { - $this->name = $name.' (future mode)'; - $this->rules = ['@PER-CS' => true]; - } else { - $this->name = $name; - $this->rules = ['@PSR12' => true]; - } - - // @TODO 4.0 cleanup - if (Utils::isFutureModeEnabled() || filter_var(getenv('PHP_CS_FIXER_PARALLEL'), FILTER_VALIDATE_BOOL)) { - $this->parallelConfig = ParallelConfigFactory::detect(); - } else { - $this->parallelConfig = ParallelConfigFactory::sequential(); - } - } - - /** - * @return non-empty-string - */ - public function getCacheFile(): string - { - return $this->cacheFile; - } - - public function getCustomFixers(): array - { - return $this->customFixers; - } - - /** - * @return Finder - */ - public function getFinder(): iterable - { - $this->finder ??= new Finder(); - - return $this->finder; - } - - public function getFormat(): string - { - return $this->format; - } - - public function getHideProgress(): bool - { - return $this->hideProgress; - } - - public function getIndent(): string - { - return $this->indent; - } - - public function getLineEnding(): string - { - return $this->lineEnding; - } - - public function getName(): string - { - return $this->name; - } - - public function getParallelConfig(): ParallelConfig - { - return $this->parallelConfig; - } - - public function getPhpExecutable(): ?string - { - return $this->phpExecutable; - } - - public function getRiskyAllowed(): bool - { - return $this->isRiskyAllowed; - } - - public function getRules(): array - { - return $this->rules; - } - - public function getUsingCache(): bool - { - return $this->usingCache; - } - - public function registerCustomFixers(iterable $fixers): ConfigInterface - { - foreach ($fixers as $fixer) { - $this->addCustomFixer($fixer); - } - - return $this; - } - - /** - * @param non-empty-string $cacheFile - */ - public function setCacheFile(string $cacheFile): ConfigInterface - { - $this->cacheFile = $cacheFile; - - return $this; - } - - public function setFinder(iterable $finder): ConfigInterface - { - $this->finder = $finder; - - return $this; - } - - public function setFormat(string $format): ConfigInterface - { - $this->format = $format; - - return $this; - } - - public function setHideProgress(bool $hideProgress): ConfigInterface - { - $this->hideProgress = $hideProgress; - - return $this; - } - - /** - * @param non-empty-string $indent - */ - public function setIndent(string $indent): ConfigInterface - { - $this->indent = $indent; - - return $this; - } - - /** - * @param non-empty-string $lineEnding - */ - public function setLineEnding(string $lineEnding): ConfigInterface - { - $this->lineEnding = $lineEnding; - - return $this; - } - - public function setParallelConfig(ParallelConfig $config): ConfigInterface - { - $this->parallelConfig = $config; - - return $this; - } - - public function setPhpExecutable(?string $phpExecutable): ConfigInterface - { - $this->phpExecutable = $phpExecutable; - - return $this; - } - - public function setRiskyAllowed(bool $isRiskyAllowed): ConfigInterface - { - $this->isRiskyAllowed = $isRiskyAllowed; - - return $this; - } - - public function setRules(array $rules): ConfigInterface - { - $this->rules = $rules; - - return $this; - } - - public function setUsingCache(bool $usingCache): ConfigInterface - { - $this->usingCache = $usingCache; - - return $this; - } - - private function addCustomFixer(FixerInterface $fixer): void - { - $this->customFixers[] = $fixer; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php deleted file mode 100644 index c097a582..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php +++ /dev/null @@ -1,162 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\Fixer\FixerInterface; - -/** - * @author Fabien Potencier - * @author Dariusz Rumiński - */ -interface ConfigInterface -{ - /** - * Returns the path to the cache file. - * - * @return null|non-empty-string Returns null if not using cache - */ - public function getCacheFile(): ?string; - - /** - * Returns the custom fixers to use. - * - * @return list - */ - public function getCustomFixers(): array; - - /** - * Returns files to scan. - * - * @return iterable<\SplFileInfo> - */ - public function getFinder(): iterable; - - public function getFormat(): string; - - /** - * Returns true if progress should be hidden. - */ - public function getHideProgress(): bool; - - /** - * @return non-empty-string - */ - public function getIndent(): string; - - /** - * @return non-empty-string - */ - public function getLineEnding(): string; - - /** - * Returns the name of the configuration. - * - * The name must be all lowercase and without any spaces. - * - * @return string The name of the configuration - */ - public function getName(): string; - - /** - * Get configured PHP executable, if any. - * - * @deprecated - * - * @TODO 4.0 remove me - */ - public function getPhpExecutable(): ?string; - - /** - * Check if it is allowed to run risky fixers. - */ - public function getRiskyAllowed(): bool; - - /** - * Get rules. - * - * Keys of array are names of fixers/sets, values are true/false. - * - * @return array|bool> - */ - public function getRules(): array; - - /** - * Returns true if caching should be enabled. - */ - public function getUsingCache(): bool; - - /** - * Adds a suite of custom fixers. - * - * Name of custom fixer should follow `VendorName/rule_name` convention. - * - * @param iterable $fixers - */ - public function registerCustomFixers(iterable $fixers): self; - - /** - * Sets the path to the cache file. - * - * @param non-empty-string $cacheFile - */ - public function setCacheFile(string $cacheFile): self; - - /** - * @param iterable<\SplFileInfo> $finder - */ - public function setFinder(iterable $finder): self; - - public function setFormat(string $format): self; - - public function setHideProgress(bool $hideProgress): self; - - /** - * @param non-empty-string $indent - */ - public function setIndent(string $indent): self; - - /** - * @param non-empty-string $lineEnding - */ - public function setLineEnding(string $lineEnding): self; - - /** - * Set PHP executable. - * - * @deprecated - * - * @TODO 4.0 remove me - */ - public function setPhpExecutable(?string $phpExecutable): self; - - /** - * Set if it is allowed to run risky fixers. - */ - public function setRiskyAllowed(bool $isRiskyAllowed): self; - - /** - * Set rules. - * - * Keys of array are names of fixers or sets. - * Value for set must be bool (turn it on or off). - * Value for fixer may be bool (turn it on or off) or array of configuration - * (turn it on and contains configuration for FixerInterface::configure method). - * - * @param array|bool> $rules - */ - public function setRules(array $rules): self; - - public function setUsingCache(bool $usingCache): self; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidConfigurationException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidConfigurationException.php deleted file mode 100644 index 87babf8f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidConfigurationException.php +++ /dev/null @@ -1,36 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\ConfigurationException; - -use PhpCsFixer\Console\Command\FixCommandExitStatusCalculator; - -/** - * Exceptions of this type are thrown on misconfiguration of the Fixer. - * - * @internal - * - * @final Only internal extending this class is supported - */ -class InvalidConfigurationException extends \InvalidArgumentException -{ - public function __construct(string $message, ?int $code = null, ?\Throwable $previous = null) - { - parent::__construct( - $message, - $code ?? FixCommandExitStatusCalculator::EXIT_STATUS_FLAG_HAS_INVALID_CONFIG, - $previous - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php deleted file mode 100644 index 8607bbfa..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php +++ /dev/null @@ -1,45 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\ConfigurationException; - -use PhpCsFixer\Console\Command\FixCommandExitStatusCalculator; - -/** - * Exception thrown by Fixers on misconfiguration. - * - * @internal - * - * @final Only internal extending this class is supported - */ -class InvalidFixerConfigurationException extends InvalidConfigurationException -{ - private string $fixerName; - - public function __construct(string $fixerName, string $message, ?\Throwable $previous = null) - { - parent::__construct( - \sprintf('[%s] %s', $fixerName, $message), - FixCommandExitStatusCalculator::EXIT_STATUS_FLAG_HAS_INVALID_FIXER_CONFIG, - $previous - ); - - $this->fixerName = $fixerName; - } - - public function getFixerName(): string - { - return $this->fixerName; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidForEnvFixerConfigurationException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidForEnvFixerConfigurationException.php deleted file mode 100644 index 440b2470..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidForEnvFixerConfigurationException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\ConfigurationException; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class InvalidForEnvFixerConfigurationException extends InvalidFixerConfigurationException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/RequiredFixerConfigurationException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/RequiredFixerConfigurationException.php deleted file mode 100644 index bcc07bdf..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/RequiredFixerConfigurationException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\ConfigurationException; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class RequiredFixerConfigurationException extends InvalidFixerConfigurationException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php deleted file mode 100644 index 635d7986..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php +++ /dev/null @@ -1,212 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console; - -use PhpCsFixer\Console\Command\CheckCommand; -use PhpCsFixer\Console\Command\DescribeCommand; -use PhpCsFixer\Console\Command\FixCommand; -use PhpCsFixer\Console\Command\HelpCommand; -use PhpCsFixer\Console\Command\ListFilesCommand; -use PhpCsFixer\Console\Command\ListSetsCommand; -use PhpCsFixer\Console\Command\SelfUpdateCommand; -use PhpCsFixer\Console\Command\WorkerCommand; -use PhpCsFixer\Console\SelfUpdate\GithubClient; -use PhpCsFixer\Console\SelfUpdate\NewVersionChecker; -use PhpCsFixer\PharChecker; -use PhpCsFixer\Runner\Parallel\WorkerException; -use PhpCsFixer\ToolInfo; -use PhpCsFixer\Utils; -use Symfony\Component\Console\Application as BaseApplication; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\ListCommand; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Fabien Potencier - * @author Dariusz Rumiński - * - * @internal - */ -final class Application extends BaseApplication -{ - public const NAME = 'PHP CS Fixer'; - public const VERSION = '3.68.1'; - public const VERSION_CODENAME = 'Persian Successor'; - - /** - * @readonly - */ - private ToolInfo $toolInfo; - private ?Command $executedCommand = null; - - public function __construct() - { - parent::__construct(self::NAME, self::VERSION); - - $this->toolInfo = new ToolInfo(); - - // in alphabetical order - $this->add(new DescribeCommand()); - $this->add(new CheckCommand($this->toolInfo)); - $this->add(new FixCommand($this->toolInfo)); - $this->add(new ListFilesCommand($this->toolInfo)); - $this->add(new ListSetsCommand()); - $this->add(new SelfUpdateCommand( - new NewVersionChecker(new GithubClient()), - $this->toolInfo, - new PharChecker() - )); - $this->add(new WorkerCommand($this->toolInfo)); - } - - public static function getMajorVersion(): int - { - return (int) explode('.', self::VERSION)[0]; - } - - public function doRun(InputInterface $input, OutputInterface $output): int - { - $stdErr = $output instanceof ConsoleOutputInterface - ? $output->getErrorOutput() - : ($input->hasParameterOption('--format', true) && 'txt' !== $input->getParameterOption('--format', null, true) ? null : $output); - - if (null !== $stdErr) { - $warningsDetector = new WarningsDetector($this->toolInfo); - $warningsDetector->detectOldVendor(); - $warningsDetector->detectOldMajor(); - $warnings = $warningsDetector->getWarnings(); - - if (\count($warnings) > 0) { - foreach ($warnings as $warning) { - $stdErr->writeln(\sprintf($stdErr->isDecorated() ? '%s' : '%s', $warning)); - } - $stdErr->writeln(''); - } - } - - $result = parent::doRun($input, $output); - - if ( - null !== $stdErr - && $output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE - ) { - $triggeredDeprecations = Utils::getTriggeredDeprecations(); - - if (\count($triggeredDeprecations) > 0) { - $stdErr->writeln(''); - $stdErr->writeln($stdErr->isDecorated() ? 'Detected deprecations in use:' : 'Detected deprecations in use:'); - foreach ($triggeredDeprecations as $deprecation) { - $stdErr->writeln(\sprintf('- %s', $deprecation)); - } - } - } - - return $result; - } - - /** - * @internal - */ - public static function getAbout(bool $decorated = false): string - { - $longVersion = \sprintf('%s %s', self::NAME, self::VERSION); - - $commit = '@git-commit@'; - $versionCommit = ''; - - if ('@'.'git-commit@' !== $commit) { /** @phpstan-ignore-line as `$commit` is replaced during phar building */ - $versionCommit = substr($commit, 0, 7); - } - - $about = implode('', [ - $longVersion, - $versionCommit ? \sprintf(' (%s)', $versionCommit) : '', // @phpstan-ignore-line to avoid `Ternary operator condition is always true|false.` - self::VERSION_CODENAME ? \sprintf(' %s', self::VERSION_CODENAME) : '', // @phpstan-ignore-line to avoid `Ternary operator condition is always true|false.` - ' by Fabien Potencier, Dariusz Ruminski and contributors.', - ]); - - if (false === $decorated) { - return strip_tags($about); - } - - return $about; - } - - /** - * @internal - */ - public static function getAboutWithRuntime(bool $decorated = false): string - { - $about = self::getAbout(true)."\nPHP runtime: ".PHP_VERSION.''; - if (false === $decorated) { - return strip_tags($about); - } - - return $about; - } - - public function getLongVersion(): string - { - return self::getAboutWithRuntime(true); - } - - protected function getDefaultCommands(): array - { - return [new HelpCommand(), new ListCommand()]; - } - - /** - * @throws \Throwable - */ - protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output): int - { - $this->executedCommand = $command; - - return parent::doRunCommand($command, $input, $output); - } - - protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void - { - // Since parallel analysis utilises child processes, and they have their own output, - // we need to capture the output of the child process to determine it there was an exception. - // Default render format is not machine-friendly, so we need to override it for `worker` command, - // in order to be able to easily parse exception data for further displaying on main process' side. - if ($this->executedCommand instanceof WorkerCommand) { - $output->writeln(WorkerCommand::ERROR_PREFIX.json_encode( - [ - 'class' => \get_class($e), - 'message' => $e->getMessage(), - 'file' => $e->getFile(), - 'line' => $e->getLine(), - 'code' => $e->getCode(), - 'trace' => $e->getTraceAsString(), - ] - )); - - return; - } - - parent::doRenderThrowable($e, $output); - - if ($output->isVeryVerbose() && $e instanceof WorkerException) { - $output->writeln('Original trace from worker:'); - $output->writeln(''); - $output->writeln($e->getOriginalTraceAsString()); - $output->writeln(''); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php deleted file mode 100644 index cb261916..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php +++ /dev/null @@ -1,64 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Command; - -use PhpCsFixer\ToolInfoInterface; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; - -/** - * @author Greg Korba - * - * @internal - */ -#[AsCommand(name: 'check', description: 'Checks if configured files/directories comply with configured rules.')] -final class CheckCommand extends FixCommand -{ - protected static $defaultName = 'check'; - - protected static $defaultDescription = 'Checks if configured files/directories comply with configured rules.'; - - public function __construct(ToolInfoInterface $toolInfo) - { - parent::__construct($toolInfo); - } - - public function getHelp(): string - { - $help = explode('--dry-run', parent::getHelp()); - - return substr($help[0], 0, strrpos($help[0], "\n") - 1) - .substr($help[1], strpos($help[1], "\n")); - } - - protected function configure(): void - { - parent::configure(); - - $this->setDefinition([ - ...array_values($this->getDefinition()->getArguments()), - ...array_values(array_filter( - $this->getDefinition()->getOptions(), - static fn (InputOption $option): bool => 'dry-run' !== $option->getName() - )), - ]); - } - - protected function isDryRun(InputInterface $input): bool - { - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php deleted file mode 100644 index f3ae6569..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php +++ /dev/null @@ -1,476 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Command; - -use PhpCsFixer\Config; -use PhpCsFixer\Console\Application; -use PhpCsFixer\Console\ConfigurationResolver; -use PhpCsFixer\Differ\DiffConsoleFormatter; -use PhpCsFixer\Differ\FullDiffer; -use PhpCsFixer\Documentation\FixerDocumentGenerator; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\Fixer\ExperimentalFixerInterface; -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\Fixer\InternalFixerInterface; -use PhpCsFixer\FixerConfiguration\AliasedFixerOption; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\DeprecatedFixerOption; -use PhpCsFixer\FixerDefinition\CodeSampleInterface; -use PhpCsFixer\FixerDefinition\FileSpecificCodeSampleInterface; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSampleInterface; -use PhpCsFixer\FixerFactory; -use PhpCsFixer\Preg; -use PhpCsFixer\RuleSet\RuleSets; -use PhpCsFixer\StdinFileInfo; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\ToolInfo; -use PhpCsFixer\Utils; -use PhpCsFixer\WordMatcher; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -#[AsCommand(name: 'describe')] -final class DescribeCommand extends Command -{ - protected static $defaultName = 'describe'; - - /** - * @var ?list - */ - private ?array $setNames = null; - - private FixerFactory $fixerFactory; - - /** - * @var null|array - */ - private ?array $fixers = null; - - public function __construct(?FixerFactory $fixerFactory = null) - { - parent::__construct(); - - if (null === $fixerFactory) { - $fixerFactory = new FixerFactory(); - $fixerFactory->registerBuiltInFixers(); - } - - $this->fixerFactory = $fixerFactory; - } - - protected function configure(): void - { - $this - ->setDefinition( - [ - new InputArgument('name', InputArgument::REQUIRED, 'Name of rule / set.'), - new InputOption('config', '', InputOption::VALUE_REQUIRED, 'The path to a .php-cs-fixer.php file.'), - ] - ) - ->setDescription('Describe rule / ruleset.') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - if ($output instanceof ConsoleOutputInterface) { - $stdErr = $output->getErrorOutput(); - $stdErr->writeln(Application::getAboutWithRuntime(true)); - } - - $resolver = new ConfigurationResolver( - new Config(), - ['config' => $input->getOption('config')], - getcwd(), - new ToolInfo() - ); - - $this->fixerFactory->registerCustomFixers($resolver->getConfig()->getCustomFixers()); - - $name = $input->getArgument('name'); - - try { - if (str_starts_with($name, '@')) { - $this->describeSet($output, $name); - - return 0; - } - - $this->describeRule($output, $name); - } catch (DescribeNameNotFoundException $e) { - $matcher = new WordMatcher( - 'set' === $e->getType() ? $this->getSetNames() : array_keys($this->getFixers()) - ); - - $alternative = $matcher->match($name); - - $this->describeList($output, $e->getType()); - - throw new \InvalidArgumentException(\sprintf( - '%s "%s" not found.%s', - ucfirst($e->getType()), - $name, - null === $alternative ? '' : ' Did you mean "'.$alternative.'"?' - )); - } - - return 0; - } - - private function describeRule(OutputInterface $output, string $name): void - { - $fixers = $this->getFixers(); - - if (!isset($fixers[$name])) { - throw new DescribeNameNotFoundException($name, 'rule'); - } - - /** @var FixerInterface $fixer */ - $fixer = $fixers[$name]; - - $definition = $fixer->getDefinition(); - - $output->writeln(\sprintf('Description of the `%s` rule.', $name)); - $output->writeln(''); - - if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { - $output->writeln(\sprintf('Fixer class: %s.', \get_class($fixer))); - $output->writeln(''); - } - - if ($fixer instanceof DeprecatedFixerInterface) { - $successors = $fixer->getSuccessorsNames(); - $message = [] === $successors - ? \sprintf('it will be removed in version %d.0', Application::getMajorVersion() + 1) - : \sprintf('use %s instead', Utils::naturalLanguageJoinWithBackticks($successors)); - - $endMessage = '. '.ucfirst($message); - Utils::triggerDeprecation(new \RuntimeException(str_replace('`', '"', "Rule \"{$name}\" is deprecated{$endMessage}."))); - $message = Preg::replace('/(`[^`]+`)/', '$1', $message); - $output->writeln(\sprintf('DEPRECATED: %s.', $message)); - $output->writeln(''); - } - - $output->writeln($definition->getSummary()); - - $description = $definition->getDescription(); - - if (null !== $description) { - $output->writeln($description); - } - - $output->writeln(''); - - if ($fixer instanceof ExperimentalFixerInterface) { - $output->writeln('Fixer applying this rule is EXPERIMENTAL..'); - $output->writeln('It is not covered with backward compatibility promise and may produce unstable or unexpected results.'); - - $output->writeln(''); - } - - if ($fixer instanceof InternalFixerInterface) { - $output->writeln('Fixer applying this rule is INTERNAL..'); - $output->writeln('It is expected to be used only on PHP CS Fixer project itself.'); - - $output->writeln(''); - } - - if ($fixer->isRisky()) { - $output->writeln('Fixer applying this rule is RISKY.'); - - $riskyDescription = $definition->getRiskyDescription(); - - if (null !== $riskyDescription) { - $output->writeln($riskyDescription); - } - - $output->writeln(''); - } - - if ($fixer instanceof ConfigurableFixerInterface) { - $configurationDefinition = $fixer->getConfigurationDefinition(); - $options = $configurationDefinition->getOptions(); - - $output->writeln(\sprintf('Fixer is configurable using following option%s:', 1 === \count($options) ? '' : 's')); - - foreach ($options as $option) { - $line = '* '.OutputFormatter::escape($option->getName()).''; - $allowed = HelpCommand::getDisplayableAllowedValues($option); - - if (null === $allowed) { - $allowed = array_map( - static fn (string $type): string => ''.$type.'', - $option->getAllowedTypes(), - ); - } else { - $allowed = array_map(static fn ($value): string => $value instanceof AllowedValueSubset - ? 'a subset of '.Utils::toString($value->getAllowedValues()).'' - : ''.Utils::toString($value).'', $allowed); - } - - $line .= ' ('.Utils::naturalLanguageJoin($allowed, '').')'; - - $description = Preg::replace('/(`.+?`)/', '$1', OutputFormatter::escape($option->getDescription())); - $line .= ': '.lcfirst(Preg::replace('/\.$/', '', $description)).'; '; - - if ($option->hasDefault()) { - $line .= \sprintf( - 'defaults to %s', - Utils::toString($option->getDefault()) - ); - } else { - $line .= 'required'; - } - - if ($option instanceof DeprecatedFixerOption) { - $line .= '. DEPRECATED: '.Preg::replace( - '/(`.+?`)/', - '$1', - OutputFormatter::escape(lcfirst($option->getDeprecationMessage())) - ); - } - - if ($option instanceof AliasedFixerOption) { - $line .= '; DEPRECATED alias: '.$option->getAlias().''; - } - - $output->writeln($line); - } - - $output->writeln(''); - } - - /** @var list $codeSamples */ - $codeSamples = array_filter($definition->getCodeSamples(), static function (CodeSampleInterface $codeSample): bool { - if ($codeSample instanceof VersionSpecificCodeSampleInterface) { - return $codeSample->isSuitableFor(\PHP_VERSION_ID); - } - - return true; - }); - - if (0 === \count($definition->getCodeSamples())) { - $output->writeln([ - 'Fixing examples are not available for this rule.', - '', - ]); - } elseif (0 === \count($codeSamples)) { - $output->writeln([ - 'Fixing examples cannot be demonstrated on the current PHP version.', - '', - ]); - } else { - $output->writeln('Fixing examples:'); - - $differ = new FullDiffer(); - $diffFormatter = new DiffConsoleFormatter( - $output->isDecorated(), - \sprintf( - ' ---------- begin diff ----------%s%%s%s ----------- end diff -----------', - PHP_EOL, - PHP_EOL - ) - ); - - foreach ($codeSamples as $index => $codeSample) { - $old = $codeSample->getCode(); - $tokens = Tokens::fromCode($old); - - $configuration = $codeSample->getConfiguration(); - - if ($fixer instanceof ConfigurableFixerInterface) { - $fixer->configure($configuration ?? []); - } - - $file = $codeSample instanceof FileSpecificCodeSampleInterface - ? $codeSample->getSplFileInfo() - : new StdinFileInfo(); - - $fixer->fix($file, $tokens); - - $diff = $differ->diff($old, $tokens->generateCode()); - - if ($fixer instanceof ConfigurableFixerInterface) { - if (null === $configuration) { - $output->writeln(\sprintf(' * Example #%d. Fixing with the default configuration.', $index + 1)); - } else { - $output->writeln(\sprintf(' * Example #%d. Fixing with configuration: %s.', $index + 1, Utils::toString($codeSample->getConfiguration()))); - } - } else { - $output->writeln(\sprintf(' * Example #%d.', $index + 1)); - } - - $output->writeln([$diffFormatter->format($diff, ' %s'), '']); - } - } - - $ruleSetConfigs = FixerDocumentGenerator::getSetsOfRule($name); - - if ([] !== $ruleSetConfigs) { - ksort($ruleSetConfigs); - $plural = 1 !== \count($ruleSetConfigs) ? 's' : ''; - $output->writeln("Fixer is part of the following rule set{$plural}:"); - - foreach ($ruleSetConfigs as $set => $config) { - if (null !== $config) { - $output->writeln(\sprintf('* %s with config: %s', $set, Utils::toString($config))); - } else { - $output->writeln(\sprintf('* %s with default config', $set)); - } - } - - $output->writeln(''); - } - } - - private function describeSet(OutputInterface $output, string $name): void - { - if (!\in_array($name, $this->getSetNames(), true)) { - throw new DescribeNameNotFoundException($name, 'set'); - } - - $ruleSetDefinitions = RuleSets::getSetDefinitions(); - $fixers = $this->getFixers(); - - $output->writeln(\sprintf('Description of the `%s` set.', $ruleSetDefinitions[$name]->getName())); - $output->writeln(''); - - $output->writeln($this->replaceRstLinks($ruleSetDefinitions[$name]->getDescription())); - $output->writeln(''); - - if ($ruleSetDefinitions[$name]->isRisky()) { - $output->writeln('This set contains risky rules.'); - $output->writeln(''); - } - - $help = ''; - - foreach ($ruleSetDefinitions[$name]->getRules() as $rule => $config) { - if (str_starts_with($rule, '@')) { - $set = $ruleSetDefinitions[$rule]; - $help .= \sprintf( - " * %s%s\n | %s\n\n", - $rule, - $set->isRisky() ? ' risky' : '', - $this->replaceRstLinks($set->getDescription()) - ); - - continue; - } - - /** @var FixerInterface $fixer */ - $fixer = $fixers[$rule]; - - $definition = $fixer->getDefinition(); - $help .= \sprintf( - " * %s%s\n | %s\n%s\n", - $rule, - $fixer->isRisky() ? ' risky' : '', - $definition->getSummary(), - true !== $config ? \sprintf(" | Configuration: %s\n", Utils::toString($config)) : '' - ); - } - - $output->write($help); - } - - /** - * @return array - */ - private function getFixers(): array - { - if (null !== $this->fixers) { - return $this->fixers; - } - - $fixers = []; - - foreach ($this->fixerFactory->getFixers() as $fixer) { - $fixers[$fixer->getName()] = $fixer; - } - - $this->fixers = $fixers; - ksort($this->fixers); - - return $this->fixers; - } - - /** - * @return list - */ - private function getSetNames(): array - { - if (null !== $this->setNames) { - return $this->setNames; - } - - $this->setNames = RuleSets::getSetDefinitionNames(); - - return $this->setNames; - } - - /** - * @param string $type 'rule'|'set' - */ - private function describeList(OutputInterface $output, string $type): void - { - if ($output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE) { - return; - } - - if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE || 'set' === $type) { - $output->writeln('Defined sets:'); - - $items = $this->getSetNames(); - foreach ($items as $item) { - $output->writeln(\sprintf('* %s', $item)); - } - } - - if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE || 'rule' === $type) { - $output->writeln('Defined rules:'); - - $items = array_keys($this->getFixers()); - foreach ($items as $item) { - $output->writeln(\sprintf('* %s', $item)); - } - } - } - - private function replaceRstLinks(string $content): string - { - return Preg::replaceCallback( - '/(`[^<]+<[^>]+>`_)/', - static fn (array $matches) => Preg::replaceCallback( - '/`(.*)<(.*)>`_/', - static fn (array $matches): string => $matches[1].'('.$matches[2].')', - $matches[1] - ), - $content - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeNameNotFoundException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeNameNotFoundException.php deleted file mode 100644 index 27f5bcfc..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeNameNotFoundException.php +++ /dev/null @@ -1,46 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Command; - -/** - * @internal - */ -final class DescribeNameNotFoundException extends \InvalidArgumentException -{ - private string $name; - - /** - * 'rule'|'set'. - */ - private string $type; - - public function __construct(string $name, string $type) - { - $this->name = $name; - $this->type = $type; - - parent::__construct(); - } - - public function getName(): string - { - return $this->name; - } - - public function getType(): string - { - return $this->type; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php deleted file mode 100644 index a2e34695..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php +++ /dev/null @@ -1,123 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Command; - -use PhpCsFixer\Documentation\DocumentationLocator; -use PhpCsFixer\Documentation\FixerDocumentGenerator; -use PhpCsFixer\Documentation\RuleSetDocumentationGenerator; -use PhpCsFixer\FixerFactory; -use PhpCsFixer\RuleSet\RuleSets; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Finder\Finder; -use Symfony\Component\Finder\SplFileInfo; - -/** - * @internal - */ -#[AsCommand(name: 'documentation')] -final class DocumentationCommand extends Command -{ - protected static $defaultName = 'documentation'; - - private Filesystem $filesystem; - - public function __construct(Filesystem $filesystem) - { - parent::__construct(); - $this->filesystem = $filesystem; - } - - protected function configure(): void - { - $this - ->setAliases(['doc']) - ->setDescription('Dumps the documentation of the project into its "/doc" directory.') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $locator = new DocumentationLocator(); - - $fixerFactory = new FixerFactory(); - $fixerFactory->registerBuiltInFixers(); - $fixers = $fixerFactory->getFixers(); - - $setDefinitions = RuleSets::getSetDefinitions(); - - $fixerDocumentGenerator = new FixerDocumentGenerator($locator); - $ruleSetDocumentationGenerator = new RuleSetDocumentationGenerator($locator); - - // Array of existing fixer docs. - // We first override existing files, and then we will delete files that are no longer needed. - // We cannot remove all files first, as generation of docs is re-using existing docs to extract code-samples for - // VersionSpecificCodeSample under incompatible PHP version. - $docForFixerRelativePaths = []; - - foreach ($fixers as $fixer) { - $docForFixerRelativePaths[] = $locator->getFixerDocumentationFileRelativePath($fixer); - $this->filesystem->dumpFile( - $locator->getFixerDocumentationFilePath($fixer), - $fixerDocumentGenerator->generateFixerDocumentation($fixer) - ); - } - - /** @var SplFileInfo $file */ - foreach ( - (new Finder())->files() - ->in($locator->getFixersDocumentationDirectoryPath()) - ->notPath($docForFixerRelativePaths) as $file - ) { - $this->filesystem->remove($file->getPathname()); - } - - // Fixer doc. index - - $this->filesystem->dumpFile( - $locator->getFixersDocumentationIndexFilePath(), - $fixerDocumentGenerator->generateFixersDocumentationIndex($fixers) - ); - - // RuleSet docs. - - /** @var SplFileInfo $file */ - foreach ((new Finder())->files()->in($locator->getRuleSetsDocumentationDirectoryPath()) as $file) { - $this->filesystem->remove($file->getPathname()); - } - - $paths = []; - - foreach ($setDefinitions as $name => $definition) { - $path = $locator->getRuleSetsDocumentationFilePath($name); - $paths[$path] = $definition; - $this->filesystem->dumpFile($path, $ruleSetDocumentationGenerator->generateRuleSetsDocumentation($definition, $fixers)); - } - - // RuleSet doc. index - - $this->filesystem->dumpFile( - $locator->getRuleSetsDocumentationIndexFilePath(), - $ruleSetDocumentationGenerator->generateRuleSetsDocumentationIndex($paths) - ); - - $output->writeln('Docs updated.'); - - return 0; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php deleted file mode 100644 index 7c157f95..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php +++ /dev/null @@ -1,393 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Command; - -use PhpCsFixer\Config; -use PhpCsFixer\ConfigInterface; -use PhpCsFixer\ConfigurationException\InvalidConfigurationException; -use PhpCsFixer\Console\Application; -use PhpCsFixer\Console\ConfigurationResolver; -use PhpCsFixer\Console\Output\ErrorOutput; -use PhpCsFixer\Console\Output\OutputContext; -use PhpCsFixer\Console\Output\Progress\ProgressOutputFactory; -use PhpCsFixer\Console\Output\Progress\ProgressOutputType; -use PhpCsFixer\Console\Report\FixReport\ReportSummary; -use PhpCsFixer\Error\ErrorsManager; -use PhpCsFixer\Runner\Event\FileProcessed; -use PhpCsFixer\Runner\Runner; -use PhpCsFixer\ToolInfoInterface; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Terminal; -use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\Stopwatch\Stopwatch; - -/** - * @author Fabien Potencier - * @author Dariusz Rumiński - * - * @final - * - * @internal - */ -#[AsCommand(name: 'fix', description: 'Fixes a directory or a file.')] -/* final */ class FixCommand extends Command -{ - protected static $defaultName = 'fix'; - - protected static $defaultDescription = 'Fixes a directory or a file.'; - - private EventDispatcherInterface $eventDispatcher; - - private ErrorsManager $errorsManager; - - private Stopwatch $stopwatch; - - private ConfigInterface $defaultConfig; - - private ToolInfoInterface $toolInfo; - - private ProgressOutputFactory $progressOutputFactory; - - public function __construct(ToolInfoInterface $toolInfo) - { - parent::__construct(); - - $this->eventDispatcher = new EventDispatcher(); - $this->errorsManager = new ErrorsManager(); - $this->stopwatch = new Stopwatch(); - $this->defaultConfig = new Config(); - $this->toolInfo = $toolInfo; - $this->progressOutputFactory = new ProgressOutputFactory(); - } - - /** - * {@inheritdoc} - * - * Override here to only generate the help copy when used. - */ - public function getHelp(): string - { - return <<<'EOF' - The %command.name% command tries to %command.name% as much coding standards - problems as possible on a given file or files in a given directory and its subdirectories: - - $ php %command.full_name% /path/to/dir - $ php %command.full_name% /path/to/file - - By default --path-mode is set to `override`, which means, that if you specify the path to a file or a directory via - command arguments, then the paths provided to a `Finder` in config file will be ignored. You can use --path-mode=intersection - to merge paths from the config file and from the argument: - - $ php %command.full_name% --path-mode=intersection /path/to/dir - - The --format option for the output format. Supported formats are `txt` (default one), `json`, `xml`, `checkstyle`, `junit` and `gitlab`. - - NOTE: the output for the following formats are generated in accordance with schemas - - * `checkstyle` follows the common `"checkstyle" XML schema `_ - * `gitlab` follows the `codeclimate JSON schema `_ - * `json` follows the `own JSON schema `_ - * `junit` follows the `JUnit XML schema from Jenkins `_ - * `xml` follows the `own XML schema `_ - - The --quiet Do not output any message. - - The --verbose option will show the applied rules. When using the `txt` format it will also display progress notifications. - - NOTE: if there is an error like "errors reported during linting after fixing", you can use this to be even more verbose for debugging purpose - - * `-v`: verbose - * `-vv`: very verbose - * `-vvv`: debug - - The --rules option limits the rules to apply to the - project: - - EOF. /* @TODO: 4.0 - change to @PER */ <<<'EOF' - - $ php %command.full_name% /path/to/project --rules=@PSR12 - - By default the PSR-12 rules are used. - - The --rules option lets you choose the exact rules to - apply (the rule names must be separated by a comma): - - $ php %command.full_name% /path/to/dir --rules=line_ending,full_opening_tag,indentation_type - - You can also exclude the rules you don't want by placing a dash in front of the rule name, if this is more convenient, - using -name_of_fixer: - - $ php %command.full_name% /path/to/dir --rules=-full_opening_tag,-indentation_type - - When using combinations of exact and exclude rules, applying exact rules along with above excluded results: - - $ php %command.full_name% /path/to/project --rules=@Symfony,-@PSR1,-blank_line_before_statement,strict_comparison - - Complete configuration for rules can be supplied using a `json` formatted string. - - $ php %command.full_name% /path/to/project --rules='{"concat_space": {"spacing": "none"}}' - - The --dry-run flag will run the fixer without making changes to your files. - - The --sequential flag will enforce sequential analysis even if parallel config is provided. - - The --diff flag can be used to let the fixer output all the changes it makes. - - The --allow-risky option (pass `yes` or `no`) allows you to set whether risky rules may run. Default value is taken from config file. - A rule is considered risky if it could change code behaviour. By default no risky rules are run. - - The --stop-on-violation flag stops the execution upon first file that needs to be fixed. - - The --show-progress option allows you to choose the way process progress is rendered: - - * none: disables progress output; - * dots: multiline progress output with number of files and percentage on each line. - * bar: single line progress output with number of files and calculated percentage. - - If the option is not provided, it defaults to bar unless a config file that disables output is used, in which case it defaults to none. This option has no effect if the verbosity of the command is less than verbose. - - $ php %command.full_name% --verbose --show-progress=dots - - By using --using-cache option with `yes` or `no` you can set if the caching - mechanism should be used. - - The command can also read from standard input, in which case it won't - automatically fix anything: - - $ cat foo.php | php %command.full_name% --diff - - - Finally, if you don't need BC kept on CLI level, you might use `PHP_CS_FIXER_FUTURE_MODE` to start using options that - would be default in next MAJOR release and to forbid using deprecated configuration: - - $ PHP_CS_FIXER_FUTURE_MODE=1 php %command.full_name% -v --diff - - Exit code - --------- - - Exit code of the `%command.name%` command is built using following bit flags: - - * 0 - OK. - * 1 - General error (or PHP minimal requirement not matched). - * 4 - Some files have invalid syntax (only in dry-run mode). - * 8 - Some files need fixing (only in dry-run mode). - * 16 - Configuration error of the application. - * 32 - Configuration error of a Fixer. - * 64 - Exception raised within the application. - - EOF; - } - - protected function configure(): void - { - $this->setDefinition( - [ - new InputArgument('path', InputArgument::IS_ARRAY, 'The path(s) that rules will be run against (each path can be a file or directory).'), - new InputOption('path-mode', '', InputOption::VALUE_REQUIRED, 'Specify path mode (can be `override` or `intersection`).', ConfigurationResolver::PATH_MODE_OVERRIDE), - new InputOption('allow-risky', '', InputOption::VALUE_REQUIRED, 'Are risky fixers allowed (can be `yes` or `no`).'), - new InputOption('config', '', InputOption::VALUE_REQUIRED, 'The path to a config file.'), - new InputOption('dry-run', '', InputOption::VALUE_NONE, 'Only shows which files would have been modified.'), - new InputOption('rules', '', InputOption::VALUE_REQUIRED, 'List of rules that should be run against configured paths.'), - new InputOption('using-cache', '', InputOption::VALUE_REQUIRED, 'Should cache be used (can be `yes` or `no`).'), - new InputOption('cache-file', '', InputOption::VALUE_REQUIRED, 'The path to the cache file.'), - new InputOption('diff', '', InputOption::VALUE_NONE, 'Prints diff for each file.'), - new InputOption('format', '', InputOption::VALUE_REQUIRED, 'To output results in other formats.'), - new InputOption('stop-on-violation', '', InputOption::VALUE_NONE, 'Stop execution on first violation.'), - new InputOption('show-progress', '', InputOption::VALUE_REQUIRED, 'Type of progress indicator (none, dots).'), - new InputOption('sequential', '', InputOption::VALUE_NONE, 'Enforce sequential analysis.'), - ] - ); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $verbosity = $output->getVerbosity(); - - $passedConfig = $input->getOption('config'); - $passedRules = $input->getOption('rules'); - - if (null !== $passedConfig && null !== $passedRules) { - throw new InvalidConfigurationException('Passing both `--config` and `--rules` options is not allowed.'); - } - - $resolver = new ConfigurationResolver( - $this->defaultConfig, - [ - 'allow-risky' => $input->getOption('allow-risky'), - 'config' => $passedConfig, - 'dry-run' => $this->isDryRun($input), - 'rules' => $passedRules, - 'path' => $input->getArgument('path'), - 'path-mode' => $input->getOption('path-mode'), - 'using-cache' => $input->getOption('using-cache'), - 'cache-file' => $input->getOption('cache-file'), - 'format' => $input->getOption('format'), - 'diff' => $input->getOption('diff'), - 'stop-on-violation' => $input->getOption('stop-on-violation'), - 'verbosity' => $verbosity, - 'show-progress' => $input->getOption('show-progress'), - 'sequential' => $input->getOption('sequential'), - ], - getcwd(), - $this->toolInfo - ); - - $reporter = $resolver->getReporter(); - - $stdErr = $output instanceof ConsoleOutputInterface - ? $output->getErrorOutput() - : ('txt' === $reporter->getFormat() ? $output : null); - - if (null !== $stdErr) { - $stdErr->writeln(Application::getAboutWithRuntime(true)); - $isParallel = $resolver->getParallelConfig()->getMaxProcesses() > 1; - - $stdErr->writeln(\sprintf( - 'Running analysis on %d core%s.', - $resolver->getParallelConfig()->getMaxProcesses(), - $isParallel ? \sprintf( - 's with %d file%s per process', - $resolver->getParallelConfig()->getFilesPerProcess(), - $resolver->getParallelConfig()->getFilesPerProcess() > 1 ? 's' : '' - ) : ' sequentially' - )); - - /** @TODO v4 remove warnings related to parallel runner */ - $usageDocs = 'https://cs.symfony.com/doc/usage.html'; - $stdErr->writeln(\sprintf( - $stdErr->isDecorated() ? '%s' : '%s', - $isParallel - ? 'Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!' - : \sprintf( - 'You can enable parallel runner and speed up the analysis! Please see %s for more information.', - $stdErr->isDecorated() - ? \sprintf('usage docs', OutputFormatter::escape($usageDocs)) - : $usageDocs - ) - )); - - $configFile = $resolver->getConfigFile(); - $stdErr->writeln(\sprintf('Loaded config %s%s.', $resolver->getConfig()->getName(), null === $configFile ? '' : ' from "'.$configFile.'"')); - - if ($resolver->getUsingCache()) { - $cacheFile = $resolver->getCacheFile(); - - if (is_file($cacheFile)) { - $stdErr->writeln(\sprintf('Using cache file "%s".', $cacheFile)); - } - } - } - - $finder = new \ArrayIterator(iterator_to_array($resolver->getFinder())); - - if (null !== $stdErr && $resolver->configFinderIsOverridden()) { - $stdErr->writeln( - \sprintf($stdErr->isDecorated() ? '%s' : '%s', 'Paths from configuration file have been overridden by paths provided as command arguments.') - ); - } - - $progressType = $resolver->getProgressType(); - $progressOutput = $this->progressOutputFactory->create( - $progressType, - new OutputContext( - $stdErr, - (new Terminal())->getWidth(), - \count($finder) - ) - ); - - $runner = new Runner( - $finder, - $resolver->getFixers(), - $resolver->getDiffer(), - ProgressOutputType::NONE !== $progressType ? $this->eventDispatcher : null, - $this->errorsManager, - $resolver->getLinter(), - $resolver->isDryRun(), - $resolver->getCacheManager(), - $resolver->getDirectory(), - $resolver->shouldStopOnViolation(), - $resolver->getParallelConfig(), - $input, - $resolver->getConfigFile() - ); - - $this->eventDispatcher->addListener(FileProcessed::NAME, [$progressOutput, 'onFixerFileProcessed']); - $this->stopwatch->start('fixFiles'); - $changed = $runner->fix(); - $this->stopwatch->stop('fixFiles'); - $this->eventDispatcher->removeListener(FileProcessed::NAME, [$progressOutput, 'onFixerFileProcessed']); - - $progressOutput->printLegend(); - - $fixEvent = $this->stopwatch->getEvent('fixFiles'); - - $reportSummary = new ReportSummary( - $changed, - \count($finder), - $fixEvent->getDuration(), - $fixEvent->getMemory(), - OutputInterface::VERBOSITY_VERBOSE <= $verbosity, - $resolver->isDryRun(), - $output->isDecorated() - ); - - $output->isDecorated() - ? $output->write($reporter->generate($reportSummary)) - : $output->write($reporter->generate($reportSummary), false, OutputInterface::OUTPUT_RAW); - - $invalidErrors = $this->errorsManager->getInvalidErrors(); - $exceptionErrors = $this->errorsManager->getExceptionErrors(); - $lintErrors = $this->errorsManager->getLintErrors(); - - if (null !== $stdErr) { - $errorOutput = new ErrorOutput($stdErr); - - if (\count($invalidErrors) > 0) { - $errorOutput->listErrors('linting before fixing', $invalidErrors); - } - - if (\count($exceptionErrors) > 0) { - $errorOutput->listErrors('fixing', $exceptionErrors); - } - - if (\count($lintErrors) > 0) { - $errorOutput->listErrors('linting after fixing', $lintErrors); - } - } - - $exitStatusCalculator = new FixCommandExitStatusCalculator(); - - return $exitStatusCalculator->calculate( - $resolver->isDryRun(), - \count($changed) > 0, - \count($invalidErrors) > 0, - \count($exceptionErrors) > 0, - \count($lintErrors) > 0 - ); - } - - protected function isDryRun(InputInterface $input): bool - { - return $input->getOption('dry-run'); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommandExitStatusCalculator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommandExitStatusCalculator.php deleted file mode 100644 index 28d6b258..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommandExitStatusCalculator.php +++ /dev/null @@ -1,56 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Command; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class FixCommandExitStatusCalculator -{ - // Exit status 1 is reserved for environment constraints not matched. - public const EXIT_STATUS_FLAG_HAS_INVALID_FILES = 4; - public const EXIT_STATUS_FLAG_HAS_CHANGED_FILES = 8; - public const EXIT_STATUS_FLAG_HAS_INVALID_CONFIG = 16; - public const EXIT_STATUS_FLAG_HAS_INVALID_FIXER_CONFIG = 32; - public const EXIT_STATUS_FLAG_EXCEPTION_IN_APP = 64; - - public function calculate( - bool $isDryRun, - bool $hasChangedFiles, - bool $hasInvalidErrors, - bool $hasExceptionErrors, - bool $hasLintErrorsAfterFixing - ): int { - $exitStatus = 0; - - if ($isDryRun) { - if ($hasChangedFiles) { - $exitStatus |= self::EXIT_STATUS_FLAG_HAS_CHANGED_FILES; - } - - if ($hasInvalidErrors) { - $exitStatus |= self::EXIT_STATUS_FLAG_HAS_INVALID_FILES; - } - } - - if ($hasExceptionErrors || $hasLintErrorsAfterFixing) { - $exitStatus |= self::EXIT_STATUS_FLAG_EXCEPTION_IN_APP; - } - - return $exitStatus; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php deleted file mode 100644 index 6dace362..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Command; - -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerOptionInterface; -use PhpCsFixer\Utils; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\HelpCommand as BaseHelpCommand; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Fabien Potencier - * @author Dariusz Rumiński - * - * @internal - */ -#[AsCommand(name: 'help')] -final class HelpCommand extends BaseHelpCommand -{ - protected static $defaultName = 'help'; - - /** - * Returns the allowed values of the given option that can be converted to a string. - * - * @return null|list - */ - public static function getDisplayableAllowedValues(FixerOptionInterface $option): ?array - { - $allowed = $option->getAllowedValues(); - - if (null !== $allowed) { - $allowed = array_filter($allowed, static fn ($value): bool => !$value instanceof \Closure); - - usort($allowed, static function ($valueA, $valueB): int { - if ($valueA instanceof AllowedValueSubset) { - return -1; - } - - if ($valueB instanceof AllowedValueSubset) { - return 1; - } - - return strcasecmp( - Utils::toString($valueA), - Utils::toString($valueB) - ); - }); - - if (0 === \count($allowed)) { - $allowed = null; - } - } - - return $allowed; - } - - protected function initialize(InputInterface $input, OutputInterface $output): void - { - $output->getFormatter()->setStyle('url', new OutputFormatterStyle('blue')); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php deleted file mode 100644 index 93549116..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php +++ /dev/null @@ -1,91 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Command; - -use PhpCsFixer\Config; -use PhpCsFixer\ConfigInterface; -use PhpCsFixer\Console\ConfigurationResolver; -use PhpCsFixer\ToolInfoInterface; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Filesystem\Path; - -/** - * @author Markus Staab - * - * @internal - */ -#[AsCommand(name: 'list-files')] -final class ListFilesCommand extends Command -{ - protected static $defaultName = 'list-files'; - - private ConfigInterface $defaultConfig; - - private ToolInfoInterface $toolInfo; - - public function __construct(ToolInfoInterface $toolInfo) - { - parent::__construct(); - - $this->defaultConfig = new Config(); - $this->toolInfo = $toolInfo; - } - - protected function configure(): void - { - $this - ->setDefinition( - [ - new InputOption('config', '', InputOption::VALUE_REQUIRED, 'The path to a .php-cs-fixer.php file.'), - ] - ) - ->setDescription('List all files being fixed by the given config.') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $passedConfig = $input->getOption('config'); - $cwd = getcwd(); - - $resolver = new ConfigurationResolver( - $this->defaultConfig, - [ - 'config' => $passedConfig, - ], - $cwd, - $this->toolInfo - ); - - $finder = $resolver->getFinder(); - - /** @var \SplFileInfo $file */ - foreach ($finder as $file) { - if ($file->isFile()) { - $relativePath = './'.Path::makeRelative($file->getRealPath(), $cwd); - // unify directory separators across operating system - $relativePath = str_replace('/', \DIRECTORY_SEPARATOR, $relativePath); - - $output->writeln(escapeshellarg($relativePath)); - } - } - - return 0; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php deleted file mode 100644 index 97737a79..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php +++ /dev/null @@ -1,87 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Command; - -use PhpCsFixer\ConfigurationException\InvalidConfigurationException; -use PhpCsFixer\Console\Report\ListSetsReport\ReporterFactory; -use PhpCsFixer\Console\Report\ListSetsReport\ReporterInterface; -use PhpCsFixer\Console\Report\ListSetsReport\ReportSummary; -use PhpCsFixer\Console\Report\ListSetsReport\TextReporter; -use PhpCsFixer\RuleSet\RuleSets; -use PhpCsFixer\Utils; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -#[AsCommand(name: 'list-sets')] -final class ListSetsCommand extends Command -{ - protected static $defaultName = 'list-sets'; - - protected function configure(): void - { - $this - ->setDefinition( - [ - new InputOption('format', '', InputOption::VALUE_REQUIRED, 'To output results in other formats.', (new TextReporter())->getFormat()), - ] - ) - ->setDescription('List all available RuleSets.') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $reporter = $this->resolveReporterWithFactory( - $input->getOption('format'), - new ReporterFactory() - ); - - $reportSummary = new ReportSummary( - array_values(RuleSets::getSetDefinitions()) - ); - - $report = $reporter->generate($reportSummary); - - $output->isDecorated() - ? $output->write(OutputFormatter::escape($report)) - : $output->write($report, false, OutputInterface::OUTPUT_RAW); - - return 0; - } - - private function resolveReporterWithFactory(string $format, ReporterFactory $factory): ReporterInterface - { - try { - $factory->registerBuiltInReporters(); - $reporter = $factory->getReporter($format); - } catch (\UnexpectedValueException $e) { - $formats = $factory->getFormats(); - sort($formats); - - throw new InvalidConfigurationException(\sprintf('The format "%s" is not defined, supported are %s.', $format, Utils::naturalLanguageJoin($formats))); - } - - return $reporter; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php deleted file mode 100644 index ab2b9049..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php +++ /dev/null @@ -1,176 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Command; - -use PhpCsFixer\Console\Application; -use PhpCsFixer\Console\SelfUpdate\NewVersionCheckerInterface; -use PhpCsFixer\PharCheckerInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\ToolInfoInterface; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Igor Wiedler - * @author Stephane PY - * @author Grégoire Pineau - * @author Dariusz Rumiński - * - * @internal - */ -#[AsCommand(name: 'self-update')] -final class SelfUpdateCommand extends Command -{ - protected static $defaultName = 'self-update'; - - private NewVersionCheckerInterface $versionChecker; - - private ToolInfoInterface $toolInfo; - - private PharCheckerInterface $pharChecker; - - public function __construct( - NewVersionCheckerInterface $versionChecker, - ToolInfoInterface $toolInfo, - PharCheckerInterface $pharChecker - ) { - parent::__construct(); - - $this->versionChecker = $versionChecker; - $this->toolInfo = $toolInfo; - $this->pharChecker = $pharChecker; - } - - protected function configure(): void - { - $this - ->setAliases(['selfupdate']) - ->setDefinition( - [ - new InputOption('--force', '-f', InputOption::VALUE_NONE, 'Force update to next major version if available.'), - ] - ) - ->setDescription('Update php-cs-fixer.phar to the latest stable version.') - ->setHelp( - <<<'EOT' - The %command.name% command replace your php-cs-fixer.phar by the - latest version released on: - https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases - - $ php php-cs-fixer.phar %command.name% - - EOT - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - if ($output instanceof ConsoleOutputInterface) { - $stdErr = $output->getErrorOutput(); - $stdErr->writeln(Application::getAboutWithRuntime(true)); - } - - if (!$this->toolInfo->isInstalledAsPhar()) { - $output->writeln('Self-update is available only for PHAR version.'); - - return 1; - } - - $currentVersion = $this->getApplication()->getVersion(); - Preg::match('/^v?(?\d+)\./', $currentVersion, $matches); - $currentMajor = (int) $matches['major']; - - try { - $latestVersion = $this->versionChecker->getLatestVersion(); - $latestVersionOfCurrentMajor = $this->versionChecker->getLatestVersionOfMajor($currentMajor); - } catch (\Exception $exception) { - $output->writeln(\sprintf( - 'Unable to determine newest version: %s', - $exception->getMessage() - )); - - return 1; - } - - if (1 !== $this->versionChecker->compareVersions($latestVersion, $currentVersion)) { - $output->writeln('PHP CS Fixer is already up-to-date.'); - - return 0; - } - - $remoteTag = $latestVersion; - - if ( - 0 !== $this->versionChecker->compareVersions($latestVersionOfCurrentMajor, $latestVersion) - && true !== $input->getOption('force') - ) { - $output->writeln(\sprintf('A new major version of PHP CS Fixer is available (%s)', $latestVersion)); - $output->writeln(\sprintf('Before upgrading please read https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/%s/UPGRADE-v%s.md', $latestVersion, $currentMajor + 1)); - $output->writeln('If you are ready to upgrade run this command with -f'); - $output->writeln('Checking for new minor/patch version...'); - - if (1 !== $this->versionChecker->compareVersions($latestVersionOfCurrentMajor, $currentVersion)) { - $output->writeln('No minor update for PHP CS Fixer.'); - - return 0; - } - - $remoteTag = $latestVersionOfCurrentMajor; - } - - $localFilename = $_SERVER['argv'][0]; - $realPath = realpath($localFilename); - if (false !== $realPath) { - $localFilename = $realPath; - } - - if (!is_writable($localFilename)) { - $output->writeln(\sprintf('No permission to update "%s" file.', $localFilename)); - - return 1; - } - - $tempFilename = \dirname($localFilename).'/'.basename($localFilename, '.phar').'-tmp.phar'; - $remoteFilename = $this->toolInfo->getPharDownloadUri($remoteTag); - - if (false === @copy($remoteFilename, $tempFilename)) { - $output->writeln(\sprintf('Unable to download new version %s from the server.', $remoteTag)); - - return 1; - } - - chmod($tempFilename, 0777 & ~umask()); - - $pharInvalidityReason = $this->pharChecker->checkFileValidity($tempFilename); - if (null !== $pharInvalidityReason) { - unlink($tempFilename); - $output->writeln(\sprintf('The download of %s is corrupt (%s).', $remoteTag, $pharInvalidityReason)); - $output->writeln('Please re-run the "self-update" command to try again.'); - - return 1; - } - - rename($tempFilename, $localFilename); - - $output->writeln(\sprintf('PHP CS Fixer updated (%s -> %s)', $currentVersion, $remoteTag)); - - return 0; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/WorkerCommand.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/WorkerCommand.php deleted file mode 100644 index 92f03bf9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Command/WorkerCommand.php +++ /dev/null @@ -1,243 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Command; - -use Clue\React\NDJson\Decoder; -use Clue\React\NDJson\Encoder; -use PhpCsFixer\Cache\NullCacheManager; -use PhpCsFixer\Config; -use PhpCsFixer\Console\ConfigurationResolver; -use PhpCsFixer\Error\ErrorsManager; -use PhpCsFixer\Runner\Event\FileProcessed; -use PhpCsFixer\Runner\Parallel\ParallelAction; -use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; -use PhpCsFixer\Runner\Parallel\ParallelisationException; -use PhpCsFixer\Runner\Runner; -use PhpCsFixer\ToolInfoInterface; -use React\EventLoop\StreamSelectLoop; -use React\Socket\ConnectionInterface; -use React\Socket\TcpConnector; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; - -/** - * @author Greg Korba - * - * @internal - */ -#[AsCommand(name: 'worker', description: 'Internal command for running fixers in parallel', hidden: true)] -final class WorkerCommand extends Command -{ - /** @var string Prefix used before JSON-encoded error printed in the worker's process */ - public const ERROR_PREFIX = 'WORKER_ERROR::'; - - protected static $defaultName = 'worker'; - - protected static $defaultDescription = 'Internal command for running fixers in parallel'; - - private ToolInfoInterface $toolInfo; - private ConfigurationResolver $configurationResolver; - private ErrorsManager $errorsManager; - private EventDispatcherInterface $eventDispatcher; - - /** @var list */ - private array $events; - - public function __construct(ToolInfoInterface $toolInfo) - { - parent::__construct(); - - $this->setHidden(true); - $this->toolInfo = $toolInfo; - $this->errorsManager = new ErrorsManager(); - $this->eventDispatcher = new EventDispatcher(); - } - - protected function configure(): void - { - $this->setDefinition( - [ - new InputOption('port', null, InputOption::VALUE_REQUIRED, 'Specifies parallelisation server\'s port.'), - new InputOption('identifier', null, InputOption::VALUE_REQUIRED, 'Specifies parallelisation process\' identifier.'), - new InputOption('allow-risky', '', InputOption::VALUE_REQUIRED, 'Are risky fixers allowed (can be `yes` or `no`).'), - new InputOption('config', '', InputOption::VALUE_REQUIRED, 'The path to a config file.'), - new InputOption('dry-run', '', InputOption::VALUE_NONE, 'Only shows which files would have been modified.'), - new InputOption('rules', '', InputOption::VALUE_REQUIRED, 'List of rules that should be run against configured paths.'), - new InputOption('using-cache', '', InputOption::VALUE_REQUIRED, 'Should cache be used (can be `yes` or `no`).'), - new InputOption('cache-file', '', InputOption::VALUE_REQUIRED, 'The path to the cache file.'), - new InputOption('diff', '', InputOption::VALUE_NONE, 'Prints diff for each file.'), - new InputOption('stop-on-violation', '', InputOption::VALUE_NONE, 'Stop execution on first violation.'), - ] - ); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $errorOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output; - $identifier = $input->getOption('identifier'); - $port = $input->getOption('port'); - - if (null === $identifier || !is_numeric($port)) { - throw new ParallelisationException('Missing parallelisation options'); - } - - try { - $runner = $this->createRunner($input); - } catch (\Throwable $e) { - throw new ParallelisationException('Unable to create runner: '.$e->getMessage(), 0, $e); - } - - $loop = new StreamSelectLoop(); - $tcpConnector = new TcpConnector($loop); - $tcpConnector - ->connect(\sprintf('127.0.0.1:%d', $port)) - ->then( - /** @codeCoverageIgnore */ - function (ConnectionInterface $connection) use ($loop, $runner, $identifier): void { - $jsonInvalidUtf8Ignore = \defined('JSON_INVALID_UTF8_IGNORE') ? JSON_INVALID_UTF8_IGNORE : 0; - $out = new Encoder($connection, $jsonInvalidUtf8Ignore); - $in = new Decoder($connection, true, 512, $jsonInvalidUtf8Ignore); - - // [REACT] Initialise connection with the parallelisation operator - $out->write(['action' => ParallelAction::WORKER_HELLO, 'identifier' => $identifier]); - - $handleError = static function (\Throwable $error) use ($out): void { - $out->write([ - 'action' => ParallelAction::WORKER_ERROR_REPORT, - 'class' => \get_class($error), - 'message' => $error->getMessage(), - 'file' => $error->getFile(), - 'line' => $error->getLine(), - 'code' => $error->getCode(), - 'trace' => $error->getTraceAsString(), - ]); - }; - $out->on('error', $handleError); - $in->on('error', $handleError); - - // [REACT] Listen for messages from the parallelisation operator (analysis requests) - $in->on('data', function (array $json) use ($loop, $runner, $out): void { - $action = $json['action'] ?? null; - - // Parallelisation operator does not have more to do, let's close the connection - if (ParallelAction::RUNNER_THANK_YOU === $action) { - $loop->stop(); - - return; - } - - if (ParallelAction::RUNNER_REQUEST_ANALYSIS !== $action) { - // At this point we only expect analysis requests, if any other action happen, we need to fix the code. - throw new \LogicException(\sprintf('Unexpected action ParallelAction::%s.', $action)); - } - - /** @var iterable $files */ - $files = $json['files']; - - foreach ($files as $absolutePath) { - // Reset events because we want to collect only those coming from analysed files chunk - $this->events = []; - $runner->setFileIterator(new \ArrayIterator([new \SplFileInfo($absolutePath)])); - $analysisResult = $runner->fix(); - - if (1 !== \count($this->events)) { - throw new ParallelisationException('Runner did not report a fixing event or reported too many.'); - } - - if (1 < \count($analysisResult)) { - throw new ParallelisationException('Runner returned more analysis results than expected.'); - } - - $out->write([ - 'action' => ParallelAction::WORKER_RESULT, - 'file' => $absolutePath, - 'fileHash' => $this->events[0]->getFileHash(), - 'status' => $this->events[0]->getStatus(), - 'fixInfo' => array_pop($analysisResult), - 'errors' => $this->errorsManager->forPath($absolutePath), - ]); - } - - // Request another file chunk (if available, the parallelisation operator will request new "run" action) - $out->write(['action' => ParallelAction::WORKER_GET_FILE_CHUNK]); - }); - }, - static function (\Throwable $error) use ($errorOutput): void { - // @TODO Verify onRejected behaviour → https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777#discussion_r1590399285 - $errorOutput->writeln($error->getMessage()); - } - ) - ; - - $loop->run(); - - return Command::SUCCESS; - } - - private function createRunner(InputInterface $input): Runner - { - $passedConfig = $input->getOption('config'); - $passedRules = $input->getOption('rules'); - - if (null !== $passedConfig && null !== $passedRules) { - throw new \RuntimeException('Passing both `--config` and `--rules` options is not allowed'); - } - - // There's no one single source of truth when it comes to fixing single file, we need to collect statuses from events. - $this->eventDispatcher->addListener(FileProcessed::NAME, function (FileProcessed $event): void { - $this->events[] = $event; - }); - - $this->configurationResolver = new ConfigurationResolver( - new Config(), - [ - 'allow-risky' => $input->getOption('allow-risky'), - 'config' => $passedConfig, - 'dry-run' => $input->getOption('dry-run'), - 'rules' => $passedRules, - 'path' => [], - 'path-mode' => ConfigurationResolver::PATH_MODE_OVERRIDE, // IMPORTANT! WorkerCommand is called with file that already passed filtering, so here we can rely on PATH_MODE_OVERRIDE. - 'using-cache' => $input->getOption('using-cache'), - 'cache-file' => $input->getOption('cache-file'), - 'diff' => $input->getOption('diff'), - 'stop-on-violation' => $input->getOption('stop-on-violation'), - ], - getcwd(), // @phpstan-ignore-line - $this->toolInfo - ); - - return new Runner( - null, // Paths are known when parallelisation server requests new chunk, not now - $this->configurationResolver->getFixers(), - $this->configurationResolver->getDiffer(), - $this->eventDispatcher, - $this->errorsManager, - $this->configurationResolver->getLinter(), - $this->configurationResolver->isDryRun(), - new NullCacheManager(), // IMPORTANT! We pass null cache, as cache is read&write in main process and we do not need to do it again. - $this->configurationResolver->getDirectory(), - $this->configurationResolver->shouldStopOnViolation(), - ParallelConfigFactory::sequential(), // IMPORTANT! Worker must run in sequential mode. - null, - $this->configurationResolver->getConfigFile() - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php deleted file mode 100644 index 496948af..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php +++ /dev/null @@ -1,930 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console; - -use PhpCsFixer\Cache\CacheManagerInterface; -use PhpCsFixer\Cache\Directory; -use PhpCsFixer\Cache\DirectoryInterface; -use PhpCsFixer\Cache\FileCacheManager; -use PhpCsFixer\Cache\FileHandler; -use PhpCsFixer\Cache\NullCacheManager; -use PhpCsFixer\Cache\Signature; -use PhpCsFixer\ConfigInterface; -use PhpCsFixer\ConfigurationException\InvalidConfigurationException; -use PhpCsFixer\Console\Output\Progress\ProgressOutputType; -use PhpCsFixer\Console\Report\FixReport\ReporterFactory; -use PhpCsFixer\Console\Report\FixReport\ReporterInterface; -use PhpCsFixer\Differ\DifferInterface; -use PhpCsFixer\Differ\NullDiffer; -use PhpCsFixer\Differ\UnifiedDiffer; -use PhpCsFixer\Finder; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\FixerFactory; -use PhpCsFixer\Linter\Linter; -use PhpCsFixer\Linter\LinterInterface; -use PhpCsFixer\ParallelAwareConfigInterface; -use PhpCsFixer\RuleSet\RuleSet; -use PhpCsFixer\RuleSet\RuleSetInterface; -use PhpCsFixer\Runner\Parallel\ParallelConfig; -use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; -use PhpCsFixer\StdinFileInfo; -use PhpCsFixer\ToolInfoInterface; -use PhpCsFixer\Utils; -use PhpCsFixer\WhitespacesFixerConfig; -use PhpCsFixer\WordMatcher; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Finder\Finder as SymfonyFinder; - -/** - * The resolver that resolves configuration to use by command line options and config. - * - * @author Fabien Potencier - * @author Katsuhiro Ogawa - * @author Dariusz Rumiński - * - * @internal - */ -final class ConfigurationResolver -{ - public const PATH_MODE_OVERRIDE = 'override'; - public const PATH_MODE_INTERSECTION = 'intersection'; - - private ?bool $allowRisky = null; - - private ?ConfigInterface $config = null; - - private ?string $configFile = null; - - private string $cwd; - - private ConfigInterface $defaultConfig; - - private ?ReporterInterface $reporter = null; - - private ?bool $isStdIn = null; - - private ?bool $isDryRun = null; - - /** - * @var null|list - */ - private ?array $fixers = null; - - private ?bool $configFinderIsOverridden = null; - - private ToolInfoInterface $toolInfo; - - /** - * @var array - */ - private array $options = [ - 'allow-risky' => null, - 'cache-file' => null, - 'config' => null, - 'diff' => null, - 'dry-run' => null, - 'format' => null, - 'path' => [], - 'path-mode' => self::PATH_MODE_OVERRIDE, - 'rules' => null, - 'sequential' => null, - 'show-progress' => null, - 'stop-on-violation' => null, - 'using-cache' => null, - 'verbosity' => null, - ]; - - private ?string $cacheFile = null; - - private ?CacheManagerInterface $cacheManager = null; - - private ?DifferInterface $differ = null; - - private ?Directory $directory = null; - - /** - * @var null|iterable<\SplFileInfo> - */ - private ?iterable $finder = null; - - private ?string $format = null; - - private ?Linter $linter = null; - - /** - * @var null|list - */ - private ?array $path = null; - - /** - * @var null|ProgressOutputType::* - */ - private $progress; - - private ?RuleSet $ruleSet = null; - - private ?bool $usingCache = null; - - private ?FixerFactory $fixerFactory = null; - - /** - * @param array $options - */ - public function __construct( - ConfigInterface $config, - array $options, - string $cwd, - ToolInfoInterface $toolInfo - ) { - $this->defaultConfig = $config; - $this->cwd = $cwd; - $this->toolInfo = $toolInfo; - - foreach ($options as $name => $value) { - $this->setOption($name, $value); - } - } - - public function getCacheFile(): ?string - { - if (!$this->getUsingCache()) { - return null; - } - - if (null === $this->cacheFile) { - if (null === $this->options['cache-file']) { - $this->cacheFile = $this->getConfig()->getCacheFile(); - } else { - $this->cacheFile = $this->options['cache-file']; - } - } - - return $this->cacheFile; - } - - public function getCacheManager(): CacheManagerInterface - { - if (null === $this->cacheManager) { - $cacheFile = $this->getCacheFile(); - - if (null === $cacheFile) { - $this->cacheManager = new NullCacheManager(); - } else { - $this->cacheManager = new FileCacheManager( - new FileHandler($cacheFile), - new Signature( - PHP_VERSION, - $this->toolInfo->getVersion(), - $this->getConfig()->getIndent(), - $this->getConfig()->getLineEnding(), - $this->getRules() - ), - $this->isDryRun(), - $this->getDirectory() - ); - } - } - - return $this->cacheManager; - } - - public function getConfig(): ConfigInterface - { - if (null === $this->config) { - foreach ($this->computeConfigFiles() as $configFile) { - if (!file_exists($configFile)) { - continue; - } - - $configFileBasename = basename($configFile); - $deprecatedConfigs = [ - '.php_cs' => '.php-cs-fixer.php', - '.php_cs.dist' => '.php-cs-fixer.dist.php', - ]; - - if (isset($deprecatedConfigs[$configFileBasename])) { - throw new InvalidConfigurationException("Configuration file `{$configFileBasename}` is outdated, rename to `{$deprecatedConfigs[$configFileBasename]}`."); - } - - $this->config = self::separatedContextLessInclude($configFile); - $this->configFile = $configFile; - - break; - } - - if (null === $this->config) { - $this->config = $this->defaultConfig; - } - } - - return $this->config; - } - - public function getParallelConfig(): ParallelConfig - { - $config = $this->getConfig(); - - return true !== $this->options['sequential'] && $config instanceof ParallelAwareConfigInterface - ? $config->getParallelConfig() - : ParallelConfigFactory::sequential(); - } - - public function getConfigFile(): ?string - { - if (null === $this->configFile) { - $this->getConfig(); - } - - return $this->configFile; - } - - public function getDiffer(): DifferInterface - { - if (null === $this->differ) { - $this->differ = (true === $this->options['diff']) ? new UnifiedDiffer() : new NullDiffer(); - } - - return $this->differ; - } - - public function getDirectory(): DirectoryInterface - { - if (null === $this->directory) { - $path = $this->getCacheFile(); - if (null === $path) { - $absolutePath = $this->cwd; - } else { - $filesystem = new Filesystem(); - - $absolutePath = $filesystem->isAbsolutePath($path) - ? $path - : $this->cwd.\DIRECTORY_SEPARATOR.$path; - $absolutePath = \dirname($absolutePath); - } - - $this->directory = new Directory($absolutePath); - } - - return $this->directory; - } - - /** - * @return list - */ - public function getFixers(): array - { - if (null === $this->fixers) { - $this->fixers = $this->createFixerFactory() - ->useRuleSet($this->getRuleSet()) - ->setWhitespacesConfig(new WhitespacesFixerConfig($this->config->getIndent(), $this->config->getLineEnding())) - ->getFixers() - ; - - if (false === $this->getRiskyAllowed()) { - $riskyFixers = array_map( - static fn (FixerInterface $fixer): string => $fixer->getName(), - array_filter( - $this->fixers, - static fn (FixerInterface $fixer): bool => $fixer->isRisky() - ) - ); - - if (\count($riskyFixers) > 0) { - throw new InvalidConfigurationException(\sprintf('The rules contain risky fixers (%s), but they are not allowed to run. Perhaps you forget to use --allow-risky=yes option?', Utils::naturalLanguageJoin($riskyFixers))); - } - } - } - - return $this->fixers; - } - - public function getLinter(): LinterInterface - { - if (null === $this->linter) { - $this->linter = new Linter(); - } - - return $this->linter; - } - - /** - * Returns path. - * - * @return list - */ - public function getPath(): array - { - if (null === $this->path) { - $filesystem = new Filesystem(); - $cwd = $this->cwd; - - if (1 === \count($this->options['path']) && '-' === $this->options['path'][0]) { - $this->path = $this->options['path']; - } else { - $this->path = array_map( - static function (string $rawPath) use ($cwd, $filesystem): string { - $path = trim($rawPath); - - if ('' === $path) { - throw new InvalidConfigurationException("Invalid path: \"{$rawPath}\"."); - } - - $absolutePath = $filesystem->isAbsolutePath($path) - ? $path - : $cwd.\DIRECTORY_SEPARATOR.$path; - - if (!file_exists($absolutePath)) { - throw new InvalidConfigurationException(\sprintf( - 'The path "%s" is not readable.', - $path - )); - } - - return $absolutePath; - }, - $this->options['path'] - ); - } - } - - return $this->path; - } - - /** - * @return ProgressOutputType::* - * - * @throws InvalidConfigurationException - */ - public function getProgressType(): string - { - if (null === $this->progress) { - if ('txt' === $this->getFormat()) { - $progressType = $this->options['show-progress']; - - if (null === $progressType) { - $progressType = $this->getConfig()->getHideProgress() - ? ProgressOutputType::NONE - : ProgressOutputType::BAR; - } elseif (!\in_array($progressType, ProgressOutputType::all(), true)) { - throw new InvalidConfigurationException(\sprintf( - 'The progress type "%s" is not defined, supported are %s.', - $progressType, - Utils::naturalLanguageJoin(ProgressOutputType::all()) - )); - } - - $this->progress = $progressType; - } else { - $this->progress = ProgressOutputType::NONE; - } - } - - return $this->progress; - } - - public function getReporter(): ReporterInterface - { - if (null === $this->reporter) { - $reporterFactory = new ReporterFactory(); - $reporterFactory->registerBuiltInReporters(); - - $format = $this->getFormat(); - - try { - $this->reporter = $reporterFactory->getReporter($format); - } catch (\UnexpectedValueException $e) { - $formats = $reporterFactory->getFormats(); - sort($formats); - - throw new InvalidConfigurationException(\sprintf('The format "%s" is not defined, supported are %s.', $format, Utils::naturalLanguageJoin($formats))); - } - } - - return $this->reporter; - } - - public function getRiskyAllowed(): bool - { - if (null === $this->allowRisky) { - if (null === $this->options['allow-risky']) { - $this->allowRisky = $this->getConfig()->getRiskyAllowed(); - } else { - $this->allowRisky = $this->resolveOptionBooleanValue('allow-risky'); - } - } - - return $this->allowRisky; - } - - /** - * Returns rules. - * - * @return array|bool> - */ - public function getRules(): array - { - return $this->getRuleSet()->getRules(); - } - - public function getUsingCache(): bool - { - if (null === $this->usingCache) { - if (null === $this->options['using-cache']) { - $this->usingCache = $this->getConfig()->getUsingCache(); - } else { - $this->usingCache = $this->resolveOptionBooleanValue('using-cache'); - } - } - - $this->usingCache = $this->usingCache && $this->isCachingAllowedForRuntime(); - - return $this->usingCache; - } - - /** - * @return iterable<\SplFileInfo> - */ - public function getFinder(): iterable - { - if (null === $this->finder) { - $this->finder = $this->resolveFinder(); - } - - return $this->finder; - } - - /** - * Returns dry-run flag. - */ - public function isDryRun(): bool - { - if (null === $this->isDryRun) { - if ($this->isStdIn()) { - // Can't write to STDIN - $this->isDryRun = true; - } else { - $this->isDryRun = $this->options['dry-run']; - } - } - - return $this->isDryRun; - } - - public function shouldStopOnViolation(): bool - { - return $this->options['stop-on-violation']; - } - - public function configFinderIsOverridden(): bool - { - if (null === $this->configFinderIsOverridden) { - $this->resolveFinder(); - } - - return $this->configFinderIsOverridden; - } - - /** - * Compute file candidates for config file. - * - * @return list - */ - private function computeConfigFiles(): array - { - $configFile = $this->options['config']; - - if (null !== $configFile) { - if (false === file_exists($configFile) || false === is_readable($configFile)) { - throw new InvalidConfigurationException(\sprintf('Cannot read config file "%s".', $configFile)); - } - - return [$configFile]; - } - - $path = $this->getPath(); - - if ($this->isStdIn() || 0 === \count($path)) { - $configDir = $this->cwd; - } elseif (1 < \count($path)) { - throw new InvalidConfigurationException('For multiple paths config parameter is required.'); - } elseif (!is_file($path[0])) { - $configDir = $path[0]; - } else { - $dirName = pathinfo($path[0], PATHINFO_DIRNAME); - $configDir = is_dir($dirName) ? $dirName : $path[0]; - } - - $candidates = [ - $configDir.\DIRECTORY_SEPARATOR.'.php-cs-fixer.php', - $configDir.\DIRECTORY_SEPARATOR.'.php-cs-fixer.dist.php', - $configDir.\DIRECTORY_SEPARATOR.'.php_cs', // old v2 config, present here only to throw nice error message later - $configDir.\DIRECTORY_SEPARATOR.'.php_cs.dist', // old v2 config, present here only to throw nice error message later - ]; - - if ($configDir !== $this->cwd) { - $candidates[] = $this->cwd.\DIRECTORY_SEPARATOR.'.php-cs-fixer.php'; - $candidates[] = $this->cwd.\DIRECTORY_SEPARATOR.'.php-cs-fixer.dist.php'; - $candidates[] = $this->cwd.\DIRECTORY_SEPARATOR.'.php_cs'; // old v2 config, present here only to throw nice error message later - $candidates[] = $this->cwd.\DIRECTORY_SEPARATOR.'.php_cs.dist'; // old v2 config, present here only to throw nice error message later - } - - return $candidates; - } - - private function createFixerFactory(): FixerFactory - { - if (null === $this->fixerFactory) { - $fixerFactory = new FixerFactory(); - $fixerFactory->registerBuiltInFixers(); - $fixerFactory->registerCustomFixers($this->getConfig()->getCustomFixers()); - - $this->fixerFactory = $fixerFactory; - } - - return $this->fixerFactory; - } - - private function getFormat(): string - { - if (null === $this->format) { - $this->format = $this->options['format'] ?? $this->getConfig()->getFormat(); - } - - return $this->format; - } - - private function getRuleSet(): RuleSetInterface - { - if (null === $this->ruleSet) { - $rules = $this->parseRules(); - $this->validateRules($rules); - - $this->ruleSet = new RuleSet($rules); - } - - return $this->ruleSet; - } - - private function isStdIn(): bool - { - if (null === $this->isStdIn) { - $this->isStdIn = 1 === \count($this->options['path']) && '-' === $this->options['path'][0]; - } - - return $this->isStdIn; - } - - /** - * @template T - * - * @param iterable $iterable - * - * @return \Traversable - */ - private function iterableToTraversable(iterable $iterable): \Traversable - { - return \is_array($iterable) ? new \ArrayIterator($iterable) : $iterable; - } - - /** - * @return array - */ - private function parseRules(): array - { - if (null === $this->options['rules']) { - return $this->getConfig()->getRules(); - } - - $rules = trim($this->options['rules']); - if ('' === $rules) { - throw new InvalidConfigurationException('Empty rules value is not allowed.'); - } - - if (str_starts_with($rules, '{')) { - $rules = json_decode($rules, true); - - if (JSON_ERROR_NONE !== json_last_error()) { - throw new InvalidConfigurationException(\sprintf('Invalid JSON rules input: "%s".', json_last_error_msg())); - } - - return $rules; - } - - $rules = []; - - foreach (explode(',', $this->options['rules']) as $rule) { - $rule = trim($rule); - - if ('' === $rule) { - throw new InvalidConfigurationException('Empty rule name is not allowed.'); - } - - if (str_starts_with($rule, '-')) { - $rules[substr($rule, 1)] = false; - } else { - $rules[$rule] = true; - } - } - - return $rules; - } - - /** - * @param array $rules - * - * @throws InvalidConfigurationException - */ - private function validateRules(array $rules): void - { - /** - * Create a ruleset that contains all configured rules, even when they originally have been disabled. - * - * @see RuleSet::resolveSet() - */ - $ruleSet = []; - - foreach ($rules as $key => $value) { - if (\is_int($key)) { - throw new InvalidConfigurationException(\sprintf('Missing value for "%s" rule/set.', $value)); - } - - $ruleSet[$key] = true; - } - - $ruleSet = new RuleSet($ruleSet); - - $configuredFixers = array_keys($ruleSet->getRules()); - - $fixers = $this->createFixerFactory()->getFixers(); - - $availableFixers = array_map(static fn (FixerInterface $fixer): string => $fixer->getName(), $fixers); - - $unknownFixers = array_diff($configuredFixers, $availableFixers); - - if (\count($unknownFixers) > 0) { - $renamedRules = [ - 'blank_line_before_return' => [ - 'new_name' => 'blank_line_before_statement', - 'config' => ['statements' => ['return']], - ], - 'final_static_access' => [ - 'new_name' => 'self_static_accessor', - ], - 'hash_to_slash_comment' => [ - 'new_name' => 'single_line_comment_style', - 'config' => ['comment_types' => ['hash']], - ], - 'lowercase_constants' => [ - 'new_name' => 'constant_case', - 'config' => ['case' => 'lower'], - ], - 'no_extra_consecutive_blank_lines' => [ - 'new_name' => 'no_extra_blank_lines', - ], - 'no_multiline_whitespace_before_semicolons' => [ - 'new_name' => 'multiline_whitespace_before_semicolons', - ], - 'no_short_echo_tag' => [ - 'new_name' => 'echo_tag_syntax', - 'config' => ['format' => 'long'], - ], - 'php_unit_ordered_covers' => [ - 'new_name' => 'phpdoc_order_by_value', - 'config' => ['annotations' => ['covers']], - ], - 'phpdoc_inline_tag' => [ - 'new_name' => 'general_phpdoc_tag_rename, phpdoc_inline_tag_normalizer and phpdoc_tag_type', - ], - 'pre_increment' => [ - 'new_name' => 'increment_style', - 'config' => ['style' => 'pre'], - ], - 'psr0' => [ - 'new_name' => 'psr_autoloading', - 'config' => ['dir' => 'x'], - ], - 'psr4' => [ - 'new_name' => 'psr_autoloading', - ], - 'silenced_deprecation_error' => [ - 'new_name' => 'error_suppression', - ], - 'trailing_comma_in_multiline_array' => [ - 'new_name' => 'trailing_comma_in_multiline', - 'config' => ['elements' => ['arrays']], - ], - ]; - - $message = 'The rules contain unknown fixers: '; - $hasOldRule = false; - - foreach ($unknownFixers as $unknownFixer) { - if (isset($renamedRules[$unknownFixer])) { // Check if present as old renamed rule - $hasOldRule = true; - $message .= \sprintf( - '"%s" is renamed (did you mean "%s"?%s), ', - $unknownFixer, - $renamedRules[$unknownFixer]['new_name'], - isset($renamedRules[$unknownFixer]['config']) ? ' (note: use configuration "'.Utils::toString($renamedRules[$unknownFixer]['config']).'")' : '' - ); - } else { // Go to normal matcher if it is not a renamed rule - $matcher = new WordMatcher($availableFixers); - $alternative = $matcher->match($unknownFixer); - $message .= \sprintf( - '"%s"%s, ', - $unknownFixer, - null === $alternative ? '' : ' (did you mean "'.$alternative.'"?)' - ); - } - } - - $message = substr($message, 0, -2).'.'; - - if ($hasOldRule) { - $message .= "\nFor more info about updating see: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.0.0/UPGRADE-v3.md#renamed-ruless."; - } - - throw new InvalidConfigurationException($message); - } - - foreach ($fixers as $fixer) { - $fixerName = $fixer->getName(); - if (isset($rules[$fixerName]) && $fixer instanceof DeprecatedFixerInterface) { - $successors = $fixer->getSuccessorsNames(); - $messageEnd = [] === $successors - ? \sprintf(' and will be removed in version %d.0.', Application::getMajorVersion() + 1) - : \sprintf('. Use %s instead.', str_replace('`', '"', Utils::naturalLanguageJoinWithBackticks($successors))); - - Utils::triggerDeprecation(new \RuntimeException("Rule \"{$fixerName}\" is deprecated{$messageEnd}")); - } - } - } - - /** - * Apply path on config instance. - * - * @return iterable<\SplFileInfo> - */ - private function resolveFinder(): iterable - { - $this->configFinderIsOverridden = false; - - if ($this->isStdIn()) { - return new \ArrayIterator([new StdinFileInfo()]); - } - - $modes = [self::PATH_MODE_OVERRIDE, self::PATH_MODE_INTERSECTION]; - - if (!\in_array( - $this->options['path-mode'], - $modes, - true - )) { - throw new InvalidConfigurationException(\sprintf( - 'The path-mode "%s" is not defined, supported are %s.', - $this->options['path-mode'], - Utils::naturalLanguageJoin($modes) - )); - } - - $isIntersectionPathMode = self::PATH_MODE_INTERSECTION === $this->options['path-mode']; - - $paths = array_map( - static fn (string $path) => realpath($path), - $this->getPath() - ); - - if (0 === \count($paths)) { - if ($isIntersectionPathMode) { - return new \ArrayIterator([]); - } - - return $this->iterableToTraversable($this->getConfig()->getFinder()); - } - - $pathsByType = [ - 'file' => [], - 'dir' => [], - ]; - - foreach ($paths as $path) { - if (is_file($path)) { - $pathsByType['file'][] = $path; - } else { - $pathsByType['dir'][] = $path.\DIRECTORY_SEPARATOR; - } - } - - $nestedFinder = null; - $currentFinder = $this->iterableToTraversable($this->getConfig()->getFinder()); - - try { - $nestedFinder = $currentFinder instanceof \IteratorAggregate ? $currentFinder->getIterator() : $currentFinder; - } catch (\Exception $e) { - } - - if ($isIntersectionPathMode) { - if (null === $nestedFinder) { - throw new InvalidConfigurationException( - 'Cannot create intersection with not-fully defined Finder in configuration file.' - ); - } - - return new \CallbackFilterIterator( - new \IteratorIterator($nestedFinder), - static function (\SplFileInfo $current) use ($pathsByType): bool { - $currentRealPath = $current->getRealPath(); - - if (\in_array($currentRealPath, $pathsByType['file'], true)) { - return true; - } - - foreach ($pathsByType['dir'] as $path) { - if (str_starts_with($currentRealPath, $path)) { - return true; - } - } - - return false; - } - ); - } - - if (null !== $this->getConfigFile() && null !== $nestedFinder) { - $this->configFinderIsOverridden = true; - } - - if ($currentFinder instanceof SymfonyFinder && null === $nestedFinder) { - // finder from configuration Symfony finder and it is not fully defined, we may fulfill it - return $currentFinder->in($pathsByType['dir'])->append($pathsByType['file']); - } - - return Finder::create()->in($pathsByType['dir'])->append($pathsByType['file']); - } - - /** - * Set option that will be resolved. - * - * @param mixed $value - */ - private function setOption(string $name, $value): void - { - if (!\array_key_exists($name, $this->options)) { - throw new InvalidConfigurationException(\sprintf('Unknown option name: "%s".', $name)); - } - - $this->options[$name] = $value; - } - - private function resolveOptionBooleanValue(string $optionName): bool - { - $value = $this->options[$optionName]; - - if (!\is_string($value)) { - throw new InvalidConfigurationException(\sprintf('Expected boolean or string value for option "%s".', $optionName)); - } - - if ('yes' === $value) { - return true; - } - - if ('no' === $value) { - return false; - } - - throw new InvalidConfigurationException(\sprintf('Expected "yes" or "no" for option "%s", got "%s".', $optionName, $value)); - } - - private static function separatedContextLessInclude(string $path): ConfigInterface - { - $config = include $path; - - // verify that the config has an instance of Config - if (!$config instanceof ConfigInterface) { - throw new InvalidConfigurationException(\sprintf('The config file: "%s" does not return a "PhpCsFixer\ConfigInterface" instance. Got: "%s".', $path, \is_object($config) ? \get_class($config) : \gettype($config))); - } - - return $config; - } - - private function isCachingAllowedForRuntime(): bool - { - return $this->toolInfo->isInstalledAsPhar() - || $this->toolInfo->isInstalledByComposer() - || $this->toolInfo->isRunInsideDocker() - || filter_var(getenv('PHP_CS_FIXER_ENFORCE_CACHE'), FILTER_VALIDATE_BOOL); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php deleted file mode 100644 index b51c8ae5..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php +++ /dev/null @@ -1,155 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Output; - -use PhpCsFixer\Differ\DiffConsoleFormatter; -use PhpCsFixer\Error\Error; -use PhpCsFixer\Linter\LintingException; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @readonly - * - * @internal - */ -final class ErrorOutput -{ - private OutputInterface $output; - - private bool $isDecorated; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - $this->isDecorated = $output->isDecorated(); - } - - /** - * @param list $errors - */ - public function listErrors(string $process, array $errors): void - { - $this->output->writeln(['', \sprintf( - 'Files that were not fixed due to errors reported during %s:', - $process - )]); - - $showDetails = $this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE; - $showTrace = $this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG; - foreach ($errors as $i => $error) { - $this->output->writeln(\sprintf('%4d) %s', $i + 1, $error->getFilePath())); - $e = $error->getSource(); - if (!$showDetails || null === $e) { - continue; - } - - $class = \sprintf('[%s]', \get_class($e)); - $message = $e->getMessage(); - $code = $e->getCode(); - if (0 !== $code) { - $message .= " ({$code})"; - } - - $length = max(\strlen($class), \strlen($message)); - $lines = [ - '', - $class, - $message, - '', - ]; - - $this->output->writeln(''); - - foreach ($lines as $line) { - if (\strlen($line) < $length) { - $line .= str_repeat(' ', $length - \strlen($line)); - } - - $this->output->writeln(\sprintf(' %s ', $this->prepareOutput($line))); - } - - if ($showTrace && !$e instanceof LintingException) { // stack trace of lint exception is of no interest - $this->output->writeln(''); - $stackTrace = $e->getTrace(); - foreach ($stackTrace as $trace) { - if (isset($trace['class']) && Command::class === $trace['class'] && 'run' === $trace['function']) { - $this->output->writeln(' [ ... ]'); - - break; - } - - $this->outputTrace($trace); - } - } - - if (Error::TYPE_LINT === $error->getType() && 0 < \count($error->getAppliedFixers())) { - $this->output->writeln(''); - $this->output->writeln(\sprintf(' Applied fixers: %s', implode(', ', $error->getAppliedFixers()))); - - $diff = $error->getDiff(); - if (null !== $diff) { - $diffFormatter = new DiffConsoleFormatter( - $this->isDecorated, - \sprintf( - ' ---------- begin diff ----------%s%%s%s ----------- end diff -----------', - PHP_EOL, - PHP_EOL - ) - ); - - $this->output->writeln($diffFormatter->format($diff)); - } - } - } - } - - /** - * @param array{ - * function?: string, - * line?: int, - * file?: string, - * class?: class-string, - * type?: '::'|'->', - * args?: mixed[], - * object?: object, - * } $trace - */ - private function outputTrace(array $trace): void - { - if (isset($trace['class'], $trace['type'], $trace['function'])) { - $this->output->writeln(\sprintf( - ' %s%s%s()', - $this->prepareOutput($trace['class']), - $this->prepareOutput($trace['type']), - $this->prepareOutput($trace['function']) - )); - } elseif (isset($trace['function'])) { - $this->output->writeln(\sprintf(' %s()', $this->prepareOutput($trace['function']))); - } - - if (isset($trace['file'])) { - $this->output->writeln(\sprintf(' in %s at line %d', $this->prepareOutput($trace['file']), $trace['line'])); - } - } - - private function prepareOutput(string $string): string - { - return $this->isDecorated - ? OutputFormatter::escape($string) - : $string; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php deleted file mode 100644 index 60ff2611..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php +++ /dev/null @@ -1,54 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Output; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @readonly - * - * @internal - */ -final class OutputContext -{ - private ?OutputInterface $output; - private int $terminalWidth; - private int $filesCount; - - public function __construct( - ?OutputInterface $output, - int $terminalWidth, - int $filesCount - ) { - $this->output = $output; - $this->terminalWidth = $terminalWidth; - $this->filesCount = $filesCount; - } - - public function getOutput(): ?OutputInterface - { - return $this->output; - } - - public function getTerminalWidth(): int - { - return $this->terminalWidth; - } - - public function getFilesCount(): int - { - return $this->filesCount; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php deleted file mode 100644 index e2821146..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php +++ /dev/null @@ -1,124 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Output\Progress; - -use PhpCsFixer\Console\Output\OutputContext; -use PhpCsFixer\Runner\Event\FileProcessed; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Output writer to show the progress of a FixCommand using dots and meaningful letters. - * - * @internal - */ -final class DotsOutput implements ProgressOutputInterface -{ - /** - * File statuses map. - * - * @var array - */ - private const EVENT_STATUS_MAP = [ - FileProcessed::STATUS_NO_CHANGES => ['symbol' => '.', 'format' => '%s', 'description' => 'no changes'], - FileProcessed::STATUS_FIXED => ['symbol' => 'F', 'format' => '%s', 'description' => 'fixed'], - FileProcessed::STATUS_SKIPPED => ['symbol' => 'S', 'format' => '%s', 'description' => 'skipped (cached or empty file)'], - FileProcessed::STATUS_INVALID => ['symbol' => 'I', 'format' => '%s', 'description' => 'invalid file syntax (file ignored)'], - FileProcessed::STATUS_EXCEPTION => ['symbol' => 'E', 'format' => '%s', 'description' => 'error'], - FileProcessed::STATUS_LINT => ['symbol' => 'E', 'format' => '%s', 'description' => 'error'], - ]; - - /** @readonly */ - private OutputContext $context; - - private int $processedFiles = 0; - - private int $symbolsPerLine; - - public function __construct(OutputContext $context) - { - $this->context = $context; - - // max number of characters per line - // - total length x 2 (e.g. " 1 / 123" => 6 digits and padding spaces) - // - 11 (extra spaces, parentheses and percentage characters, e.g. " x / x (100%)") - $this->symbolsPerLine = max(1, $context->getTerminalWidth() - \strlen((string) $context->getFilesCount()) * 2 - 11); - } - - /** - * This class is not intended to be serialized, - * and cannot be deserialized (see __wakeup method). - */ - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.self::class); - } - - /** - * Disable the deserialization of the class to prevent attacker executing - * code by leveraging the __destruct method. - * - * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection - */ - public function __wakeup(): void - { - throw new \BadMethodCallException('Cannot unserialize '.self::class); - } - - public function onFixerFileProcessed(FileProcessed $event): void - { - $status = self::EVENT_STATUS_MAP[$event->getStatus()]; - $this->getOutput()->write($this->getOutput()->isDecorated() ? \sprintf($status['format'], $status['symbol']) : $status['symbol']); - - ++$this->processedFiles; - - $symbolsOnCurrentLine = $this->processedFiles % $this->symbolsPerLine; - $isLast = $this->processedFiles === $this->context->getFilesCount(); - - if (0 === $symbolsOnCurrentLine || $isLast) { - $this->getOutput()->write(\sprintf( - '%s %'.\strlen((string) $this->context->getFilesCount()).'d / %d (%3d%%)', - $isLast && 0 !== $symbolsOnCurrentLine ? str_repeat(' ', $this->symbolsPerLine - $symbolsOnCurrentLine) : '', - $this->processedFiles, - $this->context->getFilesCount(), - round($this->processedFiles / $this->context->getFilesCount() * 100) - )); - - if (!$isLast) { - $this->getOutput()->writeln(''); - } - } - } - - public function printLegend(): void - { - $symbols = []; - - foreach (self::EVENT_STATUS_MAP as $status) { - $symbol = $status['symbol']; - if (isset($symbols[$symbol])) { - continue; - } - - $symbols[$symbol] = \sprintf('%s-%s', $this->getOutput()->isDecorated() ? \sprintf($status['format'], $symbol) : $symbol, $status['description']); - } - - $this->getOutput()->write(\sprintf("\nLegend: %s\n", implode(', ', $symbols))); - } - - private function getOutput(): OutputInterface - { - return $this->context->getOutput(); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php deleted file mode 100644 index 497ea8b0..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php +++ /dev/null @@ -1,29 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Output\Progress; - -use PhpCsFixer\Runner\Event\FileProcessed; - -/** - * @readonly - * - * @internal - */ -final class NullOutput implements ProgressOutputInterface -{ - public function printLegend(): void {} - - public function onFixerFileProcessed(FileProcessed $event): void {} -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php deleted file mode 100644 index fc320fa2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php +++ /dev/null @@ -1,78 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Output\Progress; - -use PhpCsFixer\Console\Output\OutputContext; -use PhpCsFixer\Runner\Event\FileProcessed; -use Symfony\Component\Console\Helper\ProgressBar; - -/** - * Output writer to show the progress of a FixCommand using progress bar (percentage). - * - * @readonly - * - * @internal - */ -final class PercentageBarOutput implements ProgressOutputInterface -{ - /** @readonly */ - private OutputContext $context; - - private ProgressBar $progressBar; - - public function __construct(OutputContext $context) - { - $this->context = $context; - - $this->progressBar = new ProgressBar($context->getOutput(), $this->context->getFilesCount()); - $this->progressBar->setBarCharacter('▓'); // dark shade character \u2593 - $this->progressBar->setEmptyBarCharacter('░'); // light shade character \u2591 - $this->progressBar->setProgressCharacter(''); - $this->progressBar->setFormat('normal'); - - $this->progressBar->start(); - } - - /** - * This class is not intended to be serialized, - * and cannot be deserialized (see __wakeup method). - */ - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.self::class); - } - - /** - * Disable the deserialization of the class to prevent attacker executing - * code by leveraging the __destruct method. - * - * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection - */ - public function __wakeup(): void - { - throw new \BadMethodCallException('Cannot unserialize '.self::class); - } - - public function onFixerFileProcessed(FileProcessed $event): void - { - $this->progressBar->advance(1); - - if ($this->progressBar->getProgress() === $this->progressBar->getMaxSteps()) { - $this->context->getOutput()->write("\n\n"); - } - } - - public function printLegend(): void {} -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php deleted file mode 100644 index a1474aea..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php +++ /dev/null @@ -1,63 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Output\Progress; - -use PhpCsFixer\Console\Output\OutputContext; - -/** - * @readonly - * - * @internal - */ -final class ProgressOutputFactory -{ - /** - * @var array> - */ - private const OUTPUT_TYPE_MAP = [ - ProgressOutputType::NONE => NullOutput::class, - ProgressOutputType::DOTS => DotsOutput::class, - ProgressOutputType::BAR => PercentageBarOutput::class, - ]; - - /** - * @param ProgressOutputType::* $outputType - */ - public function create(string $outputType, OutputContext $context): ProgressOutputInterface - { - if (null === $context->getOutput()) { - $outputType = ProgressOutputType::NONE; - } - - if (!$this->isBuiltInType($outputType)) { - throw new \InvalidArgumentException( - \sprintf( - 'Something went wrong, "%s" output type is not supported', - $outputType - ) - ); - } - - $outputClass = self::OUTPUT_TYPE_MAP[$outputType]; - - // @phpstan-ignore-next-line new.noConstructor - return new $outputClass($context); - } - - private function isBuiltInType(string $outputType): bool - { - return \in_array($outputType, ProgressOutputType::all(), true); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php deleted file mode 100644 index 48881e65..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Output\Progress; - -use PhpCsFixer\Runner\Event\FileProcessed; - -/** - * @internal - */ -interface ProgressOutputInterface -{ - public function printLegend(): void; - - public function onFixerFileProcessed(FileProcessed $event): void; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php deleted file mode 100644 index 6f427a46..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php +++ /dev/null @@ -1,37 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Output\Progress; - -/** - * @internal - */ -final class ProgressOutputType -{ - public const NONE = 'none'; - public const DOTS = 'dots'; - public const BAR = 'bar'; - - /** - * @return list - */ - public static function all(): array - { - return [ - self::BAR, - self::DOTS, - self::NONE, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php deleted file mode 100644 index 79806d1f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php +++ /dev/null @@ -1,71 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\FixReport; - -use PhpCsFixer\Console\Application; -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * @author Kévin Gomez - * - * @readonly - * - * @internal - */ -final class CheckstyleReporter implements ReporterInterface -{ - public function getFormat(): string - { - return 'checkstyle'; - } - - public function generate(ReportSummary $reportSummary): string - { - if (!\extension_loaded('dom')) { - throw new \RuntimeException('Cannot generate report! `ext-dom` is not available!'); - } - - $dom = new \DOMDocument('1.0', 'UTF-8'); - - /** @var \DOMElement $checkstyles */ - $checkstyles = $dom->appendChild($dom->createElement('checkstyle')); - $checkstyles->setAttribute('version', Application::getAbout()); - - foreach ($reportSummary->getChanged() as $filePath => $fixResult) { - /** @var \DOMElement $file */ - $file = $checkstyles->appendChild($dom->createElement('file')); - $file->setAttribute('name', $filePath); - - foreach ($fixResult['appliedFixers'] as $appliedFixer) { - $error = $this->createError($dom, $appliedFixer); - $file->appendChild($error); - } - } - - $dom->formatOutput = true; - - return $reportSummary->isDecoratedOutput() ? OutputFormatter::escape($dom->saveXML()) : $dom->saveXML(); - } - - private function createError(\DOMDocument $dom, string $appliedFixer): \DOMElement - { - $error = $dom->createElement('error'); - $error->setAttribute('severity', 'warning'); - $error->setAttribute('source', 'PHP-CS-Fixer.'.$appliedFixer); - $error->setAttribute('message', 'Found violation(s) of type: '.$appliedFixer); - - return $error; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php deleted file mode 100644 index 3061b6fc..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php +++ /dev/null @@ -1,96 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\FixReport; - -use PhpCsFixer\Console\Application; -use SebastianBergmann\Diff\Chunk; -use SebastianBergmann\Diff\Diff; -use SebastianBergmann\Diff\Parser; -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * Generates a report according to gitlabs subset of codeclimate json files. - * - * @see https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#data-types - * - * @author Hans-Christian Otto - * - * @readonly - * - * @internal - */ -final class GitlabReporter implements ReporterInterface -{ - private Parser $diffParser; - - public function __construct() - { - $this->diffParser = new Parser(); - } - - public function getFormat(): string - { - return 'gitlab'; - } - - /** - * Process changed files array. Returns generated report. - */ - public function generate(ReportSummary $reportSummary): string - { - $about = Application::getAbout(); - - $report = []; - foreach ($reportSummary->getChanged() as $fileName => $change) { - foreach ($change['appliedFixers'] as $fixerName) { - $report[] = [ - 'check_name' => 'PHP-CS-Fixer.'.$fixerName, - 'description' => 'PHP-CS-Fixer.'.$fixerName.' by '.$about, - 'categories' => ['Style'], - 'fingerprint' => md5($fileName.$fixerName), - 'severity' => 'minor', - 'location' => [ - 'path' => $fileName, - 'lines' => self::getLines($this->diffParser->parse($change['diff'])), - ], - ]; - } - } - - $jsonString = json_encode($report, JSON_THROW_ON_ERROR); - - return $reportSummary->isDecoratedOutput() ? OutputFormatter::escape($jsonString) : $jsonString; - } - - /** - * @param list $diffs - * - * @return array{begin: int, end: int} - */ - private static function getLines(array $diffs): array - { - if (isset($diffs[0])) { - $firstDiff = $diffs[0]; - - $firstChunk = \Closure::bind(static fn (Diff $diff) => array_shift($diff->chunks), null, $firstDiff)($firstDiff); - - if ($firstChunk instanceof Chunk) { - return \Closure::bind(static fn (Chunk $chunk): array => ['begin' => $chunk->start, 'end' => $chunk->startRange], null, $firstChunk)($firstChunk); - } - } - - return ['begin' => 0, 'end' => 0]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php deleted file mode 100644 index 49ea9e30..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php +++ /dev/null @@ -1,65 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\FixReport; - -use PhpCsFixer\Console\Application; -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * @author Boris Gorbylev - * - * @readonly - * - * @internal - */ -final class JsonReporter implements ReporterInterface -{ - public function getFormat(): string - { - return 'json'; - } - - public function generate(ReportSummary $reportSummary): string - { - $jsonFiles = []; - - foreach ($reportSummary->getChanged() as $file => $fixResult) { - $jsonFile = ['name' => $file]; - - if ($reportSummary->shouldAddAppliedFixers()) { - $jsonFile['appliedFixers'] = $fixResult['appliedFixers']; - } - - if ('' !== $fixResult['diff']) { - $jsonFile['diff'] = $fixResult['diff']; - } - - $jsonFiles[] = $jsonFile; - } - - $json = [ - 'about' => Application::getAbout(), - 'files' => $jsonFiles, - 'time' => [ - 'total' => round($reportSummary->getTime() / 1_000, 3), - ], - 'memory' => round($reportSummary->getMemory() / 1_024 / 1_024, 3), - ]; - - $json = json_encode($json, JSON_THROW_ON_ERROR); - - return $reportSummary->isDecoratedOutput() ? OutputFormatter::escape($json) : $json; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php deleted file mode 100644 index 2017a0d7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php +++ /dev/null @@ -1,145 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\FixReport; - -use PhpCsFixer\Console\Application; -use PhpCsFixer\Preg; -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * @author Boris Gorbylev - * - * @readonly - * - * @internal - */ -final class JunitReporter implements ReporterInterface -{ - public function getFormat(): string - { - return 'junit'; - } - - public function generate(ReportSummary $reportSummary): string - { - if (!\extension_loaded('dom')) { - throw new \RuntimeException('Cannot generate report! `ext-dom` is not available!'); - } - - $dom = new \DOMDocument('1.0', 'UTF-8'); - $testsuites = $dom->appendChild($dom->createElement('testsuites')); - - /** @var \DOMElement $testsuite */ - $testsuite = $testsuites->appendChild($dom->createElement('testsuite')); - $testsuite->setAttribute('name', 'PHP CS Fixer'); - - $properties = $dom->createElement('properties'); - $property = $dom->createElement('property'); - $property->setAttribute('name', 'about'); - $property->setAttribute('value', Application::getAbout()); - $properties->appendChild($property); - $testsuite->appendChild($properties); - - if (\count($reportSummary->getChanged()) > 0) { - $this->createFailedTestCases($dom, $testsuite, $reportSummary); - } else { - $this->createSuccessTestCase($dom, $testsuite); - } - - if ($reportSummary->getTime() > 0) { - $testsuite->setAttribute( - 'time', - \sprintf( - '%.3f', - $reportSummary->getTime() / 1_000 - ) - ); - } - - $dom->formatOutput = true; - - return $reportSummary->isDecoratedOutput() ? OutputFormatter::escape($dom->saveXML()) : $dom->saveXML(); - } - - private function createSuccessTestCase(\DOMDocument $dom, \DOMElement $testsuite): void - { - $testcase = $dom->createElement('testcase'); - $testcase->setAttribute('name', 'All OK'); - $testcase->setAttribute('assertions', '1'); - - $testsuite->appendChild($testcase); - $testsuite->setAttribute('tests', '1'); - $testsuite->setAttribute('assertions', '1'); - $testsuite->setAttribute('failures', '0'); - $testsuite->setAttribute('errors', '0'); - } - - private function createFailedTestCases(\DOMDocument $dom, \DOMElement $testsuite, ReportSummary $reportSummary): void - { - $assertionsCount = 0; - foreach ($reportSummary->getChanged() as $file => $fixResult) { - $testcase = $this->createFailedTestCase( - $dom, - $file, - $fixResult, - $reportSummary->shouldAddAppliedFixers() - ); - $testsuite->appendChild($testcase); - $assertionsCount += (int) $testcase->getAttribute('assertions'); - } - - $testsuite->setAttribute('tests', (string) \count($reportSummary->getChanged())); - $testsuite->setAttribute('assertions', (string) $assertionsCount); - $testsuite->setAttribute('failures', (string) $assertionsCount); - $testsuite->setAttribute('errors', '0'); - } - - /** - * @param array{appliedFixers: list, diff: string} $fixResult - */ - private function createFailedTestCase(\DOMDocument $dom, string $file, array $fixResult, bool $shouldAddAppliedFixers): \DOMElement - { - $appliedFixersCount = \count($fixResult['appliedFixers']); - - $testName = str_replace('.', '_DOT_', Preg::replace('@\.'.pathinfo($file, PATHINFO_EXTENSION).'$@', '', $file)); - - $testcase = $dom->createElement('testcase'); - $testcase->setAttribute('name', $testName); - $testcase->setAttribute('file', $file); - $testcase->setAttribute('assertions', (string) $appliedFixersCount); - - $failure = $dom->createElement('failure'); - $failure->setAttribute('type', 'code_style'); - $testcase->appendChild($failure); - - if ($shouldAddAppliedFixers) { - $failureContent = "applied fixers:\n---------------\n"; - - foreach ($fixResult['appliedFixers'] as $appliedFixer) { - $failureContent .= "* {$appliedFixer}\n"; - } - } else { - $failureContent = "Wrong code style\n"; - } - - if ('' !== $fixResult['diff']) { - $failureContent .= "\nDiff:\n---------------\n\n".$fixResult['diff']; - } - - $failure->appendChild($dom->createCDATASection(trim($failureContent))); - - return $testcase; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php deleted file mode 100644 index 231ddeae..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php +++ /dev/null @@ -1,103 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\FixReport; - -/** - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class ReportSummary -{ - /** - * @var array, diff: string}> - */ - private array $changed; - - private int $filesCount; - - private int $time; - - private int $memory; - - private bool $addAppliedFixers; - - private bool $isDryRun; - - private bool $isDecoratedOutput; - - /** - * @param array, diff: string}> $changed - * @param int $time duration in milliseconds - * @param int $memory memory usage in bytes - */ - public function __construct( - array $changed, - int $filesCount, - int $time, - int $memory, - bool $addAppliedFixers, - bool $isDryRun, - bool $isDecoratedOutput - ) { - $this->changed = $changed; - $this->filesCount = $filesCount; - $this->time = $time; - $this->memory = $memory; - $this->addAppliedFixers = $addAppliedFixers; - $this->isDryRun = $isDryRun; - $this->isDecoratedOutput = $isDecoratedOutput; - } - - public function isDecoratedOutput(): bool - { - return $this->isDecoratedOutput; - } - - public function isDryRun(): bool - { - return $this->isDryRun; - } - - /** - * @return array, diff: string}> - */ - public function getChanged(): array - { - return $this->changed; - } - - public function getMemory(): int - { - return $this->memory; - } - - public function getTime(): int - { - return $this->time; - } - - public function getFilesCount(): int - { - return $this->filesCount; - } - - public function shouldAddAppliedFixers(): bool - { - return $this->addAppliedFixers; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php deleted file mode 100644 index 1b2d8122..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php +++ /dev/null @@ -1,90 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\FixReport; - -use Symfony\Component\Finder\Finder as SymfonyFinder; - -/** - * @author Boris Gorbylev - * - * @internal - */ -final class ReporterFactory -{ - /** @var array */ - private array $reporters = []; - - public function registerBuiltInReporters(): self - { - /** @var null|list $builtInReporters */ - static $builtInReporters; - - if (null === $builtInReporters) { - $builtInReporters = []; - - foreach (SymfonyFinder::create()->files()->name('*Reporter.php')->in(__DIR__) as $file) { - $relativeNamespace = $file->getRelativePath(); - $builtInReporters[] = \sprintf( - '%s\%s%s', - __NAMESPACE__, - '' !== $relativeNamespace ? $relativeNamespace.'\\' : '', - $file->getBasename('.php') - ); - } - } - - foreach ($builtInReporters as $reporterClass) { - $this->registerReporter(new $reporterClass()); - } - - return $this; - } - - /** - * @return $this - */ - public function registerReporter(ReporterInterface $reporter): self - { - $format = $reporter->getFormat(); - - if (isset($this->reporters[$format])) { - throw new \UnexpectedValueException(\sprintf('Reporter for format "%s" is already registered.', $format)); - } - - $this->reporters[$format] = $reporter; - - return $this; - } - - /** - * @return list - */ - public function getFormats(): array - { - $formats = array_keys($this->reporters); - sort($formats); - - return $formats; - } - - public function getReporter(string $format): ReporterInterface - { - if (!isset($this->reporters[$format])) { - throw new \UnexpectedValueException(\sprintf('Reporter for format "%s" is not registered.', $format)); - } - - return $this->reporters[$format]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterInterface.php deleted file mode 100644 index 44fab560..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\FixReport; - -/** - * @author Boris Gorbylev - * - * @internal - */ -interface ReporterInterface -{ - public function getFormat(): string; - - /** - * Process changed files array. Returns generated report. - */ - public function generate(ReportSummary $reportSummary): string; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php deleted file mode 100644 index ccdeeabb..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php +++ /dev/null @@ -1,104 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\FixReport; - -use PhpCsFixer\Differ\DiffConsoleFormatter; - -/** - * @author Boris Gorbylev - * - * @readonly - * - * @internal - */ -final class TextReporter implements ReporterInterface -{ - public function getFormat(): string - { - return 'txt'; - } - - public function generate(ReportSummary $reportSummary): string - { - $output = ''; - - $identifiedFiles = 0; - foreach ($reportSummary->getChanged() as $file => $fixResult) { - ++$identifiedFiles; - $output .= \sprintf('%4d) %s', $identifiedFiles, $file); - - if ($reportSummary->shouldAddAppliedFixers()) { - $output .= $this->getAppliedFixers( - $reportSummary->isDecoratedOutput(), - $fixResult['appliedFixers'], - ); - } - - $output .= $this->getDiff($reportSummary->isDecoratedOutput(), $fixResult['diff']); - $output .= PHP_EOL; - } - - return $output.$this->getFooter( - $reportSummary->getTime(), - $identifiedFiles, - $reportSummary->getFilesCount(), - $reportSummary->getMemory(), - $reportSummary->isDryRun() - ); - } - - /** - * @param list $appliedFixers - */ - private function getAppliedFixers(bool $isDecoratedOutput, array $appliedFixers): string - { - return \sprintf( - $isDecoratedOutput ? ' (%s)' : ' (%s)', - implode(', ', $appliedFixers) - ); - } - - private function getDiff(bool $isDecoratedOutput, string $diff): string - { - if ('' === $diff) { - return ''; - } - - $diffFormatter = new DiffConsoleFormatter($isDecoratedOutput, \sprintf( - ' ---------- begin diff ----------%s%%s%s ----------- end diff -----------', - PHP_EOL, - PHP_EOL - )); - - return PHP_EOL.$diffFormatter->format($diff).PHP_EOL; - } - - private function getFooter(int $time, int $identifiedFiles, int $files, int $memory, bool $isDryRun): string - { - if (0 === $time || 0 === $memory) { - return ''; - } - - return PHP_EOL.\sprintf( - '%s %d of %d %s in %.3f seconds, %.2f MB memory used'.PHP_EOL, - $isDryRun ? 'Found' : 'Fixed', - $identifiedFiles, - $files, - $isDryRun ? 'files that can be fixed' : 'files', - $time / 1_000, - $memory / 1_024 / 1_024 - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php deleted file mode 100644 index 3914377d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php +++ /dev/null @@ -1,136 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\FixReport; - -use PhpCsFixer\Console\Application; -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * @author Boris Gorbylev - * - * @readonly - * - * @internal - */ -final class XmlReporter implements ReporterInterface -{ - public function getFormat(): string - { - return 'xml'; - } - - public function generate(ReportSummary $reportSummary): string - { - if (!\extension_loaded('dom')) { - throw new \RuntimeException('Cannot generate report! `ext-dom` is not available!'); - } - - $dom = new \DOMDocument('1.0', 'UTF-8'); - // new nodes should be added to this or existing children - $root = $dom->createElement('report'); - $dom->appendChild($root); - - $root->appendChild($this->createAboutElement($dom, Application::getAbout())); - - $filesXML = $dom->createElement('files'); - $root->appendChild($filesXML); - - $i = 1; - foreach ($reportSummary->getChanged() as $file => $fixResult) { - $fileXML = $dom->createElement('file'); - $fileXML->setAttribute('id', (string) $i++); - $fileXML->setAttribute('name', $file); - $filesXML->appendChild($fileXML); - - if ($reportSummary->shouldAddAppliedFixers()) { - $fileXML->appendChild( - $this->createAppliedFixersElement($dom, $fixResult['appliedFixers']), - ); - } - - if ('' !== $fixResult['diff']) { - $fileXML->appendChild($this->createDiffElement($dom, $fixResult['diff'])); - } - } - - if (0 !== $reportSummary->getTime()) { - $root->appendChild($this->createTimeElement($reportSummary->getTime(), $dom)); - } - - if (0 !== $reportSummary->getMemory()) { - $root->appendChild($this->createMemoryElement($reportSummary->getMemory(), $dom)); - } - - $dom->formatOutput = true; - - return $reportSummary->isDecoratedOutput() ? OutputFormatter::escape($dom->saveXML()) : $dom->saveXML(); - } - - /** - * @param list $appliedFixers - */ - private function createAppliedFixersElement(\DOMDocument $dom, array $appliedFixers): \DOMElement - { - $appliedFixersXML = $dom->createElement('applied_fixers'); - - foreach ($appliedFixers as $appliedFixer) { - $appliedFixerXML = $dom->createElement('applied_fixer'); - $appliedFixerXML->setAttribute('name', $appliedFixer); - $appliedFixersXML->appendChild($appliedFixerXML); - } - - return $appliedFixersXML; - } - - private function createDiffElement(\DOMDocument $dom, string $diff): \DOMElement - { - $diffXML = $dom->createElement('diff'); - $diffXML->appendChild($dom->createCDATASection($diff)); - - return $diffXML; - } - - private function createTimeElement(float $time, \DOMDocument $dom): \DOMElement - { - $time = round($time / 1_000, 3); - - $timeXML = $dom->createElement('time'); - $timeXML->setAttribute('unit', 's'); - $timeTotalXML = $dom->createElement('total'); - $timeTotalXML->setAttribute('value', (string) $time); - $timeXML->appendChild($timeTotalXML); - - return $timeXML; - } - - private function createMemoryElement(float $memory, \DOMDocument $dom): \DOMElement - { - $memory = round($memory / 1_024 / 1_024, 3); - - $memoryXML = $dom->createElement('memory'); - $memoryXML->setAttribute('value', (string) $memory); - $memoryXML->setAttribute('unit', 'MB'); - - return $memoryXML; - } - - private function createAboutElement(\DOMDocument $dom, string $about): \DOMElement - { - $xml = $dom->createElement('about'); - $xml->setAttribute('value', $about); - - return $xml; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php deleted file mode 100644 index 9cc1602e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php +++ /dev/null @@ -1,52 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\ListSetsReport; - -use PhpCsFixer\RuleSet\RuleSetDescriptionInterface; - -/** - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class JsonReporter implements ReporterInterface -{ - public function getFormat(): string - { - return 'json'; - } - - public function generate(ReportSummary $reportSummary): string - { - $sets = $reportSummary->getSets(); - - usort($sets, static fn (RuleSetDescriptionInterface $a, RuleSetDescriptionInterface $b): int => $a->getName() <=> $b->getName()); - - $json = ['sets' => []]; - - foreach ($sets as $set) { - $setName = $set->getName(); - $json['sets'][$setName] = [ - 'description' => $set->getDescription(), - 'isRisky' => $set->isRisky(), - 'name' => $setName, - ]; - } - - return json_encode($json, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php deleted file mode 100644 index e6ced136..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php +++ /dev/null @@ -1,48 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\ListSetsReport; - -use PhpCsFixer\RuleSet\RuleSetDescriptionInterface; - -/** - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class ReportSummary -{ - /** - * @var list - */ - private array $sets; - - /** - * @param list $sets - */ - public function __construct(array $sets) - { - $this->sets = $sets; - } - - /** - * @return list - */ - public function getSets(): array - { - return $this->sets; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php deleted file mode 100644 index ad963f6d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php +++ /dev/null @@ -1,89 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\ListSetsReport; - -use Symfony\Component\Finder\Finder as SymfonyFinder; - -/** - * @author Boris Gorbylev - * - * @internal - */ -final class ReporterFactory -{ - /** - * @var array - */ - private array $reporters = []; - - public function registerBuiltInReporters(): self - { - /** @var null|list $builtInReporters */ - static $builtInReporters; - - if (null === $builtInReporters) { - $builtInReporters = []; - - foreach (SymfonyFinder::create()->files()->name('*Reporter.php')->in(__DIR__) as $file) { - $relativeNamespace = $file->getRelativePath(); - $builtInReporters[] = \sprintf( - '%s\%s%s', - __NAMESPACE__, - '' !== $relativeNamespace ? $relativeNamespace.'\\' : '', - $file->getBasename('.php') - ); - } - } - - foreach ($builtInReporters as $reporterClass) { - $this->registerReporter(new $reporterClass()); - } - - return $this; - } - - public function registerReporter(ReporterInterface $reporter): self - { - $format = $reporter->getFormat(); - - if (isset($this->reporters[$format])) { - throw new \UnexpectedValueException(\sprintf('Reporter for format "%s" is already registered.', $format)); - } - - $this->reporters[$format] = $reporter; - - return $this; - } - - /** - * @return list - */ - public function getFormats(): array - { - $formats = array_keys($this->reporters); - sort($formats); - - return $formats; - } - - public function getReporter(string $format): ReporterInterface - { - if (!isset($this->reporters[$format])) { - throw new \UnexpectedValueException(\sprintf('Reporter for format "%s" is not registered.', $format)); - } - - return $this->reporters[$format]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterInterface.php deleted file mode 100644 index 4a03f330..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\ListSetsReport; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -interface ReporterInterface -{ - public function getFormat(): string; - - /** - * Process changed files array. Returns generated report. - */ - public function generate(ReportSummary $reportSummary): string; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php deleted file mode 100644 index 62b338df..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php +++ /dev/null @@ -1,51 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\Report\ListSetsReport; - -use PhpCsFixer\RuleSet\RuleSetDescriptionInterface; - -/** - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class TextReporter implements ReporterInterface -{ - public function getFormat(): string - { - return 'txt'; - } - - public function generate(ReportSummary $reportSummary): string - { - $sets = $reportSummary->getSets(); - - usort($sets, static fn (RuleSetDescriptionInterface $a, RuleSetDescriptionInterface $b): int => $a->getName() <=> $b->getName()); - - $output = ''; - - foreach ($sets as $i => $set) { - $output .= \sprintf('%2d) %s', $i + 1, $set->getName()).PHP_EOL.' '.$set->getDescription().PHP_EOL; - - if ($set->isRisky()) { - $output .= ' Set contains risky rules.'.PHP_EOL; - } - } - - return $output; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php deleted file mode 100644 index b6a0a279..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php +++ /dev/null @@ -1,69 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\SelfUpdate; - -/** - * @readonly - * - * @internal - */ -final class GithubClient implements GithubClientInterface -{ - private string $url; - - public function __construct(string $url = 'https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/tags') - { - $this->url = $url; - } - - public function getTags(): array - { - $result = @file_get_contents( - $this->url, - false, - stream_context_create([ - 'http' => [ - 'header' => 'User-Agent: PHP-CS-Fixer/PHP-CS-Fixer', - ], - ]) - ); - - if (false === $result) { - throw new \RuntimeException(\sprintf('Failed to load tags at "%s".', $this->url)); - } - - /** - * @var list - */ - $result = json_decode($result, true); - if (JSON_ERROR_NONE !== json_last_error()) { - throw new \RuntimeException(\sprintf( - 'Failed to read response from "%s" as JSON: %s.', - $this->url, - json_last_error_msg() - )); - } - - return array_map( - static fn (array $tagData): string => $tagData['name'], - $result - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php deleted file mode 100644 index 27728327..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\SelfUpdate; - -/** - * @internal - */ -interface GithubClientInterface -{ - /** - * @return list - */ - public function getTags(): array; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php deleted file mode 100644 index 67ed6e66..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php +++ /dev/null @@ -1,102 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\SelfUpdate; - -use Composer\Semver\Comparator; -use Composer\Semver\Semver; -use Composer\Semver\VersionParser; - -/** - * @internal - */ -final class NewVersionChecker implements NewVersionCheckerInterface -{ - private GithubClientInterface $githubClient; - - private VersionParser $versionParser; - - /** - * @var null|list - */ - private ?array $availableVersions = null; - - public function __construct(GithubClientInterface $githubClient) - { - $this->githubClient = $githubClient; - $this->versionParser = new VersionParser(); - } - - public function getLatestVersion(): string - { - $this->retrieveAvailableVersions(); - - return $this->availableVersions[0]; - } - - public function getLatestVersionOfMajor(int $majorVersion): ?string - { - $this->retrieveAvailableVersions(); - - $semverConstraint = '^'.$majorVersion; - - foreach ($this->availableVersions as $availableVersion) { - if (Semver::satisfies($availableVersion, $semverConstraint)) { - return $availableVersion; - } - } - - return null; - } - - public function compareVersions(string $versionA, string $versionB): int - { - $versionA = $this->versionParser->normalize($versionA); - $versionB = $this->versionParser->normalize($versionB); - - if (Comparator::lessThan($versionA, $versionB)) { - return -1; - } - - if (Comparator::greaterThan($versionA, $versionB)) { - return 1; - } - - return 0; - } - - private function retrieveAvailableVersions(): void - { - if (null !== $this->availableVersions) { - return; - } - - foreach ($this->githubClient->getTags() as $version) { - try { - $this->versionParser->normalize($version); - - if ('stable' === VersionParser::parseStability($version)) { - $this->availableVersions[] = $version; - } - } catch (\UnexpectedValueException $exception) { - // not a valid version tag - } - } - - $versions = Semver::rsort($this->availableVersions); - \assert(array_is_list($versions)); // Semver::rsort provides soft `array` type, let's validate and ensure proper type for SCA - - $this->availableVersions = $versions; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionCheckerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionCheckerInterface.php deleted file mode 100644 index c63b2a20..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionCheckerInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console\SelfUpdate; - -/** - * @internal - */ -interface NewVersionCheckerInterface -{ - /** - * Returns the tag of the latest version. - */ - public function getLatestVersion(): string; - - /** - * Returns the tag of the latest minor/patch version of the given major version. - */ - public function getLatestVersionOfMajor(int $majorVersion): ?string; - - /** - * Returns -1, 0, or 1 if the first version is respectively less than, - * equal to, or greater than the second. - */ - public function compareVersions(string $versionA, string $versionB): int; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php deleted file mode 100644 index 7465c2a4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Console; - -use PhpCsFixer\ToolInfo; -use PhpCsFixer\ToolInfoInterface; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class WarningsDetector -{ - private ToolInfoInterface $toolInfo; - - /** - * @var list - */ - private array $warnings = []; - - public function __construct(ToolInfoInterface $toolInfo) - { - $this->toolInfo = $toolInfo; - } - - public function detectOldMajor(): void - { - // @TODO 3.99 to be activated with new MAJOR release 4.0 - // $currentMajorVersion = \intval(explode('.', Application::VERSION)[0], 10); - // $nextMajorVersion = $currentMajorVersion + 1; - // $this->warnings[] = "You are running PHP CS Fixer v{$currentMajorVersion}, which is not maintained anymore. Please update to v{$nextMajorVersion}."; - // $this->warnings[] = "You may find an UPGRADE guide at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v{$nextMajorVersion}.0.0/UPGRADE-v{$nextMajorVersion}.md ."; - } - - public function detectOldVendor(): void - { - if ($this->toolInfo->isInstalledByComposer()) { - $details = $this->toolInfo->getComposerInstallationDetails(); - if (ToolInfo::COMPOSER_LEGACY_PACKAGE_NAME === $details['name']) { - $this->warnings[] = \sprintf( - 'You are running PHP CS Fixer installed with old vendor `%s`. Please update to `%s`.', - ToolInfo::COMPOSER_LEGACY_PACKAGE_NAME, - ToolInfo::COMPOSER_PACKAGE_NAME - ); - } - } - } - - /** - * @return list - */ - public function getWarnings(): array - { - if (0 === \count($this->warnings)) { - return []; - } - - return array_values(array_unique(array_merge( - $this->warnings, - ['If you need help while solving warnings, ask at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/, we will help you!'] - ))); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php deleted file mode 100644 index 79385bc3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php +++ /dev/null @@ -1,85 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Differ; - -use PhpCsFixer\Preg; -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class DiffConsoleFormatter -{ - private bool $isDecoratedOutput; - - private string $template; - - public function __construct(bool $isDecoratedOutput, string $template = '%s') - { - $this->isDecoratedOutput = $isDecoratedOutput; - $this->template = $template; - } - - public function format(string $diff, string $lineTemplate = '%s'): string - { - $isDecorated = $this->isDecoratedOutput; - - $template = $isDecorated - ? $this->template - : Preg::replace('/<[^<>]+>/', '', $this->template); - - return \sprintf( - $template, - implode( - PHP_EOL, - array_map( - static function (string $line) use ($isDecorated, $lineTemplate): string { - if ($isDecorated) { - $count = 0; - $line = Preg::replaceCallback( - '/^([+\-@].*)/', - static function (array $matches): string { - if ('+' === $matches[0][0]) { - $colour = 'green'; - } elseif ('-' === $matches[0][0]) { - $colour = 'red'; - } else { - $colour = 'cyan'; - } - - return \sprintf('%s', $colour, OutputFormatter::escape($matches[0]), $colour); - }, - $line, - 1, - $count - ); - - if (0 === $count) { - $line = OutputFormatter::escape($line); - } - } - - return \sprintf($lineTemplate, $line); - }, - Preg::split('#\R#u', $diff) - ) - ) - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DifferInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DifferInterface.php deleted file mode 100644 index a66f165c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/DifferInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Differ; - -/** - * @author Dariusz Rumiński - */ -interface DifferInterface -{ - /** - * Create diff. - */ - public function diff(string $old, string $new, ?\SplFileInfo $file = null): string; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php deleted file mode 100644 index 7749866c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php +++ /dev/null @@ -1,46 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Differ; - -use SebastianBergmann\Diff\Differ; -use SebastianBergmann\Diff\Output\StrictUnifiedDiffOutputBuilder; - -/** - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class FullDiffer implements DifferInterface -{ - private Differ $differ; - - public function __construct() - { - $this->differ = new Differ(new StrictUnifiedDiffOutputBuilder([ - 'collapseRanges' => false, - 'commonLineThreshold' => 100, - 'contextLines' => 100, - 'fromFile' => 'Original', - 'toFile' => 'New', - ])); - } - - public function diff(string $old, string $new, ?\SplFileInfo $file = null): string - { - return $this->differ->diff($old, $new); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/NullDiffer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/NullDiffer.php deleted file mode 100644 index cf07f9e7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/NullDiffer.php +++ /dev/null @@ -1,26 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Differ; - -/** - * @author Dariusz Rumiński - */ -final class NullDiffer implements DifferInterface -{ - public function diff(string $old, string $new, ?\SplFileInfo $file = null): string - { - return ''; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php deleted file mode 100644 index 36663aa1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php +++ /dev/null @@ -1,47 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Differ; - -use PhpCsFixer\Preg; -use SebastianBergmann\Diff\Differ; -use SebastianBergmann\Diff\Output\StrictUnifiedDiffOutputBuilder; - -final class UnifiedDiffer implements DifferInterface -{ - public function diff(string $old, string $new, ?\SplFileInfo $file = null): string - { - if (null === $file) { - $options = [ - 'fromFile' => 'Original', - 'toFile' => 'New', - ]; - } else { - $filePath = $file->getRealPath(); - - if (Preg::match('/\s/', $filePath)) { - $filePath = '"'.$filePath.'"'; - } - - $options = [ - 'fromFile' => $filePath, - 'toFile' => $filePath, - ]; - } - - $differ = new Differ(new StrictUnifiedDiffOutputBuilder($options)); - - return $differ->diff($old, $new); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php deleted file mode 100644 index c3af8adf..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php +++ /dev/null @@ -1,319 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\DocBlock; - -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; - -/** - * This represents an entire annotation from a docblock. - * - * @author Graham Campbell - * @author Dariusz Rumiński - */ -final class Annotation -{ - /** - * All the annotation tag names with types. - * - * @var list - */ - private const TAGS = [ - 'method', - 'param', - 'property', - 'property-read', - 'property-write', - 'return', - 'throws', - 'type', - 'var', - ]; - - /** - * The lines that make up the annotation. - * - * @var array - */ - private array $lines; - - /** - * The position of the first line of the annotation in the docblock. - */ - private int $start; - - /** - * The position of the last line of the annotation in the docblock. - */ - private int $end; - - /** - * The associated tag. - */ - private ?Tag $tag = null; - - /** - * Lazy loaded, cached types content. - */ - private ?string $typesContent = null; - - /** - * The cached types. - * - * @var null|list - */ - private ?array $types = null; - - private ?NamespaceAnalysis $namespace = null; - - /** - * @var list - */ - private array $namespaceUses; - - /** - * Create a new line instance. - * - * @param array $lines - * @param null|NamespaceAnalysis $namespace - * @param list $namespaceUses - */ - public function __construct(array $lines, $namespace = null, array $namespaceUses = []) - { - $this->lines = array_values($lines); - $this->namespace = $namespace; - $this->namespaceUses = $namespaceUses; - - $this->start = array_key_first($lines); - $this->end = array_key_last($lines); - } - - /** - * Get the string representation of object. - */ - public function __toString(): string - { - return $this->getContent(); - } - - /** - * Get all the annotation tag names with types. - * - * @return list - */ - public static function getTagsWithTypes(): array - { - return self::TAGS; - } - - /** - * Get the start position of this annotation. - */ - public function getStart(): int - { - return $this->start; - } - - /** - * Get the end position of this annotation. - */ - public function getEnd(): int - { - return $this->end; - } - - /** - * Get the associated tag. - */ - public function getTag(): Tag - { - if (null === $this->tag) { - $this->tag = new Tag($this->lines[0]); - } - - return $this->tag; - } - - /** - * @internal - */ - public function getTypeExpression(): ?TypeExpression - { - $typesContent = $this->getTypesContent(); - - return null === $typesContent - ? null - : new TypeExpression($typesContent, $this->namespace, $this->namespaceUses); - } - - /** - * @internal - */ - public function getVariableName(): ?string - { - $type = preg_quote($this->getTypesContent() ?? '', '/'); - $regex = \sprintf( - '/@%s\s+(%s\s*)?(&\s*)?(\.{3}\s*)?(?\$%s)(?:.*|$)/', - $this->tag->getName(), - $type, - TypeExpression::REGEX_IDENTIFIER - ); - - if (Preg::match($regex, $this->lines[0]->getContent(), $matches)) { - return $matches['variable']; - } - - return null; - } - - /** - * Get the types associated with this annotation. - * - * @return list - */ - public function getTypes(): array - { - if (null === $this->types) { - $typeExpression = $this->getTypeExpression(); - $this->types = null === $typeExpression - ? [] - : $typeExpression->getTypes(); - } - - return $this->types; - } - - /** - * Set the types associated with this annotation. - * - * @param list $types - */ - public function setTypes(array $types): void - { - $origTypesContent = $this->getTypesContent(); - $newTypesContent = implode( - // Fallback to union type is provided for backward compatibility (previously glue was set to `|` by default even when type was not composite) - // @TODO Better handling for cases where type is fixed (original type is not composite, but was made composite during fix) - $this->getTypeExpression()->getTypesGlue() ?? '|', - $types - ); - - if ($origTypesContent === $newTypesContent) { - return; - } - - $pattern = '/'.preg_quote($origTypesContent, '/').'/'; - - $this->lines[0]->setContent(Preg::replace($pattern, $newTypesContent, $this->lines[0]->getContent(), 1)); - - $this->clearCache(); - } - - /** - * Get the normalized types associated with this annotation, so they can easily be compared. - * - * @return list - */ - public function getNormalizedTypes(): array - { - $typeExpression = $this->getTypeExpression(); - if (null === $typeExpression) { - return []; - } - - $normalizedTypeExpression = $typeExpression - ->mapTypes(static fn (TypeExpression $v) => new TypeExpression(strtolower($v->toString()), null, [])) - ->sortTypes(static fn (TypeExpression $a, TypeExpression $b) => $a->toString() <=> $b->toString()) - ; - - return $normalizedTypeExpression->getTypes(); - } - - /** - * Remove this annotation by removing all its lines. - */ - public function remove(): void - { - foreach ($this->lines as $line) { - if ($line->isTheStart() && $line->isTheEnd()) { - // Single line doc block, remove entirely - $line->remove(); - } elseif ($line->isTheStart()) { - // Multi line doc block, but start is on the same line as the first annotation, keep only the start - $content = Preg::replace('#(\s*/\*\*).*#', '$1', $line->getContent()); - - $line->setContent($content); - } elseif ($line->isTheEnd()) { - // Multi line doc block, but end is on the same line as the last annotation, keep only the end - $content = Preg::replace('#(\s*)\S.*(\*/.*)#', '$1$2', $line->getContent()); - - $line->setContent($content); - } else { - // Multi line doc block, neither start nor end on this line, can be removed safely - $line->remove(); - } - } - - $this->clearCache(); - } - - /** - * Get the annotation content. - */ - public function getContent(): string - { - return implode('', $this->lines); - } - - public function supportTypes(): bool - { - return \in_array($this->getTag()->getName(), self::TAGS, true); - } - - /** - * Get the current types content. - * - * Be careful modifying the underlying line as that won't flush the cache. - */ - private function getTypesContent(): ?string - { - if (null === $this->typesContent) { - $name = $this->getTag()->getName(); - - if (!$this->supportTypes()) { - throw new \RuntimeException('This tag does not support types.'); - } - - $matchingResult = Preg::match( - '{^(?:\h*\*|/\*\*)[\h*]*@'.$name.'\h+'.TypeExpression::REGEX_TYPES.'(?:(?:[*\h\v]|\&?[\.\$]).*)?\r?$}is', - $this->lines[0]->getContent(), - $matches - ); - - $this->typesContent = $matchingResult - ? $matches['types'] - : null; - } - - return $this->typesContent; - } - - private function clearCache(): void - { - $this->types = null; - $this->typesContent = null; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php deleted file mode 100644 index b4ae53e2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php +++ /dev/null @@ -1,250 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\DocBlock; - -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; - -/** - * This class represents a docblock. - * - * It internally splits it up into "lines" that we can manipulate. - * - * @author Graham Campbell - */ -final class DocBlock -{ - /** - * @var list - */ - private array $lines = []; - - /** - * @var null|list - */ - private ?array $annotations = null; - - private ?NamespaceAnalysis $namespace; - - /** - * @var list - */ - private array $namespaceUses; - - /** - * @param list $namespaceUses - */ - public function __construct(string $content, ?NamespaceAnalysis $namespace = null, array $namespaceUses = []) - { - foreach (Preg::split('/([^\n\r]+\R*)/', $content, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $line) { - $this->lines[] = new Line($line); - } - - $this->namespace = $namespace; - $this->namespaceUses = $namespaceUses; - } - - public function __toString(): string - { - return $this->getContent(); - } - - /** - * Get this docblock's lines. - * - * @return list - */ - public function getLines(): array - { - return $this->lines; - } - - /** - * Get a single line. - */ - public function getLine(int $pos): ?Line - { - return $this->lines[$pos] ?? null; - } - - /** - * Get this docblock's annotations. - * - * @return list - */ - public function getAnnotations(): array - { - if (null !== $this->annotations) { - return $this->annotations; - } - - $this->annotations = []; - $total = \count($this->lines); - - for ($index = 0; $index < $total; ++$index) { - if ($this->lines[$index]->containsATag()) { - // get all the lines that make up the annotation - $lines = \array_slice($this->lines, $index, $this->findAnnotationLength($index), true); - $annotation = new Annotation($lines, $this->namespace, $this->namespaceUses); - // move the index to the end of the annotation to avoid - // checking it again because we know the lines inside the - // current annotation cannot be part of another annotation - $index = $annotation->getEnd(); - // add the current annotation to the list of annotations - $this->annotations[] = $annotation; - } - } - - return $this->annotations; - } - - public function isMultiLine(): bool - { - return 1 !== \count($this->lines); - } - - /** - * Take a one line doc block, and turn it into a multi line doc block. - */ - public function makeMultiLine(string $indent, string $lineEnd): void - { - if ($this->isMultiLine()) { - return; - } - - $lineContent = $this->getSingleLineDocBlockEntry($this->lines[0]); - - if ('' === $lineContent) { - $this->lines = [ - new Line('/**'.$lineEnd), - new Line($indent.' *'.$lineEnd), - new Line($indent.' */'), - ]; - - return; - } - - $this->lines = [ - new Line('/**'.$lineEnd), - new Line($indent.' * '.$lineContent.$lineEnd), - new Line($indent.' */'), - ]; - } - - public function makeSingleLine(): void - { - if (!$this->isMultiLine()) { - return; - } - - $usefulLines = array_filter( - $this->lines, - static fn (Line $line): bool => $line->containsUsefulContent() - ); - - if (1 < \count($usefulLines)) { - return; - } - - $lineContent = ''; - if (\count($usefulLines) > 0) { - $lineContent = $this->getSingleLineDocBlockEntry(array_shift($usefulLines)); - } - - $this->lines = [new Line('/** '.$lineContent.' */')]; - } - - public function getAnnotation(int $pos): ?Annotation - { - $annotations = $this->getAnnotations(); - - return $annotations[$pos] ?? null; - } - - /** - * Get specific types of annotations only. - * - * @param list|string $types - * - * @return list - */ - public function getAnnotationsOfType($types): array - { - $typesToSearchFor = (array) $types; - - $annotations = []; - - foreach ($this->getAnnotations() as $annotation) { - $tagName = $annotation->getTag()->getName(); - if (\in_array($tagName, $typesToSearchFor, true)) { - $annotations[] = $annotation; - } - } - - return $annotations; - } - - /** - * Get the actual content of this docblock. - */ - public function getContent(): string - { - return implode('', $this->lines); - } - - private function findAnnotationLength(int $start): int - { - $index = $start; - - while ($line = $this->getLine(++$index)) { - if ($line->containsATag()) { - // we've 100% reached the end of the description if we get here - break; - } - - if (!$line->containsUsefulContent()) { - // if next line is also non-useful, or contains a tag, then we're done here - $next = $this->getLine($index + 1); - if (null === $next || !$next->containsUsefulContent() || $next->containsATag()) { - break; - } - // otherwise, continue, the annotation must have contained a blank line in its description - } - } - - return $index - $start; - } - - private function getSingleLineDocBlockEntry(Line $line): string - { - $lineString = $line->getContent(); - - if ('' === $lineString) { - return $lineString; - } - - $lineString = str_replace('*/', '', $lineString); - $lineString = trim($lineString); - - if (str_starts_with($lineString, '/**')) { - $lineString = substr($lineString, 3); - } elseif (str_starts_with($lineString, '*')) { - $lineString = substr($lineString, 1); - } - - return trim($lineString); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php deleted file mode 100644 index 9ef4a087..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php +++ /dev/null @@ -1,128 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\DocBlock; - -use PhpCsFixer\Preg; - -/** - * This represents a line of a docblock. - * - * @author Graham Campbell - */ -final class Line -{ - /** - * The content of this line. - */ - private string $content; - - /** - * Create a new line instance. - */ - public function __construct(string $content) - { - $this->content = $content; - } - - /** - * Get the string representation of object. - */ - public function __toString(): string - { - return $this->content; - } - - /** - * Get the content of this line. - */ - public function getContent(): string - { - return $this->content; - } - - /** - * Does this line contain useful content? - * - * If the line contains text or tags, then this is true. - */ - public function containsUsefulContent(): bool - { - return Preg::match('/\*\s*\S+/', $this->content) && '' !== trim(str_replace(['/', '*'], ' ', $this->content)); - } - - /** - * Does the line contain a tag? - * - * If this is true, then it must be the first line of an annotation. - */ - public function containsATag(): bool - { - return Preg::match('/\*\s*@/', $this->content); - } - - /** - * Is the line the start of a docblock? - */ - public function isTheStart(): bool - { - return str_contains($this->content, '/**'); - } - - /** - * Is the line the end of a docblock? - */ - public function isTheEnd(): bool - { - return str_contains($this->content, '*/'); - } - - /** - * Set the content of this line. - */ - public function setContent(string $content): void - { - $this->content = $content; - } - - /** - * Remove this line by clearing its contents. - * - * Note that this method technically brakes the internal state of the - * docblock, but is useful when we need to retain the indices of lines - * during the execution of an algorithm. - */ - public function remove(): void - { - $this->content = ''; - } - - /** - * Append a blank docblock line to this line's contents. - * - * Note that this method technically brakes the internal state of the - * docblock, but is useful when we need to retain the indices of lines - * during the execution of an algorithm. - */ - public function addBlank(): void - { - $matched = Preg::match('/^(\h*\*)[^\r\n]*(\r?\n)$/', $this->content, $matches); - - if (!$matched) { - return; - } - - $this->content .= $matches[1].$matches[2]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/ShortDescription.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/ShortDescription.php deleted file mode 100644 index d053bc44..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/ShortDescription.php +++ /dev/null @@ -1,65 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\DocBlock; - -/** - * This class represents a short description (aka summary) of a docblock. - * - * @readonly - * - * @internal - */ -final class ShortDescription -{ - /** - * The docblock containing the short description. - */ - private DocBlock $doc; - - public function __construct(DocBlock $doc) - { - $this->doc = $doc; - } - - /** - * Get the line index of the line containing the end of the short - * description, if present. - */ - public function getEnd(): ?int - { - $reachedContent = false; - - foreach ($this->doc->getLines() as $index => $line) { - // we went past a description, then hit a tag or blank line, so - // the last line of the description must be the one before this one - if ($reachedContent && ($line->containsATag() || !$line->containsUsefulContent())) { - return $index - 1; - } - - // no short description was found - if ($line->containsATag()) { - return null; - } - - // we've reached content, but need to check the next lines too - // in case the short description is multi-line - if ($line->containsUsefulContent()) { - $reachedContent = true; - } - } - - return null; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Tag.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Tag.php deleted file mode 100644 index 6206718d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Tag.php +++ /dev/null @@ -1,102 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\DocBlock; - -use PhpCsFixer\Preg; - -/** - * This represents a tag, as defined by the proposed PSR PHPDoc standard. - * - * @author Graham Campbell - * @author Jakub Kwaśniewski - */ -final class Tag -{ - /** - * All the tags defined by the proposed PSR PHPDoc standard. - */ - public const PSR_STANDARD_TAGS = [ - 'api', 'author', 'category', 'copyright', 'deprecated', 'example', - 'global', 'internal', 'license', 'link', 'method', 'package', 'param', - 'property', 'property-read', 'property-write', 'return', 'see', - 'since', 'subpackage', 'throws', 'todo', 'uses', 'var', 'version', - ]; - - /** - * The line containing the tag. - */ - private Line $line; - - /** - * The cached tag name. - */ - private ?string $name = null; - - /** - * Create a new tag instance. - */ - public function __construct(Line $line) - { - $this->line = $line; - } - - /** - * Get the tag name. - * - * This may be "param", or "return", etc. - */ - public function getName(): string - { - if (null === $this->name) { - Preg::matchAll('/@[a-zA-Z0-9_-]+(?=\s|$)/', $this->line->getContent(), $matches); - - if (isset($matches[0][0])) { - $this->name = ltrim($matches[0][0], '@'); - } else { - $this->name = 'other'; - } - } - - return $this->name; - } - - /** - * Set the tag name. - * - * This will also be persisted to the upstream line and annotation. - */ - public function setName(string $name): void - { - $current = $this->getName(); - - if ('other' === $current) { - throw new \RuntimeException('Cannot set name on unknown tag.'); - } - - $this->line->setContent(Preg::replace("/@{$current}/", "@{$name}", $this->line->getContent(), 1)); - - $this->name = $name; - } - - /** - * Is the tag a known tag? - * - * This is defined by if it exists in the proposed PSR PHPDoc standard. - */ - public function valid(): bool - { - return \in_array($this->getName(), self::PSR_STANDARD_TAGS, true); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php deleted file mode 100644 index c5a3a896..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php +++ /dev/null @@ -1,66 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\DocBlock; - -/** - * This class is responsible for comparing tags to see if they should be kept - * together, or kept apart. - * - * @author Graham Campbell - * @author Jakub Kwaśniewski - * - * @deprecated - */ -final class TagComparator -{ - /** - * Groups of tags that should be allowed to immediately follow each other. - * - * @var list> - * - * @internal - */ - public const DEFAULT_GROUPS = [ - ['deprecated', 'link', 'see', 'since'], - ['author', 'copyright', 'license'], - ['category', 'package', 'subpackage'], - ['property', 'property-read', 'property-write'], - ]; - - /** - * Should the given tags be kept together, or kept apart? - * - * @param list> $groups - */ - public static function shouldBeTogether(Tag $first, Tag $second, array $groups = self::DEFAULT_GROUPS): bool - { - @trigger_error('Method '.__METHOD__.' is deprecated and will be removed in version 4.0.', E_USER_DEPRECATED); - - $firstName = $first->getName(); - $secondName = $second->getName(); - - if ($firstName === $secondName) { - return true; - } - - foreach ($groups as $group) { - if (\in_array($firstName, $group, true) && \in_array($secondName, $group, true)) { - return true; - } - } - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php deleted file mode 100644 index 39e68686..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php +++ /dev/null @@ -1,822 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\DocBlock; - -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; -use PhpCsFixer\Utils; - -/** - * @author Michael Vorisek - * - * @internal - */ -final class TypeExpression -{ - /** - * Regex to match any PHP identifier. - * - * @internal - */ - public const REGEX_IDENTIFIER = '(?:(?!(?(?x) # one or several types separated by `|` or `&` -'.self::REGEX_TYPE.' - (?: - \h*(?[|&])\h* - (?&type) - )*+ - )'; - - /** - * Based on: - * - https://github.com/phpstan/phpdoc-parser/blob/1.26.0/doc/grammars/type.abnf fuzzing grammar - * - and https://github.com/phpstan/phpdoc-parser/blob/1.26.0/src/Parser/PhpDocParser.php parser impl. - */ - private const REGEX_TYPE = '(?(?x) # single type - (?\??\h*) - (?: - (? - (?(?i)(?:array|list|object)(?-i)) - (?\h*\{\h*) - (? - (? - (?(?:(?&constant)|(?&identifier)|(?&name))\h*\??\h*:\h*|) - (?(?&types_inner)) - ) - (?: - \h*,\h* - (?&array_shape_inner) - )*+ - (?:\h*,\h*)? - |) - \h*\} - ) - | - (? # callable syntax, e.g. `callable(string, int...): bool`, `\Closure(T, int): T` - (?(?&name)) - (? - (?\h*<\h*) - (? - (? - (? - (?&identifier) - ) - (? # template bound - \h+(?i)(?of|as)(?-i)\h+ - (?(?&types_inner)) - |) - (? # template default - \h*=\h* - (?(?&types_inner)) - |) - ) - (?: - \h*,\h* - (?&callable_template_inner) - )*+ - ) - \h*> - (?=\h*\() - |) - (?\h*\(\h*) - (? - (? - (?(?&types_inner)) - (?\h*&|) - (?\h*\.\.\.|) - (?\h*\$(?&identifier)|) - (?\h*=|) - ) - (?: - \h*,\h* - (?&callable_argument) - )*+ - (?:\h*,\h*)? - |) - \h*\) - (?: - \h*\:\h* - (?(?&type)) - )? - ) - | - (? # generic syntax, e.g.: `array` - (?(?&name)) - (?\h*<\h*) - (? - (?&types_inner) - (?: - \h*,\h* - (?&types_inner) - )*+ - (?:\h*,\h*)? - ) - \h*> - ) - | - (? # class constants with optional wildcard, e.g.: `Foo::*`, `Foo::CONST_A`, `FOO::CONST_*` - (?(?&name)) - ::\*?(?:(?&identifier)\*?)* - ) - | - (? # single constant value (case insensitive), e.g.: 1, -1.8E+6, `\'a\'` - (?i) - # all sorts of numbers: with or without sign, supports literal separator and several numeric systems, - # e.g.: 1, +1.1, 1., .1, -1, 123E+8, 123_456_789, 0x7Fb4, 0b0110, 0o777 - [+-]?(?: - (?:0b[01]++(?:_[01]++)*+) - | (?:0o[0-7]++(?:_[0-7]++)*+) - | (?:0x[\da-f]++(?:_[\da-f]++)*+) - | (?:(?\d++(?:_\d++)*+)|(?=\.\d)) - (?:\.(?&constant_digits)|(?<=\d)\.)?+ - (?:e[+-]?(?&constant_digits))?+ - ) - | \'(?:[^\'\\\]|\\\.)*+\' - | "(?:[^"\\\]|\\\.)*+" - (?-i) - ) - | - (? # self reference, e.g.: $this, $self, @static - (?i) - [@$](?:this | self | static) - (?-i) - ) - | - (? # full name, e.g.: `int`, `\DateTime`, `\Foo\Bar`, `positive-int` - \\\?+ - (?'.self::REGEX_IDENTIFIER.') - (?:[\\\\\-](?&identifier))*+ - ) - | - (? # parenthesized type, e.g.: `(int)`, `(int|\stdClass)` - (? - \(\h* - ) - (?: - (? - (?&types_inner) - ) - | - (? # conditional type, e.g.: `$foo is \Throwable ? false : $foo` - (? - (?:\$(?&identifier)) - | - (?(?&types_inner)) - ) - (? - \h+(?i)is(?:\h+not)?(?-i)\h+ - ) - (?(?&types_inner)) - (?\h*\?\h*) - (?(?&types_inner)) - (?\h*:\h*) - (?(?&types_inner)) - ) - ) - \h*\) - ) - ) - (? # array, e.g.: `string[]`, `array[][]` - (\h*\[\h*\])* - ) - (?:(?=1)0 - (?(?> - (?&type) - (?: - \h*[|&]\h* - (?&type) - )*+ - )) - |) - )'; - - private string $value; - - private bool $isCompositeType; - - /** @var null|'&'|'|' */ - private ?string $typesGlue = null; - - /** @var list */ - private array $innerTypeExpressions = []; - - private ?NamespaceAnalysis $namespace; - - /** @var list */ - private array $namespaceUses; - - /** - * @param list $namespaceUses - */ - public function __construct(string $value, ?NamespaceAnalysis $namespace, array $namespaceUses) - { - $this->value = $value; - $this->namespace = $namespace; - $this->namespaceUses = $namespaceUses; - - $this->parse(); - } - - public function toString(): string - { - return $this->value; - } - - /** - * @return list - */ - public function getTypes(): array - { - if ($this->isCompositeType) { - return array_map( - static fn (array $type) => $type['expression']->toString(), - $this->innerTypeExpressions, - ); - } - - return [$this->value]; - } - - /** - * Determines if type expression is a composite type (union or intersection). - */ - public function isCompositeType(): bool - { - return $this->isCompositeType; - } - - public function isUnionType(): bool - { - return $this->isCompositeType && '|' === $this->typesGlue; - } - - public function isIntersectionType(): bool - { - return $this->isCompositeType && '&' === $this->typesGlue; - } - - /** - * @return null|'&'|'|' - */ - public function getTypesGlue(): ?string - { - return $this->typesGlue; - } - - /** - * @param \Closure(self): self $callback - */ - public function mapTypes(\Closure $callback): self - { - $value = $this->value; - $startIndexOffset = 0; - - foreach ($this->innerTypeExpressions as [ - 'start_index' => $startIndexOrig, - 'expression' => $inner, - ]) { - $innerValueOrig = $inner->value; - - $inner = $inner->mapTypes($callback); - - if ($inner->value !== $innerValueOrig) { - $value = substr_replace( - $value, - $inner->value, - $startIndexOrig + $startIndexOffset, - \strlen($innerValueOrig) - ); - - $startIndexOffset += \strlen($inner->value) - \strlen($innerValueOrig); - } - } - - $type = $value === $this->value - ? $this - : $this->inner($value); - - return $callback($type); - } - - /** - * @param \Closure(self): void $callback - */ - public function walkTypes(\Closure $callback): void - { - $this->mapTypes(static function (self $type) use ($callback) { - $valueOrig = $type->value; - $callback($type); - \assert($type->value === $valueOrig); - - return $type; - }); - } - - /** - * @param \Closure(self, self): (-1|0|1) $compareCallback - */ - public function sortTypes(\Closure $compareCallback): self - { - return $this->mapTypes(function (self $type) use ($compareCallback): self { - if ($type->isCompositeType) { - $innerTypeExpressions = Utils::stableSort( - $type->innerTypeExpressions, - static fn (array $v): self => $v['expression'], - $compareCallback, - ); - - if ($innerTypeExpressions !== $type->innerTypeExpressions) { - $value = implode( - $type->getTypesGlue(), - array_map(static fn (array $v): string => $v['expression']->toString(), $innerTypeExpressions) - ); - - return $this->inner($value); - } - } - - return $type; - }); - } - - public function getCommonType(): ?string - { - $aliases = $this->getAliases(); - - $mainType = null; - - foreach ($this->getTypes() as $type) { - if ('null' === $type) { - continue; - } - - if (str_starts_with($type, '?')) { - $type = substr($type, 1); - } - - if (Preg::match('/\[\h*\]$/', $type)) { - $type = 'array'; - } elseif (Preg::match('/^(.+?)\h*[<{(]/', $type, $matches)) { - $type = $matches[1]; - } - - if (isset($aliases[$type])) { - $type = $aliases[$type]; - } - - if (null === $mainType || $type === $mainType) { - $mainType = $type; - - continue; - } - - $mainType = $this->getParentType($type, $mainType); - - if (null === $mainType) { - return null; - } - } - - return $mainType; - } - - public function allowsNull(): bool - { - foreach ($this->getTypes() as $type) { - if (\in_array($type, ['null', 'mixed'], true) || str_starts_with($type, '?')) { - return true; - } - } - - return false; - } - - private function parse(): void - { - $seenGlues = null; - $innerValues = []; - - $index = 0; - while (true) { - Preg::match( - '{\G'.self::REGEX_TYPE.'(?\h*(?[|&])\h*(?!$)|$)}', - $this->value, - $matches, - PREG_OFFSET_CAPTURE, - $index - ); - - if ([] === $matches) { - throw new \Exception('Unable to parse phpdoc type '.var_export($this->value, true)); - } - - if (null === $seenGlues) { - if (($matches['glue'][0] ?? '') === '') { - break; - } - - $seenGlues = ['|' => false, '&' => false]; - } - - if (($matches['glue'][0] ?? '') !== '') { - \assert(isset($seenGlues[$matches['glue'][0]])); - $seenGlues[$matches['glue'][0]] = true; - } - - $innerValues[] = [ - 'start_index' => $index, - 'value' => $matches['type'][0], - 'next_glue' => $matches['glue'][0] ?? null, - 'next_glue_raw' => $matches['glue_raw'][0] ?? null, - ]; - - $consumedValueLength = \strlen($matches[0][0]); - $index += $consumedValueLength; - - if (\strlen($this->value) <= $index) { - \assert(\strlen($this->value) === $index); - - $seenGlues = array_filter($seenGlues); - \assert([] !== $seenGlues); - - $this->isCompositeType = true; - $this->typesGlue = array_key_first($seenGlues); - - if (1 === \count($seenGlues)) { - foreach ($innerValues as $innerValue) { - $this->innerTypeExpressions[] = [ - 'start_index' => $innerValue['start_index'], - 'expression' => $this->inner($innerValue['value']), - ]; - } - } else { - for ($i = 0; $i < \count($innerValues); ++$i) { - $innerStartIndex = $innerValues[$i]['start_index']; - $innerValue = ''; - while (true) { - $innerValue .= $innerValues[$i]['value']; - - if (($innerValues[$i]['next_glue'] ?? $this->typesGlue) === $this->typesGlue) { - break; - } - - $innerValue .= $innerValues[$i]['next_glue_raw']; - - ++$i; - } - - $this->innerTypeExpressions[] = [ - 'start_index' => $innerStartIndex, - 'expression' => $this->inner($innerValue), - ]; - } - } - - return; - } - } - - $this->isCompositeType = false; - - if ('' !== $matches['nullable'][0]) { - $this->innerTypeExpressions[] = [ - 'start_index' => \strlen($matches['nullable'][0]), - 'expression' => $this->inner(substr($matches['type'][0], \strlen($matches['nullable'][0]))), - ]; - } elseif ('' !== $matches['array'][0]) { - $this->innerTypeExpressions[] = [ - 'start_index' => 0, - 'expression' => $this->inner(substr($matches['type'][0], 0, -\strlen($matches['array'][0]))), - ]; - } elseif ('' !== ($matches['generic'][0] ?? '') && 0 === $matches['generic'][1]) { - $this->innerTypeExpressions[] = [ - 'start_index' => 0, - 'expression' => $this->inner($matches['generic_name'][0]), - ]; - - $this->parseCommaSeparatedInnerTypes( - \strlen($matches['generic_name'][0]) + \strlen($matches['generic_start'][0]), - $matches['generic_types'][0] - ); - } elseif ('' !== ($matches['callable'][0] ?? '') && 0 === $matches['callable'][1]) { - $this->innerTypeExpressions[] = [ - 'start_index' => 0, - 'expression' => $this->inner($matches['callable_name'][0]), - ]; - - $this->parseCallableTemplateInnerTypes( - \strlen($matches['callable_name'][0]) - + \strlen($matches['callable_template_start'][0]), - $matches['callable_template_inners'][0] - ); - - $this->parseCallableArgumentTypes( - \strlen($matches['callable_name'][0]) - + \strlen($matches['callable_template'][0]) - + \strlen($matches['callable_start'][0]), - $matches['callable_arguments'][0] - ); - - if ('' !== ($matches['callable_return'][0] ?? '')) { - $this->innerTypeExpressions[] = [ - 'start_index' => \strlen($this->value) - \strlen($matches['callable_return'][0]), - 'expression' => $this->inner($matches['callable_return'][0]), - ]; - } - } elseif ('' !== ($matches['array_shape'][0] ?? '') && 0 === $matches['array_shape'][1]) { - $this->innerTypeExpressions[] = [ - 'start_index' => 0, - 'expression' => $this->inner($matches['array_shape_name'][0]), - ]; - - $this->parseArrayShapeInnerTypes( - \strlen($matches['array_shape_name'][0]) + \strlen($matches['array_shape_start'][0]), - $matches['array_shape_inners'][0] - ); - } elseif ('' !== ($matches['parenthesized'][0] ?? '') && 0 === $matches['parenthesized'][1]) { - $index = \strlen($matches['parenthesized_start'][0]); - - if ('' !== ($matches['conditional'][0] ?? '')) { - if ('' !== ($matches['conditional_cond_left_types'][0] ?? '')) { - $this->innerTypeExpressions[] = [ - 'start_index' => $index, - 'expression' => $this->inner($matches['conditional_cond_left_types'][0]), - ]; - } - - $index += \strlen($matches['conditional_cond_left'][0]) + \strlen($matches['conditional_cond_middle'][0]); - - $this->innerTypeExpressions[] = [ - 'start_index' => $index, - 'expression' => $this->inner($matches['conditional_cond_right_types'][0]), - ]; - - $index += \strlen($matches['conditional_cond_right_types'][0]) + \strlen($matches['conditional_true_start'][0]); - - $this->innerTypeExpressions[] = [ - 'start_index' => $index, - 'expression' => $this->inner($matches['conditional_true_types'][0]), - ]; - - $index += \strlen($matches['conditional_true_types'][0]) + \strlen($matches['conditional_false_start'][0]); - - $this->innerTypeExpressions[] = [ - 'start_index' => $index, - 'expression' => $this->inner($matches['conditional_false_types'][0]), - ]; - } else { - $this->innerTypeExpressions[] = [ - 'start_index' => $index, - 'expression' => $this->inner($matches['parenthesized_types'][0]), - ]; - } - } elseif ('' !== $matches['class_constant'][0]) { - $this->innerTypeExpressions[] = [ - 'start_index' => 0, - 'expression' => $this->inner($matches['class_constant_name'][0]), - ]; - } - } - - private function parseCommaSeparatedInnerTypes(int $startIndex, string $value): void - { - $index = 0; - while (\strlen($value) !== $index) { - Preg::match( - '{\G'.self::REGEX_TYPES.'(?:\h*,\h*|$)}', - $value, - $matches, - 0, - $index - ); - - $this->innerTypeExpressions[] = [ - 'start_index' => $startIndex + $index, - 'expression' => $this->inner($matches['types']), - ]; - - $index += \strlen($matches[0]); - } - } - - private function parseCallableTemplateInnerTypes(int $startIndex, string $value): void - { - $index = 0; - while (\strlen($value) !== $index) { - Preg::match( - '{\G(?:(?=1)0'.self::REGEX_TYPES.'|(?<_callable_template_inner>(?&callable_template_inner))(?:\h*,\h*|$))}', - $value, - $prematches, - 0, - $index - ); - $consumedValue = $prematches['_callable_template_inner']; - $consumedValueLength = \strlen($consumedValue); - $consumedCommaLength = \strlen($prematches[0]) - $consumedValueLength; - - $addedPrefix = 'Closure<'; - Preg::match( - '{^'.self::REGEX_TYPES.'$}', - $addedPrefix.$consumedValue.'>(): void', - $matches, - PREG_OFFSET_CAPTURE - ); - - if ('' !== $matches['callable_template_inner_b'][0]) { - $this->innerTypeExpressions[] = [ - 'start_index' => $startIndex + $index + $matches['callable_template_inner_b_types'][1] - - \strlen($addedPrefix), - 'expression' => $this->inner($matches['callable_template_inner_b_types'][0]), - ]; - } - - if ('' !== $matches['callable_template_inner_d'][0]) { - $this->innerTypeExpressions[] = [ - 'start_index' => $startIndex + $index + $matches['callable_template_inner_d_types'][1] - - \strlen($addedPrefix), - 'expression' => $this->inner($matches['callable_template_inner_d_types'][0]), - ]; - } - - $index += $consumedValueLength + $consumedCommaLength; - } - } - - private function parseCallableArgumentTypes(int $startIndex, string $value): void - { - $index = 0; - while (\strlen($value) !== $index) { - Preg::match( - '{\G(?:(?=1)0'.self::REGEX_TYPES.'|(?<_callable_argument>(?&callable_argument))(?:\h*,\h*|$))}', - $value, - $prematches, - 0, - $index - ); - $consumedValue = $prematches['_callable_argument']; - $consumedValueLength = \strlen($consumedValue); - $consumedCommaLength = \strlen($prematches[0]) - $consumedValueLength; - - $addedPrefix = 'Closure('; - Preg::match( - '{^'.self::REGEX_TYPES.'$}', - $addedPrefix.$consumedValue.'): void', - $matches, - PREG_OFFSET_CAPTURE - ); - - $this->innerTypeExpressions[] = [ - 'start_index' => $startIndex + $index, - 'expression' => $this->inner($matches['callable_argument_type'][0]), - ]; - - $index += $consumedValueLength + $consumedCommaLength; - } - } - - private function parseArrayShapeInnerTypes(int $startIndex, string $value): void - { - $index = 0; - while (\strlen($value) !== $index) { - Preg::match( - '{\G(?:(?=1)0'.self::REGEX_TYPES.'|(?<_array_shape_inner>(?&array_shape_inner))(?:\h*,\h*|$))}', - $value, - $prematches, - 0, - $index - ); - $consumedValue = $prematches['_array_shape_inner']; - $consumedValueLength = \strlen($consumedValue); - $consumedCommaLength = \strlen($prematches[0]) - $consumedValueLength; - - $addedPrefix = 'array{'; - Preg::match( - '{^'.self::REGEX_TYPES.'$}', - $addedPrefix.$consumedValue.'}', - $matches, - PREG_OFFSET_CAPTURE - ); - - $this->innerTypeExpressions[] = [ - 'start_index' => $startIndex + $index + $matches['array_shape_inner_value'][1] - - \strlen($addedPrefix), - 'expression' => $this->inner($matches['array_shape_inner_value'][0]), - ]; - - $index += $consumedValueLength + $consumedCommaLength; - } - } - - private function inner(string $value): self - { - return new self($value, $this->namespace, $this->namespaceUses); - } - - private function getParentType(string $type1, string $type2): ?string - { - $types = [ - $this->normalize($type1), - $this->normalize($type2), - ]; - natcasesort($types); - $types = implode('|', $types); - - $parents = [ - 'array|Traversable' => 'iterable', - 'array|iterable' => 'iterable', - 'iterable|Traversable' => 'iterable', - 'self|static' => 'self', - ]; - - return $parents[$types] ?? null; - } - - private function normalize(string $type): string - { - $aliases = $this->getAliases(); - - if (isset($aliases[$type])) { - return $aliases[$type]; - } - - if (\in_array($type, [ - 'array', - 'bool', - 'callable', - 'false', - 'float', - 'int', - 'iterable', - 'mixed', - 'never', - 'null', - 'object', - 'resource', - 'string', - 'true', - 'void', - ], true)) { - return $type; - } - - if (Preg::match('/\[\]$/', $type)) { - return 'array'; - } - - if (Preg::match('/^(.+?)namespaceUses as $namespaceUse) { - if ($namespaceUse->getShortName() === $type) { - return $namespaceUse->getFullName(); - } - } - - if (null === $this->namespace || $this->namespace->isGlobalNamespace()) { - return $type; - } - - return "{$this->namespace->getFullName()}\\{$type}"; - } - - /** - * @return array - */ - private function getAliases(): array - { - return [ - 'boolean' => 'bool', - 'callback' => 'callable', - 'double' => 'float', - 'false' => 'bool', - 'integer' => 'int', - 'list' => 'array', - 'real' => 'float', - 'true' => 'bool', - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php deleted file mode 100644 index af64205b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php +++ /dev/null @@ -1,171 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Doctrine\Annotation; - -use PhpCsFixer\Preg; - -/** - * Copyright (c) 2006-2013 Doctrine Project. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do - * so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * @internal - */ -final class DocLexer -{ - public const T_NONE = 1; - public const T_INTEGER = 2; - public const T_STRING = 3; - public const T_FLOAT = 4; - - // All tokens that are also identifiers should be >= 100 - public const T_IDENTIFIER = 100; - public const T_AT = 101; - public const T_CLOSE_CURLY_BRACES = 102; - public const T_CLOSE_PARENTHESIS = 103; - public const T_COMMA = 104; - public const T_EQUALS = 105; - public const T_FALSE = 106; - public const T_NAMESPACE_SEPARATOR = 107; - public const T_OPEN_CURLY_BRACES = 108; - public const T_OPEN_PARENTHESIS = 109; - public const T_TRUE = 110; - public const T_NULL = 111; - public const T_COLON = 112; - public const T_MINUS = 113; - - /** @var array */ - private array $noCase = [ - '@' => self::T_AT, - ',' => self::T_COMMA, - '(' => self::T_OPEN_PARENTHESIS, - ')' => self::T_CLOSE_PARENTHESIS, - '{' => self::T_OPEN_CURLY_BRACES, - '}' => self::T_CLOSE_CURLY_BRACES, - '=' => self::T_EQUALS, - ':' => self::T_COLON, - '-' => self::T_MINUS, - '\\' => self::T_NAMESPACE_SEPARATOR, - ]; - - /** @var list */ - private array $tokens = []; - - private int $position = 0; - - private int $peek = 0; - - private ?string $regex = null; - - public function setInput(string $input): void - { - $this->tokens = []; - $this->reset(); - $this->scan($input); - } - - public function reset(): void - { - $this->peek = 0; - $this->position = 0; - } - - public function peek(): ?Token - { - if (isset($this->tokens[$this->position + $this->peek])) { - return $this->tokens[$this->position + $this->peek++]; - } - - return null; - } - - /** - * @return list - */ - private function getCatchablePatterns(): array - { - return [ - '[a-z_\\\][a-z0-9_\:\\\]*[a-z_][a-z0-9_]*', - '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?', - '"(?:""|[^"])*+"', - ]; - } - - /** - * @return list - */ - private function getNonCatchablePatterns(): array - { - return ['\s+', '\*+', '(.)']; - } - - /** - * @return self::T_* - */ - private function getType(string &$value): int - { - $type = self::T_NONE; - - if ('"' === $value[0]) { - $value = str_replace('""', '"', substr($value, 1, \strlen($value) - 2)); - - return self::T_STRING; - } - - if (isset($this->noCase[$value])) { - return $this->noCase[$value]; - } - - if ('_' === $value[0] || '\\' === $value[0] || !Preg::match('/[^A-Za-z]/', $value[0])) { - return self::T_IDENTIFIER; - } - - if (is_numeric($value)) { - return str_contains($value, '.') || false !== stripos($value, 'e') - ? self::T_FLOAT : self::T_INTEGER; - } - - return $type; - } - - private function scan(string $input): void - { - $this->regex ??= \sprintf( - '/(%s)|%s/%s', - implode(')|(', $this->getCatchablePatterns()), - implode('|', $this->getNonCatchablePatterns()), - 'iu' - ); - - $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE; - $matches = Preg::split($this->regex, $input, -1, $flags); - - foreach ($matches as $match) { - // Must remain before 'value' assignment since it can change content - $firstMatch = $match[0]; - $type = $this->getType($firstMatch); - - $this->tokens[] = new Token($type, $firstMatch, (int) $match[1]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php deleted file mode 100644 index 56cb83e4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php +++ /dev/null @@ -1,87 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Doctrine\Annotation; - -/** - * A Doctrine annotation token. - * - * @internal - */ -final class Token -{ - private int $type; - - private string $content; - - private int $position; - - /** - * @param int $type The type - * @param string $content The content - */ - public function __construct(int $type = DocLexer::T_NONE, string $content = '', int $position = 0) - { - $this->type = $type; - $this->content = $content; - $this->position = $position; - } - - public function getType(): int - { - return $this->type; - } - - public function setType(int $type): void - { - $this->type = $type; - } - - public function getContent(): string - { - return $this->content; - } - - public function setContent(string $content): void - { - $this->content = $content; - } - - public function getPosition(): int - { - return $this->position; - } - - /** - * Returns whether the token type is one of the given types. - * - * @param int|list $types - */ - public function isType($types): bool - { - if (!\is_array($types)) { - $types = [$types]; - } - - return \in_array($this->getType(), $types, true); - } - - /** - * Overrides the content with an empty string. - */ - public function clear(): void - { - $this->setContent(''); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php deleted file mode 100644 index b73d14a4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php +++ /dev/null @@ -1,303 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Doctrine\Annotation; - -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token as PhpToken; - -/** - * A list of Doctrine annotation tokens. - * - * @internal - * - * @extends \SplFixedArray - */ -final class Tokens extends \SplFixedArray -{ - /** - * @param list $ignoredTags - * - * @throws \InvalidArgumentException - */ - public static function createFromDocComment(PhpToken $input, array $ignoredTags = []): self - { - if (!$input->isGivenKind(T_DOC_COMMENT)) { - throw new \InvalidArgumentException('Input must be a T_DOC_COMMENT token.'); - } - - $tokens = []; - - $content = $input->getContent(); - $ignoredTextPosition = 0; - $currentPosition = 0; - $token = null; - while (false !== $nextAtPosition = strpos($content, '@', $currentPosition)) { - if (0 !== $nextAtPosition && !Preg::match('/\s/', $content[$nextAtPosition - 1])) { - $currentPosition = $nextAtPosition + 1; - - continue; - } - - $lexer = new DocLexer(); - $lexer->setInput(substr($content, $nextAtPosition)); - - $scannedTokens = []; - $index = 0; - $nbScannedTokensToUse = 0; - $nbScopes = 0; - while (null !== $token = $lexer->peek()) { - if (0 === $index && !$token->isType(DocLexer::T_AT)) { - break; - } - - if (1 === $index) { - if (!$token->isType(DocLexer::T_IDENTIFIER) || \in_array($token->getContent(), $ignoredTags, true)) { - break; - } - - $nbScannedTokensToUse = 2; - } - - if ($index >= 2 && 0 === $nbScopes && !$token->isType([DocLexer::T_NONE, DocLexer::T_OPEN_PARENTHESIS])) { - break; - } - - $scannedTokens[] = $token; - - if ($token->isType(DocLexer::T_OPEN_PARENTHESIS)) { - ++$nbScopes; - } elseif ($token->isType(DocLexer::T_CLOSE_PARENTHESIS)) { - if (0 === --$nbScopes) { - $nbScannedTokensToUse = \count($scannedTokens); - - break; - } - } - - ++$index; - } - - if (0 !== $nbScopes) { - break; - } - - if (0 !== $nbScannedTokensToUse) { - $ignoredTextLength = $nextAtPosition - $ignoredTextPosition; - if (0 !== $ignoredTextLength) { - $tokens[] = new Token(DocLexer::T_NONE, substr($content, $ignoredTextPosition, $ignoredTextLength)); - } - - $lastTokenEndIndex = 0; - foreach (\array_slice($scannedTokens, 0, $nbScannedTokensToUse) as $scannedToken) { - $token = $scannedToken->isType(DocLexer::T_STRING) - ? new Token( - $scannedToken->getType(), - '"'.str_replace('"', '""', $scannedToken->getContent()).'"', - $scannedToken->getPosition() - ) - : $scannedToken; - - $missingTextLength = $token->getPosition() - $lastTokenEndIndex; - if ($missingTextLength > 0) { - $tokens[] = new Token(DocLexer::T_NONE, substr( - $content, - $nextAtPosition + $lastTokenEndIndex, - $missingTextLength - )); - } - - $tokens[] = new Token($token->getType(), $token->getContent()); - $lastTokenEndIndex = $token->getPosition() + \strlen($token->getContent()); - } - - $currentPosition = $ignoredTextPosition = $nextAtPosition + $token->getPosition() + \strlen($token->getContent()); - } else { - $currentPosition = $nextAtPosition + 1; - } - } - - if ($ignoredTextPosition < \strlen($content)) { - $tokens[] = new Token(DocLexer::T_NONE, substr($content, $ignoredTextPosition)); - } - - return self::fromArray($tokens); - } - - /** - * Create token collection from array. - * - * @param array $array the array to import - * @param ?bool $saveIndices save the numeric indices used in the original array, default is yes - */ - public static function fromArray($array, $saveIndices = null): self - { - $tokens = new self(\count($array)); - - if (null === $saveIndices || $saveIndices) { - foreach ($array as $key => $val) { - $tokens[$key] = $val; - } - } else { - $index = 0; - - foreach ($array as $val) { - $tokens[$index++] = $val; - } - } - - return $tokens; - } - - /** - * Returns the index of the closest next token that is neither a comment nor a whitespace token. - */ - public function getNextMeaningfulToken(int $index): ?int - { - return $this->getMeaningfulTokenSibling($index, 1); - } - - /** - * Returns the index of the closest previous token that is neither a comment nor a whitespace token. - */ - public function getPreviousMeaningfulToken(int $index): ?int - { - return $this->getMeaningfulTokenSibling($index, -1); - } - - /** - * Returns the index of the last token that is part of the annotation at the given index. - */ - public function getAnnotationEnd(int $index): ?int - { - $currentIndex = null; - - if (isset($this[$index + 2])) { - if ($this[$index + 2]->isType(DocLexer::T_OPEN_PARENTHESIS)) { - $currentIndex = $index + 2; - } elseif ( - isset($this[$index + 3]) - && $this[$index + 2]->isType(DocLexer::T_NONE) - && $this[$index + 3]->isType(DocLexer::T_OPEN_PARENTHESIS) - && Preg::match('/^(\R\s*\*\s*)*\s*$/', $this[$index + 2]->getContent()) - ) { - $currentIndex = $index + 3; - } - } - - if (null !== $currentIndex) { - $level = 0; - for ($max = \count($this); $currentIndex < $max; ++$currentIndex) { - if ($this[$currentIndex]->isType(DocLexer::T_OPEN_PARENTHESIS)) { - ++$level; - } elseif ($this[$currentIndex]->isType(DocLexer::T_CLOSE_PARENTHESIS)) { - --$level; - } - - if (0 === $level) { - return $currentIndex; - } - } - - return null; - } - - return $index + 1; - } - - /** - * Returns the code from the tokens. - */ - public function getCode(): string - { - $code = ''; - foreach ($this as $token) { - $code .= $token->getContent(); - } - - return $code; - } - - /** - * Inserts a token at the given index. - */ - public function insertAt(int $index, Token $token): void - { - $this->setSize($this->getSize() + 1); - - for ($i = $this->getSize() - 1; $i > $index; --$i) { - $this[$i] = $this[$i - 1] ?? new Token(); - } - - $this[$index] = $token; - } - - public function offsetSet($index, $token): void - { - if (null === $token) { - throw new \InvalidArgumentException('Token must be an instance of PhpCsFixer\Doctrine\Annotation\Token, "null" given.'); - } - - if (!$token instanceof Token) { - $type = \gettype($token); - - if ('object' === $type) { - $type = \get_class($token); - } - - throw new \InvalidArgumentException(\sprintf('Token must be an instance of PhpCsFixer\Doctrine\Annotation\Token, "%s" given.', $type)); - } - - parent::offsetSet($index, $token); - } - - /** - * @param mixed $index - * - * @throws \OutOfBoundsException - */ - public function offsetUnset($index): void - { - if (!isset($this[$index])) { - throw new \OutOfBoundsException(\sprintf('Index "%s" is invalid or does not exist.', $index)); - } - - $max = \count($this) - 1; - while ($index < $max) { - $this[$index] = $this[$index + 1]; - ++$index; - } - - parent::offsetUnset($index); - - $this->setSize($max); - } - - private function getMeaningfulTokenSibling(int $index, int $direction): ?int - { - while (true) { - $index += $direction; - - if (!$this->offsetExists($index)) { - break; - } - - if (!$this[$index]->isType(DocLexer::T_NONE)) { - return $index; - } - } - - return null; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php deleted file mode 100644 index 5da0e31c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php +++ /dev/null @@ -1,82 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Documentation; - -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Utils; - -/** - * @readonly - * - * @internal - */ -final class DocumentationLocator -{ - private string $path; - - public function __construct() - { - $this->path = \dirname(__DIR__, 2).'/doc'; - } - - public function getFixersDocumentationDirectoryPath(): string - { - return $this->path.'/rules'; - } - - public function getFixersDocumentationIndexFilePath(): string - { - return $this->getFixersDocumentationDirectoryPath().'/index.rst'; - } - - public function getFixerDocumentationFilePath(FixerInterface $fixer): string - { - return $this->getFixersDocumentationDirectoryPath().'/'.Preg::replaceCallback( - '/^.*\\\(.+)\\\(.+)Fixer$/', - static fn (array $matches): string => Utils::camelCaseToUnderscore($matches[1]).'/'.Utils::camelCaseToUnderscore($matches[2]), - \get_class($fixer) - ).'.rst'; - } - - public function getFixerDocumentationFileRelativePath(FixerInterface $fixer): string - { - return Preg::replace( - '#^'.preg_quote($this->getFixersDocumentationDirectoryPath(), '#').'/#', - '', - $this->getFixerDocumentationFilePath($fixer) - ); - } - - public function getRuleSetsDocumentationDirectoryPath(): string - { - return $this->path.'/ruleSets'; - } - - public function getRuleSetsDocumentationIndexFilePath(): string - { - return $this->getRuleSetsDocumentationDirectoryPath().'/index.rst'; - } - - public function getRuleSetsDocumentationFilePath(string $name): string - { - return $this->getRuleSetsDocumentationDirectoryPath().'/'.str_replace(':risky', 'Risky', ucfirst(substr($name, 1))).'.rst'; - } - - public function getUsageFilePath(): string - { - return $this->path.'/usage.rst'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php deleted file mode 100644 index 34ae74a7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php +++ /dev/null @@ -1,415 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Documentation; - -use PhpCsFixer\Console\Command\HelpCommand; -use PhpCsFixer\Differ\FullDiffer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\Fixer\ExperimentalFixerInterface; -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\FixerConfiguration\AliasedFixerOption; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\DeprecatedFixerOptionInterface; -use PhpCsFixer\FixerDefinition\CodeSampleInterface; -use PhpCsFixer\FixerDefinition\FileSpecificCodeSampleInterface; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSampleInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\RuleSet\RuleSet; -use PhpCsFixer\RuleSet\RuleSets; -use PhpCsFixer\StdinFileInfo; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Utils; - -/** - * @readonly - * - * @internal - */ -final class FixerDocumentGenerator -{ - private DocumentationLocator $locator; - - private FullDiffer $differ; - - public function __construct(DocumentationLocator $locator) - { - $this->locator = $locator; - $this->differ = new FullDiffer(); - } - - public function generateFixerDocumentation(FixerInterface $fixer): string - { - $name = $fixer->getName(); - $title = "Rule ``{$name}``"; - $titleLine = str_repeat('=', \strlen($title)); - $doc = "{$titleLine}\n{$title}\n{$titleLine}"; - - $definition = $fixer->getDefinition(); - $doc .= "\n\n".RstUtils::toRst($definition->getSummary()); - - $description = $definition->getDescription(); - - if (null !== $description) { - $description = RstUtils::toRst($description); - $doc .= <<getSuccessorsNames(); - - if (0 !== \count($alternatives)) { - $deprecationDescription .= RstUtils::toRst(\sprintf( - "\n\nYou should use %s instead.", - Utils::naturalLanguageJoinWithBackticks($alternatives) - ), 0); - } - } - - $experimentalDescription = ''; - - if ($fixer instanceof ExperimentalFixerInterface) { - $experimentalDescriptionRaw = RstUtils::toRst('Rule is not covered with backward compatibility promise, use it at your own risk. Rule\'s behaviour may be changed at any point, including rule\'s name; its options\' names, availability and allowed values; its default configuration. Rule may be even removed without prior notice. Feel free to provide feedback and help with determining final state of the rule.', 0); - $experimentalDescription = <<getRiskyDescription(); - - if (null !== $riskyDescriptionRaw) { - $riskyDescriptionRaw = RstUtils::toRst($riskyDescriptionRaw, 0); - $riskyDescription = << '' !== $text - )); - } - - if ($fixer instanceof ConfigurableFixerInterface) { - $doc .= <<<'RST' - - - Configuration - ------------- - RST; - - $configurationDefinition = $fixer->getConfigurationDefinition(); - - foreach ($configurationDefinition->getOptions() as $option) { - $optionInfo = "``{$option->getName()}``"; - $optionInfo .= "\n".str_repeat('~', \strlen($optionInfo)); - - if ($option instanceof DeprecatedFixerOptionInterface) { - $deprecationMessage = RstUtils::toRst($option->getDeprecationMessage()); - $optionInfo .= "\n\n.. warning:: This option is deprecated and will be removed in the next major version. {$deprecationMessage}"; - } - - $optionInfo .= "\n\n".RstUtils::toRst($option->getDescription()); - - if ($option instanceof AliasedFixerOption) { - $optionInfo .= "\n\n.. note:: The previous name of this option was ``{$option->getAlias()}`` but it is now deprecated and will be removed in the next major version."; - } - - $allowed = HelpCommand::getDisplayableAllowedValues($option); - - if (null === $allowed) { - $allowedKind = 'Allowed types'; - $allowed = array_map( - static fn (string $value): string => '``'.Utils::convertArrayTypeToList($value).'``', - $option->getAllowedTypes(), - ); - } else { - $allowedKind = 'Allowed values'; - $allowed = array_map(static fn ($value): string => $value instanceof AllowedValueSubset - ? 'a subset of ``'.Utils::toString($value->getAllowedValues()).'``' - : '``'.Utils::toString($value).'``', $allowed); - } - - $allowed = Utils::naturalLanguageJoin($allowed, ''); - $optionInfo .= "\n\n{$allowedKind}: {$allowed}"; - - if ($option->hasDefault()) { - $default = Utils::toString($option->getDefault()); - $optionInfo .= "\n\nDefault value: ``{$default}``"; - } else { - $optionInfo .= "\n\nThis option is required."; - } - - $doc .= "\n\n{$optionInfo}"; - } - } - - $samples = $definition->getCodeSamples(); - - if (0 !== \count($samples)) { - $doc .= <<<'RST' - - - Examples - -------- - RST; - - foreach ($samples as $index => $sample) { - $title = \sprintf('Example #%d', $index + 1); - $titleLine = str_repeat('~', \strlen($title)); - $doc .= "\n\n{$title}\n{$titleLine}"; - - if ($fixer instanceof ConfigurableFixerInterface) { - if (null === $sample->getConfiguration()) { - $doc .= "\n\n*Default* configuration."; - } else { - $doc .= \sprintf( - "\n\nWith configuration: ``%s``.", - Utils::toString($sample->getConfiguration()) - ); - } - } - - $doc .= "\n".$this->generateSampleDiff($fixer, $sample, $index + 1, $name); - } - } - - $ruleSetConfigs = self::getSetsOfRule($name); - - if ([] !== $ruleSetConfigs) { - $plural = 1 !== \count($ruleSetConfigs) ? 's' : ''; - $doc .= << $config) { - $ruleSetPath = $this->locator->getRuleSetsDocumentationFilePath($set); - $ruleSetPath = substr($ruleSetPath, strrpos($ruleSetPath, '/')); - - $configInfo = (null !== $config) - ? " with config:\n\n ``".Utils::toString($config)."``\n" - : ''; - - $doc .= <<`_{$configInfo}\n - RST; - } - } - - $reflectionObject = new \ReflectionObject($fixer); - $className = str_replace('\\', '\\\\', $reflectionObject->getName()); - $fileName = $reflectionObject->getFileName(); - $fileName = str_replace('\\', '/', $fileName); - $fileName = substr($fileName, strrpos($fileName, '/src/Fixer/') + 1); - $fileName = "`{$className} <./../../../{$fileName}>`_"; - - $testFileName = Preg::replace('~.*\K/src/(?=Fixer/)~', '/tests/', $fileName); - $testFileName = Preg::replace('~PhpCsFixer\\\\\\\\\K(?=Fixer\\\\\\\)~', 'Tests\\\\\\\\', $testFileName); - $testFileName = Preg::replace('~(?= <|\.php>)~', 'Test', $testFileName); - - $doc .= <<', $doc); - - return "{$doc}\n"; - } - - /** - * @internal - * - * @return array> - */ - public static function getSetsOfRule(string $ruleName): array - { - $ruleSetConfigs = []; - - foreach (RuleSets::getSetDefinitionNames() as $set) { - $ruleSet = new RuleSet([$set => true]); - - if ($ruleSet->hasRule($ruleName)) { - $ruleSetConfigs[$set] = $ruleSet->getRuleConfiguration($ruleName); - } - } - - return $ruleSetConfigs; - } - - /** - * @param list $fixers - */ - public function generateFixersDocumentationIndex(array $fixers): string - { - $overrideGroups = [ - 'PhpUnit' => 'PHPUnit', - 'PhpTag' => 'PHP Tag', - 'Phpdoc' => 'PHPDoc', - ]; - - usort($fixers, static fn (FixerInterface $a, FixerInterface $b): int => \get_class($a) <=> \get_class($b)); - - $documentation = <<<'RST' - ======================= - List of Available Rules - ======================= - RST; - - $currentGroup = null; - - foreach ($fixers as $fixer) { - $namespace = Preg::replace('/^.*\\\(.+)\\\.+Fixer$/', '$1', \get_class($fixer)); - $group = $overrideGroups[$namespace] ?? Preg::replace('/(?<=[[:lower:]])(?=[[:upper:]])/', ' ', $namespace); - - if ($group !== $currentGroup) { - $underline = str_repeat('-', \strlen($group)); - $documentation .= "\n\n{$group}\n{$underline}\n"; - - $currentGroup = $group; - } - - $path = './'.$this->locator->getFixerDocumentationFileRelativePath($fixer); - - $attributes = []; - - if ($fixer instanceof DeprecatedFixerInterface) { - $attributes[] = 'deprecated'; - } - - if ($fixer instanceof ExperimentalFixerInterface) { - $attributes[] = 'experimental'; - } - - if ($fixer->isRisky()) { - $attributes[] = 'risky'; - } - - $attributes = 0 === \count($attributes) - ? '' - : ' *('.implode(', ', $attributes).')*'; - - $summary = str_replace('`', '``', $fixer->getDefinition()->getSummary()); - - $documentation .= <<getName()} <{$path}>`_{$attributes} - - {$summary} - RST; - } - - return "{$documentation}\n"; - } - - private function generateSampleDiff(FixerInterface $fixer, CodeSampleInterface $sample, int $sampleNumber, string $ruleName): string - { - if ($sample instanceof VersionSpecificCodeSampleInterface && !$sample->isSuitableFor(\PHP_VERSION_ID)) { - $existingFile = @file_get_contents($this->locator->getFixerDocumentationFilePath($fixer)); - - if (false !== $existingFile) { - Preg::match("/\\RExample #{$sampleNumber}\\R.+?(?\\R\\.\\. code-block:: diff\\R\\R.*?)\\R(?:\\R\\S|$)/s", $existingFile, $matches); - - if (isset($matches['diff'])) { - return $matches['diff']; - } - } - - $error = <<getCode(); - - $tokens = Tokens::fromCode($old); - $file = $sample instanceof FileSpecificCodeSampleInterface - ? $sample->getSplFileInfo() - : new StdinFileInfo(); - - if ($fixer instanceof ConfigurableFixerInterface) { - $fixer->configure($sample->getConfiguration() ?? []); - } - - $fixer->fix($file, $tokens); - - $diff = $this->differ->diff($old, $tokens->generateCode()); - $diff = Preg::replace('/@@[ \+\-\d,]+@@\n/', '', $diff); - $diff = Preg::replace('/\r/', '^M', $diff); - $diff = Preg::replace('/^ $/m', '', $diff); - $diff = Preg::replace('/\n$/', '', $diff); - $diff = RstUtils::indent($diff, 3); - - return << - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Documentation; - -use PhpCsFixer\Preg; - -/** - * @internal - */ -final class RstUtils -{ - private function __construct() - { - // cannot create instance of util. class - } - - public static function toRst(string $string, int $indent = 0): string - { - $string = wordwrap(self::ensureProperInlineCode($string), 80 - $indent); - - return 0 === $indent ? $string : self::indent($string, $indent); - } - - public static function ensureProperInlineCode(string $string): string - { - return Preg::replace('/(? - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Documentation; - -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\RuleSet\DeprecatedRuleSetDescriptionInterface; -use PhpCsFixer\RuleSet\RuleSetDescriptionInterface; -use PhpCsFixer\Utils; - -/** - * @readonly - * - * @internal - */ -final class RuleSetDocumentationGenerator -{ - private DocumentationLocator $locator; - - public function __construct(DocumentationLocator $locator) - { - $this->locator = $locator; - } - - /** - * @param list $fixers - */ - public function generateRuleSetsDocumentation(RuleSetDescriptionInterface $definition, array $fixers): string - { - $fixerNames = []; - - foreach ($fixers as $fixer) { - $fixerNames[$fixer->getName()] = $fixer; - } - - $title = "Rule set ``{$definition->getName()}``"; - $titleLine = str_repeat('=', \strlen($title)); - $doc = "{$titleLine}\n{$title}\n{$titleLine}\n\n".$definition->getDescription(); - - $warnings = []; - if ($definition instanceof DeprecatedRuleSetDescriptionInterface) { - $deprecationDescription = <<<'RST' - - This rule set is deprecated and will be removed in the next major version - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RST; - $alternatives = $definition->getSuccessorsNames(); - - if (0 !== \count($alternatives)) { - $deprecationDescription .= RstUtils::toRst( - \sprintf( - "\n\nYou should use %s instead.", - Utils::naturalLanguageJoinWithBackticks($alternatives) - ), - 0 - ); - } else { - $deprecationDescription .= 'No replacement available.'; - } - - $warnings[] = $deprecationDescription; - } - - if ($definition->isRisky()) { - $warnings[] = <<<'RST' - - This set contains rules that are risky - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Using this rule set may lead to changes in your code's logic and behaviour. Use it with caution and review changes before incorporating them into your code base. - RST; - } - - if ([] !== $warnings) { - $warningsHeader = 1 === \count($warnings) ? 'Warning' : 'Warnings'; - - $warningsHeaderLine = str_repeat('-', \strlen($warningsHeader)); - $doc .= "\n\n".implode( - "\n", - [ - $warningsHeader, - $warningsHeaderLine, - ...$warnings, - ] - ); - } - - $rules = $definition->getRules(); - - if ([] === $rules) { - $doc .= "\n\nThis is an empty set."; - } else { - $enabledRules = array_filter($rules, static fn ($config) => false !== $config); - $disabledRules = array_filter($rules, static fn ($config) => false === $config); - - $listRules = function (array $rules) use (&$doc, $fixerNames): void { - foreach ($rules as $rule => $config) { - if (str_starts_with($rule, '@')) { - $ruleSetPath = $this->locator->getRuleSetsDocumentationFilePath($rule); - $ruleSetPath = substr($ruleSetPath, strrpos($ruleSetPath, '/')); - - $doc .= "\n- `{$rule} <.{$ruleSetPath}>`_"; - } else { - $path = Preg::replace( - '#^'.preg_quote($this->locator->getFixersDocumentationDirectoryPath(), '#').'/#', - './../rules/', - $this->locator->getFixerDocumentationFilePath($fixerNames[$rule]) - ); - - $doc .= "\n- `{$rule} <{$path}>`_"; - } - - if (!\is_bool($config)) { - $doc .= " with config:\n\n ``".Utils::toString($config)."``\n"; - } - } - }; - - if ([] !== $enabledRules) { - $doc .= "\n\nRules\n-----\n"; - $listRules($enabledRules); - } - - if ([] !== $disabledRules) { - $doc .= "\n\nDisabled rules\n--------------\n"; - $listRules($disabledRules); - } - } - - return $doc."\n"; - } - - /** - * @param array $setDefinitions - */ - public function generateRuleSetsDocumentationIndex(array $setDefinitions): string - { - $documentation = <<<'RST' - =========================== - List of Available Rule sets - =========================== - RST; - - foreach ($setDefinitions as $path => $definition) { - $path = substr($path, strrpos($path, '/')); - - $attributes = []; - - if ($definition instanceof DeprecatedRuleSetDescriptionInterface) { - $attributes[] = 'deprecated'; - } - - $attributes = 0 === \count($attributes) - ? '' - : ' *('.implode(', ', $attributes).')*'; - - $documentation .= "\n- `{$definition->getName()} <.{$path}>`_{$attributes}"; - } - - return $documentation."\n"; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php deleted file mode 100644 index e20ff2f7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php +++ /dev/null @@ -1,125 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Error; - -/** - * An abstraction for errors that can occur before and during fixing. - * - * @author Andreas Möller - * - * @readonly - * - * @internal - */ -final class Error implements \JsonSerializable -{ - /** - * Error which has occurred in linting phase, before applying any fixers. - */ - public const TYPE_INVALID = 1; - - /** - * Error which has occurred during fixing phase. - */ - public const TYPE_EXCEPTION = 2; - - /** - * Error which has occurred in linting phase, after applying any fixers. - */ - public const TYPE_LINT = 3; - - /** @var self::TYPE_* */ - private int $type; - - private string $filePath; - - private ?\Throwable $source; - - /** - * @var list - */ - private array $appliedFixers; - - private ?string $diff; - - /** - * @param self::TYPE_* $type - * @param list $appliedFixers - */ - public function __construct(int $type, string $filePath, ?\Throwable $source = null, array $appliedFixers = [], ?string $diff = null) - { - $this->type = $type; - $this->filePath = $filePath; - $this->source = $source; - $this->appliedFixers = $appliedFixers; - $this->diff = $diff; - } - - public function getFilePath(): string - { - return $this->filePath; - } - - public function getSource(): ?\Throwable - { - return $this->source; - } - - public function getType(): int - { - return $this->type; - } - - /** - * @return list - */ - public function getAppliedFixers(): array - { - return $this->appliedFixers; - } - - public function getDiff(): ?string - { - return $this->diff; - } - - /** - * @return array{ - * type: self::TYPE_*, - * filePath: string, - * source: null|array{class: class-string, message: string, code: int, file: string, line: int}, - * appliedFixers: list, - * diff: null|string - * } - */ - public function jsonSerialize(): array - { - return [ - 'type' => $this->type, - 'filePath' => $this->filePath, - 'source' => null !== $this->source - ? [ - 'class' => \get_class($this->source), - 'message' => $this->source->getMessage(), - 'code' => $this->source->getCode(), - 'file' => $this->source->getFile(), - 'line' => $this->source->getLine(), - ] - : null, - 'appliedFixers' => $this->appliedFixers, - 'diff' => $this->diff, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php deleted file mode 100644 index e6333db8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php +++ /dev/null @@ -1,83 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Error; - -/** - * Manager of errors that occur during fixing. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class ErrorsManager -{ - /** - * @var list - */ - private array $errors = []; - - /** - * Returns errors reported during linting before fixing. - * - * @return list - */ - public function getInvalidErrors(): array - { - return array_filter($this->errors, static fn (Error $error): bool => Error::TYPE_INVALID === $error->getType()); - } - - /** - * Returns errors reported during fixing. - * - * @return list - */ - public function getExceptionErrors(): array - { - return array_filter($this->errors, static fn (Error $error): bool => Error::TYPE_EXCEPTION === $error->getType()); - } - - /** - * Returns errors reported during linting after fixing. - * - * @return list - */ - public function getLintErrors(): array - { - return array_filter($this->errors, static fn (Error $error): bool => Error::TYPE_LINT === $error->getType()); - } - - /** - * Returns errors reported for specified path. - * - * @return list - */ - public function forPath(string $path): array - { - return array_values(array_filter($this->errors, static fn (Error $error): bool => $path === $error->getFilePath())); - } - - /** - * Returns true if no errors were reported. - */ - public function isEmpty(): bool - { - return [] === $this->errors; - } - - public function report(Error $error): void - { - $this->errors[] = $error; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/SourceExceptionFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/SourceExceptionFactory.php deleted file mode 100644 index 03773861..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Error/SourceExceptionFactory.php +++ /dev/null @@ -1,62 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Error; - -/** - * @readonly - * - * @internal - */ -final class SourceExceptionFactory -{ - /** - * @param array{class: class-string<\Throwable>, message: string, code: int, file: string, line: int} $error - */ - public static function fromArray(array $error): \Throwable - { - $exceptionClass = $error['class']; - - try { - $exception = new $exceptionClass($error['message'], $error['code']); - - if ( - $exception->getMessage() !== $error['message'] - || $exception->getCode() !== $error['code'] - ) { - throw new \RuntimeException('Failed to create exception from array. Message and code are not the same.'); - } - } catch (\Throwable $e) { - $exception = new \RuntimeException( - \sprintf('[%s] %s', $exceptionClass, $error['message']), - $error['code'] - ); - } - - try { - $exceptionReflection = new \ReflectionClass($exception); - foreach (['file', 'line'] as $property) { - $propertyReflection = $exceptionReflection->getProperty($property); - $propertyReflection->setAccessible(true); - $propertyReflection->setValue($exception, $error[$property]); - $propertyReflection->setAccessible(false); - } - } catch (\Throwable $reflectionException) { - // Ignore if we were not able to set file/line properties. In most cases it should be fine, - // we just need to make sure nothing is broken when we recreate errors from raw data passed from worker. - } - - return $exception; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php deleted file mode 100644 index 003398e4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php +++ /dev/null @@ -1,58 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class ExecutorWithoutErrorHandler -{ - private function __construct() {} - - /** - * @template T - * - * @param callable(): T $callback - * - * @return T - * - * @throws ExecutorWithoutErrorHandlerException - */ - public static function execute(callable $callback) - { - /** @var ?string */ - $error = null; - - set_error_handler(static function (int $errorNumber, string $errorString, string $errorFile, int $errorLine) use (&$error): bool { - $error = $errorString; - - return true; - }); - - try { - $result = $callback(); - } finally { - restore_error_handler(); - } - - if (null !== $error) { - throw new ExecutorWithoutErrorHandlerException($error); - } - - return $result; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php deleted file mode 100644 index 750352a2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class ExecutorWithoutErrorHandlerException extends \RuntimeException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileReader.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileReader.php deleted file mode 100644 index 30eeabef..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileReader.php +++ /dev/null @@ -1,70 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * File reader that unify access to regular file and stdin-alike file. - * - * Regular file could be read multiple times with `file_get_contents`, but file provided on stdin cannot. - * Consecutive try will provide empty content for stdin-alike file. - * This reader unifies access to them. - * - * @internal - */ -final class FileReader -{ - private ?string $stdinContent = null; - - public static function createSingleton(): self - { - static $instance = null; - - if (!$instance) { - $instance = new self(); - } - - return $instance; - } - - public function read(string $filePath): string - { - if ('php://stdin' === $filePath) { - if (null === $this->stdinContent) { - $this->stdinContent = $this->readRaw($filePath); - } - - return $this->stdinContent; - } - - return $this->readRaw($filePath); - } - - private function readRaw(string $realPath): string - { - $content = @file_get_contents($realPath); - - if (false === $content) { - $error = error_get_last(); - - throw new \RuntimeException(\sprintf( - 'Failed to read content from "%s".%s', - $realPath, - null !== $error ? ' '.$error['message'] : '' - )); - } - - return $content; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php deleted file mode 100644 index 148a4c5e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php +++ /dev/null @@ -1,100 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * Handles files removal with possibility to remove them on shutdown. - * - * @author Adam Klvač - * @author Dariusz Rumiński - * - * @internal - */ -final class FileRemoval -{ - /** - * List of observed files to be removed. - * - * @var array - */ - private array $files = []; - - public function __construct() - { - register_shutdown_function([$this, 'clean']); - } - - public function __destruct() - { - $this->clean(); - } - - /** - * This class is not intended to be serialized, - * and cannot be deserialized (see __wakeup method). - */ - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.self::class); - } - - /** - * Disable the deserialization of the class to prevent attacker executing - * code by leveraging the __destruct method. - * - * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection - */ - public function __wakeup(): void - { - throw new \BadMethodCallException('Cannot unserialize '.self::class); - } - - /** - * Adds a file to be removed. - */ - public function observe(string $path): void - { - $this->files[$path] = true; - } - - /** - * Removes a file from shutdown removal. - */ - public function delete(string $path): void - { - if (isset($this->files[$path])) { - unset($this->files[$path]); - } - - $this->unlink($path); - } - - /** - * Removes attached files. - */ - public function clean(): void - { - foreach ($this->files as $file => $value) { - $this->unlink($file); - } - - $this->files = []; - } - - private function unlink(string $path): void - { - @unlink($path); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Finder.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Finder.php deleted file mode 100644 index 419354ef..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Finder.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use Symfony\Component\Finder\Finder as BaseFinder; - -/** - * @author Fabien Potencier - * @author Dariusz Rumiński - */ -class Finder extends BaseFinder -{ - public function __construct() - { - parent::__construct(); - - $this - ->files() - ->name('/\.php$/') - ->exclude('vendor') - ; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractIncrementOperatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractIncrementOperatorFixer.php deleted file mode 100644 index 3a2db980..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractIncrementOperatorFixer.php +++ /dev/null @@ -1,58 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Tokenizer\Tokens; - -abstract class AbstractIncrementOperatorFixer extends AbstractFixer -{ - final protected function findStart(Tokens $tokens, int $index): int - { - do { - $index = $tokens->getPrevMeaningfulToken($index); - $token = $tokens[$index]; - - $blockType = Tokens::detectBlockType($token); - if (null !== $blockType && !$blockType['isStart']) { - $index = $tokens->findBlockStart($blockType['type'], $index); - $token = $tokens[$index]; - } - } while (!$token->equalsAny(['$', [T_VARIABLE]])); - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - $prevToken = $tokens[$prevIndex]; - - if ($prevToken->equals('$')) { - return $this->findStart($tokens, $index); - } - - if ($prevToken->isObjectOperator()) { - return $this->findStart($tokens, $prevIndex); - } - - if ($prevToken->isGivenKind(T_PAAMAYIM_NEKUDOTAYIM)) { - $prevPrevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - if (!$tokens[$prevPrevIndex]->isGivenKind([T_STATIC, T_STRING])) { - return $this->findStart($tokens, $prevIndex); - } - - $index = $tokens->getTokenNotOfKindsSibling($prevIndex, -1, [T_NS_SEPARATOR, T_STATIC, T_STRING]); - $index = $tokens->getNextMeaningfulToken($index); - } - - return $index; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php deleted file mode 100644 index b6a8660c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php +++ /dev/null @@ -1,277 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\Line; -use PhpCsFixer\Indicator\PhpUnitTestCaseIndicator; -use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -abstract class AbstractPhpUnitFixer extends AbstractFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAllTokenKindsFound([T_CLASS, T_STRING]); - } - - final protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $phpUnitTestCaseIndicator = new PhpUnitTestCaseIndicator(); - - foreach ($phpUnitTestCaseIndicator->findPhpUnitClasses($tokens) as $indices) { - $this->applyPhpUnitClassFix($tokens, $indices[0], $indices[1]); - } - } - - abstract protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void; - - final protected function getDocBlockIndex(Tokens $tokens, int $index): int - { - $modifiers = [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_FINAL, T_ABSTRACT, T_COMMENT]; - - if (\defined('T_ATTRIBUTE')) { // @TODO: drop condition when PHP 8.0+ is required - $modifiers[] = T_ATTRIBUTE; - } - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.2+ is required - $modifiers[] = T_READONLY; - } - - do { - $index = $tokens->getPrevNonWhitespace($index); - - if ($tokens[$index]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - $index = $tokens->getPrevTokenOfKind($index, [[T_ATTRIBUTE]]); - } - } while ($tokens[$index]->isGivenKind($modifiers)); - - return $index; - } - - /** - * @param list $preventingAnnotations - * @param list $preventingAttributes - */ - final protected function ensureIsDocBlockWithAnnotation( - Tokens $tokens, - int $index, - string $annotation, - array $preventingAnnotations, - array $preventingAttributes - ): void { - $docBlockIndex = $this->getDocBlockIndex($tokens, $index); - - if (self::isPreventedByAttribute($tokens, $index, $preventingAttributes)) { - return; - } - - if ($this->isPHPDoc($tokens, $docBlockIndex)) { - $this->updateDocBlockIfNeeded($tokens, $docBlockIndex, $annotation, $preventingAnnotations); - } else { - $this->createDocBlock($tokens, $docBlockIndex, $annotation); - } - } - - final protected function isPHPDoc(Tokens $tokens, int $index): bool - { - return $tokens[$index]->isGivenKind(T_DOC_COMMENT); - } - - /** - * @return iterable - */ - protected function getPreviousAssertCall(Tokens $tokens, int $startIndex, int $endIndex): iterable - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - for ($index = $endIndex; $index > $startIndex; --$index) { - $index = $tokens->getPrevTokenOfKind($index, [[T_STRING]]); - - if (null === $index) { - return; - } - - // test if "assert" something call - $loweredContent = strtolower($tokens[$index]->getContent()); - - if (!str_starts_with($loweredContent, 'assert')) { - continue; - } - - // test candidate for simple calls like: ([\]+'some fixable call'(...)) - $openBraceIndex = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$openBraceIndex]->equals('(')) { - continue; - } - - if (!$functionsAnalyzer->isTheSameClassCall($tokens, $index)) { - continue; - } - - yield [ - 'index' => $index, - 'loweredName' => $loweredContent, - 'openBraceIndex' => $openBraceIndex, - 'closeBraceIndex' => $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openBraceIndex), - ]; - } - } - - private function createDocBlock(Tokens $tokens, int $docBlockIndex, string $annotation): void - { - $lineEnd = $this->whitespacesConfig->getLineEnding(); - $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex)); - $toInsert = [ - new Token([T_DOC_COMMENT, "/**{$lineEnd}{$originalIndent} * @{$annotation}{$lineEnd}{$originalIndent} */"]), - new Token([T_WHITESPACE, $lineEnd.$originalIndent]), - ]; - $index = $tokens->getNextMeaningfulToken($docBlockIndex); - $tokens->insertAt($index, $toInsert); - - if (!$tokens[$index - 1]->isGivenKind(T_WHITESPACE)) { - $extraNewLines = $this->whitespacesConfig->getLineEnding(); - - if (!$tokens[$index - 1]->isGivenKind(T_OPEN_TAG)) { - $extraNewLines .= $this->whitespacesConfig->getLineEnding(); - } - - $tokens->insertAt($index, [ - new Token([T_WHITESPACE, $extraNewLines.WhitespacesAnalyzer::detectIndent($tokens, $index)]), - ]); - } - } - - /** - * @param list $preventingAnnotations - */ - private function updateDocBlockIfNeeded( - Tokens $tokens, - int $docBlockIndex, - string $annotation, - array $preventingAnnotations - ): void { - $doc = new DocBlock($tokens[$docBlockIndex]->getContent()); - foreach ($preventingAnnotations as $preventingAnnotation) { - if ([] !== $doc->getAnnotationsOfType($preventingAnnotation)) { - return; - } - } - $doc = $this->makeDocBlockMultiLineIfNeeded($doc, $tokens, $docBlockIndex, $annotation); - - $lines = $this->addInternalAnnotation($doc, $tokens, $docBlockIndex, $annotation); - $lines = implode('', $lines); - - $tokens[$docBlockIndex] = new Token([T_DOC_COMMENT, $lines]); - } - - /** - * @param list $preventingAttributes - */ - private static function isPreventedByAttribute(Tokens $tokens, int $index, array $preventingAttributes): bool - { - if ([] === $preventingAttributes) { - return false; - } - - $modifiers = [T_FINAL]; - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.2+ is required - $modifiers[] = T_READONLY; - } - - do { - $index = $tokens->getPrevMeaningfulToken($index); - } while ($tokens[$index]->isGivenKind($modifiers)); - if (!$tokens[$index]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - return false; - } - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); - - foreach (AttributeAnalyzer::collect($tokens, $index) as $attributeAnalysis) { - foreach ($attributeAnalysis->getAttributes() as $attribute) { - if (\in_array(ltrim(self::getFullyQualifiedName($tokens, $attribute['name']), '\\'), $preventingAttributes, true)) { - return true; - } - } - } - - return false; - } - - private static function getFullyQualifiedName(Tokens $tokens, string $name): string - { - $name = strtolower($name); - - $names = []; - foreach ((new NamespaceUsesAnalyzer())->getDeclarationsFromTokens($tokens) as $namespaceUseAnalysis) { - $names[strtolower($namespaceUseAnalysis->getShortName())] = strtolower($namespaceUseAnalysis->getFullName()); - } - - foreach ($names as $shortName => $fullName) { - if ($name === $shortName) { - return $fullName; - } - - if (!str_starts_with($name, $shortName.'\\')) { - continue; - } - - return $fullName.substr($name, \strlen($shortName)); - } - - return $name; - } - - /** - * @return list - */ - private function addInternalAnnotation(DocBlock $docBlock, Tokens $tokens, int $docBlockIndex, string $annotation): array - { - $lines = $docBlock->getLines(); - $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $docBlockIndex); - $lineEnd = $this->whitespacesConfig->getLineEnding(); - array_splice($lines, -1, 0, $originalIndent.' * @'.$annotation.$lineEnd); - - return $lines; - } - - private function makeDocBlockMultiLineIfNeeded(DocBlock $doc, Tokens $tokens, int $docBlockIndex, string $annotation): DocBlock - { - $lines = $doc->getLines(); - if (1 === \count($lines) && [] === $doc->getAnnotationsOfType($annotation)) { - $indent = WhitespacesAnalyzer::detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex)); - $doc->makeMultiLine($indent, $this->whitespacesConfig->getLineEnding()); - - return $doc; - } - - return $doc; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractShortOperatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractShortOperatorFixer.php deleted file mode 100644 index 1897e042..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractShortOperatorFixer.php +++ /dev/null @@ -1,264 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Tokenizer\Analyzer\AlternativeSyntaxAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\RangeAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -abstract class AbstractShortOperatorFixer extends AbstractFixer -{ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $alternativeSyntaxAnalyzer = new AlternativeSyntaxAnalyzer(); - - for ($index = \count($tokens) - 1; $index > 3; --$index) { - if (!$this->isOperatorTokenCandidate($tokens, $index)) { - continue; - } - - // get what is before the operator - - $beforeRange = $this->getBeforeOperatorRange($tokens, $index); - $equalsIndex = $tokens->getPrevMeaningfulToken($beforeRange['start']); - - // make sure that before that is '=' - - if (!$tokens[$equalsIndex]->equals('=')) { - continue; - } - - // get and check what is before '=' - - $assignRange = $this->getBeforeOperatorRange($tokens, $equalsIndex); - $beforeAssignmentIndex = $tokens->getPrevMeaningfulToken($assignRange['start']); - - if ($tokens[$beforeAssignmentIndex]->equals(':')) { - if (!$this->belongsToSwitchOrAlternativeSyntax($alternativeSyntaxAnalyzer, $tokens, $beforeAssignmentIndex)) { - continue; - } - } elseif (!$tokens[$beforeAssignmentIndex]->equalsAny([';', '{', '}', '(', ')', ',', [T_OPEN_TAG], [T_RETURN]])) { - continue; - } - - // check if "assign" and "before" the operator are (functionally) the same - - if (RangeAnalyzer::rangeEqualsRange($tokens, $assignRange, $beforeRange)) { - $this->shortenOperation($tokens, $equalsIndex, $index, $assignRange, $beforeRange); - - continue; - } - - if (!$this->isOperatorCommutative($tokens[$index])) { - continue; - } - - $afterRange = $this->getAfterOperatorRange($tokens, $index); - - // check if "assign" and "after" the operator are (functionally) the same - if (!RangeAnalyzer::rangeEqualsRange($tokens, $assignRange, $afterRange)) { - continue; - } - - $this->shortenOperation($tokens, $equalsIndex, $index, $assignRange, $afterRange); - } - } - - abstract protected function getReplacementToken(Token $token): Token; - - abstract protected function isOperatorTokenCandidate(Tokens $tokens, int $index): bool; - - /** - * @param array{start: int, end: int} $assignRange - * @param array{start: int, end: int} $operatorRange - */ - private function shortenOperation( - Tokens $tokens, - int $equalsIndex, - int $operatorIndex, - array $assignRange, - array $operatorRange - ): void { - $tokens[$equalsIndex] = $this->getReplacementToken($tokens[$operatorIndex]); - $tokens->clearTokenAndMergeSurroundingWhitespace($operatorIndex); - $this->clearMeaningfulFromRange($tokens, $operatorRange); - - foreach ([$equalsIndex, $assignRange['end']] as $i) { - $i = $tokens->getNonEmptySibling($i, 1); - - if ($tokens[$i]->isWhitespace(" \t")) { - $tokens[$i] = new Token([T_WHITESPACE, ' ']); - } elseif (!$tokens[$i]->isWhitespace()) { - $tokens->insertAt($i, new Token([T_WHITESPACE, ' '])); - } - } - } - - /** - * @return array{start: int, end: int} - */ - private function getAfterOperatorRange(Tokens $tokens, int $index): array - { - $index = $tokens->getNextMeaningfulToken($index); - $range = ['start' => $index]; - - while (true) { - $nextIndex = $tokens->getNextMeaningfulToken($index); - - if (null === $nextIndex || $tokens[$nextIndex]->equalsAny([';', ',', [T_CLOSE_TAG]])) { - break; - } - - $blockType = Tokens::detectBlockType($tokens[$nextIndex]); - - if (null === $blockType) { - $index = $nextIndex; - - continue; - } - - if (false === $blockType['isStart']) { - break; - } - - $index = $tokens->findBlockEnd($blockType['type'], $nextIndex); - } - - $range['end'] = $index; - - return $range; - } - - /** - * @return array{start: int, end: int} - */ - private function getBeforeOperatorRange(Tokens $tokens, int $index): array - { - static $blockOpenTypes; - - if (null === $blockOpenTypes) { - $blockOpenTypes = [',']; // not a true "block type", but speeds up things - - foreach (Tokens::getBlockEdgeDefinitions() as $definition) { - $blockOpenTypes[] = $definition['start']; - } - } - - $controlStructureWithoutBracesTypes = [T_IF, T_ELSE, T_ELSEIF, T_FOR, T_FOREACH, T_WHILE]; - - $previousIndex = $tokens->getPrevMeaningfulToken($index); - $previousToken = $tokens[$previousIndex]; - - if ($tokens[$previousIndex]->equalsAny($blockOpenTypes)) { - return ['start' => $index, 'end' => $index]; - } - - $range = ['end' => $previousIndex]; - $index = $previousIndex; - - while ($previousToken->equalsAny([ - '$', - ']', - ')', - [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], - [CT::T_DYNAMIC_PROP_BRACE_CLOSE], - [CT::T_DYNAMIC_VAR_BRACE_CLOSE], - [T_NS_SEPARATOR], - [T_STRING], - [T_VARIABLE], - ])) { - $blockType = Tokens::detectBlockType($previousToken); - - if (null !== $blockType) { - $blockStart = $tokens->findBlockStart($blockType['type'], $previousIndex); - - if ($tokens[$previousIndex]->equals(')') && $tokens[$tokens->getPrevMeaningfulToken($blockStart)]->isGivenKind($controlStructureWithoutBracesTypes)) { - break; // we went too far back - } - - $previousIndex = $blockStart; - } - - $index = $previousIndex; - $previousIndex = $tokens->getPrevMeaningfulToken($previousIndex); - $previousToken = $tokens[$previousIndex]; - } - - if ($previousToken->isGivenKind(T_OBJECT_OPERATOR)) { - $index = $this->getBeforeOperatorRange($tokens, $previousIndex)['start']; - } elseif ($previousToken->isGivenKind(T_PAAMAYIM_NEKUDOTAYIM)) { - $index = $this->getBeforeOperatorRange($tokens, $tokens->getPrevMeaningfulToken($previousIndex))['start']; - } - - $range['start'] = $index; - - return $range; - } - - /** - * @param array{start: int, end: int} $range - */ - private function clearMeaningfulFromRange(Tokens $tokens, array $range): void - { - // $range['end'] must be meaningful! - for ($i = $range['end']; $i >= $range['start']; $i = $tokens->getPrevMeaningfulToken($i)) { - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - } - } - - private function isOperatorCommutative(Token $operatorToken): bool - { - static $commutativeKinds = ['*', '|', '&', '^']; // note that for arrays in PHP `+` is not commutative - static $nonCommutativeKinds = ['-', '/', '.', '%', '+']; - - if ($operatorToken->isGivenKind(T_COALESCE)) { - return false; - } - - if ($operatorToken->equalsAny($commutativeKinds)) { - return true; - } - - if ($operatorToken->equalsAny($nonCommutativeKinds)) { - return false; - } - - throw new \InvalidArgumentException(\sprintf('Not supported operator "%s".', $operatorToken->toJson())); - } - - private function belongsToSwitchOrAlternativeSyntax(AlternativeSyntaxAnalyzer $alternativeSyntaxAnalyzer, Tokens $tokens, int $index): bool - { - $candidate = $index; - $index = $tokens->getPrevMeaningfulToken($candidate); - - if ($tokens[$index]->isGivenKind(T_DEFAULT)) { - return true; - } - - $index = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$index]->isGivenKind(T_CASE)) { - return true; - } - - return $alternativeSyntaxAnalyzer->belongsToAlternativeSyntax($tokens, $candidate); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ArrayPushFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ArrayPushFixer.php deleted file mode 100644 index 9023bbd3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ArrayPushFixer.php +++ /dev/null @@ -1,207 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Alias; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class ArrayPushFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Converts simple usages of `array_push($x, $y);` to `$x[] = $y;`.', - [new CodeSample("isTokenKindFound(T_STRING) && $tokens->count() > 7; - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - for ($index = $tokens->count() - 7; $index > 0; --$index) { - if (!$tokens[$index]->equals([T_STRING, 'array_push'], false)) { - continue; - } - - if (!$functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { - continue; // redeclare/override - } - - // meaningful before must be `getPrevMeaningfulToken($index); - $namespaceSeparatorIndex = null; - - if ($tokens[$index]->isGivenKind(T_NS_SEPARATOR)) { - $namespaceSeparatorIndex = $index; - $index = $tokens->getPrevMeaningfulToken($index); - } - - if (!$tokens[$index]->equalsAny([';', '{', '}', ')', [T_OPEN_TAG]])) { - continue; - } - - // figure out where the arguments list opens - - $openBraceIndex = $tokens->getNextMeaningfulToken($callIndex); - $blockType = Tokens::detectBlockType($tokens[$openBraceIndex]); - - if (null === $blockType || Tokens::BLOCK_TYPE_PARENTHESIS_BRACE !== $blockType['type']) { - continue; - } - - // figure out where the arguments list closes - - $closeBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openBraceIndex); - - // meaningful after `)` must be `;`, `? >` or nothing - - $afterCloseBraceIndex = $tokens->getNextMeaningfulToken($closeBraceIndex); - - if (null !== $afterCloseBraceIndex && !$tokens[$afterCloseBraceIndex]->equalsAny([';', [T_CLOSE_TAG]])) { - continue; - } - - // must have 2 arguments - - // first argument must be a variable (with possibly array indexing etc.), - // after that nothing meaningful should be there till the next `,` or `)` - // if `)` than we cannot fix it (it is a single argument call) - - $firstArgumentStop = $this->getFirstArgumentEnd($tokens, $openBraceIndex); - $firstArgumentStop = $tokens->getNextMeaningfulToken($firstArgumentStop); - - if (!$tokens[$firstArgumentStop]->equals(',')) { - return; - } - - // second argument can be about anything but ellipsis, we must make sure there is not - // a third argument (or more) passed to `array_push` - - $secondArgumentStart = $tokens->getNextMeaningfulToken($firstArgumentStop); - $secondArgumentStop = $this->getSecondArgumentEnd($tokens, $secondArgumentStart, $closeBraceIndex); - - if (null === $secondArgumentStop) { - continue; - } - - // candidate is valid, replace tokens - - $tokens->clearTokenAndMergeSurroundingWhitespace($closeBraceIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($firstArgumentStop); - $tokens->insertAt( - $firstArgumentStop, - [ - new Token('['), - new Token(']'), - new Token([T_WHITESPACE, ' ']), - new Token('='), - ] - ); - $tokens->clearTokenAndMergeSurroundingWhitespace($openBraceIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($callIndex); - - if (null !== $namespaceSeparatorIndex) { - $tokens->clearTokenAndMergeSurroundingWhitespace($namespaceSeparatorIndex); - } - } - } - - private function getFirstArgumentEnd(Tokens $tokens, int $index): int - { - $nextIndex = $tokens->getNextMeaningfulToken($index); - $nextToken = $tokens[$nextIndex]; - - while ($nextToken->equalsAny([ - '$', - '[', - '(', - [CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN], - [CT::T_DYNAMIC_PROP_BRACE_OPEN], - [CT::T_DYNAMIC_VAR_BRACE_OPEN], - [CT::T_NAMESPACE_OPERATOR], - [T_NS_SEPARATOR], - [T_STATIC], - [T_STRING], - [T_VARIABLE], - ])) { - $blockType = Tokens::detectBlockType($nextToken); - - if (null !== $blockType) { - $nextIndex = $tokens->findBlockEnd($blockType['type'], $nextIndex); - } - - $index = $nextIndex; - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - $nextToken = $tokens[$nextIndex]; - } - - if ($nextToken->isGivenKind(T_OBJECT_OPERATOR)) { - return $this->getFirstArgumentEnd($tokens, $nextIndex); - } - - if ($nextToken->isGivenKind(T_PAAMAYIM_NEKUDOTAYIM)) { - return $this->getFirstArgumentEnd($tokens, $tokens->getNextMeaningfulToken($nextIndex)); - } - - return $index; - } - - /** - * @param int $endIndex boundary, i.e. tokens index of `)` - */ - private function getSecondArgumentEnd(Tokens $tokens, int $index, int $endIndex): ?int - { - if ($tokens[$index]->isGivenKind(T_ELLIPSIS)) { - return null; - } - - for (; $index <= $endIndex; ++$index) { - $blockType = Tokens::detectBlockType($tokens[$index]); - - while (null !== $blockType && $blockType['isStart']) { - $index = $tokens->findBlockEnd($blockType['type'], $index); - $index = $tokens->getNextMeaningfulToken($index); - $blockType = Tokens::detectBlockType($tokens[$index]); - } - - if ($tokens[$index]->equals(',') || $tokens[$index]->isGivenKind([T_YIELD, T_YIELD_FROM, T_LOGICAL_AND, T_LOGICAL_OR, T_LOGICAL_XOR])) { - return null; - } - } - - return $endIndex; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php deleted file mode 100644 index 70865e6c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php +++ /dev/null @@ -1,149 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Alias; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - */ -final class BacktickToShellExecFixer extends AbstractFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound('`'); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Converts backtick operators to `shell_exec` calls.', - [ - new CodeSample( - <<<'EOT' - call()}`; - - EOT - ), - ], - 'Conversion is done only when it is non risky, so when special chars like single-quotes, double-quotes and backticks are not used inside the command.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before ExplicitStringVariableFixer, NativeFunctionInvocationFixer, SingleQuoteFixer. - */ - public function getPriority(): int - { - return 17; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $backtickStarted = false; - $backtickTokens = []; - for ($index = $tokens->count() - 1; $index > 0; --$index) { - $token = $tokens[$index]; - - if (!$token->equals('`')) { - if ($backtickStarted) { - $backtickTokens[$index] = $token; - } - - continue; - } - - $backtickTokens[$index] = $token; - - if ($backtickStarted) { - $this->fixBackticks($tokens, $backtickTokens); - $backtickTokens = []; - } - - $backtickStarted = !$backtickStarted; - } - } - - /** - * Override backtick code with corresponding double-quoted string. - * - * @param array $backtickTokens - */ - private function fixBackticks(Tokens $tokens, array $backtickTokens): void - { - // Track indices for final override - ksort($backtickTokens); - $openingBacktickIndex = array_key_first($backtickTokens); - $closingBacktickIndex = array_key_last($backtickTokens); - - // Strip enclosing backticks - array_shift($backtickTokens); - array_pop($backtickTokens); - - // Double-quoted strings are parsed differently if they contain - // variables or not, so we need to build the new token array accordingly - $count = \count($backtickTokens); - - $newTokens = [ - new Token([T_STRING, 'shell_exec']), - new Token('('), - ]; - - if (1 !== $count) { - $newTokens[] = new Token('"'); - } - - foreach ($backtickTokens as $token) { - if (!$token->isGivenKind(T_ENCAPSED_AND_WHITESPACE)) { - $newTokens[] = $token; - - continue; - } - - $content = $token->getContent(); - // Escaping special chars depends on the context: too tricky - if (Preg::match('/[`"\']/u', $content)) { - return; - } - - $kind = T_ENCAPSED_AND_WHITESPACE; - - if (1 === $count) { - $content = '"'.$content.'"'; - $kind = T_CONSTANT_ENCAPSED_STRING; - } - - $newTokens[] = new Token([$kind, $content]); - } - - if (1 !== $count) { - $newTokens[] = new Token('"'); - } - - $newTokens[] = new Token(')'); - - $tokens->overrideRange($openingBacktickIndex, $closingBacktickIndex, $newTokens); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php deleted file mode 100644 index f7579861..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php +++ /dev/null @@ -1,193 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Alias; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\PregException; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Matteo Beccati - */ -final class EregToPregFixer extends AbstractFixer -{ - /** - * @var list> the list of the ext/ereg function names, their preg equivalent and the preg modifier(s), if any - * all condensed in an array of arrays - */ - private const FUNCTIONS = [ - ['ereg', 'preg_match', ''], - ['eregi', 'preg_match', 'i'], - ['ereg_replace', 'preg_replace', ''], - ['eregi_replace', 'preg_replace', 'i'], - ['split', 'preg_split', ''], - ['spliti', 'preg_split', 'i'], - ]; - - /** - * @var list the list of preg delimiters, in order of preference - */ - private static array $delimiters = ['/', '#', '!']; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replace deprecated `ereg` regular expression functions with `preg`.', - [new CodeSample("isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $end = $tokens->count() - 1; - $functionsAnalyzer = new FunctionsAnalyzer(); - - foreach (self::FUNCTIONS as $map) { - // the sequence is the function name, followed by "(" and a quoted string - $seq = [[T_STRING, $map[0]], '(', [T_CONSTANT_ENCAPSED_STRING]]; - $currIndex = 0; - - while (true) { - $match = $tokens->findSequence($seq, $currIndex, $end, false); - - // did we find a match? - if (null === $match) { - break; - } - - // findSequence also returns the tokens, but we're only interested in the indices, i.e.: - // 0 => function name, - // 1 => parenthesis "(" - // 2 => quoted string passed as 1st parameter - $match = array_keys($match); - - // advance tokenizer cursor - $currIndex = $match[2]; - - if (!$functionsAnalyzer->isGlobalFunctionCall($tokens, $match[0])) { - continue; - } - - // ensure the first parameter is just a string (e.g. has nothing appended) - $next = $tokens->getNextMeaningfulToken($match[2]); - - if (null === $next || !$tokens[$next]->equalsAny([',', ')'])) { - continue; - } - - // convert to PCRE - $regexTokenContent = $tokens[$match[2]]->getContent(); - - if ('b' === $regexTokenContent[0] || 'B' === $regexTokenContent[0]) { - $quote = $regexTokenContent[1]; - $prefix = $regexTokenContent[0]; - $string = substr($regexTokenContent, 2, -1); - } else { - $quote = $regexTokenContent[0]; - $prefix = ''; - $string = substr($regexTokenContent, 1, -1); - } - - $delim = $this->getBestDelimiter($string); - $preg = $delim.addcslashes($string, $delim).$delim.'D'.$map[2]; - - // check if the preg is valid - if (!$this->checkPreg($preg)) { - continue; - } - - // modify function and argument - $tokens[$match[0]] = new Token([T_STRING, $map[1]]); - $tokens[$match[2]] = new Token([T_CONSTANT_ENCAPSED_STRING, $prefix.$quote.$preg.$quote]); - } - } - } - - /** - * Check the validity of a PCRE. - * - * @param string $pattern the regular expression - */ - private function checkPreg(string $pattern): bool - { - try { - Preg::match($pattern, ''); - - return true; - } catch (PregException $e) { - return false; - } - } - - /** - * Get the delimiter that would require the least escaping in a regular expression. - * - * @param string $pattern the regular expression - * - * @return string the preg delimiter - */ - private function getBestDelimiter(string $pattern): string - { - // try to find something that's not used - $delimiters = []; - - foreach (self::$delimiters as $k => $d) { - if (!str_contains($pattern, $d)) { - return $d; - } - - $delimiters[$d] = [substr_count($pattern, $d), $k]; - } - - // return the least used delimiter, using the position in the list as a tiebreaker - uasort($delimiters, static function (array $a, array $b): int { - if ($a[0] === $b[0]) { - return $a[1] <=> $b[1]; - } - - return $a[0] <=> $b[0]; - }); - - return array_key_first($delimiters); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php deleted file mode 100644 index 1cbbd874..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php +++ /dev/null @@ -1,141 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Alias; - -use PhpCsFixer\AbstractFunctionReferenceFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - */ -final class MbStrFunctionsFixer extends AbstractFunctionReferenceFixer -{ - /** - * list of the string-related function names and their mb_ equivalent. - * - * @var array< - * string, - * array{ - * alternativeName: string, - * argumentCount: list, - * }, - * > - */ - private static array $functionsMap = [ - 'str_split' => ['alternativeName' => 'mb_str_split', 'argumentCount' => [1, 2, 3]], - 'stripos' => ['alternativeName' => 'mb_stripos', 'argumentCount' => [2, 3]], - 'stristr' => ['alternativeName' => 'mb_stristr', 'argumentCount' => [2, 3]], - 'strlen' => ['alternativeName' => 'mb_strlen', 'argumentCount' => [1]], - 'strpos' => ['alternativeName' => 'mb_strpos', 'argumentCount' => [2, 3]], - 'strrchr' => ['alternativeName' => 'mb_strrchr', 'argumentCount' => [2]], - 'strripos' => ['alternativeName' => 'mb_strripos', 'argumentCount' => [2, 3]], - 'strrpos' => ['alternativeName' => 'mb_strrpos', 'argumentCount' => [2, 3]], - 'strstr' => ['alternativeName' => 'mb_strstr', 'argumentCount' => [2, 3]], - 'strtolower' => ['alternativeName' => 'mb_strtolower', 'argumentCount' => [1]], - 'strtoupper' => ['alternativeName' => 'mb_strtoupper', 'argumentCount' => [1]], - 'substr' => ['alternativeName' => 'mb_substr', 'argumentCount' => [2, 3]], - 'substr_count' => ['alternativeName' => 'mb_substr_count', 'argumentCount' => [2, 3, 4]], - ]; - - /** - * @var array< - * string, - * array{ - * alternativeName: string, - * argumentCount: list, - * }, - * > - */ - private array $functions; - - public function __construct() - { - parent::__construct(); - - if (\PHP_VERSION_ID >= 8_03_00) { - self::$functionsMap['str_pad'] = ['alternativeName' => 'mb_str_pad', 'argumentCount' => [1, 2, 3, 4]]; - } - - if (\PHP_VERSION_ID >= 8_04_00) { - self::$functionsMap['trim'] = ['alternativeName' => 'mb_trim', 'argumentCount' => [1, 2]]; - self::$functionsMap['ltrim'] = ['alternativeName' => 'mb_ltrim', 'argumentCount' => [1, 2]]; - self::$functionsMap['rtrim'] = ['alternativeName' => 'mb_rtrim', 'argumentCount' => [1, 2]]; - } - - $this->functions = array_filter( - self::$functionsMap, - static fn (array $mapping): bool => (new \ReflectionFunction($mapping['alternativeName']))->isInternal() - ); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replace non multibyte-safe functions with corresponding mb function.', - [ - new CodeSample( - 'functions as $functionIdentity => $functionReplacement) { - $currIndex = 0; - do { - // try getting function reference and translate boundaries for humans - $boundaries = $this->find($functionIdentity, $tokens, $currIndex, $tokens->count() - 1); - if (null === $boundaries) { - // next function search, as current one not found - continue 2; - } - - [$functionName, $openParenthesis, $closeParenthesis] = $boundaries; - $count = $argumentsAnalyzer->countArguments($tokens, $openParenthesis, $closeParenthesis); - if (!\in_array($count, $functionReplacement['argumentCount'], true)) { - continue 2; - } - - // analysing cursor shift, so nested calls could be processed - $currIndex = $openParenthesis; - - $tokens[$functionName] = new Token([T_STRING, $functionReplacement['alternativeName']]); - } while (null !== $currIndex); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ModernizeStrposFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ModernizeStrposFixer.php deleted file mode 100644 index 7842f541..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/ModernizeStrposFixer.php +++ /dev/null @@ -1,338 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Alias; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Alexander M. Turek - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * modernize_stripos?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * modernize_stripos: bool - * } - */ -final class ModernizeStrposFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const REPLACEMENTS = [ - [ - 'operator' => [T_IS_IDENTICAL, '==='], - 'operand' => [T_LNUMBER, '0'], - 'replacement' => [T_STRING, 'str_starts_with'], - 'negate' => false, - ], - [ - 'operator' => [T_IS_NOT_IDENTICAL, '!=='], - 'operand' => [T_LNUMBER, '0'], - 'replacement' => [T_STRING, 'str_starts_with'], - 'negate' => true, - ], - [ - 'operator' => [T_IS_NOT_IDENTICAL, '!=='], - 'operand' => [T_STRING, 'false'], - 'replacement' => [T_STRING, 'str_contains'], - 'negate' => false, - ], - [ - 'operator' => [T_IS_IDENTICAL, '==='], - 'operand' => [T_STRING, 'false'], - 'replacement' => [T_STRING, 'str_contains'], - 'negate' => true, - ], - ]; - - private bool $modernizeStripos = false; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replace `strpos()` and `stripos()` calls with `str_starts_with()` or `str_contains()` if possible.', - [ - new CodeSample( - ' true] - ), - ], - null, - 'Risky if `strpos`, `stripos`, `str_starts_with`, `str_contains` or `strtolower` functions are overridden.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before BinaryOperatorSpacesFixer, NoExtraBlankLinesFixer, NoSpacesInsideParenthesisFixer, NoTrailingWhitespaceFixer, NotOperatorWithSpaceFixer, NotOperatorWithSuccessorSpaceFixer, PhpUnitDedicateAssertFixer, SingleSpaceAfterConstructFixer, SingleSpaceAroundConstructFixer, SpacesInsideParenthesesFixer. - * Must run after StrictComparisonFixer. - */ - public function getPriority(): int - { - return 37; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_STRING) && $tokens->isAnyTokenKindsFound([T_IS_IDENTICAL, T_IS_NOT_IDENTICAL]); - } - - public function isRisky(): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - if (isset($this->configuration['modernize_stripos']) && true === $this->configuration['modernize_stripos']) { - $this->modernizeStripos = true; - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('modernize_stripos', 'Whether to modernize `stripos` calls as well.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) // @TODO change to "true" on next major 4.0 - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - $modernizeCandidates = [[T_STRING, 'strpos']]; - if ($this->modernizeStripos) { - $modernizeCandidates[] = [T_STRING, 'stripos']; - } - - for ($index = \count($tokens) - 1; $index > 0; --$index) { - // find candidate function call - if (!$tokens[$index]->equalsAny($modernizeCandidates, false) || !$functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { - continue; - } - - // assert called with 2 arguments - $openIndex = $tokens->getNextMeaningfulToken($index); - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); - $arguments = $argumentsAnalyzer->getArguments($tokens, $openIndex, $closeIndex); - - if (2 !== \count($arguments)) { - continue; - } - - // check if part condition and fix if needed - $compareTokens = $this->getCompareTokens($tokens, $index, -1); // look behind - - if (null === $compareTokens) { - $compareTokens = $this->getCompareTokens($tokens, $closeIndex, 1); // look ahead - } - - if (null !== $compareTokens) { - $isCaseInsensitive = $tokens[$index]->equals([T_STRING, 'stripos'], false); - $this->fixCall($tokens, $index, $compareTokens, $isCaseInsensitive); - } - } - } - - /** - * @param array{operator_index: int, operand_index: int} $operatorIndices - */ - private function fixCall(Tokens $tokens, int $functionIndex, array $operatorIndices, bool $isCaseInsensitive): void - { - foreach (self::REPLACEMENTS as $replacement) { - if (!$tokens[$operatorIndices['operator_index']]->equals($replacement['operator'])) { - continue; - } - - if (!$tokens[$operatorIndices['operand_index']]->equals($replacement['operand'], false)) { - continue; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($operatorIndices['operator_index']); - $tokens->clearTokenAndMergeSurroundingWhitespace($operatorIndices['operand_index']); - $tokens->clearTokenAndMergeSurroundingWhitespace($functionIndex); - - if ($replacement['negate']) { - $negateInsertIndex = $functionIndex; - - $prevFunctionIndex = $tokens->getPrevMeaningfulToken($functionIndex); - if ($tokens[$prevFunctionIndex]->isGivenKind(T_NS_SEPARATOR)) { - $negateInsertIndex = $prevFunctionIndex; - } - - $tokens->insertAt($negateInsertIndex, new Token('!')); - ++$functionIndex; - } - - $tokens->insertAt($functionIndex, new Token($replacement['replacement'])); - - if ($isCaseInsensitive) { - $this->wrapArgumentsWithStrToLower($tokens, $functionIndex); - } - - break; - } - } - - private function wrapArgumentsWithStrToLower(Tokens $tokens, int $functionIndex): void - { - $argumentsAnalyzer = new ArgumentsAnalyzer(); - $shouldAddNamespace = $tokens[$functionIndex - 1]->isGivenKind(T_NS_SEPARATOR); - - $openIndex = $tokens->getNextMeaningfulToken($functionIndex); - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); - $arguments = $argumentsAnalyzer->getArguments($tokens, $openIndex, $closeIndex); - - $firstArgumentIndexStart = array_key_first($arguments); - if (!isset($arguments[$firstArgumentIndexStart])) { - return; - } - $firstArgumentIndexEnd = $arguments[$firstArgumentIndexStart] + 3 + ($shouldAddNamespace ? 1 : 0); - - $isSecondArgumentTokenWhiteSpace = $tokens[array_key_last($arguments)]->isGivenKind(T_WHITESPACE); - - if ($isSecondArgumentTokenWhiteSpace) { - $secondArgumentIndexStart = $tokens->getNextMeaningfulToken(array_key_last($arguments)); - } else { - $secondArgumentIndexStart = array_key_last($arguments); - } - - $secondArgumentIndexStart += 3 + ($shouldAddNamespace ? 1 : 0); - if (!isset($arguments[array_key_last($arguments)])) { - return; - } - $secondArgumentIndexEnd = $arguments[array_key_last($arguments)] + 6 + ($shouldAddNamespace ? 1 : 0) + ($isSecondArgumentTokenWhiteSpace ? 1 : 0); - - if ($shouldAddNamespace) { - $tokens->insertAt($firstArgumentIndexStart, new Token([T_NS_SEPARATOR, '\\'])); - ++$firstArgumentIndexStart; - } - - $tokens->insertAt($firstArgumentIndexStart, [new Token([T_STRING, 'strtolower']), new Token('(')]); - $tokens->insertAt($firstArgumentIndexEnd, new Token(')')); - - if ($shouldAddNamespace) { - $tokens->insertAt($secondArgumentIndexStart, new Token([T_NS_SEPARATOR, '\\'])); - ++$secondArgumentIndexStart; - } - - $tokens->insertAt($secondArgumentIndexStart, [new Token([T_STRING, 'strtolower']), new Token('(')]); - $tokens->insertAt($secondArgumentIndexEnd, new Token(')')); - } - - /** - * @param -1|1 $direction - * - * @return null|array{operator_index: int, operand_index: int} - */ - private function getCompareTokens(Tokens $tokens, int $offsetIndex, int $direction): ?array - { - $operatorIndex = $tokens->getMeaningfulTokenSibling($offsetIndex, $direction); - - if (null !== $operatorIndex && $tokens[$operatorIndex]->isGivenKind(T_NS_SEPARATOR)) { - $operatorIndex = $tokens->getMeaningfulTokenSibling($operatorIndex, $direction); - } - - if (null === $operatorIndex || !$tokens[$operatorIndex]->isGivenKind([T_IS_IDENTICAL, T_IS_NOT_IDENTICAL])) { - return null; - } - - $operandIndex = $tokens->getMeaningfulTokenSibling($operatorIndex, $direction); - - if (null === $operandIndex) { - return null; - } - - $operand = $tokens[$operandIndex]; - - if (!$operand->equals([T_LNUMBER, '0']) && !$operand->equals([T_STRING, 'false'], false)) { - return null; - } - - $precedenceTokenIndex = $tokens->getMeaningfulTokenSibling($operandIndex, $direction); - - if (null !== $precedenceTokenIndex && $this->isOfHigherPrecedence($tokens[$precedenceTokenIndex])) { - return null; - } - - return ['operator_index' => $operatorIndex, 'operand_index' => $operandIndex]; - } - - private function isOfHigherPrecedence(Token $token): bool - { - static $operatorsKinds = [ - T_DEC, // -- - T_INC, // ++ - T_INSTANCEOF, // instanceof - T_IS_GREATER_OR_EQUAL, // >= - T_IS_SMALLER_OR_EQUAL, // <= - T_POW, // ** - T_SL, // << - T_SR, // >> - ]; - - static $operatorsPerContent = [ - '!', - '%', - '*', - '+', - '-', - '.', - '/', - '<', - '>', - '~', - ]; - - return $token->isGivenKind($operatorsKinds) || $token->equalsAny($operatorsPerContent); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php deleted file mode 100644 index efd042cf..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php +++ /dev/null @@ -1,337 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Alias; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Vladimir Reznichenko - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * sets?: list<'@all'|'@exif'|'@ftp'|'@IMAP'|'@internal'|'@ldap'|'@mbreg'|'@mysqli'|'@oci'|'@odbc'|'@openssl'|'@pcntl'|'@pg'|'@posix'|'@snmp'|'@sodium'|'@time'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * sets: list<'@all'|'@exif'|'@ftp'|'@IMAP'|'@internal'|'@ldap'|'@mbreg'|'@mysqli'|'@oci'|'@odbc'|'@openssl'|'@pcntl'|'@pg'|'@posix'|'@snmp'|'@sodium'|'@time'> - * } - */ -final class NoAliasFunctionsFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const SETS = [ - '@internal' => [ - 'diskfreespace' => 'disk_free_space', - - 'dns_check_record' => 'checkdnsrr', - 'dns_get_mx' => 'getmxrr', - - 'session_commit' => 'session_write_close', - - 'stream_register_wrapper' => 'stream_wrapper_register', - 'set_file_buffer' => 'stream_set_write_buffer', - 'socket_set_blocking' => 'stream_set_blocking', - 'socket_get_status' => 'stream_get_meta_data', - 'socket_set_timeout' => 'stream_set_timeout', - 'socket_getopt' => 'socket_get_option', - 'socket_setopt' => 'socket_set_option', - - 'chop' => 'rtrim', - 'close' => 'closedir', - 'doubleval' => 'floatval', - 'fputs' => 'fwrite', - 'get_required_files' => 'get_included_files', - 'ini_alter' => 'ini_set', - 'is_double' => 'is_float', - 'is_integer' => 'is_int', - 'is_long' => 'is_int', - 'is_real' => 'is_float', - 'is_writeable' => 'is_writable', - 'join' => 'implode', - 'key_exists' => 'array_key_exists', - 'magic_quotes_runtime' => 'set_magic_quotes_runtime', - 'pos' => 'current', - 'show_source' => 'highlight_file', - 'sizeof' => 'count', - 'strchr' => 'strstr', - 'user_error' => 'trigger_error', - ], - - '@IMAP' => [ - 'imap_create' => 'imap_createmailbox', - 'imap_fetchtext' => 'imap_body', - 'imap_header' => 'imap_headerinfo', - 'imap_listmailbox' => 'imap_list', - 'imap_listsubscribed' => 'imap_lsub', - 'imap_rename' => 'imap_renamemailbox', - 'imap_scan' => 'imap_listscan', - 'imap_scanmailbox' => 'imap_listscan', - ], - - '@ldap' => [ - 'ldap_close' => 'ldap_unbind', - 'ldap_modify' => 'ldap_mod_replace', - ], - - '@mysqli' => [ - 'mysqli_execute' => 'mysqli_stmt_execute', - 'mysqli_set_opt' => 'mysqli_options', - 'mysqli_escape_string' => 'mysqli_real_escape_string', - ], - - '@pg' => [ - 'pg_exec' => 'pg_query', - ], - - '@oci' => [ - 'oci_free_cursor' => 'oci_free_statement', - ], - - '@odbc' => [ - 'odbc_do' => 'odbc_exec', - 'odbc_field_precision' => 'odbc_field_len', - ], - - '@mbreg' => [ - 'mbereg' => 'mb_ereg', - 'mbereg_match' => 'mb_ereg_match', - 'mbereg_replace' => 'mb_ereg_replace', - 'mbereg_search' => 'mb_ereg_search', - 'mbereg_search_getpos' => 'mb_ereg_search_getpos', - 'mbereg_search_getregs' => 'mb_ereg_search_getregs', - 'mbereg_search_init' => 'mb_ereg_search_init', - 'mbereg_search_pos' => 'mb_ereg_search_pos', - 'mbereg_search_regs' => 'mb_ereg_search_regs', - 'mbereg_search_setpos' => 'mb_ereg_search_setpos', - 'mberegi' => 'mb_eregi', - 'mberegi_replace' => 'mb_eregi_replace', - 'mbregex_encoding' => 'mb_regex_encoding', - 'mbsplit' => 'mb_split', - ], - - '@openssl' => [ - 'openssl_get_publickey' => 'openssl_pkey_get_public', - 'openssl_get_privatekey' => 'openssl_pkey_get_private', - ], - - '@sodium' => [ - 'sodium_crypto_scalarmult_base' => 'sodium_crypto_box_publickey_from_secretkey', - ], - - '@exif' => [ - 'read_exif_data' => 'exif_read_data', - ], - - '@ftp' => [ - 'ftp_quit' => 'ftp_close', - ], - - '@posix' => [ - 'posix_errno' => 'posix_get_last_error', - ], - - '@pcntl' => [ - 'pcntl_errno' => 'pcntl_get_last_error', - ], - - '@time' => [ - 'mktime' => ['time', 0], - 'gmmktime' => ['time', 0], - ], - ]; - - /** - * @var array stores alias (key) - master (value) functions mapping - */ - private array $aliases = []; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Master functions shall be used instead of aliases.', - [ - new CodeSample( - ' ['@mbreg']] - ), - ], - null, - 'Risky when any of the alias functions are overridden.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before ImplodeCallFixer, PhpUnitDedicateAssertFixer. - */ - public function getPriority(): int - { - return 40; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - $this->aliases = []; - - foreach ($this->configuration['sets'] as $set) { - if ('@all' === $set) { - $this->aliases = array_merge(...array_values(self::SETS)); - - break; - } - - if (!isset(self::SETS[$set])) { - throw new \LogicException(\sprintf('Set %s passed option validation, but not part of ::SETS.', $set)); - } - - $this->aliases = array_merge($this->aliases, self::SETS[$set]); - } - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - /** @var Token $token */ - foreach ($tokens->findGivenKind(T_STRING) as $index => $token) { - // check mapping hit - $tokenContent = strtolower($token->getContent()); - - if (!isset($this->aliases[$tokenContent])) { - continue; - } - - // skip expressions without parameters list - $openParenthesis = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$openParenthesis]->equals('(')) { - continue; - } - - if (!$functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { - continue; - } - - if (\is_array($this->aliases[$tokenContent])) { - [$alias, $numberOfArguments] = $this->aliases[$tokenContent]; - - $count = $argumentsAnalyzer->countArguments($tokens, $openParenthesis, $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openParenthesis)); - - if ($numberOfArguments !== $count) { - continue; - } - } else { - $alias = $this->aliases[$tokenContent]; - } - - $tokens[$index] = new Token([T_STRING, $alias]); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $sets = [ - '@all' => 'all listed sets', - '@internal' => 'native functions', - '@exif' => 'EXIF functions', - '@ftp' => 'FTP functions', - '@IMAP' => 'IMAP functions', - '@ldap' => 'LDAP functions', - '@mbreg' => 'from `ext-mbstring`', - '@mysqli' => 'mysqli functions', - '@oci' => 'oci functions', - '@odbc' => 'odbc functions', - '@openssl' => 'openssl functions', - '@pcntl' => 'PCNTL functions', - '@pg' => 'pg functions', - '@posix' => 'POSIX functions', - '@snmp' => 'SNMP functions', // @TODO Remove on next major 4.0 as this set is now empty - '@sodium' => 'libsodium functions', - '@time' => 'time functions', - ]; - - $list = "List of sets to fix. Defined sets are:\n\n"; - - foreach ($sets as $set => $description) { - $list .= \sprintf("* `%s` (%s);\n", $set, $description); - } - - $list = rtrim($list, ";\n").'.'; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('sets', $list)) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset(array_keys($sets))]) - ->setDefault(['@internal', '@IMAP', '@pg']) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasLanguageConstructCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasLanguageConstructCallFixer.php deleted file mode 100644 index 4df764ab..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasLanguageConstructCallFixer.php +++ /dev/null @@ -1,59 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Alias; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoAliasLanguageConstructCallFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Master language constructs shall be used instead of aliases.', - [ - new CodeSample( - 'isTokenKindFound(T_EXIT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_EXIT)) { - continue; - } - - if ('exit' === strtolower($token->getContent())) { - continue; - } - - $tokens[$index] = new Token([T_EXIT, 'exit']); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php deleted file mode 100644 index 7a0292fe..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php +++ /dev/null @@ -1,142 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Alias; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Sullivan Senechal - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * use?: 'echo'|'print' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * use: 'echo'|'print' - * } - */ -final class NoMixedEchoPrintFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var T_ECHO|T_PRINT - */ - private int $candidateTokenType; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Either language construct `print` or `echo` should be used.', - [ - new CodeSample(" 'print']), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after EchoTagSyntaxFixer. - */ - public function getPriority(): int - { - return -10; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound($this->candidateTokenType); - } - - protected function configurePostNormalisation(): void - { - $this->candidateTokenType = 'echo' === $this->configuration['use'] ? T_PRINT : T_ECHO; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if ($token->isGivenKind($this->candidateTokenType)) { - if (T_PRINT === $this->candidateTokenType) { - $this->fixPrintToEcho($tokens, $index); - } else { - $this->fixEchoToPrint($tokens, $index); - } - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('use', 'The desired language construct.')) - ->setAllowedValues(['print', 'echo']) - ->setDefault('echo') - ->getOption(), - ]); - } - - private function fixEchoToPrint(Tokens $tokens, int $index): void - { - $nextTokenIndex = $tokens->getNextMeaningfulToken($index); - $endTokenIndex = $tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]); - $canBeConverted = true; - - for ($i = $nextTokenIndex; $i < $endTokenIndex; ++$i) { - if ($tokens[$i]->equalsAny(['(', [CT::T_ARRAY_SQUARE_BRACE_OPEN]])) { - $blockType = Tokens::detectBlockType($tokens[$i]); - $i = $tokens->findBlockEnd($blockType['type'], $i); - } - - if ($tokens[$i]->equals(',')) { - $canBeConverted = false; - - break; - } - } - - if (false === $canBeConverted) { - return; - } - - $tokens[$index] = new Token([T_PRINT, 'print']); - } - - private function fixPrintToEcho(Tokens $tokens, int $index): void - { - $prevToken = $tokens[$tokens->getPrevMeaningfulToken($index)]; - - if (!$prevToken->equalsAny([';', '{', '}', ')', [T_OPEN_TAG], [T_ELSE]])) { - return; - } - - $tokens[$index] = new Token([T_ECHO, 'echo']); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php deleted file mode 100644 index 84e68090..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php +++ /dev/null @@ -1,219 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Alias; - -use PhpCsFixer\AbstractFunctionReferenceFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class PowToExponentiationFixer extends AbstractFunctionReferenceFixer -{ - public function isCandidate(Tokens $tokens): bool - { - // minimal candidate to fix is seven tokens: pow(x,y); - return $tokens->count() > 7 && $tokens->isTokenKindFound(T_STRING); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Converts `pow` to the `**` operator.', - [ - new CodeSample( - "findPowCalls($tokens); - $argumentsAnalyzer = new ArgumentsAnalyzer(); - $numberOfTokensAdded = 0; - $previousCloseParenthesisIndex = \count($tokens); - - foreach (array_reverse($candidates) as $candidate) { - // if in the previous iteration(s) tokens were added to the collection and this is done within the tokens - // indices of the current candidate than the index of the close ')' of the candidate has moved and so - // the index needs to be updated - if ($previousCloseParenthesisIndex < $candidate[2]) { - $previousCloseParenthesisIndex = $candidate[2]; - $candidate[2] += $numberOfTokensAdded; - } else { - $previousCloseParenthesisIndex = $candidate[2]; - $numberOfTokensAdded = 0; - } - - $arguments = $argumentsAnalyzer->getArguments($tokens, $candidate[1], $candidate[2]); - - if (2 !== \count($arguments)) { - continue; - } - - for ($i = $candidate[1]; $i < $candidate[2]; ++$i) { - if ($tokens[$i]->isGivenKind(T_ELLIPSIS)) { - continue 2; - } - } - - $numberOfTokensAdded += $this->fixPowToExponentiation( - $tokens, - $candidate[0], // functionNameIndex, - $candidate[1], // openParenthesisIndex, - $candidate[2], // closeParenthesisIndex, - $arguments - ); - } - } - - /** - * @return list - */ - private function findPowCalls(Tokens $tokens): array - { - $candidates = []; - - // Minimal candidate to fix is seven tokens: pow(x,y); - $end = \count($tokens) - 6; - - // First possible location is after the open token: 1 - for ($i = 1; $i < $end; ++$i) { - $candidate = $this->find('pow', $tokens, $i, $end); - - if (null === $candidate) { - break; - } - - $i = $candidate[1]; // proceed to openParenthesisIndex - $candidates[] = $candidate; - } - - return $candidates; - } - - /** - * @param array $arguments - * - * @return int number of tokens added to the collection - */ - private function fixPowToExponentiation(Tokens $tokens, int $functionNameIndex, int $openParenthesisIndex, int $closeParenthesisIndex, array $arguments): int - { - // find the argument separator ',' directly after the last token of the first argument; - // replace it with T_POW '**' - $tokens[$tokens->getNextTokenOfKind(reset($arguments), [','])] = new Token([T_POW, '**']); - - // clean up the function call tokens prt. I - $tokens->clearAt($closeParenthesisIndex); - $previousIndex = $tokens->getPrevMeaningfulToken($closeParenthesisIndex); - - if ($tokens[$previousIndex]->equals(',')) { - $tokens->clearAt($previousIndex); // trailing ',' in function call (PHP 7.3) - } - - $added = 0; - - // check if the arguments need to be wrapped in parentheses - foreach (array_reverse($arguments, true) as $argumentStartIndex => $argumentEndIndex) { - if ($this->isParenthesisNeeded($tokens, $argumentStartIndex, $argumentEndIndex)) { - $tokens->insertAt($argumentEndIndex + 1, new Token(')')); - $tokens->insertAt($argumentStartIndex, new Token('(')); - $added += 2; - } - } - - // clean up the function call tokens prt. II - $tokens->clearAt($openParenthesisIndex); - $tokens->clearAt($functionNameIndex); - - $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($functionNameIndex); - - if ($tokens[$prevMeaningfulTokenIndex]->isGivenKind(T_NS_SEPARATOR)) { - $tokens->clearAt($prevMeaningfulTokenIndex); - } - - return $added; - } - - private function isParenthesisNeeded(Tokens $tokens, int $argumentStartIndex, int $argumentEndIndex): bool - { - static $allowedKinds = null; - - if (null === $allowedKinds) { - $allowedKinds = $this->getAllowedKinds(); - } - - for ($i = $argumentStartIndex; $i <= $argumentEndIndex; ++$i) { - if ($tokens[$i]->isGivenKind($allowedKinds) || $tokens->isEmptyAt($i)) { - continue; - } - - $blockType = Tokens::detectBlockType($tokens[$i]); - - if (null !== $blockType) { - $i = $tokens->findBlockEnd($blockType['type'], $i); - - continue; - } - - if ($tokens[$i]->equals('$')) { - $i = $tokens->getNextMeaningfulToken($i); - if ($tokens[$i]->isGivenKind(CT::T_DYNAMIC_VAR_BRACE_OPEN)) { - $i = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_DYNAMIC_VAR_BRACE, $i); - - continue; - } - } - - if ($tokens[$i]->equals('+') && $tokens->getPrevMeaningfulToken($i) < $argumentStartIndex) { - continue; - } - - return true; - } - - return false; - } - - /** - * @return list - */ - private function getAllowedKinds(): array - { - return [ - T_DNUMBER, T_LNUMBER, T_VARIABLE, T_STRING, T_CONSTANT_ENCAPSED_STRING, T_DOUBLE_CAST, - T_INT_CAST, T_INC, T_DEC, T_NS_SEPARATOR, T_WHITESPACE, T_DOUBLE_COLON, T_LINE, T_COMMENT, T_DOC_COMMENT, - CT::T_NAMESPACE_OPERATOR, - ...Token::getObjectOperatorKinds(), - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/RandomApiMigrationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/RandomApiMigrationFixer.php deleted file mode 100644 index 7f2b8cff..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/RandomApiMigrationFixer.php +++ /dev/null @@ -1,153 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Alias; - -use PhpCsFixer\AbstractFunctionReferenceFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * @author Vladimir Reznichenko - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * replacements?: array - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * replacements: array - * } - */ -final class RandomApiMigrationFixer extends AbstractFunctionReferenceFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var array> - */ - private const ARGUMENT_COUNTS = [ - 'getrandmax' => [0], - 'mt_rand' => [1, 2], - 'rand' => [0, 2], - 'srand' => [0, 1], - 'random_int' => [0, 2], - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replaces `rand`, `srand`, `getrandmax` functions calls with their `mt_*` analogs or `random_int`.', - [ - new CodeSample(" ['getrandmax' => 'mt_getrandmax']] - ), - new CodeSample( - " ['rand' => 'random_int']] - ), - ], - null, - 'Risky when the configured functions are overridden. Or when relying on the seed based generating of the numbers.' - ); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - foreach ($this->configuration['replacements'] as $functionIdentity => $functionReplacement) { - if ($functionIdentity === $functionReplacement) { - continue; - } - - $currIndex = 0; - - do { - // try getting function reference and translate boundaries for humans - $boundaries = $this->find($functionIdentity, $tokens, $currIndex, $tokens->count() - 1); - - if (null === $boundaries) { - // next function search, as current one not found - continue 2; - } - - [$functionName, $openParenthesis, $closeParenthesis] = $boundaries; - $count = $argumentsAnalyzer->countArguments($tokens, $openParenthesis, $closeParenthesis); - - \assert(isset(self::ARGUMENT_COUNTS[$functionIdentity])); // for PHPStan - - if (!\in_array($count, self::ARGUMENT_COUNTS[$functionIdentity], true)) { - continue 2; - } - - // analysing cursor shift, so nested calls could be processed - $currIndex = $openParenthesis; - $tokens[$functionName] = new Token([T_STRING, $functionReplacement]); - - if (0 === $count && 'random_int' === $functionReplacement) { - $tokens->insertAt($currIndex + 1, [ - new Token([T_LNUMBER, '0']), - new Token(','), - new Token([T_WHITESPACE, ' ']), - new Token([T_STRING, 'getrandmax']), - new Token('('), - new Token(')'), - ]); - - $currIndex += 6; - } - } while (null !== $currIndex); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('replacements', 'Mapping between replaced functions with the new ones.')) - ->setAllowedTypes(['array']) - ->setAllowedValues([static function (array $value): bool { - foreach ($value as $functionName => $replacement) { - if (!\array_key_exists($functionName, self::ARGUMENT_COUNTS)) { - throw new InvalidOptionsException(\sprintf( - 'Function "%s" is not handled by the fixer.', - $functionName - )); - } - } - - return true; - }]) - ->setDefault([ - 'getrandmax' => 'mt_getrandmax', - 'rand' => 'mt_rand', // @TODO change to `random_int` as default on 4.0 - 'srand' => 'mt_srand', - ]) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php deleted file mode 100644 index 2127e33d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php +++ /dev/null @@ -1,240 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Alias; - -use PhpCsFixer\AbstractFunctionReferenceFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class SetTypeToCastFixer extends AbstractFunctionReferenceFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Cast shall be used, not `settype`.', - [ - new CodeSample( - 'isAllTokenKindsFound([T_CONSTANT_ENCAPSED_STRING, T_STRING, T_VARIABLE]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $map = [ - 'array' => [T_ARRAY_CAST, '(array)'], - 'bool' => [T_BOOL_CAST, '(bool)'], - 'boolean' => [T_BOOL_CAST, '(bool)'], - 'double' => [T_DOUBLE_CAST, '(float)'], - 'float' => [T_DOUBLE_CAST, '(float)'], - 'int' => [T_INT_CAST, '(int)'], - 'integer' => [T_INT_CAST, '(int)'], - 'object' => [T_OBJECT_CAST, '(object)'], - 'string' => [T_STRING_CAST, '(string)'], - // note: `'null' is dealt with later on - ]; - - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - foreach (array_reverse($this->findSettypeCalls($tokens)) as $candidate) { - $functionNameIndex = $candidate[0]; - - $arguments = $argumentsAnalyzer->getArguments($tokens, $candidate[1], $candidate[2]); - if (2 !== \count($arguments)) { - continue; // function must be overridden or used incorrectly - } - - $prev = $tokens->getPrevMeaningfulToken($functionNameIndex); - - if (!$tokens[$prev]->equalsAny([';', '{', '}', [T_OPEN_TAG]])) { - continue; // return value of the function is used - } - - reset($arguments); - - // --- Test first argument -------------------- - - $firstArgumentStart = key($arguments); - if ($tokens[$firstArgumentStart]->isComment() || $tokens[$firstArgumentStart]->isWhitespace()) { - $firstArgumentStart = $tokens->getNextMeaningfulToken($firstArgumentStart); - } - - if (!$tokens[$firstArgumentStart]->isGivenKind(T_VARIABLE)) { - continue; // settype only works with variables pass by reference, function must be overridden - } - - $commaIndex = $tokens->getNextMeaningfulToken($firstArgumentStart); - - if (null === $commaIndex || !$tokens[$commaIndex]->equals(',')) { - continue; // first argument is complex statement; function must be overridden - } - - // --- Test second argument ------------------- - - next($arguments); - $secondArgumentStart = key($arguments); - $secondArgumentEnd = $arguments[$secondArgumentStart]; - - if ($tokens[$secondArgumentStart]->isComment() || $tokens[$secondArgumentStart]->isWhitespace()) { - $secondArgumentStart = $tokens->getNextMeaningfulToken($secondArgumentStart); - } - - if ( - !$tokens[$secondArgumentStart]->isGivenKind(T_CONSTANT_ENCAPSED_STRING) - || $tokens->getNextMeaningfulToken($secondArgumentStart) < $secondArgumentEnd - ) { - continue; // second argument is of the wrong type or is a (complex) statement of some sort (function is overridden) - } - - // --- Test type ------------------------------ - - $type = strtolower(trim($tokens[$secondArgumentStart]->getContent(), '"\'')); - - if ('null' !== $type && !isset($map[$type])) { - continue; // we don't know how to map - } - - // --- Fixing --------------------------------- - - $argumentToken = $tokens[$firstArgumentStart]; - - $this->removeSettypeCall( - $tokens, - $functionNameIndex, - $candidate[1], - $firstArgumentStart, - $commaIndex, - $secondArgumentStart, - $candidate[2] - ); - - if ('null' === $type) { - $this->fixSettypeNullCall($tokens, $functionNameIndex, $argumentToken); - } else { - $this->fixSettypeCall($tokens, $functionNameIndex, $argumentToken, new Token($map[$type])); - } - } - } - - /** - * @return list> - */ - private function findSettypeCalls(Tokens $tokens): array - { - $candidates = []; - - $end = \count($tokens); - for ($i = 1; $i < $end; ++$i) { - $candidate = $this->find('settype', $tokens, $i, $end); - if (null === $candidate) { - break; - } - - $i = $candidate[1]; // proceed to openParenthesisIndex - $candidates[] = $candidate; - } - - return $candidates; - } - - private function removeSettypeCall( - Tokens $tokens, - int $functionNameIndex, - int $openParenthesisIndex, - int $firstArgumentStart, - int $commaIndex, - int $secondArgumentStart, - int $closeParenthesisIndex - ): void { - $tokens->clearTokenAndMergeSurroundingWhitespace($closeParenthesisIndex); - $prevIndex = $tokens->getPrevMeaningfulToken($closeParenthesisIndex); - if ($tokens[$prevIndex]->equals(',')) { - $tokens->clearTokenAndMergeSurroundingWhitespace($prevIndex); - } - $tokens->clearTokenAndMergeSurroundingWhitespace($secondArgumentStart); - $tokens->clearTokenAndMergeSurroundingWhitespace($commaIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($firstArgumentStart); - $tokens->clearTokenAndMergeSurroundingWhitespace($openParenthesisIndex); - $tokens->clearAt($functionNameIndex); // we'll be inserting here so no need to merge the space tokens - $tokens->clearEmptyTokens(); - } - - private function fixSettypeCall( - Tokens $tokens, - int $functionNameIndex, - Token $argumentToken, - Token $castToken - ): void { - $tokens->insertAt( - $functionNameIndex, - [ - clone $argumentToken, - new Token([T_WHITESPACE, ' ']), - new Token('='), - new Token([T_WHITESPACE, ' ']), - $castToken, - new Token([T_WHITESPACE, ' ']), - clone $argumentToken, - ] - ); - - $tokens->removeTrailingWhitespace($functionNameIndex + 6); // 6 = number of inserted tokens -1 for offset correction - } - - private function fixSettypeNullCall( - Tokens $tokens, - int $functionNameIndex, - Token $argumentToken - ): void { - $tokens->insertAt( - $functionNameIndex, - [ - clone $argumentToken, - new Token([T_WHITESPACE, ' ']), - new Token('='), - new Token([T_WHITESPACE, ' ']), - new Token([T_STRING, 'null']), - ] - ); - - $tokens->removeTrailingWhitespace($functionNameIndex + 4); // 4 = number of inserted tokens -1 for offset correction - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php deleted file mode 100644 index 2eab59c6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php +++ /dev/null @@ -1,138 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ArrayNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Gregor Harlan - * @author Sebastiaan Stok - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * syntax?: 'long'|'short' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * syntax: 'long'|'short' - * } - */ -final class ArraySyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var CT::T_ARRAY_SQUARE_BRACE_OPEN|T_ARRAY - */ - private $candidateTokenKind; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHP arrays should be declared using the configured syntax.', - [ - new CodeSample( - " 'long'] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before BinaryOperatorSpacesFixer, SingleSpaceAfterConstructFixer, SingleSpaceAroundConstructFixer, TernaryOperatorSpacesFixer. - */ - public function getPriority(): int - { - return 37; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound($this->candidateTokenKind); - } - - protected function configurePostNormalisation(): void - { - $this->resolveCandidateTokenKind(); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; 0 <= $index; --$index) { - if ($tokens[$index]->isGivenKind($this->candidateTokenKind)) { - if ('short' === $this->configuration['syntax']) { - $this->fixToShortArraySyntax($tokens, $index); - } else { - $this->fixToLongArraySyntax($tokens, $index); - } - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('syntax', 'Whether to use the `long` or `short` array syntax.')) - ->setAllowedValues(['long', 'short']) - ->setDefault('short') - ->getOption(), - ]); - } - - private function fixToLongArraySyntax(Tokens $tokens, int $index): void - { - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $index); - - $tokens[$index] = new Token('('); - $tokens[$closeIndex] = new Token(')'); - - $tokens->insertAt($index, new Token([T_ARRAY, 'array'])); - } - - private function fixToShortArraySyntax(Tokens $tokens, int $index): void - { - $openIndex = $tokens->getNextTokenOfKind($index, ['(']); - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); - - $tokens[$openIndex] = new Token([CT::T_ARRAY_SQUARE_BRACE_OPEN, '[']); - $tokens[$closeIndex] = new Token([CT::T_ARRAY_SQUARE_BRACE_CLOSE, ']']); - - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - - private function resolveCandidateTokenKind(): void - { - $this->candidateTokenKind = 'long' === $this->configuration['syntax'] ? CT::T_ARRAY_SQUARE_BRACE_OPEN : T_ARRAY; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoMultilineWhitespaceAroundDoubleArrowFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoMultilineWhitespaceAroundDoubleArrowFixer.php deleted file mode 100644 index b7a888f0..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoMultilineWhitespaceAroundDoubleArrowFixer.php +++ /dev/null @@ -1,80 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ArrayNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Carlos Cirello - * @author Dariusz Rumiński - * @author Graham Campbell - */ -final class NoMultilineWhitespaceAroundDoubleArrowFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Operator `=>` should not be surrounded by multi-line whitespaces.', - [new CodeSample(" 2);\n")] - ); - } - - /** - * {@inheritdoc} - * - * Must run before BinaryOperatorSpacesFixer, MethodArgumentSpaceFixer. - */ - public function getPriority(): int - { - return 31; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOUBLE_ARROW); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOUBLE_ARROW)) { - continue; - } - - if (!$tokens[$index - 2]->isComment() || str_starts_with($tokens[$index - 2]->getContent(), '/*')) { - $this->fixWhitespace($tokens, $index - 1); - } - - // do not move anything about if there is a comment following the whitespace - if (!$tokens[$index + 2]->isComment()) { - $this->fixWhitespace($tokens, $index + 1); - } - } - } - - private function fixWhitespace(Tokens $tokens, int $index): void - { - $token = $tokens[$index]; - - if ($token->isWhitespace() && !$token->isWhitespace(" \t")) { - $tokens[$index] = new Token([T_WHITESPACE, rtrim($token->getContent()).' ']); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixer.php deleted file mode 100644 index 6d133841..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixer.php +++ /dev/null @@ -1,52 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ArrayNotation; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\Basic\NoTrailingCommaInSinglelineFixer; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @deprecated - * - * @author Dariusz Rumiński - * @author Sebastiaan Stok - */ -final class NoTrailingCommaInSinglelineArrayFixer extends AbstractProxyFixer implements DeprecatedFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHP single-line arrays should not have trailing comma.', - [new CodeSample("proxyFixers); - } - - protected function createProxyFixers(): array - { - $fixer = new NoTrailingCommaInSinglelineFixer(); - $fixer->configure(['elements' => ['array']]); - - return [$fixer]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoWhitespaceBeforeCommaInArrayFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoWhitespaceBeforeCommaInArrayFixer.php deleted file mode 100644 index e5e75489..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NoWhitespaceBeforeCommaInArrayFixer.php +++ /dev/null @@ -1,153 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ArrayNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Adam Marczuk - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * after_heredoc?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * after_heredoc: bool - * } - */ -final class NoWhitespaceBeforeCommaInArrayFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'In array declaration, there MUST NOT be a whitespace before each comma.', - [ - new CodeSample(" true] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index > 0; --$index) { - if ($tokens[$index]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN])) { - $this->fixSpacing($index, $tokens); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('after_heredoc', 'Whether the whitespace between heredoc end and comma should be removed.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - /** - * Method to fix spacing in array declaration. - */ - private function fixSpacing(int $index, Tokens $tokens): void - { - if ($tokens[$index]->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { - $startIndex = $index; - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $startIndex); - } else { - $startIndex = $tokens->getNextTokenOfKind($index, ['(']); - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startIndex); - } - - for ($i = $endIndex - 1; $i > $startIndex; --$i) { - $i = $this->skipNonArrayElements($i, $tokens); - $currentToken = $tokens[$i]; - $prevIndex = $tokens->getPrevNonWhitespace($i - 1); - - if ( - $currentToken->equals(',') && !$tokens[$prevIndex]->isComment() - && (true === $this->configuration['after_heredoc'] || !$tokens[$prevIndex]->isGivenKind(T_END_HEREDOC)) - ) { - $tokens->removeLeadingWhitespace($i); - } - } - } - - /** - * Method to move index over the non-array elements like function calls or function declarations. - */ - private function skipNonArrayElements(int $index, Tokens $tokens): int - { - if ($tokens[$index]->equals('}')) { - return $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - } - - if ($tokens[$index]->equals(')')) { - $startIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $startIndex = $tokens->getPrevMeaningfulToken($startIndex); - if (!$tokens[$startIndex]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN])) { - return $startIndex; - } - } - - if ($tokens[$index]->equals(',') && $this->commaIsPartOfImplementsList($index, $tokens)) { - --$index; - } - - return $index; - } - - private function commaIsPartOfImplementsList(int $index, Tokens $tokens): bool - { - do { - $index = $tokens->getPrevMeaningfulToken($index); - - $current = $tokens[$index]; - } while ($current->isGivenKind(T_STRING) || $current->equals(',')); - - return $current->isGivenKind(T_IMPLEMENTS); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NormalizeIndexBraceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NormalizeIndexBraceFixer.php deleted file mode 100644 index 3d5f5616..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/NormalizeIndexBraceFixer.php +++ /dev/null @@ -1,57 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ArrayNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - */ -final class NormalizeIndexBraceFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Array index should always be written by using square braces.', - [new VersionSpecificCodeSample( - "isTokenKindFound(CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if ($token->isGivenKind(CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN)) { - $tokens[$index] = new Token('['); - } elseif ($token->isGivenKind(CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE)) { - $tokens[$index] = new Token(']'); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ReturnToYieldFromFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ReturnToYieldFromFixer.php deleted file mode 100644 index 4b130a27..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ReturnToYieldFromFixer.php +++ /dev/null @@ -1,105 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ArrayNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - */ -final class ReturnToYieldFromFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'If the function explicitly returns an array, and has the return type `iterable`, then `yield from` must be used instead of `return`.', - [new CodeSample('isAllTokenKindsFound([T_FUNCTION, T_RETURN]) && $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN]); - } - - /** - * {@inheritdoc} - * - * Must run before YieldFromArrayToYieldsFixer. - * Must run after PhpUnitDataProviderReturnTypeFixer, PhpdocToReturnTypeFixer. - */ - public function getPriority(): int - { - return 1; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens->findGivenKind(T_RETURN) as $index => $token) { - if (!$this->shouldBeFixed($tokens, $index)) { - continue; - } - - $tokens[$index] = new Token([T_YIELD_FROM, 'yield from']); - } - } - - private function shouldBeFixed(Tokens $tokens, int $returnIndex): bool - { - $arrayStartIndex = $tokens->getNextMeaningfulToken($returnIndex); - if (!$tokens[$arrayStartIndex]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN])) { - return false; - } - - if ($tokens[$arrayStartIndex]->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { - $arrayEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $arrayStartIndex); - } else { - $arrayOpenParenthesisIndex = $tokens->getNextTokenOfKind($arrayStartIndex, ['(']); - $arrayEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $arrayOpenParenthesisIndex); - } - - $functionEndIndex = $arrayEndIndex; - do { - $functionEndIndex = $tokens->getNextMeaningfulToken($functionEndIndex); - } while (null !== $functionEndIndex && $tokens[$functionEndIndex]->equals(';')); - if (null === $functionEndIndex || !$tokens[$functionEndIndex]->equals('}')) { - return false; - } - - $functionStartIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $functionEndIndex); - - $returnTypeIndex = $tokens->getPrevMeaningfulToken($functionStartIndex); - if (!$tokens[$returnTypeIndex]->isGivenKind(T_STRING)) { - return false; - } - - if ('iterable' !== strtolower($tokens[$returnTypeIndex]->getContent())) { - return false; - } - - $beforeReturnTypeIndex = $tokens->getPrevMeaningfulToken($returnTypeIndex); - - return $tokens[$beforeReturnTypeIndex]->isGivenKind(CT::T_TYPE_COLON); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/TrimArraySpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/TrimArraySpacesFixer.php deleted file mode 100644 index 775e9125..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/TrimArraySpacesFixer.php +++ /dev/null @@ -1,97 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ArrayNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Jared Henderson - */ -final class TrimArraySpacesFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Arrays should be formatted like function/method arguments, without leading or trailing single line space.', - [new CodeSample("isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = 0, $c = $tokens->count(); $index < $c; ++$index) { - if ($tokens[$index]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN])) { - self::fixArray($tokens, $index); - } - } - } - - /** - * Method to trim leading/trailing whitespace within single line arrays. - */ - private static function fixArray(Tokens $tokens, int $index): void - { - $startIndex = $index; - - if ($tokens[$startIndex]->isGivenKind(T_ARRAY)) { - $startIndex = $tokens->getNextMeaningfulToken($startIndex); - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startIndex); - } elseif ($tokens[$startIndex]->isGivenKind(CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN)) { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_DESTRUCTURING_SQUARE_BRACE, $startIndex); - } else { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $startIndex); - } - - $nextIndex = $startIndex + 1; - $nextToken = $tokens[$nextIndex]; - $nextNonWhitespaceIndex = $tokens->getNextNonWhitespace($startIndex); - $nextNonWhitespaceToken = $tokens[$nextNonWhitespaceIndex]; - $tokenAfterNextNonWhitespaceToken = $tokens[$nextNonWhitespaceIndex + 1]; - - $prevIndex = $endIndex - 1; - $prevToken = $tokens[$prevIndex]; - $prevNonWhitespaceIndex = $tokens->getPrevNonWhitespace($endIndex); - $prevNonWhitespaceToken = $tokens[$prevNonWhitespaceIndex]; - - if ( - $nextToken->isWhitespace(" \t") - && ( - !$nextNonWhitespaceToken->isComment() - || $nextNonWhitespaceIndex === $prevNonWhitespaceIndex - || $tokenAfterNextNonWhitespaceToken->isWhitespace(" \t") - || str_starts_with($nextNonWhitespaceToken->getContent(), '/*') - ) - ) { - $tokens->clearAt($nextIndex); - } - - if ( - $prevToken->isWhitespace(" \t") - && !$prevNonWhitespaceToken->equals(',') - ) { - $tokens->clearAt($prevIndex); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php deleted file mode 100644 index 88cd0724..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php +++ /dev/null @@ -1,150 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ArrayNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Adam Marczuk - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * ensure_single_space?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * ensure_single_space: bool - * } - */ -final class WhitespaceAfterCommaInArrayFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'In array declaration, there MUST be a whitespace after each comma.', - [ - new CodeSample(" true]), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN]); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('ensure_single_space', 'If there are only horizontal whitespaces after the comma then ensure it is a single space.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensToInsert = []; - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if (!$tokens[$index]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN])) { - continue; - } - - if ($tokens[$index]->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { - $startIndex = $index; - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $startIndex); - } else { - $startIndex = $tokens->getNextTokenOfKind($index, ['(']); - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startIndex); - } - - for ($i = $endIndex - 1; $i > $startIndex; --$i) { - $i = $this->skipNonArrayElements($i, $tokens); - if (!$tokens[$i]->equals(',')) { - continue; - } - if (!$tokens[$i + 1]->isWhitespace()) { - $tokensToInsert[$i + 1] = new Token([T_WHITESPACE, ' ']); - } elseif ( - true === $this->configuration['ensure_single_space'] - && ' ' !== $tokens[$i + 1]->getContent() - && Preg::match('/^\h+$/', $tokens[$i + 1]->getContent()) - && (!$tokens[$i + 2]->isComment() || Preg::match('/^\h+$/', $tokens[$i + 3]->getContent())) - ) { - $tokens[$i + 1] = new Token([T_WHITESPACE, ' ']); - } - } - } - - if ([] !== $tokensToInsert) { - $tokens->insertSlices($tokensToInsert); - } - } - - /** - * Method to move index over the non-array elements like function calls or function declarations. - * - * @return int New index - */ - private function skipNonArrayElements(int $index, Tokens $tokens): int - { - if ($tokens[$index]->equals('}')) { - return $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - } - - if ($tokens[$index]->equals(')')) { - $startIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $startIndex = $tokens->getPrevMeaningfulToken($startIndex); - if (!$tokens[$startIndex]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN])) { - return $startIndex; - } - } - - if ($tokens[$index]->equals(',') && $this->commaIsPartOfImplementsList($index, $tokens)) { - --$index; - } - - return $index; - } - - private function commaIsPartOfImplementsList(int $index, Tokens $tokens): bool - { - do { - $index = $tokens->getPrevMeaningfulToken($index); - - $current = $tokens[$index]; - } while ($current->isGivenKind(T_STRING) || $current->equals(',')); - - return $current->isGivenKind(T_IMPLEMENTS); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php deleted file mode 100644 index 021d1cd1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php +++ /dev/null @@ -1,189 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ArrayNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - */ -final class YieldFromArrayToYieldsFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Yield from array must be unpacked to series of yields.', - [ - new CodeSample('isTokenKindFound(T_YIELD_FROM); - } - - /** - * {@inheritdoc} - * - * Must run before BlankLineBeforeStatementFixer, NoExtraBlankLinesFixer, NoMultipleStatementsPerLineFixer, NoWhitespaceInBlankLineFixer, StatementIndentationFixer. - * Must run after ReturnToYieldFromFixer. - */ - public function getPriority(): int - { - return 0; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - /** - * @var array $inserts - */ - $inserts = []; - - foreach ($this->getYieldsFromToUnpack($tokens) as $index => [$startIndex, $endIndex]) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - - if ($tokens[$startIndex]->equals('(')) { - $prevStartIndex = $tokens->getPrevMeaningfulToken($startIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($prevStartIndex); // clear `array` from `array(` - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($startIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($endIndex); - - $arrayHasTrailingComma = false; - - $startIndex = $tokens->getNextMeaningfulToken($startIndex); - - $inserts[$startIndex] = [new Token([T_YIELD, 'yield']), new Token([T_WHITESPACE, ' '])]; - - foreach ($this->findArrayItemCommaIndex( - $tokens, - $startIndex, - $tokens->getPrevMeaningfulToken($endIndex), - ) as $commaIndex) { - $nextItemIndex = $tokens->getNextMeaningfulToken($commaIndex); - - if ($nextItemIndex < $endIndex) { - $inserts[$nextItemIndex] = [new Token([T_YIELD, 'yield']), new Token([T_WHITESPACE, ' '])]; - $tokens[$commaIndex] = new Token(';'); - } else { - $arrayHasTrailingComma = true; - // array has trailing comma - we replace it with `;` (as it's best fit to put it) - $tokens[$commaIndex] = new Token(';'); - } - } - - // there was a trailing comma, so we do not need original `;` after initial array structure - if (true === $arrayHasTrailingComma) { - $tokens->clearTokenAndMergeSurroundingWhitespace($tokens->getNextMeaningfulToken($endIndex)); - } - } - - $tokens->insertSlices($inserts); - } - - /** - * @return iterable - */ - private function getYieldsFromToUnpack(Tokens $tokens): iterable - { - $tokensCount = $tokens->count(); - $index = 0; - while (++$index < $tokensCount) { - if (!$tokens[$index]->isGivenKind(T_YIELD_FROM)) { - continue; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$prevIndex]->equalsAny([';', '{', '}', [T_OPEN_TAG]])) { - continue; - } - - $arrayStartIndex = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$arrayStartIndex]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN])) { - continue; - } - - if ($tokens[$arrayStartIndex]->isGivenKind(T_ARRAY)) { - $startIndex = $tokens->getNextTokenOfKind($arrayStartIndex, ['(']); - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startIndex); - } else { - $startIndex = $arrayStartIndex; - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $startIndex); - } - - // is there empty "yield from []" ? - if ($endIndex === $tokens->getNextMeaningfulToken($startIndex)) { - continue; - } - - // is there any nested "yield from"? - if ([] !== $tokens->findGivenKind(T_YIELD_FROM, $startIndex, $endIndex)) { - continue; - } - - yield $index => [$startIndex, $endIndex]; - } - } - - /** - * @return iterable - */ - private function findArrayItemCommaIndex(Tokens $tokens, int $startIndex, int $endIndex): iterable - { - for ($index = $startIndex; $index <= $endIndex; ++$index) { - $token = $tokens[$index]; - - // skip nested (), [], {} constructs - $blockDefinitionProbe = Tokens::detectBlockType($token); - - if (null !== $blockDefinitionProbe && true === $blockDefinitionProbe['isStart']) { - $index = $tokens->findBlockEnd($blockDefinitionProbe['type'], $index); - - continue; - } - - if (!$tokens[$index]->equals(',')) { - continue; - } - - yield $index; - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/AttributeEmptyParenthesesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/AttributeEmptyParenthesesFixer.php deleted file mode 100644 index 8166a0f2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/AttributeEmptyParenthesesFixer.php +++ /dev/null @@ -1,136 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\AttributeNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author HypeMC - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * use_parentheses?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * use_parentheses: bool - * } - */ -final class AttributeEmptyParenthesesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHP attributes declared without arguments must (not) be followed by empty parentheses.', - [ - new CodeSample(" true] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return \defined('T_ATTRIBUTE') && $tokens->isTokenKindFound(T_ATTRIBUTE); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('use_parentheses', 'Whether attributes should be followed by parentheses or not.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $index = 0; - - while (null !== $index = $tokens->getNextTokenOfKind($index, [[T_ATTRIBUTE]])) { - $nextIndex = $index; - - do { - $parenthesesIndex = $tokens->getNextTokenOfKind($nextIndex, ['(', ',', [CT::T_ATTRIBUTE_CLOSE]]); - - if (true === $this->configuration['use_parentheses']) { - $this->ensureParenthesesAt($tokens, $parenthesesIndex); - } else { - $this->ensureNoParenthesesAt($tokens, $parenthesesIndex); - } - - $nextIndex = $tokens->getNextTokenOfKind($nextIndex, ['(', ',', [CT::T_ATTRIBUTE_CLOSE]]); - - // Find closing parentheses, we need to do this in case there's a comma inside the parentheses - if ($tokens[$nextIndex]->equals('(')) { - $nextIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $nextIndex); - $nextIndex = $tokens->getNextTokenOfKind($nextIndex, [',', [CT::T_ATTRIBUTE_CLOSE]]); - } - - // In case there's a comma right before T_ATTRIBUTE_CLOSE - if (!$tokens[$nextIndex]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - } - } while (!$tokens[$nextIndex]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)); - } - } - - private function ensureParenthesesAt(Tokens $tokens, int $index): void - { - if ($tokens[$index]->equals('(')) { - return; - } - - $tokens->insertAt( - $tokens->getPrevMeaningfulToken($index) + 1, - [new Token('('), new Token(')')] - ); - } - - private function ensureNoParenthesesAt(Tokens $tokens, int $index): void - { - if (!$tokens[$index]->equals('(')) { - return; - } - - $closingIndex = $tokens->getNextMeaningfulToken($index); - - // attribute has arguments - parentheses can not be removed - if (!$tokens[$closingIndex]->equals(')')) { - return; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($closingIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/GeneralAttributeRemoveFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/GeneralAttributeRemoveFixer.php deleted file mode 100644 index a915f2a7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/GeneralAttributeRemoveFixer.php +++ /dev/null @@ -1,142 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\AttributeNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\AttributeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Raffaele Carelle - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-import-type _AttributeItems from AttributeAnalysis - * @phpstan-import-type _AttributeItem from AttributeAnalysis - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * attributes?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * attributes: list - * } - */ -final class GeneralAttributeRemoveFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Removes configured attributes by their respective FQN.', - [ - new CodeSample( - ' ['\A\B\Foo']] - ), - new CodeSample( - ' ['\A\B\Foo', 'A\B\Bar']] - ), - ] - ); - } - - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return \defined('T_ATTRIBUTE') && $tokens->isTokenKindFound(T_ATTRIBUTE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if (0 === \count($this->configuration['attributes'])) { - return; - } - - $index = 0; - - while (null !== $index = $tokens->getNextTokenOfKind($index, [[T_ATTRIBUTE]])) { - $attributeAnalysis = AttributeAnalyzer::collectOne($tokens, $index); - - $endIndex = $attributeAnalysis->getEndIndex(); - - $removedCount = 0; - foreach ($attributeAnalysis->getAttributes() as $element) { - $fullname = AttributeAnalyzer::determineAttributeFullyQualifiedName($tokens, $element['name'], $element['start']); - - if (!\in_array($fullname, $this->configuration['attributes'], true)) { - continue; - } - - $tokens->clearRange($element['start'], $element['end']); - ++$removedCount; - - $siblingIndex = $tokens->getNonEmptySibling($element['end'], 1); - - // Clear element comma - if (',' === $tokens[$siblingIndex]->getContent()) { - $tokens->clearAt($siblingIndex); - } - } - - // Clear whole attribute if all are removed (multiline attribute case) - if (\count($attributeAnalysis->getAttributes()) === $removedCount) { - $tokens->clearRange($attributeAnalysis->getStartIndex(), $attributeAnalysis->getEndIndex()); - } - - // Clear trailing comma - $tokenIndex = $tokens->getMeaningfulTokenSibling($attributeAnalysis->getClosingBracketIndex(), -1); - if (',' === $tokens[$tokenIndex]->getContent()) { - $tokens->clearAt($tokenIndex); - } - - $index = $endIndex; - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('attributes', 'List of FQNs of attributes for removal.')) - ->setAllowedTypes(['class-string[]']) - ->setDefault([]) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php deleted file mode 100644 index 957344e4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php +++ /dev/null @@ -1,271 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\AttributeNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\AttributeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Options; - -/** - * @author HypeMC - * - * @phpstan-import-type _AttributeItems from AttributeAnalysis - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * order?: list, - * sort_algorithm?: 'alpha'|'custom' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * order: array, - * sort_algorithm: 'alpha'|'custom' - * } - */ -final class OrderedAttributesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public const ORDER_ALPHA = 'alpha'; - public const ORDER_CUSTOM = 'custom'; - - private const SUPPORTED_SORT_ALGORITHMS = [ - self::ORDER_ALPHA, - self::ORDER_CUSTOM, - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Sorts attributes using the configured sort algorithm.', - [ - new VersionSpecificCodeSample( - <<<'EOL' - self::ORDER_CUSTOM, 'order' => ['A\B\Qux', 'A\B\Bar', 'A\B\Corge']], - ), - ], - ); - } - - /** - * {@inheritdoc} - * - * Must run after FullyQualifiedStrictTypesFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return \defined('T_ATTRIBUTE') && $tokens->isTokenKindFound(T_ATTRIBUTE); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $fixerName = $this->getName(); - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('sort_algorithm', 'How the attributes should be sorted.')) - ->setAllowedValues(self::SUPPORTED_SORT_ALGORITHMS) - ->setDefault(self::ORDER_ALPHA) - ->setNormalizer(static function (Options $options, string $value) use ($fixerName): string { - if (self::ORDER_CUSTOM === $value && [] === $options['order']) { - throw new InvalidFixerConfigurationException( - $fixerName, - 'The custom order strategy requires providing `order` option with a list of attributes\'s FQNs.' - ); - } - - return $value; - }) - ->getOption(), - (new FixerOptionBuilder('order', 'A list of FQCNs of attributes defining the desired order used when custom sorting algorithm is configured.')) - ->setAllowedTypes(['string[]']) - ->setDefault([]) - ->setNormalizer(static function (Options $options, array $value) use ($fixerName): array { - if ($value !== array_unique($value)) { - throw new InvalidFixerConfigurationException($fixerName, 'The list includes attributes that are not unique.'); - } - - return array_flip(array_values( - array_map(static fn (string $attribute): string => ltrim($attribute, '\\'), $value), - )); - }) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $index = 0; - - while (null !== $index = $tokens->getNextTokenOfKind($index, [[T_ATTRIBUTE]])) { - /** @var _AttributeItems $elements */ - $elements = array_map(fn (AttributeAnalysis $attributeAnalysis): array => [ - 'name' => $this->sortAttributes($tokens, $attributeAnalysis->getStartIndex(), $attributeAnalysis->getAttributes()), - 'start' => $attributeAnalysis->getStartIndex(), - 'end' => $attributeAnalysis->getEndIndex(), - ], AttributeAnalyzer::collect($tokens, $index)); - - $endIndex = end($elements)['end']; - - try { - if (1 === \count($elements)) { - continue; - } - - $sortedElements = $this->sortElements($elements); - - if ($elements === $sortedElements) { - continue; - } - - $this->sortTokens($tokens, $index, $endIndex, $sortedElements); - } finally { - $index = $endIndex; - } - } - } - - /** - * @param _AttributeItems $attributes - */ - private function sortAttributes(Tokens $tokens, int $index, array $attributes): string - { - if (1 === \count($attributes)) { - return $this->getAttributeName($tokens, $attributes[0]['name'], $attributes[0]['start']); - } - - foreach ($attributes as &$attribute) { - $attribute['name'] = $this->getAttributeName($tokens, $attribute['name'], $attribute['start']); - } - - $sortedElements = $this->sortElements($attributes); - - if ($attributes === $sortedElements) { - return $attributes[0]['name']; - } - - $this->sortTokens($tokens, $index + 1, end($attributes)['end'], $sortedElements, new Token(',')); - - return $sortedElements[0]['name']; - } - - private function getAttributeName(Tokens $tokens, string $name, int $index): string - { - if (self::ORDER_CUSTOM === $this->configuration['sort_algorithm']) { - $name = AttributeAnalyzer::determineAttributeFullyQualifiedName($tokens, $name, $index); - } - - return ltrim($name, '\\'); - } - - /** - * @param _AttributeItems $elements - * - * @return _AttributeItems - */ - private function sortElements(array $elements): array - { - usort($elements, function (array $a, array $b): int { - $sortAlgorithm = $this->configuration['sort_algorithm']; - - if (self::ORDER_ALPHA === $sortAlgorithm) { - return $a['name'] <=> $b['name']; - } - - if (self::ORDER_CUSTOM === $sortAlgorithm) { - return - ($this->configuration['order'][$a['name']] ?? PHP_INT_MAX) - <=> - ($this->configuration['order'][$b['name']] ?? PHP_INT_MAX); - } - - throw new \InvalidArgumentException(\sprintf('Invalid sort algorithm "%s" provided.', $sortAlgorithm)); - }); - - return $elements; - } - - /** - * @param _AttributeItems $elements - */ - private function sortTokens(Tokens $tokens, int $startIndex, int $endIndex, array $elements, ?Token $delimiter = null): void - { - $replaceTokens = []; - - foreach ($elements as $pos => $element) { - for ($i = $element['start']; $i <= $element['end']; ++$i) { - $replaceTokens[] = clone $tokens[$i]; - } - if (null !== $delimiter && $pos !== \count($elements) - 1) { - $replaceTokens[] = clone $delimiter; - } - } - - $tokens->overrideRange($startIndex, $endIndex, $replaceTokens); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php deleted file mode 100644 index 5057ae16..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php +++ /dev/null @@ -1,268 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Basic; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\ControlStructure\ControlStructureBracesFixer; -use PhpCsFixer\Fixer\ControlStructure\ControlStructureContinuationPositionFixer; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\Fixer\LanguageConstruct\DeclareParenthesesFixer; -use PhpCsFixer\Fixer\LanguageConstruct\SingleSpaceAroundConstructFixer; -use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer; -use PhpCsFixer\Fixer\Whitespace\StatementIndentationFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * Fixer for rules defined in PSR2 ¶4.1, ¶4.4, ¶5. - * - * @author Dariusz Rumiński - * - * @deprecated - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * allow_single_line_anonymous_class_with_empty_body?: bool, - * allow_single_line_closure?: bool, - * position_after_anonymous_constructs?: 'next'|'same', - * position_after_control_structures?: 'next'|'same', - * position_after_functions_and_oop_constructs?: 'next'|'same' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * allow_single_line_anonymous_class_with_empty_body: bool, - * allow_single_line_closure: bool, - * position_after_anonymous_constructs: 'next'|'same', - * position_after_control_structures: 'next'|'same', - * position_after_functions_and_oop_constructs: 'next'|'same' - * } - */ -final class BracesFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface, DeprecatedFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const LINE_NEXT = 'next'; - - /** - * @internal - */ - public const LINE_SAME = 'same'; - - private ?BracesPositionFixer $bracesPositionFixer = null; - - private ?ControlStructureContinuationPositionFixer $controlStructureContinuationPositionFixer = null; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'The body of each structure MUST be enclosed by braces. Braces should be properly placed. Body of braces should be properly indented.', - [ - new CodeSample( - '= 0; }; -$negative = function ($item) { - return $item < 0; }; -', - ['allow_single_line_closure' => true] - ), - new CodeSample( - ' self::LINE_SAME] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before HeredocIndentationFixer. - * Must run after ClassAttributesSeparationFixer, ClassDefinitionFixer, EmptyLoopBodyFixer, NoAlternativeSyntaxFixer, NoEmptyStatementFixer, NoUselessElseFixer, SingleLineThrowFixer, SingleSpaceAfterConstructFixer, SingleSpaceAroundConstructFixer, SingleTraitInsertPerStatementFixer. - */ - public function getPriority(): int - { - return 35; - } - - public function getSuccessorsNames(): array - { - return array_keys($this->proxyFixers); - } - - protected function configurePostNormalisation(): void - { - $this->getBracesPositionFixer()->configure([ - 'control_structures_opening_brace' => $this->translatePositionOption($this->configuration['position_after_control_structures']), - 'functions_opening_brace' => $this->translatePositionOption($this->configuration['position_after_functions_and_oop_constructs']), - 'anonymous_functions_opening_brace' => $this->translatePositionOption($this->configuration['position_after_anonymous_constructs']), - 'classes_opening_brace' => $this->translatePositionOption($this->configuration['position_after_functions_and_oop_constructs']), - 'anonymous_classes_opening_brace' => $this->translatePositionOption($this->configuration['position_after_anonymous_constructs']), - 'allow_single_line_empty_anonymous_classes' => $this->configuration['allow_single_line_anonymous_class_with_empty_body'], - 'allow_single_line_anonymous_functions' => $this->configuration['allow_single_line_closure'], - ]); - - $this->getControlStructureContinuationPositionFixer()->configure([ - 'position' => self::LINE_NEXT === $this->configuration['position_after_control_structures'] - ? ControlStructureContinuationPositionFixer::NEXT_LINE - : ControlStructureContinuationPositionFixer::SAME_LINE, - ]); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('allow_single_line_anonymous_class_with_empty_body', 'Whether single line anonymous class with empty body notation should be allowed.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('allow_single_line_closure', 'Whether single line lambda notation should be allowed.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('position_after_functions_and_oop_constructs', 'Whether the opening brace should be placed on "next" or "same" line after classy constructs (non-anonymous classes, interfaces, traits, methods and non-lambda functions).')) - ->setAllowedValues([self::LINE_NEXT, self::LINE_SAME]) - ->setDefault(self::LINE_NEXT) - ->getOption(), - (new FixerOptionBuilder('position_after_control_structures', 'Whether the opening brace should be placed on "next" or "same" line after control structures.')) - ->setAllowedValues([self::LINE_NEXT, self::LINE_SAME]) - ->setDefault(self::LINE_SAME) - ->getOption(), - (new FixerOptionBuilder('position_after_anonymous_constructs', 'Whether the opening brace should be placed on "next" or "same" line after anonymous constructs (anonymous classes and lambda functions).')) - ->setAllowedValues([self::LINE_NEXT, self::LINE_SAME]) - ->setDefault(self::LINE_SAME) - ->getOption(), - ]); - } - - protected function createProxyFixers(): array - { - $singleSpaceAroundConstructFixer = new SingleSpaceAroundConstructFixer(); - $singleSpaceAroundConstructFixer->configure([ - 'constructs_contain_a_single_space' => [], - 'constructs_followed_by_a_single_space' => ['elseif', 'for', 'foreach', 'if', 'match', 'while', 'use_lambda'], - 'constructs_preceded_by_a_single_space' => ['use_lambda'], - ]); - - $noExtraBlankLinesFixer = new NoExtraBlankLinesFixer(); - $noExtraBlankLinesFixer->configure([ - 'tokens' => ['curly_brace_block'], - ]); - - return [ - $singleSpaceAroundConstructFixer, - new ControlStructureBracesFixer(), - $noExtraBlankLinesFixer, - $this->getBracesPositionFixer(), - $this->getControlStructureContinuationPositionFixer(), - new DeclareParenthesesFixer(), - new NoMultipleStatementsPerLineFixer(), - new StatementIndentationFixer(true), - ]; - } - - private function getBracesPositionFixer(): BracesPositionFixer - { - if (null === $this->bracesPositionFixer) { - $this->bracesPositionFixer = new BracesPositionFixer(); - } - - return $this->bracesPositionFixer; - } - - private function getControlStructureContinuationPositionFixer(): ControlStructureContinuationPositionFixer - { - if (null === $this->controlStructureContinuationPositionFixer) { - $this->controlStructureContinuationPositionFixer = new ControlStructureContinuationPositionFixer(); - } - - return $this->controlStructureContinuationPositionFixer; - } - - /** - * @return BracesPositionFixer::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END|BracesPositionFixer::SAME_LINE - */ - private function translatePositionOption(string $option): string - { - return self::LINE_NEXT === $option - ? BracesPositionFixer::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END - : BracesPositionFixer::SAME_LINE; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php deleted file mode 100644 index 492c35d8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php +++ /dev/null @@ -1,441 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Basic; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\Indentation; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * allow_single_line_anonymous_functions?: bool, - * allow_single_line_empty_anonymous_classes?: bool, - * anonymous_classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', - * anonymous_functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', - * classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', - * control_structures_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', - * functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * allow_single_line_anonymous_functions: bool, - * allow_single_line_empty_anonymous_classes: bool, - * anonymous_classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', - * anonymous_functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', - * classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', - * control_structures_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', - * functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line' - * } - */ -final class BracesPositionFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - use Indentation; - - /** - * @internal - */ - public const NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END = 'next_line_unless_newline_at_signature_end'; - - /** - * @internal - */ - public const SAME_LINE = 'same_line'; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Braces must be placed as configured.', - [ - new CodeSample( - ' self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END] - ), - new CodeSample( - ' self::SAME_LINE] - ), - new CodeSample( - ' self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END] - ), - new CodeSample( - ' self::SAME_LINE] - ), - new CodeSample( - ' self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END] - ), - new CodeSample( - ' true] - ), - new CodeSample( - ' true] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound('{'); - } - - /** - * {@inheritdoc} - * - * Must run before SingleLineEmptyBodyFixer, StatementIndentationFixer. - * Must run after ControlStructureBracesFixer, NoMultipleStatementsPerLineFixer. - */ - public function getPriority(): int - { - return -2; - } - - /** @protected */ - public function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('control_structures_opening_brace', 'The position of the opening brace of control structures‘ body.')) - ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) - ->setDefault(self::SAME_LINE) - ->getOption(), - (new FixerOptionBuilder('functions_opening_brace', 'The position of the opening brace of functions‘ body.')) - ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) - ->setDefault(self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END) - ->getOption(), - (new FixerOptionBuilder('anonymous_functions_opening_brace', 'The position of the opening brace of anonymous functions‘ body.')) - ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) - ->setDefault(self::SAME_LINE) - ->getOption(), - (new FixerOptionBuilder('classes_opening_brace', 'The position of the opening brace of classes‘ body.')) - ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) - ->setDefault(self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END) - ->getOption(), - (new FixerOptionBuilder('anonymous_classes_opening_brace', 'The position of the opening brace of anonymous classes‘ body.')) - ->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE]) - ->setDefault(self::SAME_LINE) - ->getOption(), - (new FixerOptionBuilder('allow_single_line_empty_anonymous_classes', 'Allow anonymous classes to have opening and closing braces on the same line.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('allow_single_line_anonymous_functions', 'Allow anonymous functions to have opening and closing braces on the same line.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $classyTokens = Token::getClassyTokenKinds(); - $controlStructureTokens = [T_DECLARE, T_DO, T_ELSE, T_ELSEIF, T_FINALLY, T_FOR, T_FOREACH, T_IF, T_WHILE, T_TRY, T_CATCH, T_SWITCH]; - // @TODO: drop condition when PHP 8.0+ is required - if (\defined('T_MATCH')) { - $controlStructureTokens[] = T_MATCH; - } - - $tokensAnalyzer = new TokensAnalyzer($tokens); - - $allowSingleLineUntil = null; - - foreach ($tokens as $index => $token) { - $allowSingleLine = false; - $allowSingleLineIfEmpty = false; - - if ($token->isGivenKind($classyTokens)) { - $openBraceIndex = $tokens->getNextTokenOfKind($index, ['{']); - - if ($tokensAnalyzer->isAnonymousClass($index)) { - $allowSingleLineIfEmpty = true === $this->configuration['allow_single_line_empty_anonymous_classes']; - $positionOption = 'anonymous_classes_opening_brace'; - } else { - $positionOption = 'classes_opening_brace'; - } - } elseif ($token->isGivenKind(T_FUNCTION)) { - $openBraceIndex = $tokens->getNextTokenOfKind($index, ['{', ';']); - - if ($tokens[$openBraceIndex]->equals(';')) { - continue; - } - - if ($tokensAnalyzer->isLambda($index)) { - $allowSingleLine = true === $this->configuration['allow_single_line_anonymous_functions']; - $positionOption = 'anonymous_functions_opening_brace'; - } else { - $positionOption = 'functions_opening_brace'; - } - } elseif ($token->isGivenKind($controlStructureTokens)) { - $parenthesisEndIndex = $this->findParenthesisEnd($tokens, $index); - $openBraceIndex = $tokens->getNextMeaningfulToken($parenthesisEndIndex); - - if (!$tokens[$openBraceIndex]->equals('{')) { - continue; - } - - $positionOption = 'control_structures_opening_brace'; - } else { - continue; - } - - $closeBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $openBraceIndex); - - $addNewlinesInsideBraces = true; - if ($allowSingleLine || $allowSingleLineIfEmpty || $index < $allowSingleLineUntil) { - $addNewlinesInsideBraces = false; - - for ($indexInsideBraces = $openBraceIndex + 1; $indexInsideBraces < $closeBraceIndex; ++$indexInsideBraces) { - $tokenInsideBraces = $tokens[$indexInsideBraces]; - - if ( - ($allowSingleLineIfEmpty && !$tokenInsideBraces->isWhitespace() && !$tokenInsideBraces->isComment()) - || ($tokenInsideBraces->isWhitespace() && Preg::match('/\R/', $tokenInsideBraces->getContent())) - ) { - $addNewlinesInsideBraces = true; - - break; - } - } - - if (!$addNewlinesInsideBraces && null === $allowSingleLineUntil) { - $allowSingleLineUntil = $closeBraceIndex; - } - } - - if ( - $addNewlinesInsideBraces - && !$this->isFollowedByNewLine($tokens, $openBraceIndex) - && !$this->hasCommentOnSameLine($tokens, $openBraceIndex) - && !$tokens[$tokens->getNextMeaningfulToken($openBraceIndex)]->isGivenKind(T_CLOSE_TAG) - ) { - $whitespace = $this->whitespacesConfig->getLineEnding().$this->getLineIndentation($tokens, $openBraceIndex); - if ($tokens->ensureWhitespaceAtIndex($openBraceIndex + 1, 0, $whitespace)) { - ++$closeBraceIndex; - } - } - - $whitespace = ' '; - if (self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END === $this->configuration[$positionOption]) { - $whitespace = $this->whitespacesConfig->getLineEnding().$this->getLineIndentation($tokens, $index); - - $previousTokenIndex = $openBraceIndex; - do { - $previousTokenIndex = $tokens->getPrevMeaningfulToken($previousTokenIndex); - } while ($tokens[$previousTokenIndex]->isGivenKind([CT::T_TYPE_COLON, CT::T_NULLABLE_TYPE, T_STRING, T_NS_SEPARATOR, CT::T_ARRAY_TYPEHINT, T_STATIC, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, T_CALLABLE, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE])); - - if ($tokens[$previousTokenIndex]->equals(')')) { - if ($tokens[--$previousTokenIndex]->isComment()) { - --$previousTokenIndex; - } - if ( - $tokens[$previousTokenIndex]->isWhitespace() - && Preg::match('/\R/', $tokens[$previousTokenIndex]->getContent()) - ) { - $whitespace = ' '; - } - } - } - - $moveBraceToIndex = null; - - if (' ' === $whitespace) { - $previousMeaningfulIndex = $tokens->getPrevMeaningfulToken($openBraceIndex); - for ($indexBeforeOpenBrace = $openBraceIndex - 1; $indexBeforeOpenBrace > $previousMeaningfulIndex; --$indexBeforeOpenBrace) { - if (!$tokens[$indexBeforeOpenBrace]->isComment()) { - continue; - } - - $tokenBeforeOpenBrace = $tokens[--$indexBeforeOpenBrace]; - if ($tokenBeforeOpenBrace->isWhitespace()) { - $moveBraceToIndex = $indexBeforeOpenBrace; - } elseif ($indexBeforeOpenBrace === $previousMeaningfulIndex) { - $moveBraceToIndex = $previousMeaningfulIndex + 1; - } - } - } elseif (!$tokens[$openBraceIndex - 1]->isWhitespace() || !Preg::match('/\R/', $tokens[$openBraceIndex - 1]->getContent())) { - for ($indexAfterOpenBrace = $openBraceIndex + 1; $indexAfterOpenBrace < $closeBraceIndex; ++$indexAfterOpenBrace) { - if ($tokens[$indexAfterOpenBrace]->isWhitespace() && Preg::match('/\R/', $tokens[$indexAfterOpenBrace]->getContent())) { - break; - } - - if ($tokens[$indexAfterOpenBrace]->isComment() && !str_starts_with($tokens[$indexAfterOpenBrace]->getContent(), '/*')) { - $moveBraceToIndex = $indexAfterOpenBrace + 1; - } - } - } - - if (null !== $moveBraceToIndex) { - /** @var Token $movedToken */ - $movedToken = clone $tokens[$openBraceIndex]; - - $delta = $openBraceIndex < $moveBraceToIndex ? 1 : -1; - - if ($tokens[$openBraceIndex + $delta]->isWhitespace()) { - if (-1 === $delta && Preg::match('/\R/', $tokens[$openBraceIndex - 1]->getContent())) { - $content = Preg::replace('/^(\h*?\R)?\h*/', '', $tokens[$openBraceIndex + 1]->getContent()); - if ('' !== $content) { - $tokens[$openBraceIndex + 1] = new Token([T_WHITESPACE, $content]); - } else { - $tokens->clearAt($openBraceIndex + 1); - } - } elseif ($tokens[$openBraceIndex - 1]->isWhitespace()) { - $tokens->clearAt($openBraceIndex - 1); - } - } - - for (; $openBraceIndex !== $moveBraceToIndex; $openBraceIndex += $delta) { - /** @var Token $siblingToken */ - $siblingToken = $tokens[$openBraceIndex + $delta]; - $tokens[$openBraceIndex] = $siblingToken; - } - - $tokens[$openBraceIndex] = $movedToken; - - $openBraceIndex = $moveBraceToIndex; - } - - if ($tokens->ensureWhitespaceAtIndex($openBraceIndex - 1, 1, $whitespace)) { - ++$closeBraceIndex; - if (null !== $allowSingleLineUntil) { - ++$allowSingleLineUntil; - } - } - - if ( - !$addNewlinesInsideBraces - || $tokens[$tokens->getPrevMeaningfulToken($closeBraceIndex)]->isGivenKind(T_OPEN_TAG) - ) { - continue; - } - - $prevIndex = $closeBraceIndex - 1; - while ($tokens->isEmptyAt($prevIndex)) { - --$prevIndex; - } - - $prevToken = $tokens[$prevIndex]; - - if ($prevToken->isWhitespace() && Preg::match('/\R/', $prevToken->getContent())) { - continue; - } - - $whitespace = $this->whitespacesConfig->getLineEnding().$this->getLineIndentation($tokens, $openBraceIndex); - $tokens->ensureWhitespaceAtIndex($prevIndex, 1, $whitespace); - } - } - - private function findParenthesisEnd(Tokens $tokens, int $structureTokenIndex): int - { - $nextIndex = $tokens->getNextMeaningfulToken($structureTokenIndex); - $nextToken = $tokens[$nextIndex]; - - // return if next token is not opening parenthesis - if (!$nextToken->equals('(')) { - return $structureTokenIndex; - } - - return $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $nextIndex); - } - - private function isFollowedByNewLine(Tokens $tokens, int $index): bool - { - for (++$index, $max = \count($tokens) - 1; $index < $max; ++$index) { - $token = $tokens[$index]; - if (!$token->isComment()) { - return $token->isWhitespace() && Preg::match('/\R/', $token->getContent()); - } - } - - return false; - } - - private function hasCommentOnSameLine(Tokens $tokens, int $index): bool - { - $token = $tokens[$index + 1]; - - if ($token->isWhitespace() && !Preg::match('/\R/', $token->getContent())) { - $token = $tokens[$index + 2]; - } - - return $token->isComment(); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/CurlyBracesPositionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/CurlyBracesPositionFixer.php deleted file mode 100644 index 099b6381..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/CurlyBracesPositionFixer.php +++ /dev/null @@ -1,126 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Basic; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\Fixer\Indentation; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @deprecated - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * allow_single_line_anonymous_functions?: bool, - * allow_single_line_empty_anonymous_classes?: bool, - * anonymous_classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', - * anonymous_functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', - * classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', - * control_structures_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line', - * functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * allow_single_line_anonymous_functions: bool, - * allow_single_line_empty_anonymous_classes: bool, - * anonymous_classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', - * anonymous_functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', - * classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', - * control_structures_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line', - * functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line' - * } - */ -final class CurlyBracesPositionFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - use Indentation; - - /** - * @internal - */ - public const NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END = 'next_line_unless_newline_at_signature_end'; - - /** - * @internal - */ - public const SAME_LINE = 'same_line'; - - private BracesPositionFixer $bracesPositionFixer; - - public function __construct() - { - $this->bracesPositionFixer = new BracesPositionFixer(); - - parent::__construct(); - } - - public function getDefinition(): FixerDefinitionInterface - { - $fixerDefinition = $this->bracesPositionFixer->getDefinition(); - - return new FixerDefinition( - 'Curly braces must be placed as configured.', - $fixerDefinition->getCodeSamples(), - $fixerDefinition->getDescription(), - $fixerDefinition->getRiskyDescription() - ); - } - - /** - * {@inheritdoc} - * - * Must run before SingleLineEmptyBodyFixer, StatementIndentationFixer. - * Must run after ControlStructureBracesFixer, NoMultipleStatementsPerLineFixer. - */ - public function getPriority(): int - { - return $this->bracesPositionFixer->getPriority(); - } - - public function getSuccessorsNames(): array - { - return [ - $this->bracesPositionFixer->getName(), - ]; - } - - /** - * @param _AutogeneratedInputConfiguration $configuration - */ - protected function configurePreNormalisation(array $configuration): void - { - $this->bracesPositionFixer->configure($configuration); - } - - protected function createProxyFixers(): array - { - return [ - $this->bracesPositionFixer, - ]; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return $this->bracesPositionFixer->createConfigurationDefinition(); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/EncodingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/EncodingFixer.php deleted file mode 100644 index 2dc98e47..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/EncodingFixer.php +++ /dev/null @@ -1,80 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Basic; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR1 ¶2.2. - * - * @author Dariusz Rumiński - */ -final class EncodingFixer extends AbstractFixer -{ - private string $bom; - - public function __construct() - { - parent::__construct(); - - $this->bom = pack('CCC', 0xEF, 0xBB, 0xBF); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHP code MUST use only UTF-8 without BOM (remove BOM).', - [ - new CodeSample( - $this->bom.'getContent(); - - if (str_starts_with($content, $this->bom)) { - $newContent = substr($content, 3); - - if ('' === $newContent) { - $tokens->clearAt(0); - } else { - $tokens[0] = new Token([$tokens[0]->getId(), $newContent]); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoMultipleStatementsPerLineFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoMultipleStatementsPerLineFixer.php deleted file mode 100644 index e499d260..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoMultipleStatementsPerLineFixer.php +++ /dev/null @@ -1,111 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Basic; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\Indentation; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶2.3 Lines: There must not be more than one statement per line. - */ -final class NoMultipleStatementsPerLineFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - use Indentation; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There must not be more than one statement per line.', - [new CodeSample("isTokenKindFound(';'); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = 1, $max = \count($tokens) - 1; $index < $max; ++$index) { - if ($tokens[$index]->isGivenKind(T_FOR)) { - $index = $tokens->findBlockEnd( - Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, - $tokens->getNextTokenOfKind($index, ['(']) - ); - - continue; - } - - if ($tokens[$index]->isGivenKind(CT::T_PROPERTY_HOOK_BRACE_OPEN)) { - $index = $tokens->findBlockEnd( - Tokens::BLOCK_TYPE_PROPERTY_HOOK, - $index - ); - - continue; - } - - if (!$tokens[$index]->equals(';')) { - continue; - } - - for ($nextIndex = $index + 1; $nextIndex < $max; ++$nextIndex) { - $token = $tokens[$nextIndex]; - - if ($token->isWhitespace() || $token->isComment()) { - if (Preg::match('/\R/', $token->getContent())) { - break; - } - - continue; - } - - if (!$token->equalsAny(['}', [T_CLOSE_TAG], [T_ENDIF], [T_ENDFOR], [T_ENDSWITCH], [T_ENDWHILE], [T_ENDFOREACH]])) { - $whitespaceIndex = $index; - do { - $token = $tokens[++$whitespaceIndex]; - } while ($token->isComment()); - - $newline = $this->whitespacesConfig->getLineEnding().$this->getLineIndentation($tokens, $index); - - if ($tokens->ensureWhitespaceAtIndex($whitespaceIndex, 0, $newline)) { - ++$max; - } - } - - break; - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php deleted file mode 100644 index f7d69226..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php +++ /dev/null @@ -1,162 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Basic; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * elements?: list<'arguments'|'array'|'array_destructuring'|'group_import'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * elements: list<'arguments'|'array'|'array_destructuring'|'group_import'> - * } - */ -final class NoTrailingCommaInSinglelineFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'If a list of values separated by a comma is contained on a single line, then the last item MUST NOT have a trailing comma.', - [ - new CodeSample(" ['array_destructuring']]), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return - $tokens->isTokenKindFound(',') - && $tokens->isAnyTokenKindsFound([')', CT::T_ARRAY_SQUARE_BRACE_CLOSE, CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE, CT::T_GROUP_IMPORT_BRACE_CLOSE]); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $elements = ['arguments', 'array_destructuring', 'array', 'group_import']; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('elements', 'Which elements to fix.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset($elements)]) - ->setDefault($elements) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if (!$tokens[$index]->equals(')') && !$tokens[$index]->isGivenKind([CT::T_ARRAY_SQUARE_BRACE_CLOSE, CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE, CT::T_GROUP_IMPORT_BRACE_CLOSE])) { - continue; - } - - $commaIndex = $tokens->getPrevMeaningfulToken($index); - - if (!$tokens[$commaIndex]->equals(',')) { - continue; - } - - $block = Tokens::detectBlockType($tokens[$index]); - $blockOpenIndex = $tokens->findBlockStart($block['type'], $index); - - if ($tokens->isPartialCodeMultiline($blockOpenIndex, $index)) { - continue; - } - - if (!$this->shouldBeCleared($tokens, $blockOpenIndex)) { - continue; - } - - do { - $tokens->clearTokenAndMergeSurroundingWhitespace($commaIndex); - $commaIndex = $tokens->getPrevMeaningfulToken($commaIndex); - } while ($tokens[$commaIndex]->equals(',')); - - $tokens->removeTrailingWhitespace($commaIndex); - } - } - - private function shouldBeCleared(Tokens $tokens, int $openIndex): bool - { - $elements = $this->configuration['elements']; - - if ($tokens[$openIndex]->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { - return \in_array('array', $elements, true); - } - - if ($tokens[$openIndex]->isGivenKind(CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN)) { - return \in_array('array_destructuring', $elements, true); - } - - if ($tokens[$openIndex]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_OPEN)) { - return \in_array('group_import', $elements, true); - } - - if (!$tokens[$openIndex]->equals('(')) { - return false; - } - - $beforeOpen = $tokens->getPrevMeaningfulToken($openIndex); - - if ($tokens[$beforeOpen]->isGivenKind(T_ARRAY)) { - return \in_array('array', $elements, true); - } - - if ($tokens[$beforeOpen]->isGivenKind(T_LIST)) { - return \in_array('array_destructuring', $elements, true); - } - - if ($tokens[$beforeOpen]->isGivenKind([T_UNSET, T_ISSET, T_VARIABLE, T_CLASS])) { - return \in_array('arguments', $elements, true); - } - - if ($tokens[$beforeOpen]->isGivenKind(T_STRING)) { - return !AttributeAnalyzer::isAttribute($tokens, $beforeOpen) && \in_array('arguments', $elements, true); - } - - if ($tokens[$beforeOpen]->equalsAny([')', ']', [CT::T_DYNAMIC_VAR_BRACE_CLOSE], [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE]])) { - $block = Tokens::detectBlockType($tokens[$beforeOpen]); - - return - ( - Tokens::BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE === $block['type'] - || Tokens::BLOCK_TYPE_DYNAMIC_VAR_BRACE === $block['type'] - || Tokens::BLOCK_TYPE_INDEX_SQUARE_BRACE === $block['type'] - || Tokens::BLOCK_TYPE_PARENTHESIS_BRACE === $block['type'] - ) && \in_array('arguments', $elements, true); - } - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php deleted file mode 100644 index 44fe6093..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php +++ /dev/null @@ -1,191 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Basic; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Removes Zero-width space (ZWSP), Non-breaking space (NBSP) and other invisible unicode symbols. - * - * @author Ivan Boprzenkov - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * use_escape_sequences_in_strings?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * use_escape_sequences_in_strings: bool - * } - */ -final class NonPrintableCharacterFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var list - */ - private const TOKENS = [ - T_STRING_VARNAME, - T_INLINE_HTML, - T_VARIABLE, - T_COMMENT, - T_ENCAPSED_AND_WHITESPACE, - T_CONSTANT_ENCAPSED_STRING, - T_DOC_COMMENT, - ]; - - /** - * @var array - */ - private array $symbolsReplace; - - public function __construct() - { - parent::__construct(); - - $this->symbolsReplace = [ - pack('H*', 'e2808b') => ['', '200b'], // ZWSP U+200B - pack('H*', 'e28087') => [' ', '2007'], // FIGURE SPACE U+2007 - pack('H*', 'e280af') => [' ', '202f'], // NBSP U+202F - pack('H*', 'e281a0') => ['', '2060'], // WORD JOINER U+2060 - pack('H*', 'c2a0') => [' ', 'a0'], // NO-BREAK SPACE U+A0 - ]; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Remove Zero-width space (ZWSP), Non-breaking space (NBSP) and other invisible unicode symbols.', - [ - new CodeSample( - ' false] - ), - ], - null, - 'Risky when strings contain intended invisible characters.' - ); - } - - public function isRisky(): bool - { - return true; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(self::TOKENS); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('use_escape_sequences_in_strings', 'Whether characters should be replaced with escape sequences in strings.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $replacements = []; - $escapeSequences = []; - - foreach ($this->symbolsReplace as $character => [$replacement, $codepoint]) { - $replacements[$character] = $replacement; - $escapeSequences[$character] = '\u{'.$codepoint.'}'; - } - - foreach ($tokens as $index => $token) { - $content = $token->getContent(); - - if ( - true === $this->configuration['use_escape_sequences_in_strings'] - && $token->isGivenKind([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE]) - ) { - if (!Preg::match('/'.implode('|', array_keys($escapeSequences)).'/', $content)) { - continue; - } - - $previousToken = $tokens[$index - 1]; - $stringTypeChanged = false; - $swapQuotes = false; - - if ($previousToken->isGivenKind(T_START_HEREDOC)) { - $previousTokenContent = $previousToken->getContent(); - - if (str_contains($previousTokenContent, '\'')) { - $tokens[$index - 1] = new Token([T_START_HEREDOC, str_replace('\'', '', $previousTokenContent)]); - $stringTypeChanged = true; - } - } elseif (str_starts_with($content, "'")) { - $stringTypeChanged = true; - $swapQuotes = true; - } - - if ($swapQuotes) { - $content = str_replace("\\'", "'", $content); - } - - if ($stringTypeChanged) { - $content = Preg::replace('/(\\\{1,2})/', '\\\\\\\\', $content); - $content = str_replace('$', '\$', $content); - } - - if ($swapQuotes) { - $content = str_replace('"', '\"', $content); - $content = Preg::replace('/^\'(.*)\'$/s', '"$1"', $content); - } - - $tokens[$index] = new Token([$token->getId(), strtr($content, $escapeSequences)]); - - continue; - } - - if ($token->isGivenKind(self::TOKENS)) { - $newContent = strtr($content, $replacements); - - // variable name cannot contain space - if ($token->isGivenKind([T_STRING_VARNAME, T_VARIABLE]) && str_contains($newContent, ' ')) { - continue; - } - - // multiline comment must have "*/" only at the end - if ($token->isGivenKind([T_COMMENT, T_DOC_COMMENT]) && str_starts_with($newContent, '/*') && strpos($newContent, '*/') !== \strlen($newContent) - 2) { - continue; - } - - $tokens[$index] = new Token([$token->getId(), $newContent]); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php deleted file mode 100644 index b062dcde..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php +++ /dev/null @@ -1,232 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Basic; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Let's you add underscores to numeric literals. - * - * Inspired by: - * - {@link https://github.com/kubawerlos/php-cs-fixer-custom-fixers/blob/main/src/Fixer/NumericLiteralSeparatorFixer.php} - * - {@link https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/rules/numeric-separators-style.js} - * - * @author Marvin Heilemann - * @author Greg Korba - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * override_existing?: bool, - * strategy?: 'no_separator'|'use_separator' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * override_existing: bool, - * strategy: 'no_separator'|'use_separator' - * } - */ -final class NumericLiteralSeparatorFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public const STRATEGY_USE_SEPARATOR = 'use_separator'; - public const STRATEGY_NO_SEPARATOR = 'no_separator'; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Adds separators to numeric literals of any kind.', - [ - new CodeSample( - <<<'PHP' - self::STRATEGY_NO_SEPARATOR], - ), - new CodeSample( - <<<'PHP' - self::STRATEGY_USE_SEPARATOR], - ), - new CodeSample( - " true] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_DNUMBER, T_LNUMBER]); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder( - 'override_existing', - 'Whether literals already containing underscores should be reformatted.' - )) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder( - 'strategy', - 'Whether numeric literal should be separated by underscores or not.' - )) - ->setAllowedValues([self::STRATEGY_USE_SEPARATOR, self::STRATEGY_NO_SEPARATOR]) - ->setDefault(self::STRATEGY_USE_SEPARATOR) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind([T_DNUMBER, T_LNUMBER])) { - continue; - } - - $content = $token->getContent(); - - $newContent = $this->formatValue($content); - - if ($content === $newContent) { - // Skip Token override if its the same content, like when it - // already got a valid literal separator structure. - continue; - } - - $tokens[$index] = new Token([$token->getId(), $newContent]); - } - } - - private function formatValue(string $value): string - { - if (self::STRATEGY_NO_SEPARATOR === $this->configuration['strategy']) { - return str_contains($value, '_') ? str_replace('_', '', $value) : $value; - } - - if (true === $this->configuration['override_existing']) { - $value = str_replace('_', '', $value); - } elseif (str_contains($value, '_')) { - // Keep already underscored literals untouched. - return $value; - } - - $lowerValue = strtolower($value); - - if (str_starts_with($lowerValue, '0b')) { - // Binary - return $this->insertEveryRight($value, 8, 2); - } - - if (str_starts_with($lowerValue, '0x')) { - // Hexadecimal - return $this->insertEveryRight($value, 2, 2); - } - - if (str_starts_with($lowerValue, '0o')) { - // Octal - return $this->insertEveryRight($value, 3, 2); - } - if (str_starts_with($lowerValue, '0') && !str_contains($lowerValue, '.')) { - // Octal notation prior PHP 8.1 but still valid - return $this->insertEveryRight($value, 3, 1); - } - - // All other types - - /** If its a negative value we need an offset */ - $negativeOffset = static fn ($v) => str_contains($v, '-') ? 1 : 0; - - Preg::matchAll('/([0-9-_]+)?((\.)([0-9_]*))?((e)([0-9-_]+))?/i', $value, $result); - - $integer = $result[1][0]; - $joinedValue = $this->insertEveryRight($integer, 3, $negativeOffset($integer)); - - $dot = $result[3][0]; - if ('' !== $dot) { - $integer = $result[4][0]; - $decimal = $this->insertEveryLeft($integer, 3, $negativeOffset($integer)); - $joinedValue = $joinedValue.$dot.$decimal; - } - - $tim = $result[6][0]; - if ('' !== $tim) { - $integer = $result[7][0]; - $times = $this->insertEveryRight($integer, 3, $negativeOffset($integer)); - $joinedValue = $joinedValue.$tim.$times; - } - - return $joinedValue; - } - - private function insertEveryRight(string $value, int $length, int $offset = 0): string - { - $position = $length * -1; - while ($position > -(\strlen($value) - $offset)) { - $value = substr_replace($value, '_', $position, 0); - $position -= $length + 1; - } - - return $value; - } - - private function insertEveryLeft(string $value, int $length, int $offset = 0): string - { - $position = $length; - while ($position < \strlen($value)) { - $value = substr_replace($value, '_', $position, $offset); - $position += $length + 1; - } - - return $value; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/OctalNotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/OctalNotationFixer.php deleted file mode 100644 index 36f19e88..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/OctalNotationFixer.php +++ /dev/null @@ -1,64 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Basic; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class OctalNotationFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Literal octal must be in `0o` notation.', - [ - new VersionSpecificCodeSample( - "= 8_01_00 && $tokens->isTokenKindFound(T_LNUMBER); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_LNUMBER)) { - continue; - } - - $content = $token->getContent(); - - $newContent = Preg::replace('#^0_*+([0-7_]+)$#', '0o$1', $content); - - if ($content === $newContent) { - continue; - } - - $tokens[$index] = new Token([T_LNUMBER, $newContent]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php deleted file mode 100644 index 7f795cb9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php +++ /dev/null @@ -1,291 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Basic; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\TypeExpression; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\FileSpecificCodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\StdinFileInfo; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Jordi Boggiano - * @author Dariusz Rumiński - * @author Bram Gotink - * @author Graham Campbell - * @author Kuba Werłos - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * dir?: null|string - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * dir: null|string - * } - */ -final class PsrAutoloadingFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Classes must be in a path that matches their namespace, be at least one namespace deep and the class name should match the file name.', - [ - new FileSpecificCodeSample( - ' './src'] - ), - ], - null, - 'This fixer may change your class name, which will break the code that depends on the old name.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); - } - - public function isRisky(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * Must run before SelfAccessorFixer. - */ - public function getPriority(): int - { - return -10; - } - - public function supports(\SplFileInfo $file): bool - { - if ($file instanceof StdinFileInfo) { - return false; - } - - if ( - // ignore file with extension other than php - ('php' !== $file->getExtension()) - // ignore file with name that cannot be a class name - || !Preg::match('/^'.TypeExpression::REGEX_IDENTIFIER.'$/', $file->getBasename('.php')) - ) { - return false; - } - - try { - $tokens = Tokens::fromCode(\sprintf('getBasename('.php'))); - - if ($tokens[3]->isKeyword() || $tokens[3]->isMagicConstant()) { - // name cannot be a class name - detected by PHP 5.x - return false; - } - } catch (\ParseError $e) { - // name cannot be a class name - detected by PHP 7.x - return false; - } - - // ignore stubs/fixtures, since they typically contain invalid files for various reasons - return !Preg::match('{[/\\\](stub|fixture)s?[/\\\]}i', $file->getRealPath()); - } - - protected function configurePostNormalisation(): void - { - if (null !== $this->configuration['dir']) { - $realpath = realpath($this->configuration['dir']); - - if (false === $realpath) { - throw new \InvalidArgumentException(\sprintf('Failed to resolve configured directory "%s".', $this->configuration['dir'])); - } - - $this->configuration['dir'] = $realpath; - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('dir', 'If provided, the directory where the project code is placed.')) - ->setAllowedTypes(['null', 'string']) - ->setDefault(null) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokenAnalyzer = new TokensAnalyzer($tokens); - - if (null !== $this->configuration['dir'] && !str_starts_with($file->getRealPath(), $this->configuration['dir'])) { - return; - } - - $namespace = null; - $namespaceStartIndex = null; - $namespaceEndIndex = null; - - $classyName = null; - $classyIndex = null; - - foreach ($tokens as $index => $token) { - if ($token->isGivenKind(T_NAMESPACE)) { - if (null !== $namespace) { - return; - } - - $namespaceStartIndex = $tokens->getNextMeaningfulToken($index); - $namespaceEndIndex = $tokens->getNextTokenOfKind($namespaceStartIndex, [';']); - $namespace = trim($tokens->generatePartialCode($namespaceStartIndex, $namespaceEndIndex - 1)); - } elseif ($token->isClassy()) { - if ($tokenAnalyzer->isAnonymousClass($index)) { - continue; - } - - if (null !== $classyName) { - return; - } - - $classyIndex = $tokens->getNextMeaningfulToken($index); - $classyName = $tokens[$classyIndex]->getContent(); - } - } - - if (null === $classyName) { - return; - } - - $expectedClassyName = $this->calculateClassyName($file, $namespace, $classyName); - - if ($classyName !== $expectedClassyName) { - $tokens[$classyIndex] = new Token([T_STRING, $expectedClassyName]); - } - - if (null === $this->configuration['dir'] || null === $namespace) { - return; - } - - if (!is_dir($this->configuration['dir'])) { - return; - } - - $configuredDir = realpath($this->configuration['dir']); - $fileDir = \dirname($file->getRealPath()); - - if (\strlen($configuredDir) >= \strlen($fileDir)) { - return; - } - - $newNamespace = substr(str_replace('/', '\\', $fileDir), \strlen($configuredDir) + 1); - $originalNamespace = substr($namespace, -\strlen($newNamespace)); - - if ($originalNamespace !== $newNamespace && strtolower($originalNamespace) === strtolower($newNamespace)) { - $tokens->clearRange($namespaceStartIndex, $namespaceEndIndex); - $namespace = substr($namespace, 0, -\strlen($newNamespace)).$newNamespace; - - $newNamespace = Tokens::fromCode('clearRange(0, 2); - $newNamespace->clearEmptyTokens(); - - $tokens->insertAt($namespaceStartIndex, $newNamespace); - } - } - - private function calculateClassyName(\SplFileInfo $file, ?string $namespace, string $currentName): string - { - $name = $file->getBasename('.php'); - $maxNamespace = $this->calculateMaxNamespace($file, $namespace); - - if (null !== $this->configuration['dir']) { - return ('' !== $maxNamespace ? (str_replace('\\', '_', $maxNamespace).'_') : '').$name; - } - - $namespaceParts = array_reverse(explode('\\', $maxNamespace)); - - foreach ($namespaceParts as $namespacePart) { - $nameCandidate = \sprintf('%s_%s', $namespacePart, $name); - - if (strtolower($nameCandidate) !== strtolower(substr($currentName, -\strlen($nameCandidate)))) { - break; - } - - $name = $nameCandidate; - } - - return $name; - } - - private function calculateMaxNamespace(\SplFileInfo $file, ?string $namespace): string - { - if (null === $this->configuration['dir']) { - $root = \dirname($file->getRealPath()); - - while ($root !== \dirname($root)) { - $root = \dirname($root); - } - } else { - $root = realpath($this->configuration['dir']); - } - - $namespaceAccordingToFileLocation = trim(str_replace(\DIRECTORY_SEPARATOR, '\\', substr(\dirname($file->getRealPath()), \strlen($root))), '\\'); - - if (null === $namespace) { - return $namespaceAccordingToFileLocation; - } - - $namespaceAccordingToFileLocationPartsReversed = array_reverse(explode('\\', $namespaceAccordingToFileLocation)); - $namespacePartsReversed = array_reverse(explode('\\', $namespace)); - - foreach ($namespacePartsReversed as $key => $namespaceParte) { - if (!isset($namespaceAccordingToFileLocationPartsReversed[$key])) { - break; - } - - if (strtolower($namespaceParte) !== strtolower($namespaceAccordingToFileLocationPartsReversed[$key])) { - break; - } - - unset($namespaceAccordingToFileLocationPartsReversed[$key]); - } - - return implode('\\', array_reverse($namespaceAccordingToFileLocationPartsReversed)); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/SingleLineEmptyBodyFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/SingleLineEmptyBodyFixer.php deleted file mode 100644 index c3a81769..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/SingleLineEmptyBodyFixer.php +++ /dev/null @@ -1,83 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Basic; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class SingleLineEmptyBodyFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Empty body of class, interface, trait, enum or function must be abbreviated as `{}` and placed on the same line as the previous symbol, separated by a single space.', - [new CodeSample('isTokenKindFound(T_ENUM)) { // @TODO: drop condition when PHP 8.1+ is required - return true; - } - - return $tokens->isAnyTokenKindsFound([T_INTERFACE, T_CLASS, T_FUNCTION, T_TRAIT]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index > 0; --$index) { - if (!$tokens[$index]->isGivenKind([...Token::getClassyTokenKinds(), T_FUNCTION])) { - continue; - } - - $openBraceIndex = $tokens->getNextTokenOfKind($index, ['{', ';']); - if (!$tokens[$openBraceIndex]->equals('{')) { - continue; - } - - $closeBraceIndex = $tokens->getNextNonWhitespace($openBraceIndex); - if (!$tokens[$closeBraceIndex]->equals('}')) { - continue; - } - - $tokens->ensureWhitespaceAtIndex($openBraceIndex + 1, 0, ''); - - $beforeOpenBraceIndex = $tokens->getPrevNonWhitespace($openBraceIndex); - if (!$tokens[$beforeOpenBraceIndex]->isGivenKind([T_COMMENT, T_DOC_COMMENT])) { - $tokens->ensureWhitespaceAtIndex($openBraceIndex - 1, 1, ' '); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php deleted file mode 100644 index 20b951d1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php +++ /dev/null @@ -1,168 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Casing; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class ClassReferenceNameCasingFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'When referencing an internal class it must be written using the correct casing.', - [ - new CodeSample("isTokenKindFound(T_STRING); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $namespaceUsesAnalyzer = new NamespaceUsesAnalyzer(); - $classNames = $this->getClassNames(); - - foreach ($tokens->getNamespaceDeclarations() as $namespace) { - $uses = []; - - foreach ($namespaceUsesAnalyzer->getDeclarationsInNamespace($tokens, $namespace) as $use) { - $uses[strtolower($use->getShortName())] = true; - } - - foreach ($this->getClassReference($tokens, $namespace) as $reference) { - $currentContent = $tokens[$reference]->getContent(); - $lowerCurrentContent = strtolower($currentContent); - - if (isset($classNames[$lowerCurrentContent]) && $currentContent !== $classNames[$lowerCurrentContent] && !isset($uses[$lowerCurrentContent])) { - $tokens[$reference] = new Token([T_STRING, $classNames[$lowerCurrentContent]]); - } - } - } - } - - private function getClassReference(Tokens $tokens, NamespaceAnalysis $namespace): \Generator - { - static $notBeforeKinds; - static $blockKinds; - - if (null === $notBeforeKinds) { - $notBeforeKinds = [ - CT::T_USE_TRAIT, - T_AS, - T_CASE, // PHP 8.1 trait enum-case - T_CLASS, - T_CONST, - T_DOUBLE_ARROW, - T_DOUBLE_COLON, - T_FUNCTION, - T_INTERFACE, - T_OBJECT_OPERATOR, - T_TRAIT, - ]; - - if (\defined('T_NULLSAFE_OBJECT_OPERATOR')) { // @TODO: drop condition when PHP 8.0+ is required - $notBeforeKinds[] = T_NULLSAFE_OBJECT_OPERATOR; - } - - if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required - $notBeforeKinds[] = T_ENUM; - } - } - - if (null === $blockKinds) { - $blockKinds = ['before' => [','], 'after' => [',']]; - - foreach (Tokens::getBlockEdgeDefinitions() as $definition) { - $blockKinds['before'][] = $definition['start']; - $blockKinds['after'][] = $definition['end']; - } - } - - $namespaceIsGlobal = $namespace->isGlobalNamespace(); - - for ($index = $namespace->getScopeStartIndex(); $index < $namespace->getScopeEndIndex(); ++$index) { - if (!$tokens[$index]->isGivenKind(T_STRING)) { - continue; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$nextIndex]->isGivenKind(T_NS_SEPARATOR)) { - continue; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - $nextIndex = $tokens->getNextMeaningfulToken($index); - - $isNamespaceSeparator = $tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR); - - if (!$isNamespaceSeparator && !$namespaceIsGlobal) { - continue; - } - - if ($isNamespaceSeparator) { - $prevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - - if ($tokens[$prevIndex]->isGivenKind(T_STRING)) { - continue; - } - } elseif ($tokens[$prevIndex]->isGivenKind($notBeforeKinds)) { - continue; - } - - if ($tokens[$prevIndex]->equalsAny($blockKinds['before']) && $tokens[$nextIndex]->equalsAny($blockKinds['after'])) { - continue; - } - - if (!$tokens[$prevIndex]->isGivenKind(T_NEW) && $tokens[$nextIndex]->equalsAny(['(', ';', [T_CLOSE_TAG]])) { - continue; - } - - yield $index; - } - } - - /** - * @return array - */ - private function getClassNames(): array - { - static $classes = null; - - if (null === $classes) { - $classes = []; - - foreach (get_declared_classes() as $class) { - if ((new \ReflectionClass($class))->isInternal()) { - $classes[strtolower($class)] = $class; - } - } - } - - return $classes; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php deleted file mode 100644 index 00389a17..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php +++ /dev/null @@ -1,130 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Casing; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for constants case. - * - * @author Pol Dellaiera - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * case?: 'lower'|'upper' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * case: 'lower'|'upper' - * } - */ -final class ConstantCaseFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * Hold the function that will be used to convert the constants. - * - * @var callable - */ - private $fixFunction; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'The PHP constants `true`, `false`, and `null` MUST be written using the correct casing.', - [ - new CodeSample(" 'upper']), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_STRING); - } - - protected function configurePostNormalisation(): void - { - if ('lower' === $this->configuration['case']) { - $this->fixFunction = static fn (string $content): string => strtolower($content); - } - - if ('upper' === $this->configuration['case']) { - $this->fixFunction = static fn (string $content): string => strtoupper($content); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('case', 'Whether to use the `upper` or `lower` case syntax.')) - ->setAllowedValues(['upper', 'lower']) - ->setDefault('lower') - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - static $forbiddenPrevKinds = null; - if (null === $forbiddenPrevKinds) { - $forbiddenPrevKinds = [ - T_DOUBLE_COLON, - T_EXTENDS, - T_IMPLEMENTS, - T_INSTANCEOF, - T_NAMESPACE, - T_NEW, - T_NS_SEPARATOR, - ...Token::getObjectOperatorKinds(), - ]; - } - - foreach ($tokens as $index => $token) { - if (!$token->equalsAny([[T_STRING, 'true'], [T_STRING, 'false'], [T_STRING, 'null']], false)) { - continue; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$prevIndex]->isGivenKind($forbiddenPrevKinds)) { - continue; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - if ($tokens[$nextIndex]->isGivenKind(T_PAAMAYIM_NEKUDOTAYIM) || $tokens[$nextIndex]->equalsAny(['='], false)) { - continue; - } - - if ($tokens[$prevIndex]->isGivenKind(T_CASE) && $tokens[$nextIndex]->equals(';')) { - continue; - } - - $tokens[$index] = new Token([$token->getId(), ($this->fixFunction)($token->getContent())]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/IntegerLiteralCaseFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/IntegerLiteralCaseFixer.php deleted file mode 100644 index 1d85abba..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/IntegerLiteralCaseFixer.php +++ /dev/null @@ -1,62 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Casing; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class IntegerLiteralCaseFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Integer literals must be in correct case.', - [ - new CodeSample( - "isTokenKindFound(T_LNUMBER); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_LNUMBER)) { - continue; - } - - $content = $token->getContent(); - - $newContent = Preg::replaceCallback('#^0([boxBOX])([0-9a-fA-F_]+)$#', static fn ($matches) => '0'.strtolower($matches[1]).strtoupper($matches[2]), $content); - - if ($content === $newContent) { - continue; - } - - $tokens[$index] = new Token([T_LNUMBER, $newContent]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php deleted file mode 100644 index 53f98d15..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php +++ /dev/null @@ -1,67 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Casing; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶2.5. - * - * @author Dariusz Rumiński - */ -final class LowercaseKeywordsFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHP keywords MUST be in lower case.', - [ - new CodeSample( - 'isAnyTokenKindsFound(Token::getKeywords()); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if ($token->isKeyword() && !$token->isGivenKind([T_HALT_COMPILER])) { - $tokens[$index] = new Token([$token->getId(), strtolower($token->getContent())]); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php deleted file mode 100644 index 7615b296..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php +++ /dev/null @@ -1,107 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Casing; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - */ -final class LowercaseStaticReferenceFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Class static references `self`, `static` and `parent` MUST be in lower case.', - [ - new CodeSample('isAnyTokenKindsFound([T_STATIC, T_STRING]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->equalsAny([[T_STRING, 'self'], [T_STATIC, 'static'], [T_STRING, 'parent']], false)) { - continue; - } - - $newContent = strtolower($token->getContent()); - if ($token->getContent() === $newContent) { - continue; // case is already correct - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$prevIndex]->isGivenKind([T_CONST, T_DOUBLE_COLON, T_FUNCTION, T_NAMESPACE, T_NS_SEPARATOR, T_STATIC, T_STRING, CT::T_ARRAY_TYPEHINT, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE]) || $tokens[$prevIndex]->isObjectOperator()) { - continue; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - if ($tokens[$nextIndex]->isGivenKind([T_FUNCTION, T_NS_SEPARATOR, T_PRIVATE, T_PROTECTED, T_PUBLIC, T_STRING, CT::T_NULLABLE_TYPE])) { - continue; - } - - if ('static' === $newContent && $tokens[$nextIndex]->isGivenKind(T_VARIABLE)) { - continue; - } - - if ($tokens[$prevIndex]->isGivenKind(T_CASE) && !$tokens[$nextIndex]->isGivenKind(T_PAAMAYIM_NEKUDOTAYIM)) { - continue; - } - - $tokens[$index] = new Token([$token->getId(), $newContent]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php deleted file mode 100644 index b8de332e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php +++ /dev/null @@ -1,92 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Casing; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author ntzm - */ -final class MagicConstantCasingFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Magic constants should be referred to using the correct casing.', - [new CodeSample("isAnyTokenKindsFound($this->getMagicConstantTokens()); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $magicConstants = $this->getMagicConstants(); - $magicConstantTokens = $this->getMagicConstantTokens(); - - foreach ($tokens as $index => $token) { - if ($token->isGivenKind($magicConstantTokens)) { - $tokens[$index] = new Token([$token->getId(), $magicConstants[$token->getId()]]); - } - } - } - - /** - * @return array - */ - private function getMagicConstants(): array - { - static $magicConstants = null; - - if (null === $magicConstants) { - $magicConstants = [ - T_LINE => '__LINE__', - T_FILE => '__FILE__', - T_DIR => '__DIR__', - T_FUNC_C => '__FUNCTION__', - T_CLASS_C => '__CLASS__', - T_METHOD_C => '__METHOD__', - T_NS_C => '__NAMESPACE__', - CT::T_CLASS_CONSTANT => 'class', - T_TRAIT_C => '__TRAIT__', - ]; - } - - return $magicConstants; - } - - /** - * @return list - */ - private function getMagicConstantTokens(): array - { - static $magicConstantTokens = null; - - if (null === $magicConstantTokens) { - $magicConstantTokens = array_keys($this->getMagicConstants()); - } - - return $magicConstantTokens; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php deleted file mode 100644 index d8eaa3d0..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php +++ /dev/null @@ -1,202 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Casing; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class MagicMethodCasingFixer extends AbstractFixer -{ - /** - * @var array - */ - private const MAGIC_NAMES = [ - '__call' => '__call', - '__callstatic' => '__callStatic', - '__clone' => '__clone', - '__construct' => '__construct', - '__debuginfo' => '__debugInfo', - '__destruct' => '__destruct', - '__get' => '__get', - '__invoke' => '__invoke', - '__isset' => '__isset', - '__serialize' => '__serialize', - '__set' => '__set', - '__set_state' => '__set_state', - '__sleep' => '__sleep', - '__tostring' => '__toString', - '__unserialize' => '__unserialize', - '__unset' => '__unset', - '__wakeup' => '__wakeup', - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Magic method definitions and calls must be using the correct casing.', - [ - new CodeSample( - '__INVOKE(1); -' - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_STRING) && $tokens->isAnyTokenKindsFound([T_FUNCTION, T_DOUBLE_COLON, ...Token::getObjectOperatorKinds()]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $inClass = 0; - $tokenCount = \count($tokens); - - for ($index = 1; $index < $tokenCount - 2; ++$index) { - if (0 === $inClass && $tokens[$index]->isClassy()) { - $inClass = 1; - $index = $tokens->getNextTokenOfKind($index, ['{']); - - continue; - } - - if (0 !== $inClass) { - if ($tokens[$index]->equals('{')) { - ++$inClass; - - continue; - } - - if ($tokens[$index]->equals('}')) { - --$inClass; - - continue; - } - } - - if (!$tokens[$index]->isGivenKind(T_STRING)) { - continue; // wrong type - } - - $content = $tokens[$index]->getContent(); - - if (!str_starts_with($content, '__')) { - continue; // cheap look ahead - } - - $name = strtolower($content); - - if (!$this->isMagicMethodName($name)) { - continue; // method name is not one of the magic ones we can fix - } - - $nameInCorrectCasing = $this->getMagicMethodNameInCorrectCasing($name); - if ($nameInCorrectCasing === $content) { - continue; // method name is already in the correct casing, no fix needed - } - - if ($this->isFunctionSignature($tokens, $index)) { - if (0 !== $inClass) { - // this is a method definition we want to fix - $this->setTokenToCorrectCasing($tokens, $index, $nameInCorrectCasing); - } - - continue; - } - - if ($this->isMethodCall($tokens, $index)) { - $this->setTokenToCorrectCasing($tokens, $index, $nameInCorrectCasing); - - continue; - } - - if ( - ('__callstatic' === $name || '__set_state' === $name) - && $this->isStaticMethodCall($tokens, $index) - ) { - $this->setTokenToCorrectCasing($tokens, $index, $nameInCorrectCasing); - } - } - } - - private function isFunctionSignature(Tokens $tokens, int $index): bool - { - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$prevIndex]->isGivenKind(T_FUNCTION)) { - return false; // not a method signature - } - - return $tokens[$tokens->getNextMeaningfulToken($index)]->equals('('); - } - - private function isMethodCall(Tokens $tokens, int $index): bool - { - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$prevIndex]->isObjectOperator()) { - return false; // not a "simple" method call - } - - return $tokens[$tokens->getNextMeaningfulToken($index)]->equals('('); - } - - private function isStaticMethodCall(Tokens $tokens, int $index): bool - { - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$prevIndex]->isGivenKind(T_DOUBLE_COLON)) { - return false; // not a "simple" static method call - } - - return $tokens[$tokens->getNextMeaningfulToken($index)]->equals('('); - } - - /** - * @phpstan-assert-if-true key-of $name - */ - private function isMagicMethodName(string $name): bool - { - return isset(self::MAGIC_NAMES[$name]); - } - - /** - * @param key-of $name name of a magic method - * - * @return value-of - */ - private function getMagicMethodNameInCorrectCasing(string $name): string - { - return self::MAGIC_NAMES[$name]; - } - - private function setTokenToCorrectCasing(Tokens $tokens, int $index, string $nameInCorrectCasing): void - { - $tokens[$index] = new Token([T_STRING, $nameInCorrectCasing]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionCasingFixer.php deleted file mode 100644 index 84c7c643..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionCasingFixer.php +++ /dev/null @@ -1,89 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Casing; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class NativeFunctionCasingFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Function defined by PHP should be called using the correct casing.', - [new CodeSample("isTokenKindFound(T_STRING); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - static $nativeFunctionNames = null; - - if (null === $nativeFunctionNames) { - $nativeFunctionNames = $this->getNativeFunctionNames(); - } - - for ($index = 0, $count = $tokens->count(); $index < $count; ++$index) { - // test if we are at a function all - if (!$functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { - continue; - } - - // test if the function call is to a native PHP function - $lower = strtolower($tokens[$index]->getContent()); - if (!\array_key_exists($lower, $nativeFunctionNames)) { - continue; - } - - $tokens[$index] = new Token([T_STRING, $nativeFunctionNames[$lower]]); - } - } - - /** - * @return array - */ - private function getNativeFunctionNames(): array - { - $allFunctions = get_defined_functions(); - $functions = []; - foreach ($allFunctions['internal'] as $function) { - $functions[strtolower($function)] = $function; - } - - return $functions; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixer.php deleted file mode 100644 index 2b2d5094..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixer.php +++ /dev/null @@ -1,58 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Casing; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @deprecated in favor of NativeTypeDeclarationCasingFixer - */ -final class NativeFunctionTypeDeclarationCasingFixer extends AbstractProxyFixer implements DeprecatedFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Native type declarations for functions should use the correct case.', - [ - new CodeSample("proxyFixers); - } - - protected function createProxyFixers(): array - { - $fixer = new NativeTypeDeclarationCasingFixer(); - - return [$fixer]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php deleted file mode 100644 index e46f10df..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php +++ /dev/null @@ -1,360 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Casing; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -final class NativeTypeDeclarationCasingFixer extends AbstractFixer -{ - /* - * https://wiki.php.net/rfc/typed_class_constants - * Supported types - * Class constant type declarations support all type declarations supported by PHP, - * except `void`, `callable`, `never`. - * - * array - * bool - * callable - * float - * int - * iterable - * object - * mixed - * parent - * self - * string - * any class or interface name -> not native, so not applicable for this Fixer - * ?type -> not native, `?` has no casing, so not applicable for this Fixer - * - * Not in the list referenced but supported: - * null - * static - */ - private const CLASS_CONST_SUPPORTED_HINTS = [ - 'array' => true, - 'bool' => true, - 'float' => true, - 'int' => true, - 'iterable' => true, - 'mixed' => true, - 'null' => true, - 'object' => true, - 'parent' => true, - 'self' => true, - 'string' => true, - 'static' => true, - ]; - - private const CLASS_PROPERTY_SUPPORTED_HINTS = [ - 'array' => true, - 'bool' => true, - 'float' => true, - 'int' => true, - 'iterable' => true, - 'mixed' => true, - 'null' => true, - 'object' => true, - 'parent' => true, - 'self' => true, - 'static' => true, - 'string' => true, - ]; - - private const TYPE_SEPARATION_TYPES = [ - CT::T_TYPE_ALTERNATION, - CT::T_TYPE_INTERSECTION, - CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, - CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, - ]; - - /** - * https://secure.php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration. - * - * self PHP 5.0 - * array PHP 5.1 - * callable PHP 5.4 - * bool PHP 7.0 - * float PHP 7.0 - * int PHP 7.0 - * string PHP 7.0 - * iterable PHP 7.1 - * void PHP 7.1 - * object PHP 7.2 - * static PHP 8.0 (return type only) - * mixed PHP 8.0 - * false PHP 8.0 (union return type only) - * null PHP 8.0 (union return type only) - * never PHP 8.1 (return type only) - * true PHP 8.2 (standalone type: https://wiki.php.net/rfc/true-type) - * false PHP 8.2 (standalone type: https://wiki.php.net/rfc/null-false-standalone-types) - * null PHP 8.2 (standalone type: https://wiki.php.net/rfc/null-false-standalone-types) - * - * @var array - */ - private array $functionTypeHints; - - private FunctionsAnalyzer $functionsAnalyzer; - - /** - * @var list - */ - private array $beforePropertyTypeTokens; - - public function __construct() - { - parent::__construct(); - - $this->beforePropertyTypeTokens = ['{', ';', [T_PRIVATE], [T_PROTECTED], [T_PUBLIC], [T_VAR]]; - - $this->functionTypeHints = [ - 'array' => true, - 'bool' => true, - 'callable' => true, - 'float' => true, - 'int' => true, - 'iterable' => true, - 'object' => true, - 'self' => true, - 'string' => true, - 'void' => true, - ]; - - if (\PHP_VERSION_ID >= 8_00_00) { - $this->functionTypeHints['false'] = true; - $this->functionTypeHints['mixed'] = true; - $this->functionTypeHints['null'] = true; - $this->functionTypeHints['static'] = true; - } - - if (\PHP_VERSION_ID >= 8_01_00) { - $this->functionTypeHints['never'] = true; - - $this->beforePropertyTypeTokens[] = [T_READONLY]; - } - - if (\PHP_VERSION_ID >= 8_02_00) { - $this->functionTypeHints['true'] = true; - } - - $this->functionsAnalyzer = new FunctionsAnalyzer(); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Native type declarations should be used in the correct case.', - [ - new CodeSample( - "isAnyTokenKindsFound(Token::getClassyTokenKinds()); - - return - $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]) - || ($classyFound && $tokens->isTokenKindFound(T_STRING)) - || ( - \PHP_VERSION_ID >= 8_03_00 - && $tokens->isTokenKindFound(T_CONST) - && $classyFound - ); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->fixFunctions($tokens); - $this->fixClassConstantsAndProperties($tokens); - } - - private function fixFunctions(Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if ($tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) { - $this->fixFunctionReturnType($tokens, $index); - $this->fixFunctionArgumentTypes($tokens, $index); - } - } - } - - private function fixFunctionArgumentTypes(Tokens $tokens, int $index): void - { - foreach ($this->functionsAnalyzer->getFunctionArguments($tokens, $index) as $argument) { - $this->fixArgumentType($tokens, $argument->getTypeAnalysis()); - } - } - - private function fixFunctionReturnType(Tokens $tokens, int $index): void - { - $this->fixArgumentType($tokens, $this->functionsAnalyzer->getFunctionReturnType($tokens, $index)); - } - - private function fixArgumentType(Tokens $tokens, ?TypeAnalysis $type = null): void - { - if (null === $type) { - return; - } - - for ($index = $type->getStartIndex(); $index <= $type->getEndIndex(); ++$index) { - if ($tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(T_NS_SEPARATOR)) { - continue; - } - - $this->fixCasing($this->functionTypeHints, $tokens, $index); - } - } - - private function fixClassConstantsAndProperties(Tokens $tokens): void - { - $analyzer = new TokensAnalyzer($tokens); - $elements = array_reverse($analyzer->getClassyElements(), true); - - foreach ($elements as $index => $element) { - if ('const' === $element['type']) { - if (\PHP_VERSION_ID >= 8_03_00 && !$this->isConstWithoutType($tokens, $index)) { - foreach ($this->getNativeTypeHintCandidatesForConstant($tokens, $index) as $nativeTypeHintIndex) { - $this->fixCasing($this::CLASS_CONST_SUPPORTED_HINTS, $tokens, $nativeTypeHintIndex); - } - } - - continue; - } - - if ('property' === $element['type']) { - foreach ($this->getNativeTypeHintCandidatesForProperty($tokens, $index) as $nativeTypeHintIndex) { - $this->fixCasing($this::CLASS_PROPERTY_SUPPORTED_HINTS, $tokens, $nativeTypeHintIndex); - } - } - } - } - - /** @return iterable */ - private function getNativeTypeHintCandidatesForConstant(Tokens $tokens, int $index): iterable - { - $constNameIndex = $this->getConstNameIndex($tokens, $index); - $index = $this->getFirstIndexOfType($tokens, $index); - - do { - $typeEnd = $this->getTypeEnd($tokens, $index, $constNameIndex); - - if ($typeEnd === $index) { - yield $index; - } - - do { - $index = $tokens->getNextMeaningfulToken($index); - } while ($tokens[$index]->isGivenKind(self::TYPE_SEPARATION_TYPES)); - } while ($index < $constNameIndex); - } - - private function isConstWithoutType(Tokens $tokens, int $index): bool - { - $index = $tokens->getNextMeaningfulToken($index); - - return $tokens[$index]->isGivenKind(T_STRING) && $tokens[$tokens->getNextMeaningfulToken($index)]->equals('='); - } - - private function getConstNameIndex(Tokens $tokens, int $index): int - { - return $tokens->getPrevMeaningfulToken( - $tokens->getNextTokenOfKind($index, ['=']), - ); - } - - /** @return iterable */ - private function getNativeTypeHintCandidatesForProperty(Tokens $tokens, int $index): iterable - { - $propertyNameIndex = $index; - $index = $tokens->getPrevTokenOfKind($index, $this->beforePropertyTypeTokens); - - $index = $this->getFirstIndexOfType($tokens, $index); - - do { - $typeEnd = $this->getTypeEnd($tokens, $index, $propertyNameIndex); - - if ($typeEnd === $index) { - yield $index; - } - - do { - $index = $tokens->getNextMeaningfulToken($index); - } while ($tokens[$index]->isGivenKind(self::TYPE_SEPARATION_TYPES)); - } while ($index < $propertyNameIndex); - - return []; - } - - private function getFirstIndexOfType(Tokens $tokens, int $index): int - { - $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->isGivenKind(CT::T_NULLABLE_TYPE)) { - $index = $tokens->getNextMeaningfulToken($index); - } - - if ($tokens[$index]->isGivenKind(CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN)) { - $index = $tokens->getNextMeaningfulToken($index); - } - - return $index; - } - - private function getTypeEnd(Tokens $tokens, int $index, int $upperLimit): int - { - if (!$tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR])) { - return $index; // callable, array, self, static, etc. - } - - $endIndex = $index; - while ($tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR]) && $index < $upperLimit) { - $endIndex = $index; - $index = $tokens->getNextMeaningfulToken($index); - } - - return $endIndex; - } - - /** - * @param array $supportedTypeHints - */ - private function fixCasing(array $supportedTypeHints, Tokens $tokens, int $index): void - { - $typeContent = $tokens[$index]->getContent(); - $typeContentLower = strtolower($typeContent); - - if (isset($supportedTypeHints[$typeContentLower]) && $typeContent !== $typeContentLower) { - $tokens[$index] = new Token([$tokens[$index]->getId(), $typeContentLower]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/CastSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/CastSpacesFixer.php deleted file mode 100644 index 11ee3732..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/CastSpacesFixer.php +++ /dev/null @@ -1,131 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\CastNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * space?: 'none'|'single' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * space: 'none'|'single' - * } - */ -final class CastSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const INSIDE_CAST_SPACE_REPLACE_MAP = [ - ' ' => '', - "\t" => '', - "\n" => '', - "\r" => '', - "\0" => '', - "\x0B" => '', - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'A single space or none should be between cast and variable.', - [ - new CodeSample( - " 'single'] - ), - new CodeSample( - " 'none'] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after NoShortBoolCastFixer. - */ - public function getPriority(): int - { - return -10; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(Token::getCastTokenKinds()); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isCast()) { - continue; - } - - $tokens[$index] = new Token([ - $token->getId(), - strtr($token->getContent(), self::INSIDE_CAST_SPACE_REPLACE_MAP), - ]); - - if ('single' === $this->configuration['space']) { - // force single whitespace after cast token: - if ($tokens[$index + 1]->isWhitespace(" \t")) { - // - if next token is whitespaces that contains only spaces and tabs - override next token with single space - $tokens[$index + 1] = new Token([T_WHITESPACE, ' ']); - } elseif (!$tokens[$index + 1]->isWhitespace()) { - // - if next token is not whitespaces that contains spaces, tabs and new lines - append single space to current token - $tokens->insertAt($index + 1, new Token([T_WHITESPACE, ' '])); - } - - continue; - } - - // force no whitespace after cast token: - if ($tokens[$index + 1]->isWhitespace()) { - $tokens->clearAt($index + 1); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('space', 'Spacing to apply between cast and variable.')) - ->setAllowedValues(['none', 'single']) - ->setDefault('single') - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/LowercaseCastFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/LowercaseCastFixer.php deleted file mode 100644 index e50db282..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/LowercaseCastFixer.php +++ /dev/null @@ -1,66 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\CastNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class LowercaseCastFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Cast should be written in lower case.', - [ - new CodeSample( - 'isAnyTokenKindsFound(Token::getCastTokenKinds()); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = 0, $count = $tokens->count(); $index < $count; ++$index) { - if (!$tokens[$index]->isCast()) { - continue; - } - - $tokens[$index] = new Token([$tokens[$index]->getId(), strtolower($tokens[$index]->getContent())]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ModernizeTypesCastingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ModernizeTypesCastingFixer.php deleted file mode 100644 index 75f2a437..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ModernizeTypesCastingFixer.php +++ /dev/null @@ -1,164 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\CastNotation; - -use PhpCsFixer\AbstractFunctionReferenceFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Vladimir Reznichenko - */ -final class ModernizeTypesCastingFixer extends AbstractFunctionReferenceFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replaces `intval`, `floatval`, `doubleval`, `strval` and `boolval` function calls with according type casting operator.', - [ - new CodeSample( - ' [T_INT_CAST, '(int)'], - 'floatval' => [T_DOUBLE_CAST, '(float)'], - 'doubleval' => [T_DOUBLE_CAST, '(float)'], - 'strval' => [T_STRING_CAST, '(string)'], - 'boolval' => [T_BOOL_CAST, '(bool)'], - ]; - - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - foreach ($replacement as $functionIdentity => $newToken) { - $currIndex = 0; - - do { - // try getting function reference and translate boundaries for humans - $boundaries = $this->find($functionIdentity, $tokens, $currIndex, $tokens->count() - 1); - - if (null === $boundaries) { - // next function search, as current one not found - continue 2; - } - - [$functionName, $openParenthesis, $closeParenthesis] = $boundaries; - - // analysing cursor shift - $currIndex = $openParenthesis; - - // indicator that the function is overridden - if (1 !== $argumentsAnalyzer->countArguments($tokens, $openParenthesis, $closeParenthesis)) { - continue; - } - - $paramContentEnd = $closeParenthesis; - $commaCandidate = $tokens->getPrevMeaningfulToken($paramContentEnd); - - if ($tokens[$commaCandidate]->equals(',')) { - $tokens->removeTrailingWhitespace($commaCandidate); - $tokens->clearAt($commaCandidate); - $paramContentEnd = $commaCandidate; - } - - // check if something complex passed as an argument and preserve parentheses then - $countParamTokens = 0; - - for ($paramContentIndex = $openParenthesis + 1; $paramContentIndex < $paramContentEnd; ++$paramContentIndex) { - // not a space, means some sensible token - if (!$tokens[$paramContentIndex]->isGivenKind(T_WHITESPACE)) { - ++$countParamTokens; - } - } - - $preserveParentheses = $countParamTokens > 1; - - $afterCloseParenthesisIndex = $tokens->getNextMeaningfulToken($closeParenthesis); - $afterCloseParenthesisToken = $tokens[$afterCloseParenthesisIndex]; - $wrapInParentheses = $afterCloseParenthesisToken->equalsAny(['[', '{']) || $afterCloseParenthesisToken->isGivenKind(T_POW); - - // analyse namespace specification (root one or none) and decide what to do - $prevTokenIndex = $tokens->getPrevMeaningfulToken($functionName); - - if ($tokens[$prevTokenIndex]->isGivenKind(T_NS_SEPARATOR)) { - // get rid of root namespace when it used - $tokens->removeTrailingWhitespace($prevTokenIndex); - $tokens->clearAt($prevTokenIndex); - } - - // perform transformation - $replacementSequence = [ - new Token($newToken), - new Token([T_WHITESPACE, ' ']), - ]; - - if ($wrapInParentheses) { - array_unshift($replacementSequence, new Token('(')); - } - - if (!$preserveParentheses) { - // closing parenthesis removed with leading spaces - $tokens->removeLeadingWhitespace($closeParenthesis); - $tokens->clearAt($closeParenthesis); - - // opening parenthesis removed with trailing spaces - $tokens->removeLeadingWhitespace($openParenthesis); - $tokens->removeTrailingWhitespace($openParenthesis); - $tokens->clearAt($openParenthesis); - } else { - // we'll need to provide a space after a casting operator - $tokens->removeTrailingWhitespace($functionName); - } - - if ($wrapInParentheses) { - $tokens->insertAt($closeParenthesis, new Token(')')); - } - - $tokens->overrideRange($functionName, $functionName, $replacementSequence); - - // nested transformations support - $currIndex = $functionName; - } while (null !== $currIndex); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoShortBoolCastFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoShortBoolCastFixer.php deleted file mode 100644 index 80439c17..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoShortBoolCastFixer.php +++ /dev/null @@ -1,88 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\CastNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoShortBoolCastFixer extends AbstractFixer -{ - /** - * {@inheritdoc} - * - * Must run before CastSpacesFixer. - */ - public function getPriority(): int - { - return -9; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Short cast `bool` using double exclamation mark should not be used.', - [new CodeSample("isTokenKindFound('!'); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 1; $index > 1; --$index) { - if ($tokens[$index]->equals('!')) { - $index = $this->fixShortCast($tokens, $index); - } - } - } - - private function fixShortCast(Tokens $tokens, int $index): int - { - for ($i = $index - 1; $i > 1; --$i) { - if ($tokens[$i]->equals('!')) { - $this->fixShortCastToBoolCast($tokens, $i, $index); - - break; - } - - if (!$tokens[$i]->isComment() && !$tokens[$i]->isWhitespace()) { - break; - } - } - - return $i; - } - - private function fixShortCastToBoolCast(Tokens $tokens, int $start, int $end): void - { - for (; $start <= $end; ++$start) { - if ( - !$tokens[$start]->isComment() - && !($tokens[$start]->isWhitespace() && $tokens[$start - 1]->isComment()) - ) { - $tokens->clearAt($start); - } - } - - $tokens->insertAt($start, new Token([T_BOOL_CAST, '(bool)'])); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoUnsetCastFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoUnsetCastFixer.php deleted file mode 100644 index 81c1567f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/NoUnsetCastFixer.php +++ /dev/null @@ -1,88 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\CastNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoUnsetCastFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Variables must be set `null` instead of using `(unset)` casting.', - [new CodeSample("isTokenKindFound(T_UNSET_CAST); - } - - /** - * {@inheritdoc} - * - * Must run before BinaryOperatorSpacesFixer. - */ - public function getPriority(): int - { - return 0; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 1; $index > 0; --$index) { - if ($tokens[$index]->isGivenKind(T_UNSET_CAST)) { - $this->fixUnsetCast($tokens, $index); - } - } - } - - private function fixUnsetCast(Tokens $tokens, int $index): void - { - $assignmentIndex = $tokens->getPrevMeaningfulToken($index); - if (null === $assignmentIndex || !$tokens[$assignmentIndex]->equals('=')) { - return; - } - - $varIndex = $tokens->getNextMeaningfulToken($index); - if (null === $varIndex || !$tokens[$varIndex]->isGivenKind(T_VARIABLE)) { - return; - } - - $afterVar = $tokens->getNextMeaningfulToken($varIndex); - if (null === $afterVar || !$tokens[$afterVar]->equalsAny([';', [T_CLOSE_TAG]])) { - return; - } - - $nextIsWhiteSpace = $tokens[$assignmentIndex + 1]->isWhitespace(); - - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - $tokens->clearTokenAndMergeSurroundingWhitespace($varIndex); - - ++$assignmentIndex; - if (!$nextIsWhiteSpace) { - $tokens->insertAt($assignmentIndex, new Token([T_WHITESPACE, ' '])); - } - - ++$assignmentIndex; - $tokens->insertAt($assignmentIndex, new Token([T_STRING, 'null'])); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ShortScalarCastFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ShortScalarCastFixer.php deleted file mode 100644 index 934d8a89..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/CastNotation/ShortScalarCastFixer.php +++ /dev/null @@ -1,71 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\CastNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class ShortScalarCastFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Cast `(boolean)` and `(integer)` should be written as `(bool)` and `(int)`, `(double)` and `(real)` as `(float)`, `(binary)` as `(string)`.', - [ - new CodeSample( - "isAnyTokenKindsFound(Token::getCastTokenKinds()); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - static $castMap = [ - 'boolean' => 'bool', - 'integer' => 'int', - 'double' => 'float', - 'real' => 'float', - 'binary' => 'string', - ]; - - for ($index = 0, $count = $tokens->count(); $index < $count; ++$index) { - if (!$tokens[$index]->isCast()) { - continue; - } - - $castFrom = trim(substr($tokens[$index]->getContent(), 1, -1)); - $castFromLowered = strtolower($castFrom); - - if (!\array_key_exists($castFromLowered, $castMap)) { - continue; - } - - $tokens[$index] = new Token([ - $tokens[$index]->getId(), - str_replace($castFrom, $castMap[$castFromLowered], $tokens[$index]->getContent()), - ]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php deleted file mode 100644 index c72398d1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php +++ /dev/null @@ -1,599 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; -use PhpCsFixer\Utils; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * Make sure there is one blank line above and below class elements. - * - * The exception is when an element is the first or last item in a 'classy'. - * - * @phpstan-type _Class array{ - * index: int, - * open: int, - * close: int, - * elements: non-empty-list<_Element> - * } - * @phpstan-type _Element array{token: Token, type: string, index: int, start?: int, end?: int} - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * elements?: array - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * elements: array - * } - */ -final class ClassAttributesSeparationFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const SPACING_NONE = 'none'; - - /** - * @internal - */ - public const SPACING_ONE = 'one'; - - private const SPACING_ONLY_IF_META = 'only_if_meta'; - - /** - * @var array - */ - private array $classElementTypes = []; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Class, trait and interface elements must be separated with one or none blank line.', - [ - new CodeSample( - ' ['property' => self::SPACING_ONE]] - ), - new CodeSample( - ' ['const' => self::SPACING_ONE]] - ), - new CodeSample( - ' ['const' => self::SPACING_ONLY_IF_META]] - ), - new VersionSpecificCodeSample( - ' ['property' => self::SPACING_ONLY_IF_META]] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before BracesFixer, IndentationTypeFixer, NoExtraBlankLinesFixer, StatementIndentationFixer. - * Must run after OrderedClassElementsFixer, SingleClassElementPerStatementFixer, VisibilityRequiredFixer. - */ - public function getPriority(): int - { - return 55; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); - } - - protected function configurePostNormalisation(): void - { - $this->classElementTypes = []; // reset previous configuration - - foreach ($this->configuration['elements'] as $elementType => $spacing) { - $this->classElementTypes[$elementType] = $spacing; - } - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($this->getElementsByClass($tokens) as $class) { - $elements = $class['elements']; - $elementCount = \count($elements); - - if (0 === $elementCount) { - continue; - } - - if (isset($this->classElementTypes[$elements[0]['type']])) { - $this->fixSpaceBelowClassElement($tokens, $class); - $this->fixSpaceAboveClassElement($tokens, $class, 0); - } - - for ($index = 1; $index < $elementCount; ++$index) { - if (isset($this->classElementTypes[$elements[$index]['type']])) { - $this->fixSpaceAboveClassElement($tokens, $class, $index); - } - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('elements', 'Dictionary of `const|method|property|trait_import|case` => `none|one|only_if_meta` values.')) - ->setAllowedTypes(['array']) - ->setAllowedValues([static function (array $option): bool { - foreach ($option as $type => $spacing) { - $supportedTypes = ['const', 'method', 'property', 'trait_import', 'case']; - - if (!\in_array($type, $supportedTypes, true)) { - throw new InvalidOptionsException( - \sprintf( - 'Unexpected element type, expected any of %s, got "%s".', - Utils::naturalLanguageJoin($supportedTypes), - \gettype($type).'#'.$type - ) - ); - } - - $supportedSpacings = [self::SPACING_NONE, self::SPACING_ONE, self::SPACING_ONLY_IF_META]; - - if (!\in_array($spacing, $supportedSpacings, true)) { - throw new InvalidOptionsException( - \sprintf( - 'Unexpected spacing for element type "%s", expected any of %s, got "%s".', - $spacing, - Utils::naturalLanguageJoin($supportedSpacings), - \is_object($spacing) ? \get_class($spacing) : (null === $spacing ? 'null' : \gettype($spacing).'#'.$spacing) - ) - ); - } - } - - return true; - }]) - ->setDefault([ - 'const' => self::SPACING_ONE, - 'method' => self::SPACING_ONE, - 'property' => self::SPACING_ONE, - 'trait_import' => self::SPACING_NONE, - 'case' => self::SPACING_NONE, - ]) - ->getOption(), - ]); - } - - /** - * Fix spacing above an element of a class, interface or trait. - * - * Deals with comments, PHPDocs and spaces above the element with respect to the position of the - * element within the class, interface or trait. - * - * @param _Class $class - */ - private function fixSpaceAboveClassElement(Tokens $tokens, array $class, int $elementIndex): void - { - $element = $class['elements'][$elementIndex]; - $elementAboveEnd = isset($class['elements'][$elementIndex + 1]) ? $class['elements'][$elementIndex + 1]['end'] : 0; - $nonWhiteAbove = $tokens->getPrevNonWhitespace($element['start']); - - // element is directly after class open brace - if ($nonWhiteAbove === $class['open']) { - $this->correctLineBreaks($tokens, $nonWhiteAbove, $element['start'], 1); - - return; - } - - // deal with comments above an element - if ($tokens[$nonWhiteAbove]->isGivenKind(T_COMMENT)) { - // check if the comment belongs to the previous element - if ($elementAboveEnd === $nonWhiteAbove) { - $this->correctLineBreaks($tokens, $nonWhiteAbove, $element['start'], $this->determineRequiredLineCount($tokens, $class, $elementIndex)); - - return; - } - - // more than one line break, always bring it back to 2 line breaks between the element start and what is above it - if ($tokens[$nonWhiteAbove + 1]->isWhitespace() && substr_count($tokens[$nonWhiteAbove + 1]->getContent(), "\n") > 1) { - $this->correctLineBreaks($tokens, $nonWhiteAbove, $element['start'], 2); - - return; - } - - // there are 2 cases: - if ( - 1 === $element['start'] - $nonWhiteAbove - || $tokens[$nonWhiteAbove - 1]->isWhitespace() && substr_count($tokens[$nonWhiteAbove - 1]->getContent(), "\n") > 0 - || $tokens[$nonWhiteAbove + 1]->isWhitespace() && substr_count($tokens[$nonWhiteAbove + 1]->getContent(), "\n") > 0 - ) { - // 1. The comment is meant for the element (although not a PHPDoc), - // make sure there is one line break between the element and the comment... - $this->correctLineBreaks($tokens, $nonWhiteAbove, $element['start'], 1); - // ... and make sure there is blank line above the comment (with the exception when it is directly after a class opening) - $nonWhiteAbove = $this->findCommentBlockStart($tokens, $nonWhiteAbove, $elementAboveEnd); - $nonWhiteAboveComment = $tokens->getPrevNonWhitespace($nonWhiteAbove); - - $this->correctLineBreaks($tokens, $nonWhiteAboveComment, $nonWhiteAbove, $nonWhiteAboveComment === $class['open'] ? 1 : 2); - } else { - // 2. The comment belongs to the code above the element, - // make sure there is a blank line above the element (i.e. 2 line breaks) - $this->correctLineBreaks($tokens, $nonWhiteAbove, $element['start'], 2); - } - - return; - } - - // deal with element with a PHPDoc/attribute above it - if ($tokens[$nonWhiteAbove]->isGivenKind([T_DOC_COMMENT, CT::T_ATTRIBUTE_CLOSE])) { - // there should be one linebreak between the element and the attribute above it - $this->correctLineBreaks($tokens, $nonWhiteAbove, $element['start'], 1); - - // make sure there is blank line above the comment (with the exception when it is directly after a class opening) - $nonWhiteAbove = $this->findCommentBlockStart($tokens, $nonWhiteAbove, $elementAboveEnd); - $nonWhiteAboveComment = $tokens->getPrevNonWhitespace($nonWhiteAbove); - - $this->correctLineBreaks($tokens, $nonWhiteAboveComment, $nonWhiteAbove, $nonWhiteAboveComment === $class['open'] ? 1 : 2); - - return; - } - - $this->correctLineBreaks($tokens, $nonWhiteAbove, $element['start'], $this->determineRequiredLineCount($tokens, $class, $elementIndex)); - } - - /** - * @param _Class $class - */ - private function determineRequiredLineCount(Tokens $tokens, array $class, int $elementIndex): int - { - $type = $class['elements'][$elementIndex]['type']; - $spacing = $this->classElementTypes[$type]; - - if (self::SPACING_ONE === $spacing) { - return 2; - } - - if (self::SPACING_NONE === $spacing) { - if (!isset($class['elements'][$elementIndex + 1])) { - return 1; - } - - $aboveElement = $class['elements'][$elementIndex + 1]; - - if ($aboveElement['type'] !== $type) { - return 2; - } - - $aboveElementDocCandidateIndex = $tokens->getPrevNonWhitespace($aboveElement['start']); - - return $tokens[$aboveElementDocCandidateIndex]->isGivenKind([T_DOC_COMMENT, CT::T_ATTRIBUTE_CLOSE]) ? 2 : 1; - } - - if (self::SPACING_ONLY_IF_META === $spacing) { - $aboveElementDocCandidateIndex = $tokens->getPrevNonWhitespace($class['elements'][$elementIndex]['start']); - - return $tokens[$aboveElementDocCandidateIndex]->isGivenKind([T_DOC_COMMENT, CT::T_ATTRIBUTE_CLOSE]) ? 2 : 1; - } - - throw new \RuntimeException(\sprintf('Unknown spacing "%s".', $spacing)); - } - - /** - * @param _Class $class - */ - private function fixSpaceBelowClassElement(Tokens $tokens, array $class): void - { - $element = $class['elements'][0]; - - // if this is last element fix; fix to the class end `}` here if appropriate - if ($class['close'] === $tokens->getNextNonWhitespace($element['end'])) { - $this->correctLineBreaks($tokens, $element['end'], $class['close'], 1); - } - } - - private function correctLineBreaks(Tokens $tokens, int $startIndex, int $endIndex, int $reqLineCount): void - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - - ++$startIndex; - $numbOfWhiteTokens = $endIndex - $startIndex; - - if (0 === $numbOfWhiteTokens) { - $tokens->insertAt($startIndex, new Token([T_WHITESPACE, str_repeat($lineEnding, $reqLineCount)])); - - return; - } - - $lineBreakCount = $this->getLineBreakCount($tokens, $startIndex, $endIndex); - - if ($reqLineCount === $lineBreakCount) { - return; - } - - if ($lineBreakCount < $reqLineCount) { - $tokens[$startIndex] = new Token([ - T_WHITESPACE, - str_repeat($lineEnding, $reqLineCount - $lineBreakCount).$tokens[$startIndex]->getContent(), - ]); - - return; - } - - // $lineCount = > $reqLineCount : check the one Token case first since this one will be true most of the time - if (1 === $numbOfWhiteTokens) { - $tokens[$startIndex] = new Token([ - T_WHITESPACE, - Preg::replace('/\r\n|\n/', '', $tokens[$startIndex]->getContent(), $lineBreakCount - $reqLineCount), - ]); - - return; - } - - // $numbOfWhiteTokens = > 1 - $toReplaceCount = $lineBreakCount - $reqLineCount; - - for ($i = $startIndex; $i < $endIndex && $toReplaceCount > 0; ++$i) { - $tokenLineCount = substr_count($tokens[$i]->getContent(), "\n"); - - if ($tokenLineCount > 0) { - $tokens[$i] = new Token([ - T_WHITESPACE, - Preg::replace('/\r\n|\n/', '', $tokens[$i]->getContent(), min($toReplaceCount, $tokenLineCount)), - ]); - $toReplaceCount -= $tokenLineCount; - } - } - } - - private function getLineBreakCount(Tokens $tokens, int $startIndex, int $endIndex): int - { - $lineCount = 0; - - for ($i = $startIndex; $i < $endIndex; ++$i) { - $lineCount += substr_count($tokens[$i]->getContent(), "\n"); - } - - return $lineCount; - } - - private function findCommentBlockStart(Tokens $tokens, int $start, int $elementAboveEnd): int - { - for ($i = $start; $i > $elementAboveEnd; --$i) { - if ($tokens[$i]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - $start = $i = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $i); - - continue; - } - - if ($tokens[$i]->isComment()) { - $start = $i; - - continue; - } - - if (!$tokens[$i]->isWhitespace() || $this->getLineBreakCount($tokens, $i, $i + 1) > 1) { - break; - } - } - - return $start; - } - - /** - * @TODO Introduce proper DTO instead of an array - * - * @return \Generator<_Class> - */ - private function getElementsByClass(Tokens $tokens): \Generator - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - $class = $classIndex = false; - - foreach (array_reverse($tokensAnalyzer->getClassyElements(), true) as $index => $element) { - $element['index'] = $index; - - if ($element['classIndex'] !== $classIndex) { - if (false !== $class) { - yield $class; - } - - $classIndex = $element['classIndex']; - $classOpen = $tokens->getNextTokenOfKind($classIndex, ['{']); - $classEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $classOpen); - $class = [ - 'index' => $classIndex, - 'open' => $classOpen, - 'close' => $classEnd, - 'elements' => [], - ]; - } - - unset($element['classIndex']); - $element['start'] = $this->getFirstTokenIndexOfClassElement($tokens, $class, $element); - $element['end'] = $this->getLastTokenIndexOfClassElement($tokens, $class, $element, $tokensAnalyzer); - - $class['elements'][] = $element; // reset the key by design - } - - if (false !== $class) { - yield $class; - } - } - - /** - * including trailing single line comments if belonging to the class element. - * - * @param _Class $class - * @param _Element $element - */ - private function getFirstTokenIndexOfClassElement(Tokens $tokens, array $class, array $element): int - { - $modifierTypes = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_ABSTRACT, T_FINAL, T_STATIC, T_STRING, T_NS_SEPARATOR, T_VAR, CT::T_NULLABLE_TYPE, CT::T_ARRAY_TYPEHINT, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $modifierTypes[] = T_READONLY; - } - - $firstElementAttributeIndex = $element['index']; - - do { - $nonWhiteAbove = $tokens->getPrevMeaningfulToken($firstElementAttributeIndex); - - if (null !== $nonWhiteAbove && $tokens[$nonWhiteAbove]->isGivenKind($modifierTypes)) { - $firstElementAttributeIndex = $nonWhiteAbove; - } else { - break; - } - } while ($firstElementAttributeIndex > $class['open']); - - return $firstElementAttributeIndex; - } - - /** - * including trailing single line comments if belonging to the class element. - * - * @param _Class $class - * @param _Element $element - */ - private function getLastTokenIndexOfClassElement(Tokens $tokens, array $class, array $element, TokensAnalyzer $tokensAnalyzer): int - { - // find last token of the element - if ('method' === $element['type'] && !$tokens[$class['index']]->isGivenKind(T_INTERFACE)) { - $attributes = $tokensAnalyzer->getMethodAttributes($element['index']); - - if (true === $attributes['abstract']) { - $elementEndIndex = $tokens->getNextTokenOfKind($element['index'], [';']); - } else { - $elementEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $tokens->getNextTokenOfKind($element['index'], ['{'])); - } - } elseif ('trait_import' === $element['type']) { - $elementEndIndex = $element['index']; - - do { - $elementEndIndex = $tokens->getNextMeaningfulToken($elementEndIndex); - } while ($tokens[$elementEndIndex]->isGivenKind([T_STRING, T_NS_SEPARATOR]) || $tokens[$elementEndIndex]->equals(',')); - - if (!$tokens[$elementEndIndex]->equals(';')) { - $elementEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $tokens->getNextTokenOfKind($element['index'], ['{'])); - } - } else { // 'const', 'property', enum-'case', or 'method' of an interface - $elementEndIndex = $tokens->getNextTokenOfKind($element['index'], [';']); - } - - $singleLineElement = true; - - for ($i = $element['index'] + 1; $i < $elementEndIndex; ++$i) { - if (str_contains($tokens[$i]->getContent(), "\n")) { - $singleLineElement = false; - - break; - } - } - - if ($singleLineElement) { - while (true) { - $nextToken = $tokens[$elementEndIndex + 1]; - - if (($nextToken->isComment() || $nextToken->isWhitespace()) && !str_contains($nextToken->getContent(), "\n")) { - ++$elementEndIndex; - } else { - break; - } - } - - if ($tokens[$elementEndIndex]->isWhitespace()) { - $elementEndIndex = $tokens->getPrevNonWhitespace($elementEndIndex); - } - } - - return $elementEndIndex; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php deleted file mode 100644 index 8ff8b030..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php +++ /dev/null @@ -1,572 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * Fixer for part of the rules defined in PSR2 ¶4.1 Extends and Implements and PSR12 ¶8. Anonymous Classes. - * - * @phpstan-type _ClassExtendsInfo array{start: int, numberOfExtends: int, multiLine: bool} - * @phpstan-type _ClassImplementsInfo array{start: int, numberOfImplements: int, multiLine: bool} - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * inline_constructor_arguments?: bool, - * multi_line_extends_each_single_line?: bool, - * single_item_single_line?: bool, - * single_line?: bool, - * space_before_parenthesis?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * inline_constructor_arguments: bool, - * multi_line_extends_each_single_line: bool, - * single_item_single_line: bool, - * single_line: bool, - * space_before_parenthesis: bool - * } - */ -final class ClassDefinitionFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Whitespace around the keywords of a class, trait, enum or interfaces definition should be one space.', - [ - new CodeSample( - ' true] - ), - new CodeSample( - ' true] - ), - new CodeSample( - ' true] - ), - new CodeSample( - ' true] - ), - new CodeSample( - " true] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before BracesFixer, SingleLineEmptyBodyFixer. - * Must run after NewWithBracesFixer, NewWithParenthesesFixer. - */ - public function getPriority(): int - { - return 36; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - // -4, one for count to index, 3 because min. of tokens for a classy location. - for ($index = $tokens->getSize() - 4; $index > 0; --$index) { - if ($tokens[$index]->isClassy()) { - $this->fixClassyDefinition($tokens, $index); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('multi_line_extends_each_single_line', 'Whether definitions should be multiline.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('single_item_single_line', 'Whether definitions should be single line when including a single item.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('single_line', 'Whether definitions should be single line.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('space_before_parenthesis', 'Whether there should be a single space after the parenthesis of anonymous class (PSR12) or not.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('inline_constructor_arguments', 'Whether constructor argument list in anonymous classes should be single line.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - /** - * @param int $classyIndex Class definition token start index - */ - private function fixClassyDefinition(Tokens $tokens, int $classyIndex): void - { - $classDefInfo = $this->getClassyDefinitionInfo($tokens, $classyIndex); - - // PSR2 4.1 Lists of implements MAY be split across multiple lines, where each subsequent line is indented once. - // When doing so, the first item in the list MUST be on the next line, and there MUST be only one interface per line. - - if (false !== $classDefInfo['implements']) { - $classDefInfo['implements'] = $this->fixClassyDefinitionImplements( - $tokens, - $classDefInfo['open'], - $classDefInfo['implements'] - ); - } - - if (false !== $classDefInfo['extends']) { - $classDefInfo['extends'] = $this->fixClassyDefinitionExtends( - $tokens, - false === $classDefInfo['implements'] ? $classDefInfo['open'] : $classDefInfo['implements']['start'], - $classDefInfo['extends'] - ); - } - - // PSR2: class definition open curly brace must go on a new line. - // PSR12: anonymous class curly brace on same line if not multi line implements. - - $classDefInfo['open'] = $this->fixClassyDefinitionOpenSpacing($tokens, $classDefInfo); - - if ($classDefInfo['implements']) { - $end = $classDefInfo['implements']['start']; - } elseif ($classDefInfo['extends']) { - $end = $classDefInfo['extends']['start']; - } else { - $end = $tokens->getPrevNonWhitespace($classDefInfo['open']); - } - - if ($classDefInfo['anonymousClass'] && false === $this->configuration['inline_constructor_arguments']) { - if (!$tokens[$end]->equals(')')) { // anonymous class with `extends` and/or `implements` - $start = $tokens->getPrevMeaningfulToken($end); - $this->makeClassyDefinitionSingleLine($tokens, $start, $end); - $end = $start; - } - - if ($tokens[$end]->equals(')')) { // skip constructor arguments of anonymous class - $end = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $end); - } - } - - // 4.1 The extends and implements keywords MUST be declared on the same line as the class name. - $this->makeClassyDefinitionSingleLine($tokens, $classDefInfo['start'], $end); - - $this->sortClassModifiers($tokens, $classDefInfo); - } - - /** - * @param _ClassExtendsInfo $classExtendsInfo - * - * @return _ClassExtendsInfo - */ - private function fixClassyDefinitionExtends(Tokens $tokens, int $classOpenIndex, array $classExtendsInfo): array - { - $endIndex = $tokens->getPrevNonWhitespace($classOpenIndex); - - if (true === $this->configuration['single_line'] || false === $classExtendsInfo['multiLine']) { - $this->makeClassyDefinitionSingleLine($tokens, $classExtendsInfo['start'], $endIndex); - $classExtendsInfo['multiLine'] = false; - } elseif (true === $this->configuration['single_item_single_line'] && 1 === $classExtendsInfo['numberOfExtends']) { - $this->makeClassyDefinitionSingleLine($tokens, $classExtendsInfo['start'], $endIndex); - $classExtendsInfo['multiLine'] = false; - } elseif (true === $this->configuration['multi_line_extends_each_single_line'] && $classExtendsInfo['multiLine']) { - $this->makeClassyInheritancePartMultiLine($tokens, $classExtendsInfo['start'], $endIndex); - $classExtendsInfo['multiLine'] = true; - } - - return $classExtendsInfo; - } - - /** - * @param _ClassImplementsInfo $classImplementsInfo - * - * @return _ClassImplementsInfo - */ - private function fixClassyDefinitionImplements(Tokens $tokens, int $classOpenIndex, array $classImplementsInfo): array - { - $endIndex = $tokens->getPrevNonWhitespace($classOpenIndex); - - if (true === $this->configuration['single_line'] || false === $classImplementsInfo['multiLine']) { - $this->makeClassyDefinitionSingleLine($tokens, $classImplementsInfo['start'], $endIndex); - $classImplementsInfo['multiLine'] = false; - } elseif (true === $this->configuration['single_item_single_line'] && 1 === $classImplementsInfo['numberOfImplements']) { - $this->makeClassyDefinitionSingleLine($tokens, $classImplementsInfo['start'], $endIndex); - $classImplementsInfo['multiLine'] = false; - } else { - $this->makeClassyInheritancePartMultiLine($tokens, $classImplementsInfo['start'], $endIndex); - $classImplementsInfo['multiLine'] = true; - } - - return $classImplementsInfo; - } - - /** - * @param array{ - * start: int, - * classy: int, - * open: int, - * extends: false|_ClassExtendsInfo, - * implements: false|_ClassImplementsInfo, - * anonymousClass: bool, - * final: false|int, - * abstract: false|int, - * readonly: false|int, - * } $classDefInfo - */ - private function fixClassyDefinitionOpenSpacing(Tokens $tokens, array $classDefInfo): int - { - if ($classDefInfo['anonymousClass']) { - if (false !== $classDefInfo['implements']) { - $spacing = $classDefInfo['implements']['multiLine'] ? $this->whitespacesConfig->getLineEnding() : ' '; - } elseif (false !== $classDefInfo['extends']) { - $spacing = $classDefInfo['extends']['multiLine'] ? $this->whitespacesConfig->getLineEnding() : ' '; - } else { - $spacing = ' '; - } - } else { - $spacing = $this->whitespacesConfig->getLineEnding(); - } - - $openIndex = $tokens->getNextTokenOfKind($classDefInfo['classy'], ['{']); - - if (' ' !== $spacing && str_contains($tokens[$openIndex - 1]->getContent(), "\n")) { - return $openIndex; - } - - if ($tokens[$openIndex - 1]->isWhitespace()) { - if (' ' !== $spacing || !$tokens[$tokens->getPrevNonWhitespace($openIndex - 1)]->isComment()) { - $tokens[$openIndex - 1] = new Token([T_WHITESPACE, $spacing]); - } - - return $openIndex; - } - - $tokens->insertAt($openIndex, new Token([T_WHITESPACE, $spacing])); - - return $openIndex + 1; - } - - /** - * @return array{ - * start: int, - * classy: int, - * open: int, - * extends: false|_ClassExtendsInfo, - * implements: false|_ClassImplementsInfo, - * anonymousClass: bool, - * final: false|int, - * abstract: false|int, - * readonly: false|int, - * } - */ - private function getClassyDefinitionInfo(Tokens $tokens, int $classyIndex): array - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - $openIndex = $tokens->getNextTokenOfKind($classyIndex, ['{']); - $def = [ - 'classy' => $classyIndex, - 'open' => $openIndex, - 'extends' => false, - 'implements' => false, - 'anonymousClass' => false, - 'final' => false, - 'abstract' => false, - 'readonly' => false, - ]; - - if (!$tokens[$classyIndex]->isGivenKind(T_TRAIT)) { - $extends = $tokens->findGivenKind(T_EXTENDS, $classyIndex, $openIndex); - $def['extends'] = [] !== $extends ? $this->getClassyInheritanceInfo($tokens, array_key_first($extends), 'numberOfExtends') : false; - - if (!$tokens[$classyIndex]->isGivenKind(T_INTERFACE)) { - $implements = $tokens->findGivenKind(T_IMPLEMENTS, $classyIndex, $openIndex); - $def['implements'] = [] !== $implements ? $this->getClassyInheritanceInfo($tokens, array_key_first($implements), 'numberOfImplements') : false; - $def['anonymousClass'] = $tokensAnalyzer->isAnonymousClass($classyIndex); - } - } - - if ($def['anonymousClass']) { - $startIndex = $tokens->getPrevTokenOfKind($classyIndex, [[T_NEW]]); // go to "new" for anonymous class - } else { - $modifiers = $tokensAnalyzer->getClassyModifiers($classyIndex); - $startIndex = $classyIndex; - - foreach (['final', 'abstract', 'readonly'] as $modifier) { - if (isset($modifiers[$modifier])) { - $def[$modifier] = $modifiers[$modifier]; - $startIndex = min($startIndex, $modifiers[$modifier]); - } else { - $def[$modifier] = false; - } - } - } - - $def['start'] = $startIndex; - - return $def; - } - - /** - * @return array|array{start: int, multiLine: bool} - */ - private function getClassyInheritanceInfo(Tokens $tokens, int $startIndex, string $label): array - { - $implementsInfo = ['start' => $startIndex, $label => 1, 'multiLine' => false]; - ++$startIndex; - $endIndex = $tokens->getNextTokenOfKind($startIndex, ['{', [T_IMPLEMENTS], [T_EXTENDS]]); - $endIndex = $tokens[$endIndex]->equals('{') ? $tokens->getPrevNonWhitespace($endIndex) : $endIndex; - - for ($i = $startIndex; $i < $endIndex; ++$i) { - if ($tokens[$i]->equals(',')) { - ++$implementsInfo[$label]; - - continue; - } - - if (!$implementsInfo['multiLine'] && str_contains($tokens[$i]->getContent(), "\n")) { - $implementsInfo['multiLine'] = true; - } - } - - return $implementsInfo; - } - - private function makeClassyDefinitionSingleLine(Tokens $tokens, int $startIndex, int $endIndex): void - { - for ($i = $endIndex; $i >= $startIndex; --$i) { - if ($tokens[$i]->isWhitespace()) { - if (str_contains($tokens[$i]->getContent(), "\n")) { - if (\defined('T_ATTRIBUTE')) { // @TODO: drop condition and else when PHP 8.0+ is required - if ($tokens[$i - 1]->isGivenKind(CT::T_ATTRIBUTE_CLOSE) || $tokens[$i + 1]->isGivenKind(T_ATTRIBUTE)) { - continue; - } - } else { - if (($tokens[$i - 1]->isComment() && str_ends_with($tokens[$i - 1]->getContent(), ']')) - || ($tokens[$i + 1]->isComment() && str_starts_with($tokens[$i + 1]->getContent(), '#[')) - ) { - continue; - } - } - - if ($tokens[$i - 1]->isGivenKind(T_DOC_COMMENT) || $tokens[$i + 1]->isGivenKind(T_DOC_COMMENT)) { - continue; - } - } - - if ($tokens[$i - 1]->isComment()) { - $content = $tokens[$i - 1]->getContent(); - if (!str_starts_with($content, '//') && !str_starts_with($content, '#')) { - $tokens[$i] = new Token([T_WHITESPACE, ' ']); - } - - continue; - } - - if ($tokens[$i + 1]->isComment()) { - $content = $tokens[$i + 1]->getContent(); - if (!str_starts_with($content, '//')) { - $tokens[$i] = new Token([T_WHITESPACE, ' ']); - } - - continue; - } - - if ($tokens[$i - 1]->isGivenKind(T_CLASS) && $tokens[$i + 1]->equals('(')) { - if (true === $this->configuration['space_before_parenthesis']) { - $tokens[$i] = new Token([T_WHITESPACE, ' ']); - } else { - $tokens->clearAt($i); - } - - continue; - } - - if (!$tokens[$i - 1]->equals(',') && $tokens[$i + 1]->equalsAny([',', ')']) || $tokens[$i - 1]->equals('(')) { - $tokens->clearAt($i); - - continue; - } - - $tokens[$i] = new Token([T_WHITESPACE, ' ']); - - continue; - } - - if ($tokens[$i]->equals(',') && !$tokens[$i + 1]->isWhitespace()) { - $tokens->insertAt($i + 1, new Token([T_WHITESPACE, ' '])); - - continue; - } - - if (true === $this->configuration['space_before_parenthesis'] && $tokens[$i]->isGivenKind(T_CLASS) && !$tokens[$i + 1]->isWhitespace()) { - $tokens->insertAt($i + 1, new Token([T_WHITESPACE, ' '])); - - continue; - } - - if (!$tokens[$i]->isComment()) { - continue; - } - - if (!$tokens[$i + 1]->isWhitespace() && !$tokens[$i + 1]->isComment() && !str_contains($tokens[$i]->getContent(), "\n")) { - $tokens->insertAt($i + 1, new Token([T_WHITESPACE, ' '])); - } - - if (!$tokens[$i - 1]->isWhitespace() && !$tokens[$i - 1]->isComment()) { - $tokens->insertAt($i, new Token([T_WHITESPACE, ' '])); - } - } - } - - private function makeClassyInheritancePartMultiLine(Tokens $tokens, int $startIndex, int $endIndex): void - { - for ($i = $endIndex; $i > $startIndex; --$i) { - $previousInterfaceImplementingIndex = $tokens->getPrevTokenOfKind($i, [',', [T_IMPLEMENTS], [T_EXTENDS]]); - $breakAtIndex = $tokens->getNextMeaningfulToken($previousInterfaceImplementingIndex); - - // make the part of a ',' or 'implements' single line - $this->makeClassyDefinitionSingleLine( - $tokens, - $breakAtIndex, - $i - ); - - // make sure the part is on its own line - $isOnOwnLine = false; - - for ($j = $breakAtIndex; $j > $previousInterfaceImplementingIndex; --$j) { - if (str_contains($tokens[$j]->getContent(), "\n")) { - $isOnOwnLine = true; - - break; - } - } - - if (!$isOnOwnLine) { - if ($tokens[$breakAtIndex - 1]->isWhitespace()) { - $tokens[$breakAtIndex - 1] = new Token([ - T_WHITESPACE, - $this->whitespacesConfig->getLineEnding().$this->whitespacesConfig->getIndent(), - ]); - } else { - $tokens->insertAt($breakAtIndex, new Token([T_WHITESPACE, $this->whitespacesConfig->getLineEnding().$this->whitespacesConfig->getIndent()])); - } - } - - $i = $previousInterfaceImplementingIndex + 1; - } - } - - /** - * @param array{ - * final: false|int, - * abstract: false|int, - * readonly: false|int, - * } $classDefInfo - */ - private function sortClassModifiers(Tokens $tokens, array $classDefInfo): void - { - if (false === $classDefInfo['readonly']) { - return; - } - - $readonlyIndex = $classDefInfo['readonly']; - - foreach (['final', 'abstract'] as $accessModifier) { - if (false === $classDefInfo[$accessModifier] || $classDefInfo[$accessModifier] < $readonlyIndex) { - continue; - } - - $accessModifierIndex = $classDefInfo[$accessModifier]; - - /** @var Token $readonlyToken */ - $readonlyToken = clone $tokens[$readonlyIndex]; - - /** @var Token $accessToken */ - $accessToken = clone $tokens[$accessModifierIndex]; - - $tokens[$readonlyIndex] = $accessToken; - $tokens[$accessModifierIndex] = $readonlyToken; - - break; - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalClassFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalClassFixer.php deleted file mode 100644 index c79a1008..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalClassFixer.php +++ /dev/null @@ -1,67 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @author Filippo Tessarotto - */ -final class FinalClassFixer extends AbstractProxyFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'All classes must be final, except abstract ones and Doctrine entities.', - [ - new CodeSample( - 'configure([ - 'include' => [], - 'consider_absent_docblock_as_internal_class' => true, - ]); - - return [$fixer]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php deleted file mode 100644 index 44278aa5..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php +++ /dev/null @@ -1,374 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; -use PhpCsFixer\Utils; -use Symfony\Component\OptionsResolver\Options; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * annotation_exclude?: list, - * annotation_include?: list, - * consider_absent_docblock_as_internal_class?: bool, - * exclude?: list, - * include?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * annotation_exclude: array, - * annotation_include: array, - * consider_absent_docblock_as_internal_class: bool, - * exclude: array, - * include: array - * } - */ -final class FinalInternalClassFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const DEFAULTS = [ - 'include' => [ - 'internal', - ], - 'exclude' => [ - 'final', - 'Entity', - 'ORM\Entity', - 'ORM\Mapping\Entity', - 'Mapping\Entity', - 'Document', - 'ODM\Document', - ], - ]; - - private bool $checkAttributes; - - public function __construct() - { - parent::__construct(); - - $this->checkAttributes = \PHP_VERSION_ID >= 8_00_00; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Internal classes should be `final`.', - [ - new CodeSample(" ['@Custom'], - 'exclude' => ['@not-fix'], - ] - ), - ], - null, - 'Changing classes to `final` might cause code execution to break.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before ProtectedToPrivateFixer, SelfStaticAccessorFixer. - * Must run after PhpUnitInternalClassFixer. - */ - public function getPriority(): int - { - return 67; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_CLASS); - } - - public function isRisky(): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - $this->assertConfigHasNoConflicts(); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - for ($index = $tokens->count() - 1; 0 <= $index; --$index) { - if (!$tokens[$index]->isGivenKind(T_CLASS) || !$this->isClassCandidate($tokensAnalyzer, $tokens, $index)) { - continue; - } - - // make class 'final' - $tokens->insertSlices([ - $index => [ - new Token([T_FINAL, 'final']), - new Token([T_WHITESPACE, ' ']), - ], - ]); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $annotationsAsserts = [static function (array $values): bool { - foreach ($values as $value) { - if ('' === $value) { - return false; - } - } - - return true; - }]; - - $annotationsNormalizer = static function (Options $options, array $value): array { - $newValue = []; - foreach ($value as $key) { - if (str_starts_with($key, '@')) { - $key = substr($key, 1); - } - - $newValue[strtolower($key)] = true; - } - - return $newValue; - }; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('annotation_include', 'Class level attribute or annotation tags that must be set in order to fix the class (case insensitive).')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues($annotationsAsserts) - ->setDefault( - array_map( - static fn (string $string) => '@'.$string, - self::DEFAULTS['include'], - ), - ) - ->setNormalizer($annotationsNormalizer) - ->setDeprecationMessage('Use `include` to configure PHPDoc annotations tags and attributes.') - ->getOption(), - (new FixerOptionBuilder('annotation_exclude', 'Class level attribute or annotation tags that must be omitted to fix the class, even if all of the white list ones are used as well (case insensitive).')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues($annotationsAsserts) - ->setDefault( - array_map( - static fn (string $string) => '@'.$string, - self::DEFAULTS['exclude'], - ), - ) - ->setNormalizer($annotationsNormalizer) - ->setDeprecationMessage('Use `exclude` to configure PHPDoc annotations tags and attributes.') - ->getOption(), - (new FixerOptionBuilder('include', 'Class level attribute or annotation tags that must be set in order to fix the class (case insensitive).')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues($annotationsAsserts) - ->setDefault(self::DEFAULTS['include']) - ->setNormalizer($annotationsNormalizer) - ->getOption(), - (new FixerOptionBuilder('exclude', 'Class level attribute or annotation tags that must be omitted to fix the class, even if all of the white list ones are used as well (case insensitive).')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues($annotationsAsserts) - ->setDefault(self::DEFAULTS['exclude']) - ->setNormalizer($annotationsNormalizer) - ->getOption(), - (new FixerOptionBuilder('consider_absent_docblock_as_internal_class', 'Whether classes without any DocBlock should be fixed to final.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - /** - * @param int $index T_CLASS index - */ - private function isClassCandidate(TokensAnalyzer $tokensAnalyzer, Tokens $tokens, int $index): bool - { - if ($tokensAnalyzer->isAnonymousClass($index)) { - return false; - } - - $modifiers = $tokensAnalyzer->getClassyModifiers($index); - - if (isset($modifiers['final']) || isset($modifiers['abstract'])) { - return false; // ignore class; it is abstract or already final - } - - $decisions = []; - $currentIndex = $index; - - $acceptTypes = [ - CT::T_ATTRIBUTE_CLOSE, - T_DOC_COMMENT, - T_COMMENT, // Skip comments - ]; - - if (\defined('T_READONLY')) { - // Skip readonly classes for PHP 8.2+ - $acceptTypes[] = T_READONLY; - } - - while ($currentIndex) { - $currentIndex = $tokens->getPrevNonWhitespace($currentIndex); - - if (!$tokens[$currentIndex]->isGivenKind($acceptTypes)) { - break; - } - - if ($this->checkAttributes && $tokens[$currentIndex]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - $attributeStartIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $currentIndex); - $decisions[] = $this->isClassCandidateBasedOnAttribute($tokens, $attributeStartIndex, $currentIndex); - - $currentIndex = $attributeStartIndex; - } - - if ($tokens[$currentIndex]->isGivenKind([T_DOC_COMMENT])) { - $decisions[] = $this->isClassCandidateBasedOnPhpDoc($tokens, $currentIndex); - } - } - - if (\in_array(false, $decisions, true)) { - return false; - } - - return \in_array(true, $decisions, true) - || ([] === $decisions && true === $this->configuration['consider_absent_docblock_as_internal_class']); - } - - private function isClassCandidateBasedOnPhpDoc(Tokens $tokens, int $index): ?bool - { - $doc = new DocBlock($tokens[$index]->getContent()); - $tags = []; - - foreach ($doc->getAnnotations() as $annotation) { - if (!Preg::match('/@([^\(\s]+)/', $annotation->getContent(), $matches)) { - continue; - } - $tag = strtolower(substr(array_shift($matches), 1)); - - $tags[$tag] = true; - } - - if (\count(array_intersect_key($this->configuration['exclude'], $tags)) > 0) { - return false; - } - - if ($this->isConfiguredAsInclude($tags)) { - return true; - } - - return null; - } - - private function isClassCandidateBasedOnAttribute(Tokens $tokens, int $startIndex, int $endIndex): ?bool - { - $attributeCandidates = []; - $attributeString = ''; - $currentIndex = $startIndex; - - while ($currentIndex < $endIndex && null !== ($currentIndex = $tokens->getNextMeaningfulToken($currentIndex))) { - if (!$tokens[$currentIndex]->isGivenKind([T_STRING, T_NS_SEPARATOR])) { - if ('' !== $attributeString) { - $attributeCandidates[$attributeString] = true; - $attributeString = ''; - } - - continue; - } - - $attributeString .= strtolower($tokens[$currentIndex]->getContent()); - } - - if (\count(array_intersect_key($this->configuration['exclude'], $attributeCandidates)) > 0) { - return false; - } - - if ($this->isConfiguredAsInclude($attributeCandidates)) { - return true; - } - - return null; - } - - /** - * @param array $attributes - */ - private function isConfiguredAsInclude(array $attributes): bool - { - if (0 === \count($this->configuration['include'])) { - return true; - } - - return \count(array_intersect_key($this->configuration['include'], $attributes)) > 0; - } - - private function assertConfigHasNoConflicts(): void - { - foreach (['include' => 'annotation_include', 'exclude' => 'annotation_exclude'] as $newConfigKey => $oldConfigKey) { - $defaults = []; - - foreach (self::DEFAULTS[$newConfigKey] as $foo) { - $defaults[strtolower($foo)] = true; - } - - $newConfigIsSet = $this->configuration[$newConfigKey] !== $defaults; - $oldConfigIsSet = $this->configuration[$oldConfigKey] !== $defaults; - - if ($newConfigIsSet && $oldConfigIsSet) { - throw new InvalidFixerConfigurationException($this->getName(), \sprintf('Configuration cannot contain deprecated option "%s" and new option "%s".', $oldConfigKey, $newConfigKey)); - } - - if ($oldConfigIsSet) { - $this->configuration[$newConfigKey] = $this->configuration[$oldConfigKey]; // @phpstan-ignore-line crazy mapping, to be removed while cleaning up deprecated options - $this->checkAttributes = false; // run in old mode - } - - // if ($newConfigIsSet) - only new config is set, all good - // if (!$newConfigIsSet && !$oldConfigIsSet) - both are set as to default values, all good - - unset($this->configuration[$oldConfigKey]); // @phpstan-ignore-line crazy mapping, to be removed while cleaning up deprecated options - } - - $intersect = array_intersect_assoc($this->configuration['include'], $this->configuration['exclude']); - - if (\count($intersect) > 0) { - throw new InvalidFixerConfigurationException($this->getName(), \sprintf('Annotation cannot be used in both "include" and "exclude" list, got duplicates: %s.', Utils::naturalLanguageJoin(array_keys($intersect)))); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixer.php deleted file mode 100644 index ed9a7ac7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixer.php +++ /dev/null @@ -1,160 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - */ -final class FinalPublicMethodForAbstractClassFixer extends AbstractFixer -{ - /** - * @var array - */ - private array $magicMethods = [ - '__construct' => true, - '__destruct' => true, - '__call' => true, - '__callstatic' => true, - '__get' => true, - '__set' => true, - '__isset' => true, - '__unset' => true, - '__sleep' => true, - '__wakeup' => true, - '__tostring' => true, - '__invoke' => true, - '__set_state' => true, - '__clone' => true, - '__debuginfo' => true, - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'All `public` methods of `abstract` classes should be `final`.', - [ - new CodeSample( - 'isAllTokenKindsFound([T_ABSTRACT, T_PUBLIC, T_FUNCTION]); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $abstracts = array_keys($tokens->findGivenKind(T_ABSTRACT)); - - while ($abstractIndex = array_pop($abstracts)) { - $classIndex = $tokens->getNextTokenOfKind($abstractIndex, [[T_CLASS], [T_FUNCTION]]); - if (!$tokens[$classIndex]->isGivenKind(T_CLASS)) { - continue; - } - - $classOpen = $tokens->getNextTokenOfKind($classIndex, ['{']); - $classClose = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $classOpen); - - $this->fixClass($tokens, $classOpen, $classClose); - } - } - - private function fixClass(Tokens $tokens, int $classOpenIndex, int $classCloseIndex): void - { - for ($index = $classCloseIndex - 1; $index > $classOpenIndex; --$index) { - // skip method contents - if ($tokens[$index]->equals('}')) { - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - - continue; - } - - // skip non public methods - if (!$tokens[$index]->isGivenKind(T_PUBLIC)) { - continue; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - $nextToken = $tokens[$nextIndex]; - - if ($nextToken->isGivenKind(T_STATIC)) { - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - $nextToken = $tokens[$nextIndex]; - } - - // skip uses, attributes, constants etc - if (!$nextToken->isGivenKind(T_FUNCTION)) { - continue; - } - - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - $nextToken = $tokens[$nextIndex]; - - // skip magic methods - if (isset($this->magicMethods[strtolower($nextToken->getContent())])) { - continue; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - $prevToken = $tokens[$prevIndex]; - - if ($prevToken->isGivenKind(T_STATIC)) { - $index = $prevIndex; - $prevIndex = $tokens->getPrevMeaningfulToken($index); - $prevToken = $tokens[$prevIndex]; - } - - // skip abstract or already final methods - if ($prevToken->isGivenKind([T_ABSTRACT, T_FINAL])) { - $index = $prevIndex; - - continue; - } - - $tokens->insertAt( - $index, - [ - new Token([T_FINAL, 'final']), - new Token([T_WHITESPACE, ' ']), - ] - ); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixer.php deleted file mode 100644 index b09c2a2b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixer.php +++ /dev/null @@ -1,93 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Ceeram - */ -final class NoBlankLinesAfterClassOpeningFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should be no empty lines after class opening brace.', - [ - new CodeSample( - ' $token) { - if (!$token->isClassy()) { - continue; - } - - $startBraceIndex = $tokens->getNextTokenOfKind($index, ['{']); - if (!$tokens[$startBraceIndex + 1]->isWhitespace()) { - continue; - } - - $this->fixWhitespace($tokens, $startBraceIndex + 1); - } - } - - /** - * Cleanup a whitespace token. - */ - private function fixWhitespace(Tokens $tokens, int $index): void - { - $content = $tokens[$index]->getContent(); - // if there is more than one new line in the whitespace, then we need to fix it - if (substr_count($content, "\n") > 1) { - // the final bit of the whitespace must be the next statement's indentation - $tokens[$index] = new Token([T_WHITESPACE, $this->whitespacesConfig->getLineEnding().substr($content, strrpos($content, "\n") + 1)]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoNullPropertyInitializationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoNullPropertyInitializationFixer.php deleted file mode 100644 index b08a9231..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoNullPropertyInitializationFixer.php +++ /dev/null @@ -1,141 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author ntzm - */ -final class NoNullPropertyInitializationFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Properties MUST not be explicitly initialized with `null` except when they have a type declaration (PHP 7.4).', - [ - new CodeSample( - 'isAnyTokenKindsFound([T_CLASS, T_TRAIT]) && $tokens->isAnyTokenKindsFound([T_PUBLIC, T_PROTECTED, T_PRIVATE, T_VAR, T_STATIC]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $inClass = []; - $classLevel = 0; - - for ($index = 0, $count = $tokens->count(); $index < $count; ++$index) { - if ($tokens[$index]->isGivenKind([T_CLASS, T_TRAIT])) { // Enums and interfaces do not have properties - ++$classLevel; - $inClass[$classLevel] = 1; - - $index = $tokens->getNextTokenOfKind($index, ['{']); - - continue; - } - - if (0 === $classLevel) { - continue; - } - - if ($tokens[$index]->equals('{')) { - ++$inClass[$classLevel]; - - continue; - } - - if ($tokens[$index]->equals('}')) { - --$inClass[$classLevel]; - - if (0 === $inClass[$classLevel]) { - unset($inClass[$classLevel]); - --$classLevel; - } - - continue; - } - - // Ensure we are in a class but not in a method in case there are static variables defined - if (1 !== $inClass[$classLevel]) { - continue; - } - - if (!$tokens[$index]->isGivenKind([T_PUBLIC, T_PROTECTED, T_PRIVATE, T_VAR, T_STATIC])) { - continue; - } - - while (true) { - $varTokenIndex = $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->isGivenKind(T_STATIC)) { - $varTokenIndex = $index = $tokens->getNextMeaningfulToken($index); - } - - if (!$tokens[$index]->isGivenKind(T_VARIABLE)) { - break; - } - - $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->equals('=')) { - $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->isGivenKind(T_NS_SEPARATOR)) { - $index = $tokens->getNextMeaningfulToken($index); - } - - if ($tokens[$index]->equals([T_STRING, 'null'], false)) { - for ($i = $varTokenIndex + 1; $i <= $index; ++$i) { - if ( - !($tokens[$i]->isWhitespace() && str_contains($tokens[$i]->getContent(), "\n")) - && !$tokens[$i]->isComment() - ) { - $tokens->clearAt($i); - } - } - } - - ++$index; - } - - if (!$tokens[$index]->equals(',')) { - break; - } - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php deleted file mode 100644 index 6547cc62..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php +++ /dev/null @@ -1,408 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Matteo Beccati - */ -final class NoPhp4ConstructorFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Convert PHP4-style constructors to `__construct`.', - [ - new CodeSample('isTokenKindFound(T_CLASS); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - $classes = array_keys($tokens->findGivenKind(T_CLASS)); - $numClasses = \count($classes); - - for ($i = 0; $i < $numClasses; ++$i) { - $index = $classes[$i]; - - // is it an anonymous class definition? - if ($tokensAnalyzer->isAnonymousClass($index)) { - continue; - } - - // is it inside a namespace? - $nspIndex = $tokens->getPrevTokenOfKind($index, [[T_NAMESPACE, 'namespace']]); - - if (null !== $nspIndex) { - $nspIndex = $tokens->getNextMeaningfulToken($nspIndex); - - // make sure it's not the global namespace, as PHP4 constructors are allowed in there - if (!$tokens[$nspIndex]->equals('{')) { - // unless it's the global namespace, the index currently points to the name - $nspIndex = $tokens->getNextTokenOfKind($nspIndex, [';', '{']); - - if ($tokens[$nspIndex]->equals(';')) { - // the class is inside a (non-block) namespace, no PHP4-code should be in there - break; - } - - // the index points to the { of a block-namespace - $nspEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $nspIndex); - - if ($index < $nspEnd) { - // the class is inside a block namespace, skip other classes that might be in it - for ($j = $i + 1; $j < $numClasses; ++$j) { - if ($classes[$j] < $nspEnd) { - ++$i; - } - } - - // and continue checking the classes that might follow - continue; - } - } - } - - $classNameIndex = $tokens->getNextMeaningfulToken($index); - $className = $tokens[$classNameIndex]->getContent(); - $classStart = $tokens->getNextTokenOfKind($classNameIndex, ['{']); - $classEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $classStart); - - $this->fixConstructor($tokens, $className, $classStart, $classEnd); - $this->fixParent($tokens, $classStart, $classEnd); - } - } - - /** - * Fix constructor within a class, if possible. - * - * @param Tokens $tokens the Tokens instance - * @param string $className the class name - * @param int $classStart the class start index - * @param int $classEnd the class end index - */ - private function fixConstructor(Tokens $tokens, string $className, int $classStart, int $classEnd): void - { - $php4 = $this->findFunction($tokens, $className, $classStart, $classEnd); - - if (null === $php4) { - return; // no PHP4-constructor! - } - - if (isset($php4['modifiers'][T_ABSTRACT]) || isset($php4['modifiers'][T_STATIC])) { - return; // PHP4 constructor can't be abstract or static - } - - $php5 = $this->findFunction($tokens, '__construct', $classStart, $classEnd); - - if (null === $php5) { - // no PHP5-constructor, we can rename the old one to __construct - $tokens[$php4['nameIndex']] = new Token([T_STRING, '__construct']); - - // in some (rare) cases we might have just created an infinite recursion issue - $this->fixInfiniteRecursion($tokens, $php4['bodyIndex'], $php4['endIndex']); - - return; - } - - // does the PHP4-constructor only call $this->__construct($args, ...)? - [$sequences, $case] = $this->getWrapperMethodSequence($tokens, '__construct', $php4['startIndex'], $php4['bodyIndex']); - - foreach ($sequences as $seq) { - if (null !== $tokens->findSequence($seq, $php4['bodyIndex'] - 1, $php4['endIndex'], $case)) { - // good, delete it! - for ($i = $php4['startIndex']; $i <= $php4['endIndex']; ++$i) { - $tokens->clearAt($i); - } - - return; - } - } - - // does __construct only call the PHP4-constructor (with the same args)? - [$sequences, $case] = $this->getWrapperMethodSequence($tokens, $className, $php4['startIndex'], $php4['bodyIndex']); - - foreach ($sequences as $seq) { - if (null !== $tokens->findSequence($seq, $php5['bodyIndex'] - 1, $php5['endIndex'], $case)) { - // that was a weird choice, but we can safely delete it and... - for ($i = $php5['startIndex']; $i <= $php5['endIndex']; ++$i) { - $tokens->clearAt($i); - } - - // rename the PHP4 one to __construct - $tokens[$php4['nameIndex']] = new Token([T_STRING, '__construct']); - - return; - } - } - } - - /** - * Fix calls to the parent constructor within a class. - * - * @param Tokens $tokens the Tokens instance - * @param int $classStart the class start index - * @param int $classEnd the class end index - */ - private function fixParent(Tokens $tokens, int $classStart, int $classEnd): void - { - // check calls to the parent constructor - foreach ($tokens->findGivenKind(T_EXTENDS) as $index => $token) { - $parentIndex = $tokens->getNextMeaningfulToken($index); - $parentClass = $tokens[$parentIndex]->getContent(); - - // using parent::ParentClassName() or ParentClassName::ParentClassName() - $parentSeq = $tokens->findSequence([ - [T_STRING], - [T_DOUBLE_COLON], - [T_STRING, $parentClass], - '(', - ], $classStart, $classEnd, [2 => false]); - - if (null !== $parentSeq) { - // we only need indices - $parentSeq = array_keys($parentSeq); - - // match either of the possibilities - if ($tokens[$parentSeq[0]]->equalsAny([[T_STRING, 'parent'], [T_STRING, $parentClass]], false)) { - // replace with parent::__construct - $tokens[$parentSeq[0]] = new Token([T_STRING, 'parent']); - $tokens[$parentSeq[2]] = new Token([T_STRING, '__construct']); - } - } - - foreach (Token::getObjectOperatorKinds() as $objectOperatorKind) { - // using $this->ParentClassName() - $parentSeq = $tokens->findSequence([ - [T_VARIABLE, '$this'], - [$objectOperatorKind], - [T_STRING, $parentClass], - '(', - ], $classStart, $classEnd, [2 => false]); - - if (null !== $parentSeq) { - // we only need indices - $parentSeq = array_keys($parentSeq); - - // replace call with parent::__construct() - $tokens[$parentSeq[0]] = new Token([ - T_STRING, - 'parent', - ]); - $tokens[$parentSeq[1]] = new Token([ - T_DOUBLE_COLON, - '::', - ]); - $tokens[$parentSeq[2]] = new Token([T_STRING, '__construct']); - } - } - } - } - - /** - * Fix a particular infinite recursion issue happening when the parent class has __construct and the child has only - * a PHP4 constructor that calls the parent constructor as $this->__construct(). - * - * @param Tokens $tokens the Tokens instance - * @param int $start the PHP4 constructor body start - * @param int $end the PHP4 constructor body end - */ - private function fixInfiniteRecursion(Tokens $tokens, int $start, int $end): void - { - foreach (Token::getObjectOperatorKinds() as $objectOperatorKind) { - $seq = [ - [T_VARIABLE, '$this'], - [$objectOperatorKind], - [T_STRING, '__construct'], - ]; - - while (true) { - $callSeq = $tokens->findSequence($seq, $start, $end, [2 => false]); - - if (null === $callSeq) { - return; - } - - $callSeq = array_keys($callSeq); - - $tokens[$callSeq[0]] = new Token([T_STRING, 'parent']); - $tokens[$callSeq[1]] = new Token([T_DOUBLE_COLON, '::']); - } - } - } - - /** - * Generate the sequence of tokens necessary for the body of a wrapper method that simply - * calls $this->{$method}( [args...] ) with the same arguments as its own signature. - * - * @param Tokens $tokens the Tokens instance - * @param string $method the wrapped method name - * @param int $startIndex function/method start index - * @param int $bodyIndex function/method body index - * - * @return array{list>, array{3: false}} - */ - private function getWrapperMethodSequence(Tokens $tokens, string $method, int $startIndex, int $bodyIndex): array - { - $sequences = []; - - foreach (Token::getObjectOperatorKinds() as $objectOperatorKind) { - // initialise sequence as { $this->{$method}( - $seq = [ - '{', - [T_VARIABLE, '$this'], - [$objectOperatorKind], - [T_STRING, $method], - '(', - ]; - - // parse method parameters, if any - $index = $startIndex; - - while (true) { - // find the next variable name - $index = $tokens->getNextTokenOfKind($index, [[T_VARIABLE]]); - - if (null === $index || $index >= $bodyIndex) { - // we've reached the body already - break; - } - - // append a comma if it's not the first variable - if (\count($seq) > 5) { - $seq[] = ','; - } - - // append variable name to the sequence - $seq[] = [T_VARIABLE, $tokens[$index]->getContent()]; - } - - // almost done, close the sequence with ); } - $seq[] = ')'; - $seq[] = ';'; - $seq[] = '}'; - - $sequences[] = $seq; - } - - return [$sequences, [3 => false]]; - } - - /** - * Find a function or method matching a given name within certain bounds. - * - * Returns: - * - nameIndex (int): The index of the function/method name. - * - startIndex (int): The index of the function/method start. - * - endIndex (int): The index of the function/method end. - * - bodyIndex (int): The index of the function/method body. - * - modifiers (array): The modifiers as array keys and their index as the values, e.g. array(T_PUBLIC => 10) - * - * @param Tokens $tokens the Tokens instance - * @param string $name the function/Method name - * @param int $startIndex the search start index - * @param int $endIndex the search end index - * - * @return null|array{ - * nameIndex: int, - * startIndex: int, - * endIndex: int, - * bodyIndex: int, - * modifiers: list, - * } - */ - private function findFunction(Tokens $tokens, string $name, int $startIndex, int $endIndex): ?array - { - $function = $tokens->findSequence([ - [T_FUNCTION], - [T_STRING, $name], - '(', - ], $startIndex, $endIndex, false); - - if (null === $function) { - return null; - } - - // keep only the indices - $function = array_keys($function); - - // find previous block, saving method modifiers for later use - $possibleModifiers = [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_STATIC, T_ABSTRACT, T_FINAL]; - $modifiers = []; - - $prevBlock = $tokens->getPrevMeaningfulToken($function[0]); - - while (null !== $prevBlock && $tokens[$prevBlock]->isGivenKind($possibleModifiers)) { - $modifiers[$tokens[$prevBlock]->getId()] = $prevBlock; - $prevBlock = $tokens->getPrevMeaningfulToken($prevBlock); - } - - if (isset($modifiers[T_ABSTRACT])) { - // abstract methods have no body - $bodyStart = null; - $funcEnd = $tokens->getNextTokenOfKind($function[2], [';']); - } else { - // find method body start and the end of the function definition - $bodyStart = $tokens->getNextTokenOfKind($function[2], ['{']); - $funcEnd = null !== $bodyStart ? $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $bodyStart) : null; - } - - return [ - 'nameIndex' => $function[1], - 'startIndex' => $prevBlock + 1, - 'endIndex' => $funcEnd, - 'bodyIndex' => $bodyStart, - 'modifiers' => $modifiers, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoUnneededFinalMethodFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoUnneededFinalMethodFixer.php deleted file mode 100644 index 16fc2754..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoUnneededFinalMethodFixer.php +++ /dev/null @@ -1,215 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Filippo Tessarotto - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * private_methods?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * private_methods: bool - * } - */ -final class NoUnneededFinalMethodFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Removes `final` from methods where possible.', - [ - new CodeSample( - ' false] - ), - ], - null, - 'Risky when child class overrides a `private` method.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - if (!$tokens->isAllTokenKindsFound([T_FINAL, T_FUNCTION])) { - return false; - } - - if (\defined('T_ENUM') && $tokens->isTokenKindFound(T_ENUM)) { // @TODO: drop condition when PHP 8.1+ is required - return true; - } - - return $tokens->isTokenKindFound(T_CLASS); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($this->getMethods($tokens) as $element) { - $index = $element['method_final_index']; - - if ($element['method_of_enum'] || $element['class_is_final']) { - $this->clearFinal($tokens, $index); - - continue; - } - - if (!$element['method_is_private'] || false === $this->configuration['private_methods'] || $element['method_is_constructor']) { - continue; - } - - $this->clearFinal($tokens, $index); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('private_methods', 'Private methods of non-`final` classes must not be declared `final`.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - /** - * @return \Generator - */ - private function getMethods(Tokens $tokens): \Generator - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - $modifierKinds = [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_FINAL, T_ABSTRACT, T_STATIC]; - - $enums = []; - $classesAreFinal = []; - - foreach ($tokensAnalyzer->getClassyElements() as $index => $element) { - if ('method' !== $element['type']) { - continue; // not a method - } - - $classIndex = $element['classIndex']; - - if (!\array_key_exists($classIndex, $enums)) { - $enums[$classIndex] = \defined('T_ENUM') && $tokens[$classIndex]->isGivenKind(T_ENUM); // @TODO: drop condition when PHP 8.1+ is required - } - - $element['method_final_index'] = null; - $element['method_is_private'] = false; - - $previous = $index; - - do { - $previous = $tokens->getPrevMeaningfulToken($previous); - - if ($tokens[$previous]->isGivenKind(T_PRIVATE)) { - $element['method_is_private'] = true; - } elseif ($tokens[$previous]->isGivenKind(T_FINAL)) { - $element['method_final_index'] = $previous; - } - } while ($tokens[$previous]->isGivenKind($modifierKinds)); - - if ($enums[$classIndex]) { - $element['method_of_enum'] = true; - - yield $element; - - continue; - } - - if (!\array_key_exists($classIndex, $classesAreFinal)) { - $modifiers = $tokensAnalyzer->getClassyModifiers($classIndex); - $classesAreFinal[$classIndex] = isset($modifiers['final']); - } - - $element['method_of_enum'] = false; - $element['class_is_final'] = $classesAreFinal[$classIndex]; - $element['method_is_constructor'] = '__construct' === strtolower($tokens[$tokens->getNextMeaningfulToken($index)]->getContent()); - - yield $element; - } - } - - private function clearFinal(Tokens $tokens, ?int $index): void - { - if (null === $index) { - return; - } - - $tokens->clearAt($index); - - ++$index; - - if ($tokens[$index]->isWhitespace()) { - $tokens->clearAt($index); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php deleted file mode 100644 index 71febf69..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php +++ /dev/null @@ -1,601 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Utils; - -/** - * @author Gregor Harlan - * - * @phpstan-type _ClassElement array{ - * start: int, - * visibility: string, - * abstract: bool, - * static: bool, - * readonly: bool, - * type: string, - * name: string, - * end: int, - * } - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * case_sensitive?: bool, - * order?: list, - * sort_algorithm?: 'alpha'|'none' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * case_sensitive: bool, - * order: list, - * sort_algorithm: 'alpha'|'none' - * } - */ -final class OrderedClassElementsFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** @internal */ - public const SORT_ALPHA = 'alpha'; - - /** @internal */ - public const SORT_NONE = 'none'; - - private const SUPPORTED_SORT_ALGORITHMS = [ - self::SORT_NONE, - self::SORT_ALPHA, - ]; - - /** - * @var array> Array containing all class element base types (keys) and their parent types (values) - */ - private const TYPE_HIERARCHY = [ - 'use_trait' => null, - 'public' => null, - 'protected' => null, - 'private' => null, - 'case' => ['public'], - 'constant' => null, - 'constant_public' => ['constant', 'public'], - 'constant_protected' => ['constant', 'protected'], - 'constant_private' => ['constant', 'private'], - 'property' => null, - 'property_static' => ['property'], - 'property_public' => ['property', 'public'], - 'property_protected' => ['property', 'protected'], - 'property_private' => ['property', 'private'], - 'property_public_readonly' => ['property_readonly', 'property_public'], - 'property_protected_readonly' => ['property_readonly', 'property_protected'], - 'property_private_readonly' => ['property_readonly', 'property_private'], - 'property_public_static' => ['property_static', 'property_public'], - 'property_protected_static' => ['property_static', 'property_protected'], - 'property_private_static' => ['property_static', 'property_private'], - 'method' => null, - 'method_abstract' => ['method'], - 'method_static' => ['method'], - 'method_public' => ['method', 'public'], - 'method_protected' => ['method', 'protected'], - 'method_private' => ['method', 'private'], - 'method_public_abstract' => ['method_abstract', 'method_public'], - 'method_protected_abstract' => ['method_abstract', 'method_protected'], - 'method_private_abstract' => ['method_abstract', 'method_private'], - 'method_public_abstract_static' => ['method_abstract', 'method_static', 'method_public'], - 'method_protected_abstract_static' => ['method_abstract', 'method_static', 'method_protected'], - 'method_private_abstract_static' => ['method_abstract', 'method_static', 'method_private'], - 'method_public_static' => ['method_static', 'method_public'], - 'method_protected_static' => ['method_static', 'method_protected'], - 'method_private_static' => ['method_static', 'method_private'], - ]; - - /** - * @var array Array containing special method types - */ - private const SPECIAL_TYPES = [ - 'construct' => null, - 'destruct' => null, - 'magic' => null, - 'phpunit' => null, - ]; - - /** - * @var array Resolved configuration array (type => position) - */ - private array $typePosition; - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Orders the elements of classes/interfaces/traits/enums.', - [ - new CodeSample( - ' ['method_private', 'method_public']] - ), - new CodeSample( - ' ['method_public'], 'sort_algorithm' => self::SORT_ALPHA] - ), - new CodeSample( - ' ['method_public'], 'sort_algorithm' => self::SORT_ALPHA, 'case_sensitive' => true] - ), - ], - 'Accepts a subset of pre-defined element types, special element groups, and custom patterns. - -Element types: `[\''.implode('\', \'', array_keys(self::TYPE_HIERARCHY)).'\']` - -Special element types: `[\''.implode('\', \'', array_keys(self::SPECIAL_TYPES)).'\']` - -Custom values: - -- `method:*`: specify a single method name (e.g. `method:__invoke`) to set the order of that specific method.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before ClassAttributesSeparationFixer, NoBlankLinesAfterClassOpeningFixer, SpaceAfterSemicolonFixer. - * Must run after NoPhp4ConstructorFixer, ProtectedToPrivateFixer. - */ - public function getPriority(): int - { - return 65; - } - - protected function configurePostNormalisation(): void - { - $this->typePosition = []; - $position = 0; - - foreach ($this->configuration['order'] as $type) { - $this->typePosition[$type] = $position++; - } - - foreach (self::TYPE_HIERARCHY as $type => $parents) { - if (isset($this->typePosition[$type])) { - continue; - } - - if (null === $parents) { - $this->typePosition[$type] = null; - - continue; - } - - foreach ($parents as $parent) { - if (isset($this->typePosition[$parent])) { - $this->typePosition[$type] = $this->typePosition[$parent]; - - continue 2; - } - } - - $this->typePosition[$type] = null; - } - - $lastPosition = \count($this->configuration['order']); - - foreach ($this->typePosition as &$pos) { - if (null === $pos) { - $pos = $lastPosition; - } - - $pos *= 10; // last digit is used by phpunit method ordering - } - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($i = 1, $count = $tokens->count(); $i < $count; ++$i) { - if (!$tokens[$i]->isClassy()) { - continue; - } - - $i = $tokens->getNextTokenOfKind($i, ['{']); - $elements = $this->getElements($tokens, $i); - - if (0 === \count($elements)) { - continue; - } - - $sorted = $this->sortElements($elements); - $endIndex = $elements[\count($elements) - 1]['end']; - - if ($sorted !== $elements) { - $this->sortTokens($tokens, $i, $endIndex, $sorted); - } - - $i = $endIndex; - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $builtIns = array_keys(array_merge(self::TYPE_HIERARCHY, self::SPECIAL_TYPES)); - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('order', 'List of strings defining order of elements.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([ - static function (array $values) use ($builtIns): bool { - foreach ($values as $value) { - if (\in_array($value, $builtIns, true)) { - return true; - } - - if ('method:' === substr($value, 0, 7)) { - return true; - } - } - - return false; - }, - ]) - ->setDefault([ - 'use_trait', - 'case', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public', - 'property_protected', - 'property_private', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - ]) - ->getOption(), - (new FixerOptionBuilder('sort_algorithm', 'How multiple occurrences of same type statements should be sorted.')) - ->setAllowedValues(self::SUPPORTED_SORT_ALGORITHMS) - ->setDefault(self::SORT_NONE) - ->getOption(), - (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - /** - * @return list<_ClassElement> - */ - private function getElements(Tokens $tokens, int $startIndex): array - { - static $elementTokenKinds = [CT::T_USE_TRAIT, T_CASE, T_CONST, T_VARIABLE, T_FUNCTION]; - - ++$startIndex; - $elements = []; - - while (true) { - $element = [ - 'start' => $startIndex, - 'visibility' => 'public', - 'abstract' => false, - 'static' => false, - 'readonly' => false, - ]; - - for ($i = $startIndex;; ++$i) { - $token = $tokens[$i]; - - // class end - if ($token->equals('}')) { - return $elements; - } - - if ($token->isGivenKind(T_ABSTRACT)) { - $element['abstract'] = true; - - continue; - } - - if ($token->isGivenKind(T_STATIC)) { - $element['static'] = true; - - continue; - } - - if (\defined('T_READONLY') && $token->isGivenKind(T_READONLY)) { // @TODO: drop condition when PHP 8.1+ is required - $element['readonly'] = true; - } - - if ($token->isGivenKind([T_PROTECTED, T_PRIVATE])) { - $element['visibility'] = strtolower($token->getContent()); - - continue; - } - - if (!$token->isGivenKind($elementTokenKinds)) { - continue; - } - - $type = $this->detectElementType($tokens, $i); - - if (\is_array($type)) { - $element['type'] = $type[0]; - $element['name'] = $type[1]; - } else { - $element['type'] = $type; - } - - if ('property' === $element['type']) { - $element['name'] = $tokens[$i]->getContent(); - } elseif (\in_array($element['type'], ['use_trait', 'case', 'constant', 'method', 'magic', 'construct', 'destruct'], true)) { - $element['name'] = $tokens[$tokens->getNextMeaningfulToken($i)]->getContent(); - } - - $element['end'] = $this->findElementEnd($tokens, $i); - - break; - } - - $elements[] = $element; - $startIndex = $element['end'] + 1; - } - } - - /** - * @return list|string type or array of type and name - */ - private function detectElementType(Tokens $tokens, int $index) - { - $token = $tokens[$index]; - - if ($token->isGivenKind(CT::T_USE_TRAIT)) { - return 'use_trait'; - } - - if ($token->isGivenKind(T_CASE)) { - return 'case'; - } - - if ($token->isGivenKind(T_CONST)) { - return 'constant'; - } - - if ($token->isGivenKind(T_VARIABLE)) { - return 'property'; - } - - $nameToken = $tokens[$tokens->getNextMeaningfulToken($index)]; - - if ($nameToken->equals([T_STRING, '__construct'], false)) { - return 'construct'; - } - - if ($nameToken->equals([T_STRING, '__destruct'], false)) { - return 'destruct'; - } - - if ( - $nameToken->equalsAny([ - [T_STRING, 'setUpBeforeClass'], - [T_STRING, 'doSetUpBeforeClass'], - [T_STRING, 'tearDownAfterClass'], - [T_STRING, 'doTearDownAfterClass'], - [T_STRING, 'setUp'], - [T_STRING, 'doSetUp'], - [T_STRING, 'assertPreConditions'], - [T_STRING, 'assertPostConditions'], - [T_STRING, 'tearDown'], - [T_STRING, 'doTearDown'], - ], false) - ) { - return ['phpunit', strtolower($nameToken->getContent())]; - } - - return str_starts_with($nameToken->getContent(), '__') ? 'magic' : 'method'; - } - - private function findElementEnd(Tokens $tokens, int $index): int - { - $index = $tokens->getNextTokenOfKind($index, ['{', ';']); - - if ($tokens[$index]->equals('{')) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - } - - for (++$index; $tokens[$index]->isWhitespace(" \t") || $tokens[$index]->isComment(); ++$index); - - --$index; - - return $tokens[$index]->isWhitespace() ? $index - 1 : $index; - } - - /** - * @param list<_ClassElement> $elements - * - * @return list<_ClassElement> - */ - private function sortElements(array $elements): array - { - static $phpunitPositions = [ - 'setupbeforeclass' => 1, - 'dosetupbeforeclass' => 2, - 'teardownafterclass' => 3, - 'doteardownafterclass' => 4, - 'setup' => 5, - 'dosetup' => 6, - 'assertpreconditions' => 7, - 'assertpostconditions' => 8, - 'teardown' => 9, - 'doteardown' => 10, - ]; - - $getPositionType = function (array $element) use ($phpunitPositions): int { - $type = $element['type']; - - if (\in_array($type, ['method', 'magic', 'phpunit'], true) && isset($this->typePosition["method:{$element['name']}"])) { - return $this->typePosition["method:{$element['name']}"]; - } - - if (\array_key_exists($type, self::SPECIAL_TYPES)) { - if (isset($this->typePosition[$type])) { - $position = $this->typePosition[$type]; - - if ('phpunit' === $type) { - $position += $phpunitPositions[$element['name']]; - } - - return $position; - } - - $type = 'method'; - } - - if (\in_array($type, ['constant', 'property', 'method'], true)) { - $type .= '_'.$element['visibility']; - - if ($element['abstract']) { - $type .= '_abstract'; - } - - if ($element['static']) { - $type .= '_static'; - } - - if ($element['readonly']) { - $type .= '_readonly'; - } - } - - return $this->typePosition[$type]; - }; - - return Utils::stableSort( - $elements, - /** - * @return array{element: _ClassElement, position: int} - */ - static fn (array $element): array => ['element' => $element, 'position' => $getPositionType($element)], - /** - * @param array{element: _ClassElement, position: int} $a - * @param array{element: _ClassElement, position: int} $b - * - * @return -1|0|1 - */ - fn (array $a, array $b): int => ($a['position'] === $b['position']) ? $this->sortGroupElements($a['element'], $b['element']) : $a['position'] <=> $b['position'], - ); - } - - /** - * @param _ClassElement $a - * @param _ClassElement $b - */ - private function sortGroupElements(array $a, array $b): int - { - if (self::SORT_ALPHA === $this->configuration['sort_algorithm']) { - return true === $this->configuration['case_sensitive'] - ? $a['name'] <=> $b['name'] - : strcasecmp($a['name'], $b['name']); - } - - return $a['start'] <=> $b['start']; - } - - /** - * @param list<_ClassElement> $elements - */ - private function sortTokens(Tokens $tokens, int $startIndex, int $endIndex, array $elements): void - { - $replaceTokens = []; - - foreach ($elements as $element) { - for ($i = $element['start']; $i <= $element['end']; ++$i) { - $replaceTokens[] = clone $tokens[$i]; - } - } - - $tokens->overrideRange($startIndex + 1, $endIndex, $replaceTokens); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php deleted file mode 100644 index c2589df1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php +++ /dev/null @@ -1,272 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dave van der Brugge - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * case_sensitive?: bool, - * direction?: 'ascend'|'descend', - * order?: 'alpha'|'length' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * case_sensitive: bool, - * direction: 'ascend'|'descend', - * order: 'alpha'|'length' - * } - */ -final class OrderedInterfacesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** @internal */ - public const OPTION_DIRECTION = 'direction'; - - /** @internal */ - public const OPTION_ORDER = 'order'; - - /** @internal */ - public const DIRECTION_ASCEND = 'ascend'; - - /** @internal */ - public const DIRECTION_DESCEND = 'descend'; - - /** @internal */ - public const ORDER_ALPHA = 'alpha'; - - /** @internal */ - public const ORDER_LENGTH = 'length'; - - /** - * Array of supported directions in configuration. - * - * @var list - */ - private const SUPPORTED_DIRECTION_OPTIONS = [ - self::DIRECTION_ASCEND, - self::DIRECTION_DESCEND, - ]; - - /** - * Array of supported orders in configuration. - * - * @var list - */ - private const SUPPORTED_ORDER_OPTIONS = [ - self::ORDER_ALPHA, - self::ORDER_LENGTH, - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Orders the interfaces in an `implements` or `interface extends` clause.', - [ - new CodeSample( - " self::DIRECTION_DESCEND] - ), - new CodeSample( - " self::ORDER_LENGTH] - ), - new CodeSample( - " self::ORDER_LENGTH, - self::OPTION_DIRECTION => self::DIRECTION_DESCEND, - ] - ), - new CodeSample( - " self::ORDER_ALPHA, - ] - ), - new CodeSample( - " self::ORDER_ALPHA, - 'case_sensitive' => true, - ] - ), - ], - ); - } - - /** - * {@inheritdoc} - * - * Must run after FullyQualifiedStrictTypesFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_IMPLEMENTS) - || $tokens->isAllTokenKindsFound([T_INTERFACE, T_EXTENDS]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_IMPLEMENTS)) { - if (!$token->isGivenKind(T_EXTENDS)) { - continue; - } - - $nameTokenIndex = $tokens->getPrevMeaningfulToken($index); - $interfaceTokenIndex = $tokens->getPrevMeaningfulToken($nameTokenIndex); - $interfaceToken = $tokens[$interfaceTokenIndex]; - - if (!$interfaceToken->isGivenKind(T_INTERFACE)) { - continue; - } - } - - $implementsStart = $index + 1; - $implementsEnd = $tokens->getPrevMeaningfulToken($tokens->getNextTokenOfKind($implementsStart, ['{'])); - - $interfaces = $this->getInterfaces($tokens, $implementsStart, $implementsEnd); - - if (1 === \count($interfaces)) { - continue; - } - - foreach ($interfaces as $interfaceIndex => $interface) { - $interfaceTokens = Tokens::fromArray($interface); - $normalized = ''; - $actualInterfaceIndex = $interfaceTokens->getNextMeaningfulToken(-1); - - while ($interfaceTokens->offsetExists($actualInterfaceIndex)) { - $token = $interfaceTokens[$actualInterfaceIndex]; - - if ($token->isComment() || $token->isWhitespace()) { - break; - } - - $normalized .= str_replace('\\', ' ', $token->getContent()); - ++$actualInterfaceIndex; - } - - $interfaces[$interfaceIndex] = [ - 'tokens' => $interface, - 'normalized' => $normalized, - 'originalIndex' => $interfaceIndex, - ]; - } - - usort($interfaces, function (array $first, array $second): int { - $score = self::ORDER_LENGTH === $this->configuration[self::OPTION_ORDER] - ? \strlen($first['normalized']) - \strlen($second['normalized']) - : ( - true === $this->configuration['case_sensitive'] - ? $first['normalized'] <=> $second['normalized'] - : strcasecmp($first['normalized'], $second['normalized']) - ); - - if (self::DIRECTION_DESCEND === $this->configuration[self::OPTION_DIRECTION]) { - $score *= -1; - } - - return $score; - }); - - $changed = false; - - foreach ($interfaces as $interfaceIndex => $interface) { - if ($interface['originalIndex'] !== $interfaceIndex) { - $changed = true; - - break; - } - } - - if (!$changed) { - continue; - } - - $newTokens = array_shift($interfaces)['tokens']; - - foreach ($interfaces as $interface) { - array_push($newTokens, new Token(','), ...$interface['tokens']); - } - - $tokens->overrideRange($implementsStart, $implementsEnd, $newTokens); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder(self::OPTION_ORDER, 'How the interfaces should be ordered.')) - ->setAllowedValues(self::SUPPORTED_ORDER_OPTIONS) - ->setDefault(self::ORDER_ALPHA) - ->getOption(), - (new FixerOptionBuilder(self::OPTION_DIRECTION, 'Which direction the interfaces should be ordered.')) - ->setAllowedValues(self::SUPPORTED_DIRECTION_OPTIONS) - ->setDefault(self::DIRECTION_ASCEND) - ->getOption(), - (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - /** - * @return array> - */ - private function getInterfaces(Tokens $tokens, int $implementsStart, int $implementsEnd): array - { - $interfaces = []; - $interfaceIndex = 0; - - for ($i = $implementsStart; $i <= $implementsEnd; ++$i) { - if ($tokens[$i]->equals(',')) { - ++$interfaceIndex; - $interfaces[$interfaceIndex] = []; - - continue; - } - - $interfaces[$interfaceIndex][] = $tokens[$i]; - } - - return $interfaces; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php deleted file mode 100644 index 4d3b6dd7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php +++ /dev/null @@ -1,226 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * case_sensitive?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * case_sensitive: bool - * } - */ -final class OrderedTraitsFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Trait `use` statements must be sorted alphabetically.', - [ - new CodeSample(" true, - ] - ), - ], - null, - 'Risky when depending on order of the imports.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(CT::T_USE_TRAIT); - } - - public function isRisky(): bool - { - return true; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($this->findUseStatementsGroups($tokens) as $uses) { - $this->sortUseStatements($tokens, $uses); - } - } - - /** - * @return iterable> - */ - private function findUseStatementsGroups(Tokens $tokens): iterable - { - $uses = []; - - for ($index = 1, $max = \count($tokens); $index < $max; ++$index) { - $token = $tokens[$index]; - - if ($token->isWhitespace() || $token->isComment()) { - continue; - } - - if (!$token->isGivenKind(CT::T_USE_TRAIT)) { - if (\count($uses) > 0) { - yield $uses; - - $uses = []; - } - - continue; - } - - $startIndex = $tokens->getNextNonWhitespace($tokens->getPrevMeaningfulToken($index)); - $endIndex = $tokens->getNextTokenOfKind($index, [';', '{']); - - if ($tokens[$endIndex]->equals('{')) { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $endIndex); - } - - $use = []; - - for ($i = $startIndex; $i <= $endIndex; ++$i) { - $use[] = $tokens[$i]; - } - - $uses[$startIndex] = Tokens::fromArray($use); - - $index = $endIndex; - } - } - - /** - * @param array $uses - */ - private function sortUseStatements(Tokens $tokens, array $uses): void - { - foreach ($uses as $use) { - $this->sortMultipleTraitsInStatement($use); - } - - $this->sort($tokens, $uses); - } - - private function sortMultipleTraitsInStatement(Tokens $use): void - { - $traits = []; - $indexOfName = null; - $name = []; - - for ($index = 0, $max = \count($use); $index < $max; ++$index) { - $token = $use[$index]; - - if ($token->isGivenKind([T_STRING, T_NS_SEPARATOR])) { - $name[] = $token; - - if (null === $indexOfName) { - $indexOfName = $index; - } - - continue; - } - - if ($token->equalsAny([',', ';', '{'])) { - $traits[$indexOfName] = Tokens::fromArray($name); - - $name = []; - $indexOfName = null; - } - - if ($token->equals('{')) { - $index = $use->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - } - } - - $this->sort($use, $traits); - } - - /** - * @param array $elements - */ - private function sort(Tokens $tokens, array $elements): void - { - $toTraitName = static function (Tokens $use): string { - $string = ''; - - foreach ($use as $token) { - if ($token->equalsAny([';', '{'])) { - break; - } - - if ($token->isGivenKind([T_NS_SEPARATOR, T_STRING])) { - $string .= $token->getContent(); - } - } - - return ltrim($string, '\\'); - }; - - $sortedElements = $elements; - uasort( - $sortedElements, - fn (Tokens $useA, Tokens $useB): int => true === $this->configuration['case_sensitive'] - ? $toTraitName($useA) <=> $toTraitName($useB) - : strcasecmp($toTraitName($useA), $toTraitName($useB)) - ); - - $sortedElements = array_combine( - array_keys($elements), - array_values($sortedElements) - ); - - $beforeOverrideCount = $tokens->count(); - - foreach (array_reverse($sortedElements, true) as $index => $tokensToInsert) { - $tokens->overrideRange( - $index, - $index + \count($elements[$index]) - 1, - $tokensToInsert - ); - } - - if ($beforeOverrideCount < $tokens->count()) { - $tokens->clearEmptyTokens(); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php deleted file mode 100644 index e70c6baa..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php +++ /dev/null @@ -1,453 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author John Paul E. Balandan, CPA - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * case_sensitive?: bool, - * null_adjustment?: 'always_first'|'always_last'|'none', - * sort_algorithm?: 'alpha'|'none' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * case_sensitive: bool, - * null_adjustment: 'always_first'|'always_last'|'none', - * sort_algorithm: 'alpha'|'none' - * } - */ -final class OrderedTypesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Sort union types and intersection types using configured order.', - [ - new CodeSample( - 'save($foo); -} catch (\RuntimeException|CacheException $e) { - logger($e); - - throw $e; -} -' - ), - new VersionSpecificCodeSample( - ' true, - ] - ), - new VersionSpecificCodeSample( - ' 'always_last'] - ), - new VersionSpecificCodeSample( - ' 'none', - 'null_adjustment' => 'always_last', - ] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before TypesSpacesFixer. - * Must run after NullableTypeDeclarationFixer, NullableTypeDeclarationForDefaultNullValueFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION]); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('sort_algorithm', 'Whether the types should be sorted alphabetically, or not sorted.')) - ->setAllowedValues(['alpha', 'none']) - ->setDefault('alpha') - ->getOption(), - (new FixerOptionBuilder('null_adjustment', 'Forces the position of `null` (overrides `sort_algorithm`).')) - ->setAllowedValues(['always_first', 'always_last', 'none']) - ->setDefault('always_first') - ->getOption(), - (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - foreach ($this->getElements($tokens) as $index => $type) { - if ('catch' === $type) { - $this->fixCatchArgumentType($tokens, $index); - - continue; - } - - if ('property' === $type) { - $this->fixPropertyType($tokens, $index); - - continue; - } - - $this->fixMethodArgumentType($functionsAnalyzer, $tokens, $index); - $this->fixMethodReturnType($functionsAnalyzer, $tokens, $index); - } - } - - /** - * @return array - * - * @phpstan-return array - */ - private function getElements(Tokens $tokens): array - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - $elements = array_map( - static fn (array $element): string => $element['type'], - array_filter( - $tokensAnalyzer->getClassyElements(), - static fn (array $element): bool => \in_array($element['type'], ['method', 'property'], true) - ) - ); - - foreach ($tokens as $index => $token) { - if ($token->isGivenKind(T_CATCH)) { - $elements[$index] = 'catch'; - - continue; - } - - if ( - $token->isGivenKind(T_FN) - || ($token->isGivenKind(T_FUNCTION) && !isset($elements[$index])) - ) { - $elements[$index] = 'method'; - } - } - - return $elements; - } - - private function collectTypeAnalysis(Tokens $tokens, int $startIndex, int $endIndex): ?TypeAnalysis - { - $type = ''; - $typeStartIndex = $tokens->getNextMeaningfulToken($startIndex); - $typeEndIndex = $typeStartIndex; - - for ($i = $typeStartIndex; $i < $endIndex; ++$i) { - if ($tokens[$i]->isWhitespace() || $tokens[$i]->isComment()) { - continue; - } - - $type .= $tokens[$i]->getContent(); - $typeEndIndex = $i; - } - - return '' !== $type ? new TypeAnalysis($type, $typeStartIndex, $typeEndIndex) : null; - } - - private function fixCatchArgumentType(Tokens $tokens, int $index): void - { - $catchStart = $tokens->getNextTokenOfKind($index, ['(']); - $catchEnd = $tokens->getNextTokenOfKind($catchStart, [')', [T_VARIABLE]]); - - $catchArgumentType = $this->collectTypeAnalysis($tokens, $catchStart, $catchEnd); - - if (null === $catchArgumentType || !$this->isTypeSortable($catchArgumentType)) { - return; // nothing to fix - } - - $this->sortTypes($catchArgumentType, $tokens); - } - - private function fixPropertyType(Tokens $tokens, int $index): void - { - $propertyIndex = $index; - $propertyModifiers = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_STATIC, T_VAR]; - - if (\defined('T_READONLY')) { - $propertyModifiers[] = T_READONLY; // @TODO drop condition when PHP 8.1 is supported - } - - do { - $index = $tokens->getPrevMeaningfulToken($index); - } while (!$tokens[$index]->isGivenKind($propertyModifiers)); - - $propertyType = $this->collectTypeAnalysis($tokens, $index, $propertyIndex); - - if (null === $propertyType || !$this->isTypeSortable($propertyType)) { - return; // nothing to fix - } - - $this->sortTypes($propertyType, $tokens); - } - - private function fixMethodArgumentType(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index): void - { - foreach ($functionsAnalyzer->getFunctionArguments($tokens, $index) as $argumentInfo) { - $argumentType = $argumentInfo->getTypeAnalysis(); - - if (null === $argumentType || !$this->isTypeSortable($argumentType)) { - continue; // nothing to fix - } - - $this->sortTypes($argumentType, $tokens); - } - } - - private function fixMethodReturnType(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index): void - { - $returnType = $functionsAnalyzer->getFunctionReturnType($tokens, $index); - - if (null === $returnType || !$this->isTypeSortable($returnType)) { - return; // nothing to fix - } - - $this->sortTypes($returnType, $tokens); - } - - private function sortTypes(TypeAnalysis $typeAnalysis, Tokens $tokens): void - { - $type = $typeAnalysis->getName(); - - if (str_contains($type, '|') && str_contains($type, '&')) { - // a DNF type of the form (A&B)|C, available as of PHP 8.2 - [$originalTypes, $glue] = $this->collectDisjunctiveNormalFormTypes($type); - } else { - [$originalTypes, $glue] = $this->collectUnionOrIntersectionTypes($type); - } - - // If the $types array is coming from a DNF type, then we have parts - // which are also array. If so, we sort those sub-types first before - // running the sorting algorithm to the entire $types array. - $sortedTypes = array_map(function ($subType) { - if (\is_array($subType)) { - return $this->runTypesThroughSortingAlgorithm($subType); - } - - return $subType; - }, $originalTypes); - - $sortedTypes = $this->runTypesThroughSortingAlgorithm($sortedTypes); - - if ($sortedTypes === $originalTypes) { - return; - } - - $tokens->overrideRange( - $typeAnalysis->getStartIndex(), - $typeAnalysis->getEndIndex(), - $this->createTypeDeclarationTokens($sortedTypes, $glue) - ); - } - - private function isTypeSortable(TypeAnalysis $type): bool - { - return str_contains($type->getName(), '|') || str_contains($type->getName(), '&'); - } - - /** - * @return array{0: list|string>, 1: string} - */ - private function collectDisjunctiveNormalFormTypes(string $type): array - { - $types = array_map(static function (string $subType) { - if (str_starts_with($subType, '(')) { - return explode('&', trim($subType, '()')); - } - - return $subType; - }, explode('|', $type)); - - return [$types, '|']; - } - - /** - * @return array{0: list, 1: string} - */ - private function collectUnionOrIntersectionTypes(string $type): array - { - $types = explode('|', $type); - $glue = '|'; - - if (1 === \count($types)) { - $types = explode('&', $type); - $glue = '&'; - } - - return [$types, $glue]; - } - - /** - * @param list|string> $types - * - * @return ($types is list ? list : list>) - */ - private function runTypesThroughSortingAlgorithm(array $types): array - { - $normalizeType = static fn (string $type): string => Preg::replace('/^\\\?/', '', $type); - - usort($types, function ($a, $b) use ($normalizeType): int { - if (\is_array($a)) { - $a = implode('&', $a); - } - - if (\is_array($b)) { - $b = implode('&', $b); - } - - $a = $normalizeType($a); - $b = $normalizeType($b); - $lowerCaseA = strtolower($a); - $lowerCaseB = strtolower($b); - - if ('none' !== $this->configuration['null_adjustment']) { - if ('null' === $lowerCaseA && 'null' !== $lowerCaseB) { - return 'always_last' === $this->configuration['null_adjustment'] ? 1 : -1; - } - - if ('null' !== $lowerCaseA && 'null' === $lowerCaseB) { - return 'always_last' === $this->configuration['null_adjustment'] ? -1 : 1; - } - } - - if ('alpha' === $this->configuration['sort_algorithm']) { - return true === $this->configuration['case_sensitive'] ? $a <=> $b : strcasecmp($a, $b); - } - - return 0; - }); - - return $types; - } - - /** - * @param list|string> $types - * - * @return list - */ - private function createTypeDeclarationTokens(array $types, string $glue, bool $isDisjunctive = false): array - { - static $specialTypes = [ - 'array' => [CT::T_ARRAY_TYPEHINT, 'array'], - 'callable' => [T_CALLABLE, 'callable'], - 'static' => [T_STATIC, 'static'], - ]; - - static $glues = [ - '|' => [CT::T_TYPE_ALTERNATION, '|'], - '&' => [CT::T_TYPE_INTERSECTION, '&'], - ]; - - $count = \count($types); - $newTokens = []; - - foreach ($types as $i => $type) { - if (\is_array($type)) { - $newTokens = [ - ...$newTokens, - ...$this->createTypeDeclarationTokens($type, '&', true), - ]; - } elseif (isset($specialTypes[$type])) { - $newTokens[] = new Token($specialTypes[$type]); - } else { - foreach (explode('\\', $type) as $nsIndex => $value) { - if (0 === $nsIndex && '' === $value) { - continue; - } - - if ($nsIndex > 0) { - $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); - } - - $newTokens[] = new Token([T_STRING, $value]); - } - } - - if ($i <= $count - 2) { - $newTokens[] = new Token($glues[$glue]); - } - } - - if ($isDisjunctive) { - array_unshift($newTokens, new Token([CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, '('])); - $newTokens[] = new Token([CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, ')']); - } - - return $newTokens; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/PhpdocReadonlyClassCommentToKeywordFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/PhpdocReadonlyClassCommentToKeywordFixer.php deleted file mode 100644 index 78916047..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/PhpdocReadonlyClassCommentToKeywordFixer.php +++ /dev/null @@ -1,129 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Marcel Behrmann - */ -final class PhpdocReadonlyClassCommentToKeywordFixer extends AbstractFixer -{ - /** - * {@inheritdoc} - * - * Must run before NoEmptyPhpdocFixer, NoExtraBlankLinesFixer, PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 4; - } - - public function isCandidate(Tokens $tokens): bool - { - return \PHP_VERSION_ID >= 8_02_00 && $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - public function isRisky(): bool - { - return true; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Converts readonly comment on classes to the readonly keyword.', - [ - new VersionSpecificCodeSample( - << $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $doc = new DocBlock($token->getContent()); - - $annotations = $doc->getAnnotationsOfType('readonly'); - - if (0 === \count($annotations)) { - continue; - } - - foreach ($annotations as $annotation) { - $annotation->remove(); - } - - $mainIndex = $index; - $index = $tokens->getNextMeaningfulToken($index); - $addReadonly = true; - - while ($tokens[$index]->isGivenKind([ - T_ABSTRACT, - T_FINAL, - T_PRIVATE, - T_PUBLIC, - T_PROTECTED, - T_READONLY, - ])) { - if ($tokens[$index]->isGivenKind([T_READONLY])) { - $addReadonly = false; - } - - $index = $tokens->getNextMeaningfulToken($index); - } - - if (!$tokens[$index]->isGivenKind(T_CLASS)) { - continue; - } - - if ($addReadonly) { - $tokens->insertAt($index, [new Token([T_READONLY, 'readonly']), new Token([T_WHITESPACE, ' '])]); - } - - $newContent = $doc->getContent(); - - if ('' === $newContent) { - $tokens->clearTokenAndMergeSurroundingWhitespace($mainIndex); - - continue; - } - - $tokens[$mainIndex] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ProtectedToPrivateFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ProtectedToPrivateFixer.php deleted file mode 100644 index 27cc50c4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ProtectedToPrivateFixer.php +++ /dev/null @@ -1,168 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Filippo Tessarotto - */ -final class ProtectedToPrivateFixer extends AbstractFixer -{ - private TokensAnalyzer $tokensAnalyzer; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Converts `protected` variables and methods to `private` where possible.', - [ - new CodeSample( - 'isAllTokenKindsFound([T_ENUM, T_PROTECTED])) { // @TODO: drop condition when PHP 8.1+ is required - return true; - } - - return $tokens->isAllTokenKindsFound([T_CLASS, T_FINAL, T_PROTECTED]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->tokensAnalyzer = new TokensAnalyzer($tokens); - $modifierKinds = [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_FINAL, T_ABSTRACT, T_NS_SEPARATOR, T_STRING, CT::T_NULLABLE_TYPE, CT::T_ARRAY_TYPEHINT, T_STATIC, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $modifierKinds[] = T_READONLY; - } - - $classesCandidate = []; - $classElementTypes = ['method' => true, 'property' => true, 'const' => true]; - - foreach ($this->tokensAnalyzer->getClassyElements() as $index => $element) { - $classIndex = $element['classIndex']; - - $classesCandidate[$classIndex] ??= $this->isClassCandidate($tokens, $classIndex); - - if (false === $classesCandidate[$classIndex]) { - continue; - } - - if (!isset($classElementTypes[$element['type']])) { - continue; - } - - $previous = $index; - $isProtected = false; - $isFinal = false; - - do { - $previous = $tokens->getPrevMeaningfulToken($previous); - - if ($tokens[$previous]->isGivenKind(T_PROTECTED)) { - $isProtected = $previous; - } elseif ($tokens[$previous]->isGivenKind(T_FINAL)) { - $isFinal = $previous; - } - } while ($tokens[$previous]->isGivenKind($modifierKinds)); - - if (false === $isProtected) { - continue; - } - - if ($isFinal && 'const' === $element['type']) { - continue; // Final constants cannot be private - } - - $element['protected_index'] = $isProtected; - $tokens[$element['protected_index']] = new Token([T_PRIVATE, 'private']); - } - } - - /** - * Consider symbol as candidate for fixing if it's: - * - an Enum (PHP8.1+) - * - a class, which: - * - is not anonymous - * - is final - * - does not use traits - * - does not extend other class. - */ - private function isClassCandidate(Tokens $tokens, int $classIndex): bool - { - if (\defined('T_ENUM') && $tokens[$classIndex]->isGivenKind(T_ENUM)) { // @TODO: drop condition when PHP 8.1+ is required - return true; - } - - if (!$tokens[$classIndex]->isGivenKind(T_CLASS) || $this->tokensAnalyzer->isAnonymousClass($classIndex)) { - return false; - } - - $modifiers = $this->tokensAnalyzer->getClassyModifiers($classIndex); - - if (!isset($modifiers['final'])) { - return false; - } - - $classNameIndex = $tokens->getNextMeaningfulToken($classIndex); // move to class name as anonymous class is never "final" - $classExtendsIndex = $tokens->getNextMeaningfulToken($classNameIndex); // move to possible "extends" - - if ($tokens[$classExtendsIndex]->isGivenKind(T_EXTENDS)) { - return false; - } - - if (!$tokens->isTokenKindFound(CT::T_USE_TRAIT)) { - return true; // cheap test - } - - $classOpenIndex = $tokens->getNextTokenOfKind($classNameIndex, ['{']); - $classCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $classOpenIndex); - $useIndex = $tokens->getNextTokenOfKind($classOpenIndex, [[CT::T_USE_TRAIT]]); - - return null === $useIndex || $useIndex > $classCloseIndex; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php deleted file mode 100644 index 7150b6bb..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php +++ /dev/null @@ -1,200 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Gregor Harlan - */ -final class SelfAccessorFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Inside class or interface element `self` should be preferred to the class name itself.', - [ - new CodeSample( - 'isAnyTokenKindsFound([T_CLASS, T_INTERFACE]); - } - - /** - * {@inheritdoc} - * - * Must run after PsrAutoloadingFixer. - */ - public function getPriority(): int - { - return -11; - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - foreach ($tokens->getNamespaceDeclarations() as $namespace) { - for ($index = $namespace->getScopeStartIndex(); $index < $namespace->getScopeEndIndex(); ++$index) { - if (!$tokens[$index]->isGivenKind([T_CLASS, T_INTERFACE]) || $tokensAnalyzer->isAnonymousClass($index)) { - continue; - } - - $nameIndex = $tokens->getNextTokenOfKind($index, [[T_STRING]]); - $startIndex = $tokens->getNextTokenOfKind($nameIndex, ['{']); - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $startIndex); - - $name = $tokens[$nameIndex]->getContent(); - - $this->replaceNameOccurrences($tokens, $namespace->getFullName(), $name, $startIndex, $endIndex); - - $index = $endIndex; - } - } - } - - /** - * Replace occurrences of the name of the classy element by "self" (if possible). - */ - private function replaceNameOccurrences(Tokens $tokens, string $namespace, string $name, int $startIndex, int $endIndex): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - $insideMethodSignatureUntil = null; - - for ($i = $startIndex; $i < $endIndex; ++$i) { - if ($i === $insideMethodSignatureUntil) { - $insideMethodSignatureUntil = null; - } - - $token = $tokens[$i]; - - // skip anonymous classes - if ($token->isGivenKind(T_CLASS) && $tokensAnalyzer->isAnonymousClass($i)) { - $i = $tokens->getNextTokenOfKind($i, ['{']); - $i = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $i); - - continue; - } - - if ($token->isGivenKind(T_FN)) { - $i = $tokensAnalyzer->getLastTokenIndexOfArrowFunction($i); - $i = $tokens->getNextMeaningfulToken($i); - - continue; - } - - if ($token->isGivenKind(T_FUNCTION)) { - if ($tokensAnalyzer->isLambda($i)) { - $i = $tokens->getNextTokenOfKind($i, ['{']); - $i = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $i); - - continue; - } - - $i = $tokens->getNextTokenOfKind($i, ['(']); - $insideMethodSignatureUntil = $tokens->getNextTokenOfKind($i, ['{', ';']); - - continue; - } - - if (!$token->equals([T_STRING, $name], false)) { - continue; - } - - $nextToken = $tokens[$tokens->getNextMeaningfulToken($i)]; - if ($nextToken->isGivenKind(T_NS_SEPARATOR)) { - continue; - } - - $classStartIndex = $i; - $prevToken = $tokens[$tokens->getPrevMeaningfulToken($i)]; - if ($prevToken->isGivenKind(T_NS_SEPARATOR)) { - $classStartIndex = $this->getClassStart($tokens, $i, $namespace); - if (null === $classStartIndex) { - continue; - } - $prevToken = $tokens[$tokens->getPrevMeaningfulToken($classStartIndex)]; - } - if ($prevToken->isGivenKind(T_STRING) || $prevToken->isObjectOperator()) { - continue; - } - - if ( - $prevToken->isGivenKind([T_INSTANCEOF, T_NEW]) - || $nextToken->isGivenKind(T_PAAMAYIM_NEKUDOTAYIM) - || ( - null !== $insideMethodSignatureUntil - && $i < $insideMethodSignatureUntil - && $prevToken->equalsAny(['(', ',', [CT::T_NULLABLE_TYPE], [CT::T_TYPE_ALTERNATION], [CT::T_TYPE_COLON]]) - ) - ) { - for ($j = $classStartIndex; $j < $i; ++$j) { - $tokens->clearTokenAndMergeSurroundingWhitespace($j); - } - $tokens[$i] = new Token([T_STRING, 'self']); - } - } - } - - private function getClassStart(Tokens $tokens, int $index, string $namespace): ?int - { - $namespace = ('' !== $namespace ? '\\'.$namespace : '').'\\'; - - foreach (array_reverse(Preg::split('/(\\\)/', $namespace, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)) as $piece) { - $index = $tokens->getPrevMeaningfulToken($index); - if ('\\' === $piece) { - if (!$tokens[$index]->isGivenKind(T_NS_SEPARATOR)) { - return null; - } - } elseif (!$tokens[$index]->equals([T_STRING, $piece], false)) { - return null; - } - } - - return $index; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfStaticAccessorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfStaticAccessorFixer.php deleted file mode 100644 index 0bf56ab0..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfStaticAccessorFixer.php +++ /dev/null @@ -1,224 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -final class SelfStaticAccessorFixer extends AbstractFixer -{ - private TokensAnalyzer $tokensAnalyzer; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Inside an enum or `final`/anonymous class, `self` should be preferred over `static`.', - [ - new CodeSample( - 'isTokenKindFound(T_STATIC) - && $tokens->isAnyTokenKindsFound($classyTypes) - && $tokens->isAnyTokenKindsFound([T_DOUBLE_COLON, T_NEW, T_INSTANCEOF]); - } - - /** - * {@inheritdoc} - * - * Must run after FinalClassFixer, FinalInternalClassFixer, FunctionToConstantFixer, PhpUnitTestCaseStaticMethodCallsFixer. - */ - public function getPriority(): int - { - return -10; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $classyTokensOfInterest = [[T_CLASS]]; - - if (\defined('T_ENUM')) { - $classyTokensOfInterest[] = [T_ENUM]; // @TODO drop condition when PHP 8.1+ is required - } - - $this->tokensAnalyzer = new TokensAnalyzer($tokens); - $classyIndex = $tokens->getNextTokenOfKind(0, $classyTokensOfInterest); - - while (null !== $classyIndex) { - if ($tokens[$classyIndex]->isGivenKind(T_CLASS)) { - $modifiers = $this->tokensAnalyzer->getClassyModifiers($classyIndex); - - if ( - isset($modifiers['final']) - || $this->tokensAnalyzer->isAnonymousClass($classyIndex) - ) { - $classyIndex = $this->fixClassy($tokens, $classyIndex); - } - } else { - $classyIndex = $this->fixClassy($tokens, $classyIndex); - } - - $classyIndex = $tokens->getNextTokenOfKind($classyIndex, $classyTokensOfInterest); - } - } - - private function fixClassy(Tokens $tokens, int $index): int - { - $index = $tokens->getNextTokenOfKind($index, ['{']); - $classOpenCount = 1; - - while ($classOpenCount > 0) { - ++$index; - - if ($tokens[$index]->equals('{')) { - ++$classOpenCount; - - continue; - } - - if ($tokens[$index]->equals('}')) { - --$classOpenCount; - - continue; - } - - if ($tokens[$index]->isGivenKind(T_FUNCTION)) { - // do not fix inside lambda - if ($this->tokensAnalyzer->isLambda($index)) { - // figure out where the lambda starts - $index = $tokens->getNextTokenOfKind($index, ['{']); - $openCount = 1; - - do { - $index = $tokens->getNextTokenOfKind($index, ['}', '{', [T_CLASS]]); - if ($tokens[$index]->equals('}')) { - --$openCount; - } elseif ($tokens[$index]->equals('{')) { - ++$openCount; - } else { - $index = $this->fixClassy($tokens, $index); - } - } while ($openCount > 0); - } - - continue; - } - - if ($tokens[$index]->isGivenKind([T_NEW, T_INSTANCEOF])) { - $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->isGivenKind(T_STATIC)) { - $tokens[$index] = new Token([T_STRING, 'self']); - } - - continue; - } - - if (!$tokens[$index]->isGivenKind(T_STATIC)) { - continue; - } - - $staticIndex = $index; - $index = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$index]->isGivenKind(T_DOUBLE_COLON)) { - continue; - } - - $tokens[$staticIndex] = new Token([T_STRING, 'self']); - } - - return $index; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php deleted file mode 100644 index 5b1f781e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php +++ /dev/null @@ -1,241 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * Fixer for rules defined in PSR2 ¶4.2. - * - * @author Javier Spagnoletti - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * elements?: list<'const'|'property'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * elements: list<'const'|'property'> - * } - */ -final class SingleClassElementPerStatementFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); - } - - /** - * {@inheritdoc} - * - * Must run before ClassAttributesSeparationFixer. - */ - public function getPriority(): int - { - return 56; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There MUST NOT be more than one property or constant declared per statement.', - [ - new CodeSample( - ' ['property']] - ), - ] - ); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $analyzer = new TokensAnalyzer($tokens); - $elements = array_reverse($analyzer->getClassyElements(), true); - - foreach ($elements as $index => $element) { - if (!\in_array($element['type'], $this->configuration['elements'], true)) { - continue; // not in configuration - } - - $this->fixElement($tokens, $element['type'], $index); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $values = ['const', 'property']; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('elements', 'List of strings which element should be modified.')) - ->setDefault($values) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset($values)]) - ->getOption(), - ]); - } - - private function fixElement(Tokens $tokens, string $type, int $index): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - $repeatIndex = $index; - - while (true) { - $repeatIndex = $tokens->getNextMeaningfulToken($repeatIndex); - $repeatToken = $tokens[$repeatIndex]; - - if ($tokensAnalyzer->isArray($repeatIndex)) { - if ($repeatToken->isGivenKind(T_ARRAY)) { - $repeatIndex = $tokens->getNextTokenOfKind($repeatIndex, ['(']); - $repeatIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $repeatIndex); - } else { - $repeatIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $repeatIndex); - } - - continue; - } - - if ($repeatToken->equals(';')) { - return; // no repeating found, no fixing needed - } - - if ($repeatToken->equals(',')) { - break; - } - } - - $start = $tokens->getPrevTokenOfKind($index, [';', '{', '}']); - $this->expandElement( - $tokens, - $type, - $tokens->getNextMeaningfulToken($start), - $tokens->getNextTokenOfKind($index, [';']) - ); - } - - private function expandElement(Tokens $tokens, string $type, int $startIndex, int $endIndex): void - { - $divisionContent = null; - - if ($tokens[$startIndex - 1]->isWhitespace()) { - $divisionContent = $tokens[$startIndex - 1]->getContent(); - - if (Preg::match('#(\n|\r\n)#', $divisionContent, $matches)) { - $divisionContent = $matches[0].trim($divisionContent, "\r\n"); - } - } - - // iterate variables to split up - for ($i = $endIndex - 1; $i > $startIndex; --$i) { - $token = $tokens[$i]; - - if ($token->equals(')')) { - $i = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $i); - - continue; - } - - if ($token->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_CLOSE)) { - $i = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $i); - - continue; - } - - if (!$tokens[$i]->equals(',')) { - continue; - } - - $tokens[$i] = new Token(';'); - - if ($tokens[$i + 1]->isWhitespace()) { - $tokens->clearAt($i + 1); - } - - if (null !== $divisionContent && '' !== $divisionContent) { - $tokens->insertAt($i + 1, new Token([T_WHITESPACE, $divisionContent])); - } - - // collect modifiers - $sequence = $this->getModifiersSequences($tokens, $type, $startIndex, $endIndex); - $tokens->insertAt($i + 2, $sequence); - } - } - - /** - * @return list - */ - private function getModifiersSequences(Tokens $tokens, string $type, int $startIndex, int $endIndex): array - { - if ('property' === $type) { - $tokenKinds = [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_STATIC, T_VAR, T_STRING, T_NS_SEPARATOR, CT::T_NULLABLE_TYPE, CT::T_ARRAY_TYPEHINT, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $tokenKinds[] = T_READONLY; - } - } else { - $tokenKinds = [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_CONST]; - } - - $sequence = []; - - for ($i = $startIndex; $i < $endIndex - 1; ++$i) { - if ($tokens[$i]->isComment()) { - continue; - } - - if (!$tokens[$i]->isWhitespace() && !$tokens[$i]->isGivenKind($tokenKinds)) { - break; - } - - $sequence[] = clone $tokens[$i]; - } - - return $sequence; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php deleted file mode 100644 index 03eb845a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php +++ /dev/null @@ -1,116 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class SingleTraitInsertPerStatementFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Each trait `use` must be done as single statement.', - [ - new CodeSample( - 'isTokenKindFound(CT::T_USE_TRAIT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 1; 1 < $index; --$index) { - if ($tokens[$index]->isGivenKind(CT::T_USE_TRAIT)) { - $candidates = $this->getCandidates($tokens, $index); - if (\count($candidates) > 0) { - $this->fixTraitUse($tokens, $index, $candidates); - } - } - } - } - - /** - * @param list $candidates ',' indices to fix - */ - private function fixTraitUse(Tokens $tokens, int $useTraitIndex, array $candidates): void - { - foreach ($candidates as $commaIndex) { - $inserts = [ - new Token([CT::T_USE_TRAIT, 'use']), - new Token([T_WHITESPACE, ' ']), - ]; - - $nextImportStartIndex = $tokens->getNextMeaningfulToken($commaIndex); - - if ($tokens[$nextImportStartIndex - 1]->isWhitespace()) { - if (Preg::match('/\R/', $tokens[$nextImportStartIndex - 1]->getContent())) { - array_unshift($inserts, clone $tokens[$useTraitIndex - 1]); - } - $tokens->clearAt($nextImportStartIndex - 1); - } - - $tokens[$commaIndex] = new Token(';'); - $tokens->insertAt($nextImportStartIndex, $inserts); - } - } - - /** - * @return list - */ - private function getCandidates(Tokens $tokens, int $index): array - { - $indices = []; - $index = $tokens->getNextTokenOfKind($index, [',', ';', '{']); - - while (!$tokens[$index]->equals(';')) { - if ($tokens[$index]->equals('{')) { - return []; // do not fix use cases with grouping - } - - $indices[] = $index; - $index = $tokens->getNextTokenOfKind($index, [',', ';', '{']); - } - - return array_reverse($indices); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/VisibilityRequiredFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/VisibilityRequiredFixer.php deleted file mode 100644 index b85f4cf9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/VisibilityRequiredFixer.php +++ /dev/null @@ -1,212 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * Fixer for rules defined in PSR2 ¶4.3, ¶4.5. - * - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * elements?: list<'const'|'method'|'property'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * elements: list<'const'|'method'|'property'> - * } - */ -final class VisibilityRequiredFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Visibility MUST be declared on all properties and methods; `abstract` and `final` MUST be declared before the visibility; `static` MUST be declared after the visibility.', - [ - new CodeSample( - ' ['const']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before ClassAttributesSeparationFixer. - */ - public function getPriority(): int - { - return 56; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('elements', 'The structural elements to fix (PHP >= 7.1 required for `const`).')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset(['property', 'method', 'const'])]) - ->setDefault(['property', 'method', 'const']) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - $propertyTypeDeclarationKinds = [T_STRING, T_NS_SEPARATOR, CT::T_NULLABLE_TYPE, CT::T_ARRAY_TYPEHINT, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $propertyReadOnlyType = T_READONLY; - $propertyTypeDeclarationKinds[] = T_READONLY; - } else { - $propertyReadOnlyType = -999; - } - - $expectedKindsGeneric = [T_ABSTRACT, T_FINAL, T_PRIVATE, T_PROTECTED, T_PUBLIC, T_STATIC, T_VAR]; - $expectedKindsPropertyKinds = [...$expectedKindsGeneric, ...$propertyTypeDeclarationKinds]; - - foreach (array_reverse($tokensAnalyzer->getClassyElements(), true) as $index => $element) { - if (!\in_array($element['type'], $this->configuration['elements'], true)) { - continue; - } - - $abstractFinalIndex = null; - $visibilityIndex = null; - $staticIndex = null; - $typeIndex = null; - $readOnlyIndex = null; - $prevIndex = $tokens->getPrevMeaningfulToken($index); - $expectedKinds = 'property' === $element['type'] - ? $expectedKindsPropertyKinds - : $expectedKindsGeneric; - - while ($tokens[$prevIndex]->isGivenKind($expectedKinds)) { - if ($tokens[$prevIndex]->isGivenKind([T_ABSTRACT, T_FINAL])) { - $abstractFinalIndex = $prevIndex; - } elseif ($tokens[$prevIndex]->isGivenKind(T_STATIC)) { - $staticIndex = $prevIndex; - } elseif ($tokens[$prevIndex]->isGivenKind($propertyReadOnlyType)) { - $readOnlyIndex = $prevIndex; - } elseif ($tokens[$prevIndex]->isGivenKind($propertyTypeDeclarationKinds)) { - $typeIndex = $prevIndex; - } else { - $visibilityIndex = $prevIndex; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - } - - if (null !== $typeIndex) { - $index = $typeIndex; - } - - if ($tokens[$prevIndex]->equals(',')) { - continue; - } - - $swapIndex = $staticIndex ?? $readOnlyIndex; // "static" property cannot be "readonly", so there can always be at most one swap - - if (null !== $swapIndex) { - if ($this->isKeywordPlacedProperly($tokens, $swapIndex, $index)) { - $index = $swapIndex; - } else { - $this->moveTokenAndEnsureSingleSpaceFollows($tokens, $swapIndex, $index); - } - } - - if (null === $visibilityIndex) { - $tokens->insertAt($index, [new Token([T_PUBLIC, 'public']), new Token([T_WHITESPACE, ' '])]); - } else { - if ($tokens[$visibilityIndex]->isGivenKind(T_VAR)) { - $tokens[$visibilityIndex] = new Token([T_PUBLIC, 'public']); - } - if ($this->isKeywordPlacedProperly($tokens, $visibilityIndex, $index)) { - $index = $visibilityIndex; - } else { - $this->moveTokenAndEnsureSingleSpaceFollows($tokens, $visibilityIndex, $index); - } - } - - if (null === $abstractFinalIndex) { - continue; - } - - if ($this->isKeywordPlacedProperly($tokens, $abstractFinalIndex, $index)) { - continue; - } - - $this->moveTokenAndEnsureSingleSpaceFollows($tokens, $abstractFinalIndex, $index); - } - } - - private function isKeywordPlacedProperly(Tokens $tokens, int $keywordIndex, int $comparedIndex): bool - { - return $keywordIndex + 2 === $comparedIndex && ' ' === $tokens[$keywordIndex + 1]->getContent(); - } - - private function moveTokenAndEnsureSingleSpaceFollows(Tokens $tokens, int $fromIndex, int $toIndex): void - { - $tokens->insertAt($toIndex, [$tokens[$fromIndex], new Token([T_WHITESPACE, ' '])]); - $tokens->clearAt($fromIndex); - - if ($tokens[$fromIndex + 1]->isWhitespace()) { - $tokens->clearAt($fromIndex + 1); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassUsage/DateTimeImmutableFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassUsage/DateTimeImmutableFixer.php deleted file mode 100644 index 2add0308..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassUsage/DateTimeImmutableFixer.php +++ /dev/null @@ -1,146 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ClassUsage; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - */ -final class DateTimeImmutableFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Class `DateTimeImmutable` should be used instead of `DateTime`.', - [new CodeSample("isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - $functionMap = [ - 'date_create' => 'date_create_immutable', - 'date_create_from_format' => 'date_create_immutable_from_format', - ]; - - $isInNamespace = false; - $isImported = false; // e.g. use DateTime; - - for ($index = 0, $limit = $tokens->count(); $index < $limit; ++$index) { - $token = $tokens[$index]; - - if ($token->isGivenKind(T_NAMESPACE)) { - $isInNamespace = true; - - continue; - } - - if ($isInNamespace && $token->isGivenKind(T_USE)) { - $nextIndex = $tokens->getNextMeaningfulToken($index); - - if ('datetime' !== strtolower($tokens[$nextIndex]->getContent())) { - continue; - } - - $nextNextIndex = $tokens->getNextMeaningfulToken($nextIndex); - - if ($tokens[$nextNextIndex]->equals(';')) { - $isImported = true; - } - - $index = $nextNextIndex; - - continue; - } - - if (!$token->isGivenKind(T_STRING)) { - continue; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$prevIndex]->isGivenKind(T_FUNCTION)) { - continue; - } - - $lowercaseContent = strtolower($token->getContent()); - - if ('datetime' === $lowercaseContent) { - $this->fixClassUsage($tokens, $index, $isInNamespace, $isImported); - $limit = $tokens->count(); // update limit, as fixing class usage may insert new token - - continue; - } - - if (isset($functionMap[$lowercaseContent]) && $functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { - $tokens[$index] = new Token([T_STRING, $functionMap[$lowercaseContent]]); - } - } - } - - private function fixClassUsage(Tokens $tokens, int $index, bool $isInNamespace, bool $isImported): void - { - $nextIndex = $tokens->getNextMeaningfulToken($index); - if ($tokens[$nextIndex]->isGivenKind(T_DOUBLE_COLON)) { - $nextNextIndex = $tokens->getNextMeaningfulToken($nextIndex); - if ($tokens[$nextNextIndex]->isGivenKind(T_STRING)) { - $nextNextNextIndex = $tokens->getNextMeaningfulToken($nextNextIndex); - if (!$tokens[$nextNextNextIndex]->equals('(')) { - return; - } - } - } - - $isUsedAlone = false; // e.g. new DateTime(); - $isUsedWithLeadingBackslash = false; // e.g. new \DateTime(); - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR)) { - $prevPrevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - if (!$tokens[$prevPrevIndex]->isGivenKind(T_STRING)) { - $isUsedWithLeadingBackslash = true; - } - } elseif (!$tokens[$prevIndex]->isGivenKind(T_DOUBLE_COLON) && !$tokens[$prevIndex]->isObjectOperator()) { - $isUsedAlone = true; - } - - if ($isUsedWithLeadingBackslash || $isUsedAlone && ($isInNamespace && $isImported || !$isInNamespace)) { - $tokens[$index] = new Token([T_STRING, \DateTimeImmutable::class]); - if ($isInNamespace && $isUsedAlone) { - $tokens->insertAt($index, new Token([T_NS_SEPARATOR, '\\'])); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php deleted file mode 100644 index 770814b2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php +++ /dev/null @@ -1,230 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Comment; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\CommentsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Utils; - -/** - * @author Kuba Werłos - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * ignored_tags?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * ignored_tags: list - * } - */ -final class CommentToPhpdocFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var list - */ - private array $ignoredTags = []; - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_COMMENT); - } - - public function isRisky(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocArrayTypeFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. - * Must run after AlignMultilineCommentFixer. - */ - public function getPriority(): int - { - // Should be run before all other PHPDoc fixers - return 26; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Comments with annotation should be docblock when used on structural elements.', - [ - new CodeSample(" ['todo']]), - ], - null, - 'Risky as new docblocks might mean more, e.g. a Doctrine entity might have a new column in database.' - ); - } - - protected function configurePostNormalisation(): void - { - $this->ignoredTags = array_map( - static fn (string $tag): string => strtolower($tag), - $this->configuration['ignored_tags'] - ); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('ignored_tags', 'List of ignored tags.')) - ->setAllowedTypes(['string[]']) - ->setDefault([]) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $commentsAnalyzer = new CommentsAnalyzer(); - - for ($index = 0, $limit = \count($tokens); $index < $limit; ++$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_COMMENT)) { - continue; - } - - if ($commentsAnalyzer->isHeaderComment($tokens, $index)) { - continue; - } - - if (!$commentsAnalyzer->isBeforeStructuralElement($tokens, $index)) { - continue; - } - - $commentIndices = $commentsAnalyzer->getCommentBlockIndices($tokens, $index); - - if ($this->isCommentCandidate($tokens, $commentIndices)) { - $this->fixComment($tokens, $commentIndices); - } - - $index = max($commentIndices); - } - } - - /** - * @param list $indices - */ - private function isCommentCandidate(Tokens $tokens, array $indices): bool - { - return array_reduce( - $indices, - function (bool $carry, int $index) use ($tokens): bool { - if ($carry) { - return true; - } - if (!Preg::match('~(?:#|//|/\*+|\R(?:\s*\*)?)\s*\@([a-zA-Z0-9_\\\-]+)(?=\s|\(|$)~', $tokens[$index]->getContent(), $matches)) { - return false; - } - - return !\in_array(strtolower($matches[1]), $this->ignoredTags, true); - }, - false - ); - } - - /** - * @param non-empty-list $indices - */ - private function fixComment(Tokens $tokens, array $indices): void - { - if (1 === \count($indices)) { - $this->fixCommentSingleLine($tokens, $indices[0]); - } else { - $this->fixCommentMultiLine($tokens, $indices); - } - } - - private function fixCommentSingleLine(Tokens $tokens, int $index): void - { - $message = $this->getMessage($tokens[$index]->getContent()); - - if ('' !== trim(substr($message, 0, 1))) { - $message = ' '.$message; - } - - if ('' !== trim(substr($message, -1))) { - $message .= ' '; - } - - $tokens[$index] = new Token([T_DOC_COMMENT, '/**'.$message.'*/']); - } - - /** - * @param non-empty-list $indices - */ - private function fixCommentMultiLine(Tokens $tokens, array $indices): void - { - $startIndex = $indices[0]; - $indent = Utils::calculateTrailingWhitespaceIndent($tokens[$startIndex - 1]); - - $newContent = '/**'.$this->whitespacesConfig->getLineEnding(); - $count = max($indices); - - for ($index = $startIndex; $index <= $count; ++$index) { - if (!$tokens[$index]->isComment()) { - continue; - } - if (str_contains($tokens[$index]->getContent(), '*/')) { - return; - } - $message = $this->getMessage($tokens[$index]->getContent()); - if ('' !== trim(substr($message, 0, 1))) { - $message = ' '.$message; - } - $newContent .= $indent.' *'.$message.$this->whitespacesConfig->getLineEnding(); - } - - for ($index = $startIndex; $index <= $count; ++$index) { - $tokens->clearAt($index); - } - - $newContent .= $indent.' */'; - - $tokens->insertAt($startIndex, new Token([T_DOC_COMMENT, $newContent])); - } - - private function getMessage(string $content): string - { - if (str_starts_with($content, '#')) { - return substr($content, 1); - } - if (str_starts_with($content, '//')) { - return substr($content, 2); - } - - return rtrim(ltrim($content, '/*'), '*/'); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php deleted file mode 100644 index cdf0be00..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php +++ /dev/null @@ -1,457 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Comment; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Options; - -/** - * @author Antonio J. García Lagar - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * comment_type?: 'PHPDoc'|'comment', - * header: string, - * location?: 'after_declare_strict'|'after_open', - * separate?: 'both'|'bottom'|'none'|'top' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * comment_type: 'PHPDoc'|'comment', - * header: string, - * location: 'after_declare_strict'|'after_open', - * separate: 'both'|'bottom'|'none'|'top' - * } - */ -final class HeaderCommentFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const HEADER_PHPDOC = 'PHPDoc'; - - /** - * @internal - */ - public const HEADER_COMMENT = 'comment'; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Add, replace or remove header comment.', - [ - new CodeSample( - ' 'Made with love.', - ] - ), - new CodeSample( - ' 'Made with love.', - 'comment_type' => 'PHPDoc', - 'location' => 'after_open', - 'separate' => 'bottom', - ] - ), - new CodeSample( - ' 'Made with love.', - 'comment_type' => 'comment', - 'location' => 'after_declare_strict', - ] - ), - new CodeSample( - ' '', - ] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isMonolithicPhp() && !$tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO); - } - - /** - * {@inheritdoc} - * - * Must run before BlankLinesBeforeNamespaceFixer, SingleBlankLineBeforeNamespaceFixer, SingleLineCommentStyleFixer. - * Must run after DeclareStrictTypesFixer, NoBlankLinesAfterPhpdocFixer. - */ - public function getPriority(): int - { - // When this fixer is configured with ["separate" => "bottom", "comment_type" => "PHPDoc"] - // and the target file has no namespace or declare() construct, - // the fixed header comment gets trimmed by NoBlankLinesAfterPhpdocFixer if we run before it. - return -30; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $location = $this->configuration['location']; - $locationIndices = []; - - foreach (['after_open', 'after_declare_strict'] as $possibleLocation) { - $locationIndex = $this->findHeaderCommentInsertionIndex($tokens, $possibleLocation); - - if (!isset($locationIndices[$locationIndex]) || $possibleLocation === $location) { - $locationIndices[$locationIndex] = $possibleLocation; - } - } - - foreach ($locationIndices as $possibleLocation) { - // figure out where the comment should be placed - $headerNewIndex = $this->findHeaderCommentInsertionIndex($tokens, $possibleLocation); - - // check if there is already a comment - $headerCurrentIndex = $this->findHeaderCommentCurrentIndex($tokens, $headerNewIndex - 1); - - if (null === $headerCurrentIndex) { - if ('' === $this->configuration['header'] || $possibleLocation !== $location) { - continue; - } - - $this->insertHeader($tokens, $headerNewIndex); - - continue; - } - - $sameComment = $this->getHeaderAsComment() === $tokens[$headerCurrentIndex]->getContent(); - $expectedLocation = $possibleLocation === $location; - - if (!$sameComment || !$expectedLocation) { - if ($expectedLocation xor $sameComment) { - $this->removeHeader($tokens, $headerCurrentIndex); - } - - if ('' === $this->configuration['header']) { - continue; - } - - if ($possibleLocation === $location) { - $this->insertHeader($tokens, $headerNewIndex); - } - - continue; - } - - $this->fixWhiteSpaceAroundHeader($tokens, $headerCurrentIndex); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $fixerName = $this->getName(); - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('header', 'Proper header content.')) - ->setAllowedTypes(['string']) - ->setNormalizer(static function (Options $options, string $value) use ($fixerName): string { - if ('' === trim($value)) { - return ''; - } - - if (str_contains($value, '*/')) { - throw new InvalidFixerConfigurationException($fixerName, 'Cannot use \'*/\' in header.'); - } - - return $value; - }) - ->getOption(), - (new FixerOptionBuilder('comment_type', 'Comment syntax type.')) - ->setAllowedValues([self::HEADER_PHPDOC, self::HEADER_COMMENT]) - ->setDefault(self::HEADER_COMMENT) - ->getOption(), - (new FixerOptionBuilder('location', 'The location of the inserted header.')) - ->setAllowedValues(['after_open', 'after_declare_strict']) - ->setDefault('after_declare_strict') - ->getOption(), - (new FixerOptionBuilder('separate', 'Whether the header should be separated from the file content with a new line.')) - ->setAllowedValues(['both', 'top', 'bottom', 'none']) - ->setDefault('both') - ->getOption(), - ]); - } - - /** - * Enclose the given text in a comment block. - */ - private function getHeaderAsComment(): string - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - $comment = (self::HEADER_COMMENT === $this->configuration['comment_type'] ? '/*' : '/**').$lineEnding; - $lines = explode("\n", str_replace("\r", '', $this->configuration['header'])); - - foreach ($lines as $line) { - $comment .= rtrim(' * '.$line).$lineEnding; - } - - return $comment.' */'; - } - - private function findHeaderCommentCurrentIndex(Tokens $tokens, int $headerNewIndex): ?int - { - $index = $tokens->getNextNonWhitespace($headerNewIndex); - - if (null === $index || !$tokens[$index]->isComment()) { - return null; - } - - $next = $index + 1; - - if (!isset($tokens[$next]) || \in_array($this->configuration['separate'], ['top', 'none'], true) || !$tokens[$index]->isGivenKind(T_DOC_COMMENT)) { - return $index; - } - - if ($tokens[$next]->isWhitespace()) { - if (!Preg::match('/^\h*\R\h*$/D', $tokens[$next]->getContent())) { - return $index; - } - - ++$next; - } - - if (!isset($tokens[$next]) || !$tokens[$next]->isClassy() && !$tokens[$next]->isGivenKind(T_FUNCTION)) { - return $index; - } - - return $this->getHeaderAsComment() === $tokens[$index]->getContent() ? $index : null; - } - - /** - * Find the index where the header comment must be inserted. - */ - private function findHeaderCommentInsertionIndex(Tokens $tokens, string $location): int - { - $openTagIndex = $tokens[0]->isGivenKind(T_INLINE_HTML) ? 1 : 0; - - if ('after_open' === $location) { - return $openTagIndex + 1; - } - - $index = $tokens->getNextMeaningfulToken($openTagIndex); - - if (null === $index) { - return $openTagIndex + 1; // file without meaningful tokens but an open tag, comment should always be placed directly after the open tag - } - - if (!$tokens[$index]->isGivenKind(T_DECLARE)) { - return $openTagIndex + 1; - } - - $next = $tokens->getNextMeaningfulToken($index); - - if (null === $next || !$tokens[$next]->equals('(')) { - return $openTagIndex + 1; - } - - $next = $tokens->getNextMeaningfulToken($next); - - if (null === $next || !$tokens[$next]->equals([T_STRING, 'strict_types'], false)) { - return $openTagIndex + 1; - } - - $next = $tokens->getNextMeaningfulToken($next); - - if (null === $next || !$tokens[$next]->equals('=')) { - return $openTagIndex + 1; - } - - $next = $tokens->getNextMeaningfulToken($next); - - if (null === $next || !$tokens[$next]->isGivenKind(T_LNUMBER)) { - return $openTagIndex + 1; - } - - $next = $tokens->getNextMeaningfulToken($next); - - if (null === $next || !$tokens[$next]->equals(')')) { - return $openTagIndex + 1; - } - - $next = $tokens->getNextMeaningfulToken($next); - - if (null === $next || !$tokens[$next]->equals(';')) { // don't insert after close tag - return $openTagIndex + 1; - } - - return $next + 1; - } - - private function fixWhiteSpaceAroundHeader(Tokens $tokens, int $headerIndex): void - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - - // fix lines after header comment - if ( - ('both' === $this->configuration['separate'] || 'bottom' === $this->configuration['separate']) - && null !== $tokens->getNextMeaningfulToken($headerIndex) - ) { - $expectedLineCount = 2; - } else { - $expectedLineCount = 1; - } - - if ($headerIndex === \count($tokens) - 1) { - $tokens->insertAt($headerIndex + 1, new Token([T_WHITESPACE, str_repeat($lineEnding, $expectedLineCount)])); - } else { - $lineBreakCount = $this->getLineBreakCount($tokens, $headerIndex, 1); - - if ($lineBreakCount < $expectedLineCount) { - $missing = str_repeat($lineEnding, $expectedLineCount - $lineBreakCount); - - if ($tokens[$headerIndex + 1]->isWhitespace()) { - $tokens[$headerIndex + 1] = new Token([T_WHITESPACE, $missing.$tokens[$headerIndex + 1]->getContent()]); - } else { - $tokens->insertAt($headerIndex + 1, new Token([T_WHITESPACE, $missing])); - } - } elseif ($lineBreakCount > $expectedLineCount && $tokens[$headerIndex + 1]->isWhitespace()) { - $newLinesToRemove = $lineBreakCount - $expectedLineCount; - $tokens[$headerIndex + 1] = new Token([ - T_WHITESPACE, - Preg::replace("/^\\R{{$newLinesToRemove}}/", '', $tokens[$headerIndex + 1]->getContent()), - ]); - } - } - - // fix lines before header comment - $expectedLineCount = 'both' === $this->configuration['separate'] || 'top' === $this->configuration['separate'] ? 2 : 1; - $prev = $tokens->getPrevNonWhitespace($headerIndex); - - $regex = '/\h$/'; - - if ($tokens[$prev]->isGivenKind(T_OPEN_TAG) && Preg::match($regex, $tokens[$prev]->getContent())) { - $tokens[$prev] = new Token([T_OPEN_TAG, Preg::replace($regex, $lineEnding, $tokens[$prev]->getContent())]); - } - - $lineBreakCount = $this->getLineBreakCount($tokens, $headerIndex, -1); - - if ($lineBreakCount < $expectedLineCount) { - // because of the way the insert index was determined for header comment there cannot be an empty token here - $tokens->insertAt($headerIndex, new Token([T_WHITESPACE, str_repeat($lineEnding, $expectedLineCount - $lineBreakCount)])); - } - } - - private function getLineBreakCount(Tokens $tokens, int $index, int $direction): int - { - $whitespace = ''; - - for ($index += $direction; isset($tokens[$index]); $index += $direction) { - $token = $tokens[$index]; - - if ($token->isWhitespace()) { - $whitespace .= $token->getContent(); - - continue; - } - - if (-1 === $direction && $token->isGivenKind(T_OPEN_TAG)) { - $whitespace .= $token->getContent(); - } - - if ('' !== $token->getContent()) { - break; - } - } - - return substr_count($whitespace, "\n"); - } - - private function removeHeader(Tokens $tokens, int $index): void - { - $prevIndex = $index - 1; - $prevToken = $tokens[$prevIndex]; - $newlineRemoved = false; - - if ($prevToken->isWhitespace()) { - $content = $prevToken->getContent(); - - if (Preg::match('/\R/', $content)) { - $newlineRemoved = true; - } - - $content = Preg::replace('/\R?\h*$/', '', $content); - - $tokens->ensureWhitespaceAtIndex($prevIndex, 0, $content); - } - - $nextIndex = $index + 1; - $nextToken = $tokens[$nextIndex] ?? null; - - if (!$newlineRemoved && null !== $nextToken && $nextToken->isWhitespace()) { - $content = Preg::replace('/^\R/', '', $nextToken->getContent()); - - $tokens->ensureWhitespaceAtIndex($nextIndex, 0, $content); - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - - private function insertHeader(Tokens $tokens, int $index): void - { - $tokens->insertAt($index, new Token([self::HEADER_COMMENT === $this->configuration['comment_type'] ? T_COMMENT : T_DOC_COMMENT, $this->getHeaderAsComment()])); - $this->fixWhiteSpaceAroundHeader($tokens, $index); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php deleted file mode 100644 index 055c701b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php +++ /dev/null @@ -1,89 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Comment; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - */ -final class MultilineCommentOpeningClosingFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'DocBlocks must start with two asterisks, multiline comments must start with a single asterisk, after the opening slash. Both must end with a single asterisk before the closing slash.', - [ - new CodeSample( - <<<'EOT' - isAnyTokenKindsFound([T_COMMENT, T_DOC_COMMENT]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - $originalContent = $token->getContent(); - - if ( - !$token->isGivenKind(T_DOC_COMMENT) - && !($token->isGivenKind(T_COMMENT) && str_starts_with($originalContent, '/*')) - ) { - continue; - } - - $newContent = $originalContent; - - // Fix opening - if ($token->isGivenKind(T_COMMENT)) { - $newContent = Preg::replace('/^\/\*{2,}(?!\/)/', '/*', $newContent); - } - - // Fix closing - $newContent = Preg::replace('/(?getId(), $newContent]); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php deleted file mode 100644 index 23f0b1a3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php +++ /dev/null @@ -1,162 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Comment; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoEmptyCommentFixer extends AbstractFixer -{ - private const TYPE_HASH = 1; - - private const TYPE_DOUBLE_SLASH = 2; - - private const TYPE_SLASH_ASTERISK = 3; - - /** - * {@inheritdoc} - * - * Must run before NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer. - * Must run after PhpdocToCommentFixer. - */ - public function getPriority(): int - { - return 2; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should not be any empty comments.', - [new CodeSample("isTokenKindFound(T_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = 1, $count = \count($tokens); $index < $count; ++$index) { - if (!$tokens[$index]->isGivenKind(T_COMMENT)) { - continue; - } - - $blockInfo = $this->getCommentBlock($tokens, $index); - $blockStart = $blockInfo['blockStart']; - $index = $blockInfo['blockEnd']; - $isEmpty = $blockInfo['isEmpty']; - - if (false === $isEmpty) { - continue; - } - - for ($i = $blockStart; $i <= $index; ++$i) { - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - } - } - } - - /** - * Return the start index, end index and a flag stating if the comment block is empty. - * - * @param int $index T_COMMENT index - * - * @return array{blockStart: int, blockEnd: int, isEmpty: bool} - */ - private function getCommentBlock(Tokens $tokens, int $index): array - { - $commentType = $this->getCommentType($tokens[$index]->getContent()); - $empty = $this->isEmptyComment($tokens[$index]->getContent()); - - if (self::TYPE_SLASH_ASTERISK === $commentType) { - return [ - 'blockStart' => $index, - 'blockEnd' => $index, - 'isEmpty' => $empty, - ]; - } - - $start = $index; - $count = \count($tokens); - ++$index; - - for (; $index < $count; ++$index) { - if ($tokens[$index]->isComment()) { - if ($commentType !== $this->getCommentType($tokens[$index]->getContent())) { - break; - } - - if ($empty) { // don't retest if already known the block not being empty - $empty = $this->isEmptyComment($tokens[$index]->getContent()); - } - - continue; - } - - if (!$tokens[$index]->isWhitespace() || $this->getLineBreakCount($tokens, $index, $index + 1) > 1) { - break; - } - } - - return [ - 'blockStart' => $start, - 'blockEnd' => $index - 1, - 'isEmpty' => $empty, - ]; - } - - private function getCommentType(string $content): int - { - if (str_starts_with($content, '#')) { - return self::TYPE_HASH; - } - - if ('*' === $content[1]) { - return self::TYPE_SLASH_ASTERISK; - } - - return self::TYPE_DOUBLE_SLASH; - } - - private function getLineBreakCount(Tokens $tokens, int $whiteStart, int $whiteEnd): int - { - $lineCount = 0; - for ($i = $whiteStart; $i < $whiteEnd; ++$i) { - $lineCount += Preg::matchAll('/\R/u', $tokens[$i]->getContent(), $matches); - } - - return $lineCount; - } - - private function isEmptyComment(string $content): bool - { - static $mapper = [ - self::TYPE_HASH => '|^#\s*$|', // single line comment starting with '#' - self::TYPE_SLASH_ASTERISK => '|^/\*[\s\*]*\*+/$|', // comment starting with '/*' and ending with '*/' (but not a PHPDoc) - self::TYPE_DOUBLE_SLASH => '|^//\s*$|', // single line comment starting with '//' - ]; - - $type = $this->getCommentType($content); - - return Preg::match($mapper[$type], $content); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoTrailingWhitespaceInCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoTrailingWhitespaceInCommentFixer.php deleted file mode 100644 index d17a4495..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoTrailingWhitespaceInCommentFixer.php +++ /dev/null @@ -1,75 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Comment; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - */ -final class NoTrailingWhitespaceInCommentFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There MUST be no trailing spaces inside comment or PHPDoc.', - [new CodeSample('isAnyTokenKindsFound([T_COMMENT, T_DOC_COMMENT]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if ($token->isGivenKind(T_DOC_COMMENT)) { - $tokens[$index] = new Token([T_DOC_COMMENT, Preg::replace('/(*ANY)[\h]+$/m', '', $token->getContent())]); - - continue; - } - - if ($token->isGivenKind(T_COMMENT)) { - if (str_starts_with($token->getContent(), '/*')) { - $tokens[$index] = new Token([T_COMMENT, Preg::replace('/(*ANY)[\h]+$/m', '', $token->getContent())]); - } elseif (isset($tokens[$index + 1]) && $tokens[$index + 1]->isWhitespace()) { - $trimmedContent = ltrim($tokens[$index + 1]->getContent(), " \t"); - $tokens->ensureWhitespaceAtIndex($index + 1, 0, $trimmedContent); - } - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentSpacingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentSpacingFixer.php deleted file mode 100644 index 7b6931cc..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentSpacingFixer.php +++ /dev/null @@ -1,110 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Comment; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class SingleLineCommentSpacingFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Single-line comments must have proper spacing.', - [ - new CodeSample( - 'isTokenKindFound(T_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 1; 0 <= $index; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_COMMENT)) { - continue; - } - - $content = $token->getContent(); - $contentLength = \strlen($content); - - if ('/' === $content[0]) { - if ($contentLength < 3) { - continue; // cheap check for "//" - } - - if ('*' === $content[1]) { // slash asterisk comment - if ($contentLength < 5 || '*' === $content[2] || str_contains($content, "\n")) { - continue; // cheap check for "/**/", comment that looks like a PHPDoc, or multi line comment - } - - $newContent = rtrim(substr($content, 0, -2)).' '.substr($content, -2); - $newContent = $this->fixCommentLeadingSpace($newContent, '/*'); - } else { // double slash comment - $newContent = $this->fixCommentLeadingSpace($content, '//'); - } - } else { // hash comment - if ($contentLength < 2 || '[' === $content[1]) { // cheap check for "#" or annotation (like) comment - continue; - } - - $newContent = $this->fixCommentLeadingSpace($content, '#'); - } - - if ($newContent !== $content) { - $tokens[$index] = new Token([T_COMMENT, $newContent]); - } - } - } - - // fix space between comment open and leading text - private function fixCommentLeadingSpace(string $content, string $prefix): string - { - if (Preg::match(\sprintf('@^%s\h+.*$@', preg_quote($prefix, '@')), $content)) { - return $content; - } - - $position = \strlen($prefix); - - return substr($content, 0, $position).' '.substr($content, $position); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php deleted file mode 100644 index e4261fc9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php +++ /dev/null @@ -1,178 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Comment; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * comment_types?: list<'asterisk'|'hash'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * comment_types: list<'asterisk'|'hash'> - * } - */ -final class SingleLineCommentStyleFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private bool $asteriskEnabled; - - private bool $hashEnabled; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Single-line comments and multi-line comments with only one line of actual content should use the `//` syntax.', - [ - new CodeSample( - ' ['asterisk']] - ), - new CodeSample( - " ['hash']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after HeaderCommentFixer, NoUselessReturnFixer, PhpdocToCommentFixer. - */ - public function getPriority(): int - { - return -31; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_COMMENT); - } - - protected function configurePostNormalisation(): void - { - $this->asteriskEnabled = \in_array('asterisk', $this->configuration['comment_types'], true); - $this->hashEnabled = \in_array('hash', $this->configuration['comment_types'], true); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_COMMENT)) { - continue; - } - - $content = $token->getContent(); - - /** @TODO PHP 8.0 - no more need for `?: ''` */ - $commentContent = substr($content, 2, -2) ?: ''; // @phpstan-ignore-line - - if ($this->hashEnabled && str_starts_with($content, '#')) { - if (isset($content[1]) && '[' === $content[1]) { - continue; // This might be an attribute on PHP8, do not change - } - - $tokens[$index] = new Token([$token->getId(), '//'.substr($content, 1)]); - - continue; - } - - if ( - !$this->asteriskEnabled - || str_contains($commentContent, '?>') - || !str_starts_with($content, '/*') - || Preg::match('/[^\s\*].*\R.*[^\s\*]/s', $commentContent) - ) { - continue; - } - - $nextTokenIndex = $index + 1; - if (isset($tokens[$nextTokenIndex])) { - $nextToken = $tokens[$nextTokenIndex]; - if (!$nextToken->isWhitespace() || !Preg::match('/\R/', $nextToken->getContent())) { - continue; - } - - $tokens[$nextTokenIndex] = new Token([$nextToken->getId(), ltrim($nextToken->getContent(), " \t")]); - } - - $content = '//'; - if (Preg::match('/[^\s\*]/', $commentContent)) { - $content = '// '.Preg::replace('/[\s\*]*([^\s\*](?:.+[^\s\*])?)[\s\*]*/', '\1', $commentContent); - } - $tokens[$index] = new Token([$token->getId(), $content]); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('comment_types', 'List of comment types to fix.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset(['asterisk', 'hash'])]) - ->setDefault(['asterisk', 'hash']) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerInterface.php deleted file mode 100644 index 443141c3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerInterface.php +++ /dev/null @@ -1,50 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer; - -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; - -/** - * @author Dariusz Rumiński - * - * @template TFixerInputConfig of array - * @template TFixerComputedConfig of array - */ -interface ConfigurableFixerInterface extends FixerInterface -{ - /** - * Set configuration. - * - * New configuration must override current one, not patch it. - * Using empty array makes fixer to use default configuration - * (or reset configuration from previously configured back to default one). - * - * Some fixers may have no configuration, then - simply don't implement this interface. - * Other ones may have configuration that will change behavior of fixer, - * eg `php_unit_strict` fixer allows to configure which methods should be fixed. - * Finally, some fixers need configuration to work, eg `header_comment`. - * - * @param TFixerInputConfig $configuration configuration depends on Fixer - * - * @throws InvalidFixerConfigurationException - */ - public function configure(array $configuration): void; - - /** - * Defines the available configuration options of the fixer. - */ - public function getConfigurationDefinition(): FixerConfigurationResolverInterface; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerTrait.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerTrait.php deleted file mode 100644 index b0120994..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerTrait.php +++ /dev/null @@ -1,124 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer; - -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; -use PhpCsFixer\ConfigurationException\InvalidForEnvFixerConfigurationException; -use PhpCsFixer\ConfigurationException\RequiredFixerConfigurationException; -use PhpCsFixer\Console\Application; -use PhpCsFixer\FixerConfiguration\DeprecatedFixerOption; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\InvalidOptionsForEnvException; -use PhpCsFixer\Utils; -use Symfony\Component\OptionsResolver\Exception\ExceptionInterface; -use Symfony\Component\OptionsResolver\Exception\MissingOptionsException; - -/** - * @author Dariusz Rumiński - * - * @internal - * - * @template TFixerInputConfig of array - * @template TFixerComputedConfig of array - */ -trait ConfigurableFixerTrait -{ - /** - * @var null|TFixerComputedConfig - */ - protected ?array $configuration = null; - - private ?FixerConfigurationResolverInterface $configurationDefinition = null; - - /** - * @param TFixerInputConfig $configuration - */ - final public function configure(array $configuration): void - { - $this->configurePreNormalisation($configuration); - - foreach ($this->getConfigurationDefinition()->getOptions() as $option) { - if (!$option instanceof DeprecatedFixerOption) { - continue; - } - - $name = $option->getName(); - if (\array_key_exists($name, $configuration)) { - Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( - 'Option "%s" for rule "%s" is deprecated and will be removed in version %d.0. %s', - $name, - $this->getName(), - Application::getMajorVersion() + 1, - str_replace('`', '"', $option->getDeprecationMessage()) - ))); - } - } - - try { - $this->configuration = $this->getConfigurationDefinition()->resolve($configuration); // @phpstan-ignore-line ->configuration typehint is autogenerated base on ConfigurationDefinition - } catch (MissingOptionsException $exception) { - throw new RequiredFixerConfigurationException( - $this->getName(), - \sprintf('Missing required configuration: %s', $exception->getMessage()), - $exception - ); - } catch (InvalidOptionsForEnvException $exception) { - throw new InvalidForEnvFixerConfigurationException( - $this->getName(), - \sprintf('Invalid configuration for env: %s', $exception->getMessage()), - $exception - ); - } catch (ExceptionInterface $exception) { - throw new InvalidFixerConfigurationException( - $this->getName(), - \sprintf('Invalid configuration: %s', $exception->getMessage()), - $exception - ); - } - - $this->configurePostNormalisation(); - } - - final public function getConfigurationDefinition(): FixerConfigurationResolverInterface - { - if (null === $this->configurationDefinition) { - $this->configurationDefinition = $this->createConfigurationDefinition(); - } - - return $this->configurationDefinition; - } - - abstract public function getName(): string; - - /** - * One can override me. - * - * @param TFixerInputConfig $configuration - */ - protected function configurePreNormalisation(array &$configuration): void - { - // 🤔 ideally this method won't be needed, maybe we can remove it over time - } - - /** - * One can override me. - */ - protected function configurePostNormalisation(): void - { - // 🤔 ideally this method won't be needed, maybe we can remove it over time - } - - abstract protected function createConfigurationDefinition(): FixerConfigurationResolverInterface; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php deleted file mode 100644 index 7b53770b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php +++ /dev/null @@ -1,307 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ConstantNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * @author Filippo Tessarotto - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * exclude?: list, - * fix_built_in?: bool, - * include?: list, - * scope?: 'all'|'namespaced', - * strict?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * exclude: list, - * fix_built_in: bool, - * include: list, - * scope: 'all'|'namespaced', - * strict: bool - * } - */ -final class NativeConstantInvocationFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var array - */ - private array $constantsToEscape = []; - - /** - * @var array - */ - private array $caseInsensitiveConstantsToEscape = []; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Add leading `\` before constant invocation of internal constant to speed up resolving. Constant name match is case-sensitive, except for `null`, `false` and `true`.', - [ - new CodeSample(" 'namespaced'] - ), - new CodeSample( - " [ - 'MY_CUSTOM_PI', - ], - ] - ), - new CodeSample( - " false, - 'include' => [ - 'MY_CUSTOM_PI', - ], - ] - ), - new CodeSample( - " [ - 'M_PI', - ], - ] - ), - ], - null, - 'Risky when any of the constants are namespaced or overridden.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before GlobalNamespaceImportFixer. - * Must run after FunctionToConstantFixer. - */ - public function getPriority(): int - { - return 1; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - $uniqueConfiguredExclude = array_unique($this->configuration['exclude']); - - // Case-sensitive constants handling - $constantsToEscape = array_values($this->configuration['include']); - - if (true === $this->configuration['fix_built_in']) { - $getDefinedConstants = get_defined_constants(true); - unset($getDefinedConstants['user']); - foreach ($getDefinedConstants as $constants) { - $constantsToEscape = [...$constantsToEscape, ...array_keys($constants)]; - } - } - - /** @var list */ - $constantsToEscape = array_diff( - array_unique($constantsToEscape), - $uniqueConfiguredExclude - ); - - // Case-insensitive constants handling - static $caseInsensitiveConstants = ['null', 'false', 'true']; - $caseInsensitiveConstantsToEscape = []; - - foreach ($constantsToEscape as $constantIndex => $constant) { - $loweredConstant = strtolower($constant); - if (\in_array($loweredConstant, $caseInsensitiveConstants, true)) { - $caseInsensitiveConstantsToEscape[] = $loweredConstant; - unset($constantsToEscape[$constantIndex]); - } - } - - $caseInsensitiveConstantsToEscape = array_diff( - array_unique($caseInsensitiveConstantsToEscape), - array_map( - static fn (string $function): string => strtolower($function), - $uniqueConfiguredExclude, - ), - ); - - // Store the cache - $this->constantsToEscape = array_fill_keys($constantsToEscape, true); - ksort($this->constantsToEscape); - - $this->caseInsensitiveConstantsToEscape = array_fill_keys($caseInsensitiveConstantsToEscape, true); - ksort($this->caseInsensitiveConstantsToEscape); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if ('all' === $this->configuration['scope']) { - $this->fixConstantInvocations($tokens, 0, \count($tokens) - 1); - - return; - } - - $namespaces = $tokens->getNamespaceDeclarations(); - - // 'scope' is 'namespaced' here - /** @var NamespaceAnalysis $namespace */ - foreach (array_reverse($namespaces) as $namespace) { - if ($namespace->isGlobalNamespace()) { - continue; - } - - $this->fixConstantInvocations($tokens, $namespace->getScopeStartIndex(), $namespace->getScopeEndIndex()); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $constantChecker = static function (array $value): bool { - foreach ($value as $constantName) { - if (trim($constantName) !== $constantName) { - throw new InvalidOptionsException(\sprintf( - 'Each element must be a non-empty, trimmed string, got "%s" instead.', - get_debug_type($constantName) - )); - } - } - - return true; - }; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('fix_built_in', 'Whether to fix constants returned by `get_defined_constants`. User constants are not accounted in this list and must be specified in the include one.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('include', 'List of additional constants to fix.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([$constantChecker]) - ->setDefault([]) - ->getOption(), - (new FixerOptionBuilder('exclude', 'List of constants to ignore.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([$constantChecker]) - ->setDefault(['null', 'false', 'true']) - ->getOption(), - (new FixerOptionBuilder('scope', 'Only fix constant invocations that are made within a namespace or fix all.')) - ->setAllowedValues(['all', 'namespaced']) - ->setDefault('all') - ->getOption(), - (new FixerOptionBuilder('strict', 'Whether leading `\` of constant invocation not meant to have it should be removed.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - private function fixConstantInvocations(Tokens $tokens, int $startIndex, int $endIndex): void - { - $useDeclarations = (new NamespaceUsesAnalyzer())->getDeclarationsFromTokens($tokens); - $useConstantDeclarations = []; - - foreach ($useDeclarations as $use) { - if ($use->isConstant()) { - $useConstantDeclarations[$use->getShortName()] = true; - } - } - - $tokenAnalyzer = new TokensAnalyzer($tokens); - - for ($index = $endIndex; $index > $startIndex; --$index) { - $token = $tokens[$index]; - - // test if we are at a constant call - if (!$token->isGivenKind(T_STRING)) { - continue; - } - - if (!$tokenAnalyzer->isConstantInvocation($index)) { - continue; - } - - $tokenContent = $token->getContent(); - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if (!isset($this->constantsToEscape[$tokenContent]) && !isset($this->caseInsensitiveConstantsToEscape[strtolower($tokenContent)])) { - if (false === $this->configuration['strict']) { - continue; - } - - if (!$tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR)) { - continue; - } - - $prevPrevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - - if ($tokens[$prevPrevIndex]->isGivenKind(T_STRING)) { - continue; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($prevIndex); - - continue; - } - - if (isset($useConstantDeclarations[$tokenContent])) { - continue; - } - - if ($tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR)) { - continue; - } - - $tokens->insertAt($index, new Token([T_NS_SEPARATOR, '\\'])); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureBracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureBracesFixer.php deleted file mode 100644 index f89d959a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureBracesFixer.php +++ /dev/null @@ -1,256 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\AlternativeSyntaxAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class ControlStructureBracesFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'The body of each control structure MUST be enclosed within braces.', - [new CodeSample("getControlTokens(); - - for ($index = $tokens->count() - 1; 0 <= $index; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind($controlTokens)) { - continue; - } - - if ( - $token->isGivenKind(T_ELSE) - && $tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(T_IF) - ) { - continue; - } - - $parenthesisEndIndex = $this->findParenthesisEnd($tokens, $index); - $nextAfterParenthesisEndIndex = $tokens->getNextMeaningfulToken($parenthesisEndIndex); - $tokenAfterParenthesis = $tokens[$nextAfterParenthesisEndIndex]; - - if ($tokenAfterParenthesis->equalsAny([';', '{', ':', [T_CLOSE_TAG]])) { - continue; - } - - $statementEndIndex = null; - - if ($tokenAfterParenthesis->isGivenKind([T_IF, T_FOR, T_FOREACH, T_SWITCH, T_WHILE])) { - $tokenAfterParenthesisBlockEnd = $tokens->findBlockEnd( // go to ')' - Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, - $tokens->getNextMeaningfulToken($nextAfterParenthesisEndIndex) - ); - - if ($tokens[$tokens->getNextMeaningfulToken($tokenAfterParenthesisBlockEnd)]->equals(':')) { - $statementEndIndex = $alternativeSyntaxAnalyzer->findAlternativeSyntaxBlockEnd($tokens, $nextAfterParenthesisEndIndex); - - $tokenAfterStatementEndIndex = $tokens->getNextMeaningfulToken($statementEndIndex); - if ($tokens[$tokenAfterStatementEndIndex]->equals(';')) { - $statementEndIndex = $tokenAfterStatementEndIndex; - } - } - } - - if (null === $statementEndIndex) { - $statementEndIndex = $this->findStatementEnd($tokens, $parenthesisEndIndex); - } - - $tokensToInsertAfterStatement = [ - new Token([T_WHITESPACE, ' ']), - new Token('}'), - ]; - - if (!$tokens[$statementEndIndex]->equalsAny([';', '}'])) { - array_unshift($tokensToInsertAfterStatement, new Token(';')); - } - - $tokens->insertSlices([$statementEndIndex + 1 => $tokensToInsertAfterStatement]); - - // insert opening brace - $tokens->insertSlices([$parenthesisEndIndex + 1 => [ - new Token([T_WHITESPACE, ' ']), - new Token('{'), - ]]); - } - } - - private function findParenthesisEnd(Tokens $tokens, int $structureTokenIndex): int - { - $nextIndex = $tokens->getNextMeaningfulToken($structureTokenIndex); - $nextToken = $tokens[$nextIndex]; - - if (!$nextToken->equals('(')) { - return $structureTokenIndex; - } - - return $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $nextIndex); - } - - private function findStatementEnd(Tokens $tokens, int $parenthesisEndIndex): int - { - $nextIndex = $tokens->getNextMeaningfulToken($parenthesisEndIndex); - if (null === $nextIndex) { - return $parenthesisEndIndex; - } - - $nextToken = $tokens[$nextIndex]; - - if ($nextToken->equals('{')) { - return $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $nextIndex); - } - - if ($nextToken->isGivenKind($this->getControlTokens())) { - $parenthesisEndIndex = $this->findParenthesisEnd($tokens, $nextIndex); - - $endIndex = $this->findStatementEnd($tokens, $parenthesisEndIndex); - - if ($nextToken->isGivenKind([T_IF, T_TRY, T_DO])) { - $openingTokenKind = $nextToken->getId(); - - while (true) { - $nextIndex = $tokens->getNextMeaningfulToken($endIndex); - if (null !== $nextIndex && $tokens[$nextIndex]->isGivenKind($this->getControlContinuationTokensForOpeningToken($openingTokenKind))) { - $parenthesisEndIndex = $this->findParenthesisEnd($tokens, $nextIndex); - - $endIndex = $this->findStatementEnd($tokens, $parenthesisEndIndex); - - if ($tokens[$nextIndex]->isGivenKind($this->getFinalControlContinuationTokensForOpeningToken($openingTokenKind))) { - return $endIndex; - } - } else { - break; - } - } - } - - return $endIndex; - } - - $index = $parenthesisEndIndex; - - while (true) { - $token = $tokens[++$index]; - - // if there is some block in statement (eg lambda function) we need to skip it - if ($token->equals('{')) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - - continue; - } - - if ($token->equals(';')) { - return $index; - } - - if ($token->isGivenKind(T_CLOSE_TAG)) { - return $tokens->getPrevNonWhitespace($index); - } - } - } - - /** - * @return list - */ - private function getControlTokens(): array - { - static $tokens = [ - T_DECLARE, - T_DO, - T_ELSE, - T_ELSEIF, - T_FINALLY, - T_FOR, - T_FOREACH, - T_IF, - T_WHILE, - T_TRY, - T_CATCH, - T_SWITCH, - ]; - - return $tokens; - } - - /** - * @return list - */ - private function getControlContinuationTokensForOpeningToken(int $openingTokenKind): array - { - if (T_IF === $openingTokenKind) { - return [ - T_ELSE, - T_ELSEIF, - ]; - } - - if (T_DO === $openingTokenKind) { - return [T_WHILE]; - } - - if (T_TRY === $openingTokenKind) { - return [ - T_CATCH, - T_FINALLY, - ]; - } - - return []; - } - - /** - * @return list - */ - private function getFinalControlContinuationTokensForOpeningToken(int $openingTokenKind): array - { - if (T_IF === $openingTokenKind) { - return [T_ELSE]; - } - - if (T_TRY === $openingTokenKind) { - return [T_FINALLY]; - } - - return []; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureContinuationPositionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureContinuationPositionFixer.php deleted file mode 100644 index 95639763..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureContinuationPositionFixer.php +++ /dev/null @@ -1,157 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * position?: 'next_line'|'same_line' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * position: 'next_line'|'same_line' - * } - */ -final class ControlStructureContinuationPositionFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const NEXT_LINE = 'next_line'; - - /** - * @internal - */ - public const SAME_LINE = 'same_line'; - - private const CONTROL_CONTINUATION_TOKENS = [ - T_CATCH, - T_ELSE, - T_ELSEIF, - T_FINALLY, - T_WHILE, - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Control structure continuation keyword must be on the configured line.', - [ - new CodeSample( - ' self::NEXT_LINE] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(self::CONTROL_CONTINUATION_TOKENS); - } - - /** - * {@inheritdoc} - * - * Must run after ControlStructureBracesFixer. - */ - public function getPriority(): int - { - return parent::getPriority(); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('position', 'The position of the keyword that continues the control structure.')) - ->setAllowedValues([self::NEXT_LINE, self::SAME_LINE]) - ->setDefault(self::SAME_LINE) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->fixControlContinuationBraces($tokens); - } - - private function fixControlContinuationBraces(Tokens $tokens): void - { - for ($index = \count($tokens) - 1; 0 < $index; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(self::CONTROL_CONTINUATION_TOKENS)) { - continue; - } - - $prevIndex = $tokens->getPrevNonWhitespace($index); - $prevToken = $tokens[$prevIndex]; - - if (!$prevToken->equals('}')) { - continue; - } - - if ($token->isGivenKind(T_WHILE)) { - $prevIndex = $tokens->getPrevMeaningfulToken( - $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $prevIndex) - ); - - if (!$tokens[$prevIndex]->isGivenKind(T_DO)) { - continue; - } - } - - $tokens->ensureWhitespaceAtIndex( - $index - 1, - 1, - self::NEXT_LINE === $this->configuration['position'] ? - $this->whitespacesConfig->getLineEnding().WhitespacesAnalyzer::detectIndent($tokens, $index) - : ' ' - ); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ElseifFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ElseifFixer.php deleted file mode 100644 index 19c810ec..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ElseifFixer.php +++ /dev/null @@ -1,98 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶5.1. - * - * @author Dariusz Rumiński - */ -final class ElseifFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'The keyword `elseif` should be used instead of `else if` so that all control keywords look like single words.', - [new CodeSample("isAllTokenKindsFound([T_IF, T_ELSE]); - } - - /** - * Replace all `else if` (T_ELSE T_IF) with `elseif` (T_ELSEIF). - * - * {@inheritdoc} - */ - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_ELSE)) { - continue; - } - - $ifTokenIndex = $tokens->getNextMeaningfulToken($index); - - // if next meaningful token is not T_IF - continue searching, this is not the case for fixing - if (!$tokens[$ifTokenIndex]->isGivenKind(T_IF)) { - continue; - } - - // if next meaningful token is T_IF, but uses an alternative syntax - this is not the case for fixing neither - $conditionEndBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $tokens->getNextMeaningfulToken($ifTokenIndex)); - $afterConditionIndex = $tokens->getNextMeaningfulToken($conditionEndBraceIndex); - if ($tokens[$afterConditionIndex]->equals(':')) { - continue; - } - - // now we have T_ELSE following by T_IF with no alternative syntax so we could fix this - // 1. clear whitespaces between T_ELSE and T_IF - $tokens->clearAt($index + 1); - - // 2. change token from T_ELSE into T_ELSEIF - $tokens[$index] = new Token([T_ELSEIF, 'elseif']); - - // 3. clear succeeding T_IF - $tokens->clearAt($ifTokenIndex); - - $beforeIfTokenIndex = $tokens->getPrevNonWhitespace($ifTokenIndex); - - // 4. clear extra whitespace after T_IF in T_COMMENT,T_WHITESPACE?,T_IF,T_WHITESPACE sequence - if ($tokens[$beforeIfTokenIndex]->isComment() && $tokens[$ifTokenIndex + 1]->isWhitespace()) { - $tokens->clearAt($ifTokenIndex + 1); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopBodyFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopBodyFixer.php deleted file mode 100644 index 03f6a905..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopBodyFixer.php +++ /dev/null @@ -1,139 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * style?: 'braces'|'semicolon' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * style: 'braces'|'semicolon' - * } - */ -final class EmptyLoopBodyFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const STYLE_BRACES = 'braces'; - - private const STYLE_SEMICOLON = 'semicolon'; - - private const TOKEN_LOOP_KINDS = [T_FOR, T_FOREACH, T_WHILE]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Empty loop-body must be in configured style.', - [ - new CodeSample(" 'braces', - ] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before BracesFixer, NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer. - * Must run after NoEmptyStatementFixer. - */ - public function getPriority(): int - { - return 39; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(self::TOKEN_LOOP_KINDS); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if (self::STYLE_BRACES === $this->configuration['style']) { - $analyzer = new TokensAnalyzer($tokens); - $fixLoop = static function (int $index, int $endIndex) use ($tokens, $analyzer): void { - if ($tokens[$index]->isGivenKind(T_WHILE) && $analyzer->isWhilePartOfDoWhile($index)) { - return; - } - - $semiColonIndex = $tokens->getNextMeaningfulToken($endIndex); - - if (!$tokens[$semiColonIndex]->equals(';')) { - return; - } - - $tokens[$semiColonIndex] = new Token('{'); - $tokens->insertAt($semiColonIndex + 1, new Token('}')); - }; - } else { - $fixLoop = static function (int $index, int $endIndex) use ($tokens): void { - $braceOpenIndex = $tokens->getNextMeaningfulToken($endIndex); - - if (!$tokens[$braceOpenIndex]->equals('{')) { - return; - } - - $braceCloseIndex = $tokens->getNextNonWhitespace($braceOpenIndex); - - if (!$tokens[$braceCloseIndex]->equals('}')) { - return; - } - - $tokens[$braceOpenIndex] = new Token(';'); - $tokens->clearTokenAndMergeSurroundingWhitespace($braceCloseIndex); - }; - } - - for ($index = $tokens->count() - 1; $index > 0; --$index) { - if ($tokens[$index]->isGivenKind(self::TOKEN_LOOP_KINDS)) { - $endIndex = $tokens->getNextTokenOfKind($index, ['(']); // proceed to open '(' - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $endIndex); // proceed to close ')' - $fixLoop($index, $endIndex); // fix loop if needs fixing - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('style', 'Style of empty loop-bodies.')) - ->setAllowedTypes(['string']) - ->setAllowedValues([self::STYLE_BRACES, self::STYLE_SEMICOLON]) - ->setDefault(self::STYLE_SEMICOLON) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php deleted file mode 100644 index 2feac4ea..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php +++ /dev/null @@ -1,202 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * style?: 'for'|'while' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * style: 'for'|'while' - * } - */ -final class EmptyLoopConditionFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const STYLE_FOR = 'for'; - - private const STYLE_WHILE = 'while'; - - private const TOKEN_LOOP_KINDS = [T_FOR, T_WHILE]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Empty loop-condition must be in configured style.', - [ - new CodeSample(" 'for']), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer. - */ - public function getPriority(): int - { - return 1; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(self::TOKEN_LOOP_KINDS); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if (self::STYLE_WHILE === $this->configuration['style']) { - $candidateLoopKinds = [T_FOR, T_WHILE]; - $replacement = [new Token([T_WHILE, 'while']), new Token([T_WHITESPACE, ' ']), new Token('('), new Token([T_STRING, 'true']), new Token(')')]; - - $fixLoop = static function (int $index, int $openIndex, int $endIndex) use ($tokens, $replacement): void { - if (self::isForLoopWithEmptyCondition($tokens, $index, $openIndex, $endIndex)) { - self::clearNotCommentsInRange($tokens, $index, $endIndex); - self::cloneAndInsert($tokens, $index, $replacement); - } elseif (self::isWhileLoopWithEmptyCondition($tokens, $index, $openIndex, $endIndex)) { - $doIndex = self::getDoIndex($tokens, $index); - - if (null !== $doIndex) { - self::clearNotCommentsInRange($tokens, $index, $tokens->getNextMeaningfulToken($endIndex)); // clear including `;` - $tokens->clearAt($doIndex); - self::cloneAndInsert($tokens, $doIndex, $replacement); - } - } - }; - } else { // self::STYLE_FOR - $candidateLoopKinds = [T_WHILE]; - $replacement = [new Token([T_FOR, 'for']), new Token('('), new Token(';'), new Token(';'), new Token(')')]; - - $fixLoop = static function (int $index, int $openIndex, int $endIndex) use ($tokens, $replacement): void { - if (!self::isWhileLoopWithEmptyCondition($tokens, $index, $openIndex, $endIndex)) { - return; - } - - $doIndex = self::getDoIndex($tokens, $index); - - if (null === $doIndex) { - self::clearNotCommentsInRange($tokens, $index, $endIndex); - self::cloneAndInsert($tokens, $index, $replacement); - } else { - self::clearNotCommentsInRange($tokens, $index, $tokens->getNextMeaningfulToken($endIndex)); // clear including `;` - $tokens->clearAt($doIndex); - self::cloneAndInsert($tokens, $doIndex, $replacement); - } - }; - } - - for ($index = $tokens->count() - 1; $index > 0; --$index) { - if ($tokens[$index]->isGivenKind($candidateLoopKinds)) { - $openIndex = $tokens->getNextTokenOfKind($index, ['(']); // proceed to open '(' - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); // proceed to close ')' - $fixLoop($index, $openIndex, $endIndex); // fix loop if needed - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('style', 'Style of empty loop-condition.')) - ->setAllowedTypes(['string']) - ->setAllowedValues([self::STYLE_WHILE, self::STYLE_FOR]) - ->setDefault(self::STYLE_WHILE) - ->getOption(), - ]); - } - - private static function clearNotCommentsInRange(Tokens $tokens, int $indexStart, int $indexEnd): void - { - for ($i = $indexStart; $i <= $indexEnd; ++$i) { - if (!$tokens[$i]->isComment()) { - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - } - } - } - - /** - * @param list $replacement - */ - private static function cloneAndInsert(Tokens $tokens, int $index, array $replacement): void - { - $replacementClones = []; - - foreach ($replacement as $token) { - $replacementClones[] = clone $token; - } - - $tokens->insertAt($index, $replacementClones); - } - - private static function getDoIndex(Tokens $tokens, int $index): ?int - { - $endIndex = $tokens->getPrevMeaningfulToken($index); - - if (!$tokens[$endIndex]->equals('}')) { - return null; - } - - $startIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $endIndex); - $index = $tokens->getPrevMeaningfulToken($startIndex); - - return null === $index || !$tokens[$index]->isGivenKind(T_DO) ? null : $index; - } - - private static function isForLoopWithEmptyCondition(Tokens $tokens, int $index, int $openIndex, int $endIndex): bool - { - if (!$tokens[$index]->isGivenKind(T_FOR)) { - return false; - } - - $index = $tokens->getNextMeaningfulToken($openIndex); - - if (null === $index || !$tokens[$index]->equals(';')) { - return false; - } - - $index = $tokens->getNextMeaningfulToken($index); - - return null !== $index && $tokens[$index]->equals(';') && $endIndex === $tokens->getNextMeaningfulToken($index); - } - - private static function isWhileLoopWithEmptyCondition(Tokens $tokens, int $index, int $openIndex, int $endIndex): bool - { - if (!$tokens[$index]->isGivenKind(T_WHILE)) { - return false; - } - - $index = $tokens->getNextMeaningfulToken($openIndex); - - return null !== $index && $tokens[$index]->equals([T_STRING, 'true']) && $endIndex === $tokens->getNextMeaningfulToken($index); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/IncludeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/IncludeFixer.php deleted file mode 100644 index a0bd5acc..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/IncludeFixer.php +++ /dev/null @@ -1,153 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\BlocksAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Sebastiaan Stok - * @author Dariusz Rumiński - * @author Kuba Werłos - */ -final class IncludeFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Include/Require and file path should be divided with a single space. File path should not be placed within parentheses.', - [ - new CodeSample( - 'isAnyTokenKindsFound([T_REQUIRE, T_REQUIRE_ONCE, T_INCLUDE, T_INCLUDE_ONCE]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->clearIncludies($tokens, $this->findIncludies($tokens)); - } - - /** - * @param array $includies - */ - private function clearIncludies(Tokens $tokens, array $includies): void - { - $blocksAnalyzer = new BlocksAnalyzer(); - - foreach ($includies as $includy) { - if (!$tokens[$includy['end']]->isGivenKind(T_CLOSE_TAG)) { - $afterEndIndex = $tokens->getNextNonWhitespace($includy['end']); - - if (null === $afterEndIndex || !$tokens[$afterEndIndex]->isComment()) { - $tokens->removeLeadingWhitespace($includy['end']); - } - } - - $braces = $includy['braces']; - - if (null !== $braces) { - $prevIndex = $tokens->getPrevMeaningfulToken($includy['begin']); - $nextIndex = $tokens->getNextMeaningfulToken($braces['close']); - - // Include is also legal as function parameter or condition statement but requires being wrapped then. - if (!$tokens[$nextIndex]->equalsAny([';', [T_CLOSE_TAG]]) && !$blocksAnalyzer->isBlock($tokens, $prevIndex, $nextIndex)) { - continue; - } - - $this->removeWhitespaceAroundIfPossible($tokens, $braces['open']); - $this->removeWhitespaceAroundIfPossible($tokens, $braces['close']); - $tokens->clearTokenAndMergeSurroundingWhitespace($braces['open']); - $tokens->clearTokenAndMergeSurroundingWhitespace($braces['close']); - } - - $nextIndex = $tokens->getNonEmptySibling($includy['begin'], 1); - - if ($tokens[$nextIndex]->isWhitespace()) { - $tokens[$nextIndex] = new Token([T_WHITESPACE, ' ']); - } elseif (null !== $braces || $tokens[$nextIndex]->isGivenKind([T_VARIABLE, T_CONSTANT_ENCAPSED_STRING, T_COMMENT])) { - $tokens->insertAt($includy['begin'] + 1, new Token([T_WHITESPACE, ' '])); - } - } - } - - /** - * @return array - */ - private function findIncludies(Tokens $tokens): array - { - static $includyTokenKinds = [T_REQUIRE, T_REQUIRE_ONCE, T_INCLUDE, T_INCLUDE_ONCE]; - - $includies = []; - - foreach ($tokens->findGivenKind($includyTokenKinds) as $includyTokens) { - foreach ($includyTokens as $index => $token) { - $includy = [ - 'begin' => $index, - 'braces' => null, - 'end' => $tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]), - ]; - - $braceOpenIndex = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$braceOpenIndex]->equals('(')) { - $braceCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $braceOpenIndex); - - $includy['braces'] = [ - 'open' => $braceOpenIndex, - 'close' => $braceCloseIndex, - ]; - } - - $includies[$index] = $includy; - } - } - - krsort($includies); - - return $includies; - } - - private function removeWhitespaceAroundIfPossible(Tokens $tokens, int $index): void - { - $nextIndex = $tokens->getNextNonWhitespace($index); - - if (null === $nextIndex || !$tokens[$nextIndex]->isComment()) { - $tokens->removeLeadingWhitespace($index); - } - - $prevIndex = $tokens->getPrevNonWhitespace($index); - - if (null === $prevIndex || !$tokens[$prevIndex]->isComment()) { - $tokens->removeTrailingWhitespace($index); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoAlternativeSyntaxFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoAlternativeSyntaxFixer.php deleted file mode 100644 index c0622fd2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoAlternativeSyntaxFixer.php +++ /dev/null @@ -1,244 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Eddilbert Macharia - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * fix_non_monolithic_code?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * fix_non_monolithic_code: bool - * } - */ -final class NoAlternativeSyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replace control structure alternative syntax to use braces.', - [ - new CodeSample( - "\nLorem ipsum.\n\n", - ['fix_non_monolithic_code' => true] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->hasAlternativeSyntax() && (true === $this->configuration['fix_non_monolithic_code'] || $tokens->isMonolithicPhp()); - } - - /** - * {@inheritdoc} - * - * Must run before BracesFixer, ElseifFixer, NoSuperfluousElseifFixer, NoUnneededControlParenthesesFixer, NoUselessElseFixer, SwitchContinueToBreakFixer. - */ - public function getPriority(): int - { - return 42; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('fix_non_monolithic_code', 'Whether to also fix code with inline HTML.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) // @TODO change to "false" on next major 4.0 - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 1; 0 <= $index; --$index) { - $token = $tokens[$index]; - $this->fixElseif($index, $token, $tokens); - $this->fixElse($index, $token, $tokens); - $this->fixOpenCloseControls($index, $token, $tokens); - } - } - - private function findParenthesisEnd(Tokens $tokens, int $structureTokenIndex): int - { - $nextIndex = $tokens->getNextMeaningfulToken($structureTokenIndex); - $nextToken = $tokens[$nextIndex]; - - return $nextToken->equals('(') - ? $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $nextIndex) - : $structureTokenIndex; // return if next token is not opening parenthesis - } - - /** - * Handle both extremes of the control structures. - * e.g. if(): or endif;. - * - * @param int $index the index of the token being processed - * @param Token $token the token being processed - * @param Tokens $tokens the collection of tokens - */ - private function fixOpenCloseControls(int $index, Token $token, Tokens $tokens): void - { - if ($token->isGivenKind([T_IF, T_FOREACH, T_WHILE, T_FOR, T_SWITCH, T_DECLARE])) { - $openIndex = $tokens->getNextTokenOfKind($index, ['(']); - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); - $afterParenthesisIndex = $tokens->getNextMeaningfulToken($closeIndex); - $afterParenthesis = $tokens[$afterParenthesisIndex]; - - if (!$afterParenthesis->equals(':')) { - return; - } - - $items = []; - - if (!$tokens[$afterParenthesisIndex - 1]->isWhitespace()) { - $items[] = new Token([T_WHITESPACE, ' ']); - } - - $items[] = new Token('{'); - - if (!$tokens[$afterParenthesisIndex + 1]->isWhitespace()) { - $items[] = new Token([T_WHITESPACE, ' ']); - } - - $tokens->clearAt($afterParenthesisIndex); - $tokens->insertAt($afterParenthesisIndex, $items); - } - - if (!$token->isGivenKind([T_ENDIF, T_ENDFOREACH, T_ENDWHILE, T_ENDFOR, T_ENDSWITCH, T_ENDDECLARE])) { - return; - } - - $nextTokenIndex = $tokens->getNextMeaningfulToken($index); - $nextToken = $tokens[$nextTokenIndex]; - $tokens[$index] = new Token('}'); - - if ($nextToken->equals(';')) { - $tokens->clearAt($nextTokenIndex); - } - } - - /** - * Handle the else: cases. - * - * @param int $index the index of the token being processed - * @param Token $token the token being processed - * @param Tokens $tokens the collection of tokens - */ - private function fixElse(int $index, Token $token, Tokens $tokens): void - { - if (!$token->isGivenKind(T_ELSE)) { - return; - } - - $tokenAfterElseIndex = $tokens->getNextMeaningfulToken($index); - $tokenAfterElse = $tokens[$tokenAfterElseIndex]; - - if (!$tokenAfterElse->equals(':')) { - return; - } - - $this->addBraces($tokens, new Token([T_ELSE, 'else']), $index, $tokenAfterElseIndex); - } - - /** - * Handle the elsif(): cases. - * - * @param int $index the index of the token being processed - * @param Token $token the token being processed - * @param Tokens $tokens the collection of tokens - */ - private function fixElseif(int $index, Token $token, Tokens $tokens): void - { - if (!$token->isGivenKind(T_ELSEIF)) { - return; - } - - $parenthesisEndIndex = $this->findParenthesisEnd($tokens, $index); - $tokenAfterParenthesisIndex = $tokens->getNextMeaningfulToken($parenthesisEndIndex); - $tokenAfterParenthesis = $tokens[$tokenAfterParenthesisIndex]; - - if (!$tokenAfterParenthesis->equals(':')) { - return; - } - - $this->addBraces($tokens, new Token([T_ELSEIF, 'elseif']), $index, $tokenAfterParenthesisIndex); - } - - /** - * Add opening and closing braces to the else: and elseif: cases. - * - * @param Tokens $tokens the tokens collection - * @param Token $token the current token - * @param int $index the current token index - * @param int $colonIndex the index of the colon - */ - private function addBraces(Tokens $tokens, Token $token, int $index, int $colonIndex): void - { - $items = [ - new Token('}'), - new Token([T_WHITESPACE, ' ']), - $token, - ]; - - if (!$tokens[$index + 1]->isWhitespace()) { - $items[] = new Token([T_WHITESPACE, ' ']); - } - - $tokens->clearAt($index); - $tokens->insertAt( - $index, - $items - ); - - // increment the position of the colon by number of items inserted - $colonIndex += \count($items); - - $items = [new Token('{')]; - - if (!$tokens[$colonIndex + 1]->isWhitespace()) { - $items[] = new Token([T_WHITESPACE, ' ']); - } - - $tokens->clearAt($colonIndex); - $tokens->insertAt( - $colonIndex, - $items - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php deleted file mode 100644 index 821df86c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php +++ /dev/null @@ -1,366 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; -use Symfony\Component\OptionsResolver\Options; - -/** - * Fixer for rule defined in PSR2 ¶5.2. - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * comment_text?: string - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * comment_text: string - * } - */ -final class NoBreakCommentFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There must be a comment when fall-through is intentional in a non-empty case body.', - [ - new CodeSample( - ' 'some comment'] - ), - ], - 'Adds a "no break" comment before fall-through cases, and removes it if there is no fall-through.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_SWITCH); - } - - /** - * {@inheritdoc} - * - * Must run after NoUselessElseFixer. - */ - public function getPriority(): int - { - return 0; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('comment_text', 'The text to use in the added comment and to detect it.')) - ->setAllowedTypes(['string']) - ->setAllowedValues([ - static function (string $value): bool { - if (Preg::match('/\R/', $value)) { - throw new InvalidOptionsException('The comment text must not contain new lines.'); - } - - return true; - }, - ]) - ->setNormalizer(static fn (Options $options, string $value): string => rtrim($value)) - ->setDefault('no break') - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 1; $index >= 0; --$index) { - if ($tokens[$index]->isGivenKind(T_DEFAULT)) { - if ($tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(T_DOUBLE_ARROW)) { - continue; // this is "default" from "match" - } - } elseif (!$tokens[$index]->isGivenKind(T_CASE)) { - continue; - } - - $this->fixCase($tokens, $tokens->getNextTokenOfKind($index, [':', ';'])); - } - } - - private function fixCase(Tokens $tokens, int $casePosition): void - { - $empty = true; - $fallThrough = true; - $commentPosition = null; - - for ($i = $casePosition + 1, $max = \count($tokens); $i < $max; ++$i) { - if ($tokens[$i]->isGivenKind([...self::getParenthesisedStructureKinds(), T_ELSE, T_DO, T_CLASS])) { - $empty = false; - $i = $this->getStructureEnd($tokens, $i); - - continue; - } - - if ($tokens[$i]->isGivenKind([T_BREAK, T_CONTINUE, T_RETURN, T_EXIT, T_GOTO])) { - $fallThrough = false; - - continue; - } - - if ($tokens[$i]->isGivenKind(T_THROW)) { - $previousIndex = $tokens->getPrevMeaningfulToken($i); - - if ($previousIndex === $casePosition || $tokens[$previousIndex]->equalsAny(['{', ';', '}', [T_OPEN_TAG]])) { - $fallThrough = false; - } - - continue; - } - - if ($tokens[$i]->equals('}') || $tokens[$i]->isGivenKind(T_ENDSWITCH)) { - if (null !== $commentPosition) { - $this->removeComment($tokens, $commentPosition); - } - - break; - } - - if ($this->isNoBreakComment($tokens[$i])) { - $commentPosition = $i; - - continue; - } - - if ($tokens[$i]->isGivenKind([T_CASE, T_DEFAULT])) { - if (!$empty && $fallThrough) { - if (null !== $commentPosition && $tokens->getPrevNonWhitespace($i) !== $commentPosition) { - $this->removeComment($tokens, $commentPosition); - $commentPosition = null; - } - - if (null === $commentPosition) { - $this->insertCommentAt($tokens, $i); - } else { - $text = $this->configuration['comment_text']; - $tokens[$commentPosition] = new Token([ - $tokens[$commentPosition]->getId(), - str_ireplace($text, $text, $tokens[$commentPosition]->getContent()), - ]); - - $this->ensureNewLineAt($tokens, $commentPosition); - } - } elseif (null !== $commentPosition) { - $this->removeComment($tokens, $commentPosition); - } - - break; - } - - if (!$tokens[$i]->isGivenKind([T_COMMENT, T_WHITESPACE])) { - $empty = false; - } - } - } - - private function isNoBreakComment(Token $token): bool - { - if (!$token->isComment()) { - return false; - } - - $text = preg_quote($this->configuration['comment_text'], '~'); - - return Preg::match("~^((//|#)\\s*{$text}\\s*)|(/\\*\\*?\\s*{$text}(\\s+.*)*\\*/)$~i", $token->getContent()); - } - - private function insertCommentAt(Tokens $tokens, int $casePosition): void - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - $newlinePosition = $this->ensureNewLineAt($tokens, $casePosition); - $newlineToken = $tokens[$newlinePosition]; - $nbNewlines = substr_count($newlineToken->getContent(), $lineEnding); - - if ($newlineToken->isGivenKind(T_OPEN_TAG) && Preg::match('/\R/', $newlineToken->getContent())) { - ++$nbNewlines; - } elseif ($tokens[$newlinePosition - 1]->isGivenKind(T_OPEN_TAG) && Preg::match('/\R/', $tokens[$newlinePosition - 1]->getContent())) { - ++$nbNewlines; - - if (!Preg::match('/\R/', $newlineToken->getContent())) { - $tokens[$newlinePosition] = new Token([$newlineToken->getId(), $lineEnding.$newlineToken->getContent()]); - } - } - - if ($nbNewlines > 1) { - Preg::match('/^(.*?)(\R\h*)$/s', $newlineToken->getContent(), $matches); - - $indent = WhitespacesAnalyzer::detectIndent($tokens, $newlinePosition - 1); - $tokens[$newlinePosition] = new Token([$newlineToken->getId(), $matches[1].$lineEnding.$indent]); - $tokens->insertAt(++$newlinePosition, new Token([T_WHITESPACE, $matches[2]])); - } - - $tokens->insertAt($newlinePosition, new Token([T_COMMENT, '// '.$this->configuration['comment_text']])); - $this->ensureNewLineAt($tokens, $newlinePosition); - } - - /** - * @return int The newline token position - */ - private function ensureNewLineAt(Tokens $tokens, int $position): int - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - $content = $lineEnding.WhitespacesAnalyzer::detectIndent($tokens, $position); - $whitespaceToken = $tokens[$position - 1]; - - if (!$whitespaceToken->isGivenKind(T_WHITESPACE)) { - if ($whitespaceToken->isGivenKind(T_OPEN_TAG)) { - $content = Preg::replace('/\R/', '', $content); - - if (!Preg::match('/\R/', $whitespaceToken->getContent())) { - $tokens[$position - 1] = new Token([T_OPEN_TAG, Preg::replace('/\s+$/', $lineEnding, $whitespaceToken->getContent())]); - } - } - - if ('' !== $content) { - $tokens->insertAt($position, new Token([T_WHITESPACE, $content])); - - return $position; - } - - return $position - 1; - } - - if ($tokens[$position - 2]->isGivenKind(T_OPEN_TAG) && Preg::match('/\R/', $tokens[$position - 2]->getContent())) { - $content = Preg::replace('/^\R/', '', $content); - } - - if (!Preg::match('/\R/', $whitespaceToken->getContent())) { - $tokens[$position - 1] = new Token([T_WHITESPACE, $content]); - } - - return $position - 1; - } - - private function removeComment(Tokens $tokens, int $commentPosition): void - { - if ($tokens[$tokens->getPrevNonWhitespace($commentPosition)]->isGivenKind(T_OPEN_TAG)) { - $whitespacePosition = $commentPosition + 1; - $regex = '/^\R\h*/'; - } else { - $whitespacePosition = $commentPosition - 1; - $regex = '/\R\h*$/'; - } - - $whitespaceToken = $tokens[$whitespacePosition]; - - if ($whitespaceToken->isGivenKind(T_WHITESPACE)) { - $content = Preg::replace($regex, '', $whitespaceToken->getContent()); - - $tokens->ensureWhitespaceAtIndex($whitespacePosition, 0, $content); - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($commentPosition); - } - - private function getStructureEnd(Tokens $tokens, int $position): int - { - $initialToken = $tokens[$position]; - - if ($initialToken->isGivenKind(self::getParenthesisedStructureKinds())) { - $position = $tokens->findBlockEnd( - Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, - $tokens->getNextTokenOfKind($position, ['(']) - ); - } elseif ($initialToken->isGivenKind(T_CLASS)) { - $openParenthesisPosition = $tokens->getNextMeaningfulToken($position); - - if ('(' === $tokens[$openParenthesisPosition]->getContent()) { - $position = $tokens->findBlockEnd( - Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, - $openParenthesisPosition - ); - } - } - - $position = $tokens->getNextMeaningfulToken($position); - - if ('{' !== $tokens[$position]->getContent()) { - return $tokens->getNextTokenOfKind($position, [';']); - } - - $position = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $position); - - if ($initialToken->isGivenKind(T_DO)) { - $position = $tokens->findBlockEnd( - Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, - $tokens->getNextTokenOfKind($position, ['(']) - ); - - return $tokens->getNextTokenOfKind($position, [';']); - } - - return $position; - } - - /** - * @return list - */ - private static function getParenthesisedStructureKinds(): array - { - static $structureKinds = null; - - if (null === $structureKinds) { - $structureKinds = [T_FOR, T_FOREACH, T_WHILE, T_IF, T_ELSEIF, T_SWITCH, T_FUNCTION]; - if (\defined('T_MATCH')) { // @TODO: drop condition when PHP 8.0+ is required - $structureKinds[] = T_MATCH; - } - } - - return $structureKinds; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoSuperfluousElseifFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoSuperfluousElseifFixer.php deleted file mode 100644 index 93dbb083..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoSuperfluousElseifFixer.php +++ /dev/null @@ -1,100 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractNoUselessElseFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoSuperfluousElseifFixer extends AbstractNoUselessElseFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_ELSE, T_ELSEIF]); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replaces superfluous `elseif` with `if`.', - [ - new CodeSample(" $token) { - if ($this->isElseif($tokens, $index) && $this->isSuperfluousElse($tokens, $index)) { - $this->convertElseifToIf($tokens, $index); - } - } - } - - private function isElseif(Tokens $tokens, int $index): bool - { - return - $tokens[$index]->isGivenKind(T_ELSEIF) - || ($tokens[$index]->isGivenKind(T_ELSE) && $tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(T_IF)); - } - - private function convertElseifToIf(Tokens $tokens, int $index): void - { - if ($tokens[$index]->isGivenKind(T_ELSE)) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } else { - $tokens[$index] = new Token([T_IF, 'if']); - } - - $whitespace = ''; - - for ($previous = $index - 1; $previous > 0; --$previous) { - $token = $tokens[$previous]; - if ($token->isWhitespace() && Preg::match('/(\R\N*)$/', $token->getContent(), $matches)) { - $whitespace = $matches[1]; - - break; - } - } - - if ('' === $whitespace) { - return; - } - - $previousToken = $tokens[$index - 1]; - - if (!$previousToken->isWhitespace()) { - $tokens->insertAt($index, new Token([T_WHITESPACE, $whitespace])); - } elseif (!Preg::match('/\R/', $previousToken->getContent())) { - $tokens[$index - 1] = new Token([T_WHITESPACE, $whitespace]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoTrailingCommaInListCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoTrailingCommaInListCallFixer.php deleted file mode 100644 index 4b710058..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoTrailingCommaInListCallFixer.php +++ /dev/null @@ -1,51 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\Basic\NoTrailingCommaInSinglelineFixer; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @deprecated - * - * @author Dariusz Rumiński - */ -final class NoTrailingCommaInListCallFixer extends AbstractProxyFixer implements DeprecatedFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Remove trailing commas in list function calls.', - [new CodeSample("proxyFixers); - } - - protected function createProxyFixers(): array - { - $fixer = new NoTrailingCommaInSinglelineFixer(); - $fixer->configure(['elements' => ['array_destructuring']]); - - return [$fixer]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php deleted file mode 100644 index ce46c859..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php +++ /dev/null @@ -1,182 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * namespaces?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * namespaces: bool - * } - */ -final class NoUnneededBracesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Removes unneeded braces that are superfluous and aren\'t part of a control structure\'s body.', - [ - new CodeSample( - ' true] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoUselessElseFixer, NoUselessReturnFixer, ReturnAssignmentFixer, SimplifiedIfReturnFixer. - */ - public function getPriority(): int - { - return 40; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound('}'); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($this->findBraceOpen($tokens) as $index) { - if ($this->isOverComplete($tokens, $index)) { - $this->clearOverCompleteBraces($tokens, $index, $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index)); - } - } - - if (true === $this->configuration['namespaces']) { - $this->clearIfIsOverCompleteNamespaceBlock($tokens); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('namespaces', 'Remove unneeded braces from bracketed namespaces.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - /** - * @param int $openIndex index of `{` token - * @param int $closeIndex index of `}` token - */ - private function clearOverCompleteBraces(Tokens $tokens, int $openIndex, int $closeIndex): void - { - $tokens->clearTokenAndMergeSurroundingWhitespace($closeIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($openIndex); - } - - /** - * @return iterable - */ - private function findBraceOpen(Tokens $tokens): iterable - { - for ($i = \count($tokens) - 1; $i > 0; --$i) { - if ($tokens[$i]->equals('{')) { - yield $i; - } - } - } - - /** - * @param int $index index of `{` token - */ - private function isOverComplete(Tokens $tokens, int $index): bool - { - static $include = ['{', '}', [T_OPEN_TAG], ':', ';']; - - return $tokens[$tokens->getPrevMeaningfulToken($index)]->equalsAny($include); - } - - private function clearIfIsOverCompleteNamespaceBlock(Tokens $tokens): void - { - if (1 !== $tokens->countTokenKind(T_NAMESPACE)) { - return; // fast check, we never fix if multiple namespaces are defined - } - - $index = $tokens->getNextTokenOfKind(0, [[T_NAMESPACE]]); - - $namespaceIsNamed = false; - - $index = $tokens->getNextMeaningfulToken($index); - while ($tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR])) { - $index = $tokens->getNextMeaningfulToken($index); - $namespaceIsNamed = true; - } - - if (!$namespaceIsNamed) { - return; - } - - if (!$tokens[$index]->equals('{')) { - return; // `;` - } - - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - $afterCloseIndex = $tokens->getNextMeaningfulToken($closeIndex); - - if (null !== $afterCloseIndex && (!$tokens[$afterCloseIndex]->isGivenKind(T_CLOSE_TAG) || null !== $tokens->getNextMeaningfulToken($afterCloseIndex))) { - return; - } - - // clear up - $tokens->clearTokenAndMergeSurroundingWhitespace($closeIndex); - $tokens[$index] = new Token(';'); - - if ($tokens[$index - 1]->isWhitespace(" \t") && !$tokens[$index - 2]->isComment()) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index - 1); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php deleted file mode 100644 index 6b2c3cb1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php +++ /dev/null @@ -1,760 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Sullivan Senechal - * @author Dariusz Rumiński - * @author Gregor Harlan - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * statements?: list<'break'|'clone'|'continue'|'echo_print'|'negative_instanceof'|'others'|'return'|'switch_case'|'yield'|'yield_from'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * statements: list<'break'|'clone'|'continue'|'echo_print'|'negative_instanceof'|'others'|'return'|'switch_case'|'yield'|'yield_from'> - * } - */ -final class NoUnneededControlParenthesesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var list - */ - private const BLOCK_TYPES = [ - Tokens::BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE, - Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, - Tokens::BLOCK_TYPE_CURLY_BRACE, - Tokens::BLOCK_TYPE_DESTRUCTURING_SQUARE_BRACE, - Tokens::BLOCK_TYPE_DYNAMIC_PROP_BRACE, - Tokens::BLOCK_TYPE_DYNAMIC_VAR_BRACE, - Tokens::BLOCK_TYPE_INDEX_SQUARE_BRACE, - Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, - ]; - - private const BEFORE_TYPES = [ - ';', - '{', - [T_OPEN_TAG], - [T_OPEN_TAG_WITH_ECHO], - [T_ECHO], - [T_PRINT], - [T_RETURN], - [T_THROW], - [T_YIELD], - [T_YIELD_FROM], - [T_BREAK], - [T_CONTINUE], - // won't be fixed, but true in concept, helpful for fast check - [T_REQUIRE], - [T_REQUIRE_ONCE], - [T_INCLUDE], - [T_INCLUDE_ONCE], - ]; - - private const CONFIG_OPTIONS = [ - 'break', - 'clone', - 'continue', - 'echo_print', - 'negative_instanceof', - 'others', - 'return', - 'switch_case', - 'yield', - 'yield_from', - ]; - - private const TOKEN_TYPE_CONFIG_MAP = [ - T_BREAK => 'break', - T_CASE => 'switch_case', - T_CONTINUE => 'continue', - T_ECHO => 'echo_print', - T_PRINT => 'echo_print', - T_RETURN => 'return', - T_YIELD => 'yield', - T_YIELD_FROM => 'yield_from', - ]; - - // handled by the `include` rule - private const TOKEN_TYPE_NO_CONFIG = [ - T_REQUIRE, - T_REQUIRE_ONCE, - T_INCLUDE, - T_INCLUDE_ONCE, - ]; - - /** - * @var list - */ - private array $noopTypes; - - private TokensAnalyzer $tokensAnalyzer; - - public function __construct() - { - parent::__construct(); - - $this->noopTypes = [ - '$', - [T_CONSTANT_ENCAPSED_STRING], - [T_DNUMBER], - [T_DOUBLE_COLON], - [T_LNUMBER], - [T_NS_SEPARATOR], - [T_STRING], - [T_VARIABLE], - [T_STATIC], - // magic constants - [T_CLASS_C], - [T_DIR], - [T_FILE], - [T_FUNC_C], - [T_LINE], - [T_METHOD_C], - [T_NS_C], - [T_TRAIT_C], - ]; - - foreach (Token::getObjectOperatorKinds() as $kind) { - $this->noopTypes[] = [$kind]; - } - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Removes unneeded parentheses around control statements.', - [ - new CodeSample( - ' ['break', 'continue']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before ConcatSpaceFixer, NoTrailingWhitespaceFixer. - * Must run after ModernizeTypesCastingFixer, NoAlternativeSyntaxFixer. - */ - public function getPriority(): int - { - return 30; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(['(', CT::T_BRACE_CLASS_INSTANTIATION_OPEN]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->tokensAnalyzer = new TokensAnalyzer($tokens); - - foreach ($tokens as $openIndex => $token) { - if ($token->equals('(')) { - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); - } elseif ($token->isGivenKind(CT::T_BRACE_CLASS_INSTANTIATION_OPEN)) { - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_BRACE_CLASS_INSTANTIATION, $openIndex); - } else { - continue; - } - - $beforeOpenIndex = $tokens->getPrevMeaningfulToken($openIndex); - $afterCloseIndex = $tokens->getNextMeaningfulToken($closeIndex); - - // do a cheap check for negative case: `X()` - - if ($tokens->getNextMeaningfulToken($openIndex) === $closeIndex) { - if ($this->isExitStatement($tokens, $beforeOpenIndex)) { - $this->removeUselessParenthesisPair($tokens, $beforeOpenIndex, $afterCloseIndex, $openIndex, $closeIndex, 'others'); - } - - continue; - } - - // do a cheap check for negative case: `foo(1,2)` - - if ($this->isKnownNegativePre($tokens[$beforeOpenIndex])) { - continue; - } - - // check for the simple useless wrapped cases - - if ($this->isUselessWrapped($tokens, $beforeOpenIndex, $afterCloseIndex)) { - $this->removeUselessParenthesisPair($tokens, $beforeOpenIndex, $afterCloseIndex, $openIndex, $closeIndex, $this->getConfigType($tokens, $beforeOpenIndex)); - - continue; - } - - // handle `clone` statements - - if ($this->isCloneStatement($tokens, $beforeOpenIndex)) { - if ($this->isWrappedCloneArgument($tokens, $beforeOpenIndex, $openIndex, $closeIndex, $afterCloseIndex)) { - $this->removeUselessParenthesisPair($tokens, $beforeOpenIndex, $afterCloseIndex, $openIndex, $closeIndex, 'clone'); - } - - continue; - } - - // handle `instance of` statements - - $instanceOfIndex = $this->getIndexOfInstanceOfStatement($tokens, $openIndex, $closeIndex); - - if (null !== $instanceOfIndex) { - if ($this->isWrappedInstanceOf($tokens, $instanceOfIndex, $beforeOpenIndex, $openIndex, $closeIndex, $afterCloseIndex)) { - $this->removeUselessParenthesisPair( - $tokens, - $beforeOpenIndex, - $afterCloseIndex, - $openIndex, - $closeIndex, - $tokens[$beforeOpenIndex]->equals('!') ? 'negative_instanceof' : 'others' - ); - } - - continue; - } - - // last checks deal with operators, do not swap around - - if ($this->isWrappedPartOfOperation($tokens, $beforeOpenIndex, $openIndex, $closeIndex, $afterCloseIndex)) { - $this->removeUselessParenthesisPair($tokens, $beforeOpenIndex, $afterCloseIndex, $openIndex, $closeIndex, $this->getConfigType($tokens, $beforeOpenIndex)); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $defaults = array_filter( - self::CONFIG_OPTIONS, - static fn (string $option): bool => 'negative_instanceof' !== $option && 'others' !== $option && 'yield_from' !== $option - ); - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('statements', 'List of control statements to fix.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset(self::CONFIG_OPTIONS)]) - ->setDefault(array_values($defaults)) - ->getOption(), - ]); - } - - private function isUselessWrapped(Tokens $tokens, int $beforeOpenIndex, int $afterCloseIndex): bool - { - return - $this->isSingleStatement($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isWrappedFnBody($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isWrappedForElement($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isWrappedLanguageConstructArgument($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isWrappedSequenceElement($tokens, $beforeOpenIndex, $afterCloseIndex); - } - - private function isExitStatement(Tokens $tokens, int $beforeOpenIndex): bool - { - return $tokens[$beforeOpenIndex]->isGivenKind(T_EXIT); - } - - private function isCloneStatement(Tokens $tokens, int $beforeOpenIndex): bool - { - return $tokens[$beforeOpenIndex]->isGivenKind(T_CLONE); - } - - private function isWrappedCloneArgument(Tokens $tokens, int $beforeOpenIndex, int $openIndex, int $closeIndex, int $afterCloseIndex): bool - { - $beforeOpenIndex = $tokens->getPrevMeaningfulToken($beforeOpenIndex); - - if ( - !( - $tokens[$beforeOpenIndex]->equals('?') // For BC reasons - || $this->isSimpleAssignment($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isSingleStatement($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isWrappedFnBody($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isWrappedForElement($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isWrappedSequenceElement($tokens, $beforeOpenIndex, $afterCloseIndex) - ) - ) { - return false; - } - - $newCandidateIndex = $tokens->getNextMeaningfulToken($openIndex); - - if ($tokens[$newCandidateIndex]->isGivenKind(T_NEW)) { - $openIndex = $newCandidateIndex; // `clone (new X)`, `clone (new X())`, clone (new X(Y))` - } - - return !$this->containsOperation($tokens, $openIndex, $closeIndex); - } - - private function getIndexOfInstanceOfStatement(Tokens $tokens, int $openIndex, int $closeIndex): ?int - { - $instanceOfIndex = $tokens->findGivenKind(T_INSTANCEOF, $openIndex, $closeIndex); - - return 1 === \count($instanceOfIndex) ? array_key_first($instanceOfIndex) : null; - } - - private function isWrappedInstanceOf(Tokens $tokens, int $instanceOfIndex, int $beforeOpenIndex, int $openIndex, int $closeIndex, int $afterCloseIndex): bool - { - if ( - $this->containsOperation($tokens, $openIndex, $instanceOfIndex) - || $this->containsOperation($tokens, $instanceOfIndex, $closeIndex) - ) { - return false; - } - - if ($tokens[$beforeOpenIndex]->equals('!')) { - $beforeOpenIndex = $tokens->getPrevMeaningfulToken($beforeOpenIndex); - } - - return - $this->isSimpleAssignment($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isSingleStatement($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isWrappedFnBody($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isWrappedForElement($tokens, $beforeOpenIndex, $afterCloseIndex) - || $this->isWrappedSequenceElement($tokens, $beforeOpenIndex, $afterCloseIndex); - } - - private function isWrappedPartOfOperation(Tokens $tokens, int $beforeOpenIndex, int $openIndex, int $closeIndex, int $afterCloseIndex): bool - { - if ($this->containsOperation($tokens, $openIndex, $closeIndex)) { - return false; - } - - $boundariesMoved = false; - - if ($this->isPreUnaryOperation($tokens, $beforeOpenIndex)) { - $beforeOpenIndex = $this->getBeforePreUnaryOperation($tokens, $beforeOpenIndex); - $boundariesMoved = true; - } - - if ($this->isAccess($tokens, $afterCloseIndex)) { - $afterCloseIndex = $this->getAfterAccess($tokens, $afterCloseIndex); - $boundariesMoved = true; - - if ($this->tokensAnalyzer->isUnarySuccessorOperator($afterCloseIndex)) { // post unary operation are only valid here - $afterCloseIndex = $tokens->getNextMeaningfulToken($afterCloseIndex); - } - } - - if ($boundariesMoved) { - if ($this->isKnownNegativePre($tokens[$beforeOpenIndex])) { - return false; - } - - if ($this->isUselessWrapped($tokens, $beforeOpenIndex, $afterCloseIndex)) { - return true; - } - } - - // check if part of some operation sequence - - $beforeIsBinaryOperation = $this->tokensAnalyzer->isBinaryOperator($beforeOpenIndex); - $afterIsBinaryOperation = $this->tokensAnalyzer->isBinaryOperator($afterCloseIndex); - - if ($beforeIsBinaryOperation && $afterIsBinaryOperation) { - return true; // `+ (x) +` - } - - $beforeToken = $tokens[$beforeOpenIndex]; - $afterToken = $tokens[$afterCloseIndex]; - - $beforeIsBlockOpenOrComma = $beforeToken->equals(',') || null !== $this->getBlock($tokens, $beforeOpenIndex, true); - $afterIsBlockEndOrComma = $afterToken->equals(',') || null !== $this->getBlock($tokens, $afterCloseIndex, false); - - if (($beforeIsBlockOpenOrComma && $afterIsBinaryOperation) || ($beforeIsBinaryOperation && $afterIsBlockEndOrComma)) { - // $beforeIsBlockOpenOrComma && $afterIsBlockEndOrComma is covered by `isWrappedSequenceElement` - // `[ (x) +` or `+ (X) ]` or `, (X) +` or `+ (X) ,` - - return true; - } - - if ($tokens[$beforeOpenIndex]->equals('}')) { - $beforeIsStatementOpen = !$this->closeCurlyBelongsToDynamicElement($tokens, $beforeOpenIndex); - } else { - $beforeIsStatementOpen = $beforeToken->equalsAny(self::BEFORE_TYPES) || $beforeToken->isGivenKind(T_CASE); - } - - $afterIsStatementEnd = $afterToken->equalsAny([';', [T_CLOSE_TAG]]); - - return - ($beforeIsStatementOpen && $afterIsBinaryOperation) // `isGivenKind([T_PRINT, T_YIELD, T_YIELD_FROM, T_REQUIRE, T_REQUIRE_ONCE, T_INCLUDE, T_INCLUDE_ONCE])) { - return false; - } - - $beforeOpenIndex = $tokens->getPrevMeaningfulToken($beforeOpenIndex); - - return $this->isWrappedSequenceElement($tokens, $beforeOpenIndex, $afterCloseIndex); - } - - // any of `isGivenKind(T_CASE)) { - return $tokens[$afterCloseIndex]->equalsAny([':', ';']); // `switch case` - } - - if (!$tokens[$afterCloseIndex]->equalsAny([';', [T_CLOSE_TAG]])) { - return false; - } - - if ($tokens[$beforeOpenIndex]->equals('}')) { - return !$this->closeCurlyBelongsToDynamicElement($tokens, $beforeOpenIndex); - } - - return $tokens[$beforeOpenIndex]->equalsAny(self::BEFORE_TYPES); - } - - private function isSimpleAssignment(Tokens $tokens, int $beforeOpenIndex, int $afterCloseIndex): bool - { - return $tokens[$beforeOpenIndex]->equals('=') && $tokens[$afterCloseIndex]->equalsAny([';', [T_CLOSE_TAG]]); // `= (X) ;` - } - - private function isWrappedSequenceElement(Tokens $tokens, int $startIndex, int $endIndex): bool - { - $startIsComma = $tokens[$startIndex]->equals(','); - $endIsComma = $tokens[$endIndex]->equals(','); - - if ($startIsComma && $endIsComma) { - return true; // `,(X),` - } - - $blockTypeStart = $this->getBlock($tokens, $startIndex, true); - $blockTypeEnd = $this->getBlock($tokens, $endIndex, false); - - return - ($startIsComma && null !== $blockTypeEnd) // `,(X)]` - || ($endIsComma && null !== $blockTypeStart) // `[(X),` - || (null !== $blockTypeEnd && null !== $blockTypeStart); // any type of `{(X)}`, `[(X)]` and `((X))` - } - - // any of `for( (X); ;(X)) ;` note that the middle element is covered as 'single statement' as it is `; (X) ;` - private function isWrappedForElement(Tokens $tokens, int $beforeOpenIndex, int $afterCloseIndex): bool - { - $forCandidateIndex = null; - - if ($tokens[$beforeOpenIndex]->equals('(') && $tokens[$afterCloseIndex]->equals(';')) { - $forCandidateIndex = $tokens->getPrevMeaningfulToken($beforeOpenIndex); - } elseif ($tokens[$afterCloseIndex]->equals(')') && $tokens[$beforeOpenIndex]->equals(';')) { - $forCandidateIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $afterCloseIndex); - $forCandidateIndex = $tokens->getPrevMeaningfulToken($forCandidateIndex); - } - - return null !== $forCandidateIndex && $tokens[$forCandidateIndex]->isGivenKind(T_FOR); - } - - // `fn() => (X);` - private function isWrappedFnBody(Tokens $tokens, int $beforeOpenIndex, int $afterCloseIndex): bool - { - if (!$tokens[$beforeOpenIndex]->isGivenKind(T_DOUBLE_ARROW)) { - return false; - } - - $beforeOpenIndex = $tokens->getPrevMeaningfulToken($beforeOpenIndex); - - if ($tokens[$beforeOpenIndex]->isGivenKind(T_STRING)) { - while (true) { - $beforeOpenIndex = $tokens->getPrevMeaningfulToken($beforeOpenIndex); - - if (!$tokens[$beforeOpenIndex]->isGivenKind([T_STRING, CT::T_TYPE_INTERSECTION, CT::T_TYPE_ALTERNATION])) { - break; - } - } - - if (!$tokens[$beforeOpenIndex]->isGivenKind(CT::T_TYPE_COLON)) { - return false; - } - - $beforeOpenIndex = $tokens->getPrevMeaningfulToken($beforeOpenIndex); - } - - if (!$tokens[$beforeOpenIndex]->equals(')')) { - return false; - } - - $beforeOpenIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $beforeOpenIndex); - $beforeOpenIndex = $tokens->getPrevMeaningfulToken($beforeOpenIndex); - - if ($tokens[$beforeOpenIndex]->isGivenKind(CT::T_RETURN_REF)) { - $beforeOpenIndex = $tokens->getPrevMeaningfulToken($beforeOpenIndex); - } - - if (!$tokens[$beforeOpenIndex]->isGivenKind(T_FN)) { - return false; - } - - return $tokens[$afterCloseIndex]->equalsAny([';', ',', [T_CLOSE_TAG]]); - } - - private function isPreUnaryOperation(Tokens $tokens, int $index): bool - { - return $this->tokensAnalyzer->isUnaryPredecessorOperator($index) || $tokens[$index]->isCast(); - } - - private function getBeforePreUnaryOperation(Tokens $tokens, int $index): int - { - do { - $index = $tokens->getPrevMeaningfulToken($index); - } while ($this->isPreUnaryOperation($tokens, $index)); - - return $index; - } - - // array access `(X)[` or `(X){` or object access `(X)->` or `(X)?->` - private function isAccess(Tokens $tokens, int $index): bool - { - $token = $tokens[$index]; - - return $token->isObjectOperator() || $token->equals('[') || $token->isGivenKind([CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN]); - } - - private function getAfterAccess(Tokens $tokens, int $index): int - { - while (true) { - $block = $this->getBlock($tokens, $index, true); - - if (null !== $block) { - $index = $tokens->findBlockEnd($block['type'], $index); - $index = $tokens->getNextMeaningfulToken($index); - - continue; - } - - if ( - $tokens[$index]->isObjectOperator() - || $tokens[$index]->equalsAny(['$', [T_PAAMAYIM_NEKUDOTAYIM], [T_STRING], [T_VARIABLE]]) - ) { - $index = $tokens->getNextMeaningfulToken($index); - - continue; - } - - break; - } - - return $index; - } - - /** - * @return null|array{type: Tokens::BLOCK_TYPE_*, isStart: bool} - */ - private function getBlock(Tokens $tokens, int $index, bool $isStart): ?array - { - $block = Tokens::detectBlockType($tokens[$index]); - - return null !== $block && $isStart === $block['isStart'] && \in_array($block['type'], self::BLOCK_TYPES, true) ? $block : null; - } - - // cheap check on a tokens type before `(` of which we know the `(` will never be superfluous - private function isKnownNegativePre(Token $token): bool - { - static $knownNegativeTypes; - - if (null === $knownNegativeTypes) { - $knownNegativeTypes = [ - [CT::T_CLASS_CONSTANT], - [CT::T_DYNAMIC_VAR_BRACE_CLOSE], - [CT::T_RETURN_REF], - [CT::T_USE_LAMBDA], - [T_ARRAY], - [T_CATCH], - [T_CLASS], - [T_DECLARE], - [T_ELSEIF], - [T_EMPTY], - [T_EXIT], - [T_EVAL], - [T_FN], - [T_FOREACH], - [T_FOR], - [T_FUNCTION], - [T_HALT_COMPILER], - [T_IF], - [T_ISSET], - [T_LIST], - [T_STRING], - [T_SWITCH], - [T_STATIC], - [T_UNSET], - [T_VARIABLE], - [T_WHILE], - // handled by the `include` rule - [T_REQUIRE], - [T_REQUIRE_ONCE], - [T_INCLUDE], - [T_INCLUDE_ONCE], - ]; - - if (\defined('T_MATCH')) { // @TODO: drop condition and add directly in `$knownNegativeTypes` above when PHP 8.0+ is required - $knownNegativeTypes[] = T_MATCH; - } - } - - return $token->equalsAny($knownNegativeTypes); - } - - private function containsOperation(Tokens $tokens, int $startIndex, int $endIndex): bool - { - while (true) { - $startIndex = $tokens->getNextMeaningfulToken($startIndex); - - if ($startIndex === $endIndex) { - break; - } - - $block = Tokens::detectBlockType($tokens[$startIndex]); - - if (null !== $block && $block['isStart']) { - $startIndex = $tokens->findBlockEnd($block['type'], $startIndex); - - continue; - } - - if (!$tokens[$startIndex]->equalsAny($this->noopTypes)) { - return true; - } - } - - return false; - } - - private function getConfigType(Tokens $tokens, int $beforeOpenIndex): ?string - { - if ($tokens[$beforeOpenIndex]->isGivenKind(self::TOKEN_TYPE_NO_CONFIG)) { - return null; - } - - foreach (self::TOKEN_TYPE_CONFIG_MAP as $type => $configItem) { - if ($tokens[$beforeOpenIndex]->isGivenKind($type)) { - return $configItem; - } - } - - return 'others'; - } - - private function removeUselessParenthesisPair( - Tokens $tokens, - int $beforeOpenIndex, - int $afterCloseIndex, - int $openIndex, - int $closeIndex, - ?string $configType - ): void { - $statements = $this->configuration['statements']; - - if (null === $configType || !\in_array($configType, $statements, true)) { - return; - } - - $needsSpaceAfter = - !$this->isAccess($tokens, $afterCloseIndex) - && !$tokens[$afterCloseIndex]->equalsAny([';', ',', [T_CLOSE_TAG]]) - && null === $this->getBlock($tokens, $afterCloseIndex, false) - && !($tokens[$afterCloseIndex]->equalsAny([':', ';']) && $tokens[$beforeOpenIndex]->isGivenKind(T_CASE)); - - $needsSpaceBefore = - !$this->isPreUnaryOperation($tokens, $beforeOpenIndex) - && !$tokens[$beforeOpenIndex]->equalsAny(['}', [T_EXIT], [T_OPEN_TAG]]) - && null === $this->getBlock($tokens, $beforeOpenIndex, true); - - $this->removeBrace($tokens, $closeIndex, $needsSpaceAfter); - $this->removeBrace($tokens, $openIndex, $needsSpaceBefore); - } - - private function removeBrace(Tokens $tokens, int $index, bool $needsSpace): void - { - if ($needsSpace) { - foreach ([-1, 1] as $direction) { - $siblingIndex = $tokens->getNonEmptySibling($index, $direction); - - if ($tokens[$siblingIndex]->isWhitespace() || $tokens[$siblingIndex]->isComment()) { - $needsSpace = false; - - break; - } - } - } - - if ($needsSpace) { - $tokens[$index] = new Token([T_WHITESPACE, ' ']); - } else { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - } - - private function closeCurlyBelongsToDynamicElement(Tokens $tokens, int $beforeOpenIndex): bool - { - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $beforeOpenIndex); - $index = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$index]->isGivenKind(T_DOUBLE_COLON)) { - return true; - } - - if ($tokens[$index]->equals(':')) { - $index = $tokens->getPrevTokenOfKind($index, [[T_CASE], '?']); - - return !$tokens[$index]->isGivenKind(T_CASE); - } - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededCurlyBracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededCurlyBracesFixer.php deleted file mode 100644 index 40610d2a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededCurlyBracesFixer.php +++ /dev/null @@ -1,106 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @deprecated - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * namespaces?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * namespaces: bool - * } - */ -final class NoUnneededCurlyBracesFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private NoUnneededBracesFixer $noUnneededBracesFixer; - - public function __construct() - { - $this->noUnneededBracesFixer = new NoUnneededBracesFixer(); - - parent::__construct(); - } - - public function getDefinition(): FixerDefinitionInterface - { - $fixerDefinition = $this->noUnneededBracesFixer->getDefinition(); - - return new FixerDefinition( - 'Removes unneeded curly braces that are superfluous and aren\'t part of a control structure\'s body.', - $fixerDefinition->getCodeSamples(), - $fixerDefinition->getDescription(), - $fixerDefinition->getRiskyDescription() - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoUselessElseFixer, NoUselessReturnFixer, ReturnAssignmentFixer, SimplifiedIfReturnFixer. - */ - public function getPriority(): int - { - return $this->noUnneededBracesFixer->getPriority(); - } - - public function getSuccessorsNames(): array - { - return [ - $this->noUnneededBracesFixer->getName(), - ]; - } - - /** - * @param _AutogeneratedInputConfiguration $configuration - */ - protected function configurePreNormalisation(array $configuration): void - { - $this->noUnneededBracesFixer->configure($configuration); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('namespaces', 'Remove unneeded curly braces from bracketed namespaces.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function createProxyFixers(): array - { - return [ - $this->noUnneededBracesFixer, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUselessElseFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUselessElseFixer.php deleted file mode 100644 index 9b2d1cce..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUselessElseFixer.php +++ /dev/null @@ -1,120 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractNoUselessElseFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoUselessElseFixer extends AbstractNoUselessElseFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_ELSE); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should not be useless `else` cases.', - [ - new CodeSample(" $token) { - if (!$token->isGivenKind(T_ELSE)) { - continue; - } - - // `else if` vs. `else` and alternative syntax `else:` checks - if ($tokens[$tokens->getNextMeaningfulToken($index)]->equalsAny([':', [T_IF]])) { - continue; - } - - // clean up `else` if it is an empty statement - $this->fixEmptyElse($tokens, $index); - if ($tokens->isEmptyAt($index)) { - continue; - } - - // clean up `else` if possible - if ($this->isSuperfluousElse($tokens, $index)) { - $this->clearElse($tokens, $index); - } - } - } - - /** - * Remove tokens part of an `else` statement if not empty (i.e. no meaningful tokens inside). - * - * @param int $index T_ELSE index - */ - private function fixEmptyElse(Tokens $tokens, int $index): void - { - $next = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$next]->equals('{')) { - $close = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $next); - if (1 === $close - $next) { // '{}' - $this->clearElse($tokens, $index); - } elseif ($tokens->getNextMeaningfulToken($next) === $close) { // '{/**/}' - $this->clearElse($tokens, $index); - } - - return; - } - - // short `else` - $end = $tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]); - if ($next === $end) { - $this->clearElse($tokens, $index); - } - } - - /** - * @param int $index index of T_ELSE - */ - private function clearElse(Tokens $tokens, int $index): void - { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - - // clear T_ELSE and the '{' '}' if there are any - $next = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$next]->equals('{')) { - return; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $next)); - $tokens->clearTokenAndMergeSurroundingWhitespace($next); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php deleted file mode 100644 index a3633700..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php +++ /dev/null @@ -1,138 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - */ -final class SimplifiedIfReturnFixer extends AbstractFixer -{ - /** - * @var list}> - */ - private array $sequences = [ - [ - 'isNegative' => false, - 'sequence' => [ - '{', [T_RETURN], [T_STRING, 'true'], ';', '}', - [T_RETURN], [T_STRING, 'false'], ';', - ], - ], - [ - 'isNegative' => true, - 'sequence' => [ - '{', [T_RETURN], [T_STRING, 'false'], ';', '}', - [T_RETURN], [T_STRING, 'true'], ';', - ], - ], - [ - 'isNegative' => false, - 'sequence' => [ - [T_RETURN], [T_STRING, 'true'], ';', - [T_RETURN], [T_STRING, 'false'], ';', - ], - ], - [ - 'isNegative' => true, - 'sequence' => [ - [T_RETURN], [T_STRING, 'false'], ';', - [T_RETURN], [T_STRING, 'true'], ';', - ], - ], - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Simplify `if` control structures that return the boolean result of their condition.', - [new CodeSample("isAllTokenKindsFound([T_IF, T_RETURN, T_STRING]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($ifIndex = $tokens->count() - 1; 0 <= $ifIndex; --$ifIndex) { - if (!$tokens[$ifIndex]->isGivenKind([T_IF, T_ELSEIF])) { - continue; - } - - if ($tokens[$tokens->getPrevMeaningfulToken($ifIndex)]->equals(')')) { - continue; // in a loop without braces - } - - $startParenthesisIndex = $tokens->getNextTokenOfKind($ifIndex, ['(']); - $endParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startParenthesisIndex); - $firstCandidateIndex = $tokens->getNextMeaningfulToken($endParenthesisIndex); - - foreach ($this->sequences as $sequenceSpec) { - $sequenceFound = $tokens->findSequence($sequenceSpec['sequence'], $firstCandidateIndex); - - if (null === $sequenceFound) { - continue; - } - - $firstSequenceIndex = array_key_first($sequenceFound); - - if ($firstSequenceIndex !== $firstCandidateIndex) { - continue; - } - - $indicesToClear = array_keys($sequenceFound); - array_pop($indicesToClear); // Preserve last semicolon - rsort($indicesToClear); - - foreach ($indicesToClear as $index) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - - $newTokens = [ - new Token([T_RETURN, 'return']), - new Token([T_WHITESPACE, ' ']), - ]; - - if ($sequenceSpec['isNegative']) { - $newTokens[] = new Token('!'); - } else { - $newTokens[] = new Token([T_BOOL_CAST, '(bool)']); - } - - $tokens->overrideRange($ifIndex, $ifIndex, $newTokens); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixer.php deleted file mode 100644 index f5e2210f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixer.php +++ /dev/null @@ -1,87 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\SwitchAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\ControlCaseStructuresAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶5.2. - */ -final class SwitchCaseSemicolonToColonFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'A case should be followed by a colon and not a semicolon.', - [ - new CodeSample( - 'isTokenKindFound(T_SWITCH); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - /** @var SwitchAnalysis $analysis */ - foreach (ControlCaseStructuresAnalyzer::findControlStructures($tokens, [T_SWITCH]) as $analysis) { - $default = $analysis->getDefaultAnalysis(); - - if (null !== $default) { - $this->fixTokenIfNeeded($tokens, $default->getColonIndex()); - } - - foreach ($analysis->getCases() as $caseAnalysis) { - $this->fixTokenIfNeeded($tokens, $caseAnalysis->getColonIndex()); - } - } - } - - private function fixTokenIfNeeded(Tokens $tokens, int $index): void - { - if ($tokens[$index]->equals(';')) { - $tokens[$index] = new Token(':'); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSpaceFixer.php deleted file mode 100644 index 5616e1f3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchCaseSpaceFixer.php +++ /dev/null @@ -1,85 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\SwitchAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\ControlCaseStructuresAnalyzer; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶5.2. - * - * @author Sullivan Senechal - */ -final class SwitchCaseSpaceFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Removes extra spaces between colon and case value.', - [ - new CodeSample( - 'isTokenKindFound(T_SWITCH); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - /** @var SwitchAnalysis $analysis */ - foreach (ControlCaseStructuresAnalyzer::findControlStructures($tokens, [T_SWITCH]) as $analysis) { - $default = $analysis->getDefaultAnalysis(); - - if (null !== $default) { - $index = $default->getIndex(); - - if (!$tokens[$index + 1]->isWhitespace() || !$tokens[$index + 2]->equalsAny([':', ';'])) { - continue; - } - - $tokens->clearAt($index + 1); - } - - foreach ($analysis->getCases() as $caseAnalysis) { - $colonIndex = $caseAnalysis->getColonIndex(); - $valueIndex = $tokens->getPrevNonWhitespace($colonIndex); - - // skip if there is no space between the colon and previous token or is space after comment - if ($valueIndex === $colonIndex - 1 || $tokens[$valueIndex]->isComment()) { - continue; - } - - $tokens->clearAt($valueIndex + 1); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php deleted file mode 100644 index b42fc3a9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php +++ /dev/null @@ -1,240 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class SwitchContinueToBreakFixer extends AbstractFixer -{ - /** - * @var list - */ - private array $switchLevels = []; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Switch case must not be ended with `continue` but with `break`.', - [ - new CodeSample( - ' 3) { - continue; - } - - continue 2; - } -} -' - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after NoAlternativeSyntaxFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAllTokenKindsFound([T_SWITCH, T_CONTINUE]) && !$tokens->hasAlternativeSyntax(); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $count = \count($tokens); - - for ($index = 1; $index < $count - 1; ++$index) { - $index = $this->doFix($tokens, $index, 0, false); - } - } - - /** - * @param int $depth >= 0 - */ - private function doFix(Tokens $tokens, int $index, int $depth, bool $isInSwitch): int - { - $token = $tokens[$index]; - - if ($token->isGivenKind([T_FOREACH, T_FOR, T_WHILE])) { - // go to first `(`, go to its close ')', go to first of '{', ';', '? >' - $index = $tokens->getNextTokenOfKind($index, ['(']); - $index = $tokens->getNextTokenOfKind($index, [')']); - $index = $tokens->getNextTokenOfKind($index, ['{', ';', [T_CLOSE_TAG]]); - - if (!$tokens[$index]->equals('{')) { - return $index; - } - - return $this->fixInLoop($tokens, $index, $depth + 1); - } - - if ($token->isGivenKind(T_DO)) { - return $this->fixInLoop($tokens, $tokens->getNextTokenOfKind($index, ['{']), $depth + 1); - } - - if ($token->isGivenKind(T_SWITCH)) { - return $this->fixInSwitch($tokens, $index, $depth + 1); - } - - if ($token->isGivenKind(T_CONTINUE)) { - return $this->fixContinueWhenActsAsBreak($tokens, $index, $isInSwitch, $depth); - } - - return $index; - } - - private function fixInSwitch(Tokens $tokens, int $switchIndex, int $depth): int - { - $this->switchLevels[] = $depth; - - // figure out where the switch starts - $openIndex = $tokens->getNextTokenOfKind($switchIndex, ['{']); - - // figure out where the switch ends - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $openIndex); - - for ($index = $openIndex + 1; $index < $closeIndex; ++$index) { - $index = $this->doFix($tokens, $index, $depth, true); - } - - array_pop($this->switchLevels); - - return $closeIndex; - } - - private function fixInLoop(Tokens $tokens, int $openIndex, int $depth): int - { - $openCount = 1; - - while (true) { - ++$openIndex; - $token = $tokens[$openIndex]; - - if ($token->equals('{')) { - ++$openCount; - - continue; - } - - if ($token->equals('}')) { - --$openCount; - - if (0 === $openCount) { - break; - } - - continue; - } - - $openIndex = $this->doFix($tokens, $openIndex, $depth, false); - } - - return $openIndex; - } - - private function fixContinueWhenActsAsBreak(Tokens $tokens, int $continueIndex, bool $isInSwitch, int $depth): int - { - $followingContinueIndex = $tokens->getNextMeaningfulToken($continueIndex); - $followingContinueToken = $tokens[$followingContinueIndex]; - - if ($isInSwitch && $followingContinueToken->equals(';')) { - $this->replaceContinueWithBreakToken($tokens, $continueIndex); // short continue 1 notation - - return $followingContinueIndex; - } - - if (!$followingContinueToken->isGivenKind(T_LNUMBER)) { - return $followingContinueIndex; - } - - $afterFollowingContinueIndex = $tokens->getNextMeaningfulToken($followingContinueIndex); - - if (!$tokens[$afterFollowingContinueIndex]->equals(';')) { - return $afterFollowingContinueIndex; // if next not is `;` return without fixing, for example `continue 1 ? >getContent(); - $jump = str_replace('_', '', $jump); // support for numeric_literal_separator - - if (\strlen($jump) > 2 && 'x' === $jump[1]) { - $jump = hexdec($jump); // hexadecimal - 0x1 - } elseif (\strlen($jump) > 2 && 'b' === $jump[1]) { - $jump = bindec($jump); // binary - 0b1 - } elseif (\strlen($jump) > 1 && '0' === $jump[0]) { - $jump = octdec($jump); // octal 01 - } elseif (Preg::match('#^\d+$#', $jump)) { // positive int - $jump = (float) $jump; // cast to float, might be a number bigger than PHP max. int value - } else { - return $afterFollowingContinueIndex; // cannot process value, ignore - } - - if ($jump > PHP_INT_MAX) { - return $afterFollowingContinueIndex; // cannot process value, ignore - } - - $jump = (int) $jump; - - if ($isInSwitch && (1 === $jump || 0 === $jump)) { - $this->replaceContinueWithBreakToken($tokens, $continueIndex); // long continue 0/1 notation - - return $afterFollowingContinueIndex; - } - - $jumpDestination = $depth - $jump + 1; - - if (\in_array($jumpDestination, $this->switchLevels, true)) { - $this->replaceContinueWithBreakToken($tokens, $continueIndex); - - return $afterFollowingContinueIndex; - } - - return $afterFollowingContinueIndex; - } - - private function replaceContinueWithBreakToken(Tokens $tokens, int $index): void - { - $tokens[$index] = new Token([T_BREAK, 'break']); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php deleted file mode 100644 index 10a39785..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php +++ /dev/null @@ -1,270 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Sebastiaan Stok - * @author Dariusz Rumiński - * @author Kuba Werłos - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * after_heredoc?: bool, - * elements?: list<'arguments'|'array_destructuring'|'arrays'|'match'|'parameters'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * after_heredoc: bool, - * elements: list<'arguments'|'array_destructuring'|'arrays'|'match'|'parameters'> - * } - */ -final class TrailingCommaInMultilineFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const ELEMENTS_ARRAYS = 'arrays'; - - /** - * @internal - */ - public const ELEMENTS_ARGUMENTS = 'arguments'; - - /** - * @internal - */ - public const ELEMENTS_PARAMETERS = 'parameters'; - - private const MATCH_EXPRESSIONS = 'match'; - - private const ARRAY_DESTRUCTURING = 'array_destructuring'; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Arguments lists, array destructuring lists, arrays that are multi-line, `match`-lines and parameters lists must have a trailing comma.', - [ - new CodeSample(" true] - ), - new CodeSample(" [self::ELEMENTS_ARGUMENTS]]), - new VersionSpecificCodeSample(" [self::ELEMENTS_PARAMETERS]]), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN, '(', CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN]); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('after_heredoc', 'Whether a trailing comma should also be placed after heredoc end.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) // @TODO 4.0: set to `true`. - ->getOption(), - (new FixerOptionBuilder('elements', \sprintf('Where to fix multiline trailing comma (PHP >= 8.0 for `%s` and `%s`).', self::ELEMENTS_PARAMETERS, self::MATCH_EXPRESSIONS))) // @TODO: remove text when PHP 8.0+ is required - ->setAllowedTypes(['string[]']) - ->setAllowedValues([ - new AllowedValueSubset([ - self::ARRAY_DESTRUCTURING, - self::ELEMENTS_ARGUMENTS, - self::ELEMENTS_ARRAYS, - self::ELEMENTS_PARAMETERS, - self::MATCH_EXPRESSIONS, - ]), - ]) - ->setDefault([self::ELEMENTS_ARRAYS]) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $configuredElements = $this->configuration['elements']; - $fixArrays = \in_array(self::ELEMENTS_ARRAYS, $configuredElements, true); - $fixArguments = \in_array(self::ELEMENTS_ARGUMENTS, $configuredElements, true); - $fixParameters = \PHP_VERSION_ID >= 8_00_00 && \in_array(self::ELEMENTS_PARAMETERS, $configuredElements, true); // @TODO: drop condition when PHP 8.0+ is required - $fixMatch = \PHP_VERSION_ID >= 8_00_00 && \in_array(self::MATCH_EXPRESSIONS, $configuredElements, true); // @TODO: drop condition when PHP 8.0+ is required - $fixDestructuring = \in_array(self::ARRAY_DESTRUCTURING, $configuredElements, true); - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if ($tokens[$index]->isGivenKind(CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN)) { - if ($fixDestructuring) { // array destructing short syntax - $this->fixBlock($tokens, $index); - } - - continue; - } - - if ($tokens[$index]->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { - if ($fixArrays) { // array short syntax - $this->fixBlock($tokens, $index); - } - - continue; - } - - if (!$tokens[$index]->equals('(')) { - continue; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$prevIndex]->isGivenKind(T_ARRAY)) { - if ($fixArrays) { // array long syntax - $this->fixBlock($tokens, $index); - } - - continue; - } - - if ($tokens[$prevIndex]->isGivenKind(T_LIST)) { - if ($fixDestructuring || $fixArguments) { // array destructing long syntax - $this->fixBlock($tokens, $index); - } - - continue; - } - - if ($fixMatch && $tokens[$prevIndex]->isGivenKind(T_MATCH)) { - $this->fixMatch($tokens, $index); - - continue; - } - - $prevPrevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - - if ($fixArguments - && $tokens[$prevIndex]->equalsAny([']', [T_CLASS], [T_STRING], [T_VARIABLE], [T_STATIC], [T_ISSET], [T_UNSET], [T_LIST]]) - && !$tokens[$prevPrevIndex]->isGivenKind(T_FUNCTION) - ) { - $this->fixBlock($tokens, $index); - - continue; - } - - if ( - $fixParameters - && ( - $tokens[$prevIndex]->isGivenKind(T_STRING) - && $tokens[$prevPrevIndex]->isGivenKind(T_FUNCTION) - || $tokens[$prevIndex]->isGivenKind([T_FN, T_FUNCTION]) - ) - ) { - $this->fixBlock($tokens, $index); - } - } - } - - private function fixBlock(Tokens $tokens, int $startIndex): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - if (!$tokensAnalyzer->isBlockMultiline($tokens, $startIndex)) { - return; - } - - $blockType = Tokens::detectBlockType($tokens[$startIndex]); - $endIndex = $tokens->findBlockEnd($blockType['type'], $startIndex); - - $beforeEndIndex = $tokens->getPrevMeaningfulToken($endIndex); - if (!$tokens->isPartialCodeMultiline($beforeEndIndex, $endIndex)) { - return; - } - $beforeEndToken = $tokens[$beforeEndIndex]; - - // if there is some item between braces then add `,` after it - if ( - $startIndex !== $beforeEndIndex && !$beforeEndToken->equals(',') - && (true === $this->configuration['after_heredoc'] || !$beforeEndToken->isGivenKind(T_END_HEREDOC)) - ) { - $tokens->insertAt($beforeEndIndex + 1, new Token(',')); - - $endToken = $tokens[$endIndex]; - - if (!$endToken->isComment() && !$endToken->isWhitespace()) { - $tokens->ensureWhitespaceAtIndex($endIndex, 1, ' '); - } - } - } - - private function fixMatch(Tokens $tokens, int $index): void - { - $index = $tokens->getNextTokenOfKind($index, ['{']); - $closeIndex = $index; - $isMultiline = false; - $depth = 1; - - do { - ++$closeIndex; - - if ($tokens[$closeIndex]->equals('{')) { - ++$depth; - } elseif ($tokens[$closeIndex]->equals('}')) { - --$depth; - } elseif (!$isMultiline && str_contains($tokens[$closeIndex]->getContent(), "\n")) { - $isMultiline = true; - } - } while ($depth > 0); - - if (!$isMultiline) { - return; - } - - $previousIndex = $tokens->getPrevMeaningfulToken($closeIndex); - if (!$tokens->isPartialCodeMultiline($previousIndex, $closeIndex)) { - return; - } - - if (!$tokens[$previousIndex]->equals(',')) { - $tokens->insertAt($previousIndex + 1, new Token(',')); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php deleted file mode 100644 index 2bf136ca..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php +++ /dev/null @@ -1,758 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ControlStructure; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Bram Gotink - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * always_move_variable?: bool, - * equal?: bool|null, - * identical?: bool|null, - * less_and_greater?: bool|null - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * always_move_variable: bool, - * equal: bool|null, - * identical: bool|null, - * less_and_greater: bool|null - * } - */ -final class YodaStyleFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var array - */ - private array $candidatesMap; - - /** - * @var array - */ - private array $candidateTypesConfiguration; - - /** - * @var list - */ - private array $candidateTypes; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Write conditions in Yoda style (`true`), non-Yoda style (`[\'equal\' => false, \'identical\' => false, \'less_and_greater\' => false]`) or ignore those conditions (`null`) based on configuration.', - [ - new CodeSample( - ' 3; // less than -', - [ - 'equal' => true, - 'identical' => false, - 'less_and_greater' => null, - ] - ), - new CodeSample( - ' true, - ] - ), - new CodeSample( - ' false, - 'identical' => false, - 'less_and_greater' => false, - ] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after IsNullFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound($this->candidateTypes); - } - - protected function configurePostNormalisation(): void - { - $this->resolveConfiguration(); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->fixTokens($tokens); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('equal', 'Style for equal (`==`, `!=`) statements.')) - ->setAllowedTypes(['bool', 'null']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('identical', 'Style for identical (`===`, `!==`) statements.')) - ->setAllowedTypes(['bool', 'null']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('less_and_greater', 'Style for less and greater than (`<`, `<=`, `>`, `>=`) statements.')) - ->setAllowedTypes(['bool', 'null']) - ->setDefault(null) - ->getOption(), - (new FixerOptionBuilder('always_move_variable', 'Whether variables should always be on non assignable side when applying Yoda style.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - /** - * Finds the end of the right-hand side of the comparison at the given - * index. - * - * The right-hand side ends when an operator with a lower precedence is - * encountered or when the block level for `()`, `{}` or `[]` goes below - * zero. - * - * @param Tokens $tokens The token list - * @param int $index The index of the comparison - * - * @return int The last index of the right-hand side of the comparison - */ - private function findComparisonEnd(Tokens $tokens, int $index): int - { - ++$index; - $count = \count($tokens); - - while ($index < $count) { - $token = $tokens[$index]; - - if ($token->isGivenKind([T_WHITESPACE, T_COMMENT, T_DOC_COMMENT])) { - ++$index; - - continue; - } - - if ($this->isOfLowerPrecedence($token)) { - break; - } - - $block = Tokens::detectBlockType($token); - - if (null === $block) { - ++$index; - - continue; - } - - if (!$block['isStart']) { - break; - } - - $index = $tokens->findBlockEnd($block['type'], $index) + 1; - } - - $prev = $tokens->getPrevMeaningfulToken($index); - - return $tokens[$prev]->isGivenKind(T_CLOSE_TAG) ? $tokens->getPrevMeaningfulToken($prev) : $prev; - } - - /** - * Finds the start of the left-hand side of the comparison at the given - * index. - * - * The left-hand side ends when an operator with a lower precedence is - * encountered or when the block level for `()`, `{}` or `[]` goes below - * zero. - * - * @param Tokens $tokens The token list - * @param int $index The index of the comparison - * - * @return int The first index of the left-hand side of the comparison - */ - private function findComparisonStart(Tokens $tokens, int $index): int - { - --$index; - $nonBlockFound = false; - - while (0 <= $index) { - $token = $tokens[$index]; - - if ($token->isGivenKind([T_WHITESPACE, T_COMMENT, T_DOC_COMMENT])) { - --$index; - - continue; - } - - if ($token->isGivenKind([CT::T_NAMED_ARGUMENT_COLON])) { - break; - } - - if ($this->isOfLowerPrecedence($token)) { - break; - } - - $block = Tokens::detectBlockType($token); - - if (null === $block) { - --$index; - $nonBlockFound = true; - - continue; - } - - if ( - $block['isStart'] - || ($nonBlockFound && Tokens::BLOCK_TYPE_CURLY_BRACE === $block['type']) // closing of structure not related to the comparison - ) { - break; - } - - $index = $tokens->findBlockStart($block['type'], $index) - 1; - } - - return $tokens->getNextMeaningfulToken($index); - } - - private function fixTokens(Tokens $tokens): Tokens - { - for ($i = \count($tokens) - 1; $i > 1; --$i) { - if ($tokens[$i]->isGivenKind($this->candidateTypes)) { - $yoda = $this->candidateTypesConfiguration[$tokens[$i]->getId()]; - } elseif ( - ($tokens[$i]->equals('<') && \in_array('<', $this->candidateTypes, true)) - || ($tokens[$i]->equals('>') && \in_array('>', $this->candidateTypes, true)) - ) { - $yoda = $this->candidateTypesConfiguration[$tokens[$i]->getContent()]; - } else { - continue; - } - - $fixableCompareInfo = $this->getCompareFixableInfo($tokens, $i, $yoda); - - if (null === $fixableCompareInfo) { - continue; - } - - $i = $this->fixTokensCompare( - $tokens, - $fixableCompareInfo['left']['start'], - $fixableCompareInfo['left']['end'], - $i, - $fixableCompareInfo['right']['start'], - $fixableCompareInfo['right']['end'] - ); - } - - return $tokens; - } - - /** - * Fixes the comparison at the given index. - * - * A comparison is considered fixed when - * - both sides are a variable (e.g. $a === $b) - * - neither side is a variable (e.g. self::CONST === 3) - * - only the right-hand side is a variable (e.g. 3 === self::$var) - * - * If the left-hand side and right-hand side of the given comparison are - * swapped, this function runs recursively on the previous left-hand-side. - * - * @return int an upper bound for all non-fixed comparisons - */ - private function fixTokensCompare( - Tokens $tokens, - int $startLeft, - int $endLeft, - int $compareOperatorIndex, - int $startRight, - int $endRight - ): int { - $type = $tokens[$compareOperatorIndex]->getId(); - $content = $tokens[$compareOperatorIndex]->getContent(); - - if (\array_key_exists($type, $this->candidatesMap)) { - $tokens[$compareOperatorIndex] = clone $this->candidatesMap[$type]; - } elseif (\array_key_exists($content, $this->candidatesMap)) { - $tokens[$compareOperatorIndex] = clone $this->candidatesMap[$content]; - } - - $right = $this->fixTokensComparePart($tokens, $startRight, $endRight); - $left = $this->fixTokensComparePart($tokens, $startLeft, $endLeft); - - for ($i = $startRight; $i <= $endRight; ++$i) { - $tokens->clearAt($i); - } - - for ($i = $startLeft; $i <= $endLeft; ++$i) { - $tokens->clearAt($i); - } - - $tokens->insertAt($startRight, $left); - $tokens->insertAt($startLeft, $right); - - return $startLeft; - } - - private function fixTokensComparePart(Tokens $tokens, int $start, int $end): Tokens - { - $newTokens = $tokens->generatePartialCode($start, $end); - $newTokens = $this->fixTokens(Tokens::fromCode(\sprintf('clearAt(\count($newTokens) - 1); - $newTokens->clearAt(0); - $newTokens->clearEmptyTokens(); - - return $newTokens; - } - - /** - * @return null|array{left: array{start: int, end: int}, right: array{start: int, end: int}} - */ - private function getCompareFixableInfo(Tokens $tokens, int $index, bool $yoda): ?array - { - $right = $this->getRightSideCompareFixableInfo($tokens, $index); - - if (!$yoda && $this->isOfLowerPrecedenceAssignment($tokens[$tokens->getNextMeaningfulToken($right['end'])])) { - return null; - } - - $left = $this->getLeftSideCompareFixableInfo($tokens, $index); - - if ($this->isListStatement($tokens, $left['start'], $left['end']) || $this->isListStatement($tokens, $right['start'], $right['end'])) { - return null; // do not fix lists assignment inside statements - } - - /** @var bool $strict */ - $strict = $this->configuration['always_move_variable']; - $leftSideIsVariable = $this->isVariable($tokens, $left['start'], $left['end'], $strict); - $rightSideIsVariable = $this->isVariable($tokens, $right['start'], $right['end'], $strict); - - if (!($leftSideIsVariable xor $rightSideIsVariable)) { - return null; // both are (not) variables, do not touch - } - - if (!$strict) { // special handling for braces with not "always_move_variable" - $leftSideIsVariable = $leftSideIsVariable && !$tokens[$left['start']]->equals('('); - $rightSideIsVariable = $rightSideIsVariable && !$tokens[$right['start']]->equals('('); - } - - return ($yoda && !$leftSideIsVariable) || (!$yoda && !$rightSideIsVariable) - ? null - : ['left' => $left, 'right' => $right]; - } - - /** - * @return array{start: int, end: int} - */ - private function getLeftSideCompareFixableInfo(Tokens $tokens, int $index): array - { - return [ - 'start' => $this->findComparisonStart($tokens, $index), - 'end' => $tokens->getPrevMeaningfulToken($index), - ]; - } - - /** - * @return array{start: int, end: int} - */ - private function getRightSideCompareFixableInfo(Tokens $tokens, int $index): array - { - return [ - 'start' => $tokens->getNextMeaningfulToken($index), - 'end' => $this->findComparisonEnd($tokens, $index), - ]; - } - - private function isListStatement(Tokens $tokens, int $index, int $end): bool - { - for ($i = $index; $i <= $end; ++$i) { - if ($tokens[$i]->isGivenKind([T_LIST, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE])) { - return true; - } - } - - return false; - } - - /** - * Checks whether the given token has a lower precedence than `T_IS_EQUAL` - * or `T_IS_IDENTICAL`. - * - * @param Token $token The token to check - * - * @return bool Whether the token has a lower precedence - */ - private function isOfLowerPrecedence(Token $token): bool - { - static $tokens; - - if (null === $tokens) { - $tokens = [ - T_BOOLEAN_AND, // && - T_BOOLEAN_OR, // || - T_CASE, // case - T_DOUBLE_ARROW, // => - T_ECHO, // echo - T_GOTO, // goto - T_LOGICAL_AND, // and - T_LOGICAL_OR, // or - T_LOGICAL_XOR, // xor - T_OPEN_TAG, // isOfLowerPrecedenceAssignment($token) || $token->isGivenKind($tokens) || $token->equalsAny($otherTokens); - } - - /** - * Checks whether the given assignment token has a lower precedence than `T_IS_EQUAL` - * or `T_IS_IDENTICAL`. - */ - private function isOfLowerPrecedenceAssignment(Token $token): bool - { - static $tokens; - - if (null === $tokens) { - $tokens = [ - T_AND_EQUAL, // &= - T_CONCAT_EQUAL, // .= - T_DIV_EQUAL, // /= - T_MINUS_EQUAL, // -= - T_MOD_EQUAL, // %= - T_MUL_EQUAL, // *= - T_OR_EQUAL, // |= - T_PLUS_EQUAL, // += - T_POW_EQUAL, // **= - T_SL_EQUAL, // <<= - T_SR_EQUAL, // >>= - T_XOR_EQUAL, // ^= - T_COALESCE_EQUAL, // ??= - ]; - } - - return $token->equals('=') || $token->isGivenKind($tokens); - } - - /** - * Checks whether the tokens between the given start and end describe a - * variable. - * - * @param Tokens $tokens The token list - * @param int $start The first index of the possible variable - * @param int $end The last index of the possible variable - * @param bool $strict Enable strict variable detection - * - * @return bool Whether the tokens describe a variable - */ - private function isVariable(Tokens $tokens, int $start, int $end, bool $strict): bool - { - $tokenAnalyzer = new TokensAnalyzer($tokens); - - if ($start === $end) { - return $tokens[$start]->isGivenKind(T_VARIABLE); - } - - if ($tokens[$start]->equals('(')) { - return true; - } - - if ($strict) { - for ($index = $start; $index <= $end; ++$index) { - if ( - $tokens[$index]->isCast() - || $tokens[$index]->isGivenKind(T_INSTANCEOF) - || $tokens[$index]->equals('!') - || $tokenAnalyzer->isBinaryOperator($index) - ) { - return false; - } - } - } - - $index = $start; - - // handle multiple braces around statement ((($a === 1))) - while ( - $tokens[$index]->equals('(') - && $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index) === $end - ) { - $index = $tokens->getNextMeaningfulToken($index); - $end = $tokens->getPrevMeaningfulToken($end); - } - - $expectString = false; - - while ($index <= $end) { - $current = $tokens[$index]; - if ($current->isComment() || $current->isWhitespace() || $tokens->isEmptyAt($index)) { - ++$index; - - continue; - } - - // check if this is the last token - if ($index === $end) { - return $current->isGivenKind($expectString ? T_STRING : T_VARIABLE); - } - - if ($current->isGivenKind([T_LIST, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE])) { - return false; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - $next = $tokens[$nextIndex]; - - // self:: or ClassName:: - if ($current->isGivenKind(T_STRING) && $next->isGivenKind(T_DOUBLE_COLON)) { - $index = $tokens->getNextMeaningfulToken($nextIndex); - - continue; - } - - // \ClassName - if ($current->isGivenKind(T_NS_SEPARATOR) && $next->isGivenKind(T_STRING)) { - $index = $nextIndex; - - continue; - } - - // ClassName\ - if ($current->isGivenKind(T_STRING) && $next->isGivenKind(T_NS_SEPARATOR)) { - $index = $nextIndex; - - continue; - } - - // $a-> or a-> (as in $b->a->c) - if ($current->isGivenKind([T_STRING, T_VARIABLE]) && $next->isObjectOperator()) { - $index = $tokens->getNextMeaningfulToken($nextIndex); - $expectString = true; - - continue; - } - - // $a[...], a[...] (as in $c->a[$b]), $a{...} or a{...} (as in $c->a{$b}) - if ( - $current->isGivenKind($expectString ? T_STRING : T_VARIABLE) - && $next->equalsAny(['[', [CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN, '{']]) - ) { - $index = $tokens->findBlockEnd( - $next->equals('[') ? Tokens::BLOCK_TYPE_INDEX_SQUARE_BRACE : Tokens::BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE, - $nextIndex - ); - - if ($index === $end) { - return true; - } - - $index = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$index]->equalsAny(['[', [CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN, '{']]) && !$tokens[$index]->isObjectOperator()) { - return false; - } - - $index = $tokens->getNextMeaningfulToken($index); - $expectString = true; - - continue; - } - - // $a(...) or $a->b(...) - if ($strict && $current->isGivenKind([T_STRING, T_VARIABLE]) && $next->equals('(')) { - return false; - } - - // {...} (as in $a->{$b}) - if ($expectString && $current->isGivenKind(CT::T_DYNAMIC_PROP_BRACE_OPEN)) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_DYNAMIC_PROP_BRACE, $index); - if ($index === $end) { - return true; - } - - $index = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$index]->isObjectOperator()) { - return false; - } - - $index = $tokens->getNextMeaningfulToken($index); - $expectString = true; - - continue; - } - - break; - } - - return !$this->isConstant($tokens, $start, $end); - } - - private function isConstant(Tokens $tokens, int $index, int $end): bool - { - $expectArrayOnly = false; - $expectNumberOnly = false; - $expectNothing = false; - - for (; $index <= $end; ++$index) { - $token = $tokens[$index]; - - if ($token->isComment() || $token->isWhitespace()) { - continue; - } - - if ($expectNothing) { - return false; - } - - if ($expectArrayOnly) { - if ($token->equalsAny(['(', ')', [CT::T_ARRAY_SQUARE_BRACE_CLOSE]])) { - continue; - } - - return false; - } - - if ($token->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN])) { - $expectArrayOnly = true; - - continue; - } - - if ($expectNumberOnly && !$token->isGivenKind([T_LNUMBER, T_DNUMBER])) { - return false; - } - - if ($token->equals('-')) { - $expectNumberOnly = true; - - continue; - } - - if ( - $token->isGivenKind([T_LNUMBER, T_DNUMBER, T_CONSTANT_ENCAPSED_STRING]) - || $token->equalsAny([[T_STRING, 'true'], [T_STRING, 'false'], [T_STRING, 'null']]) - ) { - $expectNothing = true; - - continue; - } - - return false; - } - - return true; - } - - private function resolveConfiguration(): void - { - $candidateTypes = []; - $this->candidatesMap = []; - - if (null !== $this->configuration['equal']) { - // `==`, `!=` and `<>` - $candidateTypes[T_IS_EQUAL] = $this->configuration['equal']; - $candidateTypes[T_IS_NOT_EQUAL] = $this->configuration['equal']; - } - - if (null !== $this->configuration['identical']) { - // `===` and `!==` - $candidateTypes[T_IS_IDENTICAL] = $this->configuration['identical']; - $candidateTypes[T_IS_NOT_IDENTICAL] = $this->configuration['identical']; - } - - if (null !== $this->configuration['less_and_greater']) { - // `<`, `<=`, `>` and `>=` - $candidateTypes[T_IS_SMALLER_OR_EQUAL] = $this->configuration['less_and_greater']; - $this->candidatesMap[T_IS_SMALLER_OR_EQUAL] = new Token([T_IS_GREATER_OR_EQUAL, '>=']); - - $candidateTypes[T_IS_GREATER_OR_EQUAL] = $this->configuration['less_and_greater']; - $this->candidatesMap[T_IS_GREATER_OR_EQUAL] = new Token([T_IS_SMALLER_OR_EQUAL, '<=']); - - $candidateTypes['<'] = $this->configuration['less_and_greater']; - $this->candidatesMap['<'] = new Token('>'); - - $candidateTypes['>'] = $this->configuration['less_and_greater']; - $this->candidatesMap['>'] = new Token('<'); - } - - $this->candidateTypesConfiguration = $candidateTypes; - $this->candidateTypes = array_keys($candidateTypes); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php deleted file mode 100644 index eded1614..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer; - -/** - * @author Kuba Werłos - */ -interface DeprecatedFixerInterface extends FixerInterface -{ - /** - * Returns names of fixers to use instead, if any. - * - * @return list - */ - public function getSuccessorsNames(): array; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationArrayAssignmentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationArrayAssignmentFixer.php deleted file mode 100644 index d3158f54..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationArrayAssignmentFixer.php +++ /dev/null @@ -1,114 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\DoctrineAnnotation; - -use PhpCsFixer\AbstractDoctrineAnnotationFixer; -use PhpCsFixer\Doctrine\Annotation\DocLexer; -use PhpCsFixer\Doctrine\Annotation\Tokens; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * Forces the configured operator for assignment in arrays in Doctrine Annotations. - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * ignored_tags?: list, - * operator?: ':'|'=' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * ignored_tags: list, - * operator: ':'|'=' - * } - */ -final class DoctrineAnnotationArrayAssignmentFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Doctrine annotations must use configured operator for assignment in arrays.', - [ - new CodeSample( - " ':'] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before DoctrineAnnotationSpacesFixer. - */ - public function getPriority(): int - { - return 1; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $options = parent::createConfigurationDefinition()->getOptions(); - - $options[] = (new FixerOptionBuilder('operator', 'The operator to use.')) - ->setAllowedValues(['=', ':']) - ->setDefault('=') - ->getOption() - ; - - return new FixerConfigurationResolver($options); - } - - protected function fixAnnotations(Tokens $doctrineAnnotationTokens): void - { - $scopes = []; - foreach ($doctrineAnnotationTokens as $token) { - if ($token->isType(DocLexer::T_OPEN_PARENTHESIS)) { - $scopes[] = 'annotation'; - - continue; - } - - if ($token->isType(DocLexer::T_OPEN_CURLY_BRACES)) { - $scopes[] = 'array'; - - continue; - } - - if ($token->isType([DocLexer::T_CLOSE_PARENTHESIS, DocLexer::T_CLOSE_CURLY_BRACES])) { - array_pop($scopes); - - continue; - } - - if ('array' === end($scopes) && $token->isType([DocLexer::T_EQUALS, DocLexer::T_COLON])) { - $token->setContent($this->configuration['operator']); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationBracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationBracesFixer.php deleted file mode 100644 index 928254a2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationBracesFixer.php +++ /dev/null @@ -1,132 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\DoctrineAnnotation; - -use PhpCsFixer\AbstractDoctrineAnnotationFixer; -use PhpCsFixer\Doctrine\Annotation\DocLexer; -use PhpCsFixer\Doctrine\Annotation\Token; -use PhpCsFixer\Doctrine\Annotation\Tokens; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * Adds braces to Doctrine annotations when missing. - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * ignored_tags?: list, - * syntax?: 'with_braces'|'without_braces' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * ignored_tags: list, - * syntax: 'with_braces'|'without_braces' - * } - */ -final class DoctrineAnnotationBracesFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Doctrine annotations without arguments must use the configured syntax.', - [ - new CodeSample( - " 'with_braces'] - ), - ] - ); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - ...parent::createConfigurationDefinition()->getOptions(), - (new FixerOptionBuilder('syntax', 'Whether to add or remove braces.')) - ->setAllowedValues(['with_braces', 'without_braces']) - ->setDefault('without_braces') - ->getOption(), - ]); - } - - protected function fixAnnotations(Tokens $doctrineAnnotationTokens): void - { - if ('without_braces' === $this->configuration['syntax']) { - $this->removesBracesFromAnnotations($doctrineAnnotationTokens); - } else { - $this->addBracesToAnnotations($doctrineAnnotationTokens); - } - } - - private function addBracesToAnnotations(Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$tokens[$index]->isType(DocLexer::T_AT)) { - continue; - } - - $braceIndex = $tokens->getNextMeaningfulToken($index + 1); - if (null !== $braceIndex && $tokens[$braceIndex]->isType(DocLexer::T_OPEN_PARENTHESIS)) { - continue; - } - - $tokens->insertAt($index + 2, new Token(DocLexer::T_OPEN_PARENTHESIS, '(')); - $tokens->insertAt($index + 3, new Token(DocLexer::T_CLOSE_PARENTHESIS, ')')); - } - } - - private function removesBracesFromAnnotations(Tokens $tokens): void - { - for ($index = 0, $max = \count($tokens); $index < $max; ++$index) { - if (!$tokens[$index]->isType(DocLexer::T_AT)) { - continue; - } - - $openBraceIndex = $tokens->getNextMeaningfulToken($index + 1); - if (null === $openBraceIndex) { - continue; - } - - if (!$tokens[$openBraceIndex]->isType(DocLexer::T_OPEN_PARENTHESIS)) { - continue; - } - - $closeBraceIndex = $tokens->getNextMeaningfulToken($openBraceIndex); - if (null === $closeBraceIndex) { - continue; - } - - if (!$tokens[$closeBraceIndex]->isType(DocLexer::T_CLOSE_PARENTHESIS)) { - continue; - } - - for ($currentIndex = $index + 2; $currentIndex <= $closeBraceIndex; ++$currentIndex) { - $tokens[$currentIndex]->clear(); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php deleted file mode 100644 index c9c01e01..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php +++ /dev/null @@ -1,199 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\DoctrineAnnotation; - -use PhpCsFixer\AbstractDoctrineAnnotationFixer; -use PhpCsFixer\Doctrine\Annotation\DocLexer; -use PhpCsFixer\Doctrine\Annotation\Tokens; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * ignored_tags?: list, - * indent_mixed_lines?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * ignored_tags: list, - * indent_mixed_lines: bool - * } - */ -final class DoctrineAnnotationIndentationFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Doctrine annotations must be indented with four spaces.', - [ - new CodeSample(" true] - ), - ] - ); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - ...parent::createConfigurationDefinition()->getOptions(), - (new FixerOptionBuilder('indent_mixed_lines', 'Whether to indent lines that have content before closing parenthesis.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function fixAnnotations(Tokens $doctrineAnnotationTokens): void - { - $annotationPositions = []; - for ($index = 0, $max = \count($doctrineAnnotationTokens); $index < $max; ++$index) { - if (!$doctrineAnnotationTokens[$index]->isType(DocLexer::T_AT)) { - continue; - } - - $annotationEndIndex = $doctrineAnnotationTokens->getAnnotationEnd($index); - if (null === $annotationEndIndex) { - return; - } - - $annotationPositions[] = [$index, $annotationEndIndex]; - $index = $annotationEndIndex; - } - - $indentLevel = 0; - foreach ($doctrineAnnotationTokens as $index => $token) { - if (!$token->isType(DocLexer::T_NONE) || !str_contains($token->getContent(), "\n")) { - continue; - } - - if (!$this->indentationCanBeFixed($doctrineAnnotationTokens, $index, $annotationPositions)) { - continue; - } - - $braces = $this->getLineBracesCount($doctrineAnnotationTokens, $index); - $delta = $braces[0] - $braces[1]; - $mixedBraces = 0 === $delta && $braces[0] > 0; - $extraIndentLevel = 0; - - if ($indentLevel > 0 && ($delta < 0 || $mixedBraces)) { - --$indentLevel; - - if (true === $this->configuration['indent_mixed_lines'] && $this->isClosingLineWithMeaningfulContent($doctrineAnnotationTokens, $index)) { - $extraIndentLevel = 1; - } - } - - $token->setContent(Preg::replace( - '/(\n( +\*)?) *$/', - '$1'.str_repeat(' ', 4 * ($indentLevel + $extraIndentLevel) + 1), - $token->getContent() - )); - - if ($delta > 0 || $mixedBraces) { - ++$indentLevel; - } - } - } - - /** - * @return array{int, int} - */ - private function getLineBracesCount(Tokens $tokens, int $index): array - { - $opening = 0; - $closing = 0; - - while (isset($tokens[++$index])) { - $token = $tokens[$index]; - if ($token->isType(DocLexer::T_NONE) && str_contains($token->getContent(), "\n")) { - break; - } - - if ($token->isType([DocLexer::T_OPEN_PARENTHESIS, DocLexer::T_OPEN_CURLY_BRACES])) { - ++$opening; - - continue; - } - - if (!$token->isType([DocLexer::T_CLOSE_PARENTHESIS, DocLexer::T_CLOSE_CURLY_BRACES])) { - continue; - } - - if ($opening > 0) { - --$opening; - } else { - ++$closing; - } - } - - return [$opening, $closing]; - } - - private function isClosingLineWithMeaningfulContent(Tokens $tokens, int $index): bool - { - while (isset($tokens[++$index])) { - $token = $tokens[$index]; - if ($token->isType(DocLexer::T_NONE)) { - if (str_contains($token->getContent(), "\n")) { - return false; - } - - continue; - } - - return !$token->isType([DocLexer::T_CLOSE_PARENTHESIS, DocLexer::T_CLOSE_CURLY_BRACES]); - } - - return false; - } - - /** - * @param list $annotationPositions Pairs of begin and end indices of main annotations - */ - private function indentationCanBeFixed(Tokens $tokens, int $newLineTokenIndex, array $annotationPositions): bool - { - foreach ($annotationPositions as $position) { - if ($newLineTokenIndex >= $position[0] && $newLineTokenIndex <= $position[1]) { - return true; - } - } - - for ($index = $newLineTokenIndex + 1, $max = \count($tokens); $index < $max; ++$index) { - $token = $tokens[$index]; - - if (str_contains($token->getContent(), "\n")) { - return false; - } - - return $tokens[$index]->isType(DocLexer::T_AT); - } - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixer.php deleted file mode 100644 index e39fe008..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixer.php +++ /dev/null @@ -1,320 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\DoctrineAnnotation; - -use PhpCsFixer\AbstractDoctrineAnnotationFixer; -use PhpCsFixer\Doctrine\Annotation\DocLexer; -use PhpCsFixer\Doctrine\Annotation\Token; -use PhpCsFixer\Doctrine\Annotation\Tokens; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; - -/** - * Fixes spaces around commas and assignment operators in Doctrine annotations. - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * after_argument_assignments?: bool|null, - * after_array_assignments_colon?: bool|null, - * after_array_assignments_equals?: bool|null, - * around_commas?: bool, - * around_parentheses?: bool, - * before_argument_assignments?: bool|null, - * before_array_assignments_colon?: bool|null, - * before_array_assignments_equals?: bool|null, - * ignored_tags?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * after_argument_assignments: bool|null, - * after_array_assignments_colon: bool|null, - * after_array_assignments_equals: bool|null, - * around_commas: bool, - * around_parentheses: bool, - * before_argument_assignments: bool|null, - * before_array_assignments_colon: bool|null, - * before_array_assignments_equals: bool|null, - * ignored_tags: list - * } - */ -final class DoctrineAnnotationSpacesFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Fixes spaces in Doctrine annotations.', - [ - new CodeSample( - " false, 'before_array_assignments_equals' => false] - ), - ], - 'There must not be any space around parentheses; commas must be preceded by no space and followed by one space; there must be no space around named arguments assignment operator; there must be one space around array assignment operator.' - ); - } - - /** - * {@inheritdoc} - * - * Must run after DoctrineAnnotationArrayAssignmentFixer. - */ - public function getPriority(): int - { - return 0; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - ...parent::createConfigurationDefinition()->getOptions(), - (new FixerOptionBuilder('around_parentheses', 'Whether to fix spaces around parentheses.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('around_commas', 'Whether to fix spaces around commas.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('before_argument_assignments', 'Whether to add, remove or ignore spaces before argument assignment operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('after_argument_assignments', 'Whether to add, remove or ignore spaces after argument assignment operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('before_array_assignments_equals', 'Whether to add, remove or ignore spaces before array `=` assignment operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('after_array_assignments_equals', 'Whether to add, remove or ignore spaces after array assignment `=` operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('before_array_assignments_colon', 'Whether to add, remove or ignore spaces before array `:` assignment operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('after_array_assignments_colon', 'Whether to add, remove or ignore spaces after array assignment `:` operator.')) - ->setAllowedTypes(['null', 'bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - protected function fixAnnotations(Tokens $doctrineAnnotationTokens): void - { - if (true === $this->configuration['around_parentheses']) { - $this->fixSpacesAroundParentheses($doctrineAnnotationTokens); - } - - if (true === $this->configuration['around_commas']) { - $this->fixSpacesAroundCommas($doctrineAnnotationTokens); - } - - if ( - null !== $this->configuration['before_argument_assignments'] - || null !== $this->configuration['after_argument_assignments'] - || null !== $this->configuration['before_array_assignments_equals'] - || null !== $this->configuration['after_array_assignments_equals'] - || null !== $this->configuration['before_array_assignments_colon'] - || null !== $this->configuration['after_array_assignments_colon'] - ) { - $this->fixAroundAssignments($doctrineAnnotationTokens); - } - } - - private function fixSpacesAroundParentheses(Tokens $tokens): void - { - $inAnnotationUntilIndex = null; - - foreach ($tokens as $index => $token) { - if (null !== $inAnnotationUntilIndex) { - if ($index === $inAnnotationUntilIndex) { - $inAnnotationUntilIndex = null; - - continue; - } - } elseif ($tokens[$index]->isType(DocLexer::T_AT)) { - $endIndex = $tokens->getAnnotationEnd($index); - if (null !== $endIndex) { - $inAnnotationUntilIndex = $endIndex + 1; - } - - continue; - } - - if (null === $inAnnotationUntilIndex) { - continue; - } - - if (!$token->isType([DocLexer::T_OPEN_PARENTHESIS, DocLexer::T_CLOSE_PARENTHESIS])) { - continue; - } - - if ($token->isType(DocLexer::T_OPEN_PARENTHESIS)) { - $token = $tokens[$index - 1]; - if ($token->isType(DocLexer::T_NONE)) { - $token->clear(); - } - - $token = $tokens[$index + 1]; - } else { - $token = $tokens[$index - 1]; - } - - if ($token->isType(DocLexer::T_NONE)) { - if (str_contains($token->getContent(), "\n")) { - continue; - } - - $token->clear(); - } - } - } - - private function fixSpacesAroundCommas(Tokens $tokens): void - { - $inAnnotationUntilIndex = null; - - foreach ($tokens as $index => $token) { - if (null !== $inAnnotationUntilIndex) { - if ($index === $inAnnotationUntilIndex) { - $inAnnotationUntilIndex = null; - - continue; - } - } elseif ($tokens[$index]->isType(DocLexer::T_AT)) { - $endIndex = $tokens->getAnnotationEnd($index); - if (null !== $endIndex) { - $inAnnotationUntilIndex = $endIndex; - } - - continue; - } - - if (null === $inAnnotationUntilIndex) { - continue; - } - - if (!$token->isType(DocLexer::T_COMMA)) { - continue; - } - - $token = $tokens[$index - 1]; - if ($token->isType(DocLexer::T_NONE)) { - $token->clear(); - } - - if ($index < \count($tokens) - 1 && !Preg::match('/^\s/', $tokens[$index + 1]->getContent())) { - $tokens->insertAt($index + 1, new Token(DocLexer::T_NONE, ' ')); - } - } - } - - private function fixAroundAssignments(Tokens $tokens): void - { - $beforeArguments = $this->configuration['before_argument_assignments']; - $afterArguments = $this->configuration['after_argument_assignments']; - $beforeArraysEquals = $this->configuration['before_array_assignments_equals']; - $afterArraysEquals = $this->configuration['after_array_assignments_equals']; - $beforeArraysColon = $this->configuration['before_array_assignments_colon']; - $afterArraysColon = $this->configuration['after_array_assignments_colon']; - - $scopes = []; - foreach ($tokens as $index => $token) { - $endScopeType = end($scopes); - if (false !== $endScopeType && $token->isType($endScopeType)) { - array_pop($scopes); - - continue; - } - - if ($tokens[$index]->isType(DocLexer::T_AT)) { - $scopes[] = DocLexer::T_CLOSE_PARENTHESIS; - - continue; - } - - if ($tokens[$index]->isType(DocLexer::T_OPEN_CURLY_BRACES)) { - $scopes[] = DocLexer::T_CLOSE_CURLY_BRACES; - - continue; - } - - if (DocLexer::T_CLOSE_PARENTHESIS === $endScopeType && $token->isType(DocLexer::T_EQUALS)) { - $this->updateSpacesAfter($tokens, $index, $afterArguments); - $this->updateSpacesBefore($tokens, $index, $beforeArguments); - - continue; - } - - if (DocLexer::T_CLOSE_CURLY_BRACES === $endScopeType) { - if ($token->isType(DocLexer::T_EQUALS)) { - $this->updateSpacesAfter($tokens, $index, $afterArraysEquals); - $this->updateSpacesBefore($tokens, $index, $beforeArraysEquals); - - continue; - } - - if ($token->isType(DocLexer::T_COLON)) { - $this->updateSpacesAfter($tokens, $index, $afterArraysColon); - $this->updateSpacesBefore($tokens, $index, $beforeArraysColon); - } - } - } - } - - private function updateSpacesAfter(Tokens $tokens, int $index, ?bool $insert): void - { - $this->updateSpacesAt($tokens, $index + 1, $index + 1, $insert); - } - - private function updateSpacesBefore(Tokens $tokens, int $index, ?bool $insert): void - { - $this->updateSpacesAt($tokens, $index - 1, $index, $insert); - } - - private function updateSpacesAt(Tokens $tokens, int $index, int $insertIndex, ?bool $insert): void - { - if (null === $insert) { - return; - } - - $token = $tokens[$index]; - if ($insert) { - if (!$token->isType(DocLexer::T_NONE)) { - $tokens->insertAt($insertIndex, $token = new Token()); - } - - $token->setContent(' '); - } elseif ($token->isType(DocLexer::T_NONE)) { - $token->clear(); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php deleted file mode 100644 index 9ade1875..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php +++ /dev/null @@ -1,20 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer; - -/** - * @internal - */ -interface ExperimentalFixerInterface extends FixerInterface {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FixerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FixerInterface.php deleted file mode 100644 index 6e79741b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FixerInterface.php +++ /dev/null @@ -1,79 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer; - -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * @author Fabien Potencier - */ -interface FixerInterface -{ - /** - * Check if the fixer is a candidate for given Tokens collection. - * - * Fixer is a candidate when the collection contains tokens that may be fixed - * during fixer work. This could be considered as some kind of bloom filter. - * When this method returns true then to the Tokens collection may or may not - * need a fixing, but when this method returns false then the Tokens collection - * need no fixing for sure. - */ - public function isCandidate(Tokens $tokens): bool; - - /** - * Check if fixer is risky or not. - * - * Risky fixer could change code behavior! - */ - public function isRisky(): bool; - - /** - * Fixes a file. - * - * @param \SplFileInfo $file A \SplFileInfo instance - * @param Tokens $tokens Tokens collection - */ - public function fix(\SplFileInfo $file, Tokens $tokens): void; - - /** - * Returns the definition of the fixer. - */ - public function getDefinition(): FixerDefinitionInterface; - - /** - * Returns the name of the fixer. - * - * The name must be all lowercase and without any spaces. - * - * @return string The name of the fixer - */ - public function getName(): string; - - /** - * Returns the priority of the fixer. - * - * The default priority is 0 and higher priorities are executed first. - */ - public function getPriority(): int; - - /** - * Returns true if the file is supported by this fixer. - * - * @return bool true if the file is supported by this fixer, false otherwise - */ - public function supports(\SplFileInfo $file): bool; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php deleted file mode 100644 index 39841f2d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php +++ /dev/null @@ -1,224 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Gregor Harlan - */ -final class CombineNestedDirnameFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replace multiple nested calls of `dirname` by only one call with second `$level` parameter.', - [ - new CodeSample( - "isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * Must run before MethodArgumentSpaceFixer, NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. - * Must run after DirConstantFixer. - */ - public function getPriority(): int - { - return 35; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; 0 <= $index; --$index) { - $dirnameInfo = $this->getDirnameInfo($tokens, $index); - - if (false === $dirnameInfo) { - continue; - } - - $prev = $tokens->getPrevMeaningfulToken($dirnameInfo['indices'][0]); - - if (!$tokens[$prev]->equals('(')) { - continue; - } - - $prev = $tokens->getPrevMeaningfulToken($prev); - $firstArgumentEnd = $dirnameInfo['end']; - $dirnameInfoArray = [$dirnameInfo]; - - while ($dirnameInfo = $this->getDirnameInfo($tokens, $prev, $firstArgumentEnd)) { - $dirnameInfoArray[] = $dirnameInfo; - $prev = $tokens->getPrevMeaningfulToken($dirnameInfo['indices'][0]); - - if (!$tokens[$prev]->equals('(')) { - break; - } - - $prev = $tokens->getPrevMeaningfulToken($prev); - $firstArgumentEnd = $dirnameInfo['end']; - } - - if (\count($dirnameInfoArray) > 1) { - $this->combineDirnames($tokens, $dirnameInfoArray); - } - - $index = $prev; - } - } - - /** - * @param int $index Index of `dirname` - * @param null|int $firstArgumentEndIndex Index of last token of first argument of `dirname` call - * - * @return array{indices: list, secondArgument?: int, levels: int, end: int}|false `false` when it is not a (supported) `dirname` call, an array with info about the dirname call otherwise - */ - private function getDirnameInfo(Tokens $tokens, int $index, ?int $firstArgumentEndIndex = null) - { - if (!$tokens[$index]->equals([T_STRING, 'dirname'], false)) { - return false; - } - - if (!(new FunctionsAnalyzer())->isGlobalFunctionCall($tokens, $index)) { - return false; - } - - $info = ['indices' => []]; - $prev = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$prev]->isGivenKind(T_NS_SEPARATOR)) { - $info['indices'][] = $prev; - } - - $info['indices'][] = $index; - - // opening parenthesis "(" - $next = $tokens->getNextMeaningfulToken($index); - $info['indices'][] = $next; - - if (null !== $firstArgumentEndIndex) { - $next = $tokens->getNextMeaningfulToken($firstArgumentEndIndex); - } else { - $next = $tokens->getNextMeaningfulToken($next); - - if ($tokens[$next]->equals(')')) { - return false; - } - - while (!$tokens[$next]->equalsAny([',', ')'])) { - $blockType = Tokens::detectBlockType($tokens[$next]); - - if (null !== $blockType) { - $next = $tokens->findBlockEnd($blockType['type'], $next); - } - - $next = $tokens->getNextMeaningfulToken($next); - } - } - - $info['indices'][] = $next; - - if ($tokens[$next]->equals(',')) { - $next = $tokens->getNextMeaningfulToken($next); - $info['indices'][] = $next; - } - - if ($tokens[$next]->equals(')')) { - $info['levels'] = 1; - $info['end'] = $next; - - return $info; - } - - if (!$tokens[$next]->isGivenKind(T_LNUMBER)) { - return false; - } - - $info['secondArgument'] = $next; - $info['levels'] = (int) $tokens[$next]->getContent(); - - $next = $tokens->getNextMeaningfulToken($next); - - if ($tokens[$next]->equals(',')) { - $info['indices'][] = $next; - $next = $tokens->getNextMeaningfulToken($next); - } - - if (!$tokens[$next]->equals(')')) { - return false; - } - - $info['indices'][] = $next; - $info['end'] = $next; - - return $info; - } - - /** - * @param non-empty-list, secondArgument?: int, levels: int, end: int}> $dirnameInfoArray - */ - private function combineDirnames(Tokens $tokens, array $dirnameInfoArray): void - { - $outerDirnameInfo = array_pop($dirnameInfoArray); - $levels = $outerDirnameInfo['levels']; - - foreach ($dirnameInfoArray as $dirnameInfo) { - $levels += $dirnameInfo['levels']; - - foreach ($dirnameInfo['indices'] as $index) { - $tokens->removeLeadingWhitespace($index); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - } - - $levelsToken = new Token([T_LNUMBER, (string) $levels]); - - if (isset($outerDirnameInfo['secondArgument'])) { - $tokens[$outerDirnameInfo['secondArgument']] = $levelsToken; - } else { - $prev = $tokens->getPrevMeaningfulToken($outerDirnameInfo['end']); - $items = []; - - if (!$tokens[$prev]->equals(',')) { - $items = [new Token(','), new Token([T_WHITESPACE, ' '])]; - } - - $items[] = $levelsToken; - $tokens->insertAt($outerDirnameInfo['end'], $items); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php deleted file mode 100644 index 4888fe40..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php +++ /dev/null @@ -1,164 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class DateTimeCreateFromFormatCallFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'The first argument of `DateTime::createFromFormat` method must start with `!`.', - [ - new CodeSample("isTokenKindFound(T_DOUBLE_COLON); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $argumentsAnalyzer = new ArgumentsAnalyzer(); - $namespaceUsesAnalyzer = new NamespaceUsesAnalyzer(); - - foreach ($tokens->getNamespaceDeclarations() as $namespace) { - $scopeStartIndex = $namespace->getScopeStartIndex(); - $useDeclarations = $namespaceUsesAnalyzer->getDeclarationsInNamespace($tokens, $namespace); - - for ($index = $namespace->getScopeEndIndex(); $index > $scopeStartIndex; --$index) { - if (!$tokens[$index]->isGivenKind(T_DOUBLE_COLON)) { - continue; - } - - $functionNameIndex = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$functionNameIndex]->equals([T_STRING, 'createFromFormat'], false)) { - continue; - } - - if (!$tokens[$tokens->getNextMeaningfulToken($functionNameIndex)]->equals('(')) { - continue; - } - - $classNameIndex = $tokens->getPrevMeaningfulToken($index); - - if (!$tokens[$classNameIndex]->equalsAny([[T_STRING, \DateTime::class], [T_STRING, \DateTimeImmutable::class]], false)) { - continue; - } - - $preClassNameIndex = $tokens->getPrevMeaningfulToken($classNameIndex); - - if ($tokens[$preClassNameIndex]->isGivenKind(T_NS_SEPARATOR)) { - if ($tokens[$tokens->getPrevMeaningfulToken($preClassNameIndex)]->isGivenKind(T_STRING)) { - continue; - } - } elseif (!$namespace->isGlobalNamespace()) { - continue; - } else { - foreach ($useDeclarations as $useDeclaration) { - foreach (['datetime', 'datetimeimmutable'] as $name) { - if ($name === strtolower($useDeclaration->getShortName()) && $name !== strtolower($useDeclaration->getFullName())) { - continue 3; - } - } - } - } - - $openIndex = $tokens->getNextTokenOfKind($functionNameIndex, ['(']); - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); - - $argumentIndex = $this->getFirstArgumentTokenIndex($tokens, $argumentsAnalyzer->getArguments($tokens, $openIndex, $closeIndex)); - - if (null === $argumentIndex) { - continue; - } - - $format = $tokens[$argumentIndex]->getContent(); - - if (\strlen($format) < 3) { - continue; - } - - $offset = 'b' === $format[0] || 'B' === $format[0] ? 2 : 1; - - if ('!' === $format[$offset]) { - continue; - } - - $tokens->clearAt($argumentIndex); - $tokens->insertAt($argumentIndex, new Token([T_CONSTANT_ENCAPSED_STRING, substr_replace($format, '!', $offset, 0)])); - } - } - } - - /** - * @param array $arguments - */ - private function getFirstArgumentTokenIndex(Tokens $tokens, array $arguments): ?int - { - if (2 !== \count($arguments)) { - return null; - } - - $argumentStartIndex = array_key_first($arguments); - $argumentEndIndex = $arguments[$argumentStartIndex]; - $argumentStartIndex = $tokens->getNextMeaningfulToken($argumentStartIndex - 1); - - if ( - $argumentStartIndex !== $argumentEndIndex - && $tokens->getNextMeaningfulToken($argumentStartIndex) <= $argumentEndIndex - ) { - return null; // argument is not a simple single string - } - - return !$tokens[$argumentStartIndex]->isGivenKind(T_CONSTANT_ENCAPSED_STRING) - ? null // first argument is not a string - : $argumentStartIndex; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php deleted file mode 100644 index 3bf72e22..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php +++ /dev/null @@ -1,123 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFopenFlagFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class FopenFlagOrderFixer extends AbstractFopenFlagFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Order the flags in `fopen` calls, `b` and `t` must be last.', - [new CodeSample("isGivenKind([T_WHITESPACE, T_COMMENT, T_DOC_COMMENT])) { - continue; - } - - if (null !== $argumentFlagIndex) { - return; // multiple meaningful tokens found, no candidate for fixing - } - - $argumentFlagIndex = $i; - } - - // check if second argument is candidate - if (null === $argumentFlagIndex || !$tokens[$argumentFlagIndex]->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { - return; - } - - $content = $tokens[$argumentFlagIndex]->getContent(); - $contentQuote = $content[0]; // `'`, `"`, `b` or `B` - - if ('b' === $contentQuote || 'B' === $contentQuote) { - $binPrefix = $contentQuote; - $contentQuote = $content[1]; // `'` or `"` - $mode = substr($content, 2, -1); - } else { - $binPrefix = ''; - $mode = substr($content, 1, -1); - } - - $modeLength = \strlen($mode); - if ($modeLength < 2) { - return; // nothing to sort - } - - if (false === $this->isValidModeString($mode)) { - return; - } - - $split = $this->sortFlags(Preg::split('#([^\+]\+?)#', $mode, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)); - $newContent = $binPrefix.$contentQuote.implode('', $split).$contentQuote; - - if ($content !== $newContent) { - $tokens[$argumentFlagIndex] = new Token([T_CONSTANT_ENCAPSED_STRING, $newContent]); - } - } - - /** - * @param list $flags - * - * @return list - */ - private function sortFlags(array $flags): array - { - usort( - $flags, - static function (string $flag1, string $flag2): int { - if ($flag1 === $flag2) { - return 0; - } - - if ('b' === $flag1) { - return 1; - } - - if ('b' === $flag2) { - return -1; - } - - if ('t' === $flag1) { - return 1; - } - - if ('t' === $flag2) { - return -1; - } - - return $flag1 < $flag2 ? -1 : 1; - } - ); - - return $flags; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagsFixer.php deleted file mode 100644 index b363dc87..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagsFixer.php +++ /dev/null @@ -1,120 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFopenFlagFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * b_mode?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * b_mode: bool - * } - */ -final class FopenFlagsFixer extends AbstractFopenFlagFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'The flags in `fopen` calls must omit `t`, and `b` must be omitted or included consistently.', - [ - new CodeSample(" false]), - ], - null, - 'Risky when the function `fopen` is overridden.' - ); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('b_mode', 'The `b` flag must be used (`true`) or omitted (`false`).')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - protected function fixFopenFlagToken(Tokens $tokens, int $argumentStartIndex, int $argumentEndIndex): void - { - $argumentFlagIndex = null; - - for ($i = $argumentStartIndex; $i <= $argumentEndIndex; ++$i) { - if ($tokens[$i]->isGivenKind([T_WHITESPACE, T_COMMENT, T_DOC_COMMENT])) { - continue; - } - - if (null !== $argumentFlagIndex) { - return; // multiple meaningful tokens found, no candidate for fixing - } - - $argumentFlagIndex = $i; - } - - // check if second argument is candidate - if (null === $argumentFlagIndex || !$tokens[$argumentFlagIndex]->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { - return; - } - - $content = $tokens[$argumentFlagIndex]->getContent(); - $contentQuote = $content[0]; // `'`, `"`, `b` or `B` - - if ('b' === $contentQuote || 'B' === $contentQuote) { - $binPrefix = $contentQuote; - $contentQuote = $content[1]; // `'` or `"` - $mode = substr($content, 2, -1); - } else { - $binPrefix = ''; - $mode = substr($content, 1, -1); - } - - if (false === $this->isValidModeString($mode)) { - return; - } - - $mode = str_replace('t', '', $mode); - - if (true === $this->configuration['b_mode']) { - if (!str_contains($mode, 'b')) { - $mode .= 'b'; - } - } else { - $mode = str_replace('b', '', $mode); - } - - $newContent = $binPrefix.$contentQuote.$mode.$contentQuote; - - if ($content !== $newContent) { - $tokens[$argumentFlagIndex] = new Token([T_CONSTANT_ENCAPSED_STRING, $newContent]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionDeclarationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionDeclarationFixer.php deleted file mode 100644 index 2f200630..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionDeclarationFixer.php +++ /dev/null @@ -1,263 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * Fixer for rules defined in PSR2 generally (¶1 and ¶6). - * - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * closure_fn_spacing?: 'none'|'one', - * closure_function_spacing?: 'none'|'one', - * trailing_comma_single_line?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * closure_fn_spacing: 'none'|'one', - * closure_function_spacing: 'none'|'one', - * trailing_comma_single_line: bool - * } - */ -final class FunctionDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const SPACING_NONE = 'none'; - - /** - * @internal - */ - public const SPACING_ONE = 'one'; - - private const SUPPORTED_SPACINGS = [self::SPACING_NONE, self::SPACING_ONE]; - - private string $singleLineWhitespaceOptions = " \t"; - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Spaces should be properly placed in a function declaration.', - [ - new CodeSample( - ' self::SPACING_NONE] - ), - new CodeSample( - ' null; -', - ['closure_fn_spacing' => self::SPACING_NONE] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before MethodArgumentSpaceFixer. - * Must run after SingleSpaceAfterConstructFixer, SingleSpaceAroundConstructFixer, UseArrowFunctionsFixer. - */ - public function getPriority(): int - { - return 31; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind([T_FUNCTION, T_FN])) { - continue; - } - - $startParenthesisIndex = $tokens->getNextTokenOfKind($index, ['(', ';', [T_CLOSE_TAG]]); - - if (!$tokens[$startParenthesisIndex]->equals('(')) { - continue; - } - - $endParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startParenthesisIndex); - - if (false === $this->configuration['trailing_comma_single_line'] - && !$tokens->isPartialCodeMultiline($index, $endParenthesisIndex) - ) { - $commaIndex = $tokens->getPrevMeaningfulToken($endParenthesisIndex); - - if ($tokens[$commaIndex]->equals(',')) { - $tokens->clearTokenAndMergeSurroundingWhitespace($commaIndex); - } - } - - $startBraceIndex = $tokens->getNextTokenOfKind($endParenthesisIndex, [';', '{', [T_DOUBLE_ARROW]]); - - // fix single-line whitespace before { or => - // eg: `function foo(){}` => `function foo() {}` - // eg: `function foo() {}` => `function foo() {}` - // eg: `fn() =>` => `fn() =>` - if ( - $tokens[$startBraceIndex]->equalsAny(['{', [T_DOUBLE_ARROW]]) - && ( - !$tokens[$startBraceIndex - 1]->isWhitespace() - || $tokens[$startBraceIndex - 1]->isWhitespace($this->singleLineWhitespaceOptions) - ) - ) { - $tokens->ensureWhitespaceAtIndex($startBraceIndex - 1, 1, ' '); - } - - $afterParenthesisIndex = $tokens->getNextNonWhitespace($endParenthesisIndex); - $afterParenthesisToken = $tokens[$afterParenthesisIndex]; - - if ($afterParenthesisToken->isGivenKind(CT::T_USE_LAMBDA)) { - // fix whitespace after CT:T_USE_LAMBDA (we might add a token, so do this before determining start and end parenthesis) - $tokens->ensureWhitespaceAtIndex($afterParenthesisIndex + 1, 0, ' '); - - $useStartParenthesisIndex = $tokens->getNextTokenOfKind($afterParenthesisIndex, ['(']); - $useEndParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $useStartParenthesisIndex); - - if (false === $this->configuration['trailing_comma_single_line'] - && !$tokens->isPartialCodeMultiline($index, $useEndParenthesisIndex) - ) { - $commaIndex = $tokens->getPrevMeaningfulToken($useEndParenthesisIndex); - - if ($tokens[$commaIndex]->equals(',')) { - $tokens->clearTokenAndMergeSurroundingWhitespace($commaIndex); - } - } - - // remove single-line edge whitespaces inside use parentheses - $this->fixParenthesisInnerEdge($tokens, $useStartParenthesisIndex, $useEndParenthesisIndex); - - // fix whitespace before CT::T_USE_LAMBDA - $tokens->ensureWhitespaceAtIndex($afterParenthesisIndex - 1, 1, ' '); - } - - // remove single-line edge whitespaces inside parameters list parentheses - $this->fixParenthesisInnerEdge($tokens, $startParenthesisIndex, $endParenthesisIndex); - $isLambda = $tokensAnalyzer->isLambda($index); - - // remove whitespace before ( - // eg: `function foo () {}` => `function foo() {}` - if (!$isLambda && $tokens[$startParenthesisIndex - 1]->isWhitespace() && !$tokens[$tokens->getPrevNonWhitespace($startParenthesisIndex - 1)]->isComment()) { - $tokens->clearAt($startParenthesisIndex - 1); - } - - $option = $token->isGivenKind(T_FN) ? 'closure_fn_spacing' : 'closure_function_spacing'; - - if ($isLambda && self::SPACING_NONE === $this->configuration[$option]) { - // optionally remove whitespace after T_FUNCTION of a closure - // eg: `function () {}` => `function() {}` - if ($tokens[$index + 1]->isWhitespace()) { - $tokens->clearAt($index + 1); - } - } else { - // otherwise, enforce whitespace after T_FUNCTION - // eg: `function foo() {}` => `function foo() {}` - $tokens->ensureWhitespaceAtIndex($index + 1, 0, ' '); - } - - if ($isLambda) { - $prev = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$prev]->isGivenKind(T_STATIC)) { - // fix whitespace after T_STATIC - // eg: `$a = static function(){};` => `$a = static function(){};` - $tokens->ensureWhitespaceAtIndex($prev + 1, 0, ' '); - } - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('closure_function_spacing', 'Spacing to use before open parenthesis for closures.')) - ->setDefault(self::SPACING_ONE) - ->setAllowedValues(self::SUPPORTED_SPACINGS) - ->getOption(), - (new FixerOptionBuilder('closure_fn_spacing', 'Spacing to use before open parenthesis for short arrow functions.')) - ->setDefault(self::SPACING_ONE) // @TODO change to SPACING_NONE on next major 4.0 - ->setAllowedValues(self::SUPPORTED_SPACINGS) - ->getOption(), - (new FixerOptionBuilder('trailing_comma_single_line', 'Whether trailing commas are allowed in single line signatures.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - private function fixParenthesisInnerEdge(Tokens $tokens, int $start, int $end): void - { - do { - --$end; - } while ($tokens->isEmptyAt($end)); - - // remove single-line whitespace before `)` - if ($tokens[$end]->isWhitespace($this->singleLineWhitespaceOptions)) { - $tokens->clearAt($end); - } - - // remove single-line whitespace after `(` - if ($tokens[$start + 1]->isWhitespace($this->singleLineWhitespaceOptions)) { - $tokens->clearAt($start + 1); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionTypehintSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionTypehintSpaceFixer.php deleted file mode 100644 index 132f7c13..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FunctionTypehintSpaceFixer.php +++ /dev/null @@ -1,60 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\Fixer\Whitespace\TypeDeclarationSpacesFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @deprecated - */ -final class FunctionTypehintSpaceFixer extends AbstractProxyFixer implements DeprecatedFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Ensure single space between function\'s argument and its typehint.', - [ - new CodeSample("isAnyTokenKindsFound([T_FUNCTION, T_FN]); - } - - public function getSuccessorsNames(): array - { - return array_keys($this->proxyFixers); - } - - protected function createProxyFixers(): array - { - $fixer = new TypeDeclarationSpacesFixer(); - $fixer->configure(['elements' => ['function']]); - - return [$fixer]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php deleted file mode 100644 index 4561c393..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php +++ /dev/null @@ -1,139 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - */ -final class ImplodeCallFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Function `implode` must be called with 2 arguments in the documented order.', - [ - new CodeSample("isTokenKindFound(T_STRING); - } - - /** - * {@inheritdoc} - * - * Must run before MethodArgumentSpaceFixer. - * Must run after NoAliasFunctionsFixer. - */ - public function getPriority(): int - { - return 37; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - for ($index = \count($tokens) - 1; $index > 0; --$index) { - if (!$tokens[$index]->equals([T_STRING, 'implode'], false)) { - continue; - } - - if (!$functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { - continue; - } - - $argumentsIndices = $this->getArgumentIndices($tokens, $index); - - if (1 === \count($argumentsIndices)) { - $firstArgumentIndex = array_key_first($argumentsIndices); - $tokens->insertAt($firstArgumentIndex, [ - new Token([T_CONSTANT_ENCAPSED_STRING, "''"]), - new Token(','), - new Token([T_WHITESPACE, ' ']), - ]); - - continue; - } - - if (2 === \count($argumentsIndices)) { - [$firstArgumentIndex, $secondArgumentIndex] = array_keys($argumentsIndices); - - // If the first argument is string we have nothing to do - if ($tokens[$firstArgumentIndex]->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { - continue; - } - // If the second argument is not string we cannot make a swap - if (!$tokens[$secondArgumentIndex]->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { - continue; - } - - // collect tokens from first argument - $firstArgumentEndIndex = $argumentsIndices[key($argumentsIndices)]; - $newSecondArgumentTokens = []; - for ($i = array_key_first($argumentsIndices); $i <= $firstArgumentEndIndex; ++$i) { - $newSecondArgumentTokens[] = clone $tokens[$i]; - $tokens->clearAt($i); - } - - $tokens->insertAt($firstArgumentIndex, clone $tokens[$secondArgumentIndex]); - - // insert above increased the second argument index - ++$secondArgumentIndex; - $tokens->clearAt($secondArgumentIndex); - $tokens->insertAt($secondArgumentIndex, $newSecondArgumentTokens); - } - } - } - - /** - * @return array In the format: startIndex => endIndex - */ - private function getArgumentIndices(Tokens $tokens, int $functionNameIndex): array - { - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - $openParenthesis = $tokens->getNextTokenOfKind($functionNameIndex, ['(']); - $closeParenthesis = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openParenthesis); - - $indices = []; - - foreach ($argumentsAnalyzer->getArguments($tokens, $openParenthesis, $closeParenthesis) as $startIndexCandidate => $endIndex) { - $indices[$tokens->getNextMeaningfulToken($startIndexCandidate - 1)] = $tokens->getPrevMeaningfulToken($endIndex + 1); - } - - return $indices; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php deleted file mode 100644 index 80fa74fd..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php +++ /dev/null @@ -1,350 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -final class LambdaNotUsedImportFixer extends AbstractFixer -{ - private ArgumentsAnalyzer $argumentsAnalyzer; - - private FunctionsAnalyzer $functionAnalyzer; - - private TokensAnalyzer $tokensAnalyzer; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Lambda must not import variables it doesn\'t use.', - [new CodeSample("isAllTokenKindsFound([T_FUNCTION, CT::T_USE_LAMBDA]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->argumentsAnalyzer = new ArgumentsAnalyzer(); - $this->functionAnalyzer = new FunctionsAnalyzer(); - $this->tokensAnalyzer = new TokensAnalyzer($tokens); - - for ($index = $tokens->count() - 4; $index > 0; --$index) { - $lambdaUseIndex = $this->getLambdaUseIndex($tokens, $index); - - if (false !== $lambdaUseIndex) { - $this->fixLambda($tokens, $lambdaUseIndex); - } - } - } - - private function fixLambda(Tokens $tokens, int $lambdaUseIndex): void - { - $lambdaUseOpenBraceIndex = $tokens->getNextTokenOfKind($lambdaUseIndex, ['(']); - $lambdaUseCloseBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $lambdaUseOpenBraceIndex); - $arguments = $this->argumentsAnalyzer->getArguments($tokens, $lambdaUseOpenBraceIndex, $lambdaUseCloseBraceIndex); - - $imports = $this->filterArguments($tokens, $arguments); - - if (0 === \count($imports)) { - return; // no imports to remove - } - - $notUsedImports = $this->findNotUsedLambdaImports($tokens, $imports, $lambdaUseCloseBraceIndex); - $notUsedImportsCount = \count($notUsedImports); - - if (0 === $notUsedImportsCount) { - return; // no not used imports found - } - - if ($notUsedImportsCount === \count($arguments)) { - $this->clearImportsAndUse($tokens, $lambdaUseIndex, $lambdaUseCloseBraceIndex); // all imports are not used - - return; - } - - $this->clearImports($tokens, array_reverse($notUsedImports)); - } - - /** - * @param array $imports - * - * @return array - */ - private function findNotUsedLambdaImports(Tokens $tokens, array $imports, int $lambdaUseCloseBraceIndex): array - { - static $riskyKinds = [ - CT::T_DYNAMIC_VAR_BRACE_OPEN, - T_EVAL, - T_INCLUDE, - T_INCLUDE_ONCE, - T_REQUIRE, - T_REQUIRE_ONCE, - ]; - - // figure out where the lambda starts ... - $lambdaOpenIndex = $tokens->getNextTokenOfKind($lambdaUseCloseBraceIndex, ['{']); - $curlyBracesLevel = 0; - - for ($index = $lambdaOpenIndex;; ++$index) { // go through the body of the lambda and keep count of the (possible) usages of the imported variables - $token = $tokens[$index]; - - if ($token->equals('{')) { - ++$curlyBracesLevel; - - continue; - } - - if ($token->equals('}')) { - --$curlyBracesLevel; - - if (0 === $curlyBracesLevel) { - break; - } - - continue; - } - - if ($token->isGivenKind(T_STRING) && 'compact' === strtolower($token->getContent()) && $this->functionAnalyzer->isGlobalFunctionCall($tokens, $index)) { - return []; // wouldn't touch it with a ten-foot pole - } - - if ($token->isGivenKind($riskyKinds)) { - return []; - } - - if ($token->equals('$')) { - $nextIndex = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$nextIndex]->isGivenKind(T_VARIABLE)) { - return []; // "$$a" case - } - } - - if ($token->isGivenKind(T_VARIABLE)) { - $content = $token->getContent(); - - if (isset($imports[$content])) { - unset($imports[$content]); - - if (0 === \count($imports)) { - return $imports; - } - } - } - - if ($token->isGivenKind(T_STRING_VARNAME)) { - $content = '$'.$token->getContent(); - - if (isset($imports[$content])) { - unset($imports[$content]); - - if (0 === \count($imports)) { - return $imports; - } - } - } - - if ($token->isClassy()) { // is anonymous class - // check if used as argument in the constructor of the anonymous class - $index = $tokens->getNextTokenOfKind($index, ['(', '{']); - - if ($tokens[$index]->equals('(')) { - $closeBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $arguments = $this->argumentsAnalyzer->getArguments($tokens, $index, $closeBraceIndex); - - $imports = $this->countImportsUsedAsArgument($tokens, $imports, $arguments); - - $index = $tokens->getNextTokenOfKind($closeBraceIndex, ['{']); - } - - // skip body - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - - continue; - } - - if ($token->isGivenKind(T_FUNCTION)) { - // check if used as argument - $lambdaUseOpenBraceIndex = $tokens->getNextTokenOfKind($index, ['(']); - $lambdaUseCloseBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $lambdaUseOpenBraceIndex); - $arguments = $this->argumentsAnalyzer->getArguments($tokens, $lambdaUseOpenBraceIndex, $lambdaUseCloseBraceIndex); - - $imports = $this->countImportsUsedAsArgument($tokens, $imports, $arguments); - - // check if used as import - $index = $tokens->getNextTokenOfKind($index, [[CT::T_USE_LAMBDA], '{']); - - if ($tokens[$index]->isGivenKind(CT::T_USE_LAMBDA)) { - $lambdaUseOpenBraceIndex = $tokens->getNextTokenOfKind($index, ['(']); - $lambdaUseCloseBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $lambdaUseOpenBraceIndex); - $arguments = $this->argumentsAnalyzer->getArguments($tokens, $lambdaUseOpenBraceIndex, $lambdaUseCloseBraceIndex); - - $imports = $this->countImportsUsedAsArgument($tokens, $imports, $arguments); - - $index = $tokens->getNextTokenOfKind($lambdaUseCloseBraceIndex, ['{']); - } - - // skip body - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - - continue; - } - } - - return $imports; - } - - /** - * @param array $imports - * @param array $arguments - * - * @return array - */ - private function countImportsUsedAsArgument(Tokens $tokens, array $imports, array $arguments): array - { - foreach ($arguments as $start => $end) { - $info = $this->argumentsAnalyzer->getArgumentInfo($tokens, $start, $end); - $content = $info->getName(); - - if (isset($imports[$content])) { - unset($imports[$content]); - - if (0 === \count($imports)) { - return $imports; - } - } - } - - return $imports; - } - - /** - * @return false|int - */ - private function getLambdaUseIndex(Tokens $tokens, int $index) - { - if (!$tokens[$index]->isGivenKind(T_FUNCTION) || !$this->tokensAnalyzer->isLambda($index)) { - return false; - } - - $lambdaUseIndex = $tokens->getNextMeaningfulToken($index); // we are @ '(' or '&' after this - - if ($tokens[$lambdaUseIndex]->isGivenKind(CT::T_RETURN_REF)) { - $lambdaUseIndex = $tokens->getNextMeaningfulToken($lambdaUseIndex); - } - - $lambdaUseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $lambdaUseIndex); // we are @ ')' after this - $lambdaUseIndex = $tokens->getNextMeaningfulToken($lambdaUseIndex); - - if (!$tokens[$lambdaUseIndex]->isGivenKind(CT::T_USE_LAMBDA)) { - return false; - } - - return $lambdaUseIndex; - } - - /** - * @param array $arguments - * - * @return array - */ - private function filterArguments(Tokens $tokens, array $arguments): array - { - $imports = []; - - foreach ($arguments as $start => $end) { - $info = $this->argumentsAnalyzer->getArgumentInfo($tokens, $start, $end); - $argument = $info->getNameIndex(); - - if ($tokens[$tokens->getPrevMeaningfulToken($argument)]->equals('&')) { - continue; - } - - $argumentCandidate = $tokens[$argument]; - - if ('$this' === $argumentCandidate->getContent()) { - continue; - } - - if ($this->tokensAnalyzer->isSuperGlobal($argument)) { - continue; - } - - $imports[$argumentCandidate->getContent()] = $argument; - } - - return $imports; - } - - /** - * @param array $imports - */ - private function clearImports(Tokens $tokens, array $imports): void - { - foreach ($imports as $removeIndex) { - $tokens->clearTokenAndMergeSurroundingWhitespace($removeIndex); - $previousRemoveIndex = $tokens->getPrevMeaningfulToken($removeIndex); - - if ($tokens[$previousRemoveIndex]->equals(',')) { - $tokens->clearTokenAndMergeSurroundingWhitespace($previousRemoveIndex); - } elseif ($tokens[$previousRemoveIndex]->equals('(')) { - $tokens->clearTokenAndMergeSurroundingWhitespace($tokens->getNextMeaningfulToken($removeIndex)); // next is always ',' here - } - } - } - - /** - * Remove `use` and all imported variables. - */ - private function clearImportsAndUse(Tokens $tokens, int $lambdaUseIndex, int $lambdaUseCloseBraceIndex): void - { - for ($i = $lambdaUseCloseBraceIndex; $i >= $lambdaUseIndex; --$i) { - if ($tokens[$i]->isComment()) { - continue; - } - - if ($tokens[$i]->isWhitespace()) { - $previousIndex = $tokens->getPrevNonWhitespace($i); - - if ($tokens[$previousIndex]->isComment()) { - continue; - } - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php deleted file mode 100644 index 612fa4b7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php +++ /dev/null @@ -1,509 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuanhung Chen - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * after_heredoc?: bool, - * attribute_placement?: 'ignore'|'same_line'|'standalone', - * keep_multiple_spaces_after_comma?: bool, - * on_multiline?: 'ensure_fully_multiline'|'ensure_single_line'|'ignore' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * after_heredoc: bool, - * attribute_placement: 'ignore'|'same_line'|'standalone', - * keep_multiple_spaces_after_comma: bool, - * on_multiline: 'ensure_fully_multiline'|'ensure_single_line'|'ignore' - * } - */ -final class MethodArgumentSpaceFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'In method arguments and method call, there MUST NOT be a space before each comma and there MUST be one space after each comma. Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line.', - [ - new CodeSample( - " false] - ), - new CodeSample( - " true] - ), - new CodeSample( - " 'ensure_fully_multiline'] - ), - new CodeSample( - " 'ensure_single_line'] - ), - new CodeSample( - " 'ensure_fully_multiline', - 'keep_multiple_spaces_after_comma' => true, - ] - ), - new CodeSample( - " 'ensure_fully_multiline', - 'keep_multiple_spaces_after_comma' => false, - ] - ), - new CodeSample( - " 'ensure_fully_multiline', - 'attribute_placement' => 'ignore', - ] - ), - new CodeSample( - " 'ensure_fully_multiline', - 'attribute_placement' => 'same_line', - ] - ), - new CodeSample( - " 'ensure_fully_multiline', - 'attribute_placement' => 'standalone', - ] - ), - new CodeSample( - <<<'SAMPLE' - true] - ), - ], - 'This fixer covers rules defined in PSR2 ¶4.4, ¶4.6.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound('('); - } - - /** - * {@inheritdoc} - * - * Must run before ArrayIndentationFixer, StatementIndentationFixer. - * Must run after CombineNestedDirnameFixer, FunctionDeclarationFixer, ImplodeCallFixer, LambdaNotUsedImportFixer, NoMultilineWhitespaceAroundDoubleArrowFixer, NoUselessSprintfFixer, PowToExponentiationFixer, StrictParamFixer. - */ - public function getPriority(): int - { - return 30; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $expectedTokens = [T_LIST, T_FUNCTION, CT::T_USE_LAMBDA, T_FN, T_CLASS]; - - for ($index = $tokens->count() - 1; $index > 0; --$index) { - $token = $tokens[$index]; - - if (!$token->equals('(')) { - continue; - } - - $meaningfulTokenBeforeParenthesis = $tokens[$tokens->getPrevMeaningfulToken($index)]; - - if ( - $meaningfulTokenBeforeParenthesis->isKeyword() - && !$meaningfulTokenBeforeParenthesis->isGivenKind($expectedTokens) - ) { - continue; - } - - $isMultiline = $this->fixFunction($tokens, $index); - - if ( - $isMultiline - && 'ensure_fully_multiline' === $this->configuration['on_multiline'] - && !$meaningfulTokenBeforeParenthesis->isGivenKind(T_LIST) - ) { - $this->ensureFunctionFullyMultiline($tokens, $index); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('keep_multiple_spaces_after_comma', 'Whether keep multiple spaces after comma.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder( - 'on_multiline', - 'Defines how to handle function arguments lists that contain newlines.' - )) - ->setAllowedValues(['ignore', 'ensure_single_line', 'ensure_fully_multiline']) - ->setDefault('ensure_fully_multiline') - ->getOption(), - (new FixerOptionBuilder('after_heredoc', 'Whether the whitespace between heredoc end and comma should be removed.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder( - 'attribute_placement', - 'Defines how to handle argument attributes when function definition is multiline.' - )) - ->setAllowedValues(['ignore', 'same_line', 'standalone']) - ->setDefault('standalone') - ->getOption(), - ]); - } - - /** - * Fix arguments spacing for given function. - * - * @param Tokens $tokens Tokens to handle - * @param int $startFunctionIndex Start parenthesis position - * - * @return bool whether the function is multiline - */ - private function fixFunction(Tokens $tokens, int $startFunctionIndex): bool - { - $isMultiline = false; - - $endFunctionIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startFunctionIndex); - $firstWhitespaceIndex = $this->findWhitespaceIndexAfterParenthesis($tokens, $startFunctionIndex, $endFunctionIndex); - $lastWhitespaceIndex = $this->findWhitespaceIndexAfterParenthesis($tokens, $endFunctionIndex, $startFunctionIndex); - - foreach ([$firstWhitespaceIndex, $lastWhitespaceIndex] as $index) { - if (null === $index || !Preg::match('/\R/', $tokens[$index]->getContent())) { - continue; - } - - if ('ensure_single_line' !== $this->configuration['on_multiline']) { - $isMultiline = true; - - continue; - } - - $newLinesRemoved = $this->ensureSingleLine($tokens, $index); - - if (!$newLinesRemoved) { - $isMultiline = true; - } - } - - for ($index = $endFunctionIndex - 1; $index > $startFunctionIndex; --$index) { - $token = $tokens[$index]; - - if ($token->equals(')')) { - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - - continue; - } - - if ($token->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_CLOSE)) { - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $index); - - continue; - } - - if ($token->equals('}')) { - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - - continue; - } - - if ($token->equals(',')) { - $this->fixSpace($tokens, $index); - if (!$isMultiline && $this->isNewline($tokens[$index + 1])) { - $isMultiline = true; - } - } - } - - return $isMultiline; - } - - private function findWhitespaceIndexAfterParenthesis(Tokens $tokens, int $startParenthesisIndex, int $endParenthesisIndex): ?int - { - $direction = $endParenthesisIndex > $startParenthesisIndex ? 1 : -1; - $startIndex = $startParenthesisIndex + $direction; - $endIndex = $endParenthesisIndex - $direction; - - for ($index = $startIndex; $index !== $endIndex; $index += $direction) { - $token = $tokens[$index]; - - if ($token->isWhitespace()) { - return $index; - } - - if (!$token->isComment()) { - break; - } - } - - return null; - } - - /** - * @return bool Whether newlines were removed from the whitespace token - */ - private function ensureSingleLine(Tokens $tokens, int $index): bool - { - $previousToken = $tokens[$index - 1]; - - if ($previousToken->isComment() && !str_starts_with($previousToken->getContent(), '/*')) { - return false; - } - - $content = Preg::replace('/\R\h*/', '', $tokens[$index]->getContent()); - - $tokens->ensureWhitespaceAtIndex($index, 0, $content); - - return true; - } - - private function ensureFunctionFullyMultiline(Tokens $tokens, int $startFunctionIndex): void - { - // find out what the indentation is - $searchIndex = $startFunctionIndex; - do { - $prevWhitespaceTokenIndex = $tokens->getPrevTokenOfKind( - $searchIndex, - [[T_ENCAPSED_AND_WHITESPACE], [T_WHITESPACE]], - ); - - $searchIndex = $prevWhitespaceTokenIndex; - } while (null !== $prevWhitespaceTokenIndex - && !str_contains($tokens[$prevWhitespaceTokenIndex]->getContent(), "\n") - ); - - if (null === $prevWhitespaceTokenIndex) { - $existingIndentation = ''; - } elseif (!$tokens[$prevWhitespaceTokenIndex]->isGivenKind(T_WHITESPACE)) { - return; - } else { - $existingIndentation = $tokens[$prevWhitespaceTokenIndex]->getContent(); - $lastLineIndex = strrpos($existingIndentation, "\n"); - $existingIndentation = false === $lastLineIndex - ? $existingIndentation - : substr($existingIndentation, $lastLineIndex + 1); - } - - $indentation = $existingIndentation.$this->whitespacesConfig->getIndent(); - $endFunctionIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startFunctionIndex); - - $wasWhitespaceBeforeEndFunctionAddedAsNewToken = $tokens->ensureWhitespaceAtIndex( - $tokens[$endFunctionIndex - 1]->isWhitespace() ? $endFunctionIndex - 1 : $endFunctionIndex, - 0, - $this->whitespacesConfig->getLineEnding().$existingIndentation - ); - - if ($wasWhitespaceBeforeEndFunctionAddedAsNewToken) { - ++$endFunctionIndex; - } - - for ($index = $endFunctionIndex - 1; $index > $startFunctionIndex; --$index) { - $token = $tokens[$index]; - - // skip nested method calls and arrays - if ($token->equals(')')) { - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - - continue; - } - - // skip nested arrays - if ($token->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_CLOSE)) { - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $index); - - continue; - } - - if ($token->equals('}')) { - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - - continue; - } - - if ($tokens[$tokens->getNextMeaningfulToken($index)]->equals(')')) { - continue; - } - - if ($token->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - if ('standalone' === $this->configuration['attribute_placement']) { - $this->fixNewline($tokens, $index, $indentation); - } elseif ('same_line' === $this->configuration['attribute_placement']) { - $this->ensureSingleLine($tokens, $index + 1); - $tokens->ensureWhitespaceAtIndex($index + 1, 0, ' '); - } - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); - - continue; - } - - if ($token->equals(',')) { - $this->fixNewline($tokens, $index, $indentation); - } - } - - $this->fixNewline($tokens, $startFunctionIndex, $indentation, false); - } - - /** - * Method to insert newline after comma, attribute or opening parenthesis. - * - * @param int $index index of a comma - * @param string $indentation the indentation that should be used - * @param bool $override whether to override the existing character or not - */ - private function fixNewline(Tokens $tokens, int $index, string $indentation, bool $override = true): void - { - if ($tokens[$index + 1]->isComment()) { - return; - } - - if ($tokens[$index + 2]->isComment()) { - $nextMeaningfulTokenIndex = $tokens->getNextMeaningfulToken($index + 2); - if (!$this->isNewline($tokens[$nextMeaningfulTokenIndex - 1])) { - if ($tokens[$nextMeaningfulTokenIndex - 1]->isWhitespace()) { - $tokens->clearAt($nextMeaningfulTokenIndex - 1); - } - - $tokens->ensureWhitespaceAtIndex($nextMeaningfulTokenIndex, 0, $this->whitespacesConfig->getLineEnding().$indentation); - } - - return; - } - - $nextMeaningfulTokenIndex = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$nextMeaningfulTokenIndex]->equals(')')) { - return; - } - - $tokens->ensureWhitespaceAtIndex($index + 1, 0, $this->whitespacesConfig->getLineEnding().$indentation); - } - - /** - * Method to insert space after comma and remove space before comma. - */ - private function fixSpace(Tokens $tokens, int $index): void - { - // remove space before comma if exist - if ($tokens[$index - 1]->isWhitespace()) { - $prevIndex = $tokens->getPrevNonWhitespace($index - 1); - - if ( - !$tokens[$prevIndex]->equals(',') && !$tokens[$prevIndex]->isComment() - && (true === $this->configuration['after_heredoc'] || !$tokens[$prevIndex]->isGivenKind(T_END_HEREDOC)) - ) { - $tokens->clearAt($index - 1); - } - } - - $nextIndex = $index + 1; - $nextToken = $tokens[$nextIndex]; - - // Two cases for fix space after comma (exclude multiline comments) - // 1) multiple spaces after comma - // 2) no space after comma - if ($nextToken->isWhitespace()) { - $newContent = $nextToken->getContent(); - - if ('ensure_single_line' === $this->configuration['on_multiline']) { - $newContent = Preg::replace('/\R/', '', $newContent); - } - - if ( - (false === $this->configuration['keep_multiple_spaces_after_comma'] || Preg::match('/\R/', $newContent)) - && !$this->isCommentLastLineToken($tokens, $index + 2) - ) { - $newContent = ltrim($newContent, " \t"); - } - - $tokens[$nextIndex] = new Token([T_WHITESPACE, '' === $newContent ? ' ' : $newContent]); - - return; - } - - if (!$this->isCommentLastLineToken($tokens, $index + 1)) { - $tokens->insertAt($index + 1, new Token([T_WHITESPACE, ' '])); - } - } - - /** - * Check if last item of current line is a comment. - * - * @param Tokens $tokens tokens to handle - * @param int $index index of token - */ - private function isCommentLastLineToken(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->isComment() || !$tokens[$index + 1]->isWhitespace()) { - return false; - } - - $content = $tokens[$index + 1]->getContent(); - - return $content !== ltrim($content, "\r\n"); - } - - /** - * Checks if token is new line. - */ - private function isNewline(Token $token): bool - { - return $token->isWhitespace() && str_contains($token->getContent(), "\n"); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php deleted file mode 100644 index 4feb68b8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php +++ /dev/null @@ -1,420 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Utils; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * @author Andreas Möller - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * exclude?: list, - * include?: list, - * scope?: 'all'|'namespaced', - * strict?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * exclude: list, - * include: list, - * scope: 'all'|'namespaced', - * strict: bool - * } - */ -final class NativeFunctionInvocationFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const SET_ALL = '@all'; - - /** - * Subset of SET_INTERNAL. - * - * Change function call to functions known to be optimized by the Zend engine. - * For details: - * - @see https://github.com/php/php-src/blob/php-7.2.6/Zend/zend_compile.c "zend_try_compile_special_func" - * - @see https://github.com/php/php-src/blob/php-7.2.6/ext/opcache/Optimizer/pass1_5.c - * - * @internal - */ - public const SET_COMPILER_OPTIMIZED = '@compiler_optimized'; - - /** - * @internal - */ - public const SET_INTERNAL = '@internal'; - - /** - * @var callable - */ - private $functionFilter; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Add leading `\` before function invocation to speed up resolving.', - [ - new CodeSample( - ' [ - 'json_encode', - ], - ] - ), - new CodeSample( - ' 'all'] - ), - new CodeSample( - ' 'namespaced'] - ), - new CodeSample( - ' ['myGlobalFunction']] - ), - new CodeSample( - ' ['@all']] - ), - new CodeSample( - ' ['@internal']] - ), - new CodeSample( - ' ['@compiler_optimized']] - ), - ], - null, - 'Risky when any of the functions are overridden.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before GlobalNamespaceImportFixer. - * Must run after BacktickToShellExecFixer, RegularCallableCallFixer, StrictParamFixer. - */ - public function getPriority(): int - { - return 1; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - $this->functionFilter = $this->getFunctionFilter(); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if ('all' === $this->configuration['scope']) { - $this->fixFunctionCalls($tokens, $this->functionFilter, 0, \count($tokens) - 1, false); - - return; - } - - $namespaces = $tokens->getNamespaceDeclarations(); - - // 'scope' is 'namespaced' here - /** @var NamespaceAnalysis $namespace */ - foreach (array_reverse($namespaces) as $namespace) { - $this->fixFunctionCalls($tokens, $this->functionFilter, $namespace->getScopeStartIndex(), $namespace->getScopeEndIndex(), $namespace->isGlobalNamespace()); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('exclude', 'List of functions to ignore.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([static function (array $value): bool { - foreach ($value as $functionName) { - if ('' === trim($functionName) || trim($functionName) !== $functionName) { - throw new InvalidOptionsException(\sprintf( - 'Each element must be a non-empty, trimmed string, got "%s" instead.', - get_debug_type($functionName) - )); - } - } - - return true; - }]) - ->setDefault([]) - ->getOption(), - (new FixerOptionBuilder('include', 'List of function names or sets to fix. Defined sets are `@internal` (all native functions), `@all` (all global functions) and `@compiler_optimized` (functions that are specially optimized by Zend).')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([static function (array $value): bool { - foreach ($value as $functionName) { - if ('' === trim($functionName) || trim($functionName) !== $functionName) { - throw new InvalidOptionsException(\sprintf( - 'Each element must be a non-empty, trimmed string, got "%s" instead.', - get_debug_type($functionName) - )); - } - - $sets = [ - self::SET_ALL, - self::SET_INTERNAL, - self::SET_COMPILER_OPTIMIZED, - ]; - - if (str_starts_with($functionName, '@') && !\in_array($functionName, $sets, true)) { - throw new InvalidOptionsException(\sprintf('Unknown set "%s", known sets are %s.', $functionName, Utils::naturalLanguageJoin($sets))); - } - } - - return true; - }]) - ->setDefault([self::SET_COMPILER_OPTIMIZED]) - ->getOption(), - (new FixerOptionBuilder('scope', 'Only fix function calls that are made within a namespace or fix all.')) - ->setAllowedValues(['all', 'namespaced']) - ->setDefault('all') - ->getOption(), - (new FixerOptionBuilder('strict', 'Whether leading `\` of function call not meant to have it should be removed.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - private function fixFunctionCalls(Tokens $tokens, callable $functionFilter, int $start, int $end, bool $tryToRemove): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - $tokensToInsert = []; - for ($index = $start; $index < $end; ++$index) { - if (!$functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { - continue; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if (!$functionFilter($tokens[$index]->getContent()) || $tryToRemove) { - if (false === $this->configuration['strict']) { - continue; - } - - if ($tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR)) { - $tokens->clearTokenAndMergeSurroundingWhitespace($prevIndex); - } - - continue; - } - - if ($tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR)) { - continue; // do not bother if previous token is already namespace separator - } - - $tokensToInsert[$index] = new Token([T_NS_SEPARATOR, '\\']); - } - - $tokens->insertSlices($tokensToInsert); - } - - private function getFunctionFilter(): callable - { - $exclude = $this->normalizeFunctionNames($this->configuration['exclude']); - - if (\in_array(self::SET_ALL, $this->configuration['include'], true)) { - if (\count($exclude) > 0) { - return static fn (string $functionName): bool => !isset($exclude[strtolower($functionName)]); - } - - return static fn (): bool => true; - } - - $include = []; - - if (\in_array(self::SET_INTERNAL, $this->configuration['include'], true)) { - $include = $this->getAllInternalFunctionsNormalized(); - } elseif (\in_array(self::SET_COMPILER_OPTIMIZED, $this->configuration['include'], true)) { - $include = $this->getAllCompilerOptimizedFunctionsNormalized(); // if `@internal` is set all compiler optimized function are already loaded - } - - foreach ($this->configuration['include'] as $additional) { - if (!str_starts_with($additional, '@')) { - $include[strtolower($additional)] = true; - } - } - - if (\count($exclude) > 0) { - return static fn (string $functionName): bool => isset($include[strtolower($functionName)]) && !isset($exclude[strtolower($functionName)]); - } - - return static fn (string $functionName): bool => isset($include[strtolower($functionName)]); - } - - /** - * @return array normalized function names of which the PHP compiler optimizes - */ - private function getAllCompilerOptimizedFunctionsNormalized(): array - { - return $this->normalizeFunctionNames([ - // @see https://github.com/php/php-src/blob/PHP-7.4/Zend/zend_compile.c "zend_try_compile_special_func" - 'array_key_exists', - 'array_slice', - 'assert', - 'boolval', - 'call_user_func', - 'call_user_func_array', - 'chr', - 'count', - 'defined', - 'doubleval', - 'floatval', - 'func_get_args', - 'func_num_args', - 'get_called_class', - 'get_class', - 'gettype', - 'in_array', - 'intval', - 'is_array', - 'is_bool', - 'is_double', - 'is_float', - 'is_int', - 'is_integer', - 'is_long', - 'is_null', - 'is_object', - 'is_real', - 'is_resource', - 'is_scalar', - 'is_string', - 'ord', - 'sizeof', - 'sprintf', - 'strlen', - 'strval', - // @see https://github.com/php/php-src/blob/php-7.2.6/ext/opcache/Optimizer/pass1_5.c - // @see https://github.com/php/php-src/blob/PHP-8.1.2/Zend/Optimizer/block_pass.c - // @see https://github.com/php/php-src/blob/php-8.1.3/Zend/Optimizer/zend_optimizer.c - 'constant', - 'define', - 'dirname', - 'extension_loaded', - 'function_exists', - 'is_callable', - 'ini_get', - ]); - } - - /** - * @return array normalized function names of all internal defined functions - */ - private function getAllInternalFunctionsNormalized(): array - { - return $this->normalizeFunctionNames(get_defined_functions()['internal']); - } - - /** - * @param list $functionNames - * - * @return array all function names lower cased - */ - private function normalizeFunctionNames(array $functionNames): array - { - $result = []; - - foreach ($functionNames as $functionName) { - $result[strtolower($functionName)] = true; - } - - return $result; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php deleted file mode 100644 index a63e9914..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php +++ /dev/null @@ -1,176 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶4.6. - * - * @author Varga Bence - * @author Dariusz Rumiński - */ -final class NoSpacesAfterFunctionNameFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'When making a method or function call, there MUST NOT be a space between the method or function name and the opening parenthesis.', - [new CodeSample("isAnyTokenKindsFound([T_STRING, ...$this->getFunctionyTokenKinds()]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionyTokens = $this->getFunctionyTokenKinds(); - $languageConstructionTokens = $this->getLanguageConstructionTokenKinds(); - $braceTypes = $this->getBraceAfterVariableKinds(); - - foreach ($tokens as $index => $token) { - // looking for start brace - if (!$token->equals('(')) { - continue; - } - - // last non-whitespace token, can never be `null` always at least PHP open tag before it - $lastTokenIndex = $tokens->getPrevNonWhitespace($index); - - // check for ternary operator - $endParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $nextNonWhiteSpace = $tokens->getNextMeaningfulToken($endParenthesisIndex); - if ( - null !== $nextNonWhiteSpace - && !$tokens[$nextNonWhiteSpace]->equals(';') - && $tokens[$lastTokenIndex]->isGivenKind($languageConstructionTokens) - ) { - continue; - } - - // check if it is a function call - if ($tokens[$lastTokenIndex]->isGivenKind($functionyTokens)) { - $this->fixFunctionCall($tokens, $index); - } elseif ($tokens[$lastTokenIndex]->isGivenKind(T_STRING)) { // for real function calls or definitions - $possibleDefinitionIndex = $tokens->getPrevMeaningfulToken($lastTokenIndex); - if (!$tokens[$possibleDefinitionIndex]->isGivenKind(T_FUNCTION)) { - $this->fixFunctionCall($tokens, $index); - } - } elseif ($tokens[$lastTokenIndex]->equalsAny($braceTypes)) { - $block = Tokens::detectBlockType($tokens[$lastTokenIndex]); - if ( - Tokens::BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE === $block['type'] - || Tokens::BLOCK_TYPE_DYNAMIC_VAR_BRACE === $block['type'] - || Tokens::BLOCK_TYPE_INDEX_SQUARE_BRACE === $block['type'] - || Tokens::BLOCK_TYPE_PARENTHESIS_BRACE === $block['type'] - ) { - $this->fixFunctionCall($tokens, $index); - } - } - } - } - - /** - * Fixes whitespaces around braces of a function(y) call. - * - * @param Tokens $tokens tokens to handle - * @param int $index index of token - */ - private function fixFunctionCall(Tokens $tokens, int $index): void - { - // remove space before opening brace - if ($tokens[$index - 1]->isWhitespace()) { - $tokens->clearAt($index - 1); - } - } - - /** - * @return list - */ - private function getBraceAfterVariableKinds(): array - { - return [ - ')', - ']', - [CT::T_DYNAMIC_VAR_BRACE_CLOSE], - [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], - ]; - } - - /** - * Gets the token kinds which can work as function calls. - * - * @return list Token names - */ - private function getFunctionyTokenKinds(): array - { - static $tokens = [ - T_ARRAY, - T_ECHO, - T_EMPTY, - T_EVAL, - T_EXIT, - T_INCLUDE, - T_INCLUDE_ONCE, - T_ISSET, - T_LIST, - T_PRINT, - T_REQUIRE, - T_REQUIRE_ONCE, - T_UNSET, - T_VARIABLE, - ]; - - return $tokens; - } - - /** - * Gets the token kinds of actually language construction. - * - * @return list - */ - private function getLanguageConstructionTokenKinds(): array - { - static $languageConstructionTokens = [ - T_ECHO, - T_PRINT, - T_INCLUDE, - T_INCLUDE_ONCE, - T_REQUIRE, - T_REQUIRE_ONCE, - ]; - - return $languageConstructionTokens; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoTrailingCommaInSinglelineFunctionCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoTrailingCommaInSinglelineFunctionCallFixer.php deleted file mode 100644 index b0be871d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoTrailingCommaInSinglelineFunctionCallFixer.php +++ /dev/null @@ -1,59 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\Basic\NoTrailingCommaInSinglelineFixer; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @deprecated - */ -final class NoTrailingCommaInSinglelineFunctionCallFixer extends AbstractProxyFixer implements DeprecatedFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'When making a method or function call on a single line there MUST NOT be a trailing comma after the last argument.', - [new CodeSample("proxyFixers); - } - - protected function createProxyFixers(): array - { - $fixer = new NoTrailingCommaInSinglelineFixer(); - $fixer->configure(['elements' => ['arguments', 'array_destructuring']]); - - return [$fixer]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixer.php deleted file mode 100644 index 108901da..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixer.php +++ /dev/null @@ -1,191 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Mark Scherer - * @author Lucas Manzke - * @author Gregor Harlan - */ -final class NoUnreachableDefaultArgumentValueFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'In function arguments there must not be arguments with default values before non-default ones.', - [ - new CodeSample( - 'isAnyTokenKindsFound([T_FUNCTION, T_FN]); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionKinds = [T_FUNCTION, T_FN]; - - for ($i = 0, $l = $tokens->count(); $i < $l; ++$i) { - if (!$tokens[$i]->isGivenKind($functionKinds)) { - continue; - } - - $startIndex = $tokens->getNextTokenOfKind($i, ['(']); - $i = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startIndex); - - $this->fixFunctionDefinition($tokens, $startIndex, $i); - } - } - - private function fixFunctionDefinition(Tokens $tokens, int $startIndex, int $endIndex): void - { - $lastArgumentIndex = $this->getLastNonDefaultArgumentIndex($tokens, $startIndex, $endIndex); - - if (null === $lastArgumentIndex) { - return; - } - - for ($i = $lastArgumentIndex; $i > $startIndex; --$i) { - $token = $tokens[$i]; - - if ($token->isGivenKind(T_VARIABLE)) { - $lastArgumentIndex = $i; - - continue; - } - - if (!$token->equals('=') || $this->isNonNullableTypehintedNullableVariable($tokens, $i)) { - continue; - } - - $this->removeDefaultValue($tokens, $i, $this->getDefaultValueEndIndex($tokens, $lastArgumentIndex)); - } - } - - private function getLastNonDefaultArgumentIndex(Tokens $tokens, int $startIndex, int $endIndex): ?int - { - for ($i = $endIndex - 1; $i > $startIndex; --$i) { - $token = $tokens[$i]; - - if ($token->equals('=')) { - $i = $tokens->getPrevMeaningfulToken($i); - - continue; - } - - if ($token->isGivenKind(T_VARIABLE) && !$this->isEllipsis($tokens, $i)) { - return $i; - } - } - - return null; - } - - private function isEllipsis(Tokens $tokens, int $variableIndex): bool - { - return $tokens[$tokens->getPrevMeaningfulToken($variableIndex)]->isGivenKind(T_ELLIPSIS); - } - - private function getDefaultValueEndIndex(Tokens $tokens, int $index): int - { - do { - $index = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$index]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); - } - } while (!$tokens[$index]->equals(',')); - - return $tokens->getPrevMeaningfulToken($index); - } - - private function removeDefaultValue(Tokens $tokens, int $startIndex, int $endIndex): void - { - for ($i = $startIndex; $i <= $endIndex;) { - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - $this->clearWhitespacesBeforeIndex($tokens, $i); - $i = $tokens->getNextMeaningfulToken($i); - } - } - - /** - * @param int $index Index of "=" - */ - private function isNonNullableTypehintedNullableVariable(Tokens $tokens, int $index): bool - { - $nextToken = $tokens[$tokens->getNextMeaningfulToken($index)]; - - if (!$nextToken->equals([T_STRING, 'null'], false)) { - return false; - } - - $variableIndex = $tokens->getPrevMeaningfulToken($index); - - $searchTokens = [',', '(', [T_STRING], [CT::T_ARRAY_TYPEHINT], [T_CALLABLE]]; - $typehintKinds = [T_STRING, CT::T_ARRAY_TYPEHINT, T_CALLABLE]; - - $prevIndex = $tokens->getPrevTokenOfKind($variableIndex, $searchTokens); - - if (!$tokens[$prevIndex]->isGivenKind($typehintKinds)) { - return false; - } - - return !$tokens[$tokens->getPrevMeaningfulToken($prevIndex)]->isGivenKind(CT::T_NULLABLE_TYPE); - } - - private function clearWhitespacesBeforeIndex(Tokens $tokens, int $index): void - { - $prevIndex = $tokens->getNonEmptySibling($index, -1); - if (!$tokens[$prevIndex]->isWhitespace()) { - return; - } - - $prevNonWhiteIndex = $tokens->getPrevNonWhitespace($prevIndex); - if (null === $prevNonWhiteIndex || !$tokens[$prevNonWhiteIndex]->isComment()) { - $tokens->clearTokenAndMergeSurroundingWhitespace($prevIndex); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUselessSprintfFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUselessSprintfFixer.php deleted file mode 100644 index 125bbab6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoUselessSprintfFixer.php +++ /dev/null @@ -1,109 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoUselessSprintfFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There must be no `sprintf` calls with only the first argument.', - [ - new CodeSample( - "isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * Must run before MethodArgumentSpaceFixer, NativeFunctionCasingFixer, NoEmptyStatementFixer, NoExtraBlankLinesFixer, NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. - */ - public function getPriority(): int - { - return 42; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionAnalyzer = new FunctionsAnalyzer(); - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - for ($index = \count($tokens) - 1; $index > 0; --$index) { - if (!$tokens[$index]->isGivenKind(T_STRING)) { - continue; - } - - if ('sprintf' !== strtolower($tokens[$index]->getContent())) { - continue; - } - - if (!$functionAnalyzer->isGlobalFunctionCall($tokens, $index)) { - continue; - } - - $openParenthesisIndex = $tokens->getNextTokenOfKind($index, ['(']); - - if ($tokens[$tokens->getNextMeaningfulToken($openParenthesisIndex)]->isGivenKind(T_ELLIPSIS)) { - continue; - } - - $closeParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openParenthesisIndex); - - if (1 !== $argumentsAnalyzer->countArguments($tokens, $openParenthesisIndex, $closeParenthesisIndex)) { - continue; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($closeParenthesisIndex); - - $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($closeParenthesisIndex); - - if ($tokens[$prevMeaningfulTokenIndex]->equals(',')) { - $tokens->clearTokenAndMergeSurroundingWhitespace($prevMeaningfulTokenIndex); - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($openParenthesisIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - - $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$prevMeaningfulTokenIndex]->isGivenKind(T_NS_SEPARATOR)) { - $tokens->clearTokenAndMergeSurroundingWhitespace($prevMeaningfulTokenIndex); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php deleted file mode 100644 index b21a9ea5..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php +++ /dev/null @@ -1,247 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\ArgumentAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author HypeMC - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * use_nullable_type_declaration?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * use_nullable_type_declaration: bool - * } - */ -final class NullableTypeDeclarationForDefaultNullValueFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Adds or removes `?` before single type declarations or `|null` at the end of union types when parameters have a default `null` value.', - [ - new CodeSample( - " false] - ), - new VersionSpecificCodeSample( - " false] - ), - new VersionSpecificCodeSample( - " false] - ), - ], - 'Rule is applied only in a PHP 7.1+ environment.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_VARIABLE) && $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]); - } - - /** - * {@inheritdoc} - * - * Must run before NoUnreachableDefaultArgumentValueFixer, NullableTypeDeclarationFixer, OrderedTypesFixer. - */ - public function getPriority(): int - { - return 3; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('use_nullable_type_declaration', 'Whether to add or remove `?` or `|null` to parameters with a default `null` value.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->setDeprecationMessage('Behaviour will follow default one.') // @TODO remove the option on next major 4.0 - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - $tokenKinds = [T_FUNCTION, T_FN]; - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind($tokenKinds)) { - continue; - } - - $arguments = $functionsAnalyzer->getFunctionArguments($tokens, $index); - $this->fixFunctionParameters($tokens, $arguments); - } - } - - /** - * @param array $arguments - */ - private function fixFunctionParameters(Tokens $tokens, array $arguments): void - { - $constructorPropertyModifiers = [ - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE, - ]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $constructorPropertyModifiers[] = T_READONLY; - } - - foreach (array_reverse($arguments) as $argumentInfo) { - if ( - // Skip, if the parameter - // - doesn't have a type declaration - !$argumentInfo->hasTypeAnalysis() - // - has a mixed or standalone null type - || \in_array(strtolower($argumentInfo->getTypeAnalysis()->getName()), ['mixed', 'null'], true) - // - a default value is not null we can continue - || !$argumentInfo->hasDefault() || 'null' !== strtolower($argumentInfo->getDefault()) - ) { - continue; - } - - $argumentTypeInfo = $argumentInfo->getTypeAnalysis(); - - if (\PHP_VERSION_ID >= 8_00_00 && false === $this->configuration['use_nullable_type_declaration']) { - $visibility = $tokens[$tokens->getPrevMeaningfulToken($argumentTypeInfo->getStartIndex())]; - - if ($visibility->isGivenKind($constructorPropertyModifiers)) { - continue; - } - } - - $typeAnalysisName = $argumentTypeInfo->getName(); - if (str_contains($typeAnalysisName, '|') || str_contains($typeAnalysisName, '&')) { - $this->fixUnionTypeParameter($tokens, $argumentTypeInfo); - } else { - $this->fixSingleTypeParameter($tokens, $argumentTypeInfo); - } - } - } - - private function fixSingleTypeParameter(Tokens $tokens, TypeAnalysis $argumentTypeInfo): void - { - if (true === $this->configuration['use_nullable_type_declaration']) { - if (!$argumentTypeInfo->isNullable()) { - $tokens->insertAt($argumentTypeInfo->getStartIndex(), new Token([CT::T_NULLABLE_TYPE, '?'])); - } - } elseif ($argumentTypeInfo->isNullable()) { - $tokens->removeTrailingWhitespace($startIndex = $argumentTypeInfo->getStartIndex()); - $tokens->clearTokenAndMergeSurroundingWhitespace($startIndex); - } - } - - private function fixUnionTypeParameter(Tokens $tokens, TypeAnalysis $argumentTypeInfo): void - { - if (true === $this->configuration['use_nullable_type_declaration']) { - if ($argumentTypeInfo->isNullable()) { - return; - } - - $typeAnalysisName = $argumentTypeInfo->getName(); - $endIndex = $argumentTypeInfo->getEndIndex(); - - if (str_contains($typeAnalysisName, '&') && !str_contains($typeAnalysisName, '|')) { - $endIndex += 2; - $tokens->insertAt($argumentTypeInfo->getStartIndex(), new Token([CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, '('])); - $tokens->insertAt($endIndex, new Token([CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, ')'])); - } - - $tokens->insertAt($endIndex + 1, [ - new Token([CT::T_TYPE_ALTERNATION, '|']), - new Token([T_STRING, 'null']), - ]); - } elseif ($argumentTypeInfo->isNullable()) { - $startIndex = $argumentTypeInfo->getStartIndex(); - - $index = $tokens->getNextTokenOfKind($startIndex - 1, [[T_STRING, 'null']], false); - - if ($index === $startIndex) { - $tokens->removeTrailingWhitespace($index); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - - $index = $tokens->getNextMeaningfulToken($index); - if ($tokens[$index]->equals([CT::T_TYPE_ALTERNATION, '|'])) { - $tokens->removeTrailingWhitespace($index); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - } else { - $tokens->removeLeadingWhitespace($index); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - - $index = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$index]->equals([CT::T_TYPE_ALTERNATION, '|'])) { - $tokens->removeLeadingWhitespace($index); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - } - - $typeAnalysisName = $argumentTypeInfo->getName(); - - if (str_contains($typeAnalysisName, '&') && 1 === substr_count($typeAnalysisName, '|')) { - $index = $tokens->getNextTokenOfKind($startIndex - 1, [[CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN]]); - $tokens->removeTrailingWhitespace($index); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - - $index = $tokens->getPrevTokenOfKind($argumentTypeInfo->getEndIndex() + 1, [[CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE]]); - $tokens->removeLeadingWhitespace($index); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php deleted file mode 100644 index 37d0f060..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php +++ /dev/null @@ -1,244 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer; -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ExperimentalFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Jan Gantzert - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * scalar_types?: bool, - * types_map?: array, - * union_types?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * scalar_types: bool, - * types_map: array, - * union_types: bool - * } - */ -final class PhpdocToParamTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ConfigurableFixerInterface, ExperimentalFixerInterface -{ - private const TYPE_CHECK_TEMPLATE = ' - */ - private const EXCLUDE_FUNC_NAMES = [ - [T_STRING, '__clone'], - [T_STRING, '__destruct'], - ]; - - /** - * @var array - */ - private const SKIPPED_TYPES = [ - 'resource' => true, - 'static' => true, - 'void' => true, - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Takes `@param` annotations of non-mixed types and adjusts accordingly the function signature.', - [ - new CodeSample( - ' false] - ), - new CodeSample( - ' false] - ), - ], - null, - 'The `@param` annotation is mandatory for the fixer to make changes, signatures of methods without it (no docblock, inheritdocs) will not be fixed. Manual actions are required if inherited signatures are not properly documented.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]); - } - - /** - * {@inheritdoc} - * - * Must run before NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 8; - } - - protected function isSkippedType(string $type): bool - { - return isset(self::SKIPPED_TYPES[$type]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; 0 < $index; --$index) { - if (!$tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) { - continue; - } - - $funcName = $tokens->getNextMeaningfulToken($index); - if ($tokens[$funcName]->equalsAny(self::EXCLUDE_FUNC_NAMES, false)) { - continue; - } - - $docCommentIndex = $this->findFunctionDocComment($tokens, $index); - - if (null === $docCommentIndex) { - continue; - } - - foreach ($this->getAnnotationsFromDocComment('param', $tokens, $docCommentIndex) as $paramTypeAnnotation) { - $typesExpression = $paramTypeAnnotation->getTypeExpression(); - - if (null === $typesExpression) { - continue; - } - - $typeInfo = $this->getCommonTypeInfo($typesExpression, false); - $unionTypes = null; - - if (null === $typeInfo) { - $unionTypes = $this->getUnionTypes($typesExpression, false); - } - - if (null === $typeInfo && null === $unionTypes) { - continue; - } - - if (null !== $typeInfo) { - $paramType = $typeInfo['commonType']; - $isNullable = $typeInfo['isNullable']; - } elseif (null !== $unionTypes) { - $paramType = $unionTypes; - $isNullable = false; - } - - if (!isset($paramType, $isNullable)) { - continue; - } - - $startIndex = $tokens->getNextTokenOfKind($index, ['(']); - $variableIndex = $this->findCorrectVariable($tokens, $startIndex, $paramTypeAnnotation); - - if (null === $variableIndex) { - continue; - } - - $byRefIndex = $tokens->getPrevMeaningfulToken($variableIndex); - - if ($tokens[$byRefIndex]->equals('&')) { - $variableIndex = $byRefIndex; - } - - if ($this->hasParamTypeHint($tokens, $variableIndex)) { - continue; - } - - if (!$this->isValidSyntax(\sprintf(self::TYPE_CHECK_TEMPLATE, $paramType))) { - continue; - } - - $tokens->insertAt($variableIndex, array_merge( - $this->createTypeDeclarationTokens($paramType, $isNullable), - [new Token([T_WHITESPACE, ' '])] - )); - } - } - } - - protected function createTokensFromRawType(string $type): Tokens - { - $typeTokens = Tokens::fromCode(\sprintf(self::TYPE_CHECK_TEMPLATE, $type)); - $typeTokens->clearRange(0, 4); - $typeTokens->clearRange(\count($typeTokens) - 6, \count($typeTokens) - 1); - $typeTokens->clearEmptyTokens(); - - return $typeTokens; - } - - private function findCorrectVariable(Tokens $tokens, int $startIndex, Annotation $paramTypeAnnotation): ?int - { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startIndex); - - for ($index = $startIndex + 1; $index < $endIndex; ++$index) { - if (!$tokens[$index]->isGivenKind(T_VARIABLE)) { - continue; - } - - $variableName = $tokens[$index]->getContent(); - - if ($paramTypeAnnotation->getVariableName() === $variableName) { - return $index; - } - } - - return null; - } - - /** - * Determine whether the function already has a param type hint. - * - * @param int $index The index of the end of the function definition line, EG at { or ; - */ - private function hasParamTypeHint(Tokens $tokens, int $index): bool - { - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - return !$tokens[$prevIndex]->equalsAny([',', '(']); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php deleted file mode 100644 index f7db0a4b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php +++ /dev/null @@ -1,296 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer; -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ExperimentalFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @phpstan-import-type _CommonTypeInfo from AbstractPhpdocToTypeDeclarationFixer - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * scalar_types?: bool, - * types_map?: array, - * union_types?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * scalar_types: bool, - * types_map: array, - * union_types: bool - * } - */ -final class PhpdocToPropertyTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ConfigurableFixerInterface, ExperimentalFixerInterface -{ - private const TYPE_CHECK_TEMPLATE = ' - */ - private array $skippedTypes = [ - 'resource' => true, - 'null' => true, - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Takes `@var` annotation of non-mixed types and adjusts accordingly the property signature..', - [ - new CodeSample( - ' false] - ), - new CodeSample( - ' false] - ), - ], - null, - 'The `@var` annotation is mandatory for the fixer to make changes, signatures of properties without it (no docblock) will not be fixed. Manual actions might be required for newly typed properties that are read before initialization.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - /** - * {@inheritdoc} - * - * Must run before FullyQualifiedStrictTypesFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 8; - } - - protected function isSkippedType(string $type): bool - { - return isset($this->skippedTypes[$type]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; 0 < $index; --$index) { - if ($tokens[$index]->isGivenKind([T_CLASS, T_TRAIT])) { - $this->fixClass($tokens, $index); - } - } - } - - protected function createTokensFromRawType(string $type): Tokens - { - $typeTokens = Tokens::fromCode(\sprintf(self::TYPE_CHECK_TEMPLATE, $type)); - $typeTokens->clearRange(0, 8); - $typeTokens->clearRange(\count($typeTokens) - 5, \count($typeTokens) - 1); - $typeTokens->clearEmptyTokens(); - - return $typeTokens; - } - - private function fixClass(Tokens $tokens, int $index): void - { - $index = $tokens->getNextTokenOfKind($index, ['{']); - $classEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - - for (; $index < $classEndIndex; ++$index) { - if ($tokens[$index]->isGivenKind(T_FUNCTION)) { - $index = $tokens->getNextTokenOfKind($index, ['{', ';']); - - if ($tokens[$index]->equals('{')) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - } - - continue; - } - - if (!$tokens[$index]->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $docCommentIndex = $index; - $propertyIndices = $this->findNextUntypedPropertiesDeclaration($tokens, $docCommentIndex); - - if ([] === $propertyIndices) { - continue; - } - - $typeInfo = $this->resolveApplicableType( - $propertyIndices, - $this->getAnnotationsFromDocComment('var', $tokens, $docCommentIndex) - ); - - if (null === $typeInfo) { - continue; - } - - $propertyType = $typeInfo['commonType']; - $isNullable = $typeInfo['isNullable']; - - if (\in_array($propertyType, ['callable', 'never', 'void'], true)) { - continue; - } - - if (!$this->isValidSyntax(\sprintf(self::TYPE_CHECK_TEMPLATE, $propertyType))) { - continue; - } - - $newTokens = array_merge( - $this->createTypeDeclarationTokens($propertyType, $isNullable), - [new Token([T_WHITESPACE, ' '])] - ); - - $tokens->insertAt(current($propertyIndices), $newTokens); - - $index = max($propertyIndices) + \count($newTokens) + 1; - $classEndIndex += \count($newTokens); - } - } - - /** - * @return array - */ - private function findNextUntypedPropertiesDeclaration(Tokens $tokens, int $index): array - { - do { - $index = $tokens->getNextMeaningfulToken($index); - } while ($tokens[$index]->isGivenKind([ - T_PRIVATE, - T_PROTECTED, - T_PUBLIC, - T_STATIC, - T_VAR, - ])); - - if (!$tokens[$index]->isGivenKind(T_VARIABLE)) { - return []; - } - - $properties = []; - - while (!$tokens[$index]->equals(';')) { - if ($tokens[$index]->isGivenKind(T_VARIABLE)) { - $properties[$tokens[$index]->getContent()] = $index; - } - - $index = $tokens->getNextMeaningfulToken($index); - } - - return $properties; - } - - /** - * @param array $propertyIndices - * @param list $annotations - * - * @return ?_CommonTypeInfo - */ - private function resolveApplicableType(array $propertyIndices, array $annotations): ?array - { - $propertyTypes = []; - - foreach ($annotations as $annotation) { - $propertyName = $annotation->getVariableName(); - - if (null === $propertyName) { - if (1 !== \count($propertyIndices)) { - continue; - } - - $propertyName = array_key_first($propertyIndices); - } - - if (!isset($propertyIndices[$propertyName])) { - continue; - } - - $typesExpression = $annotation->getTypeExpression(); - - if (null === $typesExpression) { - continue; - } - - $typeInfo = $this->getCommonTypeInfo($typesExpression, false); - $unionTypes = null; - - if (null === $typeInfo) { - $unionTypes = $this->getUnionTypes($typesExpression, false); - } - - if (null === $typeInfo && null === $unionTypes) { - continue; - } - - if (null !== $unionTypes) { - $typeInfo = ['commonType' => $unionTypes, 'isNullable' => false]; - } - - if (\array_key_exists($propertyName, $propertyTypes) && $typeInfo !== $propertyTypes[$propertyName]) { - return null; - } - - $propertyTypes[$propertyName] = $typeInfo; - } - - if (\count($propertyTypes) !== \count($propertyIndices)) { - return null; - } - - $type = array_shift($propertyTypes); - - foreach ($propertyTypes as $propertyType) { - if ($propertyType !== $type) { - return null; - } - } - - return $type; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php deleted file mode 100644 index 0debfc93..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php +++ /dev/null @@ -1,249 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ExperimentalFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * scalar_types?: bool, - * types_map?: array, - * union_types?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * scalar_types: bool, - * types_map: array, - * union_types: bool - * } - */ -final class PhpdocToReturnTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ConfigurableFixerInterface, ExperimentalFixerInterface -{ - private const TYPE_CHECK_TEMPLATE = '> - */ - private array $excludeFuncNames = [ - [T_STRING, '__construct'], - [T_STRING, '__destruct'], - [T_STRING, '__clone'], - ]; - - /** - * @var array - */ - private array $skippedTypes = [ - 'resource' => true, - 'null' => true, - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Takes `@return` annotation of non-mixed types and adjusts accordingly the function signature.', - [ - new CodeSample( - ' false] - ), - new CodeSample( - ' false] - ), - new VersionSpecificCodeSample( - 'isAnyTokenKindsFound([T_FUNCTION, T_FN]); - } - - /** - * {@inheritdoc} - * - * Must run before FullyQualifiedStrictTypesFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer, ReturnToYieldFromFixer, ReturnTypeDeclarationFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 13; - } - - protected function isSkippedType(string $type): bool - { - return isset($this->skippedTypes[$type]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; 0 < $index; --$index) { - if (!$tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) { - continue; - } - - $funcName = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$funcName]->equalsAny($this->excludeFuncNames, false)) { - continue; - } - - $docCommentIndex = $this->findFunctionDocComment($tokens, $index); - if (null === $docCommentIndex) { - continue; - } - - $returnTypeAnnotations = $this->getAnnotationsFromDocComment('return', $tokens, $docCommentIndex); - if (1 !== \count($returnTypeAnnotations)) { - continue; - } - - $returnTypeAnnotation = $returnTypeAnnotations[0]; - - $typesExpression = $returnTypeAnnotation->getTypeExpression(); - - if (null === $typesExpression) { - continue; - } - - $typeInfo = $this->getCommonTypeInfo($typesExpression, true); - $unionTypes = null; - - if (null === $typeInfo) { - $unionTypes = $this->getUnionTypes($typesExpression, true); - } - - if (null === $typeInfo && null === $unionTypes) { - continue; - } - - if (null !== $typeInfo) { - $returnType = $typeInfo['commonType']; - $isNullable = $typeInfo['isNullable']; - } elseif (null !== $unionTypes) { - $returnType = $unionTypes; - $isNullable = false; - } - - if (!isset($returnType, $isNullable)) { - continue; - } - - $paramsStartIndex = $tokens->getNextTokenOfKind($index, ['(']); - $paramsEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $paramsStartIndex); - - $bodyStartIndex = $tokens->getNextTokenOfKind($paramsEndIndex, ['{', ';', [T_DOUBLE_ARROW]]); - - if ($this->hasReturnTypeHint($tokens, $bodyStartIndex)) { - continue; - } - - if (!$this->isValidSyntax(\sprintf(self::TYPE_CHECK_TEMPLATE, $returnType))) { - continue; - } - - $tokens->insertAt( - $paramsEndIndex + 1, - array_merge( - [ - new Token([CT::T_TYPE_COLON, ':']), - new Token([T_WHITESPACE, ' ']), - ], - $this->createTypeDeclarationTokens($returnType, $isNullable) - ) - ); - } - } - - protected function createTokensFromRawType(string $type): Tokens - { - $typeTokens = Tokens::fromCode(\sprintf(self::TYPE_CHECK_TEMPLATE, $type)); - $typeTokens->clearRange(0, 7); - $typeTokens->clearRange(\count($typeTokens) - 3, \count($typeTokens) - 1); - $typeTokens->clearEmptyTokens(); - - return $typeTokens; - } - - /** - * Determine whether the function already has a return type hint. - * - * @param int $index The index of the end of the function definition line, EG at { or ; - */ - private function hasReturnTypeHint(Tokens $tokens, int $index): bool - { - $endFuncIndex = $tokens->getPrevTokenOfKind($index, [')']); - $nextIndex = $tokens->getNextMeaningfulToken($endFuncIndex); - - return $tokens[$nextIndex]->isGivenKind(CT::T_TYPE_COLON); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php deleted file mode 100644 index 7538ff7a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php +++ /dev/null @@ -1,256 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - */ -final class RegularCallableCallFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Callables must be called without using `call_user_func*` when possible.', - [ - new CodeSample( - ' \'baz\'])` or `call_user_func($foo, $foo = \'bar\')`.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before NativeFunctionInvocationFixer. - * Must run after NoBinaryStringFixer, NoUselessConcatOperatorFixer. - */ - public function getPriority(): int - { - return 2; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - for ($index = $tokens->count() - 1; $index > 0; --$index) { - if (!$tokens[$index]->equalsAny([[T_STRING, 'call_user_func'], [T_STRING, 'call_user_func_array']], false)) { - continue; - } - - if (!$functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { - continue; // redeclare/override - } - - $openParenthesis = $tokens->getNextMeaningfulToken($index); - $closeParenthesis = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openParenthesis); - $arguments = $argumentsAnalyzer->getArguments($tokens, $openParenthesis, $closeParenthesis); - - if (1 > \count($arguments)) { - return; // no arguments! - } - - $this->processCall($tokens, $index, $arguments); - } - } - - /** - * @param non-empty-array $arguments - */ - private function processCall(Tokens $tokens, int $index, array $arguments): void - { - $firstArgIndex = $tokens->getNextMeaningfulToken( - $tokens->getNextMeaningfulToken($index) - ); - - /** @var Token $firstArgToken */ - $firstArgToken = $tokens[$firstArgIndex]; - - if ($firstArgToken->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { - $afterFirstArgIndex = $tokens->getNextMeaningfulToken($firstArgIndex); - - if (!$tokens[$afterFirstArgIndex]->equalsAny([',', ')'])) { - return; // first argument is an expression like `call_user_func("foo"."bar", ...)`, not supported! - } - - $firstArgTokenContent = $firstArgToken->getContent(); - - if (!$this->isValidFunctionInvoke($firstArgTokenContent)) { - return; - } - - $newCallTokens = Tokens::fromCode('getContent()), 1, -1).'();'); - $newCallTokensSize = $newCallTokens->count(); - $newCallTokens->clearAt(0); - $newCallTokens->clearRange($newCallTokensSize - 3, $newCallTokensSize - 1); - $newCallTokens->clearEmptyTokens(); - - $this->replaceCallUserFuncWithCallback($tokens, $index, $newCallTokens, $firstArgIndex, $firstArgIndex); - } elseif ( - $firstArgToken->isGivenKind(T_FUNCTION) - || ( - $firstArgToken->isGivenKind(T_STATIC) - && $tokens[$tokens->getNextMeaningfulToken($firstArgIndex)]->isGivenKind(T_FUNCTION) - ) - ) { - $firstArgEndIndex = $tokens->findBlockEnd( - Tokens::BLOCK_TYPE_CURLY_BRACE, - $tokens->getNextTokenOfKind($firstArgIndex, ['{']) - ); - - $newCallTokens = $this->getTokensSubcollection($tokens, $firstArgIndex, $firstArgEndIndex); - $newCallTokens->insertAt($newCallTokens->count(), new Token(')')); - $newCallTokens->insertAt(0, new Token('(')); - $this->replaceCallUserFuncWithCallback($tokens, $index, $newCallTokens, $firstArgIndex, $firstArgEndIndex); - } elseif ($firstArgToken->isGivenKind(T_VARIABLE)) { - $firstArgEndIndex = reset($arguments); - - // check if the same variable is used multiple times and if so do not fix - - foreach ($arguments as $argumentStart => $argumentEnd) { - if ($firstArgEndIndex === $argumentEnd) { - continue; - } - - for ($i = $argumentStart; $i <= $argumentEnd; ++$i) { - if ($tokens[$i]->equals($firstArgToken)) { - return; - } - } - } - - // check if complex statement and if so wrap the call in () if on PHP 7 or up, else do not fix - - $newCallTokens = $this->getTokensSubcollection($tokens, $firstArgIndex, $firstArgEndIndex); - $complex = false; - - for ($newCallIndex = \count($newCallTokens) - 1; $newCallIndex >= 0; --$newCallIndex) { - if ($newCallTokens[$newCallIndex]->isGivenKind([T_WHITESPACE, T_COMMENT, T_DOC_COMMENT, T_VARIABLE])) { - continue; - } - - $blockType = Tokens::detectBlockType($newCallTokens[$newCallIndex]); - - if (null !== $blockType && (Tokens::BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE === $blockType['type'] || Tokens::BLOCK_TYPE_INDEX_SQUARE_BRACE === $blockType['type'])) { - $newCallIndex = $newCallTokens->findBlockStart($blockType['type'], $newCallIndex); - - continue; - } - - $complex = true; - - break; - } - - if ($complex) { - $newCallTokens->insertAt($newCallTokens->count(), new Token(')')); - $newCallTokens->insertAt(0, new Token('(')); - } - $this->replaceCallUserFuncWithCallback($tokens, $index, $newCallTokens, $firstArgIndex, $firstArgEndIndex); - } - } - - private function replaceCallUserFuncWithCallback(Tokens $tokens, int $callIndex, Tokens $newCallTokens, int $firstArgStartIndex, int $firstArgEndIndex): void - { - $tokens->clearRange($firstArgStartIndex, $firstArgEndIndex); - - $afterFirstArgIndex = $tokens->getNextMeaningfulToken($firstArgEndIndex); - $afterFirstArgToken = $tokens[$afterFirstArgIndex]; - - if ($afterFirstArgToken->equals(',')) { - $useEllipsis = $tokens[$callIndex]->equals([T_STRING, 'call_user_func_array'], false); - - if ($useEllipsis) { - $secondArgIndex = $tokens->getNextMeaningfulToken($afterFirstArgIndex); - $tokens->insertAt($secondArgIndex, new Token([T_ELLIPSIS, '...'])); - } - - $tokens->clearAt($afterFirstArgIndex); - $tokens->removeTrailingWhitespace($afterFirstArgIndex); - } - - $tokens->overrideRange($callIndex, $callIndex, $newCallTokens); - $prevIndex = $tokens->getPrevMeaningfulToken($callIndex); - - if ($tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR)) { - $tokens->clearTokenAndMergeSurroundingWhitespace($prevIndex); - } - } - - private function getTokensSubcollection(Tokens $tokens, int $indexStart, int $indexEnd): Tokens - { - $size = $indexEnd - $indexStart + 1; - $subCollection = new Tokens($size); - - for ($i = 0; $i < $size; ++$i) { - /** @var Token $toClone */ - $toClone = $tokens[$i + $indexStart]; - $subCollection[$i] = clone $toClone; - } - - return $subCollection; - } - - private function isValidFunctionInvoke(string $name): bool - { - if (\strlen($name) < 3 || 'b' === $name[0] || 'B' === $name[0]) { - return false; - } - - $name = substr($name, 1, -1); - - if ($name !== trim($name)) { - return false; - } - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ReturnTypeDeclarationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ReturnTypeDeclarationFixer.php deleted file mode 100644 index 1b54e2ff..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ReturnTypeDeclarationFixer.php +++ /dev/null @@ -1,132 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * space_before?: 'none'|'one' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * space_before: 'none'|'one' - * } - */ -final class ReturnTypeDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Adjust spacing around colon in return type declarations and backed enum types.', - [ - new CodeSample( - " 'none'] - ), - new CodeSample( - " 'one'] - ), - ], - 'Rule is applied only in a PHP 7+ environment.' - ); - } - - /** - * {@inheritdoc} - * - * Must run after PhpUnitDataProviderReturnTypeFixer, PhpdocToReturnTypeFixer, VoidReturnFixer. - */ - public function getPriority(): int - { - return -17; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(CT::T_TYPE_COLON); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $oneSpaceBefore = 'one' === $this->configuration['space_before']; - - for ($index = 0, $limit = $tokens->count(); $index < $limit; ++$index) { - if (!$tokens[$index]->isGivenKind(CT::T_TYPE_COLON)) { - continue; - } - - $previousIndex = $index - 1; - $previousToken = $tokens[$previousIndex]; - - if ($previousToken->isWhitespace()) { - if (!$tokens[$tokens->getPrevNonWhitespace($index - 1)]->isComment()) { - if ($oneSpaceBefore) { - $tokens[$previousIndex] = new Token([T_WHITESPACE, ' ']); - } else { - $tokens->clearAt($previousIndex); - } - } - } elseif ($oneSpaceBefore) { - $tokenWasAdded = $tokens->ensureWhitespaceAtIndex($index, 0, ' '); - - if ($tokenWasAdded) { - ++$limit; - } - - ++$index; - } - - ++$index; - - $tokenWasAdded = $tokens->ensureWhitespaceAtIndex($index, 0, ' '); - - if ($tokenWasAdded) { - ++$limit; - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('space_before', 'Spacing to apply before colon.')) - ->setAllowedValues(['one', 'none']) - ->setDefault('none') - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/SingleLineThrowFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/SingleLineThrowFixer.php deleted file mode 100644 index 3ee0d51a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/SingleLineThrowFixer.php +++ /dev/null @@ -1,159 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - */ -final class SingleLineThrowFixer extends AbstractFixer -{ - private const REMOVE_WHITESPACE_AFTER_TOKENS = ['[']; - private const REMOVE_WHITESPACE_AROUND_TOKENS = ['(', [T_DOUBLE_COLON]]; - private const REMOVE_WHITESPACE_BEFORE_TOKENS = [')', ']', ',', ';']; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Throwing exception must be done in single line.', - [ - new CodeSample("isTokenKindFound(T_THROW); - } - - /** - * {@inheritdoc} - * - * Must run before BracesFixer, ConcatSpaceFixer. - */ - public function getPriority(): int - { - return 36; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = 0, $count = $tokens->count(); $index < $count; ++$index) { - if (!$tokens[$index]->isGivenKind(T_THROW)) { - continue; - } - - $endCandidateIndex = $tokens->getNextMeaningfulToken($index); - - while (!$tokens[$endCandidateIndex]->equalsAny([')', ']', ',', ';', [T_CLOSE_TAG]])) { - $blockType = Tokens::detectBlockType($tokens[$endCandidateIndex]); - - if (null !== $blockType) { - if (Tokens::BLOCK_TYPE_CURLY_BRACE === $blockType['type'] || !$blockType['isStart']) { - break; - } - - $endCandidateIndex = $tokens->findBlockEnd($blockType['type'], $endCandidateIndex); - } - - $endCandidateIndex = $tokens->getNextMeaningfulToken($endCandidateIndex); - } - - $this->trimNewLines($tokens, $index, $tokens->getPrevMeaningfulToken($endCandidateIndex)); - } - } - - private function trimNewLines(Tokens $tokens, int $startIndex, int $endIndex): void - { - for ($index = $startIndex; $index < $endIndex; ++$index) { - $content = $tokens[$index]->getContent(); - - if ($tokens[$index]->isGivenKind(T_COMMENT)) { - if (str_starts_with($content, '//')) { - $content = '/*'.substr($content, 2).' */'; - $tokens->clearAt($index + 1); - } elseif (str_starts_with($content, '#')) { - $content = '/*'.substr($content, 1).' */'; - $tokens->clearAt($index + 1); - } elseif (Preg::match('/\R/', $content)) { - $content = Preg::replace('/\R/', ' ', $content); - } - - $tokens[$index] = new Token([T_COMMENT, $content]); - - continue; - } - - if (!$tokens[$index]->isGivenKind(T_WHITESPACE)) { - continue; - } - - if (!Preg::match('/\R/', $content)) { - continue; - } - - $prevIndex = $tokens->getNonEmptySibling($index, -1); - - if ($this->isPreviousTokenToClear($tokens[$prevIndex])) { - $tokens->clearAt($index); - - continue; - } - - $nextIndex = $tokens->getNonEmptySibling($index, 1); - - if ( - $this->isNextTokenToClear($tokens[$nextIndex]) - && !$tokens[$prevIndex]->isGivenKind(T_FUNCTION) - ) { - $tokens->clearAt($index); - - continue; - } - - $tokens[$index] = new Token([T_WHITESPACE, ' ']); - } - } - - private function isPreviousTokenToClear(Token $token): bool - { - static $tokens = null; - - if (null === $tokens) { - $tokens = [...self::REMOVE_WHITESPACE_AFTER_TOKENS, ...self::REMOVE_WHITESPACE_AROUND_TOKENS]; - } - - return $token->equalsAny($tokens) || $token->isObjectOperator(); - } - - private function isNextTokenToClear(Token $token): bool - { - static $tokens = null; - - if (null === $tokens) { - $tokens = [...self::REMOVE_WHITESPACE_AROUND_TOKENS, ...self::REMOVE_WHITESPACE_BEFORE_TOKENS]; - } - - return $token->equalsAny($tokens) || $token->isObjectOperator(); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/StaticLambdaFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/StaticLambdaFixer.php deleted file mode 100644 index 81763f7f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/StaticLambdaFixer.php +++ /dev/null @@ -1,130 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -final class StaticLambdaFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Lambdas not (indirectly) referencing `$this` must be declared `static`.', - [new CodeSample("bindTo` on lambdas without referencing to `$this`.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $analyzer = new TokensAnalyzer($tokens); - $expectedFunctionKinds = [T_FUNCTION, T_FN]; - - for ($index = $tokens->count() - 4; $index > 0; --$index) { - if (!$tokens[$index]->isGivenKind($expectedFunctionKinds) || !$analyzer->isLambda($index)) { - continue; - } - - $prev = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$prev]->isGivenKind(T_STATIC)) { - continue; // lambda is already 'static' - } - - $argumentsStartIndex = $tokens->getNextTokenOfKind($index, ['(']); - $argumentsEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $argumentsStartIndex); - - // figure out where the lambda starts and ends - - if ($tokens[$index]->isGivenKind(T_FUNCTION)) { - $lambdaOpenIndex = $tokens->getNextTokenOfKind($argumentsEndIndex, ['{']); - $lambdaEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $lambdaOpenIndex); - } else { // T_FN - $lambdaOpenIndex = $tokens->getNextTokenOfKind($argumentsEndIndex, [[T_DOUBLE_ARROW]]); - $lambdaEndIndex = $analyzer->getLastTokenIndexOfArrowFunction($index); - } - - if ($this->hasPossibleReferenceToThis($tokens, $lambdaOpenIndex, $lambdaEndIndex)) { - continue; - } - - // make the lambda static - $tokens->insertAt( - $index, - [ - new Token([T_STATIC, 'static']), - new Token([T_WHITESPACE, ' ']), - ] - ); - - $index -= 4; // fixed after a lambda, closes candidate is at least 4 tokens before that - } - } - - /** - * Returns 'true' if there is a possible reference to '$this' within the given tokens index range. - */ - private function hasPossibleReferenceToThis(Tokens $tokens, int $startIndex, int $endIndex): bool - { - for ($i = $startIndex; $i <= $endIndex; ++$i) { - if ($tokens[$i]->isGivenKind(T_VARIABLE) && '$this' === strtolower($tokens[$i]->getContent())) { - return true; // directly accessing '$this' - } - - if ($tokens[$i]->isGivenKind([ - T_INCLUDE, // loading additional symbols we cannot analyze here - T_INCLUDE_ONCE, // " - T_REQUIRE, // " - T_REQUIRE_ONCE, // " - CT::T_DYNAMIC_VAR_BRACE_OPEN, // "$h = ${$g};" case - T_EVAL, // "$c = eval('return $this;');" case - ])) { - return true; - } - - if ($tokens[$i]->equals('$')) { - $nextIndex = $tokens->getNextMeaningfulToken($i); - - if ($tokens[$nextIndex]->isGivenKind(T_VARIABLE)) { - return true; // "$$a" case - } - } - - if ($tokens[$i]->equals([T_STRING, 'parent'], false)) { - return true; // parent:: case - } - } - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/UseArrowFunctionsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/UseArrowFunctionsFixer.php deleted file mode 100644 index 4d18b8cd..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/UseArrowFunctionsFixer.php +++ /dev/null @@ -1,181 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Gregor Harlan - */ -final class UseArrowFunctionsFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Anonymous functions with return as the only statement must use arrow functions.', - [ - new CodeSample( - <<<'SAMPLE' - isAllTokenKindsFound([T_FUNCTION, T_RETURN]); - } - - public function isRisky(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * Must run before FunctionDeclarationFixer. - */ - public function getPriority(): int - { - return 32; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $analyzer = new TokensAnalyzer($tokens); - - for ($index = $tokens->count() - 1; $index > 0; --$index) { - if (!$tokens[$index]->isGivenKind(T_FUNCTION) || !$analyzer->isLambda($index)) { - continue; - } - - // Find parameters - - $parametersStart = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$parametersStart]->isGivenKind(CT::T_RETURN_REF)) { - $parametersStart = $tokens->getNextMeaningfulToken($parametersStart); - } - - $parametersEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $parametersStart); - - // Find `use ()` start and end - // Abort if it contains reference variables - - $next = $tokens->getNextMeaningfulToken($parametersEnd); - - $useStart = null; - $useEnd = null; - - if ($tokens[$next]->isGivenKind(CT::T_USE_LAMBDA)) { - $useStart = $next; - - if ($tokens[$useStart - 1]->isGivenKind(T_WHITESPACE)) { - --$useStart; - } - - $next = $tokens->getNextMeaningfulToken($next); - - while (!$tokens[$next]->equals(')')) { - if ($tokens[$next]->equals('&')) { - // variables used by reference are not supported by arrow functions - continue 2; - } - - $next = $tokens->getNextMeaningfulToken($next); - } - - $useEnd = $next; - $next = $tokens->getNextMeaningfulToken($next); - } - - // Find opening brace and following `return` - // Abort if there is more than whitespace between them (like comments) - - $braceOpen = $tokens[$next]->equals('{') ? $next : $tokens->getNextTokenOfKind($next, ['{']); - $return = $braceOpen + 1; - - if ($tokens[$return]->isGivenKind(T_WHITESPACE)) { - ++$return; - } - - if (!$tokens[$return]->isGivenKind(T_RETURN)) { - continue; - } - - // Find semicolon of `return` statement - - $semicolon = $tokens->getNextTokenOfKind($return, ['{', ';']); - - if (!$tokens[$semicolon]->equals(';')) { - continue; - } - - // Find closing brace - // Abort if there is more than whitespace between semicolon and closing brace - - $braceClose = $semicolon + 1; - - if ($tokens[$braceClose]->isGivenKind(T_WHITESPACE)) { - ++$braceClose; - } - - if (!$tokens[$braceClose]->equals('}')) { - continue; - } - - // Transform the function to an arrow function - - $this->transform($tokens, $index, $useStart, $useEnd, $braceOpen, $return, $semicolon, $braceClose); - } - } - - private function transform(Tokens $tokens, int $index, ?int $useStart, ?int $useEnd, int $braceOpen, int $return, int $semicolon, int $braceClose): void - { - $tokensToInsert = [new Token([T_DOUBLE_ARROW, '=>'])]; - - if ($tokens->getNextMeaningfulToken($return) === $semicolon) { - $tokensToInsert[] = new Token([T_WHITESPACE, ' ']); - $tokensToInsert[] = new Token([T_STRING, 'null']); - } - - $tokens->clearRange($semicolon, $braceClose); - $tokens->clearRange($braceOpen + 1, $return); - $tokens->overrideRange($braceOpen, $braceOpen, $tokensToInsert); - - if (null !== $useStart) { - $tokens->clearRange($useStart, $useEnd); - } - - $tokens[$index] = new Token([T_FN, 'fn']); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php deleted file mode 100644 index f391347e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php +++ /dev/null @@ -1,256 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\FunctionNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Mark Nielsen - */ -final class VoidReturnFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Add `void` return type to functions with missing or empty return statements, but priority is given to `@return` annotations.', - [ - new CodeSample( - "isTokenKindFound(T_FUNCTION); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - // These cause syntax errors. - static $excludedFunctions = [ - [T_STRING, '__clone'], - [T_STRING, '__construct'], - [T_STRING, '__debugInfo'], - [T_STRING, '__destruct'], - [T_STRING, '__isset'], - [T_STRING, '__serialize'], - [T_STRING, '__set_state'], - [T_STRING, '__sleep'], - [T_STRING, '__toString'], - ]; - - for ($index = $tokens->count() - 1; 0 <= $index; --$index) { - if (!$tokens[$index]->isGivenKind(T_FUNCTION)) { - continue; - } - - $functionName = $tokens->getNextMeaningfulToken($index); - if ($tokens[$functionName]->equalsAny($excludedFunctions, false)) { - continue; - } - - $startIndex = $tokens->getNextTokenOfKind($index, ['{', ';']); - - if ($this->hasReturnTypeHint($tokens, $startIndex)) { - continue; - } - - if ($tokens[$startIndex]->equals(';')) { - // No function body defined, fallback to PHPDoc. - if ($this->hasVoidReturnAnnotation($tokens, $index)) { - $this->fixFunctionDefinition($tokens, $startIndex); - } - - continue; - } - - if ($this->hasReturnAnnotation($tokens, $index)) { - continue; - } - - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $startIndex); - - if ($this->hasVoidReturn($tokens, $startIndex, $endIndex)) { - $this->fixFunctionDefinition($tokens, $startIndex); - } - } - } - - /** - * Determine whether there is a non-void return annotation in the function's PHPDoc comment. - * - * @param int $index The index of the function token - */ - private function hasReturnAnnotation(Tokens $tokens, int $index): bool - { - foreach ($this->findReturnAnnotations($tokens, $index) as $return) { - if (['void'] !== $return->getTypes()) { - return true; - } - } - - return false; - } - - /** - * Determine whether there is a void return annotation in the function's PHPDoc comment. - * - * @param int $index The index of the function token - */ - private function hasVoidReturnAnnotation(Tokens $tokens, int $index): bool - { - foreach ($this->findReturnAnnotations($tokens, $index) as $return) { - if (['void'] === $return->getTypes()) { - return true; - } - } - - return false; - } - - /** - * Determine whether the function already has a return type hint. - * - * @param int $index The index of the end of the function definition line, EG at { or ; - */ - private function hasReturnTypeHint(Tokens $tokens, int $index): bool - { - $endFuncIndex = $tokens->getPrevTokenOfKind($index, [')']); - $nextIndex = $tokens->getNextMeaningfulToken($endFuncIndex); - - return $tokens[$nextIndex]->isGivenKind(CT::T_TYPE_COLON); - } - - /** - * Determine whether the function has a void return. - * - * @param int $startIndex Start of function body - * @param int $endIndex End of function body - */ - private function hasVoidReturn(Tokens $tokens, int $startIndex, int $endIndex): bool - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - for ($i = $startIndex; $i < $endIndex; ++$i) { - if ( - // skip anonymous classes - ($tokens[$i]->isGivenKind(T_CLASS) && $tokensAnalyzer->isAnonymousClass($i)) - // skip lambda functions - || ($tokens[$i]->isGivenKind(T_FUNCTION) && $tokensAnalyzer->isLambda($i)) - ) { - $i = $tokens->getNextTokenOfKind($i, ['{']); - $i = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $i); - - continue; - } - - if ($tokens[$i]->isGivenKind([T_YIELD, T_YIELD_FROM])) { - return false; // Generators cannot return void. - } - - if (!$tokens[$i]->isGivenKind(T_RETURN)) { - continue; - } - - $i = $tokens->getNextMeaningfulToken($i); - if (!$tokens[$i]->equals(';')) { - return false; - } - } - - return true; - } - - /** - * @param int $index The index of the end of the function definition line, EG at { or ; - */ - private function fixFunctionDefinition(Tokens $tokens, int $index): void - { - $endFuncIndex = $tokens->getPrevTokenOfKind($index, [')']); - $tokens->insertAt($endFuncIndex + 1, [ - new Token([CT::T_TYPE_COLON, ':']), - new Token([T_WHITESPACE, ' ']), - new Token([T_STRING, 'void']), - ]); - } - - /** - * Find all the return annotations in the function's PHPDoc comment. - * - * @param int $index The index of the function token - * - * @return list - */ - private function findReturnAnnotations(Tokens $tokens, int $index): array - { - $previousTokens = [ - T_ABSTRACT, - T_FINAL, - T_PRIVATE, - T_PROTECTED, - T_PUBLIC, - T_STATIC, - ]; - - if (\defined('T_ATTRIBUTE')) { // @TODO: drop condition when PHP 8.0+ is required - $previousTokens[] = T_ATTRIBUTE; - } - - do { - $index = $tokens->getPrevNonWhitespace($index); - - if ($tokens[$index]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - $index = $tokens->getPrevTokenOfKind($index, [[T_ATTRIBUTE]]); - } - } while ($tokens[$index]->isGivenKind($previousTokens)); - - if (!$tokens[$index]->isGivenKind(T_DOC_COMMENT)) { - return []; - } - - $doc = new DocBlock($tokens[$index]->getContent()); - - return $doc->getAnnotationsOfType('return'); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php deleted file mode 100644 index 151604b2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php +++ /dev/null @@ -1,987 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Import; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\TypeExpression; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Processor\ImportProcessor; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author VeeWee - * @author Tomas Jadrny - * @author Greg Korba - * @author SpacePossum - * @author Michael Vorisek - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * import_symbols?: bool, - * leading_backslash_in_global_namespace?: bool, - * phpdoc_tags?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * import_symbols: bool, - * leading_backslash_in_global_namespace: bool, - * phpdoc_tags: list - * } - * @phpstan-type _Uses array{ - * constant?: array, - * class?: array, - * function?: array - * } - * - * @phpstan-import-type _ImportType from \PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis - */ -final class FullyQualifiedStrictTypesFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const REGEX_CLASS = '(?:\\\?+'.TypeExpression::REGEX_IDENTIFIER - .'(\\\\'.TypeExpression::REGEX_IDENTIFIER.')*+)'; - - /** - * @var array{ - * constant?: list, - * class?: list, - * function?: list - * }|null - */ - private ?array $discoveredSymbols; - - /** - * @var array{ - * constant?: array, - * class?: array, - * function?: array - * } - */ - private array $symbolsForImport = []; - - /** - * @var array, array> - */ - private array $reservedIdentifiersByLevel; - - /** - * @var array{ - * constant?: array, - * class?: array, - * function?: array - * } - */ - private array $cacheUsesLast = []; - - /** - * @var array{ - * constant?: array, - * class?: array, - * function?: array - * } - */ - private array $cacheUseNameByShortNameLower; - - /** @var _Uses */ - private array $cacheUseShortNameByNameLower; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Removes the leading part of fully qualified symbol references if a given symbol is imported or belongs to the current namespace.', - [ - new CodeSample( - 'baz = $baz; - } - - /** - * @return \Foo\Bar\Baz - */ - public function getBaz() { - return $this->baz; - } - - public function doX(\Foo\Bar $foo, \Exception $e): \Foo\Bar\Baz - { - try {} - catch (\Foo\SomeException $e) {} - } -} -' - ), - new CodeSample( - ' true] - ), - new CodeSample( - ' true] - ), - new CodeSample( - ' true] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoSuperfluousPhpdocTagsFixer, OrderedAttributesFixer, OrderedImportsFixer, OrderedInterfacesFixer, StatementIndentationFixer. - * Must run after ClassKeywordFixer, PhpUnitAttributesFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer. - */ - public function getPriority(): int - { - return 7; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([ - CT::T_USE_TRAIT, - ...(\defined('T_ATTRIBUTE') ? [T_ATTRIBUTE] : []), // @TODO: drop condition when PHP 8.0+ is required - T_CATCH, - T_DOUBLE_COLON, - T_DOC_COMMENT, - T_EXTENDS, - T_FUNCTION, - T_IMPLEMENTS, - T_INSTANCEOF, - T_NEW, - T_VARIABLE, - ]); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder( - 'leading_backslash_in_global_namespace', - 'Whether FQCN is prefixed with backslash when that FQCN is used in global namespace context.' - )) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder( - 'import_symbols', - 'Whether FQCNs should be automatically imported.' - )) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder( - 'phpdoc_tags', - 'Collection of PHPDoc annotation tags where FQCNs should be processed. As of now only simple tags with `@tag \F\Q\C\N` format are supported (no complex types).' - )) - ->setAllowedTypes(['string[]']) - ->setDefault([ - 'param', - 'phpstan-param', - 'phpstan-property', - 'phpstan-property-read', - 'phpstan-property-write', - 'phpstan-return', - 'phpstan-var', - 'property', - 'property-read', - 'property-write', - 'psalm-param', - 'psalm-property', - 'psalm-property-read', - 'psalm-property-write', - 'psalm-return', - 'psalm-var', - 'return', - 'see', - 'throws', - 'var', - ]) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $namespaceUsesAnalyzer = new NamespaceUsesAnalyzer(); - $functionsAnalyzer = new FunctionsAnalyzer(); - - $this->symbolsForImport = []; - - foreach ($tokens->getNamespaceDeclarations() as $namespaceIndex => $namespace) { - $namespace = $tokens->getNamespaceDeclarations()[$namespaceIndex]; - - $namespaceName = $namespace->getFullName(); - - /** @var _Uses $uses */ - $uses = []; - $lastUse = null; - - foreach ($namespaceUsesAnalyzer->getDeclarationsInNamespace($tokens, $namespace, true) as $use) { - if (!$use->isClass()) { - continue; - } - - $uses[$use->getHumanFriendlyType()][ltrim($use->getFullName(), '\\')] = $use->getShortName(); - $lastUse = $use; - } - - $indexDiff = 0; - foreach (true === $this->configuration['import_symbols'] ? [true, false] : [false] as $discoverSymbolsPhase) { - $this->discoveredSymbols = $discoverSymbolsPhase ? [] : null; - - $classyKinds = [T_CLASS, T_INTERFACE, T_TRAIT]; - if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required - $classyKinds[] = T_ENUM; - } - - $openedCurlyBrackets = 0; - $this->reservedIdentifiersByLevel = []; - - for ($index = $namespace->getScopeStartIndex(); $index < $namespace->getScopeEndIndex() + $indexDiff; ++$index) { - $origSize = \count($tokens); - - if ($tokens[$index]->equals('{')) { - ++$openedCurlyBrackets; - } if ($tokens[$index]->equals('}')) { - unset($this->reservedIdentifiersByLevel[$openedCurlyBrackets]); - --$openedCurlyBrackets; - } elseif ($discoverSymbolsPhase && $tokens[$index]->isGivenKind($classyKinds)) { - $this->fixNextName($tokens, $index, $uses, $namespaceName); - } elseif ($tokens[$index]->isGivenKind(T_FUNCTION)) { - $this->fixFunction($functionsAnalyzer, $tokens, $index, $uses, $namespaceName); - } elseif ($tokens[$index]->isGivenKind([T_EXTENDS, T_IMPLEMENTS])) { - $this->fixExtendsImplements($tokens, $index, $uses, $namespaceName); - } elseif ($tokens[$index]->isGivenKind(T_CATCH)) { - $this->fixCatch($tokens, $index, $uses, $namespaceName); - } elseif ($tokens[$index]->isGivenKind(T_DOUBLE_COLON)) { - $this->fixPrevName($tokens, $index, $uses, $namespaceName); - } elseif ($tokens[$index]->isGivenKind([T_INSTANCEOF, T_NEW, CT::T_USE_TRAIT, CT::T_TYPE_COLON])) { - $this->fixNextName($tokens, $index, $uses, $namespaceName); - } elseif ($tokens[$index]->isGivenKind(T_VARIABLE)) { - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if (null !== $prevIndex && $tokens[$prevIndex]->isGivenKind(T_STRING)) { - $this->fixPrevName($tokens, $index, $uses, $namespaceName); - } - } elseif (\defined('T_ATTRIBUTE') && $tokens[$index]->isGivenKind(T_ATTRIBUTE)) { // @TODO: drop const check when PHP 8.0+ is required - $this->fixAttribute($tokens, $index, $uses, $namespaceName); - } elseif ($discoverSymbolsPhase && !\defined('T_ATTRIBUTE') && $tokens[$index]->isComment() && Preg::match('/#\[\s*('.self::REGEX_CLASS.')/', $tokens[$index]->getContent(), $matches)) { // @TODO: drop when PHP 8.0+ is required - /** @var class-string $attributeClass */ - $attributeClass = $matches[1]; - $this->determineShortType($attributeClass, 'class', $uses, $namespaceName); - } elseif ($tokens[$index]->isGivenKind(T_DOC_COMMENT)) { - Preg::matchAll('/\*\h*@(?:psalm-|phpstan-)?(?:template(?:-covariant|-contravariant)?|(?:import-)?type)\h+('.TypeExpression::REGEX_IDENTIFIER.')(?!\S)/i', $tokens[$index]->getContent(), $matches); - foreach ($matches[1] as $reservedIdentifier) { - $this->reservedIdentifiersByLevel[$openedCurlyBrackets + 1][$reservedIdentifier] = true; - } - - $this->fixPhpDoc($tokens, $index, $uses, $namespaceName); - } - - $indexDiff += \count($tokens) - $origSize; - } - - $this->reservedIdentifiersByLevel = []; - - if ($discoverSymbolsPhase) { - $this->setupUsesFromDiscoveredSymbols($uses, $namespaceName); - } - } - - if ([] !== $this->symbolsForImport) { - if (null !== $lastUse) { - $atIndex = $lastUse->getEndIndex() + 1; - } elseif (0 !== $namespace->getEndIndex()) { - $atIndex = $namespace->getEndIndex() + 1; - } else { - $firstTokenIndex = $tokens->getNextMeaningfulToken($namespace->getScopeStartIndex()); - if (null !== $firstTokenIndex && $tokens[$firstTokenIndex]->isGivenKind(T_DECLARE)) { - $atIndex = $tokens->getNextTokenOfKind($firstTokenIndex, [';']) + 1; - } else { - $atIndex = $namespace->getScopeStartIndex() + 1; - } - } - - // Insert all registered FQCNs - $this->createImportProcessor()->insertImports($tokens, $this->symbolsForImport, $atIndex); - - $this->symbolsForImport = []; - } - } - } - - /** - * @param _Uses $uses - */ - private function refreshUsesCache(array $uses): void - { - if ($this->cacheUsesLast === $uses) { - return; - } - - $this->cacheUsesLast = $uses; - - $this->cacheUseNameByShortNameLower = []; - $this->cacheUseShortNameByNameLower = []; - - foreach ($uses as $kind => $kindUses) { - foreach ($kindUses as $useLongName => $useShortName) { - $this->cacheUseNameByShortNameLower[$kind][strtolower($useShortName)] = $useLongName; - - /** - * @var class-string $normalisedUseLongName - * - * @phpstan-ignore varTag.nativeType - */ - $normalisedUseLongName = strtolower($useLongName); - $this->cacheUseShortNameByNameLower[$kind][$normalisedUseLongName] = $useShortName; - } - } - } - - private function isReservedIdentifier(string $symbol): bool - { - if (str_contains($symbol, '\\')) { // optimization only - return false; - } - - if ((new TypeAnalysis($symbol))->isReservedType()) { - return true; - } - - foreach ($this->reservedIdentifiersByLevel as $reservedIdentifiers) { - if (isset($reservedIdentifiers[$symbol])) { - return true; - } - } - - return false; - } - - /** - * Resolve absolute or relative symbol to normalized FQCN. - * - * @param _ImportType $importKind - * @param _Uses $uses - * - * @return class-string - */ - private function resolveSymbol(string $symbol, string $importKind, array $uses, string $namespaceName): string - { - if (str_starts_with($symbol, '\\')) { - return substr($symbol, 1); // @phpstan-ignore return.type - } - - if ($this->isReservedIdentifier($symbol)) { - return $symbol; // @phpstan-ignore return.type - } - - $this->refreshUsesCache($uses); - - $symbolArr = explode('\\', $symbol, 2); - $shortStartNameLower = strtolower($symbolArr[0]); - if (isset($this->cacheUseNameByShortNameLower[$importKind][$shortStartNameLower])) { - // @phpstan-ignore return.type - return $this->cacheUseNameByShortNameLower[$importKind][$shortStartNameLower].(isset($symbolArr[1]) ? '\\'.$symbolArr[1] : ''); - } - - return ('' !== $namespaceName ? $namespaceName.'\\' : '').$symbol; // @phpstan-ignore return.type - } - - /** - * Shorten normalized FQCN as much as possible. - * - * @param _ImportType $importKind - * @param _Uses $uses - */ - private function shortenSymbol(string $fqcn, string $importKind, array $uses, string $namespaceName): string - { - if ($this->isReservedIdentifier($fqcn)) { - return $fqcn; - } - - $this->refreshUsesCache($uses); - - $res = null; - - // try to shorten the name using namespace - $iMin = 0; - if (str_starts_with($fqcn, $namespaceName.'\\')) { - $tmpRes = substr($fqcn, \strlen($namespaceName) + 1); - if (!isset($this->cacheUseNameByShortNameLower[$importKind][strtolower(explode('\\', $tmpRes, 2)[0])]) && !$this->isReservedIdentifier($tmpRes)) { - $res = $tmpRes; - $iMin = substr_count($namespaceName, '\\') + 1; - } - } - - // try to shorten the name using uses - $tmp = $fqcn; - for ($i = substr_count($fqcn, '\\'); $i >= $iMin; --$i) { - if (isset($this->cacheUseShortNameByNameLower[$importKind][strtolower($tmp)])) { - $tmpRes = $this->cacheUseShortNameByNameLower[$importKind][strtolower($tmp)].substr($fqcn, \strlen($tmp)); - if (!$this->isReservedIdentifier($tmpRes)) { - $res = $tmpRes; - - break; - } - } - - if ($i > 0) { - $tmp = substr($tmp, 0, strrpos($tmp, '\\')); - } - } - - // shortening is not possible, add leading backslash if needed - if (null === $res) { - $res = $fqcn; - if ('' !== $namespaceName - || true === $this->configuration['leading_backslash_in_global_namespace'] - || isset($this->cacheUseNameByShortNameLower[$importKind][strtolower(explode('\\', $res, 2)[0])]) - ) { - $res = '\\'.$res; - } - } - - return $res; - } - - /** - * @param _Uses $uses - */ - private function setupUsesFromDiscoveredSymbols(array &$uses, string $namespaceName): void - { - foreach ($this->discoveredSymbols as $kind => $discoveredSymbols) { - $discoveredFqcnByShortNameLower = []; - - if ('' === $namespaceName) { - foreach ($discoveredSymbols as $symbol) { - if (!str_starts_with($symbol, '\\')) { - $shortStartName = explode('\\', ltrim($symbol, '\\'), 2)[0]; - $shortStartNameLower = strtolower($shortStartName); - $discoveredFqcnByShortNameLower[$kind][$shortStartNameLower] = $this->resolveSymbol($shortStartName, $kind, $uses, $namespaceName); - } - } - } - - foreach ($uses[$kind] ?? [] as $useLongName => $useShortName) { - $discoveredFqcnByShortNameLower[$kind][strtolower($useShortName)] = $useLongName; - } - - $useByShortNameLower = []; - foreach ($uses[$kind] ?? [] as $useShortName) { - $useByShortNameLower[strtolower($useShortName)] = true; - } - - uasort($discoveredSymbols, static function ($a, $b) { - $res = str_starts_with($a, '\\') <=> str_starts_with($b, '\\'); - if (0 !== $res) { - return $res; - } - - return substr_count($a, '\\') <=> substr_count($b, '\\'); - }); - foreach ($discoveredSymbols as $symbol) { - while (true) { - $shortEndNameLower = strtolower(str_contains($symbol, '\\') ? substr($symbol, strrpos($symbol, '\\') + 1) : $symbol); - if (!isset($discoveredFqcnByShortNameLower[$kind][$shortEndNameLower])) { - $shortStartNameLower = strtolower(explode('\\', ltrim($symbol, '\\'), 2)[0]); - if (str_starts_with($symbol, '\\') || ('' === $namespaceName && !isset($useByShortNameLower[$shortStartNameLower])) - || !str_contains($symbol, '\\') - ) { - $discoveredFqcnByShortNameLower[$kind][$shortEndNameLower] = $this->resolveSymbol($symbol, $kind, $uses, $namespaceName); - - break; - } - } - // else short name collision - keep unimported - - if (str_starts_with($symbol, '\\') || '' === $namespaceName || !str_contains($symbol, '\\')) { - break; - } - - $symbol = substr($symbol, 0, strrpos($symbol, '\\')); - } - } - - foreach ($uses[$kind] ?? [] as $useLongName => $useShortName) { - $discoveredLongName = $discoveredFqcnByShortNameLower[$kind][strtolower($useShortName)] ?? null; - if (strtolower($discoveredLongName) === strtolower($useLongName)) { - unset($discoveredFqcnByShortNameLower[$kind][strtolower($useShortName)]); - } - } - - foreach ($discoveredFqcnByShortNameLower[$kind] ?? [] as $fqcn) { - $shortenedName = ltrim($this->shortenSymbol($fqcn, $kind, [], $namespaceName), '\\'); - if (str_contains($shortenedName, '\\')) { // prevent importing non-namespaced names in global namespace - $shortEndName = str_contains($fqcn, '\\') ? substr($fqcn, strrpos($fqcn, '\\') + 1) : $fqcn; - $uses[$kind][$fqcn] = $shortEndName; - $this->symbolsForImport[$kind][$shortEndName] = $fqcn; - } - } - - if (isset($this->symbolsForImport[$kind])) { - ksort($this->symbolsForImport[$kind], SORT_NATURAL); - } - } - } - - /** - * @param _Uses $uses - */ - private function fixFunction(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index, array $uses, string $namespaceName): void - { - $arguments = $functionsAnalyzer->getFunctionArguments($tokens, $index); - - foreach ($arguments as $i => $argument) { - $argument = $functionsAnalyzer->getFunctionArguments($tokens, $index)[$i]; - - if ($argument->hasTypeAnalysis()) { - $this->replaceByShortType($tokens, $argument->getTypeAnalysis(), $uses, $namespaceName); - } - } - - $returnTypeAnalysis = $functionsAnalyzer->getFunctionReturnType($tokens, $index); - - if (null !== $returnTypeAnalysis) { - $this->replaceByShortType($tokens, $returnTypeAnalysis, $uses, $namespaceName); - } - } - - /** - * @param _Uses $uses - */ - private function fixPhpDoc(Tokens $tokens, int $index, array $uses, string $namespaceName): void - { - $allowedTags = $this->configuration['phpdoc_tags']; - - if ([] === $allowedTags) { - return; - } - - $phpDoc = $tokens[$index]; - $phpDocContent = $phpDoc->getContent(); - $phpDocContentNew = Preg::replaceCallback('/([*{]\h*@)(\S+)(\h+)('.TypeExpression::REGEX_TYPES.')(?!(?!\})\S)/', function ($matches) use ($allowedTags, $uses, $namespaceName) { - if (!\in_array($matches[2], $allowedTags, true)) { - return $matches[0]; - } - - return $matches[1].$matches[2].$matches[3].$this->fixPhpDocType($matches[4], $uses, $namespaceName); - }, $phpDocContent); - - if ($phpDocContentNew !== $phpDocContent) { - $tokens[$index] = new Token([T_DOC_COMMENT, $phpDocContentNew]); - } - } - - /** - * @param _Uses $uses - */ - private function fixPhpDocType(string $type, array $uses, string $namespaceName): string - { - $typeExpression = new TypeExpression($type, null, []); - - $typeExpression = $typeExpression->mapTypes(function (TypeExpression $type) use ($uses, $namespaceName) { - $currentTypeValue = $type->toString(); - - if ($type->isCompositeType() || !Preg::match('/^'.self::REGEX_CLASS.'$/', $currentTypeValue)) { - return $type; - } - - /** @var class-string $currentTypeValue */ - $shortTokens = $this->determineShortType($currentTypeValue, 'class', $uses, $namespaceName); - - if (null === $shortTokens) { - return $type; - } - - $newTypeValue = implode('', array_map( - static fn (Token $token) => $token->getContent(), - $shortTokens - )); - - return $currentTypeValue === $newTypeValue - ? $type - : new TypeExpression($newTypeValue, null, []); - }); - - return $typeExpression->toString(); - } - - /** - * @param _Uses $uses - */ - private function fixExtendsImplements(Tokens $tokens, int $index, array $uses, string $namespaceName): void - { - // We handle `extends` and `implements` with similar logic, but we need to exit the loop under different conditions. - $isExtends = $tokens[$index]->equals([T_EXTENDS]); - $index = $tokens->getNextMeaningfulToken($index); - - $typeStartIndex = null; - $typeEndIndex = null; - - while (true) { - if ($tokens[$index]->equalsAny([',', '{', [T_IMPLEMENTS]])) { - if (null !== $typeStartIndex) { - $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName); - } - $typeStartIndex = null; - - if ($tokens[$index]->equalsAny($isExtends ? [[T_IMPLEMENTS], '{'] : ['{'])) { - break; - } - } else { - if (null === $typeStartIndex) { - $typeStartIndex = $index; - } - $typeEndIndex = $index; - } - - $index = $tokens->getNextMeaningfulToken($index); - } - } - - /** - * @param _Uses $uses - */ - private function fixCatch(Tokens $tokens, int $index, array $uses, string $namespaceName): void - { - $index = $tokens->getNextMeaningfulToken($index); // '(' - $index = $tokens->getNextMeaningfulToken($index); // first part of first exception class to be caught - - $typeStartIndex = null; - $typeEndIndex = null; - - while (true) { - if ($tokens[$index]->equalsAny([')', [T_VARIABLE], [CT::T_TYPE_ALTERNATION]])) { - if (null === $typeStartIndex) { - break; - } - - $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName); - $typeStartIndex = null; - - if ($tokens[$index]->equals(')')) { - break; - } - } else { - if (null === $typeStartIndex) { - $typeStartIndex = $index; - } - $typeEndIndex = $index; - } - - $index = $tokens->getNextMeaningfulToken($index); - } - } - - /** - * @param _Uses $uses - */ - private function fixAttribute(Tokens $tokens, int $index, array $uses, string $namespaceName): void - { - $attributeAnalysis = AttributeAnalyzer::collectOne($tokens, $index); - - foreach ($attributeAnalysis->getAttributes() as $attribute) { - $index = $attribute['start']; - while ($tokens[$index]->equalsAny([[T_STRING], [T_NS_SEPARATOR]])) { - $index = $tokens->getPrevMeaningfulToken($index); - } - $this->fixNextName($tokens, $index, $uses, $namespaceName); - } - } - - /** - * @param _Uses $uses - */ - private function fixPrevName(Tokens $tokens, int $index, array $uses, string $namespaceName): void - { - $typeStartIndex = null; - $typeEndIndex = null; - - while (true) { - $index = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$index]->isObjectOperator()) { - break; - } - - if ($tokens[$index]->equalsAny([[T_STRING], [T_NS_SEPARATOR]])) { - $typeStartIndex = $index; - if (null === $typeEndIndex) { - $typeEndIndex = $index; - } - } else { - if (null !== $typeEndIndex) { - $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName); - } - - break; - } - } - } - - /** - * @param _Uses $uses - */ - private function fixNextName(Tokens $tokens, int $index, array $uses, string $namespaceName): void - { - $typeStartIndex = null; - $typeEndIndex = null; - - while (true) { - $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->equalsAny([[T_STRING], [T_NS_SEPARATOR]])) { - if (null === $typeStartIndex) { - $typeStartIndex = $index; - } - $typeEndIndex = $index; - } else { - if (null !== $typeStartIndex) { - $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName); - } - - break; - } - } - } - - /** - * @param _Uses $uses - */ - private function shortenClassIfPossible(Tokens $tokens, int $typeStartIndex, int $typeEndIndex, array $uses, string $namespaceName): int - { - /** @var class-string $content */ - $content = $tokens->generatePartialCode($typeStartIndex, $typeEndIndex); - $newTokens = $this->determineShortType($content, 'class', $uses, $namespaceName); - if (null === $newTokens) { - return 0; - } - - $tokens->overrideRange($typeStartIndex, $typeEndIndex, $newTokens); - - return \count($newTokens) - ($typeEndIndex - $typeStartIndex) - 1; - } - - /** - * @param _Uses $uses - */ - private function replaceByShortType(Tokens $tokens, TypeAnalysis $type, array $uses, string $namespaceName): void - { - $typeStartIndex = $type->getStartIndex(); - - if ($tokens[$typeStartIndex]->isGivenKind(CT::T_NULLABLE_TYPE)) { - $typeStartIndex = $tokens->getNextMeaningfulToken($typeStartIndex); - } - - $types = $this->getTypes($tokens, $typeStartIndex, $type->getEndIndex()); - - foreach ($types as [$startIndex, $endIndex]) { - /** @var class-string $content */ - $content = $tokens->generatePartialCode($startIndex, $endIndex); - $newTokens = $this->determineShortType($content, 'class', $uses, $namespaceName); - if (null !== $newTokens) { - $tokens->overrideRange($startIndex, $endIndex, $newTokens); - } - } - } - - /** - * Determines short type based on FQCN, current namespace and imports (`use` declarations). - * - * @param class-string $typeName - * @param _ImportType $importKind - * @param _Uses $uses - * - * @return null|list - */ - private function determineShortType(string $typeName, string $importKind, array $uses, string $namespaceName): ?array - { - if (null !== $this->discoveredSymbols) { - if (!$this->isReservedIdentifier($typeName)) { - $this->discoveredSymbols[$importKind][] = $typeName; - } - - return null; - } - - $fqcn = $this->resolveSymbol($typeName, $importKind, $uses, $namespaceName); - $shortenedType = $this->shortenSymbol($fqcn, $importKind, $uses, $namespaceName); - if ($shortenedType === $typeName) { - return null; - } - - return $this->namespacedStringToTokens($shortenedType); - } - - /** - * @return iterable - */ - private function getTypes(Tokens $tokens, int $index, int $endIndex): iterable - { - $skipNextYield = false; - $typeStartIndex = $typeEndIndex = null; - while (true) { - if ($tokens[$index]->isGivenKind(CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN)) { - $index = $tokens->getNextMeaningfulToken($index); - $typeStartIndex = $typeEndIndex = null; - - continue; - } - - if ( - $tokens[$index]->isGivenKind([CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE]) - || $index > $endIndex - ) { - if (!$skipNextYield && null !== $typeStartIndex) { - $origCount = \count($tokens); - - yield [$typeStartIndex, $typeEndIndex]; - - $endIndex += \count($tokens) - $origCount; - - // type tokens were possibly updated, restart type match - $skipNextYield = true; - $index = $typeEndIndex = $typeStartIndex; - } else { - $skipNextYield = false; - $index = $tokens->getNextMeaningfulToken($index); - $typeStartIndex = $typeEndIndex = null; - } - - if ($index > $endIndex) { - break; - } - - continue; - } - - if (null === $typeStartIndex) { - $typeStartIndex = $index; - } - $typeEndIndex = $index; - - $index = $tokens->getNextMeaningfulToken($index); - } - } - - /** - * @return list - */ - private function namespacedStringToTokens(string $input): array - { - $tokens = []; - - if (str_starts_with($input, '\\')) { - $tokens[] = new Token([T_NS_SEPARATOR, '\\']); - $input = substr($input, 1); - } - - $parts = explode('\\', $input); - foreach ($parts as $index => $part) { - $tokens[] = new Token([T_STRING, $part]); - - if ($index !== \count($parts) - 1) { - $tokens[] = new Token([T_NS_SEPARATOR, '\\']); - } - } - - return $tokens; - } - - /** - * We need to create import processor dynamically (not in costructor), because actual whitespace configuration - * is set later, not when fixer's instance is created. - */ - private function createImportProcessor(): ImportProcessor - { - return new ImportProcessor($this->whitespacesConfig); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php deleted file mode 100644 index 56c673ea..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php +++ /dev/null @@ -1,726 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Import; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\ClassyAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Processor\ImportProcessor; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Gregor Harlan - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * import_classes?: bool|null, - * import_constants?: bool|null, - * import_functions?: bool|null - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * import_classes: bool|null, - * import_constants: bool|null, - * import_functions: bool|null - * } - */ -final class GlobalNamespaceImportFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private ImportProcessor $importProcessor; - - public function __construct() - { - parent::__construct(); - - $this->importProcessor = new ImportProcessor($this->whitespacesConfig); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Imports or fully qualifies global classes/functions/constants.', - [ - new CodeSample( - ' true, 'import_constants' => true, 'import_functions' => true] - ), - new CodeSample( - ' false, 'import_constants' => false, 'import_functions' => false] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoUnusedImportsFixer, OrderedImportsFixer, StatementIndentationFixer. - * Must run after NativeConstantInvocationFixer, NativeFunctionInvocationFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_DOC_COMMENT, T_NS_SEPARATOR, T_USE]) - && $tokens->isTokenKindFound(T_NAMESPACE) - && 1 === $tokens->countTokenKind(T_NAMESPACE) - && $tokens->isMonolithicPhp(); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $namespaceAnalyses = $tokens->getNamespaceDeclarations(); - - if (1 !== \count($namespaceAnalyses) || $namespaceAnalyses[0]->isGlobalNamespace()) { - return; - } - - $useDeclarations = (new NamespaceUsesAnalyzer())->getDeclarationsFromTokens($tokens); - - $newImports = []; - - if (true === $this->configuration['import_constants']) { - $newImports['const'] = $this->importConstants($tokens, $useDeclarations); - } elseif (false === $this->configuration['import_constants']) { - $this->fullyQualifyConstants($tokens, $useDeclarations); - } - - if (true === $this->configuration['import_functions']) { - $newImports['function'] = $this->importFunctions($tokens, $useDeclarations); - } elseif (false === $this->configuration['import_functions']) { - $this->fullyQualifyFunctions($tokens, $useDeclarations); - } - - if (true === $this->configuration['import_classes']) { - $newImports['class'] = $this->importClasses($tokens, $useDeclarations); - } elseif (false === $this->configuration['import_classes']) { - $this->fullyQualifyClasses($tokens, $useDeclarations); - } - - if (\count($newImports) > 0) { - if (\count($useDeclarations) > 0) { - $useDeclaration = end($useDeclarations); - $atIndex = $useDeclaration->getEndIndex() + 1; - } else { - $namespace = $tokens->getNamespaceDeclarations()[0]; - $atIndex = $namespace->getEndIndex() + 1; - } - - $this->importProcessor->insertImports($tokens, $newImports, $atIndex); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('import_constants', 'Whether to import, not import or ignore global constants.')) - ->setDefault(null) - ->setAllowedTypes(['null', 'bool']) - ->getOption(), - (new FixerOptionBuilder('import_functions', 'Whether to import, not import or ignore global functions.')) - ->setDefault(null) - ->setAllowedTypes(['null', 'bool']) - ->getOption(), - (new FixerOptionBuilder('import_classes', 'Whether to import, not import or ignore global classes.')) - ->setDefault(true) - ->setAllowedTypes(['null', 'bool']) - ->getOption(), - ]); - } - - /** - * @param list $useDeclarations - * - * @return array - */ - private function importConstants(Tokens $tokens, array $useDeclarations): array - { - [$global, $other] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isConstant(), true); - - // find namespaced const declarations (`const FOO = 1`) - // and add them to the not importable names (already used) - for ($index = 0, $count = $tokens->count(); $index < $count; ++$index) { - $token = $tokens[$index]; - - if ($token->isClassy()) { - $index = $tokens->getNextTokenOfKind($index, ['{']); - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - - continue; - } - - if (!$token->isGivenKind(T_CONST)) { - continue; - } - - $index = $tokens->getNextMeaningfulToken($index); - $other[$tokens[$index]->getContent()] = true; - } - - $analyzer = new TokensAnalyzer($tokens); - $indices = []; - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_STRING)) { - continue; - } - - $name = $token->getContent(); - - if (isset($other[$name])) { - continue; - } - - if (!$analyzer->isConstantInvocation($index)) { - continue; - } - - $nsSeparatorIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$nsSeparatorIndex]->isGivenKind(T_NS_SEPARATOR)) { - if (!isset($global[$name])) { - // found an unqualified constant invocation - // add it to the not importable names (already used) - $other[$name] = true; - } - - continue; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($nsSeparatorIndex); - if ($tokens[$prevIndex]->isGivenKind([CT::T_NAMESPACE_OPERATOR, T_STRING])) { - continue; - } - - $indices[] = $index; - } - - return $this->prepareImports($tokens, $indices, $global, $other, true); - } - - /** - * @param list $useDeclarations - * - * @return array - */ - private function importFunctions(Tokens $tokens, array $useDeclarations): array - { - [$global, $other] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isFunction(), false); - - // find function declarations - // and add them to the not importable names (already used) - foreach ($this->findFunctionDeclarations($tokens, 0, $tokens->count() - 1) as $name) { - $other[strtolower($name)] = true; - } - - $analyzer = new FunctionsAnalyzer(); - $indices = []; - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_STRING)) { - continue; - } - - $name = strtolower($token->getContent()); - - if (isset($other[$name])) { - continue; - } - - if (!$analyzer->isGlobalFunctionCall($tokens, $index)) { - continue; - } - - $nsSeparatorIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$nsSeparatorIndex]->isGivenKind(T_NS_SEPARATOR)) { - if (!isset($global[$name])) { - $other[$name] = true; - } - - continue; - } - - $indices[] = $index; - } - - return $this->prepareImports($tokens, $indices, $global, $other, false); - } - - /** - * @param list $useDeclarations - * - * @return array - */ - private function importClasses(Tokens $tokens, array $useDeclarations): array - { - [$global, $other] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isClass(), false); - - /** @var array $docBlocks */ - $docBlocks = []; - - // find class declarations and class usages in docblocks - // and add them to the not importable names (already used) - for ($index = 0, $count = $tokens->count(); $index < $count; ++$index) { - $token = $tokens[$index]; - - if ($token->isGivenKind(T_DOC_COMMENT)) { - $docBlocks[$index] = new DocBlock($token->getContent()); - - $this->traverseDocBlockTypes($docBlocks[$index], static function (string $type) use ($global, &$other): void { - if (str_contains($type, '\\')) { - return; - } - - $name = strtolower($type); - - if (!isset($global[$name])) { - $other[$name] = true; - } - }); - } - - if (!$token->isClassy()) { - continue; - } - - $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->isGivenKind(T_STRING)) { - $other[strtolower($tokens[$index]->getContent())] = true; - } - } - - $analyzer = new ClassyAnalyzer(); - $indices = []; - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_STRING)) { - continue; - } - - $name = strtolower($token->getContent()); - - if (isset($other[$name])) { - continue; - } - - if (!$analyzer->isClassyInvocation($tokens, $index)) { - continue; - } - - $nsSeparatorIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$nsSeparatorIndex]->isGivenKind(T_NS_SEPARATOR)) { - if (!isset($global[$name])) { - $other[$name] = true; - } - - continue; - } - - if ($tokens[$tokens->getPrevMeaningfulToken($nsSeparatorIndex)]->isGivenKind([CT::T_NAMESPACE_OPERATOR, T_STRING])) { - continue; - } - - $indices[] = $index; - } - - $imports = []; - - foreach ($docBlocks as $index => $docBlock) { - $changed = $this->traverseDocBlockTypes($docBlock, static function (string $type) use ($global, $other, &$imports): string { - if ('\\' !== $type[0]) { - return $type; - } - - /** @var class-string $name */ - $name = substr($type, 1); - - $checkName = strtolower($name); - - if (str_contains($checkName, '\\') || isset($other[$checkName])) { - return $type; - } - - if (isset($global[$checkName])) { - return \is_string($global[$checkName]) ? $global[$checkName] : $name; - } - - $imports[$checkName] = $name; - - return $name; - }); - - if ($changed) { - $tokens[$index] = new Token([T_DOC_COMMENT, $docBlock->getContent()]); - } - } - - return array_merge($imports, $this->prepareImports($tokens, $indices, $global, $other, false)); - } - - /** - * Removes the leading slash at the given indices (when the name is not already used). - * - * @param list $indices - * @param array $global - * @param array $other - * - * @return array array keys contain the names that must be imported - */ - private function prepareImports(Tokens $tokens, array $indices, array $global, array $other, bool $caseSensitive): array - { - $imports = []; - - foreach ($indices as $index) { - /** @var class-string $name */ - $name = $tokens[$index]->getContent(); - $checkName = $caseSensitive ? $name : strtolower($name); - - if (isset($other[$checkName])) { - continue; - } - - if (!isset($global[$checkName])) { - $imports[$checkName] = $name; - } elseif (\is_string($global[$checkName])) { - $tokens[$index] = new Token([T_STRING, $global[$checkName]]); - } - - $tokens->clearAt($tokens->getPrevMeaningfulToken($index)); - } - - return $imports; - } - - /** - * @param list $useDeclarations - */ - private function fullyQualifyConstants(Tokens $tokens, array $useDeclarations): void - { - if (!$tokens->isTokenKindFound(CT::T_CONST_IMPORT)) { - return; - } - - [$global] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isConstant() && !$declaration->isAliased(), true); - - if ([] === $global) { - return; - } - - $analyzer = new TokensAnalyzer($tokens); - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_STRING)) { - continue; - } - - if (!isset($global[$token->getContent()])) { - continue; - } - - if ($tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(T_NS_SEPARATOR)) { - continue; - } - - if (!$analyzer->isConstantInvocation($index)) { - continue; - } - - $tokens->insertAt($index, new Token([T_NS_SEPARATOR, '\\'])); - } - } - - /** - * @param list $useDeclarations - */ - private function fullyQualifyFunctions(Tokens $tokens, array $useDeclarations): void - { - if (!$tokens->isTokenKindFound(CT::T_FUNCTION_IMPORT)) { - return; - } - - [$global] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isFunction() && !$declaration->isAliased(), false); - - if ([] === $global) { - return; - } - - $analyzer = new FunctionsAnalyzer(); - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_STRING)) { - continue; - } - - if (!isset($global[strtolower($token->getContent())])) { - continue; - } - - if ($tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(T_NS_SEPARATOR)) { - continue; - } - - if (!$analyzer->isGlobalFunctionCall($tokens, $index)) { - continue; - } - - $tokens->insertAt($index, new Token([T_NS_SEPARATOR, '\\'])); - } - } - - /** - * @param list $useDeclarations - */ - private function fullyQualifyClasses(Tokens $tokens, array $useDeclarations): void - { - if (!$tokens->isTokenKindFound(T_USE)) { - return; - } - - [$global] = $this->filterUseDeclarations($useDeclarations, static fn (NamespaceUseAnalysis $declaration): bool => $declaration->isClass() && !$declaration->isAliased(), false); - - if ([] === $global) { - return; - } - - $analyzer = new ClassyAnalyzer(); - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if ($token->isGivenKind(T_DOC_COMMENT)) { - $doc = new DocBlock($token->getContent()); - - $changed = $this->traverseDocBlockTypes($doc, static function (string $type) use ($global): string { - if (!isset($global[strtolower($type)])) { - return $type; - } - - return '\\'.$type; - }); - - if ($changed) { - $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - - continue; - } - - if (!$token->isGivenKind(T_STRING)) { - continue; - } - - if (!isset($global[strtolower($token->getContent())])) { - continue; - } - - if ($tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(T_NS_SEPARATOR)) { - continue; - } - - if (!$analyzer->isClassyInvocation($tokens, $index)) { - continue; - } - - $tokens->insertAt($index, new Token([T_NS_SEPARATOR, '\\'])); - } - } - - /** - * @param list $declarations - * - * @return array{0: array, 1: array} - */ - private function filterUseDeclarations(array $declarations, callable $callback, bool $caseSensitive): array - { - $global = []; - $other = []; - - foreach ($declarations as $declaration) { - if (!$callback($declaration)) { - continue; - } - - $fullName = ltrim($declaration->getFullName(), '\\'); - - if (str_contains($fullName, '\\')) { - $name = $caseSensitive ? $declaration->getShortName() : strtolower($declaration->getShortName()); - $other[$name] = true; - - continue; - } - - $checkName = $caseSensitive ? $fullName : strtolower($fullName); - $alias = $declaration->getShortName(); - $global[$checkName] = $alias === $fullName ? true : $alias; - } - - return [$global, $other]; - } - - /** - * @return iterable - */ - private function findFunctionDeclarations(Tokens $tokens, int $start, int $end): iterable - { - for ($index = $start; $index <= $end; ++$index) { - $token = $tokens[$index]; - - if ($token->isClassy()) { - $classStart = $tokens->getNextTokenOfKind($index, ['{']); - $classEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $classStart); - - for ($index = $classStart; $index <= $classEnd; ++$index) { - if (!$tokens[$index]->isGivenKind(T_FUNCTION)) { - continue; - } - - $methodStart = $tokens->getNextTokenOfKind($index, ['{', ';']); - - if ($tokens[$methodStart]->equals(';')) { - $index = $methodStart; - - continue; - } - - $methodEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $methodStart); - - foreach ($this->findFunctionDeclarations($tokens, $methodStart, $methodEnd) as $function) { - yield $function; - } - - $index = $methodEnd; - } - - continue; - } - - if (!$token->isGivenKind(T_FUNCTION)) { - continue; - } - - $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->isGivenKind(CT::T_RETURN_REF)) { - $index = $tokens->getNextMeaningfulToken($index); - } - - if ($tokens[$index]->isGivenKind(T_STRING)) { - yield $tokens[$index]->getContent(); - } - } - } - - private function traverseDocBlockTypes(DocBlock $doc, callable $callback): bool - { - $annotations = $doc->getAnnotationsOfType(Annotation::getTagsWithTypes()); - - if (0 === \count($annotations)) { - return false; - } - - $changed = false; - - foreach ($annotations as $annotation) { - $types = $new = $annotation->getTypes(); - - foreach ($types as $i => $fullType) { - $newFullType = $fullType; - - Preg::matchAll('/[\\\\\w]+(?![\\\\\w:])/', $fullType, $matches, PREG_OFFSET_CAPTURE); - - foreach (array_reverse($matches[0]) as [$type, $offset]) { - $newType = $callback($type); - - if (null !== $newType && $type !== $newType) { - $newFullType = substr_replace($newFullType, $newType, $offset, \strlen($type)); - } - } - - $new[$i] = $newFullType; - } - - if ($types !== $new) { - $annotation->setTypes($new); - $changed = true; - } - } - - return $changed; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GroupImportFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GroupImportFixer.php deleted file mode 100644 index 039555d5..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GroupImportFixer.php +++ /dev/null @@ -1,369 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Import; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Utils; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * @author Volodymyr Kupriienko - * @author Greg Korba - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * group_types?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * group_types: list - * } - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - */ -final class GroupImportFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** @internal */ - public const GROUP_CLASSY = 'classy'; - - /** @internal */ - public const GROUP_CONSTANTS = 'constants'; - - /** @internal */ - public const GROUP_FUNCTIONS = 'functions'; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There MUST be group use for the same namespaces.', - [ - new CodeSample( - " [self::GROUP_CLASSY]] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_USE); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $allowedTypes = [self::GROUP_CLASSY, self::GROUP_FUNCTIONS, self::GROUP_CONSTANTS]; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('group_types', 'Defines the order of import types.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([static function (array $types) use ($allowedTypes): bool { - foreach ($types as $type) { - if (!\in_array($type, $allowedTypes, true)) { - throw new InvalidOptionsException( - \sprintf( - 'Invalid group type: %s, allowed types: %s.', - $type, - Utils::naturalLanguageJoin($allowedTypes) - ) - ); - } - } - - return true; - }]) - ->setDefault($allowedTypes) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $useWithSameNamespaces = $this->getSameNamespacesByType($tokens); - - if ([] === $useWithSameNamespaces) { - return; - } - - $typeMap = [ - NamespaceUseAnalysis::TYPE_CLASS => self::GROUP_CLASSY, - NamespaceUseAnalysis::TYPE_FUNCTION => self::GROUP_FUNCTIONS, - NamespaceUseAnalysis::TYPE_CONSTANT => self::GROUP_CONSTANTS, - ]; - - // As a first step we need to remove all the use statements for the enabled import types. - // We can't add new group imports yet, because we need to operate on previously determined token indices for all types. - foreach ($useWithSameNamespaces as $type => $uses) { - if (!\in_array($typeMap[$type], $this->configuration['group_types'], true)) { - continue; - } - - $this->removeSingleUseStatements($uses, $tokens); - } - - foreach ($useWithSameNamespaces as $type => $uses) { - if (!\in_array($typeMap[$type], $this->configuration['group_types'], true)) { - continue; - } - - $this->addGroupUseStatements($uses, $tokens); - } - } - - /** - * Gets namespace use analyzers with same namespaces. - * - * @return array> - */ - private function getSameNamespacesByType(Tokens $tokens): array - { - $useDeclarations = (new NamespaceUsesAnalyzer())->getDeclarationsFromTokens($tokens); - - if (0 === \count($useDeclarations)) { - return []; - } - - $allNamespaceAndType = array_map( - fn (NamespaceUseAnalysis $useDeclaration): string => $this->getNamespaceNameWithSlash($useDeclaration).$useDeclaration->getType(), - $useDeclarations - ); - - $sameNamespaces = array_filter(array_count_values($allNamespaceAndType), static fn (int $count): bool => $count > 1); - $sameNamespaces = array_keys($sameNamespaces); - - $sameNamespaceAnalysis = array_filter($useDeclarations, function (NamespaceUseAnalysis $useDeclaration) use ($sameNamespaces): bool { - $namespaceNameAndType = $this->getNamespaceNameWithSlash($useDeclaration).$useDeclaration->getType(); - - return \in_array($namespaceNameAndType, $sameNamespaces, true); - }); - - usort($sameNamespaceAnalysis, function (NamespaceUseAnalysis $a, NamespaceUseAnalysis $b): int { - $namespaceA = $this->getNamespaceNameWithSlash($a); - $namespaceB = $this->getNamespaceNameWithSlash($b); - - $namespaceDifference = \strlen($namespaceA) <=> \strlen($namespaceB); - - return 0 !== $namespaceDifference ? $namespaceDifference : $a->getFullName() <=> $b->getFullName(); - }); - - $sameNamespaceAnalysisByType = []; - foreach ($sameNamespaceAnalysis as $analysis) { - $sameNamespaceAnalysisByType[$analysis->getType()][] = $analysis; - } - - ksort($sameNamespaceAnalysisByType); - - return $sameNamespaceAnalysisByType; - } - - /** - * @param list $statements - */ - private function removeSingleUseStatements(array $statements, Tokens $tokens): void - { - foreach ($statements as $useDeclaration) { - $index = $useDeclaration->getStartIndex(); - $endIndex = $useDeclaration->getEndIndex(); - - $useStatementTokens = [T_USE, T_WHITESPACE, T_STRING, T_NS_SEPARATOR, T_AS, CT::T_CONST_IMPORT, CT::T_FUNCTION_IMPORT]; - - while ($index !== $endIndex) { - if ($tokens[$index]->isGivenKind($useStatementTokens)) { - $tokens->clearAt($index); - } - - ++$index; - } - - if (isset($tokens[$index]) && $tokens[$index]->equals(';')) { - $tokens->clearAt($index); - } - - ++$index; - - if (isset($tokens[$index]) && $tokens[$index]->isGivenKind(T_WHITESPACE)) { - $tokens->clearAt($index); - } - } - } - - /** - * @param list $statements - */ - private function addGroupUseStatements(array $statements, Tokens $tokens): void - { - $currentUseDeclaration = null; - $insertIndex = $statements[0]->getStartIndex(); - - // If group import was inserted in place of removed imports, it may have more tokens than before, - // and indices stored in imports of another type can be out-of-sync, and can point in the middle of group import. - // Let's move the pointer to the closest empty token (erased single import). - if (null !== $tokens[$insertIndex]->getId() || '' !== $tokens[$insertIndex]->getContent()) { - do { - ++$insertIndex; - } while (null !== $tokens[$insertIndex]->getId() || '' !== $tokens[$insertIndex]->getContent()); - } - - foreach ($statements as $index => $useDeclaration) { - if ($this->areDeclarationsDifferent($currentUseDeclaration, $useDeclaration)) { - $currentUseDeclaration = $useDeclaration; - $insertIndex += $this->createNewGroup( - $tokens, - $insertIndex, - $useDeclaration, - rtrim($this->getNamespaceNameWithSlash($currentUseDeclaration), '\\') - ); - } else { - $newTokens = [ - new Token(','), - new Token([T_WHITESPACE, ' ']), - ]; - - if ($useDeclaration->isAliased()) { - $tokens->insertAt($insertIndex, $newTokens); - $insertIndex += \count($newTokens); - $newTokens = []; - - $insertIndex += $this->insertToGroupUseWithAlias($tokens, $insertIndex, $useDeclaration); - } - - $newTokens[] = new Token([T_STRING, $useDeclaration->getShortName()]); - - if (!isset($statements[$index + 1]) || $this->areDeclarationsDifferent($currentUseDeclaration, $statements[$index + 1])) { - $newTokens[] = new Token([CT::T_GROUP_IMPORT_BRACE_CLOSE, '}']); - $newTokens[] = new Token(';'); - $newTokens[] = new Token([T_WHITESPACE, "\n"]); - } - - $tokens->insertAt($insertIndex, $newTokens); - $insertIndex += \count($newTokens); - } - } - } - - private function getNamespaceNameWithSlash(NamespaceUseAnalysis $useDeclaration): string - { - $position = strrpos($useDeclaration->getFullName(), '\\'); - if (false === $position || 0 === $position) { - return $useDeclaration->getFullName(); - } - - return substr($useDeclaration->getFullName(), 0, $position + 1); - } - - /** - * Insert use with alias to the group. - */ - private function insertToGroupUseWithAlias(Tokens $tokens, int $insertIndex, NamespaceUseAnalysis $useDeclaration): int - { - $newTokens = [ - new Token([T_STRING, substr($useDeclaration->getFullName(), strripos($useDeclaration->getFullName(), '\\') + 1)]), - new Token([T_WHITESPACE, ' ']), - new Token([T_AS, 'as']), - new Token([T_WHITESPACE, ' ']), - ]; - - $tokens->insertAt($insertIndex, $newTokens); - - return \count($newTokens); - } - - /** - * Creates new use statement group. - */ - private function createNewGroup(Tokens $tokens, int $insertIndex, NamespaceUseAnalysis $useDeclaration, string $currentNamespace): int - { - $insertedTokens = 0; - - $newTokens = [ - new Token([T_USE, 'use']), - new Token([T_WHITESPACE, ' ']), - ]; - - if ($useDeclaration->isFunction() || $useDeclaration->isConstant()) { - $importStatementParams = $useDeclaration->isFunction() - ? [CT::T_FUNCTION_IMPORT, 'function'] - : [CT::T_CONST_IMPORT, 'const']; - - $newTokens[] = new Token($importStatementParams); - $newTokens[] = new Token([T_WHITESPACE, ' ']); - } - - $namespaceParts = explode('\\', $currentNamespace); - - foreach ($namespaceParts as $part) { - $newTokens[] = new Token([T_STRING, $part]); - $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); - } - - $newTokens[] = new Token([CT::T_GROUP_IMPORT_BRACE_OPEN, '{']); - - $newTokensCount = \count($newTokens); - $tokens->insertAt($insertIndex, $newTokens); - $insertedTokens += $newTokensCount; - - $insertIndex += $newTokensCount; - - if ($useDeclaration->isAliased()) { - $inserted = $this->insertToGroupUseWithAlias($tokens, $insertIndex + 1, $useDeclaration) + 1; - $insertedTokens += $inserted; - $insertIndex += $inserted; - } - - $tokens->insertAt($insertIndex, new Token([T_STRING, $useDeclaration->getShortName()])); - - return ++$insertedTokens; - } - - /** - * Check if namespace use analyses are different. - */ - private function areDeclarationsDifferent(?NamespaceUseAnalysis $analysis1, ?NamespaceUseAnalysis $analysis2): bool - { - if (null === $analysis1 || null === $analysis2) { - return true; - } - - $namespaceName1 = $this->getNamespaceNameWithSlash($analysis1); - $namespaceName2 = $this->getNamespaceNameWithSlash($analysis2); - - return $namespaceName1 !== $namespaceName2 || $analysis1->getType() !== $analysis2->getType(); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoLeadingImportSlashFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoLeadingImportSlashFixer.php deleted file mode 100644 index b9120518..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoLeadingImportSlashFixer.php +++ /dev/null @@ -1,90 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Import; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Carlos Cirello - */ -final class NoLeadingImportSlashFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Remove leading slashes in `use` clauses.', - [new CodeSample("isTokenKindFound(T_USE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - $usesIndices = $tokensAnalyzer->getImportUseIndexes(); - - foreach ($usesIndices as $idx) { - $nextTokenIdx = $tokens->getNextMeaningfulToken($idx); - $nextToken = $tokens[$nextTokenIdx]; - - if ($nextToken->isGivenKind(T_NS_SEPARATOR)) { - $this->removeLeadingImportSlash($tokens, $nextTokenIdx); - } elseif ($nextToken->isGivenKind([CT::T_FUNCTION_IMPORT, CT::T_CONST_IMPORT])) { - $nextTokenIdx = $tokens->getNextMeaningfulToken($nextTokenIdx); - if ($tokens[$nextTokenIdx]->isGivenKind(T_NS_SEPARATOR)) { - $this->removeLeadingImportSlash($tokens, $nextTokenIdx); - } - } - } - } - - private function removeLeadingImportSlash(Tokens $tokens, int $index): void - { - $previousIndex = $tokens->getPrevNonWhitespace($index); - - if ( - $previousIndex < $index - 1 - || $tokens[$previousIndex]->isComment() - ) { - $tokens->clearAt($index); - - return; - } - - $tokens[$index] = new Token([T_WHITESPACE, ' ']); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnneededImportAliasFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnneededImportAliasFixer.php deleted file mode 100644 index 2d1532c9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnneededImportAliasFixer.php +++ /dev/null @@ -1,88 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Import; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoUnneededImportAliasFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Imports should not be aliased as the same name.', - [new CodeSample("isAllTokenKindsFound([T_USE, T_AS]); - } - - /** - * {@inheritdoc} - * - * Must run before NoSinglelineWhitespaceBeforeSemicolonsFixer. - */ - public function getPriority(): int - { - return 1; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 1; 0 <= $index; --$index) { - if (!$tokens[$index]->isGivenKind(T_AS)) { - continue; - } - - $aliasIndex = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$aliasIndex]->isGivenKind(T_STRING)) { - continue; - } - - $importIndex = $tokens->getPrevMeaningfulToken($index); - - if (!$tokens[$importIndex]->isGivenKind(T_STRING)) { - continue; - } - - if ($tokens[$importIndex]->getContent() !== $tokens[$aliasIndex]->getContent()) { - continue; - } - - do { - $importIndex = $tokens->getPrevMeaningfulToken($importIndex); - } while ($tokens[$importIndex]->isGivenKind([T_NS_SEPARATOR, T_STRING, T_AS]) || $tokens[$importIndex]->equals(',')); - - if ($tokens[$importIndex]->isGivenKind([CT::T_FUNCTION_IMPORT, CT::T_CONST_IMPORT])) { - $importIndex = $tokens->getPrevMeaningfulToken($importIndex); - } - - if (!$tokens[$importIndex]->isGivenKind([T_USE, CT::T_GROUP_IMPORT_BRACE_OPEN])) { - continue; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($aliasIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnusedImportsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnusedImportsFixer.php deleted file mode 100644 index 44642831..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/NoUnusedImportsFixer.php +++ /dev/null @@ -1,455 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Import; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\GotoLabelAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Dariusz Rumiński - */ -final class NoUnusedImportsFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Unused `use` statements must be removed.', - [new CodeSample("isTokenKindFound(T_USE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $useDeclarations = (new NamespaceUsesAnalyzer())->getDeclarationsFromTokens($tokens, true); - - if (0 === \count($useDeclarations)) { - return; - } - - foreach ($tokens->getNamespaceDeclarations() as $namespace) { - $currentNamespaceUseDeclarations = []; - $currentNamespaceUseDeclarationIndices = []; - - foreach ($useDeclarations as $useDeclaration) { - if ($useDeclaration->getStartIndex() >= $namespace->getScopeStartIndex() && $useDeclaration->getEndIndex() <= $namespace->getScopeEndIndex()) { - $currentNamespaceUseDeclarations[] = $useDeclaration; - $currentNamespaceUseDeclarationIndices[$useDeclaration->getStartIndex()] = $useDeclaration->getEndIndex(); - } - } - - foreach ($currentNamespaceUseDeclarations as $useDeclaration) { - if (!$this->isImportUsed($tokens, $namespace, $useDeclaration, $currentNamespaceUseDeclarationIndices)) { - $this->removeUseDeclaration($tokens, $useDeclaration); - } - } - - $this->removeUsesInSameNamespace($tokens, $currentNamespaceUseDeclarations, $namespace); - } - } - - /** - * @param array $ignoredIndices indices of the use statements themselves that should not be checked as being "used" - */ - private function isImportUsed(Tokens $tokens, NamespaceAnalysis $namespace, NamespaceUseAnalysis $import, array $ignoredIndices): bool - { - $analyzer = new TokensAnalyzer($tokens); - $gotoLabelAnalyzer = new GotoLabelAnalyzer(); - - $tokensNotBeforeFunctionCall = [T_NEW]; - - $attributeIsDefined = \defined('T_ATTRIBUTE'); - - if ($attributeIsDefined) { // @TODO: drop condition when PHP 8.0+ is required - $tokensNotBeforeFunctionCall[] = T_ATTRIBUTE; - } - - $namespaceEndIndex = $namespace->getScopeEndIndex(); - $inAttribute = false; - - for ($index = $namespace->getScopeStartIndex(); $index <= $namespaceEndIndex; ++$index) { - $token = $tokens[$index]; - - if ($attributeIsDefined && $token->isGivenKind(T_ATTRIBUTE)) { - $inAttribute = true; - - continue; - } - - if ($attributeIsDefined && $token->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - $inAttribute = false; - - continue; - } - - if (isset($ignoredIndices[$index])) { - $index = $ignoredIndices[$index]; - - continue; - } - - if ($token->isGivenKind(T_STRING)) { - if (0 !== strcasecmp($import->getShortName(), $token->getContent())) { - continue; - } - - $prevMeaningfulToken = $tokens[$tokens->getPrevMeaningfulToken($index)]; - - if ($prevMeaningfulToken->isGivenKind(T_NAMESPACE)) { - $index = $tokens->getNextTokenOfKind($index, [';', '{', [T_CLOSE_TAG]]); - - continue; - } - - if ( - $prevMeaningfulToken->isGivenKind([T_NS_SEPARATOR, T_FUNCTION, T_CONST, T_DOUBLE_COLON]) - || $prevMeaningfulToken->isObjectOperator() - ) { - continue; - } - - if ($inAttribute) { - return true; - } - - $nextMeaningfulIndex = $tokens->getNextMeaningfulToken($index); - - if ($gotoLabelAnalyzer->belongsToGoToLabel($tokens, $nextMeaningfulIndex)) { - continue; - } - - $nextMeaningfulToken = $tokens[$nextMeaningfulIndex]; - - if ($analyzer->isConstantInvocation($index)) { - $type = NamespaceUseAnalysis::TYPE_CONSTANT; - } elseif ($nextMeaningfulToken->equals('(') && !$prevMeaningfulToken->isGivenKind($tokensNotBeforeFunctionCall)) { - $type = NamespaceUseAnalysis::TYPE_FUNCTION; - } else { - $type = NamespaceUseAnalysis::TYPE_CLASS; - } - - if ($import->getType() === $type) { - return true; - } - - continue; - } - - if ($token->isComment() - && Preg::match( - '/(?getShortName().'(?![[:alnum:]])/i', - $token->getContent() - ) - ) { - return true; - } - } - - return false; - } - - private function removeUseDeclaration( - Tokens $tokens, - NamespaceUseAnalysis $useDeclaration, - bool $forceCompleteRemoval = false - ): void { - [$start, $end] = ($useDeclaration->isInMulti() && !$forceCompleteRemoval) - ? [$useDeclaration->getChunkStartIndex(), $useDeclaration->getChunkEndIndex()] - : [$useDeclaration->getStartIndex(), $useDeclaration->getEndIndex()]; - $loopStartIndex = $useDeclaration->isInMulti() || $forceCompleteRemoval ? $end : $end - 1; - - for ($index = $loopStartIndex; $index >= $start; --$index) { - if ($tokens[$index]->isComment()) { - continue; - } - - if (!$tokens[$index]->isWhitespace() || !str_contains($tokens[$index]->getContent(), "\n")) { - $tokens->clearAt($index); - - continue; - } - - // when multi line white space keep the line feed if the previous token is a comment - $prevIndex = $tokens->getPrevNonWhitespace($index); - - if ($tokens[$prevIndex]->isComment()) { - $content = $tokens[$index]->getContent(); - $tokens[$index] = new Token([T_WHITESPACE, substr($content, strrpos($content, "\n"))]); // preserve indent only - } else { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - } - - // For multi-use import statements the tokens containing FQN were already removed in the loop above. - // We need to clean up tokens around the ex-chunk to keep the correct syntax and achieve proper formatting. - if (!$forceCompleteRemoval && $useDeclaration->isInMulti()) { - $this->cleanUpAfterImportChunkRemoval($tokens, $useDeclaration); - - return; - } - - if ($tokens[$useDeclaration->getEndIndex()]->equals(';')) { // do not remove `? >` - $tokens->clearAt($useDeclaration->getEndIndex()); - } - - $this->cleanUpSurroundingNewLines($tokens, $useDeclaration); - } - - /** - * @param list $useDeclarations - */ - private function removeUsesInSameNamespace(Tokens $tokens, array $useDeclarations, NamespaceAnalysis $namespaceDeclaration): void - { - $namespace = $namespaceDeclaration->getFullName(); - $nsLength = \strlen($namespace.'\\'); - - foreach ($useDeclarations as $useDeclaration) { - if ($useDeclaration->isAliased()) { - continue; - } - - $useDeclarationFullName = ltrim($useDeclaration->getFullName(), '\\'); - - if (!str_starts_with($useDeclarationFullName, $namespace.'\\')) { - continue; - } - - $partName = substr($useDeclarationFullName, $nsLength); - - if (!str_contains($partName, '\\')) { - $this->removeUseDeclaration($tokens, $useDeclaration); - } - } - } - - private function cleanUpAfterImportChunkRemoval(Tokens $tokens, NamespaceUseAnalysis $useDeclaration): void - { - $beforeChunkIndex = $tokens->getPrevMeaningfulToken($useDeclaration->getChunkStartIndex()); - $afterChunkIndex = $tokens->getNextMeaningfulToken($useDeclaration->getChunkEndIndex()); - $hasNonEmptyTokenBefore = $this->scanForNonEmptyTokensUntilNewLineFound( - $tokens, - $afterChunkIndex, - -1 - ); - $hasNonEmptyTokenAfter = $this->scanForNonEmptyTokensUntilNewLineFound( - $tokens, - $afterChunkIndex, - 1 - ); - - // We don't want to merge consequent new lines with indentation (leading to e.g. `\n \n `), - // so it's safe to merge whitespace only if there is any non-empty token before or after the chunk. - $mergingSurroundingWhitespaceIsSafe = $hasNonEmptyTokenBefore[1] || $hasNonEmptyTokenAfter[1]; - $clearToken = static function (int $index) use ($tokens, $mergingSurroundingWhitespaceIsSafe): void { - if ($mergingSurroundingWhitespaceIsSafe) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } else { - $tokens->clearAt($index); - } - }; - - if ($tokens[$afterChunkIndex]->equals(',')) { - $clearToken($afterChunkIndex); - } elseif ($tokens[$beforeChunkIndex]->equals(',')) { - $clearToken($beforeChunkIndex); - } - - // Ensure there's a single space where applicable, otherwise no space (before comma, before closing brace) - for ($index = $beforeChunkIndex; $index <= $afterChunkIndex; ++$index) { - if (null === $tokens[$index]->getId() || !$tokens[$index]->isWhitespace(' ')) { - continue; - } - - $nextTokenIndex = $tokens->getNextMeaningfulToken($index); - if ( - $tokens[$nextTokenIndex]->equals(',') - || $tokens[$nextTokenIndex]->equals(';') - || $tokens[$nextTokenIndex]->isGivenKind([CT::T_GROUP_IMPORT_BRACE_CLOSE]) - ) { - $tokens->clearAt($index); - } else { - $tokens[$index] = new Token([T_WHITESPACE, ' ']); - } - - $prevTokenIndex = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$prevTokenIndex]->isGivenKind([CT::T_GROUP_IMPORT_BRACE_OPEN])) { - $tokens->clearAt($index); - } - } - - $this->removeLineIfEmpty($tokens, $useDeclaration); - $this->removeImportStatementIfEmpty($tokens, $useDeclaration); - } - - private function cleanUpSurroundingNewLines(Tokens $tokens, NamespaceUseAnalysis $useDeclaration): void - { - $prevIndex = $useDeclaration->getStartIndex() - 1; - $prevToken = $tokens[$prevIndex]; - - if ($prevToken->isWhitespace()) { - $content = rtrim($prevToken->getContent(), " \t"); - - $tokens->ensureWhitespaceAtIndex($prevIndex, 0, $content); - - $prevToken = $tokens[$prevIndex]; - } - - if (!isset($tokens[$useDeclaration->getEndIndex() + 1])) { - return; - } - - $nextIndex = $tokens->getNonEmptySibling($useDeclaration->getEndIndex(), 1); - - if (null === $nextIndex) { - return; - } - - $nextToken = $tokens[$nextIndex]; - - if ($nextToken->isWhitespace()) { - $content = Preg::replace( - "#^\r\n|^\n#", - '', - ltrim($nextToken->getContent(), " \t"), - 1 - ); - - $tokens->ensureWhitespaceAtIndex($nextIndex, 0, $content); - - $nextToken = $tokens[$nextIndex]; - } - - if ($prevToken->isWhitespace() && $nextToken->isWhitespace()) { - $content = $prevToken->getContent().$nextToken->getContent(); - - $tokens->ensureWhitespaceAtIndex($nextIndex, 0, $content); - - $tokens->clearAt($prevIndex); - } - } - - private function removeImportStatementIfEmpty(Tokens $tokens, NamespaceUseAnalysis $useDeclaration): void - { - // First we look for empty groups where all chunks were removed (`use Foo\{};`). - // We're only interested in ending brace if its index is between start and end of the import statement. - $endingBraceIndex = $tokens->getPrevTokenOfKind( - $useDeclaration->getEndIndex(), - [[CT::T_GROUP_IMPORT_BRACE_CLOSE]] - ); - - if ($endingBraceIndex > $useDeclaration->getStartIndex()) { - $openingBraceIndex = $tokens->getPrevMeaningfulToken($endingBraceIndex); - - if ($tokens[$openingBraceIndex]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_OPEN)) { - $this->removeUseDeclaration($tokens, $useDeclaration, true); - } - } - - // Second we look for empty groups where all comma-separated chunks were removed (`use;`). - $beforeSemicolonIndex = $tokens->getPrevMeaningfulToken($useDeclaration->getEndIndex()); - if ( - $tokens[$beforeSemicolonIndex]->isGivenKind([T_USE]) - || \in_array($tokens[$beforeSemicolonIndex]->getContent(), ['function', 'const'], true) - ) { - $this->removeUseDeclaration($tokens, $useDeclaration, true); - } - } - - private function removeLineIfEmpty(Tokens $tokens, NamespaceUseAnalysis $useAnalysis): void - { - if (!$useAnalysis->isInMulti()) { - return; - } - - $hasNonEmptyTokenBefore = $this->scanForNonEmptyTokensUntilNewLineFound( - $tokens, - $useAnalysis->getChunkStartIndex(), - -1 - ); - $hasNonEmptyTokenAfter = $this->scanForNonEmptyTokensUntilNewLineFound( - $tokens, - $useAnalysis->getChunkEndIndex(), - 1 - ); - - if ( - \is_int($hasNonEmptyTokenBefore[0]) - && !$hasNonEmptyTokenBefore[1] - && \is_int($hasNonEmptyTokenAfter[0]) - && !$hasNonEmptyTokenAfter[1] - ) { - $tokens->clearRange($hasNonEmptyTokenBefore[0], $hasNonEmptyTokenAfter[0] - 1); - } - } - - /** - * Returns tuple with the index of first token with whitespace containing new line char - * and a flag if any non-empty token was found along the way. - * - * @param -1|1 $direction - * - * @return array{0: null|int, 1: bool} - */ - private function scanForNonEmptyTokensUntilNewLineFound(Tokens $tokens, int $index, int $direction): array - { - $hasNonEmptyToken = false; - $newLineTokenIndex = null; - - // Iterate until we find new line OR we get out of $tokens bounds (next sibling index is `null`). - while (\is_int($index)) { - $index = $tokens->getNonEmptySibling($index, $direction); - - if (null === $index || null === $tokens[$index]->getId()) { - continue; - } - - if (!$tokens[$index]->isWhitespace()) { - $hasNonEmptyToken = true; - } elseif (str_starts_with($tokens[$index]->getContent(), "\n")) { - $newLineTokenIndex = $index; - - break; - } - } - - return [$newLineTokenIndex, $hasNonEmptyToken]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/OrderedImportsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/OrderedImportsFixer.php deleted file mode 100644 index eea91b49..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/OrderedImportsFixer.php +++ /dev/null @@ -1,600 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Import; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; -use PhpCsFixer\Utils; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * @author Sebastiaan Stok - * @author Dariusz Rumiński - * @author Darius Matulionis - * @author Adriano Pilger - * - * @phpstan-type _UseImportInfo array{ - * namespace: non-empty-string, - * startIndex: int, - * endIndex: int, - * importType: self::IMPORT_TYPE_*, - * group: bool, - * } - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * case_sensitive?: bool, - * imports_order?: list|null, - * sort_algorithm?: 'alpha'|'length'|'none' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * case_sensitive: bool, - * imports_order: list|null, - * sort_algorithm: 'alpha'|'length'|'none' - * } - */ -final class OrderedImportsFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const IMPORT_TYPE_CLASS = 'class'; - - /** - * @internal - */ - public const IMPORT_TYPE_CONST = 'const'; - - /** - * @internal - */ - public const IMPORT_TYPE_FUNCTION = 'function'; - - /** - * @internal - */ - public const SORT_ALPHA = 'alpha'; - - /** - * @internal - */ - public const SORT_LENGTH = 'length'; - - /** - * @internal - */ - public const SORT_NONE = 'none'; - - /** - * Array of supported sort types in configuration. - * - * @var list - */ - private const SUPPORTED_SORT_TYPES = [self::IMPORT_TYPE_CLASS, self::IMPORT_TYPE_CONST, self::IMPORT_TYPE_FUNCTION]; - - /** - * Array of supported sort algorithms in configuration. - * - * @var list - */ - private const SUPPORTED_SORT_ALGORITHMS = [self::SORT_ALPHA, self::SORT_LENGTH, self::SORT_NONE]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Ordering `use` statements.', - [ - new CodeSample( - " true] - ), - new CodeSample( - ' self::SORT_LENGTH] - ), - new CodeSample( - ' self::SORT_LENGTH, - 'imports_order' => [ - self::IMPORT_TYPE_CONST, - self::IMPORT_TYPE_CLASS, - self::IMPORT_TYPE_FUNCTION, - ], - ] - ), - new CodeSample( - ' self::SORT_ALPHA, - 'imports_order' => [ - self::IMPORT_TYPE_CONST, - self::IMPORT_TYPE_CLASS, - self::IMPORT_TYPE_FUNCTION, - ], - ] - ), - new CodeSample( - ' self::SORT_NONE, - 'imports_order' => [ - self::IMPORT_TYPE_CONST, - self::IMPORT_TYPE_CLASS, - self::IMPORT_TYPE_FUNCTION, - ], - ] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before BlankLineBetweenImportGroupsFixer. - * Must run after FullyQualifiedStrictTypesFixer, GlobalNamespaceImportFixer, NoLeadingImportSlashFixer. - */ - public function getPriority(): int - { - return -30; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_USE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - $namespacesImports = $tokensAnalyzer->getImportUseIndexes(true); - - foreach (array_reverse($namespacesImports) as $usesPerNamespaceIndices) { - $count = \count($usesPerNamespaceIndices); - - if (0 === $count) { - continue; // nothing to sort - } - - if (1 === $count) { - $this->setNewOrder($tokens, $this->getNewOrder($usesPerNamespaceIndices, $tokens)); - - continue; - } - - $groupUsesOffset = 0; - $groupUses = [$groupUsesOffset => [$usesPerNamespaceIndices[0]]]; - - // if there's some logic between two `use` statements, sort only imports grouped before that logic - for ($index = 0; $index < $count - 1; ++$index) { - $nextGroupUse = $tokens->getNextTokenOfKind($usesPerNamespaceIndices[$index], [';', [T_CLOSE_TAG]]); - - if ($tokens[$nextGroupUse]->isGivenKind(T_CLOSE_TAG)) { - $nextGroupUse = $tokens->getNextTokenOfKind($usesPerNamespaceIndices[$index], [[T_OPEN_TAG]]); - } - - $nextGroupUse = $tokens->getNextMeaningfulToken($nextGroupUse); - - if ($nextGroupUse !== $usesPerNamespaceIndices[$index + 1]) { - $groupUses[++$groupUsesOffset] = []; - } - - $groupUses[$groupUsesOffset][] = $usesPerNamespaceIndices[$index + 1]; - } - - for ($index = $groupUsesOffset; $index >= 0; --$index) { - $this->setNewOrder($tokens, $this->getNewOrder($groupUses[$index], $tokens)); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $supportedSortTypes = self::SUPPORTED_SORT_TYPES; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('sort_algorithm', 'Whether the statements should be sorted alphabetically or by length, or not sorted.')) - ->setAllowedValues(self::SUPPORTED_SORT_ALGORITHMS) - ->setDefault(self::SORT_ALPHA) - ->getOption(), - (new FixerOptionBuilder('imports_order', 'Defines the order of import types.')) - ->setAllowedTypes(['string[]', 'null']) - ->setAllowedValues([static function (?array $value) use ($supportedSortTypes): bool { - if (null !== $value) { - $missing = array_diff($supportedSortTypes, $value); - if (\count($missing) > 0) { - throw new InvalidOptionsException(\sprintf( - 'Missing sort %s %s.', - 1 === \count($missing) ? 'type' : 'types', - Utils::naturalLanguageJoin($missing) - )); - } - - $unknown = array_diff($value, $supportedSortTypes); - if (\count($unknown) > 0) { - throw new InvalidOptionsException(\sprintf( - 'Unknown sort %s %s.', - 1 === \count($unknown) ? 'type' : 'types', - Utils::naturalLanguageJoin($unknown) - )); - } - } - - return true; - }]) - ->setDefault(null) // @TODO set to ['class', 'function', 'const'] on 4.0 - ->getOption(), - (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - /** - * This method is used for sorting the uses in a namespace. - * - * @param _UseImportInfo $first - * @param _UseImportInfo $second - */ - private function sortAlphabetically(array $first, array $second): int - { - // Replace backslashes by spaces before sorting for correct sort order - $firstNamespace = str_replace('\\', ' ', $this->prepareNamespace($first['namespace'])); - $secondNamespace = str_replace('\\', ' ', $this->prepareNamespace($second['namespace'])); - - return true === $this->configuration['case_sensitive'] - ? $firstNamespace <=> $secondNamespace - : strcasecmp($firstNamespace, $secondNamespace); - } - - /** - * This method is used for sorting the uses statements in a namespace by length. - * - * @param _UseImportInfo $first - * @param _UseImportInfo $second - */ - private function sortByLength(array $first, array $second): int - { - $firstNamespace = (self::IMPORT_TYPE_CLASS === $first['importType'] ? '' : $first['importType'].' ').$this->prepareNamespace($first['namespace']); - $secondNamespace = (self::IMPORT_TYPE_CLASS === $second['importType'] ? '' : $second['importType'].' ').$this->prepareNamespace($second['namespace']); - - $firstNamespaceLength = \strlen($firstNamespace); - $secondNamespaceLength = \strlen($secondNamespace); - - if ($firstNamespaceLength === $secondNamespaceLength) { - $sortResult = true === $this->configuration['case_sensitive'] - ? $firstNamespace <=> $secondNamespace - : strcasecmp($firstNamespace, $secondNamespace); - } else { - $sortResult = $firstNamespaceLength > $secondNamespaceLength ? 1 : -1; - } - - return $sortResult; - } - - private function prepareNamespace(string $namespace): string - { - return trim(Preg::replace('%/\*(.*)\*/%s', '', $namespace)); - } - - /** - * @param list $uses - * - * @return array - */ - private function getNewOrder(array $uses, Tokens $tokens): array - { - $indices = []; - $originalIndices = []; - $lineEnding = $this->whitespacesConfig->getLineEnding(); - $usesCount = \count($uses); - - for ($i = 0; $i < $usesCount; ++$i) { - $index = $uses[$i]; - - $startIndex = $tokens->getTokenNotOfKindsSibling($index + 1, 1, [T_WHITESPACE]); - $endIndex = $tokens->getNextTokenOfKind($startIndex, [';', [T_CLOSE_TAG]]); - $previous = $tokens->getPrevMeaningfulToken($endIndex); - - $group = $tokens[$previous]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_CLOSE); - if ($tokens[$startIndex]->isGivenKind(CT::T_CONST_IMPORT)) { - $type = self::IMPORT_TYPE_CONST; - $index = $tokens->getNextNonWhitespace($startIndex); - } elseif ($tokens[$startIndex]->isGivenKind(CT::T_FUNCTION_IMPORT)) { - $type = self::IMPORT_TYPE_FUNCTION; - $index = $tokens->getNextNonWhitespace($startIndex); - } else { - $type = self::IMPORT_TYPE_CLASS; - $index = $startIndex; - } - - $namespaceTokens = []; - - while ($index <= $endIndex) { - $token = $tokens[$index]; - - if ($index === $endIndex || (!$group && $token->equals(','))) { - if ($group && self::SORT_NONE !== $this->configuration['sort_algorithm']) { - // if group import, sort the items within the group definition - - // figure out where the list of namespace parts within the group def. starts - $namespaceTokensCount = \count($namespaceTokens) - 1; - $namespace = ''; - for ($k = 0; $k < $namespaceTokensCount; ++$k) { - if ($namespaceTokens[$k]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_OPEN)) { - $namespace .= '{'; - - break; - } - - $namespace .= $namespaceTokens[$k]->getContent(); - } - - // fetch all parts, split up in an array of strings, move comments to the end - $parts = []; - $firstIndent = ''; - $separator = ', '; - $lastIndent = ''; - $hasGroupTrailingComma = false; - - for ($k1 = $k + 1; $k1 < $namespaceTokensCount; ++$k1) { - $comment = ''; - $namespacePart = ''; - for ($k2 = $k1;; ++$k2) { - if ($namespaceTokens[$k2]->equalsAny([',', [CT::T_GROUP_IMPORT_BRACE_CLOSE]])) { - break; - } - - if ($namespaceTokens[$k2]->isComment()) { - $comment .= $namespaceTokens[$k2]->getContent(); - - continue; - } - - // if there is any line ending inside the group import, it should be indented properly - if ( - '' === $firstIndent - && $namespaceTokens[$k2]->isWhitespace() - && str_contains($namespaceTokens[$k2]->getContent(), $lineEnding) - ) { - $lastIndent = $lineEnding; - $firstIndent = $lineEnding.$this->whitespacesConfig->getIndent(); - $separator = ','.$firstIndent; - } - - $namespacePart .= $namespaceTokens[$k2]->getContent(); - } - - $namespacePart = trim($namespacePart); - if ('' === $namespacePart) { - $hasGroupTrailingComma = true; - - continue; - } - - $comment = trim($comment); - if ('' !== $comment) { - $namespacePart .= ' '.$comment; - } - - $parts[] = $namespacePart; - - $k1 = $k2; - } - - $sortedParts = $parts; - sort($parts); - - // check if the order needs to be updated, otherwise don't touch as we might change valid CS (to other valid CS). - if ($sortedParts === $parts) { - $namespace = Tokens::fromArray($namespaceTokens)->generateCode(); - } else { - $namespace .= $firstIndent.implode($separator, $parts).($hasGroupTrailingComma ? ',' : '').$lastIndent.'}'; - } - } else { - $namespace = Tokens::fromArray($namespaceTokens)->generateCode(); - } - - $indices[$startIndex] = [ - 'namespace' => $namespace, - 'startIndex' => $startIndex, - 'endIndex' => $index - 1, - 'importType' => $type, - 'group' => $group, - ]; - - $originalIndices[] = $startIndex; - - if ($index === $endIndex) { - break; - } - - $namespaceTokens = []; - $nextPartIndex = $tokens->getTokenNotOfKindSibling($index, 1, [',', [T_WHITESPACE]]); - $startIndex = $nextPartIndex; - $index = $nextPartIndex; - - continue; - } - - $namespaceTokens[] = $token; - ++$index; - } - } - - // Is sort types provided, sorting by groups and each group by algorithm - if (null !== $this->configuration['imports_order']) { - // Grouping indices by import type. - $groupedByTypes = []; - - foreach ($indices as $startIndex => $item) { - $groupedByTypes[$item['importType']][$startIndex] = $item; - } - - // Sorting each group by algorithm. - foreach ($groupedByTypes as $type => $groupIndices) { - $groupedByTypes[$type] = $this->sortByAlgorithm($groupIndices); - } - - // Ordering groups - $sortedGroups = []; - - foreach ($this->configuration['imports_order'] as $type) { - if (isset($groupedByTypes[$type]) && [] !== $groupedByTypes[$type]) { - foreach ($groupedByTypes[$type] as $startIndex => $item) { - $sortedGroups[$startIndex] = $item; - } - } - } - - $indices = $sortedGroups; - } else { - // Sorting only by algorithm - $indices = $this->sortByAlgorithm($indices); - } - - $index = -1; - $usesOrder = []; - - // Loop through the index but use original index order - foreach ($indices as $v) { - $usesOrder[$originalIndices[++$index]] = $v; - } - - return $usesOrder; - } - - /** - * @param array $indices - * - * @return array - */ - private function sortByAlgorithm(array $indices): array - { - if (self::SORT_ALPHA === $this->configuration['sort_algorithm']) { - uasort($indices, [$this, 'sortAlphabetically']); - } elseif (self::SORT_LENGTH === $this->configuration['sort_algorithm']) { - uasort($indices, [$this, 'sortByLength']); - } - - return $indices; - } - - /** - * @param array $usesOrder - */ - private function setNewOrder(Tokens $tokens, array $usesOrder): void - { - $mapStartToEnd = []; - - foreach ($usesOrder as $use) { - $mapStartToEnd[$use['startIndex']] = $use['endIndex']; - } - - // Now insert the new tokens, starting from the end - foreach (array_reverse($usesOrder, true) as $index => $use) { - $code = \sprintf( - 'getPrevMeaningfulToken($index); - if ($tokens[$prevIndex]->equals(',')) { - $numberOfInitialTokensToClear = 5; // clear `clearRange(0, $numberOfInitialTokensToClear - 1); - $declarationTokens->clearAt(\count($declarationTokens) - 1); // clear `;` - $declarationTokens->clearEmptyTokens(); - - $tokens->overrideRange($index, $mapStartToEnd[$index], $declarationTokens); - - if ($use['group']) { - // a group import must start with `use` and cannot be part of comma separated import list - $prev = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$prev]->equals(',')) { - $tokens[$prev] = new Token(';'); - $tokens->insertAt($prev + 1, new Token([T_USE, 'use'])); - - if (!$tokens[$prev + 2]->isWhitespace()) { - $tokens->insertAt($prev + 2, new Token([T_WHITESPACE, ' '])); - } - } - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php deleted file mode 100644 index cf368a8b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php +++ /dev/null @@ -1,274 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Import; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * Fixer for rules defined in PSR2 ¶3. - * - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * group_to_single_imports?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * group_to_single_imports: bool - * } - */ -final class SingleImportPerStatementFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There MUST be one use keyword per declaration.', - [ - new CodeSample( - ' true] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before MultilineWhitespaceBeforeSemicolonsFixer, NoLeadingImportSlashFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, SpaceAfterSemicolonFixer. - */ - public function getPriority(): int - { - return 1; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_USE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - foreach (array_reverse($tokensAnalyzer->getImportUseIndexes()) as $index) { - $endIndex = $tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]); - $groupClose = $tokens->getPrevMeaningfulToken($endIndex); - - if ($tokens[$groupClose]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_CLOSE)) { - if (true === $this->configuration['group_to_single_imports']) { - $this->fixGroupUse($tokens, $index, $endIndex); - } - } else { - $this->fixMultipleUse($tokens, $index, $endIndex); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('group_to_single_imports', 'Whether to change group imports into single imports.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - /** - * @return array{string, ?int, int, string} - */ - private function getGroupDeclaration(Tokens $tokens, int $index): array - { - $groupPrefix = ''; - $comment = ''; - $groupOpenIndex = null; - - for ($i = $index + 1;; ++$i) { - if ($tokens[$i]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_OPEN)) { - $groupOpenIndex = $i; - - break; - } - - if ($tokens[$i]->isComment()) { - $comment .= $tokens[$i]->getContent(); - if (!$tokens[$i - 1]->isWhitespace() && !$tokens[$i + 1]->isWhitespace()) { - $groupPrefix .= ' '; - } - - continue; - } - - if ($tokens[$i]->isWhitespace()) { - $groupPrefix .= ' '; - - continue; - } - - $groupPrefix .= $tokens[$i]->getContent(); - } - - return [ - rtrim($groupPrefix), - $groupOpenIndex, - $tokens->findBlockEnd(Tokens::BLOCK_TYPE_GROUP_IMPORT_BRACE, $groupOpenIndex), - $comment, - ]; - } - - /** - * @return list - */ - private function getGroupStatements(Tokens $tokens, string $groupPrefix, int $groupOpenIndex, int $groupCloseIndex, string $comment): array - { - $statements = []; - $statement = $groupPrefix; - - for ($i = $groupOpenIndex + 1; $i <= $groupCloseIndex; ++$i) { - $token = $tokens[$i]; - - if ($token->equals(',') && $tokens[$tokens->getNextMeaningfulToken($i)]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_CLOSE)) { - continue; - } - - if ($token->equalsAny([',', [CT::T_GROUP_IMPORT_BRACE_CLOSE]])) { - $statements[] = 'use'.$statement.';'; - $statement = $groupPrefix; - - continue; - } - - if ($token->isWhitespace()) { - $j = $tokens->getNextMeaningfulToken($i); - - if ($tokens[$j]->isGivenKind(T_AS)) { - $statement .= ' as '; - $i += 2; - } elseif ($tokens[$j]->isGivenKind(CT::T_FUNCTION_IMPORT)) { - $statement = ' function'.$statement; - $i += 2; - } elseif ($tokens[$j]->isGivenKind(CT::T_CONST_IMPORT)) { - $statement = ' const'.$statement; - $i += 2; - } - - if ($token->isWhitespace(" \t") || !str_starts_with($tokens[$i - 1]->getContent(), '//')) { - continue; - } - } - - $statement .= $token->getContent(); - } - - if ('' !== $comment) { - $statements[0] .= ' '.$comment; - } - - return $statements; - } - - private function fixGroupUse(Tokens $tokens, int $index, int $endIndex): void - { - [$groupPrefix, $groupOpenIndex, $groupCloseIndex, $comment] = $this->getGroupDeclaration($tokens, $index); - $statements = $this->getGroupStatements($tokens, $groupPrefix, $groupOpenIndex, $groupCloseIndex, $comment); - - $tokens->clearRange($index, $groupCloseIndex); - if ($tokens[$endIndex]->equals(';')) { - $tokens->clearAt($endIndex); - } - - $ending = $this->whitespacesConfig->getLineEnding(); - $importTokens = Tokens::fromCode('clearAt(0); - $importTokens->clearEmptyTokens(); - - $tokens->insertAt($index, $importTokens); - } - - private function fixMultipleUse(Tokens $tokens, int $index, int $endIndex): void - { - $nextTokenIndex = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$nextTokenIndex]->isGivenKind(CT::T_FUNCTION_IMPORT)) { - $leadingTokens = [ - new Token([CT::T_FUNCTION_IMPORT, 'function']), - new Token([T_WHITESPACE, ' ']), - ]; - } elseif ($tokens[$nextTokenIndex]->isGivenKind(CT::T_CONST_IMPORT)) { - $leadingTokens = [ - new Token([CT::T_CONST_IMPORT, 'const']), - new Token([T_WHITESPACE, ' ']), - ]; - } else { - $leadingTokens = []; - } - - $ending = $this->whitespacesConfig->getLineEnding(); - - for ($i = $endIndex - 1; $i > $index; --$i) { - if (!$tokens[$i]->equals(',')) { - continue; - } - - $tokens[$i] = new Token(';'); - $i = $tokens->getNextMeaningfulToken($i); - - $tokens->insertAt($i, new Token([T_USE, 'use'])); - $tokens->insertAt($i + 1, new Token([T_WHITESPACE, ' '])); - - foreach ($leadingTokens as $offset => $leadingToken) { - $tokens->insertAt($i + 2 + $offset, clone $leadingTokens[$offset]); - } - - $indent = WhitespacesAnalyzer::detectIndent($tokens, $index); - - if ($tokens[$i - 1]->isWhitespace()) { - $tokens[$i - 1] = new Token([T_WHITESPACE, $ending.$indent]); - } elseif (!str_contains($tokens[$i - 1]->getContent(), "\n")) { - $tokens->insertAt($i, new Token([T_WHITESPACE, $ending.$indent])); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php deleted file mode 100644 index b8b97797..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php +++ /dev/null @@ -1,152 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Import; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; -use PhpCsFixer\Utils; - -/** - * Fixer for rules defined in PSR2 ¶3. - * - * @author Ceeram - * @author Graham Campbell - */ -final class SingleLineAfterImportsFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_USE); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Each namespace use MUST go on its own line and there MUST be one blank line after the use statements block.', - [ - new CodeSample( - 'whitespacesConfig->getLineEnding(); - $tokensAnalyzer = new TokensAnalyzer($tokens); - - $added = 0; - foreach ($tokensAnalyzer->getImportUseIndexes() as $index) { - $index += $added; - $indent = ''; - - // if previous line ends with comment and current line starts with whitespace, use current indent - if ($tokens[$index - 1]->isWhitespace(" \t") && $tokens[$index - 2]->isGivenKind(T_COMMENT)) { - $indent = $tokens[$index - 1]->getContent(); - } elseif ($tokens[$index - 1]->isWhitespace()) { - $indent = Utils::calculateTrailingWhitespaceIndent($tokens[$index - 1]); - } - - $semicolonIndex = $tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]); // Handle insert index for inline T_COMMENT with whitespace after semicolon - $insertIndex = $semicolonIndex; - - if ($tokens[$semicolonIndex]->isGivenKind(T_CLOSE_TAG)) { - if ($tokens[$insertIndex - 1]->isWhitespace()) { - --$insertIndex; - } - - $tokens->insertAt($insertIndex, new Token(';')); - ++$added; - } - - if ($semicolonIndex === \count($tokens) - 1) { - $tokens->insertAt($insertIndex + 1, new Token([T_WHITESPACE, $ending.$ending.$indent])); - ++$added; - } else { - $newline = $ending; - $tokens[$semicolonIndex]->isGivenKind(T_CLOSE_TAG) ? --$insertIndex : ++$insertIndex; - if ($tokens[$insertIndex]->isWhitespace(" \t") && $tokens[$insertIndex + 1]->isComment()) { - ++$insertIndex; - } - - // Increment insert index for inline T_COMMENT or T_DOC_COMMENT - if ($tokens[$insertIndex]->isComment()) { - ++$insertIndex; - } - - $afterSemicolon = $tokens->getNextMeaningfulToken($semicolonIndex); - if (null === $afterSemicolon || !$tokens[$afterSemicolon]->isGivenKind(T_USE)) { - $newline .= $ending; - } - - if ($tokens[$insertIndex]->isWhitespace()) { - $nextToken = $tokens[$insertIndex]; - if (2 === substr_count($nextToken->getContent(), "\n")) { - continue; - } - $nextMeaningfulAfterUseIndex = $tokens->getNextMeaningfulToken($insertIndex); - if (null !== $nextMeaningfulAfterUseIndex && $tokens[$nextMeaningfulAfterUseIndex]->isGivenKind(T_USE)) { - if (substr_count($nextToken->getContent(), "\n") < 1) { - $tokens[$insertIndex] = new Token([T_WHITESPACE, $newline.$indent.ltrim($nextToken->getContent())]); - } - } else { - $tokens[$insertIndex] = new Token([T_WHITESPACE, $newline.$indent.ltrim($nextToken->getContent())]); - } - } else { - $tokens->insertAt($insertIndex, new Token([T_WHITESPACE, $newline.$indent])); - ++$added; - } - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php deleted file mode 100644 index 0e370f20..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php +++ /dev/null @@ -1,92 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer; - -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -trait Indentation -{ - private function getLineIndentation(Tokens $tokens, int $index): string - { - $newlineTokenIndex = $this->getPreviousNewlineTokenIndex($tokens, $index); - - if (null === $newlineTokenIndex) { - return ''; - } - - return $this->extractIndent($this->computeNewLineContent($tokens, $newlineTokenIndex)); - } - - private function extractIndent(string $content): string - { - if (Preg::match('/\R(\h*)[^\r\n]*$/D', $content, $matches)) { - return $matches[1]; - } - - return ''; - } - - private function getPreviousNewlineTokenIndex(Tokens $tokens, int $index): ?int - { - while ($index > 0) { - $index = $tokens->getPrevTokenOfKind($index, [[T_WHITESPACE], [T_INLINE_HTML]]); - - if (null === $index) { - break; - } - - if ($this->isNewLineToken($tokens, $index)) { - return $index; - } - } - - return null; - } - - private function computeNewLineContent(Tokens $tokens, int $index): string - { - $content = $tokens[$index]->getContent(); - - if (0 !== $index && $tokens[$index - 1]->equalsAny([[T_OPEN_TAG], [T_CLOSE_TAG]])) { - $content = Preg::replace('/\S/', '', $tokens[$index - 1]->getContent()).$content; - } - - return $content; - } - - private function isNewLineToken(Tokens $tokens, int $index): bool - { - $token = $tokens[$index]; - - if ( - $token->isGivenKind(T_OPEN_TAG) - && isset($tokens[$index + 1]) - && !$tokens[$index + 1]->isWhitespace() - && Preg::match('/\R/', $token->getContent()) - ) { - return true; - } - - if (!$tokens[$index]->isGivenKind([T_WHITESPACE, T_INLINE_HTML])) { - return false; - } - - return Preg::match('/\R/', $this->computeNewLineContent($tokens, $index)); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/InternalFixerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/InternalFixerInterface.php deleted file mode 100644 index cf843c80..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/InternalFixerInterface.php +++ /dev/null @@ -1,20 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer; - -/** - * @internal - */ -interface InternalFixerInterface extends FixerInterface {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php deleted file mode 100644 index b171e56b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php +++ /dev/null @@ -1,100 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ExperimentalFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - */ -final class ClassKeywordFixer extends AbstractFixer implements ExperimentalFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Converts FQCN strings to `*::class` keywords.', - [ - new CodeSample( - 'count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if ($token->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { - $name = substr($token->getContent(), 1, -1); - $name = ltrim($name, '\\'); - $name = str_replace('\\\\', '\\', $name); - - if ($this->exists($name)) { - $substitution = Tokens::fromCode("clearRange(0, 2); - $substitution->clearAt($substitution->getSize() - 1); - $substitution->clearEmptyTokens(); - - $tokens->clearAt($index); - $tokens->insertAt($index, $substitution); - } - } - } - } - - private function exists(string $name): bool - { - if (class_exists($name) || interface_exists($name) || trait_exists($name)) { - $rc = new \ReflectionClass($name); - - return $rc->getName() === $name; - } - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php deleted file mode 100644 index 3caf9f1b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php +++ /dev/null @@ -1,234 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @deprecated - * - * @author Sullivan Senechal - */ -final class ClassKeywordRemoveFixer extends AbstractFixer implements DeprecatedFixerInterface -{ - /** - * @var array - */ - private array $imports = []; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Converts `::class` keywords to FQCN strings.', - [ - new CodeSample( - 'isTokenKindFound(CT::T_CLASS_CONSTANT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $previousNamespaceScopeEndIndex = 0; - foreach ($tokens->getNamespaceDeclarations() as $declaration) { - $this->replaceClassKeywordsSection($tokens, '', $previousNamespaceScopeEndIndex, $declaration->getStartIndex()); - $this->replaceClassKeywordsSection($tokens, $declaration->getFullName(), $declaration->getStartIndex(), $declaration->getScopeEndIndex()); - $previousNamespaceScopeEndIndex = $declaration->getScopeEndIndex(); - } - - $this->replaceClassKeywordsSection($tokens, '', $previousNamespaceScopeEndIndex, $tokens->count() - 1); - } - - private function storeImports(Tokens $tokens, int $startIndex, int $endIndex): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - $this->imports = []; - - /** @var int $index */ - foreach ($tokensAnalyzer->getImportUseIndexes() as $index) { - if ($index < $startIndex || $index > $endIndex) { - continue; - } - - $import = ''; - while ($index = $tokens->getNextMeaningfulToken($index)) { - if ($tokens[$index]->equalsAny([';', [CT::T_GROUP_IMPORT_BRACE_OPEN]]) || $tokens[$index]->isGivenKind(T_AS)) { - break; - } - - $import .= $tokens[$index]->getContent(); - } - - // Imports group (PHP 7 spec) - if ($tokens[$index]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_OPEN)) { - $groupEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_GROUP_IMPORT_BRACE, $index); - $groupImports = array_map( - static fn (string $import): string => trim($import), - explode(',', $tokens->generatePartialCode($index + 1, $groupEndIndex - 1)) - ); - foreach ($groupImports as $groupImport) { - $groupImportParts = array_map(static fn (string $import): string => trim($import), explode(' as ', $groupImport)); - if (2 === \count($groupImportParts)) { - $this->imports[$groupImportParts[1]] = $import.$groupImportParts[0]; - } else { - $this->imports[] = $import.$groupImport; - } - } - } elseif ($tokens[$index]->isGivenKind(T_AS)) { - $aliasIndex = $tokens->getNextMeaningfulToken($index); - $alias = $tokens[$aliasIndex]->getContent(); - $this->imports[$alias] = $import; - } else { - $this->imports[] = $import; - } - } - } - - private function replaceClassKeywordsSection(Tokens $tokens, string $namespace, int $startIndex, int $endIndex): void - { - if ($endIndex - $startIndex < 3) { - return; - } - - $this->storeImports($tokens, $startIndex, $endIndex); - - $ctClassTokens = $tokens->findGivenKind(CT::T_CLASS_CONSTANT, $startIndex, $endIndex); - foreach (array_reverse(array_keys($ctClassTokens)) as $classIndex) { - $this->replaceClassKeyword($tokens, $namespace, $classIndex); - } - } - - private function replaceClassKeyword(Tokens $tokens, string $namespacePrefix, int $classIndex): void - { - $classEndIndex = $tokens->getPrevMeaningfulToken($classIndex); - $classEndIndex = $tokens->getPrevMeaningfulToken($classEndIndex); - - if (!$tokens[$classEndIndex]->isGivenKind(T_STRING)) { - return; - } - - if ($tokens[$classEndIndex]->equalsAny([[T_STRING, 'self'], [T_STATIC, 'static'], [T_STRING, 'parent']], false)) { - return; - } - - $classBeginIndex = $classEndIndex; - while (true) { - $prev = $tokens->getPrevMeaningfulToken($classBeginIndex); - if (!$tokens[$prev]->isGivenKind([T_NS_SEPARATOR, T_STRING])) { - break; - } - - $classBeginIndex = $prev; - } - - $classString = $tokens->generatePartialCode( - $tokens[$classBeginIndex]->isGivenKind(T_NS_SEPARATOR) - ? $tokens->getNextMeaningfulToken($classBeginIndex) - : $classBeginIndex, - $classEndIndex - ); - - $classImport = false; - if ($tokens[$classBeginIndex]->isGivenKind(T_NS_SEPARATOR)) { - $namespacePrefix = ''; - } else { - foreach ($this->imports as $alias => $import) { - if ($classString === $alias) { - $classImport = $import; - - break; - } - - $classStringArray = explode('\\', $classString); - $namespaceToTest = $classStringArray[0]; - - if (0 === ($namespaceToTest <=> substr($import, -\strlen($namespaceToTest)))) { - $classImport = $import; - - break; - } - } - } - - for ($i = $classBeginIndex; $i <= $classIndex; ++$i) { - if (!$tokens[$i]->isComment() && !($tokens[$i]->isWhitespace() && str_contains($tokens[$i]->getContent(), "\n"))) { - $tokens->clearAt($i); - } - } - - $tokens->insertAt($classBeginIndex, new Token([ - T_CONSTANT_ENCAPSED_STRING, - "'".$this->makeClassFQN($namespacePrefix, $classImport, $classString)."'", - ])); - } - - /** - * @param false|string $classImport - */ - private function makeClassFQN(string $namespacePrefix, $classImport, string $classString): string - { - if (false === $classImport) { - return ('' !== $namespacePrefix ? ($namespacePrefix.'\\') : '').$classString; - } - - $classStringArray = explode('\\', $classString); - $classStringLength = \count($classStringArray); - $classImportArray = explode('\\', $classImport); - $classImportLength = \count($classImportArray); - - if (1 === $classStringLength) { - return $classImport; - } - - return implode('\\', array_merge( - \array_slice($classImportArray, 0, $classImportLength - $classStringLength + 1), - $classStringArray - )); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php deleted file mode 100644 index e84bcb9d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php +++ /dev/null @@ -1,163 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class CombineConsecutiveIssetsFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Using `isset($var) &&` multiple times should be done in one call.', - [new CodeSample("isAllTokenKindsFound([T_ISSET, T_BOOLEAN_AND]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokenCount = $tokens->count(); - - for ($index = 1; $index < $tokenCount; ++$index) { - if (!$tokens[$index]->isGivenKind(T_ISSET) - || !$tokens[$tokens->getPrevMeaningfulToken($index)]->equalsAny(['(', '{', ';', '=', [T_OPEN_TAG], [T_BOOLEAN_AND], [T_BOOLEAN_OR]])) { - continue; - } - - $issetInfo = $this->getIssetInfo($tokens, $index); - $issetCloseBraceIndex = end($issetInfo); // ')' token - $insertLocation = prev($issetInfo) + 1; // one index after the previous meaningful of ')' - - $booleanAndTokenIndex = $tokens->getNextMeaningfulToken($issetCloseBraceIndex); - - while ($tokens[$booleanAndTokenIndex]->isGivenKind(T_BOOLEAN_AND)) { - $issetIndex = $tokens->getNextMeaningfulToken($booleanAndTokenIndex); - if (!$tokens[$issetIndex]->isGivenKind(T_ISSET)) { - $index = $issetIndex; - - break; - } - - // fetch info about the 'isset' statement that we're merging - $nextIssetInfo = $this->getIssetInfo($tokens, $issetIndex); - - $nextMeaningfulTokenIndex = $tokens->getNextMeaningfulToken(end($nextIssetInfo)); - $nextMeaningfulToken = $tokens[$nextMeaningfulTokenIndex]; - - if (!$nextMeaningfulToken->equalsAny([')', '}', ';', [T_CLOSE_TAG], [T_BOOLEAN_AND], [T_BOOLEAN_OR]])) { - $index = $nextMeaningfulTokenIndex; - - break; - } - - // clone what we want to move, do not clone '(' and ')' of the 'isset' statement we're merging - $clones = $this->getTokenClones($tokens, \array_slice($nextIssetInfo, 1, -1)); - - // clean up now the tokens of the 'isset' statement we're merging - $this->clearTokens($tokens, array_merge($nextIssetInfo, [$issetIndex, $booleanAndTokenIndex])); - - // insert the tokens to create the new statement - array_unshift($clones, new Token(','), new Token([T_WHITESPACE, ' '])); - $tokens->insertAt($insertLocation, $clones); - - // correct some counts and offset based on # of tokens inserted - $numberOfTokensInserted = \count($clones); - $tokenCount += $numberOfTokensInserted; - $issetCloseBraceIndex += $numberOfTokensInserted; - $insertLocation += $numberOfTokensInserted; - - $booleanAndTokenIndex = $tokens->getNextMeaningfulToken($issetCloseBraceIndex); - } - } - } - - /** - * @param list $indices - */ - private function clearTokens(Tokens $tokens, array $indices): void - { - foreach ($indices as $index) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - } - - /** - * @param int $index of T_ISSET - * - * @return list indices of meaningful tokens belonging to the isset statement - */ - private function getIssetInfo(Tokens $tokens, int $index): array - { - $openIndex = $tokens->getNextMeaningfulToken($index); - - $braceOpenCount = 1; - $meaningfulTokenIndices = [$openIndex]; - - for ($i = $openIndex + 1;; ++$i) { - if ($tokens[$i]->isWhitespace() || $tokens[$i]->isComment()) { - continue; - } - - $meaningfulTokenIndices[] = $i; - - if ($tokens[$i]->equals(')')) { - --$braceOpenCount; - if (0 === $braceOpenCount) { - break; - } - } elseif ($tokens[$i]->equals('(')) { - ++$braceOpenCount; - } - } - - return $meaningfulTokenIndices; - } - - /** - * @param list $indices - * - * @return list - */ - private function getTokenClones(Tokens $tokens, array $indices): array - { - $clones = []; - - foreach ($indices as $i) { - $clones[] = clone $tokens[$i]; - } - - return $clones; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveUnsetsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveUnsetsFixer.php deleted file mode 100644 index 24f18958..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveUnsetsFixer.php +++ /dev/null @@ -1,179 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class CombineConsecutiveUnsetsFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Calling `unset` on multiple items should be done in one call.', - [new CodeSample("isTokenKindFound(T_UNSET); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if (!$tokens[$index]->isGivenKind(T_UNSET)) { - continue; - } - - $previousUnsetCall = $this->getPreviousUnsetCall($tokens, $index); - if (\is_int($previousUnsetCall)) { - $index = $previousUnsetCall; - - continue; - } - - [$previousUnset, , $previousUnsetBraceEnd] = $previousUnsetCall; - - // Merge the tokens inside the 'unset' call into the previous one 'unset' call. - $tokensAddCount = $this->moveTokens( - $tokens, - $nextUnsetContentStart = $tokens->getNextTokenOfKind($index, ['(']), - $nextUnsetContentEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $nextUnsetContentStart), - $previousUnsetBraceEnd - 1 - ); - - if (!$tokens[$previousUnsetBraceEnd]->isWhitespace()) { - $tokens->insertAt($previousUnsetBraceEnd, new Token([T_WHITESPACE, ' '])); - ++$tokensAddCount; - } - - $tokens->insertAt($previousUnsetBraceEnd, new Token(',')); - ++$tokensAddCount; - - // Remove 'unset', '(', ')' and (possibly) ';' from the merged 'unset' call. - $this->clearOffsetTokens($tokens, $tokensAddCount, [$index, $nextUnsetContentStart, $nextUnsetContentEnd]); - - $nextUnsetSemicolon = $tokens->getNextMeaningfulToken($nextUnsetContentEnd); - if (null !== $nextUnsetSemicolon && $tokens[$nextUnsetSemicolon]->equals(';')) { - $tokens->clearTokenAndMergeSurroundingWhitespace($nextUnsetSemicolon); - } - - $index = $previousUnset + 1; - } - } - - /** - * @param list $indices - */ - private function clearOffsetTokens(Tokens $tokens, int $offset, array $indices): void - { - foreach ($indices as $index) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index + $offset); - } - } - - /** - * Find a previous call to unset directly before the index. - * - * Returns an array with - * * unset index - * * opening brace index - * * closing brace index - * * end semicolon index - * - * Or the index to where the method looked for a call. - * - * @return array{int, int, int, int}|int - */ - private function getPreviousUnsetCall(Tokens $tokens, int $index) - { - $previousUnsetSemicolon = $tokens->getPrevMeaningfulToken($index); - if (null === $previousUnsetSemicolon) { - return $index; - } - - if (!$tokens[$previousUnsetSemicolon]->equals(';')) { - return $previousUnsetSemicolon; - } - - $previousUnsetBraceEnd = $tokens->getPrevMeaningfulToken($previousUnsetSemicolon); - if (null === $previousUnsetBraceEnd) { - return $index; - } - - if (!$tokens[$previousUnsetBraceEnd]->equals(')')) { - return $previousUnsetBraceEnd; - } - - $previousUnsetBraceStart = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $previousUnsetBraceEnd); - $previousUnset = $tokens->getPrevMeaningfulToken($previousUnsetBraceStart); - if (null === $previousUnset) { - return $index; - } - - if (!$tokens[$previousUnset]->isGivenKind(T_UNSET)) { - return $previousUnset; - } - - return [ - $previousUnset, - $previousUnsetBraceStart, - $previousUnsetBraceEnd, - $previousUnsetSemicolon, - ]; - } - - /** - * @param int $start Index previous of the first token to move - * @param int $end Index of the last token to move - * @param int $to Upper boundary index - * - * @return int Number of tokens inserted - */ - private function moveTokens(Tokens $tokens, int $start, int $end, int $to): int - { - $added = 0; - for ($i = $start + 1; $i < $end; $i += 2) { - if ($tokens[$i]->isWhitespace() && $tokens[$to + 1]->isWhitespace()) { - $tokens[$to + 1] = new Token([T_WHITESPACE, $tokens[$to + 1]->getContent().$tokens[$i]->getContent()]); - } else { - $tokens->insertAt(++$to, clone $tokens[$i]); - ++$end; - ++$added; - } - - $tokens->clearAt($i + 1); - } - - return $added; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareEqualNormalizeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareEqualNormalizeFixer.php deleted file mode 100644 index 442ee723..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareEqualNormalizeFixer.php +++ /dev/null @@ -1,137 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * space?: 'none'|'single' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * space: 'none'|'single' - * } - */ -final class DeclareEqualNormalizeFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Equal sign in declare statement should be surrounded by spaces or not following configuration.', - [ - new CodeSample(" 'single']), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after DeclareStrictTypesFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DECLARE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = 0, $count = $tokens->count(); $index < $count - 6; ++$index) { - if (!$tokens[$index]->isGivenKind(T_DECLARE)) { - continue; - } - - $openParenthesisIndex = $tokens->getNextMeaningfulToken($index); - $closeParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openParenthesisIndex); - - for ($i = $closeParenthesisIndex; $i > $openParenthesisIndex; --$i) { - if ($tokens[$i]->equals('=')) { - if ('none' === $this->configuration['space']) { - $this->removeWhitespaceAroundToken($tokens, $i); - } else { - $this->ensureWhitespaceAroundToken($tokens, $i); - } - } - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('space', 'Spacing to apply around the equal sign.')) - ->setAllowedValues(['single', 'none']) - ->setDefault('none') - ->getOption(), - ]); - } - - /** - * @param int $index of `=` token - */ - private function ensureWhitespaceAroundToken(Tokens $tokens, int $index): void - { - if ($tokens[$index + 1]->isWhitespace()) { - if (' ' !== $tokens[$index + 1]->getContent()) { - $tokens[$index + 1] = new Token([T_WHITESPACE, ' ']); - } - } else { - $tokens->insertAt($index + 1, new Token([T_WHITESPACE, ' '])); - } - - if ($tokens[$index - 1]->isWhitespace()) { - if (' ' !== $tokens[$index - 1]->getContent() && !$tokens[$tokens->getPrevNonWhitespace($index - 1)]->isComment()) { - $tokens[$index - 1] = new Token([T_WHITESPACE, ' ']); - } - } else { - $tokens->insertAt($index, new Token([T_WHITESPACE, ' '])); - } - } - - /** - * @param int $index of `=` token - */ - private function removeWhitespaceAroundToken(Tokens $tokens, int $index): void - { - if (!$tokens[$tokens->getPrevNonWhitespace($index)]->isComment()) { - $tokens->removeLeadingWhitespace($index); - } - - $tokens->removeTrailingWhitespace($index); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareParenthesesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareParenthesesFixer.php deleted file mode 100644 index e3879731..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DeclareParenthesesFixer.php +++ /dev/null @@ -1,56 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -final class DeclareParenthesesFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There must not be spaces around `declare` statement parentheses.', - [new CodeSample("isTokenKindFound(T_DECLARE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; 0 <= $index; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_DECLARE)) { - continue; - } - - $tokens->removeTrailingWhitespace($index); - - $startParenthesisIndex = $tokens->getNextTokenOfKind($index, ['(']); - $tokens->removeTrailingWhitespace($startParenthesisIndex); - - $endParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startParenthesisIndex); - $tokens->removeLeadingWhitespace($endParenthesisIndex); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DirConstantFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DirConstantFixer.php deleted file mode 100644 index a19368e0..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/DirConstantFixer.php +++ /dev/null @@ -1,129 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFunctionReferenceFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Vladimir Reznichenko - */ -final class DirConstantFixer extends AbstractFunctionReferenceFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replaces `dirname(__FILE__)` expression with equivalent `__DIR__` constant.', - [new CodeSample("isAllTokenKindsFound([T_STRING, T_FILE]); - } - - /** - * {@inheritdoc} - * - * Must run before CombineNestedDirnameFixer. - */ - public function getPriority(): int - { - return 40; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $currIndex = 0; - - do { - $boundaries = $this->find('dirname', $tokens, $currIndex, $tokens->count() - 1); - if (null === $boundaries) { - return; - } - - [$functionNameIndex, $openParenthesis, $closeParenthesis] = $boundaries; - - // analysing cursor shift, so nested expressions kept processed - $currIndex = $openParenthesis; - - // ensure __FILE__ is in between (...) - - $fileCandidateRightIndex = $tokens->getPrevMeaningfulToken($closeParenthesis); - $trailingCommaIndex = null; - - if ($tokens[$fileCandidateRightIndex]->equals(',')) { - $trailingCommaIndex = $fileCandidateRightIndex; - $fileCandidateRightIndex = $tokens->getPrevMeaningfulToken($fileCandidateRightIndex); - } - - $fileCandidateRight = $tokens[$fileCandidateRightIndex]; - - if (!$fileCandidateRight->isGivenKind(T_FILE)) { - continue; - } - - $fileCandidateLeftIndex = $tokens->getNextMeaningfulToken($openParenthesis); - $fileCandidateLeft = $tokens[$fileCandidateLeftIndex]; - - if (!$fileCandidateLeft->isGivenKind(T_FILE)) { - continue; - } - - // get rid of root namespace when it used - $namespaceCandidateIndex = $tokens->getPrevMeaningfulToken($functionNameIndex); - $namespaceCandidate = $tokens[$namespaceCandidateIndex]; - - if ($namespaceCandidate->isGivenKind(T_NS_SEPARATOR)) { - $tokens->removeTrailingWhitespace($namespaceCandidateIndex); - $tokens->clearAt($namespaceCandidateIndex); - } - - if (null !== $trailingCommaIndex) { - if (!$tokens[$tokens->getNextNonWhitespace($trailingCommaIndex)]->isComment()) { - $tokens->removeTrailingWhitespace($trailingCommaIndex); - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($trailingCommaIndex); - } - - // closing parenthesis removed with leading spaces - if (!$tokens[$tokens->getNextNonWhitespace($closeParenthesis)]->isComment()) { - $tokens->removeLeadingWhitespace($closeParenthesis); - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($closeParenthesis); - - // opening parenthesis removed with trailing and leading spaces - if (!$tokens[$tokens->getNextNonWhitespace($openParenthesis)]->isComment()) { - $tokens->removeLeadingWhitespace($openParenthesis); - } - - $tokens->removeTrailingWhitespace($openParenthesis); - $tokens->clearTokenAndMergeSurroundingWhitespace($openParenthesis); - - // replace constant and remove function name - $tokens[$fileCandidateLeftIndex] = new Token([T_DIR, '__DIR__']); - $tokens->clearTokenAndMergeSurroundingWhitespace($functionNameIndex); - } while (null !== $currIndex); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ErrorSuppressionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ErrorSuppressionFixer.php deleted file mode 100644 index 551d8e33..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ErrorSuppressionFixer.php +++ /dev/null @@ -1,186 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Jules Pietri - * @author Kuba Werłos - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * mute_deprecation_error?: bool, - * noise_remaining_usages?: bool, - * noise_remaining_usages_exclude?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * mute_deprecation_error: bool, - * noise_remaining_usages: bool, - * noise_remaining_usages_exclude: list - * } - */ -final class ErrorSuppressionFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const OPTION_MUTE_DEPRECATION_ERROR = 'mute_deprecation_error'; - - /** - * @internal - */ - public const OPTION_NOISE_REMAINING_USAGES = 'noise_remaining_usages'; - - /** - * @internal - */ - public const OPTION_NOISE_REMAINING_USAGES_EXCLUDE = 'noise_remaining_usages_exclude'; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Error control operator should be added to deprecation notices and/or removed from other cases.', - [ - new CodeSample(" true] - ), - new CodeSample( - " true, - self::OPTION_NOISE_REMAINING_USAGES_EXCLUDE => ['unlink'], - ] - ), - ], - null, - 'Risky because adding/removing `@` might cause changes to code behaviour or if `trigger_error` function is overridden.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder(self::OPTION_MUTE_DEPRECATION_ERROR, 'Whether to add `@` in deprecation notices.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder(self::OPTION_NOISE_REMAINING_USAGES, 'Whether to remove `@` in remaining usages.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder(self::OPTION_NOISE_REMAINING_USAGES_EXCLUDE, 'List of global functions to exclude from removing `@`.')) - ->setAllowedTypes(['string[]']) - ->setDefault([]) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - $excludedFunctions = array_map(static fn (string $function): string => strtolower($function), $this->configuration[self::OPTION_NOISE_REMAINING_USAGES_EXCLUDE]); - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if (true === $this->configuration[self::OPTION_NOISE_REMAINING_USAGES] && $token->equals('@')) { - $tokens->clearAt($index); - - continue; - } - - if (!$functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { - continue; - } - - $functionIndex = $index; - $startIndex = $index; - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR)) { - $startIndex = $prevIndex; - $prevIndex = $tokens->getPrevMeaningfulToken($startIndex); - } - - $index = $prevIndex; - - if ($this->isDeprecationErrorCall($tokens, $functionIndex)) { - if (false === $this->configuration[self::OPTION_MUTE_DEPRECATION_ERROR]) { - continue; - } - - if ($tokens[$prevIndex]->equals('@')) { - continue; - } - - $tokens->insertAt($startIndex, new Token('@')); - - continue; - } - - if (!$tokens[$prevIndex]->equals('@')) { - continue; - } - - if (true === $this->configuration[self::OPTION_NOISE_REMAINING_USAGES] && !\in_array($tokens[$functionIndex]->getContent(), $excludedFunctions, true)) { - $tokens->clearAt($index); - } - } - } - - private function isDeprecationErrorCall(Tokens $tokens, int $index): bool - { - if ('trigger_error' !== strtolower($tokens[$index]->getContent())) { - return false; - } - - $endBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $tokens->getNextTokenOfKind($index, [[T_STRING], '('])); - $prevIndex = $tokens->getPrevMeaningfulToken($endBraceIndex); - - if ($tokens[$prevIndex]->equals(',')) { - $prevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - } - - return $tokens[$prevIndex]->equals([T_STRING, 'E_USER_DEPRECATED']); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ExplicitIndirectVariableFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ExplicitIndirectVariableFixer.php deleted file mode 100644 index 7be05e43..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ExplicitIndirectVariableFixer.php +++ /dev/null @@ -1,82 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - */ -final class ExplicitIndirectVariableFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Add curly braces to indirect variables to make them clear to understand.', - [ - new CodeSample( - <<<'EOT' - $bar['baz']; - echo $foo->$callback($baz); - - EOT - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_VARIABLE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index > 1; --$index) { - $token = $tokens[$index]; - if (!$token->isGivenKind(T_VARIABLE)) { - continue; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - $prevToken = $tokens[$prevIndex]; - if (!$prevToken->equals('$') && !$prevToken->isObjectOperator()) { - continue; - } - - $openingBrace = CT::T_DYNAMIC_VAR_BRACE_OPEN; - $closingBrace = CT::T_DYNAMIC_VAR_BRACE_CLOSE; - if ($prevToken->isObjectOperator()) { - $openingBrace = CT::T_DYNAMIC_PROP_BRACE_OPEN; - $closingBrace = CT::T_DYNAMIC_PROP_BRACE_CLOSE; - } - - $tokens->overrideRange($index, $index, [ - new Token([$openingBrace, '{']), - new Token([T_VARIABLE, $token->getContent()]), - new Token([$closingBrace, '}']), - ]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/FunctionToConstantFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/FunctionToConstantFixer.php deleted file mode 100644 index 157a013e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/FunctionToConstantFixer.php +++ /dev/null @@ -1,311 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * functions?: list<'get_called_class'|'get_class'|'get_class_this'|'php_sapi_name'|'phpversion'|'pi'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * functions: list<'get_called_class'|'get_class'|'get_class_this'|'php_sapi_name'|'phpversion'|'pi'> - * } - */ -final class FunctionToConstantFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var null|array> - */ - private static ?array $availableFunctions = null; - - /** - * @var array> - */ - private array $functionsFixMap; - - public function __construct() - { - if (null === self::$availableFunctions) { - self::$availableFunctions = [ - 'get_called_class' => [ - new Token([T_STATIC, 'static']), - new Token([T_DOUBLE_COLON, '::']), - new Token([CT::T_CLASS_CONSTANT, 'class']), - ], - 'get_class' => [ - new Token([T_STRING, 'self']), - new Token([T_DOUBLE_COLON, '::']), - new Token([CT::T_CLASS_CONSTANT, 'class']), - ], - 'get_class_this' => [ - new Token([T_STATIC, 'static']), - new Token([T_DOUBLE_COLON, '::']), - new Token([CT::T_CLASS_CONSTANT, 'class']), - ], - 'php_sapi_name' => [new Token([T_STRING, 'PHP_SAPI'])], - 'phpversion' => [new Token([T_STRING, 'PHP_VERSION'])], - 'pi' => [new Token([T_STRING, 'M_PI'])], - ]; - } - - parent::__construct(); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replace core functions calls returning constants with the constants.', - [ - new CodeSample( - " ['get_called_class', 'get_class_this', 'phpversion']] - ), - ], - null, - 'Risky when any of the configured functions to replace are overridden.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before NativeConstantInvocationFixer, NativeFunctionCasingFixer, NoExtraBlankLinesFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer, SelfStaticAccessorFixer. - * Must run after NoSpacesAfterFunctionNameFixer, NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. - */ - public function getPriority(): int - { - return 2; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - $this->functionsFixMap = []; - - foreach ($this->configuration['functions'] as $key) { - $this->functionsFixMap[$key] = self::$availableFunctions[$key]; - } - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionAnalyzer = new FunctionsAnalyzer(); - - for ($index = $tokens->count() - 4; $index > 0; --$index) { - $candidate = $this->getReplaceCandidate($tokens, $functionAnalyzer, $index); - if (null === $candidate) { - continue; - } - - $this->fixFunctionCallToConstant( - $tokens, - $index, - $candidate[0], // brace open - $candidate[1], // brace close - $candidate[2] // replacement - ); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $functionNames = array_keys(self::$availableFunctions); - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('functions', 'List of function names to fix.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset($functionNames)]) - ->setDefault([ - 'get_called_class', - 'get_class', - 'get_class_this', - 'php_sapi_name', - 'phpversion', - 'pi', - ]) - ->getOption(), - ]); - } - - /** - * @param list $replacements - */ - private function fixFunctionCallToConstant(Tokens $tokens, int $index, int $braceOpenIndex, int $braceCloseIndex, array $replacements): void - { - for ($i = $braceCloseIndex; $i >= $braceOpenIndex; --$i) { - if ($tokens[$i]->isGivenKind([T_WHITESPACE, T_COMMENT, T_DOC_COMMENT])) { - continue; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - } - - if ( - $replacements[0]->isGivenKind([T_CLASS_C, T_STATIC]) - || ($replacements[0]->isGivenKind(T_STRING) && 'self' === $replacements[0]->getContent()) - ) { - $prevIndex = $tokens->getPrevMeaningfulToken($index); - $prevToken = $tokens[$prevIndex]; - if ($prevToken->isGivenKind(T_NS_SEPARATOR)) { - $tokens->clearAt($prevIndex); - } - } - - $tokens->clearAt($index); - $tokens->insertAt($index, $replacements); - } - - /** - * @return ?array{int, int, list} - */ - private function getReplaceCandidate( - Tokens $tokens, - FunctionsAnalyzer $functionAnalyzer, - int $index - ): ?array { - if (!$tokens[$index]->isGivenKind(T_STRING)) { - return null; - } - - $lowerContent = strtolower($tokens[$index]->getContent()); - - if ('get_class' === $lowerContent) { - return $this->fixGetClassCall($tokens, $functionAnalyzer, $index); - } - - if (!isset($this->functionsFixMap[$lowerContent])) { - return null; - } - - if (!$functionAnalyzer->isGlobalFunctionCall($tokens, $index)) { - return null; - } - - // test if function call without parameters - $braceOpenIndex = $tokens->getNextMeaningfulToken($index); - if (!$tokens[$braceOpenIndex]->equals('(')) { - return null; - } - - $braceCloseIndex = $tokens->getNextMeaningfulToken($braceOpenIndex); - if (!$tokens[$braceCloseIndex]->equals(')')) { - return null; - } - - return $this->getReplacementTokenClones($lowerContent, $braceOpenIndex, $braceCloseIndex); - } - - /** - * @return ?array{int, int, list} - */ - private function fixGetClassCall( - Tokens $tokens, - FunctionsAnalyzer $functionAnalyzer, - int $index - ): ?array { - if (!isset($this->functionsFixMap['get_class']) && !isset($this->functionsFixMap['get_class_this'])) { - return null; - } - - if (!$functionAnalyzer->isGlobalFunctionCall($tokens, $index)) { - return null; - } - - $braceOpenIndex = $tokens->getNextMeaningfulToken($index); - $braceCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $braceOpenIndex); - - if ($braceCloseIndex === $tokens->getNextMeaningfulToken($braceOpenIndex)) { // no arguments passed - if (isset($this->functionsFixMap['get_class'])) { - return $this->getReplacementTokenClones('get_class', $braceOpenIndex, $braceCloseIndex); - } - } elseif (isset($this->functionsFixMap['get_class_this'])) { - $isThis = false; - - for ($i = $braceOpenIndex + 1; $i < $braceCloseIndex; ++$i) { - if ($tokens[$i]->equalsAny([[T_WHITESPACE], [T_COMMENT], [T_DOC_COMMENT], ')'])) { - continue; - } - - if ($tokens[$i]->isGivenKind(T_VARIABLE) && '$this' === strtolower($tokens[$i]->getContent())) { - $isThis = true; - - continue; - } - - if (false === $isThis && $tokens[$i]->equals('(')) { - continue; - } - - $isThis = false; - - break; - } - - if ($isThis) { - return $this->getReplacementTokenClones('get_class_this', $braceOpenIndex, $braceCloseIndex); - } - } - - return null; - } - - /** - * @return array{int, int, list} - */ - private function getReplacementTokenClones(string $lowerContent, int $braceOpenIndex, int $braceCloseIndex): array - { - $clones = array_map( - static fn (Token $token): Token => clone $token, - $this->functionsFixMap[$lowerContent], - ); - - return [ - $braceOpenIndex, - $braceCloseIndex, - $clones, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/GetClassToClassKeywordFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/GetClassToClassKeywordFixer.php deleted file mode 100644 index d5ceb526..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/GetClassToClassKeywordFixer.php +++ /dev/null @@ -1,158 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author John Paul E. Balandan, CPA - */ -final class GetClassToClassKeywordFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replace `get_class` calls on object variables with class keyword syntax.', - [ - new VersionSpecificCodeSample( - "= 8_00_00 && $tokens->isAllTokenKindsFound([T_STRING, T_VARIABLE]); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - $indicesToClear = []; - $tokenSlices = []; - - for ($index = $tokens->count() - 1; $index > 0; --$index) { - if (!$tokens[$index]->equals([T_STRING, 'get_class'], false)) { - continue; - } - - if (!$functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { - continue; - } - - $braceOpenIndex = $tokens->getNextMeaningfulToken($index); - $braceCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $braceOpenIndex); - - if ($braceCloseIndex === $tokens->getNextMeaningfulToken($braceOpenIndex)) { - continue; // get_class with no arguments - } - - $meaningfulTokensCount = 0; - $variableTokensIndices = []; - - for ($i = $braceOpenIndex + 1; $i < $braceCloseIndex; ++$i) { - if (!$tokens[$i]->equalsAny([[T_WHITESPACE], [T_COMMENT], [T_DOC_COMMENT], '(', ')'])) { - ++$meaningfulTokensCount; - } - - if (!$tokens[$i]->isGivenKind(T_VARIABLE)) { - continue; - } - - if ('$this' === strtolower($tokens[$i]->getContent())) { - continue 2; // get_class($this) - } - - $variableTokensIndices[] = $i; - } - - if ($meaningfulTokensCount > 1 || 1 !== \count($variableTokensIndices)) { - continue; // argument contains more logic, or more arguments, or no variable argument - } - - $indicesToClear[$index] = [$braceOpenIndex, current($variableTokensIndices), $braceCloseIndex]; - } - - foreach ($indicesToClear as $index => $items) { - $tokenSlices[$index] = $this->getReplacementTokenSlices($tokens, $items[1]); - $this->clearGetClassCall($tokens, $index, $items[0], $items[2]); - } - - $tokens->insertSlices($tokenSlices); - } - - /** - * @return list - */ - private function getReplacementTokenSlices(Tokens $tokens, int $variableIndex): array - { - return [ - new Token([T_VARIABLE, $tokens[$variableIndex]->getContent()]), - new Token([T_DOUBLE_COLON, '::']), - new Token([CT::T_CLASS_CONSTANT, 'class']), - ]; - } - - private function clearGetClassCall(Tokens $tokens, int $index, int $braceOpenIndex, int $braceCloseIndex): void - { - for ($i = $braceOpenIndex; $i <= $braceCloseIndex; ++$i) { - if ($tokens[$i]->isGivenKind([T_WHITESPACE, T_COMMENT, T_DOC_COMMENT])) { - continue; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR)) { - $tokens->clearAt($prevIndex); - } - - $tokens->clearAt($index); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/IsNullFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/IsNullFixer.php deleted file mode 100644 index a99695d4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/IsNullFixer.php +++ /dev/null @@ -1,169 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Vladimir Reznichenko - */ -final class IsNullFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replaces `is_null($var)` expression with `null === $var`.', - [ - new CodeSample("isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - static $sequenceNeeded = [[T_STRING, 'is_null'], '(']; - $functionsAnalyzer = new FunctionsAnalyzer(); - $currIndex = 0; - - while (true) { - // recalculate "end" because we might have added tokens in previous iteration - $matches = $tokens->findSequence($sequenceNeeded, $currIndex, $tokens->count() - 1, false); - - // stop looping if didn't find any new matches - if (null === $matches) { - break; - } - - // 0 and 1 accordingly are "is_null", "(" tokens - $matches = array_keys($matches); - - // move the cursor just after the sequence - [$isNullIndex, $currIndex] = $matches; - - if (!$functionsAnalyzer->isGlobalFunctionCall($tokens, $matches[0])) { - continue; - } - - $next = $tokens->getNextMeaningfulToken($currIndex); - - if ($tokens[$next]->equals(')')) { - continue; - } - - $prevTokenIndex = $tokens->getPrevMeaningfulToken($matches[0]); - - // handle function references with namespaces - if ($tokens[$prevTokenIndex]->isGivenKind(T_NS_SEPARATOR)) { - $tokens->removeTrailingWhitespace($prevTokenIndex); - $tokens->clearAt($prevTokenIndex); - - $prevTokenIndex = $tokens->getPrevMeaningfulToken($prevTokenIndex); - } - - // check if inversion being used, text comparison is due to not existing constant - $isInvertedNullCheck = false; - - if ($tokens[$prevTokenIndex]->equals('!')) { - $isInvertedNullCheck = true; - - // get rid of inverting for proper transformations - $tokens->removeTrailingWhitespace($prevTokenIndex); - $tokens->clearAt($prevTokenIndex); - } - - // before getting rind of `()` around a parameter, ensure it's not assignment/ternary invariant - $referenceEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $matches[1]); - $isContainingDangerousConstructs = false; - - for ($paramTokenIndex = $matches[1]; $paramTokenIndex <= $referenceEnd; ++$paramTokenIndex) { - if (\in_array($tokens[$paramTokenIndex]->getContent(), ['?', '?:', '=', '??'], true)) { - $isContainingDangerousConstructs = true; - - break; - } - } - - // edge cases: is_null() followed/preceded by ==, ===, !=, !==, <>, (int-or-other-casting) - $parentLeftToken = $tokens[$tokens->getPrevMeaningfulToken($isNullIndex)]; - $parentRightToken = $tokens[$tokens->getNextMeaningfulToken($referenceEnd)]; - $parentOperations = [T_IS_EQUAL, T_IS_NOT_EQUAL, T_IS_IDENTICAL, T_IS_NOT_IDENTICAL]; - $wrapIntoParentheses = $parentLeftToken->isCast() || $parentLeftToken->isGivenKind($parentOperations) || $parentRightToken->isGivenKind($parentOperations); - - // possible trailing comma removed - $prevIndex = $tokens->getPrevMeaningfulToken($referenceEnd); - - if ($tokens[$prevIndex]->equals(',')) { - $tokens->clearTokenAndMergeSurroundingWhitespace($prevIndex); - } - - if (!$isContainingDangerousConstructs) { - // closing parenthesis removed with leading spaces - $tokens->removeLeadingWhitespace($referenceEnd); - $tokens->clearAt($referenceEnd); - - // opening parenthesis removed with trailing spaces - $tokens->removeLeadingWhitespace($matches[1]); - $tokens->removeTrailingWhitespace($matches[1]); - $tokens->clearAt($matches[1]); - } - - // sequence which we'll use as a replacement - $replacement = [ - new Token([T_STRING, 'null']), - new Token([T_WHITESPACE, ' ']), - new Token($isInvertedNullCheck ? [T_IS_NOT_IDENTICAL, '!=='] : [T_IS_IDENTICAL, '===']), - new Token([T_WHITESPACE, ' ']), - ]; - - if ($wrapIntoParentheses) { - array_unshift($replacement, new Token('(')); - $tokens->insertAt($referenceEnd + 1, new Token(')')); - } - - $tokens->overrideRange($isNullIndex, $isNullIndex, $replacement); - - // nested is_null calls support - $currIndex = $isNullIndex; - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NoUnsetOnPropertyFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NoUnsetOnPropertyFixer.php deleted file mode 100644 index c72a783a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NoUnsetOnPropertyFixer.php +++ /dev/null @@ -1,220 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Gert de Pagter - */ -final class NoUnsetOnPropertyFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Properties should be set to `null` instead of using `unset`.', - [new CodeSample("a);\n")], - null, - 'Risky when relying on attributes to be removed using `unset` rather than be set to `null`.'. - ' Changing variables to `null` instead of unsetting means these still show up when looping over class variables'. - ' and reference properties remain unbroken.'. - ' With PHP 7.4, this rule might introduce `null` assignments to properties whose type declaration does not allow it.' - ); - } - - public function isRisky(): bool - { - return true; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_UNSET) - && $tokens->isAnyTokenKindsFound([T_OBJECT_OPERATOR, T_PAAMAYIM_NEKUDOTAYIM]); - } - - /** - * {@inheritdoc} - * - * Must run before CombineConsecutiveUnsetsFixer. - */ - public function getPriority(): int - { - return 25; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if (!$tokens[$index]->isGivenKind(T_UNSET)) { - continue; - } - - $unsetsInfo = $this->getUnsetsInfo($tokens, $index); - - if (!$this->isAnyUnsetToTransform($unsetsInfo)) { - continue; - } - - $isLastUnset = true; // "last" as we reverse the array below - - foreach (array_reverse($unsetsInfo) as $unsetInfo) { - $this->updateTokens($tokens, $unsetInfo, $isLastUnset); - $isLastUnset = false; - } - } - } - - /** - * @return list> - */ - private function getUnsetsInfo(Tokens $tokens, int $index): array - { - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - $unsetStart = $tokens->getNextTokenOfKind($index, ['(']); - $unsetEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $unsetStart); - $isFirst = true; - $unsets = []; - - foreach ($argumentsAnalyzer->getArguments($tokens, $unsetStart, $unsetEnd) as $startIndex => $endIndex) { - $startIndex = $tokens->getNextMeaningfulToken($startIndex - 1); - $endIndex = $tokens->getPrevMeaningfulToken($endIndex + 1); - $unsets[] = [ - 'startIndex' => $startIndex, - 'endIndex' => $endIndex, - 'isToTransform' => $this->isProperty($tokens, $startIndex, $endIndex), - 'isFirst' => $isFirst, - ]; - $isFirst = false; - } - - return $unsets; - } - - private function isProperty(Tokens $tokens, int $index, int $endIndex): bool - { - if ($tokens[$index]->isGivenKind(T_VARIABLE)) { - $nextIndex = $tokens->getNextMeaningfulToken($index); - - if (null === $nextIndex || !$tokens[$nextIndex]->isGivenKind(T_OBJECT_OPERATOR)) { - return false; - } - - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - $nextNextIndex = $tokens->getNextMeaningfulToken($nextIndex); - - if (null !== $nextNextIndex && $nextNextIndex < $endIndex) { - return false; - } - - return null !== $nextIndex && $tokens[$nextIndex]->isGivenKind(T_STRING); - } - - if ($tokens[$index]->isGivenKind([T_NS_SEPARATOR, T_STRING])) { - $nextIndex = $tokens->getTokenNotOfKindsSibling($index, 1, [T_DOUBLE_COLON, T_NS_SEPARATOR, T_STRING]); - $nextNextIndex = $tokens->getNextMeaningfulToken($nextIndex); - - if (null !== $nextNextIndex && $nextNextIndex < $endIndex) { - return false; - } - - return null !== $nextIndex && $tokens[$nextIndex]->isGivenKind(T_VARIABLE); - } - - return false; - } - - /** - * @param list> $unsetsInfo - */ - private function isAnyUnsetToTransform(array $unsetsInfo): bool - { - foreach ($unsetsInfo as $unsetInfo) { - if ($unsetInfo['isToTransform']) { - return true; - } - } - - return false; - } - - /** - * @param array $unsetInfo - */ - private function updateTokens(Tokens $tokens, array $unsetInfo, bool $isLastUnset): void - { - // if entry is first and to be transformed we remove leading "unset(" - if ($unsetInfo['isFirst'] && $unsetInfo['isToTransform']) { - $braceIndex = $tokens->getPrevTokenOfKind($unsetInfo['startIndex'], ['(']); - $unsetIndex = $tokens->getPrevTokenOfKind($braceIndex, [[T_UNSET]]); - $tokens->clearTokenAndMergeSurroundingWhitespace($braceIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($unsetIndex); - } - - // if entry is last and to be transformed we remove trailing ")" - if ($isLastUnset && $unsetInfo['isToTransform']) { - $braceIndex = $tokens->getNextTokenOfKind($unsetInfo['endIndex'], [')']); - $previousIndex = $tokens->getPrevMeaningfulToken($braceIndex); - if ($tokens[$previousIndex]->equals(',')) { - $tokens->clearTokenAndMergeSurroundingWhitespace($previousIndex); // trailing ',' in function call (PHP 7.3) - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($braceIndex); - } - - // if entry is not last we replace comma with semicolon (last entry already has semicolon - from original unset) - if (!$isLastUnset) { - $commaIndex = $tokens->getNextTokenOfKind($unsetInfo['endIndex'], [',']); - $tokens[$commaIndex] = new Token(';'); - } - - // if entry is to be unset and is not last we add trailing ")" - if (!$unsetInfo['isToTransform'] && !$isLastUnset) { - $tokens->insertAt($unsetInfo['endIndex'] + 1, new Token(')')); - } - - // if entry is to be unset and is not first we add leading "unset(" - if (!$unsetInfo['isToTransform'] && !$unsetInfo['isFirst']) { - $tokens->insertAt( - $unsetInfo['startIndex'], - [ - new Token([T_UNSET, 'unset']), - new Token('('), - ] - ); - } - - // and finally - // if entry is to be transformed we add trailing " = null" - if ($unsetInfo['isToTransform']) { - $tokens->insertAt( - $unsetInfo['endIndex'] + 1, - [ - new Token([T_WHITESPACE, ' ']), - new Token('='), - new Token([T_WHITESPACE, ' ']), - new Token([T_STRING, 'null']), - ] - ); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NullableTypeDeclarationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NullableTypeDeclarationFixer.php deleted file mode 100644 index 708c17c8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/NullableTypeDeclarationFixer.php +++ /dev/null @@ -1,348 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author John Paul E. Balandan, CPA - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * syntax?: 'question_mark'|'union' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * syntax: 'question_mark'|'union' - * } - */ -final class NullableTypeDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const OPTION_SYNTAX_UNION = 'union'; - private const OPTION_SYNTAX_QUESTION_MARK = 'question_mark'; - - private int $candidateTokenKind; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Nullable single type declaration should be standardised using configured syntax.', - [ - new VersionSpecificCodeSample( - " self::OPTION_SYNTAX_UNION] - ), - new VersionSpecificCodeSample( - ' self::OPTION_SYNTAX_QUESTION_MARK] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return \PHP_VERSION_ID >= 8_00_00 && $tokens->isTokenKindFound($this->candidateTokenKind); - } - - /** - * {@inheritdoc} - * - * Must run before OrderedTypesFixer, TypesSpacesFixer. - * Must run after NullableTypeDeclarationForDefaultNullValueFixer. - */ - public function getPriority(): int - { - return 2; - } - - protected function configurePostNormalisation(): void - { - $this->candidateTokenKind = self::OPTION_SYNTAX_QUESTION_MARK === $this->configuration['syntax'] - ? CT::T_TYPE_ALTERNATION // `|` -> `?` - : CT::T_NULLABLE_TYPE; // `?` -> `|` - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('syntax', 'Whether to use question mark (`?`) or explicit `null` union for nullable type.')) - ->setAllowedValues([self::OPTION_SYNTAX_UNION, self::OPTION_SYNTAX_QUESTION_MARK]) - ->setDefault(self::OPTION_SYNTAX_QUESTION_MARK) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - foreach (array_reverse($this->getElements($tokens), true) as $index => $type) { - if ('property' === $type) { - $this->normalizePropertyType($tokens, $index); - - continue; - } - - $this->normalizeMethodReturnType($functionsAnalyzer, $tokens, $index); - $this->normalizeMethodArgumentType($functionsAnalyzer, $tokens, $index); - } - } - - /** - * @return array - * - * @phpstan-return array - */ - private function getElements(Tokens $tokens): array - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - $elements = array_map( - static fn (array $element): string => 'method' === $element['type'] ? 'function' : $element['type'], - array_filter( - $tokensAnalyzer->getClassyElements(), - static fn (array $element): bool => \in_array($element['type'], ['method', 'property'], true) - ) - ); - - foreach ($tokens as $index => $token) { - if ( - $token->isGivenKind(T_FN) - || ($token->isGivenKind(T_FUNCTION) && !isset($elements[$index])) - ) { - $elements[$index] = 'function'; - } - } - - return $elements; - } - - private function collectTypeAnalysis(Tokens $tokens, int $startIndex, int $endIndex): ?TypeAnalysis - { - $type = ''; - $typeStartIndex = $tokens->getNextMeaningfulToken($startIndex); - $typeEndIndex = $typeStartIndex; - - for ($i = $typeStartIndex; $i < $endIndex; ++$i) { - if ($tokens[$i]->isWhitespace() || $tokens[$i]->isComment()) { - continue; - } - - $type .= $tokens[$i]->getContent(); - $typeEndIndex = $i; - } - - return '' !== $type ? new TypeAnalysis($type, $typeStartIndex, $typeEndIndex) : null; - } - - private function isTypeNormalizable(TypeAnalysis $typeAnalysis): bool - { - $type = $typeAnalysis->getName(); - - if ('null' === strtolower($type) || !$typeAnalysis->isNullable()) { - return false; - } - - if (str_contains($type, '&')) { - return false; // skip DNF types - } - - if (!str_contains($type, '|')) { - return true; - } - - return 1 === substr_count($type, '|') && Preg::match('/(?:\|null$|^null\|)/i', $type); - } - - private function normalizePropertyType(Tokens $tokens, int $index): void - { - $propertyEndIndex = $index; - $propertyModifiers = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_STATIC, T_VAR]; - - if (\defined('T_READONLY')) { - $propertyModifiers[] = T_READONLY; // @TODO: Drop condition when PHP 8.1+ is required - } - - do { - $index = $tokens->getPrevMeaningfulToken($index); - } while (!$tokens[$index]->isGivenKind($propertyModifiers)); - - $propertyType = $this->collectTypeAnalysis($tokens, $index, $propertyEndIndex); - - if (null === $propertyType || !$this->isTypeNormalizable($propertyType)) { - return; - } - - $this->normalizeNullableType($tokens, $propertyType); - } - - private function normalizeMethodArgumentType(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index): void - { - foreach (array_reverse($functionsAnalyzer->getFunctionArguments($tokens, $index), true) as $argumentInfo) { - $argumentType = $argumentInfo->getTypeAnalysis(); - - if (null === $argumentType || !$this->isTypeNormalizable($argumentType)) { - continue; - } - - $this->normalizeNullableType($tokens, $argumentType); - } - } - - private function normalizeMethodReturnType(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index): void - { - $returnType = $functionsAnalyzer->getFunctionReturnType($tokens, $index); - - if (null === $returnType || !$this->isTypeNormalizable($returnType)) { - return; - } - - $this->normalizeNullableType($tokens, $returnType); - } - - private function normalizeNullableType(Tokens $tokens, TypeAnalysis $typeAnalysis): void - { - $type = $typeAnalysis->getName(); - - if (!str_contains($type, '|') && !str_contains($type, '&')) { - $type = ($typeAnalysis->isNullable() ? '?' : '').$type; - } - - $isQuestionMarkSyntax = self::OPTION_SYNTAX_QUESTION_MARK === $this->configuration['syntax']; - - if ($isQuestionMarkSyntax) { - $normalizedType = $this->convertToNullableType($type); - $normalizedTypeAsString = implode('', $normalizedType); - } else { - $normalizedType = $this->convertToExplicitUnionType($type); - $normalizedTypeAsString = implode('|', $normalizedType); - } - - if ($normalizedTypeAsString === $type) { - return; // nothing to fix - } - - $tokens->overrideRange( - $typeAnalysis->getStartIndex(), - $typeAnalysis->getEndIndex(), - $this->createTypeDeclarationTokens($normalizedType, $isQuestionMarkSyntax) - ); - - $prevStartIndex = $typeAnalysis->getStartIndex() - 1; - if (!$tokens[$prevStartIndex]->isWhitespace() && !$tokens[$prevStartIndex]->equals('(')) { - $tokens->ensureWhitespaceAtIndex($prevStartIndex, 1, ' '); - } - } - - /** - * @return list - */ - private function convertToNullableType(string $type): array - { - if (str_starts_with($type, '?')) { - return [$type]; // no need to convert; already fixed - } - - return ['?', Preg::replace('/(?:\|null$|^null\|)/i', '', $type)]; - } - - /** - * @return list - */ - private function convertToExplicitUnionType(string $type): array - { - if (str_contains($type, '|')) { - return [$type]; // no need to convert; already fixed - } - - return ['null', substr($type, 1)]; - } - - /** - * @param list $types - * - * @return list - */ - private function createTypeDeclarationTokens(array $types, bool $isQuestionMarkSyntax): array - { - static $specialTypes = [ - '?' => CT::T_NULLABLE_TYPE, - 'array' => CT::T_ARRAY_TYPEHINT, - 'callable' => T_CALLABLE, - 'static' => T_STATIC, - ]; - - $count = \count($types); - $newTokens = []; - - foreach ($types as $index => $type) { - if (isset($specialTypes[strtolower($type)])) { - $newTokens[] = new Token([$specialTypes[strtolower($type)], $type]); - } else { - foreach (explode('\\', $type) as $nsIndex => $value) { - if (0 === $nsIndex && '' === $value) { - continue; - } - - if ($nsIndex > 0) { - $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); - } - - $newTokens[] = new Token([T_STRING, $value]); - } - } - - if ($index <= $count - 2 && !$isQuestionMarkSyntax) { - $newTokens[] = new Token([CT::T_TYPE_ALTERNATION, '|']); - } - } - - return $newTokens; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAfterConstructFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAfterConstructFixer.php deleted file mode 100644 index 586c37c9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAfterConstructFixer.php +++ /dev/null @@ -1,209 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; - -/** - * @author Andreas Möller - * - * @deprecated - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * constructs?: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * constructs: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'> - * } - */ -final class SingleSpaceAfterConstructFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var array - */ - private const TOKEN_MAP = [ - 'abstract' => T_ABSTRACT, - 'as' => T_AS, - 'attribute' => CT::T_ATTRIBUTE_CLOSE, - 'break' => T_BREAK, - 'case' => T_CASE, - 'catch' => T_CATCH, - 'class' => T_CLASS, - 'clone' => T_CLONE, - 'comment' => T_COMMENT, - 'const' => T_CONST, - 'const_import' => CT::T_CONST_IMPORT, - 'continue' => T_CONTINUE, - 'do' => T_DO, - 'echo' => T_ECHO, - 'else' => T_ELSE, - 'elseif' => T_ELSEIF, - 'enum' => null, - 'extends' => T_EXTENDS, - 'final' => T_FINAL, - 'finally' => T_FINALLY, - 'for' => T_FOR, - 'foreach' => T_FOREACH, - 'function' => T_FUNCTION, - 'function_import' => CT::T_FUNCTION_IMPORT, - 'global' => T_GLOBAL, - 'goto' => T_GOTO, - 'if' => T_IF, - 'implements' => T_IMPLEMENTS, - 'include' => T_INCLUDE, - 'include_once' => T_INCLUDE_ONCE, - 'instanceof' => T_INSTANCEOF, - 'insteadof' => T_INSTEADOF, - 'interface' => T_INTERFACE, - 'match' => null, - 'named_argument' => CT::T_NAMED_ARGUMENT_COLON, - 'namespace' => T_NAMESPACE, - 'new' => T_NEW, - 'open_tag_with_echo' => T_OPEN_TAG_WITH_ECHO, - 'php_doc' => T_DOC_COMMENT, - 'php_open' => T_OPEN_TAG, - 'print' => T_PRINT, - 'private' => T_PRIVATE, - 'protected' => T_PROTECTED, - 'public' => T_PUBLIC, - 'readonly' => null, - 'require' => T_REQUIRE, - 'require_once' => T_REQUIRE_ONCE, - 'return' => T_RETURN, - 'static' => T_STATIC, - 'switch' => T_SWITCH, - 'throw' => T_THROW, - 'trait' => T_TRAIT, - 'try' => T_TRY, - 'type_colon' => CT::T_TYPE_COLON, - 'use' => T_USE, - 'use_lambda' => CT::T_USE_LAMBDA, - 'use_trait' => CT::T_USE_TRAIT, - 'var' => T_VAR, - 'while' => T_WHILE, - 'yield' => T_YIELD, - 'yield_from' => T_YIELD_FROM, - ]; - - private SingleSpaceAroundConstructFixer $singleSpaceAroundConstructFixer; - - public function __construct() - { - $this->singleSpaceAroundConstructFixer = new SingleSpaceAroundConstructFixer(); - - parent::__construct(); - } - - public function getSuccessorsNames(): array - { - return array_keys($this->proxyFixers); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Ensures a single space after language constructs.', - [ - new CodeSample( - ' [ - 'echo', - ], - ] - ), - new CodeSample( - ' [ - 'yield_from', - ], - ] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before BracesFixer, FunctionDeclarationFixer. - * Must run after ArraySyntaxFixer, ModernizeStrposFixer. - */ - public function getPriority(): int - { - return parent::getPriority(); - } - - protected function configurePostNormalisation(): void - { - $this->singleSpaceAroundConstructFixer->configure([ - 'constructs_contain_a_single_space' => [ - 'yield_from', - ], - 'constructs_preceded_by_a_single_space' => [], - 'constructs_followed_by_a_single_space' => $this->configuration['constructs'], - ]); - } - - protected function createProxyFixers(): array - { - return [$this->singleSpaceAroundConstructFixer]; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $defaults = self::TOKEN_MAP; - $tokens = array_keys($defaults); - - unset($defaults['type_colon']); - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('constructs', 'List of constructs which must be followed by a single space.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset($tokens)]) - ->setDefault(array_keys($defaults)) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixer.php deleted file mode 100644 index c76ef293..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixer.php +++ /dev/null @@ -1,515 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\LanguageConstruct; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Andreas Möller - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * constructs_contain_a_single_space?: list<'yield_from'>, - * constructs_followed_by_a_single_space?: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'>, - * constructs_preceded_by_a_single_space?: list<'as'|'else'|'elseif'|'use_lambda'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * constructs_contain_a_single_space: list<'yield_from'>, - * constructs_followed_by_a_single_space: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'>, - * constructs_preceded_by_a_single_space: list<'as'|'else'|'elseif'|'use_lambda'> - * } - */ -final class SingleSpaceAroundConstructFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var array - */ - private static array $tokenMapContainASingleSpace = [ - // for now, only one case - but we are ready to extend it, when we learn about new cases to cover - 'yield_from' => T_YIELD_FROM, - ]; - - /** - * @var array - */ - private static array $tokenMapPrecededByASingleSpace = [ - 'as' => T_AS, - 'else' => T_ELSE, - 'elseif' => T_ELSEIF, - 'use_lambda' => CT::T_USE_LAMBDA, - ]; - - /** - * @var array - */ - private static array $tokenMapFollowedByASingleSpace = [ - 'abstract' => T_ABSTRACT, - 'as' => T_AS, - 'attribute' => CT::T_ATTRIBUTE_CLOSE, - 'break' => T_BREAK, - 'case' => T_CASE, - 'catch' => T_CATCH, - 'class' => T_CLASS, - 'clone' => T_CLONE, - 'comment' => T_COMMENT, - 'const' => T_CONST, - 'const_import' => CT::T_CONST_IMPORT, - 'continue' => T_CONTINUE, - 'do' => T_DO, - 'echo' => T_ECHO, - 'else' => T_ELSE, - 'elseif' => T_ELSEIF, - 'enum' => null, - 'extends' => T_EXTENDS, - 'final' => T_FINAL, - 'finally' => T_FINALLY, - 'for' => T_FOR, - 'foreach' => T_FOREACH, - 'function' => T_FUNCTION, - 'function_import' => CT::T_FUNCTION_IMPORT, - 'global' => T_GLOBAL, - 'goto' => T_GOTO, - 'if' => T_IF, - 'implements' => T_IMPLEMENTS, - 'include' => T_INCLUDE, - 'include_once' => T_INCLUDE_ONCE, - 'instanceof' => T_INSTANCEOF, - 'insteadof' => T_INSTEADOF, - 'interface' => T_INTERFACE, - 'match' => null, - 'named_argument' => CT::T_NAMED_ARGUMENT_COLON, - 'namespace' => T_NAMESPACE, - 'new' => T_NEW, - 'open_tag_with_echo' => T_OPEN_TAG_WITH_ECHO, - 'php_doc' => T_DOC_COMMENT, - 'php_open' => T_OPEN_TAG, - 'print' => T_PRINT, - 'private' => T_PRIVATE, - 'protected' => T_PROTECTED, - 'public' => T_PUBLIC, - 'readonly' => null, - 'require' => T_REQUIRE, - 'require_once' => T_REQUIRE_ONCE, - 'return' => T_RETURN, - 'static' => T_STATIC, - 'switch' => T_SWITCH, - 'throw' => T_THROW, - 'trait' => T_TRAIT, - 'try' => T_TRY, - 'type_colon' => CT::T_TYPE_COLON, - 'use' => T_USE, - 'use_lambda' => CT::T_USE_LAMBDA, - 'use_trait' => CT::T_USE_TRAIT, - 'var' => T_VAR, - 'while' => T_WHILE, - 'yield' => T_YIELD, - 'yield_from' => T_YIELD_FROM, - ]; - - /** - * @var array - */ - private array $fixTokenMapFollowedByASingleSpace = []; - - /** - * @var array - */ - private array $fixTokenMapContainASingleSpace = []; - - /** - * @var array - */ - private array $fixTokenMapPrecededByASingleSpace = []; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Ensures a single space after language constructs.', - [ - new CodeSample( - ' [ - 'yield_from', - ], - 'constructs_followed_by_a_single_space' => [ - 'yield_from', - ], - ] - ), - - new CodeSample( - ' [ - 'use_lambda', - ], - 'constructs_followed_by_a_single_space' => [ - 'use_lambda', - ], - ] - ), - new CodeSample( - ' [ - 'echo', - ], - ] - ), - new CodeSample( - ' [ - 'yield_from', - ], - ] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before BracesFixer, FunctionDeclarationFixer. - * Must run after ArraySyntaxFixer, ModernizeStrposFixer. - */ - public function getPriority(): int - { - return 36; - } - - public function isCandidate(Tokens $tokens): bool - { - $tokenKinds = [ - ...array_values($this->fixTokenMapContainASingleSpace), - ...array_values($this->fixTokenMapPrecededByASingleSpace), - ...array_values($this->fixTokenMapFollowedByASingleSpace), - ]; - - return $tokens->isAnyTokenKindsFound($tokenKinds) && !$tokens->hasAlternativeSyntax(); - } - - protected function configurePostNormalisation(): void - { - if (\defined('T_MATCH')) { // @TODO: drop condition when PHP 8.0+ is required - self::$tokenMapFollowedByASingleSpace['match'] = T_MATCH; - } - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - self::$tokenMapFollowedByASingleSpace['readonly'] = T_READONLY; - } - - if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required - self::$tokenMapFollowedByASingleSpace['enum'] = T_ENUM; - } - - $this->fixTokenMapContainASingleSpace = []; - - foreach ($this->configuration['constructs_contain_a_single_space'] as $key) { - if (null !== self::$tokenMapContainASingleSpace[$key]) { - $this->fixTokenMapContainASingleSpace[$key] = self::$tokenMapContainASingleSpace[$key]; - } - } - - $this->fixTokenMapPrecededByASingleSpace = []; - - foreach ($this->configuration['constructs_preceded_by_a_single_space'] as $key) { - if (null !== self::$tokenMapPrecededByASingleSpace[$key]) { - $this->fixTokenMapPrecededByASingleSpace[$key] = self::$tokenMapPrecededByASingleSpace[$key]; - } - } - - $this->fixTokenMapFollowedByASingleSpace = []; - - foreach ($this->configuration['constructs_followed_by_a_single_space'] as $key) { - if (null !== self::$tokenMapFollowedByASingleSpace[$key]) { - $this->fixTokenMapFollowedByASingleSpace[$key] = self::$tokenMapFollowedByASingleSpace[$key]; - } - } - - if (isset($this->fixTokenMapFollowedByASingleSpace['public'])) { - $this->fixTokenMapFollowedByASingleSpace['constructor_public'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC; - } - - if (isset($this->fixTokenMapFollowedByASingleSpace['protected'])) { - $this->fixTokenMapFollowedByASingleSpace['constructor_protected'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED; - } - - if (isset($this->fixTokenMapFollowedByASingleSpace['private'])) { - $this->fixTokenMapFollowedByASingleSpace['constructor_private'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE; - } - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokenKindsContainASingleSpace = array_values($this->fixTokenMapContainASingleSpace); - - for ($index = $tokens->count() - 1; $index > 0; --$index) { - if ($tokens[$index]->isGivenKind($tokenKindsContainASingleSpace)) { - $token = $tokens[$index]; - - if ( - $token->isGivenKind(T_YIELD_FROM) - && 'yield from' !== strtolower($token->getContent()) - ) { - $tokens[$index] = new Token([T_YIELD_FROM, Preg::replace( - '/\s+/', - ' ', - $token->getContent() - )]); - } - } - } - - $tokenKindsPrecededByASingleSpace = array_values($this->fixTokenMapPrecededByASingleSpace); - - for ($index = $tokens->count() - 1; $index > 0; --$index) { - if ($tokens[$index]->isGivenKind($tokenKindsPrecededByASingleSpace)) { - if (!$this->isFullLineCommentBefore($tokens, $index)) { - $tokens->ensureWhitespaceAtIndex($index - 1, 1, ' '); - } - } - } - - $tokenKindsFollowedByASingleSpace = array_values($this->fixTokenMapFollowedByASingleSpace); - - for ($index = $tokens->count() - 2; $index >= 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind($tokenKindsFollowedByASingleSpace)) { - continue; - } - - $whitespaceTokenIndex = $index + 1; - - if ($tokens[$whitespaceTokenIndex]->equalsAny([',', ';', ')', [CT::T_ARRAY_SQUARE_BRACE_CLOSE], [CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE]])) { - continue; - } - - if ( - $token->isGivenKind(T_STATIC) - && !$tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind([T_FN, T_FUNCTION, T_NS_SEPARATOR, T_STRING, T_VARIABLE, CT::T_ARRAY_TYPEHINT, CT::T_NULLABLE_TYPE]) - ) { - continue; - } - - if ($token->isGivenKind(T_OPEN_TAG)) { - if ($tokens[$whitespaceTokenIndex]->equals([T_WHITESPACE]) && !str_contains($tokens[$whitespaceTokenIndex]->getContent(), "\n") && !str_contains($token->getContent(), "\n")) { - $tokens->clearAt($whitespaceTokenIndex); - } - - continue; - } - - if ($token->isGivenKind(T_CLASS) && $tokens[$tokens->getNextMeaningfulToken($index)]->equals('(')) { - continue; - } - - if ($token->isGivenKind([T_EXTENDS, T_IMPLEMENTS]) && $this->isMultilineExtendsOrImplementsWithMoreThanOneAncestor($tokens, $index)) { - continue; - } - - if ($token->isGivenKind(T_RETURN) && $this->isMultiLineReturn($tokens, $index)) { - continue; - } - - if ($token->isGivenKind(T_CONST) && $this->isMultilineCommaSeparatedConstant($tokens, $index)) { - continue; - } - - if ($token->isComment() || $token->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - if ($tokens[$whitespaceTokenIndex]->equals([T_WHITESPACE]) && str_contains($tokens[$whitespaceTokenIndex]->getContent(), "\n")) { - continue; - } - } - - if ($tokens[$whitespaceTokenIndex]->isWhitespace() && str_contains($tokens[$whitespaceTokenIndex]->getContent(), "\n")) { - $nextNextToken = $tokens[$whitespaceTokenIndex + 1]; - if (\defined('T_ATTRIBUTE')) { // @TODO: drop condition and else when PHP 8.0+ is required - if ($nextNextToken->isGivenKind(T_ATTRIBUTE)) { - continue; - } - } else { - if ($nextNextToken->isComment() && str_starts_with($nextNextToken->getContent(), '#[')) { - continue; - } - } - - if ($nextNextToken->isGivenKind(T_DOC_COMMENT)) { - continue; - } - } - - $tokens->ensureWhitespaceAtIndex($whitespaceTokenIndex, 0, ' '); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $tokenMapContainASingleSpaceKeys = array_keys(self::$tokenMapContainASingleSpace); - $tokenMapPrecededByASingleSpaceKeys = array_keys(self::$tokenMapPrecededByASingleSpace); - $tokenMapFollowedByASingleSpaceKeys = array_keys(self::$tokenMapFollowedByASingleSpace); - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('constructs_contain_a_single_space', 'List of constructs which must contain a single space.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset($tokenMapContainASingleSpaceKeys)]) - ->setDefault($tokenMapContainASingleSpaceKeys) - ->getOption(), - (new FixerOptionBuilder('constructs_preceded_by_a_single_space', 'List of constructs which must be preceded by a single space.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset($tokenMapPrecededByASingleSpaceKeys)]) - ->setDefault(['as', 'use_lambda']) - ->getOption(), - (new FixerOptionBuilder('constructs_followed_by_a_single_space', 'List of constructs which must be followed by a single space.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset($tokenMapFollowedByASingleSpaceKeys)]) - ->setDefault($tokenMapFollowedByASingleSpaceKeys) - ->getOption(), - ]); - } - - private function isMultiLineReturn(Tokens $tokens, int $index): bool - { - ++$index; - $tokenFollowingReturn = $tokens[$index]; - - if ( - !$tokenFollowingReturn->isGivenKind(T_WHITESPACE) - || !str_contains($tokenFollowingReturn->getContent(), "\n") - ) { - return false; - } - - $nestedCount = 0; - - for ($indexEnd = \count($tokens) - 1, ++$index; $index < $indexEnd; ++$index) { - if (str_contains($tokens[$index]->getContent(), "\n")) { - return true; - } - - if ($tokens[$index]->equals('{')) { - ++$nestedCount; - } elseif ($tokens[$index]->equals('}')) { - --$nestedCount; - } elseif (0 === $nestedCount && $tokens[$index]->equalsAny([';', [T_CLOSE_TAG]])) { - break; - } - } - - return false; - } - - private function isMultilineExtendsOrImplementsWithMoreThanOneAncestor(Tokens $tokens, int $index): bool - { - $hasMoreThanOneAncestor = false; - - while (++$index) { - $token = $tokens[$index]; - - if ($token->equals(',')) { - $hasMoreThanOneAncestor = true; - - continue; - } - - if ($token->equals('{')) { - return false; - } - - if ($hasMoreThanOneAncestor && str_contains($token->getContent(), "\n")) { - return true; - } - } - - return false; - } - - private function isMultilineCommaSeparatedConstant(Tokens $tokens, int $constantIndex): bool - { - $isMultilineConstant = false; - $hasMoreThanOneConstant = false; - $index = $constantIndex; - while (!$tokens[$index]->equalsAny([';', [T_CLOSE_TAG]])) { - ++$index; - - $isMultilineConstant = $isMultilineConstant || str_contains($tokens[$index]->getContent(), "\n"); - - if ($tokens[$index]->equals(',')) { - $hasMoreThanOneConstant = true; - } - - $blockType = Tokens::detectBlockType($tokens[$index]); - - if (null !== $blockType && true === $blockType['isStart']) { - $index = $tokens->findBlockEnd($blockType['type'], $index); - } - } - - return $hasMoreThanOneConstant && $isMultilineConstant; - } - - private function isFullLineCommentBefore(Tokens $tokens, int $index): bool - { - $beforeIndex = $tokens->getPrevNonWhitespace($index); - - if (!$tokens[$beforeIndex]->isGivenKind([T_COMMENT])) { - return false; - } - - $content = $tokens[$beforeIndex]->getContent(); - - return str_starts_with($content, '#') || str_starts_with($content, '//'); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ListNotation/ListSyntaxFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ListNotation/ListSyntaxFixer.php deleted file mode 100644 index ecc55cf7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ListNotation/ListSyntaxFixer.php +++ /dev/null @@ -1,133 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ListNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * syntax?: 'long'|'short' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * syntax: 'long'|'short' - * } - */ -final class ListSyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private ?int $candidateTokenKind = null; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'List (`array` destructuring) assignment should be declared using the configured syntax.', - [ - new CodeSample( - " 'long'] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before BinaryOperatorSpacesFixer, TernaryOperatorSpacesFixer. - */ - public function getPriority(): int - { - return 2; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound($this->candidateTokenKind); - } - - protected function configurePostNormalisation(): void - { - $this->candidateTokenKind = 'long' === $this->configuration['syntax'] ? CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN : T_LIST; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; 0 <= $index; --$index) { - if ($tokens[$index]->isGivenKind($this->candidateTokenKind)) { - if (T_LIST === $this->candidateTokenKind) { - $this->fixToShortSyntax($tokens, $index); - } else { - $this->fixToLongSyntax($tokens, $index); - } - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('syntax', 'Whether to use the `long` or `short` syntax for array destructuring.')) - ->setAllowedValues(['long', 'short']) - ->setDefault('short') - ->getOption(), - ]); - } - - private function fixToLongSyntax(Tokens $tokens, int $index): void - { - static $typesOfInterest = [ - [CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE], - '[', // [CT::T_ARRAY_SQUARE_BRACE_OPEN], - ]; - - $closeIndex = $tokens->getNextTokenOfKind($index, $typesOfInterest); - if (!$tokens[$closeIndex]->isGivenKind(CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE)) { - return; - } - - $tokens[$index] = new Token('('); - $tokens[$closeIndex] = new Token(')'); - $tokens->insertAt($index, new Token([T_LIST, 'list'])); - } - - private function fixToShortSyntax(Tokens $tokens, int $index): void - { - $openIndex = $tokens->getNextTokenOfKind($index, ['(']); - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); - - $tokens[$openIndex] = new Token([CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN, '[']); - $tokens[$closeIndex] = new Token([CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE, ']']); - - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixer.php deleted file mode 100644 index 7c27bef6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixer.php +++ /dev/null @@ -1,127 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\NamespaceNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶3. - * - * @author Dariusz Rumiński - */ -final class BlankLineAfterNamespaceFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There MUST be one blank line after the namespace declaration.', - [ - new CodeSample("isTokenKindFound(T_NAMESPACE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $lastIndex = $tokens->count() - 1; - - for ($index = $lastIndex; $index >= 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_NAMESPACE)) { - continue; - } - - $semicolonIndex = $tokens->getNextTokenOfKind($index, [';', '{', [T_CLOSE_TAG]]); - $semicolonToken = $tokens[$semicolonIndex]; - - if (!$semicolonToken->equals(';')) { - continue; - } - - $indexToEnsureBlankLineAfter = $this->getIndexToEnsureBlankLineAfter($tokens, $semicolonIndex); - $indexToEnsureBlankLine = $tokens->getNonEmptySibling($indexToEnsureBlankLineAfter, 1); - - if (null !== $indexToEnsureBlankLine && $tokens[$indexToEnsureBlankLine]->isWhitespace()) { - $tokens[$indexToEnsureBlankLine] = $this->getTokenToInsert($tokens[$indexToEnsureBlankLine]->getContent(), $indexToEnsureBlankLine === $lastIndex); - } else { - $tokens->insertAt($indexToEnsureBlankLineAfter + 1, $this->getTokenToInsert('', $indexToEnsureBlankLineAfter === $lastIndex)); - } - } - } - - private function getIndexToEnsureBlankLineAfter(Tokens $tokens, int $index): int - { - $indexToEnsureBlankLine = $index; - $nextIndex = $tokens->getNonEmptySibling($indexToEnsureBlankLine, 1); - - while (null !== $nextIndex) { - $token = $tokens[$nextIndex]; - - if ($token->isWhitespace()) { - if (Preg::match('/\R/', $token->getContent())) { - break; - } - $nextNextIndex = $tokens->getNonEmptySibling($nextIndex, 1); - - if (!$tokens[$nextNextIndex]->isComment()) { - break; - } - } - - if (!$token->isWhitespace() && !$token->isComment()) { - break; - } - - $indexToEnsureBlankLine = $nextIndex; - $nextIndex = $tokens->getNonEmptySibling($indexToEnsureBlankLine, 1); - } - - return $indexToEnsureBlankLine; - } - - private function getTokenToInsert(string $currentContent, bool $isLastIndex): Token - { - $ending = $this->whitespacesConfig->getLineEnding(); - - $emptyLines = $isLastIndex ? $ending : $ending.$ending; - $indent = Preg::match('/^.*\R( *)$/s', $currentContent, $matches) ? $matches[1] : ''; - - return new Token([T_WHITESPACE, $emptyLines.$indent]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLinesBeforeNamespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLinesBeforeNamespaceFixer.php deleted file mode 100644 index 2a3a9456..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/BlankLinesBeforeNamespaceFixer.php +++ /dev/null @@ -1,242 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\NamespaceNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Options; - -/** - * @author Graham Campbell - * @author Greg Korba - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * max_line_breaks?: int, - * min_line_breaks?: int - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * max_line_breaks: int, - * min_line_breaks: int - * } - */ -final class BlankLinesBeforeNamespaceFixer extends AbstractFixer implements WhitespacesAwareFixerInterface, ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Controls blank lines before a namespace declaration.', - [ - new CodeSample(" 1]), - new CodeSample(" 2]), - new CodeSample(" 2]), - new CodeSample(" 0, 'max_line_breaks' => 0]), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_NAMESPACE); - } - - /** - * {@inheritdoc} - * - * Must run after BlankLineAfterOpeningTagFixer, HeaderCommentFixer. - */ - public function getPriority(): int - { - return -31; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('min_line_breaks', 'Minimum line breaks that should exist before namespace declaration.')) - ->setAllowedTypes(['int']) - ->setDefault(2) - ->setNormalizer(static function (Options $options, int $value): int { - if ($value < 0) { - throw new InvalidFixerConfigurationException( - (new self())->getName(), - 'Option `min_line_breaks` cannot be lower than 0.' - ); - } - - return $value; - }) - ->getOption(), - (new FixerOptionBuilder('max_line_breaks', 'Maximum line breaks that should exist before namespace declaration.')) - ->setAllowedTypes(['int']) - ->setDefault(2) - ->setNormalizer(static function (Options $options, int $value): int { - if ($value < 0) { - throw new InvalidFixerConfigurationException( - (new self())->getName(), - 'Option `max_line_breaks` cannot be lower than 0.' - ); - } - - if ($value < $options['min_line_breaks']) { - throw new InvalidFixerConfigurationException( - (new self())->getName(), - 'Option `max_line_breaks` cannot have lower value than `min_line_breaks`.' - ); - } - - return $value; - }) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if ($token->isGivenKind(T_NAMESPACE)) { - $this->fixLinesBeforeNamespace( - $tokens, - $index, - $this->configuration['min_line_breaks'], - $this->configuration['max_line_breaks'] - ); - } - } - } - - /** - * Make sure # of line breaks prefixing namespace is within given range. - * - * @param int $expectedMin min. # of line breaks - * @param int $expectedMax max. # of line breaks - */ - protected function fixLinesBeforeNamespace(Tokens $tokens, int $index, int $expectedMin, int $expectedMax): void - { - // Let's determine the total numbers of new lines before the namespace - // and the opening token - $openingTokenIndex = null; - $precedingNewlines = 0; - $newlineInOpening = false; - $openingToken = null; - - for ($i = 1; $i <= 2; ++$i) { - if (isset($tokens[$index - $i])) { - $token = $tokens[$index - $i]; - - if ($token->isGivenKind(T_OPEN_TAG)) { - $openingToken = $token; - $openingTokenIndex = $index - $i; - $newlineInOpening = str_contains($token->getContent(), "\n"); - - if ($newlineInOpening) { - ++$precedingNewlines; - } - - break; - } - - if (false === $token->isGivenKind(T_WHITESPACE)) { - break; - } - - $precedingNewlines += substr_count($token->getContent(), "\n"); - } - } - - if ($precedingNewlines >= $expectedMin && $precedingNewlines <= $expectedMax) { - return; - } - - $previousIndex = $index - 1; - $previous = $tokens[$previousIndex]; - - if (0 === $expectedMax) { - // Remove all the previous new lines - if ($previous->isWhitespace()) { - $tokens->clearAt($previousIndex); - } - - // Remove new lines in opening token - if ($newlineInOpening) { - $tokens[$openingTokenIndex] = new Token([T_OPEN_TAG, rtrim($openingToken->getContent()).' ']); - } - - return; - } - - $lineEnding = $this->whitespacesConfig->getLineEnding(); - - // Allow only as many line breaks as configured: - // - keep as-is when current preceding line breaks are within configured range - // - use configured max line breaks if currently there is more preceding line breaks - // - use configured min line breaks if currently there is less preceding line breaks - $newlinesForWhitespaceToken = $precedingNewlines >= $expectedMax - ? $expectedMax - : max($precedingNewlines, $expectedMin); - - if (null !== $openingToken) { - // Use the configured line ending for the PHP opening tag - $content = rtrim($openingToken->getContent()); - $newContent = $content.$lineEnding; - $tokens[$openingTokenIndex] = new Token([T_OPEN_TAG, $newContent]); - --$newlinesForWhitespaceToken; - } - - if (0 === $newlinesForWhitespaceToken) { - // We have all the needed new lines in the opening tag - if ($previous->isWhitespace()) { - // Let's remove the previous token containing extra new lines - $tokens->clearAt($previousIndex); - } - - return; - } - - if ($previous->isWhitespace()) { - // Fix the previous whitespace token - $tokens[$previousIndex] = new Token( - [ - T_WHITESPACE, - str_repeat($lineEnding, $newlinesForWhitespaceToken).substr( - $previous->getContent(), - strrpos($previous->getContent(), "\n") + 1 - ), - ] - ); - } else { - // Add a new whitespace token - $tokens->insertAt($index, new Token([T_WHITESPACE, str_repeat($lineEnding, $newlinesForWhitespaceToken)])); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/CleanNamespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/CleanNamespaceFixer.php deleted file mode 100644 index aaa13cc0..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/CleanNamespaceFixer.php +++ /dev/null @@ -1,108 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\NamespaceNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\Tokens; - -final class CleanNamespaceFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - $samples = []; - - foreach (['namespace Foo \ Bar;', 'echo foo /* comment */ \ bar();'] as $sample) { - $samples[] = new VersionSpecificCodeSample( - "isTokenKindFound(T_NS_SEPARATOR); - } - - /** - * {@inheritdoc} - * - * Must run before PhpUnitDataProviderReturnTypeFixer. - */ - public function getPriority(): int - { - return 10; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $count = $tokens->count(); - - for ($index = 0; $index < $count; ++$index) { - if ($tokens[$index]->isGivenKind(T_NS_SEPARATOR)) { - $previousIndex = $tokens->getPrevMeaningfulToken($index); - - $index = $this->fixNamespace( - $tokens, - $tokens[$previousIndex]->isGivenKind(T_STRING) ? $previousIndex : $index - ); - } - } - } - - /** - * @param int $index start of namespace - */ - private function fixNamespace(Tokens $tokens, int $index): int - { - $tillIndex = $index; - - // go to the end of the namespace - while ($tokens[$tillIndex]->isGivenKind([T_NS_SEPARATOR, T_STRING])) { - $tillIndex = $tokens->getNextMeaningfulToken($tillIndex); - } - - $tillIndex = $tokens->getPrevMeaningfulToken($tillIndex); - - $spaceIndices = []; - - for (; $index <= $tillIndex; ++$index) { - if ($tokens[$index]->isGivenKind(T_WHITESPACE)) { - $spaceIndices[] = $index; - } elseif ($tokens[$index]->isComment()) { - $tokens->clearAt($index); - } - } - - if ($tokens[$index - 1]->isWhitespace()) { - array_pop($spaceIndices); - } - - foreach ($spaceIndices as $i) { - $tokens->clearAt($i); - } - - return $index; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixer.php deleted file mode 100644 index 20dc38ea..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixer.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\NamespaceNotation; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Graham Campbell - * - * @deprecated Use `blank_lines_before_namespace` with config: ['min_line_breaks' => 0, 'max_line_breaks' => 1] - */ -final class NoBlankLinesBeforeNamespaceFixer extends AbstractProxyFixer implements WhitespacesAwareFixerInterface, DeprecatedFixerInterface -{ - public function getSuccessorsNames(): array - { - return array_keys($this->proxyFixers); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_NAMESPACE); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should be no blank lines before a namespace declaration.', - [ - new CodeSample( - "configure([ - 'min_line_breaks' => 0, - 'max_line_breaks' => 1, - ]); - - return [ - $blankLineBeforeNamespace, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoLeadingNamespaceWhitespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoLeadingNamespaceWhitespaceFixer.php deleted file mode 100644 index 0d866d4a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/NoLeadingNamespaceWhitespaceFixer.php +++ /dev/null @@ -1,95 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\NamespaceNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Bram Gotink - * @author Dariusz Rumiński - */ -final class NoLeadingNamespaceWhitespaceFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_NAMESPACE); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'The namespace declaration line shouldn\'t contain leading whitespace.', - [ - new CodeSample( - 'isGivenKind(T_NAMESPACE)) { - continue; - } - - $beforeNamespaceIndex = $index - 1; - $beforeNamespace = $tokens[$beforeNamespaceIndex]; - - if (!$beforeNamespace->isWhitespace()) { - if (!self::endsWithWhitespace($beforeNamespace->getContent())) { - $tokens->insertAt($index, new Token([T_WHITESPACE, $this->whitespacesConfig->getLineEnding()])); - } - - continue; - } - - $lastNewline = strrpos($beforeNamespace->getContent(), "\n"); - - if (false === $lastNewline) { - $beforeBeforeNamespace = $tokens[$index - 2]; - - if (self::endsWithWhitespace($beforeBeforeNamespace->getContent())) { - $tokens->clearAt($beforeNamespaceIndex); - } else { - $tokens[$beforeNamespaceIndex] = new Token([T_WHITESPACE, ' ']); - } - } else { - $tokens[$beforeNamespaceIndex] = new Token([T_WHITESPACE, substr($beforeNamespace->getContent(), 0, $lastNewline + 1)]); - } - } - } - - private static function endsWithWhitespace(string $str): bool - { - if ('' === $str) { - return false; - } - - return '' === trim(substr($str, -1)); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixer.php deleted file mode 100644 index 67de6a24..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixer.php +++ /dev/null @@ -1,75 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\NamespaceNotation; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Graham Campbell - * - * @deprecated Use `blank_lines_before_namespace` with config: ['min_line_breaks' => 2, 'max_line_breaks' => 2] (default) - */ -final class SingleBlankLineBeforeNamespaceFixer extends AbstractProxyFixer implements WhitespacesAwareFixerInterface, DeprecatedFixerInterface -{ - public function getSuccessorsNames(): array - { - return array_keys($this->proxyFixers); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should be exactly one blank line before a namespace declaration.', - [ - new CodeSample("isTokenKindFound(T_NAMESPACE); - } - - /** - * {@inheritdoc} - * - * Must run after HeaderCommentFixer. - */ - public function getPriority(): int - { - return parent::getPriority(); - } - - protected function createProxyFixers(): array - { - $blankLineBeforeNamespace = new BlankLinesBeforeNamespaceFixer(); - $blankLineBeforeNamespace->configure([ - 'min_line_breaks' => 2, - 'max_line_breaks' => 2, - ]); - - return [ - $blankLineBeforeNamespace, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Naming/NoHomoglyphNamesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Naming/NoHomoglyphNamesFixer.php deleted file mode 100644 index 8bd9fccb..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Naming/NoHomoglyphNamesFixer.php +++ /dev/null @@ -1,230 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Naming; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Fred Cox - * @author Dariusz Rumiński - */ -final class NoHomoglyphNamesFixer extends AbstractFixer -{ - /** - * Used the program https://github.com/mcfedr/homoglyph-download - * to generate this list from - * http://homoglyphs.net/?text=abcdefghijklmnopqrstuvwxyz&lang=en&exc7=1&exc8=1&exc13=1&exc14=1. - * - * Symbols replaced include - * - Latin homoglyphs - * - IPA extensions - * - Greek and Coptic - * - Cyrillic - * - Cyrillic Supplement - * - Letterlike Symbols - * - Latin Numbers - * - Fullwidth Latin - * - * This is not the complete list of unicode homographs, but limited - * to those you are more likely to have typed/copied by accident - * - * @var array - */ - private const REPLACEMENTS = [ - 'O' => '0', - '0' => '0', - 'I' => '1', - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - '6' => '6', - '7' => '7', - '8' => '8', - '9' => '9', - 'Α' => 'A', - 'А' => 'A', - 'A' => 'A', - 'ʙ' => 'B', - 'Β' => 'B', - 'В' => 'B', - 'B' => 'B', - 'Ϲ' => 'C', - 'С' => 'C', - 'Ⅽ' => 'C', - 'C' => 'C', - 'Ⅾ' => 'D', - 'D' => 'D', - 'Ε' => 'E', - 'Е' => 'E', - 'E' => 'E', - 'Ϝ' => 'F', - 'F' => 'F', - 'ɢ' => 'G', - 'Ԍ' => 'G', - 'G' => 'G', - 'ʜ' => 'H', - 'Η' => 'H', - 'Н' => 'H', - 'H' => 'H', - 'l' => 'I', - 'Ι' => 'I', - 'І' => 'I', - 'Ⅰ' => 'I', - 'I' => 'I', - 'Ј' => 'J', - 'J' => 'J', - 'Κ' => 'K', - 'К' => 'K', - 'K' => 'K', - 'K' => 'K', - 'ʟ' => 'L', - 'Ⅼ' => 'L', - 'L' => 'L', - 'Μ' => 'M', - 'М' => 'M', - 'Ⅿ' => 'M', - 'M' => 'M', - 'ɴ' => 'N', - 'Ν' => 'N', - 'N' => 'N', - 'Ο' => 'O', - 'О' => 'O', - 'O' => 'O', - 'Ρ' => 'P', - 'Р' => 'P', - 'P' => 'P', - 'Q' => 'Q', - 'ʀ' => 'R', - 'R' => 'R', - 'Ѕ' => 'S', - 'S' => 'S', - 'Τ' => 'T', - 'Т' => 'T', - 'T' => 'T', - 'U' => 'U', - 'Ѵ' => 'V', - 'Ⅴ' => 'V', - 'V' => 'V', - 'W' => 'W', - 'Χ' => 'X', - 'Х' => 'X', - 'Ⅹ' => 'X', - 'X' => 'X', - 'ʏ' => 'Y', - 'Υ' => 'Y', - 'Ү' => 'Y', - 'Y' => 'Y', - 'Ζ' => 'Z', - 'Z' => 'Z', - '_' => '_', - 'ɑ' => 'a', - 'а' => 'a', - 'a' => 'a', - 'Ь' => 'b', - 'b' => 'b', - 'ϲ' => 'c', - 'с' => 'c', - 'ⅽ' => 'c', - 'c' => 'c', - 'ԁ' => 'd', - 'ⅾ' => 'd', - 'd' => 'd', - 'е' => 'e', - 'e' => 'e', - 'f' => 'f', - 'ɡ' => 'g', - 'g' => 'g', - 'һ' => 'h', - 'h' => 'h', - 'ɩ' => 'i', - 'і' => 'i', - 'ⅰ' => 'i', - 'i' => 'i', - 'ј' => 'j', - 'j' => 'j', - 'k' => 'k', - 'ⅼ' => 'l', - 'l' => 'l', - 'ⅿ' => 'm', - 'm' => 'm', - 'n' => 'n', - 'ο' => 'o', - 'о' => 'o', - 'o' => 'o', - 'р' => 'p', - 'p' => 'p', - 'q' => 'q', - 'r' => 'r', - 'ѕ' => 's', - 's' => 's', - 't' => 't', - 'u' => 'u', - 'ν' => 'v', - 'ѵ' => 'v', - 'ⅴ' => 'v', - 'v' => 'v', - 'ѡ' => 'w', - 'w' => 'w', - 'х' => 'x', - 'ⅹ' => 'x', - 'x' => 'x', - 'у' => 'y', - 'y' => 'y', - 'z' => 'z', - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replace accidental usage of homoglyphs (non ascii characters) in names.', - [new CodeSample("isAnyTokenKindsFound([T_VARIABLE, T_STRING]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind([T_VARIABLE, T_STRING])) { - continue; - } - - $replaced = Preg::replaceCallback('/[^[:ascii:]]/u', static fn (array $matches): string => self::REPLACEMENTS[$matches[0]] ?? $matches[0], $token->getContent(), -1, $count); - - if ($count > 0) { - $tokens->offsetSet($index, new Token([$token->getId(), $replaced])); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/AssignNullCoalescingToCoalesceEqualFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/AssignNullCoalescingToCoalesceEqualFixer.php deleted file mode 100644 index b1c37606..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/AssignNullCoalescingToCoalesceEqualFixer.php +++ /dev/null @@ -1,71 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\Fixer\AbstractShortOperatorFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class AssignNullCoalescingToCoalesceEqualFixer extends AbstractShortOperatorFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Use the null coalescing assignment operator `??=` where possible.', - [ - new CodeSample( - "isTokenKindFound(T_COALESCE); - } - - protected function isOperatorTokenCandidate(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->isGivenKind(T_COALESCE)) { - return false; - } - - // make sure after '??' does not contain '? :' - - $nextIndex = $tokens->getNextTokenOfKind($index, ['?', ';', [T_CLOSE_TAG]]); - - return !$tokens[$nextIndex]->equals('?'); - } - - protected function getReplacementToken(Token $token): Token - { - return new Token([T_COALESCE_EQUAL, '??=']); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/BinaryOperatorSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/BinaryOperatorSpacesFixer.php deleted file mode 100644 index 5ecd14d3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/BinaryOperatorSpacesFixer.php +++ /dev/null @@ -1,951 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; -use PhpCsFixer\Utils; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * default?: 'align'|'align_by_scope'|'align_single_space'|'align_single_space_by_scope'|'align_single_space_minimal'|'align_single_space_minimal_by_scope'|'at_least_single_space'|'no_space'|'single_space'|null, - * operators?: array - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * default: 'align'|'align_by_scope'|'align_single_space'|'align_single_space_by_scope'|'align_single_space_minimal'|'align_single_space_minimal_by_scope'|'at_least_single_space'|'no_space'|'single_space'|null, - * operators: array - * } - */ -final class BinaryOperatorSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const SINGLE_SPACE = 'single_space'; - - /** - * @internal - */ - public const AT_LEAST_SINGLE_SPACE = 'at_least_single_space'; - - /** - * @internal - */ - public const NO_SPACE = 'no_space'; - - /** - * @internal - */ - public const ALIGN = 'align'; - - /** - * @internal - */ - public const ALIGN_BY_SCOPE = 'align_by_scope'; - - /** - * @internal - */ - public const ALIGN_SINGLE_SPACE = 'align_single_space'; - - /** - * @internal - */ - public const ALIGN_SINGLE_SPACE_BY_SCOPE = 'align_single_space_by_scope'; - - /** - * @internal - */ - public const ALIGN_SINGLE_SPACE_MINIMAL = 'align_single_space_minimal'; - - /** - * @internal - */ - public const ALIGN_SINGLE_SPACE_MINIMAL_BY_SCOPE = 'align_single_space_minimal_by_scope'; - - /** - * @internal - * - * @const Placeholder used as anchor for right alignment. - */ - public const ALIGN_PLACEHOLDER = "\x2 ALIGNABLE%d \x3"; - - /** - * @var list - */ - private const SUPPORTED_OPERATORS = [ - '=', - '*', - '/', - '%', - '<', - '>', - '|', - '^', - '+', - '-', - '&', - '&=', - '&&', - '||', - '.=', - '/=', - '=>', - '==', - '>=', - '===', - '!=', - '<>', - '!==', - '<=', - 'and', - 'or', - 'xor', - '-=', - '%=', - '*=', - '|=', - '+=', - '<<', - '<<=', - '>>', - '>>=', - '^=', - '**', - '**=', - '<=>', - '??', - '??=', - ]; - - /** - * @var list - */ - private const ALLOWED_VALUES = [ - self::ALIGN, - self::ALIGN_BY_SCOPE, - self::ALIGN_SINGLE_SPACE, - self::ALIGN_SINGLE_SPACE_MINIMAL, - self::ALIGN_SINGLE_SPACE_BY_SCOPE, - self::ALIGN_SINGLE_SPACE_MINIMAL_BY_SCOPE, - self::SINGLE_SPACE, - self::NO_SPACE, - self::AT_LEAST_SINGLE_SPACE, - null, - ]; - - /** - * Keep track of the deepest level ever achieved while - * parsing the code. Used later to replace alignment - * placeholders with spaces. - */ - private int $deepestLevel; - - /** - * Level counter of the current nest level. - * So one level alignments are not mixed with - * other level ones. - */ - private int $currentLevel; - - private TokensAnalyzer $tokensAnalyzer; - - /** - * @var array - */ - private array $alignOperatorTokens = []; - - /** - * @var array - */ - private array $operators = []; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Binary operators should be surrounded by space as configured.', - [ - new CodeSample( - " ['=' => 'align', 'xor' => null]] - ), - new CodeSample( - ' ['+=' => 'align_single_space']] - ), - new CodeSample( - ' ['===' => 'align_single_space_minimal']] - ), - new CodeSample( - ' ['|' => 'no_space']] - ), - new CodeSample( - ' 1, - "baaaaaaaaaaar" => 11, -]; -', - ['operators' => ['=>' => 'single_space']] - ), - new CodeSample( - ' 12, - "baaaaaaaaaaar" => 13, - - "baz" => 1, -]; -', - ['operators' => ['=>' => 'align']] - ), - new CodeSample( - ' 12, - "baaaaaaaaaaar" => 13, - - "baz" => 1, -]; -', - ['operators' => ['=>' => 'align_by_scope']] - ), - new CodeSample( - ' 12, - "baaaaaaaaaaar" => 13, - - "baz" => 1, -]; -', - ['operators' => ['=>' => 'align_single_space']] - ), - new CodeSample( - ' 12, - "baaaaaaaaaaar" => 13, - - "baz" => 1, -]; -', - ['operators' => ['=>' => 'align_single_space_by_scope']] - ), - new CodeSample( - ' 12, - "baaaaaaaaaaar" => 13, - - "baz" => 1, -]; -', - ['operators' => ['=>' => 'align_single_space_minimal']] - ), - new CodeSample( - ' 12, - "baaaaaaaaaaar" => 13, - - "baz" => 1, -]; -', - ['operators' => ['=>' => 'align_single_space_minimal_by_scope']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after ArrayIndentationFixer, ArraySyntaxFixer, AssignNullCoalescingToCoalesceEqualFixer, ListSyntaxFixer, LongToShorthandOperatorFixer, ModernizeStrposFixer, NoMultilineWhitespaceAroundDoubleArrowFixer, NoUnsetCastFixer, PowToExponentiationFixer, StandardizeNotEqualsFixer, StrictComparisonFixer. - */ - public function getPriority(): int - { - return -32; - } - - public function isCandidate(Tokens $tokens): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - $this->operators = $this->resolveOperatorsFromConfig(); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->tokensAnalyzer = new TokensAnalyzer($tokens); - - // last and first tokens cannot be an operator - for ($index = $tokens->count() - 2; $index > 0; --$index) { - if (!$this->tokensAnalyzer->isBinaryOperator($index)) { - continue; - } - - if ('=' === $tokens[$index]->getContent()) { - $isDeclare = $this->isEqualPartOfDeclareStatement($tokens, $index); - if (false === $isDeclare) { - $this->fixWhiteSpaceAroundOperator($tokens, $index); - } else { - $index = $isDeclare; // skip `declare(foo ==bar)`, see `declare_equal_normalize` - } - } else { - $this->fixWhiteSpaceAroundOperator($tokens, $index); - } - - // previous of binary operator is now never an operator / previous of declare statement cannot be an operator - --$index; - } - - if (\count($this->alignOperatorTokens) > 0) { - $this->fixAlignment($tokens, $this->alignOperatorTokens); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('default', 'Default fix strategy.')) - ->setDefault(self::SINGLE_SPACE) - ->setAllowedValues(self::ALLOWED_VALUES) - ->getOption(), - (new FixerOptionBuilder('operators', 'Dictionary of `binary operator` => `fix strategy` values that differ from the default strategy. Supported are: '.Utils::naturalLanguageJoinWithBackticks(self::SUPPORTED_OPERATORS).'.')) - ->setAllowedTypes(['array']) - ->setAllowedValues([static function (array $option): bool { - foreach ($option as $operator => $value) { - if (!\in_array($operator, self::SUPPORTED_OPERATORS, true)) { - throw new InvalidOptionsException( - \sprintf( - 'Unexpected "operators" key, expected any of %s, got "%s".', - Utils::naturalLanguageJoin(self::SUPPORTED_OPERATORS), - \gettype($operator).'#'.$operator - ) - ); - } - - if (!\in_array($value, self::ALLOWED_VALUES, true)) { - throw new InvalidOptionsException( - \sprintf( - 'Unexpected value for operator "%s", expected any of %s, got "%s".', - $operator, - Utils::naturalLanguageJoin(array_map( - static fn ($value): string => Utils::toString($value), - self::ALLOWED_VALUES - )), - \is_object($value) ? \get_class($value) : (null === $value ? 'null' : \gettype($value).'#'.$value) - ) - ); - } - } - - return true; - }]) - ->setDefault([]) - ->getOption(), - ]); - } - - private function fixWhiteSpaceAroundOperator(Tokens $tokens, int $index): void - { - $tokenContent = strtolower($tokens[$index]->getContent()); - - if (!\array_key_exists($tokenContent, $this->operators)) { - return; // not configured to be changed - } - - if (self::SINGLE_SPACE === $this->operators[$tokenContent]) { - $this->fixWhiteSpaceAroundOperatorToSingleSpace($tokens, $index); - - return; - } - - if (self::AT_LEAST_SINGLE_SPACE === $this->operators[$tokenContent]) { - $this->fixWhiteSpaceAroundOperatorToAtLeastSingleSpace($tokens, $index); - - return; - } - - if (self::NO_SPACE === $this->operators[$tokenContent]) { - $this->fixWhiteSpaceAroundOperatorToNoSpace($tokens, $index); - - return; - } - - // schedule for alignment - $this->alignOperatorTokens[$tokenContent] = $this->operators[$tokenContent]; - - if ( - self::ALIGN === $this->operators[$tokenContent] - || self::ALIGN_BY_SCOPE === $this->operators[$tokenContent] - ) { - return; - } - - // fix white space after operator - if ($tokens[$index + 1]->isWhitespace()) { - if ( - self::ALIGN_SINGLE_SPACE_MINIMAL === $this->operators[$tokenContent] - || self::ALIGN_SINGLE_SPACE_MINIMAL_BY_SCOPE === $this->operators[$tokenContent] - ) { - $tokens[$index + 1] = new Token([T_WHITESPACE, ' ']); - } - - return; - } - - $tokens->insertAt($index + 1, new Token([T_WHITESPACE, ' '])); - } - - private function fixWhiteSpaceAroundOperatorToSingleSpace(Tokens $tokens, int $index): void - { - // fix white space after operator - if ($tokens[$index + 1]->isWhitespace()) { - $content = $tokens[$index + 1]->getContent(); - if (' ' !== $content && !str_contains($content, "\n") && !$tokens[$tokens->getNextNonWhitespace($index + 1)]->isComment()) { - $tokens[$index + 1] = new Token([T_WHITESPACE, ' ']); - } - } else { - $tokens->insertAt($index + 1, new Token([T_WHITESPACE, ' '])); - } - - // fix white space before operator - if ($tokens[$index - 1]->isWhitespace()) { - $content = $tokens[$index - 1]->getContent(); - if (' ' !== $content && !str_contains($content, "\n") && !$tokens[$tokens->getPrevNonWhitespace($index - 1)]->isComment()) { - $tokens[$index - 1] = new Token([T_WHITESPACE, ' ']); - } - } else { - $tokens->insertAt($index, new Token([T_WHITESPACE, ' '])); - } - } - - private function fixWhiteSpaceAroundOperatorToAtLeastSingleSpace(Tokens $tokens, int $index): void - { - // fix white space after operator - if (!$tokens[$index + 1]->isWhitespace()) { - $tokens->insertAt($index + 1, new Token([T_WHITESPACE, ' '])); - } - - // fix white space before operator - if (!$tokens[$index - 1]->isWhitespace()) { - $tokens->insertAt($index, new Token([T_WHITESPACE, ' '])); - } - } - - private function fixWhiteSpaceAroundOperatorToNoSpace(Tokens $tokens, int $index): void - { - // fix white space after operator - if ($tokens[$index + 1]->isWhitespace()) { - $content = $tokens[$index + 1]->getContent(); - if (!str_contains($content, "\n") && !$tokens[$tokens->getNextNonWhitespace($index + 1)]->isComment()) { - $tokens->clearAt($index + 1); - } - } - - // fix white space before operator - if ($tokens[$index - 1]->isWhitespace()) { - $content = $tokens[$index - 1]->getContent(); - if (!str_contains($content, "\n") && !$tokens[$tokens->getPrevNonWhitespace($index - 1)]->isComment()) { - $tokens->clearAt($index - 1); - } - } - } - - /** - * @return false|int index of T_DECLARE where the `=` belongs to or `false` - */ - private function isEqualPartOfDeclareStatement(Tokens $tokens, int $index) - { - $prevMeaningfulIndex = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$prevMeaningfulIndex]->isGivenKind(T_STRING)) { - $prevMeaningfulIndex = $tokens->getPrevMeaningfulToken($prevMeaningfulIndex); - if ($tokens[$prevMeaningfulIndex]->equals('(')) { - $prevMeaningfulIndex = $tokens->getPrevMeaningfulToken($prevMeaningfulIndex); - if ($tokens[$prevMeaningfulIndex]->isGivenKind(T_DECLARE)) { - return $prevMeaningfulIndex; - } - } - } - - return false; - } - - /** - * @return array - */ - private function resolveOperatorsFromConfig(): array - { - $operators = []; - - if (null !== $this->configuration['default']) { - foreach (self::SUPPORTED_OPERATORS as $operator) { - $operators[$operator] = $this->configuration['default']; - } - } - - foreach ($this->configuration['operators'] as $operator => $value) { - if (null === $value) { - unset($operators[$operator]); - } else { - $operators[$operator] = $value; - } - } - - return $operators; - } - - // Alignment logic related methods - - /** - * @param array $toAlign - */ - private function fixAlignment(Tokens $tokens, array $toAlign): void - { - $this->deepestLevel = 0; - $this->currentLevel = 0; - - foreach ($toAlign as $tokenContent => $alignStrategy) { - // This fixer works partially on Tokens and partially on string representation of code. - // During the process of fixing internal state of single Token may be affected by injecting ALIGN_PLACEHOLDER to its content. - // The placeholder will be resolved by `replacePlaceholders` method by removing placeholder or changing it into spaces. - // That way of fixing the code causes disturbances in marking Token as changed - if code is perfectly valid then placeholder - // still be injected and removed, which will cause the `changed` flag to be set. - // To handle that unwanted behavior we work on clone of Tokens collection and then override original collection with fixed collection. - $tokensClone = clone $tokens; - - if ('=>' === $tokenContent) { - $this->injectAlignmentPlaceholdersForArrow($tokensClone, 0, \count($tokens)); - } else { - $this->injectAlignmentPlaceholdersDefault($tokensClone, 0, \count($tokens), $tokenContent); - } - - // for all tokens that should be aligned but do not have anything to align with, fix spacing if needed - if ( - self::ALIGN_SINGLE_SPACE === $alignStrategy - || self::ALIGN_SINGLE_SPACE_MINIMAL === $alignStrategy - || self::ALIGN_SINGLE_SPACE_BY_SCOPE === $alignStrategy - || self::ALIGN_SINGLE_SPACE_MINIMAL_BY_SCOPE === $alignStrategy - ) { - if ('=>' === $tokenContent) { - for ($index = $tokens->count() - 2; $index > 0; --$index) { - if ($tokens[$index]->isGivenKind(T_DOUBLE_ARROW)) { // always binary operator, never part of declare statement - $this->fixWhiteSpaceBeforeOperator($tokensClone, $index, $alignStrategy); - } - } - } elseif ('=' === $tokenContent) { - for ($index = $tokens->count() - 2; $index > 0; --$index) { - if ('=' === $tokens[$index]->getContent() && !$this->isEqualPartOfDeclareStatement($tokens, $index) && $this->tokensAnalyzer->isBinaryOperator($index)) { - $this->fixWhiteSpaceBeforeOperator($tokensClone, $index, $alignStrategy); - } - } - } else { - for ($index = $tokens->count() - 2; $index > 0; --$index) { - $content = $tokens[$index]->getContent(); - if (strtolower($content) === $tokenContent && $this->tokensAnalyzer->isBinaryOperator($index)) { // never part of declare statement - $this->fixWhiteSpaceBeforeOperator($tokensClone, $index, $alignStrategy); - } - } - } - } - - $tokens->setCode($this->replacePlaceholders($tokensClone, $alignStrategy, $tokenContent)); - } - } - - private function injectAlignmentPlaceholdersDefault(Tokens $tokens, int $startAt, int $endAt, string $tokenContent): void - { - $newLineFoundSinceLastPlaceholder = true; - - for ($index = $startAt; $index < $endAt; ++$index) { - $token = $tokens[$index]; - $content = $token->getContent(); - - if (str_contains($content, "\n")) { - $newLineFoundSinceLastPlaceholder = true; - } - - if ( - strtolower($content) === $tokenContent - && $this->tokensAnalyzer->isBinaryOperator($index) - && ('=' !== $content || !$this->isEqualPartOfDeclareStatement($tokens, $index)) - && $newLineFoundSinceLastPlaceholder - ) { - $tokens[$index] = new Token(\sprintf(self::ALIGN_PLACEHOLDER, $this->currentLevel).$content); - $newLineFoundSinceLastPlaceholder = false; - - continue; - } - - if ($token->isGivenKind(T_FN)) { - $from = $tokens->getNextMeaningfulToken($index); - $until = $this->tokensAnalyzer->getLastTokenIndexOfArrowFunction($index); - $this->injectAlignmentPlaceholders($tokens, $from + 1, $until - 1, $tokenContent); - $index = $until; - - continue; - } - - if ($token->isGivenKind([T_FUNCTION, T_CLASS])) { - $index = $tokens->getNextTokenOfKind($index, ['{', ';', '(']); - // We don't align `=` on multi-line definition of function parameters with default values - if ($tokens[$index]->equals('(')) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - - continue; - } - - if ($tokens[$index]->equals(';')) { - continue; - } - - // Update the token to the `{` one in order to apply the following logic - $token = $tokens[$index]; - } - - if ($token->equals('{')) { - $until = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - $this->injectAlignmentPlaceholders($tokens, $index + 1, $until - 1, $tokenContent); - $index = $until; - - continue; - } - - if ($token->equals('(')) { - $until = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $this->injectAlignmentPlaceholders($tokens, $index + 1, $until - 1, $tokenContent); - $index = $until; - - continue; - } - - if ($token->equals('[')) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_INDEX_SQUARE_BRACE, $index); - - continue; - } - - if ($token->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { - $until = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $index); - $this->injectAlignmentPlaceholders($tokens, $index + 1, $until - 1, $tokenContent); - $index = $until; - - continue; - } - } - } - - private function injectAlignmentPlaceholders(Tokens $tokens, int $from, int $until, string $tokenContent): void - { - // Only inject placeholders for multi-line code - if ($tokens->isPartialCodeMultiline($from, $until)) { - ++$this->deepestLevel; - $currentLevel = $this->currentLevel; - $this->currentLevel = $this->deepestLevel; - $this->injectAlignmentPlaceholdersDefault($tokens, $from, $until, $tokenContent); - $this->currentLevel = $currentLevel; - } - } - - private function injectAlignmentPlaceholdersForArrow(Tokens $tokens, int $startAt, int $endAt): void - { - $newLineFoundSinceLastPlaceholder = true; - $yieldFoundSinceLastPlaceholder = false; - - for ($index = $startAt; $index < $endAt; ++$index) { - /** @var Token $token */ - $token = $tokens[$index]; - $content = $token->getContent(); - - if (str_contains($content, "\n")) { - $newLineFoundSinceLastPlaceholder = true; - } - - if ($token->isGivenKind(T_YIELD)) { - $yieldFoundSinceLastPlaceholder = true; - } - - if ($token->isGivenKind(T_FN)) { - $yieldFoundSinceLastPlaceholder = false; - $from = $tokens->getNextMeaningfulToken($index); - $until = $this->tokensAnalyzer->getLastTokenIndexOfArrowFunction($index); - $this->injectArrayAlignmentPlaceholders($tokens, $from + 1, $until - 1); - $index = $until; - - continue; - } - - if ($token->isGivenKind(T_ARRAY)) { // don't use "$tokens->isArray()" here, short arrays are handled in the next case - $yieldFoundSinceLastPlaceholder = false; - $from = $tokens->getNextMeaningfulToken($index); - $until = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $from); - $index = $until; - - $this->injectArrayAlignmentPlaceholders($tokens, $from + 1, $until - 1); - - continue; - } - - if ($token->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { - $yieldFoundSinceLastPlaceholder = false; - $from = $index; - $until = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $from); - $index = $until; - - $this->injectArrayAlignmentPlaceholders($tokens, $from + 1, $until - 1); - - continue; - } - - // no need to analyze for `isBinaryOperator` (always true), nor if part of declare statement (not valid PHP) - // there is also no need to analyse the second arrow of a line - if ($token->isGivenKind(T_DOUBLE_ARROW) && $newLineFoundSinceLastPlaceholder) { - if ($yieldFoundSinceLastPlaceholder) { - ++$this->deepestLevel; - ++$this->currentLevel; - } - $tokenContent = \sprintf(self::ALIGN_PLACEHOLDER, $this->currentLevel).$token->getContent(); - - $nextToken = $tokens[$index + 1]; - if (!$nextToken->isWhitespace()) { - $tokenContent .= ' '; - } elseif ($nextToken->isWhitespace(" \t")) { - $tokens[$index + 1] = new Token([T_WHITESPACE, ' ']); - } - - $tokens[$index] = new Token([T_DOUBLE_ARROW, $tokenContent]); - $newLineFoundSinceLastPlaceholder = false; - $yieldFoundSinceLastPlaceholder = false; - - continue; - } - - if ($token->equals(';')) { - ++$this->deepestLevel; - ++$this->currentLevel; - - continue; - } - - if ($token->equals(',')) { - for ($i = $index; $i < $endAt - 1; ++$i) { - if (str_contains($tokens[$i - 1]->getContent(), "\n")) { - $newLineFoundSinceLastPlaceholder = true; - - break; - } - - if ($tokens[$i + 1]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN])) { - $arrayStartIndex = $tokens[$i + 1]->isGivenKind(T_ARRAY) - ? $tokens->getNextMeaningfulToken($i + 1) - : $i + 1; - $blockType = Tokens::detectBlockType($tokens[$arrayStartIndex]); - $arrayEndIndex = $tokens->findBlockEnd($blockType['type'], $arrayStartIndex); - - if ($tokens->isPartialCodeMultiline($arrayStartIndex, $arrayEndIndex)) { - break; - } - } - - ++$index; - } - } - - if ($token->equals('{')) { - $until = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - $this->injectArrayAlignmentPlaceholders($tokens, $index + 1, $until - 1); - $index = $until; - - continue; - } - - if ($token->equals('(')) { - $until = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $this->injectArrayAlignmentPlaceholders($tokens, $index + 1, $until - 1); - $index = $until; - - continue; - } - } - } - - private function injectArrayAlignmentPlaceholders(Tokens $tokens, int $from, int $until): void - { - // Only inject placeholders for multi-line arrays - if ($tokens->isPartialCodeMultiline($from, $until)) { - ++$this->deepestLevel; - $currentLevel = $this->currentLevel; - $this->currentLevel = $this->deepestLevel; - $this->injectAlignmentPlaceholdersForArrow($tokens, $from, $until); - $this->currentLevel = $currentLevel; - } - } - - private function fixWhiteSpaceBeforeOperator(Tokens $tokens, int $index, string $alignStrategy): void - { - // fix white space after operator is not needed as BinaryOperatorSpacesFixer took care of this (if strategy is _not_ ALIGN) - if (!$tokens[$index - 1]->isWhitespace()) { - $tokens->insertAt($index, new Token([T_WHITESPACE, ' '])); - - return; - } - - if ( - self::ALIGN_SINGLE_SPACE_MINIMAL !== $alignStrategy && self::ALIGN_SINGLE_SPACE_MINIMAL_BY_SCOPE !== $alignStrategy - || $tokens[$tokens->getPrevNonWhitespace($index - 1)]->isComment() - ) { - return; - } - - $content = $tokens[$index - 1]->getContent(); - if (' ' !== $content && !str_contains($content, "\n")) { - $tokens[$index - 1] = new Token([T_WHITESPACE, ' ']); - } - } - - /** - * Look for group of placeholders and provide vertical alignment. - */ - private function replacePlaceholders(Tokens $tokens, string $alignStrategy, string $tokenContent): string - { - $tmpCode = $tokens->generateCode(); - - for ($j = 0; $j <= $this->deepestLevel; ++$j) { - $placeholder = \sprintf(self::ALIGN_PLACEHOLDER, $j); - - if (!str_contains($tmpCode, $placeholder)) { - continue; - } - - $lines = explode("\n", $tmpCode); - $groups = []; - $groupIndex = 0; - $groups[$groupIndex] = []; - - foreach ($lines as $index => $line) { - if (substr_count($line, $placeholder) > 0) { - $groups[$groupIndex][] = $index; - } elseif ( - self::ALIGN_BY_SCOPE !== $alignStrategy - && self::ALIGN_SINGLE_SPACE_BY_SCOPE !== $alignStrategy - && self::ALIGN_SINGLE_SPACE_MINIMAL_BY_SCOPE !== $alignStrategy - ) { - ++$groupIndex; - $groups[$groupIndex] = []; - } - } - - foreach ($groups as $group) { - if (\count($group) < 1) { - continue; - } - - if (self::ALIGN !== $alignStrategy) { - // move placeholders to match strategy - foreach ($group as $index) { - $currentPosition = strpos($lines[$index], $placeholder); - $before = substr($lines[$index], 0, $currentPosition); - - if ( - self::ALIGN_SINGLE_SPACE === $alignStrategy - || self::ALIGN_SINGLE_SPACE_BY_SCOPE === $alignStrategy - ) { - if (!str_ends_with($before, ' ')) { // if last char of before-content is not ' '; add it - $before .= ' '; - } - } elseif ( - self::ALIGN_SINGLE_SPACE_MINIMAL === $alignStrategy - || self::ALIGN_SINGLE_SPACE_MINIMAL_BY_SCOPE === $alignStrategy - ) { - if (!Preg::match('/^\h+$/', $before)) { // if indent; do not move, leave to other fixer - $before = rtrim($before).' '; - } - } - - $lines[$index] = $before.substr($lines[$index], $currentPosition); - } - } - - $rightmostSymbol = 0; - foreach ($group as $index) { - $rightmostSymbol = max($rightmostSymbol, mb_strpos($lines[$index], $placeholder)); - } - - foreach ($group as $index) { - $line = $lines[$index]; - $currentSymbol = mb_strpos($line, $placeholder); - $delta = abs($rightmostSymbol - $currentSymbol); - - if ($delta > 0) { - $line = str_replace($placeholder, str_repeat(' ', $delta).$placeholder, $line); - $lines[$index] = $line; - } - } - } - - $tmpCode = str_replace($placeholder, '', implode("\n", $lines)); - } - - return $tmpCode; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ConcatSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ConcatSpaceFixer.php deleted file mode 100644 index c9d962c3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ConcatSpaceFixer.php +++ /dev/null @@ -1,160 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * spacing?: 'none'|'one' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * spacing: 'none'|'one' - * } - */ -final class ConcatSpaceFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Concatenation should be spaced according to configuration.', - [ - new CodeSample( - " 'none'] - ), - new CodeSample( - " 'one'] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after NoUnneededControlParenthesesFixer, SingleLineThrowFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound('.'); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if ($tokens[$index]->equals('.')) { - if ('one' === $this->configuration['spacing']) { - $this->fixConcatenationToSingleSpace($tokens, $index); - } else { - $this->fixConcatenationToNoSpace($tokens, $index); - } - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('spacing', 'Spacing to apply around concatenation operator.')) - ->setAllowedValues(['one', 'none']) - ->setDefault('none') - ->getOption(), - ]); - } - - /** - * @param int $index index of concatenation '.' token - */ - private function fixConcatenationToNoSpace(Tokens $tokens, int $index): void - { - $prevNonWhitespaceToken = $tokens[$tokens->getPrevNonWhitespace($index)]; - - if (!$prevNonWhitespaceToken->isGivenKind([T_LNUMBER, T_COMMENT, T_DOC_COMMENT]) || str_starts_with($prevNonWhitespaceToken->getContent(), '/*')) { - $tokens->removeLeadingWhitespace($index, " \t"); - } - - if (!$tokens[$tokens->getNextNonWhitespace($index)]->isGivenKind([T_LNUMBER, T_COMMENT, T_DOC_COMMENT])) { - $tokens->removeTrailingWhitespace($index, " \t"); - } - } - - /** - * @param int $index index of concatenation '.' token - */ - private function fixConcatenationToSingleSpace(Tokens $tokens, int $index): void - { - $this->fixWhiteSpaceAroundConcatToken($tokens, $index, 1); - $this->fixWhiteSpaceAroundConcatToken($tokens, $index, -1); - } - - /** - * @param int $index index of concatenation '.' token - * @param int $offset 1 or -1 - */ - private function fixWhiteSpaceAroundConcatToken(Tokens $tokens, int $index, int $offset): void - { - if (-1 !== $offset && 1 !== $offset) { - throw new \InvalidArgumentException(\sprintf( - 'Expected `-1|1` for "$offset", got "%s"', - $offset - )); - } - - $offsetIndex = $index + $offset; - - if (!$tokens[$offsetIndex]->isWhitespace()) { - $tokens->insertAt($index + (1 === $offset ? 1 : 0), new Token([T_WHITESPACE, ' '])); - - return; - } - - if (str_contains($tokens[$offsetIndex]->getContent(), "\n")) { - return; - } - - if ($tokens[$index + $offset * 2]->isComment()) { - return; - } - - $tokens[$offsetIndex] = new Token([T_WHITESPACE, ' ']); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/IncrementStyleFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/IncrementStyleFixer.php deleted file mode 100644 index bc5de5bd..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/IncrementStyleFixer.php +++ /dev/null @@ -1,179 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\Fixer\AbstractIncrementOperatorFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Gregor Harlan - * @author Kuba Werłos - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * style?: 'post'|'pre' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * style: 'post'|'pre' - * } - */ -final class IncrementStyleFixer extends AbstractIncrementOperatorFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const STYLE_PRE = 'pre'; - - /** - * @internal - */ - public const STYLE_POST = 'post'; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Pre- or post-increment and decrement operators should be used if possible.', - [ - new CodeSample(" self::STYLE_POST] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. - * Must run after StandardizeIncrementFixer. - */ - public function getPriority(): int - { - return 15; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_INC, T_DEC]); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('style', 'Whether to use pre- or post-increment and decrement operators.')) - ->setAllowedValues([self::STYLE_PRE, self::STYLE_POST]) - ->setDefault(self::STYLE_PRE) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - for ($index = $tokens->count() - 1; 0 <= $index; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind([T_INC, T_DEC])) { - continue; - } - - if (self::STYLE_PRE === $this->configuration['style'] && $tokensAnalyzer->isUnarySuccessorOperator($index)) { - $nextToken = $tokens[$tokens->getNextMeaningfulToken($index)]; - - if (!$nextToken->equalsAny([';', ')'])) { - continue; - } - - $startIndex = $this->findStart($tokens, $index); - $prevToken = $tokens[$tokens->getPrevMeaningfulToken($startIndex)]; - - if ($prevToken->equalsAny([';', '{', '}', [T_OPEN_TAG], ')'])) { - $tokens->clearAt($index); - $tokens->insertAt($startIndex, clone $token); - } - } elseif (self::STYLE_POST === $this->configuration['style'] && $tokensAnalyzer->isUnaryPredecessorOperator($index)) { - $prevToken = $tokens[$tokens->getPrevMeaningfulToken($index)]; - - if (!$prevToken->equalsAny([';', '{', '}', [T_OPEN_TAG], ')'])) { - continue; - } - - $endIndex = $this->findEnd($tokens, $index); - $nextToken = $tokens[$tokens->getNextMeaningfulToken($endIndex)]; - - if ($nextToken->equalsAny([';', ')'])) { - $tokens->clearAt($index); - $tokens->insertAt($tokens->getNextNonWhitespace($endIndex), clone $token); - } - } - } - } - - private function findEnd(Tokens $tokens, int $index): int - { - $nextIndex = $tokens->getNextMeaningfulToken($index); - $nextToken = $tokens[$nextIndex]; - - while ($nextToken->equalsAny([ - '$', - '(', - '[', - [CT::T_DYNAMIC_PROP_BRACE_OPEN], - [CT::T_DYNAMIC_VAR_BRACE_OPEN], - [CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN], - [T_NS_SEPARATOR], - [T_STATIC], - [T_STRING], - [T_VARIABLE], - ])) { - $blockType = Tokens::detectBlockType($nextToken); - - if (null !== $blockType) { - $nextIndex = $tokens->findBlockEnd($blockType['type'], $nextIndex); - } - - $index = $nextIndex; - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - $nextToken = $tokens[$nextIndex]; - } - - if ($nextToken->isObjectOperator()) { - return $this->findEnd($tokens, $nextIndex); - } - - if ($nextToken->isGivenKind(T_PAAMAYIM_NEKUDOTAYIM)) { - return $this->findEnd($tokens, $tokens->getNextMeaningfulToken($nextIndex)); - } - - return $index; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LogicalOperatorsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LogicalOperatorsFixer.php deleted file mode 100644 index 5e05aac6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LogicalOperatorsFixer.php +++ /dev/null @@ -1,67 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Haralan Dobrev - */ -final class LogicalOperatorsFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Use `&&` and `||` logical operators instead of `and` and `or`.', - [ - new CodeSample( - 'isAnyTokenKindsFound([T_LOGICAL_AND, T_LOGICAL_OR]); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if ($token->isGivenKind(T_LOGICAL_AND)) { - $tokens[$index] = new Token([T_BOOLEAN_AND, '&&']); - } elseif ($token->isGivenKind(T_LOGICAL_OR)) { - $tokens[$index] = new Token([T_BOOLEAN_OR, '||']); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LongToShorthandOperatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LongToShorthandOperatorFixer.php deleted file mode 100644 index 23099621..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/LongToShorthandOperatorFixer.php +++ /dev/null @@ -1,140 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\Fixer\AbstractShortOperatorFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -final class LongToShorthandOperatorFixer extends AbstractShortOperatorFixer -{ - /** - * @var array - */ - private const OPERATORS = [ - '+' => [T_PLUS_EQUAL, '+='], - '-' => [T_MINUS_EQUAL, '-='], - '*' => [T_MUL_EQUAL, '*='], - '/' => [T_DIV_EQUAL, '/='], - '&' => [T_AND_EQUAL, '&='], - '.' => [T_CONCAT_EQUAL, '.='], - '%' => [T_MOD_EQUAL, '%='], - '|' => [T_OR_EQUAL, '|='], - '^' => [T_XOR_EQUAL, '^='], - ]; - - /** - * @var list - */ - private array $operatorTypes; - - private TokensAnalyzer $tokensAnalyzer; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Shorthand notation for operators should be used if possible.', - [ - new CodeSample("isAnyTokenKindsFound(array_keys(self::OPERATORS))) { - return true; - } - - // @TODO: drop condition when PHP 8.0 is required and the "&" issues went away - return \defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG'); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->operatorTypes = array_keys(self::OPERATORS); - $this->tokensAnalyzer = new TokensAnalyzer($tokens); - - parent::applyFix($file, $tokens); - } - - protected function isOperatorTokenCandidate(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->equalsAny($this->operatorTypes)) { - return false; - } - - while (null !== $index) { - $index = $tokens->getNextMeaningfulToken($index); - $otherToken = $tokens[$index]; - - if ($otherToken->equalsAny([';', [T_CLOSE_TAG]])) { - return true; - } - - // fast precedence check - if ($otherToken->equals('?') || $otherToken->isGivenKind(T_INSTANCEOF)) { - return false; - } - - $blockType = Tokens::detectBlockType($otherToken); - - if (null !== $blockType) { - if (false === $blockType['isStart']) { - return true; - } - - $index = $tokens->findBlockEnd($blockType['type'], $index); - - continue; - } - - // precedence check - if ($this->tokensAnalyzer->isBinaryOperator($index)) { - return false; - } - } - - return false; // unreachable, but keeps SCA happy - } - - protected function getReplacementToken(Token $token): Token - { - \assert(isset(self::OPERATORS[$token->getContent()])); // for PHPStan - - return new Token(self::OPERATORS[$token->getContent()]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithBracesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithBracesFixer.php deleted file mode 100644 index 865f6897..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithBracesFixer.php +++ /dev/null @@ -1,103 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @author Dariusz Rumiński - * - * @deprecated - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * anonymous_class?: bool, - * named_class?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * anonymous_class: bool, - * named_class: bool - * } - */ -final class NewWithBracesFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private NewWithParenthesesFixer $newWithParenthesesFixer; - - public function __construct() - { - $this->newWithParenthesesFixer = new NewWithParenthesesFixer(); - - parent::__construct(); - } - - public function getDefinition(): FixerDefinitionInterface - { - $fixerDefinition = $this->newWithParenthesesFixer->getDefinition(); - - return new FixerDefinition( - 'All instances created with `new` keyword must (not) be followed by braces.', - $fixerDefinition->getCodeSamples(), - $fixerDefinition->getDescription(), - $fixerDefinition->getRiskyDescription(), - ); - } - - /** - * {@inheritdoc} - * - * Must run before ClassDefinitionFixer. - */ - public function getPriority(): int - { - return $this->newWithParenthesesFixer->getPriority(); - } - - public function getSuccessorsNames(): array - { - return [ - $this->newWithParenthesesFixer->getName(), - ]; - } - - /** - * @param _AutogeneratedInputConfiguration $configuration - */ - protected function configurePreNormalisation(array $configuration): void - { - $this->newWithParenthesesFixer->configure($configuration); - } - - protected function createProxyFixers(): array - { - return [ - $this->newWithParenthesesFixer, - ]; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return $this->newWithParenthesesFixer->createConfigurationDefinition(); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithParenthesesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithParenthesesFixer.php deleted file mode 100644 index f7f1af3e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NewWithParenthesesFixer.php +++ /dev/null @@ -1,216 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * anonymous_class?: bool, - * named_class?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * anonymous_class: bool, - * named_class: bool - * } - */ -final class NewWithParenthesesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'All instances created with `new` keyword must (not) be followed by parentheses.', - [ - new CodeSample(" false] - ), - new CodeSample( - " false] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before ClassDefinitionFixer. - */ - public function getPriority(): int - { - return 37; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_NEW); - } - - /** @protected */ - public function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('named_class', 'Whether named classes should be followed by parentheses.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('anonymous_class', 'Whether anonymous classes should be followed by parentheses.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) // @TODO 4.0: set to `false` - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - static $nextTokenKinds = null; - - if (null === $nextTokenKinds) { - $nextTokenKinds = [ - '?', - ';', - ',', - '(', - ')', - '[', - ']', - ':', - '<', - '>', - '+', - '-', - '*', - '/', - '%', - '&', - '^', - '|', - [T_CLASS], - [T_IS_SMALLER_OR_EQUAL], - [T_IS_GREATER_OR_EQUAL], - [T_IS_EQUAL], - [T_IS_NOT_EQUAL], - [T_IS_IDENTICAL], - [T_IS_NOT_IDENTICAL], - [T_CLOSE_TAG], - [T_LOGICAL_AND], - [T_LOGICAL_OR], - [T_LOGICAL_XOR], - [T_BOOLEAN_AND], - [T_BOOLEAN_OR], - [T_SL], - [T_SR], - [T_INSTANCEOF], - [T_AS], - [T_DOUBLE_ARROW], - [T_POW], - [T_SPACESHIP], - [CT::T_ARRAY_SQUARE_BRACE_OPEN], - [CT::T_ARRAY_SQUARE_BRACE_CLOSE], - [CT::T_BRACE_CLASS_INSTANTIATION_OPEN], - [CT::T_BRACE_CLASS_INSTANTIATION_CLOSE], - ]; - - if (\defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG')) { // @TODO: drop condition when PHP 8.1+ is required - $nextTokenKinds[] = [T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG]; - $nextTokenKinds[] = [T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG]; - } - } - - for ($index = $tokens->count() - 3; $index > 0; --$index) { - if (!$tokens[$index]->isGivenKind(T_NEW)) { - continue; - } - - $nextIndex = $tokens->getNextTokenOfKind($index, $nextTokenKinds); - - // new anonymous class definition - if ($tokens[$nextIndex]->isGivenKind(T_CLASS)) { - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - - if (true === $this->configuration['anonymous_class']) { - $this->ensureParenthesesAt($tokens, $nextIndex); - } else { - $this->ensureNoParenthesesAt($tokens, $nextIndex); - } - - continue; - } - - // entrance into array index syntax - need to look for exit - - while ($tokens[$nextIndex]->equals('[') || $tokens[$nextIndex]->isGivenKind(CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN)) { - $nextIndex = $tokens->findBlockEnd(Tokens::detectBlockType($tokens[$nextIndex])['type'], $nextIndex); - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - } - - if (true === $this->configuration['named_class']) { - $this->ensureParenthesesAt($tokens, $nextIndex); - } else { - $this->ensureNoParenthesesAt($tokens, $nextIndex); - } - } - } - - private function ensureParenthesesAt(Tokens $tokens, int $index): void - { - $token = $tokens[$index]; - - if (!$token->equals('(') && !$token->isObjectOperator()) { - $tokens->insertAt( - $tokens->getPrevMeaningfulToken($index) + 1, - [new Token('('), new Token(')')] - ); - } - } - - private function ensureNoParenthesesAt(Tokens $tokens, int $index): void - { - if (!$tokens[$index]->equals('(')) { - return; - } - - $closingIndex = $tokens->getNextMeaningfulToken($index); - - // constructor has arguments - parentheses can not be removed - if (!$tokens[$closingIndex]->equals(')')) { - return; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($closingIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoSpaceAroundDoubleColonFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoSpaceAroundDoubleColonFixer.php deleted file mode 100644 index d897fff5..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoSpaceAroundDoubleColonFixer.php +++ /dev/null @@ -1,73 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoSpaceAroundDoubleColonFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There must be no space around double colons (also called Scope Resolution Operator or Paamayim Nekudotayim).', - [new CodeSample("isTokenKindFound(T_DOUBLE_COLON); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 2; $index > 1; --$index) { - if ($tokens[$index]->isGivenKind(T_DOUBLE_COLON)) { - $this->removeSpace($tokens, $index, 1); - $this->removeSpace($tokens, $index, -1); - } - } - } - - /** - * @param -1|1 $direction - */ - private function removeSpace(Tokens $tokens, int $index, int $direction): void - { - if (!$tokens[$index + $direction]->isWhitespace()) { - return; - } - - if ($tokens[$tokens->getNonWhitespaceSibling($index, $direction)]->isComment()) { - return; - } - - $tokens->clearAt($index + $direction); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessConcatOperatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessConcatOperatorFixer.php deleted file mode 100644 index f42196d2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessConcatOperatorFixer.php +++ /dev/null @@ -1,375 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @phpstan-type _ConcatOperandType array{ - * start: int, - * end: int, - * type: self::STR_*, - * } - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * juggle_simple_strings?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * juggle_simple_strings: bool - * } - */ -final class NoUselessConcatOperatorFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const STR_DOUBLE_QUOTE = 0; - private const STR_DOUBLE_QUOTE_VAR = 1; - private const STR_SINGLE_QUOTE = 2; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should not be useless concat operations.', - [ - new CodeSample(" true]), - ], - ); - } - - /** - * {@inheritdoc} - * - * Must run before DateTimeCreateFromFormatCallFixer, EregToPregFixer, PhpUnitDedicateAssertInternalTypeFixer, RegularCallableCallFixer, SetTypeToCastFixer. - * Must run after ExplicitStringVariableFixer, NoBinaryStringFixer, SingleQuoteFixer. - */ - public function getPriority(): int - { - return 5; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound('.') && $tokens->isAnyTokenKindsFound([T_CONSTANT_ENCAPSED_STRING, '"']); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index > 0; --$index) { - if (!$tokens[$index]->equals('.')) { - continue; - } - - $nextMeaningfulTokenIndex = $tokens->getNextMeaningfulToken($index); - - if ($this->containsLinebreak($tokens, $index, $nextMeaningfulTokenIndex)) { - continue; - } - - $secondOperand = $this->getConcatOperandType($tokens, $nextMeaningfulTokenIndex, 1); - - if (null === $secondOperand) { - continue; - } - - $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($index); - - if ($this->containsLinebreak($tokens, $prevMeaningfulTokenIndex, $index)) { - continue; - } - - $firstOperand = $this->getConcatOperandType($tokens, $prevMeaningfulTokenIndex, -1); - - if (null === $firstOperand) { - continue; - } - - $this->fixConcatOperation($tokens, $firstOperand, $index, $secondOperand); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('juggle_simple_strings', 'Allow for simple string quote juggling if it results in more concat-operations merges.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - /** - * @param _ConcatOperandType $firstOperand - * @param _ConcatOperandType $secondOperand - */ - private function fixConcatOperation(Tokens $tokens, array $firstOperand, int $concatIndex, array $secondOperand): void - { - // if both operands are of the same type then these operands can always be merged - - if ( - (self::STR_DOUBLE_QUOTE === $firstOperand['type'] && self::STR_DOUBLE_QUOTE === $secondOperand['type']) - || (self::STR_SINGLE_QUOTE === $firstOperand['type'] && self::STR_SINGLE_QUOTE === $secondOperand['type']) - ) { - $this->mergeConstantEscapedStringOperands($tokens, $firstOperand, $concatIndex, $secondOperand); - - return; - } - - if (self::STR_DOUBLE_QUOTE_VAR === $firstOperand['type'] && self::STR_DOUBLE_QUOTE_VAR === $secondOperand['type']) { - if ($this->operandsCanNotBeMerged($tokens, $firstOperand, $secondOperand)) { - return; - } - - $this->mergeConstantEscapedStringVarOperands($tokens, $firstOperand, $concatIndex, $secondOperand); - - return; - } - - // if any is double and the other is not, check for simple other, than merge with " - - $operands = [ - [$firstOperand, $secondOperand], - [$secondOperand, $firstOperand], - ]; - - foreach ($operands as $operandPair) { - [$operand1, $operand2] = $operandPair; - - if (self::STR_DOUBLE_QUOTE_VAR === $operand1['type'] && self::STR_DOUBLE_QUOTE === $operand2['type']) { - if ($this->operandsCanNotBeMerged($tokens, $operand1, $operand2)) { - return; - } - - $this->mergeConstantEscapedStringVarOperands($tokens, $firstOperand, $concatIndex, $secondOperand); - - return; - } - - if (false === $this->configuration['juggle_simple_strings']) { - continue; - } - - if (self::STR_DOUBLE_QUOTE === $operand1['type'] && self::STR_SINGLE_QUOTE === $operand2['type']) { - $operantContent = $tokens[$operand2['start']]->getContent(); - - if ($this->isSimpleQuotedStringContent($operantContent)) { - $this->mergeConstantEscapedStringOperands($tokens, $firstOperand, $concatIndex, $secondOperand); - } - - return; - } - - if (self::STR_DOUBLE_QUOTE_VAR === $operand1['type'] && self::STR_SINGLE_QUOTE === $operand2['type']) { - $operantContent = $tokens[$operand2['start']]->getContent(); - - if ($this->isSimpleQuotedStringContent($operantContent)) { - if ($this->operandsCanNotBeMerged($tokens, $operand1, $operand2)) { - return; - } - - $this->mergeConstantEscapedStringVarOperands($tokens, $firstOperand, $concatIndex, $secondOperand); - } - - return; - } - } - } - - /** - * @param -1|1 $direction - * - * @return null|_ConcatOperandType - */ - private function getConcatOperandType(Tokens $tokens, int $index, int $direction): ?array - { - if ($tokens[$index]->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { - $firstChar = $tokens[$index]->getContent(); - - if ('b' === $firstChar[0] || 'B' === $firstChar[0]) { - return null; // we don't care about these, priorities are set to do deal with these cases - } - - return [ - 'start' => $index, - 'end' => $index, - 'type' => '"' === $firstChar[0] ? self::STR_DOUBLE_QUOTE : self::STR_SINGLE_QUOTE, - ]; - } - - if ($tokens[$index]->equals('"')) { - $end = $tokens->getTokenOfKindSibling($index, $direction, ['"']); - - return [ - 'start' => 1 === $direction ? $index : $end, - 'end' => 1 === $direction ? $end : $index, - 'type' => self::STR_DOUBLE_QUOTE_VAR, - ]; - } - - return null; - } - - /** - * @param _ConcatOperandType $firstOperand - * @param _ConcatOperandType $secondOperand - */ - private function mergeConstantEscapedStringOperands( - Tokens $tokens, - array $firstOperand, - int $concatOperatorIndex, - array $secondOperand - ): void { - $quote = self::STR_DOUBLE_QUOTE === $firstOperand['type'] || self::STR_DOUBLE_QUOTE === $secondOperand['type'] ? '"' : "'"; - $firstOperandTokenContent = $tokens[$firstOperand['start']]->getContent(); - $secondOperandTokenContent = $tokens[$secondOperand['start']]->getContent(); - - $tokens[$firstOperand['start']] = new Token( - [ - T_CONSTANT_ENCAPSED_STRING, - $quote.substr($firstOperandTokenContent, 1, -1).substr($secondOperandTokenContent, 1, -1).$quote, - ], - ); - - $this->clearConcatAndAround($tokens, $concatOperatorIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($secondOperand['start']); - } - - /** - * @param _ConcatOperandType $firstOperand - * @param _ConcatOperandType $secondOperand - */ - private function mergeConstantEscapedStringVarOperands( - Tokens $tokens, - array $firstOperand, - int $concatOperatorIndex, - array $secondOperand - ): void { - // build up the new content - $newContent = ''; - - foreach ([$firstOperand, $secondOperand] as $operant) { - $operandContent = ''; - - for ($i = $operant['start']; $i <= $operant['end'];) { - $operandContent .= $tokens[$i]->getContent(); - $i = $tokens->getNextMeaningfulToken($i); - } - - $newContent .= substr($operandContent, 1, -1); - } - - // remove tokens making up the concat statement - - for ($i = $secondOperand['end']; $i >= $secondOperand['start'];) { - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - $i = $tokens->getPrevMeaningfulToken($i); - } - - $this->clearConcatAndAround($tokens, $concatOperatorIndex); - - for ($i = $firstOperand['end']; $i > $firstOperand['start'];) { - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - $i = $tokens->getPrevMeaningfulToken($i); - } - - // insert new tokens based on the new content - - $newTokens = Tokens::fromCode('overrideRange($firstOperand['start'], $firstOperand['start'], $insertTokens); - } - - private function clearConcatAndAround(Tokens $tokens, int $concatOperatorIndex): void - { - if ($tokens[$concatOperatorIndex + 1]->isWhitespace()) { - $tokens->clearTokenAndMergeSurroundingWhitespace($concatOperatorIndex + 1); - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($concatOperatorIndex); - - if ($tokens[$concatOperatorIndex - 1]->isWhitespace()) { - $tokens->clearTokenAndMergeSurroundingWhitespace($concatOperatorIndex - 1); - } - } - - private function isSimpleQuotedStringContent(string $candidate): bool - { - return !Preg::match('#[\$"\'\\\]#', substr($candidate, 1, -1)); - } - - private function containsLinebreak(Tokens $tokens, int $startIndex, int $endIndex): bool - { - for ($i = $endIndex; $i > $startIndex; --$i) { - if (Preg::match('/\R/', $tokens[$i]->getContent())) { - return true; - } - } - - return false; - } - - /** - * @param _ConcatOperandType $firstOperand - * @param _ConcatOperandType $secondOperand - */ - private function operandsCanNotBeMerged(Tokens $tokens, array $firstOperand, array $secondOperand): bool - { - // If the first operand does not end with a variable, no variables would be broken by concatenation. - if (self::STR_DOUBLE_QUOTE_VAR !== $firstOperand['type']) { - return false; - } - if (!$tokens[$firstOperand['end'] - 1]->isGivenKind(T_VARIABLE)) { - return false; - } - - $allowedPatternsForSecondOperand = [ - '/^ .*/', // e.g. " foo", ' bar', " $baz" - '/^-(?!\>)/', // e.g. "-foo", '-bar', "-$baz" - ]; - - // If the first operand ends with a variable, the second operand should match one of the allowed patterns. - // Otherwise, the concatenation can break a variable in the first operand. - foreach ($allowedPatternsForSecondOperand as $allowedPattern) { - $secondOperandInnerContent = substr($tokens->generatePartialCode($secondOperand['start'], $secondOperand['end']), 1, -1); - - if (Preg::match($allowedPattern, $secondOperandInnerContent)) { - return false; - } - } - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessNullsafeOperatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessNullsafeOperatorFixer.php deleted file mode 100644 index 2754e152..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NoUselessNullsafeOperatorFixer.php +++ /dev/null @@ -1,73 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoUselessNullsafeOperatorFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should not be useless Null-safe operator `?->` used.', - [ - new VersionSpecificCodeSample( - 'parentMethod(); - } -} -', - new VersionSpecification(8_00_00) - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return \PHP_VERSION_ID >= 8_00_00 && $tokens->isAllTokenKindsFound([T_VARIABLE, T_NULLSAFE_OBJECT_OPERATOR]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if (!$tokens[$index]->isGivenKind(T_NULLSAFE_OBJECT_OPERATOR)) { - continue; - } - - $nullsafeObjectOperatorIndex = $index; - $index = $tokens->getPrevMeaningfulToken($index); - - if (!$tokens[$index]->isGivenKind(T_VARIABLE)) { - continue; - } - - if ('$this' !== strtolower($tokens[$index]->getContent())) { - continue; - } - - $tokens[$nullsafeObjectOperatorIndex] = new Token([T_OBJECT_OPERATOR, '->']); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSpaceFixer.php deleted file mode 100644 index f40dcc22..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSpaceFixer.php +++ /dev/null @@ -1,75 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Javier Spagnoletti - */ -final class NotOperatorWithSpaceFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Logical NOT operators (`!`) should have leading and trailing whitespaces.', - [new CodeSample( - 'isTokenKindFound('!'); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if ($token->equals('!')) { - if (!$tokens[$index + 1]->isWhitespace()) { - $tokens->insertAt($index + 1, new Token([T_WHITESPACE, ' '])); - } - - if (!$tokens[$index - 1]->isWhitespace()) { - $tokens->insertAt($index, new Token([T_WHITESPACE, ' '])); - } - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSuccessorSpaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSuccessorSpaceFixer.php deleted file mode 100644 index bf228b52..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/NotOperatorWithSuccessorSpaceFixer.php +++ /dev/null @@ -1,68 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Javier Spagnoletti - */ -final class NotOperatorWithSuccessorSpaceFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Logical NOT operators (`!`) should have one trailing whitespace.', - [new CodeSample( - 'isTokenKindFound('!'); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - $token = $tokens[$index]; - - if ($token->equals('!')) { - $tokens->ensureWhitespaceAtIndex($index + 1, 0, ' '); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixer.php deleted file mode 100644 index fe6e7ac9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixer.php +++ /dev/null @@ -1,62 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Fabien Potencier - * @author Dariusz Rumiński - */ -final class ObjectOperatorWithoutWhitespaceFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should not be space before or after object operators `->` and `?->`.', - [new CodeSample(" b;\n")] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(Token::getObjectOperatorKinds()); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - // [Structure] there should not be space before or after "->" or "?->" - foreach ($tokens as $index => $token) { - if (!$token->isObjectOperator()) { - continue; - } - - // clear whitespace before -> - if ($tokens[$index - 1]->isWhitespace(" \t") && !$tokens[$index - 2]->isComment()) { - $tokens->clearAt($index - 1); - } - - // clear whitespace after -> - if ($tokens[$index + 1]->isWhitespace(" \t") && !$tokens[$index + 2]->isComment()) { - $tokens->clearAt($index + 1); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/OperatorLinebreakFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/OperatorLinebreakFixer.php deleted file mode 100644 index fdec2fb1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/OperatorLinebreakFixer.php +++ /dev/null @@ -1,292 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\AlternativeSyntaxAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\GotoLabelAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\ReferenceAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\SwitchAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * only_booleans?: bool, - * position?: 'beginning'|'end' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * only_booleans: bool, - * position: 'beginning'|'end' - * } - */ -final class OperatorLinebreakFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const BOOLEAN_OPERATORS = [[T_BOOLEAN_AND], [T_BOOLEAN_OR], [T_LOGICAL_AND], [T_LOGICAL_OR], [T_LOGICAL_XOR]]; - - private string $position = 'beginning'; - - /** - * @var list - */ - private array $operators = []; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Operators - when multiline - must always be at the beginning or at the end of the line.', - [ - new CodeSample(' 'end'] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - $this->position = $this->configuration['position']; - $this->operators = self::BOOLEAN_OPERATORS; - - if (false === $this->configuration['only_booleans']) { - $this->operators = array_merge($this->operators, self::getNonBooleanOperators()); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('only_booleans', 'Whether to limit operators to only boolean ones.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('position', 'Whether to place operators at the beginning or at the end of the line.')) - ->setAllowedValues(['beginning', 'end']) - ->setDefault($this->position) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $referenceAnalyzer = new ReferenceAnalyzer(); - $gotoLabelAnalyzer = new GotoLabelAnalyzer(); - $alternativeSyntaxAnalyzer = new AlternativeSyntaxAnalyzer(); - - $index = $tokens->count(); - while ($index > 1) { - --$index; - - if (!$tokens[$index]->equalsAny($this->operators, false)) { - continue; - } - - if ($gotoLabelAnalyzer->belongsToGoToLabel($tokens, $index)) { - continue; - } - - if ($referenceAnalyzer->isReference($tokens, $index)) { - continue; - } - - if ($alternativeSyntaxAnalyzer->belongsToAlternativeSyntax($tokens, $index)) { - continue; - } - - if (SwitchAnalyzer::belongsToSwitch($tokens, $index)) { - continue; - } - - $operatorIndices = [$index]; - if ($tokens[$index]->equals(':')) { - /** @var int $prevIndex */ - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$prevIndex]->equals('?')) { - $operatorIndices = [$prevIndex, $index]; - $index = $prevIndex; - } - } - - $this->fixOperatorLinebreak($tokens, $operatorIndices); - } - } - - /** - * @param non-empty-list $operatorIndices - */ - private function fixOperatorLinebreak(Tokens $tokens, array $operatorIndices): void - { - /** @var int $prevIndex */ - $prevIndex = $tokens->getPrevMeaningfulToken(min($operatorIndices)); - $indexStart = $prevIndex + 1; - - /** @var int $nextIndex */ - $nextIndex = $tokens->getNextMeaningfulToken(max($operatorIndices)); - $indexEnd = $nextIndex - 1; - - if (!$this->isMultiline($tokens, $indexStart, $indexEnd)) { - return; // operator is not surrounded by multiline whitespaces, do not touch it - } - - if ('beginning' === $this->position) { - if (!$this->isMultiline($tokens, max($operatorIndices), $indexEnd)) { - return; // operator already is placed correctly - } - $this->fixMoveToTheBeginning($tokens, $operatorIndices); - - return; - } - - if (!$this->isMultiline($tokens, $indexStart, min($operatorIndices))) { - return; // operator already is placed correctly - } - $this->fixMoveToTheEnd($tokens, $operatorIndices); - } - - /** - * @param non-empty-list $operatorIndices - */ - private function fixMoveToTheBeginning(Tokens $tokens, array $operatorIndices): void - { - /** @var int $prevIndex */ - $prevIndex = $tokens->getNonEmptySibling(min($operatorIndices), -1); - - /** @var int $nextIndex */ - $nextIndex = $tokens->getNextMeaningfulToken(max($operatorIndices)); - - for ($i = $nextIndex - 1; $i > max($operatorIndices); --$i) { - if ($tokens[$i]->isWhitespace() && Preg::match('/\R/u', $tokens[$i]->getContent())) { - $isWhitespaceBefore = $tokens[$prevIndex]->isWhitespace(); - $inserts = $this->getReplacementsAndClear($tokens, $operatorIndices, -1); - if ($isWhitespaceBefore) { - $inserts[] = new Token([T_WHITESPACE, ' ']); - } - $tokens->insertAt($nextIndex, $inserts); - - break; - } - } - } - - /** - * @param non-empty-list $operatorIndices - */ - private function fixMoveToTheEnd(Tokens $tokens, array $operatorIndices): void - { - /** @var int $prevIndex */ - $prevIndex = $tokens->getPrevMeaningfulToken(min($operatorIndices)); - - /** @var int $nextIndex */ - $nextIndex = $tokens->getNonEmptySibling(max($operatorIndices), 1); - - for ($i = $prevIndex + 1; $i < max($operatorIndices); ++$i) { - if ($tokens[$i]->isWhitespace() && Preg::match('/\R/u', $tokens[$i]->getContent())) { - $isWhitespaceAfter = $tokens[$nextIndex]->isWhitespace(); - $inserts = $this->getReplacementsAndClear($tokens, $operatorIndices, 1); - if ($isWhitespaceAfter) { - array_unshift($inserts, new Token([T_WHITESPACE, ' '])); - } - $tokens->insertAt($prevIndex + 1, $inserts); - - break; - } - } - } - - /** - * @param list $indices - * - * @return list - */ - private function getReplacementsAndClear(Tokens $tokens, array $indices, int $direction): array - { - return array_map( - static function (int $index) use ($tokens, $direction): Token { - $clone = $tokens[$index]; - - if ($tokens[$index + $direction]->isWhitespace()) { - $tokens->clearAt($index + $direction); - } - - $tokens->clearAt($index); - - return $clone; - }, - $indices - ); - } - - private function isMultiline(Tokens $tokens, int $indexStart, int $indexEnd): bool - { - for ($index = $indexStart; $index <= $indexEnd; ++$index) { - if (str_contains($tokens[$index]->getContent(), "\n")) { - return true; - } - } - - return false; - } - - /** - * @return list - */ - private static function getNonBooleanOperators(): array - { - return array_merge( - [ - '%', '&', '*', '+', '-', '.', '/', ':', '<', '=', '>', '?', '^', '|', - [T_AND_EQUAL], [T_CONCAT_EQUAL], [T_DIV_EQUAL], [T_DOUBLE_ARROW], [T_IS_EQUAL], [T_IS_GREATER_OR_EQUAL], - [T_IS_IDENTICAL], [T_IS_NOT_EQUAL], [T_IS_NOT_IDENTICAL], [T_IS_SMALLER_OR_EQUAL], [T_MINUS_EQUAL], - [T_MOD_EQUAL], [T_MUL_EQUAL], [T_OR_EQUAL], [T_PAAMAYIM_NEKUDOTAYIM], [T_PLUS_EQUAL], [T_POW], - [T_POW_EQUAL], [T_SL], [T_SL_EQUAL], [T_SR], [T_SR_EQUAL], [T_XOR_EQUAL], - [T_COALESCE], [T_SPACESHIP], - ], - array_map(static fn (int $id): array => [$id], Token::getObjectOperatorKinds()), - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeIncrementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeIncrementFixer.php deleted file mode 100644 index 1aaae169..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeIncrementFixer.php +++ /dev/null @@ -1,122 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\Fixer\AbstractIncrementOperatorFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author ntzm - */ -final class StandardizeIncrementFixer extends AbstractIncrementOperatorFixer -{ - private const EXPRESSION_END_TOKENS = [ - ';', - ')', - ']', - ',', - ':', - [CT::T_DYNAMIC_PROP_BRACE_CLOSE], - [CT::T_DYNAMIC_VAR_BRACE_CLOSE], - [T_CLOSE_TAG], - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Increment and decrement operators should be used if possible.', - [ - new CodeSample("isAnyTokenKindsFound([T_PLUS_EQUAL, T_MINUS_EQUAL]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; $index > 0; --$index) { - $expressionEnd = $tokens[$index]; - if (!$expressionEnd->equalsAny(self::EXPRESSION_END_TOKENS)) { - continue; - } - - $numberIndex = $tokens->getPrevMeaningfulToken($index); - $number = $tokens[$numberIndex]; - if (!$number->isGivenKind(T_LNUMBER) || '1' !== $number->getContent()) { - continue; - } - - $operatorIndex = $tokens->getPrevMeaningfulToken($numberIndex); - $operator = $tokens[$operatorIndex]; - if (!$operator->isGivenKind([T_PLUS_EQUAL, T_MINUS_EQUAL])) { - continue; - } - - $startIndex = $this->findStart($tokens, $operatorIndex); - - $this->clearRangeLeaveComments( - $tokens, - $tokens->getPrevMeaningfulToken($operatorIndex) + 1, - $numberIndex - ); - - $tokens->insertAt( - $startIndex, - new Token($operator->isGivenKind(T_PLUS_EQUAL) ? [T_INC, '++'] : [T_DEC, '--']) - ); - } - } - - /** - * Clear tokens in the given range unless they are comments. - */ - private function clearRangeLeaveComments(Tokens $tokens, int $indexStart, int $indexEnd): void - { - for ($i = $indexStart; $i <= $indexEnd; ++$i) { - $token = $tokens[$i]; - - if ($token->isComment()) { - continue; - } - - if ($token->isWhitespace("\n\r")) { - continue; - } - - $tokens->clearAt($i); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeNotEqualsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeNotEqualsFixer.php deleted file mode 100644 index 2dab6092..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/StandardizeNotEqualsFixer.php +++ /dev/null @@ -1,60 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - */ -final class StandardizeNotEqualsFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Replace all `<>` with `!=`.', - [new CodeSample(" \$c;\n")] - ); - } - - /** - * {@inheritdoc} - * - * Must run before BinaryOperatorSpacesFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_IS_NOT_EQUAL); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if ($token->isGivenKind(T_IS_NOT_EQUAL)) { - $tokens[$index] = new Token([T_IS_NOT_EQUAL, '!=']); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryOperatorSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryOperatorSpacesFixer.php deleted file mode 100644 index 758c7939..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryOperatorSpacesFixer.php +++ /dev/null @@ -1,131 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\AlternativeSyntaxAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\GotoLabelAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\SwitchAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - */ -final class TernaryOperatorSpacesFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Standardize spaces around ternary operator.', - [new CodeSample("isAllTokenKindsFound(['?', ':']); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $alternativeSyntaxAnalyzer = new AlternativeSyntaxAnalyzer(); - $gotoLabelAnalyzer = new GotoLabelAnalyzer(); - $ternaryOperatorIndices = []; - - foreach ($tokens as $index => $token) { - if (!$token->equalsAny(['?', ':'])) { - continue; - } - - if (SwitchAnalyzer::belongsToSwitch($tokens, $index)) { - continue; - } - - if ($alternativeSyntaxAnalyzer->belongsToAlternativeSyntax($tokens, $index)) { - continue; - } - - if ($gotoLabelAnalyzer->belongsToGoToLabel($tokens, $index)) { - continue; - } - - $ternaryOperatorIndices[] = $index; - } - - foreach (array_reverse($ternaryOperatorIndices) as $index) { - $token = $tokens[$index]; - - if ($token->equals('?')) { - $nextNonWhitespaceIndex = $tokens->getNextNonWhitespace($index); - - if ($tokens[$nextNonWhitespaceIndex]->equals(':')) { - // for `$a ?: $b` remove spaces between `?` and `:` - $tokens->ensureWhitespaceAtIndex($index + 1, 0, ''); - } else { - // for `$a ? $b : $c` ensure space after `?` - $this->ensureWhitespaceExistence($tokens, $index + 1, true); - } - - // for `$a ? $b : $c` ensure space before `?` - $this->ensureWhitespaceExistence($tokens, $index - 1, false); - - continue; - } - - if ($token->equals(':')) { - // for `$a ? $b : $c` ensure space after `:` - $this->ensureWhitespaceExistence($tokens, $index + 1, true); - - $prevNonWhitespaceToken = $tokens[$tokens->getPrevNonWhitespace($index)]; - - if (!$prevNonWhitespaceToken->equals('?')) { - // for `$a ? $b : $c` ensure space before `:` - $this->ensureWhitespaceExistence($tokens, $index - 1, false); - } - } - } - } - - private function ensureWhitespaceExistence(Tokens $tokens, int $index, bool $after): void - { - if ($tokens[$index]->isWhitespace()) { - if ( - !str_contains($tokens[$index]->getContent(), "\n") - && !$tokens[$index - 1]->isComment() - ) { - $tokens[$index] = new Token([T_WHITESPACE, ' ']); - } - - return; - } - - $index += $after ? 0 : 1; - $tokens->insertAt($index, new Token([T_WHITESPACE, ' '])); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToElvisOperatorFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToElvisOperatorFixer.php deleted file mode 100644 index e1e85b37..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToElvisOperatorFixer.php +++ /dev/null @@ -1,217 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\RangeAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -final class TernaryToElvisOperatorFixer extends AbstractFixer -{ - /** - * Lower precedence and other valid preceding tokens. - * - * Ordered by most common types first. - * - * @var list - */ - private const VALID_BEFORE_ENDTYPES = [ - '=', - [T_OPEN_TAG], - [T_OPEN_TAG_WITH_ECHO], - '(', - ',', - ';', - '[', - '{', - '}', - [CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN], - [T_AND_EQUAL], // &= - [T_CONCAT_EQUAL], // .= - [T_DIV_EQUAL], // /= - [T_MINUS_EQUAL], // -= - [T_MOD_EQUAL], // %= - [T_MUL_EQUAL], // *= - [T_OR_EQUAL], // |= - [T_PLUS_EQUAL], // += - [T_POW_EQUAL], // **= - [T_SL_EQUAL], // <<= - [T_SR_EQUAL], // >>= - [T_XOR_EQUAL], // ^= - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Use the Elvis operator `?:` where possible.', - [ - new CodeSample( - "isTokenKindFound('?'); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 5; $index > 1; --$index) { - if (!$tokens[$index]->equals('?')) { - continue; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$nextIndex]->equals(':')) { - continue; // Elvis is alive! - } - - // get and check what is before the `?` operator - - $beforeOperator = $this->getBeforeOperator($tokens, $index); - - if (null === $beforeOperator) { - continue; // contains something we cannot fix because of priorities - } - - // get what is after the `?` token - - $afterOperator = $this->getAfterOperator($tokens, $index); - - // if before and after the `?` operator are the same (in meaningful matter), clear after - - if (RangeAnalyzer::rangeEqualsRange($tokens, $beforeOperator, $afterOperator)) { - $this->clearMeaningfulFromRange($tokens, $afterOperator); - } - } - } - - /** - * @return ?array{start: int, end: int} null if contains ++/-- operator - */ - private function getBeforeOperator(Tokens $tokens, int $index): ?array - { - $blockEdgeDefinitions = Tokens::getBlockEdgeDefinitions(); - $index = $tokens->getPrevMeaningfulToken($index); - $before = ['end' => $index]; - - while (!$tokens[$index]->equalsAny(self::VALID_BEFORE_ENDTYPES)) { - if ($tokens[$index]->isGivenKind([T_INC, T_DEC])) { - return null; - } - - $detectedBlockType = Tokens::detectBlockType($tokens[$index]); - - if (null === $detectedBlockType || $detectedBlockType['isStart']) { - $before['start'] = $index; - $index = $tokens->getPrevMeaningfulToken($index); - - continue; - } - - /** @phpstan-ignore-next-line offsetAccess.notFound (we just detected block type, we know it's definition exists under given PHP runtime) */ - $blockType = $blockEdgeDefinitions[$detectedBlockType['type']]; - $openCount = 1; - - do { - $index = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$index]->isGivenKind([T_INC, T_DEC])) { - return null; - } - - if ($tokens[$index]->equals($blockType['start'])) { - ++$openCount; - - continue; - } - - if ($tokens[$index]->equals($blockType['end'])) { - --$openCount; - } - } while (1 >= $openCount); - - $before['start'] = $index; - $index = $tokens->getPrevMeaningfulToken($index); - } - - if (!isset($before['start'])) { - return null; - } - - return $before; - } - - /** - * @return array{start: int, end: int} - */ - private function getAfterOperator(Tokens $tokens, int $index): array - { - $index = $tokens->getNextMeaningfulToken($index); - $after = ['start' => $index]; - - do { - $blockType = Tokens::detectBlockType($tokens[$index]); - - if (null !== $blockType) { - $index = $tokens->findBlockEnd($blockType['type'], $index); - } - - $after['end'] = $index; - $index = $tokens->getNextMeaningfulToken($index); - } while (!$tokens[$index]->equals(':')); - - return $after; - } - - /** - * @param array{start: int, end: int} $range - */ - private function clearMeaningfulFromRange(Tokens $tokens, array $range): void - { - // $range['end'] must be meaningful! - for ($i = $range['end']; $i >= $range['start']; $i = $tokens->getPrevMeaningfulToken($i)) { - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToNullCoalescingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToNullCoalescingFixer.php deleted file mode 100644 index e73c5861..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/TernaryToNullCoalescingFixer.php +++ /dev/null @@ -1,224 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - */ -final class TernaryToNullCoalescingFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Use `null` coalescing operator `??` where possible.', - [ - new CodeSample( - "isTokenKindFound(T_ISSET); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $issetIndices = array_keys($tokens->findGivenKind(T_ISSET)); - - while ($issetIndex = array_pop($issetIndices)) { - $this->fixIsset($tokens, $issetIndex); - } - } - - /** - * @param int $index of `T_ISSET` token - */ - private function fixIsset(Tokens $tokens, int $index): void - { - $prevTokenIndex = $tokens->getPrevMeaningfulToken($index); - - if ($this->isHigherPrecedenceAssociativityOperator($tokens[$prevTokenIndex])) { - return; - } - - $startBraceIndex = $tokens->getNextTokenOfKind($index, ['(']); - $endBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startBraceIndex); - - $ternaryQuestionMarkIndex = $tokens->getNextMeaningfulToken($endBraceIndex); - - if (!$tokens[$ternaryQuestionMarkIndex]->equals('?')) { - return; // we are not in a ternary operator - } - - // search what is inside the isset() - $issetTokens = $this->getMeaningfulSequence($tokens, $startBraceIndex, $endBraceIndex); - - if ($this->hasChangingContent($issetTokens)) { - return; // some weird stuff inside the isset - } - - $issetCode = $issetTokens->generateCode(); - - if ('$this' === $issetCode) { - return; // null coalescing operator does not with $this - } - - // search what is inside the middle argument of ternary operator - $ternaryColonIndex = $tokens->getNextTokenOfKind($ternaryQuestionMarkIndex, [':']); - $ternaryFirstOperandTokens = $this->getMeaningfulSequence($tokens, $ternaryQuestionMarkIndex, $ternaryColonIndex); - - if ($issetCode !== $ternaryFirstOperandTokens->generateCode()) { - return; // regardless of non-meaningful tokens, the operands are different - } - - $ternaryFirstOperandIndex = $tokens->getNextMeaningfulToken($ternaryQuestionMarkIndex); - - // preserve comments and spaces - $comments = []; - $commentStarted = false; - - for ($loopIndex = $index; $loopIndex < $ternaryFirstOperandIndex; ++$loopIndex) { - if ($tokens[$loopIndex]->isComment()) { - $comments[] = $tokens[$loopIndex]; - $commentStarted = true; - } elseif ($commentStarted) { - if ($tokens[$loopIndex]->isWhitespace()) { - $comments[] = $tokens[$loopIndex]; - } - - $commentStarted = false; - } - } - - $tokens[$ternaryColonIndex] = new Token([T_COALESCE, '??']); - $tokens->overrideRange($index, $ternaryFirstOperandIndex - 1, $comments); - } - - /** - * Get the sequence of meaningful tokens and returns a new Tokens instance. - * - * @param int $start start index - * @param int $end end index - */ - private function getMeaningfulSequence(Tokens $tokens, int $start, int $end): Tokens - { - $sequence = []; - $index = $start; - - while ($index < $end) { - $index = $tokens->getNextMeaningfulToken($index); - - if ($index >= $end || null === $index) { - break; - } - - $sequence[] = $tokens[$index]; - } - - return Tokens::fromArray($sequence); - } - - /** - * Check if the requested token is an operator computed - * before the ternary operator along with the `isset()`. - */ - private function isHigherPrecedenceAssociativityOperator(Token $token): bool - { - static $operatorsPerId = [ - T_ARRAY_CAST => true, - T_BOOLEAN_AND => true, - T_BOOLEAN_OR => true, - T_BOOL_CAST => true, - T_COALESCE => true, - T_DEC => true, - T_DOUBLE_CAST => true, - T_INC => true, - T_INT_CAST => true, - T_IS_EQUAL => true, - T_IS_GREATER_OR_EQUAL => true, - T_IS_IDENTICAL => true, - T_IS_NOT_EQUAL => true, - T_IS_NOT_IDENTICAL => true, - T_IS_SMALLER_OR_EQUAL => true, - T_OBJECT_CAST => true, - T_POW => true, - T_SL => true, - T_SPACESHIP => true, - T_SR => true, - T_STRING_CAST => true, - T_UNSET_CAST => true, - ]; - - static $operatorsPerContent = [ - '!', - '%', - '&', - '*', - '+', - '-', - '/', - ':', - '^', - '|', - '~', - '.', - ]; - - return isset($operatorsPerId[$token->getId()]) || $token->equalsAny($operatorsPerContent); - } - - /** - * Check if the `isset()` content may change if called multiple times. - * - * @param Tokens $tokens The original token list - */ - private function hasChangingContent(Tokens $tokens): bool - { - static $operatorsPerId = [ - T_DEC, - T_INC, - T_YIELD, - T_YIELD_FROM, - ]; - - foreach ($tokens as $token) { - if ($token->isGivenKind($operatorsPerId) || $token->equals('(')) { - return true; - } - } - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/UnaryOperatorSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/UnaryOperatorSpacesFixer.php deleted file mode 100644 index 42b977fe..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Operator/UnaryOperatorSpacesFixer.php +++ /dev/null @@ -1,118 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Operator; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Gregor Harlan - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * only_dec_inc?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * only_dec_inc: bool - * } - */ -final class UnaryOperatorSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Unary operators should be placed adjacent to their operands.', - [ - new CodeSample(" false] - ), - new CodeSample( - ' true] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before NotOperatorWithSpaceFixer, NotOperatorWithSuccessorSpaceFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return true; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('only_dec_inc', 'Limit to increment and decrement operators.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if (true === $this->configuration['only_dec_inc'] && !$tokens[$index]->isGivenKind([T_DEC, T_INC])) { - continue; - } - - if ($tokensAnalyzer->isUnarySuccessorOperator($index)) { - if (!$tokens[$tokens->getPrevNonWhitespace($index)]->isComment()) { - $tokens->removeLeadingWhitespace($index); - } - - continue; - } - - if ($tokensAnalyzer->isUnaryPredecessorOperator($index)) { - $tokens->removeTrailingWhitespace($index); - - continue; - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/BlankLineAfterOpeningTagFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/BlankLineAfterOpeningTagFixer.php deleted file mode 100644 index 849f3016..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/BlankLineAfterOpeningTagFixer.php +++ /dev/null @@ -1,92 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpTag; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Ceeram - */ -final class BlankLineAfterOpeningTagFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Ensure there is no code on the same line as the PHP open tag and it is followed by a blank line.', - [new CodeSample("isMonolithicPhp() && !$tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - - $newlineFound = false; - foreach ($tokens as $token) { - if (($token->isWhitespace() || $token->isGivenKind(T_OPEN_TAG)) && str_contains($token->getContent(), "\n")) { - $newlineFound = true; - - break; - } - } - - // ignore one-line files - if (!$newlineFound) { - return; - } - - $openTagIndex = $tokens[0]->isGivenKind(T_INLINE_HTML) ? 1 : 0; - $token = $tokens[$openTagIndex]; - - if (!str_contains($token->getContent(), "\n")) { - $tokens[$openTagIndex] = new Token([$token->getId(), rtrim($token->getContent()).$lineEnding]); - } - - $newLineIndex = $openTagIndex + 1; - if (!$tokens->offsetExists($newLineIndex)) { - return; - } - - if ($tokens[$newLineIndex]->isWhitespace()) { - if (!str_contains($tokens[$newLineIndex]->getContent(), "\n")) { - $tokens[$newLineIndex] = new Token([T_WHITESPACE, $lineEnding.$tokens[$newLineIndex]->getContent()]); - } - } else { - $tokens->insertAt($newLineIndex, new Token([T_WHITESPACE, $lineEnding])); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/EchoTagSyntaxFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/EchoTagSyntaxFixer.php deleted file mode 100644 index 2953c35d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/EchoTagSyntaxFixer.php +++ /dev/null @@ -1,273 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpTag; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Michele Locati - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * format?: 'long'|'short', - * long_function?: 'echo'|'print', - * shorten_simple_statements_only?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * format: 'long'|'short', - * long_function: 'echo'|'print', - * shorten_simple_statements_only: bool - * } - */ -final class EchoTagSyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** @internal */ - public const OPTION_FORMAT = 'format'; - - /** @internal */ - public const OPTION_SHORTEN_SIMPLE_STATEMENTS_ONLY = 'shorten_simple_statements_only'; - - /** @internal */ - public const OPTION_LONG_FUNCTION = 'long_function'; - - /** @internal */ - public const FORMAT_SHORT = 'short'; - - /** @internal */ - public const FORMAT_LONG = 'long'; - - /** @internal */ - public const LONG_FUNCTION_ECHO = 'echo'; - - /** @internal */ - public const LONG_FUNCTION_PRINT = 'print'; - - private const SUPPORTED_FORMAT_OPTIONS = [ - self::FORMAT_LONG, - self::FORMAT_SHORT, - ]; - - private const SUPPORTED_LONGFUNCTION_OPTIONS = [ - self::LONG_FUNCTION_ECHO, - self::LONG_FUNCTION_PRINT, - ]; - - public function getDefinition(): FixerDefinitionInterface - { - $sample = <<<'EOT' - - - - - - EOT; - - return new FixerDefinition( - 'Replaces short-echo ` self::FORMAT_LONG]), - new CodeSample($sample, [self::OPTION_FORMAT => self::FORMAT_LONG, self::OPTION_LONG_FUNCTION => self::LONG_FUNCTION_PRINT]), - new CodeSample($sample, [self::OPTION_FORMAT => self::FORMAT_SHORT]), - new CodeSample($sample, [self::OPTION_FORMAT => self::FORMAT_SHORT, self::OPTION_SHORTEN_SIMPLE_STATEMENTS_ONLY => false]), - ], - null - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoMixedEchoPrintFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - if (self::FORMAT_SHORT === $this->configuration[self::OPTION_FORMAT]) { - return $tokens->isAnyTokenKindsFound([T_ECHO, T_PRINT]); - } - - return $tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder(self::OPTION_FORMAT, 'The desired language construct.')) - ->setAllowedValues(self::SUPPORTED_FORMAT_OPTIONS) - ->setDefault(self::FORMAT_LONG) - ->getOption(), - (new FixerOptionBuilder(self::OPTION_LONG_FUNCTION, 'The function to be used to expand the short echo tags.')) - ->setAllowedValues(self::SUPPORTED_LONGFUNCTION_OPTIONS) - ->setDefault(self::LONG_FUNCTION_ECHO) - ->getOption(), - (new FixerOptionBuilder(self::OPTION_SHORTEN_SIMPLE_STATEMENTS_ONLY, 'Render short-echo tags only in case of simple code.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if (self::FORMAT_SHORT === $this->configuration[self::OPTION_FORMAT]) { - $this->longToShort($tokens); - } else { - $this->shortToLong($tokens); - } - } - - private function longToShort(Tokens $tokens): void - { - $count = $tokens->count(); - - for ($index = 0; $index < $count; ++$index) { - if (!$tokens[$index]->isGivenKind(T_OPEN_TAG)) { - continue; - } - - $nextMeaningful = $tokens->getNextMeaningfulToken($index); - - if (null === $nextMeaningful) { - return; - } - - if (!$tokens[$nextMeaningful]->isGivenKind([T_ECHO, T_PRINT])) { - $index = $nextMeaningful; - - continue; - } - - if (true === $this->configuration[self::OPTION_SHORTEN_SIMPLE_STATEMENTS_ONLY] && $this->isComplexCode($tokens, $nextMeaningful + 1)) { - $index = $nextMeaningful; - - continue; - } - - $newTokens = $this->buildLongToShortTokens($tokens, $index, $nextMeaningful); - $tokens->overrideRange($index, $nextMeaningful, $newTokens); - $count = $tokens->count(); - } - } - - private function shortToLong(Tokens $tokens): void - { - if (self::LONG_FUNCTION_PRINT === $this->configuration[self::OPTION_LONG_FUNCTION]) { - $echoToken = [T_PRINT, 'print']; - } else { - $echoToken = [T_ECHO, 'echo']; - } - - $index = -1; - - while (true) { - $index = $tokens->getNextTokenOfKind($index, [[T_OPEN_TAG_WITH_ECHO]]); - - if (null === $index) { - return; - } - - $replace = [new Token([T_OPEN_TAG, 'isWhitespace()) { - $replace[] = new Token([T_WHITESPACE, ' ']); - } - - $tokens->overrideRange($index, $index, $replace); - ++$index; - } - } - - /** - * Check if $tokens, starting at $index, contains "complex code", that is, the content - * of the echo tag contains more than a simple "echo something". - * - * This is done by a very quick test: if the tag contains non-whitespace tokens after - * a semicolon, we consider it as "complex". - * - * @example `` is false (not complex) - * @example `` is false (not "complex") - * @example `` is true ("complex") - */ - private function isComplexCode(Tokens $tokens, int $index): bool - { - $semicolonFound = false; - - for ($count = $tokens->count(); $index < $count; ++$index) { - $token = $tokens[$index]; - - if ($token->isGivenKind(T_CLOSE_TAG)) { - return false; - } - - if (';' === $token->getContent()) { - $semicolonFound = true; - } elseif ($semicolonFound && !$token->isWhitespace()) { - return true; - } - } - - return false; - } - - /** - * Builds the list of tokens that replace a long echo sequence. - * - * @return list - */ - private function buildLongToShortTokens(Tokens $tokens, int $openTagIndex, int $echoTagIndex): array - { - $result = [new Token([T_OPEN_TAG_WITH_ECHO, 'getNextNonWhitespace($openTagIndex); - - if ($start === $echoTagIndex) { - // No non-whitespace tokens between $openTagIndex and $echoTagIndex - return $result; - } - - // Find the last non-whitespace index before $echoTagIndex - $end = $echoTagIndex - 1; - - while ($tokens[$end]->isWhitespace()) { - --$end; - } - - // Copy the non-whitespace tokens between $openTagIndex and $echoTagIndex - for ($index = $start; $index <= $end; ++$index) { - $result[] = clone $tokens[$index]; - } - - return $result; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/FullOpeningTagFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/FullOpeningTagFixer.php deleted file mode 100644 index bf6c1313..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/FullOpeningTagFixer.php +++ /dev/null @@ -1,123 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpTag; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR1 ¶2.1. - * - * @author Dariusz Rumiński - */ -final class FullOpeningTagFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHP code must use the long `generateCode(); - - // replace all echo ' echo ' $token) { - if ($token->isGivenKind(T_OPEN_TAG)) { - $tokenContent = $token->getContent(); - $possibleOpenContent = substr($content, $tokensOldContentLength, 5); - - if (false === $possibleOpenContent || 'isGivenKind([T_COMMENT, T_DOC_COMMENT, T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE, T_STRING])) { - $tokenContent = ''; - $tokenContentLength = 0; - $parts = explode('getContent()); - $iLast = \count($parts) - 1; - - foreach ($parts as $i => $part) { - $tokenContent .= $part; - $tokenContentLength += \strlen($part); - - if ($i !== $iLast) { - $originalTokenContent = substr($content, $tokensOldContentLength + $tokenContentLength, 5); - if ('getId(), $tokenContent]); - $token = $newTokens[$index]; - } - - $tokensOldContentLength += \strlen($token->getContent()); - } - - $tokens->overrideRange(0, $tokens->count() - 1, $newTokens); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/LinebreakAfterOpeningTagFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/LinebreakAfterOpeningTagFixer.php deleted file mode 100644 index 2a827161..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/LinebreakAfterOpeningTagFixer.php +++ /dev/null @@ -1,68 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpTag; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Ceeram - */ -final class LinebreakAfterOpeningTagFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Ensure there is no code on the same line as the PHP open tag.', - [new CodeSample("isMonolithicPhp() && !$tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $openTagIndex = $tokens[0]->isGivenKind(T_INLINE_HTML) ? 1 : 0; - - // ignore if linebreak already present - if (str_contains($tokens[$openTagIndex]->getContent(), "\n")) { - return; - } - - $newlineFound = false; - foreach ($tokens as $token) { - if (($token->isWhitespace() || $token->isGivenKind(T_OPEN_TAG)) && str_contains($token->getContent(), "\n")) { - $newlineFound = true; - - break; - } - } - - // ignore one-line files - if (!$newlineFound) { - return; - } - - $tokens[$openTagIndex] = new Token([T_OPEN_TAG, rtrim($tokens[$openTagIndex]->getContent()).$this->whitespacesConfig->getLineEnding()]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/NoClosingTagFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/NoClosingTagFixer.php deleted file mode 100644 index 14c40c03..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/NoClosingTagFixer.php +++ /dev/null @@ -1,59 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpTag; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶2.2. - * - * @author Dariusz Rumiński - */ -final class NoClosingTagFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'The closing `?>` tag MUST be omitted from files containing only PHP.', - [new CodeSample("\n")] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return \count($tokens) >= 2 && $tokens->isMonolithicPhp() && $tokens->isTokenKindFound(T_CLOSE_TAG); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $closeTags = $tokens->findGivenKind(T_CLOSE_TAG); - $index = array_key_first($closeTags); - - if (isset($tokens[$index - 1]) && $tokens[$index - 1]->isWhitespace()) { - $tokens->clearAt($index - 1); - } - $tokens->clearAt($index); - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$prevIndex]->equalsAny([';', '}', [T_OPEN_TAG]])) { - $tokens->insertAt($prevIndex + 1, new Token(';')); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAssertNewNamesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAssertNewNamesFixer.php deleted file mode 100644 index 71f02b5d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAssertNewNamesFixer.php +++ /dev/null @@ -1,107 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Krzysztof Ciszewski - */ -final class PhpUnitAssertNewNamesFixer extends AbstractPhpUnitFixer -{ - public function isRisky(): bool - { - return true; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Rename deprecated PHPUnit assertions like `assertFileNotExists` to new methods like `assertFileDoesNotExist`.', - [ - new CodeSample( - 'assertFileNotExists("test.php"); - $this->assertNotIsWritable("path.php"); - } -} -' - ), - ], - null, - 'Fixer could be risky if one is overriding PHPUnit\'s native methods.' - ); - } - - /** - * {@inheritdoc} - * - * Must run after PhpUnitDedicateAssertFixer. - */ - public function getPriority(): int - { - return -10; - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - foreach ($this->getPreviousAssertCall($tokens, $startIndex, $endIndex) as $assertCall) { - $this->fixAssertNewNames($tokens, $assertCall); - } - } - - /** - * @param array{ - * index: int, - * loweredName: string, - * openBraceIndex: int, - * closeBraceIndex: int, - * } $assertCall - */ - private function fixAssertNewNames(Tokens $tokens, array $assertCall): void - { - $replacements = [ - 'assertnotisreadable' => 'assertIsNotReadable', - 'assertnotiswritable' => 'assertIsNotWritable', - 'assertdirectorynotexists' => 'assertDirectoryDoesNotExist', - 'assertfilenotexists' => 'assertFileDoesNotExist', - 'assertdirectorynotisreadable' => 'assertDirectoryIsNotReadable', - 'assertdirectorynotiswritable' => 'assertDirectoryIsNotWriteable', - 'assertfilenotisreadable' => 'assertFileIsNotReadable', - 'assertfilenotiswritable' => 'assertFileIsNotWriteable', - 'assertregexp' => 'assertMatchesRegularExpression', - 'assertnotregexp' => 'assertDoesNotMatchRegularExpression', - ]; - $replacement = $replacements[$assertCall['loweredName']] ?? null; - - if (null === $replacement) { - return; - } - - $tokens[$assertCall['index']] = new Token([ - T_STRING, - $replacement, - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAttributesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAttributesFixer.php deleted file mode 100644 index 49b045b7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAttributesFixer.php +++ /dev/null @@ -1,596 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Processor\ImportProcessor; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * keep_annotations?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * keep_annotations: bool - * } - */ -final class PhpUnitAttributesFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** @var array */ - private array $fixingMap; - - public function __construct() - { - parent::__construct(); - $this->prepareFixingMap(); - } - - public function getDefinition(): FixerDefinitionInterface - { - $codeSample = <<<'PHP' - true]), - ], - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return \PHP_VERSION_ID >= 8_00_00 && parent::isCandidate($tokens); - } - - /** - * {@inheritdoc} - * - * Must run before FullyQualifiedStrictTypesFixer, PhpdocSeparationFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer. - * Must run after PhpUnitDataProviderNameFixer, PhpUnitDataProviderReturnTypeFixer, PhpUnitDataProviderStaticFixer. - */ - public function getPriority(): int - { - return 8; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('keep_annotations', 'Whether to keep annotations or not. This may be helpful for projects that support PHP before version 8 or PHPUnit before version 10.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $classIndex = $tokens->getPrevTokenOfKind($startIndex, [[T_CLASS]]); - $docBlockIndex = $this->getDocBlockIndex($tokens, $classIndex); - if ($tokens[$docBlockIndex]->isGivenKind(T_DOC_COMMENT)) { - $startIndex = $docBlockIndex; - } - - for ($index = $endIndex; $index >= $startIndex; --$index) { - if (!$tokens[$index]->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $targetIndex = $tokens->getTokenNotOfKindSibling( - $index, - 1, - [[T_ABSTRACT], [T_COMMENT], [T_FINAL], [T_FUNCTION], [T_PRIVATE], [T_PROTECTED], [T_PUBLIC], [T_STATIC], [T_WHITESPACE]], - ); - $annotationScope = $tokens[$targetIndex]->isGivenKind(T_CLASS) ? 'class' : 'method'; - - $docBlock = new DocBlock($tokens[$index]->getContent()); - - $presentAttributes = []; - foreach (array_reverse($docBlock->getAnnotations()) as $annotation) { - $annotationName = $annotation->getTag()->getName(); - - if (!isset($this->fixingMap[$annotationName])) { - continue; - } - if (!self::shouldBeFixed($annotationName, $annotationScope)) { - continue; - } - - /** @phpstan-ignore-next-line */ - $tokensToInsert = self::{$this->fixingMap[$annotationName]}($tokens, $index, $annotation); - - $presentAttributes[$annotationName] ??= self::isAttributeAlreadyPresent($tokens, $index, $tokensToInsert); - - if ($presentAttributes[$annotationName]) { - continue; - } - - if ([] === $tokensToInsert) { - continue; - } - - $tokens->insertSlices([$index + 1 => $tokensToInsert]); - - if (!$this->configuration['keep_annotations']) { - $annotation->remove(); - } - } - - if ('' === $docBlock->getContent()) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } else { - $tokens[$index] = new Token([T_DOC_COMMENT, $docBlock->getContent()]); - } - } - } - - private function prepareFixingMap(): void - { - // annotations that map to attribute without parameters - foreach ([ - 'after', - 'afterClass', - 'before', - 'beforeClass', - 'coversNothing', - 'doesNotPerformAssertions', - 'large', - 'medium', - 'runInSeparateProcess', - 'runTestsInSeparateProcesses', - 'small', - 'test', - 'preCondition', - 'postCondition', - ] as $annotation) { - $this->fixingMap[$annotation] = 'fixWithoutParameters'; - } - - // annotations that map to attribute with single string value - foreach (['group', 'testDox', 'ticket'] as $annotation) { - $this->fixingMap[$annotation] = 'fixWithSingleStringValue'; - } - - // annotations that map from 'enabled'/'disabled' value to attribute with boolean value - foreach (['backupGlobals', 'backupStaticAttributes', 'preserveGlobalState'] as $annotation) { - $this->fixingMap[$annotation] = 'fixWithEnabledDisabledValue'; - } - - // annotations that has custom mapping function - $this->fixingMap['covers'] = 'fixCovers'; - $this->fixingMap['dataProvider'] = 'fixDataProvider'; - $this->fixingMap['depends'] = 'fixDepends'; - $this->fixingMap['requires'] = 'fixRequires'; - $this->fixingMap['testWith'] = 'fixTestWith'; - $this->fixingMap['uses'] = 'fixUses'; - } - - private static function shouldBeFixed(string $annotationName, string $annotationScope): bool - { - if ( - 'method' === $annotationScope - && \in_array($annotationName, ['covers', 'large', 'medium', 'runTestsInSeparateProcesses', 'small', 'uses'], true) - ) { - return false; - } - - if ( - 'class' === $annotationScope - && \in_array($annotationName, ['after', 'afterClass', 'before', 'beforeClass', 'dataProvider', 'depends', 'postCondition', 'preCondition', 'runInSeparateProcess', 'test', 'testWith'], true) - ) { - return false; - } - - return true; - } - - /** - * @param list $tokensToInsert - */ - private static function isAttributeAlreadyPresent(Tokens $tokens, int $index, array $tokensToInsert): bool - { - $attributeIndex = $tokens->getNextMeaningfulToken($index); - if (!$tokens[$attributeIndex]->isGivenKind(T_ATTRIBUTE)) { - return false; - } - - $insertedClassName = ''; - foreach (\array_slice($tokensToInsert, 3) as $token) { - if ($token->equals('(') || $token->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - break; - } - $insertedClassName .= $token->getContent(); - } - - foreach (AttributeAnalyzer::collect($tokens, $attributeIndex) as $attributeAnalysis) { - foreach ($attributeAnalysis->getAttributes() as $attribute) { - $className = ltrim(AttributeAnalyzer::determineAttributeFullyQualifiedName($tokens, $attribute['name'], $attribute['start']), '\\'); - - if ($insertedClassName === $className) { - return true; - } - } - } - - return false; - } - - /** - * @return list - */ - private static function fixWithoutParameters(Tokens $tokens, int $index, Annotation $annotation): array - { - return self::createAttributeTokens($tokens, $index, self::getAttributeNameForAnnotation($annotation)); - } - - /** - * @return list - */ - private static function fixWithSingleStringValue(Tokens $tokens, int $index, Annotation $annotation): array - { - Preg::match( - \sprintf('/@%s\s+(.*\S)(?:\R|\s*\*+\/$)/', $annotation->getTag()->getName()), - $annotation->getContent(), - $matches, - ); - if (!isset($matches[1])) { - return []; - } - - return self::createAttributeTokens( - $tokens, - $index, - self::getAttributeNameForAnnotation($annotation), - self::createEscapedStringToken($matches[1]), - ); - } - - /** - * @return list - */ - private static function fixWithEnabledDisabledValue(Tokens $tokens, int $index, Annotation $annotation): array - { - $matches = self::getMatches($annotation); - if (!isset($matches[1])) { - return []; - } - - return self::createAttributeTokens( - $tokens, - $index, - self::getAttributeNameForAnnotation($annotation), - new Token([T_STRING, isset($matches[1]) && 'enabled' === $matches[1] ? 'true' : 'false']), - ); - } - - /** - * @return list - */ - private static function fixCovers(Tokens $tokens, int $index, Annotation $annotation): array - { - $matches = self::getMatches($annotation); - \assert(isset($matches[1])); - - if (str_starts_with($matches[1], '::')) { - return self::createAttributeTokens($tokens, $index, 'CoversFunction', self::createEscapedStringToken(substr($matches[1], 2))); - } - if (!str_contains($matches[1], '::')) { - return self::createAttributeTokens( - $tokens, - $index, - 'CoversClass', - ...self::toClassConstant($matches[1]), - ); - } - - return []; - } - - /** - * @return list - */ - private static function fixDataProvider(Tokens $tokens, int $index, Annotation $annotation): array - { - $matches = self::getMatches($annotation); - if (!isset($matches[1])) { - return []; - } - - if (str_contains($matches[1], '::')) { - // @phpstan-ignore offsetAccess.notFound - [$class, $method] = explode('::', $matches[1]); - - return self::createAttributeTokens( - $tokens, - $index, - 'DataProviderExternal', - ...[ - ...self::toClassConstant($class), - new Token(','), - new Token([T_WHITESPACE, ' ']), - self::createEscapedStringToken($method), - ], - ); - } - - return self::createAttributeTokens($tokens, $index, 'DataProvider', self::createEscapedStringToken($matches[1])); - } - - /** - * @return list - */ - private static function fixDepends(Tokens $tokens, int $index, Annotation $annotation): array - { - $matches = self::getMatches($annotation); - if (!isset($matches[1])) { - return []; - } - - $nameSuffix = ''; - $depended = $matches[1]; - if (isset($matches[2])) { - if ('clone' === $matches[1]) { - $nameSuffix = 'UsingDeepClone'; - $depended = $matches[2]; - } elseif ('shallowClone' === $matches[1]) { - $nameSuffix = 'UsingShallowClone'; - $depended = $matches[2]; - } - } - - $class = null; - $method = $depended; - if (str_contains($depended, '::')) { - // @phpstan-ignore offsetAccess.notFound - [$class, $method] = explode('::', $depended); - - if ('class' === $method) { - $method = null; - $nameSuffix = '' === $nameSuffix ? 'OnClass' : ('OnClass'.$nameSuffix); - } else { - $nameSuffix = ('External'.$nameSuffix); - } - } - - $attributeTokens = []; - if (null !== $class) { - $attributeTokens = self::toClassConstant($class); - } - if (null !== $method) { - if ([] !== $attributeTokens) { - $attributeTokens[] = new Token(','); - $attributeTokens[] = new Token([T_WHITESPACE, ' ']); - } - $attributeTokens[] = self::createEscapedStringToken($method); - } - - return self::createAttributeTokens($tokens, $index, 'Depends'.$nameSuffix, ...$attributeTokens); - } - - /** - * @return list - */ - private static function fixRequires(Tokens $tokens, int $index, Annotation $annotation): array - { - $matches = self::getMatches($annotation); - if (!isset($matches[1])) { - return []; - } - - $map = [ - 'extension' => 'RequiresPhpExtension', - 'function' => 'RequiresFunction', - 'PHP' => 'RequiresPhp', - 'PHPUnit' => 'RequiresPhpunit', - 'OS' => 'RequiresOperatingSystem', - 'OSFAMILY' => 'RequiresOperatingSystemFamily', - 'setting' => 'RequiresSetting', - ]; - - if (!isset($matches[2]) || !isset($map[$matches[1]])) { - return []; - } - - $attributeName = $map[$matches[1]]; - - if ('RequiresFunction' === $attributeName && str_contains($matches[2], '::')) { - // @phpstan-ignore offsetAccess.notFound - [$class, $method] = explode('::', $matches[2]); - - $attributeName = 'RequiresMethod'; - $attributeTokens = [ - ...self::toClassConstant($class), - new Token(','), - new Token([T_WHITESPACE, ' ']), - self::createEscapedStringToken($method), - ]; - } elseif ('RequiresPhp' === $attributeName && isset($matches[3])) { - $attributeTokens = [self::createEscapedStringToken($matches[2].' '.$matches[3])]; - } else { - $attributeTokens = [self::createEscapedStringToken($matches[2])]; - } - - if (isset($matches[3]) && 'RequiresPhp' !== $attributeName) { - $attributeTokens[] = new Token(','); - $attributeTokens[] = new Token([T_WHITESPACE, ' ']); - $attributeTokens[] = self::createEscapedStringToken($matches[3]); - } - - return self::createAttributeTokens($tokens, $index, $attributeName, ...$attributeTokens); - } - - /** - * @return list - */ - private static function fixTestWith(Tokens $tokens, int $index, Annotation $annotation): array - { - $content = $annotation->getContent(); - $content = Preg::replace('/@testWith\s+/', '', $content); - $content = Preg::replace('/(^|\R)\s+\**\s*/', "\n", $content); - $content = trim($content); - if ('' === $content) { - return []; - } - - $attributeTokens = []; - foreach (explode("\n", $content) as $json) { - $attributeTokens = array_merge( - $attributeTokens, - self::createAttributeTokens($tokens, $index, 'TestWithJson', self::createEscapedStringToken($json)), - ); - } - - return $attributeTokens; - } - - /** - * @return list - */ - private static function fixUses(Tokens $tokens, int $index, Annotation $annotation): array - { - $matches = self::getMatches($annotation); - if (!isset($matches[1])) { - return []; - } - - if (str_starts_with($matches[1], '::')) { - $attributeName = 'UsesFunction'; - $attributeTokens = [self::createEscapedStringToken(substr($matches[1], 2))]; - } elseif (Preg::match('/^[a-zA-Z\d\\\]+$/', $matches[1])) { - $attributeName = 'UsesClass'; - $attributeTokens = self::toClassConstant($matches[1]); - } else { - return []; - } - - return self::createAttributeTokens($tokens, $index, $attributeName, ...$attributeTokens); - } - - /** - * @return list - */ - private static function getMatches(Annotation $annotation): array - { - Preg::match( - \sprintf('/@%s\s+(\S+)(?:\s+(\S+))?(?:\s+(.+\S))?\s*(?:\R|\*+\/$)/', $annotation->getTag()->getName()), - $annotation->getContent(), - $matches, - ); - - \assert(array_is_list($matches)); // preg_match matches is not well typed, it depends on used regex, let's assure the type to instruct SCA - - return $matches; - } - - private static function getAttributeNameForAnnotation(Annotation $annotation): string - { - $annotationName = $annotation->getTag()->getName(); - - return 'backupStaticAttributes' === $annotationName - ? 'BackupStaticProperties' - : ucfirst($annotationName); - } - - /** - * @return list - */ - private static function createAttributeTokens( - Tokens $tokens, - int $index, - string $className, - Token ...$attributeTokens - ): array { - if ([] !== $attributeTokens) { - $attributeTokens = [ - new Token('('), - ...$attributeTokens, - new Token(')'), - ]; - } - - return [ - clone $tokens[$index + 1], - new Token([T_ATTRIBUTE, '#[']), - new Token([T_NS_SEPARATOR, '\\']), - new Token([T_STRING, 'PHPUnit']), - new Token([T_NS_SEPARATOR, '\\']), - new Token([T_STRING, 'Framework']), - new Token([T_NS_SEPARATOR, '\\']), - new Token([T_STRING, 'Attributes']), - new Token([T_NS_SEPARATOR, '\\']), - new Token([T_STRING, $className]), - ...$attributeTokens, - new Token([CT::T_ATTRIBUTE_CLOSE, ']']), - ]; - } - - /** - * @param class-string $name - * - * @return list - */ - private static function toClassConstant(string $name): array - { - return [ - ...ImportProcessor::tokenizeName($name), - new Token([T_DOUBLE_COLON, '::']), - new Token([CT::T_CLASS_CONSTANT, 'class']), - ]; - } - - private static function createEscapedStringToken(string $value): Token - { - return new Token([T_CONSTANT_ENCAPSED_STRING, "'".str_replace("'", "\\'", $value)."'"]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitConstructFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitConstructFixer.php deleted file mode 100644 index c0b6efae..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitConstructFixer.php +++ /dev/null @@ -1,210 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * assertions?: list<'assertEquals'|'assertNotEquals'|'assertNotSame'|'assertSame'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * assertions: list<'assertEquals'|'assertNotEquals'|'assertNotSame'|'assertSame'> - * } - */ -final class PhpUnitConstructFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function isRisky(): bool - { - return true; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPUnit assertion method calls like `->assertSame(true, $foo)` should be written with dedicated method like `->assertTrue($foo)`.', - [ - new CodeSample( - 'assertEquals(false, $b); - $this->assertSame(true, $a); - $this->assertNotEquals(null, $c); - $this->assertNotSame(null, $d); - } -} -' - ), - new CodeSample( - 'assertEquals(false, $b); - $this->assertSame(true, $a); - $this->assertNotEquals(null, $c); - $this->assertNotSame(null, $d); - } -} -', - ['assertions' => ['assertSame', 'assertNotSame']] - ), - ], - null, - 'Fixer could be risky if one is overriding PHPUnit\'s native methods.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpUnitDedicateAssertFixer. - */ - public function getPriority(): int - { - return -8; - } - - /** - * @uses fixAssertNegative() - * @uses fixAssertPositive() - */ - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - // no assertions to be fixed - fast return - if ([] === $this->configuration['assertions']) { - return; - } - - foreach ($this->configuration['assertions'] as $assertionMethod) { - for ($index = $startIndex; $index < $endIndex; ++$index) { - $index = \call_user_func_array( - \in_array($assertionMethod, ['assertSame', 'assertEquals'], true) - ? [$this, 'fixAssertPositive'] - : [$this, 'fixAssertNegative'], - [$tokens, $index, $assertionMethod] - ); - - if (null === $index) { - break; - } - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $assertMethods = [ - 'assertEquals', - 'assertSame', - 'assertNotEquals', - 'assertNotSame', - ]; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('assertions', 'List of assertion methods to fix.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset($assertMethods)]) - ->setDefault($assertMethods) - ->getOption(), - ]); - } - - private function fixAssertNegative(Tokens $tokens, int $index, string $method): ?int - { - static $map = [ - 'false' => 'assertNotFalse', - 'null' => 'assertNotNull', - 'true' => 'assertNotTrue', - ]; - - return $this->fixAssert($map, $tokens, $index, $method); - } - - private function fixAssertPositive(Tokens $tokens, int $index, string $method): ?int - { - static $map = [ - 'false' => 'assertFalse', - 'null' => 'assertNull', - 'true' => 'assertTrue', - ]; - - return $this->fixAssert($map, $tokens, $index, $method); - } - - /** - * @param array $map - */ - private function fixAssert(array $map, Tokens $tokens, int $index, string $method): ?int - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - $sequence = $tokens->findSequence( - [ - [T_STRING, $method], - '(', - ], - $index - ); - - if (null === $sequence) { - return null; - } - - $sequenceIndices = array_keys($sequence); - - if (!$functionsAnalyzer->isTheSameClassCall($tokens, $sequenceIndices[0])) { - return null; - } - - $sequenceIndices[2] = $tokens->getNextMeaningfulToken($sequenceIndices[1]); - $firstParameterToken = $tokens[$sequenceIndices[2]]; - - if (!$firstParameterToken->isNativeConstant()) { - return $sequenceIndices[2]; - } - - $sequenceIndices[3] = $tokens->getNextMeaningfulToken($sequenceIndices[2]); - - // return if first method argument is an expression, not value - if (!$tokens[$sequenceIndices[3]]->equals(',')) { - return $sequenceIndices[3]; - } - - $tokens[$sequenceIndices[0]] = new Token([T_STRING, $map[strtolower($firstParameterToken->getContent())]]); - $tokens->clearRange($sequenceIndices[2], $tokens->getNextNonWhitespace($sequenceIndices[3]) - 1); - - return $sequenceIndices[3]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderNameFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderNameFixer.php deleted file mode 100644 index ed3a8d0d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderNameFixer.php +++ /dev/null @@ -1,199 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\DataProviderAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * prefix?: string, - * suffix?: string - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * prefix: string, - * suffix: string - * } - */ -final class PhpUnitDataProviderNameFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Data provider names must match the name of the test.', - [ - new CodeSample( - ' 'data_', - 'suffix' => '', - ] - ), - new CodeSample( - ' 'provides', - 'suffix' => 'Data', - ] - ), - ], - null, - 'Fixer could be risky if one is calling data provider by name as function.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpUnitAttributesFixer. - */ - public function getPriority(): int - { - return 9; - } - - public function isRisky(): bool - { - return true; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('prefix', 'Prefix that replaces "test".')) - ->setAllowedTypes(['string']) - ->setDefault('provide') - ->getOption(), - (new FixerOptionBuilder('suffix', 'Suffix to be present at the end.')) - ->setAllowedTypes(['string']) - ->setDefault('Cases') - ->getOption(), - ]); - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $dataProviderAnalyzer = new DataProviderAnalyzer(); - foreach ($dataProviderAnalyzer->getDataProviders($tokens, $startIndex, $endIndex) as $dataProviderAnalysis) { - if (\count($dataProviderAnalysis->getUsageIndices()) > 1) { - continue; - } - - $usageIndex = $dataProviderAnalysis->getUsageIndices()[0][0]; - if (substr_count($tokens[$usageIndex]->getContent(), '@dataProvider') > 1) { - continue; - } - - $dataProviderNewName = $this->getDataProviderNameForUsageIndex($tokens, $usageIndex); - if (null !== $tokens->findSequence([[T_FUNCTION], [T_STRING, $dataProviderNewName]], $startIndex, $endIndex)) { - continue; - } - - $tokens[$dataProviderAnalysis->getNameIndex()] = new Token([T_STRING, $dataProviderNewName]); - - $newCommentContent = Preg::replace( - \sprintf('/(@dataProvider\s+)%s/', $dataProviderAnalysis->getName()), - \sprintf('$1%s', $dataProviderNewName), - $tokens[$usageIndex]->getContent(), - ); - - $tokens[$usageIndex] = new Token([T_DOC_COMMENT, $newCommentContent]); - } - } - - private function getDataProviderNameForUsageIndex(Tokens $tokens, int $index): string - { - do { - if (\defined('T_ATTRIBUTE') && $tokens[$index]->isGivenKind(T_ATTRIBUTE)) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); - } - $index = $tokens->getNextMeaningfulToken($index); - } while (!$tokens[$index]->isGivenKind(T_STRING)); - - $name = $tokens[$index]->getContent(); - - $name = Preg::replace('/^test_*/i', '', $name); - - if ('' === $this->configuration['prefix']) { - $name = lcfirst($name); - } elseif ('_' !== substr($this->configuration['prefix'], -1)) { - $name = ucfirst($name); - } - - return $this->configuration['prefix'].$name.$this->configuration['suffix']; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderReturnTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderReturnTypeFixer.php deleted file mode 100644 index cbeda2c7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderReturnTypeFixer.php +++ /dev/null @@ -1,120 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\DataProviderAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - */ -final class PhpUnitDataProviderReturnTypeFixer extends AbstractPhpUnitFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'The return type of PHPUnit data provider must be `iterable`.', - [ - new CodeSample( - 'getDataProviders($tokens, $startIndex, $endIndex)) as $dataProviderAnalysis) { - $typeAnalysis = $functionsAnalyzer->getFunctionReturnType($tokens, $dataProviderAnalysis->getNameIndex()); - - if (null === $typeAnalysis) { - $argumentsStart = $tokens->getNextTokenOfKind($dataProviderAnalysis->getNameIndex(), ['(']); - $argumentsEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $argumentsStart); - - $tokens->insertAt( - $argumentsEnd + 1, - [ - new Token([CT::T_TYPE_COLON, ':']), - new Token([T_WHITESPACE, ' ']), - new Token([T_STRING, 'iterable']), - ], - ); - - continue; - } - - if ('iterable' === $typeAnalysis->getName()) { - continue; - } - - $typeStartIndex = $tokens->getNextMeaningfulToken($typeAnalysis->getStartIndex() - 1); - $typeEndIndex = $typeAnalysis->getEndIndex(); - - // @TODO: drop condition and it's body when PHP 8+ is required - if ($tokens->generatePartialCode($typeStartIndex, $typeEndIndex) !== $typeAnalysis->getName()) { - continue; - } - - $tokens->overrideRange($typeStartIndex, $typeEndIndex, [new Token([T_STRING, 'iterable'])]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderStaticFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderStaticFixer.php deleted file mode 100644 index 4f6dd158..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderStaticFixer.php +++ /dev/null @@ -1,156 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\DataProviderAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Kuba Werłos - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * force?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * force: bool - * } - */ -final class PhpUnitDataProviderStaticFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Data providers must be static.', - [ - new CodeSample( - 'getData1(); } - public function provideSomethingCases2() { self::getData2(); } -} -', - ['force' => true] - ), - new CodeSample( - 'getData1(); } - public function provideSomething2Cases() { self::getData2(); } -} -', - ['force' => false] - ), - ], - null, - 'Fixer could be risky if one is calling data provider function dynamically.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpUnitAttributesFixer. - */ - public function getPriority(): int - { - return 9; - } - - public function isRisky(): bool - { - return true; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder( - 'force', - 'Whether to make the data providers static even if they have a dynamic class call' - .' (may introduce fatal error "using $this when not in object context",' - .' and you may have to adjust the code manually by converting dynamic calls to static ones).' - )) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $dataProviderAnalyzer = new DataProviderAnalyzer(); - $tokensAnalyzer = new TokensAnalyzer($tokens); - - $inserts = []; - foreach ($dataProviderAnalyzer->getDataProviders($tokens, $startIndex, $endIndex) as $dataProviderDefinitionIndex) { - $methodStartIndex = $tokens->getNextTokenOfKind($dataProviderDefinitionIndex->getNameIndex(), ['{']); - if (null !== $methodStartIndex) { - $methodEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $methodStartIndex); - - if (false === $this->configuration['force'] && null !== $tokens->findSequence([[T_VARIABLE, '$this']], $methodStartIndex, $methodEndIndex)) { - continue; - } - } - - /** @var int $functionIndex */ - $functionIndex = $tokens->getPrevTokenOfKind($dataProviderDefinitionIndex->getNameIndex(), [[T_FUNCTION]]); - - $methodAttributes = $tokensAnalyzer->getMethodAttributes($functionIndex); - if (false !== $methodAttributes['static']) { - continue; - } - - $inserts[$functionIndex] = [new Token([T_STATIC, 'static']), new Token([T_WHITESPACE, ' '])]; - } - $tokens->insertSlices($inserts); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php deleted file mode 100644 index 0af7856d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php +++ /dev/null @@ -1,590 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * target?: '3.0'|'3.5'|'5.0'|'5.6'|'newest' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * target: '3.0'|'3.5'|'5.0'|'5.6'|'newest' - * } - */ -final class PhpUnitDedicateAssertFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var array - */ - private const FIX_MAP = [ - 'array_key_exists' => [ - 'positive' => 'assertArrayHasKey', - 'negative' => 'assertArrayNotHasKey', - 'argument_count' => 2, - ], - 'empty' => [ - 'positive' => 'assertEmpty', - 'negative' => 'assertNotEmpty', - ], - 'file_exists' => [ - 'positive' => 'assertFileExists', - 'negative' => 'assertFileNotExists', - ], - 'is_array' => true, - 'is_bool' => true, - 'is_callable' => true, - 'is_dir' => [ - 'positive' => 'assertDirectoryExists', - 'negative' => 'assertDirectoryNotExists', - ], - 'is_double' => true, - 'is_float' => true, - 'is_infinite' => [ - 'positive' => 'assertInfinite', - 'negative' => 'assertFinite', - ], - 'is_int' => true, - 'is_integer' => true, - 'is_long' => true, - 'is_nan' => [ - 'positive' => 'assertNan', - 'negative' => false, - ], - 'is_null' => [ - 'positive' => 'assertNull', - 'negative' => 'assertNotNull', - ], - 'is_numeric' => true, - 'is_object' => true, - 'is_readable' => [ - 'positive' => 'assertIsReadable', - 'negative' => 'assertNotIsReadable', - ], - 'is_real' => true, - 'is_resource' => true, - 'is_scalar' => true, - 'is_string' => true, - 'is_writable' => [ - 'positive' => 'assertIsWritable', - 'negative' => 'assertNotIsWritable', - ], - 'str_contains' => [ // since 7.5 - 'positive' => 'assertStringContainsString', - 'negative' => 'assertStringNotContainsString', - 'argument_count' => 2, - 'swap_arguments' => true, - ], - 'str_ends_with' => [ // since 3.4 - 'positive' => 'assertStringEndsWith', - 'negative' => 'assertStringEndsNotWith', - 'argument_count' => 2, - 'swap_arguments' => true, - ], - 'str_starts_with' => [ // since 3.4 - 'positive' => 'assertStringStartsWith', - 'negative' => 'assertStringStartsNotWith', - 'argument_count' => 2, - 'swap_arguments' => true, - ], - ]; - - /** - * @var list - */ - private array $functions = []; - - public function isRisky(): bool - { - return true; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPUnit assertions like `assertInternalType`, `assertFileExists`, should be used over `assertTrue`.', - [ - new CodeSample( - 'assertTrue(is_float( $a), "my message"); - $this->assertTrue(is_nan($a)); - } -} -' - ), - new CodeSample( - 'assertTrue(is_dir($a)); - $this->assertTrue(is_writable($a)); - $this->assertTrue(is_readable($a)); - } -} -', - ['target' => PhpUnitTargetVersion::VERSION_5_6] - ), - ], - null, - 'Fixer could be risky if one is overriding PHPUnit\'s native methods.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoUnusedImportsFixer, PhpUnitAssertNewNamesFixer, PhpUnitDedicateAssertInternalTypeFixer. - * Must run after ModernizeStrposFixer, NoAliasFunctionsFixer, PhpUnitConstructFixer. - */ - public function getPriority(): int - { - return -9; - } - - protected function configurePostNormalisation(): void - { - // assertions added in 3.0: assertArrayNotHasKey assertArrayHasKey assertFileNotExists assertFileExists assertNotNull, assertNull - $this->functions = [ - 'array_key_exists', - 'file_exists', - 'is_null', - 'str_ends_with', - 'str_starts_with', - ]; - - if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_3_5)) { - // assertions added in 3.5: assertInternalType assertNotEmpty assertEmpty - $this->functions = array_merge($this->functions, [ - 'empty', - 'is_array', - 'is_bool', - 'is_boolean', - 'is_callable', - 'is_double', - 'is_float', - 'is_int', - 'is_integer', - 'is_long', - 'is_numeric', - 'is_object', - 'is_real', - 'is_scalar', - 'is_string', - ]); - } - - if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_5_0)) { - // assertions added in 5.0: assertFinite assertInfinite assertNan - $this->functions = array_merge($this->functions, [ - 'is_infinite', - 'is_nan', - ]); - } - - if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_5_6)) { - // assertions added in 5.6: assertDirectoryExists assertDirectoryNotExists assertIsReadable assertNotIsReadable assertIsWritable assertNotIsWritable - $this->functions = array_merge($this->functions, [ - 'is_dir', - 'is_readable', - 'is_writable', - ]); - } - - if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_7_5)) { - $this->functions = array_merge($this->functions, [ - 'str_contains', - ]); - } - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - foreach ($this->getPreviousAssertCall($tokens, $startIndex, $endIndex) as $assertCall) { - // test and fix for assertTrue/False to dedicated asserts - if (\in_array($assertCall['loweredName'], ['asserttrue', 'assertfalse'], true)) { - $this->fixAssertTrueFalse($tokens, $argumentsAnalyzer, $assertCall); - - continue; - } - - if (\in_array( - $assertCall['loweredName'], - ['assertsame', 'assertnotsame', 'assertequals', 'assertnotequals'], - true - )) { - $this->fixAssertSameEquals($tokens, $assertCall); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('target', 'Target version of PHPUnit.')) - ->setAllowedTypes(['string']) - ->setAllowedValues([ - PhpUnitTargetVersion::VERSION_3_0, - PhpUnitTargetVersion::VERSION_3_5, - PhpUnitTargetVersion::VERSION_5_0, - PhpUnitTargetVersion::VERSION_5_6, - PhpUnitTargetVersion::VERSION_NEWEST, - ]) - ->setDefault(PhpUnitTargetVersion::VERSION_NEWEST) - ->getOption(), - ]); - } - - /** - * @param array{ - * index: int, - * loweredName: string, - * openBraceIndex: int, - * closeBraceIndex: int, - * } $assertCall - */ - private function fixAssertTrueFalse(Tokens $tokens, ArgumentsAnalyzer $argumentsAnalyzer, array $assertCall): void - { - $testDefaultNamespaceTokenIndex = null; - $testIndex = $tokens->getNextMeaningfulToken($assertCall['openBraceIndex']); - - if (!$tokens[$testIndex]->isGivenKind([T_EMPTY, T_STRING])) { - if ($this->fixAssertTrueFalseInstanceof($tokens, $assertCall, $testIndex)) { - return; - } - - if (!$tokens[$testIndex]->isGivenKind(T_NS_SEPARATOR)) { - return; - } - - $testDefaultNamespaceTokenIndex = $testIndex; - $testIndex = $tokens->getNextMeaningfulToken($testIndex); - } - - $testOpenIndex = $tokens->getNextMeaningfulToken($testIndex); - - if (!$tokens[$testOpenIndex]->equals('(')) { - return; - } - - $testCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $testOpenIndex); - $assertCallCloseIndex = $tokens->getNextMeaningfulToken($testCloseIndex); - - if (!$tokens[$assertCallCloseIndex]->equalsAny([')', ','])) { - return; - } - - $content = strtolower($tokens[$testIndex]->getContent()); - - if (!\in_array($content, $this->functions, true)) { - return; - } - - $arguments = $argumentsAnalyzer->getArguments($tokens, $testOpenIndex, $testCloseIndex); - $isPositive = 'asserttrue' === $assertCall['loweredName']; - - if (isset(self::FIX_MAP[$content]) && \is_array(self::FIX_MAP[$content])) { - $fixDetails = self::FIX_MAP[$content]; - $expectedCount = $fixDetails['argument_count'] ?? 1; - - if ($expectedCount !== \count($arguments)) { - return; - } - - $isPositive = $isPositive ? 'positive' : 'negative'; - - if (false === $fixDetails[$isPositive]) { - return; - } - - $tokens[$assertCall['index']] = new Token([T_STRING, $fixDetails[$isPositive]]); - $this->removeFunctionCall($tokens, $testDefaultNamespaceTokenIndex, $testIndex, $testOpenIndex, $testCloseIndex); - - if ($fixDetails['swap_arguments'] ?? false) { - if (2 !== $expectedCount) { - throw new \RuntimeException('Can only swap two arguments, please update map or logic.'); - } - - $this->swapArguments($tokens, $arguments); - } - - return; - } - - if (1 !== \count($arguments)) { - return; - } - - $type = substr($content, 3); - - $tokens[$assertCall['index']] = new Token([T_STRING, $isPositive ? 'assertInternalType' : 'assertNotInternalType']); - $tokens[$testIndex] = new Token([T_CONSTANT_ENCAPSED_STRING, "'".$type."'"]); - $tokens[$testOpenIndex] = new Token(','); - - $tokens->clearTokenAndMergeSurroundingWhitespace($testCloseIndex); - $commaIndex = $tokens->getPrevMeaningfulToken($testCloseIndex); - - if ($tokens[$commaIndex]->equals(',')) { - $tokens->removeTrailingWhitespace($commaIndex); - $tokens->clearAt($commaIndex); - } - - if (!$tokens[$testOpenIndex + 1]->isWhitespace()) { - $tokens->insertAt($testOpenIndex + 1, new Token([T_WHITESPACE, ' '])); - } - - if (null !== $testDefaultNamespaceTokenIndex) { - $tokens->clearTokenAndMergeSurroundingWhitespace($testDefaultNamespaceTokenIndex); - } - } - - /** - * @param array{ - * index: int, - * loweredName: string, - * openBraceIndex: int, - * closeBraceIndex: int, - * } $assertCall - */ - private function fixAssertTrueFalseInstanceof(Tokens $tokens, array $assertCall, int $testIndex): bool - { - if ($tokens[$testIndex]->equals('!')) { - $variableIndex = $tokens->getNextMeaningfulToken($testIndex); - $positive = false; - } else { - $variableIndex = $testIndex; - $positive = true; - } - - if (!$tokens[$variableIndex]->isGivenKind(T_VARIABLE)) { - return false; - } - - $instanceOfIndex = $tokens->getNextMeaningfulToken($variableIndex); - - if (!$tokens[$instanceOfIndex]->isGivenKind(T_INSTANCEOF)) { - return false; - } - - $classEndIndex = $instanceOfIndex; - $classPartTokens = []; - - do { - $classEndIndex = $tokens->getNextMeaningfulToken($classEndIndex); - $classPartTokens[] = $tokens[$classEndIndex]; - } while ($tokens[$classEndIndex]->isGivenKind([T_STRING, T_NS_SEPARATOR, T_VARIABLE])); - - if ($tokens[$classEndIndex]->equalsAny([',', ')'])) { // do the fixing - array_pop($classPartTokens); - $isInstanceOfVar = reset($classPartTokens)->isGivenKind(T_VARIABLE); - $insertIndex = $testIndex - 1; - $newTokens = []; - - foreach ($classPartTokens as $token) { - $newTokens[++$insertIndex] = clone $token; - } - - if (!$isInstanceOfVar) { - $newTokens[++$insertIndex] = new Token([T_DOUBLE_COLON, '::']); - $newTokens[++$insertIndex] = new Token([CT::T_CLASS_CONSTANT, 'class']); - } - - $newTokens[++$insertIndex] = new Token(','); - $newTokens[++$insertIndex] = new Token([T_WHITESPACE, ' ']); - $newTokens[++$insertIndex] = clone $tokens[$variableIndex]; - - for ($i = $classEndIndex - 1; $i >= $testIndex; --$i) { - if (!$tokens[$i]->isComment()) { - $tokens->clearTokenAndMergeSurroundingWhitespace($i); - } - } - - $tokens->insertSlices($newTokens); - $tokens[$assertCall['index']] = new Token([T_STRING, $positive ? 'assertInstanceOf' : 'assertNotInstanceOf']); - } - - return true; - } - - /** - * @param array{ - * index: int, - * loweredName: string, - * openBraceIndex: int, - * closeBraceIndex: int, - * } $assertCall - */ - private function fixAssertSameEquals(Tokens $tokens, array $assertCall): void - { - // @ $this->/self::assertEquals/Same([$nextIndex]) - $expectedIndex = $tokens->getNextMeaningfulToken($assertCall['openBraceIndex']); - - // do not fix - // let $a = [1,2]; $b = "2"; - // "$this->assertEquals("2", count($a)); $this->assertEquals($b, count($a)); $this->assertEquals(2.1, count($a));" - - if ($tokens[$expectedIndex]->isGivenKind([T_VARIABLE])) { - if (!$tokens[$tokens->getNextMeaningfulToken($expectedIndex)]->equals(',')) { - return; - } - } elseif (!$tokens[$expectedIndex]->isGivenKind([T_LNUMBER, T_VARIABLE])) { - return; - } - - // @ $this->/self::assertEquals/Same([$nextIndex,$commaIndex]) - $commaIndex = $tokens->getNextMeaningfulToken($expectedIndex); - - if (!$tokens[$commaIndex]->equals(',')) { - return; - } - - // @ $this->/self::assertEquals/Same([$nextIndex,$commaIndex,$countCallIndex]) - $countCallIndex = $tokens->getNextMeaningfulToken($commaIndex); - - if ($tokens[$countCallIndex]->isGivenKind(T_NS_SEPARATOR)) { - $defaultNamespaceTokenIndex = $countCallIndex; - $countCallIndex = $tokens->getNextMeaningfulToken($countCallIndex); - } else { - $defaultNamespaceTokenIndex = null; - } - - if (!$tokens[$countCallIndex]->isGivenKind(T_STRING)) { - return; - } - - $lowerContent = strtolower($tokens[$countCallIndex]->getContent()); - - if (!\in_array($lowerContent, ['count', 'sizeof'], true)) { - return; // not a call to "count" or "sizeOf" - } - - // @ $this->/self::assertEquals/Same([$nextIndex,$commaIndex,[$defaultNamespaceTokenIndex,]$countCallIndex,$countCallOpenBraceIndex]) - $countCallOpenBraceIndex = $tokens->getNextMeaningfulToken($countCallIndex); - - if (!$tokens[$countCallOpenBraceIndex]->equals('(')) { - return; - } - - $countCallCloseBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $countCallOpenBraceIndex); - $afterCountCallCloseBraceIndex = $tokens->getNextMeaningfulToken($countCallCloseBraceIndex); - - if (!$tokens[$afterCountCallCloseBraceIndex]->equalsAny([')', ','])) { - return; - } - - $this->removeFunctionCall( - $tokens, - $defaultNamespaceTokenIndex, - $countCallIndex, - $countCallOpenBraceIndex, - $countCallCloseBraceIndex - ); - - $tokens[$assertCall['index']] = new Token([ - T_STRING, - false === strpos($assertCall['loweredName'], 'not', 6) ? 'assertCount' : 'assertNotCount', - ]); - } - - private function removeFunctionCall(Tokens $tokens, ?int $callNSIndex, int $callIndex, int $openIndex, int $closeIndex): void - { - $tokens->clearTokenAndMergeSurroundingWhitespace($callIndex); - - if (null !== $callNSIndex) { - $tokens->clearTokenAndMergeSurroundingWhitespace($callNSIndex); - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($openIndex); - $commaIndex = $tokens->getPrevMeaningfulToken($closeIndex); - - if ($tokens[$commaIndex]->equals(',')) { - $tokens->removeTrailingWhitespace($commaIndex); - $tokens->clearAt($commaIndex); - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($closeIndex); - } - - /** - * @param array $argumentsIndices - */ - private function swapArguments(Tokens $tokens, array $argumentsIndices): void - { - [$firstArgumentIndex, $secondArgumentIndex] = array_keys($argumentsIndices); - - $firstArgumentEndIndex = $argumentsIndices[$firstArgumentIndex]; - $secondArgumentEndIndex = $argumentsIndices[$secondArgumentIndex]; - - $firstClone = $this->cloneAndClearTokens($tokens, $firstArgumentIndex, $firstArgumentEndIndex); - $secondClone = $this->cloneAndClearTokens($tokens, $secondArgumentIndex, $secondArgumentEndIndex); - - if (!$firstClone[0]->isWhitespace()) { - array_unshift($firstClone, new Token([T_WHITESPACE, ' '])); - } - - $tokens->insertAt($secondArgumentIndex, $firstClone); - - if ($secondClone[0]->isWhitespace()) { - array_shift($secondClone); - } - - $tokens->insertAt($firstArgumentIndex, $secondClone); - } - - /** - * @return list - */ - private function cloneAndClearTokens(Tokens $tokens, int $start, int $end): array - { - $clone = []; - - for ($i = $start; $i <= $end; ++$i) { - if ('' === $tokens[$i]->getContent()) { - continue; - } - - $clone[] = clone $tokens[$i]; - $tokens->clearAt($i); - } - - return $clone; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertInternalTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertInternalTypeFixer.php deleted file mode 100644 index ece43be2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDedicateAssertInternalTypeFixer.php +++ /dev/null @@ -1,204 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Filippo Tessarotto - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * target?: '7.5'|'newest' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * target: '7.5'|'newest' - * } - */ -final class PhpUnitDedicateAssertInternalTypeFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var array - */ - private array $typeToDedicatedAssertMap = [ - 'array' => 'assertIsArray', - 'boolean' => 'assertIsBool', - 'bool' => 'assertIsBool', - 'double' => 'assertIsFloat', - 'float' => 'assertIsFloat', - 'integer' => 'assertIsInt', - 'int' => 'assertIsInt', - 'null' => 'assertNull', - 'numeric' => 'assertIsNumeric', - 'object' => 'assertIsObject', - 'real' => 'assertIsFloat', - 'resource' => 'assertIsResource', - 'string' => 'assertIsString', - 'scalar' => 'assertIsScalar', - 'callable' => 'assertIsCallable', - 'iterable' => 'assertIsIterable', - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPUnit assertions like `assertIsArray` should be used over `assertInternalType`.', - [ - new CodeSample( - 'assertInternalType("array", $var); - $this->assertInternalType("boolean", $var); - } -} -' - ), - new CodeSample( - 'assertInternalType("array", $var); - $this->assertInternalType("boolean", $var); - } -} -', - ['target' => PhpUnitTargetVersion::VERSION_7_5] - ), - ], - null, - 'Risky when PHPUnit methods are overridden or when project has PHPUnit incompatibilities.' - ); - } - - public function isRisky(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * Must run after NoBinaryStringFixer, NoUselessConcatOperatorFixer, PhpUnitDedicateAssertFixer. - */ - public function getPriority(): int - { - return -16; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('target', 'Target version of PHPUnit.')) - ->setAllowedTypes(['string']) - ->setAllowedValues([PhpUnitTargetVersion::VERSION_7_5, PhpUnitTargetVersion::VERSION_NEWEST]) - ->setDefault(PhpUnitTargetVersion::VERSION_NEWEST) - ->getOption(), - ]); - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $anonymousClassIndices = []; - $tokenAnalyzer = new TokensAnalyzer($tokens); - - for ($index = $startIndex; $index < $endIndex; ++$index) { - if (!$tokens[$index]->isGivenKind(T_CLASS) || !$tokenAnalyzer->isAnonymousClass($index)) { - continue; - } - - $openingBraceIndex = $tokens->getNextTokenOfKind($index, ['{']); - $closingBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $openingBraceIndex); - - $anonymousClassIndices[$closingBraceIndex] = $openingBraceIndex; - } - - for ($index = $endIndex - 1; $index > $startIndex; --$index) { - if (isset($anonymousClassIndices[$index])) { - $index = $anonymousClassIndices[$index]; - - continue; - } - - if (!$tokens[$index]->isGivenKind(T_STRING)) { - continue; - } - - $functionName = strtolower($tokens[$index]->getContent()); - - if ('assertinternaltype' !== $functionName && 'assertnotinternaltype' !== $functionName) { - continue; - } - - $bracketTokenIndex = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$bracketTokenIndex]->equals('(')) { - continue; - } - - $expectedTypeTokenIndex = $tokens->getNextMeaningfulToken($bracketTokenIndex); - $expectedTypeToken = $tokens[$expectedTypeTokenIndex]; - - if (!$expectedTypeToken->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { - continue; - } - - $expectedType = trim($expectedTypeToken->getContent(), '\'"'); - - if (!isset($this->typeToDedicatedAssertMap[$expectedType])) { - continue; - } - - $commaTokenIndex = $tokens->getNextMeaningfulToken($expectedTypeTokenIndex); - - if (!$tokens[$commaTokenIndex]->equals(',')) { - continue; - } - - $newAssertion = $this->typeToDedicatedAssertMap[$expectedType]; - - if ('assertnotinternaltype' === $functionName) { - $newAssertion = str_replace('Is', 'IsNot', $newAssertion); - $newAssertion = str_replace('Null', 'NotNull', $newAssertion); - } - - $nextMeaningfulTokenIndex = $tokens->getNextMeaningfulToken($commaTokenIndex); - - $tokens->overrideRange($index, $nextMeaningfulTokenIndex - 1, [ - new Token([T_STRING, $newAssertion]), - new Token('('), - ]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitExpectationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitExpectationFixer.php deleted file mode 100644 index 24ef2b79..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitExpectationFixer.php +++ /dev/null @@ -1,289 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * target?: '5.2'|'5.6'|'8.4'|'newest' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * target: '5.2'|'5.6'|'8.4'|'newest' - * } - */ -final class PhpUnitExpectationFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var array - */ - private array $methodMap = []; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Usages of `->setExpectedException*` methods MUST be replaced by `->expectException*` methods.', - [ - new CodeSample( - 'setExpectedException("RuntimeException", "Msg", 123); - foo(); - } - - public function testBar() - { - $this->setExpectedExceptionRegExp("RuntimeException", "/Msg.*/", 123); - bar(); - } -} -' - ), - new CodeSample( - 'setExpectedException("RuntimeException", null, 123); - foo(); - } - - public function testBar() - { - $this->setExpectedExceptionRegExp("RuntimeException", "/Msg.*/", 123); - bar(); - } -} -', - ['target' => PhpUnitTargetVersion::VERSION_8_4] - ), - new CodeSample( - 'setExpectedException("RuntimeException", null, 123); - foo(); - } - - public function testBar() - { - $this->setExpectedExceptionRegExp("RuntimeException", "/Msg.*/", 123); - bar(); - } -} -', - ['target' => PhpUnitTargetVersion::VERSION_5_6] - ), - new CodeSample( - 'setExpectedException("RuntimeException", "Msg", 123); - foo(); - } - - public function testBar() - { - $this->setExpectedExceptionRegExp("RuntimeException", "/Msg.*/", 123); - bar(); - } -} -', - ['target' => PhpUnitTargetVersion::VERSION_5_2] - ), - ], - null, - 'Risky when PHPUnit classes are overridden or not accessible, or when project has PHPUnit incompatibilities.' - ); - } - - /** - * {@inheritdoc} - * - * Must run after PhpUnitNoExpectationAnnotationFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isRisky(): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - $this->methodMap = [ - 'setExpectedException' => 'expectExceptionMessage', - ]; - - if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_5_6)) { - $this->methodMap['setExpectedExceptionRegExp'] = 'expectExceptionMessageRegExp'; - } - - if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_8_4)) { - $this->methodMap['setExpectedExceptionRegExp'] = 'expectExceptionMessageMatches'; - $this->methodMap['expectExceptionMessageRegExp'] = 'expectExceptionMessageMatches'; - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('target', 'Target version of PHPUnit.')) - ->setAllowedTypes(['string']) - ->setAllowedValues([PhpUnitTargetVersion::VERSION_5_2, PhpUnitTargetVersion::VERSION_5_6, PhpUnitTargetVersion::VERSION_8_4, PhpUnitTargetVersion::VERSION_NEWEST]) - ->setDefault(PhpUnitTargetVersion::VERSION_NEWEST) - ->getOption(), - ]); - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - foreach (Token::getObjectOperatorKinds() as $objectOperator) { - $this->applyPhpUnitClassFixWithObjectOperator($tokens, $startIndex, $endIndex, $objectOperator); - } - } - - private function applyPhpUnitClassFixWithObjectOperator(Tokens $tokens, int $startIndex, int $endIndex, int $objectOperator): void - { - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - $oldMethodSequence = [ - [T_VARIABLE, '$this'], - [$objectOperator], - [T_STRING], - ]; - - for ($index = $startIndex; $startIndex < $endIndex; ++$index) { - $match = $tokens->findSequence($oldMethodSequence, $index); - - if (null === $match) { - return; - } - - [$thisIndex, , $index] = array_keys($match); - - if (!isset($this->methodMap[$tokens[$index]->getContent()])) { - continue; - } - - $openIndex = $tokens->getNextTokenOfKind($index, ['(']); - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); - $commaIndex = $tokens->getPrevMeaningfulToken($closeIndex); - if ($tokens[$commaIndex]->equals(',')) { - $tokens->removeTrailingWhitespace($commaIndex); - $tokens->clearAt($commaIndex); - } - - $arguments = $argumentsAnalyzer->getArguments($tokens, $openIndex, $closeIndex); - $argumentsCnt = \count($arguments); - - $argumentsReplacements = ['expectException', $this->methodMap[$tokens[$index]->getContent()], 'expectExceptionCode']; - - $indent = $this->whitespacesConfig->getLineEnding().WhitespacesAnalyzer::detectIndent($tokens, $thisIndex); - - $isMultilineWhitespace = false; - - for ($cnt = $argumentsCnt - 1; $cnt >= 1; --$cnt) { - $argStart = array_keys($arguments)[$cnt]; - $argBefore = $tokens->getPrevMeaningfulToken($argStart); - - if (!isset($argumentsReplacements[$cnt])) { - throw new \LogicException(\sprintf('Unexpected index %d to find replacement method.', $cnt)); - } - - if ('expectExceptionMessage' === $argumentsReplacements[$cnt]) { - $paramIndicatorIndex = $tokens->getNextMeaningfulToken($argBefore); - $afterParamIndicatorIndex = $tokens->getNextMeaningfulToken($paramIndicatorIndex); - - if ( - $tokens[$paramIndicatorIndex]->equals([T_STRING, 'null'], false) - && $tokens[$afterParamIndicatorIndex]->equals(')') - ) { - if ($tokens[$argBefore + 1]->isWhitespace()) { - $tokens->clearTokenAndMergeSurroundingWhitespace($argBefore + 1); - } - $tokens->clearTokenAndMergeSurroundingWhitespace($argBefore); - $tokens->clearTokenAndMergeSurroundingWhitespace($paramIndicatorIndex); - - continue; - } - } - - $isMultilineWhitespace = $isMultilineWhitespace || ($tokens[$argStart]->isWhitespace() && !$tokens[$argStart]->isWhitespace(" \t")); - $tokensOverrideArgStart = [ - new Token([T_WHITESPACE, $indent]), - new Token([T_VARIABLE, '$this']), - new Token([T_OBJECT_OPERATOR, '->']), - new Token([T_STRING, $argumentsReplacements[$cnt]]), - new Token('('), - ]; - $tokensOverrideArgBefore = [ - new Token(')'), - new Token(';'), - ]; - - if ($isMultilineWhitespace) { - $tokensOverrideArgStart[] = new Token([T_WHITESPACE, $indent.$this->whitespacesConfig->getIndent()]); - array_unshift($tokensOverrideArgBefore, new Token([T_WHITESPACE, $indent])); - } - - if ($tokens[$argStart]->isWhitespace()) { - $tokens->overrideRange($argStart, $argStart, $tokensOverrideArgStart); - } else { - $tokens->insertAt($argStart, $tokensOverrideArgStart); - } - - $tokens->overrideRange($argBefore, $argBefore, $tokensOverrideArgBefore); - } - - $methodName = 'expectException'; - if ('expectExceptionMessageRegExp' === $tokens[$index]->getContent()) { - $methodName = $this->methodMap[$tokens[$index]->getContent()]; - } - $tokens[$index] = new Token([T_STRING, $methodName]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitFqcnAnnotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitFqcnAnnotationFixer.php deleted file mode 100644 index 46bb9a7d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitFqcnAnnotationFixer.php +++ /dev/null @@ -1,86 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Roland Franssen - */ -final class PhpUnitFqcnAnnotationFixer extends AbstractPhpUnitFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPUnit annotations should be a FQCNs including a root namespace.', - [new CodeSample( - 'getPrevTokenOfKind($startIndex, [[T_DOC_COMMENT]]); - - if (null !== $prevDocCommentIndex) { - $startIndex = $prevDocCommentIndex; - } - - $this->fixPhpUnitClass($tokens, $startIndex, $endIndex); - } - - private function fixPhpUnitClass(Tokens $tokens, int $startIndex, int $endIndex): void - { - for ($index = $startIndex; $index < $endIndex; ++$index) { - if ($tokens[$index]->isGivenKind(T_DOC_COMMENT)) { - $tokens[$index] = new Token([T_DOC_COMMENT, Preg::replace( - '~^(\s*\*\s*@(?:expectedException|covers|coversDefaultClass|uses)\h+)(?!(?:self|static)::)(\w.*)$~m', - '$1\\\$2', - $tokens[$index]->getContent() - )]); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitInternalClassFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitInternalClassFixer.php deleted file mode 100644 index 1a50197f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitInternalClassFixer.php +++ /dev/null @@ -1,117 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Gert de Pagter - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * types?: list<'abstract'|'final'|'normal'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * types: list<'abstract'|'final'|'normal'> - * } - */ -final class PhpUnitInternalClassFixer extends AbstractPhpUnitFixer implements WhitespacesAwareFixerInterface, ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'All PHPUnit test classes should be marked as internal.', - [ - new CodeSample(" ['final']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before FinalInternalClassFixer, PhpdocSeparationFixer. - */ - public function getPriority(): int - { - return 68; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $types = ['normal', 'final', 'abstract']; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('types', 'What types of classes to mark as internal.')) - ->setAllowedValues([new AllowedValueSubset($types)]) - ->setAllowedTypes(['string[]']) - ->setDefault(['normal', 'final']) - ->getOption(), - ]); - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $classIndex = $tokens->getPrevTokenOfKind($startIndex, [[T_CLASS]]); - - if (!$this->isAllowedByConfiguration($tokens, $classIndex)) { - return; - } - - $this->ensureIsDocBlockWithAnnotation( - $tokens, - $classIndex, - 'internal', - ['internal'], - [], - ); - } - - private function isAllowedByConfiguration(Tokens $tokens, int $index): bool - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - $modifiers = $tokensAnalyzer->getClassyModifiers($index); - - if (isset($modifiers['final'])) { - return \in_array('final', $this->configuration['types'], true); - } - - if (isset($modifiers['abstract'])) { - return \in_array('abstract', $this->configuration['types'], true); - } - - return \in_array('normal', $this->configuration['types'], true); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMethodCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMethodCasingFixer.php deleted file mode 100644 index 230535c8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMethodCasingFixer.php +++ /dev/null @@ -1,209 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\Line; -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; -use PhpCsFixer\Utils; - -/** - * @author Filippo Tessarotto - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * case?: 'camel_case'|'snake_case' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * case: 'camel_case'|'snake_case' - * } - */ -final class PhpUnitMethodCasingFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const CAMEL_CASE = 'camel_case'; - - /** - * @internal - */ - public const SNAKE_CASE = 'snake_case'; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Enforce camel (or snake) case for PHPUnit test methods, following configuration.', - [ - new CodeSample( - ' self::SNAKE_CASE] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after PhpUnitTestAnnotationFixer. - */ - public function getPriority(): int - { - return 0; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('case', 'Apply camel or snake case to test methods.')) - ->setAllowedValues([self::CAMEL_CASE, self::SNAKE_CASE]) - ->setDefault(self::CAMEL_CASE) - ->getOption(), - ]); - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - for ($index = $endIndex - 1; $index > $startIndex; --$index) { - if (!$this->isTestMethod($tokens, $index)) { - continue; - } - - $functionNameIndex = $tokens->getNextMeaningfulToken($index); - $functionName = $tokens[$functionNameIndex]->getContent(); - $newFunctionName = $this->updateMethodCasing($functionName); - - if ($newFunctionName !== $functionName) { - $tokens[$functionNameIndex] = new Token([T_STRING, $newFunctionName]); - } - - $docBlockIndex = $this->getDocBlockIndex($tokens, $index); - - if ($this->isPHPDoc($tokens, $docBlockIndex)) { - $this->updateDocBlock($tokens, $docBlockIndex); - } - } - } - - private function updateMethodCasing(string $functionName): string - { - $parts = explode('::', $functionName); - - $functionNamePart = array_pop($parts); - - if (self::CAMEL_CASE === $this->configuration['case']) { - $newFunctionNamePart = $functionNamePart; - $newFunctionNamePart = ucwords($newFunctionNamePart, '_'); - $newFunctionNamePart = str_replace('_', '', $newFunctionNamePart); - $newFunctionNamePart = lcfirst($newFunctionNamePart); - } else { - $newFunctionNamePart = Utils::camelCaseToUnderscore($functionNamePart); - } - - $parts[] = $newFunctionNamePart; - - return implode('::', $parts); - } - - private function isTestMethod(Tokens $tokens, int $index): bool - { - // Check if we are dealing with a (non-abstract, non-lambda) function - if (!$this->isMethod($tokens, $index)) { - return false; - } - - // if the function name starts with test it's a test - $functionNameIndex = $tokens->getNextMeaningfulToken($index); - $functionName = $tokens[$functionNameIndex]->getContent(); - - if (str_starts_with($functionName, 'test')) { - return true; - } - - $docBlockIndex = $this->getDocBlockIndex($tokens, $index); - - return - $this->isPHPDoc($tokens, $docBlockIndex) // If the function doesn't have test in its name, and no doc block, it's not a test - && str_contains($tokens[$docBlockIndex]->getContent(), '@test'); - } - - private function isMethod(Tokens $tokens, int $index): bool - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - return $tokens[$index]->isGivenKind(T_FUNCTION) && !$tokensAnalyzer->isLambda($index); - } - - private function updateDocBlock(Tokens $tokens, int $docBlockIndex): void - { - $doc = new DocBlock($tokens[$docBlockIndex]->getContent()); - $lines = $doc->getLines(); - - $docBlockNeedsUpdate = false; - for ($inc = 0; $inc < \count($lines); ++$inc) { - $lineContent = $lines[$inc]->getContent(); - if (!str_contains($lineContent, '@depends')) { - continue; - } - - $newLineContent = Preg::replaceCallback('/(@depends\s+)(.+)(\b)/', fn (array $matches): string => \sprintf( - '%s%s%s', - $matches[1], - $this->updateMethodCasing($matches[2]), - $matches[3] - ), $lineContent); - - if ($newLineContent !== $lineContent) { - $lines[$inc] = new Line($newLineContent); - $docBlockNeedsUpdate = true; - } - } - - if ($docBlockNeedsUpdate) { - $lines = implode('', $lines); - $tokens[$docBlockIndex] = new Token([T_DOC_COMMENT, $lines]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockFixer.php deleted file mode 100644 index 6afbf7c4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockFixer.php +++ /dev/null @@ -1,135 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * target?: '5.4'|'5.5'|'newest' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * target: '5.4'|'5.5'|'newest' - * } - */ -final class PhpUnitMockFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private bool $fixCreatePartialMock; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Usages of `->getMock` and `->getMockWithoutInvokingTheOriginalConstructor` methods MUST be replaced by `->createMock` or `->createPartialMock` methods.', - [ - new CodeSample( - 'getMockWithoutInvokingTheOriginalConstructor("Foo"); - $mock1 = $this->getMock("Foo"); - $mock1 = $this->getMock("Bar", ["aaa"]); - $mock1 = $this->getMock("Baz", ["aaa"], ["argument"]); // version with more than 2 params is not supported - } -} -' - ), - new CodeSample( - 'getMock("Foo"); - $mock1 = $this->getMock("Bar", ["aaa"]); // version with multiple params is not supported - } -} -', - ['target' => PhpUnitTargetVersion::VERSION_5_4] - ), - ], - null, - 'Risky when PHPUnit classes are overridden or not accessible, or when project has PHPUnit incompatibilities.' - ); - } - - public function isRisky(): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - $this->fixCreatePartialMock = PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_5_5); - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - for ($index = $startIndex; $index < $endIndex; ++$index) { - if (!$tokens[$index]->isObjectOperator()) { - continue; - } - - $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->equals([T_STRING, 'getMockWithoutInvokingTheOriginalConstructor'], false)) { - $tokens[$index] = new Token([T_STRING, 'createMock']); - } elseif ($tokens[$index]->equals([T_STRING, 'getMock'], false)) { - $openingParenthesis = $tokens->getNextMeaningfulToken($index); - $closingParenthesis = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openingParenthesis); - - $argumentsCount = $argumentsAnalyzer->countArguments($tokens, $openingParenthesis, $closingParenthesis); - - if (1 === $argumentsCount) { - $tokens[$index] = new Token([T_STRING, 'createMock']); - } elseif (2 === $argumentsCount && true === $this->fixCreatePartialMock) { - $tokens[$index] = new Token([T_STRING, 'createPartialMock']); - } - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('target', 'Target version of PHPUnit.')) - ->setAllowedTypes(['string']) - ->setAllowedValues([PhpUnitTargetVersion::VERSION_5_4, PhpUnitTargetVersion::VERSION_5_5, PhpUnitTargetVersion::VERSION_NEWEST]) - ->setDefault(PhpUnitTargetVersion::VERSION_NEWEST) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixer.php deleted file mode 100644 index 3350b669..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixer.php +++ /dev/null @@ -1,123 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Michał Adamski - * @author Kuba Werłos - */ -final class PhpUnitMockShortWillReturnFixer extends AbstractPhpUnitFixer -{ - private const RETURN_METHODS_MAP = [ - 'returnargument' => 'willReturnArgument', - 'returncallback' => 'willReturnCallback', - 'returnself' => 'willReturnSelf', - 'returnvalue' => 'willReturn', - 'returnvaluemap' => 'willReturnMap', - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Usage of PHPUnit\'s mock e.g. `->will($this->returnValue(..))` must be replaced by its shorter equivalent such as `->willReturn(...)`.', - [ - new CodeSample('createMock(Some::class); - $someMock->method("some")->will($this->returnSelf()); - $someMock->method("some")->will($this->returnValue("example")); - $someMock->method("some")->will($this->returnArgument(2)); - $someMock->method("some")->will($this->returnCallback("str_rot13")); - $someMock->method("some")->will($this->returnValueMap(["a","b","c"])); - } -} -'), - ], - null, - 'Risky when PHPUnit classes are overridden or not accessible, or when project has PHPUnit incompatibilities.' - ); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - for ($index = $startIndex; $index < $endIndex; ++$index) { - if (!$tokens[$index]->isObjectOperator()) { - continue; - } - - $functionToReplaceIndex = $tokens->getNextMeaningfulToken($index); - if (!$tokens[$functionToReplaceIndex]->equals([T_STRING, 'will'], false)) { - continue; - } - - $functionToReplaceOpeningBraceIndex = $tokens->getNextMeaningfulToken($functionToReplaceIndex); - - if (!$tokens[$functionToReplaceOpeningBraceIndex]->equals('(')) { - continue; - } - - $classReferenceIndex = $tokens->getNextMeaningfulToken($functionToReplaceOpeningBraceIndex); - $objectOperatorIndex = $tokens->getNextMeaningfulToken($classReferenceIndex); - $functionToRemoveIndex = $tokens->getNextMeaningfulToken($objectOperatorIndex); - - if (!$functionsAnalyzer->isTheSameClassCall($tokens, $functionToRemoveIndex)) { - continue; - } - - if (!\array_key_exists(strtolower($tokens[$functionToRemoveIndex]->getContent()), self::RETURN_METHODS_MAP)) { - continue; - } - - $openingBraceIndex = $tokens->getNextMeaningfulToken($functionToRemoveIndex); - - if ($tokens[$tokens->getNextMeaningfulToken($openingBraceIndex)]->isGivenKind(CT::T_FIRST_CLASS_CALLABLE)) { - continue; - } - - $closingBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openingBraceIndex); - - $tokens[$functionToReplaceIndex] = new Token([T_STRING, self::RETURN_METHODS_MAP[strtolower($tokens[$functionToRemoveIndex]->getContent())]]); - $tokens->clearTokenAndMergeSurroundingWhitespace($classReferenceIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($objectOperatorIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($functionToRemoveIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($openingBraceIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($closingBraceIndex); - - $commaAfterClosingBraceIndex = $tokens->getNextMeaningfulToken($closingBraceIndex); - if ($tokens[$commaAfterClosingBraceIndex]->equals(',')) { - $tokens->clearTokenAndMergeSurroundingWhitespace($commaAfterClosingBraceIndex); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNamespacedFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNamespacedFixer.php deleted file mode 100644 index 9d39640b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNamespacedFixer.php +++ /dev/null @@ -1,235 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\ClassyAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * target?: '4.8'|'5.7'|'6.0'|'newest' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * target: '4.8'|'5.7'|'6.0'|'newest' - * } - */ -final class PhpUnitNamespacedFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private string $originalClassRegEx; - - /** - * Class Mappings. - * - * * [original classname => new classname] Some classes which match the - * original class regular expression do not have a same-compound name- - * space class and need a dedicated translation table. This trans- - * lation table is defined in @see configure. - * - * @var array Class Mappings - */ - private array $classMap; - - public function getDefinition(): FixerDefinitionInterface - { - $codeSample = ' PhpUnitTargetVersion::VERSION_4_8]), - ], - "PHPUnit v6 has finally fully switched to namespaces.\n" - ."You could start preparing the upgrade by switching from non-namespaced TestCase to namespaced one.\n" - .'Forward compatibility layer (`\PHPUnit\Framework\TestCase` class) was backported to PHPUnit v4.8.35 and PHPUnit v5.4.0.'."\n" - .'Extended forward compatibility layer (`PHPUnit\Framework\Assert`, `PHPUnit\Framework\BaseTestListener`, `PHPUnit\Framework\TestListener` classes) was introduced in v5.7.0.'."\n", - 'Risky when PHPUnit classes are overridden or not accessible, or when project has PHPUnit incompatibilities.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - if (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_6_0)) { - $this->originalClassRegEx = '/^PHPUnit_\w+$/i'; - // @noinspection ClassConstantCanBeUsedInspection - $this->classMap = [ - 'PHPUnit_Extensions_PhptTestCase' => 'PHPUnit\Runner\PhptTestCase', - 'PHPUnit_Framework_Constraint' => 'PHPUnit\Framework\Constraint\Constraint', - 'PHPUnit_Framework_Constraint_StringMatches' => 'PHPUnit\Framework\Constraint\StringMatchesFormatDescription', - 'PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider' => 'PHPUnit\Framework\Constraint\JsonMatchesErrorMessageProvider', - 'PHPUnit_Framework_Constraint_PCREMatch' => 'PHPUnit\Framework\Constraint\RegularExpression', - 'PHPUnit_Framework_Constraint_ExceptionMessageRegExp' => 'PHPUnit\Framework\Constraint\ExceptionMessageRegularExpression', - 'PHPUnit_Framework_Constraint_And' => 'PHPUnit\Framework\Constraint\LogicalAnd', - 'PHPUnit_Framework_Constraint_Or' => 'PHPUnit\Framework\Constraint\LogicalOr', - 'PHPUnit_Framework_Constraint_Not' => 'PHPUnit\Framework\Constraint\LogicalNot', - 'PHPUnit_Framework_Constraint_Xor' => 'PHPUnit\Framework\Constraint\LogicalXor', - 'PHPUnit_Framework_Error' => 'PHPUnit\Framework\Error\Error', - 'PHPUnit_Framework_TestSuite_DataProvider' => 'PHPUnit\Framework\DataProviderTestSuite', - 'PHPUnit_Framework_MockObject_Invocation_Static' => 'PHPUnit\Framework\MockObject\Invocation\StaticInvocation', - 'PHPUnit_Framework_MockObject_Invocation_Object' => 'PHPUnit\Framework\MockObject\Invocation\ObjectInvocation', - 'PHPUnit_Framework_MockObject_Stub_Return' => 'PHPUnit\Framework\MockObject\Stub\ReturnStub', - 'PHPUnit_Runner_Filter_Group_Exclude' => 'PHPUnit\Runner\Filter\ExcludeGroupFilterIterator', - 'PHPUnit_Runner_Filter_Group_Include' => 'PHPUnit\Runner\Filter\IncludeGroupFilterIterator', - 'PHPUnit_Runner_Filter_Test' => 'PHPUnit\Runner\Filter\NameFilterIterator', - 'PHPUnit_Util_PHP' => 'PHPUnit\Util\PHP\AbstractPhpProcess', - 'PHPUnit_Util_PHP_Default' => 'PHPUnit\Util\PHP\DefaultPhpProcess', - 'PHPUnit_Util_PHP_Windows' => 'PHPUnit\Util\PHP\WindowsPhpProcess', - 'PHPUnit_Util_Regex' => 'PHPUnit\Util\RegularExpression', - 'PHPUnit_Util_TestDox_ResultPrinter_XML' => 'PHPUnit\Util\TestDox\XmlResultPrinter', - 'PHPUnit_Util_TestDox_ResultPrinter_HTML' => 'PHPUnit\Util\TestDox\HtmlResultPrinter', - 'PHPUnit_Util_TestDox_ResultPrinter_Text' => 'PHPUnit\Util\TestDox\TextResultPrinter', - 'PHPUnit_Util_TestSuiteIterator' => 'PHPUnit\Framework\TestSuiteIterator', - 'PHPUnit_Util_XML' => 'PHPUnit\Util\Xml', - ]; - } elseif (PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_5_7)) { - $this->originalClassRegEx = '/^PHPUnit_Framework_(TestCase|Assert|BaseTestListener|TestListener)+$/i'; - $this->classMap = []; - } else { - $this->originalClassRegEx = '/^PHPUnit_Framework_TestCase$/i'; - $this->classMap = []; - } - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $importedOriginalClassesMap = []; - $currIndex = 0; - - while (true) { - $currIndex = $tokens->getNextTokenOfKind($currIndex, [[T_STRING]]); - - if (null === $currIndex) { - break; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($currIndex); - - if ($tokens[$prevIndex]->isGivenKind([T_CONST, T_DOUBLE_COLON])) { - continue; - } - - $originalClass = $tokens[$currIndex]->getContent(); - $allowedReplacementScenarios = (new ClassyAnalyzer())->isClassyInvocation($tokens, $currIndex) - || $this->isImport($tokens, $currIndex); - - if (!$allowedReplacementScenarios || !Preg::match($this->originalClassRegEx, $originalClass)) { - ++$currIndex; - - continue; - } - - $substituteTokens = $this->generateReplacement($originalClass); - - $tokens->clearAt($currIndex); - $tokens->insertAt( - $currIndex, - isset($importedOriginalClassesMap[$originalClass]) ? $substituteTokens[$substituteTokens->getSize() - 1] : $substituteTokens - ); - - $prevIndex = $tokens->getPrevMeaningfulToken($currIndex); - if ($tokens[$prevIndex]->isGivenKind(T_USE)) { - $importedOriginalClassesMap[$originalClass] = true; - } elseif ($tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR)) { - $prevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - - if ($tokens[$prevIndex]->isGivenKind(T_USE)) { - $importedOriginalClassesMap[$originalClass] = true; - } - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('target', 'Target version of PHPUnit.')) - ->setAllowedTypes(['string']) - ->setAllowedValues([PhpUnitTargetVersion::VERSION_4_8, PhpUnitTargetVersion::VERSION_5_7, PhpUnitTargetVersion::VERSION_6_0, PhpUnitTargetVersion::VERSION_NEWEST]) - ->setDefault(PhpUnitTargetVersion::VERSION_NEWEST) - ->getOption(), - ]); - } - - private function generateReplacement(string $originalClassName): Tokens - { - $delimiter = '_'; - $string = $originalClassName; - - $map = array_change_key_case($this->classMap); - if (isset($map[strtolower($originalClassName)])) { - $delimiter = '\\'; - $string = $map[strtolower($originalClassName)]; - } - - $parts = explode($delimiter, $string); - $tokensArray = []; - - while ([] !== $parts) { - $tokensArray[] = new Token([T_STRING, array_shift($parts)]); - if ([] !== $parts) { - $tokensArray[] = new Token([T_NS_SEPARATOR, '\\']); - } - } - - return Tokens::fromArray($tokensArray); - } - - private function isImport(Tokens $tokens, int $currIndex): bool - { - $prevIndex = $tokens->getPrevMeaningfulToken($currIndex); - - if ($tokens[$prevIndex]->isGivenKind([T_NS_SEPARATOR])) { - $prevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - } - - return $tokens[$prevIndex]->isGivenKind([T_USE]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixer.php deleted file mode 100644 index 8e011368..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixer.php +++ /dev/null @@ -1,278 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * target?: '3.2'|'4.3'|'newest', - * use_class_const?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * target: '3.2'|'4.3'|'newest', - * use_class_const: bool - * } - */ -final class PhpUnitNoExpectationAnnotationFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private bool $fixMessageRegExp; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Usages of `@expectedException*` annotations MUST be replaced by `->setExpectedException*` methods.', - [ - new CodeSample( - ' PhpUnitTargetVersion::VERSION_3_2] - ), - ], - null, - 'Risky when PHPUnit classes are overridden or not accessible, or when project has PHPUnit incompatibilities.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoEmptyPhpdocFixer, PhpUnitExpectationFixer. - */ - public function getPriority(): int - { - return 10; - } - - public function isRisky(): bool - { - return true; - } - - protected function configurePostNormalisation(): void - { - $this->fixMessageRegExp = PhpUnitTargetVersion::fulfills($this->configuration['target'], PhpUnitTargetVersion::VERSION_4_3); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('target', 'Target version of PHPUnit.')) - ->setAllowedTypes(['string']) - ->setAllowedValues([PhpUnitTargetVersion::VERSION_3_2, PhpUnitTargetVersion::VERSION_4_3, PhpUnitTargetVersion::VERSION_NEWEST]) - ->setDefault(PhpUnitTargetVersion::VERSION_NEWEST) - ->getOption(), - (new FixerOptionBuilder('use_class_const', 'Use ::class notation.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - for ($i = $endIndex - 1; $i > $startIndex; --$i) { - if (!$tokens[$i]->isGivenKind(T_FUNCTION) || $tokensAnalyzer->isLambda($i)) { - continue; - } - - $functionIndex = $i; - $docBlockIndex = $i; - - // ignore abstract functions - $braceIndex = $tokens->getNextTokenOfKind($functionIndex, [';', '{']); - if (!$tokens[$braceIndex]->equals('{')) { - continue; - } - - do { - $docBlockIndex = $tokens->getPrevNonWhitespace($docBlockIndex); - } while ($tokens[$docBlockIndex]->isGivenKind([T_PUBLIC, T_PROTECTED, T_PRIVATE, T_FINAL, T_ABSTRACT, T_COMMENT])); - - if (!$tokens[$docBlockIndex]->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $doc = new DocBlock($tokens[$docBlockIndex]->getContent()); - $annotations = []; - - foreach ($doc->getAnnotationsOfType([ - 'expectedException', - 'expectedExceptionCode', - 'expectedExceptionMessage', - 'expectedExceptionMessageRegExp', - ]) as $annotation) { - $tag = $annotation->getTag()->getName(); - $content = $this->extractContentFromAnnotation($annotation); - $annotations[$tag] = $content; - $annotation->remove(); - } - - if (!isset($annotations['expectedException'])) { - continue; - } - - if (!$this->fixMessageRegExp && isset($annotations['expectedExceptionMessageRegExp'])) { - continue; - } - - $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $docBlockIndex); - - $paramList = $this->annotationsToParamList($annotations); - - $newMethodsCode = '' - .(isset($annotations['expectedExceptionMessageRegExp']) ? 'setExpectedExceptionRegExp' : 'setExpectedException') - .'(' - .implode(', ', $paramList) - .');'; - $newMethods = Tokens::fromCode($newMethodsCode); - $newMethods[0] = new Token([ - T_WHITESPACE, - $this->whitespacesConfig->getLineEnding().$originalIndent.$this->whitespacesConfig->getIndent(), - ]); - - // apply changes - $docContent = $doc->getContent(); - if ('' === $docContent) { - $docContent = '/** */'; - } - $tokens[$docBlockIndex] = new Token([T_DOC_COMMENT, $docContent]); - $tokens->insertAt($braceIndex + 1, $newMethods); - - $whitespaceIndex = $braceIndex + $newMethods->getSize() + 1; - $tokens[$whitespaceIndex] = new Token([ - T_WHITESPACE, - $this->whitespacesConfig->getLineEnding().$tokens[$whitespaceIndex]->getContent(), - ]); - - $i = $docBlockIndex; - } - } - - private function extractContentFromAnnotation(Annotation $annotation): string - { - $tag = $annotation->getTag()->getName(); - - if (!Preg::match('/@'.$tag.'\s+(.+)$/s', $annotation->getContent(), $matches)) { - return ''; - } - - $content = Preg::replace('/\*+\/$/', '', $matches[1]); - - if (Preg::match('/\R/u', $content)) { - $content = Preg::replace('/\s*\R+\s*\*\s*/u', ' ', $content); - } - - return rtrim($content); - } - - /** - * @param array $annotations - * - * @return list - */ - private function annotationsToParamList(array $annotations): array - { - $params = []; - $exceptionClass = ltrim($annotations['expectedException'], '\\'); - - if (str_contains($exceptionClass, '*')) { - $exceptionClass = substr($exceptionClass, 0, strpos($exceptionClass, '*')); - } - - $exceptionClass = trim($exceptionClass); - - if (true === $this->configuration['use_class_const']) { - $params[] = "\\{$exceptionClass}::class"; - } else { - $params[] = "'{$exceptionClass}'"; - } - - if (isset($annotations['expectedExceptionMessage'])) { - $params[] = var_export($annotations['expectedExceptionMessage'], true); - } elseif (isset($annotations['expectedExceptionMessageRegExp'])) { - $params[] = var_export($annotations['expectedExceptionMessageRegExp'], true); - } elseif (isset($annotations['expectedExceptionCode'])) { - $params[] = 'null'; - } - - if (isset($annotations['expectedExceptionCode'])) { - $params[] = $annotations['expectedExceptionCode']; - } - - return $params; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixer.php deleted file mode 100644 index 7ee72545..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixer.php +++ /dev/null @@ -1,111 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Gert de Pagter - */ -final class PhpUnitSetUpTearDownVisibilityFixer extends AbstractPhpUnitFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Changes the visibility of the `setUp()` and `tearDown()` functions of PHPUnit to `protected`, to match the PHPUnit TestCase.', - [ - new CodeSample( - 'hello = "hello"; - } - - public function tearDown() - { - $this->hello = null; - } -} -' - ), - ], - null, - 'This fixer may change functions named `setUp()` or `tearDown()` outside of PHPUnit tests, '. - 'when a class is wrongly seen as a PHPUnit test.' - ); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $counter = 0; - $tokensAnalyzer = new TokensAnalyzer($tokens); - - $slicesToInsert = []; - - for ($index = $startIndex + 1; $index < $endIndex; ++$index) { - if (2 === $counter) { - break; // we've seen both methods we are interested in, so stop analyzing this class - } - - if ($tokens[$index]->equals('{')) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - - continue; - } - - if (!$tokens[$index]->isGivenKind(T_FUNCTION)) { - continue; - } - - $functionNameIndex = $tokens->getNextMeaningfulToken($index); - $functionName = strtolower($tokens[$functionNameIndex]->getContent()); - - if ('setup' !== $functionName && 'teardown' !== $functionName) { - continue; - } - - ++$counter; - - $visibility = $tokensAnalyzer->getMethodAttributes($index)['visibility']; - - if (T_PUBLIC === $visibility) { - $visibilityIndex = $tokens->getPrevTokenOfKind($index, [[T_PUBLIC]]); - $tokens[$visibilityIndex] = new Token([T_PROTECTED, 'protected']); - - continue; - } - - if (null === $visibility) { - $slicesToInsert[$index] = [new Token([T_PROTECTED, 'protected']), new Token([T_WHITESPACE, ' '])]; - } - } - - $tokens->insertSlices($slicesToInsert); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSizeClassFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSizeClassFixer.php deleted file mode 100644 index 669bb78a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitSizeClassFixer.php +++ /dev/null @@ -1,107 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Jefersson Nathan - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * group?: 'large'|'medium'|'small' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * group: 'large'|'medium'|'small' - * } - */ -final class PhpUnitSizeClassFixer extends AbstractPhpUnitFixer implements WhitespacesAwareFixerInterface, ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const SIZES = ['small', 'medium', 'large']; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'All PHPUnit test cases should have `@small`, `@medium` or `@large` annotation to enable run time limits.', - [ - new CodeSample(" 'medium']), - ], - 'The special groups [small, medium, large] provides a way to identify tests that are taking long to be executed.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocSeparationFixer. - */ - public function getPriority(): int - { - return 0; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('group', 'Define a specific group to be used in case no group is already in use.')) - ->setAllowedValues(self::SIZES) - ->setDefault('small') - ->getOption(), - ]); - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $classIndex = $tokens->getPrevTokenOfKind($startIndex, [[T_CLASS]]); - - if ($this->isAbstractClass($tokens, $classIndex)) { - return; - } - - $this->ensureIsDocBlockWithAnnotation( - $tokens, - $classIndex, - $this->configuration['group'], - self::SIZES, - [ - 'phpunit\framework\attributes\small', - 'phpunit\framework\attributes\medium', - 'phpunit\framework\attributes\large', - ], - ); - } - - private function isAbstractClass(Tokens $tokens, int $i): bool - { - $typeIndex = $tokens->getPrevMeaningfulToken($i); - - return $tokens[$typeIndex]->isGivenKind(T_ABSTRACT); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitStrictFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitStrictFixer.php deleted file mode 100644 index f3d8fcc8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitStrictFixer.php +++ /dev/null @@ -1,154 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * assertions?: list<'assertAttributeEquals'|'assertAttributeNotEquals'|'assertEquals'|'assertNotEquals'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * assertions: list<'assertAttributeEquals'|'assertAttributeNotEquals'|'assertEquals'|'assertNotEquals'> - * } - */ -final class PhpUnitStrictFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var array - */ - private const ASSERTION_MAP = [ - 'assertAttributeEquals' => 'assertAttributeSame', - 'assertAttributeNotEquals' => 'assertAttributeNotSame', - 'assertEquals' => 'assertSame', - 'assertNotEquals' => 'assertNotSame', - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPUnit methods like `assertSame` should be used instead of `assertEquals`.', - [ - new CodeSample( - 'assertAttributeEquals(a(), b()); - $this->assertAttributeNotEquals(a(), b()); - $this->assertEquals(a(), b()); - $this->assertNotEquals(a(), b()); - } -} -' - ), - new CodeSample( - 'assertAttributeEquals(a(), b()); - $this->assertAttributeNotEquals(a(), b()); - $this->assertEquals(a(), b()); - $this->assertNotEquals(a(), b()); - } -} -', - ['assertions' => ['assertEquals']] - ), - ], - null, - 'Risky when any of the functions are overridden or when testing object equality.' - ); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $argumentsAnalyzer = new ArgumentsAnalyzer(); - $functionsAnalyzer = new FunctionsAnalyzer(); - - foreach ($this->configuration['assertions'] as $methodBefore) { - $methodAfter = self::ASSERTION_MAP[$methodBefore]; - - for ($index = $startIndex; $index < $endIndex; ++$index) { - $methodIndex = $tokens->getNextTokenOfKind($index, [[T_STRING, $methodBefore]]); - - if (null === $methodIndex) { - break; - } - - if (!$functionsAnalyzer->isTheSameClassCall($tokens, $methodIndex)) { - continue; - } - - $openingParenthesisIndex = $tokens->getNextMeaningfulToken($methodIndex); - $argumentsCount = $argumentsAnalyzer->countArguments( - $tokens, - $openingParenthesisIndex, - $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openingParenthesisIndex) - ); - - if (2 === $argumentsCount || 3 === $argumentsCount) { - $tokens[$methodIndex] = new Token([T_STRING, $methodAfter]); - } - - $index = $methodIndex; - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('assertions', 'List of assertion methods to fix.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset(array_keys(self::ASSERTION_MAP))]) - ->setDefault([ - 'assertAttributeEquals', - 'assertAttributeNotEquals', - 'assertEquals', - 'assertNotEquals', - ]) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTargetVersion.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTargetVersion.php deleted file mode 100644 index 8ecc1c2d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTargetVersion.php +++ /dev/null @@ -1,57 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use Composer\Semver\Comparator; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class PhpUnitTargetVersion -{ - public const VERSION_3_0 = '3.0'; - public const VERSION_3_2 = '3.2'; - public const VERSION_3_5 = '3.5'; - public const VERSION_4_3 = '4.3'; - public const VERSION_4_8 = '4.8'; - public const VERSION_5_0 = '5.0'; - public const VERSION_5_2 = '5.2'; - public const VERSION_5_4 = '5.4'; - public const VERSION_5_5 = '5.5'; - public const VERSION_5_6 = '5.6'; - public const VERSION_5_7 = '5.7'; - public const VERSION_6_0 = '6.0'; - public const VERSION_7_5 = '7.5'; - public const VERSION_8_4 = '8.4'; - public const VERSION_9_1 = '9.1'; - public const VERSION_NEWEST = 'newest'; - - private function __construct() {} - - public static function fulfills(string $candidate, string $target): bool - { - if (self::VERSION_NEWEST === $target) { - throw new \LogicException(\sprintf('Parameter `target` shall not be provided as "%s", determine proper target for tested PHPUnit feature instead.', self::VERSION_NEWEST)); - } - - if (self::VERSION_NEWEST === $candidate) { - return true; - } - - return Comparator::greaterThanOrEqualTo($candidate, $target); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php deleted file mode 100644 index 8b524346..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php +++ /dev/null @@ -1,416 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\Line; -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Gert de Pagter - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * style?: 'annotation'|'prefix' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * style: 'annotation'|'prefix' - * } - */ -final class PhpUnitTestAnnotationFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function isRisky(): bool - { - return true; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Adds or removes @test annotations from tests, following configuration.', - [ - new CodeSample('whitespacesConfig->getLineEnding()), - new CodeSample('whitespacesConfig->getLineEnding(), ['style' => 'annotation']), - ], - null, - 'This fixer may change the name of your tests, and could cause incompatibility with'. - ' abstract classes or interfaces.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoEmptyPhpdocFixer, PhpUnitMethodCasingFixer, PhpdocTrimFixer. - */ - public function getPriority(): int - { - return 10; - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - if ('annotation' === $this->configuration['style']) { - $this->applyTestAnnotation($tokens, $startIndex, $endIndex); - } else { - $this->applyTestPrefix($tokens, $startIndex, $endIndex); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('style', 'Whether to use the @test annotation or not.')) - ->setAllowedValues(['prefix', 'annotation']) - ->setDefault('prefix') - ->getOption(), - ]); - } - - private function applyTestAnnotation(Tokens $tokens, int $startIndex, int $endIndex): void - { - for ($i = $endIndex - 1; $i > $startIndex; --$i) { - if (!$this->isTestMethod($tokens, $i)) { - continue; - } - - $functionNameIndex = $tokens->getNextMeaningfulToken($i); - $functionName = $tokens[$functionNameIndex]->getContent(); - - if ($this->hasTestPrefix($functionName) && !$this->hasProperTestAnnotation($tokens, $i)) { - $newFunctionName = $this->removeTestPrefix($functionName); - $tokens[$functionNameIndex] = new Token([T_STRING, $newFunctionName]); - } - - $docBlockIndex = $this->getDocBlockIndex($tokens, $i); - - if ($this->isPHPDoc($tokens, $docBlockIndex)) { - $lines = $this->updateDocBlock($tokens, $docBlockIndex); - $lines = $this->addTestAnnotation($lines, $tokens, $docBlockIndex); - $lines = implode('', $lines); - - $tokens[$docBlockIndex] = new Token([T_DOC_COMMENT, $lines]); - } else { - // Create a new docblock if it didn't have one before; - $this->createDocBlock($tokens, $docBlockIndex); - } - } - } - - private function applyTestPrefix(Tokens $tokens, int $startIndex, int $endIndex): void - { - for ($i = $endIndex - 1; $i > $startIndex; --$i) { - // We explicitly check again if the function has a doc block to save some time. - if (!$this->isTestMethod($tokens, $i)) { - continue; - } - - $docBlockIndex = $this->getDocBlockIndex($tokens, $i); - - if (!$this->isPHPDoc($tokens, $docBlockIndex)) { - continue; - } - - $lines = $this->updateDocBlock($tokens, $docBlockIndex); - $lines = implode('', $lines); - $tokens[$docBlockIndex] = new Token([T_DOC_COMMENT, $lines]); - - $functionNameIndex = $tokens->getNextMeaningfulToken($i); - $functionName = $tokens[$functionNameIndex]->getContent(); - - if ($this->hasTestPrefix($functionName)) { - continue; - } - - $newFunctionName = $this->addTestPrefix($functionName); - $tokens[$functionNameIndex] = new Token([T_STRING, $newFunctionName]); - } - } - - private function isTestMethod(Tokens $tokens, int $index): bool - { - // Check if we are dealing with a (non-abstract, non-lambda) function - if (!$this->isMethod($tokens, $index)) { - return false; - } - - // if the function name starts with test it is a test - $functionNameIndex = $tokens->getNextMeaningfulToken($index); - $functionName = $tokens[$functionNameIndex]->getContent(); - - if ($this->hasTestPrefix($functionName)) { - return true; - } - - $docBlockIndex = $this->getDocBlockIndex($tokens, $index); - - // If the function doesn't have test in its name, and no doc block, it is not a test - return - $this->isPHPDoc($tokens, $docBlockIndex) - && str_contains($tokens[$docBlockIndex]->getContent(), '@test'); - } - - private function isMethod(Tokens $tokens, int $index): bool - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - return $tokens[$index]->isGivenKind(T_FUNCTION) && !$tokensAnalyzer->isLambda($index); - } - - private function hasTestPrefix(string $functionName): bool - { - return str_starts_with($functionName, 'test'); - } - - private function hasProperTestAnnotation(Tokens $tokens, int $index): bool - { - $docBlockIndex = $this->getDocBlockIndex($tokens, $index); - $doc = $tokens[$docBlockIndex]->getContent(); - - return Preg::match('/\*\s+@test\b/', $doc); - } - - private function removeTestPrefix(string $functionName): string - { - $remainder = Preg::replace('/^test(?=[A-Z_])_?/', '', $functionName); - - if ('' === $remainder) { - return $functionName; - } - - return lcfirst($remainder); - } - - private function addTestPrefix(string $functionName): string - { - return 'test'.ucfirst($functionName); - } - - private function createDocBlock(Tokens $tokens, int $docBlockIndex): void - { - $lineEnd = $this->whitespacesConfig->getLineEnding(); - $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex)); - $toInsert = [ - new Token([T_DOC_COMMENT, '/**'.$lineEnd."{$originalIndent} * @test".$lineEnd."{$originalIndent} */"]), - new Token([T_WHITESPACE, $lineEnd.$originalIndent]), - ]; - $index = $tokens->getNextMeaningfulToken($docBlockIndex); - $tokens->insertAt($index, $toInsert); - } - - /** - * @return list - */ - private function updateDocBlock(Tokens $tokens, int $docBlockIndex): array - { - $doc = new DocBlock($tokens[$docBlockIndex]->getContent()); - $lines = $doc->getLines(); - - return $this->updateLines($lines, $tokens, $docBlockIndex); - } - - /** - * @param list $lines - * - * @return list - */ - private function updateLines(array $lines, Tokens $tokens, int $docBlockIndex): array - { - $needsAnnotation = 'annotation' === $this->configuration['style']; - - $doc = new DocBlock($tokens[$docBlockIndex]->getContent()); - for ($i = 0; $i < \count($lines); ++$i) { - // If we need to add test annotation and it is a single line comment we need to deal with that separately - if ($needsAnnotation && ($lines[$i]->isTheStart() && $lines[$i]->isTheEnd())) { - if (!$this->doesDocBlockContainTest($doc)) { - $lines = $this->splitUpDocBlock($lines, $tokens, $docBlockIndex); - - return $this->updateLines($lines, $tokens, $docBlockIndex); - } - // One we split it up, we run the function again, so we deal with other things in a proper way - } - - if (!$needsAnnotation - && str_contains($lines[$i]->getContent(), ' @test') - && !str_contains($lines[$i]->getContent(), '@testWith') - && !str_contains($lines[$i]->getContent(), '@testdox') - ) { - // We remove @test from the doc block - $lines[$i] = new Line(str_replace(' @test', '', $lines[$i]->getContent())); - } - // ignore the line if it isn't @depends - if (!str_contains($lines[$i]->getContent(), '@depends')) { - continue; - } - - $lines[$i] = $this->updateDependsAnnotation($lines[$i]); - } - - return $lines; - } - - /** - * Take a one line doc block, and turn it into a multi line doc block. - * - * @param non-empty-list $lines - * - * @return list - */ - private function splitUpDocBlock(array $lines, Tokens $tokens, int $docBlockIndex): array - { - $lineContent = $this->getSingleLineDocBlockEntry($lines); - $lineEnd = $this->whitespacesConfig->getLineEnding(); - $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex)); - - return [ - new Line('/**'.$lineEnd), - new Line($originalIndent.' * '.$lineContent.$lineEnd), - new Line($originalIndent.' */'), - ]; - } - - /** - * @todo check whether it's doable to use \PhpCsFixer\DocBlock\DocBlock::getSingleLineDocBlockEntry instead - * - * @param non-empty-list $lines - */ - private function getSingleLineDocBlockEntry(array $lines): string - { - $line = $lines[0]; - $line = str_replace('*/', '', $line->getContent()); - $line = trim($line); - $line = str_split($line); - $i = \count($line); - do { - --$i; - } while ('*' !== $line[$i] && '*' !== $line[$i - 1] && '/' !== $line[$i - 2]); - if (' ' === $line[$i]) { - ++$i; - } - $line = \array_slice($line, $i); - - return implode('', $line); - } - - /** - * Updates the depends tag on the current doc block. - */ - private function updateDependsAnnotation(Line $line): Line - { - if ('annotation' === $this->configuration['style']) { - return $this->removeTestPrefixFromDependsAnnotation($line); - } - - return $this->addTestPrefixToDependsAnnotation($line); - } - - private function removeTestPrefixFromDependsAnnotation(Line $line): Line - { - $line = str_split($line->getContent()); - - $dependsIndex = $this->findWhereDependsFunctionNameStarts($line); - $dependsFunctionName = implode('', \array_slice($line, $dependsIndex)); - - if ($this->hasTestPrefix($dependsFunctionName)) { - $dependsFunctionName = $this->removeTestPrefix($dependsFunctionName); - } - array_splice($line, $dependsIndex); - - return new Line(implode('', $line).$dependsFunctionName); - } - - private function addTestPrefixToDependsAnnotation(Line $line): Line - { - $line = str_split($line->getContent()); - $dependsIndex = $this->findWhereDependsFunctionNameStarts($line); - $dependsFunctionName = implode('', \array_slice($line, $dependsIndex)); - - if (!$this->hasTestPrefix($dependsFunctionName)) { - $dependsFunctionName = $this->addTestPrefix($dependsFunctionName); - } - - array_splice($line, $dependsIndex); - - return new Line(implode('', $line).$dependsFunctionName); - } - - /** - * Helps to find where the function name in the doc block starts. - * - * @param list $line - */ - private function findWhereDependsFunctionNameStarts(array $line): int - { - $index = stripos(implode('', $line), '@depends') + 8; - - while (' ' === $line[$index]) { - ++$index; - } - - return $index; - } - - /** - * @param list $lines - * - * @return list - */ - private function addTestAnnotation(array $lines, Tokens $tokens, int $docBlockIndex): array - { - $doc = new DocBlock($tokens[$docBlockIndex]->getContent()); - - if (!$this->doesDocBlockContainTest($doc)) { - $originalIndent = WhitespacesAnalyzer::detectIndent($tokens, $docBlockIndex); - $lineEnd = $this->whitespacesConfig->getLineEnding(); - - array_splice($lines, -1, 0, [new Line($originalIndent.' *'.$lineEnd.$originalIndent.' * @test'.$lineEnd)]); - \assert(array_is_list($lines)); // we know it's list, but we need to tell PHPStan - } - - return $lines; - } - - private function doesDocBlockContainTest(DocBlock $doc): bool - { - return 0 !== \count($doc->getAnnotationsOfType('test')); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixer.php deleted file mode 100644 index 7e1f026f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixer.php +++ /dev/null @@ -1,564 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; -use PhpCsFixer\Utils; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * @author Filippo Tessarotto - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * call_type?: 'self'|'static'|'this', - * methods?: array - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * call_type: 'self'|'static'|'this', - * methods: array - * } - */ -final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const CALL_TYPE_THIS = 'this'; - - /** - * @internal - */ - public const CALL_TYPE_SELF = 'self'; - - /** - * @internal - */ - public const CALL_TYPE_STATIC = 'static'; - - /** - * @var array - */ - private const STATIC_METHODS = [ - // Assert methods - 'anything' => true, - 'arrayHasKey' => true, - 'assertArrayHasKey' => true, - 'assertArrayIsEqualToArrayIgnoringListOfKeys' => true, - 'assertArrayIsEqualToArrayOnlyConsideringListOfKeys' => true, - 'assertArrayIsIdenticalToArrayIgnoringListOfKeys' => true, - 'assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys' => true, - 'assertArrayNotHasKey' => true, - 'assertArraySubset' => true, - 'assertAttributeContains' => true, - 'assertAttributeContainsOnly' => true, - 'assertAttributeCount' => true, - 'assertAttributeEmpty' => true, - 'assertAttributeEquals' => true, - 'assertAttributeGreaterThan' => true, - 'assertAttributeGreaterThanOrEqual' => true, - 'assertAttributeInstanceOf' => true, - 'assertAttributeInternalType' => true, - 'assertAttributeLessThan' => true, - 'assertAttributeLessThanOrEqual' => true, - 'assertAttributeNotContains' => true, - 'assertAttributeNotContainsOnly' => true, - 'assertAttributeNotCount' => true, - 'assertAttributeNotEmpty' => true, - 'assertAttributeNotEquals' => true, - 'assertAttributeNotInstanceOf' => true, - 'assertAttributeNotInternalType' => true, - 'assertAttributeNotSame' => true, - 'assertAttributeSame' => true, - 'assertClassHasAttribute' => true, - 'assertClassHasStaticAttribute' => true, - 'assertClassNotHasAttribute' => true, - 'assertClassNotHasStaticAttribute' => true, - 'assertContains' => true, - 'assertContainsEquals' => true, - 'assertContainsNotOnlyArray' => true, - 'assertContainsNotOnlyBool' => true, - 'assertContainsNotOnlyCallable' => true, - 'assertContainsNotOnlyClosedResource' => true, - 'assertContainsNotOnlyFloat' => true, - 'assertContainsNotOnlyInstancesOf' => true, - 'assertContainsNotOnlyInt' => true, - 'assertContainsNotOnlyIterable' => true, - 'assertContainsNotOnlyNull' => true, - 'assertContainsNotOnlyNumeric' => true, - 'assertContainsNotOnlyObject' => true, - 'assertContainsNotOnlyResource' => true, - 'assertContainsNotOnlyScalar' => true, - 'assertContainsNotOnlyString' => true, - 'assertContainsOnly' => true, - 'assertContainsOnlyArray' => true, - 'assertContainsOnlyBool' => true, - 'assertContainsOnlyCallable' => true, - 'assertContainsOnlyClosedResource' => true, - 'assertContainsOnlyFloat' => true, - 'assertContainsOnlyInstancesOf' => true, - 'assertContainsOnlyInt' => true, - 'assertContainsOnlyIterable' => true, - 'assertContainsOnlyNull' => true, - 'assertContainsOnlyNumeric' => true, - 'assertContainsOnlyObject' => true, - 'assertContainsOnlyResource' => true, - 'assertContainsOnlyScalar' => true, - 'assertContainsOnlyString' => true, - 'assertCount' => true, - 'assertDirectoryDoesNotExist' => true, - 'assertDirectoryExists' => true, - 'assertDirectoryIsNotReadable' => true, - 'assertDirectoryIsNotWritable' => true, - 'assertDirectoryIsReadable' => true, - 'assertDirectoryIsWritable' => true, - 'assertDirectoryNotExists' => true, - 'assertDirectoryNotIsReadable' => true, - 'assertDirectoryNotIsWritable' => true, - 'assertDoesNotMatchRegularExpression' => true, - 'assertEmpty' => true, - 'assertEquals' => true, - 'assertEqualsCanonicalizing' => true, - 'assertEqualsIgnoringCase' => true, - 'assertEqualsWithDelta' => true, - 'assertEqualXMLStructure' => true, - 'assertFalse' => true, - 'assertFileDoesNotExist' => true, - 'assertFileEquals' => true, - 'assertFileEqualsCanonicalizing' => true, - 'assertFileEqualsIgnoringCase' => true, - 'assertFileExists' => true, - 'assertFileIsNotReadable' => true, - 'assertFileIsNotWritable' => true, - 'assertFileIsReadable' => true, - 'assertFileIsWritable' => true, - 'assertFileMatchesFormat' => true, - 'assertFileMatchesFormatFile' => true, - 'assertFileNotEquals' => true, - 'assertFileNotEqualsCanonicalizing' => true, - 'assertFileNotEqualsIgnoringCase' => true, - 'assertFileNotExists' => true, - 'assertFileNotIsReadable' => true, - 'assertFileNotIsWritable' => true, - 'assertFinite' => true, - 'assertGreaterThan' => true, - 'assertGreaterThanOrEqual' => true, - 'assertInfinite' => true, - 'assertInstanceOf' => true, - 'assertInternalType' => true, - 'assertIsArray' => true, - 'assertIsBool' => true, - 'assertIsCallable' => true, - 'assertIsClosedResource' => true, - 'assertIsFloat' => true, - 'assertIsInt' => true, - 'assertIsIterable' => true, - 'assertIsList' => true, - 'assertIsNotArray' => true, - 'assertIsNotBool' => true, - 'assertIsNotCallable' => true, - 'assertIsNotClosedResource' => true, - 'assertIsNotFloat' => true, - 'assertIsNotInt' => true, - 'assertIsNotIterable' => true, - 'assertIsNotNumeric' => true, - 'assertIsNotObject' => true, - 'assertIsNotReadable' => true, - 'assertIsNotResource' => true, - 'assertIsNotScalar' => true, - 'assertIsNotString' => true, - 'assertIsNotWritable' => true, - 'assertIsNumeric' => true, - 'assertIsObject' => true, - 'assertIsReadable' => true, - 'assertIsResource' => true, - 'assertIsScalar' => true, - 'assertIsString' => true, - 'assertIsWritable' => true, - 'assertJson' => true, - 'assertJsonFileEqualsJsonFile' => true, - 'assertJsonFileNotEqualsJsonFile' => true, - 'assertJsonStringEqualsJsonFile' => true, - 'assertJsonStringEqualsJsonString' => true, - 'assertJsonStringNotEqualsJsonFile' => true, - 'assertJsonStringNotEqualsJsonString' => true, - 'assertLessThan' => true, - 'assertLessThanOrEqual' => true, - 'assertMatchesRegularExpression' => true, - 'assertNan' => true, - 'assertNotContains' => true, - 'assertNotContainsEquals' => true, - 'assertNotContainsOnly' => true, - 'assertNotCount' => true, - 'assertNotEmpty' => true, - 'assertNotEquals' => true, - 'assertNotEqualsCanonicalizing' => true, - 'assertNotEqualsIgnoringCase' => true, - 'assertNotEqualsWithDelta' => true, - 'assertNotFalse' => true, - 'assertNotInstanceOf' => true, - 'assertNotInternalType' => true, - 'assertNotIsReadable' => true, - 'assertNotIsWritable' => true, - 'assertNotNull' => true, - 'assertNotRegExp' => true, - 'assertNotSame' => true, - 'assertNotSameSize' => true, - 'assertNotTrue' => true, - 'assertNull' => true, - 'assertObjectEquals' => true, - 'assertObjectHasAttribute' => true, - 'assertObjectHasProperty' => true, - 'assertObjectNotEquals' => true, - 'assertObjectNotHasAttribute' => true, - 'assertObjectNotHasProperty' => true, - 'assertRegExp' => true, - 'assertSame' => true, - 'assertSameSize' => true, - 'assertStringContainsString' => true, - 'assertStringContainsStringIgnoringCase' => true, - 'assertStringContainsStringIgnoringLineEndings' => true, - 'assertStringEndsNotWith' => true, - 'assertStringEndsWith' => true, - 'assertStringEqualsFile' => true, - 'assertStringEqualsFileCanonicalizing' => true, - 'assertStringEqualsFileIgnoringCase' => true, - 'assertStringEqualsStringIgnoringLineEndings' => true, - 'assertStringMatchesFormat' => true, - 'assertStringMatchesFormatFile' => true, - 'assertStringNotContainsString' => true, - 'assertStringNotContainsStringIgnoringCase' => true, - 'assertStringNotEqualsFile' => true, - 'assertStringNotEqualsFileCanonicalizing' => true, - 'assertStringNotEqualsFileIgnoringCase' => true, - 'assertStringNotMatchesFormat' => true, - 'assertStringNotMatchesFormatFile' => true, - 'assertStringStartsNotWith' => true, - 'assertStringStartsWith' => true, - 'assertThat' => true, - 'assertTrue' => true, - 'assertXmlFileEqualsXmlFile' => true, - 'assertXmlFileNotEqualsXmlFile' => true, - 'assertXmlStringEqualsXmlFile' => true, - 'assertXmlStringEqualsXmlString' => true, - 'assertXmlStringNotEqualsXmlFile' => true, - 'assertXmlStringNotEqualsXmlString' => true, - 'attribute' => true, - 'attributeEqualTo' => true, - 'callback' => true, - 'classHasAttribute' => true, - 'classHasStaticAttribute' => true, - 'contains' => true, - 'containsEqual' => true, - 'containsIdentical' => true, - 'containsOnly' => true, - 'containsOnlyArray' => true, - 'containsOnlyBool' => true, - 'containsOnlyCallable' => true, - 'containsOnlyClosedResource' => true, - 'containsOnlyFloat' => true, - 'containsOnlyInstancesOf' => true, - 'containsOnlyInt' => true, - 'containsOnlyIterable' => true, - 'containsOnlyNull' => true, - 'containsOnlyNumeric' => true, - 'containsOnlyObject' => true, - 'containsOnlyResource' => true, - 'containsOnlyScalar' => true, - 'containsOnlyString' => true, - 'countOf' => true, - 'directoryExists' => true, - 'equalTo' => true, - 'equalToCanonicalizing' => true, - 'equalToIgnoringCase' => true, - 'equalToWithDelta' => true, - 'fail' => true, - 'fileExists' => true, - 'getCount' => true, - 'getObjectAttribute' => true, - 'getStaticAttribute' => true, - 'greaterThan' => true, - 'greaterThanOrEqual' => true, - 'identicalTo' => true, - 'isArray' => true, - 'isBool' => true, - 'isCallable' => true, - 'isClosedResource' => true, - 'isEmpty' => true, - 'isFalse' => true, - 'isFinite' => true, - 'isFloat' => true, - 'isInfinite' => true, - 'isInstanceOf' => true, - 'isInt' => true, - 'isIterable' => true, - 'isJson' => true, - 'isList' => true, - 'isNan' => true, - 'isNull' => true, - 'isNumeric' => true, - 'isObject' => true, - 'isReadable' => true, - 'isResource' => true, - 'isScalar' => true, - 'isString' => true, - 'isTrue' => true, - 'isType' => true, - 'isWritable' => true, - 'lessThan' => true, - 'lessThanOrEqual' => true, - 'logicalAnd' => true, - 'logicalNot' => true, - 'logicalOr' => true, - 'logicalXor' => true, - 'markTestIncomplete' => true, - 'markTestSkipped' => true, - 'matches' => true, - 'matchesRegularExpression' => true, - 'objectEquals' => true, - 'objectHasAttribute' => true, - 'readAttribute' => true, - 'resetCount' => true, - 'stringContains' => true, - 'stringEndsWith' => true, - 'stringEqualsStringIgnoringLineEndings' => true, - 'stringStartsWith' => true, - - // TestCase methods - 'any' => true, - 'at' => true, - 'atLeast' => true, - 'atLeastOnce' => true, - 'atMost' => true, - 'createStub' => true, - 'createConfiguredStub' => true, - 'createStubForIntersectionOfInterfaces' => true, - 'exactly' => true, - 'never' => true, - 'once' => true, - 'onConsecutiveCalls' => true, - 'returnArgument' => true, - 'returnCallback' => true, - 'returnSelf' => true, - 'returnValue' => true, - 'returnValueMap' => true, - 'setUpBeforeClass' => true, - 'tearDownAfterClass' => true, - 'throwException' => true, - ]; - - /** - * @var array - */ - private const ALLOWED_VALUES = [ - self::CALL_TYPE_THIS => true, - self::CALL_TYPE_SELF => true, - self::CALL_TYPE_STATIC => true, - ]; - - /** - * @var array> - */ - private array $conversionMap = [ - self::CALL_TYPE_THIS => [[T_OBJECT_OPERATOR, '->'], [T_VARIABLE, '$this']], - self::CALL_TYPE_SELF => [[T_DOUBLE_COLON, '::'], [T_STRING, 'self']], - self::CALL_TYPE_STATIC => [[T_DOUBLE_COLON, '::'], [T_STATIC, 'static']], - ]; - - public function getDefinition(): FixerDefinitionInterface - { - $codeSample = 'assertSame(1, 2); - self::assertSame(1, 2); - static::assertSame(1, 2); - static::assertTrue(false); - } -} -'; - - return new FixerDefinition( - 'Calls to `PHPUnit\Framework\TestCase` static methods must all be of the same type, either `$this->`, `self::` or `static::`.', - [ - new CodeSample($codeSample), - new CodeSample($codeSample, ['call_type' => self::CALL_TYPE_THIS]), - new CodeSample($codeSample, ['methods' => ['assertTrue' => self::CALL_TYPE_THIS]]), - ], - null, - 'Risky when PHPUnit methods are overridden or not accessible, or when project has PHPUnit incompatibilities.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before SelfStaticAccessorFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isRisky(): bool - { - return true; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('call_type', 'The call type to use for referring to PHPUnit methods.')) - ->setAllowedTypes(['string']) - ->setAllowedValues(array_keys(self::ALLOWED_VALUES)) - ->setDefault('static') - ->getOption(), - (new FixerOptionBuilder('methods', 'Dictionary of `method` => `call_type` values that differ from the default strategy.')) - ->setAllowedTypes(['array']) - ->setAllowedValues([static function (array $option): bool { - foreach ($option as $method => $value) { - if (!isset(self::STATIC_METHODS[$method])) { - throw new InvalidOptionsException( - \sprintf( - 'Unexpected "methods" key, expected any of %s, got "%s".', - Utils::naturalLanguageJoin(array_keys(self::STATIC_METHODS)), - \gettype($method).'#'.$method - ) - ); - } - - if (!isset(self::ALLOWED_VALUES[$value])) { - throw new InvalidOptionsException( - \sprintf( - 'Unexpected value for method "%s", expected any of %s, got "%s".', - $method, - Utils::naturalLanguageJoin(array_keys(self::ALLOWED_VALUES)), - \is_object($value) ? \get_class($value) : (null === $value ? 'null' : \gettype($value).'#'.$value) - ) - ); - } - } - - return true; - }]) - ->setDefault([]) - ->getOption(), - ]); - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $analyzer = new TokensAnalyzer($tokens); - - for ($index = $startIndex; $index < $endIndex; ++$index) { - // skip anonymous classes - if ($tokens[$index]->isGivenKind(T_CLASS)) { - $index = $this->findEndOfNextBlock($tokens, $index); - - continue; - } - - $callType = $this->configuration['call_type']; - - if ($tokens[$index]->isGivenKind(T_FUNCTION)) { - // skip lambda - if ($analyzer->isLambda($index)) { - $index = $this->findEndOfNextBlock($tokens, $index); - - continue; - } - - // do not change `self` to `this` in static methods - if ('this' === $callType) { - $attributes = $analyzer->getMethodAttributes($index); - - if (false !== $attributes['static']) { - $index = $this->findEndOfNextBlock($tokens, $index); - - continue; - } - } - } - - if (!$tokens[$index]->isGivenKind(T_STRING) || !isset(self::STATIC_METHODS[$tokens[$index]->getContent()])) { - continue; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$nextIndex]->equals('(')) { - $index = $nextIndex; - - continue; - } - - if ($tokens[$tokens->getNextMeaningfulToken($nextIndex)]->isGivenKind(CT::T_FIRST_CLASS_CALLABLE)) { - continue; - } - - $methodName = $tokens[$index]->getContent(); - - if (isset($this->configuration['methods'][$methodName])) { - $callType = $this->configuration['methods'][$methodName]; - } - - $operatorIndex = $tokens->getPrevMeaningfulToken($index); - $referenceIndex = $tokens->getPrevMeaningfulToken($operatorIndex); - - if (!$this->needsConversion($tokens, $index, $referenceIndex, $callType)) { - continue; - } - - $tokens[$operatorIndex] = new Token($this->conversionMap[$callType][0]); - $tokens[$referenceIndex] = new Token($this->conversionMap[$callType][1]); - } - } - - private function needsConversion(Tokens $tokens, int $index, int $referenceIndex, string $callType): bool - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - return $functionsAnalyzer->isTheSameClassCall($tokens, $index) - && !$tokens[$referenceIndex]->equals($this->conversionMap[$callType][1], false); - } - - private function findEndOfNextBlock(Tokens $tokens, int $index): int - { - $nextIndex = $tokens->getNextTokenOfKind($index, [';', '{']); - - return $tokens[$nextIndex]->equals('{') - ? $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $nextIndex) - : $nextIndex; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixer.php deleted file mode 100644 index 5e3de5af..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixer.php +++ /dev/null @@ -1,88 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\PhpUnit; - -use PhpCsFixer\Fixer\AbstractPhpUnitFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Dariusz Rumiński - */ -final class PhpUnitTestClassRequiresCoversFixer extends AbstractPhpUnitFixer implements WhitespacesAwareFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Adds a default `@coversNothing` annotation to PHPUnit test classes that have no `@covers*` annotation.', - [ - new CodeSample( - 'assertSame(a(), b()); - } -} -' - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocSeparationFixer. - */ - public function getPriority(): int - { - return 0; - } - - protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex): void - { - $classIndex = $tokens->getPrevTokenOfKind($startIndex, [[T_CLASS]]); - - $tokensAnalyzer = new TokensAnalyzer($tokens); - $modifiers = $tokensAnalyzer->getClassyModifiers($classIndex); - - if (isset($modifiers['abstract'])) { - return; // don't add `@covers` annotation for abstract base classes - } - - $this->ensureIsDocBlockWithAnnotation( - $tokens, - $classIndex, - 'coversNothing', - [ - 'covers', - 'coversDefaultClass', - 'coversNothing', - ], - [ - 'phpunit\framework\attributes\coversclass', - 'phpunit\framework\attributes\coversnothing', - 'phpunit\framework\attributes\coversmethod', - 'phpunit\framework\attributes\coversfunction', - ], - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php deleted file mode 100644 index 6a92e2e3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php +++ /dev/null @@ -1,178 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - * @author Julien Falque - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * comment_type?: 'all_multiline'|'phpdocs_like'|'phpdocs_only' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * comment_type: 'all_multiline'|'phpdocs_like'|'phpdocs_only' - * } - */ -final class AlignMultilineCommentFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var null|list - */ - private ?array $tokenKinds = null; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Each line of multi-line DocComments must have an asterisk [PSR-5] and must be aligned with the first one.', - [ - new CodeSample( - ' 'phpdocs_like'] - ), - new CodeSample( - ' 'all_multiline'] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocArrayTypeFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. - * Must run after ArrayIndentationFixer. - */ - public function getPriority(): int - { - return 27; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound($this->tokenKinds); - } - - protected function configurePostNormalisation(): void - { - $this->tokenKinds = [T_DOC_COMMENT]; - if ('phpdocs_only' !== $this->configuration['comment_type']) { - $this->tokenKinds[] = T_COMMENT; - } - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind($this->tokenKinds)) { - continue; - } - - $whitespace = ''; - $previousIndex = $index - 1; - - if ($tokens[$previousIndex]->isWhitespace()) { - $whitespace = $tokens[$previousIndex]->getContent(); - --$previousIndex; - } - - if ($tokens[$previousIndex]->isGivenKind(T_OPEN_TAG)) { - $whitespace = Preg::replace('/\S/', '', $tokens[$previousIndex]->getContent()).$whitespace; - } - - if (!Preg::match('/\R(\h*)$/', $whitespace, $matches)) { - continue; - } - - if ($token->isGivenKind(T_COMMENT) && 'all_multiline' !== $this->configuration['comment_type'] && Preg::match('/\R(?:\R|\s*[^\s\*])/', $token->getContent())) { - continue; - } - - $indentation = $matches[1]; - $lines = Preg::split('/\R/u', $token->getContent()); - - foreach ($lines as $lineNumber => $line) { - if (0 === $lineNumber) { - continue; - } - - $line = ltrim($line); - - if ($token->isGivenKind(T_COMMENT) && (!isset($line[0]) || '*' !== $line[0])) { - continue; - } - - if (!isset($line[0])) { - $line = '*'; - } elseif ('*' !== $line[0]) { - $line = '* '.$line; - } - - $lines[$lineNumber] = $indentation.' '.$line; - } - - $tokens[$index] = new Token([$token->getId(), implode($lineEnding, $lines)]); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('comment_type', 'Whether to fix PHPDoc comments only (`phpdocs_only`), any multi-line comment whose lines all start with an asterisk (`phpdocs_like`) or any multi-line comment (`all_multiline`).')) - ->setAllowedValues(['phpdocs_only', 'phpdocs_like', 'all_multiline']) - ->setDefault('phpdocs_only') - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixer.php deleted file mode 100644 index 2e5ab520..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixer.php +++ /dev/null @@ -1,177 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Graham Campbell - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * annotations?: list, - * case_sensitive?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * annotations: list, - * case_sensitive: bool - * } - */ -final class GeneralPhpdocAnnotationRemoveFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Removes configured annotations from PHPDoc.', - [ - new CodeSample( - ' ['author']] - ), - new CodeSample( - ' ['author'], 'case_sensitive' => false] - ), - new CodeSample( - ' ['package', 'subpackage']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoEmptyPhpdocFixer, PhpdocAlignFixer, PhpdocLineSpanFixer, PhpdocSeparationFixer, PhpdocTrimFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 10; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if (0 === \count($this->configuration['annotations'])) { - return; - } - - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $doc = new DocBlock($token->getContent()); - $annotations = $this->getAnnotationsToRemove($doc); - - // nothing to do if there are no annotations - if (0 === \count($annotations)) { - continue; - } - - foreach ($annotations as $annotation) { - $annotation->remove(); - } - - if ('' === $doc->getContent()) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } else { - $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('annotations', 'List of annotations to remove, e.g. `["author"]`.')) - ->setAllowedTypes(['string[]']) - ->setDefault([]) - ->getOption(), - (new FixerOptionBuilder('case_sensitive', 'Should annotations be case sensitive.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } - - /** - * @return list - */ - private function getAnnotationsToRemove(DocBlock $doc): array - { - if (true === $this->configuration['case_sensitive']) { - return $doc->getAnnotationsOfType($this->configuration['annotations']); - } - - $typesToSearchFor = array_map(static fn (string $type): string => strtolower($type), $this->configuration['annotations']); - - $annotations = []; - - foreach ($doc->getAnnotations() as $annotation) { - $tagName = strtolower($annotation->getTag()->getName()); - if (\in_array($tagName, $typesToSearchFor, true)) { - $annotations[] = $annotation; - } - } - - return $annotations; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php deleted file mode 100644 index 4926a4b5..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php +++ /dev/null @@ -1,212 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; -use Symfony\Component\OptionsResolver\Options; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * case_sensitive?: bool, - * fix_annotation?: bool, - * fix_inline?: bool, - * replacements?: array - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * case_sensitive: bool, - * fix_annotation: bool, - * fix_inline: bool, - * replacements: array - * } - */ -final class GeneralPhpdocTagRenameFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Renames PHPDoc tags.', - [ - new CodeSample(" [ - 'inheritDocs' => 'inheritDoc', - ], - ]), - new CodeSample(" [ - 'inheritDocs' => 'inheritDoc', - ], - 'fix_annotation' => false, - ]), - new CodeSample(" [ - 'inheritDocs' => 'inheritDoc', - ], - 'fix_inline' => false, - ]), - new CodeSample(" [ - 'inheritDocs' => 'inheritDoc', - ], - 'case_sensitive' => true, - ]), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - // must be run before PhpdocAddMissingParamAnnotationFixer - return 11; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('fix_annotation', 'Whether annotation tags should be fixed.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('fix_inline', 'Whether inline tags should be fixed.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('replacements', 'A map of tags to replace.')) - ->setAllowedTypes(['array']) - ->setNormalizer(static function (Options $options, array $value): array { - $normalizedValue = []; - - foreach ($value as $from => $to) { - if (!\is_string($from)) { - throw new InvalidOptionsException('Tag to replace must be a string.'); - } - - if (!Preg::match('#^\S+$#', $to) || str_contains($to, '*/')) { - throw new InvalidOptionsException(\sprintf( - 'Tag "%s" cannot be replaced by invalid tag "%s".', - $from, - $to - )); - } - - $from = trim($from); - $to = trim($to); - - if (false === $options['case_sensitive']) { - $lowercaseFrom = strtolower($from); - - if (isset($normalizedValue[$lowercaseFrom]) && $normalizedValue[$lowercaseFrom] !== $to) { - throw new InvalidOptionsException(\sprintf( - 'Tag "%s" cannot be configured to be replaced with several different tags when case sensitivity is off.', - $from - )); - } - - $from = $lowercaseFrom; - } - - $normalizedValue[$from] = $to; - } - - foreach ($normalizedValue as $from => $to) { - if (isset($normalizedValue[$to]) && $normalizedValue[$to] !== $to) { - throw new InvalidOptionsException(\sprintf( - 'Cannot change tag "%1$s" to tag "%2$s", as the tag "%2$s" is configured to be replaced to "%3$s".', - $from, - $to, - $normalizedValue[$to] - )); - } - } - - return $normalizedValue; - }) - ->setDefault([]) - ->getOption(), - (new FixerOptionBuilder('case_sensitive', 'Whether tags should be replaced only if they have exact same casing.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if (0 === \count($this->configuration['replacements'])) { - return; - } - - if (true === $this->configuration['fix_annotation']) { - $regex = true === $this->configuration['fix_inline'] - ? '/"[^"]*"(*SKIP)(*FAIL)|\b(?<=@)(%s)\b/' - : '/"[^"]*"(*SKIP)(*FAIL)|(?configuration['case_sensitive']; - $replacements = $this->configuration['replacements']; - $regex = \sprintf($regex, implode('|', array_keys($replacements))); - - if ($caseInsensitive) { - $regex .= 'i'; - } - - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $tokens[$index] = new Token([T_DOC_COMMENT, Preg::replaceCallback( - $regex, - static function (array $matches) use ($caseInsensitive, $replacements) { - if ($caseInsensitive) { - $matches[1] = strtolower($matches[1]); - } - - return $replacements[$matches[1]]; - }, - $token->getContent() - )]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixer.php deleted file mode 100644 index 33fb2d0e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixer.php +++ /dev/null @@ -1,110 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Graham Campbell - */ -final class NoBlankLinesAfterPhpdocFixer extends AbstractFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should not be blank lines between docblock and the documented element.', - [ - new CodeSample( - ' $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - // get the next non-whitespace token inc comments, provided - // that there is whitespace between it and the current token - $next = $tokens->getNextNonWhitespace($index); - if ($index + 2 === $next && false === $tokens[$next]->isGivenKind($forbiddenSuccessors)) { - $this->fixWhitespace($tokens, $index + 1); - } - } - } - - /** - * Cleanup a whitespace token. - */ - private function fixWhitespace(Tokens $tokens, int $index): void - { - $content = $tokens[$index]->getContent(); - // if there is more than one new line in the whitespace, then we need to fix it - if (substr_count($content, "\n") > 1) { - // the final bit of the whitespace must be the next statement's indentation - $tokens[$index] = new Token([T_WHITESPACE, substr($content, strrpos($content, "\n"))]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php deleted file mode 100644 index 27d7af64..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php +++ /dev/null @@ -1,84 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoEmptyPhpdocFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should not be empty PHPDoc blocks.', - [new CodeSample("isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - if (!Preg::match('#^/\*\*[\s\*]*\*/$#', $token->getContent())) { - continue; - } - - if ( - $tokens[$index - 1]->isGivenKind([T_OPEN_TAG, T_WHITESPACE]) - && substr_count($tokens[$index - 1]->getContent(), "\n") > 0 - && $tokens[$index + 1]->isGivenKind(T_WHITESPACE) - && Preg::match('/^\R/', $tokens[$index + 1]->getContent()) - ) { - $tokens[$index - 1] = new Token([ - $tokens[$index - 1]->getId(), - Preg::replace('/\h*$/', '', $tokens[$index - 1]->getContent()), - ]); - - $newContent = Preg::replace('/^\R/', '', $tokens[$index + 1]->getContent()); - if ('' === $newContent) { - $tokens->clearAt($index + 1); - } else { - $tokens[$index + 1] = new Token([T_WHITESPACE, $newContent]); - } - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php deleted file mode 100644 index 466acbdd..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php +++ /dev/null @@ -1,756 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\TypeExpression; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @phpstan-type _TypeInfo array{ - * types: list, - * allows_null: bool, - * } - * @phpstan-type _DocumentElement array{ - * index: int, - * type: 'classy'|'function'|'property', - * modifiers: array, - * types: array, - * } - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * allow_hidden_params?: bool, - * allow_mixed?: bool, - * allow_unused_params?: bool, - * remove_inheritdoc?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * allow_hidden_params: bool, - * allow_mixed: bool, - * allow_unused_params: bool, - * remove_inheritdoc: bool - * } - */ -final class NoSuperfluousPhpdocTagsFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** @var _TypeInfo */ - private const NO_TYPE_INFO = [ - 'types' => [], - 'allows_null' => true, - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Removes `@param`, `@return` and `@var` tags that don\'t provide any useful information.', - [ - new CodeSample( - ' true], - ), - new CodeSample( - ' true], - ), - new CodeSample( - ' true], - ), - new CodeSample( - ' true], - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoEmptyPhpdocFixer, PhpdocAlignFixer, VoidReturnFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, FullyQualifiedStrictTypesFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocIndentFixer, PhpdocLineSpanFixer, PhpdocReturnSelfReferenceFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 6; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - $namespaceUseAnalyzer = new NamespaceUsesAnalyzer(); - $shortNames = []; - $currentSymbol = null; - $currentSymbolEndIndex = null; - - foreach ($namespaceUseAnalyzer->getDeclarationsFromTokens($tokens) as $namespaceUseAnalysis) { - $shortNames[strtolower($namespaceUseAnalysis->getShortName())] = strtolower($namespaceUseAnalysis->getFullName()); - } - - $symbolKinds = [T_CLASS, T_INTERFACE]; - if (\defined('T_ENUM')) { // @TODO drop the condition when requiring PHP 8.1+ - $symbolKinds[] = T_ENUM; - } - - foreach ($tokens as $index => $token) { - if ($index === $currentSymbolEndIndex) { - $currentSymbol = null; - $currentSymbolEndIndex = null; - - continue; - } - - if ($token->isGivenKind(T_CLASS) && $tokensAnalyzer->isAnonymousClass($index)) { - continue; - } - - if ($token->isGivenKind($symbolKinds)) { - $currentSymbol = $tokens[$tokens->getNextMeaningfulToken($index)]->getContent(); - $currentSymbolEndIndex = $tokens->findBlockEnd( - Tokens::BLOCK_TYPE_CURLY_BRACE, - $tokens->getNextTokenOfKind($index, ['{']), - ); - - continue; - } - - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $documentedElement = $this->findDocumentedElement($tokens, $index); - - if (null === $documentedElement) { - continue; - } - - $content = $initialContent = $token->getContent(); - - if (true === $this->configuration['remove_inheritdoc']) { - $content = $this->removeSuperfluousInheritDoc($content); - } - - $namespace = (new NamespacesAnalyzer())->getNamespaceAt($tokens, $index)->getFullName(); - if ('' === $namespace) { - $namespace = null; - } - - if ('function' === $documentedElement['type']) { - $content = $this->fixFunctionDocComment($content, $tokens, $documentedElement, $namespace, $currentSymbol, $shortNames); - } elseif ('property' === $documentedElement['type']) { - $content = $this->fixPropertyDocComment($content, $tokens, $documentedElement, $namespace, $currentSymbol, $shortNames); - } elseif ('classy' === $documentedElement['type']) { - $content = $this->fixClassDocComment($content, $documentedElement); - } else { - throw new \RuntimeException('Unknown type.'); - } - - if ('' === $content) { - $content = '/** */'; - } - - if ($content !== $initialContent) { - $tokens[$index] = new Token([T_DOC_COMMENT, $content]); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('allow_mixed', 'Whether type `mixed` without description is allowed (`true`) or considered superfluous (`false`).')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('remove_inheritdoc', 'Remove `@inheritDoc` tags.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('allow_hidden_params', 'Whether `param` annotation for hidden params in method signature are allowed.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) // @TODO set to `true` on 4.0 - ->getOption(), - (new FixerOptionBuilder('allow_unused_params', 'Whether `param` annotation without actual signature is allowed (`true`) or considered superfluous (`false`).')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - /** - * @return null|_DocumentElement - */ - private function findDocumentedElement(Tokens $tokens, int $docCommentIndex): ?array - { - $modifierKinds = [ - T_PRIVATE, - T_PROTECTED, - T_PUBLIC, - T_ABSTRACT, - T_FINAL, - T_STATIC, - ]; - - $typeKinds = [ - CT::T_NULLABLE_TYPE, - CT::T_ARRAY_TYPEHINT, - CT::T_TYPE_ALTERNATION, - CT::T_TYPE_INTERSECTION, - T_STRING, - T_NS_SEPARATOR, - ]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $modifierKinds[] = T_READONLY; - } - - $element = [ - 'modifiers' => [], - 'types' => [], - ]; - - $index = $tokens->getNextMeaningfulToken($docCommentIndex); - - // @TODO: drop condition when PHP 8.0+ is required - if (null !== $index && \defined('T_ATTRIBUTE') && $tokens[$index]->isGivenKind(T_ATTRIBUTE)) { - do { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); - $index = $tokens->getNextMeaningfulToken($index); - } while (null !== $index && $tokens[$index]->isGivenKind(T_ATTRIBUTE)); - } - - while (true) { - if (null === $index) { - break; - } - - if ($tokens[$index]->isClassy()) { - $element['index'] = $index; - $element['type'] = 'classy'; - - return $element; - } - - if ($tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) { - $element['index'] = $index; - $element['type'] = 'function'; - - return $element; - } - - if ($tokens[$index]->isGivenKind(T_VARIABLE)) { - $element['index'] = $index; - $element['type'] = 'property'; - - return $element; - } - - if ($tokens[$index]->isGivenKind($modifierKinds)) { - $element['modifiers'][$index] = $tokens[$index]; - } elseif ($tokens[$index]->isGivenKind($typeKinds)) { - $element['types'][$index] = $tokens[$index]; - } else { - break; - } - - $index = $tokens->getNextMeaningfulToken($index); - } - - return null; - } - - /** - * @param _DocumentElement&array{type: 'function'} $element - * @param null|non-empty-string $namespace - * @param array $shortNames - */ - private function fixFunctionDocComment( - string $content, - Tokens $tokens, - array $element, - ?string $namespace, - ?string $currentSymbol, - array $shortNames - ): string { - $docBlock = new DocBlock($content); - - $openingParenthesisIndex = $tokens->getNextTokenOfKind($element['index'], ['(']); - $closingParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openingParenthesisIndex); - - $argumentsInfo = $this->getArgumentsInfo( - $tokens, - $openingParenthesisIndex + 1, - $closingParenthesisIndex - 1 - ); - - foreach ($docBlock->getAnnotationsOfType('param') as $annotation) { - $argumentName = $annotation->getVariableName(); - - if (null === $argumentName) { - if ($this->annotationIsSuperfluous($annotation, self::NO_TYPE_INFO, $namespace, $currentSymbol, $shortNames)) { - $annotation->remove(); - } - - continue; - } - - if (!isset($argumentsInfo[$argumentName]) && true === $this->configuration['allow_unused_params']) { - continue; - } - - if (!isset($argumentsInfo[$argumentName]) || $this->annotationIsSuperfluous($annotation, $argumentsInfo[$argumentName], $namespace, $currentSymbol, $shortNames)) { - $annotation->remove(); - } - } - - $returnTypeInfo = $this->getReturnTypeInfo($tokens, $closingParenthesisIndex); - - foreach ($docBlock->getAnnotationsOfType('return') as $annotation) { - if ($this->annotationIsSuperfluous($annotation, $returnTypeInfo, $namespace, $currentSymbol, $shortNames)) { - $annotation->remove(); - } - } - - $this->removeSuperfluousModifierAnnotation($docBlock, $element); - - return $docBlock->getContent(); - } - - /** - * @param _DocumentElement&array{type: 'property'} $element - * @param null|non-empty-string $namespace - * @param array $shortNames - */ - private function fixPropertyDocComment( - string $content, - Tokens $tokens, - array $element, - ?string $namespace, - ?string $currentSymbol, - array $shortNames - ): string { - if (\count($element['types']) > 0) { - $propertyTypeInfo = $this->parseTypeHint($tokens, array_key_first($element['types'])); - } else { - $propertyTypeInfo = self::NO_TYPE_INFO; - } - - $docBlock = new DocBlock($content); - - foreach ($docBlock->getAnnotationsOfType('var') as $annotation) { - if ($this->annotationIsSuperfluous($annotation, $propertyTypeInfo, $namespace, $currentSymbol, $shortNames)) { - $annotation->remove(); - } - } - - return $docBlock->getContent(); - } - - /** - * @param _DocumentElement&array{type: 'classy'} $element - */ - private function fixClassDocComment(string $content, array $element): string - { - $docBlock = new DocBlock($content); - - $this->removeSuperfluousModifierAnnotation($docBlock, $element); - - return $docBlock->getContent(); - } - - /** - * @return array - */ - private function getArgumentsInfo(Tokens $tokens, int $start, int $end): array - { - $argumentsInfo = []; - - for ($index = $start; $index <= $end; ++$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_VARIABLE)) { - continue; - } - - $beforeArgumentIndex = $tokens->getPrevTokenOfKind($index, ['(', ',', [CT::T_ATTRIBUTE_CLOSE]]); - $typeIndex = $tokens->getNextMeaningfulToken($beforeArgumentIndex); - - if ($typeIndex !== $index) { - $info = $this->parseTypeHint($tokens, $typeIndex); - } else { - $info = self::NO_TYPE_INFO; - } - - if (!$info['allows_null']) { - $nextIndex = $tokens->getNextMeaningfulToken($index); - if ( - $tokens[$nextIndex]->equals('=') - && $tokens[$tokens->getNextMeaningfulToken($nextIndex)]->equals([T_STRING, 'null'], false) - ) { - $info['allows_null'] = true; - } - } - - $argumentsInfo[$token->getContent()] = $info; - } - - // virtualise "hidden params" as if they would be regular ones - if (true === $this->configuration['allow_hidden_params']) { - $paramsString = $tokens->generatePartialCode($start, $end); - Preg::matchAll('|/\*[^$]*(\$\w+)[^*]*\*/|', $paramsString, $matches); - - /** @var non-empty-string $match */ - foreach ($matches[1] as $match) { - $argumentsInfo[$match] = self::NO_TYPE_INFO; // HINT: one could try to extract actual type for hidden param, for now we only indicate it's existence - } - } - - return $argumentsInfo; - } - - /** - * @return _TypeInfo - */ - private function getReturnTypeInfo(Tokens $tokens, int $closingParenthesisIndex): array - { - $colonIndex = $tokens->getNextMeaningfulToken($closingParenthesisIndex); - - return $tokens[$colonIndex]->isGivenKind(CT::T_TYPE_COLON) - ? $this->parseTypeHint($tokens, $tokens->getNextMeaningfulToken($colonIndex)) - : self::NO_TYPE_INFO; - } - - /** - * @param int $index The index of the first token of the type hint - * - * @return _TypeInfo - */ - private function parseTypeHint(Tokens $tokens, int $index): array - { - $allowsNull = false; - - $types = []; - - while (true) { - $type = ''; - - if (\defined('T_READONLY') && $tokens[$index]->isGivenKind(T_READONLY)) { // @TODO: simplify condition when PHP 8.1+ is required - $index = $tokens->getNextMeaningfulToken($index); - } - - if ($tokens[$index]->isGivenKind([CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE])) { - $index = $tokens->getNextMeaningfulToken($index); - - continue; - } - - if ($tokens[$index]->isGivenKind(CT::T_NULLABLE_TYPE)) { - $allowsNull = true; - $index = $tokens->getNextMeaningfulToken($index); - } - - while ($tokens[$index]->isGivenKind([T_NS_SEPARATOR, T_STATIC, T_STRING, CT::T_ARRAY_TYPEHINT, T_CALLABLE])) { - $type .= $tokens[$index]->getContent(); - $index = $tokens->getNextMeaningfulToken($index); - } - - if ('' === $type) { - break; - } - - $types[] = $type; - - if (!$tokens[$index]->isGivenKind([CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION])) { - break; - } - - $index = $tokens->getNextMeaningfulToken($index); - } - - return [ - 'types' => $types, - 'allows_null' => $allowsNull, - ]; - } - - /** - * @param _TypeInfo $info - * @param null|non-empty-string $namespace - * @param array $symbolShortNames - */ - private function annotationIsSuperfluous( - Annotation $annotation, - array $info, - ?string $namespace, - ?string $currentSymbol, - array $symbolShortNames - ): bool { - if ('param' === $annotation->getTag()->getName()) { - $regex = '{\*\h*@param(?:\h+'.TypeExpression::REGEX_TYPES.')?(?!\S)(?:\h+(?:\&\h*)?(?:\.{3}\h*)?\$\S+)?(?:\s+(?(?!\*+\/)\S+))?}s'; - } elseif ('var' === $annotation->getTag()->getName()) { - $regex = '{\*\h*@var(?:\h+'.TypeExpression::REGEX_TYPES.')?(?!\S)(?:\h+\$\S+)?(?:\s+(?(?!\*\/)\S+))?}s'; - } else { - $regex = '{\*\h*@return(?:\h+'.TypeExpression::REGEX_TYPES.')?(?!\S)(?:\s+(?(?!\*\/)\S+))?}s'; - } - - if (!Preg::match($regex, $annotation->getContent(), $matches)) { - // Unable to match the annotation, it must be malformed or has unsupported format. - // Either way we don't want to tinker with it. - return false; - } - - if (isset($matches['description'])) { - return false; - } - - if (!isset($matches['types']) || '' === $matches['types']) { - // If there's no type info in the annotation, further checks make no sense, exit early. - return true; - } - - $annotationTypes = $this->toComparableNames($annotation->getTypes(), $namespace, $currentSymbol, $symbolShortNames); - - if (['null'] === $annotationTypes && ['null'] !== $info['types']) { - return false; - } - - if (['mixed'] === $annotationTypes && [] === $info['types']) { - return false === $this->configuration['allow_mixed']; - } - - $actualTypes = $info['types']; - - if ($info['allows_null']) { - $actualTypes[] = 'null'; - } - - $actualTypes = $this->toComparableNames($actualTypes, $namespace, $currentSymbol, $symbolShortNames); - - if ($annotationTypes === $actualTypes) { - return true; - } - - // retry comparison with annotation type unioned with null - // phpstan implies the null presence from the native type - $annotationTypes = array_merge($annotationTypes, ['null']); - sort($annotationTypes); - - return $actualTypes === $annotationTypes; - } - - /** - * Normalizes types to make them comparable. - * - * Converts given types to lowercase, replaces imports aliases with - * their matching FQCN, and finally sorts the result. - * - * @param list $types The types to normalize - * @param null|non-empty-string $namespace - * @param array $symbolShortNames The imports aliases - * - * @return list The normalized types - */ - private function toComparableNames(array $types, ?string $namespace, ?string $currentSymbol, array $symbolShortNames): array - { - if (isset($types[0][0]) && '?' === $types[0][0]) { - $types = [ - substr($types[0], 1), - 'null', - ]; - } - - $normalized = array_map( - function (string $type) use ($namespace, $currentSymbol, $symbolShortNames): string { - if (str_contains($type, '&')) { - $intersects = explode('&', $type); - - $intersects = $this->toComparableNames($intersects, $namespace, $currentSymbol, $symbolShortNames); - - return implode('&', $intersects); - } - - if ('self' === $type && null !== $currentSymbol) { - $type = $currentSymbol; - } - - $type = strtolower($type); - - if (isset($symbolShortNames[$type])) { - return $symbolShortNames[$type]; // always FQCN /wo leading backslash and in lower-case - } - - if (str_starts_with($type, '\\')) { - return substr($type, 1); - } - - if (null !== $namespace && !(new TypeAnalysis($type))->isReservedType()) { - $type = strtolower($namespace).'\\'.$type; - } - - return $type; - }, - $types - ); - - sort($normalized); - - return $normalized; - } - - private function removeSuperfluousInheritDoc(string $docComment): string - { - return Preg::replace('~ - # $1: before @inheritDoc tag - ( - # beginning of comment or a PHPDoc tag - (?: - ^/\*\* - (?: - \R - [ \t]*(?:\*[ \t]*)? - )*? - | - @\N+ - ) - - # empty comment lines - (?: - \R - [ \t]*(?:\*[ \t]*?)? - )* - ) - - # spaces before @inheritDoc tag - [ \t]* - - # @inheritDoc tag - (?:@inheritDocs?|\{@inheritDocs?\}) - - # $2: after @inheritDoc tag - ( - # empty comment lines - (?: - \R - [ \t]*(?:\*[ \t]*)? - )* - - # a PHPDoc tag or end of comment - (?: - @\N+ - | - (?: - \R - [ \t]*(?:\*[ \t]*)? - )* - [ \t]*\*/$ - ) - ) - ~ix', '$1$2', $docComment); - } - - /** - * @param _DocumentElement $element - */ - private function removeSuperfluousModifierAnnotation(DocBlock $docBlock, array $element): void - { - foreach (['abstract' => T_ABSTRACT, 'final' => T_FINAL] as $annotationType => $modifierToken) { - $annotations = $docBlock->getAnnotationsOfType($annotationType); - - foreach ($element['modifiers'] as $token) { - if ($token->isGivenKind($modifierToken)) { - foreach ($annotations as $annotation) { - $annotation->remove(); - } - } - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixer.php deleted file mode 100644 index 12e74bee..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixer.php +++ /dev/null @@ -1,289 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\Line; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * only_untyped?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * only_untyped: bool - * } - */ -final class PhpdocAddMissingParamAnnotationFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPDoc should contain `@param` for all params.', - [ - new CodeSample( - ' true] - ), - new CodeSample( - ' false] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer, PhpdocOrderFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocTagRenameFixer, PhpdocIndentFixer, PhpdocNoAliasTagFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 10; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $argumentsAnalyzer = new ArgumentsAnalyzer(); - - for ($index = 0, $limit = $tokens->count(); $index < $limit; ++$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $tokenContent = $token->getContent(); - - if (str_contains(strtolower($tokenContent), strtolower('inheritdoc'))) { - continue; - } - - // ignore one-line phpdocs like `/** foo */`, as there is no place to put new annotations - if (!str_contains($tokenContent, "\n")) { - continue; - } - - $mainIndex = $index; - $index = $tokens->getNextMeaningfulToken($index); - - if (null === $index) { - return; - } - - while ($tokens[$index]->isGivenKind([ - T_ABSTRACT, - T_FINAL, - T_PRIVATE, - T_PROTECTED, - T_PUBLIC, - T_STATIC, - ])) { - $index = $tokens->getNextMeaningfulToken($index); - } - - if (!$tokens[$index]->isGivenKind(T_FUNCTION)) { - continue; - } - - $openIndex = $tokens->getNextTokenOfKind($index, ['(']); - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openIndex); - - $arguments = []; - - foreach ($argumentsAnalyzer->getArguments($tokens, $openIndex, $index) as $start => $end) { - $argumentInfo = $this->prepareArgumentInformation($tokens, $start, $end); - - if (false === $this->configuration['only_untyped'] || '' === $argumentInfo['type']) { - $arguments[$argumentInfo['name']] = $argumentInfo; - } - } - - if (0 === \count($arguments)) { - continue; - } - - $doc = new DocBlock($tokenContent); - $lastParamLine = null; - - foreach ($doc->getAnnotationsOfType('param') as $annotation) { - $pregMatched = Preg::match('/^[^$]+(\$\w+).*$/s', $annotation->getContent(), $matches); - - if ($pregMatched) { - unset($arguments[$matches[1]]); - } - - $lastParamLine = max($lastParamLine, $annotation->getEnd()); - } - - if (0 === \count($arguments)) { - continue; - } - - $lines = $doc->getLines(); - $linesCount = \count($lines); - - Preg::match('/^(\s*).*$/', $lines[$linesCount - 1]->getContent(), $matches); - $indent = $matches[1]; - - $newLines = []; - - foreach ($arguments as $argument) { - $type = '' !== $argument['type'] ? $argument['type'] : 'mixed'; - - if (!str_starts_with($type, '?') && 'null' === strtolower($argument['default'])) { - $type = 'null|'.$type; - } - - $newLines[] = new Line(\sprintf( - '%s* @param %s %s%s', - $indent, - $type, - $argument['name'], - $this->whitespacesConfig->getLineEnding() - )); - } - - array_splice( - $lines, - $lastParamLine > 0 ? $lastParamLine + 1 : $linesCount - 1, - 0, - $newLines - ); - - $tokens[$mainIndex] = new Token([T_DOC_COMMENT, implode('', $lines)]); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('only_untyped', 'Whether to add missing `@param` annotations for untyped parameters only.')) - ->setDefault(true) - ->setAllowedTypes(['bool']) - ->getOption(), - ]); - } - - /** - * @return array{default: string, name: string, type: string} - */ - private function prepareArgumentInformation(Tokens $tokens, int $start, int $end): array - { - $info = [ - 'default' => '', - 'name' => '', - 'type' => '', - ]; - - $sawName = false; - - for ($index = $start; $index <= $end; ++$index) { - $token = $tokens[$index]; - - if ( - $token->isComment() - || $token->isWhitespace() - || $token->isGivenKind([ - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, - ]) - || (\defined('T_READONLY') && $token->isGivenKind(T_READONLY)) - ) { - continue; - } - - if ($token->isGivenKind(T_VARIABLE)) { - $sawName = true; - $info['name'] = $token->getContent(); - - continue; - } - - if ($token->equals('=')) { - continue; - } - - if ($sawName) { - $info['default'] .= $token->getContent(); - } elseif (!$token->equals('&')) { - if ($token->isGivenKind(T_ELLIPSIS)) { - if ('' === $info['type']) { - $info['type'] = 'array'; - } else { - $info['type'] .= '[]'; - } - } else { - $info['type'] .= $token->getContent(); - } - } - } - - return $info; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAlignFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAlignFixer.php deleted file mode 100644 index ba54d90a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAlignFixer.php +++ /dev/null @@ -1,511 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\TypeExpression; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * @author Fabien Potencier - * @author Jordi Boggiano - * @author Sebastiaan Stok - * @author Graham Campbell - * @author Dariusz Rumiński - * @author Jakub Kwaśniewski - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * align?: 'left'|'vertical', - * spacing?: array|int, - * tags?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * align: 'left'|'vertical', - * spacing: array|int, - * tags: list - * } - */ -final class PhpdocAlignFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const ALIGN_LEFT = 'left'; - - /** - * @internal - */ - public const ALIGN_VERTICAL = 'vertical'; - - private const DEFAULT_TAGS = [ - 'method', - 'param', - 'property', - 'return', - 'throws', - 'type', - 'var', - ]; - - private const TAGS_WITH_NAME = [ - 'param', - 'property', - 'property-read', - 'property-write', - 'phpstan-param', - 'phpstan-property', - 'phpstan-property-read', - 'phpstan-property-write', - 'phpstan-assert', - 'phpstan-assert-if-true', - 'phpstan-assert-if-false', - 'psalm-param', - 'psalm-param-out', - 'psalm-property', - 'psalm-property-read', - 'psalm-property-write', - 'psalm-assert', - 'psalm-assert-if-true', - 'psalm-assert-if-false', - ]; - - private const TAGS_WITH_METHOD_SIGNATURE = [ - 'method', - 'phpstan-method', - 'psalm-method', - ]; - - private const DEFAULT_SPACING = 1; - - private const DEFAULT_SPACING_KEY = '_default'; - - private string $regex; - - private string $regexCommentLine; - - private string $align; - - /** - * same spacing for all or specific for different tags. - * - * @var array|int - */ - private $spacing = 1; - - public function getDefinition(): FixerDefinitionInterface - { - $code = <<<'EOF' - self::ALIGN_VERTICAL]), - new CodeSample($code, ['align' => self::ALIGN_LEFT]), - new CodeSample($code, ['align' => self::ALIGN_LEFT, 'spacing' => 2]), - new CodeSample($code, ['align' => self::ALIGN_LEFT, 'spacing' => ['param' => 2]]), - ], - ); - } - - /** - * {@inheritdoc} - * - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAnnotationWithoutDotFixer, PhpdocArrayTypeFixer, PhpdocIndentFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocScalarFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. - */ - public function getPriority(): int - { - /* - * Should be run after all other docblock fixers. This because they - * modify other annotations to change their type and or separation - * which totally change the behavior of this fixer. It's important that - * annotations are of the correct type, and are grouped correctly - * before running this fixer. - */ - return -42; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - protected function configurePostNormalisation(): void - { - $tagsWithNameToAlign = array_intersect($this->configuration['tags'], self::TAGS_WITH_NAME); - $tagsWithMethodSignatureToAlign = array_intersect($this->configuration['tags'], self::TAGS_WITH_METHOD_SIGNATURE); - $tagsWithoutNameToAlign = array_diff($this->configuration['tags'], $tagsWithNameToAlign, $tagsWithMethodSignatureToAlign); - - $indentRegex = '^(?P(?:\ {2}|\t)*)\ ?'; - - $types = []; - - // e.g. @param <$var> - if ([] !== $tagsWithNameToAlign) { - $types[] = '(?P'.implode('|', $tagsWithNameToAlign).')\s+(?P(?:'.TypeExpression::REGEX_TYPES.')?)\s*(?P(?:&|\.{3})?\$\S+)'; - } - - // e.g. @return - if ([] !== $tagsWithoutNameToAlign) { - $types[] = '(?P'.implode('|', $tagsWithoutNameToAlign).')\s+(?P(?:'.TypeExpression::REGEX_TYPES.')?)'; - } - - // e.g. @method - if ([] !== $tagsWithMethodSignatureToAlign) { - $types[] = '(?P'.implode('|', $tagsWithMethodSignatureToAlign).')(\s+(?Pstatic))?(\s+(?P(?:'.TypeExpression::REGEX_TYPES.')?))\s+(?P.+\))'; - } - - // optional - $desc = '(?:\s+(?P\V*))'; - - $this->regex = '/'.$indentRegex.'\*\h*@(?J)(?:'.implode('|', $types).')'.$desc.'\h*\r?$/'; - $this->regexCommentLine = '/'.$indentRegex.'\*(?!\h?+@)(?:\s+(?P\V+))(?align = $this->configuration['align']; - $this->spacing = $this->configuration['spacing']; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $content = $token->getContent(); - $docBlock = new DocBlock($content); - $this->fixDocBlock($docBlock); - $newContent = $docBlock->getContent(); - if ($newContent !== $content) { - $tokens[$index] = new Token([T_DOC_COMMENT, $newContent]); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $allowPositiveIntegers = static function ($value) { - $spacings = \is_array($value) ? $value : [$value]; - foreach ($spacings as $val) { - if (\is_int($val) && $val <= 0) { - throw new InvalidOptionsException('The option "spacing" is invalid. All spacings must be greater than zero.'); - } - } - - return true; - }; - - $tags = new FixerOptionBuilder( - 'tags', - 'The tags that should be aligned. Allowed values are tags with name (`\''.implode('\', \'', self::TAGS_WITH_NAME).'\'`), tags with method signature (`\''.implode('\', \'', self::TAGS_WITH_METHOD_SIGNATURE).'\'`) and any custom tag with description (e.g. `@tag `).' - ); - $tags - ->setAllowedTypes(['string[]']) - ->setDefault(self::DEFAULT_TAGS) - ; - - $align = new FixerOptionBuilder('align', 'How comments should be aligned.'); - $align - ->setAllowedTypes(['string']) - ->setAllowedValues([self::ALIGN_LEFT, self::ALIGN_VERTICAL]) - ->setDefault(self::ALIGN_VERTICAL) - ; - - $spacing = new FixerOptionBuilder( - 'spacing', - 'Spacing between tag, hint, comment, signature, etc. You can set same spacing for all tags using a positive integer or different spacings for different tags using an associative array of positive integers `[\'tagA\' => spacingForA, \'tagB\' => spacingForB]`. If you want to define default spacing to more than 1 space use `_default` key in config array, e.g.: `[\'tagA\' => spacingForA, \'tagB\' => spacingForB, \'_default\' => spacingForAllOthers]`.' - ); - $spacing->setAllowedTypes(['int', 'array']) - ->setAllowedValues([$allowPositiveIntegers]) - ->setDefault(self::DEFAULT_SPACING) - ; - - return new FixerConfigurationResolver([$tags->getOption(), $align->getOption(), $spacing->getOption()]); - } - - private function fixDocBlock(DocBlock $docBlock): void - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - - for ($i = 0, $l = \count($docBlock->getLines()); $i < $l; ++$i) { - $matches = $this->getMatches($docBlock->getLine($i)->getContent()); - - if (null === $matches) { - continue; - } - - $current = $i; - $items = [$matches]; - - while (true) { - if (null === $docBlock->getLine(++$i)) { - break 2; - } - - $matches = $this->getMatches($docBlock->getLine($i)->getContent(), true); - if (null === $matches) { - break; - } - - $items[] = $matches; - } - - // compute the max length of the tag, hint and variables - $hasStatic = false; - $tagMax = 0; - $hintMax = 0; - $varMax = 0; - - foreach ($items as $item) { - if (null === $item['tag']) { - continue; - } - - $hasStatic = $hasStatic || '' !== $item['static']; - $tagMax = max($tagMax, \strlen($item['tag'])); - $hintMax = max($hintMax, \strlen($item['hint'])); - $varMax = max($varMax, \strlen($item['var'])); - } - - $itemOpeningLine = null; - - $currTag = null; - $spacingForTag = $this->spacingForTag($currTag); - - // update - foreach ($items as $j => $item) { - if (null === $item['tag']) { - if ('@' === $item['desc'][0]) { - $line = $item['indent'].' * '.$item['desc']; - $docBlock->getLine($current + $j)->setContent($line.$lineEnding); - - continue; - } - - $extraIndent = 2 * $spacingForTag; - - if (\in_array($itemOpeningLine['tag'], self::TAGS_WITH_NAME, true) || \in_array($itemOpeningLine['tag'], self::TAGS_WITH_METHOD_SIGNATURE, true)) { - $extraIndent += $varMax + $spacingForTag; - } - - if ($hasStatic) { - $extraIndent += 7; // \strlen('static '); - } - - $line = - $item['indent'] - .' * ' - .('' !== $itemOpeningLine['hint'] ? ' ' : '') - .$this->getIndent( - $tagMax + $hintMax + $extraIndent, - $this->getLeftAlignedDescriptionIndent($items, $j) - ) - .$item['desc']; - - $docBlock->getLine($current + $j)->setContent($line.$lineEnding); - - continue; - } - - $currTag = $item['tag']; - - $spacingForTag = $this->spacingForTag($currTag); - - $itemOpeningLine = $item; - - $line = - $item['indent'] - .' * @' - .$item['tag']; - - if ($hasStatic) { - $line .= - $this->getIndent( - $tagMax - \strlen($item['tag']) + $spacingForTag, - '' !== $item['static'] ? $spacingForTag : 0 - ) - .('' !== $item['static'] ? $item['static'] : $this->getIndent(6 /* \strlen('static') */, 0)); - $hintVerticalAlignIndent = $spacingForTag; - } else { - $hintVerticalAlignIndent = $tagMax - \strlen($item['tag']) + $spacingForTag; - } - - $line .= - $this->getIndent( - $hintVerticalAlignIndent, - '' !== $item['hint'] ? $spacingForTag : 0 - ) - .$item['hint']; - - if ('' !== $item['var']) { - $line .= - $this->getIndent((0 !== $hintMax ? $hintMax : -1) - \strlen($item['hint']) + $spacingForTag, $spacingForTag) - .$item['var'] - .( - '' !== $item['desc'] - ? $this->getIndent($varMax - \strlen($item['var']) + $spacingForTag, $spacingForTag).$item['desc'] - : '' - ); - } elseif ('' !== $item['desc']) { - $line .= $this->getIndent($hintMax - \strlen($item['hint']) + $spacingForTag, $spacingForTag).$item['desc']; - } - - $docBlock->getLine($current + $j)->setContent($line.$lineEnding); - } - } - } - - private function spacingForTag(?string $tag): int - { - return (\is_int($this->spacing)) - ? $this->spacing - : ($this->spacing[$tag] ?? $this->spacing[self::DEFAULT_SPACING_KEY] ?? self::DEFAULT_SPACING); - } - - /** - * @TODO Introduce proper DTO instead of an array - * - * @return null|array{indent: null|string, tag: null|string, hint: string, var: null|string, static: string, desc?: null|string} - */ - private function getMatches(string $line, bool $matchCommentOnly = false): ?array - { - if (Preg::match($this->regex, $line, $matches)) { - if (isset($matches['tag2']) && '' !== $matches['tag2']) { - $matches['tag'] = $matches['tag2']; - $matches['hint'] = $matches['hint2']; - $matches['var'] = ''; - } - - if (isset($matches['tag3']) && '' !== $matches['tag3']) { - $matches['tag'] = $matches['tag3']; - $matches['hint'] = $matches['hint3']; - $matches['var'] = $matches['signature']; - - // Since static can be both a return type declaration & a keyword that defines static methods - // we assume it's a type declaration when only one value is present - if ('' === $matches['hint'] && '' !== $matches['static']) { - $matches['hint'] = $matches['static']; - $matches['static'] = ''; - } - } - - if (isset($matches['hint'])) { - $matches['hint'] = trim($matches['hint']); - } - - $matches['static'] ??= ''; - - return $matches; - } - - if ($matchCommentOnly && Preg::match($this->regexCommentLine, $line, $matches)) { - $matches['tag'] = null; - $matches['var'] = ''; - $matches['hint'] = ''; - $matches['static'] = ''; - - return $matches; - } - - return null; - } - - private function getIndent(int $verticalAlignIndent, int $leftAlignIndent = 1): string - { - $indent = self::ALIGN_VERTICAL === $this->align ? $verticalAlignIndent : $leftAlignIndent; - - return str_repeat(' ', $indent); - } - - /** - * @param non-empty-list $items - */ - private function getLeftAlignedDescriptionIndent(array $items, int $index): int - { - if (self::ALIGN_LEFT !== $this->align) { - return 0; - } - - // Find last tagged line: - $item = null; - for (; $index >= 0; --$index) { - $item = $items[$index]; - if (null !== $item['tag']) { - break; - } - } - - // No last tag found — no indent: - if (null === $item) { - return 0; - } - - $spacingForTag = $this->spacingForTag($item['tag']); - - // Indent according to existing values: - return - $this->getSentenceIndent($item['static'], $spacingForTag) + - $this->getSentenceIndent($item['tag'], $spacingForTag) + - $this->getSentenceIndent($item['hint'], $spacingForTag) + - $this->getSentenceIndent($item['var'], $spacingForTag); - } - - /** - * Get indent for sentence. - */ - private function getSentenceIndent(?string $sentence, int $spacingForTag = 1): int - { - if (null === $sentence) { - return 0; - } - - $length = \strlen($sentence); - - return 0 === $length ? 0 : $length + $spacingForTag; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixer.php deleted file mode 100644 index 756086b5..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixer.php +++ /dev/null @@ -1,123 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - */ -final class PhpdocAnnotationWithoutDotFixer extends AbstractFixer -{ - /** - * @var list - */ - private array $tags = ['throws', 'return', 'param', 'internal', 'deprecated', 'var', 'type']; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPDoc annotation descriptions should not be a sentence.', - [new CodeSample('isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $doc = new DocBlock($token->getContent()); - $annotations = $doc->getAnnotations(); - - if (0 === \count($annotations)) { - continue; - } - - foreach ($annotations as $annotation) { - if ( - !$annotation->getTag()->valid() || !\in_array($annotation->getTag()->getName(), $this->tags, true) - ) { - continue; - } - - $lineAfterAnnotation = $doc->getLine($annotation->getEnd() + 1); - if (null !== $lineAfterAnnotation) { - $lineAfterAnnotationTrimmed = ltrim($lineAfterAnnotation->getContent()); - if ('' === $lineAfterAnnotationTrimmed || !str_starts_with($lineAfterAnnotationTrimmed, '*')) { - // malformed PHPDoc, missing asterisk ! - continue; - } - } - - $content = $annotation->getContent(); - - if ( - !Preg::match('/[.。]\h*$/u', $content) - || Preg::match('/[.。](?!\h*$)/u', $content, $matches) - ) { - continue; - } - - $endLine = $doc->getLine($annotation->getEnd()); - $endLine->setContent(Preg::replace('/(?getContent())); - - $startLine = $doc->getLine($annotation->getStart()); - $optionalTypeRegEx = $annotation->supportTypes() - ? \sprintf('(?:%s\s+(?:\$\w+\s+)?)?', preg_quote(implode('|', $annotation->getTypes()), '/')) - : ''; - $content = Preg::replaceCallback( - '/^(\s*\*\s*@\w+\s+'.$optionalTypeRegEx.')(\p{Lu}?(?=\p{Ll}|\p{Zs}))(.*)$/', - static fn (array $matches): string => $matches[1].mb_strtolower($matches[2]).$matches[3], - $startLine->getContent(), - 1 - ); - $startLine->setContent($content); - } - - $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php deleted file mode 100644 index f3f64c11..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php +++ /dev/null @@ -1,92 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractPhpdocTypesFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Tokens; - -final class PhpdocArrayTypeFixer extends AbstractPhpdocTypesFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - public function isRisky(): bool - { - return true; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPDoc `array` type must be used instead of `T[]`.', - [ - new CodeSample(<<<'PHP' - ', $level); - }, - $type, - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocIndentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocIndentFixer.php deleted file mode 100644 index 818595d2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocIndentFixer.php +++ /dev/null @@ -1,141 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Utils; - -/** - * @author Ceeram - * @author Graham Campbell - */ -final class PhpdocIndentFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Docblocks should have the same indentation as the documented subject.', - [new CodeSample('isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = $tokens->count() - 1; 0 <= $index; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - - // skip if there is no next token or if next token is block end `}` - if (null === $nextIndex || $tokens[$nextIndex]->equals('}')) { - continue; - } - - $prevIndex = $index - 1; - $prevToken = $tokens[$prevIndex]; - - // ignore inline docblocks - if ( - $prevToken->isGivenKind(T_OPEN_TAG) - || ($prevToken->isWhitespace(" \t") && !$tokens[$index - 2]->isGivenKind(T_OPEN_TAG)) - || $prevToken->equalsAny([';', ',', '{', '(']) - ) { - continue; - } - - if ($tokens[$nextIndex - 1]->isWhitespace()) { - $indent = Utils::calculateTrailingWhitespaceIndent($tokens[$nextIndex - 1]); - } else { - $indent = ''; - } - - $newPrevContent = $this->fixWhitespaceBeforeDocblock($prevToken->getContent(), $indent); - - $tokens[$index] = new Token([T_DOC_COMMENT, $this->fixDocBlock($token->getContent(), $indent)]); - - if (!$prevToken->isWhitespace()) { - if ('' !== $indent) { - $tokens->insertAt($index, new Token([T_WHITESPACE, $indent])); - } - } elseif ('' !== $newPrevContent) { - if ($prevToken->isArray()) { - $tokens[$prevIndex] = new Token([$prevToken->getId(), $newPrevContent]); - } else { - $tokens[$prevIndex] = new Token($newPrevContent); - } - } else { - $tokens->clearAt($prevIndex); - } - } - } - - /** - * Fix indentation of Docblock. - * - * @param string $content Docblock contents - * @param string $indent Indentation to apply - * - * @return string Dockblock contents including correct indentation - */ - private function fixDocBlock(string $content, string $indent): string - { - return ltrim(Preg::replace('/^\h*\*/m', $indent.' *', $content)); - } - - /** - * @param string $content Whitespace before Docblock - * @param string $indent Indentation of the documented subject - * - * @return string Whitespace including correct indentation for Dockblock after this whitespace - */ - private function fixWhitespaceBeforeDocblock(string $content, string $indent): string - { - return rtrim($content, " \t").$indent; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixer.php deleted file mode 100644 index a37b9b83..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixer.php +++ /dev/null @@ -1,121 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * tags?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * tags: list - * } - */ -final class PhpdocInlineTagNormalizerFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Fixes PHPDoc inline tags.', - [ - new CodeSample( - " ['TUTORIAL']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 0; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if (0 === \count($this->configuration['tags'])) { - return; - } - - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - // Move `@` inside tag, for example @{tag} -> {@tag}, replace multiple curly brackets, - // remove spaces between '{' and '@', remove white space between end - // of text and closing bracket and between the tag and inline comment. - $content = Preg::replaceCallback( - \sprintf( - '#(?:@{+|{+\h*@)\h*(%s)\b([^}]*)(?:}+)#i', - implode('|', array_map(static fn (string $tag): string => preg_quote($tag, '/'), $this->configuration['tags'])) - ), - static function (array $matches): string { - $doc = trim($matches[2]); - - if ('' === $doc) { - return '{@'.$matches[1].'}'; - } - - return '{@'.$matches[1].' '.$doc.'}'; - }, - $token->getContent() - ); - - $tokens[$index] = new Token([T_DOC_COMMENT, $content]); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('tags', 'The list of tags to normalize.')) - ->setAllowedTypes(['string[]']) - ->setDefault(['example', 'id', 'internal', 'inheritdoc', 'inheritdocs', 'link', 'source', 'toc', 'tutorial']) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocLineSpanFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocLineSpanFixer.php deleted file mode 100644 index 9a639ae1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocLineSpanFixer.php +++ /dev/null @@ -1,173 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Gert de Pagter - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * const?: 'multi'|'single'|null, - * method?: 'multi'|'single'|null, - * property?: 'multi'|'single'|null - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * const: 'multi'|'single'|null, - * method: 'multi'|'single'|null, - * property: 'multi'|'single'|null - * } - */ -final class PhpdocLineSpanFixer extends AbstractFixer implements WhitespacesAwareFixerInterface, ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Changes doc blocks from single to multi line, or reversed. Works for class constants, properties and methods only.', - [ - new CodeSample(" 'single'] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 7; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('const', 'Whether const blocks should be single or multi line.')) - ->setAllowedValues(['single', 'multi', null]) - ->setDefault('multi') - ->getOption(), - (new FixerOptionBuilder('property', 'Whether property doc blocks should be single or multi line.')) - ->setAllowedValues(['single', 'multi', null]) - ->setDefault('multi') - ->getOption(), - (new FixerOptionBuilder('method', 'Whether method doc blocks should be single or multi line.')) - ->setAllowedValues(['single', 'multi', null]) - ->setDefault('multi') - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $analyzer = new TokensAnalyzer($tokens); - - foreach ($analyzer->getClassyElements() as $index => $element) { - if (!$this->hasDocBlock($tokens, $index)) { - continue; - } - - $type = $element['type']; - - if (!isset($this->configuration[$type])) { - continue; - } - - $docIndex = $this->getDocBlockIndex($tokens, $index); - $doc = new DocBlock($tokens[$docIndex]->getContent()); - - if ('multi' === $this->configuration[$type]) { - $doc->makeMultiLine(WhitespacesAnalyzer::detectIndent($tokens, $docIndex), $this->whitespacesConfig->getLineEnding()); - } elseif ('single' === $this->configuration[$type]) { - $doc->makeSingleLine(); - } - - $tokens->offsetSet($docIndex, new Token([T_DOC_COMMENT, $doc->getContent()])); - } - } - - private function hasDocBlock(Tokens $tokens, int $index): bool - { - $docBlockIndex = $this->getDocBlockIndex($tokens, $index); - - return $tokens[$docBlockIndex]->isGivenKind(T_DOC_COMMENT); - } - - private function getDocBlockIndex(Tokens $tokens, int $index): int - { - $propertyPartKinds = [ - T_PUBLIC, - T_PROTECTED, - T_PRIVATE, - T_FINAL, - T_ABSTRACT, - T_COMMENT, - T_VAR, - T_STATIC, - T_STRING, - T_NS_SEPARATOR, - CT::T_ARRAY_TYPEHINT, - CT::T_NULLABLE_TYPE, - ]; - - if (\defined('T_ATTRIBUTE')) { // @TODO: drop condition when PHP 8.0+ is required - $propertyPartKinds[] = T_ATTRIBUTE; - } - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $propertyPartKinds[] = T_READONLY; - } - - do { - $index = $tokens->getPrevNonWhitespace($index); - - if ($tokens[$index]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - $index = $tokens->getPrevTokenOfKind($index, [[T_ATTRIBUTE]]); - } - } while ($tokens[$index]->isGivenKind($propertyPartKinds)); - - return $index; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocListTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocListTypeFixer.php deleted file mode 100644 index 9d2cdff9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocListTypeFixer.php +++ /dev/null @@ -1,70 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractPhpdocTypesFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Tokens; - -final class PhpdocListTypeFixer extends AbstractPhpdocTypesFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - public function isRisky(): bool - { - return true; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPDoc `list` type must be used instead of `array` without a key.', - [ - new CodeSample(<<<'PHP' - $x - * @param array> $y - */ - - PHP), - ], - null, - 'Risky when `array` key should be present, but is missing.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocAlignFixer, PhpdocTypesOrderFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocArrayTypeFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 1; - } - - protected function normalize(string $type): string - { - return Preg::replace('/array(?=<(?:[^,<]|<[^>]+>)+(>|{|\())/i', 'list', $type); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAccessFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAccessFixer.php deleted file mode 100644 index d2f959a1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAccessFixer.php +++ /dev/null @@ -1,71 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @author Graham Campbell - * @author Dariusz Rumiński - */ -final class PhpdocNoAccessFixer extends AbstractProxyFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - '`@access` annotations must be removed from PHPDoc.', - [ - new CodeSample( - 'configure( - ['annotations' => ['access'], - 'case_sensitive' => true, - ] - ); - - return [$fixer]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php deleted file mode 100644 index d50e42d1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php +++ /dev/null @@ -1,137 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\ConfigurationException\InvalidConfigurationException; -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; - -/** - * Case-sensitive tag replace fixer (does not process inline tags like {@inheritdoc}). - * - * @author Graham Campbell - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * replacements?: array - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * replacements: array - * } - */ -final class PhpdocNoAliasTagFixer extends AbstractProxyFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'No alias PHPDoc tags should be used.', - [ - new CodeSample( - ' ['link' => 'website']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocSingleLineVarSpacingFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return parent::getPriority(); - } - - protected function configurePostNormalisation(): void - { - /** @var GeneralPhpdocTagRenameFixer $generalPhpdocTagRenameFixer */ - $generalPhpdocTagRenameFixer = $this->proxyFixers['general_phpdoc_tag_rename']; - - try { - $generalPhpdocTagRenameFixer->configure([ - 'fix_annotation' => true, - 'fix_inline' => false, - 'replacements' => $this->configuration['replacements'], - 'case_sensitive' => true, - ]); - } catch (InvalidConfigurationException $exception) { - throw new InvalidFixerConfigurationException( - $this->getName(), - Preg::replace('/^\[.+?\] /', '', $exception->getMessage()), - $exception - ); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('replacements', 'Mapping between replaced annotations with new ones.')) - ->setAllowedTypes(['array']) - ->setDefault([ - 'property-read' => 'property', - 'property-write' => 'property', - 'type' => 'var', - 'link' => 'see', - ]) - ->getOption(), - ]); - } - - protected function createProxyFixers(): array - { - return [new GeneralPhpdocTagRenameFixer()]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php deleted file mode 100644 index c591c67a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php +++ /dev/null @@ -1,117 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Graham Campbell - */ -final class PhpdocNoEmptyReturnFixer extends AbstractFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - '`@return void` and `@return null` annotations must be removed from PHPDoc.', - [ - new CodeSample( - ' $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $doc = new DocBlock($token->getContent()); - $annotations = $doc->getAnnotationsOfType('return'); - - if (0 === \count($annotations)) { - continue; - } - - foreach ($annotations as $annotation) { - $this->fixAnnotation($annotation); - } - - $newContent = $doc->getContent(); - - if ($newContent === $token->getContent()) { - continue; - } - - if ('' === $newContent) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - - continue; - } - - $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - } - - /** - * Remove `return void` or `return null` annotations. - */ - private function fixAnnotation(Annotation $annotation): void - { - $types = $annotation->getNormalizedTypes(); - - if (1 === \count($types) && ('null' === $types[0] || 'void' === $types[0])) { - $annotation->remove(); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoPackageFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoPackageFixer.php deleted file mode 100644 index 2f927849..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoPackageFixer.php +++ /dev/null @@ -1,70 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @author Graham Campbell - * @author Dariusz Rumiński - */ -final class PhpdocNoPackageFixer extends AbstractProxyFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - '`@package` and `@subpackage` annotations must be removed from PHPDoc.', - [ - new CodeSample( - 'configure([ - 'annotations' => ['package', 'subpackage'], - 'case_sensitive' => true, - ]); - - return [$fixer]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixer.php deleted file mode 100644 index b1e88a3a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixer.php +++ /dev/null @@ -1,151 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Remove inheritdoc tags from classy that does not inherit. - */ -final class PhpdocNoUselessInheritdocFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Classy that does not inherit must not have `@inheritdoc` tags.', - [ - new CodeSample("isTokenKindFound(T_DOC_COMMENT) && $tokens->isAnyTokenKindsFound([T_CLASS, T_INTERFACE]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - // min. offset 4 as minimal candidate is @: isGivenKind([T_CLASS, T_INTERFACE])) { - $index = $this->fixClassy($tokens, $index); - } - } - } - - private function fixClassy(Tokens $tokens, int $index): int - { - // figure out where the classy starts - $classOpenIndex = $tokens->getNextTokenOfKind($index, ['{']); - - // figure out where the classy ends - $classEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $classOpenIndex); - - // is classy extending or implementing some interface - $extendingOrImplementing = $this->isExtendingOrImplementing($tokens, $index, $classOpenIndex); - - if (!$extendingOrImplementing) { - // PHPDoc of classy should not have inherit tag even when using traits as Traits cannot provide this information - $this->fixClassyOutside($tokens, $index); - } - - // figure out if the classy uses a trait - if (!$extendingOrImplementing && $this->isUsingTrait($tokens, $index, $classOpenIndex, $classEndIndex)) { - $extendingOrImplementing = true; - } - - $this->fixClassyInside($tokens, $classOpenIndex, $classEndIndex, !$extendingOrImplementing); - - return $classEndIndex; - } - - private function fixClassyInside(Tokens $tokens, int $classOpenIndex, int $classEndIndex, bool $fixThisLevel): void - { - for ($i = $classOpenIndex; $i < $classEndIndex; ++$i) { - if ($tokens[$i]->isGivenKind(T_CLASS)) { - $i = $this->fixClassy($tokens, $i); - } elseif ($fixThisLevel && $tokens[$i]->isGivenKind(T_DOC_COMMENT)) { - $this->fixToken($tokens, $i); - } - } - } - - private function fixClassyOutside(Tokens $tokens, int $classIndex): void - { - $previousIndex = $tokens->getPrevNonWhitespace($classIndex); - if ($tokens[$previousIndex]->isGivenKind(T_DOC_COMMENT)) { - $this->fixToken($tokens, $previousIndex); - } - } - - private function fixToken(Tokens $tokens, int $tokenIndex): void - { - $count = 0; - $content = Preg::replaceCallback( - '#(\h*(?:@{*|{*\h*@)\h*inheritdoc\h*)([^}]*)((?:}*)\h*)#i', - static fn (array $matches): string => ' '.$matches[2], - $tokens[$tokenIndex]->getContent(), - -1, - $count - ); - - if ($count > 0) { - $tokens[$tokenIndex] = new Token([T_DOC_COMMENT, $content]); - } - } - - private function isExtendingOrImplementing(Tokens $tokens, int $classIndex, int $classOpenIndex): bool - { - for ($index = $classIndex; $index < $classOpenIndex; ++$index) { - if ($tokens[$index]->isGivenKind([T_EXTENDS, T_IMPLEMENTS])) { - return true; - } - } - - return false; - } - - private function isUsingTrait(Tokens $tokens, int $classIndex, int $classOpenIndex, int $classCloseIndex): bool - { - if ($tokens[$classIndex]->isGivenKind(T_INTERFACE)) { - // cannot use Trait inside an interface - return false; - } - - $useIndex = $tokens->getNextTokenOfKind($classOpenIndex, [[CT::T_USE_TRAIT]]); - - return null !== $useIndex && $useIndex < $classCloseIndex; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderByValueFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderByValueFixer.php deleted file mode 100644 index 74f0eb40..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderByValueFixer.php +++ /dev/null @@ -1,225 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Options; - -/** - * @author Filippo Tessarotto - * @author Andreas Möller - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * annotations?: list<'author'|'covers'|'coversNothing'|'dataProvider'|'depends'|'group'|'internal'|'method'|'mixin'|'property'|'property-read'|'property-write'|'requires'|'throws'|'uses'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * annotations: array{'author'?: 'author', 'covers'?: 'covers', 'coversNothing'?: 'coversnothing', 'dataProvider'?: 'dataprovider', 'depends'?: 'depends', 'group'?: 'group', 'internal'?: 'internal', 'method'?: 'method', 'mixin'?: 'mixin', 'property'?: 'property', 'property-read'?: 'property-read', 'property-write'?: 'property-write', 'requires'?: 'requires', 'throws'?: 'throws', 'uses'?: 'uses'} - * } - */ -final class PhpdocOrderByValueFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Order PHPDoc tags by value.', - [ - new CodeSample( - ' [ - 'author', - ], - ] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpUnitFqcnAnnotationFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return -10; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAllTokenKindsFound([T_CLASS, T_DOC_COMMENT]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if ([] === $this->configuration['annotations']) { - return; - } - - for ($index = $tokens->count() - 1; $index > 0; --$index) { - foreach ($this->configuration['annotations'] as $type => $typeLowerCase) { - $findPattern = \sprintf( - '/@%s\s.+@%s\s/s', - $type, - $type - ); - - if ( - !$tokens[$index]->isGivenKind(T_DOC_COMMENT) - || !Preg::match($findPattern, $tokens[$index]->getContent()) - ) { - continue; - } - - $docBlock = new DocBlock($tokens[$index]->getContent()); - - $annotations = $docBlock->getAnnotationsOfType($type); - $annotationMap = []; - - if (\in_array($type, ['property', 'property-read', 'property-write'], true)) { - $replacePattern = \sprintf( - '/(?s)\*\s*@%s\s+(?P.+\s+)?\$(?P\S+).*/', - $type - ); - - $replacement = '\2'; - } elseif ('method' === $type) { - $replacePattern = '/(?s)\*\s*@method\s+(?P.+\s+)?(?P.+)\(.*/'; - $replacement = '\2'; - } else { - $replacePattern = \sprintf( - '/\*\s*@%s\s+(?P.+)/', - $typeLowerCase - ); - - $replacement = '\1'; - } - - foreach ($annotations as $annotation) { - $rawContent = $annotation->getContent(); - - $comparableContent = Preg::replace( - $replacePattern, - $replacement, - strtolower(trim($rawContent)) - ); - - $annotationMap[$comparableContent] = $rawContent; - } - - $orderedAnnotationMap = $annotationMap; - - ksort($orderedAnnotationMap, SORT_STRING); - - if ($orderedAnnotationMap === $annotationMap) { - continue; - } - - $lines = $docBlock->getLines(); - - foreach (array_reverse($annotations) as $annotation) { - array_splice( - $lines, - $annotation->getStart(), - $annotation->getEnd() - $annotation->getStart() + 1, - array_pop($orderedAnnotationMap) - ); - } - - $tokens[$index] = new Token([T_DOC_COMMENT, implode('', $lines)]); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $allowedValues = [ - 'author', - 'covers', - 'coversNothing', - 'dataProvider', - 'depends', - 'group', - 'internal', - 'method', - 'mixin', - 'property', - 'property-read', - 'property-write', - 'requires', - 'throws', - 'uses', - ]; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('annotations', 'List of annotations to order, e.g. `["covers"]`.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([ - new AllowedValueSubset($allowedValues), - ]) - ->setNormalizer(static function (Options $options, array $value): array { - $normalized = []; - - foreach ($value as $annotation) { - // since we will be using "strtolower" on the input annotations when building the sorting - // map we must match the type in lower case as well - $normalized[$annotation] = strtolower($annotation); - } - - return $normalized; - }) - ->setDefault([ - 'covers', - ]) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderFixer.php deleted file mode 100644 index d7423f5e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocOrderFixer.php +++ /dev/null @@ -1,223 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * @author Graham Campbell - * @author Jakub Kwaśniewski - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * order?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * order: list - * } - */ -final class PhpdocOrderFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @const string[] - * - * @TODO: 4.0 - change default to ['param', 'return', 'throws'] - */ - private const ORDER_DEFAULT = ['param', 'throws', 'return']; - - public function getDefinition(): FixerDefinitionInterface - { - $code = <<<'EOF' - self::ORDER_DEFAULT]), - new CodeSample($code, ['order' => ['param', 'return', 'throws']]), - new CodeSample($code, ['order' => ['param', 'custom', 'throws', 'return']]), - ], - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocAlignFixer, PhpdocSeparationFixer, PhpdocTrimFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocIndentFixer, PhpdocNoEmptyReturnFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return -2; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('order', 'Sequence in which annotations in PHPDoc should be ordered.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([static function (array $order): bool { - if (\count($order) < 2) { - throw new InvalidOptionsException('The option "order" value is invalid. Minimum two tags are required.'); - } - - return true; - }]) - ->setDefault(self::ORDER_DEFAULT) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - // assuming annotations are already grouped by tags - $content = $token->getContent(); - - // sort annotations - /** @var list */ - $successors = $this->configuration['order']; - while (\count($successors) >= 3) { - $predecessor = array_shift($successors); - $content = $this->moveAnnotationsBefore($predecessor, $successors, $content); - } - - // we're parsing the content last time to make sure the internal - // state of the docblock is correct after the modifications - /** @var list */ - $predecessors = $this->configuration['order']; - $last = array_pop($predecessors); - $content = $this->moveAnnotationsAfter($last, $predecessors, $content); - - // persist the content at the end - $tokens[$index] = new Token([T_DOC_COMMENT, $content]); - } - } - - /** - * Move all given annotations in before given set of annotations. - * - * @param string $move Tag of annotations that should be moved - * @param list $before Tags of annotations that should moved annotations be placed before - */ - private function moveAnnotationsBefore(string $move, array $before, string $content): string - { - $doc = new DocBlock($content); - $toBeMoved = $doc->getAnnotationsOfType($move); - - // nothing to do if there are no annotations to be moved - if (0 === \count($toBeMoved)) { - return $content; - } - - $others = $doc->getAnnotationsOfType($before); - - if (0 === \count($others)) { - return $content; - } - - // get the index of the final line of the final toBoMoved annotation - $end = end($toBeMoved)->getEnd(); - - $line = $doc->getLine($end); - - // move stuff about if required - foreach ($others as $other) { - if ($other->getStart() < $end) { - // we're doing this to maintain the original line indices - $line->setContent($line->getContent().$other->getContent()); - $other->remove(); - } - } - - return $doc->getContent(); - } - - /** - * Move all given annotations after given set of annotations. - * - * @param string $move Tag of annotations that should be moved - * @param list $after Tags of annotations that should moved annotations be placed after - */ - private function moveAnnotationsAfter(string $move, array $after, string $content): string - { - $doc = new DocBlock($content); - $toBeMoved = $doc->getAnnotationsOfType($move); - - // nothing to do if there are no annotations to be moved - if (0 === \count($toBeMoved)) { - return $content; - } - - $others = $doc->getAnnotationsOfType($after); - - // nothing to do if there are no other annotations - if (0 === \count($others)) { - return $content; - } - - // get the index of the first line of the first toBeMoved annotation - $start = $toBeMoved[0]->getStart(); - $line = $doc->getLine($start); - - // move stuff about if required - foreach (array_reverse($others) as $other) { - if ($other->getEnd() > $start) { - // we're doing this to maintain the original line indices - $line->setContent($other->getContent().$line->getContent()); - $other->remove(); - } - } - - return $doc->getContent(); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocParamOrderFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocParamOrderFixer.php deleted file mode 100644 index dbed46eb..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocParamOrderFixer.php +++ /dev/null @@ -1,273 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\TypeExpression; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Jonathan Gruber - */ -final class PhpdocParamOrderFixer extends AbstractFixer -{ - private const PARAM_TAG = 'param'; - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return parent::getPriority(); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Orders all `@param` annotations in DocBlocks according to method signature.', - [ - new CodeSample( - ' $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - // Check for function / closure token - $nextFunctionToken = $tokens->getNextTokenOfKind($index, [[T_FUNCTION], [T_FN]]); - if (null === $nextFunctionToken) { - return; - } - - // Find start index of param block (opening parenthesis) - $paramBlockStart = $tokens->getNextTokenOfKind($index, ['(']); - if (null === $paramBlockStart) { - return; - } - - $doc = new DocBlock($tokens[$index]->getContent()); - $paramAnnotations = $doc->getAnnotationsOfType(self::PARAM_TAG); - - if ([] === $paramAnnotations) { - continue; - } - - $paramNames = $this->getFunctionParamNames($tokens, $paramBlockStart); - $doc = $this->rewriteDocBlock($doc, $paramNames, $paramAnnotations); - - $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - } - - /** - * @return list - */ - private function getFunctionParamNames(Tokens $tokens, int $paramBlockStart): array - { - $paramBlockEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $paramBlockStart); - - $paramNames = []; - for ( - $i = $tokens->getNextTokenOfKind($paramBlockStart, [[T_VARIABLE]]); - null !== $i && $i < $paramBlockEnd; - $i = $tokens->getNextTokenOfKind($i, [[T_VARIABLE]]) - ) { - $paramNames[] = $tokens[$i]; - } - - return $paramNames; - } - - /** - * Overwrite the param annotations in order. - * - * @param list $paramNames - * @param list $paramAnnotations - */ - private function rewriteDocBlock(DocBlock $doc, array $paramNames, array $paramAnnotations): DocBlock - { - $orderedAnnotations = $this->sortParamAnnotations($paramNames, $paramAnnotations); - $otherAnnotations = $this->getOtherAnnotationsBetweenParams($doc, $paramAnnotations); - - // Append annotations found between param ones - if ([] !== $otherAnnotations) { - array_push($orderedAnnotations, ...$otherAnnotations); - } - - // Overwrite all annotations between first and last @param tag in order - $paramsStart = reset($paramAnnotations)->getStart(); - $paramsEnd = end($paramAnnotations)->getEnd(); - - foreach ($doc->getAnnotations() as $annotation) { - if ($annotation->getStart() < $paramsStart || $annotation->getEnd() > $paramsEnd) { - continue; - } - - $annotation->remove(); - $doc - ->getLine($annotation->getStart()) - ->setContent(current($orderedAnnotations)) - ; - - next($orderedAnnotations); - } - - return $doc; - } - - /** - * Sort the param annotations according to the function parameters. - * - * @param list $funcParamNames - * @param list $paramAnnotations - * - * @return list - */ - private function sortParamAnnotations(array $funcParamNames, array $paramAnnotations): array - { - $validParams = []; - foreach ($funcParamNames as $paramName) { - $indices = $this->findParamAnnotationByIdentifier($paramAnnotations, $paramName->getContent()); - - // Found an exactly matching @param annotation - if (\is_array($indices)) { - foreach ($indices as $index) { - $validParams[$index] = $paramAnnotations[$index]->getContent(); - } - } - } - - // Detect superfluous annotations - /** @var list $invalidParams */ - $invalidParams = array_values( - array_diff_key($paramAnnotations, $validParams) - ); - - // Append invalid parameters to the (ordered) valid ones - $orderedParams = array_values($validParams); - foreach ($invalidParams as $params) { - $orderedParams[] = $params->getContent(); - } - - return $orderedParams; - } - - /** - * Fetch all annotations except the param ones. - * - * @param list $paramAnnotations - * - * @return list - */ - private function getOtherAnnotationsBetweenParams(DocBlock $doc, array $paramAnnotations): array - { - if (0 === \count($paramAnnotations)) { - return []; - } - - $paramsStart = reset($paramAnnotations)->getStart(); - $paramsEnd = end($paramAnnotations)->getEnd(); - - $otherAnnotations = []; - foreach ($doc->getAnnotations() as $annotation) { - if ($annotation->getStart() < $paramsStart || $annotation->getEnd() > $paramsEnd) { - continue; - } - - if (self::PARAM_TAG !== $annotation->getTag()->getName()) { - $otherAnnotations[] = $annotation->getContent(); - } - } - - return $otherAnnotations; - } - - /** - * Return the indices of the lines of a specific parameter annotation. - * - * @param list $paramAnnotations - * - * @return ?list - */ - private function findParamAnnotationByIdentifier(array $paramAnnotations, string $identifier): ?array - { - $blockLevel = 0; - $blockMatch = false; - $blockIndices = []; - - $paramRegex = '/\*\h*@param\h*(?:|'.TypeExpression::REGEX_TYPES.'\h*)&?(?=\$\b)'.preg_quote($identifier).'\b/'; - - foreach ($paramAnnotations as $i => $param) { - $blockStart = Preg::match('/\s*{\s*/', $param->getContent()); - $blockEndMatches = Preg::matchAll('/}[\*\s\n]*/', $param->getContent()); - - if (0 === $blockLevel && Preg::match($paramRegex, $param->getContent())) { - if ($blockStart) { - $blockMatch = true; // Start of a nested block - } else { - return [$i]; // Top level match - } - } - - if ($blockStart) { - ++$blockLevel; - } - - if (0 !== $blockEndMatches) { - $blockLevel -= $blockEndMatches; - } - - if ($blockMatch) { - $blockIndices[] = $i; - if (0 === $blockLevel) { - return $blockIndices; - } - } - } - - return null; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php deleted file mode 100644 index a8eb6aef..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php +++ /dev/null @@ -1,234 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; -use PhpCsFixer\Utils; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; -use Symfony\Component\OptionsResolver\Options; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * replacements?: array - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * replacements: array - * } - */ -final class PhpdocReturnSelfReferenceFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var list - */ - private const TO_TYPES = [ - '$this', - 'static', - 'self', - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'The type of `@return` annotations of methods returning a reference to itself must the configured one.', - [ - new CodeSample( - ' ['this' => 'self']] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return \count($tokens) > 10 && $tokens->isAllTokenKindsFound([T_DOC_COMMENT, T_FUNCTION]) && $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()); - } - - /** - * {@inheritdoc} - * - * Must run before NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 10; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - foreach ($tokensAnalyzer->getClassyElements() as $index => $element) { - if ('method' === $element['type']) { - $this->fixMethod($tokens, $index); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $default = [ - 'this' => '$this', - '@this' => '$this', - '$self' => 'self', - '@self' => 'self', - '$static' => 'static', - '@static' => 'static', - ]; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('replacements', 'Mapping between replaced return types with new ones.')) - ->setAllowedTypes(['array']) - ->setNormalizer(static function (Options $options, array $value) use ($default): array { - $normalizedValue = []; - - foreach ($value as $from => $to) { - if (\is_string($from)) { - $from = strtolower($from); - } - - if (!isset($default[$from])) { - throw new InvalidOptionsException(\sprintf( - 'Unknown key "%s", expected any of %s.', - \gettype($from).'#'.$from, - Utils::naturalLanguageJoin(array_keys($default)) - )); - } - - if (!\in_array($to, self::TO_TYPES, true)) { - throw new InvalidOptionsException(\sprintf( - 'Unknown value "%s", expected any of %s.', - \is_object($to) ? \get_class($to) : \gettype($to).(\is_resource($to) ? '' : '#'.$to), - Utils::naturalLanguageJoin(self::TO_TYPES) - )); - } - - $normalizedValue[$from] = $to; - } - - return $normalizedValue; - }) - ->setDefault($default) - ->getOption(), - ]); - } - - private function fixMethod(Tokens $tokens, int $index): void - { - static $methodModifiers = [T_STATIC, T_FINAL, T_ABSTRACT, T_PRIVATE, T_PROTECTED, T_PUBLIC]; - - // find PHPDoc of method (if any) - while (true) { - $tokenIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$tokenIndex]->isGivenKind($methodModifiers)) { - break; - } - - $index = $tokenIndex; - } - - $docIndex = $tokens->getPrevNonWhitespace($index); - if (!$tokens[$docIndex]->isGivenKind(T_DOC_COMMENT)) { - return; - } - - // find @return - $docBlock = new DocBlock($tokens[$docIndex]->getContent()); - $returnsBlock = $docBlock->getAnnotationsOfType('return'); - - if (0 === \count($returnsBlock)) { - return; // no return annotation found - } - - $returnsBlock = $returnsBlock[0]; - $types = $returnsBlock->getTypes(); - - if (0 === \count($types)) { - return; // no return type(s) found - } - - $newTypes = []; - - foreach ($types as $type) { - $newTypes[] = $this->configuration['replacements'][strtolower($type)] ?? $type; - } - - if ($types === $newTypes) { - return; - } - - $returnsBlock->setTypes($newTypes); - $tokens[$docIndex] = new Token([T_DOC_COMMENT, $docBlock->getContent()]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocScalarFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocScalarFixer.php deleted file mode 100644 index d047b457..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocScalarFixer.php +++ /dev/null @@ -1,139 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractPhpdocTypesFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @author Graham Campbell - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * types?: list<'boolean'|'callback'|'double'|'integer'|'real'|'str'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * types: list<'boolean'|'callback'|'double'|'integer'|'real'|'str'> - * } - */ -final class PhpdocScalarFixer extends AbstractPhpdocTypesFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * The types to fix. - */ - private const TYPES_MAP = [ - 'boolean' => 'bool', - 'callback' => 'callable', - 'double' => 'float', - 'integer' => 'int', - 'real' => 'float', - 'str' => 'string', - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Scalar types should always be written in the same form. `int` not `integer`, `bool` not `boolean`, `float` not `real` or `double`.', - [ - new CodeSample(' ['boolean']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocArrayTypeFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. - * Must run after PhpdocTypesFixer. - */ - public function getPriority(): int - { - /* - * Should be run before all other docblock fixers apart from the - * phpdoc_to_comment and phpdoc_indent fixer to make sure all fixers - * apply correct indentation to new code they add. This should run - * before alignment of params is done since this fixer might change - * the type and thereby un-aligning the params. We also must run after - * the phpdoc_types_fixer because it can convert types to things that - * we can fix. - */ - return 15; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $types = array_keys(self::TYPES_MAP); - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('types', 'A list of types to fix.')) - ->setAllowedValues([new AllowedValueSubset($types)]) - ->setDefault($types) - ->getOption(), - ]); - } - - protected function normalize(string $type): string - { - $suffix = ''; - while (str_ends_with($type, '[]')) { - $type = substr($type, 0, -2); - $suffix .= '[]'; - } - - if (\in_array($type, $this->configuration['types'], true)) { - $type = self::TYPES_MAP[$type]; - } - - return $type.$suffix; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSeparationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSeparationFixer.php deleted file mode 100644 index 7c2f1d91..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSeparationFixer.php +++ /dev/null @@ -1,333 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * @author Graham Campbell - * @author Jakub Kwaśniewski - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * groups?: list>, - * skip_unlisted_annotations?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * groups: list>, - * skip_unlisted_annotations: bool - * } - */ -final class PhpdocSeparationFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - * - * @var list> - */ - public const OPTION_GROUPS_DEFAULT = [ - ['author', 'copyright', 'license'], - ['category', 'package', 'subpackage'], - ['property', 'property-read', 'property-write'], - ['deprecated', 'link', 'see', 'since'], - ]; - - /** - * @var list> - */ - private array $groups; - - public function getDefinition(): FixerDefinitionInterface - { - $code = <<<'EOF' - [ - ['deprecated', 'link', 'see', 'since'], - ['author', 'copyright', 'license'], - ['category', 'package', 'subpackage'], - ['property', 'property-read', 'property-write'], - ['param', 'return'], - ]]), - new CodeSample($code, ['groups' => [ - ['author', 'throws', 'custom'], - ['return', 'param'], - ]]), - new CodeSample( - <<<'EOF' - [['ORM\*'], ['Assert\*']]], - ), - new CodeSample($code, ['skip_unlisted_annotations' => true]), - ], - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, GeneralPhpdocAnnotationRemoveFixer, PhpUnitAttributesFixer, PhpUnitInternalClassFixer, PhpUnitSizeClassFixer, PhpUnitTestClassRequiresCoversFixer, PhpdocIndentFixer, PhpdocNoAccessFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocOrderFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return -3; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - protected function configurePostNormalisation(): void - { - $this->groups = $this->configuration['groups']; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $doc = new DocBlock($token->getContent()); - $this->fixDescription($doc); - $this->fixAnnotations($doc); - - $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $allowTagToBelongToOnlyOneGroup = static function (array $groups): bool { - $tags = []; - foreach ($groups as $groupIndex => $group) { - foreach ($group as $member) { - if (isset($tags[$member])) { - if ($groupIndex === $tags[$member]) { - throw new InvalidOptionsException( - 'The option "groups" value is invalid. '. - 'The "'.$member.'" tag is specified more than once.' - ); - } - - throw new InvalidOptionsException( - 'The option "groups" value is invalid. '. - 'The "'.$member.'" tag belongs to more than one group.' - ); - } - $tags[$member] = $groupIndex; - } - } - - return true; - }; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('groups', 'Sets of annotation types to be grouped together. Use `*` to match any tag character.')) - ->setAllowedTypes(['string[][]']) - ->setDefault(self::OPTION_GROUPS_DEFAULT) - ->setAllowedValues([$allowTagToBelongToOnlyOneGroup]) - ->getOption(), - (new FixerOptionBuilder('skip_unlisted_annotations', 'Whether to skip annotations that are not listed in any group.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) // @TODO 4.0: set to `true`. - ->getOption(), - ]); - } - - /** - * Make sure the description is separated from the annotations. - */ - private function fixDescription(DocBlock $doc): void - { - foreach ($doc->getLines() as $index => $line) { - if ($line->containsATag()) { - break; - } - - if ($line->containsUsefulContent()) { - $next = $doc->getLine($index + 1); - - if (null !== $next && $next->containsATag()) { - $line->addBlank(); - - break; - } - } - } - } - - /** - * Make sure the annotations are correctly separated. - */ - private function fixAnnotations(DocBlock $doc): void - { - foreach ($doc->getAnnotations() as $index => $annotation) { - $next = $doc->getAnnotation($index + 1); - - if (null === $next) { - break; - } - - $shouldBeTogether = $this->shouldBeTogether($annotation, $next, $this->groups); - - if (true === $shouldBeTogether) { - $this->ensureAreTogether($doc, $annotation, $next); - } elseif (false === $shouldBeTogether || false === $this->configuration['skip_unlisted_annotations']) { - $this->ensureAreSeparate($doc, $annotation, $next); - } - } - } - - /** - * Force the given annotations to immediately follow each other. - */ - private function ensureAreTogether(DocBlock $doc, Annotation $first, Annotation $second): void - { - $pos = $first->getEnd(); - $final = $second->getStart(); - - for (++$pos; $pos < $final; ++$pos) { - $doc->getLine($pos)->remove(); - } - } - - /** - * Force the given annotations to have one empty line between each other. - */ - private function ensureAreSeparate(DocBlock $doc, Annotation $first, Annotation $second): void - { - $pos = $first->getEnd(); - $final = $second->getStart() - 1; - - // check if we need to add a line, or need to remove one or more lines - if ($pos === $final) { - $doc->getLine($pos)->addBlank(); - - return; - } - - for (++$pos; $pos < $final; ++$pos) { - $doc->getLine($pos)->remove(); - } - } - - /** - * @param list> $groups - */ - private function shouldBeTogether(Annotation $first, Annotation $second, array $groups): ?bool - { - $firstName = $this->tagName($first); - $secondName = $this->tagName($second); - - // A tag could not be read. - if (null === $firstName || null === $secondName) { - return null; - } - - if ($firstName === $secondName) { - return true; - } - - foreach ($groups as $group) { - $firstTagIsInGroup = $this->isInGroup($firstName, $group); - $secondTagIsInGroup = $this->isInGroup($secondName, $group); - - if ($firstTagIsInGroup) { - return $secondTagIsInGroup; - } - - if ($secondTagIsInGroup) { - return false; - } - } - - return null; - } - - private function tagName(Annotation $annotation): ?string - { - Preg::match('/@([a-zA-Z0-9_\\\-]+(?=\s|$|\())/', $annotation->getContent(), $matches); - - return $matches[1] ?? null; - } - - /** - * @param list $group - */ - private function isInGroup(string $tag, array $group): bool - { - foreach ($group as $tagInGroup) { - $tagInGroup = str_replace('*', '\*', $tagInGroup); - $tagInGroup = preg_quote($tagInGroup, '/'); - $tagInGroup = str_replace('\\\\\*', '.*?', $tagInGroup); - - if (Preg::match("/^{$tagInGroup}$/", $tag)) { - return true; - } - } - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixer.php deleted file mode 100644 index 9c2bda1d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixer.php +++ /dev/null @@ -1,89 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for part of rule defined in PSR5 ¶7.22. - */ -final class PhpdocSingleLineVarSpacingFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Single line `@var` PHPDoc should have proper spacing.', - [new CodeSample("isAnyTokenKindsFound([T_COMMENT, T_DOC_COMMENT]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - /** @var Token $token */ - foreach ($tokens as $index => $token) { - if (!$token->isComment()) { - continue; - } - - $content = $token->getContent(); - $fixedContent = $this->fixTokenContent($content); - - if ($content !== $fixedContent) { - $tokens[$index] = new Token([T_DOC_COMMENT, $fixedContent]); - } - } - } - - private function fixTokenContent(string $content): string - { - return Preg::replaceCallback( - '#^/\*\*\h*@var\h+(\S+)\h*(\$\S+)?\h*([^\n]*)\*/$#', - static function (array $matches) { - $content = '/** @var'; - - for ($i = 1, $m = \count($matches); $i < $m; ++$i) { - if ('' !== $matches[$i]) { - $content .= ' '.$matches[$i]; - } - } - - return rtrim($content).' */'; - }, - $content - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSummaryFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSummaryFixer.php deleted file mode 100644 index 034be5c9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocSummaryFixer.php +++ /dev/null @@ -1,99 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\ShortDescription; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Graham Campbell - */ -final class PhpdocSummaryFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPDoc summary should end in either a full stop, exclamation mark, or question mark.', - [new CodeSample('isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $doc = new DocBlock($token->getContent()); - $end = (new ShortDescription($doc))->getEnd(); - - if (null !== $end) { - $line = $doc->getLine($end); - $content = rtrim($line->getContent()); - - if ( - // final line of Description is NOT properly formatted - !$this->isCorrectlyFormatted($content) - // and first line of Description, if different than final line, does NOT indicate a list - && (1 === $end || ($doc->isMultiLine() && ':' !== substr(rtrim($doc->getLine(1)->getContent()), -1))) - ) { - $line->setContent($content.'.'.$this->whitespacesConfig->getLineEnding()); - $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - } - } - } - - /** - * Is the last line of the short description correctly formatted? - */ - private function isCorrectlyFormatted(string $content): bool - { - if (str_contains(strtolower($content), strtolower('{@inheritdoc}'))) { - return true; - } - - return $content !== rtrim($content, '.:。!?¡¿!?'); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagCasingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagCasingFixer.php deleted file mode 100644 index 16ef2e88..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagCasingFixer.php +++ /dev/null @@ -1,109 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\ConfigurationException\InvalidConfigurationException; -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * tags?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * tags: list - * } - */ -final class PhpdocTagCasingFixer extends AbstractProxyFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Fixes casing of PHPDoc tags.', - [ - new CodeSample(" ['foo'], - ]), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return parent::getPriority(); - } - - protected function configurePostNormalisation(): void - { - $replacements = []; - foreach ($this->configuration['tags'] as $tag) { - $replacements[$tag] = $tag; - } - - /** @var GeneralPhpdocTagRenameFixer $generalPhpdocTagRenameFixer */ - $generalPhpdocTagRenameFixer = $this->proxyFixers['general_phpdoc_tag_rename']; - - try { - $generalPhpdocTagRenameFixer->configure([ - 'case_sensitive' => false, - 'fix_annotation' => true, - 'fix_inline' => true, - 'replacements' => $replacements, - ]); - } catch (InvalidConfigurationException $exception) { - throw new InvalidFixerConfigurationException( - $this->getName(), - Preg::replace('/^\[.+?\] /', '', $exception->getMessage()), - $exception - ); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('tags', 'List of tags to fix with their expected casing.')) - ->setAllowedTypes(['string[]']) - ->setDefault(['inheritDoc']) - ->getOption(), - ]); - } - - protected function createProxyFixers(): array - { - return [new GeneralPhpdocTagRenameFixer()]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php deleted file mode 100644 index 150115c6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php +++ /dev/null @@ -1,214 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; -use Symfony\Component\OptionsResolver\Options; - -/** - * @phpstan-type _AutogeneratedInputConfiguration array{ - * tags?: array - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * tags: array - * } - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - */ -final class PhpdocTagTypeFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - private const TAG_REGEX = '/^(?: - (? - (?:@(?.+?)(?:\s.+)?) - ) - | - {(? - (?:@(?.+?)(?:\s.+)?) - )} - )$/x'; - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Forces PHPDoc tags to be either regular annotations or inline.', - [ - new CodeSample( - " ['inheritdoc' => 'inline']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 0; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if (0 === \count($this->configuration['tags'])) { - return; - } - - $regularExpression = \sprintf( - '/({?@(?:%s).*?(?:(?=\s\*\/)|(?=\n)}?))/i', - implode('|', array_map( - static fn (string $tag): string => preg_quote($tag, '/'), - array_keys($this->configuration['tags']) - )) - ); - - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $parts = Preg::split( - $regularExpression, - $token->getContent(), - -1, - PREG_SPLIT_DELIM_CAPTURE - ); - - for ($i = 1, $max = \count($parts) - 1; $i < $max; $i += 2) { - if (!Preg::match(self::TAG_REGEX, $parts[$i], $matches)) { - continue; - } - - if ('' !== $matches['tag']) { - $tag = $matches['tag']; - $tagName = $matches['tag_name']; - } else { - $tag = $matches['inlined_tag']; - $tagName = $matches['inlined_tag_name']; - } - - $tagName = strtolower($tagName); - if (!isset($this->configuration['tags'][$tagName])) { - continue; - } - - if ('inline' === $this->configuration['tags'][$tagName]) { - $parts[$i] = '{'.$tag.'}'; - - continue; - } - - if (!$this->tagIsSurroundedByText($parts, $i)) { - $parts[$i] = $tag; - } - } - - $tokens[$index] = new Token([T_DOC_COMMENT, implode('', $parts)]); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('tags', 'The list of tags to fix.')) - ->setAllowedTypes(["array"]) - ->setAllowedValues([static function (array $value): bool { - foreach ($value as $type) { - if (!\in_array($type, ['annotation', 'inline'], true)) { - throw new InvalidOptionsException("Unknown tag type \"{$type}\"."); - } - } - - return true; - }]) - ->setDefault([ - 'api' => 'annotation', - 'author' => 'annotation', - 'copyright' => 'annotation', - 'deprecated' => 'annotation', - 'example' => 'annotation', - 'global' => 'annotation', - 'inheritDoc' => 'annotation', - 'internal' => 'annotation', - 'license' => 'annotation', - 'method' => 'annotation', - 'package' => 'annotation', - 'param' => 'annotation', - 'property' => 'annotation', - 'return' => 'annotation', - 'see' => 'annotation', - 'since' => 'annotation', - 'throws' => 'annotation', - 'todo' => 'annotation', - 'uses' => 'annotation', - 'var' => 'annotation', - 'version' => 'annotation', - ]) - ->setNormalizer(static function (Options $options, array $value): array { - $normalized = []; - - foreach ($value as $tag => $type) { - $normalized[strtolower($tag)] = $type; - } - - return $normalized; - }) - ->getOption(), - ]); - } - - /** - * @param array $parts - */ - private function tagIsSurroundedByText(array $parts, int $index): bool - { - return - Preg::match('/(^|\R)\h*[^@\s]\N*/', $this->cleanComment($parts[$index - 1])) - || Preg::match('/^.*?\R\s*[^@\s]/', $this->cleanComment($parts[$index + 1])); - } - - private function cleanComment(string $comment): string - { - $comment = Preg::replace('/^\/\*\*|\*\/$/', '', $comment); - - return Preg::replace('/(\R)(\h*\*)?\h*/', '$1', $comment); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocToCommentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocToCommentFixer.php deleted file mode 100644 index 08e35740..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocToCommentFixer.php +++ /dev/null @@ -1,185 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\CommentsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Ceeram - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * allow_before_return_statement?: bool, - * ignored_tags?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * allow_before_return_statement: bool, - * ignored_tags: list - * } - */ -final class PhpdocToCommentFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var list - */ - private array $ignoredTags = []; - private bool $allowBeforeReturnStatement = false; - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - /** - * {@inheritdoc} - * - * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyCommentFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocArrayTypeFixer, PhpdocIndentFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer, SingleLineCommentSpacingFixer, SingleLineCommentStyleFixer. - * Must run after CommentToPhpdocFixer. - */ - public function getPriority(): int - { - /* - * Should be run before all other docblock fixers so that these fixers - * don't touch doc comments which are meant to be converted to regular - * comments. - */ - return 25; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Docblocks should only be used on structural elements.', - [ - new CodeSample( - ' $sqlite) { - $sqlite->open($path); -} -' - ), - new CodeSample( - ' $sqlite) { - $sqlite->open($path); -} - -/** @todo This should be a PHPDoc as the tag is on "ignored_tags" list */ -foreach($connections as $key => $sqlite) { - $sqlite->open($path); -} -', - ['ignored_tags' => ['todo']] - ), - new CodeSample( - ' $sqlite) { - $sqlite->open($path); -} - -function returnClassName() { - /** @var class-string */ - return \StdClass::class; -} -', - ['allow_before_return_statement' => true] - ), - ] - ); - } - - protected function configurePostNormalisation(): void - { - $this->ignoredTags = array_map( - static fn (string $tag): string => strtolower($tag), - $this->configuration['ignored_tags'] - ); - - $this->allowBeforeReturnStatement = true === $this->configuration['allow_before_return_statement']; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('ignored_tags', 'List of ignored tags (matched case insensitively).')) - ->setAllowedTypes(['string[]']) - ->setDefault([]) - ->getOption(), - (new FixerOptionBuilder('allow_before_return_statement', 'Whether to allow PHPDoc before return statement.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) // @TODO 4.0: set to `true` - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $commentsAnalyzer = new CommentsAnalyzer(); - - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - if ($commentsAnalyzer->isHeaderComment($tokens, $index)) { - continue; - } - - if ($this->allowBeforeReturnStatement && $commentsAnalyzer->isBeforeReturn($tokens, $index)) { - continue; - } - - if ($commentsAnalyzer->isBeforeStructuralElement($tokens, $index)) { - continue; - } - - if (0 < Preg::matchAll('~\@([a-zA-Z0-9_\\\-]+)\b~', $token->getContent(), $matches)) { - foreach ($matches[1] as $match) { - if (\in_array(strtolower($match), $this->ignoredTags, true)) { - continue 2; - } - } - } - - $tokens[$index] = new Token([T_COMMENT, '/*'.ltrim($token->getContent(), '/*')]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php deleted file mode 100644 index 6b107af1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php +++ /dev/null @@ -1,191 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\Line; -use PhpCsFixer\DocBlock\ShortDescription; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Nobu Funaki - * @author Dariusz Rumiński - */ -final class PhpdocTrimConsecutiveBlankLineSeparationFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Removes extra blank lines after summary and after description in PHPDoc.', - [ - new CodeSample( - 'isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $doc = new DocBlock($token->getContent()); - $summaryEnd = (new ShortDescription($doc))->getEnd(); - - if (null !== $summaryEnd) { - $this->fixSummary($doc, $summaryEnd); - $this->fixDescription($doc, $summaryEnd); - } - - $this->fixAllTheRest($doc); - - $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - } - - private function fixSummary(DocBlock $doc, int $summaryEnd): void - { - $nonBlankLineAfterSummary = $this->findNonBlankLine($doc, $summaryEnd); - - $this->removeExtraBlankLinesBetween($doc, $summaryEnd, $nonBlankLineAfterSummary); - } - - private function fixDescription(DocBlock $doc, int $summaryEnd): void - { - $annotationStart = $this->findFirstAnnotationOrEnd($doc); - - // assuming the end of the Description appears before the first Annotation - $descriptionEnd = $this->reverseFindLastUsefulContent($doc, $annotationStart); - - if (null === $descriptionEnd || $summaryEnd === $descriptionEnd) { - return; // no Description - } - - if ($annotationStart === \count($doc->getLines()) - 1) { - return; // no content after Description - } - - $this->removeExtraBlankLinesBetween($doc, $descriptionEnd, $annotationStart); - } - - private function fixAllTheRest(DocBlock $doc): void - { - $annotationStart = $this->findFirstAnnotationOrEnd($doc); - $lastLine = $this->reverseFindLastUsefulContent($doc, \count($doc->getLines()) - 1); - - if (null !== $lastLine && $annotationStart !== $lastLine) { - $this->removeExtraBlankLinesBetween($doc, $annotationStart, $lastLine); - } - } - - private function removeExtraBlankLinesBetween(DocBlock $doc, int $from, int $to): void - { - for ($index = $from + 1; $index < $to; ++$index) { - $line = $doc->getLine($index); - $next = $doc->getLine($index + 1); - $this->removeExtraBlankLine($line, $next); - } - } - - private function removeExtraBlankLine(Line $current, Line $next): void - { - if (!$current->isTheEnd() && !$current->containsUsefulContent() - && !$next->isTheEnd() && !$next->containsUsefulContent()) { - $current->remove(); - } - } - - private function findNonBlankLine(DocBlock $doc, int $after): ?int - { - foreach ($doc->getLines() as $index => $line) { - if ($index <= $after) { - continue; - } - - if ($line->containsATag() || $line->containsUsefulContent() || $line->isTheEnd()) { - return $index; - } - } - - return null; - } - - private function findFirstAnnotationOrEnd(DocBlock $doc): int - { - foreach ($doc->getLines() as $index => $line) { - if ($line->containsATag()) { - return $index; - } - } - - if (!isset($index)) { - throw new \LogicException('PHPDoc has empty lines collection.'); - } - - return $index; // no Annotation, return the last line - } - - private function reverseFindLastUsefulContent(DocBlock $doc, int $from): ?int - { - for ($index = $from - 1; $index >= 0; --$index) { - if ($doc->getLine($index)->containsUsefulContent()) { - return $index; - } - } - - return null; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimFixer.php deleted file mode 100644 index d6b2391e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTrimFixer.php +++ /dev/null @@ -1,115 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Graham Campbell - */ -final class PhpdocTrimFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'PHPDoc should start and end with content, excluding the very first and last line of the docblocks.', - [new CodeSample('isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $content = $token->getContent(); - $content = $this->fixStart($content); - // we need re-parse the docblock after fixing the start before - // fixing the end in order for the lines to be correctly indexed - $content = $this->fixEnd($content); - $tokens[$index] = new Token([T_DOC_COMMENT, $content]); - } - } - - /** - * Make sure the first useful line starts immediately after the first line. - */ - private function fixStart(string $content): string - { - return Preg::replace( - '~ - (^/\*\*) # DocComment begin - (?: - \R\h*(?:\*\h*)? # lines without useful content - (?!\R\h*\*/) # not followed by a DocComment end - )+ - (\R\h*(?:\*\h*)?\S) # first line with useful content - ~x', - '$1$2', - $content - ); - } - - /** - * Make sure the last useful line is immediately before the final line. - */ - private function fixEnd(string $content): string - { - return Preg::replace( - '~ - (\R\h*(?:\*\h*)?\S.*?) # last line with useful content - (?: - (? - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractPhpdocTypesFixer; -use PhpCsFixer\DocBlock\TypeExpression; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @author Graham Campbell - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * groups?: list<'alias'|'meta'|'simple'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * groups: list<'alias'|'meta'|'simple'> - * } - */ -final class PhpdocTypesFixer extends AbstractPhpdocTypesFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * Available types, grouped. - * - * @var array> - */ - private const POSSIBLE_TYPES = [ - 'simple' => [ - 'array', - 'bool', - 'callable', - 'float', - 'int', - 'iterable', - 'null', - 'object', - 'string', - ], - 'alias' => [ - 'boolean', - 'double', - 'integer', - ], - 'meta' => [ - '$this', - 'false', - 'mixed', - 'parent', - 'resource', - 'scalar', - 'self', - 'static', - 'true', - 'void', - ], - ]; - - /** @var array */ - private array $typesSetToFix; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'The correct case must be used for standard PHP types in PHPDoc.', - [ - new CodeSample( - ' ['simple', 'alias']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocArrayTypeFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocScalarFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer. - * Must run after PhpdocIndentFixer. - */ - public function getPriority(): int - { - /* - * Should be run before all other docblock fixers apart from the - * phpdoc_to_comment and phpdoc_indent fixer to make sure all fixers - * apply correct indentation to new code they add. This should run - * before alignment of params is done since this fixer might change - * the type and thereby un-aligning the params. We also must run before - * the phpdoc_scalar_fixer so that it can make changes after us. - */ - return 16; - } - - protected function configurePostNormalisation(): void - { - $typesToFix = array_merge(...array_map(static fn (string $group): array => self::POSSIBLE_TYPES[$group], $this->configuration['groups'])); - - $this->typesSetToFix = array_combine($typesToFix, array_fill(0, \count($typesToFix), true)); - } - - protected function normalize(string $type): string - { - $typeExpression = new TypeExpression($type, null, []); - - $newTypeExpression = $typeExpression->mapTypes(function (TypeExpression $type) { - if ($type->isUnionType()) { - return $type; - } - - $value = $type->toString(); - $valueLower = strtolower($value); - if (isset($this->typesSetToFix[$valueLower])) { - return new TypeExpression($valueLower, null, []); - } - - return $type; - }); - - return $newTypeExpression->toString(); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $possibleGroups = array_keys(self::POSSIBLE_TYPES); - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('groups', 'Type groups to fix.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset($possibleGroups)]) - ->setDefault($possibleGroups) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesOrderFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesOrderFixer.php deleted file mode 100644 index 1462e933..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocTypesOrderFixer.php +++ /dev/null @@ -1,218 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\Annotation; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\TypeExpression; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * case_sensitive?: bool, - * null_adjustment?: 'always_first'|'always_last'|'none', - * sort_algorithm?: 'alpha'|'none' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * case_sensitive: bool, - * null_adjustment: 'always_first'|'always_last'|'none', - * sort_algorithm: 'alpha'|'none' - * } - */ -final class PhpdocTypesOrderFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Sorts PHPDoc types.', - [ - new CodeSample( - ' 'always_last'] - ), - new CodeSample( - ' 'alpha'] - ), - new CodeSample( - ' 'alpha', - 'null_adjustment' => 'always_last', - ] - ), - new CodeSample( - ' 'alpha', - 'null_adjustment' => 'none', - ] - ), - new CodeSample( - ' true] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before PhpdocAlignFixer. - * Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocArrayTypeFixer, PhpdocIndentFixer, PhpdocListTypeFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_DOC_COMMENT); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('sort_algorithm', 'The sorting algorithm to apply.')) - ->setAllowedValues(['alpha', 'none']) - ->setDefault('alpha') - ->getOption(), - (new FixerOptionBuilder('null_adjustment', 'Forces the position of `null` (overrides `sort_algorithm`).')) - ->setAllowedValues(['always_first', 'always_last', 'none']) - ->setDefault('always_first') - ->getOption(), - (new FixerOptionBuilder('case_sensitive', 'Whether the sorting should be case sensitive.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $doc = new DocBlock($token->getContent()); - $annotations = $doc->getAnnotationsOfType(Annotation::getTagsWithTypes()); - - if (0 === \count($annotations)) { - continue; - } - - foreach ($annotations as $annotation) { - // fix main types - if (null !== $annotation->getTypeExpression()) { - $annotation->setTypes( - $this->sortTypes( - $annotation->getTypeExpression() - ) - ); - } - - // fix @method parameters types - $line = $doc->getLine($annotation->getStart()); - $line->setContent(Preg::replaceCallback('/\*\h*@method\h+'.TypeExpression::REGEX_TYPES.'\h+\K(?&callable)/', function (array $matches) { - $typeExpression = new TypeExpression($matches[0], null, []); - - return implode('|', $this->sortTypes($typeExpression)); - }, $line->getContent())); - } - - $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - } - - /** - * @return list - */ - private function sortTypes(TypeExpression $typeExpression): array - { - $normalizeType = static fn (string $type): string => Preg::replace('/^\(*\??\\\?/', '', $type); - - $sortedTypeExpression = $typeExpression->sortTypes( - function (TypeExpression $a, TypeExpression $b) use ($normalizeType): int { - $a = $normalizeType($a->toString()); - $b = $normalizeType($b->toString()); - $lowerCaseA = strtolower($a); - $lowerCaseB = strtolower($b); - - if ('none' !== $this->configuration['null_adjustment']) { - if ('null' === $lowerCaseA && 'null' !== $lowerCaseB) { - return 'always_last' === $this->configuration['null_adjustment'] ? 1 : -1; - } - if ('null' !== $lowerCaseA && 'null' === $lowerCaseB) { - return 'always_last' === $this->configuration['null_adjustment'] ? -1 : 1; - } - } - - if ('alpha' === $this->configuration['sort_algorithm']) { - return true === $this->configuration['case_sensitive'] ? $a <=> $b : strcasecmp($a, $b); - } - - return 0; - } - ); - - return $sortedTypeExpression->getTypes(); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarAnnotationCorrectOrderFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarAnnotationCorrectOrderFixer.php deleted file mode 100644 index 441710ae..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarAnnotationCorrectOrderFixer.php +++ /dev/null @@ -1,81 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - */ -final class PhpdocVarAnnotationCorrectOrderFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - '`@var` and `@type` annotations must have type and name in the correct order.', - [new CodeSample('isTokenKindFound(T_DOC_COMMENT); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - if (!str_contains(strtolower($token->getContent()), strtolower('@var')) && !str_contains(strtolower($token->getContent()), strtolower('@type'))) { - continue; - } - - $newContent = Preg::replace( - '/(@(?:type|var)\s*)(\$\S+)(\h+)([^\$](?:[^<\s]|<[^>]*>)*)(\s|\*)/i', - '$1$4$3$2$5', - $token->getContent() - ); - - if ($newContent === $token->getContent()) { - continue; - } - - $tokens[$index] = new Token([$token->getId(), $newContent]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarWithoutNameFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarWithoutNameFixer.php deleted file mode 100644 index d6e9675c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocVarWithoutNameFixer.php +++ /dev/null @@ -1,150 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Phpdoc; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\DocBlock\DocBlock; -use PhpCsFixer\DocBlock\Line; -use PhpCsFixer\DocBlock\TypeExpression; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Graham Campbell - * @author Dave van der Brugge - */ -final class PhpdocVarWithoutNameFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - '`@var` and `@type` annotations of classy properties should not contain the name.', - [new CodeSample('isTokenKindFound(T_DOC_COMMENT) && $tokens->isAnyTokenKindsFound([T_CLASS, T_TRAIT]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_DOC_COMMENT)) { - continue; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - - if (null === $nextIndex) { - continue; - } - - // For people writing "static public $foo" instead of "public static $foo" - if ($tokens[$nextIndex]->isGivenKind(T_STATIC)) { - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - } - - // We want only doc blocks that are for properties and thus have specified access modifiers next - $propertyModifierKinds = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_VAR]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $propertyModifierKinds[] = T_READONLY; - } - - if (!$tokens[$nextIndex]->isGivenKind($propertyModifierKinds)) { - continue; - } - - $doc = new DocBlock($token->getContent()); - - $firstLevelLines = $this->getFirstLevelLines($doc); - $annotations = $doc->getAnnotationsOfType(['type', 'var']); - - foreach ($annotations as $annotation) { - if (isset($firstLevelLines[$annotation->getStart()])) { - $this->fixLine($firstLevelLines[$annotation->getStart()]); - } - } - - $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]); - } - } - - private function fixLine(Line $line): void - { - Preg::matchAll('/ \$'.TypeExpression::REGEX_IDENTIFIER.'(?getContent(), $matches); - - foreach ($matches[0] as $match) { - $line->setContent(str_replace($match, '', $line->getContent())); - } - } - - /** - * @return array - */ - private function getFirstLevelLines(DocBlock $docBlock): array - { - $nested = 0; - $lines = $docBlock->getLines(); - - foreach ($lines as $index => $line) { - $content = $line->getContent(); - - if (Preg::match('/\s*\*\s*}$/', $content)) { - --$nested; - } - - if ($nested > 0) { - unset($lines[$index]); - } - - if (Preg::match('/\s\{$/', $content)) { - ++$nested; - } - } - - return $lines; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/NoUselessReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/NoUselessReturnFixer.php deleted file mode 100644 index aba3072c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/NoUselessReturnFixer.php +++ /dev/null @@ -1,103 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ReturnNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -final class NoUselessReturnFixer extends AbstractFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAllTokenKindsFound([T_FUNCTION, T_RETURN]); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should not be an empty `return` statement at the end of a function.', - [ - new CodeSample( - ' $token) { - if (!$token->isGivenKind(T_FUNCTION)) { - continue; - } - - $index = $tokens->getNextTokenOfKind($index, [';', '{']); - if ($tokens[$index]->equals('{')) { - $this->fixFunction($tokens, $index, $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index)); - } - } - } - - /** - * @param int $start Token index of the opening brace token of the function - * @param int $end Token index of the closing brace token of the function - */ - private function fixFunction(Tokens $tokens, int $start, int $end): void - { - for ($index = $end; $index > $start; --$index) { - if (!$tokens[$index]->isGivenKind(T_RETURN)) { - continue; - } - - $nextAt = $tokens->getNextMeaningfulToken($index); - if (!$tokens[$nextAt]->equals(';')) { - continue; - } - - if ($tokens->getNextMeaningfulToken($nextAt) !== $end) { - continue; - } - - $previous = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$previous]->equalsAny([[T_ELSE], ')'])) { - continue; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - $tokens->clearTokenAndMergeSurroundingWhitespace($nextAt); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/ReturnAssignmentFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/ReturnAssignmentFixer.php deleted file mode 100644 index 1e883382..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/ReturnAssignmentFixer.php +++ /dev/null @@ -1,527 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ReturnNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -final class ReturnAssignmentFixer extends AbstractFixer -{ - private TokensAnalyzer $tokensAnalyzer; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Local, dynamic and directly referenced variables should not be assigned and directly returned by a function or method.', - [new CodeSample("isAllTokenKindsFound([T_FUNCTION, T_RETURN, T_VARIABLE]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokenCount = \count($tokens); - $this->tokensAnalyzer = new TokensAnalyzer($tokens); - - for ($index = 1; $index < $tokenCount; ++$index) { - if (!$tokens[$index]->isGivenKind(T_FUNCTION)) { - continue; - } - - $next = $tokens->getNextMeaningfulToken($index); - if ($tokens[$next]->isGivenKind(CT::T_RETURN_REF)) { - continue; - } - - $functionOpenIndex = $tokens->getNextTokenOfKind($index, ['{', ';']); - if ($tokens[$functionOpenIndex]->equals(';')) { // abstract function - $index = $functionOpenIndex - 1; - - continue; - } - - $functionCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $functionOpenIndex); - $totalTokensAdded = 0; - - do { - $tokensAdded = $this->fixFunction( - $tokens, - $index, - $functionOpenIndex, - $functionCloseIndex - ); - - $functionCloseIndex += $tokensAdded; - $totalTokensAdded += $tokensAdded; - } while ($tokensAdded > 0); - - $index = $functionCloseIndex; - $tokenCount += $totalTokensAdded; - } - } - - /** - * @param int $functionIndex token index of T_FUNCTION - * @param int $functionOpenIndex token index of the opening brace token of the function - * @param int $functionCloseIndex token index of the closing brace token of the function - * - * @return int >= 0 number of tokens inserted into the Tokens collection - */ - private function fixFunction(Tokens $tokens, int $functionIndex, int $functionOpenIndex, int $functionCloseIndex): int - { - static $riskyKinds = [ - CT::T_DYNAMIC_VAR_BRACE_OPEN, // "$h = ${$g};" case - T_EVAL, // "$c = eval('return $this;');" case - T_GLOBAL, - T_INCLUDE, // loading additional symbols we cannot analyze here - T_INCLUDE_ONCE, // " - T_REQUIRE, // " - T_REQUIRE_ONCE, // " - ]; - - $inserted = 0; - $candidates = []; - $isRisky = false; - - if ($tokens[$tokens->getNextMeaningfulToken($functionIndex)]->isGivenKind(CT::T_RETURN_REF)) { - $isRisky = true; - } - - // go through the function declaration and check if references are passed - // - check if it will be risky to fix return statements of this function - for ($index = $functionIndex + 1; $index < $functionOpenIndex; ++$index) { - if ($tokens[$index]->equals('&')) { - $isRisky = true; - - break; - } - } - - // go through all the tokens of the body of the function: - // - check if it will be risky to fix return statements of this function - // - check nested functions; fix when found and update the upper limit + number of inserted token - // - check for return statements that might be fixed (based on if fixing will be risky, which is only know after analyzing the whole function) - - for ($index = $functionOpenIndex + 1; $index < $functionCloseIndex; ++$index) { - if ($tokens[$index]->isGivenKind(T_FUNCTION)) { - $nestedFunctionOpenIndex = $tokens->getNextTokenOfKind($index, ['{', ';']); - if ($tokens[$nestedFunctionOpenIndex]->equals(';')) { // abstract function - $index = $nestedFunctionOpenIndex - 1; - - continue; - } - - $nestedFunctionCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $nestedFunctionOpenIndex); - - $tokensAdded = $this->fixFunction( - $tokens, - $index, - $nestedFunctionOpenIndex, - $nestedFunctionCloseIndex - ); - - $index = $nestedFunctionCloseIndex + $tokensAdded; - $functionCloseIndex += $tokensAdded; - $inserted += $tokensAdded; - } - - if ($isRisky) { - continue; // don't bother to look into anything else than nested functions as the current is risky already - } - - if ($tokens[$index]->equals('&')) { - $isRisky = true; - - continue; - } - - if ($tokens[$index]->isGivenKind(T_RETURN)) { - $candidates[] = $index; - - continue; - } - - // test if there is anything in the function body that might - // change global state or indirect changes (like through references, eval, etc.) - - if ($tokens[$index]->isGivenKind($riskyKinds)) { - $isRisky = true; - - continue; - } - - if ($tokens[$index]->isGivenKind(T_STATIC)) { - $nextIndex = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$nextIndex]->isGivenKind(T_FUNCTION)) { - $isRisky = true; // "static $a" case - - continue; - } - } - - if ($tokens[$index]->equals('$')) { - $nextIndex = $tokens->getNextMeaningfulToken($index); - if ($tokens[$nextIndex]->isGivenKind(T_VARIABLE)) { - $isRisky = true; // "$$a" case - - continue; - } - } - - if ($this->tokensAnalyzer->isSuperGlobal($index)) { - $isRisky = true; - - continue; - } - } - - if ($isRisky) { - return $inserted; - } - - // fix the candidates in reverse order when applicable - for ($i = \count($candidates) - 1; $i >= 0; --$i) { - $index = $candidates[$i]; - - // Check if returning only a variable (i.e. not the result of an expression, function call etc.) - $returnVarIndex = $tokens->getNextMeaningfulToken($index); - if (!$tokens[$returnVarIndex]->isGivenKind(T_VARIABLE)) { - continue; // example: "return 1;" - } - - $endReturnVarIndex = $tokens->getNextMeaningfulToken($returnVarIndex); - if (!$tokens[$endReturnVarIndex]->equalsAny([';', [T_CLOSE_TAG]])) { - continue; // example: "return $a + 1;" - } - - // Check that the variable is assigned just before it is returned - $assignVarEndIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$assignVarEndIndex]->equals(';')) { - continue; // example: "? return $a;" - } - - // Note: here we are @ "; return $a;" (or "; return $a ? >") - while (true) { - $prevMeaningFul = $tokens->getPrevMeaningfulToken($assignVarEndIndex); - - if (!$tokens[$prevMeaningFul]->equals(')')) { - break; - } - - $assignVarEndIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $prevMeaningFul); - } - - $assignVarOperatorIndex = $tokens->getPrevTokenOfKind( - $assignVarEndIndex, - ['=', ';', '{', '}', [T_OPEN_TAG], [T_OPEN_TAG_WITH_ECHO]] - ); - - if ($tokens[$assignVarOperatorIndex]->equals('}')) { - $startIndex = $this->isCloseBracePartOfDefinition($tokens, $assignVarOperatorIndex); // test for `anonymous class`, `lambda` and `match` - - if (null === $startIndex) { - continue; - } - - $assignVarOperatorIndex = $tokens->getPrevMeaningfulToken($startIndex); - } - - if (!$tokens[$assignVarOperatorIndex]->equals('=')) { - continue; - } - - // Note: here we are @ "= [^;{] ; return $a;" - $assignVarIndex = $tokens->getPrevMeaningfulToken($assignVarOperatorIndex); - if (!$tokens[$assignVarIndex]->equals($tokens[$returnVarIndex], false)) { - continue; - } - - // Note: here we are @ "$a = [^;{] ; return $a;" - $beforeAssignVarIndex = $tokens->getPrevMeaningfulToken($assignVarIndex); - if (!$tokens[$beforeAssignVarIndex]->equalsAny([';', '{', '}'])) { - continue; - } - - // Check if there is a `catch` or `finally` block between the assignment and the return - if ($this->isUsedInCatchOrFinally($tokens, $returnVarIndex, $functionOpenIndex, $functionCloseIndex)) { - continue; - } - - // Note: here we are @ "[;{}] $a = [^;{] ; return $a;" - $inserted += $this->simplifyReturnStatement( - $tokens, - $assignVarIndex, - $assignVarOperatorIndex, - $index, - $endReturnVarIndex - ); - } - - return $inserted; - } - - /** - * @return int >= 0 number of tokens inserted into the Tokens collection - */ - private function simplifyReturnStatement( - Tokens $tokens, - int $assignVarIndex, - int $assignVarOperatorIndex, - int $returnIndex, - int $returnVarEndIndex - ): int { - $inserted = 0; - $originalIndent = $tokens[$assignVarIndex - 1]->isWhitespace() - ? $tokens[$assignVarIndex - 1]->getContent() - : null; - - // remove the return statement - if ($tokens[$returnVarEndIndex]->equals(';')) { // do not remove PHP close tags - $tokens->clearTokenAndMergeSurroundingWhitespace($returnVarEndIndex); - } - - for ($i = $returnIndex; $i <= $returnVarEndIndex - 1; ++$i) { - $this->clearIfSave($tokens, $i); - } - - // remove no longer needed indentation of the old/remove return statement - if ($tokens[$returnIndex - 1]->isWhitespace()) { - $content = $tokens[$returnIndex - 1]->getContent(); - $fistLinebreakPos = strrpos($content, "\n"); - $content = false === $fistLinebreakPos - ? ' ' - : substr($content, $fistLinebreakPos); - - $tokens[$returnIndex - 1] = new Token([T_WHITESPACE, $content]); - } - - // remove the variable and the assignment - for ($i = $assignVarIndex; $i <= $assignVarOperatorIndex; ++$i) { - $this->clearIfSave($tokens, $i); - } - - // insert new return statement - $tokens->insertAt($assignVarIndex, new Token([T_RETURN, 'return'])); - ++$inserted; - - // use the original indent of the var assignment for the new return statement - if ( - null !== $originalIndent - && $tokens[$assignVarIndex - 1]->isWhitespace() - && $originalIndent !== $tokens[$assignVarIndex - 1]->getContent() - ) { - $tokens[$assignVarIndex - 1] = new Token([T_WHITESPACE, $originalIndent]); - } - - // remove trailing space after the new return statement which might be added during the cleanup process - $nextIndex = $tokens->getNonEmptySibling($assignVarIndex, 1); - if (!$tokens[$nextIndex]->isWhitespace()) { - $tokens->insertAt($nextIndex, new Token([T_WHITESPACE, ' '])); - ++$inserted; - } - - return $inserted; - } - - private function clearIfSave(Tokens $tokens, int $index): void - { - if ($tokens[$index]->isComment()) { - return; - } - - if ($tokens[$index]->isWhitespace() && $tokens[$tokens->getPrevNonWhitespace($index)]->isComment()) { - return; - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - - /** - * @param int $index open brace index - * - * @return null|int index of the first token of a definition (lambda, anonymous class or match) or `null` if not an anonymous - */ - private function isCloseBracePartOfDefinition(Tokens $tokens, int $index): ?int - { - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - $candidateIndex = $this->isOpenBraceOfLambda($tokens, $index); - - if (null !== $candidateIndex) { - return $candidateIndex; - } - - $candidateIndex = $this->isOpenBraceOfAnonymousClass($tokens, $index); - - return $candidateIndex ?? $this->isOpenBraceOfMatch($tokens, $index); - } - - /** - * @param int $index open brace index - * - * @return null|int index of T_NEW of anonymous class or `null` if not an anonymous - */ - private function isOpenBraceOfAnonymousClass(Tokens $tokens, int $index): ?int - { - do { - $index = $tokens->getPrevMeaningfulToken($index); - } while ($tokens[$index]->equalsAny([',', [T_STRING], [T_IMPLEMENTS], [T_EXTENDS], [T_NS_SEPARATOR]])); - - if ($tokens[$index]->equals(')')) { // skip constructor braces and content within - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $index = $tokens->getPrevMeaningfulToken($index); - } - - if (!$tokens[$index]->isGivenKind(T_CLASS) || !$this->tokensAnalyzer->isAnonymousClass($index)) { - return null; - } - - return $tokens->getPrevTokenOfKind($index, [[T_NEW]]); - } - - /** - * @param int $index open brace index - * - * @return null|int index of T_FUNCTION or T_STATIC of lambda or `null` if not a lambda - */ - private function isOpenBraceOfLambda(Tokens $tokens, int $index): ?int - { - $index = $tokens->getPrevMeaningfulToken($index); - - if (!$tokens[$index]->equals(')')) { - return null; - } - - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $index = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$index]->isGivenKind(CT::T_USE_LAMBDA)) { - $index = $tokens->getPrevTokenOfKind($index, [')']); - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $index = $tokens->getPrevMeaningfulToken($index); - } - - if ($tokens[$index]->isGivenKind(CT::T_RETURN_REF)) { - $index = $tokens->getPrevMeaningfulToken($index); - } - - if (!$tokens[$index]->isGivenKind(T_FUNCTION)) { - return null; - } - - $staticCandidate = $tokens->getPrevMeaningfulToken($index); - - return $tokens[$staticCandidate]->isGivenKind(T_STATIC) ? $staticCandidate : $index; - } - - /** - * @param int $index open brace index - * - * @return null|int index of T_MATCH or `null` if not a `match` - */ - private function isOpenBraceOfMatch(Tokens $tokens, int $index): ?int - { - if (!\defined('T_MATCH') || !$tokens->isTokenKindFound(T_MATCH)) { // @TODO: drop condition when PHP 8.0+ is required - return null; - } - - $index = $tokens->getPrevMeaningfulToken($index); - - if (!$tokens[$index]->equals(')')) { - return null; - } - - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $index = $tokens->getPrevMeaningfulToken($index); - - return $tokens[$index]->isGivenKind(T_MATCH) ? $index : null; - } - - private function isUsedInCatchOrFinally(Tokens $tokens, int $returnVarIndex, int $functionOpenIndex, int $functionCloseIndex): bool - { - // Find try - $tryIndex = $tokens->getPrevTokenOfKind($returnVarIndex, [[T_TRY]]); - if (null === $tryIndex || $tryIndex <= $functionOpenIndex) { - return false; - } - $tryOpenIndex = $tokens->getNextTokenOfKind($tryIndex, ['{']); - $tryCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $tryOpenIndex); - - // Find catch or finally - $nextIndex = $tokens->getNextMeaningfulToken($tryCloseIndex); - if (null === $nextIndex) { - return false; - } - - // Find catches - while ($tokens[$nextIndex]->isGivenKind(T_CATCH)) { - $catchOpenIndex = $tokens->getNextTokenOfKind($nextIndex, ['{']); - $catchCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $catchOpenIndex); - - if ($catchCloseIndex >= $functionCloseIndex) { - return false; - } - $varIndex = $tokens->getNextTokenOfKind($catchOpenIndex, [$tokens[$returnVarIndex]]); - // Check if the variable is used in the finally block - if (null !== $varIndex && $varIndex < $catchCloseIndex) { - return true; - } - - $nextIndex = $tokens->getNextMeaningfulToken($catchCloseIndex); - if (null === $nextIndex) { - return false; - } - } - - if (!$tokens[$nextIndex]->isGivenKind(T_FINALLY)) { - return false; - } - - $finallyIndex = $nextIndex; - if ($finallyIndex >= $functionCloseIndex) { - return false; - } - $finallyOpenIndex = $tokens->getNextTokenOfKind($finallyIndex, ['{']); - $finallyCloseIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $finallyOpenIndex); - $varIndex = $tokens->getNextTokenOfKind($finallyOpenIndex, [$tokens[$returnVarIndex]]); - // Check if the variable is used in the finally block - if (null !== $varIndex && $varIndex < $finallyCloseIndex) { - return true; - } - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/SimplifiedNullReturnFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/SimplifiedNullReturnFixer.php deleted file mode 100644 index 38d13393..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/ReturnNotation/SimplifiedNullReturnFixer.php +++ /dev/null @@ -1,171 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\ReturnNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Graham Campbell - */ -final class SimplifiedNullReturnFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'A return statement wishing to return `void` should not return `null`.', - [ - new CodeSample("isTokenKindFound(T_RETURN); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_RETURN)) { - continue; - } - - if ($this->needFixing($tokens, $index)) { - $this->clear($tokens, $index); - } - } - } - - /** - * Clear the return statement located at a given index. - */ - private function clear(Tokens $tokens, int $index): void - { - while (!$tokens[++$index]->equalsAny([';', [T_CLOSE_TAG]])) { - if ($this->shouldClearToken($tokens, $index)) { - $tokens->clearAt($index); - } - } - } - - /** - * Does the return statement located at a given index need fixing? - */ - private function needFixing(Tokens $tokens, int $index): bool - { - if ($this->isStrictOrNullableReturnTypeFunction($tokens, $index)) { - return false; - } - - $content = ''; - while (!$tokens[$index]->equalsAny([';', [T_CLOSE_TAG]])) { - $index = $tokens->getNextMeaningfulToken($index); - $content .= $tokens[$index]->getContent(); - } - - $lastTokenContent = $tokens[$index]->getContent(); - $content = substr($content, 0, -\strlen($lastTokenContent)); - - $content = ltrim($content, '('); - $content = rtrim($content, ')'); - - return 'null' === strtolower($content); - } - - /** - * Is the return within a function with a non-void or nullable return type? - * - * @param int $returnIndex Current return token index - */ - private function isStrictOrNullableReturnTypeFunction(Tokens $tokens, int $returnIndex): bool - { - $functionIndex = $returnIndex; - do { - $functionIndex = $tokens->getPrevTokenOfKind($functionIndex, [[T_FUNCTION]]); - if (null === $functionIndex) { - return false; - } - $openingCurlyBraceIndex = $tokens->getNextTokenOfKind($functionIndex, ['{']); - $closingCurlyBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $openingCurlyBraceIndex); - } while ($closingCurlyBraceIndex < $returnIndex); - - $possibleVoidIndex = $tokens->getPrevMeaningfulToken($openingCurlyBraceIndex); - $isStrictReturnType = $tokens[$possibleVoidIndex]->isGivenKind([T_STRING, CT::T_ARRAY_TYPEHINT]) - && 'void' !== $tokens[$possibleVoidIndex]->getContent(); - - $nullableTypeIndex = $tokens->getNextTokenOfKind($functionIndex, [[CT::T_NULLABLE_TYPE]]); - $isNullableReturnType = null !== $nullableTypeIndex && $nullableTypeIndex < $openingCurlyBraceIndex; - - return $isStrictReturnType || $isNullableReturnType; - } - - /** - * Should we clear the specific token? - * - * We'll leave it alone if - * - token is a comment - * - token is whitespace that is immediately before a comment - * - token is whitespace that is immediately before the PHP close tag - * - token is whitespace that is immediately after a comment and before a semicolon - */ - private function shouldClearToken(Tokens $tokens, int $index): bool - { - $token = $tokens[$index]; - - if ($token->isComment()) { - return false; - } - - if (!$token->isWhitespace()) { - return true; - } - - if ( - $tokens[$index + 1]->isComment() - || $tokens[$index + 1]->equals([T_CLOSE_TAG]) - || ($tokens[$index - 1]->isComment() && $tokens[$index + 1]->equals(';')) - ) { - return false; - } - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php deleted file mode 100644 index 7931fda0..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php +++ /dev/null @@ -1,244 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Semicolon; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Graham Campbell - * @author Egidijus Girčys - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * strategy?: 'new_line_for_chained_calls'|'no_multi_line' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * strategy: 'new_line_for_chained_calls'|'no_multi_line' - * } - */ -final class MultilineWhitespaceBeforeSemicolonsFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @internal - */ - public const STRATEGY_NO_MULTI_LINE = 'no_multi_line'; - - /** - * @internal - */ - public const STRATEGY_NEW_LINE_FOR_CHAINED_CALLS = 'new_line_for_chained_calls'; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Forbid multi-line whitespace before the closing semicolon or move the semicolon to the new line for chained calls.', - [ - new CodeSample( - 'method1() - ->method2() - ->method(3); -', - ['strategy' => self::STRATEGY_NEW_LINE_FOR_CHAINED_CALLS] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before SpaceAfterSemicolonFixer. - * Must run after CombineConsecutiveIssetsFixer, GetClassToClassKeywordFixer, NoEmptyStatementFixer, SimplifiedIfReturnFixer, SingleImportPerStatementFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(';'); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder( - 'strategy', - 'Forbid multi-line whitespace or move the semicolon to the new line for chained calls.' - )) - ->setAllowedValues([self::STRATEGY_NO_MULTI_LINE, self::STRATEGY_NEW_LINE_FOR_CHAINED_CALLS]) - ->setDefault(self::STRATEGY_NO_MULTI_LINE) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - - for ($index = 0, $count = \count($tokens); $index < $count; ++$index) { - if (!$tokens[$index]->equals(';')) { - continue; - } - - $previousIndex = $index - 1; - $previous = $tokens[$previousIndex]; - - $indent = $this->findWhitespaceBeforeFirstCall($index, $tokens); - if (self::STRATEGY_NEW_LINE_FOR_CHAINED_CALLS === $this->configuration['strategy'] && null !== $indent) { - if ($previous->isWhitespace() && $previous->getContent() === $lineEnding.$indent) { - continue; - } - - // unset whitespace and semicolon - if ($previous->isWhitespace()) { - $tokens->clearAt($previousIndex); - } - $tokens->clearAt($index); - - // find the line ending token index after the semicolon - $index = $this->getNewLineIndex($index, $tokens); - - // appended new line to the last method call - $newline = new Token([T_WHITESPACE, $lineEnding.$indent]); - - // insert the new line with indented semicolon - $tokens->insertAt($index++, [$newline, new Token(';')]); - } else { - if (!$previous->isWhitespace() || !str_contains($previous->getContent(), "\n")) { - continue; - } - - $content = $previous->getContent(); - if (str_starts_with($content, $lineEnding) && $tokens[$index - 2]->isComment()) { - // if there is comment between closing parenthesis and semicolon - - // unset whitespace and semicolon - $tokens->clearAt($previousIndex); - $tokens->clearAt($index); - - // find the significant token index before the semicolon - $significantTokenIndex = $this->getPreviousSignificantTokenIndex($index, $tokens); - - // insert the semicolon - $tokens->insertAt($significantTokenIndex + 1, [new Token(';')]); - } else { - // if there is whitespace between closing bracket and semicolon, just remove it - $tokens->clearAt($previousIndex); - } - } - } - } - - /** - * Find the index for the next new line. Return the given index when there's no new line. - */ - private function getNewLineIndex(int $index, Tokens $tokens): int - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - - for ($index, $count = \count($tokens); $index < $count; ++$index) { - if (!$tokens[$index]->isWhitespace() && !$tokens[$index]->isComment()) { - break; - } - if (false !== strstr($tokens[$index]->getContent(), $lineEnding)) { - return $index; - } - } - - return $index; - } - - /** - * Find the index for the previous significant token. Return the given index when there's no significant token. - */ - private function getPreviousSignificantTokenIndex(int $index, Tokens $tokens): int - { - $stopTokens = [ - T_LNUMBER, - T_DNUMBER, - T_STRING, - T_VARIABLE, - T_CONSTANT_ENCAPSED_STRING, - ]; - for ($index; $index > 0; --$index) { - if ($tokens[$index]->isGivenKind($stopTokens) || $tokens[$index]->equals(')')) { - return $index; - } - } - - return $index; - } - - /** - * Checks if the semicolon closes a multiline call and returns the whitespace of the first call at $index. - * i.e. it will return the whitespace marked with '____' in the example underneath. - * - * .. - * ____$this->methodCall() - * ->anotherCall(); - * .. - */ - private function findWhitespaceBeforeFirstCall(int $index, Tokens $tokens): ?string - { - $isMultilineCall = false; - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - while (!$tokens[$prevIndex]->equalsAny([';', ':', '{', '}', [T_OPEN_TAG], [T_OPEN_TAG_WITH_ECHO], [T_ELSE]])) { - $index = $prevIndex; - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - $blockType = Tokens::detectBlockType($tokens[$index]); - if (null !== $blockType && !$blockType['isStart']) { - $prevIndex = $tokens->findBlockStart($blockType['type'], $index); - - continue; - } - - if ($tokens[$index]->isObjectOperator() || $tokens[$index]->isGivenKind(T_DOUBLE_COLON)) { - $prevIndex = $tokens->getPrevMeaningfulToken($index); - $isMultilineCall = $isMultilineCall || $tokens->isPartialCodeMultiline($prevIndex, $index); - } - } - - return $isMultilineCall ? WhitespacesAnalyzer::detectIndent($tokens, $index) : null; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoEmptyStatementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoEmptyStatementFixer.php deleted file mode 100644 index 15c1e670..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoEmptyStatementFixer.php +++ /dev/null @@ -1,186 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Semicolon; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Dariusz Rumiński - */ -final class NoEmptyStatementFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Remove useless (semicolon) statements.', - [ - new CodeSample("isTokenKindFound(';'); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = 0, $count = $tokens->count(); $index < $count; ++$index) { - if ($tokens[$index]->isGivenKind([T_BREAK, T_CONTINUE])) { - $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->equals([T_LNUMBER, '1'])) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - - continue; - } - - // skip T_FOR parenthesis to ignore double `;` like `for ($i = 1; ; ++$i) {...}` - if ($tokens[$index]->isGivenKind(T_FOR)) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $tokens->getNextMeaningfulToken($index)) + 1; - - continue; - } - - if (!$tokens[$index]->equals(';')) { - continue; - } - - $previousMeaningfulIndex = $tokens->getPrevMeaningfulToken($index); - - // A semicolon can always be removed if it follows a semicolon, '{' or opening tag. - if ($tokens[$previousMeaningfulIndex]->equalsAny(['{', ';', [T_OPEN_TAG]])) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - - continue; - } - - // A semicolon might be removed if it follows a '}' but only if the brace is part of certain structures. - if ($tokens[$previousMeaningfulIndex]->equals('}')) { - $this->fixSemicolonAfterCurlyBraceClose($tokens, $index, $previousMeaningfulIndex); - - continue; - } - - // A semicolon might be removed together with its noop statement, for example "getPrevMeaningfulToken($previousMeaningfulIndex); - - if ( - $tokens[$prePreviousMeaningfulIndex]->equalsAny([';', '{', '}', [T_OPEN_TAG]]) - && $tokens[$previousMeaningfulIndex]->isGivenKind([T_CONSTANT_ENCAPSED_STRING, T_DNUMBER, T_LNUMBER, T_STRING, T_VARIABLE]) - ) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - $tokens->clearTokenAndMergeSurroundingWhitespace($previousMeaningfulIndex); - } - } - } - - /** - * Fix semicolon after closing curly brace if needed. - * - * Test for the following cases - * - just '{' '}' block (following open tag or ';') - * - if, else, elseif - * - interface, trait, class (but not anonymous) - * - catch, finally (but not try) - * - for, foreach, while (but not 'do - while') - * - switch - * - function (declaration, but not lambda) - * - declare (with '{' '}') - * - namespace (with '{' '}') - * - * @param int $index Semicolon index - */ - private function fixSemicolonAfterCurlyBraceClose(Tokens $tokens, int $index, int $curlyCloseIndex): void - { - static $beforeCurlyOpeningKinds = null; - - if (null === $beforeCurlyOpeningKinds) { - $beforeCurlyOpeningKinds = [T_ELSE, T_FINALLY, T_NAMESPACE, T_OPEN_TAG]; - } - - $curlyOpeningIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $curlyCloseIndex); - $beforeCurlyOpeningIndex = $tokens->getPrevMeaningfulToken($curlyOpeningIndex); - - if ($tokens[$beforeCurlyOpeningIndex]->isGivenKind($beforeCurlyOpeningKinds) || $tokens[$beforeCurlyOpeningIndex]->equalsAny([';', '{', '}'])) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - - return; - } - - // check for namespaces and class, interface and trait definitions - if ($tokens[$beforeCurlyOpeningIndex]->isGivenKind(T_STRING)) { - $classyTestIndex = $tokens->getPrevMeaningfulToken($beforeCurlyOpeningIndex); - - while ($tokens[$classyTestIndex]->equals(',') || $tokens[$classyTestIndex]->isGivenKind([T_STRING, T_NS_SEPARATOR, T_EXTENDS, T_IMPLEMENTS])) { - $classyTestIndex = $tokens->getPrevMeaningfulToken($classyTestIndex); - } - - $tokensAnalyzer = new TokensAnalyzer($tokens); - - if ( - $tokens[$classyTestIndex]->isGivenKind(T_NAMESPACE) - || ($tokens[$classyTestIndex]->isClassy() && !$tokensAnalyzer->isAnonymousClass($classyTestIndex)) - ) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - } - - return; - } - - // early return check, below only control structures with conditions are fixed - if (!$tokens[$beforeCurlyOpeningIndex]->equals(')')) { - return; - } - - $openingBraceIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $beforeCurlyOpeningIndex); - $beforeOpeningBraceIndex = $tokens->getPrevMeaningfulToken($openingBraceIndex); - - if ($tokens[$beforeOpeningBraceIndex]->isGivenKind([T_IF, T_ELSEIF, T_FOR, T_FOREACH, T_WHILE, T_SWITCH, T_CATCH, T_DECLARE])) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); - - return; - } - - // check for function definition - if ($tokens[$beforeOpeningBraceIndex]->isGivenKind(T_STRING)) { - $beforeStringIndex = $tokens->getPrevMeaningfulToken($beforeOpeningBraceIndex); - - if ($tokens[$beforeStringIndex]->isGivenKind(T_FUNCTION)) { - $tokens->clearTokenAndMergeSurroundingWhitespace($index); // implicit return - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixer.php deleted file mode 100644 index f06d9d73..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixer.php +++ /dev/null @@ -1,66 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Semicolon; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Graham Campbell - */ -final class NoSinglelineWhitespaceBeforeSemicolonsFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Single-line whitespace before closing semicolon are prohibited.', - [new CodeSample("foo() ;\n")] - ); - } - - /** - * {@inheritdoc} - * - * Must run after CombineConsecutiveIssetsFixer, FunctionToConstantFixer, LongToShorthandOperatorFixer, NoEmptyStatementFixer, NoUnneededImportAliasFixer, SimplifiedIfReturnFixer, SingleImportPerStatementFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(';'); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->equals(';') || !$tokens[$index - 1]->isWhitespace(" \t")) { - continue; - } - - if ($tokens[$index - 2]->equals(';')) { - // do not remove all whitespace before the semicolon because it is also whitespace after another semicolon - $tokens->ensureWhitespaceAtIndex($index - 1, 0, ' '); - } elseif (!$tokens[$index - 2]->isComment()) { - $tokens->clearAt($index - 1); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SemicolonAfterInstructionFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SemicolonAfterInstructionFixer.php deleted file mode 100644 index 2fe9ab07..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SemicolonAfterInstructionFixer.php +++ /dev/null @@ -1,64 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Semicolon; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class SemicolonAfterInstructionFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Instructions must be terminated with a semicolon.', - [new CodeSample("\n")] - ); - } - - /** - * {@inheritdoc} - * - * Must run before SimplifiedIfReturnFixer. - */ - public function getPriority(): int - { - return 2; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_CLOSE_TAG); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 1; $index > 1; --$index) { - if (!$tokens[$index]->isGivenKind(T_CLOSE_TAG)) { - continue; - } - - $prev = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$prev]->equalsAny([';', '{', '}', ':', [T_OPEN_TAG]])) { - continue; - } - - $tokens->insertAt($prev + 1, new Token(';')); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SpaceAfterSemicolonFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SpaceAfterSemicolonFixer.php deleted file mode 100644 index f8e4084e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/SpaceAfterSemicolonFixer.php +++ /dev/null @@ -1,148 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Semicolon; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * remove_in_empty_for_expressions?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * remove_in_empty_for_expressions: bool - * } - */ -final class SpaceAfterSemicolonFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Fix whitespace after a semicolon.', - [ - new CodeSample( - " true, - ]), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after CombineConsecutiveUnsetsFixer, MultilineWhitespaceBeforeSemicolonsFixer, NoEmptyStatementFixer, OrderedClassElementsFixer, SingleImportPerStatementFixer, SingleTraitInsertPerStatementFixer. - */ - public function getPriority(): int - { - return -1; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(';'); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('remove_in_empty_for_expressions', 'Whether spaces should be removed for empty `for` expressions.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $insideForParenthesesUntil = null; - - for ($index = 0, $max = \count($tokens) - 1; $index < $max; ++$index) { - if (true === $this->configuration['remove_in_empty_for_expressions']) { - if ($tokens[$index]->isGivenKind(T_FOR)) { - $index = $tokens->getNextMeaningfulToken($index); - $insideForParenthesesUntil = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - - continue; - } - - if ($index === $insideForParenthesesUntil) { - $insideForParenthesesUntil = null; - - continue; - } - } - - if (!$tokens[$index]->equals(';')) { - continue; - } - - if (!$tokens[$index + 1]->isWhitespace()) { - if ( - !$tokens[$index + 1]->equalsAny([')', [T_INLINE_HTML]]) && ( - false === $this->configuration['remove_in_empty_for_expressions'] - || !$tokens[$index + 1]->equals(';') - ) - ) { - $tokens->insertAt($index + 1, new Token([T_WHITESPACE, ' '])); - ++$max; - } - - continue; - } - - if ( - null !== $insideForParenthesesUntil - && ($tokens[$index + 2]->equals(';') || $index + 2 === $insideForParenthesesUntil) - && !Preg::match('/\R/', $tokens[$index + 1]->getContent()) - ) { - $tokens->clearAt($index + 1); - - continue; - } - - if ( - isset($tokens[$index + 2]) - && !$tokens[$index + 1]->equals([T_WHITESPACE, ' ']) - && $tokens[$index + 1]->isWhitespace(" \t") - && !$tokens[$index + 2]->isComment() - && !$tokens[$index + 2]->equals(')') - ) { - $tokens[$index + 1] = new Token([T_WHITESPACE, ' ']); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/DeclareStrictTypesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/DeclareStrictTypesFixer.php deleted file mode 100644 index b0ff7180..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/DeclareStrictTypesFixer.php +++ /dev/null @@ -1,132 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Strict; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Jordi Boggiano - */ -final class DeclareStrictTypesFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Force strict types declaration in all files.', - [ - new CodeSample( - "isMonolithicPhp() && !$tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $openTagIndex = $tokens[0]->isGivenKind(T_INLINE_HTML) ? 1 : 0; - - $sequenceLocation = $tokens->findSequence([[T_DECLARE, 'declare'], '(', [T_STRING, 'strict_types'], '=', [T_LNUMBER], ')'], $openTagIndex, null, false); - if (null === $sequenceLocation) { - $this->insertSequence($openTagIndex, $tokens); // declaration not found, insert one - - return; - } - - $this->fixStrictTypesCasingAndValue($tokens, $sequenceLocation); - } - - /** - * @param array $sequence - */ - private function fixStrictTypesCasingAndValue(Tokens $tokens, array $sequence): void - { - /** @var int $index */ - /** @var Token $token */ - foreach ($sequence as $index => $token) { - if ($token->isGivenKind(T_STRING)) { - $tokens[$index] = new Token([T_STRING, strtolower($token->getContent())]); - - continue; - } - if ($token->isGivenKind(T_LNUMBER)) { - $tokens[$index] = new Token([T_LNUMBER, '1']); - - break; - } - } - } - - private function insertSequence(int $openTagIndex, Tokens $tokens): void - { - $sequence = [ - new Token([T_DECLARE, 'declare']), - new Token('('), - new Token([T_STRING, 'strict_types']), - new Token('='), - new Token([T_LNUMBER, '1']), - new Token(')'), - new Token(';'), - ]; - $nextIndex = $openTagIndex + \count($sequence) + 1; - - $tokens->insertAt($openTagIndex + 1, $sequence); - - // transform "getContent(); - if (!str_contains($content, ' ') || str_contains($content, "\n")) { - $tokens[$openTagIndex] = new Token([$tokens[$openTagIndex]->getId(), trim($tokens[$openTagIndex]->getContent()).' ']); - } - - if (\count($tokens) === $nextIndex) { - return; // no more tokens after sequence, single_blank_line_at_eof might add a line - } - - $lineEnding = $this->whitespacesConfig->getLineEnding(); - if ($tokens[$nextIndex]->isWhitespace()) { - $content = $tokens[$nextIndex]->getContent(); - $tokens[$nextIndex] = new Token([T_WHITESPACE, $lineEnding.ltrim($content, " \t")]); - } else { - $tokens->insertAt($nextIndex, new Token([T_WHITESPACE, $lineEnding])); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictComparisonFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictComparisonFixer.php deleted file mode 100644 index 18222c59..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictComparisonFixer.php +++ /dev/null @@ -1,80 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Strict; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - */ -final class StrictComparisonFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Comparisons should be strict.', - [new CodeSample("isAnyTokenKindsFound([T_IS_EQUAL, T_IS_NOT_EQUAL]); - } - - public function isRisky(): bool - { - return true; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - static $map = [ - T_IS_EQUAL => [ - 'id' => T_IS_IDENTICAL, - 'content' => '===', - ], - T_IS_NOT_EQUAL => [ - 'id' => T_IS_NOT_IDENTICAL, - 'content' => '!==', - ], - ]; - - foreach ($tokens as $index => $token) { - $tokenId = $token->getId(); - - if (isset($map[$tokenId])) { - $tokens[$index] = new Token([$map[$tokenId]['id'], $map[$tokenId]['content']]); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictParamFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictParamFixer.php deleted file mode 100644 index e0f12f33..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictParamFixer.php +++ /dev/null @@ -1,168 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Strict; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - */ -final class StrictParamFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Functions should be used with `$strict` param set to `true`.', - [new CodeSample("isTokenKindFound(T_STRING); - } - - public function isRisky(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * Must run before MethodArgumentSpaceFixer, NativeFunctionInvocationFixer. - */ - public function getPriority(): int - { - return 31; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - static $map = null; - - if (null === $map) { - $trueToken = new Token([T_STRING, 'true']); - - $map = [ - 'array_keys' => [null, null, $trueToken], - 'array_search' => [null, null, $trueToken], - 'base64_decode' => [null, $trueToken], - 'in_array' => [null, null, $trueToken], - 'mb_detect_encoding' => [null, [new Token([T_STRING, 'mb_detect_order']), new Token('('), new Token(')')], $trueToken], - ]; - } - - for ($index = $tokens->count() - 1; 0 <= $index; --$index) { - $token = $tokens[$index]; - - $nextIndex = $tokens->getNextMeaningfulToken($index); - if (null !== $nextIndex && !$tokens[$nextIndex]->equals('(')) { - continue; - } - - $lowercaseContent = strtolower($token->getContent()); - if (isset($map[$lowercaseContent]) && $functionsAnalyzer->isGlobalFunctionCall($tokens, $index)) { - $this->fixFunction($tokens, $index, $map[$lowercaseContent]); - } - } - } - - /** - * @param list $functionParams - */ - private function fixFunction(Tokens $tokens, int $functionIndex, array $functionParams): void - { - $startBraceIndex = $tokens->getNextTokenOfKind($functionIndex, ['(']); - $endBraceIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $startBraceIndex); - $paramsQuantity = 0; - $expectParam = true; - - for ($index = $startBraceIndex + 1; $index < $endBraceIndex; ++$index) { - $token = $tokens[$index]; - - if ($expectParam && !$token->isWhitespace() && !$token->isComment()) { - ++$paramsQuantity; - $expectParam = false; - } - - if ($token->equals('(')) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - - continue; - } - - if ($token->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $index); - - continue; - } - - if ($token->equals(',')) { - $expectParam = true; - - continue; - } - } - - $functionParamsQuantity = \count($functionParams); - - if ($paramsQuantity === $functionParamsQuantity) { - return; - } - - $tokensToInsert = []; - - for ($i = $paramsQuantity; $i < $functionParamsQuantity; ++$i) { - // function call do not have all params that are required to set useStrict flag, exit from method! - if (null === $functionParams[$i]) { - return; - } - - $tokensToInsert[] = new Token(','); - $tokensToInsert[] = new Token([T_WHITESPACE, ' ']); - - if (!\is_array($functionParams[$i])) { - $tokensToInsert[] = clone $functionParams[$i]; - - continue; - } - - foreach ($functionParams[$i] as $param) { - $tokensToInsert[] = clone $param; - } - } - - $beforeEndBraceIndex = $tokens->getPrevMeaningfulToken($endBraceIndex); - - if ($tokens[$beforeEndBraceIndex]->equals(',')) { - array_shift($tokensToInsert); - $tokensToInsert[] = new Token(','); - } - - $tokens->insertAt($beforeEndBraceIndex + 1, $tokensToInsert); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/EscapeImplicitBackslashesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/EscapeImplicitBackslashesFixer.php deleted file mode 100644 index 03a2e682..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/EscapeImplicitBackslashesFixer.php +++ /dev/null @@ -1,153 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @author Filippo Tessarotto - * @author Michael Vorisek - * - * @deprecated Use `string_implicit_backslashes` with config: ['single_quoted' => 'ignore', 'double_quoted' => 'escape', 'heredoc' => 'escape'] (default) - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * double_quoted?: bool, - * heredoc_syntax?: bool, - * single_quoted?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * double_quoted: bool, - * heredoc_syntax: bool, - * single_quoted: bool - * } - */ -final class EscapeImplicitBackslashesFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getSuccessorsNames(): array - { - return array_keys($this->proxyFixers); - } - - public function getDefinition(): FixerDefinitionInterface - { - $codeSample = <<<'EOF' - true] - ), - new CodeSample( - $codeSample, - ['double_quoted' => false] - ), - new CodeSample( - $codeSample, - ['heredoc_syntax' => false] - ), - ], - 'In PHP double-quoted strings and heredocs some chars like `n`, `$` or `u` have special meanings if preceded by a backslash ' - .'(and some are special only if followed by other special chars), while a backslash preceding other chars are interpreted like a plain ' - .'backslash. The precise list of those special chars is hard to remember and to identify quickly: this fixer escapes backslashes ' - ."that do not start a special interpretation with the char after them.\n" - .'It is possible to fix also single-quoted strings: in this case there is no special chars apart from single-quote and backslash ' - .'itself, so the fixer simply ensure that all backslashes are escaped. Both single and double backslashes are allowed in single-quoted ' - .'strings, so the purpose in this context is mainly to have a uniformed way to have them written all over the codebase.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before HeredocToNowdocFixer, SingleQuoteFixer. - * Must run after MultilineStringToHeredocFixer. - */ - public function getPriority(): int - { - return parent::getPriority(); - } - - protected function configurePostNormalisation(): void - { - /** @var StringImplicitBackslashesFixer */ - $stringImplicitBackslashesFixer = $this->proxyFixers['string_implicit_backslashes']; - - $stringImplicitBackslashesFixer->configure([ - 'single_quoted' => true === $this->configuration['single_quoted'] ? 'escape' : 'ignore', - 'double_quoted' => true === $this->configuration['double_quoted'] ? 'escape' : 'ignore', - 'heredoc' => true === $this->configuration['heredoc_syntax'] ? 'escape' : 'ignore', - ]); - } - - protected function createProxyFixers(): array - { - $stringImplicitBackslashesFixer = new StringImplicitBackslashesFixer(); - $stringImplicitBackslashesFixer->configure([ - 'single_quoted' => 'ignore', - 'double_quoted' => 'escape', - 'heredoc' => 'escape', - ]); - - return [ - $stringImplicitBackslashesFixer, - ]; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('single_quoted', 'Whether to fix single-quoted strings.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - (new FixerOptionBuilder('double_quoted', 'Whether to fix double-quoted strings.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - (new FixerOptionBuilder('heredoc_syntax', 'Whether to fix heredoc syntax.')) - ->setAllowedTypes(['bool']) - ->setDefault(true) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/ExplicitStringVariableFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/ExplicitStringVariableFixer.php deleted file mode 100644 index 1671940c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/ExplicitStringVariableFixer.php +++ /dev/null @@ -1,166 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - */ -final class ExplicitStringVariableFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Converts implicit variables into explicit ones in double-quoted strings or heredoc syntax.', - [new CodeSample( - <<<'EOT' - country !"; - $c = "I have $farm[0] chickens !"; - - EOT - )], - 'The reasoning behind this rule is the following:' - ."\n".'- When there are two valid ways of doing the same thing, using both is confusing, there should be a coding standard to follow.' - ."\n".'- PHP manual marks `"$var"` syntax as implicit and `"{$var}"` syntax as explicit: explicit code should always be preferred.' - ."\n".'- Explicit syntax allows word concatenation inside strings, e.g. `"{$var}IsAVar"`, implicit doesn\'t.' - ."\n".'- Explicit syntax is easier to detect for IDE/editors and therefore has colors/highlight with higher contrast, which is easier to read.' - ."\n".'Backtick operator is skipped because it is harder to handle; you can use `backtick_to_shell_exec` fixer to normalize backticks to strings.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoUselessConcatOperatorFixer. - * Must run after BacktickToShellExecFixer. - */ - public function getPriority(): int - { - return 6; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_VARIABLE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $backtickStarted = false; - for ($index = \count($tokens) - 1; $index > 0; --$index) { - $token = $tokens[$index]; - - if ($token->equals('`')) { - $backtickStarted = !$backtickStarted; - - continue; - } - - if ($backtickStarted || !$token->isGivenKind(T_VARIABLE)) { - continue; - } - - $prevToken = $tokens[$index - 1]; - - if (!$this->isStringPartToken($prevToken)) { - continue; - } - - $distinctVariableIndex = $index; - $variableTokens = [ - $distinctVariableIndex => [ - 'tokens' => [$index => $token], - 'firstVariableTokenIndex' => $index, - 'lastVariableTokenIndex' => $index, - ], - ]; - - $nextIndex = $index + 1; - $squareBracketCount = 0; - - while (!$this->isStringPartToken($tokens[$nextIndex])) { - if ($tokens[$nextIndex]->isGivenKind(T_CURLY_OPEN)) { - $nextIndex = $tokens->getNextTokenOfKind($nextIndex, [[CT::T_CURLY_CLOSE]]); - } elseif ($tokens[$nextIndex]->isGivenKind(T_VARIABLE) && 1 !== $squareBracketCount) { - $distinctVariableIndex = $nextIndex; - $variableTokens[$distinctVariableIndex] = [ - 'tokens' => [$nextIndex => $tokens[$nextIndex]], - 'firstVariableTokenIndex' => $nextIndex, - 'lastVariableTokenIndex' => $nextIndex, - ]; - } else { - $variableTokens[$distinctVariableIndex]['tokens'][$nextIndex] = $tokens[$nextIndex]; - $variableTokens[$distinctVariableIndex]['lastVariableTokenIndex'] = $nextIndex; - - if ($tokens[$nextIndex]->equalsAny(['[', ']'])) { - ++$squareBracketCount; - } - } - - ++$nextIndex; - } - krsort($variableTokens, SORT_NUMERIC); - - foreach ($variableTokens as $distinctVariableSet) { - if (1 === \count($distinctVariableSet['tokens'])) { - $singleVariableIndex = array_key_first($distinctVariableSet['tokens']); - $singleVariableToken = current($distinctVariableSet['tokens']); - $tokens->overrideRange($singleVariableIndex, $singleVariableIndex, [ - new Token([T_CURLY_OPEN, '{']), - new Token([T_VARIABLE, $singleVariableToken->getContent()]), - new Token([CT::T_CURLY_CLOSE, '}']), - ]); - } else { - foreach ($distinctVariableSet['tokens'] as $variablePartIndex => $variablePartToken) { - if ($variablePartToken->isGivenKind(T_NUM_STRING)) { - $tokens[$variablePartIndex] = new Token([T_LNUMBER, $variablePartToken->getContent()]); - - continue; - } - - if ($variablePartToken->isGivenKind(T_STRING) && $tokens[$variablePartIndex + 1]->equals(']')) { - $tokens[$variablePartIndex] = new Token([T_CONSTANT_ENCAPSED_STRING, "'".$variablePartToken->getContent()."'"]); - } - } - - $tokens->insertAt($distinctVariableSet['lastVariableTokenIndex'] + 1, new Token([CT::T_CURLY_CLOSE, '}'])); - $tokens->insertAt($distinctVariableSet['firstVariableTokenIndex'], new Token([T_CURLY_OPEN, '{'])); - } - } - } - } - - /** - * Check if token is a part of a string. - * - * @param Token $token The token to check - */ - private function isStringPartToken(Token $token): bool - { - return $token->isGivenKind(T_ENCAPSED_AND_WHITESPACE) - || $token->isGivenKind(T_START_HEREDOC) - || '"' === $token->getContent() - || 'b"' === strtolower($token->getContent()); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocClosingMarkerFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocClosingMarkerFixer.php deleted file mode 100644 index dda5025d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocClosingMarkerFixer.php +++ /dev/null @@ -1,205 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Michael Vorisek - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * closing_marker?: string, - * explicit_heredoc_style?: bool, - * reserved_closing_markers?: list - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * closing_marker: string, - * explicit_heredoc_style: bool, - * reserved_closing_markers: list - * } - */ -final class HeredocClosingMarkerFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var list - */ - public const RESERVED_CLOSING_MARKERS = [ - 'CSS', - 'DIFF', - 'HTML', - 'JS', - 'JSON', - 'MD', - 'PHP', - 'PYTHON', - 'RST', - 'TS', - 'SQL', - 'XML', - 'YAML', - ]; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Unify `heredoc` or `nowdoc` closing marker.', - [ - new CodeSample( - <<<'EOD' - 'EOF'] - ), - new CodeSample( - <<<'EOD_' - true] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_START_HEREDOC); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder( - 'closing_marker', - 'Preferred closing marker.' - )) - ->setAllowedTypes(['string']) - ->setDefault('EOD') - ->getOption(), - (new FixerOptionBuilder( - 'reserved_closing_markers', - 'Reserved closing markers to be kept unchanged.' - )) - ->setAllowedTypes(['string[]']) - ->setDefault(self::RESERVED_CLOSING_MARKERS) - ->getOption(), - (new FixerOptionBuilder( - 'explicit_heredoc_style', - 'Whether the closing marker should be wrapped in double quotes.' - )) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $reservedClosingMarkersMap = null; - - $startIndex = null; - foreach ($tokens as $index => $token) { - if ($token->isGivenKind(T_START_HEREDOC)) { - $startIndex = $index; - - continue; - } - - if (null !== $startIndex && $token->isGivenKind(T_END_HEREDOC)) { - $existingClosingMarker = trim($token->getContent()); - - if (null === $reservedClosingMarkersMap) { - $reservedClosingMarkersMap = []; - foreach ($this->configuration['reserved_closing_markers'] as $v) { - $reservedClosingMarkersMap[mb_strtoupper($v)] = $v; - } - } - - $existingClosingMarker = mb_strtoupper($existingClosingMarker); - do { - $newClosingMarker = $reservedClosingMarkersMap[$existingClosingMarker] ?? null; - if (!str_ends_with($existingClosingMarker, '_')) { - break; - } - $existingClosingMarker = substr($existingClosingMarker, 0, -1); - } while (null === $newClosingMarker); - - if (null === $newClosingMarker) { - $newClosingMarker = $this->configuration['closing_marker']; - } - - $content = $tokens->generatePartialCode($startIndex + 1, $index - 1); - while (Preg::match('~(^|[\r\n])\s*'.preg_quote($newClosingMarker, '~').'(?!\w)~', $content)) { - $newClosingMarker .= '_'; - } - - [$tokens[$startIndex], $tokens[$index]] = $this->convertClosingMarker($tokens[$startIndex], $token, $newClosingMarker); - - $startIndex = null; - - continue; - } - } - } - - /** - * @return array{Token, Token} - */ - private function convertClosingMarker(Token $startToken, Token $endToken, string $newClosingMarker): array - { - $isNowdoc = str_contains($startToken->getContent(), '\''); - - $markerQuote = $isNowdoc - ? '\'' - : (true === $this->configuration['explicit_heredoc_style'] ? '"' : ''); - - return [new Token([ - $startToken->getId(), - Preg::replace('/<<<\h*\K["\']?[^\s"\']+["\']?/', $markerQuote.$newClosingMarker.$markerQuote, $startToken->getContent()), - ]), new Token([ - $endToken->getId(), - Preg::replace('/\S+/', $newClosingMarker, $endToken->getContent()), - ])]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocToNowdocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocToNowdocFixer.php deleted file mode 100644 index 9c736c14..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocToNowdocFixer.php +++ /dev/null @@ -1,107 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Gregor Harlan - */ -final class HeredocToNowdocFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Convert `heredoc` to `nowdoc` where possible.', - [ - new CodeSample( - <<<'EOF' - isTokenKindFound(T_START_HEREDOC); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_START_HEREDOC) || str_contains($token->getContent(), "'")) { - continue; - } - - if ($tokens[$index + 1]->isGivenKind(T_END_HEREDOC)) { - $tokens[$index] = $this->convertToNowdoc($token); - - continue; - } - - if ( - !$tokens[$index + 1]->isGivenKind(T_ENCAPSED_AND_WHITESPACE) - || !$tokens[$index + 2]->isGivenKind(T_END_HEREDOC) - ) { - continue; - } - - $content = $tokens[$index + 1]->getContent(); - // regex: odd number of backslashes, not followed by dollar - if (Preg::match('/(?convertToNowdoc($token); - $content = str_replace(['\\\\', '\$'], ['\\', '$'], $content); - $tokens[$index + 1] = new Token([ - $tokens[$index + 1]->getId(), - $content, - ]); - } - } - - /** - * Transforms the heredoc start token to nowdoc notation. - */ - private function convertToNowdoc(Token $token): Token - { - return new Token([ - $token->getId(), - Preg::replace('/^([Bb]?<<<)(\h*)"?([^\s"]+)"?/', '$1$2\'$3\'', $token->getContent()), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/MultilineStringToHeredocFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/MultilineStringToHeredocFixer.php deleted file mode 100644 index 1a6790e6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/MultilineStringToHeredocFixer.php +++ /dev/null @@ -1,166 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Michael Vorisek - */ -final class MultilineStringToHeredocFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Convert multiline string to `heredoc` or `nowdoc`.', - [ - new CodeSample( - <<<'EOD' - getName()}"; - EOD."\n" - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE]); - } - - /** - * {@inheritdoc} - * - * Must run before EscapeImplicitBackslashesFixer, HeredocIndentationFixer, StringImplicitBackslashesFixer. - */ - public function getPriority(): int - { - return 16; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $inHeredoc = false; - $complexStringStartIndex = null; - foreach ($tokens as $index => $token) { - if ($token->isGivenKind([T_START_HEREDOC, T_END_HEREDOC])) { - $inHeredoc = $token->isGivenKind(T_START_HEREDOC) || !$token->isGivenKind(T_END_HEREDOC); - - continue; - } - - if (null === $complexStringStartIndex) { - if ($token->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { - $this->convertStringToHeredoc($tokens, $index, $index); - - // skip next 2 added tokens if replaced - if ($tokens[$index]->isGivenKind(T_START_HEREDOC)) { - $inHeredoc = true; - } - } elseif ($token->equalsAny(['"', 'b"', 'B"'])) { - $complexStringStartIndex = $index; - } - } elseif ($token->equals('"')) { - $this->convertStringToHeredoc($tokens, $complexStringStartIndex, $index); - - $complexStringStartIndex = null; - } - } - } - - private function convertStringToHeredoc(Tokens $tokens, int $stringStartIndex, int $stringEndIndex): void - { - $closingMarker = 'EOD'; - - if ($tokens[$stringStartIndex]->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { - $content = $tokens[$stringStartIndex]->getContent(); - if ('b' === strtolower(substr($content, 0, 1))) { - $content = substr($content, 1); - } - $isSingleQuoted = str_starts_with($content, '\''); - $content = substr($content, 1, -1); - - if ($isSingleQuoted) { - $content = Preg::replace('~\\\([\\\\\'])~', '$1', $content); - } else { - $content = Preg::replace('~(\\\\\\\)|\\\(")~', '$1$2', $content); - } - - $constantStringToken = new Token([T_ENCAPSED_AND_WHITESPACE, $content."\n"]); - } else { - $content = $tokens->generatePartialCode($stringStartIndex + 1, $stringEndIndex - 1); - $isSingleQuoted = false; - $constantStringToken = null; - } - - if (!str_contains($content, "\n") && !str_contains($content, "\r")) { - return; - } - - while (Preg::match('~(^|[\r\n])\s*'.preg_quote($closingMarker, '~').'(?!\w)~', $content)) { - $closingMarker .= '_'; - } - - $quoting = $isSingleQuoted ? '\'' : ''; - $heredocStartToken = new Token([T_START_HEREDOC, '<<<'.$quoting.$closingMarker.$quoting."\n"]); - $heredocEndToken = new Token([T_END_HEREDOC, $closingMarker]); - - if (null !== $constantStringToken) { - $tokens->overrideRange($stringStartIndex, $stringEndIndex, [ - $heredocStartToken, - $constantStringToken, - $heredocEndToken, - ]); - } else { - for ($i = $stringStartIndex + 1; $i < $stringEndIndex; ++$i) { - if ($tokens[$i]->isGivenKind(T_ENCAPSED_AND_WHITESPACE)) { - $tokens[$i] = new Token([ - $tokens[$i]->getId(), - Preg::replace('~(\\\\\\\)|\\\(")~', '$1$2', $tokens[$i]->getContent()), - ]); - } - } - - $tokens[$stringStartIndex] = $heredocStartToken; - $tokens[$stringEndIndex] = $heredocEndToken; - if ($tokens[$stringEndIndex - 1]->isGivenKind(T_ENCAPSED_AND_WHITESPACE)) { - $tokens[$stringEndIndex - 1] = new Token([ - $tokens[$stringEndIndex - 1]->getId(), - $tokens[$stringEndIndex - 1]->getContent()."\n", - ]); - } else { - $tokens->insertAt($stringEndIndex, new Token([ - T_ENCAPSED_AND_WHITESPACE, - "\n", - ])); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoBinaryStringFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoBinaryStringFixer.php deleted file mode 100644 index 3c41ab5b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoBinaryStringFixer.php +++ /dev/null @@ -1,75 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author ntzm - */ -final class NoBinaryStringFixer extends AbstractFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound( - [ - T_CONSTANT_ENCAPSED_STRING, - T_START_HEREDOC, - 'b"', - ] - ); - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There should not be a binary flag before strings.', - [ - new CodeSample(" $token) { - if ($token->isGivenKind([T_CONSTANT_ENCAPSED_STRING, T_START_HEREDOC])) { - $content = $token->getContent(); - - if ('b' === strtolower($content[0])) { - $tokens[$index] = new Token([$token->getId(), substr($content, 1)]); - } - } elseif ($token->equals('b"')) { - $tokens[$index] = new Token('"'); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoTrailingWhitespaceInStringFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoTrailingWhitespaceInStringFixer.php deleted file mode 100644 index 5e046073..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoTrailingWhitespaceInStringFixer.php +++ /dev/null @@ -1,100 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Gregor Harlan - */ -final class NoTrailingWhitespaceInStringFixer extends AbstractFixer -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE, T_INLINE_HTML]); - } - - public function isRisky(): bool - { - return true; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There must be no trailing whitespace in strings.', - [ - new CodeSample( - "count() - 1, $last = true; $index >= 0; --$index, $last = false) { - /** @var Token $token */ - $token = $tokens[$index]; - - if (!$token->isGivenKind([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE, T_INLINE_HTML])) { - continue; - } - - $isInlineHtml = $token->isGivenKind(T_INLINE_HTML); - $regex = $isInlineHtml && $last ? '/\h+(?=\R|$)/' : '/\h+(?=\R)/'; - $content = Preg::replace($regex, '', $token->getContent()); - - if ($token->getContent() === $content) { - continue; - } - - if (!$isInlineHtml || 0 === $index) { - $this->updateContent($tokens, $index, $content); - - continue; - } - - $prev = $index - 1; - - if ($tokens[$prev]->equals([T_CLOSE_TAG, '?>']) && Preg::match('/^\R/', $content, $match)) { - $tokens[$prev] = new Token([T_CLOSE_TAG, $tokens[$prev]->getContent().$match[0]]); - $content = substr($content, \strlen($match[0])); - $content = false === $content ? '' : $content; // @phpstan-ignore-line due to https://github.com/phpstan/phpstan/issues/1215 , awaiting PHP8 as min requirement of Fixer - } - - $this->updateContent($tokens, $index, $content); - } - } - - private function updateContent(Tokens $tokens, int $index, string $content): void - { - if ('' === $content) { - $tokens->clearAt($index); - - return; - } - - $tokens[$index] = new Token([$tokens[$index]->getId(), $content]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SimpleToComplexStringVariableFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SimpleToComplexStringVariableFixer.php deleted file mode 100644 index 9c6b4852..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SimpleToComplexStringVariableFixer.php +++ /dev/null @@ -1,96 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dave van der Brugge - */ -final class SimpleToComplexStringVariableFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Converts explicit variables in double-quoted strings and heredoc syntax from simple to complex format (`${` to `{$`).', - [ - new CodeSample( - <<<'EOT' - isTokenKindFound(T_DOLLAR_OPEN_CURLY_BRACES); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 3; $index > 0; --$index) { - if (!$tokens[$index]->isGivenKind(T_DOLLAR_OPEN_CURLY_BRACES)) { - continue; - } - $varnameToken = $tokens[$index + 1]; - - if (!$varnameToken->isGivenKind(T_STRING_VARNAME)) { - continue; - } - - $dollarCloseToken = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_COMPLEX_STRING_VARIABLE, $index); - - $prevTokenContent = $tokens[$index - 1]->getContent(); - if (str_ends_with($prevTokenContent, '$') && !str_ends_with($prevTokenContent, '\$')) { - $tokens[$index - 1] = new Token([T_ENCAPSED_AND_WHITESPACE, substr($prevTokenContent, 0, -1).'\$']); - } - $tokens[$index] = new Token([T_CURLY_OPEN, '{']); - $tokens[$index + 1] = new Token([T_VARIABLE, '$'.$varnameToken->getContent()]); - $tokens[$dollarCloseToken] = new Token([CT::T_CURLY_CLOSE, '}']); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SingleQuoteFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SingleQuoteFixer.php deleted file mode 100644 index 6541699c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SingleQuoteFixer.php +++ /dev/null @@ -1,122 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Gregor Harlan - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * strings_containing_single_quote_chars?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * strings_containing_single_quote_chars: bool - * } - */ -final class SingleQuoteFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - $codeSample = <<<'EOF' - true] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before NoUselessConcatOperatorFixer. - * Must run after BacktickToShellExecFixer, EscapeImplicitBackslashesFixer, StringImplicitBackslashesFixer. - */ - public function getPriority(): int - { - return 10; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_CONSTANT_ENCAPSED_STRING); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->isGivenKind(T_CONSTANT_ENCAPSED_STRING)) { - continue; - } - - $content = $token->getContent(); - $prefix = ''; - - if ('b' === strtolower($content[0])) { - $prefix = $content[0]; - $content = substr($content, 1); - } - - if ( - '"' === $content[0] - && (true === $this->configuration['strings_containing_single_quote_chars'] || !str_contains($content, "'")) - // regex: odd number of backslashes, not followed by double quote or dollar - && !Preg::match('/(?setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringImplicitBackslashesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringImplicitBackslashesFixer.php deleted file mode 100644 index b3203cb2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringImplicitBackslashesFixer.php +++ /dev/null @@ -1,194 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Filippo Tessarotto - * @author Michael Vorisek - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * double_quoted?: 'escape'|'ignore'|'unescape', - * heredoc?: 'escape'|'ignore'|'unescape', - * single_quoted?: 'escape'|'ignore'|'unescape' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * double_quoted: 'escape'|'ignore'|'unescape', - * heredoc: 'escape'|'ignore'|'unescape', - * single_quoted: 'escape'|'ignore'|'unescape' - * } - */ -final class StringImplicitBackslashesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - $codeSample = <<<'EOF' - 'escape'] - ), - new CodeSample( - $codeSample, - ['double_quoted' => 'unescape'] - ), - new CodeSample( - $codeSample, - ['heredoc' => 'unescape'] - ), - ], - 'In PHP double-quoted strings and heredocs some chars like `n`, `$` or `u` have special meanings if preceded by a backslash ' - .'(and some are special only if followed by other special chars), while a backslash preceding other chars are interpreted like a plain ' - .'backslash. The precise list of those special chars is hard to remember and to identify quickly: this fixer escapes backslashes ' - ."that do not start a special interpretation with the char after them.\n" - .'It is possible to fix also single-quoted strings: in this case there is no special chars apart from single-quote and backslash ' - .'itself, so the fixer simply ensure that all backslashes are escaped. Both single and double backslashes are allowed in single-quoted ' - .'strings, so the purpose in this context is mainly to have a uniformed way to have them written all over the codebase.' - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_ENCAPSED_AND_WHITESPACE, T_CONSTANT_ENCAPSED_STRING]); - } - - /** - * {@inheritdoc} - * - * Must run before HeredocToNowdocFixer, SingleQuoteFixer. - * Must run after MultilineStringToHeredocFixer. - */ - public function getPriority(): int - { - return 15; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $singleQuotedReservedRegex = '[\'\\\]'; - $doubleQuotedReservedRegex = '(?:[efnrtv$"\\\0-7]|x[0-9A-Fa-f]|u{|$)'; - $heredocSyntaxReservedRegex = '(?:[efnrtv$\\\0-7]|x[0-9A-Fa-f]|u{|$)'; - - $doubleQuoteOpened = false; - foreach ($tokens as $index => $token) { - if ($token->equalsAny(['"', 'b"', 'B"'])) { - $doubleQuoteOpened = !$doubleQuoteOpened; - } - - if (!$token->isGivenKind([T_ENCAPSED_AND_WHITESPACE, T_CONSTANT_ENCAPSED_STRING])) { - continue; - } - - $content = $token->getContent(); - if (!str_contains($content, '\\')) { - continue; - } - - // nowdoc syntax - if ($token->isGivenKind(T_ENCAPSED_AND_WHITESPACE) && '\'' === substr(rtrim($tokens[$index - 1]->getContent()), -1)) { - continue; - } - - $firstTwoCharacters = strtolower(substr($content, 0, 2)); - $isSingleQuotedString = $token->isGivenKind(T_CONSTANT_ENCAPSED_STRING) && ('\'' === $content[0] || 'b\'' === $firstTwoCharacters); - $isDoubleQuotedString = - ($token->isGivenKind(T_CONSTANT_ENCAPSED_STRING) && ('"' === $content[0] || 'b"' === $firstTwoCharacters)) - || ($token->isGivenKind(T_ENCAPSED_AND_WHITESPACE) && $doubleQuoteOpened); - - if ($isSingleQuotedString - ? 'ignore' === $this->configuration['single_quoted'] - : ($isDoubleQuotedString - ? 'ignore' === $this->configuration['double_quoted'] - : 'ignore' === $this->configuration['heredoc']) - ) { - continue; - } - - $escapeBackslashes = $isSingleQuotedString - ? 'escape' === $this->configuration['single_quoted'] - : ($isDoubleQuotedString - ? 'escape' === $this->configuration['double_quoted'] - : 'escape' === $this->configuration['heredoc']); - - $reservedRegex = $isSingleQuotedString - ? $singleQuotedReservedRegex - : ($isDoubleQuotedString - ? $doubleQuotedReservedRegex - : $heredocSyntaxReservedRegex); - - if ($escapeBackslashes) { - $regex = '/(?getId(), $newContent]); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('single_quoted', 'Whether to escape backslashes in single-quoted strings.')) - ->setAllowedValues(['escape', 'unescape', 'ignore']) - ->setDefault('unescape') - ->getOption(), - (new FixerOptionBuilder('double_quoted', 'Whether to escape backslashes in double-quoted strings.')) - ->setAllowedValues(['escape', 'unescape', 'ignore']) - ->setDefault('escape') - ->getOption(), - (new FixerOptionBuilder('heredoc', 'Whether to escape backslashes in heredoc syntax.')) - ->setAllowedValues(['escape', 'unescape', 'ignore']) - ->setDefault('escape') - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLengthToEmptyFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLengthToEmptyFixer.php deleted file mode 100644 index 361cc73c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLengthToEmptyFixer.php +++ /dev/null @@ -1,322 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractFunctionReferenceFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class StringLengthToEmptyFixer extends AbstractFunctionReferenceFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'String tests for empty must be done against `\'\'`, not with `strlen`.', - [new CodeSample("findStrLengthCalls($tokens) as $candidate) { - [$functionNameIndex, $openParenthesisIndex, $closeParenthesisIndex] = $candidate; - $arguments = $argumentsAnalyzer->getArguments($tokens, $openParenthesisIndex, $closeParenthesisIndex); - - if (1 !== \count($arguments)) { - continue; // must be one argument - } - - // test for leading `\` before `strlen` call - - $nextIndex = $tokens->getNextMeaningfulToken($closeParenthesisIndex); - $previousIndex = $tokens->getPrevMeaningfulToken($functionNameIndex); - - if ($tokens[$previousIndex]->isGivenKind(T_NS_SEPARATOR)) { - $namespaceSeparatorIndex = $previousIndex; - $previousIndex = $tokens->getPrevMeaningfulToken($previousIndex); - } else { - $namespaceSeparatorIndex = null; - } - - // test for yoda vs non-yoda fix case - - if ($this->isOperatorOfInterest($tokens[$previousIndex])) { // test if valid yoda case to fix - $operatorIndex = $previousIndex; - $operandIndex = $tokens->getPrevMeaningfulToken($previousIndex); - - if (!$this->isOperandOfInterest($tokens[$operandIndex])) { // test if operand is `0` or `1` - continue; - } - - $replacement = $this->getReplacementYoda($tokens[$operatorIndex], $tokens[$operandIndex]); - - if (null === $replacement) { - continue; - } - - if ($this->isOfHigherPrecedence($tokens[$nextIndex])) { // is of higher precedence right; continue - continue; - } - - if ($this->isOfHigherPrecedence($tokens[$tokens->getPrevMeaningfulToken($operandIndex)])) { // is of higher precedence left; continue - continue; - } - } elseif ($this->isOperatorOfInterest($tokens[$nextIndex])) { // test if valid !yoda case to fix - $operatorIndex = $nextIndex; - $operandIndex = $tokens->getNextMeaningfulToken($nextIndex); - - if (!$this->isOperandOfInterest($tokens[$operandIndex])) { // test if operand is `0` or `1` - continue; - } - - $replacement = $this->getReplacementNotYoda($tokens[$operatorIndex], $tokens[$operandIndex]); - - if (null === $replacement) { - continue; - } - - if ($this->isOfHigherPrecedence($tokens[$tokens->getNextMeaningfulToken($operandIndex)])) { // is of higher precedence right; continue - continue; - } - - if ($this->isOfHigherPrecedence($tokens[$previousIndex])) { // is of higher precedence left; continue - continue; - } - } else { - continue; - } - - // prepare for fixing - - $keepParentheses = $this->keepParentheses($tokens, $openParenthesisIndex, $closeParenthesisIndex); - - if (T_IS_IDENTICAL === $replacement) { - $operandContent = '==='; - } else { // T_IS_NOT_IDENTICAL === $replacement - $operandContent = '!=='; - } - - // apply fixing - - $tokens[$operandIndex] = new Token([T_CONSTANT_ENCAPSED_STRING, "''"]); - $tokens[$operatorIndex] = new Token([$replacement, $operandContent]); - - if (!$keepParentheses) { - $tokens->clearTokenAndMergeSurroundingWhitespace($closeParenthesisIndex); - $tokens->clearTokenAndMergeSurroundingWhitespace($openParenthesisIndex); - } - - $tokens->clearTokenAndMergeSurroundingWhitespace($functionNameIndex); - - if (null !== $namespaceSeparatorIndex) { - $tokens->clearTokenAndMergeSurroundingWhitespace($namespaceSeparatorIndex); - } - } - } - - private function getReplacementYoda(Token $operator, Token $operand): ?int - { - /* Yoda 0 - - 0 === strlen($b) | '' === $b - 0 !== strlen($b) | '' !== $b - 0 <= strlen($b) | X makes no sense, assume overridden - 0 >= strlen($b) | '' === $b - 0 < strlen($b) | '' !== $b - 0 > strlen($b) | X makes no sense, assume overridden - */ - - if ('0' === $operand->getContent()) { - if ($operator->isGivenKind([T_IS_IDENTICAL, T_IS_GREATER_OR_EQUAL])) { - return T_IS_IDENTICAL; - } - - if ($operator->isGivenKind(T_IS_NOT_IDENTICAL) || $operator->equals('<')) { - return T_IS_NOT_IDENTICAL; - } - - return null; - } - - /* Yoda 1 - - 1 === strlen($b) | X cannot simplify - 1 !== strlen($b) | X cannot simplify - 1 <= strlen($b) | '' !== $b - 1 >= strlen($b) | cannot simplify - 1 < strlen($b) | cannot simplify - 1 > strlen($b) | '' === $b - */ - - if ($operator->isGivenKind(T_IS_SMALLER_OR_EQUAL)) { - return T_IS_NOT_IDENTICAL; - } - - if ($operator->equals('>')) { - return T_IS_IDENTICAL; - } - - return null; - } - - private function getReplacementNotYoda(Token $operator, Token $operand): ?int - { - /* Not Yoda 0 - - strlen($b) === 0 | $b === '' - strlen($b) !== 0 | $b !== '' - strlen($b) <= 0 | $b === '' - strlen($b) >= 0 | X makes no sense, assume overridden - strlen($b) < 0 | X makes no sense, assume overridden - strlen($b) > 0 | $b !== '' - */ - - if ('0' === $operand->getContent()) { - if ($operator->isGivenKind([T_IS_IDENTICAL, T_IS_SMALLER_OR_EQUAL])) { - return T_IS_IDENTICAL; - } - - if ($operator->isGivenKind(T_IS_NOT_IDENTICAL) || $operator->equals('>')) { - return T_IS_NOT_IDENTICAL; - } - - return null; - } - - /* Not Yoda 1 - - strlen($b) === 1 | X cannot simplify - strlen($b) !== 1 | X cannot simplify - strlen($b) <= 1 | X cannot simplify - strlen($b) >= 1 | $b !== '' - strlen($b) < 1 | $b === '' - strlen($b) > 1 | X cannot simplify - */ - - if ($operator->isGivenKind(T_IS_GREATER_OR_EQUAL)) { - return T_IS_NOT_IDENTICAL; - } - - if ($operator->equals('<')) { - return T_IS_IDENTICAL; - } - - return null; - } - - private function isOperandOfInterest(Token $token): bool - { - if (!$token->isGivenKind(T_LNUMBER)) { - return false; - } - - $content = $token->getContent(); - - return '0' === $content || '1' === $content; - } - - private function isOperatorOfInterest(Token $token): bool - { - return - $token->isGivenKind([T_IS_IDENTICAL, T_IS_NOT_IDENTICAL, T_IS_SMALLER_OR_EQUAL, T_IS_GREATER_OR_EQUAL]) - || $token->equals('<') || $token->equals('>'); - } - - private function isOfHigherPrecedence(Token $token): bool - { - static $operatorsPerContent = [ - '!', - '%', - '*', - '+', - '-', - '.', - '/', - '~', - '?', - ]; - - return $token->isGivenKind([T_INSTANCEOF, T_POW, T_SL, T_SR]) || $token->equalsAny($operatorsPerContent); - } - - private function keepParentheses(Tokens $tokens, int $openParenthesisIndex, int $closeParenthesisIndex): bool - { - $i = $tokens->getNextMeaningfulToken($openParenthesisIndex); - - if ($tokens[$i]->isCast()) { - $i = $tokens->getNextMeaningfulToken($i); - } - - for (; $i < $closeParenthesisIndex; ++$i) { - $token = $tokens[$i]; - - if ($token->isGivenKind([T_VARIABLE, T_STRING]) || $token->isObjectOperator() || $token->isWhitespace() || $token->isComment()) { - continue; - } - - $blockType = Tokens::detectBlockType($token); - - if (null !== $blockType && $blockType['isStart']) { - $i = $tokens->findBlockEnd($blockType['type'], $i); - - continue; - } - - return true; - } - - return false; - } - - private function findStrLengthCalls(Tokens $tokens): \Generator - { - $candidates = []; - $count = \count($tokens); - - for ($i = 0; $i < $count; ++$i) { - $candidate = $this->find('strlen', $tokens, $i, $count); - - if (null === $candidate) { - break; - } - - $i = $candidate[1]; // proceed to openParenthesisIndex - $candidates[] = $candidate; - } - - foreach (array_reverse($candidates) as $candidate) { - yield $candidate; - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLineEndingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLineEndingFixer.php deleted file mode 100644 index aae69262..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLineEndingFixer.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\StringNotation; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixes the line endings in multi-line strings. - * - * @author Ilija Tovilo - */ -final class StringLineEndingFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE, T_INLINE_HTML]); - } - - public function isRisky(): bool - { - return true; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'All multi-line strings must use correct line ending.', - [ - new CodeSample( - "whitespacesConfig->getLineEnding(); - - foreach ($tokens as $tokenIndex => $token) { - if (!$token->isGivenKind([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE, T_INLINE_HTML])) { - continue; - } - - $tokens[$tokenIndex] = new Token([ - $token->getId(), - Preg::replace( - '#\R#u', - $ending, - $token->getContent() - ), - ]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/ArrayIndentationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/ArrayIndentationFixer.php deleted file mode 100644 index 80ef9ef9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/ArrayIndentationFixer.php +++ /dev/null @@ -1,197 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\Indentation; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -final class ArrayIndentationFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - use Indentation; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Each element of an array must be indented exactly once.', - [ - new CodeSample(" [\n 'baz' => true,\n ],\n];\n"), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([T_ARRAY, T_LIST, CT::T_ARRAY_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN]); - } - - /** - * {@inheritdoc} - * - * Must run before AlignMultilineCommentFixer, BinaryOperatorSpacesFixer. - * Must run after MethodArgumentSpaceFixer. - */ - public function getPriority(): int - { - return 29; - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $lastIndent = ''; - $scopes = []; - $previousLineInitialIndent = ''; - $previousLineNewIndent = ''; - - foreach ($tokens as $index => $token) { - $currentScope = [] !== $scopes ? \count($scopes) - 1 : null; - - if ($token->isComment()) { - continue; - } - - if ( - $token->isGivenKind([CT::T_ARRAY_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN]) - || ($token->equals('(') && $tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind([T_ARRAY, T_LIST])) - ) { - $blockType = Tokens::detectBlockType($token); - $endIndex = $tokens->findBlockEnd($blockType['type'], $index); - - $scopes[] = [ - 'type' => 'array', - 'end_index' => $endIndex, - 'initial_indent' => $lastIndent, - ]; - - continue; - } - - if ($this->isNewLineToken($tokens, $index)) { - $lastIndent = $this->extractIndent($this->computeNewLineContent($tokens, $index)); - } - - if (null === $currentScope) { - continue; - } - - if ($token->isWhitespace()) { - if (!Preg::match('/\R/', $token->getContent())) { - continue; - } - - if ('array' === $scopes[$currentScope]['type']) { - $indent = false; - - for ($searchEndIndex = $index + 1; $searchEndIndex < $scopes[$currentScope]['end_index']; ++$searchEndIndex) { - $searchEndToken = $tokens[$searchEndIndex]; - - if ( - (!$searchEndToken->isWhitespace() && !$searchEndToken->isComment()) - || ($searchEndToken->isWhitespace() && Preg::match('/\R/', $searchEndToken->getContent())) - ) { - $indent = true; - - break; - } - } - - $content = Preg::replace( - '/(\R+)\h*$/', - '$1'.$scopes[$currentScope]['initial_indent'].($indent ? $this->whitespacesConfig->getIndent() : ''), - $token->getContent() - ); - - $previousLineInitialIndent = $this->extractIndent($token->getContent()); - $previousLineNewIndent = $this->extractIndent($content); - } else { - $content = Preg::replace( - '/(\R)'.preg_quote($scopes[$currentScope]['initial_indent'], '/').'(\h*)$/', - '$1'.$scopes[$currentScope]['new_indent'].'$2', - $token->getContent() - ); - } - - $tokens[$index] = new Token([T_WHITESPACE, $content]); - $lastIndent = $this->extractIndent($content); - - continue; - } - - if ($index === $scopes[$currentScope]['end_index']) { - while ([] !== $scopes && $index === $scopes[$currentScope]['end_index']) { - array_pop($scopes); - --$currentScope; - } - - continue; - } - - if ($token->equals(',')) { - continue; - } - - if ('expression' !== $scopes[$currentScope]['type']) { - $endIndex = $this->findExpressionEndIndex($tokens, $index, $scopes[$currentScope]['end_index']); - - if ($endIndex === $index) { - continue; - } - - $scopes[] = [ - 'type' => 'expression', - 'end_index' => $endIndex, - 'initial_indent' => $previousLineInitialIndent, - 'new_indent' => $previousLineNewIndent, - ]; - } - } - } - - private function findExpressionEndIndex(Tokens $tokens, int $index, int $parentScopeEndIndex): int - { - $endIndex = null; - - for ($searchEndIndex = $index + 1; $searchEndIndex < $parentScopeEndIndex; ++$searchEndIndex) { - $searchEndToken = $tokens[$searchEndIndex]; - - if ($searchEndToken->equalsAny(['(', '{']) - || $searchEndToken->isGivenKind([CT::T_ARRAY_SQUARE_BRACE_OPEN, CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN]) - ) { - $type = Tokens::detectBlockType($searchEndToken); - $searchEndIndex = $tokens->findBlockEnd( - $type['type'], - $searchEndIndex - ); - - continue; - } - - if ($searchEndToken->equals(',')) { - $endIndex = $tokens->getPrevMeaningfulToken($searchEndIndex); - - break; - } - } - - return $endIndex ?? $tokens->getPrevMeaningfulToken($parentScopeEndIndex); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBeforeStatementFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBeforeStatementFixer.php deleted file mode 100644 index 9256de3b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBeforeStatementFixer.php +++ /dev/null @@ -1,379 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Dariusz Rumiński - * @author Andreas Möller - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * statements?: list<'break'|'case'|'continue'|'declare'|'default'|'do'|'exit'|'for'|'foreach'|'goto'|'if'|'include'|'include_once'|'phpdoc'|'require'|'require_once'|'return'|'switch'|'throw'|'try'|'while'|'yield'|'yield_from'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * statements: list<'break'|'case'|'continue'|'declare'|'default'|'do'|'exit'|'for'|'foreach'|'goto'|'if'|'include'|'include_once'|'phpdoc'|'require'|'require_once'|'return'|'switch'|'throw'|'try'|'while'|'yield'|'yield_from'> - * } - */ -final class BlankLineBeforeStatementFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var array - */ - private const TOKEN_MAP = [ - 'break' => T_BREAK, - 'case' => T_CASE, - 'continue' => T_CONTINUE, - 'declare' => T_DECLARE, - 'default' => T_DEFAULT, - 'do' => T_DO, - 'exit' => T_EXIT, - 'for' => T_FOR, - 'foreach' => T_FOREACH, - 'goto' => T_GOTO, - 'if' => T_IF, - 'include' => T_INCLUDE, - 'include_once' => T_INCLUDE_ONCE, - 'phpdoc' => T_DOC_COMMENT, - 'require' => T_REQUIRE, - 'require_once' => T_REQUIRE_ONCE, - 'return' => T_RETURN, - 'switch' => T_SWITCH, - 'throw' => T_THROW, - 'try' => T_TRY, - 'while' => T_WHILE, - 'yield' => T_YIELD, - 'yield_from' => T_YIELD_FROM, - ]; - - /** - * @var list - */ - private array $fixTokenMap = []; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'An empty line feed must precede any configured statement.', - [ - new CodeSample( - 'process(); - break; - case 44: - break; -} -', - [ - 'statements' => ['break'], - ] - ), - new CodeSample( - 'isTired()) { - $bar->sleep(); - continue; - } -} -', - [ - 'statements' => ['continue'], - ] - ), - new CodeSample( - ' 0); -', - [ - 'statements' => ['do'], - ] - ), - new CodeSample( - ' ['exit'], - ] - ), - new CodeSample( - ' ['goto'], - ] - ), - new CodeSample( - ' ['if'], - ] - ), - new CodeSample( - ' ['return'], - ] - ), - new CodeSample( - ' ['switch'], - ] - ), - new CodeSample( - 'bar(); - throw new \UnexpectedValueException("A cannot be null."); -} -', - [ - 'statements' => ['throw'], - ] - ), - new CodeSample( - 'bar(); -} catch (\Exception $exception) { - $a = -1; -} -', - [ - 'statements' => ['try'], - ] - ), - new CodeSample( - ' ['yield'], - ] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after NoExtraBlankLinesFixer, NoUselessElseFixer, NoUselessReturnFixer, ReturnAssignmentFixer, YieldFromArrayToYieldsFixer. - */ - public function getPriority(): int - { - return -21; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound($this->fixTokenMap); - } - - protected function configurePostNormalisation(): void - { - $fixTokenMap = []; - - foreach ($this->configuration['statements'] as $key) { - $fixTokenMap[$key] = self::TOKEN_MAP[$key]; - } - - $this->fixTokenMap = array_values($fixTokenMap); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $analyzer = new TokensAnalyzer($tokens); - - for ($index = $tokens->count() - 1; $index > 0; --$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind($this->fixTokenMap)) { - continue; - } - - if ($token->isGivenKind(T_WHILE) && $analyzer->isWhilePartOfDoWhile($index)) { - continue; - } - - if ($token->isGivenKind(T_CASE) && $analyzer->isEnumCase($index)) { - continue; - } - - $insertBlankLineIndex = $this->getInsertBlankLineIndex($tokens, $index); - $prevNonWhitespace = $tokens->getPrevNonWhitespace($insertBlankLineIndex); - - if ($this->shouldAddBlankLine($tokens, $prevNonWhitespace)) { - $this->insertBlankLine($tokens, $insertBlankLineIndex); - } - - $index = $prevNonWhitespace; - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('statements', 'List of statements which must be preceded by an empty line.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset(array_keys(self::TOKEN_MAP))]) - ->setDefault([ - 'break', - 'continue', - 'declare', - 'return', - 'throw', - 'try', - ]) - ->getOption(), - ]); - } - - private function getInsertBlankLineIndex(Tokens $tokens, int $index): int - { - while ($index > 0) { - if ($tokens[$index - 1]->isWhitespace() && substr_count($tokens[$index - 1]->getContent(), "\n") > 1) { - break; - } - - $prevIndex = $tokens->getPrevNonWhitespace($index); - - if (!$tokens[$prevIndex]->isComment()) { - break; - } - - if (!$tokens[$prevIndex - 1]->isWhitespace()) { - break; - } - - if (1 !== substr_count($tokens[$prevIndex - 1]->getContent(), "\n")) { - break; - } - - $index = $prevIndex; - } - - return $index; - } - - private function shouldAddBlankLine(Tokens $tokens, int $prevNonWhitespace): bool - { - $prevNonWhitespaceToken = $tokens[$prevNonWhitespace]; - - if ($prevNonWhitespaceToken->isComment()) { - for ($j = $prevNonWhitespace - 1; $j >= 0; --$j) { - if (str_contains($tokens[$j]->getContent(), "\n")) { - return false; - } - - if ($tokens[$j]->isWhitespace() || $tokens[$j]->isComment()) { - continue; - } - - return $tokens[$j]->equalsAny([';', '}']); - } - } - - return $prevNonWhitespaceToken->equalsAny([';', '}']); - } - - private function insertBlankLine(Tokens $tokens, int $index): void - { - $prevIndex = $index - 1; - $prevToken = $tokens[$prevIndex]; - $lineEnding = $this->whitespacesConfig->getLineEnding(); - - if ($prevToken->isWhitespace()) { - $newlinesCount = substr_count($prevToken->getContent(), "\n"); - - if (0 === $newlinesCount) { - $tokens[$prevIndex] = new Token([T_WHITESPACE, rtrim($prevToken->getContent(), " \t").$lineEnding.$lineEnding]); - } elseif (1 === $newlinesCount) { - $tokens[$prevIndex] = new Token([T_WHITESPACE, $lineEnding.$prevToken->getContent()]); - } - } else { - $tokens->insertAt($index, new Token([T_WHITESPACE, $lineEnding.$lineEnding])); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBetweenImportGroupsFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBetweenImportGroupsFixer.php deleted file mode 100644 index 7bd48ca6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/BlankLineBetweenImportGroupsFixer.php +++ /dev/null @@ -1,180 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Sander Verkuil - */ -final class BlankLineBetweenImportGroupsFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - private const IMPORT_TYPE_CLASS = 'class'; - - private const IMPORT_TYPE_CONST = 'const'; - - private const IMPORT_TYPE_FUNCTION = 'function'; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Putting blank lines between `use` statement groups.', - [ - new CodeSample( - 'isTokenKindFound(T_USE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - $namespacesImports = $tokensAnalyzer->getImportUseIndexes(true); - - foreach (array_reverse($namespacesImports) as $uses) { - $this->walkOverUses($tokens, $uses); - } - } - - /** - * @param list $uses - */ - private function walkOverUses(Tokens $tokens, array $uses): void - { - $usesCount = \count($uses); - - if ($usesCount < 2) { - return; // nothing to fix - } - - $previousType = null; - - for ($i = $usesCount - 1; $i >= 0; --$i) { - $index = $uses[$i]; - $startIndex = $tokens->getNextMeaningfulToken($index + 1); - $endIndex = $tokens->getNextTokenOfKind($startIndex, [';', [T_CLOSE_TAG]]); - - if ($tokens[$startIndex]->isGivenKind(CT::T_CONST_IMPORT)) { - $type = self::IMPORT_TYPE_CONST; - } elseif ($tokens[$startIndex]->isGivenKind(CT::T_FUNCTION_IMPORT)) { - $type = self::IMPORT_TYPE_FUNCTION; - } else { - $type = self::IMPORT_TYPE_CLASS; - } - - if (null !== $previousType && $type !== $previousType) { - $this->ensureLine($tokens, $endIndex + 1); - } - - $previousType = $type; - } - } - - private function ensureLine(Tokens $tokens, int $index): void - { - static $lineEnding; - - if (null === $lineEnding) { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - $lineEnding .= $lineEnding; - } - - $index = $this->getInsertIndex($tokens, $index); - $indent = WhitespacesAnalyzer::detectIndent($tokens, $index); - - $tokens->ensureWhitespaceAtIndex($index, 1, $lineEnding.$indent); - } - - private function getInsertIndex(Tokens $tokens, int $index): int - { - $tokensCount = \count($tokens); - - for (; $index < $tokensCount - 1; ++$index) { - if (!$tokens[$index]->isWhitespace() && !$tokens[$index]->isComment()) { - return $index - 1; - } - - $content = $tokens[$index]->getContent(); - - if (str_contains($content, "\n")) { - return $index; - } - } - - return $index; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypeDeclarationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypeDeclarationFixer.php deleted file mode 100644 index e1af647e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypeDeclarationFixer.php +++ /dev/null @@ -1,72 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Jack Cherng - */ -final class CompactNullableTypeDeclarationFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Remove extra spaces in a nullable type declaration.', - [ - new CodeSample( - "isTokenKindFound(CT::T_NULLABLE_TYPE); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - static $typehintKinds = [ - CT::T_ARRAY_TYPEHINT, - T_CALLABLE, - T_NS_SEPARATOR, - T_STATIC, - T_STRING, - ]; - - for ($index = $tokens->count() - 1; $index >= 0; --$index) { - if (!$tokens[$index]->isGivenKind(CT::T_NULLABLE_TYPE)) { - continue; - } - - // remove whitespaces only if there are only whitespaces - // between '?' and the variable type - if ( - $tokens[$index + 1]->isWhitespace() - && $tokens[$index + 2]->isGivenKind($typehintKinds) - ) { - $tokens->removeTrailingWhitespace($index); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypehintFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypehintFixer.php deleted file mode 100644 index 89c4ec65..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/CompactNullableTypehintFixer.php +++ /dev/null @@ -1,63 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; - -/** - * @author Jack Cherng - * - * @deprecated - */ -final class CompactNullableTypehintFixer extends AbstractProxyFixer implements DeprecatedFixerInterface -{ - private CompactNullableTypeDeclarationFixer $compactNullableTypeDeclarationFixer; - - public function __construct() - { - $this->compactNullableTypeDeclarationFixer = new CompactNullableTypeDeclarationFixer(); - - parent::__construct(); - } - - public function getDefinition(): FixerDefinitionInterface - { - $fixerDefinition = $this->compactNullableTypeDeclarationFixer->getDefinition(); - - return new FixerDefinition( - 'Remove extra spaces in a nullable typehint.', - $fixerDefinition->getCodeSamples(), - $fixerDefinition->getDescription(), - $fixerDefinition->getRiskyDescription(), - ); - } - - public function getSuccessorsNames(): array - { - return [ - $this->compactNullableTypeDeclarationFixer->getName(), - ]; - } - - protected function createProxyFixers(): array - { - return [ - $this->compactNullableTypeDeclarationFixer, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/HeredocIndentationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/HeredocIndentationFixer.php deleted file mode 100644 index 67b9d283..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/HeredocIndentationFixer.php +++ /dev/null @@ -1,180 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Gregor Harlan - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * indentation?: 'same_as_start'|'start_plus_one' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * indentation: 'same_as_start'|'start_plus_one' - * } - */ -final class HeredocIndentationFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Heredoc/nowdoc content must be properly indented.', - [ - new CodeSample( - <<<'SAMPLE' - 'same_as_start'] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run after BracesFixer, MultilineStringToHeredocFixer, StatementIndentationFixer. - */ - public function getPriority(): int - { - return -26; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound(T_START_HEREDOC); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('indentation', 'Whether the indentation should be the same as in the start token line or one level more.')) - ->setAllowedValues(['start_plus_one', 'same_as_start']) - ->setDefault('start_plus_one') - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - for ($index = \count($tokens) - 1; 0 <= $index; --$index) { - if (!$tokens[$index]->isGivenKind(T_END_HEREDOC)) { - continue; - } - - $end = $index; - $index = $tokens->getPrevTokenOfKind($index, [[T_START_HEREDOC]]); - - $this->fixIndentation($tokens, $index, $end); - } - } - - private function fixIndentation(Tokens $tokens, int $start, int $end): void - { - $indent = WhitespacesAnalyzer::detectIndent($tokens, $start); - - if ('start_plus_one' === $this->configuration['indentation']) { - $indent .= $this->whitespacesConfig->getIndent(); - } - - Preg::match('/^\h*/', $tokens[$end]->getContent(), $matches); - $currentIndent = $matches[0]; - $currentIndentLength = \strlen($currentIndent); - - $content = $indent.substr($tokens[$end]->getContent(), $currentIndentLength); - $tokens[$end] = new Token([T_END_HEREDOC, $content]); - - if ($end === $start + 1) { - return; - } - - $index = $end - 1; - - for ($last = true; $index > $start; --$index, $last = false) { - if (!$tokens[$index]->isGivenKind([T_ENCAPSED_AND_WHITESPACE, T_WHITESPACE])) { - continue; - } - - $content = $tokens[$index]->getContent(); - - if ('' !== $currentIndent) { - $content = Preg::replace('/(?<=\v)(?!'.$currentIndent.')\h+/', '', $content); - } - - $regexEnd = $last && '' === $currentIndent ? '(?!\v|$)' : '(?!\v)'; - $content = Preg::replace('/(?<=\v)'.$currentIndent.$regexEnd.'/', $indent, $content); - - $tokens[$index] = new Token([$tokens[$index]->getId(), $content]); - } - - ++$index; - - if (!$tokens[$index]->isGivenKind(T_ENCAPSED_AND_WHITESPACE)) { - $tokens->insertAt($index, new Token([T_ENCAPSED_AND_WHITESPACE, $indent])); - - return; - } - - $content = $tokens[$index]->getContent(); - - if (!\in_array($content[0], ["\r", "\n"], true) && ('' === $currentIndent || str_starts_with($content, $currentIndent))) { - $content = $indent.substr($content, $currentIndentLength); - } elseif ('' !== $currentIndent) { - $content = Preg::replace('/^(?!'.$currentIndent.')\h+/', '', $content); - } - - $tokens[$index] = new Token([T_ENCAPSED_AND_WHITESPACE, $content]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/IndentationTypeFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/IndentationTypeFixer.php deleted file mode 100644 index 4d332cc1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/IndentationTypeFixer.php +++ /dev/null @@ -1,139 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶2.4. - * - * @author Dariusz Rumiński - */ -final class IndentationTypeFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - private string $indent; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Code MUST use configured indentation type.', - [ - new CodeSample("isAnyTokenKindsFound([T_COMMENT, T_DOC_COMMENT, T_WHITESPACE]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->indent = $this->whitespacesConfig->getIndent(); - - foreach ($tokens as $index => $token) { - if ($token->isComment()) { - $tokens[$index] = $this->fixIndentInComment($tokens, $index); - - continue; - } - - if ($token->isWhitespace()) { - $tokens[$index] = $this->fixIndentToken($tokens, $index); - - continue; - } - } - } - - private function fixIndentInComment(Tokens $tokens, int $index): Token - { - $content = Preg::replace('/^(?:(?getContent(), -1, $count); - - // Also check for more tabs. - while (0 !== $count) { - $content = Preg::replace('/^(\ +)?\t/m', '\1 ', $content, -1, $count); - } - - $indent = $this->indent; - - // change indent to expected one - $content = Preg::replaceCallback('/^(?: )+/m', fn (array $matches): string => $this->getExpectedIndent($matches[0], $indent), $content); - - return new Token([$tokens[$index]->getId(), $content]); - } - - private function fixIndentToken(Tokens $tokens, int $index): Token - { - $content = $tokens[$index]->getContent(); - $previousTokenHasTrailingLinebreak = false; - - // @TODO this can be removed when we have a transformer for "T_OPEN_TAG" to "T_OPEN_TAG + T_WHITESPACE" - if (str_contains($tokens[$index - 1]->getContent(), "\n")) { - $content = "\n".$content; - $previousTokenHasTrailingLinebreak = true; - } - - $indent = $this->indent; - $newContent = Preg::replaceCallback( - '/(\R)(\h+)/', // find indent - function (array $matches) use ($indent): string { - // normalize mixed indent - $content = Preg::replace('/(?:(?getExpectedIndent($content, $indent); - }, - $content - ); - - if ($previousTokenHasTrailingLinebreak) { - $newContent = substr($newContent, 1); - } - - return new Token([T_WHITESPACE, $newContent]); - } - - /** - * @return string mixed - */ - private function getExpectedIndent(string $content, string $indent): string - { - if ("\t" === $indent) { - $content = str_replace(' ', $indent, $content); - } - - return $content; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/LineEndingFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/LineEndingFixer.php deleted file mode 100644 index adc2016f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/LineEndingFixer.php +++ /dev/null @@ -1,85 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶2.2. - * - * @author Fabien Potencier - * @author Dariusz Rumiński - */ -final class LineEndingFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function isCandidate(Tokens $tokens): bool - { - return true; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'All PHP files must use same line ending.', - [ - new CodeSample( - "whitespacesConfig->getLineEnding(); - - for ($index = 0, $count = \count($tokens); $index < $count; ++$index) { - $token = $tokens[$index]; - - if ($token->isGivenKind(T_ENCAPSED_AND_WHITESPACE)) { - if ($tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(T_END_HEREDOC)) { - $tokens[$index] = new Token([ - $token->getId(), - Preg::replace( - '#\R#', - $ending, - $token->getContent() - ), - ]); - } - - continue; - } - - if ($token->isGivenKind([T_CLOSE_TAG, T_COMMENT, T_DOC_COMMENT, T_OPEN_TAG, T_START_HEREDOC, T_WHITESPACE])) { - $tokens[$index] = new Token([ - $token->getId(), - Preg::replace( - '#\R#', - $ending, - $token->getContent() - ), - ]); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/MethodChainingIndentationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/MethodChainingIndentationFixer.php deleted file mode 100644 index 58725fbe..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/MethodChainingIndentationFixer.php +++ /dev/null @@ -1,229 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Vladimir Boliev - */ -final class MethodChainingIndentationFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Method chaining MUST be properly indented. Method chaining with different levels of indentation is not supported.', - [new CodeSample("setEmail('voff.web@gmail.com')\n ->setPassword('233434');\n")] - ); - } - - /** - * {@inheritdoc} - * - * Must run after NoSpaceAroundDoubleColonFixer. - */ - public function getPriority(): int - { - return 0; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(Token::getObjectOperatorKinds()); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - - for ($index = 1, $count = \count($tokens); $index < $count; ++$index) { - if (!$tokens[$index]->isObjectOperator()) { - continue; - } - - $endParenthesisIndex = $tokens->getNextTokenOfKind($index, ['(', ';', ',', [T_CLOSE_TAG]]); - $previousEndParenthesisIndex = $tokens->getPrevTokenOfKind($index, [')']); - - if ( - null === $endParenthesisIndex - || !$tokens[$endParenthesisIndex]->equals('(') && null === $previousEndParenthesisIndex - ) { - continue; - } - - if ($this->canBeMovedToNextLine($index, $tokens)) { - $newline = new Token([T_WHITESPACE, $lineEnding]); - - if ($tokens[$index - 1]->isWhitespace()) { - $tokens[$index - 1] = $newline; - } else { - $tokens->insertAt($index, $newline); - ++$index; - ++$endParenthesisIndex; - } - } - - $currentIndent = $this->getIndentAt($tokens, $index - 1); - - if (null === $currentIndent) { - continue; - } - - $expectedIndent = $this->getExpectedIndentAt($tokens, $index); - - if ($currentIndent !== $expectedIndent) { - $tokens[$index - 1] = new Token([T_WHITESPACE, $lineEnding.$expectedIndent]); - } - - if (!$tokens[$endParenthesisIndex]->equals('(')) { - continue; - } - - $endParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $endParenthesisIndex); - - for ($searchIndex = $index + 1; $searchIndex < $endParenthesisIndex; ++$searchIndex) { - $searchToken = $tokens[$searchIndex]; - - if (!$searchToken->isWhitespace()) { - continue; - } - - $content = $searchToken->getContent(); - - if (!Preg::match('/\R/', $content)) { - continue; - } - - $content = Preg::replace( - '/(\R)'.$currentIndent.'(\h*)$/D', - '$1'.$expectedIndent.'$2', - $content - ); - - $tokens[$searchIndex] = new Token([$searchToken->getId(), $content]); - } - } - } - - /** - * @param int $index index of the first token on the line to indent - */ - private function getExpectedIndentAt(Tokens $tokens, int $index): string - { - $index = $tokens->getPrevMeaningfulToken($index); - $indent = $this->whitespacesConfig->getIndent(); - - for ($i = $index; $i >= 0; --$i) { - if ($tokens[$i]->equals(')')) { - $i = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $i); - } - - $currentIndent = $this->getIndentAt($tokens, $i); - if (null === $currentIndent) { - continue; - } - - if ($this->currentLineRequiresExtraIndentLevel($tokens, $i, $index)) { - return $currentIndent.$indent; - } - - return $currentIndent; - } - - return $indent; - } - - /** - * @param int $index position of the object operator token ("->" or "?->") - */ - private function canBeMovedToNextLine(int $index, Tokens $tokens): bool - { - $prevMeaningful = $tokens->getPrevMeaningfulToken($index); - $hasCommentBefore = false; - - for ($i = $index - 1; $i > $prevMeaningful; --$i) { - if ($tokens[$i]->isComment()) { - $hasCommentBefore = true; - - continue; - } - - if ($tokens[$i]->isWhitespace() && Preg::match('/\R/', $tokens[$i]->getContent())) { - return $hasCommentBefore; - } - } - - return false; - } - - /** - * @param int $index index of the indentation token - */ - private function getIndentAt(Tokens $tokens, int $index): ?string - { - if (Preg::match('/\R{1}(\h*)$/', $this->getIndentContentAt($tokens, $index), $matches)) { - return $matches[1]; - } - - return null; - } - - private function getIndentContentAt(Tokens $tokens, int $index): string - { - if (!$tokens[$index]->isGivenKind([T_WHITESPACE, T_INLINE_HTML])) { - return ''; - } - - $content = $tokens[$index]->getContent(); - - if ($tokens[$index]->isWhitespace() && $tokens[$index - 1]->isGivenKind(T_OPEN_TAG)) { - $content = $tokens[$index - 1]->getContent().$content; - } - - if (Preg::match('/\R/', $content)) { - return $content; - } - - return ''; - } - - /** - * @param int $start index of first meaningful token on previous line - * @param int $end index of last token on previous line - */ - private function currentLineRequiresExtraIndentLevel(Tokens $tokens, int $start, int $end): bool - { - $firstMeaningful = $tokens->getNextMeaningfulToken($start); - - if ($tokens[$firstMeaningful]->isObjectOperator()) { - $thirdMeaningful = $tokens->getNextMeaningfulToken($tokens->getNextMeaningfulToken($firstMeaningful)); - - return - $tokens[$thirdMeaningful]->equals('(') - && $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $thirdMeaningful) > $end; - } - - return - !$tokens[$end]->equals(')') - || $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $end) >= $start; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoExtraBlankLinesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoExtraBlankLinesFixer.php deleted file mode 100644 index 8f0555b5..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoExtraBlankLinesFixer.php +++ /dev/null @@ -1,496 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\SwitchAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; -use PhpCsFixer\Utils; - -/** - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * tokens?: list<'attribute'|'break'|'case'|'continue'|'curly_brace_block'|'default'|'extra'|'parenthesis_brace_block'|'return'|'square_brace_block'|'switch'|'throw'|'use'|'use_trait'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * tokens: list<'attribute'|'break'|'case'|'continue'|'curly_brace_block'|'default'|'extra'|'parenthesis_brace_block'|'return'|'square_brace_block'|'switch'|'throw'|'use'|'use_trait'> - * } - */ -final class NoExtraBlankLinesFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - /** - * @var list - */ - private const AVAILABLE_TOKENS = [ - 'attribute', - 'break', - 'case', - 'continue', - 'curly_brace_block', - 'default', - 'extra', - 'parenthesis_brace_block', - 'return', - 'square_brace_block', - 'switch', - 'throw', - 'use', - 'use_trait', - ]; - - /** - * @var array key is token id - */ - private array $tokenKindCallbackMap; - - /** - * @var array key is token's content - */ - private array $tokenEqualsMap; - - private Tokens $tokens; - - private TokensAnalyzer $tokensAnalyzer; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Removes extra blank lines and/or blank lines following configuration.', - [ - new CodeSample( - ' ['break']] - ), - new CodeSample( - ' ['continue']] - ), - new CodeSample( - ' ['curly_brace_block']] - ), - new CodeSample( - ' ['extra']] - ), - new CodeSample( - ' ['parenthesis_brace_block']] - ), - new CodeSample( - ' ['return']] - ), - new CodeSample( - ' ['square_brace_block']] - ), - new CodeSample( - ' ['throw']] - ), - new CodeSample( - ' ['use']] - ), - new CodeSample( - ' ['switch', 'case', 'default']] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before BlankLineBeforeStatementFixer. - * Must run after ClassAttributesSeparationFixer, CombineConsecutiveUnsetsFixer, EmptyLoopBodyFixer, EmptyLoopConditionFixer, FunctionToConstantFixer, LongToShorthandOperatorFixer, ModernizeStrposFixer, NoEmptyCommentFixer, NoEmptyPhpdocFixer, NoEmptyStatementFixer, NoUnusedImportsFixer, NoUselessElseFixer, NoUselessReturnFixer, NoUselessSprintfFixer, PhpdocReadonlyClassCommentToKeywordFixer, StringLengthToEmptyFixer, YieldFromArrayToYieldsFixer. - */ - public function getPriority(): int - { - return -20; - } - - public function isCandidate(Tokens $tokens): bool - { - return true; - } - - /** - * @param _AutogeneratedInputConfiguration $configuration - */ - protected function configurePreNormalisation(array $configuration): void - { - if (isset($configuration['tokens']) && \in_array('use_trait', $configuration['tokens'], true)) { - Utils::triggerDeprecation(new \RuntimeException('Option "tokens: use_trait" used in `no_extra_blank_lines` rule is deprecated, use the rule `class_attributes_separation` with `elements: trait_import` instead.')); - } - } - - protected function configurePostNormalisation(): void - { - $tokensConfiguration = $this->configuration['tokens']; - - $this->tokenEqualsMap = []; - - if (\in_array('curly_brace_block', $tokensConfiguration, true)) { - $this->tokenEqualsMap['{'] = [$this, 'fixStructureOpenCloseIfMultiLine']; // i.e. not: CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN - } - - if (\in_array('parenthesis_brace_block', $tokensConfiguration, true)) { - $this->tokenEqualsMap['('] = [$this, 'fixStructureOpenCloseIfMultiLine']; // i.e. not: CT::T_BRACE_CLASS_INSTANTIATION_OPEN - } - - // Each item requires explicit array-like callable, otherwise PHPStan will complain about unused private methods. - $configMap = [ - 'attribute' => [CT::T_ATTRIBUTE_CLOSE, [$this, 'fixAfterToken']], - 'break' => [T_BREAK, [$this, 'fixAfterToken']], - 'case' => [T_CASE, [$this, 'fixAfterCaseToken']], - 'continue' => [T_CONTINUE, [$this, 'fixAfterToken']], - 'default' => [T_DEFAULT, [$this, 'fixAfterToken']], - 'extra' => [T_WHITESPACE, [$this, 'removeMultipleBlankLines']], - 'return' => [T_RETURN, [$this, 'fixAfterToken']], - 'square_brace_block' => [CT::T_ARRAY_SQUARE_BRACE_OPEN, [$this, 'fixStructureOpenCloseIfMultiLine']], - 'switch' => [T_SWITCH, [$this, 'fixAfterToken']], - 'throw' => [T_THROW, [$this, 'fixAfterThrowToken']], - 'use' => [T_USE, [$this, 'removeBetweenUse']], - 'use_trait' => [CT::T_USE_TRAIT, [$this, 'removeBetweenUse']], - ]; - - $this->tokenKindCallbackMap = []; - - foreach ($tokensConfiguration as $config) { - if (isset($configMap[$config])) { - $this->tokenKindCallbackMap[$configMap[$config][0]] = $configMap[$config][1]; - } - } - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->tokens = $tokens; - $this->tokensAnalyzer = new TokensAnalyzer($this->tokens); - - for ($index = $tokens->getSize() - 1; $index > 0; --$index) { - $this->fixByToken($tokens[$index], $index); - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('tokens', 'List of tokens to fix.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset(self::AVAILABLE_TOKENS)]) - ->setDefault(['extra']) - ->getOption(), - ]); - } - - /** - * @uses fixAfterToken() - * @uses fixAfterCaseToken() - * @uses fixAfterThrowToken() - * @uses fixStructureOpenCloseIfMultiLine() - * @uses removeBetweenUse() - * @uses removeMultipleBlankLines() - */ - private function fixByToken(Token $token, int $index): void - { - foreach ($this->tokenKindCallbackMap as $kind => $callback) { - if (!$token->isGivenKind($kind)) { - continue; - } - - \call_user_func_array($this->tokenKindCallbackMap[$token->getId()], [$index]); - - return; - } - - foreach ($this->tokenEqualsMap as $equals => $callback) { - if (!$token->equals($equals)) { - continue; - } - - \call_user_func_array($this->tokenEqualsMap[$token->getContent()], [$index]); - - return; - } - } - - private function removeBetweenUse(int $index): void - { - $next = $this->tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]); - - if (null === $next || $this->tokens[$next]->isGivenKind(T_CLOSE_TAG)) { - return; - } - - $nextUseCandidate = $this->tokens->getNextMeaningfulToken($next); - - if (null === $nextUseCandidate || !$this->tokens[$nextUseCandidate]->isGivenKind($this->tokens[$index]->getId()) || !$this->containsLinebreak($index, $nextUseCandidate)) { - return; - } - - $this->removeEmptyLinesAfterLineWithTokenAt($next); - } - - private function removeMultipleBlankLines(int $index): void - { - $expected = $this->tokens[$index - 1]->isGivenKind(T_OPEN_TAG) && Preg::match('/\R$/', $this->tokens[$index - 1]->getContent()) ? 1 : 2; - - $parts = Preg::split('/(.*\R)/', $this->tokens[$index]->getContent(), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - $count = \count($parts); - - if ($count > $expected) { - $this->tokens[$index] = new Token([T_WHITESPACE, implode('', \array_slice($parts, 0, $expected)).rtrim($parts[$count - 1], "\r\n")]); - } - } - - private function fixAfterToken(int $index): void - { - for ($i = $index - 1; $i > 0; --$i) { - if ($this->tokens[$i]->isGivenKind(T_FUNCTION) && $this->tokensAnalyzer->isLambda($i)) { - return; - } - - if ($this->tokens[$i]->isGivenKind(T_CLASS) && $this->tokensAnalyzer->isAnonymousClass($i)) { - return; - } - - if ($this->tokens[$i]->isWhitespace() && str_contains($this->tokens[$i]->getContent(), "\n")) { - break; - } - } - - $this->removeEmptyLinesAfterLineWithTokenAt($index); - } - - private function fixAfterCaseToken(int $index): void - { - if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required - $enumSwitchIndex = $this->tokens->getPrevTokenOfKind($index, [[T_SWITCH], [T_ENUM]]); - - if (!$this->tokens[$enumSwitchIndex]->isGivenKind(T_SWITCH)) { - return; - } - } - - $this->removeEmptyLinesAfterLineWithTokenAt($index); - } - - private function fixAfterThrowToken(int $index): void - { - $prevIndex = $this->tokens->getPrevMeaningfulToken($index); - - if (!$this->tokens[$prevIndex]->equalsAny([';', '{', '}', ':', [T_OPEN_TAG]])) { - return; - } - - if ($this->tokens[$prevIndex]->equals(':') && !SwitchAnalyzer::belongsToSwitch($this->tokens, $prevIndex)) { - return; - } - - $this->fixAfterToken($index); - } - - /** - * Remove white line(s) after the index of a block type, - * but only if the block is not on one line. - * - * @param int $index body start - */ - private function fixStructureOpenCloseIfMultiLine(int $index): void - { - $blockTypeInfo = Tokens::detectBlockType($this->tokens[$index]); - $bodyEnd = $this->tokens->findBlockEnd($blockTypeInfo['type'], $index); - - for ($i = $bodyEnd - 1; $i >= $index; --$i) { - if (str_contains($this->tokens[$i]->getContent(), "\n")) { - $this->removeEmptyLinesAfterLineWithTokenAt($i); - $this->removeEmptyLinesAfterLineWithTokenAt($index); - - break; - } - } - } - - private function removeEmptyLinesAfterLineWithTokenAt(int $index): void - { - // find the line break - $parenthesesDepth = 0; - $tokenCount = \count($this->tokens); - for ($end = $index; $end < $tokenCount; ++$end) { - if ($this->tokens[$end]->equals('(')) { - ++$parenthesesDepth; - - continue; - } - - if ($this->tokens[$end]->equals(')')) { - --$parenthesesDepth; - if ($parenthesesDepth < 0) { - return; - } - - continue; - } - - if ( - $this->tokens[$end]->equals('}') - || str_contains($this->tokens[$end]->getContent(), "\n") - ) { - break; - } - } - - if ($end === $tokenCount) { - return; // not found, early return - } - - $ending = $this->whitespacesConfig->getLineEnding(); - - for ($i = $end; $i < $tokenCount && $this->tokens[$i]->isWhitespace(); ++$i) { - $content = $this->tokens[$i]->getContent(); - - if (substr_count($content, "\n") < 1) { - continue; - } - - $newContent = Preg::replace('/^.*\R(\h*)$/s', $ending.'$1', $content); - - $this->tokens[$i] = new Token([T_WHITESPACE, $newContent]); - } - } - - private function containsLinebreak(int $startIndex, int $endIndex): bool - { - for ($i = $endIndex; $i > $startIndex; --$i) { - if (Preg::match('/\R/', $this->tokens[$i]->getContent())) { - return true; - } - } - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesAroundOffsetFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesAroundOffsetFixer.php deleted file mode 100644 index 1d8156ca..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesAroundOffsetFixer.php +++ /dev/null @@ -1,112 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Javier Spagnoletti - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * positions?: list<'inside'|'outside'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * positions: list<'inside'|'outside'> - * } - */ -final class NoSpacesAroundOffsetFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There MUST NOT be spaces around offset braces.', - [ - new CodeSample(" ['inside']]), - new CodeSample(" ['outside']]), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(['[', CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - foreach ($tokens as $index => $token) { - if (!$token->equalsAny(['[', [CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN]])) { - continue; - } - - if (\in_array('inside', $this->configuration['positions'], true)) { - if ($token->equals('[')) { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_INDEX_SQUARE_BRACE, $index); - } else { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE, $index); - } - - // remove space after opening `[` or `{` - if ($tokens[$index + 1]->isWhitespace(" \t")) { - $tokens->clearAt($index + 1); - } - - // remove space before closing `]` or `}` - if ($tokens[$endIndex - 1]->isWhitespace(" \t")) { - $tokens->clearAt($endIndex - 1); - } - } - - if (\in_array('outside', $this->configuration['positions'], true)) { - $prevNonWhitespaceIndex = $tokens->getPrevNonWhitespace($index); - if ($tokens[$prevNonWhitespaceIndex]->isComment()) { - continue; - } - - $tokens->removeLeadingWhitespace($index); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - $values = ['inside', 'outside']; - - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('positions', 'Whether spacing should be fixed inside and/or outside the offset braces.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset($values)]) - ->setDefault($values) - ->getOption(), - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesInsideParenthesisFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesInsideParenthesisFixer.php deleted file mode 100644 index d8507512..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoSpacesInsideParenthesisFixer.php +++ /dev/null @@ -1,75 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractProxyFixer; -use PhpCsFixer\Fixer\DeprecatedFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶4.3, ¶4.6, ¶5. - * - * @author Marc Aubé - * @author Dariusz Rumiński - * - * @deprecated in favor of SpacesInsideParenthesisFixer - */ -final class NoSpacesInsideParenthesisFixer extends AbstractProxyFixer implements DeprecatedFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'There MUST NOT be a space after the opening parenthesis. There MUST NOT be a space before the closing parenthesis.', - [ - new CodeSample("proxyFixers); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isTokenKindFound('('); - } - - protected function createProxyFixers(): array - { - return [new SpacesInsideParenthesesFixer()]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoTrailingWhitespaceFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoTrailingWhitespaceFixer.php deleted file mode 100644 index e05a9fdd..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoTrailingWhitespaceFixer.php +++ /dev/null @@ -1,104 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶2.3. - * - * Don't add trailing spaces at the end of non-blank lines. - * - * @author Fabien Potencier - * @author Dariusz Rumiński - */ -final class NoTrailingWhitespaceFixer extends AbstractFixer -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Remove trailing whitespace at the end of non-blank lines.', - [new CodeSample("= 0; --$index) { - $token = $tokens[$index]; - if ( - $token->isGivenKind(T_OPEN_TAG) - && $tokens->offsetExists($index + 1) - && $tokens[$index + 1]->isWhitespace() - && Preg::match('/(.*)\h$/', $token->getContent(), $openTagMatches) - && Preg::match('/^(\R)(.*)$/s', $tokens[$index + 1]->getContent(), $whitespaceMatches) - ) { - $tokens[$index] = new Token([T_OPEN_TAG, $openTagMatches[1].$whitespaceMatches[1]]); - $tokens->ensureWhitespaceAtIndex($index + 1, 0, $whitespaceMatches[2]); - - continue; - } - - if (!$token->isWhitespace()) { - continue; - } - - $lines = Preg::split('/(\R+)/', $token->getContent(), -1, PREG_SPLIT_DELIM_CAPTURE); - $linesSize = \count($lines); - - // fix only multiline whitespaces or singleline whitespaces at the end of file - if ($linesSize > 1 || !isset($tokens[$index + 1])) { - if (!$tokens[$index - 1]->isGivenKind(T_OPEN_TAG) || !Preg::match('/(.*)\R$/', $tokens[$index - 1]->getContent())) { - $lines[0] = rtrim($lines[0], " \t"); - } - - for ($i = 1; $i < $linesSize; ++$i) { - $trimmedLine = rtrim($lines[$i], " \t"); - if ('' !== $trimmedLine) { - $lines[$i] = $trimmedLine; - } - } - - $content = implode('', $lines); - if ('' !== $content) { - $tokens[$index] = new Token([$token->getId(), $content]); - } else { - $tokens->clearAt($index); - } - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoWhitespaceInBlankLineFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoWhitespaceInBlankLineFixer.php deleted file mode 100644 index 352ce7a8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/NoWhitespaceInBlankLineFixer.php +++ /dev/null @@ -1,89 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - */ -final class NoWhitespaceInBlankLineFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Remove trailing whitespace at the end of blank lines.', - [new CodeSample("isWhitespace()) { - $this->fixWhitespaceToken($tokens, $i); - } - } - } - - private function fixWhitespaceToken(Tokens $tokens, int $index): void - { - $content = $tokens[$index]->getContent(); - $lines = Preg::split("/(\r\n|\n)/", $content); - $lineCount = \count($lines); - - if ( - // fix T_WHITESPACES with at least 3 lines (eg `\n \n`) - $lineCount > 2 - // and T_WHITESPACES with at least 2 lines at the end of file or after open tag with linebreak - || ($lineCount > 0 && (!isset($tokens[$index + 1]) || $tokens[$index - 1]->isGivenKind(T_OPEN_TAG))) - ) { - $lMax = isset($tokens[$index + 1]) ? $lineCount - 1 : $lineCount; - - $lStart = 1; - if ($tokens[$index - 1]->isGivenKind(T_OPEN_TAG) && "\n" === substr($tokens[$index - 1]->getContent(), -1)) { - $lStart = 0; - } - - for ($l = $lStart; $l < $lMax; ++$l) { - $lines[$l] = Preg::replace('/^\h+$/', '', $lines[$l]); - } - $content = implode($this->whitespacesConfig->getLineEnding(), $lines); - $tokens->ensureWhitespaceAtIndex($index, 0, $content); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SingleBlankLineAtEofFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SingleBlankLineAtEofFixer.php deleted file mode 100644 index 6fbea69d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SingleBlankLineAtEofFixer.php +++ /dev/null @@ -1,64 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * A file must always end with a line endings character. - * - * Fixer for rules defined in PSR2 ¶2.2. - * - * @author Fabien Potencier - * @author Dariusz Rumiński - */ -final class SingleBlankLineAtEofFixer extends AbstractFixer implements WhitespacesAwareFixerInterface -{ - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'A PHP file without end tag must always end with a single empty line feed.', - [ - new CodeSample("count(); - - if ($count > 0 && !$tokens[$count - 1]->isGivenKind([T_INLINE_HTML, T_CLOSE_TAG, T_OPEN_TAG])) { - $tokens->ensureWhitespaceAtIndex($count - 1, 1, $this->whitespacesConfig->getLineEnding()); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SpacesInsideParenthesesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SpacesInsideParenthesesFixer.php deleted file mode 100644 index f5078c2b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/SpacesInsideParenthesesFixer.php +++ /dev/null @@ -1,223 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Fixer for rules defined in PSR2 ¶4.3, ¶4.6, ¶5. - * - * @author Marc Aubé - * @author Dariusz Rumiński - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * space?: 'none'|'single' - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * space: 'none'|'single' - * } - */ -final class SpacesInsideParenthesesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Parentheses must be declared using the configured whitespace.', - [ - new CodeSample(" 'none'] - ), - new CodeSample( - " 'single'] - ), - new CodeSample( - " 'single'] - ), - ], - 'By default there are not any additional spaces inside parentheses, however with `space=single` configuration option whitespace inside parentheses will be unified to single space.' - ); - } - - /** - * {@inheritdoc} - * - * Must run before FunctionToConstantFixer, GetClassToClassKeywordFixer, StringLengthToEmptyFixer. - * Must run after CombineConsecutiveIssetsFixer, CombineNestedDirnameFixer, IncrementStyleFixer, LambdaNotUsedImportFixer, ModernizeStrposFixer, NoUselessSprintfFixer, PowToExponentiationFixer. - */ - public function getPriority(): int - { - return 3; - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound(['(', CT::T_BRACE_CLASS_INSTANTIATION_OPEN]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - if ('none' === $this->configuration['space']) { - foreach ($tokens as $index => $token) { - if (!$token->equalsAny(['(', [CT::T_BRACE_CLASS_INSTANTIATION_OPEN]])) { - continue; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - // ignore parenthesis for T_ARRAY - if (null !== $prevIndex && $tokens[$prevIndex]->isGivenKind(T_ARRAY)) { - continue; - } - - $blockType = Tokens::detectBlockType($tokens[$index]); - $endIndex = $tokens->findBlockEnd($blockType['type'], $index); - - // remove space after opening `(` - if (!$tokens[$tokens->getNextNonWhitespace($index)]->isComment()) { - $this->removeSpaceAroundToken($tokens, $index + 1); - } - - // remove space before closing `)` if it is not `list($a, $b, )` case - if (!$tokens[$tokens->getPrevMeaningfulToken($endIndex)]->equals(',')) { - $this->removeSpaceAroundToken($tokens, $endIndex - 1); - } - } - } - - if ('single' === $this->configuration['space']) { - foreach ($tokens as $index => $token) { - if (!$token->equalsAny(['(', [CT::T_BRACE_CLASS_INSTANTIATION_OPEN]])) { - continue; - } - - $blockType = Tokens::detectBlockType($tokens[$index]); - $endParenthesisIndex = $tokens->findBlockEnd($blockType['type'], $index); - - // if not other content than spaces in block remove spaces - $blockContent = $this->getBlockContent($index, $endParenthesisIndex, $tokens); - if (1 === \count($blockContent) && \in_array(' ', $blockContent, true)) { - $this->removeSpaceAroundToken($tokens, $index + 1); - - continue; - } - - // don't process if the next token is `)` - $nextMeaningfulTokenIndex = $tokens->getNextMeaningfulToken($index); - if (')' === $tokens[$nextMeaningfulTokenIndex]->getContent()) { - continue; - } - - $afterParenthesisIndex = $tokens->getNextNonWhitespace($endParenthesisIndex); - $afterParenthesisToken = $tokens[$afterParenthesisIndex]; - - if ($afterParenthesisToken->isGivenKind(CT::T_USE_LAMBDA)) { - $useStartParenthesisIndex = $tokens->getNextTokenOfKind($afterParenthesisIndex, ['(']); - $useEndParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $useStartParenthesisIndex); - - // add single-line edge whitespaces inside use parentheses - $this->fixParenthesisInnerEdge($tokens, $useStartParenthesisIndex, $useEndParenthesisIndex); - } - - // add single-line edge whitespaces inside parameters list parentheses - $this->fixParenthesisInnerEdge($tokens, $index, $endParenthesisIndex); - } - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('space', 'Whether to have `single` or `none` space inside parentheses.')) - ->setAllowedValues(['none', 'single']) - ->setDefault('none') - ->getOption(), - ]); - } - - /** - * Remove spaces from token at a given index. - */ - private function removeSpaceAroundToken(Tokens $tokens, int $index): void - { - $token = $tokens[$index]; - - if ($token->isWhitespace() && !str_contains($token->getContent(), "\n")) { - $tokens->clearAt($index); - } - } - - private function fixParenthesisInnerEdge(Tokens $tokens, int $start, int $end): void - { - // fix white space before ')' - if ($tokens[$end - 1]->isWhitespace()) { - $content = $tokens[$end - 1]->getContent(); - if (' ' !== $content && !str_contains($content, "\n") && !$tokens[$tokens->getPrevNonWhitespace($end - 1)]->isComment()) { - $tokens[$end - 1] = new Token([T_WHITESPACE, ' ']); - } - } else { - $tokens->insertAt($end, new Token([T_WHITESPACE, ' '])); - } - - // fix white space after '(' - if ($tokens[$start + 1]->isWhitespace()) { - $content = $tokens[$start + 1]->getContent(); - if (' ' !== $content && !str_contains($content, "\n") && !$tokens[$tokens->getNextNonWhitespace($start + 1)]->isComment()) { - $tokens[$start + 1] = new Token([T_WHITESPACE, ' ']); - } - } else { - $tokens->insertAt($start + 1, new Token([T_WHITESPACE, ' '])); - } - } - - /** - * @return list - */ - private function getBlockContent(int $startIndex, int $endIndex, Tokens $tokens): array - { - // + 1 for ( - $contents = []; - for ($i = ($startIndex + 1); $i < $endIndex; ++$i) { - $contents[] = $tokens[$i]->getContent(); - } - - return $contents; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/StatementIndentationFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/StatementIndentationFixer.php deleted file mode 100644 index db33fa53..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/StatementIndentationFixer.php +++ /dev/null @@ -1,834 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\Fixer\Indentation; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\AlternativeSyntaxAnalyzer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * stick_comment_to_next_continuous_control_statement?: bool - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * stick_comment_to_next_continuous_control_statement: bool - * } - */ -final class StatementIndentationFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - use Indentation; - - private AlternativeSyntaxAnalyzer $alternativeSyntaxAnalyzer; - - private bool $bracesFixerCompatibility; - - public function __construct(bool $bracesFixerCompatibility = false) - { - parent::__construct(); - - $this->bracesFixerCompatibility = $bracesFixerCompatibility; - } - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Each statement must be indented.', - [ - new CodeSample( - ' false] - ), - new CodeSample( - ' true] - ), - ] - ); - } - - /** - * {@inheritdoc} - * - * Must run before HeredocIndentationFixer. - * Must run after BracesPositionFixer, ClassAttributesSeparationFixer, CurlyBracesPositionFixer, FullyQualifiedStrictTypesFixer, GlobalNamespaceImportFixer, MethodArgumentSpaceFixer, NoUselessElseFixer, YieldFromArrayToYieldsFixer. - */ - public function getPriority(): int - { - return -3; - } - - public function isCandidate(Tokens $tokens): bool - { - return true; - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('stick_comment_to_next_continuous_control_statement', 'Last comment of code block counts as comment for next block.')) - ->setAllowedTypes(['bool']) - ->setDefault(false) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $this->alternativeSyntaxAnalyzer = new AlternativeSyntaxAnalyzer(); - - $blockSignatureFirstTokens = [ - T_USE, - T_IF, - T_ELSE, - T_ELSEIF, - T_FOR, - T_FOREACH, - T_WHILE, - T_DO, - T_SWITCH, - T_CASE, - T_DEFAULT, - T_TRY, - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_EXTENDS, - T_IMPLEMENTS, - T_CONST, - ]; - $controlStructurePossibiblyWithoutBracesTokens = [ - T_IF, - T_ELSE, - T_ELSEIF, - T_FOR, - T_FOREACH, - T_WHILE, - T_DO, - ]; - if (\defined('T_MATCH')) { // @TODO: drop condition when PHP 8.0+ is required - $blockSignatureFirstTokens[] = T_MATCH; - } - - $blockFirstTokens = ['{', [CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN], [CT::T_USE_TRAIT], [CT::T_GROUP_IMPORT_BRACE_OPEN]]; - if (\defined('T_ATTRIBUTE')) { // @TODO: drop condition when PHP 8.0+ is required - $blockFirstTokens[] = [T_ATTRIBUTE]; - } - - $endIndex = \count($tokens) - 1; - if ($tokens[$endIndex]->isWhitespace()) { - --$endIndex; - } - - $lastIndent = $this->getLineIndentationWithBracesCompatibility( - $tokens, - 0, - $this->extractIndent($this->computeNewLineContent($tokens, 0)), - ); - - /** - * @var list $scopes - */ - $scopes = [ - [ - 'type' => 'block', - 'skip' => false, - 'end_index' => $endIndex, - 'end_index_inclusive' => true, - 'initial_indent' => $lastIndent, - 'is_indented_block' => false, - ], - ]; - - $previousLineInitialIndent = ''; - $previousLineNewIndent = ''; - $noBracesBlockStarts = []; - $alternativeBlockStarts = []; - $caseBlockStarts = []; - - foreach ($tokens as $index => $token) { - $currentScope = \count($scopes) - 1; - - if (isset($noBracesBlockStarts[$index])) { - $scopes[] = [ - 'type' => 'block', - 'skip' => false, - 'end_index' => $this->findStatementEndIndex($tokens, $index, \count($tokens) - 1), - 'end_index_inclusive' => true, - 'initial_indent' => $this->getLineIndentationWithBracesCompatibility($tokens, $index, $lastIndent), - 'is_indented_block' => true, - ]; - ++$currentScope; - } - - if ( - $token->equalsAny($blockFirstTokens) - || ($token->equals('(') && !$tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(T_ARRAY)) - || isset($alternativeBlockStarts[$index]) - || isset($caseBlockStarts[$index]) - ) { - $endIndexInclusive = true; - - if ($token->isGivenKind([T_EXTENDS, T_IMPLEMENTS])) { - $endIndex = $tokens->getNextTokenOfKind($index, ['{']); - } elseif ($token->isGivenKind(CT::T_USE_TRAIT)) { - $endIndex = $tokens->getNextTokenOfKind($index, [';']); - } elseif ($token->equals(':')) { - if (isset($caseBlockStarts[$index])) { - [$endIndex, $endIndexInclusive] = $this->findCaseBlockEnd($tokens, $index); - } elseif ($this->alternativeSyntaxAnalyzer->belongsToAlternativeSyntax($tokens, $index)) { - $endIndex = $this->alternativeSyntaxAnalyzer->findAlternativeSyntaxBlockEnd($tokens, $alternativeBlockStarts[$index]); - } - } elseif ($token->isGivenKind(CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN)) { - $endIndex = $tokens->getNextTokenOfKind($index, [[CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE]]); - } elseif ($token->isGivenKind(CT::T_GROUP_IMPORT_BRACE_OPEN)) { - $endIndex = $tokens->getNextTokenOfKind($index, [[CT::T_GROUP_IMPORT_BRACE_CLOSE]]); - } elseif ($token->equals('{')) { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - } elseif ($token->equals('(')) { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - } else { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); - } - - if ('block_signature' === $scopes[$currentScope]['type']) { - $initialIndent = $scopes[$currentScope]['initial_indent']; - } else { - $initialIndent = $this->getLineIndentationWithBracesCompatibility($tokens, $index, $lastIndent); - } - - $skip = false; - if ($this->bracesFixerCompatibility) { - $prevIndex = $tokens->getPrevMeaningfulToken($index); - if (null !== $prevIndex) { - $prevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - } - if (null !== $prevIndex && $tokens[$prevIndex]->isGivenKind([T_FUNCTION, T_FN])) { - $skip = true; - } - } - - $scopes[] = [ - 'type' => 'block', - 'skip' => $skip, - 'end_index' => $endIndex, - 'end_index_inclusive' => $endIndexInclusive, - 'initial_indent' => $initialIndent, - 'is_indented_block' => true, - ]; - ++$currentScope; - - while ($index >= $scopes[$currentScope]['end_index']) { - array_pop($scopes); - - --$currentScope; - } - - continue; - } - - if ( - $token->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN) - || ($token->equals('(') && $tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(T_ARRAY)) - ) { - $blockType = $token->equals('(') ? Tokens::BLOCK_TYPE_PARENTHESIS_BRACE : Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE; - - $scopes[] = [ - 'type' => 'statement', - 'skip' => true, - 'end_index' => $tokens->findBlockEnd($blockType, $index), - 'end_index_inclusive' => true, - 'initial_indent' => $previousLineInitialIndent, - 'new_indent' => $previousLineNewIndent, - 'is_indented_block' => false, - ]; - - continue; - } - - $isPropertyStart = $this->isPropertyStart($tokens, $index); - if ($isPropertyStart || $token->isGivenKind($blockSignatureFirstTokens)) { - $lastWhitespaceIndex = null; - $closingParenthesisIndex = null; - - for ($endIndex = $index + 1, $max = \count($tokens); $endIndex < $max; ++$endIndex) { - $endToken = $tokens[$endIndex]; - - if ($endToken->equals('(')) { - $closingParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $endIndex); - $endIndex = $closingParenthesisIndex; - - continue; - } - - if ($endToken->equalsAny(['{', ';', [T_DOUBLE_ARROW], [T_IMPLEMENTS]])) { - break; - } - - if ($endToken->equals(':')) { - if ($token->isGivenKind([T_CASE, T_DEFAULT])) { - $caseBlockStarts[$endIndex] = $index; - } else { - $alternativeBlockStarts[$endIndex] = $index; - } - - break; - } - - if (!$token->isGivenKind($controlStructurePossibiblyWithoutBracesTokens)) { - continue; - } - - if ($endToken->isWhitespace()) { - $lastWhitespaceIndex = $endIndex; - - continue; - } - - if (!$endToken->isComment()) { - $noBraceBlockStartIndex = $lastWhitespaceIndex ?? $endIndex; - $noBracesBlockStarts[$noBraceBlockStartIndex] = true; - - $endIndex = $closingParenthesisIndex ?? $index; - - break; - } - } - - $scopes[] = [ - 'type' => 'block_signature', - 'skip' => false, - 'end_index' => $endIndex, - 'end_index_inclusive' => true, - 'initial_indent' => $this->getLineIndentationWithBracesCompatibility($tokens, $index, $lastIndent), - 'is_indented_block' => $isPropertyStart || $token->isGivenKind([T_EXTENDS, T_IMPLEMENTS, T_CONST]), - ]; - - continue; - } - - if ($token->isGivenKind(T_FUNCTION)) { - $endIndex = $index + 1; - - for ($max = \count($tokens); $endIndex < $max; ++$endIndex) { - if ($tokens[$endIndex]->equals('(')) { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $endIndex); - - continue; - } - - if ($tokens[$endIndex]->equalsAny(['{', ';'])) { - break; - } - } - - $scopes[] = [ - 'type' => 'block_signature', - 'skip' => false, - 'end_index' => $endIndex, - 'end_index_inclusive' => true, - 'initial_indent' => $this->getLineIndentationWithBracesCompatibility($tokens, $index, $lastIndent), - 'is_indented_block' => false, - ]; - - continue; - } - - if ( - $token->isWhitespace() - || ($index > 0 && $tokens[$index - 1]->isGivenKind(T_OPEN_TAG)) - ) { - $previousOpenTagContent = $tokens[$index - 1]->isGivenKind(T_OPEN_TAG) - ? Preg::replace('/\S/', '', $tokens[$index - 1]->getContent()) - : ''; - - $content = $previousOpenTagContent.($token->isWhitespace() ? $token->getContent() : ''); - - if (!Preg::match('/\R/', $content)) { - continue; - } - - $nextToken = $tokens[$index + 1] ?? null; - - if ( - $this->bracesFixerCompatibility - && null !== $nextToken - && $nextToken->isComment() - && !$this->isCommentWithFixableIndentation($tokens, $index + 1) - ) { - continue; - } - - if ('block' === $scopes[$currentScope]['type'] || 'block_signature' === $scopes[$currentScope]['type']) { - $indent = false; - - if ($scopes[$currentScope]['is_indented_block']) { - $firstNonWhitespaceTokenIndex = null; - $nextNewlineIndex = null; - for ($searchIndex = $index + 1, $max = \count($tokens); $searchIndex < $max; ++$searchIndex) { - $searchToken = $tokens[$searchIndex]; - - if (!$searchToken->isWhitespace()) { - if (null === $firstNonWhitespaceTokenIndex) { - $firstNonWhitespaceTokenIndex = $searchIndex; - } - - continue; - } - - if (Preg::match('/\R/', $searchToken->getContent())) { - $nextNewlineIndex = $searchIndex; - - break; - } - } - - $endIndex = $scopes[$currentScope]['end_index']; - - if (!$scopes[$currentScope]['end_index_inclusive']) { - ++$endIndex; - } - - if ( - (null !== $firstNonWhitespaceTokenIndex && $firstNonWhitespaceTokenIndex < $endIndex) - || (null !== $nextNewlineIndex && $nextNewlineIndex < $endIndex) - ) { - if ( - // do we touch whitespace directly before comment... - $tokens[$firstNonWhitespaceTokenIndex]->isGivenKind(T_COMMENT) - // ...and afterwards, there is only comment or `}` - && $tokens[$tokens->getNextMeaningfulToken($firstNonWhitespaceTokenIndex)]->equals('}') - ) { - if ( - // ... and the comment was only content in docblock - $tokens[$tokens->getPrevMeaningfulToken($firstNonWhitespaceTokenIndex)]->equals('{') - ) { - $indent = true; - } else { - // or it was dedicated comment for next control loop - // ^^ we need to check if there is a control group afterwards, and in that case don't make extra indent level - $nextIndex = $tokens->getNextMeaningfulToken($firstNonWhitespaceTokenIndex); - $nextNextIndex = $tokens->getNextMeaningfulToken($nextIndex); - - if (null !== $nextNextIndex && $tokens[$nextNextIndex]->isGivenKind([T_ELSE, T_ELSEIF])) { - $indent = true !== $this->configuration['stick_comment_to_next_continuous_control_statement']; - } else { - $indent = true; - } - } - } else { - $indent = true; - } - } - } - - $previousLineInitialIndent = $this->extractIndent($content); - - if ($scopes[$currentScope]['skip']) { - $whitespaces = $previousLineInitialIndent; - } else { - $whitespaces = $scopes[$currentScope]['initial_indent'].($indent ? $this->whitespacesConfig->getIndent() : ''); - } - - $content = Preg::replace( - '/(\R+)\h*$/', - '$1'.$whitespaces, - $content - ); - - $previousLineNewIndent = $this->extractIndent($content); - } else { - $content = Preg::replace( - '/(\R)'.$scopes[$currentScope]['initial_indent'].'(\h*)$/D', - '$1'.$scopes[$currentScope]['new_indent'].'$2', - $content - ); - } - - $lastIndent = $this->extractIndent($content); - - if ('' !== $previousOpenTagContent) { - $content = Preg::replace("/^{$previousOpenTagContent}/", '', $content); - } - - if ('' !== $content) { - $tokens->ensureWhitespaceAtIndex($index, 0, $content); - } elseif ($token->isWhitespace()) { - $tokens->clearAt($index); - } - - if (null !== $nextToken && $nextToken->isComment()) { - $tokens[$index + 1] = new Token([ - $nextToken->getId(), - Preg::replace( - '/(\R)'.preg_quote($previousLineInitialIndent, '/').'(\h*\S+.*)/', - '$1'.$previousLineNewIndent.'$2', - $nextToken->getContent() - ), - ]); - } - - if ($token->isWhitespace()) { - continue; - } - } - - if ($this->isNewLineToken($tokens, $index)) { - $lastIndent = $this->extractIndent($this->computeNewLineContent($tokens, $index)); - } - - while ($index >= $scopes[$currentScope]['end_index']) { - array_pop($scopes); - - if ([] === $scopes) { - return; - } - - --$currentScope; - } - - if ($token->isComment() || $token->equalsAny([';', ',', '}', [T_OPEN_TAG], [T_CLOSE_TAG], [CT::T_ATTRIBUTE_CLOSE]])) { - continue; - } - - if ('statement' !== $scopes[$currentScope]['type'] && 'block_signature' !== $scopes[$currentScope]['type']) { - $endIndex = $this->findStatementEndIndex($tokens, $index, $scopes[$currentScope]['end_index']); - - if ($endIndex === $index) { - continue; - } - - $scopes[] = [ - 'type' => 'statement', - 'skip' => false, - 'end_index' => $endIndex, - 'end_index_inclusive' => false, - 'initial_indent' => $previousLineInitialIndent, - 'new_indent' => $previousLineNewIndent, - 'is_indented_block' => true, - ]; - } - } - } - - private function findStatementEndIndex(Tokens $tokens, int $index, int $parentScopeEndIndex): int - { - $endIndex = null; - - $ifLevel = 0; - $doWhileLevel = 0; - for ($searchEndIndex = $index; $searchEndIndex <= $parentScopeEndIndex; ++$searchEndIndex) { - $searchEndToken = $tokens[$searchEndIndex]; - - if ( - $searchEndToken->isGivenKind(T_IF) - && !$tokens[$tokens->getPrevMeaningfulToken($searchEndIndex)]->isGivenKind(T_ELSE) - ) { - ++$ifLevel; - - continue; - } - - if ($searchEndToken->isGivenKind(T_DO)) { - ++$doWhileLevel; - - continue; - } - - if ($searchEndToken->equalsAny(['(', '{', [CT::T_ARRAY_SQUARE_BRACE_OPEN]])) { - if ($searchEndToken->equals('(')) { - $blockType = Tokens::BLOCK_TYPE_PARENTHESIS_BRACE; - } elseif ($searchEndToken->equals('{')) { - $blockType = Tokens::BLOCK_TYPE_CURLY_BRACE; - } else { - $blockType = Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE; - } - - $searchEndIndex = $tokens->findBlockEnd($blockType, $searchEndIndex); - $searchEndToken = $tokens[$searchEndIndex]; - } - - if (!$searchEndToken->equalsAny([';', ',', '}', [T_CLOSE_TAG]])) { - continue; - } - - $controlStructureContinuationIndex = $tokens->getNextMeaningfulToken($searchEndIndex); - - if ( - $ifLevel > 0 - && null !== $controlStructureContinuationIndex - && $tokens[$controlStructureContinuationIndex]->isGivenKind([T_ELSE, T_ELSEIF]) - ) { - if ( - $tokens[$controlStructureContinuationIndex]->isGivenKind(T_ELSE) - && !$tokens[$tokens->getNextMeaningfulToken($controlStructureContinuationIndex)]->isGivenKind(T_IF) - ) { - --$ifLevel; - } - - $searchEndIndex = $controlStructureContinuationIndex; - - continue; - } - - if ( - $doWhileLevel > 0 - && null !== $controlStructureContinuationIndex - && $tokens[$controlStructureContinuationIndex]->isGivenKind([T_WHILE]) - ) { - --$doWhileLevel; - $searchEndIndex = $controlStructureContinuationIndex; - - continue; - } - - $endIndex = $tokens->getPrevNonWhitespace($searchEndIndex); - - break; - } - - return $endIndex ?? $tokens->getPrevMeaningfulToken($parentScopeEndIndex); - } - - /** - * @return array{int, bool} - */ - private function findCaseBlockEnd(Tokens $tokens, int $index): array - { - for ($max = \count($tokens); $index < $max; ++$index) { - if ($tokens[$index]->isGivenKind(T_SWITCH)) { - $braceIndex = $tokens->getNextMeaningfulToken( - $tokens->findBlockEnd( - Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, - $tokens->getNextMeaningfulToken($index) - ) - ); - - if ($tokens[$braceIndex]->equals(':')) { - $index = $this->alternativeSyntaxAnalyzer->findAlternativeSyntaxBlockEnd($tokens, $index); - } else { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $braceIndex); - } - - continue; - } - - if ($tokens[$index]->equals('{')) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - - continue; - } - - if ($tokens[$index]->equalsAny([[T_CASE], [T_DEFAULT]])) { - return [$index, true]; - } - - if ($tokens[$index]->equalsAny(['}', [T_ENDSWITCH]])) { - return [$tokens->getPrevNonWhitespace($index), false]; - } - } - - throw new \LogicException('End of case block not found.'); - } - - private function getLineIndentationWithBracesCompatibility(Tokens $tokens, int $index, string $regularIndent): string - { - if ( - $this->bracesFixerCompatibility - && $tokens[$index]->isGivenKind(T_OPEN_TAG) - && Preg::match('/\R/', $tokens[$index]->getContent()) - && isset($tokens[$index + 1]) - && $tokens[$index + 1]->isWhitespace() - && Preg::match('/\h+$/D', $tokens[$index + 1]->getContent()) - ) { - return Preg::replace('/.*?(\h+)$/sD', '$1', $tokens[$index + 1]->getContent()); - } - - return $regularIndent; - } - - /** - * Returns whether the token at given index is the last token in a property - * declaration before the type or the name of that property. - */ - private function isPropertyStart(Tokens $tokens, int $index): bool - { - $propertyKeywords = [T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_STATIC]; - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $propertyKeywords[] = T_READONLY; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - if ( - null === $nextIndex - || $tokens[$nextIndex]->isGivenKind($propertyKeywords) - || $tokens[$nextIndex]->isGivenKind([T_CONST, T_FUNCTION]) - ) { - return false; - } - - while ($tokens[$index]->isGivenKind($propertyKeywords)) { - if ($tokens[$index]->isGivenKind([T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE])) { - return true; - } - - $index = $tokens->getPrevMeaningfulToken($index); - } - - return false; - } - - /** - * Returns whether the token at given index is a comment whose indentation - * can be fixed. - * - * Indentation of a comment is not changed when the comment is part of a - * multi-line message whose lines are all single-line comments and at least - * one line has meaningful content. - */ - private function isCommentWithFixableIndentation(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->isComment()) { - return false; - } - - if (str_starts_with($tokens[$index]->getContent(), '/*')) { - return true; - } - - $indent = preg_quote($this->whitespacesConfig->getIndent(), '~'); - - if (Preg::match("~^(//|#)({$indent}.*)?$~", $tokens[$index]->getContent())) { - return false; - } - - $firstCommentIndex = $index; - while (true) { - $firstCommentCandidateIndex = $this->getSiblingContinuousSingleLineComment($tokens, $firstCommentIndex, false); - if (null === $firstCommentCandidateIndex) { - break; - } - - $firstCommentIndex = $firstCommentCandidateIndex; - } - - $lastCommentIndex = $index; - while (true) { - $lastCommentCandidateIndex = $this->getSiblingContinuousSingleLineComment($tokens, $lastCommentIndex, true); - if (null === $lastCommentCandidateIndex) { - break; - } - - $lastCommentIndex = $lastCommentCandidateIndex; - } - - if ($firstCommentIndex === $lastCommentIndex) { - return true; - } - - for ($i = $firstCommentIndex + 1; $i < $lastCommentIndex; ++$i) { - if (!$tokens[$i]->isWhitespace() && !$tokens[$i]->isComment()) { - return false; - } - } - - return true; - } - - private function getSiblingContinuousSingleLineComment(Tokens $tokens, int $index, bool $after): ?int - { - $siblingIndex = $index; - do { - if ($after) { - $siblingIndex = $tokens->getNextTokenOfKind($siblingIndex, [[T_COMMENT]]); - } else { - $siblingIndex = $tokens->getPrevTokenOfKind($siblingIndex, [[T_COMMENT]]); - } - - if (null === $siblingIndex) { - return null; - } - } while (str_starts_with($tokens[$siblingIndex]->getContent(), '/*')); - - $newLines = 0; - for ($i = min($siblingIndex, $index) + 1, $max = max($siblingIndex, $index); $i < $max; ++$i) { - if ($tokens[$i]->isWhitespace() && Preg::match('/\R/', $tokens[$i]->getContent())) { - if (1 === $newLines || Preg::match('/\R.*\R/', $tokens[$i]->getContent())) { - return null; - } - - ++$newLines; - } - } - - return $siblingIndex; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypeDeclarationSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypeDeclarationSpacesFixer.php deleted file mode 100644 index b07514e1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypeDeclarationSpacesFixer.php +++ /dev/null @@ -1,212 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\AllowedValueSubset; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author Dariusz Rumiński - * @author John Paul E. Balandan, CPA - * - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * elements?: list<'function'|'property'> - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * elements: list<'function'|'property'> - * } - */ -final class TypeDeclarationSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'Ensure single space between a variable and its type declaration in function arguments and properties.', - [ - new CodeSample( - ' (string) $c; - } -} -', - ['elements' => ['function']] - ), - new CodeSample( - ' ['property']] - ), - ] - ); - } - - public function isCandidate(Tokens $tokens): bool - { - return $tokens->isAnyTokenKindsFound([...Token::getClassyTokenKinds(), T_FN, T_FUNCTION]); - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('elements', 'Structural elements where the spacing after the type declaration should be fixed.')) - ->setAllowedTypes(['string[]']) - ->setAllowedValues([new AllowedValueSubset(['function', 'property'])]) - ->setDefault(['function', 'property']) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $functionsAnalyzer = new FunctionsAnalyzer(); - - foreach (array_reverse($this->getElements($tokens), true) as $index => $type) { - if ('property' === $type && \in_array('property', $this->configuration['elements'], true)) { - $this->ensureSingleSpaceAtPropertyTypehint($tokens, $index); - - continue; - } - - if ('method' === $type && \in_array('function', $this->configuration['elements'], true)) { - $this->ensureSingleSpaceAtFunctionArgumentTypehint($functionsAnalyzer, $tokens, $index); - - // implicit continue; - } - } - } - - /** - * @return array - * - * @phpstan-return array - */ - private function getElements(Tokens $tokens): array - { - $tokensAnalyzer = new TokensAnalyzer($tokens); - - $elements = array_map( - static fn (array $element): string => $element['type'], - array_filter( - $tokensAnalyzer->getClassyElements(), - static fn (array $element): bool => \in_array($element['type'], ['method', 'property'], true) - ) - ); - - foreach ($tokens as $index => $token) { - if ( - $token->isGivenKind(T_FN) - || ($token->isGivenKind(T_FUNCTION) && !isset($elements[$index])) - ) { - $elements[$index] = 'method'; - } - } - - return $elements; - } - - private function ensureSingleSpaceAtFunctionArgumentTypehint(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index): void - { - foreach (array_reverse($functionsAnalyzer->getFunctionArguments($tokens, $index)) as $argumentInfo) { - $argumentType = $argumentInfo->getTypeAnalysis(); - - if (null === $argumentType) { - continue; - } - - $tokens->ensureWhitespaceAtIndex($argumentType->getEndIndex() + 1, 0, ' '); - } - } - - private function ensureSingleSpaceAtPropertyTypehint(Tokens $tokens, int $index): void - { - $propertyIndex = $index; - $propertyModifiers = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_STATIC, T_VAR]; - - if (\defined('T_READONLY')) { - $propertyModifiers[] = T_READONLY; // @TODO drop condition when PHP 8.1 is supported - } - - do { - $index = $tokens->getPrevMeaningfulToken($index); - } while (!$tokens[$index]->isGivenKind($propertyModifiers)); - - $propertyType = $this->collectTypeAnalysis($tokens, $index, $propertyIndex); - - if (null === $propertyType) { - return; - } - - $tokens->ensureWhitespaceAtIndex($propertyType->getEndIndex() + 1, 0, ' '); - } - - private function collectTypeAnalysis(Tokens $tokens, int $startIndex, int $endIndex): ?TypeAnalysis - { - $type = ''; - $typeStartIndex = $tokens->getNextMeaningfulToken($startIndex); - $typeEndIndex = $typeStartIndex; - - for ($i = $typeStartIndex; $i < $endIndex; ++$i) { - if ($tokens[$i]->isWhitespace() || $tokens[$i]->isComment()) { - continue; - } - - $type .= $tokens[$i]->getContent(); - $typeEndIndex = $i; - } - - return '' !== $type ? new TypeAnalysis($type, $typeStartIndex, $typeEndIndex) : null; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypesSpacesFixer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypesSpacesFixer.php deleted file mode 100644 index 538c221f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/TypesSpacesFixer.php +++ /dev/null @@ -1,173 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer\Whitespace; - -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\ConfigurableFixerTrait; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver; -use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; -use PhpCsFixer\FixerConfiguration\FixerOptionBuilder; -use PhpCsFixer\FixerDefinition\CodeSample; -use PhpCsFixer\FixerDefinition\FixerDefinition; -use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; -use PhpCsFixer\FixerDefinition\VersionSpecification; -use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> - * - * @phpstan-type _AutogeneratedInputConfiguration array{ - * space?: 'none'|'single', - * space_multiple_catch?: 'none'|'single'|null - * } - * @phpstan-type _AutogeneratedComputedConfiguration array{ - * space: 'none'|'single', - * space_multiple_catch: 'none'|'single'|null - * } - */ -final class TypesSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface -{ - /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */ - use ConfigurableFixerTrait; - - public function getDefinition(): FixerDefinitionInterface - { - return new FixerDefinition( - 'A single space or none should be around union type and intersection type operators.', - [ - new CodeSample( - " 'single'] - ), - new VersionSpecificCodeSample( - "isAnyTokenKindsFound([CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION]); - } - - protected function configurePostNormalisation(): void - { - if (!isset($this->configuration['space_multiple_catch'])) { - $this->configuration = [ - 'space' => $this->configuration['space'], - 'space_multiple_catch' => $this->configuration['space'], - ]; - } - } - - protected function createConfigurationDefinition(): FixerConfigurationResolverInterface - { - return new FixerConfigurationResolver([ - (new FixerOptionBuilder('space', 'Spacing to apply around union type and intersection type operators.')) - ->setAllowedValues(['none', 'single']) - ->setDefault('none') - ->getOption(), - (new FixerOptionBuilder('space_multiple_catch', 'Spacing to apply around type operator when catching exceptions of multiple types, use `null` to follow the value configured for `space`.')) - ->setAllowedValues(['none', 'single', null]) - ->setDefault(null) - ->getOption(), - ]); - } - - protected function applyFix(\SplFileInfo $file, Tokens $tokens): void - { - $tokenCount = $tokens->count() - 1; - - for ($index = 0; $index < $tokenCount; ++$index) { - if ($tokens[$index]->isGivenKind([CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION])) { - $tokenCount += $this->fixSpacing($tokens, $index, 'single' === $this->configuration['space']); - - continue; - } - - if ($tokens[$index]->isGivenKind(T_CATCH)) { - while (true) { - $index = $tokens->getNextTokenOfKind($index, [')', [CT::T_TYPE_ALTERNATION]]); - - if ($tokens[$index]->equals(')')) { - break; - } - - $tokenCount += $this->fixSpacing($tokens, $index, 'single' === $this->configuration['space_multiple_catch']); - } - - // implicit continue - } - } - } - - private function fixSpacing(Tokens $tokens, int $index, bool $singleSpace): int - { - if (!$singleSpace) { - $this->ensureNoSpace($tokens, $index + 1); - $this->ensureNoSpace($tokens, $index - 1); - - return 0; - } - - $addedTokenCount = 0; - $addedTokenCount += $this->ensureSingleSpace($tokens, $index + 1, 0); - $addedTokenCount += $this->ensureSingleSpace($tokens, $index - 1, 1); - - return $addedTokenCount; - } - - private function ensureSingleSpace(Tokens $tokens, int $index, int $offset): int - { - if (!$tokens[$index]->isWhitespace()) { - $tokens->insertSlices([$index + $offset => new Token([T_WHITESPACE, ' '])]); - - return 1; - } - - if (' ' !== $tokens[$index]->getContent() && !Preg::match('/\R/', $tokens[$index]->getContent())) { - $tokens[$index] = new Token([T_WHITESPACE, ' ']); - } - - return 0; - } - - private function ensureNoSpace(Tokens $tokens, int $index): void - { - if ($tokens[$index]->isWhitespace() && !Preg::match('/\R/', $tokens[$index]->getContent())) { - $tokens->clearAt($index); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/WhitespacesAwareFixerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/WhitespacesAwareFixerInterface.php deleted file mode 100644 index c03a3e78..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Fixer/WhitespacesAwareFixerInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Fixer; - -use PhpCsFixer\WhitespacesFixerConfig; - -/** - * @author Dariusz Rumiński - */ -interface WhitespacesAwareFixerInterface extends FixerInterface -{ - public function setWhitespacesConfig(WhitespacesFixerConfig $config): void; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOption.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOption.php deleted file mode 100644 index 87f2eac4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOption.php +++ /dev/null @@ -1,75 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -/** - * @author ntzm - * - * @readonly - * - * @internal - */ -final class AliasedFixerOption implements FixerOptionInterface -{ - private FixerOptionInterface $fixerOption; - - private string $alias; - - public function __construct(FixerOptionInterface $fixerOption, string $alias) - { - $this->fixerOption = $fixerOption; - $this->alias = $alias; - } - - public function getAlias(): string - { - return $this->alias; - } - - public function getName(): string - { - return $this->fixerOption->getName(); - } - - public function getDescription(): string - { - return $this->fixerOption->getDescription(); - } - - public function hasDefault(): bool - { - return $this->fixerOption->hasDefault(); - } - - public function getDefault() - { - return $this->fixerOption->getDefault(); - } - - public function getAllowedTypes(): ?array - { - return $this->fixerOption->getAllowedTypes(); - } - - public function getAllowedValues(): ?array - { - return $this->fixerOption->getAllowedValues(); - } - - public function getNormalizer(): ?\Closure - { - return $this->fixerOption->getNormalizer(); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOptionBuilder.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOptionBuilder.php deleted file mode 100644 index 13bb3faa..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AliasedFixerOptionBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -/** - * @author ntzm - * - * @internal - */ -final class AliasedFixerOptionBuilder -{ - private FixerOptionBuilder $optionBuilder; - - private string $alias; - - public function __construct(FixerOptionBuilder $optionBuilder, string $alias) - { - $this->optionBuilder = $optionBuilder; - $this->alias = $alias; - } - - /** - * @param mixed $default - */ - public function setDefault($default): self - { - $this->optionBuilder->setDefault($default); - - return $this; - } - - /** - * @param list $allowedTypes - */ - public function setAllowedTypes(array $allowedTypes): self - { - $this->optionBuilder->setAllowedTypes($allowedTypes); - - return $this; - } - - /** - * @param list $allowedValues - */ - public function setAllowedValues(array $allowedValues): self - { - $this->optionBuilder->setAllowedValues($allowedValues); - - return $this; - } - - public function setNormalizer(\Closure $normalizer): self - { - $this->optionBuilder->setNormalizer($normalizer); - - return $this; - } - - public function getOption(): AliasedFixerOption - { - return new AliasedFixerOption( - $this->optionBuilder->getOption(), - $this->alias - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AllowedValueSubset.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AllowedValueSubset.php deleted file mode 100644 index 4f328974..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/AllowedValueSubset.php +++ /dev/null @@ -1,65 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -/** - * @readonly - * - * @internal - */ -final class AllowedValueSubset -{ - /** - * @var list - */ - private array $allowedValues; - - /** - * @param list $allowedValues - */ - public function __construct(array $allowedValues) - { - sort($allowedValues, SORT_FLAG_CASE | SORT_STRING); - $this->allowedValues = $allowedValues; - } - - /** - * Checks whether the given values are a subset of the allowed ones. - * - * @param mixed $values the value to validate - */ - public function __invoke($values): bool - { - if (!\is_array($values)) { - return false; - } - - foreach ($values as $value) { - if (!\in_array($value, $this->allowedValues, true)) { - return false; - } - } - - return true; - } - - /** - * @return list - */ - public function getAllowedValues(): array - { - return $this->allowedValues; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOption.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOption.php deleted file mode 100644 index c2ea366a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOption.php +++ /dev/null @@ -1,74 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -/** - * @readonly - */ -final class DeprecatedFixerOption implements DeprecatedFixerOptionInterface -{ - private FixerOptionInterface $option; - - private string $deprecationMessage; - - public function __construct(FixerOptionInterface $option, string $deprecationMessage) - { - $this->option = $option; - $this->deprecationMessage = $deprecationMessage; - } - - public function getName(): string - { - return $this->option->getName(); - } - - public function getDescription(): string - { - return $this->option->getDescription(); - } - - public function hasDefault(): bool - { - return $this->option->hasDefault(); - } - - /** - * @return mixed - */ - public function getDefault() - { - return $this->option->getDefault(); - } - - public function getAllowedTypes(): ?array - { - return $this->option->getAllowedTypes(); - } - - public function getAllowedValues(): ?array - { - return $this->option->getAllowedValues(); - } - - public function getNormalizer(): ?\Closure - { - return $this->option->getNormalizer(); - } - - public function getDeprecationMessage(): string - { - return $this->deprecationMessage; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOptionInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOptionInterface.php deleted file mode 100644 index d847aea3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/DeprecatedFixerOptionInterface.php +++ /dev/null @@ -1,20 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -interface DeprecatedFixerOptionInterface extends FixerOptionInterface -{ - public function getDeprecationMessage(): string; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolver.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolver.php deleted file mode 100644 index 24611144..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolver.php +++ /dev/null @@ -1,152 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -use PhpCsFixer\Preg; -use PhpCsFixer\Utils; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; -use Symfony\Component\OptionsResolver\OptionsResolver; - -/** - * @readonly - */ -final class FixerConfigurationResolver implements FixerConfigurationResolverInterface -{ - /** - * @var list - * - * @readonly - */ - private array $options; - - /** - * @param iterable $options - */ - public function __construct(iterable $options) - { - $fixerOptionSorter = new FixerOptionSorter(); - $this->validateOptions($options); - - $this->options = $fixerOptionSorter->sort($options); - - if (0 === \count($this->options)) { - throw new \LogicException('Options cannot be empty.'); - } - } - - public function getOptions(): array - { - return $this->options; - } - - public function resolve(array $configuration): array - { - $resolver = new OptionsResolver(); - - foreach ($this->options as $option) { - $name = $option->getName(); - - if ($option instanceof AliasedFixerOption) { - $alias = $option->getAlias(); - - if (\array_key_exists($alias, $configuration)) { - if (\array_key_exists($name, $configuration)) { - throw new InvalidOptionsException(\sprintf('Aliased option "%s"/"%s" is passed multiple times.', $name, $alias)); - } - - Utils::triggerDeprecation(new \RuntimeException(\sprintf( - 'Option "%s" is deprecated, use "%s" instead.', - $alias, - $name - ))); - - $configuration[$name] = $configuration[$alias]; - unset($configuration[$alias]); - } - } - - if ($option->hasDefault()) { - $resolver->setDefault($name, $option->getDefault()); - } else { - $resolver->setRequired($name); - } - - $allowedValues = $option->getAllowedValues(); - if (null !== $allowedValues) { - foreach ($allowedValues as &$allowedValue) { - if (\is_object($allowedValue) && \is_callable($allowedValue)) { - $allowedValue = static fn (/* mixed */ $values) => $allowedValue($values); - } - } - - $resolver->setAllowedValues($name, $allowedValues); - } - - $allowedTypes = $option->getAllowedTypes(); - if (null !== $allowedTypes) { - $allowedTypesNormalised = array_map( - static function (string $type): string { - // Symfony OptionsResolver doesn't support `array` natively, let's simplify the type - $matches = []; - if (true === Preg::match('/array<\w+,\s*(\??[\w\'|]+)>/', $type, $matches)) { - if ('?' === $matches[1][0]) { - return 'array'; - } - - if ("'" === $matches[1][0]) { - return 'string[]'; - } - - return $matches[1].'[]'; - } - - // Symfony OptionsResolver doesn't support 'class-string' natively, let's simplify the type - return str_replace('class-string', 'string', $type); - }, - $allowedTypes, - ); - - $resolver->setAllowedTypes($name, $allowedTypesNormalised); - } - - $normalizer = $option->getNormalizer(); - if (null !== $normalizer) { - $resolver->setNormalizer($name, $normalizer); - } - } - - return $resolver->resolve($configuration); - } - - /** - * @param iterable $options - * - * @throws \LogicException when the option is already defined - */ - private function validateOptions(iterable $options): void - { - $names = []; - - foreach ($options as $option) { - $name = $option->getName(); - - if (\in_array($name, $names, true)) { - throw new \LogicException(\sprintf('The "%s" option is defined multiple times.', $name)); - } - - $names[] = $name; - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolverInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolverInterface.php deleted file mode 100644 index 284cdbd3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerConfigurationResolverInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -interface FixerConfigurationResolverInterface -{ - /** - * @return list - */ - public function getOptions(): array; - - /** - * @param array $configuration - * - * @return array - */ - public function resolve(array $configuration): array; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOption.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOption.php deleted file mode 100644 index 97edd4eb..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOption.php +++ /dev/null @@ -1,146 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -/** - * @readonly - */ -final class FixerOption implements FixerOptionInterface -{ - private string $name; - - private string $description; - - private bool $isRequired; - - /** - * @var mixed - */ - private $default; - - /** - * @var null|list - */ - private ?array $allowedTypes; - - /** - * @var null|list - */ - private ?array $allowedValues; - - private ?\Closure $normalizer; - - /** - * @param mixed $default - * @param null|list $allowedTypes - * @param null|list $allowedValues - */ - public function __construct( - string $name, - string $description, - bool $isRequired = true, - $default = null, - ?array $allowedTypes = null, - ?array $allowedValues = null, - ?\Closure $normalizer = null - ) { - if ($isRequired && null !== $default) { - throw new \LogicException('Required options cannot have a default value.'); - } - - if (null !== $allowedValues) { - foreach ($allowedValues as &$allowedValue) { - if ($allowedValue instanceof \Closure) { - $allowedValue = $this->unbind($allowedValue); - } - } - } - - $this->name = $name; - $this->description = $description; - $this->isRequired = $isRequired; - $this->default = $default; - $this->allowedTypes = $allowedTypes; - $this->allowedValues = $allowedValues; - - if (null !== $normalizer) { - $this->normalizer = $this->unbind($normalizer); - } else { - $this->normalizer = null; - } - } - - public function getName(): string - { - return $this->name; - } - - public function getDescription(): string - { - return $this->description; - } - - public function hasDefault(): bool - { - return !$this->isRequired; - } - - /** - * @return mixed - */ - public function getDefault() - { - if (!$this->hasDefault()) { - throw new \LogicException('No default value defined.'); - } - - return $this->default; - } - - public function getAllowedTypes(): ?array - { - return $this->allowedTypes; - } - - public function getAllowedValues(): ?array - { - return $this->allowedValues; - } - - public function getNormalizer(): ?\Closure - { - return $this->normalizer; - } - - /** - * Unbinds the given closure to avoid memory leaks. - * - * The closures provided to this class were probably defined in a fixer - * class and thus bound to it by default. The configuration will then be - * stored in {@see AbstractFixer::$configurationDefinition}, leading to the - * following cyclic reference: - * - * fixer -> configuration definition -> options -> closures -> fixer - * - * This cyclic reference prevent the garbage collector to free memory as - * all elements are still referenced. - * - * See {@see https://bugs.php.net/bug.php?id=69639 Bug #69639} for details. - */ - private function unbind(\Closure $closure): \Closure - { - return $closure->bindTo(null); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionBuilder.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionBuilder.php deleted file mode 100644 index 8f8a4ea5..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionBuilder.php +++ /dev/null @@ -1,126 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -final class FixerOptionBuilder -{ - private string $name; - - private string $description; - - /** - * @var null|mixed - */ - private $default; - - private bool $isRequired = true; - - /** - * @var null|list - */ - private ?array $allowedTypes = null; - - /** - * @var null|list - */ - private ?array $allowedValues = null; - - private ?\Closure $normalizer = null; - - private ?string $deprecationMessage = null; - - public function __construct(string $name, string $description) - { - $this->name = $name; - $this->description = $description; - $this->default = null; - } - - /** - * @param mixed $default - * - * @return $this - */ - public function setDefault($default): self - { - $this->default = $default; - $this->isRequired = false; - - return $this; - } - - /** - * @param list $allowedTypes - * - * @return $this - */ - public function setAllowedTypes(array $allowedTypes): self - { - $this->allowedTypes = $allowedTypes; - - return $this; - } - - /** - * @param list $allowedValues - * - * @return $this - */ - public function setAllowedValues(array $allowedValues): self - { - $this->allowedValues = $allowedValues; - - return $this; - } - - /** - * @return $this - */ - public function setNormalizer(\Closure $normalizer): self - { - $this->normalizer = $normalizer; - - return $this; - } - - /** - * @return $this - */ - public function setDeprecationMessage(?string $deprecationMessage): self - { - $this->deprecationMessage = $deprecationMessage; - - return $this; - } - - public function getOption(): FixerOptionInterface - { - $option = new FixerOption( - $this->name, - $this->description, - $this->isRequired, - $this->default, - $this->allowedTypes, - $this->allowedValues, - $this->normalizer - ); - - if (null !== $this->deprecationMessage) { - $option = new DeprecatedFixerOption($option, $this->deprecationMessage); - } - - return $option; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionInterface.php deleted file mode 100644 index d760e4df..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionInterface.php +++ /dev/null @@ -1,43 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -interface FixerOptionInterface -{ - public function getName(): string; - - public function getDescription(): string; - - public function hasDefault(): bool; - - /** - * @return mixed - * - * @throws \LogicException when no default value is defined - */ - public function getDefault(); - - /** - * @return null|list - */ - public function getAllowedTypes(): ?array; - - /** - * @return null|list - */ - public function getAllowedValues(): ?array; - - public function getNormalizer(): ?\Closure; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionSorter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionSorter.php deleted file mode 100644 index bb526874..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionSorter.php +++ /dev/null @@ -1,37 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -/** - * @internal - */ -final class FixerOptionSorter -{ - /** - * @param iterable $options - * - * @return list - */ - public function sort(iterable $options): array - { - if (!\is_array($options)) { - $options = iterator_to_array($options, false); - } - - usort($options, static fn (FixerOptionInterface $a, FixerOptionInterface $b): int => $a->getName() <=> $b->getName()); - - return $options; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/InvalidOptionsForEnvException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/InvalidOptionsForEnvException.php deleted file mode 100644 index 4c12d5da..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerConfiguration/InvalidOptionsForEnvException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerConfiguration; - -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class InvalidOptionsForEnvException extends InvalidOptionsException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSample.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSample.php deleted file mode 100644 index b705bb66..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSample.php +++ /dev/null @@ -1,49 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerDefinition; - -/** - * @author Dariusz Rumiński - * - * @readonly - */ -final class CodeSample implements CodeSampleInterface -{ - private string $code; - - /** - * @var null|array - */ - private ?array $configuration; - - /** - * @param null|array $configuration - */ - public function __construct(string $code, ?array $configuration = null) - { - $this->code = $code; - $this->configuration = $configuration; - } - - public function getCode(): string - { - return $this->code; - } - - public function getConfiguration(): ?array - { - return $this->configuration; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSampleInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSampleInterface.php deleted file mode 100644 index 9bce5eb8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSampleInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerDefinition; - -/** - * @author Dariusz Rumiński - */ -interface CodeSampleInterface -{ - public function getCode(): string; - - /** - * @return null|array - */ - public function getConfiguration(): ?array; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSample.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSample.php deleted file mode 100644 index 8547737c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSample.php +++ /dev/null @@ -1,56 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerDefinition; - -/** - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class FileSpecificCodeSample implements FileSpecificCodeSampleInterface -{ - private CodeSampleInterface $codeSample; - - private \SplFileInfo $splFileInfo; - - /** - * @param null|array $configuration - */ - public function __construct( - string $code, - \SplFileInfo $splFileInfo, - ?array $configuration = null - ) { - $this->codeSample = new CodeSample($code, $configuration); - $this->splFileInfo = $splFileInfo; - } - - public function getCode(): string - { - return $this->codeSample->getCode(); - } - - public function getConfiguration(): ?array - { - return $this->codeSample->getConfiguration(); - } - - public function getSplFileInfo(): \SplFileInfo - { - return $this->splFileInfo; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSampleInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSampleInterface.php deleted file mode 100644 index df6f092f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FileSpecificCodeSampleInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerDefinition; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -interface FileSpecificCodeSampleInterface extends CodeSampleInterface -{ - public function getSplFileInfo(): \SplFileInfo; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinition.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinition.php deleted file mode 100644 index 8da7f3d1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinition.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerDefinition; - -/** - * @author Dariusz Rumiński - * - * @readonly - */ -final class FixerDefinition implements FixerDefinitionInterface -{ - private string $summary; - - /** - * @var list - */ - private array $codeSamples; - - /** - * Description of Fixer and benefit of using it. - */ - private ?string $description; - - /** - * Description why Fixer is risky. - */ - private ?string $riskyDescription; - - /** - * @param list $codeSamples array of samples, where single sample is [code, configuration] - * @param null|string $riskyDescription null for non-risky fixer - */ - public function __construct( - string $summary, - array $codeSamples, - ?string $description = null, - ?string $riskyDescription = null - ) { - $this->summary = $summary; - $this->codeSamples = $codeSamples; - $this->description = $description; - $this->riskyDescription = $riskyDescription; - } - - public function getSummary(): string - { - return $this->summary; - } - - public function getDescription(): ?string - { - return $this->description; - } - - public function getRiskyDescription(): ?string - { - return $this->riskyDescription; - } - - public function getCodeSamples(): array - { - return $this->codeSamples; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinitionInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinitionInterface.php deleted file mode 100644 index 5bc2f934..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/FixerDefinitionInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerDefinition; - -/** - * @author Dariusz Rumiński - */ -interface FixerDefinitionInterface -{ - public function getSummary(): string; - - public function getDescription(): ?string; - - /** - * @return null|string null for non-risky fixer - */ - public function getRiskyDescription(): ?string; - - /** - * Array of samples, where single sample is [code, configuration]. - * - * @return list - */ - public function getCodeSamples(): array; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSample.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSample.php deleted file mode 100644 index c27a8748..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSample.php +++ /dev/null @@ -1,54 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerDefinition; - -/** - * @author Andreas Möller - * - * @readonly - */ -final class VersionSpecificCodeSample implements VersionSpecificCodeSampleInterface -{ - private CodeSampleInterface $codeSample; - - private VersionSpecificationInterface $versionSpecification; - - /** - * @param null|array $configuration - */ - public function __construct( - string $code, - VersionSpecificationInterface $versionSpecification, - ?array $configuration = null - ) { - $this->codeSample = new CodeSample($code, $configuration); - $this->versionSpecification = $versionSpecification; - } - - public function getCode(): string - { - return $this->codeSample->getCode(); - } - - public function getConfiguration(): ?array - { - return $this->codeSample->getConfiguration(); - } - - public function isSuitableFor(int $version): bool - { - return $this->versionSpecification->isSatisfiedBy($version); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSampleInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSampleInterface.php deleted file mode 100644 index 74e4f446..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificCodeSampleInterface.php +++ /dev/null @@ -1,23 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerDefinition; - -/** - * @author Andreas Moeller - */ -interface VersionSpecificCodeSampleInterface extends CodeSampleInterface -{ - public function isSuitableFor(int $version): bool; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecification.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecification.php deleted file mode 100644 index e33fa4aa..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecification.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerDefinition; - -/** - * @author Andreas Möller - * - * @readonly - */ -final class VersionSpecification implements VersionSpecificationInterface -{ - /** - * @var null|int<1, max> - */ - private ?int $minimum; - - /** - * @var null|int<1, max> - */ - private ?int $maximum; - - /** - * @param null|int<1, max> $minimum - * @param null|int<1, max> $maximum - * - * @throws \InvalidArgumentException - */ - public function __construct(?int $minimum = null, ?int $maximum = null) - { - if (null === $minimum && null === $maximum) { - throw new \InvalidArgumentException('Minimum or maximum need to be specified.'); - } - - if (null !== $minimum && 1 > $minimum) { - throw new \InvalidArgumentException('Minimum needs to be either null or an integer greater than 0.'); - } - - if (null !== $maximum) { - if (1 > $maximum) { - throw new \InvalidArgumentException('Maximum needs to be either null or an integer greater than 0.'); - } - - if (null !== $minimum && $maximum < $minimum) { - throw new \InvalidArgumentException('Maximum should not be lower than the minimum.'); - } - } - - $this->minimum = $minimum; - $this->maximum = $maximum; - } - - public function isSatisfiedBy(int $version): bool - { - if (null !== $this->minimum && $version < $this->minimum) { - return false; - } - - if (null !== $this->maximum && $version > $this->maximum) { - return false; - } - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificationInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificationInterface.php deleted file mode 100644 index 502cdc4a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerDefinition/VersionSpecificationInterface.php +++ /dev/null @@ -1,23 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\FixerDefinition; - -/** - * @author Andreas Möller - */ -interface VersionSpecificationInterface -{ - public function isSatisfiedBy(int $version): bool; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerFactory.php deleted file mode 100644 index 8b422396..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerFactory.php +++ /dev/null @@ -1,248 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; -use PhpCsFixer\Fixer\ConfigurableFixerInterface; -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; -use PhpCsFixer\RuleSet\RuleSetInterface; -use Symfony\Component\Finder\Finder as SymfonyFinder; -use Symfony\Component\Finder\SplFileInfo; - -/** - * Class provides a way to create a group of fixers. - * - * Fixers may be registered (made the factory aware of them) by - * registering a custom fixer and default, built in fixers. - * Then, one can attach Config instance to fixer instances. - * - * Finally factory creates a ready to use group of fixers. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class FixerFactory -{ - private FixerNameValidator $nameValidator; - - /** - * @var list - */ - private array $fixers = []; - - /** - * @var array - */ - private array $fixersByName = []; - - public function __construct() - { - $this->nameValidator = new FixerNameValidator(); - } - - public function setWhitespacesConfig(WhitespacesFixerConfig $config): self - { - foreach ($this->fixers as $fixer) { - if ($fixer instanceof WhitespacesAwareFixerInterface) { - $fixer->setWhitespacesConfig($config); - } - } - - return $this; - } - - /** - * @return list - */ - public function getFixers(): array - { - $this->fixers = Utils::sortFixers($this->fixers); - - return $this->fixers; - } - - /** - * @return $this - */ - public function registerBuiltInFixers(): self - { - static $builtInFixers = null; - - if (null === $builtInFixers) { - /** @var list> */ - $builtInFixers = []; - - $finder = SymfonyFinder::create()->files() - ->in(__DIR__.'/Fixer') - ->exclude(['Internal']) - ->name('*Fixer.php') - ->depth(1) - ; - - /** @var SplFileInfo $file */ - foreach ($finder as $file) { - $relativeNamespace = $file->getRelativePath(); - $fixerClass = 'PhpCsFixer\Fixer\\'.('' !== $relativeNamespace ? $relativeNamespace.'\\' : '').$file->getBasename('.php'); - $builtInFixers[] = $fixerClass; - } - } - - foreach ($builtInFixers as $class) { - /** @var FixerInterface */ - $fixer = new $class(); - $this->registerFixer($fixer, false); - } - - return $this; - } - - /** - * @param iterable $fixers - * - * @return $this - */ - public function registerCustomFixers(iterable $fixers): self - { - foreach ($fixers as $fixer) { - $this->registerFixer($fixer, true); - } - - return $this; - } - - /** - * @return $this - */ - public function registerFixer(FixerInterface $fixer, bool $isCustom): self - { - $name = $fixer->getName(); - - if (isset($this->fixersByName[$name])) { - throw new \UnexpectedValueException(\sprintf('Fixer named "%s" is already registered.', $name)); - } - - if (!$this->nameValidator->isValid($name, $isCustom)) { - throw new \UnexpectedValueException(\sprintf('Fixer named "%s" has invalid name.', $name)); - } - - $this->fixers[] = $fixer; - $this->fixersByName[$name] = $fixer; - - return $this; - } - - /** - * Apply RuleSet on fixers to filter out all unwanted fixers. - * - * @return $this - */ - public function useRuleSet(RuleSetInterface $ruleSet): self - { - $fixers = []; - $fixersByName = []; - $fixerConflicts = []; - - $fixerNames = array_keys($ruleSet->getRules()); - foreach ($fixerNames as $name) { - if (!\array_key_exists($name, $this->fixersByName)) { - throw new \UnexpectedValueException(\sprintf('Rule "%s" does not exist.', $name)); - } - - $fixer = $this->fixersByName[$name]; - $config = $ruleSet->getRuleConfiguration($name); - - if (null !== $config) { - if ($fixer instanceof ConfigurableFixerInterface) { - if (\count($config) < 1) { - throw new InvalidFixerConfigurationException($fixer->getName(), 'Configuration must be an array and may not be empty.'); - } - - $fixer->configure($config); - } else { - throw new InvalidFixerConfigurationException($fixer->getName(), 'Is not configurable.'); - } - } - - $fixers[] = $fixer; - $fixersByName[$name] = $fixer; - $conflicts = array_intersect($this->getFixersConflicts($fixer), $fixerNames); - - if (\count($conflicts) > 0) { - $fixerConflicts[$name] = $conflicts; - } - } - - if (\count($fixerConflicts) > 0) { - throw new \UnexpectedValueException($this->generateConflictMessage($fixerConflicts)); - } - - $this->fixers = $fixers; - $this->fixersByName = $fixersByName; - - return $this; - } - - /** - * Check if fixer exists. - */ - public function hasRule(string $name): bool - { - return isset($this->fixersByName[$name]); - } - - /** - * @return list - */ - private function getFixersConflicts(FixerInterface $fixer): array - { - static $conflictMap = [ - 'blank_lines_before_namespace' => [ - 'no_blank_lines_before_namespace', - 'single_blank_line_before_namespace', - ], - 'no_blank_lines_before_namespace' => ['single_blank_line_before_namespace'], - 'single_import_per_statement' => ['group_import'], - ]; - - $fixerName = $fixer->getName(); - - return \array_key_exists($fixerName, $conflictMap) ? $conflictMap[$fixerName] : []; - } - - /** - * @param array> $fixerConflicts - */ - private function generateConflictMessage(array $fixerConflicts): string - { - $message = 'Rule contains conflicting fixers:'; - $report = []; - - foreach ($fixerConflicts as $fixer => $fixers) { - // filter mutual conflicts - $report[$fixer] = array_filter( - $fixers, - static fn (string $candidate): bool => !\array_key_exists($candidate, $report) || !\in_array($fixer, $report[$candidate], true) - ); - - if (\count($report[$fixer]) > 0) { - $message .= \sprintf("\n- \"%s\" with %s", $fixer, Utils::naturalLanguageJoin($report[$fixer])); - } - } - - return $message; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerNameValidator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerNameValidator.php deleted file mode 100644 index 8f19cb06..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/FixerNameValidator.php +++ /dev/null @@ -1,32 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class FixerNameValidator -{ - public function isValid(string $name, bool $isCustom): bool - { - if (!$isCustom) { - return Preg::match('/^[a-z][a-z0-9_]*$/', $name); - } - - return Preg::match('/^[A-Z][a-zA-Z0-9]*\/[a-z][a-z0-9_]*$/', $name); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Indicator/PhpUnitTestCaseIndicator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Indicator/PhpUnitTestCaseIndicator.php deleted file mode 100644 index ed82aaa2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Indicator/PhpUnitTestCaseIndicator.php +++ /dev/null @@ -1,90 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Indicator; - -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -final class PhpUnitTestCaseIndicator -{ - public function isPhpUnitClass(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->isGivenKind(T_CLASS)) { - throw new \LogicException(\sprintf('No "T_CLASS" at given index %d, got "%s".', $index, $tokens[$index]->getName())); - } - - $index = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$index]->isGivenKind(T_STRING)) { - return false; - } - - $extendsIndex = $tokens->getNextTokenOfKind($index, ['{', [T_EXTENDS]]); - - if (!$tokens[$extendsIndex]->isGivenKind(T_EXTENDS)) { - return false; - } - - if (Preg::match('/(?:Test|TestCase)$/', $tokens[$index]->getContent())) { - return true; - } - - while (null !== $index = $tokens->getNextMeaningfulToken($index)) { - if ($tokens[$index]->equals('{')) { - break; // end of class signature - } - - if (!$tokens[$index]->isGivenKind(T_STRING)) { - continue; // not part of extends nor part of implements; so continue - } - - if (Preg::match('/(?:Test|TestCase)(?:Interface)?$/', $tokens[$index]->getContent())) { - return true; - } - } - - return false; - } - - /** - * Returns an indices of PHPUnit classes in reverse appearance order. - * Order is important - it's reverted, so if we inject tokens into collection, - * we do it for bottom of file first, and then to the top of the file, so we - * mitigate risk of not visiting whole collections (final indices). - * - * @return iterable array of [int start, int end] indices from later to earlier classes - */ - public function findPhpUnitClasses(Tokens $tokens): iterable - { - for ($index = $tokens->count() - 1; $index > 0; --$index) { - if (!$tokens[$index]->isGivenKind(T_CLASS) || !$this->isPhpUnitClass($tokens, $index)) { - continue; - } - - $startIndex = $tokens->getNextTokenOfKind($index, ['{']); - - if (null === $startIndex) { - return; - } - - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $startIndex); - - yield [$startIndex, $endIndex]; - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/CachingLinter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/CachingLinter.php deleted file mode 100644 index 7d6813fe..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/CachingLinter.php +++ /dev/null @@ -1,54 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Linter; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class CachingLinter implements LinterInterface -{ - private LinterInterface $sublinter; - - /** - * @var array - */ - private array $cache = []; - - public function __construct(LinterInterface $linter) - { - $this->sublinter = $linter; - } - - public function isAsync(): bool - { - return $this->sublinter->isAsync(); - } - - public function lintFile(string $path): LintingResultInterface - { - $checksum = md5(file_get_contents($path)); - - return $this->cache[$checksum] ??= $this->sublinter->lintFile($path); - } - - public function lintSource(string $source): LintingResultInterface - { - $checksum = md5($source); - - return $this->cache[$checksum] ??= $this->sublinter->lintSource($source); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/Linter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/Linter.php deleted file mode 100644 index 86129ab4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/Linter.php +++ /dev/null @@ -1,49 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Linter; - -/** - * Handle PHP code linting process. - * - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class Linter implements LinterInterface -{ - private LinterInterface $subLinter; - - public function __construct() - { - $this->subLinter = new TokenizerLinter(); - } - - public function isAsync(): bool - { - return $this->subLinter->isAsync(); - } - - public function lintFile(string $path): LintingResultInterface - { - return $this->subLinter->lintFile($path); - } - - public function lintSource(string $source): LintingResultInterface - { - return $this->subLinter->lintSource($source); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LinterInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LinterInterface.php deleted file mode 100644 index 1b5c2db6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LinterInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Linter; - -/** - * Interface for PHP code linting process manager. - * - * @author Dariusz Rumiński - */ -interface LinterInterface -{ - public function isAsync(): bool; - - /** - * Lint PHP file. - */ - public function lintFile(string $path): LintingResultInterface; - - /** - * Lint PHP code. - */ - public function lintSource(string $source): LintingResultInterface; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingException.php deleted file mode 100644 index 1874bac1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Linter; - -/** - * @author Dariusz Rumiński - * - * @final - * - * @TODO 4.0 make class "final" - */ -class LintingException extends \RuntimeException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingResultInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingResultInterface.php deleted file mode 100644 index 855d695b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/LintingResultInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Linter; - -/** - * @author Dariusz Rumiński - */ -interface LintingResultInterface -{ - /** - * Check if linting process was successful and raise LintingException if not. - */ - public function check(): void; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinter.php deleted file mode 100644 index 74d276a6..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinter.php +++ /dev/null @@ -1,149 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Linter; - -use PhpCsFixer\FileReader; -use PhpCsFixer\FileRemoval; -use Symfony\Component\Filesystem\Exception\IOException; -use Symfony\Component\Process\PhpExecutableFinder; -use Symfony\Component\Process\Process; - -/** - * Handle PHP code linting using separated process of `php -l _file_`. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class ProcessLinter implements LinterInterface -{ - private FileRemoval $fileRemoval; - - private ProcessLinterProcessBuilder $processBuilder; - - /** - * Temporary file for code linting. - */ - private ?string $temporaryFile = null; - - /** - * @param null|string $executable PHP executable, null for autodetection - */ - public function __construct(?string $executable = null) - { - if (null === $executable) { - $executableFinder = new PhpExecutableFinder(); - $executable = $executableFinder->find(false); - - if (false === $executable) { - throw new UnavailableLinterException('Cannot find PHP executable.'); - } - - if ('phpdbg' === \PHP_SAPI) { - if (!str_contains($executable, 'phpdbg')) { - throw new UnavailableLinterException('Automatically found PHP executable is non-standard phpdbg. Could not find proper PHP executable.'); - } - - // automatically found executable is `phpdbg`, let us try to fallback to regular `php` - $executable = str_replace('phpdbg', 'php', $executable); - - if (!is_executable($executable)) { - throw new UnavailableLinterException('Automatically found PHP executable is phpdbg. Could not find proper PHP executable.'); - } - } - } - - $this->processBuilder = new ProcessLinterProcessBuilder($executable); - $this->fileRemoval = new FileRemoval(); - } - - public function __destruct() - { - if (null !== $this->temporaryFile) { - $this->fileRemoval->delete($this->temporaryFile); - } - } - - /** - * This class is not intended to be serialized, - * and cannot be deserialized (see __wakeup method). - */ - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.self::class); - } - - /** - * Disable the deserialization of the class to prevent attacker executing - * code by leveraging the __destruct method. - * - * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection - */ - public function __wakeup(): void - { - throw new \BadMethodCallException('Cannot unserialize '.self::class); - } - - public function isAsync(): bool - { - return true; - } - - public function lintFile(string $path): LintingResultInterface - { - return new ProcessLintingResult($this->createProcessForFile($path), $path); - } - - public function lintSource(string $source): LintingResultInterface - { - return new ProcessLintingResult($this->createProcessForSource($source), $this->temporaryFile); - } - - /** - * @param string $path path to file - */ - private function createProcessForFile(string $path): Process - { - // in case php://stdin - if (!is_file($path)) { - return $this->createProcessForSource(FileReader::createSingleton()->read($path)); - } - - $process = $this->processBuilder->build($path); - $process->setTimeout(10); - $process->start(); - - return $process; - } - - /** - * Create process that lint PHP code. - * - * @param string $source code - */ - private function createProcessForSource(string $source): Process - { - if (null === $this->temporaryFile) { - $this->temporaryFile = tempnam(sys_get_temp_dir(), 'cs_fixer_tmp_'); - $this->fileRemoval->observe($this->temporaryFile); - } - - if (false === @file_put_contents($this->temporaryFile, $source)) { - throw new IOException(\sprintf('Failed to write file "%s".', $this->temporaryFile), 0, null, $this->temporaryFile); - } - - return $this->createProcessForFile($this->temporaryFile); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinterProcessBuilder.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinterProcessBuilder.php deleted file mode 100644 index 2dd24e17..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLinterProcessBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Linter; - -use Symfony\Component\Process\Process; - -/** - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class ProcessLinterProcessBuilder -{ - private string $executable; - - /** - * @param string $executable PHP executable - */ - public function __construct(string $executable) - { - $this->executable = $executable; - } - - public function build(string $path): Process - { - return new Process([ - $this->executable, - '-l', - $path, - ]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLintingResult.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLintingResult.php deleted file mode 100644 index bbdd78c9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/ProcessLintingResult.php +++ /dev/null @@ -1,86 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Linter; - -use Symfony\Component\Process\Process; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class ProcessLintingResult implements LintingResultInterface -{ - private Process $process; - - private ?string $path; - - private ?bool $isSuccessful = null; - - public function __construct(Process $process, ?string $path = null) - { - $this->process = $process; - $this->path = $path; - } - - public function check(): void - { - if (!$this->isSuccessful()) { - // on some systems stderr is used, but on others, it's not - throw new LintingException($this->getProcessErrorMessage(), $this->process->getExitCode()); - } - } - - private function getProcessErrorMessage(): string - { - $errorOutput = $this->process->getErrorOutput(); - $output = strtok(ltrim('' !== $errorOutput ? $errorOutput : $this->process->getOutput()), "\n"); - - if (false === $output) { - return 'Fatal error: Unable to lint file.'; - } - - if (null !== $this->path) { - $needle = \sprintf('in %s ', $this->path); - $pos = strrpos($output, $needle); - - if (false !== $pos) { - $output = \sprintf('%s%s', substr($output, 0, $pos), substr($output, $pos + \strlen($needle))); - } - } - - $prefix = substr($output, 0, 18); - - if ('PHP Parse error: ' === $prefix) { - return \sprintf('Parse error: %s.', substr($output, 18)); - } - - if ('PHP Fatal error: ' === $prefix) { - return \sprintf('Fatal error: %s.', substr($output, 18)); - } - - return \sprintf('%s.', $output); - } - - private function isSuccessful(): bool - { - if (null === $this->isSuccessful) { - $this->process->wait(); - $this->isSuccessful = $this->process->isSuccessful(); - } - - return $this->isSuccessful; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLinter.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLinter.php deleted file mode 100644 index fec0b674..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLinter.php +++ /dev/null @@ -1,58 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Linter; - -use PhpCsFixer\FileReader; -use PhpCsFixer\Tokenizer\CodeHasher; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Handle PHP code linting. - * - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class TokenizerLinter implements LinterInterface -{ - public function isAsync(): bool - { - return false; - } - - public function lintFile(string $path): LintingResultInterface - { - return $this->lintSource(FileReader::createSingleton()->read($path)); - } - - public function lintSource(string $source): LintingResultInterface - { - try { - // To lint, we will parse the source into Tokens. - // During that process, it might throw a ParseError or CompileError. - // If it won't, cache of tokenized version of source will be kept, which is great for Runner. - // Yet, first we need to clear already existing cache to not hit it and lint the code indeed. - $codeHash = CodeHasher::calculateCodeHash($source); - Tokens::clearCache($codeHash); - Tokens::fromCode($source); - - return new TokenizerLintingResult(); - } catch (\CompileError|\ParseError $e) { - return new TokenizerLintingResult($e); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLintingResult.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLintingResult.php deleted file mode 100644 index 469f2dfd..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/TokenizerLintingResult.php +++ /dev/null @@ -1,48 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Linter; - -/** - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class TokenizerLintingResult implements LintingResultInterface -{ - private ?\Error $error; - - public function __construct(?\Error $error = null) - { - $this->error = $error; - } - - public function check(): void - { - if (null !== $this->error) { - throw new LintingException( - \sprintf('%s: %s on line %d.', $this->getMessagePrefix(), $this->error->getMessage(), $this->error->getLine()), - $this->error->getCode(), - $this->error - ); - } - } - - private function getMessagePrefix(): string - { - return $this->error instanceof \ParseError ? 'Parse error' : 'Fatal error'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/UnavailableLinterException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/UnavailableLinterException.php deleted file mode 100644 index df67b5f0..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Linter/UnavailableLinterException.php +++ /dev/null @@ -1,26 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Linter; - -/** - * Exception that is thrown when the chosen linter is not available on the environment. - * - * @author Dariusz Rumiński - * - * @final - * - * @TODO 4.0 make class "final" - */ -class UnavailableLinterException extends \RuntimeException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ParallelAwareConfigInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ParallelAwareConfigInterface.php deleted file mode 100644 index 6716cf3c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ParallelAwareConfigInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\Runner\Parallel\ParallelConfig; - -/** - * @author Greg Korba - * - * @TODO 4.0 Include parallel runner config in main ConfigInterface - */ -interface ParallelAwareConfigInterface extends ConfigInterface -{ - public function getParallelConfig(): ParallelConfig; - - public function setParallelConfig(ParallelConfig $config): ConfigInterface; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharChecker.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharChecker.php deleted file mode 100644 index b7cb356c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharChecker.php +++ /dev/null @@ -1,38 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * @internal - */ -final class PharChecker implements PharCheckerInterface -{ - public function checkFileValidity(string $filename): ?string - { - try { - $phar = new \Phar($filename); - // free the variable to unlock the file - unset($phar); - } catch (\Exception $e) { - if (!$e instanceof \UnexpectedValueException && !$e instanceof \PharException) { - throw $e; - } - - return 'Failed to create Phar instance. '.$e->getMessage(); - } - - return null; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharCheckerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharCheckerInterface.php deleted file mode 100644 index 6ae22088..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PharCheckerInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * @internal - */ -interface PharCheckerInterface -{ - /** - * @return null|string the invalidity reason if any, null otherwise - */ - public function checkFileValidity(string $filename): ?string; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Preg.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Preg.php deleted file mode 100644 index a88db938..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Preg.php +++ /dev/null @@ -1,215 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * This class replaces preg_* functions to better handling UTF8 strings, - * ensuring no matter "u" modifier is present or absent subject will be handled correctly. - * - * @author Kuba Werłos - * - * @internal - */ -final class Preg -{ - /** - * @param array $matches - * @param int-mask $flags - * - * @param-out ($flags is PREG_OFFSET_CAPTURE - * ? array - * : ($flags is PREG_UNMATCHED_AS_NULL - * ? array - * : ($flags is int-mask&768 - * ? array - * : array - * ) - * ) - * ) $matches - * - * @throws PregException - */ - public static function match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool - { - $result = @preg_match(self::addUtf8Modifier($pattern), $subject, $matches, $flags, $offset); - if (false !== $result && PREG_NO_ERROR === preg_last_error()) { - return 1 === $result; - } - - $result = @preg_match(self::removeUtf8Modifier($pattern), $subject, $matches, $flags, $offset); - if (false !== $result && PREG_NO_ERROR === preg_last_error()) { - return 1 === $result; - } - - throw self::newPregException(preg_last_error(), preg_last_error_msg(), __METHOD__, $pattern); - } - - /** - * @param array $matches - * @param int-mask $flags - * - * @param-out ($flags is PREG_PATTERN_ORDER - * ? array> - * : ($flags is PREG_SET_ORDER - * ? list> - * : ($flags is int-mask&(256|257) - * ? array> - * : ($flags is int-mask&258 - * ? list> - * : ($flags is int-mask&(512|513) - * ? array> - * : ($flags is int-mask&514 - * ? list> - * : ($flags is int-mask&770 - * ? list> - * : ($flags is 0 ? array> : array) - * ) - * ) - * ) - * ) - * ) - * ) - * ) $matches - * - * @throws PregException - */ - public static function matchAll(string $pattern, string $subject, ?array &$matches = null, int $flags = PREG_PATTERN_ORDER, int $offset = 0): int - { - $result = @preg_match_all(self::addUtf8Modifier($pattern), $subject, $matches, $flags, $offset); - if (false !== $result && PREG_NO_ERROR === preg_last_error()) { - return $result; - } - - $result = @preg_match_all(self::removeUtf8Modifier($pattern), $subject, $matches, $flags, $offset); - if (false !== $result && PREG_NO_ERROR === preg_last_error()) { - return $result; - } - - throw self::newPregException(preg_last_error(), preg_last_error_msg(), __METHOD__, $pattern); - } - - /** - * @param array|string $subject - * - * @param-out int $count - * - * @throws PregException - */ - public static function replace(string $pattern, string $replacement, $subject, int $limit = -1, ?int &$count = null): string - { - $result = @preg_replace(self::addUtf8Modifier($pattern), $replacement, $subject, $limit, $count); - if (null !== $result && PREG_NO_ERROR === preg_last_error()) { - return $result; - } - - $result = @preg_replace(self::removeUtf8Modifier($pattern), $replacement, $subject, $limit, $count); - if (null !== $result && PREG_NO_ERROR === preg_last_error()) { - return $result; - } - - throw self::newPregException(preg_last_error(), preg_last_error_msg(), __METHOD__, $pattern); - } - - /** - * @param-out int $count - * - * @throws PregException - */ - public static function replaceCallback(string $pattern, callable $callback, string $subject, int $limit = -1, ?int &$count = null): string - { - $result = @preg_replace_callback(self::addUtf8Modifier($pattern), $callback, $subject, $limit, $count); - if (null !== $result && PREG_NO_ERROR === preg_last_error()) { - return $result; - } - - $result = @preg_replace_callback(self::removeUtf8Modifier($pattern), $callback, $subject, $limit, $count); - if (null !== $result && PREG_NO_ERROR === preg_last_error()) { - return $result; - } - - throw self::newPregException(preg_last_error(), preg_last_error_msg(), __METHOD__, $pattern); - } - - /** - * @return list - * - * @throws PregException - */ - public static function split(string $pattern, string $subject, int $limit = -1, int $flags = 0): array - { - $result = @preg_split(self::addUtf8Modifier($pattern), $subject, $limit, $flags); - if (false !== $result && PREG_NO_ERROR === preg_last_error()) { - return $result; - } - - $result = @preg_split(self::removeUtf8Modifier($pattern), $subject, $limit, $flags); - if (false !== $result && PREG_NO_ERROR === preg_last_error()) { - return $result; - } - - throw self::newPregException(preg_last_error(), preg_last_error_msg(), __METHOD__, $pattern); - } - - private static function addUtf8Modifier(string $pattern): string - { - return $pattern.'u'; - } - - private static function removeUtf8Modifier(string $pattern): string - { - if ('' === $pattern) { - return ''; - } - - $delimiter = $pattern[0]; - - $endDelimiterPosition = strrpos($pattern, $delimiter); - - return substr($pattern, 0, $endDelimiterPosition).str_replace('u', '', substr($pattern, $endDelimiterPosition)); - } - - /** - * Create the generic PregException message and tell more about such kind of error in the message. - */ - private static function newPregException(int $error, string $errorMsg, string $method, string $pattern): PregException - { - $result = null; - $errorMessage = null; - - try { - $result = ExecutorWithoutErrorHandler::execute(static fn () => preg_match($pattern, '')); - } catch (ExecutorWithoutErrorHandlerException $e) { - $result = false; - $errorMessage = $e->getMessage(); - } - - if (false !== $result) { - return new PregException(\sprintf('Unknown error occurred when calling %s: %s.', $method, $errorMsg), $error); - } - - $code = preg_last_error(); - - $message = \sprintf( - '(code: %d) %s', - $code, - preg_replace('~preg_[a-z_]+[()]{2}: ~', '', $errorMessage) - ); - - return new PregException( - \sprintf('%s(): Invalid PCRE pattern "%s": %s (version: %s)', $method, $pattern, $message, PCRE_VERSION), - $code - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PregException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PregException.php deleted file mode 100644 index 57519e8a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/PregException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * Exception that is thrown when PCRE function encounters an error. - * - * @author Kuba Werłos - * - * @internal - */ -final class PregException extends \RuntimeException {} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMigrationSetDescription.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMigrationSetDescription.php deleted file mode 100644 index 397c6873..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMigrationSetDescription.php +++ /dev/null @@ -1,38 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet; - -use PhpCsFixer\Preg; - -/** - * @internal - */ -abstract class AbstractMigrationSetDescription extends AbstractRuleSetDescription -{ - public function getDescription(): string - { - $name = $this->getName(); - - if (Preg::match('#^@PHPUnit(\d+)(\d)Migration.*$#', $name, $matches)) { - return \sprintf('Rules to improve tests code for PHPUnit %d.%d compatibility.', $matches[1], $matches[2]); - } - - if (Preg::match('#^@PHP([\d]{2})Migration.*$#', $name, $matches)) { - return \sprintf('Rules to improve code for PHP %d.%d compatibility.', $matches[1][0], $matches[1][1]); - } - - throw new \RuntimeException(\sprintf('Cannot generate description for "%s" "%s".', static::class, $name)); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractRuleSetDescription.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractRuleSetDescription.php deleted file mode 100644 index db565b41..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractRuleSetDescription.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet; - -/** - * @internal - */ -abstract class AbstractRuleSetDescription implements RuleSetDescriptionInterface -{ - public function __construct() {} - - public function getName(): string - { - $name = substr(static::class, 1 + strrpos(static::class, '\\'), -3); - - return '@'.str_replace('Risky', ':risky', $name); - } - - public function isRisky(): bool - { - return str_contains(static::class, 'Risky'); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/DeprecatedRuleSetDescriptionInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/DeprecatedRuleSetDescriptionInterface.php deleted file mode 100644 index ae52441d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/DeprecatedRuleSetDescriptionInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet; - -/** - * @author Greg Korba - */ -interface DeprecatedRuleSetDescriptionInterface extends RuleSetDescriptionInterface -{ - /** - * Returns names of rule sets to use instead, if any. - * - * @return list - */ - public function getSuccessorsNames(): array; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSet.php deleted file mode 100644 index 79286c9f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSet.php +++ /dev/null @@ -1,159 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet; - -use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; -use PhpCsFixer\Utils; - -/** - * Set of rules to be used by fixer. - * - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class RuleSet implements RuleSetInterface -{ - /** - * Group of rules generated from input set. - * - * The key is name of rule, value is configuration array or true. - * The key must not point to any set. - * - * @var array|true> - */ - private array $rules; - - public function __construct(array $set = []) - { - foreach ($set as $name => $value) { - if ('' === $name) { - throw new \InvalidArgumentException('Rule/set name must not be empty.'); - } - - if (\is_int($name)) { - throw new \InvalidArgumentException(\sprintf('Missing value for "%s" rule/set.', $value)); - } - - if (!\is_bool($value) && !\is_array($value)) { - $message = str_starts_with($name, '@') ? 'Set must be enabled (true) or disabled (false). Other values are not allowed.' : 'Rule must be enabled (true), disabled (false) or configured (non-empty, assoc array). Other values are not allowed.'; - - if (null === $value) { - $message .= ' To disable the '.(str_starts_with($name, '@') ? 'set' : 'rule').', use "FALSE" instead of "NULL".'; - } - - throw new InvalidFixerConfigurationException($name, $message); - } - } - - $this->rules = $this->resolveSet($set); - } - - public function hasRule(string $rule): bool - { - return \array_key_exists($rule, $this->rules); - } - - public function getRuleConfiguration(string $rule): ?array - { - if (!$this->hasRule($rule)) { - throw new \InvalidArgumentException(\sprintf('Rule "%s" is not in the set.', $rule)); - } - - if (true === $this->rules[$rule]) { - return null; - } - - return $this->rules[$rule]; - } - - public function getRules(): array - { - return $this->rules; - } - - /** - * Resolve input set into group of rules. - * - * @param array|bool> $rules - * - * @return array|true> - */ - private function resolveSet(array $rules): array - { - $resolvedRules = []; - - // expand sets - foreach ($rules as $name => $value) { - if (str_starts_with($name, '@')) { - if (!\is_bool($value)) { - throw new \UnexpectedValueException(\sprintf('Nested rule set "%s" configuration must be a boolean.', $name)); - } - - $set = $this->resolveSubset($name, $value); - $resolvedRules = array_merge($resolvedRules, $set); - } else { - $resolvedRules[$name] = $value; - } - } - - // filter out all resolvedRules that are off - $resolvedRules = array_filter( - $resolvedRules, - static fn ($value): bool => false !== $value - ); - - return $resolvedRules; - } - - /** - * Resolve set rules as part of another set. - * - * If set value is false then disable all fixers in set, - * if not then get value from set item. - * - * @return array|bool> - */ - private function resolveSubset(string $setName, bool $setValue): array - { - $ruleSet = RuleSets::getSetDefinition($setName); - - if ($ruleSet instanceof DeprecatedRuleSetDescriptionInterface) { - $messageEnd = [] === $ruleSet->getSuccessorsNames() - ? 'No replacement available' - : \sprintf('Use %s instead', Utils::naturalLanguageJoin($ruleSet->getSuccessorsNames())); - - Utils::triggerDeprecation(new \RuntimeException("Rule set \"{$setName}\" is deprecated. {$messageEnd}.")); - } - - $rules = $ruleSet->getRules(); - - foreach ($rules as $name => $value) { - if (str_starts_with($name, '@')) { - $set = $this->resolveSubset($name, $setValue); - unset($rules[$name]); - $rules = array_merge($rules, $set); - } elseif (!$setValue) { - $rules[$name] = false; - } else { - $rules[$name] = $value; - } - } - - return $rules; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetDescriptionInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetDescriptionInterface.php deleted file mode 100644 index 156aed3a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetDescriptionInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet; - -/** - * @internal - */ -interface RuleSetDescriptionInterface -{ - public function getDescription(): string; - - public function getName(): string; - - /** - * Get all rules from rules set. - * - * @return array|bool> - */ - public function getRules(): array; - - public function isRisky(): bool; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetInterface.php deleted file mode 100644 index 02424825..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetInterface.php +++ /dev/null @@ -1,49 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet; - -/** - * Set of rules to be used by fixer. - * - * Example of set: ["@PSR2" => true, "@PSR1" => false, "strict" => true]. - * - * @author Dariusz Rumiński - */ -interface RuleSetInterface -{ - /** - * @param array|bool> $set - */ - public function __construct(array $set = []); - - /** - * Get configuration for given rule. - * - * @return null|array - */ - public function getRuleConfiguration(string $rule): ?array; - - /** - * Get all rules from rules set. - * - * @return array|true> - */ - public function getRules(): array; - - /** - * Check given rule is in rules set. - */ - public function hasRule(string $rule): bool; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSets.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSets.php deleted file mode 100644 index e66ced99..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/RuleSets.php +++ /dev/null @@ -1,72 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet; - -use Symfony\Component\Finder\Finder; - -/** - * Set of rule sets to be used by fixer. - * - * @internal - */ -final class RuleSets -{ - /** - * @var null|array - */ - private static ?array $setDefinitions = null; - - /** - * @return array - */ - public static function getSetDefinitions(): array - { - if (null === self::$setDefinitions) { - self::$setDefinitions = []; - - foreach (Finder::create()->files()->in(__DIR__.'/Sets') as $file) { - $class = 'PhpCsFixer\RuleSet\Sets\\'.$file->getBasename('.php'); - - /** @var RuleSetDescriptionInterface */ - $set = new $class(); - - self::$setDefinitions[$set->getName()] = $set; - } - - uksort(self::$setDefinitions, static fn (string $x, string $y): int => strnatcmp($x, $y)); - } - - return self::$setDefinitions; - } - - /** - * @return list - */ - public static function getSetDefinitionNames(): array - { - return array_keys(self::getSetDefinitions()); - } - - public static function getSetDefinition(string $name): RuleSetDescriptionInterface - { - $definitions = self::getSetDefinitions(); - - if (!isset($definitions[$name])) { - throw new \InvalidArgumentException(\sprintf('Set "%s" does not exist.', $name)); - } - - return $definitions[$name]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/DoctrineAnnotationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/DoctrineAnnotationSet.php deleted file mode 100644 index 53535465..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/DoctrineAnnotationSet.php +++ /dev/null @@ -1,42 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - */ -final class DoctrineAnnotationSet extends AbstractRuleSetDescription -{ - public function getRules(): array - { - return [ - 'doctrine_annotation_array_assignment' => [ - 'operator' => ':', - ], - 'doctrine_annotation_braces' => true, - 'doctrine_annotation_indentation' => true, - 'doctrine_annotation_spaces' => [ - 'before_array_assignments_colon' => false, - ], - ]; - } - - public function getDescription(): string - { - return 'Rules covering Doctrine annotations with configuration based on examples found in `Doctrine Annotation documentation `_ and `Symfony documentation `_.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0RiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0RiskySet.php deleted file mode 100644 index 3e446037..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0RiskySet.php +++ /dev/null @@ -1,44 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - * - * PER Coding Style v1.0. - * - * @see https://github.com/php-fig/per-coding-style/blob/1.0.0/spec.md - */ -final class PERCS1x0RiskySet extends AbstractRuleSetDescription -{ - public function getName(): string - { - return '@PER-CS1.0:risky'; - } - - public function getRules(): array - { - return [ - '@PSR12:risky' => true, - ]; - } - - public function getDescription(): string - { - return 'Rules that follow `PER Coding Style 1.0 `_.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0Set.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0Set.php deleted file mode 100644 index 3ad0a6fc..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS1x0Set.php +++ /dev/null @@ -1,44 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - * - * PER Coding Style v1.0. - * - * @see https://github.com/php-fig/per-coding-style/blob/1.0.0/spec.md - */ -final class PERCS1x0Set extends AbstractRuleSetDescription -{ - public function getName(): string - { - return '@PER-CS1.0'; - } - - public function getRules(): array - { - return [ - '@PSR12' => true, - ]; - } - - public function getDescription(): string - { - return 'Rules that follow `PER Coding Style 1.0 `_.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0RiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0RiskySet.php deleted file mode 100644 index 4a75a93d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0RiskySet.php +++ /dev/null @@ -1,44 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - * - * PER Coding Style v2.0. - * - * @see https://github.com/php-fig/per-coding-style/blob/2.0.0/spec.md - */ -final class PERCS2x0RiskySet extends AbstractRuleSetDescription -{ - public function getName(): string - { - return '@PER-CS2.0:risky'; - } - - public function getRules(): array - { - return [ - '@PER-CS1.0:risky' => true, - ]; - } - - public function getDescription(): string - { - return 'Rules that follow `PER Coding Style 2.0 `_.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0Set.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0Set.php deleted file mode 100644 index 7acf8e96..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCS2x0Set.php +++ /dev/null @@ -1,112 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - * - * PER Coding Style v2.0. - * - * @see https://github.com/php-fig/per-coding-style/blob/2.0.0/spec.md - */ -final class PERCS2x0Set extends AbstractRuleSetDescription -{ - public function getName(): string - { - return '@PER-CS2.0'; - } - - public function getRules(): array - { - return [ - '@PER-CS1.0' => true, - 'array_indentation' => true, - 'array_syntax' => true, - 'cast_spaces' => true, - 'concat_space' => ['spacing' => 'one'], - 'function_declaration' => [ - 'closure_fn_spacing' => 'none', - ], - 'method_argument_space' => true, - 'new_with_parentheses' => [ - 'anonymous_class' => false, - ], - 'single_line_empty_body' => true, - 'single_space_around_construct' => [ - 'constructs_followed_by_a_single_space' => [ - 'abstract', - 'as', - 'case', - 'catch', - 'class', - 'const', - 'const_import', - 'do', - 'else', - 'elseif', - 'enum', - 'final', - 'finally', - 'for', - 'foreach', - 'function', - 'function_import', - 'if', - 'insteadof', - 'interface', - 'match', - 'named_argument', - 'namespace', - 'new', - 'private', - 'protected', - 'public', - 'readonly', - 'static', - 'switch', - 'trait', - 'try', - 'type_colon', - 'use', - 'use_lambda', - 'while', - ], - 'constructs_preceded_by_a_single_space' => [ - 'as', - 'else', - 'elseif', - 'use_lambda', - ], - ], - 'trailing_comma_in_multiline' => [ - 'after_heredoc' => true, - 'elements' => [ - 'arguments', - 'array_destructuring', - 'arrays', - 'match', - 'parameters', - ], - ], - ]; - } - - public function getDescription(): string - { - return 'Rules that follow `PER Coding Style 2.0 `_.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSRiskySet.php deleted file mode 100644 index 6e6f7908..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSRiskySet.php +++ /dev/null @@ -1,40 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - */ -final class PERCSRiskySet extends AbstractRuleSetDescription -{ - public function getName(): string - { - return '@PER-CS:risky'; - } - - public function getRules(): array - { - return [ - '@PER-CS2.0:risky' => true, - ]; - } - - public function getDescription(): string - { - return 'Alias for the latest revision of PER-CS risky rules. Use it if you always want to be in sync with newest PER-CS standard.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSSet.php deleted file mode 100644 index 0fe59349..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERCSSet.php +++ /dev/null @@ -1,40 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - */ -final class PERCSSet extends AbstractRuleSetDescription -{ - public function getName(): string - { - return '@PER-CS'; - } - - public function getRules(): array - { - return [ - '@PER-CS2.0' => true, - ]; - } - - public function getDescription(): string - { - return 'Alias for the latest revision of PER-CS rules. Use it if you always want to be in sync with newest PER-CS standard.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERRiskySet.php deleted file mode 100644 index 9f156c28..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERRiskySet.php +++ /dev/null @@ -1,52 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; -use PhpCsFixer\RuleSet\DeprecatedRuleSetDescriptionInterface; - -/** - * @internal - * - * @deprecated use `@PER-CS:risky` instead - * - * @TODO 4.0 remove me - * - * Last updated to PER Coding Style v2.0. - */ -final class PERRiskySet extends AbstractRuleSetDescription implements DeprecatedRuleSetDescriptionInterface -{ - public function getName(): string - { - return '@PER:risky'; - } - - public function getRules(): array - { - return [ - '@PER-CS:risky' => true, - ]; - } - - public function getDescription(): string - { - return 'Alias for the newest PER-CS risky rules. It is recommended you use ``@PER-CS2.0:risky`` instead if you want to stick with stable ruleset.'; - } - - public function getSuccessorsNames(): array - { - return ['@PER-CS:risky']; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERSet.php deleted file mode 100644 index 81de37de..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PERSet.php +++ /dev/null @@ -1,47 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; -use PhpCsFixer\RuleSet\DeprecatedRuleSetDescriptionInterface; - -/** - * @internal - * - * @deprecated use `@PER-CS` instead - * - * @TODO 4.0 remove me - * - * Last updated to PER Coding Style v2.0. - */ -final class PERSet extends AbstractRuleSetDescription implements DeprecatedRuleSetDescriptionInterface -{ - public function getRules(): array - { - return [ - '@PER-CS' => true, - ]; - } - - public function getDescription(): string - { - return 'Alias for the newest PER-CS rules. It is recommended you use ``@PER-CS2.0`` instead if you want to stick with stable ruleset.'; - } - - public function getSuccessorsNames(): array - { - return ['@PER-CS']; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP54MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP54MigrationSet.php deleted file mode 100644 index bb877922..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP54MigrationSet.php +++ /dev/null @@ -1,30 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP54MigrationSet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - 'array_syntax' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP56MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP56MigrationRiskySet.php deleted file mode 100644 index 848b3501..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP56MigrationRiskySet.php +++ /dev/null @@ -1,30 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP56MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - 'pow_to_exponentiation' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP70MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP70MigrationRiskySet.php deleted file mode 100644 index a7fcb211..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP70MigrationRiskySet.php +++ /dev/null @@ -1,39 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP70MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP56Migration:risky' => true, - 'combine_nested_dirname' => true, - 'declare_strict_types' => true, - 'non_printable_character' => true, - 'random_api_migration' => [ - 'replacements' => [ - 'mt_rand' => 'random_int', - 'rand' => 'random_int', - ], - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP70MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP70MigrationSet.php deleted file mode 100644 index 62b0ad99..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP70MigrationSet.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP70MigrationSet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP54Migration' => true, - 'ternary_to_null_coalescing' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP71MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP71MigrationRiskySet.php deleted file mode 100644 index 5a57f262..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP71MigrationRiskySet.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP71MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP70Migration:risky' => true, - 'void_return' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP71MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP71MigrationSet.php deleted file mode 100644 index 9379628d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP71MigrationSet.php +++ /dev/null @@ -1,32 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP71MigrationSet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP70Migration' => true, - 'list_syntax' => true, - 'visibility_required' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP73MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP73MigrationSet.php deleted file mode 100644 index aa0ed8fb..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP73MigrationSet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP73MigrationSet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP71Migration' => true, - 'heredoc_indentation' => true, - 'method_argument_space' => ['after_heredoc' => true], - 'no_whitespace_before_comma_in_array' => ['after_heredoc' => true], - 'trailing_comma_in_multiline' => ['after_heredoc' => true], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP74MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP74MigrationRiskySet.php deleted file mode 100644 index 0a1bc17d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP74MigrationRiskySet.php +++ /dev/null @@ -1,33 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP74MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP71Migration:risky' => true, - 'implode_call' => true, - 'no_alias_functions' => true, - 'use_arrow_functions' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP74MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP74MigrationSet.php deleted file mode 100644 index 8af7296a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP74MigrationSet.php +++ /dev/null @@ -1,33 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP74MigrationSet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP73Migration' => true, - 'assign_null_coalescing_to_coalesce_equal' => true, - 'normalize_index_brace' => true, - 'short_scalar_cast' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP80MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP80MigrationRiskySet.php deleted file mode 100644 index 4027b6ed..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP80MigrationRiskySet.php +++ /dev/null @@ -1,40 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP80MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP74Migration:risky' => true, - 'get_class_to_class_keyword' => true, - 'modernize_strpos' => true, - 'no_alias_functions' => [ - 'sets' => [ - '@all', - ], - ], - 'no_php4_constructor' => true, - 'no_unneeded_final_method' => true, // final private method (not constructor) are no longer allowed >= PHP8.0 - 'no_unreachable_default_argument_value' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP80MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP80MigrationSet.php deleted file mode 100644 index 8b49a55c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP80MigrationSet.php +++ /dev/null @@ -1,32 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP80MigrationSet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP74Migration' => true, - 'clean_namespace' => true, - 'no_unset_cast' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP81MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP81MigrationSet.php deleted file mode 100644 index eaa27e9d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP81MigrationSet.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP81MigrationSet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP80Migration' => true, - 'octal_notation' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationRiskySet.php deleted file mode 100644 index 3bdbfdfc..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationRiskySet.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP82MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP80Migration:risky' => true, - 'phpdoc_readonly_class_comment_to_keyword' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationSet.php deleted file mode 100644 index 6a9da7db..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationSet.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP82MigrationSet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP81Migration' => true, - 'simple_to_complex_string_variable' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP83MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP83MigrationSet.php deleted file mode 100644 index a2bdfbd9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP83MigrationSet.php +++ /dev/null @@ -1,30 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP83MigrationSet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP82Migration' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP84MigrationSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP84MigrationSet.php deleted file mode 100644 index 480391bd..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP84MigrationSet.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHP84MigrationSet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHP83Migration' => true, - 'nullable_type_declaration_for_default_null_value' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit100MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit100MigrationRiskySet.php deleted file mode 100644 index f2092648..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit100MigrationRiskySet.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit100MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit91Migration:risky' => true, - 'php_unit_data_provider_static' => ['force' => true], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit30MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit30MigrationRiskySet.php deleted file mode 100644 index 1cabfc04..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit30MigrationRiskySet.php +++ /dev/null @@ -1,33 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit30MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - 'php_unit_dedicate_assert' => [ - 'target' => PhpUnitTargetVersion::VERSION_3_0, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit32MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit32MigrationRiskySet.php deleted file mode 100644 index fb4cbfb5..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit32MigrationRiskySet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit32MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit30Migration:risky' => true, - 'php_unit_no_expectation_annotation' => [ - 'target' => PhpUnitTargetVersion::VERSION_3_2, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit35MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit35MigrationRiskySet.php deleted file mode 100644 index 6a52afac..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit35MigrationRiskySet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit35MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit32Migration:risky' => true, - 'php_unit_dedicate_assert' => [ - 'target' => PhpUnitTargetVersion::VERSION_3_5, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit43MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit43MigrationRiskySet.php deleted file mode 100644 index 13927970..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit43MigrationRiskySet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit43MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit35Migration:risky' => true, - 'php_unit_no_expectation_annotation' => [ - 'target' => PhpUnitTargetVersion::VERSION_4_3, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit48MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit48MigrationRiskySet.php deleted file mode 100644 index fcb1b57e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit48MigrationRiskySet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit48MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit43Migration:risky' => true, - 'php_unit_namespaced' => [ - 'target' => PhpUnitTargetVersion::VERSION_4_8, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit50MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit50MigrationRiskySet.php deleted file mode 100644 index 38474584..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit50MigrationRiskySet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit50MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit48Migration:risky' => true, - 'php_unit_dedicate_assert' => [ - 'target' => PhpUnitTargetVersion::VERSION_5_0, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit52MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit52MigrationRiskySet.php deleted file mode 100644 index d0f71ee3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit52MigrationRiskySet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit52MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit50Migration:risky' => true, - 'php_unit_expectation' => [ - 'target' => PhpUnitTargetVersion::VERSION_5_2, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit54MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit54MigrationRiskySet.php deleted file mode 100644 index b7c87922..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit54MigrationRiskySet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit54MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit52Migration:risky' => true, - 'php_unit_mock' => [ - 'target' => PhpUnitTargetVersion::VERSION_5_4, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit55MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit55MigrationRiskySet.php deleted file mode 100644 index e3c1647d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit55MigrationRiskySet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit55MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit54Migration:risky' => true, - 'php_unit_mock' => [ - 'target' => PhpUnitTargetVersion::VERSION_5_5, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit56MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit56MigrationRiskySet.php deleted file mode 100644 index a1038bf8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit56MigrationRiskySet.php +++ /dev/null @@ -1,37 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit56MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit55Migration:risky' => true, - 'php_unit_dedicate_assert' => [ - 'target' => PhpUnitTargetVersion::VERSION_5_6, - ], - 'php_unit_expectation' => [ - 'target' => PhpUnitTargetVersion::VERSION_5_6, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit57MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit57MigrationRiskySet.php deleted file mode 100644 index 84076e11..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit57MigrationRiskySet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit57MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit56Migration:risky' => true, - 'php_unit_namespaced' => [ - 'target' => PhpUnitTargetVersion::VERSION_5_7, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit60MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit60MigrationRiskySet.php deleted file mode 100644 index 6bc7f711..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit60MigrationRiskySet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit60MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit57Migration:risky' => true, - 'php_unit_namespaced' => [ - 'target' => PhpUnitTargetVersion::VERSION_6_0, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit75MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit75MigrationRiskySet.php deleted file mode 100644 index a7efa234..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit75MigrationRiskySet.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit75MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit60Migration:risky' => true, - 'php_unit_dedicate_assert_internal_type' => [ - 'target' => PhpUnitTargetVersion::VERSION_7_5, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit84MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit84MigrationRiskySet.php deleted file mode 100644 index aaf5fc31..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit84MigrationRiskySet.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion; -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit84MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit60Migration:risky' => true, - '@PHPUnit75Migration:risky' => true, - 'php_unit_expectation' => [ - 'target' => PhpUnitTargetVersion::VERSION_8_4, - ], - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit91MigrationRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit91MigrationRiskySet.php deleted file mode 100644 index 5f0736d9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit91MigrationRiskySet.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractMigrationSetDescription; - -/** - * @internal - */ -final class PHPUnit91MigrationRiskySet extends AbstractMigrationSetDescription -{ - public function getRules(): array - { - return [ - '@PHPUnit84Migration:risky' => true, - 'php_unit_assert_new_names' => true, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12RiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12RiskySet.php deleted file mode 100644 index 84fd3efa..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12RiskySet.php +++ /dev/null @@ -1,36 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - */ -final class PSR12RiskySet extends AbstractRuleSetDescription -{ - public function getRules(): array - { - return [ - 'no_trailing_whitespace_in_string' => true, - 'no_unreachable_default_argument_value' => true, - ]; - } - - public function getDescription(): string - { - return 'Rules that follow `PSR-12 `_ standard.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12Set.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12Set.php deleted file mode 100644 index a9f7b5ff..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR12Set.php +++ /dev/null @@ -1,123 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - */ -final class PSR12Set extends AbstractRuleSetDescription -{ - public function getRules(): array - { - return [ - '@PSR2' => true, - 'binary_operator_spaces' => [ - 'default' => 'at_least_single_space', - ], - 'blank_line_after_opening_tag' => true, - 'blank_line_between_import_groups' => true, - 'blank_lines_before_namespace' => true, - 'braces_position' => [ - 'allow_single_line_empty_anonymous_classes' => true, - ], - 'class_definition' => [ - 'inline_constructor_arguments' => false, // handled by method_argument_space fixer - 'space_before_parenthesis' => true, // defined in PSR12 ¶8. Anonymous Classes - ], - 'compact_nullable_type_declaration' => true, - 'declare_equal_normalize' => true, - 'lowercase_cast' => true, - 'lowercase_static_reference' => true, - 'new_with_parentheses' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_extra_blank_lines' => [ - 'tokens' => [ - 'use', // defined in PSR12 ¶3. Declare Statements, Namespace, and Import Statements - ], - ], - 'no_leading_import_slash' => true, - 'no_whitespace_in_blank_line' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - ], - ], - 'ordered_imports' => [ - 'imports_order' => [ - 'class', - 'function', - 'const', - ], - 'sort_algorithm' => 'none', - ], - 'return_type_declaration' => true, - 'short_scalar_cast' => true, - 'single_import_per_statement' => ['group_to_single_imports' => false], - 'single_space_around_construct' => [ - 'constructs_followed_by_a_single_space' => [ - 'abstract', - 'as', - 'case', - 'catch', - 'class', - 'const_import', - 'do', - 'else', - 'elseif', - 'final', - 'finally', - 'for', - 'foreach', - 'function', - 'function_import', - 'if', - 'insteadof', - 'interface', - 'namespace', - 'new', - 'private', - 'protected', - 'public', - 'static', - 'switch', - 'trait', - 'try', - 'use', - 'use_lambda', - 'while', - ], - 'constructs_preceded_by_a_single_space' => [ - 'as', - 'else', - 'elseif', - 'use_lambda', - ], - ], - 'single_trait_insert_per_statement' => true, - 'ternary_operator_spaces' => true, - 'unary_operator_spaces' => [ - 'only_dec_inc' => true, - ], - 'visibility_required' => true, - ]; - } - - public function getDescription(): string - { - return 'Rules that follow `PSR-12 `_ standard.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR1Set.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR1Set.php deleted file mode 100644 index 3c82ea56..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR1Set.php +++ /dev/null @@ -1,36 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - */ -final class PSR1Set extends AbstractRuleSetDescription -{ - public function getRules(): array - { - return [ - 'encoding' => true, - 'full_opening_tag' => true, - ]; - } - - public function getDescription(): string - { - return 'Rules that follow `PSR-1 `_ standard.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR2Set.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR2Set.php deleted file mode 100644 index a386da47..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PSR2Set.php +++ /dev/null @@ -1,104 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - */ -final class PSR2Set extends AbstractRuleSetDescription -{ - public function getRules(): array - { - return [ - '@PSR1' => true, - 'blank_line_after_namespace' => true, - 'braces_position' => true, - 'class_definition' => true, - 'constant_case' => true, - 'control_structure_braces' => true, - 'control_structure_continuation_position' => true, - 'elseif' => true, - 'function_declaration' => true, - 'indentation_type' => true, - 'line_ending' => true, - 'lowercase_keywords' => true, - 'method_argument_space' => [ - 'attribute_placement' => 'ignore', - 'on_multiline' => 'ensure_fully_multiline', - ], - 'no_break_comment' => true, - 'no_closing_tag' => true, - 'no_multiple_statements_per_line' => true, - 'no_space_around_double_colon' => true, - 'no_spaces_after_function_name' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'single_blank_line_at_eof' => true, - 'single_class_element_per_statement' => [ - 'elements' => [ - 'property', - ], - ], - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_space_around_construct' => [ - 'constructs_followed_by_a_single_space' => [ - 'abstract', - 'as', - 'case', - 'catch', - 'class', - 'do', - 'else', - 'elseif', - 'final', - 'for', - 'foreach', - 'function', - 'if', - 'interface', - 'namespace', - 'private', - 'protected', - 'public', - 'static', - 'switch', - 'trait', - 'try', - 'use_lambda', - 'while', - ], - 'constructs_preceded_by_a_single_space' => [ - 'as', - 'else', - 'elseif', - 'use_lambda', - ], - ], - 'spaces_inside_parentheses' => true, - 'statement_indentation' => true, - 'switch_case_semicolon_to_colon' => true, - 'switch_case_space' => true, - 'visibility_required' => ['elements' => ['method', 'property']], - ]; - } - - public function getDescription(): string - { - return 'Rules that follow `PSR-2 `_ standard.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerRiskySet.php deleted file mode 100644 index 9048d242..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerRiskySet.php +++ /dev/null @@ -1,67 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - */ -final class PhpCsFixerRiskySet extends AbstractRuleSetDescription -{ - public function getRules(): array - { - return [ - '@PER-CS:risky' => true, - '@Symfony:risky' => true, - 'comment_to_phpdoc' => true, - 'final_internal_class' => true, - 'get_class_to_class_keyword' => false, - 'modernize_strpos' => false, - // @TODO: consider switching to `true`, like in @Symfony - 'native_constant_invocation' => [ - 'fix_built_in' => false, - 'include' => [ - 'DIRECTORY_SEPARATOR', - 'PHP_INT_SIZE', - 'PHP_SAPI', - 'PHP_VERSION_ID', - ], - 'scope' => 'namespaced', - 'strict' => true, - ], - 'no_alias_functions' => [ - 'sets' => [ - '@all', - ], - ], - 'no_unset_on_property' => true, - 'php_unit_data_provider_name' => true, - 'php_unit_data_provider_return_type' => true, - 'php_unit_data_provider_static' => ['force' => true], - 'php_unit_strict' => true, - 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], - 'static_lambda' => true, - 'strict_comparison' => true, - 'strict_param' => true, - 'yield_from_array_to_yields' => true, - ]; - } - - public function getDescription(): string - { - return 'Rule set as used by the PHP-CS-Fixer development team, highly opinionated.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerSet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerSet.php deleted file mode 100644 index 4e62c98a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PhpCsFixerSet.php +++ /dev/null @@ -1,132 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - */ -final class PhpCsFixerSet extends AbstractRuleSetDescription -{ - public function getRules(): array - { - return [ - '@PER-CS' => true, - '@Symfony' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'case', - 'continue', - 'declare', - 'default', - 'exit', - 'goto', - 'include', - 'include_once', - 'phpdoc', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'yield', - 'yield_from', - ], - ], - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'empty_loop_body' => true, - 'explicit_indirect_variable' => true, - 'explicit_string_variable' => true, - 'fully_qualified_strict_types' => [ - 'import_symbols' => true, - ], - 'heredoc_to_nowdoc' => true, - 'method_argument_space' => [ - 'on_multiline' => 'ensure_fully_multiline', - ], - 'method_chaining_indentation' => true, - 'multiline_comment_opening_closing' => true, - 'multiline_whitespace_before_semicolons' => [ - 'strategy' => 'new_line_for_chained_calls', - ], - 'no_extra_blank_lines' => [ - 'tokens' => [ - 'attribute', - 'break', - 'case', - 'continue', - 'curly_brace_block', - 'default', - 'extra', - 'parenthesis_brace_block', - 'return', - 'square_brace_block', - 'switch', - 'throw', - 'use', - ], - ], - 'no_superfluous_elseif' => true, - 'no_superfluous_phpdoc_tags' => [ - 'allow_mixed' => true, - 'remove_inheritdoc' => true, - ], - 'no_unneeded_control_parentheses' => [ - 'statements' => [ - 'break', - 'clone', - 'continue', - 'echo_print', - 'negative_instanceof', - 'others', - 'return', - 'switch_case', - 'yield', - 'yield_from', - ], - ], - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => ['after_heredoc' => true], - 'ordered_class_elements' => true, - 'ordered_types' => true, - 'php_unit_internal_class' => true, - 'php_unit_test_class_requires_covers' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_order_by_value' => true, - 'phpdoc_types_order' => true, - 'phpdoc_var_annotation_correct_order' => true, - 'protected_to_private' => true, - 'return_assignment' => true, - 'self_static_accessor' => true, - 'single_line_comment_style' => true, - 'single_line_empty_body' => true, - 'single_line_throw' => false, - 'string_implicit_backslashes' => true, - 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays']], - 'whitespace_after_comma_in_array' => ['ensure_single_space' => true], - ]; - } - - public function getDescription(): string - { - return 'Rule set as used by the PHP-CS-Fixer development team, highly opinionated.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonyRiskySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonyRiskySet.php deleted file mode 100644 index f60d9cac..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonyRiskySet.php +++ /dev/null @@ -1,78 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - */ -final class SymfonyRiskySet extends AbstractRuleSetDescription -{ - public function getRules(): array - { - return [ - '@PHP56Migration:risky' => true, - '@PSR12:risky' => true, - 'array_push' => true, - 'combine_nested_dirname' => true, - 'dir_constant' => true, - 'ereg_to_preg' => true, - 'error_suppression' => true, - 'fopen_flag_order' => true, - 'fopen_flags' => [ - 'b_mode' => false, - ], - 'function_to_constant' => true, - 'get_class_to_class_keyword' => true, - 'implode_call' => true, - 'is_null' => true, - 'logical_operators' => true, - 'long_to_shorthand_operator' => true, - 'modernize_strpos' => true, - 'modernize_types_casting' => true, - 'native_constant_invocation' => ['strict' => false], - 'native_function_invocation' => [ - 'include' => [ - '@compiler_optimized', - ], - 'scope' => 'namespaced', - 'strict' => true, - ], - 'no_alias_functions' => true, - 'no_homoglyph_names' => true, - 'no_php4_constructor' => true, - 'no_unneeded_final_method' => true, - 'no_useless_sprintf' => true, - 'non_printable_character' => true, - 'ordered_traits' => true, - 'php_unit_construct' => true, - 'php_unit_mock_short_will_return' => true, - 'php_unit_set_up_tear_down_visibility' => true, - 'php_unit_test_annotation' => true, - 'psr_autoloading' => true, - 'self_accessor' => true, - 'set_type_to_cast' => true, - 'string_length_to_empty' => true, - 'string_line_ending' => true, - 'ternary_to_elvis_operator' => true, - ]; - } - - public function getDescription(): string - { - return 'Rules that follow the official `Symfony Coding Standards `_.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonySet.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonySet.php deleted file mode 100644 index 28af540d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/RuleSet/Sets/SymfonySet.php +++ /dev/null @@ -1,241 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\RuleSet\Sets; - -use PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer; -use PhpCsFixer\RuleSet\AbstractRuleSetDescription; - -/** - * @internal - */ -final class SymfonySet extends AbstractRuleSetDescription -{ - public function getRules(): array - { - return [ - '@PER-CS2.0' => true, - 'align_multiline_comment' => true, - 'backtick_to_shell_exec' => true, - 'binary_operator_spaces' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'return', - ], - ], - 'braces_position' => [ - 'allow_single_line_anonymous_functions' => true, - 'allow_single_line_empty_anonymous_classes' => true, - ], - 'class_attributes_separation' => [ - 'elements' => [ - 'method' => 'one', - ], - ], - 'class_definition' => [ - 'single_line' => true, - ], - 'class_reference_name_casing' => true, - 'clean_namespace' => true, - 'concat_space' => true, // overrides @PER-CS2.0 - 'declare_parentheses' => true, - 'echo_tag_syntax' => true, - 'empty_loop_body' => ['style' => 'braces'], - 'empty_loop_condition' => true, - 'fully_qualified_strict_types' => true, - 'function_declaration' => true, // overrides @PER-CS2.0 - 'general_phpdoc_tag_rename' => [ - 'replacements' => [ - 'inheritDocs' => 'inheritDoc', - ], - ], - 'global_namespace_import' => [ - 'import_classes' => false, - 'import_constants' => false, - 'import_functions' => false, - ], - 'include' => true, - 'increment_style' => true, - 'integer_literal_case' => true, - 'lambda_not_used_import' => true, - 'linebreak_after_opening_tag' => true, - 'magic_constant_casing' => true, - 'magic_method_casing' => true, - 'method_argument_space' => [ // overrides @PER-CS2.0 - 'on_multiline' => 'ignore', - ], - 'native_function_casing' => true, - 'native_type_declaration_casing' => true, - 'no_alias_language_construct_call' => true, - 'no_alternative_syntax' => true, - 'no_binary_string' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => [ - 'tokens' => [ - 'attribute', - 'case', - 'continue', - 'curly_brace_block', - 'default', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'switch', - 'throw', - 'use', - ], - ], - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_null_property_initialization' => true, - 'no_short_bool_cast' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_around_offset' => true, - 'no_superfluous_phpdoc_tags' => [ - 'allow_hidden_params' => true, - 'remove_inheritdoc' => true, - ], - 'no_trailing_comma_in_singleline' => true, - 'no_unneeded_braces' => [ - 'namespaces' => true, - ], - 'no_unneeded_control_parentheses' => [ - 'statements' => [ - 'break', - 'clone', - 'continue', - 'echo_print', - 'others', - 'return', - 'switch_case', - 'yield', - 'yield_from', - ], - ], - 'no_unneeded_import_alias' => true, - 'no_unset_cast' => true, - 'no_unused_imports' => true, - 'no_useless_concat_operator' => true, - 'no_useless_nullsafe_operator' => true, - 'no_whitespace_before_comma_in_array' => true, - 'normalize_index_brace' => true, - 'nullable_type_declaration' => true, - 'nullable_type_declaration_for_default_null_value' => true, - 'object_operator_without_whitespace' => true, - 'operator_linebreak' => [ - 'only_booleans' => true, - ], - 'ordered_imports' => [ - 'imports_order' => [ - 'class', - 'function', - 'const', - ], - 'sort_algorithm' => 'alpha', - ], - 'ordered_types' => [ - 'null_adjustment' => 'always_last', - 'sort_algorithm' => 'none', - ], - 'php_unit_fqcn_annotation' => true, - 'php_unit_method_casing' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_inline_tag_normalizer' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_alias_tag' => true, - 'phpdoc_no_package' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_order' => [ - 'order' => [ - 'param', - 'return', - 'throws', - ], - ], - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => [ - 'groups' => [ - ['Annotation', 'NamedArgumentConstructor', 'Target'], - ...PhpdocSeparationFixer::OPTION_GROUPS_DEFAULT, - ], - ], - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_summary' => true, - 'phpdoc_tag_type' => [ - 'tags' => [ - 'inheritDoc' => 'inline', - ], - ], - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => true, - 'phpdoc_types_order' => [ - 'null_adjustment' => 'always_last', - 'sort_algorithm' => 'none', - ], - 'phpdoc_var_without_name' => true, - 'semicolon_after_instruction' => true, - 'simple_to_complex_string_variable' => true, - 'single_class_element_per_statement' => true, - 'single_import_per_statement' => true, - 'single_line_comment_spacing' => true, - 'single_line_comment_style' => [ - 'comment_types' => [ - 'hash', - ], - ], - 'single_line_empty_body' => false, // overrides @PER-CS2.0 - 'single_line_throw' => true, - 'single_quote' => true, - 'single_space_around_construct' => true, - 'space_after_semicolon' => [ - 'remove_in_empty_for_expressions' => true, - ], - 'standardize_increment' => true, - 'standardize_not_equals' => true, - 'statement_indentation' => [ - 'stick_comment_to_next_continuous_control_statement' => true, - ], - 'switch_continue_to_break' => true, - 'trailing_comma_in_multiline' => [ - 'after_heredoc' => true, - 'elements' => [ // explicitly omit 'arguments' - 'array_destructuring', - 'arrays', - 'match', - 'parameters', - ], - ], - 'trim_array_spaces' => true, - 'type_declaration_spaces' => true, - 'types_spaces' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - 'yoda_style' => true, - ]; - } - - public function getDescription(): string - { - return 'Rules that follow the official `Symfony Coding Standards `_.'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/AnalysisStarted.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/AnalysisStarted.php deleted file mode 100644 index 75c9ff7b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/AnalysisStarted.php +++ /dev/null @@ -1,54 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner\Event; - -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Event that is fired when Fixer starts analysis. - * - * @author Greg Korba - * - * @internal - */ -final class AnalysisStarted extends Event -{ - public const NAME = 'fixer.analysis_started'; - public const MODE_SEQUENTIAL = 'sequential'; - public const MODE_PARALLEL = 'parallel'; - - /** @var self::MODE_* */ - private string $mode; - private bool $dryRun; - - /** - * @param self::MODE_* $mode - */ - public function __construct(string $mode, bool $dryRun) - { - $this->mode = $mode; - $this->dryRun = $dryRun; - } - - public function getMode(): string - { - return $this->mode; - } - - public function isDryRun(): bool - { - return $this->dryRun; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/FileProcessed.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/FileProcessed.php deleted file mode 100644 index b9d4bcda..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Event/FileProcessed.php +++ /dev/null @@ -1,75 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner\Event; - -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Event that is fired when file was processed by Fixer. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class FileProcessed extends Event -{ - /** - * Event name. - */ - public const NAME = 'fixer.file_processed'; - - public const STATUS_INVALID = 1; - public const STATUS_SKIPPED = 2; - public const STATUS_NO_CHANGES = 3; - public const STATUS_FIXED = 4; - public const STATUS_EXCEPTION = 5; - public const STATUS_LINT = 6; - - /** - * @var self::STATUS_* - */ - private int $status; - - private ?string $fileRelativePath; - private ?string $fileHash; - - /** - * @param self::STATUS_* $status - */ - public function __construct(int $status, ?string $fileRelativePath = null, ?string $fileHash = null) - { - $this->status = $status; - $this->fileRelativePath = $fileRelativePath; - $this->fileHash = $fileHash; - } - - /** - * @return self::STATUS_* - */ - public function getStatus(): int - { - return $this->status; - } - - public function getFileRelativePath(): ?string - { - return $this->fileRelativePath; - } - - public function getFileHash(): ?string - { - return $this->fileHash; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileCachingLintingFileIterator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileCachingLintingFileIterator.php deleted file mode 100644 index c46cf3d3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileCachingLintingFileIterator.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner; - -use PhpCsFixer\Linter\LinterInterface; -use PhpCsFixer\Linter\LintingResultInterface; - -/** - * @author Dariusz Rumiński - * - * @internal - * - * @extends \CachingIterator> - */ -final class FileCachingLintingFileIterator extends \CachingIterator implements LintingResultAwareFileIteratorInterface -{ - private LinterInterface $linter; - private ?LintingResultInterface $currentResult = null; - private ?LintingResultInterface $nextResult = null; - - /** - * @param \Iterator $iterator - */ - public function __construct(\Iterator $iterator, LinterInterface $linter) - { - parent::__construct($iterator); - - $this->linter = $linter; - } - - public function currentLintingResult(): ?LintingResultInterface - { - return $this->currentResult; - } - - public function next(): void - { - parent::next(); - - $this->currentResult = $this->nextResult; - - if ($this->hasNext()) { - $this->nextResult = $this->handleItem($this->getInnerIterator()->current()); - } - } - - public function rewind(): void - { - parent::rewind(); - - if ($this->valid()) { - $this->currentResult = $this->handleItem($this->current()); - } - - if ($this->hasNext()) { - $this->nextResult = $this->handleItem($this->getInnerIterator()->current()); - } - } - - private function handleItem(\SplFileInfo $file): LintingResultInterface - { - return $this->linter->lintFile($file->getRealPath()); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileFilterIterator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileFilterIterator.php deleted file mode 100644 index 8a597218..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/FileFilterIterator.php +++ /dev/null @@ -1,108 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner; - -use PhpCsFixer\Cache\CacheManagerInterface; -use PhpCsFixer\FileReader; -use PhpCsFixer\Runner\Event\FileProcessed; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * @author Dariusz Rumiński - * - * @internal - * - * @extends \FilterIterator> - */ -final class FileFilterIterator extends \FilterIterator -{ - private ?EventDispatcherInterface $eventDispatcher; - - private CacheManagerInterface $cacheManager; - - /** - * @var array - */ - private array $visitedElements = []; - - /** - * @param \Traversable<\SplFileInfo> $iterator - */ - public function __construct( - \Traversable $iterator, - ?EventDispatcherInterface $eventDispatcher, - CacheManagerInterface $cacheManager - ) { - if (!$iterator instanceof \Iterator) { - $iterator = new \IteratorIterator($iterator); - } - - parent::__construct($iterator); - - $this->eventDispatcher = $eventDispatcher; - $this->cacheManager = $cacheManager; - } - - public function accept(): bool - { - $file = $this->current(); - if (!$file instanceof \SplFileInfo) { - throw new \RuntimeException( - \sprintf( - 'Expected instance of "\SplFileInfo", got "%s".', - get_debug_type($file) - ) - ); - } - - $path = $file->isLink() ? $file->getPathname() : $file->getRealPath(); - - if (isset($this->visitedElements[$path])) { - return false; - } - - $this->visitedElements[$path] = true; - - if (!$file->isFile() || $file->isLink()) { - return false; - } - - $content = FileReader::createSingleton()->read($path); - - // mark as skipped: - if ( - // empty file - '' === $content - // file that does not need fixing due to cache - || !$this->cacheManager->needFixing($file->getPathname(), $content) - ) { - $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_SKIPPED)); - - return false; - } - - return true; - } - - private function dispatchEvent(string $name, Event $event): void - { - if (null === $this->eventDispatcher) { - return; - } - - $this->eventDispatcher->dispatch($event, $name); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingFileIterator.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingFileIterator.php deleted file mode 100644 index 19bd6771..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingFileIterator.php +++ /dev/null @@ -1,66 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner; - -use PhpCsFixer\Linter\LinterInterface; -use PhpCsFixer\Linter\LintingResultInterface; - -/** - * @author Dariusz Rumiński - * - * @internal - * - * @extends \IteratorIterator> - */ -final class LintingFileIterator extends \IteratorIterator implements LintingResultAwareFileIteratorInterface -{ - private ?LintingResultInterface $currentResult = null; - - private LinterInterface $linter; - - /** - * @param \Iterator $iterator - */ - public function __construct(\Iterator $iterator, LinterInterface $linter) - { - parent::__construct($iterator); - - $this->linter = $linter; - } - - public function currentLintingResult(): ?LintingResultInterface - { - return $this->currentResult; - } - - public function next(): void - { - parent::next(); - - $this->currentResult = $this->valid() ? $this->handleItem($this->current()) : null; - } - - public function rewind(): void - { - parent::rewind(); - - $this->currentResult = $this->valid() ? $this->handleItem($this->current()) : null; - } - - private function handleItem(\SplFileInfo $file): LintingResultInterface - { - return $this->linter->lintFile($file->getRealPath()); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingResultAwareFileIteratorInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingResultAwareFileIteratorInterface.php deleted file mode 100644 index 1c05bf29..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/LintingResultAwareFileIteratorInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner; - -use PhpCsFixer\Linter\LintingResultInterface; - -/** - * @author Greg Korba - * - * @internal - * - * @extends \Iterator - */ -interface LintingResultAwareFileIteratorInterface extends \Iterator -{ - public function currentLintingResult(): ?LintingResultInterface; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelAction.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelAction.php deleted file mode 100644 index 42585ee2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelAction.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner\Parallel; - -/** - * @author Greg Korba - * - * @internal - */ -final class ParallelAction -{ - // Actions executed by the runner (main process) - public const RUNNER_REQUEST_ANALYSIS = 'requestAnalysis'; - public const RUNNER_THANK_YOU = 'thankYou'; - - // Actions executed by the worker - public const WORKER_ERROR_REPORT = 'errorReport'; - public const WORKER_GET_FILE_CHUNK = 'getFileChunk'; - public const WORKER_HELLO = 'hello'; - public const WORKER_RESULT = 'result'; - - private function __construct() {} -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfig.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfig.php deleted file mode 100644 index b4886c6b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfig.php +++ /dev/null @@ -1,67 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner\Parallel; - -/** - * @author Greg Korba - * - * @readonly - */ -final class ParallelConfig -{ - /** @internal */ - public const DEFAULT_FILES_PER_PROCESS = 10; - - /** @internal */ - public const DEFAULT_PROCESS_TIMEOUT = 120; - - private int $filesPerProcess; - private int $maxProcesses; - private int $processTimeout; - - /** - * @param positive-int $maxProcesses - * @param positive-int $filesPerProcess - * @param positive-int $processTimeout - */ - public function __construct( - int $maxProcesses = 2, - int $filesPerProcess = self::DEFAULT_FILES_PER_PROCESS, - int $processTimeout = self::DEFAULT_PROCESS_TIMEOUT - ) { - if ($maxProcesses <= 0 || $filesPerProcess <= 0 || $processTimeout <= 0) { - throw new \InvalidArgumentException('Invalid parallelisation configuration: only positive integers are allowed'); - } - - $this->maxProcesses = $maxProcesses; - $this->filesPerProcess = $filesPerProcess; - $this->processTimeout = $processTimeout; - } - - public function getFilesPerProcess(): int - { - return $this->filesPerProcess; - } - - public function getMaxProcesses(): int - { - return $this->maxProcesses; - } - - public function getProcessTimeout(): int - { - return $this->processTimeout; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfigFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfigFactory.php deleted file mode 100644 index 5d306d45..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelConfigFactory.php +++ /dev/null @@ -1,61 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner\Parallel; - -use Fidry\CpuCoreCounter\CpuCoreCounter; -use Fidry\CpuCoreCounter\Finder\DummyCpuCoreFinder; -use Fidry\CpuCoreCounter\Finder\FinderRegistry; - -/** - * @author Dariusz Rumiński - */ -final class ParallelConfigFactory -{ - private static ?CpuCoreCounter $cpuDetector = null; - - private function __construct() {} - - public static function sequential(): ParallelConfig - { - return new ParallelConfig(1); - } - - /** - * @param null|positive-int $filesPerProcess - * @param null|positive-int $processTimeout - * @param null|positive-int $maxProcesses - */ - public static function detect( - ?int $filesPerProcess = null, - ?int $processTimeout = null, - ?int $maxProcesses = null - ): ParallelConfig { - if (null === self::$cpuDetector) { - self::$cpuDetector = new CpuCoreCounter([ - ...FinderRegistry::getDefaultLogicalFinders(), - new DummyCpuCoreFinder(1), - ]); - } - - // Reserve 1 core for the main orchestrating process - $available = self::$cpuDetector->getAvailableForParallelisation(1, $maxProcesses); - - return new ParallelConfig( - $available->availableCpus, - $filesPerProcess ?? ParallelConfig::DEFAULT_FILES_PER_PROCESS, - $processTimeout ?? ParallelConfig::DEFAULT_PROCESS_TIMEOUT - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelisationException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelisationException.php deleted file mode 100644 index 8c24e6a4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ParallelisationException.php +++ /dev/null @@ -1,30 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner\Parallel; - -/** - * Common exception for all the errors related to parallelisation. - * - * @author Greg Korba - * - * @internal - */ -final class ParallelisationException extends \RuntimeException -{ - public static function forUnknownIdentifier(ProcessIdentifier $identifier): self - { - return new self('Unknown process identifier: '.$identifier->toString()); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/Process.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/Process.php deleted file mode 100644 index 0d5ce588..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/Process.php +++ /dev/null @@ -1,189 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner\Parallel; - -use React\ChildProcess\Process as ReactProcess; -use React\EventLoop\LoopInterface; -use React\EventLoop\TimerInterface; -use React\Stream\ReadableStreamInterface; -use React\Stream\WritableStreamInterface; - -/** - * Represents single process that is handled within parallel run. - * Inspired by: - * - https://github.com/phpstan/phpstan-src/blob/9ce425bca5337039fb52c0acf96a20a2b8ace490/src/Parallel/Process.php - * - https://github.com/phpstan/phpstan-src/blob/1477e752b4b5893f323b6d2c43591e68b3d85003/src/Process/ProcessHelper.php. - * - * @author Greg Korba - * - * @internal - */ -final class Process -{ - // Properties required for process instantiation - private string $command; - private LoopInterface $loop; - private int $timeoutSeconds; - - // Properties required for process execution - private ?ReactProcess $process = null; - private ?WritableStreamInterface $in = null; - - /** @var resource */ - private $stdErr; - - /** @var resource */ - private $stdOut; - - /** @var callable(array): void */ - private $onData; - - /** @var callable(\Throwable): void */ - private $onError; - - private ?TimerInterface $timer = null; - - public function __construct(string $command, LoopInterface $loop, int $timeoutSeconds) - { - $this->command = $command; - $this->loop = $loop; - $this->timeoutSeconds = $timeoutSeconds; - } - - /** - * @param callable(array $json): void $onData callback to be called when data is received from the parallelisation operator - * @param callable(\Throwable $exception): void $onError callback to be called when an exception occurs - * @param callable(?int $exitCode, string $output): void $onExit callback to be called when the process exits - */ - public function start(callable $onData, callable $onError, callable $onExit): void - { - $stdOut = tmpfile(); - if (false === $stdOut) { - throw new ParallelisationException('Failed creating temp file for stdOut.'); - } - $this->stdOut = $stdOut; - - $stdErr = tmpfile(); - if (false === $stdErr) { - throw new ParallelisationException('Failed creating temp file for stdErr.'); - } - $this->stdErr = $stdErr; - - $this->onData = $onData; - $this->onError = $onError; - - $this->process = new ReactProcess($this->command, null, null, [ - 1 => $this->stdOut, - 2 => $this->stdErr, - ]); - $this->process->start($this->loop); - $this->process->on('exit', function ($exitCode) use ($onExit): void { - $this->cancelTimer(); - - $output = ''; - rewind($this->stdOut); - $stdOut = stream_get_contents($this->stdOut); - if (\is_string($stdOut)) { - $output .= $stdOut; - } - - rewind($this->stdErr); - $stdErr = stream_get_contents($this->stdErr); - if (\is_string($stdErr)) { - $output .= $stdErr; - } - - $onExit($exitCode, $output); - - fclose($this->stdOut); - fclose($this->stdErr); - }); - } - - /** - * Handles requests from parallelisation operator to its worker (spawned process). - * - * @param array $data - */ - public function request(array $data): void - { - $this->cancelTimer(); // Configured process timeout actually means "chunk timeout" (each request resets timer) - - if (null === $this->in) { - throw new ParallelisationException( - 'Process not connected with parallelisation operator, ensure `bindConnection()` was called' - ); - } - - $this->in->write($data); - $this->timer = $this->loop->addTimer($this->timeoutSeconds, function (): void { - ($this->onError)( - new \Exception( - \sprintf( - 'Child process timed out after %d seconds. Try making it longer using `ParallelConfig`.', - $this->timeoutSeconds - ) - ) - ); - }); - } - - public function quit(): void - { - $this->cancelTimer(); - if (null === $this->process || !$this->process->isRunning()) { - return; - } - - foreach ($this->process->pipes as $pipe) { - $pipe->close(); - } - - if (null === $this->in) { - return; - } - - $this->in->end(); - } - - public function bindConnection(ReadableStreamInterface $out, WritableStreamInterface $in): void - { - $this->in = $in; - - $in->on('error', function (\Throwable $error): void { - ($this->onError)($error); - }); - - $out->on('data', function (array $json): void { - $this->cancelTimer(); - - // Pass everything to the parallelisation operator, it should decide how to handle the data - ($this->onData)($json); - }); - $out->on('error', function (\Throwable $error): void { - ($this->onError)($error); - }); - } - - private function cancelTimer(): void - { - if (null === $this->timer) { - return; - } - - $this->loop->cancelTimer($this->timer); - $this->timer = null; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessFactory.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessFactory.php deleted file mode 100644 index 5649e251..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessFactory.php +++ /dev/null @@ -1,111 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner\Parallel; - -use PhpCsFixer\Runner\RunnerConfig; -use React\EventLoop\LoopInterface; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Process\PhpExecutableFinder; - -/** - * @author Greg Korba - * - * @readonly - * - * @internal - */ -final class ProcessFactory -{ - private InputInterface $input; - - public function __construct(InputInterface $input) - { - $this->input = $input; - } - - public function create( - LoopInterface $loop, - RunnerConfig $runnerConfig, - ProcessIdentifier $identifier, - int $serverPort - ): Process { - $commandArgs = $this->getCommandArgs($serverPort, $identifier, $runnerConfig); - - return new Process( - implode(' ', $commandArgs), - $loop, - $runnerConfig->getParallelConfig()->getProcessTimeout() - ); - } - - /** - * @private - * - * @return list - */ - public function getCommandArgs(int $serverPort, ProcessIdentifier $identifier, RunnerConfig $runnerConfig): array - { - $phpBinary = (new PhpExecutableFinder())->find(false); - - if (false === $phpBinary) { - throw new ParallelisationException('Cannot find PHP executable.'); - } - - $mainScript = realpath(__DIR__.'/../../../php-cs-fixer'); - if (false === $mainScript - && isset($_SERVER['argv'][0]) - && str_contains($_SERVER['argv'][0], 'php-cs-fixer') - ) { - $mainScript = $_SERVER['argv'][0]; - } - - if (!is_file($mainScript)) { - throw new ParallelisationException('Cannot determine Fixer executable.'); - } - - $commandArgs = [ - escapeshellarg($phpBinary), - escapeshellarg($mainScript), - 'worker', - '--port', - (string) $serverPort, - '--identifier', - escapeshellarg($identifier->toString()), - ]; - - if ($runnerConfig->isDryRun()) { - $commandArgs[] = '--dry-run'; - } - - if (filter_var($this->input->getOption('diff'), FILTER_VALIDATE_BOOLEAN)) { - $commandArgs[] = '--diff'; - } - - if (filter_var($this->input->getOption('stop-on-violation'), FILTER_VALIDATE_BOOLEAN)) { - $commandArgs[] = '--stop-on-violation'; - } - - foreach (['allow-risky', 'config', 'rules', 'using-cache', 'cache-file'] as $option) { - $optionValue = $this->input->getOption($option); - - if (null !== $optionValue) { - $commandArgs[] = "--{$option}"; - $commandArgs[] = escapeshellarg($optionValue); - } - } - - return $commandArgs; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessIdentifier.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessIdentifier.php deleted file mode 100644 index 20df38d8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessIdentifier.php +++ /dev/null @@ -1,55 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner\Parallel; - -/** - * Represents identifier of single process that is handled within parallel run. - * - * @author Greg Korba - * - * @readonly - * - * @internal - */ -final class ProcessIdentifier -{ - private const IDENTIFIER_PREFIX = 'php-cs-fixer_parallel_'; - - private string $identifier; - - private function __construct(string $identifier) - { - $this->identifier = $identifier; - } - - public function toString(): string - { - return $this->identifier; - } - - public static function create(): self - { - return new self(uniqid(self::IDENTIFIER_PREFIX, true)); - } - - public static function fromRaw(string $identifier): self - { - if (!str_starts_with($identifier, self::IDENTIFIER_PREFIX)) { - throw new ParallelisationException(\sprintf('Invalid process identifier "%s".', $identifier)); - } - - return new self($identifier); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessPool.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessPool.php deleted file mode 100644 index 215023f2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/ProcessPool.php +++ /dev/null @@ -1,99 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner\Parallel; - -use React\Socket\ServerInterface; - -/** - * Represents collection of active processes that are being run in parallel. - * Inspired by {@see https://github.com/phpstan/phpstan-src/blob/ed68345a82992775112acc2c2bd639d1bd3a1a02/src/Parallel/ProcessPool.php}. - * - * @author Greg Korba - * - * @internal - */ -final class ProcessPool -{ - /** - * @readonly - */ - private ServerInterface $server; - - /** - * @var null|(callable(): void) - * - * @readonly - */ - private $onServerClose; - - /** - * @var array - */ - private array $processes = []; - - /** - * @param null|(callable(): void) $onServerClose - */ - public function __construct(ServerInterface $server, ?callable $onServerClose = null) - { - $this->server = $server; - $this->onServerClose = $onServerClose; - } - - public function getProcess(ProcessIdentifier $identifier): Process - { - if (!isset($this->processes[$identifier->toString()])) { - throw ParallelisationException::forUnknownIdentifier($identifier); - } - - return $this->processes[$identifier->toString()]; - } - - public function addProcess(ProcessIdentifier $identifier, Process $process): void - { - $this->processes[$identifier->toString()] = $process; - } - - public function endProcessIfKnown(ProcessIdentifier $identifier): void - { - if (!isset($this->processes[$identifier->toString()])) { - return; - } - - $this->endProcess($identifier); - } - - public function endAll(): void - { - foreach (array_keys($this->processes) as $identifier) { - $this->endProcessIfKnown(ProcessIdentifier::fromRaw($identifier)); - } - } - - private function endProcess(ProcessIdentifier $identifier): void - { - $this->getProcess($identifier)->quit(); - - unset($this->processes[$identifier->toString()]); - - if (0 === \count($this->processes)) { - $this->server->close(); - - if (null !== $this->onServerClose) { - ($this->onServerClose)(); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/WorkerException.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/WorkerException.php deleted file mode 100644 index 714306d3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/WorkerException.php +++ /dev/null @@ -1,66 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner\Parallel; - -use Throwable; - -/** - * @author Greg Korba - * - * @internal - */ -final class WorkerException extends \RuntimeException -{ - private string $originalTraceAsString; - - private function __construct(string $message, int $code) - { - parent::__construct($message, $code); - } - - /** - * @param array{ - * class: class-string, - * message: string, - * file: string, - * line: int, - * code: int, - * trace: string - * } $data - */ - public static function fromRaw(array $data): self - { - $exception = new self( - \sprintf('[%s] %s', $data['class'], $data['message']), - $data['code'] - ); - $exception->file = $data['file']; - $exception->line = $data['line']; - $exception->originalTraceAsString = \sprintf( - '## %s(%d)%s%s', - $data['file'], - $data['line'], - PHP_EOL, - $data['trace'] - ); - - return $exception; - } - - public function getOriginalTraceAsString(): string - { - return $this->originalTraceAsString; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php deleted file mode 100644 index 9b022572..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php +++ /dev/null @@ -1,589 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner; - -use Clue\React\NDJson\Decoder; -use Clue\React\NDJson\Encoder; -use PhpCsFixer\AbstractFixer; -use PhpCsFixer\Cache\CacheManagerInterface; -use PhpCsFixer\Cache\Directory; -use PhpCsFixer\Cache\DirectoryInterface; -use PhpCsFixer\Console\Command\WorkerCommand; -use PhpCsFixer\Differ\DifferInterface; -use PhpCsFixer\Error\Error; -use PhpCsFixer\Error\ErrorsManager; -use PhpCsFixer\Error\SourceExceptionFactory; -use PhpCsFixer\FileReader; -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\Linter\LinterInterface; -use PhpCsFixer\Linter\LintingException; -use PhpCsFixer\Linter\LintingResultInterface; -use PhpCsFixer\Preg; -use PhpCsFixer\Runner\Event\AnalysisStarted; -use PhpCsFixer\Runner\Event\FileProcessed; -use PhpCsFixer\Runner\Parallel\ParallelAction; -use PhpCsFixer\Runner\Parallel\ParallelConfig; -use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; -use PhpCsFixer\Runner\Parallel\ParallelisationException; -use PhpCsFixer\Runner\Parallel\ProcessFactory; -use PhpCsFixer\Runner\Parallel\ProcessIdentifier; -use PhpCsFixer\Runner\Parallel\ProcessPool; -use PhpCsFixer\Runner\Parallel\WorkerException; -use PhpCsFixer\Tokenizer\Tokens; -use React\EventLoop\StreamSelectLoop; -use React\Socket\ConnectionInterface; -use React\Socket\TcpServer; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\Filesystem\Exception\IOException; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * @author Dariusz Rumiński - * @author Greg Korba - * - * @phpstan-type _RunResult array, diff: string}> - */ -final class Runner -{ - /** - * Buffer size used in the NDJSON decoder for communication between main process and workers. - * - * @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8068 - */ - private const PARALLEL_BUFFER_SIZE = 16 * (1_024 * 1_024 /* 1MB */); - - private DifferInterface $differ; - - private DirectoryInterface $directory; - - private ?EventDispatcherInterface $eventDispatcher; - - private ErrorsManager $errorsManager; - - private CacheManagerInterface $cacheManager; - - private bool $isDryRun; - - private LinterInterface $linter; - - /** - * @var null|\Traversable - */ - private ?\Traversable $fileIterator = null; - - private int $fileCount; - - /** - * @var list - */ - private array $fixers; - - private bool $stopOnViolation; - - private ParallelConfig $parallelConfig; - - private ?InputInterface $input; - - private ?string $configFile; - - /** - * @param null|\Traversable $fileIterator - * @param list $fixers - */ - public function __construct( - ?\Traversable $fileIterator, - array $fixers, - DifferInterface $differ, - ?EventDispatcherInterface $eventDispatcher, - ErrorsManager $errorsManager, - LinterInterface $linter, - bool $isDryRun, - CacheManagerInterface $cacheManager, - ?DirectoryInterface $directory = null, - bool $stopOnViolation = false, - // @TODO Make these arguments required in 4.0 - ?ParallelConfig $parallelConfig = null, - ?InputInterface $input = null, - ?string $configFile = null - ) { - // Required only for main process (calculating workers count) - $this->fileCount = null !== $fileIterator ? \count(iterator_to_array($fileIterator)) : 0; - - $this->fileIterator = $fileIterator; - $this->fixers = $fixers; - $this->differ = $differ; - $this->eventDispatcher = $eventDispatcher; - $this->errorsManager = $errorsManager; - $this->linter = $linter; - $this->isDryRun = $isDryRun; - $this->cacheManager = $cacheManager; - $this->directory = $directory ?? new Directory(''); - $this->stopOnViolation = $stopOnViolation; - $this->parallelConfig = $parallelConfig ?? ParallelConfigFactory::sequential(); - $this->input = $input; - $this->configFile = $configFile; - } - - /** - * @TODO consider to drop this method and make iterator parameter obligatory in constructor, - * more in https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777/files#r1590447581 - * - * @param \Traversable $fileIterator - */ - public function setFileIterator(iterable $fileIterator): void - { - $this->fileIterator = $fileIterator; - - // Required only for main process (calculating workers count) - $this->fileCount = \count(iterator_to_array($fileIterator)); - } - - /** - * @return _RunResult - */ - public function fix(): array - { - if (0 === $this->fileCount) { - return []; - } - - // @TODO 4.0: Remove condition and its body, as no longer needed when param will be required in the constructor. - // This is a fallback only in case someone calls `new Runner()` in a custom repo and does not provide v4-ready params in v3-codebase. - if (null === $this->input) { - return $this->fixSequential(); - } - - if ( - 1 === $this->parallelConfig->getMaxProcesses() - || $this->fileCount <= $this->parallelConfig->getFilesPerProcess() - ) { - return $this->fixSequential(); - } - - return $this->fixParallel(); - } - - /** - * Heavily inspired by {@see https://github.com/phpstan/phpstan-src/blob/9ce425bca5337039fb52c0acf96a20a2b8ace490/src/Parallel/ParallelAnalyser.php}. - * - * @return _RunResult - */ - private function fixParallel(): array - { - $this->dispatchEvent(AnalysisStarted::NAME, new AnalysisStarted(AnalysisStarted::MODE_PARALLEL, $this->isDryRun)); - - $changed = []; - $streamSelectLoop = new StreamSelectLoop(); - $server = new TcpServer('127.0.0.1:0', $streamSelectLoop); - $serverPort = parse_url($server->getAddress() ?? '', PHP_URL_PORT); - - if (!is_numeric($serverPort)) { - throw new ParallelisationException(\sprintf( - 'Unable to parse server port from "%s"', - $server->getAddress() ?? '' - )); - } - - $processPool = new ProcessPool($server); - $maxFilesPerProcess = $this->parallelConfig->getFilesPerProcess(); - $fileIterator = $this->getFilteringFileIterator(); - $fileIterator->rewind(); - - $getFileChunk = static function () use ($fileIterator, $maxFilesPerProcess): array { - $files = []; - - while (\count($files) < $maxFilesPerProcess) { - $current = $fileIterator->current(); - - if (null === $current) { - break; - } - - $files[] = $current->getRealPath(); - - $fileIterator->next(); - } - - return $files; - }; - - // [REACT] Handle worker's handshake (init connection) - $server->on('connection', static function (ConnectionInterface $connection) use ($processPool, $getFileChunk): void { - $jsonInvalidUtf8Ignore = \defined('JSON_INVALID_UTF8_IGNORE') ? JSON_INVALID_UTF8_IGNORE : 0; - $decoder = new Decoder( - $connection, - true, - 512, - $jsonInvalidUtf8Ignore, - self::PARALLEL_BUFFER_SIZE - ); - $encoder = new Encoder($connection, $jsonInvalidUtf8Ignore); - - // [REACT] Bind connection when worker's process requests "hello" action (enables 2-way communication) - $decoder->on('data', static function (array $data) use ($processPool, $getFileChunk, $decoder, $encoder): void { - if (ParallelAction::WORKER_HELLO !== $data['action']) { - return; - } - - $identifier = ProcessIdentifier::fromRaw($data['identifier']); - $process = $processPool->getProcess($identifier); - $process->bindConnection($decoder, $encoder); - $fileChunk = $getFileChunk(); - - if (0 === \count($fileChunk)) { - $process->request(['action' => ParallelAction::RUNNER_THANK_YOU]); - $processPool->endProcessIfKnown($identifier); - - return; - } - - $process->request(['action' => ParallelAction::RUNNER_REQUEST_ANALYSIS, 'files' => $fileChunk]); - }); - }); - - $processesToSpawn = min( - $this->parallelConfig->getMaxProcesses(), - max( - 1, - (int) ceil($this->fileCount / $this->parallelConfig->getFilesPerProcess()), - ) - ); - $processFactory = new ProcessFactory($this->input); - - for ($i = 0; $i < $processesToSpawn; ++$i) { - $identifier = ProcessIdentifier::create(); - $process = $processFactory->create( - $streamSelectLoop, - new RunnerConfig( - $this->isDryRun, - $this->stopOnViolation, - $this->parallelConfig, - $this->configFile - ), - $identifier, - $serverPort, - ); - $processPool->addProcess($identifier, $process); - $process->start( - // [REACT] Handle workers' responses (multiple actions possible) - function (array $workerResponse) use ($processPool, $process, $identifier, $getFileChunk, &$changed): void { - // File analysis result (we want close-to-realtime progress with frequent cache savings) - if (ParallelAction::WORKER_RESULT === $workerResponse['action']) { - $fileAbsolutePath = $workerResponse['file']; - $fileRelativePath = $this->directory->getRelativePathTo($fileAbsolutePath); - - // Dispatch an event for each file processed and dispatch its status (required for progress output) - $this->dispatchEvent(FileProcessed::NAME, new FileProcessed($workerResponse['status'])); - - if (isset($workerResponse['fileHash'])) { - $this->cacheManager->setFileHash($fileRelativePath, $workerResponse['fileHash']); - } - - foreach ($workerResponse['errors'] ?? [] as $error) { - $this->errorsManager->report(new Error( - $error['type'], - $error['filePath'], - null !== $error['source'] - ? SourceExceptionFactory::fromArray($error['source']) - : null, - $error['appliedFixers'], - $error['diff'] - )); - } - - // Pass-back information about applied changes (only if there are any) - if (isset($workerResponse['fixInfo'])) { - $changed[$fileRelativePath] = $workerResponse['fixInfo']; - - if ($this->stopOnViolation) { - $processPool->endAll(); - - return; - } - } - - return; - } - - if (ParallelAction::WORKER_GET_FILE_CHUNK === $workerResponse['action']) { - // Request another chunk of files, if still available - $fileChunk = $getFileChunk(); - - if (0 === \count($fileChunk)) { - $process->request(['action' => ParallelAction::RUNNER_THANK_YOU]); - $processPool->endProcessIfKnown($identifier); - - return; - } - - $process->request(['action' => ParallelAction::RUNNER_REQUEST_ANALYSIS, 'files' => $fileChunk]); - - return; - } - - if (ParallelAction::WORKER_ERROR_REPORT === $workerResponse['action']) { - throw WorkerException::fromRaw($workerResponse); // @phpstan-ignore-line - } - - throw new ParallelisationException('Unsupported action: '.($workerResponse['action'] ?? 'n/a')); - }, - - // [REACT] Handle errors encountered during worker's execution - static function (\Throwable $error) use ($processPool): void { - $processPool->endAll(); - - throw new ParallelisationException($error->getMessage(), $error->getCode(), $error); - }, - - // [REACT] Handle worker's shutdown - static function ($exitCode, string $output) use ($processPool, $identifier): void { - $processPool->endProcessIfKnown($identifier); - - if (0 === $exitCode || null === $exitCode) { - return; - } - - $errorsReported = Preg::matchAll( - \sprintf('/^(?:%s)([^\n]+)+/m', WorkerCommand::ERROR_PREFIX), - $output, - $matches - ); - - if ($errorsReported > 0) { - throw WorkerException::fromRaw(json_decode($matches[1][0], true)); - } - } - ); - } - - $streamSelectLoop->run(); - - return $changed; - } - - /** - * @return _RunResult - */ - private function fixSequential(): array - { - $this->dispatchEvent(AnalysisStarted::NAME, new AnalysisStarted(AnalysisStarted::MODE_SEQUENTIAL, $this->isDryRun)); - - $changed = []; - $collection = $this->getLintingFileIterator(); - - foreach ($collection as $file) { - $fixInfo = $this->fixFile($file, $collection->currentLintingResult()); - - // we do not need Tokens to still caching just fixed file - so clear the cache - Tokens::clearCache(); - - if (null !== $fixInfo) { - $name = $this->directory->getRelativePathTo($file->__toString()); - $changed[$name] = $fixInfo; - - if ($this->stopOnViolation) { - break; - } - } - } - - return $changed; - } - - /** - * @return null|array{appliedFixers: list, diff: string} - */ - private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResult): ?array - { - $name = $file->getPathname(); - - try { - $lintingResult->check(); - } catch (LintingException $e) { - $this->dispatchEvent( - FileProcessed::NAME, - new FileProcessed(FileProcessed::STATUS_INVALID) - ); - - $this->errorsManager->report(new Error(Error::TYPE_INVALID, $name, $e)); - - return null; - } - - $old = FileReader::createSingleton()->read($file->getRealPath()); - - $tokens = Tokens::fromCode($old); - $oldHash = $tokens->getCodeHash(); - - $new = $old; - $newHash = $oldHash; - - $appliedFixers = []; - - try { - foreach ($this->fixers as $fixer) { - // for custom fixers we don't know is it safe to run `->fix()` without checking `->supports()` and `->isCandidate()`, - // thus we need to check it and conditionally skip fixing - if ( - !$fixer instanceof AbstractFixer - && (!$fixer->supports($file) || !$fixer->isCandidate($tokens)) - ) { - continue; - } - - $fixer->fix($file, $tokens); - - if ($tokens->isChanged()) { - $tokens->clearEmptyTokens(); - $tokens->clearChanged(); - $appliedFixers[] = $fixer->getName(); - } - } - } catch (\ParseError $e) { - $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_LINT)); - - $this->errorsManager->report(new Error(Error::TYPE_LINT, $name, $e)); - - return null; - } catch (\Throwable $e) { - $this->processException($name, $e); - - return null; - } - - $fixInfo = null; - - if ([] !== $appliedFixers) { - $new = $tokens->generateCode(); - $newHash = $tokens->getCodeHash(); - } - - // We need to check if content was changed and then applied changes. - // But we can't simply check $appliedFixers, because one fixer may revert - // work of other and both of them will mark collection as changed. - // Therefore we need to check if code hashes changed. - if ($oldHash !== $newHash) { - $fixInfo = [ - 'appliedFixers' => $appliedFixers, - 'diff' => $this->differ->diff($old, $new, $file), - ]; - - try { - $this->linter->lintSource($new)->check(); - } catch (LintingException $e) { - $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_LINT)); - - $this->errorsManager->report(new Error(Error::TYPE_LINT, $name, $e, $fixInfo['appliedFixers'], $fixInfo['diff'])); - - return null; - } - - if (!$this->isDryRun) { - $fileName = $file->getRealPath(); - - if (!file_exists($fileName)) { - throw new IOException( - \sprintf('Failed to write file "%s" (no longer) exists.', $file->getPathname()), - 0, - null, - $file->getPathname() - ); - } - - if (is_dir($fileName)) { - throw new IOException( - \sprintf('Cannot write file "%s" as the location exists as directory.', $fileName), - 0, - null, - $fileName - ); - } - - if (!is_writable($fileName)) { - throw new IOException( - \sprintf('Cannot write to file "%s" as it is not writable.', $fileName), - 0, - null, - $fileName - ); - } - - if (false === @file_put_contents($fileName, $new)) { - $error = error_get_last(); - - throw new IOException( - \sprintf('Failed to write file "%s", "%s".', $fileName, null !== $error ? $error['message'] : 'no reason available'), - 0, - null, - $fileName - ); - } - } - } - - $this->cacheManager->setFileHash($name, $newHash); - - $this->dispatchEvent( - FileProcessed::NAME, - new FileProcessed(null !== $fixInfo ? FileProcessed::STATUS_FIXED : FileProcessed::STATUS_NO_CHANGES, $name, $newHash) - ); - - return $fixInfo; - } - - /** - * Process an exception that occurred. - */ - private function processException(string $name, \Throwable $e): void - { - $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_EXCEPTION)); - - $this->errorsManager->report(new Error(Error::TYPE_EXCEPTION, $name, $e)); - } - - private function dispatchEvent(string $name, Event $event): void - { - if (null === $this->eventDispatcher) { - return; - } - - $this->eventDispatcher->dispatch($event, $name); - } - - private function getLintingFileIterator(): LintingResultAwareFileIteratorInterface - { - $fileFilterIterator = $this->getFilteringFileIterator(); - - return $this->linter->isAsync() - ? new FileCachingLintingFileIterator($fileFilterIterator, $this->linter) - : new LintingFileIterator($fileFilterIterator, $this->linter); - } - - private function getFilteringFileIterator(): FileFilterIterator - { - if (null === $this->fileIterator) { - throw new \RuntimeException('File iterator is not configured. Pass paths during Runner initialisation or set them after with `setFileIterator()`.'); - } - - return new FileFilterIterator( - $this->fileIterator instanceof \IteratorAggregate - ? $this->fileIterator->getIterator() - : $this->fileIterator, - $this->eventDispatcher, - $this->cacheManager - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/RunnerConfig.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/RunnerConfig.php deleted file mode 100644 index f95b16ca..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Runner/RunnerConfig.php +++ /dev/null @@ -1,64 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Runner; - -use PhpCsFixer\Runner\Parallel\ParallelConfig; - -/** - * @author Greg Korba - * - * @readonly - * - * @internal - */ -final class RunnerConfig -{ - private bool $isDryRun; - private bool $stopOnViolation; - private ParallelConfig $parallelConfig; - private ?string $configFile; - - public function __construct( - bool $isDryRun, - bool $stopOnViolation, - ParallelConfig $parallelConfig, - ?string $configFile = null - ) { - $this->isDryRun = $isDryRun; - $this->stopOnViolation = $stopOnViolation; - $this->parallelConfig = $parallelConfig; - $this->configFile = $configFile; - } - - public function isDryRun(): bool - { - return $this->isDryRun; - } - - public function shouldStopOnViolation(): bool - { - return $this->stopOnViolation; - } - - public function getParallelConfig(): ParallelConfig - { - return $this->parallelConfig; - } - - public function getConfigFile(): ?string - { - return $this->configFile; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/StdinFileInfo.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/StdinFileInfo.php deleted file mode 100644 index d7cdccdd..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/StdinFileInfo.php +++ /dev/null @@ -1,173 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * @author Davi Koscianski Vidal - * - * @internal - */ -final class StdinFileInfo extends \SplFileInfo -{ - public function __construct() - { - parent::__construct(__FILE__); - } - - public function __toString(): string - { - return $this->getRealPath(); - } - - public function getRealPath(): string - { - // So file_get_contents & friends will work. - // Warning - this stream is not seekable, so `file_get_contents` will work only once! Consider using `FileReader`. - return 'php://stdin'; - } - - public function getATime(): int - { - return 0; - } - - public function getBasename($suffix = null): string - { - return $this->getFilename(); - } - - public function getCTime(): int - { - return 0; - } - - public function getExtension(): string - { - return '.php'; - } - - /** - * @param null|class-string<\SplFileInfo> $class - */ - public function getFileInfo($class = null): \SplFileInfo - { - throw new \BadMethodCallException(\sprintf('Method "%s" is not implemented.', __METHOD__)); - } - - public function getFilename(): string - { - /* - * Useful so fixers depending on PHP-only files still work. - * - * The idea to use STDIN is to parse PHP-only files, so we can - * assume that there will be always a PHP file out there. - */ - - return 'stdin.php'; - } - - public function getGroup(): int - { - return 0; - } - - public function getInode(): int - { - return 0; - } - - public function getLinkTarget(): string - { - return ''; - } - - public function getMTime(): int - { - return 0; - } - - public function getOwner(): int - { - return 0; - } - - public function getPath(): string - { - return ''; - } - - /** - * @param null|class-string<\SplFileInfo> $class - */ - public function getPathInfo($class = null): \SplFileInfo - { - throw new \BadMethodCallException(\sprintf('Method "%s" is not implemented.', __METHOD__)); - } - - public function getPathname(): string - { - return $this->getFilename(); - } - - public function getPerms(): int - { - return 0; - } - - public function getSize(): int - { - return 0; - } - - public function getType(): string - { - return 'file'; - } - - public function isDir(): bool - { - return false; - } - - public function isExecutable(): bool - { - return false; - } - - public function isFile(): bool - { - return true; - } - - public function isLink(): bool - { - return false; - } - - public function isReadable(): bool - { - return true; - } - - public function isWritable(): bool - { - return false; - } - - public function openFile($openMode = 'r', $useIncludePath = false, $context = null): \SplFileObject - { - throw new \BadMethodCallException(\sprintf('Method "%s" is not implemented.', __METHOD__)); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTransformer.php deleted file mode 100644 index 5c8de2eb..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTransformer.php +++ /dev/null @@ -1,40 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer; - -use PhpCsFixer\Utils; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -abstract class AbstractTransformer implements TransformerInterface -{ - public function getName(): string - { - $nameParts = explode('\\', static::class); - $name = substr(end($nameParts), 0, -\strlen('Transformer')); - - return Utils::camelCaseToUnderscore($name); - } - - public function getPriority(): int - { - return 0; - } - - abstract public function getCustomTokens(): array; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTypeTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTypeTransformer.php deleted file mode 100644 index 8c5476b4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/AbstractTypeTransformer.php +++ /dev/null @@ -1,89 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -abstract class AbstractTypeTransformer extends AbstractTransformer -{ - private const TYPE_END_TOKENS = [')', [T_CALLABLE], [T_NS_SEPARATOR], [T_STATIC], [T_STRING], [CT::T_ARRAY_TYPEHINT]]; - - private const TYPE_TOKENS = [ - '|', '&', '(', - ...self::TYPE_END_TOKENS, - [CT::T_TYPE_ALTERNATION], [CT::T_TYPE_INTERSECTION], // some siblings may already be transformed - [T_WHITESPACE], [T_COMMENT], [T_DOC_COMMENT], // technically these can be inside of type tokens array - ]; - - abstract protected function replaceToken(Tokens $tokens, int $index): void; - - /** - * @param array{0: int, 1: string}|string $originalToken - */ - protected function doProcess(Tokens $tokens, int $index, $originalToken): void - { - if (!$tokens[$index]->equals($originalToken)) { - return; - } - - if (!$this->isPartOfType($tokens, $index)) { - return; - } - - $this->replaceToken($tokens, $index); - } - - private function isPartOfType(Tokens $tokens, int $index): bool - { - // return types and non-capturing catches - $typeColonIndex = $tokens->getTokenNotOfKindSibling($index, -1, self::TYPE_TOKENS); - if ($tokens[$typeColonIndex]->isGivenKind([T_CATCH, CT::T_TYPE_COLON, T_CONST])) { - return true; - } - - // for parameter there will be splat operator or variable after the type ("&" is ambiguous and can be reference or bitwise and) - $afterTypeIndex = $tokens->getTokenNotOfKindSibling($index, 1, self::TYPE_TOKENS); - - if ($tokens[$afterTypeIndex]->isGivenKind(T_ELLIPSIS)) { - return true; - } - - if (!$tokens[$afterTypeIndex]->isGivenKind(T_VARIABLE)) { - return false; - } - - $beforeVariableIndex = $tokens->getPrevMeaningfulToken($afterTypeIndex); - if ($tokens[$beforeVariableIndex]->equals('&')) { - $prevIndex = $tokens->getPrevTokenOfKind( - $index, - [ - '{', - '}', - ';', - [T_CLOSE_TAG], - [T_FN], - [T_FUNCTION], - ], - ); - - return null !== $prevIndex && $tokens[$prevIndex]->isGivenKind([T_FN, T_FUNCTION]); - } - - return $tokens[$beforeVariableIndex]->equalsAny(self::TYPE_END_TOKENS); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AlternativeSyntaxAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AlternativeSyntaxAnalyzer.php deleted file mode 100644 index 242aedd7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AlternativeSyntaxAnalyzer.php +++ /dev/null @@ -1,121 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - * - * @TODO 4.0 remove this analyzer and move this logic into a transformer - */ -final class AlternativeSyntaxAnalyzer -{ - private const ALTERNATIVE_SYNTAX_BLOCK_EDGES = [ - T_IF => [T_ENDIF, T_ELSE, T_ELSEIF], - T_ELSE => [T_ENDIF], - T_ELSEIF => [T_ENDIF, T_ELSE, T_ELSEIF], - T_FOR => [T_ENDFOR], - T_FOREACH => [T_ENDFOREACH], - T_WHILE => [T_ENDWHILE], - T_SWITCH => [T_ENDSWITCH], - ]; - - public function belongsToAlternativeSyntax(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->equals(':')) { - return false; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$prevIndex]->isGivenKind(T_ELSE)) { - return true; - } - - if (!$tokens[$prevIndex]->equals(')')) { - return false; - } - - $openParenthesisIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $prevIndex); - $beforeOpenParenthesisIndex = $tokens->getPrevMeaningfulToken($openParenthesisIndex); - - return $tokens[$beforeOpenParenthesisIndex]->isGivenKind([ - T_DECLARE, - T_ELSEIF, - T_FOR, - T_FOREACH, - T_IF, - T_SWITCH, - T_WHILE, - ]); - } - - public function findAlternativeSyntaxBlockEnd(Tokens $tokens, int $index): int - { - if (!isset($tokens[$index])) { - throw new \InvalidArgumentException("There is no token at index {$index}."); - } - - if (!$this->isStartOfAlternativeSyntaxBlock($tokens, $index)) { - throw new \InvalidArgumentException("Token at index {$index} is not the start of an alternative syntax block."); - } - - $startTokenKind = $tokens[$index]->getId(); - - if (!isset(self::ALTERNATIVE_SYNTAX_BLOCK_EDGES[$startTokenKind])) { - throw new \LogicException(\sprintf('Unknown startTokenKind: %s', $tokens[$index]->toJson())); - } - - $endTokenKinds = self::ALTERNATIVE_SYNTAX_BLOCK_EDGES[$startTokenKind]; - - $findKinds = [[$startTokenKind]]; - foreach ($endTokenKinds as $endTokenKind) { - $findKinds[] = [$endTokenKind]; - } - - while (true) { - $index = $tokens->getNextTokenOfKind($index, $findKinds); - - if ($tokens[$index]->isGivenKind($endTokenKinds)) { - return $index; - } - - if ($this->isStartOfAlternativeSyntaxBlock($tokens, $index)) { - $index = $this->findAlternativeSyntaxBlockEnd($tokens, $index); - } - } - } - - private function isStartOfAlternativeSyntaxBlock(Tokens $tokens, int $index): bool - { - $map = self::ALTERNATIVE_SYNTAX_BLOCK_EDGES; - $startTokenKind = $tokens[$index]->getId(); - - if (null === $startTokenKind || !isset($map[$startTokenKind])) { - return false; - } - - $index = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$index]->equals('(')) { - $index = $tokens->getNextMeaningfulToken( - $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index) - ); - } - - return $tokens[$index]->equals(':'); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AbstractControlCaseStructuresAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AbstractControlCaseStructuresAnalysis.php deleted file mode 100644 index 92efc074..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AbstractControlCaseStructuresAnalysis.php +++ /dev/null @@ -1,51 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @readonly - * - * @internal - */ -abstract class AbstractControlCaseStructuresAnalysis -{ - private int $index; - - private int $open; - - private int $close; - - public function __construct(int $index, int $open, int $close) - { - $this->index = $index; - $this->open = $open; - $this->close = $close; - } - - public function getIndex(): int - { - return $this->index; - } - - public function getOpenIndex(): int - { - return $this->open; - } - - public function getCloseIndex(): int - { - return $this->close; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/ArgumentAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/ArgumentAnalysis.php deleted file mode 100644 index 591c3ee9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/ArgumentAnalysis.php +++ /dev/null @@ -1,81 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @readonly - * - * @internal - */ -final class ArgumentAnalysis -{ - /** - * The name of the argument. - */ - private ?string $name; - - /** - * The index where the name is located in the supplied Tokens object. - */ - private ?int $nameIndex; - - /** - * The default value of the argument. - */ - private ?string $default; - - /** - * The type analysis of the argument. - */ - private ?TypeAnalysis $typeAnalysis; - - public function __construct(?string $name, ?int $nameIndex, ?string $default, ?TypeAnalysis $typeAnalysis = null) - { - $this->name = $name; - $this->nameIndex = $nameIndex; - $this->default = $default ?? null; - $this->typeAnalysis = $typeAnalysis ?? null; - } - - public function getDefault(): ?string - { - return $this->default; - } - - public function hasDefault(): bool - { - return null !== $this->default; - } - - public function getName(): ?string - { - return $this->name; - } - - public function getNameIndex(): ?int - { - return $this->nameIndex; - } - - public function getTypeAnalysis(): ?TypeAnalysis - { - return $this->typeAnalysis; - } - - public function hasTypeAnalysis(): bool - { - return null !== $this->typeAnalysis; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AttributeAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AttributeAnalysis.php deleted file mode 100644 index 184015fa..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AttributeAnalysis.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @readonly - * - * @internal - * - * @phpstan-type _AttributeItem array{start: int, end: int, name: string} - * @phpstan-type _AttributeItems non-empty-list<_AttributeItem> - */ -final class AttributeAnalysis -{ - private int $startIndex; - private int $endIndex; - private int $openingBracketIndex; - private int $closingBracketIndex; - - /** - * @var _AttributeItems - */ - private array $attributes; - - /** - * @param _AttributeItems $attributes - */ - public function __construct(int $startIndex, int $endIndex, int $openingBracketIndex, int $closingBracketIndex, array $attributes) - { - $this->startIndex = $startIndex; - $this->endIndex = $endIndex; - $this->openingBracketIndex = $openingBracketIndex; - $this->closingBracketIndex = $closingBracketIndex; - $this->attributes = $attributes; - } - - public function getStartIndex(): int - { - return $this->startIndex; - } - - public function getEndIndex(): int - { - return $this->endIndex; - } - - public function getOpeningBracketIndex(): int - { - return $this->openingBracketIndex; - } - - public function getClosingBracketIndex(): int - { - return $this->closingBracketIndex; - } - - /** - * @return _AttributeItems - */ - public function getAttributes(): array - { - return $this->attributes; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/CaseAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/CaseAnalysis.php deleted file mode 100644 index e500bf44..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/CaseAnalysis.php +++ /dev/null @@ -1,45 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @author Kuba Werłos - * - * @readonly - * - * @internal - */ -final class CaseAnalysis -{ - private int $index; - - private int $colonIndex; - - public function __construct(int $index, int $colonIndex) - { - $this->index = $index; - $this->colonIndex = $colonIndex; - } - - public function getIndex(): int - { - return $this->index; - } - - public function getColonIndex(): int - { - return $this->colonIndex; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DataProviderAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DataProviderAnalysis.php deleted file mode 100644 index aab64c3f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DataProviderAnalysis.php +++ /dev/null @@ -1,68 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -use PhpCsFixer\Console\Application; -use PhpCsFixer\Utils; - -/** - * @internal - * - * @readonly - */ -final class DataProviderAnalysis -{ - private string $name; - - private int $nameIndex; - - /** @var non-empty-list */ - private array $usageIndices; - - /** - * @param non-empty-list $usageIndices - */ - public function __construct(string $name, int $nameIndex, array $usageIndices) - { - if ([] === $usageIndices || !array_is_list($usageIndices)) { - Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( - 'Parameter "usageIndices" should be a non-empty-list. This will be enforced in version %d.0.', - Application::getMajorVersion() + 1 - ))); - } - - $this->name = $name; - $this->nameIndex = $nameIndex; - $this->usageIndices = $usageIndices; - } - - public function getName(): string - { - return $this->name; - } - - public function getNameIndex(): int - { - return $this->nameIndex; - } - - /** - * @return non-empty-list - */ - public function getUsageIndices(): array - { - return $this->usageIndices; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DefaultAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DefaultAnalysis.php deleted file mode 100644 index 6ca02898..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DefaultAnalysis.php +++ /dev/null @@ -1,43 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @readonly - * - * @internal - */ -final class DefaultAnalysis -{ - private int $index; - - private int $colonIndex; - - public function __construct(int $index, int $colonIndex) - { - $this->index = $index; - $this->colonIndex = $colonIndex; - } - - public function getIndex(): int - { - return $this->index; - } - - public function getColonIndex(): int - { - return $this->colonIndex; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/EnumAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/EnumAnalysis.php deleted file mode 100644 index 9c1aa5c5..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/EnumAnalysis.php +++ /dev/null @@ -1,46 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @readonly - * - * @internal - */ -final class EnumAnalysis extends AbstractControlCaseStructuresAnalysis -{ - /** - * @var list - */ - private array $cases; - - /** - * @param list $cases - */ - public function __construct(int $index, int $open, int $close, array $cases) - { - parent::__construct($index, $open, $close); - - $this->cases = $cases; - } - - /** - * @return list - */ - public function getCases(): array - { - return $this->cases; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/MatchAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/MatchAnalysis.php deleted file mode 100644 index 5a3ecf30..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/MatchAnalysis.php +++ /dev/null @@ -1,37 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @readonly - * - * @internal - */ -final class MatchAnalysis extends AbstractControlCaseStructuresAnalysis -{ - private ?DefaultAnalysis $defaultAnalysis; - - public function __construct(int $index, int $open, int $close, ?DefaultAnalysis $defaultAnalysis) - { - parent::__construct($index, $open, $close); - - $this->defaultAnalysis = $defaultAnalysis; - } - - public function getDefaultAnalysis(): ?DefaultAnalysis - { - return $this->defaultAnalysis; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceAnalysis.php deleted file mode 100644 index 7721e270..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceAnalysis.php +++ /dev/null @@ -1,98 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @readonly - * - * @internal - */ -final class NamespaceAnalysis implements StartEndTokenAwareAnalysis -{ - /** - * The fully qualified namespace name. - */ - private string $fullName; - - /** - * The short version of the namespace. - */ - private string $shortName; - - /** - * The start index of the namespace declaration in the analyzed Tokens. - */ - private int $startIndex; - - /** - * The end index of the namespace declaration in the analyzed Tokens. - */ - private int $endIndex; - - /** - * The start index of the scope of the namespace in the analyzed Tokens. - */ - private int $scopeStartIndex; - - /** - * The end index of the scope of the namespace in the analyzed Tokens. - */ - private int $scopeEndIndex; - - public function __construct(string $fullName, string $shortName, int $startIndex, int $endIndex, int $scopeStartIndex, int $scopeEndIndex) - { - $this->fullName = $fullName; - $this->shortName = $shortName; - $this->startIndex = $startIndex; - $this->endIndex = $endIndex; - $this->scopeStartIndex = $scopeStartIndex; - $this->scopeEndIndex = $scopeEndIndex; - } - - public function getFullName(): string - { - return $this->fullName; - } - - public function getShortName(): string - { - return $this->shortName; - } - - public function getStartIndex(): int - { - return $this->startIndex; - } - - public function getEndIndex(): int - { - return $this->endIndex; - } - - public function getScopeStartIndex(): int - { - return $this->scopeStartIndex; - } - - public function getScopeEndIndex(): int - { - return $this->scopeEndIndex; - } - - public function isGlobalNamespace(): bool - { - return '' === $this->getFullName(); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceUseAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceUseAnalysis.php deleted file mode 100644 index 475fa6c0..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/NamespaceUseAnalysis.php +++ /dev/null @@ -1,189 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @author VeeWee - * @author Greg Korba - * - * @readonly - * - * @internal - * - * @phpstan-type _ImportType 'class'|'constant'|'function' - */ -final class NamespaceUseAnalysis implements StartEndTokenAwareAnalysis -{ - public const TYPE_CLASS = 1; // "classy" could be class, interface or trait - public const TYPE_FUNCTION = 2; - public const TYPE_CONSTANT = 3; - - /** - * The fully qualified use namespace. - * - * @var class-string - */ - private string $fullName; - - /** - * The short version of use namespace or the alias name in case of aliased use statements. - */ - private string $shortName; - - /** - * Is the use statement part of multi-use (`use A, B, C;`, `use A\{B, C};`)? - */ - private bool $isInMulti; - - /** - * Is the use statement being aliased? - */ - private bool $isAliased; - - /** - * The start index of the namespace declaration in the analyzed Tokens. - */ - private int $startIndex; - - /** - * The end index of the namespace declaration in the analyzed Tokens. - */ - private int $endIndex; - - /** - * The start index of the single import in the multi-use statement. - */ - private ?int $chunkStartIndex; - - /** - * The end index of the single import in the multi-use statement. - */ - private ?int $chunkEndIndex; - - /** - * The type of import: class, function or constant. - * - * @var self::TYPE_* - */ - private int $type; - - /** - * @param self::TYPE_* $type - * @param class-string $fullName - */ - public function __construct( - int $type, - string $fullName, - string $shortName, - bool $isAliased, - bool $isInMulti, - int $startIndex, - int $endIndex, - ?int $chunkStartIndex = null, - ?int $chunkEndIndex = null - ) { - if (true === $isInMulti && (null === $chunkStartIndex || null === $chunkEndIndex)) { - throw new \LogicException('Chunk start and end index must be set when the import is part of a multi-use statement.'); - } - - $this->type = $type; - $this->fullName = $fullName; - $this->shortName = $shortName; - $this->isAliased = $isAliased; - $this->isInMulti = $isInMulti; - $this->startIndex = $startIndex; - $this->endIndex = $endIndex; - $this->chunkStartIndex = $chunkStartIndex; - $this->chunkEndIndex = $chunkEndIndex; - } - - /** - * @return class-string - */ - public function getFullName(): string - { - return $this->fullName; - } - - public function getShortName(): string - { - return $this->shortName; - } - - public function isAliased(): bool - { - return $this->isAliased; - } - - public function isInMulti(): bool - { - return $this->isInMulti; - } - - public function getStartIndex(): int - { - return $this->startIndex; - } - - public function getEndIndex(): int - { - return $this->endIndex; - } - - public function getChunkStartIndex(): ?int - { - return $this->chunkStartIndex; - } - - public function getChunkEndIndex(): ?int - { - return $this->chunkEndIndex; - } - - /** - * @return self::TYPE_* - */ - public function getType(): int - { - return $this->type; - } - - /** - * @return _ImportType - */ - public function getHumanFriendlyType(): string - { - return [ - self::TYPE_CLASS => 'class', - self::TYPE_FUNCTION => 'function', - self::TYPE_CONSTANT => 'constant', - ][$this->type]; - } - - public function isClass(): bool - { - return self::TYPE_CLASS === $this->type; - } - - public function isFunction(): bool - { - return self::TYPE_FUNCTION === $this->type; - } - - public function isConstant(): bool - { - return self::TYPE_CONSTANT === $this->type; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/StartEndTokenAwareAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/StartEndTokenAwareAnalysis.php deleted file mode 100644 index c00b1777..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/StartEndTokenAwareAnalysis.php +++ /dev/null @@ -1,33 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @internal - * - * @readonly - */ -interface StartEndTokenAwareAnalysis -{ - /** - * The start index of the analyzed subject inside of the Tokens. - */ - public function getStartIndex(): int; - - /** - * The end index of the analyzed subject inside of the Tokens. - */ - public function getEndIndex(): int; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/SwitchAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/SwitchAnalysis.php deleted file mode 100644 index ff4f5717..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/SwitchAnalysis.php +++ /dev/null @@ -1,54 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @readonly - * - * @internal - */ -final class SwitchAnalysis extends AbstractControlCaseStructuresAnalysis -{ - /** - * @var list - */ - private array $cases; - - private ?DefaultAnalysis $defaultAnalysis; - - /** - * @param list $cases - */ - public function __construct(int $index, int $open, int $close, array $cases, ?DefaultAnalysis $defaultAnalysis) - { - parent::__construct($index, $open, $close); - - $this->cases = $cases; - $this->defaultAnalysis = $defaultAnalysis; - } - - /** - * @return list - */ - public function getCases(): array - { - return $this->cases; - } - - public function getDefaultAnalysis(): ?DefaultAnalysis - { - return $this->defaultAnalysis; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php deleted file mode 100644 index fd76075c..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php +++ /dev/null @@ -1,116 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis; - -/** - * @readonly - * - * @internal - */ -final class TypeAnalysis implements StartEndTokenAwareAnalysis -{ - /** - * This list contains soft and hard reserved types that can be used or will be used by PHP at some point. - * - * More info: - * - * @see https://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration.types - * @see https://php.net/manual/en/reserved.other-reserved-words.php - * - * @var list - */ - private const RESERVED_TYPES = [ - 'array', - 'bool', - 'callable', - 'false', - 'float', - 'int', - 'iterable', - 'list', - 'mixed', - 'never', - 'null', - 'object', - 'parent', - 'resource', - 'self', - 'static', - 'string', - 'true', - 'void', - ]; - - private string $name; - - private ?int $startIndex; - - private ?int $endIndex; - - private bool $nullable; - - /** - * @param ($startIndex is null ? null : int) $endIndex - */ - public function __construct(string $name, ?int $startIndex = null, ?int $endIndex = null) - { - if (str_starts_with($name, '?')) { - $this->name = substr($name, 1); - $this->nullable = true; - } elseif (\PHP_VERSION_ID >= 8_00_00) { - $this->name = $name; - $this->nullable = \in_array('null', array_map('trim', explode('|', strtolower($name))), true); - } else { - $this->name = $name; - $this->nullable = false; - } - - $this->startIndex = $startIndex; - $this->endIndex = $endIndex; - } - - public function getName(): string - { - return $this->name; - } - - public function getStartIndex(): int - { - if (null === $this->startIndex) { - throw new \RuntimeException('TypeAnalysis: no start index.'); - } - - return $this->startIndex; - } - - public function getEndIndex(): int - { - if (null === $this->endIndex) { - throw new \RuntimeException('TypeAnalysis: no end index.'); - } - - return $this->endIndex; - } - - public function isReservedType(): bool - { - return \in_array(strtolower($this->name), self::RESERVED_TYPES, true); - } - - public function isNullable(): bool - { - return $this->nullable; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ArgumentsAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ArgumentsAnalyzer.php deleted file mode 100644 index 94322071..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ArgumentsAnalyzer.php +++ /dev/null @@ -1,161 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\Analyzer\Analysis\ArgumentAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Dariusz Rumiński - * @author Vladimir Reznichenko - * - * @internal - */ -final class ArgumentsAnalyzer -{ - /** - * Count amount of parameters in a function/method reference. - */ - public function countArguments(Tokens $tokens, int $openParenthesis, int $closeParenthesis): int - { - return \count($this->getArguments($tokens, $openParenthesis, $closeParenthesis)); - } - - /** - * Returns start and end token indices of arguments. - * - * Returns an array with each key being the first token of an - * argument and the value the last. Including non-function tokens - * such as comments and white space tokens, but without the separation - * tokens like '(', ',' and ')'. - * - * @return array - */ - public function getArguments(Tokens $tokens, int $openParenthesis, int $closeParenthesis): array - { - $arguments = []; - $firstSensibleToken = $tokens->getNextMeaningfulToken($openParenthesis); - - if ($tokens[$firstSensibleToken]->equals(')')) { - return $arguments; - } - - $paramContentIndex = $openParenthesis + 1; - $argumentsStart = $paramContentIndex; - - for (; $paramContentIndex < $closeParenthesis; ++$paramContentIndex) { - $token = $tokens[$paramContentIndex]; - - // skip nested (), [], {} constructs - $blockDefinitionProbe = Tokens::detectBlockType($token); - - if (null !== $blockDefinitionProbe && true === $blockDefinitionProbe['isStart']) { - $paramContentIndex = $tokens->findBlockEnd($blockDefinitionProbe['type'], $paramContentIndex); - - continue; - } - - // if comma matched, increase arguments counter - if ($token->equals(',')) { - if ($tokens->getNextMeaningfulToken($paramContentIndex) === $closeParenthesis) { - break; // trailing ',' in function call (PHP 7.3) - } - - $arguments[$argumentsStart] = $paramContentIndex - 1; - $argumentsStart = $paramContentIndex + 1; - } - } - - $arguments[$argumentsStart] = $paramContentIndex - 1; - - return $arguments; - } - - public function getArgumentInfo(Tokens $tokens, int $argumentStart, int $argumentEnd): ArgumentAnalysis - { - static $skipTypes = null; - - if (null === $skipTypes) { - $skipTypes = [T_ELLIPSIS, CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $skipTypes[] = T_READONLY; - } - } - - $info = [ - 'default' => null, - 'name' => null, - 'name_index' => null, - 'type' => null, - 'type_index_start' => null, - 'type_index_end' => null, - ]; - - $sawName = false; - - for ($index = $argumentStart; $index <= $argumentEnd; ++$index) { - $token = $tokens[$index]; - - if (\defined('T_ATTRIBUTE') && $token->isGivenKind(T_ATTRIBUTE)) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); - - continue; - } - - if ( - $token->isComment() - || $token->isWhitespace() - || $token->isGivenKind($skipTypes) - || $token->equals('&') - ) { - continue; - } - - if ($token->isGivenKind(T_VARIABLE)) { - $sawName = true; - $info['name_index'] = $index; - $info['name'] = $token->getContent(); - - continue; - } - - if ($token->equals('=')) { - continue; - } - - if ($sawName) { - $info['default'] .= $token->getContent(); - } else { - $info['type_index_start'] = ($info['type_index_start'] > 0) ? $info['type_index_start'] : $index; - $info['type_index_end'] = $index; - $info['type'] .= $token->getContent(); - } - } - - if (null === $info['name']) { - $info['type'] = null; - } - - return new ArgumentAnalysis( - $info['name'], - $info['name_index'], - $info['default'], - null !== $info['type'] ? new TypeAnalysis($info['type'], $info['type_index_start'], $info['type_index_end']) : null - ); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AttributeAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AttributeAnalyzer.php deleted file mode 100644 index 709f8321..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AttributeAnalyzer.php +++ /dev/null @@ -1,211 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\AttributeAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - * - * @phpstan-import-type _AttributeItems from AttributeAnalysis - */ -final class AttributeAnalyzer -{ - private const TOKEN_KINDS_NOT_ALLOWED_IN_ATTRIBUTE = [ - ';', - '{', - [T_ATTRIBUTE], - [T_FUNCTION], - [T_OPEN_TAG], - [T_OPEN_TAG_WITH_ECHO], - [T_PRIVATE], - [T_PROTECTED], - [T_PUBLIC], - [T_RETURN], - [T_VARIABLE], - [CT::T_ATTRIBUTE_CLOSE], - ]; - - /** - * Check if given index is an attribute declaration. - */ - public static function isAttribute(Tokens $tokens, int $index): bool - { - if ( - !\defined('T_ATTRIBUTE') // attributes not available, PHP version lower than 8.0 - || !$tokens[$index]->isGivenKind(T_STRING) // checked token is not a string - || !$tokens->isAnyTokenKindsFound([T_ATTRIBUTE]) // no attributes in the tokens collection - ) { - return false; - } - - $attributeStartIndex = $tokens->getPrevTokenOfKind($index, self::TOKEN_KINDS_NOT_ALLOWED_IN_ATTRIBUTE); - if (!$tokens[$attributeStartIndex]->isGivenKind(T_ATTRIBUTE)) { - return false; - } - - // now, between attribute start and the attribute candidate index cannot be more "(" than ")" - $count = 0; - for ($i = $attributeStartIndex + 1; $i < $index; ++$i) { - if ($tokens[$i]->equals('(')) { - ++$count; - } elseif ($tokens[$i]->equals(')')) { - --$count; - } - } - - return 0 === $count; - } - - /** - * Find all consecutive elements that start with #[ and end with ] and the attributes inside. - * - * @return list - */ - public static function collect(Tokens $tokens, int $index): array - { - if (!$tokens[$index]->isGivenKind(T_ATTRIBUTE)) { - throw new \InvalidArgumentException('Given index must point to an attribute.'); - } - - // Rewind to first attribute in group - while ($tokens[$prevIndex = $tokens->getPrevMeaningfulToken($index)]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - $index = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $prevIndex); - } - - /** @var list $elements */ - $elements = []; - - $openingIndex = $index; - do { - $elements[] = $element = self::collectOne($tokens, $openingIndex); - $openingIndex = $tokens->getNextMeaningfulToken($element->getEndIndex()); - } while ($tokens[$openingIndex]->isGivenKind(T_ATTRIBUTE)); - - return $elements; - } - - /** - * Find one element that starts with #[ and ends with ] and the attributes inside. - */ - public static function collectOne(Tokens $tokens, int $index): AttributeAnalysis - { - if (!$tokens[$index]->isGivenKind(T_ATTRIBUTE)) { - throw new \InvalidArgumentException('Given index must point to an attribute.'); - } - - $startIndex = $index; - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - // Include comments/PHPDoc if they are present - $startIndex = $tokens->getNextNonWhitespace($prevIndex); - } - - $closingIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); - $endIndex = $tokens->getNextNonWhitespace($closingIndex); - - return new AttributeAnalysis( - $startIndex, - $endIndex - 1, - $index, - $closingIndex, - self::collectAttributes($tokens, $index, $closingIndex), - ); - } - - public static function determineAttributeFullyQualifiedName(Tokens $tokens, string $name, int $index): string - { - if ('\\' === $name[0]) { - return $name; - } - - if (!$tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR])) { - $index = $tokens->getNextTokenOfKind($index, [[T_STRING], [T_NS_SEPARATOR]]); - } - - [$namespaceAnalysis, $namespaceUseAnalyses] = NamespacesAnalyzer::collectNamespaceAnalysis($tokens, $index); - $namespace = $namespaceAnalysis->getFullName(); - $firstTokenOfName = $tokens[$index]->getContent(); - $namespaceUseAnalysis = $namespaceUseAnalyses[$firstTokenOfName] ?? false; - - if ($namespaceUseAnalysis instanceof NamespaceUseAnalysis) { - $namespace = $namespaceUseAnalysis->getFullName(); - - if ($name === $firstTokenOfName) { - return $namespace; - } - - $name = substr((string) strstr($name, '\\'), 1); - } - - return $namespace.'\\'.$name; - } - - /** - * @return _AttributeItems - */ - private static function collectAttributes(Tokens $tokens, int $index, int $closingIndex): array - { - $elements = []; - - do { - $attributeStartIndex = $index + 1; - - $nameStartIndex = $tokens->getNextTokenOfKind($index, [[T_STRING], [T_NS_SEPARATOR]]); - $index = $tokens->getNextTokenOfKind($attributeStartIndex, ['(', ',', [CT::T_ATTRIBUTE_CLOSE]]); - $attributeName = $tokens->generatePartialCode($nameStartIndex, $tokens->getPrevMeaningfulToken($index)); - - // Find closing parentheses, we need to do this in case there's a comma inside the parentheses - if ($tokens[$index]->equals('(')) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $index = $tokens->getNextTokenOfKind($index, [',', [CT::T_ATTRIBUTE_CLOSE]]); - } - - $elements[] = [ - 'start' => $attributeStartIndex, - 'end' => $index - 1, - 'name' => $attributeName, - ]; - - $nextIndex = $index; - - // In case there's a comma right before T_ATTRIBUTE_CLOSE - if ($nextIndex < $closingIndex) { - $nextIndex = $tokens->getNextMeaningfulToken($index); - } - } while ($nextIndex < $closingIndex); - - // End last element at newline if it exists and there's no trailing comma - --$index; - while ($tokens[$index]->isWhitespace()) { - if (Preg::match('/\R/', $tokens[$index]->getContent())) { - $lastElementKey = array_key_last($elements); - $elements[$lastElementKey]['end'] = $index - 1; - - break; - } - --$index; - } - - \assert(array_is_list($elements)); - - return $elements; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/BlocksAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/BlocksAnalyzer.php deleted file mode 100644 index 0f2f7735..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/BlocksAnalyzer.php +++ /dev/null @@ -1,59 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - * - * @internal - */ -final class BlocksAnalyzer -{ - public function isBlock(Tokens $tokens, int $openIndex, int $closeIndex): bool - { - if (!$tokens->offsetExists($openIndex)) { - throw new \InvalidArgumentException(\sprintf('Tokex index %d for potential block opening does not exist.', $openIndex)); - } - - if (!$tokens->offsetExists($closeIndex)) { - throw new \InvalidArgumentException(\sprintf('Token index %d for potential block closure does not exist.', $closeIndex)); - } - - $blockType = $this->getBlockType($tokens[$openIndex]); - - if (null === $blockType) { - return false; - } - - return $closeIndex === $tokens->findBlockEnd($blockType, $openIndex); - } - - /** - * @return Tokens::BLOCK_TYPE_* - */ - private function getBlockType(Token $token): ?int - { - foreach (Tokens::getBlockEdgeDefinitions() as $blockType => $definition) { - if ($token->equals($definition['start'])) { - return $blockType; - } - } - - return null; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ClassyAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ClassyAnalyzer.php deleted file mode 100644 index 31e0b051..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ClassyAnalyzer.php +++ /dev/null @@ -1,87 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -final class ClassyAnalyzer -{ - public function isClassyInvocation(Tokens $tokens, int $index): bool - { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_STRING)) { - throw new \LogicException(\sprintf('No T_STRING at given index %d, got "%s".', $index, $tokens[$index]->getName())); - } - - if ((new Analysis\TypeAnalysis($token->getContent()))->isReservedType()) { - return false; - } - - $next = $tokens->getNextMeaningfulToken($index); - $nextToken = $tokens[$next]; - - if ($nextToken->isGivenKind(T_NS_SEPARATOR)) { - return false; - } - - if ($nextToken->isGivenKind([T_DOUBLE_COLON, T_ELLIPSIS, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, T_VARIABLE])) { - return true; - } - - $prev = $tokens->getPrevMeaningfulToken($index); - - while ($tokens[$prev]->isGivenKind([CT::T_NAMESPACE_OPERATOR, T_NS_SEPARATOR, T_STRING])) { - $prev = $tokens->getPrevMeaningfulToken($prev); - } - - $prevToken = $tokens[$prev]; - - if ($prevToken->isGivenKind([T_EXTENDS, T_INSTANCEOF, T_INSTEADOF, T_IMPLEMENTS, T_NEW, CT::T_NULLABLE_TYPE, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, CT::T_TYPE_COLON, CT::T_USE_TRAIT])) { - return true; - } - - if (\PHP_VERSION_ID >= 8_00_00 && $nextToken->equals(')') && $prevToken->equals('(') && $tokens[$tokens->getPrevMeaningfulToken($prev)]->isGivenKind(T_CATCH)) { - return true; - } - - if (AttributeAnalyzer::isAttribute($tokens, $index)) { - return true; - } - - // `Foo & $bar` could be: - // - function reference parameter: function baz(Foo & $bar) {} - // - bit operator: $x = Foo & $bar; - if ($nextToken->equals('&') && $tokens[$tokens->getNextMeaningfulToken($next)]->isGivenKind(T_VARIABLE)) { - $checkIndex = $tokens->getPrevTokenOfKind($prev + 1, [';', '{', '}', [T_FUNCTION], [T_OPEN_TAG], [T_OPEN_TAG_WITH_ECHO]]); - - return $tokens[$checkIndex]->isGivenKind(T_FUNCTION); - } - - if (!$prevToken->equals(',')) { - return false; - } - - do { - $prev = $tokens->getPrevMeaningfulToken($prev); - } while ($tokens[$prev]->equalsAny([',', [T_NS_SEPARATOR], [T_STRING], [CT::T_NAMESPACE_OPERATOR]])); - - return $tokens[$prev]->isGivenKind([T_IMPLEMENTS, CT::T_USE_TRAIT]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/CommentsAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/CommentsAnalyzer.php deleted file mode 100644 index c2822c60..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/CommentsAnalyzer.php +++ /dev/null @@ -1,350 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - * - * @internal - */ -final class CommentsAnalyzer -{ - private const TYPE_HASH = 1; - private const TYPE_DOUBLE_SLASH = 2; - private const TYPE_SLASH_ASTERISK = 3; - - public function isHeaderComment(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->isGivenKind([T_COMMENT, T_DOC_COMMENT])) { - throw new \InvalidArgumentException('Given index must point to a comment.'); - } - - if (null === $tokens->getNextMeaningfulToken($index)) { - return false; - } - - $prevIndex = $tokens->getPrevNonWhitespace($index); - - if ($tokens[$prevIndex]->equals(';')) { - $braceCloseIndex = $tokens->getPrevMeaningfulToken($prevIndex); - if (!$tokens[$braceCloseIndex]->equals(')')) { - return false; - } - - $braceOpenIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $braceCloseIndex); - $declareIndex = $tokens->getPrevMeaningfulToken($braceOpenIndex); - if (!$tokens[$declareIndex]->isGivenKind(T_DECLARE)) { - return false; - } - - $prevIndex = $tokens->getPrevNonWhitespace($declareIndex); - } - - return $tokens[$prevIndex]->isGivenKind(T_OPEN_TAG); - } - - /** - * Check if comment at given index precedes structural element. - * - * @see https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md#3-definitions - */ - public function isBeforeStructuralElement(Tokens $tokens, int $index): bool - { - $token = $tokens[$index]; - - if (!$token->isGivenKind([T_COMMENT, T_DOC_COMMENT])) { - throw new \InvalidArgumentException('Given index must point to a comment.'); - } - - $nextIndex = $this->getNextTokenIndex($tokens, $index); - - if (null === $nextIndex || $tokens[$nextIndex]->equals('}')) { - return false; - } - - if ($this->isStructuralElement($tokens, $nextIndex)) { - return true; - } - - if ($this->isValidControl($tokens, $token, $nextIndex)) { - return true; - } - - if ($this->isValidVariable($tokens, $nextIndex)) { - return true; - } - - if ($this->isValidVariableAssignment($tokens, $token, $nextIndex)) { - return true; - } - - if ($tokens[$nextIndex]->isGivenKind(CT::T_USE_TRAIT)) { - return true; - } - - return false; - } - - /** - * Check if comment at given index precedes return statement. - */ - public function isBeforeReturn(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->isGivenKind([T_COMMENT, T_DOC_COMMENT])) { - throw new \InvalidArgumentException('Given index must point to a comment.'); - } - - $nextIndex = $this->getNextTokenIndex($tokens, $index); - - if (null === $nextIndex || $tokens[$nextIndex]->equals('}')) { - return false; - } - - return $tokens[$nextIndex]->isGivenKind(T_RETURN); - } - - /** - * Return array of indices that are part of a comment started at given index. - * - * @param int $index T_COMMENT index - * - * @return non-empty-list - */ - public function getCommentBlockIndices(Tokens $tokens, int $index): array - { - if (!$tokens[$index]->isGivenKind(T_COMMENT)) { - throw new \InvalidArgumentException('Given index must point to a comment.'); - } - - $commentType = $this->getCommentType($tokens[$index]->getContent()); - $indices = [$index]; - - if (self::TYPE_SLASH_ASTERISK === $commentType) { - return $indices; - } - - $count = \count($tokens); - ++$index; - - for (; $index < $count; ++$index) { - if ($tokens[$index]->isComment()) { - if ($commentType === $this->getCommentType($tokens[$index]->getContent())) { - $indices[] = $index; - - continue; - } - - break; - } - - if (!$tokens[$index]->isWhitespace() || $this->getLineBreakCount($tokens, $index, $index + 1) > 1) { - break; - } - } - - return $indices; - } - - /** - * @see https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md#3-definitions - */ - private function isStructuralElement(Tokens $tokens, int $index): bool - { - static $skip; - - if (null === $skip) { - $skip = [ - T_PRIVATE, - T_PROTECTED, - T_PUBLIC, - T_VAR, - T_FUNCTION, - T_FN, - T_ABSTRACT, - T_CONST, - T_NAMESPACE, - T_REQUIRE, - T_REQUIRE_ONCE, - T_INCLUDE, - T_INCLUDE_ONCE, - T_FINAL, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE, - ]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $skip[] = T_READONLY; - } - } - - $token = $tokens[$index]; - - if ($token->isClassy() || $token->isGivenKind($skip)) { - return true; - } - - if ($token->isGivenKind(T_CASE) && \defined('T_ENUM')) { - $caseParent = $tokens->getPrevTokenOfKind($index, [[T_ENUM], [T_SWITCH]]); - - return $tokens[$caseParent]->isGivenKind([T_ENUM]); - } - - if ($token->isGivenKind(T_STATIC)) { - return !$tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(T_DOUBLE_COLON); - } - - return false; - } - - /** - * Checks control structures (for, foreach, if, switch, while) for correct docblock usage. - * - * @param Token $docsToken docs Token - * @param int $controlIndex index of control structure Token - */ - private function isValidControl(Tokens $tokens, Token $docsToken, int $controlIndex): bool - { - static $controlStructures = [ - T_FOR, - T_FOREACH, - T_IF, - T_SWITCH, - T_WHILE, - ]; - - if (!$tokens[$controlIndex]->isGivenKind($controlStructures)) { - return false; - } - - $openParenthesisIndex = $tokens->getNextMeaningfulToken($controlIndex); - $closeParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openParenthesisIndex); - $docsContent = $docsToken->getContent(); - - for ($index = $openParenthesisIndex + 1; $index < $closeParenthesisIndex; ++$index) { - $token = $tokens[$index]; - - if ( - $token->isGivenKind(T_VARIABLE) - && str_contains($docsContent, $token->getContent()) - ) { - return true; - } - } - - return false; - } - - /** - * Checks variable assignments through `list()`, `print()` etc. calls for correct docblock usage. - * - * @param Token $docsToken docs Token - * @param int $languageConstructIndex index of variable Token - */ - private function isValidVariableAssignment(Tokens $tokens, Token $docsToken, int $languageConstructIndex): bool - { - static $languageStructures = [ - T_LIST, - T_PRINT, - T_ECHO, - CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN, - ]; - - if (!$tokens[$languageConstructIndex]->isGivenKind($languageStructures)) { - return false; - } - - $endKind = $tokens[$languageConstructIndex]->isGivenKind(CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN) - ? [CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE] - : ')'; - - $endIndex = $tokens->getNextTokenOfKind($languageConstructIndex, [$endKind]); - - $docsContent = $docsToken->getContent(); - - for ($index = $languageConstructIndex + 1; $index < $endIndex; ++$index) { - $token = $tokens[$index]; - - if ($token->isGivenKind(T_VARIABLE) && str_contains($docsContent, $token->getContent())) { - return true; - } - } - - return false; - } - - /** - * Checks variable assignments for correct docblock usage. - * - * @param int $index index of variable Token - */ - private function isValidVariable(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->isGivenKind(T_VARIABLE)) { - return false; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - - return $tokens[$nextIndex]->equals('='); - } - - private function getCommentType(string $content): int - { - if (str_starts_with($content, '#')) { - return self::TYPE_HASH; - } - - if ('*' === $content[1]) { - return self::TYPE_SLASH_ASTERISK; - } - - return self::TYPE_DOUBLE_SLASH; - } - - private function getLineBreakCount(Tokens $tokens, int $whiteStart, int $whiteEnd): int - { - $lineCount = 0; - for ($i = $whiteStart; $i < $whiteEnd; ++$i) { - $lineCount += Preg::matchAll('/\R/u', $tokens[$i]->getContent()); - } - - return $lineCount; - } - - private function getNextTokenIndex(Tokens $tokens, int $startIndex): ?int - { - $nextIndex = $startIndex; - - do { - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - - // @TODO: drop condition when PHP 8.0+ is required - if (\defined('T_ATTRIBUTE')) { - while (null !== $nextIndex && $tokens[$nextIndex]->isGivenKind(T_ATTRIBUTE)) { - $nextIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $nextIndex); - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - } - } - } while (null !== $nextIndex && $tokens[$nextIndex]->equals('(')); - - return $nextIndex; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ControlCaseStructuresAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ControlCaseStructuresAnalyzer.php deleted file mode 100644 index 6c9f2543..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ControlCaseStructuresAnalyzer.php +++ /dev/null @@ -1,309 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\Analyzer\Analysis\AbstractControlCaseStructuresAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\CaseAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\DefaultAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\EnumAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\MatchAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\SwitchAnalysis; -use PhpCsFixer\Tokenizer\Tokens; - -final class ControlCaseStructuresAnalyzer -{ - /** - * @param list $types Token types of interest of which analyzes must be returned - * - * @return \Generator - */ - public static function findControlStructures(Tokens $tokens, array $types): \Generator - { - if (\count($types) < 1) { - return; // quick skip - } - - $typesWithCaseOrDefault = self::getTypesWithCaseOrDefault(); - - foreach ($types as $type) { - if (!\in_array($type, $typesWithCaseOrDefault, true)) { - throw new \InvalidArgumentException(\sprintf('Unexpected type "%d".', $type)); - } - } - - if (!$tokens->isAnyTokenKindsFound($types)) { - return; // quick skip - } - - $depth = -1; - - /** - * @var list, - * default: array{index: int, open: int}|null, - * alternative_syntax: bool, - * }> $stack - */ - $stack = []; - $isTypeOfInterest = false; - - foreach ($tokens as $index => $token) { - if ($token->isGivenKind($typesWithCaseOrDefault)) { - ++$depth; - - $stack[$depth] = [ - 'kind' => $token->getId(), - 'index' => $index, - 'brace_count' => 0, - 'cases' => [], - 'default' => null, - 'alternative_syntax' => false, - ]; - - $isTypeOfInterest = \in_array($stack[$depth]['kind'], $types, true); - - if ($token->isGivenKind(T_SWITCH)) { - $index = $tokens->getNextMeaningfulToken($index); - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - - $stack[$depth]['open'] = $tokens->getNextMeaningfulToken($index); - $stack[$depth]['alternative_syntax'] = $tokens[$stack[$depth]['open']]->equals(':'); - } elseif (\defined('T_MATCH') && $token->isGivenKind(T_MATCH)) { // @TODO: drop condition when PHP 8.0+ is required - $index = $tokens->getNextMeaningfulToken($index); - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - - $stack[$depth]['open'] = $tokens->getNextMeaningfulToken($index); - } elseif (\defined('T_ENUM') && $token->isGivenKind(T_ENUM)) { - $stack[$depth]['open'] = $tokens->getNextTokenOfKind($index, ['{']); - } - - continue; - } - - if ($depth < 0) { - continue; - } - - if ($token->equals('{')) { - ++$stack[$depth]['brace_count']; - - continue; - } - - if ($token->equals('}')) { - --$stack[$depth]['brace_count']; - - if (0 === $stack[$depth]['brace_count']) { - if ($stack[$depth]['alternative_syntax']) { - continue; - } - - if ($isTypeOfInterest) { - $stack[$depth]['end'] = $index; - - yield $stack[$depth]['index'] => self::buildControlCaseStructureAnalysis($stack[$depth]); - } - - array_pop($stack); - --$depth; - - if ($depth < -1) { // @phpstan-ignore-line - throw new \RuntimeException('Analysis depth count failure.'); - } - - if (isset($stack[$depth]['kind'])) { - $isTypeOfInterest = \in_array($stack[$depth]['kind'], $types, true); - } - } - - continue; - } - - if ($tokens[$index]->isGivenKind(T_ENDSWITCH)) { - if (!$stack[$depth]['alternative_syntax']) { - throw new \RuntimeException('Analysis syntax failure, unexpected "T_ENDSWITCH".'); - } - - if (T_SWITCH !== $stack[$depth]['kind']) { - throw new \RuntimeException('Analysis type failure, unexpected "T_ENDSWITCH".'); - } - - if (0 !== $stack[$depth]['brace_count']) { - throw new \RuntimeException('Analysis count failure, unexpected "T_ENDSWITCH".'); - } - - $index = $tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]); - - if ($isTypeOfInterest) { - $stack[$depth]['end'] = $index; - - yield $stack[$depth]['index'] => self::buildControlCaseStructureAnalysis($stack[$depth]); - } - - array_pop($stack); - --$depth; - - if ($depth < -1) { // @phpstan-ignore-line - throw new \RuntimeException('Analysis depth count failure ("T_ENDSWITCH").'); - } - - if (isset($stack[$depth]['kind'])) { - $isTypeOfInterest = \in_array($stack[$depth]['kind'], $types, true); - } - } - - if (!$isTypeOfInterest) { - continue; // don't bother to analyze stuff that caller is not interested in - } - - if ($token->isGivenKind(T_CASE)) { - $stack[$depth]['cases'][] = ['index' => $index, 'open' => self::findCaseOpen($tokens, $stack[$depth]['kind'], $index)]; - } elseif ($token->isGivenKind(T_DEFAULT)) { - if (null !== $stack[$depth]['default']) { - throw new \RuntimeException('Analysis multiple "default" found.'); - } - - $stack[$depth]['default'] = ['index' => $index, 'open' => self::findDefaultOpen($tokens, $stack[$depth]['kind'], $index)]; - } - } - } - - /** - * @param array{ - * kind: int, - * index: int, - * open: int, - * end: int, - * cases: list, - * default: null|array{index: int, open: int}, - * } $analysis - */ - private static function buildControlCaseStructureAnalysis(array $analysis): AbstractControlCaseStructuresAnalysis - { - $default = null === $analysis['default'] - ? null - : new DefaultAnalysis($analysis['default']['index'], $analysis['default']['open']); - - $cases = []; - - foreach ($analysis['cases'] as $case) { - $cases[$case['index']] = new CaseAnalysis($case['index'], $case['open']); - } - - sort($cases); - - if (T_SWITCH === $analysis['kind']) { - return new SwitchAnalysis( - $analysis['index'], - $analysis['open'], - $analysis['end'], - $cases, - $default - ); - } - - if (\defined('T_ENUM') && T_ENUM === $analysis['kind']) { - return new EnumAnalysis( - $analysis['index'], - $analysis['open'], - $analysis['end'], - $cases - ); - } - - if (\defined('T_MATCH') && T_MATCH === $analysis['kind']) { // @TODO: drop condition when PHP 8.0+ is required - return new MatchAnalysis( - $analysis['index'], - $analysis['open'], - $analysis['end'], - $default - ); - } - - throw new \InvalidArgumentException(\sprintf('Unexpected type "%d".', $analysis['kind'])); - } - - private static function findCaseOpen(Tokens $tokens, int $kind, int $index): int - { - if (T_SWITCH === $kind) { - $ternariesCount = 0; - - do { - if ($tokens[$index]->equalsAny(['(', '{'])) { // skip constructs - $type = Tokens::detectBlockType($tokens[$index]); - $index = $tokens->findBlockEnd($type['type'], $index); - - continue; - } - - if ($tokens[$index]->equals('?')) { - ++$ternariesCount; - - continue; - } - - if ($tokens[$index]->equalsAny([':', ';'])) { - if (0 === $ternariesCount) { - break; - } - - --$ternariesCount; - } - } while (++$index); - - return $index; - } - - if (\defined('T_ENUM') && T_ENUM === $kind) { - return $tokens->getNextTokenOfKind($index, ['=', ';']); - } - - throw new \InvalidArgumentException(\sprintf('Unexpected case for type "%d".', $kind)); - } - - private static function findDefaultOpen(Tokens $tokens, int $kind, int $index): int - { - if (T_SWITCH === $kind) { - return $tokens->getNextTokenOfKind($index, [':', ';']); - } - - if (\defined('T_MATCH') && T_MATCH === $kind) { // @TODO: drop condition when PHP 8.0+ is required - return $tokens->getNextTokenOfKind($index, [[T_DOUBLE_ARROW]]); - } - - throw new \InvalidArgumentException(\sprintf('Unexpected default for type "%d".', $kind)); - } - - /** - * @return list - */ - private static function getTypesWithCaseOrDefault(): array - { - $supportedTypes = [T_SWITCH]; - - if (\defined('T_MATCH')) { // @TODO: drop condition when PHP 8.0+ is required - $supportedTypes[] = T_MATCH; - } - - if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required - $supportedTypes[] = T_ENUM; - } - - return $supportedTypes; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/DataProviderAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/DataProviderAnalyzer.php deleted file mode 100644 index 5fb06f3a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/DataProviderAnalyzer.php +++ /dev/null @@ -1,115 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\DocBlock\TypeExpression; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\DataProviderAnalysis; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - * - * @internal - */ -final class DataProviderAnalyzer -{ - private const REGEX_CLASS = '(?:\\\?+'.TypeExpression::REGEX_IDENTIFIER - .'(\\\\'.TypeExpression::REGEX_IDENTIFIER.')*+)'; - - /** - * @return list - */ - public function getDataProviders(Tokens $tokens, int $startIndex, int $endIndex): array - { - $methods = $this->getMethods($tokens, $startIndex, $endIndex); - - $dataProviders = []; - foreach ($methods as $methodIndex) { - $docCommentIndex = $this->getDocCommentIndex($tokens, $methodIndex); - - if (null !== $docCommentIndex) { - Preg::matchAll( - '/@dataProvider\h+(('.self::REGEX_CLASS.'::)?'.TypeExpression::REGEX_IDENTIFIER.')/', - $tokens[$docCommentIndex]->getContent(), - $matches, - PREG_OFFSET_CAPTURE - ); - - foreach ($matches[1] as $k => [$matchName]) { - \assert(isset($matches[0][$k])); - - $dataProviders[$matchName][] = [$docCommentIndex, $matches[0][$k][1]]; - } - } - } - - $dataProviderAnalyses = []; - foreach ($dataProviders as $dataProviderName => $dataProviderUsages) { - $lowercaseDataProviderName = strtolower($dataProviderName); - if (!\array_key_exists($lowercaseDataProviderName, $methods)) { - continue; - } - $dataProviderAnalyses[$methods[$lowercaseDataProviderName]] = new DataProviderAnalysis( - $tokens[$methods[$lowercaseDataProviderName]]->getContent(), - $methods[$lowercaseDataProviderName], - $dataProviderUsages, - ); - } - - ksort($dataProviderAnalyses); - - return array_values($dataProviderAnalyses); - } - - /** - * @return array - */ - private function getMethods(Tokens $tokens, int $startIndex, int $endIndex): array - { - $functions = []; - for ($index = $startIndex; $index < $endIndex; ++$index) { - if (!$tokens[$index]->isGivenKind(T_FUNCTION)) { - continue; - } - - $functionNameIndex = $tokens->getNextNonWhitespace($index); - - if (!$tokens[$functionNameIndex]->isGivenKind(T_STRING)) { - continue; - } - - $functions[strtolower($tokens[$functionNameIndex]->getContent())] = $functionNameIndex; - } - - return $functions; - } - - private function getDocCommentIndex(Tokens $tokens, int $index): ?int - { - $docCommentIndex = null; - while (!$tokens[$index]->equalsAny([';', '{', '}', [T_OPEN_TAG]])) { - --$index; - - if ($tokens[$index]->isGivenKind(T_DOC_COMMENT)) { - $docCommentIndex = $index; - - break; - } - } - - return $docCommentIndex; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/FunctionsAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/FunctionsAnalyzer.php deleted file mode 100644 index 65d0e6ac..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/FunctionsAnalyzer.php +++ /dev/null @@ -1,273 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\Analyzer\Analysis\ArgumentAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -final class FunctionsAnalyzer -{ - /** - * @var array{tokens: string, imports: list, declarations: list} - */ - private array $functionsAnalysis = ['tokens' => '', 'imports' => [], 'declarations' => []]; - - /** - * Important: risky because of the limited (file) scope of the tool. - */ - public function isGlobalFunctionCall(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->isGivenKind(T_STRING)) { - return false; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$nextIndex]->equals('(')) { - return false; - } - - $previousIsNamespaceSeparator = false; - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR)) { - $previousIsNamespaceSeparator = true; - $prevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - } - - $possibleKind = [ - T_DOUBLE_COLON, T_FUNCTION, CT::T_NAMESPACE_OPERATOR, T_NEW, CT::T_RETURN_REF, T_STRING, - ...Token::getObjectOperatorKinds(), - ]; - - // @TODO: drop condition when PHP 8.0+ is required - if (\defined('T_ATTRIBUTE')) { - $possibleKind[] = T_ATTRIBUTE; - } - - if ($tokens[$prevIndex]->isGivenKind($possibleKind)) { - return false; - } - - if ($tokens[$tokens->getNextMeaningfulToken($nextIndex)]->isGivenKind(CT::T_FIRST_CLASS_CALLABLE)) { - return false; - } - - if ($previousIsNamespaceSeparator) { - return true; - } - - if ($tokens->isChanged() || $tokens->getCodeHash() !== $this->functionsAnalysis['tokens']) { - $this->buildFunctionsAnalysis($tokens); - } - - // figure out in which namespace we are - $scopeStartIndex = 0; - $scopeEndIndex = \count($tokens) - 1; - $inGlobalNamespace = false; - - foreach ($tokens->getNamespaceDeclarations() as $declaration) { - $scopeStartIndex = $declaration->getScopeStartIndex(); - $scopeEndIndex = $declaration->getScopeEndIndex(); - - if ($index >= $scopeStartIndex && $index <= $scopeEndIndex) { - $inGlobalNamespace = $declaration->isGlobalNamespace(); - - break; - } - } - - $call = strtolower($tokens[$index]->getContent()); - - // check if the call is to a function declared in the same namespace as the call is done, - // if the call is already in the global namespace than declared functions are in the same - // global namespace and don't need checking - - if (!$inGlobalNamespace) { - /** @var int $functionNameIndex */ - foreach ($this->functionsAnalysis['declarations'] as $functionNameIndex) { - if ($functionNameIndex < $scopeStartIndex || $functionNameIndex > $scopeEndIndex) { - continue; - } - - if (strtolower($tokens[$functionNameIndex]->getContent()) === $call) { - return false; - } - } - } - - /** @var NamespaceUseAnalysis $functionUse */ - foreach ($this->functionsAnalysis['imports'] as $functionUse) { - if ($functionUse->getStartIndex() < $scopeStartIndex || $functionUse->getEndIndex() > $scopeEndIndex) { - continue; - } - - if ($call !== strtolower($functionUse->getShortName())) { - continue; - } - - // global import like `use function \str_repeat;` - return $functionUse->getShortName() === ltrim($functionUse->getFullName(), '\\'); - } - - if (AttributeAnalyzer::isAttribute($tokens, $index)) { - return false; - } - - return true; - } - - /** - * @return array - */ - public function getFunctionArguments(Tokens $tokens, int $functionIndex): array - { - $argumentsStart = $tokens->getNextTokenOfKind($functionIndex, ['(']); - $argumentsEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $argumentsStart); - $argumentAnalyzer = new ArgumentsAnalyzer(); - $arguments = []; - - foreach ($argumentAnalyzer->getArguments($tokens, $argumentsStart, $argumentsEnd) as $start => $end) { - $argumentInfo = $argumentAnalyzer->getArgumentInfo($tokens, $start, $end); - $arguments[$argumentInfo->getName()] = $argumentInfo; - } - - return $arguments; - } - - public function getFunctionReturnType(Tokens $tokens, int $methodIndex): ?TypeAnalysis - { - $argumentsStart = $tokens->getNextTokenOfKind($methodIndex, ['(']); - $argumentsEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $argumentsStart); - $typeColonIndex = $tokens->getNextMeaningfulToken($argumentsEnd); - - if (!$tokens[$typeColonIndex]->isGivenKind(CT::T_TYPE_COLON)) { - return null; - } - - $type = ''; - $typeStartIndex = $tokens->getNextMeaningfulToken($typeColonIndex); - $typeEndIndex = $typeStartIndex; - $functionBodyStart = $tokens->getNextTokenOfKind($typeColonIndex, ['{', ';', [T_DOUBLE_ARROW]]); - - for ($i = $typeStartIndex; $i < $functionBodyStart; ++$i) { - if ($tokens[$i]->isWhitespace() || $tokens[$i]->isComment()) { - continue; - } - - $type .= $tokens[$i]->getContent(); - $typeEndIndex = $i; - } - - return new TypeAnalysis($type, $typeStartIndex, $typeEndIndex); - } - - public function isTheSameClassCall(Tokens $tokens, int $index): bool - { - if (!$tokens->offsetExists($index)) { - throw new \InvalidArgumentException(\sprintf('Token index %d does not exist.', $index)); - } - - $operatorIndex = $tokens->getPrevMeaningfulToken($index); - - if (null === $operatorIndex) { - return false; - } - - if (!$tokens[$operatorIndex]->isObjectOperator() && !$tokens[$operatorIndex]->isGivenKind(T_DOUBLE_COLON)) { - return false; - } - - $referenceIndex = $tokens->getPrevMeaningfulToken($operatorIndex); - - if (null === $referenceIndex) { - return false; - } - - if (!$tokens[$referenceIndex]->equalsAny([[T_VARIABLE, '$this'], [T_STRING, 'self'], [T_STATIC, 'static']], false)) { - return false; - } - - return $tokens[$tokens->getNextMeaningfulToken($index)]->equals('('); - } - - private function buildFunctionsAnalysis(Tokens $tokens): void - { - $this->functionsAnalysis = [ - 'tokens' => $tokens->getCodeHash(), - 'imports' => [], - 'declarations' => [], - ]; - - // find declarations - - if ($tokens->isTokenKindFound(T_FUNCTION)) { - $end = \count($tokens); - - for ($i = 0; $i < $end; ++$i) { - // skip classy, we are looking for functions not methods - if ($tokens[$i]->isGivenKind(Token::getClassyTokenKinds())) { - $i = $tokens->getNextTokenOfKind($i, ['(', '{']); - - if ($tokens[$i]->equals('(')) { // anonymous class - $i = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $i); - $i = $tokens->getNextTokenOfKind($i, ['{']); - } - - $i = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $i); - - continue; - } - - if (!$tokens[$i]->isGivenKind(T_FUNCTION)) { - continue; - } - - $i = $tokens->getNextMeaningfulToken($i); - - if ($tokens[$i]->isGivenKind(CT::T_RETURN_REF)) { - $i = $tokens->getNextMeaningfulToken($i); - } - - if (!$tokens[$i]->isGivenKind(T_STRING)) { - continue; - } - - $this->functionsAnalysis['declarations'][] = $i; - } - } - - // find imported functions - - $namespaceUsesAnalyzer = new NamespaceUsesAnalyzer(); - - if ($tokens->isTokenKindFound(CT::T_FUNCTION_IMPORT)) { - $declarations = $namespaceUsesAnalyzer->getDeclarationsFromTokens($tokens); - - foreach ($declarations as $declaration) { - if ($declaration->isFunction()) { - $this->functionsAnalysis['imports'][] = $declaration; - } - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/GotoLabelAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/GotoLabelAnalyzer.php deleted file mode 100644 index 15d5b066..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/GotoLabelAnalyzer.php +++ /dev/null @@ -1,40 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -final class GotoLabelAnalyzer -{ - public function belongsToGoToLabel(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->equals(':')) { - return false; - } - - $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($index); - - if (!$tokens[$prevMeaningfulTokenIndex]->isGivenKind(T_STRING)) { - return false; - } - - $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($prevMeaningfulTokenIndex); - - return $tokens[$prevMeaningfulTokenIndex]->equalsAny([':', ';', '{', '}', [T_OPEN_TAG]]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespaceUsesAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespaceUsesAnalyzer.php deleted file mode 100644 index fea85906..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespaceUsesAnalyzer.php +++ /dev/null @@ -1,216 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\Tokenizer\TokensAnalyzer; - -/** - * @author VeeWee - * @author Greg Korba - * - * @internal - * - * @TODO Drop `allowMultiUses` opt-in flag when all fixers are updated and can handle multi-use statements. - */ -final class NamespaceUsesAnalyzer -{ - /** - * @return list - */ - public function getDeclarationsFromTokens(Tokens $tokens, bool $allowMultiUses = false): array - { - $tokenAnalyzer = new TokensAnalyzer($tokens); - $useIndices = $tokenAnalyzer->getImportUseIndexes(); - - return $this->getDeclarations($tokens, $useIndices, $allowMultiUses); - } - - /** - * @return list - */ - public function getDeclarationsInNamespace(Tokens $tokens, NamespaceAnalysis $namespace, bool $allowMultiUses = false): array - { - $namespaceUses = []; - - foreach ($this->getDeclarationsFromTokens($tokens, $allowMultiUses) as $namespaceUse) { - if ($namespaceUse->getStartIndex() >= $namespace->getScopeStartIndex() && $namespaceUse->getStartIndex() <= $namespace->getScopeEndIndex()) { - $namespaceUses[] = $namespaceUse; - } - } - - return $namespaceUses; - } - - /** - * @param list $useIndices - * - * @return list - */ - private function getDeclarations(Tokens $tokens, array $useIndices, bool $allowMultiUses = false): array - { - $uses = []; - - foreach ($useIndices as $index) { - $endIndex = $tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]); - - $declarations = $this->parseDeclarations($index, $endIndex, $tokens); - if (false === $allowMultiUses) { - $declarations = array_filter($declarations, static fn (NamespaceUseAnalysis $declaration) => !$declaration->isInMulti()); - } - - if ([] !== $declarations) { - $uses = array_merge($uses, $declarations); - } - } - - return $uses; - } - - /** - * @return list - */ - private function parseDeclarations(int $startIndex, int $endIndex, Tokens $tokens): array - { - $type = $this->determineImportType($tokens, $startIndex); - $potentialMulti = $tokens->getNextTokenOfKind($startIndex, [',', [CT::T_GROUP_IMPORT_BRACE_OPEN]]); - $multi = null !== $potentialMulti && $potentialMulti < $endIndex; - $index = $tokens->getNextTokenOfKind($startIndex, [[T_STRING], [T_NS_SEPARATOR]]); - $imports = []; - - while (null !== $index && $index <= $endIndex) { - $qualifiedName = $this->getNearestQualifiedName($tokens, $index); - $token = $tokens[$qualifiedName['afterIndex']]; - - if ($token->isGivenKind(CT::T_GROUP_IMPORT_BRACE_OPEN)) { - $groupStart = $groupIndex = $qualifiedName['afterIndex']; - $groupEnd = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_GROUP_IMPORT_BRACE, $groupStart); - - while ($groupIndex < $groupEnd) { - $chunkStart = $tokens->getNextMeaningfulToken($groupIndex); - - // Finish parsing on trailing comma (no more chunks there) - if ($tokens[$chunkStart]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_CLOSE)) { - break; - } - - $groupQualifiedName = $this->getNearestQualifiedName($tokens, $chunkStart); - $imports[] = new NamespaceUseAnalysis( - $type, - $qualifiedName['fullName'].$groupQualifiedName['fullName'], // @phpstan-ignore argument.type - $groupQualifiedName['shortName'], - $groupQualifiedName['aliased'], - true, - $startIndex, - $endIndex, - $chunkStart, - $tokens->getPrevMeaningfulToken($groupQualifiedName['afterIndex']) - ); - - $groupIndex = $groupQualifiedName['afterIndex']; - } - - $index = $groupIndex; - } elseif ($token->equalsAny([',', ';', [T_CLOSE_TAG]])) { - $previousToken = $tokens->getPrevMeaningfulToken($qualifiedName['afterIndex']); - - if (!$tokens[$previousToken]->isGivenKind(CT::T_GROUP_IMPORT_BRACE_CLOSE)) { - $imports[] = new NamespaceUseAnalysis( - $type, - $qualifiedName['fullName'], - $qualifiedName['shortName'], - $qualifiedName['aliased'], - $multi, - $startIndex, - $endIndex, - $multi ? $index : null, - $multi ? $previousToken : null - ); - } - - $index = $qualifiedName['afterIndex']; - } - - $index = $tokens->getNextMeaningfulToken($index); - } - - return $imports; - } - - /** - * @return NamespaceUseAnalysis::TYPE_* - */ - private function determineImportType(Tokens $tokens, int $startIndex): int - { - $potentialType = $tokens[$tokens->getNextMeaningfulToken($startIndex)]; - - if ($potentialType->isGivenKind(CT::T_FUNCTION_IMPORT)) { - return NamespaceUseAnalysis::TYPE_FUNCTION; - } - - if ($potentialType->isGivenKind(CT::T_CONST_IMPORT)) { - return NamespaceUseAnalysis::TYPE_CONSTANT; - } - - return NamespaceUseAnalysis::TYPE_CLASS; - } - - /** - * @return array{fullName: class-string, shortName: string, aliased: bool, afterIndex: int} - */ - private function getNearestQualifiedName(Tokens $tokens, int $index): array - { - $fullName = $shortName = ''; - $aliased = false; - - while (null !== $index) { - $token = $tokens[$index]; - - if ($token->isGivenKind(T_STRING)) { - $shortName = $token->getContent(); - if (!$aliased) { - $fullName .= $shortName; - } - } elseif ($token->isGivenKind(T_NS_SEPARATOR)) { - $fullName .= $token->getContent(); - } elseif ($token->isGivenKind(T_AS)) { - $aliased = true; - } elseif ($token->equalsAny([ - ',', - ';', - [CT::T_GROUP_IMPORT_BRACE_OPEN], - [CT::T_GROUP_IMPORT_BRACE_CLOSE], - [T_CLOSE_TAG], - ])) { - break; - } - - $index = $tokens->getNextMeaningfulToken($index); - } - - /** @var class-string $fqn */ - $fqn = $fullName; - - return [ - 'fullName' => $fqn, - 'shortName' => $shortName, - 'aliased' => $aliased, - 'afterIndex' => $index, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespacesAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespacesAnalyzer.php deleted file mode 100644 index ed1dacd4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespacesAnalyzer.php +++ /dev/null @@ -1,116 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -final class NamespacesAnalyzer -{ - /** - * @return list - */ - public function getDeclarations(Tokens $tokens): array - { - $namespaces = []; - - for ($index = 1, $count = \count($tokens); $index < $count; ++$index) { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_NAMESPACE)) { - continue; - } - - $declarationEndIndex = $tokens->getNextTokenOfKind($index, [';', '{']); - $namespace = trim($tokens->generatePartialCode($index + 1, $declarationEndIndex - 1)); - $declarationParts = explode('\\', $namespace); - $shortName = end($declarationParts); - - if ($tokens[$declarationEndIndex]->equals('{')) { - $scopeEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $declarationEndIndex); - } else { - $scopeEndIndex = $tokens->getNextTokenOfKind($declarationEndIndex, [[T_NAMESPACE]]); - if (null === $scopeEndIndex) { - $scopeEndIndex = \count($tokens); - } - --$scopeEndIndex; - } - - $namespaces[] = new NamespaceAnalysis( - $namespace, - $shortName, - $index, - $declarationEndIndex, - $index, - $scopeEndIndex - ); - - // Continue the analysis after the end of this namespace to find the next one - $index = $scopeEndIndex; - } - - if (0 === \count($namespaces) && $tokens->isTokenKindFound(T_OPEN_TAG)) { - $namespaces[] = new NamespaceAnalysis( - '', - '', - $openTagIndex = $tokens[0]->isGivenKind(T_INLINE_HTML) ? 1 : 0, - $openTagIndex, - $openTagIndex, - \count($tokens) - 1, - ); - } - - return $namespaces; - } - - public function getNamespaceAt(Tokens $tokens, int $index): NamespaceAnalysis - { - if (!$tokens->offsetExists($index)) { - throw new \InvalidArgumentException(\sprintf('Token index %d does not exist.', $index)); - } - - foreach ($this->getDeclarations($tokens) as $namespace) { - if ($namespace->getScopeStartIndex() <= $index && $namespace->getScopeEndIndex() >= $index) { - return $namespace; - } - } - - throw new \LogicException(\sprintf('Unable to get the namespace at index %d.', $index)); - } - - /** - * @return array{NamespaceAnalysis, array} - */ - public static function collectNamespaceAnalysis(Tokens $tokens, int $startIndex): array - { - $namespaceAnalysis = (new self())->getNamespaceAt($tokens, $startIndex); - $namespaceUseAnalyses = (new NamespaceUsesAnalyzer())->getDeclarationsInNamespace($tokens, $namespaceAnalysis); - - $uses = []; - foreach ($namespaceUseAnalyses as $use) { - if (!$use->isClass()) { - continue; - } - - $uses[$use->getShortName()] = $use; - } - - return [$namespaceAnalysis, $uses]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/RangeAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/RangeAnalyzer.php deleted file mode 100644 index 51a2abde..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/RangeAnalyzer.php +++ /dev/null @@ -1,90 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -final class RangeAnalyzer -{ - private function __construct() - { - // cannot create instance of util. class - } - - /** - * Meaningful compare of tokens within ranges. - * - * @param array{start: int, end: int} $range1 - * @param array{start: int, end: int} $range2 - */ - public static function rangeEqualsRange(Tokens $tokens, array $range1, array $range2): bool - { - $leftStart = $range1['start']; - $leftEnd = $range1['end']; - - if ($tokens[$leftStart]->isGivenKind([T_WHITESPACE, T_COMMENT, T_DOC_COMMENT])) { - $leftStart = $tokens->getNextMeaningfulToken($leftStart); - } - - while ($tokens[$leftStart]->equals('(') && $tokens[$leftEnd]->equals(')')) { - $leftStart = $tokens->getNextMeaningfulToken($leftStart); - $leftEnd = $tokens->getPrevMeaningfulToken($leftEnd); - } - - $rightStart = $range2['start']; - $rightEnd = $range2['end']; - - if ($tokens[$rightStart]->isGivenKind([T_WHITESPACE, T_COMMENT, T_DOC_COMMENT])) { - $rightStart = $tokens->getNextMeaningfulToken($rightStart); - } - - while ($tokens[$rightStart]->equals('(') && $tokens[$rightEnd]->equals(')')) { - $rightStart = $tokens->getNextMeaningfulToken($rightStart); - $rightEnd = $tokens->getPrevMeaningfulToken($rightEnd); - } - - $arrayOpenTypes = ['[', [CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN]]; - $arrayCloseTypes = [']', [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE]]; - - while (true) { - $leftToken = $tokens[$leftStart]; - $rightToken = $tokens[$rightStart]; - - if ( - !$leftToken->equals($rightToken) - && !($leftToken->equalsAny($arrayOpenTypes) && $rightToken->equalsAny($arrayOpenTypes)) - && !($leftToken->equalsAny($arrayCloseTypes) && $rightToken->equalsAny($arrayCloseTypes)) - ) { - return false; - } - - $leftStart = $tokens->getNextMeaningfulToken($leftStart); - $rightStart = $tokens->getNextMeaningfulToken($rightStart); - - $reachedLeftEnd = null === $leftStart || $leftStart > $leftEnd; // reached end left or moved over - $reachedRightEnd = null === $rightStart || $rightStart > $rightEnd; // reached end right or moved over - - if (!$reachedLeftEnd && !$reachedRightEnd) { - continue; - } - - return $reachedLeftEnd && $reachedRightEnd; - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ReferenceAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ReferenceAnalyzer.php deleted file mode 100644 index 0c7d4bd9..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ReferenceAnalyzer.php +++ /dev/null @@ -1,49 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @author Kuba Werłos - * - * @internal - */ -final class ReferenceAnalyzer -{ - public function isReference(Tokens $tokens, int $index): bool - { - if ($tokens[$index]->isGivenKind(CT::T_RETURN_REF)) { - return true; - } - - if (!$tokens[$index]->equals('&')) { - return false; - } - - /** @var int $index */ - $index = $tokens->getPrevMeaningfulToken($index); - if ($tokens[$index]->equalsAny(['=', [T_AS], [T_CALLABLE], [T_DOUBLE_ARROW], [CT::T_ARRAY_TYPEHINT]])) { - return true; - } - - if ($tokens[$index]->isGivenKind(T_STRING)) { - $index = $tokens->getPrevMeaningfulToken($index); - } - - return $tokens[$index]->equalsAny(['(', ',', [T_NS_SEPARATOR], [CT::T_NULLABLE_TYPE]]); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/SwitchAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/SwitchAnalyzer.php deleted file mode 100644 index fce1f9e3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/SwitchAnalyzer.php +++ /dev/null @@ -1,69 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\Analyzer\Analysis\SwitchAnalysis; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -final class SwitchAnalyzer -{ - /** @var array> */ - private static array $cache = []; - - public static function belongsToSwitch(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->equals(':')) { - return false; - } - - $tokensHash = md5(serialize($tokens->toArray())); - - if (!\array_key_exists($tokensHash, self::$cache)) { - self::$cache[$tokensHash] = self::getColonIndicesForSwitch(clone $tokens); - } - - return \in_array($index, self::$cache[$tokensHash], true); - } - - /** - * @return list - */ - private static function getColonIndicesForSwitch(Tokens $tokens): array - { - $colonIndices = []; - - /** @var SwitchAnalysis $analysis */ - foreach (ControlCaseStructuresAnalyzer::findControlStructures($tokens, [T_SWITCH]) as $analysis) { - if ($tokens[$analysis->getOpenIndex()]->equals(':')) { - $colonIndices[] = $analysis->getOpenIndex(); - } - - foreach ($analysis->getCases() as $case) { - $colonIndices[] = $case->getColonIndex(); - } - - $defaultAnalysis = $analysis->getDefaultAnalysis(); - - if (null !== $defaultAnalysis) { - $colonIndices[] = $defaultAnalysis->getColonIndex(); - } - } - - return $colonIndices; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/WhitespacesAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/WhitespacesAnalyzer.php deleted file mode 100644 index 0845ce40..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/WhitespacesAnalyzer.php +++ /dev/null @@ -1,52 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Analyzer; - -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -final class WhitespacesAnalyzer -{ - public static function detectIndent(Tokens $tokens, int $index): string - { - while (true) { - $whitespaceIndex = $tokens->getPrevTokenOfKind($index, [[T_WHITESPACE]]); - - if (null === $whitespaceIndex) { - return ''; - } - - $whitespaceToken = $tokens[$whitespaceIndex]; - - if (str_contains($whitespaceToken->getContent(), "\n")) { - break; - } - - $prevToken = $tokens[$whitespaceIndex - 1]; - - if ($prevToken->isGivenKind([T_OPEN_TAG, T_COMMENT]) && "\n" === substr($prevToken->getContent(), -1)) { - break; - } - - $index = $whitespaceIndex; - } - - $explodedContent = explode("\n", $whitespaceToken->getContent()); - - return end($explodedContent); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CT.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CT.php deleted file mode 100644 index eefe46d3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CT.php +++ /dev/null @@ -1,112 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer; - -/** - * @author Dariusz Rumiński - */ -final class CT -{ - public const T_ARRAY_INDEX_CURLY_BRACE_CLOSE = 10_001; - public const T_ARRAY_INDEX_CURLY_BRACE_OPEN = 10_002; - public const T_ARRAY_SQUARE_BRACE_CLOSE = 10_003; - public const T_ARRAY_SQUARE_BRACE_OPEN = 10_004; - public const T_ARRAY_TYPEHINT = 10_005; - public const T_BRACE_CLASS_INSTANTIATION_CLOSE = 10_006; - public const T_BRACE_CLASS_INSTANTIATION_OPEN = 10_007; - public const T_CLASS_CONSTANT = 10_008; - public const T_CONST_IMPORT = 10_009; - public const T_CURLY_CLOSE = 10_010; - public const T_DESTRUCTURING_SQUARE_BRACE_CLOSE = 10_011; - public const T_DESTRUCTURING_SQUARE_BRACE_OPEN = 10_012; - public const T_DOLLAR_CLOSE_CURLY_BRACES = 10_013; - public const T_DYNAMIC_PROP_BRACE_CLOSE = 10_014; - public const T_DYNAMIC_PROP_BRACE_OPEN = 10_015; - public const T_DYNAMIC_VAR_BRACE_CLOSE = 10_016; - public const T_DYNAMIC_VAR_BRACE_OPEN = 10_017; - public const T_FUNCTION_IMPORT = 10_018; - public const T_GROUP_IMPORT_BRACE_CLOSE = 10_019; - public const T_GROUP_IMPORT_BRACE_OPEN = 10_020; - public const T_NAMESPACE_OPERATOR = 10_021; - public const T_NULLABLE_TYPE = 10_022; - public const T_RETURN_REF = 10_023; - public const T_TYPE_ALTERNATION = 10_024; - public const T_TYPE_COLON = 10_025; - public const T_USE_LAMBDA = 10_026; - public const T_USE_TRAIT = 10_027; - public const T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC = 10_028; - public const T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED = 10_029; - public const T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE = 10_030; - public const T_ATTRIBUTE_CLOSE = 10_031; - public const T_NAMED_ARGUMENT_NAME = 10_032; - public const T_NAMED_ARGUMENT_COLON = 10_033; - public const T_FIRST_CLASS_CALLABLE = 10_034; - public const T_TYPE_INTERSECTION = 10_035; - public const T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN = 10_036; - public const T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE = 10_037; - public const T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_OPEN = 10_038; - public const T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_CLOSE = 10_039; - public const T_PROPERTY_HOOK_BRACE_OPEN = 10_040; - public const T_PROPERTY_HOOK_BRACE_CLOSE = 10_041; - - private function __construct() {} - - /** - * Get name for custom token. - * - * @param int $value custom token value - * - * @return non-empty-string - */ - public static function getName(int $value): string - { - if (!self::has($value)) { - throw new \InvalidArgumentException(\sprintf('No custom token was found for "%s".', $value)); - } - - $tokens = self::getMapById(); - - \assert(isset($tokens[$value])); - - return 'CT::'.$tokens[$value]; - } - - /** - * Check if given custom token exists. - * - * @param int $value custom token value - */ - public static function has(int $value): bool - { - $tokens = self::getMapById(); - - return isset($tokens[$value]); - } - - /** - * @return array - */ - private static function getMapById(): array - { - static $constants; - - if (null === $constants) { - $reflection = new \ReflectionClass(self::class); - $constants = array_flip($reflection->getConstants()); - } - - return $constants; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CodeHasher.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CodeHasher.php deleted file mode 100644 index 86a4a68a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CodeHasher.php +++ /dev/null @@ -1,38 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer; - -/** - * @author Dariusz Rumiński - * - * @internal - */ -final class CodeHasher -{ - private function __construct() - { - // cannot create instance of util. class - } - - /** - * Calculate hash for code. - * - * @return non-empty-string - */ - public static function calculateCodeHash(string $code): string - { - return md5($code); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Processor/ImportProcessor.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Processor/ImportProcessor.php deleted file mode 100644 index 46bfe06e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Processor/ImportProcessor.php +++ /dev/null @@ -1,103 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Processor; - -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; -use PhpCsFixer\WhitespacesFixerConfig; - -/** - * @author Greg Korba - * - * @readonly - */ -final class ImportProcessor -{ - private WhitespacesFixerConfig $whitespacesConfig; - - public function __construct(WhitespacesFixerConfig $whitespacesConfig) - { - $this->whitespacesConfig = $whitespacesConfig; - } - - /** - * @param array{ - * const?: array, - * class?: array, - * function?: array - * } $imports - */ - public function insertImports(Tokens $tokens, array $imports, int $atIndex): void - { - $lineEnding = $this->whitespacesConfig->getLineEnding(); - - if (!$tokens[$atIndex]->isWhitespace() || !str_contains($tokens[$atIndex]->getContent(), "\n")) { - $tokens->insertAt($atIndex, new Token([T_WHITESPACE, $lineEnding])); - } - - foreach ($imports as $type => $typeImports) { - sort($typeImports); - - $items = []; - - foreach ($typeImports as $name) { - $items = array_merge($items, [ - new Token([T_WHITESPACE, $lineEnding]), - new Token([T_USE, 'use']), - new Token([T_WHITESPACE, ' ']), - ]); - - if ('const' === $type) { - $items[] = new Token([CT::T_CONST_IMPORT, 'const']); - $items[] = new Token([T_WHITESPACE, ' ']); - } elseif ('function' === $type) { - $items[] = new Token([CT::T_FUNCTION_IMPORT, 'function']); - $items[] = new Token([T_WHITESPACE, ' ']); - } - - $items = array_merge($items, self::tokenizeName($name)); - $items[] = new Token(';'); - } - - $tokens->insertAt($atIndex, $items); - } - } - - /** - * @param class-string $name - * - * @return list - */ - public static function tokenizeName(string $name): array - { - $parts = explode('\\', $name); - $newTokens = []; - - if ('' === $parts[0]) { - $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); - array_shift($parts); - } - - foreach ($parts as $part) { - $newTokens[] = new Token([T_STRING, $part]); - $newTokens[] = new Token([T_NS_SEPARATOR, '\\']); - } - - array_pop($newTokens); - - return $newTokens; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Token.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Token.php deleted file mode 100644 index 57ad192d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Token.php +++ /dev/null @@ -1,541 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer; - -use PhpCsFixer\Utils; - -/** - * Representation of single token. - * As a token prototype you should understand a single element generated by token_get_all. - * - * @author Dariusz Rumiński - * - * @readonly - */ -final class Token -{ - /** - * Content of token prototype. - */ - private string $content; - - /** - * ID of token prototype, if available. - */ - private ?int $id; - - /** - * If token prototype is an array. - */ - private bool $isArray; - - /** - * @param array{int, string}|string $token token prototype - */ - public function __construct($token) - { - if (\is_array($token)) { - if (!\is_int($token[0])) { - throw new \InvalidArgumentException(\sprintf( - 'Id must be an int, got "%s".', - get_debug_type($token[0]) - )); - } - - if (!\is_string($token[1])) { - throw new \InvalidArgumentException(\sprintf( - 'Content must be a string, got "%s".', - get_debug_type($token[1]) - )); - } - - if ('' === $token[1]) { - throw new \InvalidArgumentException('Cannot set empty content for id-based Token.'); - } - - $this->isArray = true; - $this->id = $token[0]; - $this->content = $token[1]; - } elseif (\is_string($token)) { - $this->isArray = false; - $this->id = null; - $this->content = $token; - } else { - throw new \InvalidArgumentException(\sprintf('Cannot recognize input value as valid Token prototype, got "%s".', get_debug_type($token))); - } - } - - /** - * @return list - */ - public static function getCastTokenKinds(): array - { - static $castTokens = [T_ARRAY_CAST, T_BOOL_CAST, T_DOUBLE_CAST, T_INT_CAST, T_OBJECT_CAST, T_STRING_CAST, T_UNSET_CAST]; - - return $castTokens; - } - - /** - * Get classy tokens kinds: T_CLASS, T_INTERFACE and T_TRAIT. - * - * @return list - */ - public static function getClassyTokenKinds(): array - { - static $classTokens; - - if (null === $classTokens) { - $classTokens = [T_CLASS, T_TRAIT, T_INTERFACE]; - - if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required - $classTokens[] = T_ENUM; - } - } - - return $classTokens; - } - - /** - * Get object operator tokens kinds: T_OBJECT_OPERATOR and (if available) T_NULLSAFE_OBJECT_OPERATOR. - * - * @return list - */ - public static function getObjectOperatorKinds(): array - { - static $objectOperators = null; - - if (null === $objectOperators) { - $objectOperators = [T_OBJECT_OPERATOR]; - if (\defined('T_NULLSAFE_OBJECT_OPERATOR')) { - $objectOperators[] = T_NULLSAFE_OBJECT_OPERATOR; - } - } - - return $objectOperators; - } - - /** - * Check if token is equals to given one. - * - * If tokens are arrays, then only keys defined in parameter token are checked. - * - * @param array{0: int, 1?: string}|string|Token $other token or it's prototype - * @param bool $caseSensitive perform a case sensitive comparison - */ - public function equals($other, bool $caseSensitive = true): bool - { - if (\defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG')) { // @TODO: drop condition when PHP 8.1+ is required - if ('&' === $other) { - return '&' === $this->content && (null === $this->id || $this->isGivenKind([T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG, T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG])); - } - if (null === $this->id && '&' === $this->content) { - return $other instanceof self && '&' === $other->content && (null === $other->id || $other->isGivenKind([T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG, T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG])); - } - } - - if ($other instanceof self) { - // Inlined getPrototype() on this very hot path. - // We access the private properties of $other directly to save function call overhead. - // This is only possible because $other is of the same class as `self`. - if (!$other->isArray) { - $otherPrototype = $other->content; - } else { - $otherPrototype = [ - $other->id, - $other->content, - ]; - } - } else { - $otherPrototype = $other; - } - - if ($this->isArray !== \is_array($otherPrototype)) { - return false; - } - - if (!$this->isArray) { - return $this->content === $otherPrototype; - } - - if ($this->id !== $otherPrototype[0]) { - return false; - } - - if (isset($otherPrototype[1])) { - if ($caseSensitive) { - if ($this->content !== $otherPrototype[1]) { - return false; - } - } elseif (0 !== strcasecmp($this->content, $otherPrototype[1])) { - return false; - } - } - - // detect unknown keys - unset($otherPrototype[0], $otherPrototype[1]); - - return [] === $otherPrototype; - } - - /** - * Check if token is equals to one of given. - * - * @param list $others array of tokens or token prototypes - * @param bool $caseSensitive perform a case sensitive comparison - */ - public function equalsAny(array $others, bool $caseSensitive = true): bool - { - foreach ($others as $other) { - if ($this->equals($other, $caseSensitive)) { - return true; - } - } - - return false; - } - - /** - * A helper method used to find out whether a certain input token has to be case-sensitively matched. - * - * @param array|bool $caseSensitive global case sensitiveness or an array of booleans, whose keys should match - * the ones used in $sequence. If any is missing, the default case-sensitive - * comparison is used - * @param int $key the key of the token that has to be looked up - * - * @deprecated - */ - public static function isKeyCaseSensitive($caseSensitive, int $key): bool - { - Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( - 'Method "%s" is deprecated and will be removed in the next major version.', - __METHOD__ - ))); - - if (\is_array($caseSensitive)) { - return $caseSensitive[$key] ?? true; - } - - return $caseSensitive; - } - - /** - * @return array{int, non-empty-string}|string - */ - public function getPrototype() - { - if (!$this->isArray) { - return $this->content; - } - - \assert('' !== $this->content); - - return [ - $this->id, - $this->content, - ]; - } - - /** - * Get token's content. - * - * It shall be used only for getting the content of token, not for checking it against excepted value. - */ - public function getContent(): string - { - return $this->content; - } - - /** - * Get token's id. - * - * It shall be used only for getting the internal id of token, not for checking it against excepted value. - */ - public function getId(): ?int - { - return $this->id; - } - - /** - * Get token's name. - * - * It shall be used only for getting the name of token, not for checking it against excepted value. - * - * @return null|non-empty-string token name - */ - public function getName(): ?string - { - if (null === $this->id) { - return null; - } - - return self::getNameForId($this->id); - } - - /** - * Get token's name. - * - * It shall be used only for getting the name of token, not for checking it against excepted value. - * - * @return null|non-empty-string token name - */ - public static function getNameForId(int $id): ?string - { - if (CT::has($id)) { - return CT::getName($id); - } - - $name = token_name($id); - - return 'UNKNOWN' === $name ? null : $name; - } - - /** - * Generate array containing all keywords that exists in PHP version in use. - * - * @return list - */ - public static function getKeywords(): array - { - static $keywords = null; - - if (null === $keywords) { - $keywords = self::getTokenKindsForNames(['T_ABSTRACT', 'T_ARRAY', 'T_AS', 'T_BREAK', 'T_CALLABLE', 'T_CASE', - 'T_CATCH', 'T_CLASS', 'T_CLONE', 'T_CONST', 'T_CONTINUE', 'T_DECLARE', 'T_DEFAULT', 'T_DO', - 'T_ECHO', 'T_ELSE', 'T_ELSEIF', 'T_EMPTY', 'T_ENDDECLARE', 'T_ENDFOR', 'T_ENDFOREACH', - 'T_ENDIF', 'T_ENDSWITCH', 'T_ENDWHILE', 'T_EVAL', 'T_EXIT', 'T_EXTENDS', 'T_FINAL', - 'T_FINALLY', 'T_FN', 'T_FOR', 'T_FOREACH', 'T_FUNCTION', 'T_GLOBAL', 'T_GOTO', 'T_HALT_COMPILER', - 'T_IF', 'T_IMPLEMENTS', 'T_INCLUDE', 'T_INCLUDE_ONCE', 'T_INSTANCEOF', 'T_INSTEADOF', - 'T_INTERFACE', 'T_ISSET', 'T_LIST', 'T_LOGICAL_AND', 'T_LOGICAL_OR', 'T_LOGICAL_XOR', - 'T_NAMESPACE', 'T_MATCH', 'T_NEW', 'T_PRINT', 'T_PRIVATE', 'T_PROTECTED', 'T_PUBLIC', 'T_REQUIRE', - 'T_REQUIRE_ONCE', 'T_RETURN', 'T_STATIC', 'T_SWITCH', 'T_THROW', 'T_TRAIT', 'T_TRY', - 'T_UNSET', 'T_USE', 'T_VAR', 'T_WHILE', 'T_YIELD', 'T_YIELD_FROM', 'T_READONLY', 'T_ENUM', - ]) + [ - CT::T_ARRAY_TYPEHINT => CT::T_ARRAY_TYPEHINT, - CT::T_CLASS_CONSTANT => CT::T_CLASS_CONSTANT, - CT::T_CONST_IMPORT => CT::T_CONST_IMPORT, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE => CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED => CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC => CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, - CT::T_FUNCTION_IMPORT => CT::T_FUNCTION_IMPORT, - CT::T_NAMESPACE_OPERATOR => CT::T_NAMESPACE_OPERATOR, - CT::T_USE_LAMBDA => CT::T_USE_LAMBDA, - CT::T_USE_TRAIT => CT::T_USE_TRAIT, - ]; - } - - return $keywords; - } - - /** - * Generate array containing all predefined constants that exists in PHP version in use. - * - * @see https://php.net/manual/en/language.constants.predefined.php - * - * @return array - */ - public static function getMagicConstants(): array - { - static $magicConstants = null; - - if (null === $magicConstants) { - $magicConstants = self::getTokenKindsForNames(['T_CLASS_C', 'T_DIR', 'T_FILE', 'T_FUNC_C', 'T_LINE', 'T_METHOD_C', 'T_NS_C', 'T_TRAIT_C']); - } - - return $magicConstants; - } - - /** - * Check if token prototype is an array. - * - * @return bool is array - * - * @phpstan-assert-if-true !=null $this->getId() - * @phpstan-assert-if-true !='' $this->getContent() - */ - public function isArray(): bool - { - return $this->isArray; - } - - /** - * Check if token is one of type cast tokens. - * - * @phpstan-assert-if-true !='' $this->getContent() - */ - public function isCast(): bool - { - return $this->isGivenKind(self::getCastTokenKinds()); - } - - /** - * Check if token is one of classy tokens: T_CLASS, T_INTERFACE, T_TRAIT or T_ENUM. - * - * @phpstan-assert-if-true !='' $this->getContent() - */ - public function isClassy(): bool - { - return $this->isGivenKind(self::getClassyTokenKinds()); - } - - /** - * Check if token is one of comment tokens: T_COMMENT or T_DOC_COMMENT. - * - * @phpstan-assert-if-true !='' $this->getContent() - */ - public function isComment(): bool - { - static $commentTokens = [T_COMMENT, T_DOC_COMMENT]; - - return $this->isGivenKind($commentTokens); - } - - /** - * Check if token is one of object operator tokens: T_OBJECT_OPERATOR or T_NULLSAFE_OBJECT_OPERATOR. - * - * @phpstan-assert-if-true !='' $this->getContent() - */ - public function isObjectOperator(): bool - { - return $this->isGivenKind(self::getObjectOperatorKinds()); - } - - /** - * Check if token is one of given kind. - * - * @param int|list $possibleKind kind or array of kinds - * - * @phpstan-assert-if-true !='' $this->getContent() - */ - public function isGivenKind($possibleKind): bool - { - return $this->isArray && (\is_array($possibleKind) ? \in_array($this->id, $possibleKind, true) : $this->id === $possibleKind); - } - - /** - * Check if token is a keyword. - * - * @phpstan-assert-if-true !='' $this->getContent() - */ - public function isKeyword(): bool - { - $keywords = self::getKeywords(); - - return $this->isArray && isset($keywords[$this->id]); - } - - /** - * Check if token is a native PHP constant: true, false or null. - * - * @phpstan-assert-if-true !='' $this->getContent() - */ - public function isNativeConstant(): bool - { - static $nativeConstantStrings = ['true', 'false', 'null']; - - return $this->isArray && \in_array(strtolower($this->content), $nativeConstantStrings, true); - } - - /** - * Returns if the token is of a Magic constants type. - * - * @phpstan-assert-if-true !='' $this->getContent() - * - * @see https://php.net/manual/en/language.constants.predefined.php - */ - public function isMagicConstant(): bool - { - $magicConstants = self::getMagicConstants(); - - return $this->isArray && isset($magicConstants[$this->id]); - } - - /** - * Check if token is whitespace. - * - * @param null|string $whitespaces whitespace characters, default is " \t\n\r\0\x0B" - */ - public function isWhitespace(?string $whitespaces = " \t\n\r\0\x0B"): bool - { - if (null === $whitespaces) { - $whitespaces = " \t\n\r\0\x0B"; - } - - if ($this->isArray && !$this->isGivenKind(T_WHITESPACE)) { - return false; - } - - return '' === trim($this->content, $whitespaces); - } - - /** - * @return array{ - * id: int|null, - * name: non-empty-string|null, - * content: string, - * isArray: bool, - * changed: bool, - * } - */ - public function toArray(): array - { - return [ - 'id' => $this->id, - 'name' => $this->getName(), - 'content' => $this->content, - 'isArray' => $this->isArray, - 'changed' => false, // @TODO v4: remove index - ]; - } - - /** - * @return non-empty-string - */ - public function toJson(): string - { - $jsonResult = json_encode($this->toArray(), JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK); - - if (JSON_ERROR_NONE !== json_last_error()) { - $jsonResult = json_encode( - [ - 'errorDescription' => 'Cannot encode Tokens to JSON.', - 'rawErrorMessage' => json_last_error_msg(), - ], - JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK - ); - } - - \assert(false !== $jsonResult); - - return $jsonResult; - } - - /** - * @param list $tokenNames - * - * @return array - */ - private static function getTokenKindsForNames(array $tokenNames): array - { - $keywords = []; - foreach ($tokenNames as $keywordName) { - if (\defined($keywordName)) { - $keyword = \constant($keywordName); - $keywords[$keyword] = $keyword; - } - } - - return $keywords; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Tokens.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Tokens.php deleted file mode 100644 index 62d55672..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Tokens.php +++ /dev/null @@ -1,1504 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer; - -use PhpCsFixer\Console\Application; -use PhpCsFixer\Preg; -use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis; -use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer; -use PhpCsFixer\Utils; - -/** - * Collection of code tokens. - * - * Its role is to provide the ability to manage collection and navigate through it. - * - * As a token prototype you should understand a single element generated by token_get_all. - * - * @author Dariusz Rumiński - * - * @extends \SplFixedArray - * - * @method Token offsetGet($offset) - * - * @final - */ -class Tokens extends \SplFixedArray -{ - public const BLOCK_TYPE_PARENTHESIS_BRACE = 1; - public const BLOCK_TYPE_CURLY_BRACE = 2; - public const BLOCK_TYPE_INDEX_SQUARE_BRACE = 3; - public const BLOCK_TYPE_ARRAY_SQUARE_BRACE = 4; - public const BLOCK_TYPE_DYNAMIC_PROP_BRACE = 5; - public const BLOCK_TYPE_DYNAMIC_VAR_BRACE = 6; - public const BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE = 7; - public const BLOCK_TYPE_GROUP_IMPORT_BRACE = 8; - public const BLOCK_TYPE_DESTRUCTURING_SQUARE_BRACE = 9; - public const BLOCK_TYPE_BRACE_CLASS_INSTANTIATION = 10; - public const BLOCK_TYPE_ATTRIBUTE = 11; - public const BLOCK_TYPE_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS = 12; - public const BLOCK_TYPE_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE = 13; - public const BLOCK_TYPE_COMPLEX_STRING_VARIABLE = 14; - public const BLOCK_TYPE_PROPERTY_HOOK = 15; - - /** - * Static class cache. - * - * @var array - */ - private static array $cache = []; - - /** - * Cache of block starts. Any change in collection will invalidate it. - * - * @var array - */ - private array $blockStartCache = []; - - /** - * Cache of block ends. Any change in collection will invalidate it. - * - * @var array - */ - private array $blockEndCache = []; - - /** - * A MD5 hash of the code string. - * - * @var ?non-empty-string - */ - private ?string $codeHash = null; - - /** - * Flag is collection was changed. - * - * It doesn't know about change of collection's items. To check it run `isChanged` method. - */ - private bool $changed = false; - - /** - * Set of found token kinds. - * - * When the token kind is present in this set it means that given token kind - * was ever seen inside the collection (but may not be part of it any longer). - * The key is token kind and the value is the number of occurrences. - * - * @var array> - */ - private array $foundTokenKinds = []; - - /** - * @var null|list - */ - private ?array $namespaceDeclarations = null; - - /** - * Clone tokens collection. - */ - public function __clone() - { - foreach ($this as $key => $val) { - $this[$key] = clone $val; - } - } - - /** - * Clear cache - one position or all of them. - * - * @param null|non-empty-string $key position to clear, when null clear all - */ - public static function clearCache(?string $key = null): void - { - if (null === $key) { - self::$cache = []; - - return; - } - - unset(self::$cache[$key]); - } - - /** - * Detect type of block. - * - * @return null|array{type: self::BLOCK_TYPE_*, isStart: bool} - */ - public static function detectBlockType(Token $token): ?array - { - static $blockEdgeKinds = null; - - if (null === $blockEdgeKinds) { - $blockEdgeKinds = []; - foreach (self::getBlockEdgeDefinitions() as $type => $definition) { - $blockEdgeKinds[ - \is_string($definition['start']) ? $definition['start'] : $definition['start'][0] - ] = ['type' => $type, 'isStart' => true]; - $blockEdgeKinds[ - \is_string($definition['end']) ? $definition['end'] : $definition['end'][0] - ] = ['type' => $type, 'isStart' => false]; - } - } - - // inlined extractTokenKind() call on the hot path - $tokenKind = $token->isArray() ? $token->getId() : $token->getContent(); - - return $blockEdgeKinds[$tokenKind] ?? null; - } - - /** - * Create token collection from array. - * - * @param array $array the array to import - * @param ?bool $saveIndices save the numeric indices used in the original array, default is yes - */ - public static function fromArray($array, $saveIndices = null): self - { - $tokens = new self(\count($array)); - - if (false !== $saveIndices && !array_is_list($array)) { - Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( - 'Parameter "array" should be a list. This will be enforced in version %d.0.', - Application::getMajorVersion() + 1 - ))); - - foreach ($array as $key => $val) { - $tokens[$key] = $val; - } - } else { - $index = 0; - foreach ($array as $val) { - $tokens[$index++] = $val; - } - } - - $tokens->generateCode(); // regenerate code to calculate code hash - $tokens->clearChanged(); - - return $tokens; - } - - /** - * Create token collection directly from code. - * - * @param string $code PHP code - */ - public static function fromCode(string $code): self - { - $codeHash = self::calculateCodeHash($code); - - if (self::hasCache($codeHash)) { - $tokens = self::getCache($codeHash); - - // generate the code to recalculate the hash - $tokens->generateCode(); - - if ($codeHash === $tokens->codeHash) { - $tokens->clearEmptyTokens(); - $tokens->clearChanged(); - - return $tokens; - } - } - - $tokens = new self(); - $tokens->setCode($code); - $tokens->clearChanged(); - - return $tokens; - } - - /** - * @return array - */ - public static function getBlockEdgeDefinitions(): array - { - static $definitions = null; - if (null === $definitions) { - $definitions = [ - self::BLOCK_TYPE_CURLY_BRACE => [ - 'start' => '{', - 'end' => '}', - ], - self::BLOCK_TYPE_PARENTHESIS_BRACE => [ - 'start' => '(', - 'end' => ')', - ], - self::BLOCK_TYPE_INDEX_SQUARE_BRACE => [ - 'start' => '[', - 'end' => ']', - ], - self::BLOCK_TYPE_ARRAY_SQUARE_BRACE => [ - 'start' => [CT::T_ARRAY_SQUARE_BRACE_OPEN, '['], - 'end' => [CT::T_ARRAY_SQUARE_BRACE_CLOSE, ']'], - ], - self::BLOCK_TYPE_DYNAMIC_PROP_BRACE => [ - 'start' => [CT::T_DYNAMIC_PROP_BRACE_OPEN, '{'], - 'end' => [CT::T_DYNAMIC_PROP_BRACE_CLOSE, '}'], - ], - self::BLOCK_TYPE_DYNAMIC_VAR_BRACE => [ - 'start' => [CT::T_DYNAMIC_VAR_BRACE_OPEN, '{'], - 'end' => [CT::T_DYNAMIC_VAR_BRACE_CLOSE, '}'], - ], - self::BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE => [ - 'start' => [CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN, '{'], - 'end' => [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE, '}'], - ], - self::BLOCK_TYPE_GROUP_IMPORT_BRACE => [ - 'start' => [CT::T_GROUP_IMPORT_BRACE_OPEN, '{'], - 'end' => [CT::T_GROUP_IMPORT_BRACE_CLOSE, '}'], - ], - self::BLOCK_TYPE_DESTRUCTURING_SQUARE_BRACE => [ - 'start' => [CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN, '['], - 'end' => [CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE, ']'], - ], - self::BLOCK_TYPE_BRACE_CLASS_INSTANTIATION => [ - 'start' => [CT::T_BRACE_CLASS_INSTANTIATION_OPEN, '('], - 'end' => [CT::T_BRACE_CLASS_INSTANTIATION_CLOSE, ')'], - ], - self::BLOCK_TYPE_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS => [ - 'start' => [CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, '('], - 'end' => [CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, ')'], - ], - self::BLOCK_TYPE_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE => [ - 'start' => [CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_OPEN, '{'], - 'end' => [CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_CLOSE, '}'], - ], - self::BLOCK_TYPE_COMPLEX_STRING_VARIABLE => [ - 'start' => [T_DOLLAR_OPEN_CURLY_BRACES, '${'], - 'end' => [CT::T_DOLLAR_CLOSE_CURLY_BRACES, '}'], - ], - self::BLOCK_TYPE_PROPERTY_HOOK => [ - 'start' => [CT::T_PROPERTY_HOOK_BRACE_OPEN, '{'], - 'end' => [CT::T_PROPERTY_HOOK_BRACE_CLOSE, '}'], - ], - ]; - - // @TODO: drop condition when PHP 8.0+ is required - if (\defined('T_ATTRIBUTE')) { - $definitions[self::BLOCK_TYPE_ATTRIBUTE] = [ - 'start' => [T_ATTRIBUTE, '#['], - 'end' => [CT::T_ATTRIBUTE_CLOSE, ']'], - ]; - } - } - - return $definitions; - } - - /** - * Set new size of collection. - * - * @param int $size - */ - #[\ReturnTypeWillChange] - public function setSize($size): bool - { - throw new \RuntimeException('Changing tokens collection size explicitly is not allowed.'); - } - - /** - * Unset collection item. - * - * @param int $index - */ - public function offsetUnset($index): void - { - if (\count($this) - 1 !== $index) { - Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( - 'Tokens should be a list - only the last index can be unset. This will be enforced in version %d.0.', - Application::getMajorVersion() + 1 - ))); - } - - if (isset($this[$index])) { - if (isset($this->blockStartCache[$index])) { - unset($this->blockEndCache[$this->blockStartCache[$index]], $this->blockStartCache[$index]); - } - if (isset($this->blockEndCache[$index])) { - unset($this->blockStartCache[$this->blockEndCache[$index]], $this->blockEndCache[$index]); - } - - $this->unregisterFoundToken($this[$index]); - - $this->changed = true; - $this->namespaceDeclarations = null; - } - - parent::offsetUnset($index); - } - - /** - * Set collection item. - * - * Warning! `$newval` must not be typehinted to be compatible with `ArrayAccess::offsetSet` method. - * - * @param int $index - * @param Token $newval - */ - public function offsetSet($index, $newval): void - { - if (0 > $index || \count($this) <= $index) { - Utils::triggerDeprecation(new \InvalidArgumentException(\sprintf( - 'Tokens should be a list - index must be within the existing range. This will be enforced in version %d.0.', - Application::getMajorVersion() + 1 - ))); - } - - if (isset($this[$index])) { - if (isset($this->blockStartCache[$index])) { - unset($this->blockEndCache[$this->blockStartCache[$index]], $this->blockStartCache[$index]); - } - if (isset($this->blockEndCache[$index])) { - unset($this->blockStartCache[$this->blockEndCache[$index]], $this->blockEndCache[$index]); - } - } - - if (!isset($this[$index]) || !$this[$index]->equals($newval)) { - if (isset($this[$index])) { - $this->unregisterFoundToken($this[$index]); - } - - $this->changed = true; - $this->namespaceDeclarations = null; - - $this->registerFoundToken($newval); - } - - parent::offsetSet($index, $newval); - } - - /** - * Clear internal flag if collection was changed and flag for all collection's items. - */ - public function clearChanged(): void - { - $this->changed = false; - } - - /** - * Clear empty tokens. - * - * Empty tokens can occur e.g. after calling clear on item of collection. - */ - public function clearEmptyTokens(): void - { - // no empty token found, therefore there is no need to override collection - if (!$this->isTokenKindFound('')) { - return; - } - - $limit = \count($this); - - for ($index = 0; $index < $limit; ++$index) { - if ($this->isEmptyAt($index)) { - break; - } - } - - for ($count = $index; $index < $limit; ++$index) { - if (!$this->isEmptyAt($index)) { - // use directly for speed, skip the register of token kinds found etc. - $buffer = $this[$count]; - parent::offsetSet($count, $this[$index]); - parent::offsetSet($index, $buffer); - - if (isset($this->blockStartCache[$index])) { - $otherEndIndex = $this->blockStartCache[$index]; - unset($this->blockStartCache[$index]); - $this->blockStartCache[$count] = $otherEndIndex; - $this->blockEndCache[$otherEndIndex] = $count; - } - - if (isset($this->blockEndCache[$index])) { - $otherEndIndex = $this->blockEndCache[$index]; - unset($this->blockEndCache[$index]); - $this->blockStartCache[$otherEndIndex] = $count; - $this->blockEndCache[$count] = $otherEndIndex; - } - - ++$count; - } - } - - // we are moving the tokens, we need to clear the index-based Cache - $this->namespaceDeclarations = null; - $this->foundTokenKinds[''] = 0; - - $this->updateSize($count); - } - - /** - * Ensure that on given index is a whitespace with given kind. - * - * If there is a whitespace then it's content will be modified. - * If not - the new Token will be added. - * - * @param int $index index - * @param int $indexOffset index offset for Token insertion - * @param string $whitespace whitespace to set - * - * @return bool if new Token was added - */ - public function ensureWhitespaceAtIndex(int $index, int $indexOffset, string $whitespace): bool - { - $removeLastCommentLine = static function (self $tokens, int $index, int $indexOffset, string $whitespace): string { - $token = $tokens[$index]; - - if (1 === $indexOffset && $token->isGivenKind(T_OPEN_TAG)) { - if (str_starts_with($whitespace, "\r\n")) { - $tokens[$index] = new Token([T_OPEN_TAG, rtrim($token->getContent())."\r\n"]); - - return \strlen($whitespace) > 2 // @TODO: can be removed on PHP 8; https://php.net/manual/en/function.substr.php - ? substr($whitespace, 2) - : ''; - } - - $tokens[$index] = new Token([T_OPEN_TAG, rtrim($token->getContent()).$whitespace[0]]); - - return \strlen($whitespace) > 1 // @TODO: can be removed on PHP 8; https://php.net/manual/en/function.substr.php - ? substr($whitespace, 1) - : ''; - } - - return $whitespace; - }; - - if ($this[$index]->isWhitespace()) { - $whitespace = $removeLastCommentLine($this, $index - 1, $indexOffset, $whitespace); - - if ('' === $whitespace) { - $this->clearAt($index); - } else { - $this[$index] = new Token([T_WHITESPACE, $whitespace]); - } - - return false; - } - - $whitespace = $removeLastCommentLine($this, $index, $indexOffset, $whitespace); - - if ('' === $whitespace) { - return false; - } - - $this->insertAt( - $index + $indexOffset, - [new Token([T_WHITESPACE, $whitespace])] - ); - - return true; - } - - /** - * @param self::BLOCK_TYPE_* $type type of block - * @param int $searchIndex index of opening brace - * - * @return int<0, max> index of closing brace - */ - public function findBlockEnd(int $type, int $searchIndex): int - { - return $this->findOppositeBlockEdge($type, $searchIndex, true); - } - - /** - * @param self::BLOCK_TYPE_* $type type of block - * @param int $searchIndex index of closing brace - * - * @return int<0, max> index of opening brace - */ - public function findBlockStart(int $type, int $searchIndex): int - { - return $this->findOppositeBlockEdge($type, $searchIndex, false); - } - - /** - * @param int|non-empty-list $possibleKind kind or array of kinds - * @param int $start optional offset - * @param null|int $end optional limit - * - * @return ($possibleKind is int ? array, Token> : array, Token>>) - */ - public function findGivenKind($possibleKind, int $start = 0, ?int $end = null): array - { - if (null === $end) { - $end = \count($this); - } - - $elements = []; - $possibleKinds = (array) $possibleKind; - - foreach ($possibleKinds as $kind) { - $elements[$kind] = []; - } - - $possibleKinds = array_filter($possibleKinds, fn ($kind): bool => $this->isTokenKindFound($kind)); - - if (\count($possibleKinds) > 0) { - for ($i = $start; $i < $end; ++$i) { - $token = $this[$i]; - if ($token->isGivenKind($possibleKinds)) { - $elements[$token->getId()][$i] = $token; - } - } - } - - return \is_array($possibleKind) ? $elements : $elements[$possibleKind]; - } - - public function generateCode(): string - { - $code = $this->generatePartialCode(0, \count($this) - 1); - $this->changeCodeHash(self::calculateCodeHash($code)); - - return $code; - } - - /** - * Generate code from tokens between given indices. - * - * @param int $start start index - * @param int $end end index - */ - public function generatePartialCode(int $start, int $end): string - { - $code = ''; - - for ($i = $start; $i <= $end; ++$i) { - $code .= $this[$i]->getContent(); - } - - return $code; - } - - /** - * Get hash of code. - */ - public function getCodeHash(): string - { - return $this->codeHash; - } - - /** - * Get index for closest next token which is non whitespace. - * - * This method is shorthand for getNonWhitespaceSibling method. - * - * @param int $index token index - * @param null|string $whitespaces whitespaces characters for Token::isWhitespace - */ - public function getNextNonWhitespace(int $index, ?string $whitespaces = null): ?int - { - return $this->getNonWhitespaceSibling($index, 1, $whitespaces); - } - - /** - * Get index for closest next token of given kind. - * - * This method is shorthand for getTokenOfKindSibling method. - * - * @param int $index token index - * @param list $tokens possible tokens - * @param bool $caseSensitive perform a case sensitive comparison - */ - public function getNextTokenOfKind(int $index, array $tokens = [], bool $caseSensitive = true): ?int - { - return $this->getTokenOfKindSibling($index, 1, $tokens, $caseSensitive); - } - - /** - * Get index for closest sibling token which is non whitespace. - * - * @param int $index token index - * @param -1|1 $direction - * @param null|string $whitespaces whitespaces characters for Token::isWhitespace - */ - public function getNonWhitespaceSibling(int $index, int $direction, ?string $whitespaces = null): ?int - { - while (true) { - $index += $direction; - if (!$this->offsetExists($index)) { - return null; - } - - if (!$this[$index]->isWhitespace($whitespaces)) { - return $index; - } - } - } - - /** - * Get index for closest previous token which is non whitespace. - * - * This method is shorthand for getNonWhitespaceSibling method. - * - * @param int $index token index - * @param null|string $whitespaces whitespaces characters for Token::isWhitespace - */ - public function getPrevNonWhitespace(int $index, ?string $whitespaces = null): ?int - { - return $this->getNonWhitespaceSibling($index, -1, $whitespaces); - } - - /** - * Get index for closest previous token of given kind. - * This method is shorthand for getTokenOfKindSibling method. - * - * @param int $index token index - * @param list $tokens possible tokens - * @param bool $caseSensitive perform a case sensitive comparison - */ - public function getPrevTokenOfKind(int $index, array $tokens = [], bool $caseSensitive = true): ?int - { - return $this->getTokenOfKindSibling($index, -1, $tokens, $caseSensitive); - } - - /** - * Get index for closest sibling token of given kind. - * - * @param int $index token index - * @param -1|1 $direction - * @param list $tokens possible tokens - * @param bool $caseSensitive perform a case sensitive comparison - */ - public function getTokenOfKindSibling(int $index, int $direction, array $tokens = [], bool $caseSensitive = true): ?int - { - $tokens = array_filter($tokens, fn ($token): bool => $this->isTokenKindFound($this->extractTokenKind($token))); - - if (0 === \count($tokens)) { - return null; - } - - while (true) { - $index += $direction; - if (!$this->offsetExists($index)) { - return null; - } - - if ($this[$index]->equalsAny($tokens, $caseSensitive)) { - return $index; - } - } - } - - /** - * Get index for closest sibling token not of given kind. - * - * @param int $index token index - * @param -1|1 $direction - * @param list $tokens possible tokens - */ - public function getTokenNotOfKindSibling(int $index, int $direction, array $tokens = []): ?int - { - return $this->getTokenNotOfKind( - $index, - $direction, - fn (int $a): bool => $this[$a]->equalsAny($tokens), - ); - } - - /** - * Get index for closest sibling token not of given kind. - * - * @param int $index token index - * @param -1|1 $direction - * @param list $kinds possible tokens kinds - */ - public function getTokenNotOfKindsSibling(int $index, int $direction, array $kinds = []): ?int - { - return $this->getTokenNotOfKind( - $index, - $direction, - fn (int $index): bool => $this[$index]->isGivenKind($kinds), - ); - } - - /** - * Get index for closest sibling token that is not a whitespace, comment or attribute. - * - * @param int $index token index - * @param -1|1 $direction - */ - public function getMeaningfulTokenSibling(int $index, int $direction): ?int - { - return $this->getTokenNotOfKindsSibling( - $index, - $direction, - [T_WHITESPACE, T_COMMENT, T_DOC_COMMENT] - ); - } - - /** - * Get index for closest sibling token which is not empty. - * - * @param int $index token index - * @param -1|1 $direction - */ - public function getNonEmptySibling(int $index, int $direction): ?int - { - while (true) { - $index += $direction; - if (!$this->offsetExists($index)) { - return null; - } - - if (!$this->isEmptyAt($index)) { - return $index; - } - } - } - - /** - * Get index for closest next token that is not a whitespace or comment. - * - * @param int $index token index - */ - public function getNextMeaningfulToken(int $index): ?int - { - return $this->getMeaningfulTokenSibling($index, 1); - } - - /** - * Get index for closest previous token that is not a whitespace or comment. - * - * @param int $index token index - */ - public function getPrevMeaningfulToken(int $index): ?int - { - return $this->getMeaningfulTokenSibling($index, -1); - } - - /** - * Find a sequence of meaningful tokens and returns the array of their locations. - * - * @param non-empty-list $sequence an array of token (kinds) - * @param int $start start index, defaulting to the start of the file - * @param null|int $end end index, defaulting to the end of the file - * @param array|bool $caseSensitive global case sensitiveness or a list of booleans, whose keys should match - * the ones used in $sequence. If any is missing, the default case-sensitive - * comparison is used - * - * @return null|non-empty-array, Token> an array containing the tokens matching the sequence elements, indexed by their position - */ - public function findSequence(array $sequence, int $start = 0, ?int $end = null, $caseSensitive = true): ?array - { - $sequenceCount = \count($sequence); - if (0 === $sequenceCount) { - throw new \InvalidArgumentException('Invalid sequence.'); - } - - // $end defaults to the end of the collection - $end = null === $end ? \count($this) - 1 : min($end, \count($this) - 1); - - if ($start + $sequenceCount - 1 > $end) { - return null; - } - - $nonMeaningFullKind = [T_COMMENT, T_DOC_COMMENT, T_WHITESPACE]; - - // make sure the sequence content is "meaningful" - foreach ($sequence as $key => $token) { - // if not a Token instance already, we convert it to verify the meaningfulness - if (!$token instanceof Token) { - if (\is_array($token) && !isset($token[1])) { - // fake some content as it is required by the Token constructor, - // although optional for search purposes - $token[1] = 'DUMMY'; - } - - $token = new Token($token); - } - - if ($token->isGivenKind($nonMeaningFullKind)) { - throw new \InvalidArgumentException(\sprintf('Non-meaningful token at position: "%s".', $key)); - } - - if ('' === $token->getContent()) { - throw new \InvalidArgumentException(\sprintf('Non-meaningful (empty) token at position: "%s".', $key)); - } - } - - foreach ($sequence as $token) { - if (!$this->isTokenKindFound($this->extractTokenKind($token))) { - return null; - } - } - - // remove the first token from the sequence, so we can freely iterate through the sequence after a match to - // the first one is found - $firstKey = array_key_first($sequence); - $firstCs = self::isKeyCaseSensitive($caseSensitive, $firstKey); - $firstToken = $sequence[$firstKey]; - unset($sequence[$firstKey]); - - // begin searching for the first token in the sequence (start included) - $index = $start - 1; - while ($index <= $end) { - $index = $this->getNextTokenOfKind($index, [$firstToken], $firstCs); - - // ensure we found a match and didn't get past the end index - if (null === $index || $index > $end) { - return null; - } - - // initialise the result array with the current index - $result = [$index => $this[$index]]; - - // advance cursor to the current position - $currIdx = $index; - - // iterate through the remaining tokens in the sequence - foreach ($sequence as $key => $token) { - $currIdx = $this->getNextMeaningfulToken($currIdx); - - // ensure we didn't go too far - if (null === $currIdx || $currIdx > $end) { - return null; - } - - if (!$this[$currIdx]->equals($token, self::isKeyCaseSensitive($caseSensitive, $key))) { - // not a match, restart the outer loop - continue 2; - } - - // append index to the result array - $result[$currIdx] = $this[$currIdx]; - } - - // do we have a complete match? - // hint: $result is bigger than $sequence since the first token has been removed from the latter - if (\count($sequence) < \count($result)) { - return $result; - } - } - - return null; - } - - /** - * Insert instances of Token inside collection. - * - * @param int $index start inserting index - * @param list|Token|Tokens $items instances of Token to insert - */ - public function insertAt(int $index, $items): void - { - $this->insertSlices([$index => $items]); - } - - /** - * Insert a slices or individual Tokens into multiple places in a single run. - * - * This approach is kind-of an experiment - it's proven to improve performance a lot for big files that needs plenty of new tickets to be inserted, - * like edge case example of 3.7h vs 4s (https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/3996#issuecomment-455617637), - * yet at same time changing a logic of fixers in not-always easy way. - * - * To be discussed: - * - should we always aim to use this method? - * - should we deprecate `insertAt` method ? - * - * The `$slices` parameter is an assoc array, in which: - * - index: starting point for inserting of individual slice, with indices being relatives to original array collection before any Token inserted - * - value under index: a slice of Tokens to be inserted - * - * @internal - * - * @param array|Token|Tokens> $slices - */ - public function insertSlices(array $slices): void - { - $itemsCount = 0; - - foreach ($slices as $slice) { - $itemsCount += \is_array($slice) || $slice instanceof self ? \count($slice) : 1; - } - - if (0 === $itemsCount) { - return; - } - - $oldSize = \count($this); - $this->changed = true; - $this->namespaceDeclarations = null; - $this->blockStartCache = []; - $this->blockEndCache = []; - $this->updateSize($oldSize + $itemsCount); - - krsort($slices); - $farthestSliceIndex = array_key_first($slices); - - // We check only the farthest index, if it's within the size of collection, other indices will be valid too. - if (!\is_int($farthestSliceIndex) || $farthestSliceIndex > $oldSize) { - throw new \OutOfBoundsException(\sprintf('Cannot insert index "%s" outside of collection.', $farthestSliceIndex)); - } - - $previousSliceIndex = $oldSize; - - // since we only move already existing items around, we directly call into SplFixedArray::offset* methods. - // that way we get around additional overhead this class adds with overridden offset* methods. - foreach ($slices as $index => $slice) { - if (!\is_int($index) || $index < 0) { - throw new \OutOfBoundsException(\sprintf('Invalid index "%s".', $index)); - } - - $slice = \is_array($slice) || $slice instanceof self ? $slice : [$slice]; - $sliceCount = \count($slice); - - for ($i = $previousSliceIndex - 1; $i >= $index; --$i) { - parent::offsetSet($i + $itemsCount, $this[$i]); - } - - $previousSliceIndex = $index; - $itemsCount -= $sliceCount; - - foreach ($slice as $indexItem => $item) { - if ('' === $item->getContent()) { - throw new \InvalidArgumentException('Must not add empty token to collection.'); - } - - $this->registerFoundToken($item); - - parent::offsetSet($index + $itemsCount + $indexItem, $item); - } - } - } - - /** - * Check if collection was change: collection itself (like insert new tokens) or any of collection's elements. - */ - public function isChanged(): bool - { - return $this->changed; - } - - public function isEmptyAt(int $index): bool - { - $token = $this[$index]; - - return null === $token->getId() && '' === $token->getContent(); - } - - public function clearAt(int $index): void - { - $this[$index] = new Token(''); - } - - /** - * Override tokens at given range. - * - * @param int $indexStart start overriding index - * @param int $indexEnd end overriding index - * @param array|Tokens $items tokens to insert - */ - public function overrideRange(int $indexStart, int $indexEnd, iterable $items): void - { - $indexToChange = $indexEnd - $indexStart + 1; - $itemsCount = \count($items); - - // If we want to add more items than passed range contains we need to - // add placeholders for overhead items. - if ($itemsCount > $indexToChange) { - $placeholders = []; - - while ($itemsCount > $indexToChange) { - $placeholders[] = new Token('__PLACEHOLDER__'); - ++$indexToChange; - } - - $this->insertAt($indexEnd + 1, $placeholders); - } - - // Override each items. - foreach ($items as $itemIndex => $item) { - $this[$indexStart + $itemIndex] = $item; - } - - // If we want to add fewer tokens than passed range contains then clear - // not needed tokens. - if ($itemsCount < $indexToChange) { - $this->clearRange($indexStart + $itemsCount, $indexEnd); - } - } - - /** - * @param null|string $whitespaces optional whitespaces characters for Token::isWhitespace - */ - public function removeLeadingWhitespace(int $index, ?string $whitespaces = null): void - { - $this->removeWhitespaceSafely($index, -1, $whitespaces); - } - - /** - * @param null|string $whitespaces optional whitespaces characters for Token::isWhitespace - */ - public function removeTrailingWhitespace(int $index, ?string $whitespaces = null): void - { - $this->removeWhitespaceSafely($index, 1, $whitespaces); - } - - /** - * Set code. Clear all current content and replace it by new Token items generated from code directly. - * - * @param string $code PHP code - */ - public function setCode(string $code): void - { - // No need to work when the code is the same. - // That is how we avoid a lot of work and setting changed flag. - if ($code === $this->generateCode()) { - return; - } - - // clear memory - $this->updateSize(0); - $this->blockStartCache = []; - $this->blockEndCache = []; - - $tokens = token_get_all($code, TOKEN_PARSE); - - $this->updateSize(\count($tokens)); - - foreach ($tokens as $index => $token) { - $this[$index] = new Token($token); - } - - $this->applyTransformers(); - - if (\PHP_VERSION_ID < 8_00_00) { - $this->rewind(); - } - - $this->changeCodeHash(self::calculateCodeHash($code)); - $this->changed = true; - $this->namespaceDeclarations = null; - } - - public function toJson(): string - { - $output = new \SplFixedArray(\count($this)); - - foreach ($this as $index => $token) { - $output[$index] = $token->toArray(); - } - - if (\PHP_VERSION_ID < 8_00_00) { - $this->rewind(); - } - - return json_encode($output, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK); - } - - /** - * Check if all token kinds given as argument are found. - * - * @param list $tokenKinds - */ - public function isAllTokenKindsFound(array $tokenKinds): bool - { - foreach ($tokenKinds as $tokenKind) { - if (0 === ($this->foundTokenKinds[$tokenKind] ?? 0)) { - return false; - } - } - - return true; - } - - /** - * Check if any token kind given as argument is found. - * - * @param list $tokenKinds - */ - public function isAnyTokenKindsFound(array $tokenKinds): bool - { - foreach ($tokenKinds as $tokenKind) { - if (0 !== ($this->foundTokenKinds[$tokenKind] ?? 0)) { - return true; - } - } - - return false; - } - - /** - * Check if token kind given as argument is found. - * - * @param int|string $tokenKind - */ - public function isTokenKindFound($tokenKind): bool - { - return 0 !== ($this->foundTokenKinds[$tokenKind] ?? 0); - } - - /** - * @param int|string $tokenKind - */ - public function countTokenKind($tokenKind): int - { - return $this->foundTokenKinds[$tokenKind] ?? 0; - } - - /** - * Clear tokens in the given range. - */ - public function clearRange(int $indexStart, int $indexEnd): void - { - for ($i = $indexStart; $i <= $indexEnd; ++$i) { - $this->clearAt($i); - } - } - - /** - * Checks for monolithic PHP code. - * - * Checks that the code is pure PHP code, in a single code block, starting - * with an open tag. - */ - public function isMonolithicPhp(): bool - { - if (1 !== ($this->countTokenKind(T_OPEN_TAG) + $this->countTokenKind(T_OPEN_TAG_WITH_ECHO))) { - return false; - } - - return 0 === $this->countTokenKind(T_INLINE_HTML) - || (1 === $this->countTokenKind(T_INLINE_HTML) && Preg::match('/^#!.+$/', $this[0]->getContent())); - } - - /** - * @param int $start start index - * @param int $end end index - */ - public function isPartialCodeMultiline(int $start, int $end): bool - { - for ($i = $start; $i <= $end; ++$i) { - if (str_contains($this[$i]->getContent(), "\n")) { - return true; - } - } - - return false; - } - - public function hasAlternativeSyntax(): bool - { - return $this->isAnyTokenKindsFound([ - T_ENDDECLARE, - T_ENDFOR, - T_ENDFOREACH, - T_ENDIF, - T_ENDSWITCH, - T_ENDWHILE, - ]); - } - - public function clearTokenAndMergeSurroundingWhitespace(int $index): void - { - $count = \count($this); - $this->clearAt($index); - - if ($index === $count - 1) { - return; - } - - $nextIndex = $this->getNonEmptySibling($index, 1); - - if (null === $nextIndex || !$this[$nextIndex]->isWhitespace()) { - return; - } - - $prevIndex = $this->getNonEmptySibling($index, -1); - - if ($this[$prevIndex]->isWhitespace()) { - $this[$prevIndex] = new Token([T_WHITESPACE, $this[$prevIndex]->getContent().$this[$nextIndex]->getContent()]); - } elseif ($this->isEmptyAt($prevIndex + 1)) { - $this[$prevIndex + 1] = new Token([T_WHITESPACE, $this[$nextIndex]->getContent()]); - } - - $this->clearAt($nextIndex); - } - - /** - * @internal This is performance-related workaround for lack of proper DI, may be removed at some point - * - * @return list - */ - public function getNamespaceDeclarations(): array - { - if (null === $this->namespaceDeclarations) { - $this->namespaceDeclarations = (new NamespacesAnalyzer())->getDeclarations($this); - } - - return $this->namespaceDeclarations; - } - - /** - * @internal - */ - protected function applyTransformers(): void - { - $transformers = Transformers::createSingleton(); - $transformers->transform($this); - } - - private function updateSize(int $size): void - { - if (\count($this) !== $size) { - $this->changed = true; - $this->namespaceDeclarations = null; - - parent::setSize($size); - } - } - - /** - * @param -1|1 $direction - */ - private function removeWhitespaceSafely(int $index, int $direction, ?string $whitespaces = null): void - { - $whitespaceIndex = $this->getNonEmptySibling($index, $direction); - if (isset($this[$whitespaceIndex]) && $this[$whitespaceIndex]->isWhitespace()) { - $newContent = ''; - $tokenToCheck = $this[$whitespaceIndex]; - - // if the token candidate to remove is preceded by single line comment we do not consider the new line after this comment as part of T_WHITESPACE - if (isset($this[$whitespaceIndex - 1]) && $this[$whitespaceIndex - 1]->isComment() && !str_starts_with($this[$whitespaceIndex - 1]->getContent(), '/*')) { - [, $newContent, $whitespacesToCheck] = Preg::split('/^(\R)/', $this[$whitespaceIndex]->getContent(), -1, PREG_SPLIT_DELIM_CAPTURE); - - if ('' === $whitespacesToCheck) { - return; - } - - $tokenToCheck = new Token([T_WHITESPACE, $whitespacesToCheck]); - } - - if (!$tokenToCheck->isWhitespace($whitespaces)) { - return; - } - - if ('' === $newContent) { - $this->clearAt($whitespaceIndex); - } else { - $this[$whitespaceIndex] = new Token([T_WHITESPACE, $newContent]); - } - } - } - - /** - * @param self::BLOCK_TYPE_* $type type of block - * @param int $searchIndex index of starting brace - * @param bool $findEnd if method should find block's end or start - * - * @return int<0, max> index of opposite brace - */ - private function findOppositeBlockEdge(int $type, int $searchIndex, bool $findEnd): int - { - $blockEdgeDefinitions = self::getBlockEdgeDefinitions(); - - if (!isset($blockEdgeDefinitions[$type])) { - throw new \InvalidArgumentException(\sprintf('Invalid param type: "%s".', $type)); - } - - if ($findEnd && isset($this->blockStartCache[$searchIndex])) { - return $this->blockStartCache[$searchIndex]; - } - - if (!$findEnd && isset($this->blockEndCache[$searchIndex])) { - return $this->blockEndCache[$searchIndex]; - } - - $startEdge = $blockEdgeDefinitions[$type]['start']; - $endEdge = $blockEdgeDefinitions[$type]['end']; - $startIndex = $searchIndex; - $endIndex = \count($this) - 1; - $indexOffset = 1; - - if (!$findEnd) { - [$startEdge, $endEdge] = [$endEdge, $startEdge]; - $indexOffset = -1; - $endIndex = 0; - } - - if (!$this[$startIndex]->equals($startEdge)) { - throw new \InvalidArgumentException(\sprintf('Invalid param $startIndex - not a proper block "%s".', $findEnd ? 'start' : 'end')); - } - - $blockLevel = 0; - - for ($index = $startIndex; $index !== $endIndex; $index += $indexOffset) { - $token = $this[$index]; - - if ($token->equals($startEdge)) { - ++$blockLevel; - - continue; - } - - if ($token->equals($endEdge)) { - --$blockLevel; - - if (0 === $blockLevel) { - break; - } - } - } - - if (!$this[$index]->equals($endEdge)) { - throw new \UnexpectedValueException(\sprintf('Missing block "%s".', $findEnd ? 'end' : 'start')); - } - - if ($startIndex < $index) { - $this->blockStartCache[$startIndex] = $index; - $this->blockEndCache[$index] = $startIndex; - } else { - $this->blockStartCache[$index] = $startIndex; - $this->blockEndCache[$startIndex] = $index; - } - - return $index; - } - - /** - * Calculate hash for code. - * - * @return non-empty-string - */ - private static function calculateCodeHash(string $code): string - { - return CodeHasher::calculateCodeHash($code); - } - - /** - * Get cache value for given key. - * - * @param non-empty-string $key item key - */ - private static function getCache(string $key): self - { - if (!self::hasCache($key)) { - throw new \OutOfBoundsException(\sprintf('Unknown cache key: "%s".', $key)); - } - - return self::$cache[$key]; - } - - /** - * Check if given key exists in cache. - * - * @param non-empty-string $key item key - */ - private static function hasCache(string $key): bool - { - return isset(self::$cache[$key]); - } - - /** - * @param non-empty-string $key item key - * @param Tokens $value item value - */ - private static function setCache(string $key, self $value): void - { - self::$cache[$key] = $value; - } - - /** - * Change code hash. - * - * Remove old cache and set new one. - * - * @param non-empty-string $codeHash new code hash - */ - private function changeCodeHash(string $codeHash): void - { - if (null !== $this->codeHash) { - self::clearCache($this->codeHash); - } - - $this->codeHash = $codeHash; - self::setCache($this->codeHash, $this); - } - - /** - * Register token as found. - */ - private function registerFoundToken(Token $token): void - { - // inlined extractTokenKind() call on the hot path - $tokenKind = $token->isArray() ? $token->getId() : $token->getContent(); - - $this->foundTokenKinds[$tokenKind] ??= 0; - ++$this->foundTokenKinds[$tokenKind]; - } - - /** - * Unregister token as not found. - */ - private function unregisterFoundToken(Token $token): void - { - // inlined extractTokenKind() call on the hot path - $tokenKind = $token->isArray() ? $token->getId() : $token->getContent(); - - \assert(($this->foundTokenKinds[$tokenKind] ?? 0) > 0); - --$this->foundTokenKinds[$tokenKind]; - } - - /** - * @param array{int}|string|Token $token token prototype - * - * @return int|string - */ - private function extractTokenKind($token) - { - return $token instanceof Token - ? ($token->isArray() ? $token->getId() : $token->getContent()) - : (\is_array($token) ? $token[0] : $token); - } - - /** - * @param int $index token index - * @param -1|1 $direction - * @param callable(int): bool $filter - */ - private function getTokenNotOfKind(int $index, int $direction, callable $filter): ?int - { - while (true) { - $index += $direction; - if (!$this->offsetExists($index)) { - return null; - } - - if ($this->isEmptyAt($index) || $filter($index)) { - continue; - } - - return $index; - } - } - - /** - * A helper method used to find out whether a certain input token has to be case-sensitively matched. - * - * @param array|bool $caseSensitive global case sensitiveness or an array of booleans, whose keys should match - * the ones used in $sequence. If any is missing, the default case-sensitive - * comparison is used - * @param int $key the key of the token that has to be looked up - */ - private static function isKeyCaseSensitive($caseSensitive, int $key): bool - { - if (\is_array($caseSensitive)) { - return $caseSensitive[$key] ?? true; - } - - return $caseSensitive; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TokensAnalyzer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TokensAnalyzer.php deleted file mode 100644 index 63048f98..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TokensAnalyzer.php +++ /dev/null @@ -1,888 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer; - -use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer; -use PhpCsFixer\Tokenizer\Analyzer\GotoLabelAnalyzer; - -/** - * Analyzer of Tokens collection. - * - * Its role is to provide the ability to analyze collection. - * - * @author Dariusz Rumiński - * @author Gregor Harlan - * - * @internal - * - * @phpstan-type _ClassyElementType 'case'|'const'|'method'|'property'|'trait_import' - */ -final class TokensAnalyzer -{ - /** - * Tokens collection instance. - */ - private Tokens $tokens; - - /** - * @readonly - */ - private GotoLabelAnalyzer $gotoLabelAnalyzer; - - public function __construct(Tokens $tokens) - { - $this->tokens = $tokens; - $this->gotoLabelAnalyzer = new GotoLabelAnalyzer(); - } - - /** - * Get indices of methods and properties in classy code (classes, interfaces and traits). - * - * @return array - */ - public function getClassyElements(): array - { - $elements = []; - - for ($index = 1, $count = \count($this->tokens) - 2; $index < $count; ++$index) { - if ($this->tokens[$index]->isClassy()) { - [$index, $newElements] = $this->findClassyElements($index, $index); - $elements += $newElements; - } - } - - ksort($elements); - - return $elements; - } - - /** - * Get indices of modifiers of a classy code (classes, interfaces and traits). - * - * @return array{ - * final: int|null, - * abstract: int|null, - * readonly: int|null - * } - */ - public function getClassyModifiers(int $index): array - { - if (!$this->tokens[$index]->isClassy()) { - throw new \InvalidArgumentException(\sprintf('Not an "classy" at given index %d.', $index)); - } - - $readOnlyPossible = \defined('T_READONLY'); // @TODO: drop condition when PHP 8.2+ is required - $modifiers = ['final' => null, 'abstract' => null, 'readonly' => null]; - - while (true) { - $index = $this->tokens->getPrevMeaningfulToken($index); - - if ($this->tokens[$index]->isGivenKind(T_FINAL)) { - $modifiers['final'] = $index; - } elseif ($this->tokens[$index]->isGivenKind(T_ABSTRACT)) { - $modifiers['abstract'] = $index; - } elseif ($readOnlyPossible && $this->tokens[$index]->isGivenKind(T_READONLY)) { - $modifiers['readonly'] = $index; - } else { // no need to skip attributes as it is not possible on PHP8.2 - break; - } - } - - return $modifiers; - } - - /** - * Get indices of namespace uses. - * - * @param bool $perNamespace Return namespace uses per namespace - * - * @return ($perNamespace is true ? array> : list) - */ - public function getImportUseIndexes(bool $perNamespace = false): array - { - $tokens = $this->tokens; - - $uses = []; - $namespaceIndex = 0; - - for ($index = 0, $limit = $tokens->count(); $index < $limit; ++$index) { - $token = $tokens[$index]; - - if ($token->isGivenKind(T_NAMESPACE)) { - $nextTokenIndex = $tokens->getNextTokenOfKind($index, [';', '{']); - $nextToken = $tokens[$nextTokenIndex]; - - if ($nextToken->equals('{')) { - $index = $nextTokenIndex; - } - - if ($perNamespace) { - ++$namespaceIndex; - } - - continue; - } - - if ($token->isGivenKind(T_USE)) { - $uses[$namespaceIndex][] = $index; - } - } - - if (!$perNamespace && isset($uses[$namespaceIndex])) { - return $uses[$namespaceIndex]; - } - - return $uses; - } - - /** - * Check if there is an array at given index. - */ - public function isArray(int $index): bool - { - return $this->tokens[$index]->isGivenKind([T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN]); - } - - /** - * Check if the array at index is multiline. - * - * This only checks the root-level of the array. - */ - public function isArrayMultiLine(int $index): bool - { - if (!$this->isArray($index)) { - throw new \InvalidArgumentException(\sprintf('Not an array at given index %d.', $index)); - } - - $tokens = $this->tokens; - - // Skip only when it's an array, for short arrays we need the brace for correct - // level counting - if ($tokens[$index]->isGivenKind(T_ARRAY)) { - $index = $tokens->getNextMeaningfulToken($index); - } - - return $this->isBlockMultiline($tokens, $index); - } - - public function isBlockMultiline(Tokens $tokens, int $index): bool - { - $blockType = Tokens::detectBlockType($tokens[$index]); - - if (null === $blockType || !$blockType['isStart']) { - throw new \InvalidArgumentException(\sprintf('Not an block start at given index %d.', $index)); - } - - $endIndex = $tokens->findBlockEnd($blockType['type'], $index); - - for (++$index; $index < $endIndex; ++$index) { - $token = $tokens[$index]; - $blockType = Tokens::detectBlockType($token); - - if (null !== $blockType && $blockType['isStart']) { - $index = $tokens->findBlockEnd($blockType['type'], $index); - - continue; - } - - if ( - $token->isWhitespace() - && !$tokens[$index - 1]->isGivenKind(T_END_HEREDOC) - && str_contains($token->getContent(), "\n") - ) { - return true; - } - } - - return false; - } - - /** - * @param int $index Index of the T_FUNCTION token - * - * @return array{visibility: null|T_PRIVATE|T_PROTECTED|T_PUBLIC, static: bool, abstract: bool, final: bool} - */ - public function getMethodAttributes(int $index): array - { - if (!$this->tokens[$index]->isGivenKind(T_FUNCTION)) { - throw new \LogicException(\sprintf('No T_FUNCTION at given index %d, got "%s".', $index, $this->tokens[$index]->getName())); - } - - $attributes = [ - 'visibility' => null, - 'static' => false, - 'abstract' => false, - 'final' => false, - ]; - - for ($i = $index; $i >= 0; --$i) { - $i = $this->tokens->getPrevMeaningfulToken($i); - $token = $this->tokens[$i]; - - if ($token->isGivenKind(T_STATIC)) { - $attributes['static'] = true; - - continue; - } - - if ($token->isGivenKind(T_FINAL)) { - $attributes['final'] = true; - - continue; - } - - if ($token->isGivenKind(T_ABSTRACT)) { - $attributes['abstract'] = true; - - continue; - } - - // visibility - - if ($token->isGivenKind(T_PRIVATE)) { - $attributes['visibility'] = T_PRIVATE; - - continue; - } - - if ($token->isGivenKind(T_PROTECTED)) { - $attributes['visibility'] = T_PROTECTED; - - continue; - } - - if ($token->isGivenKind(T_PUBLIC)) { - $attributes['visibility'] = T_PUBLIC; - - continue; - } - - // found a meaningful token that is not part of - // the function signature; stop looking - break; - } - - return $attributes; - } - - /** - * Check if there is an anonymous class under given index. - */ - public function isAnonymousClass(int $index): bool - { - if (!$this->tokens[$index]->isClassy()) { - throw new \LogicException(\sprintf('No classy token at given index %d.', $index)); - } - - if (!$this->tokens[$index]->isGivenKind(T_CLASS)) { - return false; - } - - $index = $this->tokens->getPrevMeaningfulToken($index); - - if (\defined('T_READONLY') && $this->tokens[$index]->isGivenKind(T_READONLY)) { // @TODO: drop condition when PHP 8.1+ is required - $index = $this->tokens->getPrevMeaningfulToken($index); - } - - while ($this->tokens[$index]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) { - $index = $this->tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $index); - $index = $this->tokens->getPrevMeaningfulToken($index); - } - - return $this->tokens[$index]->isGivenKind(T_NEW); - } - - /** - * Check if the function under given index is a lambda. - */ - public function isLambda(int $index): bool - { - if (!$this->tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) { - throw new \LogicException(\sprintf('No T_FUNCTION or T_FN at given index %d, got "%s".', $index, $this->tokens[$index]->getName())); - } - - $startParenthesisIndex = $this->tokens->getNextMeaningfulToken($index); - $startParenthesisToken = $this->tokens[$startParenthesisIndex]; - - // skip & for `function & () {}` syntax - if ($startParenthesisToken->isGivenKind(CT::T_RETURN_REF)) { - $startParenthesisIndex = $this->tokens->getNextMeaningfulToken($startParenthesisIndex); - $startParenthesisToken = $this->tokens[$startParenthesisIndex]; - } - - return $startParenthesisToken->equals('('); - } - - public function getLastTokenIndexOfArrowFunction(int $index): int - { - if (!$this->tokens[$index]->isGivenKind(T_FN)) { - throw new \InvalidArgumentException(\sprintf('Not an "arrow function" at given index %d.', $index)); - } - - $stopTokens = [')', ']', ',', ';', [T_CLOSE_TAG]]; - $index = $this->tokens->getNextTokenOfKind($index, [[T_DOUBLE_ARROW]]); - - while (true) { - $index = $this->tokens->getNextMeaningfulToken($index); - - if ($this->tokens[$index]->equalsAny($stopTokens)) { - break; - } - - $blockType = Tokens::detectBlockType($this->tokens[$index]); - - if (null === $blockType) { - continue; - } - - if ($blockType['isStart']) { - $index = $this->tokens->findBlockEnd($blockType['type'], $index); - - continue; - } - - break; - } - - return $this->tokens->getPrevMeaningfulToken($index); - } - - /** - * Check if the T_STRING under given index is a constant invocation. - */ - public function isConstantInvocation(int $index): bool - { - if (!$this->tokens[$index]->isGivenKind(T_STRING)) { - throw new \LogicException(\sprintf('No T_STRING at given index %d, got "%s".', $index, $this->tokens[$index]->getName())); - } - - $nextIndex = $this->tokens->getNextMeaningfulToken($index); - - if ( - $this->tokens[$nextIndex]->equalsAny(['(', '{']) - || $this->tokens[$nextIndex]->isGivenKind([T_DOUBLE_COLON, T_ELLIPSIS, T_NS_SEPARATOR, CT::T_RETURN_REF, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, T_VARIABLE]) - ) { - return false; - } - - // handle foreach( FOO as $_ ) {} - if ($this->tokens[$nextIndex]->isGivenKind(T_AS)) { - $prevIndex = $this->tokens->getPrevMeaningfulToken($index); - - if (!$this->tokens[$prevIndex]->equals('(')) { - return false; - } - } - - $prevIndex = $this->tokens->getPrevMeaningfulToken($index); - - if ($this->tokens[$prevIndex]->isGivenKind(Token::getClassyTokenKinds())) { - return false; - } - - if ($this->tokens[$prevIndex]->isGivenKind([T_AS, T_CONST, T_DOUBLE_COLON, T_FUNCTION, T_GOTO, CT::T_GROUP_IMPORT_BRACE_OPEN, CT::T_TYPE_COLON, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION]) || $this->tokens[$prevIndex]->isObjectOperator()) { - return false; - } - - if ( - $this->tokens[$prevIndex]->isGivenKind(T_CASE) - && \defined('T_ENUM') - && $this->tokens->isAllTokenKindsFound([T_ENUM]) - ) { - $enumSwitchIndex = $this->tokens->getPrevTokenOfKind($index, [[T_SWITCH], [T_ENUM]]); - - if (!$this->tokens[$enumSwitchIndex]->isGivenKind(T_SWITCH)) { - return false; - } - } - - while ($this->tokens[$prevIndex]->isGivenKind([CT::T_NAMESPACE_OPERATOR, T_NS_SEPARATOR, T_STRING, CT::T_ARRAY_TYPEHINT])) { - $prevIndex = $this->tokens->getPrevMeaningfulToken($prevIndex); - } - - if ($this->tokens[$prevIndex]->isGivenKind([CT::T_CONST_IMPORT, T_EXTENDS, CT::T_FUNCTION_IMPORT, T_IMPLEMENTS, T_INSTANCEOF, T_INSTEADOF, T_NAMESPACE, T_NEW, CT::T_NULLABLE_TYPE, CT::T_TYPE_COLON, T_USE, CT::T_USE_TRAIT, CT::T_TYPE_INTERSECTION, CT::T_TYPE_ALTERNATION, T_CONST, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE])) { - return false; - } - - // `FOO & $bar` could be: - // - function reference parameter: function baz(Foo & $bar) {} - // - bit operator: $x = FOO & $bar; - if ($this->tokens[$nextIndex]->equals('&') && $this->tokens[$this->tokens->getNextMeaningfulToken($nextIndex)]->isGivenKind(T_VARIABLE)) { - $checkIndex = $this->tokens->getPrevTokenOfKind($prevIndex, [';', '{', '}', [T_FUNCTION], [T_OPEN_TAG], [T_OPEN_TAG_WITH_ECHO]]); - - if ($this->tokens[$checkIndex]->isGivenKind(T_FUNCTION)) { - return false; - } - } - - // check for `extends`/`implements`/`use` list - if ($this->tokens[$prevIndex]->equals(',')) { - $checkIndex = $prevIndex; - - while ($this->tokens[$checkIndex]->equalsAny([',', [T_AS], [CT::T_NAMESPACE_OPERATOR], [T_NS_SEPARATOR], [T_STRING]])) { - $checkIndex = $this->tokens->getPrevMeaningfulToken($checkIndex); - } - - if ($this->tokens[$checkIndex]->isGivenKind([T_EXTENDS, CT::T_GROUP_IMPORT_BRACE_OPEN, T_IMPLEMENTS, T_USE, CT::T_USE_TRAIT])) { - return false; - } - } - - // check for array in double quoted string: `"..$foo[bar].."` - if ($this->tokens[$prevIndex]->equals('[') && $this->tokens[$nextIndex]->equals(']')) { - $checkToken = $this->tokens[$this->tokens->getNextMeaningfulToken($nextIndex)]; - - if ($checkToken->equals('"') || $checkToken->isGivenKind([T_CURLY_OPEN, T_DOLLAR_OPEN_CURLY_BRACES, T_ENCAPSED_AND_WHITESPACE, T_VARIABLE])) { - return false; - } - } - - // check for attribute: `#[Foo]` - if (AttributeAnalyzer::isAttribute($this->tokens, $index)) { - return false; - } - - // check for goto label - if ($this->tokens[$nextIndex]->equals(':')) { - if ($this->gotoLabelAnalyzer->belongsToGoToLabel($this->tokens, $nextIndex)) { - return false; - } - } - - // check for non-capturing catches - - while ($this->tokens[$prevIndex]->isGivenKind([CT::T_NAMESPACE_OPERATOR, T_NS_SEPARATOR, T_STRING, CT::T_TYPE_ALTERNATION])) { - $prevIndex = $this->tokens->getPrevMeaningfulToken($prevIndex); - } - - if ($this->tokens[$prevIndex]->equals('(')) { - $prevPrevIndex = $this->tokens->getPrevMeaningfulToken($prevIndex); - - if ($this->tokens[$prevPrevIndex]->isGivenKind(T_CATCH)) { - return false; - } - } - - return true; - } - - /** - * Checks if there is a unary successor operator under given index. - */ - public function isUnarySuccessorOperator(int $index): bool - { - static $allowedPrevToken = [ - ']', - [T_STRING], - [T_VARIABLE], - [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], - [CT::T_DYNAMIC_PROP_BRACE_CLOSE], - [CT::T_DYNAMIC_VAR_BRACE_CLOSE], - ]; - - $tokens = $this->tokens; - $token = $tokens[$index]; - - if (!$token->isGivenKind([T_INC, T_DEC])) { - return false; - } - - $prevToken = $tokens[$tokens->getPrevMeaningfulToken($index)]; - - return $prevToken->equalsAny($allowedPrevToken); - } - - /** - * Checks if there is a unary predecessor operator under given index. - */ - public function isUnaryPredecessorOperator(int $index): bool - { - static $potentialSuccessorOperator = [T_INC, T_DEC]; - - static $potentialBinaryOperator = ['+', '-', '&', [CT::T_RETURN_REF]]; - - static $otherOperators; - - if (null === $otherOperators) { - $otherOperators = ['!', '~', '@', [T_ELLIPSIS]]; - } - - static $disallowedPrevTokens; - - if (null === $disallowedPrevTokens) { - $disallowedPrevTokens = [ - ']', - '}', - ')', - '"', - '`', - [CT::T_ARRAY_SQUARE_BRACE_CLOSE], - [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], - [CT::T_DYNAMIC_PROP_BRACE_CLOSE], - [CT::T_DYNAMIC_VAR_BRACE_CLOSE], - [T_CLASS_C], - [T_CONSTANT_ENCAPSED_STRING], - [T_DEC], - [T_DIR], - [T_DNUMBER], - [T_FILE], - [T_FUNC_C], - [T_INC], - [T_LINE], - [T_LNUMBER], - [T_METHOD_C], - [T_NS_C], - [T_STRING], - [T_TRAIT_C], - [T_VARIABLE], - ]; - } - - $tokens = $this->tokens; - $token = $tokens[$index]; - - if ($token->isGivenKind($potentialSuccessorOperator)) { - return !$this->isUnarySuccessorOperator($index); - } - - if ($token->equalsAny($otherOperators)) { - return true; - } - - if (!$token->equalsAny($potentialBinaryOperator)) { - return false; - } - - $prevToken = $tokens[$tokens->getPrevMeaningfulToken($index)]; - - if (!$prevToken->equalsAny($disallowedPrevTokens)) { - return true; - } - - if (!$token->equals('&') || !$prevToken->isGivenKind(T_STRING)) { - return false; - } - - static $searchTokens = [ - ';', - '{', - '}', - [T_DOUBLE_ARROW], - [T_FN], - [T_FUNCTION], - [T_OPEN_TAG], - [T_OPEN_TAG_WITH_ECHO], - ]; - $prevToken = $tokens[$tokens->getPrevTokenOfKind($index, $searchTokens)]; - - return $prevToken->isGivenKind([T_FN, T_FUNCTION]); - } - - /** - * Checks if there is a binary operator under given index. - */ - public function isBinaryOperator(int $index): bool - { - static $nonArrayOperators = [ - '=' => true, - '*' => true, - '/' => true, - '%' => true, - '<' => true, - '>' => true, - '|' => true, - '^' => true, - '.' => true, - ]; - - static $potentialUnaryNonArrayOperators = [ - '+' => true, - '-' => true, - '&' => true, - ]; - - static $arrayOperators; - - if (null === $arrayOperators) { - $arrayOperators = [ - T_AND_EQUAL => true, // &= - T_BOOLEAN_AND => true, // && - T_BOOLEAN_OR => true, // || - T_CONCAT_EQUAL => true, // .= - T_DIV_EQUAL => true, // /= - T_DOUBLE_ARROW => true, // => - T_IS_EQUAL => true, // == - T_IS_GREATER_OR_EQUAL => true, // >= - T_IS_IDENTICAL => true, // === - T_IS_NOT_EQUAL => true, // !=, <> - T_IS_NOT_IDENTICAL => true, // !== - T_IS_SMALLER_OR_EQUAL => true, // <= - T_LOGICAL_AND => true, // and - T_LOGICAL_OR => true, // or - T_LOGICAL_XOR => true, // xor - T_MINUS_EQUAL => true, // -= - T_MOD_EQUAL => true, // %= - T_MUL_EQUAL => true, // *= - T_OR_EQUAL => true, // |= - T_PLUS_EQUAL => true, // += - T_POW => true, // ** - T_POW_EQUAL => true, // **= - T_SL => true, // << - T_SL_EQUAL => true, // <<= - T_SR => true, // >> - T_SR_EQUAL => true, // >>= - T_XOR_EQUAL => true, // ^= - T_SPACESHIP => true, // <=> - T_COALESCE => true, // ?? - T_COALESCE_EQUAL => true, // ??= - ]; - } - - $tokens = $this->tokens; - $token = $tokens[$index]; - - if ($token->isGivenKind([T_INLINE_HTML, T_ENCAPSED_AND_WHITESPACE, CT::T_TYPE_INTERSECTION])) { - return false; - } - - if (isset($potentialUnaryNonArrayOperators[$token->getContent()])) { - return !$this->isUnaryPredecessorOperator($index); - } - - if ($token->isArray()) { - return isset($arrayOperators[$token->getId()]); - } - - if (isset($nonArrayOperators[$token->getContent()])) { - return true; - } - - return false; - } - - /** - * Check if `T_WHILE` token at given index is `do { ... } while ();` syntax - * and not `while () { ...}`. - */ - public function isWhilePartOfDoWhile(int $index): bool - { - $tokens = $this->tokens; - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_WHILE)) { - throw new \LogicException(\sprintf('No T_WHILE at given index %d, got "%s".', $index, $token->getName())); - } - - $endIndex = $tokens->getPrevMeaningfulToken($index); - if (!$tokens[$endIndex]->equals('}')) { - return false; - } - - $startIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $endIndex); - $beforeStartIndex = $tokens->getPrevMeaningfulToken($startIndex); - - return $tokens[$beforeStartIndex]->isGivenKind(T_DO); - } - - /** - * @throws \LogicException when provided index does not point to token containing T_CASE - */ - public function isEnumCase(int $caseIndex): bool - { - $tokens = $this->tokens; - $token = $tokens[$caseIndex]; - - if (!$token->isGivenKind(T_CASE)) { - throw new \LogicException(\sprintf( - 'No T_CASE given at index %d, got %s instead.', - $caseIndex, - $token->getName() ?? $token->getContent() - )); - } - - if (!\defined('T_ENUM') || !$tokens->isTokenKindFound(T_ENUM)) { - return false; - } - - $prevIndex = $tokens->getPrevTokenOfKind($caseIndex, [[T_ENUM], [T_SWITCH]]); - - return null !== $prevIndex && $tokens[$prevIndex]->isGivenKind(T_ENUM); - } - - public function isSuperGlobal(int $index): bool - { - static $superNames = [ - '$_COOKIE' => true, - '$_ENV' => true, - '$_FILES' => true, - '$_GET' => true, - '$_POST' => true, - '$_REQUEST' => true, - '$_SERVER' => true, - '$_SESSION' => true, - '$GLOBALS' => true, - ]; - - $token = $this->tokens[$index]; - - if (!$token->isGivenKind(T_VARIABLE)) { - return false; - } - - return isset($superNames[strtoupper($token->getContent())]); - } - - /** - * Find classy elements. - * - * Searches in tokens from the classy (start) index till the end (index) of the classy. - * Returns an array; first value is the index until the method has analysed (int), second the found classy elements (array). - * - * @param int $classIndex classy index - * - * @return array{int, array} - */ - private function findClassyElements(int $classIndex, int $index): array - { - $elements = []; - $curlyBracesLevel = 0; - $bracesLevel = 0; - ++$index; // skip the classy index itself - - for ($count = \count($this->tokens); $index < $count; ++$index) { - $token = $this->tokens[$index]; - - if ($token->isGivenKind(T_ENCAPSED_AND_WHITESPACE)) { - continue; - } - - if ($token->isGivenKind(T_CLASS)) { // anonymous class in class - // check for nested anonymous classes inside the new call of an anonymous class, - // for example `new class(function (){new class(function (){new class(function (){}){};}){};}){};` etc. - // if class(XYZ) {} skip till `(` as XYZ might contain functions etc. - - $nestedClassIndex = $index; - $index = $this->tokens->getNextMeaningfulToken($index); - - if ($this->tokens[$index]->equals('(')) { - ++$index; // move after `(` - - for ($nestedBracesLevel = 1; $index < $count; ++$index) { - $token = $this->tokens[$index]; - - if ($token->equals('(')) { - ++$nestedBracesLevel; - - continue; - } - - if ($token->equals(')')) { - --$nestedBracesLevel; - - if (0 === $nestedBracesLevel) { - [$index, $newElements] = $this->findClassyElements($nestedClassIndex, $index); - $elements += $newElements; - - break; - } - - continue; - } - - if ($token->isGivenKind(T_CLASS)) { // anonymous class in class - [$index, $newElements] = $this->findClassyElements($index, $index); - $elements += $newElements; - } - } - } else { - [$index, $newElements] = $this->findClassyElements($nestedClassIndex, $nestedClassIndex); - $elements += $newElements; - } - - continue; - } - - if ($token->equals('(')) { - ++$bracesLevel; - - continue; - } - - if ($token->equals(')')) { - --$bracesLevel; - - continue; - } - - if ($token->equals('{')) { - ++$curlyBracesLevel; - - continue; - } - - if ($token->equals('}')) { - --$curlyBracesLevel; - - if (0 === $curlyBracesLevel) { - break; - } - - continue; - } - - if (1 !== $curlyBracesLevel || !$token->isArray()) { - continue; - } - - if (0 === $bracesLevel && $token->isGivenKind(T_VARIABLE)) { - $elements[$index] = [ - 'classIndex' => $classIndex, - 'token' => $token, - 'type' => 'property', - ]; - - continue; - } - - if ($token->isGivenKind(T_FUNCTION)) { - $elements[$index] = [ - 'classIndex' => $classIndex, - 'token' => $token, - 'type' => 'method', - ]; - } elseif ($token->isGivenKind(T_CONST)) { - $elements[$index] = [ - 'classIndex' => $classIndex, - 'token' => $token, - 'type' => 'const', - ]; - } elseif ($token->isGivenKind(CT::T_USE_TRAIT)) { - $elements[$index] = [ - 'classIndex' => $classIndex, - 'token' => $token, - 'type' => 'trait_import', - ]; - } elseif ($token->isGivenKind(T_CASE)) { - $elements[$index] = [ - 'classIndex' => $classIndex, - 'token' => $token, - 'type' => 'case', - ]; - } - } - - return [$index, $elements]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ArrayTypehintTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ArrayTypehintTransformer.php deleted file mode 100644 index 8e5b9bf1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ArrayTypehintTransformer.php +++ /dev/null @@ -1,54 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform `array` typehint from T_ARRAY into CT::T_ARRAY_TYPEHINT. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class ArrayTypehintTransformer extends AbstractTransformer -{ - public function getRequiredPhpVersionId(): int - { - return 5_00_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if (!$token->isGivenKind(T_ARRAY)) { - return; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - $nextToken = $tokens[$nextIndex]; - - if (!$nextToken->equals('(')) { - $tokens[$index] = new Token([CT::T_ARRAY_TYPEHINT, $token->getContent()]); - } - } - - public function getCustomTokens(): array - { - return [CT::T_ARRAY_TYPEHINT]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/AttributeTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/AttributeTransformer.php deleted file mode 100644 index d19d3b88..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/AttributeTransformer.php +++ /dev/null @@ -1,67 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transforms attribute related Tokens. - * - * @internal - */ -final class AttributeTransformer extends AbstractTransformer -{ - public function getPriority(): int - { - // must run before all other transformers that might touch attributes - return 200; - } - - public function getRequiredPhpVersionId(): int - { - return 8_00_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if (!$tokens[$index]->isGivenKind(T_ATTRIBUTE)) { - return; - } - - $level = 1; - - do { - ++$index; - - if ($tokens[$index]->equals('[')) { - ++$level; - } elseif ($tokens[$index]->equals(']')) { - --$level; - } - } while (0 < $level); - - $tokens[$index] = new Token([CT::T_ATTRIBUTE_CLOSE, ']']); - } - - public function getCustomTokens(): array - { - return [ - CT::T_ATTRIBUTE_CLOSE, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceClassInstantiationTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceClassInstantiationTransformer.php deleted file mode 100644 index 1a690b89..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceClassInstantiationTransformer.php +++ /dev/null @@ -1,80 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform braced class instantiation braces in `(new Foo())` into CT::T_BRACE_CLASS_INSTANTIATION_OPEN - * and CT::T_BRACE_CLASS_INSTANTIATION_CLOSE. - * - * @author Sebastiaans Stok - * - * @internal - */ -final class BraceClassInstantiationTransformer extends AbstractTransformer -{ - public function getPriority(): int - { - // must run after CurlyBraceTransformer and SquareBraceTransformer - return -2; - } - - public function getRequiredPhpVersionId(): int - { - return 5_00_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if (!$tokens[$index]->equals('(') || !$tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(T_NEW)) { - return; - } - - if ($tokens[$tokens->getPrevMeaningfulToken($index)]->equalsAny([ - ')', - ']', - [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], - [CT::T_ARRAY_SQUARE_BRACE_CLOSE], - [CT::T_BRACE_CLASS_INSTANTIATION_CLOSE], - [T_ARRAY], - [T_CLASS], - [T_ELSEIF], - [T_FOR], - [T_FOREACH], - [T_IF], - [T_STATIC], - [T_STRING], - [T_SWITCH], - [T_VARIABLE], - [T_WHILE], - ])) { - return; - } - - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - - $tokens[$index] = new Token([CT::T_BRACE_CLASS_INSTANTIATION_OPEN, '(']); - $tokens[$closeIndex] = new Token([CT::T_BRACE_CLASS_INSTANTIATION_CLOSE, ')']); - } - - public function getCustomTokens(): array - { - return [CT::T_BRACE_CLASS_INSTANTIATION_OPEN, CT::T_BRACE_CLASS_INSTANTIATION_CLOSE]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceTransformer.php deleted file mode 100644 index 1f273159..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/BraceTransformer.php +++ /dev/null @@ -1,349 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform discriminate overloaded curly braces tokens. - * - * Performed transformations: - * - closing `}` for T_CURLY_OPEN into CT::T_CURLY_CLOSE, - * - closing `}` for T_DOLLAR_OPEN_CURLY_BRACES into CT::T_DOLLAR_CLOSE_CURLY_BRACES, - * - in `$foo->{$bar}` into CT::T_DYNAMIC_PROP_BRACE_OPEN and CT::T_DYNAMIC_PROP_BRACE_CLOSE, - * - in `${$foo}` into CT::T_DYNAMIC_VAR_BRACE_OPEN and CT::T_DYNAMIC_VAR_BRACE_CLOSE, - * - in `$array{$index}` into CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN and CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE, - * - in `use some\a\{ClassA, ClassB, ClassC as C}` into CT::T_GROUP_IMPORT_BRACE_OPEN, CT::T_GROUP_IMPORT_BRACE_CLOSE, - * - in `class PropertyHooks { public string $bar _{_ set(string $value) { } _}_` into CT::T_PROPERTY_HOOK_BRACE_OPEN, CT::T_PROPERTY_HOOK_BRACE_CLOSE. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class BraceTransformer extends AbstractTransformer -{ - public function getRequiredPhpVersionId(): int - { - return 5_00_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - $this->transformIntoCurlyCloseBrace($tokens, $index); - $this->transformIntoDollarCloseBrace($tokens, $index); - $this->transformIntoDynamicPropBraces($tokens, $index); - $this->transformIntoDynamicVarBraces($tokens, $index); - $this->transformIntoPropertyHookBraces($tokens, $index); - $this->transformIntoCurlyIndexBraces($tokens, $index); - $this->transformIntoGroupUseBraces($tokens, $index); - $this->transformIntoDynamicClassConstantFetchBraces($tokens, $index); - } - - public function getCustomTokens(): array - { - return [ - CT::T_CURLY_CLOSE, - CT::T_DOLLAR_CLOSE_CURLY_BRACES, - CT::T_DYNAMIC_PROP_BRACE_OPEN, - CT::T_DYNAMIC_PROP_BRACE_CLOSE, - CT::T_DYNAMIC_VAR_BRACE_OPEN, - CT::T_DYNAMIC_VAR_BRACE_CLOSE, - CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN, - CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE, - CT::T_GROUP_IMPORT_BRACE_OPEN, - CT::T_GROUP_IMPORT_BRACE_CLOSE, - CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_OPEN, - CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_CLOSE, - CT::T_PROPERTY_HOOK_BRACE_OPEN, - CT::T_PROPERTY_HOOK_BRACE_CLOSE, - ]; - } - - /** - * Transform closing `}` for T_CURLY_OPEN into CT::T_CURLY_CLOSE. - * - * This should be done at very beginning of curly braces transformations. - */ - private function transformIntoCurlyCloseBrace(Tokens $tokens, int $index): void - { - $token = $tokens[$index]; - - if (!$token->isGivenKind(T_CURLY_OPEN)) { - return; - } - - $level = 1; - - do { - ++$index; - - if ($tokens[$index]->equals('{') || $tokens[$index]->isGivenKind(T_CURLY_OPEN)) { // we count all kind of { - ++$level; - } elseif ($tokens[$index]->equals('}')) { // we count all kind of } - --$level; - } - } while (0 < $level); - - $tokens[$index] = new Token([CT::T_CURLY_CLOSE, '}']); - } - - private function transformIntoDollarCloseBrace(Tokens $tokens, int $index): void - { - $token = $tokens[$index]; - - if ($token->isGivenKind(T_DOLLAR_OPEN_CURLY_BRACES)) { - $nextIndex = $tokens->getNextTokenOfKind($index, ['}']); - $tokens[$nextIndex] = new Token([CT::T_DOLLAR_CLOSE_CURLY_BRACES, '}']); - } - } - - private function transformIntoDynamicPropBraces(Tokens $tokens, int $index): void - { - $token = $tokens[$index]; - - if (!$token->isObjectOperator()) { - return; - } - - if (!$tokens[$index + 1]->equals('{')) { - return; - } - - $openIndex = $index + 1; - $closeIndex = $this->naivelyFindCurlyBlockEnd($tokens, $openIndex); - - $tokens[$openIndex] = new Token([CT::T_DYNAMIC_PROP_BRACE_OPEN, '{']); - $tokens[$closeIndex] = new Token([CT::T_DYNAMIC_PROP_BRACE_CLOSE, '}']); - } - - private function transformIntoDynamicVarBraces(Tokens $tokens, int $index): void - { - $token = $tokens[$index]; - - if (!$token->equals('$')) { - return; - } - - $openIndex = $tokens->getNextMeaningfulToken($index); - - if (null === $openIndex) { - return; - } - - $openToken = $tokens[$openIndex]; - - if (!$openToken->equals('{')) { - return; - } - - $closeIndex = $this->naivelyFindCurlyBlockEnd($tokens, $openIndex); - - $tokens[$openIndex] = new Token([CT::T_DYNAMIC_VAR_BRACE_OPEN, '{']); - $tokens[$closeIndex] = new Token([CT::T_DYNAMIC_VAR_BRACE_CLOSE, '}']); - } - - private function transformIntoPropertyHookBraces(Tokens $tokens, int $index): void - { - if (\PHP_VERSION_ID < 8_04_00) { - return; // @TODO: drop condition when PHP 8.4+ is required or majority of the users are using 8.4+ - } - - $token = $tokens[$index]; - - if (!$token->equals('{')) { - return; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - - // @TODO: drop condition when PHP 8.0+ is required - if (\defined('T_ATTRIBUTE')) { - // skip attributes - while ($tokens[$nextIndex]->isGivenKind(T_ATTRIBUTE)) { - $nextIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ATTRIBUTE, $nextIndex); - $nextIndex = $tokens->getNextMeaningfulToken($nextIndex); - } - } - - if (!$tokens[$nextIndex]->equalsAny([ - [T_STRING, 'get'], - [T_STRING, 'set'], - ])) { - return; - } - - $closeIndex = $this->naivelyFindCurlyBlockEnd($tokens, $index); - - $tokens[$index] = new Token([CT::T_PROPERTY_HOOK_BRACE_OPEN, '{']); - $tokens[$closeIndex] = new Token([CT::T_PROPERTY_HOOK_BRACE_CLOSE, '}']); - } - - private function transformIntoCurlyIndexBraces(Tokens $tokens, int $index): void - { - // Support for fetching array index with braces syntax (`$arr{$index}`) - // was deprecated in 7.4 and removed in 8.0. However, the PHP's behaviour - // differs between 8.0-8.3 (fatal error in runtime) and 8.4 (parse error). - // - // @TODO Do not replace `CT::T_ARRAY_INDEX_CURLY_BRACE_*` for 8.0-8.3, as further optimization - if (\PHP_VERSION_ID >= 8_04_00) { - return; - } - - $token = $tokens[$index]; - - if (!$token->equals('{')) { - return; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if (!$tokens[$prevIndex]->equalsAny([ - [T_STRING], - [T_VARIABLE], - [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], - ']', - ')', - ])) { - return; - } - - if ( - $tokens[$prevIndex]->isGivenKind(T_STRING) - && !$tokens[$tokens->getPrevMeaningfulToken($prevIndex)]->isObjectOperator() - ) { - return; - } - - if ( - $tokens[$prevIndex]->equals(')') - && !$tokens[$tokens->getPrevMeaningfulToken( - $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $prevIndex) - )]->isGivenKind(T_ARRAY) - ) { - return; - } - - $closeIndex = $this->naivelyFindCurlyBlockEnd($tokens, $index); - - $tokens[$index] = new Token([CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN, '{']); - $tokens[$closeIndex] = new Token([CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE, '}']); - } - - private function transformIntoGroupUseBraces(Tokens $tokens, int $index): void - { - $token = $tokens[$index]; - - if (!$token->equals('{')) { - return; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if (!$tokens[$prevIndex]->isGivenKind(T_NS_SEPARATOR)) { - return; - } - - $closeIndex = $this->naivelyFindCurlyBlockEnd($tokens, $index); - - $tokens[$index] = new Token([CT::T_GROUP_IMPORT_BRACE_OPEN, '{']); - $tokens[$closeIndex] = new Token([CT::T_GROUP_IMPORT_BRACE_CLOSE, '}']); - } - - private function transformIntoDynamicClassConstantFetchBraces(Tokens $tokens, int $index): void - { - if (\PHP_VERSION_ID < 8_03_00) { - return; // @TODO: drop condition when PHP 8.3+ is required or majority of the users are using 8.3+ - } - - $token = $tokens[$index]; - - if (!$token->equals('{')) { - return; - } - - $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($index); - - while (!$tokens[$prevMeaningfulTokenIndex]->isGivenKind(T_DOUBLE_COLON)) { - if (!$tokens[$prevMeaningfulTokenIndex]->equals(')')) { - return; - } - - $prevMeaningfulTokenIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $prevMeaningfulTokenIndex); - $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($prevMeaningfulTokenIndex); - - if (!$tokens[$prevMeaningfulTokenIndex]->equals('}')) { - return; - } - - $prevMeaningfulTokenIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_CURLY_BRACE, $prevMeaningfulTokenIndex); - $prevMeaningfulTokenIndex = $tokens->getPrevMeaningfulToken($prevMeaningfulTokenIndex); - } - - $closeIndex = $this->naivelyFindCurlyBlockEnd($tokens, $index); - $nextMeaningfulTokenIndexAfterCloseIndex = $tokens->getNextMeaningfulToken($closeIndex); - - if (!$tokens[$nextMeaningfulTokenIndexAfterCloseIndex]->equalsAny([';', [T_CLOSE_TAG], [T_DOUBLE_COLON]])) { - return; - } - - $tokens[$index] = new Token([CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_OPEN, '{']); - $tokens[$closeIndex] = new Token([CT::T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_CLOSE, '}']); - } - - /** - * We do not want to rely on `$tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index)` here, - * as it relies on block types that are assuming that `}` tokens are already transformed to Custom Tokens that are allowing to distinguish different block types. - * As we are just about to transform `{` and `}` into Custom Tokens by this transformer, thus we need to compare those tokens manually by content without using `Tokens::findBlockEnd`. - */ - private function naivelyFindCurlyBlockEnd(Tokens $tokens, int $startIndex): int - { - if (!$tokens->offsetExists($startIndex)) { - throw new \OutOfBoundsException(\sprintf('Unavailable index: "%s".', $startIndex)); - } - - if ('{' !== $tokens[$startIndex]->getContent()) { - throw new \InvalidArgumentException(\sprintf('Wrong start index: "%s".', $startIndex)); - } - - $blockLevel = 1; - $endIndex = $tokens->count() - 1; - for ($index = $startIndex + 1; $index !== $endIndex; ++$index) { - $token = $tokens[$index]; - - if ('{' === $token->getContent()) { - ++$blockLevel; - - continue; - } - - if ('}' === $token->getContent()) { - --$blockLevel; - - if (0 === $blockLevel) { - if (!$token->equals('}')) { - throw new \UnexpectedValueException(\sprintf('Detected block end for index: "%s" was already transformed into other token type: "%s".', $startIndex, $token->getName())); - } - - return $index; - } - } - } - - throw new \UnexpectedValueException(\sprintf('Missing block end for index: "%s".', $startIndex)); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ClassConstantTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ClassConstantTransformer.php deleted file mode 100644 index bb75b727..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ClassConstantTransformer.php +++ /dev/null @@ -1,57 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform `class` class' constant from T_CLASS into CT::T_CLASS_CONSTANT. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class ClassConstantTransformer extends AbstractTransformer -{ - public function getRequiredPhpVersionId(): int - { - return 5_05_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if (!$token->equalsAny([ - [T_CLASS, 'class'], - [T_STRING, 'class'], - ], false)) { - return; - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - $prevToken = $tokens[$prevIndex]; - - if ($prevToken->isGivenKind(T_DOUBLE_COLON)) { - $tokens[$index] = new Token([CT::T_CLASS_CONSTANT, $token->getContent()]); - } - } - - public function getCustomTokens(): array - { - return [CT::T_CLASS_CONSTANT]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ConstructorPromotionTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ConstructorPromotionTransformer.php deleted file mode 100644 index cdb282d3..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ConstructorPromotionTransformer.php +++ /dev/null @@ -1,71 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transforms for Constructor Property Promotion. - * - * Transform T_PUBLIC, T_PROTECTED and T_PRIVATE of Constructor Property Promotion into custom tokens. - * - * @internal - */ -final class ConstructorPromotionTransformer extends AbstractTransformer -{ - public function getRequiredPhpVersionId(): int - { - return 8_00_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if (!$tokens[$index]->isGivenKind(T_FUNCTION)) { - return; - } - - $functionNameIndex = $tokens->getNextMeaningfulToken($index); - - if (!$tokens[$functionNameIndex]->isGivenKind(T_STRING) || '__construct' !== strtolower($tokens[$functionNameIndex]->getContent())) { - return; - } - - /** @var int $openParenthesisIndex */ - $openParenthesisIndex = $tokens->getNextMeaningfulToken($functionNameIndex); // we are @ '(' now - $closeParenthesisIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openParenthesisIndex); - - for ($argsIndex = $openParenthesisIndex; $argsIndex < $closeParenthesisIndex; ++$argsIndex) { - if ($tokens[$argsIndex]->isGivenKind(T_PUBLIC)) { - $tokens[$argsIndex] = new Token([CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, $tokens[$argsIndex]->getContent()]); - } elseif ($tokens[$argsIndex]->isGivenKind(T_PROTECTED)) { - $tokens[$argsIndex] = new Token([CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, $tokens[$argsIndex]->getContent()]); - } elseif ($tokens[$argsIndex]->isGivenKind(T_PRIVATE)) { - $tokens[$argsIndex] = new Token([CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE, $tokens[$argsIndex]->getContent()]); - } - } - } - - public function getCustomTokens(): array - { - return [ - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, - CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/DisjunctiveNormalFormTypeParenthesisTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/DisjunctiveNormalFormTypeParenthesisTransformer.php deleted file mode 100644 index 21d062b0..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/DisjunctiveNormalFormTypeParenthesisTransformer.php +++ /dev/null @@ -1,65 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform DNF parentheses into CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN and CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE. - * - * @see https://wiki.php.net/rfc/dnf_types - * - * @internal - */ -final class DisjunctiveNormalFormTypeParenthesisTransformer extends AbstractTransformer -{ - public function getPriority(): int - { - // needs to run after TypeAlternationTransformer - return -16; - } - - public function getRequiredPhpVersionId(): int - { - return 8_02_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if ($token->equals('(') && $tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(CT::T_TYPE_ALTERNATION)) { - $openIndex = $index; - $closeIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - } elseif ($token->equals(')') && $tokens[$tokens->getNextMeaningfulToken($index)]->isGivenKind(CT::T_TYPE_ALTERNATION)) { - $openIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index); - $closeIndex = $index; - } else { - return; - } - - $tokens[$openIndex] = new Token([CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, '(']); - $tokens[$closeIndex] = new Token([CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, ')']); - } - - public function getCustomTokens(): array - { - return [ - CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, - CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/FirstClassCallableTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/FirstClassCallableTransformer.php deleted file mode 100644 index 4781e7b8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/FirstClassCallableTransformer.php +++ /dev/null @@ -1,49 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * @internal - */ -final class FirstClassCallableTransformer extends AbstractTransformer -{ - public function getRequiredPhpVersionId(): int - { - return 8_01_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if ( - $token->isGivenKind(T_ELLIPSIS) - && $tokens[$tokens->getPrevMeaningfulToken($index)]->equals('(') - && $tokens[$tokens->getNextMeaningfulToken($index)]->equals(')') - ) { - $tokens[$index] = new Token([CT::T_FIRST_CLASS_CALLABLE, '...']); - } - } - - public function getCustomTokens(): array - { - return [ - CT::T_FIRST_CLASS_CALLABLE, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ImportTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ImportTransformer.php deleted file mode 100644 index 1a5b0107..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ImportTransformer.php +++ /dev/null @@ -1,72 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform const/function import tokens. - * - * Performed transformations: - * - T_CONST into CT::T_CONST_IMPORT - * - T_FUNCTION into CT::T_FUNCTION_IMPORT - * - * @author Gregor Harlan - * - * @internal - */ -final class ImportTransformer extends AbstractTransformer -{ - public function getPriority(): int - { - // Should run after CurlyBraceTransformer and ReturnRefTransformer - return -1; - } - - public function getRequiredPhpVersionId(): int - { - return 5_06_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if (!$token->isGivenKind([T_CONST, T_FUNCTION])) { - return; - } - - $prevToken = $tokens[$tokens->getPrevMeaningfulToken($index)]; - - if (!$prevToken->isGivenKind(T_USE)) { - $nextToken = $tokens[$tokens->getNextTokenOfKind($index, ['=', '(', [CT::T_RETURN_REF], [CT::T_GROUP_IMPORT_BRACE_CLOSE]])]; - - if (!$nextToken->isGivenKind(CT::T_GROUP_IMPORT_BRACE_CLOSE)) { - return; - } - } - - $tokens[$index] = new Token([ - $token->isGivenKind(T_FUNCTION) ? CT::T_FUNCTION_IMPORT : CT::T_CONST_IMPORT, - $token->getContent(), - ]); - } - - public function getCustomTokens(): array - { - return [CT::T_CONST_IMPORT, CT::T_FUNCTION_IMPORT]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NameQualifiedTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NameQualifiedTransformer.php deleted file mode 100644 index ed8353c8..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NameQualifiedTransformer.php +++ /dev/null @@ -1,67 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\Processor\ImportProcessor; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED and T_NAME_RELATIVE into T_NAMESPACE T_NS_SEPARATOR T_STRING. - * - * @internal - */ -final class NameQualifiedTransformer extends AbstractTransformer -{ - public function getPriority(): int - { - return 1; // must run before NamespaceOperatorTransformer - } - - public function getRequiredPhpVersionId(): int - { - return 8_00_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if ($token->isGivenKind([T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED])) { - $this->transformQualified($tokens, $token, $index); - } elseif ($token->isGivenKind(T_NAME_RELATIVE)) { - $this->transformRelative($tokens, $token, $index); - } - } - - public function getCustomTokens(): array - { - return []; - } - - private function transformQualified(Tokens $tokens, Token $token, int $index): void - { - $newTokens = ImportProcessor::tokenizeName($token->getContent()); - - $tokens->overrideRange($index, $index, $newTokens); - } - - private function transformRelative(Tokens $tokens, Token $token, int $index): void - { - $newTokens = ImportProcessor::tokenizeName($token->getContent()); - $newTokens[0] = new Token([T_NAMESPACE, 'namespace']); - - $tokens->overrideRange($index, $index, $newTokens); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamedArgumentTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamedArgumentTransformer.php deleted file mode 100644 index 0f64717b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamedArgumentTransformer.php +++ /dev/null @@ -1,73 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform named argument tokens. - * - * @internal - */ -final class NamedArgumentTransformer extends AbstractTransformer -{ - public function getPriority(): int - { - // needs to run after TypeColonTransformer - return -15; - } - - public function getRequiredPhpVersionId(): int - { - return 8_00_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if (!$tokens[$index]->equals(':')) { - return; - } - - $stringIndex = $tokens->getPrevMeaningfulToken($index); - - if (!$tokens[$stringIndex]->isGivenKind(T_STRING)) { - return; - } - - $preStringIndex = $tokens->getPrevMeaningfulToken($stringIndex); - - // if equals any [';', '{', '}', [T_OPEN_TAG]] than it is a goto label - // if equals ')' than likely it is a type colon, but sure not a name argument - // if equals '?' than it is part of ternary statement - - if (!$tokens[$preStringIndex]->equalsAny([',', '('])) { - return; - } - - $tokens[$stringIndex] = new Token([CT::T_NAMED_ARGUMENT_NAME, $tokens[$stringIndex]->getContent()]); - $tokens[$index] = new Token([CT::T_NAMED_ARGUMENT_COLON, ':']); - } - - public function getCustomTokens(): array - { - return [ - CT::T_NAMED_ARGUMENT_COLON, - CT::T_NAMED_ARGUMENT_NAME, - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamespaceOperatorTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamespaceOperatorTransformer.php deleted file mode 100644 index 5244481a..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NamespaceOperatorTransformer.php +++ /dev/null @@ -1,53 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform `namespace` operator from T_NAMESPACE into CT::T_NAMESPACE_OPERATOR. - * - * @author Gregor Harlan - * - * @internal - */ -final class NamespaceOperatorTransformer extends AbstractTransformer -{ - public function getRequiredPhpVersionId(): int - { - return 5_03_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if (!$token->isGivenKind(T_NAMESPACE)) { - return; - } - - $nextIndex = $tokens->getNextMeaningfulToken($index); - - if ($tokens[$nextIndex]->isGivenKind(T_NS_SEPARATOR)) { - $tokens[$index] = new Token([CT::T_NAMESPACE_OPERATOR, $token->getContent()]); - } - } - - public function getCustomTokens(): array - { - return [CT::T_NAMESPACE_OPERATOR]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NullableTypeTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NullableTypeTransformer.php deleted file mode 100644 index 07f481f4..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/NullableTypeTransformer.php +++ /dev/null @@ -1,83 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform `?` operator into CT::T_NULLABLE_TYPE in `function foo(?Bar $b) {}`. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class NullableTypeTransformer extends AbstractTransformer -{ - public function getPriority(): int - { - // needs to run after TypeColonTransformer - return -20; - } - - public function getRequiredPhpVersionId(): int - { - return 7_01_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if (!$token->equals('?')) { - return; - } - - static $types; - - if (null === $types) { - $types = [ - '(', - ',', - [CT::T_TYPE_COLON], - [CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC], - [CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED], - [CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE], - [CT::T_ATTRIBUTE_CLOSE], - [T_PRIVATE], - [T_PROTECTED], - [T_PUBLIC], - [T_VAR], - [T_STATIC], - [T_CONST], - ]; - - if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required - $types[] = [T_READONLY]; - } - } - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - - if ($tokens[$prevIndex]->equalsAny($types)) { - $tokens[$index] = new Token([CT::T_NULLABLE_TYPE, '?']); - } - } - - public function getCustomTokens(): array - { - return [CT::T_NULLABLE_TYPE]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ReturnRefTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ReturnRefTransformer.php deleted file mode 100644 index 13f26d05..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ReturnRefTransformer.php +++ /dev/null @@ -1,47 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform `&` operator into CT::T_RETURN_REF in `function & foo() {}`. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class ReturnRefTransformer extends AbstractTransformer -{ - public function getRequiredPhpVersionId(): int - { - return 5_00_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if ($token->equals('&') && $tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind([T_FUNCTION, T_FN])) { - $tokens[$index] = new Token([CT::T_RETURN_REF, '&']); - } - } - - public function getCustomTokens(): array - { - return [CT::T_RETURN_REF]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/SquareBraceTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/SquareBraceTransformer.php deleted file mode 100644 index 46e5b12d..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/SquareBraceTransformer.php +++ /dev/null @@ -1,187 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform discriminate overloaded square braces tokens. - * - * Performed transformations: - * - in `[1, 2, 3]` into CT::T_ARRAY_SQUARE_BRACE_OPEN and CT::T_ARRAY_SQUARE_BRACE_CLOSE, - * - in `[$a, &$b, [$c]] = array(1, 2, array(3))` into CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN and CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class SquareBraceTransformer extends AbstractTransformer -{ - public function getPriority(): int - { - // must run after CurlyBraceTransformer and AttributeTransformer - return -1; - } - - public function getRequiredPhpVersionId(): int - { - // Short array syntax was introduced in PHP 5.4, but the fixer is smart - // enough to handle it even before 5.4. - // Same for array destructing syntax sugar `[` introduced in PHP 7.1. - return 5_00_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if ($this->isArrayDestructing($tokens, $index)) { - $this->transformIntoDestructuringSquareBrace($tokens, $index); - - return; - } - - if ($this->isShortArray($tokens, $index)) { - $this->transformIntoArraySquareBrace($tokens, $index); - } - } - - public function getCustomTokens(): array - { - return [ - CT::T_ARRAY_SQUARE_BRACE_OPEN, - CT::T_ARRAY_SQUARE_BRACE_CLOSE, - CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN, - CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE, - ]; - } - - private function transformIntoArraySquareBrace(Tokens $tokens, int $index): void - { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_INDEX_SQUARE_BRACE, $index); - - $tokens[$index] = new Token([CT::T_ARRAY_SQUARE_BRACE_OPEN, '[']); - $tokens[$endIndex] = new Token([CT::T_ARRAY_SQUARE_BRACE_CLOSE, ']']); - } - - private function transformIntoDestructuringSquareBrace(Tokens $tokens, int $index): void - { - $endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_INDEX_SQUARE_BRACE, $index); - - $tokens[$index] = new Token([CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN, '[']); - $tokens[$endIndex] = new Token([CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE, ']']); - - $previousMeaningfulIndex = $index; - $index = $tokens->getNextMeaningfulToken($index); - - while ($index < $endIndex) { - if ($tokens[$index]->equals('[') && $tokens[$previousMeaningfulIndex]->equalsAny([[CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN], ','])) { - $tokens[$tokens->findBlockEnd(Tokens::BLOCK_TYPE_INDEX_SQUARE_BRACE, $index)] = new Token([CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE, ']']); - $tokens[$index] = new Token([CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN, '[']); - } - - $previousMeaningfulIndex = $index; - $index = $tokens->getNextMeaningfulToken($index); - } - } - - /** - * Check if token under given index is short array opening. - */ - private function isShortArray(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->equals('[')) { - return false; - } - - static $disallowedPrevTokens = [ - ')', - ']', - '}', - '"', - [T_CONSTANT_ENCAPSED_STRING], - [T_STRING], - [T_STRING_VARNAME], - [T_VARIABLE], - [CT::T_ARRAY_SQUARE_BRACE_CLOSE], - [CT::T_DYNAMIC_PROP_BRACE_CLOSE], - [CT::T_DYNAMIC_VAR_BRACE_CLOSE], - [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], - ]; - - $prevToken = $tokens[$tokens->getPrevMeaningfulToken($index)]; - if ($prevToken->equalsAny($disallowedPrevTokens)) { - return false; - } - - $nextToken = $tokens[$tokens->getNextMeaningfulToken($index)]; - if ($nextToken->equals(']')) { - return true; - } - - return !$this->isArrayDestructing($tokens, $index); - } - - private function isArrayDestructing(Tokens $tokens, int $index): bool - { - if (!$tokens[$index]->equals('[')) { - return false; - } - - static $disallowedPrevTokens = [ - ')', - ']', - '"', - [T_CONSTANT_ENCAPSED_STRING], - [T_STRING], - [T_STRING_VARNAME], - [T_VARIABLE], - [CT::T_ARRAY_SQUARE_BRACE_CLOSE], - [CT::T_DYNAMIC_PROP_BRACE_CLOSE], - [CT::T_DYNAMIC_VAR_BRACE_CLOSE], - [CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE], - ]; - - $prevIndex = $tokens->getPrevMeaningfulToken($index); - $prevToken = $tokens[$prevIndex]; - if ($prevToken->equalsAny($disallowedPrevTokens)) { - return false; - } - - if ($prevToken->isGivenKind(T_AS)) { - return true; - } - - if ($prevToken->isGivenKind(T_DOUBLE_ARROW)) { - $variableIndex = $tokens->getPrevMeaningfulToken($prevIndex); - if (!$tokens[$variableIndex]->isGivenKind(T_VARIABLE)) { - return false; - } - - $prevVariableIndex = $tokens->getPrevMeaningfulToken($variableIndex); - if ($tokens[$prevVariableIndex]->isGivenKind(T_AS)) { - return true; - } - } - - $type = Tokens::detectBlockType($tokens[$index]); - $end = $tokens->findBlockEnd($type['type'], $index); - - $nextToken = $tokens[$tokens->getNextMeaningfulToken($end)]; - - return $nextToken->equals('='); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeAlternationTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeAlternationTransformer.php deleted file mode 100644 index 91035f90..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeAlternationTransformer.php +++ /dev/null @@ -1,57 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTypeTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform `|` operator into CT::T_TYPE_ALTERNATION in `function foo(Type1 | Type2 $x) {` - * or `} catch (ExceptionType1 | ExceptionType2 $e) {`. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class TypeAlternationTransformer extends AbstractTypeTransformer -{ - public function getPriority(): int - { - // needs to run after ArrayTypehintTransformer, TypeColonTransformer and AttributeTransformer - return -15; - } - - public function getRequiredPhpVersionId(): int - { - return 7_01_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - $this->doProcess($tokens, $index, '|'); - } - - public function getCustomTokens(): array - { - return [CT::T_TYPE_ALTERNATION]; - } - - protected function replaceToken(Tokens $tokens, int $index): void - { - $tokens[$index] = new Token([CT::T_TYPE_ALTERNATION, '|']); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeColonTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeColonTransformer.php deleted file mode 100644 index 7fed9de2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeColonTransformer.php +++ /dev/null @@ -1,83 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform `:` operator into CT::T_TYPE_COLON in `function foo() : int {}`. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class TypeColonTransformer extends AbstractTransformer -{ - public function getPriority(): int - { - // needs to run after ReturnRefTransformer and UseTransformer - // and before TypeAlternationTransformer - return -10; - } - - public function getRequiredPhpVersionId(): int - { - return 7_00_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if (!$token->equals(':')) { - return; - } - - $endIndex = $tokens->getPrevMeaningfulToken($index); - - if ( - \defined('T_ENUM') // @TODO: drop condition when PHP 8.1+ is required - && $tokens[$tokens->getPrevMeaningfulToken($endIndex)]->isGivenKind(T_ENUM) - ) { - $tokens[$index] = new Token([CT::T_TYPE_COLON, ':']); - - return; - } - - if (!$tokens[$endIndex]->equals(')')) { - return; - } - - $startIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $endIndex); - $prevIndex = $tokens->getPrevMeaningfulToken($startIndex); - $prevToken = $tokens[$prevIndex]; - - // if this could be a function name we need to take one more step - if ($prevToken->isGivenKind(T_STRING)) { - $prevIndex = $tokens->getPrevMeaningfulToken($prevIndex); - $prevToken = $tokens[$prevIndex]; - } - - if ($prevToken->isGivenKind([T_FUNCTION, CT::T_RETURN_REF, CT::T_USE_LAMBDA, T_FN])) { - $tokens[$index] = new Token([CT::T_TYPE_COLON, ':']); - } - } - - public function getCustomTokens(): array - { - return [CT::T_TYPE_COLON]; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeIntersectionTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeIntersectionTransformer.php deleted file mode 100644 index 8018155e..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/TypeIntersectionTransformer.php +++ /dev/null @@ -1,55 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTypeTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform `&` operator into CT::T_TYPE_INTERSECTION in `function foo(Type1 & Type2 $x) {` - * or `} catch (ExceptionType1 & ExceptionType2 $e) {`. - * - * @internal - */ -final class TypeIntersectionTransformer extends AbstractTypeTransformer -{ - public function getPriority(): int - { - // needs to run after ArrayTypehintTransformer, TypeColonTransformer and AttributeTransformer - return -15; - } - - public function getRequiredPhpVersionId(): int - { - return 8_01_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - $this->doProcess($tokens, $index, [T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG, '&']); - } - - public function getCustomTokens(): array - { - return [CT::T_TYPE_INTERSECTION]; - } - - protected function replaceToken(Tokens $tokens, int $index): void - { - $tokens[$index] = new Token([CT::T_TYPE_INTERSECTION, '&']); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/UseTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/UseTransformer.php deleted file mode 100644 index 5aa0c027..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/UseTransformer.php +++ /dev/null @@ -1,102 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\CT; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Transform T_USE into: - * - CT::T_USE_TRAIT for imports, - * - CT::T_USE_LAMBDA for lambda variable uses. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class UseTransformer extends AbstractTransformer -{ - public function getPriority(): int - { - // Should run after CurlyBraceTransformer and before TypeColonTransformer - return -5; - } - - public function getRequiredPhpVersionId(): int - { - return 5_03_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if ($token->isGivenKind(T_USE) && $this->isUseForLambda($tokens, $index)) { - $tokens[$index] = new Token([CT::T_USE_LAMBDA, $token->getContent()]); - - return; - } - - // Only search inside class/trait body for `T_USE` for traits. - // Cannot import traits inside interfaces or anywhere else - - $classTypes = [T_TRAIT]; - - if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required - $classTypes[] = T_ENUM; - } - - if ($token->isGivenKind(T_CLASS)) { - if ($tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(T_DOUBLE_COLON)) { - return; - } - } elseif (!$token->isGivenKind($classTypes)) { - return; - } - - $index = $tokens->getNextTokenOfKind($index, ['{']); - $innerLimit = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - - while ($index < $innerLimit) { - $token = $tokens[++$index]; - - if (!$token->isGivenKind(T_USE)) { - continue; - } - - if ($this->isUseForLambda($tokens, $index)) { - $tokens[$index] = new Token([CT::T_USE_LAMBDA, $token->getContent()]); - } else { - $tokens[$index] = new Token([CT::T_USE_TRAIT, $token->getContent()]); - } - } - } - - public function getCustomTokens(): array - { - return [CT::T_USE_TRAIT, CT::T_USE_LAMBDA]; - } - - /** - * Check if token under given index is `use` statement for lambda function. - */ - private function isUseForLambda(Tokens $tokens, int $index): bool - { - $nextToken = $tokens[$tokens->getNextMeaningfulToken($index)]; - - // test `function () use ($foo) {}` case - return $nextToken->equals('('); - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/WhitespacyCommentTransformer.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/WhitespacyCommentTransformer.php deleted file mode 100644 index 91ab4cf2..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/WhitespacyCommentTransformer.php +++ /dev/null @@ -1,64 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer\Transformer; - -use PhpCsFixer\Tokenizer\AbstractTransformer; -use PhpCsFixer\Tokenizer\Token; -use PhpCsFixer\Tokenizer\Tokens; - -/** - * Move trailing whitespaces from comments and docs into following T_WHITESPACE token. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class WhitespacyCommentTransformer extends AbstractTransformer -{ - public function getRequiredPhpVersionId(): int - { - return 5_00_00; - } - - public function process(Tokens $tokens, Token $token, int $index): void - { - if (!$token->isComment()) { - return; - } - - $content = $token->getContent(); - $trimmedContent = rtrim($content); - - // nothing trimmed, nothing to do - if ($content === $trimmedContent) { - return; - } - - $whitespaces = substr($content, \strlen($trimmedContent)); - - $tokens[$index] = new Token([$token->getId(), $trimmedContent]); - - if (isset($tokens[$index + 1]) && $tokens[$index + 1]->isWhitespace()) { - $tokens[$index + 1] = new Token([T_WHITESPACE, $whitespaces.$tokens[$index + 1]->getContent()]); - } else { - $tokens->insertAt($index + 1, new Token([T_WHITESPACE, $whitespaces])); - } - } - - public function getCustomTokens(): array - { - return []; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TransformerInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TransformerInterface.php deleted file mode 100644 index 9d7f8600..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/TransformerInterface.php +++ /dev/null @@ -1,68 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer; - -/** - * Interface for Transformer class. - * - * Transformer role is to register custom tokens and transform Tokens collection to use them. - * - * Custom token is a user defined token type and is used to separate different meaning of original token type. - * For example T_ARRAY is a token for both creating new array and typehinting a parameter. This two meaning should have two token types. - * - * @author Dariusz Rumiński - * - * @internal - */ -interface TransformerInterface -{ - /** - * Get tokens created by Transformer. - * - * @return list - */ - public function getCustomTokens(): array; - - /** - * Return the name of the transformer. - * - * The name must be all lowercase and without any spaces. - * - * @return string The name of the fixer - */ - public function getName(): string; - - /** - * Returns the priority of the transformer. - * - * The default priority is 0 and higher priorities are executed first. - */ - public function getPriority(): int; - - /** - * Return minimal required PHP version id to transform the code. - * - * Custom Token kinds from Transformers are always registered, but sometimes - * there is no need to analyse the Tokens if for sure we cannot find examined - * token kind, e.g. transforming `T_FUNCTION` in ` - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer\Tokenizer; - -use Symfony\Component\Finder\Finder; -use Symfony\Component\Finder\SplFileInfo; - -/** - * Collection of Transformer classes. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class Transformers -{ - /** - * The registered transformers. - * - * @var list - */ - private array $items = []; - - /** - * Register built in Transformers. - */ - private function __construct() - { - $this->registerBuiltInTransformers(); - - usort($this->items, static fn (TransformerInterface $a, TransformerInterface $b): int => $b->getPriority() <=> $a->getPriority()); - } - - public static function createSingleton(): self - { - static $instance = null; - - if (!$instance) { - $instance = new self(); - } - - return $instance; - } - - /** - * Transform given Tokens collection through all Transformer classes. - * - * @param Tokens $tokens Tokens collection - */ - public function transform(Tokens $tokens): void - { - foreach ($this->items as $transformer) { - foreach ($tokens as $index => $token) { - $transformer->process($tokens, $token, $index); - } - } - } - - /** - * @param TransformerInterface $transformer Transformer - */ - private function registerTransformer(TransformerInterface $transformer): void - { - if (\PHP_VERSION_ID >= $transformer->getRequiredPhpVersionId()) { - $this->items[] = $transformer; - } - } - - private function registerBuiltInTransformers(): void - { - static $registered = false; - - if ($registered) { - return; - } - - $registered = true; - - foreach ($this->findBuiltInTransformers() as $transformer) { - $this->registerTransformer($transformer); - } - } - - /** - * @return \Generator - */ - private function findBuiltInTransformers(): iterable - { - /** @var SplFileInfo $file */ - foreach (Finder::create()->files()->in(__DIR__.'/Transformer') as $file) { - $relativeNamespace = $file->getRelativePath(); - $class = __NAMESPACE__.'\Transformer\\'.('' !== $relativeNamespace ? $relativeNamespace.'\\' : '').$file->getBasename('.php'); - - yield new $class(); - } - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfo.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfo.php deleted file mode 100644 index 885069f7..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfo.php +++ /dev/null @@ -1,119 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\Console\Application; - -/** - * Obtain information about using version of tool. - * - * @author Dariusz Rumiński - * - * @internal - */ -final class ToolInfo implements ToolInfoInterface -{ - public const COMPOSER_PACKAGE_NAME = 'friendsofphp/php-cs-fixer'; - - public const COMPOSER_LEGACY_PACKAGE_NAME = 'fabpot/php-cs-fixer'; - - /** - * @var null|array{name: string, version: string, dist: array{reference?: string}} - */ - private ?array $composerInstallationDetails = null; - - private ?bool $isInstalledByComposer = null; - - public function getComposerInstallationDetails(): array - { - if (!$this->isInstalledByComposer()) { - throw new \LogicException('Cannot get composer version for tool not installed by composer.'); - } - - if (null === $this->composerInstallationDetails) { - $composerInstalled = json_decode(file_get_contents($this->getComposerInstalledFile()), true, 512, JSON_THROW_ON_ERROR); - - $packages = $composerInstalled['packages'] ?? $composerInstalled; - - foreach ($packages as $package) { - if (\in_array($package['name'], [self::COMPOSER_PACKAGE_NAME, self::COMPOSER_LEGACY_PACKAGE_NAME], true)) { - $this->composerInstallationDetails = $package; - - break; - } - } - } - - return $this->composerInstallationDetails; - } - - public function getComposerVersion(): string - { - $package = $this->getComposerInstallationDetails(); - - $versionSuffix = ''; - - if (isset($package['dist']['reference'])) { - $versionSuffix = '#'.$package['dist']['reference']; - } - - return $package['version'].$versionSuffix; - } - - public function getVersion(): string - { - if ($this->isInstalledByComposer()) { - return Application::VERSION.':'.$this->getComposerVersion(); - } - - return Application::VERSION; - } - - public function isInstalledAsPhar(): bool - { - return str_starts_with(__DIR__, 'phar://'); - } - - public function isInstalledByComposer(): bool - { - if (null === $this->isInstalledByComposer) { - $this->isInstalledByComposer = !$this->isInstalledAsPhar() && file_exists($this->getComposerInstalledFile()); - } - - return $this->isInstalledByComposer; - } - - /** - * Determines if the tool is run inside our pre-built Docker image. - * The `/fixer/` path comes from our Dockerfile, tool is installed there and added to global PATH via symlinked binary. - */ - public function isRunInsideDocker(): bool - { - return str_starts_with(__FILE__, '/fixer/') && is_file('/.dockerenv'); - } - - public function getPharDownloadUri(string $version): string - { - return \sprintf( - 'https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/%s/php-cs-fixer.phar', - $version - ); - } - - private function getComposerInstalledFile(): string - { - return __DIR__.'/../../../composer/installed.json'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfoInterface.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfoInterface.php deleted file mode 100644 index bc2a5e0b..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/ToolInfoInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * @internal - */ -interface ToolInfoInterface -{ - /** - * @return array{name: string, version: string, dist: array{reference?: string}} - */ - public function getComposerInstallationDetails(): array; - - public function getComposerVersion(): string; - - public function getVersion(): string; - - public function isInstalledAsPhar(): bool; - - public function isInstalledByComposer(): bool; - - public function isRunInsideDocker(): bool; - - public function getPharDownloadUri(string $version): string; -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Utils.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Utils.php deleted file mode 100644 index 89f6c43f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/Utils.php +++ /dev/null @@ -1,250 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -use PhpCsFixer\Fixer\FixerInterface; -use PhpCsFixer\Tokenizer\Token; - -/** - * @author Dariusz Rumiński - * @author Graham Campbell - * @author Odín del Río - * - * @internal - * - * @deprecated This is a God Class anti-pattern. Don't expand it. It is fine to use logic that is already here (that's why we don't trigger deprecation warnings), but over time logic should be moved to dedicated, single-responsibility classes. - */ -final class Utils -{ - /** - * @var array - */ - private static array $deprecations = []; - - private function __construct() - { - // cannot create instance of util. class - } - - /** - * Converts a camel cased string to a snake cased string. - */ - public static function camelCaseToUnderscore(string $string): string - { - return mb_strtolower(Preg::replace('/(?isWhitespace()) { - throw new \InvalidArgumentException(\sprintf('The given token must be whitespace, got "%s".', $token->getName())); - } - - $str = strrchr( - str_replace(["\r\n", "\r"], "\n", $token->getContent()), - "\n" - ); - - if (false === $str) { - return ''; - } - - return ltrim($str, "\n"); - } - - /** - * Perform stable sorting using provided comparison function. - * - * Stability is ensured by using Schwartzian transform. - * - * @template T - * @template R - * - * @param list $elements - * @param callable(T): R $getComparedValue a callable that takes a single element and returns the value to compare - * @param callable(R, R): int $compareValues a callable that compares two values - * - * @return list - */ - public static function stableSort(array $elements, callable $getComparedValue, callable $compareValues): array - { - array_walk($elements, static function (&$element, int $index) use ($getComparedValue): void { - $element = [$element, $index, $getComparedValue($element)]; - }); - - usort($elements, static function ($a, $b) use ($compareValues): int { - $comparison = $compareValues($a[2], $b[2]); - - if (0 !== $comparison) { - return $comparison; - } - - return $a[1] <=> $b[1]; - }); - - return array_map(static fn (array $item) => $item[0], $elements); - } - - /** - * Sort fixers by their priorities. - * - * @param list $fixers - * - * @return list - */ - public static function sortFixers(array $fixers): array - { - // Schwartzian transform is used to improve the efficiency and avoid - // `usort(): Array was modified by the user comparison function` warning for mocked objects. - return self::stableSort( - $fixers, - static fn (FixerInterface $fixer): int => $fixer->getPriority(), - static fn (int $a, int $b): int => $b <=> $a - ); - } - - /** - * Join names in natural language using specified wrapper (double quote by default). - * - * @param list $names - * - * @throws \InvalidArgumentException - */ - public static function naturalLanguageJoin(array $names, string $wrapper = '"'): string - { - if (0 === \count($names)) { - throw new \InvalidArgumentException('Array of names cannot be empty.'); - } - - if (\strlen($wrapper) > 1) { - throw new \InvalidArgumentException('Wrapper should be a single-char string or empty.'); - } - - $names = array_map(static fn (string $name): string => \sprintf('%2$s%1$s%2$s', $name, $wrapper), $names); - - $last = array_pop($names); - - if (\count($names) > 0) { - return implode(', ', $names).' and '.$last; - } - - return $last; - } - - /** - * Join names in natural language wrapped in backticks, e.g. `a`, `b` and `c`. - * - * @param list $names - * - * @throws \InvalidArgumentException - */ - public static function naturalLanguageJoinWithBackticks(array $names): string - { - return self::naturalLanguageJoin($names, '`'); - } - - public static function isFutureModeEnabled(): bool - { - return filter_var( - getenv('PHP_CS_FIXER_FUTURE_MODE'), - FILTER_VALIDATE_BOOL - ); - } - - public static function triggerDeprecation(\Exception $futureException): void - { - if (self::isFutureModeEnabled()) { - throw new \RuntimeException( - 'Your are using something deprecated, see previous exception. Aborting execution because `PHP_CS_FIXER_FUTURE_MODE` environment variable is set.', - 0, - $futureException - ); - } - - $message = $futureException->getMessage(); - - self::$deprecations[$message] = true; - @trigger_error($message, E_USER_DEPRECATED); - } - - /** - * @return list - */ - public static function getTriggeredDeprecations(): array - { - $triggeredDeprecations = array_keys(self::$deprecations); - sort($triggeredDeprecations); - - return $triggeredDeprecations; - } - - public static function convertArrayTypeToList(string $type): string - { - $parts = explode('[]', $type); - $count = \count($parts) - 1; - - return str_repeat('list<', $count).$parts[0].str_repeat('>', $count); - } - - /** - * @param mixed $value - */ - public static function toString($value): string - { - return \is_array($value) - ? self::arrayToString($value) - : self::scalarToString($value); - } - - /** - * @param mixed $value - */ - private static function scalarToString($value): string - { - $str = var_export($value, true); - - return Preg::replace('/\bNULL\b/', 'null', $str); - } - - /** - * @param array $value - */ - private static function arrayToString(array $value): string - { - if (0 === \count($value)) { - return '[]'; - } - - $isHash = !array_is_list($value); - $str = '['; - - foreach ($value as $k => $v) { - if ($isHash) { - $str .= self::scalarToString($k).' => '; - } - - $str .= \is_array($v) - ? self::arrayToString($v).', ' - : self::scalarToString($v).', '; - } - - return substr($str, 0, -2).']'; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WhitespacesFixerConfig.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WhitespacesFixerConfig.php deleted file mode 100644 index c908c4f1..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WhitespacesFixerConfig.php +++ /dev/null @@ -1,63 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * @author Dariusz Rumiński - * - * @readonly - */ -final class WhitespacesFixerConfig -{ - /** @var non-empty-string */ - private string $indent; - - /** @var non-empty-string */ - private string $lineEnding; - - /** - * @param non-empty-string $indent - * @param non-empty-string $lineEnding - */ - public function __construct(string $indent = ' ', string $lineEnding = "\n") - { - if (!\in_array($indent, [' ', ' ', "\t"], true)) { - throw new \InvalidArgumentException('Invalid "indent" param, expected tab or two or four spaces.'); - } - - if (!\in_array($lineEnding, ["\n", "\r\n"], true)) { - throw new \InvalidArgumentException('Invalid "lineEnding" param, expected "\n" or "\r\n".'); - } - - $this->indent = $indent; - $this->lineEnding = $lineEnding; - } - - /** - * @return non-empty-string - */ - public function getIndent(): string - { - return $this->indent; - } - - /** - * @return non-empty-string - */ - public function getLineEnding(): string - { - return $this->lineEnding; - } -} diff --git a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WordMatcher.php b/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WordMatcher.php deleted file mode 100644 index b54dae5f..00000000 --- a/tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/src/WordMatcher.php +++ /dev/null @@ -1,55 +0,0 @@ - - * Dariusz Rumiński - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace PhpCsFixer; - -/** - * @author Dariusz Rumiński - * - * @readonly - * - * @internal - */ -final class WordMatcher -{ - /** - * @var list - */ - private array $candidates; - - /** - * @param list $candidates - */ - public function __construct(array $candidates) - { - $this->candidates = $candidates; - } - - public function match(string $needle): ?string - { - $word = null; - $distance = ceil(\strlen($needle) * 0.35); - - foreach ($this->candidates as $candidate) { - $candidateDistance = levenshtein($needle, $candidate); - - if ($candidateDistance < $distance) { - $word = $candidate; - $distance = $candidateDistance; - } - } - - return $word; - } -} diff --git a/tools/php-cs-fixer/vendor/psr/container/.gitignore b/tools/php-cs-fixer/vendor/psr/container/.gitignore deleted file mode 100644 index b2395aa0..00000000 --- a/tools/php-cs-fixer/vendor/psr/container/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -composer.phar -/vendor/ diff --git a/tools/php-cs-fixer/vendor/psr/container/LICENSE b/tools/php-cs-fixer/vendor/psr/container/LICENSE deleted file mode 100644 index 2877a489..00000000 --- a/tools/php-cs-fixer/vendor/psr/container/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2016 container-interop -Copyright (c) 2016 PHP Framework Interoperability Group - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/psr/container/README.md b/tools/php-cs-fixer/vendor/psr/container/README.md deleted file mode 100644 index 1b9d9e57..00000000 --- a/tools/php-cs-fixer/vendor/psr/container/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Container interface -============== - -This repository holds all interfaces related to [PSR-11 (Container Interface)][psr-url]. - -Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container. - -The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. - -[psr-url]: https://www.php-fig.org/psr/psr-11/ -[package-url]: https://packagist.org/packages/psr/container -[implementation-url]: https://packagist.org/providers/psr/container-implementation - diff --git a/tools/php-cs-fixer/vendor/psr/container/composer.json b/tools/php-cs-fixer/vendor/psr/container/composer.json deleted file mode 100644 index baf6cd1a..00000000 --- a/tools/php-cs-fixer/vendor/psr/container/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "psr/container", - "type": "library", - "description": "Common Container Interface (PHP FIG PSR-11)", - "keywords": ["psr", "psr-11", "container", "container-interop", "container-interface"], - "homepage": "https://github.com/php-fig/container", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=7.4.0" - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/tools/php-cs-fixer/vendor/psr/container/src/ContainerExceptionInterface.php b/tools/php-cs-fixer/vendor/psr/container/src/ContainerExceptionInterface.php deleted file mode 100644 index 0f213f2f..00000000 --- a/tools/php-cs-fixer/vendor/psr/container/src/ContainerExceptionInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -=7.2.0" - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/tools/php-cs-fixer/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php b/tools/php-cs-fixer/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php deleted file mode 100644 index 4306fa91..00000000 --- a/tools/php-cs-fixer/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -logger = $logger; - } - - public function doSomething() - { - if ($this->logger) { - $this->logger->info('Doing work'); - } - - try { - $this->doSomethingElse(); - } catch (Exception $exception) { - $this->logger->error('Oh no!', array('exception' => $exception)); - } - - // do something useful - } -} -``` - -You can then pick one of the implementations of the interface to get a logger. - -If you want to implement the interface, you can require this package and -implement `Psr\Log\LoggerInterface` in your code. Please read the -[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) -for details. diff --git a/tools/php-cs-fixer/vendor/psr/log/composer.json b/tools/php-cs-fixer/vendor/psr/log/composer.json deleted file mode 100644 index 879fc6f5..00000000 --- a/tools/php-cs-fixer/vendor/psr/log/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "psr/log", - "description": "Common interface for logging libraries", - "keywords": ["psr", "psr-3", "log"], - "homepage": "https://github.com/php-fig/log", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=8.0.0" - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - } -} diff --git a/tools/php-cs-fixer/vendor/psr/log/src/AbstractLogger.php b/tools/php-cs-fixer/vendor/psr/log/src/AbstractLogger.php deleted file mode 100644 index d60a091a..00000000 --- a/tools/php-cs-fixer/vendor/psr/log/src/AbstractLogger.php +++ /dev/null @@ -1,15 +0,0 @@ -logger = $logger; - } -} diff --git a/tools/php-cs-fixer/vendor/psr/log/src/LoggerInterface.php b/tools/php-cs-fixer/vendor/psr/log/src/LoggerInterface.php deleted file mode 100644 index cb4cf648..00000000 --- a/tools/php-cs-fixer/vendor/psr/log/src/LoggerInterface.php +++ /dev/null @@ -1,98 +0,0 @@ -log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - */ - public function alert(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - */ - public function critical(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - */ - public function error(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - */ - public function warning(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - */ - public function notice(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - */ - public function info(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - */ - public function debug(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::DEBUG, $message, $context); - } - - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * - * @throws \Psr\Log\InvalidArgumentException - */ - abstract public function log($level, string|\Stringable $message, array $context = []): void; -} diff --git a/tools/php-cs-fixer/vendor/psr/log/src/NullLogger.php b/tools/php-cs-fixer/vendor/psr/log/src/NullLogger.php deleted file mode 100644 index de0561e2..00000000 --- a/tools/php-cs-fixer/vendor/psr/log/src/NullLogger.php +++ /dev/null @@ -1,26 +0,0 @@ -logger) { }` - * blocks. - */ -class NullLogger extends AbstractLogger -{ - /** - * Logs with an arbitrary level. - * - * @param mixed[] $context - * - * @throws \Psr\Log\InvalidArgumentException - */ - public function log($level, string|\Stringable $message, array $context = []): void - { - // noop - } -} diff --git a/tools/php-cs-fixer/vendor/react/cache/CHANGELOG.md b/tools/php-cs-fixer/vendor/react/cache/CHANGELOG.md deleted file mode 100644 index ab59f183..00000000 --- a/tools/php-cs-fixer/vendor/react/cache/CHANGELOG.md +++ /dev/null @@ -1,96 +0,0 @@ -# Changelog - -## 1.2.0 (2022-11-30) - -* Feature: Support PHP 8.1 and PHP 8.2. - (#47 by @SimonFrings and #52 by @WyriHaximus) - -* Minor documentation improvements. - (#48 by @SimonFrings and #51 by @nhedger) - -* Update test suite and use GitHub actions for continuous integration (CI). - (#45 and #49 by @SimonFrings and #54 by @clue) - -## 1.1.0 (2020-09-18) - -* Feature: Forward compatibility with react/promise 3. - (#39 by @WyriHaximus) - -* Add `.gitattributes` to exclude dev files from exports. - (#40 by @reedy) - -* Improve test suite, update to support PHP 8 and PHPUnit 9.3. - (#41 and #43 by @SimonFrings and #42 by @WyriHaximus) - -## 1.0.0 (2019-07-11) - -* First stable LTS release, now following [SemVer](https://semver.org/). - We'd like to emphasize that this component is production ready and battle-tested. - We plan to support all long-term support (LTS) releases for at least 24 months, - so you have a rock-solid foundation to build on top of. - -> Contains no other changes, so it's actually fully compatible with the v0.6.0 release. - -## 0.6.0 (2019-07-04) - -* Feature / BC break: Add support for `getMultiple()`, `setMultiple()`, `deleteMultiple()`, `clear()` and `has()` - supporting multiple cache items (inspired by PSR-16). - (#32 by @krlv and #37 by @clue) - -* Documentation for TTL precision with millisecond accuracy or below and - use high-resolution timer for cache TTL on PHP 7.3+. - (#35 and #38 by @clue) - -* Improve API documentation and allow legacy HHVM to fail in Travis CI config. - (#34 and #36 by @clue) - -* Prefix all global functions calls with \ to skip the look up and resolve process and go straight to the global function. - (#31 by @WyriHaximus) - -## 0.5.0 (2018-06-25) - -* Improve documentation by describing what is expected of a class implementing `CacheInterface`. - (#21, #22, #23, #27 by @WyriHaximus) - -* Implemented (optional) Least Recently Used (LRU) cache algorithm for `ArrayCache`. - (#26 by @clue) - -* Added support for cache expiration (TTL). - (#29 by @clue and @WyriHaximus) - -* Renamed `remove` to `delete` making it more in line with `PSR-16`. - (#30 by @clue) - -## 0.4.2 (2017-12-20) - -* Improve documentation with usage and installation instructions - (#10 by @clue) - -* Improve test suite by adding PHPUnit to `require-dev` and - add forward compatibility with PHPUnit 5 and PHPUnit 6 and - sanitize Composer autoload paths - (#14 by @shaunbramley and #12 and #18 by @clue) - -## 0.4.1 (2016-02-25) - -* Repository maintenance, split off from main repo, improve test suite and documentation -* First class support for PHP7 and HHVM (#9 by @clue) -* Adjust compatibility to 5.3 (#7 by @clue) - -## 0.4.0 (2014-02-02) - -* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks -* BC break: Update to React/Promise 2.0 -* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0 - -## 0.3.2 (2013-05-10) - -* Version bump - -## 0.3.0 (2013-04-14) - -* Version bump - -## 0.2.6 (2012-12-26) - -* Feature: New cache component, used by DNS diff --git a/tools/php-cs-fixer/vendor/react/cache/LICENSE b/tools/php-cs-fixer/vendor/react/cache/LICENSE deleted file mode 100644 index d6f8901f..00000000 --- a/tools/php-cs-fixer/vendor/react/cache/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/cache/README.md b/tools/php-cs-fixer/vendor/react/cache/README.md deleted file mode 100644 index 7a86be9c..00000000 --- a/tools/php-cs-fixer/vendor/react/cache/README.md +++ /dev/null @@ -1,367 +0,0 @@ -# Cache - -[![CI status](https://github.com/reactphp/cache/actions/workflows/ci.yml/badge.svg)](https://github.com/reactphp/cache/actions) -[![installs on Packagist](https://img.shields.io/packagist/dt/react/cache?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/cache) - -Async, [Promise](https://github.com/reactphp/promise)-based cache interface -for [ReactPHP](https://reactphp.org/). - -The cache component provides a -[Promise](https://github.com/reactphp/promise)-based -[`CacheInterface`](#cacheinterface) and an in-memory [`ArrayCache`](#arraycache) -implementation of that. -This allows consumers to type hint against the interface and third parties to -provide alternate implementations. -This project is heavily inspired by -[PSR-16: Common Interface for Caching Libraries](https://www.php-fig.org/psr/psr-16/), -but uses an interface more suited for async, non-blocking applications. - -**Table of Contents** - -* [Usage](#usage) - * [CacheInterface](#cacheinterface) - * [get()](#get) - * [set()](#set) - * [delete()](#delete) - * [getMultiple()](#getmultiple) - * [setMultiple()](#setmultiple) - * [deleteMultiple()](#deletemultiple) - * [clear()](#clear) - * [has()](#has) - * [ArrayCache](#arraycache) -* [Common usage](#common-usage) - * [Fallback get](#fallback-get) - * [Fallback-get-and-set](#fallback-get-and-set) -* [Install](#install) -* [Tests](#tests) -* [License](#license) - -## Usage - -### CacheInterface - -The `CacheInterface` describes the main interface of this component. -This allows consumers to type hint against the interface and third parties to -provide alternate implementations. - -#### get() - -The `get(string $key, mixed $default = null): PromiseInterface` method can be used to -retrieve an item from the cache. - -This method will resolve with the cached value on success or with the -given `$default` value when no item can be found or when an error occurs. -Similarly, an expired cache item (once the time-to-live is expired) is -considered a cache miss. - -```php -$cache - ->get('foo') - ->then('var_dump'); -``` - -This example fetches the value of the key `foo` and passes it to the -`var_dump` function. You can use any of the composition provided by -[promises](https://github.com/reactphp/promise). - -#### set() - -The `set(string $key, mixed $value, ?float $ttl = null): PromiseInterface` method can be used to -store an item in the cache. - -This method will resolve with `true` on success or `false` when an error -occurs. If the cache implementation has to go over the network to store -it, it may take a while. - -The optional `$ttl` parameter sets the maximum time-to-live in seconds -for this cache item. If this parameter is omitted (or `null`), the item -will stay in the cache for as long as the underlying implementation -supports. Trying to access an expired cache item results in a cache miss, -see also [`get()`](#get). - -```php -$cache->set('foo', 'bar', 60); -``` - -This example eventually sets the value of the key `foo` to `bar`. If it -already exists, it is overridden. - -This interface does not enforce any particular TTL resolution, so special -care may have to be taken if you rely on very high precision with -millisecond accuracy or below. Cache implementations SHOULD work on a -best effort basis and SHOULD provide at least second accuracy unless -otherwise noted. Many existing cache implementations are known to provide -microsecond or millisecond accuracy, but it's generally not recommended -to rely on this high precision. - -This interface suggests that cache implementations SHOULD use a monotonic -time source if available. Given that a monotonic time source is only -available as of PHP 7.3 by default, cache implementations MAY fall back -to using wall-clock time. -While this does not affect many common use cases, this is an important -distinction for programs that rely on a high time precision or on systems -that are subject to discontinuous time adjustments (time jumps). -This means that if you store a cache item with a TTL of 30s and then -adjust your system time forward by 20s, the cache item SHOULD still -expire in 30s. - -#### delete() - -The `delete(string $key): PromiseInterface` method can be used to -delete an item from the cache. - -This method will resolve with `true` on success or `false` when an error -occurs. When no item for `$key` is found in the cache, it also resolves -to `true`. If the cache implementation has to go over the network to -delete it, it may take a while. - -```php -$cache->delete('foo'); -``` - -This example eventually deletes the key `foo` from the cache. As with -`set()`, this may not happen instantly and a promise is returned to -provide guarantees whether or not the item has been removed from cache. - -#### getMultiple() - -The `getMultiple(string[] $keys, mixed $default = null): PromiseInterface` method can be used to -retrieve multiple cache items by their unique keys. - -This method will resolve with an array of cached values on success or with the -given `$default` value when an item can not be found or when an error occurs. -Similarly, an expired cache item (once the time-to-live is expired) is -considered a cache miss. - -```php -$cache->getMultiple(array('name', 'age'))->then(function (array $values) { - $name = $values['name'] ?? 'User'; - $age = $values['age'] ?? 'n/a'; - - echo $name . ' is ' . $age . PHP_EOL; -}); -``` - -This example fetches the cache items for the `name` and `age` keys and -prints some example output. You can use any of the composition provided -by [promises](https://github.com/reactphp/promise). - -#### setMultiple() - -The `setMultiple(array $values, ?float $ttl = null): PromiseInterface` method can be used to -persist a set of key => value pairs in the cache, with an optional TTL. - -This method will resolve with `true` on success or `false` when an error -occurs. If the cache implementation has to go over the network to store -it, it may take a while. - -The optional `$ttl` parameter sets the maximum time-to-live in seconds -for these cache items. If this parameter is omitted (or `null`), these items -will stay in the cache for as long as the underlying implementation -supports. Trying to access an expired cache items results in a cache miss, -see also [`getMultiple()`](#getmultiple). - -```php -$cache->setMultiple(array('foo' => 1, 'bar' => 2), 60); -``` - -This example eventually sets the list of values - the key `foo` to `1` value -and the key `bar` to `2`. If some of the keys already exist, they are overridden. - -#### deleteMultiple() - -The `setMultiple(string[] $keys): PromiseInterface` method can be used to -delete multiple cache items in a single operation. - -This method will resolve with `true` on success or `false` when an error -occurs. When no items for `$keys` are found in the cache, it also resolves -to `true`. If the cache implementation has to go over the network to -delete it, it may take a while. - -```php -$cache->deleteMultiple(array('foo', 'bar, 'baz')); -``` - -This example eventually deletes keys `foo`, `bar` and `baz` from the cache. -As with `setMultiple()`, this may not happen instantly and a promise is returned to -provide guarantees whether or not the item has been removed from cache. - -#### clear() - -The `clear(): PromiseInterface` method can be used to -wipe clean the entire cache. - -This method will resolve with `true` on success or `false` when an error -occurs. If the cache implementation has to go over the network to -delete it, it may take a while. - -```php -$cache->clear(); -``` - -This example eventually deletes all keys from the cache. As with `deleteMultiple()`, -this may not happen instantly and a promise is returned to provide guarantees -whether or not all the items have been removed from cache. - -#### has() - -The `has(string $key): PromiseInterface` method can be used to -determine whether an item is present in the cache. - -This method will resolve with `true` on success or `false` when no item can be found -or when an error occurs. Similarly, an expired cache item (once the time-to-live -is expired) is considered a cache miss. - -```php -$cache - ->has('foo') - ->then('var_dump'); -``` - -This example checks if the value of the key `foo` is set in the cache and passes -the result to the `var_dump` function. You can use any of the composition provided by -[promises](https://github.com/reactphp/promise). - -NOTE: It is recommended that has() is only to be used for cache warming type purposes -and not to be used within your live applications operations for get/set, as this method -is subject to a race condition where your has() will return true and immediately after, -another script can remove it making the state of your app out of date. - -### ArrayCache - -The `ArrayCache` provides an in-memory implementation of the [`CacheInterface`](#cacheinterface). - -```php -$cache = new ArrayCache(); - -$cache->set('foo', 'bar'); -``` - -Its constructor accepts an optional `?int $limit` parameter to limit the -maximum number of entries to store in the LRU cache. If you add more -entries to this instance, it will automatically take care of removing -the one that was least recently used (LRU). - -For example, this snippet will overwrite the first value and only store -the last two entries: - -```php -$cache = new ArrayCache(2); - -$cache->set('foo', '1'); -$cache->set('bar', '2'); -$cache->set('baz', '3'); -``` - -This cache implementation is known to rely on wall-clock time to schedule -future cache expiration times when using any version before PHP 7.3, -because a monotonic time source is only available as of PHP 7.3 (`hrtime()`). -While this does not affect many common use cases, this is an important -distinction for programs that rely on a high time precision or on systems -that are subject to discontinuous time adjustments (time jumps). -This means that if you store a cache item with a TTL of 30s on PHP < 7.3 -and then adjust your system time forward by 20s, the cache item may -expire in 10s. See also [`set()`](#set) for more details. - -## Common usage - -### Fallback get - -A common use case of caches is to attempt fetching a cached value and as a -fallback retrieve it from the original data source if not found. Here is an -example of that: - -```php -$cache - ->get('foo') - ->then(function ($result) { - if ($result === null) { - return getFooFromDb(); - } - - return $result; - }) - ->then('var_dump'); -``` - -First an attempt is made to retrieve the value of `foo`. A callback function is -registered that will call `getFooFromDb` when the resulting value is null. -`getFooFromDb` is a function (can be any PHP callable) that will be called if the -key does not exist in the cache. - -`getFooFromDb` can handle the missing key by returning a promise for the -actual value from the database (or any other data source). As a result, this -chain will correctly fall back, and provide the value in both cases. - -### Fallback get and set - -To expand on the fallback get example, often you want to set the value on the -cache after fetching it from the data source. - -```php -$cache - ->get('foo') - ->then(function ($result) { - if ($result === null) { - return $this->getAndCacheFooFromDb(); - } - - return $result; - }) - ->then('var_dump'); - -public function getAndCacheFooFromDb() -{ - return $this->db - ->get('foo') - ->then(array($this, 'cacheFooFromDb')); -} - -public function cacheFooFromDb($foo) -{ - $this->cache->set('foo', $foo); - - return $foo; -} -``` - -By using chaining you can easily conditionally cache the value if it is -fetched from the database. - -## Install - -The recommended way to install this library is [through Composer](https://getcomposer.org). -[New to Composer?](https://getcomposer.org/doc/00-intro.md) - -This project follows [SemVer](https://semver.org/). -This will install the latest supported version: - -```bash -composer require react/cache:^1.2 -``` - -See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. - -This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.3 through current PHP 8+ and -HHVM. -It's *highly recommended to use PHP 7+* for this project. - -## Tests - -To run the test suite, you first need to clone this repo and then install all -dependencies [through Composer](https://getcomposer.org): - -```bash -composer install -``` - -To run the test suite, go to the project root and run: - -```bash -vendor/bin/phpunit -``` - -## License - -MIT, see [LICENSE file](LICENSE). diff --git a/tools/php-cs-fixer/vendor/react/cache/composer.json b/tools/php-cs-fixer/vendor/react/cache/composer.json deleted file mode 100644 index 153439a2..00000000 --- a/tools/php-cs-fixer/vendor/react/cache/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "react/cache", - "description": "Async, Promise-based cache interface for ReactPHP", - "keywords": ["cache", "caching", "promise", "ReactPHP"], - "license": "MIT", - "authors": [ - { - "name": "Christian Lück", - "homepage": "https://clue.engineering/", - "email": "christian@clue.engineering" - }, - { - "name": "Cees-Jan Kiewiet", - "homepage": "https://wyrihaximus.net/", - "email": "reactphp@ceesjankiewiet.nl" - }, - { - "name": "Jan Sorgalla", - "homepage": "https://sorgalla.com/", - "email": "jsorgalla@gmail.com" - }, - { - "name": "Chris Boden", - "homepage": "https://cboden.dev/", - "email": "cboden@gmail.com" - } - ], - "require": { - "php": ">=5.3.0", - "react/promise": "^3.0 || ^2.0 || ^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" - }, - "autoload": { - "psr-4": { - "React\\Cache\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "React\\Tests\\Cache\\": "tests/" - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/cache/src/ArrayCache.php b/tools/php-cs-fixer/vendor/react/cache/src/ArrayCache.php deleted file mode 100644 index 81f25eff..00000000 --- a/tools/php-cs-fixer/vendor/react/cache/src/ArrayCache.php +++ /dev/null @@ -1,181 +0,0 @@ -set('foo', 'bar'); - * ``` - * - * Its constructor accepts an optional `?int $limit` parameter to limit the - * maximum number of entries to store in the LRU cache. If you add more - * entries to this instance, it will automatically take care of removing - * the one that was least recently used (LRU). - * - * For example, this snippet will overwrite the first value and only store - * the last two entries: - * - * ```php - * $cache = new ArrayCache(2); - * - * $cache->set('foo', '1'); - * $cache->set('bar', '2'); - * $cache->set('baz', '3'); - * ``` - * - * This cache implementation is known to rely on wall-clock time to schedule - * future cache expiration times when using any version before PHP 7.3, - * because a monotonic time source is only available as of PHP 7.3 (`hrtime()`). - * While this does not affect many common use cases, this is an important - * distinction for programs that rely on a high time precision or on systems - * that are subject to discontinuous time adjustments (time jumps). - * This means that if you store a cache item with a TTL of 30s on PHP < 7.3 - * and then adjust your system time forward by 20s, the cache item may - * expire in 10s. See also [`set()`](#set) for more details. - * - * @param int|null $limit maximum number of entries to store in the LRU cache - */ - public function __construct($limit = null) - { - $this->limit = $limit; - - // prefer high-resolution timer, available as of PHP 7.3+ - $this->supportsHighResolution = \function_exists('hrtime'); - } - - public function get($key, $default = null) - { - // delete key if it is already expired => below will detect this as a cache miss - if (isset($this->expires[$key]) && $this->now() - $this->expires[$key] > 0) { - unset($this->data[$key], $this->expires[$key]); - } - - if (!\array_key_exists($key, $this->data)) { - return Promise\resolve($default); - } - - // remove and append to end of array to keep track of LRU info - $value = $this->data[$key]; - unset($this->data[$key]); - $this->data[$key] = $value; - - return Promise\resolve($value); - } - - public function set($key, $value, $ttl = null) - { - // unset before setting to ensure this entry will be added to end of array (LRU info) - unset($this->data[$key]); - $this->data[$key] = $value; - - // sort expiration times if TTL is given (first will expire first) - unset($this->expires[$key]); - if ($ttl !== null) { - $this->expires[$key] = $this->now() + $ttl; - \asort($this->expires); - } - - // ensure size limit is not exceeded or remove first entry from array - if ($this->limit !== null && \count($this->data) > $this->limit) { - // first try to check if there's any expired entry - // expiration times are sorted, so we can simply look at the first one - \reset($this->expires); - $key = \key($this->expires); - - // check to see if the first in the list of expiring keys is already expired - // if the first key is not expired, we have to overwrite by using LRU info - if ($key === null || $this->now() - $this->expires[$key] < 0) { - \reset($this->data); - $key = \key($this->data); - } - unset($this->data[$key], $this->expires[$key]); - } - - return Promise\resolve(true); - } - - public function delete($key) - { - unset($this->data[$key], $this->expires[$key]); - - return Promise\resolve(true); - } - - public function getMultiple(array $keys, $default = null) - { - $values = array(); - - foreach ($keys as $key) { - $values[$key] = $this->get($key, $default); - } - - return Promise\all($values); - } - - public function setMultiple(array $values, $ttl = null) - { - foreach ($values as $key => $value) { - $this->set($key, $value, $ttl); - } - - return Promise\resolve(true); - } - - public function deleteMultiple(array $keys) - { - foreach ($keys as $key) { - unset($this->data[$key], $this->expires[$key]); - } - - return Promise\resolve(true); - } - - public function clear() - { - $this->data = array(); - $this->expires = array(); - - return Promise\resolve(true); - } - - public function has($key) - { - // delete key if it is already expired - if (isset($this->expires[$key]) && $this->now() - $this->expires[$key] > 0) { - unset($this->data[$key], $this->expires[$key]); - } - - if (!\array_key_exists($key, $this->data)) { - return Promise\resolve(false); - } - - // remove and append to end of array to keep track of LRU info - $value = $this->data[$key]; - unset($this->data[$key]); - $this->data[$key] = $value; - - return Promise\resolve(true); - } - - /** - * @return float - */ - private function now() - { - return $this->supportsHighResolution ? \hrtime(true) * 1e-9 : \microtime(true); - } -} diff --git a/tools/php-cs-fixer/vendor/react/cache/src/CacheInterface.php b/tools/php-cs-fixer/vendor/react/cache/src/CacheInterface.php deleted file mode 100644 index 8e51c190..00000000 --- a/tools/php-cs-fixer/vendor/react/cache/src/CacheInterface.php +++ /dev/null @@ -1,194 +0,0 @@ -get('foo') - * ->then('var_dump'); - * ``` - * - * This example fetches the value of the key `foo` and passes it to the - * `var_dump` function. You can use any of the composition provided by - * [promises](https://github.com/reactphp/promise). - * - * @param string $key - * @param mixed $default Default value to return for cache miss or null if not given. - * @return PromiseInterface - */ - public function get($key, $default = null); - - /** - * Stores an item in the cache. - * - * This method will resolve with `true` on success or `false` when an error - * occurs. If the cache implementation has to go over the network to store - * it, it may take a while. - * - * The optional `$ttl` parameter sets the maximum time-to-live in seconds - * for this cache item. If this parameter is omitted (or `null`), the item - * will stay in the cache for as long as the underlying implementation - * supports. Trying to access an expired cache item results in a cache miss, - * see also [`get()`](#get). - * - * ```php - * $cache->set('foo', 'bar', 60); - * ``` - * - * This example eventually sets the value of the key `foo` to `bar`. If it - * already exists, it is overridden. - * - * This interface does not enforce any particular TTL resolution, so special - * care may have to be taken if you rely on very high precision with - * millisecond accuracy or below. Cache implementations SHOULD work on a - * best effort basis and SHOULD provide at least second accuracy unless - * otherwise noted. Many existing cache implementations are known to provide - * microsecond or millisecond accuracy, but it's generally not recommended - * to rely on this high precision. - * - * This interface suggests that cache implementations SHOULD use a monotonic - * time source if available. Given that a monotonic time source is only - * available as of PHP 7.3 by default, cache implementations MAY fall back - * to using wall-clock time. - * While this does not affect many common use cases, this is an important - * distinction for programs that rely on a high time precision or on systems - * that are subject to discontinuous time adjustments (time jumps). - * This means that if you store a cache item with a TTL of 30s and then - * adjust your system time forward by 20s, the cache item SHOULD still - * expire in 30s. - * - * @param string $key - * @param mixed $value - * @param ?float $ttl - * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error - */ - public function set($key, $value, $ttl = null); - - /** - * Deletes an item from the cache. - * - * This method will resolve with `true` on success or `false` when an error - * occurs. When no item for `$key` is found in the cache, it also resolves - * to `true`. If the cache implementation has to go over the network to - * delete it, it may take a while. - * - * ```php - * $cache->delete('foo'); - * ``` - * - * This example eventually deletes the key `foo` from the cache. As with - * `set()`, this may not happen instantly and a promise is returned to - * provide guarantees whether or not the item has been removed from cache. - * - * @param string $key - * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error - */ - public function delete($key); - - /** - * Retrieves multiple cache items by their unique keys. - * - * This method will resolve with an array of cached values on success or with the - * given `$default` value when an item can not be found or when an error occurs. - * Similarly, an expired cache item (once the time-to-live is expired) is - * considered a cache miss. - * - * ```php - * $cache->getMultiple(array('name', 'age'))->then(function (array $values) { - * $name = $values['name'] ?? 'User'; - * $age = $values['age'] ?? 'n/a'; - * - * echo $name . ' is ' . $age . PHP_EOL; - * }); - * ``` - * - * This example fetches the cache items for the `name` and `age` keys and - * prints some example output. You can use any of the composition provided - * by [promises](https://github.com/reactphp/promise). - * - * @param string[] $keys A list of keys that can obtained in a single operation. - * @param mixed $default Default value to return for keys that do not exist. - * @return PromiseInterface Returns a promise which resolves to an `array` of cached values - */ - public function getMultiple(array $keys, $default = null); - - /** - * Persists a set of key => value pairs in the cache, with an optional TTL. - * - * This method will resolve with `true` on success or `false` when an error - * occurs. If the cache implementation has to go over the network to store - * it, it may take a while. - * - * The optional `$ttl` parameter sets the maximum time-to-live in seconds - * for these cache items. If this parameter is omitted (or `null`), these items - * will stay in the cache for as long as the underlying implementation - * supports. Trying to access an expired cache items results in a cache miss, - * see also [`get()`](#get). - * - * ```php - * $cache->setMultiple(array('foo' => 1, 'bar' => 2), 60); - * ``` - * - * This example eventually sets the list of values - the key `foo` to 1 value - * and the key `bar` to 2. If some of the keys already exist, they are overridden. - * - * @param array $values A list of key => value pairs for a multiple-set operation. - * @param ?float $ttl Optional. The TTL value of this item. - * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error - */ - public function setMultiple(array $values, $ttl = null); - - /** - * Deletes multiple cache items in a single operation. - * - * @param string[] $keys A list of string-based keys to be deleted. - * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error - */ - public function deleteMultiple(array $keys); - - /** - * Wipes clean the entire cache. - * - * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error - */ - public function clear(); - - /** - * Determines whether an item is present in the cache. - * - * This method will resolve with `true` on success or `false` when no item can be found - * or when an error occurs. Similarly, an expired cache item (once the time-to-live - * is expired) is considered a cache miss. - * - * ```php - * $cache - * ->has('foo') - * ->then('var_dump'); - * ``` - * - * This example checks if the value of the key `foo` is set in the cache and passes - * the result to the `var_dump` function. You can use any of the composition provided by - * [promises](https://github.com/reactphp/promise). - * - * NOTE: It is recommended that has() is only to be used for cache warming type purposes - * and not to be used within your live applications operations for get/set, as this method - * is subject to a race condition where your has() will return true and immediately after, - * another script can remove it making the state of your app out of date. - * - * @param string $key The cache item key. - * @return PromiseInterface Returns a promise which resolves to `true` on success or `false` on error - */ - public function has($key); -} diff --git a/tools/php-cs-fixer/vendor/react/child-process/CHANGELOG.md b/tools/php-cs-fixer/vendor/react/child-process/CHANGELOG.md deleted file mode 100644 index 5ad759d4..00000000 --- a/tools/php-cs-fixer/vendor/react/child-process/CHANGELOG.md +++ /dev/null @@ -1,176 +0,0 @@ -# Changelog - -## 0.6.6 (2025-01-01) - -This is a compatibility release that contains backported features from the `0.7.x` branch. -Once v0.7 is released, it will be the way forward for this project. - -* Feature: Improve PHP 8.4+ support by avoiding implicitly nullable types. - (#114 by @clue) - -* Improve test suite to run tests on latest PHP versions and report failed assertions. - (#113 by @clue) - -## 0.6.5 (2022-09-16) - -* Feature: Full support for PHP 8.1 and PHP 8.2 release. - (#91 by @SimonFrings and #99 by @WyriHaximus) - -* Feature / Fix: Improve error reporting when custom error handler is used. - (#94 by @clue) - -* Minor documentation improvements. - (#92 by @SimonFrings and #95 by @nhedger) - -* Improve test suite, skip failing tests on bugged versions and fix legacy HHVM build. - (#96 and #98 by @clue and #93 by @SimonFrings) - -## 0.6.4 (2021-10-12) - -* Feature / Fix: Skip sigchild check if `phpinfo()` has been disabled. - (#89 by @clue) - -* Fix: Fix detecting closed socket pipes on PHP 8. - (#90 by @clue) - -## 0.6.3 (2021-07-11) - -A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). - -* Feature: Simplify usage by supporting new [default loop](https://reactphp.org/event-loop/#loop). - (#87 by @clue) - - ```php - // old (still supported) - $process = new React\ChildProcess\Process($command); - $process->start($loop); - - // new (using default loop) - $process = new React\ChildProcess\Process($command); - $process->start(); - ``` - -## 0.6.2 (2021-02-05) - -* Feature: Support PHP 8 and add non-blocking I/O support on Windows with PHP 8. - (#85 by @clue) - -* Minor documentation improvements. - (#78 by @WyriHaximus and #80 by @gdejong) - -* Improve test suite and add `.gitattributes` to exclude dev files from exports. - Run tests on PHPUnit 9, switch to GitHub actions and clean up test suite. - (#75 by @reedy, #81 by @gdejong, #82 by @SimonFrings and #84 by @clue) - -## 0.6.1 (2019-02-15) - -* Feature / Fix: Improve error reporting when spawning child process fails. - (#73 by @clue) - -## 0.6.0 (2019-01-14) - -A major feature release with some minor API improvements! -This project now has limited Windows support and supports passing custom pipes -and file descriptors to the child process. - -This update involves a few minor BC breaks. We've tried hard to avoid BC breaks -where possible and minimize impact otherwise. We expect that most consumers of -this package will actually not be affected by any BC breaks, see below for more -details. - -* Feature / BC break: Support passing custom pipes and file descriptors to child process, - expose all standard I/O pipes in an array and remove unused Windows-only options. - (#62, #64 and #65 by @clue) - - > BC note: The optional `$options` parameter in the `Process` constructor - has been removed and a new `$fds` parameter has been added instead. The - previous `$options` parameter was Windows-only, available options were not - documented or referenced anywhere else in this library, so its actual - impact is expected to be relatively small. See the documentation and the - following changelog entry if you're looking for Windows support. - -* Feature: Support spawning child process on Windows without process I/O pipes. - (#67 by @clue) - -* Feature / BC break: Improve sigchild compatibility and support explicit configuration. - (#63 by @clue) - - ```php - // advanced: not recommended by default - Process::setSigchildEnabled(true); - ``` - - > BC note: The old public sigchild methods have been removed, but its - practical impact is believed to be relatively small due to the automatic detection. - -* Improve performance by prefixing all global functions calls with \ to skip - the look up and resolve process and go straight to the global function. - (#68 by @WyriHaximus) - -* Minor documentation improvements and docblock updates. - (#59 by @iamluc and #69 by @CharlotteDunois) - -* Improve test suite to test against PHP7.2 and PHP 7.3, improve HHVM compatibility, - add forward compatibility with PHPUnit 7 and run tests on Windows via Travis CI. - (#66 and #71 by @clue) - -## 0.5.2 (2018-01-18) - -* Feature: Detect "exit" immediately if last process pipe is closed - (#58 by @clue) - - This introduces a simple check to see if the program is already known to be - closed when the last process pipe is closed instead of relying on a periodic - timer. This simple change improves "exit" detection significantly for most - programs and does not cause a noticeable penalty for more advanced use cases. - -* Fix forward compatibility with upcoming EventLoop releases - (#56 by @clue) - -## 0.5.1 (2017-12-22) - -* Fix: Update Stream dependency to work around SEGFAULT in legacy PHP < 5.4.28 - and PHP < 5.5.12 - (#50 and #52 by @clue) - -* Improve test suite by simplifying test bootstrapping logic via Composer and - adding forward compatibility with PHPUnit 6 - (#53, #54 and #55 by @clue) - -## 0.5.0 (2017-08-15) - -* Forward compatibility: react/event-loop 1.0 and 0.5, react/stream 0.7.2 and 1.0, and Événement 3.0 - (#38 and #44 by @WyriHaximus, and #46 by @clue) -* Windows compatibility: Documentate that windows isn't supported in 0.5 unless used from within WSL - (#41 and #47 by @WyriHaximus) -* Documentation: Termination examples - (#42 by @clue) -* BC: Throw LogicException in Process instanciating when on Windows or when proc_open is missing (was `RuntimeException`) - (#49 by @mdrost) - -## 0.4.3 (2017-03-14) - -* Ease getting started by improving documentation and adding examples - (#33 and #34 by @clue) - -* First class support for PHP 5.3 through PHP 7.1 and HHVM - (#29 by @clue and #32 by @WyriHaximus) - -## 0.4.2 (2017-03-10) - -* Feature: Forward compatibility with Stream v0.5 - (#26 by @clue) - -* Improve test suite by removing AppVeyor and adding PHPUnit to `require-dev` - (#27 and #28 by @clue) - -## 0.4.1 (2016-08-01) - -* Standalone component -* Test against PHP 7 and HHVM, report test coverage, AppVeyor tests -* Wait for stdout and stderr to close before watching for process exit - (#18 by @mbonneau) - -## 0.4.0 (2014-02-02) - -* Feature: Added ChildProcess to run async child processes within the event loop (@jmikola) diff --git a/tools/php-cs-fixer/vendor/react/child-process/LICENSE b/tools/php-cs-fixer/vendor/react/child-process/LICENSE deleted file mode 100644 index d6f8901f..00000000 --- a/tools/php-cs-fixer/vendor/react/child-process/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/child-process/README.md b/tools/php-cs-fixer/vendor/react/child-process/README.md deleted file mode 100644 index bea72041..00000000 --- a/tools/php-cs-fixer/vendor/react/child-process/README.md +++ /dev/null @@ -1,619 +0,0 @@ -# ChildProcess - -[![CI status](https://github.com/reactphp/child-process/actions/workflows/ci.yml/badge.svg)](https://github.com/reactphp/child-process/actions) -[![installs on Packagist](https://img.shields.io/packagist/dt/react/child-process?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/child-process) - -Event-driven library for executing child processes with -[ReactPHP](https://reactphp.org/). - -This library integrates [Program Execution](http://php.net/manual/en/book.exec.php) -with the [EventLoop](https://github.com/reactphp/event-loop). -Child processes launched may be signaled and will emit an -`exit` event upon termination. -Additionally, process I/O streams (i.e. STDIN, STDOUT, STDERR) are exposed -as [Streams](https://github.com/reactphp/stream). - -**Table of contents** - -* [Quickstart example](#quickstart-example) -* [Process](#process) - * [Stream Properties](#stream-properties) - * [Command](#command) - * [Termination](#termination) - * [Custom pipes](#custom-pipes) - * [Sigchild Compatibility](#sigchild-compatibility) - * [Windows Compatibility](#windows-compatibility) -* [Install](#install) -* [Tests](#tests) -* [License](#license) - -## Quickstart example - -```php -$process = new React\ChildProcess\Process('echo foo'); -$process->start(); - -$process->stdout->on('data', function ($chunk) { - echo $chunk; -}); - -$process->on('exit', function($exitCode, $termSignal) { - echo 'Process exited with code ' . $exitCode . PHP_EOL; -}); -``` - -See also the [examples](examples). - -## Process - -### Stream Properties - -Once a process is started, its I/O streams will be constructed as instances of -`React\Stream\ReadableStreamInterface` and `React\Stream\WritableStreamInterface`. -Before `start()` is called, these properties are not set. Once a process terminates, -the streams will become closed but not unset. - -Following common Unix conventions, this library will start each child process -with the three pipes matching the standard I/O streams as given below by default. -You can use the named references for common use cases or access these as an -array with all three pipes. - -* `$stdin` or `$pipes[0]` is a `WritableStreamInterface` -* `$stdout` or `$pipes[1]` is a `ReadableStreamInterface` -* `$stderr` or `$pipes[2]` is a `ReadableStreamInterface` - -Note that this default configuration may be overridden by explicitly passing -[custom pipes](#custom-pipes), in which case they may not be set or be assigned -different values. In particular, note that [Windows support](#windows-compatibility) -is limited in that it doesn't support non-blocking STDIO pipes. The `$pipes` -array will always contain references to all pipes as configured and the standard -I/O references will always be set to reference the pipes matching the above -conventions. See [custom pipes](#custom-pipes) for more details. - -Because each of these implement the underlying -[`ReadableStreamInterface`](https://github.com/reactphp/stream#readablestreaminterface) or -[`WritableStreamInterface`](https://github.com/reactphp/stream#writablestreaminterface), -you can use any of their events and methods as usual: - -```php -$process = new Process($command); -$process->start(); - -$process->stdout->on('data', function ($chunk) { - echo $chunk; -}); - -$process->stdout->on('end', function () { - echo 'ended'; -}); - -$process->stdout->on('error', function (Exception $e) { - echo 'error: ' . $e->getMessage(); -}); - -$process->stdout->on('close', function () { - echo 'closed'; -}); - -$process->stdin->write($data); -$process->stdin->end($data = null); -// … -``` - -For more details, see the -[`ReadableStreamInterface`](https://github.com/reactphp/stream#readablestreaminterface) and -[`WritableStreamInterface`](https://github.com/reactphp/stream#writablestreaminterface). - -### Command - -The `Process` class allows you to pass any kind of command line string: - -```php -$process = new Process('echo test'); -$process->start(); -``` - -The command line string usually consists of a whitespace-separated list with -your main executable bin and any number of arguments. Special care should be -taken to escape or quote any arguments, escpecially if you pass any user input -along. Likewise, keep in mind that especially on Windows, it is rather common to -have path names containing spaces and other special characters. If you want to -run a binary like this, you will have to ensure this is quoted as a single -argument using `escapeshellarg()` like this: - -```php -$bin = 'C:\\Program files (x86)\\PHP\\php.exe'; -$file = 'C:\\Users\\me\\Desktop\\Application\\main.php'; - -$process = new Process(escapeshellarg($bin) . ' ' . escapeshellarg($file)); -$process->start(); -``` - -By default, PHP will launch processes by wrapping the given command line string -in a `sh` command on Unix, so that the first example will actually execute -`sh -c echo test` under the hood on Unix. On Windows, it will not launch -processes by wrapping them in a shell. - -This is a very useful feature because it does not only allow you to pass single -commands, but actually allows you to pass any kind of shell command line and -launch multiple sub-commands using command chains (with `&&`, `||`, `;` and -others) and allows you to redirect STDIO streams (with `2>&1` and family). -This can be used to pass complete command lines and receive the resulting STDIO -streams from the wrapping shell command like this: - -```php -$process = new Process('echo run && demo || echo failed'); -$process->start(); -``` - -> Note that [Windows support](#windows-compatibility) is limited in that it - doesn't support STDIO streams at all and also that processes will not be run - in a wrapping shell by default. If you want to run a shell built-in function - such as `echo hello` or `sleep 10`, you may have to prefix your command line - with an explicit shell like `cmd /c echo hello`. - -In other words, the underlying shell is responsible for managing this command -line and launching the individual sub-commands and connecting their STDIO -streams as appropriate. -This implies that the `Process` class will only receive the resulting STDIO -streams from the wrapping shell, which will thus contain the complete -input/output with no way to discern the input/output of single sub-commands. - -If you want to discern the output of single sub-commands, you may want to -implement some higher-level protocol logic, such as printing an explicit -boundary between each sub-command like this: - -```php -$process = new Process('cat first && echo --- && cat second'); -$process->start(); -``` - -As an alternative, considering launching one process at a time and listening on -its `exit` event to conditionally start the next process in the chain. -This will give you an opportunity to configure the subsequent process I/O streams: - -```php -$first = new Process('cat first'); -$first->start(); - -$first->on('exit', function () { - $second = new Process('cat second'); - $second->start(); -}); -``` - -Keep in mind that PHP uses the shell wrapper for ALL command lines on Unix. -While this may seem reasonable for more complex command lines, this actually -also applies to running the most simple single command: - -```php -$process = new Process('yes'); -$process->start(); -``` - -This will actually spawn a command hierarchy similar to this on Unix: - -``` -5480 … \_ php example.php -5481 … \_ sh -c yes -5482 … \_ yes -``` - -This means that trying to get the underlying process PID or sending signals -will actually target the wrapping shell, which may not be the desired result -in many cases. - -If you do not want this wrapping shell process to show up, you can simply -prepend the command string with `exec` on Unix platforms, which will cause the -wrapping shell process to be replaced by our process: - -```php -$process = new Process('exec yes'); -$process->start(); -``` - -This will show a resulting command hierarchy similar to this: - -``` -5480 … \_ php example.php -5481 … \_ yes -``` - -This means that trying to get the underlying process PID and sending signals -will now target the actual command as expected. - -Note that in this case, the command line will not be run in a wrapping shell. -This implies that when using `exec`, there's no way to pass command lines such -as those containing command chains or redirected STDIO streams. - -As a rule of thumb, most commands will likely run just fine with the wrapping -shell. -If you pass a complete command line (or are unsure), you SHOULD most likely keep -the wrapping shell. -If you're running on Unix and you want to pass an invidual command only, you MAY -want to consider prepending the command string with `exec` to avoid the wrapping shell. - -### Termination - -The `exit` event will be emitted whenever the process is no longer running. -Event listeners will receive the exit code and termination signal as two -arguments: - -```php -$process = new Process('sleep 10'); -$process->start(); - -$process->on('exit', function ($code, $term) { - if ($term === null) { - echo 'exit with code ' . $code . PHP_EOL; - } else { - echo 'terminated with signal ' . $term . PHP_EOL; - } -}); -``` - -Note that `$code` is `null` if the process has terminated, but the exit -code could not be determined (for example -[sigchild compatibility](#sigchild-compatibility) was disabled). -Similarly, `$term` is `null` unless the process has terminated in response to -an uncaught signal sent to it. -This is not a limitation of this project, but actual how exit codes and signals -are exposed on POSIX systems, for more details see also -[here](https://unix.stackexchange.com/questions/99112/default-exit-code-when-process-is-terminated). - -It's also worth noting that process termination depends on all file descriptors -being closed beforehand. -This means that all [process pipes](#stream-properties) will emit a `close` -event before the `exit` event and that no more `data` events will arrive after -the `exit` event. -Accordingly, if either of these pipes is in a paused state (`pause()` method -or internally due to a `pipe()` call), this detection may not trigger. - -The `terminate(?int $signal = null): bool` method can be used to send the -process a signal (SIGTERM by default). -Depending on which signal you send to the process and whether it has a signal -handler registered, this can be used to either merely signal a process or even -forcefully terminate it. - -```php -$process->terminate(SIGUSR1); -``` - -Keep the above section in mind if you want to forcefully terminate a process. -If your process spawn sub-processes or implicitly uses the -[wrapping shell mentioned above](#command), its file descriptors may be -inherited to child processes and terminating the main process may not -necessarily terminate the whole process tree. -It is highly suggested that you explicitly `close()` all process pipes -accordingly when terminating a process: - -```php -$process = new Process('sleep 10'); -$process->start(); - -Loop::addTimer(2.0, function () use ($process) { - foreach ($process->pipes as $pipe) { - $pipe->close(); - } - $process->terminate(); -}); -``` - -For many simple programs these seamingly complicated steps can also be avoided -by prefixing the command line with `exec` to avoid the wrapping shell and its -inherited process pipes as [mentioned above](#command). - -```php -$process = new Process('exec sleep 10'); -$process->start(); - -Loop::addTimer(2.0, function () use ($process) { - $process->terminate(); -}); -``` - -Many command line programs also wait for data on `STDIN` and terminate cleanly -when this pipe is closed. -For example, the following can be used to "soft-close" a `cat` process: - -```php -$process = new Process('cat'); -$process->start(); - -Loop::addTimer(2.0, function () use ($process) { - $process->stdin->end(); -}); -``` - -While process pipes and termination may seem confusing to newcomers, the above -properties actually allow some fine grained control over process termination, -such as first trying a soft-close and then applying a force-close after a -timeout. - -### Custom pipes - -Following common Unix conventions, this library will start each child process -with the three pipes matching the standard I/O streams by default. For more -advanced use cases it may be useful to pass in custom pipes, such as explicitly -passing additional file descriptors (FDs) or overriding default process pipes. - -Note that passing custom pipes is considered advanced usage and requires a -more in-depth understanding of Unix file descriptors and how they are inherited -to child processes and shared in multi-processing applications. - -If you do not want to use the default standard I/O pipes, you can explicitly -pass an array containing the file descriptor specification to the constructor -like this: - -```php -$fds = array( - // standard I/O pipes for stdin/stdout/stderr - 0 => array('pipe', 'r'), - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w'), - - // example FDs for files or open resources - 4 => array('file', '/dev/null', 'r'), - 6 => fopen('log.txt','a'), - 8 => STDERR, - - // example FDs for sockets - 10 => fsockopen('localhost', 8080), - 12 => stream_socket_server('tcp://0.0.0.0:4711') -); - -$process = new Process($cmd, null, null, $fds); -$process->start(); -``` - -Unless your use case has special requirements that demand otherwise, you're -highly recommended to (at least) pass in the standard I/O pipes as given above. -The file descriptor specification accepts arguments in the exact same format -as the underlying [`proc_open()`](http://php.net/proc_open) function. - -Once the process is started, the `$pipes` array will always contain references to -all pipes as configured and the standard I/O references will always be set to -reference the pipes matching common Unix conventions. This library supports any -number of pipes and additional file descriptors, but many common applications -being run as a child process will expect that the parent process properly -assigns these file descriptors. - -### Sigchild Compatibility - -Internally, this project uses a work-around to improve compatibility when PHP -has been compiled with the `--enable-sigchild` option. This should not affect most -installations as this configure option is not used by default and many -distributions (such as Debian and Ubuntu) are known to not use this by default. -Some installations that use [Oracle OCI8](http://php.net/manual/en/book.oci8.php) -may use this configure option to circumvent `defunct` processes. - -When PHP has been compiled with the `--enable-sigchild` option, a child process' -exit code cannot be reliably determined via `proc_close()` or `proc_get_status()`. -To work around this, we execute the child process with an additional pipe and -use that to retrieve its exit code. - -This work-around incurs some overhead, so we only trigger this when necessary -and when we detect that PHP has been compiled with the `--enable-sigchild` option. -Because PHP does not provide a way to reliably detect this option, we try to -inspect output of PHP's configure options from the `phpinfo()` function. - -The static `setSigchildEnabled(bool $sigchild): void` method can be used to -explicitly enable or disable this behavior like this: - -```php -// advanced: not recommended by default -Process::setSigchildEnabled(true); -``` - -Note that all processes instantiated after this method call will be affected. -If this work-around is disabled on an affected PHP installation, the `exit` -event may receive `null` instead of the actual exit code as described above. -Similarly, some distributions are known to omit the configure options from -`phpinfo()`, so automatic detection may fail to enable this work-around in some -cases. You may then enable this explicitly as given above. - -**Note:** The original functionality was taken from Symfony's -[Process](https://github.com/symfony/process) compoment. - -### Windows Compatibility - -Due to platform constraints, this library provides only limited support for -spawning child processes on Windows. In particular, PHP does not allow accessing -standard I/O pipes on Windows without blocking. As such, this project will not -allow constructing a child process with the default process pipes and will -instead throw a `LogicException` on Windows by default: - -```php -// throws LogicException on Windows -$process = new Process('ping example.com'); -$process->start(); -``` - -There are a number of alternatives and workarounds as detailed below if you want -to run a child process on Windows, each with its own set of pros and cons: - -* As of PHP 8, you can start the child process with `socket` pair descriptors - in place of normal standard I/O pipes like this: - - ```php - $process = new Process( - 'ping example.com', - null, - null, - [ - ['socket'], - ['socket'], - ['socket'] - ] - ); - $process->start(); - - $process->stdout->on('data', function ($chunk) { - echo $chunk; - }); - ``` - - These `socket` pairs support non-blocking process I/O on any platform, - including Windows. However, not all programs accept stdio sockets. - -* This package does work on - [`Windows Subsystem for Linux`](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) - (or WSL) without issues. When you are in control over how your application is - deployed, we recommend [installing WSL](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide) - when you want to run this package on Windows. - -* If you only care about the exit code of a child process to check if its - execution was successful, you can use [custom pipes](#custom-pipes) to omit - any standard I/O pipes like this: - - ```php - $process = new Process('ping example.com', null, null, array()); - $process->start(); - - $process->on('exit', function ($exitcode) { - echo 'exit with ' . $exitcode . PHP_EOL; - }); - ``` - - Similarly, this is also useful if your child process communicates over - sockets with remote servers or even your parent process using the - [Socket component](https://github.com/reactphp/socket). This is usually - considered the best alternative if you have control over how your child - process communicates with the parent process. - -* If you only care about command output after the child process has been - executed, you can use [custom pipes](#custom-pipes) to configure file - handles to be passed to the child process instead of pipes like this: - - ```php - $process = new Process('ping example.com', null, null, array( - array('file', 'nul', 'r'), - $stdout = tmpfile(), - array('file', 'nul', 'w') - )); - $process->start(); - - $process->on('exit', function ($exitcode) use ($stdout) { - echo 'exit with ' . $exitcode . PHP_EOL; - - // rewind to start and then read full file (demo only, this is blocking). - // reading from shared file is only safe if you have some synchronization in place - // or after the child process has terminated. - rewind($stdout); - echo stream_get_contents($stdout); - fclose($stdout); - }); - ``` - - Note that this example uses `tmpfile()`/`fopen()` for illustration purposes only. - This should not be used in a truly async program because the filesystem is - inherently blocking and each call could potentially take several seconds. - See also the [Filesystem component](https://github.com/reactphp/filesystem) as an - alternative. - -* If you want to access command output as it happens in a streaming fashion, - you can use redirection to spawn an additional process to forward your - standard I/O streams to a socket and use [custom pipes](#custom-pipes) to - omit any actual standard I/O pipes like this: - - ```php - $server = new React\Socket\Server('127.0.0.1:0'); - $server->on('connection', function (React\Socket\ConnectionInterface $connection) { - $connection->on('data', function ($chunk) { - echo $chunk; - }); - }); - - $command = 'ping example.com | foobar ' . escapeshellarg($server->getAddress()); - $process = new Process($command, null, null, array()); - $process->start(); - - $process->on('exit', function ($exitcode) use ($server) { - $server->close(); - echo 'exit with ' . $exitcode . PHP_EOL; - }); - ``` - - Note how this will spawn another fictional `foobar` helper program to consume - the standard output from the actual child process. This is in fact similar - to the above recommendation of using socket connections in the child process, - but in this case does not require modification of the actual child process. - - In this example, the fictional `foobar` helper program can be implemented by - simply consuming all data from standard input and forwarding it to a socket - connection like this: - - ```php - $socket = stream_socket_client($argv[1]); - do { - fwrite($socket, $data = fread(STDIN, 8192)); - } while (isset($data[0])); - ``` - - Accordingly, this example can also be run with plain PHP without having to - rely on any external helper program like this: - - ```php - $code = '$s=stream_socket_client($argv[1]);do{fwrite($s,$d=fread(STDIN, 8192));}while(isset($d[0]));'; - $command = 'ping example.com | php -r ' . escapeshellarg($code) . ' ' . escapeshellarg($server->getAddress()); - $process = new Process($command, null, null, array()); - $process->start(); - ``` - - See also [example #23](examples/23-forward-socket.php). - - Note that this is for illustration purposes only and you may want to implement - some proper error checks and/or socket verification in actual production use - if you do not want to risk other processes connecting to the server socket. - In this case, we suggest looking at the excellent - [createprocess-windows](https://github.com/cubiclesoft/createprocess-windows). - -Additionally, note that the [command](#command) given to the `Process` will be -passed to the underlying Windows-API -([`CreateProcess`](https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa)) -as-is and the process will not be launched in a wrapping shell by default. In -particular, this means that shell built-in functions such as `echo hello` or -`sleep 10` may have to be prefixed with an explicit shell command like this: - -```php -$process = new Process('cmd /c echo hello', null, null, $pipes); -$process->start(); -``` - -## Install - -The recommended way to install this library is [through Composer](https://getcomposer.org/). -[New to Composer?](https://getcomposer.org/doc/00-intro.md) - -This will install the latest supported version: - -```bash -composer require react/child-process:^0.6.6 -``` - -See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. - -This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.3 through current PHP 8+ and HHVM. -It's *highly recommended to use the latest supported PHP version* for this project. - -See above note for limited [Windows Compatibility](#windows-compatibility). - -## Tests - -To run the test suite, you first need to clone this repo and then install all -dependencies [through Composer](https://getcomposer.org/): - -```bash -composer install -``` - -To run the test suite, go to the project root and run: - -```bash -vendor/bin/phpunit -``` - -## License - -MIT, see [LICENSE file](LICENSE). diff --git a/tools/php-cs-fixer/vendor/react/child-process/composer.json b/tools/php-cs-fixer/vendor/react/child-process/composer.json deleted file mode 100644 index fba70b88..00000000 --- a/tools/php-cs-fixer/vendor/react/child-process/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "react/child-process", - "description": "Event-driven library for executing child processes with ReactPHP.", - "keywords": ["process", "event-driven", "ReactPHP"], - "license": "MIT", - "authors": [ - { - "name": "Christian Lück", - "homepage": "https://clue.engineering/", - "email": "christian@clue.engineering" - }, - { - "name": "Cees-Jan Kiewiet", - "homepage": "https://wyrihaximus.net/", - "email": "reactphp@ceesjankiewiet.nl" - }, - { - "name": "Jan Sorgalla", - "homepage": "https://sorgalla.com/", - "email": "jsorgalla@gmail.com" - }, - { - "name": "Chris Boden", - "homepage": "https://cboden.dev/", - "email": "cboden@gmail.com" - } - ], - "require": { - "php": ">=5.3.0", - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "react/event-loop": "^1.2", - "react/stream": "^1.4" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/socket": "^1.16", - "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" - }, - "autoload": { - "psr-4": { - "React\\ChildProcess\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "React\\Tests\\ChildProcess\\": "tests/" - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/child-process/src/Process.php b/tools/php-cs-fixer/vendor/react/child-process/src/Process.php deleted file mode 100644 index 7af5de75..00000000 --- a/tools/php-cs-fixer/vendor/react/child-process/src/Process.php +++ /dev/null @@ -1,585 +0,0 @@ -start(); - * - * $process->on('exit', function ($code, $term) { - * if ($term === null) { - * echo 'exit with code ' . $code . PHP_EOL; - * } else { - * echo 'terminated with signal ' . $term . PHP_EOL; - * } - * }); - * ``` - * - * Note that `$code` is `null` if the process has terminated, but the exit - * code could not be determined (for example - * [sigchild compatibility](#sigchild-compatibility) was disabled). - * Similarly, `$term` is `null` unless the process has terminated in response to - * an uncaught signal sent to it. - * This is not a limitation of this project, but actual how exit codes and signals - * are exposed on POSIX systems, for more details see also - * [here](https://unix.stackexchange.com/questions/99112/default-exit-code-when-process-is-terminated). - * - * It's also worth noting that process termination depends on all file descriptors - * being closed beforehand. - * This means that all [process pipes](#stream-properties) will emit a `close` - * event before the `exit` event and that no more `data` events will arrive after - * the `exit` event. - * Accordingly, if either of these pipes is in a paused state (`pause()` method - * or internally due to a `pipe()` call), this detection may not trigger. - */ -class Process extends EventEmitter -{ - /** - * @var WritableStreamInterface|null|DuplexStreamInterface|ReadableStreamInterface - */ - public $stdin; - - /** - * @var ReadableStreamInterface|null|DuplexStreamInterface|WritableStreamInterface - */ - public $stdout; - - /** - * @var ReadableStreamInterface|null|DuplexStreamInterface|WritableStreamInterface - */ - public $stderr; - - /** - * Array with all process pipes (once started) - * - * Unless explicitly configured otherwise during construction, the following - * standard I/O pipes will be assigned by default: - * - 0: STDIN (`WritableStreamInterface`) - * - 1: STDOUT (`ReadableStreamInterface`) - * - 2: STDERR (`ReadableStreamInterface`) - * - * @var array - */ - public $pipes = array(); - - private $cmd; - private $cwd; - private $env; - private $fds; - - private $enhanceSigchildCompatibility; - private $sigchildPipe; - - private $process; - private $status; - private $exitCode; - private $fallbackExitCode; - private $stopSignal; - private $termSignal; - - private static $sigchild; - - /** - * Constructor. - * - * @param string $cmd Command line to run - * @param null|string $cwd Current working directory or null to inherit - * @param null|array $env Environment variables or null to inherit - * @param null|array $fds File descriptors to allocate for this process (or null = default STDIO streams) - * @throws \LogicException On windows or when proc_open() is not installed - */ - public function __construct($cmd, $cwd = null, $env = null, $fds = null) - { - if ($env !== null && !\is_array($env)) { // manual type check to support legacy PHP < 7.1 - throw new \InvalidArgumentException('Argument #3 ($env) expected null|array'); - } - if ($fds !== null && !\is_array($fds)) { // manual type check to support legacy PHP < 7.1 - throw new \InvalidArgumentException('Argument #4 ($fds) expected null|array'); - } - if (!\function_exists('proc_open')) { - throw new \LogicException('The Process class relies on proc_open(), which is not available on your PHP installation.'); - } - - $this->cmd = $cmd; - $this->cwd = $cwd; - - if (null !== $env) { - $this->env = array(); - foreach ($env as $key => $value) { - $this->env[(binary) $key] = (binary) $value; - } - } - - if ($fds === null) { - $fds = array( - array('pipe', 'r'), // stdin - array('pipe', 'w'), // stdout - array('pipe', 'w'), // stderr - ); - } - - if (\DIRECTORY_SEPARATOR === '\\') { - foreach ($fds as $fd) { - if (isset($fd[0]) && $fd[0] === 'pipe') { - throw new \LogicException('Process pipes are not supported on Windows due to their blocking nature on Windows'); - } - } - } - - $this->fds = $fds; - $this->enhanceSigchildCompatibility = self::isSigchildEnabled(); - } - - /** - * Start the process. - * - * After the process is started, the standard I/O streams will be constructed - * and available via public properties. - * - * This method takes an optional `LoopInterface|null $loop` parameter that can be used to - * pass the event loop instance to use for this process. You can use a `null` value - * here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). - * This value SHOULD NOT be given unless you're sure you want to explicitly use a - * given event loop instance. - * - * @param ?LoopInterface $loop Loop interface for stream construction - * @param float $interval Interval to periodically monitor process state (seconds) - * @throws \RuntimeException If the process is already running or fails to start - */ - public function start($loop = null, $interval = 0.1) - { - if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 - throw new \InvalidArgumentException('Argument #1 ($loop) expected null|React\EventLoop\LoopInterface'); - } - if ($this->isRunning()) { - throw new \RuntimeException('Process is already running'); - } - - $loop = $loop ?: Loop::get(); - $cmd = $this->cmd; - $fdSpec = $this->fds; - $sigchild = null; - - // Read exit code through fourth pipe to work around --enable-sigchild - if ($this->enhanceSigchildCompatibility) { - $fdSpec[] = array('pipe', 'w'); - \end($fdSpec); - $sigchild = \key($fdSpec); - - // make sure this is fourth or higher (do not mess with STDIO) - if ($sigchild < 3) { - $fdSpec[3] = $fdSpec[$sigchild]; - unset($fdSpec[$sigchild]); - $sigchild = 3; - } - - $cmd = \sprintf('(%s) ' . $sigchild . '>/dev/null; code=$?; echo $code >&' . $sigchild . '; exit $code', $cmd); - } - - // on Windows, we do not launch the given command line in a shell (cmd.exe) by default and omit any error dialogs - // the cmd.exe shell can explicitly be given as part of the command as detailed in both documentation and tests - $options = array(); - if (\DIRECTORY_SEPARATOR === '\\') { - $options['bypass_shell'] = true; - $options['suppress_errors'] = true; - } - - $errstr = ''; - \set_error_handler(function ($_, $error) use (&$errstr) { - // Match errstr from PHP's warning message. - // proc_open(/dev/does-not-exist): Failed to open stream: No such file or directory - $errstr = $error; - }); - - $pipes = array(); - $this->process = @\proc_open($cmd, $fdSpec, $pipes, $this->cwd, $this->env, $options); - - \restore_error_handler(); - - if (!\is_resource($this->process)) { - throw new \RuntimeException('Unable to launch a new process: ' . $errstr); - } - - // count open process pipes and await close event for each to drain buffers before detecting exit - $that = $this; - $closeCount = 0; - $streamCloseHandler = function () use (&$closeCount, $loop, $interval, $that) { - $closeCount--; - - if ($closeCount > 0) { - return; - } - - // process already closed => report immediately - if (!$that->isRunning()) { - $that->close(); - $that->emit('exit', array($that->getExitCode(), $that->getTermSignal())); - return; - } - - // close not detected immediately => check regularly - $loop->addPeriodicTimer($interval, function ($timer) use ($that, $loop) { - if (!$that->isRunning()) { - $loop->cancelTimer($timer); - $that->close(); - $that->emit('exit', array($that->getExitCode(), $that->getTermSignal())); - } - }); - }; - - if ($sigchild !== null) { - $this->sigchildPipe = $pipes[$sigchild]; - unset($pipes[$sigchild]); - } - - foreach ($pipes as $n => $fd) { - // use open mode from stream meta data or fall back to pipe open mode for legacy HHVM - $meta = \stream_get_meta_data($fd); - $mode = $meta['mode'] === '' ? ($this->fds[$n][1] === 'r' ? 'w' : 'r') : $meta['mode']; - - if ($mode === 'r+') { - $stream = new DuplexResourceStream($fd, $loop); - $stream->on('close', $streamCloseHandler); - $closeCount++; - } elseif ($mode === 'w') { - $stream = new WritableResourceStream($fd, $loop); - } else { - $stream = new ReadableResourceStream($fd, $loop); - $stream->on('close', $streamCloseHandler); - $closeCount++; - } - $this->pipes[$n] = $stream; - } - - $this->stdin = isset($this->pipes[0]) ? $this->pipes[0] : null; - $this->stdout = isset($this->pipes[1]) ? $this->pipes[1] : null; - $this->stderr = isset($this->pipes[2]) ? $this->pipes[2] : null; - - // immediately start checking for process exit when started without any I/O pipes - if (!$closeCount) { - $streamCloseHandler(); - } - } - - /** - * Close the process. - * - * This method should only be invoked via the periodic timer that monitors - * the process state. - */ - public function close() - { - if ($this->process === null) { - return; - } - - foreach ($this->pipes as $pipe) { - $pipe->close(); - } - - if ($this->enhanceSigchildCompatibility) { - $this->pollExitCodePipe(); - $this->closeExitCodePipe(); - } - - $exitCode = \proc_close($this->process); - $this->process = null; - - if ($this->exitCode === null && $exitCode !== -1) { - $this->exitCode = $exitCode; - } - - if ($this->exitCode === null && $this->status['exitcode'] !== -1) { - $this->exitCode = $this->status['exitcode']; - } - - if ($this->exitCode === null && $this->fallbackExitCode !== null) { - $this->exitCode = $this->fallbackExitCode; - $this->fallbackExitCode = null; - } - } - - /** - * Terminate the process with an optional signal. - * - * @param int $signal Optional signal (default: SIGTERM) - * @return bool Whether the signal was sent successfully - */ - public function terminate($signal = null) - { - if ($this->process === null) { - return false; - } - - if ($signal !== null) { - return \proc_terminate($this->process, $signal); - } - - return \proc_terminate($this->process); - } - - /** - * Get the command string used to launch the process. - * - * @return string - */ - public function getCommand() - { - return $this->cmd; - } - - /** - * Get the exit code returned by the process. - * - * This value is only meaningful if isRunning() has returned false. Null - * will be returned if the process is still running. - * - * Null may also be returned if the process has terminated, but the exit - * code could not be determined (e.g. sigchild compatibility was disabled). - * - * @return int|null - */ - public function getExitCode() - { - return $this->exitCode; - } - - /** - * Get the process ID. - * - * @return int|null - */ - public function getPid() - { - $status = $this->getCachedStatus(); - - return $status !== null ? $status['pid'] : null; - } - - /** - * Get the signal that caused the process to stop its execution. - * - * This value is only meaningful if isStopped() has returned true. Null will - * be returned if the process was never stopped. - * - * @return int|null - */ - public function getStopSignal() - { - return $this->stopSignal; - } - - /** - * Get the signal that caused the process to terminate its execution. - * - * This value is only meaningful if isTerminated() has returned true. Null - * will be returned if the process was never terminated. - * - * @return int|null - */ - public function getTermSignal() - { - return $this->termSignal; - } - - /** - * Return whether the process is still running. - * - * @return bool - */ - public function isRunning() - { - if ($this->process === null) { - return false; - } - - $status = $this->getFreshStatus(); - - return $status !== null ? $status['running'] : false; - } - - /** - * Return whether the process has been stopped by a signal. - * - * @return bool - */ - public function isStopped() - { - $status = $this->getFreshStatus(); - - return $status !== null ? $status['stopped'] : false; - } - - /** - * Return whether the process has been terminated by an uncaught signal. - * - * @return bool - */ - public function isTerminated() - { - $status = $this->getFreshStatus(); - - return $status !== null ? $status['signaled'] : false; - } - - /** - * Return whether PHP has been compiled with the '--enable-sigchild' option. - * - * @see \Symfony\Component\Process\Process::isSigchildEnabled() - * @return bool - */ - public final static function isSigchildEnabled() - { - if (null !== self::$sigchild) { - return self::$sigchild; - } - - if (!\function_exists('phpinfo')) { - return self::$sigchild = false; // @codeCoverageIgnore - } - - \ob_start(); - \phpinfo(INFO_GENERAL); - - return self::$sigchild = false !== \strpos(\ob_get_clean(), '--enable-sigchild'); - } - - /** - * Enable or disable sigchild compatibility mode. - * - * Sigchild compatibility mode is required to get the exit code and - * determine the success of a process when PHP has been compiled with - * the --enable-sigchild option. - * - * @param bool $sigchild - * @return void - */ - public final static function setSigchildEnabled($sigchild) - { - self::$sigchild = (bool) $sigchild; - } - - /** - * Check the fourth pipe for an exit code. - * - * This should only be used if --enable-sigchild compatibility was enabled. - */ - private function pollExitCodePipe() - { - if ($this->sigchildPipe === null) { - return; - } - - $r = array($this->sigchildPipe); - $w = $e = null; - - $n = @\stream_select($r, $w, $e, 0); - - if (1 !== $n) { - return; - } - - $data = \fread($r[0], 8192); - - if (\strlen($data) > 0) { - $this->fallbackExitCode = (int) $data; - } - } - - /** - * Close the fourth pipe used to relay an exit code. - * - * This should only be used if --enable-sigchild compatibility was enabled. - */ - private function closeExitCodePipe() - { - if ($this->sigchildPipe === null) { - return; - } - - \fclose($this->sigchildPipe); - $this->sigchildPipe = null; - } - - /** - * Return the cached process status. - * - * @return array - */ - private function getCachedStatus() - { - if ($this->status === null) { - $this->updateStatus(); - } - - return $this->status; - } - - /** - * Return the updated process status. - * - * @return array - */ - private function getFreshStatus() - { - $this->updateStatus(); - - return $this->status; - } - - /** - * Update the process status, stop/term signals, and exit code. - * - * Stop/term signals are only updated if the process is currently stopped or - * signaled, respectively. Otherwise, signal values will remain as-is so the - * corresponding getter methods may be used at a later point in time. - */ - private function updateStatus() - { - if ($this->process === null) { - return; - } - - $this->status = \proc_get_status($this->process); - - if ($this->status === false) { - throw new \UnexpectedValueException('proc_get_status() failed'); - } - - if ($this->status['stopped']) { - $this->stopSignal = $this->status['stopsig']; - } - - if ($this->status['signaled']) { - $this->termSignal = $this->status['termsig']; - } - - if (!$this->status['running'] && -1 !== $this->status['exitcode']) { - $this->exitCode = $this->status['exitcode']; - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/CHANGELOG.md b/tools/php-cs-fixer/vendor/react/dns/CHANGELOG.md deleted file mode 100644 index bc1055fc..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/CHANGELOG.md +++ /dev/null @@ -1,452 +0,0 @@ -# Changelog - -## 1.13.0 (2024-06-13) - -* Feature: Improve PHP 8.4+ support by avoiding implicitly nullable type declarations. - (#224 by @WyriHaximus) - -## 1.12.0 (2023-11-29) - -* Feature: Full PHP 8.3 compatibility. - (#217 by @sergiy-petrov) - -* Update test environment and avoid unhandled promise rejections. - (#215, #216 and #218 by @clue) - -## 1.11.0 (2023-06-02) - -* Feature: Include timeout logic to avoid dependency on reactphp/promise-timer. - (#213 by @clue) - -* Improve test suite and project setup and report failed assertions. - (#210 by @clue, #212 by @WyriHaximus and #209 and #211 by @SimonFrings) - -## 1.10.0 (2022-09-08) - -* Feature: Full support for PHP 8.2 release. - (#201 by @clue and #207 by @WyriHaximus) - -* Feature: Optimize forward compatibility with Promise v3, avoid hitting autoloader. - (#202 by @clue) - -* Feature / Fix: Improve error reporting when custom error handler is used. - (#197 by @clue) - -* Fix: Fix invalid references in exception stack trace. - (#191 by @clue) - -* Minor documentation improvements. - (#195 by @SimonFrings and #203 by @nhedger) - -* Improve test suite, update to use default loop and new reactphp/async package. - (#204, #205 and #206 by @clue and #196 by @SimonFrings) - -## 1.9.0 (2021-12-20) - -* Feature: Full support for PHP 8.1 release and prepare PHP 8.2 compatibility - by refactoring `Parser` to avoid assigning dynamic properties. - (#188 and #186 by @clue and #184 by @SimonFrings) - -* Feature: Avoid dependency on `ext-filter`. - (#185 by @clue) - -* Feature / Fix: Skip invalid nameserver entries from `resolv.conf` and ignore IPv6 zone IDs. - (#187 by @clue) - -* Feature / Fix: Reduce socket read chunk size for queries over TCP/IP. - (#189 by @clue) - -## 1.8.0 (2021-07-11) - -A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). - -* Feature: Simplify usage by supporting new [default loop](https://reactphp.org/event-loop/#loop). - (#182 by @clue) - - ```php - // old (still supported) - $factory = new React\Dns\Resolver\Factory(); - $resolver = $factory->create($config, $loop); - - // new (using default loop) - $factory = new React\Dns\Resolver\Factory(); - $resolver = $factory->create($config); - ``` - -## 1.7.0 (2021-06-25) - -* Feature: Update DNS `Factory` to accept complete `Config` object. - Add new `FallbackExecutor` and use fallback DNS servers when `Config` lists multiple servers. - (#179 and #180 by @clue) - - ```php - // old (still supported) - $config = React\Dns\Config\Config::loadSystemConfigBlocking(); - $server = $config->nameservers ? reset($config->nameservers) : '8.8.8.8'; - $resolver = $factory->create($server, $loop); - - // new - $config = React\Dns\Config\Config::loadSystemConfigBlocking(); - if (!$config->nameservers) { - $config->nameservers[] = '8.8.8.8'; - } - $resolver = $factory->create($config, $loop); - ``` - -## 1.6.0 (2021-06-21) - -* Feature: Add support for legacy `SPF` record type. - (#178 by @akondas and @clue) - -* Fix: Fix integer overflow for TCP/IP chunk size on 32 bit platforms. - (#177 by @clue) - -## 1.5.0 (2021-03-05) - -* Feature: Improve error reporting when query fails, include domain and query type and DNS server address where applicable. - (#174 by @clue) - -* Feature: Improve error handling when sending data to DNS server fails (macOS). - (#171 and #172 by @clue) - -* Fix: Improve DNS response parser to limit recursion for compressed labels. - (#169 by @clue) - -* Improve test suite, use GitHub actions for continuous integration (CI). - (#170 by @SimonFrings) - -## 1.4.0 (2020-09-18) - -* Feature: Support upcoming PHP 8. - (#168 by @clue) - -* Improve test suite and update to PHPUnit 9.3. - (#164 by @clue, #165 and #166 by @SimonFrings and #167 by @WyriHaximus) - -## 1.3.0 (2020-07-10) - -* Feature: Forward compatibility with react/promise v3. - (#153 by @WyriHaximus) - -* Feature: Support parsing `OPT` records (EDNS0). - (#157 by @clue) - -* Fix: Avoid PHP warnings due to lack of args in exception trace on PHP 7.4. - (#160 by @clue) - -* Improve test suite and add `.gitattributes` to exclude dev files from exports. - Run tests on PHPUnit 9 and PHP 7.4 and clean up test suite. - (#154 by @reedy, #156 by @clue and #163 by @SimonFrings) - -## 1.2.0 (2019-08-15) - -* Feature: Add `TcpTransportExecutor` to send DNS queries over TCP/IP connection, - add `SelectiveTransportExecutor` to retry with TCP if UDP is truncated and - automatically select transport protocol when no explicit `udp://` or `tcp://` scheme is given in `Factory`. - (#145, #146, #147 and #148 by @clue) - -* Feature: Support escaping literal dots and special characters in domain names. - (#144 by @clue) - -## 1.1.0 (2019-07-18) - -* Feature: Support parsing `CAA` and `SSHFP` records. - (#141 and #142 by @clue) - -* Feature: Add `ResolverInterface` as common interface for `Resolver` class. - (#139 by @clue) - -* Fix: Add missing private property definitions and - remove unneeded dependency on `react/stream`. - (#140 and #143 by @clue) - -## 1.0.0 (2019-07-11) - -* First stable LTS release, now following [SemVer](https://semver.org/). - We'd like to emphasize that this component is production ready and battle-tested. - We plan to support all long-term support (LTS) releases for at least 24 months, - so you have a rock-solid foundation to build on top of. - -This update involves a number of BC breaks due to dropped support for -deprecated functionality and some internal API cleanup. We've tried hard to -avoid BC breaks where possible and minimize impact otherwise. We expect that -most consumers of this package will actually not be affected by any BC -breaks, see below for more details: - -* BC break: Delete all deprecated APIs, use `Query` objects for `Message` questions - instead of nested arrays and increase code coverage to 100%. - (#130 by @clue) - -* BC break: Move `$nameserver` from `ExecutorInterface` to `UdpTransportExecutor`, - remove advanced/internal `UdpTransportExecutor` args for `Parser`/`BinaryDumper` and - add API documentation for `ExecutorInterface`. - (#135, #137 and #138 by @clue) - -* BC break: Replace `HeaderBag` attributes with simple `Message` properties. - (#132 by @clue) - -* BC break: Mark all `Record` attributes as required, add documentation vs `Query`. - (#136 by @clue) - -* BC break: Mark all classes as final to discourage inheritance - (#134 by @WyriHaximus) - -## 0.4.19 (2019-07-10) - -* Feature: Avoid garbage references when DNS resolution rejects on legacy PHP <= 5.6. - (#133 by @clue) - -## 0.4.18 (2019-09-07) - -* Feature / Fix: Implement `CachingExecutor` using cache TTL, deprecate old `CachedExecutor`, - respect TTL from response records when caching and do not cache truncated responses. - (#129 by @clue) - -* Feature: Limit cache size to 256 last responses by default. - (#127 by @clue) - -* Feature: Cooperatively resolve hosts to avoid running same query concurrently. - (#125 by @clue) - -## 0.4.17 (2019-04-01) - -* Feature: Support parsing `authority` and `additional` records from DNS response. - (#123 by @clue) - -* Feature: Support dumping records as part of outgoing binary DNS message. - (#124 by @clue) - -* Feature: Forward compatibility with upcoming Cache v0.6 and Cache v1.0 - (#121 by @clue) - -* Improve test suite to add forward compatibility with PHPUnit 7, - test against PHP 7.3 and use legacy PHPUnit 5 on legacy HHVM. - (#122 by @clue) - -## 0.4.16 (2018-11-11) - -* Feature: Improve promise cancellation for DNS lookup retries and clean up any garbage references. - (#118 by @clue) - -* Fix: Reject parsing malformed DNS response messages such as incomplete DNS response messages, - malformed record data or malformed compressed domain name labels. - (#115 and #117 by @clue) - -* Fix: Fix interpretation of TTL as UINT32 with most significant bit unset. - (#116 by @clue) - -* Fix: Fix caching advanced MX/SRV/TXT/SOA structures. - (#112 by @clue) - -## 0.4.15 (2018-07-02) - -* Feature: Add `resolveAll()` method to support custom query types in `Resolver`. - (#110 by @clue and @WyriHaximus) - - ```php - $resolver->resolveAll('reactphp.org', Message::TYPE_AAAA)->then(function ($ips) { - echo 'IPv6 addresses for reactphp.org ' . implode(', ', $ips) . PHP_EOL; - }); - ``` - -* Feature: Support parsing `NS`, `TXT`, `MX`, `SOA` and `SRV` records. - (#104, #105, #106, #107 and #108 by @clue) - -* Feature: Add support for `Message::TYPE_ANY` and parse unknown types as binary data. - (#104 by @clue) - -* Feature: Improve error messages for failed queries and improve documentation. - (#109 by @clue) - -* Feature: Add reverse DNS lookup example. - (#111 by @clue) - -## 0.4.14 (2018-06-26) - -* Feature: Add `UdpTransportExecutor`, validate incoming DNS response messages - to avoid cache poisoning attacks and deprecate legacy `Executor`. - (#101 and #103 by @clue) - -* Feature: Forward compatibility with Cache 0.5 - (#102 by @clue) - -* Deprecate legacy `Query::$currentTime` and binary parser data attributes to clean up and simplify API. - (#99 by @clue) - -## 0.4.13 (2018-02-27) - -* Add `Config::loadSystemConfigBlocking()` to load default system config - and support parsing DNS config on all supported platforms - (`/etc/resolv.conf` on Unix/Linux/Mac and WMIC on Windows) - (#92, #93, #94 and #95 by @clue) - - ```php - $config = Config::loadSystemConfigBlocking(); - $server = $config->nameservers ? reset($config->nameservers) : '8.8.8.8'; - ``` - -* Remove unneeded cyclic dependency on react/socket - (#96 by @clue) - -## 0.4.12 (2018-01-14) - -* Improve test suite by adding forward compatibility with PHPUnit 6, - test against PHP 7.2, fix forward compatibility with upcoming EventLoop releases, - add test group to skip integration tests relying on internet connection - and add minor documentation improvements. - (#85 and #87 by @carusogabriel, #88 and #89 by @clue and #83 by @jsor) - -## 0.4.11 (2017-08-25) - -* Feature: Support resolving from default hosts file - (#75, #76 and #77 by @clue) - - This means that resolving hosts such as `localhost` will now work as - expected across all platforms with no changes required: - - ```php - $resolver->resolve('localhost')->then(function ($ip) { - echo 'IP: ' . $ip; - }); - ``` - - The new `HostsExecutor` exists for advanced usage and is otherwise used - internally for this feature. - -## 0.4.10 (2017-08-10) - -* Feature: Forward compatibility with EventLoop v1.0 and v0.5 and - lock minimum dependencies and work around circular dependency for tests - (#70 and #71 by @clue) - -* Fix: Work around DNS timeout issues for Windows users - (#74 by @clue) - -* Documentation and examples for advanced usage - (#66 by @WyriHaximus) - -* Remove broken TCP code, do not retry with invalid TCP query - (#73 by @clue) - -* Improve test suite by fixing HHVM build for now again and ignore future HHVM build errors and - lock Travis distro so new defaults will not break the build and - fix failing tests for PHP 7.1 - (#68 by @WyriHaximus and #69 and #72 by @clue) - -## 0.4.9 (2017-05-01) - -* Feature: Forward compatibility with upcoming Socket v1.0 and v0.8 - (#61 by @clue) - -## 0.4.8 (2017-04-16) - -* Feature: Add support for the AAAA record type to the protocol parser - (#58 by @othillo) - -* Feature: Add support for the PTR record type to the protocol parser - (#59 by @othillo) - -## 0.4.7 (2017-03-31) - -* Feature: Forward compatibility with upcoming Socket v0.6 and v0.7 component - (#57 by @clue) - -## 0.4.6 (2017-03-11) - -* Fix: Fix DNS timeout issues for Windows users and add forward compatibility - with Stream v0.5 and upcoming v0.6 - (#53 by @clue) - -* Improve test suite by adding PHPUnit to `require-dev` - (#54 by @clue) - -## 0.4.5 (2017-03-02) - -* Fix: Ensure we ignore the case of the answer - (#51 by @WyriHaximus) - -* Feature: Add `TimeoutExecutor` and simplify internal APIs to allow internal - code re-use for upcoming versions. - (#48 and #49 by @clue) - -## 0.4.4 (2017-02-13) - -* Fix: Fix handling connection and stream errors - (#45 by @clue) - -* Feature: Add examples and forward compatibility with upcoming Socket v0.5 component - (#46 and #47 by @clue) - -## 0.4.3 (2016-07-31) - -* Feature: Allow for cache adapter injection (#38 by @WyriHaximus) - - ```php - $factory = new React\Dns\Resolver\Factory(); - - $cache = new MyCustomCacheInstance(); - $resolver = $factory->createCached('8.8.8.8', $loop, $cache); - ``` - -* Feature: Support Promise cancellation (#35 by @clue) - - ```php - $promise = $resolver->resolve('reactphp.org'); - - $promise->cancel(); - ``` - -## 0.4.2 (2016-02-24) - -* Repository maintenance, split off from main repo, improve test suite and documentation -* First class support for PHP7 and HHVM (#34 by @clue) -* Adjust compatibility to 5.3 (#30 by @clue) - -## 0.4.1 (2014-04-13) - -* Bug fix: Fixed PSR-4 autoload path (@marcj/WyriHaximus) - -## 0.4.0 (2014-02-02) - -* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks -* BC break: Update to React/Promise 2.0 -* Bug fix: Properly resolve CNAME aliases -* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0 -* Bump React dependencies to v0.4 - -## 0.3.2 (2013-05-10) - -* Feature: Support default port for IPv6 addresses (@clue) - -## 0.3.0 (2013-04-14) - -* Bump React dependencies to v0.3 - -## 0.2.6 (2012-12-26) - -* Feature: New cache component, used by DNS - -## 0.2.5 (2012-11-26) - -* Version bump - -## 0.2.4 (2012-11-18) - -* Feature: Change to promise-based API (@jsor) - -## 0.2.3 (2012-11-14) - -* Version bump - -## 0.2.2 (2012-10-28) - -* Feature: DNS executor timeout handling (@arnaud-lb) -* Feature: DNS retry executor (@arnaud-lb) - -## 0.2.1 (2012-10-14) - -* Minor adjustments to DNS parser - -## 0.2.0 (2012-09-10) - -* Feature: DNS resolver diff --git a/tools/php-cs-fixer/vendor/react/dns/LICENSE b/tools/php-cs-fixer/vendor/react/dns/LICENSE deleted file mode 100644 index d6f8901f..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/dns/README.md b/tools/php-cs-fixer/vendor/react/dns/README.md deleted file mode 100644 index 9f83a944..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/README.md +++ /dev/null @@ -1,453 +0,0 @@ -# DNS - -[![CI status](https://github.com/reactphp/dns/actions/workflows/ci.yml/badge.svg)](https://github.com/reactphp/dns/actions) -[![installs on Packagist](https://img.shields.io/packagist/dt/react/dns?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/dns) - -Async DNS resolver for [ReactPHP](https://reactphp.org/). - -The main point of the DNS component is to provide async DNS resolution. -However, it is really a toolkit for working with DNS messages, and could -easily be used to create a DNS server. - -**Table of contents** - -* [Basic usage](#basic-usage) -* [Caching](#caching) - * [Custom cache adapter](#custom-cache-adapter) -* [ResolverInterface](#resolverinterface) - * [resolve()](#resolve) - * [resolveAll()](#resolveall) -* [Advanced usage](#advanced-usage) - * [UdpTransportExecutor](#udptransportexecutor) - * [TcpTransportExecutor](#tcptransportexecutor) - * [SelectiveTransportExecutor](#selectivetransportexecutor) - * [HostsFileExecutor](#hostsfileexecutor) -* [Install](#install) -* [Tests](#tests) -* [License](#license) -* [References](#references) - -## Basic usage - -The most basic usage is to just create a resolver through the resolver -factory. All you need to give it is a nameserver, then you can start resolving -names, baby! - -```php -$config = React\Dns\Config\Config::loadSystemConfigBlocking(); -if (!$config->nameservers) { - $config->nameservers[] = '8.8.8.8'; -} - -$factory = new React\Dns\Resolver\Factory(); -$dns = $factory->create($config); - -$dns->resolve('igor.io')->then(function ($ip) { - echo "Host: $ip\n"; -}); -``` - -See also the [first example](examples). - -The `Config` class can be used to load the system default config. This is an -operation that may access the filesystem and block. Ideally, this method should -thus be executed only once before the loop starts and not repeatedly while it is -running. -Note that this class may return an *empty* configuration if the system config -can not be loaded. As such, you'll likely want to apply a default nameserver -as above if none can be found. - -> Note that the factory loads the hosts file from the filesystem once when - creating the resolver instance. - Ideally, this method should thus be executed only once before the loop starts - and not repeatedly while it is running. - -But there's more. - -## Caching - -You can cache results by configuring the resolver to use a `CachedExecutor`: - -```php -$config = React\Dns\Config\Config::loadSystemConfigBlocking(); -if (!$config->nameservers) { - $config->nameservers[] = '8.8.8.8'; -} - -$factory = new React\Dns\Resolver\Factory(); -$dns = $factory->createCached($config); - -$dns->resolve('igor.io')->then(function ($ip) { - echo "Host: $ip\n"; -}); - -... - -$dns->resolve('igor.io')->then(function ($ip) { - echo "Host: $ip\n"; -}); -``` - -If the first call returns before the second, only one query will be executed. -The second result will be served from an in memory cache. -This is particularly useful for long running scripts where the same hostnames -have to be looked up multiple times. - -See also the [third example](examples). - -### Custom cache adapter - -By default, the above will use an in memory cache. - -You can also specify a custom cache implementing [`CacheInterface`](https://github.com/reactphp/cache) to handle the record cache instead: - -```php -$cache = new React\Cache\ArrayCache(); -$factory = new React\Dns\Resolver\Factory(); -$dns = $factory->createCached('8.8.8.8', null, $cache); -``` - -See also the wiki for possible [cache implementations](https://github.com/reactphp/react/wiki/Users#cache-implementations). - -## ResolverInterface - - - -### resolve() - -The `resolve(string $domain): PromiseInterface` method can be used to -resolve the given $domain name to a single IPv4 address (type `A` query). - -```php -$resolver->resolve('reactphp.org')->then(function ($ip) { - echo 'IP for reactphp.org is ' . $ip . PHP_EOL; -}); -``` - -This is one of the main methods in this package. It sends a DNS query -for the given $domain name to your DNS server and returns a single IP -address on success. - -If the DNS server sends a DNS response message that contains more than -one IP address for this query, it will randomly pick one of the IP -addresses from the response. If you want the full list of IP addresses -or want to send a different type of query, you should use the -[`resolveAll()`](#resolveall) method instead. - -If the DNS server sends a DNS response message that indicates an error -code, this method will reject with a `RecordNotFoundException`. Its -message and code can be used to check for the response code. - -If the DNS communication fails and the server does not respond with a -valid response message, this message will reject with an `Exception`. - -Pending DNS queries can be cancelled by cancelling its pending promise like so: - -```php -$promise = $resolver->resolve('reactphp.org'); - -$promise->cancel(); -``` - -### resolveAll() - -The `resolveAll(string $host, int $type): PromiseInterface` method can be used to -resolve all record values for the given $domain name and query $type. - -```php -$resolver->resolveAll('reactphp.org', Message::TYPE_A)->then(function ($ips) { - echo 'IPv4 addresses for reactphp.org ' . implode(', ', $ips) . PHP_EOL; -}); - -$resolver->resolveAll('reactphp.org', Message::TYPE_AAAA)->then(function ($ips) { - echo 'IPv6 addresses for reactphp.org ' . implode(', ', $ips) . PHP_EOL; -}); -``` - -This is one of the main methods in this package. It sends a DNS query -for the given $domain name to your DNS server and returns a list with all -record values on success. - -If the DNS server sends a DNS response message that contains one or more -records for this query, it will return a list with all record values -from the response. You can use the `Message::TYPE_*` constants to control -which type of query will be sent. Note that this method always returns a -list of record values, but each record value type depends on the query -type. For example, it returns the IPv4 addresses for type `A` queries, -the IPv6 addresses for type `AAAA` queries, the hostname for type `NS`, -`CNAME` and `PTR` queries and structured data for other queries. See also -the `Record` documentation for more details. - -If the DNS server sends a DNS response message that indicates an error -code, this method will reject with a `RecordNotFoundException`. Its -message and code can be used to check for the response code. - -If the DNS communication fails and the server does not respond with a -valid response message, this message will reject with an `Exception`. - -Pending DNS queries can be cancelled by cancelling its pending promise like so: - -```php -$promise = $resolver->resolveAll('reactphp.org', Message::TYPE_AAAA); - -$promise->cancel(); -``` - -## Advanced Usage - -### UdpTransportExecutor - -The `UdpTransportExecutor` can be used to -send DNS queries over a UDP transport. - -This is the main class that sends a DNS query to your DNS server and is used -internally by the `Resolver` for the actual message transport. - -For more advanced usages one can utilize this class directly. -The following example looks up the `IPv6` address for `igor.io`. - -```php -$executor = new UdpTransportExecutor('8.8.8.8:53'); - -$executor->query( - new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) -)->then(function (Message $message) { - foreach ($message->answers as $answer) { - echo 'IPv6: ' . $answer->data . PHP_EOL; - } -}, 'printf'); -``` - -See also the [fourth example](examples). - -Note that this executor does not implement a timeout, so you will very likely -want to use this in combination with a `TimeoutExecutor` like this: - -```php -$executor = new TimeoutExecutor( - new UdpTransportExecutor($nameserver), - 3.0 -); -``` - -Also note that this executor uses an unreliable UDP transport and that it -does not implement any retry logic, so you will likely want to use this in -combination with a `RetryExecutor` like this: - -```php -$executor = new RetryExecutor( - new TimeoutExecutor( - new UdpTransportExecutor($nameserver), - 3.0 - ) -); -``` - -Note that this executor is entirely async and as such allows you to execute -any number of queries concurrently. You should probably limit the number of -concurrent queries in your application or you're very likely going to face -rate limitations and bans on the resolver end. For many common applications, -you may want to avoid sending the same query multiple times when the first -one is still pending, so you will likely want to use this in combination with -a `CoopExecutor` like this: - -```php -$executor = new CoopExecutor( - new RetryExecutor( - new TimeoutExecutor( - new UdpTransportExecutor($nameserver), - 3.0 - ) - ) -); -``` - -> Internally, this class uses PHP's UDP sockets and does not take advantage - of [react/datagram](https://github.com/reactphp/datagram) purely for - organizational reasons to avoid a cyclic dependency between the two - packages. Higher-level components should take advantage of the Datagram - component instead of reimplementing this socket logic from scratch. - -### TcpTransportExecutor - -The `TcpTransportExecutor` class can be used to -send DNS queries over a TCP/IP stream transport. - -This is one of the main classes that send a DNS query to your DNS server. - -For more advanced usages one can utilize this class directly. -The following example looks up the `IPv6` address for `reactphp.org`. - -```php -$executor = new TcpTransportExecutor('8.8.8.8:53'); - -$executor->query( - new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) -)->then(function (Message $message) { - foreach ($message->answers as $answer) { - echo 'IPv6: ' . $answer->data . PHP_EOL; - } -}, 'printf'); -``` - -See also [example #92](examples). - -Note that this executor does not implement a timeout, so you will very likely -want to use this in combination with a `TimeoutExecutor` like this: - -```php -$executor = new TimeoutExecutor( - new TcpTransportExecutor($nameserver), - 3.0 -); -``` - -Unlike the `UdpTransportExecutor`, this class uses a reliable TCP/IP -transport, so you do not necessarily have to implement any retry logic. - -Note that this executor is entirely async and as such allows you to execute -queries concurrently. The first query will establish a TCP/IP socket -connection to the DNS server which will be kept open for a short period. -Additional queries will automatically reuse this existing socket connection -to the DNS server, will pipeline multiple requests over this single -connection and will keep an idle connection open for a short period. The -initial TCP/IP connection overhead may incur a slight delay if you only send -occasional queries – when sending a larger number of concurrent queries over -an existing connection, it becomes increasingly more efficient and avoids -creating many concurrent sockets like the UDP-based executor. You may still -want to limit the number of (concurrent) queries in your application or you -may be facing rate limitations and bans on the resolver end. For many common -applications, you may want to avoid sending the same query multiple times -when the first one is still pending, so you will likely want to use this in -combination with a `CoopExecutor` like this: - -```php -$executor = new CoopExecutor( - new TimeoutExecutor( - new TcpTransportExecutor($nameserver), - 3.0 - ) -); -``` - -> Internally, this class uses PHP's TCP/IP sockets and does not take advantage - of [react/socket](https://github.com/reactphp/socket) purely for - organizational reasons to avoid a cyclic dependency between the two - packages. Higher-level components should take advantage of the Socket - component instead of reimplementing this socket logic from scratch. - -### SelectiveTransportExecutor - -The `SelectiveTransportExecutor` class can be used to -Send DNS queries over a UDP or TCP/IP stream transport. - -This class will automatically choose the correct transport protocol to send -a DNS query to your DNS server. It will always try to send it over the more -efficient UDP transport first. If this query yields a size related issue -(truncated messages), it will retry over a streaming TCP/IP transport. - -For more advanced usages one can utilize this class directly. -The following example looks up the `IPv6` address for `reactphp.org`. - -```php -$executor = new SelectiveTransportExecutor($udpExecutor, $tcpExecutor); - -$executor->query( - new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) -)->then(function (Message $message) { - foreach ($message->answers as $answer) { - echo 'IPv6: ' . $answer->data . PHP_EOL; - } -}, 'printf'); -``` - -Note that this executor only implements the logic to select the correct -transport for the given DNS query. Implementing the correct transport logic, -implementing timeouts and any retry logic is left up to the given executors, -see also [`UdpTransportExecutor`](#udptransportexecutor) and -[`TcpTransportExecutor`](#tcptransportexecutor) for more details. - -Note that this executor is entirely async and as such allows you to execute -any number of queries concurrently. You should probably limit the number of -concurrent queries in your application or you're very likely going to face -rate limitations and bans on the resolver end. For many common applications, -you may want to avoid sending the same query multiple times when the first -one is still pending, so you will likely want to use this in combination with -a `CoopExecutor` like this: - -```php -$executor = new CoopExecutor( - new SelectiveTransportExecutor( - $datagramExecutor, - $streamExecutor - ) -); -``` - -### HostsFileExecutor - -Note that the above `UdpTransportExecutor` class always performs an actual DNS query. -If you also want to take entries from your hosts file into account, you may -use this code: - -```php -$hosts = \React\Dns\Config\HostsFile::loadFromPathBlocking(); - -$executor = new UdpTransportExecutor('8.8.8.8:53'); -$executor = new HostsFileExecutor($hosts, $executor); - -$executor->query( - new Query('localhost', Message::TYPE_A, Message::CLASS_IN) -); -``` - -## Install - -The recommended way to install this library is [through Composer](https://getcomposer.org/). -[New to Composer?](https://getcomposer.org/doc/00-intro.md) - -This project follows [SemVer](https://semver.org/). -This will install the latest supported version: - -```bash -composer require react/dns:^1.13 -``` - -See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. - -This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.3 through current PHP 8+ and -HHVM. -It's *highly recommended to use the latest supported PHP version* for this project. - -## Tests - -To run the test suite, you first need to clone this repo and then install all -dependencies [through Composer](https://getcomposer.org/): - -```bash -composer install -``` - -To run the test suite, go to the project root and run: - -```bash -vendor/bin/phpunit -``` - -The test suite also contains a number of functional integration tests that rely -on a stable internet connection. -If you do not want to run these, they can simply be skipped like this: - -```bash -vendor/bin/phpunit --exclude-group internet -``` - -## License - -MIT, see [LICENSE file](LICENSE). - -## References - -* [RFC 1034](https://tools.ietf.org/html/rfc1034) Domain Names - Concepts and Facilities -* [RFC 1035](https://tools.ietf.org/html/rfc1035) Domain Names - Implementation and Specification diff --git a/tools/php-cs-fixer/vendor/react/dns/composer.json b/tools/php-cs-fixer/vendor/react/dns/composer.json deleted file mode 100644 index 4fe5c0da..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "react/dns", - "description": "Async DNS resolver for ReactPHP", - "keywords": ["dns", "dns-resolver", "ReactPHP", "async"], - "license": "MIT", - "authors": [ - { - "name": "Christian Lück", - "homepage": "https://clue.engineering/", - "email": "christian@clue.engineering" - }, - { - "name": "Cees-Jan Kiewiet", - "homepage": "https://wyrihaximus.net/", - "email": "reactphp@ceesjankiewiet.nl" - }, - { - "name": "Jan Sorgalla", - "homepage": "https://sorgalla.com/", - "email": "jsorgalla@gmail.com" - }, - { - "name": "Chris Boden", - "homepage": "https://cboden.dev/", - "email": "cboden@gmail.com" - } - ], - "require": { - "php": ">=5.3.0", - "react/cache": "^1.0 || ^0.6 || ^0.5", - "react/event-loop": "^1.2", - "react/promise": "^3.2 || ^2.7 || ^1.2.1" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4.3 || ^3 || ^2", - "react/promise-timer": "^1.11" - }, - "autoload": { - "psr-4": { - "React\\Dns\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "React\\Tests\\Dns\\": "tests/" - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/BadServerException.php b/tools/php-cs-fixer/vendor/react/dns/src/BadServerException.php deleted file mode 100644 index 3d95213f..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/BadServerException.php +++ /dev/null @@ -1,7 +0,0 @@ - `fe80:1`) - if (strpos($ip, ':') !== false && ($pos = strpos($ip, '%')) !== false) { - $ip = substr($ip, 0, $pos); - } - - if (@inet_pton($ip) !== false) { - $config->nameservers[] = $ip; - } - } - - return $config; - } - - /** - * Loads the DNS configurations from Windows's WMIC (from the given command or default command) - * - * Note that this method blocks while loading the given command and should - * thus be used with care! While this should be relatively fast for normal - * WMIC commands, it remains unknown if this may block under certain - * circumstances. In particular, this method should only be executed before - * the loop starts, not while it is running. - * - * Note that this method will only try to execute the given command try to - * parse its output, irrespective of whether this command exists. In - * particular, this command is only available on Windows. Currently, this - * will only parse valid nameserver entries from the command output and will - * ignore all other output without complaining. - * - * Note that the previous section implies that this may return an empty - * `Config` object if no valid nameserver entries can be found. - * - * @param ?string $command (advanced) should not be given (NULL) unless you know what you're doing - * @return self - * @link https://ss64.com/nt/wmic.html - */ - public static function loadWmicBlocking($command = null) - { - $contents = shell_exec($command === null ? 'wmic NICCONFIG get "DNSServerSearchOrder" /format:CSV' : $command); - preg_match_all('/(?<=[{;,"])([\da-f.:]{4,})(?=[};,"])/i', $contents, $matches); - - $config = new self(); - $config->nameservers = $matches[1]; - - return $config; - } - - public $nameservers = array(); -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Config/HostsFile.php b/tools/php-cs-fixer/vendor/react/dns/src/Config/HostsFile.php deleted file mode 100644 index 1060231a..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Config/HostsFile.php +++ /dev/null @@ -1,153 +0,0 @@ -contents = $contents; - } - - /** - * Returns all IPs for the given hostname - * - * @param string $name - * @return string[] - */ - public function getIpsForHost($name) - { - $name = strtolower($name); - - $ips = array(); - foreach (preg_split('/\r?\n/', $this->contents) as $line) { - $parts = preg_split('/\s+/', $line); - $ip = array_shift($parts); - if ($parts && array_search($name, $parts) !== false) { - // remove IPv6 zone ID (`fe80::1%lo0` => `fe80:1`) - if (strpos($ip, ':') !== false && ($pos = strpos($ip, '%')) !== false) { - $ip = substr($ip, 0, $pos); - } - - if (@inet_pton($ip) !== false) { - $ips[] = $ip; - } - } - } - - return $ips; - } - - /** - * Returns all hostnames for the given IPv4 or IPv6 address - * - * @param string $ip - * @return string[] - */ - public function getHostsForIp($ip) - { - // check binary representation of IP to avoid string case and short notation - $ip = @inet_pton($ip); - if ($ip === false) { - return array(); - } - - $names = array(); - foreach (preg_split('/\r?\n/', $this->contents) as $line) { - $parts = preg_split('/\s+/', $line, -1, PREG_SPLIT_NO_EMPTY); - $addr = (string) array_shift($parts); - - // remove IPv6 zone ID (`fe80::1%lo0` => `fe80:1`) - if (strpos($addr, ':') !== false && ($pos = strpos($addr, '%')) !== false) { - $addr = substr($addr, 0, $pos); - } - - if (@inet_pton($addr) === $ip) { - foreach ($parts as $part) { - $names[] = $part; - } - } - } - - return $names; - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Model/Message.php b/tools/php-cs-fixer/vendor/react/dns/src/Model/Message.php deleted file mode 100644 index bac2b10d..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Model/Message.php +++ /dev/null @@ -1,230 +0,0 @@ -id = self::generateId(); - $request->rd = true; - $request->questions[] = $query; - - return $request; - } - - /** - * Creates a new response message for the given query with the given answer records - * - * @param Query $query - * @param Record[] $answers - * @return self - */ - public static function createResponseWithAnswersForQuery(Query $query, array $answers) - { - $response = new Message(); - $response->id = self::generateId(); - $response->qr = true; - $response->rd = true; - - $response->questions[] = $query; - - foreach ($answers as $record) { - $response->answers[] = $record; - } - - return $response; - } - - /** - * generates a random 16 bit message ID - * - * This uses a CSPRNG so that an outside attacker that is sending spoofed - * DNS response messages can not guess the message ID to avoid possible - * cache poisoning attacks. - * - * The `random_int()` function is only available on PHP 7+ or when - * https://github.com/paragonie/random_compat is installed. As such, using - * the latest supported PHP version is highly recommended. This currently - * falls back to a less secure random number generator on older PHP versions - * in the hope that this system is properly protected against outside - * attackers, for example by using one of the common local DNS proxy stubs. - * - * @return int - * @see self::getId() - * @codeCoverageIgnore - */ - private static function generateId() - { - if (function_exists('random_int')) { - return random_int(0, 0xffff); - } - return mt_rand(0, 0xffff); - } - - /** - * The 16 bit message ID - * - * The response message ID has to match the request message ID. This allows - * the receiver to verify this is the correct response message. An outside - * attacker may try to inject fake responses by "guessing" the message ID, - * so this should use a proper CSPRNG to avoid possible cache poisoning. - * - * @var int 16 bit message ID - * @see self::generateId() - */ - public $id = 0; - - /** - * @var bool Query/Response flag, query=false or response=true - */ - public $qr = false; - - /** - * @var int specifies the kind of query (4 bit), see self::OPCODE_* constants - * @see self::OPCODE_QUERY - */ - public $opcode = self::OPCODE_QUERY; - - /** - * - * @var bool Authoritative Answer - */ - public $aa = false; - - /** - * @var bool TrunCation - */ - public $tc = false; - - /** - * @var bool Recursion Desired - */ - public $rd = false; - - /** - * @var bool Recursion Available - */ - public $ra = false; - - /** - * @var int response code (4 bit), see self::RCODE_* constants - * @see self::RCODE_OK - */ - public $rcode = Message::RCODE_OK; - - /** - * An array of Query objects - * - * ```php - * $questions = array( - * new Query( - * 'reactphp.org', - * Message::TYPE_A, - * Message::CLASS_IN - * ) - * ); - * ``` - * - * @var Query[] - */ - public $questions = array(); - - /** - * @var Record[] - */ - public $answers = array(); - - /** - * @var Record[] - */ - public $authority = array(); - - /** - * @var Record[] - */ - public $additional = array(); -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Model/Record.php b/tools/php-cs-fixer/vendor/react/dns/src/Model/Record.php deleted file mode 100644 index c20403f5..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Model/Record.php +++ /dev/null @@ -1,153 +0,0 @@ -name = $name; - $this->type = $type; - $this->class = $class; - $this->ttl = $ttl; - $this->data = $data; - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Protocol/BinaryDumper.php b/tools/php-cs-fixer/vendor/react/dns/src/Protocol/BinaryDumper.php deleted file mode 100644 index 6f4030f6..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Protocol/BinaryDumper.php +++ /dev/null @@ -1,199 +0,0 @@ -headerToBinary($message); - $data .= $this->questionToBinary($message->questions); - $data .= $this->recordsToBinary($message->answers); - $data .= $this->recordsToBinary($message->authority); - $data .= $this->recordsToBinary($message->additional); - - return $data; - } - - /** - * @param Message $message - * @return string - */ - private function headerToBinary(Message $message) - { - $data = ''; - - $data .= pack('n', $message->id); - - $flags = 0x00; - $flags = ($flags << 1) | ($message->qr ? 1 : 0); - $flags = ($flags << 4) | $message->opcode; - $flags = ($flags << 1) | ($message->aa ? 1 : 0); - $flags = ($flags << 1) | ($message->tc ? 1 : 0); - $flags = ($flags << 1) | ($message->rd ? 1 : 0); - $flags = ($flags << 1) | ($message->ra ? 1 : 0); - $flags = ($flags << 3) | 0; // skip unused zero bit - $flags = ($flags << 4) | $message->rcode; - - $data .= pack('n', $flags); - - $data .= pack('n', count($message->questions)); - $data .= pack('n', count($message->answers)); - $data .= pack('n', count($message->authority)); - $data .= pack('n', count($message->additional)); - - return $data; - } - - /** - * @param Query[] $questions - * @return string - */ - private function questionToBinary(array $questions) - { - $data = ''; - - foreach ($questions as $question) { - $data .= $this->domainNameToBinary($question->name); - $data .= pack('n*', $question->type, $question->class); - } - - return $data; - } - - /** - * @param Record[] $records - * @return string - */ - private function recordsToBinary(array $records) - { - $data = ''; - - foreach ($records as $record) { - /* @var $record Record */ - switch ($record->type) { - case Message::TYPE_A: - case Message::TYPE_AAAA: - $binary = \inet_pton($record->data); - break; - case Message::TYPE_CNAME: - case Message::TYPE_NS: - case Message::TYPE_PTR: - $binary = $this->domainNameToBinary($record->data); - break; - case Message::TYPE_TXT: - case Message::TYPE_SPF: - $binary = $this->textsToBinary($record->data); - break; - case Message::TYPE_MX: - $binary = \pack( - 'n', - $record->data['priority'] - ); - $binary .= $this->domainNameToBinary($record->data['target']); - break; - case Message::TYPE_SRV: - $binary = \pack( - 'n*', - $record->data['priority'], - $record->data['weight'], - $record->data['port'] - ); - $binary .= $this->domainNameToBinary($record->data['target']); - break; - case Message::TYPE_SOA: - $binary = $this->domainNameToBinary($record->data['mname']); - $binary .= $this->domainNameToBinary($record->data['rname']); - $binary .= \pack( - 'N*', - $record->data['serial'], - $record->data['refresh'], - $record->data['retry'], - $record->data['expire'], - $record->data['minimum'] - ); - break; - case Message::TYPE_CAA: - $binary = \pack( - 'C*', - $record->data['flag'], - \strlen($record->data['tag']) - ); - $binary .= $record->data['tag']; - $binary .= $record->data['value']; - break; - case Message::TYPE_SSHFP: - $binary = \pack( - 'CCH*', - $record->data['algorithm'], - $record->data['type'], - $record->data['fingerprint'] - ); - break; - case Message::TYPE_OPT: - $binary = ''; - foreach ($record->data as $opt => $value) { - if ($opt === Message::OPT_TCP_KEEPALIVE && $value !== null) { - $value = \pack('n', round($value * 10)); - } - $binary .= \pack('n*', $opt, \strlen((string) $value)) . $value; - } - break; - default: - // RDATA is already stored as binary value for unknown record types - $binary = $record->data; - } - - $data .= $this->domainNameToBinary($record->name); - $data .= \pack('nnNn', $record->type, $record->class, $record->ttl, \strlen($binary)); - $data .= $binary; - } - - return $data; - } - - /** - * @param string[] $texts - * @return string - */ - private function textsToBinary(array $texts) - { - $data = ''; - foreach ($texts as $text) { - $data .= \chr(\strlen($text)) . $text; - } - return $data; - } - - /** - * @param string $host - * @return string - */ - private function domainNameToBinary($host) - { - if ($host === '') { - return "\0"; - } - - // break up domain name at each dot that is not preceeded by a backslash (escaped notation) - return $this->textsToBinary( - \array_map( - 'stripcslashes', - \preg_split( - '/(?parse($data, 0); - if ($message === null) { - throw new InvalidArgumentException('Unable to parse binary message'); - } - - return $message; - } - - /** - * @param string $data - * @param int $consumed - * @return ?Message - */ - private function parse($data, $consumed) - { - if (!isset($data[12 - 1])) { - return null; - } - - list($id, $fields, $qdCount, $anCount, $nsCount, $arCount) = array_values(unpack('n*', substr($data, 0, 12))); - - $message = new Message(); - $message->id = $id; - $message->rcode = $fields & 0xf; - $message->ra = (($fields >> 7) & 1) === 1; - $message->rd = (($fields >> 8) & 1) === 1; - $message->tc = (($fields >> 9) & 1) === 1; - $message->aa = (($fields >> 10) & 1) === 1; - $message->opcode = ($fields >> 11) & 0xf; - $message->qr = (($fields >> 15) & 1) === 1; - $consumed += 12; - - // parse all questions - for ($i = $qdCount; $i > 0; --$i) { - list($question, $consumed) = $this->parseQuestion($data, $consumed); - if ($question === null) { - return null; - } else { - $message->questions[] = $question; - } - } - - // parse all answer records - for ($i = $anCount; $i > 0; --$i) { - list($record, $consumed) = $this->parseRecord($data, $consumed); - if ($record === null) { - return null; - } else { - $message->answers[] = $record; - } - } - - // parse all authority records - for ($i = $nsCount; $i > 0; --$i) { - list($record, $consumed) = $this->parseRecord($data, $consumed); - if ($record === null) { - return null; - } else { - $message->authority[] = $record; - } - } - - // parse all additional records - for ($i = $arCount; $i > 0; --$i) { - list($record, $consumed) = $this->parseRecord($data, $consumed); - if ($record === null) { - return null; - } else { - $message->additional[] = $record; - } - } - - return $message; - } - - /** - * @param string $data - * @param int $consumed - * @return array - */ - private function parseQuestion($data, $consumed) - { - list($labels, $consumed) = $this->readLabels($data, $consumed); - - if ($labels === null || !isset($data[$consumed + 4 - 1])) { - return array(null, null); - } - - list($type, $class) = array_values(unpack('n*', substr($data, $consumed, 4))); - $consumed += 4; - - return array( - new Query( - implode('.', $labels), - $type, - $class - ), - $consumed - ); - } - - /** - * @param string $data - * @param int $consumed - * @return array An array with a parsed Record on success or array with null if data is invalid/incomplete - */ - private function parseRecord($data, $consumed) - { - list($name, $consumed) = $this->readDomain($data, $consumed); - - if ($name === null || !isset($data[$consumed + 10 - 1])) { - return array(null, null); - } - - list($type, $class) = array_values(unpack('n*', substr($data, $consumed, 4))); - $consumed += 4; - - list($ttl) = array_values(unpack('N', substr($data, $consumed, 4))); - $consumed += 4; - - // TTL is a UINT32 that must not have most significant bit set for BC reasons - if ($ttl < 0 || $ttl >= 1 << 31) { - $ttl = 0; - } - - list($rdLength) = array_values(unpack('n', substr($data, $consumed, 2))); - $consumed += 2; - - if (!isset($data[$consumed + $rdLength - 1])) { - return array(null, null); - } - - $rdata = null; - $expected = $consumed + $rdLength; - - if (Message::TYPE_A === $type) { - if ($rdLength === 4) { - $rdata = inet_ntop(substr($data, $consumed, $rdLength)); - $consumed += $rdLength; - } - } elseif (Message::TYPE_AAAA === $type) { - if ($rdLength === 16) { - $rdata = inet_ntop(substr($data, $consumed, $rdLength)); - $consumed += $rdLength; - } - } elseif (Message::TYPE_CNAME === $type || Message::TYPE_PTR === $type || Message::TYPE_NS === $type) { - list($rdata, $consumed) = $this->readDomain($data, $consumed); - } elseif (Message::TYPE_TXT === $type || Message::TYPE_SPF === $type) { - $rdata = array(); - while ($consumed < $expected) { - $len = ord($data[$consumed]); - $rdata[] = (string)substr($data, $consumed + 1, $len); - $consumed += $len + 1; - } - } elseif (Message::TYPE_MX === $type) { - if ($rdLength > 2) { - list($priority) = array_values(unpack('n', substr($data, $consumed, 2))); - list($target, $consumed) = $this->readDomain($data, $consumed + 2); - - $rdata = array( - 'priority' => $priority, - 'target' => $target - ); - } - } elseif (Message::TYPE_SRV === $type) { - if ($rdLength > 6) { - list($priority, $weight, $port) = array_values(unpack('n*', substr($data, $consumed, 6))); - list($target, $consumed) = $this->readDomain($data, $consumed + 6); - - $rdata = array( - 'priority' => $priority, - 'weight' => $weight, - 'port' => $port, - 'target' => $target - ); - } - } elseif (Message::TYPE_SSHFP === $type) { - if ($rdLength > 2) { - list($algorithm, $hash) = \array_values(\unpack('C*', \substr($data, $consumed, 2))); - $fingerprint = \bin2hex(\substr($data, $consumed + 2, $rdLength - 2)); - $consumed += $rdLength; - - $rdata = array( - 'algorithm' => $algorithm, - 'type' => $hash, - 'fingerprint' => $fingerprint - ); - } - } elseif (Message::TYPE_SOA === $type) { - list($mname, $consumed) = $this->readDomain($data, $consumed); - list($rname, $consumed) = $this->readDomain($data, $consumed); - - if ($mname !== null && $rname !== null && isset($data[$consumed + 20 - 1])) { - list($serial, $refresh, $retry, $expire, $minimum) = array_values(unpack('N*', substr($data, $consumed, 20))); - $consumed += 20; - - $rdata = array( - 'mname' => $mname, - 'rname' => $rname, - 'serial' => $serial, - 'refresh' => $refresh, - 'retry' => $retry, - 'expire' => $expire, - 'minimum' => $minimum - ); - } - } elseif (Message::TYPE_OPT === $type) { - $rdata = array(); - while (isset($data[$consumed + 4 - 1])) { - list($code, $length) = array_values(unpack('n*', substr($data, $consumed, 4))); - $value = (string) substr($data, $consumed + 4, $length); - if ($code === Message::OPT_TCP_KEEPALIVE && $value === '') { - $value = null; - } elseif ($code === Message::OPT_TCP_KEEPALIVE && $length === 2) { - list($value) = array_values(unpack('n', $value)); - $value = round($value * 0.1, 1); - } elseif ($code === Message::OPT_TCP_KEEPALIVE) { - break; - } - $rdata[$code] = $value; - $consumed += 4 + $length; - } - } elseif (Message::TYPE_CAA === $type) { - if ($rdLength > 3) { - list($flag, $tagLength) = array_values(unpack('C*', substr($data, $consumed, 2))); - - if ($tagLength > 0 && $rdLength - 2 - $tagLength > 0) { - $tag = substr($data, $consumed + 2, $tagLength); - $value = substr($data, $consumed + 2 + $tagLength, $rdLength - 2 - $tagLength); - $consumed += $rdLength; - - $rdata = array( - 'flag' => $flag, - 'tag' => $tag, - 'value' => $value - ); - } - } - } else { - // unknown types simply parse rdata as an opaque binary string - $rdata = substr($data, $consumed, $rdLength); - $consumed += $rdLength; - } - - // ensure parsing record data consumes expact number of bytes indicated in record length - if ($consumed !== $expected || $rdata === null) { - return array(null, null); - } - - return array( - new Record($name, $type, $class, $ttl, $rdata), - $consumed - ); - } - - private function readDomain($data, $consumed) - { - list ($labels, $consumed) = $this->readLabels($data, $consumed); - - if ($labels === null) { - return array(null, null); - } - - // use escaped notation for each label part, then join using dots - return array( - \implode( - '.', - \array_map( - function ($label) { - return \addcslashes($label, "\0..\40.\177"); - }, - $labels - ) - ), - $consumed - ); - } - - /** - * @param string $data - * @param int $consumed - * @param int $compressionDepth maximum depth for compressed labels to avoid unreasonable recursion - * @return array - */ - private function readLabels($data, $consumed, $compressionDepth = 127) - { - $labels = array(); - - while (true) { - if (!isset($data[$consumed])) { - return array(null, null); - } - - $length = \ord($data[$consumed]); - - // end of labels reached - if ($length === 0) { - $consumed += 1; - break; - } - - // first two bits set? this is a compressed label (14 bit pointer offset) - if (($length & 0xc0) === 0xc0 && isset($data[$consumed + 1]) && $compressionDepth) { - $offset = ($length & ~0xc0) << 8 | \ord($data[$consumed + 1]); - if ($offset >= $consumed) { - return array(null, null); - } - - $consumed += 2; - list($newLabels) = $this->readLabels($data, $offset, $compressionDepth - 1); - - if ($newLabels === null) { - return array(null, null); - } - - $labels = array_merge($labels, $newLabels); - break; - } - - // length MUST be 0-63 (6 bits only) and data has to be large enough - if ($length & 0xc0 || !isset($data[$consumed + $length - 1])) { - return array(null, null); - } - - $labels[] = substr($data, $consumed + 1, $length); - $consumed += $length + 1; - } - - return array($labels, $consumed); - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/CachingExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/CachingExecutor.php deleted file mode 100644 index e530b24c..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Query/CachingExecutor.php +++ /dev/null @@ -1,88 +0,0 @@ -executor = $executor; - $this->cache = $cache; - } - - public function query(Query $query) - { - $id = $query->name . ':' . $query->type . ':' . $query->class; - $cache = $this->cache; - $that = $this; - $executor = $this->executor; - - $pending = $cache->get($id); - return new Promise(function ($resolve, $reject) use ($query, $id, $cache, $executor, &$pending, $that) { - $pending->then( - function ($message) use ($query, $id, $cache, $executor, &$pending, $that) { - // return cached response message on cache hit - if ($message !== null) { - return $message; - } - - // perform DNS lookup if not already cached - return $pending = $executor->query($query)->then( - function (Message $message) use ($cache, $id, $that) { - // DNS response message received => store in cache when not truncated and return - if (!$message->tc) { - $cache->set($id, $message, $that->ttl($message)); - } - - return $message; - } - ); - } - )->then($resolve, function ($e) use ($reject, &$pending) { - $reject($e); - $pending = null; - }); - }, function ($_, $reject) use (&$pending, $query) { - $reject(new \RuntimeException('DNS query for ' . $query->describe() . ' has been cancelled')); - $pending->cancel(); - $pending = null; - }); - } - - /** - * @param Message $message - * @return int - * @internal - */ - public function ttl(Message $message) - { - // select TTL from answers (should all be the same), use smallest value if available - // @link https://tools.ietf.org/html/rfc2181#section-5.2 - $ttl = null; - foreach ($message->answers as $answer) { - if ($ttl === null || $answer->ttl < $ttl) { - $ttl = $answer->ttl; - } - } - - if ($ttl === null) { - $ttl = self::TTL; - } - - return $ttl; - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/CancellationException.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/CancellationException.php deleted file mode 100644 index 5432b36f..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Query/CancellationException.php +++ /dev/null @@ -1,7 +0,0 @@ -executor = $base; - } - - public function query(Query $query) - { - $key = $this->serializeQueryToIdentity($query); - if (isset($this->pending[$key])) { - // same query is already pending, so use shared reference to pending query - $promise = $this->pending[$key]; - ++$this->counts[$key]; - } else { - // no such query pending, so start new query and keep reference until it's fulfilled or rejected - $promise = $this->executor->query($query); - $this->pending[$key] = $promise; - $this->counts[$key] = 1; - - $pending =& $this->pending; - $counts =& $this->counts; - $promise->then(function () use ($key, &$pending, &$counts) { - unset($pending[$key], $counts[$key]); - }, function () use ($key, &$pending, &$counts) { - unset($pending[$key], $counts[$key]); - }); - } - - // Return a child promise awaiting the pending query. - // Cancelling this child promise should only cancel the pending query - // when no other child promise is awaiting the same query. - $pending =& $this->pending; - $counts =& $this->counts; - return new Promise(function ($resolve, $reject) use ($promise) { - $promise->then($resolve, $reject); - }, function () use (&$promise, $key, $query, &$pending, &$counts) { - if (--$counts[$key] < 1) { - unset($pending[$key], $counts[$key]); - $promise->cancel(); - $promise = null; - } - throw new \RuntimeException('DNS query for ' . $query->describe() . ' has been cancelled'); - }); - } - - private function serializeQueryToIdentity(Query $query) - { - return sprintf('%s:%s:%s', $query->name, $query->type, $query->class); - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/ExecutorInterface.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/ExecutorInterface.php deleted file mode 100644 index 0bc3945f..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Query/ExecutorInterface.php +++ /dev/null @@ -1,43 +0,0 @@ -query($query)->then( - * function (React\Dns\Model\Message $response) { - * // response message successfully received - * var_dump($response->rcode, $response->answers); - * }, - * function (Exception $error) { - * // failed to query due to $error - * } - * ); - * ``` - * - * The returned Promise MUST be implemented in such a way that it can be - * cancelled when it is still pending. Cancelling a pending promise MUST - * reject its value with an Exception. It SHOULD clean up any underlying - * resources and references as applicable. - * - * ```php - * $promise = $executor->query($query); - * - * $promise->cancel(); - * ``` - * - * @param Query $query - * @return \React\Promise\PromiseInterface<\React\Dns\Model\Message> - * resolves with response message on success or rejects with an Exception on error - */ - public function query(Query $query); -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/FallbackExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/FallbackExecutor.php deleted file mode 100644 index 83bd360b..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Query/FallbackExecutor.php +++ /dev/null @@ -1,49 +0,0 @@ -executor = $executor; - $this->fallback = $fallback; - } - - public function query(Query $query) - { - $cancelled = false; - $fallback = $this->fallback; - $promise = $this->executor->query($query); - - return new Promise(function ($resolve, $reject) use (&$promise, $fallback, $query, &$cancelled) { - $promise->then($resolve, function (\Exception $e1) use ($fallback, $query, $resolve, $reject, &$cancelled, &$promise) { - // reject if primary resolution rejected due to cancellation - if ($cancelled) { - $reject($e1); - return; - } - - // start fallback query if primary query rejected - $promise = $fallback->query($query)->then($resolve, function (\Exception $e2) use ($e1, $reject) { - $append = $e2->getMessage(); - if (($pos = strpos($append, ':')) !== false) { - $append = substr($append, $pos + 2); - } - - // reject with combined error message if both queries fail - $reject(new \RuntimeException($e1->getMessage() . '. ' . $append)); - }); - }); - }, function () use (&$promise, &$cancelled) { - // cancel pending query (primary or fallback) - $cancelled = true; - $promise->cancel(); - }); - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/HostsFileExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/HostsFileExecutor.php deleted file mode 100644 index d6e2d934..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Query/HostsFileExecutor.php +++ /dev/null @@ -1,89 +0,0 @@ -hosts = $hosts; - $this->fallback = $fallback; - } - - public function query(Query $query) - { - if ($query->class === Message::CLASS_IN && ($query->type === Message::TYPE_A || $query->type === Message::TYPE_AAAA)) { - // forward lookup for type A or AAAA - $records = array(); - $expectsColon = $query->type === Message::TYPE_AAAA; - foreach ($this->hosts->getIpsForHost($query->name) as $ip) { - // ensure this is an IPv4/IPV6 address according to query type - if ((strpos($ip, ':') !== false) === $expectsColon) { - $records[] = new Record($query->name, $query->type, $query->class, 0, $ip); - } - } - - if ($records) { - return Promise\resolve( - Message::createResponseWithAnswersForQuery($query, $records) - ); - } - } elseif ($query->class === Message::CLASS_IN && $query->type === Message::TYPE_PTR) { - // reverse lookup: extract IPv4 or IPv6 from special `.arpa` domain - $ip = $this->getIpFromHost($query->name); - - if ($ip !== null) { - $records = array(); - foreach ($this->hosts->getHostsForIp($ip) as $host) { - $records[] = new Record($query->name, $query->type, $query->class, 0, $host); - } - - if ($records) { - return Promise\resolve( - Message::createResponseWithAnswersForQuery($query, $records) - ); - } - } - } - - return $this->fallback->query($query); - } - - private function getIpFromHost($host) - { - if (substr($host, -13) === '.in-addr.arpa') { - // IPv4: read as IP and reverse bytes - $ip = @inet_pton(substr($host, 0, -13)); - if ($ip === false || isset($ip[4])) { - return null; - } - - return inet_ntop(strrev($ip)); - } elseif (substr($host, -9) === '.ip6.arpa') { - // IPv6: replace dots, reverse nibbles and interpret as hexadecimal string - $ip = @inet_ntop(pack('H*', strrev(str_replace('.', '', substr($host, 0, -9))))); - if ($ip === false) { - return null; - } - - return $ip; - } else { - return null; - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/Query.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/Query.php deleted file mode 100644 index a3dcfb58..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Query/Query.php +++ /dev/null @@ -1,69 +0,0 @@ -name = $name; - $this->type = $type; - $this->class = $class; - } - - /** - * Describes the hostname and query type/class for this query - * - * The output format is supposed to be human readable and is subject to change. - * The format is inspired by RFC 3597 when handling unkown types/classes. - * - * @return string "example.com (A)" or "example.com (CLASS0 TYPE1234)" - * @link https://tools.ietf.org/html/rfc3597 - */ - public function describe() - { - $class = $this->class !== Message::CLASS_IN ? 'CLASS' . $this->class . ' ' : ''; - - $type = 'TYPE' . $this->type; - $ref = new \ReflectionClass('React\Dns\Model\Message'); - foreach ($ref->getConstants() as $name => $value) { - if ($value === $this->type && \strpos($name, 'TYPE_') === 0) { - $type = \substr($name, 5); - break; - } - } - - return $this->name . ' (' . $class . $type . ')'; - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/RetryExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/RetryExecutor.php deleted file mode 100644 index 880609b2..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Query/RetryExecutor.php +++ /dev/null @@ -1,85 +0,0 @@ -executor = $executor; - $this->retries = $retries; - } - - public function query(Query $query) - { - return $this->tryQuery($query, $this->retries); - } - - public function tryQuery(Query $query, $retries) - { - $deferred = new Deferred(function () use (&$promise) { - if ($promise instanceof PromiseInterface && \method_exists($promise, 'cancel')) { - $promise->cancel(); - } - }); - - $success = function ($value) use ($deferred, &$errorback) { - $errorback = null; - $deferred->resolve($value); - }; - - $executor = $this->executor; - $errorback = function ($e) use ($deferred, &$promise, $query, $success, &$errorback, &$retries, $executor) { - if (!$e instanceof TimeoutException) { - $errorback = null; - $deferred->reject($e); - } elseif ($retries <= 0) { - $errorback = null; - $deferred->reject($e = new \RuntimeException( - 'DNS query for ' . $query->describe() . ' failed: too many retries', - 0, - $e - )); - - // avoid garbage references by replacing all closures in call stack. - // what a lovely piece of code! - $r = new \ReflectionProperty('Exception', 'trace'); - $r->setAccessible(true); - $trace = $r->getValue($e); - - // Exception trace arguments are not available on some PHP 7.4 installs - // @codeCoverageIgnoreStart - foreach ($trace as $ti => $one) { - if (isset($one['args'])) { - foreach ($one['args'] as $ai => $arg) { - if ($arg instanceof \Closure) { - $trace[$ti]['args'][$ai] = 'Object(' . \get_class($arg) . ')'; - } - } - } - } - // @codeCoverageIgnoreEnd - $r->setValue($e, $trace); - } else { - --$retries; - $promise = $executor->query($query)->then( - $success, - $errorback - ); - } - }; - - $promise = $this->executor->query($query)->then( - $success, - $errorback - ); - - return $deferred->promise(); - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/SelectiveTransportExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/SelectiveTransportExecutor.php deleted file mode 100644 index 0f0ca5d0..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Query/SelectiveTransportExecutor.php +++ /dev/null @@ -1,85 +0,0 @@ -query( - * new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) - * )->then(function (Message $message) { - * foreach ($message->answers as $answer) { - * echo 'IPv6: ' . $answer->data . PHP_EOL; - * } - * }, 'printf'); - * ``` - * - * Note that this executor only implements the logic to select the correct - * transport for the given DNS query. Implementing the correct transport logic, - * implementing timeouts and any retry logic is left up to the given executors, - * see also [`UdpTransportExecutor`](#udptransportexecutor) and - * [`TcpTransportExecutor`](#tcptransportexecutor) for more details. - * - * Note that this executor is entirely async and as such allows you to execute - * any number of queries concurrently. You should probably limit the number of - * concurrent queries in your application or you're very likely going to face - * rate limitations and bans on the resolver end. For many common applications, - * you may want to avoid sending the same query multiple times when the first - * one is still pending, so you will likely want to use this in combination with - * a `CoopExecutor` like this: - * - * ```php - * $executor = new CoopExecutor( - * new SelectiveTransportExecutor( - * $datagramExecutor, - * $streamExecutor - * ) - * ); - * ``` - */ -class SelectiveTransportExecutor implements ExecutorInterface -{ - private $datagramExecutor; - private $streamExecutor; - - public function __construct(ExecutorInterface $datagramExecutor, ExecutorInterface $streamExecutor) - { - $this->datagramExecutor = $datagramExecutor; - $this->streamExecutor = $streamExecutor; - } - - public function query(Query $query) - { - $stream = $this->streamExecutor; - $pending = $this->datagramExecutor->query($query); - - return new Promise(function ($resolve, $reject) use (&$pending, $stream, $query) { - $pending->then( - $resolve, - function ($e) use (&$pending, $stream, $query, $resolve, $reject) { - if ($e->getCode() === (\defined('SOCKET_EMSGSIZE') ? \SOCKET_EMSGSIZE : 90)) { - $pending = $stream->query($query)->then($resolve, $reject); - } else { - $reject($e); - } - } - ); - }, function () use (&$pending) { - $pending->cancel(); - $pending = null; - }); - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/TcpTransportExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/TcpTransportExecutor.php deleted file mode 100644 index 669fd012..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Query/TcpTransportExecutor.php +++ /dev/null @@ -1,382 +0,0 @@ -query( - * new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) - * )->then(function (Message $message) { - * foreach ($message->answers as $answer) { - * echo 'IPv6: ' . $answer->data . PHP_EOL; - * } - * }, 'printf'); - * ``` - * - * See also [example #92](examples). - * - * Note that this executor does not implement a timeout, so you will very likely - * want to use this in combination with a `TimeoutExecutor` like this: - * - * ```php - * $executor = new TimeoutExecutor( - * new TcpTransportExecutor($nameserver), - * 3.0 - * ); - * ``` - * - * Unlike the `UdpTransportExecutor`, this class uses a reliable TCP/IP - * transport, so you do not necessarily have to implement any retry logic. - * - * Note that this executor is entirely async and as such allows you to execute - * queries concurrently. The first query will establish a TCP/IP socket - * connection to the DNS server which will be kept open for a short period. - * Additional queries will automatically reuse this existing socket connection - * to the DNS server, will pipeline multiple requests over this single - * connection and will keep an idle connection open for a short period. The - * initial TCP/IP connection overhead may incur a slight delay if you only send - * occasional queries – when sending a larger number of concurrent queries over - * an existing connection, it becomes increasingly more efficient and avoids - * creating many concurrent sockets like the UDP-based executor. You may still - * want to limit the number of (concurrent) queries in your application or you - * may be facing rate limitations and bans on the resolver end. For many common - * applications, you may want to avoid sending the same query multiple times - * when the first one is still pending, so you will likely want to use this in - * combination with a `CoopExecutor` like this: - * - * ```php - * $executor = new CoopExecutor( - * new TimeoutExecutor( - * new TcpTransportExecutor($nameserver), - * 3.0 - * ) - * ); - * ``` - * - * > Internally, this class uses PHP's TCP/IP sockets and does not take advantage - * of [react/socket](https://github.com/reactphp/socket) purely for - * organizational reasons to avoid a cyclic dependency between the two - * packages. Higher-level components should take advantage of the Socket - * component instead of reimplementing this socket logic from scratch. - */ -class TcpTransportExecutor implements ExecutorInterface -{ - private $nameserver; - private $loop; - private $parser; - private $dumper; - - /** - * @var ?resource - */ - private $socket; - - /** - * @var Deferred[] - */ - private $pending = array(); - - /** - * @var string[] - */ - private $names = array(); - - /** - * Maximum idle time when socket is current unused (i.e. no pending queries outstanding) - * - * If a new query is to be sent during the idle period, we can reuse the - * existing socket without having to wait for a new socket connection. - * This uses a rather small, hard-coded value to not keep any unneeded - * sockets open and to not keep the loop busy longer than needed. - * - * A future implementation may take advantage of `edns-tcp-keepalive` to keep - * the socket open for longer periods. This will likely require explicit - * configuration because this may consume additional resources and also keep - * the loop busy for longer than expected in some applications. - * - * @var float - * @link https://tools.ietf.org/html/rfc7766#section-6.2.1 - * @link https://tools.ietf.org/html/rfc7828 - */ - private $idlePeriod = 0.001; - - /** - * @var ?\React\EventLoop\TimerInterface - */ - private $idleTimer; - - private $writeBuffer = ''; - private $writePending = false; - - private $readBuffer = ''; - private $readPending = false; - - /** @var string */ - private $readChunk = 0xffff; - - /** - * @param string $nameserver - * @param ?LoopInterface $loop - */ - public function __construct($nameserver, $loop = null) - { - if (\strpos($nameserver, '[') === false && \substr_count($nameserver, ':') >= 2 && \strpos($nameserver, '://') === false) { - // several colons, but not enclosed in square brackets => enclose IPv6 address in square brackets - $nameserver = '[' . $nameserver . ']'; - } - - $parts = \parse_url((\strpos($nameserver, '://') === false ? 'tcp://' : '') . $nameserver); - if (!isset($parts['scheme'], $parts['host']) || $parts['scheme'] !== 'tcp' || @\inet_pton(\trim($parts['host'], '[]')) === false) { - throw new \InvalidArgumentException('Invalid nameserver address given'); - } - - if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 - throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); - } - - $this->nameserver = 'tcp://' . $parts['host'] . ':' . (isset($parts['port']) ? $parts['port'] : 53); - $this->loop = $loop ?: Loop::get(); - $this->parser = new Parser(); - $this->dumper = new BinaryDumper(); - } - - public function query(Query $query) - { - $request = Message::createRequestForQuery($query); - - // keep shuffing message ID to avoid using the same message ID for two pending queries at the same time - while (isset($this->pending[$request->id])) { - $request->id = \mt_rand(0, 0xffff); // @codeCoverageIgnore - } - - $queryData = $this->dumper->toBinary($request); - $length = \strlen($queryData); - if ($length > 0xffff) { - return \React\Promise\reject(new \RuntimeException( - 'DNS query for ' . $query->describe() . ' failed: Query too large for TCP transport' - )); - } - - $queryData = \pack('n', $length) . $queryData; - - if ($this->socket === null) { - // create async TCP/IP connection (may take a while) - $socket = @\stream_socket_client($this->nameserver, $errno, $errstr, 0, \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT); - if ($socket === false) { - return \React\Promise\reject(new \RuntimeException( - 'DNS query for ' . $query->describe() . ' failed: Unable to connect to DNS server ' . $this->nameserver . ' (' . $errstr . ')', - $errno - )); - } - - // set socket to non-blocking and wait for it to become writable (connection success/rejected) - \stream_set_blocking($socket, false); - if (\function_exists('stream_set_chunk_size')) { - \stream_set_chunk_size($socket, $this->readChunk); // @codeCoverageIgnore - } - $this->socket = $socket; - } - - if ($this->idleTimer !== null) { - $this->loop->cancelTimer($this->idleTimer); - $this->idleTimer = null; - } - - // wait for socket to become writable to actually write out data - $this->writeBuffer .= $queryData; - if (!$this->writePending) { - $this->writePending = true; - $this->loop->addWriteStream($this->socket, array($this, 'handleWritable')); - } - - $names =& $this->names; - $that = $this; - $deferred = new Deferred(function () use ($that, &$names, $request) { - // remove from list of pending names, but remember pending query - $name = $names[$request->id]; - unset($names[$request->id]); - $that->checkIdle(); - - throw new CancellationException('DNS query for ' . $name . ' has been cancelled'); - }); - - $this->pending[$request->id] = $deferred; - $this->names[$request->id] = $query->describe(); - - return $deferred->promise(); - } - - /** - * @internal - */ - public function handleWritable() - { - if ($this->readPending === false) { - $name = @\stream_socket_get_name($this->socket, true); - if ($name === false) { - // Connection failed? Check socket error if available for underlying errno/errstr. - // @codeCoverageIgnoreStart - if (\function_exists('socket_import_stream')) { - $socket = \socket_import_stream($this->socket); - $errno = \socket_get_option($socket, \SOL_SOCKET, \SO_ERROR); - $errstr = \socket_strerror($errno); - } else { - $errno = \defined('SOCKET_ECONNREFUSED') ? \SOCKET_ECONNREFUSED : 111; - $errstr = 'Connection refused'; - } - // @codeCoverageIgnoreEnd - - $this->closeError('Unable to connect to DNS server ' . $this->nameserver . ' (' . $errstr . ')', $errno); - return; - } - - $this->readPending = true; - $this->loop->addReadStream($this->socket, array($this, 'handleRead')); - } - - $errno = 0; - $errstr = ''; - \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { - // Match errstr from PHP's warning message. - // fwrite(): Send of 327712 bytes failed with errno=32 Broken pipe - \preg_match('/errno=(\d+) (.+)/', $error, $m); - $errno = isset($m[1]) ? (int) $m[1] : 0; - $errstr = isset($m[2]) ? $m[2] : $error; - }); - - $written = \fwrite($this->socket, $this->writeBuffer); - - \restore_error_handler(); - - if ($written === false || $written === 0) { - $this->closeError( - 'Unable to send query to DNS server ' . $this->nameserver . ' (' . $errstr . ')', - $errno - ); - return; - } - - if (isset($this->writeBuffer[$written])) { - $this->writeBuffer = \substr($this->writeBuffer, $written); - } else { - $this->loop->removeWriteStream($this->socket); - $this->writePending = false; - $this->writeBuffer = ''; - } - } - - /** - * @internal - */ - public function handleRead() - { - // read one chunk of data from the DNS server - // any error is fatal, this is a stream of TCP/IP data - $chunk = @\fread($this->socket, $this->readChunk); - if ($chunk === false || $chunk === '') { - $this->closeError('Connection to DNS server ' . $this->nameserver . ' lost'); - return; - } - - // reassemble complete message by concatenating all chunks. - $this->readBuffer .= $chunk; - - // response message header contains at least 12 bytes - while (isset($this->readBuffer[11])) { - // read response message length from first 2 bytes and ensure we have length + data in buffer - list(, $length) = \unpack('n', $this->readBuffer); - if (!isset($this->readBuffer[$length + 1])) { - return; - } - - $data = \substr($this->readBuffer, 2, $length); - $this->readBuffer = (string)substr($this->readBuffer, $length + 2); - - try { - $response = $this->parser->parseMessage($data); - } catch (\Exception $e) { - // reject all pending queries if we received an invalid message from remote server - $this->closeError('Invalid message received from DNS server ' . $this->nameserver); - return; - } - - // reject all pending queries if we received an unexpected response ID or truncated response - if (!isset($this->pending[$response->id]) || $response->tc) { - $this->closeError('Invalid response message received from DNS server ' . $this->nameserver); - return; - } - - $deferred = $this->pending[$response->id]; - unset($this->pending[$response->id], $this->names[$response->id]); - - $deferred->resolve($response); - - $this->checkIdle(); - } - } - - /** - * @internal - * @param string $reason - * @param int $code - */ - public function closeError($reason, $code = 0) - { - $this->readBuffer = ''; - if ($this->readPending) { - $this->loop->removeReadStream($this->socket); - $this->readPending = false; - } - - $this->writeBuffer = ''; - if ($this->writePending) { - $this->loop->removeWriteStream($this->socket); - $this->writePending = false; - } - - if ($this->idleTimer !== null) { - $this->loop->cancelTimer($this->idleTimer); - $this->idleTimer = null; - } - - @\fclose($this->socket); - $this->socket = null; - - foreach ($this->names as $id => $name) { - $this->pending[$id]->reject(new \RuntimeException( - 'DNS query for ' . $name . ' failed: ' . $reason, - $code - )); - } - $this->pending = $this->names = array(); - } - - /** - * @internal - */ - public function checkIdle() - { - if ($this->idleTimer === null && !$this->names) { - $that = $this; - $this->idleTimer = $this->loop->addTimer($this->idlePeriod, function () use ($that) { - $that->closeError('Idle timeout'); - }); - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/TimeoutException.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/TimeoutException.php deleted file mode 100644 index 109b0a9d..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Query/TimeoutException.php +++ /dev/null @@ -1,7 +0,0 @@ -executor = $executor; - $this->loop = $loop ?: Loop::get(); - $this->timeout = $timeout; - } - - public function query(Query $query) - { - $promise = $this->executor->query($query); - - $loop = $this->loop; - $time = $this->timeout; - return new Promise(function ($resolve, $reject) use ($loop, $time, $promise, $query) { - $timer = null; - $promise = $promise->then(function ($v) use (&$timer, $loop, $resolve) { - if ($timer) { - $loop->cancelTimer($timer); - } - $timer = false; - $resolve($v); - }, function ($v) use (&$timer, $loop, $reject) { - if ($timer) { - $loop->cancelTimer($timer); - } - $timer = false; - $reject($v); - }); - - // promise already resolved => no need to start timer - if ($timer === false) { - return; - } - - // start timeout timer which will cancel the pending promise - $timer = $loop->addTimer($time, function () use ($time, &$promise, $reject, $query) { - $reject(new TimeoutException( - 'DNS query for ' . $query->describe() . ' timed out' - )); - - // Cancel pending query to clean up any underlying resources and references. - // Avoid garbage references in call stack by passing pending promise by reference. - assert(\method_exists($promise, 'cancel')); - $promise->cancel(); - $promise = null; - }); - }, function () use (&$promise) { - // Cancelling this promise will cancel the pending query, thus triggering the rejection logic above. - // Avoid garbage references in call stack by passing pending promise by reference. - assert(\method_exists($promise, 'cancel')); - $promise->cancel(); - $promise = null; - }); - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Query/UdpTransportExecutor.php b/tools/php-cs-fixer/vendor/react/dns/src/Query/UdpTransportExecutor.php deleted file mode 100644 index a8cbfafa..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Query/UdpTransportExecutor.php +++ /dev/null @@ -1,221 +0,0 @@ -query( - * new Query($name, Message::TYPE_AAAA, Message::CLASS_IN) - * )->then(function (Message $message) { - * foreach ($message->answers as $answer) { - * echo 'IPv6: ' . $answer->data . PHP_EOL; - * } - * }, 'printf'); - * ``` - * - * See also the [fourth example](examples). - * - * Note that this executor does not implement a timeout, so you will very likely - * want to use this in combination with a `TimeoutExecutor` like this: - * - * ```php - * $executor = new TimeoutExecutor( - * new UdpTransportExecutor($nameserver), - * 3.0 - * ); - * ``` - * - * Also note that this executor uses an unreliable UDP transport and that it - * does not implement any retry logic, so you will likely want to use this in - * combination with a `RetryExecutor` like this: - * - * ```php - * $executor = new RetryExecutor( - * new TimeoutExecutor( - * new UdpTransportExecutor($nameserver), - * 3.0 - * ) - * ); - * ``` - * - * Note that this executor is entirely async and as such allows you to execute - * any number of queries concurrently. You should probably limit the number of - * concurrent queries in your application or you're very likely going to face - * rate limitations and bans on the resolver end. For many common applications, - * you may want to avoid sending the same query multiple times when the first - * one is still pending, so you will likely want to use this in combination with - * a `CoopExecutor` like this: - * - * ```php - * $executor = new CoopExecutor( - * new RetryExecutor( - * new TimeoutExecutor( - * new UdpTransportExecutor($nameserver), - * 3.0 - * ) - * ) - * ); - * ``` - * - * > Internally, this class uses PHP's UDP sockets and does not take advantage - * of [react/datagram](https://github.com/reactphp/datagram) purely for - * organizational reasons to avoid a cyclic dependency between the two - * packages. Higher-level components should take advantage of the Datagram - * component instead of reimplementing this socket logic from scratch. - */ -final class UdpTransportExecutor implements ExecutorInterface -{ - private $nameserver; - private $loop; - private $parser; - private $dumper; - - /** - * maximum UDP packet size to send and receive - * - * @var int - */ - private $maxPacketSize = 512; - - /** - * @param string $nameserver - * @param ?LoopInterface $loop - */ - public function __construct($nameserver, $loop = null) - { - if (\strpos($nameserver, '[') === false && \substr_count($nameserver, ':') >= 2 && \strpos($nameserver, '://') === false) { - // several colons, but not enclosed in square brackets => enclose IPv6 address in square brackets - $nameserver = '[' . $nameserver . ']'; - } - - $parts = \parse_url((\strpos($nameserver, '://') === false ? 'udp://' : '') . $nameserver); - if (!isset($parts['scheme'], $parts['host']) || $parts['scheme'] !== 'udp' || @\inet_pton(\trim($parts['host'], '[]')) === false) { - throw new \InvalidArgumentException('Invalid nameserver address given'); - } - - if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 - throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); - } - - $this->nameserver = 'udp://' . $parts['host'] . ':' . (isset($parts['port']) ? $parts['port'] : 53); - $this->loop = $loop ?: Loop::get(); - $this->parser = new Parser(); - $this->dumper = new BinaryDumper(); - } - - public function query(Query $query) - { - $request = Message::createRequestForQuery($query); - - $queryData = $this->dumper->toBinary($request); - if (isset($queryData[$this->maxPacketSize])) { - return \React\Promise\reject(new \RuntimeException( - 'DNS query for ' . $query->describe() . ' failed: Query too large for UDP transport', - \defined('SOCKET_EMSGSIZE') ? \SOCKET_EMSGSIZE : 90 - )); - } - - // UDP connections are instant, so try connection without a loop or timeout - $errno = 0; - $errstr = ''; - $socket = @\stream_socket_client($this->nameserver, $errno, $errstr, 0); - if ($socket === false) { - return \React\Promise\reject(new \RuntimeException( - 'DNS query for ' . $query->describe() . ' failed: Unable to connect to DNS server ' . $this->nameserver . ' (' . $errstr . ')', - $errno - )); - } - - // set socket to non-blocking and immediately try to send (fill write buffer) - \stream_set_blocking($socket, false); - - \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { - // Write may potentially fail, but most common errors are already caught by connection check above. - // Among others, macOS is known to report here when trying to send to broadcast address. - // This can also be reproduced by writing data exceeding `stream_set_chunk_size()` to a server refusing UDP data. - // fwrite(): send of 8192 bytes failed with errno=111 Connection refused - \preg_match('/errno=(\d+) (.+)/', $error, $m); - $errno = isset($m[1]) ? (int) $m[1] : 0; - $errstr = isset($m[2]) ? $m[2] : $error; - }); - - $written = \fwrite($socket, $queryData); - - \restore_error_handler(); - - if ($written !== \strlen($queryData)) { - return \React\Promise\reject(new \RuntimeException( - 'DNS query for ' . $query->describe() . ' failed: Unable to send query to DNS server ' . $this->nameserver . ' (' . $errstr . ')', - $errno - )); - } - - $loop = $this->loop; - $deferred = new Deferred(function () use ($loop, $socket, $query) { - // cancellation should remove socket from loop and close socket - $loop->removeReadStream($socket); - \fclose($socket); - - throw new CancellationException('DNS query for ' . $query->describe() . ' has been cancelled'); - }); - - $max = $this->maxPacketSize; - $parser = $this->parser; - $nameserver = $this->nameserver; - $loop->addReadStream($socket, function ($socket) use ($loop, $deferred, $query, $parser, $request, $max, $nameserver) { - // try to read a single data packet from the DNS server - // ignoring any errors, this is uses UDP packets and not a stream of data - $data = @\fread($socket, $max); - if ($data === false) { - return; - } - - try { - $response = $parser->parseMessage($data); - } catch (\Exception $e) { - // ignore and await next if we received an invalid message from remote server - // this may as well be a fake response from an attacker (possible DOS) - return; - } - - // ignore and await next if we received an unexpected response ID - // this may as well be a fake response from an attacker (possible cache poisoning) - if ($response->id !== $request->id) { - return; - } - - // we only react to the first valid message, so remove socket from loop and close - $loop->removeReadStream($socket); - \fclose($socket); - - if ($response->tc) { - $deferred->reject(new \RuntimeException( - 'DNS query for ' . $query->describe() . ' failed: The DNS server ' . $nameserver . ' returned a truncated result for a UDP query', - \defined('SOCKET_EMSGSIZE') ? \SOCKET_EMSGSIZE : 90 - )); - return; - } - - $deferred->resolve($response); - }); - - return $deferred->promise(); - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/RecordNotFoundException.php b/tools/php-cs-fixer/vendor/react/dns/src/RecordNotFoundException.php deleted file mode 100644 index 3b702742..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/RecordNotFoundException.php +++ /dev/null @@ -1,7 +0,0 @@ -decorateHostsFileExecutor($this->createExecutor($config, $loop ?: Loop::get())); - - return new Resolver($executor); - } - - /** - * Creates a cached DNS resolver instance for the given DNS config and cache - * - * As of v1.7.0 it's recommended to pass a `Config` object instead of a - * single nameserver address. If the given config contains more than one DNS - * nameserver, all DNS nameservers will be used in order. The primary DNS - * server will always be used first before falling back to the secondary or - * tertiary DNS server. - * - * @param Config|string $config DNS Config object (recommended) or single nameserver address - * @param ?LoopInterface $loop - * @param ?CacheInterface $cache - * @return \React\Dns\Resolver\ResolverInterface - * @throws \InvalidArgumentException for invalid DNS server address - * @throws \UnderflowException when given DNS Config object has an empty list of nameservers - */ - public function createCached($config, $loop = null, $cache = null) - { - if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 - throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); - } - - if ($cache !== null && !$cache instanceof CacheInterface) { // manual type check to support legacy PHP < 7.1 - throw new \InvalidArgumentException('Argument #3 ($cache) expected null|React\Cache\CacheInterface'); - } - - // default to keeping maximum of 256 responses in cache unless explicitly given - if (!($cache instanceof CacheInterface)) { - $cache = new ArrayCache(256); - } - - $executor = $this->createExecutor($config, $loop ?: Loop::get()); - $executor = new CachingExecutor($executor, $cache); - $executor = $this->decorateHostsFileExecutor($executor); - - return new Resolver($executor); - } - - /** - * Tries to load the hosts file and decorates the given executor on success - * - * @param ExecutorInterface $executor - * @return ExecutorInterface - * @codeCoverageIgnore - */ - private function decorateHostsFileExecutor(ExecutorInterface $executor) - { - try { - $executor = new HostsFileExecutor( - HostsFile::loadFromPathBlocking(), - $executor - ); - } catch (\RuntimeException $e) { - // ignore this file if it can not be loaded - } - - // Windows does not store localhost in hosts file by default but handles this internally - // To compensate for this, we explicitly use hard-coded defaults for localhost - if (DIRECTORY_SEPARATOR === '\\') { - $executor = new HostsFileExecutor( - new HostsFile("127.0.0.1 localhost\n::1 localhost"), - $executor - ); - } - - return $executor; - } - - /** - * @param Config|string $nameserver - * @param LoopInterface $loop - * @return CoopExecutor - * @throws \InvalidArgumentException for invalid DNS server address - * @throws \UnderflowException when given DNS Config object has an empty list of nameservers - */ - private function createExecutor($nameserver, LoopInterface $loop) - { - if ($nameserver instanceof Config) { - if (!$nameserver->nameservers) { - throw new \UnderflowException('Empty config with no DNS servers'); - } - - // Hard-coded to check up to 3 DNS servers to match default limits in place in most systems (see MAXNS config). - // Note to future self: Recursion isn't too hard, but how deep do we really want to go? - $primary = reset($nameserver->nameservers); - $secondary = next($nameserver->nameservers); - $tertiary = next($nameserver->nameservers); - - if ($tertiary !== false) { - // 3 DNS servers given => nest first with fallback for second and third - return new CoopExecutor( - new RetryExecutor( - new FallbackExecutor( - $this->createSingleExecutor($primary, $loop), - new FallbackExecutor( - $this->createSingleExecutor($secondary, $loop), - $this->createSingleExecutor($tertiary, $loop) - ) - ) - ) - ); - } elseif ($secondary !== false) { - // 2 DNS servers given => fallback from first to second - return new CoopExecutor( - new RetryExecutor( - new FallbackExecutor( - $this->createSingleExecutor($primary, $loop), - $this->createSingleExecutor($secondary, $loop) - ) - ) - ); - } else { - // 1 DNS server given => use single executor - $nameserver = $primary; - } - } - - return new CoopExecutor(new RetryExecutor($this->createSingleExecutor($nameserver, $loop))); - } - - /** - * @param string $nameserver - * @param LoopInterface $loop - * @return ExecutorInterface - * @throws \InvalidArgumentException for invalid DNS server address - */ - private function createSingleExecutor($nameserver, LoopInterface $loop) - { - $parts = \parse_url($nameserver); - - if (isset($parts['scheme']) && $parts['scheme'] === 'tcp') { - $executor = $this->createTcpExecutor($nameserver, $loop); - } elseif (isset($parts['scheme']) && $parts['scheme'] === 'udp') { - $executor = $this->createUdpExecutor($nameserver, $loop); - } else { - $executor = new SelectiveTransportExecutor( - $this->createUdpExecutor($nameserver, $loop), - $this->createTcpExecutor($nameserver, $loop) - ); - } - - return $executor; - } - - /** - * @param string $nameserver - * @param LoopInterface $loop - * @return TimeoutExecutor - * @throws \InvalidArgumentException for invalid DNS server address - */ - private function createTcpExecutor($nameserver, LoopInterface $loop) - { - return new TimeoutExecutor( - new TcpTransportExecutor($nameserver, $loop), - 5.0, - $loop - ); - } - - /** - * @param string $nameserver - * @param LoopInterface $loop - * @return TimeoutExecutor - * @throws \InvalidArgumentException for invalid DNS server address - */ - private function createUdpExecutor($nameserver, LoopInterface $loop) - { - return new TimeoutExecutor( - new UdpTransportExecutor( - $nameserver, - $loop - ), - 5.0, - $loop - ); - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Resolver/Resolver.php b/tools/php-cs-fixer/vendor/react/dns/src/Resolver/Resolver.php deleted file mode 100644 index 92926f3f..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Resolver/Resolver.php +++ /dev/null @@ -1,147 +0,0 @@ -executor = $executor; - } - - public function resolve($domain) - { - return $this->resolveAll($domain, Message::TYPE_A)->then(function (array $ips) { - return $ips[array_rand($ips)]; - }); - } - - public function resolveAll($domain, $type) - { - $query = new Query($domain, $type, Message::CLASS_IN); - $that = $this; - - return $this->executor->query( - $query - )->then(function (Message $response) use ($query, $that) { - return $that->extractValues($query, $response); - }); - } - - /** - * [Internal] extract all resource record values from response for this query - * - * @param Query $query - * @param Message $response - * @return array - * @throws RecordNotFoundException when response indicates an error or contains no data - * @internal - */ - public function extractValues(Query $query, Message $response) - { - // reject if response code indicates this is an error response message - $code = $response->rcode; - if ($code !== Message::RCODE_OK) { - switch ($code) { - case Message::RCODE_FORMAT_ERROR: - $message = 'Format Error'; - break; - case Message::RCODE_SERVER_FAILURE: - $message = 'Server Failure'; - break; - case Message::RCODE_NAME_ERROR: - $message = 'Non-Existent Domain / NXDOMAIN'; - break; - case Message::RCODE_NOT_IMPLEMENTED: - $message = 'Not Implemented'; - break; - case Message::RCODE_REFUSED: - $message = 'Refused'; - break; - default: - $message = 'Unknown error response code ' . $code; - } - throw new RecordNotFoundException( - 'DNS query for ' . $query->describe() . ' returned an error response (' . $message . ')', - $code - ); - } - - $answers = $response->answers; - $addresses = $this->valuesByNameAndType($answers, $query->name, $query->type); - - // reject if we did not receive a valid answer (domain is valid, but no record for this type could be found) - if (0 === count($addresses)) { - throw new RecordNotFoundException( - 'DNS query for ' . $query->describe() . ' did not return a valid answer (NOERROR / NODATA)' - ); - } - - return array_values($addresses); - } - - /** - * @param \React\Dns\Model\Record[] $answers - * @param string $name - * @param int $type - * @return array - */ - private function valuesByNameAndType(array $answers, $name, $type) - { - // return all record values for this name and type (if any) - $named = $this->filterByName($answers, $name); - $records = $this->filterByType($named, $type); - if ($records) { - return $this->mapRecordData($records); - } - - // no matching records found? check if there are any matching CNAMEs instead - $cnameRecords = $this->filterByType($named, Message::TYPE_CNAME); - if ($cnameRecords) { - $cnames = $this->mapRecordData($cnameRecords); - foreach ($cnames as $cname) { - $records = array_merge( - $records, - $this->valuesByNameAndType($answers, $cname, $type) - ); - } - } - - return $records; - } - - private function filterByName(array $answers, $name) - { - return $this->filterByField($answers, 'name', $name); - } - - private function filterByType(array $answers, $type) - { - return $this->filterByField($answers, 'type', $type); - } - - private function filterByField(array $answers, $field, $value) - { - $value = strtolower($value); - return array_filter($answers, function ($answer) use ($field, $value) { - return $value === strtolower($answer->$field); - }); - } - - private function mapRecordData(array $records) - { - return array_map(function ($record) { - return $record->data; - }, $records); - } -} diff --git a/tools/php-cs-fixer/vendor/react/dns/src/Resolver/ResolverInterface.php b/tools/php-cs-fixer/vendor/react/dns/src/Resolver/ResolverInterface.php deleted file mode 100644 index 555a1cb1..00000000 --- a/tools/php-cs-fixer/vendor/react/dns/src/Resolver/ResolverInterface.php +++ /dev/null @@ -1,94 +0,0 @@ -resolve('reactphp.org')->then(function ($ip) { - * echo 'IP for reactphp.org is ' . $ip . PHP_EOL; - * }); - * ``` - * - * This is one of the main methods in this package. It sends a DNS query - * for the given $domain name to your DNS server and returns a single IP - * address on success. - * - * If the DNS server sends a DNS response message that contains more than - * one IP address for this query, it will randomly pick one of the IP - * addresses from the response. If you want the full list of IP addresses - * or want to send a different type of query, you should use the - * [`resolveAll()`](#resolveall) method instead. - * - * If the DNS server sends a DNS response message that indicates an error - * code, this method will reject with a `RecordNotFoundException`. Its - * message and code can be used to check for the response code. - * - * If the DNS communication fails and the server does not respond with a - * valid response message, this message will reject with an `Exception`. - * - * Pending DNS queries can be cancelled by cancelling its pending promise like so: - * - * ```php - * $promise = $resolver->resolve('reactphp.org'); - * - * $promise->cancel(); - * ``` - * - * @param string $domain - * @return \React\Promise\PromiseInterface - * resolves with a single IP address on success or rejects with an Exception on error. - */ - public function resolve($domain); - - /** - * Resolves all record values for the given $domain name and query $type. - * - * ```php - * $resolver->resolveAll('reactphp.org', Message::TYPE_A)->then(function ($ips) { - * echo 'IPv4 addresses for reactphp.org ' . implode(', ', $ips) . PHP_EOL; - * }); - * - * $resolver->resolveAll('reactphp.org', Message::TYPE_AAAA)->then(function ($ips) { - * echo 'IPv6 addresses for reactphp.org ' . implode(', ', $ips) . PHP_EOL; - * }); - * ``` - * - * This is one of the main methods in this package. It sends a DNS query - * for the given $domain name to your DNS server and returns a list with all - * record values on success. - * - * If the DNS server sends a DNS response message that contains one or more - * records for this query, it will return a list with all record values - * from the response. You can use the `Message::TYPE_*` constants to control - * which type of query will be sent. Note that this method always returns a - * list of record values, but each record value type depends on the query - * type. For example, it returns the IPv4 addresses for type `A` queries, - * the IPv6 addresses for type `AAAA` queries, the hostname for type `NS`, - * `CNAME` and `PTR` queries and structured data for other queries. See also - * the `Record` documentation for more details. - * - * If the DNS server sends a DNS response message that indicates an error - * code, this method will reject with a `RecordNotFoundException`. Its - * message and code can be used to check for the response code. - * - * If the DNS communication fails and the server does not respond with a - * valid response message, this message will reject with an `Exception`. - * - * Pending DNS queries can be cancelled by cancelling its pending promise like so: - * - * ```php - * $promise = $resolver->resolveAll('reactphp.org', Message::TYPE_AAAA); - * - * $promise->cancel(); - * ``` - * - * @param string $domain - * @return \React\Promise\PromiseInterface - * Resolves with all record values on success or rejects with an Exception on error. - */ - public function resolveAll($domain, $type); -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/CHANGELOG.md b/tools/php-cs-fixer/vendor/react/event-loop/CHANGELOG.md deleted file mode 100644 index e634b12e..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/CHANGELOG.md +++ /dev/null @@ -1,468 +0,0 @@ -# Changelog - -## 1.5.0 (2023-11-13) - -* Feature: Improve performance by using `spl_object_id()` on PHP 7.2+. - (#267 by @samsonasik) - -* Feature: Full PHP 8.3 compatibility. - (#269 by @clue) - -* Update tests for `ext-uv` on PHP 8+ and legacy PHP. - (#270 by @clue and #268 by @SimonFrings) - -## 1.4.0 (2023-05-05) - -* Feature: Improve performance of `Loop` by avoiding unneeded method calls. - (#266 by @clue) - -* Feature: Support checking `EINTR` constant from `ext-pcntl` without `ext-sockets`. - (#265 by @clue) - -* Minor documentation improvements. - (#254 by @nhedger) - -* Improve test suite, run tests on PHP 8.2 and report failed assertions. - (#258 by @WyriHaximus, #264 by @clue and #251, #261 and #262 by @SimonFrings) - -## 1.3.0 (2022-03-17) - -* Feature: Improve default `StreamSelectLoop` to report any warnings for invalid streams. - (#245 by @clue) - -* Feature: Improve performance of `StreamSelectLoop` when no timers are scheduled. - (#246 by @clue) - -* Fix: Fix periodic timer with zero interval for `ExtEvLoop` and legacy `ExtLibevLoop`. - (#243 by @lucasnetau) - -* Minor documentation improvements, update PHP version references. - (#240, #248 and #250 by @SimonFrings, #241 by @dbu and #249 by @clue) - -* Improve test suite and test against PHP 8.1. - (#238 by @WyriHaximus and #242 by @clue) - -## 1.2.0 (2021-07-11) - -A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). - -* Feature: Introduce new concept of default loop with the new `Loop` class. - (#226 by @WyriHaximus, #229, #231 and #232 by @clue) - - The `Loop` class exists as a convenient global accessor for the event loop. - It provides all methods that exist on the `LoopInterface` as static methods and - will automatically execute the loop at the end of the program: - - ```php - $timer = Loop::addPeriodicTimer(0.1, function () { - echo 'Tick' . PHP_EOL; - }); - - Loop::addTimer(1.0, function () use ($timer) { - Loop::cancelTimer($timer); - echo 'Done' . PHP_EOL; - }); - ``` - - The explicit loop instructions are still valid and may still be useful in some applications, - especially for a transition period towards the more concise style. - The `Loop::get()` method can be used to get the currently active event loop instance. - - ```php - // deprecated - $loop = React\EventLoop\Factory::create(); - - // new - $loop = React\EventLoop\Loop::get(); - ``` - -* Minor documentation improvements and mark legacy extensions as deprecated. - (#234 by @SimonFrings, #214 by @WyriHaximus and #233 and #235 by @nhedger) - -* Improve test suite, use GitHub actions for continuous integration (CI), - update PHPUnit config and run tests on PHP 8. - (#212 and #215 by @SimonFrings and #230 by @clue) - -## 1.1.1 (2020-01-01) - -* Fix: Fix reporting connection refused errors with `ExtUvLoop` on Linux and `StreamSelectLoop` on Windows. - (#207 and #208 by @clue) - -* Fix: Fix unsupported EventConfig and `SEGFAULT` on shutdown with `ExtEventLoop` on Windows. - (#205 by @clue) - -* Fix: Prevent interval overflow for timers very far in the future with `ExtUvLoop`. - (#196 by @PabloKowalczyk) - -* Fix: Check PCNTL functions for signal support instead of PCNTL extension with `StreamSelectLoop`. - (#195 by @clue) - -* Add `.gitattributes` to exclude dev files from exports. - (#201 by @reedy) - -* Improve test suite to fix testing `ExtUvLoop` on Travis, - fix Travis CI builds, do not install `libuv` on legacy PHP setups, - fix failing test cases due to inaccurate timers, - run tests on Windows via Travis CI and - run tests on PHP 7.4 and simplify test matrix and test setup. - (#197 by @WyriHaximus and #202, #203, #204 and #209 by @clue) - -## 1.1.0 (2019-02-07) - -* New UV based event loop (ext-uv). - (#112 by @WyriHaximus) - -* Use high resolution timer on PHP 7.3+. - (#182 by @clue) - -* Improve PCNTL signals by using async signal dispatching if available. - (#179 by @CharlotteDunois) - -* Improve test suite and test suite set up. - (#174 by @WyriHaximus, #181 by @clue) - -* Fix PCNTL signals edge case. - (#183 by @clue) - -## 1.0.0 (2018-07-11) - -* First stable LTS release, now following [SemVer](https://semver.org/). - We'd like to emphasize that this component is production ready and battle-tested. - We plan to support all long-term support (LTS) releases for at least 24 months, - so you have a rock-solid foundation to build on top of. - -> Contains no other changes, so it's actually fully compatible with the v0.5.3 release. - -## 0.5.3 (2018-07-09) - -* Improve performance by importing global functions. - (#167 by @Ocramius) - -* Improve test suite by simplifying test bootstrap by using dev autoloader. - (#169 by @lcobucci) - -* Minor internal changes to improved backward compatibility with PHP 5.3. - (#166 by @Donatello-za) - -## 0.5.2 (2018-04-24) - -* Feature: Improve memory consumption and runtime performance for `StreamSelectLoop` timers. - (#164 by @clue) - -* Improve test suite by removing I/O dependency at `StreamSelectLoopTest` to fix Mac OS X tests. - (#161 by @nawarian) - -## 0.5.1 (2018-04-09) - -* Feature: New `ExtEvLoop` (PECL ext-ev) (#148 by @kaduev13) - -## 0.5.0 (2018-04-05) - -A major feature release with a significant documentation overhaul and long overdue API cleanup! - -This update involves a number of BC breaks due to dropped support for deprecated -functionality. We've tried hard to avoid BC breaks where possible and minimize -impact otherwise. We expect that most consumers of this package will actually -not be affected by any BC breaks, see below for more details. - -We realize that the changes listed below may seem overwhelming, but we've tried -to be very clear about any possible BC breaks. Don't worry: In fact, all ReactPHP -components are already compatible and support both this new release as well as -providing backwards compatibility with the last release. - -* Feature / BC break: Add support for signal handling via new - `LoopInterface::addSignal()` and `LoopInterface::removeSignal()` methods. - (#104 by @WyriHaximus and #111 and #150 by @clue) - - ```php - $loop->addSignal(SIGINT, function () { - echo 'CTRL-C'; - }); - ``` - -* Feature: Significant documentation updates for `LoopInterface` and `Factory`. - (#100, #119, #126, #127, #159 and #160 by @clue, #113 by @WyriHaximus and #81 and #91 by @jsor) - -* Feature: Add examples to ease getting started - (#99, #100 and #125 by @clue, #59 by @WyriHaximus and #143 by @jsor) - -* Feature: Documentation for advanced timer concepts, such as monotonic time source vs wall-clock time - and high precision timers with millisecond accuracy or below. - (#130 and #157 by @clue) - -* Feature: Documentation for advanced stream concepts, such as edge-triggered event listeners - and stream buffers and allow throwing Exception if stream resource is not supported. - (#129 and #158 by @clue) - -* Feature: Throw `BadMethodCallException` on manual loop creation when required extension isn't installed. - (#153 by @WyriHaximus) - -* Feature / BC break: First class support for legacy PHP 5.3 through PHP 7.2 and HHVM - and remove all `callable` type hints for consistency reasons. - (#141 and #151 by @clue) - -* BC break: Documentation for timer API and clean up unneeded timer API. - (#102 by @clue) - - Remove `TimerInterface::cancel()`, use `LoopInterface::cancelTimer()` instead: - - ```php - // old (method invoked on timer instance) - $timer->cancel(); - - // already supported before: invoke method on loop instance - $loop->cancelTimer($timer); - ``` - - Remove unneeded `TimerInterface::setData()` and `TimerInterface::getData()`, - use closure binding to add arbitrary data to timer instead: - - ```php - // old (limited setData() and getData() only allows single variable) - $name = 'Tester'; - $timer = $loop->addTimer(1.0, function ($timer) { - echo 'Hello ' . $timer->getData() . PHP_EOL; - }); - $timer->setData($name); - - // already supported before: closure binding allows any number of variables - $name = 'Tester'; - $loop->addTimer(1.0, function () use ($name) { - echo 'Hello ' . $name . PHP_EOL; - }); - ``` - - Remove unneeded `TimerInterface::getLoop()`, use closure binding instead: - - ```php - // old (getLoop() called on timer instance) - $loop->addTimer(0.1, function ($timer) { - $timer->getLoop()->stop(); - }); - - // already supported before: use closure binding as usual - $loop->addTimer(0.1, function () use ($loop) { - $loop->stop(); - }); - ``` - -* BC break: Remove unneeded `LoopInterface::isTimerActive()` and - `TimerInterface::isActive()` to reduce API surface. - (#133 by @clue) - - ```php - // old (method on timer instance or on loop instance) - $timer->isActive(); - $loop->isTimerActive($timer); - ``` - -* BC break: Move `TimerInterface` one level up to `React\EventLoop\TimerInterface`. - (#138 by @WyriHaximus) - - ```php - // old (notice obsolete "Timer" namespace) - assert($timer instanceof React\EventLoop\Timer\TimerInterface); - - // new - assert($timer instanceof React\EventLoop\TimerInterface); - ``` - -* BC break: Remove unneeded `LoopInterface::nextTick()` (and internal `NextTickQueue`), - use `LoopInterface::futureTick()` instead. - (#30 by @clue) - - ```php - // old (removed) - $loop->nextTick(function () { - echo 'tick'; - }); - - // already supported before - $loop->futureTick(function () { - echo 'tick'; - }); - ``` - -* BC break: Remove unneeded `$loop` argument for `LoopInterface::futureTick()` - (and fix internal cyclic dependency). - (#103 by @clue) - - ```php - // old ($loop gets passed by default) - $loop->futureTick(function ($loop) { - $loop->stop(); - }); - - // already supported before: use closure binding as usual - $loop->futureTick(function () use ($loop) { - $loop->stop(); - }); - ``` - -* BC break: Remove unneeded `LoopInterface::tick()`. - (#72 by @jsor) - - ```php - // old (removed) - $loop->tick(); - - // suggested work around for testing purposes only - $loop->futureTick(function () use ($loop) { - $loop->stop(); - }); - ``` - -* BC break: Documentation for advanced stream API and clean up unneeded stream API. - (#110 by @clue) - - Remove unneeded `$loop` argument for `LoopInterface::addReadStream()` - and `LoopInterface::addWriteStream()`, use closure binding instead: - - ```php - // old ($loop gets passed by default) - $loop->addReadStream($stream, function ($stream, $loop) { - $loop->removeReadStream($stream); - }); - - // already supported before: use closure binding as usual - $loop->addReadStream($stream, function ($stream) use ($loop) { - $loop->removeReadStream($stream); - }); - ``` - -* BC break: Remove unneeded `LoopInterface::removeStream()` method, - use `LoopInterface::removeReadStream()` and `LoopInterface::removeWriteStream()` instead. - (#118 by @clue) - - ```php - // old - $loop->removeStream($stream); - - // already supported before - $loop->removeReadStream($stream); - $loop->removeWriteStream($stream); - ``` - -* BC break: Rename `LibEventLoop` to `ExtLibeventLoop` and `LibEvLoop` to `ExtLibevLoop` - for consistent naming for event loop implementations. - (#128 by @clue) - -* BC break: Remove optional `EventBaseConfig` argument from `ExtEventLoop` - and make its `FEATURE_FDS` enabled by default. - (#156 by @WyriHaximus) - -* BC break: Mark all classes as final to discourage inheritance. - (#131 by @clue) - -* Fix: Fix `ExtEventLoop` to keep track of stream resources (refcount) - (#123 by @clue) - -* Fix: Ensure large timer interval does not overflow on 32bit systems - (#132 by @clue) - -* Fix: Fix separately removing readable and writable side of stream when closing - (#139 by @clue) - -* Fix: Properly clean up event watchers for `ext-event` and `ext-libev` - (#149 by @clue) - -* Fix: Minor code cleanup and remove unneeded references - (#145 by @seregazhuk) - -* Fix: Discourage outdated `ext-libevent` on PHP 7 - (#62 by @cboden) - -* Improve test suite by adding forward compatibility with PHPUnit 6 and PHPUnit 5, - lock Travis distro so new defaults will not break the build, - improve test suite to be less fragile and increase test timeouts, - test against PHP 7.2 and reduce fwrite() call length to one chunk. - (#106 and #144 by @clue, #120 and #124 by @carusogabriel, #147 by nawarian and #92 by @kelunik) - -* A number of changes were originally planned for this release but have been backported - to the last `v0.4.3` already: #74, #76, #79, #81 (refs #65, #66, #67), #88 and #93 - -## 0.4.3 (2017-04-27) - -* Bug fix: Bugfix in the usage sample code #57 (@dandelionred) -* Improvement: Remove branch-alias definition #53 (@WyriHaximus) -* Improvement: StreamSelectLoop: Use fresh time so Timers added during stream events are accurate #51 (@andrewminerd) -* Improvement: Avoid deprecation warnings in test suite due to deprecation of getMock() in PHPUnit #68 (@martinschroeder) -* Improvement: Add PHPUnit 4.8 to require-dev #69 (@shaunbramley) -* Improvement: Increase test timeouts for HHVM and unify timeout handling #70 (@clue) -* Improvement: Travis improvements (backported from #74) #75 (@clue) -* Improvement: Test suite now uses socket pairs instead of memory streams #66 (@martinschroeder) -* Improvement: StreamSelectLoop: Test suite uses signal constant names in data provider #67 (@martinschroeder) -* Improvement: ExtEventLoop: No longer suppress all errors #65 (@mamciek) -* Improvement: Readme cleanup #89 (@jsor) -* Improvement: Restructure and improve README #90 (@jsor) -* Bug fix: StreamSelectLoop: Fix erroneous zero-time sleep (backport to 0.4) #94 (@jsor) - -## 0.4.2 (2016-03-07) - -* Bug fix: No longer error when signals sent to StreamSelectLoop -* Support HHVM and PHP7 (@ondrejmirtes, @cebe) -* Feature: Added support for EventConfig for ExtEventLoop (@steverhoades) -* Bug fix: Fixed an issue loading loop extension libs via autoloader (@czarpino) - -## 0.4.1 (2014-04-13) - -* Bug fix: null timeout in StreamSelectLoop causing 100% CPU usage (@clue) -* Bug fix: v0.3.4 changes merged for v0.4.1 - -## 0.4.0 (2014-02-02) - -* Feature: Added `EventLoopInterface::nextTick()`, implemented in all event loops (@jmalloc) -* Feature: Added `EventLoopInterface::futureTick()`, implemented in all event loops (@jmalloc) -* Feature: Added `ExtEventLoop` implementation using pecl/event (@jmalloc) -* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks -* BC break: New method: `EventLoopInterface::nextTick()` -* BC break: New method: `EventLoopInterface::futureTick()` -* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0 - -## 0.3.5 (2016-12-28) - -This is a compatibility release that eases upgrading to the v0.4 release branch. -You should consider upgrading to the v0.4 release branch. - -* Feature: Cap min timer interval at 1µs, thus improving compatibility with v0.4 - (#47 by @clue) - -## 0.3.4 (2014-03-30) - -* Bug fix: Changed StreamSelectLoop to use non-blocking behavior on tick() (@astephens25) - -## 0.3.3 (2013-07-08) - -* Bug fix: No error on removing non-existent streams (@clue) -* Bug fix: Do not silently remove feof listeners in `LibEvLoop` - -## 0.3.0 (2013-04-14) - -* BC break: New timers API (@nrk) -* BC break: Remove check on return value from stream callbacks (@nrk) - -## 0.2.7 (2013-01-05) - -* Bug fix: Fix libevent timers with PHP 5.3 -* Bug fix: Fix libevent timer cancellation (@nrk) - -## 0.2.6 (2012-12-26) - -* Bug fix: Plug memory issue in libevent timers (@cameronjacobson) -* Bug fix: Correctly pause LibEvLoop on stop() - -## 0.2.3 (2012-11-14) - -* Feature: LibEvLoop, integration of `php-libev` - -## 0.2.0 (2012-09-10) - -* Version bump - -## 0.1.1 (2012-07-12) - -* Version bump - -## 0.1.0 (2012-07-11) - -* First tagged release diff --git a/tools/php-cs-fixer/vendor/react/event-loop/LICENSE b/tools/php-cs-fixer/vendor/react/event-loop/LICENSE deleted file mode 100644 index d6f8901f..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/event-loop/README.md b/tools/php-cs-fixer/vendor/react/event-loop/README.md deleted file mode 100644 index 88a3e18b..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/README.md +++ /dev/null @@ -1,930 +0,0 @@ -# EventLoop - -[![CI status](https://github.com/reactphp/event-loop/actions/workflows/ci.yml/badge.svg)](https://github.com/reactphp/event-loop/actions) -[![installs on Packagist](https://img.shields.io/packagist/dt/react/event-loop?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/event-loop) - -[ReactPHP](https://reactphp.org/)'s core reactor event loop that libraries can use for evented I/O. - -In order for async based libraries to be interoperable, they need to use the -same event loop. This component provides a common `LoopInterface` that any -library can target. This allows them to be used in the same loop, with one -single [`run()`](#run) call that is controlled by the user. - -**Table of contents** - -* [Quickstart example](#quickstart-example) -* [Usage](#usage) - * [Loop](#loop) - * [Loop methods](#loop-methods) - * [Loop autorun](#loop-autorun) - * [get()](#get) - * [~~Factory~~](#factory) - * [~~create()~~](#create) - * [Loop implementations](#loop-implementations) - * [StreamSelectLoop](#streamselectloop) - * [ExtEventLoop](#exteventloop) - * [ExtEvLoop](#extevloop) - * [ExtUvLoop](#extuvloop) - * [~~ExtLibeventLoop~~](#extlibeventloop) - * [~~ExtLibevLoop~~](#extlibevloop) - * [LoopInterface](#loopinterface) - * [run()](#run) - * [stop()](#stop) - * [addTimer()](#addtimer) - * [addPeriodicTimer()](#addperiodictimer) - * [cancelTimer()](#canceltimer) - * [futureTick()](#futuretick) - * [addSignal()](#addsignal) - * [removeSignal()](#removesignal) - * [addReadStream()](#addreadstream) - * [addWriteStream()](#addwritestream) - * [removeReadStream()](#removereadstream) - * [removeWriteStream()](#removewritestream) -* [Install](#install) -* [Tests](#tests) -* [License](#license) -* [More](#more) - -## Quickstart example - -Here is an async HTTP server built with just the event loop. - -```php -addPeriodicTimer(0.1, function () { - echo 'Tick' . PHP_EOL; -}); - -$loop->addTimer(1.0, function () use ($loop, $timer) { - $loop->cancelTimer($timer); - echo 'Done' . PHP_EOL; -}); - -$loop->run(); -``` - -While the former is more concise, the latter is more explicit. -In both cases, the program would perform the exact same steps. - -1. The event loop instance is created at the beginning of the program. This is - implicitly done the first time you call the [`Loop` class](#loop) or - explicitly when using the deprecated [`Factory::create()` method](#create) - (or manually instantiating any of the [loop implementations](#loop-implementations)). -2. The event loop is used directly or passed as an instance to library and - application code. In this example, a periodic timer is registered with the - event loop which simply outputs `Tick` every fraction of a second until another - timer stops the periodic timer after a second. -3. The event loop is run at the end of the program. This is automatically done - when using the [`Loop` class](#loop) or explicitly with a single [`run()`](#run) - call at the end of the program. - -As of `v1.2.0`, we highly recommend using the [`Loop` class](#loop). -The explicit loop instructions are still valid and may still be useful in some -applications, especially for a transition period towards the more concise style. - -### Loop - -The `Loop` class exists as a convenient global accessor for the event loop. - -#### Loop methods - -The `Loop` class provides all methods that exist on the [`LoopInterface`](#loopinterface) -as static methods: - -* [run()](#run) -* [stop()](#stop) -* [addTimer()](#addtimer) -* [addPeriodicTimer()](#addperiodictimer) -* [cancelTimer()](#canceltimer) -* [futureTick()](#futuretick) -* [addSignal()](#addsignal) -* [removeSignal()](#removesignal) -* [addReadStream()](#addreadstream) -* [addWriteStream()](#addwritestream) -* [removeReadStream()](#removereadstream) -* [removeWriteStream()](#removewritestream) - -If you're working with the event loop in your application code, it's often -easiest to directly interface with the static methods defined on the `Loop` class -like this: - -```php -use React\EventLoop\Loop; - -$timer = Loop::addPeriodicTimer(0.1, function () { - echo 'Tick' . PHP_EOL; -}); - -Loop::addTimer(1.0, function () use ($timer) { - Loop::cancelTimer($timer); - echo 'Done' . PHP_EOL; -}); -``` - -On the other hand, if you're familiar with object-oriented programming (OOP) and -dependency injection (DI), you may want to inject an event loop instance and -invoke instance methods on the `LoopInterface` like this: - -```php -use React\EventLoop\Loop; -use React\EventLoop\LoopInterface; - -class Greeter -{ - private $loop; - - public function __construct(LoopInterface $loop) - { - $this->loop = $loop; - } - - public function greet(string $name) - { - $this->loop->addTimer(1.0, function () use ($name) { - echo 'Hello ' . $name . '!' . PHP_EOL; - }); - } -} - -$greeter = new Greeter(Loop::get()); -$greeter->greet('Alice'); -$greeter->greet('Bob'); -``` - -Each static method call will be forwarded as-is to the underlying event loop -instance by using the [`Loop::get()`](#get) call internally. -See [`LoopInterface`](#loopinterface) for more details about available methods. - -#### Loop autorun - -When using the `Loop` class, it will automatically execute the loop at the end of -the program. This means the following example will schedule a timer and will -automatically execute the program until the timer event fires: - -```php -use React\EventLoop\Loop; - -Loop::addTimer(1.0, function () { - echo 'Hello' . PHP_EOL; -}); -``` - -As of `v1.2.0`, we highly recommend using the `Loop` class this way and omitting any -explicit [`run()`](#run) calls. For BC reasons, the explicit [`run()`](#run) -method is still valid and may still be useful in some applications, especially -for a transition period towards the more concise style. - -If you don't want the `Loop` to run automatically, you can either explicitly -[`run()`](#run) or [`stop()`](#stop) it. This can be useful if you're using -a global exception handler like this: - -```php -use React\EventLoop\Loop; - -Loop::addTimer(10.0, function () { - echo 'Never happens'; -}); - -set_exception_handler(function (Throwable $e) { - echo 'Error: ' . $e->getMessage() . PHP_EOL; - Loop::stop(); -}); - -throw new RuntimeException('Demo'); -``` - -#### get() - -The `get(): LoopInterface` method can be used to -get the currently active event loop instance. - -This method will always return the same event loop instance throughout the -lifetime of your application. - -```php -use React\EventLoop\Loop; -use React\EventLoop\LoopInterface; - -$loop = Loop::get(); - -assert($loop instanceof LoopInterface); -assert($loop === Loop::get()); -``` - -This is particularly useful if you're using object-oriented programming (OOP) -and dependency injection (DI). In this case, you may want to inject an event -loop instance and invoke instance methods on the `LoopInterface` like this: - -```php -use React\EventLoop\Loop; -use React\EventLoop\LoopInterface; - -class Greeter -{ - private $loop; - - public function __construct(LoopInterface $loop) - { - $this->loop = $loop; - } - - public function greet(string $name) - { - $this->loop->addTimer(1.0, function () use ($name) { - echo 'Hello ' . $name . '!' . PHP_EOL; - }); - } -} - -$greeter = new Greeter(Loop::get()); -$greeter->greet('Alice'); -$greeter->greet('Bob'); -``` - -See [`LoopInterface`](#loopinterface) for more details about available methods. - -### ~~Factory~~ - -> Deprecated since v1.2.0, see [`Loop` class](#loop) instead. - -The deprecated `Factory` class exists as a convenient way to pick the best available -[event loop implementation](#loop-implementations). - -#### ~~create()~~ - -> Deprecated since v1.2.0, see [`Loop::get()`](#get) instead. - -The deprecated `create(): LoopInterface` method can be used to -create a new event loop instance: - -```php -// deprecated -$loop = React\EventLoop\Factory::create(); - -// new -$loop = React\EventLoop\Loop::get(); -``` - -This method always returns an instance implementing [`LoopInterface`](#loopinterface), -the actual [event loop implementation](#loop-implementations) is an implementation detail. - -This method should usually only be called once at the beginning of the program. - -### Loop implementations - -In addition to the [`LoopInterface`](#loopinterface), there are a number of -event loop implementations provided. - -All of the event loops support these features: - -* File descriptor polling -* One-off timers -* Periodic timers -* Deferred execution on future loop tick - -For most consumers of this package, the underlying event loop implementation is -an implementation detail. -You should use the [`Loop` class](#loop) to automatically create a new instance. - -Advanced! If you explicitly need a certain event loop implementation, you can -manually instantiate one of the following classes. -Note that you may have to install the required PHP extensions for the respective -event loop implementation first or they will throw a `BadMethodCallException` on creation. - -#### StreamSelectLoop - -A `stream_select()` based event loop. - -This uses the [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php) -function and is the only implementation that works out of the box with PHP. - -This event loop works out of the box on PHP 5.3 through PHP 8+ and HHVM. -This means that no installation is required and this library works on all -platforms and supported PHP versions. -Accordingly, the [`Loop` class](#loop) and the deprecated [`Factory`](#factory) -will use this event loop by default if you do not install any of the event loop -extensions listed below. - -Under the hood, it does a simple `select` system call. -This system call is limited to the maximum file descriptor number of -`FD_SETSIZE` (platform dependent, commonly 1024) and scales with `O(m)` -(`m` being the maximum file descriptor number passed). -This means that you may run into issues when handling thousands of streams -concurrently and you may want to look into using one of the alternative -event loop implementations listed below in this case. -If your use case is among the many common use cases that involve handling only -dozens or a few hundred streams at once, then this event loop implementation -performs really well. - -If you want to use signal handling (see also [`addSignal()`](#addsignal) below), -this event loop implementation requires `ext-pcntl`. -This extension is only available for Unix-like platforms and does not support -Windows. -It is commonly installed as part of many PHP distributions. -If this extension is missing (or you're running on Windows), signal handling is -not supported and throws a `BadMethodCallException` instead. - -This event loop is known to rely on wall-clock time to schedule future timers -when using any version before PHP 7.3, because a monotonic time source is -only available as of PHP 7.3 (`hrtime()`). -While this does not affect many common use cases, this is an important -distinction for programs that rely on a high time precision or on systems -that are subject to discontinuous time adjustments (time jumps). -This means that if you schedule a timer to trigger in 30s on PHP < 7.3 and -then adjust your system time forward by 20s, the timer may trigger in 10s. -See also [`addTimer()`](#addtimer) for more details. - -#### ExtEventLoop - -An `ext-event` based event loop. - -This uses the [`event` PECL extension](https://pecl.php.net/package/event), -that provides an interface to `libevent` library. -`libevent` itself supports a number of system-specific backends (epoll, kqueue). - -This loop is known to work with PHP 5.4 through PHP 8+. - -#### ExtEvLoop - -An `ext-ev` based event loop. - -This loop uses the [`ev` PECL extension](https://pecl.php.net/package/ev), -that provides an interface to `libev` library. -`libev` itself supports a number of system-specific backends (epoll, kqueue). - - -This loop is known to work with PHP 5.4 through PHP 8+. - -#### ExtUvLoop - -An `ext-uv` based event loop. - -This loop uses the [`uv` PECL extension](https://pecl.php.net/package/uv), -that provides an interface to `libuv` library. -`libuv` itself supports a number of system-specific backends (epoll, kqueue). - -This loop is known to work with PHP 7+. - -#### ~~ExtLibeventLoop~~ - -> Deprecated since v1.2.0, use [`ExtEventLoop`](#exteventloop) instead. - -An `ext-libevent` based event loop. - -This uses the [`libevent` PECL extension](https://pecl.php.net/package/libevent), -that provides an interface to `libevent` library. -`libevent` itself supports a number of system-specific backends (epoll, kqueue). - -This event loop does only work with PHP 5. -An [unofficial update](https://github.com/php/pecl-event-libevent/pull/2) for -PHP 7 does exist, but it is known to cause regular crashes due to `SEGFAULT`s. -To reiterate: Using this event loop on PHP 7 is not recommended. -Accordingly, neither the [`Loop` class](#loop) nor the deprecated -[`Factory` class](#factory) will try to use this event loop on PHP 7. - -This event loop is known to trigger a readable listener only if -the stream *becomes* readable (edge-triggered) and may not trigger if the -stream has already been readable from the beginning. -This also implies that a stream may not be recognized as readable when data -is still left in PHP's internal stream buffers. -As such, it's recommended to use `stream_set_read_buffer($stream, 0);` -to disable PHP's internal read buffer in this case. -See also [`addReadStream()`](#addreadstream) for more details. - -#### ~~ExtLibevLoop~~ - -> Deprecated since v1.2.0, use [`ExtEvLoop`](#extevloop) instead. - -An `ext-libev` based event loop. - -This uses an [unofficial `libev` extension](https://github.com/m4rw3r/php-libev), -that provides an interface to `libev` library. -`libev` itself supports a number of system-specific backends (epoll, kqueue). - -This loop does only work with PHP 5. -An update for PHP 7 is [unlikely](https://github.com/m4rw3r/php-libev/issues/8) -to happen any time soon. - -### LoopInterface - -#### run() - -The `run(): void` method can be used to -run the event loop until there are no more tasks to perform. - -For many applications, this method is the only directly visible -invocation on the event loop. -As a rule of thumb, it is usually recommended to attach everything to the -same loop instance and then run the loop once at the bottom end of the -application. - -```php -$loop->run(); -``` - -This method will keep the loop running until there are no more tasks -to perform. In other words: This method will block until the last -timer, stream and/or signal has been removed. - -Likewise, it is imperative to ensure the application actually invokes -this method once. Adding listeners to the loop and missing to actually -run it will result in the application exiting without actually waiting -for any of the attached listeners. - -This method MUST NOT be called while the loop is already running. -This method MAY be called more than once after it has explicitly been -[`stop()`ped](#stop) or after it automatically stopped because it -previously did no longer have anything to do. - -#### stop() - -The `stop(): void` method can be used to -instruct a running event loop to stop. - -This method is considered advanced usage and should be used with care. -As a rule of thumb, it is usually recommended to let the loop stop -only automatically when it no longer has anything to do. - -This method can be used to explicitly instruct the event loop to stop: - -```php -$loop->addTimer(3.0, function () use ($loop) { - $loop->stop(); -}); -``` - -Calling this method on a loop instance that is not currently running or -on a loop instance that has already been stopped has no effect. - -#### addTimer() - -The `addTimer(float $interval, callable $callback): TimerInterface` method can be used to -enqueue a callback to be invoked once after the given interval. - -The second parameter MUST be a timer callback function that accepts -the timer instance as its only parameter. -If you don't use the timer instance inside your timer callback function -you MAY use a function which has no parameters at all. - -The timer callback function MUST NOT throw an `Exception`. -The return value of the timer callback function will be ignored and has -no effect, so for performance reasons you're recommended to not return -any excessive data structures. - -This method returns a timer instance. The same timer instance will also be -passed into the timer callback function as described above. -You can invoke [`cancelTimer`](#canceltimer) to cancel a pending timer. -Unlike [`addPeriodicTimer()`](#addperiodictimer), this method will ensure -the callback will be invoked only once after the given interval. - -```php -$loop->addTimer(0.8, function () { - echo 'world!' . PHP_EOL; -}); - -$loop->addTimer(0.3, function () { - echo 'hello '; -}); -``` - -See also [example #1](examples). - -If you want to access any variables within your callback function, you -can bind arbitrary data to a callback closure like this: - -```php -function hello($name, LoopInterface $loop) -{ - $loop->addTimer(1.0, function () use ($name) { - echo "hello $name\n"; - }); -} - -hello('Tester', $loop); -``` - -This interface does not enforce any particular timer resolution, so -special care may have to be taken if you rely on very high precision with -millisecond accuracy or below. Event loop implementations SHOULD work on -a best effort basis and SHOULD provide at least millisecond accuracy -unless otherwise noted. Many existing event loop implementations are -known to provide microsecond accuracy, but it's generally not recommended -to rely on this high precision. - -Similarly, the execution order of timers scheduled to execute at the -same time (within its possible accuracy) is not guaranteed. - -This interface suggests that event loop implementations SHOULD use a -monotonic time source if available. Given that a monotonic time source is -only available as of PHP 7.3 by default, event loop implementations MAY -fall back to using wall-clock time. -While this does not affect many common use cases, this is an important -distinction for programs that rely on a high time precision or on systems -that are subject to discontinuous time adjustments (time jumps). -This means that if you schedule a timer to trigger in 30s and then adjust -your system time forward by 20s, the timer SHOULD still trigger in 30s. -See also [event loop implementations](#loop-implementations) for more details. - -#### addPeriodicTimer() - -The `addPeriodicTimer(float $interval, callable $callback): TimerInterface` method can be used to -enqueue a callback to be invoked repeatedly after the given interval. - -The second parameter MUST be a timer callback function that accepts -the timer instance as its only parameter. -If you don't use the timer instance inside your timer callback function -you MAY use a function which has no parameters at all. - -The timer callback function MUST NOT throw an `Exception`. -The return value of the timer callback function will be ignored and has -no effect, so for performance reasons you're recommended to not return -any excessive data structures. - -This method returns a timer instance. The same timer instance will also be -passed into the timer callback function as described above. -Unlike [`addTimer()`](#addtimer), this method will ensure the callback -will be invoked infinitely after the given interval or until you invoke -[`cancelTimer`](#canceltimer). - -```php -$timer = $loop->addPeriodicTimer(0.1, function () { - echo 'tick!' . PHP_EOL; -}); - -$loop->addTimer(1.0, function () use ($loop, $timer) { - $loop->cancelTimer($timer); - echo 'Done' . PHP_EOL; -}); -``` - -See also [example #2](examples). - -If you want to limit the number of executions, you can bind -arbitrary data to a callback closure like this: - -```php -function hello($name, LoopInterface $loop) -{ - $n = 3; - $loop->addPeriodicTimer(1.0, function ($timer) use ($name, $loop, &$n) { - if ($n > 0) { - --$n; - echo "hello $name\n"; - } else { - $loop->cancelTimer($timer); - } - }); -} - -hello('Tester', $loop); -``` - -This interface does not enforce any particular timer resolution, so -special care may have to be taken if you rely on very high precision with -millisecond accuracy or below. Event loop implementations SHOULD work on -a best effort basis and SHOULD provide at least millisecond accuracy -unless otherwise noted. Many existing event loop implementations are -known to provide microsecond accuracy, but it's generally not recommended -to rely on this high precision. - -Similarly, the execution order of timers scheduled to execute at the -same time (within its possible accuracy) is not guaranteed. - -This interface suggests that event loop implementations SHOULD use a -monotonic time source if available. Given that a monotonic time source is -only available as of PHP 7.3 by default, event loop implementations MAY -fall back to using wall-clock time. -While this does not affect many common use cases, this is an important -distinction for programs that rely on a high time precision or on systems -that are subject to discontinuous time adjustments (time jumps). -This means that if you schedule a timer to trigger in 30s and then adjust -your system time forward by 20s, the timer SHOULD still trigger in 30s. -See also [event loop implementations](#loop-implementations) for more details. - -Additionally, periodic timers may be subject to timer drift due to -re-scheduling after each invocation. As such, it's generally not -recommended to rely on this for high precision intervals with millisecond -accuracy or below. - -#### cancelTimer() - -The `cancelTimer(TimerInterface $timer): void` method can be used to -cancel a pending timer. - -See also [`addPeriodicTimer()`](#addperiodictimer) and [example #2](examples). - -Calling this method on a timer instance that has not been added to this -loop instance or on a timer that has already been cancelled has no effect. - -#### futureTick() - -The `futureTick(callable $listener): void` method can be used to -schedule a callback to be invoked on a future tick of the event loop. - -This works very much similar to timers with an interval of zero seconds, -but does not require the overhead of scheduling a timer queue. - -The tick callback function MUST be able to accept zero parameters. - -The tick callback function MUST NOT throw an `Exception`. -The return value of the tick callback function will be ignored and has -no effect, so for performance reasons you're recommended to not return -any excessive data structures. - -If you want to access any variables within your callback function, you -can bind arbitrary data to a callback closure like this: - -```php -function hello($name, LoopInterface $loop) -{ - $loop->futureTick(function () use ($name) { - echo "hello $name\n"; - }); -} - -hello('Tester', $loop); -``` - -Unlike timers, tick callbacks are guaranteed to be executed in the order -they are enqueued. -Also, once a callback is enqueued, there's no way to cancel this operation. - -This is often used to break down bigger tasks into smaller steps (a form -of cooperative multitasking). - -```php -$loop->futureTick(function () { - echo 'b'; -}); -$loop->futureTick(function () { - echo 'c'; -}); -echo 'a'; -``` - -See also [example #3](examples). - -#### addSignal() - -The `addSignal(int $signal, callable $listener): void` method can be used to -register a listener to be notified when a signal has been caught by this process. - -This is useful to catch user interrupt signals or shutdown signals from -tools like `supervisor` or `systemd`. - -The second parameter MUST be a listener callback function that accepts -the signal as its only parameter. -If you don't use the signal inside your listener callback function -you MAY use a function which has no parameters at all. - -The listener callback function MUST NOT throw an `Exception`. -The return value of the listener callback function will be ignored and has -no effect, so for performance reasons you're recommended to not return -any excessive data structures. - -```php -$loop->addSignal(SIGINT, function (int $signal) { - echo 'Caught user interrupt signal' . PHP_EOL; -}); -``` - -See also [example #4](examples). - -Signaling is only available on Unix-like platforms, Windows isn't -supported due to operating system limitations. -This method may throw a `BadMethodCallException` if signals aren't -supported on this platform, for example when required extensions are -missing. - -**Note: A listener can only be added once to the same signal, any -attempts to add it more than once will be ignored.** - -#### removeSignal() - -The `removeSignal(int $signal, callable $listener): void` method can be used to -remove a previously added signal listener. - -```php -$loop->removeSignal(SIGINT, $listener); -``` - -Any attempts to remove listeners that aren't registered will be ignored. - -#### addReadStream() - -> Advanced! Note that this low-level API is considered advanced usage. - Most use cases should probably use the higher-level - [readable Stream API](https://github.com/reactphp/stream#readablestreaminterface) - instead. - -The `addReadStream(resource $stream, callable $callback): void` method can be used to -register a listener to be notified when a stream is ready to read. - -The first parameter MUST be a valid stream resource that supports -checking whether it is ready to read by this loop implementation. -A single stream resource MUST NOT be added more than once. -Instead, either call [`removeReadStream()`](#removereadstream) first or -react to this event with a single listener and then dispatch from this -listener. This method MAY throw an `Exception` if the given resource type -is not supported by this loop implementation. - -The second parameter MUST be a listener callback function that accepts -the stream resource as its only parameter. -If you don't use the stream resource inside your listener callback function -you MAY use a function which has no parameters at all. - -The listener callback function MUST NOT throw an `Exception`. -The return value of the listener callback function will be ignored and has -no effect, so for performance reasons you're recommended to not return -any excessive data structures. - -If you want to access any variables within your callback function, you -can bind arbitrary data to a callback closure like this: - -```php -$loop->addReadStream($stream, function ($stream) use ($name) { - echo $name . ' said: ' . fread($stream); -}); -``` - -See also [example #11](examples). - -You can invoke [`removeReadStream()`](#removereadstream) to remove the -read event listener for this stream. - -The execution order of listeners when multiple streams become ready at -the same time is not guaranteed. - -Some event loop implementations are known to only trigger the listener if -the stream *becomes* readable (edge-triggered) and may not trigger if the -stream has already been readable from the beginning. -This also implies that a stream may not be recognized as readable when data -is still left in PHP's internal stream buffers. -As such, it's recommended to use `stream_set_read_buffer($stream, 0);` -to disable PHP's internal read buffer in this case. - -#### addWriteStream() - -> Advanced! Note that this low-level API is considered advanced usage. - Most use cases should probably use the higher-level - [writable Stream API](https://github.com/reactphp/stream#writablestreaminterface) - instead. - -The `addWriteStream(resource $stream, callable $callback): void` method can be used to -register a listener to be notified when a stream is ready to write. - -The first parameter MUST be a valid stream resource that supports -checking whether it is ready to write by this loop implementation. -A single stream resource MUST NOT be added more than once. -Instead, either call [`removeWriteStream()`](#removewritestream) first or -react to this event with a single listener and then dispatch from this -listener. This method MAY throw an `Exception` if the given resource type -is not supported by this loop implementation. - -The second parameter MUST be a listener callback function that accepts -the stream resource as its only parameter. -If you don't use the stream resource inside your listener callback function -you MAY use a function which has no parameters at all. - -The listener callback function MUST NOT throw an `Exception`. -The return value of the listener callback function will be ignored and has -no effect, so for performance reasons you're recommended to not return -any excessive data structures. - -If you want to access any variables within your callback function, you -can bind arbitrary data to a callback closure like this: - -```php -$loop->addWriteStream($stream, function ($stream) use ($name) { - fwrite($stream, 'Hello ' . $name); -}); -``` - -See also [example #12](examples). - -You can invoke [`removeWriteStream()`](#removewritestream) to remove the -write event listener for this stream. - -The execution order of listeners when multiple streams become ready at -the same time is not guaranteed. - -#### removeReadStream() - -The `removeReadStream(resource $stream): void` method can be used to -remove the read event listener for the given stream. - -Removing a stream from the loop that has already been removed or trying -to remove a stream that was never added or is invalid has no effect. - -#### removeWriteStream() - -The `removeWriteStream(resource $stream): void` method can be used to -remove the write event listener for the given stream. - -Removing a stream from the loop that has already been removed or trying -to remove a stream that was never added or is invalid has no effect. - -## Install - -The recommended way to install this library is [through Composer](https://getcomposer.org/). -[New to Composer?](https://getcomposer.org/doc/00-intro.md) - -This project follows [SemVer](https://semver.org/). -This will install the latest supported version: - -```bash -composer require react/event-loop:^1.5 -``` - -See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. - -This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.3 through current PHP 8+ and -HHVM. -It's *highly recommended to use the latest supported PHP version* for this project. - -Installing any of the event loop extensions is suggested, but entirely optional. -See also [event loop implementations](#loop-implementations) for more details. - -## Tests - -To run the test suite, you first need to clone this repo and then install all -dependencies [through Composer](https://getcomposer.org/): - -```bash -composer install -``` - -To run the test suite, go to the project root and run: - -```bash -vendor/bin/phpunit -``` - -## License - -MIT, see [LICENSE file](LICENSE). - -## More - -* See our [Stream component](https://github.com/reactphp/stream) for more - information on how streams are used in real-world applications. -* See our [users wiki](https://github.com/reactphp/react/wiki/Users) and the - [dependents on Packagist](https://packagist.org/packages/react/event-loop/dependents) - for a list of packages that use the EventLoop in real-world applications. diff --git a/tools/php-cs-fixer/vendor/react/event-loop/composer.json b/tools/php-cs-fixer/vendor/react/event-loop/composer.json deleted file mode 100644 index 25a41fe1..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/composer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "react/event-loop", - "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", - "keywords": ["event-loop", "asynchronous"], - "license": "MIT", - "authors": [ - { - "name": "Christian Lück", - "homepage": "https://clue.engineering/", - "email": "christian@clue.engineering" - }, - { - "name": "Cees-Jan Kiewiet", - "homepage": "https://wyrihaximus.net/", - "email": "reactphp@ceesjankiewiet.nl" - }, - { - "name": "Jan Sorgalla", - "homepage": "https://sorgalla.com/", - "email": "jsorgalla@gmail.com" - }, - { - "name": "Chris Boden", - "homepage": "https://cboden.dev/", - "email": "cboden@gmail.com" - } - ], - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "suggest": { - "ext-pcntl": "For signal handling support when using the StreamSelectLoop" - }, - "autoload": { - "psr-4": { - "React\\EventLoop\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "React\\Tests\\EventLoop\\": "tests/" - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEvLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEvLoop.php deleted file mode 100644 index a3fcec68..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEvLoop.php +++ /dev/null @@ -1,253 +0,0 @@ -loop = new EvLoop(); - $this->futureTickQueue = new FutureTickQueue(); - $this->timers = new SplObjectStorage(); - $this->signals = new SignalsHandler(); - } - - public function addReadStream($stream, $listener) - { - $key = (int)$stream; - - if (isset($this->readStreams[$key])) { - return; - } - - $callback = $this->getStreamListenerClosure($stream, $listener); - $event = $this->loop->io($stream, Ev::READ, $callback); - $this->readStreams[$key] = $event; - } - - /** - * @param resource $stream - * @param callable $listener - * - * @return \Closure - */ - private function getStreamListenerClosure($stream, $listener) - { - return function () use ($stream, $listener) { - \call_user_func($listener, $stream); - }; - } - - public function addWriteStream($stream, $listener) - { - $key = (int)$stream; - - if (isset($this->writeStreams[$key])) { - return; - } - - $callback = $this->getStreamListenerClosure($stream, $listener); - $event = $this->loop->io($stream, Ev::WRITE, $callback); - $this->writeStreams[$key] = $event; - } - - public function removeReadStream($stream) - { - $key = (int)$stream; - - if (!isset($this->readStreams[$key])) { - return; - } - - $this->readStreams[$key]->stop(); - unset($this->readStreams[$key]); - } - - public function removeWriteStream($stream) - { - $key = (int)$stream; - - if (!isset($this->writeStreams[$key])) { - return; - } - - $this->writeStreams[$key]->stop(); - unset($this->writeStreams[$key]); - } - - public function addTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, false); - - $that = $this; - $timers = $this->timers; - $callback = function () use ($timer, $timers, $that) { - \call_user_func($timer->getCallback(), $timer); - - if ($timers->contains($timer)) { - $that->cancelTimer($timer); - } - }; - - $event = $this->loop->timer($timer->getInterval(), 0.0, $callback); - $this->timers->attach($timer, $event); - - return $timer; - } - - public function addPeriodicTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, true); - - $callback = function () use ($timer) { - \call_user_func($timer->getCallback(), $timer); - }; - - $event = $this->loop->timer($timer->getInterval(), $timer->getInterval(), $callback); - $this->timers->attach($timer, $event); - - return $timer; - } - - public function cancelTimer(TimerInterface $timer) - { - if (!isset($this->timers[$timer])) { - return; - } - - $event = $this->timers[$timer]; - $event->stop(); - $this->timers->detach($timer); - } - - public function futureTick($listener) - { - $this->futureTickQueue->add($listener); - } - - public function run() - { - $this->running = true; - - while ($this->running) { - $this->futureTickQueue->tick(); - - $hasPendingCallbacks = !$this->futureTickQueue->isEmpty(); - $wasJustStopped = !$this->running; - $nothingLeftToDo = !$this->readStreams - && !$this->writeStreams - && !$this->timers->count() - && $this->signals->isEmpty(); - - $flags = Ev::RUN_ONCE; - if ($wasJustStopped || $hasPendingCallbacks) { - $flags |= Ev::RUN_NOWAIT; - } elseif ($nothingLeftToDo) { - break; - } - - $this->loop->run($flags); - } - } - - public function stop() - { - $this->running = false; - } - - public function __destruct() - { - /** @var TimerInterface $timer */ - foreach ($this->timers as $timer) { - $this->cancelTimer($timer); - } - - foreach ($this->readStreams as $key => $stream) { - $this->removeReadStream($key); - } - - foreach ($this->writeStreams as $key => $stream) { - $this->removeWriteStream($key); - } - } - - public function addSignal($signal, $listener) - { - $this->signals->add($signal, $listener); - - if (!isset($this->signalEvents[$signal])) { - $this->signalEvents[$signal] = $this->loop->signal($signal, function() use ($signal) { - $this->signals->call($signal); - }); - } - } - - public function removeSignal($signal, $listener) - { - $this->signals->remove($signal, $listener); - - if (isset($this->signalEvents[$signal])) { - $this->signalEvents[$signal]->stop(); - unset($this->signalEvents[$signal]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEventLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEventLoop.php deleted file mode 100644 index b162a402..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtEventLoop.php +++ /dev/null @@ -1,275 +0,0 @@ -requireFeatures(\EventConfig::FEATURE_FDS); - } - - $this->eventBase = new EventBase($config); - $this->futureTickQueue = new FutureTickQueue(); - $this->timerEvents = new SplObjectStorage(); - $this->signals = new SignalsHandler(); - - $this->createTimerCallback(); - $this->createStreamCallback(); - } - - public function __destruct() - { - // explicitly clear all references to Event objects to prevent SEGFAULTs on Windows - foreach ($this->timerEvents as $timer) { - $this->timerEvents->detach($timer); - } - - $this->readEvents = array(); - $this->writeEvents = array(); - } - - public function addReadStream($stream, $listener) - { - $key = (int) $stream; - if (isset($this->readListeners[$key])) { - return; - } - - $event = new Event($this->eventBase, $stream, Event::PERSIST | Event::READ, $this->streamCallback); - $event->add(); - $this->readEvents[$key] = $event; - $this->readListeners[$key] = $listener; - - // ext-event does not increase refcount on stream resources for PHP 7+ - // manually keep track of stream resource to prevent premature garbage collection - if (\PHP_VERSION_ID >= 70000) { - $this->readRefs[$key] = $stream; - } - } - - public function addWriteStream($stream, $listener) - { - $key = (int) $stream; - if (isset($this->writeListeners[$key])) { - return; - } - - $event = new Event($this->eventBase, $stream, Event::PERSIST | Event::WRITE, $this->streamCallback); - $event->add(); - $this->writeEvents[$key] = $event; - $this->writeListeners[$key] = $listener; - - // ext-event does not increase refcount on stream resources for PHP 7+ - // manually keep track of stream resource to prevent premature garbage collection - if (\PHP_VERSION_ID >= 70000) { - $this->writeRefs[$key] = $stream; - } - } - - public function removeReadStream($stream) - { - $key = (int) $stream; - - if (isset($this->readEvents[$key])) { - $this->readEvents[$key]->free(); - unset( - $this->readEvents[$key], - $this->readListeners[$key], - $this->readRefs[$key] - ); - } - } - - public function removeWriteStream($stream) - { - $key = (int) $stream; - - if (isset($this->writeEvents[$key])) { - $this->writeEvents[$key]->free(); - unset( - $this->writeEvents[$key], - $this->writeListeners[$key], - $this->writeRefs[$key] - ); - } - } - - public function addTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, false); - - $this->scheduleTimer($timer); - - return $timer; - } - - public function addPeriodicTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, true); - - $this->scheduleTimer($timer); - - return $timer; - } - - public function cancelTimer(TimerInterface $timer) - { - if ($this->timerEvents->contains($timer)) { - $this->timerEvents[$timer]->free(); - $this->timerEvents->detach($timer); - } - } - - public function futureTick($listener) - { - $this->futureTickQueue->add($listener); - } - - public function addSignal($signal, $listener) - { - $this->signals->add($signal, $listener); - - if (!isset($this->signalEvents[$signal])) { - $this->signalEvents[$signal] = Event::signal($this->eventBase, $signal, array($this->signals, 'call')); - $this->signalEvents[$signal]->add(); - } - } - - public function removeSignal($signal, $listener) - { - $this->signals->remove($signal, $listener); - - if (isset($this->signalEvents[$signal]) && $this->signals->count($signal) === 0) { - $this->signalEvents[$signal]->free(); - unset($this->signalEvents[$signal]); - } - } - - public function run() - { - $this->running = true; - - while ($this->running) { - $this->futureTickQueue->tick(); - - $flags = EventBase::LOOP_ONCE; - if (!$this->running || !$this->futureTickQueue->isEmpty()) { - $flags |= EventBase::LOOP_NONBLOCK; - } elseif (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { - break; - } - - $this->eventBase->loop($flags); - } - } - - public function stop() - { - $this->running = false; - } - - /** - * Schedule a timer for execution. - * - * @param TimerInterface $timer - */ - private function scheduleTimer(TimerInterface $timer) - { - $flags = Event::TIMEOUT; - - if ($timer->isPeriodic()) { - $flags |= Event::PERSIST; - } - - $event = new Event($this->eventBase, -1, $flags, $this->timerCallback, $timer); - $this->timerEvents[$timer] = $event; - - $event->add($timer->getInterval()); - } - - /** - * Create a callback used as the target of timer events. - * - * A reference is kept to the callback for the lifetime of the loop - * to prevent "Cannot destroy active lambda function" fatal error from - * the event extension. - */ - private function createTimerCallback() - { - $timers = $this->timerEvents; - $this->timerCallback = function ($_, $__, $timer) use ($timers) { - \call_user_func($timer->getCallback(), $timer); - - if (!$timer->isPeriodic() && $timers->contains($timer)) { - $this->cancelTimer($timer); - } - }; - } - - /** - * Create a callback used as the target of stream events. - * - * A reference is kept to the callback for the lifetime of the loop - * to prevent "Cannot destroy active lambda function" fatal error from - * the event extension. - */ - private function createStreamCallback() - { - $read =& $this->readListeners; - $write =& $this->writeListeners; - $this->streamCallback = function ($stream, $flags) use (&$read, &$write) { - $key = (int) $stream; - - if (Event::READ === (Event::READ & $flags) && isset($read[$key])) { - \call_user_func($read[$key], $stream); - } - - if (Event::WRITE === (Event::WRITE & $flags) && isset($write[$key])) { - \call_user_func($write[$key], $stream); - } - }; - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibevLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibevLoop.php deleted file mode 100644 index c303fdd5..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibevLoop.php +++ /dev/null @@ -1,201 +0,0 @@ -loop = new EventLoop(); - $this->futureTickQueue = new FutureTickQueue(); - $this->timerEvents = new SplObjectStorage(); - $this->signals = new SignalsHandler(); - } - - public function addReadStream($stream, $listener) - { - if (isset($this->readEvents[(int) $stream])) { - return; - } - - $callback = function () use ($stream, $listener) { - \call_user_func($listener, $stream); - }; - - $event = new IOEvent($callback, $stream, IOEvent::READ); - $this->loop->add($event); - - $this->readEvents[(int) $stream] = $event; - } - - public function addWriteStream($stream, $listener) - { - if (isset($this->writeEvents[(int) $stream])) { - return; - } - - $callback = function () use ($stream, $listener) { - \call_user_func($listener, $stream); - }; - - $event = new IOEvent($callback, $stream, IOEvent::WRITE); - $this->loop->add($event); - - $this->writeEvents[(int) $stream] = $event; - } - - public function removeReadStream($stream) - { - $key = (int) $stream; - - if (isset($this->readEvents[$key])) { - $this->readEvents[$key]->stop(); - $this->loop->remove($this->readEvents[$key]); - unset($this->readEvents[$key]); - } - } - - public function removeWriteStream($stream) - { - $key = (int) $stream; - - if (isset($this->writeEvents[$key])) { - $this->writeEvents[$key]->stop(); - $this->loop->remove($this->writeEvents[$key]); - unset($this->writeEvents[$key]); - } - } - - public function addTimer($interval, $callback) - { - $timer = new Timer( $interval, $callback, false); - - $that = $this; - $timers = $this->timerEvents; - $callback = function () use ($timer, $timers, $that) { - \call_user_func($timer->getCallback(), $timer); - - if ($timers->contains($timer)) { - $that->cancelTimer($timer); - } - }; - - $event = new TimerEvent($callback, $timer->getInterval()); - $this->timerEvents->attach($timer, $event); - $this->loop->add($event); - - return $timer; - } - - public function addPeriodicTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, true); - - $callback = function () use ($timer) { - \call_user_func($timer->getCallback(), $timer); - }; - - $event = new TimerEvent($callback, $timer->getInterval(), $timer->getInterval()); - $this->timerEvents->attach($timer, $event); - $this->loop->add($event); - - return $timer; - } - - public function cancelTimer(TimerInterface $timer) - { - if (isset($this->timerEvents[$timer])) { - $this->loop->remove($this->timerEvents[$timer]); - $this->timerEvents->detach($timer); - } - } - - public function futureTick($listener) - { - $this->futureTickQueue->add($listener); - } - - public function addSignal($signal, $listener) - { - $this->signals->add($signal, $listener); - - if (!isset($this->signalEvents[$signal])) { - $signals = $this->signals; - $this->signalEvents[$signal] = new SignalEvent(function () use ($signals, $signal) { - $signals->call($signal); - }, $signal); - $this->loop->add($this->signalEvents[$signal]); - } - } - - public function removeSignal($signal, $listener) - { - $this->signals->remove($signal, $listener); - - if (isset($this->signalEvents[$signal]) && $this->signals->count($signal) === 0) { - $this->signalEvents[$signal]->stop(); - $this->loop->remove($this->signalEvents[$signal]); - unset($this->signalEvents[$signal]); - } - } - - public function run() - { - $this->running = true; - - while ($this->running) { - $this->futureTickQueue->tick(); - - $flags = EventLoop::RUN_ONCE; - if (!$this->running || !$this->futureTickQueue->isEmpty()) { - $flags |= EventLoop::RUN_NOWAIT; - } elseif (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { - break; - } - - $this->loop->run($flags); - } - } - - public function stop() - { - $this->running = false; - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibeventLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibeventLoop.php deleted file mode 100644 index 099293a4..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtLibeventLoop.php +++ /dev/null @@ -1,285 +0,0 @@ -eventBase = \event_base_new(); - $this->futureTickQueue = new FutureTickQueue(); - $this->timerEvents = new SplObjectStorage(); - $this->signals = new SignalsHandler(); - - $this->createTimerCallback(); - $this->createStreamCallback(); - } - - public function addReadStream($stream, $listener) - { - $key = (int) $stream; - if (isset($this->readListeners[$key])) { - return; - } - - $event = \event_new(); - \event_set($event, $stream, \EV_PERSIST | \EV_READ, $this->streamCallback); - \event_base_set($event, $this->eventBase); - \event_add($event); - - $this->readEvents[$key] = $event; - $this->readListeners[$key] = $listener; - } - - public function addWriteStream($stream, $listener) - { - $key = (int) $stream; - if (isset($this->writeListeners[$key])) { - return; - } - - $event = \event_new(); - \event_set($event, $stream, \EV_PERSIST | \EV_WRITE, $this->streamCallback); - \event_base_set($event, $this->eventBase); - \event_add($event); - - $this->writeEvents[$key] = $event; - $this->writeListeners[$key] = $listener; - } - - public function removeReadStream($stream) - { - $key = (int) $stream; - - if (isset($this->readListeners[$key])) { - $event = $this->readEvents[$key]; - \event_del($event); - \event_free($event); - - unset( - $this->readEvents[$key], - $this->readListeners[$key] - ); - } - } - - public function removeWriteStream($stream) - { - $key = (int) $stream; - - if (isset($this->writeListeners[$key])) { - $event = $this->writeEvents[$key]; - \event_del($event); - \event_free($event); - - unset( - $this->writeEvents[$key], - $this->writeListeners[$key] - ); - } - } - - public function addTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, false); - - $this->scheduleTimer($timer); - - return $timer; - } - - public function addPeriodicTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, true); - - $this->scheduleTimer($timer); - - return $timer; - } - - public function cancelTimer(TimerInterface $timer) - { - if ($this->timerEvents->contains($timer)) { - $event = $this->timerEvents[$timer]; - \event_del($event); - \event_free($event); - - $this->timerEvents->detach($timer); - } - } - - public function futureTick($listener) - { - $this->futureTickQueue->add($listener); - } - - public function addSignal($signal, $listener) - { - $this->signals->add($signal, $listener); - - if (!isset($this->signalEvents[$signal])) { - $this->signalEvents[$signal] = \event_new(); - \event_set($this->signalEvents[$signal], $signal, \EV_PERSIST | \EV_SIGNAL, array($this->signals, 'call')); - \event_base_set($this->signalEvents[$signal], $this->eventBase); - \event_add($this->signalEvents[$signal]); - } - } - - public function removeSignal($signal, $listener) - { - $this->signals->remove($signal, $listener); - - if (isset($this->signalEvents[$signal]) && $this->signals->count($signal) === 0) { - \event_del($this->signalEvents[$signal]); - \event_free($this->signalEvents[$signal]); - unset($this->signalEvents[$signal]); - } - } - - public function run() - { - $this->running = true; - - while ($this->running) { - $this->futureTickQueue->tick(); - - $flags = \EVLOOP_ONCE; - if (!$this->running || !$this->futureTickQueue->isEmpty()) { - $flags |= \EVLOOP_NONBLOCK; - } elseif (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { - break; - } - - \event_base_loop($this->eventBase, $flags); - } - } - - public function stop() - { - $this->running = false; - } - - /** - * Schedule a timer for execution. - * - * @param TimerInterface $timer - */ - private function scheduleTimer(TimerInterface $timer) - { - $this->timerEvents[$timer] = $event = \event_timer_new(); - - \event_timer_set($event, $this->timerCallback, $timer); - \event_base_set($event, $this->eventBase); - \event_add($event, $timer->getInterval() * self::MICROSECONDS_PER_SECOND); - } - - /** - * Create a callback used as the target of timer events. - * - * A reference is kept to the callback for the lifetime of the loop - * to prevent "Cannot destroy active lambda function" fatal error from - * the event extension. - */ - private function createTimerCallback() - { - $that = $this; - $timers = $this->timerEvents; - $this->timerCallback = function ($_, $__, $timer) use ($timers, $that) { - \call_user_func($timer->getCallback(), $timer); - - // Timer already cancelled ... - if (!$timers->contains($timer)) { - return; - } - - // Reschedule periodic timers ... - if ($timer->isPeriodic()) { - \event_add( - $timers[$timer], - $timer->getInterval() * ExtLibeventLoop::MICROSECONDS_PER_SECOND - ); - - // Clean-up one shot timers ... - } else { - $that->cancelTimer($timer); - } - }; - } - - /** - * Create a callback used as the target of stream events. - * - * A reference is kept to the callback for the lifetime of the loop - * to prevent "Cannot destroy active lambda function" fatal error from - * the event extension. - */ - private function createStreamCallback() - { - $read =& $this->readListeners; - $write =& $this->writeListeners; - $this->streamCallback = function ($stream, $flags) use (&$read, &$write) { - $key = (int) $stream; - - if (\EV_READ === (\EV_READ & $flags) && isset($read[$key])) { - \call_user_func($read[$key], $stream); - } - - if (\EV_WRITE === (\EV_WRITE & $flags) && isset($write[$key])) { - \call_user_func($write[$key], $stream); - } - }; - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtUvLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/ExtUvLoop.php deleted file mode 100644 index 4434720d..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/ExtUvLoop.php +++ /dev/null @@ -1,342 +0,0 @@ -uv = \uv_loop_new(); - $this->futureTickQueue = new FutureTickQueue(); - $this->timers = new SplObjectStorage(); - $this->streamListener = $this->createStreamListener(); - $this->signals = new SignalsHandler(); - } - - /** - * Returns the underlying ext-uv event loop. (Internal ReactPHP use only.) - * - * @internal - * - * @return resource - */ - public function getUvLoop() - { - return $this->uv; - } - - /** - * {@inheritdoc} - */ - public function addReadStream($stream, $listener) - { - if (isset($this->readStreams[(int) $stream])) { - return; - } - - $this->readStreams[(int) $stream] = $listener; - $this->addStream($stream); - } - - /** - * {@inheritdoc} - */ - public function addWriteStream($stream, $listener) - { - if (isset($this->writeStreams[(int) $stream])) { - return; - } - - $this->writeStreams[(int) $stream] = $listener; - $this->addStream($stream); - } - - /** - * {@inheritdoc} - */ - public function removeReadStream($stream) - { - if (!isset($this->streamEvents[(int) $stream])) { - return; - } - - unset($this->readStreams[(int) $stream]); - $this->removeStream($stream); - } - - /** - * {@inheritdoc} - */ - public function removeWriteStream($stream) - { - if (!isset($this->streamEvents[(int) $stream])) { - return; - } - - unset($this->writeStreams[(int) $stream]); - $this->removeStream($stream); - } - - /** - * {@inheritdoc} - */ - public function addTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, false); - - $that = $this; - $timers = $this->timers; - $callback = function () use ($timer, $timers, $that) { - \call_user_func($timer->getCallback(), $timer); - - if ($timers->contains($timer)) { - $that->cancelTimer($timer); - } - }; - - $event = \uv_timer_init($this->uv); - $this->timers->attach($timer, $event); - \uv_timer_start( - $event, - $this->convertFloatSecondsToMilliseconds($interval), - 0, - $callback - ); - - return $timer; - } - - /** - * {@inheritdoc} - */ - public function addPeriodicTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, true); - - $callback = function () use ($timer) { - \call_user_func($timer->getCallback(), $timer); - }; - - $interval = $this->convertFloatSecondsToMilliseconds($interval); - $event = \uv_timer_init($this->uv); - $this->timers->attach($timer, $event); - \uv_timer_start( - $event, - $interval, - (int) $interval === 0 ? 1 : $interval, - $callback - ); - - return $timer; - } - - /** - * {@inheritdoc} - */ - public function cancelTimer(TimerInterface $timer) - { - if (isset($this->timers[$timer])) { - @\uv_timer_stop($this->timers[$timer]); - $this->timers->detach($timer); - } - } - - /** - * {@inheritdoc} - */ - public function futureTick($listener) - { - $this->futureTickQueue->add($listener); - } - - public function addSignal($signal, $listener) - { - $this->signals->add($signal, $listener); - - if (!isset($this->signalEvents[$signal])) { - $signals = $this->signals; - $this->signalEvents[$signal] = \uv_signal_init($this->uv); - \uv_signal_start($this->signalEvents[$signal], function () use ($signals, $signal) { - $signals->call($signal); - }, $signal); - } - } - - public function removeSignal($signal, $listener) - { - $this->signals->remove($signal, $listener); - - if (isset($this->signalEvents[$signal]) && $this->signals->count($signal) === 0) { - \uv_signal_stop($this->signalEvents[$signal]); - unset($this->signalEvents[$signal]); - } - } - - /** - * {@inheritdoc} - */ - public function run() - { - $this->running = true; - - while ($this->running) { - $this->futureTickQueue->tick(); - - $hasPendingCallbacks = !$this->futureTickQueue->isEmpty(); - $wasJustStopped = !$this->running; - $nothingLeftToDo = !$this->readStreams - && !$this->writeStreams - && !$this->timers->count() - && $this->signals->isEmpty(); - - // Use UV::RUN_ONCE when there are only I/O events active in the loop and block until one of those triggers, - // otherwise use UV::RUN_NOWAIT. - // @link http://docs.libuv.org/en/v1.x/loop.html#c.uv_run - $flags = \UV::RUN_ONCE; - if ($wasJustStopped || $hasPendingCallbacks) { - $flags = \UV::RUN_NOWAIT; - } elseif ($nothingLeftToDo) { - break; - } - - \uv_run($this->uv, $flags); - } - } - - /** - * {@inheritdoc} - */ - public function stop() - { - $this->running = false; - } - - private function addStream($stream) - { - if (!isset($this->streamEvents[(int) $stream])) { - $this->streamEvents[(int)$stream] = \uv_poll_init_socket($this->uv, $stream); - } - - if ($this->streamEvents[(int) $stream] !== false) { - $this->pollStream($stream); - } - } - - private function removeStream($stream) - { - if (!isset($this->streamEvents[(int) $stream])) { - return; - } - - if (!isset($this->readStreams[(int) $stream]) - && !isset($this->writeStreams[(int) $stream])) { - \uv_poll_stop($this->streamEvents[(int) $stream]); - \uv_close($this->streamEvents[(int) $stream]); - unset($this->streamEvents[(int) $stream]); - return; - } - - $this->pollStream($stream); - } - - private function pollStream($stream) - { - if (!isset($this->streamEvents[(int) $stream])) { - return; - } - - $flags = 0; - if (isset($this->readStreams[(int) $stream])) { - $flags |= \UV::READABLE; - } - - if (isset($this->writeStreams[(int) $stream])) { - $flags |= \UV::WRITABLE; - } - - \uv_poll_start($this->streamEvents[(int) $stream], $flags, $this->streamListener); - } - - /** - * Create a stream listener - * - * @return callable Returns a callback - */ - private function createStreamListener() - { - $callback = function ($event, $status, $events, $stream) { - // libuv automatically stops polling on error, re-enable polling to match other loop implementations - if ($status !== 0) { - $this->pollStream($stream); - - // libuv may report no events on error, but this should still invoke stream listeners to report closed connections - // re-enable both readable and writable, correct listeners will be checked below anyway - if ($events === 0) { - $events = \UV::READABLE | \UV::WRITABLE; - } - } - - if (isset($this->readStreams[(int) $stream]) && ($events & \UV::READABLE)) { - \call_user_func($this->readStreams[(int) $stream], $stream); - } - - if (isset($this->writeStreams[(int) $stream]) && ($events & \UV::WRITABLE)) { - \call_user_func($this->writeStreams[(int) $stream], $stream); - } - }; - - return $callback; - } - - /** - * @param float $interval - * @return int - */ - private function convertFloatSecondsToMilliseconds($interval) - { - if ($interval < 0) { - return 0; - } - - $maxValue = (int) (\PHP_INT_MAX / 1000); - $intInterval = (int) $interval; - - if (($intInterval <= 0 && $interval > 1) || $intInterval >= $maxValue) { - throw new \InvalidArgumentException( - "Interval overflow, value must be lower than '{$maxValue}', but '{$interval}' passed." - ); - } - - return (int) \floor($interval * 1000); - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/Factory.php b/tools/php-cs-fixer/vendor/react/event-loop/src/Factory.php deleted file mode 100644 index 30bbfd7c..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/Factory.php +++ /dev/null @@ -1,75 +0,0 @@ -futureTick(function () use (&$hasRun) { - $hasRun = true; - }); - - $stopped =& self::$stopped; - register_shutdown_function(function () use ($loop, &$hasRun, &$stopped) { - // Don't run if we're coming from a fatal error (uncaught exception). - $error = error_get_last(); - if ((isset($error['type']) ? $error['type'] : 0) & (E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR)) { - return; - } - - if (!$hasRun && !$stopped) { - $loop->run(); - } - }); - // @codeCoverageIgnoreEnd - - return self::$instance; - } - - /** - * Internal undocumented method, behavior might change or throw in the - * future. Use with caution and at your own risk. - * - * @internal - * @return void - */ - public static function set(LoopInterface $loop) - { - self::$instance = $loop; - } - - /** - * [Advanced] Register a listener to be notified when a stream is ready to read. - * - * @param resource $stream - * @param callable $listener - * @return void - * @throws \Exception - * @see LoopInterface::addReadStream() - */ - public static function addReadStream($stream, $listener) - { - // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) - if (self::$instance === null) { - self::get(); - } - self::$instance->addReadStream($stream, $listener); - } - - /** - * [Advanced] Register a listener to be notified when a stream is ready to write. - * - * @param resource $stream - * @param callable $listener - * @return void - * @throws \Exception - * @see LoopInterface::addWriteStream() - */ - public static function addWriteStream($stream, $listener) - { - // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) - if (self::$instance === null) { - self::get(); - } - self::$instance->addWriteStream($stream, $listener); - } - - /** - * Remove the read event listener for the given stream. - * - * @param resource $stream - * @return void - * @see LoopInterface::removeReadStream() - */ - public static function removeReadStream($stream) - { - if (self::$instance !== null) { - self::$instance->removeReadStream($stream); - } - } - - /** - * Remove the write event listener for the given stream. - * - * @param resource $stream - * @return void - * @see LoopInterface::removeWriteStream() - */ - public static function removeWriteStream($stream) - { - if (self::$instance !== null) { - self::$instance->removeWriteStream($stream); - } - } - - /** - * Enqueue a callback to be invoked once after the given interval. - * - * @param float $interval - * @param callable $callback - * @return TimerInterface - * @see LoopInterface::addTimer() - */ - public static function addTimer($interval, $callback) - { - // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) - if (self::$instance === null) { - self::get(); - } - return self::$instance->addTimer($interval, $callback); - } - - /** - * Enqueue a callback to be invoked repeatedly after the given interval. - * - * @param float $interval - * @param callable $callback - * @return TimerInterface - * @see LoopInterface::addPeriodicTimer() - */ - public static function addPeriodicTimer($interval, $callback) - { - // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) - if (self::$instance === null) { - self::get(); - } - return self::$instance->addPeriodicTimer($interval, $callback); - } - - /** - * Cancel a pending timer. - * - * @param TimerInterface $timer - * @return void - * @see LoopInterface::cancelTimer() - */ - public static function cancelTimer(TimerInterface $timer) - { - if (self::$instance !== null) { - self::$instance->cancelTimer($timer); - } - } - - /** - * Schedule a callback to be invoked on a future tick of the event loop. - * - * @param callable $listener - * @return void - * @see LoopInterface::futureTick() - */ - public static function futureTick($listener) - { - // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) - if (self::$instance === null) { - self::get(); - } - - self::$instance->futureTick($listener); - } - - /** - * Register a listener to be notified when a signal has been caught by this process. - * - * @param int $signal - * @param callable $listener - * @return void - * @see LoopInterface::addSignal() - */ - public static function addSignal($signal, $listener) - { - // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) - if (self::$instance === null) { - self::get(); - } - - self::$instance->addSignal($signal, $listener); - } - - /** - * Removes a previously added signal listener. - * - * @param int $signal - * @param callable $listener - * @return void - * @see LoopInterface::removeSignal() - */ - public static function removeSignal($signal, $listener) - { - if (self::$instance !== null) { - self::$instance->removeSignal($signal, $listener); - } - } - - /** - * Run the event loop until there are no more tasks to perform. - * - * @return void - * @see LoopInterface::run() - */ - public static function run() - { - // create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls) - if (self::$instance === null) { - self::get(); - } - - self::$instance->run(); - } - - /** - * Instruct a running event loop to stop. - * - * @return void - * @see LoopInterface::stop() - */ - public static function stop() - { - self::$stopped = true; - if (self::$instance !== null) { - self::$instance->stop(); - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/LoopInterface.php b/tools/php-cs-fixer/vendor/react/event-loop/src/LoopInterface.php deleted file mode 100644 index 9266f718..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/LoopInterface.php +++ /dev/null @@ -1,472 +0,0 @@ -addReadStream($stream, function ($stream) use ($name) { - * echo $name . ' said: ' . fread($stream); - * }); - * ``` - * - * See also [example #11](examples). - * - * You can invoke [`removeReadStream()`](#removereadstream) to remove the - * read event listener for this stream. - * - * The execution order of listeners when multiple streams become ready at - * the same time is not guaranteed. - * - * @param resource $stream The PHP stream resource to check. - * @param callable $listener Invoked when the stream is ready. - * @throws \Exception if the given resource type is not supported by this loop implementation - * @see self::removeReadStream() - */ - public function addReadStream($stream, $listener); - - /** - * [Advanced] Register a listener to be notified when a stream is ready to write. - * - * Note that this low-level API is considered advanced usage. - * Most use cases should probably use the higher-level - * [writable Stream API](https://github.com/reactphp/stream#writablestreaminterface) - * instead. - * - * The first parameter MUST be a valid stream resource that supports - * checking whether it is ready to write by this loop implementation. - * A single stream resource MUST NOT be added more than once. - * Instead, either call [`removeWriteStream()`](#removewritestream) first or - * react to this event with a single listener and then dispatch from this - * listener. This method MAY throw an `Exception` if the given resource type - * is not supported by this loop implementation. - * - * The second parameter MUST be a listener callback function that accepts - * the stream resource as its only parameter. - * If you don't use the stream resource inside your listener callback function - * you MAY use a function which has no parameters at all. - * - * The listener callback function MUST NOT throw an `Exception`. - * The return value of the listener callback function will be ignored and has - * no effect, so for performance reasons you're recommended to not return - * any excessive data structures. - * - * If you want to access any variables within your callback function, you - * can bind arbitrary data to a callback closure like this: - * - * ```php - * $loop->addWriteStream($stream, function ($stream) use ($name) { - * fwrite($stream, 'Hello ' . $name); - * }); - * ``` - * - * See also [example #12](examples). - * - * You can invoke [`removeWriteStream()`](#removewritestream) to remove the - * write event listener for this stream. - * - * The execution order of listeners when multiple streams become ready at - * the same time is not guaranteed. - * - * Some event loop implementations are known to only trigger the listener if - * the stream *becomes* readable (edge-triggered) and may not trigger if the - * stream has already been readable from the beginning. - * This also implies that a stream may not be recognized as readable when data - * is still left in PHP's internal stream buffers. - * As such, it's recommended to use `stream_set_read_buffer($stream, 0);` - * to disable PHP's internal read buffer in this case. - * - * @param resource $stream The PHP stream resource to check. - * @param callable $listener Invoked when the stream is ready. - * @throws \Exception if the given resource type is not supported by this loop implementation - * @see self::removeWriteStream() - */ - public function addWriteStream($stream, $listener); - - /** - * Remove the read event listener for the given stream. - * - * Removing a stream from the loop that has already been removed or trying - * to remove a stream that was never added or is invalid has no effect. - * - * @param resource $stream The PHP stream resource. - */ - public function removeReadStream($stream); - - /** - * Remove the write event listener for the given stream. - * - * Removing a stream from the loop that has already been removed or trying - * to remove a stream that was never added or is invalid has no effect. - * - * @param resource $stream The PHP stream resource. - */ - public function removeWriteStream($stream); - - /** - * Enqueue a callback to be invoked once after the given interval. - * - * The second parameter MUST be a timer callback function that accepts - * the timer instance as its only parameter. - * If you don't use the timer instance inside your timer callback function - * you MAY use a function which has no parameters at all. - * - * The timer callback function MUST NOT throw an `Exception`. - * The return value of the timer callback function will be ignored and has - * no effect, so for performance reasons you're recommended to not return - * any excessive data structures. - * - * This method returns a timer instance. The same timer instance will also be - * passed into the timer callback function as described above. - * You can invoke [`cancelTimer`](#canceltimer) to cancel a pending timer. - * Unlike [`addPeriodicTimer()`](#addperiodictimer), this method will ensure - * the callback will be invoked only once after the given interval. - * - * ```php - * $loop->addTimer(0.8, function () { - * echo 'world!' . PHP_EOL; - * }); - * - * $loop->addTimer(0.3, function () { - * echo 'hello '; - * }); - * ``` - * - * See also [example #1](examples). - * - * If you want to access any variables within your callback function, you - * can bind arbitrary data to a callback closure like this: - * - * ```php - * function hello($name, LoopInterface $loop) - * { - * $loop->addTimer(1.0, function () use ($name) { - * echo "hello $name\n"; - * }); - * } - * - * hello('Tester', $loop); - * ``` - * - * This interface does not enforce any particular timer resolution, so - * special care may have to be taken if you rely on very high precision with - * millisecond accuracy or below. Event loop implementations SHOULD work on - * a best effort basis and SHOULD provide at least millisecond accuracy - * unless otherwise noted. Many existing event loop implementations are - * known to provide microsecond accuracy, but it's generally not recommended - * to rely on this high precision. - * - * Similarly, the execution order of timers scheduled to execute at the - * same time (within its possible accuracy) is not guaranteed. - * - * This interface suggests that event loop implementations SHOULD use a - * monotonic time source if available. Given that a monotonic time source is - * only available as of PHP 7.3 by default, event loop implementations MAY - * fall back to using wall-clock time. - * While this does not affect many common use cases, this is an important - * distinction for programs that rely on a high time precision or on systems - * that are subject to discontinuous time adjustments (time jumps). - * This means that if you schedule a timer to trigger in 30s and then adjust - * your system time forward by 20s, the timer SHOULD still trigger in 30s. - * See also [event loop implementations](#loop-implementations) for more details. - * - * @param int|float $interval The number of seconds to wait before execution. - * @param callable $callback The callback to invoke. - * - * @return TimerInterface - */ - public function addTimer($interval, $callback); - - /** - * Enqueue a callback to be invoked repeatedly after the given interval. - * - * The second parameter MUST be a timer callback function that accepts - * the timer instance as its only parameter. - * If you don't use the timer instance inside your timer callback function - * you MAY use a function which has no parameters at all. - * - * The timer callback function MUST NOT throw an `Exception`. - * The return value of the timer callback function will be ignored and has - * no effect, so for performance reasons you're recommended to not return - * any excessive data structures. - * - * This method returns a timer instance. The same timer instance will also be - * passed into the timer callback function as described above. - * Unlike [`addTimer()`](#addtimer), this method will ensure the callback - * will be invoked infinitely after the given interval or until you invoke - * [`cancelTimer`](#canceltimer). - * - * ```php - * $timer = $loop->addPeriodicTimer(0.1, function () { - * echo 'tick!' . PHP_EOL; - * }); - * - * $loop->addTimer(1.0, function () use ($loop, $timer) { - * $loop->cancelTimer($timer); - * echo 'Done' . PHP_EOL; - * }); - * ``` - * - * See also [example #2](examples). - * - * If you want to limit the number of executions, you can bind - * arbitrary data to a callback closure like this: - * - * ```php - * function hello($name, LoopInterface $loop) - * { - * $n = 3; - * $loop->addPeriodicTimer(1.0, function ($timer) use ($name, $loop, &$n) { - * if ($n > 0) { - * --$n; - * echo "hello $name\n"; - * } else { - * $loop->cancelTimer($timer); - * } - * }); - * } - * - * hello('Tester', $loop); - * ``` - * - * This interface does not enforce any particular timer resolution, so - * special care may have to be taken if you rely on very high precision with - * millisecond accuracy or below. Event loop implementations SHOULD work on - * a best effort basis and SHOULD provide at least millisecond accuracy - * unless otherwise noted. Many existing event loop implementations are - * known to provide microsecond accuracy, but it's generally not recommended - * to rely on this high precision. - * - * Similarly, the execution order of timers scheduled to execute at the - * same time (within its possible accuracy) is not guaranteed. - * - * This interface suggests that event loop implementations SHOULD use a - * monotonic time source if available. Given that a monotonic time source is - * only available as of PHP 7.3 by default, event loop implementations MAY - * fall back to using wall-clock time. - * While this does not affect many common use cases, this is an important - * distinction for programs that rely on a high time precision or on systems - * that are subject to discontinuous time adjustments (time jumps). - * This means that if you schedule a timer to trigger in 30s and then adjust - * your system time forward by 20s, the timer SHOULD still trigger in 30s. - * See also [event loop implementations](#loop-implementations) for more details. - * - * Additionally, periodic timers may be subject to timer drift due to - * re-scheduling after each invocation. As such, it's generally not - * recommended to rely on this for high precision intervals with millisecond - * accuracy or below. - * - * @param int|float $interval The number of seconds to wait before execution. - * @param callable $callback The callback to invoke. - * - * @return TimerInterface - */ - public function addPeriodicTimer($interval, $callback); - - /** - * Cancel a pending timer. - * - * See also [`addPeriodicTimer()`](#addperiodictimer) and [example #2](examples). - * - * Calling this method on a timer instance that has not been added to this - * loop instance or on a timer that has already been cancelled has no effect. - * - * @param TimerInterface $timer The timer to cancel. - * - * @return void - */ - public function cancelTimer(TimerInterface $timer); - - /** - * Schedule a callback to be invoked on a future tick of the event loop. - * - * This works very much similar to timers with an interval of zero seconds, - * but does not require the overhead of scheduling a timer queue. - * - * The tick callback function MUST be able to accept zero parameters. - * - * The tick callback function MUST NOT throw an `Exception`. - * The return value of the tick callback function will be ignored and has - * no effect, so for performance reasons you're recommended to not return - * any excessive data structures. - * - * If you want to access any variables within your callback function, you - * can bind arbitrary data to a callback closure like this: - * - * ```php - * function hello($name, LoopInterface $loop) - * { - * $loop->futureTick(function () use ($name) { - * echo "hello $name\n"; - * }); - * } - * - * hello('Tester', $loop); - * ``` - * - * Unlike timers, tick callbacks are guaranteed to be executed in the order - * they are enqueued. - * Also, once a callback is enqueued, there's no way to cancel this operation. - * - * This is often used to break down bigger tasks into smaller steps (a form - * of cooperative multitasking). - * - * ```php - * $loop->futureTick(function () { - * echo 'b'; - * }); - * $loop->futureTick(function () { - * echo 'c'; - * }); - * echo 'a'; - * ``` - * - * See also [example #3](examples). - * - * @param callable $listener The callback to invoke. - * - * @return void - */ - public function futureTick($listener); - - /** - * Register a listener to be notified when a signal has been caught by this process. - * - * This is useful to catch user interrupt signals or shutdown signals from - * tools like `supervisor` or `systemd`. - * - * The second parameter MUST be a listener callback function that accepts - * the signal as its only parameter. - * If you don't use the signal inside your listener callback function - * you MAY use a function which has no parameters at all. - * - * The listener callback function MUST NOT throw an `Exception`. - * The return value of the listener callback function will be ignored and has - * no effect, so for performance reasons you're recommended to not return - * any excessive data structures. - * - * ```php - * $loop->addSignal(SIGINT, function (int $signal) { - * echo 'Caught user interrupt signal' . PHP_EOL; - * }); - * ``` - * - * See also [example #4](examples). - * - * Signaling is only available on Unix-like platforms, Windows isn't - * supported due to operating system limitations. - * This method may throw a `BadMethodCallException` if signals aren't - * supported on this platform, for example when required extensions are - * missing. - * - * **Note: A listener can only be added once to the same signal, any - * attempts to add it more than once will be ignored.** - * - * @param int $signal - * @param callable $listener - * - * @throws \BadMethodCallException when signals aren't supported on this - * platform, for example when required extensions are missing. - * - * @return void - */ - public function addSignal($signal, $listener); - - /** - * Removes a previously added signal listener. - * - * ```php - * $loop->removeSignal(SIGINT, $listener); - * ``` - * - * Any attempts to remove listeners that aren't registered will be ignored. - * - * @param int $signal - * @param callable $listener - * - * @return void - */ - public function removeSignal($signal, $listener); - - /** - * Run the event loop until there are no more tasks to perform. - * - * For many applications, this method is the only directly visible - * invocation on the event loop. - * As a rule of thumb, it is usually recommended to attach everything to the - * same loop instance and then run the loop once at the bottom end of the - * application. - * - * ```php - * $loop->run(); - * ``` - * - * This method will keep the loop running until there are no more tasks - * to perform. In other words: This method will block until the last - * timer, stream and/or signal has been removed. - * - * Likewise, it is imperative to ensure the application actually invokes - * this method once. Adding listeners to the loop and missing to actually - * run it will result in the application exiting without actually waiting - * for any of the attached listeners. - * - * This method MUST NOT be called while the loop is already running. - * This method MAY be called more than once after it has explicitly been - * [`stop()`ped](#stop) or after it automatically stopped because it - * previously did no longer have anything to do. - * - * @return void - */ - public function run(); - - /** - * Instruct a running event loop to stop. - * - * This method is considered advanced usage and should be used with care. - * As a rule of thumb, it is usually recommended to let the loop stop - * only automatically when it no longer has anything to do. - * - * This method can be used to explicitly instruct the event loop to stop: - * - * ```php - * $loop->addTimer(3.0, function () use ($loop) { - * $loop->stop(); - * }); - * ``` - * - * Calling this method on a loop instance that is not currently running or - * on a loop instance that has already been stopped has no effect. - * - * @return void - */ - public function stop(); -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/SignalsHandler.php b/tools/php-cs-fixer/vendor/react/event-loop/src/SignalsHandler.php deleted file mode 100644 index 10d125df..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/SignalsHandler.php +++ /dev/null @@ -1,63 +0,0 @@ -signals[$signal])) { - $this->signals[$signal] = array(); - } - - if (\in_array($listener, $this->signals[$signal])) { - return; - } - - $this->signals[$signal][] = $listener; - } - - public function remove($signal, $listener) - { - if (!isset($this->signals[$signal])) { - return; - } - - $index = \array_search($listener, $this->signals[$signal], true); - unset($this->signals[$signal][$index]); - - if (isset($this->signals[$signal]) && \count($this->signals[$signal]) === 0) { - unset($this->signals[$signal]); - } - } - - public function call($signal) - { - if (!isset($this->signals[$signal])) { - return; - } - - foreach ($this->signals[$signal] as $listener) { - \call_user_func($listener, $signal); - } - } - - public function count($signal) - { - if (!isset($this->signals[$signal])) { - return 0; - } - - return \count($this->signals[$signal]); - } - - public function isEmpty() - { - return !$this->signals; - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/StreamSelectLoop.php b/tools/php-cs-fixer/vendor/react/event-loop/src/StreamSelectLoop.php deleted file mode 100644 index 1686fd74..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/StreamSelectLoop.php +++ /dev/null @@ -1,330 +0,0 @@ -futureTickQueue = new FutureTickQueue(); - $this->timers = new Timers(); - $this->pcntl = \function_exists('pcntl_signal') && \function_exists('pcntl_signal_dispatch'); - $this->pcntlPoll = $this->pcntl && !\function_exists('pcntl_async_signals'); - $this->signals = new SignalsHandler(); - - // prefer async signals if available (PHP 7.1+) or fall back to dispatching on each tick - if ($this->pcntl && !$this->pcntlPoll) { - \pcntl_async_signals(true); - } - } - - public function addReadStream($stream, $listener) - { - $key = (int) $stream; - - if (!isset($this->readStreams[$key])) { - $this->readStreams[$key] = $stream; - $this->readListeners[$key] = $listener; - } - } - - public function addWriteStream($stream, $listener) - { - $key = (int) $stream; - - if (!isset($this->writeStreams[$key])) { - $this->writeStreams[$key] = $stream; - $this->writeListeners[$key] = $listener; - } - } - - public function removeReadStream($stream) - { - $key = (int) $stream; - - unset( - $this->readStreams[$key], - $this->readListeners[$key] - ); - } - - public function removeWriteStream($stream) - { - $key = (int) $stream; - - unset( - $this->writeStreams[$key], - $this->writeListeners[$key] - ); - } - - public function addTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, false); - - $this->timers->add($timer); - - return $timer; - } - - public function addPeriodicTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, true); - - $this->timers->add($timer); - - return $timer; - } - - public function cancelTimer(TimerInterface $timer) - { - $this->timers->cancel($timer); - } - - public function futureTick($listener) - { - $this->futureTickQueue->add($listener); - } - - public function addSignal($signal, $listener) - { - if ($this->pcntl === false) { - throw new \BadMethodCallException('Event loop feature "signals" isn\'t supported by the "StreamSelectLoop"'); - } - - $first = $this->signals->count($signal) === 0; - $this->signals->add($signal, $listener); - - if ($first) { - \pcntl_signal($signal, array($this->signals, 'call')); - } - } - - public function removeSignal($signal, $listener) - { - if (!$this->signals->count($signal)) { - return; - } - - $this->signals->remove($signal, $listener); - - if ($this->signals->count($signal) === 0) { - \pcntl_signal($signal, \SIG_DFL); - } - } - - public function run() - { - $this->running = true; - - while ($this->running) { - $this->futureTickQueue->tick(); - - $this->timers->tick(); - - // Future-tick queue has pending callbacks ... - if (!$this->running || !$this->futureTickQueue->isEmpty()) { - $timeout = 0; - - // There is a pending timer, only block until it is due ... - } elseif ($scheduledAt = $this->timers->getFirst()) { - $timeout = $scheduledAt - $this->timers->getTime(); - if ($timeout < 0) { - $timeout = 0; - } else { - // Convert float seconds to int microseconds. - // Ensure we do not exceed maximum integer size, which may - // cause the loop to tick once every ~35min on 32bit systems. - $timeout *= self::MICROSECONDS_PER_SECOND; - $timeout = $timeout > \PHP_INT_MAX ? \PHP_INT_MAX : (int)$timeout; - } - - // The only possible event is stream or signal activity, so wait forever ... - } elseif ($this->readStreams || $this->writeStreams || !$this->signals->isEmpty()) { - $timeout = null; - - // There's nothing left to do ... - } else { - break; - } - - $this->waitForStreamActivity($timeout); - } - } - - public function stop() - { - $this->running = false; - } - - /** - * Wait/check for stream activity, or until the next timer is due. - * - * @param integer|null $timeout Activity timeout in microseconds, or null to wait forever. - */ - private function waitForStreamActivity($timeout) - { - $read = $this->readStreams; - $write = $this->writeStreams; - - $available = $this->streamSelect($read, $write, $timeout); - if ($this->pcntlPoll) { - \pcntl_signal_dispatch(); - } - if (false === $available) { - // if a system call has been interrupted, - // we cannot rely on it's outcome - return; - } - - foreach ($read as $stream) { - $key = (int) $stream; - - if (isset($this->readListeners[$key])) { - \call_user_func($this->readListeners[$key], $stream); - } - } - - foreach ($write as $stream) { - $key = (int) $stream; - - if (isset($this->writeListeners[$key])) { - \call_user_func($this->writeListeners[$key], $stream); - } - } - } - - /** - * Emulate a stream_select() implementation that does not break when passed - * empty stream arrays. - * - * @param array $read An array of read streams to select upon. - * @param array $write An array of write streams to select upon. - * @param int|null $timeout Activity timeout in microseconds, or null to wait forever. - * - * @return int|false The total number of streams that are ready for read/write. - * Can return false if stream_select() is interrupted by a signal. - */ - private function streamSelect(array &$read, array &$write, $timeout) - { - if ($read || $write) { - // We do not usually use or expose the `exceptfds` parameter passed to the underlying `select`. - // However, Windows does not report failed connection attempts in `writefds` passed to `select` like most other platforms. - // Instead, it uses `writefds` only for successful connection attempts and `exceptfds` for failed connection attempts. - // We work around this by adding all sockets that look like a pending connection attempt to `exceptfds` automatically on Windows and merge it back later. - // This ensures the public API matches other loop implementations across all platforms (see also test suite or rather test matrix). - // Lacking better APIs, every write-only socket that has not yet read any data is assumed to be in a pending connection attempt state. - // @link https://docs.microsoft.com/de-de/windows/win32/api/winsock2/nf-winsock2-select - $except = null; - if (\DIRECTORY_SEPARATOR === '\\') { - $except = array(); - foreach ($write as $key => $socket) { - if (!isset($read[$key]) && @\ftell($socket) === 0) { - $except[$key] = $socket; - } - } - } - - /** @var ?callable $previous */ - $previous = \set_error_handler(function ($errno, $errstr) use (&$previous) { - // suppress warnings that occur when `stream_select()` is interrupted by a signal - // PHP defines `EINTR` through `ext-sockets` or `ext-pcntl`, otherwise use common default (Linux & Mac) - $eintr = \defined('SOCKET_EINTR') ? \SOCKET_EINTR : (\defined('PCNTL_EINTR') ? \PCNTL_EINTR : 4); - if ($errno === \E_WARNING && \strpos($errstr, '[' . $eintr .']: ') !== false) { - return; - } - - // forward any other error to registered error handler or print warning - return ($previous !== null) ? \call_user_func_array($previous, \func_get_args()) : false; - }); - - try { - $ret = \stream_select($read, $write, $except, $timeout === null ? null : 0, $timeout); - \restore_error_handler(); - } catch (\Throwable $e) { // @codeCoverageIgnoreStart - \restore_error_handler(); - throw $e; - } catch (\Exception $e) { - \restore_error_handler(); - throw $e; - } // @codeCoverageIgnoreEnd - - if ($except) { - $write = \array_merge($write, $except); - } - return $ret; - } - - if ($timeout > 0) { - \usleep($timeout); - } elseif ($timeout === null) { - // wait forever (we only reach this if we're only awaiting signals) - // this may be interrupted and return earlier when a signal is received - \sleep(PHP_INT_MAX); - } - - return 0; - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/Tick/FutureTickQueue.php b/tools/php-cs-fixer/vendor/react/event-loop/src/Tick/FutureTickQueue.php deleted file mode 100644 index efabcbc5..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/Tick/FutureTickQueue.php +++ /dev/null @@ -1,60 +0,0 @@ -queue = new SplQueue(); - } - - /** - * Add a callback to be invoked on a future tick of the event loop. - * - * Callbacks are guaranteed to be executed in the order they are enqueued. - * - * @param callable $listener The callback to invoke. - */ - public function add($listener) - { - $this->queue->enqueue($listener); - } - - /** - * Flush the callback queue. - */ - public function tick() - { - // Only invoke as many callbacks as were on the queue when tick() was called. - $count = $this->queue->count(); - - while ($count--) { - \call_user_func( - $this->queue->dequeue() - ); - } - } - - /** - * Check if the next tick queue is empty. - * - * @return boolean - */ - public function isEmpty() - { - return $this->queue->isEmpty(); - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timer.php b/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timer.php deleted file mode 100644 index da3602a3..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timer.php +++ /dev/null @@ -1,55 +0,0 @@ -interval = (float) $interval; - $this->callback = $callback; - $this->periodic = (bool) $periodic; - } - - public function getInterval() - { - return $this->interval; - } - - public function getCallback() - { - return $this->callback; - } - - public function isPeriodic() - { - return $this->periodic; - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timers.php b/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timers.php deleted file mode 100644 index 53c46d03..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/Timer/Timers.php +++ /dev/null @@ -1,113 +0,0 @@ -useHighResolution = \function_exists('hrtime'); - } - - public function updateTime() - { - return $this->time = $this->useHighResolution ? \hrtime(true) * 1e-9 : \microtime(true); - } - - public function getTime() - { - return $this->time ?: $this->updateTime(); - } - - public function add(TimerInterface $timer) - { - $id = \PHP_VERSION_ID < 70200 ? \spl_object_hash($timer) : \spl_object_id($timer); - $this->timers[$id] = $timer; - $this->schedule[$id] = $timer->getInterval() + $this->updateTime(); - $this->sorted = false; - } - - public function contains(TimerInterface $timer) - { - $id = \PHP_VERSION_ID < 70200 ? \spl_object_hash($timer) : \spl_object_id($timer); - return isset($this->timers[$id]); - } - - public function cancel(TimerInterface $timer) - { - $id = \PHP_VERSION_ID < 70200 ? \spl_object_hash($timer) : \spl_object_id($timer); - unset($this->timers[$id], $this->schedule[$id]); - } - - public function getFirst() - { - // ensure timers are sorted to simply accessing next (first) one - if (!$this->sorted) { - $this->sorted = true; - \asort($this->schedule); - } - - return \reset($this->schedule); - } - - public function isEmpty() - { - return \count($this->timers) === 0; - } - - public function tick() - { - // hot path: skip timers if nothing is scheduled - if (!$this->schedule) { - return; - } - - // ensure timers are sorted so we can execute in order - if (!$this->sorted) { - $this->sorted = true; - \asort($this->schedule); - } - - $time = $this->updateTime(); - - foreach ($this->schedule as $id => $scheduled) { - // schedule is ordered, so loop until first timer that is not scheduled for execution now - if ($scheduled >= $time) { - break; - } - - // skip any timers that are removed while we process the current schedule - if (!isset($this->schedule[$id]) || $this->schedule[$id] !== $scheduled) { - continue; - } - - $timer = $this->timers[$id]; - \call_user_func($timer->getCallback(), $timer); - - // re-schedule if this is a periodic timer and it has not been cancelled explicitly already - if ($timer->isPeriodic() && isset($this->timers[$id])) { - $this->schedule[$id] = $timer->getInterval() + $time; - $this->sorted = false; - } else { - unset($this->timers[$id], $this->schedule[$id]); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/event-loop/src/TimerInterface.php b/tools/php-cs-fixer/vendor/react/event-loop/src/TimerInterface.php deleted file mode 100644 index cdcf7732..00000000 --- a/tools/php-cs-fixer/vendor/react/event-loop/src/TimerInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -` and `reject(Throwable $reason): PromiseInterface`. - It is no longer possible to resolve a promise without a value (use `null` instead) or reject a promise without a reason (use `Throwable` instead). - (#93, #141 and #142 by @jsor, #138, #149 and #247 by @WyriHaximus and #213 and #246 by @clue) - - ```php - // old (arguments used to be optional) - $promise = resolve(); - $promise = reject(); - - // new (already supported before) - $promise = resolve(null); - $promise = reject(new RuntimeException()); - ``` - -* Feature / BC break: Report all unhandled rejections by default and remove ~~`done()`~~ method. - Add new `set_rejection_handler()` function to set the global rejection handler for unhandled promise rejections. - (#248, #249 and #224 by @clue) - - ```php - // Unhandled promise rejection with RuntimeException: Unhandled in example.php:2 - reject(new RuntimeException('Unhandled')); - ``` - -* BC break: Remove all deprecated APIs and reduce API surface. - Remove ~~`some()`~~, ~~`map()`~~, ~~`reduce()`~~ functions, use `any()` and `all()` functions instead. - Remove internal ~~`FulfilledPromise`~~ and ~~`RejectedPromise`~~ classes, use `resolve()` and `reject()` functions instead. - Remove legacy promise progress API (deprecated third argument to `then()` method) and deprecated ~~`LazyPromise`~~ class. - (#32 and #98 by @jsor and #164, #219 and #220 by @clue) - -* BC break: Make all classes final to encourage composition over inheritance. - (#80 by @jsor) - -* Feature / BC break: Require `array` (or `iterable`) type for `all()` + `race()` + `any()` functions and bring in line with ES6 specification. - These functions now require a single argument with a variable number of promises or values as input. - (#225 by @clue and #35 by @jsor) - -* Fix / BC break: Fix `race()` to return a forever pending promise when called with an empty `array` (or `iterable`) and bring in line with ES6 specification. - (#83 by @jsor and #225 by @clue) - -* Minor performance improvements by initializing `Deferred` in the constructor and avoiding `call_user_func()` calls. - (#151 by @WyriHaximus and #171 by @Kubo2) - -* Minor documentation improvements. - (#110 by @seregazhuk, #132 by @CharlotteDunois, #145 by @danielecr, #178 by @WyriHaximus, #189 by @srdante, #212 by @clue, #214, #239 and #243 by @SimonFrings and #231 by @nhedger) - -The following changes had to be ported to this release due to our branching -strategy, but also appeared in the [`2.x` branch](https://github.com/reactphp/promise/tree/2.x): - -* Feature: Support union types and address deprecation of `ReflectionType::getClass()` (PHP 8+). - (#197 by @cdosoftei and @SimonFrings) - -* Feature: Support intersection types (PHP 8.1+). - (#209 by @bzikarsky) - -* Feature: Support DNS types (PHP 8.2+). - (#236 by @nhedger) - -* Feature: Port all memory improvements from `2.x` to `3.x`. - (#150 by @clue and @WyriHaximus) - -* Fix: Fix checking whether cancellable promise is an object and avoid possible warning. - (#161 by @smscr) - -* Improve performance by prefixing all global functions calls with \ to skip the look up and resolve process and go straight to the global function. - (#134 by @WyriHaximus) - -* Improve test suite, update PHPUnit and PHP versions and add `.gitattributes` to exclude dev files from exports. - (#107 by @carusogabriel, #148 and #234 by @WyriHaximus, #153 by @reedy, #162, #230 and #240 by @clue, #173, #177, #185 and #199 by @SimonFrings, #193 by @woodongwong and #210 by @bzikarsky) - -The following changes were originally planned for this release but later reverted -and are not part of the final release: - -* Add iterative callback queue handler to avoid recursion (later removed to improve Fiber support). - (#28, #82 and #86 by @jsor, #158 by @WyriHaximus and #229 and #238 by @clue) - -* Trigger an `E_USER_ERROR` instead of throwing an exception from `done()` (later removed entire `done()` method to globally report unhandled rejections). - (#97 by @jsor and #224 and #248 by @clue) - -* Add type declarations for `some()` (later removed entire `some()` function). - (#172 by @WyriHaximus and #219 by @clue) - -## 2.0.0 (2013-12-10) - -See [`2.x` CHANGELOG](https://github.com/reactphp/promise/blob/2.x/CHANGELOG.md) for more details. - -## 1.0.0 (2012-11-07) - -See [`1.x` CHANGELOG](https://github.com/reactphp/promise/blob/1.x/CHANGELOG.md) for more details. diff --git a/tools/php-cs-fixer/vendor/react/promise/LICENSE b/tools/php-cs-fixer/vendor/react/promise/LICENSE deleted file mode 100644 index 21c1357b..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012 Jan Sorgalla, Christian Lück, Cees-Jan Kiewiet, Chris Boden - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/promise/README.md b/tools/php-cs-fixer/vendor/react/promise/README.md deleted file mode 100644 index 2108d982..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/README.md +++ /dev/null @@ -1,722 +0,0 @@ -Promise -======= - -A lightweight implementation of -[CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP. - -[![CI status](https://github.com/reactphp/promise/workflows/CI/badge.svg)](https://github.com/reactphp/promise/actions) -[![installs on Packagist](https://img.shields.io/packagist/dt/react/promise?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/promise) - -Table of Contents ------------------ - -1. [Introduction](#introduction) -2. [Concepts](#concepts) - * [Deferred](#deferred) - * [Promise](#promise-1) -3. [API](#api) - * [Deferred](#deferred-1) - * [Deferred::promise()](#deferredpromise) - * [Deferred::resolve()](#deferredresolve) - * [Deferred::reject()](#deferredreject) - * [PromiseInterface](#promiseinterface) - * [PromiseInterface::then()](#promiseinterfacethen) - * [PromiseInterface::catch()](#promiseinterfacecatch) - * [PromiseInterface::finally()](#promiseinterfacefinally) - * [PromiseInterface::cancel()](#promiseinterfacecancel) - * [~~PromiseInterface::otherwise()~~](#promiseinterfaceotherwise) - * [~~PromiseInterface::always()~~](#promiseinterfacealways) - * [Promise](#promise-2) - * [Functions](#functions) - * [resolve()](#resolve) - * [reject()](#reject) - * [all()](#all) - * [race()](#race) - * [any()](#any) - * [set_rejection_handler()](#set_rejection_handler) -4. [Examples](#examples) - * [How to use Deferred](#how-to-use-deferred) - * [How promise forwarding works](#how-promise-forwarding-works) - * [Resolution forwarding](#resolution-forwarding) - * [Rejection forwarding](#rejection-forwarding) - * [Mixed resolution and rejection forwarding](#mixed-resolution-and-rejection-forwarding) -5. [Install](#install) -6. [Tests](#tests) -7. [Credits](#credits) -8. [License](#license) - -Introduction ------------- - -Promise is a library implementing -[CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP. - -It also provides several other useful promise-related concepts, such as joining -multiple promises and mapping and reducing collections of promises. - -If you've never heard about promises before, -[read this first](https://gist.github.com/domenic/3889970). - -Concepts --------- - -### Deferred - -A **Deferred** represents a computation or unit of work that may not have -completed yet. Typically (but not always), that computation will be something -that executes asynchronously and completes at some point in the future. - -### Promise - -While a deferred represents the computation itself, a **Promise** represents -the result of that computation. Thus, each deferred has a promise that acts as -a placeholder for its actual result. - -API ---- - -### Deferred - -A deferred represents an operation whose resolution is pending. It has separate -promise and resolver parts. - -```php -$deferred = new React\Promise\Deferred(); - -$promise = $deferred->promise(); - -$deferred->resolve(mixed $value); -$deferred->reject(\Throwable $reason); -``` - -The `promise` method returns the promise of the deferred. - -The `resolve` and `reject` methods control the state of the deferred. - -The constructor of the `Deferred` accepts an optional `$canceller` argument. -See [Promise](#promise-2) for more information. - -#### Deferred::promise() - -```php -$promise = $deferred->promise(); -``` - -Returns the promise of the deferred, which you can hand out to others while -keeping the authority to modify its state to yourself. - -#### Deferred::resolve() - -```php -$deferred->resolve(mixed $value); -``` - -Resolves the promise returned by `promise()`. All consumers are notified by -having `$onFulfilled` (which they registered via `$promise->then()`) called with -`$value`. - -If `$value` itself is a promise, the promise will transition to the state of -this promise once it is resolved. - -See also the [`resolve()` function](#resolve). - -#### Deferred::reject() - -```php -$deferred->reject(\Throwable $reason); -``` - -Rejects the promise returned by `promise()`, signalling that the deferred's -computation failed. -All consumers are notified by having `$onRejected` (which they registered via -`$promise->then()`) called with `$reason`. - -See also the [`reject()` function](#reject). - -### PromiseInterface - -The promise interface provides the common interface for all promise -implementations. -See [Promise](#promise-2) for the only public implementation exposed by this -package. - -A promise represents an eventual outcome, which is either fulfillment (success) -and an associated value, or rejection (failure) and an associated reason. - -Once in the fulfilled or rejected state, a promise becomes immutable. -Neither its state nor its result (or error) can be modified. - -#### PromiseInterface::then() - -```php -$transformedPromise = $promise->then(callable $onFulfilled = null, callable $onRejected = null); -``` - -Transforms a promise's value by applying a function to the promise's fulfillment -or rejection value. Returns a new promise for the transformed result. - -The `then()` method registers new fulfilled and rejection handlers with a promise -(all parameters are optional): - - * `$onFulfilled` will be invoked once the promise is fulfilled and passed - the result as the first argument. - * `$onRejected` will be invoked once the promise is rejected and passed the - reason as the first argument. - -It returns a new promise that will fulfill with the return value of either -`$onFulfilled` or `$onRejected`, whichever is called, or will reject with -the thrown exception if either throws. - -A promise makes the following guarantees about handlers registered in -the same call to `then()`: - - 1. Only one of `$onFulfilled` or `$onRejected` will be called, - never both. - 2. `$onFulfilled` and `$onRejected` will never be called more - than once. - -#### See also - -* [resolve()](#resolve) - Creating a resolved promise -* [reject()](#reject) - Creating a rejected promise - -#### PromiseInterface::catch() - -```php -$promise->catch(callable $onRejected); -``` - -Registers a rejection handler for promise. It is a shortcut for: - -```php -$promise->then(null, $onRejected); -``` - -Additionally, you can type hint the `$reason` argument of `$onRejected` to catch -only specific errors. - -```php -$promise - ->catch(function (\RuntimeException $reason) { - // Only catch \RuntimeException instances - // All other types of errors will propagate automatically - }) - ->catch(function (\Throwable $reason) { - // Catch other errors - }); -``` - -#### PromiseInterface::finally() - -```php -$newPromise = $promise->finally(callable $onFulfilledOrRejected); -``` - -Allows you to execute "cleanup" type tasks in a promise chain. - -It arranges for `$onFulfilledOrRejected` to be called, with no arguments, -when the promise is either fulfilled or rejected. - -* If `$promise` fulfills, and `$onFulfilledOrRejected` returns successfully, - `$newPromise` will fulfill with the same value as `$promise`. -* If `$promise` fulfills, and `$onFulfilledOrRejected` throws or returns a - rejected promise, `$newPromise` will reject with the thrown exception or - rejected promise's reason. -* If `$promise` rejects, and `$onFulfilledOrRejected` returns successfully, - `$newPromise` will reject with the same reason as `$promise`. -* If `$promise` rejects, and `$onFulfilledOrRejected` throws or returns a - rejected promise, `$newPromise` will reject with the thrown exception or - rejected promise's reason. - -`finally()` behaves similarly to the synchronous finally statement. When combined -with `catch()`, `finally()` allows you to write code that is similar to the familiar -synchronous catch/finally pair. - -Consider the following synchronous code: - -```php -try { - return doSomething(); -} catch (\Throwable $e) { - return handleError($e); -} finally { - cleanup(); -} -``` - -Similar asynchronous code (with `doSomething()` that returns a promise) can be -written: - -```php -return doSomething() - ->catch('handleError') - ->finally('cleanup'); -``` - -#### PromiseInterface::cancel() - -``` php -$promise->cancel(); -``` - -The `cancel()` method notifies the creator of the promise that there is no -further interest in the results of the operation. - -Once a promise is settled (either fulfilled or rejected), calling `cancel()` on -a promise has no effect. - -#### ~~PromiseInterface::otherwise()~~ - -> Deprecated since v3.0.0, see [`catch()`](#promiseinterfacecatch) instead. - -The `otherwise()` method registers a rejection handler for a promise. - -This method continues to exist only for BC reasons and to ease upgrading -between versions. It is an alias for: - -```php -$promise->catch($onRejected); -``` - -#### ~~PromiseInterface::always()~~ - -> Deprecated since v3.0.0, see [`finally()`](#promiseinterfacefinally) instead. - -The `always()` method allows you to execute "cleanup" type tasks in a promise chain. - -This method continues to exist only for BC reasons and to ease upgrading -between versions. It is an alias for: - -```php -$promise->finally($onFulfilledOrRejected); -``` - -### Promise - -Creates a promise whose state is controlled by the functions passed to -`$resolver`. - -```php -$resolver = function (callable $resolve, callable $reject) { - // Do some work, possibly asynchronously, and then - // resolve or reject. - - $resolve($awesomeResult); - // or throw new Exception('Promise rejected'); - // or $resolve($anotherPromise); - // or $reject($nastyError); -}; - -$canceller = function () { - // Cancel/abort any running operations like network connections, streams etc. - - // Reject promise by throwing an exception - throw new Exception('Promise cancelled'); -}; - -$promise = new React\Promise\Promise($resolver, $canceller); -``` - -The promise constructor receives a resolver function and an optional canceller -function which both will be called with two arguments: - - * `$resolve($value)` - Primary function that seals the fate of the - returned promise. Accepts either a non-promise value, or another promise. - When called with a non-promise value, fulfills promise with that value. - When called with another promise, e.g. `$resolve($otherPromise)`, promise's - fate will be equivalent to that of `$otherPromise`. - * `$reject($reason)` - Function that rejects the promise. It is recommended to - just throw an exception instead of using `$reject()`. - -If the resolver or canceller throw an exception, the promise will be rejected -with that thrown exception as the rejection reason. - -The resolver function will be called immediately, the canceller function only -once all consumers called the `cancel()` method of the promise. - -### Functions - -Useful functions for creating and joining collections of promises. - -All functions working on promise collections (like `all()`, `race()`, -etc.) support cancellation. This means, if you call `cancel()` on the returned -promise, all promises in the collection are cancelled. - -#### resolve() - -```php -$promise = React\Promise\resolve(mixed $promiseOrValue); -``` - -Creates a promise for the supplied `$promiseOrValue`. - -If `$promiseOrValue` is a value, it will be the resolution value of the -returned promise. - -If `$promiseOrValue` is a thenable (any object that provides a `then()` method), -a trusted promise that follows the state of the thenable is returned. - -If `$promiseOrValue` is a promise, it will be returned as is. - -The resulting `$promise` implements the [`PromiseInterface`](#promiseinterface) -and can be consumed like any other promise: - -```php -$promise = React\Promise\resolve(42); - -$promise->then(function (int $result): void { - var_dump($result); -}, function (\Throwable $e): void { - echo 'Error: ' . $e->getMessage() . PHP_EOL; -}); -``` - -#### reject() - -```php -$promise = React\Promise\reject(\Throwable $reason); -``` - -Creates a rejected promise for the supplied `$reason`. - -Note that the [`\Throwable`](https://www.php.net/manual/en/class.throwable.php) interface introduced in PHP 7 covers -both user land [`\Exception`](https://www.php.net/manual/en/class.exception.php)'s and -[`\Error`](https://www.php.net/manual/en/class.error.php) internal PHP errors. By enforcing `\Throwable` as reason to -reject a promise, any language error or user land exception can be used to reject a promise. - -The resulting `$promise` implements the [`PromiseInterface`](#promiseinterface) -and can be consumed like any other promise: - -```php -$promise = React\Promise\reject(new RuntimeException('Request failed')); - -$promise->then(function (int $result): void { - var_dump($result); -}, function (\Throwable $e): void { - echo 'Error: ' . $e->getMessage() . PHP_EOL; -}); -``` - -Note that rejected promises should always be handled similar to how any -exceptions should always be caught in a `try` + `catch` block. If you remove the -last reference to a rejected promise that has not been handled, it will -report an unhandled promise rejection: - -```php -function incorrect(): int -{ - $promise = React\Promise\reject(new RuntimeException('Request failed')); - - // Commented out: No rejection handler registered here. - // $promise->then(null, function (\Throwable $e): void { /* ignore */ }); - - // Returning from a function will remove all local variable references, hence why - // this will report an unhandled promise rejection here. - return 42; -} - -// Calling this function will log an error message plus its stack trace: -// Unhandled promise rejection with RuntimeException: Request failed in example.php:10 -incorrect(); -``` - -A rejected promise will be considered "handled" if you catch the rejection -reason with either the [`then()` method](#promiseinterfacethen), the -[`catch()` method](#promiseinterfacecatch), or the -[`finally()` method](#promiseinterfacefinally). Note that each of these methods -return a new promise that may again be rejected if you re-throw an exception. - -A rejected promise will also be considered "handled" if you abort the operation -with the [`cancel()` method](#promiseinterfacecancel) (which in turn would -usually reject the promise if it is still pending). - -See also the [`set_rejection_handler()` function](#set_rejection_handler). - -#### all() - -```php -$promise = React\Promise\all(iterable $promisesOrValues); -``` - -Returns a promise that will resolve only once all the items in -`$promisesOrValues` have resolved. The resolution value of the returned promise -will be an array containing the resolution values of each of the items in -`$promisesOrValues`. - -#### race() - -```php -$promise = React\Promise\race(iterable $promisesOrValues); -``` - -Initiates a competitive race that allows one winner. Returns a promise which is -resolved in the same way the first settled promise resolves. - -The returned promise will become **infinitely pending** if `$promisesOrValues` -contains 0 items. - -#### any() - -```php -$promise = React\Promise\any(iterable $promisesOrValues); -``` - -Returns a promise that will resolve when any one of the items in -`$promisesOrValues` resolves. The resolution value of the returned promise -will be the resolution value of the triggering item. - -The returned promise will only reject if *all* items in `$promisesOrValues` are -rejected. The rejection value will be a `React\Promise\Exception\CompositeException` -which holds all rejection reasons. The rejection reasons can be obtained with -`CompositeException::getThrowables()`. - -The returned promise will also reject with a `React\Promise\Exception\LengthException` -if `$promisesOrValues` contains 0 items. - -#### set_rejection_handler() - -```php -React\Promise\set_rejection_handler(?callable $callback): ?callable; -``` - -Sets the global rejection handler for unhandled promise rejections. - -Note that rejected promises should always be handled similar to how any -exceptions should always be caught in a `try` + `catch` block. If you remove -the last reference to a rejected promise that has not been handled, it will -report an unhandled promise rejection. See also the [`reject()` function](#reject) -for more details. - -The `?callable $callback` argument MUST be a valid callback function that -accepts a single `Throwable` argument or a `null` value to restore the -default promise rejection handler. The return value of the callback function -will be ignored and has no effect, so you SHOULD return a `void` value. The -callback function MUST NOT throw or the program will be terminated with a -fatal error. - -The function returns the previous rejection handler or `null` if using the -default promise rejection handler. - -The default promise rejection handler will log an error message plus its stack -trace: - -```php -// Unhandled promise rejection with RuntimeException: Unhandled in example.php:2 -React\Promise\reject(new RuntimeException('Unhandled')); -``` - -The promise rejection handler may be used to use customize the log message or -write to custom log targets. As a rule of thumb, this function should only be -used as a last resort and promise rejections are best handled with either the -[`then()` method](#promiseinterfacethen), the -[`catch()` method](#promiseinterfacecatch), or the -[`finally()` method](#promiseinterfacefinally). -See also the [`reject()` function](#reject) for more details. - -Examples --------- - -### How to use Deferred - -```php -function getAwesomeResultPromise() -{ - $deferred = new React\Promise\Deferred(); - - // Execute a Node.js-style function using the callback pattern - computeAwesomeResultAsynchronously(function (\Throwable $error, $result) use ($deferred) { - if ($error) { - $deferred->reject($error); - } else { - $deferred->resolve($result); - } - }); - - // Return the promise - return $deferred->promise(); -} - -getAwesomeResultPromise() - ->then( - function ($value) { - // Deferred resolved, do something with $value - }, - function (\Throwable $reason) { - // Deferred rejected, do something with $reason - } - ); -``` - -### How promise forwarding works - -A few simple examples to show how the mechanics of Promises/A forwarding works. -These examples are contrived, of course, and in real usage, promise chains will -typically be spread across several function calls, or even several levels of -your application architecture. - -#### Resolution forwarding - -Resolved promises forward resolution values to the next promise. -The first promise, `$deferred->promise()`, will resolve with the value passed -to `$deferred->resolve()` below. - -Each call to `then()` returns a new promise that will resolve with the return -value of the previous handler. This creates a promise "pipeline". - -```php -$deferred = new React\Promise\Deferred(); - -$deferred->promise() - ->then(function ($x) { - // $x will be the value passed to $deferred->resolve() below - // and returns a *new promise* for $x + 1 - return $x + 1; - }) - ->then(function ($x) { - // $x === 2 - // This handler receives the return value of the - // previous handler. - return $x + 1; - }) - ->then(function ($x) { - // $x === 3 - // This handler receives the return value of the - // previous handler. - return $x + 1; - }) - ->then(function ($x) { - // $x === 4 - // This handler receives the return value of the - // previous handler. - echo 'Resolve ' . $x; - }); - -$deferred->resolve(1); // Prints "Resolve 4" -``` - -#### Rejection forwarding - -Rejected promises behave similarly, and also work similarly to try/catch: -When you catch an exception, you must rethrow for it to propagate. - -Similarly, when you handle a rejected promise, to propagate the rejection, -"rethrow" it by either returning a rejected promise, or actually throwing -(since promise translates thrown exceptions into rejections) - -```php -$deferred = new React\Promise\Deferred(); - -$deferred->promise() - ->then(function ($x) { - throw new \Exception($x + 1); - }) - ->catch(function (\Exception $x) { - // Propagate the rejection - throw $x; - }) - ->catch(function (\Exception $x) { - // Can also propagate by returning another rejection - return React\Promise\reject( - new \Exception($x->getMessage() + 1) - ); - }) - ->catch(function ($x) { - echo 'Reject ' . $x->getMessage(); // 3 - }); - -$deferred->resolve(1); // Prints "Reject 3" -``` - -#### Mixed resolution and rejection forwarding - -Just like try/catch, you can choose to propagate or not. Mixing resolutions and -rejections will still forward handler results in a predictable way. - -```php -$deferred = new React\Promise\Deferred(); - -$deferred->promise() - ->then(function ($x) { - return $x + 1; - }) - ->then(function ($x) { - throw new \Exception($x + 1); - }) - ->catch(function (\Exception $x) { - // Handle the rejection, and don't propagate. - // This is like catch without a rethrow - return $x->getMessage() + 1; - }) - ->then(function ($x) { - echo 'Mixed ' . $x; // 4 - }); - -$deferred->resolve(1); // Prints "Mixed 4" -``` - -Install -------- - -The recommended way to install this library is [through Composer](https://getcomposer.org/). -[New to Composer?](https://getcomposer.org/doc/00-intro.md) - -This project follows [SemVer](https://semver.org/). -This will install the latest supported version from this branch: - -```bash -composer require react/promise:^3.2 -``` - -See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. - -This project aims to run on any platform and thus does not require any PHP -extensions and supports running on PHP 7.1 through current PHP 8+. -It's *highly recommended to use the latest supported PHP version* for this project. - -We're committed to providing long-term support (LTS) options and to provide a -smooth upgrade path. If you're using an older PHP version, you may use the -[`2.x` branch](https://github.com/reactphp/promise/tree/2.x) (PHP 5.4+) or -[`1.x` branch](https://github.com/reactphp/promise/tree/1.x) (PHP 5.3+) which both -provide a compatible API but do not take advantage of newer language features. -You may target multiple versions at the same time to support a wider range of -PHP versions like this: - -```bash -composer require "react/promise:^3 || ^2 || ^1" -``` - -## Tests - -To run the test suite, you first need to clone this repo and then install all -dependencies [through Composer](https://getcomposer.org/): - -```bash -composer install -``` - -To run the test suite, go to the project root and run: - -```bash -vendor/bin/phpunit -``` - -On top of this, we use PHPStan on max level to ensure type safety across the project: - -```bash -vendor/bin/phpstan -``` - -Credits -------- - -Promise is a port of [when.js](https://github.com/cujojs/when) -by [Brian Cavalier](https://github.com/briancavalier). - -Also, large parts of the documentation have been ported from the when.js -[Wiki](https://github.com/cujojs/when/wiki) and the -[API docs](https://github.com/cujojs/when/blob/master/docs/api.md). - -License -------- - -Released under the [MIT](LICENSE) license. diff --git a/tools/php-cs-fixer/vendor/react/promise/composer.json b/tools/php-cs-fixer/vendor/react/promise/composer.json deleted file mode 100644 index 5d1e2771..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/composer.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "react/promise", - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "license": "MIT", - "authors": [ - { - "name": "Jan Sorgalla", - "homepage": "https://sorgalla.com/", - "email": "jsorgalla@gmail.com" - }, - { - "name": "Christian Lück", - "homepage": "https://clue.engineering/", - "email": "christian@clue.engineering" - }, - { - "name": "Cees-Jan Kiewiet", - "homepage": "https://wyrihaximus.net/", - "email": "reactphp@ceesjankiewiet.nl" - }, - { - "name": "Chris Boden", - "homepage": "https://cboden.dev/", - "email": "cboden@gmail.com" - } - ], - "require": { - "php": ">=7.1.0" - }, - "require-dev": { - "phpstan/phpstan": "1.10.39 || 1.4.10", - "phpunit/phpunit": "^9.6 || ^7.5" - }, - "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "autoload-dev": { - "psr-4": { - "React\\Promise\\": [ - "tests/fixtures/", - "tests/" - ] - }, - "files": [ - "tests/Fiber.php" - ] - }, - "keywords": [ - "promise", - "promises" - ] -} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Deferred.php b/tools/php-cs-fixer/vendor/react/promise/src/Deferred.php deleted file mode 100644 index 80b8fcfb..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/src/Deferred.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ - private $promise; - - /** @var callable(T):void */ - private $resolveCallback; - - /** @var callable(\Throwable):void */ - private $rejectCallback; - - /** - * @param (callable(callable(T):void,callable(\Throwable):void):void)|null $canceller - */ - public function __construct(?callable $canceller = null) - { - $this->promise = new Promise(function ($resolve, $reject): void { - $this->resolveCallback = $resolve; - $this->rejectCallback = $reject; - }, $canceller); - } - - /** - * @return PromiseInterface - */ - public function promise(): PromiseInterface - { - return $this->promise; - } - - /** - * @param T $value - */ - public function resolve($value): void - { - ($this->resolveCallback)($value); - } - - public function reject(\Throwable $reason): void - { - ($this->rejectCallback)($reason); - } -} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Exception/CompositeException.php b/tools/php-cs-fixer/vendor/react/promise/src/Exception/CompositeException.php deleted file mode 100644 index 2e672a04..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/src/Exception/CompositeException.php +++ /dev/null @@ -1,32 +0,0 @@ -throwables = $throwables; - } - - /** - * @return \Throwable[] - */ - public function getThrowables(): array - { - return $this->throwables; - } -} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Exception/LengthException.php b/tools/php-cs-fixer/vendor/react/promise/src/Exception/LengthException.php deleted file mode 100644 index 775c48db..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/src/Exception/LengthException.php +++ /dev/null @@ -1,7 +0,0 @@ -started) { - return; - } - - $this->started = true; - $this->drain(); - } - - /** - * @param mixed $cancellable - */ - public function enqueue($cancellable): void - { - if (!\is_object($cancellable) || !\method_exists($cancellable, 'then') || !\method_exists($cancellable, 'cancel')) { - return; - } - - $length = \array_push($this->queue, $cancellable); - - if ($this->started && 1 === $length) { - $this->drain(); - } - } - - private function drain(): void - { - for ($i = \key($this->queue); isset($this->queue[$i]); $i++) { - $cancellable = $this->queue[$i]; - assert(\method_exists($cancellable, 'cancel')); - - $exception = null; - - try { - $cancellable->cancel(); - } catch (\Throwable $exception) { - } - - unset($this->queue[$i]); - - if ($exception) { - throw $exception; - } - } - - $this->queue = []; - } -} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Internal/FulfilledPromise.php b/tools/php-cs-fixer/vendor/react/promise/src/Internal/FulfilledPromise.php deleted file mode 100644 index 8664ffdb..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/src/Internal/FulfilledPromise.php +++ /dev/null @@ -1,89 +0,0 @@ - - */ -final class FulfilledPromise implements PromiseInterface -{ - /** @var T */ - private $value; - - /** - * @param T $value - * @throws \InvalidArgumentException - */ - public function __construct($value = null) - { - if ($value instanceof PromiseInterface) { - throw new \InvalidArgumentException('You cannot create React\Promise\FulfilledPromise with a promise. Use React\Promise\resolve($promiseOrValue) instead.'); - } - - $this->value = $value; - } - - /** - * @template TFulfilled - * @param ?(callable((T is void ? null : T)): (PromiseInterface|TFulfilled)) $onFulfilled - * @return PromiseInterface<($onFulfilled is null ? T : TFulfilled)> - */ - public function then(?callable $onFulfilled = null, ?callable $onRejected = null): PromiseInterface - { - if (null === $onFulfilled) { - return $this; - } - - try { - /** - * @var PromiseInterface|T $result - */ - $result = $onFulfilled($this->value); - return resolve($result); - } catch (\Throwable $exception) { - return new RejectedPromise($exception); - } - } - - public function catch(callable $onRejected): PromiseInterface - { - return $this; - } - - public function finally(callable $onFulfilledOrRejected): PromiseInterface - { - return $this->then(function ($value) use ($onFulfilledOrRejected): PromiseInterface { - return resolve($onFulfilledOrRejected())->then(function () use ($value) { - return $value; - }); - }); - } - - public function cancel(): void - { - } - - /** - * @deprecated 3.0.0 Use `catch()` instead - * @see self::catch() - */ - public function otherwise(callable $onRejected): PromiseInterface - { - return $this->catch($onRejected); - } - - /** - * @deprecated 3.0.0 Use `finally()` instead - * @see self::finally() - */ - public function always(callable $onFulfilledOrRejected): PromiseInterface - { - return $this->finally($onFulfilledOrRejected); - } -} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Internal/RejectedPromise.php b/tools/php-cs-fixer/vendor/react/promise/src/Internal/RejectedPromise.php deleted file mode 100644 index aa1dff30..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/src/Internal/RejectedPromise.php +++ /dev/null @@ -1,128 +0,0 @@ - - */ -final class RejectedPromise implements PromiseInterface -{ - /** @var \Throwable */ - private $reason; - - /** @var bool */ - private $handled = false; - - /** - * @param \Throwable $reason - */ - public function __construct(\Throwable $reason) - { - $this->reason = $reason; - } - - /** @throws void */ - public function __destruct() - { - if ($this->handled) { - return; - } - - $handler = set_rejection_handler(null); - if ($handler === null) { - $message = 'Unhandled promise rejection with ' . $this->reason; - - \error_log($message); - return; - } - - try { - $handler($this->reason); - } catch (\Throwable $e) { - \preg_match('/^([^:\s]++)(.*+)$/sm', (string) $e, $match); - \assert(isset($match[1], $match[2])); - $message = 'Fatal error: Uncaught ' . $match[1] . ' from unhandled promise rejection handler' . $match[2]; - - \error_log($message); - exit(255); - } - } - - /** - * @template TRejected - * @param ?callable $onFulfilled - * @param ?(callable(\Throwable): (PromiseInterface|TRejected)) $onRejected - * @return PromiseInterface<($onRejected is null ? never : TRejected)> - */ - public function then(?callable $onFulfilled = null, ?callable $onRejected = null): PromiseInterface - { - if (null === $onRejected) { - return $this; - } - - $this->handled = true; - - try { - return resolve($onRejected($this->reason)); - } catch (\Throwable $exception) { - return new RejectedPromise($exception); - } - } - - /** - * @template TThrowable of \Throwable - * @template TRejected - * @param callable(TThrowable): (PromiseInterface|TRejected) $onRejected - * @return PromiseInterface - */ - public function catch(callable $onRejected): PromiseInterface - { - if (!_checkTypehint($onRejected, $this->reason)) { - return $this; - } - - /** - * @var callable(\Throwable):(PromiseInterface|TRejected) $onRejected - */ - return $this->then(null, $onRejected); - } - - public function finally(callable $onFulfilledOrRejected): PromiseInterface - { - return $this->then(null, function (\Throwable $reason) use ($onFulfilledOrRejected): PromiseInterface { - return resolve($onFulfilledOrRejected())->then(function () use ($reason): PromiseInterface { - return new RejectedPromise($reason); - }); - }); - } - - public function cancel(): void - { - $this->handled = true; - } - - /** - * @deprecated 3.0.0 Use `catch()` instead - * @see self::catch() - */ - public function otherwise(callable $onRejected): PromiseInterface - { - return $this->catch($onRejected); - } - - /** - * @deprecated 3.0.0 Use `always()` instead - * @see self::always() - */ - public function always(callable $onFulfilledOrRejected): PromiseInterface - { - return $this->finally($onFulfilledOrRejected); - } -} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/Promise.php b/tools/php-cs-fixer/vendor/react/promise/src/Promise.php deleted file mode 100644 index 4ac27007..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/src/Promise.php +++ /dev/null @@ -1,303 +0,0 @@ - - */ -final class Promise implements PromiseInterface -{ - /** @var (callable(callable(T):void,callable(\Throwable):void):void)|null */ - private $canceller; - - /** @var ?PromiseInterface */ - private $result; - - /** @var list):void> */ - private $handlers = []; - - /** @var int */ - private $requiredCancelRequests = 0; - - /** @var bool */ - private $cancelled = false; - - /** - * @param callable(callable(T):void,callable(\Throwable):void):void $resolver - * @param (callable(callable(T):void,callable(\Throwable):void):void)|null $canceller - */ - public function __construct(callable $resolver, ?callable $canceller = null) - { - $this->canceller = $canceller; - - // Explicitly overwrite arguments with null values before invoking - // resolver function. This ensure that these arguments do not show up - // in the stack trace in PHP 7+ only. - $cb = $resolver; - $resolver = $canceller = null; - $this->call($cb); - } - - public function then(?callable $onFulfilled = null, ?callable $onRejected = null): PromiseInterface - { - if (null !== $this->result) { - return $this->result->then($onFulfilled, $onRejected); - } - - if (null === $this->canceller) { - return new static($this->resolver($onFulfilled, $onRejected)); - } - - // This promise has a canceller, so we create a new child promise which - // has a canceller that invokes the parent canceller if all other - // followers are also cancelled. We keep a reference to this promise - // instance for the static canceller function and clear this to avoid - // keeping a cyclic reference between parent and follower. - $parent = $this; - ++$parent->requiredCancelRequests; - - return new static( - $this->resolver($onFulfilled, $onRejected), - static function () use (&$parent): void { - assert($parent instanceof self); - --$parent->requiredCancelRequests; - - if ($parent->requiredCancelRequests <= 0) { - $parent->cancel(); - } - - $parent = null; - } - ); - } - - /** - * @template TThrowable of \Throwable - * @template TRejected - * @param callable(TThrowable): (PromiseInterface|TRejected) $onRejected - * @return PromiseInterface - */ - public function catch(callable $onRejected): PromiseInterface - { - return $this->then(null, static function (\Throwable $reason) use ($onRejected) { - if (!_checkTypehint($onRejected, $reason)) { - return new RejectedPromise($reason); - } - - /** - * @var callable(\Throwable):(PromiseInterface|TRejected) $onRejected - */ - return $onRejected($reason); - }); - } - - public function finally(callable $onFulfilledOrRejected): PromiseInterface - { - return $this->then(static function ($value) use ($onFulfilledOrRejected): PromiseInterface { - return resolve($onFulfilledOrRejected())->then(function () use ($value) { - return $value; - }); - }, static function (\Throwable $reason) use ($onFulfilledOrRejected): PromiseInterface { - return resolve($onFulfilledOrRejected())->then(function () use ($reason): RejectedPromise { - return new RejectedPromise($reason); - }); - }); - } - - public function cancel(): void - { - $this->cancelled = true; - $canceller = $this->canceller; - $this->canceller = null; - - $parentCanceller = null; - - if (null !== $this->result) { - // Forward cancellation to rejected promise to avoid reporting unhandled rejection - if ($this->result instanceof RejectedPromise) { - $this->result->cancel(); - } - - // Go up the promise chain and reach the top most promise which is - // itself not following another promise - $root = $this->unwrap($this->result); - - // Return if the root promise is already resolved or a - // FulfilledPromise or RejectedPromise - if (!$root instanceof self || null !== $root->result) { - return; - } - - $root->requiredCancelRequests--; - - if ($root->requiredCancelRequests <= 0) { - $parentCanceller = [$root, 'cancel']; - } - } - - if (null !== $canceller) { - $this->call($canceller); - } - - // For BC, we call the parent canceller after our own canceller - if ($parentCanceller) { - $parentCanceller(); - } - } - - /** - * @deprecated 3.0.0 Use `catch()` instead - * @see self::catch() - */ - public function otherwise(callable $onRejected): PromiseInterface - { - return $this->catch($onRejected); - } - - /** - * @deprecated 3.0.0 Use `finally()` instead - * @see self::finally() - */ - public function always(callable $onFulfilledOrRejected): PromiseInterface - { - return $this->finally($onFulfilledOrRejected); - } - - private function resolver(?callable $onFulfilled = null, ?callable $onRejected = null): callable - { - return function (callable $resolve, callable $reject) use ($onFulfilled, $onRejected): void { - $this->handlers[] = static function (PromiseInterface $promise) use ($onFulfilled, $onRejected, $resolve, $reject): void { - $promise = $promise->then($onFulfilled, $onRejected); - - if ($promise instanceof self && $promise->result === null) { - $promise->handlers[] = static function (PromiseInterface $promise) use ($resolve, $reject): void { - $promise->then($resolve, $reject); - }; - } else { - $promise->then($resolve, $reject); - } - }; - }; - } - - private function reject(\Throwable $reason): void - { - if (null !== $this->result) { - return; - } - - $this->settle(reject($reason)); - } - - /** - * @param PromiseInterface $result - */ - private function settle(PromiseInterface $result): void - { - $result = $this->unwrap($result); - - if ($result === $this) { - $result = new RejectedPromise( - new \LogicException('Cannot resolve a promise with itself.') - ); - } - - if ($result instanceof self) { - $result->requiredCancelRequests++; - } else { - // Unset canceller only when not following a pending promise - $this->canceller = null; - } - - $handlers = $this->handlers; - - $this->handlers = []; - $this->result = $result; - - foreach ($handlers as $handler) { - $handler($result); - } - - // Forward cancellation to rejected promise to avoid reporting unhandled rejection - if ($this->cancelled && $result instanceof RejectedPromise) { - $result->cancel(); - } - } - - /** - * @param PromiseInterface $promise - * @return PromiseInterface - */ - private function unwrap(PromiseInterface $promise): PromiseInterface - { - while ($promise instanceof self && null !== $promise->result) { - /** @var PromiseInterface $promise */ - $promise = $promise->result; - } - - return $promise; - } - - /** - * @param callable(callable(mixed):void,callable(\Throwable):void):void $cb - */ - private function call(callable $cb): void - { - // Explicitly overwrite argument with null value. This ensure that this - // argument does not show up in the stack trace in PHP 7+ only. - $callback = $cb; - $cb = null; - - // Use reflection to inspect number of arguments expected by this callback. - // We did some careful benchmarking here: Using reflection to avoid unneeded - // function arguments is actually faster than blindly passing them. - // Also, this helps avoiding unnecessary function arguments in the call stack - // if the callback creates an Exception (creating garbage cycles). - if (\is_array($callback)) { - $ref = new \ReflectionMethod($callback[0], $callback[1]); - } elseif (\is_object($callback) && !$callback instanceof \Closure) { - $ref = new \ReflectionMethod($callback, '__invoke'); - } else { - assert($callback instanceof \Closure || \is_string($callback)); - $ref = new \ReflectionFunction($callback); - } - $args = $ref->getNumberOfParameters(); - - try { - if ($args === 0) { - $callback(); - } else { - // Keep references to this promise instance for the static resolve/reject functions. - // By using static callbacks that are not bound to this instance - // and passing the target promise instance by reference, we can - // still execute its resolving logic and still clear this - // reference when settling the promise. This helps avoiding - // garbage cycles if any callback creates an Exception. - // These assumptions are covered by the test suite, so if you ever feel like - // refactoring this, go ahead, any alternative suggestions are welcome! - $target =& $this; - - $callback( - static function ($value) use (&$target): void { - if ($target !== null) { - $target->settle(resolve($value)); - $target = null; - } - }, - static function (\Throwable $reason) use (&$target): void { - if ($target !== null) { - $target->reject($reason); - $target = null; - } - } - ); - } - } catch (\Throwable $e) { - $target = null; - $this->reject($e); - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/PromiseInterface.php b/tools/php-cs-fixer/vendor/react/promise/src/PromiseInterface.php deleted file mode 100644 index 5869f76b..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/src/PromiseInterface.php +++ /dev/null @@ -1,152 +0,0 @@ -|TFulfilled)) $onFulfilled - * @param ?(callable(\Throwable): (PromiseInterface|TRejected)) $onRejected - * @return PromiseInterface<($onRejected is null ? ($onFulfilled is null ? T : TFulfilled) : ($onFulfilled is null ? T|TRejected : TFulfilled|TRejected))> - */ - public function then(?callable $onFulfilled = null, ?callable $onRejected = null): PromiseInterface; - - /** - * Registers a rejection handler for promise. It is a shortcut for: - * - * ```php - * $promise->then(null, $onRejected); - * ``` - * - * Additionally, you can type hint the `$reason` argument of `$onRejected` to catch - * only specific errors. - * - * @template TThrowable of \Throwable - * @template TRejected - * @param callable(TThrowable): (PromiseInterface|TRejected) $onRejected - * @return PromiseInterface - */ - public function catch(callable $onRejected): PromiseInterface; - - /** - * Allows you to execute "cleanup" type tasks in a promise chain. - * - * It arranges for `$onFulfilledOrRejected` to be called, with no arguments, - * when the promise is either fulfilled or rejected. - * - * * If `$promise` fulfills, and `$onFulfilledOrRejected` returns successfully, - * `$newPromise` will fulfill with the same value as `$promise`. - * * If `$promise` fulfills, and `$onFulfilledOrRejected` throws or returns a - * rejected promise, `$newPromise` will reject with the thrown exception or - * rejected promise's reason. - * * If `$promise` rejects, and `$onFulfilledOrRejected` returns successfully, - * `$newPromise` will reject with the same reason as `$promise`. - * * If `$promise` rejects, and `$onFulfilledOrRejected` throws or returns a - * rejected promise, `$newPromise` will reject with the thrown exception or - * rejected promise's reason. - * - * `finally()` behaves similarly to the synchronous finally statement. When combined - * with `catch()`, `finally()` allows you to write code that is similar to the familiar - * synchronous catch/finally pair. - * - * Consider the following synchronous code: - * - * ```php - * try { - * return doSomething(); - * } catch(\Exception $e) { - * return handleError($e); - * } finally { - * cleanup(); - * } - * ``` - * - * Similar asynchronous code (with `doSomething()` that returns a promise) can be - * written: - * - * ```php - * return doSomething() - * ->catch('handleError') - * ->finally('cleanup'); - * ``` - * - * @param callable(): (void|PromiseInterface) $onFulfilledOrRejected - * @return PromiseInterface - */ - public function finally(callable $onFulfilledOrRejected): PromiseInterface; - - /** - * The `cancel()` method notifies the creator of the promise that there is no - * further interest in the results of the operation. - * - * Once a promise is settled (either fulfilled or rejected), calling `cancel()` on - * a promise has no effect. - * - * @return void - */ - public function cancel(): void; - - /** - * [Deprecated] Registers a rejection handler for a promise. - * - * This method continues to exist only for BC reasons and to ease upgrading - * between versions. It is an alias for: - * - * ```php - * $promise->catch($onRejected); - * ``` - * - * @template TThrowable of \Throwable - * @template TRejected - * @param callable(TThrowable): (PromiseInterface|TRejected) $onRejected - * @return PromiseInterface - * @deprecated 3.0.0 Use catch() instead - * @see self::catch() - */ - public function otherwise(callable $onRejected): PromiseInterface; - - /** - * [Deprecated] Allows you to execute "cleanup" type tasks in a promise chain. - * - * This method continues to exist only for BC reasons and to ease upgrading - * between versions. It is an alias for: - * - * ```php - * $promise->finally($onFulfilledOrRejected); - * ``` - * - * @param callable(): (void|PromiseInterface) $onFulfilledOrRejected - * @return PromiseInterface - * @deprecated 3.0.0 Use finally() instead - * @see self::finally() - */ - public function always(callable $onFulfilledOrRejected): PromiseInterface; -} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/functions.php b/tools/php-cs-fixer/vendor/react/promise/src/functions.php deleted file mode 100644 index 2aab877e..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/src/functions.php +++ /dev/null @@ -1,345 +0,0 @@ -|T $promiseOrValue - * @return PromiseInterface - */ -function resolve($promiseOrValue): PromiseInterface -{ - if ($promiseOrValue instanceof PromiseInterface) { - return $promiseOrValue; - } - - if (\is_object($promiseOrValue) && \method_exists($promiseOrValue, 'then')) { - $canceller = null; - - if (\method_exists($promiseOrValue, 'cancel')) { - $canceller = [$promiseOrValue, 'cancel']; - assert(\is_callable($canceller)); - } - - /** @var Promise */ - return new Promise(function (callable $resolve, callable $reject) use ($promiseOrValue): void { - $promiseOrValue->then($resolve, $reject); - }, $canceller); - } - - return new FulfilledPromise($promiseOrValue); -} - -/** - * Creates a rejected promise for the supplied `$reason`. - * - * If `$reason` is a value, it will be the rejection value of the - * returned promise. - * - * If `$reason` is a promise, its completion value will be the rejected - * value of the returned promise. - * - * This can be useful in situations where you need to reject a promise without - * throwing an exception. For example, it allows you to propagate a rejection with - * the value of another promise. - * - * @return PromiseInterface - */ -function reject(\Throwable $reason): PromiseInterface -{ - return new RejectedPromise($reason); -} - -/** - * Returns a promise that will resolve only once all the items in - * `$promisesOrValues` have resolved. The resolution value of the returned promise - * will be an array containing the resolution values of each of the items in - * `$promisesOrValues`. - * - * @template T - * @param iterable|T> $promisesOrValues - * @return PromiseInterface> - */ -function all(iterable $promisesOrValues): PromiseInterface -{ - $cancellationQueue = new Internal\CancellationQueue(); - - /** @var Promise> */ - return new Promise(function (callable $resolve, callable $reject) use ($promisesOrValues, $cancellationQueue): void { - $toResolve = 0; - /** @var bool */ - $continue = true; - $values = []; - - foreach ($promisesOrValues as $i => $promiseOrValue) { - $cancellationQueue->enqueue($promiseOrValue); - $values[$i] = null; - ++$toResolve; - - resolve($promiseOrValue)->then( - function ($value) use ($i, &$values, &$toResolve, &$continue, $resolve): void { - $values[$i] = $value; - - if (0 === --$toResolve && !$continue) { - $resolve($values); - } - }, - function (\Throwable $reason) use (&$continue, $reject): void { - $continue = false; - $reject($reason); - } - ); - - if (!$continue && !\is_array($promisesOrValues)) { - break; - } - } - - $continue = false; - if ($toResolve === 0) { - $resolve($values); - } - }, $cancellationQueue); -} - -/** - * Initiates a competitive race that allows one winner. Returns a promise which is - * resolved in the same way the first settled promise resolves. - * - * The returned promise will become **infinitely pending** if `$promisesOrValues` - * contains 0 items. - * - * @template T - * @param iterable|T> $promisesOrValues - * @return PromiseInterface - */ -function race(iterable $promisesOrValues): PromiseInterface -{ - $cancellationQueue = new Internal\CancellationQueue(); - - /** @var Promise */ - return new Promise(function (callable $resolve, callable $reject) use ($promisesOrValues, $cancellationQueue): void { - $continue = true; - - foreach ($promisesOrValues as $promiseOrValue) { - $cancellationQueue->enqueue($promiseOrValue); - - resolve($promiseOrValue)->then($resolve, $reject)->finally(function () use (&$continue): void { - $continue = false; - }); - - if (!$continue && !\is_array($promisesOrValues)) { - break; - } - } - }, $cancellationQueue); -} - -/** - * Returns a promise that will resolve when any one of the items in - * `$promisesOrValues` resolves. The resolution value of the returned promise - * will be the resolution value of the triggering item. - * - * The returned promise will only reject if *all* items in `$promisesOrValues` are - * rejected. The rejection value will be an array of all rejection reasons. - * - * The returned promise will also reject with a `React\Promise\Exception\LengthException` - * if `$promisesOrValues` contains 0 items. - * - * @template T - * @param iterable|T> $promisesOrValues - * @return PromiseInterface - */ -function any(iterable $promisesOrValues): PromiseInterface -{ - $cancellationQueue = new Internal\CancellationQueue(); - - /** @var Promise */ - return new Promise(function (callable $resolve, callable $reject) use ($promisesOrValues, $cancellationQueue): void { - $toReject = 0; - $continue = true; - $reasons = []; - - foreach ($promisesOrValues as $i => $promiseOrValue) { - $cancellationQueue->enqueue($promiseOrValue); - ++$toReject; - - resolve($promiseOrValue)->then( - function ($value) use ($resolve, &$continue): void { - $continue = false; - $resolve($value); - }, - function (\Throwable $reason) use ($i, &$reasons, &$toReject, $reject, &$continue): void { - $reasons[$i] = $reason; - - if (0 === --$toReject && !$continue) { - $reject(new CompositeException( - $reasons, - 'All promises rejected.' - )); - } - } - ); - - if (!$continue && !\is_array($promisesOrValues)) { - break; - } - } - - $continue = false; - if ($toReject === 0 && !$reasons) { - $reject(new Exception\LengthException( - 'Must contain at least 1 item but contains only 0 items.' - )); - } elseif ($toReject === 0) { - $reject(new CompositeException( - $reasons, - 'All promises rejected.' - )); - } - }, $cancellationQueue); -} - -/** - * Sets the global rejection handler for unhandled promise rejections. - * - * Note that rejected promises should always be handled similar to how any - * exceptions should always be caught in a `try` + `catch` block. If you remove - * the last reference to a rejected promise that has not been handled, it will - * report an unhandled promise rejection. See also the [`reject()` function](#reject) - * for more details. - * - * The `?callable $callback` argument MUST be a valid callback function that - * accepts a single `Throwable` argument or a `null` value to restore the - * default promise rejection handler. The return value of the callback function - * will be ignored and has no effect, so you SHOULD return a `void` value. The - * callback function MUST NOT throw or the program will be terminated with a - * fatal error. - * - * The function returns the previous rejection handler or `null` if using the - * default promise rejection handler. - * - * The default promise rejection handler will log an error message plus its - * stack trace: - * - * ```php - * // Unhandled promise rejection with RuntimeException: Unhandled in example.php:2 - * React\Promise\reject(new RuntimeException('Unhandled')); - * ``` - * - * The promise rejection handler may be used to use customize the log message or - * write to custom log targets. As a rule of thumb, this function should only be - * used as a last resort and promise rejections are best handled with either the - * [`then()` method](#promiseinterfacethen), the - * [`catch()` method](#promiseinterfacecatch), or the - * [`finally()` method](#promiseinterfacefinally). - * See also the [`reject()` function](#reject) for more details. - * - * @param callable(\Throwable):void|null $callback - * @return callable(\Throwable):void|null - */ -function set_rejection_handler(?callable $callback): ?callable -{ - static $current = null; - $previous = $current; - $current = $callback; - - return $previous; -} - -/** - * @internal - */ -function _checkTypehint(callable $callback, \Throwable $reason): bool -{ - if (\is_array($callback)) { - $callbackReflection = new \ReflectionMethod($callback[0], $callback[1]); - } elseif (\is_object($callback) && !$callback instanceof \Closure) { - $callbackReflection = new \ReflectionMethod($callback, '__invoke'); - } else { - assert($callback instanceof \Closure || \is_string($callback)); - $callbackReflection = new \ReflectionFunction($callback); - } - - $parameters = $callbackReflection->getParameters(); - - if (!isset($parameters[0])) { - return true; - } - - $expectedException = $parameters[0]; - - // Extract the type of the argument and handle different possibilities - $type = $expectedException->getType(); - - $isTypeUnion = true; - $types = []; - - switch (true) { - case $type === null: - break; - case $type instanceof \ReflectionNamedType: - $types = [$type]; - break; - case $type instanceof \ReflectionIntersectionType: - $isTypeUnion = false; - case $type instanceof \ReflectionUnionType; - $types = $type->getTypes(); - break; - default: - throw new \LogicException('Unexpected return value of ReflectionParameter::getType'); - } - - // If there is no type restriction, it matches - if (empty($types)) { - return true; - } - - foreach ($types as $type) { - - if ($type instanceof \ReflectionIntersectionType) { - foreach ($type->getTypes() as $typeToMatch) { - assert($typeToMatch instanceof \ReflectionNamedType); - $name = $typeToMatch->getName(); - if (!($matches = (!$typeToMatch->isBuiltin() && $reason instanceof $name))) { - break; - } - } - assert(isset($matches)); - } else { - assert($type instanceof \ReflectionNamedType); - $name = $type->getName(); - $matches = !$type->isBuiltin() && $reason instanceof $name; - } - - // If we look for a single match (union), we can return early on match - // If we look for a full match (intersection), we can return early on mismatch - if ($matches) { - if ($isTypeUnion) { - return true; - } - } else { - if (!$isTypeUnion) { - return false; - } - } - } - - // If we look for a single match (union) and did not return early, we matched no type and are false - // If we look for a full match (intersection) and did not return early, we matched all types and are true - return $isTypeUnion ? false : true; -} diff --git a/tools/php-cs-fixer/vendor/react/promise/src/functions_include.php b/tools/php-cs-fixer/vendor/react/promise/src/functions_include.php deleted file mode 100644 index bd0c54fd..00000000 --- a/tools/php-cs-fixer/vendor/react/promise/src/functions_include.php +++ /dev/null @@ -1,5 +0,0 @@ -connect($uri)->then(function (React\Socket\ConnectionInterface $conn) { - // … - }, function (Exception $e) { - echo 'Error:' . $e->getMessage() . PHP_EOL; - }); - ``` - -* Improve test suite, test against PHP 8.1 release. - (#274 by @SimonFrings) - -## 1.9.0 (2021-08-03) - -* Feature: Add new `SocketServer` and deprecate `Server` to avoid class name collisions. - (#263 by @clue) - - The new `SocketServer` class has been added with an improved constructor signature - as a replacement for the previous `Server` class in order to avoid any ambiguities. - The previous name has been deprecated and should not be used anymore. - In its most basic form, the deprecated `Server` can now be considered an alias for new `SocketServer`. - - ```php - // deprecated - $socket = new React\Socket\Server(0); - $socket = new React\Socket\Server('127.0.0.1:8000'); - $socket = new React\Socket\Server('127.0.0.1:8000', null, $context); - $socket = new React\Socket\Server('127.0.0.1:8000', $loop, $context); - - // new - $socket = new React\Socket\SocketServer('127.0.0.1:0'); - $socket = new React\Socket\SocketServer('127.0.0.1:8000'); - $socket = new React\Socket\SocketServer('127.0.0.1:8000', $context); - $socket = new React\Socket\SocketServer('127.0.0.1:8000', $context, $loop); - ``` - -* Feature: Update `Connector` signature to take optional `$context` as first argument. - (#264 by @clue) - - The new signature has been added to match the new `SocketServer` and - consistently move the now commonly unneeded loop argument to the last argument. - The previous signature has been deprecated and should not be used anymore. - In its most basic form, both signatures are compatible. - - ```php - // deprecated - $connector = new React\Socket\Connector(null, $context); - $connector = new React\Socket\Connector($loop, $context); - - // new - $connector = new React\Socket\Connector($context); - $connector = new React\Socket\Connector($context, $loop); - ``` - -## 1.8.0 (2021-07-11) - -A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). - -* Feature: Simplify usage by supporting new [default loop](https://reactphp.org/event-loop/#loop). - (#260 by @clue) - - ```php - // old (still supported) - $socket = new React\Socket\Server('127.0.0.1:8080', $loop); - $connector = new React\Socket\Connector($loop); - - // new (using default loop) - $socket = new React\Socket\Server('127.0.0.1:8080'); - $connector = new React\Socket\Connector(); - ``` - -## 1.7.0 (2021-06-25) - -* Feature: Support falling back to multiple DNS servers from DNS config. - (#257 by @clue) - - If you're using the default `Connector`, it will now use all DNS servers - configured on your system. If you have multiple DNS servers configured and - connectivity to the primary DNS server is broken, it will now fall back to - your other DNS servers, thus providing improved connectivity and redundancy - for broken DNS configurations. - -* Feature: Use round robin for happy eyeballs DNS responses (load balancing). - (#247 by @clue) - - If you're using the default `Connector`, it will now randomize the order of - the IP addresses resolved via DNS when connecting. This allows the load to - be distributed more evenly across all returned IP addresses. This can be - used as a very basic DNS load balancing mechanism. - -* Internal improvement to avoid unhandled rejection for future Promise API. - (#258 by @clue) - -* Improve test suite, use GitHub actions for continuous integration (CI). - (#254 by @SimonFrings) - -## 1.6.0 (2020-08-28) - -* Feature: Support upcoming PHP 8 release. - (#246 by @clue) - -* Feature: Change default socket backlog size to 511. - (#242 by @clue) - -* Fix: Fix closing connection when cancelling during TLS handshake. - (#241 by @clue) - -* Fix: Fix blocking during possible `accept()` race condition - when multiple socket servers listen on same socket address. - (#244 by @clue) - -* Improve test suite, update PHPUnit config and add full core team to the license. - (#243 by @SimonFrings and #245 by @WyriHaximus) - -## 1.5.0 (2020-07-01) - -* Feature / Fix: Improve error handling and reporting for happy eyeballs and - immediately try next connection when one connection attempt fails. - (#230, #231, #232 and #233 by @clue) - - Error messages for failed connection attempts now include more details to - ease debugging. Additionally, the happy eyeballs algorithm has been improved - to avoid having to wait for some timers to expire which significantly - improves connection setup times (in particular when IPv6 isn't available). - -* Improve test suite, minor code cleanup and improve code coverage to 100%. - Update to PHPUnit 9 and skip legacy TLS 1.0 / TLS 1.1 tests if disabled by - system. Run tests on Windows and simplify Travis CI test matrix for Mac OS X - setup and skip all TLS tests on legacy HHVM. - (#229, #235, #236 and #238 by @clue and #239 by @SimonFrings) - -## 1.4.0 (2020-03-12) - -A major new feature release, see [**release announcement**](https://clue.engineering/2020/introducing-ipv6-for-reactphp). - -* Feature: Add IPv6 support to `Connector` (implement "Happy Eyeballs" algorithm to support IPv6 probing). - IPv6 support is turned on by default, use new `happy_eyeballs` option in `Connector` to toggle behavior. - (#196, #224 and #225 by @WyriHaximus and @clue) - -* Feature: Default to using DNS cache (with max 256 entries) for `Connector`. - (#226 by @clue) - -* Add `.gitattributes` to exclude dev files from exports and some minor code style fixes. - (#219 by @reedy and #218 by @mmoreram) - -* Improve test suite to fix failing test cases when using new DNS component, - significantly improve test performance by awaiting events instead of sleeping, - exclude TLS 1.3 test on PHP 7.3, run tests on PHP 7.4 and simplify test matrix. - (#208, #209, #210, #217 and #223 by @clue) - -## 1.3.0 (2019-07-10) - -* Feature: Forward compatibility with upcoming stable DNS component. - (#206 by @clue) - -## 1.2.1 (2019-06-03) - -* Avoid uneeded fragmented TLS work around for PHP 7.3.3+ and - work around failing test case detecting EOF on TLS 1.3 socket streams. - (#201 and #202 by @clue) - -* Improve TLS certificate/passphrase example. - (#190 by @jsor) - -## 1.2.0 (2019-01-07) - -* Feature / Fix: Improve TLS 1.3 support. - (#186 by @clue) - - TLS 1.3 is now an official standard as of August 2018! :tada: - The protocol has major improvements in the areas of security, performance, and privacy. - TLS 1.3 is supported by default as of [OpenSSL 1.1.1](https://www.openssl.org/blog/blog/2018/09/11/release111/). - For example, this version ships with Ubuntu 18.10 (and newer) by default, meaning that recent installations support TLS 1.3 out of the box :shipit: - -* Fix: Avoid possibility of missing remote address when TLS handshake fails. - (#188 by @clue) - -* Improve performance by prefixing all global functions calls with `\` to skip the look up and resolve process and go straight to the global function. - (#183 by @WyriHaximus) - -* Update documentation to use full class names with namespaces. - (#187 by @clue) - -* Improve test suite to avoid some possible race conditions, - test against PHP 7.3 on Travis and - use dedicated `assertInstanceOf()` assertions. - (#185 by @clue, #178 by @WyriHaximus and #181 by @carusogabriel) - -## 1.1.0 (2018-10-01) - -* Feature: Improve error reporting for failed connection attempts and improve - cancellation forwarding during DNS lookup, TCP/IP connection or TLS handshake. - (#168, #169, #170, #171, #176 and #177 by @clue) - - All error messages now always contain a reference to the remote URI to give - more details which connection actually failed and the reason for this error. - Accordingly, failures during DNS lookup will now mention both the remote URI - as well as the DNS error reason. TCP/IP connection issues and errors during - a secure TLS handshake will both mention the remote URI as well as the - underlying socket error. Similarly, lost/dropped connections during a TLS - handshake will now report a lost connection instead of an empty error reason. - - For most common use cases this means that simply reporting the `Exception` - message should give the most relevant details for any connection issues: - - ```php - $promise = $connector->connect('tls://example.com:443'); - $promise->then(function (ConnectionInterface $conn) use ($loop) { - // … - }, function (Exception $e) { - echo $e->getMessage(); - }); - ``` - -## 1.0.0 (2018-07-11) - -* First stable LTS release, now following [SemVer](https://semver.org/). - We'd like to emphasize that this component is production ready and battle-tested. - We plan to support all long-term support (LTS) releases for at least 24 months, - so you have a rock-solid foundation to build on top of. - -> Contains no other changes, so it's actually fully compatible with the v0.8.12 release. - -## 0.8.12 (2018-06-11) - -* Feature: Improve memory consumption for failed and cancelled connection attempts. - (#161 by @clue) - -* Improve test suite to fix Travis config to test against legacy PHP 5.3 again. - (#162 by @clue) - -## 0.8.11 (2018-04-24) - -* Feature: Improve memory consumption for cancelled connection attempts and - simplify skipping DNS lookup when connecting to IP addresses. - (#159 and #160 by @clue) - -## 0.8.10 (2018-02-28) - -* Feature: Update DNS dependency to support loading system default DNS - nameserver config on all supported platforms - (`/etc/resolv.conf` on Unix/Linux/Mac/Docker/WSL and WMIC on Windows) - (#152 by @clue) - - This means that connecting to hosts that are managed by a local DNS server, - such as a corporate DNS server or when using Docker containers, will now - work as expected across all platforms with no changes required: - - ```php - $connector = new Connector($loop); - $connector->connect('intranet.example:80')->then(function ($connection) { - // … - }); - ``` - -## 0.8.9 (2018-01-18) - -* Feature: Support explicitly choosing TLS version to negotiate with remote side - by respecting `crypto_method` context parameter for all classes. - (#149 by @clue) - - By default, all connector and server classes support TLSv1.0+ and exclude - support for legacy SSLv2/SSLv3. As of PHP 5.6+ you can also explicitly - choose the TLS version you want to negotiate with the remote side: - - ```php - // new: now supports 'crypto_method` context parameter for all classes - $connector = new Connector($loop, array( - 'tls' => array( - 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT - ) - )); - ``` - -* Minor internal clean up to unify class imports - (#148 by @clue) - -## 0.8.8 (2018-01-06) - -* Improve test suite by adding test group to skip integration tests relying on - internet connection and fix minor documentation typo. - (#146 by @clue and #145 by @cn007b) - -## 0.8.7 (2017-12-24) - -* Fix: Fix closing socket resource before removing from loop - (#141 by @clue) - - This fixes the root cause of an uncaught `Exception` that only manifested - itself after the recent Stream v0.7.4 component update and only if you're - using `ext-event` (`ExtEventLoop`). - -* Improve test suite by testing against PHP 7.2 - (#140 by @carusogabriel) - -## 0.8.6 (2017-11-18) - -* Feature: Add Unix domain socket (UDS) support to `Server` with `unix://` URI scheme - and add advanced `UnixServer` class. - (#120 by @andig) - - ```php - // new: Server now supports "unix://" scheme - $server = new Server('unix:///tmp/server.sock', $loop); - - // new: advanced usage - $server = new UnixServer('/tmp/server.sock', $loop); - ``` - -* Restructure examples to ease getting started - (#136 by @clue) - -* Improve test suite by adding forward compatibility with PHPUnit 6 and - ignore Mac OS X test failures for now until Travis tests work again - (#133 by @gabriel-caruso and #134 by @clue) - -## 0.8.5 (2017-10-23) - -* Fix: Work around PHP bug with Unix domain socket (UDS) paths for Mac OS X - (#123 by @andig) - -* Fix: Fix `SecureServer` to return `null` URI if server socket is already closed - (#129 by @clue) - -* Improve test suite by adding forward compatibility with PHPUnit v5 and - forward compatibility with upcoming EventLoop releases in tests and - test Mac OS X on Travis - (#122 by @andig and #125, #127 and #130 by @clue) - -* Readme improvements - (#118 by @jsor) - -## 0.8.4 (2017-09-16) - -* Feature: Add `FixedUriConnector` decorator to use fixed, preconfigured URI instead - (#117 by @clue) - - This can be useful for consumers that do not support certain URIs, such as - when you want to explicitly connect to a Unix domain socket (UDS) path - instead of connecting to a default address assumed by an higher-level API: - - ```php - $connector = new FixedUriConnector( - 'unix:///var/run/docker.sock', - new UnixConnector($loop) - ); - - // destination will be ignored, actually connects to Unix domain socket - $promise = $connector->connect('localhost:80'); - ``` - -## 0.8.3 (2017-09-08) - -* Feature: Reduce memory consumption for failed connections - (#113 by @valga) - -* Fix: Work around write chunk size for TLS streams for PHP < 7.1.14 - (#114 by @clue) - -## 0.8.2 (2017-08-25) - -* Feature: Update DNS dependency to support hosts file on all platforms - (#112 by @clue) - - This means that connecting to hosts such as `localhost` will now work as - expected across all platforms with no changes required: - - ```php - $connector = new Connector($loop); - $connector->connect('localhost:8080')->then(function ($connection) { - // … - }); - ``` - -## 0.8.1 (2017-08-15) - -* Feature: Forward compatibility with upcoming EventLoop v1.0 and v0.5 and - target evenement 3.0 a long side 2.0 and 1.0 - (#104 by @clue and #111 by @WyriHaximus) - -* Improve test suite by locking Travis distro so new defaults will not break the build and - fix HHVM build for now again and ignore future HHVM build errors - (#109 and #110 by @clue) - -* Minor documentation fixes - (#103 by @christiaan and #108 by @hansott) - -## 0.8.0 (2017-05-09) - -* Feature: New `Server` class now acts as a facade for existing server classes - and renamed old `Server` to `TcpServer` for advanced usage. - (#96 and #97 by @clue) - - The `Server` class is now the main class in this package that implements the - `ServerInterface` and allows you to accept incoming streaming connections, - such as plaintext TCP/IP or secure TLS connection streams. - - > This is not a BC break and consumer code does not have to be updated. - -* Feature / BC break: All addresses are now URIs that include the URI scheme - (#98 by @clue) - - ```diff - - $parts = parse_url('tcp://' . $conn->getRemoteAddress()); - + $parts = parse_url($conn->getRemoteAddress()); - ``` - -* Fix: Fix `unix://` addresses for Unix domain socket (UDS) paths - (#100 by @clue) - -* Feature: Forward compatibility with Stream v1.0 and v0.7 - (#99 by @clue) - -## 0.7.2 (2017-04-24) - -* Fix: Work around latest PHP 7.0.18 and 7.1.4 no longer accepting full URIs - (#94 by @clue) - -## 0.7.1 (2017-04-10) - -* Fix: Ignore HHVM errors when closing connection that is already closing - (#91 by @clue) - -## 0.7.0 (2017-04-10) - -* Feature: Merge SocketClient component into this component - (#87 by @clue) - - This means that this package now provides async, streaming plaintext TCP/IP - and secure TLS socket server and client connections for ReactPHP. - - ``` - $connector = new React\Socket\Connector($loop); - $connector->connect('google.com:80')->then(function (ConnectionInterface $conn) { - $connection->write('…'); - }); - ``` - - Accordingly, the `ConnectionInterface` is now used to represent both incoming - server side connections as well as outgoing client side connections. - - If you've previously used the SocketClient component to establish outgoing - client connections, upgrading should take no longer than a few minutes. - All classes have been merged as-is from the latest `v0.7.0` release with no - other changes, so you can simply update your code to use the updated namespace - like this: - - ```php - // old from SocketClient component and namespace - $connector = new React\SocketClient\Connector($loop); - $connector->connect('google.com:80')->then(function (ConnectionInterface $conn) { - $connection->write('…'); - }); - - // new - $connector = new React\Socket\Connector($loop); - $connector->connect('google.com:80')->then(function (ConnectionInterface $conn) { - $connection->write('…'); - }); - ``` - -## 0.6.0 (2017-04-04) - -* Feature: Add `LimitingServer` to limit and keep track of open connections - (#86 by @clue) - - ```php - $server = new Server(0, $loop); - $server = new LimitingServer($server, 100); - - $server->on('connection', function (ConnectionInterface $connection) { - $connection->write('hello there!' . PHP_EOL); - … - }); - ``` - -* Feature / BC break: Add `pause()` and `resume()` methods to limit active - connections - (#84 by @clue) - - ```php - $server = new Server(0, $loop); - $server->pause(); - - $loop->addTimer(1.0, function() use ($server) { - $server->resume(); - }); - ``` - -## 0.5.1 (2017-03-09) - -* Feature: Forward compatibility with Stream v0.5 and upcoming v0.6 - (#79 by @clue) - -## 0.5.0 (2017-02-14) - -* Feature / BC break: Replace `listen()` call with URIs passed to constructor - and reject listening on hostnames with `InvalidArgumentException` - and replace `ConnectionException` with `RuntimeException` for consistency - (#61, #66 and #72 by @clue) - - ```php - // old - $server = new Server($loop); - $server->listen(8080); - - // new - $server = new Server(8080, $loop); - ``` - - Similarly, you can now pass a full listening URI to the constructor to change - the listening host: - - ```php - // old - $server = new Server($loop); - $server->listen(8080, '127.0.0.1'); - - // new - $server = new Server('127.0.0.1:8080', $loop); - ``` - - Trying to start listening on (DNS) host names will now throw an - `InvalidArgumentException`, use IP addresses instead: - - ```php - // old - $server = new Server($loop); - $server->listen(8080, 'localhost'); - - // new - $server = new Server('127.0.0.1:8080', $loop); - ``` - - If trying to listen fails (such as if port is already in use or port below - 1024 may require root access etc.), it will now throw a `RuntimeException`, - the `ConnectionException` class has been removed: - - ```php - // old: throws React\Socket\ConnectionException - $server = new Server($loop); - $server->listen(80); - - // new: throws RuntimeException - $server = new Server(80, $loop); - ``` - -* Feature / BC break: Rename `shutdown()` to `close()` for consistency throughout React - (#62 by @clue) - - ```php - // old - $server->shutdown(); - - // new - $server->close(); - ``` - -* Feature / BC break: Replace `getPort()` with `getAddress()` - (#67 by @clue) - - ```php - // old - echo $server->getPort(); // 8080 - - // new - echo $server->getAddress(); // 127.0.0.1:8080 - ``` - -* Feature / BC break: `getRemoteAddress()` returns full address instead of only IP - (#65 by @clue) - - ```php - // old - echo $connection->getRemoteAddress(); // 192.168.0.1 - - // new - echo $connection->getRemoteAddress(); // 192.168.0.1:51743 - ``` - -* Feature / BC break: Add `getLocalAddress()` method - (#68 by @clue) - - ```php - echo $connection->getLocalAddress(); // 127.0.0.1:8080 - ``` - -* BC break: The `Server` and `SecureServer` class are now marked `final` - and you can no longer `extend` them - (which was never documented or recommended anyway). - Public properties and event handlers are now internal only. - Please use composition instead of extension. - (#71, #70 and #69 by @clue) - -## 0.4.6 (2017-01-26) - -* Feature: Support socket context options passed to `Server` - (#64 by @clue) - -* Fix: Properly return `null` for unknown addresses - (#63 by @clue) - -* Improve documentation for `ServerInterface` and lock test suite requirements - (#60 by @clue, #57 by @shaunbramley) - -## 0.4.5 (2017-01-08) - -* Feature: Add `SecureServer` for secure TLS connections - (#55 by @clue) - -* Add functional integration tests - (#54 by @clue) - -## 0.4.4 (2016-12-19) - -* Feature / Fix: `ConnectionInterface` should extend `DuplexStreamInterface` + documentation - (#50 by @clue) - -* Feature / Fix: Improve test suite and switch to normal stream handler - (#51 by @clue) - -* Feature: Add examples - (#49 by @clue) - -## 0.4.3 (2016-03-01) - -* Bug fix: Suppress errors on stream_socket_accept to prevent PHP from crashing -* Support for PHP7 and HHVM -* Support PHP 5.3 again - -## 0.4.2 (2014-05-25) - -* Verify stream is a valid resource in Connection - -## 0.4.1 (2014-04-13) - -* Bug fix: Check read buffer for data before shutdown signal and end emit (@ArtyDev) -* Bug fix: v0.3.4 changes merged for v0.4.1 - -## 0.3.4 (2014-03-30) - -* Bug fix: Reset socket to non-blocking after shutting down (PHP bug) - -## 0.4.0 (2014-02-02) - -* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks -* BC break: Update to React/Promise 2.0 -* BC break: Update to Evenement 2.0 -* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0 -* Bump React dependencies to v0.4 - -## 0.3.3 (2013-07-08) - -* Version bump - -## 0.3.2 (2013-05-10) - -* Version bump - -## 0.3.1 (2013-04-21) - -* Feature: Support binding to IPv6 addresses (@clue) - -## 0.3.0 (2013-04-14) - -* Bump React dependencies to v0.3 - -## 0.2.6 (2012-12-26) - -* Version bump - -## 0.2.3 (2012-11-14) - -* Version bump - -## 0.2.0 (2012-09-10) - -* Bump React dependencies to v0.2 - -## 0.1.1 (2012-07-12) - -* Version bump - -## 0.1.0 (2012-07-11) - -* First tagged release diff --git a/tools/php-cs-fixer/vendor/react/socket/LICENSE b/tools/php-cs-fixer/vendor/react/socket/LICENSE deleted file mode 100644 index d6f8901f..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/socket/README.md b/tools/php-cs-fixer/vendor/react/socket/README.md deleted file mode 100644 index e77e6764..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/README.md +++ /dev/null @@ -1,1564 +0,0 @@ -# Socket - -[![CI status](https://github.com/reactphp/socket/workflows/CI/badge.svg)](https://github.com/reactphp/socket/actions) -[![installs on Packagist](https://img.shields.io/packagist/dt/react/socket?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/socket) - -Async, streaming plaintext TCP/IP and secure TLS socket server and client -connections for [ReactPHP](https://reactphp.org/). - -The socket library provides re-usable interfaces for a socket-layer -server and client based on the [`EventLoop`](https://github.com/reactphp/event-loop) -and [`Stream`](https://github.com/reactphp/stream) components. -Its server component allows you to build networking servers that accept incoming -connections from networking clients (such as an HTTP server). -Its client component allows you to build networking clients that establish -outgoing connections to networking servers (such as an HTTP or database client). -This library provides async, streaming means for all of this, so you can -handle multiple concurrent connections without blocking. - -**Table of Contents** - -* [Quickstart example](#quickstart-example) -* [Connection usage](#connection-usage) - * [ConnectionInterface](#connectioninterface) - * [getRemoteAddress()](#getremoteaddress) - * [getLocalAddress()](#getlocaladdress) -* [Server usage](#server-usage) - * [ServerInterface](#serverinterface) - * [connection event](#connection-event) - * [error event](#error-event) - * [getAddress()](#getaddress) - * [pause()](#pause) - * [resume()](#resume) - * [close()](#close) - * [SocketServer](#socketserver) - * [Advanced server usage](#advanced-server-usage) - * [TcpServer](#tcpserver) - * [SecureServer](#secureserver) - * [UnixServer](#unixserver) - * [LimitingServer](#limitingserver) - * [getConnections()](#getconnections) -* [Client usage](#client-usage) - * [ConnectorInterface](#connectorinterface) - * [connect()](#connect) - * [Connector](#connector) - * [Advanced client usage](#advanced-client-usage) - * [TcpConnector](#tcpconnector) - * [HappyEyeBallsConnector](#happyeyeballsconnector) - * [DnsConnector](#dnsconnector) - * [SecureConnector](#secureconnector) - * [TimeoutConnector](#timeoutconnector) - * [UnixConnector](#unixconnector) - * [FixUriConnector](#fixeduriconnector) -* [Install](#install) -* [Tests](#tests) -* [License](#license) - -## Quickstart example - -Here is a server that closes the connection if you send it anything: - -```php -$socket = new React\Socket\SocketServer('127.0.0.1:8080'); - -$socket->on('connection', function (React\Socket\ConnectionInterface $connection) { - $connection->write("Hello " . $connection->getRemoteAddress() . "!\n"); - $connection->write("Welcome to this amazing server!\n"); - $connection->write("Here's a tip: don't say anything.\n"); - - $connection->on('data', function ($data) use ($connection) { - $connection->close(); - }); -}); -``` - -See also the [examples](examples). - -Here's a client that outputs the output of said server and then attempts to -send it a string: - -```php -$connector = new React\Socket\Connector(); - -$connector->connect('127.0.0.1:8080')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->pipe(new React\Stream\WritableResourceStream(STDOUT)); - $connection->write("Hello World!\n"); -}, function (Exception $e) { - echo 'Error: ' . $e->getMessage() . PHP_EOL; -}); -``` - -## Connection usage - -### ConnectionInterface - -The `ConnectionInterface` is used to represent any incoming and outgoing -connection, such as a normal TCP/IP connection. - -An incoming or outgoing connection is a duplex stream (both readable and -writable) that implements React's -[`DuplexStreamInterface`](https://github.com/reactphp/stream#duplexstreaminterface). -It contains additional properties for the local and remote address (client IP) -where this connection has been established to/from. - -Most commonly, instances implementing this `ConnectionInterface` are emitted -by all classes implementing the [`ServerInterface`](#serverinterface) and -used by all classes implementing the [`ConnectorInterface`](#connectorinterface). - -Because the `ConnectionInterface` implements the underlying -[`DuplexStreamInterface`](https://github.com/reactphp/stream#duplexstreaminterface) -you can use any of its events and methods as usual: - -```php -$connection->on('data', function ($chunk) { - echo $chunk; -}); - -$connection->on('end', function () { - echo 'ended'; -}); - -$connection->on('error', function (Exception $e) { - echo 'error: ' . $e->getMessage(); -}); - -$connection->on('close', function () { - echo 'closed'; -}); - -$connection->write($data); -$connection->end($data = null); -$connection->close(); -// … -``` - -For more details, see the -[`DuplexStreamInterface`](https://github.com/reactphp/stream#duplexstreaminterface). - -#### getRemoteAddress() - -The `getRemoteAddress(): ?string` method returns the full remote address -(URI) where this connection has been established with. - -```php -$address = $connection->getRemoteAddress(); -echo 'Connection with ' . $address . PHP_EOL; -``` - -If the remote address can not be determined or is unknown at this time (such as -after the connection has been closed), it MAY return a `NULL` value instead. - -Otherwise, it will return the full address (URI) as a string value, such -as `tcp://127.0.0.1:8080`, `tcp://[::1]:80`, `tls://127.0.0.1:443`, -`unix://example.sock` or `unix:///path/to/example.sock`. -Note that individual URI components are application specific and depend -on the underlying transport protocol. - -If this is a TCP/IP based connection and you only want the remote IP, you may -use something like this: - -```php -$address = $connection->getRemoteAddress(); -$ip = trim(parse_url($address, PHP_URL_HOST), '[]'); -echo 'Connection with ' . $ip . PHP_EOL; -``` - -#### getLocalAddress() - -The `getLocalAddress(): ?string` method returns the full local address -(URI) where this connection has been established with. - -```php -$address = $connection->getLocalAddress(); -echo 'Connection with ' . $address . PHP_EOL; -``` - -If the local address can not be determined or is unknown at this time (such as -after the connection has been closed), it MAY return a `NULL` value instead. - -Otherwise, it will return the full address (URI) as a string value, such -as `tcp://127.0.0.1:8080`, `tcp://[::1]:80`, `tls://127.0.0.1:443`, -`unix://example.sock` or `unix:///path/to/example.sock`. -Note that individual URI components are application specific and depend -on the underlying transport protocol. - -This method complements the [`getRemoteAddress()`](#getremoteaddress) method, -so they should not be confused. - -If your `TcpServer` instance is listening on multiple interfaces (e.g. using -the address `0.0.0.0`), you can use this method to find out which interface -actually accepted this connection (such as a public or local interface). - -If your system has multiple interfaces (e.g. a WAN and a LAN interface), -you can use this method to find out which interface was actually -used for this connection. - -## Server usage - -### ServerInterface - -The `ServerInterface` is responsible for providing an interface for accepting -incoming streaming connections, such as a normal TCP/IP connection. - -Most higher-level components (such as a HTTP server) accept an instance -implementing this interface to accept incoming streaming connections. -This is usually done via dependency injection, so it's fairly simple to actually -swap this implementation against any other implementation of this interface. -This means that you SHOULD typehint against this interface instead of a concrete -implementation of this interface. - -Besides defining a few methods, this interface also implements the -[`EventEmitterInterface`](https://github.com/igorw/evenement) -which allows you to react to certain events. - -#### connection event - -The `connection` event will be emitted whenever a new connection has been -established, i.e. a new client connects to this server socket: - -```php -$socket->on('connection', function (React\Socket\ConnectionInterface $connection) { - echo 'new connection' . PHP_EOL; -}); -``` - -See also the [`ConnectionInterface`](#connectioninterface) for more details -about handling the incoming connection. - -#### error event - -The `error` event will be emitted whenever there's an error accepting a new -connection from a client. - -```php -$socket->on('error', function (Exception $e) { - echo 'error: ' . $e->getMessage() . PHP_EOL; -}); -``` - -Note that this is not a fatal error event, i.e. the server keeps listening for -new connections even after this event. - -#### getAddress() - -The `getAddress(): ?string` method can be used to -return the full address (URI) this server is currently listening on. - -```php -$address = $socket->getAddress(); -echo 'Server listening on ' . $address . PHP_EOL; -``` - -If the address can not be determined or is unknown at this time (such as -after the socket has been closed), it MAY return a `NULL` value instead. - -Otherwise, it will return the full address (URI) as a string value, such -as `tcp://127.0.0.1:8080`, `tcp://[::1]:80`, `tls://127.0.0.1:443` -`unix://example.sock` or `unix:///path/to/example.sock`. -Note that individual URI components are application specific and depend -on the underlying transport protocol. - -If this is a TCP/IP based server and you only want the local port, you may -use something like this: - -```php -$address = $socket->getAddress(); -$port = parse_url($address, PHP_URL_PORT); -echo 'Server listening on port ' . $port . PHP_EOL; -``` - -#### pause() - -The `pause(): void` method can be used to -pause accepting new incoming connections. - -Removes the socket resource from the EventLoop and thus stop accepting -new connections. Note that the listening socket stays active and is not -closed. - -This means that new incoming connections will stay pending in the -operating system backlog until its configurable backlog is filled. -Once the backlog is filled, the operating system may reject further -incoming connections until the backlog is drained again by resuming -to accept new connections. - -Once the server is paused, no futher `connection` events SHOULD -be emitted. - -```php -$socket->pause(); - -$socket->on('connection', assertShouldNeverCalled()); -``` - -This method is advisory-only, though generally not recommended, the -server MAY continue emitting `connection` events. - -Unless otherwise noted, a successfully opened server SHOULD NOT start -in paused state. - -You can continue processing events by calling `resume()` again. - -Note that both methods can be called any number of times, in particular -calling `pause()` more than once SHOULD NOT have any effect. -Similarly, calling this after `close()` is a NO-OP. - -#### resume() - -The `resume(): void` method can be used to -resume accepting new incoming connections. - -Re-attach the socket resource to the EventLoop after a previous `pause()`. - -```php -$socket->pause(); - -Loop::addTimer(1.0, function () use ($socket) { - $socket->resume(); -}); -``` - -Note that both methods can be called any number of times, in particular -calling `resume()` without a prior `pause()` SHOULD NOT have any effect. -Similarly, calling this after `close()` is a NO-OP. - -#### close() - -The `close(): void` method can be used to -shut down this listening socket. - -This will stop listening for new incoming connections on this socket. - -```php -echo 'Shutting down server socket' . PHP_EOL; -$socket->close(); -``` - -Calling this method more than once on the same instance is a NO-OP. - -### SocketServer - - - -The `SocketServer` class is the main class in this package that implements the -[`ServerInterface`](#serverinterface) and allows you to accept incoming -streaming connections, such as plaintext TCP/IP or secure TLS connection streams. - -In order to accept plaintext TCP/IP connections, you can simply pass a host -and port combination like this: - -```php -$socket = new React\Socket\SocketServer('127.0.0.1:8080'); -``` - -Listening on the localhost address `127.0.0.1` means it will not be reachable from -outside of this system. -In order to change the host the socket is listening on, you can provide an IP -address of an interface or use the special `0.0.0.0` address to listen on all -interfaces: - -```php -$socket = new React\Socket\SocketServer('0.0.0.0:8080'); -``` - -If you want to listen on an IPv6 address, you MUST enclose the host in square -brackets: - -```php -$socket = new React\Socket\SocketServer('[::1]:8080'); -``` - -In order to use a random port assignment, you can use the port `0`: - -```php -$socket = new React\Socket\SocketServer('127.0.0.1:0'); -$address = $socket->getAddress(); -``` - -To listen on a Unix domain socket (UDS) path, you MUST prefix the URI with the -`unix://` scheme: - -```php -$socket = new React\Socket\SocketServer('unix:///tmp/server.sock'); -``` - -In order to listen on an existing file descriptor (FD) number, you MUST prefix -the URI with `php://fd/` like this: - -```php -$socket = new React\Socket\SocketServer('php://fd/3'); -``` - -If the given URI is invalid, does not contain a port, any other scheme or if it -contains a hostname, it will throw an `InvalidArgumentException`: - -```php -// throws InvalidArgumentException due to missing port -$socket = new React\Socket\SocketServer('127.0.0.1'); -``` - -If the given URI appears to be valid, but listening on it fails (such as if port -is already in use or port below 1024 may require root access etc.), it will -throw a `RuntimeException`: - -```php -$first = new React\Socket\SocketServer('127.0.0.1:8080'); - -// throws RuntimeException because port is already in use -$second = new React\Socket\SocketServer('127.0.0.1:8080'); -``` - -> Note that these error conditions may vary depending on your system and/or - configuration. - See the exception message and code for more details about the actual error - condition. - -Optionally, you can specify [TCP socket context options](https://www.php.net/manual/en/context.socket.php) -for the underlying stream socket resource like this: - -```php -$socket = new React\Socket\SocketServer('[::1]:8080', array( - 'tcp' => array( - 'backlog' => 200, - 'so_reuseport' => true, - 'ipv6_v6only' => true - ) -)); -``` - -> Note that available [socket context options](https://www.php.net/manual/en/context.socket.php), - their defaults and effects of changing these may vary depending on your system - and/or PHP version. - Passing unknown context options has no effect. - The `backlog` context option defaults to `511` unless given explicitly. - -You can start a secure TLS (formerly known as SSL) server by simply prepending -the `tls://` URI scheme. -Internally, it will wait for plaintext TCP/IP connections and then performs a -TLS handshake for each connection. -It thus requires valid [TLS context options](https://www.php.net/manual/en/context.ssl.php), -which in its most basic form may look something like this if you're using a -PEM encoded certificate file: - -```php -$socket = new React\Socket\SocketServer('tls://127.0.0.1:8080', array( - 'tls' => array( - 'local_cert' => 'server.pem' - ) -)); -``` - -> Note that the certificate file will not be loaded on instantiation but when an - incoming connection initializes its TLS context. - This implies that any invalid certificate file paths or contents will only cause - an `error` event at a later time. - -If your private key is encrypted with a passphrase, you have to specify it -like this: - -```php -$socket = new React\Socket\SocketServer('tls://127.0.0.1:8000', array( - 'tls' => array( - 'local_cert' => 'server.pem', - 'passphrase' => 'secret' - ) -)); -``` - -By default, this server supports TLSv1.0+ and excludes support for legacy -SSLv2/SSLv3. As of PHP 5.6+ you can also explicitly choose the TLS version you -want to negotiate with the remote side: - -```php -$socket = new React\Socket\SocketServer('tls://127.0.0.1:8000', array( - 'tls' => array( - 'local_cert' => 'server.pem', - 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_SERVER - ) -)); -``` - -> Note that available [TLS context options](https://www.php.net/manual/en/context.ssl.php), - their defaults and effects of changing these may vary depending on your system - and/or PHP version. - The outer context array allows you to also use `tcp` (and possibly more) - context options at the same time. - Passing unknown context options has no effect. - If you do not use the `tls://` scheme, then passing `tls` context options - has no effect. - -Whenever a client connects, it will emit a `connection` event with a connection -instance implementing [`ConnectionInterface`](#connectioninterface): - -```php -$socket->on('connection', function (React\Socket\ConnectionInterface $connection) { - echo 'Plaintext connection from ' . $connection->getRemoteAddress() . PHP_EOL; - - $connection->write('hello there!' . PHP_EOL); - … -}); -``` - -See also the [`ServerInterface`](#serverinterface) for more details. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -> Note that the `SocketServer` class is a concrete implementation for TCP/IP sockets. - If you want to typehint in your higher-level protocol implementation, you SHOULD - use the generic [`ServerInterface`](#serverinterface) instead. - -> Changelog v1.9.0: This class has been added with an improved constructor signature - as a replacement for the previous `Server` class in order to avoid any ambiguities. - The previous name has been deprecated and should not be used anymore. - -### Advanced server usage - -#### TcpServer - -The `TcpServer` class implements the [`ServerInterface`](#serverinterface) and -is responsible for accepting plaintext TCP/IP connections. - -```php -$server = new React\Socket\TcpServer(8080); -``` - -As above, the `$uri` parameter can consist of only a port, in which case the -server will default to listening on the localhost address `127.0.0.1`, -which means it will not be reachable from outside of this system. - -In order to use a random port assignment, you can use the port `0`: - -```php -$server = new React\Socket\TcpServer(0); -$address = $server->getAddress(); -``` - -In order to change the host the socket is listening on, you can provide an IP -address through the first parameter provided to the constructor, optionally -preceded by the `tcp://` scheme: - -```php -$server = new React\Socket\TcpServer('192.168.0.1:8080'); -``` - -If you want to listen on an IPv6 address, you MUST enclose the host in square -brackets: - -```php -$server = new React\Socket\TcpServer('[::1]:8080'); -``` - -If the given URI is invalid, does not contain a port, any other scheme or if it -contains a hostname, it will throw an `InvalidArgumentException`: - -```php -// throws InvalidArgumentException due to missing port -$server = new React\Socket\TcpServer('127.0.0.1'); -``` - -If the given URI appears to be valid, but listening on it fails (such as if port -is already in use or port below 1024 may require root access etc.), it will -throw a `RuntimeException`: - -```php -$first = new React\Socket\TcpServer(8080); - -// throws RuntimeException because port is already in use -$second = new React\Socket\TcpServer(8080); -``` - -> Note that these error conditions may vary depending on your system and/or -configuration. -See the exception message and code for more details about the actual error -condition. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -Optionally, you can specify [socket context options](https://www.php.net/manual/en/context.socket.php) -for the underlying stream socket resource like this: - -```php -$server = new React\Socket\TcpServer('[::1]:8080', null, array( - 'backlog' => 200, - 'so_reuseport' => true, - 'ipv6_v6only' => true -)); -``` - -> Note that available [socket context options](https://www.php.net/manual/en/context.socket.php), -their defaults and effects of changing these may vary depending on your system -and/or PHP version. -Passing unknown context options has no effect. -The `backlog` context option defaults to `511` unless given explicitly. - -Whenever a client connects, it will emit a `connection` event with a connection -instance implementing [`ConnectionInterface`](#connectioninterface): - -```php -$server->on('connection', function (React\Socket\ConnectionInterface $connection) { - echo 'Plaintext connection from ' . $connection->getRemoteAddress() . PHP_EOL; - - $connection->write('hello there!' . PHP_EOL); - … -}); -``` - -See also the [`ServerInterface`](#serverinterface) for more details. - -#### SecureServer - -The `SecureServer` class implements the [`ServerInterface`](#serverinterface) -and is responsible for providing a secure TLS (formerly known as SSL) server. - -It does so by wrapping a [`TcpServer`](#tcpserver) instance which waits for plaintext -TCP/IP connections and then performs a TLS handshake for each connection. -It thus requires valid [TLS context options](https://www.php.net/manual/en/context.ssl.php), -which in its most basic form may look something like this if you're using a -PEM encoded certificate file: - -```php -$server = new React\Socket\TcpServer(8000); -$server = new React\Socket\SecureServer($server, null, array( - 'local_cert' => 'server.pem' -)); -``` - -> Note that the certificate file will not be loaded on instantiation but when an -incoming connection initializes its TLS context. -This implies that any invalid certificate file paths or contents will only cause -an `error` event at a later time. - -If your private key is encrypted with a passphrase, you have to specify it -like this: - -```php -$server = new React\Socket\TcpServer(8000); -$server = new React\Socket\SecureServer($server, null, array( - 'local_cert' => 'server.pem', - 'passphrase' => 'secret' -)); -``` - -By default, this server supports TLSv1.0+ and excludes support for legacy -SSLv2/SSLv3. As of PHP 5.6+ you can also explicitly choose the TLS version you -want to negotiate with the remote side: - -```php -$server = new React\Socket\TcpServer(8000); -$server = new React\Socket\SecureServer($server, null, array( - 'local_cert' => 'server.pem', - 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_SERVER -)); -``` - -> Note that available [TLS context options](https://www.php.net/manual/en/context.ssl.php), -their defaults and effects of changing these may vary depending on your system -and/or PHP version. -Passing unknown context options has no effect. - -Whenever a client completes the TLS handshake, it will emit a `connection` event -with a connection instance implementing [`ConnectionInterface`](#connectioninterface): - -```php -$server->on('connection', function (React\Socket\ConnectionInterface $connection) { - echo 'Secure connection from' . $connection->getRemoteAddress() . PHP_EOL; - - $connection->write('hello there!' . PHP_EOL); - … -}); -``` - -Whenever a client fails to perform a successful TLS handshake, it will emit an -`error` event and then close the underlying TCP/IP connection: - -```php -$server->on('error', function (Exception $e) { - echo 'Error' . $e->getMessage() . PHP_EOL; -}); -``` - -See also the [`ServerInterface`](#serverinterface) for more details. - -Note that the `SecureServer` class is a concrete implementation for TLS sockets. -If you want to typehint in your higher-level protocol implementation, you SHOULD -use the generic [`ServerInterface`](#serverinterface) instead. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -> Advanced usage: Despite allowing any `ServerInterface` as first parameter, -you SHOULD pass a `TcpServer` instance as first parameter, unless you -know what you're doing. -Internally, the `SecureServer` has to set the required TLS context options on -the underlying stream resources. -These resources are not exposed through any of the interfaces defined in this -package, but only through the internal `Connection` class. -The `TcpServer` class is guaranteed to emit connections that implement -the `ConnectionInterface` and uses the internal `Connection` class in order to -expose these underlying resources. -If you use a custom `ServerInterface` and its `connection` event does not -meet this requirement, the `SecureServer` will emit an `error` event and -then close the underlying connection. - -#### UnixServer - -The `UnixServer` class implements the [`ServerInterface`](#serverinterface) and -is responsible for accepting connections on Unix domain sockets (UDS). - -```php -$server = new React\Socket\UnixServer('/tmp/server.sock'); -``` - -As above, the `$uri` parameter can consist of only a socket path or socket path -prefixed by the `unix://` scheme. - -If the given URI appears to be valid, but listening on it fails (such as if the -socket is already in use or the file not accessible etc.), it will throw a -`RuntimeException`: - -```php -$first = new React\Socket\UnixServer('/tmp/same.sock'); - -// throws RuntimeException because socket is already in use -$second = new React\Socket\UnixServer('/tmp/same.sock'); -``` - -> Note that these error conditions may vary depending on your system and/or - configuration. - In particular, Zend PHP does only report "Unknown error" when the UDS path - already exists and can not be bound. You may want to check `is_file()` on the - given UDS path to report a more user-friendly error message in this case. - See the exception message and code for more details about the actual error - condition. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -Whenever a client connects, it will emit a `connection` event with a connection -instance implementing [`ConnectionInterface`](#connectioninterface): - -```php -$server->on('connection', function (React\Socket\ConnectionInterface $connection) { - echo 'New connection' . PHP_EOL; - - $connection->write('hello there!' . PHP_EOL); - … -}); -``` - -See also the [`ServerInterface`](#serverinterface) for more details. - -#### LimitingServer - -The `LimitingServer` decorator wraps a given `ServerInterface` and is responsible -for limiting and keeping track of open connections to this server instance. - -Whenever the underlying server emits a `connection` event, it will check its -limits and then either - - keep track of this connection by adding it to the list of - open connections and then forward the `connection` event - - or reject (close) the connection when its limits are exceeded and will - forward an `error` event instead. - -Whenever a connection closes, it will remove this connection from the list of -open connections. - -```php -$server = new React\Socket\LimitingServer($server, 100); -$server->on('connection', function (React\Socket\ConnectionInterface $connection) { - $connection->write('hello there!' . PHP_EOL); - … -}); -``` - -See also the [second example](examples) for more details. - -You have to pass a maximum number of open connections to ensure -the server will automatically reject (close) connections once this limit -is exceeded. In this case, it will emit an `error` event to inform about -this and no `connection` event will be emitted. - -```php -$server = new React\Socket\LimitingServer($server, 100); -$server->on('connection', function (React\Socket\ConnectionInterface $connection) { - $connection->write('hello there!' . PHP_EOL); - … -}); -``` - -You MAY pass a `null` limit in order to put no limit on the number of -open connections and keep accepting new connection until you run out of -operating system resources (such as open file handles). This may be -useful if you do not want to take care of applying a limit but still want -to use the `getConnections()` method. - -You can optionally configure the server to pause accepting new -connections once the connection limit is reached. In this case, it will -pause the underlying server and no longer process any new connections at -all, thus also no longer closing any excessive connections. -The underlying operating system is responsible for keeping a backlog of -pending connections until its limit is reached, at which point it will -start rejecting further connections. -Once the server is below the connection limit, it will continue consuming -connections from the backlog and will process any outstanding data on -each connection. -This mode may be useful for some protocols that are designed to wait for -a response message (such as HTTP), but may be less useful for other -protocols that demand immediate responses (such as a "welcome" message in -an interactive chat). - -```php -$server = new React\Socket\LimitingServer($server, 100, true); -$server->on('connection', function (React\Socket\ConnectionInterface $connection) { - $connection->write('hello there!' . PHP_EOL); - … -}); -``` - -##### getConnections() - -The `getConnections(): ConnectionInterface[]` method can be used to -return an array with all currently active connections. - -```php -foreach ($server->getConnection() as $connection) { - $connection->write('Hi!'); -} -``` - -## Client usage - -### ConnectorInterface - -The `ConnectorInterface` is responsible for providing an interface for -establishing streaming connections, such as a normal TCP/IP connection. - -This is the main interface defined in this package and it is used throughout -React's vast ecosystem. - -Most higher-level components (such as HTTP, database or other networking -service clients) accept an instance implementing this interface to create their -TCP/IP connection to the underlying networking service. -This is usually done via dependency injection, so it's fairly simple to actually -swap this implementation against any other implementation of this interface. - -The interface only offers a single method: - -#### connect() - -The `connect(string $uri): PromiseInterface` method can be used to -create a streaming connection to the given remote address. - -It returns a [Promise](https://github.com/reactphp/promise) which either -fulfills with a stream implementing [`ConnectionInterface`](#connectioninterface) -on success or rejects with an `Exception` if the connection is not successful: - -```php -$connector->connect('google.com:443')->then( - function (React\Socket\ConnectionInterface $connection) { - // connection successfully established - }, - function (Exception $error) { - // failed to connect due to $error - } -); -``` - -See also [`ConnectionInterface`](#connectioninterface) for more details. - -The returned Promise MUST be implemented in such a way that it can be -cancelled when it is still pending. Cancelling a pending promise MUST -reject its value with an `Exception`. It SHOULD clean up any underlying -resources and references as applicable: - -```php -$promise = $connector->connect($uri); - -$promise->cancel(); -``` - -### Connector - -The `Connector` class is the main class in this package that implements the -[`ConnectorInterface`](#connectorinterface) and allows you to create streaming connections. - -You can use this connector to create any kind of streaming connections, such -as plaintext TCP/IP, secure TLS or local Unix connection streams. - -It binds to the main event loop and can be used like this: - -```php -$connector = new React\Socket\Connector(); - -$connector->connect($uri)->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}, function (Exception $e) { - echo 'Error: ' . $e->getMessage() . PHP_EOL; -}); -``` - -In order to create a plaintext TCP/IP connection, you can simply pass a host -and port combination like this: - -```php -$connector->connect('www.google.com:80')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -> If you do no specify a URI scheme in the destination URI, it will assume - `tcp://` as a default and establish a plaintext TCP/IP connection. - Note that TCP/IP connections require a host and port part in the destination - URI like above, all other URI components are optional. - -In order to create a secure TLS connection, you can use the `tls://` URI scheme -like this: - -```php -$connector->connect('tls://www.google.com:443')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -In order to create a local Unix domain socket connection, you can use the -`unix://` URI scheme like this: - -```php -$connector->connect('unix:///tmp/demo.sock')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -> The [`getRemoteAddress()`](#getremoteaddress) method will return the target - Unix domain socket (UDS) path as given to the `connect()` method, including - the `unix://` scheme, for example `unix:///tmp/demo.sock`. - The [`getLocalAddress()`](#getlocaladdress) method will most likely return a - `null` value as this value is not applicable to UDS connections here. - -Under the hood, the `Connector` is implemented as a *higher-level facade* -for the lower-level connectors implemented in this package. This means it -also shares all of their features and implementation details. -If you want to typehint in your higher-level protocol implementation, you SHOULD -use the generic [`ConnectorInterface`](#connectorinterface) instead. - -As of `v1.4.0`, the `Connector` class defaults to using the -[happy eyeballs algorithm](https://en.wikipedia.org/wiki/Happy_Eyeballs) to -automatically connect over IPv4 or IPv6 when a hostname is given. -This automatically attempts to connect using both IPv4 and IPv6 at the same time -(preferring IPv6), thus avoiding the usual problems faced by users with imperfect -IPv6 connections or setups. -If you want to revert to the old behavior of only doing an IPv4 lookup and -only attempt a single IPv4 connection, you can set up the `Connector` like this: - -```php -$connector = new React\Socket\Connector(array( - 'happy_eyeballs' => false -)); -``` - -Similarly, you can also affect the default DNS behavior as follows. -The `Connector` class will try to detect your system DNS settings (and uses -Google's public DNS server `8.8.8.8` as a fallback if unable to determine your -system settings) to resolve all public hostnames into underlying IP addresses by -default. -If you explicitly want to use a custom DNS server (such as a local DNS relay or -a company wide DNS server), you can set up the `Connector` like this: - -```php -$connector = new React\Socket\Connector(array( - 'dns' => '127.0.1.1' -)); - -$connector->connect('localhost:80')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -If you do not want to use a DNS resolver at all and want to connect to IP -addresses only, you can also set up your `Connector` like this: - -```php -$connector = new React\Socket\Connector(array( - 'dns' => false -)); - -$connector->connect('127.0.0.1:80')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -Advanced: If you need a custom DNS `React\Dns\Resolver\ResolverInterface` instance, you -can also set up your `Connector` like this: - -```php -$dnsResolverFactory = new React\Dns\Resolver\Factory(); -$resolver = $dnsResolverFactory->createCached('127.0.1.1'); - -$connector = new React\Socket\Connector(array( - 'dns' => $resolver -)); - -$connector->connect('localhost:80')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -By default, the `tcp://` and `tls://` URI schemes will use timeout value that -respects your `default_socket_timeout` ini setting (which defaults to 60s). -If you want a custom timeout value, you can simply pass this like this: - -```php -$connector = new React\Socket\Connector(array( - 'timeout' => 10.0 -)); -``` - -Similarly, if you do not want to apply a timeout at all and let the operating -system handle this, you can pass a boolean flag like this: - -```php -$connector = new React\Socket\Connector(array( - 'timeout' => false -)); -``` - -By default, the `Connector` supports the `tcp://`, `tls://` and `unix://` -URI schemes. If you want to explicitly prohibit any of these, you can simply -pass boolean flags like this: - -```php -// only allow secure TLS connections -$connector = new React\Socket\Connector(array( - 'tcp' => false, - 'tls' => true, - 'unix' => false, -)); - -$connector->connect('tls://google.com:443')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -The `tcp://` and `tls://` also accept additional context options passed to -the underlying connectors. -If you want to explicitly pass additional context options, you can simply -pass arrays of context options like this: - -```php -// allow insecure TLS connections -$connector = new React\Socket\Connector(array( - 'tcp' => array( - 'bindto' => '192.168.0.1:0' - ), - 'tls' => array( - 'verify_peer' => false, - 'verify_peer_name' => false - ), -)); - -$connector->connect('tls://localhost:443')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -By default, this connector supports TLSv1.0+ and excludes support for legacy -SSLv2/SSLv3. As of PHP 5.6+ you can also explicitly choose the TLS version you -want to negotiate with the remote side: - -```php -$connector = new React\Socket\Connector(array( - 'tls' => array( - 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT - ) -)); -``` - -> For more details about context options, please refer to the PHP documentation - about [socket context options](https://www.php.net/manual/en/context.socket.php) - and [SSL context options](https://www.php.net/manual/en/context.ssl.php). - -Advanced: By default, the `Connector` supports the `tcp://`, `tls://` and -`unix://` URI schemes. -For this, it sets up the required connector classes automatically. -If you want to explicitly pass custom connectors for any of these, you can simply -pass an instance implementing the `ConnectorInterface` like this: - -```php -$dnsResolverFactory = new React\Dns\Resolver\Factory(); -$resolver = $dnsResolverFactory->createCached('127.0.1.1'); -$tcp = new React\Socket\HappyEyeBallsConnector(null, new React\Socket\TcpConnector(), $resolver); - -$tls = new React\Socket\SecureConnector($tcp); - -$unix = new React\Socket\UnixConnector(); - -$connector = new React\Socket\Connector(array( - 'tcp' => $tcp, - 'tls' => $tls, - 'unix' => $unix, - - 'dns' => false, - 'timeout' => false, -)); - -$connector->connect('google.com:80')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -> Internally, the `tcp://` connector will always be wrapped by the DNS resolver, - unless you disable DNS like in the above example. In this case, the `tcp://` - connector receives the actual hostname instead of only the resolved IP address - and is thus responsible for performing the lookup. - Internally, the automatically created `tls://` connector will always wrap the - underlying `tcp://` connector for establishing the underlying plaintext - TCP/IP connection before enabling secure TLS mode. If you want to use a custom - underlying `tcp://` connector for secure TLS connections only, you may - explicitly pass a `tls://` connector like above instead. - Internally, the `tcp://` and `tls://` connectors will always be wrapped by - `TimeoutConnector`, unless you disable timeouts like in the above example. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -> Changelog v1.9.0: The constructur signature has been updated to take the -> optional `$context` as the first parameter and the optional `$loop` as a second -> argument. The previous signature has been deprecated and should not be used anymore. -> -> ```php -> // constructor signature as of v1.9.0 -> $connector = new React\Socket\Connector(array $context = [], ?LoopInterface $loop = null); -> -> // legacy constructor signature before v1.9.0 -> $connector = new React\Socket\Connector(?LoopInterface $loop = null, array $context = []); -> ``` - -### Advanced client usage - -#### TcpConnector - -The `TcpConnector` class implements the -[`ConnectorInterface`](#connectorinterface) and allows you to create plaintext -TCP/IP connections to any IP-port-combination: - -```php -$tcpConnector = new React\Socket\TcpConnector(); - -$tcpConnector->connect('127.0.0.1:80')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -See also the [examples](examples). - -Pending connection attempts can be cancelled by cancelling its pending promise like so: - -```php -$promise = $tcpConnector->connect('127.0.0.1:80'); - -$promise->cancel(); -``` - -Calling `cancel()` on a pending promise will close the underlying socket -resource, thus cancelling the pending TCP/IP connection, and reject the -resulting promise. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -You can optionally pass additional -[socket context options](https://www.php.net/manual/en/context.socket.php) -to the constructor like this: - -```php -$tcpConnector = new React\Socket\TcpConnector(null, array( - 'bindto' => '192.168.0.1:0' -)); -``` - -Note that this class only allows you to connect to IP-port-combinations. -If the given URI is invalid, does not contain a valid IP address and port -or contains any other scheme, it will reject with an -`InvalidArgumentException`: - -If the given URI appears to be valid, but connecting to it fails (such as if -the remote host rejects the connection etc.), it will reject with a -`RuntimeException`. - -If you want to connect to hostname-port-combinations, see also the following chapter. - -> Advanced usage: Internally, the `TcpConnector` allocates an empty *context* -resource for each stream resource. -If the destination URI contains a `hostname` query parameter, its value will -be used to set up the TLS peer name. -This is used by the `SecureConnector` and `DnsConnector` to verify the peer -name and can also be used if you want a custom TLS peer name. - -#### HappyEyeBallsConnector - -The `HappyEyeBallsConnector` class implements the -[`ConnectorInterface`](#connectorinterface) and allows you to create plaintext -TCP/IP connections to any hostname-port-combination. Internally it implements the -happy eyeballs algorithm from [`RFC6555`](https://tools.ietf.org/html/rfc6555) and -[`RFC8305`](https://tools.ietf.org/html/rfc8305) to support IPv6 and IPv4 hostnames. - -It does so by decorating a given `TcpConnector` instance so that it first -looks up the given domain name via DNS (if applicable) and then establishes the -underlying TCP/IP connection to the resolved target IP address. - -Make sure to set up your DNS resolver and underlying TCP connector like this: - -```php -$dnsResolverFactory = new React\Dns\Resolver\Factory(); -$dns = $dnsResolverFactory->createCached('8.8.8.8'); - -$dnsConnector = new React\Socket\HappyEyeBallsConnector(null, $tcpConnector, $dns); - -$dnsConnector->connect('www.google.com:80')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -See also the [examples](examples). - -Pending connection attempts can be cancelled by cancelling its pending promise like so: - -```php -$promise = $dnsConnector->connect('www.google.com:80'); - -$promise->cancel(); -``` - -Calling `cancel()` on a pending promise will cancel the underlying DNS lookups -and/or the underlying TCP/IP connection(s) and reject the resulting promise. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -> Advanced usage: Internally, the `HappyEyeBallsConnector` relies on a `Resolver` to -look up the IP addresses for the given hostname. -It will then replace the hostname in the destination URI with this IP's and -append a `hostname` query parameter and pass this updated URI to the underlying -connector. -The Happy Eye Balls algorithm describes looking the IPv6 and IPv4 address for -the given hostname so this connector sends out two DNS lookups for the A and -AAAA records. It then uses all IP addresses (both v6 and v4) and tries to -connect to all of them with a 50ms interval in between. Alterating between IPv6 -and IPv4 addresses. When a connection is established all the other DNS lookups -and connection attempts are cancelled. - -#### DnsConnector - -The `DnsConnector` class implements the -[`ConnectorInterface`](#connectorinterface) and allows you to create plaintext -TCP/IP connections to any hostname-port-combination. - -It does so by decorating a given `TcpConnector` instance so that it first -looks up the given domain name via DNS (if applicable) and then establishes the -underlying TCP/IP connection to the resolved target IP address. - -Make sure to set up your DNS resolver and underlying TCP connector like this: - -```php -$dnsResolverFactory = new React\Dns\Resolver\Factory(); -$dns = $dnsResolverFactory->createCached('8.8.8.8'); - -$dnsConnector = new React\Socket\DnsConnector($tcpConnector, $dns); - -$dnsConnector->connect('www.google.com:80')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write('...'); - $connection->end(); -}); -``` - -See also the [examples](examples). - -Pending connection attempts can be cancelled by cancelling its pending promise like so: - -```php -$promise = $dnsConnector->connect('www.google.com:80'); - -$promise->cancel(); -``` - -Calling `cancel()` on a pending promise will cancel the underlying DNS lookup -and/or the underlying TCP/IP connection and reject the resulting promise. - -> Advanced usage: Internally, the `DnsConnector` relies on a `React\Dns\Resolver\ResolverInterface` -to look up the IP address for the given hostname. -It will then replace the hostname in the destination URI with this IP and -append a `hostname` query parameter and pass this updated URI to the underlying -connector. -The underlying connector is thus responsible for creating a connection to the -target IP address, while this query parameter can be used to check the original -hostname and is used by the `TcpConnector` to set up the TLS peer name. -If a `hostname` is given explicitly, this query parameter will not be modified, -which can be useful if you want a custom TLS peer name. - -#### SecureConnector - -The `SecureConnector` class implements the -[`ConnectorInterface`](#connectorinterface) and allows you to create secure -TLS (formerly known as SSL) connections to any hostname-port-combination. - -It does so by decorating a given `DnsConnector` instance so that it first -creates a plaintext TCP/IP connection and then enables TLS encryption on this -stream. - -```php -$secureConnector = new React\Socket\SecureConnector($dnsConnector); - -$secureConnector->connect('www.google.com:443')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write("GET / HTTP/1.0\r\nHost: www.google.com\r\n\r\n"); - ... -}); -``` - -See also the [examples](examples). - -Pending connection attempts can be cancelled by cancelling its pending promise like so: - -```php -$promise = $secureConnector->connect('www.google.com:443'); - -$promise->cancel(); -``` - -Calling `cancel()` on a pending promise will cancel the underlying TCP/IP -connection and/or the SSL/TLS negotiation and reject the resulting promise. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -You can optionally pass additional -[SSL context options](https://www.php.net/manual/en/context.ssl.php) -to the constructor like this: - -```php -$secureConnector = new React\Socket\SecureConnector($dnsConnector, null, array( - 'verify_peer' => false, - 'verify_peer_name' => false -)); -``` - -By default, this connector supports TLSv1.0+ and excludes support for legacy -SSLv2/SSLv3. As of PHP 5.6+ you can also explicitly choose the TLS version you -want to negotiate with the remote side: - -```php -$secureConnector = new React\Socket\SecureConnector($dnsConnector, null, array( - 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT -)); -``` - -> Advanced usage: Internally, the `SecureConnector` relies on setting up the -required *context options* on the underlying stream resource. -It should therefor be used with a `TcpConnector` somewhere in the connector -stack so that it can allocate an empty *context* resource for each stream -resource and verify the peer name. -Failing to do so may result in a TLS peer name mismatch error or some hard to -trace race conditions, because all stream resources will use a single, shared -*default context* resource otherwise. - -#### TimeoutConnector - -The `TimeoutConnector` class implements the -[`ConnectorInterface`](#connectorinterface) and allows you to add timeout -handling to any existing connector instance. - -It does so by decorating any given [`ConnectorInterface`](#connectorinterface) -instance and starting a timer that will automatically reject and abort any -underlying connection attempt if it takes too long. - -```php -$timeoutConnector = new React\Socket\TimeoutConnector($connector, 3.0); - -$timeoutConnector->connect('google.com:80')->then(function (React\Socket\ConnectionInterface $connection) { - // connection succeeded within 3.0 seconds -}); -``` - -See also any of the [examples](examples). - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -Pending connection attempts can be cancelled by cancelling its pending promise like so: - -```php -$promise = $timeoutConnector->connect('google.com:80'); - -$promise->cancel(); -``` - -Calling `cancel()` on a pending promise will cancel the underlying connection -attempt, abort the timer and reject the resulting promise. - -#### UnixConnector - -The `UnixConnector` class implements the -[`ConnectorInterface`](#connectorinterface) and allows you to connect to -Unix domain socket (UDS) paths like this: - -```php -$connector = new React\Socket\UnixConnector(); - -$connector->connect('/tmp/demo.sock')->then(function (React\Socket\ConnectionInterface $connection) { - $connection->write("HELLO\n"); -}); -``` - -Connecting to Unix domain sockets is an atomic operation, i.e. its promise will -settle (either resolve or reject) immediately. -As such, calling `cancel()` on the resulting promise has no effect. - -> The [`getRemoteAddress()`](#getremoteaddress) method will return the target - Unix domain socket (UDS) path as given to the `connect()` method, prepended - with the `unix://` scheme, for example `unix:///tmp/demo.sock`. - The [`getLocalAddress()`](#getlocaladdress) method will most likely return a - `null` value as this value is not applicable to UDS connections here. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -#### FixedUriConnector - -The `FixedUriConnector` class implements the -[`ConnectorInterface`](#connectorinterface) and decorates an existing Connector -to always use a fixed, preconfigured URI. - -This can be useful for consumers that do not support certain URIs, such as -when you want to explicitly connect to a Unix domain socket (UDS) path -instead of connecting to a default address assumed by an higher-level API: - -```php -$connector = new React\Socket\FixedUriConnector( - 'unix:///var/run/docker.sock', - new React\Socket\UnixConnector() -); - -// destination will be ignored, actually connects to Unix domain socket -$promise = $connector->connect('localhost:80'); -``` - -## Install - -The recommended way to install this library is [through Composer](https://getcomposer.org/). -[New to Composer?](https://getcomposer.org/doc/00-intro.md) - -This project follows [SemVer](https://semver.org/). -This will install the latest supported version: - -```bash -composer require react/socket:^1.16 -``` - -See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. - -This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.3 through current PHP 8+ and HHVM. -It's *highly recommended to use the latest supported PHP version* for this project, -partly due to its vast performance improvements and partly because legacy PHP -versions require several workarounds as described below. - -Secure TLS connections received some major upgrades starting with PHP 5.6, with -the defaults now being more secure, while older versions required explicit -context options. -This library does not take responsibility over these context options, so it's -up to consumers of this library to take care of setting appropriate context -options as described above. - -PHP < 7.3.3 (and PHP < 7.2.15) suffers from a bug where feof() might -block with 100% CPU usage on fragmented TLS records. -We try to work around this by always consuming the complete receive -buffer at once to avoid stale data in TLS buffers. This is known to -work around high CPU usage for well-behaving peers, but this may -cause very large data chunks for high throughput scenarios. The buggy -behavior can still be triggered due to network I/O buffers or -malicious peers on affected versions, upgrading is highly recommended. - -PHP < 7.1.4 (and PHP < 7.0.18) suffers from a bug when writing big -chunks of data over TLS streams at once. -We try to work around this by limiting the write chunk size to 8192 -bytes for older PHP versions only. -This is only a work-around and has a noticable performance penalty on -affected versions. - -This project also supports running on HHVM. -Note that really old HHVM < 3.8 does not support secure TLS connections, as it -lacks the required `stream_socket_enable_crypto()` function. -As such, trying to create a secure TLS connections on affected versions will -return a rejected promise instead. -This issue is also covered by our test suite, which will skip related tests -on affected versions. - -## Tests - -To run the test suite, you first need to clone this repo and then install all -dependencies [through Composer](https://getcomposer.org/): - -```bash -composer install -``` - -To run the test suite, go to the project root and run: - -```bash -vendor/bin/phpunit -``` - -The test suite also contains a number of functional integration tests that rely -on a stable internet connection. -If you do not want to run these, they can simply be skipped like this: - -```bash -vendor/bin/phpunit --exclude-group internet -``` - -## License - -MIT, see [LICENSE file](LICENSE). diff --git a/tools/php-cs-fixer/vendor/react/socket/composer.json b/tools/php-cs-fixer/vendor/react/socket/composer.json deleted file mode 100644 index b1e1d253..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/composer.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "react/socket", - "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", - "keywords": ["async", "socket", "stream", "connection", "ReactPHP"], - "license": "MIT", - "authors": [ - { - "name": "Christian Lück", - "homepage": "https://clue.engineering/", - "email": "christian@clue.engineering" - }, - { - "name": "Cees-Jan Kiewiet", - "homepage": "https://wyrihaximus.net/", - "email": "reactphp@ceesjankiewiet.nl" - }, - { - "name": "Jan Sorgalla", - "homepage": "https://sorgalla.com/", - "email": "jsorgalla@gmail.com" - }, - { - "name": "Chris Boden", - "homepage": "https://cboden.dev/", - "email": "cboden@gmail.com" - } - ], - "require": { - "php": ">=5.3.0", - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "react/dns": "^1.13", - "react/event-loop": "^1.2", - "react/promise": "^3.2 || ^2.6 || ^1.2.1", - "react/stream": "^1.4" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4.3 || ^3.3 || ^2", - "react/promise-stream": "^1.4", - "react/promise-timer": "^1.11" - }, - "autoload": { - "psr-4": { - "React\\Socket\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "React\\Tests\\Socket\\": "tests/" - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/Connection.php b/tools/php-cs-fixer/vendor/react/socket/src/Connection.php deleted file mode 100644 index 65ae26b4..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/Connection.php +++ /dev/null @@ -1,183 +0,0 @@ -= 70300 && \PHP_VERSION_ID < 70303); - - // PHP < 7.1.4 (and PHP < 7.0.18) suffers from a bug when writing big - // chunks of data over TLS streams at once. - // We try to work around this by limiting the write chunk size to 8192 - // bytes for older PHP versions only. - // This is only a work-around and has a noticable performance penalty on - // affected versions. Please update your PHP version. - // This applies to all streams because TLS may be enabled later on. - // See https://github.com/reactphp/socket/issues/105 - $limitWriteChunks = (\PHP_VERSION_ID < 70018 || (\PHP_VERSION_ID >= 70100 && \PHP_VERSION_ID < 70104)); - - $this->input = new DuplexResourceStream( - $resource, - $loop, - $clearCompleteBuffer ? -1 : null, - new WritableResourceStream($resource, $loop, null, $limitWriteChunks ? 8192 : null) - ); - - $this->stream = $resource; - - Util::forwardEvents($this->input, $this, array('data', 'end', 'error', 'close', 'pipe', 'drain')); - - $this->input->on('close', array($this, 'close')); - } - - public function isReadable() - { - return $this->input->isReadable(); - } - - public function isWritable() - { - return $this->input->isWritable(); - } - - public function pause() - { - $this->input->pause(); - } - - public function resume() - { - $this->input->resume(); - } - - public function pipe(WritableStreamInterface $dest, array $options = array()) - { - return $this->input->pipe($dest, $options); - } - - public function write($data) - { - return $this->input->write($data); - } - - public function end($data = null) - { - $this->input->end($data); - } - - public function close() - { - $this->input->close(); - $this->handleClose(); - $this->removeAllListeners(); - } - - public function handleClose() - { - if (!\is_resource($this->stream)) { - return; - } - - // Try to cleanly shut down socket and ignore any errors in case other - // side already closed. Underlying Stream implementation will take care - // of closing stream resource, so we otherwise keep this open here. - @\stream_socket_shutdown($this->stream, \STREAM_SHUT_RDWR); - } - - public function getRemoteAddress() - { - if (!\is_resource($this->stream)) { - return null; - } - - return $this->parseAddress(\stream_socket_get_name($this->stream, true)); - } - - public function getLocalAddress() - { - if (!\is_resource($this->stream)) { - return null; - } - - return $this->parseAddress(\stream_socket_get_name($this->stream, false)); - } - - private function parseAddress($address) - { - if ($address === false) { - return null; - } - - if ($this->unix) { - // remove trailing colon from address for HHVM < 3.19: https://3v4l.org/5C1lo - // note that technically ":" is a valid address, so keep this in place otherwise - if (\substr($address, -1) === ':' && \defined('HHVM_VERSION_ID') && \HHVM_VERSION_ID < 31900) { - $address = (string)\substr($address, 0, -1); // @codeCoverageIgnore - } - - // work around unknown addresses should return null value: https://3v4l.org/5C1lo and https://bugs.php.net/bug.php?id=74556 - // PHP uses "\0" string and HHVM uses empty string (colon removed above) - if ($address === '' || $address[0] === "\x00" ) { - return null; // @codeCoverageIgnore - } - - return 'unix://' . $address; - } - - // check if this is an IPv6 address which includes multiple colons but no square brackets - $pos = \strrpos($address, ':'); - if ($pos !== false && \strpos($address, ':') < $pos && \substr($address, 0, 1) !== '[') { - $address = '[' . \substr($address, 0, $pos) . ']:' . \substr($address, $pos + 1); // @codeCoverageIgnore - } - - return ($this->encryptionEnabled ? 'tls' : 'tcp') . '://' . $address; - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/ConnectionInterface.php b/tools/php-cs-fixer/vendor/react/socket/src/ConnectionInterface.php deleted file mode 100644 index 64613b58..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/ConnectionInterface.php +++ /dev/null @@ -1,119 +0,0 @@ -on('data', function ($chunk) { - * echo $chunk; - * }); - * - * $connection->on('end', function () { - * echo 'ended'; - * }); - * - * $connection->on('error', function (Exception $e) { - * echo 'error: ' . $e->getMessage(); - * }); - * - * $connection->on('close', function () { - * echo 'closed'; - * }); - * - * $connection->write($data); - * $connection->end($data = null); - * $connection->close(); - * // … - * ``` - * - * For more details, see the - * [`DuplexStreamInterface`](https://github.com/reactphp/stream#duplexstreaminterface). - * - * @see DuplexStreamInterface - * @see ServerInterface - * @see ConnectorInterface - */ -interface ConnectionInterface extends DuplexStreamInterface -{ - /** - * Returns the full remote address (URI) where this connection has been established with - * - * ```php - * $address = $connection->getRemoteAddress(); - * echo 'Connection with ' . $address . PHP_EOL; - * ``` - * - * If the remote address can not be determined or is unknown at this time (such as - * after the connection has been closed), it MAY return a `NULL` value instead. - * - * Otherwise, it will return the full address (URI) as a string value, such - * as `tcp://127.0.0.1:8080`, `tcp://[::1]:80`, `tls://127.0.0.1:443`, - * `unix://example.sock` or `unix:///path/to/example.sock`. - * Note that individual URI components are application specific and depend - * on the underlying transport protocol. - * - * If this is a TCP/IP based connection and you only want the remote IP, you may - * use something like this: - * - * ```php - * $address = $connection->getRemoteAddress(); - * $ip = trim(parse_url($address, PHP_URL_HOST), '[]'); - * echo 'Connection with ' . $ip . PHP_EOL; - * ``` - * - * @return ?string remote address (URI) or null if unknown - */ - public function getRemoteAddress(); - - /** - * Returns the full local address (full URI with scheme, IP and port) where this connection has been established with - * - * ```php - * $address = $connection->getLocalAddress(); - * echo 'Connection with ' . $address . PHP_EOL; - * ``` - * - * If the local address can not be determined or is unknown at this time (such as - * after the connection has been closed), it MAY return a `NULL` value instead. - * - * Otherwise, it will return the full address (URI) as a string value, such - * as `tcp://127.0.0.1:8080`, `tcp://[::1]:80`, `tls://127.0.0.1:443`, - * `unix://example.sock` or `unix:///path/to/example.sock`. - * Note that individual URI components are application specific and depend - * on the underlying transport protocol. - * - * This method complements the [`getRemoteAddress()`](#getremoteaddress) method, - * so they should not be confused. - * - * If your `TcpServer` instance is listening on multiple interfaces (e.g. using - * the address `0.0.0.0`), you can use this method to find out which interface - * actually accepted this connection (such as a public or local interface). - * - * If your system has multiple interfaces (e.g. a WAN and a LAN interface), - * you can use this method to find out which interface was actually - * used for this connection. - * - * @return ?string local address (URI) or null if unknown - * @see self::getRemoteAddress() - */ - public function getLocalAddress(); -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/Connector.php b/tools/php-cs-fixer/vendor/react/socket/src/Connector.php deleted file mode 100644 index 15faa469..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/Connector.php +++ /dev/null @@ -1,236 +0,0 @@ - true, - 'tls' => true, - 'unix' => true, - - 'dns' => true, - 'timeout' => true, - 'happy_eyeballs' => true, - ); - - if ($context['timeout'] === true) { - $context['timeout'] = (float)\ini_get("default_socket_timeout"); - } - - if ($context['tcp'] instanceof ConnectorInterface) { - $tcp = $context['tcp']; - } else { - $tcp = new TcpConnector( - $loop, - \is_array($context['tcp']) ? $context['tcp'] : array() - ); - } - - if ($context['dns'] !== false) { - if ($context['dns'] instanceof ResolverInterface) { - $resolver = $context['dns']; - } else { - if ($context['dns'] !== true) { - $config = $context['dns']; - } else { - // try to load nameservers from system config or default to Google's public DNS - $config = DnsConfig::loadSystemConfigBlocking(); - if (!$config->nameservers) { - $config->nameservers[] = '8.8.8.8'; // @codeCoverageIgnore - } - } - - $factory = new DnsFactory(); - $resolver = $factory->createCached( - $config, - $loop - ); - } - - if ($context['happy_eyeballs'] === true) { - $tcp = new HappyEyeBallsConnector($loop, $tcp, $resolver); - } else { - $tcp = new DnsConnector($tcp, $resolver); - } - } - - if ($context['tcp'] !== false) { - $context['tcp'] = $tcp; - - if ($context['timeout'] !== false) { - $context['tcp'] = new TimeoutConnector( - $context['tcp'], - $context['timeout'], - $loop - ); - } - - $this->connectors['tcp'] = $context['tcp']; - } - - if ($context['tls'] !== false) { - if (!$context['tls'] instanceof ConnectorInterface) { - $context['tls'] = new SecureConnector( - $tcp, - $loop, - \is_array($context['tls']) ? $context['tls'] : array() - ); - } - - if ($context['timeout'] !== false) { - $context['tls'] = new TimeoutConnector( - $context['tls'], - $context['timeout'], - $loop - ); - } - - $this->connectors['tls'] = $context['tls']; - } - - if ($context['unix'] !== false) { - if (!$context['unix'] instanceof ConnectorInterface) { - $context['unix'] = new UnixConnector($loop); - } - $this->connectors['unix'] = $context['unix']; - } - } - - public function connect($uri) - { - $scheme = 'tcp'; - if (\strpos($uri, '://') !== false) { - $scheme = (string)\substr($uri, 0, \strpos($uri, '://')); - } - - if (!isset($this->connectors[$scheme])) { - return \React\Promise\reject(new \RuntimeException( - 'No connector available for URI scheme "' . $scheme . '" (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - )); - } - - return $this->connectors[$scheme]->connect($uri); - } - - - /** - * [internal] Builds on URI from the given URI parts and ip address with original hostname as query - * - * @param array $parts - * @param string $host - * @param string $ip - * @return string - * @internal - */ - public static function uri(array $parts, $host, $ip) - { - $uri = ''; - - // prepend original scheme if known - if (isset($parts['scheme'])) { - $uri .= $parts['scheme'] . '://'; - } - - if (\strpos($ip, ':') !== false) { - // enclose IPv6 addresses in square brackets before appending port - $uri .= '[' . $ip . ']'; - } else { - $uri .= $ip; - } - - // append original port if known - if (isset($parts['port'])) { - $uri .= ':' . $parts['port']; - } - - // append orignal path if known - if (isset($parts['path'])) { - $uri .= $parts['path']; - } - - // append original query if known - if (isset($parts['query'])) { - $uri .= '?' . $parts['query']; - } - - // append original hostname as query if resolved via DNS and if - // destination URI does not contain "hostname" query param already - $args = array(); - \parse_str(isset($parts['query']) ? $parts['query'] : '', $args); - if ($host !== $ip && !isset($args['hostname'])) { - $uri .= (isset($parts['query']) ? '&' : '?') . 'hostname=' . \rawurlencode($host); - } - - // append original fragment if known - if (isset($parts['fragment'])) { - $uri .= '#' . $parts['fragment']; - } - - return $uri; - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/ConnectorInterface.php b/tools/php-cs-fixer/vendor/react/socket/src/ConnectorInterface.php deleted file mode 100644 index 1f07b753..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/ConnectorInterface.php +++ /dev/null @@ -1,59 +0,0 @@ -connect('google.com:443')->then( - * function (React\Socket\ConnectionInterface $connection) { - * // connection successfully established - * }, - * function (Exception $error) { - * // failed to connect due to $error - * } - * ); - * ``` - * - * The returned Promise MUST be implemented in such a way that it can be - * cancelled when it is still pending. Cancelling a pending promise MUST - * reject its value with an Exception. It SHOULD clean up any underlying - * resources and references as applicable. - * - * ```php - * $promise = $connector->connect($uri); - * - * $promise->cancel(); - * ``` - * - * @param string $uri - * @return \React\Promise\PromiseInterface - * Resolves with a `ConnectionInterface` on success or rejects with an `Exception` on error. - * @see ConnectionInterface - */ - public function connect($uri); -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/DnsConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/DnsConnector.php deleted file mode 100644 index d2fb2c7d..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/DnsConnector.php +++ /dev/null @@ -1,117 +0,0 @@ -connector = $connector; - $this->resolver = $resolver; - } - - public function connect($uri) - { - $original = $uri; - if (\strpos($uri, '://') === false) { - $uri = 'tcp://' . $uri; - $parts = \parse_url($uri); - if (isset($parts['scheme'])) { - unset($parts['scheme']); - } - } else { - $parts = \parse_url($uri); - } - - if (!$parts || !isset($parts['host'])) { - return Promise\reject(new \InvalidArgumentException( - 'Given URI "' . $original . '" is invalid (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - )); - } - - $host = \trim($parts['host'], '[]'); - $connector = $this->connector; - - // skip DNS lookup / URI manipulation if this URI already contains an IP - if (@\inet_pton($host) !== false) { - return $connector->connect($original); - } - - $promise = $this->resolver->resolve($host); - $resolved = null; - - return new Promise\Promise( - function ($resolve, $reject) use (&$promise, &$resolved, $uri, $connector, $host, $parts) { - // resolve/reject with result of DNS lookup - $promise->then(function ($ip) use (&$promise, &$resolved, $uri, $connector, $host, $parts) { - $resolved = $ip; - - return $promise = $connector->connect( - Connector::uri($parts, $host, $ip) - )->then(null, function (\Exception $e) use ($uri) { - if ($e instanceof \RuntimeException) { - $message = \preg_replace('/^(Connection to [^ ]+)[&?]hostname=[^ &]+/', '$1', $e->getMessage()); - $e = new \RuntimeException( - 'Connection to ' . $uri . ' failed: ' . $message, - $e->getCode(), - $e - ); - - // avoid garbage references by replacing all closures in call stack. - // what a lovely piece of code! - $r = new \ReflectionProperty('Exception', 'trace'); - $r->setAccessible(true); - $trace = $r->getValue($e); - - // Exception trace arguments are not available on some PHP 7.4 installs - // @codeCoverageIgnoreStart - foreach ($trace as $ti => $one) { - if (isset($one['args'])) { - foreach ($one['args'] as $ai => $arg) { - if ($arg instanceof \Closure) { - $trace[$ti]['args'][$ai] = 'Object(' . \get_class($arg) . ')'; - } - } - } - } - // @codeCoverageIgnoreEnd - $r->setValue($e, $trace); - } - - throw $e; - }); - }, function ($e) use ($uri, $reject) { - $reject(new \RuntimeException('Connection to ' . $uri .' failed during DNS lookup: ' . $e->getMessage(), 0, $e)); - })->then($resolve, $reject); - }, - function ($_, $reject) use (&$promise, &$resolved, $uri) { - // cancellation should reject connection attempt - // reject DNS resolution with custom reason, otherwise rely on connection cancellation below - if ($resolved === null) { - $reject(new \RuntimeException( - 'Connection to ' . $uri . ' cancelled during DNS lookup (ECONNABORTED)', - \defined('SOCKET_ECONNABORTED') ? \SOCKET_ECONNABORTED : 103 - )); - } - - // (try to) cancel pending DNS lookup / connection attempt - if ($promise instanceof PromiseInterface && \method_exists($promise, 'cancel')) { - // overwrite callback arguments for PHP7+ only, so they do not show - // up in the Exception trace and do not cause a possible cyclic reference. - $_ = $reject = null; - - $promise->cancel(); - $promise = null; - } - } - ); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/FdServer.php b/tools/php-cs-fixer/vendor/react/socket/src/FdServer.php deleted file mode 100644 index 8e46719a..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/FdServer.php +++ /dev/null @@ -1,222 +0,0 @@ -on('connection', function (ConnectionInterface $connection) { - * echo 'Plaintext connection from ' . $connection->getRemoteAddress() . PHP_EOL; - * $connection->write('hello there!' . PHP_EOL); - * … - * }); - * ``` - * - * See also the `ServerInterface` for more details. - * - * @see ServerInterface - * @see ConnectionInterface - * @internal - */ -final class FdServer extends EventEmitter implements ServerInterface -{ - private $master; - private $loop; - private $unix = false; - private $listening = false; - - /** - * Creates a socket server and starts listening on the given file descriptor - * - * This starts accepting new incoming connections on the given file descriptor. - * See also the `connection event` documented in the `ServerInterface` - * for more details. - * - * ```php - * $socket = new React\Socket\FdServer(3); - * ``` - * - * If the given FD is invalid or out of range, it will throw an `InvalidArgumentException`: - * - * ```php - * // throws InvalidArgumentException - * $socket = new React\Socket\FdServer(-1); - * ``` - * - * If the given FD appears to be valid, but listening on it fails (such as - * if the FD does not exist or does not refer to a socket server), it will - * throw a `RuntimeException`: - * - * ```php - * // throws RuntimeException because FD does not reference a socket server - * $socket = new React\Socket\FdServer(0, $loop); - * ``` - * - * Note that these error conditions may vary depending on your system and/or - * configuration. - * See the exception message and code for more details about the actual error - * condition. - * - * @param int|string $fd FD number such as `3` or as URL in the form of `php://fd/3` - * @param ?LoopInterface $loop - * @throws \InvalidArgumentException if the listening address is invalid - * @throws \RuntimeException if listening on this address fails (already in use etc.) - */ - public function __construct($fd, $loop = null) - { - if (\preg_match('#^php://fd/(\d+)$#', $fd, $m)) { - $fd = (int) $m[1]; - } - if (!\is_int($fd) || $fd < 0 || $fd >= \PHP_INT_MAX) { - throw new \InvalidArgumentException( - 'Invalid FD number given (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - ); - } - - if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 - throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); - } - - $this->loop = $loop ?: Loop::get(); - - $errno = 0; - $errstr = ''; - \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { - // Match errstr from PHP's warning message. - // fopen(php://fd/3): Failed to open stream: Error duping file descriptor 3; possibly it doesn't exist: [9]: Bad file descriptor - \preg_match('/\[(\d+)\]: (.*)/', $error, $m); - $errno = isset($m[1]) ? (int) $m[1] : 0; - $errstr = isset($m[2]) ? $m[2] : $error; - }); - - $this->master = \fopen('php://fd/' . $fd, 'r+'); - - \restore_error_handler(); - - if (false === $this->master) { - throw new \RuntimeException( - 'Failed to listen on FD ' . $fd . ': ' . $errstr . SocketServer::errconst($errno), - $errno - ); - } - - $meta = \stream_get_meta_data($this->master); - if (!isset($meta['stream_type']) || $meta['stream_type'] !== 'tcp_socket') { - \fclose($this->master); - - $errno = \defined('SOCKET_ENOTSOCK') ? \SOCKET_ENOTSOCK : 88; - $errstr = \function_exists('socket_strerror') ? \socket_strerror($errno) : 'Not a socket'; - - throw new \RuntimeException( - 'Failed to listen on FD ' . $fd . ': ' . $errstr . ' (ENOTSOCK)', - $errno - ); - } - - // Socket should not have a peer address if this is a listening socket. - // Looks like this work-around is the closest we can get because PHP doesn't expose SO_ACCEPTCONN even with ext-sockets. - if (\stream_socket_get_name($this->master, true) !== false) { - \fclose($this->master); - - $errno = \defined('SOCKET_EISCONN') ? \SOCKET_EISCONN : 106; - $errstr = \function_exists('socket_strerror') ? \socket_strerror($errno) : 'Socket is connected'; - - throw new \RuntimeException( - 'Failed to listen on FD ' . $fd . ': ' . $errstr . ' (EISCONN)', - $errno - ); - } - - // Assume this is a Unix domain socket (UDS) when its listening address doesn't parse as a valid URL with a port. - // Looks like this work-around is the closest we can get because PHP doesn't expose SO_DOMAIN even with ext-sockets. - $this->unix = \parse_url($this->getAddress(), \PHP_URL_PORT) === false; - - \stream_set_blocking($this->master, false); - - $this->resume(); - } - - public function getAddress() - { - if (!\is_resource($this->master)) { - return null; - } - - $address = \stream_socket_get_name($this->master, false); - - if ($this->unix === true) { - return 'unix://' . $address; - } - - // check if this is an IPv6 address which includes multiple colons but no square brackets - $pos = \strrpos($address, ':'); - if ($pos !== false && \strpos($address, ':') < $pos && \substr($address, 0, 1) !== '[') { - $address = '[' . \substr($address, 0, $pos) . ']:' . \substr($address, $pos + 1); // @codeCoverageIgnore - } - - return 'tcp://' . $address; - } - - public function pause() - { - if (!$this->listening) { - return; - } - - $this->loop->removeReadStream($this->master); - $this->listening = false; - } - - public function resume() - { - if ($this->listening || !\is_resource($this->master)) { - return; - } - - $that = $this; - $this->loop->addReadStream($this->master, function ($master) use ($that) { - try { - $newSocket = SocketServer::accept($master); - } catch (\RuntimeException $e) { - $that->emit('error', array($e)); - return; - } - $that->handleConnection($newSocket); - }); - $this->listening = true; - } - - public function close() - { - if (!\is_resource($this->master)) { - return; - } - - $this->pause(); - \fclose($this->master); - $this->removeAllListeners(); - } - - /** @internal */ - public function handleConnection($socket) - { - $connection = new Connection($socket, $this->loop); - $connection->unix = $this->unix; - - $this->emit('connection', array($connection)); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/FixedUriConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/FixedUriConnector.php deleted file mode 100644 index f83241d6..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/FixedUriConnector.php +++ /dev/null @@ -1,41 +0,0 @@ -connect('localhost:80'); - * ``` - */ -class FixedUriConnector implements ConnectorInterface -{ - private $uri; - private $connector; - - /** - * @param string $uri - * @param ConnectorInterface $connector - */ - public function __construct($uri, ConnectorInterface $connector) - { - $this->uri = $uri; - $this->connector = $connector; - } - - public function connect($_) - { - return $this->connector->connect($this->uri); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnectionBuilder.php b/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnectionBuilder.php deleted file mode 100644 index d4f05e85..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnectionBuilder.php +++ /dev/null @@ -1,334 +0,0 @@ - false, - Message::TYPE_AAAA => false, - ); - public $resolverPromises = array(); - public $connectionPromises = array(); - public $connectQueue = array(); - public $nextAttemptTimer; - public $parts; - public $ipsCount = 0; - public $failureCount = 0; - public $resolve; - public $reject; - - public $lastErrorFamily; - public $lastError6; - public $lastError4; - - public function __construct(LoopInterface $loop, ConnectorInterface $connector, ResolverInterface $resolver, $uri, $host, $parts) - { - $this->loop = $loop; - $this->connector = $connector; - $this->resolver = $resolver; - $this->uri = $uri; - $this->host = $host; - $this->parts = $parts; - } - - public function connect() - { - $that = $this; - return new Promise\Promise(function ($resolve, $reject) use ($that) { - $lookupResolve = function ($type) use ($that, $resolve, $reject) { - return function (array $ips) use ($that, $type, $resolve, $reject) { - unset($that->resolverPromises[$type]); - $that->resolved[$type] = true; - - $that->mixIpsIntoConnectQueue($ips); - - // start next connection attempt if not already awaiting next - if ($that->nextAttemptTimer === null && $that->connectQueue) { - $that->check($resolve, $reject); - } - }; - }; - - $that->resolverPromises[Message::TYPE_AAAA] = $that->resolve(Message::TYPE_AAAA, $reject)->then($lookupResolve(Message::TYPE_AAAA)); - $that->resolverPromises[Message::TYPE_A] = $that->resolve(Message::TYPE_A, $reject)->then(function (array $ips) use ($that) { - // happy path: IPv6 has resolved already (or could not resolve), continue with IPv4 addresses - if ($that->resolved[Message::TYPE_AAAA] === true || !$ips) { - return $ips; - } - - // Otherwise delay processing IPv4 lookup until short timer passes or IPv6 resolves in the meantime - $deferred = new Promise\Deferred(function () use (&$ips) { - // discard all IPv4 addresses if cancelled - $ips = array(); - }); - $timer = $that->loop->addTimer($that::RESOLUTION_DELAY, function () use ($deferred, $ips) { - $deferred->resolve($ips); - }); - - $that->resolverPromises[Message::TYPE_AAAA]->then(function () use ($that, $timer, $deferred, &$ips) { - $that->loop->cancelTimer($timer); - $deferred->resolve($ips); - }); - - return $deferred->promise(); - })->then($lookupResolve(Message::TYPE_A)); - }, function ($_, $reject) use ($that) { - $reject(new \RuntimeException( - 'Connection to ' . $that->uri . ' cancelled' . (!$that->connectionPromises ? ' during DNS lookup' : '') . ' (ECONNABORTED)', - \defined('SOCKET_ECONNABORTED') ? \SOCKET_ECONNABORTED : 103 - )); - $_ = $reject = null; - - $that->cleanUp(); - }); - } - - /** - * @internal - * @param int $type DNS query type - * @param callable $reject - * @return \React\Promise\PromiseInterface Returns a promise that - * always resolves with a list of IP addresses on success or an empty - * list on error. - */ - public function resolve($type, $reject) - { - $that = $this; - return $that->resolver->resolveAll($that->host, $type)->then(null, function (\Exception $e) use ($type, $reject, $that) { - unset($that->resolverPromises[$type]); - $that->resolved[$type] = true; - - if ($type === Message::TYPE_A) { - $that->lastError4 = $e->getMessage(); - $that->lastErrorFamily = 4; - } else { - $that->lastError6 = $e->getMessage(); - $that->lastErrorFamily = 6; - } - - // cancel next attempt timer when there are no more IPs to connect to anymore - if ($that->nextAttemptTimer !== null && !$that->connectQueue) { - $that->loop->cancelTimer($that->nextAttemptTimer); - $that->nextAttemptTimer = null; - } - - if ($that->hasBeenResolved() && $that->ipsCount === 0) { - $reject(new \RuntimeException( - $that->error(), - 0, - $e - )); - } - - // Exception already handled above, so don't throw an unhandled rejection here - return array(); - }); - } - - /** - * @internal - */ - public function check($resolve, $reject) - { - $ip = \array_shift($this->connectQueue); - - // start connection attempt and remember array position to later unset again - $this->connectionPromises[] = $this->attemptConnection($ip); - \end($this->connectionPromises); - $index = \key($this->connectionPromises); - - $that = $this; - $that->connectionPromises[$index]->then(function ($connection) use ($that, $index, $resolve) { - unset($that->connectionPromises[$index]); - - $that->cleanUp(); - - $resolve($connection); - }, function (\Exception $e) use ($that, $index, $ip, $resolve, $reject) { - unset($that->connectionPromises[$index]); - - $that->failureCount++; - - $message = \preg_replace('/^(Connection to [^ ]+)[&?]hostname=[^ &]+/', '$1', $e->getMessage()); - if (\strpos($ip, ':') === false) { - $that->lastError4 = $message; - $that->lastErrorFamily = 4; - } else { - $that->lastError6 = $message; - $that->lastErrorFamily = 6; - } - - // start next connection attempt immediately on error - if ($that->connectQueue) { - if ($that->nextAttemptTimer !== null) { - $that->loop->cancelTimer($that->nextAttemptTimer); - $that->nextAttemptTimer = null; - } - - $that->check($resolve, $reject); - } - - if ($that->hasBeenResolved() === false) { - return; - } - - if ($that->ipsCount === $that->failureCount) { - $that->cleanUp(); - - $reject(new \RuntimeException( - $that->error(), - $e->getCode(), - $e - )); - } - }); - - // Allow next connection attempt in 100ms: https://tools.ietf.org/html/rfc8305#section-5 - // Only start timer when more IPs are queued or when DNS query is still pending (might add more IPs) - if ($this->nextAttemptTimer === null && (\count($this->connectQueue) > 0 || $this->resolved[Message::TYPE_A] === false || $this->resolved[Message::TYPE_AAAA] === false)) { - $this->nextAttemptTimer = $this->loop->addTimer(self::CONNECTION_ATTEMPT_DELAY, function () use ($that, $resolve, $reject) { - $that->nextAttemptTimer = null; - - if ($that->connectQueue) { - $that->check($resolve, $reject); - } - }); - } - } - - /** - * @internal - */ - public function attemptConnection($ip) - { - $uri = Connector::uri($this->parts, $this->host, $ip); - - return $this->connector->connect($uri); - } - - /** - * @internal - */ - public function cleanUp() - { - // clear list of outstanding IPs to avoid creating new connections - $this->connectQueue = array(); - - // cancel pending connection attempts - foreach ($this->connectionPromises as $connectionPromise) { - if ($connectionPromise instanceof PromiseInterface && \method_exists($connectionPromise, 'cancel')) { - $connectionPromise->cancel(); - } - } - - // cancel pending DNS resolution (cancel IPv4 first in case it is awaiting IPv6 resolution delay) - foreach (\array_reverse($this->resolverPromises) as $resolverPromise) { - if ($resolverPromise instanceof PromiseInterface && \method_exists($resolverPromise, 'cancel')) { - $resolverPromise->cancel(); - } - } - - if ($this->nextAttemptTimer instanceof TimerInterface) { - $this->loop->cancelTimer($this->nextAttemptTimer); - $this->nextAttemptTimer = null; - } - } - - /** - * @internal - */ - public function hasBeenResolved() - { - foreach ($this->resolved as $typeHasBeenResolved) { - if ($typeHasBeenResolved === false) { - return false; - } - } - - return true; - } - - /** - * Mixes an array of IP addresses into the connect queue in such a way they alternate when attempting to connect. - * The goal behind it is first attempt to connect to IPv6, then to IPv4, then to IPv6 again until one of those - * attempts succeeds. - * - * @link https://tools.ietf.org/html/rfc8305#section-4 - * - * @internal - */ - public function mixIpsIntoConnectQueue(array $ips) - { - \shuffle($ips); - $this->ipsCount += \count($ips); - $connectQueueStash = $this->connectQueue; - $this->connectQueue = array(); - while (\count($connectQueueStash) > 0 || \count($ips) > 0) { - if (\count($ips) > 0) { - $this->connectQueue[] = \array_shift($ips); - } - if (\count($connectQueueStash) > 0) { - $this->connectQueue[] = \array_shift($connectQueueStash); - } - } - } - - /** - * @internal - * @return string - */ - public function error() - { - if ($this->lastError4 === $this->lastError6) { - $message = $this->lastError6; - } elseif ($this->lastErrorFamily === 6) { - $message = 'Last error for IPv6: ' . $this->lastError6 . '. Previous error for IPv4: ' . $this->lastError4; - } else { - $message = 'Last error for IPv4: ' . $this->lastError4 . '. Previous error for IPv6: ' . $this->lastError6; - } - - if ($this->hasBeenResolved() && $this->ipsCount === 0) { - if ($this->lastError6 === $this->lastError4) { - $message = ' during DNS lookup: ' . $this->lastError6; - } else { - $message = ' during DNS lookup. ' . $message; - } - } else { - $message = ': ' . $message; - } - - return 'Connection to ' . $this->uri . ' failed' . $message; - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnector.php deleted file mode 100644 index a5511ac9..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/HappyEyeBallsConnector.php +++ /dev/null @@ -1,80 +0,0 @@ -loop = $loop ?: Loop::get(); - $this->connector = $connector; - $this->resolver = $resolver; - } - - public function connect($uri) - { - $original = $uri; - if (\strpos($uri, '://') === false) { - $uri = 'tcp://' . $uri; - $parts = \parse_url($uri); - if (isset($parts['scheme'])) { - unset($parts['scheme']); - } - } else { - $parts = \parse_url($uri); - } - - if (!$parts || !isset($parts['host'])) { - return Promise\reject(new \InvalidArgumentException( - 'Given URI "' . $original . '" is invalid (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - )); - } - - $host = \trim($parts['host'], '[]'); - - // skip DNS lookup / URI manipulation if this URI already contains an IP - if (@\inet_pton($host) !== false) { - return $this->connector->connect($original); - } - - $builder = new HappyEyeBallsConnectionBuilder( - $this->loop, - $this->connector, - $this->resolver, - $uri, - $host, - $parts - ); - return $builder->connect(); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/LimitingServer.php b/tools/php-cs-fixer/vendor/react/socket/src/LimitingServer.php deleted file mode 100644 index d19000b3..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/LimitingServer.php +++ /dev/null @@ -1,203 +0,0 @@ -on('connection', function (React\Socket\ConnectionInterface $connection) { - * $connection->write('hello there!' . PHP_EOL); - * … - * }); - * ``` - * - * See also the `ServerInterface` for more details. - * - * @see ServerInterface - * @see ConnectionInterface - */ -class LimitingServer extends EventEmitter implements ServerInterface -{ - private $connections = array(); - private $server; - private $limit; - - private $pauseOnLimit = false; - private $autoPaused = false; - private $manuPaused = false; - - /** - * Instantiates a new LimitingServer. - * - * You have to pass a maximum number of open connections to ensure - * the server will automatically reject (close) connections once this limit - * is exceeded. In this case, it will emit an `error` event to inform about - * this and no `connection` event will be emitted. - * - * ```php - * $server = new React\Socket\LimitingServer($server, 100); - * $server->on('connection', function (React\Socket\ConnectionInterface $connection) { - * $connection->write('hello there!' . PHP_EOL); - * … - * }); - * ``` - * - * You MAY pass a `null` limit in order to put no limit on the number of - * open connections and keep accepting new connection until you run out of - * operating system resources (such as open file handles). This may be - * useful if you do not want to take care of applying a limit but still want - * to use the `getConnections()` method. - * - * You can optionally configure the server to pause accepting new - * connections once the connection limit is reached. In this case, it will - * pause the underlying server and no longer process any new connections at - * all, thus also no longer closing any excessive connections. - * The underlying operating system is responsible for keeping a backlog of - * pending connections until its limit is reached, at which point it will - * start rejecting further connections. - * Once the server is below the connection limit, it will continue consuming - * connections from the backlog and will process any outstanding data on - * each connection. - * This mode may be useful for some protocols that are designed to wait for - * a response message (such as HTTP), but may be less useful for other - * protocols that demand immediate responses (such as a "welcome" message in - * an interactive chat). - * - * ```php - * $server = new React\Socket\LimitingServer($server, 100, true); - * $server->on('connection', function (React\Socket\ConnectionInterface $connection) { - * $connection->write('hello there!' . PHP_EOL); - * … - * }); - * ``` - * - * @param ServerInterface $server - * @param int|null $connectionLimit - * @param bool $pauseOnLimit - */ - public function __construct(ServerInterface $server, $connectionLimit, $pauseOnLimit = false) - { - $this->server = $server; - $this->limit = $connectionLimit; - if ($connectionLimit !== null) { - $this->pauseOnLimit = $pauseOnLimit; - } - - $this->server->on('connection', array($this, 'handleConnection')); - $this->server->on('error', array($this, 'handleError')); - } - - /** - * Returns an array with all currently active connections - * - * ```php - * foreach ($server->getConnection() as $connection) { - * $connection->write('Hi!'); - * } - * ``` - * - * @return ConnectionInterface[] - */ - public function getConnections() - { - return $this->connections; - } - - public function getAddress() - { - return $this->server->getAddress(); - } - - public function pause() - { - if (!$this->manuPaused) { - $this->manuPaused = true; - - if (!$this->autoPaused) { - $this->server->pause(); - } - } - } - - public function resume() - { - if ($this->manuPaused) { - $this->manuPaused = false; - - if (!$this->autoPaused) { - $this->server->resume(); - } - } - } - - public function close() - { - $this->server->close(); - } - - /** @internal */ - public function handleConnection(ConnectionInterface $connection) - { - // close connection if limit exceeded - if ($this->limit !== null && \count($this->connections) >= $this->limit) { - $this->handleError(new \OverflowException('Connection closed because server reached connection limit')); - $connection->close(); - return; - } - - $this->connections[] = $connection; - $that = $this; - $connection->on('close', function () use ($that, $connection) { - $that->handleDisconnection($connection); - }); - - // pause accepting new connections if limit exceeded - if ($this->pauseOnLimit && !$this->autoPaused && \count($this->connections) >= $this->limit) { - $this->autoPaused = true; - - if (!$this->manuPaused) { - $this->server->pause(); - } - } - - $this->emit('connection', array($connection)); - } - - /** @internal */ - public function handleDisconnection(ConnectionInterface $connection) - { - unset($this->connections[\array_search($connection, $this->connections)]); - - // continue accepting new connection if below limit - if ($this->autoPaused && \count($this->connections) < $this->limit) { - $this->autoPaused = false; - - if (!$this->manuPaused) { - $this->server->resume(); - } - } - } - - /** @internal */ - public function handleError(\Exception $error) - { - $this->emit('error', array($error)); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/SecureConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/SecureConnector.php deleted file mode 100644 index 08255ac9..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/SecureConnector.php +++ /dev/null @@ -1,132 +0,0 @@ -connector = $connector; - $this->streamEncryption = new StreamEncryption($loop ?: Loop::get(), false); - $this->context = $context; - } - - public function connect($uri) - { - if (!\function_exists('stream_socket_enable_crypto')) { - return Promise\reject(new \BadMethodCallException('Encryption not supported on your platform (HHVM < 3.8?)')); // @codeCoverageIgnore - } - - if (\strpos($uri, '://') === false) { - $uri = 'tls://' . $uri; - } - - $parts = \parse_url($uri); - if (!$parts || !isset($parts['scheme']) || $parts['scheme'] !== 'tls') { - return Promise\reject(new \InvalidArgumentException( - 'Given URI "' . $uri . '" is invalid (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - )); - } - - $context = $this->context; - $encryption = $this->streamEncryption; - $connected = false; - /** @var \React\Promise\PromiseInterface $promise */ - $promise = $this->connector->connect( - \str_replace('tls://', '', $uri) - )->then(function (ConnectionInterface $connection) use ($context, $encryption, $uri, &$promise, &$connected) { - // (unencrypted) TCP/IP connection succeeded - $connected = true; - - if (!$connection instanceof Connection) { - $connection->close(); - throw new \UnexpectedValueException('Base connector does not use internal Connection class exposing stream resource'); - } - - // set required SSL/TLS context options - foreach ($context as $name => $value) { - \stream_context_set_option($connection->stream, 'ssl', $name, $value); - } - - // try to enable encryption - return $promise = $encryption->enable($connection)->then(null, function ($error) use ($connection, $uri) { - // establishing encryption failed => close invalid connection and return error - $connection->close(); - - throw new \RuntimeException( - 'Connection to ' . $uri . ' failed during TLS handshake: ' . $error->getMessage(), - $error->getCode() - ); - }); - }, function (\Exception $e) use ($uri) { - if ($e instanceof \RuntimeException) { - $message = \preg_replace('/^Connection to [^ ]+/', '', $e->getMessage()); - $e = new \RuntimeException( - 'Connection to ' . $uri . $message, - $e->getCode(), - $e - ); - - // avoid garbage references by replacing all closures in call stack. - // what a lovely piece of code! - $r = new \ReflectionProperty('Exception', 'trace'); - $r->setAccessible(true); - $trace = $r->getValue($e); - - // Exception trace arguments are not available on some PHP 7.4 installs - // @codeCoverageIgnoreStart - foreach ($trace as $ti => $one) { - if (isset($one['args'])) { - foreach ($one['args'] as $ai => $arg) { - if ($arg instanceof \Closure) { - $trace[$ti]['args'][$ai] = 'Object(' . \get_class($arg) . ')'; - } - } - } - } - // @codeCoverageIgnoreEnd - $r->setValue($e, $trace); - } - - throw $e; - }); - - return new \React\Promise\Promise( - function ($resolve, $reject) use ($promise) { - $promise->then($resolve, $reject); - }, - function ($_, $reject) use (&$promise, $uri, &$connected) { - if ($connected) { - $reject(new \RuntimeException( - 'Connection to ' . $uri . ' cancelled during TLS handshake (ECONNABORTED)', - \defined('SOCKET_ECONNABORTED') ? \SOCKET_ECONNABORTED : 103 - )); - } - - $promise->cancel(); - $promise = null; - } - ); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/SecureServer.php b/tools/php-cs-fixer/vendor/react/socket/src/SecureServer.php deleted file mode 100644 index 5a202d27..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/SecureServer.php +++ /dev/null @@ -1,210 +0,0 @@ -on('connection', function (React\Socket\ConnectionInterface $connection) { - * echo 'Secure connection from' . $connection->getRemoteAddress() . PHP_EOL; - * - * $connection->write('hello there!' . PHP_EOL); - * … - * }); - * ``` - * - * Whenever a client fails to perform a successful TLS handshake, it will emit an - * `error` event and then close the underlying TCP/IP connection: - * - * ```php - * $server->on('error', function (Exception $e) { - * echo 'Error' . $e->getMessage() . PHP_EOL; - * }); - * ``` - * - * See also the `ServerInterface` for more details. - * - * Note that the `SecureServer` class is a concrete implementation for TLS sockets. - * If you want to typehint in your higher-level protocol implementation, you SHOULD - * use the generic `ServerInterface` instead. - * - * @see ServerInterface - * @see ConnectionInterface - */ -final class SecureServer extends EventEmitter implements ServerInterface -{ - private $tcp; - private $encryption; - private $context; - - /** - * Creates a secure TLS server and starts waiting for incoming connections - * - * It does so by wrapping a `TcpServer` instance which waits for plaintext - * TCP/IP connections and then performs a TLS handshake for each connection. - * It thus requires valid [TLS context options], - * which in its most basic form may look something like this if you're using a - * PEM encoded certificate file: - * - * ```php - * $server = new React\Socket\TcpServer(8000); - * $server = new React\Socket\SecureServer($server, null, array( - * 'local_cert' => 'server.pem' - * )); - * ``` - * - * Note that the certificate file will not be loaded on instantiation but when an - * incoming connection initializes its TLS context. - * This implies that any invalid certificate file paths or contents will only cause - * an `error` event at a later time. - * - * If your private key is encrypted with a passphrase, you have to specify it - * like this: - * - * ```php - * $server = new React\Socket\TcpServer(8000); - * $server = new React\Socket\SecureServer($server, null, array( - * 'local_cert' => 'server.pem', - * 'passphrase' => 'secret' - * )); - * ``` - * - * Note that available [TLS context options], - * their defaults and effects of changing these may vary depending on your system - * and/or PHP version. - * Passing unknown context options has no effect. - * - * This class takes an optional `LoopInterface|null $loop` parameter that can be used to - * pass the event loop instance to use for this object. You can use a `null` value - * here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). - * This value SHOULD NOT be given unless you're sure you want to explicitly use a - * given event loop instance. - * - * Advanced usage: Despite allowing any `ServerInterface` as first parameter, - * you SHOULD pass a `TcpServer` instance as first parameter, unless you - * know what you're doing. - * Internally, the `SecureServer` has to set the required TLS context options on - * the underlying stream resources. - * These resources are not exposed through any of the interfaces defined in this - * package, but only through the internal `Connection` class. - * The `TcpServer` class is guaranteed to emit connections that implement - * the `ConnectionInterface` and uses the internal `Connection` class in order to - * expose these underlying resources. - * If you use a custom `ServerInterface` and its `connection` event does not - * meet this requirement, the `SecureServer` will emit an `error` event and - * then close the underlying connection. - * - * @param ServerInterface|TcpServer $tcp - * @param ?LoopInterface $loop - * @param array $context - * @throws BadMethodCallException for legacy HHVM < 3.8 due to lack of support - * @see TcpServer - * @link https://www.php.net/manual/en/context.ssl.php for TLS context options - */ - public function __construct(ServerInterface $tcp, $loop = null, array $context = array()) - { - if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 - throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); - } - - if (!\function_exists('stream_socket_enable_crypto')) { - throw new \BadMethodCallException('Encryption not supported on your platform (HHVM < 3.8?)'); // @codeCoverageIgnore - } - - // default to empty passphrase to suppress blocking passphrase prompt - $context += array( - 'passphrase' => '' - ); - - $this->tcp = $tcp; - $this->encryption = new StreamEncryption($loop ?: Loop::get()); - $this->context = $context; - - $that = $this; - $this->tcp->on('connection', function ($connection) use ($that) { - $that->handleConnection($connection); - }); - $this->tcp->on('error', function ($error) use ($that) { - $that->emit('error', array($error)); - }); - } - - public function getAddress() - { - $address = $this->tcp->getAddress(); - if ($address === null) { - return null; - } - - return \str_replace('tcp://' , 'tls://', $address); - } - - public function pause() - { - $this->tcp->pause(); - } - - public function resume() - { - $this->tcp->resume(); - } - - public function close() - { - return $this->tcp->close(); - } - - /** @internal */ - public function handleConnection(ConnectionInterface $connection) - { - if (!$connection instanceof Connection) { - $this->emit('error', array(new \UnexpectedValueException('Base server does not use internal Connection class exposing stream resource'))); - $connection->close(); - return; - } - - foreach ($this->context as $name => $value) { - \stream_context_set_option($connection->stream, 'ssl', $name, $value); - } - - // get remote address before starting TLS handshake in case connection closes during handshake - $remote = $connection->getRemoteAddress(); - $that = $this; - - $this->encryption->enable($connection)->then( - function ($conn) use ($that) { - $that->emit('connection', array($conn)); - }, - function ($error) use ($that, $connection, $remote) { - $error = new \RuntimeException( - 'Connection from ' . $remote . ' failed during TLS handshake: ' . $error->getMessage(), - $error->getCode() - ); - - $that->emit('error', array($error)); - $connection->close(); - } - ); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/Server.php b/tools/php-cs-fixer/vendor/react/socket/src/Server.php deleted file mode 100644 index b24c5564..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/Server.php +++ /dev/null @@ -1,118 +0,0 @@ - $context); - } - - // apply default options if not explicitly given - $context += array( - 'tcp' => array(), - 'tls' => array(), - 'unix' => array() - ); - - $scheme = 'tcp'; - $pos = \strpos($uri, '://'); - if ($pos !== false) { - $scheme = \substr($uri, 0, $pos); - } - - if ($scheme === 'unix') { - $server = new UnixServer($uri, $loop, $context['unix']); - } else { - $server = new TcpServer(str_replace('tls://', '', $uri), $loop, $context['tcp']); - - if ($scheme === 'tls') { - $server = new SecureServer($server, $loop, $context['tls']); - } - } - - $this->server = $server; - - $that = $this; - $server->on('connection', function (ConnectionInterface $conn) use ($that) { - $that->emit('connection', array($conn)); - }); - $server->on('error', function (Exception $error) use ($that) { - $that->emit('error', array($error)); - }); - } - - public function getAddress() - { - return $this->server->getAddress(); - } - - public function pause() - { - $this->server->pause(); - } - - public function resume() - { - $this->server->resume(); - } - - public function close() - { - $this->server->close(); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/ServerInterface.php b/tools/php-cs-fixer/vendor/react/socket/src/ServerInterface.php deleted file mode 100644 index aa79fa17..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/ServerInterface.php +++ /dev/null @@ -1,151 +0,0 @@ -on('connection', function (React\Socket\ConnectionInterface $connection) { - * echo 'new connection' . PHP_EOL; - * }); - * ``` - * - * See also the `ConnectionInterface` for more details about handling the - * incoming connection. - * - * error event: - * The `error` event will be emitted whenever there's an error accepting a new - * connection from a client. - * - * ```php - * $socket->on('error', function (Exception $e) { - * echo 'error: ' . $e->getMessage() . PHP_EOL; - * }); - * ``` - * - * Note that this is not a fatal error event, i.e. the server keeps listening for - * new connections even after this event. - * - * @see ConnectionInterface - */ -interface ServerInterface extends EventEmitterInterface -{ - /** - * Returns the full address (URI) this server is currently listening on - * - * ```php - * $address = $socket->getAddress(); - * echo 'Server listening on ' . $address . PHP_EOL; - * ``` - * - * If the address can not be determined or is unknown at this time (such as - * after the socket has been closed), it MAY return a `NULL` value instead. - * - * Otherwise, it will return the full address (URI) as a string value, such - * as `tcp://127.0.0.1:8080`, `tcp://[::1]:80` or `tls://127.0.0.1:443`. - * Note that individual URI components are application specific and depend - * on the underlying transport protocol. - * - * If this is a TCP/IP based server and you only want the local port, you may - * use something like this: - * - * ```php - * $address = $socket->getAddress(); - * $port = parse_url($address, PHP_URL_PORT); - * echo 'Server listening on port ' . $port . PHP_EOL; - * ``` - * - * @return ?string the full listening address (URI) or NULL if it is unknown (not applicable to this server socket or already closed) - */ - public function getAddress(); - - /** - * Pauses accepting new incoming connections. - * - * Removes the socket resource from the EventLoop and thus stop accepting - * new connections. Note that the listening socket stays active and is not - * closed. - * - * This means that new incoming connections will stay pending in the - * operating system backlog until its configurable backlog is filled. - * Once the backlog is filled, the operating system may reject further - * incoming connections until the backlog is drained again by resuming - * to accept new connections. - * - * Once the server is paused, no futher `connection` events SHOULD - * be emitted. - * - * ```php - * $socket->pause(); - * - * $socket->on('connection', assertShouldNeverCalled()); - * ``` - * - * This method is advisory-only, though generally not recommended, the - * server MAY continue emitting `connection` events. - * - * Unless otherwise noted, a successfully opened server SHOULD NOT start - * in paused state. - * - * You can continue processing events by calling `resume()` again. - * - * Note that both methods can be called any number of times, in particular - * calling `pause()` more than once SHOULD NOT have any effect. - * Similarly, calling this after `close()` is a NO-OP. - * - * @see self::resume() - * @return void - */ - public function pause(); - - /** - * Resumes accepting new incoming connections. - * - * Re-attach the socket resource to the EventLoop after a previous `pause()`. - * - * ```php - * $socket->pause(); - * - * Loop::addTimer(1.0, function () use ($socket) { - * $socket->resume(); - * }); - * ``` - * - * Note that both methods can be called any number of times, in particular - * calling `resume()` without a prior `pause()` SHOULD NOT have any effect. - * Similarly, calling this after `close()` is a NO-OP. - * - * @see self::pause() - * @return void - */ - public function resume(); - - /** - * Shuts down this listening socket - * - * This will stop listening for new incoming connections on this socket. - * - * Calling this method more than once on the same instance is a NO-OP. - * - * @return void - */ - public function close(); -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/SocketServer.php b/tools/php-cs-fixer/vendor/react/socket/src/SocketServer.php deleted file mode 100644 index e987f5f6..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/SocketServer.php +++ /dev/null @@ -1,215 +0,0 @@ - array(), - 'tls' => array(), - 'unix' => array() - ); - - $scheme = 'tcp'; - $pos = \strpos($uri, '://'); - if ($pos !== false) { - $scheme = \substr($uri, 0, $pos); - } - - if ($scheme === 'unix') { - $server = new UnixServer($uri, $loop, $context['unix']); - } elseif ($scheme === 'php') { - $server = new FdServer($uri, $loop); - } else { - if (preg_match('#^(?:\w+://)?\d+$#', $uri)) { - throw new \InvalidArgumentException( - 'Invalid URI given (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - ); - } - - $server = new TcpServer(str_replace('tls://', '', $uri), $loop, $context['tcp']); - - if ($scheme === 'tls') { - $server = new SecureServer($server, $loop, $context['tls']); - } - } - - $this->server = $server; - - $that = $this; - $server->on('connection', function (ConnectionInterface $conn) use ($that) { - $that->emit('connection', array($conn)); - }); - $server->on('error', function (\Exception $error) use ($that) { - $that->emit('error', array($error)); - }); - } - - public function getAddress() - { - return $this->server->getAddress(); - } - - public function pause() - { - $this->server->pause(); - } - - public function resume() - { - $this->server->resume(); - } - - public function close() - { - $this->server->close(); - } - - /** - * [internal] Internal helper method to accept new connection from given server socket - * - * @param resource $socket server socket to accept connection from - * @return resource new client socket if any - * @throws \RuntimeException if accepting fails - * @internal - */ - public static function accept($socket) - { - $errno = 0; - $errstr = ''; - \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { - // Match errstr from PHP's warning message. - // stream_socket_accept(): accept failed: Connection timed out - $errstr = \preg_replace('#.*: #', '', $error); - $errno = SocketServer::errno($errstr); - }); - - $newSocket = \stream_socket_accept($socket, 0); - - \restore_error_handler(); - - if (false === $newSocket) { - throw new \RuntimeException( - 'Unable to accept new connection: ' . $errstr . self::errconst($errno), - $errno - ); - } - - return $newSocket; - } - - /** - * [Internal] Returns errno value for given errstr - * - * The errno and errstr values describes the type of error that has been - * encountered. This method tries to look up the given errstr and find a - * matching errno value which can be useful to provide more context to error - * messages. It goes through the list of known errno constants when either - * `ext-sockets`, `ext-posix` or `ext-pcntl` is available to find an errno - * matching the given errstr. - * - * @param string $errstr - * @return int errno value (e.g. value of `SOCKET_ECONNREFUSED`) or 0 if not found - * @internal - * @copyright Copyright (c) 2023 Christian Lück, taken from https://github.com/clue/errno with permission - * @codeCoverageIgnore - */ - public static function errno($errstr) - { - // PHP defines the required `strerror()` function through either `ext-sockets`, `ext-posix` or `ext-pcntl` - $strerror = \function_exists('socket_strerror') ? 'socket_strerror' : (\function_exists('posix_strerror') ? 'posix_strerror' : (\function_exists('pcntl_strerror') ? 'pcntl_strerror' : null)); - if ($strerror !== null) { - assert(\is_string($strerror) && \is_callable($strerror)); - - // PHP defines most useful errno constants like `ECONNREFUSED` through constants in `ext-sockets` like `SOCKET_ECONNREFUSED` - // PHP also defines a hand full of errno constants like `EMFILE` through constants in `ext-pcntl` like `PCNTL_EMFILE` - // go through list of all defined constants like `SOCKET_E*` and `PCNTL_E*` and see if they match the given `$errstr` - foreach (\get_defined_constants(false) as $name => $value) { - if (\is_int($value) && (\strpos($name, 'SOCKET_E') === 0 || \strpos($name, 'PCNTL_E') === 0) && $strerror($value) === $errstr) { - return $value; - } - } - - // if we reach this, no matching errno constant could be found (unlikely when `ext-sockets` is available) - // go through list of all possible errno values from 1 to `MAX_ERRNO` and see if they match the given `$errstr` - for ($errno = 1, $max = \defined('MAX_ERRNO') ? \MAX_ERRNO : 4095; $errno <= $max; ++$errno) { - if ($strerror($errno) === $errstr) { - return $errno; - } - } - } - - // if we reach this, no matching errno value could be found (unlikely when either `ext-sockets`, `ext-posix` or `ext-pcntl` is available) - return 0; - } - - /** - * [Internal] Returns errno constant name for given errno value - * - * The errno value describes the type of error that has been encountered. - * This method tries to look up the given errno value and find a matching - * errno constant name which can be useful to provide more context and more - * descriptive error messages. It goes through the list of known errno - * constants when either `ext-sockets` or `ext-pcntl` is available to find - * the matching errno constant name. - * - * Because this method is used to append more context to error messages, the - * constant name will be prefixed with a space and put between parenthesis - * when found. - * - * @param int $errno - * @return string e.g. ` (ECONNREFUSED)` or empty string if no matching const for the given errno could be found - * @internal - * @copyright Copyright (c) 2023 Christian Lück, taken from https://github.com/clue/errno with permission - * @codeCoverageIgnore - */ - public static function errconst($errno) - { - // PHP defines most useful errno constants like `ECONNREFUSED` through constants in `ext-sockets` like `SOCKET_ECONNREFUSED` - // PHP also defines a hand full of errno constants like `EMFILE` through constants in `ext-pcntl` like `PCNTL_EMFILE` - // go through list of all defined constants like `SOCKET_E*` and `PCNTL_E*` and see if they match the given `$errno` - foreach (\get_defined_constants(false) as $name => $value) { - if ($value === $errno && (\strpos($name, 'SOCKET_E') === 0 || \strpos($name, 'PCNTL_E') === 0)) { - return ' (' . \substr($name, \strpos($name, '_') + 1) . ')'; - } - } - - // if we reach this, no matching errno constant could be found (unlikely when `ext-sockets` is available) - return ''; - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/StreamEncryption.php b/tools/php-cs-fixer/vendor/react/socket/src/StreamEncryption.php deleted file mode 100644 index f91a3597..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/StreamEncryption.php +++ /dev/null @@ -1,158 +0,0 @@ -loop = $loop; - $this->server = $server; - - // support TLSv1.0+ by default and exclude legacy SSLv2/SSLv3. - // As of PHP 7.2+ the main crypto method constant includes all TLS versions. - // As of PHP 5.6+ the crypto method is a bitmask, so we explicitly include all TLS versions. - // For legacy PHP < 5.6 the crypto method is a single value only and this constant includes all TLS versions. - // @link https://3v4l.org/9PSST - if ($server) { - $this->method = \STREAM_CRYPTO_METHOD_TLS_SERVER; - - if (\PHP_VERSION_ID < 70200 && \PHP_VERSION_ID >= 50600) { - $this->method |= \STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | \STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | \STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; // @codeCoverageIgnore - } - } else { - $this->method = \STREAM_CRYPTO_METHOD_TLS_CLIENT; - - if (\PHP_VERSION_ID < 70200 && \PHP_VERSION_ID >= 50600) { - $this->method |= \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; // @codeCoverageIgnore - } - } - } - - /** - * @param Connection $stream - * @return \React\Promise\PromiseInterface - */ - public function enable(Connection $stream) - { - return $this->toggle($stream, true); - } - - /** - * @param Connection $stream - * @param bool $toggle - * @return \React\Promise\PromiseInterface - */ - public function toggle(Connection $stream, $toggle) - { - // pause actual stream instance to continue operation on raw stream socket - $stream->pause(); - - // TODO: add write() event to make sure we're not sending any excessive data - - // cancelling this leaves this stream in an inconsistent state… - $deferred = new Deferred(function () { - throw new \RuntimeException(); - }); - - // get actual stream socket from stream instance - $socket = $stream->stream; - - // get crypto method from context options or use global setting from constructor - $method = $this->method; - $context = \stream_context_get_options($socket); - if (isset($context['ssl']['crypto_method'])) { - $method = $context['ssl']['crypto_method']; - } - - $that = $this; - $toggleCrypto = function () use ($socket, $deferred, $toggle, $method, $that) { - $that->toggleCrypto($socket, $deferred, $toggle, $method); - }; - - $this->loop->addReadStream($socket, $toggleCrypto); - - if (!$this->server) { - $toggleCrypto(); - } - - $loop = $this->loop; - - return $deferred->promise()->then(function () use ($stream, $socket, $loop, $toggle) { - $loop->removeReadStream($socket); - - $stream->encryptionEnabled = $toggle; - $stream->resume(); - - return $stream; - }, function($error) use ($stream, $socket, $loop) { - $loop->removeReadStream($socket); - $stream->resume(); - throw $error; - }); - } - - /** - * @internal - * @param resource $socket - * @param Deferred $deferred - * @param bool $toggle - * @param int $method - * @return void - */ - public function toggleCrypto($socket, Deferred $deferred, $toggle, $method) - { - $error = null; - \set_error_handler(function ($_, $errstr) use (&$error) { - $error = \str_replace(array("\r", "\n"), ' ', $errstr); - - // remove useless function name from error message - if (($pos = \strpos($error, "): ")) !== false) { - $error = \substr($error, $pos + 3); - } - }); - - $result = \stream_socket_enable_crypto($socket, $toggle, $method); - - \restore_error_handler(); - - if (true === $result) { - $deferred->resolve(null); - } else if (false === $result) { - // overwrite callback arguments for PHP7+ only, so they do not show - // up in the Exception trace and do not cause a possible cyclic reference. - $d = $deferred; - $deferred = null; - - if (\feof($socket) || $error === null) { - // EOF or failed without error => connection closed during handshake - $d->reject(new \UnexpectedValueException( - 'Connection lost during TLS handshake (ECONNRESET)', - \defined('SOCKET_ECONNRESET') ? \SOCKET_ECONNRESET : 104 - )); - } else { - // handshake failed with error message - $d->reject(new \UnexpectedValueException( - $error - )); - } - } else { - // need more data, will retry - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/TcpConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/TcpConnector.php deleted file mode 100644 index 9d2599e8..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/TcpConnector.php +++ /dev/null @@ -1,173 +0,0 @@ -loop = $loop ?: Loop::get(); - $this->context = $context; - } - - public function connect($uri) - { - if (\strpos($uri, '://') === false) { - $uri = 'tcp://' . $uri; - } - - $parts = \parse_url($uri); - if (!$parts || !isset($parts['scheme'], $parts['host'], $parts['port']) || $parts['scheme'] !== 'tcp') { - return Promise\reject(new \InvalidArgumentException( - 'Given URI "' . $uri . '" is invalid (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - )); - } - - $ip = \trim($parts['host'], '[]'); - if (@\inet_pton($ip) === false) { - return Promise\reject(new \InvalidArgumentException( - 'Given URI "' . $uri . '" does not contain a valid host IP (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - )); - } - - // use context given in constructor - $context = array( - 'socket' => $this->context - ); - - // parse arguments from query component of URI - $args = array(); - if (isset($parts['query'])) { - \parse_str($parts['query'], $args); - } - - // If an original hostname has been given, use this for TLS setup. - // This can happen due to layers of nested connectors, such as a - // DnsConnector reporting its original hostname. - // These context options are here in case TLS is enabled later on this stream. - // If TLS is not enabled later, this doesn't hurt either. - if (isset($args['hostname'])) { - $context['ssl'] = array( - 'SNI_enabled' => true, - 'peer_name' => $args['hostname'] - ); - - // Legacy PHP < 5.6 ignores peer_name and requires legacy context options instead. - // The SNI_server_name context option has to be set here during construction, - // as legacy PHP ignores any values set later. - // @codeCoverageIgnoreStart - if (\PHP_VERSION_ID < 50600) { - $context['ssl'] += array( - 'SNI_server_name' => $args['hostname'], - 'CN_match' => $args['hostname'] - ); - } - // @codeCoverageIgnoreEnd - } - - // latest versions of PHP no longer accept any other URI components and - // HHVM fails to parse URIs with a query but no path, so let's simplify our URI here - $remote = 'tcp://' . $parts['host'] . ':' . $parts['port']; - - $stream = @\stream_socket_client( - $remote, - $errno, - $errstr, - 0, - \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT, - \stream_context_create($context) - ); - - if (false === $stream) { - return Promise\reject(new \RuntimeException( - 'Connection to ' . $uri . ' failed: ' . $errstr . SocketServer::errconst($errno), - $errno - )); - } - - // wait for connection - $loop = $this->loop; - return new Promise\Promise(function ($resolve, $reject) use ($loop, $stream, $uri) { - $loop->addWriteStream($stream, function ($stream) use ($loop, $resolve, $reject, $uri) { - $loop->removeWriteStream($stream); - - // The following hack looks like the only way to - // detect connection refused errors with PHP's stream sockets. - if (false === \stream_socket_get_name($stream, true)) { - // If we reach this point, we know the connection is dead, but we don't know the underlying error condition. - // @codeCoverageIgnoreStart - if (\function_exists('socket_import_stream')) { - // actual socket errno and errstr can be retrieved with ext-sockets on PHP 5.4+ - $socket = \socket_import_stream($stream); - $errno = \socket_get_option($socket, \SOL_SOCKET, \SO_ERROR); - $errstr = \socket_strerror($errno); - } elseif (\PHP_OS === 'Linux') { - // Linux reports socket errno and errstr again when trying to write to the dead socket. - // Suppress error reporting to get error message below and close dead socket before rejecting. - // This is only known to work on Linux, Mac and Windows are known to not support this. - $errno = 0; - $errstr = ''; - \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { - // Match errstr from PHP's warning message. - // fwrite(): send of 1 bytes failed with errno=111 Connection refused - \preg_match('/errno=(\d+) (.+)/', $error, $m); - $errno = isset($m[1]) ? (int) $m[1] : 0; - $errstr = isset($m[2]) ? $m[2] : $error; - }); - - \fwrite($stream, \PHP_EOL); - - \restore_error_handler(); - } else { - // Not on Linux and ext-sockets not available? Too bad. - $errno = \defined('SOCKET_ECONNREFUSED') ? \SOCKET_ECONNREFUSED : 111; - $errstr = 'Connection refused?'; - } - // @codeCoverageIgnoreEnd - - \fclose($stream); - $reject(new \RuntimeException( - 'Connection to ' . $uri . ' failed: ' . $errstr . SocketServer::errconst($errno), - $errno - )); - } else { - $resolve(new Connection($stream, $loop)); - } - }); - }, function () use ($loop, $stream, $uri) { - $loop->removeWriteStream($stream); - \fclose($stream); - - // @codeCoverageIgnoreStart - // legacy PHP 5.3 sometimes requires a second close call (see tests) - if (\PHP_VERSION_ID < 50400 && \is_resource($stream)) { - \fclose($stream); - } - // @codeCoverageIgnoreEnd - - throw new \RuntimeException( - 'Connection to ' . $uri . ' cancelled during TCP/IP handshake (ECONNABORTED)', - \defined('SOCKET_ECONNABORTED') ? \SOCKET_ECONNABORTED : 103 - ); - }); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/TcpServer.php b/tools/php-cs-fixer/vendor/react/socket/src/TcpServer.php deleted file mode 100644 index 01b2b46d..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/TcpServer.php +++ /dev/null @@ -1,262 +0,0 @@ -on('connection', function (React\Socket\ConnectionInterface $connection) { - * echo 'Plaintext connection from ' . $connection->getRemoteAddress() . PHP_EOL; - * $connection->write('hello there!' . PHP_EOL); - * … - * }); - * ``` - * - * See also the `ServerInterface` for more details. - * - * @see ServerInterface - * @see ConnectionInterface - */ -final class TcpServer extends EventEmitter implements ServerInterface -{ - private $master; - private $loop; - private $listening = false; - - /** - * Creates a plaintext TCP/IP socket server and starts listening on the given address - * - * This starts accepting new incoming connections on the given address. - * See also the `connection event` documented in the `ServerInterface` - * for more details. - * - * ```php - * $server = new React\Socket\TcpServer(8080); - * ``` - * - * As above, the `$uri` parameter can consist of only a port, in which case the - * server will default to listening on the localhost address `127.0.0.1`, - * which means it will not be reachable from outside of this system. - * - * In order to use a random port assignment, you can use the port `0`: - * - * ```php - * $server = new React\Socket\TcpServer(0); - * $address = $server->getAddress(); - * ``` - * - * In order to change the host the socket is listening on, you can provide an IP - * address through the first parameter provided to the constructor, optionally - * preceded by the `tcp://` scheme: - * - * ```php - * $server = new React\Socket\TcpServer('192.168.0.1:8080'); - * ``` - * - * If you want to listen on an IPv6 address, you MUST enclose the host in square - * brackets: - * - * ```php - * $server = new React\Socket\TcpServer('[::1]:8080'); - * ``` - * - * If the given URI is invalid, does not contain a port, any other scheme or if it - * contains a hostname, it will throw an `InvalidArgumentException`: - * - * ```php - * // throws InvalidArgumentException due to missing port - * $server = new React\Socket\TcpServer('127.0.0.1'); - * ``` - * - * If the given URI appears to be valid, but listening on it fails (such as if port - * is already in use or port below 1024 may require root access etc.), it will - * throw a `RuntimeException`: - * - * ```php - * $first = new React\Socket\TcpServer(8080); - * - * // throws RuntimeException because port is already in use - * $second = new React\Socket\TcpServer(8080); - * ``` - * - * Note that these error conditions may vary depending on your system and/or - * configuration. - * See the exception message and code for more details about the actual error - * condition. - * - * This class takes an optional `LoopInterface|null $loop` parameter that can be used to - * pass the event loop instance to use for this object. You can use a `null` value - * here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). - * This value SHOULD NOT be given unless you're sure you want to explicitly use a - * given event loop instance. - * - * Optionally, you can specify [socket context options](https://www.php.net/manual/en/context.socket.php) - * for the underlying stream socket resource like this: - * - * ```php - * $server = new React\Socket\TcpServer('[::1]:8080', null, array( - * 'backlog' => 200, - * 'so_reuseport' => true, - * 'ipv6_v6only' => true - * )); - * ``` - * - * Note that available [socket context options](https://www.php.net/manual/en/context.socket.php), - * their defaults and effects of changing these may vary depending on your system - * and/or PHP version. - * Passing unknown context options has no effect. - * The `backlog` context option defaults to `511` unless given explicitly. - * - * @param string|int $uri - * @param ?LoopInterface $loop - * @param array $context - * @throws InvalidArgumentException if the listening address is invalid - * @throws RuntimeException if listening on this address fails (already in use etc.) - */ - public function __construct($uri, $loop = null, array $context = array()) - { - if ($loop !== null && !$loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1 - throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\EventLoop\LoopInterface'); - } - - $this->loop = $loop ?: Loop::get(); - - // a single port has been given => assume localhost - if ((string)(int)$uri === (string)$uri) { - $uri = '127.0.0.1:' . $uri; - } - - // assume default scheme if none has been given - if (\strpos($uri, '://') === false) { - $uri = 'tcp://' . $uri; - } - - // parse_url() does not accept null ports (random port assignment) => manually remove - if (\substr($uri, -2) === ':0') { - $parts = \parse_url(\substr($uri, 0, -2)); - if ($parts) { - $parts['port'] = 0; - } - } else { - $parts = \parse_url($uri); - } - - // ensure URI contains TCP scheme, host and port - if (!$parts || !isset($parts['scheme'], $parts['host'], $parts['port']) || $parts['scheme'] !== 'tcp') { - throw new \InvalidArgumentException( - 'Invalid URI "' . $uri . '" given (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - ); - } - - if (@\inet_pton(\trim($parts['host'], '[]')) === false) { - throw new \InvalidArgumentException( - 'Given URI "' . $uri . '" does not contain a valid host IP (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - ); - } - - $this->master = @\stream_socket_server( - $uri, - $errno, - $errstr, - \STREAM_SERVER_BIND | \STREAM_SERVER_LISTEN, - \stream_context_create(array('socket' => $context + array('backlog' => 511))) - ); - if (false === $this->master) { - if ($errno === 0) { - // PHP does not seem to report errno, so match errno from errstr - // @link https://3v4l.org/3qOBl - $errno = SocketServer::errno($errstr); - } - - throw new \RuntimeException( - 'Failed to listen on "' . $uri . '": ' . $errstr . SocketServer::errconst($errno), - $errno - ); - } - \stream_set_blocking($this->master, false); - - $this->resume(); - } - - public function getAddress() - { - if (!\is_resource($this->master)) { - return null; - } - - $address = \stream_socket_get_name($this->master, false); - - // check if this is an IPv6 address which includes multiple colons but no square brackets - $pos = \strrpos($address, ':'); - if ($pos !== false && \strpos($address, ':') < $pos && \substr($address, 0, 1) !== '[') { - $address = '[' . \substr($address, 0, $pos) . ']:' . \substr($address, $pos + 1); // @codeCoverageIgnore - } - - return 'tcp://' . $address; - } - - public function pause() - { - if (!$this->listening) { - return; - } - - $this->loop->removeReadStream($this->master); - $this->listening = false; - } - - public function resume() - { - if ($this->listening || !\is_resource($this->master)) { - return; - } - - $that = $this; - $this->loop->addReadStream($this->master, function ($master) use ($that) { - try { - $newSocket = SocketServer::accept($master); - } catch (\RuntimeException $e) { - $that->emit('error', array($e)); - return; - } - $that->handleConnection($newSocket); - }); - $this->listening = true; - } - - public function close() - { - if (!\is_resource($this->master)) { - return; - } - - $this->pause(); - \fclose($this->master); - $this->removeAllListeners(); - } - - /** @internal */ - public function handleConnection($socket) - { - $this->emit('connection', array( - new Connection($socket, $this->loop) - )); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/TimeoutConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/TimeoutConnector.php deleted file mode 100644 index 9ef252f7..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/TimeoutConnector.php +++ /dev/null @@ -1,79 +0,0 @@ -connector = $connector; - $this->timeout = $timeout; - $this->loop = $loop ?: Loop::get(); - } - - public function connect($uri) - { - $promise = $this->connector->connect($uri); - - $loop = $this->loop; - $time = $this->timeout; - return new Promise(function ($resolve, $reject) use ($loop, $time, $promise, $uri) { - $timer = null; - $promise = $promise->then(function ($v) use (&$timer, $loop, $resolve) { - if ($timer) { - $loop->cancelTimer($timer); - } - $timer = false; - $resolve($v); - }, function ($v) use (&$timer, $loop, $reject) { - if ($timer) { - $loop->cancelTimer($timer); - } - $timer = false; - $reject($v); - }); - - // promise already resolved => no need to start timer - if ($timer === false) { - return; - } - - // start timeout timer which will cancel the pending promise - $timer = $loop->addTimer($time, function () use ($time, &$promise, $reject, $uri) { - $reject(new \RuntimeException( - 'Connection to ' . $uri . ' timed out after ' . $time . ' seconds (ETIMEDOUT)', - \defined('SOCKET_ETIMEDOUT') ? \SOCKET_ETIMEDOUT : 110 - )); - - // Cancel pending connection to clean up any underlying resources and references. - // Avoid garbage references in call stack by passing pending promise by reference. - assert(\method_exists($promise, 'cancel')); - $promise->cancel(); - $promise = null; - }); - }, function () use (&$promise) { - // Cancelling this promise will cancel the pending connection, thus triggering the rejection logic above. - // Avoid garbage references in call stack by passing pending promise by reference. - assert(\method_exists($promise, 'cancel')); - $promise->cancel(); - $promise = null; - }); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/UnixConnector.php b/tools/php-cs-fixer/vendor/react/socket/src/UnixConnector.php deleted file mode 100644 index 95f932cb..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/UnixConnector.php +++ /dev/null @@ -1,58 +0,0 @@ -loop = $loop ?: Loop::get(); - } - - public function connect($path) - { - if (\strpos($path, '://') === false) { - $path = 'unix://' . $path; - } elseif (\substr($path, 0, 7) !== 'unix://') { - return Promise\reject(new \InvalidArgumentException( - 'Given URI "' . $path . '" is invalid (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - )); - } - - $resource = @\stream_socket_client($path, $errno, $errstr, 1.0); - - if (!$resource) { - return Promise\reject(new \RuntimeException( - 'Unable to connect to unix domain socket "' . $path . '": ' . $errstr . SocketServer::errconst($errno), - $errno - )); - } - - $connection = new Connection($resource, $this->loop); - $connection->unix = true; - - return Promise\resolve($connection); - } -} diff --git a/tools/php-cs-fixer/vendor/react/socket/src/UnixServer.php b/tools/php-cs-fixer/vendor/react/socket/src/UnixServer.php deleted file mode 100644 index 27b014d1..00000000 --- a/tools/php-cs-fixer/vendor/react/socket/src/UnixServer.php +++ /dev/null @@ -1,162 +0,0 @@ -loop = $loop ?: Loop::get(); - - if (\strpos($path, '://') === false) { - $path = 'unix://' . $path; - } elseif (\substr($path, 0, 7) !== 'unix://') { - throw new \InvalidArgumentException( - 'Given URI "' . $path . '" is invalid (EINVAL)', - \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22) - ); - } - - $errno = 0; - $errstr = ''; - \set_error_handler(function ($_, $error) use (&$errno, &$errstr) { - // PHP does not seem to report errno/errstr for Unix domain sockets (UDS) right now. - // This only applies to UDS server sockets, see also https://3v4l.org/NAhpr. - // Parse PHP warning message containing unknown error, HHVM reports proper info at least. - if (\preg_match('/\(([^\)]+)\)|\[(\d+)\]: (.*)/', $error, $match)) { - $errstr = isset($match[3]) ? $match['3'] : $match[1]; - $errno = isset($match[2]) ? (int)$match[2] : 0; - } - }); - - $this->master = \stream_socket_server( - $path, - $errno, - $errstr, - \STREAM_SERVER_BIND | \STREAM_SERVER_LISTEN, - \stream_context_create(array('socket' => $context)) - ); - - \restore_error_handler(); - - if (false === $this->master) { - throw new \RuntimeException( - 'Failed to listen on Unix domain socket "' . $path . '": ' . $errstr . SocketServer::errconst($errno), - $errno - ); - } - \stream_set_blocking($this->master, 0); - - $this->resume(); - } - - public function getAddress() - { - if (!\is_resource($this->master)) { - return null; - } - - return 'unix://' . \stream_socket_get_name($this->master, false); - } - - public function pause() - { - if (!$this->listening) { - return; - } - - $this->loop->removeReadStream($this->master); - $this->listening = false; - } - - public function resume() - { - if ($this->listening || !is_resource($this->master)) { - return; - } - - $that = $this; - $this->loop->addReadStream($this->master, function ($master) use ($that) { - try { - $newSocket = SocketServer::accept($master); - } catch (\RuntimeException $e) { - $that->emit('error', array($e)); - return; - } - $that->handleConnection($newSocket); - }); - $this->listening = true; - } - - public function close() - { - if (!\is_resource($this->master)) { - return; - } - - $this->pause(); - \fclose($this->master); - $this->removeAllListeners(); - } - - /** @internal */ - public function handleConnection($socket) - { - $connection = new Connection($socket, $this->loop); - $connection->unix = true; - - $this->emit('connection', array( - $connection - )); - } -} diff --git a/tools/php-cs-fixer/vendor/react/stream/CHANGELOG.md b/tools/php-cs-fixer/vendor/react/stream/CHANGELOG.md deleted file mode 100644 index 639db658..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/CHANGELOG.md +++ /dev/null @@ -1,460 +0,0 @@ -# Changelog - -## 1.4.0 (2024-06-11) - -* Feature: Improve PHP 8.4+ support by avoiding implicitly nullable type declarations. - (#179 by @clue) - -* Feature: Full PHP 8.3 compatibility. - (#172 by @clue) - -* Fix: Fix `drain` event of `ThroughStream` to handle potential race condition. - (#171 by @clue) - -## 1.3.0 (2023-06-16) - -* Feature: Full PHP 8.1 and PHP 8.2 compatibility. - (#160 by @SimonFrings, #165 by @clue and #169 by @WyriHaximus) - -* Feature: Avoid unneeded syscall when creating non-blocking `DuplexResourceStream`. - (#164 by @clue) - -* Minor documentation improvements. - (#161 by @mrsimonbennett, #162 by @SimonFrings and #166 by @nhedger) - -* Improve test suite and project setup and report failed assertions. - (#168 and #170 by @clue and #163 by @SimonFrings) - -## 1.2.0 (2021-07-11) - -A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). - -* Feature: Simplify usage by supporting new [default loop](https://reactphp.org/event-loop/#loop). - (#159 by @clue) - - ```php - // old (still supported) - $stream = new ReadableResourceStream($resource, $loop); - $stream = new WritabeResourceStream($resource, $loop); - $stream = new DuplexResourceStream($resource, $loop); - - // new (using default loop) - $stream = new ReadableResourceStream($resource); - $stream = new WritabeResourceStream($resource); - $stream = new DuplexResourceStream($resource); - ``` - -* Improve test suite, use GitHub actions for continuous integration (CI), - update PHPUnit config, run tests on PHP 8 and add full core team to the license. - (#153, #156 and #157 by @SimonFrings and #154 by @WyriHaximus) - -## 1.1.1 (2020-05-04) - -* Fix: Fix faulty write buffer behavior when sending large data chunks over TLS (Mac OS X only). - (#150 by @clue) - -* Minor code style improvements to fix phpstan analysis warnings and - add `.gitattributes` to exclude dev files from exports. - (#140 by @flow-control and #144 by @reedy) - -* Improve test suite to run tests on PHP 7.4 and simplify test matrix. - (#147 by @clue) - -## 1.1.0 (2019-01-01) - -* Improvement: Increase performance by optimizing global function and constant look ups. - (#137 by @WyriHaximus) - -* Travis: Test against PHP 7.3. - (#138 by @WyriHaximus) - -* Fix: Ignore empty reads. - (#139 by @WyriHaximus) - -## 1.0.0 (2018-07-11) - -* First stable LTS release, now following [SemVer](https://semver.org/). - We'd like to emphasize that this component is production ready and battle-tested. - We plan to support all long-term support (LTS) releases for at least 24 months, - so you have a rock-solid foundation to build on top of. - -> Contains no other changes, so it's actually fully compatible with the v0.7.7 release. - -## 0.7.7 (2018-01-19) - -* Improve test suite by fixing forward compatibility with upcoming EventLoop - releases, avoid risky tests and add test group to skip integration tests - relying on internet connection and apply appropriate test timeouts. - (#128, #131 and #132 by @clue) - -## 0.7.6 (2017-12-21) - -* Fix: Work around reading from unbuffered pipe stream in legacy PHP < 5.4.28 and PHP < 5.5.12 - (#126 by @clue) - -* Improve test suite by simplifying test bootstrapping logic via Composer and - test against PHP 7.2 - (#127 by @clue and #124 by @carusogabriel) - -## 0.7.5 (2017-11-20) - -* Fix: Igore excessive `fopen()` mode flags for `WritableResourceStream` - (#119 by @clue) - -* Fix: Fix forward compatibility with upcoming EventLoop releases - (#121 by @clue) - -* Restructure examples to ease getting started - (#123 by @clue) - -* Improve test suite by adding forward compatibility with PHPUnit 6 and - ignore Mac OS X test failures for now until Travis tests work again - (#122 by @gabriel-caruso and #120 by @clue) - -## 0.7.4 (2017-10-11) - -* Fix: Remove event listeners from `CompositeStream` once closed and - remove undocumented left-over `close` event argument - (#116 by @clue) - -* Minor documentation improvements: Fix wrong class name in example, - fix typos in README and - fix forward compatibility with upcoming EventLoop releases in example - (#113 by @docteurklein and #114 and #115 by @clue) - -* Improve test suite by running against Mac OS X on Travis - (#112 by @clue) - -## 0.7.3 (2017-08-05) - -* Improvement: Support Événement 3.0 a long side 2.0 and 1.0 - (#108 by @WyriHaximus) - -* Readme: Corrected loop initialization in usage example - (#109 by @pulyavin) - -* Travis: Lock linux distribution preventing future builds from breaking - (#110 by @clue) - -## 0.7.2 (2017-06-15) - -* Bug fix: WritableResourceStream: Close the underlying stream when closing the stream. - (#107 by @WyriHaximus) - -## 0.7.1 (2017-05-20) - -* Feature: Add optional `$writeChunkSize` parameter to limit maximum number of - bytes to write at once. - (#105 by @clue) - - ```php - $stream = new WritableResourceStream(STDOUT, $loop, null, 8192); - ``` - -* Ignore HHVM test failures for now until Travis tests work again - (#106 by @clue) - -## 0.7.0 (2017-05-04) - -* Removed / BC break: Remove deprecated and unneeded functionality - (#45, #87, #90, #91 and #93 by @clue) - - * Remove deprecated `Stream` class, use `DuplexResourceStream` instead - (#87 by @clue) - - * Remove public `$buffer` property, use new constructor parameters instead - (#91 by @clue) - - * Remove public `$stream` property from all resource streams - (#90 by @clue) - - * Remove undocumented and now unused `ReadableStream` and `WritableStream` - (#93 by @clue) - - * Remove `BufferedSink` - (#45 by @clue) - -* Feature / BC break: Simplify `ThroughStream` by using data callback instead of - inheritance. It is now a direct implementation of `DuplexStreamInterface`. - (#88 and #89 by @clue) - - ```php - $through = new ThroughStream(function ($data) { - return json_encode($data) . PHP_EOL; - }); - $through->on('data', $this->expectCallableOnceWith("[2, true]\n")); - - $through->write(array(2, true)); - ``` - -* Feature / BC break: The `CompositeStream` starts closed if either side is - already closed and forwards pause to pipe source on first write attempt. - (#96 and #103 by @clue) - - If either side of the composite stream closes, it will also close the other - side. We now also ensure that if either side is already closed during - instantiation, it will also close the other side. - -* BC break: Mark all classes as `final` and - mark internal API as `private` to discourage inheritance - (#95 and #99 by @clue) - -* Feature / BC break: Only emit `error` event for fatal errors - (#92 by @clue) - - > The `error` event was previously also allowed to be emitted for non-fatal - errors, but our implementations actually only ever emitted this as a fatal - error and then closed the stream. - -* Feature: Explicitly allow custom events and exclude any semantics - (#97 by @clue) - -* Strict definition for event callback functions - (#101 by @clue) - -* Support legacy PHP 5.3 through PHP 7.1 and HHVM and improve usage documentation - (#100 and #102 by @clue) - -* Actually require all dependencies so this is self-contained and improve - forward compatibility with EventLoop v1.0 and v0.5 - (#94 and #98 by @clue) - -## 0.6.0 (2017-03-26) - -* Feature / Fix / BC break: Add `DuplexResourceStream` and deprecate `Stream` - (#85 by @clue) - - ```php - // old (does still work for BC reasons) - $stream = new Stream($connection, $loop); - - // new - $stream = new DuplexResourceStream($connection, $loop); - ``` - - Note that the `DuplexResourceStream` now rejects read-only or write-only - streams, so this may affect BC. If you want a read-only or write-only - resource, use `ReadableResourceStream` or `WritableResourceStream` instead of - `DuplexResourceStream`. - - > BC note: This class was previously called `Stream`. The `Stream` class still - exists for BC reasons and will be removed in future versions of this package. - -* Feature / BC break: Add `WritableResourceStream` (previously called `Buffer`) - (#84 by @clue) - - ```php - // old - $stream = new Buffer(STDOUT, $loop); - - // new - $stream = new WritableResourceStream(STDOUT, $loop); - ``` - -* Feature: Add `ReadableResourceStream` - (#83 by @clue) - - ```php - $stream = new ReadableResourceStream(STDIN, $loop); - ``` - -* Fix / BC Break: Enforce using non-blocking I/O - (#46 by @clue) - - > BC note: This is known to affect process pipes on Windows which do not - support non-blocking I/O and could thus block the whole EventLoop previously. - -* Feature / Fix / BC break: Consistent semantics for - `DuplexStreamInterface::end()` to ensure it SHOULD also end readable side - (#86 by @clue) - -* Fix: Do not use unbuffered reads on pipe streams for legacy PHP < 5.4 - (#80 by @clue) - -## 0.5.0 (2017-03-08) - -* Feature / BC break: Consistent `end` event semantics (EOF) - (#70 by @clue) - - The `end` event will now only be emitted for a *successful* end, not if the - stream closes due to an unrecoverable `error` event or if you call `close()` - explicitly. - If you want to detect when the stream closes (terminates), use the `close` - event instead. - -* BC break: Remove custom (undocumented) `full-drain` event from `Buffer` - (#63 and #68 by @clue) - - > The `full-drain` event was undocumented and mostly used internally. - Relying on this event has attracted some low-quality code in the past, so - we've removed this from the public API in order to work out a better - solution instead. - If you want to detect when the buffer finishes flushing data to the stream, - you may want to look into its `end()` method or the `close` event instead. - -* Feature / BC break: Consistent event semantics and documentation, - explicitly state *when* events will be emitted and *which* arguments they - receive. - (#73 and #69 by @clue) - - The documentation now explicitly defines each event and its arguments. - Custom events and event arguments are still supported. - Most notably, all defined events only receive inherently required event - arguments and no longer transmit the instance they are emitted on for - consistency and performance reasons. - - ```php - // old (inconsistent and not supported by all implementations) - $stream->on('data', function ($data, $stream) { - // process $data - }); - - // new (consistent throughout the whole ecosystem) - $stream->on('data', function ($data) use ($stream) { - // process $data - }); - ``` - - > This mostly adds documentation (and thus some stricter, consistent - definitions) for the existing behavior, it does NOT define any major - changes otherwise. - Most existing code should be compatible with these changes, unless - it relied on some undocumented/unintended semantics. - -* Feature / BC break: Consistent method semantics and documentation - (#72 by @clue) - - > This mostly adds documentation (and thus some stricter, consistent - definitions) for the existing behavior, it does NOT define any major - changes otherwise. - Most existing code should be compatible with these changes, unless - it relied on some undocumented/unintended semantics. - -* Feature: Consistent `pipe()` semantics for closed and closing streams - (#71 from @clue) - - The source stream will now always be paused via `pause()` when the - destination stream closes. Also, properly stop piping if the source - stream closes and remove all event forwarding. - -* Improve test suite by adding PHPUnit to `require-dev` and improving coverage. - (#74 and #75 by @clue, #66 by @nawarian) - -## 0.4.6 (2017-01-25) - -* Feature: The `Buffer` can now be injected into the `Stream` (or be used standalone) - (#62 by @clue) - -* Fix: Forward `close` event only once for `CompositeStream` and `ThroughStream` - (#60 by @clue) - -* Fix: Consistent `close` event behavior for `Buffer` - (#61 by @clue) - -## 0.4.5 (2016-11-13) - -* Feature: Support setting read buffer size to `null` (infinite) - (#42 by @clue) - -* Fix: Do not emit `full-drain` event if `Buffer` is closed during `drain` event - (#55 by @clue) - -* Vastly improved performance by factor of 10x to 20x. - Raise default buffer sizes to 64 KiB and simplify and improve error handling - and unneeded function calls. - (#53, #55, #56 by @clue) - -## 0.4.4 (2016-08-22) - -* Bug fix: Emit `error` event and close `Stream` when accessing the underlying - stream resource fails with a permanent error. - (#52 and #40 by @clue, #25 by @lysenkobv) - -* Bug fix: Do not emit empty `data` event if nothing has been read (stream reached EOF) - (#39 by @clue) - -* Bug fix: Ignore empty writes to `Buffer` - (#51 by @clue) - -* Add benchmarking script to measure throughput in CI - (#41 by @clue) - -## 0.4.3 (2015-10-07) - -* Bug fix: Read buffer to 0 fixes error with libevent and large quantity of I/O (@mbonneau) -* Bug fix: No double-write during drain call (@arnaud-lb) -* Bug fix: Support HHVM (@clue) -* Adjust compatibility to 5.3 (@clue) - -## 0.4.2 (2014-09-09) - -* Added DuplexStreamInterface -* Stream sets stream resources to non-blocking -* Fixed potential race condition in pipe - -## 0.4.1 (2014-04-13) - -* Bug fix: v0.3.4 changes merged for v0.4.1 - -## 0.3.4 (2014-03-30) - -* Bug fix: [Stream] Fixed 100% CPU spike from non-empty write buffer on closed stream - -## 0.4.0 (2014-02-02) - -* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks -* BC break: Update to Evenement 2.0 -* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0 - -## 0.3.3 (2013-07-08) - -* Bug fix: [Stream] Correctly detect closed connections - -## 0.3.2 (2013-05-10) - -* Bug fix: [Stream] Make sure CompositeStream is closed properly - -## 0.3.1 (2013-04-21) - -* Bug fix: [Stream] Allow any `ReadableStreamInterface` on `BufferedSink::createPromise()` - -## 0.3.0 (2013-04-14) - -* Feature: [Stream] Factory method for BufferedSink - -## 0.2.6 (2012-12-26) - -* Version bump - -## 0.2.5 (2012-11-26) - -* Feature: Make BufferedSink trigger progress events on the promise (@jsor) - -## 0.2.4 (2012-11-18) - -* Feature: Added ThroughStream, CompositeStream, ReadableStream and WritableStream -* Feature: Added BufferedSink - -## 0.2.3 (2012-11-14) - -* Version bump - -## 0.2.2 (2012-10-28) - -* Version bump - -## 0.2.1 (2012-10-14) - -* Bug fix: Check for EOF in `Buffer::write()` - -## 0.2.0 (2012-09-10) - -* Version bump - -## 0.1.1 (2012-07-12) - -* Bug fix: Testing and functional against PHP >= 5.3.3 and <= 5.3.8 - -## 0.1.0 (2012-07-11) - -* First tagged release diff --git a/tools/php-cs-fixer/vendor/react/stream/LICENSE b/tools/php-cs-fixer/vendor/react/stream/LICENSE deleted file mode 100644 index d6f8901f..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012 Christian Lück, Cees-Jan Kiewiet, Jan Sorgalla, Chris Boden, Igor Wiedler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/react/stream/README.md b/tools/php-cs-fixer/vendor/react/stream/README.md deleted file mode 100644 index 9c0468a6..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/README.md +++ /dev/null @@ -1,1249 +0,0 @@ -# Stream - -[![CI status](https://github.com/reactphp/stream/actions/workflows/ci.yml/badge.svg)](https://github.com/reactphp/stream/actions) -[![installs on Packagist](https://img.shields.io/packagist/dt/react/stream?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/stream) - -Event-driven readable and writable streams for non-blocking I/O in [ReactPHP](https://reactphp.org/). - -In order to make the [EventLoop](https://github.com/reactphp/event-loop) -easier to use, this component introduces the powerful concept of "streams". -Streams allow you to efficiently process huge amounts of data (such as a multi -Gigabyte file download) in small chunks without having to store everything in -memory at once. -They are very similar to the streams found in PHP itself, -but have an interface more suited for async, non-blocking I/O. - -**Table of contents** - -* [Stream usage](#stream-usage) - * [ReadableStreamInterface](#readablestreaminterface) - * [data event](#data-event) - * [end event](#end-event) - * [error event](#error-event) - * [close event](#close-event) - * [isReadable()](#isreadable) - * [pause()](#pause) - * [resume()](#resume) - * [pipe()](#pipe) - * [close()](#close) - * [WritableStreamInterface](#writablestreaminterface) - * [drain event](#drain-event) - * [pipe event](#pipe-event) - * [error event](#error-event-1) - * [close event](#close-event-1) - * [isWritable()](#iswritable) - * [write()](#write) - * [end()](#end) - * [close()](#close-1) - * [DuplexStreamInterface](#duplexstreaminterface) -* [Creating streams](#creating-streams) - * [ReadableResourceStream](#readableresourcestream) - * [WritableResourceStream](#writableresourcestream) - * [DuplexResourceStream](#duplexresourcestream) - * [ThroughStream](#throughstream) - * [CompositeStream](#compositestream) -* [Usage](#usage) -* [Install](#install) -* [Tests](#tests) -* [License](#license) -* [More](#more) - -## Stream usage - -ReactPHP uses the concept of "streams" throughout its ecosystem to provide a -consistent higher-level abstraction for processing streams of arbitrary data -contents and size. -While a stream itself is a quite low-level concept, it can be used as a powerful -abstraction to build higher-level components and protocols on top. - -If you're new to this concept, it helps to think of them as a water pipe: -You can consume water from a source or you can produce water and forward (pipe) -it to any destination (sink). - -Similarly, streams can either be - -* readable (such as `STDIN` terminal input) or -* writable (such as `STDOUT` terminal output) or -* duplex (both readable *and* writable, such as a TCP/IP connection) - -Accordingly, this package defines the following three interfaces - -* [`ReadableStreamInterface`](#readablestreaminterface) -* [`WritableStreamInterface`](#writablestreaminterface) -* [`DuplexStreamInterface`](#duplexstreaminterface) - -### ReadableStreamInterface - -The `ReadableStreamInterface` is responsible for providing an interface for -read-only streams and the readable side of duplex streams. - -Besides defining a few methods, this interface also implements the -`EventEmitterInterface` which allows you to react to certain events. - -The event callback functions MUST be a valid `callable` that obeys strict -parameter definitions and MUST accept event parameters exactly as documented. -The event callback functions MUST NOT throw an `Exception`. -The return value of the event callback functions will be ignored and has no -effect, so for performance reasons you're recommended to not return any -excessive data structures. - -Every implementation of this interface MUST follow these event semantics in -order to be considered a well-behaving stream. - -> Note that higher-level implementations of this interface may choose to - define additional events with dedicated semantics not defined as part of - this low-level stream specification. Conformance with these event semantics - is out of scope for this interface, so you may also have to refer to the - documentation of such a higher-level implementation. - -#### data event - -The `data` event will be emitted whenever some data was read/received -from this source stream. -The event receives a single mixed argument for incoming data. - -```php -$stream->on('data', function ($data) { - echo $data; -}); -``` - -This event MAY be emitted any number of times, which may be zero times if -this stream does not send any data at all. -It SHOULD not be emitted after an `end` or `close` event. - -The given `$data` argument may be of mixed type, but it's usually -recommended it SHOULD be a `string` value or MAY use a type that allows -representation as a `string` for maximum compatibility. - -Many common streams (such as a TCP/IP connection or a file-based stream) -will emit the raw (binary) payload data that is received over the wire as -chunks of `string` values. - -Due to the stream-based nature of this, the sender may send any number -of chunks with varying sizes. There are no guarantees that these chunks -will be received with the exact same framing the sender intended to send. -In other words, many lower-level protocols (such as TCP/IP) transfer the -data in chunks that may be anywhere between single-byte values to several -dozens of kilobytes. You may want to apply a higher-level protocol to -these low-level data chunks in order to achieve proper message framing. - -#### end event - -The `end` event will be emitted once the source stream has successfully -reached the end of the stream (EOF). - -```php -$stream->on('end', function () { - echo 'END'; -}); -``` - -This event SHOULD be emitted once or never at all, depending on whether -a successful end was detected. -It SHOULD NOT be emitted after a previous `end` or `close` event. -It MUST NOT be emitted if the stream closes due to a non-successful -end, such as after a previous `error` event. - -After the stream is ended, it MUST switch to non-readable mode, -see also `isReadable()`. - -This event will only be emitted if the *end* was reached successfully, -not if the stream was interrupted by an unrecoverable error or explicitly -closed. Not all streams know this concept of a "successful end". -Many use-cases involve detecting when the stream closes (terminates) -instead, in this case you should use the `close` event. -After the stream emits an `end` event, it SHOULD usually be followed by a -`close` event. - -Many common streams (such as a TCP/IP connection or a file-based stream) -will emit this event if either the remote side closes the connection or -a file handle was successfully read until reaching its end (EOF). - -Note that this event should not be confused with the `end()` method. -This event defines a successful end *reading* from a source stream, while -the `end()` method defines *writing* a successful end to a destination -stream. - -#### error event - -The `error` event will be emitted once a fatal error occurs, usually while -trying to read from this stream. -The event receives a single `Exception` argument for the error instance. - -```php -$server->on('error', function (Exception $e) { - echo 'Error: ' . $e->getMessage() . PHP_EOL; -}); -``` - -This event SHOULD be emitted once the stream detects a fatal error, such -as a fatal transmission error or after an unexpected `data` or premature -`end` event. -It SHOULD NOT be emitted after a previous `error`, `end` or `close` event. -It MUST NOT be emitted if this is not a fatal error condition, such as -a temporary network issue that did not cause any data to be lost. - -After the stream errors, it MUST close the stream and SHOULD thus be -followed by a `close` event and then switch to non-readable mode, see -also `close()` and `isReadable()`. - -Many common streams (such as a TCP/IP connection or a file-based stream) -only deal with data transmission and do not make assumption about data -boundaries (such as unexpected `data` or premature `end` events). -In other words, many lower-level protocols (such as TCP/IP) may choose -to only emit this for a fatal transmission error once and will then -close (terminate) the stream in response. - -If this stream is a `DuplexStreamInterface`, you should also notice -how the writable side of the stream also implements an `error` event. -In other words, an error may occur while either reading or writing the -stream which should result in the same error processing. - -#### close event - -The `close` event will be emitted once the stream closes (terminates). - -```php -$stream->on('close', function () { - echo 'CLOSED'; -}); -``` - -This event SHOULD be emitted once or never at all, depending on whether -the stream ever terminates. -It SHOULD NOT be emitted after a previous `close` event. - -After the stream is closed, it MUST switch to non-readable mode, -see also `isReadable()`. - -Unlike the `end` event, this event SHOULD be emitted whenever the stream -closes, irrespective of whether this happens implicitly due to an -unrecoverable error or explicitly when either side closes the stream. -If you only want to detect a *successful* end, you should use the `end` -event instead. - -Many common streams (such as a TCP/IP connection or a file-based stream) -will likely choose to emit this event after reading a *successful* `end` -event or after a fatal transmission `error` event. - -If this stream is a `DuplexStreamInterface`, you should also notice -how the writable side of the stream also implements a `close` event. -In other words, after receiving this event, the stream MUST switch into -non-writable AND non-readable mode, see also `isWritable()`. -Note that this event should not be confused with the `end` event. - -#### isReadable() - -The `isReadable(): bool` method can be used to -check whether this stream is in a readable state (not closed already). - -This method can be used to check if the stream still accepts incoming -data events or if it is ended or closed already. -Once the stream is non-readable, no further `data` or `end` events SHOULD -be emitted. - -```php -assert($stream->isReadable() === false); - -$stream->on('data', assertNeverCalled()); -$stream->on('end', assertNeverCalled()); -``` - -A successfully opened stream always MUST start in readable mode. - -Once the stream ends or closes, it MUST switch to non-readable mode. -This can happen any time, explicitly through `close()` or -implicitly due to a remote close or an unrecoverable transmission error. -Once a stream has switched to non-readable mode, it MUST NOT transition -back to readable mode. - -If this stream is a `DuplexStreamInterface`, you should also notice -how the writable side of the stream also implements an `isWritable()` -method. Unless this is a half-open duplex stream, they SHOULD usually -have the same return value. - -#### pause() - -The `pause(): void` method can be used to -pause reading incoming data events. - -Removes the data source file descriptor from the event loop. This -allows you to throttle incoming data. - -Unless otherwise noted, a successfully opened stream SHOULD NOT start -in paused state. - -Once the stream is paused, no futher `data` or `end` events SHOULD -be emitted. - -```php -$stream->pause(); - -$stream->on('data', assertShouldNeverCalled()); -$stream->on('end', assertShouldNeverCalled()); -``` - -This method is advisory-only, though generally not recommended, the -stream MAY continue emitting `data` events. - -You can continue processing events by calling `resume()` again. - -Note that both methods can be called any number of times, in particular -calling `pause()` more than once SHOULD NOT have any effect. - -See also `resume()`. - -#### resume() - -The `resume(): void` method can be used to -resume reading incoming data events. - -Re-attach the data source after a previous `pause()`. - -```php -$stream->pause(); - -Loop::addTimer(1.0, function () use ($stream) { - $stream->resume(); -}); -``` - -Note that both methods can be called any number of times, in particular -calling `resume()` without a prior `pause()` SHOULD NOT have any effect. - -See also `pause()`. - -#### pipe() - -The `pipe(WritableStreamInterface $dest, array $options = [])` method can be used to -pipe all the data from this readable source into the given writable destination. - -Automatically sends all incoming data to the destination. -Automatically throttles the source based on what the destination can handle. - -```php -$source->pipe($dest); -``` - -Similarly, you can also pipe an instance implementing `DuplexStreamInterface` -into itself in order to write back all the data that is received. -This may be a useful feature for a TCP/IP echo service: - -```php -$connection->pipe($connection); -``` - -This method returns the destination stream as-is, which can be used to -set up chains of piped streams: - -```php -$source->pipe($decodeGzip)->pipe($filterBadWords)->pipe($dest); -``` - -By default, this will call `end()` on the destination stream once the -source stream emits an `end` event. This can be disabled like this: - -```php -$source->pipe($dest, array('end' => false)); -``` - -Note that this only applies to the `end` event. -If an `error` or explicit `close` event happens on the source stream, -you'll have to manually close the destination stream: - -```php -$source->pipe($dest); -$source->on('close', function () use ($dest) { - $dest->end('BYE!'); -}); -``` - -If the source stream is not readable (closed state), then this is a NO-OP. - -```php -$source->close(); -$source->pipe($dest); // NO-OP -``` - -If the destinantion stream is not writable (closed state), then this will simply -throttle (pause) the source stream: - -```php -$dest->close(); -$source->pipe($dest); // calls $source->pause() -``` - -Similarly, if the destination stream is closed while the pipe is still -active, it will also throttle (pause) the source stream: - -```php -$source->pipe($dest); -$dest->close(); // calls $source->pause() -``` - -Once the pipe is set up successfully, the destination stream MUST emit -a `pipe` event with this source stream an event argument. - -#### close() - -The `close(): void` method can be used to -close the stream (forcefully). - -This method can be used to (forcefully) close the stream. - -```php -$stream->close(); -``` - -Once the stream is closed, it SHOULD emit a `close` event. -Note that this event SHOULD NOT be emitted more than once, in particular -if this method is called multiple times. - -After calling this method, the stream MUST switch into a non-readable -mode, see also `isReadable()`. -This means that no further `data` or `end` events SHOULD be emitted. - -```php -$stream->close(); -assert($stream->isReadable() === false); - -$stream->on('data', assertNeverCalled()); -$stream->on('end', assertNeverCalled()); -``` - -If this stream is a `DuplexStreamInterface`, you should also notice -how the writable side of the stream also implements a `close()` method. -In other words, after calling this method, the stream MUST switch into -non-writable AND non-readable mode, see also `isWritable()`. -Note that this method should not be confused with the `end()` method. - -### WritableStreamInterface - -The `WritableStreamInterface` is responsible for providing an interface for -write-only streams and the writable side of duplex streams. - -Besides defining a few methods, this interface also implements the -`EventEmitterInterface` which allows you to react to certain events. - -The event callback functions MUST be a valid `callable` that obeys strict -parameter definitions and MUST accept event parameters exactly as documented. -The event callback functions MUST NOT throw an `Exception`. -The return value of the event callback functions will be ignored and has no -effect, so for performance reasons you're recommended to not return any -excessive data structures. - -Every implementation of this interface MUST follow these event semantics in -order to be considered a well-behaving stream. - -> Note that higher-level implementations of this interface may choose to - define additional events with dedicated semantics not defined as part of - this low-level stream specification. Conformance with these event semantics - is out of scope for this interface, so you may also have to refer to the - documentation of such a higher-level implementation. - -#### drain event - -The `drain` event will be emitted whenever the write buffer became full -previously and is now ready to accept more data. - -```php -$stream->on('drain', function () use ($stream) { - echo 'Stream is now ready to accept more data'; -}); -``` - -This event SHOULD be emitted once every time the buffer became full -previously and is now ready to accept more data. -In other words, this event MAY be emitted any number of times, which may -be zero times if the buffer never became full in the first place. -This event SHOULD NOT be emitted if the buffer has not become full -previously. - -This event is mostly used internally, see also `write()` for more details. - -#### pipe event - -The `pipe` event will be emitted whenever a readable stream is `pipe()`d -into this stream. -The event receives a single `ReadableStreamInterface` argument for the -source stream. - -```php -$stream->on('pipe', function (ReadableStreamInterface $source) use ($stream) { - echo 'Now receiving piped data'; - - // explicitly close target if source emits an error - $source->on('error', function () use ($stream) { - $stream->close(); - }); -}); - -$source->pipe($stream); -``` - -This event MUST be emitted once for each readable stream that is -successfully piped into this destination stream. -In other words, this event MAY be emitted any number of times, which may -be zero times if no stream is ever piped into this stream. -This event MUST NOT be emitted if either the source is not readable -(closed already) or this destination is not writable (closed already). - -This event is mostly used internally, see also `pipe()` for more details. - -#### error event - -The `error` event will be emitted once a fatal error occurs, usually while -trying to write to this stream. -The event receives a single `Exception` argument for the error instance. - -```php -$stream->on('error', function (Exception $e) { - echo 'Error: ' . $e->getMessage() . PHP_EOL; -}); -``` - -This event SHOULD be emitted once the stream detects a fatal error, such -as a fatal transmission error. -It SHOULD NOT be emitted after a previous `error` or `close` event. -It MUST NOT be emitted if this is not a fatal error condition, such as -a temporary network issue that did not cause any data to be lost. - -After the stream errors, it MUST close the stream and SHOULD thus be -followed by a `close` event and then switch to non-writable mode, see -also `close()` and `isWritable()`. - -Many common streams (such as a TCP/IP connection or a file-based stream) -only deal with data transmission and may choose -to only emit this for a fatal transmission error once and will then -close (terminate) the stream in response. - -If this stream is a `DuplexStreamInterface`, you should also notice -how the readable side of the stream also implements an `error` event. -In other words, an error may occur while either reading or writing the -stream which should result in the same error processing. - -#### close event - -The `close` event will be emitted once the stream closes (terminates). - -```php -$stream->on('close', function () { - echo 'CLOSED'; -}); -``` - -This event SHOULD be emitted once or never at all, depending on whether -the stream ever terminates. -It SHOULD NOT be emitted after a previous `close` event. - -After the stream is closed, it MUST switch to non-writable mode, -see also `isWritable()`. - -This event SHOULD be emitted whenever the stream closes, irrespective of -whether this happens implicitly due to an unrecoverable error or -explicitly when either side closes the stream. - -Many common streams (such as a TCP/IP connection or a file-based stream) -will likely choose to emit this event after flushing the buffer from -the `end()` method, after receiving a *successful* `end` event or after -a fatal transmission `error` event. - -If this stream is a `DuplexStreamInterface`, you should also notice -how the readable side of the stream also implements a `close` event. -In other words, after receiving this event, the stream MUST switch into -non-writable AND non-readable mode, see also `isReadable()`. -Note that this event should not be confused with the `end` event. - -#### isWritable() - -The `isWritable(): bool` method can be used to -check whether this stream is in a writable state (not closed already). - -This method can be used to check if the stream still accepts writing -any data or if it is ended or closed already. -Writing any data to a non-writable stream is a NO-OP: - -```php -assert($stream->isWritable() === false); - -$stream->write('end'); // NO-OP -$stream->end('end'); // NO-OP -``` - -A successfully opened stream always MUST start in writable mode. - -Once the stream ends or closes, it MUST switch to non-writable mode. -This can happen any time, explicitly through `end()` or `close()` or -implicitly due to a remote close or an unrecoverable transmission error. -Once a stream has switched to non-writable mode, it MUST NOT transition -back to writable mode. - -If this stream is a `DuplexStreamInterface`, you should also notice -how the readable side of the stream also implements an `isReadable()` -method. Unless this is a half-open duplex stream, they SHOULD usually -have the same return value. - -#### write() - -The `write(mixed $data): bool` method can be used to -write some data into the stream. - -A successful write MUST be confirmed with a boolean `true`, which means -that either the data was written (flushed) immediately or is buffered and -scheduled for a future write. Note that this interface gives you no -control over explicitly flushing the buffered data, as finding the -appropriate time for this is beyond the scope of this interface and left -up to the implementation of this interface. - -Many common streams (such as a TCP/IP connection or file-based stream) -may choose to buffer all given data and schedule a future flush by using -an underlying EventLoop to check when the resource is actually writable. - -If a stream cannot handle writing (or flushing) the data, it SHOULD emit -an `error` event and MAY `close()` the stream if it can not recover from -this error. - -If the internal buffer is full after adding `$data`, then `write()` -SHOULD return `false`, indicating that the caller should stop sending -data until the buffer drains. -The stream SHOULD send a `drain` event once the buffer is ready to accept -more data. - -Similarly, if the stream is not writable (already in a closed state) -it MUST NOT process the given `$data` and SHOULD return `false`, -indicating that the caller should stop sending data. - -The given `$data` argument MAY be of mixed type, but it's usually -recommended it SHOULD be a `string` value or MAY use a type that allows -representation as a `string` for maximum compatibility. - -Many common streams (such as a TCP/IP connection or a file-based stream) -will only accept the raw (binary) payload data that is transferred over -the wire as chunks of `string` values. - -Due to the stream-based nature of this, the sender may send any number -of chunks with varying sizes. There are no guarantees that these chunks -will be received with the exact same framing the sender intended to send. -In other words, many lower-level protocols (such as TCP/IP) transfer the -data in chunks that may be anywhere between single-byte values to several -dozens of kilobytes. You may want to apply a higher-level protocol to -these low-level data chunks in order to achieve proper message framing. - -#### end() - -The `end(mixed $data = null): void` method can be used to -successfully end the stream (after optionally sending some final data). - -This method can be used to successfully end the stream, i.e. close -the stream after sending out all data that is currently buffered. - -```php -$stream->write('hello'); -$stream->write('world'); -$stream->end(); -``` - -If there's no data currently buffered and nothing to be flushed, then -this method MAY `close()` the stream immediately. - -If there's still data in the buffer that needs to be flushed first, then -this method SHOULD try to write out this data and only then `close()` -the stream. -Once the stream is closed, it SHOULD emit a `close` event. - -Note that this interface gives you no control over explicitly flushing -the buffered data, as finding the appropriate time for this is beyond the -scope of this interface and left up to the implementation of this -interface. - -Many common streams (such as a TCP/IP connection or file-based stream) -may choose to buffer all given data and schedule a future flush by using -an underlying EventLoop to check when the resource is actually writable. - -You can optionally pass some final data that is written to the stream -before ending the stream. If a non-`null` value is given as `$data`, then -this method will behave just like calling `write($data)` before ending -with no data. - -```php -// shorter version -$stream->end('bye'); - -// same as longer version -$stream->write('bye'); -$stream->end(); -``` - -After calling this method, the stream MUST switch into a non-writable -mode, see also `isWritable()`. -This means that no further writes are possible, so any additional -`write()` or `end()` calls have no effect. - -```php -$stream->end(); -assert($stream->isWritable() === false); - -$stream->write('nope'); // NO-OP -$stream->end(); // NO-OP -``` - -If this stream is a `DuplexStreamInterface`, calling this method SHOULD -also end its readable side, unless the stream supports half-open mode. -In other words, after calling this method, these streams SHOULD switch -into non-writable AND non-readable mode, see also `isReadable()`. -This implies that in this case, the stream SHOULD NOT emit any `data` -or `end` events anymore. -Streams MAY choose to use the `pause()` method logic for this, but -special care may have to be taken to ensure a following call to the -`resume()` method SHOULD NOT continue emitting readable events. - -Note that this method should not be confused with the `close()` method. - -#### close() - -The `close(): void` method can be used to -close the stream (forcefully). - -This method can be used to forcefully close the stream, i.e. close -the stream without waiting for any buffered data to be flushed. -If there's still data in the buffer, this data SHOULD be discarded. - -```php -$stream->close(); -``` - -Once the stream is closed, it SHOULD emit a `close` event. -Note that this event SHOULD NOT be emitted more than once, in particular -if this method is called multiple times. - -After calling this method, the stream MUST switch into a non-writable -mode, see also `isWritable()`. -This means that no further writes are possible, so any additional -`write()` or `end()` calls have no effect. - -```php -$stream->close(); -assert($stream->isWritable() === false); - -$stream->write('nope'); // NO-OP -$stream->end(); // NO-OP -``` - -Note that this method should not be confused with the `end()` method. -Unlike the `end()` method, this method does not take care of any existing -buffers and simply discards any buffer contents. -Likewise, this method may also be called after calling `end()` on a -stream in order to stop waiting for the stream to flush its final data. - -```php -$stream->end(); -Loop::addTimer(1.0, function () use ($stream) { - $stream->close(); -}); -``` - -If this stream is a `DuplexStreamInterface`, you should also notice -how the readable side of the stream also implements a `close()` method. -In other words, after calling this method, the stream MUST switch into -non-writable AND non-readable mode, see also `isReadable()`. - -### DuplexStreamInterface - -The `DuplexStreamInterface` is responsible for providing an interface for -duplex streams (both readable and writable). - -It builds on top of the existing interfaces for readable and writable streams -and follows the exact same method and event semantics. -If you're new to this concept, you should look into the -`ReadableStreamInterface` and `WritableStreamInterface` first. - -Besides defining a few methods, this interface also implements the -`EventEmitterInterface` which allows you to react to the same events defined -on the `ReadbleStreamInterface` and `WritableStreamInterface`. - -The event callback functions MUST be a valid `callable` that obeys strict -parameter definitions and MUST accept event parameters exactly as documented. -The event callback functions MUST NOT throw an `Exception`. -The return value of the event callback functions will be ignored and has no -effect, so for performance reasons you're recommended to not return any -excessive data structures. - -Every implementation of this interface MUST follow these event semantics in -order to be considered a well-behaving stream. - -> Note that higher-level implementations of this interface may choose to - define additional events with dedicated semantics not defined as part of - this low-level stream specification. Conformance with these event semantics - is out of scope for this interface, so you may also have to refer to the - documentation of such a higher-level implementation. - -See also [`ReadableStreamInterface`](#readablestreaminterface) and -[`WritableStreamInterface`](#writablestreaminterface) for more details. - -## Creating streams - -ReactPHP uses the concept of "streams" throughout its ecosystem, so that -many higher-level consumers of this package only deal with -[stream usage](#stream-usage). -This implies that stream instances are most often created within some -higher-level components and many consumers never actually have to deal with -creating a stream instance. - -* Use [react/socket](https://github.com/reactphp/socket) - if you want to accept incoming or establish outgoing plaintext TCP/IP or - secure TLS socket connection streams. -* Use [react/http](https://github.com/reactphp/http) - if you want to receive an incoming HTTP request body streams. -* Use [react/child-process](https://github.com/reactphp/child-process) - if you want to communicate with child processes via process pipes such as - STDIN, STDOUT, STDERR etc. -* Use experimental [react/filesystem](https://github.com/reactphp/filesystem) - if you want to read from / write to the filesystem. -* See also the last chapter for [more real-world applications](#more). - -However, if you are writing a lower-level component or want to create a stream -instance from a stream resource, then the following chapter is for you. - -> Note that the following examples use `fopen()` and `stream_socket_client()` - for illustration purposes only. - These functions SHOULD NOT be used in a truly async program because each call - may take several seconds to complete and would block the EventLoop otherwise. - Additionally, the `fopen()` call will return a file handle on some platforms - which may or may not be supported by all EventLoop implementations. - As an alternative, you may want to use higher-level libraries listed above. - -### ReadableResourceStream - -The `ReadableResourceStream` is a concrete implementation of the -[`ReadableStreamInterface`](#readablestreaminterface) for PHP's stream resources. - -This can be used to represent a read-only resource like a file stream opened in -readable mode or a stream such as `STDIN`: - -```php -$stream = new ReadableResourceStream(STDIN); -$stream->on('data', function ($chunk) { - echo $chunk; -}); -$stream->on('end', function () { - echo 'END'; -}); -``` - -See also [`ReadableStreamInterface`](#readablestreaminterface) for more details. - -The first parameter given to the constructor MUST be a valid stream resource -that is opened in reading mode (e.g. `fopen()` mode `r`). -Otherwise, it will throw an `InvalidArgumentException`: - -```php -// throws InvalidArgumentException -$stream = new ReadableResourceStream(false); -``` - -See also the [`DuplexResourceStream`](#readableresourcestream) for read-and-write -stream resources otherwise. - -Internally, this class tries to enable non-blocking mode on the stream resource -which may not be supported for all stream resources. -Most notably, this is not supported by pipes on Windows (STDIN etc.). -If this fails, it will throw a `RuntimeException`: - -```php -// throws RuntimeException on Windows -$stream = new ReadableResourceStream(STDIN); -``` - -Once the constructor is called with a valid stream resource, this class will -take care of the underlying stream resource. -You SHOULD only use its public API and SHOULD NOT interfere with the underlying -stream resource manually. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -This class takes an optional `int|null $readChunkSize` parameter that controls -the maximum buffer size in bytes to read at once from the stream. -You can use a `null` value here in order to apply its default value. -This value SHOULD NOT be changed unless you know what you're doing. -This can be a positive number which means that up to X bytes will be read -at once from the underlying stream resource. Note that the actual number -of bytes read may be lower if the stream resource has less than X bytes -currently available. -This can be `-1` which means "read everything available" from the -underlying stream resource. -This should read until the stream resource is not readable anymore -(i.e. underlying buffer drained), note that this does not neccessarily -mean it reached EOF. - -```php -$stream = new ReadableResourceStream(STDIN, null, 8192); -``` - -> PHP bug warning: If the PHP process has explicitly been started without a - `STDIN` stream, then trying to read from `STDIN` may return data from - another stream resource. This does not happen if you start this with an empty - stream like `php test.php < /dev/null` instead of `php test.php <&-`. - See [#81](https://github.com/reactphp/stream/issues/81) for more details. - -> Changelog: As of v1.2.0 the `$loop` parameter can be omitted (or skipped with a - `null` value) to use the [default loop](https://github.com/reactphp/event-loop#loop). - -### WritableResourceStream - -The `WritableResourceStream` is a concrete implementation of the -[`WritableStreamInterface`](#writablestreaminterface) for PHP's stream resources. - -This can be used to represent a write-only resource like a file stream opened in -writable mode or a stream such as `STDOUT` or `STDERR`: - -```php -$stream = new WritableResourceStream(STDOUT); -$stream->write('hello!'); -$stream->end(); -``` - -See also [`WritableStreamInterface`](#writablestreaminterface) for more details. - -The first parameter given to the constructor MUST be a valid stream resource -that is opened for writing. -Otherwise, it will throw an `InvalidArgumentException`: - -```php -// throws InvalidArgumentException -$stream = new WritableResourceStream(false); -``` - -See also the [`DuplexResourceStream`](#readableresourcestream) for read-and-write -stream resources otherwise. - -Internally, this class tries to enable non-blocking mode on the stream resource -which may not be supported for all stream resources. -Most notably, this is not supported by pipes on Windows (STDOUT, STDERR etc.). -If this fails, it will throw a `RuntimeException`: - -```php -// throws RuntimeException on Windows -$stream = new WritableResourceStream(STDOUT); -``` - -Once the constructor is called with a valid stream resource, this class will -take care of the underlying stream resource. -You SHOULD only use its public API and SHOULD NOT interfere with the underlying -stream resource manually. - -Any `write()` calls to this class will not be performed instantly, but will -be performed asynchronously, once the EventLoop reports the stream resource is -ready to accept data. -For this, it uses an in-memory buffer string to collect all outstanding writes. -This buffer has a soft-limit applied which defines how much data it is willing -to accept before the caller SHOULD stop sending further data. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -This class takes an optional `int|null $writeBufferSoftLimit` parameter that controls -this maximum buffer size in bytes. -You can use a `null` value here in order to apply its default value. -This value SHOULD NOT be changed unless you know what you're doing. - -```php -$stream = new WritableResourceStream(STDOUT, null, 8192); -``` - -This class takes an optional `int|null $writeChunkSize` parameter that controls -this maximum buffer size in bytes to write at once to the stream. -You can use a `null` value here in order to apply its default value. -This value SHOULD NOT be changed unless you know what you're doing. -This can be a positive number which means that up to X bytes will be written -at once to the underlying stream resource. Note that the actual number -of bytes written may be lower if the stream resource has less than X bytes -currently available. -This can be `-1` which means "write everything available" to the -underlying stream resource. - -```php -$stream = new WritableResourceStream(STDOUT, null, null, 8192); -``` - -See also [`write()`](#write) for more details. - -> Changelog: As of v1.2.0 the `$loop` parameter can be omitted (or skipped with a - `null` value) to use the [default loop](https://github.com/reactphp/event-loop#loop). - -### DuplexResourceStream - -The `DuplexResourceStream` is a concrete implementation of the -[`DuplexStreamInterface`](#duplexstreaminterface) for PHP's stream resources. - -This can be used to represent a read-and-write resource like a file stream opened -in read and write mode mode or a stream such as a TCP/IP connection: - -```php -$conn = stream_socket_client('tcp://google.com:80'); -$stream = new DuplexResourceStream($conn); -$stream->write('hello!'); -$stream->end(); -``` - -See also [`DuplexStreamInterface`](#duplexstreaminterface) for more details. - -The first parameter given to the constructor MUST be a valid stream resource -that is opened for reading *and* writing. -Otherwise, it will throw an `InvalidArgumentException`: - -```php -// throws InvalidArgumentException -$stream = new DuplexResourceStream(false); -``` - -See also the [`ReadableResourceStream`](#readableresourcestream) for read-only -and the [`WritableResourceStream`](#writableresourcestream) for write-only -stream resources otherwise. - -Internally, this class tries to enable non-blocking mode on the stream resource -which may not be supported for all stream resources. -Most notably, this is not supported by pipes on Windows (STDOUT, STDERR etc.). -If this fails, it will throw a `RuntimeException`: - -```php -// throws RuntimeException on Windows -$stream = new DuplexResourceStream(STDOUT); -``` - -Once the constructor is called with a valid stream resource, this class will -take care of the underlying stream resource. -You SHOULD only use its public API and SHOULD NOT interfere with the underlying -stream resource manually. - -This class takes an optional `LoopInterface|null $loop` parameter that can be used to -pass the event loop instance to use for this object. You can use a `null` value -here in order to use the [default loop](https://github.com/reactphp/event-loop#loop). -This value SHOULD NOT be given unless you're sure you want to explicitly use a -given event loop instance. - -This class takes an optional `int|null $readChunkSize` parameter that controls -the maximum buffer size in bytes to read at once from the stream. -You can use a `null` value here in order to apply its default value. -This value SHOULD NOT be changed unless you know what you're doing. -This can be a positive number which means that up to X bytes will be read -at once from the underlying stream resource. Note that the actual number -of bytes read may be lower if the stream resource has less than X bytes -currently available. -This can be `-1` which means "read everything available" from the -underlying stream resource. -This should read until the stream resource is not readable anymore -(i.e. underlying buffer drained), note that this does not neccessarily -mean it reached EOF. - -```php -$conn = stream_socket_client('tcp://google.com:80'); -$stream = new DuplexResourceStream($conn, null, 8192); -``` - -Any `write()` calls to this class will not be performed instantly, but will -be performed asynchronously, once the EventLoop reports the stream resource is -ready to accept data. -For this, it uses an in-memory buffer string to collect all outstanding writes. -This buffer has a soft-limit applied which defines how much data it is willing -to accept before the caller SHOULD stop sending further data. - -This class takes another optional `WritableStreamInterface|null $buffer` parameter -that controls this write behavior of this stream. -You can use a `null` value here in order to apply its default value. -This value SHOULD NOT be changed unless you know what you're doing. - -If you want to change the write buffer soft limit, you can pass an instance of -[`WritableResourceStream`](#writableresourcestream) like this: - -```php -$conn = stream_socket_client('tcp://google.com:80'); -$buffer = new WritableResourceStream($conn, null, 8192); -$stream = new DuplexResourceStream($conn, null, null, $buffer); -``` - -See also [`WritableResourceStream`](#writableresourcestream) for more details. - -> Changelog: As of v1.2.0 the `$loop` parameter can be omitted (or skipped with a - `null` value) to use the [default loop](https://github.com/reactphp/event-loop#loop). - -### ThroughStream - -The `ThroughStream` implements the -[`DuplexStreamInterface`](#duplexstreaminterface) and will simply pass any data -you write to it through to its readable end. - -```php -$through = new ThroughStream(); -$through->on('data', $this->expectCallableOnceWith('hello')); - -$through->write('hello'); -``` - -Similarly, the [`end()` method](#end) will end the stream and emit an -[`end` event](#end-event) and then [`close()`](#close-1) the stream. -The [`close()` method](#close-1) will close the stream and emit a -[`close` event](#close-event). -Accordingly, this is can also be used in a [`pipe()`](#pipe) context like this: - -```php -$through = new ThroughStream(); -$source->pipe($through)->pipe($dest); -``` - -Optionally, its constructor accepts any callable function which will then be -used to *filter* any data written to it. This function receives a single data -argument as passed to the writable side and must return the data as it will be -passed to its readable end: - -```php -$through = new ThroughStream('strtoupper'); -$source->pipe($through)->pipe($dest); -``` - -Note that this class makes no assumptions about any data types. This can be -used to convert data, for example for transforming any structured data into -a newline-delimited JSON (NDJSON) stream like this: - -```php -$through = new ThroughStream(function ($data) { - return json_encode($data) . PHP_EOL; -}); -$through->on('data', $this->expectCallableOnceWith("[2, true]\n")); - -$through->write(array(2, true)); -``` - -The callback function is allowed to throw an `Exception`. In this case, -the stream will emit an `error` event and then [`close()`](#close-1) the stream. - -```php -$through = new ThroughStream(function ($data) { - if (!is_string($data)) { - throw new \UnexpectedValueException('Only strings allowed'); - } - return $data; -}); -$through->on('error', $this->expectCallableOnce())); -$through->on('close', $this->expectCallableOnce())); -$through->on('data', $this->expectCallableNever())); - -$through->write(2); -``` - -### CompositeStream - -The `CompositeStream` implements the -[`DuplexStreamInterface`](#duplexstreaminterface) and can be used to create a -single duplex stream from two individual streams implementing -[`ReadableStreamInterface`](#readablestreaminterface) and -[`WritableStreamInterface`](#writablestreaminterface) respectively. - -This is useful for some APIs which may require a single -[`DuplexStreamInterface`](#duplexstreaminterface) or simply because it's often -more convenient to work with a single stream instance like this: - -```php -$stdin = new ReadableResourceStream(STDIN); -$stdout = new WritableResourceStream(STDOUT); - -$stdio = new CompositeStream($stdin, $stdout); - -$stdio->on('data', function ($chunk) use ($stdio) { - $stdio->write('You said: ' . $chunk); -}); -``` - -This is a well-behaving stream which forwards all stream events from the -underlying streams and forwards all streams calls to the underlying streams. - -If you `write()` to the duplex stream, it will simply `write()` to the -writable side and return its status. - -If you `end()` the duplex stream, it will `end()` the writable side and will -`pause()` the readable side. - -If you `close()` the duplex stream, both input streams will be closed. -If either of the two input streams emits a `close` event, the duplex stream -will also close. -If either of the two input streams is already closed while constructing the -duplex stream, it will `close()` the other side and return a closed stream. - -## Usage - -The following example can be used to pipe the contents of a source file into -a destination file without having to ever read the whole file into memory: - -```php -$source = new React\Stream\ReadableResourceStream(fopen('source.txt', 'r')); -$dest = new React\Stream\WritableResourceStream(fopen('destination.txt', 'w')); - -$source->pipe($dest); -``` - -> Note that this example uses `fopen()` for illustration purposes only. - This should not be used in a truly async program because the filesystem is - inherently blocking and each call could potentially take several seconds. - See also [creating streams](#creating-streams) for more sophisticated - examples. - -## Install - -The recommended way to install this library is [through Composer](https://getcomposer.org). -[New to Composer?](https://getcomposer.org/doc/00-intro.md) - -This project follows [SemVer](https://semver.org/). -This will install the latest supported version: - -```bash -composer require react/stream:^1.4 -``` - -See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. - -This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.3 through current PHP 8+ and HHVM. -It's *highly recommended to use PHP 7+* for this project due to its vast -performance improvements. - -## Tests - -To run the test suite, you first need to clone this repo and then install all -dependencies [through Composer](https://getcomposer.org): - -```bash -composer install -``` - -To run the test suite, go to the project root and run: - -```bash -vendor/bin/phpunit -``` - -The test suite also contains a number of functional integration tests that rely -on a stable internet connection. -If you do not want to run these, they can simply be skipped like this: - -```bash -vendor/bin/phpunit --exclude-group internet -``` - -## License - -MIT, see [LICENSE file](LICENSE). - -## More - -* See [creating streams](#creating-streams) for more information on how streams - are created in real-world applications. -* See our [users wiki](https://github.com/reactphp/react/wiki/Users) and the - [dependents on Packagist](https://packagist.org/packages/react/stream/dependents) - for a list of packages that use streams in real-world applications. diff --git a/tools/php-cs-fixer/vendor/react/stream/composer.json b/tools/php-cs-fixer/vendor/react/stream/composer.json deleted file mode 100644 index 09d8b71e..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/composer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "react/stream", - "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", - "keywords": ["event-driven", "readable", "writable", "stream", "non-blocking", "io", "pipe", "ReactPHP"], - "license": "MIT", - "authors": [ - { - "name": "Christian Lück", - "homepage": "https://clue.engineering/", - "email": "christian@clue.engineering" - }, - { - "name": "Cees-Jan Kiewiet", - "homepage": "https://wyrihaximus.net/", - "email": "reactphp@ceesjankiewiet.nl" - }, - { - "name": "Jan Sorgalla", - "homepage": "https://sorgalla.com/", - "email": "jsorgalla@gmail.com" - }, - { - "name": "Chris Boden", - "homepage": "https://cboden.dev/", - "email": "cboden@gmail.com" - } - ], - "require": { - "php": ">=5.3.8", - "react/event-loop": "^1.2", - "evenement/evenement": "^3.0 || ^2.0 || ^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "clue/stream-filter": "~1.2" - }, - "autoload": { - "psr-4": { - "React\\Stream\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "React\\Tests\\Stream\\": "tests/" - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/CompositeStream.php b/tools/php-cs-fixer/vendor/react/stream/src/CompositeStream.php deleted file mode 100644 index dde091de..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/src/CompositeStream.php +++ /dev/null @@ -1,83 +0,0 @@ -readable = $readable; - $this->writable = $writable; - - if (!$readable->isReadable() || !$writable->isWritable()) { - $this->close(); - return; - } - - Util::forwardEvents($this->readable, $this, array('data', 'end', 'error')); - Util::forwardEvents($this->writable, $this, array('drain', 'error', 'pipe')); - - $this->readable->on('close', array($this, 'close')); - $this->writable->on('close', array($this, 'close')); - } - - public function isReadable() - { - return $this->readable->isReadable(); - } - - public function pause() - { - $this->readable->pause(); - } - - public function resume() - { - if (!$this->writable->isWritable()) { - return; - } - - $this->readable->resume(); - } - - public function pipe(WritableStreamInterface $dest, array $options = array()) - { - return Util::pipe($this, $dest, $options); - } - - public function isWritable() - { - return $this->writable->isWritable(); - } - - public function write($data) - { - return $this->writable->write($data); - } - - public function end($data = null) - { - $this->readable->pause(); - $this->writable->end($data); - } - - public function close() - { - if ($this->closed) { - return; - } - - $this->closed = true; - $this->readable->close(); - $this->writable->close(); - - $this->emit('close'); - $this->removeAllListeners(); - } -} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/DuplexResourceStream.php b/tools/php-cs-fixer/vendor/react/stream/src/DuplexResourceStream.php deleted file mode 100644 index d6de55c0..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/src/DuplexResourceStream.php +++ /dev/null @@ -1,240 +0,0 @@ -isLegacyPipe($stream)) { - \stream_set_read_buffer($stream, 0); - } - - if ($buffer === null) { - $buffer = new WritableResourceStream($stream, $loop); - } - - $this->stream = $stream; - $this->loop = $loop ?: Loop::get(); - $this->bufferSize = ($readChunkSize === null) ? 65536 : (int)$readChunkSize; - $this->buffer = $buffer; - - $that = $this; - - $this->buffer->on('error', function ($error) use ($that) { - $that->emit('error', array($error)); - }); - - $this->buffer->on('close', array($this, 'close')); - - $this->buffer->on('drain', function () use ($that) { - $that->emit('drain'); - }); - - $this->resume(); - } - - public function isReadable() - { - return $this->readable; - } - - public function isWritable() - { - return $this->writable; - } - - public function pause() - { - if ($this->listening) { - $this->loop->removeReadStream($this->stream); - $this->listening = false; - } - } - - public function resume() - { - if (!$this->listening && $this->readable) { - $this->loop->addReadStream($this->stream, array($this, 'handleData')); - $this->listening = true; - } - } - - public function write($data) - { - if (!$this->writable) { - return false; - } - - return $this->buffer->write($data); - } - - public function close() - { - if (!$this->writable && !$this->closing) { - return; - } - - $this->closing = false; - - $this->readable = false; - $this->writable = false; - - $this->emit('close'); - $this->pause(); - $this->buffer->close(); - $this->removeAllListeners(); - - if (\is_resource($this->stream)) { - \fclose($this->stream); - } - } - - public function end($data = null) - { - if (!$this->writable) { - return; - } - - $this->closing = true; - - $this->readable = false; - $this->writable = false; - $this->pause(); - - $this->buffer->end($data); - } - - public function pipe(WritableStreamInterface $dest, array $options = array()) - { - return Util::pipe($this, $dest, $options); - } - - /** @internal */ - public function handleData($stream) - { - $error = null; - \set_error_handler(function ($errno, $errstr, $errfile, $errline) use (&$error) { - $error = new \ErrorException( - $errstr, - 0, - $errno, - $errfile, - $errline - ); - }); - - $data = \stream_get_contents($stream, $this->bufferSize); - - \restore_error_handler(); - - if ($error !== null) { - $this->emit('error', array(new \RuntimeException('Unable to read from stream: ' . $error->getMessage(), 0, $error))); - $this->close(); - return; - } - - if ($data !== '') { - $this->emit('data', array($data)); - } elseif (\feof($this->stream)) { - // no data read => we reached the end and close the stream - $this->emit('end'); - $this->close(); - } - } - - /** - * Returns whether this is a pipe resource in a legacy environment - * - * This works around a legacy PHP bug (#61019) that was fixed in PHP 5.4.28+ - * and PHP 5.5.12+ and newer. - * - * @param resource $resource - * @return bool - * @link https://github.com/reactphp/child-process/issues/40 - * - * @codeCoverageIgnore - */ - private function isLegacyPipe($resource) - { - if (\PHP_VERSION_ID < 50428 || (\PHP_VERSION_ID >= 50500 && \PHP_VERSION_ID < 50512)) { - $meta = \stream_get_meta_data($resource); - - if (isset($meta['stream_type']) && $meta['stream_type'] === 'STDIO') { - return true; - } - } - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/DuplexStreamInterface.php b/tools/php-cs-fixer/vendor/react/stream/src/DuplexStreamInterface.php deleted file mode 100644 index 631ce31e..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/src/DuplexStreamInterface.php +++ /dev/null @@ -1,39 +0,0 @@ - Note that higher-level implementations of this interface may choose to - * define additional events with dedicated semantics not defined as part of - * this low-level stream specification. Conformance with these event semantics - * is out of scope for this interface, so you may also have to refer to the - * documentation of such a higher-level implementation. - * - * @see ReadableStreamInterface - * @see WritableStreamInterface - */ -interface DuplexStreamInterface extends ReadableStreamInterface, WritableStreamInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/ReadableResourceStream.php b/tools/php-cs-fixer/vendor/react/stream/src/ReadableResourceStream.php deleted file mode 100644 index 823360a6..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/src/ReadableResourceStream.php +++ /dev/null @@ -1,188 +0,0 @@ -isLegacyPipe($stream)) { - \stream_set_read_buffer($stream, 0); - } - - $this->stream = $stream; - $this->loop = $loop ?: Loop::get(); - $this->bufferSize = ($readChunkSize === null) ? 65536 : (int)$readChunkSize; - - $this->resume(); - } - - public function isReadable() - { - return !$this->closed; - } - - public function pause() - { - if ($this->listening) { - $this->loop->removeReadStream($this->stream); - $this->listening = false; - } - } - - public function resume() - { - if (!$this->listening && !$this->closed) { - $this->loop->addReadStream($this->stream, array($this, 'handleData')); - $this->listening = true; - } - } - - public function pipe(WritableStreamInterface $dest, array $options = array()) - { - return Util::pipe($this, $dest, $options); - } - - public function close() - { - if ($this->closed) { - return; - } - - $this->closed = true; - - $this->emit('close'); - $this->pause(); - $this->removeAllListeners(); - - if (\is_resource($this->stream)) { - \fclose($this->stream); - } - } - - /** @internal */ - public function handleData() - { - $error = null; - \set_error_handler(function ($errno, $errstr, $errfile, $errline) use (&$error) { - $error = new \ErrorException( - $errstr, - 0, - $errno, - $errfile, - $errline - ); - }); - - $data = \stream_get_contents($this->stream, $this->bufferSize); - - \restore_error_handler(); - - if ($error !== null) { - $this->emit('error', array(new \RuntimeException('Unable to read from stream: ' . $error->getMessage(), 0, $error))); - $this->close(); - return; - } - - if ($data !== '') { - $this->emit('data', array($data)); - } elseif (\feof($this->stream)) { - // no data read => we reached the end and close the stream - $this->emit('end'); - $this->close(); - } - } - - /** - * Returns whether this is a pipe resource in a legacy environment - * - * This works around a legacy PHP bug (#61019) that was fixed in PHP 5.4.28+ - * and PHP 5.5.12+ and newer. - * - * @param resource $resource - * @return bool - * @link https://github.com/reactphp/child-process/issues/40 - * - * @codeCoverageIgnore - */ - private function isLegacyPipe($resource) - { - if (\PHP_VERSION_ID < 50428 || (\PHP_VERSION_ID >= 50500 && \PHP_VERSION_ID < 50512)) { - $meta = \stream_get_meta_data($resource); - - if (isset($meta['stream_type']) && $meta['stream_type'] === 'STDIO') { - return true; - } - } - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/ReadableStreamInterface.php b/tools/php-cs-fixer/vendor/react/stream/src/ReadableStreamInterface.php deleted file mode 100644 index fa3d59cd..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/src/ReadableStreamInterface.php +++ /dev/null @@ -1,362 +0,0 @@ -on('data', function ($data) { - * echo $data; - * }); - * ``` - * - * This event MAY be emitted any number of times, which may be zero times if - * this stream does not send any data at all. - * It SHOULD not be emitted after an `end` or `close` event. - * - * The given `$data` argument may be of mixed type, but it's usually - * recommended it SHOULD be a `string` value or MAY use a type that allows - * representation as a `string` for maximum compatibility. - * - * Many common streams (such as a TCP/IP connection or a file-based stream) - * will emit the raw (binary) payload data that is received over the wire as - * chunks of `string` values. - * - * Due to the stream-based nature of this, the sender may send any number - * of chunks with varying sizes. There are no guarantees that these chunks - * will be received with the exact same framing the sender intended to send. - * In other words, many lower-level protocols (such as TCP/IP) transfer the - * data in chunks that may be anywhere between single-byte values to several - * dozens of kilobytes. You may want to apply a higher-level protocol to - * these low-level data chunks in order to achieve proper message framing. - * - * end event: - * The `end` event will be emitted once the source stream has successfully - * reached the end of the stream (EOF). - * - * ```php - * $stream->on('end', function () { - * echo 'END'; - * }); - * ``` - * - * This event SHOULD be emitted once or never at all, depending on whether - * a successful end was detected. - * It SHOULD NOT be emitted after a previous `end` or `close` event. - * It MUST NOT be emitted if the stream closes due to a non-successful - * end, such as after a previous `error` event. - * - * After the stream is ended, it MUST switch to non-readable mode, - * see also `isReadable()`. - * - * This event will only be emitted if the *end* was reached successfully, - * not if the stream was interrupted by an unrecoverable error or explicitly - * closed. Not all streams know this concept of a "successful end". - * Many use-cases involve detecting when the stream closes (terminates) - * instead, in this case you should use the `close` event. - * After the stream emits an `end` event, it SHOULD usually be followed by a - * `close` event. - * - * Many common streams (such as a TCP/IP connection or a file-based stream) - * will emit this event if either the remote side closes the connection or - * a file handle was successfully read until reaching its end (EOF). - * - * Note that this event should not be confused with the `end()` method. - * This event defines a successful end *reading* from a source stream, while - * the `end()` method defines *writing* a successful end to a destination - * stream. - * - * error event: - * The `error` event will be emitted once a fatal error occurs, usually while - * trying to read from this stream. - * The event receives a single `Exception` argument for the error instance. - * - * ```php - * $stream->on('error', function (Exception $e) { - * echo 'Error: ' . $e->getMessage() . PHP_EOL; - * }); - * ``` - * - * This event SHOULD be emitted once the stream detects a fatal error, such - * as a fatal transmission error or after an unexpected `data` or premature - * `end` event. - * It SHOULD NOT be emitted after a previous `error`, `end` or `close` event. - * It MUST NOT be emitted if this is not a fatal error condition, such as - * a temporary network issue that did not cause any data to be lost. - * - * After the stream errors, it MUST close the stream and SHOULD thus be - * followed by a `close` event and then switch to non-readable mode, see - * also `close()` and `isReadable()`. - * - * Many common streams (such as a TCP/IP connection or a file-based stream) - * only deal with data transmission and do not make assumption about data - * boundaries (such as unexpected `data` or premature `end` events). - * In other words, many lower-level protocols (such as TCP/IP) may choose - * to only emit this for a fatal transmission error once and will then - * close (terminate) the stream in response. - * - * If this stream is a `DuplexStreamInterface`, you should also notice - * how the writable side of the stream also implements an `error` event. - * In other words, an error may occur while either reading or writing the - * stream which should result in the same error processing. - * - * close event: - * The `close` event will be emitted once the stream closes (terminates). - * - * ```php - * $stream->on('close', function () { - * echo 'CLOSED'; - * }); - * ``` - * - * This event SHOULD be emitted once or never at all, depending on whether - * the stream ever terminates. - * It SHOULD NOT be emitted after a previous `close` event. - * - * After the stream is closed, it MUST switch to non-readable mode, - * see also `isReadable()`. - * - * Unlike the `end` event, this event SHOULD be emitted whenever the stream - * closes, irrespective of whether this happens implicitly due to an - * unrecoverable error or explicitly when either side closes the stream. - * If you only want to detect a *successful* end, you should use the `end` - * event instead. - * - * Many common streams (such as a TCP/IP connection or a file-based stream) - * will likely choose to emit this event after reading a *successful* `end` - * event or after a fatal transmission `error` event. - * - * If this stream is a `DuplexStreamInterface`, you should also notice - * how the writable side of the stream also implements a `close` event. - * In other words, after receiving this event, the stream MUST switch into - * non-writable AND non-readable mode, see also `isWritable()`. - * Note that this event should not be confused with the `end` event. - * - * The event callback functions MUST be a valid `callable` that obeys strict - * parameter definitions and MUST accept event parameters exactly as documented. - * The event callback functions MUST NOT throw an `Exception`. - * The return value of the event callback functions will be ignored and has no - * effect, so for performance reasons you're recommended to not return any - * excessive data structures. - * - * Every implementation of this interface MUST follow these event semantics in - * order to be considered a well-behaving stream. - * - * > Note that higher-level implementations of this interface may choose to - * define additional events with dedicated semantics not defined as part of - * this low-level stream specification. Conformance with these event semantics - * is out of scope for this interface, so you may also have to refer to the - * documentation of such a higher-level implementation. - * - * @see EventEmitterInterface - */ -interface ReadableStreamInterface extends EventEmitterInterface -{ - /** - * Checks whether this stream is in a readable state (not closed already). - * - * This method can be used to check if the stream still accepts incoming - * data events or if it is ended or closed already. - * Once the stream is non-readable, no further `data` or `end` events SHOULD - * be emitted. - * - * ```php - * assert($stream->isReadable() === false); - * - * $stream->on('data', assertNeverCalled()); - * $stream->on('end', assertNeverCalled()); - * ``` - * - * A successfully opened stream always MUST start in readable mode. - * - * Once the stream ends or closes, it MUST switch to non-readable mode. - * This can happen any time, explicitly through `close()` or - * implicitly due to a remote close or an unrecoverable transmission error. - * Once a stream has switched to non-readable mode, it MUST NOT transition - * back to readable mode. - * - * If this stream is a `DuplexStreamInterface`, you should also notice - * how the writable side of the stream also implements an `isWritable()` - * method. Unless this is a half-open duplex stream, they SHOULD usually - * have the same return value. - * - * @return bool - */ - public function isReadable(); - - /** - * Pauses reading incoming data events. - * - * Removes the data source file descriptor from the event loop. This - * allows you to throttle incoming data. - * - * Unless otherwise noted, a successfully opened stream SHOULD NOT start - * in paused state. - * - * Once the stream is paused, no futher `data` or `end` events SHOULD - * be emitted. - * - * ```php - * $stream->pause(); - * - * $stream->on('data', assertShouldNeverCalled()); - * $stream->on('end', assertShouldNeverCalled()); - * ``` - * - * This method is advisory-only, though generally not recommended, the - * stream MAY continue emitting `data` events. - * - * You can continue processing events by calling `resume()` again. - * - * Note that both methods can be called any number of times, in particular - * calling `pause()` more than once SHOULD NOT have any effect. - * - * @see self::resume() - * @return void - */ - public function pause(); - - /** - * Resumes reading incoming data events. - * - * Re-attach the data source after a previous `pause()`. - * - * ```php - * $stream->pause(); - * - * Loop::addTimer(1.0, function () use ($stream) { - * $stream->resume(); - * }); - * ``` - * - * Note that both methods can be called any number of times, in particular - * calling `resume()` without a prior `pause()` SHOULD NOT have any effect. - * - * @see self::pause() - * @return void - */ - public function resume(); - - /** - * Pipes all the data from this readable source into the given writable destination. - * - * Automatically sends all incoming data to the destination. - * Automatically throttles the source based on what the destination can handle. - * - * ```php - * $source->pipe($dest); - * ``` - * - * Similarly, you can also pipe an instance implementing `DuplexStreamInterface` - * into itself in order to write back all the data that is received. - * This may be a useful feature for a TCP/IP echo service: - * - * ```php - * $connection->pipe($connection); - * ``` - * - * This method returns the destination stream as-is, which can be used to - * set up chains of piped streams: - * - * ```php - * $source->pipe($decodeGzip)->pipe($filterBadWords)->pipe($dest); - * ``` - * - * By default, this will call `end()` on the destination stream once the - * source stream emits an `end` event. This can be disabled like this: - * - * ```php - * $source->pipe($dest, array('end' => false)); - * ``` - * - * Note that this only applies to the `end` event. - * If an `error` or explicit `close` event happens on the source stream, - * you'll have to manually close the destination stream: - * - * ```php - * $source->pipe($dest); - * $source->on('close', function () use ($dest) { - * $dest->end('BYE!'); - * }); - * ``` - * - * If the source stream is not readable (closed state), then this is a NO-OP. - * - * ```php - * $source->close(); - * $source->pipe($dest); // NO-OP - * ``` - * - * If the destinantion stream is not writable (closed state), then this will simply - * throttle (pause) the source stream: - * - * ```php - * $dest->close(); - * $source->pipe($dest); // calls $source->pause() - * ``` - * - * Similarly, if the destination stream is closed while the pipe is still - * active, it will also throttle (pause) the source stream: - * - * ```php - * $source->pipe($dest); - * $dest->close(); // calls $source->pause() - * ``` - * - * Once the pipe is set up successfully, the destination stream MUST emit - * a `pipe` event with this source stream an event argument. - * - * @param WritableStreamInterface $dest - * @param array $options - * @return WritableStreamInterface $dest stream as-is - */ - public function pipe(WritableStreamInterface $dest, array $options = array()); - - /** - * Closes the stream (forcefully). - * - * This method can be used to (forcefully) close the stream. - * - * ```php - * $stream->close(); - * ``` - * - * Once the stream is closed, it SHOULD emit a `close` event. - * Note that this event SHOULD NOT be emitted more than once, in particular - * if this method is called multiple times. - * - * After calling this method, the stream MUST switch into a non-readable - * mode, see also `isReadable()`. - * This means that no further `data` or `end` events SHOULD be emitted. - * - * ```php - * $stream->close(); - * assert($stream->isReadable() === false); - * - * $stream->on('data', assertNeverCalled()); - * $stream->on('end', assertNeverCalled()); - * ``` - * - * If this stream is a `DuplexStreamInterface`, you should also notice - * how the writable side of the stream also implements a `close()` method. - * In other words, after calling this method, the stream MUST switch into - * non-writable AND non-readable mode, see also `isWritable()`. - * Note that this method should not be confused with the `end()` method. - * - * @return void - * @see WritableStreamInterface::close() - */ - public function close(); -} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/ThroughStream.php b/tools/php-cs-fixer/vendor/react/stream/src/ThroughStream.php deleted file mode 100644 index 3b4fbb78..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/src/ThroughStream.php +++ /dev/null @@ -1,195 +0,0 @@ -on('data', $this->expectCallableOnceWith('hello')); - * - * $through->write('hello'); - * ``` - * - * Similarly, the [`end()` method](#end) will end the stream and emit an - * [`end` event](#end-event) and then [`close()`](#close-1) the stream. - * The [`close()` method](#close-1) will close the stream and emit a - * [`close` event](#close-event). - * Accordingly, this is can also be used in a [`pipe()`](#pipe) context like this: - * - * ```php - * $through = new ThroughStream(); - * $source->pipe($through)->pipe($dest); - * ``` - * - * Optionally, its constructor accepts any callable function which will then be - * used to *filter* any data written to it. This function receives a single data - * argument as passed to the writable side and must return the data as it will be - * passed to its readable end: - * - * ```php - * $through = new ThroughStream('strtoupper'); - * $source->pipe($through)->pipe($dest); - * ``` - * - * Note that this class makes no assumptions about any data types. This can be - * used to convert data, for example for transforming any structured data into - * a newline-delimited JSON (NDJSON) stream like this: - * - * ```php - * $through = new ThroughStream(function ($data) { - * return json_encode($data) . PHP_EOL; - * }); - * $through->on('data', $this->expectCallableOnceWith("[2, true]\n")); - * - * $through->write(array(2, true)); - * ``` - * - * The callback function is allowed to throw an `Exception`. In this case, - * the stream will emit an `error` event and then [`close()`](#close-1) the stream. - * - * ```php - * $through = new ThroughStream(function ($data) { - * if (!is_string($data)) { - * throw new \UnexpectedValueException('Only strings allowed'); - * } - * return $data; - * }); - * $through->on('error', $this->expectCallableOnce())); - * $through->on('close', $this->expectCallableOnce())); - * $through->on('data', $this->expectCallableNever())); - * - * $through->write(2); - * ``` - * - * @see WritableStreamInterface::write() - * @see WritableStreamInterface::end() - * @see DuplexStreamInterface::close() - * @see WritableStreamInterface::pipe() - */ -final class ThroughStream extends EventEmitter implements DuplexStreamInterface -{ - private $readable = true; - private $writable = true; - private $closed = false; - private $paused = false; - private $drain = false; - private $callback; - - public function __construct($callback = null) - { - if ($callback !== null && !\is_callable($callback)) { - throw new InvalidArgumentException('Invalid transformation callback given'); - } - - $this->callback = $callback; - } - - public function pause() - { - // only allow pause if still readable, false otherwise - $this->paused = $this->readable; - } - - public function resume() - { - $this->paused = false; - - // emit drain event if previous write was paused (throttled) - if ($this->drain) { - $this->drain = false; - $this->emit('drain'); - } - } - - public function pipe(WritableStreamInterface $dest, array $options = array()) - { - return Util::pipe($this, $dest, $options); - } - - public function isReadable() - { - return $this->readable; - } - - public function isWritable() - { - return $this->writable; - } - - public function write($data) - { - if (!$this->writable) { - return false; - } - - if ($this->callback !== null) { - try { - $data = \call_user_func($this->callback, $data); - } catch (\Exception $e) { - $this->emit('error', array($e)); - $this->close(); - - return false; - } - } - - $this->emit('data', array($data)); - - // emit drain event on next resume if currently paused (throttled) - if ($this->paused) { - $this->drain = true; - } - - // continue writing if still writable and not paused (throttled), false otherwise - return $this->writable && !$this->paused; - } - - public function end($data = null) - { - if (!$this->writable) { - return; - } - - if (null !== $data) { - $this->write($data); - - // return if write() already caused the stream to close - if (!$this->writable) { - return; - } - } - - $this->readable = false; - $this->writable = false; - $this->paused = false; - $this->drain = false; - - $this->emit('end'); - $this->close(); - } - - public function close() - { - if ($this->closed) { - return; - } - - $this->readable = false; - $this->writable = false; - $this->paused = false; - $this->drain = false; - - $this->closed = true; - $this->callback = null; - - $this->emit('close'); - $this->removeAllListeners(); - } -} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/Util.php b/tools/php-cs-fixer/vendor/react/stream/src/Util.php deleted file mode 100644 index 056b0377..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/src/Util.php +++ /dev/null @@ -1,75 +0,0 @@ - NO-OP - if (!$source->isReadable()) { - return $dest; - } - - // destination not writable => just pause() source - if (!$dest->isWritable()) { - $source->pause(); - - return $dest; - } - - $dest->emit('pipe', array($source)); - - // forward all source data events as $dest->write() - $source->on('data', $dataer = function ($data) use ($source, $dest) { - $feedMore = $dest->write($data); - - if (false === $feedMore) { - $source->pause(); - } - }); - $dest->on('close', function () use ($source, $dataer) { - $source->removeListener('data', $dataer); - $source->pause(); - }); - - // forward destination drain as $source->resume() - $dest->on('drain', $drainer = function () use ($source) { - $source->resume(); - }); - $source->on('close', function () use ($dest, $drainer) { - $dest->removeListener('drain', $drainer); - }); - - // forward end event from source as $dest->end() - $end = isset($options['end']) ? $options['end'] : true; - if ($end) { - $source->on('end', $ender = function () use ($dest) { - $dest->end(); - }); - $dest->on('close', function () use ($source, $ender) { - $source->removeListener('end', $ender); - }); - } - - return $dest; - } - - public static function forwardEvents($source, $target, array $events) - { - foreach ($events as $event) { - $source->on($event, function () use ($event, $target) { - $target->emit($event, \func_get_args()); - }); - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/WritableResourceStream.php b/tools/php-cs-fixer/vendor/react/stream/src/WritableResourceStream.php deleted file mode 100644 index e3a7e74d..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/src/WritableResourceStream.php +++ /dev/null @@ -1,178 +0,0 @@ -stream = $stream; - $this->loop = $loop ?: Loop::get(); - $this->softLimit = ($writeBufferSoftLimit === null) ? 65536 : (int)$writeBufferSoftLimit; - $this->writeChunkSize = ($writeChunkSize === null) ? -1 : (int)$writeChunkSize; - } - - public function isWritable() - { - return $this->writable; - } - - public function write($data) - { - if (!$this->writable) { - return false; - } - - $this->data .= $data; - - if (!$this->listening && $this->data !== '') { - $this->listening = true; - - $this->loop->addWriteStream($this->stream, array($this, 'handleWrite')); - } - - return !isset($this->data[$this->softLimit - 1]); - } - - public function end($data = null) - { - if (null !== $data) { - $this->write($data); - } - - $this->writable = false; - - // close immediately if buffer is already empty - // otherwise wait for buffer to flush first - if ($this->data === '') { - $this->close(); - } - } - - public function close() - { - if ($this->closed) { - return; - } - - if ($this->listening) { - $this->listening = false; - $this->loop->removeWriteStream($this->stream); - } - - $this->closed = true; - $this->writable = false; - $this->data = ''; - - $this->emit('close'); - $this->removeAllListeners(); - - if (\is_resource($this->stream)) { - \fclose($this->stream); - } - } - - /** @internal */ - public function handleWrite() - { - $error = null; - \set_error_handler(function ($_, $errstr) use (&$error) { - $error = $errstr; - }); - - if ($this->writeChunkSize === -1) { - $sent = \fwrite($this->stream, $this->data); - } else { - $sent = \fwrite($this->stream, $this->data, $this->writeChunkSize); - } - - \restore_error_handler(); - - // Only report errors if *nothing* could be sent and an error has been raised. - // Ignore non-fatal warnings if *some* data could be sent. - // Any hard (permanent) error will fail to send any data at all. - // Sending excessive amounts of data will only flush *some* data and then - // report a temporary error (EAGAIN) which we do not raise here in order - // to keep the stream open for further tries to write. - // Should this turn out to be a permanent error later, it will eventually - // send *nothing* and we can detect this. - if (($sent === 0 || $sent === false) && $error !== null) { - $this->emit('error', array(new \RuntimeException('Unable to write to stream: ' . $error))); - $this->close(); - - return; - } - - $exceeded = isset($this->data[$this->softLimit - 1]); - $this->data = (string) \substr($this->data, $sent); - - // buffer has been above limit and is now below limit - if ($exceeded && !isset($this->data[$this->softLimit - 1])) { - $this->emit('drain'); - } - - // buffer is now completely empty => stop trying to write - if ($this->data === '') { - // stop waiting for resource to be writable - if ($this->listening) { - $this->loop->removeWriteStream($this->stream); - $this->listening = false; - } - - // buffer is end()ing and now completely empty => close buffer - if (!$this->writable) { - $this->close(); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/react/stream/src/WritableStreamInterface.php b/tools/php-cs-fixer/vendor/react/stream/src/WritableStreamInterface.php deleted file mode 100644 index e2625928..00000000 --- a/tools/php-cs-fixer/vendor/react/stream/src/WritableStreamInterface.php +++ /dev/null @@ -1,347 +0,0 @@ -on('drain', function () use ($stream) { - * echo 'Stream is now ready to accept more data'; - * }); - * ``` - * - * This event SHOULD be emitted once every time the buffer became full - * previously and is now ready to accept more data. - * In other words, this event MAY be emitted any number of times, which may - * be zero times if the buffer never became full in the first place. - * This event SHOULD NOT be emitted if the buffer has not become full - * previously. - * - * This event is mostly used internally, see also `write()` for more details. - * - * pipe event: - * The `pipe` event will be emitted whenever a readable stream is `pipe()`d - * into this stream. - * The event receives a single `ReadableStreamInterface` argument for the - * source stream. - * - * ```php - * $stream->on('pipe', function (ReadableStreamInterface $source) use ($stream) { - * echo 'Now receiving piped data'; - * - * // explicitly close target if source emits an error - * $source->on('error', function () use ($stream) { - * $stream->close(); - * }); - * }); - * - * $source->pipe($stream); - * ``` - * - * This event MUST be emitted once for each readable stream that is - * successfully piped into this destination stream. - * In other words, this event MAY be emitted any number of times, which may - * be zero times if no stream is ever piped into this stream. - * This event MUST NOT be emitted if either the source is not readable - * (closed already) or this destination is not writable (closed already). - * - * This event is mostly used internally, see also `pipe()` for more details. - * - * error event: - * The `error` event will be emitted once a fatal error occurs, usually while - * trying to write to this stream. - * The event receives a single `Exception` argument for the error instance. - * - * ```php - * $stream->on('error', function (Exception $e) { - * echo 'Error: ' . $e->getMessage() . PHP_EOL; - * }); - * ``` - * - * This event SHOULD be emitted once the stream detects a fatal error, such - * as a fatal transmission error. - * It SHOULD NOT be emitted after a previous `error` or `close` event. - * It MUST NOT be emitted if this is not a fatal error condition, such as - * a temporary network issue that did not cause any data to be lost. - * - * After the stream errors, it MUST close the stream and SHOULD thus be - * followed by a `close` event and then switch to non-writable mode, see - * also `close()` and `isWritable()`. - * - * Many common streams (such as a TCP/IP connection or a file-based stream) - * only deal with data transmission and may choose - * to only emit this for a fatal transmission error once and will then - * close (terminate) the stream in response. - * - * If this stream is a `DuplexStreamInterface`, you should also notice - * how the readable side of the stream also implements an `error` event. - * In other words, an error may occur while either reading or writing the - * stream which should result in the same error processing. - * - * close event: - * The `close` event will be emitted once the stream closes (terminates). - * - * ```php - * $stream->on('close', function () { - * echo 'CLOSED'; - * }); - * ``` - * - * This event SHOULD be emitted once or never at all, depending on whether - * the stream ever terminates. - * It SHOULD NOT be emitted after a previous `close` event. - * - * After the stream is closed, it MUST switch to non-writable mode, - * see also `isWritable()`. - * - * This event SHOULD be emitted whenever the stream closes, irrespective of - * whether this happens implicitly due to an unrecoverable error or - * explicitly when either side closes the stream. - * - * Many common streams (such as a TCP/IP connection or a file-based stream) - * will likely choose to emit this event after flushing the buffer from - * the `end()` method, after receiving a *successful* `end` event or after - * a fatal transmission `error` event. - * - * If this stream is a `DuplexStreamInterface`, you should also notice - * how the readable side of the stream also implements a `close` event. - * In other words, after receiving this event, the stream MUST switch into - * non-writable AND non-readable mode, see also `isReadable()`. - * Note that this event should not be confused with the `end` event. - * - * The event callback functions MUST be a valid `callable` that obeys strict - * parameter definitions and MUST accept event parameters exactly as documented. - * The event callback functions MUST NOT throw an `Exception`. - * The return value of the event callback functions will be ignored and has no - * effect, so for performance reasons you're recommended to not return any - * excessive data structures. - * - * Every implementation of this interface MUST follow these event semantics in - * order to be considered a well-behaving stream. - * - * > Note that higher-level implementations of this interface may choose to - * define additional events with dedicated semantics not defined as part of - * this low-level stream specification. Conformance with these event semantics - * is out of scope for this interface, so you may also have to refer to the - * documentation of such a higher-level implementation. - * - * @see EventEmitterInterface - * @see DuplexStreamInterface - */ -interface WritableStreamInterface extends EventEmitterInterface -{ - /** - * Checks whether this stream is in a writable state (not closed already). - * - * This method can be used to check if the stream still accepts writing - * any data or if it is ended or closed already. - * Writing any data to a non-writable stream is a NO-OP: - * - * ```php - * assert($stream->isWritable() === false); - * - * $stream->write('end'); // NO-OP - * $stream->end('end'); // NO-OP - * ``` - * - * A successfully opened stream always MUST start in writable mode. - * - * Once the stream ends or closes, it MUST switch to non-writable mode. - * This can happen any time, explicitly through `end()` or `close()` or - * implicitly due to a remote close or an unrecoverable transmission error. - * Once a stream has switched to non-writable mode, it MUST NOT transition - * back to writable mode. - * - * If this stream is a `DuplexStreamInterface`, you should also notice - * how the readable side of the stream also implements an `isReadable()` - * method. Unless this is a half-open duplex stream, they SHOULD usually - * have the same return value. - * - * @return bool - */ - public function isWritable(); - - /** - * Write some data into the stream. - * - * A successful write MUST be confirmed with a boolean `true`, which means - * that either the data was written (flushed) immediately or is buffered and - * scheduled for a future write. Note that this interface gives you no - * control over explicitly flushing the buffered data, as finding the - * appropriate time for this is beyond the scope of this interface and left - * up to the implementation of this interface. - * - * Many common streams (such as a TCP/IP connection or file-based stream) - * may choose to buffer all given data and schedule a future flush by using - * an underlying EventLoop to check when the resource is actually writable. - * - * If a stream cannot handle writing (or flushing) the data, it SHOULD emit - * an `error` event and MAY `close()` the stream if it can not recover from - * this error. - * - * If the internal buffer is full after adding `$data`, then `write()` - * SHOULD return `false`, indicating that the caller should stop sending - * data until the buffer drains. - * The stream SHOULD send a `drain` event once the buffer is ready to accept - * more data. - * - * Similarly, if the stream is not writable (already in a closed state) - * it MUST NOT process the given `$data` and SHOULD return `false`, - * indicating that the caller should stop sending data. - * - * The given `$data` argument MAY be of mixed type, but it's usually - * recommended it SHOULD be a `string` value or MAY use a type that allows - * representation as a `string` for maximum compatibility. - * - * Many common streams (such as a TCP/IP connection or a file-based stream) - * will only accept the raw (binary) payload data that is transferred over - * the wire as chunks of `string` values. - * - * Due to the stream-based nature of this, the sender may send any number - * of chunks with varying sizes. There are no guarantees that these chunks - * will be received with the exact same framing the sender intended to send. - * In other words, many lower-level protocols (such as TCP/IP) transfer the - * data in chunks that may be anywhere between single-byte values to several - * dozens of kilobytes. You may want to apply a higher-level protocol to - * these low-level data chunks in order to achieve proper message framing. - * - * @param mixed|string $data - * @return bool - */ - public function write($data); - - /** - * Successfully ends the stream (after optionally sending some final data). - * - * This method can be used to successfully end the stream, i.e. close - * the stream after sending out all data that is currently buffered. - * - * ```php - * $stream->write('hello'); - * $stream->write('world'); - * $stream->end(); - * ``` - * - * If there's no data currently buffered and nothing to be flushed, then - * this method MAY `close()` the stream immediately. - * - * If there's still data in the buffer that needs to be flushed first, then - * this method SHOULD try to write out this data and only then `close()` - * the stream. - * Once the stream is closed, it SHOULD emit a `close` event. - * - * Note that this interface gives you no control over explicitly flushing - * the buffered data, as finding the appropriate time for this is beyond the - * scope of this interface and left up to the implementation of this - * interface. - * - * Many common streams (such as a TCP/IP connection or file-based stream) - * may choose to buffer all given data and schedule a future flush by using - * an underlying EventLoop to check when the resource is actually writable. - * - * You can optionally pass some final data that is written to the stream - * before ending the stream. If a non-`null` value is given as `$data`, then - * this method will behave just like calling `write($data)` before ending - * with no data. - * - * ```php - * // shorter version - * $stream->end('bye'); - * - * // same as longer version - * $stream->write('bye'); - * $stream->end(); - * ``` - * - * After calling this method, the stream MUST switch into a non-writable - * mode, see also `isWritable()`. - * This means that no further writes are possible, so any additional - * `write()` or `end()` calls have no effect. - * - * ```php - * $stream->end(); - * assert($stream->isWritable() === false); - * - * $stream->write('nope'); // NO-OP - * $stream->end(); // NO-OP - * ``` - * - * If this stream is a `DuplexStreamInterface`, calling this method SHOULD - * also end its readable side, unless the stream supports half-open mode. - * In other words, after calling this method, these streams SHOULD switch - * into non-writable AND non-readable mode, see also `isReadable()`. - * This implies that in this case, the stream SHOULD NOT emit any `data` - * or `end` events anymore. - * Streams MAY choose to use the `pause()` method logic for this, but - * special care may have to be taken to ensure a following call to the - * `resume()` method SHOULD NOT continue emitting readable events. - * - * Note that this method should not be confused with the `close()` method. - * - * @param mixed|string|null $data - * @return void - */ - public function end($data = null); - - /** - * Closes the stream (forcefully). - * - * This method can be used to forcefully close the stream, i.e. close - * the stream without waiting for any buffered data to be flushed. - * If there's still data in the buffer, this data SHOULD be discarded. - * - * ```php - * $stream->close(); - * ``` - * - * Once the stream is closed, it SHOULD emit a `close` event. - * Note that this event SHOULD NOT be emitted more than once, in particular - * if this method is called multiple times. - * - * After calling this method, the stream MUST switch into a non-writable - * mode, see also `isWritable()`. - * This means that no further writes are possible, so any additional - * `write()` or `end()` calls have no effect. - * - * ```php - * $stream->close(); - * assert($stream->isWritable() === false); - * - * $stream->write('nope'); // NO-OP - * $stream->end(); // NO-OP - * ``` - * - * Note that this method should not be confused with the `end()` method. - * Unlike the `end()` method, this method does not take care of any existing - * buffers and simply discards any buffer contents. - * Likewise, this method may also be called after calling `end()` on a - * stream in order to stop waiting for the stream to flush its final data. - * - * ```php - * $stream->end(); - * Loop::addTimer(1.0, function () use ($stream) { - * $stream->close(); - * }); - * ``` - * - * If this stream is a `DuplexStreamInterface`, you should also notice - * how the readable side of the stream also implements a `close()` method. - * In other words, after calling this method, the stream MUST switch into - * non-writable AND non-readable mode, see also `isReadable()`. - * - * @return void - * @see ReadableStreamInterface::close() - */ - public function close(); -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/ChangeLog.md b/tools/php-cs-fixer/vendor/sebastian/diff/ChangeLog.md deleted file mode 100644 index b12b9932..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/ChangeLog.md +++ /dev/null @@ -1,172 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [6.0.2] - 2024-07-03 - -### Changed - -* This project now uses PHPStan instead of Psalm for static analysis - -## [6.0.1] - 2024-03-02 - -### Changed - -* Do not use implicitly nullable parameters - -## [6.0.0] - 2024-02-02 - -### Removed - -* `SebastianBergmann\Diff\Chunk::getStart()`, `SebastianBergmann\Diff\Chunk::getStartRange()`, `SebastianBergmann\Diff\Chunk::getEnd()`, `SebastianBergmann\Diff\Chunk::getEndRange()`, and `SebastianBergmann\Diff\Chunk::getLines()` -* `SebastianBergmann\Diff\Diff::getFrom()`, `SebastianBergmann\Diff\Diff::getTo()`, and `SebastianBergmann\Diff\Diff::getChunks()` -* `SebastianBergmann\Diff\Line::getContent()` and `SebastianBergmann\Diff\Diff::getType()` -* Removed support for PHP 8.1 - -## [5.1.1] - 2024-03-02 - -### Changed - -* Do not use implicitly nullable parameters - -## [5.1.0] - 2023-12-22 - -### Added - -* `SebastianBergmann\Diff\Chunk::start()`, `SebastianBergmann\Diff\Chunk::startRange()`, `SebastianBergmann\Diff\Chunk::end()`, `SebastianBergmann\Diff\Chunk::endRange()`, and `SebastianBergmann\Diff\Chunk::lines()` -* `SebastianBergmann\Diff\Diff::from()`, `SebastianBergmann\Diff\Diff::to()`, and `SebastianBergmann\Diff\Diff::chunks()` -* `SebastianBergmann\Diff\Line::content()` and `SebastianBergmann\Diff\Diff::type()` -* `SebastianBergmann\Diff\Line::isAdded()`,`SebastianBergmann\Diff\Line::isRemoved()`, and `SebastianBergmann\Diff\Line::isUnchanged()` - -### Changed - -* `SebastianBergmann\Diff\Diff` now implements `IteratorAggregate`, iterating over it yields the aggregated `SebastianBergmann\Diff\Chunk` objects -* `SebastianBergmann\Diff\Chunk` now implements `IteratorAggregate`, iterating over it yields the aggregated `SebastianBergmann\Diff\Line` objects - -### Deprecated - -* `SebastianBergmann\Diff\Chunk::getStart()`, `SebastianBergmann\Diff\Chunk::getStartRange()`, `SebastianBergmann\Diff\Chunk::getEnd()`, `SebastianBergmann\Diff\Chunk::getEndRange()`, and `SebastianBergmann\Diff\Chunk::getLines()` -* `SebastianBergmann\Diff\Diff::getFrom()`, `SebastianBergmann\Diff\Diff::getTo()`, and `SebastianBergmann\Diff\Diff::getChunks()` -* `SebastianBergmann\Diff\Line::getContent()` and `SebastianBergmann\Diff\Diff::getType()` - -## [5.0.3] - 2023-05-01 - -### Changed - -* [#119](https://github.com/sebastianbergmann/diff/pull/119): Improve performance of `TimeEfficientLongestCommonSubsequenceCalculator` - -## [5.0.2] - 2023-05-01 - -### Changed - -* [#118](https://github.com/sebastianbergmann/diff/pull/118): Improve performance of `MemoryEfficientLongestCommonSubsequenceCalculator` - -## [5.0.1] - 2023-03-23 - -### Fixed - -* [#115](https://github.com/sebastianbergmann/diff/pull/115): `Parser::parseFileDiff()` does not handle diffs correctly that only add lines or only remove lines - -## [5.0.0] - 2023-02-03 - -### Changed - -* Passing a `DiffOutputBuilderInterface` instance to `Differ::__construct()` is no longer optional - -### Removed - -* Removed support for PHP 7.3, PHP 7.4, and PHP 8.0 - -## [4.0.4] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\Diff\Exception` now correctly extends `\Throwable` - -## [4.0.3] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [4.0.2] - 2020-06-30 - -### Added - -* This component is now supported on PHP 8 - -## [4.0.1] - 2020-05-08 - -### Fixed - -* [#99](https://github.com/sebastianbergmann/diff/pull/99): Regression in unified diff output of identical strings - -## [4.0.0] - 2020-02-07 - -### Removed - -* Removed support for PHP 7.1 and PHP 7.2 - -## [3.0.2] - 2019-02-04 - -### Changed - -* `Chunk::setLines()` now ensures that the `$lines` array only contains `Line` objects - -## [3.0.1] - 2018-06-10 - -### Fixed - -* Removed `"minimum-stability": "dev",` from `composer.json` - -## [3.0.0] - 2018-02-01 - -* The `StrictUnifiedDiffOutputBuilder` implementation of the `DiffOutputBuilderInterface` was added - -### Changed - -* The default `DiffOutputBuilderInterface` implementation now generates context lines (unchanged lines) - -### Removed - -* Removed support for PHP 7.0 - -### Fixed - -* [#70](https://github.com/sebastianbergmann/diff/issues/70): Diffing of arrays no longer works - -## [2.0.1] - 2017-08-03 - -### Fixed - -* [#66](https://github.com/sebastianbergmann/diff/pull/66): Restored backwards compatibility for PHPUnit 6.1.4, 6.2.0, 6.2.1, 6.2.2, and 6.2.3 - -## [2.0.0] - 2017-07-11 [YANKED] - -### Added - -* [#64](https://github.com/sebastianbergmann/diff/pull/64): Show line numbers for chunks of a diff - -### Removed - -* This component is no longer supported on PHP 5.6 - -[6.0.2]: https://github.com/sebastianbergmann/diff/compare/6.0.1...6.0.2 -[6.0.1]: https://github.com/sebastianbergmann/diff/compare/6.0.0...6.0.1 -[6.0.0]: https://github.com/sebastianbergmann/diff/compare/5.1...6.0.0 -[5.1.1]: https://github.com/sebastianbergmann/diff/compare/5.1.0...5.1.1 -[5.1.0]: https://github.com/sebastianbergmann/diff/compare/5.0.3...5.1.0 -[5.0.3]: https://github.com/sebastianbergmann/diff/compare/5.0.2...5.0.3 -[5.0.2]: https://github.com/sebastianbergmann/diff/compare/5.0.1...5.0.2 -[5.0.1]: https://github.com/sebastianbergmann/diff/compare/5.0.0...5.0.1 -[5.0.0]: https://github.com/sebastianbergmann/diff/compare/4.0.4...5.0.0 -[4.0.4]: https://github.com/sebastianbergmann/diff/compare/4.0.3...4.0.4 -[4.0.3]: https://github.com/sebastianbergmann/diff/compare/4.0.2...4.0.3 -[4.0.2]: https://github.com/sebastianbergmann/diff/compare/4.0.1...4.0.2 -[4.0.1]: https://github.com/sebastianbergmann/diff/compare/4.0.0...4.0.1 -[4.0.0]: https://github.com/sebastianbergmann/diff/compare/3.0.2...4.0.0 -[3.0.2]: https://github.com/sebastianbergmann/diff/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/diff/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/diff/compare/2.0...3.0.0 -[2.0.1]: https://github.com/sebastianbergmann/diff/compare/c341c98ce083db77f896a0aa64f5ee7652915970...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/diff/compare/1.4...c341c98ce083db77f896a0aa64f5ee7652915970 diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/LICENSE b/tools/php-cs-fixer/vendor/sebastian/diff/LICENSE deleted file mode 100644 index 5b4705a4..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2002-2024, Sebastian Bergmann -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. 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. - -3. Neither the name of the copyright holder nor the names of its - contributors may 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 HOLDER 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. diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/README.md b/tools/php-cs-fixer/vendor/sebastian/diff/README.md deleted file mode 100644 index 7b710249..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/README.md +++ /dev/null @@ -1,205 +0,0 @@ -[![Latest Stable Version](https://poser.pugx.org/sebastian/diff/v/stable.png)](https://packagist.org/packages/sebastian/diff) -[![CI Status](https://github.com/sebastianbergmann/diff/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/diff/actions) -[![codecov](https://codecov.io/gh/sebastianbergmann/diff/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/diff) - -# sebastian/diff - -Diff implementation for PHP, factored out of PHPUnit into a stand-alone component. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/diff -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/diff -``` - -### Usage - -#### Generating diff - -The `Differ` class can be used to generate a textual representation of the difference between two strings: - -```php -diff('foo', 'bar'); -``` - -The code above yields the output below: -```diff ---- Original -+++ New -@@ @@ --foo -+bar -``` - -There are three output builders available in this package: - -#### UnifiedDiffOutputBuilder - -This is default builder, which generates the output close to udiff and is used by PHPUnit. - -```php -diff('foo', 'bar'); -``` - -#### StrictUnifiedDiffOutputBuilder - -Generates (strict) Unified diff's (unidiffs) with hunks, -similar to `diff -u` and compatible with `patch` and `git apply`. - -```php - true, // ranges of length one are rendered with the trailing `,1` - 'commonLineThreshold' => 6, // number of same lines before ending a new hunk and creating a new one (if needed) - 'contextLines' => 3, // like `diff: -u, -U NUM, --unified[=NUM]`, for patch/git apply compatibility best to keep at least @ 3 - 'fromFile' => '', - 'fromFileDate' => null, - 'toFile' => '', - 'toFileDate' => null, -]); - -$differ = new Differ($builder); -print $differ->diff('foo', 'bar'); -``` - -#### DiffOnlyOutputBuilder - -Output only the lines that differ. - -```php -diff('foo', 'bar'); -``` - -#### DiffOutputBuilderInterface - -You can pass any output builder to the `Differ` class as longs as it implements the `DiffOutputBuilderInterface`. - -#### Parsing diff - -The `Parser` class can be used to parse a unified diff into an object graph: - -```php -use SebastianBergmann\Diff\Parser; -use SebastianBergmann\Git; - -$git = new Git('/usr/local/src/money'); - -$diff = $git->getDiff( - '948a1a07768d8edd10dcefa8315c1cbeffb31833', - 'c07a373d2399f3e686234c4f7f088d635eb9641b' -); - -$parser = new Parser; - -print_r($parser->parse($diff)); -``` - -The code above yields the output below: - - Array - ( - [0] => SebastianBergmann\Diff\Diff Object - ( - [from:SebastianBergmann\Diff\Diff:private] => a/tests/MoneyTest.php - [to:SebastianBergmann\Diff\Diff:private] => b/tests/MoneyTest.php - [chunks:SebastianBergmann\Diff\Diff:private] => Array - ( - [0] => SebastianBergmann\Diff\Chunk Object - ( - [start:SebastianBergmann\Diff\Chunk:private] => 87 - [startRange:SebastianBergmann\Diff\Chunk:private] => 7 - [end:SebastianBergmann\Diff\Chunk:private] => 87 - [endRange:SebastianBergmann\Diff\Chunk:private] => 7 - [lines:SebastianBergmann\Diff\Chunk:private] => Array - ( - [0] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => * @covers SebastianBergmann\Money\Money::add - ) - - [1] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => * @covers SebastianBergmann\Money\Money::newMoney - ) - - [2] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => */ - ) - - [3] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 2 - [content:SebastianBergmann\Diff\Line:private] => public function testAnotherMoneyWithSameCurrencyObjectCanBeAdded() - ) - - [4] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 1 - [content:SebastianBergmann\Diff\Line:private] => public function testAnotherMoneyObjectWithSameCurrencyCanBeAdded() - ) - - [5] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => { - ) - - [6] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => $a = new Money(1, new Currency('EUR')); - ) - - [7] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => $b = new Money(2, new Currency('EUR')); - ) - ) - ) - ) - ) - ) - -Note: If the chunk size is 0 lines, i.e., `getStartRange()` or `getEndRange()` return 0, the number of line returned by `getStart()` or `getEnd()` is one lower than one would expect. It is the line number after which the chunk should be inserted or deleted; in all other cases, it gives the first line number of the replaced range of lines. diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/SECURITY.md b/tools/php-cs-fixer/vendor/sebastian/diff/SECURITY.md deleted file mode 100644 index d88ff001..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/SECURITY.md +++ /dev/null @@ -1,30 +0,0 @@ -# Security Policy - -If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. - -**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** - -Instead, please email `sebastian@phpunit.de`. - -Please include as much of the information listed below as you can to help us better understand and resolve the issue: - -* The type of issue -* Full paths of source file(s) related to the manifestation of the issue -* The location of the affected source code (tag/branch/commit or direct URL) -* Any special configuration required to reproduce the issue -* Step-by-step instructions to reproduce the issue -* Proof-of-concept or exploit code (if possible) -* Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -## Web Context - -The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. - -The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. - -If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. - -Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. - diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/composer.json b/tools/php-cs-fixer/vendor/sebastian/diff/composer.json deleted file mode 100644 index 7e19a7d9..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/composer.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "sebastian/diff", - "description": "Diff implementation", - "keywords": ["diff", "udiff", "unidiff", "unified diff"], - "homepage": "https://github.com/sebastianbergmann/diff", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "security": "https://github.com/sebastianbergmann/diff/security/policy" - }, - "prefer-stable": true, - "config": { - "platform": { - "php": "8.2.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "require": { - "php": ">=8.2" - }, - "require-dev": { - "phpunit/phpunit": "^11.0", - "symfony/process": "^4.2 || ^5" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/" - ] - }, - "extra": { - "branch-alias": { - "dev-main": "6.0-dev" - } - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Chunk.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Chunk.php deleted file mode 100644 index 8d1854e0..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Chunk.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -use ArrayIterator; -use IteratorAggregate; -use Traversable; - -/** - * @template-implements IteratorAggregate - */ -final class Chunk implements IteratorAggregate -{ - private int $start; - private int $startRange; - private int $end; - private int $endRange; - - /** - * @var list - */ - private array $lines; - - /** - * @param list $lines - */ - public function __construct(int $start = 0, int $startRange = 1, int $end = 0, int $endRange = 1, array $lines = []) - { - $this->start = $start; - $this->startRange = $startRange; - $this->end = $end; - $this->endRange = $endRange; - $this->lines = $lines; - } - - public function start(): int - { - return $this->start; - } - - public function startRange(): int - { - return $this->startRange; - } - - public function end(): int - { - return $this->end; - } - - public function endRange(): int - { - return $this->endRange; - } - - /** - * @return list - */ - public function lines(): array - { - return $this->lines; - } - - /** - * @param list $lines - */ - public function setLines(array $lines): void - { - foreach ($lines as $line) { - if (!$line instanceof Line) { - throw new InvalidArgumentException; - } - } - - $this->lines = $lines; - } - - public function getIterator(): Traversable - { - return new ArrayIterator($this->lines); - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Diff.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Diff.php deleted file mode 100644 index 372eb3d5..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Diff.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -use ArrayIterator; -use IteratorAggregate; -use Traversable; - -/** - * @template-implements IteratorAggregate - */ -final class Diff implements IteratorAggregate -{ - /** - * @var non-empty-string - */ - private string $from; - - /** - * @var non-empty-string - */ - private string $to; - - /** - * @var list - */ - private array $chunks; - - /** - * @param non-empty-string $from - * @param non-empty-string $to - * @param list $chunks - */ - public function __construct(string $from, string $to, array $chunks = []) - { - $this->from = $from; - $this->to = $to; - $this->chunks = $chunks; - } - - /** - * @return non-empty-string - */ - public function from(): string - { - return $this->from; - } - - /** - * @return non-empty-string - */ - public function to(): string - { - return $this->to; - } - - /** - * @return list - */ - public function chunks(): array - { - return $this->chunks; - } - - /** - * @param list $chunks - */ - public function setChunks(array $chunks): void - { - $this->chunks = $chunks; - } - - public function getIterator(): Traversable - { - return new ArrayIterator($this->chunks); - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Differ.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Differ.php deleted file mode 100644 index 86bd96c7..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Differ.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -use const PHP_INT_SIZE; -use const PREG_SPLIT_DELIM_CAPTURE; -use const PREG_SPLIT_NO_EMPTY; -use function array_shift; -use function array_unshift; -use function array_values; -use function count; -use function current; -use function end; -use function is_string; -use function key; -use function min; -use function preg_split; -use function prev; -use function reset; -use function str_ends_with; -use function substr; -use SebastianBergmann\Diff\Output\DiffOutputBuilderInterface; - -final class Differ -{ - public const OLD = 0; - public const ADDED = 1; - public const REMOVED = 2; - public const DIFF_LINE_END_WARNING = 3; - public const NO_LINE_END_EOF_WARNING = 4; - private DiffOutputBuilderInterface $outputBuilder; - - public function __construct(DiffOutputBuilderInterface $outputBuilder) - { - $this->outputBuilder = $outputBuilder; - } - - /** - * @param list|string $from - * @param list|string $to - */ - public function diff(array|string $from, array|string $to, ?LongestCommonSubsequenceCalculator $lcs = null): string - { - $diff = $this->diffToArray($from, $to, $lcs); - - return $this->outputBuilder->getDiff($diff); - } - - /** - * @param list|string $from - * @param list|string $to - */ - public function diffToArray(array|string $from, array|string $to, ?LongestCommonSubsequenceCalculator $lcs = null): array - { - if (is_string($from)) { - $from = $this->splitStringByLines($from); - } - - if (is_string($to)) { - $to = $this->splitStringByLines($to); - } - - [$from, $to, $start, $end] = self::getArrayDiffParted($from, $to); - - if ($lcs === null) { - $lcs = $this->selectLcsImplementation($from, $to); - } - - $common = $lcs->calculate(array_values($from), array_values($to)); - $diff = []; - - foreach ($start as $token) { - $diff[] = [$token, self::OLD]; - } - - reset($from); - reset($to); - - foreach ($common as $token) { - while (($fromToken = reset($from)) !== $token) { - $diff[] = [array_shift($from), self::REMOVED]; - } - - while (($toToken = reset($to)) !== $token) { - $diff[] = [array_shift($to), self::ADDED]; - } - - $diff[] = [$token, self::OLD]; - - array_shift($from); - array_shift($to); - } - - while (($token = array_shift($from)) !== null) { - $diff[] = [$token, self::REMOVED]; - } - - while (($token = array_shift($to)) !== null) { - $diff[] = [$token, self::ADDED]; - } - - foreach ($end as $token) { - $diff[] = [$token, self::OLD]; - } - - if ($this->detectUnmatchedLineEndings($diff)) { - array_unshift($diff, ["#Warning: Strings contain different line endings!\n", self::DIFF_LINE_END_WARNING]); - } - - return $diff; - } - - private function splitStringByLines(string $input): array - { - return preg_split('/(.*\R)/', $input, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - } - - private function selectLcsImplementation(array $from, array $to): LongestCommonSubsequenceCalculator - { - // We do not want to use the time-efficient implementation if its memory - // footprint will probably exceed this value. Note that the footprint - // calculation is only an estimation for the matrix and the LCS method - // will typically allocate a bit more memory than this. - $memoryLimit = 100 * 1024 * 1024; - - if ($this->calculateEstimatedFootprint($from, $to) > $memoryLimit) { - return new MemoryEfficientLongestCommonSubsequenceCalculator; - } - - return new TimeEfficientLongestCommonSubsequenceCalculator; - } - - private function calculateEstimatedFootprint(array $from, array $to): float|int - { - $itemSize = PHP_INT_SIZE === 4 ? 76 : 144; - - return $itemSize * min(count($from), count($to)) ** 2; - } - - private function detectUnmatchedLineEndings(array $diff): bool - { - $newLineBreaks = ['' => true]; - $oldLineBreaks = ['' => true]; - - foreach ($diff as $entry) { - if (self::OLD === $entry[1]) { - $ln = $this->getLinebreak($entry[0]); - $oldLineBreaks[$ln] = true; - $newLineBreaks[$ln] = true; - } elseif (self::ADDED === $entry[1]) { - $newLineBreaks[$this->getLinebreak($entry[0])] = true; - } elseif (self::REMOVED === $entry[1]) { - $oldLineBreaks[$this->getLinebreak($entry[0])] = true; - } - } - - // if either input or output is a single line without breaks than no warning should be raised - if (['' => true] === $newLineBreaks || ['' => true] === $oldLineBreaks) { - return false; - } - - // two-way compare - foreach ($newLineBreaks as $break => $set) { - if (!isset($oldLineBreaks[$break])) { - return true; - } - } - - foreach ($oldLineBreaks as $break => $set) { - if (!isset($newLineBreaks[$break])) { - return true; - } - } - - return false; - } - - private function getLinebreak($line): string - { - if (!is_string($line)) { - return ''; - } - - $lc = substr($line, -1); - - if ("\r" === $lc) { - return "\r"; - } - - if ("\n" !== $lc) { - return ''; - } - - if (str_ends_with($line, "\r\n")) { - return "\r\n"; - } - - return "\n"; - } - - private static function getArrayDiffParted(array &$from, array &$to): array - { - $start = []; - $end = []; - - reset($to); - - foreach ($from as $k => $v) { - $toK = key($to); - - if ($toK === $k && $v === $to[$k]) { - $start[$k] = $v; - - unset($from[$k], $to[$k]); - } else { - break; - } - } - - end($from); - end($to); - - do { - $fromK = key($from); - $toK = key($to); - - if (null === $fromK || null === $toK || current($from) !== current($to)) { - break; - } - - prev($from); - prev($to); - - $end = [$fromK => $from[$fromK]] + $end; - unset($from[$fromK], $to[$toK]); - } while (true); - - return [$from, $to, $start, $end]; - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/ConfigurationException.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/ConfigurationException.php deleted file mode 100644 index 4bd25d89..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/ConfigurationException.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -use function gettype; -use function is_object; -use function sprintf; -use Exception; - -final class ConfigurationException extends InvalidArgumentException -{ - public function __construct(string $option, string $expected, mixed $value, int $code = 0, ?Exception $previous = null) - { - parent::__construct( - sprintf( - 'Option "%s" must be %s, got "%s".', - $option, - $expected, - is_object($value) ? $value::class : (null === $value ? '' : gettype($value) . '#' . $value), - ), - $code, - $previous, - ); - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/Exception.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/Exception.php deleted file mode 100644 index e20d3203..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/Exception.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/InvalidArgumentException.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/InvalidArgumentException.php deleted file mode 100644 index 846ac3fb..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Line.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Line.php deleted file mode 100644 index be544f05..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Line.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -final class Line -{ - public const ADDED = 1; - public const REMOVED = 2; - public const UNCHANGED = 3; - private int $type; - private string $content; - - public function __construct(int $type = self::UNCHANGED, string $content = '') - { - $this->type = $type; - $this->content = $content; - } - - public function content(): string - { - return $this->content; - } - - public function type(): int - { - return $this->type; - } - - public function isAdded(): bool - { - return $this->type === self::ADDED; - } - - public function isRemoved(): bool - { - return $this->type === self::REMOVED; - } - - public function isUnchanged(): bool - { - return $this->type === self::UNCHANGED; - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/LongestCommonSubsequenceCalculator.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/LongestCommonSubsequenceCalculator.php deleted file mode 100644 index dea8fe1c..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/LongestCommonSubsequenceCalculator.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -interface LongestCommonSubsequenceCalculator -{ - /** - * Calculates the longest common subsequence of two arrays. - */ - public function calculate(array $from, array $to): array; -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php deleted file mode 100644 index b9846c37..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -use function array_fill; -use function array_merge; -use function array_reverse; -use function array_slice; -use function count; -use function in_array; -use function max; - -final class MemoryEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator -{ - /** - * @inheritDoc - */ - public function calculate(array $from, array $to): array - { - $cFrom = count($from); - $cTo = count($to); - - if ($cFrom === 0) { - return []; - } - - if ($cFrom === 1) { - if (in_array($from[0], $to, true)) { - return [$from[0]]; - } - - return []; - } - - $i = (int) ($cFrom / 2); - $fromStart = array_slice($from, 0, $i); - $fromEnd = array_slice($from, $i); - $llB = $this->length($fromStart, $to); - $llE = $this->length(array_reverse($fromEnd), array_reverse($to)); - $jMax = 0; - $max = 0; - - for ($j = 0; $j <= $cTo; $j++) { - $m = $llB[$j] + $llE[$cTo - $j]; - - if ($m >= $max) { - $max = $m; - $jMax = $j; - } - } - - $toStart = array_slice($to, 0, $jMax); - $toEnd = array_slice($to, $jMax); - - return array_merge( - $this->calculate($fromStart, $toStart), - $this->calculate($fromEnd, $toEnd), - ); - } - - private function length(array $from, array $to): array - { - $current = array_fill(0, count($to) + 1, 0); - $cFrom = count($from); - $cTo = count($to); - - for ($i = 0; $i < $cFrom; $i++) { - $prev = $current; - - for ($j = 0; $j < $cTo; $j++) { - if ($from[$i] === $to[$j]) { - $current[$j + 1] = $prev[$j] + 1; - } else { - /** - * @noinspection PhpConditionCanBeReplacedWithMinMaxCallInspection - * - * We do not use max() here to avoid the function call overhead - */ - if ($current[$j] > $prev[$j + 1]) { - $current[$j + 1] = $current[$j]; - } else { - $current[$j + 1] = $prev[$j + 1]; - } - } - } - } - - return $current; - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php deleted file mode 100644 index 6c706839..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff\Output; - -use function count; - -abstract class AbstractChunkOutputBuilder implements DiffOutputBuilderInterface -{ - /** - * Takes input of the diff array and returns the common parts. - * Iterates through diff line by line. - */ - protected function getCommonChunks(array $diff, int $lineThreshold = 5): array - { - $diffSize = count($diff); - $capturing = false; - $chunkStart = 0; - $chunkSize = 0; - $commonChunks = []; - - for ($i = 0; $i < $diffSize; $i++) { - if ($diff[$i][1] === 0 /* OLD */) { - if ($capturing === false) { - $capturing = true; - $chunkStart = $i; - $chunkSize = 0; - } else { - $chunkSize++; - } - } elseif ($capturing !== false) { - if ($chunkSize >= $lineThreshold) { - $commonChunks[$chunkStart] = $chunkStart + $chunkSize; - } - - $capturing = false; - } - } - - if ($capturing !== false && $chunkSize >= $lineThreshold) { - $commonChunks[$chunkStart] = $chunkStart + $chunkSize; - } - - return $commonChunks; - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php deleted file mode 100644 index fd6ce768..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff\Output; - -use function fclose; -use function fopen; -use function fwrite; -use function str_ends_with; -use function stream_get_contents; -use function substr; -use SebastianBergmann\Diff\Differ; - -/** - * Builds a diff string representation in a loose unified diff format - * listing only changes lines. Does not include line numbers. - */ -final class DiffOnlyOutputBuilder implements DiffOutputBuilderInterface -{ - private string $header; - - public function __construct(string $header = "--- Original\n+++ New\n") - { - $this->header = $header; - } - - public function getDiff(array $diff): string - { - $buffer = fopen('php://memory', 'r+b'); - - if ('' !== $this->header) { - fwrite($buffer, $this->header); - - if (!str_ends_with($this->header, "\n")) { - fwrite($buffer, "\n"); - } - } - - foreach ($diff as $diffEntry) { - if ($diffEntry[1] === Differ::ADDED) { - fwrite($buffer, '+' . $diffEntry[0]); - } elseif ($diffEntry[1] === Differ::REMOVED) { - fwrite($buffer, '-' . $diffEntry[0]); - } elseif ($diffEntry[1] === Differ::DIFF_LINE_END_WARNING) { - fwrite($buffer, ' ' . $diffEntry[0]); - - continue; // Warnings should not be tested for line break, it will always be there - } else { /* Not changed (old) 0 */ - continue; // we didn't write the not-changed line, so do not add a line break either - } - - $lc = substr($diffEntry[0], -1); - - if ($lc !== "\n" && $lc !== "\r") { - fwrite($buffer, "\n"); // \No newline at end of file - } - } - - $diff = stream_get_contents($buffer, -1, 0); - fclose($buffer); - - return $diff; - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/DiffOutputBuilderInterface.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/DiffOutputBuilderInterface.php deleted file mode 100644 index 0e18f9f2..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/DiffOutputBuilderInterface.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff\Output; - -/** - * Defines how an output builder should take a generated - * diff array and return a string representation of that diff. - */ -interface DiffOutputBuilderInterface -{ - public function getDiff(array $diff): string; -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php deleted file mode 100644 index 3bb5e0de..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php +++ /dev/null @@ -1,326 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff\Output; - -use function array_merge; -use function array_splice; -use function count; -use function fclose; -use function fopen; -use function fwrite; -use function is_bool; -use function is_int; -use function is_string; -use function max; -use function min; -use function sprintf; -use function stream_get_contents; -use function substr; -use SebastianBergmann\Diff\ConfigurationException; -use SebastianBergmann\Diff\Differ; - -/** - * Strict Unified diff output builder. - * - * Generates (strict) Unified diff's (unidiffs) with hunks. - */ -final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface -{ - private static array $default = [ - 'collapseRanges' => true, // ranges of length one are rendered with the trailing `,1` - 'commonLineThreshold' => 6, // number of same lines before ending a new hunk and creating a new one (if needed) - 'contextLines' => 3, // like `diff: -u, -U NUM, --unified[=NUM]`, for patch/git apply compatibility best to keep at least @ 3 - 'fromFile' => null, - 'fromFileDate' => null, - 'toFile' => null, - 'toFileDate' => null, - ]; - private bool $changed; - private bool $collapseRanges; - - /** - * @var positive-int - */ - private int $commonLineThreshold; - private string $header; - - /** - * @var positive-int - */ - private int $contextLines; - - public function __construct(array $options = []) - { - $options = array_merge(self::$default, $options); - - if (!is_bool($options['collapseRanges'])) { - throw new ConfigurationException('collapseRanges', 'a bool', $options['collapseRanges']); - } - - if (!is_int($options['contextLines']) || $options['contextLines'] < 0) { - throw new ConfigurationException('contextLines', 'an int >= 0', $options['contextLines']); - } - - if (!is_int($options['commonLineThreshold']) || $options['commonLineThreshold'] <= 0) { - throw new ConfigurationException('commonLineThreshold', 'an int > 0', $options['commonLineThreshold']); - } - - $this->assertString($options, 'fromFile'); - $this->assertString($options, 'toFile'); - $this->assertStringOrNull($options, 'fromFileDate'); - $this->assertStringOrNull($options, 'toFileDate'); - - $this->header = sprintf( - "--- %s%s\n+++ %s%s\n", - $options['fromFile'], - null === $options['fromFileDate'] ? '' : "\t" . $options['fromFileDate'], - $options['toFile'], - null === $options['toFileDate'] ? '' : "\t" . $options['toFileDate'], - ); - - $this->collapseRanges = $options['collapseRanges']; - $this->commonLineThreshold = $options['commonLineThreshold']; - $this->contextLines = $options['contextLines']; - } - - public function getDiff(array $diff): string - { - if (0 === count($diff)) { - return ''; - } - - $this->changed = false; - - $buffer = fopen('php://memory', 'r+b'); - fwrite($buffer, $this->header); - - $this->writeDiffHunks($buffer, $diff); - - if (!$this->changed) { - fclose($buffer); - - return ''; - } - - $diff = stream_get_contents($buffer, -1, 0); - - fclose($buffer); - - // If the last char is not a linebreak: add it. - // This might happen when both the `from` and `to` do not have a trailing linebreak - $last = substr($diff, -1); - - return "\n" !== $last && "\r" !== $last - ? $diff . "\n" - : $diff; - } - - private function writeDiffHunks($output, array $diff): void - { - // detect "No newline at end of file" and insert into `$diff` if needed - - $upperLimit = count($diff); - - if (0 === $diff[$upperLimit - 1][1]) { - $lc = substr($diff[$upperLimit - 1][0], -1); - - if ("\n" !== $lc) { - array_splice($diff, $upperLimit, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - } else { - // search back for the last `+` and `-` line, - // check if it has a trailing linebreak, else add a warning under it - $toFind = [1 => true, 2 => true]; - - for ($i = $upperLimit - 1; $i >= 0; $i--) { - if (isset($toFind[$diff[$i][1]])) { - unset($toFind[$diff[$i][1]]); - $lc = substr($diff[$i][0], -1); - - if ("\n" !== $lc) { - array_splice($diff, $i + 1, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - - if (!count($toFind)) { - break; - } - } - } - } - - // write hunks to output buffer - - $cutOff = max($this->commonLineThreshold, $this->contextLines); - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - $toStart = $fromStart = 1; - $i = 0; - - /** @var int $i */ - foreach ($diff as $i => $entry) { - if (0 === $entry[1]) { // same - if (false === $hunkCapture) { - $fromStart++; - $toStart++; - - continue; - } - - $sameCount++; - $toRange++; - $fromRange++; - - if ($sameCount === $cutOff) { - $contextStartOffset = ($hunkCapture - $this->contextLines) < 0 - ? $hunkCapture - : $this->contextLines; - - // note: $contextEndOffset = $this->contextLines; - // - // because we never go beyond the end of the diff. - // with the cutoff/contextlines here the follow is never true; - // - // if ($i - $cutOff + $this->contextLines + 1 > \count($diff)) { - // $contextEndOffset = count($diff) - 1; - // } - // - // ; that would be true for a trailing incomplete hunk case which is dealt with after this loop - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $cutOff + $this->contextLines + 1, - $fromStart - $contextStartOffset, - $fromRange - $cutOff + $contextStartOffset + $this->contextLines, - $toStart - $contextStartOffset, - $toRange - $cutOff + $contextStartOffset + $this->contextLines, - $output, - ); - - $fromStart += $fromRange; - $toStart += $toRange; - - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - } - - continue; - } - - $sameCount = 0; - - if ($entry[1] === Differ::NO_LINE_END_EOF_WARNING) { - continue; - } - - $this->changed = true; - - if (false === $hunkCapture) { - $hunkCapture = $i; - } - - if (Differ::ADDED === $entry[1]) { // added - $toRange++; - } - - if (Differ::REMOVED === $entry[1]) { // removed - $fromRange++; - } - } - - if (false === $hunkCapture) { - return; - } - - // we end here when cutoff (commonLineThreshold) was not reached, but we were capturing a hunk, - // do not render hunk till end automatically because the number of context lines might be less than the commonLineThreshold - - $contextStartOffset = $hunkCapture - $this->contextLines < 0 - ? $hunkCapture - : $this->contextLines; - - // prevent trying to write out more common lines than there are in the diff _and_ - // do not write more than configured through the context lines - $contextEndOffset = min($sameCount, $this->contextLines); - - $fromRange -= $sameCount; - $toRange -= $sameCount; - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $sameCount + $contextEndOffset + 1, - $fromStart - $contextStartOffset, - $fromRange + $contextStartOffset + $contextEndOffset, - $toStart - $contextStartOffset, - $toRange + $contextStartOffset + $contextEndOffset, - $output, - ); - } - - private function writeHunk( - array $diff, - int $diffStartIndex, - int $diffEndIndex, - int $fromStart, - int $fromRange, - int $toStart, - int $toRange, - $output - ): void { - fwrite($output, '@@ -' . $fromStart); - - if (!$this->collapseRanges || 1 !== $fromRange) { - fwrite($output, ',' . $fromRange); - } - - fwrite($output, ' +' . $toStart); - - if (!$this->collapseRanges || 1 !== $toRange) { - fwrite($output, ',' . $toRange); - } - - fwrite($output, " @@\n"); - - for ($i = $diffStartIndex; $i < $diffEndIndex; $i++) { - if ($diff[$i][1] === Differ::ADDED) { - $this->changed = true; - fwrite($output, '+' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::REMOVED) { - $this->changed = true; - fwrite($output, '-' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::OLD) { - fwrite($output, ' ' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::NO_LINE_END_EOF_WARNING) { - $this->changed = true; - fwrite($output, $diff[$i][0]); - } - // } elseif ($diff[$i][1] === Differ::DIFF_LINE_END_WARNING) { // custom comment inserted by PHPUnit/diff package - // skip - // } else { - // unknown/invalid - // } - } - } - - private function assertString(array $options, string $option): void - { - if (!is_string($options[$option])) { - throw new ConfigurationException($option, 'a string', $options[$option]); - } - } - - private function assertStringOrNull(array $options, string $option): void - { - if (null !== $options[$option] && !is_string($options[$option])) { - throw new ConfigurationException($option, 'a string or ', $options[$option]); - } - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php deleted file mode 100644 index fa6ae7a1..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php +++ /dev/null @@ -1,257 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff\Output; - -use function array_splice; -use function count; -use function fclose; -use function fopen; -use function fwrite; -use function max; -use function min; -use function str_ends_with; -use function stream_get_contents; -use function substr; -use SebastianBergmann\Diff\Differ; - -/** - * Builds a diff string representation in unified diff format in chunks. - */ -final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder -{ - private bool $collapseRanges = true; - private int $commonLineThreshold = 6; - - /** - * @var positive-int - */ - private int $contextLines = 3; - private string $header; - private bool $addLineNumbers; - - public function __construct(string $header = "--- Original\n+++ New\n", bool $addLineNumbers = false) - { - $this->header = $header; - $this->addLineNumbers = $addLineNumbers; - } - - public function getDiff(array $diff): string - { - $buffer = fopen('php://memory', 'r+b'); - - if ('' !== $this->header) { - fwrite($buffer, $this->header); - - if (!str_ends_with($this->header, "\n")) { - fwrite($buffer, "\n"); - } - } - - if (0 !== count($diff)) { - $this->writeDiffHunks($buffer, $diff); - } - - $diff = stream_get_contents($buffer, -1, 0); - - fclose($buffer); - - // If the diff is non-empty and last char is not a linebreak: add it. - // This might happen when both the `from` and `to` do not have a trailing linebreak - $last = substr($diff, -1); - - return '' !== $diff && "\n" !== $last && "\r" !== $last - ? $diff . "\n" - : $diff; - } - - private function writeDiffHunks($output, array $diff): void - { - // detect "No newline at end of file" and insert into `$diff` if needed - - $upperLimit = count($diff); - - if (0 === $diff[$upperLimit - 1][1]) { - $lc = substr($diff[$upperLimit - 1][0], -1); - - if ("\n" !== $lc) { - array_splice($diff, $upperLimit, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - } else { - // search back for the last `+` and `-` line, - // check if it has trailing linebreak, else add a warning under it - $toFind = [1 => true, 2 => true]; - - for ($i = $upperLimit - 1; $i >= 0; $i--) { - if (isset($toFind[$diff[$i][1]])) { - unset($toFind[$diff[$i][1]]); - $lc = substr($diff[$i][0], -1); - - if ("\n" !== $lc) { - array_splice($diff, $i + 1, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - - if (!count($toFind)) { - break; - } - } - } - } - - // write hunks to output buffer - - $cutOff = max($this->commonLineThreshold, $this->contextLines); - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - $toStart = $fromStart = 1; - $i = 0; - - /** @var int $i */ - foreach ($diff as $i => $entry) { - if (0 === $entry[1]) { // same - if (false === $hunkCapture) { - $fromStart++; - $toStart++; - - continue; - } - - $sameCount++; - $toRange++; - $fromRange++; - - if ($sameCount === $cutOff) { - $contextStartOffset = ($hunkCapture - $this->contextLines) < 0 - ? $hunkCapture - : $this->contextLines; - - // note: $contextEndOffset = $this->contextLines; - // - // because we never go beyond the end of the diff. - // with the cutoff/contextlines here the follow is never true; - // - // if ($i - $cutOff + $this->contextLines + 1 > \count($diff)) { - // $contextEndOffset = count($diff) - 1; - // } - // - // ; that would be true for a trailing incomplete hunk case which is dealt with after this loop - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $cutOff + $this->contextLines + 1, - $fromStart - $contextStartOffset, - $fromRange - $cutOff + $contextStartOffset + $this->contextLines, - $toStart - $contextStartOffset, - $toRange - $cutOff + $contextStartOffset + $this->contextLines, - $output, - ); - - $fromStart += $fromRange; - $toStart += $toRange; - - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - } - - continue; - } - - $sameCount = 0; - - if ($entry[1] === Differ::NO_LINE_END_EOF_WARNING) { - continue; - } - - if (false === $hunkCapture) { - $hunkCapture = $i; - } - - if (Differ::ADDED === $entry[1]) { - $toRange++; - } - - if (Differ::REMOVED === $entry[1]) { - $fromRange++; - } - } - - if (false === $hunkCapture) { - return; - } - - // we end here when cutoff (commonLineThreshold) was not reached, but we were capturing a hunk, - // do not render hunk till end automatically because the number of context lines might be less than the commonLineThreshold - - $contextStartOffset = $hunkCapture - $this->contextLines < 0 - ? $hunkCapture - : $this->contextLines; - - // prevent trying to write out more common lines than there are in the diff _and_ - // do not write more than configured through the context lines - $contextEndOffset = min($sameCount, $this->contextLines); - - $fromRange -= $sameCount; - $toRange -= $sameCount; - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $sameCount + $contextEndOffset + 1, - $fromStart - $contextStartOffset, - $fromRange + $contextStartOffset + $contextEndOffset, - $toStart - $contextStartOffset, - $toRange + $contextStartOffset + $contextEndOffset, - $output, - ); - } - - private function writeHunk( - array $diff, - int $diffStartIndex, - int $diffEndIndex, - int $fromStart, - int $fromRange, - int $toStart, - int $toRange, - $output - ): void { - if ($this->addLineNumbers) { - fwrite($output, '@@ -' . $fromStart); - - if (!$this->collapseRanges || 1 !== $fromRange) { - fwrite($output, ',' . $fromRange); - } - - fwrite($output, ' +' . $toStart); - - if (!$this->collapseRanges || 1 !== $toRange) { - fwrite($output, ',' . $toRange); - } - - fwrite($output, " @@\n"); - } else { - fwrite($output, "@@ @@\n"); - } - - for ($i = $diffStartIndex; $i < $diffEndIndex; $i++) { - if ($diff[$i][1] === Differ::ADDED) { - fwrite($output, '+' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::REMOVED) { - fwrite($output, '-' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::OLD) { - fwrite($output, ' ' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::NO_LINE_END_EOF_WARNING) { - fwrite($output, "\n"); // $diff[$i][0] - } else { /* Not changed (old) Differ::OLD or Warning Differ::DIFF_LINE_END_WARNING */ - fwrite($output, ' ' . $diff[$i][0]); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/Parser.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/Parser.php deleted file mode 100644 index 9293fc91..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/Parser.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -use function array_pop; -use function assert; -use function count; -use function max; -use function preg_match; -use function preg_split; - -/** - * Unified diff parser. - */ -final class Parser -{ - /** - * @return Diff[] - */ - public function parse(string $string): array - { - $lines = preg_split('(\r\n|\r|\n)', $string); - - if (!empty($lines) && $lines[count($lines) - 1] === '') { - array_pop($lines); - } - - $lineCount = count($lines); - $diffs = []; - $diff = null; - $collected = []; - - for ($i = 0; $i < $lineCount; $i++) { - if (preg_match('#^---\h+"?(?P[^\\v\\t"]+)#', $lines[$i], $fromMatch) && - preg_match('#^\\+\\+\\+\\h+"?(?P[^\\v\\t"]+)#', $lines[$i + 1], $toMatch)) { - if ($diff !== null) { - $this->parseFileDiff($diff, $collected); - - $diffs[] = $diff; - $collected = []; - } - - assert(!empty($fromMatch['file'])); - assert(!empty($toMatch['file'])); - - $diff = new Diff($fromMatch['file'], $toMatch['file']); - - $i++; - } else { - if (preg_match('/^(?:diff --git |index [\da-f.]+|[+-]{3} [ab])/', $lines[$i])) { - continue; - } - - $collected[] = $lines[$i]; - } - } - - if ($diff !== null && count($collected)) { - $this->parseFileDiff($diff, $collected); - - $diffs[] = $diff; - } - - return $diffs; - } - - private function parseFileDiff(Diff $diff, array $lines): void - { - $chunks = []; - $chunk = null; - $diffLines = []; - - foreach ($lines as $line) { - if (preg_match('/^@@\s+-(?P\d+)(?:,\s*(?P\d+))?\s+\+(?P\d+)(?:,\s*(?P\d+))?\s+@@/', $line, $match, PREG_UNMATCHED_AS_NULL)) { - $chunk = new Chunk( - (int) $match['start'], - isset($match['startrange']) ? max(0, (int) $match['startrange']) : 1, - (int) $match['end'], - isset($match['endrange']) ? max(0, (int) $match['endrange']) : 1, - ); - - $chunks[] = $chunk; - $diffLines = []; - - continue; - } - - if (preg_match('/^(?P[+ -])?(?P.*)/', $line, $match)) { - $type = Line::UNCHANGED; - - if ($match['type'] === '+') { - $type = Line::ADDED; - } elseif ($match['type'] === '-') { - $type = Line::REMOVED; - } - - $diffLines[] = new Line($type, $match['line']); - - $chunk?->setLines($diffLines); - } - } - - $diff->setChunks($chunks); - } -} diff --git a/tools/php-cs-fixer/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php b/tools/php-cs-fixer/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php deleted file mode 100644 index 93b76288..00000000 --- a/tools/php-cs-fixer/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -use function array_reverse; -use function count; -use function max; -use SplFixedArray; - -final class TimeEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator -{ - /** - * @inheritDoc - */ - public function calculate(array $from, array $to): array - { - $common = []; - $fromLength = count($from); - $toLength = count($to); - $width = $fromLength + 1; - $matrix = new SplFixedArray($width * ($toLength + 1)); - - for ($i = 0; $i <= $fromLength; $i++) { - $matrix[$i] = 0; - } - - for ($j = 0; $j <= $toLength; $j++) { - $matrix[$j * $width] = 0; - } - - for ($i = 1; $i <= $fromLength; $i++) { - for ($j = 1; $j <= $toLength; $j++) { - $o = ($j * $width) + $i; - - // don't use max() to avoid function call overhead - $firstOrLast = $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0; - - if ($matrix[$o - 1] > $matrix[$o - $width]) { - if ($firstOrLast > $matrix[$o - 1]) { - $matrix[$o] = $firstOrLast; - } else { - $matrix[$o] = $matrix[$o - 1]; - } - } else { - if ($firstOrLast > $matrix[$o - $width]) { - $matrix[$o] = $firstOrLast; - } else { - $matrix[$o] = $matrix[$o - $width]; - } - } - } - } - - $i = $fromLength; - $j = $toLength; - - while ($i > 0 && $j > 0) { - if ($from[$i - 1] === $to[$j - 1]) { - $common[] = $from[$i - 1]; - $i--; - $j--; - } else { - $o = ($j * $width) + $i; - - if ($matrix[$o - $width] > $matrix[$o - 1]) { - $j--; - } else { - $i--; - } - } - } - - return array_reverse($common); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Application.php b/tools/php-cs-fixer/vendor/symfony/console/Application.php deleted file mode 100644 index 78d885d2..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Application.php +++ /dev/null @@ -1,1330 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\CompleteCommand; -use Symfony\Component\Console\Command\DumpCompletionCommand; -use Symfony\Component\Console\Command\HelpCommand; -use Symfony\Component\Console\Command\LazyCommand; -use Symfony\Component\Console\Command\ListCommand; -use Symfony\Component\Console\Command\SignalableCommandInterface; -use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Suggestion; -use Symfony\Component\Console\Event\ConsoleAlarmEvent; -use Symfony\Component\Console\Event\ConsoleCommandEvent; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleSignalEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\Console\Exception\CommandNotFoundException; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Exception\NamespaceNotFoundException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\DebugFormatterHelper; -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\ProcessHelper; -use Symfony\Component\Console\Helper\QuestionHelper; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputAwareInterface; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\SignalRegistry\SignalRegistry; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\ErrorHandler\ErrorHandler; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -use Symfony\Contracts\Service\ResetInterface; - -/** - * An Application is the container for a collection of commands. - * - * It is the main entry point of a Console application. - * - * This class is optimized for a standard CLI environment. - * - * Usage: - * - * $app = new Application('myapp', '1.0 (stable)'); - * $app->add(new SimpleCommand()); - * $app->run(); - * - * @author Fabien Potencier - */ -class Application implements ResetInterface -{ - private array $commands = []; - private bool $wantHelps = false; - private ?Command $runningCommand = null; - private ?CommandLoaderInterface $commandLoader = null; - private bool $catchExceptions = true; - private bool $catchErrors = false; - private bool $autoExit = true; - private InputDefinition $definition; - private HelperSet $helperSet; - private ?EventDispatcherInterface $dispatcher = null; - private Terminal $terminal; - private string $defaultCommand; - private bool $singleCommand = false; - private bool $initialized = false; - private ?SignalRegistry $signalRegistry = null; - private array $signalsToDispatchEvent = []; - private ?int $alarmInterval = null; - - public function __construct( - private string $name = 'UNKNOWN', - private string $version = 'UNKNOWN', - ) { - $this->terminal = new Terminal(); - $this->defaultCommand = 'list'; - if (\defined('SIGINT') && SignalRegistry::isSupported()) { - $this->signalRegistry = new SignalRegistry(); - $this->signalsToDispatchEvent = [\SIGINT, \SIGQUIT, \SIGTERM, \SIGUSR1, \SIGUSR2, \SIGALRM]; - } - } - - /** - * @final - */ - public function setDispatcher(EventDispatcherInterface $dispatcher): void - { - $this->dispatcher = $dispatcher; - } - - public function setCommandLoader(CommandLoaderInterface $commandLoader): void - { - $this->commandLoader = $commandLoader; - } - - public function getSignalRegistry(): SignalRegistry - { - if (!$this->signalRegistry) { - throw new RuntimeException('Signals are not supported. Make sure that the "pcntl" extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } - - return $this->signalRegistry; - } - - public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent): void - { - $this->signalsToDispatchEvent = $signalsToDispatchEvent; - } - - /** - * Sets the interval to schedule a SIGALRM signal in seconds. - */ - public function setAlarmInterval(?int $seconds): void - { - $this->alarmInterval = $seconds; - $this->scheduleAlarm(); - } - - /** - * Gets the interval in seconds on which a SIGALRM signal is dispatched. - */ - public function getAlarmInterval(): ?int - { - return $this->alarmInterval; - } - - private function scheduleAlarm(): void - { - if (null !== $this->alarmInterval) { - $this->getSignalRegistry()->scheduleAlarm($this->alarmInterval); - } - } - - /** - * Runs the current application. - * - * @return int 0 if everything went fine, or an error code - * - * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. - */ - public function run(?InputInterface $input = null, ?OutputInterface $output = null): int - { - if (\function_exists('putenv')) { - @putenv('LINES='.$this->terminal->getHeight()); - @putenv('COLUMNS='.$this->terminal->getWidth()); - } - - $input ??= new ArgvInput(); - $output ??= new ConsoleOutput(); - - $renderException = function (\Throwable $e) use ($output) { - if ($output instanceof ConsoleOutputInterface) { - $this->renderThrowable($e, $output->getErrorOutput()); - } else { - $this->renderThrowable($e, $output); - } - }; - if ($phpHandler = set_exception_handler($renderException)) { - restore_exception_handler(); - if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler) { - $errorHandler = true; - } elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) { - $phpHandler[0]->setExceptionHandler($errorHandler); - } - } - - try { - $this->configureIO($input, $output); - - $exitCode = $this->doRun($input, $output); - } catch (\Throwable $e) { - if ($e instanceof \Exception && !$this->catchExceptions) { - throw $e; - } - if (!$e instanceof \Exception && !$this->catchErrors) { - throw $e; - } - - $renderException($e); - - $exitCode = $e->getCode(); - if (is_numeric($exitCode)) { - $exitCode = (int) $exitCode; - if ($exitCode <= 0) { - $exitCode = 1; - } - } else { - $exitCode = 1; - } - } finally { - // if the exception handler changed, keep it - // otherwise, unregister $renderException - if (!$phpHandler) { - if (set_exception_handler($renderException) === $renderException) { - restore_exception_handler(); - } - restore_exception_handler(); - } elseif (!$errorHandler) { - $finalHandler = $phpHandler[0]->setExceptionHandler(null); - if ($finalHandler !== $renderException) { - $phpHandler[0]->setExceptionHandler($finalHandler); - } - } - } - - if ($this->autoExit) { - if ($exitCode > 255) { - $exitCode = 255; - } - - exit($exitCode); - } - - return $exitCode; - } - - /** - * Runs the current application. - * - * @return int 0 if everything went fine, or an error code - */ - public function doRun(InputInterface $input, OutputInterface $output): int - { - if (true === $input->hasParameterOption(['--version', '-V'], true)) { - $output->writeln($this->getLongVersion()); - - return 0; - } - - try { - // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument. - $input->bind($this->getDefinition()); - } catch (ExceptionInterface) { - // Errors must be ignored, full binding/validation happens later when the command is known. - } - - $name = $this->getCommandName($input); - if (true === $input->hasParameterOption(['--help', '-h'], true)) { - if (!$name) { - $name = 'help'; - $input = new ArrayInput(['command_name' => $this->defaultCommand]); - } else { - $this->wantHelps = true; - } - } - - if (!$name) { - $name = $this->defaultCommand; - $definition = $this->getDefinition(); - $definition->setArguments(array_merge( - $definition->getArguments(), - [ - 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name), - ] - )); - } - - try { - $this->runningCommand = null; - // the command name MUST be the first element of the input - $command = $this->find($name); - } catch (\Throwable $e) { - if (($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) && 1 === \count($alternatives = $e->getAlternatives()) && $input->isInteractive()) { - $alternative = $alternatives[0]; - - $style = new SymfonyStyle($input, $output); - $output->writeln(''); - $formattedBlock = (new FormatterHelper())->formatBlock(\sprintf('Command "%s" is not defined.', $name), 'error', true); - $output->writeln($formattedBlock); - if (!$style->confirm(\sprintf('Do you want to run "%s" instead? ', $alternative), false)) { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - - return $event->getExitCode(); - } - - return 1; - } - - $command = $this->find($alternative); - } else { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - - if (0 === $event->getExitCode()) { - return 0; - } - - $e = $event->getError(); - } - - try { - if ($e instanceof CommandNotFoundException && $namespace = $this->findNamespace($name)) { - $helper = new DescriptorHelper(); - $helper->describe($output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output, $this, [ - 'format' => 'txt', - 'raw_text' => false, - 'namespace' => $namespace, - 'short' => false, - ]); - - return isset($event) ? $event->getExitCode() : 1; - } - - throw $e; - } catch (NamespaceNotFoundException) { - throw $e; - } - } - } - - if ($command instanceof LazyCommand) { - $command = $command->getCommand(); - } - - $this->runningCommand = $command; - $exitCode = $this->doRunCommand($command, $input, $output); - $this->runningCommand = null; - - return $exitCode; - } - - public function reset(): void - { - } - - public function setHelperSet(HelperSet $helperSet): void - { - $this->helperSet = $helperSet; - } - - /** - * Get the helper set associated with the command. - */ - public function getHelperSet(): HelperSet - { - return $this->helperSet ??= $this->getDefaultHelperSet(); - } - - public function setDefinition(InputDefinition $definition): void - { - $this->definition = $definition; - } - - /** - * Gets the InputDefinition related to this Application. - */ - public function getDefinition(): InputDefinition - { - $this->definition ??= $this->getDefaultInputDefinition(); - - if ($this->singleCommand) { - $inputDefinition = $this->definition; - $inputDefinition->setArguments(); - - return $inputDefinition; - } - - return $this->definition; - } - - /** - * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ( - CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType() - && 'command' === $input->getCompletionName() - ) { - foreach ($this->all() as $name => $command) { - // skip hidden commands and aliased commands as they already get added below - if ($command->isHidden() || $command->getName() !== $name) { - continue; - } - $suggestions->suggestValue(new Suggestion($command->getName(), $command->getDescription())); - foreach ($command->getAliases() as $name) { - $suggestions->suggestValue(new Suggestion($name, $command->getDescription())); - } - } - - return; - } - - if (CompletionInput::TYPE_OPTION_NAME === $input->getCompletionType()) { - $suggestions->suggestOptions($this->getDefinition()->getOptions()); - } - } - - /** - * Gets the help message. - */ - public function getHelp(): string - { - return $this->getLongVersion(); - } - - /** - * Gets whether to catch exceptions or not during commands execution. - */ - public function areExceptionsCaught(): bool - { - return $this->catchExceptions; - } - - /** - * Sets whether to catch exceptions or not during commands execution. - */ - public function setCatchExceptions(bool $boolean): void - { - $this->catchExceptions = $boolean; - } - - /** - * Sets whether to catch errors or not during commands execution. - */ - public function setCatchErrors(bool $catchErrors = true): void - { - $this->catchErrors = $catchErrors; - } - - /** - * Gets whether to automatically exit after a command execution or not. - */ - public function isAutoExitEnabled(): bool - { - return $this->autoExit; - } - - /** - * Sets whether to automatically exit after a command execution or not. - */ - public function setAutoExit(bool $boolean): void - { - $this->autoExit = $boolean; - } - - /** - * Gets the name of the application. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets the application name. - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Gets the application version. - */ - public function getVersion(): string - { - return $this->version; - } - - /** - * Sets the application version. - */ - public function setVersion(string $version): void - { - $this->version = $version; - } - - /** - * Returns the long version of the application. - */ - public function getLongVersion(): string - { - if ('UNKNOWN' !== $this->getName()) { - if ('UNKNOWN' !== $this->getVersion()) { - return \sprintf('%s %s', $this->getName(), $this->getVersion()); - } - - return $this->getName(); - } - - return 'Console Tool'; - } - - /** - * Registers a new command. - */ - public function register(string $name): Command - { - return $this->add(new Command($name)); - } - - /** - * Adds an array of command objects. - * - * If a Command is not enabled it will not be added. - * - * @param Command[] $commands An array of commands - */ - public function addCommands(array $commands): void - { - foreach ($commands as $command) { - $this->add($command); - } - } - - /** - * Adds a command object. - * - * If a command with the same name already exists, it will be overridden. - * If the command is not enabled it will not be added. - */ - public function add(Command $command): ?Command - { - $this->init(); - - $command->setApplication($this); - - if (!$command->isEnabled()) { - $command->setApplication(null); - - return null; - } - - if (!$command instanceof LazyCommand) { - // Will throw if the command is not correctly initialized. - $command->getDefinition(); - } - - if (!$command->getName()) { - throw new LogicException(\sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command))); - } - - $this->commands[$command->getName()] = $command; - - foreach ($command->getAliases() as $alias) { - $this->commands[$alias] = $command; - } - - return $command; - } - - /** - * Returns a registered command by name or alias. - * - * @throws CommandNotFoundException When given command name does not exist - */ - public function get(string $name): Command - { - $this->init(); - - if (!$this->has($name)) { - throw new CommandNotFoundException(\sprintf('The command "%s" does not exist.', $name)); - } - - // When the command has a different name than the one used at the command loader level - if (!isset($this->commands[$name])) { - throw new CommandNotFoundException(\sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name)); - } - - $command = $this->commands[$name]; - - if ($this->wantHelps) { - $this->wantHelps = false; - - $helpCommand = $this->get('help'); - $helpCommand->setCommand($command); - - return $helpCommand; - } - - return $command; - } - - /** - * Returns true if the command exists, false otherwise. - */ - public function has(string $name): bool - { - $this->init(); - - return isset($this->commands[$name]) || ($this->commandLoader?->has($name) && $this->add($this->commandLoader->get($name))); - } - - /** - * Returns an array of all unique namespaces used by currently registered commands. - * - * It does not return the global namespace which always exists. - * - * @return string[] - */ - public function getNamespaces(): array - { - $namespaces = []; - foreach ($this->all() as $command) { - if ($command->isHidden()) { - continue; - } - - $namespaces[] = $this->extractAllNamespaces($command->getName()); - - foreach ($command->getAliases() as $alias) { - $namespaces[] = $this->extractAllNamespaces($alias); - } - } - - return array_values(array_unique(array_filter(array_merge([], ...$namespaces)))); - } - - /** - * Finds a registered namespace by a name or an abbreviation. - * - * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous - */ - public function findNamespace(string $namespace): string - { - $allNamespaces = $this->getNamespaces(); - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*'; - $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); - - if (!$namespaces) { - $message = \sprintf('There are no commands defined in the "%s" namespace.', $namespace); - - if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) { - if (1 == \count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - - $message .= implode("\n ", $alternatives); - } - - throw new NamespaceNotFoundException($message, $alternatives); - } - - $exact = \in_array($namespace, $namespaces, true); - if (\count($namespaces) > 1 && !$exact) { - throw new NamespaceNotFoundException(\sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); - } - - return $exact ? $namespace : reset($namespaces); - } - - /** - * Finds a command by name or alias. - * - * Contrary to get, this command tries to find the best - * match if you give it an abbreviation of a name or alias. - * - * @throws CommandNotFoundException When command name is incorrect or ambiguous - */ - public function find(string $name): Command - { - $this->init(); - - $aliases = []; - - foreach ($this->commands as $command) { - foreach ($command->getAliases() as $alias) { - if (!$this->has($alias)) { - $this->commands[$alias] = $command; - } - } - } - - if ($this->has($name)) { - return $this->get($name); - } - - $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands); - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $name))).'[^:]*'; - $commands = preg_grep('{^'.$expr.'}', $allCommands); - - if (!$commands) { - $commands = preg_grep('{^'.$expr.'}i', $allCommands); - } - - // if no commands matched or we just matched namespaces - if (!$commands || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) { - if (false !== $pos = strrpos($name, ':')) { - // check if a namespace exists and contains commands - $this->findNamespace(substr($name, 0, $pos)); - } - - $message = \sprintf('Command "%s" is not defined.', $name); - - if ($alternatives = $this->findAlternatives($name, $allCommands)) { - // remove hidden commands - $alternatives = array_filter($alternatives, fn ($name) => !$this->get($name)->isHidden()); - - if (1 == \count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - $message .= implode("\n ", $alternatives); - } - - throw new CommandNotFoundException($message, array_values($alternatives)); - } - - // filter out aliases for commands which are already on the list - if (\count($commands) > 1) { - $commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands; - $commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) { - if (!$commandList[$nameOrAlias] instanceof Command) { - $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias); - } - - $commandName = $commandList[$nameOrAlias]->getName(); - - $aliases[$nameOrAlias] = $commandName; - - return $commandName === $nameOrAlias || !\in_array($commandName, $commands, true); - })); - } - - if (\count($commands) > 1) { - $usableWidth = $this->terminal->getWidth() - 10; - $abbrevs = array_values($commands); - $maxLen = 0; - foreach ($abbrevs as $abbrev) { - $maxLen = max(Helper::width($abbrev), $maxLen); - } - $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { - if ($commandList[$cmd]->isHidden()) { - unset($commands[array_search($cmd, $commands)]); - - return false; - } - - $abbrev = str_pad($cmd, $maxLen, ' ').' '.$commandList[$cmd]->getDescription(); - - return Helper::width($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev; - }, array_values($commands)); - - if (\count($commands) > 1) { - $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs)); - - throw new CommandNotFoundException(\sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); - } - } - - $command = $this->get(reset($commands)); - - if ($command->isHidden()) { - throw new CommandNotFoundException(\sprintf('The command "%s" does not exist.', $name)); - } - - return $command; - } - - /** - * Gets the commands (registered in the given namespace if provided). - * - * The array keys are the full names and the values the command instances. - * - * @return Command[] - */ - public function all(?string $namespace = null): array - { - $this->init(); - - if (null === $namespace) { - if (!$this->commandLoader) { - return $this->commands; - } - - $commands = $this->commands; - foreach ($this->commandLoader->getNames() as $name) { - if (!isset($commands[$name]) && $this->has($name)) { - $commands[$name] = $this->get($name); - } - } - - return $commands; - } - - $commands = []; - foreach ($this->commands as $name => $command) { - if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) { - $commands[$name] = $command; - } - } - - if ($this->commandLoader) { - foreach ($this->commandLoader->getNames() as $name) { - if (!isset($commands[$name]) && $namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1) && $this->has($name)) { - $commands[$name] = $this->get($name); - } - } - } - - return $commands; - } - - /** - * Returns an array of possible abbreviations given a set of names. - * - * @return string[][] - */ - public static function getAbbreviations(array $names): array - { - $abbrevs = []; - foreach ($names as $name) { - for ($len = \strlen($name); $len > 0; --$len) { - $abbrev = substr($name, 0, $len); - $abbrevs[$abbrev][] = $name; - } - } - - return $abbrevs; - } - - public function renderThrowable(\Throwable $e, OutputInterface $output): void - { - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - - $this->doRenderThrowable($e, $output); - - if (null !== $this->runningCommand) { - $output->writeln(\sprintf('%s', OutputFormatter::escape(\sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET); - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - } - } - - protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void - { - do { - $message = trim($e->getMessage()); - if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $class = get_debug_type($e); - $title = \sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); - $len = Helper::width($title); - } else { - $len = 0; - } - - if (str_contains($message, "@anonymous\0")) { - $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)?[0-9a-fA-F]++/', fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0], $message); - } - - $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX; - $lines = []; - foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) { - foreach ($this->splitStringByWidth($line, $width - 4) as $line) { - // pre-format lines to get the right string length - $lineLength = Helper::width($line) + 4; - $lines[] = [$line, $lineLength]; - - $len = max($lineLength, $len); - } - } - - $messages = []; - if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = \sprintf('%s', OutputFormatter::escape(\sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a'))); - } - $messages[] = $emptyLine = \sprintf('%s', str_repeat(' ', $len)); - if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = \sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::width($title)))); - } - foreach ($lines as $line) { - $messages[] = \sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); - } - $messages[] = $emptyLine; - $messages[] = ''; - - $output->writeln($messages, OutputInterface::VERBOSITY_QUIET); - - if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $output->writeln('Exception trace:', OutputInterface::VERBOSITY_QUIET); - - // exception related properties - $trace = $e->getTrace(); - - array_unshift($trace, [ - 'function' => '', - 'file' => $e->getFile() ?: 'n/a', - 'line' => $e->getLine() ?: 'n/a', - 'args' => [], - ]); - - for ($i = 0, $count = \count($trace); $i < $count; ++$i) { - $class = $trace[$i]['class'] ?? ''; - $type = $trace[$i]['type'] ?? ''; - $function = $trace[$i]['function'] ?? ''; - $file = $trace[$i]['file'] ?? 'n/a'; - $line = $trace[$i]['line'] ?? 'n/a'; - - $output->writeln(\sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); - } - - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - } - } while ($e = $e->getPrevious()); - } - - /** - * Configures the input and output instances based on the user arguments and options. - */ - protected function configureIO(InputInterface $input, OutputInterface $output): void - { - if (true === $input->hasParameterOption(['--ansi'], true)) { - $output->setDecorated(true); - } elseif (true === $input->hasParameterOption(['--no-ansi'], true)) { - $output->setDecorated(false); - } - - if (true === $input->hasParameterOption(['--no-interaction', '-n'], true)) { - $input->setInteractive(false); - } - - switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { - case -2: - $output->setVerbosity(OutputInterface::VERBOSITY_SILENT); - break; - case -1: - $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - break; - case 1: - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - break; - case 2: - $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); - break; - case 3: - $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); - break; - default: - $shellVerbosity = 0; - break; - } - - if (true === $input->hasParameterOption(['--silent'], true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_SILENT); - $shellVerbosity = -2; - } elseif (true === $input->hasParameterOption(['--quiet', '-q'], true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - $shellVerbosity = -1; - } else { - if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || 3 === $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); - $shellVerbosity = 3; - } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || 2 === $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); - $shellVerbosity = 2; - } elseif ($input->hasParameterOption('-v', true) || $input->hasParameterOption('--verbose=1', true) || $input->hasParameterOption('--verbose', true) || $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - $shellVerbosity = 1; - } - } - - if (0 > $shellVerbosity) { - $input->setInteractive(false); - } - - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY='.$shellVerbosity); - } - $_ENV['SHELL_VERBOSITY'] = $shellVerbosity; - $_SERVER['SHELL_VERBOSITY'] = $shellVerbosity; - } - - /** - * Runs the current command. - * - * If an event dispatcher has been attached to the application, - * events are also dispatched during the life-cycle of the command. - * - * @return int 0 if everything went fine, or an error code - */ - protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output): int - { - foreach ($command->getHelperSet() as $helper) { - if ($helper instanceof InputAwareInterface) { - $helper->setInput($input); - } - } - - $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; - if ($commandSignals || $this->dispatcher && $this->signalsToDispatchEvent) { - $signalRegistry = $this->getSignalRegistry(); - - if (Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); - - foreach ([\SIGINT, \SIGQUIT, \SIGTERM] as $signal) { - $signalRegistry->register($signal, static fn () => shell_exec('stty '.$sttyMode)); - } - } - - if ($this->dispatcher) { - // We register application signals, so that we can dispatch the event - foreach ($this->signalsToDispatchEvent as $signal) { - $signalEvent = new ConsoleSignalEvent($command, $input, $output, $signal); - $alarmEvent = \SIGALRM === $signal ? new ConsoleAlarmEvent($command, $input, $output) : null; - - $signalRegistry->register($signal, function ($signal) use ($signalEvent, $alarmEvent, $command, $commandSignals, $input, $output) { - $this->dispatcher->dispatch($signalEvent, ConsoleEvents::SIGNAL); - $exitCode = $signalEvent->getExitCode(); - - if (null !== $alarmEvent) { - if (false !== $exitCode) { - $alarmEvent->setExitCode($exitCode); - } else { - $alarmEvent->abortExit(); - } - $this->dispatcher->dispatch($alarmEvent); - $exitCode = $alarmEvent->getExitCode(); - } - - // If the command is signalable, we call the handleSignal() method - if (\in_array($signal, $commandSignals, true)) { - $exitCode = $command->handleSignal($signal, $exitCode); - } - - if (\SIGALRM === $signal) { - $this->scheduleAlarm(); - } - - if (false !== $exitCode) { - $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode, $signal); - $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE); - - exit($event->getExitCode()); - } - }); - } - - // then we register command signals, but not if already handled after the dispatcher - $commandSignals = array_diff($commandSignals, $this->signalsToDispatchEvent); - } - - foreach ($commandSignals as $signal) { - $signalRegistry->register($signal, function (int $signal) use ($command): void { - if (\SIGALRM === $signal) { - $this->scheduleAlarm(); - } - - if (false !== $exitCode = $command->handleSignal($signal)) { - exit($exitCode); - } - }); - } - } - - if (null === $this->dispatcher) { - return $command->run($input, $output); - } - - // bind before the console.command event, so the listeners have access to input options/arguments - try { - $command->mergeApplicationDefinition(); - $input->bind($command->getDefinition()); - } catch (ExceptionInterface) { - // ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition - } - - $event = new ConsoleCommandEvent($command, $input, $output); - $e = null; - - try { - $this->dispatcher->dispatch($event, ConsoleEvents::COMMAND); - - if ($event->commandShouldRun()) { - $exitCode = $command->run($input, $output); - } else { - $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED; - } - } catch (\Throwable $e) { - $event = new ConsoleErrorEvent($input, $output, $e, $command); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - $e = $event->getError(); - - if (0 === $exitCode = $event->getExitCode()) { - $e = null; - } - } - - $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); - $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE); - - if (null !== $e) { - throw $e; - } - - return $event->getExitCode(); - } - - /** - * Gets the name of the command based on input. - */ - protected function getCommandName(InputInterface $input): ?string - { - return $this->singleCommand ? $this->defaultCommand : $input->getFirstArgument(); - } - - /** - * Gets the default input definition. - */ - protected function getDefaultInputDefinition(): InputDefinition - { - return new InputDefinition([ - new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the '.$this->defaultCommand.' command'), - new InputOption('--silent', null, InputOption::VALUE_NONE, 'Do not output any message'), - new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Only errors are displayed. All other output is suppressed'), - new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), - new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), - new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', null), - new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), - ]); - } - - /** - * Gets the default commands that should always be available. - * - * @return Command[] - */ - protected function getDefaultCommands(): array - { - return [new HelpCommand(), new ListCommand(), new CompleteCommand(), new DumpCompletionCommand()]; - } - - /** - * Gets the default helper set with the helpers that should always be available. - */ - protected function getDefaultHelperSet(): HelperSet - { - return new HelperSet([ - new FormatterHelper(), - new DebugFormatterHelper(), - new ProcessHelper(), - new QuestionHelper(), - ]); - } - - /** - * Returns abbreviated suggestions in string format. - */ - private function getAbbreviationSuggestions(array $abbrevs): string - { - return ' '.implode("\n ", $abbrevs); - } - - /** - * Returns the namespace part of the command name. - * - * This method is not part of public API and should not be used directly. - */ - public function extractNamespace(string $name, ?int $limit = null): string - { - $parts = explode(':', $name, -1); - - return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit)); - } - - /** - * Finds alternative of $name among $collection, - * if nothing is found in $collection, try in $abbrevs. - * - * @return string[] - */ - private function findAlternatives(string $name, iterable $collection): array - { - $threshold = 1e3; - $alternatives = []; - - $collectionParts = []; - foreach ($collection as $item) { - $collectionParts[$item] = explode(':', $item); - } - - foreach (explode(':', $name) as $i => $subname) { - foreach ($collectionParts as $collectionName => $parts) { - $exists = isset($alternatives[$collectionName]); - if (!isset($parts[$i]) && $exists) { - $alternatives[$collectionName] += $threshold; - continue; - } elseif (!isset($parts[$i])) { - continue; - } - - $lev = levenshtein($subname, $parts[$i]); - if ($lev <= \strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) { - $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev; - } elseif ($exists) { - $alternatives[$collectionName] += $threshold; - } - } - } - - foreach ($collection as $item) { - $lev = levenshtein($name, $item); - if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) { - $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev; - } - } - - $alternatives = array_filter($alternatives, fn ($lev) => $lev < 2 * $threshold); - ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE); - - return array_keys($alternatives); - } - - /** - * Sets the default Command name. - * - * @return $this - */ - public function setDefaultCommand(string $commandName, bool $isSingleCommand = false): static - { - $this->defaultCommand = explode('|', ltrim($commandName, '|'))[0]; - - if ($isSingleCommand) { - // Ensure the command exist - $this->find($commandName); - - $this->singleCommand = true; - } - - return $this; - } - - /** - * @internal - */ - public function isSingleCommand(): bool - { - return $this->singleCommand; - } - - private function splitStringByWidth(string $string, int $width): array - { - // str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly. - // additionally, array_slice() is not enough as some character has doubled width. - // we need a function to split string not by character count but by string width - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return str_split($string, $width); - } - - $utf8String = mb_convert_encoding($string, 'utf8', $encoding); - $lines = []; - $line = ''; - - $offset = 0; - while (preg_match('/.{1,10000}/u', $utf8String, $m, 0, $offset)) { - $offset += \strlen($m[0]); - - foreach (preg_split('//u', $m[0]) as $char) { - // test if $char could be appended to current line - if (mb_strwidth($line.$char, 'utf8') <= $width) { - $line .= $char; - continue; - } - // if not, push current line to array and make new line - $lines[] = str_pad($line, $width); - $line = $char; - } - } - - $lines[] = \count($lines) ? str_pad($line, $width) : $line; - - mb_convert_variables($encoding, 'utf8', $lines); - - return $lines; - } - - /** - * Returns all namespaces of the command name. - * - * @return string[] - */ - private function extractAllNamespaces(string $name): array - { - // -1 as third argument is needed to skip the command short name when exploding - $parts = explode(':', $name, -1); - $namespaces = []; - - foreach ($parts as $part) { - if (\count($namespaces)) { - $namespaces[] = end($namespaces).':'.$part; - } else { - $namespaces[] = $part; - } - } - - return $namespaces; - } - - private function init(): void - { - if ($this->initialized) { - return; - } - $this->initialized = true; - - foreach ($this->getDefaultCommands() as $command) { - $this->add($command); - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Attribute/AsCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Attribute/AsCommand.php deleted file mode 100644 index 6066d7c5..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Attribute/AsCommand.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Attribute; - -/** - * Service tag to autoconfigure commands. - */ -#[\Attribute(\Attribute::TARGET_CLASS)] -class AsCommand -{ - /** - * @param string $name The name of the command, used when calling it (i.e. "cache:clear") - * @param string|null $description The description of the command, displayed with the help page - * @param string[] $aliases The list of aliases of the command. The command will be executed when using one of them (i.e. "cache:clean") - * @param bool $hidden If true, the command won't be shown when listing all the available commands, but it can still be run as any other command - */ - public function __construct( - public string $name, - public ?string $description = null, - array $aliases = [], - bool $hidden = false, - ) { - if (!$hidden && !$aliases) { - return; - } - - $name = explode('|', $name); - $name = array_merge($name, $aliases); - - if ($hidden && '' !== $name[0]) { - array_unshift($name, ''); - } - - $this->name = implode('|', $name); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/console/CHANGELOG.md deleted file mode 100644 index 2c963568..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/CHANGELOG.md +++ /dev/null @@ -1,284 +0,0 @@ -CHANGELOG -========= - -7.2 ---- - - * Add support for `FORCE_COLOR` environment variable - * Add `verbosity` argument to `mustRun` process helper method - * [BC BREAK] Add silent verbosity (`--silent`/`SHELL_VERBOSITY=-2`) to suppress all output, including errors - * Add `OutputInterface::isSilent()`, `Output::isSilent()`, `OutputStyle::isSilent()` methods - * Add a configurable finished indicator to the progress indicator to show that the progress is finished - * Add ability to schedule alarm signals and a `ConsoleAlarmEvent` - -7.1 ---- - - * Add `ArgvInput::getRawTokens()` - -7.0 ---- - - * Add method `__toString()` to `InputInterface` - * Remove `Command::$defaultName` and `Command::$defaultDescription`, use the `AsCommand` attribute instead - * Require explicit argument when calling `*Command::setApplication()`, `*FormatterStyle::setForeground/setBackground()`, `Helper::setHelpSet()`, `Input*::setDefault()` and `Question::setAutocompleterCallback/setValidator()` - * Remove `StringInput::REGEX_STRING` - -6.4 ---- - - * Add `SignalMap` to map signal value to its name - * Multi-line text in vertical tables is aligned properly - * The application can also catch errors with `Application::setCatchErrors(true)` - * Add `RunCommandMessage` and `RunCommandMessageHandler` - * Dispatch `ConsoleTerminateEvent` after an exit on signal handling and add `ConsoleTerminateEvent::getInterruptingSignal()` - -6.3 ---- - - * Add support for choosing exit code while handling signal, or to not exit at all - * Add `ProgressBar::setPlaceholderFormatter` to set a placeholder attached to a instance, instead of being global. - * Add `ReStructuredTextDescriptor` - -6.2 ---- - - * Improve truecolor terminal detection in some cases - * Add support for 256 color terminals (conversion from Ansi24 to Ansi8 if terminal is capable of it) - * Deprecate calling `*Command::setApplication()`, `*FormatterStyle::setForeground/setBackground()`, `Helper::setHelpSet()`, `Input*::setDefault()`, `Question::setAutocompleterCallback/setValidator()`without any arguments - * Change the signature of `OutputFormatterStyleInterface::setForeground/setBackground()` to `setForeground/setBackground(?string)` - * Change the signature of `HelperInterface::setHelperSet()` to `setHelperSet(?HelperSet)` - -6.1 ---- - - * Add support to display table vertically when calling setVertical() - * Add method `__toString()` to `InputInterface` - * Added `OutputWrapper` to prevent truncated URL in `SymfonyStyle::createBlock`. - * Deprecate `Command::$defaultName` and `Command::$defaultDescription`, use the `AsCommand` attribute instead - * Add suggested values for arguments and options in input definition, for input completion - * Add `$resumeAt` parameter to `ProgressBar#start()`, so that one can easily 'resume' progress on longer tasks, and still get accurate `getEstimate()` and `getRemaining()` results. - -6.0 ---- - - * `Command::setHidden()` has a default value (`true`) for `$hidden` parameter and is final - * Remove `Helper::strlen()`, use `Helper::width()` instead - * Remove `Helper::strlenWithoutDecoration()`, use `Helper::removeDecoration()` instead - * `AddConsoleCommandPass` can not be configured anymore - * Remove `HelperSet::setCommand()` and `getCommand()` without replacement - -5.4 ---- - - * Add `TesterTrait::assertCommandIsSuccessful()` to test command - * Deprecate `HelperSet::setCommand()` and `getCommand()` without replacement - -5.3 ---- - - * Add `GithubActionReporter` to render annotations in a Github Action - * Add `InputOption::VALUE_NEGATABLE` flag to handle `--foo`/`--no-foo` options - * Add the `Command::$defaultDescription` static property and the `description` attribute - on the `console.command` tag to allow the `list` command to instantiate commands lazily - * Add option `--short` to the `list` command - * Add support for bright colors - * Add `#[AsCommand]` attribute for declaring commands on PHP 8 - * Add `Helper::width()` and `Helper::length()` - * The `--ansi` and `--no-ansi` options now default to `null`. - -5.2.0 ------ - - * Added `SingleCommandApplication::setAutoExit()` to allow testing via `CommandTester` - * added support for multiline responses to questions through `Question::setMultiline()` - and `Question::isMultiline()` - * Added `SignalRegistry` class to stack signals handlers - * Added support for signals: - * Added `Application::getSignalRegistry()` and `Application::setSignalsToDispatchEvent()` methods - * Added `SignalableCommandInterface` interface - * Added `TableCellStyle` class to customize table cell - * Removed `php ` prefix invocation from help messages. - -5.1.0 ------ - - * `Command::setHidden()` is final since Symfony 5.1 - * Add `SingleCommandApplication` - * Add `Cursor` class - -5.0.0 ------ - - * removed support for finding hidden commands using an abbreviation, use the full name instead - * removed `TableStyle::setCrossingChar()` method in favor of `TableStyle::setDefaultCrossingChar()` - * removed `TableStyle::setHorizontalBorderChar()` method in favor of `TableStyle::setDefaultCrossingChars()` - * removed `TableStyle::getHorizontalBorderChar()` method in favor of `TableStyle::getBorderChars()` - * removed `TableStyle::setVerticalBorderChar()` method in favor of `TableStyle::setVerticalBorderChars()` - * removed `TableStyle::getVerticalBorderChar()` method in favor of `TableStyle::getBorderChars()` - * removed support for returning `null` from `Command::execute()`, return `0` instead - * `ProcessHelper::run()` accepts only `array|Symfony\Component\Process\Process` for its `command` argument - * `Application::setDispatcher` accepts only `Symfony\Contracts\EventDispatcher\EventDispatcherInterface` - for its `dispatcher` argument - * renamed `Application::renderException()` and `Application::doRenderException()` - to `renderThrowable()` and `doRenderThrowable()` respectively. - -4.4.0 ------ - - * deprecated finding hidden commands using an abbreviation, use the full name instead - * added `Question::setTrimmable` default to true to allow the answer to be trimmed - * added method `minSecondsBetweenRedraws()` and `maxSecondsBetweenRedraws()` on `ProgressBar` - * `Application` implements `ResetInterface` - * marked all dispatched event classes as `@final` - * added support for displaying table horizontally - * deprecated returning `null` from `Command::execute()`, return `0` instead - * Deprecated the `Application::renderException()` and `Application::doRenderException()` methods, - use `renderThrowable()` and `doRenderThrowable()` instead. - * added support for the `NO_COLOR` env var (https://no-color.org/) - -4.3.0 ------ - - * added support for hyperlinks - * added `ProgressBar::iterate()` method that simplify updating the progress bar when iterating - * added `Question::setAutocompleterCallback()` to provide a callback function - that dynamically generates suggestions as the user types - -4.2.0 ------ - - * allowed passing commands as `[$process, 'ENV_VAR' => 'value']` to - `ProcessHelper::run()` to pass environment variables - * deprecated passing a command as a string to `ProcessHelper::run()`, - pass it the command as an array of its arguments instead - * made the `ProcessHelper` class final - * added `WrappableOutputFormatterInterface::formatAndWrap()` (implemented in `OutputFormatter`) - * added `capture_stderr_separately` option to `CommandTester::execute()` - -4.1.0 ------ - - * added option to run suggested command if command is not found and only 1 alternative is available - * added option to modify console output and print multiple modifiable sections - * added support for iterable messages in output `write` and `writeln` methods - -4.0.0 ------ - - * `OutputFormatter` throws an exception when unknown options are used - * removed `QuestionHelper::setInputStream()/getInputStream()` - * removed `Application::getTerminalWidth()/getTerminalHeight()` and - `Application::setTerminalDimensions()/getTerminalDimensions()` - * removed `ConsoleExceptionEvent` - * removed `ConsoleEvents::EXCEPTION` - -3.4.0 ------ - - * added `SHELL_VERBOSITY` env var to control verbosity - * added `CommandLoaderInterface`, `FactoryCommandLoader` and PSR-11 - `ContainerCommandLoader` for commands lazy-loading - * added a case-insensitive command name matching fallback - * added static `Command::$defaultName/getDefaultName()`, allowing for - commands to be registered at compile time in the application command loader. - Setting the `$defaultName` property avoids the need for filling the `command` - attribute on the `console.command` tag when using `AddConsoleCommandPass`. - -3.3.0 ------ - - * added `ExceptionListener` - * added `AddConsoleCommandPass` (originally in FrameworkBundle) - * [BC BREAK] `Input::getOption()` no longer returns the default value for options - with value optional explicitly passed empty - * added console.error event to catch exceptions thrown by other listeners - * deprecated console.exception event in favor of console.error - * added ability to handle `CommandNotFoundException` through the - `console.error` event - * deprecated default validation in `SymfonyQuestionHelper::ask` - -3.2.0 ------- - - * added `setInputs()` method to CommandTester for ease testing of commands expecting inputs - * added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) - * added StreamableInputInterface - * added LockableTrait - -3.1.0 ------ - - * added truncate method to FormatterHelper - * added setColumnWidth(s) method to Table - -2.8.3 ------ - - * remove readline support from the question helper as it caused issues - -2.8.0 ------ - - * use readline for user input in the question helper when available to allow - the use of arrow keys - -2.6.0 ------ - - * added a Process helper - * added a DebugFormatter helper - -2.5.0 ------ - - * deprecated the dialog helper (use the question helper instead) - * deprecated TableHelper in favor of Table - * deprecated ProgressHelper in favor of ProgressBar - * added ConsoleLogger - * added a question helper - * added a way to set the process name of a command - * added a way to set a default command instead of `ListCommand` - -2.4.0 ------ - - * added a way to force terminal dimensions - * added a convenient method to detect verbosity level - * [BC BREAK] made descriptors use output instead of returning a string - -2.3.0 ------ - - * added multiselect support to the select dialog helper - * added Table Helper for tabular data rendering - * added support for events in `Application` - * added a way to normalize EOLs in `ApplicationTester::getDisplay()` and `CommandTester::getDisplay()` - * added a way to set the progress bar progress via the `setCurrent` method - * added support for multiple InputOption shortcuts, written as `'-a|-b|-c'` - * added two additional verbosity levels, VERBOSITY_VERY_VERBOSE and VERBOSITY_DEBUG - -2.2.0 ------ - - * added support for colorization on Windows via ConEmu - * add a method to Dialog Helper to ask for a question and hide the response - * added support for interactive selections in console (DialogHelper::select()) - * added support for autocompletion as you type in Dialog Helper - -2.1.0 ------ - - * added ConsoleOutputInterface - * added the possibility to disable a command (Command::isEnabled()) - * added suggestions when a command does not exist - * added a --raw option to the list command - * added support for STDERR in the console output class (errors are now sent - to STDERR) - * made the defaults (helper set, commands, input definition) in Application - more easily customizable - * added support for the shell even if readline is not available - * added support for process isolation in Symfony shell via - `--process-isolation` switch - * added support for `--`, which disables options parsing after that point - (tokens will be parsed as arguments) diff --git a/tools/php-cs-fixer/vendor/symfony/console/CI/GithubActionReporter.php b/tools/php-cs-fixer/vendor/symfony/console/CI/GithubActionReporter.php deleted file mode 100644 index 952d380d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/CI/GithubActionReporter.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CI; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Utility class for Github actions. - * - * @author Maxime Steinhausser - */ -class GithubActionReporter -{ - /** - * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L80-L85 - */ - private const ESCAPED_DATA = [ - '%' => '%25', - "\r" => '%0D', - "\n" => '%0A', - ]; - - /** - * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L87-L94 - */ - private const ESCAPED_PROPERTIES = [ - '%' => '%25', - "\r" => '%0D', - "\n" => '%0A', - ':' => '%3A', - ',' => '%2C', - ]; - - public function __construct( - private OutputInterface $output, - ) { - } - - public static function isGithubActionEnvironment(): bool - { - return false !== getenv('GITHUB_ACTIONS'); - } - - /** - * Output an error using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message - */ - public function error(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void - { - $this->log('error', $message, $file, $line, $col); - } - - /** - * Output a warning using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message - */ - public function warning(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void - { - $this->log('warning', $message, $file, $line, $col); - } - - /** - * Output a debug log using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message - */ - public function debug(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void - { - $this->log('debug', $message, $file, $line, $col); - } - - private function log(string $type, string $message, ?string $file = null, ?int $line = null, ?int $col = null): void - { - // Some values must be encoded. - $message = strtr($message, self::ESCAPED_DATA); - - if (!$file) { - // No file provided, output the message solely: - $this->output->writeln(\sprintf('::%s::%s', $type, $message)); - - return; - } - - $this->output->writeln(\sprintf('::%s file=%s,line=%s,col=%s::%s', $type, strtr($file, self::ESCAPED_PROPERTIES), strtr($line ?? 1, self::ESCAPED_PROPERTIES), strtr($col ?? 0, self::ESCAPED_PROPERTIES), $message)); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Color.php b/tools/php-cs-fixer/vendor/symfony/console/Color.php deleted file mode 100644 index b1914c19..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Color.php +++ /dev/null @@ -1,133 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Fabien Potencier - */ -final class Color -{ - private const COLORS = [ - 'black' => 0, - 'red' => 1, - 'green' => 2, - 'yellow' => 3, - 'blue' => 4, - 'magenta' => 5, - 'cyan' => 6, - 'white' => 7, - 'default' => 9, - ]; - - private const BRIGHT_COLORS = [ - 'gray' => 0, - 'bright-red' => 1, - 'bright-green' => 2, - 'bright-yellow' => 3, - 'bright-blue' => 4, - 'bright-magenta' => 5, - 'bright-cyan' => 6, - 'bright-white' => 7, - ]; - - private const AVAILABLE_OPTIONS = [ - 'bold' => ['set' => 1, 'unset' => 22], - 'underscore' => ['set' => 4, 'unset' => 24], - 'blink' => ['set' => 5, 'unset' => 25], - 'reverse' => ['set' => 7, 'unset' => 27], - 'conceal' => ['set' => 8, 'unset' => 28], - ]; - - private string $foreground; - private string $background; - private array $options = []; - - public function __construct(string $foreground = '', string $background = '', array $options = []) - { - $this->foreground = $this->parseColor($foreground); - $this->background = $this->parseColor($background, true); - - foreach ($options as $option) { - if (!isset(self::AVAILABLE_OPTIONS[$option])) { - throw new InvalidArgumentException(\sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(self::AVAILABLE_OPTIONS)))); - } - - $this->options[$option] = self::AVAILABLE_OPTIONS[$option]; - } - } - - public function apply(string $text): string - { - return $this->set().$text.$this->unset(); - } - - public function set(): string - { - $setCodes = []; - if ('' !== $this->foreground) { - $setCodes[] = $this->foreground; - } - if ('' !== $this->background) { - $setCodes[] = $this->background; - } - foreach ($this->options as $option) { - $setCodes[] = $option['set']; - } - if (0 === \count($setCodes)) { - return ''; - } - - return \sprintf("\033[%sm", implode(';', $setCodes)); - } - - public function unset(): string - { - $unsetCodes = []; - if ('' !== $this->foreground) { - $unsetCodes[] = 39; - } - if ('' !== $this->background) { - $unsetCodes[] = 49; - } - foreach ($this->options as $option) { - $unsetCodes[] = $option['unset']; - } - if (0 === \count($unsetCodes)) { - return ''; - } - - return \sprintf("\033[%sm", implode(';', $unsetCodes)); - } - - private function parseColor(string $color, bool $background = false): string - { - if ('' === $color) { - return ''; - } - - if ('#' === $color[0]) { - return ($background ? '4' : '3').Terminal::getColorMode()->convertFromHexToAnsiColorCode($color); - } - - if (isset(self::COLORS[$color])) { - return ($background ? '4' : '3').self::COLORS[$color]; - } - - if (isset(self::BRIGHT_COLORS[$color])) { - return ($background ? '10' : '9').self::BRIGHT_COLORS[$color]; - } - - throw new InvalidArgumentException(\sprintf('Invalid "%s" color; expected one of (%s).', $color, implode(', ', array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS))))); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/Command.php b/tools/php-cs-fixer/vendor/symfony/console/Command/Command.php deleted file mode 100644 index 244a419f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/Command.php +++ /dev/null @@ -1,664 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Suggestion; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Helper\HelperInterface; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Base class for all commands. - * - * @author Fabien Potencier - */ -class Command -{ - // see https://tldp.org/LDP/abs/html/exitcodes.html - public const SUCCESS = 0; - public const FAILURE = 1; - public const INVALID = 2; - - private ?Application $application = null; - private ?string $name = null; - private ?string $processTitle = null; - private array $aliases = []; - private InputDefinition $definition; - private bool $hidden = false; - private string $help = ''; - private string $description = ''; - private ?InputDefinition $fullDefinition = null; - private bool $ignoreValidationErrors = false; - private ?\Closure $code = null; - private array $synopsis = []; - private array $usages = []; - private ?HelperSet $helperSet = null; - - public static function getDefaultName(): ?string - { - if ($attribute = (new \ReflectionClass(static::class))->getAttributes(AsCommand::class)) { - return $attribute[0]->newInstance()->name; - } - - return null; - } - - public static function getDefaultDescription(): ?string - { - if ($attribute = (new \ReflectionClass(static::class))->getAttributes(AsCommand::class)) { - return $attribute[0]->newInstance()->description; - } - - return null; - } - - /** - * @param string|null $name The name of the command; passing null means it must be set in configure() - * - * @throws LogicException When the command name is empty - */ - public function __construct(?string $name = null) - { - $this->definition = new InputDefinition(); - - if (null === $name && null !== $name = static::getDefaultName()) { - $aliases = explode('|', $name); - - if ('' === $name = array_shift($aliases)) { - $this->setHidden(true); - $name = array_shift($aliases); - } - - $this->setAliases($aliases); - } - - if (null !== $name) { - $this->setName($name); - } - - if ('' === $this->description) { - $this->setDescription(static::getDefaultDescription() ?? ''); - } - - $this->configure(); - } - - /** - * Ignores validation errors. - * - * This is mainly useful for the help command. - */ - public function ignoreValidationErrors(): void - { - $this->ignoreValidationErrors = true; - } - - public function setApplication(?Application $application): void - { - $this->application = $application; - if ($application) { - $this->setHelperSet($application->getHelperSet()); - } else { - $this->helperSet = null; - } - - $this->fullDefinition = null; - } - - public function setHelperSet(HelperSet $helperSet): void - { - $this->helperSet = $helperSet; - } - - /** - * Gets the helper set. - */ - public function getHelperSet(): ?HelperSet - { - return $this->helperSet; - } - - /** - * Gets the application instance for this command. - */ - public function getApplication(): ?Application - { - return $this->application; - } - - /** - * Checks whether the command is enabled or not in the current environment. - * - * Override this to check for x or y and return false if the command cannot - * run properly under the current conditions. - */ - public function isEnabled(): bool - { - return true; - } - - /** - * Configures the current command. - * - * @return void - */ - protected function configure() - { - } - - /** - * Executes the current command. - * - * This method is not abstract because you can use this class - * as a concrete class. In this case, instead of defining the - * execute() method, you set the code to execute by passing - * a Closure to the setCode() method. - * - * @return int 0 if everything went fine, or an exit code - * - * @throws LogicException When this abstract method is not implemented - * - * @see setCode() - */ - protected function execute(InputInterface $input, OutputInterface $output): int - { - throw new LogicException('You must override the execute() method in the concrete command class.'); - } - - /** - * Interacts with the user. - * - * This method is executed before the InputDefinition is validated. - * This means that this is the only place where the command can - * interactively ask for values of missing required arguments. - * - * @return void - */ - protected function interact(InputInterface $input, OutputInterface $output) - { - } - - /** - * Initializes the command after the input has been bound and before the input - * is validated. - * - * This is mainly useful when a lot of commands extends one main command - * where some things need to be initialized based on the input arguments and options. - * - * @see InputInterface::bind() - * @see InputInterface::validate() - * - * @return void - */ - protected function initialize(InputInterface $input, OutputInterface $output) - { - } - - /** - * Runs the command. - * - * The code to execute is either defined directly with the - * setCode() method or by overriding the execute() method - * in a sub-class. - * - * @return int The command exit code - * - * @throws ExceptionInterface When input binding fails. Bypass this by calling {@link ignoreValidationErrors()}. - * - * @see setCode() - * @see execute() - */ - public function run(InputInterface $input, OutputInterface $output): int - { - // add the application arguments and options - $this->mergeApplicationDefinition(); - - // bind the input against the command specific arguments/options - try { - $input->bind($this->getDefinition()); - } catch (ExceptionInterface $e) { - if (!$this->ignoreValidationErrors) { - throw $e; - } - } - - $this->initialize($input, $output); - - if (null !== $this->processTitle) { - if (\function_exists('cli_set_process_title')) { - if (!@cli_set_process_title($this->processTitle)) { - if ('Darwin' === \PHP_OS) { - $output->writeln('Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.', OutputInterface::VERBOSITY_VERY_VERBOSE); - } else { - cli_set_process_title($this->processTitle); - } - } - } elseif (\function_exists('setproctitle')) { - setproctitle($this->processTitle); - } elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) { - $output->writeln('Install the proctitle PECL to be able to change the process title.'); - } - } - - if ($input->isInteractive()) { - $this->interact($input, $output); - } - - // The command name argument is often omitted when a command is executed directly with its run() method. - // It would fail the validation if we didn't make sure the command argument is present, - // since it's required by the application. - if ($input->hasArgument('command') && null === $input->getArgument('command')) { - $input->setArgument('command', $this->getName()); - } - - $input->validate(); - - if ($this->code) { - $statusCode = ($this->code)($input, $output); - } else { - $statusCode = $this->execute($input, $output); - } - - return is_numeric($statusCode) ? (int) $statusCode : 0; - } - - /** - * Supplies suggestions when resolving possible completion options for input (e.g. option or argument). - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - $definition = $this->getDefinition(); - if (CompletionInput::TYPE_OPTION_VALUE === $input->getCompletionType() && $definition->hasOption($input->getCompletionName())) { - $definition->getOption($input->getCompletionName())->complete($input, $suggestions); - } elseif (CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType() && $definition->hasArgument($input->getCompletionName())) { - $definition->getArgument($input->getCompletionName())->complete($input, $suggestions); - } - } - - /** - * Sets the code to execute when running this command. - * - * If this method is used, it overrides the code defined - * in the execute() method. - * - * @param callable $code A callable(InputInterface $input, OutputInterface $output) - * - * @return $this - * - * @throws InvalidArgumentException - * - * @see execute() - */ - public function setCode(callable $code): static - { - if ($code instanceof \Closure) { - $r = new \ReflectionFunction($code); - if (null === $r->getClosureThis()) { - set_error_handler(static function () {}); - try { - if ($c = \Closure::bind($code, $this)) { - $code = $c; - } - } finally { - restore_error_handler(); - } - } - } else { - $code = $code(...); - } - - $this->code = $code; - - return $this; - } - - /** - * Merges the application definition with the command definition. - * - * This method is not part of public API and should not be used directly. - * - * @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments - * - * @internal - */ - public function mergeApplicationDefinition(bool $mergeArgs = true): void - { - if (null === $this->application) { - return; - } - - $this->fullDefinition = new InputDefinition(); - $this->fullDefinition->setOptions($this->definition->getOptions()); - $this->fullDefinition->addOptions($this->application->getDefinition()->getOptions()); - - if ($mergeArgs) { - $this->fullDefinition->setArguments($this->application->getDefinition()->getArguments()); - $this->fullDefinition->addArguments($this->definition->getArguments()); - } else { - $this->fullDefinition->setArguments($this->definition->getArguments()); - } - } - - /** - * Sets an array of argument and option instances. - * - * @return $this - */ - public function setDefinition(array|InputDefinition $definition): static - { - if ($definition instanceof InputDefinition) { - $this->definition = $definition; - } else { - $this->definition->setDefinition($definition); - } - - $this->fullDefinition = null; - - return $this; - } - - /** - * Gets the InputDefinition attached to this Command. - */ - public function getDefinition(): InputDefinition - { - return $this->fullDefinition ?? $this->getNativeDefinition(); - } - - /** - * Gets the InputDefinition to be used to create representations of this Command. - * - * Can be overridden to provide the original command representation when it would otherwise - * be changed by merging with the application InputDefinition. - * - * This method is not part of public API and should not be used directly. - */ - public function getNativeDefinition(): InputDefinition - { - return $this->definition ?? throw new LogicException(\sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); - } - - /** - * Adds an argument. - * - * @param $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL - * @param $default The default value (for InputArgument::OPTIONAL mode only) - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - * - * @return $this - * - * @throws InvalidArgumentException When argument mode is not valid - */ - public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static - { - $this->definition->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues)); - $this->fullDefinition?->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues)); - - return $this; - } - - /** - * Adds an option. - * - * @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param $mode The option mode: One of the InputOption::VALUE_* constants - * @param $default The default value (must be null for InputOption::VALUE_NONE) - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - * - * @return $this - * - * @throws InvalidArgumentException If option mode is invalid or incompatible - */ - public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static - { - $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues)); - $this->fullDefinition?->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues)); - - return $this; - } - - /** - * Sets the name of the command. - * - * This method can set both the namespace and the name if - * you separate them by a colon (:) - * - * $command->setName('foo:bar'); - * - * @return $this - * - * @throws InvalidArgumentException When the name is invalid - */ - public function setName(string $name): static - { - $this->validateName($name); - - $this->name = $name; - - return $this; - } - - /** - * Sets the process title of the command. - * - * This feature should be used only when creating a long process command, - * like a daemon. - * - * @return $this - */ - public function setProcessTitle(string $title): static - { - $this->processTitle = $title; - - return $this; - } - - /** - * Returns the command name. - */ - public function getName(): ?string - { - return $this->name; - } - - /** - * @param bool $hidden Whether or not the command should be hidden from the list of commands - * - * @return $this - */ - public function setHidden(bool $hidden = true): static - { - $this->hidden = $hidden; - - return $this; - } - - /** - * @return bool whether the command should be publicly shown or not - */ - public function isHidden(): bool - { - return $this->hidden; - } - - /** - * Sets the description for the command. - * - * @return $this - */ - public function setDescription(string $description): static - { - $this->description = $description; - - return $this; - } - - /** - * Returns the description for the command. - */ - public function getDescription(): string - { - return $this->description; - } - - /** - * Sets the help for the command. - * - * @return $this - */ - public function setHelp(string $help): static - { - $this->help = $help; - - return $this; - } - - /** - * Returns the help for the command. - */ - public function getHelp(): string - { - return $this->help; - } - - /** - * Returns the processed help for the command replacing the %command.name% and - * %command.full_name% patterns with the real values dynamically. - */ - public function getProcessedHelp(): string - { - $name = $this->name; - $isSingleCommand = $this->application?->isSingleCommand(); - - $placeholders = [ - '%command.name%', - '%command.full_name%', - ]; - $replacements = [ - $name, - $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name, - ]; - - return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription()); - } - - /** - * Sets the aliases for the command. - * - * @param string[] $aliases An array of aliases for the command - * - * @return $this - * - * @throws InvalidArgumentException When an alias is invalid - */ - public function setAliases(iterable $aliases): static - { - $list = []; - - foreach ($aliases as $alias) { - $this->validateName($alias); - $list[] = $alias; - } - - $this->aliases = \is_array($aliases) ? $aliases : $list; - - return $this; - } - - /** - * Returns the aliases for the command. - */ - public function getAliases(): array - { - return $this->aliases; - } - - /** - * Returns the synopsis for the command. - * - * @param bool $short Whether to show the short version of the synopsis (with options folded) or not - */ - public function getSynopsis(bool $short = false): string - { - $key = $short ? 'short' : 'long'; - - if (!isset($this->synopsis[$key])) { - $this->synopsis[$key] = trim(\sprintf('%s %s', $this->name, $this->definition->getSynopsis($short))); - } - - return $this->synopsis[$key]; - } - - /** - * Add a command usage example, it'll be prefixed with the command name. - * - * @return $this - */ - public function addUsage(string $usage): static - { - if (!str_starts_with($usage, $this->name)) { - $usage = \sprintf('%s %s', $this->name, $usage); - } - - $this->usages[] = $usage; - - return $this; - } - - /** - * Returns alternative usages of the command. - */ - public function getUsages(): array - { - return $this->usages; - } - - /** - * Gets a helper instance by name. - * - * @throws LogicException if no HelperSet is defined - * @throws InvalidArgumentException if the helper is not defined - */ - public function getHelper(string $name): HelperInterface - { - if (null === $this->helperSet) { - throw new LogicException(\sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); - } - - return $this->helperSet->get($name); - } - - /** - * Validates a command name. - * - * It must be non-empty and parts can optionally be separated by ":". - * - * @throws InvalidArgumentException When the name is invalid - */ - private function validateName(string $name): void - { - if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { - throw new InvalidArgumentException(\sprintf('Command name "%s" is invalid.', $name)); - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/CompleteCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/CompleteCommand.php deleted file mode 100644 index 15eeea16..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/CompleteCommand.php +++ /dev/null @@ -1,212 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Output\BashCompletionOutput; -use Symfony\Component\Console\Completion\Output\CompletionOutputInterface; -use Symfony\Component\Console\Completion\Output\FishCompletionOutput; -use Symfony\Component\Console\Completion\Output\ZshCompletionOutput; -use Symfony\Component\Console\Exception\CommandNotFoundException; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Responsible for providing the values to the shell completion. - * - * @author Wouter de Jong - */ -#[AsCommand(name: '|_complete', description: 'Internal command to provide shell completion suggestions')] -final class CompleteCommand extends Command -{ - public const COMPLETION_API_VERSION = '1'; - - private array $completionOutputs; - private bool $isDebug = false; - - /** - * @param array> $completionOutputs A list of additional completion outputs, with shell name as key and FQCN as value - */ - public function __construct(array $completionOutputs = []) - { - // must be set before the parent constructor, as the property value is used in configure() - $this->completionOutputs = $completionOutputs + [ - 'bash' => BashCompletionOutput::class, - 'fish' => FishCompletionOutput::class, - 'zsh' => ZshCompletionOutput::class, - ]; - - parent::__construct(); - } - - protected function configure(): void - { - $this - ->addOption('shell', 's', InputOption::VALUE_REQUIRED, 'The shell type ("'.implode('", "', array_keys($this->completionOutputs)).'")') - ->addOption('input', 'i', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'An array of input tokens (e.g. COMP_WORDS or argv)') - ->addOption('current', 'c', InputOption::VALUE_REQUIRED, 'The index of the "input" array that the cursor is in (e.g. COMP_CWORD)') - ->addOption('api-version', 'a', InputOption::VALUE_REQUIRED, 'The API version of the completion script') - ->addOption('symfony', 'S', InputOption::VALUE_REQUIRED, 'deprecated') - ; - } - - protected function initialize(InputInterface $input, OutputInterface $output): void - { - $this->isDebug = filter_var(getenv('SYMFONY_COMPLETION_DEBUG'), \FILTER_VALIDATE_BOOL); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - try { - // "symfony" must be kept for compat with the shell scripts generated by Symfony Console 5.4 - 6.1 - $version = $input->getOption('symfony') ? '1' : $input->getOption('api-version'); - if ($version && version_compare($version, self::COMPLETION_API_VERSION, '<')) { - $message = \sprintf('Completion script version is not supported ("%s" given, ">=%s" required).', $version, self::COMPLETION_API_VERSION); - $this->log($message); - - $output->writeln($message.' Install the Symfony completion script again by using the "completion" command.'); - - return 126; - } - - $shell = $input->getOption('shell'); - if (!$shell) { - throw new \RuntimeException('The "--shell" option must be set.'); - } - - if (!$completionOutput = $this->completionOutputs[$shell] ?? false) { - throw new \RuntimeException(\sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs)))); - } - - $completionInput = $this->createCompletionInput($input); - $suggestions = new CompletionSuggestions(); - - $this->log([ - '', - ''.date('Y-m-d H:i:s').'', - 'Input: ("|" indicates the cursor position)', - ' '.$completionInput, - 'Command:', - ' '.implode(' ', $_SERVER['argv']), - 'Messages:', - ]); - - $command = $this->findCommand($completionInput); - if (null === $command) { - $this->log(' No command found, completing using the Application class.'); - - $this->getApplication()->complete($completionInput, $suggestions); - } elseif ( - $completionInput->mustSuggestArgumentValuesFor('command') - && $command->getName() !== $completionInput->getCompletionValue() - && !\in_array($completionInput->getCompletionValue(), $command->getAliases(), true) - ) { - $this->log(' No command found, completing using the Application class.'); - - // expand shortcut names ("cache:cl") into their full name ("cache:clear") - $suggestions->suggestValues(array_filter(array_merge([$command->getName()], $command->getAliases()))); - } else { - $command->mergeApplicationDefinition(); - $completionInput->bind($command->getDefinition()); - - if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) { - $this->log(' Completing option names for the '.($command instanceof LazyCommand ? $command->getCommand() : $command)::class.' command.'); - - $suggestions->suggestOptions($command->getDefinition()->getOptions()); - } else { - $this->log([ - ' Completing using the '.($command instanceof LazyCommand ? $command->getCommand() : $command)::class.' class.', - ' Completing '.$completionInput->getCompletionType().' for '.$completionInput->getCompletionName().'', - ]); - if (null !== $compval = $completionInput->getCompletionValue()) { - $this->log(' Current value: '.$compval.''); - } - - $command->complete($completionInput, $suggestions); - } - } - - /** @var CompletionOutputInterface $completionOutput */ - $completionOutput = new $completionOutput(); - - $this->log('Suggestions:'); - if ($options = $suggestions->getOptionSuggestions()) { - $this->log(' --'.implode(' --', array_map(fn ($o) => $o->getName(), $options))); - } elseif ($values = $suggestions->getValueSuggestions()) { - $this->log(' '.implode(' ', $values)); - } else { - $this->log(' No suggestions were provided'); - } - - $completionOutput->write($suggestions, $output); - } catch (\Throwable $e) { - $this->log([ - 'Error!', - (string) $e, - ]); - - if ($output->isDebug()) { - throw $e; - } - - return 2; - } - - return 0; - } - - private function createCompletionInput(InputInterface $input): CompletionInput - { - $currentIndex = $input->getOption('current'); - if (!$currentIndex || !ctype_digit($currentIndex)) { - throw new \RuntimeException('The "--current" option must be set and it must be an integer.'); - } - - $completionInput = CompletionInput::fromTokens($input->getOption('input'), (int) $currentIndex); - - try { - $completionInput->bind($this->getApplication()->getDefinition()); - } catch (ExceptionInterface) { - } - - return $completionInput; - } - - private function findCommand(CompletionInput $completionInput): ?Command - { - try { - $inputName = $completionInput->getFirstArgument(); - if (null === $inputName) { - return null; - } - - return $this->getApplication()->find($inputName); - } catch (CommandNotFoundException) { - } - - return null; - } - - private function log($messages): void - { - if (!$this->isDebug) { - return; - } - - $commandName = basename($_SERVER['argv'][0]); - file_put_contents(sys_get_temp_dir().'/sf_'.$commandName.'.log', implode(\PHP_EOL, (array) $messages).\PHP_EOL, \FILE_APPEND); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/DumpCompletionCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/DumpCompletionCommand.php deleted file mode 100644 index 2853fc5f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/DumpCompletionCommand.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Process\Process; - -/** - * Dumps the completion script for the current shell. - * - * @author Wouter de Jong - */ -#[AsCommand(name: 'completion', description: 'Dump the shell completion script')] -final class DumpCompletionCommand extends Command -{ - private array $supportedShells; - - protected function configure(): void - { - $fullCommand = $_SERVER['PHP_SELF']; - $commandName = basename($fullCommand); - $fullCommand = @realpath($fullCommand) ?: $fullCommand; - - $shell = self::guessShell(); - [$rcFile, $completionFile] = match ($shell) { - 'fish' => ['~/.config/fish/config.fish', "/etc/fish/completions/$commandName.fish"], - 'zsh' => ['~/.zshrc', '$fpath[1]/_'.$commandName], - default => ['~/.bashrc', "/etc/bash_completion.d/$commandName"], - }; - - $supportedShells = implode(', ', $this->getSupportedShells()); - - $this - ->setHelp(<<%command.name% command dumps the shell completion script required -to use shell autocompletion (currently, {$supportedShells} completion are supported). - -Static installation -------------------- - -Dump the script to a global completion file and restart your shell: - - %command.full_name% {$shell} | sudo tee {$completionFile} - -Or dump the script to a local file and source it: - - %command.full_name% {$shell} > completion.sh - - # source the file whenever you use the project - source completion.sh - - # or add this line at the end of your "{$rcFile}" file: - source /path/to/completion.sh - -Dynamic installation --------------------- - -Add this to the end of your shell configuration file (e.g. "{$rcFile}"): - - eval "$({$fullCommand} completion {$shell})" -EOH - ) - ->addArgument('shell', InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given', null, $this->getSupportedShells(...)) - ->addOption('debug', null, InputOption::VALUE_NONE, 'Tail the completion debug log') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $commandName = basename($_SERVER['argv'][0]); - - if ($input->getOption('debug')) { - $this->tailDebugLog($commandName, $output); - - return 0; - } - - $shell = $input->getArgument('shell') ?? self::guessShell(); - $completionFile = __DIR__.'/../Resources/completion.'.$shell; - if (!file_exists($completionFile)) { - $supportedShells = $this->getSupportedShells(); - - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - if ($shell) { - $output->writeln(\sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); - } else { - $output->writeln(\sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); - } - - return 2; - } - - $output->write(str_replace(['{{ COMMAND_NAME }}', '{{ VERSION }}'], [$commandName, CompleteCommand::COMPLETION_API_VERSION], file_get_contents($completionFile))); - - return 0; - } - - private static function guessShell(): string - { - return basename($_SERVER['SHELL'] ?? ''); - } - - private function tailDebugLog(string $commandName, OutputInterface $output): void - { - $debugFile = sys_get_temp_dir().'/sf_'.$commandName.'.log'; - if (!file_exists($debugFile)) { - touch($debugFile); - } - $process = new Process(['tail', '-f', $debugFile], null, null, null, 0); - $process->run(function (string $type, string $line) use ($output): void { - $output->write($line); - }); - } - - /** - * @return string[] - */ - private function getSupportedShells(): array - { - if (isset($this->supportedShells)) { - return $this->supportedShells; - } - - $shells = []; - - foreach (new \DirectoryIterator(__DIR__.'/../Resources/') as $file) { - if (str_starts_with($file->getBasename(), 'completion.') && $file->isFile()) { - $shells[] = $file->getExtension(); - } - } - sort($shells); - - return $this->supportedShells = $shells; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/HelpCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/HelpCommand.php deleted file mode 100644 index a2a72dab..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/HelpCommand.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Descriptor\ApplicationDescription; -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * HelpCommand displays the help for a given command. - * - * @author Fabien Potencier - */ -class HelpCommand extends Command -{ - private Command $command; - - protected function configure(): void - { - $this->ignoreValidationErrors(); - - $this - ->setName('help') - ->setDefinition([ - new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help', fn () => array_keys((new ApplicationDescription($this->getApplication()))->getCommands())), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', fn () => (new DescriptorHelper())->getFormats()), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), - ]) - ->setDescription('Display help for a command') - ->setHelp(<<<'EOF' -The %command.name% command displays help for a given command: - - %command.full_name% list - -You can also output the help in other formats by using the --format option: - - %command.full_name% --format=xml list - -To display the list of available commands, please use the list command. -EOF - ) - ; - } - - public function setCommand(Command $command): void - { - $this->command = $command; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $this->command ??= $this->getApplication()->find($input->getArgument('command_name')); - - $helper = new DescriptorHelper(); - $helper->describe($output, $this->command, [ - 'format' => $input->getOption('format'), - 'raw_text' => $input->getOption('raw'), - ]); - - unset($this->command); - - return 0; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/LazyCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/LazyCommand.php deleted file mode 100644 index fd2c300d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/LazyCommand.php +++ /dev/null @@ -1,206 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Suggestion; -use Symfony\Component\Console\Helper\HelperInterface; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Nicolas Grekas - */ -final class LazyCommand extends Command -{ - private \Closure|Command $command; - - public function __construct( - string $name, - array $aliases, - string $description, - bool $isHidden, - \Closure $commandFactory, - private ?bool $isEnabled = true, - ) { - $this->setName($name) - ->setAliases($aliases) - ->setHidden($isHidden) - ->setDescription($description); - - $this->command = $commandFactory; - } - - public function ignoreValidationErrors(): void - { - $this->getCommand()->ignoreValidationErrors(); - } - - public function setApplication(?Application $application): void - { - if ($this->command instanceof parent) { - $this->command->setApplication($application); - } - - parent::setApplication($application); - } - - public function setHelperSet(HelperSet $helperSet): void - { - if ($this->command instanceof parent) { - $this->command->setHelperSet($helperSet); - } - - parent::setHelperSet($helperSet); - } - - public function isEnabled(): bool - { - return $this->isEnabled ?? $this->getCommand()->isEnabled(); - } - - public function run(InputInterface $input, OutputInterface $output): int - { - return $this->getCommand()->run($input, $output); - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - $this->getCommand()->complete($input, $suggestions); - } - - public function setCode(callable $code): static - { - $this->getCommand()->setCode($code); - - return $this; - } - - /** - * @internal - */ - public function mergeApplicationDefinition(bool $mergeArgs = true): void - { - $this->getCommand()->mergeApplicationDefinition($mergeArgs); - } - - public function setDefinition(array|InputDefinition $definition): static - { - $this->getCommand()->setDefinition($definition); - - return $this; - } - - public function getDefinition(): InputDefinition - { - return $this->getCommand()->getDefinition(); - } - - public function getNativeDefinition(): InputDefinition - { - return $this->getCommand()->getNativeDefinition(); - } - - /** - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - */ - public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static - { - $this->getCommand()->addArgument($name, $mode, $description, $default, $suggestedValues); - - return $this; - } - - /** - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - */ - public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static - { - $this->getCommand()->addOption($name, $shortcut, $mode, $description, $default, $suggestedValues); - - return $this; - } - - public function setProcessTitle(string $title): static - { - $this->getCommand()->setProcessTitle($title); - - return $this; - } - - public function setHelp(string $help): static - { - $this->getCommand()->setHelp($help); - - return $this; - } - - public function getHelp(): string - { - return $this->getCommand()->getHelp(); - } - - public function getProcessedHelp(): string - { - return $this->getCommand()->getProcessedHelp(); - } - - public function getSynopsis(bool $short = false): string - { - return $this->getCommand()->getSynopsis($short); - } - - public function addUsage(string $usage): static - { - $this->getCommand()->addUsage($usage); - - return $this; - } - - public function getUsages(): array - { - return $this->getCommand()->getUsages(); - } - - public function getHelper(string $name): HelperInterface - { - return $this->getCommand()->getHelper($name); - } - - public function getCommand(): parent - { - if (!$this->command instanceof \Closure) { - return $this->command; - } - - $command = $this->command = ($this->command)(); - $command->setApplication($this->getApplication()); - - if (null !== $this->getHelperSet()) { - $command->setHelperSet($this->getHelperSet()); - } - - $command->setName($this->getName()) - ->setAliases($this->getAliases()) - ->setHidden($this->isHidden()) - ->setDescription($this->getDescription()); - - // Will throw if the command is not correctly initialized. - $command->getDefinition(); - - return $command; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/ListCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/ListCommand.php deleted file mode 100644 index 61b4b1b3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/ListCommand.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Descriptor\ApplicationDescription; -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * ListCommand displays the list of all available commands for the application. - * - * @author Fabien Potencier - */ -class ListCommand extends Command -{ - protected function configure(): void - { - $this - ->setName('list') - ->setDefinition([ - new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name', null, fn () => array_keys((new ApplicationDescription($this->getApplication()))->getNamespaces())), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', fn () => (new DescriptorHelper())->getFormats()), - new InputOption('short', null, InputOption::VALUE_NONE, 'To skip describing commands\' arguments'), - ]) - ->setDescription('List commands') - ->setHelp(<<<'EOF' -The %command.name% command lists all commands: - - %command.full_name% - -You can also display the commands for a specific namespace: - - %command.full_name% test - -You can also output the information in other formats by using the --format option: - - %command.full_name% --format=xml - -It's also possible to get raw list of commands (useful for embedding command runner): - - %command.full_name% --raw -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $helper = new DescriptorHelper(); - $helper->describe($output, $this->getApplication(), [ - 'format' => $input->getOption('format'), - 'raw_text' => $input->getOption('raw'), - 'namespace' => $input->getArgument('namespace'), - 'short' => $input->getOption('short'), - ]); - - return 0; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/LockableTrait.php b/tools/php-cs-fixer/vendor/symfony/console/Command/LockableTrait.php deleted file mode 100644 index f0001cc5..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/LockableTrait.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Lock\LockFactory; -use Symfony\Component\Lock\LockInterface; -use Symfony\Component\Lock\Store\FlockStore; -use Symfony\Component\Lock\Store\SemaphoreStore; - -/** - * Basic lock feature for commands. - * - * @author Geoffrey Brier - */ -trait LockableTrait -{ - private ?LockInterface $lock = null; - - private ?LockFactory $lockFactory = null; - - /** - * Locks a command. - */ - private function lock(?string $name = null, bool $blocking = false): bool - { - if (!class_exists(SemaphoreStore::class)) { - throw new LogicException('To enable the locking feature you must install the symfony/lock component. Try running "composer require symfony/lock".'); - } - - if (null !== $this->lock) { - throw new LogicException('A lock is already in place.'); - } - - if (null === $this->lockFactory) { - if (SemaphoreStore::isSupported()) { - $store = new SemaphoreStore(); - } else { - $store = new FlockStore(); - } - - $this->lockFactory = (new LockFactory($store)); - } - - $this->lock = $this->lockFactory->createLock($name ?: $this->getName()); - if (!$this->lock->acquire($blocking)) { - $this->lock = null; - - return false; - } - - return true; - } - - /** - * Releases the command lock if there is one. - */ - private function release(): void - { - if ($this->lock) { - $this->lock->release(); - $this->lock = null; - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/SignalableCommandInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Command/SignalableCommandInterface.php deleted file mode 100644 index 40b301d1..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/SignalableCommandInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -/** - * Interface for command reacting to signal. - * - * @author Grégoire Pineau - */ -interface SignalableCommandInterface -{ - /** - * Returns the list of signals to subscribe. - */ - public function getSubscribedSignals(): array; - - /** - * The method will be called when the application is signaled. - * - * @return int|false The exit code to return or false to continue the normal execution - */ - public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Command/TraceableCommand.php b/tools/php-cs-fixer/vendor/symfony/console/Command/TraceableCommand.php deleted file mode 100644 index 9ffb68da..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Command/TraceableCommand.php +++ /dev/null @@ -1,356 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Helper\HelperInterface; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Stopwatch\Stopwatch; - -/** - * @internal - * - * @author Jules Pietri - */ -final class TraceableCommand extends Command implements SignalableCommandInterface -{ - public readonly Command $command; - public int $exitCode; - public ?int $interruptedBySignal = null; - public bool $ignoreValidation; - public bool $isInteractive = false; - public string $duration = 'n/a'; - public string $maxMemoryUsage = 'n/a'; - public InputInterface $input; - public OutputInterface $output; - /** @var array */ - public array $arguments; - /** @var array */ - public array $options; - /** @var array */ - public array $interactiveInputs = []; - public array $handledSignals = []; - - public function __construct( - Command $command, - private readonly Stopwatch $stopwatch, - ) { - if ($command instanceof LazyCommand) { - $command = $command->getCommand(); - } - - $this->command = $command; - - // prevent call to self::getDefaultDescription() - $this->setDescription($command->getDescription()); - - parent::__construct($command->getName()); - - // init below enables calling {@see parent::run()} - [$code, $processTitle, $ignoreValidationErrors] = \Closure::bind(function () { - return [$this->code, $this->processTitle, $this->ignoreValidationErrors]; - }, $command, Command::class)(); - - if (\is_callable($code)) { - $this->setCode($code); - } - - if ($processTitle) { - parent::setProcessTitle($processTitle); - } - - if ($ignoreValidationErrors) { - parent::ignoreValidationErrors(); - } - - $this->ignoreValidation = $ignoreValidationErrors; - } - - public function __call(string $name, array $arguments): mixed - { - return $this->command->{$name}(...$arguments); - } - - public function getSubscribedSignals(): array - { - return $this->command instanceof SignalableCommandInterface ? $this->command->getSubscribedSignals() : []; - } - - public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false - { - if (!$this->command instanceof SignalableCommandInterface) { - return false; - } - - $event = $this->stopwatch->start($this->getName().'.handle_signal'); - - $exit = $this->command->handleSignal($signal, $previousExitCode); - - $event->stop(); - - if (!isset($this->handledSignals[$signal])) { - $this->handledSignals[$signal] = [ - 'handled' => 0, - 'duration' => 0, - 'memory' => 0, - ]; - } - - ++$this->handledSignals[$signal]['handled']; - $this->handledSignals[$signal]['duration'] += $event->getDuration(); - $this->handledSignals[$signal]['memory'] = max( - $this->handledSignals[$signal]['memory'], - $event->getMemory() >> 20 - ); - - return $exit; - } - - /** - * {@inheritdoc} - * - * Calling parent method is required to be used in {@see parent::run()}. - */ - public function ignoreValidationErrors(): void - { - $this->ignoreValidation = true; - $this->command->ignoreValidationErrors(); - - parent::ignoreValidationErrors(); - } - - public function setApplication(?Application $application = null): void - { - $this->command->setApplication($application); - } - - public function getApplication(): ?Application - { - return $this->command->getApplication(); - } - - public function setHelperSet(HelperSet $helperSet): void - { - $this->command->setHelperSet($helperSet); - } - - public function getHelperSet(): ?HelperSet - { - return $this->command->getHelperSet(); - } - - public function isEnabled(): bool - { - return $this->command->isEnabled(); - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - $this->command->complete($input, $suggestions); - } - - /** - * {@inheritdoc} - * - * Calling parent method is required to be used in {@see parent::run()}. - */ - public function setCode(callable $code): static - { - $this->command->setCode($code); - - return parent::setCode(function (InputInterface $input, OutputInterface $output) use ($code): int { - $event = $this->stopwatch->start($this->getName().'.code'); - - $this->exitCode = $code($input, $output); - - $event->stop(); - - return $this->exitCode; - }); - } - - /** - * @internal - */ - public function mergeApplicationDefinition(bool $mergeArgs = true): void - { - $this->command->mergeApplicationDefinition($mergeArgs); - } - - public function setDefinition(array|InputDefinition $definition): static - { - $this->command->setDefinition($definition); - - return $this; - } - - public function getDefinition(): InputDefinition - { - return $this->command->getDefinition(); - } - - public function getNativeDefinition(): InputDefinition - { - return $this->command->getNativeDefinition(); - } - - public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static - { - $this->command->addArgument($name, $mode, $description, $default, $suggestedValues); - - return $this; - } - - public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static - { - $this->command->addOption($name, $shortcut, $mode, $description, $default, $suggestedValues); - - return $this; - } - - /** - * {@inheritdoc} - * - * Calling parent method is required to be used in {@see parent::run()}. - */ - public function setProcessTitle(string $title): static - { - $this->command->setProcessTitle($title); - - return parent::setProcessTitle($title); - } - - public function setHelp(string $help): static - { - $this->command->setHelp($help); - - return $this; - } - - public function getHelp(): string - { - return $this->command->getHelp(); - } - - public function getProcessedHelp(): string - { - return $this->command->getProcessedHelp(); - } - - public function getSynopsis(bool $short = false): string - { - return $this->command->getSynopsis($short); - } - - public function addUsage(string $usage): static - { - $this->command->addUsage($usage); - - return $this; - } - - public function getUsages(): array - { - return $this->command->getUsages(); - } - - public function getHelper(string $name): HelperInterface - { - return $this->command->getHelper($name); - } - - public function run(InputInterface $input, OutputInterface $output): int - { - $this->input = $input; - $this->output = $output; - $this->arguments = $input->getArguments(); - $this->options = $input->getOptions(); - $event = $this->stopwatch->start($this->getName(), 'command'); - - try { - $this->exitCode = parent::run($input, $output); - } finally { - $event->stop(); - - if ($output instanceof ConsoleOutputInterface && $output->isDebug()) { - $output->getErrorOutput()->writeln((string) $event); - } - - $this->duration = $event->getDuration().' ms'; - $this->maxMemoryUsage = ($event->getMemory() >> 20).' MiB'; - - if ($this->isInteractive) { - $this->extractInteractiveInputs($input->getArguments(), $input->getOptions()); - } - } - - return $this->exitCode; - } - - protected function initialize(InputInterface $input, OutputInterface $output): void - { - $event = $this->stopwatch->start($this->getName().'.init', 'command'); - - $this->command->initialize($input, $output); - - $event->stop(); - } - - protected function interact(InputInterface $input, OutputInterface $output): void - { - if (!$this->isInteractive = Command::class !== (new \ReflectionMethod($this->command, 'interact'))->getDeclaringClass()->getName()) { - return; - } - - $event = $this->stopwatch->start($this->getName().'.interact', 'command'); - - $this->command->interact($input, $output); - - $event->stop(); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $event = $this->stopwatch->start($this->getName().'.execute', 'command'); - - $exitCode = $this->command->execute($input, $output); - - $event->stop(); - - return $exitCode; - } - - private function extractInteractiveInputs(array $arguments, array $options): void - { - foreach ($arguments as $argName => $argValue) { - if (\array_key_exists($argName, $this->arguments) && $this->arguments[$argName] === $argValue) { - continue; - } - - $this->interactiveInputs[$argName] = $argValue; - } - - foreach ($options as $optName => $optValue) { - if (\array_key_exists($optName, $this->options) && $this->options[$optName] === $optValue) { - continue; - } - - $this->interactiveInputs['--'.$optName] = $optValue; - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php b/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php deleted file mode 100644 index b6b637ce..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * @author Robin Chalas - */ -interface CommandLoaderInterface -{ - /** - * Loads a command. - * - * @throws CommandNotFoundException - */ - public function get(string $name): Command; - - /** - * Checks if a command exists. - */ - public function has(string $name): bool; - - /** - * @return string[] - */ - public function getNames(): array; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php deleted file mode 100644 index eb494513..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Psr\Container\ContainerInterface; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * Loads commands from a PSR-11 container. - * - * @author Robin Chalas - */ -class ContainerCommandLoader implements CommandLoaderInterface -{ - /** - * @param array $commandMap An array with command names as keys and service ids as values - */ - public function __construct( - private ContainerInterface $container, - private array $commandMap, - ) { - } - - public function get(string $name): Command - { - if (!$this->has($name)) { - throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name)); - } - - return $this->container->get($this->commandMap[$name]); - } - - public function has(string $name): bool - { - return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]); - } - - public function getNames(): array - { - return array_keys($this->commandMap); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php deleted file mode 100644 index 2d13139c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * A simple command loader using factories to instantiate commands lazily. - * - * @author Maxime Steinhausser - */ -class FactoryCommandLoader implements CommandLoaderInterface -{ - /** - * @param callable[] $factories Indexed by command names - */ - public function __construct( - private array $factories, - ) { - } - - public function has(string $name): bool - { - return isset($this->factories[$name]); - } - - public function get(string $name): Command - { - if (!isset($this->factories[$name])) { - throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name)); - } - - $factory = $this->factories[$name]; - - return $factory(); - } - - public function getNames(): array - { - return array_keys($this->factories); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionInput.php b/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionInput.php deleted file mode 100644 index 9f9619e1..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionInput.php +++ /dev/null @@ -1,248 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * An input specialized for shell completion. - * - * This input allows unfinished option names or values and exposes what kind of - * completion is expected. - * - * @author Wouter de Jong - */ -final class CompletionInput extends ArgvInput -{ - public const TYPE_ARGUMENT_VALUE = 'argument_value'; - public const TYPE_OPTION_VALUE = 'option_value'; - public const TYPE_OPTION_NAME = 'option_name'; - public const TYPE_NONE = 'none'; - - private array $tokens; - private int $currentIndex; - private string $completionType; - private ?string $completionName = null; - private string $completionValue = ''; - - /** - * Converts a terminal string into tokens. - * - * This is required for shell completions without COMP_WORDS support. - */ - public static function fromString(string $inputStr, int $currentIndex): self - { - preg_match_all('/(?<=^|\s)([\'"]?)(.+?)(?tokens = $tokens; - $input->currentIndex = $currentIndex; - - return $input; - } - - public function bind(InputDefinition $definition): void - { - parent::bind($definition); - - $relevantToken = $this->getRelevantToken(); - if ('-' === $relevantToken[0]) { - // the current token is an input option: complete either option name or option value - [$optionToken, $optionValue] = explode('=', $relevantToken, 2) + ['', '']; - - $option = $this->getOptionFromToken($optionToken); - if (null === $option && !$this->isCursorFree()) { - $this->completionType = self::TYPE_OPTION_NAME; - $this->completionValue = $relevantToken; - - return; - } - - if ($option?->acceptValue()) { - $this->completionType = self::TYPE_OPTION_VALUE; - $this->completionName = $option->getName(); - $this->completionValue = $optionValue ?: (!str_starts_with($optionToken, '--') ? substr($optionToken, 2) : ''); - - return; - } - } - - $previousToken = $this->tokens[$this->currentIndex - 1]; - if ('-' === $previousToken[0] && '' !== trim($previousToken, '-')) { - // check if previous option accepted a value - $previousOption = $this->getOptionFromToken($previousToken); - if ($previousOption?->acceptValue()) { - $this->completionType = self::TYPE_OPTION_VALUE; - $this->completionName = $previousOption->getName(); - $this->completionValue = $relevantToken; - - return; - } - } - - // complete argument value - $this->completionType = self::TYPE_ARGUMENT_VALUE; - - foreach ($this->definition->getArguments() as $argumentName => $argument) { - if (!isset($this->arguments[$argumentName])) { - break; - } - - $argumentValue = $this->arguments[$argumentName]; - $this->completionName = $argumentName; - if (\is_array($argumentValue)) { - $this->completionValue = $argumentValue ? $argumentValue[array_key_last($argumentValue)] : null; - } else { - $this->completionValue = $argumentValue; - } - } - - if ($this->currentIndex >= \count($this->tokens)) { - if (!isset($this->arguments[$argumentName]) || $this->definition->getArgument($argumentName)->isArray()) { - $this->completionName = $argumentName; - } else { - // we've reached the end - $this->completionType = self::TYPE_NONE; - $this->completionName = null; - } - - $this->completionValue = ''; - } - } - - /** - * Returns the type of completion required. - * - * TYPE_ARGUMENT_VALUE when completing the value of an input argument - * TYPE_OPTION_VALUE when completing the value of an input option - * TYPE_OPTION_NAME when completing the name of an input option - * TYPE_NONE when nothing should be completed - * - * TYPE_OPTION_NAME and TYPE_NONE are already implemented by the Console component. - * - * @return self::TYPE_* - */ - public function getCompletionType(): string - { - return $this->completionType; - } - - /** - * The name of the input option or argument when completing a value. - * - * @return string|null returns null when completing an option name - */ - public function getCompletionName(): ?string - { - return $this->completionName; - } - - /** - * The value already typed by the user (or empty string). - */ - public function getCompletionValue(): string - { - return $this->completionValue; - } - - public function mustSuggestOptionValuesFor(string $optionName): bool - { - return self::TYPE_OPTION_VALUE === $this->getCompletionType() && $optionName === $this->getCompletionName(); - } - - public function mustSuggestArgumentValuesFor(string $argumentName): bool - { - return self::TYPE_ARGUMENT_VALUE === $this->getCompletionType() && $argumentName === $this->getCompletionName(); - } - - protected function parseToken(string $token, bool $parseOptions): bool - { - try { - return parent::parseToken($token, $parseOptions); - } catch (RuntimeException) { - // suppress errors, completed input is almost never valid - } - - return $parseOptions; - } - - private function getOptionFromToken(string $optionToken): ?InputOption - { - $optionName = ltrim($optionToken, '-'); - if (!$optionName) { - return null; - } - - if ('-' === ($optionToken[1] ?? ' ')) { - // long option name - return $this->definition->hasOption($optionName) ? $this->definition->getOption($optionName) : null; - } - - // short option name - return $this->definition->hasShortcut($optionName[0]) ? $this->definition->getOptionForShortcut($optionName[0]) : null; - } - - /** - * The token of the cursor, or the last token if the cursor is at the end of the input. - */ - private function getRelevantToken(): string - { - return $this->tokens[$this->isCursorFree() ? $this->currentIndex - 1 : $this->currentIndex]; - } - - /** - * Whether the cursor is "free" (i.e. at the end of the input preceded by a space). - */ - private function isCursorFree(): bool - { - $nrOfTokens = \count($this->tokens); - if ($this->currentIndex > $nrOfTokens) { - throw new \LogicException('Current index is invalid, it must be the number of input tokens or one more.'); - } - - return $this->currentIndex >= $nrOfTokens; - } - - public function __toString(): string - { - $str = ''; - foreach ($this->tokens as $i => $token) { - $str .= $token; - - if ($this->currentIndex === $i) { - $str .= '|'; - } - - $str .= ' '; - } - - if ($this->currentIndex > $i) { - $str .= '|'; - } - - return rtrim($str); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionSuggestions.php b/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionSuggestions.php deleted file mode 100644 index 549bbafb..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Completion/CompletionSuggestions.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -use Symfony\Component\Console\Input\InputOption; - -/** - * Stores all completion suggestions for the current input. - * - * @author Wouter de Jong - */ -final class CompletionSuggestions -{ - private array $valueSuggestions = []; - private array $optionSuggestions = []; - - /** - * Add a suggested value for an input option or argument. - * - * @return $this - */ - public function suggestValue(string|Suggestion $value): static - { - $this->valueSuggestions[] = !$value instanceof Suggestion ? new Suggestion($value) : $value; - - return $this; - } - - /** - * Add multiple suggested values at once for an input option or argument. - * - * @param list $values - * - * @return $this - */ - public function suggestValues(array $values): static - { - foreach ($values as $value) { - $this->suggestValue($value); - } - - return $this; - } - - /** - * Add a suggestion for an input option name. - * - * @return $this - */ - public function suggestOption(InputOption $option): static - { - $this->optionSuggestions[] = $option; - - return $this; - } - - /** - * Add multiple suggestions for input option names at once. - * - * @param InputOption[] $options - * - * @return $this - */ - public function suggestOptions(array $options): static - { - foreach ($options as $option) { - $this->suggestOption($option); - } - - return $this; - } - - /** - * @return InputOption[] - */ - public function getOptionSuggestions(): array - { - return $this->optionSuggestions; - } - - /** - * @return Suggestion[] - */ - public function getValueSuggestions(): array - { - return $this->valueSuggestions; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/BashCompletionOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/BashCompletionOutput.php deleted file mode 100644 index c6f76eb8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/BashCompletionOutput.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Wouter de Jong - */ -class BashCompletionOutput implements CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void - { - $values = $suggestions->getValueSuggestions(); - foreach ($suggestions->getOptionSuggestions() as $option) { - $values[] = '--'.$option->getName(); - if ($option->isNegatable()) { - $values[] = '--no-'.$option->getName(); - } - } - $output->writeln(implode("\n", $values)); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php deleted file mode 100644 index 659e5965..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Transforms the {@see CompletionSuggestions} object into output readable by the shell completion. - * - * @author Wouter de Jong - */ -interface CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/FishCompletionOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/FishCompletionOutput.php deleted file mode 100644 index 356a974e..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/FishCompletionOutput.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Guillaume Aveline - */ -class FishCompletionOutput implements CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void - { - $values = []; - foreach ($suggestions->getValueSuggestions() as $value) { - $values[] = $value->getValue().($value->getDescription() ? "\t".$value->getDescription() : ''); - } - foreach ($suggestions->getOptionSuggestions() as $option) { - $values[] = '--'.$option->getName().($option->getDescription() ? "\t".$option->getDescription() : ''); - if ($option->isNegatable()) { - $values[] = '--no-'.$option->getName().($option->getDescription() ? "\t".$option->getDescription() : ''); - } - } - $output->write(implode("\n", $values)); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/ZshCompletionOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/ZshCompletionOutput.php deleted file mode 100644 index bb4ce70b..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Completion/Output/ZshCompletionOutput.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Jitendra A - */ -class ZshCompletionOutput implements CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void - { - $values = []; - foreach ($suggestions->getValueSuggestions() as $value) { - $values[] = $value->getValue().($value->getDescription() ? "\t".$value->getDescription() : ''); - } - foreach ($suggestions->getOptionSuggestions() as $option) { - $values[] = '--'.$option->getName().($option->getDescription() ? "\t".$option->getDescription() : ''); - if ($option->isNegatable()) { - $values[] = '--no-'.$option->getName().($option->getDescription() ? "\t".$option->getDescription() : ''); - } - } - $output->write(implode("\n", $values)."\n"); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Completion/Suggestion.php b/tools/php-cs-fixer/vendor/symfony/console/Completion/Suggestion.php deleted file mode 100644 index 3251b079..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Completion/Suggestion.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -/** - * Represents a single suggested value. - * - * @author Wouter de Jong - */ -class Suggestion implements \Stringable -{ - public function __construct( - private readonly string $value, - private readonly string $description = '', - ) { - } - - public function getValue(): string - { - return $this->value; - } - - public function getDescription(): string - { - return $this->description; - } - - public function __toString(): string - { - return $this->getValue(); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/ConsoleEvents.php b/tools/php-cs-fixer/vendor/symfony/console/ConsoleEvents.php deleted file mode 100644 index 6ae8f32b..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/ConsoleEvents.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Event\ConsoleCommandEvent; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleSignalEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; - -/** - * Contains all events dispatched by an Application. - * - * @author Francesco Levorato - */ -final class ConsoleEvents -{ - /** - * The COMMAND event allows you to attach listeners before any command is - * executed by the console. It also allows you to modify the command, input and output - * before they are handed to the command. - * - * @Event("Symfony\Component\Console\Event\ConsoleCommandEvent") - */ - public const COMMAND = 'console.command'; - - /** - * The SIGNAL event allows you to perform some actions - * after the command execution was interrupted. - * - * @Event("Symfony\Component\Console\Event\ConsoleSignalEvent") - */ - public const SIGNAL = 'console.signal'; - - /** - * The TERMINATE event allows you to attach listeners after a command is - * executed by the console. - * - * @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent") - */ - public const TERMINATE = 'console.terminate'; - - /** - * The ERROR event occurs when an uncaught exception or error appears. - * - * This event allows you to deal with the exception/error or - * to modify the thrown exception. - * - * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent") - */ - public const ERROR = 'console.error'; - - /** - * Event aliases. - * - * These aliases can be consumed by RegisterListenersPass. - */ - public const ALIASES = [ - ConsoleCommandEvent::class => self::COMMAND, - ConsoleErrorEvent::class => self::ERROR, - ConsoleSignalEvent::class => self::SIGNAL, - ConsoleTerminateEvent::class => self::TERMINATE, - ]; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Cursor.php b/tools/php-cs-fixer/vendor/symfony/console/Cursor.php deleted file mode 100644 index e2618cf1..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Cursor.php +++ /dev/null @@ -1,204 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Pierre du Plessis - */ -final class Cursor -{ - /** @var resource */ - private $input; - - /** - * @param resource|null $input - */ - public function __construct( - private OutputInterface $output, - $input = null, - ) { - $this->input = $input ?? (\defined('STDIN') ? \STDIN : fopen('php://input', 'r+')); - } - - /** - * @return $this - */ - public function moveUp(int $lines = 1): static - { - $this->output->write(\sprintf("\x1b[%dA", $lines)); - - return $this; - } - - /** - * @return $this - */ - public function moveDown(int $lines = 1): static - { - $this->output->write(\sprintf("\x1b[%dB", $lines)); - - return $this; - } - - /** - * @return $this - */ - public function moveRight(int $columns = 1): static - { - $this->output->write(\sprintf("\x1b[%dC", $columns)); - - return $this; - } - - /** - * @return $this - */ - public function moveLeft(int $columns = 1): static - { - $this->output->write(\sprintf("\x1b[%dD", $columns)); - - return $this; - } - - /** - * @return $this - */ - public function moveToColumn(int $column): static - { - $this->output->write(\sprintf("\x1b[%dG", $column)); - - return $this; - } - - /** - * @return $this - */ - public function moveToPosition(int $column, int $row): static - { - $this->output->write(\sprintf("\x1b[%d;%dH", $row + 1, $column)); - - return $this; - } - - /** - * @return $this - */ - public function savePosition(): static - { - $this->output->write("\x1b7"); - - return $this; - } - - /** - * @return $this - */ - public function restorePosition(): static - { - $this->output->write("\x1b8"); - - return $this; - } - - /** - * @return $this - */ - public function hide(): static - { - $this->output->write("\x1b[?25l"); - - return $this; - } - - /** - * @return $this - */ - public function show(): static - { - $this->output->write("\x1b[?25h\x1b[?0c"); - - return $this; - } - - /** - * Clears all the output from the current line. - * - * @return $this - */ - public function clearLine(): static - { - $this->output->write("\x1b[2K"); - - return $this; - } - - /** - * Clears all the output from the current line after the current position. - */ - public function clearLineAfter(): self - { - $this->output->write("\x1b[K"); - - return $this; - } - - /** - * Clears all the output from the cursors' current position to the end of the screen. - * - * @return $this - */ - public function clearOutput(): static - { - $this->output->write("\x1b[0J"); - - return $this; - } - - /** - * Clears the entire screen. - * - * @return $this - */ - public function clearScreen(): static - { - $this->output->write("\x1b[2J"); - - return $this; - } - - /** - * Returns the current cursor position as x,y coordinates. - */ - public function getCurrentPosition(): array - { - static $isTtySupported; - - if (!$isTtySupported ??= '/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT)) { - return [1, 1]; - } - - $sttyMode = shell_exec('stty -g'); - shell_exec('stty -icanon -echo'); - - @fwrite($this->input, "\033[6n"); - - $code = trim(fread($this->input, 1024)); - - shell_exec(\sprintf('stty %s', $sttyMode)); - - sscanf($code, "\033[%d;%dR", $row, $col); - - return [$col, $row]; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/DataCollector/CommandDataCollector.php b/tools/php-cs-fixer/vendor/symfony/console/DataCollector/CommandDataCollector.php deleted file mode 100644 index 3cbe72b5..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/DataCollector/CommandDataCollector.php +++ /dev/null @@ -1,234 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\DataCollector; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Debug\CliRequest; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\SignalRegistry\SignalMap; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\DataCollector\DataCollector; -use Symfony\Component\VarDumper\Cloner\Data; - -/** - * @internal - * - * @author Jules Pietri - */ -final class CommandDataCollector extends DataCollector -{ - public function collect(Request $request, Response $response, ?\Throwable $exception = null): void - { - if (!$request instanceof CliRequest) { - return; - } - - $command = $request->command; - $application = $command->getApplication(); - - $this->data = [ - 'command' => $this->cloneVar($command->command), - 'exit_code' => $command->exitCode, - 'interrupted_by_signal' => $command->interruptedBySignal, - 'duration' => $command->duration, - 'max_memory_usage' => $command->maxMemoryUsage, - 'verbosity_level' => match ($command->output->getVerbosity()) { - OutputInterface::VERBOSITY_QUIET => 'quiet', - OutputInterface::VERBOSITY_NORMAL => 'normal', - OutputInterface::VERBOSITY_VERBOSE => 'verbose', - OutputInterface::VERBOSITY_VERY_VERBOSE => 'very verbose', - OutputInterface::VERBOSITY_DEBUG => 'debug', - }, - 'interactive' => $command->isInteractive, - 'validate_input' => !$command->ignoreValidation, - 'enabled' => $command->isEnabled(), - 'visible' => !$command->isHidden(), - 'input' => $this->cloneVar($command->input), - 'output' => $this->cloneVar($command->output), - 'interactive_inputs' => array_map($this->cloneVar(...), $command->interactiveInputs), - 'signalable' => $command->getSubscribedSignals(), - 'handled_signals' => $command->handledSignals, - 'helper_set' => array_map($this->cloneVar(...), iterator_to_array($command->getHelperSet())), - ]; - - $baseDefinition = $application->getDefinition(); - - foreach ($command->arguments as $argName => $argValue) { - if ($baseDefinition->hasArgument($argName)) { - $this->data['application_inputs'][$argName] = $this->cloneVar($argValue); - } else { - $this->data['arguments'][$argName] = $this->cloneVar($argValue); - } - } - - foreach ($command->options as $optName => $optValue) { - if ($baseDefinition->hasOption($optName)) { - $this->data['application_inputs']['--'.$optName] = $this->cloneVar($optValue); - } else { - $this->data['options'][$optName] = $this->cloneVar($optValue); - } - } - } - - public function getName(): string - { - return 'command'; - } - - /** - * @return array{ - * class?: class-string, - * executor?: string, - * file: string, - * line: int, - * } - */ - public function getCommand(): array - { - $class = $this->data['command']->getType(); - $r = new \ReflectionMethod($class, 'execute'); - - if (Command::class !== $r->getDeclaringClass()) { - return [ - 'executor' => $class.'::'.$r->name, - 'file' => $r->getFileName(), - 'line' => $r->getStartLine(), - ]; - } - - $r = new \ReflectionClass($class); - - return [ - 'class' => $class, - 'file' => $r->getFileName(), - 'line' => $r->getStartLine(), - ]; - } - - public function getInterruptedBySignal(): ?string - { - if (isset($this->data['interrupted_by_signal'])) { - return \sprintf('%s (%d)', SignalMap::getSignalName($this->data['interrupted_by_signal']), $this->data['interrupted_by_signal']); - } - - return null; - } - - public function getDuration(): string - { - return $this->data['duration']; - } - - public function getMaxMemoryUsage(): string - { - return $this->data['max_memory_usage']; - } - - public function getVerbosityLevel(): string - { - return $this->data['verbosity_level']; - } - - public function getInteractive(): bool - { - return $this->data['interactive']; - } - - public function getValidateInput(): bool - { - return $this->data['validate_input']; - } - - public function getEnabled(): bool - { - return $this->data['enabled']; - } - - public function getVisible(): bool - { - return $this->data['visible']; - } - - public function getInput(): Data - { - return $this->data['input']; - } - - public function getOutput(): Data - { - return $this->data['output']; - } - - /** - * @return Data[] - */ - public function getArguments(): array - { - return $this->data['arguments'] ?? []; - } - - /** - * @return Data[] - */ - public function getOptions(): array - { - return $this->data['options'] ?? []; - } - - /** - * @return Data[] - */ - public function getApplicationInputs(): array - { - return $this->data['application_inputs'] ?? []; - } - - /** - * @return Data[] - */ - public function getInteractiveInputs(): array - { - return $this->data['interactive_inputs'] ?? []; - } - - public function getSignalable(): array - { - return array_map( - static fn (int $signal): string => \sprintf('%s (%d)', SignalMap::getSignalName($signal), $signal), - $this->data['signalable'] - ); - } - - public function getHandledSignals(): array - { - $keys = array_map( - static fn (int $signal): string => \sprintf('%s (%d)', SignalMap::getSignalName($signal), $signal), - array_keys($this->data['handled_signals']) - ); - - return array_combine($keys, array_values($this->data['handled_signals'])); - } - - /** - * @return Data[] - */ - public function getHelperSet(): array - { - return $this->data['helper_set'] ?? []; - } - - public function reset(): void - { - $this->data = []; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Debug/CliRequest.php b/tools/php-cs-fixer/vendor/symfony/console/Debug/CliRequest.php deleted file mode 100644 index b023db07..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Debug/CliRequest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Debug; - -use Symfony\Component\Console\Command\TraceableCommand; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * @internal - */ -final class CliRequest extends Request -{ - public function __construct( - public readonly TraceableCommand $command, - ) { - parent::__construct( - attributes: ['_controller' => \get_class($command->command), '_virtual_type' => 'command'], - server: $_SERVER, - ); - } - - // Methods below allow to populate a profile, thus enable search and filtering - public function getUri(): string - { - if ($this->server->has('SYMFONY_CLI_BINARY_NAME')) { - $binary = $this->server->get('SYMFONY_CLI_BINARY_NAME').' console'; - } else { - $binary = $this->server->get('argv')[0]; - } - - return $binary.' '.$this->command->input; - } - - public function getMethod(): string - { - return $this->command->isInteractive ? 'INTERACTIVE' : 'BATCH'; - } - - public function getResponse(): Response - { - return new class($this->command->exitCode) extends Response { - public function __construct(private readonly int $exitCode) - { - parent::__construct(); - } - - public function getStatusCode(): int - { - return $this->exitCode; - } - }; - } - - public function getClientIp(): string - { - $application = $this->command->getApplication(); - - return $application->getName().' '.$application->getVersion(); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/tools/php-cs-fixer/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php deleted file mode 100644 index f1521602..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ /dev/null @@ -1,131 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\DependencyInjection; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\LazyCommand; -use Symfony\Component\Console\CommandLoader\ContainerCommandLoader; -use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\TypedReference; - -/** - * Registers console commands. - * - * @author Grégoire Pineau - */ -class AddConsoleCommandPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container): void - { - $commandServices = $container->findTaggedServiceIds('console.command', true); - $lazyCommandMap = []; - $lazyCommandRefs = []; - $serviceIds = []; - - foreach ($commandServices as $id => $tags) { - $definition = $container->getDefinition($id); - $definition->addTag('container.no_preload'); - $class = $container->getParameterBag()->resolveValue($definition->getClass()); - - if (isset($tags[0]['command'])) { - $aliases = $tags[0]['command']; - } else { - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(\sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); - } - $aliases = str_replace('%', '%%', $class::getDefaultName() ?? ''); - } - - $aliases = explode('|', $aliases); - $commandName = array_shift($aliases); - - if ($isHidden = '' === $commandName) { - $commandName = array_shift($aliases); - } - - if (null === $commandName) { - if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag('container.private')) { - $commandId = 'console.command.public_alias.'.$id; - $container->setAlias($commandId, $id)->setPublic(true); - $id = $commandId; - } - $serviceIds[] = $id; - - continue; - } - - $description = $tags[0]['description'] ?? null; - - unset($tags[0]); - $lazyCommandMap[$commandName] = $id; - $lazyCommandRefs[$id] = new TypedReference($id, $class); - - foreach ($aliases as $alias) { - $lazyCommandMap[$alias] = $id; - } - - foreach ($tags as $tag) { - if (isset($tag['command'])) { - $aliases[] = $tag['command']; - $lazyCommandMap[$tag['command']] = $id; - } - - $description ??= $tag['description'] ?? null; - } - - $definition->addMethodCall('setName', [$commandName]); - - if ($aliases) { - $definition->addMethodCall('setAliases', [$aliases]); - } - - if ($isHidden) { - $definition->addMethodCall('setHidden', [true]); - } - - if (!$description) { - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(\sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); - } - $description = str_replace('%', '%%', $class::getDefaultDescription() ?? ''); - } - - if ($description) { - $definition->addMethodCall('setDescription', [$description]); - - $container->register('.'.$id.'.lazy', LazyCommand::class) - ->setArguments([$commandName, $aliases, $description, $isHidden, new ServiceClosureArgument($lazyCommandRefs[$id])]); - - $lazyCommandRefs[$id] = new Reference('.'.$id.'.lazy'); - } - } - - $container - ->register('console.command_loader', ContainerCommandLoader::class) - ->setPublic(true) - ->addTag('container.no_preload') - ->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]); - - $container->setParameter('console.command.ids', $serviceIds); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ApplicationDescription.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ApplicationDescription.php deleted file mode 100644 index 802d6856..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * @author Jean-François Simon - * - * @internal - */ -class ApplicationDescription -{ - public const GLOBAL_NAMESPACE = '_global'; - - private array $namespaces; - - /** - * @var array - */ - private array $commands; - - /** - * @var array - */ - private array $aliases = []; - - public function __construct( - private Application $application, - private ?string $namespace = null, - private bool $showHidden = false, - ) { - } - - public function getNamespaces(): array - { - if (!isset($this->namespaces)) { - $this->inspectApplication(); - } - - return $this->namespaces; - } - - /** - * @return Command[] - */ - public function getCommands(): array - { - if (!isset($this->commands)) { - $this->inspectApplication(); - } - - return $this->commands; - } - - /** - * @throws CommandNotFoundException - */ - public function getCommand(string $name): Command - { - if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { - throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name)); - } - - return $this->commands[$name] ?? $this->aliases[$name]; - } - - private function inspectApplication(): void - { - $this->commands = []; - $this->namespaces = []; - - $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null); - foreach ($this->sortCommands($all) as $namespace => $commands) { - $names = []; - - /** @var Command $command */ - foreach ($commands as $name => $command) { - if (!$command->getName() || (!$this->showHidden && $command->isHidden())) { - continue; - } - - if ($command->getName() === $name) { - $this->commands[$name] = $command; - } else { - $this->aliases[$name] = $command; - } - - $names[] = $name; - } - - $this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names]; - } - } - - private function sortCommands(array $commands): array - { - $namespacedCommands = []; - $globalCommands = []; - $sortedCommands = []; - foreach ($commands as $name => $command) { - $key = $this->application->extractNamespace($name, 1); - if (\in_array($key, ['', self::GLOBAL_NAMESPACE], true)) { - $globalCommands[$name] = $command; - } else { - $namespacedCommands[$key][$name] = $command; - } - } - - if ($globalCommands) { - ksort($globalCommands); - $sortedCommands[self::GLOBAL_NAMESPACE] = $globalCommands; - } - - if ($namespacedCommands) { - ksort($namespacedCommands, \SORT_STRING); - foreach ($namespacedCommands as $key => $commandsSet) { - ksort($commandsSet); - $sortedCommands[$key] = $commandsSet; - } - } - - return $sortedCommands; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/Descriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/Descriptor.php deleted file mode 100644 index 2143a17c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/Descriptor.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Jean-François Simon - * - * @internal - */ -abstract class Descriptor implements DescriptorInterface -{ - protected OutputInterface $output; - - public function describe(OutputInterface $output, object $object, array $options = []): void - { - $this->output = $output; - - match (true) { - $object instanceof InputArgument => $this->describeInputArgument($object, $options), - $object instanceof InputOption => $this->describeInputOption($object, $options), - $object instanceof InputDefinition => $this->describeInputDefinition($object, $options), - $object instanceof Command => $this->describeCommand($object, $options), - $object instanceof Application => $this->describeApplication($object, $options), - default => throw new InvalidArgumentException(\sprintf('Object of type "%s" is not describable.', get_debug_type($object))), - }; - } - - protected function write(string $content, bool $decorated = false): void - { - $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW); - } - - /** - * Describes an InputArgument instance. - */ - abstract protected function describeInputArgument(InputArgument $argument, array $options = []): void; - - /** - * Describes an InputOption instance. - */ - abstract protected function describeInputOption(InputOption $option, array $options = []): void; - - /** - * Describes an InputDefinition instance. - */ - abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []): void; - - /** - * Describes a Command instance. - */ - abstract protected function describeCommand(Command $command, array $options = []): void; - - /** - * Describes an Application instance. - */ - abstract protected function describeApplication(Application $application, array $options = []): void; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/DescriptorInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/DescriptorInterface.php deleted file mode 100644 index 04e5a7c8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/DescriptorInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Descriptor interface. - * - * @author Jean-François Simon - */ -interface DescriptorInterface -{ - public function describe(OutputInterface $output, object $object, array $options = []): void; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/JsonDescriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/JsonDescriptor.php deleted file mode 100644 index 95630370..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/JsonDescriptor.php +++ /dev/null @@ -1,166 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * JSON descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class JsonDescriptor extends Descriptor -{ - protected function describeInputArgument(InputArgument $argument, array $options = []): void - { - $this->writeData($this->getInputArgumentData($argument), $options); - } - - protected function describeInputOption(InputOption $option, array $options = []): void - { - $this->writeData($this->getInputOptionData($option), $options); - if ($option->isNegatable()) { - $this->writeData($this->getInputOptionData($option, true), $options); - } - } - - protected function describeInputDefinition(InputDefinition $definition, array $options = []): void - { - $this->writeData($this->getInputDefinitionData($definition), $options); - } - - protected function describeCommand(Command $command, array $options = []): void - { - $this->writeData($this->getCommandData($command, $options['short'] ?? false), $options); - } - - protected function describeApplication(Application $application, array $options = []): void - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace, true); - $commands = []; - - foreach ($description->getCommands() as $command) { - $commands[] = $this->getCommandData($command, $options['short'] ?? false); - } - - $data = []; - if ('UNKNOWN' !== $application->getName()) { - $data['application']['name'] = $application->getName(); - if ('UNKNOWN' !== $application->getVersion()) { - $data['application']['version'] = $application->getVersion(); - } - } - - $data['commands'] = $commands; - - if ($describedNamespace) { - $data['namespace'] = $describedNamespace; - } else { - $data['namespaces'] = array_values($description->getNamespaces()); - } - - $this->writeData($data, $options); - } - - /** - * Writes data as json. - */ - private function writeData(array $data, array $options): void - { - $flags = $options['json_encoding'] ?? 0; - - $this->write(json_encode($data, $flags)); - } - - private function getInputArgumentData(InputArgument $argument): array - { - return [ - 'name' => $argument->getName(), - 'is_required' => $argument->isRequired(), - 'is_array' => $argument->isArray(), - 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()), - 'default' => \INF === $argument->getDefault() ? 'INF' : $argument->getDefault(), - ]; - } - - private function getInputOptionData(InputOption $option, bool $negated = false): array - { - return $negated ? [ - 'name' => '--no-'.$option->getName(), - 'shortcut' => '', - 'accept_value' => false, - 'is_value_required' => false, - 'is_multiple' => false, - 'description' => 'Negate the "--'.$option->getName().'" option', - 'default' => false, - ] : [ - 'name' => '--'.$option->getName(), - 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '', - 'accept_value' => $option->acceptValue(), - 'is_value_required' => $option->isValueRequired(), - 'is_multiple' => $option->isArray(), - 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()), - 'default' => \INF === $option->getDefault() ? 'INF' : $option->getDefault(), - ]; - } - - private function getInputDefinitionData(InputDefinition $definition): array - { - $inputArguments = []; - foreach ($definition->getArguments() as $name => $argument) { - $inputArguments[$name] = $this->getInputArgumentData($argument); - } - - $inputOptions = []; - foreach ($definition->getOptions() as $name => $option) { - $inputOptions[$name] = $this->getInputOptionData($option); - if ($option->isNegatable()) { - $inputOptions['no-'.$name] = $this->getInputOptionData($option, true); - } - } - - return ['arguments' => $inputArguments, 'options' => $inputOptions]; - } - - private function getCommandData(Command $command, bool $short = false): array - { - $data = [ - 'name' => $command->getName(), - 'description' => $command->getDescription(), - ]; - - if ($short) { - $data += [ - 'usage' => $command->getAliases(), - ]; - } else { - $command->mergeApplicationDefinition(false); - - $data += [ - 'usage' => array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()), - 'help' => $command->getProcessedHelp(), - 'definition' => $this->getInputDefinitionData($command->getDefinition()), - ]; - } - - $data['hidden'] = $command->isHidden(); - - return $data; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/MarkdownDescriptor.php deleted file mode 100644 index 8b707594..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/MarkdownDescriptor.php +++ /dev/null @@ -1,173 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Markdown descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class MarkdownDescriptor extends Descriptor -{ - public function describe(OutputInterface $output, object $object, array $options = []): void - { - $decorated = $output->isDecorated(); - $output->setDecorated(false); - - parent::describe($output, $object, $options); - - $output->setDecorated($decorated); - } - - protected function write(string $content, bool $decorated = true): void - { - parent::write($content, $decorated); - } - - protected function describeInputArgument(InputArgument $argument, array $options = []): void - { - $this->write( - '#### `'.($argument->getName() ?: '')."`\n\n" - .($argument->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $argument->getDescription())."\n\n" : '') - .'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n" - .'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n" - .'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`' - ); - } - - protected function describeInputOption(InputOption $option, array $options = []): void - { - $name = '--'.$option->getName(); - if ($option->isNegatable()) { - $name .= '|--no-'.$option->getName(); - } - if ($option->getShortcut()) { - $name .= '|-'.str_replace('|', '|-', $option->getShortcut()).''; - } - - $this->write( - '#### `'.$name.'`'."\n\n" - .($option->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $option->getDescription())."\n\n" : '') - .'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n" - .'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n" - .'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n" - .'* Is negatable: '.($option->isNegatable() ? 'yes' : 'no')."\n" - .'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`' - ); - } - - protected function describeInputDefinition(InputDefinition $definition, array $options = []): void - { - if ($showArguments = \count($definition->getArguments()) > 0) { - $this->write('### Arguments'); - foreach ($definition->getArguments() as $argument) { - $this->write("\n\n"); - $this->describeInputArgument($argument); - } - } - - if (\count($definition->getOptions()) > 0) { - if ($showArguments) { - $this->write("\n\n"); - } - - $this->write('### Options'); - foreach ($definition->getOptions() as $option) { - $this->write("\n\n"); - $this->describeInputOption($option); - } - } - } - - protected function describeCommand(Command $command, array $options = []): void - { - if ($options['short'] ?? false) { - $this->write( - '`'.$command->getName()."`\n" - .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - .'### Usage'."\n\n" - .array_reduce($command->getAliases(), fn ($carry, $usage) => $carry.'* `'.$usage.'`'."\n") - ); - - return; - } - - $command->mergeApplicationDefinition(false); - - $this->write( - '`'.$command->getName()."`\n" - .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - .'### Usage'."\n\n" - .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), fn ($carry, $usage) => $carry.'* `'.$usage.'`'."\n") - ); - - if ($help = $command->getProcessedHelp()) { - $this->write("\n"); - $this->write($help); - } - - $definition = $command->getDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { - $this->write("\n\n"); - $this->describeInputDefinition($definition); - } - } - - protected function describeApplication(Application $application, array $options = []): void - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace); - $title = $this->getApplicationTitle($application); - - $this->write($title."\n".str_repeat('=', Helper::width($title))); - - foreach ($description->getNamespaces() as $namespace) { - if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { - $this->write("\n\n"); - $this->write('**'.$namespace['id'].':**'); - } - - $this->write("\n\n"); - $this->write(implode("\n", array_map(fn ($commandName) => \sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())), $namespace['commands']))); - } - - foreach ($description->getCommands() as $command) { - $this->write("\n\n"); - $this->describeCommand($command, $options); - } - } - - private function getApplicationTitle(Application $application): string - { - if ('UNKNOWN' !== $application->getName()) { - if ('UNKNOWN' !== $application->getVersion()) { - return \sprintf('%s %s', $application->getName(), $application->getVersion()); - } - - return $application->getName(); - } - - return 'Console Tool'; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php deleted file mode 100644 index d2dde6fb..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php +++ /dev/null @@ -1,273 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\String\UnicodeString; - -class ReStructuredTextDescriptor extends Descriptor -{ - //

- private string $partChar = '='; - //

- private string $chapterChar = '-'; - //

- private string $sectionChar = '~'; - //

- private string $subsectionChar = '.'; - //

- private string $subsubsectionChar = '^'; - //
- private string $paragraphsChar = '"'; - - private array $visibleNamespaces = []; - - public function describe(OutputInterface $output, object $object, array $options = []): void - { - $decorated = $output->isDecorated(); - $output->setDecorated(false); - - parent::describe($output, $object, $options); - - $output->setDecorated($decorated); - } - - /** - * Override parent method to set $decorated = true. - */ - protected function write(string $content, bool $decorated = true): void - { - parent::write($content, $decorated); - } - - protected function describeInputArgument(InputArgument $argument, array $options = []): void - { - $this->write( - $argument->getName() ?: ''."\n".str_repeat($this->paragraphsChar, Helper::width($argument->getName()))."\n\n" - .($argument->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $argument->getDescription())."\n\n" : '') - .'- **Is required**: '.($argument->isRequired() ? 'yes' : 'no')."\n" - .'- **Is array**: '.($argument->isArray() ? 'yes' : 'no')."\n" - .'- **Default**: ``'.str_replace("\n", '', var_export($argument->getDefault(), true)).'``' - ); - } - - protected function describeInputOption(InputOption $option, array $options = []): void - { - $name = '\-\-'.$option->getName(); - if ($option->isNegatable()) { - $name .= '|\-\-no-'.$option->getName(); - } - if ($option->getShortcut()) { - $name .= '|-'.str_replace('|', '|-', $option->getShortcut()); - } - - $optionDescription = $option->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n\n", $option->getDescription())."\n\n" : ''; - $optionDescription = (new UnicodeString($optionDescription))->ascii(); - $this->write( - $name."\n".str_repeat($this->paragraphsChar, Helper::width($name))."\n\n" - .$optionDescription - .'- **Accept value**: '.($option->acceptValue() ? 'yes' : 'no')."\n" - .'- **Is value required**: '.($option->isValueRequired() ? 'yes' : 'no')."\n" - .'- **Is multiple**: '.($option->isArray() ? 'yes' : 'no')."\n" - .'- **Is negatable**: '.($option->isNegatable() ? 'yes' : 'no')."\n" - .'- **Default**: ``'.str_replace("\n", '', var_export($option->getDefault(), true)).'``'."\n" - ); - } - - protected function describeInputDefinition(InputDefinition $definition, array $options = []): void - { - if ($showArguments = ((bool) $definition->getArguments())) { - $this->write("Arguments\n".str_repeat($this->subsubsectionChar, 9)); - foreach ($definition->getArguments() as $argument) { - $this->write("\n\n"); - $this->describeInputArgument($argument); - } - } - - if ($nonDefaultOptions = $this->getNonDefaultOptions($definition)) { - if ($showArguments) { - $this->write("\n\n"); - } - - $this->write("Options\n".str_repeat($this->subsubsectionChar, 7)."\n\n"); - foreach ($nonDefaultOptions as $option) { - $this->describeInputOption($option); - $this->write("\n"); - } - } - } - - protected function describeCommand(Command $command, array $options = []): void - { - if ($options['short'] ?? false) { - $this->write( - '``'.$command->getName()."``\n" - .str_repeat($this->subsectionChar, Helper::width($command->getName()))."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - ."Usage\n".str_repeat($this->paragraphsChar, 5)."\n\n" - .array_reduce($command->getAliases(), static fn ($carry, $usage) => $carry.'- ``'.$usage.'``'."\n") - ); - - return; - } - - $command->mergeApplicationDefinition(false); - - foreach ($command->getAliases() as $alias) { - $this->write('.. _'.$alias.":\n\n"); - } - $this->write( - $command->getName()."\n" - .str_repeat($this->subsectionChar, Helper::width($command->getName()))."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - ."Usage\n".str_repeat($this->subsubsectionChar, 5)."\n\n" - .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), static fn ($carry, $usage) => $carry.'- ``'.$usage.'``'."\n") - ); - - if ($help = $command->getProcessedHelp()) { - $this->write("\n"); - $this->write($help); - } - - $definition = $command->getDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { - $this->write("\n\n"); - $this->describeInputDefinition($definition); - } - } - - protected function describeApplication(Application $application, array $options = []): void - { - $description = new ApplicationDescription($application, $options['namespace'] ?? null); - $title = $this->getApplicationTitle($application); - - $this->write($title."\n".str_repeat($this->partChar, Helper::width($title))); - $this->createTableOfContents($description, $application); - $this->describeCommands($application, $options); - } - - private function getApplicationTitle(Application $application): string - { - if ('UNKNOWN' === $application->getName()) { - return 'Console Tool'; - } - if ('UNKNOWN' !== $application->getVersion()) { - return \sprintf('%s %s', $application->getName(), $application->getVersion()); - } - - return $application->getName(); - } - - private function describeCommands($application, array $options): void - { - $title = 'Commands'; - $this->write("\n\n$title\n".str_repeat($this->chapterChar, Helper::width($title))."\n\n"); - foreach ($this->visibleNamespaces as $namespace) { - if ('_global' === $namespace) { - $commands = $application->all(''); - $this->write('Global'."\n".str_repeat($this->sectionChar, Helper::width('Global'))."\n\n"); - } else { - $commands = $application->all($namespace); - $this->write($namespace."\n".str_repeat($this->sectionChar, Helper::width($namespace))."\n\n"); - } - - foreach ($this->removeAliasesAndHiddenCommands($commands) as $command) { - $this->describeCommand($command, $options); - $this->write("\n\n"); - } - } - } - - private function createTableOfContents(ApplicationDescription $description, Application $application): void - { - $this->setVisibleNamespaces($description); - $chapterTitle = 'Table of Contents'; - $this->write("\n\n$chapterTitle\n".str_repeat($this->chapterChar, Helper::width($chapterTitle))."\n\n"); - foreach ($this->visibleNamespaces as $namespace) { - if ('_global' === $namespace) { - $commands = $application->all(''); - } else { - $commands = $application->all($namespace); - $this->write("\n\n"); - $this->write($namespace."\n".str_repeat($this->sectionChar, Helper::width($namespace))."\n\n"); - } - $commands = $this->removeAliasesAndHiddenCommands($commands); - - $this->write("\n\n"); - $this->write(implode("\n", array_map(static fn ($commandName) => \sprintf('- `%s`_', $commandName), array_keys($commands)))); - } - } - - private function getNonDefaultOptions(InputDefinition $definition): array - { - $globalOptions = [ - 'help', - 'silent', - 'quiet', - 'verbose', - 'version', - 'ansi', - 'no-interaction', - ]; - $nonDefaultOptions = []; - foreach ($definition->getOptions() as $option) { - // Skip global options. - if (!\in_array($option->getName(), $globalOptions, true)) { - $nonDefaultOptions[] = $option; - } - } - - return $nonDefaultOptions; - } - - private function setVisibleNamespaces(ApplicationDescription $description): void - { - $commands = $description->getCommands(); - foreach ($description->getNamespaces() as $namespace) { - try { - $namespaceCommands = $namespace['commands']; - foreach ($namespaceCommands as $key => $commandName) { - if (!\array_key_exists($commandName, $commands)) { - // If the array key does not exist, then this is an alias. - unset($namespaceCommands[$key]); - } elseif ($commands[$commandName]->isHidden()) { - unset($namespaceCommands[$key]); - } - } - if (!$namespaceCommands) { - // If the namespace contained only aliases or hidden commands, skip the namespace. - continue; - } - } catch (\Exception) { - } - $this->visibleNamespaces[] = $namespace['id']; - } - } - - private function removeAliasesAndHiddenCommands(array $commands): array - { - foreach ($commands as $key => $command) { - if ($command->isHidden() || \in_array($key, $command->getAliases(), true)) { - unset($commands[$key]); - } - } - unset($commands['completion']); - - return $commands; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/TextDescriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/TextDescriptor.php deleted file mode 100644 index 51c411f4..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/TextDescriptor.php +++ /dev/null @@ -1,317 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * Text descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class TextDescriptor extends Descriptor -{ - protected function describeInputArgument(InputArgument $argument, array $options = []): void - { - if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) { - $default = \sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); - } else { - $default = ''; - } - - $totalWidth = $options['total_width'] ?? Helper::width($argument->getName()); - $spacingWidth = $totalWidth - \strlen($argument->getName()); - - $this->writeText(\sprintf(' %s %s%s%s', - $argument->getName(), - str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $argument->getDescription()), - $default - ), $options); - } - - protected function describeInputOption(InputOption $option, array $options = []): void - { - if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) { - $default = \sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); - } else { - $default = ''; - } - - $value = ''; - if ($option->acceptValue()) { - $value = '='.strtoupper($option->getName()); - - if ($option->isValueOptional()) { - $value = '['.$value.']'; - } - } - - $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]); - $synopsis = \sprintf('%s%s', - $option->getShortcut() ? \sprintf('-%s, ', $option->getShortcut()) : ' ', - \sprintf($option->isNegatable() ? '--%1$s|--no-%1$s' : '--%1$s%2$s', $option->getName(), $value) - ); - - $spacingWidth = $totalWidth - Helper::width($synopsis); - - $this->writeText(\sprintf(' %s %s%s%s%s', - $synopsis, - str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $option->getDescription()), - $default, - $option->isArray() ? ' (multiple values allowed)' : '' - ), $options); - } - - protected function describeInputDefinition(InputDefinition $definition, array $options = []): void - { - $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); - foreach ($definition->getArguments() as $argument) { - $totalWidth = max($totalWidth, Helper::width($argument->getName())); - } - - if ($definition->getArguments()) { - $this->writeText('Arguments:', $options); - $this->writeText("\n"); - foreach ($definition->getArguments() as $argument) { - $this->describeInputArgument($argument, array_merge($options, ['total_width' => $totalWidth])); - $this->writeText("\n"); - } - } - - if ($definition->getArguments() && $definition->getOptions()) { - $this->writeText("\n"); - } - - if ($definition->getOptions()) { - $laterOptions = []; - - $this->writeText('Options:', $options); - foreach ($definition->getOptions() as $option) { - if (\strlen($option->getShortcut() ?? '') > 1) { - $laterOptions[] = $option; - continue; - } - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - foreach ($laterOptions as $option) { - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - } - } - - protected function describeCommand(Command $command, array $options = []): void - { - $command->mergeApplicationDefinition(false); - - if ($description = $command->getDescription()) { - $this->writeText('Description:', $options); - $this->writeText("\n"); - $this->writeText(' '.$description); - $this->writeText("\n\n"); - } - - $this->writeText('Usage:', $options); - foreach (array_merge([$command->getSynopsis(true)], $command->getAliases(), $command->getUsages()) as $usage) { - $this->writeText("\n"); - $this->writeText(' '.OutputFormatter::escape($usage), $options); - } - $this->writeText("\n"); - - $definition = $command->getDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { - $this->writeText("\n"); - $this->describeInputDefinition($definition, $options); - $this->writeText("\n"); - } - - $help = $command->getProcessedHelp(); - if ($help && $help !== $description) { - $this->writeText("\n"); - $this->writeText('Help:', $options); - $this->writeText("\n"); - $this->writeText(' '.str_replace("\n", "\n ", $help), $options); - $this->writeText("\n"); - } - } - - protected function describeApplication(Application $application, array $options = []): void - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace); - - if (isset($options['raw_text']) && $options['raw_text']) { - $width = $this->getColumnWidth($description->getCommands()); - - foreach ($description->getCommands() as $command) { - $this->writeText(\sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options); - $this->writeText("\n"); - } - } else { - if ('' != $help = $application->getHelp()) { - $this->writeText("$help\n\n", $options); - } - - $this->writeText("Usage:\n", $options); - $this->writeText(" command [options] [arguments]\n\n", $options); - - $this->describeInputDefinition(new InputDefinition($application->getDefinition()->getOptions()), $options); - - $this->writeText("\n"); - $this->writeText("\n"); - - $commands = $description->getCommands(); - $namespaces = $description->getNamespaces(); - if ($describedNamespace && $namespaces) { - // make sure all alias commands are included when describing a specific namespace - $describedNamespaceInfo = reset($namespaces); - foreach ($describedNamespaceInfo['commands'] as $name) { - $commands[$name] = $description->getCommand($name); - } - } - - // calculate max. width based on available commands per namespace - $width = $this->getColumnWidth(array_merge(...array_values(array_map(fn ($namespace) => array_intersect($namespace['commands'], array_keys($commands)), array_values($namespaces))))); - - if ($describedNamespace) { - $this->writeText(\sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); - } else { - $this->writeText('Available commands:', $options); - } - - foreach ($namespaces as $namespace) { - $namespace['commands'] = array_filter($namespace['commands'], fn ($name) => isset($commands[$name])); - - if (!$namespace['commands']) { - continue; - } - - if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { - $this->writeText("\n"); - $this->writeText(' '.$namespace['id'].'', $options); - } - - foreach ($namespace['commands'] as $name) { - $this->writeText("\n"); - $spacingWidth = $width - Helper::width($name); - $command = $commands[$name]; - $commandAliases = $name === $command->getName() ? $this->getCommandAliasesText($command) : ''; - $this->writeText(\sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options); - } - } - - $this->writeText("\n"); - } - } - - private function writeText(string $content, array $options = []): void - { - $this->write( - isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, - isset($options['raw_output']) ? !$options['raw_output'] : true - ); - } - - /** - * Formats command aliases to show them in the command description. - */ - private function getCommandAliasesText(Command $command): string - { - $text = ''; - $aliases = $command->getAliases(); - - if ($aliases) { - $text = '['.implode('|', $aliases).'] '; - } - - return $text; - } - - /** - * Formats input option/argument default value. - */ - private function formatDefaultValue(mixed $default): string - { - if (\INF === $default) { - return 'INF'; - } - - if (\is_string($default)) { - $default = OutputFormatter::escape($default); - } elseif (\is_array($default)) { - foreach ($default as $key => $value) { - if (\is_string($value)) { - $default[$key] = OutputFormatter::escape($value); - } - } - } - - return str_replace('\\\\', '\\', json_encode($default, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE)); - } - - /** - * @param array $commands - */ - private function getColumnWidth(array $commands): int - { - $widths = []; - - foreach ($commands as $command) { - if ($command instanceof Command) { - $widths[] = Helper::width($command->getName()); - foreach ($command->getAliases() as $alias) { - $widths[] = Helper::width($alias); - } - } else { - $widths[] = Helper::width($command); - } - } - - return $widths ? max($widths) + 2 : 0; - } - - /** - * @param InputOption[] $options - */ - private function calculateTotalWidthForOptions(array $options): int - { - $totalWidth = 0; - foreach ($options as $option) { - // "-" + shortcut + ", --" + name - $nameLength = 1 + max(Helper::width($option->getShortcut()), 1) + 4 + Helper::width($option->getName()); - if ($option->isNegatable()) { - $nameLength += 6 + Helper::width($option->getName()); // |--no- + name - } elseif ($option->acceptValue()) { - $valueLength = 1 + Helper::width($option->getName()); // = + value - $valueLength += $option->isValueOptional() ? 2 : 0; // [ + ] - - $nameLength += $valueLength; - } - $totalWidth = max($totalWidth, $nameLength); - } - - return $totalWidth; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/XmlDescriptor.php b/tools/php-cs-fixer/vendor/symfony/console/Descriptor/XmlDescriptor.php deleted file mode 100644 index 00055557..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Descriptor/XmlDescriptor.php +++ /dev/null @@ -1,230 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * XML descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class XmlDescriptor extends Descriptor -{ - public function getInputDefinitionDocument(InputDefinition $definition): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($definitionXML = $dom->createElement('definition')); - - $definitionXML->appendChild($argumentsXML = $dom->createElement('arguments')); - foreach ($definition->getArguments() as $argument) { - $this->appendDocument($argumentsXML, $this->getInputArgumentDocument($argument)); - } - - $definitionXML->appendChild($optionsXML = $dom->createElement('options')); - foreach ($definition->getOptions() as $option) { - $this->appendDocument($optionsXML, $this->getInputOptionDocument($option)); - } - - return $dom; - } - - public function getCommandDocument(Command $command, bool $short = false): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($commandXML = $dom->createElement('command')); - - $commandXML->setAttribute('id', $command->getName()); - $commandXML->setAttribute('name', $command->getName()); - $commandXML->setAttribute('hidden', $command->isHidden() ? 1 : 0); - - $commandXML->appendChild($usagesXML = $dom->createElement('usages')); - - $commandXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getDescription()))); - - if ($short) { - foreach ($command->getAliases() as $usage) { - $usagesXML->appendChild($dom->createElement('usage', $usage)); - } - } else { - $command->mergeApplicationDefinition(false); - - foreach (array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()) as $usage) { - $usagesXML->appendChild($dom->createElement('usage', $usage)); - } - - $commandXML->appendChild($helpXML = $dom->createElement('help')); - $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getProcessedHelp()))); - - $definitionXML = $this->getInputDefinitionDocument($command->getDefinition()); - $this->appendDocument($commandXML, $definitionXML->getElementsByTagName('definition')->item(0)); - } - - return $dom; - } - - public function getApplicationDocument(Application $application, ?string $namespace = null, bool $short = false): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($rootXml = $dom->createElement('symfony')); - - if ('UNKNOWN' !== $application->getName()) { - $rootXml->setAttribute('name', $application->getName()); - if ('UNKNOWN' !== $application->getVersion()) { - $rootXml->setAttribute('version', $application->getVersion()); - } - } - - $rootXml->appendChild($commandsXML = $dom->createElement('commands')); - - $description = new ApplicationDescription($application, $namespace, true); - - if ($namespace) { - $commandsXML->setAttribute('namespace', $namespace); - } - - foreach ($description->getCommands() as $command) { - $this->appendDocument($commandsXML, $this->getCommandDocument($command, $short)); - } - - if (!$namespace) { - $rootXml->appendChild($namespacesXML = $dom->createElement('namespaces')); - - foreach ($description->getNamespaces() as $namespaceDescription) { - $namespacesXML->appendChild($namespaceArrayXML = $dom->createElement('namespace')); - $namespaceArrayXML->setAttribute('id', $namespaceDescription['id']); - - foreach ($namespaceDescription['commands'] as $name) { - $namespaceArrayXML->appendChild($commandXML = $dom->createElement('command')); - $commandXML->appendChild($dom->createTextNode($name)); - } - } - } - - return $dom; - } - - protected function describeInputArgument(InputArgument $argument, array $options = []): void - { - $this->writeDocument($this->getInputArgumentDocument($argument)); - } - - protected function describeInputOption(InputOption $option, array $options = []): void - { - $this->writeDocument($this->getInputOptionDocument($option)); - } - - protected function describeInputDefinition(InputDefinition $definition, array $options = []): void - { - $this->writeDocument($this->getInputDefinitionDocument($definition)); - } - - protected function describeCommand(Command $command, array $options = []): void - { - $this->writeDocument($this->getCommandDocument($command, $options['short'] ?? false)); - } - - protected function describeApplication(Application $application, array $options = []): void - { - $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null, $options['short'] ?? false)); - } - - /** - * Appends document children to parent node. - */ - private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent): void - { - foreach ($importedParent->childNodes as $childNode) { - $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true)); - } - } - - /** - * Writes DOM document. - */ - private function writeDocument(\DOMDocument $dom): void - { - $dom->formatOutput = true; - $this->write($dom->saveXML()); - } - - private function getInputArgumentDocument(InputArgument $argument): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - - $dom->appendChild($objectXML = $dom->createElement('argument')); - $objectXML->setAttribute('name', $argument->getName()); - $objectXML->setAttribute('is_required', $argument->isRequired() ? 1 : 0); - $objectXML->setAttribute('is_array', $argument->isArray() ? 1 : 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($argument->getDescription())); - - $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - $defaults = \is_array($argument->getDefault()) ? $argument->getDefault() : (\is_bool($argument->getDefault()) ? [var_export($argument->getDefault(), true)] : ($argument->getDefault() ? [$argument->getDefault()] : [])); - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - - return $dom; - } - - private function getInputOptionDocument(InputOption $option): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - - $dom->appendChild($objectXML = $dom->createElement('option')); - $objectXML->setAttribute('name', '--'.$option->getName()); - $pos = strpos($option->getShortcut() ?? '', '|'); - if (false !== $pos) { - $objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos)); - $objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut())); - } else { - $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : ''); - } - $objectXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0); - $objectXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0); - $objectXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($option->getDescription())); - - if ($option->acceptValue()) { - $defaults = \is_array($option->getDefault()) ? $option->getDefault() : (\is_bool($option->getDefault()) ? [var_export($option->getDefault(), true)] : ($option->getDefault() ? [$option->getDefault()] : [])); - $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - } - - if ($option->isNegatable()) { - $dom->appendChild($objectXML = $dom->createElement('option')); - $objectXML->setAttribute('name', '--no-'.$option->getName()); - $objectXML->setAttribute('shortcut', ''); - $objectXML->setAttribute('accept_value', 0); - $objectXML->setAttribute('is_value_required', 0); - $objectXML->setAttribute('is_multiple', 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode('Negate the "--'.$option->getName().'" option')); - } - - return $dom; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleAlarmEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleAlarmEvent.php deleted file mode 100644 index 876ab59b..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleAlarmEvent.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -final class ConsoleAlarmEvent extends ConsoleEvent -{ - public function __construct( - Command $command, - InputInterface $input, - OutputInterface $output, - private int|false $exitCode = 0, - ) { - parent::__construct($command, $input, $output); - } - - public function setExitCode(int $exitCode): void - { - if ($exitCode < 0 || $exitCode > 255) { - throw new \InvalidArgumentException('Exit code must be between 0 and 255.'); - } - - $this->exitCode = $exitCode; - } - - public function abortExit(): void - { - $this->exitCode = false; - } - - public function getExitCode(): int|false - { - return $this->exitCode; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleCommandEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleCommandEvent.php deleted file mode 100644 index 0757a23f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -/** - * Allows to do things before the command is executed, like skipping the command or executing code before the command is - * going to be executed. - * - * Changing the input arguments will have no effect. - * - * @author Fabien Potencier - */ -final class ConsoleCommandEvent extends ConsoleEvent -{ - /** - * The return code for skipped commands, this will also be passed into the terminate event. - */ - public const RETURN_CODE_DISABLED = 113; - - /** - * Indicates if the command should be run or skipped. - */ - private bool $commandShouldRun = true; - - /** - * Disables the command, so it won't be run. - */ - public function disableCommand(): bool - { - return $this->commandShouldRun = false; - } - - public function enableCommand(): bool - { - return $this->commandShouldRun = true; - } - - /** - * Returns true if the command is runnable, false otherwise. - */ - public function commandShouldRun(): bool - { - return $this->commandShouldRun; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleErrorEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleErrorEvent.php deleted file mode 100644 index 1c0d6265..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleErrorEvent.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Allows to handle throwables thrown while running a command. - * - * @author Wouter de Jong - */ -final class ConsoleErrorEvent extends ConsoleEvent -{ - private int $exitCode; - - public function __construct( - InputInterface $input, - OutputInterface $output, - private \Throwable $error, - ?Command $command = null, - ) { - parent::__construct($command, $input, $output); - } - - public function getError(): \Throwable - { - return $this->error; - } - - public function setError(\Throwable $error): void - { - $this->error = $error; - } - - public function setExitCode(int $exitCode): void - { - $this->exitCode = $exitCode; - - $r = new \ReflectionProperty($this->error, 'code'); - $r->setValue($this->error, $this->exitCode); - } - - public function getExitCode(): int - { - return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleEvent.php deleted file mode 100644 index 2f9f0778..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleEvent.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Allows to inspect input and output of a command. - * - * @author Francesco Levorato - */ -class ConsoleEvent extends Event -{ - public function __construct( - protected ?Command $command, - private InputInterface $input, - private OutputInterface $output, - ) { - } - - /** - * Gets the command that is executed. - */ - public function getCommand(): ?Command - { - return $this->command; - } - - /** - * Gets the input instance. - */ - public function getInput(): InputInterface - { - return $this->input; - } - - /** - * Gets the output instance. - */ - public function getOutput(): OutputInterface - { - return $this->output; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleSignalEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleSignalEvent.php deleted file mode 100644 index b27f08a1..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleSignalEvent.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author marie - */ -final class ConsoleSignalEvent extends ConsoleEvent -{ - public function __construct( - Command $command, - InputInterface $input, - OutputInterface $output, - private int $handlingSignal, - private int|false $exitCode = 0, - ) { - parent::__construct($command, $input, $output); - } - - public function getHandlingSignal(): int - { - return $this->handlingSignal; - } - - public function setExitCode(int $exitCode): void - { - if ($exitCode < 0 || $exitCode > 255) { - throw new \InvalidArgumentException('Exit code must be between 0 and 255.'); - } - - $this->exitCode = $exitCode; - } - - public function abortExit(): void - { - $this->exitCode = false; - } - - public function getExitCode(): int|false - { - return $this->exitCode; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleTerminateEvent.php deleted file mode 100644 index 38f7253a..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Event/ConsoleTerminateEvent.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Allows to manipulate the exit code of a command after its execution. - * - * @author Francesco Levorato - * @author Jules Pietri - */ -final class ConsoleTerminateEvent extends ConsoleEvent -{ - public function __construct( - Command $command, - InputInterface $input, - OutputInterface $output, - private int $exitCode, - private readonly ?int $interruptingSignal = null, - ) { - parent::__construct($command, $input, $output); - } - - public function setExitCode(int $exitCode): void - { - $this->exitCode = $exitCode; - } - - public function getExitCode(): int - { - return $this->exitCode; - } - - public function getInterruptingSignal(): ?int - { - return $this->interruptingSignal; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/EventListener/ErrorListener.php b/tools/php-cs-fixer/vendor/symfony/console/EventListener/ErrorListener.php deleted file mode 100644 index 9acb0e41..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/EventListener/ErrorListener.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\EventListener; - -use Psr\Log\LoggerInterface; -use Symfony\Component\Console\ConsoleEvents; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * @author James Halsall - * @author Robin Chalas - */ -class ErrorListener implements EventSubscriberInterface -{ - public function __construct( - private ?LoggerInterface $logger = null, - ) { - } - - public function onConsoleError(ConsoleErrorEvent $event): void - { - if (null === $this->logger) { - return; - } - - $error = $event->getError(); - - if (!$inputString = self::getInputString($event)) { - $this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); - - return; - } - - $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); - } - - public function onConsoleTerminate(ConsoleTerminateEvent $event): void - { - if (null === $this->logger) { - return; - } - - $exitCode = $event->getExitCode(); - - if (0 === $exitCode) { - return; - } - - if (!$inputString = self::getInputString($event)) { - $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]); - - return; - } - - $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]); - } - - public static function getSubscribedEvents(): array - { - return [ - ConsoleEvents::ERROR => ['onConsoleError', -128], - ConsoleEvents::TERMINATE => ['onConsoleTerminate', -128], - ]; - } - - private static function getInputString(ConsoleEvent $event): string - { - $commandName = $event->getCommand()?->getName(); - $inputString = (string) $event->getInput(); - - if ($commandName) { - return str_replace(["'$commandName'", "\"$commandName\""], $commandName, $inputString); - } - - return $inputString; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Exception/CommandNotFoundException.php b/tools/php-cs-fixer/vendor/symfony/console/Exception/CommandNotFoundException.php deleted file mode 100644 index 246f04fa..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Exception/CommandNotFoundException.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect command name typed in the console. - * - * @author Jérôme Tamarelle - */ -class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface -{ - /** - * @param string $message Exception message to throw - * @param string[] $alternatives List of similar defined names - * @param int $code Exception code - * @param \Throwable|null $previous Previous exception used for the exception chaining - */ - public function __construct( - string $message, - private array $alternatives = [], - int $code = 0, - ?\Throwable $previous = null, - ) { - parent::__construct($message, $code, $previous); - } - - /** - * @return string[] - */ - public function getAlternatives(): array - { - return $this->alternatives; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Exception/ExceptionInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Exception/ExceptionInterface.php deleted file mode 100644 index 1624e13d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * ExceptionInterface. - * - * @author Jérôme Tamarelle - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Exception/InvalidArgumentException.php b/tools/php-cs-fixer/vendor/symfony/console/Exception/InvalidArgumentException.php deleted file mode 100644 index 07cc0b61..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Exception/InvalidOptionException.php b/tools/php-cs-fixer/vendor/symfony/console/Exception/InvalidOptionException.php deleted file mode 100644 index 5cf62792..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Exception/InvalidOptionException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect option name or value typed in the console. - * - * @author Jérôme Tamarelle - */ -class InvalidOptionException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Exception/LogicException.php b/tools/php-cs-fixer/vendor/symfony/console/Exception/LogicException.php deleted file mode 100644 index fc37b8d8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Exception/LogicException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Exception/MissingInputException.php b/tools/php-cs-fixer/vendor/symfony/console/Exception/MissingInputException.php deleted file mode 100644 index 04f02ade..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Exception/MissingInputException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents failure to read input from stdin. - * - * @author Gabriel Ostrolucký - */ -class MissingInputException extends RuntimeException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Exception/NamespaceNotFoundException.php b/tools/php-cs-fixer/vendor/symfony/console/Exception/NamespaceNotFoundException.php deleted file mode 100644 index dd16e450..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Exception/NamespaceNotFoundException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect namespace typed in the console. - * - * @author Pierre du Plessis - */ -class NamespaceNotFoundException extends CommandNotFoundException -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Exception/RunCommandFailedException.php b/tools/php-cs-fixer/vendor/symfony/console/Exception/RunCommandFailedException.php deleted file mode 100644 index 5d87ec94..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Exception/RunCommandFailedException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -use Symfony\Component\Console\Messenger\RunCommandContext; - -/** - * @author Kevin Bond - */ -final class RunCommandFailedException extends RuntimeException -{ - public function __construct(\Throwable|string $exception, public readonly RunCommandContext $context) - { - parent::__construct( - $exception instanceof \Throwable ? $exception->getMessage() : $exception, - $exception instanceof \Throwable ? $exception->getCode() : 0, - $exception instanceof \Throwable ? $exception : null, - ); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Exception/RuntimeException.php b/tools/php-cs-fixer/vendor/symfony/console/Exception/RuntimeException.php deleted file mode 100644 index 51d7d80a..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Exception/RuntimeException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatter.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatter.php deleted file mode 100644 index 5c11c764..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatter.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * @author Tien Xuan Vo - */ -final class NullOutputFormatter implements OutputFormatterInterface -{ - private NullOutputFormatterStyle $style; - - public function format(?string $message): ?string - { - return null; - } - - public function getStyle(string $name): OutputFormatterStyleInterface - { - // to comply with the interface we must return a OutputFormatterStyleInterface - return $this->style ??= new NullOutputFormatterStyle(); - } - - public function hasStyle(string $name): bool - { - return false; - } - - public function isDecorated(): bool - { - return false; - } - - public function setDecorated(bool $decorated): void - { - // do nothing - } - - public function setStyle(string $name, OutputFormatterStyleInterface $style): void - { - // do nothing - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php deleted file mode 100644 index 06fa6e40..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * @author Tien Xuan Vo - */ -final class NullOutputFormatterStyle implements OutputFormatterStyleInterface -{ - public function apply(string $text): string - { - return $text; - } - - public function setBackground(?string $color): void - { - // do nothing - } - - public function setForeground(?string $color): void - { - // do nothing - } - - public function setOption(string $option): void - { - // do nothing - } - - public function setOptions(array $options): void - { - // do nothing - } - - public function unsetOption(string $option): void - { - // do nothing - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatter.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatter.php deleted file mode 100644 index 3c8c287e..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatter.php +++ /dev/null @@ -1,267 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -use function Symfony\Component\String\b; - -/** - * Formatter class for console output. - * - * @author Konstantin Kudryashov - * @author Roland Franssen - */ -class OutputFormatter implements WrappableOutputFormatterInterface -{ - private array $styles = []; - private OutputFormatterStyleStack $styleStack; - - public function __clone() - { - $this->styleStack = clone $this->styleStack; - foreach ($this->styles as $key => $value) { - $this->styles[$key] = clone $value; - } - } - - /** - * Escapes "<" and ">" special chars in given text. - */ - public static function escape(string $text): string - { - $text = preg_replace('/([^\\\\]|^)([<>])/', '$1\\\\$2', $text); - - return self::escapeTrailingBackslash($text); - } - - /** - * Escapes trailing "\" in given text. - * - * @internal - */ - public static function escapeTrailingBackslash(string $text): string - { - if (str_ends_with($text, '\\')) { - $len = \strlen($text); - $text = rtrim($text, '\\'); - $text = str_replace("\0", '', $text); - $text .= str_repeat("\0", $len - \strlen($text)); - } - - return $text; - } - - /** - * Initializes console output formatter. - * - * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances - */ - public function __construct( - private bool $decorated = false, - array $styles = [], - ) { - $this->setStyle('error', new OutputFormatterStyle('white', 'red')); - $this->setStyle('info', new OutputFormatterStyle('green')); - $this->setStyle('comment', new OutputFormatterStyle('yellow')); - $this->setStyle('question', new OutputFormatterStyle('black', 'cyan')); - - foreach ($styles as $name => $style) { - $this->setStyle($name, $style); - } - - $this->styleStack = new OutputFormatterStyleStack(); - } - - public function setDecorated(bool $decorated): void - { - $this->decorated = $decorated; - } - - public function isDecorated(): bool - { - return $this->decorated; - } - - public function setStyle(string $name, OutputFormatterStyleInterface $style): void - { - $this->styles[strtolower($name)] = $style; - } - - public function hasStyle(string $name): bool - { - return isset($this->styles[strtolower($name)]); - } - - public function getStyle(string $name): OutputFormatterStyleInterface - { - if (!$this->hasStyle($name)) { - throw new InvalidArgumentException(\sprintf('Undefined style: "%s".', $name)); - } - - return $this->styles[strtolower($name)]; - } - - public function format(?string $message): ?string - { - return $this->formatAndWrap($message, 0); - } - - public function formatAndWrap(?string $message, int $width): string - { - if (null === $message) { - return ''; - } - - $offset = 0; - $output = ''; - $openTagRegex = '[a-z](?:[^\\\\<>]*+ | \\\\.)*'; - $closeTagRegex = '[a-z][^<>]*+'; - $currentLineLength = 0; - preg_match_all("#<(($openTagRegex) | /($closeTagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE); - foreach ($matches[0] as $i => $match) { - $pos = $match[1]; - $text = $match[0]; - - if (0 != $pos && '\\' == $message[$pos - 1]) { - continue; - } - - // add the text up to the next tag - $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); - $offset = $pos + \strlen($text); - - // opening tag? - if ($open = '/' !== $text[1]) { - $tag = $matches[1][$i][0]; - } else { - $tag = $matches[3][$i][0] ?? ''; - } - - if (!$open && !$tag) { - // - $this->styleStack->pop(); - } elseif (null === $style = $this->createStyleFromString($tag)) { - $output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength); - } elseif ($open) { - $this->styleStack->push($style); - } else { - $this->styleStack->pop($style); - } - } - - $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength); - - return strtr($output, ["\0" => '\\', '\\<' => '<', '\\>' => '>']); - } - - public function getStyleStack(): OutputFormatterStyleStack - { - return $this->styleStack; - } - - /** - * Tries to create new style instance from string. - */ - private function createStyleFromString(string $string): ?OutputFormatterStyleInterface - { - if (isset($this->styles[$string])) { - return $this->styles[$string]; - } - - if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, \PREG_SET_ORDER)) { - return null; - } - - $style = new OutputFormatterStyle(); - foreach ($matches as $match) { - array_shift($match); - $match[0] = strtolower($match[0]); - - if ('fg' == $match[0]) { - $style->setForeground(strtolower($match[1])); - } elseif ('bg' == $match[0]) { - $style->setBackground(strtolower($match[1])); - } elseif ('href' === $match[0]) { - $url = preg_replace('{\\\\([<>])}', '$1', $match[1]); - $style->setHref($url); - } elseif ('options' === $match[0]) { - preg_match_all('([^,;]+)', strtolower($match[1]), $options); - $options = array_shift($options); - foreach ($options as $option) { - $style->setOption($option); - } - } else { - return null; - } - } - - return $style; - } - - /** - * Applies current style from stack to text, if must be applied. - */ - private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string - { - if ('' === $text) { - return ''; - } - - if (!$width) { - return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text; - } - - if (!$currentLineLength && '' !== $current) { - $text = ltrim($text); - } - - if ($currentLineLength) { - $prefix = substr($text, 0, $i = $width - $currentLineLength)."\n"; - $text = substr($text, $i); - } else { - $prefix = ''; - } - - preg_match('~(\\n)$~', $text, $matches); - $text = $prefix.$this->addLineBreaks($text, $width); - $text = rtrim($text, "\n").($matches[1] ?? ''); - - if (!$currentLineLength && '' !== $current && !str_ends_with($current, "\n")) { - $text = "\n".$text; - } - - $lines = explode("\n", $text); - - foreach ($lines as $line) { - $currentLineLength += \strlen($line); - if ($width <= $currentLineLength) { - $currentLineLength = 0; - } - } - - if ($this->isDecorated()) { - foreach ($lines as $i => $line) { - $lines[$i] = $this->styleStack->getCurrent()->apply($line); - } - } - - return implode("\n", $lines); - } - - private function addLineBreaks(string $text, int $width): string - { - $encoding = mb_detect_encoding($text, null, true) ?: 'UTF-8'; - - return b($text)->toCodePointString($encoding)->wordwrap($width, "\n", true)->toByteString($encoding); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterInterface.php deleted file mode 100644 index 947347fa..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter interface for console output. - * - * @author Konstantin Kudryashov - */ -interface OutputFormatterInterface -{ - /** - * Sets the decorated flag. - */ - public function setDecorated(bool $decorated): void; - - /** - * Whether the output will decorate messages. - */ - public function isDecorated(): bool; - - /** - * Sets a new style. - */ - public function setStyle(string $name, OutputFormatterStyleInterface $style): void; - - /** - * Checks if output formatter has style with specified name. - */ - public function hasStyle(string $name): bool; - - /** - * Gets style options from style with specified name. - * - * @throws \InvalidArgumentException When style isn't defined - */ - public function getStyle(string $name): OutputFormatterStyleInterface; - - /** - * Formats a message according to the given styles. - */ - public function format(?string $message): ?string; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyle.php deleted file mode 100644 index 20a65b51..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Color; - -/** - * Formatter style class for defining styles. - * - * @author Konstantin Kudryashov - */ -class OutputFormatterStyle implements OutputFormatterStyleInterface -{ - private Color $color; - private string $foreground; - private string $background; - private array $options; - private ?string $href = null; - private bool $handlesHrefGracefully; - - /** - * Initializes output formatter style. - * - * @param string|null $foreground The style foreground color name - * @param string|null $background The style background color name - */ - public function __construct(?string $foreground = null, ?string $background = null, array $options = []) - { - $this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options); - } - - public function setForeground(?string $color): void - { - $this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options); - } - - public function setBackground(?string $color): void - { - $this->color = new Color($this->foreground, $this->background = $color ?: '', $this->options); - } - - public function setHref(string $url): void - { - $this->href = $url; - } - - public function setOption(string $option): void - { - $this->options[] = $option; - $this->color = new Color($this->foreground, $this->background, $this->options); - } - - public function unsetOption(string $option): void - { - $pos = array_search($option, $this->options); - if (false !== $pos) { - unset($this->options[$pos]); - } - - $this->color = new Color($this->foreground, $this->background, $this->options); - } - - public function setOptions(array $options): void - { - $this->color = new Color($this->foreground, $this->background, $this->options = $options); - } - - public function apply(string $text): string - { - $this->handlesHrefGracefully ??= 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100) - && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']); - - if (null !== $this->href && $this->handlesHrefGracefully) { - $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\"; - } - - return $this->color->apply($text); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php deleted file mode 100644 index 03741927..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter style interface for defining styles. - * - * @author Konstantin Kudryashov - */ -interface OutputFormatterStyleInterface -{ - /** - * Sets style foreground color. - */ - public function setForeground(?string $color): void; - - /** - * Sets style background color. - */ - public function setBackground(?string $color): void; - - /** - * Sets some specific style option. - */ - public function setOption(string $option): void; - - /** - * Unsets some specific style option. - */ - public function unsetOption(string $option): void; - - /** - * Sets multiple style options at once. - */ - public function setOptions(array $options): void; - - /** - * Applies the style to a given text. - */ - public function apply(string $text): string; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php deleted file mode 100644 index 4985213a..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Contracts\Service\ResetInterface; - -/** - * @author Jean-François Simon - */ -class OutputFormatterStyleStack implements ResetInterface -{ - /** - * @var OutputFormatterStyleInterface[] - */ - private array $styles = []; - - private OutputFormatterStyleInterface $emptyStyle; - - public function __construct(?OutputFormatterStyleInterface $emptyStyle = null) - { - $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle(); - $this->reset(); - } - - /** - * Resets stack (ie. empty internal arrays). - */ - public function reset(): void - { - $this->styles = []; - } - - /** - * Pushes a style in the stack. - */ - public function push(OutputFormatterStyleInterface $style): void - { - $this->styles[] = $style; - } - - /** - * Pops a style from the stack. - * - * @throws InvalidArgumentException When style tags incorrectly nested - */ - public function pop(?OutputFormatterStyleInterface $style = null): OutputFormatterStyleInterface - { - if (!$this->styles) { - return $this->emptyStyle; - } - - if (null === $style) { - return array_pop($this->styles); - } - - foreach (array_reverse($this->styles, true) as $index => $stackedStyle) { - if ($style->apply('') === $stackedStyle->apply('')) { - $this->styles = \array_slice($this->styles, 0, $index); - - return $stackedStyle; - } - } - - throw new InvalidArgumentException('Incorrectly nested style tag found.'); - } - - /** - * Computes current style with stacks top codes. - */ - public function getCurrent(): OutputFormatterStyleInterface - { - if (!$this->styles) { - return $this->emptyStyle; - } - - return $this->styles[\count($this->styles) - 1]; - } - - /** - * @return $this - */ - public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle): static - { - $this->emptyStyle = $emptyStyle; - - return $this; - } - - public function getEmptyStyle(): OutputFormatterStyleInterface - { - return $this->emptyStyle; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php deleted file mode 100644 index 412d9976..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter interface for console output that supports word wrapping. - * - * @author Roland Franssen - */ -interface WrappableOutputFormatterInterface extends OutputFormatterInterface -{ - /** - * Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping). - */ - public function formatAndWrap(?string $message, int $width): string; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/DebugFormatterHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/DebugFormatterHelper.php deleted file mode 100644 index dfdb8a82..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/DebugFormatterHelper.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Helps outputting debug information when running an external program from a command. - * - * An external program can be a Process, an HTTP request, or anything else. - * - * @author Fabien Potencier - */ -class DebugFormatterHelper extends Helper -{ - private const COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']; - private array $started = []; - private int $count = -1; - - /** - * Starts a debug formatting session. - */ - public function start(string $id, string $message, string $prefix = 'RUN'): string - { - $this->started[$id] = ['border' => ++$this->count % \count(self::COLORS)]; - - return \sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); - } - - /** - * Adds progress to a formatting session. - */ - public function progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR'): string - { - $message = ''; - - if ($error) { - if (isset($this->started[$id]['out'])) { - $message .= "\n"; - unset($this->started[$id]['out']); - } - if (!isset($this->started[$id]['err'])) { - $message .= \sprintf('%s %s ', $this->getBorder($id), $errorPrefix); - $this->started[$id]['err'] = true; - } - - $message .= str_replace("\n", \sprintf("\n%s %s ", $this->getBorder($id), $errorPrefix), $buffer); - } else { - if (isset($this->started[$id]['err'])) { - $message .= "\n"; - unset($this->started[$id]['err']); - } - if (!isset($this->started[$id]['out'])) { - $message .= \sprintf('%s %s ', $this->getBorder($id), $prefix); - $this->started[$id]['out'] = true; - } - - $message .= str_replace("\n", \sprintf("\n%s %s ", $this->getBorder($id), $prefix), $buffer); - } - - return $message; - } - - /** - * Stops a formatting session. - */ - public function stop(string $id, string $message, bool $successful, string $prefix = 'RES'): string - { - $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : ''; - - if ($successful) { - return \sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); - } - - $message = \sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); - - unset($this->started[$id]['out'], $this->started[$id]['err']); - - return $message; - } - - private function getBorder(string $id): string - { - return \sprintf(' ', self::COLORS[$this->started[$id]['border']]); - } - - public function getName(): string - { - return 'debug_formatter'; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/DescriptorHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/DescriptorHelper.php deleted file mode 100644 index 9422271f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/DescriptorHelper.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Descriptor\DescriptorInterface; -use Symfony\Component\Console\Descriptor\JsonDescriptor; -use Symfony\Component\Console\Descriptor\MarkdownDescriptor; -use Symfony\Component\Console\Descriptor\ReStructuredTextDescriptor; -use Symfony\Component\Console\Descriptor\TextDescriptor; -use Symfony\Component\Console\Descriptor\XmlDescriptor; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * This class adds helper method to describe objects in various formats. - * - * @author Jean-François Simon - */ -class DescriptorHelper extends Helper -{ - /** - * @var DescriptorInterface[] - */ - private array $descriptors = []; - - public function __construct() - { - $this - ->register('txt', new TextDescriptor()) - ->register('xml', new XmlDescriptor()) - ->register('json', new JsonDescriptor()) - ->register('md', new MarkdownDescriptor()) - ->register('rst', new ReStructuredTextDescriptor()) - ; - } - - /** - * Describes an object if supported. - * - * Available options are: - * * format: string, the output format name - * * raw_text: boolean, sets output type as raw - * - * @throws InvalidArgumentException when the given format is not supported - */ - public function describe(OutputInterface $output, ?object $object, array $options = []): void - { - $options = array_merge([ - 'raw_text' => false, - 'format' => 'txt', - ], $options); - - if (!isset($this->descriptors[$options['format']])) { - throw new InvalidArgumentException(\sprintf('Unsupported format "%s".', $options['format'])); - } - - $descriptor = $this->descriptors[$options['format']]; - $descriptor->describe($output, $object, $options); - } - - /** - * Registers a descriptor. - * - * @return $this - */ - public function register(string $format, DescriptorInterface $descriptor): static - { - $this->descriptors[$format] = $descriptor; - - return $this; - } - - public function getName(): string - { - return 'descriptor'; - } - - public function getFormats(): array - { - return array_keys($this->descriptors); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/Dumper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/Dumper.php deleted file mode 100644 index 0cd01e61..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/Dumper.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\VarDumper\Cloner\ClonerInterface; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -/** - * @author Roland Franssen - */ -final class Dumper -{ - private \Closure $handler; - - public function __construct( - private OutputInterface $output, - private ?CliDumper $dumper = null, - private ?ClonerInterface $cloner = null, - ) { - if (class_exists(CliDumper::class)) { - $this->handler = function ($var): string { - $dumper = $this->dumper ??= new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR); - $dumper->setColors($this->output->isDecorated()); - - return rtrim($dumper->dump(($this->cloner ??= new VarCloner())->cloneVar($var)->withRefHandles(false), true)); - }; - } else { - $this->handler = fn ($var): string => match (true) { - null === $var => 'null', - true === $var => 'true', - false === $var => 'false', - \is_string($var) => '"'.$var.'"', - default => rtrim(print_r($var, true)), - }; - } - } - - public function __invoke(mixed $var): string - { - return ($this->handler)($var); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/FormatterHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/FormatterHelper.php deleted file mode 100644 index 3646b3d6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/FormatterHelper.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * The Formatter class provides helpers to format messages. - * - * @author Fabien Potencier - */ -class FormatterHelper extends Helper -{ - /** - * Formats a message within a section. - */ - public function formatSection(string $section, string $message, string $style = 'info'): string - { - return \sprintf('<%s>[%s] %s', $style, $section, $style, $message); - } - - /** - * Formats a message as a block of text. - */ - public function formatBlock(string|array $messages, string $style, bool $large = false): string - { - if (!\is_array($messages)) { - $messages = [$messages]; - } - - $len = 0; - $lines = []; - foreach ($messages as $message) { - $message = OutputFormatter::escape($message); - $lines[] = \sprintf($large ? ' %s ' : ' %s ', $message); - $len = max(self::width($message) + ($large ? 4 : 2), $len); - } - - $messages = $large ? [str_repeat(' ', $len)] : []; - for ($i = 0; isset($lines[$i]); ++$i) { - $messages[] = $lines[$i].str_repeat(' ', $len - self::width($lines[$i])); - } - if ($large) { - $messages[] = str_repeat(' ', $len); - } - - for ($i = 0; isset($messages[$i]); ++$i) { - $messages[$i] = \sprintf('<%s>%s', $style, $messages[$i], $style); - } - - return implode("\n", $messages); - } - - /** - * Truncates a message to the given length. - */ - public function truncate(string $message, int $length, string $suffix = '...'): string - { - $computedLength = $length - self::width($suffix); - - if ($computedLength > self::width($message)) { - return $message; - } - - return self::substr($message, 0, $length).$suffix; - } - - public function getName(): string - { - return 'formatter'; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/Helper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/Helper.php deleted file mode 100644 index 3981bbf3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/Helper.php +++ /dev/null @@ -1,159 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\String\UnicodeString; - -/** - * Helper is the base class for all helper classes. - * - * @author Fabien Potencier - */ -abstract class Helper implements HelperInterface -{ - protected ?HelperSet $helperSet = null; - - public function setHelperSet(?HelperSet $helperSet): void - { - $this->helperSet = $helperSet; - } - - public function getHelperSet(): ?HelperSet - { - return $this->helperSet; - } - - /** - * Returns the width of a string, using mb_strwidth if it is available. - * The width is how many characters positions the string will use. - */ - public static function width(?string $string): int - { - $string ??= ''; - - if (preg_match('//u', $string)) { - return (new UnicodeString($string))->width(false); - } - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return \strlen($string); - } - - return mb_strwidth($string, $encoding); - } - - /** - * Returns the length of a string, using mb_strlen if it is available. - * The length is related to how many bytes the string will use. - */ - public static function length(?string $string): int - { - $string ??= ''; - - if (preg_match('//u', $string)) { - return (new UnicodeString($string))->length(); - } - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return \strlen($string); - } - - return mb_strlen($string, $encoding); - } - - /** - * Returns the subset of a string, using mb_substr if it is available. - */ - public static function substr(?string $string, int $from, ?int $length = null): string - { - $string ??= ''; - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return substr($string, $from, $length); - } - - return mb_substr($string, $from, $length, $encoding); - } - - public static function formatTime(int|float $secs, int $precision = 1): string - { - $secs = (int) floor($secs); - - if (0 === $secs) { - return '< 1 sec'; - } - - static $timeFormats = [ - [1, '1 sec', 'secs'], - [60, '1 min', 'mins'], - [3600, '1 hr', 'hrs'], - [86400, '1 day', 'days'], - ]; - - $times = []; - foreach ($timeFormats as $index => $format) { - $seconds = isset($timeFormats[$index + 1]) ? $secs % $timeFormats[$index + 1][0] : $secs; - - if (isset($times[$index - $precision])) { - unset($times[$index - $precision]); - } - - if (0 === $seconds) { - continue; - } - - $unitCount = ($seconds / $format[0]); - $times[$index] = 1 === $unitCount ? $format[1] : $unitCount.' '.$format[2]; - - if ($secs === $seconds) { - break; - } - - $secs -= $seconds; - } - - return implode(', ', array_reverse($times)); - } - - public static function formatMemory(int $memory): string - { - if ($memory >= 1024 * 1024 * 1024) { - return \sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024); - } - - if ($memory >= 1024 * 1024) { - return \sprintf('%.1f MiB', $memory / 1024 / 1024); - } - - if ($memory >= 1024) { - return \sprintf('%d KiB', $memory / 1024); - } - - return \sprintf('%d B', $memory); - } - - public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string): string - { - $isDecorated = $formatter->isDecorated(); - $formatter->setDecorated(false); - // remove <...> formatting - $string = $formatter->format($string ?? ''); - // remove already formatted characters - $string = preg_replace("/\033\[[^m]*m/", '', $string ?? ''); - // remove terminal hyperlinks - $string = preg_replace('/\\033]8;[^;]*;[^\\033]*\\033\\\\/', '', $string ?? ''); - $formatter->setDecorated($isDecorated); - - return $string; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperInterface.php deleted file mode 100644 index 8c4da3c9..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * HelperInterface is the interface all helpers must implement. - * - * @author Fabien Potencier - */ -interface HelperInterface -{ - /** - * Sets the helper set associated with this helper. - */ - public function setHelperSet(?HelperSet $helperSet): void; - - /** - * Gets the helper set associated with this helper. - */ - public function getHelperSet(): ?HelperSet; - - /** - * Returns the canonical name of this helper. - */ - public function getName(): string; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperSet.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperSet.php deleted file mode 100644 index ffe756c9..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/HelperSet.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * HelperSet represents a set of helpers to be used with a command. - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class HelperSet implements \IteratorAggregate -{ - /** @var array */ - private array $helpers = []; - - /** - * @param HelperInterface[] $helpers - */ - public function __construct(array $helpers = []) - { - foreach ($helpers as $alias => $helper) { - $this->set($helper, \is_int($alias) ? null : $alias); - } - } - - public function set(HelperInterface $helper, ?string $alias = null): void - { - $this->helpers[$helper->getName()] = $helper; - if (null !== $alias) { - $this->helpers[$alias] = $helper; - } - - $helper->setHelperSet($this); - } - - /** - * Returns true if the helper if defined. - */ - public function has(string $name): bool - { - return isset($this->helpers[$name]); - } - - /** - * Gets a helper value. - * - * @throws InvalidArgumentException if the helper is not defined - */ - public function get(string $name): HelperInterface - { - if (!$this->has($name)) { - throw new InvalidArgumentException(\sprintf('The helper "%s" is not defined.', $name)); - } - - return $this->helpers[$name]; - } - - public function getIterator(): \Traversable - { - return new \ArrayIterator($this->helpers); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/InputAwareHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/InputAwareHelper.php deleted file mode 100644 index 47126bda..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/InputAwareHelper.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Input\InputAwareInterface; -use Symfony\Component\Console\Input\InputInterface; - -/** - * An implementation of InputAwareInterface for Helpers. - * - * @author Wouter J - */ -abstract class InputAwareHelper extends Helper implements InputAwareInterface -{ - protected InputInterface $input; - - public function setInput(InputInterface $input): void - { - $this->input = $input; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/OutputWrapper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/OutputWrapper.php deleted file mode 100644 index a615ed2f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/OutputWrapper.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Simple output wrapper for "tagged outputs" instead of wordwrap(). This solution is based on a StackOverflow - * answer: https://stackoverflow.com/a/20434776/1476819 from user557597 (alias SLN). - * - * (?: - * # -- Words/Characters - * ( # (1 start) - * (?> # Atomic Group - Match words with valid breaks - * .{1,16} # 1-N characters - * # Followed by one of 4 prioritized, non-linebreak whitespace - * (?: # break types: - * (?<= [^\S\r\n] ) # 1. - Behind a non-linebreak whitespace - * [^\S\r\n]? # ( optionally accept an extra non-linebreak whitespace ) - * | (?= \r? \n ) # 2. - Ahead a linebreak - * | $ # 3. - EOS - * | [^\S\r\n] # 4. - Accept an extra non-linebreak whitespace - * ) - * ) # End atomic group - * | - * .{1,16} # No valid word breaks, just break on the N'th character - * ) # (1 end) - * (?: \r? \n )? # Optional linebreak after Words/Characters - * | - * # -- Or, Linebreak - * (?: \r? \n | $ ) # Stand alone linebreak or at EOS - * ) - * - * @author Krisztián Ferenczi - * - * @see https://stackoverflow.com/a/20434776/1476819 - */ -final class OutputWrapper -{ - private const TAG_OPEN_REGEX_SEGMENT = '[a-z](?:[^\\\\<>]*+ | \\\\.)*'; - private const TAG_CLOSE_REGEX_SEGMENT = '[a-z][^<>]*+'; - private const URL_PATTERN = 'https?://\S+'; - - public function __construct( - private bool $allowCutUrls = false, - ) { - } - - public function wrap(string $text, int $width, string $break = "\n"): string - { - if (!$width) { - return $text; - } - - $tagPattern = \sprintf('<(?:(?:%s)|/(?:%s)?)>', self::TAG_OPEN_REGEX_SEGMENT, self::TAG_CLOSE_REGEX_SEGMENT); - $limitPattern = "{1,$width}"; - $patternBlocks = [$tagPattern]; - if (!$this->allowCutUrls) { - $patternBlocks[] = self::URL_PATTERN; - } - $patternBlocks[] = '.'; - $blocks = implode('|', $patternBlocks); - $rowPattern = "(?:$blocks)$limitPattern"; - $pattern = \sprintf('#(?:((?>(%1$s)((?<=[^\S\r\n])[^\S\r\n]?|(?=\r?\n)|$|[^\S\r\n]))|(%1$s))(?:\r?\n)?|(?:\r?\n|$))#imux', $rowPattern); - $output = rtrim(preg_replace($pattern, '\\1'.$break, $text), $break); - - return str_replace(' '.$break, $break, $output); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProcessHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/ProcessHelper.php deleted file mode 100644 index 4a8cfc9d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProcessHelper.php +++ /dev/null @@ -1,137 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Process\Exception\ProcessFailedException; -use Symfony\Component\Process\Process; - -/** - * The ProcessHelper class provides helpers to run external processes. - * - * @author Fabien Potencier - * - * @final - */ -class ProcessHelper extends Helper -{ - /** - * Runs an external process. - * - * @param array|Process $cmd An instance of Process or an array of the command and arguments - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - */ - public function run(OutputInterface $output, array|Process $cmd, ?string $error = null, ?callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process - { - if (!class_exists(Process::class)) { - throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".'); - } - - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $formatter = $this->getHelperSet()->get('debug_formatter'); - - if ($cmd instanceof Process) { - $cmd = [$cmd]; - } - - if (\is_string($cmd[0] ?? null)) { - $process = new Process($cmd); - $cmd = []; - } elseif (($cmd[0] ?? null) instanceof Process) { - $process = $cmd[0]; - unset($cmd[0]); - } else { - throw new \InvalidArgumentException(\sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__)); - } - - if ($verbosity <= $output->getVerbosity()) { - $output->write($formatter->start(spl_object_hash($process), $this->escapeString($process->getCommandLine()))); - } - - if ($output->isDebug()) { - $callback = $this->wrapCallback($output, $process, $callback); - } - - $process->run($callback, $cmd); - - if ($verbosity <= $output->getVerbosity()) { - $message = $process->isSuccessful() ? 'Command ran successfully' : \sprintf('%s Command did not run successfully', $process->getExitCode()); - $output->write($formatter->stop(spl_object_hash($process), $message, $process->isSuccessful())); - } - - if (!$process->isSuccessful() && null !== $error) { - $output->writeln(\sprintf('%s', $this->escapeString($error))); - } - - return $process; - } - - /** - * Runs the process. - * - * This is identical to run() except that an exception is thrown if the process - * exits with a non-zero exit code. - * - * @param array|Process $cmd An instance of Process or a command to run - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @throws ProcessFailedException - * - * @see run() - */ - public function mustRun(OutputInterface $output, array|Process $cmd, ?string $error = null, ?callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process - { - $process = $this->run($output, $cmd, $error, $callback, $verbosity); - - if (!$process->isSuccessful()) { - throw new ProcessFailedException($process); - } - - return $process; - } - - /** - * Wraps a Process callback to add debugging output. - */ - public function wrapCallback(OutputInterface $output, Process $process, ?callable $callback = null): callable - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $formatter = $this->getHelperSet()->get('debug_formatter'); - - return function ($type, $buffer) use ($output, $process, $callback, $formatter) { - $output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type)); - - if (null !== $callback) { - $callback($type, $buffer); - } - }; - } - - private function escapeString(string $str): string - { - return str_replace('<', '\\<', $str); - } - - public function getName(): string - { - return 'process'; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressBar.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressBar.php deleted file mode 100644 index 49e34d8d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressBar.php +++ /dev/null @@ -1,645 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Cursor; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Terminal; - -/** - * The ProgressBar provides helpers to display progress output. - * - * @author Fabien Potencier - * @author Chris Jones - */ -final class ProgressBar -{ - public const FORMAT_VERBOSE = 'verbose'; - public const FORMAT_VERY_VERBOSE = 'very_verbose'; - public const FORMAT_DEBUG = 'debug'; - public const FORMAT_NORMAL = 'normal'; - - private const FORMAT_VERBOSE_NOMAX = 'verbose_nomax'; - private const FORMAT_VERY_VERBOSE_NOMAX = 'very_verbose_nomax'; - private const FORMAT_DEBUG_NOMAX = 'debug_nomax'; - private const FORMAT_NORMAL_NOMAX = 'normal_nomax'; - - private int $barWidth = 28; - private string $barChar; - private string $emptyBarChar = '-'; - private string $progressChar = '>'; - private ?string $format = null; - private ?string $internalFormat = null; - private ?int $redrawFreq = 1; - private int $writeCount = 0; - private float $lastWriteTime = 0; - private float $minSecondsBetweenRedraws = 0; - private float $maxSecondsBetweenRedraws = 1; - private OutputInterface $output; - private int $step = 0; - private int $startingStep = 0; - private ?int $max = null; - private int $startTime; - private int $stepWidth; - private float $percent = 0.0; - private array $messages = []; - private bool $overwrite = true; - private Terminal $terminal; - private ?string $previousMessage = null; - private Cursor $cursor; - private array $placeholders = []; - - private static array $formatters; - private static array $formats; - - /** - * @param int $max Maximum steps (0 if unknown) - */ - public function __construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 1 / 25) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $this->output = $output; - $this->setMaxSteps($max); - $this->terminal = new Terminal(); - - if (0 < $minSecondsBetweenRedraws) { - $this->redrawFreq = null; - $this->minSecondsBetweenRedraws = $minSecondsBetweenRedraws; - } - - if (!$this->output->isDecorated()) { - // disable overwrite when output does not support ANSI codes. - $this->overwrite = false; - - // set a reasonable redraw frequency so output isn't flooded - $this->redrawFreq = null; - } - - $this->startTime = time(); - $this->cursor = new Cursor($output); - } - - /** - * Sets a placeholder formatter for a given name, globally for all instances of ProgressBar. - * - * This method also allow you to override an existing placeholder. - * - * @param string $name The placeholder name (including the delimiter char like %) - * @param callable(ProgressBar):string $callable A PHP callable - */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void - { - self::$formatters ??= self::initPlaceholderFormatters(); - - self::$formatters[$name] = $callable; - } - - /** - * Gets the placeholder formatter for a given name. - * - * @param string $name The placeholder name (including the delimiter char like %) - */ - public static function getPlaceholderFormatterDefinition(string $name): ?callable - { - self::$formatters ??= self::initPlaceholderFormatters(); - - return self::$formatters[$name] ?? null; - } - - /** - * Sets a placeholder formatter for a given name, for this instance only. - * - * @param callable(ProgressBar):string $callable A PHP callable - */ - public function setPlaceholderFormatter(string $name, callable $callable): void - { - $this->placeholders[$name] = $callable; - } - - /** - * Gets the placeholder formatter for a given name. - * - * @param string $name The placeholder name (including the delimiter char like %) - */ - public function getPlaceholderFormatter(string $name): ?callable - { - return $this->placeholders[$name] ?? $this::getPlaceholderFormatterDefinition($name); - } - - /** - * Sets a format for a given name. - * - * This method also allow you to override an existing format. - * - * @param string $name The format name - * @param string $format A format string - */ - public static function setFormatDefinition(string $name, string $format): void - { - self::$formats ??= self::initFormats(); - - self::$formats[$name] = $format; - } - - /** - * Gets the format for a given name. - * - * @param string $name The format name - */ - public static function getFormatDefinition(string $name): ?string - { - self::$formats ??= self::initFormats(); - - return self::$formats[$name] ?? null; - } - - /** - * Associates a text with a named placeholder. - * - * The text is displayed when the progress bar is rendered but only - * when the corresponding placeholder is part of the custom format line - * (by wrapping the name with %). - * - * @param string $message The text to associate with the placeholder - * @param string $name The name of the placeholder - */ - public function setMessage(string $message, string $name = 'message'): void - { - $this->messages[$name] = $message; - } - - public function getMessage(string $name = 'message'): ?string - { - return $this->messages[$name] ?? null; - } - - public function getStartTime(): int - { - return $this->startTime; - } - - public function getMaxSteps(): int - { - return $this->max ?? 0; - } - - public function getProgress(): int - { - return $this->step; - } - - private function getStepWidth(): int - { - return $this->stepWidth; - } - - public function getProgressPercent(): float - { - return $this->percent; - } - - public function getBarOffset(): float - { - return floor(null !== $this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth); - } - - public function getEstimated(): float - { - if (0 === $this->step || $this->step === $this->startingStep) { - return 0; - } - - return round((time() - $this->startTime) / ($this->step - $this->startingStep) * $this->max); - } - - public function getRemaining(): float - { - if (0 === $this->step || $this->step === $this->startingStep) { - return 0; - } - - return round((time() - $this->startTime) / ($this->step - $this->startingStep) * ($this->max - $this->step)); - } - - public function setBarWidth(int $size): void - { - $this->barWidth = max(1, $size); - } - - public function getBarWidth(): int - { - return $this->barWidth; - } - - public function setBarCharacter(string $char): void - { - $this->barChar = $char; - } - - public function getBarCharacter(): string - { - return $this->barChar ?? (null !== $this->max ? '=' : $this->emptyBarChar); - } - - public function setEmptyBarCharacter(string $char): void - { - $this->emptyBarChar = $char; - } - - public function getEmptyBarCharacter(): string - { - return $this->emptyBarChar; - } - - public function setProgressCharacter(string $char): void - { - $this->progressChar = $char; - } - - public function getProgressCharacter(): string - { - return $this->progressChar; - } - - public function setFormat(string $format): void - { - $this->format = null; - $this->internalFormat = $format; - } - - /** - * Sets the redraw frequency. - * - * @param int|null $freq The frequency in steps - */ - public function setRedrawFrequency(?int $freq): void - { - $this->redrawFreq = null !== $freq ? max(1, $freq) : null; - } - - public function minSecondsBetweenRedraws(float $seconds): void - { - $this->minSecondsBetweenRedraws = $seconds; - } - - public function maxSecondsBetweenRedraws(float $seconds): void - { - $this->maxSecondsBetweenRedraws = $seconds; - } - - /** - * Returns an iterator that will automatically update the progress bar when iterated. - * - * @template TKey - * @template TValue - * - * @param iterable $iterable - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable - * - * @return iterable - */ - public function iterate(iterable $iterable, ?int $max = null): iterable - { - if (0 === $max) { - $max = null; - } - - $max ??= is_countable($iterable) ? \count($iterable) : null; - - if (0 === $max) { - $this->max = 0; - $this->stepWidth = 2; - $this->finish(); - - return; - } - - $this->start($max); - - foreach ($iterable as $key => $value) { - yield $key => $value; - - $this->advance(); - } - - $this->finish(); - } - - /** - * Starts the progress output. - * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged - * @param int $startAt The starting point of the bar (useful e.g. when resuming a previously started bar) - */ - public function start(?int $max = null, int $startAt = 0): void - { - $this->startTime = time(); - $this->step = $startAt; - $this->startingStep = $startAt; - - $startAt > 0 ? $this->setProgress($startAt) : $this->percent = 0.0; - - if (null !== $max) { - $this->setMaxSteps($max); - } - - $this->display(); - } - - /** - * Advances the progress output X steps. - * - * @param int $step Number of steps to advance - */ - public function advance(int $step = 1): void - { - $this->setProgress($this->step + $step); - } - - /** - * Sets whether to overwrite the progressbar, false for new line. - */ - public function setOverwrite(bool $overwrite): void - { - $this->overwrite = $overwrite; - } - - public function setProgress(int $step): void - { - if ($this->max && $step > $this->max) { - $this->max = $step; - } elseif ($step < 0) { - $step = 0; - } - - $redrawFreq = $this->redrawFreq ?? (($this->max ?? 10) / 10); - $prevPeriod = $redrawFreq ? (int) ($this->step / $redrawFreq) : 0; - $currPeriod = $redrawFreq ? (int) ($step / $redrawFreq) : 0; - $this->step = $step; - $this->percent = match ($this->max) { - null => 0, - 0 => 1, - default => (float) $this->step / $this->max, - }; - $timeInterval = microtime(true) - $this->lastWriteTime; - - // Draw regardless of other limits - if ($this->max === $step) { - $this->display(); - - return; - } - - // Throttling - if ($timeInterval < $this->minSecondsBetweenRedraws) { - return; - } - - // Draw each step period, but not too late - if ($prevPeriod !== $currPeriod || $timeInterval >= $this->maxSecondsBetweenRedraws) { - $this->display(); - } - } - - public function setMaxSteps(?int $max): void - { - if (0 === $max) { - $max = null; - } - - $this->format = null; - if (null === $max) { - $this->max = null; - $this->stepWidth = 4; - } else { - $this->max = max(0, $max); - $this->stepWidth = Helper::width((string) $this->max); - } - } - - /** - * Finishes the progress output. - */ - public function finish(): void - { - if (null === $this->max) { - $this->max = $this->step; - } - - if (($this->step === $this->max || null === $this->max) && !$this->overwrite) { - // prevent double 100% output - return; - } - - $this->setProgress($this->max ?? $this->step); - } - - /** - * Outputs the current progress string. - */ - public function display(): void - { - if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { - return; - } - - if (null === $this->format) { - $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); - } - - $this->overwrite($this->buildLine()); - } - - /** - * Removes the progress bar from the current line. - * - * This is useful if you wish to write some output - * while a progress bar is running. - * Call display() to show the progress bar again. - */ - public function clear(): void - { - if (!$this->overwrite) { - return; - } - - if (null === $this->format) { - $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); - } - - $this->overwrite(''); - } - - private function setRealFormat(string $format): void - { - // try to use the _nomax variant if available - if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) { - $this->format = self::getFormatDefinition($format.'_nomax'); - } elseif (null !== self::getFormatDefinition($format)) { - $this->format = self::getFormatDefinition($format); - } else { - $this->format = $format; - } - } - - /** - * Overwrites a previous message to the output. - */ - private function overwrite(string $message): void - { - if ($this->previousMessage === $message) { - return; - } - - $originalMessage = $message; - - if ($this->overwrite) { - if (null !== $this->previousMessage) { - if ($this->output instanceof ConsoleSectionOutput) { - $messageLines = explode("\n", $this->previousMessage); - $lineCount = \count($messageLines); - foreach ($messageLines as $messageLine) { - $messageLineLength = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $messageLine)); - if ($messageLineLength > $this->terminal->getWidth()) { - $lineCount += floor($messageLineLength / $this->terminal->getWidth()); - } - } - $this->output->clear($lineCount); - } else { - $lineCount = substr_count($this->previousMessage, "\n"); - for ($i = 0; $i < $lineCount; ++$i) { - $this->cursor->moveToColumn(1); - $this->cursor->clearLine(); - $this->cursor->moveUp(); - } - - $this->cursor->moveToColumn(1); - $this->cursor->clearLine(); - } - } - } elseif ($this->step > 0) { - $message = \PHP_EOL.$message; - } - - $this->previousMessage = $originalMessage; - $this->lastWriteTime = microtime(true); - - $this->output->write($message); - ++$this->writeCount; - } - - private function determineBestFormat(): string - { - return match ($this->output->getVerbosity()) { - // OutputInterface::VERBOSITY_QUIET: display is disabled anyway - OutputInterface::VERBOSITY_VERBOSE => $this->max ? self::FORMAT_VERBOSE : self::FORMAT_VERBOSE_NOMAX, - OutputInterface::VERBOSITY_VERY_VERBOSE => $this->max ? self::FORMAT_VERY_VERBOSE : self::FORMAT_VERY_VERBOSE_NOMAX, - OutputInterface::VERBOSITY_DEBUG => $this->max ? self::FORMAT_DEBUG : self::FORMAT_DEBUG_NOMAX, - default => $this->max ? self::FORMAT_NORMAL : self::FORMAT_NORMAL_NOMAX, - }; - } - - private static function initPlaceholderFormatters(): array - { - return [ - 'bar' => function (self $bar, OutputInterface $output) { - $completeBars = $bar->getBarOffset(); - $display = str_repeat($bar->getBarCharacter(), $completeBars); - if ($completeBars < $bar->getBarWidth()) { - $emptyBars = $bar->getBarWidth() - $completeBars - Helper::length(Helper::removeDecoration($output->getFormatter(), $bar->getProgressCharacter())); - $display .= $bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(), $emptyBars); - } - - return $display; - }, - 'elapsed' => fn (self $bar) => Helper::formatTime(time() - $bar->getStartTime(), 2), - 'remaining' => function (self $bar) { - if (null === $bar->getMaxSteps()) { - throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); - } - - return Helper::formatTime($bar->getRemaining(), 2); - }, - 'estimated' => function (self $bar) { - if (null === $bar->getMaxSteps()) { - throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); - } - - return Helper::formatTime($bar->getEstimated(), 2); - }, - 'memory' => fn (self $bar) => Helper::formatMemory(memory_get_usage(true)), - 'current' => fn (self $bar) => str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT), - 'max' => fn (self $bar) => $bar->getMaxSteps(), - 'percent' => fn (self $bar) => floor($bar->getProgressPercent() * 100), - ]; - } - - private static function initFormats(): array - { - return [ - self::FORMAT_NORMAL => ' %current%/%max% [%bar%] %percent:3s%%', - self::FORMAT_NORMAL_NOMAX => ' %current% [%bar%]', - - self::FORMAT_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%', - self::FORMAT_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', - - self::FORMAT_VERY_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%', - self::FORMAT_VERY_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', - - self::FORMAT_DEBUG => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%', - self::FORMAT_DEBUG_NOMAX => ' %current% [%bar%] %elapsed:6s% %memory:6s%', - ]; - } - - private function buildLine(): string - { - \assert(null !== $this->format); - - $regex = '{%([a-z\-_]+)(?:\:([^%]+))?%}i'; - $callback = function ($matches) { - if ($formatter = $this->getPlaceholderFormatter($matches[1])) { - $text = $formatter($this, $this->output); - } elseif (isset($this->messages[$matches[1]])) { - $text = $this->messages[$matches[1]]; - } else { - return $matches[0]; - } - - if (isset($matches[2])) { - $text = \sprintf('%'.$matches[2], $text); - } - - return $text; - }; - $line = preg_replace_callback($regex, $callback, $this->format); - - // gets string length for each sub line with multiline format - $linesLength = array_map(fn ($subLine) => Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))), explode("\n", $line)); - - $linesWidth = max($linesLength); - - $terminalWidth = $this->terminal->getWidth(); - if ($linesWidth <= $terminalWidth) { - return $line; - } - - $this->setBarWidth($this->barWidth - $linesWidth + $terminalWidth); - - return preg_replace_callback($regex, $callback, $this->format); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressIndicator.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressIndicator.php deleted file mode 100644 index b6bbd0cf..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/ProgressIndicator.php +++ /dev/null @@ -1,242 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Kevin Bond - */ -class ProgressIndicator -{ - private const FORMATS = [ - 'normal' => ' %indicator% %message%', - 'normal_no_ansi' => ' %message%', - - 'verbose' => ' %indicator% %message% (%elapsed:6s%)', - 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', - - 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', - 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)', - ]; - - private int $startTime; - private ?string $format = null; - private ?string $message = null; - private array $indicatorValues; - private int $indicatorCurrent; - private string $finishedIndicatorValue; - private float $indicatorUpdateTime; - private bool $started = false; - private bool $finished = false; - - /** - * @var array - */ - private static array $formatters; - - /** - * @param int $indicatorChangeInterval Change interval in milliseconds - * @param array|null $indicatorValues Animated indicator characters - */ - public function __construct( - private OutputInterface $output, - ?string $format = null, - private int $indicatorChangeInterval = 100, - ?array $indicatorValues = null, - ?string $finishedIndicatorValue = null, - ) { - $format ??= $this->determineBestFormat(); - $indicatorValues ??= ['-', '\\', '|', '/']; - $indicatorValues = array_values($indicatorValues); - $finishedIndicatorValue ??= '✔'; - - if (2 > \count($indicatorValues)) { - throw new InvalidArgumentException('Must have at least 2 indicator value characters.'); - } - - $this->format = self::getFormatDefinition($format); - $this->indicatorValues = $indicatorValues; - $this->finishedIndicatorValue = $finishedIndicatorValue; - $this->startTime = time(); - } - - /** - * Sets the current indicator message. - */ - public function setMessage(?string $message): void - { - $this->message = $message; - - $this->display(); - } - - /** - * Starts the indicator output. - */ - public function start(string $message): void - { - if ($this->started) { - throw new LogicException('Progress indicator already started.'); - } - - $this->message = $message; - $this->started = true; - $this->finished = false; - $this->startTime = time(); - $this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval; - $this->indicatorCurrent = 0; - - $this->display(); - } - - /** - * Advances the indicator. - */ - public function advance(): void - { - if (!$this->started) { - throw new LogicException('Progress indicator has not yet been started.'); - } - - if (!$this->output->isDecorated()) { - return; - } - - $currentTime = $this->getCurrentTimeInMilliseconds(); - - if ($currentTime < $this->indicatorUpdateTime) { - return; - } - - $this->indicatorUpdateTime = $currentTime + $this->indicatorChangeInterval; - ++$this->indicatorCurrent; - - $this->display(); - } - - /** - * Finish the indicator with message. - * - * @param ?string $finishedIndicator - */ - public function finish(string $message/* , ?string $finishedIndicator = null */): void - { - $finishedIndicator = 1 < \func_num_args() ? func_get_arg(1) : null; - if (null !== $finishedIndicator && !\is_string($finishedIndicator)) { - throw new \TypeError(\sprintf('Argument 2 passed to "%s()" must be of the type string or null, "%s" given.', __METHOD__, get_debug_type($finishedIndicator))); - } - - if (!$this->started) { - throw new LogicException('Progress indicator has not yet been started.'); - } - - if (null !== $finishedIndicator) { - $this->finishedIndicatorValue = $finishedIndicator; - } - - $this->finished = true; - $this->message = $message; - $this->display(); - $this->output->writeln(''); - $this->started = false; - } - - /** - * Gets the format for a given name. - */ - public static function getFormatDefinition(string $name): ?string - { - return self::FORMATS[$name] ?? null; - } - - /** - * Sets a placeholder formatter for a given name. - * - * This method also allow you to override an existing placeholder. - */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void - { - self::$formatters ??= self::initPlaceholderFormatters(); - - self::$formatters[$name] = $callable; - } - - /** - * Gets the placeholder formatter for a given name (including the delimiter char like %). - */ - public static function getPlaceholderFormatterDefinition(string $name): ?callable - { - self::$formatters ??= self::initPlaceholderFormatters(); - - return self::$formatters[$name] ?? null; - } - - private function display(): void - { - if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { - return; - } - - $this->overwrite(preg_replace_callback('{%([a-z\-_]+)(?:\:([^%]+))?%}i', function ($matches) { - if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) { - return $formatter($this); - } - - return $matches[0]; - }, $this->format ?? '')); - } - - private function determineBestFormat(): string - { - return match ($this->output->getVerbosity()) { - // OutputInterface::VERBOSITY_QUIET: display is disabled anyway - OutputInterface::VERBOSITY_VERBOSE => $this->output->isDecorated() ? 'verbose' : 'verbose_no_ansi', - OutputInterface::VERBOSITY_VERY_VERBOSE, - OutputInterface::VERBOSITY_DEBUG => $this->output->isDecorated() ? 'very_verbose' : 'very_verbose_no_ansi', - default => $this->output->isDecorated() ? 'normal' : 'normal_no_ansi', - }; - } - - /** - * Overwrites a previous message to the output. - */ - private function overwrite(string $message): void - { - if ($this->output->isDecorated()) { - $this->output->write("\x0D\x1B[2K"); - $this->output->write($message); - } else { - $this->output->writeln($message); - } - } - - private function getCurrentTimeInMilliseconds(): float - { - return round(microtime(true) * 1000); - } - - /** - * @return array - */ - private static function initPlaceholderFormatters(): array - { - return [ - 'indicator' => fn (self $indicator) => $indicator->finished ? $indicator->finishedIndicatorValue : $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)], - 'message' => fn (self $indicator) => $indicator->message, - 'elapsed' => fn (self $indicator) => Helper::formatTime(time() - $indicator->startTime, 2), - 'memory' => fn () => Helper::formatMemory(memory_get_usage(true)), - ]; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/QuestionHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/QuestionHelper.php deleted file mode 100644 index 69afc2a6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/QuestionHelper.php +++ /dev/null @@ -1,589 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Cursor; -use Symfony\Component\Console\Exception\MissingInputException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\StreamableInputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Terminal; - -use function Symfony\Component\String\s; - -/** - * The QuestionHelper class provides helpers to interact with the user. - * - * @author Fabien Potencier - */ -class QuestionHelper extends Helper -{ - private static bool $stty = true; - private static bool $stdinIsInteractive; - - /** - * Asks a question to the user. - * - * @return mixed The user answer - * - * @throws RuntimeException If there is no data to read in the input stream - */ - public function ask(InputInterface $input, OutputInterface $output, Question $question): mixed - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - if (!$input->isInteractive()) { - return $this->getDefaultAnswer($question); - } - - $inputStream = $input instanceof StreamableInputInterface ? $input->getStream() : null; - $inputStream ??= STDIN; - - try { - if (!$question->getValidator()) { - return $this->doAsk($inputStream, $output, $question); - } - - $interviewer = fn () => $this->doAsk($inputStream, $output, $question); - - return $this->validateAttempts($interviewer, $output, $question); - } catch (MissingInputException $exception) { - $input->setInteractive(false); - - if (null === $fallbackOutput = $this->getDefaultAnswer($question)) { - throw $exception; - } - - return $fallbackOutput; - } - } - - public function getName(): string - { - return 'question'; - } - - /** - * Prevents usage of stty. - */ - public static function disableStty(): void - { - self::$stty = false; - } - - /** - * Asks the question to the user. - * - * @param resource $inputStream - * - * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden - */ - private function doAsk($inputStream, OutputInterface $output, Question $question): mixed - { - $this->writePrompt($output, $question); - - $autocomplete = $question->getAutocompleterCallback(); - - if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) { - $ret = false; - if ($question->isHidden()) { - try { - $hiddenResponse = $this->getHiddenResponse($output, $inputStream, $question->isTrimmable()); - $ret = $question->isTrimmable() ? trim($hiddenResponse) : $hiddenResponse; - } catch (RuntimeException $e) { - if (!$question->isHiddenFallback()) { - throw $e; - } - } - } - - if (false === $ret) { - $isBlocked = stream_get_meta_data($inputStream)['blocked'] ?? true; - - if (!$isBlocked) { - stream_set_blocking($inputStream, true); - } - - $ret = $this->readInput($inputStream, $question); - - if (!$isBlocked) { - stream_set_blocking($inputStream, false); - } - - if (false === $ret) { - throw new MissingInputException('Aborted.'); - } - if ($question->isTrimmable()) { - $ret = trim($ret); - } - } - } else { - $autocomplete = $this->autocomplete($output, $question, $inputStream, $autocomplete); - $ret = $question->isTrimmable() ? trim($autocomplete) : $autocomplete; - } - - if ($output instanceof ConsoleSectionOutput) { - $output->addContent(''); // add EOL to the question - $output->addContent($ret); - } - - $ret = \strlen($ret) > 0 ? $ret : $question->getDefault(); - - if ($normalizer = $question->getNormalizer()) { - return $normalizer($ret); - } - - return $ret; - } - - private function getDefaultAnswer(Question $question): mixed - { - $default = $question->getDefault(); - - if (null === $default) { - return $default; - } - - if ($validator = $question->getValidator()) { - return \call_user_func($validator, $default); - } elseif ($question instanceof ChoiceQuestion) { - $choices = $question->getChoices(); - - if (!$question->isMultiselect()) { - return $choices[$default] ?? $default; - } - - $default = explode(',', $default); - foreach ($default as $k => $v) { - $v = $question->isTrimmable() ? trim($v) : $v; - $default[$k] = $choices[$v] ?? $v; - } - } - - return $default; - } - - /** - * Outputs the question prompt. - */ - protected function writePrompt(OutputInterface $output, Question $question): void - { - $message = $question->getQuestion(); - - if ($question instanceof ChoiceQuestion) { - $output->writeln(array_merge([ - $question->getQuestion(), - ], $this->formatChoiceQuestionChoices($question, 'info'))); - - $message = $question->getPrompt(); - } - - $output->write($message); - } - - /** - * @return string[] - */ - protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag): array - { - $messages = []; - - $maxWidth = max(array_map([__CLASS__, 'width'], array_keys($choices = $question->getChoices()))); - - foreach ($choices as $key => $value) { - $padding = str_repeat(' ', $maxWidth - self::width($key)); - - $messages[] = \sprintf(" [<$tag>%s$padding] %s", $key, $value); - } - - return $messages; - } - - /** - * Outputs an error message. - */ - protected function writeError(OutputInterface $output, \Exception $error): void - { - if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) { - $message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error'); - } else { - $message = ''.$error->getMessage().''; - } - - $output->writeln($message); - } - - /** - * Autocompletes a question. - * - * @param resource $inputStream - */ - private function autocomplete(OutputInterface $output, Question $question, $inputStream, callable $autocomplete): string - { - $cursor = new Cursor($output, $inputStream); - - $fullChoice = ''; - $ret = ''; - - $i = 0; - $ofs = -1; - $matches = $autocomplete($ret); - $numMatches = \count($matches); - - $sttyMode = shell_exec('stty -g'); - $isStdin = 'php://stdin' === (stream_get_meta_data($inputStream)['uri'] ?? null); - $r = [$inputStream]; - $w = []; - - // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead) - shell_exec('stty -icanon -echo'); - - // Add highlighted text style - $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white')); - - // Read a keypress - while (!feof($inputStream)) { - while ($isStdin && 0 === @stream_select($r, $w, $w, 0, 100)) { - // Give signal handlers a chance to run - $r = [$inputStream]; - } - $c = fread($inputStream, 1); - - // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false. - if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) { - shell_exec('stty '.$sttyMode); - throw new MissingInputException('Aborted.'); - } elseif ("\177" === $c) { // Backspace Character - if (0 === $numMatches && 0 !== $i) { - --$i; - $cursor->moveLeft(s($fullChoice)->slice(-1)->width(false)); - - $fullChoice = self::substr($fullChoice, 0, $i); - } - - if (0 === $i) { - $ofs = -1; - $matches = $autocomplete($ret); - $numMatches = \count($matches); - } else { - $numMatches = 0; - } - - // Pop the last character off the end of our string - $ret = self::substr($ret, 0, $i); - } elseif ("\033" === $c) { - // Did we read an escape sequence? - $c .= fread($inputStream, 2); - - // A = Up Arrow. B = Down Arrow - if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) { - if ('A' === $c[2] && -1 === $ofs) { - $ofs = 0; - } - - if (0 === $numMatches) { - continue; - } - - $ofs += ('A' === $c[2]) ? -1 : 1; - $ofs = ($numMatches + $ofs) % $numMatches; - } - } elseif (\ord($c) < 32) { - if ("\t" === $c || "\n" === $c) { - if ($numMatches > 0 && -1 !== $ofs) { - $ret = (string) $matches[$ofs]; - // Echo out remaining chars for current match - $remainingCharacters = substr($ret, \strlen(trim($this->mostRecentlyEnteredValue($fullChoice)))); - $output->write($remainingCharacters); - $fullChoice .= $remainingCharacters; - $i = (false === $encoding = mb_detect_encoding($fullChoice, null, true)) ? \strlen($fullChoice) : mb_strlen($fullChoice, $encoding); - - $matches = array_filter( - $autocomplete($ret), - fn ($match) => '' === $ret || str_starts_with($match, $ret) - ); - $numMatches = \count($matches); - $ofs = -1; - } - - if ("\n" === $c) { - $output->write($c); - break; - } - - $numMatches = 0; - } - - continue; - } else { - if ("\x80" <= $c) { - $c .= fread($inputStream, ["\xC0" => 1, "\xD0" => 1, "\xE0" => 2, "\xF0" => 3][$c & "\xF0"]); - } - - $output->write($c); - $ret .= $c; - $fullChoice .= $c; - ++$i; - - $tempRet = $ret; - - if ($question instanceof ChoiceQuestion && $question->isMultiselect()) { - $tempRet = $this->mostRecentlyEnteredValue($fullChoice); - } - - $numMatches = 0; - $ofs = 0; - - foreach ($autocomplete($ret) as $value) { - // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) - if (str_starts_with($value, $tempRet)) { - $matches[$numMatches++] = $value; - } - } - } - - $cursor->clearLineAfter(); - - if ($numMatches > 0 && -1 !== $ofs) { - $cursor->savePosition(); - // Write highlighted text, complete the partially entered response - $charactersEntered = \strlen(trim($this->mostRecentlyEnteredValue($fullChoice))); - $output->write(''.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $charactersEntered)).''); - $cursor->restorePosition(); - } - } - - // Reset stty so it behaves normally again - shell_exec('stty '.$sttyMode); - - return $fullChoice; - } - - private function mostRecentlyEnteredValue(string $entered): string - { - // Determine the most recent value that the user entered - if (!str_contains($entered, ',')) { - return $entered; - } - - $choices = explode(',', $entered); - if ('' !== $lastChoice = trim($choices[\count($choices) - 1])) { - return $lastChoice; - } - - return $entered; - } - - /** - * Gets a hidden response from user. - * - * @param resource $inputStream The handler resource - * @param bool $trimmable Is the answer trimmable - * - * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden - */ - private function getHiddenResponse(OutputInterface $output, $inputStream, bool $trimmable = true): string - { - if ('\\' === \DIRECTORY_SEPARATOR) { - $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; - - // handle code running from a phar - if (str_starts_with(__FILE__, 'phar:')) { - $tmpExe = sys_get_temp_dir().'/hiddeninput.exe'; - copy($exe, $tmpExe); - $exe = $tmpExe; - } - - $sExec = shell_exec('"'.$exe.'"'); - $value = $trimmable ? rtrim($sExec) : $sExec; - $output->writeln(''); - - if (isset($tmpExe)) { - unlink($tmpExe); - } - - return $value; - } - - if (self::$stty && Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); - shell_exec('stty -echo'); - } elseif ($this->isInteractiveInput($inputStream)) { - throw new RuntimeException('Unable to hide the response.'); - } - - $value = fgets($inputStream, 4096); - - if (4095 === \strlen($value)) { - $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output; - $errOutput->warning('The value was possibly truncated by your shell or terminal emulator'); - } - - if (self::$stty && Terminal::hasSttyAvailable()) { - shell_exec('stty '.$sttyMode); - } - - if (false === $value) { - throw new MissingInputException('Aborted.'); - } - if ($trimmable) { - $value = trim($value); - } - $output->writeln(''); - - return $value; - } - - /** - * Validates an attempt. - * - * @param callable $interviewer A callable that will ask for a question and return the result - * - * @throws \Exception In case the max number of attempts has been reached and no valid response has been given - */ - private function validateAttempts(callable $interviewer, OutputInterface $output, Question $question): mixed - { - $error = null; - $attempts = $question->getMaxAttempts(); - - while (null === $attempts || $attempts--) { - if (null !== $error) { - $this->writeError($output, $error); - } - - try { - return $question->getValidator()($interviewer()); - } catch (RuntimeException $e) { - throw $e; - } catch (\Exception $error) { - } - } - - throw $error; - } - - private function isInteractiveInput($inputStream): bool - { - if ('php://stdin' !== (stream_get_meta_data($inputStream)['uri'] ?? null)) { - return false; - } - - if (isset(self::$stdinIsInteractive)) { - return self::$stdinIsInteractive; - } - - return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); - } - - /** - * Reads one or more lines of input and returns what is read. - * - * @param resource $inputStream The handler resource - * @param Question $question The question being asked - */ - private function readInput($inputStream, Question $question): string|false - { - if (!$question->isMultiline()) { - $cp = $this->setIOCodepage(); - $ret = fgets($inputStream, 4096); - - return $this->resetIOCodepage($cp, $ret); - } - - $multiLineStreamReader = $this->cloneInputStream($inputStream); - if (null === $multiLineStreamReader) { - return false; - } - - $ret = ''; - $cp = $this->setIOCodepage(); - while (false !== ($char = fgetc($multiLineStreamReader))) { - if (\PHP_EOL === "{$ret}{$char}") { - break; - } - $ret .= $char; - } - - return $this->resetIOCodepage($cp, $ret); - } - - private function setIOCodepage(): int - { - if (\function_exists('sapi_windows_cp_set')) { - $cp = sapi_windows_cp_get(); - sapi_windows_cp_set(sapi_windows_cp_get('oem')); - - return $cp; - } - - return 0; - } - - /** - * Sets console I/O to the specified code page and converts the user input. - */ - private function resetIOCodepage(int $cp, string|false $input): string|false - { - if (0 !== $cp) { - sapi_windows_cp_set($cp); - - if (false !== $input && '' !== $input) { - $input = sapi_windows_cp_conv(sapi_windows_cp_get('oem'), $cp, $input); - } - } - - return $input; - } - - /** - * Clones an input stream in order to act on one instance of the same - * stream without affecting the other instance. - * - * @param resource $inputStream The handler resource - * - * @return resource|null The cloned resource, null in case it could not be cloned - */ - private function cloneInputStream($inputStream) - { - $streamMetaData = stream_get_meta_data($inputStream); - $seekable = $streamMetaData['seekable'] ?? false; - $mode = $streamMetaData['mode'] ?? 'rb'; - $uri = $streamMetaData['uri'] ?? null; - - if (null === $uri) { - return null; - } - - $cloneStream = fopen($uri, $mode); - - // For seekable and writable streams, add all the same data to the - // cloned stream and then seek to the same offset. - if (true === $seekable && !\in_array($mode, ['r', 'rb', 'rt'])) { - $offset = ftell($inputStream); - rewind($inputStream); - stream_copy_to_stream($inputStream, $cloneStream); - fseek($inputStream, $offset); - fseek($cloneStream, $offset); - } - - return $cloneStream; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/SymfonyQuestionHelper.php deleted file mode 100644 index b452bf04..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/SymfonyQuestionHelper.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Style\SymfonyStyle; - -/** - * Symfony Style Guide compliant question helper. - * - * @author Kevin Bond - */ -class SymfonyQuestionHelper extends QuestionHelper -{ - protected function writePrompt(OutputInterface $output, Question $question): void - { - $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); - $default = $question->getDefault(); - - if ($question->isMultiline()) { - $text .= \sprintf(' (press %s to continue)', $this->getEofShortcut()); - } - - switch (true) { - case null === $default: - $text = \sprintf(' %s:', $text); - - break; - - case $question instanceof ConfirmationQuestion: - $text = \sprintf(' %s (yes/no) [%s]:', $text, $default ? 'yes' : 'no'); - - break; - - case $question instanceof ChoiceQuestion && $question->isMultiselect(): - $choices = $question->getChoices(); - $default = explode(',', $default); - - foreach ($default as $key => $value) { - $default[$key] = $choices[trim($value)]; - } - - $text = \sprintf(' %s [%s]:', $text, OutputFormatter::escape(implode(', ', $default))); - - break; - - case $question instanceof ChoiceQuestion: - $choices = $question->getChoices(); - $text = \sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default] ?? $default)); - - break; - - default: - $text = \sprintf(' %s [%s]:', $text, OutputFormatter::escape($default)); - } - - $output->writeln($text); - - $prompt = ' > '; - - if ($question instanceof ChoiceQuestion) { - $output->writeln($this->formatChoiceQuestionChoices($question, 'comment')); - - $prompt = $question->getPrompt(); - } - - $output->write($prompt); - } - - protected function writeError(OutputInterface $output, \Exception $error): void - { - if ($output instanceof SymfonyStyle) { - $output->newLine(); - $output->error($error->getMessage()); - - return; - } - - parent::writeError($output, $error); - } - - private function getEofShortcut(): string - { - if ('Windows' === \PHP_OS_FAMILY) { - return 'Ctrl+Z then Enter'; - } - - return 'Ctrl+D'; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/Table.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/Table.php deleted file mode 100644 index 9ff73d2c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/Table.php +++ /dev/null @@ -1,924 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Provides helpers to display a table. - * - * @author Fabien Potencier - * @author Саша Стаменковић - * @author Abdellatif Ait boudad - * @author Max Grigorian - * @author Dany Maillard - */ -class Table -{ - private const SEPARATOR_TOP = 0; - private const SEPARATOR_TOP_BOTTOM = 1; - private const SEPARATOR_MID = 2; - private const SEPARATOR_BOTTOM = 3; - private const BORDER_OUTSIDE = 0; - private const BORDER_INSIDE = 1; - private const DISPLAY_ORIENTATION_DEFAULT = 'default'; - private const DISPLAY_ORIENTATION_HORIZONTAL = 'horizontal'; - private const DISPLAY_ORIENTATION_VERTICAL = 'vertical'; - - private ?string $headerTitle = null; - private ?string $footerTitle = null; - private array $headers = []; - private array $rows = []; - private array $effectiveColumnWidths = []; - private int $numberOfColumns; - private TableStyle $style; - private array $columnStyles = []; - private array $columnWidths = []; - private array $columnMaxWidths = []; - private bool $rendered = false; - private string $displayOrientation = self::DISPLAY_ORIENTATION_DEFAULT; - - private static array $styles; - - public function __construct( - private OutputInterface $output, - ) { - self::$styles ??= self::initStyles(); - - $this->setStyle('default'); - } - - /** - * Sets a style definition. - */ - public static function setStyleDefinition(string $name, TableStyle $style): void - { - self::$styles ??= self::initStyles(); - - self::$styles[$name] = $style; - } - - /** - * Gets a style definition by name. - */ - public static function getStyleDefinition(string $name): TableStyle - { - self::$styles ??= self::initStyles(); - - return self::$styles[$name] ?? throw new InvalidArgumentException(\sprintf('Style "%s" is not defined.', $name)); - } - - /** - * Sets table style. - * - * @return $this - */ - public function setStyle(TableStyle|string $name): static - { - $this->style = $this->resolveStyle($name); - - return $this; - } - - /** - * Gets the current table style. - */ - public function getStyle(): TableStyle - { - return $this->style; - } - - /** - * Sets table column style. - * - * @param TableStyle|string $name The style name or a TableStyle instance - * - * @return $this - */ - public function setColumnStyle(int $columnIndex, TableStyle|string $name): static - { - $this->columnStyles[$columnIndex] = $this->resolveStyle($name); - - return $this; - } - - /** - * Gets the current style for a column. - * - * If style was not set, it returns the global table style. - */ - public function getColumnStyle(int $columnIndex): TableStyle - { - return $this->columnStyles[$columnIndex] ?? $this->getStyle(); - } - - /** - * Sets the minimum width of a column. - * - * @return $this - */ - public function setColumnWidth(int $columnIndex, int $width): static - { - $this->columnWidths[$columnIndex] = $width; - - return $this; - } - - /** - * Sets the minimum width of all columns. - * - * @return $this - */ - public function setColumnWidths(array $widths): static - { - $this->columnWidths = []; - foreach ($widths as $index => $width) { - $this->setColumnWidth($index, $width); - } - - return $this; - } - - /** - * Sets the maximum width of a column. - * - * Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while - * formatted strings are preserved. - * - * @return $this - */ - public function setColumnMaxWidth(int $columnIndex, int $width): static - { - if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) { - throw new \LogicException(\sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output->getFormatter()))); - } - - $this->columnMaxWidths[$columnIndex] = $width; - - return $this; - } - - /** - * @return $this - */ - public function setHeaders(array $headers): static - { - $headers = array_values($headers); - if ($headers && !\is_array($headers[0])) { - $headers = [$headers]; - } - - $this->headers = $headers; - - return $this; - } - - /** - * @return $this - */ - public function setRows(array $rows): static - { - $this->rows = []; - - return $this->addRows($rows); - } - - /** - * @return $this - */ - public function addRows(array $rows): static - { - foreach ($rows as $row) { - $this->addRow($row); - } - - return $this; - } - - /** - * @return $this - */ - public function addRow(TableSeparator|array $row): static - { - if ($row instanceof TableSeparator) { - $this->rows[] = $row; - - return $this; - } - - $this->rows[] = array_values($row); - - return $this; - } - - /** - * Adds a row to the table, and re-renders the table. - * - * @return $this - */ - public function appendRow(TableSeparator|array $row): static - { - if (!$this->output instanceof ConsoleSectionOutput) { - throw new RuntimeException(\sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); - } - - if ($this->rendered) { - $this->output->clear($this->calculateRowCount()); - } - - $this->addRow($row); - $this->render(); - - return $this; - } - - /** - * @return $this - */ - public function setRow(int|string $column, array $row): static - { - $this->rows[$column] = $row; - - return $this; - } - - /** - * @return $this - */ - public function setHeaderTitle(?string $title): static - { - $this->headerTitle = $title; - - return $this; - } - - /** - * @return $this - */ - public function setFooterTitle(?string $title): static - { - $this->footerTitle = $title; - - return $this; - } - - /** - * @return $this - */ - public function setHorizontal(bool $horizontal = true): static - { - $this->displayOrientation = $horizontal ? self::DISPLAY_ORIENTATION_HORIZONTAL : self::DISPLAY_ORIENTATION_DEFAULT; - - return $this; - } - - /** - * @return $this - */ - public function setVertical(bool $vertical = true): static - { - $this->displayOrientation = $vertical ? self::DISPLAY_ORIENTATION_VERTICAL : self::DISPLAY_ORIENTATION_DEFAULT; - - return $this; - } - - /** - * Renders table to output. - * - * Example: - * - * +---------------+-----------------------+------------------+ - * | ISBN | Title | Author | - * +---------------+-----------------------+------------------+ - * | 99921-58-10-7 | Divine Comedy | Dante Alighieri | - * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | - * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | - * +---------------+-----------------------+------------------+ - */ - public function render(): void - { - $divider = new TableSeparator(); - $isCellWithColspan = static fn ($cell) => $cell instanceof TableCell && $cell->getColspan() >= 2; - - $horizontal = self::DISPLAY_ORIENTATION_HORIZONTAL === $this->displayOrientation; - $vertical = self::DISPLAY_ORIENTATION_VERTICAL === $this->displayOrientation; - - $rows = []; - if ($horizontal) { - foreach ($this->headers[0] ?? [] as $i => $header) { - $rows[$i] = [$header]; - foreach ($this->rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - if (isset($row[$i])) { - $rows[$i][] = $row[$i]; - } elseif ($isCellWithColspan($rows[$i][0])) { - // Noop, there is a "title" - } else { - $rows[$i][] = null; - } - } - } - } elseif ($vertical) { - $formatter = $this->output->getFormatter(); - $maxHeaderLength = array_reduce($this->headers[0] ?? [], static fn ($max, $header) => max($max, Helper::width(Helper::removeDecoration($formatter, $header))), 0); - - foreach ($this->rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - if ($rows) { - $rows[] = [$divider]; - } - - $containsColspan = false; - foreach ($row as $cell) { - if ($containsColspan = $isCellWithColspan($cell)) { - break; - } - } - - $headers = $this->headers[0] ?? []; - $maxRows = max(\count($headers), \count($row)); - for ($i = 0; $i < $maxRows; ++$i) { - $cell = (string) ($row[$i] ?? ''); - - $eol = str_contains($cell, "\r\n") ? "\r\n" : "\n"; - $parts = explode($eol, $cell); - foreach ($parts as $idx => $part) { - if ($headers && !$containsColspan) { - if (0 === $idx) { - $rows[] = [\sprintf( - '%s%s: %s', - str_repeat(' ', $maxHeaderLength - Helper::width(Helper::removeDecoration($formatter, $headers[$i] ?? ''))), - $headers[$i] ?? '', - $part - )]; - } else { - $rows[] = [\sprintf( - '%s %s', - str_pad('', $maxHeaderLength, ' ', \STR_PAD_LEFT), - $part - )]; - } - } elseif ('' !== $cell) { - $rows[] = [$part]; - } - } - } - } - } else { - $rows = array_merge($this->headers, [$divider], $this->rows); - } - - $this->calculateNumberOfColumns($rows); - - $rowGroups = $this->buildTableRows($rows); - $this->calculateColumnsWidth($rowGroups); - - $isHeader = !$horizontal; - $isFirstRow = $horizontal; - $hasTitle = (bool) $this->headerTitle; - - foreach ($rowGroups as $rowGroup) { - $isHeaderSeparatorRendered = false; - - foreach ($rowGroup as $row) { - if ($divider === $row) { - $isHeader = false; - $isFirstRow = true; - - continue; - } - - if ($row instanceof TableSeparator) { - $this->renderRowSeparator(); - - continue; - } - - if (!$row) { - continue; - } - - if ($isHeader && !$isHeaderSeparatorRendered) { - $this->renderRowSeparator( - self::SEPARATOR_TOP, - $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null - ); - $hasTitle = false; - $isHeaderSeparatorRendered = true; - } - - if ($isFirstRow) { - $this->renderRowSeparator( - $horizontal ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, - $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null - ); - $isFirstRow = false; - $hasTitle = false; - } - - if ($vertical) { - $isHeader = false; - $isFirstRow = false; - } - - if ($horizontal) { - $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat()); - } else { - $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat()); - } - } - } - $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat()); - - $this->cleanup(); - $this->rendered = true; - } - - /** - * Renders horizontal header separator. - * - * Example: - * - * +-----+-----------+-------+ - */ - private function renderRowSeparator(int $type = self::SEPARATOR_MID, ?string $title = null, ?string $titleFormat = null): void - { - if (!$count = $this->numberOfColumns) { - return; - } - - $borders = $this->style->getBorderChars(); - if (!$borders[0] && !$borders[2] && !$this->style->getCrossingChar()) { - return; - } - - $crossings = $this->style->getCrossingChars(); - if (self::SEPARATOR_MID === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[2], $crossings[8], $crossings[0], $crossings[4]]; - } elseif (self::SEPARATOR_TOP === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[1], $crossings[2], $crossings[3]]; - } elseif (self::SEPARATOR_TOP_BOTTOM === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[9], $crossings[10], $crossings[11]]; - } else { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[7], $crossings[6], $crossings[5]]; - } - - $markup = $leftChar; - for ($column = 0; $column < $count; ++$column) { - $markup .= str_repeat($horizontal, $this->effectiveColumnWidths[$column]); - $markup .= $column === $count - 1 ? $rightChar : $midChar; - } - - if (null !== $title) { - $titleLength = Helper::width(Helper::removeDecoration($formatter = $this->output->getFormatter(), $formattedTitle = \sprintf($titleFormat, $title))); - $markupLength = Helper::width($markup); - if ($titleLength > $limit = $markupLength - 4) { - $titleLength = $limit; - $formatLength = Helper::width(Helper::removeDecoration($formatter, \sprintf($titleFormat, ''))); - $formattedTitle = \sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); - } - - $titleStart = intdiv($markupLength - $titleLength, 2); - if (false === mb_detect_encoding($markup, null, true)) { - $markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength); - } else { - $markup = mb_substr($markup, 0, $titleStart).$formattedTitle.mb_substr($markup, $titleStart + $titleLength); - } - } - - $this->output->writeln(\sprintf($this->style->getBorderFormat(), $markup)); - } - - /** - * Renders vertical column separator. - */ - private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string - { - $borders = $this->style->getBorderChars(); - - return \sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]); - } - - /** - * Renders table row. - * - * Example: - * - * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | - */ - private function renderRow(array $row, string $cellFormat, ?string $firstCellFormat = null): void - { - $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE); - $columns = $this->getRowColumns($row); - $last = \count($columns) - 1; - foreach ($columns as $i => $column) { - if ($firstCellFormat && 0 === $i) { - $rowContent .= $this->renderCell($row, $column, $firstCellFormat); - } else { - $rowContent .= $this->renderCell($row, $column, $cellFormat); - } - $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE); - } - $this->output->writeln($rowContent); - } - - /** - * Renders table cell with padding. - */ - private function renderCell(array $row, int $column, string $cellFormat): string - { - $cell = $row[$column] ?? ''; - $width = $this->effectiveColumnWidths[$column]; - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - // add the width of the following columns(numbers of colspan). - foreach (range($column + 1, $column + $cell->getColspan() - 1) as $nextColumn) { - $width += $this->getColumnSeparatorWidth() + $this->effectiveColumnWidths[$nextColumn]; - } - } - - // str_pad won't work properly with multi-byte strings, we need to fix the padding - if (false !== $encoding = mb_detect_encoding($cell, null, true)) { - $width += \strlen($cell) - mb_strwidth($cell, $encoding); - } - - $style = $this->getColumnStyle($column); - - if ($cell instanceof TableSeparator) { - return \sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width)); - } - - $width += Helper::length($cell) - Helper::length(Helper::removeDecoration($this->output->getFormatter(), $cell)); - $content = \sprintf($style->getCellRowContentFormat(), $cell); - - $padType = $style->getPadType(); - if ($cell instanceof TableCell && $cell->getStyle() instanceof TableCellStyle) { - $isNotStyledByTag = !preg_match('/^<(\w+|(\w+=[\w,]+;?)*)>.+<\/(\w+|(\w+=\w+;?)*)?>$/', $cell); - if ($isNotStyledByTag) { - $cellFormat = $cell->getStyle()->getCellFormat(); - if (!\is_string($cellFormat)) { - $tag = http_build_query($cell->getStyle()->getTagOptions(), '', ';'); - $cellFormat = '<'.$tag.'>%s'; - } - - if (str_contains($content, '')) { - $content = str_replace('', '', $content); - $width -= 3; - } - if (str_contains($content, '')) { - $content = str_replace('', '', $content); - $width -= \strlen(''); - } - } - - $padType = $cell->getStyle()->getPadByAlign(); - } - - return \sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $padType)); - } - - /** - * Calculate number of columns for this table. - */ - private function calculateNumberOfColumns(array $rows): void - { - $columns = [0]; - foreach ($rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - $columns[] = $this->getNumberOfColumns($row); - } - - $this->numberOfColumns = max($columns); - } - - private function buildTableRows(array $rows): TableRows - { - /** @var WrappableOutputFormatterInterface $formatter */ - $formatter = $this->output->getFormatter(); - $unmergedRows = []; - for ($rowKey = 0; $rowKey < \count($rows); ++$rowKey) { - $rows = $this->fillNextRows($rows, $rowKey); - - // Remove any new line breaks and replace it with a new line - foreach ($rows[$rowKey] as $column => $cell) { - $colspan = $cell instanceof TableCell ? $cell->getColspan() : 1; - - if (isset($this->columnMaxWidths[$column]) && Helper::width(Helper::removeDecoration($formatter, $cell)) > $this->columnMaxWidths[$column]) { - $cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan); - } - if (!str_contains($cell ?? '', "\n")) { - continue; - } - $eol = str_contains($cell ?? '', "\r\n") ? "\r\n" : "\n"; - $escaped = implode($eol, array_map(OutputFormatter::escapeTrailingBackslash(...), explode($eol, $cell))); - $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; - $lines = explode($eol, str_replace($eol, ''.$eol, $cell)); - foreach ($lines as $lineKey => $line) { - if ($colspan > 1) { - $line = new TableCell($line, ['colspan' => $colspan]); - } - if (0 === $lineKey) { - $rows[$rowKey][$column] = $line; - } else { - if (!\array_key_exists($rowKey, $unmergedRows) || !\array_key_exists($lineKey, $unmergedRows[$rowKey])) { - $unmergedRows[$rowKey][$lineKey] = $this->copyRow($rows, $rowKey); - } - $unmergedRows[$rowKey][$lineKey][$column] = $line; - } - } - } - } - - return new TableRows(function () use ($rows, $unmergedRows): \Traversable { - foreach ($rows as $rowKey => $row) { - $rowGroup = [$row instanceof TableSeparator ? $row : $this->fillCells($row)]; - - if (isset($unmergedRows[$rowKey])) { - foreach ($unmergedRows[$rowKey] as $row) { - $rowGroup[] = $row instanceof TableSeparator ? $row : $this->fillCells($row); - } - } - yield $rowGroup; - } - }); - } - - private function calculateRowCount(): int - { - $numberOfRows = \count(iterator_to_array($this->buildTableRows(array_merge($this->headers, [new TableSeparator()], $this->rows)))); - - if ($this->headers) { - ++$numberOfRows; // Add row for header separator - } - - if ($this->rows) { - ++$numberOfRows; // Add row for footer separator - } - - return $numberOfRows; - } - - /** - * fill rows that contains rowspan > 1. - * - * @throws InvalidArgumentException - */ - private function fillNextRows(array $rows, int $line): array - { - $unmergedRows = []; - foreach ($rows[$line] as $column => $cell) { - if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !$cell instanceof \Stringable) { - throw new InvalidArgumentException(\sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); - } - if ($cell instanceof TableCell && $cell->getRowspan() > 1) { - $nbLines = $cell->getRowspan() - 1; - $lines = [$cell]; - if (str_contains($cell, "\n")) { - $eol = str_contains($cell, "\r\n") ? "\r\n" : "\n"; - $lines = explode($eol, str_replace($eol, ''.$eol.'', $cell)); - $nbLines = \count($lines) > $nbLines ? substr_count($cell, $eol) : $nbLines; - - $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); - unset($lines[0]); - } - - // create a two dimensional array (rowspan x colspan) - $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, []), $unmergedRows); - foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { - $value = $lines[$unmergedRowKey - $line] ?? ''; - $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); - if ($nbLines === $unmergedRowKey - $line) { - break; - } - } - } - } - - foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { - // we need to know if $unmergedRow will be merged or inserted into $rows - if (isset($rows[$unmergedRowKey]) && \is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRow) <= $this->numberOfColumns)) { - foreach ($unmergedRow as $cellKey => $cell) { - // insert cell into row at cellKey position - array_splice($rows[$unmergedRowKey], $cellKey, 0, [$cell]); - } - } else { - $row = $this->copyRow($rows, $unmergedRowKey - 1); - foreach ($unmergedRow as $column => $cell) { - if ($cell) { - $row[$column] = $cell; - } - } - array_splice($rows, $unmergedRowKey, 0, [$row]); - } - } - - return $rows; - } - - /** - * fill cells for a row that contains colspan > 1. - */ - private function fillCells(iterable $row): iterable - { - $newRow = []; - - foreach ($row as $column => $cell) { - $newRow[] = $cell; - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - foreach (range($column + 1, $column + $cell->getColspan() - 1) as $position) { - // insert empty value at column position - $newRow[] = ''; - } - } - } - - return $newRow ?: $row; - } - - private function copyRow(array $rows, int $line): array - { - $row = $rows[$line]; - foreach ($row as $cellKey => $cellValue) { - $row[$cellKey] = ''; - if ($cellValue instanceof TableCell) { - $row[$cellKey] = new TableCell('', ['colspan' => $cellValue->getColspan()]); - } - } - - return $row; - } - - /** - * Gets number of columns by row. - */ - private function getNumberOfColumns(array $row): int - { - $columns = \count($row); - foreach ($row as $column) { - $columns += $column instanceof TableCell ? ($column->getColspan() - 1) : 0; - } - - return $columns; - } - - /** - * Gets list of columns for the given row. - */ - private function getRowColumns(array $row): array - { - $columns = range(0, $this->numberOfColumns - 1); - foreach ($row as $cellKey => $cell) { - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - // exclude grouped columns. - $columns = array_diff($columns, range($cellKey + 1, $cellKey + $cell->getColspan() - 1)); - } - } - - return $columns; - } - - /** - * Calculates columns widths. - */ - private function calculateColumnsWidth(iterable $groups): void - { - for ($column = 0; $column < $this->numberOfColumns; ++$column) { - $lengths = []; - foreach ($groups as $group) { - foreach ($group as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - foreach ($row as $i => $cell) { - if ($cell instanceof TableCell) { - $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); - $textLength = Helper::width($textContent); - if ($textLength > 0) { - $contentColumns = mb_str_split($textContent, ceil($textLength / $cell->getColspan())); - foreach ($contentColumns as $position => $content) { - $row[$i + $position] = $content; - } - } - } - } - - $lengths[] = $this->getCellWidth($row, $column); - } - } - - $this->effectiveColumnWidths[$column] = max($lengths) + Helper::width($this->style->getCellRowContentFormat()) - 2; - } - } - - private function getColumnSeparatorWidth(): int - { - return Helper::width(\sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3])); - } - - private function getCellWidth(array $row, int $column): int - { - $cellWidth = 0; - - if (isset($row[$column])) { - $cell = $row[$column]; - $cellWidth = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $cell)); - } - - $columnWidth = $this->columnWidths[$column] ?? 0; - $cellWidth = max($cellWidth, $columnWidth); - - return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth; - } - - /** - * Called after rendering to cleanup cache data. - */ - private function cleanup(): void - { - $this->effectiveColumnWidths = []; - unset($this->numberOfColumns); - } - - /** - * @return array - */ - private static function initStyles(): array - { - $borderless = new TableStyle(); - $borderless - ->setHorizontalBorderChars('=') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') - ; - - $compact = new TableStyle(); - $compact - ->setHorizontalBorderChars('') - ->setVerticalBorderChars('') - ->setDefaultCrossingChar('') - ->setCellRowContentFormat('%s ') - ; - - $styleGuide = new TableStyle(); - $styleGuide - ->setHorizontalBorderChars('-') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') - ->setCellHeaderFormat('%s') - ; - - $box = (new TableStyle()) - ->setHorizontalBorderChars('─') - ->setVerticalBorderChars('│') - ->setCrossingChars('┼', '┌', '┬', '┐', '┤', '┘', '┴', '└', '├') - ; - - $boxDouble = (new TableStyle()) - ->setHorizontalBorderChars('═', '─') - ->setVerticalBorderChars('║', '│') - ->setCrossingChars('┼', '╔', '╤', '╗', '╢', '╝', '╧', '╚', '╟', '╠', '╪', '╣') - ; - - return [ - 'default' => new TableStyle(), - 'borderless' => $borderless, - 'compact' => $compact, - 'symfony-style-guide' => $styleGuide, - 'box' => $box, - 'box-double' => $boxDouble, - ]; - } - - private function resolveStyle(TableStyle|string $name): TableStyle - { - if ($name instanceof TableStyle) { - return $name; - } - - return self::$styles[$name] ?? throw new InvalidArgumentException(\sprintf('Style "%s" is not defined.', $name)); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCell.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCell.php deleted file mode 100644 index ab833920..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCell.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Abdellatif Ait boudad - */ -class TableCell -{ - private array $options = [ - 'rowspan' => 1, - 'colspan' => 1, - 'style' => null, - ]; - - public function __construct( - private string $value = '', - array $options = [], - ) { - // check option names - if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(\sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); - } - - if (isset($options['style']) && !$options['style'] instanceof TableCellStyle) { - throw new InvalidArgumentException('The style option must be an instance of "TableCellStyle".'); - } - - $this->options = array_merge($this->options, $options); - } - - /** - * Returns the cell value. - */ - public function __toString(): string - { - return $this->value; - } - - /** - * Gets number of colspan. - */ - public function getColspan(): int - { - return (int) $this->options['colspan']; - } - - /** - * Gets number of rowspan. - */ - public function getRowspan(): int - { - return (int) $this->options['rowspan']; - } - - public function getStyle(): ?TableCellStyle - { - return $this->options['style']; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCellStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCellStyle.php deleted file mode 100644 index af1a17e9..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableCellStyle.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Yewhen Khoptynskyi - */ -class TableCellStyle -{ - public const DEFAULT_ALIGN = 'left'; - - private const TAG_OPTIONS = [ - 'fg', - 'bg', - 'options', - ]; - - private const ALIGN_MAP = [ - 'left' => \STR_PAD_RIGHT, - 'center' => \STR_PAD_BOTH, - 'right' => \STR_PAD_LEFT, - ]; - - private array $options = [ - 'fg' => 'default', - 'bg' => 'default', - 'options' => null, - 'align' => self::DEFAULT_ALIGN, - 'cellFormat' => null, - ]; - - public function __construct(array $options = []) - { - if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(\sprintf('The TableCellStyle does not support the following options: \'%s\'.', implode('\', \'', $diff))); - } - - if (isset($options['align']) && !\array_key_exists($options['align'], self::ALIGN_MAP)) { - throw new InvalidArgumentException(\sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys(self::ALIGN_MAP)))); - } - - $this->options = array_merge($this->options, $options); - } - - public function getOptions(): array - { - return $this->options; - } - - /** - * Gets options we need for tag for example fg, bg. - * - * @return string[] - */ - public function getTagOptions(): array - { - return array_filter( - $this->getOptions(), - fn ($key) => \in_array($key, self::TAG_OPTIONS, true) && isset($this->options[$key]), - \ARRAY_FILTER_USE_KEY - ); - } - - public function getPadByAlign(): int - { - return self::ALIGN_MAP[$this->getOptions()['align']]; - } - - public function getCellFormat(): ?string - { - return $this->getOptions()['cellFormat']; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableRows.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableRows.php deleted file mode 100644 index fb2dc278..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableRows.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * @internal - */ -class TableRows implements \IteratorAggregate -{ - public function __construct( - private \Closure $generator, - ) { - } - - public function getIterator(): \Traversable - { - return ($this->generator)(); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableSeparator.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableSeparator.php deleted file mode 100644 index e541c531..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableSeparator.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Marks a row as being a separator. - * - * @author Fabien Potencier - */ -class TableSeparator extends TableCell -{ - public function __construct(array $options = []) - { - parent::__construct('', $options); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Helper/TableStyle.php deleted file mode 100644 index be956c10..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Helper/TableStyle.php +++ /dev/null @@ -1,362 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Defines the styles for a Table. - * - * @author Fabien Potencier - * @author Саша Стаменковић - * @author Dany Maillard - */ -class TableStyle -{ - private string $paddingChar = ' '; - private string $horizontalOutsideBorderChar = '-'; - private string $horizontalInsideBorderChar = '-'; - private string $verticalOutsideBorderChar = '|'; - private string $verticalInsideBorderChar = '|'; - private string $crossingChar = '+'; - private string $crossingTopRightChar = '+'; - private string $crossingTopMidChar = '+'; - private string $crossingTopLeftChar = '+'; - private string $crossingMidRightChar = '+'; - private string $crossingBottomRightChar = '+'; - private string $crossingBottomMidChar = '+'; - private string $crossingBottomLeftChar = '+'; - private string $crossingMidLeftChar = '+'; - private string $crossingTopLeftBottomChar = '+'; - private string $crossingTopMidBottomChar = '+'; - private string $crossingTopRightBottomChar = '+'; - private string $headerTitleFormat = ' %s '; - private string $footerTitleFormat = ' %s '; - private string $cellHeaderFormat = '%s'; - private string $cellRowFormat = '%s'; - private string $cellRowContentFormat = ' %s '; - private string $borderFormat = '%s'; - private int $padType = \STR_PAD_RIGHT; - - /** - * Sets padding character, used for cell padding. - * - * @return $this - */ - public function setPaddingChar(string $paddingChar): static - { - if (!$paddingChar) { - throw new LogicException('The padding char must not be empty.'); - } - - $this->paddingChar = $paddingChar; - - return $this; - } - - /** - * Gets padding character, used for cell padding. - */ - public function getPaddingChar(): string - { - return $this->paddingChar; - } - - /** - * Sets horizontal border characters. - * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * 1 ISBN 2 Title │ Author ║ - * ╠═══════════════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - * - * @return $this - */ - public function setHorizontalBorderChars(string $outside, ?string $inside = null): static - { - $this->horizontalOutsideBorderChar = $outside; - $this->horizontalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Sets vertical border characters. - * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * ║ ISBN │ Title │ Author ║ - * ╠═══════1═══════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ╟───────2───────┼──────────────────────────┼──────────────────╢ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - * - * @return $this - */ - public function setVerticalBorderChars(string $outside, ?string $inside = null): static - { - $this->verticalOutsideBorderChar = $outside; - $this->verticalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Gets border characters. - * - * @internal - */ - public function getBorderChars(): array - { - return [ - $this->horizontalOutsideBorderChar, - $this->verticalOutsideBorderChar, - $this->horizontalInsideBorderChar, - $this->verticalInsideBorderChar, - ]; - } - - /** - * Sets crossing characters. - * - * Example: - * - * 1═══════════════2══════════════════════════2══════════════════3 - * ║ ISBN │ Title │ Author ║ - * 8'══════════════0'═════════════════════════0'═════════════════4' - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * 8───────────────0──────────────────────────0──────────────────4 - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * 7═══════════════6══════════════════════════6══════════════════5 - * - * - * @param string $cross Crossing char (see #0 of example) - * @param string $topLeft Top left char (see #1 of example) - * @param string $topMid Top mid char (see #2 of example) - * @param string $topRight Top right char (see #3 of example) - * @param string $midRight Mid right char (see #4 of example) - * @param string $bottomRight Bottom right char (see #5 of example) - * @param string $bottomMid Bottom mid char (see #6 of example) - * @param string $bottomLeft Bottom left char (see #7 of example) - * @param string $midLeft Mid left char (see #8 of example) - * @param string|null $topLeftBottom Top left bottom char (see #8' of example), equals to $midLeft if null - * @param string|null $topMidBottom Top mid bottom char (see #0' of example), equals to $cross if null - * @param string|null $topRightBottom Top right bottom char (see #4' of example), equals to $midRight if null - * - * @return $this - */ - public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, ?string $topLeftBottom = null, ?string $topMidBottom = null, ?string $topRightBottom = null): static - { - $this->crossingChar = $cross; - $this->crossingTopLeftChar = $topLeft; - $this->crossingTopMidChar = $topMid; - $this->crossingTopRightChar = $topRight; - $this->crossingMidRightChar = $midRight; - $this->crossingBottomRightChar = $bottomRight; - $this->crossingBottomMidChar = $bottomMid; - $this->crossingBottomLeftChar = $bottomLeft; - $this->crossingMidLeftChar = $midLeft; - $this->crossingTopLeftBottomChar = $topLeftBottom ?? $midLeft; - $this->crossingTopMidBottomChar = $topMidBottom ?? $cross; - $this->crossingTopRightBottomChar = $topRightBottom ?? $midRight; - - return $this; - } - - /** - * Sets default crossing character used for each cross. - * - * @see {@link setCrossingChars()} for setting each crossing individually. - */ - public function setDefaultCrossingChar(string $char): self - { - return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char); - } - - /** - * Gets crossing character. - */ - public function getCrossingChar(): string - { - return $this->crossingChar; - } - - /** - * Gets crossing characters. - * - * @internal - */ - public function getCrossingChars(): array - { - return [ - $this->crossingChar, - $this->crossingTopLeftChar, - $this->crossingTopMidChar, - $this->crossingTopRightChar, - $this->crossingMidRightChar, - $this->crossingBottomRightChar, - $this->crossingBottomMidChar, - $this->crossingBottomLeftChar, - $this->crossingMidLeftChar, - $this->crossingTopLeftBottomChar, - $this->crossingTopMidBottomChar, - $this->crossingTopRightBottomChar, - ]; - } - - /** - * Sets header cell format. - * - * @return $this - */ - public function setCellHeaderFormat(string $cellHeaderFormat): static - { - $this->cellHeaderFormat = $cellHeaderFormat; - - return $this; - } - - /** - * Gets header cell format. - */ - public function getCellHeaderFormat(): string - { - return $this->cellHeaderFormat; - } - - /** - * Sets row cell format. - * - * @return $this - */ - public function setCellRowFormat(string $cellRowFormat): static - { - $this->cellRowFormat = $cellRowFormat; - - return $this; - } - - /** - * Gets row cell format. - */ - public function getCellRowFormat(): string - { - return $this->cellRowFormat; - } - - /** - * Sets row cell content format. - * - * @return $this - */ - public function setCellRowContentFormat(string $cellRowContentFormat): static - { - $this->cellRowContentFormat = $cellRowContentFormat; - - return $this; - } - - /** - * Gets row cell content format. - */ - public function getCellRowContentFormat(): string - { - return $this->cellRowContentFormat; - } - - /** - * Sets table border format. - * - * @return $this - */ - public function setBorderFormat(string $borderFormat): static - { - $this->borderFormat = $borderFormat; - - return $this; - } - - /** - * Gets table border format. - */ - public function getBorderFormat(): string - { - return $this->borderFormat; - } - - /** - * Sets cell padding type. - * - * @return $this - */ - public function setPadType(int $padType): static - { - if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) { - throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).'); - } - - $this->padType = $padType; - - return $this; - } - - /** - * Gets cell padding type. - */ - public function getPadType(): int - { - return $this->padType; - } - - public function getHeaderTitleFormat(): string - { - return $this->headerTitleFormat; - } - - /** - * @return $this - */ - public function setHeaderTitleFormat(string $format): static - { - $this->headerTitleFormat = $format; - - return $this; - } - - public function getFooterTitleFormat(): string - { - return $this->footerTitleFormat; - } - - /** - * @return $this - */ - public function setFooterTitleFormat(string $format): static - { - $this->footerTitleFormat = $format; - - return $this; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/ArgvInput.php b/tools/php-cs-fixer/vendor/symfony/console/Input/ArgvInput.php deleted file mode 100644 index fe25b861..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/ArgvInput.php +++ /dev/null @@ -1,402 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * ArgvInput represents an input coming from the CLI arguments. - * - * Usage: - * - * $input = new ArgvInput(); - * - * By default, the `$_SERVER['argv']` array is used for the input values. - * - * This can be overridden by explicitly passing the input values in the constructor: - * - * $input = new ArgvInput($_SERVER['argv']); - * - * If you pass it yourself, don't forget that the first element of the array - * is the name of the running application. - * - * When passing an argument to the constructor, be sure that it respects - * the same rules as the argv one. It's almost always better to use the - * `StringInput` when you want to provide your own input. - * - * @author Fabien Potencier - * - * @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html - * @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 - */ -class ArgvInput extends Input -{ - /** @var list */ - private array $tokens; - private array $parsed; - - /** @param list|null $argv */ - public function __construct(?array $argv = null, ?InputDefinition $definition = null) - { - $argv ??= $_SERVER['argv'] ?? []; - - foreach ($argv as $arg) { - if (!\is_scalar($arg) && !$arg instanceof \Stringable) { - throw new RuntimeException(\sprintf('Argument values expected to be all scalars, got "%s".', get_debug_type($arg))); - } - } - - // strip the application name - array_shift($argv); - - $this->tokens = $argv; - - parent::__construct($definition); - } - - /** @param list $tokens */ - protected function setTokens(array $tokens): void - { - $this->tokens = $tokens; - } - - protected function parse(): void - { - $parseOptions = true; - $this->parsed = $this->tokens; - while (null !== $token = array_shift($this->parsed)) { - $parseOptions = $this->parseToken($token, $parseOptions); - } - } - - protected function parseToken(string $token, bool $parseOptions): bool - { - if ($parseOptions && '' == $token) { - $this->parseArgument($token); - } elseif ($parseOptions && '--' == $token) { - return false; - } elseif ($parseOptions && str_starts_with($token, '--')) { - $this->parseLongOption($token); - } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { - $this->parseShortOption($token); - } else { - $this->parseArgument($token); - } - - return $parseOptions; - } - - /** - * Parses a short option. - */ - private function parseShortOption(string $token): void - { - $name = substr($token, 1); - - if (\strlen($name) > 1) { - if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) { - // an option with a value (with no space) - $this->addShortOption($name[0], substr($name, 1)); - } else { - $this->parseShortOptionSet($name); - } - } else { - $this->addShortOption($name, null); - } - } - - /** - * Parses a short option set. - * - * @throws RuntimeException When option given doesn't exist - */ - private function parseShortOptionSet(string $name): void - { - $len = \strlen($name); - for ($i = 0; $i < $len; ++$i) { - if (!$this->definition->hasShortcut($name[$i])) { - $encoding = mb_detect_encoding($name, null, true); - throw new RuntimeException(\sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding))); - } - - $option = $this->definition->getOptionForShortcut($name[$i]); - if ($option->acceptValue()) { - $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); - - break; - } - - $this->addLongOption($option->getName(), null); - } - } - - /** - * Parses a long option. - */ - private function parseLongOption(string $token): void - { - $name = substr($token, 2); - - if (false !== $pos = strpos($name, '=')) { - if ('' === $value = substr($name, $pos + 1)) { - array_unshift($this->parsed, $value); - } - $this->addLongOption(substr($name, 0, $pos), $value); - } else { - $this->addLongOption($name, null); - } - } - - /** - * Parses an argument. - * - * @throws RuntimeException When too many arguments are given - */ - private function parseArgument(string $token): void - { - $c = \count($this->arguments); - - // if input is expecting another argument, add it - if ($this->definition->hasArgument($c)) { - $arg = $this->definition->getArgument($c); - $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token; - - // if last argument isArray(), append token to last argument - } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { - $arg = $this->definition->getArgument($c - 1); - $this->arguments[$arg->getName()][] = $token; - - // unexpected argument - } else { - $all = $this->definition->getArguments(); - $symfonyCommandName = null; - if (($inputArgument = $all[$key = array_key_first($all)] ?? null) && 'command' === $inputArgument->getName()) { - $symfonyCommandName = $this->arguments['command'] ?? null; - unset($all[$key]); - } - - if (\count($all)) { - if ($symfonyCommandName) { - $message = \sprintf('Too many arguments to "%s" command, expected arguments "%s".', $symfonyCommandName, implode('" "', array_keys($all))); - } else { - $message = \sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))); - } - } elseif ($symfonyCommandName) { - $message = \sprintf('No arguments expected for "%s" command, got "%s".', $symfonyCommandName, $token); - } else { - $message = \sprintf('No arguments expected, got "%s".', $token); - } - - throw new RuntimeException($message); - } - } - - /** - * Adds a short option value. - * - * @throws RuntimeException When option given doesn't exist - */ - private function addShortOption(string $shortcut, mixed $value): void - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new RuntimeException(\sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @throws RuntimeException When option given doesn't exist - */ - private function addLongOption(string $name, mixed $value): void - { - if (!$this->definition->hasOption($name)) { - if (!$this->definition->hasNegation($name)) { - throw new RuntimeException(\sprintf('The "--%s" option does not exist.', $name)); - } - - $optionName = $this->definition->negationToName($name); - if (null !== $value) { - throw new RuntimeException(\sprintf('The "--%s" option does not accept a value.', $name)); - } - $this->options[$optionName] = false; - - return; - } - - $option = $this->definition->getOption($name); - - if (null !== $value && !$option->acceptValue()) { - throw new RuntimeException(\sprintf('The "--%s" option does not accept a value.', $name)); - } - - if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) { - // if option accepts an optional or mandatory argument - // let's see if there is one provided - $next = array_shift($this->parsed); - if ((isset($next[0]) && '-' !== $next[0]) || \in_array($next, ['', null], true)) { - $value = $next; - } else { - array_unshift($this->parsed, $next); - } - } - - if (null === $value) { - if ($option->isValueRequired()) { - throw new RuntimeException(\sprintf('The "--%s" option requires a value.', $name)); - } - - if (!$option->isArray() && !$option->isValueOptional()) { - $value = true; - } - } - - if ($option->isArray()) { - $this->options[$name][] = $value; - } else { - $this->options[$name] = $value; - } - } - - public function getFirstArgument(): ?string - { - $isOption = false; - foreach ($this->tokens as $i => $token) { - if ($token && '-' === $token[0]) { - if (str_contains($token, '=') || !isset($this->tokens[$i + 1])) { - continue; - } - - // If it's a long option, consider that everything after "--" is the option name. - // Otherwise, use the last char (if it's a short option set, only the last one can take a value with space separator) - $name = '-' === $token[1] ? substr($token, 2) : substr($token, -1); - if (!isset($this->options[$name]) && !$this->definition->hasShortcut($name)) { - // noop - } elseif ((isset($this->options[$name]) || isset($this->options[$name = $this->definition->shortcutToName($name)])) && $this->tokens[$i + 1] === $this->options[$name]) { - $isOption = true; - } - - continue; - } - - if ($isOption) { - $isOption = false; - continue; - } - - return $token; - } - - return null; - } - - public function hasParameterOption(string|array $values, bool $onlyParams = false): bool - { - $values = (array) $values; - - foreach ($this->tokens as $token) { - if ($onlyParams && '--' === $token) { - return false; - } - foreach ($values as $value) { - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ($token === $value || '' !== $leading && str_starts_with($token, $leading)) { - return true; - } - } - } - - return false; - } - - public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed - { - $values = (array) $values; - $tokens = $this->tokens; - - while (0 < \count($tokens)) { - $token = array_shift($tokens); - if ($onlyParams && '--' === $token) { - return $default; - } - - foreach ($values as $value) { - if ($token === $value) { - return array_shift($tokens); - } - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ('' !== $leading && str_starts_with($token, $leading)) { - return substr($token, \strlen($leading)); - } - } - } - - return $default; - } - - /** - * Returns un-parsed and not validated tokens. - * - * @param bool $strip Whether to return the raw parameters (false) or the values after the command name (true) - * - * @return list - */ - public function getRawTokens(bool $strip = false): array - { - if (!$strip) { - return $this->tokens; - } - - $parameters = []; - $keep = false; - foreach ($this->tokens as $value) { - if (!$keep && $value === $this->getFirstArgument()) { - $keep = true; - - continue; - } - if ($keep) { - $parameters[] = $value; - } - } - - return $parameters; - } - - /** - * Returns a stringified representation of the args passed to the command. - */ - public function __toString(): string - { - $tokens = array_map(function ($token) { - if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { - return $match[1].$this->escapeToken($match[2]); - } - - if ($token && '-' !== $token[0]) { - return $this->escapeToken($token); - } - - return $token; - }, $this->tokens); - - return implode(' ', $tokens); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/ArrayInput.php b/tools/php-cs-fixer/vendor/symfony/console/Input/ArrayInput.php deleted file mode 100644 index 7335632b..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/ArrayInput.php +++ /dev/null @@ -1,191 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\InvalidOptionException; - -/** - * ArrayInput represents an input provided as an array. - * - * Usage: - * - * $input = new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']); - * - * @author Fabien Potencier - */ -class ArrayInput extends Input -{ - public function __construct( - private array $parameters, - ?InputDefinition $definition = null, - ) { - parent::__construct($definition); - } - - public function getFirstArgument(): ?string - { - foreach ($this->parameters as $param => $value) { - if ($param && \is_string($param) && '-' === $param[0]) { - continue; - } - - return $value; - } - - return null; - } - - public function hasParameterOption(string|array $values, bool $onlyParams = false): bool - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if (!\is_int($k)) { - $v = $k; - } - - if ($onlyParams && '--' === $v) { - return false; - } - - if (\in_array($v, $values)) { - return true; - } - } - - return false; - } - - public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if ($onlyParams && ('--' === $k || (\is_int($k) && '--' === $v))) { - return $default; - } - - if (\is_int($k)) { - if (\in_array($v, $values)) { - return true; - } - } elseif (\in_array($k, $values)) { - return $v; - } - } - - return $default; - } - - /** - * Returns a stringified representation of the args passed to the command. - */ - public function __toString(): string - { - $params = []; - foreach ($this->parameters as $param => $val) { - if ($param && \is_string($param) && '-' === $param[0]) { - $glue = ('-' === $param[1]) ? '=' : ' '; - if (\is_array($val)) { - foreach ($val as $v) { - $params[] = $param.('' != $v ? $glue.$this->escapeToken($v) : ''); - } - } else { - $params[] = $param.('' != $val ? $glue.$this->escapeToken($val) : ''); - } - } else { - $params[] = \is_array($val) ? implode(' ', array_map($this->escapeToken(...), $val)) : $this->escapeToken($val); - } - } - - return implode(' ', $params); - } - - protected function parse(): void - { - foreach ($this->parameters as $key => $value) { - if ('--' === $key) { - return; - } - if (str_starts_with($key, '--')) { - $this->addLongOption(substr($key, 2), $value); - } elseif (str_starts_with($key, '-')) { - $this->addShortOption(substr($key, 1), $value); - } else { - $this->addArgument($key, $value); - } - } - } - - /** - * Adds a short option value. - * - * @throws InvalidOptionException When option given doesn't exist - */ - private function addShortOption(string $shortcut, mixed $value): void - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new InvalidOptionException(\sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @throws InvalidOptionException When option given doesn't exist - * @throws InvalidOptionException When a required value is missing - */ - private function addLongOption(string $name, mixed $value): void - { - if (!$this->definition->hasOption($name)) { - if (!$this->definition->hasNegation($name)) { - throw new InvalidOptionException(\sprintf('The "--%s" option does not exist.', $name)); - } - - $optionName = $this->definition->negationToName($name); - $this->options[$optionName] = false; - - return; - } - - $option = $this->definition->getOption($name); - - if (null === $value) { - if ($option->isValueRequired()) { - throw new InvalidOptionException(\sprintf('The "--%s" option requires a value.', $name)); - } - - if (!$option->isValueOptional()) { - $value = true; - } - } - - $this->options[$name] = $value; - } - - /** - * Adds an argument value. - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - private function addArgument(string|int $name, mixed $value): void - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/Input.php b/tools/php-cs-fixer/vendor/symfony/console/Input/Input.php deleted file mode 100644 index d2881c60..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/Input.php +++ /dev/null @@ -1,174 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * Input is the base class for all concrete Input classes. - * - * Three concrete classes are provided by default: - * - * * `ArgvInput`: The input comes from the CLI arguments (argv) - * * `StringInput`: The input is provided as a string - * * `ArrayInput`: The input is provided as an array - * - * @author Fabien Potencier - */ -abstract class Input implements InputInterface, StreamableInputInterface -{ - protected InputDefinition $definition; - /** @var resource */ - protected $stream; - protected array $options = []; - protected array $arguments = []; - protected bool $interactive = true; - - public function __construct(?InputDefinition $definition = null) - { - if (null === $definition) { - $this->definition = new InputDefinition(); - } else { - $this->bind($definition); - $this->validate(); - } - } - - public function bind(InputDefinition $definition): void - { - $this->arguments = []; - $this->options = []; - $this->definition = $definition; - - $this->parse(); - } - - /** - * Processes command line arguments. - */ - abstract protected function parse(): void; - - public function validate(): void - { - $definition = $this->definition; - $givenArguments = $this->arguments; - - $missingArguments = array_filter(array_keys($definition->getArguments()), fn ($argument) => !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired()); - - if (\count($missingArguments) > 0) { - throw new RuntimeException(\sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); - } - } - - public function isInteractive(): bool - { - return $this->interactive; - } - - public function setInteractive(bool $interactive): void - { - $this->interactive = $interactive; - } - - public function getArguments(): array - { - return array_merge($this->definition->getArgumentDefaults(), $this->arguments); - } - - public function getArgument(string $name): mixed - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); - } - - return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault(); - } - - public function setArgument(string $name, mixed $value): void - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } - - public function hasArgument(string $name): bool - { - return $this->definition->hasArgument($name); - } - - public function getOptions(): array - { - return array_merge($this->definition->getOptionDefaults(), $this->options); - } - - public function getOption(string $name): mixed - { - if ($this->definition->hasNegation($name)) { - if (null === $value = $this->getOption($this->definition->negationToName($name))) { - return $value; - } - - return !$value; - } - - if (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(\sprintf('The "%s" option does not exist.', $name)); - } - - return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); - } - - public function setOption(string $name, mixed $value): void - { - if ($this->definition->hasNegation($name)) { - $this->options[$this->definition->negationToName($name)] = !$value; - - return; - } elseif (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(\sprintf('The "%s" option does not exist.', $name)); - } - - $this->options[$name] = $value; - } - - public function hasOption(string $name): bool - { - return $this->definition->hasOption($name) || $this->definition->hasNegation($name); - } - - /** - * Escapes a token through escapeshellarg if it contains unsafe chars. - */ - public function escapeToken(string $token): string - { - return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); - } - - /** - * @param resource $stream - */ - public function setStream($stream): void - { - $this->stream = $stream; - } - - /** - * @return resource - */ - public function getStream() - { - return $this->stream; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/InputArgument.php b/tools/php-cs-fixer/vendor/symfony/console/Input/InputArgument.php deleted file mode 100644 index 6fbb64ed..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/InputArgument.php +++ /dev/null @@ -1,160 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Suggestion; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a command line argument. - * - * @author Fabien Potencier - */ -class InputArgument -{ - /** - * Providing an argument is required (e.g. just 'app:foo' is not allowed). - */ - public const REQUIRED = 1; - - /** - * Providing an argument is optional (e.g. 'app:foo' and 'app:foo bar' are both allowed). This is the default behavior of arguments. - */ - public const OPTIONAL = 2; - - /** - * The argument accepts multiple values and turn them into an array (e.g. 'app:foo bar baz' will result in value ['bar', 'baz']). - */ - public const IS_ARRAY = 4; - - private int $mode; - private string|int|bool|array|float|null $default; - - /** - * @param string $name The argument name - * @param int-mask-of|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY - * @param string $description A description text - * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - * - * @throws InvalidArgumentException When argument mode is not valid - */ - public function __construct( - private string $name, - ?int $mode = null, - private string $description = '', - string|bool|int|float|array|null $default = null, - private \Closure|array $suggestedValues = [], - ) { - if (null === $mode) { - $mode = self::OPTIONAL; - } elseif ($mode >= (self::IS_ARRAY << 1) || $mode < 1) { - throw new InvalidArgumentException(\sprintf('Argument mode "%s" is not valid.', $mode)); - } - - $this->mode = $mode; - - $this->setDefault($default); - } - - /** - * Returns the argument name. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Returns true if the argument is required. - * - * @return bool true if parameter mode is self::REQUIRED, false otherwise - */ - public function isRequired(): bool - { - return self::REQUIRED === (self::REQUIRED & $this->mode); - } - - /** - * Returns true if the argument can take multiple values. - * - * @return bool true if mode is self::IS_ARRAY, false otherwise - */ - public function isArray(): bool - { - return self::IS_ARRAY === (self::IS_ARRAY & $this->mode); - } - - /** - * Sets the default value. - */ - public function setDefault(string|bool|int|float|array|null $default): void - { - if ($this->isRequired() && null !== $default) { - throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!\is_array($default)) { - throw new LogicException('A default value for an array argument must be an array.'); - } - } - - $this->default = $default; - } - - /** - * Returns the default value. - */ - public function getDefault(): string|bool|int|float|array|null - { - return $this->default; - } - - /** - * Returns true if the argument has values for input completion. - */ - public function hasCompletion(): bool - { - return [] !== $this->suggestedValues; - } - - /** - * Supplies suggestions when command resolves possible completion options for input. - * - * @see Command::complete() - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - $values = $this->suggestedValues; - if ($values instanceof \Closure && !\is_array($values = $values($input))) { - throw new LogicException(\sprintf('Closure for argument "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); - } - if ($values) { - $suggestions->suggestValues($values); - } - } - - /** - * Returns the description text. - */ - public function getDescription(): string - { - return $this->description; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/InputAwareInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Input/InputAwareInterface.php deleted file mode 100644 index ba4664cd..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/InputAwareInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * InputAwareInterface should be implemented by classes that depends on the - * Console Input. - * - * @author Wouter J - */ -interface InputAwareInterface -{ - /** - * Sets the Console Input. - */ - public function setInput(InputInterface $input): void; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/InputDefinition.php b/tools/php-cs-fixer/vendor/symfony/console/Input/InputDefinition.php deleted file mode 100644 index a8b006d4..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/InputDefinition.php +++ /dev/null @@ -1,402 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * A InputDefinition represents a set of valid command line arguments and options. - * - * Usage: - * - * $definition = new InputDefinition([ - * new InputArgument('name', InputArgument::REQUIRED), - * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), - * ]); - * - * @author Fabien Potencier - */ -class InputDefinition -{ - private array $arguments = []; - private int $requiredCount = 0; - private ?InputArgument $lastArrayArgument = null; - private ?InputArgument $lastOptionalArgument = null; - private array $options = []; - private array $negations = []; - private array $shortcuts = []; - - /** - * @param array $definition An array of InputArgument and InputOption instance - */ - public function __construct(array $definition = []) - { - $this->setDefinition($definition); - } - - /** - * Sets the definition of the input. - */ - public function setDefinition(array $definition): void - { - $arguments = []; - $options = []; - foreach ($definition as $item) { - if ($item instanceof InputOption) { - $options[] = $item; - } else { - $arguments[] = $item; - } - } - - $this->setArguments($arguments); - $this->setOptions($options); - } - - /** - * Sets the InputArgument objects. - * - * @param InputArgument[] $arguments An array of InputArgument objects - */ - public function setArguments(array $arguments = []): void - { - $this->arguments = []; - $this->requiredCount = 0; - $this->lastOptionalArgument = null; - $this->lastArrayArgument = null; - $this->addArguments($arguments); - } - - /** - * Adds an array of InputArgument objects. - * - * @param InputArgument[] $arguments An array of InputArgument objects - */ - public function addArguments(?array $arguments = []): void - { - if (null !== $arguments) { - foreach ($arguments as $argument) { - $this->addArgument($argument); - } - } - } - - /** - * @throws LogicException When incorrect argument is given - */ - public function addArgument(InputArgument $argument): void - { - if (isset($this->arguments[$argument->getName()])) { - throw new LogicException(\sprintf('An argument with name "%s" already exists.', $argument->getName())); - } - - if (null !== $this->lastArrayArgument) { - throw new LogicException(\sprintf('Cannot add a required argument "%s" after an array argument "%s".', $argument->getName(), $this->lastArrayArgument->getName())); - } - - if ($argument->isRequired() && null !== $this->lastOptionalArgument) { - throw new LogicException(\sprintf('Cannot add a required argument "%s" after an optional one "%s".', $argument->getName(), $this->lastOptionalArgument->getName())); - } - - if ($argument->isArray()) { - $this->lastArrayArgument = $argument; - } - - if ($argument->isRequired()) { - ++$this->requiredCount; - } else { - $this->lastOptionalArgument = $argument; - } - - $this->arguments[$argument->getName()] = $argument; - } - - /** - * Returns an InputArgument by name or by position. - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function getArgument(string|int $name): InputArgument - { - if (!$this->hasArgument($name)) { - throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); - } - - $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; - - return $arguments[$name]; - } - - /** - * Returns true if an InputArgument object exists by name or position. - */ - public function hasArgument(string|int $name): bool - { - $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; - - return isset($arguments[$name]); - } - - /** - * Gets the array of InputArgument objects. - * - * @return InputArgument[] - */ - public function getArguments(): array - { - return $this->arguments; - } - - /** - * Returns the number of InputArguments. - */ - public function getArgumentCount(): int - { - return null !== $this->lastArrayArgument ? \PHP_INT_MAX : \count($this->arguments); - } - - /** - * Returns the number of required InputArguments. - */ - public function getArgumentRequiredCount(): int - { - return $this->requiredCount; - } - - /** - * @return array - */ - public function getArgumentDefaults(): array - { - $values = []; - foreach ($this->arguments as $argument) { - $values[$argument->getName()] = $argument->getDefault(); - } - - return $values; - } - - /** - * Sets the InputOption objects. - * - * @param InputOption[] $options An array of InputOption objects - */ - public function setOptions(array $options = []): void - { - $this->options = []; - $this->shortcuts = []; - $this->negations = []; - $this->addOptions($options); - } - - /** - * Adds an array of InputOption objects. - * - * @param InputOption[] $options An array of InputOption objects - */ - public function addOptions(array $options = []): void - { - foreach ($options as $option) { - $this->addOption($option); - } - } - - /** - * @throws LogicException When option given already exist - */ - public function addOption(InputOption $option): void - { - if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { - throw new LogicException(\sprintf('An option named "%s" already exists.', $option->getName())); - } - if (isset($this->negations[$option->getName()])) { - throw new LogicException(\sprintf('An option named "%s" already exists.', $option->getName())); - } - - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) { - throw new LogicException(\sprintf('An option with shortcut "%s" already exists.', $shortcut)); - } - } - } - - $this->options[$option->getName()] = $option; - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - $this->shortcuts[$shortcut] = $option->getName(); - } - } - - if ($option->isNegatable()) { - $negatedName = 'no-'.$option->getName(); - if (isset($this->options[$negatedName])) { - throw new LogicException(\sprintf('An option named "%s" already exists.', $negatedName)); - } - $this->negations[$negatedName] = $option->getName(); - } - } - - /** - * Returns an InputOption by name. - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function getOption(string $name): InputOption - { - if (!$this->hasOption($name)) { - throw new InvalidArgumentException(\sprintf('The "--%s" option does not exist.', $name)); - } - - return $this->options[$name]; - } - - /** - * Returns true if an InputOption object exists by name. - * - * This method can't be used to check if the user included the option when - * executing the command (use getOption() instead). - */ - public function hasOption(string $name): bool - { - return isset($this->options[$name]); - } - - /** - * Gets the array of InputOption objects. - * - * @return InputOption[] - */ - public function getOptions(): array - { - return $this->options; - } - - /** - * Returns true if an InputOption object exists by shortcut. - */ - public function hasShortcut(string $name): bool - { - return isset($this->shortcuts[$name]); - } - - /** - * Returns true if an InputOption object exists by negated name. - */ - public function hasNegation(string $name): bool - { - return isset($this->negations[$name]); - } - - /** - * Gets an InputOption by shortcut. - */ - public function getOptionForShortcut(string $shortcut): InputOption - { - return $this->getOption($this->shortcutToName($shortcut)); - } - - /** - * @return array - */ - public function getOptionDefaults(): array - { - $values = []; - foreach ($this->options as $option) { - $values[$option->getName()] = $option->getDefault(); - } - - return $values; - } - - /** - * Returns the InputOption name given a shortcut. - * - * @throws InvalidArgumentException When option given does not exist - * - * @internal - */ - public function shortcutToName(string $shortcut): string - { - if (!isset($this->shortcuts[$shortcut])) { - throw new InvalidArgumentException(\sprintf('The "-%s" option does not exist.', $shortcut)); - } - - return $this->shortcuts[$shortcut]; - } - - /** - * Returns the InputOption name given a negation. - * - * @throws InvalidArgumentException When option given does not exist - * - * @internal - */ - public function negationToName(string $negation): string - { - if (!isset($this->negations[$negation])) { - throw new InvalidArgumentException(\sprintf('The "--%s" option does not exist.', $negation)); - } - - return $this->negations[$negation]; - } - - /** - * Gets the synopsis. - */ - public function getSynopsis(bool $short = false): string - { - $elements = []; - - if ($short && $this->getOptions()) { - $elements[] = '[options]'; - } elseif (!$short) { - foreach ($this->getOptions() as $option) { - $value = ''; - if ($option->acceptValue()) { - $value = \sprintf( - ' %s%s%s', - $option->isValueOptional() ? '[' : '', - strtoupper($option->getName()), - $option->isValueOptional() ? ']' : '' - ); - } - - $shortcut = $option->getShortcut() ? \sprintf('-%s|', $option->getShortcut()) : ''; - $negation = $option->isNegatable() ? \sprintf('|--no-%s', $option->getName()) : ''; - $elements[] = \sprintf('[%s--%s%s%s]', $shortcut, $option->getName(), $value, $negation); - } - } - - if (\count($elements) && $this->getArguments()) { - $elements[] = '[--]'; - } - - $tail = ''; - foreach ($this->getArguments() as $argument) { - $element = '<'.$argument->getName().'>'; - if ($argument->isArray()) { - $element .= '...'; - } - - if (!$argument->isRequired()) { - $element = '['.$element; - $tail .= ']'; - } - - $elements[] = $element; - } - - return implode(' ', $elements).$tail; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/InputInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Input/InputInterface.php deleted file mode 100644 index c177d960..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/InputInterface.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * InputInterface is the interface implemented by all input classes. - * - * @author Fabien Potencier - */ -interface InputInterface -{ - /** - * Returns the first argument from the raw parameters (not parsed). - */ - public function getFirstArgument(): ?string; - - /** - * Returns true if the raw parameters (not parsed) contain a value. - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. - * - * @param string|array $values The values to look for in the raw parameters (can be an array) - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - */ - public function hasParameterOption(string|array $values, bool $onlyParams = false): bool; - - /** - * Returns the value of a raw option (not parsed). - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. - * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * @param string|bool|int|float|array|null $default The default value to return if no result is found - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - */ - public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed; - - /** - * Binds the current Input instance with the given arguments and options. - * - * @throws RuntimeException - */ - public function bind(InputDefinition $definition): void; - - /** - * Validates the input. - * - * @throws RuntimeException When not enough arguments are given - */ - public function validate(): void; - - /** - * Returns all the given arguments merged with the default values. - * - * @return array - */ - public function getArguments(): array; - - /** - * Returns the argument value for a given argument name. - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function getArgument(string $name): mixed; - - /** - * Sets an argument value by name. - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function setArgument(string $name, mixed $value): void; - - /** - * Returns true if an InputArgument object exists by name or position. - */ - public function hasArgument(string $name): bool; - - /** - * Returns all the given options merged with the default values. - * - * @return array - */ - public function getOptions(): array; - - /** - * Returns the option value for a given option name. - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function getOption(string $name): mixed; - - /** - * Sets an option value by name. - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function setOption(string $name, mixed $value): void; - - /** - * Returns true if an InputOption object exists by name. - */ - public function hasOption(string $name): bool; - - /** - * Is this input means interactive? - */ - public function isInteractive(): bool; - - /** - * Sets the input interactivity. - */ - public function setInteractive(bool $interactive): void; - - /** - * Returns a stringified representation of the args passed to the command. - * - * InputArguments MUST be escaped as well as the InputOption values passed to the command. - */ - public function __toString(): string; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/InputOption.php b/tools/php-cs-fixer/vendor/symfony/console/Input/InputOption.php deleted file mode 100644 index 25fb9178..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/InputOption.php +++ /dev/null @@ -1,262 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Suggestion; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a command line option. - * - * @author Fabien Potencier - */ -class InputOption -{ - /** - * Do not accept input for the option (e.g. --yell). This is the default behavior of options. - */ - public const VALUE_NONE = 1; - - /** - * A value must be passed when the option is used (e.g. --iterations=5 or -i5). - */ - public const VALUE_REQUIRED = 2; - - /** - * The option may or may not have a value (e.g. --yell or --yell=loud). - */ - public const VALUE_OPTIONAL = 4; - - /** - * The option accepts multiple values (e.g. --dir=/foo --dir=/bar). - */ - public const VALUE_IS_ARRAY = 8; - - /** - * The option allows passing a negated variant (e.g. --ansi or --no-ansi). - */ - public const VALUE_NEGATABLE = 16; - - private string $name; - private ?string $shortcut; - private int $mode; - private string|int|bool|array|float|null $default; - - /** - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int-mask-of|null $mode The option mode: One of the VALUE_* constants - * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - * - * @throws InvalidArgumentException If option mode is invalid or incompatible - */ - public function __construct( - string $name, - string|array|null $shortcut = null, - ?int $mode = null, - private string $description = '', - string|bool|int|float|array|null $default = null, - private array|\Closure $suggestedValues = [], - ) { - if (str_starts_with($name, '--')) { - $name = substr($name, 2); - } - - if (!$name) { - throw new InvalidArgumentException('An option name cannot be empty.'); - } - - if ('' === $shortcut || [] === $shortcut || false === $shortcut) { - $shortcut = null; - } - - if (null !== $shortcut) { - if (\is_array($shortcut)) { - $shortcut = implode('|', $shortcut); - } - $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); - $shortcuts = array_filter($shortcuts, 'strlen'); - $shortcut = implode('|', $shortcuts); - - if ('' === $shortcut) { - throw new InvalidArgumentException('An option shortcut cannot be empty.'); - } - } - - if (null === $mode) { - $mode = self::VALUE_NONE; - } elseif ($mode >= (self::VALUE_NEGATABLE << 1) || $mode < 1) { - throw new InvalidArgumentException(\sprintf('Option mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->shortcut = $shortcut; - $this->mode = $mode; - - if ($suggestedValues && !$this->acceptValue()) { - throw new LogicException('Cannot set suggested values if the option does not accept a value.'); - } - if ($this->isArray() && !$this->acceptValue()) { - throw new InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); - } - if ($this->isNegatable() && $this->acceptValue()) { - throw new InvalidArgumentException('Impossible to have an option mode VALUE_NEGATABLE if the option also accepts a value.'); - } - - $this->setDefault($default); - } - - /** - * Returns the option shortcut. - */ - public function getShortcut(): ?string - { - return $this->shortcut; - } - - /** - * Returns the option name. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Returns true if the option accepts a value. - * - * @return bool true if value mode is not self::VALUE_NONE, false otherwise - */ - public function acceptValue(): bool - { - return $this->isValueRequired() || $this->isValueOptional(); - } - - /** - * Returns true if the option requires a value. - * - * @return bool true if value mode is self::VALUE_REQUIRED, false otherwise - */ - public function isValueRequired(): bool - { - return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); - } - - /** - * Returns true if the option takes an optional value. - * - * @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise - */ - public function isValueOptional(): bool - { - return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); - } - - /** - * Returns true if the option can take multiple values. - * - * @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise - */ - public function isArray(): bool - { - return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); - } - - /** - * Returns true if the option allows passing a negated variant. - * - * @return bool true if mode is self::VALUE_NEGATABLE, false otherwise - */ - public function isNegatable(): bool - { - return self::VALUE_NEGATABLE === (self::VALUE_NEGATABLE & $this->mode); - } - - /** - * Sets the default value. - */ - public function setDefault(string|bool|int|float|array|null $default): void - { - if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { - throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!\is_array($default)) { - throw new LogicException('A default value for an array option must be an array.'); - } - } - - $this->default = $this->acceptValue() || $this->isNegatable() ? $default : false; - } - - /** - * Returns the default value. - */ - public function getDefault(): string|bool|int|float|array|null - { - return $this->default; - } - - /** - * Returns the description text. - */ - public function getDescription(): string - { - return $this->description; - } - - /** - * Returns true if the option has values for input completion. - */ - public function hasCompletion(): bool - { - return [] !== $this->suggestedValues; - } - - /** - * Supplies suggestions when command resolves possible completion options for input. - * - * @see Command::complete() - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - $values = $this->suggestedValues; - if ($values instanceof \Closure && !\is_array($values = $values($input))) { - throw new LogicException(\sprintf('Closure for option "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); - } - if ($values) { - $suggestions->suggestValues($values); - } - } - - /** - * Checks whether the given option equals this one. - */ - public function equals(self $option): bool - { - return $option->getName() === $this->getName() - && $option->getShortcut() === $this->getShortcut() - && $option->getDefault() === $this->getDefault() - && $option->isNegatable() === $this->isNegatable() - && $option->isArray() === $this->isArray() - && $option->isValueRequired() === $this->isValueRequired() - && $option->isValueOptional() === $this->isValueOptional() - ; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/StreamableInputInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Input/StreamableInputInterface.php deleted file mode 100644 index 4a0dc017..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/StreamableInputInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * StreamableInputInterface is the interface implemented by all input classes - * that have an input stream. - * - * @author Robin Chalas - */ -interface StreamableInputInterface extends InputInterface -{ - /** - * Sets the input stream to read from when interacting with the user. - * - * This is mainly useful for testing purpose. - * - * @param resource $stream The input stream - */ - public function setStream($stream): void; - - /** - * Returns the input stream. - * - * @return resource|null - */ - public function getStream(); -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Input/StringInput.php b/tools/php-cs-fixer/vendor/symfony/console/Input/StringInput.php deleted file mode 100644 index a70f048f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Input/StringInput.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * StringInput represents an input provided as a string. - * - * Usage: - * - * $input = new StringInput('foo --bar="foobar"'); - * - * @author Fabien Potencier - */ -class StringInput extends ArgvInput -{ - public const REGEX_UNQUOTED_STRING = '([^\s\\\\]+?)'; - public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')'; - - /** - * @param string $input A string representing the parameters from the CLI - */ - public function __construct(string $input) - { - parent::__construct([]); - - $this->setTokens($this->tokenize($input)); - } - - /** - * Tokenizes a string. - * - * @return list - * - * @throws InvalidArgumentException When unable to parse input (should never happen) - */ - private function tokenize(string $input): array - { - $tokens = []; - $length = \strlen($input); - $cursor = 0; - $token = null; - while ($cursor < $length) { - if ('\\' === $input[$cursor]) { - $token .= $input[++$cursor] ?? ''; - ++$cursor; - continue; - } - - if (preg_match('/\s+/A', $input, $match, 0, $cursor)) { - if (null !== $token) { - $tokens[] = $token; - $token = null; - } - } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, 0, $cursor)) { - $token .= $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, -1))); - } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, 0, $cursor)) { - $token .= stripcslashes(substr($match[0], 1, -1)); - } elseif (preg_match('/'.self::REGEX_UNQUOTED_STRING.'/A', $input, $match, 0, $cursor)) { - $token .= $match[1]; - } else { - // should never happen - throw new InvalidArgumentException(\sprintf('Unable to parse input near "... %s ...".', substr($input, $cursor, 10))); - } - - $cursor += \strlen($match[0]); - } - - if (null !== $token) { - $tokens[] = $token; - } - - return $tokens; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/LICENSE b/tools/php-cs-fixer/vendor/symfony/console/LICENSE deleted file mode 100644 index 0138f8f0..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/console/Logger/ConsoleLogger.php b/tools/php-cs-fixer/vendor/symfony/console/Logger/ConsoleLogger.php deleted file mode 100644 index a6ef49ea..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Logger/ConsoleLogger.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Logger; - -use Psr\Log\AbstractLogger; -use Psr\Log\InvalidArgumentException; -use Psr\Log\LogLevel; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * PSR-3 compliant console logger. - * - * @author Kévin Dunglas - * - * @see https://www.php-fig.org/psr/psr-3/ - */ -class ConsoleLogger extends AbstractLogger -{ - public const INFO = 'info'; - public const ERROR = 'error'; - - private array $verbosityLevelMap = [ - LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, - LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL, - LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL, - LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE, - LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE, - LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG, - ]; - private array $formatLevelMap = [ - LogLevel::EMERGENCY => self::ERROR, - LogLevel::ALERT => self::ERROR, - LogLevel::CRITICAL => self::ERROR, - LogLevel::ERROR => self::ERROR, - LogLevel::WARNING => self::INFO, - LogLevel::NOTICE => self::INFO, - LogLevel::INFO => self::INFO, - LogLevel::DEBUG => self::INFO, - ]; - private bool $errored = false; - - public function __construct( - private OutputInterface $output, - array $verbosityLevelMap = [], - array $formatLevelMap = [], - ) { - $this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap; - $this->formatLevelMap = $formatLevelMap + $this->formatLevelMap; - } - - public function log($level, $message, array $context = []): void - { - if (!isset($this->verbosityLevelMap[$level])) { - throw new InvalidArgumentException(\sprintf('The log level "%s" does not exist.', $level)); - } - - $output = $this->output; - - // Write to the error output if necessary and available - if (self::ERROR === $this->formatLevelMap[$level]) { - if ($this->output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - $this->errored = true; - } - - // the if condition check isn't necessary -- it's the same one that $output will do internally anyway. - // We only do it for efficiency here as the message formatting is relatively expensive. - if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) { - $output->writeln(\sprintf('<%1$s>[%2$s] %3$s', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]); - } - } - - /** - * Returns true when any messages have been logged at error levels. - */ - public function hasErrored(): bool - { - return $this->errored; - } - - /** - * Interpolates context values into the message placeholders. - * - * @author PHP Framework Interoperability Group - */ - private function interpolate(string $message, array $context): string - { - if (!str_contains($message, '{')) { - return $message; - } - - $replacements = []; - foreach ($context as $key => $val) { - if (null === $val || \is_scalar($val) || $val instanceof \Stringable) { - $replacements["{{$key}}"] = $val; - } elseif ($val instanceof \DateTimeInterface) { - $replacements["{{$key}}"] = $val->format(\DateTimeInterface::RFC3339); - } elseif (\is_object($val)) { - $replacements["{{$key}}"] = '[object '.$val::class.']'; - } else { - $replacements["{{$key}}"] = '['.\gettype($val).']'; - } - } - - return strtr($message, $replacements); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandContext.php b/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandContext.php deleted file mode 100644 index 2ee5415c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandContext.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Messenger; - -/** - * @author Kevin Bond - */ -final class RunCommandContext -{ - public function __construct( - public readonly RunCommandMessage $message, - public readonly int $exitCode, - public readonly string $output, - ) { - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessage.php b/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessage.php deleted file mode 100644 index b530c438..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessage.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Messenger; - -use Symfony\Component\Console\Exception\RunCommandFailedException; - -/** - * @author Kevin Bond - */ -class RunCommandMessage implements \Stringable -{ - /** - * @param bool $throwOnFailure If the command has a non-zero exit code, throw {@see RunCommandFailedException} - * @param bool $catchExceptions @see Application::setCatchExceptions() - */ - public function __construct( - public readonly string $input, - public readonly bool $throwOnFailure = true, - public readonly bool $catchExceptions = false, - ) { - } - - public function __toString(): string - { - return $this->input; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessageHandler.php b/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessageHandler.php deleted file mode 100644 index 0fdf7d01..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Messenger/RunCommandMessageHandler.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Messenger; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\RunCommandFailedException; -use Symfony\Component\Console\Input\StringInput; -use Symfony\Component\Console\Output\BufferedOutput; - -/** - * @author Kevin Bond - */ -final class RunCommandMessageHandler -{ - public function __construct( - private readonly Application $application, - ) { - } - - public function __invoke(RunCommandMessage $message): RunCommandContext - { - $input = new StringInput($message->input); - $output = new BufferedOutput(); - - $this->application->setCatchExceptions($message->catchExceptions); - - try { - $exitCode = $this->application->run($input, $output); - } catch (\Throwable $e) { - throw new RunCommandFailedException($e, new RunCommandContext($message, Command::FAILURE, $output->fetch())); - } - - if ($message->throwOnFailure && Command::SUCCESS !== $exitCode) { - throw new RunCommandFailedException(\sprintf('Command "%s" exited with code "%s".', $message->input, $exitCode), new RunCommandContext($message, $exitCode, $output->fetch())); - } - - return new RunCommandContext($message, $exitCode, $output->fetch()); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/AnsiColorMode.php b/tools/php-cs-fixer/vendor/symfony/console/Output/AnsiColorMode.php deleted file mode 100644 index 0e1422a2..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/AnsiColorMode.php +++ /dev/null @@ -1,106 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Fabien Potencier - * @author Julien Boudry - */ -enum AnsiColorMode -{ - /* - * Classical 4-bit Ansi colors, including 8 classical colors and 8 bright color. Output syntax is "ESC[${foreGroundColorcode};${backGroundColorcode}m" - * Must be compatible with all terminals and it's the minimal version supported. - */ - case Ansi4; - - /* - * 8-bit Ansi colors (240 different colors + 16 duplicate color codes, ensuring backward compatibility). - * Output syntax is: "ESC[38;5;${foreGroundColorcode};48;5;${backGroundColorcode}m" - * Should be compatible with most terminals. - */ - case Ansi8; - - /* - * 24-bit Ansi colors (RGB). - * Output syntax is: "ESC[38;2;${foreGroundColorcodeRed};${foreGroundColorcodeGreen};${foreGroundColorcodeBlue};48;2;${backGroundColorcodeRed};${backGroundColorcodeGreen};${backGroundColorcodeBlue}m" - * May be compatible with many modern terminals. - */ - case Ansi24; - - /** - * Converts an RGB hexadecimal color to the corresponding Ansi code. - */ - public function convertFromHexToAnsiColorCode(string $hexColor): string - { - $hexColor = str_replace('#', '', $hexColor); - - if (3 === \strlen($hexColor)) { - $hexColor = $hexColor[0].$hexColor[0].$hexColor[1].$hexColor[1].$hexColor[2].$hexColor[2]; - } - - if (6 !== \strlen($hexColor)) { - throw new InvalidArgumentException(\sprintf('Invalid "#%s" color.', $hexColor)); - } - - $color = hexdec($hexColor); - - $r = ($color >> 16) & 255; - $g = ($color >> 8) & 255; - $b = $color & 255; - - return match ($this) { - self::Ansi4 => (string) $this->convertFromRGB($r, $g, $b), - self::Ansi8 => '8;5;'.$this->convertFromRGB($r, $g, $b), - self::Ansi24 => \sprintf('8;2;%d;%d;%d', $r, $g, $b), - }; - } - - private function convertFromRGB(int $r, int $g, int $b): int - { - return match ($this) { - self::Ansi4 => $this->degradeHexColorToAnsi4($r, $g, $b), - self::Ansi8 => $this->degradeHexColorToAnsi8($r, $g, $b), - default => throw new InvalidArgumentException("RGB cannot be converted to {$this->name}."), - }; - } - - private function degradeHexColorToAnsi4(int $r, int $g, int $b): int - { - return round($b / 255) << 2 | (round($g / 255) << 1) | round($r / 255); - } - - /** - * Inspired from https://github.com/ajalt/colormath/blob/e464e0da1b014976736cf97250063248fc77b8e7/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/Ansi256.kt code (MIT license). - */ - private function degradeHexColorToAnsi8(int $r, int $g, int $b): int - { - if ($r === $g && $g === $b) { - if ($r < 8) { - return 16; - } - - if ($r > 248) { - return 231; - } - - return (int) round(($r - 8) / 247 * 24) + 232; - } - - return 16 + - (36 * (int) round($r / 255 * 5)) + - (6 * (int) round($g / 255 * 5)) + - (int) round($b / 255 * 5); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/BufferedOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/BufferedOutput.php deleted file mode 100644 index 3c8d3906..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/BufferedOutput.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -/** - * @author Jean-François Simon - */ -class BufferedOutput extends Output -{ - private string $buffer = ''; - - /** - * Empties buffer and returns its content. - */ - public function fetch(): string - { - $content = $this->buffer; - $this->buffer = ''; - - return $content; - } - - protected function doWrite(string $message, bool $newline): void - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutput.php deleted file mode 100644 index 2ad3dbcf..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutput.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * ConsoleOutput is the default class for all CLI output. It uses STDOUT and STDERR. - * - * This class is a convenient wrapper around `StreamOutput` for both STDOUT and STDERR. - * - * $output = new ConsoleOutput(); - * - * This is equivalent to: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * $stdErr = new StreamOutput(fopen('php://stderr', 'w')); - * - * @author Fabien Potencier - */ -class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface -{ - private OutputInterface $stderr; - private array $consoleSectionOutputs = []; - - /** - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - */ - public function __construct(int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null) - { - parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter); - - if (null === $formatter) { - // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter. - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated); - - return; - } - - $actualDecorated = $this->isDecorated(); - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter()); - - if (null === $decorated) { - $this->setDecorated($actualDecorated && $this->stderr->isDecorated()); - } - } - - /** - * Creates a new output section. - */ - public function section(): ConsoleSectionOutput - { - return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); - } - - public function setDecorated(bool $decorated): void - { - parent::setDecorated($decorated); - $this->stderr->setDecorated($decorated); - } - - public function setFormatter(OutputFormatterInterface $formatter): void - { - parent::setFormatter($formatter); - $this->stderr->setFormatter($formatter); - } - - public function setVerbosity(int $level): void - { - parent::setVerbosity($level); - $this->stderr->setVerbosity($level); - } - - public function getErrorOutput(): OutputInterface - { - return $this->stderr; - } - - public function setErrorOutput(OutputInterface $error): void - { - $this->stderr = $error; - } - - /** - * Returns true if current environment supports writing console output to - * STDOUT. - */ - protected function hasStdoutSupport(): bool - { - return false === $this->isRunningOS400(); - } - - /** - * Returns true if current environment supports writing console output to - * STDERR. - */ - protected function hasStderrSupport(): bool - { - return false === $this->isRunningOS400(); - } - - /** - * Checks if current executing environment is IBM iSeries (OS400), which - * doesn't properly convert character-encodings between ASCII to EBCDIC. - */ - private function isRunningOS400(): bool - { - $checks = [ - \function_exists('php_uname') ? php_uname('s') : '', - getenv('OSTYPE'), - \PHP_OS, - ]; - - return false !== stripos(implode(';', $checks), 'OS400'); - } - - /** - * @return resource - */ - private function openOutputStream() - { - if (!$this->hasStdoutSupport()) { - return fopen('php://output', 'w'); - } - - // Use STDOUT when possible to prevent from opening too many file descriptors - return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w')); - } - - /** - * @return resource - */ - private function openErrorStream() - { - if (!$this->hasStderrSupport()) { - return fopen('php://output', 'w'); - } - - // Use STDERR when possible to prevent from opening too many file descriptors - return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w')); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutputInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutputInterface.php deleted file mode 100644 index 1f8f147c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleOutputInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -/** - * ConsoleOutputInterface is the interface implemented by ConsoleOutput class. - * This adds information about stderr and section output stream. - * - * @author Dariusz Górecki - */ -interface ConsoleOutputInterface extends OutputInterface -{ - /** - * Gets the OutputInterface for errors. - */ - public function getErrorOutput(): OutputInterface; - - public function setErrorOutput(OutputInterface $error): void; - - public function section(): ConsoleSectionOutput; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleSectionOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleSectionOutput.php deleted file mode 100644 index 44728dfd..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ /dev/null @@ -1,237 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Terminal; - -/** - * @author Pierre du Plessis - * @author Gabriel Ostrolucký - */ -class ConsoleSectionOutput extends StreamOutput -{ - private array $content = []; - private int $lines = 0; - private array $sections; - private Terminal $terminal; - private int $maxHeight = 0; - - /** - * @param resource $stream - * @param ConsoleSectionOutput[] $sections - */ - public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter) - { - parent::__construct($stream, $verbosity, $decorated, $formatter); - array_unshift($sections, $this); - $this->sections = &$sections; - $this->terminal = new Terminal(); - } - - /** - * Defines a maximum number of lines for this section. - * - * When more lines are added, the section will automatically scroll to the - * end (i.e. remove the first lines to comply with the max height). - */ - public function setMaxHeight(int $maxHeight): void - { - // when changing max height, clear output of current section and redraw again with the new height - $previousMaxHeight = $this->maxHeight; - $this->maxHeight = $maxHeight; - $existingContent = $this->popStreamContentUntilCurrentSection($previousMaxHeight ? min($previousMaxHeight, $this->lines) : $this->lines); - - parent::doWrite($this->getVisibleContent(), false); - parent::doWrite($existingContent, false); - } - - /** - * Clears previous output for this section. - * - * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared - */ - public function clear(?int $lines = null): void - { - if (!$this->content || !$this->isDecorated()) { - return; - } - - if ($lines) { - array_splice($this->content, -$lines); - } else { - $lines = $this->lines; - $this->content = []; - } - - $this->lines -= $lines; - - parent::doWrite($this->popStreamContentUntilCurrentSection($this->maxHeight ? min($this->maxHeight, $lines) : $lines), false); - } - - /** - * Overwrites the previous output with a new message. - */ - public function overwrite(string|iterable $message): void - { - $this->clear(); - $this->writeln($message); - } - - public function getContent(): string - { - return implode('', $this->content); - } - - public function getVisibleContent(): string - { - if (0 === $this->maxHeight) { - return $this->getContent(); - } - - return implode('', \array_slice($this->content, -$this->maxHeight)); - } - - /** - * @internal - */ - public function addContent(string $input, bool $newline = true): int - { - $width = $this->terminal->getWidth(); - $lines = explode(\PHP_EOL, $input); - $linesAdded = 0; - $count = \count($lines) - 1; - foreach ($lines as $i => $lineContent) { - // re-add the line break (that has been removed in the above `explode()` for - // - every line that is not the last line - // - if $newline is required, also add it to the last line - if ($i < $count || $newline) { - $lineContent .= \PHP_EOL; - } - - // skip line if there is no text (or newline for that matter) - if ('' === $lineContent) { - continue; - } - - // For the first line, check if the previous line (last entry of `$this->content`) - // needs to be continued (i.e. does not end with a line break). - if (0 === $i - && (false !== $lastLine = end($this->content)) - && !str_ends_with($lastLine, \PHP_EOL) - ) { - // deduct the line count of the previous line - $this->lines -= (int) ceil($this->getDisplayLength($lastLine) / $width) ?: 1; - // concatenate previous and new line - $lineContent = $lastLine.$lineContent; - // replace last entry of `$this->content` with the new expanded line - array_splice($this->content, -1, 1, $lineContent); - } else { - // otherwise just add the new content - $this->content[] = $lineContent; - } - - $linesAdded += (int) ceil($this->getDisplayLength($lineContent) / $width) ?: 1; - } - - $this->lines += $linesAdded; - - return $linesAdded; - } - - /** - * @internal - */ - public function addNewLineOfInputSubmit(): void - { - $this->content[] = \PHP_EOL; - ++$this->lines; - } - - protected function doWrite(string $message, bool $newline): void - { - // Simulate newline behavior for consistent output formatting, avoiding extra logic - if (!$newline && str_ends_with($message, \PHP_EOL)) { - $message = substr($message, 0, -\strlen(\PHP_EOL)); - $newline = true; - } - - if (!$this->isDecorated()) { - parent::doWrite($message, $newline); - - return; - } - - // Check if the previous line (last entry of `$this->content`) needs to be continued - // (i.e. does not end with a line break). In which case, it needs to be erased first. - $linesToClear = $deleteLastLine = ($lastLine = end($this->content) ?: '') && !str_ends_with($lastLine, \PHP_EOL) ? 1 : 0; - - $linesAdded = $this->addContent($message, $newline); - - if ($lineOverflow = $this->maxHeight > 0 && $this->lines > $this->maxHeight) { - // on overflow, clear the whole section and redraw again (to remove the first lines) - $linesToClear = $this->maxHeight; - } - - $erasedContent = $this->popStreamContentUntilCurrentSection($linesToClear); - - if ($lineOverflow) { - // redraw existing lines of the section - $previousLinesOfSection = \array_slice($this->content, $this->lines - $this->maxHeight, $this->maxHeight - $linesAdded); - parent::doWrite(implode('', $previousLinesOfSection), false); - } - - // if the last line was removed, re-print its content together with the new content. - // otherwise, just print the new content. - parent::doWrite($deleteLastLine ? $lastLine.$message : $message, true); - parent::doWrite($erasedContent, false); - } - - /** - * At initial stage, cursor is at the end of stream output. This method makes cursor crawl upwards until it hits - * current section. Then it erases content it crawled through. Optionally, it erases part of current section too. - */ - private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFromCurrentSection = 0): string - { - $numberOfLinesToClear = $numberOfLinesToClearFromCurrentSection; - $erasedContent = []; - - foreach ($this->sections as $section) { - if ($section === $this) { - break; - } - - $numberOfLinesToClear += $section->maxHeight ? min($section->lines, $section->maxHeight) : $section->lines; - if ('' !== $sectionContent = $section->getVisibleContent()) { - if (!str_ends_with($sectionContent, \PHP_EOL)) { - $sectionContent .= \PHP_EOL; - } - $erasedContent[] = $sectionContent; - } - } - - if ($numberOfLinesToClear > 0) { - // move cursor up n lines - parent::doWrite(\sprintf("\x1b[%dA", $numberOfLinesToClear), false); - // erase to end of screen - parent::doWrite("\x1b[0J", false); - } - - return implode('', array_reverse($erasedContent)); - } - - private function getDisplayLength(string $text): int - { - return Helper::width(Helper::removeDecoration($this->getFormatter(), str_replace("\t", ' ', $text))); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/NullOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/NullOutput.php deleted file mode 100644 index 8bec706d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/NullOutput.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\NullOutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * NullOutput suppresses all output. - * - * $output = new NullOutput(); - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class NullOutput implements OutputInterface -{ - private NullOutputFormatter $formatter; - - public function setFormatter(OutputFormatterInterface $formatter): void - { - // do nothing - } - - public function getFormatter(): OutputFormatterInterface - { - // to comply with the interface we must return a OutputFormatterInterface - return $this->formatter ??= new NullOutputFormatter(); - } - - public function setDecorated(bool $decorated): void - { - // do nothing - } - - public function isDecorated(): bool - { - return false; - } - - public function setVerbosity(int $level): void - { - // do nothing - } - - public function getVerbosity(): int - { - return self::VERBOSITY_SILENT; - } - - public function isSilent(): bool - { - return true; - } - - public function isQuiet(): bool - { - return false; - } - - public function isVerbose(): bool - { - return false; - } - - public function isVeryVerbose(): bool - { - return false; - } - - public function isDebug(): bool - { - return false; - } - - public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL): void - { - // do nothing - } - - public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL): void - { - // do nothing - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/Output.php b/tools/php-cs-fixer/vendor/symfony/console/Output/Output.php deleted file mode 100644 index 32e6cb24..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/Output.php +++ /dev/null @@ -1,144 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * Base class for output classes. - * - * There are six levels of verbosity: - * - * * normal: no option passed (normal output) - * * verbose: -v (more output) - * * very verbose: -vv (highly extended output) - * * debug: -vvv (all debug output) - * * quiet: -q (only output errors) - * * silent: --silent (no output) - * - * @author Fabien Potencier - */ -abstract class Output implements OutputInterface -{ - private int $verbosity; - private OutputFormatterInterface $formatter; - - /** - * @param int|null $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool $decorated Whether to decorate messages - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - */ - public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null) - { - $this->verbosity = $verbosity ?? self::VERBOSITY_NORMAL; - $this->formatter = $formatter ?? new OutputFormatter(); - $this->formatter->setDecorated($decorated); - } - - public function setFormatter(OutputFormatterInterface $formatter): void - { - $this->formatter = $formatter; - } - - public function getFormatter(): OutputFormatterInterface - { - return $this->formatter; - } - - public function setDecorated(bool $decorated): void - { - $this->formatter->setDecorated($decorated); - } - - public function isDecorated(): bool - { - return $this->formatter->isDecorated(); - } - - public function setVerbosity(int $level): void - { - $this->verbosity = $level; - } - - public function getVerbosity(): int - { - return $this->verbosity; - } - - public function isSilent(): bool - { - return self::VERBOSITY_SILENT === $this->verbosity; - } - - public function isQuiet(): bool - { - return self::VERBOSITY_QUIET === $this->verbosity; - } - - public function isVerbose(): bool - { - return self::VERBOSITY_VERBOSE <= $this->verbosity; - } - - public function isVeryVerbose(): bool - { - return self::VERBOSITY_VERY_VERBOSE <= $this->verbosity; - } - - public function isDebug(): bool - { - return self::VERBOSITY_DEBUG <= $this->verbosity; - } - - public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL): void - { - $this->write($messages, true, $options); - } - - public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL): void - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - $types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN; - $type = $types & $options ?: self::OUTPUT_NORMAL; - - $verbosities = self::VERBOSITY_QUIET | self::VERBOSITY_NORMAL | self::VERBOSITY_VERBOSE | self::VERBOSITY_VERY_VERBOSE | self::VERBOSITY_DEBUG; - $verbosity = $verbosities & $options ?: self::VERBOSITY_NORMAL; - - if ($verbosity > $this->getVerbosity()) { - return; - } - - foreach ($messages as $message) { - switch ($type) { - case OutputInterface::OUTPUT_NORMAL: - $message = $this->formatter->format($message); - break; - case OutputInterface::OUTPUT_RAW: - break; - case OutputInterface::OUTPUT_PLAIN: - $message = strip_tags($this->formatter->format($message)); - break; - } - - $this->doWrite($message ?? '', $newline); - } - } - - /** - * Writes a message to the output. - */ - abstract protected function doWrite(string $message, bool $newline): void; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/OutputInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Output/OutputInterface.php deleted file mode 100644 index 969a3b02..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/OutputInterface.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * OutputInterface is the interface implemented by all Output classes. - * - * @author Fabien Potencier - * - * @method bool isSilent() - */ -interface OutputInterface -{ - public const VERBOSITY_SILENT = 8; - public const VERBOSITY_QUIET = 16; - public const VERBOSITY_NORMAL = 32; - public const VERBOSITY_VERBOSE = 64; - public const VERBOSITY_VERY_VERBOSE = 128; - public const VERBOSITY_DEBUG = 256; - - public const OUTPUT_NORMAL = 1; - public const OUTPUT_RAW = 2; - public const OUTPUT_PLAIN = 4; - - /** - * Writes a message to the output. - * - * @param bool $newline Whether to add a newline - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), - * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - */ - public function write(string|iterable $messages, bool $newline = false, int $options = 0): void; - - /** - * Writes a message to the output and adds a newline at the end. - * - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), - * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - */ - public function writeln(string|iterable $messages, int $options = 0): void; - - /** - * Sets the verbosity of the output. - * - * @param self::VERBOSITY_* $level - */ - public function setVerbosity(int $level): void; - - /** - * Gets the current verbosity of the output. - * - * @return self::VERBOSITY_* - */ - public function getVerbosity(): int; - - /** - * Returns whether verbosity is quiet (-q). - */ - public function isQuiet(): bool; - - /** - * Returns whether verbosity is verbose (-v). - */ - public function isVerbose(): bool; - - /** - * Returns whether verbosity is very verbose (-vv). - */ - public function isVeryVerbose(): bool; - - /** - * Returns whether verbosity is debug (-vvv). - */ - public function isDebug(): bool; - - /** - * Sets the decorated flag. - */ - public function setDecorated(bool $decorated): void; - - /** - * Gets the decorated flag. - */ - public function isDecorated(): bool; - - public function setFormatter(OutputFormatterInterface $formatter): void; - - /** - * Returns current output formatter instance. - */ - public function getFormatter(): OutputFormatterInterface; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/StreamOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/StreamOutput.php deleted file mode 100644 index ce5a825e..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/StreamOutput.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * StreamOutput writes the output to a given stream. - * - * Usage: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * - * As `StreamOutput` can use any stream, you can also use a file: - * - * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); - * - * @author Fabien Potencier - */ -class StreamOutput extends Output -{ - /** @var resource */ - private $stream; - - /** - * @param resource $stream A stream resource - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - * - * @throws InvalidArgumentException When first argument is not a real stream - */ - public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null) - { - if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { - throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); - } - - $this->stream = $stream; - - $decorated ??= $this->hasColorSupport(); - - parent::__construct($verbosity, $decorated, $formatter); - } - - /** - * Gets the stream attached to this StreamOutput instance. - * - * @return resource - */ - public function getStream() - { - return $this->stream; - } - - protected function doWrite(string $message, bool $newline): void - { - if ($newline) { - $message .= \PHP_EOL; - } - - @fwrite($this->stream, $message); - - fflush($this->stream); - } - - /** - * Returns true if the stream supports colorization. - * - * Colorization is disabled if not supported by the stream: - * - * This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo - * terminals via named pipes, so we can only check the environment. - * - * Reference: Composer\XdebugHandler\Process::supportsColor - * https://github.com/composer/xdebug-handler - * - * @return bool true if the stream supports colorization, false otherwise - */ - protected function hasColorSupport(): bool - { - // Follow https://no-color.org/ - if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) { - return false; - } - - // Follow https://force-color.org/ - if ('' !== (($_SERVER['FORCE_COLOR'] ?? getenv('FORCE_COLOR'))[0] ?? '')) { - return true; - } - - // Detect msysgit/mingw and assume this is a tty because detection - // does not work correctly, see https://github.com/composer/composer/issues/9690 - if (!@stream_isatty($this->stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) { - return false; - } - - if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($this->stream)) { - return true; - } - - if ('Hyper' === getenv('TERM_PROGRAM') - || false !== getenv('COLORTERM') - || false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - ) { - return true; - } - - if ('dumb' === $term = (string) getenv('TERM')) { - return false; - } - - // See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157 - return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Output/TrimmedBufferOutput.php b/tools/php-cs-fixer/vendor/symfony/console/Output/TrimmedBufferOutput.php deleted file mode 100644 index 33db072c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * A BufferedOutput that keeps only the last N chars. - * - * @author Jérémy Derussé - */ -class TrimmedBufferOutput extends Output -{ - private int $maxLength; - private string $buffer = ''; - - public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null) - { - if ($maxLength <= 0) { - throw new InvalidArgumentException(\sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); - } - - parent::__construct($verbosity, $decorated, $formatter); - $this->maxLength = $maxLength; - } - - /** - * Empties buffer and returns its content. - */ - public function fetch(): string - { - $content = $this->buffer; - $this->buffer = ''; - - return $content; - } - - protected function doWrite(string $message, bool $newline): void - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - - $this->buffer = substr($this->buffer, -$this->maxLength); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Question/ChoiceQuestion.php b/tools/php-cs-fixer/vendor/symfony/console/Question/ChoiceQuestion.php deleted file mode 100644 index 36c240d3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Question/ChoiceQuestion.php +++ /dev/null @@ -1,178 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * Represents a choice question. - * - * @author Fabien Potencier - */ -class ChoiceQuestion extends Question -{ - private bool $multiselect = false; - private string $prompt = ' > '; - private string $errorMessage = 'Value "%s" is invalid'; - - /** - * @param string $question The question to ask to the user - * @param array $choices The list of available choices - * @param string|bool|int|float|null $default The default answer to return - */ - public function __construct( - string $question, - private array $choices, - string|bool|int|float|null $default = null, - ) { - if (!$choices) { - throw new \LogicException('Choice question must have at least 1 choice available.'); - } - - parent::__construct($question, $default); - - $this->setValidator($this->getDefaultValidator()); - $this->setAutocompleterValues($choices); - } - - /** - * Returns available choices. - */ - public function getChoices(): array - { - return $this->choices; - } - - /** - * Sets multiselect option. - * - * When multiselect is set to true, multiple choices can be answered. - * - * @return $this - */ - public function setMultiselect(bool $multiselect): static - { - $this->multiselect = $multiselect; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - /** - * Returns whether the choices are multiselect. - */ - public function isMultiselect(): bool - { - return $this->multiselect; - } - - /** - * Gets the prompt for choices. - */ - public function getPrompt(): string - { - return $this->prompt; - } - - /** - * Sets the prompt for choices. - * - * @return $this - */ - public function setPrompt(string $prompt): static - { - $this->prompt = $prompt; - - return $this; - } - - /** - * Sets the error message for invalid values. - * - * The error message has a string placeholder (%s) for the invalid value. - * - * @return $this - */ - public function setErrorMessage(string $errorMessage): static - { - $this->errorMessage = $errorMessage; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - private function getDefaultValidator(): callable - { - $choices = $this->choices; - $errorMessage = $this->errorMessage; - $multiselect = $this->multiselect; - $isAssoc = $this->isAssoc($choices); - - return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { - if ($multiselect) { - // Check for a separated comma values - if (!preg_match('/^[^,]+(?:,[^,]+)*$/', (string) $selected, $matches)) { - throw new InvalidArgumentException(\sprintf($errorMessage, $selected)); - } - - $selectedChoices = explode(',', (string) $selected); - } else { - $selectedChoices = [$selected]; - } - - if ($this->isTrimmable()) { - foreach ($selectedChoices as $k => $v) { - $selectedChoices[$k] = trim((string) $v); - } - } - - $multiselectChoices = []; - foreach ($selectedChoices as $value) { - $results = []; - foreach ($choices as $key => $choice) { - if ($choice === $value) { - $results[] = $key; - } - } - - if (\count($results) > 1) { - throw new InvalidArgumentException(\sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results))); - } - - $result = array_search($value, $choices); - - if (!$isAssoc) { - if (false !== $result) { - $result = $choices[$result]; - } elseif (isset($choices[$value])) { - $result = $choices[$value]; - } - } elseif (false === $result && isset($choices[$value])) { - $result = $value; - } - - if (false === $result) { - throw new InvalidArgumentException(\sprintf($errorMessage, $value)); - } - - // For associative choices, consistently return the key as string: - $multiselectChoices[] = $isAssoc ? (string) $result : $result; - } - - if ($multiselect) { - return $multiselectChoices; - } - - return current($multiselectChoices); - }; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Question/ConfirmationQuestion.php b/tools/php-cs-fixer/vendor/symfony/console/Question/ConfirmationQuestion.php deleted file mode 100644 index 951d6814..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Question/ConfirmationQuestion.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -/** - * Represents a yes/no question. - * - * @author Fabien Potencier - */ -class ConfirmationQuestion extends Question -{ - /** - * @param string $question The question to ask to the user - * @param bool $default The default answer to return, true or false - * @param string $trueAnswerRegex A regex to match the "yes" answer - */ - public function __construct( - string $question, - bool $default = true, - private string $trueAnswerRegex = '/^y/i', - ) { - parent::__construct($question, $default); - - $this->setNormalizer($this->getDefaultNormalizer()); - } - - /** - * Returns the default answer normalizer. - */ - private function getDefaultNormalizer(): callable - { - $default = $this->getDefault(); - $regex = $this->trueAnswerRegex; - - return function ($answer) use ($default, $regex) { - if (\is_bool($answer)) { - return $answer; - } - - $answerIsTrue = (bool) preg_match($regex, $answer); - if (false === $default) { - return $answer && $answerIsTrue; - } - - return '' === $answer || $answerIsTrue; - }; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Question/Question.php b/tools/php-cs-fixer/vendor/symfony/console/Question/Question.php deleted file mode 100644 index 46a60c79..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Question/Question.php +++ /dev/null @@ -1,280 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a Question. - * - * @author Fabien Potencier - */ -class Question -{ - private ?int $attempts = null; - private bool $hidden = false; - private bool $hiddenFallback = true; - private ?\Closure $autocompleterCallback = null; - private ?\Closure $validator = null; - private ?\Closure $normalizer = null; - private bool $trimmable = true; - private bool $multiline = false; - - /** - * @param string $question The question to ask to the user - * @param string|bool|int|float|null $default The default answer to return if the user enters nothing - */ - public function __construct( - private string $question, - private string|bool|int|float|null $default = null, - ) { - } - - /** - * Returns the question. - */ - public function getQuestion(): string - { - return $this->question; - } - - /** - * Returns the default answer. - */ - public function getDefault(): string|bool|int|float|null - { - return $this->default; - } - - /** - * Returns whether the user response accepts newline characters. - */ - public function isMultiline(): bool - { - return $this->multiline; - } - - /** - * Sets whether the user response should accept newline characters. - * - * @return $this - */ - public function setMultiline(bool $multiline): static - { - $this->multiline = $multiline; - - return $this; - } - - /** - * Returns whether the user response must be hidden. - */ - public function isHidden(): bool - { - return $this->hidden; - } - - /** - * Sets whether the user response must be hidden or not. - * - * @return $this - * - * @throws LogicException In case the autocompleter is also used - */ - public function setHidden(bool $hidden): static - { - if ($this->autocompleterCallback) { - throw new LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->hidden = $hidden; - - return $this; - } - - /** - * In case the response cannot be hidden, whether to fallback on non-hidden question or not. - */ - public function isHiddenFallback(): bool - { - return $this->hiddenFallback; - } - - /** - * Sets whether to fallback on non-hidden question if the response cannot be hidden. - * - * @return $this - */ - public function setHiddenFallback(bool $fallback): static - { - $this->hiddenFallback = $fallback; - - return $this; - } - - /** - * Gets values for the autocompleter. - */ - public function getAutocompleterValues(): ?iterable - { - $callback = $this->getAutocompleterCallback(); - - return $callback ? $callback('') : null; - } - - /** - * Sets values for the autocompleter. - * - * @return $this - * - * @throws LogicException - */ - public function setAutocompleterValues(?iterable $values): static - { - if (\is_array($values)) { - $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); - - $callback = static fn () => $values; - } elseif ($values instanceof \Traversable) { - $callback = static function () use ($values) { - static $valueCache; - - return $valueCache ??= iterator_to_array($values, false); - }; - } else { - $callback = null; - } - - return $this->setAutocompleterCallback($callback); - } - - /** - * Gets the callback function used for the autocompleter. - */ - public function getAutocompleterCallback(): ?callable - { - return $this->autocompleterCallback; - } - - /** - * Sets the callback function used for the autocompleter. - * - * The callback is passed the user input as argument and should return an iterable of corresponding suggestions. - * - * @return $this - */ - public function setAutocompleterCallback(?callable $callback): static - { - if ($this->hidden && null !== $callback) { - throw new LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->autocompleterCallback = null === $callback ? null : $callback(...); - - return $this; - } - - /** - * Sets a validator for the question. - * - * @return $this - */ - public function setValidator(?callable $validator): static - { - $this->validator = null === $validator ? null : $validator(...); - - return $this; - } - - /** - * Gets the validator for the question. - */ - public function getValidator(): ?callable - { - return $this->validator; - } - - /** - * Sets the maximum number of attempts. - * - * Null means an unlimited number of attempts. - * - * @return $this - * - * @throws InvalidArgumentException in case the number of attempts is invalid - */ - public function setMaxAttempts(?int $attempts): static - { - if (null !== $attempts && $attempts < 1) { - throw new InvalidArgumentException('Maximum number of attempts must be a positive value.'); - } - - $this->attempts = $attempts; - - return $this; - } - - /** - * Gets the maximum number of attempts. - * - * Null means an unlimited number of attempts. - */ - public function getMaxAttempts(): ?int - { - return $this->attempts; - } - - /** - * Sets a normalizer for the response. - * - * The normalizer can be a callable (a string), a closure or a class implementing __invoke. - * - * @return $this - */ - public function setNormalizer(callable $normalizer): static - { - $this->normalizer = $normalizer(...); - - return $this; - } - - /** - * Gets the normalizer for the response. - * - * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. - */ - public function getNormalizer(): ?callable - { - return $this->normalizer; - } - - protected function isAssoc(array $array): bool - { - return (bool) \count(array_filter(array_keys($array), 'is_string')); - } - - public function isTrimmable(): bool - { - return $this->trimmable; - } - - /** - * @return $this - */ - public function setTrimmable(bool $trimmable): static - { - $this->trimmable = $trimmable; - - return $this; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/README.md b/tools/php-cs-fixer/vendor/symfony/console/README.md deleted file mode 100644 index 92f70e71..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/README.md +++ /dev/null @@ -1,27 +0,0 @@ -Console Component -================= - -The Console component eases the creation of beautiful and testable command line -interfaces. - -Sponsor -------- - -Help Symfony by [sponsoring][1] its development! - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/console.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) - -Credits -------- - -`Resources/bin/hiddeninput.exe` is a third party binary provided within this -component. Find sources and license at https://github.com/Seldaek/hidden-input. - -[1]: https://symfony.com/sponsor diff --git a/tools/php-cs-fixer/vendor/symfony/console/Resources/bin/hiddeninput.exe b/tools/php-cs-fixer/vendor/symfony/console/Resources/bin/hiddeninput.exe deleted file mode 100644 index c8cf65e8d819e6e525121cf6b21f1c2429746038..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9216 zcmeHNe{@sVeZR8hV88~S)=Hp|Mpn({rC^@)BwNOI{ERJXCYlx+k1K6PLHo z_e!z_fhOzeA3JTX&-Z@s{rFOgjEwBlqjr!)9f zjyHz`A+ni`!0Taby{Uj5Y>jQq(k5A+X})PLWAi|{IZbtc8n^^trM{GI=P_15U6d?l zJJ3PW8XjfHpR}6`k{&5@JcEeH_SqQoQbU62o2YS30W)p_t&Fjy*RXQCZt$gCf|ao| zx&3R}m6|-Lfi@pua=$26n(UlnWo$>K67*|+#(qL_An=?l0M02AhOSJDv3;~?1ORfw z76EdK#MpSHqACHLcnJLIYlCSiX4eS@Pr8rN)Xwz0dk7O*y^0_C(Yks2Kvg! z-d-fJ)F9@k?>)m(XqDKIe2OKfhCQde9fpO0ko24yn*4xzX7q+ze`Z*=aJgwV?D?73 zaJ8UkSk|NN>@-|mB*f`EIK7$ElgAB<7p&p`^Vuq$58#;?B^*Bz7&d$B#+AYUC z(^m|`7{lqx&b^5$;i`j|S!+u|lcaQplp_&Nb)!>r>vGh3wb!tW zLq6%bkSt8jO|(vWH>LiPV(Xkp%BiGhl1q!PXXNKVKE!>Y5cHc2%cJOJA{-&ZsSn`T z#8~TA#(HWH4m>uCd+kCMTFgMI*s*n3!iCOwEI`{vGcVhzDu!Lw%-Ea^JATtrF`q3`+#KvvYJ0vM~A}D#LOD zlw`4ncB0U*Jji=--Wz#>I&5?hy;MgYW2u91d8ob=7MWfY`u;7Xe-J{Qsb0=0p|SM2 zG|=~mERIj4?gi)Ew|{LIN#oAsh20k_khIYjJBBN6rrIJ=eQO=nE;rTnPSiaQS$1$# z+|JRh0!IbQIa*f1(TZ}QM;|WO0+jTy(e)ggN4>zqp2E>C>hGPLHjHBh--2%@{EZNE zbUk{<3MABX&20QwK{MxK8`1Vk>^%dO5i@VTfu>NG3$K4NC=hSPsj9UYy`rNO}sBnB9QdKdIk7G+2_amnWstdTYVg z7HgLJGC~XLZG`63GwH8PdO_+G(k6~?J8Wj5mQos#21kC4W#2)guQXI)!z^{@F)U)5 z*re+r(2dib3D4P~%Z6TL=$PIkpmm<_#isu%t=%DcIwNkJhMeJ|bpahHO%8h|y~Ccf zUg#xVk+dyu>Q1O7JZ~8KS>tqi0qK**X*y6yHM71`bT=kFZ=@E%oe2!Km1^2sa>v+onZ%x_>aOJF+N0{i~z|<(IzgT*{0PpQq}E zQpU35@bm;qI?t_znGI&5&4sZV>+%m}w$(4hSDvLk)l<{5XyMlnCl7C%AjM3XnWvVz z{NoFsX)JB)SoqABZxUa*Yq+^^(cbq4mL%^lO12c${z{pf+)|kTTI~nQywyYF6}6|8 zlsN9&{-vwTrTyu<5^90_AsIU-ID#ZG@6d%poU44<**%xVe?`uxf}_Mr$SLHLS|K_N zQnw>(Lr2U=%$-<2D~RSzbG)2W2u^KMDnFFE?GmmbQ)V)fty957F`4OvQ_25E68ITr z5?`suu`|v?r!y=gFOGj$%9IJ zuTP=&2GcnoZZ0qSe6YL-*-lg>Q#>?Ew`a=GDc4vI#<1sNdKn?n7iSj0Orl$-#FMFi zykr>X-Xvi>sVr;92+8*H!r|3L$#o~hXa0z>AmF=z z?|@FF;*S|S0yqsw0j>Z(3mX-HD!|{N-vYc9paC8Ld=|6?00!6(_%lERupO`&um*4k z0b~W>e*uhTe4;V;mq>(ox$9FB`wLt!*DKj~!aOh|fL&#Pg*b??tm%5~_6M#02wqeC zS~wO>TWGnSp^r<0&8f2V6W->w=C+p~daC5e5wNQM*(* z66^}b0(!q3)zq$mu&VnbR#nr3;h5DS*o7{y66=!#;Dy4$pd1ZH<6WEOi0oJ8SxRL* z*v-9@Z^2w%^S(w5dO{_9Duby%2RT~;ppxaE$l()x6&}>7Wcg=u_&>f`Vs8OJGTy{X z2HpG=ThJz<{%|4Qq-~ad0qcrc87n88DHpM(nypwXIkZn<{zIT$ul&BQ?{ApCAZtyr zs2YpNt@x(G*faTU*HCKnAk(G=Tl~>r1QK8LY~J8mFFGoN5iIkYSwlm4Lsj#g4dsE5 zU-4;*Kdh-zv!rT4N$O}Q&n)?v0-9Y)lRFz58^P-KtKonzrfQ1p@0V_10^0||cGRn9 zRG<-#_TEV2nn4{BOh{YVBR4e!V!D?0K%BAlQN!D%M#k1bHypiIHT)5tlj>p0Pp_;+ z!cqC-JIs@JRhB+#teGs$Cib_=(yjRo4OJg^YPg%58aJVsC(LQ?W6%pn!-#aMZwoPcopo^Rn6BE z3=c5&W5~pP(C(-2r;PnH-S0{F`runM0ERCf3rESX$+S(MKOXmKJL9zXF}9-lf^xUs z+bb)+P%L&gV@<4q{6w^xEJ>Y>TQFUeoz0o-yq)jUqww=?wjUO8Y{a5G;DJ0Jr!LL+ zWhgsLuzi&eDrGDn$2DJwpFfH-?SGWbr>qRb?v{P`_%)So)CQgzO^HQ%;y#tJ=knH4 z95jX;^bF#BiuTH^%-j}{9VrZD=R%Q%wselH^p>5 z7d>gWB-st&3Fj%Mt*|tR5iK3J=`xhs&G)I7E>`FO@o7L z@S$B!pYMuzz5DN@X!O4DPm5n@raPJn-Q#o*m*e^5lk$g?0esg%$;>g5QW-|;c=H2GM}bo2tW^D924wmOkrUbWxcQ# z#v6bP%Tdfe~jtCRzAL;-OahZ=#yvUixu2-9fD2j$*|YY`F?0wF-{a# ztr<&kZjZ+81}6ZESqtgW)8kP#s@VLTSUR{}6?U^R*x7RE3Rl&n=VnFFqg9Uqz1n@N9N|=9<4} zuJfy^+}|D9X&vm3MAdqmu0&UMd^=K>b1hLAm_E!$rZC2b;;T~Dl zI`Eo_yRY76uM})|6wk9->of(=9&4jLv5#p@OzS~Yl>@pG)^>6`R+KtL{<4ly4o9WiM!%p_pfROU354)e8PIeE z1_s?#;OX6waNvvb&UQRN(WLbR+}&b#jo&WY-LlwCX}Q*$jGuKYuOGoIoyR(>e}}ix z+t}Q^cEcC8Y{@h}>HmJ^gD!l@gzwHmiBKl26x_lZVZG2UY!`w;RJd122;US&geQdW z3Qq}R!gIo5;ka;0I4c-Jq5X6A6?VzK&c4y!ZXdAUYu{r}*!SBXw?Aor+J4-A(*COb zb^CwV-?3k`zi-cX*c`VzL`RLI(b4MgIrGN z%ojf`E*6)Gg1A9!7q^N##2zsss^V9~-Qt7d!{UDNZ^XY9pA^3@9ui*?e=7c5d`nD; z?}~R(p>y1Kw!>|X4ycYEAkcZa*n-R%y! zqi)Up756UpqwfE7=hfigw$k~G@25gaxF9UGTkV>C(7x1Rbx4jb#|}rxq0vQ!n-c#f J0sQ~1{4brj`U(I5 diff --git a/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.bash b/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.bash deleted file mode 100644 index 64c6a338..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.bash +++ /dev/null @@ -1,94 +0,0 @@ -# This file is part of the Symfony package. -# -# (c) Fabien Potencier -# -# For the full copyright and license information, please view -# https://symfony.com/doc/current/contributing/code/license.html - -_sf_{{ COMMAND_NAME }}() { - - # Use the default completion for shell redirect operators. - for w in '>' '>>' '&>' '<'; do - if [[ $w = "${COMP_WORDS[COMP_CWORD-1]}" ]]; then - compopt -o filenames - COMPREPLY=($(compgen -f -- "${COMP_WORDS[COMP_CWORD]}")) - return 0 - fi - done - - # Use newline as only separator to allow space in completion values - local IFS=$'\n' - local sf_cmd="${COMP_WORDS[0]}" - - # for an alias, get the real script behind it - sf_cmd_type=$(type -t $sf_cmd) - if [[ $sf_cmd_type == "alias" ]]; then - sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/") - elif [[ $sf_cmd_type == "file" ]]; then - sf_cmd=$(type -p $sf_cmd) - fi - - if [[ $sf_cmd_type != "function" && ! -x $sf_cmd ]]; then - return 1 - fi - - local cur prev words cword - _get_comp_words_by_ref -n := cur prev words cword - - local completecmd=("$sf_cmd" "_complete" "--no-interaction" "-sbash" "-c$cword" "-a{{ VERSION }}") - for w in ${words[@]}; do - w=$(printf -- '%b' "$w") - # remove quotes from typed values - quote="${w:0:1}" - if [ "$quote" == \' ]; then - w="${w%\'}" - w="${w#\'}" - elif [ "$quote" == \" ]; then - w="${w%\"}" - w="${w#\"}" - fi - # empty values are ignored - if [ ! -z "$w" ]; then - completecmd+=("-i$w") - fi - done - - local sfcomplete - if sfcomplete=$(${completecmd[@]} 2>&1); then - local quote suggestions - quote=${cur:0:1} - - # Use single quotes by default if suggestions contains backslash (FQCN) - if [ "$quote" == '' ] && [[ "$sfcomplete" =~ \\ ]]; then - quote=\' - fi - - if [ "$quote" == \' ]; then - # single quotes: no additional escaping (does not accept ' in values) - suggestions=$(for s in $sfcomplete; do printf $'%q%q%q\n' "$quote" "$s" "$quote"; done) - elif [ "$quote" == \" ]; then - # double quotes: double escaping for \ $ ` " - suggestions=$(for s in $sfcomplete; do - s=${s//\\/\\\\} - s=${s//\$/\\\$} - s=${s//\`/\\\`} - s=${s//\"/\\\"} - printf $'%q%q%q\n' "$quote" "$s" "$quote"; - done) - else - # no quotes: double escaping - suggestions=$(for s in $sfcomplete; do printf $'%q\n' $(printf '%q' "$s"); done) - fi - COMPREPLY=($(IFS=$'\n' compgen -W "$suggestions" -- $(printf -- "%q" "$cur"))) - __ltrim_colon_completions "$cur" - else - if [[ "$sfcomplete" != *"Command \"_complete\" is not defined."* ]]; then - >&2 echo - >&2 echo $sfcomplete - fi - - return 1 - fi -} - -complete -F _sf_{{ COMMAND_NAME }} {{ COMMAND_NAME }} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.fish b/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.fish deleted file mode 100644 index 1853dd80..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.fish +++ /dev/null @@ -1,25 +0,0 @@ -# This file is part of the Symfony package. -# -# (c) Fabien Potencier -# -# For the full copyright and license information, please view -# https://symfony.com/doc/current/contributing/code/license.html - -function _sf_{{ COMMAND_NAME }} - set sf_cmd (commandline -o) - set c (count (commandline -oc)) - - set completecmd "$sf_cmd[1]" "_complete" "--no-interaction" "-sfish" "-a{{ VERSION }}" - - for i in $sf_cmd - if [ $i != "" ] - set completecmd $completecmd "-i$i" - end - end - - set completecmd $completecmd "-c$c" - - $completecmd -end - -complete -c '{{ COMMAND_NAME }}' -a '(_sf_{{ COMMAND_NAME }})' -f diff --git a/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.zsh b/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.zsh deleted file mode 100644 index ff76fe5f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Resources/completion.zsh +++ /dev/null @@ -1,82 +0,0 @@ -#compdef {{ COMMAND_NAME }} - -# This file is part of the Symfony package. -# -# (c) Fabien Potencier -# -# For the full copyright and license information, please view -# https://symfony.com/doc/current/contributing/code/license.html - -# -# zsh completions for {{ COMMAND_NAME }} -# -# References: -# - https://github.com/spf13/cobra/blob/master/zsh_completions.go -# - https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Console/Resources/completion.bash -# -_sf_{{ COMMAND_NAME }}() { - local lastParam flagPrefix requestComp out comp - local -a completions - - # The user could have moved the cursor backwards on the command-line. - # We need to trigger completion from the $CURRENT location, so we need - # to truncate the command-line ($words) up to the $CURRENT location. - # (We cannot use $CURSOR as its value does not work when a command is an alias.) - words=("${=words[1,CURRENT]}") lastParam=${words[-1]} - - # For zsh, when completing a flag with an = (e.g., {{ COMMAND_NAME }} -n=) - # completions must be prefixed with the flag - setopt local_options BASH_REMATCH - if [[ "${lastParam}" =~ '-.*=' ]]; then - # We are dealing with a flag with an = - flagPrefix="-P ${BASH_REMATCH}" - fi - - # Prepare the command to obtain completions - requestComp="${words[0]} ${words[1]} _complete --no-interaction -szsh -a{{ VERSION }} -c$((CURRENT-1))" i="" - for w in ${words[@]}; do - w=$(printf -- '%b' "$w") - # remove quotes from typed values - quote="${w:0:1}" - if [ "$quote" = \' ]; then - w="${w%\'}" - w="${w#\'}" - elif [ "$quote" = \" ]; then - w="${w%\"}" - w="${w#\"}" - fi - # empty values are ignored - if [ ! -z "$w" ]; then - i="${i}-i${w} " - fi - done - - # Ensure at least 1 input - if [ "${i}" = "" ]; then - requestComp="${requestComp} -i\" \"" - else - requestComp="${requestComp} ${i}" - fi - - # Use eval to handle any environment variables and such - out=$(eval ${requestComp} 2>/dev/null) - - while IFS='\n' read -r comp; do - if [ -n "$comp" ]; then - # If requested, completions are returned with a description. - # The description is preceded by a TAB character. - # For zsh's _describe, we need to use a : instead of a TAB. - # We first need to escape any : as part of the completion itself. - comp=${comp//:/\\:} - local tab=$(printf '\t') - comp=${comp//$tab/:} - completions+=${comp} - fi - done < <(printf "%s\n" "${out[@]}") - - # Let inbuilt _describe handle completions - eval _describe "completions" completions $flagPrefix - return $? -} - -compdef _sf_{{ COMMAND_NAME }} {{ COMMAND_NAME }} diff --git a/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalMap.php b/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalMap.php deleted file mode 100644 index de419bda..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalMap.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\SignalRegistry; - -/** - * @author Grégoire Pineau - */ -class SignalMap -{ - private static array $map; - - public static function getSignalName(int $signal): ?string - { - if (!\extension_loaded('pcntl')) { - return null; - } - - if (!isset(self::$map)) { - $r = new \ReflectionExtension('pcntl'); - $c = $r->getConstants(); - $map = array_filter($c, fn ($k) => str_starts_with($k, 'SIG') && !str_starts_with($k, 'SIG_'), \ARRAY_FILTER_USE_KEY); - self::$map = array_flip($map); - } - - return self::$map[$signal] ?? null; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalRegistry.php b/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalRegistry.php deleted file mode 100644 index 8c2939ee..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/SignalRegistry/SignalRegistry.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\SignalRegistry; - -final class SignalRegistry -{ - private array $signalHandlers = []; - - public function __construct() - { - if (\function_exists('pcntl_async_signals')) { - pcntl_async_signals(true); - } - } - - public function register(int $signal, callable $signalHandler): void - { - if (!isset($this->signalHandlers[$signal])) { - $previousCallback = pcntl_signal_get_handler($signal); - - if (\is_callable($previousCallback)) { - $this->signalHandlers[$signal][] = $previousCallback; - } - } - - $this->signalHandlers[$signal][] = $signalHandler; - - pcntl_signal($signal, $this->handle(...)); - } - - public static function isSupported(): bool - { - return \function_exists('pcntl_signal'); - } - - /** - * @internal - */ - public function handle(int $signal): void - { - $count = \count($this->signalHandlers[$signal]); - - foreach ($this->signalHandlers[$signal] as $i => $signalHandler) { - $hasNext = $i !== $count - 1; - $signalHandler($signal, $hasNext); - } - } - - /** - * @internal - */ - public function scheduleAlarm(int $seconds): void - { - pcntl_alarm($seconds); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/SingleCommandApplication.php b/tools/php-cs-fixer/vendor/symfony/console/SingleCommandApplication.php deleted file mode 100644 index 2b54fb87..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/SingleCommandApplication.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Grégoire Pineau - */ -class SingleCommandApplication extends Command -{ - private string $version = 'UNKNOWN'; - private bool $autoExit = true; - private bool $running = false; - - /** - * @return $this - */ - public function setVersion(string $version): static - { - $this->version = $version; - - return $this; - } - - /** - * @final - * - * @return $this - */ - public function setAutoExit(bool $autoExit): static - { - $this->autoExit = $autoExit; - - return $this; - } - - public function run(?InputInterface $input = null, ?OutputInterface $output = null): int - { - if ($this->running) { - return parent::run($input, $output); - } - - // We use the command name as the application name - $application = new Application($this->getName() ?: 'UNKNOWN', $this->version); - $application->setAutoExit($this->autoExit); - // Fix the usage of the command displayed with "--help" - $this->setName($_SERVER['argv'][0]); - $application->add($this); - $application->setDefaultCommand($this->getName(), true); - - $this->running = true; - try { - $ret = $application->run($input, $output); - } finally { - $this->running = false; - } - - return $ret; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Style/OutputStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Style/OutputStyle.php deleted file mode 100644 index 89a3a417..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Style/OutputStyle.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Decorates output to add console style guide helpers. - * - * @author Kevin Bond - */ -abstract class OutputStyle implements OutputInterface, StyleInterface -{ - public function __construct( - private OutputInterface $output, - ) { - } - - public function newLine(int $count = 1): void - { - $this->output->write(str_repeat(\PHP_EOL, $count)); - } - - public function createProgressBar(int $max = 0): ProgressBar - { - return new ProgressBar($this->output, $max); - } - - public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL): void - { - $this->output->write($messages, $newline, $type); - } - - public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL): void - { - $this->output->writeln($messages, $type); - } - - public function setVerbosity(int $level): void - { - $this->output->setVerbosity($level); - } - - public function getVerbosity(): int - { - return $this->output->getVerbosity(); - } - - public function setDecorated(bool $decorated): void - { - $this->output->setDecorated($decorated); - } - - public function isDecorated(): bool - { - return $this->output->isDecorated(); - } - - public function setFormatter(OutputFormatterInterface $formatter): void - { - $this->output->setFormatter($formatter); - } - - public function getFormatter(): OutputFormatterInterface - { - return $this->output->getFormatter(); - } - - public function isSilent(): bool - { - // @deprecated since Symfony 7.2, change to $this->output->isSilent() in 8.0 - return method_exists($this->output, 'isSilent') ? $this->output->isSilent() : self::VERBOSITY_SILENT === $this->output->getVerbosity(); - } - - public function isQuiet(): bool - { - return $this->output->isQuiet(); - } - - public function isVerbose(): bool - { - return $this->output->isVerbose(); - } - - public function isVeryVerbose(): bool - { - return $this->output->isVeryVerbose(); - } - - public function isDebug(): bool - { - return $this->output->isDebug(); - } - - protected function getErrorOutput(): OutputInterface - { - if (!$this->output instanceof ConsoleOutputInterface) { - return $this->output; - } - - return $this->output->getErrorOutput(); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Style/StyleInterface.php b/tools/php-cs-fixer/vendor/symfony/console/Style/StyleInterface.php deleted file mode 100644 index fcc5bc77..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Style/StyleInterface.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -/** - * Output style helpers. - * - * @author Kevin Bond - */ -interface StyleInterface -{ - /** - * Formats a command title. - */ - public function title(string $message): void; - - /** - * Formats a section title. - */ - public function section(string $message): void; - - /** - * Formats a list. - */ - public function listing(array $elements): void; - - /** - * Formats informational text. - */ - public function text(string|array $message): void; - - /** - * Formats a success result bar. - */ - public function success(string|array $message): void; - - /** - * Formats an error result bar. - */ - public function error(string|array $message): void; - - /** - * Formats an warning result bar. - */ - public function warning(string|array $message): void; - - /** - * Formats a note admonition. - */ - public function note(string|array $message): void; - - /** - * Formats a caution admonition. - */ - public function caution(string|array $message): void; - - /** - * Formats a table. - */ - public function table(array $headers, array $rows): void; - - /** - * Asks a question. - */ - public function ask(string $question, ?string $default = null, ?callable $validator = null): mixed; - - /** - * Asks a question with the user input hidden. - */ - public function askHidden(string $question, ?callable $validator = null): mixed; - - /** - * Asks for confirmation. - */ - public function confirm(string $question, bool $default = true): bool; - - /** - * Asks a choice question. - */ - public function choice(string $question, array $choices, mixed $default = null): mixed; - - /** - * Add newline(s). - */ - public function newLine(int $count = 1): void; - - /** - * Starts the progress output. - */ - public function progressStart(int $max = 0): void; - - /** - * Advances the progress output X steps. - */ - public function progressAdvance(int $step = 1): void; - - /** - * Finishes the progress output. - */ - public function progressFinish(): void; -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Style/SymfonyStyle.php b/tools/php-cs-fixer/vendor/symfony/console/Style/SymfonyStyle.php deleted file mode 100644 index 4cf62cdb..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Style/SymfonyStyle.php +++ /dev/null @@ -1,455 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Helper\OutputWrapper; -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Helper\SymfonyQuestionHelper; -use Symfony\Component\Console\Helper\Table; -use Symfony\Component\Console\Helper\TableCell; -use Symfony\Component\Console\Helper\TableSeparator; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\TrimmedBufferOutput; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Terminal; - -/** - * Output decorator helpers for the Symfony Style Guide. - * - * @author Kevin Bond - */ -class SymfonyStyle extends OutputStyle -{ - public const MAX_LINE_LENGTH = 120; - - private SymfonyQuestionHelper $questionHelper; - private ProgressBar $progressBar; - private int $lineLength; - private TrimmedBufferOutput $bufferedOutput; - - public function __construct( - private InputInterface $input, - private OutputInterface $output, - ) { - $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), false, clone $output->getFormatter()); - // Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not. - $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH; - $this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH); - - parent::__construct($output); - } - - /** - * Formats a message as a block of text. - */ - public function block(string|array $messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true): void - { - $messages = \is_array($messages) ? array_values($messages) : [$messages]; - - $this->autoPrependBlock(); - $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape)); - $this->newLine(); - } - - public function title(string $message): void - { - $this->autoPrependBlock(); - $this->writeln([ - \sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - \sprintf('%s', str_repeat('=', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), - ]); - $this->newLine(); - } - - public function section(string $message): void - { - $this->autoPrependBlock(); - $this->writeln([ - \sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - \sprintf('%s', str_repeat('-', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), - ]); - $this->newLine(); - } - - public function listing(array $elements): void - { - $this->autoPrependText(); - $elements = array_map(fn ($element) => \sprintf(' * %s', $element), $elements); - - $this->writeln($elements); - $this->newLine(); - } - - public function text(string|array $message): void - { - $this->autoPrependText(); - - $messages = \is_array($message) ? array_values($message) : [$message]; - foreach ($messages as $message) { - $this->writeln(\sprintf(' %s', $message)); - } - } - - /** - * Formats a command comment. - */ - public function comment(string|array $message): void - { - $this->block($message, null, null, ' // ', false, false); - } - - public function success(string|array $message): void - { - $this->block($message, 'OK', 'fg=black;bg=green', ' ', true); - } - - public function error(string|array $message): void - { - $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true); - } - - public function warning(string|array $message): void - { - $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); - } - - public function note(string|array $message): void - { - $this->block($message, 'NOTE', 'fg=yellow', ' ! '); - } - - /** - * Formats an info message. - */ - public function info(string|array $message): void - { - $this->block($message, 'INFO', 'fg=green', ' ', true); - } - - public function caution(string|array $message): void - { - $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true); - } - - public function table(array $headers, array $rows): void - { - $this->createTable() - ->setHeaders($headers) - ->setRows($rows) - ->render() - ; - - $this->newLine(); - } - - /** - * Formats a horizontal table. - */ - public function horizontalTable(array $headers, array $rows): void - { - $this->createTable() - ->setHorizontal(true) - ->setHeaders($headers) - ->setRows($rows) - ->render() - ; - - $this->newLine(); - } - - /** - * Formats a list of key/value horizontally. - * - * Each row can be one of: - * * 'A title' - * * ['key' => 'value'] - * * new TableSeparator() - */ - public function definitionList(string|array|TableSeparator ...$list): void - { - $headers = []; - $row = []; - foreach ($list as $value) { - if ($value instanceof TableSeparator) { - $headers[] = $value; - $row[] = $value; - continue; - } - if (\is_string($value)) { - $headers[] = new TableCell($value, ['colspan' => 2]); - $row[] = null; - continue; - } - if (!\is_array($value)) { - throw new InvalidArgumentException('Value should be an array, string, or an instance of TableSeparator.'); - } - $headers[] = key($value); - $row[] = current($value); - } - - $this->horizontalTable($headers, [$row]); - } - - public function ask(string $question, ?string $default = null, ?callable $validator = null): mixed - { - $question = new Question($question, $default); - $question->setValidator($validator); - - return $this->askQuestion($question); - } - - public function askHidden(string $question, ?callable $validator = null): mixed - { - $question = new Question($question); - - $question->setHidden(true); - $question->setValidator($validator); - - return $this->askQuestion($question); - } - - public function confirm(string $question, bool $default = true): bool - { - return $this->askQuestion(new ConfirmationQuestion($question, $default)); - } - - public function choice(string $question, array $choices, mixed $default = null, bool $multiSelect = false): mixed - { - if (null !== $default) { - $values = array_flip($choices); - $default = $values[$default] ?? $default; - } - - $questionChoice = new ChoiceQuestion($question, $choices, $default); - $questionChoice->setMultiselect($multiSelect); - - return $this->askQuestion($questionChoice); - } - - public function progressStart(int $max = 0): void - { - $this->progressBar = $this->createProgressBar($max); - $this->progressBar->start(); - } - - public function progressAdvance(int $step = 1): void - { - $this->getProgressBar()->advance($step); - } - - public function progressFinish(): void - { - $this->getProgressBar()->finish(); - $this->newLine(2); - unset($this->progressBar); - } - - public function createProgressBar(int $max = 0): ProgressBar - { - $progressBar = parent::createProgressBar($max); - - if ('\\' !== \DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) { - $progressBar->setEmptyBarCharacter('░'); // light shade character \u2591 - $progressBar->setProgressCharacter(''); - $progressBar->setBarCharacter('▓'); // dark shade character \u2593 - } - - return $progressBar; - } - - /** - * @see ProgressBar::iterate() - * - * @template TKey - * @template TValue - * - * @param iterable $iterable - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable - * - * @return iterable - */ - public function progressIterate(iterable $iterable, ?int $max = null): iterable - { - yield from $this->createProgressBar()->iterate($iterable, $max); - - $this->newLine(2); - } - - public function askQuestion(Question $question): mixed - { - if ($this->input->isInteractive()) { - $this->autoPrependBlock(); - } - - $this->questionHelper ??= new SymfonyQuestionHelper(); - - $answer = $this->questionHelper->ask($this->input, $this, $question); - - if ($this->input->isInteractive()) { - if ($this->output instanceof ConsoleSectionOutput) { - // add the new line of the `return` to submit the input to ConsoleSectionOutput, because ConsoleSectionOutput is holding all it's lines. - // this is relevant when a `ConsoleSectionOutput::clear` is called. - $this->output->addNewLineOfInputSubmit(); - } - $this->newLine(); - $this->bufferedOutput->write("\n"); - } - - return $answer; - } - - public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL): void - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::writeln($message, $type); - $this->writeBuffer($message, true, $type); - } - } - - public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL): void - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::write($message, $newline, $type); - $this->writeBuffer($message, $newline, $type); - } - } - - public function newLine(int $count = 1): void - { - parent::newLine($count); - $this->bufferedOutput->write(str_repeat("\n", $count)); - } - - /** - * Returns a new instance which makes use of stderr if available. - */ - public function getErrorStyle(): self - { - return new self($this->input, $this->getErrorOutput()); - } - - public function createTable(): Table - { - $output = $this->output instanceof ConsoleOutputInterface ? $this->output->section() : $this->output; - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); - - return (new Table($output))->setStyle($style); - } - - private function getProgressBar(): ProgressBar - { - return $this->progressBar - ?? throw new RuntimeException('The ProgressBar is not started.'); - } - - private function autoPrependBlock(): void - { - $chars = substr(str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2); - - if (!isset($chars[0])) { - $this->newLine(); // empty history, so we should start with a new line. - - return; - } - // Prepend new line for each non LF chars (This means no blank line was output before) - $this->newLine(2 - substr_count($chars, "\n")); - } - - private function autoPrependText(): void - { - $fetched = $this->bufferedOutput->fetch(); - // Prepend new line if last char isn't EOL: - if ($fetched && !str_ends_with($fetched, "\n")) { - $this->newLine(); - } - } - - private function writeBuffer(string $message, bool $newLine, int $type): void - { - // We need to know if the last chars are PHP_EOL - $this->bufferedOutput->write($message, $newLine, $type); - } - - private function createBlock(iterable $messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array - { - $indentLength = 0; - $prefixLength = Helper::width(Helper::removeDecoration($this->getFormatter(), $prefix)); - $lines = []; - - if (null !== $type) { - $type = \sprintf('[%s] ', $type); - $indentLength = Helper::width($type); - $lineIndentation = str_repeat(' ', $indentLength); - } - - // wrap and add newlines for each element - $outputWrapper = new OutputWrapper(); - foreach ($messages as $key => $message) { - if ($escape) { - $message = OutputFormatter::escape($message); - } - - $lines = array_merge( - $lines, - explode(\PHP_EOL, $outputWrapper->wrap( - $message, - $this->lineLength - $prefixLength - $indentLength, - \PHP_EOL - )) - ); - - if (\count($messages) > 1 && $key < \count($messages) - 1) { - $lines[] = ''; - } - } - - $firstLineIndex = 0; - if ($padding && $this->isDecorated()) { - $firstLineIndex = 1; - array_unshift($lines, ''); - $lines[] = ''; - } - - foreach ($lines as $i => &$line) { - if (null !== $type) { - $line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line; - } - - $line = $prefix.$line; - $line .= str_repeat(' ', max($this->lineLength - Helper::width(Helper::removeDecoration($this->getFormatter(), $line)), 0)); - - if ($style) { - $line = \sprintf('<%s>%s', $style, $line); - } - } - - return $lines; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Terminal.php b/tools/php-cs-fixer/vendor/symfony/console/Terminal.php deleted file mode 100644 index 80f25443..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Terminal.php +++ /dev/null @@ -1,227 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Output\AnsiColorMode; - -class Terminal -{ - public const DEFAULT_COLOR_MODE = AnsiColorMode::Ansi4; - - private static ?AnsiColorMode $colorMode = null; - private static ?int $width = null; - private static ?int $height = null; - private static ?bool $stty = null; - - /** - * About Ansi color types: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors - * For more information about true color support with terminals https://github.com/termstandard/colors/. - */ - public static function getColorMode(): AnsiColorMode - { - // Use Cache from previous run (or user forced mode) - if (null !== self::$colorMode) { - return self::$colorMode; - } - - // Try with $COLORTERM first - if (\is_string($colorterm = getenv('COLORTERM'))) { - $colorterm = strtolower($colorterm); - - if (str_contains($colorterm, 'truecolor')) { - self::setColorMode(AnsiColorMode::Ansi24); - - return self::$colorMode; - } - - if (str_contains($colorterm, '256color')) { - self::setColorMode(AnsiColorMode::Ansi8); - - return self::$colorMode; - } - } - - // Try with $TERM - if (\is_string($term = getenv('TERM'))) { - $term = strtolower($term); - - if (str_contains($term, 'truecolor')) { - self::setColorMode(AnsiColorMode::Ansi24); - - return self::$colorMode; - } - - if (str_contains($term, '256color')) { - self::setColorMode(AnsiColorMode::Ansi8); - - return self::$colorMode; - } - } - - self::setColorMode(self::DEFAULT_COLOR_MODE); - - return self::$colorMode; - } - - /** - * Force a terminal color mode rendering. - */ - public static function setColorMode(?AnsiColorMode $colorMode): void - { - self::$colorMode = $colorMode; - } - - /** - * Gets the terminal width. - */ - public function getWidth(): int - { - $width = getenv('COLUMNS'); - if (false !== $width) { - return (int) trim($width); - } - - if (null === self::$width) { - self::initDimensions(); - } - - return self::$width ?: 80; - } - - /** - * Gets the terminal height. - */ - public function getHeight(): int - { - $height = getenv('LINES'); - if (false !== $height) { - return (int) trim($height); - } - - if (null === self::$height) { - self::initDimensions(); - } - - return self::$height ?: 50; - } - - /** - * @internal - */ - public static function hasSttyAvailable(): bool - { - if (null !== self::$stty) { - return self::$stty; - } - - // skip check if shell_exec function is disabled - if (!\function_exists('shell_exec')) { - return false; - } - - return self::$stty = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); - } - - private static function initDimensions(): void - { - if ('\\' === \DIRECTORY_SEPARATOR) { - $ansicon = getenv('ANSICON'); - if (false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim($ansicon), $matches)) { - // extract [w, H] from "wxh (WxH)" - // or [w, h] from "wxh" - self::$width = (int) $matches[1]; - self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2]; - } elseif (!sapi_windows_vt100_support(fopen('php://stdout', 'w')) && self::hasSttyAvailable()) { - // only use stty on Windows if the terminal does not support vt100 (e.g. Windows 7 + git-bash) - // testing for stty in a Windows 10 vt100-enabled console will implicitly disable vt100 support on STDOUT - self::initDimensionsUsingStty(); - } elseif (null !== $dimensions = self::getConsoleMode()) { - // extract [w, h] from "wxh" - self::$width = (int) $dimensions[0]; - self::$height = (int) $dimensions[1]; - } - } else { - self::initDimensionsUsingStty(); - } - } - - /** - * Initializes dimensions using the output of an stty columns line. - */ - private static function initDimensionsUsingStty(): void - { - if ($sttyString = self::getSttyColumns()) { - if (preg_match('/rows.(\d+);.columns.(\d+);/is', $sttyString, $matches)) { - // extract [w, h] from "rows h; columns w;" - self::$width = (int) $matches[2]; - self::$height = (int) $matches[1]; - } elseif (preg_match('/;.(\d+).rows;.(\d+).columns/is', $sttyString, $matches)) { - // extract [w, h] from "; h rows; w columns" - self::$width = (int) $matches[2]; - self::$height = (int) $matches[1]; - } - } - } - - /** - * Runs and parses mode CON if it's available, suppressing any error output. - * - * @return int[]|null An array composed of the width and the height or null if it could not be parsed - */ - private static function getConsoleMode(): ?array - { - $info = self::readFromProcess('mode CON'); - - if (null === $info || !preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { - return null; - } - - return [(int) $matches[2], (int) $matches[1]]; - } - - /** - * Runs and parses stty -a if it's available, suppressing any error output. - */ - private static function getSttyColumns(): ?string - { - return self::readFromProcess(['stty', '-a']); - } - - private static function readFromProcess(string|array $command): ?string - { - if (!\function_exists('proc_open')) { - return null; - } - - $descriptorspec = [ - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ]; - - $cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0; - - if (!$process = @proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true])) { - return null; - } - - $info = stream_get_contents($pipes[1]); - fclose($pipes[1]); - fclose($pipes[2]); - proc_close($process); - - if ($cp) { - sapi_windows_cp_set($cp); - } - - return $info; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Tester/ApplicationTester.php b/tools/php-cs-fixer/vendor/symfony/console/Tester/ApplicationTester.php deleted file mode 100644 index cebb6f8e..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Tester/ApplicationTester.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Input\ArrayInput; - -/** - * Eases the testing of console applications. - * - * When testing an application, don't forget to disable the auto exit flag: - * - * $application = new Application(); - * $application->setAutoExit(false); - * - * @author Fabien Potencier - */ -class ApplicationTester -{ - use TesterTrait; - - public function __construct( - private Application $application, - ) { - } - - /** - * Executes the application. - * - * Available options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - * - * @return int The command exit code - */ - public function run(array $input, array $options = []): int - { - $prevShellVerbosity = getenv('SHELL_VERBOSITY'); - - try { - $this->input = new ArrayInput($input); - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - if ($this->inputs) { - $this->input->setStream(self::createStream($this->inputs)); - } - - $this->initOutput($options); - - return $this->statusCode = $this->application->run($this->input, $this->output); - } finally { - // SHELL_VERBOSITY is set by Application::configureIO so we need to unset/reset it - // to its previous value to avoid one test's verbosity to spread to the following tests - if (false === $prevShellVerbosity) { - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY'); - } - unset($_ENV['SHELL_VERBOSITY']); - unset($_SERVER['SHELL_VERBOSITY']); - } else { - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY='.$prevShellVerbosity); - } - $_ENV['SHELL_VERBOSITY'] = $prevShellVerbosity; - $_SERVER['SHELL_VERBOSITY'] = $prevShellVerbosity; - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandCompletionTester.php b/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandCompletionTester.php deleted file mode 100644 index 76cbaf14..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandCompletionTester.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; - -/** - * Eases the testing of command completion. - * - * @author Jérôme Tamarelle - */ -class CommandCompletionTester -{ - public function __construct( - private Command $command, - ) { - } - - /** - * Create completion suggestions from input tokens. - */ - public function complete(array $input): array - { - $currentIndex = \count($input); - if ('' === end($input)) { - array_pop($input); - } - array_unshift($input, $this->command->getName()); - - $completionInput = CompletionInput::fromTokens($input, $currentIndex); - $completionInput->bind($this->command->getDefinition()); - $suggestions = new CompletionSuggestions(); - - $this->command->complete($completionInput, $suggestions); - - $options = []; - foreach ($suggestions->getOptionSuggestions() as $option) { - $options[] = '--'.$option->getName(); - } - - return array_map('strval', array_merge($options, $suggestions->getValueSuggestions())); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandTester.php b/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandTester.php deleted file mode 100644 index d39cde7f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Tester/CommandTester.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\ArrayInput; - -/** - * Eases the testing of console commands. - * - * @author Fabien Potencier - * @author Robin Chalas - */ -class CommandTester -{ - use TesterTrait; - - public function __construct( - private Command $command, - ) { - } - - /** - * Executes the command. - * - * Available execution options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - * - * @param array $input An array of command arguments and options - * @param array $options An array of execution options - * - * @return int The command exit code - */ - public function execute(array $input, array $options = []): int - { - // set the command name automatically if the application requires - // this argument and no command name was passed - if (!isset($input['command']) - && (null !== $application = $this->command->getApplication()) - && $application->getDefinition()->hasArgument('command') - ) { - $input = array_merge(['command' => $this->command->getName()], $input); - } - - $this->input = new ArrayInput($input); - // Use an in-memory input stream even if no inputs are set so that QuestionHelper::ask() does not rely on the blocking STDIN. - $this->input->setStream(self::createStream($this->inputs)); - - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - if (!isset($options['decorated'])) { - $options['decorated'] = false; - } - - $this->initOutput($options); - - return $this->statusCode = $this->command->run($this->input, $this->output); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php b/tools/php-cs-fixer/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php deleted file mode 100644 index d677c27a..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Console\Command\Command; - -final class CommandIsSuccessful extends Constraint -{ - public function toString(): string - { - return 'is successful'; - } - - protected function matches($other): bool - { - return Command::SUCCESS === $other; - } - - protected function failureDescription($other): string - { - return 'the command '.$this->toString(); - } - - protected function additionalFailureDescription($other): string - { - $mapping = [ - Command::FAILURE => 'Command failed.', - Command::INVALID => 'Command was invalid.', - ]; - - return $mapping[$other] ?? \sprintf('Command returned exit status %d.', $other); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/Tester/TesterTrait.php b/tools/php-cs-fixer/vendor/symfony/console/Tester/TesterTrait.php deleted file mode 100644 index 1ab7a70a..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/Tester/TesterTrait.php +++ /dev/null @@ -1,178 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use PHPUnit\Framework\Assert; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\StreamOutput; -use Symfony\Component\Console\Tester\Constraint\CommandIsSuccessful; - -/** - * @author Amrouche Hamza - */ -trait TesterTrait -{ - private StreamOutput $output; - private array $inputs = []; - private bool $captureStreamsIndependently = false; - private InputInterface $input; - private int $statusCode; - - /** - * Gets the display returned by the last execution of the command or application. - * - * @throws \RuntimeException If it's called before the execute method - */ - public function getDisplay(bool $normalize = false): string - { - if (!isset($this->output)) { - throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); - } - - rewind($this->output->getStream()); - - $display = stream_get_contents($this->output->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the output written to STDERR by the application. - * - * @param bool $normalize Whether to normalize end of lines to \n or not - */ - public function getErrorOutput(bool $normalize = false): string - { - if (!$this->captureStreamsIndependently) { - throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.'); - } - - rewind($this->output->getErrorOutput()->getStream()); - - $display = stream_get_contents($this->output->getErrorOutput()->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the input instance used by the last execution of the command or application. - */ - public function getInput(): InputInterface - { - return $this->input; - } - - /** - * Gets the output instance used by the last execution of the command or application. - */ - public function getOutput(): OutputInterface - { - return $this->output; - } - - /** - * Gets the status code returned by the last execution of the command or application. - * - * @throws \RuntimeException If it's called before the execute method - */ - public function getStatusCode(): int - { - return $this->statusCode ?? throw new \RuntimeException('Status code not initialized, did you execute the command before requesting the status code?'); - } - - public function assertCommandIsSuccessful(string $message = ''): void - { - Assert::assertThat($this->statusCode, new CommandIsSuccessful(), $message); - } - - /** - * Sets the user inputs. - * - * @param array $inputs An array of strings representing each input - * passed to the command input stream - * - * @return $this - */ - public function setInputs(array $inputs): static - { - $this->inputs = $inputs; - - return $this; - } - - /** - * Initializes the output property. - * - * Available options: - * - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - */ - private function initOutput(array $options): void - { - $this->captureStreamsIndependently = $options['capture_stderr_separately'] ?? false; - if (!$this->captureStreamsIndependently) { - $this->output = new StreamOutput(fopen('php://memory', 'w', false)); - if (isset($options['decorated'])) { - $this->output->setDecorated($options['decorated']); - } - if (isset($options['verbosity'])) { - $this->output->setVerbosity($options['verbosity']); - } - } else { - $this->output = new ConsoleOutput( - $options['verbosity'] ?? ConsoleOutput::VERBOSITY_NORMAL, - $options['decorated'] ?? null - ); - - $errorOutput = new StreamOutput(fopen('php://memory', 'w', false)); - $errorOutput->setFormatter($this->output->getFormatter()); - $errorOutput->setVerbosity($this->output->getVerbosity()); - $errorOutput->setDecorated($this->output->isDecorated()); - - $reflectedOutput = new \ReflectionObject($this->output); - $strErrProperty = $reflectedOutput->getProperty('stderr'); - $strErrProperty->setValue($this->output, $errorOutput); - - $reflectedParent = $reflectedOutput->getParentClass(); - $streamProperty = $reflectedParent->getProperty('stream'); - $streamProperty->setValue($this->output, fopen('php://memory', 'w', false)); - } - } - - /** - * @return resource - */ - private static function createStream(array $inputs) - { - $stream = fopen('php://memory', 'r+', false); - - foreach ($inputs as $input) { - fwrite($stream, $input.\PHP_EOL); - } - - rewind($stream); - - return $stream; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/console/composer.json b/tools/php-cs-fixer/vendor/symfony/console/composer.json deleted file mode 100644 index 0ed1bd9a..00000000 --- a/tools/php-cs-fixer/vendor/symfony/console/composer.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "symfony/console", - "type": "library", - "description": "Eases the creation of beautiful and testable command line interfaces", - "keywords": ["console", "cli", "command-line", "terminal"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.2", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^6.4|^7.0" - }, - "require-dev": { - "symfony/config": "^6.4|^7.0", - "symfony/event-dispatcher": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/lock": "^6.4|^7.0", - "symfony/messenger": "^6.4|^7.0", - "symfony/process": "^6.4|^7.0", - "symfony/stopwatch": "^6.4|^7.0", - "symfony/var-dumper": "^6.4|^7.0", - "psr/log": "^1|^2|^3" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "conflict": { - "symfony/dependency-injection": "<6.4", - "symfony/dotenv": "<6.4", - "symfony/event-dispatcher": "<6.4", - "symfony/lock": "<6.4", - "symfony/process": "<6.4" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Console\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e261..00000000 --- a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/LICENSE b/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/LICENSE deleted file mode 100644 index 0ed3a246..00000000 --- a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/README.md b/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/README.md deleted file mode 100644 index 9814864c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -Symfony Deprecation Contracts -============================= - -A generic function and convention to trigger deprecation notices. - -This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. - -By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, -the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. - -The function requires at least 3 arguments: - - the name of the Composer package that is triggering the deprecation - - the version of the package that introduced the deprecation - - the message of the deprecation - - more arguments can be provided: they will be inserted in the message using `printf()` formatting - -Example: -```php -trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); -``` - -This will generate the following message: -`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` - -While not recommended, the deprecation notices can be completely ignored by declaring an empty -`function trigger_deprecation() {}` in your application. diff --git a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/composer.json b/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/composer.json deleted file mode 100644 index ceb6c079..00000000 --- a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/deprecation-contracts", - "type": "library", - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1" - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/function.php b/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/function.php deleted file mode 100644 index 2d56512b..00000000 --- a/tools/php-cs-fixer/vendor/symfony/deprecation-contracts/function.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!function_exists('trigger_deprecation')) { - /** - * Triggers a silenced deprecation notice. - * - * @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 message of the deprecation - * @param mixed ...$args Values to insert in the message using printf() formatting - * - * @author Nicolas Grekas - */ - function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void - { - @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/CHANGELOG.md deleted file mode 100644 index 7932e261..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/Event.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/Event.php deleted file mode 100644 index 2e7f9989..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/Event.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\EventDispatcher; - -use Psr\EventDispatcher\StoppableEventInterface; - -/** - * Event is the base class for classes containing event data. - * - * This class contains no event data. It is used by events that do not pass - * state information to an event handler when an event is raised. - * - * You can call the method stopPropagation() to abort the execution of - * further listeners in your event listener. - * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - * @author Nicolas Grekas - */ -class Event implements StoppableEventInterface -{ - private bool $propagationStopped = false; - - public function isPropagationStopped(): bool - { - return $this->propagationStopped; - } - - /** - * Stops the propagation of the event to further event listeners. - * - * If multiple event listeners are connected to the same event, no - * further event listener will be triggered once any trigger calls - * stopPropagation(). - */ - public function stopPropagation(): void - { - $this->propagationStopped = true; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php deleted file mode 100644 index 2d7840d3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\EventDispatcher; - -use Psr\EventDispatcher\EventDispatcherInterface as PsrEventDispatcherInterface; - -/** - * Allows providing hooks on domain-specific lifecycles by dispatching events. - */ -interface EventDispatcherInterface extends PsrEventDispatcherInterface -{ - /** - * Dispatches an event to all registered listeners. - * - * @template T of object - * - * @param T $event The event to pass to the event handlers/listeners - * @param string|null $eventName The name of the event to dispatch. If not supplied, - * the class of $event should be used instead. - * - * @return T The passed $event MUST be returned - */ - public function dispatch(object $event, ?string $eventName = null): object; -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/LICENSE b/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/LICENSE deleted file mode 100644 index 7536caea..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/README.md b/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/README.md deleted file mode 100644 index 332b961c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Symfony EventDispatcher Contracts -================================= - -A set of abstractions extracted out of the Symfony components. - -Can be used to build on semantics that the Symfony components proved useful and -that already have battle tested implementations. - -See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/composer.json b/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/composer.json deleted file mode 100644 index 35956eb8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/event-dispatcher-contracts", - "type": "library", - "description": "Generic abstractions related to dispatching event", - "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "psr/event-dispatcher": "^1" - }, - "autoload": { - "psr-4": { "Symfony\\Contracts\\EventDispatcher\\": "" } - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php deleted file mode 100644 index 590ada9e..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\Attribute; - -/** - * Service tag to autoconfigure event listeners. - * - * @author Alexander M. Turek - */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class AsEventListener -{ - /** - * @param string|null $event The event name to listen to - * @param string|null $method The method to run when the listened event is triggered - * @param int $priority The priority of this listener if several are declared for the same event - * @param string|null $dispatcher The service id of the event dispatcher to listen to - */ - public function __construct( - public ?string $event = null, - public ?string $method = null, - public int $priority = 0, - public ?string $dispatcher = null, - ) { - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/CHANGELOG.md deleted file mode 100644 index 76b2eab6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/CHANGELOG.md +++ /dev/null @@ -1,96 +0,0 @@ -CHANGELOG -========= - -6.0 ---- - - * Remove `LegacyEventDispatcherProxy` - -5.4 ---- - - * Allow `#[AsEventListener]` attribute on methods - -5.3 ---- - - * Add `#[AsEventListener]` attribute for declaring listeners on PHP 8 - -5.1.0 ------ - - * The `LegacyEventDispatcherProxy` class has been deprecated. - * Added an optional `dispatcher` attribute to the listener and subscriber tags in `RegisterListenerPass`. - -5.0.0 ------ - - * The signature of the `EventDispatcherInterface::dispatch()` method has been changed to `dispatch($event, string $eventName = null): object`. - * The `Event` class has been removed in favor of `Symfony\Contracts\EventDispatcher\Event`. - * The `TraceableEventDispatcherInterface` has been removed. - * The `WrappedListener` class is now final. - -4.4.0 ------ - - * `AddEventAliasesPass` has been added, allowing applications and bundles to extend the event alias mapping used by `RegisterListenersPass`. - * Made the `event` attribute of the `kernel.event_listener` tag optional for FQCN events. - -4.3.0 ------ - - * The signature of the `EventDispatcherInterface::dispatch()` method should be updated to `dispatch($event, string $eventName = null)`, not doing so is deprecated - * deprecated the `Event` class, use `Symfony\Contracts\EventDispatcher\Event` instead - -4.1.0 ------ - - * added support for invokable event listeners tagged with `kernel.event_listener` by default - * The `TraceableEventDispatcher::getOrphanedEvents()` method has been added. - * The `TraceableEventDispatcherInterface` has been deprecated. - -4.0.0 ------ - - * removed the `ContainerAwareEventDispatcher` class - * added the `reset()` method to the `TraceableEventDispatcherInterface` - -3.4.0 ------ - - * Implementing `TraceableEventDispatcherInterface` without the `reset()` method has been deprecated. - -3.3.0 ------ - - * The ContainerAwareEventDispatcher class has been deprecated. Use EventDispatcher with closure factories instead. - -3.0.0 ------ - - * The method `getListenerPriority($eventName, $listener)` has been added to the - `EventDispatcherInterface`. - * The methods `Event::setDispatcher()`, `Event::getDispatcher()`, `Event::setName()` - and `Event::getName()` have been removed. - The event dispatcher and the event name are passed to the listener call. - -2.5.0 ------ - - * added Debug\TraceableEventDispatcher (originally in HttpKernel) - * changed Debug\TraceableEventDispatcherInterface to extend EventDispatcherInterface - * added RegisterListenersPass (originally in HttpKernel) - -2.1.0 ------ - - * added TraceableEventDispatcherInterface - * added ContainerAwareEventDispatcher - * added a reference to the EventDispatcher on the Event - * added a reference to the Event name on the event - * added fluid interface to the dispatch() method which now returns the Event - object - * added GenericEvent event class - * added the possibility for subscribers to subscribe several times for the - same event - * added ImmutableEventDispatcher diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php deleted file mode 100644 index 8330ce15..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php +++ /dev/null @@ -1,351 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\Debug; - -use Psr\EventDispatcher\StoppableEventInterface; -use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\Stopwatch\Stopwatch; -use Symfony\Contracts\Service\ResetInterface; - -/** - * Collects some data about event listeners. - * - * This event dispatcher delegates the dispatching to another one. - * - * @author Fabien Potencier - */ -class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterface -{ - /** - * @var \SplObjectStorage|null - */ - private ?\SplObjectStorage $callStack = null; - private array $wrappedListeners = []; - private array $orphanedEvents = []; - private string $currentRequestHash = ''; - - public function __construct( - private EventDispatcherInterface $dispatcher, - protected Stopwatch $stopwatch, - protected ?LoggerInterface $logger = null, - private ?RequestStack $requestStack = null, - ) { - } - - public function addListener(string $eventName, callable|array $listener, int $priority = 0): void - { - $this->dispatcher->addListener($eventName, $listener, $priority); - } - - public function addSubscriber(EventSubscriberInterface $subscriber): void - { - $this->dispatcher->addSubscriber($subscriber); - } - - public function removeListener(string $eventName, callable|array $listener): void - { - if (isset($this->wrappedListeners[$eventName])) { - foreach ($this->wrappedListeners[$eventName] as $index => $wrappedListener) { - if ($wrappedListener->getWrappedListener() === $listener || ($listener instanceof \Closure && $wrappedListener->getWrappedListener() == $listener)) { - $listener = $wrappedListener; - unset($this->wrappedListeners[$eventName][$index]); - break; - } - } - } - - $this->dispatcher->removeListener($eventName, $listener); - } - - public function removeSubscriber(EventSubscriberInterface $subscriber): void - { - $this->dispatcher->removeSubscriber($subscriber); - } - - public function getListeners(?string $eventName = null): array - { - return $this->dispatcher->getListeners($eventName); - } - - public function getListenerPriority(string $eventName, callable|array $listener): ?int - { - // we might have wrapped listeners for the event (if called while dispatching) - // in that case get the priority by wrapper - if (isset($this->wrappedListeners[$eventName])) { - foreach ($this->wrappedListeners[$eventName] as $wrappedListener) { - if ($wrappedListener->getWrappedListener() === $listener || ($listener instanceof \Closure && $wrappedListener->getWrappedListener() == $listener)) { - return $this->dispatcher->getListenerPriority($eventName, $wrappedListener); - } - } - } - - return $this->dispatcher->getListenerPriority($eventName, $listener); - } - - public function hasListeners(?string $eventName = null): bool - { - return $this->dispatcher->hasListeners($eventName); - } - - public function dispatch(object $event, ?string $eventName = null): object - { - $eventName ??= $event::class; - - $this->callStack ??= new \SplObjectStorage(); - - $currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : ''; - - if (null !== $this->logger && $event instanceof StoppableEventInterface && $event->isPropagationStopped()) { - $this->logger->debug(\sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName)); - } - - $this->preProcess($eventName); - try { - $this->beforeDispatch($eventName, $event); - try { - $e = $this->stopwatch->start($eventName, 'section'); - try { - $this->dispatcher->dispatch($event, $eventName); - } finally { - if ($e->isStarted()) { - $e->stop(); - } - } - } finally { - $this->afterDispatch($eventName, $event); - } - } finally { - $this->currentRequestHash = $currentRequestHash; - $this->postProcess($eventName); - } - - return $event; - } - - public function getCalledListeners(?Request $request = null): array - { - if (null === $this->callStack) { - return []; - } - - $hash = $request ? spl_object_hash($request) : null; - $called = []; - foreach ($this->callStack as $listener) { - [$eventName, $requestHash] = $this->callStack->getInfo(); - if (null === $hash || $hash === $requestHash) { - $called[] = $listener->getInfo($eventName); - } - } - - return $called; - } - - public function getNotCalledListeners(?Request $request = null): array - { - try { - $allListeners = $this->dispatcher instanceof EventDispatcher ? $this->getListenersWithPriority() : $this->getListenersWithoutPriority(); - } catch (\Exception $e) { - $this->logger?->info('An exception was thrown while getting the uncalled listeners.', ['exception' => $e]); - - // unable to retrieve the uncalled listeners - return []; - } - - $hash = $request ? spl_object_hash($request) : null; - $calledListeners = []; - - if (null !== $this->callStack) { - foreach ($this->callStack as $calledListener) { - [, $requestHash] = $this->callStack->getInfo(); - - if (null === $hash || $hash === $requestHash) { - $calledListeners[] = $calledListener->getWrappedListener(); - } - } - } - - $notCalled = []; - - foreach ($allListeners as $eventName => $listeners) { - foreach ($listeners as [$listener, $priority]) { - if (!\in_array($listener, $calledListeners, true)) { - if (!$listener instanceof WrappedListener) { - $listener = new WrappedListener($listener, null, $this->stopwatch, $this, $priority); - } - $notCalled[] = $listener->getInfo($eventName); - } - } - } - - uasort($notCalled, $this->sortNotCalledListeners(...)); - - return $notCalled; - } - - public function getOrphanedEvents(?Request $request = null): array - { - if ($request) { - return $this->orphanedEvents[spl_object_hash($request)] ?? []; - } - - if (!$this->orphanedEvents) { - return []; - } - - return array_merge(...array_values($this->orphanedEvents)); - } - - public function reset(): void - { - $this->callStack = null; - $this->orphanedEvents = []; - $this->currentRequestHash = ''; - } - - /** - * Proxies all method calls to the original event dispatcher. - * - * @param string $method The method name - * @param array $arguments The method arguments - */ - public function __call(string $method, array $arguments): mixed - { - return $this->dispatcher->{$method}(...$arguments); - } - - /** - * Called before dispatching the event. - */ - protected function beforeDispatch(string $eventName, object $event): void - { - } - - /** - * Called after dispatching the event. - */ - protected function afterDispatch(string $eventName, object $event): void - { - } - - private function preProcess(string $eventName): void - { - if (!$this->dispatcher->hasListeners($eventName)) { - $this->orphanedEvents[$this->currentRequestHash][] = $eventName; - - return; - } - - foreach ($this->dispatcher->getListeners($eventName) as $listener) { - $priority = $this->getListenerPriority($eventName, $listener); - $wrappedListener = new WrappedListener($listener instanceof WrappedListener ? $listener->getWrappedListener() : $listener, null, $this->stopwatch, $this); - $this->wrappedListeners[$eventName][] = $wrappedListener; - $this->dispatcher->removeListener($eventName, $listener); - $this->dispatcher->addListener($eventName, $wrappedListener, $priority); - $this->callStack->attach($wrappedListener, [$eventName, $this->currentRequestHash]); - } - } - - private function postProcess(string $eventName): void - { - unset($this->wrappedListeners[$eventName]); - $skipped = false; - foreach ($this->dispatcher->getListeners($eventName) as $listener) { - if (!$listener instanceof WrappedListener) { // #12845: a new listener was added during dispatch. - continue; - } - // Unwrap listener - $priority = $this->getListenerPriority($eventName, $listener); - $this->dispatcher->removeListener($eventName, $listener); - $this->dispatcher->addListener($eventName, $listener->getWrappedListener(), $priority); - - if (null !== $this->logger) { - $context = ['event' => $eventName, 'listener' => $listener->getPretty()]; - } - - if ($listener->wasCalled()) { - $this->logger?->debug('Notified event "{event}" to listener "{listener}".', $context); - } else { - $this->callStack->detach($listener); - } - - if (null !== $this->logger && $skipped) { - $this->logger->debug('Listener "{listener}" was not called for event "{event}".', $context); - } - - if ($listener->stoppedPropagation()) { - $this->logger?->debug('Listener "{listener}" stopped propagation of the event "{event}".', $context); - - $skipped = true; - } - } - } - - private function sortNotCalledListeners(array $a, array $b): int - { - if (0 !== $cmp = strcmp($a['event'], $b['event'])) { - return $cmp; - } - - if (\is_int($a['priority']) && !\is_int($b['priority'])) { - return 1; - } - - if (!\is_int($a['priority']) && \is_int($b['priority'])) { - return -1; - } - - if ($a['priority'] === $b['priority']) { - return 0; - } - - if ($a['priority'] > $b['priority']) { - return -1; - } - - return 1; - } - - private function getListenersWithPriority(): array - { - $result = []; - - $allListeners = new \ReflectionProperty(EventDispatcher::class, 'listeners'); - - foreach ($allListeners->getValue($this->dispatcher) as $eventName => $listenersByPriority) { - foreach ($listenersByPriority as $priority => $listeners) { - foreach ($listeners as $listener) { - $result[$eventName][] = [$listener, $priority]; - } - } - } - - return $result; - } - - private function getListenersWithoutPriority(): array - { - $result = []; - - foreach ($this->getListeners() as $eventName => $listeners) { - foreach ($listeners as $listener) { - $result[$eventName][] = [$listener, null]; - } - } - - return $result; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/WrappedListener.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/WrappedListener.php deleted file mode 100644 index b83115bb..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/Debug/WrappedListener.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\Debug; - -use Psr\EventDispatcher\StoppableEventInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\Stopwatch\Stopwatch; -use Symfony\Component\VarDumper\Caster\ClassStub; - -/** - * @author Fabien Potencier - */ -final class WrappedListener -{ - private string|array|object $listener; - private ?\Closure $optimizedListener; - private string $name; - private bool $called = false; - private bool $stoppedPropagation = false; - private string $pretty; - private string $callableRef; - private ClassStub|string $stub; - private static bool $hasClassStub; - - public function __construct( - callable|array $listener, - ?string $name, - private Stopwatch $stopwatch, - private ?EventDispatcherInterface $dispatcher = null, - private ?int $priority = null, - ) { - $this->listener = $listener; - $this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? $listener(...) : null); - - if (\is_array($listener)) { - [$this->name, $this->callableRef] = $this->parseListener($listener); - $this->pretty = $this->name.'::'.$listener[1]; - $this->callableRef .= '::'.$listener[1]; - } elseif ($listener instanceof \Closure) { - $r = new \ReflectionFunction($listener); - if ($r->isAnonymous()) { - $this->pretty = $this->name = 'closure'; - } elseif ($class = $r->getClosureCalledClass()) { - $this->name = $class->name; - $this->pretty = $this->name.'::'.$r->name; - } else { - $this->pretty = $this->name = $r->name; - } - } elseif (\is_string($listener)) { - $this->pretty = $this->name = $listener; - } else { - $this->name = get_debug_type($listener); - $this->pretty = $this->name.'::__invoke'; - $this->callableRef = $listener::class.'::__invoke'; - } - - if (null !== $name) { - $this->name = $name; - } - - self::$hasClassStub ??= class_exists(ClassStub::class); - } - - public function getWrappedListener(): callable|array - { - return $this->listener; - } - - public function wasCalled(): bool - { - return $this->called; - } - - public function stoppedPropagation(): bool - { - return $this->stoppedPropagation; - } - - public function getPretty(): string - { - return $this->pretty; - } - - public function getInfo(string $eventName): array - { - $this->stub ??= self::$hasClassStub ? new ClassStub($this->pretty.'()', $this->callableRef ?? $this->listener) : $this->pretty.'()'; - - return [ - 'event' => $eventName, - 'priority' => $this->priority ??= $this->dispatcher?->getListenerPriority($eventName, $this->listener), - 'pretty' => $this->pretty, - 'stub' => $this->stub, - ]; - } - - public function __invoke(object $event, string $eventName, EventDispatcherInterface $dispatcher): void - { - $dispatcher = $this->dispatcher ?: $dispatcher; - - $this->called = true; - $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener); - - $e = $this->stopwatch->start($this->name, 'event_listener'); - - try { - ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); - } finally { - if ($e->isStarted()) { - $e->stop(); - } - } - - if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { - $this->stoppedPropagation = true; - } - } - - private function parseListener(array $listener): array - { - if ($listener[0] instanceof \Closure) { - foreach ((new \ReflectionFunction($listener[0]))->getAttributes(\Closure::class) as $attribute) { - if ($name = $attribute->getArguments()['name'] ?? false) { - return [$name, $attribute->getArguments()['class'] ?? $name]; - } - } - } - - if (\is_object($listener[0])) { - return [get_debug_type($listener[0]), $listener[0]::class]; - } - - return [$listener[0], $listener[0]]; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php deleted file mode 100644 index 53089920..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * This pass allows bundles to extend the list of event aliases. - * - * @author Alexander M. Turek - */ -class AddEventAliasesPass implements CompilerPassInterface -{ - public function __construct( - private array $eventAliases, - ) { - } - - public function process(ContainerBuilder $container): void - { - $eventAliases = $container->hasParameter('event_dispatcher.event_aliases') ? $container->getParameter('event_dispatcher.event_aliases') : []; - - $container->setParameter( - 'event_dispatcher.event_aliases', - array_merge($eventAliases, $this->eventAliases) - ); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php deleted file mode 100644 index a0267ce3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php +++ /dev/null @@ -1,213 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\DependencyInjection; - -use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Compiler pass to register tagged services for an event dispatcher. - */ -class RegisterListenersPass implements CompilerPassInterface -{ - private array $hotPathEvents = []; - private array $noPreloadEvents = []; - - /** - * @return $this - */ - public function setHotPathEvents(array $hotPathEvents): static - { - $this->hotPathEvents = array_flip($hotPathEvents); - - return $this; - } - - /** - * @return $this - */ - public function setNoPreloadEvents(array $noPreloadEvents): static - { - $this->noPreloadEvents = array_flip($noPreloadEvents); - - return $this; - } - - public function process(ContainerBuilder $container): void - { - if (!$container->hasDefinition('event_dispatcher') && !$container->hasAlias('event_dispatcher')) { - return; - } - - $aliases = []; - - if ($container->hasParameter('event_dispatcher.event_aliases')) { - $aliases = $container->getParameter('event_dispatcher.event_aliases'); - } - - $globalDispatcherDefinition = $container->findDefinition('event_dispatcher'); - - foreach ($container->findTaggedServiceIds('kernel.event_listener', true) as $id => $events) { - $noPreload = 0; - - foreach ($events as $event) { - $priority = $event['priority'] ?? 0; - - if (!isset($event['event'])) { - if ($container->getDefinition($id)->hasTag('kernel.event_subscriber')) { - continue; - } - - $event['method'] ??= '__invoke'; - $event['event'] = $this->getEventFromTypeDeclaration($container, $id, $event['method']); - } - - $event['event'] = $aliases[$event['event']] ?? $event['event']; - - if (!isset($event['method'])) { - $event['method'] = 'on'.preg_replace_callback([ - '/(?<=\b|_)[a-z]/i', - '/[^a-z0-9]/i', - ], fn ($matches) => strtoupper($matches[0]), $event['event']); - $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); - - if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method'])) { - if (!$r->hasMethod('__invoke')) { - throw new InvalidArgumentException(\sprintf('None of the "%s" or "__invoke" methods exist for the service "%s". Please define the "method" attribute on "kernel.event_listener" tags.', $event['method'], $id)); - } - - $event['method'] = '__invoke'; - } - } - - $dispatcherDefinition = $globalDispatcherDefinition; - if (isset($event['dispatcher'])) { - $dispatcherDefinition = $container->findDefinition($event['dispatcher']); - } - - $dispatcherDefinition->addMethodCall('addListener', [$event['event'], [new ServiceClosureArgument(new Reference($id)), $event['method']], $priority]); - - if (isset($this->hotPathEvents[$event['event']])) { - $container->getDefinition($id)->addTag('container.hot_path'); - } elseif (isset($this->noPreloadEvents[$event['event']])) { - ++$noPreload; - } - } - - if ($noPreload && \count($events) === $noPreload) { - $container->getDefinition($id)->addTag('container.no_preload'); - } - } - - $extractingDispatcher = new ExtractingEventDispatcher(); - - foreach ($container->findTaggedServiceIds('kernel.event_subscriber', true) as $id => $tags) { - $def = $container->getDefinition($id); - - // We must assume that the class value has been correctly filled, even if the service is created by a factory - $class = $def->getClass(); - - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(EventSubscriberInterface::class)) { - throw new InvalidArgumentException(\sprintf('Service "%s" must implement interface "%s".', $id, EventSubscriberInterface::class)); - } - $class = $r->name; - - $dispatcherDefinitions = []; - foreach ($tags as $attributes) { - if (!isset($attributes['dispatcher']) || isset($dispatcherDefinitions[$attributes['dispatcher']])) { - continue; - } - - $dispatcherDefinitions[$attributes['dispatcher']] = $container->findDefinition($attributes['dispatcher']); - } - - if (!$dispatcherDefinitions) { - $dispatcherDefinitions = [$globalDispatcherDefinition]; - } - - $noPreload = 0; - ExtractingEventDispatcher::$aliases = $aliases; - ExtractingEventDispatcher::$subscriber = $class; - $extractingDispatcher->addSubscriber($extractingDispatcher); - foreach ($extractingDispatcher->listeners as $args) { - $args[1] = [new ServiceClosureArgument(new Reference($id)), $args[1]]; - foreach ($dispatcherDefinitions as $dispatcherDefinition) { - $dispatcherDefinition->addMethodCall('addListener', $args); - } - - if (isset($this->hotPathEvents[$args[0]])) { - $container->getDefinition($id)->addTag('container.hot_path'); - } elseif (isset($this->noPreloadEvents[$args[0]])) { - ++$noPreload; - } - } - if ($noPreload && \count($extractingDispatcher->listeners) === $noPreload) { - $container->getDefinition($id)->addTag('container.no_preload'); - } - $extractingDispatcher->listeners = []; - ExtractingEventDispatcher::$aliases = []; - } - } - - private function getEventFromTypeDeclaration(ContainerBuilder $container, string $id, string $method): string - { - if ( - null === ($class = $container->getDefinition($id)->getClass()) - || !($r = $container->getReflectionClass($class, false)) - || !$r->hasMethod($method) - || 1 > ($m = $r->getMethod($method))->getNumberOfParameters() - || !($type = $m->getParameters()[0]->getType()) instanceof \ReflectionNamedType - || $type->isBuiltin() - || Event::class === ($name = $type->getName()) - ) { - throw new InvalidArgumentException(\sprintf('Service "%s" must define the "event" attribute on "kernel.event_listener" tags.', $id)); - } - - return $name; - } -} - -/** - * @internal - */ -class ExtractingEventDispatcher extends EventDispatcher implements EventSubscriberInterface -{ - public array $listeners = []; - - public static array $aliases = []; - public static string $subscriber; - - public function addListener(string $eventName, callable|array $listener, int $priority = 0): void - { - $this->listeners[] = [$eventName, $listener[1], $priority]; - } - - public static function getSubscribedEvents(): array - { - $events = []; - - foreach ([self::$subscriber, 'getSubscribedEvents']() as $eventName => $params) { - $events[self::$aliases[$eventName] ?? $eventName] = $params; - } - - return $events; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcher.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcher.php deleted file mode 100644 index 43bc16b8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcher.php +++ /dev/null @@ -1,256 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -use Psr\EventDispatcher\StoppableEventInterface; -use Symfony\Component\EventDispatcher\Debug\WrappedListener; - -/** - * The EventDispatcherInterface is the central point of Symfony's event listener system. - * - * Listeners are registered on the manager and events are dispatched through the - * manager. - * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - * @author Fabien Potencier - * @author Jordi Boggiano - * @author Jordan Alliot - * @author Nicolas Grekas - */ -class EventDispatcher implements EventDispatcherInterface -{ - private array $listeners = []; - private array $sorted = []; - private array $optimized; - - public function __construct() - { - if (__CLASS__ === static::class) { - $this->optimized = []; - } - } - - public function dispatch(object $event, ?string $eventName = null): object - { - $eventName ??= $event::class; - - if (isset($this->optimized)) { - $listeners = $this->optimized[$eventName] ?? (empty($this->listeners[$eventName]) ? [] : $this->optimizeListeners($eventName)); - } else { - $listeners = $this->getListeners($eventName); - } - - if ($listeners) { - $this->callListeners($listeners, $eventName, $event); - } - - return $event; - } - - public function getListeners(?string $eventName = null): array - { - if (null !== $eventName) { - if (empty($this->listeners[$eventName])) { - return []; - } - - if (!isset($this->sorted[$eventName])) { - $this->sortListeners($eventName); - } - - return $this->sorted[$eventName]; - } - - foreach ($this->listeners as $eventName => $eventListeners) { - if (!isset($this->sorted[$eventName])) { - $this->sortListeners($eventName); - } - } - - return array_filter($this->sorted); - } - - public function getListenerPriority(string $eventName, callable|array $listener): ?int - { - if (empty($this->listeners[$eventName])) { - return null; - } - - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $listener[0] = $listener[0](); - $listener[1] ??= '__invoke'; - } - - foreach ($this->listeners[$eventName] as $priority => &$listeners) { - foreach ($listeners as &$v) { - if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) { - $v[0] = $v[0](); - $v[1] ??= '__invoke'; - } - if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) { - return $priority; - } - } - } - - return null; - } - - public function hasListeners(?string $eventName = null): bool - { - if (null !== $eventName) { - return !empty($this->listeners[$eventName]); - } - - foreach ($this->listeners as $eventListeners) { - if ($eventListeners) { - return true; - } - } - - return false; - } - - public function addListener(string $eventName, callable|array $listener, int $priority = 0): void - { - $this->listeners[$eventName][$priority][] = $listener; - unset($this->sorted[$eventName], $this->optimized[$eventName]); - } - - public function removeListener(string $eventName, callable|array $listener): void - { - if (empty($this->listeners[$eventName])) { - return; - } - - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $listener[0] = $listener[0](); - $listener[1] ??= '__invoke'; - } - - foreach ($this->listeners[$eventName] as $priority => &$listeners) { - foreach ($listeners as $k => &$v) { - if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) { - $v[0] = $v[0](); - $v[1] ??= '__invoke'; - } - if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) { - unset($listeners[$k], $this->sorted[$eventName], $this->optimized[$eventName]); - } - } - - if (!$listeners) { - unset($this->listeners[$eventName][$priority]); - } - } - } - - public function addSubscriber(EventSubscriberInterface $subscriber): void - { - foreach ($subscriber->getSubscribedEvents() as $eventName => $params) { - if (\is_string($params)) { - $this->addListener($eventName, [$subscriber, $params]); - } elseif (\is_string($params[0])) { - $this->addListener($eventName, [$subscriber, $params[0]], $params[1] ?? 0); - } else { - foreach ($params as $listener) { - $this->addListener($eventName, [$subscriber, $listener[0]], $listener[1] ?? 0); - } - } - } - } - - public function removeSubscriber(EventSubscriberInterface $subscriber): void - { - foreach ($subscriber->getSubscribedEvents() as $eventName => $params) { - if (\is_array($params) && \is_array($params[0])) { - foreach ($params as $listener) { - $this->removeListener($eventName, [$subscriber, $listener[0]]); - } - } else { - $this->removeListener($eventName, [$subscriber, \is_string($params) ? $params : $params[0]]); - } - } - } - - /** - * Triggers the listeners of an event. - * - * This method can be overridden to add functionality that is executed - * for each listener. - * - * @param callable[] $listeners The event listeners - * @param string $eventName The name of the event to dispatch - * @param object $event The event object to pass to the event handlers/listeners - */ - protected function callListeners(iterable $listeners, string $eventName, object $event): void - { - $stoppable = $event instanceof StoppableEventInterface; - - foreach ($listeners as $listener) { - if ($stoppable && $event->isPropagationStopped()) { - break; - } - $listener($event, $eventName, $this); - } - } - - /** - * Sorts the internal list of listeners for the given event by priority. - */ - private function sortListeners(string $eventName): void - { - krsort($this->listeners[$eventName]); - $this->sorted[$eventName] = []; - - foreach ($this->listeners[$eventName] as &$listeners) { - foreach ($listeners as &$listener) { - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $listener[0] = $listener[0](); - $listener[1] ??= '__invoke'; - } - $this->sorted[$eventName][] = $listener; - } - } - } - - /** - * Optimizes the internal list of listeners for the given event by priority. - */ - private function optimizeListeners(string $eventName): array - { - krsort($this->listeners[$eventName]); - $this->optimized[$eventName] = []; - - foreach ($this->listeners[$eventName] as &$listeners) { - foreach ($listeners as &$listener) { - $closure = &$this->optimized[$eventName][]; - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $closure = static function (...$args) use (&$listener, &$closure) { - if ($listener[0] instanceof \Closure) { - $listener[0] = $listener[0](); - $listener[1] ??= '__invoke'; - } - ($closure = $listener(...))(...$args); - }; - } else { - $closure = $listener instanceof WrappedListener ? $listener : $listener(...); - } - } - } - - return $this->optimized[$eventName]; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcherInterface.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcherInterface.php deleted file mode 100644 index 99f8b1a0..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventDispatcherInterface.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as ContractsEventDispatcherInterface; - -/** - * The EventDispatcherInterface is the central point of Symfony's event listener system. - * Listeners are registered on the manager and events are dispatched through the - * manager. - * - * @author Bernhard Schussek - */ -interface EventDispatcherInterface extends ContractsEventDispatcherInterface -{ - /** - * Adds an event listener that listens on the specified events. - * - * @param int $priority The higher this value, the earlier an event - * listener will be triggered in the chain (defaults to 0) - */ - public function addListener(string $eventName, callable $listener, int $priority = 0): void; - - /** - * Adds an event subscriber. - * - * The subscriber is asked for all the events it is - * interested in and added as a listener for these events. - */ - public function addSubscriber(EventSubscriberInterface $subscriber): void; - - /** - * Removes an event listener from the specified events. - */ - public function removeListener(string $eventName, callable $listener): void; - - public function removeSubscriber(EventSubscriberInterface $subscriber): void; - - /** - * Gets the listeners of a specific event or all listeners sorted by descending priority. - * - * @return array - */ - public function getListeners(?string $eventName = null): array; - - /** - * Gets the listener priority for a specific event. - * - * Returns null if the event or the listener does not exist. - */ - public function getListenerPriority(string $eventName, callable $listener): ?int; - - /** - * Checks whether an event has any registered listeners. - */ - public function hasListeners(?string $eventName = null): bool; -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventSubscriberInterface.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventSubscriberInterface.php deleted file mode 100644 index 2085e428..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/EventSubscriberInterface.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -/** - * An EventSubscriber knows itself what events it is interested in. - * If an EventSubscriber is added to an EventDispatcherInterface, the manager invokes - * {@link getSubscribedEvents} and registers the subscriber as a listener for all - * returned events. - * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - */ -interface EventSubscriberInterface -{ - /** - * Returns an array of event names this subscriber wants to listen to. - * - * The array keys are event names and the value can be: - * - * * The method name to call (priority defaults to 0) - * * An array composed of the method name to call and the priority - * * An array of arrays composed of the method names to call and respective - * priorities, or 0 if unset - * - * For instance: - * - * * ['eventName' => 'methodName'] - * * ['eventName' => ['methodName', $priority]] - * * ['eventName' => [['methodName1', $priority], ['methodName2']]] - * - * The code must not depend on runtime state as it will only be called at compile time. - * All logic depending on runtime state must be put into the individual methods handling the events. - * - * @return array> - */ - public static function getSubscribedEvents(); -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/GenericEvent.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/GenericEvent.php deleted file mode 100644 index 87f61ad5..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/GenericEvent.php +++ /dev/null @@ -1,155 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Event encapsulation class. - * - * Encapsulates events thus decoupling the observer from the subject they encapsulate. - * - * @author Drak - * - * @implements \ArrayAccess - * @implements \IteratorAggregate - */ -class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate -{ - /** - * Encapsulate an event with $subject and $arguments. - * - * @param mixed $subject The subject of the event, usually an object or a callable - * @param array $arguments Arguments to store in the event - */ - public function __construct( - protected mixed $subject = null, - protected array $arguments = [], - ) { - } - - /** - * Getter for subject property. - */ - public function getSubject(): mixed - { - return $this->subject; - } - - /** - * Get argument by key. - * - * @throws \InvalidArgumentException if key is not found - */ - public function getArgument(string $key): mixed - { - if ($this->hasArgument($key)) { - return $this->arguments[$key]; - } - - throw new \InvalidArgumentException(\sprintf('Argument "%s" not found.', $key)); - } - - /** - * Add argument to event. - * - * @return $this - */ - public function setArgument(string $key, mixed $value): static - { - $this->arguments[$key] = $value; - - return $this; - } - - /** - * Getter for all arguments. - */ - public function getArguments(): array - { - return $this->arguments; - } - - /** - * Set args property. - * - * @return $this - */ - public function setArguments(array $args = []): static - { - $this->arguments = $args; - - return $this; - } - - /** - * Has argument. - */ - public function hasArgument(string $key): bool - { - return \array_key_exists($key, $this->arguments); - } - - /** - * ArrayAccess for argument getter. - * - * @param string $key Array key - * - * @throws \InvalidArgumentException if key does not exist in $this->args - */ - public function offsetGet(mixed $key): mixed - { - return $this->getArgument($key); - } - - /** - * ArrayAccess for argument setter. - * - * @param string $key Array key to set - */ - public function offsetSet(mixed $key, mixed $value): void - { - $this->setArgument($key, $value); - } - - /** - * ArrayAccess for unset argument. - * - * @param string $key Array key - */ - public function offsetUnset(mixed $key): void - { - if ($this->hasArgument($key)) { - unset($this->arguments[$key]); - } - } - - /** - * ArrayAccess has argument. - * - * @param string $key Array key - */ - public function offsetExists(mixed $key): bool - { - return $this->hasArgument($key); - } - - /** - * IteratorAggregate for iterating over the object like an array. - * - * @return \ArrayIterator - */ - public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->arguments); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php deleted file mode 100644 index a6d078e9..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -/** - * A read-only proxy for an event dispatcher. - * - * @author Bernhard Schussek - */ -class ImmutableEventDispatcher implements EventDispatcherInterface -{ - public function __construct( - private EventDispatcherInterface $dispatcher, - ) { - } - - public function dispatch(object $event, ?string $eventName = null): object - { - return $this->dispatcher->dispatch($event, $eventName); - } - - public function addListener(string $eventName, callable|array $listener, int $priority = 0): never - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - public function addSubscriber(EventSubscriberInterface $subscriber): never - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - public function removeListener(string $eventName, callable|array $listener): never - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - public function removeSubscriber(EventSubscriberInterface $subscriber): never - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - public function getListeners(?string $eventName = null): array - { - return $this->dispatcher->getListeners($eventName); - } - - public function getListenerPriority(string $eventName, callable|array $listener): ?int - { - return $this->dispatcher->getListenerPriority($eventName, $listener); - } - - public function hasListeners(?string $eventName = null): bool - { - return $this->dispatcher->hasListeners($eventName); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/LICENSE b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/LICENSE deleted file mode 100644 index 0138f8f0..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/README.md b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/README.md deleted file mode 100644 index dcdb68d2..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/README.md +++ /dev/null @@ -1,15 +0,0 @@ -EventDispatcher Component -========================= - -The EventDispatcher component provides tools that allow your application -components to communicate with each other by dispatching events and listening to -them. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/event_dispatcher.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/composer.json b/tools/php-cs-fixer/vendor/symfony/event-dispatcher/composer.json deleted file mode 100644 index 598bbdc5..00000000 --- a/tools/php-cs-fixer/vendor/symfony/event-dispatcher/composer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "symfony/event-dispatcher", - "type": "library", - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.2", - "symfony/event-dispatcher-contracts": "^2.5|^3" - }, - "require-dev": { - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/expression-language": "^6.4|^7.0", - "symfony/config": "^6.4|^7.0", - "symfony/error-handler": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^6.4|^7.0", - "psr/log": "^1|^2|^3" - }, - "conflict": { - "symfony/dependency-injection": "<6.4", - "symfony/service-contracts": "<2.5" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0|3.0" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/filesystem/CHANGELOG.md deleted file mode 100644 index 80818d1b..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/CHANGELOG.md +++ /dev/null @@ -1,92 +0,0 @@ -CHANGELOG -========= - -7.1 ---- - - * Add the `Filesystem::readFile()` method - -7.0 ---- - - * Add argument `$lock` to `Filesystem::appendToFile()` - -5.4 ---- - - * Add `Path` class - * Add `$lock` argument to `Filesystem::appendToFile()` - -5.0.0 ------ - - * `Filesystem::dumpFile()` and `appendToFile()` don't accept arrays anymore - -4.4.0 ------ - - * support for passing a `null` value to `Filesystem::isAbsolutePath()` is deprecated and will be removed in 5.0 - * `tempnam()` now accepts a third argument `$suffix`. - -4.3.0 ------ - - * support for passing arrays to `Filesystem::dumpFile()` is deprecated and will be removed in 5.0 - * support for passing arrays to `Filesystem::appendToFile()` is deprecated and will be removed in 5.0 - -4.0.0 ------ - - * removed `LockHandler` - * Support for passing relative paths to `Filesystem::makePathRelative()` has been removed. - -3.4.0 ------ - - * support for passing relative paths to `Filesystem::makePathRelative()` is deprecated and will be removed in 4.0 - -3.3.0 ------ - - * added `appendToFile()` to append contents to existing files - -3.2.0 ------ - - * added `readlink()` as a platform independent method to read links - -3.0.0 ------ - - * removed `$mode` argument from `Filesystem::dumpFile()` - -2.8.0 ------ - - * added tempnam() a stream aware version of PHP's native tempnam() - -2.6.0 ------ - - * added LockHandler - -2.3.12 ------- - - * deprecated dumpFile() file mode argument. - -2.3.0 ------ - - * added the dumpFile() method to atomically write files - -2.2.0 ------ - - * added a delete option for the mirror() method - -2.1.0 ------ - - * 24eb396 : BC Break : mkdir() function now throws exception in case of failure instead of returning Boolean value - * created the component diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/ExceptionInterface.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/ExceptionInterface.php deleted file mode 100644 index fc438d9f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Filesystem\Exception; - -/** - * Exception interface for all exceptions thrown by the component. - * - * @author Romain Neutron - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/FileNotFoundException.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/FileNotFoundException.php deleted file mode 100644 index d0d27977..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/FileNotFoundException.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Filesystem\Exception; - -/** - * Exception class thrown when a file couldn't be found. - * - * @author Fabien Potencier - * @author Christian Gärtner - */ -class FileNotFoundException extends IOException -{ - public function __construct(?string $message = null, int $code = 0, ?\Throwable $previous = null, ?string $path = null) - { - if (null === $message) { - if (null === $path) { - $message = 'File could not be found.'; - } else { - $message = \sprintf('File "%s" could not be found.', $path); - } - } - - parent::__construct($message, $code, $previous, $path); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOException.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOException.php deleted file mode 100644 index 46ab8b4a..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOException.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Filesystem\Exception; - -/** - * Exception class thrown when a filesystem operation failure happens. - * - * @author Romain Neutron - * @author Christian Gärtner - * @author Fabien Potencier - */ -class IOException extends \RuntimeException implements IOExceptionInterface -{ - public function __construct( - string $message, - int $code = 0, - ?\Throwable $previous = null, - private ?string $path = null, - ) { - parent::__construct($message, $code, $previous); - } - - public function getPath(): ?string - { - return $this->path; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOExceptionInterface.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOExceptionInterface.php deleted file mode 100644 index 90c71db8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/IOExceptionInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Filesystem\Exception; - -/** - * IOException interface for file and input/output stream related exceptions thrown by the component. - * - * @author Christian Gärtner - */ -interface IOExceptionInterface extends ExceptionInterface -{ - /** - * Returns the associated path for the exception. - */ - public function getPath(): ?string; -} diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/InvalidArgumentException.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/InvalidArgumentException.php deleted file mode 100644 index abadc200..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Filesystem\Exception; - -/** - * @author Christian Flothmann - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/RuntimeException.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/RuntimeException.php deleted file mode 100644 index a7512dca..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Exception/RuntimeException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Filesystem\Exception; - -/** - * @author Théo Fidry - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Filesystem.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Filesystem.php deleted file mode 100644 index f97c8b2f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Filesystem.php +++ /dev/null @@ -1,773 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Filesystem; - -use Symfony\Component\Filesystem\Exception\FileNotFoundException; -use Symfony\Component\Filesystem\Exception\InvalidArgumentException; -use Symfony\Component\Filesystem\Exception\IOException; - -/** - * Provides basic utility to manipulate the file system. - * - * @author Fabien Potencier - */ -class Filesystem -{ - private static ?string $lastError = null; - - /** - * Copies a file. - * - * If the target file is older than the origin file, it's always overwritten. - * If the target file is newer, it is overwritten only when the - * $overwriteNewerFiles option is set to true. - * - * @throws FileNotFoundException When originFile doesn't exist - * @throws IOException When copy fails - */ - public function copy(string $originFile, string $targetFile, bool $overwriteNewerFiles = false): void - { - $originIsLocal = stream_is_local($originFile) || 0 === stripos($originFile, 'file://'); - if ($originIsLocal && !is_file($originFile)) { - throw new FileNotFoundException(\sprintf('Failed to copy "%s" because file does not exist.', $originFile), 0, null, $originFile); - } - - $this->mkdir(\dirname($targetFile)); - - $doCopy = true; - if (!$overwriteNewerFiles && !parse_url($originFile, \PHP_URL_HOST) && is_file($targetFile)) { - $doCopy = filemtime($originFile) > filemtime($targetFile); - } - - if ($doCopy) { - // https://bugs.php.net/64634 - if (!$source = self::box('fopen', $originFile, 'r')) { - throw new IOException(\sprintf('Failed to copy "%s" to "%s" because source file could not be opened for reading: ', $originFile, $targetFile).self::$lastError, 0, null, $originFile); - } - - // Stream context created to allow files overwrite when using FTP stream wrapper - disabled by default - if (!$target = self::box('fopen', $targetFile, 'w', false, stream_context_create(['ftp' => ['overwrite' => true]]))) { - throw new IOException(\sprintf('Failed to copy "%s" to "%s" because target file could not be opened for writing: ', $originFile, $targetFile).self::$lastError, 0, null, $originFile); - } - - $bytesCopied = stream_copy_to_stream($source, $target); - fclose($source); - fclose($target); - unset($source, $target); - - if (!is_file($targetFile)) { - throw new IOException(\sprintf('Failed to copy "%s" to "%s".', $originFile, $targetFile), 0, null, $originFile); - } - - if ($originIsLocal) { - // Like `cp`, preserve executable permission bits - self::box('chmod', $targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111)); - - // Like `cp`, preserve the file modification time - self::box('touch', $targetFile, filemtime($originFile)); - - if ($bytesCopied !== $bytesOrigin = filesize($originFile)) { - throw new IOException(\sprintf('Failed to copy the whole content of "%s" to "%s" (%g of %g bytes copied).', $originFile, $targetFile, $bytesCopied, $bytesOrigin), 0, null, $originFile); - } - } - } - } - - /** - * Creates a directory recursively. - * - * @throws IOException On any directory creation failure - */ - public function mkdir(string|iterable $dirs, int $mode = 0777): void - { - foreach ($this->toIterable($dirs) as $dir) { - if (is_dir($dir)) { - continue; - } - - if (!self::box('mkdir', $dir, $mode, true) && !is_dir($dir)) { - throw new IOException(\sprintf('Failed to create "%s": ', $dir).self::$lastError, 0, null, $dir); - } - } - } - - /** - * Checks the existence of files or directories. - */ - public function exists(string|iterable $files): bool - { - $maxPathLength = \PHP_MAXPATHLEN - 2; - - foreach ($this->toIterable($files) as $file) { - if (\strlen($file) > $maxPathLength) { - throw new IOException(\sprintf('Could not check if file exist because path length exceeds %d characters.', $maxPathLength), 0, null, $file); - } - - if (!file_exists($file)) { - return false; - } - } - - return true; - } - - /** - * Sets access and modification time of file. - * - * @param int|null $time The touch time as a Unix timestamp, if not supplied the current system time is used - * @param int|null $atime The access time as a Unix timestamp, if not supplied the current system time is used - * - * @throws IOException When touch fails - */ - 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))) { - throw new IOException(\sprintf('Failed to touch "%s": ', $file).self::$lastError, 0, null, $file); - } - } - } - - /** - * Removes files or directories. - * - * @throws IOException When removal fails - */ - public function remove(string|iterable $files): void - { - if ($files instanceof \Traversable) { - $files = iterator_to_array($files, false); - } elseif (!\is_array($files)) { - $files = [$files]; - } - - self::doRemove($files, false); - } - - private static function doRemove(array $files, bool $isRecursive): void - { - $files = array_reverse($files); - foreach ($files as $file) { - if (is_link($file)) { - // See https://bugs.php.net/52176 - if (!(self::box('unlink', $file) || '\\' !== \DIRECTORY_SEPARATOR || self::box('rmdir', $file)) && file_exists($file)) { - throw new IOException(\sprintf('Failed to remove symlink "%s": ', $file).self::$lastError); - } - } elseif (is_dir($file)) { - if (!$isRecursive) { - $tmpName = \dirname(realpath($file)).'/.!'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-!')); - - if (file_exists($tmpName)) { - try { - self::doRemove([$tmpName], true); - } catch (IOException) { - } - } - - if (!file_exists($tmpName) && self::box('rename', $file, $tmpName)) { - $origFile = $file; - $file = $tmpName; - } else { - $origFile = null; - } - } - - $filesystemIterator = new \FilesystemIterator($file, \FilesystemIterator::CURRENT_AS_PATHNAME | \FilesystemIterator::SKIP_DOTS); - self::doRemove(iterator_to_array($filesystemIterator, true), true); - - if (!self::box('rmdir', $file) && file_exists($file) && !$isRecursive) { - $lastError = self::$lastError; - - if (null !== $origFile && self::box('rename', $file, $origFile)) { - $file = $origFile; - } - - throw new IOException(\sprintf('Failed to remove directory "%s": ', $file).$lastError); - } - } elseif (!self::box('unlink', $file) && ((self::$lastError && str_contains(self::$lastError, 'Permission denied')) || file_exists($file))) { - throw new IOException(\sprintf('Failed to remove file "%s": ', $file).self::$lastError); - } - } - } - - /** - * Change mode for an array of files or directories. - * - * @param int $mode The new mode (octal) - * @param int $umask The mode mask (octal) - * @param bool $recursive Whether change the mod recursively or not - * - * @throws IOException When the change fails - */ - public function chmod(string|iterable $files, int $mode, int $umask = 0000, bool $recursive = false): void - { - foreach ($this->toIterable($files) as $file) { - if (!self::box('chmod', $file, $mode & ~$umask)) { - throw new IOException(\sprintf('Failed to chmod file "%s": ', $file).self::$lastError, 0, null, $file); - } - if ($recursive && is_dir($file) && !is_link($file)) { - $this->chmod(new \FilesystemIterator($file), $mode, $umask, true); - } - } - } - - /** - * Change the owner of an array of files or directories. - * - * This method always throws on Windows, as the underlying PHP function is not supported. - * - * @see https://www.php.net/chown - * - * @param string|int $user A user name or number - * @param bool $recursive Whether change the owner recursively or not - * - * @throws IOException When the change fails - */ - public function chown(string|iterable $files, string|int $user, bool $recursive = false): void - { - foreach ($this->toIterable($files) as $file) { - if ($recursive && is_dir($file) && !is_link($file)) { - $this->chown(new \FilesystemIterator($file), $user, true); - } - if (is_link($file) && \function_exists('lchown')) { - if (!self::box('lchown', $file, $user)) { - throw new IOException(\sprintf('Failed to chown file "%s": ', $file).self::$lastError, 0, null, $file); - } - } else { - if (!self::box('chown', $file, $user)) { - throw new IOException(\sprintf('Failed to chown file "%s": ', $file).self::$lastError, 0, null, $file); - } - } - } - } - - /** - * Change the group of an array of files or directories. - * - * This method always throws on Windows, as the underlying PHP function is not supported. - * - * @see https://www.php.net/chgrp - * - * @param string|int $group A group name or number - * @param bool $recursive Whether change the group recursively or not - * - * @throws IOException When the change fails - */ - public function chgrp(string|iterable $files, string|int $group, bool $recursive = false): void - { - foreach ($this->toIterable($files) as $file) { - if ($recursive && is_dir($file) && !is_link($file)) { - $this->chgrp(new \FilesystemIterator($file), $group, true); - } - if (is_link($file) && \function_exists('lchgrp')) { - if (!self::box('lchgrp', $file, $group)) { - throw new IOException(\sprintf('Failed to chgrp file "%s": ', $file).self::$lastError, 0, null, $file); - } - } else { - if (!self::box('chgrp', $file, $group)) { - throw new IOException(\sprintf('Failed to chgrp file "%s": ', $file).self::$lastError, 0, null, $file); - } - } - } - } - - /** - * Renames a file or a directory. - * - * @throws IOException When target file or directory already exists - * @throws IOException When origin cannot be renamed - */ - public function rename(string $origin, string $target, bool $overwrite = false): void - { - // we check that target does not exist - if (!$overwrite && $this->isReadable($target)) { - throw new IOException(\sprintf('Cannot rename because the target "%s" already exists.', $target), 0, null, $target); - } - - if (!self::box('rename', $origin, $target)) { - if (is_dir($origin)) { - // See https://bugs.php.net/54097 & https://php.net/rename#113943 - $this->mirror($origin, $target, null, ['override' => $overwrite, 'delete' => $overwrite]); - $this->remove($origin); - - return; - } - throw new IOException(\sprintf('Cannot rename "%s" to "%s": ', $origin, $target).self::$lastError, 0, null, $target); - } - } - - /** - * Tells whether a file exists and is readable. - * - * @throws IOException When windows path is longer than 258 characters - */ - private function isReadable(string $filename): bool - { - $maxPathLength = \PHP_MAXPATHLEN - 2; - - if (\strlen($filename) > $maxPathLength) { - throw new IOException(\sprintf('Could not check if file is readable because path length exceeds %d characters.', $maxPathLength), 0, null, $filename); - } - - return is_readable($filename); - } - - /** - * Creates a symbolic link or copy a directory. - * - * @throws IOException When symlink fails - */ - public function symlink(string $originDir, string $targetDir, bool $copyOnWindows = false): void - { - self::assertFunctionExists('symlink'); - - if ('\\' === \DIRECTORY_SEPARATOR) { - $originDir = strtr($originDir, '/', '\\'); - $targetDir = strtr($targetDir, '/', '\\'); - - if ($copyOnWindows) { - $this->mirror($originDir, $targetDir); - - return; - } - } - - $this->mkdir(\dirname($targetDir)); - - if (is_link($targetDir)) { - if (readlink($targetDir) === $originDir) { - return; - } - $this->remove($targetDir); - } - - if (!self::box('symlink', $originDir, $targetDir)) { - $this->linkException($originDir, $targetDir, 'symbolic'); - } - } - - /** - * Creates a hard link, or several hard links to a file. - * - * @param string|string[] $targetFiles The target file(s) - * - * @throws FileNotFoundException When original file is missing or not a file - * @throws IOException When link fails, including if link already exists - */ - public function hardlink(string $originFile, string|iterable $targetFiles): void - { - self::assertFunctionExists('link'); - - if (!$this->exists($originFile)) { - throw new FileNotFoundException(null, 0, null, $originFile); - } - - if (!is_file($originFile)) { - throw new FileNotFoundException(\sprintf('Origin file "%s" is not a file.', $originFile)); - } - - foreach ($this->toIterable($targetFiles) as $targetFile) { - if (is_file($targetFile)) { - if (fileinode($originFile) === fileinode($targetFile)) { - continue; - } - $this->remove($targetFile); - } - - if (!self::box('link', $originFile, $targetFile)) { - $this->linkException($originFile, $targetFile, 'hard'); - } - } - } - - /** - * @param string $linkType Name of the link type, typically 'symbolic' or 'hard' - */ - private function linkException(string $origin, string $target, string $linkType): never - { - if (self::$lastError) { - if ('\\' === \DIRECTORY_SEPARATOR && str_contains(self::$lastError, 'error code(1314)')) { - throw new IOException(\sprintf('Unable to create "%s" link due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?', $linkType), 0, null, $target); - } - } - throw new IOException(\sprintf('Failed to create "%s" link from "%s" to "%s": ', $linkType, $origin, $target).self::$lastError, 0, null, $target); - } - - /** - * Resolves links in paths. - * - * With $canonicalize = false (default) - * - if $path does not exist or is not a link, returns null - * - if $path is a link, returns the next direct target of the link without considering the existence of the target - * - * With $canonicalize = true - * - if $path does not exist, returns null - * - if $path exists, returns its absolute fully resolved final version - */ - public function readlink(string $path, bool $canonicalize = false): ?string - { - if (!$canonicalize && !is_link($path)) { - return null; - } - - if ($canonicalize) { - if (!$this->exists($path)) { - return null; - } - - return realpath($path); - } - - return readlink($path); - } - - /** - * Given an existing path, convert it to a path relative to a given starting path. - */ - public function makePathRelative(string $endPath, string $startPath): string - { - if (!$this->isAbsolutePath($startPath)) { - throw new InvalidArgumentException(\sprintf('The start path "%s" is not absolute.', $startPath)); - } - - if (!$this->isAbsolutePath($endPath)) { - throw new InvalidArgumentException(\sprintf('The end path "%s" is not absolute.', $endPath)); - } - - // Normalize separators on Windows - if ('\\' === \DIRECTORY_SEPARATOR) { - $endPath = str_replace('\\', '/', $endPath); - $startPath = str_replace('\\', '/', $startPath); - } - - $splitDriveLetter = fn ($path) => (\strlen($path) > 2 && ':' === $path[1] && '/' === $path[2] && ctype_alpha($path[0])) - ? [substr($path, 2), strtoupper($path[0])] - : [$path, null]; - - $splitPath = function ($path) { - $result = []; - - foreach (explode('/', trim($path, '/')) as $segment) { - if ('..' === $segment) { - array_pop($result); - } elseif ('.' !== $segment && '' !== $segment) { - $result[] = $segment; - } - } - - return $result; - }; - - [$endPath, $endDriveLetter] = $splitDriveLetter($endPath); - [$startPath, $startDriveLetter] = $splitDriveLetter($startPath); - - $startPathArr = $splitPath($startPath); - $endPathArr = $splitPath($endPath); - - if ($endDriveLetter && $startDriveLetter && $endDriveLetter != $startDriveLetter) { - // End path is on another drive, so no relative path exists - return $endDriveLetter.':/'.($endPathArr ? implode('/', $endPathArr).'/' : ''); - } - - // Find for which directory the common path stops - $index = 0; - while (isset($startPathArr[$index]) && isset($endPathArr[$index]) && $startPathArr[$index] === $endPathArr[$index]) { - ++$index; - } - - // Determine how deep the start path is relative to the common path (ie, "web/bundles" = 2 levels) - if (1 === \count($startPathArr) && '' === $startPathArr[0]) { - $depth = 0; - } else { - $depth = \count($startPathArr) - $index; - } - - // Repeated "../" for each level need to reach the common path - $traverser = str_repeat('../', $depth); - - $endPathRemainder = implode('/', \array_slice($endPathArr, $index)); - - // Construct $endPath from traversing to the common path, then to the remaining $endPath - $relativePath = $traverser.('' !== $endPathRemainder ? $endPathRemainder.'/' : ''); - - return '' === $relativePath ? './' : $relativePath; - } - - /** - * Mirrors a directory to another. - * - * Copies files and directories from the origin directory into the target directory. By default: - * - * - existing files in the target directory will be overwritten, except if they are newer (see the `override` option) - * - files in the target directory that do not exist in the source directory will not be deleted (see the `delete` option) - * - * @param \Traversable|null $iterator Iterator that filters which files and directories to copy, if null a recursive iterator is created - * @param array $options An array of boolean options - * Valid options are: - * - $options['override'] If true, target files newer than origin files are overwritten (see copy(), defaults to false) - * - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink(), defaults to false) - * - $options['delete'] Whether to delete files that are not in the source directory (defaults to false) - * - * @throws IOException When file type is unknown - */ - public function mirror(string $originDir, string $targetDir, ?\Traversable $iterator = null, array $options = []): void - { - $targetDir = rtrim($targetDir, '/\\'); - $originDir = rtrim($originDir, '/\\'); - $originDirLen = \strlen($originDir); - - if (!$this->exists($originDir)) { - throw new IOException(\sprintf('The origin directory specified "%s" was not found.', $originDir), 0, null, $originDir); - } - - // Iterate in destination folder to remove obsolete entries - if ($this->exists($targetDir) && isset($options['delete']) && $options['delete']) { - $deleteIterator = $iterator; - if (null === $deleteIterator) { - $flags = \FilesystemIterator::SKIP_DOTS; - $deleteIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($targetDir, $flags), \RecursiveIteratorIterator::CHILD_FIRST); - } - $targetDirLen = \strlen($targetDir); - foreach ($deleteIterator as $file) { - $origin = $originDir.substr($file->getPathname(), $targetDirLen); - if (!$this->exists($origin)) { - $this->remove($file); - } - } - } - - $copyOnWindows = $options['copy_on_windows'] ?? false; - - if (null === $iterator) { - $flags = $copyOnWindows ? \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS : \FilesystemIterator::SKIP_DOTS; - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($originDir, $flags), \RecursiveIteratorIterator::SELF_FIRST); - } - - $this->mkdir($targetDir); - $filesCreatedWhileMirroring = []; - - foreach ($iterator as $file) { - if ($file->getPathname() === $targetDir || $file->getRealPath() === $targetDir || isset($filesCreatedWhileMirroring[$file->getRealPath()])) { - continue; - } - - $target = $targetDir.substr($file->getPathname(), $originDirLen); - $filesCreatedWhileMirroring[$target] = true; - - if (!$copyOnWindows && is_link($file)) { - $this->symlink($file->getLinkTarget(), $target); - } elseif (is_dir($file)) { - $this->mkdir($target); - } elseif (is_file($file)) { - $this->copy($file, $target, $options['override'] ?? false); - } else { - throw new IOException(\sprintf('Unable to guess "%s" file type.', $file), 0, null, $file); - } - } - } - - /** - * Returns whether the file path is an absolute path. - */ - public function isAbsolutePath(string $file): bool - { - return '' !== $file && (strspn($file, '/\\', 0, 1) - || (\strlen($file) > 3 && ctype_alpha($file[0]) - && ':' === $file[1] - && strspn($file, '/\\', 2, 1) - ) - || null !== parse_url($file, \PHP_URL_SCHEME) - ); - } - - /** - * Creates a temporary file with support for custom stream wrappers. - * - * @param string $prefix The prefix of the generated temporary filename - * Note: Windows uses only the first three characters of prefix - * @param string $suffix The suffix of the generated temporary filename - * - * @return string The new temporary filename (with path), or throw an exception on failure - */ - public function tempnam(string $dir, string $prefix, string $suffix = ''): string - { - [$scheme, $hierarchy] = $this->getSchemeAndHierarchy($dir); - - // If no scheme or scheme is "file" or "gs" (Google Cloud) create temp file in local filesystem - if ((null === $scheme || 'file' === $scheme || 'gs' === $scheme) && '' === $suffix) { - // If tempnam failed or no scheme return the filename otherwise prepend the scheme - if ($tmpFile = self::box('tempnam', $hierarchy, $prefix)) { - if (null !== $scheme && 'gs' !== $scheme) { - return $scheme.'://'.$tmpFile; - } - - return $tmpFile; - } - - throw new IOException('A temporary file could not be created: '.self::$lastError); - } - - // Loop until we create a valid temp file or have reached 10 attempts - for ($i = 0; $i < 10; ++$i) { - // Create a unique filename - $tmpFile = $dir.'/'.$prefix.bin2hex(random_bytes(4)).$suffix; - - // Use fopen instead of file_exists as some streams do not support stat - // Use mode 'x+' to atomically check existence and create to avoid a TOCTOU vulnerability - if (!$handle = self::box('fopen', $tmpFile, 'x+')) { - continue; - } - - // Close the file if it was successfully opened - self::box('fclose', $handle); - - return $tmpFile; - } - - throw new IOException('A temporary file could not be created: '.self::$lastError); - } - - /** - * Atomically dumps content into a file. - * - * @param string|resource $content The data to write into the file - * - * @throws IOException if the file cannot be written to - */ - public function dumpFile(string $filename, $content): void - { - if (\is_array($content)) { - throw new \TypeError(\sprintf('Argument 2 passed to "%s()" must be string or resource, array given.', __METHOD__)); - } - - $dir = \dirname($filename); - - if (is_link($filename) && $linkTarget = $this->readlink($filename)) { - $this->dumpFile(Path::makeAbsolute($linkTarget, $dir), $content); - - return; - } - - if (!is_dir($dir)) { - $this->mkdir($dir); - } - - // Will create a temp file with 0600 access rights - // when the filesystem supports chmod. - $tmpFile = $this->tempnam($dir, basename($filename)); - - try { - if (false === self::box('file_put_contents', $tmpFile, $content)) { - throw new IOException(\sprintf('Failed to write file "%s": ', $filename).self::$lastError, 0, null, $filename); - } - - self::box('chmod', $tmpFile, self::box('fileperms', $filename) ?: 0666 & ~umask()); - - $this->rename($tmpFile, $filename, true); - } finally { - if (file_exists($tmpFile)) { - if ('\\' === \DIRECTORY_SEPARATOR && !is_writable($tmpFile)) { - self::box('chmod', $tmpFile, self::box('fileperms', $tmpFile) | 0200); - } - - self::box('unlink', $tmpFile); - } - } - } - - /** - * Appends content to an existing file. - * - * @param string|resource $content The content to append - * @param bool $lock Whether the file should be locked when writing to it - * - * @throws IOException If the file is not writable - */ - public function appendToFile(string $filename, $content, bool $lock = false): void - { - if (\is_array($content)) { - throw new \TypeError(\sprintf('Argument 2 passed to "%s()" must be string or resource, array given.', __METHOD__)); - } - - $dir = \dirname($filename); - - if (!is_dir($dir)) { - $this->mkdir($dir); - } - - if (false === self::box('file_put_contents', $filename, $content, \FILE_APPEND | ($lock ? \LOCK_EX : 0))) { - throw new IOException(\sprintf('Failed to write file "%s": ', $filename).self::$lastError, 0, null, $filename); - } - } - - /** - * Returns the content of a file as a string. - * - * @throws IOException If the file cannot be read - */ - public function readFile(string $filename): string - { - if (is_dir($filename)) { - throw new IOException(\sprintf('Failed to read file "%s": File is a directory.', $filename)); - } - - $content = self::box('file_get_contents', $filename); - if (false === $content) { - throw new IOException(\sprintf('Failed to read file "%s": ', $filename).self::$lastError, 0, null, $filename); - } - - return $content; - } - - private function toIterable(string|iterable $files): iterable - { - return is_iterable($files) ? $files : [$files]; - } - - /** - * Gets a 2-tuple of scheme (may be null) and hierarchical part of a filename (e.g. file:///tmp -> [file, tmp]). - */ - private function getSchemeAndHierarchy(string $filename): array - { - $components = explode('://', $filename, 2); - - return 2 === \count($components) ? [$components[0], $components[1]] : [null, $components[0]]; - } - - private static function assertFunctionExists(string $func): void - { - if (!\function_exists($func)) { - throw new IOException(\sprintf('Unable to perform filesystem operation because the "%s()" function has been disabled.', $func)); - } - } - - private static function box(string $func, mixed ...$args): mixed - { - self::assertFunctionExists($func); - - self::$lastError = null; - set_error_handler(self::handleError(...)); - try { - return $func(...$args); - } finally { - restore_error_handler(); - } - } - - /** - * @internal - */ - public static function handleError(int $type, string $msg): void - { - self::$lastError = $msg; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/LICENSE b/tools/php-cs-fixer/vendor/symfony/filesystem/LICENSE deleted file mode 100644 index 0138f8f0..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/Path.php b/tools/php-cs-fixer/vendor/symfony/filesystem/Path.php deleted file mode 100644 index 2f2e8790..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/Path.php +++ /dev/null @@ -1,816 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Filesystem; - -use Symfony\Component\Filesystem\Exception\InvalidArgumentException; -use Symfony\Component\Filesystem\Exception\RuntimeException; - -/** - * Contains utility methods for handling path strings. - * - * The methods in this class are able to deal with both UNIX and Windows paths - * with both forward and backward slashes. All methods return normalized parts - * containing only forward slashes and no excess "." and ".." segments. - * - * @author Bernhard Schussek - * @author Thomas Schulz - * @author Théo Fidry - */ -final class Path -{ - /** - * The number of buffer entries that triggers a cleanup operation. - */ - private const CLEANUP_THRESHOLD = 1250; - - /** - * The buffer size after the cleanup operation. - */ - private const CLEANUP_SIZE = 1000; - - /** - * Buffers input/output of {@link canonicalize()}. - * - * @var array - */ - private static array $buffer = []; - - private static int $bufferSize = 0; - - /** - * Canonicalizes the given path. - * - * During normalization, all slashes are replaced by forward slashes ("/"). - * Furthermore, all "." and ".." segments are removed as far as possible. - * ".." segments at the beginning of relative paths are not removed. - * - * ```php - * echo Path::canonicalize("\symfony\puli\..\css\style.css"); - * // => /symfony/css/style.css - * - * echo Path::canonicalize("../css/./style.css"); - * // => ../css/style.css - * ``` - * - * This method is able to deal with both UNIX and Windows paths. - */ - public static function canonicalize(string $path): string - { - if ('' === $path) { - return ''; - } - - // This method is called by many other methods in this class. Buffer - // the canonicalized paths to make up for the severe performance - // decrease. - if (isset(self::$buffer[$path])) { - return self::$buffer[$path]; - } - - // Replace "~" with user's home directory. - if ('~' === $path[0]) { - $path = self::getHomeDirectory().substr($path, 1); - } - - $path = self::normalize($path); - - [$root, $pathWithoutRoot] = self::split($path); - - $canonicalParts = self::findCanonicalParts($root, $pathWithoutRoot); - - // Add the root directory again - self::$buffer[$path] = $canonicalPath = $root.implode('/', $canonicalParts); - ++self::$bufferSize; - - // Clean up regularly to prevent memory leaks - if (self::$bufferSize > self::CLEANUP_THRESHOLD) { - self::$buffer = \array_slice(self::$buffer, -self::CLEANUP_SIZE, null, true); - self::$bufferSize = self::CLEANUP_SIZE; - } - - return $canonicalPath; - } - - /** - * Normalizes the given path. - * - * During normalization, all slashes are replaced by forward slashes ("/"). - * Contrary to {@link canonicalize()}, this method does not remove invalid - * or dot path segments. Consequently, it is much more efficient and should - * be used whenever the given path is known to be a valid, absolute system - * path. - * - * This method is able to deal with both UNIX and Windows paths. - */ - public static function normalize(string $path): string - { - return str_replace('\\', '/', $path); - } - - /** - * Returns the directory part of the path. - * - * This method is similar to PHP's dirname(), but handles various cases - * where dirname() returns a weird result: - * - * - dirname() does not accept backslashes on UNIX - * - dirname("C:/symfony") returns "C:", not "C:/" - * - dirname("C:/") returns ".", not "C:/" - * - dirname("C:") returns ".", not "C:/" - * - dirname("symfony") returns ".", not "" - * - dirname() does not canonicalize the result - * - * This method fixes these shortcomings and behaves like dirname() - * otherwise. - * - * The result is a canonical path. - * - * @return string The canonical directory part. Returns the root directory - * if the root directory is passed. Returns an empty string - * if a relative path is passed that contains no slashes. - * Returns an empty string if an empty string is passed. - */ - public static function getDirectory(string $path): string - { - if ('' === $path) { - return ''; - } - - $path = self::canonicalize($path); - - // Maintain scheme - if (false !== $schemeSeparatorPosition = strpos($path, '://')) { - $scheme = substr($path, 0, $schemeSeparatorPosition + 3); - $path = substr($path, $schemeSeparatorPosition + 3); - } else { - $scheme = ''; - } - - if (false === $dirSeparatorPosition = strrpos($path, '/')) { - return ''; - } - - // Directory equals root directory "/" - if (0 === $dirSeparatorPosition) { - return $scheme.'/'; - } - - // Directory equals Windows root "C:/" - if (2 === $dirSeparatorPosition && ctype_alpha($path[0]) && ':' === $path[1]) { - return $scheme.substr($path, 0, 3); - } - - return $scheme.substr($path, 0, $dirSeparatorPosition); - } - - /** - * Returns canonical path of the user's home directory. - * - * Supported operating systems: - * - * - UNIX - * - Windows8 and upper - * - * If your operating system or environment isn't supported, an exception is thrown. - * - * The result is a canonical path. - * - * @throws RuntimeException If your operating system or environment isn't supported - */ - public static function getHomeDirectory(): string - { - // For UNIX support - if (getenv('HOME')) { - return self::canonicalize(getenv('HOME')); - } - - // For >= Windows8 support - if (getenv('HOMEDRIVE') && getenv('HOMEPATH')) { - return self::canonicalize(getenv('HOMEDRIVE').getenv('HOMEPATH')); - } - - throw new RuntimeException("Cannot find the home directory path: Your environment or operating system isn't supported."); - } - - /** - * Returns the root directory of a path. - * - * The result is a canonical path. - * - * @return string The canonical root directory. Returns an empty string if - * the given path is relative or empty. - */ - public static function getRoot(string $path): string - { - if ('' === $path) { - return ''; - } - - // Maintain scheme - if (false !== $schemeSeparatorPosition = strpos($path, '://')) { - $scheme = substr($path, 0, $schemeSeparatorPosition + 3); - $path = substr($path, $schemeSeparatorPosition + 3); - } else { - $scheme = ''; - } - - $firstCharacter = $path[0]; - - // UNIX root "/" or "\" (Windows style) - if ('/' === $firstCharacter || '\\' === $firstCharacter) { - return $scheme.'/'; - } - - $length = \strlen($path); - - // Windows root - if ($length > 1 && ':' === $path[1] && ctype_alpha($firstCharacter)) { - // Special case: "C:" - if (2 === $length) { - return $scheme.$path.'/'; - } - - // Normal case: "C:/ or "C:\" - if ('/' === $path[2] || '\\' === $path[2]) { - return $scheme.$firstCharacter.$path[1].'/'; - } - } - - return ''; - } - - /** - * Returns the file name without the extension from a file path. - * - * @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 - { - if ('' === $path) { - return ''; - } - - if (null !== $extension) { - // remove extension and trailing dot - return rtrim(basename($path, $extension), '.'); - } - - return pathinfo($path, \PATHINFO_FILENAME); - } - - /** - * Returns the extension from a file path (without leading dot). - * - * @param bool $forceLowerCase forces the extension to be lower-case - */ - public static function getExtension(string $path, bool $forceLowerCase = false): string - { - if ('' === $path) { - return ''; - } - - $extension = pathinfo($path, \PATHINFO_EXTENSION); - - if ($forceLowerCase) { - $extension = self::toLower($extension); - } - - return $extension; - } - - /** - * Returns whether the path has an (or the specified) extension. - * - * @param string $path the path string - * @param string|string[]|null $extensions if null or not provided, checks if - * an extension exists, otherwise - * checks for the specified extension - * or array of extensions (with or - * without leading dot) - * @param bool $ignoreCase whether to ignore case-sensitivity - */ - public static function hasExtension(string $path, $extensions = null, bool $ignoreCase = false): bool - { - if ('' === $path) { - return false; - } - - $actualExtension = self::getExtension($path, $ignoreCase); - - // Only check if path has any extension - if ([] === $extensions || null === $extensions) { - return '' !== $actualExtension; - } - - if (\is_string($extensions)) { - $extensions = [$extensions]; - } - - foreach ($extensions as $key => $extension) { - if ($ignoreCase) { - $extension = self::toLower($extension); - } - - // remove leading '.' in extensions array - $extensions[$key] = ltrim($extension, '.'); - } - - return \in_array($actualExtension, $extensions, true); - } - - /** - * Changes the extension of a path string. - * - * @param string $path The path string with filename.ext to change. - * @param string $extension new extension (with or without leading dot) - * - * @return string the path string with new file extension - */ - public static function changeExtension(string $path, string $extension): string - { - if ('' === $path) { - return ''; - } - - $actualExtension = self::getExtension($path); - $extension = ltrim($extension, '.'); - - // No extension for paths - if (str_ends_with($path, '/')) { - return $path; - } - - // No actual extension in path - if (!$actualExtension) { - return $path.(str_ends_with($path, '.') ? '' : '.').$extension; - } - - return substr($path, 0, -\strlen($actualExtension)).$extension; - } - - public static function isAbsolute(string $path): bool - { - if ('' === $path) { - return false; - } - - // Strip scheme - if (false !== ($schemeSeparatorPosition = strpos($path, '://')) && 1 !== $schemeSeparatorPosition) { - $path = substr($path, $schemeSeparatorPosition + 3); - } - - $firstCharacter = $path[0]; - - // UNIX root "/" or "\" (Windows style) - if ('/' === $firstCharacter || '\\' === $firstCharacter) { - return true; - } - - // Windows root - if (\strlen($path) > 1 && ctype_alpha($firstCharacter) && ':' === $path[1]) { - // Special case: "C:" - if (2 === \strlen($path)) { - return true; - } - - // Normal case: "C:/ or "C:\" - if ('/' === $path[2] || '\\' === $path[2]) { - return true; - } - } - - return false; - } - - public static function isRelative(string $path): bool - { - return !self::isAbsolute($path); - } - - /** - * Turns a relative path into an absolute path in canonical form. - * - * Usually, the relative path is appended to the given base path. Dot - * segments ("." and "..") are removed/collapsed and all slashes turned - * into forward slashes. - * - * ```php - * echo Path::makeAbsolute("../style.css", "/symfony/puli/css"); - * // => /symfony/puli/style.css - * ``` - * - * If an absolute path is passed, that path is returned unless its root - * directory is different than the one of the base path. In that case, an - * exception is thrown. - * - * ```php - * Path::makeAbsolute("/style.css", "/symfony/puli/css"); - * // => /style.css - * - * Path::makeAbsolute("C:/style.css", "C:/symfony/puli/css"); - * // => C:/style.css - * - * Path::makeAbsolute("C:/style.css", "/symfony/puli/css"); - * // InvalidArgumentException - * ``` - * - * If the base path is not an absolute path, an exception is thrown. - * - * The result is a canonical path. - * - * @param string $basePath an absolute base path - * - * @throws InvalidArgumentException if the base path is not absolute or if - * the given path is an absolute path with - * a different root than the base path - */ - public static function makeAbsolute(string $path, string $basePath): string - { - if ('' === $basePath) { - throw new InvalidArgumentException(\sprintf('The base path must be a non-empty string. Got: "%s".', $basePath)); - } - - if (!self::isAbsolute($basePath)) { - throw new InvalidArgumentException(\sprintf('The base path "%s" is not an absolute path.', $basePath)); - } - - if (self::isAbsolute($path)) { - return self::canonicalize($path); - } - - if (false !== $schemeSeparatorPosition = strpos($basePath, '://')) { - $scheme = substr($basePath, 0, $schemeSeparatorPosition + 3); - $basePath = substr($basePath, $schemeSeparatorPosition + 3); - } else { - $scheme = ''; - } - - return $scheme.self::canonicalize(rtrim($basePath, '/\\').'/'.$path); - } - - /** - * Turns a path into a relative path. - * - * The relative path is created relative to the given base path: - * - * ```php - * echo Path::makeRelative("/symfony/style.css", "/symfony/puli"); - * // => ../style.css - * ``` - * - * If a relative path is passed and the base path is absolute, the relative - * path is returned unchanged: - * - * ```php - * Path::makeRelative("style.css", "/symfony/puli/css"); - * // => style.css - * ``` - * - * If both paths are relative, the relative path is created with the - * assumption that both paths are relative to the same directory: - * - * ```php - * Path::makeRelative("style.css", "symfony/puli/css"); - * // => ../../../style.css - * ``` - * - * If both paths are absolute, their root directory must be the same, - * otherwise an exception is thrown: - * - * ```php - * Path::makeRelative("C:/symfony/style.css", "/symfony/puli"); - * // InvalidArgumentException - * ``` - * - * If the passed path is absolute, but the base path is not, an exception - * is thrown as well: - * - * ```php - * Path::makeRelative("/symfony/style.css", "symfony/puli"); - * // InvalidArgumentException - * ``` - * - * If the base path is not an absolute path, an exception is thrown. - * - * The result is a canonical path. - * - * @throws InvalidArgumentException if the base path is not absolute or if - * the given path has a different root - * than the base path - */ - public static function makeRelative(string $path, string $basePath): string - { - $path = self::canonicalize($path); - $basePath = self::canonicalize($basePath); - - [$root, $relativePath] = self::split($path); - [$baseRoot, $relativeBasePath] = self::split($basePath); - - // If the base path is given as absolute path and the path is already - // relative, consider it to be relative to the given absolute path - // already - if ('' === $root && '' !== $baseRoot) { - // If base path is already in its root - if ('' === $relativeBasePath) { - $relativePath = ltrim($relativePath, './\\'); - } - - return $relativePath; - } - - // If the passed path is absolute, but the base path is not, we - // cannot generate a relative path - if ('' !== $root && '' === $baseRoot) { - throw new InvalidArgumentException(\sprintf('The absolute path "%s" cannot be made relative to the relative path "%s". You should provide an absolute base path instead.', $path, $basePath)); - } - - // Fail if the roots of the two paths are different - if ($baseRoot && $root !== $baseRoot) { - throw new InvalidArgumentException(\sprintf('The path "%s" cannot be made relative to "%s", because they have different roots ("%s" and "%s").', $path, $basePath, $root, $baseRoot)); - } - - if ('' === $relativeBasePath) { - return $relativePath; - } - - // Build a "../../" prefix with as many "../" parts as necessary - $parts = explode('/', $relativePath); - $baseParts = explode('/', $relativeBasePath); - $dotDotPrefix = ''; - - // Once we found a non-matching part in the prefix, we need to add - // "../" parts for all remaining parts - $match = true; - - foreach ($baseParts as $index => $basePart) { - if ($match && isset($parts[$index]) && $basePart === $parts[$index]) { - unset($parts[$index]); - - continue; - } - - $match = false; - $dotDotPrefix .= '../'; - } - - return rtrim($dotDotPrefix.implode('/', $parts), '/'); - } - - /** - * Returns whether the given path is on the local filesystem. - */ - public static function isLocal(string $path): bool - { - return '' !== $path && !str_contains($path, '://'); - } - - /** - * Returns the longest common base path in canonical form of a set of paths or - * `null` if the paths are on different Windows partitions. - * - * Dot segments ("." and "..") are removed/collapsed and all slashes turned - * into forward slashes. - * - * ```php - * $basePath = Path::getLongestCommonBasePath( - * '/symfony/css/style.css', - * '/symfony/css/..' - * ); - * // => /symfony - * ``` - * - * The root is returned if no common base path can be found: - * - * ```php - * $basePath = Path::getLongestCommonBasePath( - * '/symfony/css/style.css', - * '/puli/css/..' - * ); - * // => / - * ``` - * - * If the paths are located on different Windows partitions, `null` is - * returned. - * - * ```php - * $basePath = Path::getLongestCommonBasePath( - * 'C:/symfony/css/style.css', - * 'D:/symfony/css/..' - * ); - * // => null - * ``` - */ - public static function getLongestCommonBasePath(string ...$paths): ?string - { - [$bpRoot, $basePath] = self::split(self::canonicalize(reset($paths))); - - for (next($paths); null !== key($paths) && '' !== $basePath; next($paths)) { - [$root, $path] = self::split(self::canonicalize(current($paths))); - - // If we deal with different roots (e.g. C:/ vs. D:/), it's time - // to quit - if ($root !== $bpRoot) { - return null; - } - - // Make the base path shorter until it fits into path - while (true) { - if ('.' === $basePath) { - // No more base paths - $basePath = ''; - - // next path - continue 2; - } - - // Prevent false positives for common prefixes - // see isBasePath() - if (str_starts_with($path.'/', $basePath.'/')) { - // next path - continue 2; - } - - $basePath = \dirname($basePath); - } - } - - return $bpRoot.$basePath; - } - - /** - * Joins two or more path strings into a canonical path. - */ - public static function join(string ...$paths): string - { - $finalPath = null; - $wasScheme = false; - - foreach ($paths as $path) { - if ('' === $path) { - continue; - } - - if (null === $finalPath) { - // For first part we keep slashes, like '/top', 'C:\' or 'phar://' - $finalPath = $path; - $wasScheme = str_contains($path, '://'); - continue; - } - - // Only add slash if previous part didn't end with '/' or '\' - if (!\in_array(substr($finalPath, -1), ['/', '\\'], true)) { - $finalPath .= '/'; - } - - // If first part included a scheme like 'phar://' we allow \current part to start with '/', otherwise trim - $finalPath .= $wasScheme ? $path : ltrim($path, '/'); - $wasScheme = false; - } - - if (null === $finalPath) { - return ''; - } - - return self::canonicalize($finalPath); - } - - /** - * Returns whether a path is a base path of another path. - * - * Dot segments ("." and "..") are removed/collapsed and all slashes turned - * into forward slashes. - * - * ```php - * Path::isBasePath('/symfony', '/symfony/css'); - * // => true - * - * Path::isBasePath('/symfony', '/symfony'); - * // => true - * - * Path::isBasePath('/symfony', '/symfony/..'); - * // => false - * - * Path::isBasePath('/symfony', '/puli'); - * // => false - * ``` - */ - public static function isBasePath(string $basePath, string $ofPath): bool - { - $basePath = self::canonicalize($basePath); - $ofPath = self::canonicalize($ofPath); - - // Append slashes to prevent false positives when two paths have - // a common prefix, for example /base/foo and /base/foobar. - // Don't append a slash for the root "/", because then that root - // won't be discovered as common prefix ("//" is not a prefix of - // "/foobar/"). - return str_starts_with($ofPath.'/', rtrim($basePath, '/').'/'); - } - - /** - * @return string[] - */ - private static function findCanonicalParts(string $root, string $pathWithoutRoot): array - { - $parts = explode('/', $pathWithoutRoot); - - $canonicalParts = []; - - // Collapse "." and "..", if possible - foreach ($parts as $part) { - if ('.' === $part || '' === $part) { - continue; - } - - // Collapse ".." with the previous part, if one exists - // Don't collapse ".." if the previous part is also ".." - if ('..' === $part && \count($canonicalParts) > 0 && '..' !== $canonicalParts[\count($canonicalParts) - 1]) { - array_pop($canonicalParts); - - continue; - } - - // Only add ".." prefixes for relative paths - if ('..' !== $part || '' === $root) { - $canonicalParts[] = $part; - } - } - - return $canonicalParts; - } - - /** - * Splits a canonical path into its root directory and the remainder. - * - * If the path has no root directory, an empty root directory will be - * returned. - * - * If the root directory is a Windows style partition, the resulting root - * will always contain a trailing slash. - * - * list ($root, $path) = Path::split("C:/symfony") - * // => ["C:/", "symfony"] - * - * list ($root, $path) = Path::split("C:") - * // => ["C:/", ""] - * - * @return array{string, string} an array with the root directory and the remaining relative path - */ - private static function split(string $path): array - { - if ('' === $path) { - return ['', '']; - } - - // Remember scheme as part of the root, if any - if (false !== $schemeSeparatorPosition = strpos($path, '://')) { - $root = substr($path, 0, $schemeSeparatorPosition + 3); - $path = substr($path, $schemeSeparatorPosition + 3); - } else { - $root = ''; - } - - $length = \strlen($path); - - // Remove and remember root directory - if (str_starts_with($path, '/')) { - $root .= '/'; - $path = $length > 1 ? substr($path, 1) : ''; - } elseif ($length > 1 && ctype_alpha($path[0]) && ':' === $path[1]) { - if (2 === $length) { - // Windows special case: "C:" - $root .= $path.'/'; - $path = ''; - } elseif ('/' === $path[2]) { - // Windows normal case: "C:/".. - $root .= substr($path, 0, 3); - $path = $length > 3 ? substr($path, 3) : ''; - } - } - - return [$root, $path]; - } - - private static function toLower(string $string): string - { - if (false !== $encoding = mb_detect_encoding($string, null, true)) { - return mb_strtolower($string, $encoding); - } - - return strtolower($string); - } - - private function __construct() - { - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/README.md b/tools/php-cs-fixer/vendor/symfony/filesystem/README.md deleted file mode 100644 index f2f6d45f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Filesystem Component -==================== - -The Filesystem component provides basic utilities for the filesystem. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/filesystem.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/tools/php-cs-fixer/vendor/symfony/filesystem/composer.json b/tools/php-cs-fixer/vendor/symfony/filesystem/composer.json deleted file mode 100644 index c781e55b..00000000 --- a/tools/php-cs-fixer/vendor/symfony/filesystem/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "symfony/filesystem", - "type": "library", - "description": "Provides basic utilities for the filesystem", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "require-dev": { - "symfony/process": "^6.4|^7.0" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Filesystem\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/finder/CHANGELOG.md deleted file mode 100644 index e8383024..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/CHANGELOG.md +++ /dev/null @@ -1,103 +0,0 @@ -CHANGELOG -========= - -6.4 ---- - - * Add early directory pruning to `Finder::filter()` - -6.2 ---- - - * Add `Finder::sortByExtension()` and `Finder::sortBySize()` - * Add `Finder::sortByCaseInsensitiveName()` to sort by name with case insensitive sorting methods - -6.0 ---- - - * Remove `Comparator::setTarget()` and `Comparator::setOperator()` - -5.4.0 ------ - - * Deprecate `Comparator::setTarget()` and `Comparator::setOperator()` - * Add a constructor to `Comparator` that allows setting target and operator - * Finder's iterator has now `Symfony\Component\Finder\SplFileInfo` inner type specified - * Add recursive .gitignore files support - -5.0.0 ------ - - * added `$useNaturalSort` argument to `Finder::sortByName()` - -4.3.0 ------ - - * added Finder::ignoreVCSIgnored() to ignore files based on rules listed in .gitignore - -4.2.0 ------ - - * added $useNaturalSort option to Finder::sortByName() method - * the `Finder::sortByName()` method will have a new `$useNaturalSort` - argument in version 5.0, not defining it is deprecated - * added `Finder::reverseSorting()` to reverse the sorting - -4.0.0 ------ - - * removed `ExceptionInterface` - * removed `Symfony\Component\Finder\Iterator\FilterIterator` - -3.4.0 ------ - - * deprecated `Symfony\Component\Finder\Iterator\FilterIterator` - * added Finder::hasResults() method to check if any results were found - -3.3.0 ------ - - * added double-star matching to Glob::toRegex() - -3.0.0 ------ - - * removed deprecated classes - -2.8.0 ------ - - * deprecated adapters and related classes - -2.5.0 ------ - * added support for GLOB_BRACE in the paths passed to Finder::in() - -2.3.0 ------ - - * added a way to ignore unreadable directories (via Finder::ignoreUnreadableDirs()) - * unified the way subfolders that are not executable are handled by always throwing an AccessDeniedException exception - -2.2.0 ------ - - * added Finder::path() and Finder::notPath() methods - * added finder adapters to improve performance on specific platforms - * added support for wildcard characters (glob patterns) in the paths passed - to Finder::in() - -2.1.0 ------ - - * added Finder::sortByAccessedTime(), Finder::sortByChangedTime(), and - Finder::sortByModifiedTime() - * added Countable to Finder - * added support for an array of directories as an argument to - Finder::exclude() - * added searching based on the file content via Finder::contains() and - Finder::notContains() - * added support for the != operator in the Comparator - * [BC BREAK] filter expressions (used for file name and content) are no more - considered as regexps but glob patterns when they are enclosed in '*' or '?' diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/Comparator.php b/tools/php-cs-fixer/vendor/symfony/finder/Comparator/Comparator.php deleted file mode 100644 index 41c02ac6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/Comparator.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * @author Fabien Potencier - */ -class Comparator -{ - private string $operator; - - public function __construct( - private string $target, - string $operator = '==', - ) { - if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { - throw new \InvalidArgumentException(\sprintf('Invalid operator "%s".', $operator)); - } - - $this->operator = $operator; - } - - /** - * Gets the target value. - */ - public function getTarget(): string - { - return $this->target; - } - - /** - * Gets the comparison operator. - */ - public function getOperator(): string - { - return $this->operator; - } - - /** - * Tests against the target. - */ - public function test(mixed $test): bool - { - return match ($this->operator) { - '>' => $test > $this->target, - '>=' => $test >= $this->target, - '<' => $test < $this->target, - '<=' => $test <= $this->target, - '!=' => $test != $this->target, - default => $test == $this->target, - }; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/DateComparator.php b/tools/php-cs-fixer/vendor/symfony/finder/Comparator/DateComparator.php deleted file mode 100644 index bcf93cfb..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/DateComparator.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * DateCompare compiles date comparisons. - * - * @author Fabien Potencier - */ -class DateComparator extends Comparator -{ - /** - * @param string $test A comparison string - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(string $test) - { - if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(\sprintf('Don\'t understand "%s" as a date test.', $test)); - } - - try { - $date = new \DateTimeImmutable($matches[2]); - $target = $date->format('U'); - } catch (\Exception) { - throw new \InvalidArgumentException(\sprintf('"%s" is not a valid date.', $matches[2])); - } - - $operator = $matches[1] ?: '=='; - if ('since' === $operator || 'after' === $operator) { - $operator = '>'; - } - - if ('until' === $operator || 'before' === $operator) { - $operator = '<'; - } - - parent::__construct($target, $operator); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/NumberComparator.php b/tools/php-cs-fixer/vendor/symfony/finder/Comparator/NumberComparator.php deleted file mode 100644 index 0ec0049f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Comparator/NumberComparator.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * NumberComparator compiles a simple comparison to an anonymous - * subroutine, which you can call with a value to be tested again. - * - * Now this would be very pointless, if NumberCompare didn't understand - * magnitudes. - * - * The target value may use magnitudes of kilobytes (k, ki), - * megabytes (m, mi), or gigabytes (g, gi). Those suffixed - * with an i use the appropriate 2**n version in accordance with the - * IEC standard: http://physics.nist.gov/cuu/Units/binary.html - * - * Based on the Perl Number::Compare module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - * - * @see http://physics.nist.gov/cuu/Units/binary.html - */ -class NumberComparator extends Comparator -{ - /** - * @param string|null $test A comparison string or null - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(?string $test) - { - if (null === $test || !preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(\sprintf('Don\'t understand "%s" as a number test.', $test ?? 'null')); - } - - $target = $matches[2]; - if (!is_numeric($target)) { - throw new \InvalidArgumentException(\sprintf('Invalid number "%s".', $target)); - } - if (isset($matches[3])) { - // magnitude - switch (strtolower($matches[3])) { - case 'k': - $target *= 1000; - break; - case 'ki': - $target *= 1024; - break; - case 'm': - $target *= 1000000; - break; - case 'mi': - $target *= 1024 * 1024; - break; - case 'g': - $target *= 1000000000; - break; - case 'gi': - $target *= 1024 * 1024 * 1024; - break; - } - } - - parent::__construct($target, $matches[1] ?: '=='); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Exception/AccessDeniedException.php b/tools/php-cs-fixer/vendor/symfony/finder/Exception/AccessDeniedException.php deleted file mode 100644 index ee195ea8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Exception/AccessDeniedException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Jean-François Simon - */ -class AccessDeniedException extends \UnexpectedValueException -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Exception/DirectoryNotFoundException.php b/tools/php-cs-fixer/vendor/symfony/finder/Exception/DirectoryNotFoundException.php deleted file mode 100644 index c6cc0f27..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Exception/DirectoryNotFoundException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Andreas Erhard - */ -class DirectoryNotFoundException extends \InvalidArgumentException -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Finder.php b/tools/php-cs-fixer/vendor/symfony/finder/Finder.php deleted file mode 100644 index 78673af6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Finder.php +++ /dev/null @@ -1,852 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -use Symfony\Component\Finder\Comparator\DateComparator; -use Symfony\Component\Finder\Comparator\NumberComparator; -use Symfony\Component\Finder\Exception\DirectoryNotFoundException; -use Symfony\Component\Finder\Iterator\CustomFilterIterator; -use Symfony\Component\Finder\Iterator\DateRangeFilterIterator; -use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator; -use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator; -use Symfony\Component\Finder\Iterator\FilecontentFilterIterator; -use Symfony\Component\Finder\Iterator\FilenameFilterIterator; -use Symfony\Component\Finder\Iterator\LazyIterator; -use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator; -use Symfony\Component\Finder\Iterator\SortableIterator; - -/** - * Finder allows to build rules to find files and directories. - * - * It is a thin wrapper around several specialized iterator classes. - * - * All rules may be invoked several times. - * - * All methods return the current Finder object to allow chaining: - * - * $finder = Finder::create()->files()->name('*.php')->in(__DIR__); - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class Finder implements \IteratorAggregate, \Countable -{ - public const IGNORE_VCS_FILES = 1; - public const IGNORE_DOT_FILES = 2; - public const IGNORE_VCS_IGNORED_FILES = 4; - - private int $mode = 0; - private array $names = []; - private array $notNames = []; - private array $exclude = []; - private array $filters = []; - private array $pruneFilters = []; - private array $depths = []; - private array $sizes = []; - private bool $followLinks = false; - private bool $reverseSorting = false; - private \Closure|int|false $sort = false; - private int $ignore = 0; - private array $dirs = []; - private array $dates = []; - private array $iterators = []; - private array $contains = []; - private array $notContains = []; - private array $paths = []; - private array $notPaths = []; - private bool $ignoreUnreadableDirs = false; - - private static array $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; - - public function __construct() - { - $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES; - } - - /** - * Creates a new Finder. - */ - public static function create(): static - { - return new static(); - } - - /** - * Restricts the matching to directories only. - * - * @return $this - */ - public function directories(): static - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES; - - return $this; - } - - /** - * Restricts the matching to files only. - * - * @return $this - */ - public function files(): static - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES; - - return $this; - } - - /** - * Adds tests for the directory depth. - * - * Usage: - * - * $finder->depth('> 1') // the Finder will start matching at level 1. - * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. - * $finder->depth(['>= 1', '< 3']) - * - * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels - * - * @return $this - * - * @see DepthRangeFilterIterator - * @see NumberComparator - */ - public function depth(string|int|array $levels): static - { - foreach ((array) $levels as $level) { - $this->depths[] = new NumberComparator($level); - } - - return $this; - } - - /** - * Adds tests for file dates (last modified). - * - * The date must be something that strtotime() is able to parse: - * - * $finder->date('since yesterday'); - * $finder->date('until 2 days ago'); - * $finder->date('> now - 2 hours'); - * $finder->date('>= 2005-10-15'); - * $finder->date(['>= 2005-10-15', '<= 2006-05-27']); - * - * @param string|string[] $dates A date range string or an array of date ranges - * - * @return $this - * - * @see strtotime - * @see DateRangeFilterIterator - * @see DateComparator - */ - public function date(string|array $dates): static - { - foreach ((array) $dates as $date) { - $this->dates[] = new DateComparator($date); - } - - return $this; - } - - /** - * Adds rules that files must match. - * - * You can use patterns (delimited with / sign), globs or simple strings. - * - * $finder->name('/\.php$/') - * $finder->name('*.php') // same as above, without dot files - * $finder->name('test.php') - * $finder->name(['test.py', 'test.php']) - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function name(string|array $patterns): static - { - $this->names = array_merge($this->names, (array) $patterns); - - return $this; - } - - /** - * Adds rules that files must not match. - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notName(string|array $patterns): static - { - $this->notNames = array_merge($this->notNames, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must match. - * - * Strings or PCRE patterns can be used: - * - * $finder->contains('Lorem ipsum') - * $finder->contains('/Lorem ipsum/i') - * $finder->contains(['dolor', '/ipsum/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function contains(string|array $patterns): static - { - $this->contains = array_merge($this->contains, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must not match. - * - * Strings or PCRE patterns can be used: - * - * $finder->notContains('Lorem ipsum') - * $finder->notContains('/Lorem ipsum/i') - * $finder->notContains(['lorem', '/dolor/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function notContains(string|array $patterns): static - { - $this->notContains = array_merge($this->notContains, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->path('some/special/dir') - * $finder->path('/some\/special\/dir/') // same as above - * $finder->path(['some dir', 'another/dir']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function path(string|array $patterns): static - { - $this->paths = array_merge($this->paths, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must not match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->notPath('some/special/dir') - * $finder->notPath('/some\/special\/dir/') // same as above - * $finder->notPath(['some/file.txt', 'another/file.log']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notPath(string|array $patterns): static - { - $this->notPaths = array_merge($this->notPaths, (array) $patterns); - - return $this; - } - - /** - * Adds tests for file sizes. - * - * $finder->size('> 10K'); - * $finder->size('<= 1Ki'); - * $finder->size(4); - * $finder->size(['> 10K', '< 20K']) - * - * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges - * - * @return $this - * - * @see SizeRangeFilterIterator - * @see NumberComparator - */ - public function size(string|int|array $sizes): static - { - foreach ((array) $sizes as $size) { - $this->sizes[] = new NumberComparator($size); - } - - return $this; - } - - /** - * Excludes directories. - * - * Directories passed as argument must be relative to the ones defined with the `in()` method. For example: - * - * $finder->in(__DIR__)->exclude('ruby'); - * - * @param string|array $dirs A directory path or an array of directories - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function exclude(string|array $dirs): static - { - $this->exclude = array_merge($this->exclude, (array) $dirs); - - return $this; - } - - /** - * Excludes "hidden" directories and files (starting with a dot). - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreDotFiles(bool $ignoreDotFiles): static - { - if ($ignoreDotFiles) { - $this->ignore |= static::IGNORE_DOT_FILES; - } else { - $this->ignore &= ~static::IGNORE_DOT_FILES; - } - - return $this; - } - - /** - * Forces the finder to ignore version control directories. - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreVCS(bool $ignoreVCS): static - { - if ($ignoreVCS) { - $this->ignore |= static::IGNORE_VCS_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_FILES; - } - - return $this; - } - - /** - * Forces Finder to obey .gitignore and ignore files based on rules listed there. - * - * This option is disabled by default. - * - * @return $this - */ - public function ignoreVCSIgnored(bool $ignoreVCSIgnored): static - { - if ($ignoreVCSIgnored) { - $this->ignore |= static::IGNORE_VCS_IGNORED_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES; - } - - return $this; - } - - /** - * Adds VCS patterns. - * - * @see ignoreVCS() - * - * @param string|string[] $pattern VCS patterns to ignore - */ - public static function addVCSPattern(string|array $pattern): void - { - foreach ((array) $pattern as $p) { - self::$vcsPatterns[] = $p; - } - - self::$vcsPatterns = array_unique(self::$vcsPatterns); - } - - /** - * Sorts files and directories by an anonymous function. - * - * The anonymous function receives two \SplFileInfo instances to compare. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sort(\Closure $closure): static - { - $this->sort = $closure; - - return $this; - } - - /** - * Sorts files and directories by extension. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByExtension(): static - { - $this->sort = SortableIterator::SORT_BY_EXTENSION; - - return $this; - } - - /** - * Sorts files and directories by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByName(bool $useNaturalSort = false): static - { - $this->sort = $useNaturalSort ? SortableIterator::SORT_BY_NAME_NATURAL : SortableIterator::SORT_BY_NAME; - - return $this; - } - - /** - * Sorts files and directories by name case insensitive. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByCaseInsensitiveName(bool $useNaturalSort = false): static - { - $this->sort = $useNaturalSort ? SortableIterator::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE : SortableIterator::SORT_BY_NAME_CASE_INSENSITIVE; - - return $this; - } - - /** - * Sorts files and directories by size. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortBySize(): static - { - $this->sort = SortableIterator::SORT_BY_SIZE; - - return $this; - } - - /** - * Sorts files and directories by type (directories before files), then by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByType(): static - { - $this->sort = SortableIterator::SORT_BY_TYPE; - - return $this; - } - - /** - * Sorts files and directories by the last accessed time. - * - * This is the time that the file was last accessed, read or written to. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByAccessedTime(): static - { - $this->sort = SortableIterator::SORT_BY_ACCESSED_TIME; - - return $this; - } - - /** - * Reverses the sorting. - * - * @return $this - */ - public function reverseSorting(): static - { - $this->reverseSorting = true; - - return $this; - } - - /** - * Sorts files and directories by the last inode changed time. - * - * This is the time that the inode information was last modified (permissions, owner, group or other metadata). - * - * On Windows, since inode is not available, changed time is actually the file creation time. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByChangedTime(): static - { - $this->sort = SortableIterator::SORT_BY_CHANGED_TIME; - - return $this; - } - - /** - * Sorts files and directories by the last modified time. - * - * This is the last time the actual contents of the file were last modified. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByModifiedTime(): static - { - $this->sort = SortableIterator::SORT_BY_MODIFIED_TIME; - - return $this; - } - - /** - * Filters the iterator with an anonymous function. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @param \Closure(SplFileInfo): bool $closure - * @param bool $prune Whether to skip traversing directories further - * - * @return $this - * - * @see CustomFilterIterator - */ - public function filter(\Closure $closure, bool $prune = false): static - { - $this->filters[] = $closure; - - if ($prune) { - $this->pruneFilters[] = $closure; - } - - return $this; - } - - /** - * Forces the following of symlinks. - * - * @return $this - */ - public function followLinks(): static - { - $this->followLinks = true; - - return $this; - } - - /** - * Tells finder to ignore unreadable directories. - * - * By default, scanning unreadable directories content throws an AccessDeniedException. - * - * @return $this - */ - public function ignoreUnreadableDirs(bool $ignore = true): static - { - $this->ignoreUnreadableDirs = $ignore; - - return $this; - } - - /** - * Searches files and directories which match defined rules. - * - * @param string|string[] $dirs A directory path or an array of directories - * - * @return $this - * - * @throws DirectoryNotFoundException if one of the directories does not exist - */ - public function in(string|array $dirs): static - { - $resolvedDirs = []; - - foreach ((array) $dirs as $dir) { - if (is_dir($dir)) { - $resolvedDirs[] = [$this->normalizeDir($dir)]; - } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) { - sort($glob); - $resolvedDirs[] = array_map($this->normalizeDir(...), $glob); - } else { - throw new DirectoryNotFoundException(\sprintf('The "%s" directory does not exist.', $dir)); - } - } - - $this->dirs = array_merge($this->dirs, ...$resolvedDirs); - - return $this; - } - - /** - * Returns an Iterator for the current Finder configuration. - * - * This method implements the IteratorAggregate interface. - * - * @return \Iterator - * - * @throws \LogicException if the in() method has not been called - */ - public function getIterator(): \Iterator - { - if (0 === \count($this->dirs) && 0 === \count($this->iterators)) { - throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.'); - } - - if (1 === \count($this->dirs) && 0 === \count($this->iterators)) { - $iterator = $this->searchInDirectory($this->dirs[0]); - - if ($this->sort || $this->reverseSorting) { - $iterator = (new SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - $iterator = new \AppendIterator(); - foreach ($this->dirs as $dir) { - $iterator->append(new \IteratorIterator(new LazyIterator(fn () => $this->searchInDirectory($dir)))); - } - - foreach ($this->iterators as $it) { - $iterator->append($it); - } - - if ($this->sort || $this->reverseSorting) { - $iterator = (new SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - /** - * Appends an existing set of files/directories to the finder. - * - * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. - * - * @return $this - */ - public function append(iterable $iterator): static - { - if ($iterator instanceof \IteratorAggregate) { - $this->iterators[] = $iterator->getIterator(); - } elseif ($iterator instanceof \Iterator) { - $this->iterators[] = $iterator; - } else { - $it = new \ArrayIterator(); - foreach ($iterator as $file) { - $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file); - $it[$file->getPathname()] = $file; - } - $this->iterators[] = $it; - } - - return $this; - } - - /** - * Check if any results were found. - */ - public function hasResults(): bool - { - foreach ($this->getIterator() as $_) { - return true; - } - - return false; - } - - /** - * Counts all the results collected by the iterators. - */ - public function count(): int - { - return iterator_count($this->getIterator()); - } - - private function searchInDirectory(string $dir): \Iterator - { - $exclude = $this->exclude; - $notPaths = $this->notPaths; - - if ($this->pruneFilters) { - $exclude = array_merge($exclude, $this->pruneFilters); - } - - if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) { - $exclude = array_merge($exclude, self::$vcsPatterns); - } - - if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) { - $notPaths[] = '#(^|/)\..+(/|$)#'; - } - - $minDepth = 0; - $maxDepth = \PHP_INT_MAX; - - foreach ($this->depths as $comparator) { - switch ($comparator->getOperator()) { - case '>': - $minDepth = $comparator->getTarget() + 1; - break; - case '>=': - $minDepth = $comparator->getTarget(); - break; - case '<': - $maxDepth = $comparator->getTarget() - 1; - break; - case '<=': - $maxDepth = $comparator->getTarget(); - break; - default: - $minDepth = $maxDepth = $comparator->getTarget(); - } - } - - $flags = \RecursiveDirectoryIterator::SKIP_DOTS; - - if ($this->followLinks) { - $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS; - } - - $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs); - - if ($exclude) { - $iterator = new ExcludeDirectoryFilterIterator($iterator, $exclude); - } - - $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); - - if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) { - $iterator = new DepthRangeFilterIterator($iterator, $minDepth, $maxDepth); - } - - if ($this->mode) { - $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode); - } - - if ($this->names || $this->notNames) { - $iterator = new FilenameFilterIterator($iterator, $this->names, $this->notNames); - } - - if ($this->contains || $this->notContains) { - $iterator = new FilecontentFilterIterator($iterator, $this->contains, $this->notContains); - } - - if ($this->sizes) { - $iterator = new SizeRangeFilterIterator($iterator, $this->sizes); - } - - if ($this->dates) { - $iterator = new DateRangeFilterIterator($iterator, $this->dates); - } - - if ($this->filters) { - $iterator = new CustomFilterIterator($iterator, $this->filters); - } - - if ($this->paths || $notPaths) { - $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths); - } - - if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) { - $iterator = new Iterator\VcsIgnoredFilterIterator($iterator, $dir); - } - - return $iterator; - } - - /** - * Normalizes given directory names by removing trailing slashes. - * - * Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper - */ - private function normalizeDir(string $dir): string - { - if ('/' === $dir) { - return $dir; - } - - $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR); - - if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) { - $dir .= '/'; - } - - return $dir; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Gitignore.php b/tools/php-cs-fixer/vendor/symfony/finder/Gitignore.php deleted file mode 100644 index bf05c5b3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Gitignore.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Gitignore matches against text. - * - * @author Michael Voříšek - * @author Ahmed Abdou - */ -class Gitignore -{ - /** - * Returns a regexp which is the equivalent of the gitignore pattern. - * - * Format specification: https://git-scm.com/docs/gitignore#_pattern_format - */ - public static function toRegex(string $gitignoreFileContent): string - { - return self::buildRegex($gitignoreFileContent, false); - } - - public static function toRegexMatchingNegatedPatterns(string $gitignoreFileContent): string - { - return self::buildRegex($gitignoreFileContent, true); - } - - private static function buildRegex(string $gitignoreFileContent, bool $inverted): string - { - $gitignoreFileContent = preg_replace('~(? '['.('' !== $matches[1] ? '^' : '').str_replace('\\-', '-', $matches[2]).']', $regex); - $regex = preg_replace('~(?:(?:\\\\\*){2,}(/?))+~', '(?:(?:(?!//).(? - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Glob matches globbing patterns against text. - * - * if match_glob("foo.*", "foo.bar") echo "matched\n"; - * - * // prints foo.bar and foo.baz - * $regex = glob_to_regex("foo.*"); - * for (['foo.bar', 'foo.baz', 'foo', 'bar'] as $t) - * { - * if (/$regex/) echo "matched: $car\n"; - * } - * - * Glob implements glob(3) style matching that can be used to match - * against text, rather than fetching names from a filesystem. - * - * Based on the Perl Text::Glob module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - */ -class Glob -{ - /** - * Returns a regexp which is the equivalent of the glob pattern. - */ - public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#'): string - { - $firstByte = true; - $escaping = false; - $inCurlies = 0; - $regex = ''; - $sizeGlob = \strlen($glob); - for ($i = 0; $i < $sizeGlob; ++$i) { - $car = $glob[$i]; - if ($firstByte && $strictLeadingDot && '.' !== $car) { - $regex .= '(?=[^\.])'; - } - - $firstByte = '/' === $car; - - if ($firstByte && $strictWildcardSlash && isset($glob[$i + 2]) && '**' === $glob[$i + 1].$glob[$i + 2] && (!isset($glob[$i + 3]) || '/' === $glob[$i + 3])) { - $car = '[^/]++/'; - if (!isset($glob[$i + 3])) { - $car .= '?'; - } - - if ($strictLeadingDot) { - $car = '(?=[^\.])'.$car; - } - - $car = '/(?:'.$car.')*'; - $i += 2 + isset($glob[$i + 3]); - - if ('/' === $delimiter) { - $car = str_replace('/', '\\/', $car); - } - } - - if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) { - $regex .= "\\$car"; - } elseif ('*' === $car) { - $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*'); - } elseif ('?' === $car) { - $regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.'); - } elseif ('{' === $car) { - $regex .= $escaping ? '\\{' : '('; - if (!$escaping) { - ++$inCurlies; - } - } elseif ('}' === $car && $inCurlies) { - $regex .= $escaping ? '}' : ')'; - if (!$escaping) { - --$inCurlies; - } - } elseif (',' === $car && $inCurlies) { - $regex .= $escaping ? ',' : '|'; - } elseif ('\\' === $car) { - if ($escaping) { - $regex .= '\\\\'; - $escaping = false; - } else { - $escaping = true; - } - - continue; - } else { - $regex .= $car; - } - $escaping = false; - } - - return $delimiter.'^'.$regex.'$'.$delimiter; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/CustomFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/CustomFilterIterator.php deleted file mode 100644 index 82ee81d8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/CustomFilterIterator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * CustomFilterIterator filters files by applying anonymous functions. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class CustomFilterIterator extends \FilterIterator -{ - private array $filters = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param callable[] $filters An array of PHP callbacks - * - * @throws \InvalidArgumentException - */ - public function __construct(\Iterator $iterator, array $filters) - { - foreach ($filters as $filter) { - if (!\is_callable($filter)) { - throw new \InvalidArgumentException('Invalid PHP callback.'); - } - } - $this->filters = $filters; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - $fileinfo = $this->current(); - - foreach ($this->filters as $filter) { - if (false === $filter($fileinfo)) { - return false; - } - } - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php deleted file mode 100644 index 718d42b1..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\DateComparator; - -/** - * DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class DateRangeFilterIterator extends \FilterIterator -{ - private array $comparators = []; - - /** - * @param \Iterator $iterator - * @param DateComparator[] $comparators - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - $fileinfo = $this->current(); - - if (!file_exists($fileinfo->getPathname())) { - return false; - } - - $filedate = $fileinfo->getMTime(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filedate)) { - return false; - } - } - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php deleted file mode 100644 index 1cddb5fa..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * DepthRangeFilterIterator limits the directory depth. - * - * @author Fabien Potencier - * - * @template-covariant TKey - * @template-covariant TValue - * - * @extends \FilterIterator - */ -class DepthRangeFilterIterator extends \FilterIterator -{ - private int $minDepth = 0; - - /** - * @param \RecursiveIteratorIterator<\RecursiveIterator> $iterator The Iterator to filter - * @param int $minDepth The min depth - * @param int $maxDepth The max depth - */ - public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $maxDepth = \PHP_INT_MAX) - { - $this->minDepth = $minDepth; - $iterator->setMaxDepth(\PHP_INT_MAX === $maxDepth ? -1 : $maxDepth); - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - return $this->getInnerIterator()->getDepth() >= $this->minDepth; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php deleted file mode 100644 index ebbc76ec..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\SplFileInfo; - -/** - * ExcludeDirectoryFilterIterator filters out directories. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - * - * @implements \RecursiveIterator - */ -class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator -{ - /** @var \Iterator */ - private \Iterator $iterator; - private bool $isRecursive; - /** @var array */ - private array $excludedDirs = []; - private ?string $excludedPattern = null; - /** @var list */ - private array $pruneFilters = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param list $directories An array of directories to exclude - */ - public function __construct(\Iterator $iterator, array $directories) - { - $this->iterator = $iterator; - $this->isRecursive = $iterator instanceof \RecursiveIterator; - $patterns = []; - foreach ($directories as $directory) { - if (!\is_string($directory)) { - if (!\is_callable($directory)) { - throw new \InvalidArgumentException('Invalid PHP callback.'); - } - - $this->pruneFilters[] = $directory; - - continue; - } - - $directory = rtrim($directory, '/'); - if (!$this->isRecursive || str_contains($directory, '/')) { - $patterns[] = preg_quote($directory, '#'); - } else { - $this->excludedDirs[$directory] = true; - } - } - if ($patterns) { - $this->excludedPattern = '#(?:^|/)(?:'.implode('|', $patterns).')(?:/|$)#'; - } - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { - return false; - } - - if ($this->excludedPattern) { - $path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath(); - $path = str_replace('\\', '/', $path); - - return !preg_match($this->excludedPattern, $path); - } - - if ($this->pruneFilters && $this->hasChildren()) { - foreach ($this->pruneFilters as $pruneFilter) { - if (!$pruneFilter($this->current())) { - return false; - } - } - } - - return true; - } - - public function hasChildren(): bool - { - return $this->isRecursive && $this->iterator->hasChildren(); - } - - public function getChildren(): self - { - $children = new self($this->iterator->getChildren(), []); - $children->excludedDirs = $this->excludedDirs; - $children->excludedPattern = $this->excludedPattern; - - return $children; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php deleted file mode 100644 index 0d4a5fd3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FileTypeFilterIterator only keeps files, directories, or both. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class FileTypeFilterIterator extends \FilterIterator -{ - public const ONLY_FILES = 1; - public const ONLY_DIRECTORIES = 2; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES) - */ - public function __construct( - \Iterator $iterator, - private int $mode, - ) { - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - $fileinfo = $this->current(); - if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) { - return false; - } elseif (self::ONLY_FILES === (self::ONLY_FILES & $this->mode) && $fileinfo->isDir()) { - return false; - } - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php deleted file mode 100644 index bdc71ffd..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\SplFileInfo; - -/** - * FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - * - * @extends MultiplePcreFilterIterator - */ -class FilecontentFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - */ - public function accept(): bool - { - if (!$this->matchRegexps && !$this->noMatchRegexps) { - return true; - } - - $fileinfo = $this->current(); - - if ($fileinfo->isDir() || !$fileinfo->isReadable()) { - return false; - } - - $content = $fileinfo->getContents(); - if (!$content) { - return false; - } - - return $this->isAccepted($content); - } - - /** - * Converts string to regexp if necessary. - * - * @param string $str Pattern: string or regexp - */ - protected function toRegex(string $str): string - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FilenameFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FilenameFilterIterator.php deleted file mode 100644 index 05d95358..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Glob; - -/** - * FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). - * - * @author Fabien Potencier - * - * @extends MultiplePcreFilterIterator - */ -class FilenameFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - */ - public function accept(): bool - { - return $this->isAccepted($this->current()->getFilename()); - } - - /** - * Converts glob to regexp. - * - * PCRE patterns are left unchanged. - * Glob strings are transformed with Glob::toRegex(). - * - * @param string $str Pattern: glob or regexp - */ - protected function toRegex(string $str): string - { - return $this->isRegex($str) ? $str : Glob::toRegex($str); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/LazyIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/LazyIterator.php deleted file mode 100644 index 5b5806be..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/LazyIterator.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * @author Jérémy Derussé - * - * @internal - */ -class LazyIterator implements \IteratorAggregate -{ - private \Closure $iteratorFactory; - - public function __construct(callable $iteratorFactory) - { - $this->iteratorFactory = $iteratorFactory(...); - } - - public function getIterator(): \Traversable - { - yield from ($this->iteratorFactory)(); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php deleted file mode 100644 index 3450c49d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). - * - * @author Fabien Potencier - * - * @template-covariant TKey - * @template-covariant TValue - * - * @extends \FilterIterator - */ -abstract class MultiplePcreFilterIterator extends \FilterIterator -{ - protected array $matchRegexps = []; - protected array $noMatchRegexps = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $matchPatterns An array of patterns that need to match - * @param string[] $noMatchPatterns An array of patterns that need to not match - */ - public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns) - { - foreach ($matchPatterns as $pattern) { - $this->matchRegexps[] = $this->toRegex($pattern); - } - - foreach ($noMatchPatterns as $pattern) { - $this->noMatchRegexps[] = $this->toRegex($pattern); - } - - parent::__construct($iterator); - } - - /** - * Checks whether the string is accepted by the regex filters. - * - * If there is no regexps defined in the class, this method will accept the string. - * Such case can be handled by child classes before calling the method if they want to - * apply a different behavior. - */ - protected function isAccepted(string $string): bool - { - // should at least not match one rule to exclude - foreach ($this->noMatchRegexps as $regex) { - if (preg_match($regex, $string)) { - return false; - } - } - - // should at least match one rule - if ($this->matchRegexps) { - foreach ($this->matchRegexps as $regex) { - if (preg_match($regex, $string)) { - return true; - } - } - - return false; - } - - // If there is no match rules, the file is accepted - return true; - } - - /** - * Checks whether the string is a regex. - */ - protected function isRegex(string $str): bool - { - $availableModifiers = 'imsxuADUn'; - - if (preg_match('/^(.{3,}?)['.$availableModifiers.']*$/', $str, $m)) { - $start = substr($m[1], 0, 1); - $end = substr($m[1], -1); - - if ($start === $end) { - return !preg_match('/[*?[:alnum:] \\\\]/', $start); - } - - foreach ([['{', '}'], ['(', ')'], ['[', ']'], ['<', '>']] as $delimiters) { - if ($start === $delimiters[0] && $end === $delimiters[1]) { - return true; - } - } - } - - return false; - } - - /** - * Converts string into regexp. - */ - abstract protected function toRegex(string $str): string; -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/PathFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/PathFilterIterator.php deleted file mode 100644 index c6d58139..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/PathFilterIterator.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\SplFileInfo; - -/** - * PathFilterIterator filters files by path patterns (e.g. some/special/dir). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - * - * @extends MultiplePcreFilterIterator - */ -class PathFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - */ - public function accept(): bool - { - $filename = $this->current()->getRelativePathname(); - - if ('\\' === \DIRECTORY_SEPARATOR) { - $filename = str_replace('\\', '/', $filename); - } - - return $this->isAccepted($filename); - } - - /** - * Converts strings to regexp. - * - * PCRE patterns are left unchanged. - * - * Default conversion: - * 'lorem/ipsum/dolor' ==> 'lorem\/ipsum\/dolor/' - * - * Use only / as directory separator (on Windows also). - * - * @param string $str Pattern: regexp or dirname - */ - protected function toRegex(string $str): string - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php deleted file mode 100644 index f5fd2d4d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Exception\AccessDeniedException; -use Symfony\Component\Finder\SplFileInfo; - -/** - * Extends the \RecursiveDirectoryIterator to support relative paths. - * - * @author Victor Berchet - * - * @extends \RecursiveDirectoryIterator - */ -class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator -{ - private bool $ignoreUnreadableDirs; - private bool $ignoreFirstRewind = true; - - // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations - private string $rootPath; - private string $subPath; - private string $directorySeparator = '/'; - - /** - * @throws \RuntimeException - */ - public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs = false) - { - if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) { - throw new \RuntimeException('This iterator only support returning current as fileinfo.'); - } - - parent::__construct($path, $flags); - $this->ignoreUnreadableDirs = $ignoreUnreadableDirs; - $this->rootPath = $path; - if ('/' !== \DIRECTORY_SEPARATOR && !($flags & self::UNIX_PATHS)) { - $this->directorySeparator = \DIRECTORY_SEPARATOR; - } - } - - /** - * Return an instance of SplFileInfo with support for relative paths. - */ - public function current(): SplFileInfo - { - // the logic here avoids redoing the same work in all iterations - - if (!isset($this->subPath)) { - $this->subPath = $this->getSubPath(); - } - $subPathname = $this->subPath; - if ('' !== $subPathname) { - $subPathname .= $this->directorySeparator; - } - $subPathname .= $this->getFilename(); - $basePath = $this->rootPath; - - if ('/' !== $basePath && !str_ends_with($basePath, $this->directorySeparator) && !str_ends_with($basePath, '/')) { - $basePath .= $this->directorySeparator; - } - - return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname); - } - - public function hasChildren(bool $allowLinks = false): bool - { - $hasChildren = parent::hasChildren($allowLinks); - - if (!$hasChildren || !$this->ignoreUnreadableDirs) { - return $hasChildren; - } - - try { - parent::getChildren(); - - return true; - } catch (\UnexpectedValueException) { - // If directory is unreadable and finder is set to ignore it, skip children - return false; - } - } - - /** - * @throws AccessDeniedException - */ - public function getChildren(): \RecursiveDirectoryIterator - { - try { - $children = parent::getChildren(); - - if ($children instanceof self) { - // parent method will call the constructor with default arguments, so unreadable dirs won't be ignored anymore - $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; - - // performance optimization to avoid redoing the same work in all children - $children->rootPath = $this->rootPath; - } - - return $children; - } catch (\UnexpectedValueException $e) { - throw new AccessDeniedException($e->getMessage(), $e->getCode(), $e); - } - } - - public function next(): void - { - $this->ignoreFirstRewind = false; - - parent::next(); - } - - public function rewind(): void - { - // some streams like FTP are not rewindable, ignore the first rewind after creation, - // as newly created DirectoryIterator does not need to be rewound - if ($this->ignoreFirstRewind) { - $this->ignoreFirstRewind = false; - - return; - } - - parent::rewind(); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php deleted file mode 100644 index 925830a2..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\NumberComparator; - -/** - * SizeRangeFilterIterator filters out files that are not in the given size range. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class SizeRangeFilterIterator extends \FilterIterator -{ - private array $comparators = []; - - /** - * @param \Iterator $iterator - * @param NumberComparator[] $comparators - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - $fileinfo = $this->current(); - if (!$fileinfo->isFile()) { - return true; - } - - $filesize = $fileinfo->getSize(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filesize)) { - return false; - } - } - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/SortableIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/SortableIterator.php deleted file mode 100644 index 177cd0b6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/SortableIterator.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * SortableIterator applies a sort on a given Iterator. - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class SortableIterator implements \IteratorAggregate -{ - public const SORT_BY_NONE = 0; - public const SORT_BY_NAME = 1; - public const SORT_BY_TYPE = 2; - public const SORT_BY_ACCESSED_TIME = 3; - public const SORT_BY_CHANGED_TIME = 4; - public const SORT_BY_MODIFIED_TIME = 5; - public const SORT_BY_NAME_NATURAL = 6; - public const SORT_BY_NAME_CASE_INSENSITIVE = 7; - public const SORT_BY_NAME_NATURAL_CASE_INSENSITIVE = 8; - public const SORT_BY_EXTENSION = 9; - public const SORT_BY_SIZE = 10; - - /** @var \Traversable */ - private \Traversable $iterator; - private \Closure|int $sort; - - /** - * @param \Traversable $iterator - * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) - * - * @throws \InvalidArgumentException - */ - public function __construct(\Traversable $iterator, int|callable $sort, bool $reverseOrder = false) - { - $this->iterator = $iterator; - $order = $reverseOrder ? -1 : 1; - - if (self::SORT_BY_NAME === $sort) { - $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - } elseif (self::SORT_BY_NAME_NATURAL === $sort) { - $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - } elseif (self::SORT_BY_NAME_CASE_INSENSITIVE === $sort) { - $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - } elseif (self::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE === $sort) { - $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strnatcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - } elseif (self::SORT_BY_TYPE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - if ($a->isDir() && $b->isFile()) { - return -$order; - } elseif ($a->isFile() && $b->isDir()) { - return $order; - } - - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { - $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getATime() - $b->getATime()); - } elseif (self::SORT_BY_CHANGED_TIME === $sort) { - $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getCTime() - $b->getCTime()); - } elseif (self::SORT_BY_MODIFIED_TIME === $sort) { - $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getMTime() - $b->getMTime()); - } elseif (self::SORT_BY_EXTENSION === $sort) { - $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strnatcmp($a->getExtension(), $b->getExtension()); - } elseif (self::SORT_BY_SIZE === $sort) { - $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getSize() - $b->getSize()); - } elseif (self::SORT_BY_NONE === $sort) { - $this->sort = $order; - } elseif (\is_callable($sort)) { - $this->sort = $reverseOrder ? static fn (\SplFileInfo $a, \SplFileInfo $b) => -$sort($a, $b) : $sort(...); - } else { - throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); - } - } - - public function getIterator(): \Traversable - { - if (1 === $this->sort) { - return $this->iterator; - } - - $array = iterator_to_array($this->iterator, true); - - if (-1 === $this->sort) { - $array = array_reverse($array); - } else { - uasort($array, $this->sort); - } - - return new \ArrayIterator($array); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php b/tools/php-cs-fixer/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php deleted file mode 100644 index b278706e..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +++ /dev/null @@ -1,173 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Gitignore; - -/** - * @extends \FilterIterator - */ -final class VcsIgnoredFilterIterator extends \FilterIterator -{ - private string $baseDir; - - /** - * @var array - */ - private array $gitignoreFilesCache = []; - - /** - * @var array - */ - private array $ignoredPathsCache = []; - - /** - * @param \Iterator $iterator - */ - public function __construct(\Iterator $iterator, string $baseDir) - { - $this->baseDir = $this->normalizePath($baseDir); - - foreach ([$this->baseDir, ...$this->parentDirectoriesUpwards($this->baseDir)] as $directory) { - if (@is_dir("{$directory}/.git")) { - $this->baseDir = $directory; - break; - } - } - - parent::__construct($iterator); - } - - public function accept(): bool - { - $file = $this->current(); - - $fileRealPath = $this->normalizePath($file->getRealPath()); - - return !$this->isIgnored($fileRealPath); - } - - private function isIgnored(string $fileRealPath): bool - { - if (is_dir($fileRealPath) && !str_ends_with($fileRealPath, '/')) { - $fileRealPath .= '/'; - } - - if (isset($this->ignoredPathsCache[$fileRealPath])) { - return $this->ignoredPathsCache[$fileRealPath]; - } - - $ignored = false; - - foreach ($this->parentDirectoriesDownwards($fileRealPath) as $parentDirectory) { - if ($this->isIgnored($parentDirectory)) { - // rules in ignored directories are ignored, no need to check further. - break; - } - - $fileRelativePath = substr($fileRealPath, \strlen($parentDirectory) + 1); - - if (null === $regexps = $this->readGitignoreFile("{$parentDirectory}/.gitignore")) { - continue; - } - - [$exclusionRegex, $inclusionRegex] = $regexps; - - if (preg_match($exclusionRegex, $fileRelativePath)) { - $ignored = true; - - continue; - } - - if (preg_match($inclusionRegex, $fileRelativePath)) { - $ignored = false; - } - } - - return $this->ignoredPathsCache[$fileRealPath] = $ignored; - } - - /** - * @return list - */ - private function parentDirectoriesUpwards(string $from): array - { - $parentDirectories = []; - - $parentDirectory = $from; - - while (true) { - $newParentDirectory = \dirname($parentDirectory); - - // dirname('/') = '/' - if ($newParentDirectory === $parentDirectory) { - break; - } - - $parentDirectories[] = $parentDirectory = $newParentDirectory; - } - - return $parentDirectories; - } - - private function parentDirectoriesUpTo(string $from, string $upTo): array - { - return array_filter( - $this->parentDirectoriesUpwards($from), - static fn (string $directory): bool => str_starts_with($directory, $upTo) - ); - } - - /** - * @return list - */ - private function parentDirectoriesDownwards(string $fileRealPath): array - { - return array_reverse( - $this->parentDirectoriesUpTo($fileRealPath, $this->baseDir) - ); - } - - /** - * @return array{0: string, 1: string}|null - */ - private function readGitignoreFile(string $path): ?array - { - if (\array_key_exists($path, $this->gitignoreFilesCache)) { - return $this->gitignoreFilesCache[$path]; - } - - if (!file_exists($path)) { - return $this->gitignoreFilesCache[$path] = null; - } - - if (!is_file($path) || !is_readable($path)) { - throw new \RuntimeException("The \"ignoreVCSIgnored\" option cannot be used by the Finder as the \"{$path}\" file is not readable."); - } - - $gitignoreFileContent = file_get_contents($path); - - return $this->gitignoreFilesCache[$path] = [ - Gitignore::toRegex($gitignoreFileContent), - Gitignore::toRegexMatchingNegatedPatterns($gitignoreFileContent), - ]; - } - - private function normalizePath(string $path): string - { - if ('\\' === \DIRECTORY_SEPARATOR) { - return str_replace('\\', '/', $path); - } - - return $path; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/LICENSE b/tools/php-cs-fixer/vendor/symfony/finder/LICENSE deleted file mode 100644 index 0138f8f0..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/finder/README.md b/tools/php-cs-fixer/vendor/symfony/finder/README.md deleted file mode 100644 index 22bdeb9b..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Finder Component -================ - -The Finder component finds files and directories via an intuitive fluent -interface. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/finder.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/tools/php-cs-fixer/vendor/symfony/finder/SplFileInfo.php b/tools/php-cs-fixer/vendor/symfony/finder/SplFileInfo.php deleted file mode 100644 index 2afc3782..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/SplFileInfo.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Extends \SplFileInfo to support relative paths. - * - * @author Fabien Potencier - */ -class SplFileInfo extends \SplFileInfo -{ - /** - * @param string $file The file name - * @param string $relativePath The relative path - * @param string $relativePathname The relative path name - */ - public function __construct( - string $file, - private string $relativePath, - private string $relativePathname, - ) { - parent::__construct($file); - } - - /** - * Returns the relative path. - * - * This path does not contain the file name. - */ - public function getRelativePath(): string - { - return $this->relativePath; - } - - /** - * Returns the relative path name. - * - * This path contains the file name. - */ - public function getRelativePathname(): string - { - return $this->relativePathname; - } - - public function getFilenameWithoutExtension(): string - { - $filename = $this->getFilename(); - - return pathinfo($filename, \PATHINFO_FILENAME); - } - - /** - * Returns the contents of the file. - * - * @throws \RuntimeException - */ - public function getContents(): string - { - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); - try { - $content = file_get_contents($this->getPathname()); - } finally { - restore_error_handler(); - } - if (false === $content) { - throw new \RuntimeException($error); - } - - return $content; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/finder/composer.json b/tools/php-cs-fixer/vendor/symfony/finder/composer.json deleted file mode 100644 index 2b70600d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/finder/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "symfony/finder", - "type": "library", - "description": "Finds files and directories via an intuitive fluent interface", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.2" - }, - "require-dev": { - "symfony/filesystem": "^6.4|^7.0" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Finder\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/options-resolver/CHANGELOG.md deleted file mode 100644 index f4de6d01..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/CHANGELOG.md +++ /dev/null @@ -1,96 +0,0 @@ -CHANGELOG -========= - -6.4 ---- - -* Improve message with full path on invalid type in nested option - -6.3 ---- - - * Add `OptionsResolver::setIgnoreUndefined()` and `OptionConfigurator::ignoreUndefined()` to ignore not defined options while resolving - -6.0 ---- - - * Remove `OptionsResolverIntrospector::getDeprecationMessage()` - -5.3 ---- - - * Add prototype definition for nested options - -5.1.0 ------ - - * added fluent configuration of options using `OptionResolver::define()` - * added `setInfo()` and `getInfo()` methods - * updated the signature of method `OptionsResolver::setDeprecated()` to `OptionsResolver::setDeprecation(string $option, string $package, string $version, $message)` - * deprecated `OptionsResolverIntrospector::getDeprecationMessage()`, use `OptionsResolverIntrospector::getDeprecation()` instead - -5.0.0 ------ - - * added argument `$triggerDeprecation` to `OptionsResolver::offsetGet()` - -4.3.0 ------ - - * added `OptionsResolver::addNormalizer` method - -4.2.0 ------ - - * added support for nested options definition - * added `setDeprecated` and `isDeprecated` methods - -3.4.0 ------ - - * added `OptionsResolverIntrospector` to inspect options definitions inside an `OptionsResolver` instance - * added array of types support in allowed types (e.g int[]) - -2.6.0 ------ - - * deprecated OptionsResolverInterface - * [BC BREAK] removed "array" type hint from OptionsResolverInterface methods - setRequired(), setAllowedValues(), addAllowedValues(), setAllowedTypes() and - addAllowedTypes() - * added OptionsResolver::setDefault() - * added OptionsResolver::hasDefault() - * added OptionsResolver::setNormalizer() - * added OptionsResolver::isRequired() - * added OptionsResolver::getRequiredOptions() - * added OptionsResolver::isMissing() - * added OptionsResolver::getMissingOptions() - * added OptionsResolver::setDefined() - * added OptionsResolver::isDefined() - * added OptionsResolver::getDefinedOptions() - * added OptionsResolver::remove() - * added OptionsResolver::clear() - * deprecated OptionsResolver::replaceDefaults() - * deprecated OptionsResolver::setOptional() in favor of setDefined() - * deprecated OptionsResolver::isKnown() in favor of isDefined() - * [BC BREAK] OptionsResolver::isRequired() returns true now if a required - option has a default value set - * [BC BREAK] merged Options into OptionsResolver and turned Options into an - interface - * deprecated Options::overload() (now in OptionsResolver) - * deprecated Options::set() (now in OptionsResolver) - * deprecated Options::get() (now in OptionsResolver) - * deprecated Options::has() (now in OptionsResolver) - * deprecated Options::replace() (now in OptionsResolver) - * [BC BREAK] Options::get() (now in OptionsResolver) can only be used within - lazy option/normalizer closures now - * [BC BREAK] removed Traversable interface from Options since using within - lazy option/normalizer closures resulted in exceptions - * [BC BREAK] removed Options::all() since using within lazy option/normalizer - closures resulted in exceptions - * [BC BREAK] OptionDefinitionException now extends LogicException instead of - RuntimeException - * [BC BREAK] normalizers are not executed anymore for unset options - * normalizers are executed after validating the options now - * [BC BREAK] an UndefinedOptionsException is now thrown instead of an - InvalidOptionsException when non-existing options are passed diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php deleted file mode 100644 index dab741b4..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Debug; - -use Symfony\Component\OptionsResolver\Exception\NoConfigurationException; -use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException; -use Symfony\Component\OptionsResolver\OptionsResolver; - -/** - * @author Maxime Steinhausser - * - * @final - */ -class OptionsResolverIntrospector -{ - private \Closure $get; - - public function __construct(OptionsResolver $optionsResolver) - { - $this->get = \Closure::bind(function ($property, $option, $message) { - /** @var OptionsResolver $this */ - if (!$this->isDefined($option)) { - throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist.', $option)); - } - - if (!\array_key_exists($option, $this->{$property})) { - throw new NoConfigurationException($message); - } - - return $this->{$property}[$option]; - }, $optionsResolver, $optionsResolver); - } - - /** - * @throws NoConfigurationException on no configured value - */ - public function getDefault(string $option): mixed - { - return ($this->get)('defaults', $option, \sprintf('No default value was set for the "%s" option.', $option)); - } - - /** - * @return \Closure[] - * - * @throws NoConfigurationException on no configured closures - */ - public function getLazyClosures(string $option): array - { - return ($this->get)('lazy', $option, \sprintf('No lazy closures were set for the "%s" option.', $option)); - } - - /** - * @return string[] - * - * @throws NoConfigurationException on no configured types - */ - public function getAllowedTypes(string $option): array - { - return ($this->get)('allowedTypes', $option, \sprintf('No allowed types were set for the "%s" option.', $option)); - } - - /** - * @return mixed[] - * - * @throws NoConfigurationException on no configured values - */ - public function getAllowedValues(string $option): array - { - return ($this->get)('allowedValues', $option, \sprintf('No allowed values were set for the "%s" option.', $option)); - } - - /** - * @throws NoConfigurationException on no configured normalizer - */ - public function getNormalizer(string $option): \Closure - { - return current($this->getNormalizers($option)); - } - - /** - * @throws NoConfigurationException when no normalizer is configured - */ - public function getNormalizers(string $option): array - { - return ($this->get)('normalizers', $option, \sprintf('No normalizer was set for the "%s" option.', $option)); - } - - /** - * @throws NoConfigurationException on no configured deprecation - */ - public function getDeprecation(string $option): array - { - return ($this->get)('deprecated', $option, \sprintf('No deprecation was set for the "%s" option.', $option)); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/AccessException.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/AccessException.php deleted file mode 100644 index c12b6806..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/AccessException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Thrown when trying to read an option outside of or write it inside of - * {@link \Symfony\Component\OptionsResolver\Options::resolve()}. - * - * @author Bernhard Schussek - */ -class AccessException extends \LogicException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/ExceptionInterface.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/ExceptionInterface.php deleted file mode 100644 index ea99d050..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Marker interface for all exceptions thrown by the OptionsResolver component. - * - * @author Bernhard Schussek - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/InvalidArgumentException.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/InvalidArgumentException.php deleted file mode 100644 index 6d421d68..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Thrown when an argument is invalid. - * - * @author Bernhard Schussek - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/InvalidOptionsException.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/InvalidOptionsException.php deleted file mode 100644 index 6fd4f125..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/InvalidOptionsException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Thrown when the value of an option does not match its validation rules. - * - * You should make sure a valid value is passed to the option. - * - * @author Bernhard Schussek - */ -class InvalidOptionsException extends InvalidArgumentException -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/MissingOptionsException.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/MissingOptionsException.php deleted file mode 100644 index faa487f1..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/MissingOptionsException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Exception thrown when a required option is missing. - * - * Add the option to the passed options array. - * - * @author Bernhard Schussek - */ -class MissingOptionsException extends InvalidArgumentException -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/NoConfigurationException.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/NoConfigurationException.php deleted file mode 100644 index 6693ec14..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/NoConfigurationException.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -use Symfony\Component\OptionsResolver\Debug\OptionsResolverIntrospector; - -/** - * Thrown when trying to introspect an option definition property - * for which no value was configured inside the OptionsResolver instance. - * - * @see OptionsResolverIntrospector - * - * @author Maxime Steinhausser - */ -class NoConfigurationException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/NoSuchOptionException.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/NoSuchOptionException.php deleted file mode 100644 index 4c3280f4..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/NoSuchOptionException.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Thrown when trying to read an option that has no value set. - * - * When accessing optional options from within a lazy option or normalizer you should first - * check whether the optional option is set. You can do this with `isset($options['optional'])`. - * In contrast to the {@link UndefinedOptionsException}, this is a runtime exception that can - * occur when evaluating lazy options. - * - * @author Tobias Schultze - */ -class NoSuchOptionException extends \OutOfBoundsException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php deleted file mode 100644 index e8e339d4..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Thrown when two lazy options have a cyclic dependency. - * - * @author Bernhard Schussek - */ -class OptionDefinitionException extends \LogicException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php deleted file mode 100644 index 6ca3fce4..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Exception thrown when an undefined option is passed. - * - * You should remove the options in question from your code or define them - * beforehand. - * - * @author Bernhard Schussek - */ -class UndefinedOptionsException extends InvalidArgumentException -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/LICENSE b/tools/php-cs-fixer/vendor/symfony/options-resolver/LICENSE deleted file mode 100644 index 0138f8f0..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionConfigurator.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionConfigurator.php deleted file mode 100644 index e708c2ce..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionConfigurator.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver; - -use Symfony\Component\OptionsResolver\Exception\AccessException; - -final class OptionConfigurator -{ - public function __construct( - private string $name, - private OptionsResolver $resolver, - ) { - $this->resolver->setDefined($name); - } - - /** - * Adds allowed types for this option. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function allowedTypes(string ...$types): static - { - $this->resolver->setAllowedTypes($this->name, $types); - - return $this; - } - - /** - * Sets allowed values for this option. - * - * @param mixed ...$values One or more acceptable values/closures - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function allowedValues(mixed ...$values): static - { - $this->resolver->setAllowedValues($this->name, $values); - - return $this; - } - - /** - * Sets the default value for this option. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function default(mixed $value): static - { - $this->resolver->setDefault($this->name, $value); - - return $this; - } - - /** - * Defines an option configurator with the given name. - */ - public function define(string $option): self - { - return $this->resolver->define($option); - } - - /** - * Marks this option as deprecated. - * - * @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|\Closure $message The deprecation message to use - * - * @return $this - */ - public function deprecated(string $package, string $version, string|\Closure $message = 'The option "%name%" is deprecated.'): static - { - $this->resolver->setDeprecated($this->name, $package, $version, $message); - - return $this; - } - - /** - * Sets the normalizer for this option. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function normalize(\Closure $normalizer): static - { - $this->resolver->setNormalizer($this->name, $normalizer); - - return $this; - } - - /** - * Marks this option as required. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function required(): static - { - $this->resolver->setRequired($this->name); - - return $this; - } - - /** - * Sets an info message for an option. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function info(string $info): static - { - $this->resolver->setInfo($this->name, $info); - - return $this; - } - - /** - * Sets whether ignore undefined options. - * - * @return $this - */ - public function ignoreUndefined(bool $ignore = true): static - { - $this->resolver->setIgnoreUndefined($ignore); - - return $this; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/Options.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/Options.php deleted file mode 100644 index d444ec42..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/Options.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver; - -/** - * Contains resolved option values. - * - * @author Bernhard Schussek - * @author Tobias Schultze - */ -interface Options extends \ArrayAccess, \Countable -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionsResolver.php b/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionsResolver.php deleted file mode 100644 index 8d1d8f70..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/OptionsResolver.php +++ /dev/null @@ -1,1317 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver; - -use Symfony\Component\OptionsResolver\Exception\AccessException; -use Symfony\Component\OptionsResolver\Exception\InvalidArgumentException; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; -use Symfony\Component\OptionsResolver\Exception\MissingOptionsException; -use Symfony\Component\OptionsResolver\Exception\NoSuchOptionException; -use Symfony\Component\OptionsResolver\Exception\OptionDefinitionException; -use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException; - -/** - * Validates options and merges them with default values. - * - * @author Bernhard Schussek - * @author Tobias Schultze - */ -class OptionsResolver implements Options -{ - private const VALIDATION_FUNCTIONS = [ - 'bool' => 'is_bool', - 'boolean' => 'is_bool', - 'int' => 'is_int', - 'integer' => 'is_int', - 'long' => 'is_int', - 'float' => 'is_float', - 'double' => 'is_float', - 'real' => 'is_float', - 'numeric' => 'is_numeric', - 'string' => 'is_string', - 'scalar' => 'is_scalar', - 'array' => 'is_array', - 'iterable' => 'is_iterable', - 'countable' => 'is_countable', - 'callable' => 'is_callable', - 'object' => 'is_object', - 'resource' => 'is_resource', - ]; - - /** - * The names of all defined options. - */ - private array $defined = []; - - /** - * The default option values. - */ - private array $defaults = []; - - /** - * A list of closure for nested options. - * - * @var \Closure[][] - */ - private array $nested = []; - - /** - * The names of required options. - */ - private array $required = []; - - /** - * The resolved option values. - */ - private array $resolved = []; - - /** - * A list of normalizer closures. - * - * @var \Closure[][] - */ - private array $normalizers = []; - - /** - * A list of accepted values for each option. - */ - private array $allowedValues = []; - - /** - * A list of accepted types for each option. - */ - private array $allowedTypes = []; - - /** - * A list of info messages for each option. - */ - private array $info = []; - - /** - * A list of closures for evaluating lazy options. - */ - private array $lazy = []; - - /** - * A list of lazy options whose closure is currently being called. - * - * This list helps detecting circular dependencies between lazy options. - */ - private array $calling = []; - - /** - * A list of deprecated options. - */ - private array $deprecated = []; - - /** - * The list of options provided by the user. - */ - private array $given = []; - - /** - * Whether the instance is locked for reading. - * - * Once locked, the options cannot be changed anymore. This is - * necessary in order to avoid inconsistencies during the resolving - * process. If any option is changed after being read, all evaluated - * lazy options that depend on this option would become invalid. - */ - private bool $locked = false; - - private array $parentsOptions = []; - - /** - * Whether the whole options definition is marked as array prototype. - */ - private ?bool $prototype = null; - - /** - * The prototype array's index that is being read. - */ - private int|string|null $prototypeIndex = null; - - /** - * Whether to ignore undefined options. - */ - private bool $ignoreUndefined = false; - - /** - * Sets the default value of a given option. - * - * If the default value should be set based on other options, you can pass - * a closure with the following signature: - * - * function (Options $options) { - * // ... - * } - * - * The closure will be evaluated when {@link resolve()} is called. The - * closure has access to the resolved values of other options through the - * passed {@link Options} instance: - * - * function (Options $options) { - * if (isset($options['port'])) { - * // ... - * } - * } - * - * If you want to access the previously set default value, add a second - * argument to the closure's signature: - * - * $options->setDefault('name', 'Default Name'); - * - * $options->setDefault('name', function (Options $options, $previousValue) { - * // 'Default Name' === $previousValue - * }); - * - * This is mostly useful if the configuration of the {@link Options} object - * is spread across different locations of your code, such as base and - * sub-classes. - * - * If you want to define nested options, you can pass a closure with the - * following signature: - * - * $options->setDefault('database', function (OptionsResolver $resolver) { - * $resolver->setDefined(['dbname', 'host', 'port', 'user', 'pass']); - * } - * - * To get access to the parent options, add a second argument to the closure's - * signature: - * - * function (OptionsResolver $resolver, Options $parent) { - * // 'default' === $parent['connection'] - * } - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function setDefault(string $option, mixed $value): static - { - // Setting is not possible once resolving starts, because then lazy - // options could manipulate the state of the object, leading to - // inconsistent results. - if ($this->locked) { - throw new AccessException('Default values cannot be set from a lazy option or normalizer.'); - } - - // If an option is a closure that should be evaluated lazily, store it - // in the "lazy" property. - if ($value instanceof \Closure) { - $reflClosure = new \ReflectionFunction($value); - $params = $reflClosure->getParameters(); - - if (isset($params[0]) && Options::class === $this->getParameterClassName($params[0])) { - // Initialize the option if no previous value exists - if (!isset($this->defaults[$option])) { - $this->defaults[$option] = null; - } - - // Ignore previous lazy options if the closure has no second parameter - if (!isset($this->lazy[$option]) || !isset($params[1])) { - $this->lazy[$option] = []; - } - - // Store closure for later evaluation - $this->lazy[$option][] = $value; - $this->defined[$option] = true; - - // Make sure the option is processed and is not nested anymore - unset($this->resolved[$option], $this->nested[$option]); - - return $this; - } - - if (isset($params[0]) && ($type = $params[0]->getType()) instanceof \ReflectionNamedType && self::class === $type->getName() && (!isset($params[1]) || (($type = $params[1]->getType()) instanceof \ReflectionNamedType && Options::class === $type->getName()))) { - // Store closure for later evaluation - $this->nested[$option][] = $value; - $this->defaults[$option] = []; - $this->defined[$option] = true; - - // Make sure the option is processed and is not lazy anymore - unset($this->resolved[$option], $this->lazy[$option]); - - return $this; - } - } - - // This option is not lazy nor nested anymore - unset($this->lazy[$option], $this->nested[$option]); - - // Yet undefined options can be marked as resolved, because we only need - // to resolve options with lazy closures, normalizers or validation - // rules, none of which can exist for undefined options - // If the option was resolved before, update the resolved value - if (!isset($this->defined[$option]) || \array_key_exists($option, $this->resolved)) { - $this->resolved[$option] = $value; - } - - $this->defaults[$option] = $value; - $this->defined[$option] = true; - - return $this; - } - - /** - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function setDefaults(array $defaults): static - { - foreach ($defaults as $option => $value) { - $this->setDefault($option, $value); - } - - return $this; - } - - /** - * Returns whether a default value is set for an option. - * - * Returns true if {@link setDefault()} was called for this option. - * An option is also considered set if it was set to null. - */ - public function hasDefault(string $option): bool - { - return \array_key_exists($option, $this->defaults); - } - - /** - * Marks one or more options as required. - * - * @param string|string[] $optionNames One or more option names - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function setRequired(string|array $optionNames): static - { - if ($this->locked) { - throw new AccessException('Options cannot be made required from a lazy option or normalizer.'); - } - - foreach ((array) $optionNames as $option) { - $this->defined[$option] = true; - $this->required[$option] = true; - } - - return $this; - } - - /** - * Returns whether an option is required. - * - * An option is required if it was passed to {@link setRequired()}. - */ - public function isRequired(string $option): bool - { - return isset($this->required[$option]); - } - - /** - * Returns the names of all required options. - * - * @return string[] - * - * @see isRequired() - */ - public function getRequiredOptions(): array - { - return array_keys($this->required); - } - - /** - * Returns whether an option is missing a default value. - * - * An option is missing if it was passed to {@link setRequired()}, but not - * to {@link setDefault()}. This option must be passed explicitly to - * {@link resolve()}, otherwise an exception will be thrown. - */ - public function isMissing(string $option): bool - { - return isset($this->required[$option]) && !\array_key_exists($option, $this->defaults); - } - - /** - * Returns the names of all options missing a default value. - * - * @return string[] - */ - public function getMissingOptions(): array - { - return array_keys(array_diff_key($this->required, $this->defaults)); - } - - /** - * Defines a valid option name. - * - * Defines an option name without setting a default value. The option will - * be accepted when passed to {@link resolve()}. When not passed, the - * option will not be included in the resolved options. - * - * @param string|string[] $optionNames One or more option names - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function setDefined(string|array $optionNames): static - { - if ($this->locked) { - throw new AccessException('Options cannot be defined from a lazy option or normalizer.'); - } - - foreach ((array) $optionNames as $option) { - $this->defined[$option] = true; - } - - return $this; - } - - /** - * Returns whether an option is defined. - * - * Returns true for any option passed to {@link setDefault()}, - * {@link setRequired()} or {@link setDefined()}. - */ - public function isDefined(string $option): bool - { - return isset($this->defined[$option]); - } - - /** - * Returns the names of all defined options. - * - * @return string[] - * - * @see isDefined() - */ - public function getDefinedOptions(): array - { - return array_keys($this->defined); - } - - public function isNested(string $option): bool - { - return isset($this->nested[$option]); - } - - /** - * Deprecates an option, allowed types or values. - * - * Instead of passing the message, you may also pass a closure with the - * following signature: - * - * function (Options $options, $value): string { - * // ... - * } - * - * The closure receives the value as argument and should return a string. - * Return an empty string to ignore the option deprecation. - * - * The closure is invoked when {@link resolve()} is called. The parameter - * passed to the closure is the value of the option after validating it - * and before normalizing it. - * - * @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|\Closure $message The deprecation message to use - * - * @return $this - */ - public function setDeprecated(string $option, string $package, string $version, string|\Closure $message = 'The option "%name%" is deprecated.'): static - { - if ($this->locked) { - throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist, defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - if (!\is_string($message) && !$message instanceof \Closure) { - throw new InvalidArgumentException(\sprintf('Invalid type for deprecation message argument, expected string or \Closure, but got "%s".', get_debug_type($message))); - } - - // ignore if empty string - if ('' === $message) { - return $this; - } - - $this->deprecated[$option] = [ - 'package' => $package, - 'version' => $version, - 'message' => $message, - ]; - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - public function isDeprecated(string $option): bool - { - return isset($this->deprecated[$option]); - } - - /** - * Sets the normalizer for an option. - * - * The normalizer should be a closure with the following signature: - * - * function (Options $options, $value) { - * // ... - * } - * - * The closure is invoked when {@link resolve()} is called. The closure - * has access to the resolved values of other options through the passed - * {@link Options} instance. - * - * The second parameter passed to the closure is the value of - * the option. - * - * The resolved option value is set to the return value of the closure. - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function setNormalizer(string $option, \Closure $normalizer): static - { - if ($this->locked) { - throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - $this->normalizers[$option] = [$normalizer]; - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Adds a normalizer for an option. - * - * The normalizer should be a closure with the following signature: - * - * function (Options $options, $value): mixed { - * // ... - * } - * - * The closure is invoked when {@link resolve()} is called. The closure - * has access to the resolved values of other options through the passed - * {@link Options} instance. - * - * The second parameter passed to the closure is the value of - * the option. - * - * The resolved option value is set to the return value of the closure. - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function addNormalizer(string $option, \Closure $normalizer, bool $forcePrepend = false): static - { - if ($this->locked) { - throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - if ($forcePrepend) { - $this->normalizers[$option] ??= []; - array_unshift($this->normalizers[$option], $normalizer); - } else { - $this->normalizers[$option][] = $normalizer; - } - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Sets allowed values for an option. - * - * Instead of passing values, you may also pass a closures with the - * following signature: - * - * function ($value) { - * // return true or false - * } - * - * The closure receives the value as argument and should return true to - * accept the value and false to reject the value. - * - * @param mixed $allowedValues One or more acceptable values/closures - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function setAllowedValues(string $option, mixed $allowedValues): static - { - if ($this->locked) { - throw new AccessException('Allowed values cannot be set from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - $this->allowedValues[$option] = \is_array($allowedValues) ? $allowedValues : [$allowedValues]; - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Adds allowed values for an option. - * - * The values are merged with the allowed values defined previously. - * - * Instead of passing values, you may also pass a closures with the - * following signature: - * - * function ($value) { - * // return true or false - * } - * - * The closure receives the value as argument and should return true to - * accept the value and false to reject the value. - * - * @param mixed $allowedValues One or more acceptable values/closures - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function addAllowedValues(string $option, mixed $allowedValues): static - { - if ($this->locked) { - throw new AccessException('Allowed values cannot be added from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - if (!\is_array($allowedValues)) { - $allowedValues = [$allowedValues]; - } - - if (!isset($this->allowedValues[$option])) { - $this->allowedValues[$option] = $allowedValues; - } else { - $this->allowedValues[$option] = array_merge($this->allowedValues[$option], $allowedValues); - } - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Sets allowed types for an option. - * - * Any type for which a corresponding is_() function exists is - * acceptable. Additionally, fully-qualified class or interface names may - * be passed. - * - * @param string|string[] $allowedTypes One or more accepted types - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function setAllowedTypes(string $option, string|array $allowedTypes): static - { - if ($this->locked) { - throw new AccessException('Allowed types cannot be set from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - $this->allowedTypes[$option] = (array) $allowedTypes; - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Adds allowed types for an option. - * - * The types are merged with the allowed types defined previously. - * - * Any type for which a corresponding is_() function exists is - * acceptable. Additionally, fully-qualified class or interface names may - * be passed. - * - * @param string|string[] $allowedTypes One or more accepted types - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function addAllowedTypes(string $option, string|array $allowedTypes): static - { - if ($this->locked) { - throw new AccessException('Allowed types cannot be added from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - if (!isset($this->allowedTypes[$option])) { - $this->allowedTypes[$option] = (array) $allowedTypes; - } else { - $this->allowedTypes[$option] = array_merge($this->allowedTypes[$option], (array) $allowedTypes); - } - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Defines an option configurator with the given name. - */ - public function define(string $option): OptionConfigurator - { - if (isset($this->defined[$option])) { - throw new OptionDefinitionException(\sprintf('The option "%s" is already defined.', $option)); - } - - return new OptionConfigurator($option, $this); - } - - /** - * Sets an info message for an option. - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function setInfo(string $option, string $info): static - { - if ($this->locked) { - throw new AccessException('The Info message cannot be set from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - $this->info[$option] = $info; - - return $this; - } - - /** - * Gets the info message for an option. - */ - public function getInfo(string $option): ?string - { - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - return $this->info[$option] ?? null; - } - - /** - * Marks the whole options definition as array prototype. - * - * @return $this - * - * @throws AccessException If called from a lazy option, a normalizer or a root definition - */ - public function setPrototype(bool $prototype): static - { - if ($this->locked) { - throw new AccessException('The prototype property cannot be set from a lazy option or normalizer.'); - } - - if (null === $this->prototype && $prototype) { - throw new AccessException('The prototype property cannot be set from a root definition.'); - } - - $this->prototype = $prototype; - - return $this; - } - - public function isPrototype(): bool - { - return $this->prototype ?? false; - } - - /** - * Removes the option with the given name. - * - * Undefined options are ignored. - * - * @param string|string[] $optionNames One or more option names - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function remove(string|array $optionNames): static - { - if ($this->locked) { - throw new AccessException('Options cannot be removed from a lazy option or normalizer.'); - } - - foreach ((array) $optionNames as $option) { - unset($this->defined[$option], $this->defaults[$option], $this->required[$option], $this->resolved[$option]); - unset($this->lazy[$option], $this->normalizers[$option], $this->allowedTypes[$option], $this->allowedValues[$option], $this->info[$option]); - } - - return $this; - } - - /** - * Removes all options. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function clear(): static - { - if ($this->locked) { - throw new AccessException('Options cannot be cleared from a lazy option or normalizer.'); - } - - $this->defined = []; - $this->defaults = []; - $this->nested = []; - $this->required = []; - $this->resolved = []; - $this->lazy = []; - $this->normalizers = []; - $this->allowedTypes = []; - $this->allowedValues = []; - $this->deprecated = []; - $this->info = []; - - return $this; - } - - /** - * Merges options with the default values stored in the container and - * validates them. - * - * Exceptions are thrown if: - * - * - Undefined options are passed; - * - Required options are missing; - * - Options have invalid types; - * - Options have invalid values. - * - * @throws UndefinedOptionsException If an option name is undefined - * @throws InvalidOptionsException If an option doesn't fulfill the - * specified validation rules - * @throws MissingOptionsException If a required option is missing - * @throws OptionDefinitionException If there is a cyclic dependency between - * lazy options and/or normalizers - * @throws NoSuchOptionException If a lazy option reads an unavailable option - * @throws AccessException If called from a lazy option or normalizer - */ - public function resolve(array $options = []): array - { - if ($this->locked) { - throw new AccessException('Options cannot be resolved from a lazy option or normalizer.'); - } - - // Allow this method to be called multiple times - $clone = clone $this; - - // Make sure that no unknown options are passed - $diff = $this->ignoreUndefined ? [] : array_diff_key($options, $clone->defined); - - if (\count($diff) > 0) { - ksort($clone->defined); - ksort($diff); - - throw new UndefinedOptionsException(\sprintf((\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".', $this->formatOptions(array_keys($diff)), implode('", "', array_keys($clone->defined)))); - } - - // Override options set by the user - foreach ($options as $option => $value) { - if ($this->ignoreUndefined && !isset($clone->defined[$option])) { - continue; - } - - $clone->given[$option] = true; - $clone->defaults[$option] = $value; - unset($clone->resolved[$option], $clone->lazy[$option]); - } - - // Check whether any required option is missing - $diff = array_diff_key($clone->required, $clone->defaults); - - if (\count($diff) > 0) { - ksort($diff); - - throw new MissingOptionsException(\sprintf(\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.', $this->formatOptions(array_keys($diff)))); - } - - // Lock the container - $clone->locked = true; - - // Now process the individual options. Use offsetGet(), which resolves - // the option itself and any options that the option depends on - foreach ($clone->defaults as $option => $_) { - $clone->offsetGet($option); - } - - return $clone->resolved; - } - - /** - * Returns the resolved value of an option. - * - * @param bool $triggerDeprecation Whether to trigger the deprecation or not (true by default) - * - * @throws AccessException If accessing this method outside of - * {@link resolve()} - * @throws NoSuchOptionException If the option is not set - * @throws InvalidOptionsException If the option doesn't fulfill the - * specified validation rules - * @throws OptionDefinitionException If there is a cyclic dependency between - * lazy options and/or normalizers - */ - public function offsetGet(mixed $option, bool $triggerDeprecation = true): mixed - { - if (!$this->locked) { - throw new AccessException('Array access is only supported within closures of lazy options and normalizers.'); - } - - // Shortcut for resolved options - if (isset($this->resolved[$option]) || \array_key_exists($option, $this->resolved)) { - if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || $this->calling) && \is_string($this->deprecated[$option]['message'])) { - trigger_deprecation($this->deprecated[$option]['package'], $this->deprecated[$option]['version'], strtr($this->deprecated[$option]['message'], ['%name%' => $option])); - } - - return $this->resolved[$option]; - } - - // Check whether the option is set at all - if (!isset($this->defaults[$option]) && !\array_key_exists($option, $this->defaults)) { - if (!isset($this->defined[$option])) { - throw new NoSuchOptionException(\sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - throw new NoSuchOptionException(\sprintf('The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.', $this->formatOptions([$option]))); - } - - $value = $this->defaults[$option]; - - // Resolve the option if it is a nested definition - if (isset($this->nested[$option])) { - // If the closure is already being called, we have a cyclic dependency - if (isset($this->calling[$option])) { - throw new OptionDefinitionException(\sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); - } - - if (!\is_array($value)) { - throw new InvalidOptionsException(\sprintf('The nested option "%s" with value %s is expected to be of type array, but is of type "%s".', $this->formatOptions([$option]), $this->formatValue($value), get_debug_type($value))); - } - - // The following section must be protected from cyclic calls. - $this->calling[$option] = true; - try { - $resolver = new self(); - $resolver->prototype = false; - $resolver->parentsOptions = $this->parentsOptions; - $resolver->parentsOptions[] = $option; - foreach ($this->nested[$option] as $closure) { - $closure($resolver, $this); - } - - if ($resolver->prototype) { - $values = []; - foreach ($value as $index => $prototypeValue) { - if (!\is_array($prototypeValue)) { - throw new InvalidOptionsException(\sprintf('The value of the option "%s" is expected to be of type array of array, but is of type array of "%s".', $this->formatOptions([$option]), get_debug_type($prototypeValue))); - } - - $resolver->prototypeIndex = $index; - $values[$index] = $resolver->resolve($prototypeValue); - } - $value = $values; - } else { - $value = $resolver->resolve($value); - } - } finally { - $resolver->prototypeIndex = null; - unset($this->calling[$option]); - } - } - - // Resolve the option if the default value is lazily evaluated - if (isset($this->lazy[$option])) { - // If the closure is already being called, we have a cyclic - // dependency - if (isset($this->calling[$option])) { - throw new OptionDefinitionException(\sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); - } - - // The following section must be protected from cyclic - // calls. Set $calling for the current $option to detect a cyclic - // dependency - // BEGIN - $this->calling[$option] = true; - try { - foreach ($this->lazy[$option] as $closure) { - $value = $closure($this, $value); - } - } finally { - unset($this->calling[$option]); - } - // END - } - - // Validate the type of the resolved option - if (isset($this->allowedTypes[$option])) { - $valid = true; - $invalidTypes = []; - - foreach ($this->allowedTypes[$option] as $type) { - if ($valid = $this->verifyTypes($type, $value, $invalidTypes)) { - break; - } - } - - if (!$valid) { - $fmtActualValue = $this->formatValue($value); - $fmtAllowedTypes = implode('" or "', $this->allowedTypes[$option]); - $fmtProvidedTypes = implode('|', array_keys($invalidTypes)); - $allowedContainsArrayType = \count(array_filter($this->allowedTypes[$option], static fn ($item) => str_ends_with($item, '[]'))) > 0; - - if (\is_array($value) && $allowedContainsArrayType) { - throw new InvalidOptionsException(\sprintf('The option "%s" with value %s is expected to be of type "%s", but one of the elements is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); - } - - throw new InvalidOptionsException(\sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); - } - } - - // Validate the value of the resolved option - if (isset($this->allowedValues[$option])) { - $success = false; - $printableAllowedValues = []; - - foreach ($this->allowedValues[$option] as $allowedValue) { - if ($allowedValue instanceof \Closure) { - if ($allowedValue($value)) { - $success = true; - break; - } - - // Don't include closures in the exception message - continue; - } - - if ($value === $allowedValue) { - $success = true; - break; - } - - $printableAllowedValues[] = $allowedValue; - } - - if (!$success) { - $message = \sprintf( - 'The option "%s" with value %s is invalid.', - $this->formatOptions([$option]), - $this->formatValue($value) - ); - - if (\count($printableAllowedValues) > 0) { - $message .= \sprintf( - ' Accepted values are: %s.', - $this->formatValues($printableAllowedValues) - ); - } - - if (isset($this->info[$option])) { - $message .= \sprintf(' Info: %s.', $this->info[$option]); - } - - throw new InvalidOptionsException($message); - } - } - - // Check whether the option is deprecated - // and it is provided by the user or is being called from a lazy evaluation - if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || ($this->calling && \is_string($this->deprecated[$option]['message'])))) { - $deprecation = $this->deprecated[$option]; - $message = $this->deprecated[$option]['message']; - - if ($message instanceof \Closure) { - // If the closure is already being called, we have a cyclic dependency - if (isset($this->calling[$option])) { - throw new OptionDefinitionException(\sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); - } - - $this->calling[$option] = true; - try { - if (!\is_string($message = $message($this, $value))) { - throw new InvalidOptionsException(\sprintf('Invalid type for deprecation message, expected string but got "%s", return an empty string to ignore.', get_debug_type($message))); - } - } finally { - unset($this->calling[$option]); - } - } - - if ('' !== $message) { - trigger_deprecation($deprecation['package'], $deprecation['version'], strtr($message, ['%name%' => $option])); - } - } - - // Normalize the validated option - if (isset($this->normalizers[$option])) { - // If the closure is already being called, we have a cyclic - // dependency - if (isset($this->calling[$option])) { - throw new OptionDefinitionException(\sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); - } - - // The following section must be protected from cyclic - // calls. Set $calling for the current $option to detect a cyclic - // dependency - // BEGIN - $this->calling[$option] = true; - try { - foreach ($this->normalizers[$option] as $normalizer) { - $value = $normalizer($this, $value); - } - } finally { - unset($this->calling[$option]); - } - // END - } - - // Mark as resolved - $this->resolved[$option] = $value; - - return $value; - } - - private function verifyTypes(string $type, mixed $value, array &$invalidTypes, int $level = 0): bool - { - if (\is_array($value) && str_ends_with($type, '[]')) { - $type = substr($type, 0, -2); - $valid = true; - - foreach ($value as $val) { - if (!$this->verifyTypes($type, $val, $invalidTypes, $level + 1)) { - $valid = false; - } - } - - return $valid; - } - - if (('null' === $type && null === $value) || (isset(self::VALIDATION_FUNCTIONS[$type]) ? self::VALIDATION_FUNCTIONS[$type]($value) : $value instanceof $type)) { - return true; - } - - if (!$invalidTypes || $level > 0) { - $invalidTypes[get_debug_type($value)] = true; - } - - return false; - } - - /** - * Returns whether a resolved option with the given name exists. - * - * @throws AccessException If accessing this method outside of {@link resolve()} - * - * @see \ArrayAccess::offsetExists() - */ - public function offsetExists(mixed $option): bool - { - if (!$this->locked) { - throw new AccessException('Array access is only supported within closures of lazy options and normalizers.'); - } - - return \array_key_exists($option, $this->defaults); - } - - /** - * Not supported. - * - * @throws AccessException - */ - public function offsetSet(mixed $option, mixed $value): void - { - throw new AccessException('Setting options via array access is not supported. Use setDefault() instead.'); - } - - /** - * Not supported. - * - * @throws AccessException - */ - public function offsetUnset(mixed $option): void - { - throw new AccessException('Removing options via array access is not supported. Use remove() instead.'); - } - - /** - * Returns the number of set options. - * - * This may be only a subset of the defined options. - * - * @throws AccessException If accessing this method outside of {@link resolve()} - * - * @see \Countable::count() - */ - public function count(): int - { - if (!$this->locked) { - throw new AccessException('Counting is only supported within closures of lazy options and normalizers.'); - } - - return \count($this->defaults); - } - - /** - * Sets whether ignore undefined options. - * - * @return $this - */ - public function setIgnoreUndefined(bool $ignore = true): static - { - $this->ignoreUndefined = $ignore; - - return $this; - } - - /** - * Returns a string representation of the value. - * - * This method returns the equivalent PHP tokens for most scalar types - * (i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped - * in double quotes ("). - */ - private function formatValue(mixed $value): string - { - if (\is_object($value)) { - return $value::class; - } - - if (\is_array($value)) { - return 'array'; - } - - if (\is_string($value)) { - return '"'.$value.'"'; - } - - if (\is_resource($value)) { - return 'resource'; - } - - if (null === $value) { - return 'null'; - } - - if (false === $value) { - return 'false'; - } - - if (true === $value) { - return 'true'; - } - - return (string) $value; - } - - /** - * Returns a string representation of a list of values. - * - * Each of the values is converted to a string using - * {@link formatValue()}. The values are then concatenated with commas. - * - * @see formatValue() - */ - private function formatValues(array $values): string - { - foreach ($values as $key => $value) { - $values[$key] = $this->formatValue($value); - } - - return implode(', ', $values); - } - - private function formatOptions(array $options): string - { - if ($this->parentsOptions) { - $prefix = array_shift($this->parentsOptions); - if ($this->parentsOptions) { - $prefix .= \sprintf('[%s]', implode('][', $this->parentsOptions)); - } - - if ($this->prototype && null !== $this->prototypeIndex) { - $prefix .= \sprintf('[%s]', $this->prototypeIndex); - } - - $options = array_map(static fn (string $option): string => \sprintf('%s[%s]', $prefix, $option), $options); - } - - return implode('", "', $options); - } - - private function getParameterClassName(\ReflectionParameter $parameter): ?string - { - if (!($type = $parameter->getType()) instanceof \ReflectionNamedType || $type->isBuiltin()) { - return null; - } - - return $type->getName(); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/README.md b/tools/php-cs-fixer/vendor/symfony/options-resolver/README.md deleted file mode 100644 index c63b9005..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/README.md +++ /dev/null @@ -1,15 +0,0 @@ -OptionsResolver Component -========================= - -The OptionsResolver component is `array_replace` on steroids. It allows you to -create an options system with required options, defaults, validation (type, -value), normalization and more. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/options_resolver.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/tools/php-cs-fixer/vendor/symfony/options-resolver/composer.json b/tools/php-cs-fixer/vendor/symfony/options-resolver/composer.json deleted file mode 100644 index e70640d6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/options-resolver/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "symfony/options-resolver", - "type": "library", - "description": "Provides an improved replacement for the array_replace PHP function", - "keywords": ["options", "config", "configuration"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/Ctype.php b/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/Ctype.php deleted file mode 100644 index ba75a2c9..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/Ctype.php +++ /dev/null @@ -1,232 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Ctype; - -/** - * Ctype implementation through regex. - * - * @internal - * - * @author Gert de Pagter - */ -final class Ctype -{ - /** - * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. - * - * @see https://php.net/ctype-alnum - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alnum($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is a letter, FALSE otherwise. - * - * @see https://php.net/ctype-alpha - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alpha($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); - } - - /** - * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. - * - * @see https://php.net/ctype-cntrl - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_cntrl($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); - } - - /** - * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. - * - * @see https://php.net/ctype-digit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_digit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. - * - * @see https://php.net/ctype-graph - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_graph($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); - } - - /** - * Returns TRUE if every character in text is a lowercase letter. - * - * @see https://php.net/ctype-lower - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_lower($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); - } - - /** - * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. - * - * @see https://php.net/ctype-print - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_print($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); - } - - /** - * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. - * - * @see https://php.net/ctype-punct - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_punct($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); - } - - /** - * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. - * - * @see https://php.net/ctype-space - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_space($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); - } - - /** - * Returns TRUE if every character in text is an uppercase letter. - * - * @see https://php.net/ctype-upper - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_upper($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); - } - - /** - * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. - * - * @see https://php.net/ctype-xdigit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_xdigit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); - } - - /** - * Converts integers to their char versions according to normal ctype behaviour, if needed. - * - * If an integer between -128 and 255 inclusive is provided, - * it is interpreted as the ASCII value of a single character - * (negative values have 256 added in order to allow characters in the Extended ASCII range). - * Any other integer is interpreted as a string containing the decimal digits of the integer. - * - * @param mixed $int - * @param string $function - * - * @return mixed - */ - private static function convert_int_to_char_for_ctype($int, $function) - { - if (!\is_int($int)) { - return $int; - } - - if ($int < -128 || $int > 255) { - return (string) $int; - } - - if (\PHP_VERSION_ID >= 80100) { - @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); - } - - if ($int < 0) { - $int += 256; - } - - return \chr($int); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/LICENSE deleted file mode 100644 index 7536caea..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/README.md b/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/README.md deleted file mode 100644 index b144d03c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Symfony Polyfill / Ctype -======================== - -This component provides `ctype_*` functions to users who run php versions without the ctype extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/bootstrap.php b/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/bootstrap.php deleted file mode 100644 index d54524b3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/bootstrap.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('ctype_alnum')) { - function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit($text) { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph($text) { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower($text) { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print($text) { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct($text) { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space($text) { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper($text) { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/bootstrap80.php b/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/bootstrap80.php deleted file mode 100644 index ab2f8611..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/bootstrap80.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (!function_exists('ctype_alnum')) { - function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/composer.json deleted file mode 100644 index 131ca7ad..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-ctype/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/polyfill-ctype", - "type": "library", - "description": "Symfony polyfill for ctype functions", - "keywords": ["polyfill", "compatibility", "portable", "ctype"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2" - }, - "provide": { - "ext-ctype": "*" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/Grapheme.php b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/Grapheme.php deleted file mode 100644 index 5373f168..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/Grapheme.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Grapheme; - -\define('SYMFONY_GRAPHEME_CLUSTER_RX', ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39) ? '\X' : Grapheme::GRAPHEME_CLUSTER_RX); - -/** - * Partial intl implementation in pure PHP. - * - * Implemented: - * - grapheme_extract - Extract a sequence of grapheme clusters from a text buffer, which must be encoded in UTF-8 - * - grapheme_stripos - Find position (in grapheme units) of first occurrence of a case-insensitive string - * - grapheme_stristr - Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack - * - grapheme_strlen - Get string length in grapheme units - * - grapheme_strpos - Find position (in grapheme units) of first occurrence of a string - * - grapheme_strripos - Find position (in grapheme units) of last occurrence of a case-insensitive string - * - grapheme_strrpos - Find position (in grapheme units) of last occurrence of a string - * - grapheme_strstr - Returns part of haystack string from the first occurrence of needle to the end of haystack - * - grapheme_substr - Return part of a string - * - * @author Nicolas Grekas - * - * @internal - */ -final class Grapheme -{ - // (CRLF|([ZWNJ-ZWJ]|T+|L*(LV?V+|LV|LVT)T*|L+|[^Control])[Extend]*|[Control]) - // This regular expression is a work around for http://bugs.exim.org/1279 - public const GRAPHEME_CLUSTER_RX = '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; - - private const CASE_FOLD = [ - ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], - ]; - - public static function grapheme_extract($s, $size, $type = \GRAPHEME_EXTR_COUNT, $start = 0, &$next = 0) - { - if (0 > $start) { - $start = \strlen($s) + $start; - } - - if (!\is_scalar($s)) { - $hasError = false; - set_error_handler(function () use (&$hasError) { $hasError = true; }); - $next = substr($s, $start); - restore_error_handler(); - if ($hasError) { - substr($s, $start); - $s = ''; - } else { - $s = $next; - } - } else { - $s = substr($s, $start); - } - $size = (int) $size; - $type = (int) $type; - $start = (int) $start; - - if (\GRAPHEME_EXTR_COUNT !== $type && \GRAPHEME_EXTR_MAXBYTES !== $type && \GRAPHEME_EXTR_MAXCHARS !== $type) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('grapheme_extract(): Argument #3 ($type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS'); - } - - if (!isset($s[0]) || 0 > $size || 0 > $start) { - return false; - } - if (0 === $size) { - return ''; - } - - $next = $start; - - $s = preg_split('/('.SYMFONY_GRAPHEME_CLUSTER_RX.')/u', "\r\n".$s, $size + 1, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE); - - if (!isset($s[1])) { - return false; - } - - $i = 1; - $ret = ''; - - do { - if (\GRAPHEME_EXTR_COUNT === $type) { - --$size; - } elseif (\GRAPHEME_EXTR_MAXBYTES === $type) { - $size -= \strlen($s[$i]); - } else { - $size -= iconv_strlen($s[$i], 'UTF-8//IGNORE'); - } - - if ($size >= 0) { - $ret .= $s[$i]; - } - } while (isset($s[++$i]) && $size > 0); - - $next += \strlen($ret); - - return $ret; - } - - public static function grapheme_strlen($s) - { - preg_replace('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', '', $s, -1, $len); - - return 0 === $len && '' !== $s ? null : $len; - } - - public static function grapheme_substr($s, $start, $len = null) - { - if (null === $len) { - $len = 2147483647; - } - - preg_match_all('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', $s, $s); - - $slen = \count($s[0]); - $start = (int) $start; - - if (0 > $start) { - $start += $slen; - } - if (0 > $start) { - if (\PHP_VERSION_ID < 80000) { - return false; - } - - $start = 0; - } - if ($start >= $slen) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - - $rem = $slen - $start; - - if (0 > $len) { - $len += $rem; - } - if (0 === $len) { - return ''; - } - if (0 > $len) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - if ($len > $rem) { - $len = $rem; - } - - return implode('', \array_slice($s[0], $start, $len)); - } - - public static function grapheme_strpos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 0); - } - - public static function grapheme_stripos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 1); - } - - public static function grapheme_strrpos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 2); - } - - public static function grapheme_strripos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 3); - } - - public static function grapheme_stristr($s, $needle, $beforeNeedle = false) - { - return mb_stristr($s, $needle, $beforeNeedle, 'UTF-8'); - } - - public static function grapheme_strstr($s, $needle, $beforeNeedle = false) - { - return mb_strstr($s, $needle, $beforeNeedle, 'UTF-8'); - } - - private static function grapheme_position($s, $needle, $offset, $mode) - { - $needle = (string) $needle; - if (80000 > \PHP_VERSION_ID && !preg_match('/./us', $needle)) { - return false; - } - $s = (string) $s; - if (!preg_match('/./us', $s)) { - return false; - } - if ($offset > 0) { - $s = self::grapheme_substr($s, $offset); - } elseif ($offset < 0) { - if (2 > $mode) { - $offset += self::grapheme_strlen($s); - $s = self::grapheme_substr($s, $offset); - if (0 > $offset) { - $offset = 0; - } - } elseif (0 > $offset += self::grapheme_strlen($needle)) { - $s = self::grapheme_substr($s, 0, $offset); - $offset = 0; - } else { - $offset = 0; - } - } - - // As UTF-8 is self-synchronizing, and we have ensured the strings are valid UTF-8, - // we can use normal binary string functions here. For case-insensitive searches, - // case fold the strings first. - $caseInsensitive = $mode & 1; - $reverse = $mode & 2; - if ($caseInsensitive) { - // Use the same case folding mode as mbstring does for mb_stripos(). - // Stick to SIMPLE case folding to avoid changing the length of the string, which - // might result in offsets being shifted. - $mode = \defined('MB_CASE_FOLD_SIMPLE') ? \MB_CASE_FOLD_SIMPLE : \MB_CASE_LOWER; - $s = mb_convert_case($s, $mode, 'UTF-8'); - $needle = mb_convert_case($needle, $mode, 'UTF-8'); - - if (!\defined('MB_CASE_FOLD_SIMPLE')) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); - $needle = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $needle); - } - } - if ($reverse) { - $needlePos = strrpos($s, $needle); - } else { - $needlePos = strpos($s, $needle); - } - - return false !== $needlePos ? self::grapheme_strlen(substr($s, 0, $needlePos)) + $offset : false; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/LICENSE deleted file mode 100644 index 6e3afce6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/README.md b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/README.md deleted file mode 100644 index f55d92c5..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/README.md +++ /dev/null @@ -1,31 +0,0 @@ -Symfony Polyfill / Intl: Grapheme -================================= - -This component provides a partial, native PHP implementation of the -[Grapheme functions](https://php.net/intl.grapheme) from the -[Intl](https://php.net/intl) extension. - -- [`grapheme_extract`](https://php.net/grapheme_extract): Extract a sequence of grapheme - clusters from a text buffer, which must be encoded in UTF-8 -- [`grapheme_stripos`](https://php.net/grapheme_stripos): Find position (in grapheme units) - of first occurrence of a case-insensitive string -- [`grapheme_stristr`](https://php.net/grapheme_stristr): Returns part of haystack string - from the first occurrence of case-insensitive needle to the end of haystack -- [`grapheme_strlen`](https://php.net/grapheme_strlen): Get string length in grapheme units -- [`grapheme_strpos`](https://php.net/grapheme_strpos): Find position (in grapheme units) - of first occurrence of a string -- [`grapheme_strripos`](https://php.net/grapheme_strripos): Find position (in grapheme units) - of last occurrence of a case-insensitive string -- [`grapheme_strrpos`](https://php.net/grapheme_strrpos): Find position (in grapheme units) - of last occurrence of a string -- [`grapheme_strstr`](https://php.net/grapheme_strstr): Returns part of haystack string from - the first occurrence of needle to the end of haystack -- [`grapheme_substr`](https://php.net/grapheme_substr): Return part of a string - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/bootstrap.php b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/bootstrap.php deleted file mode 100644 index a9ea03c7..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/bootstrap.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Grapheme as p; - -if (extension_loaded('intl')) { - return; -} - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!defined('GRAPHEME_EXTR_COUNT')) { - define('GRAPHEME_EXTR_COUNT', 0); -} -if (!defined('GRAPHEME_EXTR_MAXBYTES')) { - define('GRAPHEME_EXTR_MAXBYTES', 1); -} -if (!defined('GRAPHEME_EXTR_MAXCHARS')) { - define('GRAPHEME_EXTR_MAXCHARS', 2); -} - -if (!function_exists('grapheme_extract')) { - function grapheme_extract($haystack, $size, $type = 0, $start = 0, &$next = 0) { return p\Grapheme::grapheme_extract($haystack, $size, $type, $start, $next); } -} -if (!function_exists('grapheme_stripos')) { - function grapheme_stripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_stripos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_stristr')) { - function grapheme_stristr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_stristr($haystack, $needle, $beforeNeedle); } -} -if (!function_exists('grapheme_strlen')) { - function grapheme_strlen($input) { return p\Grapheme::grapheme_strlen($input); } -} -if (!function_exists('grapheme_strpos')) { - function grapheme_strpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strpos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strripos')) { - function grapheme_strripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strripos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strrpos')) { - function grapheme_strrpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strrpos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strstr')) { - function grapheme_strstr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_strstr($haystack, $needle, $beforeNeedle); } -} -if (!function_exists('grapheme_substr')) { - function grapheme_substr($string, $offset, $length = null) { return p\Grapheme::grapheme_substr($string, $offset, $length); } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php deleted file mode 100644 index b8c07867..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Grapheme as p; - -if (!defined('GRAPHEME_EXTR_COUNT')) { - define('GRAPHEME_EXTR_COUNT', 0); -} -if (!defined('GRAPHEME_EXTR_MAXBYTES')) { - define('GRAPHEME_EXTR_MAXBYTES', 1); -} -if (!defined('GRAPHEME_EXTR_MAXCHARS')) { - define('GRAPHEME_EXTR_MAXCHARS', 2); -} - -if (!function_exists('grapheme_extract')) { - function grapheme_extract(?string $haystack, ?int $size, ?int $type = GRAPHEME_EXTR_COUNT, ?int $offset = 0, &$next = null): string|false { return p\Grapheme::grapheme_extract((string) $haystack, (int) $size, (int) $type, (int) $offset, $next); } -} -if (!function_exists('grapheme_stripos')) { - function grapheme_stripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_stripos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_stristr')) { - function grapheme_stristr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_stristr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } -} -if (!function_exists('grapheme_strlen')) { - function grapheme_strlen(?string $string): int|false|null { return p\Grapheme::grapheme_strlen((string) $string); } -} -if (!function_exists('grapheme_strpos')) { - function grapheme_strpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strpos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strripos')) { - function grapheme_strripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strripos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strrpos')) { - function grapheme_strrpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strrpos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strstr')) { - function grapheme_strstr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_strstr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } -} -if (!function_exists('grapheme_substr')) { - function grapheme_substr(?string $string, ?int $offset, ?int $length = null): string|false { return p\Grapheme::grapheme_substr((string) $string, (int) $offset, $length); } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/composer.json deleted file mode 100644 index 0eea417d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-grapheme/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/polyfill-intl-grapheme", - "type": "library", - "description": "Symfony polyfill for intl's grapheme_* functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "grapheme"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Grapheme\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-intl": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/LICENSE deleted file mode 100644 index 6e3afce6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Normalizer.php deleted file mode 100644 index 81704ab3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Normalizer.php +++ /dev/null @@ -1,310 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Normalizer; - -/** - * Normalizer is a PHP fallback implementation of the Normalizer class provided by the intl extension. - * - * It has been validated with Unicode 6.3 Normalization Conformance Test. - * See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations. - * - * @author Nicolas Grekas - * - * @internal - */ -class Normalizer -{ - public const FORM_D = \Normalizer::FORM_D; - public const FORM_KD = \Normalizer::FORM_KD; - public const FORM_C = \Normalizer::FORM_C; - public const FORM_KC = \Normalizer::FORM_KC; - public const NFD = \Normalizer::NFD; - public const NFKD = \Normalizer::NFKD; - public const NFC = \Normalizer::NFC; - public const NFKC = \Normalizer::NFKC; - - private static $C; - private static $D; - private static $KD; - private static $cC; - private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - - public static function isNormalized(string $s, int $form = self::FORM_C) - { - if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) { - return false; - } - if (!isset($s[strspn($s, self::$ASCII)])) { - return true; - } - if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) { - return true; - } - - return self::normalize($s, $form) === $s; - } - - public static function normalize(string $s, int $form = self::FORM_C) - { - if (!preg_match('//u', $s)) { - return false; - } - - switch ($form) { - case self::NFC: $C = true; $K = false; break; - case self::NFD: $C = false; $K = false; break; - case self::NFKC: $C = true; $K = true; break; - case self::NFKD: $C = false; $K = true; break; - default: - if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) { - return $s; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form'); - } - - if ('' === $s) { - return ''; - } - - if ($K && null === self::$KD) { - self::$KD = self::getData('compatibilityDecomposition'); - } - - if (null === self::$D) { - self::$D = self::getData('canonicalDecomposition'); - self::$cC = self::getData('combiningClass'); - } - - if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { - mb_internal_encoding('8bit'); - } - - $r = self::decompose($s, $K); - - if ($C) { - if (null === self::$C) { - self::$C = self::getData('canonicalComposition'); - } - - $r = self::recompose($r); - } - if (null !== $mbEncoding) { - mb_internal_encoding($mbEncoding); - } - - return $r; - } - - private static function recompose($s) - { - $ASCII = self::$ASCII; - $compMap = self::$C; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - - $result = $tail = ''; - - $i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"]; - $len = \strlen($s); - - $lastUchr = substr($s, 0, $i); - $lastUcls = isset($combClass[$lastUchr]) ? 256 : 0; - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - if ($j = strspn($s, $ASCII, $i + 1)) { - $lastUchr .= substr($s, $i, $j); - $i += $j; - } - - $result .= $lastUchr; - $lastUchr = $s[$i]; - $lastUcls = 0; - ++$i; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - - if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr - || $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr - || $lastUcls) { - // Table lookup and combining chars composition - - $ucls = $combClass[$uchr] ?? 0; - - if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { - $lastUchr = $compMap[$lastUchr.$uchr]; - } elseif ($lastUcls = $ucls) { - $tail .= $uchr; - } else { - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - $result .= $lastUchr; - $lastUchr = $uchr; - } - } else { - // Hangul chars - - $L = \ord($lastUchr[2]) - 0x80; - $V = \ord($uchr[2]) - 0xA1; - $T = 0; - - $uchr = substr($s, $i + $ulen, 3); - - if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") { - $T = \ord($uchr[2]) - 0xA7; - 0 > $T && $T += 0x40; - $ulen += 3; - } - - $L = 0xAC00 + ($L * 21 + $V) * 28 + $T; - $lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F); - } - - $i += $ulen; - } - - return $result.$lastUchr.$tail; - } - - private static function decompose($s, $c) - { - $result = ''; - - $ASCII = self::$ASCII; - $decompMap = self::$D; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - if ($c) { - $compatMap = self::$KD; - } - - $c = []; - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $j = 1 + strspn($s, $ASCII, $i + 1); - $result .= substr($s, $i, $j); - $i += $j; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) { - // Table lookup - - if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) { - $uchr = $j; - - $j = \strlen($uchr); - $ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"]; - - if ($ulen != $j) { - // Put trailing chars in $s - - $j -= $ulen; - $i -= $j; - - if (0 > $i) { - $s = str_repeat(' ', -$i).$s; - $len -= $i; - $i = 0; - } - - while ($j--) { - $s[$i + $j] = $uchr[$ulen + $j]; - } - - $uchr = substr($uchr, 0, $ulen); - } - } - if (isset($combClass[$uchr])) { - // Combining chars, for sorting - - if (!isset($c[$combClass[$uchr]])) { - $c[$combClass[$uchr]] = ''; - } - $c[$combClass[$uchr]] .= $uchr; - continue; - } - } else { - // Hangul chars - - $uchr = unpack('C*', $uchr); - $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; - - $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) - ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); - - if ($j %= 28) { - $uchr .= $j < 25 - ? ("\xE1\x86".\chr(0xA7 + $j)) - : ("\xE1\x87".\chr(0x67 + $j)); - } - } - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $result .= $uchr; - } - - if ($c) { - ksort($c); - $result .= implode('', $c); - } - - return $result; - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/README.md b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/README.md deleted file mode 100644 index b9b762e8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Symfony Polyfill / Intl: Normalizer -=================================== - -This component provides a fallback implementation for the -[`Normalizer`](https://php.net/Normalizer) class provided -by the [Intl](https://php.net/intl) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php deleted file mode 100644 index 0fdfc890..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php +++ /dev/null @@ -1,17 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ĕ' => 'Ĕ', - 'ĕ' => 'ĕ', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'ģ' => 'ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'ĭ', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'ķ', - 'Ĺ' => 'Ĺ', - 'ĺ' => 'ĺ', - 'Ļ' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'Ľ', - 'ľ' => 'ľ', - 'Ń' => 'Ń', - 'ń' => 'ń', - 'Ņ' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'Ň', - 'ň' => 'ň', - 'Ō' => 'Ō', - 'ō' => 'ō', - 'Ŏ' => 'Ŏ', - 'ŏ' => 'ŏ', - 'Ő' => 'Ő', - 'ő' => 'ő', - 'Ŕ' => 'Ŕ', - 'ŕ' => 'ŕ', - 'Ŗ' => 'Ŗ', - 'ŗ' => 'ŗ', - 'Ř' => 'Ř', - 'ř' => 'ř', - 'Ś' => 'Ś', - 'ś' => 'ś', - 'Ŝ' => 'Ŝ', - 'ŝ' => 'ŝ', - 'Ş' => 'Ş', - 'ş' => 'ş', - 'Š' => 'Š', - 'š' => 'š', - 'Ţ' => 'Ţ', - 'ţ' => 'ţ', - 'Ť' => 'Ť', - 'ť' => 'ť', - 'Ũ' => 'Ũ', - 'ũ' => 'ũ', - 'Ū' => 'Ū', - 'ū' => 'ū', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'ŭ', - 'Ů' => 'Ů', - 'ů' => 'ů', - 'Ű' => 'Ű', - 'ű' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Ŵ' => 'Ŵ', - 'ŵ' => 'ŵ', - 'Ŷ' => 'Ŷ', - 'ŷ' => 'ŷ', - 'Ÿ' => 'Ÿ', - 'Ź' => 'Ź', - 'ź' => 'ź', - 'Ż' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'Ž', - 'ž' => 'ž', - 'Ơ' => 'Ơ', - 'ơ' => 'ơ', - 'Ư' => 'Ư', - 'ư' => 'ư', - 'Ǎ' => 'Ǎ', - 'ǎ' => 'ǎ', - 'Ǐ' => 'Ǐ', - 'ǐ' => 'ǐ', - 'Ǒ' => 'Ǒ', - 'ǒ' => 'ǒ', - 'Ǔ' => 'Ǔ', - 'ǔ' => 'ǔ', - 'Ǖ' => 'Ǖ', - 'ǖ' => 'ǖ', - 'Ǘ' => 'Ǘ', - 'ǘ' => 'ǘ', - 'Ǚ' => 'Ǚ', - 'ǚ' => 'ǚ', - 'Ǜ' => 'Ǜ', - 'ǜ' => 'ǜ', - 'Ǟ' => 'Ǟ', - 'ǟ' => 'ǟ', - 'Ǡ' => 'Ǡ', - 'ǡ' => 'ǡ', - 'Ǣ' => 'Ǣ', - 'ǣ' => 'ǣ', - 'Ǧ' => 'Ǧ', - 'ǧ' => 'ǧ', - 'Ǩ' => 'Ǩ', - 'ǩ' => 'ǩ', - 'Ǫ' => 'Ǫ', - 'ǫ' => 'ǫ', - 'Ǭ' => 'Ǭ', - 'ǭ' => 'ǭ', - 'Ǯ' => 'Ǯ', - 'ǯ' => 'ǯ', - 'ǰ' => 'ǰ', - 'Ǵ' => 'Ǵ', - 'ǵ' => 'ǵ', - 'Ǹ' => 'Ǹ', - 'ǹ' => 'ǹ', - 'Ǻ' => 'Ǻ', - 'ǻ' => 'ǻ', - 'Ǽ' => 'Ǽ', - 'ǽ' => 'ǽ', - 'Ǿ' => 'Ǿ', - 'ǿ' => 'ǿ', - 'Ȁ' => 'Ȁ', - 'ȁ' => 'ȁ', - 'Ȃ' => 'Ȃ', - 'ȃ' => 'ȃ', - 'Ȅ' => 'Ȅ', - 'ȅ' => 'ȅ', - 'Ȇ' => 'Ȇ', - 'ȇ' => 'ȇ', - 'Ȉ' => 'Ȉ', - 'ȉ' => 'ȉ', - 'Ȋ' => 'Ȋ', - 'ȋ' => 'ȋ', - 'Ȍ' => 'Ȍ', - 'ȍ' => 'ȍ', - 'Ȏ' => 'Ȏ', - 'ȏ' => 'ȏ', - 'Ȑ' => 'Ȑ', - 'ȑ' => 'ȑ', - 'Ȓ' => 'Ȓ', - 'ȓ' => 'ȓ', - 'Ȕ' => 'Ȕ', - 'ȕ' => 'ȕ', - 'Ȗ' => 'Ȗ', - 'ȗ' => 'ȗ', - 'Ș' => 'Ș', - 'ș' => 'ș', - 'Ț' => 'Ț', - 'ț' => 'ț', - 'Ȟ' => 'Ȟ', - 'ȟ' => 'ȟ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'ȩ' => 'ȩ', - 'Ȫ' => 'Ȫ', - 'ȫ' => 'ȫ', - 'Ȭ' => 'Ȭ', - 'ȭ' => 'ȭ', - 'Ȯ' => 'Ȯ', - 'ȯ' => 'ȯ', - 'Ȱ' => 'Ȱ', - 'ȱ' => 'ȱ', - 'Ȳ' => 'Ȳ', - 'ȳ' => 'ȳ', - '΅' => '΅', - 'Ά' => 'Ά', - 'Έ' => 'Έ', - 'Ή' => 'Ή', - 'Ί' => 'Ί', - 'Ό' => 'Ό', - 'Ύ' => 'Ύ', - 'Ώ' => 'Ώ', - 'ΐ' => 'ΐ', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'ά' => 'ά', - 'έ' => 'έ', - 'ή' => 'ή', - 'ί' => 'ί', - 'ΰ' => 'ΰ', - 'ϊ' => 'ϊ', - 'ϋ' => 'ϋ', - 'ό' => 'ό', - 'ύ' => 'ύ', - 'ώ' => 'ώ', - 'ϓ' => 'ϓ', - 'ϔ' => 'ϔ', - 'Ѐ' => 'Ѐ', - 'Ё' => 'Ё', - 'Ѓ' => 'Ѓ', - 'Ї' => 'Ї', - 'Ќ' => 'Ќ', - 'Ѝ' => 'Ѝ', - 'Ў' => 'Ў', - 'Й' => 'Й', - 'й' => 'й', - 'ѐ' => 'ѐ', - 'ё' => 'ё', - 'ѓ' => 'ѓ', - 'ї' => 'ї', - 'ќ' => 'ќ', - 'ѝ' => 'ѝ', - 'ў' => 'ў', - 'Ѷ' => 'Ѷ', - 'ѷ' => 'ѷ', - 'Ӂ' => 'Ӂ', - 'ӂ' => 'ӂ', - 'Ӑ' => 'Ӑ', - 'ӑ' => 'ӑ', - 'Ӓ' => 'Ӓ', - 'ӓ' => 'ӓ', - 'Ӗ' => 'Ӗ', - 'ӗ' => 'ӗ', - 'Ӛ' => 'Ӛ', - 'ӛ' => 'ӛ', - 'Ӝ' => 'Ӝ', - 'ӝ' => 'ӝ', - 'Ӟ' => 'Ӟ', - 'ӟ' => 'ӟ', - 'Ӣ' => 'Ӣ', - 'ӣ' => 'ӣ', - 'Ӥ' => 'Ӥ', - 'ӥ' => 'ӥ', - 'Ӧ' => 'Ӧ', - 'ӧ' => 'ӧ', - 'Ӫ' => 'Ӫ', - 'ӫ' => 'ӫ', - 'Ӭ' => 'Ӭ', - 'ӭ' => 'ӭ', - 'Ӯ' => 'Ӯ', - 'ӯ' => 'ӯ', - 'Ӱ' => 'Ӱ', - 'ӱ' => 'ӱ', - 'Ӳ' => 'Ӳ', - 'ӳ' => 'ӳ', - 'Ӵ' => 'Ӵ', - 'ӵ' => 'ӵ', - 'Ӹ' => 'Ӹ', - 'ӹ' => 'ӹ', - 'آ' => 'آ', - 'أ' => 'أ', - 'ؤ' => 'ؤ', - 'إ' => 'إ', - 'ئ' => 'ئ', - 'ۀ' => 'ۀ', - 'ۂ' => 'ۂ', - 'ۓ' => 'ۓ', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ୈ' => 'ୈ', - 'ୋ' => 'ୋ', - 'ୌ' => 'ୌ', - 'ஔ' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'ේ', - 'ො' => 'ො', - 'ෝ' => 'ෝ', - 'ෞ' => 'ෞ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ὲ' => 'ὲ', - 'ὴ' => 'ὴ', - 'ὶ' => 'ὶ', - 'ὸ' => 'ὸ', - 'ὺ' => 'ὺ', - 'ὼ' => 'ὼ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'ᾼ' => 'ᾼ', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Ὴ' => 'Ὴ', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ὼ' => 'Ὼ', - 'ῼ' => 'ῼ', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', -); diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php deleted file mode 100644 index 5a3e8e09..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php +++ /dev/null @@ -1,2065 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ĕ' => 'Ĕ', - 'ĕ' => 'ĕ', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'ģ' => 'ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'ĭ', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'ķ', - 'Ĺ' => 'Ĺ', - 'ĺ' => 'ĺ', - 'Ļ' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'Ľ', - 'ľ' => 'ľ', - 'Ń' => 'Ń', - 'ń' => 'ń', - 'Ņ' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'Ň', - 'ň' => 'ň', - 'Ō' => 'Ō', - 'ō' => 'ō', - 'Ŏ' => 'Ŏ', - 'ŏ' => 'ŏ', - 'Ő' => 'Ő', - 'ő' => 'ő', - 'Ŕ' => 'Ŕ', - 'ŕ' => 'ŕ', - 'Ŗ' => 'Ŗ', - 'ŗ' => 'ŗ', - 'Ř' => 'Ř', - 'ř' => 'ř', - 'Ś' => 'Ś', - 'ś' => 'ś', - 'Ŝ' => 'Ŝ', - 'ŝ' => 'ŝ', - 'Ş' => 'Ş', - 'ş' => 'ş', - 'Š' => 'Š', - 'š' => 'š', - 'Ţ' => 'Ţ', - 'ţ' => 'ţ', - 'Ť' => 'Ť', - 'ť' => 'ť', - 'Ũ' => 'Ũ', - 'ũ' => 'ũ', - 'Ū' => 'Ū', - 'ū' => 'ū', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'ŭ', - 'Ů' => 'Ů', - 'ů' => 'ů', - 'Ű' => 'Ű', - 'ű' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Ŵ' => 'Ŵ', - 'ŵ' => 'ŵ', - 'Ŷ' => 'Ŷ', - 'ŷ' => 'ŷ', - 'Ÿ' => 'Ÿ', - 'Ź' => 'Ź', - 'ź' => 'ź', - 'Ż' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'Ž', - 'ž' => 'ž', - 'Ơ' => 'Ơ', - 'ơ' => 'ơ', - 'Ư' => 'Ư', - 'ư' => 'ư', - 'Ǎ' => 'Ǎ', - 'ǎ' => 'ǎ', - 'Ǐ' => 'Ǐ', - 'ǐ' => 'ǐ', - 'Ǒ' => 'Ǒ', - 'ǒ' => 'ǒ', - 'Ǔ' => 'Ǔ', - 'ǔ' => 'ǔ', - 'Ǖ' => 'Ǖ', - 'ǖ' => 'ǖ', - 'Ǘ' => 'Ǘ', - 'ǘ' => 'ǘ', - 'Ǚ' => 'Ǚ', - 'ǚ' => 'ǚ', - 'Ǜ' => 'Ǜ', - 'ǜ' => 'ǜ', - 'Ǟ' => 'Ǟ', - 'ǟ' => 'ǟ', - 'Ǡ' => 'Ǡ', - 'ǡ' => 'ǡ', - 'Ǣ' => 'Ǣ', - 'ǣ' => 'ǣ', - 'Ǧ' => 'Ǧ', - 'ǧ' => 'ǧ', - 'Ǩ' => 'Ǩ', - 'ǩ' => 'ǩ', - 'Ǫ' => 'Ǫ', - 'ǫ' => 'ǫ', - 'Ǭ' => 'Ǭ', - 'ǭ' => 'ǭ', - 'Ǯ' => 'Ǯ', - 'ǯ' => 'ǯ', - 'ǰ' => 'ǰ', - 'Ǵ' => 'Ǵ', - 'ǵ' => 'ǵ', - 'Ǹ' => 'Ǹ', - 'ǹ' => 'ǹ', - 'Ǻ' => 'Ǻ', - 'ǻ' => 'ǻ', - 'Ǽ' => 'Ǽ', - 'ǽ' => 'ǽ', - 'Ǿ' => 'Ǿ', - 'ǿ' => 'ǿ', - 'Ȁ' => 'Ȁ', - 'ȁ' => 'ȁ', - 'Ȃ' => 'Ȃ', - 'ȃ' => 'ȃ', - 'Ȅ' => 'Ȅ', - 'ȅ' => 'ȅ', - 'Ȇ' => 'Ȇ', - 'ȇ' => 'ȇ', - 'Ȉ' => 'Ȉ', - 'ȉ' => 'ȉ', - 'Ȋ' => 'Ȋ', - 'ȋ' => 'ȋ', - 'Ȍ' => 'Ȍ', - 'ȍ' => 'ȍ', - 'Ȏ' => 'Ȏ', - 'ȏ' => 'ȏ', - 'Ȑ' => 'Ȑ', - 'ȑ' => 'ȑ', - 'Ȓ' => 'Ȓ', - 'ȓ' => 'ȓ', - 'Ȕ' => 'Ȕ', - 'ȕ' => 'ȕ', - 'Ȗ' => 'Ȗ', - 'ȗ' => 'ȗ', - 'Ș' => 'Ș', - 'ș' => 'ș', - 'Ț' => 'Ț', - 'ț' => 'ț', - 'Ȟ' => 'Ȟ', - 'ȟ' => 'ȟ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'ȩ' => 'ȩ', - 'Ȫ' => 'Ȫ', - 'ȫ' => 'ȫ', - 'Ȭ' => 'Ȭ', - 'ȭ' => 'ȭ', - 'Ȯ' => 'Ȯ', - 'ȯ' => 'ȯ', - 'Ȱ' => 'Ȱ', - 'ȱ' => 'ȱ', - 'Ȳ' => 'Ȳ', - 'ȳ' => 'ȳ', - '̀' => '̀', - '́' => '́', - '̓' => '̓', - '̈́' => '̈́', - 'ʹ' => 'ʹ', - ';' => ';', - '΅' => '΅', - 'Ά' => 'Ά', - '·' => '·', - 'Έ' => 'Έ', - 'Ή' => 'Ή', - 'Ί' => 'Ί', - 'Ό' => 'Ό', - 'Ύ' => 'Ύ', - 'Ώ' => 'Ώ', - 'ΐ' => 'ΐ', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'ά' => 'ά', - 'έ' => 'έ', - 'ή' => 'ή', - 'ί' => 'ί', - 'ΰ' => 'ΰ', - 'ϊ' => 'ϊ', - 'ϋ' => 'ϋ', - 'ό' => 'ό', - 'ύ' => 'ύ', - 'ώ' => 'ώ', - 'ϓ' => 'ϓ', - 'ϔ' => 'ϔ', - 'Ѐ' => 'Ѐ', - 'Ё' => 'Ё', - 'Ѓ' => 'Ѓ', - 'Ї' => 'Ї', - 'Ќ' => 'Ќ', - 'Ѝ' => 'Ѝ', - 'Ў' => 'Ў', - 'Й' => 'Й', - 'й' => 'й', - 'ѐ' => 'ѐ', - 'ё' => 'ё', - 'ѓ' => 'ѓ', - 'ї' => 'ї', - 'ќ' => 'ќ', - 'ѝ' => 'ѝ', - 'ў' => 'ў', - 'Ѷ' => 'Ѷ', - 'ѷ' => 'ѷ', - 'Ӂ' => 'Ӂ', - 'ӂ' => 'ӂ', - 'Ӑ' => 'Ӑ', - 'ӑ' => 'ӑ', - 'Ӓ' => 'Ӓ', - 'ӓ' => 'ӓ', - 'Ӗ' => 'Ӗ', - 'ӗ' => 'ӗ', - 'Ӛ' => 'Ӛ', - 'ӛ' => 'ӛ', - 'Ӝ' => 'Ӝ', - 'ӝ' => 'ӝ', - 'Ӟ' => 'Ӟ', - 'ӟ' => 'ӟ', - 'Ӣ' => 'Ӣ', - 'ӣ' => 'ӣ', - 'Ӥ' => 'Ӥ', - 'ӥ' => 'ӥ', - 'Ӧ' => 'Ӧ', - 'ӧ' => 'ӧ', - 'Ӫ' => 'Ӫ', - 'ӫ' => 'ӫ', - 'Ӭ' => 'Ӭ', - 'ӭ' => 'ӭ', - 'Ӯ' => 'Ӯ', - 'ӯ' => 'ӯ', - 'Ӱ' => 'Ӱ', - 'ӱ' => 'ӱ', - 'Ӳ' => 'Ӳ', - 'ӳ' => 'ӳ', - 'Ӵ' => 'Ӵ', - 'ӵ' => 'ӵ', - 'Ӹ' => 'Ӹ', - 'ӹ' => 'ӹ', - 'آ' => 'آ', - 'أ' => 'أ', - 'ؤ' => 'ؤ', - 'إ' => 'إ', - 'ئ' => 'ئ', - 'ۀ' => 'ۀ', - 'ۂ' => 'ۂ', - 'ۓ' => 'ۓ', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'क़' => 'क़', - 'ख़' => 'ख़', - 'ग़' => 'ग़', - 'ज़' => 'ज़', - 'ड़' => 'ड़', - 'ढ़' => 'ढ़', - 'फ़' => 'फ़', - 'य़' => 'य़', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ড়' => 'ড়', - 'ঢ়' => 'ঢ়', - 'য়' => 'য়', - 'ਲ਼' => 'ਲ਼', - 'ਸ਼' => 'ਸ਼', - 'ਖ਼' => 'ਖ਼', - 'ਗ਼' => 'ਗ਼', - 'ਜ਼' => 'ਜ਼', - 'ਫ਼' => 'ਫ਼', - 'ୈ' => 'ୈ', - 'ୋ' => 'ୋ', - 'ୌ' => 'ୌ', - 'ଡ଼' => 'ଡ଼', - 'ଢ଼' => 'ଢ଼', - 'ஔ' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'ේ', - 'ො' => 'ො', - 'ෝ' => 'ෝ', - 'ෞ' => 'ෞ', - 'གྷ' => 'གྷ', - 'ཌྷ' => 'ཌྷ', - 'དྷ' => 'དྷ', - 'བྷ' => 'བྷ', - 'ཛྷ' => 'ཛྷ', - 'ཀྵ' => 'ཀྵ', - 'ཱི' => 'ཱི', - 'ཱུ' => 'ཱུ', - 'ྲྀ' => 'ྲྀ', - 'ླྀ' => 'ླྀ', - 'ཱྀ' => 'ཱྀ', - 'ྒྷ' => 'ྒྷ', - 'ྜྷ' => 'ྜྷ', - 'ྡྷ' => 'ྡྷ', - 'ྦྷ' => 'ྦྷ', - 'ྫྷ' => 'ྫྷ', - 'ྐྵ' => 'ྐྵ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ά' => 'ά', - 'ὲ' => 'ὲ', - 'έ' => 'έ', - 'ὴ' => 'ὴ', - 'ή' => 'ή', - 'ὶ' => 'ὶ', - 'ί' => 'ί', - 'ὸ' => 'ὸ', - 'ό' => 'ό', - 'ὺ' => 'ὺ', - 'ύ' => 'ύ', - 'ὼ' => 'ὼ', - 'ώ' => 'ώ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'Ά' => 'Ά', - 'ᾼ' => 'ᾼ', - 'ι' => 'ι', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Έ' => 'Έ', - 'Ὴ' => 'Ὴ', - 'Ή' => 'Ή', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ΐ' => 'ΐ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - 'Ί' => 'Ί', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ΰ' => 'ΰ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ύ' => 'Ύ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - '΅' => '΅', - '`' => '`', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ό' => 'Ό', - 'Ὼ' => 'Ὼ', - 'Ώ' => 'Ώ', - 'ῼ' => 'ῼ', - '´' => '´', - ' ' => ' ', - ' ' => ' ', - 'Ω' => 'Ω', - 'K' => 'K', - 'Å' => 'Å', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - '〈' => '〈', - '〉' => '〉', - '⫝̸' => '⫝̸', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '豈' => '豈', - '更' => '更', - '車' => '車', - '賈' => '賈', - '滑' => '滑', - '串' => '串', - '句' => '句', - '龜' => '龜', - '龜' => '龜', - '契' => '契', - '金' => '金', - '喇' => '喇', - '奈' => '奈', - '懶' => '懶', - '癩' => '癩', - '羅' => '羅', - '蘿' => '蘿', - '螺' => '螺', - '裸' => '裸', - '邏' => '邏', - '樂' => '樂', - '洛' => '洛', - '烙' => '烙', - '珞' => '珞', - '落' => '落', - '酪' => '酪', - '駱' => '駱', - '亂' => '亂', - '卵' => '卵', - '欄' => '欄', - '爛' => '爛', - '蘭' => '蘭', - '鸞' => '鸞', - '嵐' => '嵐', - '濫' => '濫', - '藍' => '藍', - '襤' => '襤', - '拉' => '拉', - '臘' => '臘', - '蠟' => '蠟', - '廊' => '廊', - '朗' => '朗', - '浪' => '浪', - '狼' => '狼', - '郎' => '郎', - '來' => '來', - '冷' => '冷', - '勞' => '勞', - '擄' => '擄', - '櫓' => '櫓', - '爐' => '爐', - '盧' => '盧', - '老' => '老', - '蘆' => '蘆', - '虜' => '虜', - '路' => '路', - '露' => '露', - '魯' => '魯', - '鷺' => '鷺', - '碌' => '碌', - '祿' => '祿', - '綠' => '綠', - '菉' => '菉', - '錄' => '錄', - '鹿' => '鹿', - '論' => '論', - '壟' => '壟', - '弄' => '弄', - '籠' => '籠', - '聾' => '聾', - '牢' => '牢', - '磊' => '磊', - '賂' => '賂', - '雷' => '雷', - '壘' => '壘', - '屢' => '屢', - '樓' => '樓', - '淚' => '淚', - '漏' => '漏', - '累' => '累', - '縷' => '縷', - '陋' => '陋', - '勒' => '勒', - '肋' => '肋', - '凜' => '凜', - '凌' => '凌', - '稜' => '稜', - '綾' => '綾', - '菱' => '菱', - '陵' => '陵', - '讀' => '讀', - '拏' => '拏', - '樂' => '樂', - '諾' => '諾', - '丹' => '丹', - '寧' => '寧', - '怒' => '怒', - '率' => '率', - '異' => '異', - '北' => '北', - '磻' => '磻', - '便' => '便', - '復' => '復', - '不' => '不', - '泌' => '泌', - '數' => '數', - '索' => '索', - '參' => '參', - '塞' => '塞', - '省' => '省', - '葉' => '葉', - '說' => '說', - '殺' => '殺', - '辰' => '辰', - '沈' => '沈', - '拾' => '拾', - '若' => '若', - '掠' => '掠', - '略' => '略', - '亮' => '亮', - '兩' => '兩', - '凉' => '凉', - '梁' => '梁', - '糧' => '糧', - '良' => '良', - '諒' => '諒', - '量' => '量', - '勵' => '勵', - '呂' => '呂', - '女' => '女', - '廬' => '廬', - '旅' => '旅', - '濾' => '濾', - '礪' => '礪', - '閭' => '閭', - '驪' => '驪', - '麗' => '麗', - '黎' => '黎', - '力' => '力', - '曆' => '曆', - '歷' => '歷', - '轢' => '轢', - '年' => '年', - '憐' => '憐', - '戀' => '戀', - '撚' => '撚', - '漣' => '漣', - '煉' => '煉', - '璉' => '璉', - '秊' => '秊', - '練' => '練', - '聯' => '聯', - '輦' => '輦', - '蓮' => '蓮', - '連' => '連', - '鍊' => '鍊', - '列' => '列', - '劣' => '劣', - '咽' => '咽', - '烈' => '烈', - '裂' => '裂', - '說' => '說', - '廉' => '廉', - '念' => '念', - '捻' => '捻', - '殮' => '殮', - '簾' => '簾', - '獵' => '獵', - '令' => '令', - '囹' => '囹', - '寧' => '寧', - '嶺' => '嶺', - '怜' => '怜', - '玲' => '玲', - '瑩' => '瑩', - '羚' => '羚', - '聆' => '聆', - '鈴' => '鈴', - '零' => '零', - '靈' => '靈', - '領' => '領', - '例' => '例', - '禮' => '禮', - '醴' => '醴', - '隸' => '隸', - '惡' => '惡', - '了' => '了', - '僚' => '僚', - '寮' => '寮', - '尿' => '尿', - '料' => '料', - '樂' => '樂', - '燎' => '燎', - '療' => '療', - '蓼' => '蓼', - '遼' => '遼', - '龍' => '龍', - '暈' => '暈', - '阮' => '阮', - '劉' => '劉', - '杻' => '杻', - '柳' => '柳', - '流' => '流', - '溜' => '溜', - '琉' => '琉', - '留' => '留', - '硫' => '硫', - '紐' => '紐', - '類' => '類', - '六' => '六', - '戮' => '戮', - '陸' => '陸', - '倫' => '倫', - '崙' => '崙', - '淪' => '淪', - '輪' => '輪', - '律' => '律', - '慄' => '慄', - '栗' => '栗', - '率' => '率', - '隆' => '隆', - '利' => '利', - '吏' => '吏', - '履' => '履', - '易' => '易', - '李' => '李', - '梨' => '梨', - '泥' => '泥', - '理' => '理', - '痢' => '痢', - '罹' => '罹', - '裏' => '裏', - '裡' => '裡', - '里' => '里', - '離' => '離', - '匿' => '匿', - '溺' => '溺', - '吝' => '吝', - '燐' => '燐', - '璘' => '璘', - '藺' => '藺', - '隣' => '隣', - '鱗' => '鱗', - '麟' => '麟', - '林' => '林', - '淋' => '淋', - '臨' => '臨', - '立' => '立', - '笠' => '笠', - '粒' => '粒', - '狀' => '狀', - '炙' => '炙', - '識' => '識', - '什' => '什', - '茶' => '茶', - '刺' => '刺', - '切' => '切', - '度' => '度', - '拓' => '拓', - '糖' => '糖', - '宅' => '宅', - '洞' => '洞', - '暴' => '暴', - '輻' => '輻', - '行' => '行', - '降' => '降', - '見' => '見', - '廓' => '廓', - '兀' => '兀', - '嗀' => '嗀', - '塚' => '塚', - '晴' => '晴', - '凞' => '凞', - '猪' => '猪', - '益' => '益', - '礼' => '礼', - '神' => '神', - '祥' => '祥', - '福' => '福', - '靖' => '靖', - '精' => '精', - '羽' => '羽', - '蘒' => '蘒', - '諸' => '諸', - '逸' => '逸', - '都' => '都', - '飯' => '飯', - '飼' => '飼', - '館' => '館', - '鶴' => '鶴', - '郞' => '郞', - '隷' => '隷', - '侮' => '侮', - '僧' => '僧', - '免' => '免', - '勉' => '勉', - '勤' => '勤', - '卑' => '卑', - '喝' => '喝', - '嘆' => '嘆', - '器' => '器', - '塀' => '塀', - '墨' => '墨', - '層' => '層', - '屮' => '屮', - '悔' => '悔', - '慨' => '慨', - '憎' => '憎', - '懲' => '懲', - '敏' => '敏', - '既' => '既', - '暑' => '暑', - '梅' => '梅', - '海' => '海', - '渚' => '渚', - '漢' => '漢', - '煮' => '煮', - '爫' => '爫', - '琢' => '琢', - '碑' => '碑', - '社' => '社', - '祉' => '祉', - '祈' => '祈', - '祐' => '祐', - '祖' => '祖', - '祝' => '祝', - '禍' => '禍', - '禎' => '禎', - '穀' => '穀', - '突' => '突', - '節' => '節', - '練' => '練', - '縉' => '縉', - '繁' => '繁', - '署' => '署', - '者' => '者', - '臭' => '臭', - '艹' => '艹', - '艹' => '艹', - '著' => '著', - '褐' => '褐', - '視' => '視', - '謁' => '謁', - '謹' => '謹', - '賓' => '賓', - '贈' => '贈', - '辶' => '辶', - '逸' => '逸', - '難' => '難', - '響' => '響', - '頻' => '頻', - '恵' => '恵', - '𤋮' => '𤋮', - '舘' => '舘', - '並' => '並', - '况' => '况', - '全' => '全', - '侀' => '侀', - '充' => '充', - '冀' => '冀', - '勇' => '勇', - '勺' => '勺', - '喝' => '喝', - '啕' => '啕', - '喙' => '喙', - '嗢' => '嗢', - '塚' => '塚', - '墳' => '墳', - '奄' => '奄', - '奔' => '奔', - '婢' => '婢', - '嬨' => '嬨', - '廒' => '廒', - '廙' => '廙', - '彩' => '彩', - '徭' => '徭', - '惘' => '惘', - '慎' => '慎', - '愈' => '愈', - '憎' => '憎', - '慠' => '慠', - '懲' => '懲', - '戴' => '戴', - '揄' => '揄', - '搜' => '搜', - '摒' => '摒', - '敖' => '敖', - '晴' => '晴', - '朗' => '朗', - '望' => '望', - '杖' => '杖', - '歹' => '歹', - '殺' => '殺', - '流' => '流', - '滛' => '滛', - '滋' => '滋', - '漢' => '漢', - '瀞' => '瀞', - '煮' => '煮', - '瞧' => '瞧', - '爵' => '爵', - '犯' => '犯', - '猪' => '猪', - '瑱' => '瑱', - '甆' => '甆', - '画' => '画', - '瘝' => '瘝', - '瘟' => '瘟', - '益' => '益', - '盛' => '盛', - '直' => '直', - '睊' => '睊', - '着' => '着', - '磌' => '磌', - '窱' => '窱', - '節' => '節', - '类' => '类', - '絛' => '絛', - '練' => '練', - '缾' => '缾', - '者' => '者', - '荒' => '荒', - '華' => '華', - '蝹' => '蝹', - '襁' => '襁', - '覆' => '覆', - '視' => '視', - '調' => '調', - '諸' => '諸', - '請' => '請', - '謁' => '謁', - '諾' => '諾', - '諭' => '諭', - '謹' => '謹', - '變' => '變', - '贈' => '贈', - '輸' => '輸', - '遲' => '遲', - '醙' => '醙', - '鉶' => '鉶', - '陼' => '陼', - '難' => '難', - '靖' => '靖', - '韛' => '韛', - '響' => '響', - '頋' => '頋', - '頻' => '頻', - '鬒' => '鬒', - '龜' => '龜', - '𢡊' => '𢡊', - '𢡄' => '𢡄', - '𣏕' => '𣏕', - '㮝' => '㮝', - '䀘' => '䀘', - '䀹' => '䀹', - '𥉉' => '𥉉', - '𥳐' => '𥳐', - '𧻓' => '𧻓', - '齃' => '齃', - '龎' => '龎', - 'יִ' => 'יִ', - 'ײַ' => 'ײַ', - 'שׁ' => 'שׁ', - 'שׂ' => 'שׂ', - 'שּׁ' => 'שּׁ', - 'שּׂ' => 'שּׂ', - 'אַ' => 'אַ', - 'אָ' => 'אָ', - 'אּ' => 'אּ', - 'בּ' => 'בּ', - 'גּ' => 'גּ', - 'דּ' => 'דּ', - 'הּ' => 'הּ', - 'וּ' => 'וּ', - 'זּ' => 'זּ', - 'טּ' => 'טּ', - 'יּ' => 'יּ', - 'ךּ' => 'ךּ', - 'כּ' => 'כּ', - 'לּ' => 'לּ', - 'מּ' => 'מּ', - 'נּ' => 'נּ', - 'סּ' => 'סּ', - 'ףּ' => 'ףּ', - 'פּ' => 'פּ', - 'צּ' => 'צּ', - 'קּ' => 'קּ', - 'רּ' => 'רּ', - 'שּ' => 'שּ', - 'תּ' => 'תּ', - 'וֹ' => 'וֹ', - 'בֿ' => 'בֿ', - 'כֿ' => 'כֿ', - 'פֿ' => 'פֿ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', - '𝅗𝅥' => '𝅗𝅥', - '𝅘𝅥' => '𝅘𝅥', - '𝅘𝅥𝅮' => '𝅘𝅥𝅮', - '𝅘𝅥𝅯' => '𝅘𝅥𝅯', - '𝅘𝅥𝅰' => '𝅘𝅥𝅰', - '𝅘𝅥𝅱' => '𝅘𝅥𝅱', - '𝅘𝅥𝅲' => '𝅘𝅥𝅲', - '𝆹𝅥' => '𝆹𝅥', - '𝆺𝅥' => '𝆺𝅥', - '𝆹𝅥𝅮' => '𝆹𝅥𝅮', - '𝆺𝅥𝅮' => '𝆺𝅥𝅮', - '𝆹𝅥𝅯' => '𝆹𝅥𝅯', - '𝆺𝅥𝅯' => '𝆺𝅥𝅯', - '丽' => '丽', - '丸' => '丸', - '乁' => '乁', - '𠄢' => '𠄢', - '你' => '你', - '侮' => '侮', - '侻' => '侻', - '倂' => '倂', - '偺' => '偺', - '備' => '備', - '僧' => '僧', - '像' => '像', - '㒞' => '㒞', - '𠘺' => '𠘺', - '免' => '免', - '兔' => '兔', - '兤' => '兤', - '具' => '具', - '𠔜' => '𠔜', - '㒹' => '㒹', - '內' => '內', - '再' => '再', - '𠕋' => '𠕋', - '冗' => '冗', - '冤' => '冤', - '仌' => '仌', - '冬' => '冬', - '况' => '况', - '𩇟' => '𩇟', - '凵' => '凵', - '刃' => '刃', - '㓟' => '㓟', - '刻' => '刻', - '剆' => '剆', - '割' => '割', - '剷' => '剷', - '㔕' => '㔕', - '勇' => '勇', - '勉' => '勉', - '勤' => '勤', - '勺' => '勺', - '包' => '包', - '匆' => '匆', - '北' => '北', - '卉' => '卉', - '卑' => '卑', - '博' => '博', - '即' => '即', - '卽' => '卽', - '卿' => '卿', - '卿' => '卿', - '卿' => '卿', - '𠨬' => '𠨬', - '灰' => '灰', - '及' => '及', - '叟' => '叟', - '𠭣' => '𠭣', - '叫' => '叫', - '叱' => '叱', - '吆' => '吆', - '咞' => '咞', - '吸' => '吸', - '呈' => '呈', - '周' => '周', - '咢' => '咢', - '哶' => '哶', - '唐' => '唐', - '啓' => '啓', - '啣' => '啣', - '善' => '善', - '善' => '善', - '喙' => '喙', - '喫' => '喫', - '喳' => '喳', - '嗂' => '嗂', - '圖' => '圖', - '嘆' => '嘆', - '圗' => '圗', - '噑' => '噑', - '噴' => '噴', - '切' => '切', - '壮' => '壮', - '城' => '城', - '埴' => '埴', - '堍' => '堍', - '型' => '型', - '堲' => '堲', - '報' => '報', - '墬' => '墬', - '𡓤' => '𡓤', - '売' => '売', - '壷' => '壷', - '夆' => '夆', - '多' => '多', - '夢' => '夢', - '奢' => '奢', - '𡚨' => '𡚨', - '𡛪' => '𡛪', - '姬' => '姬', - '娛' => '娛', - '娧' => '娧', - '姘' => '姘', - '婦' => '婦', - '㛮' => '㛮', - '㛼' => '㛼', - '嬈' => '嬈', - '嬾' => '嬾', - '嬾' => '嬾', - '𡧈' => '𡧈', - '寃' => '寃', - '寘' => '寘', - '寧' => '寧', - '寳' => '寳', - '𡬘' => '𡬘', - '寿' => '寿', - '将' => '将', - '当' => '当', - '尢' => '尢', - '㞁' => '㞁', - '屠' => '屠', - '屮' => '屮', - '峀' => '峀', - '岍' => '岍', - '𡷤' => '𡷤', - '嵃' => '嵃', - '𡷦' => '𡷦', - '嵮' => '嵮', - '嵫' => '嵫', - '嵼' => '嵼', - '巡' => '巡', - '巢' => '巢', - '㠯' => '㠯', - '巽' => '巽', - '帨' => '帨', - '帽' => '帽', - '幩' => '幩', - '㡢' => '㡢', - '𢆃' => '𢆃', - '㡼' => '㡼', - '庰' => '庰', - '庳' => '庳', - '庶' => '庶', - '廊' => '廊', - '𪎒' => '𪎒', - '廾' => '廾', - '𢌱' => '𢌱', - '𢌱' => '𢌱', - '舁' => '舁', - '弢' => '弢', - '弢' => '弢', - '㣇' => '㣇', - '𣊸' => '𣊸', - '𦇚' => '𦇚', - '形' => '形', - '彫' => '彫', - '㣣' => '㣣', - '徚' => '徚', - '忍' => '忍', - '志' => '志', - '忹' => '忹', - '悁' => '悁', - '㤺' => '㤺', - '㤜' => '㤜', - '悔' => '悔', - '𢛔' => '𢛔', - '惇' => '惇', - '慈' => '慈', - '慌' => '慌', - '慎' => '慎', - '慌' => '慌', - '慺' => '慺', - '憎' => '憎', - '憲' => '憲', - '憤' => '憤', - '憯' => '憯', - '懞' => '懞', - '懲' => '懲', - '懶' => '懶', - '成' => '成', - '戛' => '戛', - '扝' => '扝', - '抱' => '抱', - '拔' => '拔', - '捐' => '捐', - '𢬌' => '𢬌', - '挽' => '挽', - '拼' => '拼', - '捨' => '捨', - '掃' => '掃', - '揤' => '揤', - '𢯱' => '𢯱', - '搢' => '搢', - '揅' => '揅', - '掩' => '掩', - '㨮' => '㨮', - '摩' => '摩', - '摾' => '摾', - '撝' => '撝', - '摷' => '摷', - '㩬' => '㩬', - '敏' => '敏', - '敬' => '敬', - '𣀊' => '𣀊', - '旣' => '旣', - '書' => '書', - '晉' => '晉', - '㬙' => '㬙', - '暑' => '暑', - '㬈' => '㬈', - '㫤' => '㫤', - '冒' => '冒', - '冕' => '冕', - '最' => '最', - '暜' => '暜', - '肭' => '肭', - '䏙' => '䏙', - '朗' => '朗', - '望' => '望', - '朡' => '朡', - '杞' => '杞', - '杓' => '杓', - '𣏃' => '𣏃', - '㭉' => '㭉', - '柺' => '柺', - '枅' => '枅', - '桒' => '桒', - '梅' => '梅', - '𣑭' => '𣑭', - '梎' => '梎', - '栟' => '栟', - '椔' => '椔', - '㮝' => '㮝', - '楂' => '楂', - '榣' => '榣', - '槪' => '槪', - '檨' => '檨', - '𣚣' => '𣚣', - '櫛' => '櫛', - '㰘' => '㰘', - '次' => '次', - '𣢧' => '𣢧', - '歔' => '歔', - '㱎' => '㱎', - '歲' => '歲', - '殟' => '殟', - '殺' => '殺', - '殻' => '殻', - '𣪍' => '𣪍', - '𡴋' => '𡴋', - '𣫺' => '𣫺', - '汎' => '汎', - '𣲼' => '𣲼', - '沿' => '沿', - '泍' => '泍', - '汧' => '汧', - '洖' => '洖', - '派' => '派', - '海' => '海', - '流' => '流', - '浩' => '浩', - '浸' => '浸', - '涅' => '涅', - '𣴞' => '𣴞', - '洴' => '洴', - '港' => '港', - '湮' => '湮', - '㴳' => '㴳', - '滋' => '滋', - '滇' => '滇', - '𣻑' => '𣻑', - '淹' => '淹', - '潮' => '潮', - '𣽞' => '𣽞', - '𣾎' => '𣾎', - '濆' => '濆', - '瀹' => '瀹', - '瀞' => '瀞', - '瀛' => '瀛', - '㶖' => '㶖', - '灊' => '灊', - '災' => '災', - '灷' => '灷', - '炭' => '炭', - '𠔥' => '𠔥', - '煅' => '煅', - '𤉣' => '𤉣', - '熜' => '熜', - '𤎫' => '𤎫', - '爨' => '爨', - '爵' => '爵', - '牐' => '牐', - '𤘈' => '𤘈', - '犀' => '犀', - '犕' => '犕', - '𤜵' => '𤜵', - '𤠔' => '𤠔', - '獺' => '獺', - '王' => '王', - '㺬' => '㺬', - '玥' => '玥', - '㺸' => '㺸', - '㺸' => '㺸', - '瑇' => '瑇', - '瑜' => '瑜', - '瑱' => '瑱', - '璅' => '璅', - '瓊' => '瓊', - '㼛' => '㼛', - '甤' => '甤', - '𤰶' => '𤰶', - '甾' => '甾', - '𤲒' => '𤲒', - '異' => '異', - '𢆟' => '𢆟', - '瘐' => '瘐', - '𤾡' => '𤾡', - '𤾸' => '𤾸', - '𥁄' => '𥁄', - '㿼' => '㿼', - '䀈' => '䀈', - '直' => '直', - '𥃳' => '𥃳', - '𥃲' => '𥃲', - '𥄙' => '𥄙', - '𥄳' => '𥄳', - '眞' => '眞', - '真' => '真', - '真' => '真', - '睊' => '睊', - '䀹' => '䀹', - '瞋' => '瞋', - '䁆' => '䁆', - '䂖' => '䂖', - '𥐝' => '𥐝', - '硎' => '硎', - '碌' => '碌', - '磌' => '磌', - '䃣' => '䃣', - '𥘦' => '𥘦', - '祖' => '祖', - '𥚚' => '𥚚', - '𥛅' => '𥛅', - '福' => '福', - '秫' => '秫', - '䄯' => '䄯', - '穀' => '穀', - '穊' => '穊', - '穏' => '穏', - '𥥼' => '𥥼', - '𥪧' => '𥪧', - '𥪧' => '𥪧', - '竮' => '竮', - '䈂' => '䈂', - '𥮫' => '𥮫', - '篆' => '篆', - '築' => '築', - '䈧' => '䈧', - '𥲀' => '𥲀', - '糒' => '糒', - '䊠' => '䊠', - '糨' => '糨', - '糣' => '糣', - '紀' => '紀', - '𥾆' => '𥾆', - '絣' => '絣', - '䌁' => '䌁', - '緇' => '緇', - '縂' => '縂', - '繅' => '繅', - '䌴' => '䌴', - '𦈨' => '𦈨', - '𦉇' => '𦉇', - '䍙' => '䍙', - '𦋙' => '𦋙', - '罺' => '罺', - '𦌾' => '𦌾', - '羕' => '羕', - '翺' => '翺', - '者' => '者', - '𦓚' => '𦓚', - '𦔣' => '𦔣', - '聠' => '聠', - '𦖨' => '𦖨', - '聰' => '聰', - '𣍟' => '𣍟', - '䏕' => '䏕', - '育' => '育', - '脃' => '脃', - '䐋' => '䐋', - '脾' => '脾', - '媵' => '媵', - '𦞧' => '𦞧', - '𦞵' => '𦞵', - '𣎓' => '𣎓', - '𣎜' => '𣎜', - '舁' => '舁', - '舄' => '舄', - '辞' => '辞', - '䑫' => '䑫', - '芑' => '芑', - '芋' => '芋', - '芝' => '芝', - '劳' => '劳', - '花' => '花', - '芳' => '芳', - '芽' => '芽', - '苦' => '苦', - '𦬼' => '𦬼', - '若' => '若', - '茝' => '茝', - '荣' => '荣', - '莭' => '莭', - '茣' => '茣', - '莽' => '莽', - '菧' => '菧', - '著' => '著', - '荓' => '荓', - '菊' => '菊', - '菌' => '菌', - '菜' => '菜', - '𦰶' => '𦰶', - '𦵫' => '𦵫', - '𦳕' => '𦳕', - '䔫' => '䔫', - '蓱' => '蓱', - '蓳' => '蓳', - '蔖' => '蔖', - '𧏊' => '𧏊', - '蕤' => '蕤', - '𦼬' => '𦼬', - '䕝' => '䕝', - '䕡' => '䕡', - '𦾱' => '𦾱', - '𧃒' => '𧃒', - '䕫' => '䕫', - '虐' => '虐', - '虜' => '虜', - '虧' => '虧', - '虩' => '虩', - '蚩' => '蚩', - '蚈' => '蚈', - '蜎' => '蜎', - '蛢' => '蛢', - '蝹' => '蝹', - '蜨' => '蜨', - '蝫' => '蝫', - '螆' => '螆', - '䗗' => '䗗', - '蟡' => '蟡', - '蠁' => '蠁', - '䗹' => '䗹', - '衠' => '衠', - '衣' => '衣', - '𧙧' => '𧙧', - '裗' => '裗', - '裞' => '裞', - '䘵' => '䘵', - '裺' => '裺', - '㒻' => '㒻', - '𧢮' => '𧢮', - '𧥦' => '𧥦', - '䚾' => '䚾', - '䛇' => '䛇', - '誠' => '誠', - '諭' => '諭', - '變' => '變', - '豕' => '豕', - '𧲨' => '𧲨', - '貫' => '貫', - '賁' => '賁', - '贛' => '贛', - '起' => '起', - '𧼯' => '𧼯', - '𠠄' => '𠠄', - '跋' => '跋', - '趼' => '趼', - '跰' => '跰', - '𠣞' => '𠣞', - '軔' => '軔', - '輸' => '輸', - '𨗒' => '𨗒', - '𨗭' => '𨗭', - '邔' => '邔', - '郱' => '郱', - '鄑' => '鄑', - '𨜮' => '𨜮', - '鄛' => '鄛', - '鈸' => '鈸', - '鋗' => '鋗', - '鋘' => '鋘', - '鉼' => '鉼', - '鏹' => '鏹', - '鐕' => '鐕', - '𨯺' => '𨯺', - '開' => '開', - '䦕' => '䦕', - '閷' => '閷', - '𨵷' => '𨵷', - '䧦' => '䧦', - '雃' => '雃', - '嶲' => '嶲', - '霣' => '霣', - '𩅅' => '𩅅', - '𩈚' => '𩈚', - '䩮' => '䩮', - '䩶' => '䩶', - '韠' => '韠', - '𩐊' => '𩐊', - '䪲' => '䪲', - '𩒖' => '𩒖', - '頋' => '頋', - '頋' => '頋', - '頩' => '頩', - '𩖶' => '𩖶', - '飢' => '飢', - '䬳' => '䬳', - '餩' => '餩', - '馧' => '馧', - '駂' => '駂', - '駾' => '駾', - '䯎' => '䯎', - '𩬰' => '𩬰', - '鬒' => '鬒', - '鱀' => '鱀', - '鳽' => '鳽', - '䳎' => '䳎', - '䳭' => '䳭', - '鵧' => '鵧', - '𪃎' => '𪃎', - '䳸' => '䳸', - '𪄅' => '𪄅', - '𪈎' => '𪈎', - '𪊑' => '𪊑', - '麻' => '麻', - '䵖' => '䵖', - '黹' => '黹', - '黾' => '黾', - '鼅' => '鼅', - '鼏' => '鼏', - '鼖' => '鼖', - '鼻' => '鼻', - '𪘀' => '𪘀', -); diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php deleted file mode 100644 index ec90f36e..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php +++ /dev/null @@ -1,876 +0,0 @@ - 230, - '́' => 230, - '̂' => 230, - '̃' => 230, - '̄' => 230, - '̅' => 230, - '̆' => 230, - '̇' => 230, - '̈' => 230, - '̉' => 230, - '̊' => 230, - '̋' => 230, - '̌' => 230, - '̍' => 230, - '̎' => 230, - '̏' => 230, - '̐' => 230, - '̑' => 230, - '̒' => 230, - '̓' => 230, - '̔' => 230, - '̕' => 232, - '̖' => 220, - '̗' => 220, - '̘' => 220, - '̙' => 220, - '̚' => 232, - '̛' => 216, - '̜' => 220, - '̝' => 220, - '̞' => 220, - '̟' => 220, - '̠' => 220, - '̡' => 202, - '̢' => 202, - '̣' => 220, - '̤' => 220, - '̥' => 220, - '̦' => 220, - '̧' => 202, - '̨' => 202, - '̩' => 220, - '̪' => 220, - '̫' => 220, - '̬' => 220, - '̭' => 220, - '̮' => 220, - '̯' => 220, - '̰' => 220, - '̱' => 220, - '̲' => 220, - '̳' => 220, - '̴' => 1, - '̵' => 1, - '̶' => 1, - '̷' => 1, - '̸' => 1, - '̹' => 220, - '̺' => 220, - '̻' => 220, - '̼' => 220, - '̽' => 230, - '̾' => 230, - '̿' => 230, - '̀' => 230, - '́' => 230, - '͂' => 230, - '̓' => 230, - '̈́' => 230, - 'ͅ' => 240, - '͆' => 230, - '͇' => 220, - '͈' => 220, - '͉' => 220, - '͊' => 230, - '͋' => 230, - '͌' => 230, - '͍' => 220, - '͎' => 220, - '͐' => 230, - '͑' => 230, - '͒' => 230, - '͓' => 220, - '͔' => 220, - '͕' => 220, - '͖' => 220, - '͗' => 230, - '͘' => 232, - '͙' => 220, - '͚' => 220, - '͛' => 230, - '͜' => 233, - '͝' => 234, - '͞' => 234, - '͟' => 233, - '͠' => 234, - '͡' => 234, - '͢' => 233, - 'ͣ' => 230, - 'ͤ' => 230, - 'ͥ' => 230, - 'ͦ' => 230, - 'ͧ' => 230, - 'ͨ' => 230, - 'ͩ' => 230, - 'ͪ' => 230, - 'ͫ' => 230, - 'ͬ' => 230, - 'ͭ' => 230, - 'ͮ' => 230, - 'ͯ' => 230, - '҃' => 230, - '҄' => 230, - '҅' => 230, - '҆' => 230, - '҇' => 230, - '֑' => 220, - '֒' => 230, - '֓' => 230, - '֔' => 230, - '֕' => 230, - '֖' => 220, - '֗' => 230, - '֘' => 230, - '֙' => 230, - '֚' => 222, - '֛' => 220, - '֜' => 230, - '֝' => 230, - '֞' => 230, - '֟' => 230, - '֠' => 230, - '֡' => 230, - '֢' => 220, - '֣' => 220, - '֤' => 220, - '֥' => 220, - '֦' => 220, - '֧' => 220, - '֨' => 230, - '֩' => 230, - '֪' => 220, - '֫' => 230, - '֬' => 230, - '֭' => 222, - '֮' => 228, - '֯' => 230, - 'ְ' => 10, - 'ֱ' => 11, - 'ֲ' => 12, - 'ֳ' => 13, - 'ִ' => 14, - 'ֵ' => 15, - 'ֶ' => 16, - 'ַ' => 17, - 'ָ' => 18, - 'ֹ' => 19, - 'ֺ' => 19, - 'ֻ' => 20, - 'ּ' => 21, - 'ֽ' => 22, - 'ֿ' => 23, - 'ׁ' => 24, - 'ׂ' => 25, - 'ׄ' => 230, - 'ׅ' => 220, - 'ׇ' => 18, - 'ؐ' => 230, - 'ؑ' => 230, - 'ؒ' => 230, - 'ؓ' => 230, - 'ؔ' => 230, - 'ؕ' => 230, - 'ؖ' => 230, - 'ؗ' => 230, - 'ؘ' => 30, - 'ؙ' => 31, - 'ؚ' => 32, - 'ً' => 27, - 'ٌ' => 28, - 'ٍ' => 29, - 'َ' => 30, - 'ُ' => 31, - 'ِ' => 32, - 'ّ' => 33, - 'ْ' => 34, - 'ٓ' => 230, - 'ٔ' => 230, - 'ٕ' => 220, - 'ٖ' => 220, - 'ٗ' => 230, - '٘' => 230, - 'ٙ' => 230, - 'ٚ' => 230, - 'ٛ' => 230, - 'ٜ' => 220, - 'ٝ' => 230, - 'ٞ' => 230, - 'ٟ' => 220, - 'ٰ' => 35, - 'ۖ' => 230, - 'ۗ' => 230, - 'ۘ' => 230, - 'ۙ' => 230, - 'ۚ' => 230, - 'ۛ' => 230, - 'ۜ' => 230, - '۟' => 230, - '۠' => 230, - 'ۡ' => 230, - 'ۢ' => 230, - 'ۣ' => 220, - 'ۤ' => 230, - 'ۧ' => 230, - 'ۨ' => 230, - '۪' => 220, - '۫' => 230, - '۬' => 230, - 'ۭ' => 220, - 'ܑ' => 36, - 'ܰ' => 230, - 'ܱ' => 220, - 'ܲ' => 230, - 'ܳ' => 230, - 'ܴ' => 220, - 'ܵ' => 230, - 'ܶ' => 230, - 'ܷ' => 220, - 'ܸ' => 220, - 'ܹ' => 220, - 'ܺ' => 230, - 'ܻ' => 220, - 'ܼ' => 220, - 'ܽ' => 230, - 'ܾ' => 220, - 'ܿ' => 230, - '݀' => 230, - '݁' => 230, - '݂' => 220, - '݃' => 230, - '݄' => 220, - '݅' => 230, - '݆' => 220, - '݇' => 230, - '݈' => 220, - '݉' => 230, - '݊' => 230, - '߫' => 230, - '߬' => 230, - '߭' => 230, - '߮' => 230, - '߯' => 230, - '߰' => 230, - '߱' => 230, - '߲' => 220, - '߳' => 230, - '߽' => 220, - 'ࠖ' => 230, - 'ࠗ' => 230, - '࠘' => 230, - '࠙' => 230, - 'ࠛ' => 230, - 'ࠜ' => 230, - 'ࠝ' => 230, - 'ࠞ' => 230, - 'ࠟ' => 230, - 'ࠠ' => 230, - 'ࠡ' => 230, - 'ࠢ' => 230, - 'ࠣ' => 230, - 'ࠥ' => 230, - 'ࠦ' => 230, - 'ࠧ' => 230, - 'ࠩ' => 230, - 'ࠪ' => 230, - 'ࠫ' => 230, - 'ࠬ' => 230, - '࠭' => 230, - '࡙' => 220, - '࡚' => 220, - '࡛' => 220, - '࣓' => 220, - 'ࣔ' => 230, - 'ࣕ' => 230, - 'ࣖ' => 230, - 'ࣗ' => 230, - 'ࣘ' => 230, - 'ࣙ' => 230, - 'ࣚ' => 230, - 'ࣛ' => 230, - 'ࣜ' => 230, - 'ࣝ' => 230, - 'ࣞ' => 230, - 'ࣟ' => 230, - '࣠' => 230, - '࣡' => 230, - 'ࣣ' => 220, - 'ࣤ' => 230, - 'ࣥ' => 230, - 'ࣦ' => 220, - 'ࣧ' => 230, - 'ࣨ' => 230, - 'ࣩ' => 220, - '࣪' => 230, - '࣫' => 230, - '࣬' => 230, - '࣭' => 220, - '࣮' => 220, - '࣯' => 220, - 'ࣰ' => 27, - 'ࣱ' => 28, - 'ࣲ' => 29, - 'ࣳ' => 230, - 'ࣴ' => 230, - 'ࣵ' => 230, - 'ࣶ' => 220, - 'ࣷ' => 230, - 'ࣸ' => 230, - 'ࣹ' => 220, - 'ࣺ' => 220, - 'ࣻ' => 230, - 'ࣼ' => 230, - 'ࣽ' => 230, - 'ࣾ' => 230, - 'ࣿ' => 230, - '़' => 7, - '्' => 9, - '॑' => 230, - '॒' => 220, - '॓' => 230, - '॔' => 230, - '়' => 7, - '্' => 9, - '৾' => 230, - '਼' => 7, - '੍' => 9, - '઼' => 7, - '્' => 9, - '଼' => 7, - '୍' => 9, - '்' => 9, - '్' => 9, - 'ౕ' => 84, - 'ౖ' => 91, - '಼' => 7, - '್' => 9, - '഻' => 9, - '഼' => 9, - '്' => 9, - '්' => 9, - 'ุ' => 103, - 'ู' => 103, - 'ฺ' => 9, - '่' => 107, - '้' => 107, - '๊' => 107, - '๋' => 107, - 'ຸ' => 118, - 'ູ' => 118, - '຺' => 9, - '່' => 122, - '້' => 122, - '໊' => 122, - '໋' => 122, - '༘' => 220, - '༙' => 220, - '༵' => 220, - '༷' => 220, - '༹' => 216, - 'ཱ' => 129, - 'ི' => 130, - 'ུ' => 132, - 'ེ' => 130, - 'ཻ' => 130, - 'ོ' => 130, - 'ཽ' => 130, - 'ྀ' => 130, - 'ྂ' => 230, - 'ྃ' => 230, - '྄' => 9, - '྆' => 230, - '྇' => 230, - '࿆' => 220, - '့' => 7, - '္' => 9, - '်' => 9, - 'ႍ' => 220, - '፝' => 230, - '፞' => 230, - '፟' => 230, - '᜔' => 9, - '᜴' => 9, - '្' => 9, - '៝' => 230, - 'ᢩ' => 228, - '᤹' => 222, - '᤺' => 230, - '᤻' => 220, - 'ᨗ' => 230, - 'ᨘ' => 220, - '᩠' => 9, - '᩵' => 230, - '᩶' => 230, - '᩷' => 230, - '᩸' => 230, - '᩹' => 230, - '᩺' => 230, - '᩻' => 230, - '᩼' => 230, - '᩿' => 220, - '᪰' => 230, - '᪱' => 230, - '᪲' => 230, - '᪳' => 230, - '᪴' => 230, - '᪵' => 220, - '᪶' => 220, - '᪷' => 220, - '᪸' => 220, - '᪹' => 220, - '᪺' => 220, - '᪻' => 230, - '᪼' => 230, - '᪽' => 220, - 'ᪿ' => 220, - 'ᫀ' => 220, - '᬴' => 7, - '᭄' => 9, - '᭫' => 230, - '᭬' => 220, - '᭭' => 230, - '᭮' => 230, - '᭯' => 230, - '᭰' => 230, - '᭱' => 230, - '᭲' => 230, - '᭳' => 230, - '᮪' => 9, - '᮫' => 9, - '᯦' => 7, - '᯲' => 9, - '᯳' => 9, - '᰷' => 7, - '᳐' => 230, - '᳑' => 230, - '᳒' => 230, - '᳔' => 1, - '᳕' => 220, - '᳖' => 220, - '᳗' => 220, - '᳘' => 220, - '᳙' => 220, - '᳚' => 230, - '᳛' => 230, - '᳜' => 220, - '᳝' => 220, - '᳞' => 220, - '᳟' => 220, - '᳠' => 230, - '᳢' => 1, - '᳣' => 1, - '᳤' => 1, - '᳥' => 1, - '᳦' => 1, - '᳧' => 1, - '᳨' => 1, - '᳭' => 220, - '᳴' => 230, - '᳸' => 230, - '᳹' => 230, - '᷀' => 230, - '᷁' => 230, - '᷂' => 220, - '᷃' => 230, - '᷄' => 230, - '᷅' => 230, - '᷆' => 230, - '᷇' => 230, - '᷈' => 230, - '᷉' => 230, - '᷊' => 220, - '᷋' => 230, - '᷌' => 230, - '᷍' => 234, - '᷎' => 214, - '᷏' => 220, - '᷐' => 202, - '᷑' => 230, - '᷒' => 230, - 'ᷓ' => 230, - 'ᷔ' => 230, - 'ᷕ' => 230, - 'ᷖ' => 230, - 'ᷗ' => 230, - 'ᷘ' => 230, - 'ᷙ' => 230, - 'ᷚ' => 230, - 'ᷛ' => 230, - 'ᷜ' => 230, - 'ᷝ' => 230, - 'ᷞ' => 230, - 'ᷟ' => 230, - 'ᷠ' => 230, - 'ᷡ' => 230, - 'ᷢ' => 230, - 'ᷣ' => 230, - 'ᷤ' => 230, - 'ᷥ' => 230, - 'ᷦ' => 230, - 'ᷧ' => 230, - 'ᷨ' => 230, - 'ᷩ' => 230, - 'ᷪ' => 230, - 'ᷫ' => 230, - 'ᷬ' => 230, - 'ᷭ' => 230, - 'ᷮ' => 230, - 'ᷯ' => 230, - 'ᷰ' => 230, - 'ᷱ' => 230, - 'ᷲ' => 230, - 'ᷳ' => 230, - 'ᷴ' => 230, - '᷵' => 230, - '᷶' => 232, - '᷷' => 228, - '᷸' => 228, - '᷹' => 220, - '᷻' => 230, - '᷼' => 233, - '᷽' => 220, - '᷾' => 230, - '᷿' => 220, - '⃐' => 230, - '⃑' => 230, - '⃒' => 1, - '⃓' => 1, - '⃔' => 230, - '⃕' => 230, - '⃖' => 230, - '⃗' => 230, - '⃘' => 1, - '⃙' => 1, - '⃚' => 1, - '⃛' => 230, - '⃜' => 230, - '⃡' => 230, - '⃥' => 1, - '⃦' => 1, - '⃧' => 230, - '⃨' => 220, - '⃩' => 230, - '⃪' => 1, - '⃫' => 1, - '⃬' => 220, - '⃭' => 220, - '⃮' => 220, - '⃯' => 220, - '⃰' => 230, - '⳯' => 230, - '⳰' => 230, - '⳱' => 230, - '⵿' => 9, - 'ⷠ' => 230, - 'ⷡ' => 230, - 'ⷢ' => 230, - 'ⷣ' => 230, - 'ⷤ' => 230, - 'ⷥ' => 230, - 'ⷦ' => 230, - 'ⷧ' => 230, - 'ⷨ' => 230, - 'ⷩ' => 230, - 'ⷪ' => 230, - 'ⷫ' => 230, - 'ⷬ' => 230, - 'ⷭ' => 230, - 'ⷮ' => 230, - 'ⷯ' => 230, - 'ⷰ' => 230, - 'ⷱ' => 230, - 'ⷲ' => 230, - 'ⷳ' => 230, - 'ⷴ' => 230, - 'ⷵ' => 230, - 'ⷶ' => 230, - 'ⷷ' => 230, - 'ⷸ' => 230, - 'ⷹ' => 230, - 'ⷺ' => 230, - 'ⷻ' => 230, - 'ⷼ' => 230, - 'ⷽ' => 230, - 'ⷾ' => 230, - 'ⷿ' => 230, - '〪' => 218, - '〫' => 228, - '〬' => 232, - '〭' => 222, - '〮' => 224, - '〯' => 224, - '゙' => 8, - '゚' => 8, - '꙯' => 230, - 'ꙴ' => 230, - 'ꙵ' => 230, - 'ꙶ' => 230, - 'ꙷ' => 230, - 'ꙸ' => 230, - 'ꙹ' => 230, - 'ꙺ' => 230, - 'ꙻ' => 230, - '꙼' => 230, - '꙽' => 230, - 'ꚞ' => 230, - 'ꚟ' => 230, - '꛰' => 230, - '꛱' => 230, - '꠆' => 9, - '꠬' => 9, - '꣄' => 9, - '꣠' => 230, - '꣡' => 230, - '꣢' => 230, - '꣣' => 230, - '꣤' => 230, - '꣥' => 230, - '꣦' => 230, - '꣧' => 230, - '꣨' => 230, - '꣩' => 230, - '꣪' => 230, - '꣫' => 230, - '꣬' => 230, - '꣭' => 230, - '꣮' => 230, - '꣯' => 230, - '꣰' => 230, - '꣱' => 230, - '꤫' => 220, - '꤬' => 220, - '꤭' => 220, - '꥓' => 9, - '꦳' => 7, - '꧀' => 9, - 'ꪰ' => 230, - 'ꪲ' => 230, - 'ꪳ' => 230, - 'ꪴ' => 220, - 'ꪷ' => 230, - 'ꪸ' => 230, - 'ꪾ' => 230, - '꪿' => 230, - '꫁' => 230, - '꫶' => 9, - '꯭' => 9, - 'ﬞ' => 26, - '︠' => 230, - '︡' => 230, - '︢' => 230, - '︣' => 230, - '︤' => 230, - '︥' => 230, - '︦' => 230, - '︧' => 220, - '︨' => 220, - '︩' => 220, - '︪' => 220, - '︫' => 220, - '︬' => 220, - '︭' => 220, - '︮' => 230, - '︯' => 230, - '𐇽' => 220, - '𐋠' => 220, - '𐍶' => 230, - '𐍷' => 230, - '𐍸' => 230, - '𐍹' => 230, - '𐍺' => 230, - '𐨍' => 220, - '𐨏' => 230, - '𐨸' => 230, - '𐨹' => 1, - '𐨺' => 220, - '𐨿' => 9, - '𐫥' => 230, - '𐫦' => 220, - '𐴤' => 230, - '𐴥' => 230, - '𐴦' => 230, - '𐴧' => 230, - '𐺫' => 230, - '𐺬' => 230, - '𐽆' => 220, - '𐽇' => 220, - '𐽈' => 230, - '𐽉' => 230, - '𐽊' => 230, - '𐽋' => 220, - '𐽌' => 230, - '𐽍' => 220, - '𐽎' => 220, - '𐽏' => 220, - '𐽐' => 220, - '𑁆' => 9, - '𑁿' => 9, - '𑂹' => 9, - '𑂺' => 7, - '𑄀' => 230, - '𑄁' => 230, - '𑄂' => 230, - '𑄳' => 9, - '𑄴' => 9, - '𑅳' => 7, - '𑇀' => 9, - '𑇊' => 7, - '𑈵' => 9, - '𑈶' => 7, - '𑋩' => 7, - '𑋪' => 9, - '𑌻' => 7, - '𑌼' => 7, - '𑍍' => 9, - '𑍦' => 230, - '𑍧' => 230, - '𑍨' => 230, - '𑍩' => 230, - '𑍪' => 230, - '𑍫' => 230, - '𑍬' => 230, - '𑍰' => 230, - '𑍱' => 230, - '𑍲' => 230, - '𑍳' => 230, - '𑍴' => 230, - '𑑂' => 9, - '𑑆' => 7, - '𑑞' => 230, - '𑓂' => 9, - '𑓃' => 7, - '𑖿' => 9, - '𑗀' => 7, - '𑘿' => 9, - '𑚶' => 9, - '𑚷' => 7, - '𑜫' => 9, - '𑠹' => 9, - '𑠺' => 7, - '𑤽' => 9, - '𑤾' => 9, - '𑥃' => 7, - '𑧠' => 9, - '𑨴' => 9, - '𑩇' => 9, - '𑪙' => 9, - '𑰿' => 9, - '𑵂' => 7, - '𑵄' => 9, - '𑵅' => 9, - '𑶗' => 9, - '𖫰' => 1, - '𖫱' => 1, - '𖫲' => 1, - '𖫳' => 1, - '𖫴' => 1, - '𖬰' => 230, - '𖬱' => 230, - '𖬲' => 230, - '𖬳' => 230, - '𖬴' => 230, - '𖬵' => 230, - '𖬶' => 230, - '𖿰' => 6, - '𖿱' => 6, - '𛲞' => 1, - '𝅥' => 216, - '𝅦' => 216, - '𝅧' => 1, - '𝅨' => 1, - '𝅩' => 1, - '𝅭' => 226, - '𝅮' => 216, - '𝅯' => 216, - '𝅰' => 216, - '𝅱' => 216, - '𝅲' => 216, - '𝅻' => 220, - '𝅼' => 220, - '𝅽' => 220, - '𝅾' => 220, - '𝅿' => 220, - '𝆀' => 220, - '𝆁' => 220, - '𝆂' => 220, - '𝆅' => 230, - '𝆆' => 230, - '𝆇' => 230, - '𝆈' => 230, - '𝆉' => 230, - '𝆊' => 220, - '𝆋' => 220, - '𝆪' => 230, - '𝆫' => 230, - '𝆬' => 230, - '𝆭' => 230, - '𝉂' => 230, - '𝉃' => 230, - '𝉄' => 230, - '𞀀' => 230, - '𞀁' => 230, - '𞀂' => 230, - '𞀃' => 230, - '𞀄' => 230, - '𞀅' => 230, - '𞀆' => 230, - '𞀈' => 230, - '𞀉' => 230, - '𞀊' => 230, - '𞀋' => 230, - '𞀌' => 230, - '𞀍' => 230, - '𞀎' => 230, - '𞀏' => 230, - '𞀐' => 230, - '𞀑' => 230, - '𞀒' => 230, - '𞀓' => 230, - '𞀔' => 230, - '𞀕' => 230, - '𞀖' => 230, - '𞀗' => 230, - '𞀘' => 230, - '𞀛' => 230, - '𞀜' => 230, - '𞀝' => 230, - '𞀞' => 230, - '𞀟' => 230, - '𞀠' => 230, - '𞀡' => 230, - '𞀣' => 230, - '𞀤' => 230, - '𞀦' => 230, - '𞀧' => 230, - '𞀨' => 230, - '𞀩' => 230, - '𞀪' => 230, - '𞄰' => 230, - '𞄱' => 230, - '𞄲' => 230, - '𞄳' => 230, - '𞄴' => 230, - '𞄵' => 230, - '𞄶' => 230, - '𞋬' => 230, - '𞋭' => 230, - '𞋮' => 230, - '𞋯' => 230, - '𞣐' => 220, - '𞣑' => 220, - '𞣒' => 220, - '𞣓' => 220, - '𞣔' => 220, - '𞣕' => 220, - '𞣖' => 220, - '𞥄' => 230, - '𞥅' => 230, - '𞥆' => 230, - '𞥇' => 230, - '𞥈' => 230, - '𞥉' => 230, - '𞥊' => 7, -); diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php deleted file mode 100644 index 15749028..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php +++ /dev/null @@ -1,3695 +0,0 @@ - ' ', - '¨' => ' ̈', - 'ª' => 'a', - '¯' => ' ̄', - '²' => '2', - '³' => '3', - '´' => ' ́', - 'µ' => 'μ', - '¸' => ' ̧', - '¹' => '1', - 'º' => 'o', - '¼' => '1⁄4', - '½' => '1⁄2', - '¾' => '3⁄4', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ŀ' => 'L·', - 'ŀ' => 'l·', - 'ʼn' => 'ʼn', - 'ſ' => 's', - 'DŽ' => 'DŽ', - 'Dž' => 'Dž', - 'dž' => 'dž', - 'LJ' => 'LJ', - 'Lj' => 'Lj', - 'lj' => 'lj', - 'NJ' => 'NJ', - 'Nj' => 'Nj', - 'nj' => 'nj', - 'DZ' => 'DZ', - 'Dz' => 'Dz', - 'dz' => 'dz', - 'ʰ' => 'h', - 'ʱ' => 'ɦ', - 'ʲ' => 'j', - 'ʳ' => 'r', - 'ʴ' => 'ɹ', - 'ʵ' => 'ɻ', - 'ʶ' => 'ʁ', - 'ʷ' => 'w', - 'ʸ' => 'y', - '˘' => ' ̆', - '˙' => ' ̇', - '˚' => ' ̊', - '˛' => ' ̨', - '˜' => ' ̃', - '˝' => ' ̋', - 'ˠ' => 'ɣ', - 'ˡ' => 'l', - 'ˢ' => 's', - 'ˣ' => 'x', - 'ˤ' => 'ʕ', - 'ͺ' => ' ͅ', - '΄' => ' ́', - '΅' => ' ̈́', - 'ϐ' => 'β', - 'ϑ' => 'θ', - 'ϒ' => 'Υ', - 'ϓ' => 'Ύ', - 'ϔ' => 'Ϋ', - 'ϕ' => 'φ', - 'ϖ' => 'π', - 'ϰ' => 'κ', - 'ϱ' => 'ρ', - 'ϲ' => 'ς', - 'ϴ' => 'Θ', - 'ϵ' => 'ε', - 'Ϲ' => 'Σ', - 'և' => 'եւ', - 'ٵ' => 'اٴ', - 'ٶ' => 'وٴ', - 'ٷ' => 'ۇٴ', - 'ٸ' => 'يٴ', - 'ำ' => 'ํา', - 'ຳ' => 'ໍາ', - 'ໜ' => 'ຫນ', - 'ໝ' => 'ຫມ', - '༌' => '་', - 'ཷ' => 'ྲཱྀ', - 'ཹ' => 'ླཱྀ', - 'ჼ' => 'ნ', - 'ᴬ' => 'A', - 'ᴭ' => 'Æ', - 'ᴮ' => 'B', - 'ᴰ' => 'D', - 'ᴱ' => 'E', - 'ᴲ' => 'Ǝ', - 'ᴳ' => 'G', - 'ᴴ' => 'H', - 'ᴵ' => 'I', - 'ᴶ' => 'J', - 'ᴷ' => 'K', - 'ᴸ' => 'L', - 'ᴹ' => 'M', - 'ᴺ' => 'N', - 'ᴼ' => 'O', - 'ᴽ' => 'Ȣ', - 'ᴾ' => 'P', - 'ᴿ' => 'R', - 'ᵀ' => 'T', - 'ᵁ' => 'U', - 'ᵂ' => 'W', - 'ᵃ' => 'a', - 'ᵄ' => 'ɐ', - 'ᵅ' => 'ɑ', - 'ᵆ' => 'ᴂ', - 'ᵇ' => 'b', - 'ᵈ' => 'd', - 'ᵉ' => 'e', - 'ᵊ' => 'ə', - 'ᵋ' => 'ɛ', - 'ᵌ' => 'ɜ', - 'ᵍ' => 'g', - 'ᵏ' => 'k', - 'ᵐ' => 'm', - 'ᵑ' => 'ŋ', - 'ᵒ' => 'o', - 'ᵓ' => 'ɔ', - 'ᵔ' => 'ᴖ', - 'ᵕ' => 'ᴗ', - 'ᵖ' => 'p', - 'ᵗ' => 't', - 'ᵘ' => 'u', - 'ᵙ' => 'ᴝ', - 'ᵚ' => 'ɯ', - 'ᵛ' => 'v', - 'ᵜ' => 'ᴥ', - 'ᵝ' => 'β', - 'ᵞ' => 'γ', - 'ᵟ' => 'δ', - 'ᵠ' => 'φ', - 'ᵡ' => 'χ', - 'ᵢ' => 'i', - 'ᵣ' => 'r', - 'ᵤ' => 'u', - 'ᵥ' => 'v', - 'ᵦ' => 'β', - 'ᵧ' => 'γ', - 'ᵨ' => 'ρ', - 'ᵩ' => 'φ', - 'ᵪ' => 'χ', - 'ᵸ' => 'н', - 'ᶛ' => 'ɒ', - 'ᶜ' => 'c', - 'ᶝ' => 'ɕ', - 'ᶞ' => 'ð', - 'ᶟ' => 'ɜ', - 'ᶠ' => 'f', - 'ᶡ' => 'ɟ', - 'ᶢ' => 'ɡ', - 'ᶣ' => 'ɥ', - 'ᶤ' => 'ɨ', - 'ᶥ' => 'ɩ', - 'ᶦ' => 'ɪ', - 'ᶧ' => 'ᵻ', - 'ᶨ' => 'ʝ', - 'ᶩ' => 'ɭ', - 'ᶪ' => 'ᶅ', - 'ᶫ' => 'ʟ', - 'ᶬ' => 'ɱ', - 'ᶭ' => 'ɰ', - 'ᶮ' => 'ɲ', - 'ᶯ' => 'ɳ', - 'ᶰ' => 'ɴ', - 'ᶱ' => 'ɵ', - 'ᶲ' => 'ɸ', - 'ᶳ' => 'ʂ', - 'ᶴ' => 'ʃ', - 'ᶵ' => 'ƫ', - 'ᶶ' => 'ʉ', - 'ᶷ' => 'ʊ', - 'ᶸ' => 'ᴜ', - 'ᶹ' => 'ʋ', - 'ᶺ' => 'ʌ', - 'ᶻ' => 'z', - 'ᶼ' => 'ʐ', - 'ᶽ' => 'ʑ', - 'ᶾ' => 'ʒ', - 'ᶿ' => 'θ', - 'ẚ' => 'aʾ', - 'ẛ' => 'ṡ', - '᾽' => ' ̓', - '᾿' => ' ̓', - '῀' => ' ͂', - '῁' => ' ̈͂', - '῍' => ' ̓̀', - '῎' => ' ̓́', - '῏' => ' ̓͂', - '῝' => ' ̔̀', - '῞' => ' ̔́', - '῟' => ' ̔͂', - '῭' => ' ̈̀', - '΅' => ' ̈́', - '´' => ' ́', - '῾' => ' ̔', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - '‑' => '‐', - '‗' => ' ̳', - '․' => '.', - '‥' => '..', - '…' => '...', - ' ' => ' ', - '″' => '′′', - '‴' => '′′′', - '‶' => '‵‵', - '‷' => '‵‵‵', - '‼' => '!!', - '‾' => ' ̅', - '⁇' => '??', - '⁈' => '?!', - '⁉' => '!?', - '⁗' => '′′′′', - ' ' => ' ', - '⁰' => '0', - 'ⁱ' => 'i', - '⁴' => '4', - '⁵' => '5', - '⁶' => '6', - '⁷' => '7', - '⁸' => '8', - '⁹' => '9', - '⁺' => '+', - '⁻' => '−', - '⁼' => '=', - '⁽' => '(', - '⁾' => ')', - 'ⁿ' => 'n', - '₀' => '0', - '₁' => '1', - '₂' => '2', - '₃' => '3', - '₄' => '4', - '₅' => '5', - '₆' => '6', - '₇' => '7', - '₈' => '8', - '₉' => '9', - '₊' => '+', - '₋' => '−', - '₌' => '=', - '₍' => '(', - '₎' => ')', - 'ₐ' => 'a', - 'ₑ' => 'e', - 'ₒ' => 'o', - 'ₓ' => 'x', - 'ₔ' => 'ə', - 'ₕ' => 'h', - 'ₖ' => 'k', - 'ₗ' => 'l', - 'ₘ' => 'm', - 'ₙ' => 'n', - 'ₚ' => 'p', - 'ₛ' => 's', - 'ₜ' => 't', - '₨' => 'Rs', - '℀' => 'a/c', - '℁' => 'a/s', - 'ℂ' => 'C', - '℃' => '°C', - '℅' => 'c/o', - '℆' => 'c/u', - 'ℇ' => 'Ɛ', - '℉' => '°F', - 'ℊ' => 'g', - 'ℋ' => 'H', - 'ℌ' => 'H', - 'ℍ' => 'H', - 'ℎ' => 'h', - 'ℏ' => 'ħ', - 'ℐ' => 'I', - 'ℑ' => 'I', - 'ℒ' => 'L', - 'ℓ' => 'l', - 'ℕ' => 'N', - '№' => 'No', - 'ℙ' => 'P', - 'ℚ' => 'Q', - 'ℛ' => 'R', - 'ℜ' => 'R', - 'ℝ' => 'R', - '℠' => 'SM', - '℡' => 'TEL', - '™' => 'TM', - 'ℤ' => 'Z', - 'ℨ' => 'Z', - 'ℬ' => 'B', - 'ℭ' => 'C', - 'ℯ' => 'e', - 'ℰ' => 'E', - 'ℱ' => 'F', - 'ℳ' => 'M', - 'ℴ' => 'o', - 'ℵ' => 'א', - 'ℶ' => 'ב', - 'ℷ' => 'ג', - 'ℸ' => 'ד', - 'ℹ' => 'i', - '℻' => 'FAX', - 'ℼ' => 'π', - 'ℽ' => 'γ', - 'ℾ' => 'Γ', - 'ℿ' => 'Π', - '⅀' => '∑', - 'ⅅ' => 'D', - 'ⅆ' => 'd', - 'ⅇ' => 'e', - 'ⅈ' => 'i', - 'ⅉ' => 'j', - '⅐' => '1⁄7', - '⅑' => '1⁄9', - '⅒' => '1⁄10', - '⅓' => '1⁄3', - '⅔' => '2⁄3', - '⅕' => '1⁄5', - '⅖' => '2⁄5', - '⅗' => '3⁄5', - '⅘' => '4⁄5', - '⅙' => '1⁄6', - '⅚' => '5⁄6', - '⅛' => '1⁄8', - '⅜' => '3⁄8', - '⅝' => '5⁄8', - '⅞' => '7⁄8', - '⅟' => '1⁄', - 'Ⅰ' => 'I', - 'Ⅱ' => 'II', - 'Ⅲ' => 'III', - 'Ⅳ' => 'IV', - 'Ⅴ' => 'V', - 'Ⅵ' => 'VI', - 'Ⅶ' => 'VII', - 'Ⅷ' => 'VIII', - 'Ⅸ' => 'IX', - 'Ⅹ' => 'X', - 'Ⅺ' => 'XI', - 'Ⅻ' => 'XII', - 'Ⅼ' => 'L', - 'Ⅽ' => 'C', - 'Ⅾ' => 'D', - 'Ⅿ' => 'M', - 'ⅰ' => 'i', - 'ⅱ' => 'ii', - 'ⅲ' => 'iii', - 'ⅳ' => 'iv', - 'ⅴ' => 'v', - 'ⅵ' => 'vi', - 'ⅶ' => 'vii', - 'ⅷ' => 'viii', - 'ⅸ' => 'ix', - 'ⅹ' => 'x', - 'ⅺ' => 'xi', - 'ⅻ' => 'xii', - 'ⅼ' => 'l', - 'ⅽ' => 'c', - 'ⅾ' => 'd', - 'ⅿ' => 'm', - '↉' => '0⁄3', - '∬' => '∫∫', - '∭' => '∫∫∫', - '∯' => '∮∮', - '∰' => '∮∮∮', - '①' => '1', - '②' => '2', - '③' => '3', - '④' => '4', - '⑤' => '5', - '⑥' => '6', - '⑦' => '7', - '⑧' => '8', - '⑨' => '9', - '⑩' => '10', - '⑪' => '11', - '⑫' => '12', - '⑬' => '13', - '⑭' => '14', - '⑮' => '15', - '⑯' => '16', - '⑰' => '17', - '⑱' => '18', - '⑲' => '19', - '⑳' => '20', - '⑴' => '(1)', - '⑵' => '(2)', - '⑶' => '(3)', - '⑷' => '(4)', - '⑸' => '(5)', - '⑹' => '(6)', - '⑺' => '(7)', - '⑻' => '(8)', - '⑼' => '(9)', - '⑽' => '(10)', - '⑾' => '(11)', - '⑿' => '(12)', - '⒀' => '(13)', - '⒁' => '(14)', - '⒂' => '(15)', - '⒃' => '(16)', - '⒄' => '(17)', - '⒅' => '(18)', - '⒆' => '(19)', - '⒇' => '(20)', - '⒈' => '1.', - '⒉' => '2.', - '⒊' => '3.', - '⒋' => '4.', - '⒌' => '5.', - '⒍' => '6.', - '⒎' => '7.', - '⒏' => '8.', - '⒐' => '9.', - '⒑' => '10.', - '⒒' => '11.', - '⒓' => '12.', - '⒔' => '13.', - '⒕' => '14.', - '⒖' => '15.', - '⒗' => '16.', - '⒘' => '17.', - '⒙' => '18.', - '⒚' => '19.', - '⒛' => '20.', - '⒜' => '(a)', - '⒝' => '(b)', - '⒞' => '(c)', - '⒟' => '(d)', - '⒠' => '(e)', - '⒡' => '(f)', - '⒢' => '(g)', - '⒣' => '(h)', - '⒤' => '(i)', - '⒥' => '(j)', - '⒦' => '(k)', - '⒧' => '(l)', - '⒨' => '(m)', - '⒩' => '(n)', - '⒪' => '(o)', - '⒫' => '(p)', - '⒬' => '(q)', - '⒭' => '(r)', - '⒮' => '(s)', - '⒯' => '(t)', - '⒰' => '(u)', - '⒱' => '(v)', - '⒲' => '(w)', - '⒳' => '(x)', - '⒴' => '(y)', - '⒵' => '(z)', - 'Ⓐ' => 'A', - 'Ⓑ' => 'B', - 'Ⓒ' => 'C', - 'Ⓓ' => 'D', - 'Ⓔ' => 'E', - 'Ⓕ' => 'F', - 'Ⓖ' => 'G', - 'Ⓗ' => 'H', - 'Ⓘ' => 'I', - 'Ⓙ' => 'J', - 'Ⓚ' => 'K', - 'Ⓛ' => 'L', - 'Ⓜ' => 'M', - 'Ⓝ' => 'N', - 'Ⓞ' => 'O', - 'Ⓟ' => 'P', - 'Ⓠ' => 'Q', - 'Ⓡ' => 'R', - 'Ⓢ' => 'S', - 'Ⓣ' => 'T', - 'Ⓤ' => 'U', - 'Ⓥ' => 'V', - 'Ⓦ' => 'W', - 'Ⓧ' => 'X', - 'Ⓨ' => 'Y', - 'Ⓩ' => 'Z', - 'ⓐ' => 'a', - 'ⓑ' => 'b', - 'ⓒ' => 'c', - 'ⓓ' => 'd', - 'ⓔ' => 'e', - 'ⓕ' => 'f', - 'ⓖ' => 'g', - 'ⓗ' => 'h', - 'ⓘ' => 'i', - 'ⓙ' => 'j', - 'ⓚ' => 'k', - 'ⓛ' => 'l', - 'ⓜ' => 'm', - 'ⓝ' => 'n', - 'ⓞ' => 'o', - 'ⓟ' => 'p', - 'ⓠ' => 'q', - 'ⓡ' => 'r', - 'ⓢ' => 's', - 'ⓣ' => 't', - 'ⓤ' => 'u', - 'ⓥ' => 'v', - 'ⓦ' => 'w', - 'ⓧ' => 'x', - 'ⓨ' => 'y', - 'ⓩ' => 'z', - '⓪' => '0', - '⨌' => '∫∫∫∫', - '⩴' => '::=', - '⩵' => '==', - '⩶' => '===', - 'ⱼ' => 'j', - 'ⱽ' => 'V', - 'ⵯ' => 'ⵡ', - '⺟' => '母', - '⻳' => '龟', - '⼀' => '一', - '⼁' => '丨', - '⼂' => '丶', - '⼃' => '丿', - '⼄' => '乙', - '⼅' => '亅', - '⼆' => '二', - '⼇' => '亠', - '⼈' => '人', - '⼉' => '儿', - '⼊' => '入', - '⼋' => '八', - '⼌' => '冂', - '⼍' => '冖', - '⼎' => '冫', - '⼏' => '几', - '⼐' => '凵', - '⼑' => '刀', - '⼒' => '力', - '⼓' => '勹', - '⼔' => '匕', - '⼕' => '匚', - '⼖' => '匸', - '⼗' => '十', - '⼘' => '卜', - '⼙' => '卩', - '⼚' => '厂', - '⼛' => '厶', - '⼜' => '又', - '⼝' => '口', - '⼞' => '囗', - '⼟' => '土', - '⼠' => '士', - '⼡' => '夂', - '⼢' => '夊', - '⼣' => '夕', - '⼤' => '大', - '⼥' => '女', - '⼦' => '子', - '⼧' => '宀', - '⼨' => '寸', - '⼩' => '小', - '⼪' => '尢', - '⼫' => '尸', - '⼬' => '屮', - '⼭' => '山', - '⼮' => '巛', - '⼯' => '工', - '⼰' => '己', - '⼱' => '巾', - '⼲' => '干', - '⼳' => '幺', - '⼴' => '广', - '⼵' => '廴', - '⼶' => '廾', - '⼷' => '弋', - '⼸' => '弓', - '⼹' => '彐', - '⼺' => '彡', - '⼻' => '彳', - '⼼' => '心', - '⼽' => '戈', - '⼾' => '戶', - '⼿' => '手', - '⽀' => '支', - '⽁' => '攴', - '⽂' => '文', - '⽃' => '斗', - '⽄' => '斤', - '⽅' => '方', - '⽆' => '无', - '⽇' => '日', - '⽈' => '曰', - '⽉' => '月', - '⽊' => '木', - '⽋' => '欠', - '⽌' => '止', - '⽍' => '歹', - '⽎' => '殳', - '⽏' => '毋', - '⽐' => '比', - '⽑' => '毛', - '⽒' => '氏', - '⽓' => '气', - '⽔' => '水', - '⽕' => '火', - '⽖' => '爪', - '⽗' => '父', - '⽘' => '爻', - '⽙' => '爿', - '⽚' => '片', - '⽛' => '牙', - '⽜' => '牛', - '⽝' => '犬', - '⽞' => '玄', - '⽟' => '玉', - '⽠' => '瓜', - '⽡' => '瓦', - '⽢' => '甘', - '⽣' => '生', - '⽤' => '用', - '⽥' => '田', - '⽦' => '疋', - '⽧' => '疒', - '⽨' => '癶', - '⽩' => '白', - '⽪' => '皮', - '⽫' => '皿', - '⽬' => '目', - '⽭' => '矛', - '⽮' => '矢', - '⽯' => '石', - '⽰' => '示', - '⽱' => '禸', - '⽲' => '禾', - '⽳' => '穴', - '⽴' => '立', - '⽵' => '竹', - '⽶' => '米', - '⽷' => '糸', - '⽸' => '缶', - '⽹' => '网', - '⽺' => '羊', - '⽻' => '羽', - '⽼' => '老', - '⽽' => '而', - '⽾' => '耒', - '⽿' => '耳', - '⾀' => '聿', - '⾁' => '肉', - '⾂' => '臣', - '⾃' => '自', - '⾄' => '至', - '⾅' => '臼', - '⾆' => '舌', - '⾇' => '舛', - '⾈' => '舟', - '⾉' => '艮', - '⾊' => '色', - '⾋' => '艸', - '⾌' => '虍', - '⾍' => '虫', - '⾎' => '血', - '⾏' => '行', - '⾐' => '衣', - '⾑' => '襾', - '⾒' => '見', - '⾓' => '角', - '⾔' => '言', - '⾕' => '谷', - '⾖' => '豆', - '⾗' => '豕', - '⾘' => '豸', - '⾙' => '貝', - '⾚' => '赤', - '⾛' => '走', - '⾜' => '足', - '⾝' => '身', - '⾞' => '車', - '⾟' => '辛', - '⾠' => '辰', - '⾡' => '辵', - '⾢' => '邑', - '⾣' => '酉', - '⾤' => '釆', - '⾥' => '里', - '⾦' => '金', - '⾧' => '長', - '⾨' => '門', - '⾩' => '阜', - '⾪' => '隶', - '⾫' => '隹', - '⾬' => '雨', - '⾭' => '靑', - '⾮' => '非', - '⾯' => '面', - '⾰' => '革', - '⾱' => '韋', - '⾲' => '韭', - '⾳' => '音', - '⾴' => '頁', - '⾵' => '風', - '⾶' => '飛', - '⾷' => '食', - '⾸' => '首', - '⾹' => '香', - '⾺' => '馬', - '⾻' => '骨', - '⾼' => '高', - '⾽' => '髟', - '⾾' => '鬥', - '⾿' => '鬯', - '⿀' => '鬲', - '⿁' => '鬼', - '⿂' => '魚', - '⿃' => '鳥', - '⿄' => '鹵', - '⿅' => '鹿', - '⿆' => '麥', - '⿇' => '麻', - '⿈' => '黃', - '⿉' => '黍', - '⿊' => '黑', - '⿋' => '黹', - '⿌' => '黽', - '⿍' => '鼎', - '⿎' => '鼓', - '⿏' => '鼠', - '⿐' => '鼻', - '⿑' => '齊', - '⿒' => '齒', - '⿓' => '龍', - '⿔' => '龜', - '⿕' => '龠', - ' ' => ' ', - '〶' => '〒', - '〸' => '十', - '〹' => '卄', - '〺' => '卅', - '゛' => ' ゙', - '゜' => ' ゚', - 'ゟ' => 'より', - 'ヿ' => 'コト', - 'ㄱ' => 'ᄀ', - 'ㄲ' => 'ᄁ', - 'ㄳ' => 'ᆪ', - 'ㄴ' => 'ᄂ', - 'ㄵ' => 'ᆬ', - 'ㄶ' => 'ᆭ', - 'ㄷ' => 'ᄃ', - 'ㄸ' => 'ᄄ', - 'ㄹ' => 'ᄅ', - 'ㄺ' => 'ᆰ', - 'ㄻ' => 'ᆱ', - 'ㄼ' => 'ᆲ', - 'ㄽ' => 'ᆳ', - 'ㄾ' => 'ᆴ', - 'ㄿ' => 'ᆵ', - 'ㅀ' => 'ᄚ', - 'ㅁ' => 'ᄆ', - 'ㅂ' => 'ᄇ', - 'ㅃ' => 'ᄈ', - 'ㅄ' => 'ᄡ', - 'ㅅ' => 'ᄉ', - 'ㅆ' => 'ᄊ', - 'ㅇ' => 'ᄋ', - 'ㅈ' => 'ᄌ', - 'ㅉ' => 'ᄍ', - 'ㅊ' => 'ᄎ', - 'ㅋ' => 'ᄏ', - 'ㅌ' => 'ᄐ', - 'ㅍ' => 'ᄑ', - 'ㅎ' => 'ᄒ', - 'ㅏ' => 'ᅡ', - 'ㅐ' => 'ᅢ', - 'ㅑ' => 'ᅣ', - 'ㅒ' => 'ᅤ', - 'ㅓ' => 'ᅥ', - 'ㅔ' => 'ᅦ', - 'ㅕ' => 'ᅧ', - 'ㅖ' => 'ᅨ', - 'ㅗ' => 'ᅩ', - 'ㅘ' => 'ᅪ', - 'ㅙ' => 'ᅫ', - 'ㅚ' => 'ᅬ', - 'ㅛ' => 'ᅭ', - 'ㅜ' => 'ᅮ', - 'ㅝ' => 'ᅯ', - 'ㅞ' => 'ᅰ', - 'ㅟ' => 'ᅱ', - 'ㅠ' => 'ᅲ', - 'ㅡ' => 'ᅳ', - 'ㅢ' => 'ᅴ', - 'ㅣ' => 'ᅵ', - 'ㅤ' => 'ᅠ', - 'ㅥ' => 'ᄔ', - 'ㅦ' => 'ᄕ', - 'ㅧ' => 'ᇇ', - 'ㅨ' => 'ᇈ', - 'ㅩ' => 'ᇌ', - 'ㅪ' => 'ᇎ', - 'ㅫ' => 'ᇓ', - 'ㅬ' => 'ᇗ', - 'ㅭ' => 'ᇙ', - 'ㅮ' => 'ᄜ', - 'ㅯ' => 'ᇝ', - 'ㅰ' => 'ᇟ', - 'ㅱ' => 'ᄝ', - 'ㅲ' => 'ᄞ', - 'ㅳ' => 'ᄠ', - 'ㅴ' => 'ᄢ', - 'ㅵ' => 'ᄣ', - 'ㅶ' => 'ᄧ', - 'ㅷ' => 'ᄩ', - 'ㅸ' => 'ᄫ', - 'ㅹ' => 'ᄬ', - 'ㅺ' => 'ᄭ', - 'ㅻ' => 'ᄮ', - 'ㅼ' => 'ᄯ', - 'ㅽ' => 'ᄲ', - 'ㅾ' => 'ᄶ', - 'ㅿ' => 'ᅀ', - 'ㆀ' => 'ᅇ', - 'ㆁ' => 'ᅌ', - 'ㆂ' => 'ᇱ', - 'ㆃ' => 'ᇲ', - 'ㆄ' => 'ᅗ', - 'ㆅ' => 'ᅘ', - 'ㆆ' => 'ᅙ', - 'ㆇ' => 'ᆄ', - 'ㆈ' => 'ᆅ', - 'ㆉ' => 'ᆈ', - 'ㆊ' => 'ᆑ', - 'ㆋ' => 'ᆒ', - 'ㆌ' => 'ᆔ', - 'ㆍ' => 'ᆞ', - 'ㆎ' => 'ᆡ', - '㆒' => '一', - '㆓' => '二', - '㆔' => '三', - '㆕' => '四', - '㆖' => '上', - '㆗' => '中', - '㆘' => '下', - '㆙' => '甲', - '㆚' => '乙', - '㆛' => '丙', - '㆜' => '丁', - '㆝' => '天', - '㆞' => '地', - '㆟' => '人', - '㈀' => '(ᄀ)', - '㈁' => '(ᄂ)', - '㈂' => '(ᄃ)', - '㈃' => '(ᄅ)', - '㈄' => '(ᄆ)', - '㈅' => '(ᄇ)', - '㈆' => '(ᄉ)', - '㈇' => '(ᄋ)', - '㈈' => '(ᄌ)', - '㈉' => '(ᄎ)', - '㈊' => '(ᄏ)', - '㈋' => '(ᄐ)', - '㈌' => '(ᄑ)', - '㈍' => '(ᄒ)', - '㈎' => '(가)', - '㈏' => '(나)', - '㈐' => '(다)', - '㈑' => '(라)', - '㈒' => '(마)', - '㈓' => '(바)', - '㈔' => '(사)', - '㈕' => '(아)', - '㈖' => '(자)', - '㈗' => '(차)', - '㈘' => '(카)', - '㈙' => '(타)', - '㈚' => '(파)', - '㈛' => '(하)', - '㈜' => '(주)', - '㈝' => '(오전)', - '㈞' => '(오후)', - '㈠' => '(一)', - '㈡' => '(二)', - '㈢' => '(三)', - '㈣' => '(四)', - '㈤' => '(五)', - '㈥' => '(六)', - '㈦' => '(七)', - '㈧' => '(八)', - '㈨' => '(九)', - '㈩' => '(十)', - '㈪' => '(月)', - '㈫' => '(火)', - '㈬' => '(水)', - '㈭' => '(木)', - '㈮' => '(金)', - '㈯' => '(土)', - '㈰' => '(日)', - '㈱' => '(株)', - '㈲' => '(有)', - '㈳' => '(社)', - '㈴' => '(名)', - '㈵' => '(特)', - '㈶' => '(財)', - '㈷' => '(祝)', - '㈸' => '(労)', - '㈹' => '(代)', - '㈺' => '(呼)', - '㈻' => '(学)', - '㈼' => '(監)', - '㈽' => '(企)', - '㈾' => '(資)', - '㈿' => '(協)', - '㉀' => '(祭)', - '㉁' => '(休)', - '㉂' => '(自)', - '㉃' => '(至)', - '㉄' => '問', - '㉅' => '幼', - '㉆' => '文', - '㉇' => '箏', - '㉐' => 'PTE', - '㉑' => '21', - '㉒' => '22', - '㉓' => '23', - '㉔' => '24', - '㉕' => '25', - '㉖' => '26', - '㉗' => '27', - '㉘' => '28', - '㉙' => '29', - '㉚' => '30', - '㉛' => '31', - '㉜' => '32', - '㉝' => '33', - '㉞' => '34', - '㉟' => '35', - '㉠' => 'ᄀ', - '㉡' => 'ᄂ', - '㉢' => 'ᄃ', - '㉣' => 'ᄅ', - '㉤' => 'ᄆ', - '㉥' => 'ᄇ', - '㉦' => 'ᄉ', - '㉧' => 'ᄋ', - '㉨' => 'ᄌ', - '㉩' => 'ᄎ', - '㉪' => 'ᄏ', - '㉫' => 'ᄐ', - '㉬' => 'ᄑ', - '㉭' => 'ᄒ', - '㉮' => '가', - '㉯' => '나', - '㉰' => '다', - '㉱' => '라', - '㉲' => '마', - '㉳' => '바', - '㉴' => '사', - '㉵' => '아', - '㉶' => '자', - '㉷' => '차', - '㉸' => '카', - '㉹' => '타', - '㉺' => '파', - '㉻' => '하', - '㉼' => '참고', - '㉽' => '주의', - '㉾' => '우', - '㊀' => '一', - '㊁' => '二', - '㊂' => '三', - '㊃' => '四', - '㊄' => '五', - '㊅' => '六', - '㊆' => '七', - '㊇' => '八', - '㊈' => '九', - '㊉' => '十', - '㊊' => '月', - '㊋' => '火', - '㊌' => '水', - '㊍' => '木', - '㊎' => '金', - '㊏' => '土', - '㊐' => '日', - '㊑' => '株', - '㊒' => '有', - '㊓' => '社', - '㊔' => '名', - '㊕' => '特', - '㊖' => '財', - '㊗' => '祝', - '㊘' => '労', - '㊙' => '秘', - '㊚' => '男', - '㊛' => '女', - '㊜' => '適', - '㊝' => '優', - '㊞' => '印', - '㊟' => '注', - '㊠' => '項', - '㊡' => '休', - '㊢' => '写', - '㊣' => '正', - '㊤' => '上', - '㊥' => '中', - '㊦' => '下', - '㊧' => '左', - '㊨' => '右', - '㊩' => '医', - '㊪' => '宗', - '㊫' => '学', - '㊬' => '監', - '㊭' => '企', - '㊮' => '資', - '㊯' => '協', - '㊰' => '夜', - '㊱' => '36', - '㊲' => '37', - '㊳' => '38', - '㊴' => '39', - '㊵' => '40', - '㊶' => '41', - '㊷' => '42', - '㊸' => '43', - '㊹' => '44', - '㊺' => '45', - '㊻' => '46', - '㊼' => '47', - '㊽' => '48', - '㊾' => '49', - '㊿' => '50', - '㋀' => '1月', - '㋁' => '2月', - '㋂' => '3月', - '㋃' => '4月', - '㋄' => '5月', - '㋅' => '6月', - '㋆' => '7月', - '㋇' => '8月', - '㋈' => '9月', - '㋉' => '10月', - '㋊' => '11月', - '㋋' => '12月', - '㋌' => 'Hg', - '㋍' => 'erg', - '㋎' => 'eV', - '㋏' => 'LTD', - '㋐' => 'ア', - '㋑' => 'イ', - '㋒' => 'ウ', - '㋓' => 'エ', - '㋔' => 'オ', - '㋕' => 'カ', - '㋖' => 'キ', - '㋗' => 'ク', - '㋘' => 'ケ', - '㋙' => 'コ', - '㋚' => 'サ', - '㋛' => 'シ', - '㋜' => 'ス', - '㋝' => 'セ', - '㋞' => 'ソ', - '㋟' => 'タ', - '㋠' => 'チ', - '㋡' => 'ツ', - '㋢' => 'テ', - '㋣' => 'ト', - '㋤' => 'ナ', - '㋥' => 'ニ', - '㋦' => 'ヌ', - '㋧' => 'ネ', - '㋨' => 'ノ', - '㋩' => 'ハ', - '㋪' => 'ヒ', - '㋫' => 'フ', - '㋬' => 'ヘ', - '㋭' => 'ホ', - '㋮' => 'マ', - '㋯' => 'ミ', - '㋰' => 'ム', - '㋱' => 'メ', - '㋲' => 'モ', - '㋳' => 'ヤ', - '㋴' => 'ユ', - '㋵' => 'ヨ', - '㋶' => 'ラ', - '㋷' => 'リ', - '㋸' => 'ル', - '㋹' => 'レ', - '㋺' => 'ロ', - '㋻' => 'ワ', - '㋼' => 'ヰ', - '㋽' => 'ヱ', - '㋾' => 'ヲ', - '㋿' => '令和', - '㌀' => 'アパート', - '㌁' => 'アルファ', - '㌂' => 'アンペア', - '㌃' => 'アール', - '㌄' => 'イニング', - '㌅' => 'インチ', - '㌆' => 'ウォン', - '㌇' => 'エスクード', - '㌈' => 'エーカー', - '㌉' => 'オンス', - '㌊' => 'オーム', - '㌋' => 'カイリ', - '㌌' => 'カラット', - '㌍' => 'カロリー', - '㌎' => 'ガロン', - '㌏' => 'ガンマ', - '㌐' => 'ギガ', - '㌑' => 'ギニー', - '㌒' => 'キュリー', - '㌓' => 'ギルダー', - '㌔' => 'キロ', - '㌕' => 'キログラム', - '㌖' => 'キロメートル', - '㌗' => 'キロワット', - '㌘' => 'グラム', - '㌙' => 'グラムトン', - '㌚' => 'クルゼイロ', - '㌛' => 'クローネ', - '㌜' => 'ケース', - '㌝' => 'コルナ', - '㌞' => 'コーポ', - '㌟' => 'サイクル', - '㌠' => 'サンチーム', - '㌡' => 'シリング', - '㌢' => 'センチ', - '㌣' => 'セント', - '㌤' => 'ダース', - '㌥' => 'デシ', - '㌦' => 'ドル', - '㌧' => 'トン', - '㌨' => 'ナノ', - '㌩' => 'ノット', - '㌪' => 'ハイツ', - '㌫' => 'パーセント', - '㌬' => 'パーツ', - '㌭' => 'バーレル', - '㌮' => 'ピアストル', - '㌯' => 'ピクル', - '㌰' => 'ピコ', - '㌱' => 'ビル', - '㌲' => 'ファラッド', - '㌳' => 'フィート', - '㌴' => 'ブッシェル', - '㌵' => 'フラン', - '㌶' => 'ヘクタール', - '㌷' => 'ペソ', - '㌸' => 'ペニヒ', - '㌹' => 'ヘルツ', - '㌺' => 'ペンス', - '㌻' => 'ページ', - '㌼' => 'ベータ', - '㌽' => 'ポイント', - '㌾' => 'ボルト', - '㌿' => 'ホン', - '㍀' => 'ポンド', - '㍁' => 'ホール', - '㍂' => 'ホーン', - '㍃' => 'マイクロ', - '㍄' => 'マイル', - '㍅' => 'マッハ', - '㍆' => 'マルク', - '㍇' => 'マンション', - '㍈' => 'ミクロン', - '㍉' => 'ミリ', - '㍊' => 'ミリバール', - '㍋' => 'メガ', - '㍌' => 'メガトン', - '㍍' => 'メートル', - '㍎' => 'ヤード', - '㍏' => 'ヤール', - '㍐' => 'ユアン', - '㍑' => 'リットル', - '㍒' => 'リラ', - '㍓' => 'ルピー', - '㍔' => 'ルーブル', - '㍕' => 'レム', - '㍖' => 'レントゲン', - '㍗' => 'ワット', - '㍘' => '0点', - '㍙' => '1点', - '㍚' => '2点', - '㍛' => '3点', - '㍜' => '4点', - '㍝' => '5点', - '㍞' => '6点', - '㍟' => '7点', - '㍠' => '8点', - '㍡' => '9点', - '㍢' => '10点', - '㍣' => '11点', - '㍤' => '12点', - '㍥' => '13点', - '㍦' => '14点', - '㍧' => '15点', - '㍨' => '16点', - '㍩' => '17点', - '㍪' => '18点', - '㍫' => '19点', - '㍬' => '20点', - '㍭' => '21点', - '㍮' => '22点', - '㍯' => '23点', - '㍰' => '24点', - '㍱' => 'hPa', - '㍲' => 'da', - '㍳' => 'AU', - '㍴' => 'bar', - '㍵' => 'oV', - '㍶' => 'pc', - '㍷' => 'dm', - '㍸' => 'dm2', - '㍹' => 'dm3', - '㍺' => 'IU', - '㍻' => '平成', - '㍼' => '昭和', - '㍽' => '大正', - '㍾' => '明治', - '㍿' => '株式会社', - '㎀' => 'pA', - '㎁' => 'nA', - '㎂' => 'μA', - '㎃' => 'mA', - '㎄' => 'kA', - '㎅' => 'KB', - '㎆' => 'MB', - '㎇' => 'GB', - '㎈' => 'cal', - '㎉' => 'kcal', - '㎊' => 'pF', - '㎋' => 'nF', - '㎌' => 'μF', - '㎍' => 'μg', - '㎎' => 'mg', - '㎏' => 'kg', - '㎐' => 'Hz', - '㎑' => 'kHz', - '㎒' => 'MHz', - '㎓' => 'GHz', - '㎔' => 'THz', - '㎕' => 'μl', - '㎖' => 'ml', - '㎗' => 'dl', - '㎘' => 'kl', - '㎙' => 'fm', - '㎚' => 'nm', - '㎛' => 'μm', - '㎜' => 'mm', - '㎝' => 'cm', - '㎞' => 'km', - '㎟' => 'mm2', - '㎠' => 'cm2', - '㎡' => 'm2', - '㎢' => 'km2', - '㎣' => 'mm3', - '㎤' => 'cm3', - '㎥' => 'm3', - '㎦' => 'km3', - '㎧' => 'm∕s', - '㎨' => 'm∕s2', - '㎩' => 'Pa', - '㎪' => 'kPa', - '㎫' => 'MPa', - '㎬' => 'GPa', - '㎭' => 'rad', - '㎮' => 'rad∕s', - '㎯' => 'rad∕s2', - '㎰' => 'ps', - '㎱' => 'ns', - '㎲' => 'μs', - '㎳' => 'ms', - '㎴' => 'pV', - '㎵' => 'nV', - '㎶' => 'μV', - '㎷' => 'mV', - '㎸' => 'kV', - '㎹' => 'MV', - '㎺' => 'pW', - '㎻' => 'nW', - '㎼' => 'μW', - '㎽' => 'mW', - '㎾' => 'kW', - '㎿' => 'MW', - '㏀' => 'kΩ', - '㏁' => 'MΩ', - '㏂' => 'a.m.', - '㏃' => 'Bq', - '㏄' => 'cc', - '㏅' => 'cd', - '㏆' => 'C∕kg', - '㏇' => 'Co.', - '㏈' => 'dB', - '㏉' => 'Gy', - '㏊' => 'ha', - '㏋' => 'HP', - '㏌' => 'in', - '㏍' => 'KK', - '㏎' => 'KM', - '㏏' => 'kt', - '㏐' => 'lm', - '㏑' => 'ln', - '㏒' => 'log', - '㏓' => 'lx', - '㏔' => 'mb', - '㏕' => 'mil', - '㏖' => 'mol', - '㏗' => 'PH', - '㏘' => 'p.m.', - '㏙' => 'PPM', - '㏚' => 'PR', - '㏛' => 'sr', - '㏜' => 'Sv', - '㏝' => 'Wb', - '㏞' => 'V∕m', - '㏟' => 'A∕m', - '㏠' => '1日', - '㏡' => '2日', - '㏢' => '3日', - '㏣' => '4日', - '㏤' => '5日', - '㏥' => '6日', - '㏦' => '7日', - '㏧' => '8日', - '㏨' => '9日', - '㏩' => '10日', - '㏪' => '11日', - '㏫' => '12日', - '㏬' => '13日', - '㏭' => '14日', - '㏮' => '15日', - '㏯' => '16日', - '㏰' => '17日', - '㏱' => '18日', - '㏲' => '19日', - '㏳' => '20日', - '㏴' => '21日', - '㏵' => '22日', - '㏶' => '23日', - '㏷' => '24日', - '㏸' => '25日', - '㏹' => '26日', - '㏺' => '27日', - '㏻' => '28日', - '㏼' => '29日', - '㏽' => '30日', - '㏾' => '31日', - '㏿' => 'gal', - 'ꚜ' => 'ъ', - 'ꚝ' => 'ь', - 'ꝰ' => 'ꝯ', - 'ꟸ' => 'Ħ', - 'ꟹ' => 'œ', - 'ꭜ' => 'ꜧ', - 'ꭝ' => 'ꬷ', - 'ꭞ' => 'ɫ', - 'ꭟ' => 'ꭒ', - 'ꭩ' => 'ʍ', - 'ff' => 'ff', - 'fi' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - 'ſt' => 'st', - 'st' => 'st', - 'ﬓ' => 'մն', - 'ﬔ' => 'մե', - 'ﬕ' => 'մի', - 'ﬖ' => 'վն', - 'ﬗ' => 'մխ', - 'ﬠ' => 'ע', - 'ﬡ' => 'א', - 'ﬢ' => 'ד', - 'ﬣ' => 'ה', - 'ﬤ' => 'כ', - 'ﬥ' => 'ל', - 'ﬦ' => 'ם', - 'ﬧ' => 'ר', - 'ﬨ' => 'ת', - '﬩' => '+', - 'ﭏ' => 'אל', - 'ﭐ' => 'ٱ', - 'ﭑ' => 'ٱ', - 'ﭒ' => 'ٻ', - 'ﭓ' => 'ٻ', - 'ﭔ' => 'ٻ', - 'ﭕ' => 'ٻ', - 'ﭖ' => 'پ', - 'ﭗ' => 'پ', - 'ﭘ' => 'پ', - 'ﭙ' => 'پ', - 'ﭚ' => 'ڀ', - 'ﭛ' => 'ڀ', - 'ﭜ' => 'ڀ', - 'ﭝ' => 'ڀ', - 'ﭞ' => 'ٺ', - 'ﭟ' => 'ٺ', - 'ﭠ' => 'ٺ', - 'ﭡ' => 'ٺ', - 'ﭢ' => 'ٿ', - 'ﭣ' => 'ٿ', - 'ﭤ' => 'ٿ', - 'ﭥ' => 'ٿ', - 'ﭦ' => 'ٹ', - 'ﭧ' => 'ٹ', - 'ﭨ' => 'ٹ', - 'ﭩ' => 'ٹ', - 'ﭪ' => 'ڤ', - 'ﭫ' => 'ڤ', - 'ﭬ' => 'ڤ', - 'ﭭ' => 'ڤ', - 'ﭮ' => 'ڦ', - 'ﭯ' => 'ڦ', - 'ﭰ' => 'ڦ', - 'ﭱ' => 'ڦ', - 'ﭲ' => 'ڄ', - 'ﭳ' => 'ڄ', - 'ﭴ' => 'ڄ', - 'ﭵ' => 'ڄ', - 'ﭶ' => 'ڃ', - 'ﭷ' => 'ڃ', - 'ﭸ' => 'ڃ', - 'ﭹ' => 'ڃ', - 'ﭺ' => 'چ', - 'ﭻ' => 'چ', - 'ﭼ' => 'چ', - 'ﭽ' => 'چ', - 'ﭾ' => 'ڇ', - 'ﭿ' => 'ڇ', - 'ﮀ' => 'ڇ', - 'ﮁ' => 'ڇ', - 'ﮂ' => 'ڍ', - 'ﮃ' => 'ڍ', - 'ﮄ' => 'ڌ', - 'ﮅ' => 'ڌ', - 'ﮆ' => 'ڎ', - 'ﮇ' => 'ڎ', - 'ﮈ' => 'ڈ', - 'ﮉ' => 'ڈ', - 'ﮊ' => 'ژ', - 'ﮋ' => 'ژ', - 'ﮌ' => 'ڑ', - 'ﮍ' => 'ڑ', - 'ﮎ' => 'ک', - 'ﮏ' => 'ک', - 'ﮐ' => 'ک', - 'ﮑ' => 'ک', - 'ﮒ' => 'گ', - 'ﮓ' => 'گ', - 'ﮔ' => 'گ', - 'ﮕ' => 'گ', - 'ﮖ' => 'ڳ', - 'ﮗ' => 'ڳ', - 'ﮘ' => 'ڳ', - 'ﮙ' => 'ڳ', - 'ﮚ' => 'ڱ', - 'ﮛ' => 'ڱ', - 'ﮜ' => 'ڱ', - 'ﮝ' => 'ڱ', - 'ﮞ' => 'ں', - 'ﮟ' => 'ں', - 'ﮠ' => 'ڻ', - 'ﮡ' => 'ڻ', - 'ﮢ' => 'ڻ', - 'ﮣ' => 'ڻ', - 'ﮤ' => 'ۀ', - 'ﮥ' => 'ۀ', - 'ﮦ' => 'ہ', - 'ﮧ' => 'ہ', - 'ﮨ' => 'ہ', - 'ﮩ' => 'ہ', - 'ﮪ' => 'ھ', - 'ﮫ' => 'ھ', - 'ﮬ' => 'ھ', - 'ﮭ' => 'ھ', - 'ﮮ' => 'ے', - 'ﮯ' => 'ے', - 'ﮰ' => 'ۓ', - 'ﮱ' => 'ۓ', - 'ﯓ' => 'ڭ', - 'ﯔ' => 'ڭ', - 'ﯕ' => 'ڭ', - 'ﯖ' => 'ڭ', - 'ﯗ' => 'ۇ', - 'ﯘ' => 'ۇ', - 'ﯙ' => 'ۆ', - 'ﯚ' => 'ۆ', - 'ﯛ' => 'ۈ', - 'ﯜ' => 'ۈ', - 'ﯝ' => 'ۇٴ', - 'ﯞ' => 'ۋ', - 'ﯟ' => 'ۋ', - 'ﯠ' => 'ۅ', - 'ﯡ' => 'ۅ', - 'ﯢ' => 'ۉ', - 'ﯣ' => 'ۉ', - 'ﯤ' => 'ې', - 'ﯥ' => 'ې', - 'ﯦ' => 'ې', - 'ﯧ' => 'ې', - 'ﯨ' => 'ى', - 'ﯩ' => 'ى', - 'ﯪ' => 'ئا', - 'ﯫ' => 'ئا', - 'ﯬ' => 'ئە', - 'ﯭ' => 'ئە', - 'ﯮ' => 'ئو', - 'ﯯ' => 'ئو', - 'ﯰ' => 'ئۇ', - 'ﯱ' => 'ئۇ', - 'ﯲ' => 'ئۆ', - 'ﯳ' => 'ئۆ', - 'ﯴ' => 'ئۈ', - 'ﯵ' => 'ئۈ', - 'ﯶ' => 'ئې', - 'ﯷ' => 'ئې', - 'ﯸ' => 'ئې', - 'ﯹ' => 'ئى', - 'ﯺ' => 'ئى', - 'ﯻ' => 'ئى', - 'ﯼ' => 'ی', - 'ﯽ' => 'ی', - 'ﯾ' => 'ی', - 'ﯿ' => 'ی', - 'ﰀ' => 'ئج', - 'ﰁ' => 'ئح', - 'ﰂ' => 'ئم', - 'ﰃ' => 'ئى', - 'ﰄ' => 'ئي', - 'ﰅ' => 'بج', - 'ﰆ' => 'بح', - 'ﰇ' => 'بخ', - 'ﰈ' => 'بم', - 'ﰉ' => 'بى', - 'ﰊ' => 'بي', - 'ﰋ' => 'تج', - 'ﰌ' => 'تح', - 'ﰍ' => 'تخ', - 'ﰎ' => 'تم', - 'ﰏ' => 'تى', - 'ﰐ' => 'تي', - 'ﰑ' => 'ثج', - 'ﰒ' => 'ثم', - 'ﰓ' => 'ثى', - 'ﰔ' => 'ثي', - 'ﰕ' => 'جح', - 'ﰖ' => 'جم', - 'ﰗ' => 'حج', - 'ﰘ' => 'حم', - 'ﰙ' => 'خج', - 'ﰚ' => 'خح', - 'ﰛ' => 'خم', - 'ﰜ' => 'سج', - 'ﰝ' => 'سح', - 'ﰞ' => 'سخ', - 'ﰟ' => 'سم', - 'ﰠ' => 'صح', - 'ﰡ' => 'صم', - 'ﰢ' => 'ضج', - 'ﰣ' => 'ضح', - 'ﰤ' => 'ضخ', - 'ﰥ' => 'ضم', - 'ﰦ' => 'طح', - 'ﰧ' => 'طم', - 'ﰨ' => 'ظم', - 'ﰩ' => 'عج', - 'ﰪ' => 'عم', - 'ﰫ' => 'غج', - 'ﰬ' => 'غم', - 'ﰭ' => 'فج', - 'ﰮ' => 'فح', - 'ﰯ' => 'فخ', - 'ﰰ' => 'فم', - 'ﰱ' => 'فى', - 'ﰲ' => 'في', - 'ﰳ' => 'قح', - 'ﰴ' => 'قم', - 'ﰵ' => 'قى', - 'ﰶ' => 'قي', - 'ﰷ' => 'كا', - 'ﰸ' => 'كج', - 'ﰹ' => 'كح', - 'ﰺ' => 'كخ', - 'ﰻ' => 'كل', - 'ﰼ' => 'كم', - 'ﰽ' => 'كى', - 'ﰾ' => 'كي', - 'ﰿ' => 'لج', - 'ﱀ' => 'لح', - 'ﱁ' => 'لخ', - 'ﱂ' => 'لم', - 'ﱃ' => 'لى', - 'ﱄ' => 'لي', - 'ﱅ' => 'مج', - 'ﱆ' => 'مح', - 'ﱇ' => 'مخ', - 'ﱈ' => 'مم', - 'ﱉ' => 'مى', - 'ﱊ' => 'مي', - 'ﱋ' => 'نج', - 'ﱌ' => 'نح', - 'ﱍ' => 'نخ', - 'ﱎ' => 'نم', - 'ﱏ' => 'نى', - 'ﱐ' => 'ني', - 'ﱑ' => 'هج', - 'ﱒ' => 'هم', - 'ﱓ' => 'هى', - 'ﱔ' => 'هي', - 'ﱕ' => 'يج', - 'ﱖ' => 'يح', - 'ﱗ' => 'يخ', - 'ﱘ' => 'يم', - 'ﱙ' => 'يى', - 'ﱚ' => 'يي', - 'ﱛ' => 'ذٰ', - 'ﱜ' => 'رٰ', - 'ﱝ' => 'ىٰ', - 'ﱞ' => ' ٌّ', - 'ﱟ' => ' ٍّ', - 'ﱠ' => ' َّ', - 'ﱡ' => ' ُّ', - 'ﱢ' => ' ِّ', - 'ﱣ' => ' ّٰ', - 'ﱤ' => 'ئر', - 'ﱥ' => 'ئز', - 'ﱦ' => 'ئم', - 'ﱧ' => 'ئن', - 'ﱨ' => 'ئى', - 'ﱩ' => 'ئي', - 'ﱪ' => 'بر', - 'ﱫ' => 'بز', - 'ﱬ' => 'بم', - 'ﱭ' => 'بن', - 'ﱮ' => 'بى', - 'ﱯ' => 'بي', - 'ﱰ' => 'تر', - 'ﱱ' => 'تز', - 'ﱲ' => 'تم', - 'ﱳ' => 'تن', - 'ﱴ' => 'تى', - 'ﱵ' => 'تي', - 'ﱶ' => 'ثر', - 'ﱷ' => 'ثز', - 'ﱸ' => 'ثم', - 'ﱹ' => 'ثن', - 'ﱺ' => 'ثى', - 'ﱻ' => 'ثي', - 'ﱼ' => 'فى', - 'ﱽ' => 'في', - 'ﱾ' => 'قى', - 'ﱿ' => 'قي', - 'ﲀ' => 'كا', - 'ﲁ' => 'كل', - 'ﲂ' => 'كم', - 'ﲃ' => 'كى', - 'ﲄ' => 'كي', - 'ﲅ' => 'لم', - 'ﲆ' => 'لى', - 'ﲇ' => 'لي', - 'ﲈ' => 'ما', - 'ﲉ' => 'مم', - 'ﲊ' => 'نر', - 'ﲋ' => 'نز', - 'ﲌ' => 'نم', - 'ﲍ' => 'نن', - 'ﲎ' => 'نى', - 'ﲏ' => 'ني', - 'ﲐ' => 'ىٰ', - 'ﲑ' => 'ير', - 'ﲒ' => 'يز', - 'ﲓ' => 'يم', - 'ﲔ' => 'ين', - 'ﲕ' => 'يى', - 'ﲖ' => 'يي', - 'ﲗ' => 'ئج', - 'ﲘ' => 'ئح', - 'ﲙ' => 'ئخ', - 'ﲚ' => 'ئم', - 'ﲛ' => 'ئه', - 'ﲜ' => 'بج', - 'ﲝ' => 'بح', - 'ﲞ' => 'بخ', - 'ﲟ' => 'بم', - 'ﲠ' => 'به', - 'ﲡ' => 'تج', - 'ﲢ' => 'تح', - 'ﲣ' => 'تخ', - 'ﲤ' => 'تم', - 'ﲥ' => 'ته', - 'ﲦ' => 'ثم', - 'ﲧ' => 'جح', - 'ﲨ' => 'جم', - 'ﲩ' => 'حج', - 'ﲪ' => 'حم', - 'ﲫ' => 'خج', - 'ﲬ' => 'خم', - 'ﲭ' => 'سج', - 'ﲮ' => 'سح', - 'ﲯ' => 'سخ', - 'ﲰ' => 'سم', - 'ﲱ' => 'صح', - 'ﲲ' => 'صخ', - 'ﲳ' => 'صم', - 'ﲴ' => 'ضج', - 'ﲵ' => 'ضح', - 'ﲶ' => 'ضخ', - 'ﲷ' => 'ضم', - 'ﲸ' => 'طح', - 'ﲹ' => 'ظم', - 'ﲺ' => 'عج', - 'ﲻ' => 'عم', - 'ﲼ' => 'غج', - 'ﲽ' => 'غم', - 'ﲾ' => 'فج', - 'ﲿ' => 'فح', - 'ﳀ' => 'فخ', - 'ﳁ' => 'فم', - 'ﳂ' => 'قح', - 'ﳃ' => 'قم', - 'ﳄ' => 'كج', - 'ﳅ' => 'كح', - 'ﳆ' => 'كخ', - 'ﳇ' => 'كل', - 'ﳈ' => 'كم', - 'ﳉ' => 'لج', - 'ﳊ' => 'لح', - 'ﳋ' => 'لخ', - 'ﳌ' => 'لم', - 'ﳍ' => 'له', - 'ﳎ' => 'مج', - 'ﳏ' => 'مح', - 'ﳐ' => 'مخ', - 'ﳑ' => 'مم', - 'ﳒ' => 'نج', - 'ﳓ' => 'نح', - 'ﳔ' => 'نخ', - 'ﳕ' => 'نم', - 'ﳖ' => 'نه', - 'ﳗ' => 'هج', - 'ﳘ' => 'هم', - 'ﳙ' => 'هٰ', - 'ﳚ' => 'يج', - 'ﳛ' => 'يح', - 'ﳜ' => 'يخ', - 'ﳝ' => 'يم', - 'ﳞ' => 'يه', - 'ﳟ' => 'ئم', - 'ﳠ' => 'ئه', - 'ﳡ' => 'بم', - 'ﳢ' => 'به', - 'ﳣ' => 'تم', - 'ﳤ' => 'ته', - 'ﳥ' => 'ثم', - 'ﳦ' => 'ثه', - 'ﳧ' => 'سم', - 'ﳨ' => 'سه', - 'ﳩ' => 'شم', - 'ﳪ' => 'شه', - 'ﳫ' => 'كل', - 'ﳬ' => 'كم', - 'ﳭ' => 'لم', - 'ﳮ' => 'نم', - 'ﳯ' => 'نه', - 'ﳰ' => 'يم', - 'ﳱ' => 'يه', - 'ﳲ' => 'ـَّ', - 'ﳳ' => 'ـُّ', - 'ﳴ' => 'ـِّ', - 'ﳵ' => 'طى', - 'ﳶ' => 'طي', - 'ﳷ' => 'عى', - 'ﳸ' => 'عي', - 'ﳹ' => 'غى', - 'ﳺ' => 'غي', - 'ﳻ' => 'سى', - 'ﳼ' => 'سي', - 'ﳽ' => 'شى', - 'ﳾ' => 'شي', - 'ﳿ' => 'حى', - 'ﴀ' => 'حي', - 'ﴁ' => 'جى', - 'ﴂ' => 'جي', - 'ﴃ' => 'خى', - 'ﴄ' => 'خي', - 'ﴅ' => 'صى', - 'ﴆ' => 'صي', - 'ﴇ' => 'ضى', - 'ﴈ' => 'ضي', - 'ﴉ' => 'شج', - 'ﴊ' => 'شح', - 'ﴋ' => 'شخ', - 'ﴌ' => 'شم', - 'ﴍ' => 'شر', - 'ﴎ' => 'سر', - 'ﴏ' => 'صر', - 'ﴐ' => 'ضر', - 'ﴑ' => 'طى', - 'ﴒ' => 'طي', - 'ﴓ' => 'عى', - 'ﴔ' => 'عي', - 'ﴕ' => 'غى', - 'ﴖ' => 'غي', - 'ﴗ' => 'سى', - 'ﴘ' => 'سي', - 'ﴙ' => 'شى', - 'ﴚ' => 'شي', - 'ﴛ' => 'حى', - 'ﴜ' => 'حي', - 'ﴝ' => 'جى', - 'ﴞ' => 'جي', - 'ﴟ' => 'خى', - 'ﴠ' => 'خي', - 'ﴡ' => 'صى', - 'ﴢ' => 'صي', - 'ﴣ' => 'ضى', - 'ﴤ' => 'ضي', - 'ﴥ' => 'شج', - 'ﴦ' => 'شح', - 'ﴧ' => 'شخ', - 'ﴨ' => 'شم', - 'ﴩ' => 'شر', - 'ﴪ' => 'سر', - 'ﴫ' => 'صر', - 'ﴬ' => 'ضر', - 'ﴭ' => 'شج', - 'ﴮ' => 'شح', - 'ﴯ' => 'شخ', - 'ﴰ' => 'شم', - 'ﴱ' => 'سه', - 'ﴲ' => 'شه', - 'ﴳ' => 'طم', - 'ﴴ' => 'سج', - 'ﴵ' => 'سح', - 'ﴶ' => 'سخ', - 'ﴷ' => 'شج', - 'ﴸ' => 'شح', - 'ﴹ' => 'شخ', - 'ﴺ' => 'طم', - 'ﴻ' => 'ظم', - 'ﴼ' => 'اً', - 'ﴽ' => 'اً', - 'ﵐ' => 'تجم', - 'ﵑ' => 'تحج', - 'ﵒ' => 'تحج', - 'ﵓ' => 'تحم', - 'ﵔ' => 'تخم', - 'ﵕ' => 'تمج', - 'ﵖ' => 'تمح', - 'ﵗ' => 'تمخ', - 'ﵘ' => 'جمح', - 'ﵙ' => 'جمح', - 'ﵚ' => 'حمي', - 'ﵛ' => 'حمى', - 'ﵜ' => 'سحج', - 'ﵝ' => 'سجح', - 'ﵞ' => 'سجى', - 'ﵟ' => 'سمح', - 'ﵠ' => 'سمح', - 'ﵡ' => 'سمج', - 'ﵢ' => 'سمم', - 'ﵣ' => 'سمم', - 'ﵤ' => 'صحح', - 'ﵥ' => 'صحح', - 'ﵦ' => 'صمم', - 'ﵧ' => 'شحم', - 'ﵨ' => 'شحم', - 'ﵩ' => 'شجي', - 'ﵪ' => 'شمخ', - 'ﵫ' => 'شمخ', - 'ﵬ' => 'شمم', - 'ﵭ' => 'شمم', - 'ﵮ' => 'ضحى', - 'ﵯ' => 'ضخم', - 'ﵰ' => 'ضخم', - 'ﵱ' => 'طمح', - 'ﵲ' => 'طمح', - 'ﵳ' => 'طمم', - 'ﵴ' => 'طمي', - 'ﵵ' => 'عجم', - 'ﵶ' => 'عمم', - 'ﵷ' => 'عمم', - 'ﵸ' => 'عمى', - 'ﵹ' => 'غمم', - 'ﵺ' => 'غمي', - 'ﵻ' => 'غمى', - 'ﵼ' => 'فخم', - 'ﵽ' => 'فخم', - 'ﵾ' => 'قمح', - 'ﵿ' => 'قمم', - 'ﶀ' => 'لحم', - 'ﶁ' => 'لحي', - 'ﶂ' => 'لحى', - 'ﶃ' => 'لجج', - 'ﶄ' => 'لجج', - 'ﶅ' => 'لخم', - 'ﶆ' => 'لخم', - 'ﶇ' => 'لمح', - 'ﶈ' => 'لمح', - 'ﶉ' => 'محج', - 'ﶊ' => 'محم', - 'ﶋ' => 'محي', - 'ﶌ' => 'مجح', - 'ﶍ' => 'مجم', - 'ﶎ' => 'مخج', - 'ﶏ' => 'مخم', - 'ﶒ' => 'مجخ', - 'ﶓ' => 'همج', - 'ﶔ' => 'همم', - 'ﶕ' => 'نحم', - 'ﶖ' => 'نحى', - 'ﶗ' => 'نجم', - 'ﶘ' => 'نجم', - 'ﶙ' => 'نجى', - 'ﶚ' => 'نمي', - 'ﶛ' => 'نمى', - 'ﶜ' => 'يمم', - 'ﶝ' => 'يمم', - 'ﶞ' => 'بخي', - 'ﶟ' => 'تجي', - 'ﶠ' => 'تجى', - 'ﶡ' => 'تخي', - 'ﶢ' => 'تخى', - 'ﶣ' => 'تمي', - 'ﶤ' => 'تمى', - 'ﶥ' => 'جمي', - 'ﶦ' => 'جحى', - 'ﶧ' => 'جمى', - 'ﶨ' => 'سخى', - 'ﶩ' => 'صحي', - 'ﶪ' => 'شحي', - 'ﶫ' => 'ضحي', - 'ﶬ' => 'لجي', - 'ﶭ' => 'لمي', - 'ﶮ' => 'يحي', - 'ﶯ' => 'يجي', - 'ﶰ' => 'يمي', - 'ﶱ' => 'ممي', - 'ﶲ' => 'قمي', - 'ﶳ' => 'نحي', - 'ﶴ' => 'قمح', - 'ﶵ' => 'لحم', - 'ﶶ' => 'عمي', - 'ﶷ' => 'كمي', - 'ﶸ' => 'نجح', - 'ﶹ' => 'مخي', - 'ﶺ' => 'لجم', - 'ﶻ' => 'كمم', - 'ﶼ' => 'لجم', - 'ﶽ' => 'نجح', - 'ﶾ' => 'جحي', - 'ﶿ' => 'حجي', - 'ﷀ' => 'مجي', - 'ﷁ' => 'فمي', - 'ﷂ' => 'بحي', - 'ﷃ' => 'كمم', - 'ﷄ' => 'عجم', - 'ﷅ' => 'صمم', - 'ﷆ' => 'سخي', - 'ﷇ' => 'نجي', - 'ﷰ' => 'صلے', - 'ﷱ' => 'قلے', - 'ﷲ' => 'الله', - 'ﷳ' => 'اكبر', - 'ﷴ' => 'محمد', - 'ﷵ' => 'صلعم', - 'ﷶ' => 'رسول', - 'ﷷ' => 'عليه', - 'ﷸ' => 'وسلم', - 'ﷹ' => 'صلى', - 'ﷺ' => 'صلى الله عليه وسلم', - 'ﷻ' => 'جل جلاله', - '﷼' => 'ریال', - '︐' => ',', - '︑' => '、', - '︒' => '。', - '︓' => ':', - '︔' => ';', - '︕' => '!', - '︖' => '?', - '︗' => '〖', - '︘' => '〗', - '︙' => '...', - '︰' => '..', - '︱' => '—', - '︲' => '–', - '︳' => '_', - '︴' => '_', - '︵' => '(', - '︶' => ')', - '︷' => '{', - '︸' => '}', - '︹' => '〔', - '︺' => '〕', - '︻' => '【', - '︼' => '】', - '︽' => '《', - '︾' => '》', - '︿' => '〈', - '﹀' => '〉', - '﹁' => '「', - '﹂' => '」', - '﹃' => '『', - '﹄' => '』', - '﹇' => '[', - '﹈' => ']', - '﹉' => ' ̅', - '﹊' => ' ̅', - '﹋' => ' ̅', - '﹌' => ' ̅', - '﹍' => '_', - '﹎' => '_', - '﹏' => '_', - '﹐' => ',', - '﹑' => '、', - '﹒' => '.', - '﹔' => ';', - '﹕' => ':', - '﹖' => '?', - '﹗' => '!', - '﹘' => '—', - '﹙' => '(', - '﹚' => ')', - '﹛' => '{', - '﹜' => '}', - '﹝' => '〔', - '﹞' => '〕', - '﹟' => '#', - '﹠' => '&', - '﹡' => '*', - '﹢' => '+', - '﹣' => '-', - '﹤' => '<', - '﹥' => '>', - '﹦' => '=', - '﹨' => '\\', - '﹩' => '$', - '﹪' => '%', - '﹫' => '@', - 'ﹰ' => ' ً', - 'ﹱ' => 'ـً', - 'ﹲ' => ' ٌ', - 'ﹴ' => ' ٍ', - 'ﹶ' => ' َ', - 'ﹷ' => 'ـَ', - 'ﹸ' => ' ُ', - 'ﹹ' => 'ـُ', - 'ﹺ' => ' ِ', - 'ﹻ' => 'ـِ', - 'ﹼ' => ' ّ', - 'ﹽ' => 'ـّ', - 'ﹾ' => ' ْ', - 'ﹿ' => 'ـْ', - 'ﺀ' => 'ء', - 'ﺁ' => 'آ', - 'ﺂ' => 'آ', - 'ﺃ' => 'أ', - 'ﺄ' => 'أ', - 'ﺅ' => 'ؤ', - 'ﺆ' => 'ؤ', - 'ﺇ' => 'إ', - 'ﺈ' => 'إ', - 'ﺉ' => 'ئ', - 'ﺊ' => 'ئ', - 'ﺋ' => 'ئ', - 'ﺌ' => 'ئ', - 'ﺍ' => 'ا', - 'ﺎ' => 'ا', - 'ﺏ' => 'ب', - 'ﺐ' => 'ب', - 'ﺑ' => 'ب', - 'ﺒ' => 'ب', - 'ﺓ' => 'ة', - 'ﺔ' => 'ة', - 'ﺕ' => 'ت', - 'ﺖ' => 'ت', - 'ﺗ' => 'ت', - 'ﺘ' => 'ت', - 'ﺙ' => 'ث', - 'ﺚ' => 'ث', - 'ﺛ' => 'ث', - 'ﺜ' => 'ث', - 'ﺝ' => 'ج', - 'ﺞ' => 'ج', - 'ﺟ' => 'ج', - 'ﺠ' => 'ج', - 'ﺡ' => 'ح', - 'ﺢ' => 'ح', - 'ﺣ' => 'ح', - 'ﺤ' => 'ح', - 'ﺥ' => 'خ', - 'ﺦ' => 'خ', - 'ﺧ' => 'خ', - 'ﺨ' => 'خ', - 'ﺩ' => 'د', - 'ﺪ' => 'د', - 'ﺫ' => 'ذ', - 'ﺬ' => 'ذ', - 'ﺭ' => 'ر', - 'ﺮ' => 'ر', - 'ﺯ' => 'ز', - 'ﺰ' => 'ز', - 'ﺱ' => 'س', - 'ﺲ' => 'س', - 'ﺳ' => 'س', - 'ﺴ' => 'س', - 'ﺵ' => 'ش', - 'ﺶ' => 'ش', - 'ﺷ' => 'ش', - 'ﺸ' => 'ش', - 'ﺹ' => 'ص', - 'ﺺ' => 'ص', - 'ﺻ' => 'ص', - 'ﺼ' => 'ص', - 'ﺽ' => 'ض', - 'ﺾ' => 'ض', - 'ﺿ' => 'ض', - 'ﻀ' => 'ض', - 'ﻁ' => 'ط', - 'ﻂ' => 'ط', - 'ﻃ' => 'ط', - 'ﻄ' => 'ط', - 'ﻅ' => 'ظ', - 'ﻆ' => 'ظ', - 'ﻇ' => 'ظ', - 'ﻈ' => 'ظ', - 'ﻉ' => 'ع', - 'ﻊ' => 'ع', - 'ﻋ' => 'ع', - 'ﻌ' => 'ع', - 'ﻍ' => 'غ', - 'ﻎ' => 'غ', - 'ﻏ' => 'غ', - 'ﻐ' => 'غ', - 'ﻑ' => 'ف', - 'ﻒ' => 'ف', - 'ﻓ' => 'ف', - 'ﻔ' => 'ف', - 'ﻕ' => 'ق', - 'ﻖ' => 'ق', - 'ﻗ' => 'ق', - 'ﻘ' => 'ق', - 'ﻙ' => 'ك', - 'ﻚ' => 'ك', - 'ﻛ' => 'ك', - 'ﻜ' => 'ك', - 'ﻝ' => 'ل', - 'ﻞ' => 'ل', - 'ﻟ' => 'ل', - 'ﻠ' => 'ل', - 'ﻡ' => 'م', - 'ﻢ' => 'م', - 'ﻣ' => 'م', - 'ﻤ' => 'م', - 'ﻥ' => 'ن', - 'ﻦ' => 'ن', - 'ﻧ' => 'ن', - 'ﻨ' => 'ن', - 'ﻩ' => 'ه', - 'ﻪ' => 'ه', - 'ﻫ' => 'ه', - 'ﻬ' => 'ه', - 'ﻭ' => 'و', - 'ﻮ' => 'و', - 'ﻯ' => 'ى', - 'ﻰ' => 'ى', - 'ﻱ' => 'ي', - 'ﻲ' => 'ي', - 'ﻳ' => 'ي', - 'ﻴ' => 'ي', - 'ﻵ' => 'لآ', - 'ﻶ' => 'لآ', - 'ﻷ' => 'لأ', - 'ﻸ' => 'لأ', - 'ﻹ' => 'لإ', - 'ﻺ' => 'لإ', - 'ﻻ' => 'لا', - 'ﻼ' => 'لا', - '!' => '!', - '"' => '"', - '#' => '#', - '$' => '$', - '%' => '%', - '&' => '&', - ''' => '\'', - '(' => '(', - ')' => ')', - '*' => '*', - '+' => '+', - ',' => ',', - '-' => '-', - '.' => '.', - '/' => '/', - '0' => '0', - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - '6' => '6', - '7' => '7', - '8' => '8', - '9' => '9', - ':' => ':', - ';' => ';', - '<' => '<', - '=' => '=', - '>' => '>', - '?' => '?', - '@' => '@', - 'A' => 'A', - 'B' => 'B', - 'C' => 'C', - 'D' => 'D', - 'E' => 'E', - 'F' => 'F', - 'G' => 'G', - 'H' => 'H', - 'I' => 'I', - 'J' => 'J', - 'K' => 'K', - 'L' => 'L', - 'M' => 'M', - 'N' => 'N', - 'O' => 'O', - 'P' => 'P', - 'Q' => 'Q', - 'R' => 'R', - 'S' => 'S', - 'T' => 'T', - 'U' => 'U', - 'V' => 'V', - 'W' => 'W', - 'X' => 'X', - 'Y' => 'Y', - 'Z' => 'Z', - '[' => '[', - '\' => '\\', - ']' => ']', - '^' => '^', - '_' => '_', - '`' => '`', - 'a' => 'a', - 'b' => 'b', - 'c' => 'c', - 'd' => 'd', - 'e' => 'e', - 'f' => 'f', - 'g' => 'g', - 'h' => 'h', - 'i' => 'i', - 'j' => 'j', - 'k' => 'k', - 'l' => 'l', - 'm' => 'm', - 'n' => 'n', - 'o' => 'o', - 'p' => 'p', - 'q' => 'q', - 'r' => 'r', - 's' => 's', - 't' => 't', - 'u' => 'u', - 'v' => 'v', - 'w' => 'w', - 'x' => 'x', - 'y' => 'y', - 'z' => 'z', - '{' => '{', - '|' => '|', - '}' => '}', - '~' => '~', - '⦅' => '⦅', - '⦆' => '⦆', - '。' => '。', - '「' => '「', - '」' => '」', - '、' => '、', - '・' => '・', - 'ヲ' => 'ヲ', - 'ァ' => 'ァ', - 'ィ' => 'ィ', - 'ゥ' => 'ゥ', - 'ェ' => 'ェ', - 'ォ' => 'ォ', - 'ャ' => 'ャ', - 'ュ' => 'ュ', - 'ョ' => 'ョ', - 'ッ' => 'ッ', - 'ー' => 'ー', - 'ア' => 'ア', - 'イ' => 'イ', - 'ウ' => 'ウ', - 'エ' => 'エ', - 'オ' => 'オ', - 'カ' => 'カ', - 'キ' => 'キ', - 'ク' => 'ク', - 'ケ' => 'ケ', - 'コ' => 'コ', - 'サ' => 'サ', - 'シ' => 'シ', - 'ス' => 'ス', - 'セ' => 'セ', - 'ソ' => 'ソ', - 'タ' => 'タ', - 'チ' => 'チ', - 'ツ' => 'ツ', - 'テ' => 'テ', - 'ト' => 'ト', - 'ナ' => 'ナ', - 'ニ' => 'ニ', - 'ヌ' => 'ヌ', - 'ネ' => 'ネ', - 'ノ' => 'ノ', - 'ハ' => 'ハ', - 'ヒ' => 'ヒ', - 'フ' => 'フ', - 'ヘ' => 'ヘ', - 'ホ' => 'ホ', - 'マ' => 'マ', - 'ミ' => 'ミ', - 'ム' => 'ム', - 'メ' => 'メ', - 'モ' => 'モ', - 'ヤ' => 'ヤ', - 'ユ' => 'ユ', - 'ヨ' => 'ヨ', - 'ラ' => 'ラ', - 'リ' => 'リ', - 'ル' => 'ル', - 'レ' => 'レ', - 'ロ' => 'ロ', - 'ワ' => 'ワ', - 'ン' => 'ン', - '゙' => '゙', - '゚' => '゚', - 'ᅠ' => 'ᅠ', - 'ᄀ' => 'ᄀ', - 'ᄁ' => 'ᄁ', - 'ᆪ' => 'ᆪ', - 'ᄂ' => 'ᄂ', - 'ᆬ' => 'ᆬ', - 'ᆭ' => 'ᆭ', - 'ᄃ' => 'ᄃ', - 'ᄄ' => 'ᄄ', - 'ᄅ' => 'ᄅ', - 'ᆰ' => 'ᆰ', - 'ᆱ' => 'ᆱ', - 'ᆲ' => 'ᆲ', - 'ᆳ' => 'ᆳ', - 'ᆴ' => 'ᆴ', - 'ᆵ' => 'ᆵ', - 'ᄚ' => 'ᄚ', - 'ᄆ' => 'ᄆ', - 'ᄇ' => 'ᄇ', - 'ᄈ' => 'ᄈ', - 'ᄡ' => 'ᄡ', - 'ᄉ' => 'ᄉ', - 'ᄊ' => 'ᄊ', - 'ᄋ' => 'ᄋ', - 'ᄌ' => 'ᄌ', - 'ᄍ' => 'ᄍ', - 'ᄎ' => 'ᄎ', - 'ᄏ' => 'ᄏ', - 'ᄐ' => 'ᄐ', - 'ᄑ' => 'ᄑ', - 'ᄒ' => 'ᄒ', - 'ᅡ' => 'ᅡ', - 'ᅢ' => 'ᅢ', - 'ᅣ' => 'ᅣ', - 'ᅤ' => 'ᅤ', - 'ᅥ' => 'ᅥ', - 'ᅦ' => 'ᅦ', - 'ᅧ' => 'ᅧ', - 'ᅨ' => 'ᅨ', - 'ᅩ' => 'ᅩ', - 'ᅪ' => 'ᅪ', - 'ᅫ' => 'ᅫ', - 'ᅬ' => 'ᅬ', - 'ᅭ' => 'ᅭ', - 'ᅮ' => 'ᅮ', - 'ᅯ' => 'ᅯ', - 'ᅰ' => 'ᅰ', - 'ᅱ' => 'ᅱ', - 'ᅲ' => 'ᅲ', - 'ᅳ' => 'ᅳ', - 'ᅴ' => 'ᅴ', - 'ᅵ' => 'ᅵ', - '¢' => '¢', - '£' => '£', - '¬' => '¬', - ' ̄' => ' ̄', - '¦' => '¦', - '¥' => '¥', - '₩' => '₩', - '│' => '│', - '←' => '←', - '↑' => '↑', - '→' => '→', - '↓' => '↓', - '■' => '■', - '○' => '○', - '𝐀' => 'A', - '𝐁' => 'B', - '𝐂' => 'C', - '𝐃' => 'D', - '𝐄' => 'E', - '𝐅' => 'F', - '𝐆' => 'G', - '𝐇' => 'H', - '𝐈' => 'I', - '𝐉' => 'J', - '𝐊' => 'K', - '𝐋' => 'L', - '𝐌' => 'M', - '𝐍' => 'N', - '𝐎' => 'O', - '𝐏' => 'P', - '𝐐' => 'Q', - '𝐑' => 'R', - '𝐒' => 'S', - '𝐓' => 'T', - '𝐔' => 'U', - '𝐕' => 'V', - '𝐖' => 'W', - '𝐗' => 'X', - '𝐘' => 'Y', - '𝐙' => 'Z', - '𝐚' => 'a', - '𝐛' => 'b', - '𝐜' => 'c', - '𝐝' => 'd', - '𝐞' => 'e', - '𝐟' => 'f', - '𝐠' => 'g', - '𝐡' => 'h', - '𝐢' => 'i', - '𝐣' => 'j', - '𝐤' => 'k', - '𝐥' => 'l', - '𝐦' => 'm', - '𝐧' => 'n', - '𝐨' => 'o', - '𝐩' => 'p', - '𝐪' => 'q', - '𝐫' => 'r', - '𝐬' => 's', - '𝐭' => 't', - '𝐮' => 'u', - '𝐯' => 'v', - '𝐰' => 'w', - '𝐱' => 'x', - '𝐲' => 'y', - '𝐳' => 'z', - '𝐴' => 'A', - '𝐵' => 'B', - '𝐶' => 'C', - '𝐷' => 'D', - '𝐸' => 'E', - '𝐹' => 'F', - '𝐺' => 'G', - '𝐻' => 'H', - '𝐼' => 'I', - '𝐽' => 'J', - '𝐾' => 'K', - '𝐿' => 'L', - '𝑀' => 'M', - '𝑁' => 'N', - '𝑂' => 'O', - '𝑃' => 'P', - '𝑄' => 'Q', - '𝑅' => 'R', - '𝑆' => 'S', - '𝑇' => 'T', - '𝑈' => 'U', - '𝑉' => 'V', - '𝑊' => 'W', - '𝑋' => 'X', - '𝑌' => 'Y', - '𝑍' => 'Z', - '𝑎' => 'a', - '𝑏' => 'b', - '𝑐' => 'c', - '𝑑' => 'd', - '𝑒' => 'e', - '𝑓' => 'f', - '𝑔' => 'g', - '𝑖' => 'i', - '𝑗' => 'j', - '𝑘' => 'k', - '𝑙' => 'l', - '𝑚' => 'm', - '𝑛' => 'n', - '𝑜' => 'o', - '𝑝' => 'p', - '𝑞' => 'q', - '𝑟' => 'r', - '𝑠' => 's', - '𝑡' => 't', - '𝑢' => 'u', - '𝑣' => 'v', - '𝑤' => 'w', - '𝑥' => 'x', - '𝑦' => 'y', - '𝑧' => 'z', - '𝑨' => 'A', - '𝑩' => 'B', - '𝑪' => 'C', - '𝑫' => 'D', - '𝑬' => 'E', - '𝑭' => 'F', - '𝑮' => 'G', - '𝑯' => 'H', - '𝑰' => 'I', - '𝑱' => 'J', - '𝑲' => 'K', - '𝑳' => 'L', - '𝑴' => 'M', - '𝑵' => 'N', - '𝑶' => 'O', - '𝑷' => 'P', - '𝑸' => 'Q', - '𝑹' => 'R', - '𝑺' => 'S', - '𝑻' => 'T', - '𝑼' => 'U', - '𝑽' => 'V', - '𝑾' => 'W', - '𝑿' => 'X', - '𝒀' => 'Y', - '𝒁' => 'Z', - '𝒂' => 'a', - '𝒃' => 'b', - '𝒄' => 'c', - '𝒅' => 'd', - '𝒆' => 'e', - '𝒇' => 'f', - '𝒈' => 'g', - '𝒉' => 'h', - '𝒊' => 'i', - '𝒋' => 'j', - '𝒌' => 'k', - '𝒍' => 'l', - '𝒎' => 'm', - '𝒏' => 'n', - '𝒐' => 'o', - '𝒑' => 'p', - '𝒒' => 'q', - '𝒓' => 'r', - '𝒔' => 's', - '𝒕' => 't', - '𝒖' => 'u', - '𝒗' => 'v', - '𝒘' => 'w', - '𝒙' => 'x', - '𝒚' => 'y', - '𝒛' => 'z', - '𝒜' => 'A', - '𝒞' => 'C', - '𝒟' => 'D', - '𝒢' => 'G', - '𝒥' => 'J', - '𝒦' => 'K', - '𝒩' => 'N', - '𝒪' => 'O', - '𝒫' => 'P', - '𝒬' => 'Q', - '𝒮' => 'S', - '𝒯' => 'T', - '𝒰' => 'U', - '𝒱' => 'V', - '𝒲' => 'W', - '𝒳' => 'X', - '𝒴' => 'Y', - '𝒵' => 'Z', - '𝒶' => 'a', - '𝒷' => 'b', - '𝒸' => 'c', - '𝒹' => 'd', - '𝒻' => 'f', - '𝒽' => 'h', - '𝒾' => 'i', - '𝒿' => 'j', - '𝓀' => 'k', - '𝓁' => 'l', - '𝓂' => 'm', - '𝓃' => 'n', - '𝓅' => 'p', - '𝓆' => 'q', - '𝓇' => 'r', - '𝓈' => 's', - '𝓉' => 't', - '𝓊' => 'u', - '𝓋' => 'v', - '𝓌' => 'w', - '𝓍' => 'x', - '𝓎' => 'y', - '𝓏' => 'z', - '𝓐' => 'A', - '𝓑' => 'B', - '𝓒' => 'C', - '𝓓' => 'D', - '𝓔' => 'E', - '𝓕' => 'F', - '𝓖' => 'G', - '𝓗' => 'H', - '𝓘' => 'I', - '𝓙' => 'J', - '𝓚' => 'K', - '𝓛' => 'L', - '𝓜' => 'M', - '𝓝' => 'N', - '𝓞' => 'O', - '𝓟' => 'P', - '𝓠' => 'Q', - '𝓡' => 'R', - '𝓢' => 'S', - '𝓣' => 'T', - '𝓤' => 'U', - '𝓥' => 'V', - '𝓦' => 'W', - '𝓧' => 'X', - '𝓨' => 'Y', - '𝓩' => 'Z', - '𝓪' => 'a', - '𝓫' => 'b', - '𝓬' => 'c', - '𝓭' => 'd', - '𝓮' => 'e', - '𝓯' => 'f', - '𝓰' => 'g', - '𝓱' => 'h', - '𝓲' => 'i', - '𝓳' => 'j', - '𝓴' => 'k', - '𝓵' => 'l', - '𝓶' => 'm', - '𝓷' => 'n', - '𝓸' => 'o', - '𝓹' => 'p', - '𝓺' => 'q', - '𝓻' => 'r', - '𝓼' => 's', - '𝓽' => 't', - '𝓾' => 'u', - '𝓿' => 'v', - '𝔀' => 'w', - '𝔁' => 'x', - '𝔂' => 'y', - '𝔃' => 'z', - '𝔄' => 'A', - '𝔅' => 'B', - '𝔇' => 'D', - '𝔈' => 'E', - '𝔉' => 'F', - '𝔊' => 'G', - '𝔍' => 'J', - '𝔎' => 'K', - '𝔏' => 'L', - '𝔐' => 'M', - '𝔑' => 'N', - '𝔒' => 'O', - '𝔓' => 'P', - '𝔔' => 'Q', - '𝔖' => 'S', - '𝔗' => 'T', - '𝔘' => 'U', - '𝔙' => 'V', - '𝔚' => 'W', - '𝔛' => 'X', - '𝔜' => 'Y', - '𝔞' => 'a', - '𝔟' => 'b', - '𝔠' => 'c', - '𝔡' => 'd', - '𝔢' => 'e', - '𝔣' => 'f', - '𝔤' => 'g', - '𝔥' => 'h', - '𝔦' => 'i', - '𝔧' => 'j', - '𝔨' => 'k', - '𝔩' => 'l', - '𝔪' => 'm', - '𝔫' => 'n', - '𝔬' => 'o', - '𝔭' => 'p', - '𝔮' => 'q', - '𝔯' => 'r', - '𝔰' => 's', - '𝔱' => 't', - '𝔲' => 'u', - '𝔳' => 'v', - '𝔴' => 'w', - '𝔵' => 'x', - '𝔶' => 'y', - '𝔷' => 'z', - '𝔸' => 'A', - '𝔹' => 'B', - '𝔻' => 'D', - '𝔼' => 'E', - '𝔽' => 'F', - '𝔾' => 'G', - '𝕀' => 'I', - '𝕁' => 'J', - '𝕂' => 'K', - '𝕃' => 'L', - '𝕄' => 'M', - '𝕆' => 'O', - '𝕊' => 'S', - '𝕋' => 'T', - '𝕌' => 'U', - '𝕍' => 'V', - '𝕎' => 'W', - '𝕏' => 'X', - '𝕐' => 'Y', - '𝕒' => 'a', - '𝕓' => 'b', - '𝕔' => 'c', - '𝕕' => 'd', - '𝕖' => 'e', - '𝕗' => 'f', - '𝕘' => 'g', - '𝕙' => 'h', - '𝕚' => 'i', - '𝕛' => 'j', - '𝕜' => 'k', - '𝕝' => 'l', - '𝕞' => 'm', - '𝕟' => 'n', - '𝕠' => 'o', - '𝕡' => 'p', - '𝕢' => 'q', - '𝕣' => 'r', - '𝕤' => 's', - '𝕥' => 't', - '𝕦' => 'u', - '𝕧' => 'v', - '𝕨' => 'w', - '𝕩' => 'x', - '𝕪' => 'y', - '𝕫' => 'z', - '𝕬' => 'A', - '𝕭' => 'B', - '𝕮' => 'C', - '𝕯' => 'D', - '𝕰' => 'E', - '𝕱' => 'F', - '𝕲' => 'G', - '𝕳' => 'H', - '𝕴' => 'I', - '𝕵' => 'J', - '𝕶' => 'K', - '𝕷' => 'L', - '𝕸' => 'M', - '𝕹' => 'N', - '𝕺' => 'O', - '𝕻' => 'P', - '𝕼' => 'Q', - '𝕽' => 'R', - '𝕾' => 'S', - '𝕿' => 'T', - '𝖀' => 'U', - '𝖁' => 'V', - '𝖂' => 'W', - '𝖃' => 'X', - '𝖄' => 'Y', - '𝖅' => 'Z', - '𝖆' => 'a', - '𝖇' => 'b', - '𝖈' => 'c', - '𝖉' => 'd', - '𝖊' => 'e', - '𝖋' => 'f', - '𝖌' => 'g', - '𝖍' => 'h', - '𝖎' => 'i', - '𝖏' => 'j', - '𝖐' => 'k', - '𝖑' => 'l', - '𝖒' => 'm', - '𝖓' => 'n', - '𝖔' => 'o', - '𝖕' => 'p', - '𝖖' => 'q', - '𝖗' => 'r', - '𝖘' => 's', - '𝖙' => 't', - '𝖚' => 'u', - '𝖛' => 'v', - '𝖜' => 'w', - '𝖝' => 'x', - '𝖞' => 'y', - '𝖟' => 'z', - '𝖠' => 'A', - '𝖡' => 'B', - '𝖢' => 'C', - '𝖣' => 'D', - '𝖤' => 'E', - '𝖥' => 'F', - '𝖦' => 'G', - '𝖧' => 'H', - '𝖨' => 'I', - '𝖩' => 'J', - '𝖪' => 'K', - '𝖫' => 'L', - '𝖬' => 'M', - '𝖭' => 'N', - '𝖮' => 'O', - '𝖯' => 'P', - '𝖰' => 'Q', - '𝖱' => 'R', - '𝖲' => 'S', - '𝖳' => 'T', - '𝖴' => 'U', - '𝖵' => 'V', - '𝖶' => 'W', - '𝖷' => 'X', - '𝖸' => 'Y', - '𝖹' => 'Z', - '𝖺' => 'a', - '𝖻' => 'b', - '𝖼' => 'c', - '𝖽' => 'd', - '𝖾' => 'e', - '𝖿' => 'f', - '𝗀' => 'g', - '𝗁' => 'h', - '𝗂' => 'i', - '𝗃' => 'j', - '𝗄' => 'k', - '𝗅' => 'l', - '𝗆' => 'm', - '𝗇' => 'n', - '𝗈' => 'o', - '𝗉' => 'p', - '𝗊' => 'q', - '𝗋' => 'r', - '𝗌' => 's', - '𝗍' => 't', - '𝗎' => 'u', - '𝗏' => 'v', - '𝗐' => 'w', - '𝗑' => 'x', - '𝗒' => 'y', - '𝗓' => 'z', - '𝗔' => 'A', - '𝗕' => 'B', - '𝗖' => 'C', - '𝗗' => 'D', - '𝗘' => 'E', - '𝗙' => 'F', - '𝗚' => 'G', - '𝗛' => 'H', - '𝗜' => 'I', - '𝗝' => 'J', - '𝗞' => 'K', - '𝗟' => 'L', - '𝗠' => 'M', - '𝗡' => 'N', - '𝗢' => 'O', - '𝗣' => 'P', - '𝗤' => 'Q', - '𝗥' => 'R', - '𝗦' => 'S', - '𝗧' => 'T', - '𝗨' => 'U', - '𝗩' => 'V', - '𝗪' => 'W', - '𝗫' => 'X', - '𝗬' => 'Y', - '𝗭' => 'Z', - '𝗮' => 'a', - '𝗯' => 'b', - '𝗰' => 'c', - '𝗱' => 'd', - '𝗲' => 'e', - '𝗳' => 'f', - '𝗴' => 'g', - '𝗵' => 'h', - '𝗶' => 'i', - '𝗷' => 'j', - '𝗸' => 'k', - '𝗹' => 'l', - '𝗺' => 'm', - '𝗻' => 'n', - '𝗼' => 'o', - '𝗽' => 'p', - '𝗾' => 'q', - '𝗿' => 'r', - '𝘀' => 's', - '𝘁' => 't', - '𝘂' => 'u', - '𝘃' => 'v', - '𝘄' => 'w', - '𝘅' => 'x', - '𝘆' => 'y', - '𝘇' => 'z', - '𝘈' => 'A', - '𝘉' => 'B', - '𝘊' => 'C', - '𝘋' => 'D', - '𝘌' => 'E', - '𝘍' => 'F', - '𝘎' => 'G', - '𝘏' => 'H', - '𝘐' => 'I', - '𝘑' => 'J', - '𝘒' => 'K', - '𝘓' => 'L', - '𝘔' => 'M', - '𝘕' => 'N', - '𝘖' => 'O', - '𝘗' => 'P', - '𝘘' => 'Q', - '𝘙' => 'R', - '𝘚' => 'S', - '𝘛' => 'T', - '𝘜' => 'U', - '𝘝' => 'V', - '𝘞' => 'W', - '𝘟' => 'X', - '𝘠' => 'Y', - '𝘡' => 'Z', - '𝘢' => 'a', - '𝘣' => 'b', - '𝘤' => 'c', - '𝘥' => 'd', - '𝘦' => 'e', - '𝘧' => 'f', - '𝘨' => 'g', - '𝘩' => 'h', - '𝘪' => 'i', - '𝘫' => 'j', - '𝘬' => 'k', - '𝘭' => 'l', - '𝘮' => 'm', - '𝘯' => 'n', - '𝘰' => 'o', - '𝘱' => 'p', - '𝘲' => 'q', - '𝘳' => 'r', - '𝘴' => 's', - '𝘵' => 't', - '𝘶' => 'u', - '𝘷' => 'v', - '𝘸' => 'w', - '𝘹' => 'x', - '𝘺' => 'y', - '𝘻' => 'z', - '𝘼' => 'A', - '𝘽' => 'B', - '𝘾' => 'C', - '𝘿' => 'D', - '𝙀' => 'E', - '𝙁' => 'F', - '𝙂' => 'G', - '𝙃' => 'H', - '𝙄' => 'I', - '𝙅' => 'J', - '𝙆' => 'K', - '𝙇' => 'L', - '𝙈' => 'M', - '𝙉' => 'N', - '𝙊' => 'O', - '𝙋' => 'P', - '𝙌' => 'Q', - '𝙍' => 'R', - '𝙎' => 'S', - '𝙏' => 'T', - '𝙐' => 'U', - '𝙑' => 'V', - '𝙒' => 'W', - '𝙓' => 'X', - '𝙔' => 'Y', - '𝙕' => 'Z', - '𝙖' => 'a', - '𝙗' => 'b', - '𝙘' => 'c', - '𝙙' => 'd', - '𝙚' => 'e', - '𝙛' => 'f', - '𝙜' => 'g', - '𝙝' => 'h', - '𝙞' => 'i', - '𝙟' => 'j', - '𝙠' => 'k', - '𝙡' => 'l', - '𝙢' => 'm', - '𝙣' => 'n', - '𝙤' => 'o', - '𝙥' => 'p', - '𝙦' => 'q', - '𝙧' => 'r', - '𝙨' => 's', - '𝙩' => 't', - '𝙪' => 'u', - '𝙫' => 'v', - '𝙬' => 'w', - '𝙭' => 'x', - '𝙮' => 'y', - '𝙯' => 'z', - '𝙰' => 'A', - '𝙱' => 'B', - '𝙲' => 'C', - '𝙳' => 'D', - '𝙴' => 'E', - '𝙵' => 'F', - '𝙶' => 'G', - '𝙷' => 'H', - '𝙸' => 'I', - '𝙹' => 'J', - '𝙺' => 'K', - '𝙻' => 'L', - '𝙼' => 'M', - '𝙽' => 'N', - '𝙾' => 'O', - '𝙿' => 'P', - '𝚀' => 'Q', - '𝚁' => 'R', - '𝚂' => 'S', - '𝚃' => 'T', - '𝚄' => 'U', - '𝚅' => 'V', - '𝚆' => 'W', - '𝚇' => 'X', - '𝚈' => 'Y', - '𝚉' => 'Z', - '𝚊' => 'a', - '𝚋' => 'b', - '𝚌' => 'c', - '𝚍' => 'd', - '𝚎' => 'e', - '𝚏' => 'f', - '𝚐' => 'g', - '𝚑' => 'h', - '𝚒' => 'i', - '𝚓' => 'j', - '𝚔' => 'k', - '𝚕' => 'l', - '𝚖' => 'm', - '𝚗' => 'n', - '𝚘' => 'o', - '𝚙' => 'p', - '𝚚' => 'q', - '𝚛' => 'r', - '𝚜' => 's', - '𝚝' => 't', - '𝚞' => 'u', - '𝚟' => 'v', - '𝚠' => 'w', - '𝚡' => 'x', - '𝚢' => 'y', - '𝚣' => 'z', - '𝚤' => 'ı', - '𝚥' => 'ȷ', - '𝚨' => 'Α', - '𝚩' => 'Β', - '𝚪' => 'Γ', - '𝚫' => 'Δ', - '𝚬' => 'Ε', - '𝚭' => 'Ζ', - '𝚮' => 'Η', - '𝚯' => 'Θ', - '𝚰' => 'Ι', - '𝚱' => 'Κ', - '𝚲' => 'Λ', - '𝚳' => 'Μ', - '𝚴' => 'Ν', - '𝚵' => 'Ξ', - '𝚶' => 'Ο', - '𝚷' => 'Π', - '𝚸' => 'Ρ', - '𝚹' => 'Θ', - '𝚺' => 'Σ', - '𝚻' => 'Τ', - '𝚼' => 'Υ', - '𝚽' => 'Φ', - '𝚾' => 'Χ', - '𝚿' => 'Ψ', - '𝛀' => 'Ω', - '𝛁' => '∇', - '𝛂' => 'α', - '𝛃' => 'β', - '𝛄' => 'γ', - '𝛅' => 'δ', - '𝛆' => 'ε', - '𝛇' => 'ζ', - '𝛈' => 'η', - '𝛉' => 'θ', - '𝛊' => 'ι', - '𝛋' => 'κ', - '𝛌' => 'λ', - '𝛍' => 'μ', - '𝛎' => 'ν', - '𝛏' => 'ξ', - '𝛐' => 'ο', - '𝛑' => 'π', - '𝛒' => 'ρ', - '𝛓' => 'ς', - '𝛔' => 'σ', - '𝛕' => 'τ', - '𝛖' => 'υ', - '𝛗' => 'φ', - '𝛘' => 'χ', - '𝛙' => 'ψ', - '𝛚' => 'ω', - '𝛛' => '∂', - '𝛜' => 'ε', - '𝛝' => 'θ', - '𝛞' => 'κ', - '𝛟' => 'φ', - '𝛠' => 'ρ', - '𝛡' => 'π', - '𝛢' => 'Α', - '𝛣' => 'Β', - '𝛤' => 'Γ', - '𝛥' => 'Δ', - '𝛦' => 'Ε', - '𝛧' => 'Ζ', - '𝛨' => 'Η', - '𝛩' => 'Θ', - '𝛪' => 'Ι', - '𝛫' => 'Κ', - '𝛬' => 'Λ', - '𝛭' => 'Μ', - '𝛮' => 'Ν', - '𝛯' => 'Ξ', - '𝛰' => 'Ο', - '𝛱' => 'Π', - '𝛲' => 'Ρ', - '𝛳' => 'Θ', - '𝛴' => 'Σ', - '𝛵' => 'Τ', - '𝛶' => 'Υ', - '𝛷' => 'Φ', - '𝛸' => 'Χ', - '𝛹' => 'Ψ', - '𝛺' => 'Ω', - '𝛻' => '∇', - '𝛼' => 'α', - '𝛽' => 'β', - '𝛾' => 'γ', - '𝛿' => 'δ', - '𝜀' => 'ε', - '𝜁' => 'ζ', - '𝜂' => 'η', - '𝜃' => 'θ', - '𝜄' => 'ι', - '𝜅' => 'κ', - '𝜆' => 'λ', - '𝜇' => 'μ', - '𝜈' => 'ν', - '𝜉' => 'ξ', - '𝜊' => 'ο', - '𝜋' => 'π', - '𝜌' => 'ρ', - '𝜍' => 'ς', - '𝜎' => 'σ', - '𝜏' => 'τ', - '𝜐' => 'υ', - '𝜑' => 'φ', - '𝜒' => 'χ', - '𝜓' => 'ψ', - '𝜔' => 'ω', - '𝜕' => '∂', - '𝜖' => 'ε', - '𝜗' => 'θ', - '𝜘' => 'κ', - '𝜙' => 'φ', - '𝜚' => 'ρ', - '𝜛' => 'π', - '𝜜' => 'Α', - '𝜝' => 'Β', - '𝜞' => 'Γ', - '𝜟' => 'Δ', - '𝜠' => 'Ε', - '𝜡' => 'Ζ', - '𝜢' => 'Η', - '𝜣' => 'Θ', - '𝜤' => 'Ι', - '𝜥' => 'Κ', - '𝜦' => 'Λ', - '𝜧' => 'Μ', - '𝜨' => 'Ν', - '𝜩' => 'Ξ', - '𝜪' => 'Ο', - '𝜫' => 'Π', - '𝜬' => 'Ρ', - '𝜭' => 'Θ', - '𝜮' => 'Σ', - '𝜯' => 'Τ', - '𝜰' => 'Υ', - '𝜱' => 'Φ', - '𝜲' => 'Χ', - '𝜳' => 'Ψ', - '𝜴' => 'Ω', - '𝜵' => '∇', - '𝜶' => 'α', - '𝜷' => 'β', - '𝜸' => 'γ', - '𝜹' => 'δ', - '𝜺' => 'ε', - '𝜻' => 'ζ', - '𝜼' => 'η', - '𝜽' => 'θ', - '𝜾' => 'ι', - '𝜿' => 'κ', - '𝝀' => 'λ', - '𝝁' => 'μ', - '𝝂' => 'ν', - '𝝃' => 'ξ', - '𝝄' => 'ο', - '𝝅' => 'π', - '𝝆' => 'ρ', - '𝝇' => 'ς', - '𝝈' => 'σ', - '𝝉' => 'τ', - '𝝊' => 'υ', - '𝝋' => 'φ', - '𝝌' => 'χ', - '𝝍' => 'ψ', - '𝝎' => 'ω', - '𝝏' => '∂', - '𝝐' => 'ε', - '𝝑' => 'θ', - '𝝒' => 'κ', - '𝝓' => 'φ', - '𝝔' => 'ρ', - '𝝕' => 'π', - '𝝖' => 'Α', - '𝝗' => 'Β', - '𝝘' => 'Γ', - '𝝙' => 'Δ', - '𝝚' => 'Ε', - '𝝛' => 'Ζ', - '𝝜' => 'Η', - '𝝝' => 'Θ', - '𝝞' => 'Ι', - '𝝟' => 'Κ', - '𝝠' => 'Λ', - '𝝡' => 'Μ', - '𝝢' => 'Ν', - '𝝣' => 'Ξ', - '𝝤' => 'Ο', - '𝝥' => 'Π', - '𝝦' => 'Ρ', - '𝝧' => 'Θ', - '𝝨' => 'Σ', - '𝝩' => 'Τ', - '𝝪' => 'Υ', - '𝝫' => 'Φ', - '𝝬' => 'Χ', - '𝝭' => 'Ψ', - '𝝮' => 'Ω', - '𝝯' => '∇', - '𝝰' => 'α', - '𝝱' => 'β', - '𝝲' => 'γ', - '𝝳' => 'δ', - '𝝴' => 'ε', - '𝝵' => 'ζ', - '𝝶' => 'η', - '𝝷' => 'θ', - '𝝸' => 'ι', - '𝝹' => 'κ', - '𝝺' => 'λ', - '𝝻' => 'μ', - '𝝼' => 'ν', - '𝝽' => 'ξ', - '𝝾' => 'ο', - '𝝿' => 'π', - '𝞀' => 'ρ', - '𝞁' => 'ς', - '𝞂' => 'σ', - '𝞃' => 'τ', - '𝞄' => 'υ', - '𝞅' => 'φ', - '𝞆' => 'χ', - '𝞇' => 'ψ', - '𝞈' => 'ω', - '𝞉' => '∂', - '𝞊' => 'ε', - '𝞋' => 'θ', - '𝞌' => 'κ', - '𝞍' => 'φ', - '𝞎' => 'ρ', - '𝞏' => 'π', - '𝞐' => 'Α', - '𝞑' => 'Β', - '𝞒' => 'Γ', - '𝞓' => 'Δ', - '𝞔' => 'Ε', - '𝞕' => 'Ζ', - '𝞖' => 'Η', - '𝞗' => 'Θ', - '𝞘' => 'Ι', - '𝞙' => 'Κ', - '𝞚' => 'Λ', - '𝞛' => 'Μ', - '𝞜' => 'Ν', - '𝞝' => 'Ξ', - '𝞞' => 'Ο', - '𝞟' => 'Π', - '𝞠' => 'Ρ', - '𝞡' => 'Θ', - '𝞢' => 'Σ', - '𝞣' => 'Τ', - '𝞤' => 'Υ', - '𝞥' => 'Φ', - '𝞦' => 'Χ', - '𝞧' => 'Ψ', - '𝞨' => 'Ω', - '𝞩' => '∇', - '𝞪' => 'α', - '𝞫' => 'β', - '𝞬' => 'γ', - '𝞭' => 'δ', - '𝞮' => 'ε', - '𝞯' => 'ζ', - '𝞰' => 'η', - '𝞱' => 'θ', - '𝞲' => 'ι', - '𝞳' => 'κ', - '𝞴' => 'λ', - '𝞵' => 'μ', - '𝞶' => 'ν', - '𝞷' => 'ξ', - '𝞸' => 'ο', - '𝞹' => 'π', - '𝞺' => 'ρ', - '𝞻' => 'ς', - '𝞼' => 'σ', - '𝞽' => 'τ', - '𝞾' => 'υ', - '𝞿' => 'φ', - '𝟀' => 'χ', - '𝟁' => 'ψ', - '𝟂' => 'ω', - '𝟃' => '∂', - '𝟄' => 'ε', - '𝟅' => 'θ', - '𝟆' => 'κ', - '𝟇' => 'φ', - '𝟈' => 'ρ', - '𝟉' => 'π', - '𝟊' => 'Ϝ', - '𝟋' => 'ϝ', - '𝟎' => '0', - '𝟏' => '1', - '𝟐' => '2', - '𝟑' => '3', - '𝟒' => '4', - '𝟓' => '5', - '𝟔' => '6', - '𝟕' => '7', - '𝟖' => '8', - '𝟗' => '9', - '𝟘' => '0', - '𝟙' => '1', - '𝟚' => '2', - '𝟛' => '3', - '𝟜' => '4', - '𝟝' => '5', - '𝟞' => '6', - '𝟟' => '7', - '𝟠' => '8', - '𝟡' => '9', - '𝟢' => '0', - '𝟣' => '1', - '𝟤' => '2', - '𝟥' => '3', - '𝟦' => '4', - '𝟧' => '5', - '𝟨' => '6', - '𝟩' => '7', - '𝟪' => '8', - '𝟫' => '9', - '𝟬' => '0', - '𝟭' => '1', - '𝟮' => '2', - '𝟯' => '3', - '𝟰' => '4', - '𝟱' => '5', - '𝟲' => '6', - '𝟳' => '7', - '𝟴' => '8', - '𝟵' => '9', - '𝟶' => '0', - '𝟷' => '1', - '𝟸' => '2', - '𝟹' => '3', - '𝟺' => '4', - '𝟻' => '5', - '𝟼' => '6', - '𝟽' => '7', - '𝟾' => '8', - '𝟿' => '9', - '𞸀' => 'ا', - '𞸁' => 'ب', - '𞸂' => 'ج', - '𞸃' => 'د', - '𞸅' => 'و', - '𞸆' => 'ز', - '𞸇' => 'ح', - '𞸈' => 'ط', - '𞸉' => 'ي', - '𞸊' => 'ك', - '𞸋' => 'ل', - '𞸌' => 'م', - '𞸍' => 'ن', - '𞸎' => 'س', - '𞸏' => 'ع', - '𞸐' => 'ف', - '𞸑' => 'ص', - '𞸒' => 'ق', - '𞸓' => 'ر', - '𞸔' => 'ش', - '𞸕' => 'ت', - '𞸖' => 'ث', - '𞸗' => 'خ', - '𞸘' => 'ذ', - '𞸙' => 'ض', - '𞸚' => 'ظ', - '𞸛' => 'غ', - '𞸜' => 'ٮ', - '𞸝' => 'ں', - '𞸞' => 'ڡ', - '𞸟' => 'ٯ', - '𞸡' => 'ب', - '𞸢' => 'ج', - '𞸤' => 'ه', - '𞸧' => 'ح', - '𞸩' => 'ي', - '𞸪' => 'ك', - '𞸫' => 'ل', - '𞸬' => 'م', - '𞸭' => 'ن', - '𞸮' => 'س', - '𞸯' => 'ع', - '𞸰' => 'ف', - '𞸱' => 'ص', - '𞸲' => 'ق', - '𞸴' => 'ش', - '𞸵' => 'ت', - '𞸶' => 'ث', - '𞸷' => 'خ', - '𞸹' => 'ض', - '𞸻' => 'غ', - '𞹂' => 'ج', - '𞹇' => 'ح', - '𞹉' => 'ي', - '𞹋' => 'ل', - '𞹍' => 'ن', - '𞹎' => 'س', - '𞹏' => 'ع', - '𞹑' => 'ص', - '𞹒' => 'ق', - '𞹔' => 'ش', - '𞹗' => 'خ', - '𞹙' => 'ض', - '𞹛' => 'غ', - '𞹝' => 'ں', - '𞹟' => 'ٯ', - '𞹡' => 'ب', - '𞹢' => 'ج', - '𞹤' => 'ه', - '𞹧' => 'ح', - '𞹨' => 'ط', - '𞹩' => 'ي', - '𞹪' => 'ك', - '𞹬' => 'م', - '𞹭' => 'ن', - '𞹮' => 'س', - '𞹯' => 'ع', - '𞹰' => 'ف', - '𞹱' => 'ص', - '𞹲' => 'ق', - '𞹴' => 'ش', - '𞹵' => 'ت', - '𞹶' => 'ث', - '𞹷' => 'خ', - '𞹹' => 'ض', - '𞹺' => 'ظ', - '𞹻' => 'غ', - '𞹼' => 'ٮ', - '𞹾' => 'ڡ', - '𞺀' => 'ا', - '𞺁' => 'ب', - '𞺂' => 'ج', - '𞺃' => 'د', - '𞺄' => 'ه', - '𞺅' => 'و', - '𞺆' => 'ز', - '𞺇' => 'ح', - '𞺈' => 'ط', - '𞺉' => 'ي', - '𞺋' => 'ل', - '𞺌' => 'م', - '𞺍' => 'ن', - '𞺎' => 'س', - '𞺏' => 'ع', - '𞺐' => 'ف', - '𞺑' => 'ص', - '𞺒' => 'ق', - '𞺓' => 'ر', - '𞺔' => 'ش', - '𞺕' => 'ت', - '𞺖' => 'ث', - '𞺗' => 'خ', - '𞺘' => 'ذ', - '𞺙' => 'ض', - '𞺚' => 'ظ', - '𞺛' => 'غ', - '𞺡' => 'ب', - '𞺢' => 'ج', - '𞺣' => 'د', - '𞺥' => 'و', - '𞺦' => 'ز', - '𞺧' => 'ح', - '𞺨' => 'ط', - '𞺩' => 'ي', - '𞺫' => 'ل', - '𞺬' => 'م', - '𞺭' => 'ن', - '𞺮' => 'س', - '𞺯' => 'ع', - '𞺰' => 'ف', - '𞺱' => 'ص', - '𞺲' => 'ق', - '𞺳' => 'ر', - '𞺴' => 'ش', - '𞺵' => 'ت', - '𞺶' => 'ث', - '𞺷' => 'خ', - '𞺸' => 'ذ', - '𞺹' => 'ض', - '𞺺' => 'ظ', - '𞺻' => 'غ', - '🄀' => '0.', - '🄁' => '0,', - '🄂' => '1,', - '🄃' => '2,', - '🄄' => '3,', - '🄅' => '4,', - '🄆' => '5,', - '🄇' => '6,', - '🄈' => '7,', - '🄉' => '8,', - '🄊' => '9,', - '🄐' => '(A)', - '🄑' => '(B)', - '🄒' => '(C)', - '🄓' => '(D)', - '🄔' => '(E)', - '🄕' => '(F)', - '🄖' => '(G)', - '🄗' => '(H)', - '🄘' => '(I)', - '🄙' => '(J)', - '🄚' => '(K)', - '🄛' => '(L)', - '🄜' => '(M)', - '🄝' => '(N)', - '🄞' => '(O)', - '🄟' => '(P)', - '🄠' => '(Q)', - '🄡' => '(R)', - '🄢' => '(S)', - '🄣' => '(T)', - '🄤' => '(U)', - '🄥' => '(V)', - '🄦' => '(W)', - '🄧' => '(X)', - '🄨' => '(Y)', - '🄩' => '(Z)', - '🄪' => '〔S〕', - '🄫' => 'C', - '🄬' => 'R', - '🄭' => 'CD', - '🄮' => 'WZ', - '🄰' => 'A', - '🄱' => 'B', - '🄲' => 'C', - '🄳' => 'D', - '🄴' => 'E', - '🄵' => 'F', - '🄶' => 'G', - '🄷' => 'H', - '🄸' => 'I', - '🄹' => 'J', - '🄺' => 'K', - '🄻' => 'L', - '🄼' => 'M', - '🄽' => 'N', - '🄾' => 'O', - '🄿' => 'P', - '🅀' => 'Q', - '🅁' => 'R', - '🅂' => 'S', - '🅃' => 'T', - '🅄' => 'U', - '🅅' => 'V', - '🅆' => 'W', - '🅇' => 'X', - '🅈' => 'Y', - '🅉' => 'Z', - '🅊' => 'HV', - '🅋' => 'MV', - '🅌' => 'SD', - '🅍' => 'SS', - '🅎' => 'PPV', - '🅏' => 'WC', - '🅪' => 'MC', - '🅫' => 'MD', - '🅬' => 'MR', - '🆐' => 'DJ', - '🈀' => 'ほか', - '🈁' => 'ココ', - '🈂' => 'サ', - '🈐' => '手', - '🈑' => '字', - '🈒' => '双', - '🈓' => 'デ', - '🈔' => '二', - '🈕' => '多', - '🈖' => '解', - '🈗' => '天', - '🈘' => '交', - '🈙' => '映', - '🈚' => '無', - '🈛' => '料', - '🈜' => '前', - '🈝' => '後', - '🈞' => '再', - '🈟' => '新', - '🈠' => '初', - '🈡' => '終', - '🈢' => '生', - '🈣' => '販', - '🈤' => '声', - '🈥' => '吹', - '🈦' => '演', - '🈧' => '投', - '🈨' => '捕', - '🈩' => '一', - '🈪' => '三', - '🈫' => '遊', - '🈬' => '左', - '🈭' => '中', - '🈮' => '右', - '🈯' => '指', - '🈰' => '走', - '🈱' => '打', - '🈲' => '禁', - '🈳' => '空', - '🈴' => '合', - '🈵' => '満', - '🈶' => '有', - '🈷' => '月', - '🈸' => '申', - '🈹' => '割', - '🈺' => '営', - '🈻' => '配', - '🉀' => '〔本〕', - '🉁' => '〔三〕', - '🉂' => '〔二〕', - '🉃' => '〔安〕', - '🉄' => '〔点〕', - '🉅' => '〔打〕', - '🉆' => '〔盗〕', - '🉇' => '〔勝〕', - '🉈' => '〔敗〕', - '🉐' => '得', - '🉑' => '可', - '🯰' => '0', - '🯱' => '1', - '🯲' => '2', - '🯳' => '3', - '🯴' => '4', - '🯵' => '5', - '🯶' => '6', - '🯷' => '7', - '🯸' => '8', - '🯹' => '9', -); diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/bootstrap.php b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/bootstrap.php deleted file mode 100644 index 3608e5c0..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/bootstrap.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php deleted file mode 100644 index e36d1a94..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/composer.json deleted file mode 100644 index 9bd04e88..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-intl-normalizer/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "symfony/polyfill-intl-normalizer", - "type": "library", - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "normalizer"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "suggest": { - "ext-intl": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/LICENSE deleted file mode 100644 index 6e3afce6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Mbstring.php b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Mbstring.php deleted file mode 100644 index 3d45c9d9..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Mbstring.php +++ /dev/null @@ -1,1045 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Mbstring; - -/** - * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. - * - * Implemented: - * - mb_chr - Returns a specific character from its Unicode code point - * - mb_convert_encoding - Convert character encoding - * - mb_convert_variables - Convert character code in variable(s) - * - mb_decode_mimeheader - Decode string in MIME header field - * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED - * - mb_decode_numericentity - Decode HTML numeric string reference to character - * - mb_encode_numericentity - Encode character to HTML numeric string reference - * - mb_convert_case - Perform case folding on a string - * - mb_detect_encoding - Detect character encoding - * - mb_get_info - Get internal settings of mbstring - * - mb_http_input - Detect HTTP input character encoding - * - mb_http_output - Set/Get HTTP output character encoding - * - mb_internal_encoding - Set/Get internal character encoding - * - mb_list_encodings - Returns an array of all supported encodings - * - mb_ord - Returns the Unicode code point of a character - * - mb_output_handler - Callback function converts character encoding in output buffer - * - mb_scrub - Replaces ill-formed byte sequences with substitute characters - * - mb_strlen - Get string length - * - mb_strpos - Find position of first occurrence of string in a string - * - mb_strrpos - Find position of last occurrence of a string in a string - * - mb_str_split - Convert a string to an array - * - mb_strtolower - Make a string lowercase - * - mb_strtoupper - Make a string uppercase - * - mb_substitute_character - Set/Get substitution character - * - mb_substr - Get part of string - * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive - * - mb_stristr - Finds first occurrence of a string within another, case insensitive - * - mb_strrchr - Finds the last occurrence of a character in a string within another - * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive - * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive - * - mb_strstr - Finds first occurrence of a string within another - * - mb_strwidth - Return width of string - * - mb_substr_count - Count the number of substring occurrences - * - mb_ucfirst - Make a string's first character uppercase - * - mb_lcfirst - Make a string's first character lowercase - * - mb_trim - Strip whitespace (or other characters) from the beginning and end of a string - * - mb_ltrim - Strip whitespace (or other characters) from the beginning of a string - * - mb_rtrim - Strip whitespace (or other characters) from the end of a string - * - * Not implemented: - * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) - * - mb_ereg_* - Regular expression with multibyte support - * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable - * - mb_preferred_mime_name - Get MIME charset string - * - mb_regex_encoding - Returns current encoding for multibyte regex as string - * - mb_regex_set_options - Set/Get the default options for mbregex functions - * - mb_send_mail - Send encoded mail - * - mb_split - Split multibyte string using regular expression - * - mb_strcut - Get part of string - * - mb_strimwidth - Get truncated string with specified width - * - * @author Nicolas Grekas - * - * @internal - */ -final class Mbstring -{ - public const MB_CASE_FOLD = \PHP_INT_MAX; - - private const SIMPLE_CASE_FOLD = [ - ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], - ]; - - private static $encodingList = ['ASCII', 'UTF-8']; - private static $language = 'neutral'; - private static $internalEncoding = 'UTF-8'; - - public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) - { - if (\is_array($s)) { - $r = []; - foreach ($s as $str) { - $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); - } - - return $r; - } - - if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { - $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); - } else { - $fromEncoding = self::getEncoding($fromEncoding); - } - - $toEncoding = self::getEncoding($toEncoding); - - if ('BASE64' === $fromEncoding) { - $s = base64_decode($s); - $fromEncoding = $toEncoding; - } - - if ('BASE64' === $toEncoding) { - return base64_encode($s); - } - - if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { - if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { - $fromEncoding = 'Windows-1252'; - } - if ('UTF-8' !== $fromEncoding) { - $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); - } - - return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); - } - - if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); - $fromEncoding = 'UTF-8'; - } - - return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); - } - - public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) - { - $ok = true; - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { - $ok = false; - } - }); - - return $ok ? $fromEncoding : false; - } - - public static function mb_decode_mimeheader($s) - { - return iconv_mime_decode($s, 2, self::$internalEncoding); - } - - public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) - { - trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); - } - - public static function mb_decode_numericentity($s, $convmap, $encoding = null) - { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return ''; // Instead of null (cf. mb_encode_numericentity). - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $cnt = floor(\count($convmap) / 4) * 4; - - for ($i = 0; $i < $cnt; $i += 4) { - // collector_decode_htmlnumericentity ignores $convmap[$i + 3] - $convmap[$i] += $convmap[$i + 2]; - $convmap[$i + 1] += $convmap[$i + 2]; - } - - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { - $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; - for ($i = 0; $i < $cnt; $i += 4) { - if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { - return self::mb_chr($c - $convmap[$i + 2]); - } - } - - return $m[0]; - }, $s); - - if (null === $encoding) { - return $s; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) - { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; // Instead of '' (cf. mb_decode_numericentity). - } - - if (null !== $is_hex && !\is_scalar($is_hex)) { - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $cnt = floor(\count($convmap) / 4) * 4; - $i = 0; - $len = \strlen($s); - $result = ''; - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - $c = self::mb_ord($uchr); - - for ($j = 0; $j < $cnt; $j += 4) { - if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { - $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; - $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; - continue 2; - } - } - $result .= $uchr; - } - - if (null === $encoding) { - return $result; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $result); - } - - public static function mb_convert_case($s, $mode, $encoding = null) - { - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - if (\MB_CASE_TITLE == $mode) { - static $titleRegexp = null; - if (null === $titleRegexp) { - $titleRegexp = self::getData('titleCaseRegexp'); - } - $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); - } else { - if (\MB_CASE_UPPER == $mode) { - static $upper = null; - if (null === $upper) { - $upper = self::getData('upperCase'); - } - $map = $upper; - } else { - if (self::MB_CASE_FOLD === $mode) { - static $caseFolding = null; - if (null === $caseFolding) { - $caseFolding = self::getData('caseFolding'); - } - $s = strtr($s, $caseFolding); - } - - static $lower = null; - if (null === $lower) { - $lower = self::getData('lowerCase'); - } - $map = $lower; - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if (isset($map[$uchr])) { - $uchr = $map[$uchr]; - $nlen = \strlen($uchr); - - if ($nlen == $ulen) { - $nlen = $i; - do { - $s[--$nlen] = $uchr[--$ulen]; - } while ($ulen); - } else { - $s = substr_replace($s, $uchr, $i - $ulen, $ulen); - $len += $nlen - $ulen; - $i += $nlen - $ulen; - } - } - } - } - - if (null === $encoding) { - return $s; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_internal_encoding($encoding = null) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - $normalizedEncoding = self::getEncoding($encoding); - - if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { - self::$internalEncoding = $normalizedEncoding; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); - } - - public static function mb_language($lang = null) - { - if (null === $lang) { - return self::$language; - } - - switch ($normalizedLang = strtolower($lang)) { - case 'uni': - case 'neutral': - self::$language = $normalizedLang; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); - } - - public static function mb_list_encodings() - { - return ['UTF-8']; - } - - public static function mb_encoding_aliases($encoding) - { - switch (strtoupper($encoding)) { - case 'UTF8': - case 'UTF-8': - return ['utf8']; - } - - return false; - } - - public static function mb_check_encoding($var = null, $encoding = null) - { - if (null === $encoding) { - if (null === $var) { - return false; - } - $encoding = self::$internalEncoding; - } - - if (!\is_array($var)) { - return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); - } - - foreach ($var as $key => $value) { - if (!self::mb_check_encoding($key, $encoding)) { - return false; - } - if (!self::mb_check_encoding($value, $encoding)) { - return false; - } - } - - return true; - } - - public static function mb_detect_encoding($str, $encodingList = null, $strict = false) - { - if (null === $encodingList) { - $encodingList = self::$encodingList; - } else { - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - } - - foreach ($encodingList as $enc) { - switch ($enc) { - case 'ASCII': - if (!preg_match('/[\x80-\xFF]/', $str)) { - return $enc; - } - break; - - case 'UTF8': - case 'UTF-8': - if (preg_match('//u', $str)) { - return 'UTF-8'; - } - break; - - default: - if (0 === strncmp($enc, 'ISO-8859-', 9)) { - return $enc; - } - } - } - - return false; - } - - public static function mb_detect_order($encodingList = null) - { - if (null === $encodingList) { - return self::$encodingList; - } - - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - - foreach ($encodingList as $enc) { - switch ($enc) { - default: - if (strncmp($enc, 'ISO-8859-', 9)) { - return false; - } - // no break - case 'ASCII': - case 'UTF8': - case 'UTF-8': - } - } - - self::$encodingList = $encodingList; - - return true; - } - - public static function mb_strlen($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return \strlen($s); - } - - return @iconv_strlen($s, $encoding); - } - - public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strpos($haystack, $needle, $offset); - } - - $needle = (string) $needle; - if ('' === $needle) { - if (80000 > \PHP_VERSION_ID) { - trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); - - return false; - } - - return 0; - } - - return iconv_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrpos($haystack, $needle, $offset); - } - - if ($offset != (int) $offset) { - $offset = 0; - } elseif ($offset = (int) $offset) { - if ($offset < 0) { - if (0 > $offset += self::mb_strlen($needle)) { - $haystack = self::mb_substr($haystack, 0, $offset, $encoding); - } - $offset = 0; - } else { - $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); - } - } - - $pos = '' !== $needle || 80000 > \PHP_VERSION_ID - ? iconv_strrpos($haystack, $needle, $encoding) - : self::mb_strlen($haystack, $encoding); - - return false !== $pos ? $offset + $pos : false; - } - - public static function mb_str_split($string, $split_length = 1, $encoding = null) - { - if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { - trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); - - return null; - } - - if (1 > $split_length = (int) $split_length) { - if (80000 > \PHP_VERSION_ID) { - trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); - - return false; - } - - throw new \ValueError('Argument #2 ($length) must be greater than 0'); - } - - if (null === $encoding) { - $encoding = mb_internal_encoding(); - } - - if ('UTF-8' === $encoding = self::getEncoding($encoding)) { - $rx = '/('; - while (65535 < $split_length) { - $rx .= '.{65535}'; - $split_length -= 65535; - } - $rx .= '.{'.$split_length.'})/us'; - - return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); - } - - $result = []; - $length = mb_strlen($string, $encoding); - - for ($i = 0; $i < $length; $i += $split_length) { - $result[] = mb_substr($string, $i, $split_length, $encoding); - } - - return $result; - } - - public static function mb_strtolower($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); - } - - public static function mb_strtoupper($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); - } - - public static function mb_substitute_character($c = null) - { - if (null === $c) { - return 'none'; - } - if (0 === strcasecmp($c, 'none')) { - return true; - } - if (80000 > \PHP_VERSION_ID) { - return false; - } - if (\is_int($c) || 'long' === $c || 'entity' === $c) { - return false; - } - - throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); - } - - public static function mb_substr($s, $start, $length = null, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return (string) substr($s, $start, null === $length ? 2147483647 : $length); - } - - if ($start < 0) { - $start = iconv_strlen($s, $encoding) + $start; - if ($start < 0) { - $start = 0; - } - } - - if (null === $length) { - $length = 2147483647; - } elseif ($length < 0) { - $length = iconv_strlen($s, $encoding) + $length - $start; - if ($length < 0) { - return ''; - } - } - - return (string) iconv_substr($s, $start, $length, $encoding); - } - - public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) - { - [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ - self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), - self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), - ]); - - return self::mb_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) - { - $pos = self::mb_stripos($haystack, $needle, 0, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - $pos = strrpos($haystack, $needle); - } else { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = iconv_strrpos($haystack, $needle, $encoding); - } - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) - { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = self::mb_strripos($haystack, $needle, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) - { - $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); - $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); - - $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); - $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); - - return self::mb_strrpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) - { - $pos = strpos($haystack, $needle); - if (false === $pos) { - return false; - } - if ($part) { - return substr($haystack, 0, $pos); - } - - return substr($haystack, $pos); - } - - public static function mb_get_info($type = 'all') - { - $info = [ - 'internal_encoding' => self::$internalEncoding, - 'http_output' => 'pass', - 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', - 'func_overload' => 0, - 'func_overload_list' => 'no overload', - 'mail_charset' => 'UTF-8', - 'mail_header_encoding' => 'BASE64', - 'mail_body_encoding' => 'BASE64', - 'illegal_chars' => 0, - 'encoding_translation' => 'Off', - 'language' => self::$language, - 'detect_order' => self::$encodingList, - 'substitute_character' => 'none', - 'strict_detection' => 'Off', - ]; - - if ('all' === $type) { - return $info; - } - if (isset($info[$type])) { - return $info[$type]; - } - - return false; - } - - public static function mb_http_input($type = '') - { - return false; - } - - public static function mb_http_output($encoding = null) - { - return null !== $encoding ? 'pass' === $encoding : 'pass'; - } - - public static function mb_strwidth($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - - if ('UTF-8' !== $encoding) { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); - - return ($wide << 1) + iconv_strlen($s, 'UTF-8'); - } - - public static function mb_substr_count($haystack, $needle, $encoding = null) - { - return substr_count($haystack, $needle); - } - - public static function mb_output_handler($contents, $status) - { - return $contents; - } - - public static function mb_chr($code, $encoding = null) - { - if (0x80 > $code %= 0x200000) { - $s = \chr($code); - } elseif (0x800 > $code) { - $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, 'UTF-8', $encoding); - } - - if (1 === \strlen($s)) { - return \ord($s); - } - - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; - } - - return $code; - } - - public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string - { - if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { - throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); - } - - if (null === $encoding) { - $encoding = self::mb_internal_encoding(); - } else { - self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given'); - } - - if (self::mb_strlen($pad_string, $encoding) <= 0) { - throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); - } - - $paddingRequired = $length - self::mb_strlen($string, $encoding); - - if ($paddingRequired < 1) { - return $string; - } - - switch ($pad_type) { - case \STR_PAD_LEFT: - return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; - case \STR_PAD_RIGHT: - return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); - default: - $leftPaddingLength = floor($paddingRequired / 2); - $rightPaddingLength = $paddingRequired - $leftPaddingLength; - - return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); - } - } - - public static function mb_ucfirst(string $string, ?string $encoding = null): string - { - if (null === $encoding) { - $encoding = self::mb_internal_encoding(); - } else { - self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); - } - - $firstChar = mb_substr($string, 0, 1, $encoding); - $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); - - return $firstChar.mb_substr($string, 1, null, $encoding); - } - - public static function mb_lcfirst(string $string, ?string $encoding = null): string - { - if (null === $encoding) { - $encoding = self::mb_internal_encoding(); - } else { - self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); - } - - $firstChar = mb_substr($string, 0, 1, $encoding); - $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); - - return $firstChar.mb_substr($string, 1, null, $encoding); - } - - private static function getSubpart($pos, $part, $haystack, $encoding) - { - if (false === $pos) { - return false; - } - if ($part) { - return self::mb_substr($haystack, 0, $pos, $encoding); - } - - return self::mb_substr($haystack, $pos, null, $encoding); - } - - private static function html_encoding_callback(array $m) - { - $i = 1; - $entities = ''; - $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); - - while (isset($m[$i])) { - if (0x80 > $m[$i]) { - $entities .= \chr($m[$i++]); - continue; - } - if (0xF0 <= $m[$i]) { - $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } elseif (0xE0 <= $m[$i]) { - $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } else { - $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; - } - - $entities .= '&#'.$c.';'; - } - - return $entities; - } - - private static function title_case(array $s) - { - return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } - - private static function getEncoding($encoding) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - if ('UTF-8' === $encoding) { - return 'UTF-8'; - } - - $encoding = strtoupper($encoding); - - if ('8BIT' === $encoding || 'BINARY' === $encoding) { - return 'CP850'; - } - - if ('UTF8' === $encoding) { - return 'UTF-8'; - } - - return $encoding; - } - - public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string - { - return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__); - } - - public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string - { - return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__); - } - - public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string - { - return self::mb_internal_trim('{[%s]+$}D', $string, $characters, $encoding, __FUNCTION__); - } - - private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function): string - { - if (null === $encoding) { - $encoding = self::mb_internal_encoding(); - } else { - self::assertEncoding($encoding, $function.'(): Argument #3 ($encoding) must be a valid encoding, "%s" given'); - } - - if ('' === $characters) { - return null === $encoding ? $string : self::mb_convert_encoding($string, $encoding); - } - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $string)) { - $string = @iconv('UTF-8', 'UTF-8//IGNORE', $string); - } - if (null !== $characters && !preg_match('//u', $characters)) { - $characters = @iconv('UTF-8', 'UTF-8//IGNORE', $characters); - } - } else { - $string = iconv($encoding, 'UTF-8//IGNORE', $string); - - if (null !== $characters) { - $characters = iconv($encoding, 'UTF-8//IGNORE', $characters); - } - } - - if (null === $characters) { - $characters = "\\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}"; - } else { - $characters = preg_quote($characters); - } - - $string = preg_replace(sprintf($regex, $characters), '', $string); - - if (null === $encoding) { - return $string; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $string); - } - - private static function assertEncoding(string $encoding, string $errorFormat): void - { - try { - $validEncoding = @self::mb_check_encoding('', $encoding); - } catch (\ValueError $e) { - throw new \ValueError(sprintf($errorFormat, $encoding)); - } - - // BC for PHP 7.3 and lower - if (!$validEncoding) { - throw new \ValueError(sprintf($errorFormat, $encoding)); - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/README.md b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/README.md deleted file mode 100644 index 478b40da..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Symfony Polyfill / Mbstring -=========================== - -This component provides a partial, native PHP implementation for the -[Mbstring](https://php.net/mbstring) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php deleted file mode 100644 index 512bba0b..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +++ /dev/null @@ -1,119 +0,0 @@ - 'i̇', - 'µ' => 'μ', - 'ſ' => 's', - 'ͅ' => 'ι', - 'ς' => 'σ', - 'ϐ' => 'β', - 'ϑ' => 'θ', - 'ϕ' => 'φ', - 'ϖ' => 'π', - 'ϰ' => 'κ', - 'ϱ' => 'ρ', - 'ϵ' => 'ε', - 'ẛ' => 'ṡ', - 'ι' => 'ι', - 'ß' => 'ss', - 'ʼn' => 'ʼn', - 'ǰ' => 'ǰ', - 'ΐ' => 'ΐ', - 'ΰ' => 'ΰ', - 'և' => 'եւ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẚ' => 'aʾ', - 'ẞ' => 'ss', - 'ὐ' => 'ὐ', - 'ὒ' => 'ὒ', - 'ὔ' => 'ὔ', - 'ὖ' => 'ὖ', - 'ᾀ' => 'ἀι', - 'ᾁ' => 'ἁι', - 'ᾂ' => 'ἂι', - 'ᾃ' => 'ἃι', - 'ᾄ' => 'ἄι', - 'ᾅ' => 'ἅι', - 'ᾆ' => 'ἆι', - 'ᾇ' => 'ἇι', - 'ᾈ' => 'ἀι', - 'ᾉ' => 'ἁι', - 'ᾊ' => 'ἂι', - 'ᾋ' => 'ἃι', - 'ᾌ' => 'ἄι', - 'ᾍ' => 'ἅι', - 'ᾎ' => 'ἆι', - 'ᾏ' => 'ἇι', - 'ᾐ' => 'ἠι', - 'ᾑ' => 'ἡι', - 'ᾒ' => 'ἢι', - 'ᾓ' => 'ἣι', - 'ᾔ' => 'ἤι', - 'ᾕ' => 'ἥι', - 'ᾖ' => 'ἦι', - 'ᾗ' => 'ἧι', - 'ᾘ' => 'ἠι', - 'ᾙ' => 'ἡι', - 'ᾚ' => 'ἢι', - 'ᾛ' => 'ἣι', - 'ᾜ' => 'ἤι', - 'ᾝ' => 'ἥι', - 'ᾞ' => 'ἦι', - 'ᾟ' => 'ἧι', - 'ᾠ' => 'ὠι', - 'ᾡ' => 'ὡι', - 'ᾢ' => 'ὢι', - 'ᾣ' => 'ὣι', - 'ᾤ' => 'ὤι', - 'ᾥ' => 'ὥι', - 'ᾦ' => 'ὦι', - 'ᾧ' => 'ὧι', - 'ᾨ' => 'ὠι', - 'ᾩ' => 'ὡι', - 'ᾪ' => 'ὢι', - 'ᾫ' => 'ὣι', - 'ᾬ' => 'ὤι', - 'ᾭ' => 'ὥι', - 'ᾮ' => 'ὦι', - 'ᾯ' => 'ὧι', - 'ᾲ' => 'ὰι', - 'ᾳ' => 'αι', - 'ᾴ' => 'άι', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾶι', - 'ᾼ' => 'αι', - 'ῂ' => 'ὴι', - 'ῃ' => 'ηι', - 'ῄ' => 'ήι', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῆι', - 'ῌ' => 'ηι', - 'ῒ' => 'ῒ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'ῢ' => 'ῢ', - 'ῤ' => 'ῤ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'ῲ' => 'ὼι', - 'ῳ' => 'ωι', - 'ῴ' => 'ώι', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῶι', - 'ῼ' => 'ωι', - 'ff' => 'ff', - 'fi' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - 'ſt' => 'st', - 'st' => 'st', - 'ﬓ' => 'մն', - 'ﬔ' => 'մե', - 'ﬕ' => 'մի', - 'ﬖ' => 'վն', - 'ﬗ' => 'մխ', -]; diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php deleted file mode 100644 index fac60b08..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ /dev/null @@ -1,1397 +0,0 @@ - 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - 'À' => 'à', - 'Á' => 'á', - 'Â' => 'â', - 'Ã' => 'ã', - 'Ä' => 'ä', - 'Å' => 'å', - 'Æ' => 'æ', - 'Ç' => 'ç', - 'È' => 'è', - 'É' => 'é', - 'Ê' => 'ê', - 'Ë' => 'ë', - 'Ì' => 'ì', - 'Í' => 'í', - 'Î' => 'î', - 'Ï' => 'ï', - 'Ð' => 'ð', - 'Ñ' => 'ñ', - 'Ò' => 'ò', - 'Ó' => 'ó', - 'Ô' => 'ô', - 'Õ' => 'õ', - 'Ö' => 'ö', - 'Ø' => 'ø', - 'Ù' => 'ù', - 'Ú' => 'ú', - 'Û' => 'û', - 'Ü' => 'ü', - 'Ý' => 'ý', - 'Þ' => 'þ', - 'Ā' => 'ā', - 'Ă' => 'ă', - 'Ą' => 'ą', - 'Ć' => 'ć', - 'Ĉ' => 'ĉ', - 'Ċ' => 'ċ', - 'Č' => 'č', - 'Ď' => 'ď', - 'Đ' => 'đ', - 'Ē' => 'ē', - 'Ĕ' => 'ĕ', - 'Ė' => 'ė', - 'Ę' => 'ę', - 'Ě' => 'ě', - 'Ĝ' => 'ĝ', - 'Ğ' => 'ğ', - 'Ġ' => 'ġ', - 'Ģ' => 'ģ', - 'Ĥ' => 'ĥ', - 'Ħ' => 'ħ', - 'Ĩ' => 'ĩ', - 'Ī' => 'ī', - 'Ĭ' => 'ĭ', - 'Į' => 'į', - 'İ' => 'i̇', - 'IJ' => 'ij', - 'Ĵ' => 'ĵ', - 'Ķ' => 'ķ', - 'Ĺ' => 'ĺ', - 'Ļ' => 'ļ', - 'Ľ' => 'ľ', - 'Ŀ' => 'ŀ', - 'Ł' => 'ł', - 'Ń' => 'ń', - 'Ņ' => 'ņ', - 'Ň' => 'ň', - 'Ŋ' => 'ŋ', - 'Ō' => 'ō', - 'Ŏ' => 'ŏ', - 'Ő' => 'ő', - 'Œ' => 'œ', - 'Ŕ' => 'ŕ', - 'Ŗ' => 'ŗ', - 'Ř' => 'ř', - 'Ś' => 'ś', - 'Ŝ' => 'ŝ', - 'Ş' => 'ş', - 'Š' => 'š', - 'Ţ' => 'ţ', - 'Ť' => 'ť', - 'Ŧ' => 'ŧ', - 'Ũ' => 'ũ', - 'Ū' => 'ū', - 'Ŭ' => 'ŭ', - 'Ů' => 'ů', - 'Ű' => 'ű', - 'Ų' => 'ų', - 'Ŵ' => 'ŵ', - 'Ŷ' => 'ŷ', - 'Ÿ' => 'ÿ', - 'Ź' => 'ź', - 'Ż' => 'ż', - 'Ž' => 'ž', - 'Ɓ' => 'ɓ', - 'Ƃ' => 'ƃ', - 'Ƅ' => 'ƅ', - 'Ɔ' => 'ɔ', - 'Ƈ' => 'ƈ', - 'Ɖ' => 'ɖ', - 'Ɗ' => 'ɗ', - 'Ƌ' => 'ƌ', - 'Ǝ' => 'ǝ', - 'Ə' => 'ə', - 'Ɛ' => 'ɛ', - 'Ƒ' => 'ƒ', - 'Ɠ' => 'ɠ', - 'Ɣ' => 'ɣ', - 'Ɩ' => 'ɩ', - 'Ɨ' => 'ɨ', - 'Ƙ' => 'ƙ', - 'Ɯ' => 'ɯ', - 'Ɲ' => 'ɲ', - 'Ɵ' => 'ɵ', - 'Ơ' => 'ơ', - 'Ƣ' => 'ƣ', - 'Ƥ' => 'ƥ', - 'Ʀ' => 'ʀ', - 'Ƨ' => 'ƨ', - 'Ʃ' => 'ʃ', - 'Ƭ' => 'ƭ', - 'Ʈ' => 'ʈ', - 'Ư' => 'ư', - 'Ʊ' => 'ʊ', - 'Ʋ' => 'ʋ', - 'Ƴ' => 'ƴ', - 'Ƶ' => 'ƶ', - 'Ʒ' => 'ʒ', - 'Ƹ' => 'ƹ', - 'Ƽ' => 'ƽ', - 'DŽ' => 'dž', - 'Dž' => 'dž', - 'LJ' => 'lj', - 'Lj' => 'lj', - 'NJ' => 'nj', - 'Nj' => 'nj', - 'Ǎ' => 'ǎ', - 'Ǐ' => 'ǐ', - 'Ǒ' => 'ǒ', - 'Ǔ' => 'ǔ', - 'Ǖ' => 'ǖ', - 'Ǘ' => 'ǘ', - 'Ǚ' => 'ǚ', - 'Ǜ' => 'ǜ', - 'Ǟ' => 'ǟ', - 'Ǡ' => 'ǡ', - 'Ǣ' => 'ǣ', - 'Ǥ' => 'ǥ', - 'Ǧ' => 'ǧ', - 'Ǩ' => 'ǩ', - 'Ǫ' => 'ǫ', - 'Ǭ' => 'ǭ', - 'Ǯ' => 'ǯ', - 'DZ' => 'dz', - 'Dz' => 'dz', - 'Ǵ' => 'ǵ', - 'Ƕ' => 'ƕ', - 'Ƿ' => 'ƿ', - 'Ǹ' => 'ǹ', - 'Ǻ' => 'ǻ', - 'Ǽ' => 'ǽ', - 'Ǿ' => 'ǿ', - 'Ȁ' => 'ȁ', - 'Ȃ' => 'ȃ', - 'Ȅ' => 'ȅ', - 'Ȇ' => 'ȇ', - 'Ȉ' => 'ȉ', - 'Ȋ' => 'ȋ', - 'Ȍ' => 'ȍ', - 'Ȏ' => 'ȏ', - 'Ȑ' => 'ȑ', - 'Ȓ' => 'ȓ', - 'Ȕ' => 'ȕ', - 'Ȗ' => 'ȗ', - 'Ș' => 'ș', - 'Ț' => 'ț', - 'Ȝ' => 'ȝ', - 'Ȟ' => 'ȟ', - 'Ƞ' => 'ƞ', - 'Ȣ' => 'ȣ', - 'Ȥ' => 'ȥ', - 'Ȧ' => 'ȧ', - 'Ȩ' => 'ȩ', - 'Ȫ' => 'ȫ', - 'Ȭ' => 'ȭ', - 'Ȯ' => 'ȯ', - 'Ȱ' => 'ȱ', - 'Ȳ' => 'ȳ', - 'Ⱥ' => 'ⱥ', - 'Ȼ' => 'ȼ', - 'Ƚ' => 'ƚ', - 'Ⱦ' => 'ⱦ', - 'Ɂ' => 'ɂ', - 'Ƀ' => 'ƀ', - 'Ʉ' => 'ʉ', - 'Ʌ' => 'ʌ', - 'Ɇ' => 'ɇ', - 'Ɉ' => 'ɉ', - 'Ɋ' => 'ɋ', - 'Ɍ' => 'ɍ', - 'Ɏ' => 'ɏ', - 'Ͱ' => 'ͱ', - 'Ͳ' => 'ͳ', - 'Ͷ' => 'ͷ', - 'Ϳ' => 'ϳ', - 'Ά' => 'ά', - 'Έ' => 'έ', - 'Ή' => 'ή', - 'Ί' => 'ί', - 'Ό' => 'ό', - 'Ύ' => 'ύ', - 'Ώ' => 'ώ', - 'Α' => 'α', - 'Β' => 'β', - 'Γ' => 'γ', - 'Δ' => 'δ', - 'Ε' => 'ε', - 'Ζ' => 'ζ', - 'Η' => 'η', - 'Θ' => 'θ', - 'Ι' => 'ι', - 'Κ' => 'κ', - 'Λ' => 'λ', - 'Μ' => 'μ', - 'Ν' => 'ν', - 'Ξ' => 'ξ', - 'Ο' => 'ο', - 'Π' => 'π', - 'Ρ' => 'ρ', - 'Σ' => 'σ', - 'Τ' => 'τ', - 'Υ' => 'υ', - 'Φ' => 'φ', - 'Χ' => 'χ', - 'Ψ' => 'ψ', - 'Ω' => 'ω', - 'Ϊ' => 'ϊ', - 'Ϋ' => 'ϋ', - 'Ϗ' => 'ϗ', - 'Ϙ' => 'ϙ', - 'Ϛ' => 'ϛ', - 'Ϝ' => 'ϝ', - 'Ϟ' => 'ϟ', - 'Ϡ' => 'ϡ', - 'Ϣ' => 'ϣ', - 'Ϥ' => 'ϥ', - 'Ϧ' => 'ϧ', - 'Ϩ' => 'ϩ', - 'Ϫ' => 'ϫ', - 'Ϭ' => 'ϭ', - 'Ϯ' => 'ϯ', - 'ϴ' => 'θ', - 'Ϸ' => 'ϸ', - 'Ϲ' => 'ϲ', - 'Ϻ' => 'ϻ', - 'Ͻ' => 'ͻ', - 'Ͼ' => 'ͼ', - 'Ͽ' => 'ͽ', - 'Ѐ' => 'ѐ', - 'Ё' => 'ё', - 'Ђ' => 'ђ', - 'Ѓ' => 'ѓ', - 'Є' => 'є', - 'Ѕ' => 'ѕ', - 'І' => 'і', - 'Ї' => 'ї', - 'Ј' => 'ј', - 'Љ' => 'љ', - 'Њ' => 'њ', - 'Ћ' => 'ћ', - 'Ќ' => 'ќ', - 'Ѝ' => 'ѝ', - 'Ў' => 'ў', - 'Џ' => 'џ', - 'А' => 'а', - 'Б' => 'б', - 'В' => 'в', - 'Г' => 'г', - 'Д' => 'д', - 'Е' => 'е', - 'Ж' => 'ж', - 'З' => 'з', - 'И' => 'и', - 'Й' => 'й', - 'К' => 'к', - 'Л' => 'л', - 'М' => 'м', - 'Н' => 'н', - 'О' => 'о', - 'П' => 'п', - 'Р' => 'р', - 'С' => 'с', - 'Т' => 'т', - 'У' => 'у', - 'Ф' => 'ф', - 'Х' => 'х', - 'Ц' => 'ц', - 'Ч' => 'ч', - 'Ш' => 'ш', - 'Щ' => 'щ', - 'Ъ' => 'ъ', - 'Ы' => 'ы', - 'Ь' => 'ь', - 'Э' => 'э', - 'Ю' => 'ю', - 'Я' => 'я', - 'Ѡ' => 'ѡ', - 'Ѣ' => 'ѣ', - 'Ѥ' => 'ѥ', - 'Ѧ' => 'ѧ', - 'Ѩ' => 'ѩ', - 'Ѫ' => 'ѫ', - 'Ѭ' => 'ѭ', - 'Ѯ' => 'ѯ', - 'Ѱ' => 'ѱ', - 'Ѳ' => 'ѳ', - 'Ѵ' => 'ѵ', - 'Ѷ' => 'ѷ', - 'Ѹ' => 'ѹ', - 'Ѻ' => 'ѻ', - 'Ѽ' => 'ѽ', - 'Ѿ' => 'ѿ', - 'Ҁ' => 'ҁ', - 'Ҋ' => 'ҋ', - 'Ҍ' => 'ҍ', - 'Ҏ' => 'ҏ', - 'Ґ' => 'ґ', - 'Ғ' => 'ғ', - 'Ҕ' => 'ҕ', - 'Җ' => 'җ', - 'Ҙ' => 'ҙ', - 'Қ' => 'қ', - 'Ҝ' => 'ҝ', - 'Ҟ' => 'ҟ', - 'Ҡ' => 'ҡ', - 'Ң' => 'ң', - 'Ҥ' => 'ҥ', - 'Ҧ' => 'ҧ', - 'Ҩ' => 'ҩ', - 'Ҫ' => 'ҫ', - 'Ҭ' => 'ҭ', - 'Ү' => 'ү', - 'Ұ' => 'ұ', - 'Ҳ' => 'ҳ', - 'Ҵ' => 'ҵ', - 'Ҷ' => 'ҷ', - 'Ҹ' => 'ҹ', - 'Һ' => 'һ', - 'Ҽ' => 'ҽ', - 'Ҿ' => 'ҿ', - 'Ӏ' => 'ӏ', - 'Ӂ' => 'ӂ', - 'Ӄ' => 'ӄ', - 'Ӆ' => 'ӆ', - 'Ӈ' => 'ӈ', - 'Ӊ' => 'ӊ', - 'Ӌ' => 'ӌ', - 'Ӎ' => 'ӎ', - 'Ӑ' => 'ӑ', - 'Ӓ' => 'ӓ', - 'Ӕ' => 'ӕ', - 'Ӗ' => 'ӗ', - 'Ә' => 'ә', - 'Ӛ' => 'ӛ', - 'Ӝ' => 'ӝ', - 'Ӟ' => 'ӟ', - 'Ӡ' => 'ӡ', - 'Ӣ' => 'ӣ', - 'Ӥ' => 'ӥ', - 'Ӧ' => 'ӧ', - 'Ө' => 'ө', - 'Ӫ' => 'ӫ', - 'Ӭ' => 'ӭ', - 'Ӯ' => 'ӯ', - 'Ӱ' => 'ӱ', - 'Ӳ' => 'ӳ', - 'Ӵ' => 'ӵ', - 'Ӷ' => 'ӷ', - 'Ӹ' => 'ӹ', - 'Ӻ' => 'ӻ', - 'Ӽ' => 'ӽ', - 'Ӿ' => 'ӿ', - 'Ԁ' => 'ԁ', - 'Ԃ' => 'ԃ', - 'Ԅ' => 'ԅ', - 'Ԇ' => 'ԇ', - 'Ԉ' => 'ԉ', - 'Ԋ' => 'ԋ', - 'Ԍ' => 'ԍ', - 'Ԏ' => 'ԏ', - 'Ԑ' => 'ԑ', - 'Ԓ' => 'ԓ', - 'Ԕ' => 'ԕ', - 'Ԗ' => 'ԗ', - 'Ԙ' => 'ԙ', - 'Ԛ' => 'ԛ', - 'Ԝ' => 'ԝ', - 'Ԟ' => 'ԟ', - 'Ԡ' => 'ԡ', - 'Ԣ' => 'ԣ', - 'Ԥ' => 'ԥ', - 'Ԧ' => 'ԧ', - 'Ԩ' => 'ԩ', - 'Ԫ' => 'ԫ', - 'Ԭ' => 'ԭ', - 'Ԯ' => 'ԯ', - 'Ա' => 'ա', - 'Բ' => 'բ', - 'Գ' => 'գ', - 'Դ' => 'դ', - 'Ե' => 'ե', - 'Զ' => 'զ', - 'Է' => 'է', - 'Ը' => 'ը', - 'Թ' => 'թ', - 'Ժ' => 'ժ', - 'Ի' => 'ի', - 'Լ' => 'լ', - 'Խ' => 'խ', - 'Ծ' => 'ծ', - 'Կ' => 'կ', - 'Հ' => 'հ', - 'Ձ' => 'ձ', - 'Ղ' => 'ղ', - 'Ճ' => 'ճ', - 'Մ' => 'մ', - 'Յ' => 'յ', - 'Ն' => 'ն', - 'Շ' => 'շ', - 'Ո' => 'ո', - 'Չ' => 'չ', - 'Պ' => 'պ', - 'Ջ' => 'ջ', - 'Ռ' => 'ռ', - 'Ս' => 'ս', - 'Վ' => 'վ', - 'Տ' => 'տ', - 'Ր' => 'ր', - 'Ց' => 'ց', - 'Ւ' => 'ւ', - 'Փ' => 'փ', - 'Ք' => 'ք', - 'Օ' => 'օ', - 'Ֆ' => 'ֆ', - 'Ⴀ' => 'ⴀ', - 'Ⴁ' => 'ⴁ', - 'Ⴂ' => 'ⴂ', - 'Ⴃ' => 'ⴃ', - 'Ⴄ' => 'ⴄ', - 'Ⴅ' => 'ⴅ', - 'Ⴆ' => 'ⴆ', - 'Ⴇ' => 'ⴇ', - 'Ⴈ' => 'ⴈ', - 'Ⴉ' => 'ⴉ', - 'Ⴊ' => 'ⴊ', - 'Ⴋ' => 'ⴋ', - 'Ⴌ' => 'ⴌ', - 'Ⴍ' => 'ⴍ', - 'Ⴎ' => 'ⴎ', - 'Ⴏ' => 'ⴏ', - 'Ⴐ' => 'ⴐ', - 'Ⴑ' => 'ⴑ', - 'Ⴒ' => 'ⴒ', - 'Ⴓ' => 'ⴓ', - 'Ⴔ' => 'ⴔ', - 'Ⴕ' => 'ⴕ', - 'Ⴖ' => 'ⴖ', - 'Ⴗ' => 'ⴗ', - 'Ⴘ' => 'ⴘ', - 'Ⴙ' => 'ⴙ', - 'Ⴚ' => 'ⴚ', - 'Ⴛ' => 'ⴛ', - 'Ⴜ' => 'ⴜ', - 'Ⴝ' => 'ⴝ', - 'Ⴞ' => 'ⴞ', - 'Ⴟ' => 'ⴟ', - 'Ⴠ' => 'ⴠ', - 'Ⴡ' => 'ⴡ', - 'Ⴢ' => 'ⴢ', - 'Ⴣ' => 'ⴣ', - 'Ⴤ' => 'ⴤ', - 'Ⴥ' => 'ⴥ', - 'Ⴧ' => 'ⴧ', - 'Ⴭ' => 'ⴭ', - 'Ꭰ' => 'ꭰ', - 'Ꭱ' => 'ꭱ', - 'Ꭲ' => 'ꭲ', - 'Ꭳ' => 'ꭳ', - 'Ꭴ' => 'ꭴ', - 'Ꭵ' => 'ꭵ', - 'Ꭶ' => 'ꭶ', - 'Ꭷ' => 'ꭷ', - 'Ꭸ' => 'ꭸ', - 'Ꭹ' => 'ꭹ', - 'Ꭺ' => 'ꭺ', - 'Ꭻ' => 'ꭻ', - 'Ꭼ' => 'ꭼ', - 'Ꭽ' => 'ꭽ', - 'Ꭾ' => 'ꭾ', - 'Ꭿ' => 'ꭿ', - 'Ꮀ' => 'ꮀ', - 'Ꮁ' => 'ꮁ', - 'Ꮂ' => 'ꮂ', - 'Ꮃ' => 'ꮃ', - 'Ꮄ' => 'ꮄ', - 'Ꮅ' => 'ꮅ', - 'Ꮆ' => 'ꮆ', - 'Ꮇ' => 'ꮇ', - 'Ꮈ' => 'ꮈ', - 'Ꮉ' => 'ꮉ', - 'Ꮊ' => 'ꮊ', - 'Ꮋ' => 'ꮋ', - 'Ꮌ' => 'ꮌ', - 'Ꮍ' => 'ꮍ', - 'Ꮎ' => 'ꮎ', - 'Ꮏ' => 'ꮏ', - 'Ꮐ' => 'ꮐ', - 'Ꮑ' => 'ꮑ', - 'Ꮒ' => 'ꮒ', - 'Ꮓ' => 'ꮓ', - 'Ꮔ' => 'ꮔ', - 'Ꮕ' => 'ꮕ', - 'Ꮖ' => 'ꮖ', - 'Ꮗ' => 'ꮗ', - 'Ꮘ' => 'ꮘ', - 'Ꮙ' => 'ꮙ', - 'Ꮚ' => 'ꮚ', - 'Ꮛ' => 'ꮛ', - 'Ꮜ' => 'ꮜ', - 'Ꮝ' => 'ꮝ', - 'Ꮞ' => 'ꮞ', - 'Ꮟ' => 'ꮟ', - 'Ꮠ' => 'ꮠ', - 'Ꮡ' => 'ꮡ', - 'Ꮢ' => 'ꮢ', - 'Ꮣ' => 'ꮣ', - 'Ꮤ' => 'ꮤ', - 'Ꮥ' => 'ꮥ', - 'Ꮦ' => 'ꮦ', - 'Ꮧ' => 'ꮧ', - 'Ꮨ' => 'ꮨ', - 'Ꮩ' => 'ꮩ', - 'Ꮪ' => 'ꮪ', - 'Ꮫ' => 'ꮫ', - 'Ꮬ' => 'ꮬ', - 'Ꮭ' => 'ꮭ', - 'Ꮮ' => 'ꮮ', - 'Ꮯ' => 'ꮯ', - 'Ꮰ' => 'ꮰ', - 'Ꮱ' => 'ꮱ', - 'Ꮲ' => 'ꮲ', - 'Ꮳ' => 'ꮳ', - 'Ꮴ' => 'ꮴ', - 'Ꮵ' => 'ꮵ', - 'Ꮶ' => 'ꮶ', - 'Ꮷ' => 'ꮷ', - 'Ꮸ' => 'ꮸ', - 'Ꮹ' => 'ꮹ', - 'Ꮺ' => 'ꮺ', - 'Ꮻ' => 'ꮻ', - 'Ꮼ' => 'ꮼ', - 'Ꮽ' => 'ꮽ', - 'Ꮾ' => 'ꮾ', - 'Ꮿ' => 'ꮿ', - 'Ᏸ' => 'ᏸ', - 'Ᏹ' => 'ᏹ', - 'Ᏺ' => 'ᏺ', - 'Ᏻ' => 'ᏻ', - 'Ᏼ' => 'ᏼ', - 'Ᏽ' => 'ᏽ', - 'Ა' => 'ა', - 'Ბ' => 'ბ', - 'Გ' => 'გ', - 'Დ' => 'დ', - 'Ე' => 'ე', - 'Ვ' => 'ვ', - 'Ზ' => 'ზ', - 'Თ' => 'თ', - 'Ი' => 'ი', - 'Კ' => 'კ', - 'Ლ' => 'ლ', - 'Მ' => 'მ', - 'Ნ' => 'ნ', - 'Ო' => 'ო', - 'Პ' => 'პ', - 'Ჟ' => 'ჟ', - 'Რ' => 'რ', - 'Ს' => 'ს', - 'Ტ' => 'ტ', - 'Უ' => 'უ', - 'Ფ' => 'ფ', - 'Ქ' => 'ქ', - 'Ღ' => 'ღ', - 'Ყ' => 'ყ', - 'Შ' => 'შ', - 'Ჩ' => 'ჩ', - 'Ც' => 'ც', - 'Ძ' => 'ძ', - 'Წ' => 'წ', - 'Ჭ' => 'ჭ', - 'Ხ' => 'ხ', - 'Ჯ' => 'ჯ', - 'Ჰ' => 'ჰ', - 'Ჱ' => 'ჱ', - 'Ჲ' => 'ჲ', - 'Ჳ' => 'ჳ', - 'Ჴ' => 'ჴ', - 'Ჵ' => 'ჵ', - 'Ჶ' => 'ჶ', - 'Ჷ' => 'ჷ', - 'Ჸ' => 'ჸ', - 'Ჹ' => 'ჹ', - 'Ჺ' => 'ჺ', - 'Ჽ' => 'ჽ', - 'Ჾ' => 'ჾ', - 'Ჿ' => 'ჿ', - 'Ḁ' => 'ḁ', - 'Ḃ' => 'ḃ', - 'Ḅ' => 'ḅ', - 'Ḇ' => 'ḇ', - 'Ḉ' => 'ḉ', - 'Ḋ' => 'ḋ', - 'Ḍ' => 'ḍ', - 'Ḏ' => 'ḏ', - 'Ḑ' => 'ḑ', - 'Ḓ' => 'ḓ', - 'Ḕ' => 'ḕ', - 'Ḗ' => 'ḗ', - 'Ḙ' => 'ḙ', - 'Ḛ' => 'ḛ', - 'Ḝ' => 'ḝ', - 'Ḟ' => 'ḟ', - 'Ḡ' => 'ḡ', - 'Ḣ' => 'ḣ', - 'Ḥ' => 'ḥ', - 'Ḧ' => 'ḧ', - 'Ḩ' => 'ḩ', - 'Ḫ' => 'ḫ', - 'Ḭ' => 'ḭ', - 'Ḯ' => 'ḯ', - 'Ḱ' => 'ḱ', - 'Ḳ' => 'ḳ', - 'Ḵ' => 'ḵ', - 'Ḷ' => 'ḷ', - 'Ḹ' => 'ḹ', - 'Ḻ' => 'ḻ', - 'Ḽ' => 'ḽ', - 'Ḿ' => 'ḿ', - 'Ṁ' => 'ṁ', - 'Ṃ' => 'ṃ', - 'Ṅ' => 'ṅ', - 'Ṇ' => 'ṇ', - 'Ṉ' => 'ṉ', - 'Ṋ' => 'ṋ', - 'Ṍ' => 'ṍ', - 'Ṏ' => 'ṏ', - 'Ṑ' => 'ṑ', - 'Ṓ' => 'ṓ', - 'Ṕ' => 'ṕ', - 'Ṗ' => 'ṗ', - 'Ṙ' => 'ṙ', - 'Ṛ' => 'ṛ', - 'Ṝ' => 'ṝ', - 'Ṟ' => 'ṟ', - 'Ṡ' => 'ṡ', - 'Ṣ' => 'ṣ', - 'Ṥ' => 'ṥ', - 'Ṧ' => 'ṧ', - 'Ṩ' => 'ṩ', - 'Ṫ' => 'ṫ', - 'Ṭ' => 'ṭ', - 'Ṯ' => 'ṯ', - 'Ṱ' => 'ṱ', - 'Ṳ' => 'ṳ', - 'Ṵ' => 'ṵ', - 'Ṷ' => 'ṷ', - 'Ṹ' => 'ṹ', - 'Ṻ' => 'ṻ', - 'Ṽ' => 'ṽ', - 'Ṿ' => 'ṿ', - 'Ẁ' => 'ẁ', - 'Ẃ' => 'ẃ', - 'Ẅ' => 'ẅ', - 'Ẇ' => 'ẇ', - 'Ẉ' => 'ẉ', - 'Ẋ' => 'ẋ', - 'Ẍ' => 'ẍ', - 'Ẏ' => 'ẏ', - 'Ẑ' => 'ẑ', - 'Ẓ' => 'ẓ', - 'Ẕ' => 'ẕ', - 'ẞ' => 'ß', - 'Ạ' => 'ạ', - 'Ả' => 'ả', - 'Ấ' => 'ấ', - 'Ầ' => 'ầ', - 'Ẩ' => 'ẩ', - 'Ẫ' => 'ẫ', - 'Ậ' => 'ậ', - 'Ắ' => 'ắ', - 'Ằ' => 'ằ', - 'Ẳ' => 'ẳ', - 'Ẵ' => 'ẵ', - 'Ặ' => 'ặ', - 'Ẹ' => 'ẹ', - 'Ẻ' => 'ẻ', - 'Ẽ' => 'ẽ', - 'Ế' => 'ế', - 'Ề' => 'ề', - 'Ể' => 'ể', - 'Ễ' => 'ễ', - 'Ệ' => 'ệ', - 'Ỉ' => 'ỉ', - 'Ị' => 'ị', - 'Ọ' => 'ọ', - 'Ỏ' => 'ỏ', - 'Ố' => 'ố', - 'Ồ' => 'ồ', - 'Ổ' => 'ổ', - 'Ỗ' => 'ỗ', - 'Ộ' => 'ộ', - 'Ớ' => 'ớ', - 'Ờ' => 'ờ', - 'Ở' => 'ở', - 'Ỡ' => 'ỡ', - 'Ợ' => 'ợ', - 'Ụ' => 'ụ', - 'Ủ' => 'ủ', - 'Ứ' => 'ứ', - 'Ừ' => 'ừ', - 'Ử' => 'ử', - 'Ữ' => 'ữ', - 'Ự' => 'ự', - 'Ỳ' => 'ỳ', - 'Ỵ' => 'ỵ', - 'Ỷ' => 'ỷ', - 'Ỹ' => 'ỹ', - 'Ỻ' => 'ỻ', - 'Ỽ' => 'ỽ', - 'Ỿ' => 'ỿ', - 'Ἀ' => 'ἀ', - 'Ἁ' => 'ἁ', - 'Ἂ' => 'ἂ', - 'Ἃ' => 'ἃ', - 'Ἄ' => 'ἄ', - 'Ἅ' => 'ἅ', - 'Ἆ' => 'ἆ', - 'Ἇ' => 'ἇ', - 'Ἐ' => 'ἐ', - 'Ἑ' => 'ἑ', - 'Ἒ' => 'ἒ', - 'Ἓ' => 'ἓ', - 'Ἔ' => 'ἔ', - 'Ἕ' => 'ἕ', - 'Ἠ' => 'ἠ', - 'Ἡ' => 'ἡ', - 'Ἢ' => 'ἢ', - 'Ἣ' => 'ἣ', - 'Ἤ' => 'ἤ', - 'Ἥ' => 'ἥ', - 'Ἦ' => 'ἦ', - 'Ἧ' => 'ἧ', - 'Ἰ' => 'ἰ', - 'Ἱ' => 'ἱ', - 'Ἲ' => 'ἲ', - 'Ἳ' => 'ἳ', - 'Ἴ' => 'ἴ', - 'Ἵ' => 'ἵ', - 'Ἶ' => 'ἶ', - 'Ἷ' => 'ἷ', - 'Ὀ' => 'ὀ', - 'Ὁ' => 'ὁ', - 'Ὂ' => 'ὂ', - 'Ὃ' => 'ὃ', - 'Ὄ' => 'ὄ', - 'Ὅ' => 'ὅ', - 'Ὑ' => 'ὑ', - 'Ὓ' => 'ὓ', - 'Ὕ' => 'ὕ', - 'Ὗ' => 'ὗ', - 'Ὠ' => 'ὠ', - 'Ὡ' => 'ὡ', - 'Ὢ' => 'ὢ', - 'Ὣ' => 'ὣ', - 'Ὤ' => 'ὤ', - 'Ὥ' => 'ὥ', - 'Ὦ' => 'ὦ', - 'Ὧ' => 'ὧ', - 'ᾈ' => 'ᾀ', - 'ᾉ' => 'ᾁ', - 'ᾊ' => 'ᾂ', - 'ᾋ' => 'ᾃ', - 'ᾌ' => 'ᾄ', - 'ᾍ' => 'ᾅ', - 'ᾎ' => 'ᾆ', - 'ᾏ' => 'ᾇ', - 'ᾘ' => 'ᾐ', - 'ᾙ' => 'ᾑ', - 'ᾚ' => 'ᾒ', - 'ᾛ' => 'ᾓ', - 'ᾜ' => 'ᾔ', - 'ᾝ' => 'ᾕ', - 'ᾞ' => 'ᾖ', - 'ᾟ' => 'ᾗ', - 'ᾨ' => 'ᾠ', - 'ᾩ' => 'ᾡ', - 'ᾪ' => 'ᾢ', - 'ᾫ' => 'ᾣ', - 'ᾬ' => 'ᾤ', - 'ᾭ' => 'ᾥ', - 'ᾮ' => 'ᾦ', - 'ᾯ' => 'ᾧ', - 'Ᾰ' => 'ᾰ', - 'Ᾱ' => 'ᾱ', - 'Ὰ' => 'ὰ', - 'Ά' => 'ά', - 'ᾼ' => 'ᾳ', - 'Ὲ' => 'ὲ', - 'Έ' => 'έ', - 'Ὴ' => 'ὴ', - 'Ή' => 'ή', - 'ῌ' => 'ῃ', - 'Ῐ' => 'ῐ', - 'Ῑ' => 'ῑ', - 'Ὶ' => 'ὶ', - 'Ί' => 'ί', - 'Ῠ' => 'ῠ', - 'Ῡ' => 'ῡ', - 'Ὺ' => 'ὺ', - 'Ύ' => 'ύ', - 'Ῥ' => 'ῥ', - 'Ὸ' => 'ὸ', - 'Ό' => 'ό', - 'Ὼ' => 'ὼ', - 'Ώ' => 'ώ', - 'ῼ' => 'ῳ', - 'Ω' => 'ω', - 'K' => 'k', - 'Å' => 'å', - 'Ⅎ' => 'ⅎ', - 'Ⅰ' => 'ⅰ', - 'Ⅱ' => 'ⅱ', - 'Ⅲ' => 'ⅲ', - 'Ⅳ' => 'ⅳ', - 'Ⅴ' => 'ⅴ', - 'Ⅵ' => 'ⅵ', - 'Ⅶ' => 'ⅶ', - 'Ⅷ' => 'ⅷ', - 'Ⅸ' => 'ⅸ', - 'Ⅹ' => 'ⅹ', - 'Ⅺ' => 'ⅺ', - 'Ⅻ' => 'ⅻ', - 'Ⅼ' => 'ⅼ', - 'Ⅽ' => 'ⅽ', - 'Ⅾ' => 'ⅾ', - 'Ⅿ' => 'ⅿ', - 'Ↄ' => 'ↄ', - 'Ⓐ' => 'ⓐ', - 'Ⓑ' => 'ⓑ', - 'Ⓒ' => 'ⓒ', - 'Ⓓ' => 'ⓓ', - 'Ⓔ' => 'ⓔ', - 'Ⓕ' => 'ⓕ', - 'Ⓖ' => 'ⓖ', - 'Ⓗ' => 'ⓗ', - 'Ⓘ' => 'ⓘ', - 'Ⓙ' => 'ⓙ', - 'Ⓚ' => 'ⓚ', - 'Ⓛ' => 'ⓛ', - 'Ⓜ' => 'ⓜ', - 'Ⓝ' => 'ⓝ', - 'Ⓞ' => 'ⓞ', - 'Ⓟ' => 'ⓟ', - 'Ⓠ' => 'ⓠ', - 'Ⓡ' => 'ⓡ', - 'Ⓢ' => 'ⓢ', - 'Ⓣ' => 'ⓣ', - 'Ⓤ' => 'ⓤ', - 'Ⓥ' => 'ⓥ', - 'Ⓦ' => 'ⓦ', - 'Ⓧ' => 'ⓧ', - 'Ⓨ' => 'ⓨ', - 'Ⓩ' => 'ⓩ', - 'Ⰰ' => 'ⰰ', - 'Ⰱ' => 'ⰱ', - 'Ⰲ' => 'ⰲ', - 'Ⰳ' => 'ⰳ', - 'Ⰴ' => 'ⰴ', - 'Ⰵ' => 'ⰵ', - 'Ⰶ' => 'ⰶ', - 'Ⰷ' => 'ⰷ', - 'Ⰸ' => 'ⰸ', - 'Ⰹ' => 'ⰹ', - 'Ⰺ' => 'ⰺ', - 'Ⰻ' => 'ⰻ', - 'Ⰼ' => 'ⰼ', - 'Ⰽ' => 'ⰽ', - 'Ⰾ' => 'ⰾ', - 'Ⰿ' => 'ⰿ', - 'Ⱀ' => 'ⱀ', - 'Ⱁ' => 'ⱁ', - 'Ⱂ' => 'ⱂ', - 'Ⱃ' => 'ⱃ', - 'Ⱄ' => 'ⱄ', - 'Ⱅ' => 'ⱅ', - 'Ⱆ' => 'ⱆ', - 'Ⱇ' => 'ⱇ', - 'Ⱈ' => 'ⱈ', - 'Ⱉ' => 'ⱉ', - 'Ⱊ' => 'ⱊ', - 'Ⱋ' => 'ⱋ', - 'Ⱌ' => 'ⱌ', - 'Ⱍ' => 'ⱍ', - 'Ⱎ' => 'ⱎ', - 'Ⱏ' => 'ⱏ', - 'Ⱐ' => 'ⱐ', - 'Ⱑ' => 'ⱑ', - 'Ⱒ' => 'ⱒ', - 'Ⱓ' => 'ⱓ', - 'Ⱔ' => 'ⱔ', - 'Ⱕ' => 'ⱕ', - 'Ⱖ' => 'ⱖ', - 'Ⱗ' => 'ⱗ', - 'Ⱘ' => 'ⱘ', - 'Ⱙ' => 'ⱙ', - 'Ⱚ' => 'ⱚ', - 'Ⱛ' => 'ⱛ', - 'Ⱜ' => 'ⱜ', - 'Ⱝ' => 'ⱝ', - 'Ⱞ' => 'ⱞ', - 'Ⱡ' => 'ⱡ', - 'Ɫ' => 'ɫ', - 'Ᵽ' => 'ᵽ', - 'Ɽ' => 'ɽ', - 'Ⱨ' => 'ⱨ', - 'Ⱪ' => 'ⱪ', - 'Ⱬ' => 'ⱬ', - 'Ɑ' => 'ɑ', - 'Ɱ' => 'ɱ', - 'Ɐ' => 'ɐ', - 'Ɒ' => 'ɒ', - 'Ⱳ' => 'ⱳ', - 'Ⱶ' => 'ⱶ', - 'Ȿ' => 'ȿ', - 'Ɀ' => 'ɀ', - 'Ⲁ' => 'ⲁ', - 'Ⲃ' => 'ⲃ', - 'Ⲅ' => 'ⲅ', - 'Ⲇ' => 'ⲇ', - 'Ⲉ' => 'ⲉ', - 'Ⲋ' => 'ⲋ', - 'Ⲍ' => 'ⲍ', - 'Ⲏ' => 'ⲏ', - 'Ⲑ' => 'ⲑ', - 'Ⲓ' => 'ⲓ', - 'Ⲕ' => 'ⲕ', - 'Ⲗ' => 'ⲗ', - 'Ⲙ' => 'ⲙ', - 'Ⲛ' => 'ⲛ', - 'Ⲝ' => 'ⲝ', - 'Ⲟ' => 'ⲟ', - 'Ⲡ' => 'ⲡ', - 'Ⲣ' => 'ⲣ', - 'Ⲥ' => 'ⲥ', - 'Ⲧ' => 'ⲧ', - 'Ⲩ' => 'ⲩ', - 'Ⲫ' => 'ⲫ', - 'Ⲭ' => 'ⲭ', - 'Ⲯ' => 'ⲯ', - 'Ⲱ' => 'ⲱ', - 'Ⲳ' => 'ⲳ', - 'Ⲵ' => 'ⲵ', - 'Ⲷ' => 'ⲷ', - 'Ⲹ' => 'ⲹ', - 'Ⲻ' => 'ⲻ', - 'Ⲽ' => 'ⲽ', - 'Ⲿ' => 'ⲿ', - 'Ⳁ' => 'ⳁ', - 'Ⳃ' => 'ⳃ', - 'Ⳅ' => 'ⳅ', - 'Ⳇ' => 'ⳇ', - 'Ⳉ' => 'ⳉ', - 'Ⳋ' => 'ⳋ', - 'Ⳍ' => 'ⳍ', - 'Ⳏ' => 'ⳏ', - 'Ⳑ' => 'ⳑ', - 'Ⳓ' => 'ⳓ', - 'Ⳕ' => 'ⳕ', - 'Ⳗ' => 'ⳗ', - 'Ⳙ' => 'ⳙ', - 'Ⳛ' => 'ⳛ', - 'Ⳝ' => 'ⳝ', - 'Ⳟ' => 'ⳟ', - 'Ⳡ' => 'ⳡ', - 'Ⳣ' => 'ⳣ', - 'Ⳬ' => 'ⳬ', - 'Ⳮ' => 'ⳮ', - 'Ⳳ' => 'ⳳ', - 'Ꙁ' => 'ꙁ', - 'Ꙃ' => 'ꙃ', - 'Ꙅ' => 'ꙅ', - 'Ꙇ' => 'ꙇ', - 'Ꙉ' => 'ꙉ', - 'Ꙋ' => 'ꙋ', - 'Ꙍ' => 'ꙍ', - 'Ꙏ' => 'ꙏ', - 'Ꙑ' => 'ꙑ', - 'Ꙓ' => 'ꙓ', - 'Ꙕ' => 'ꙕ', - 'Ꙗ' => 'ꙗ', - 'Ꙙ' => 'ꙙ', - 'Ꙛ' => 'ꙛ', - 'Ꙝ' => 'ꙝ', - 'Ꙟ' => 'ꙟ', - 'Ꙡ' => 'ꙡ', - 'Ꙣ' => 'ꙣ', - 'Ꙥ' => 'ꙥ', - 'Ꙧ' => 'ꙧ', - 'Ꙩ' => 'ꙩ', - 'Ꙫ' => 'ꙫ', - 'Ꙭ' => 'ꙭ', - 'Ꚁ' => 'ꚁ', - 'Ꚃ' => 'ꚃ', - 'Ꚅ' => 'ꚅ', - 'Ꚇ' => 'ꚇ', - 'Ꚉ' => 'ꚉ', - 'Ꚋ' => 'ꚋ', - 'Ꚍ' => 'ꚍ', - 'Ꚏ' => 'ꚏ', - 'Ꚑ' => 'ꚑ', - 'Ꚓ' => 'ꚓ', - 'Ꚕ' => 'ꚕ', - 'Ꚗ' => 'ꚗ', - 'Ꚙ' => 'ꚙ', - 'Ꚛ' => 'ꚛ', - 'Ꜣ' => 'ꜣ', - 'Ꜥ' => 'ꜥ', - 'Ꜧ' => 'ꜧ', - 'Ꜩ' => 'ꜩ', - 'Ꜫ' => 'ꜫ', - 'Ꜭ' => 'ꜭ', - 'Ꜯ' => 'ꜯ', - 'Ꜳ' => 'ꜳ', - 'Ꜵ' => 'ꜵ', - 'Ꜷ' => 'ꜷ', - 'Ꜹ' => 'ꜹ', - 'Ꜻ' => 'ꜻ', - 'Ꜽ' => 'ꜽ', - 'Ꜿ' => 'ꜿ', - 'Ꝁ' => 'ꝁ', - 'Ꝃ' => 'ꝃ', - 'Ꝅ' => 'ꝅ', - 'Ꝇ' => 'ꝇ', - 'Ꝉ' => 'ꝉ', - 'Ꝋ' => 'ꝋ', - 'Ꝍ' => 'ꝍ', - 'Ꝏ' => 'ꝏ', - 'Ꝑ' => 'ꝑ', - 'Ꝓ' => 'ꝓ', - 'Ꝕ' => 'ꝕ', - 'Ꝗ' => 'ꝗ', - 'Ꝙ' => 'ꝙ', - 'Ꝛ' => 'ꝛ', - 'Ꝝ' => 'ꝝ', - 'Ꝟ' => 'ꝟ', - 'Ꝡ' => 'ꝡ', - 'Ꝣ' => 'ꝣ', - 'Ꝥ' => 'ꝥ', - 'Ꝧ' => 'ꝧ', - 'Ꝩ' => 'ꝩ', - 'Ꝫ' => 'ꝫ', - 'Ꝭ' => 'ꝭ', - 'Ꝯ' => 'ꝯ', - 'Ꝺ' => 'ꝺ', - 'Ꝼ' => 'ꝼ', - 'Ᵹ' => 'ᵹ', - 'Ꝿ' => 'ꝿ', - 'Ꞁ' => 'ꞁ', - 'Ꞃ' => 'ꞃ', - 'Ꞅ' => 'ꞅ', - 'Ꞇ' => 'ꞇ', - 'Ꞌ' => 'ꞌ', - 'Ɥ' => 'ɥ', - 'Ꞑ' => 'ꞑ', - 'Ꞓ' => 'ꞓ', - 'Ꞗ' => 'ꞗ', - 'Ꞙ' => 'ꞙ', - 'Ꞛ' => 'ꞛ', - 'Ꞝ' => 'ꞝ', - 'Ꞟ' => 'ꞟ', - 'Ꞡ' => 'ꞡ', - 'Ꞣ' => 'ꞣ', - 'Ꞥ' => 'ꞥ', - 'Ꞧ' => 'ꞧ', - 'Ꞩ' => 'ꞩ', - 'Ɦ' => 'ɦ', - 'Ɜ' => 'ɜ', - 'Ɡ' => 'ɡ', - 'Ɬ' => 'ɬ', - 'Ɪ' => 'ɪ', - 'Ʞ' => 'ʞ', - 'Ʇ' => 'ʇ', - 'Ʝ' => 'ʝ', - 'Ꭓ' => 'ꭓ', - 'Ꞵ' => 'ꞵ', - 'Ꞷ' => 'ꞷ', - 'Ꞹ' => 'ꞹ', - 'Ꞻ' => 'ꞻ', - 'Ꞽ' => 'ꞽ', - 'Ꞿ' => 'ꞿ', - 'Ꟃ' => 'ꟃ', - 'Ꞔ' => 'ꞔ', - 'Ʂ' => 'ʂ', - 'Ᶎ' => 'ᶎ', - 'Ꟈ' => 'ꟈ', - 'Ꟊ' => 'ꟊ', - 'Ꟶ' => 'ꟶ', - 'A' => 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - '𐐀' => '𐐨', - '𐐁' => '𐐩', - '𐐂' => '𐐪', - '𐐃' => '𐐫', - '𐐄' => '𐐬', - '𐐅' => '𐐭', - '𐐆' => '𐐮', - '𐐇' => '𐐯', - '𐐈' => '𐐰', - '𐐉' => '𐐱', - '𐐊' => '𐐲', - '𐐋' => '𐐳', - '𐐌' => '𐐴', - '𐐍' => '𐐵', - '𐐎' => '𐐶', - '𐐏' => '𐐷', - '𐐐' => '𐐸', - '𐐑' => '𐐹', - '𐐒' => '𐐺', - '𐐓' => '𐐻', - '𐐔' => '𐐼', - '𐐕' => '𐐽', - '𐐖' => '𐐾', - '𐐗' => '𐐿', - '𐐘' => '𐑀', - '𐐙' => '𐑁', - '𐐚' => '𐑂', - '𐐛' => '𐑃', - '𐐜' => '𐑄', - '𐐝' => '𐑅', - '𐐞' => '𐑆', - '𐐟' => '𐑇', - '𐐠' => '𐑈', - '𐐡' => '𐑉', - '𐐢' => '𐑊', - '𐐣' => '𐑋', - '𐐤' => '𐑌', - '𐐥' => '𐑍', - '𐐦' => '𐑎', - '𐐧' => '𐑏', - '𐒰' => '𐓘', - '𐒱' => '𐓙', - '𐒲' => '𐓚', - '𐒳' => '𐓛', - '𐒴' => '𐓜', - '𐒵' => '𐓝', - '𐒶' => '𐓞', - '𐒷' => '𐓟', - '𐒸' => '𐓠', - '𐒹' => '𐓡', - '𐒺' => '𐓢', - '𐒻' => '𐓣', - '𐒼' => '𐓤', - '𐒽' => '𐓥', - '𐒾' => '𐓦', - '𐒿' => '𐓧', - '𐓀' => '𐓨', - '𐓁' => '𐓩', - '𐓂' => '𐓪', - '𐓃' => '𐓫', - '𐓄' => '𐓬', - '𐓅' => '𐓭', - '𐓆' => '𐓮', - '𐓇' => '𐓯', - '𐓈' => '𐓰', - '𐓉' => '𐓱', - '𐓊' => '𐓲', - '𐓋' => '𐓳', - '𐓌' => '𐓴', - '𐓍' => '𐓵', - '𐓎' => '𐓶', - '𐓏' => '𐓷', - '𐓐' => '𐓸', - '𐓑' => '𐓹', - '𐓒' => '𐓺', - '𐓓' => '𐓻', - '𐲀' => '𐳀', - '𐲁' => '𐳁', - '𐲂' => '𐳂', - '𐲃' => '𐳃', - '𐲄' => '𐳄', - '𐲅' => '𐳅', - '𐲆' => '𐳆', - '𐲇' => '𐳇', - '𐲈' => '𐳈', - '𐲉' => '𐳉', - '𐲊' => '𐳊', - '𐲋' => '𐳋', - '𐲌' => '𐳌', - '𐲍' => '𐳍', - '𐲎' => '𐳎', - '𐲏' => '𐳏', - '𐲐' => '𐳐', - '𐲑' => '𐳑', - '𐲒' => '𐳒', - '𐲓' => '𐳓', - '𐲔' => '𐳔', - '𐲕' => '𐳕', - '𐲖' => '𐳖', - '𐲗' => '𐳗', - '𐲘' => '𐳘', - '𐲙' => '𐳙', - '𐲚' => '𐳚', - '𐲛' => '𐳛', - '𐲜' => '𐳜', - '𐲝' => '𐳝', - '𐲞' => '𐳞', - '𐲟' => '𐳟', - '𐲠' => '𐳠', - '𐲡' => '𐳡', - '𐲢' => '𐳢', - '𐲣' => '𐳣', - '𐲤' => '𐳤', - '𐲥' => '𐳥', - '𐲦' => '𐳦', - '𐲧' => '𐳧', - '𐲨' => '𐳨', - '𐲩' => '𐳩', - '𐲪' => '𐳪', - '𐲫' => '𐳫', - '𐲬' => '𐳬', - '𐲭' => '𐳭', - '𐲮' => '𐳮', - '𐲯' => '𐳯', - '𐲰' => '𐳰', - '𐲱' => '𐳱', - '𐲲' => '𐳲', - '𑢠' => '𑣀', - '𑢡' => '𑣁', - '𑢢' => '𑣂', - '𑢣' => '𑣃', - '𑢤' => '𑣄', - '𑢥' => '𑣅', - '𑢦' => '𑣆', - '𑢧' => '𑣇', - '𑢨' => '𑣈', - '𑢩' => '𑣉', - '𑢪' => '𑣊', - '𑢫' => '𑣋', - '𑢬' => '𑣌', - '𑢭' => '𑣍', - '𑢮' => '𑣎', - '𑢯' => '𑣏', - '𑢰' => '𑣐', - '𑢱' => '𑣑', - '𑢲' => '𑣒', - '𑢳' => '𑣓', - '𑢴' => '𑣔', - '𑢵' => '𑣕', - '𑢶' => '𑣖', - '𑢷' => '𑣗', - '𑢸' => '𑣘', - '𑢹' => '𑣙', - '𑢺' => '𑣚', - '𑢻' => '𑣛', - '𑢼' => '𑣜', - '𑢽' => '𑣝', - '𑢾' => '𑣞', - '𑢿' => '𑣟', - '𖹀' => '𖹠', - '𖹁' => '𖹡', - '𖹂' => '𖹢', - '𖹃' => '𖹣', - '𖹄' => '𖹤', - '𖹅' => '𖹥', - '𖹆' => '𖹦', - '𖹇' => '𖹧', - '𖹈' => '𖹨', - '𖹉' => '𖹩', - '𖹊' => '𖹪', - '𖹋' => '𖹫', - '𖹌' => '𖹬', - '𖹍' => '𖹭', - '𖹎' => '𖹮', - '𖹏' => '𖹯', - '𖹐' => '𖹰', - '𖹑' => '𖹱', - '𖹒' => '𖹲', - '𖹓' => '𖹳', - '𖹔' => '𖹴', - '𖹕' => '𖹵', - '𖹖' => '𖹶', - '𖹗' => '𖹷', - '𖹘' => '𖹸', - '𖹙' => '𖹹', - '𖹚' => '𖹺', - '𖹛' => '𖹻', - '𖹜' => '𖹼', - '𖹝' => '𖹽', - '𖹞' => '𖹾', - '𖹟' => '𖹿', - '𞤀' => '𞤢', - '𞤁' => '𞤣', - '𞤂' => '𞤤', - '𞤃' => '𞤥', - '𞤄' => '𞤦', - '𞤅' => '𞤧', - '𞤆' => '𞤨', - '𞤇' => '𞤩', - '𞤈' => '𞤪', - '𞤉' => '𞤫', - '𞤊' => '𞤬', - '𞤋' => '𞤭', - '𞤌' => '𞤮', - '𞤍' => '𞤯', - '𞤎' => '𞤰', - '𞤏' => '𞤱', - '𞤐' => '𞤲', - '𞤑' => '𞤳', - '𞤒' => '𞤴', - '𞤓' => '𞤵', - '𞤔' => '𞤶', - '𞤕' => '𞤷', - '𞤖' => '𞤸', - '𞤗' => '𞤹', - '𞤘' => '𞤺', - '𞤙' => '𞤻', - '𞤚' => '𞤼', - '𞤛' => '𞤽', - '𞤜' => '𞤾', - '𞤝' => '𞤿', - '𞤞' => '𞥀', - '𞤟' => '𞥁', - '𞤠' => '𞥂', - '𞤡' => '𞥃', -); diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php deleted file mode 100644 index 2a8f6e73..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +++ /dev/null @@ -1,5 +0,0 @@ - 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - 'µ' => 'Μ', - 'à' => 'À', - 'á' => 'Á', - 'â' => 'Â', - 'ã' => 'Ã', - 'ä' => 'Ä', - 'å' => 'Å', - 'æ' => 'Æ', - 'ç' => 'Ç', - 'è' => 'È', - 'é' => 'É', - 'ê' => 'Ê', - 'ë' => 'Ë', - 'ì' => 'Ì', - 'í' => 'Í', - 'î' => 'Î', - 'ï' => 'Ï', - 'ð' => 'Ð', - 'ñ' => 'Ñ', - 'ò' => 'Ò', - 'ó' => 'Ó', - 'ô' => 'Ô', - 'õ' => 'Õ', - 'ö' => 'Ö', - 'ø' => 'Ø', - 'ù' => 'Ù', - 'ú' => 'Ú', - 'û' => 'Û', - 'ü' => 'Ü', - 'ý' => 'Ý', - 'þ' => 'Þ', - 'ÿ' => 'Ÿ', - 'ā' => 'Ā', - 'ă' => 'Ă', - 'ą' => 'Ą', - 'ć' => 'Ć', - 'ĉ' => 'Ĉ', - 'ċ' => 'Ċ', - 'č' => 'Č', - 'ď' => 'Ď', - 'đ' => 'Đ', - 'ē' => 'Ē', - 'ĕ' => 'Ĕ', - 'ė' => 'Ė', - 'ę' => 'Ę', - 'ě' => 'Ě', - 'ĝ' => 'Ĝ', - 'ğ' => 'Ğ', - 'ġ' => 'Ġ', - 'ģ' => 'Ģ', - 'ĥ' => 'Ĥ', - 'ħ' => 'Ħ', - 'ĩ' => 'Ĩ', - 'ī' => 'Ī', - 'ĭ' => 'Ĭ', - 'į' => 'Į', - 'ı' => 'I', - 'ij' => 'IJ', - 'ĵ' => 'Ĵ', - 'ķ' => 'Ķ', - 'ĺ' => 'Ĺ', - 'ļ' => 'Ļ', - 'ľ' => 'Ľ', - 'ŀ' => 'Ŀ', - 'ł' => 'Ł', - 'ń' => 'Ń', - 'ņ' => 'Ņ', - 'ň' => 'Ň', - 'ŋ' => 'Ŋ', - 'ō' => 'Ō', - 'ŏ' => 'Ŏ', - 'ő' => 'Ő', - 'œ' => 'Œ', - 'ŕ' => 'Ŕ', - 'ŗ' => 'Ŗ', - 'ř' => 'Ř', - 'ś' => 'Ś', - 'ŝ' => 'Ŝ', - 'ş' => 'Ş', - 'š' => 'Š', - 'ţ' => 'Ţ', - 'ť' => 'Ť', - 'ŧ' => 'Ŧ', - 'ũ' => 'Ũ', - 'ū' => 'Ū', - 'ŭ' => 'Ŭ', - 'ů' => 'Ů', - 'ű' => 'Ű', - 'ų' => 'Ų', - 'ŵ' => 'Ŵ', - 'ŷ' => 'Ŷ', - 'ź' => 'Ź', - 'ż' => 'Ż', - 'ž' => 'Ž', - 'ſ' => 'S', - 'ƀ' => 'Ƀ', - 'ƃ' => 'Ƃ', - 'ƅ' => 'Ƅ', - 'ƈ' => 'Ƈ', - 'ƌ' => 'Ƌ', - 'ƒ' => 'Ƒ', - 'ƕ' => 'Ƕ', - 'ƙ' => 'Ƙ', - 'ƚ' => 'Ƚ', - 'ƞ' => 'Ƞ', - 'ơ' => 'Ơ', - 'ƣ' => 'Ƣ', - 'ƥ' => 'Ƥ', - 'ƨ' => 'Ƨ', - 'ƭ' => 'Ƭ', - 'ư' => 'Ư', - 'ƴ' => 'Ƴ', - 'ƶ' => 'Ƶ', - 'ƹ' => 'Ƹ', - 'ƽ' => 'Ƽ', - 'ƿ' => 'Ƿ', - 'Dž' => 'DŽ', - 'dž' => 'DŽ', - 'Lj' => 'LJ', - 'lj' => 'LJ', - 'Nj' => 'NJ', - 'nj' => 'NJ', - 'ǎ' => 'Ǎ', - 'ǐ' => 'Ǐ', - 'ǒ' => 'Ǒ', - 'ǔ' => 'Ǔ', - 'ǖ' => 'Ǖ', - 'ǘ' => 'Ǘ', - 'ǚ' => 'Ǚ', - 'ǜ' => 'Ǜ', - 'ǝ' => 'Ǝ', - 'ǟ' => 'Ǟ', - 'ǡ' => 'Ǡ', - 'ǣ' => 'Ǣ', - 'ǥ' => 'Ǥ', - 'ǧ' => 'Ǧ', - 'ǩ' => 'Ǩ', - 'ǫ' => 'Ǫ', - 'ǭ' => 'Ǭ', - 'ǯ' => 'Ǯ', - 'Dz' => 'DZ', - 'dz' => 'DZ', - 'ǵ' => 'Ǵ', - 'ǹ' => 'Ǹ', - 'ǻ' => 'Ǻ', - 'ǽ' => 'Ǽ', - 'ǿ' => 'Ǿ', - 'ȁ' => 'Ȁ', - 'ȃ' => 'Ȃ', - 'ȅ' => 'Ȅ', - 'ȇ' => 'Ȇ', - 'ȉ' => 'Ȉ', - 'ȋ' => 'Ȋ', - 'ȍ' => 'Ȍ', - 'ȏ' => 'Ȏ', - 'ȑ' => 'Ȑ', - 'ȓ' => 'Ȓ', - 'ȕ' => 'Ȕ', - 'ȗ' => 'Ȗ', - 'ș' => 'Ș', - 'ț' => 'Ț', - 'ȝ' => 'Ȝ', - 'ȟ' => 'Ȟ', - 'ȣ' => 'Ȣ', - 'ȥ' => 'Ȥ', - 'ȧ' => 'Ȧ', - 'ȩ' => 'Ȩ', - 'ȫ' => 'Ȫ', - 'ȭ' => 'Ȭ', - 'ȯ' => 'Ȯ', - 'ȱ' => 'Ȱ', - 'ȳ' => 'Ȳ', - 'ȼ' => 'Ȼ', - 'ȿ' => 'Ȿ', - 'ɀ' => 'Ɀ', - 'ɂ' => 'Ɂ', - 'ɇ' => 'Ɇ', - 'ɉ' => 'Ɉ', - 'ɋ' => 'Ɋ', - 'ɍ' => 'Ɍ', - 'ɏ' => 'Ɏ', - 'ɐ' => 'Ɐ', - 'ɑ' => 'Ɑ', - 'ɒ' => 'Ɒ', - 'ɓ' => 'Ɓ', - 'ɔ' => 'Ɔ', - 'ɖ' => 'Ɖ', - 'ɗ' => 'Ɗ', - 'ə' => 'Ə', - 'ɛ' => 'Ɛ', - 'ɜ' => 'Ɜ', - 'ɠ' => 'Ɠ', - 'ɡ' => 'Ɡ', - 'ɣ' => 'Ɣ', - 'ɥ' => 'Ɥ', - 'ɦ' => 'Ɦ', - 'ɨ' => 'Ɨ', - 'ɩ' => 'Ɩ', - 'ɪ' => 'Ɪ', - 'ɫ' => 'Ɫ', - 'ɬ' => 'Ɬ', - 'ɯ' => 'Ɯ', - 'ɱ' => 'Ɱ', - 'ɲ' => 'Ɲ', - 'ɵ' => 'Ɵ', - 'ɽ' => 'Ɽ', - 'ʀ' => 'Ʀ', - 'ʂ' => 'Ʂ', - 'ʃ' => 'Ʃ', - 'ʇ' => 'Ʇ', - 'ʈ' => 'Ʈ', - 'ʉ' => 'Ʉ', - 'ʊ' => 'Ʊ', - 'ʋ' => 'Ʋ', - 'ʌ' => 'Ʌ', - 'ʒ' => 'Ʒ', - 'ʝ' => 'Ʝ', - 'ʞ' => 'Ʞ', - 'ͅ' => 'Ι', - 'ͱ' => 'Ͱ', - 'ͳ' => 'Ͳ', - 'ͷ' => 'Ͷ', - 'ͻ' => 'Ͻ', - 'ͼ' => 'Ͼ', - 'ͽ' => 'Ͽ', - 'ά' => 'Ά', - 'έ' => 'Έ', - 'ή' => 'Ή', - 'ί' => 'Ί', - 'α' => 'Α', - 'β' => 'Β', - 'γ' => 'Γ', - 'δ' => 'Δ', - 'ε' => 'Ε', - 'ζ' => 'Ζ', - 'η' => 'Η', - 'θ' => 'Θ', - 'ι' => 'Ι', - 'κ' => 'Κ', - 'λ' => 'Λ', - 'μ' => 'Μ', - 'ν' => 'Ν', - 'ξ' => 'Ξ', - 'ο' => 'Ο', - 'π' => 'Π', - 'ρ' => 'Ρ', - 'ς' => 'Σ', - 'σ' => 'Σ', - 'τ' => 'Τ', - 'υ' => 'Υ', - 'φ' => 'Φ', - 'χ' => 'Χ', - 'ψ' => 'Ψ', - 'ω' => 'Ω', - 'ϊ' => 'Ϊ', - 'ϋ' => 'Ϋ', - 'ό' => 'Ό', - 'ύ' => 'Ύ', - 'ώ' => 'Ώ', - 'ϐ' => 'Β', - 'ϑ' => 'Θ', - 'ϕ' => 'Φ', - 'ϖ' => 'Π', - 'ϗ' => 'Ϗ', - 'ϙ' => 'Ϙ', - 'ϛ' => 'Ϛ', - 'ϝ' => 'Ϝ', - 'ϟ' => 'Ϟ', - 'ϡ' => 'Ϡ', - 'ϣ' => 'Ϣ', - 'ϥ' => 'Ϥ', - 'ϧ' => 'Ϧ', - 'ϩ' => 'Ϩ', - 'ϫ' => 'Ϫ', - 'ϭ' => 'Ϭ', - 'ϯ' => 'Ϯ', - 'ϰ' => 'Κ', - 'ϱ' => 'Ρ', - 'ϲ' => 'Ϲ', - 'ϳ' => 'Ϳ', - 'ϵ' => 'Ε', - 'ϸ' => 'Ϸ', - 'ϻ' => 'Ϻ', - 'а' => 'А', - 'б' => 'Б', - 'в' => 'В', - 'г' => 'Г', - 'д' => 'Д', - 'е' => 'Е', - 'ж' => 'Ж', - 'з' => 'З', - 'и' => 'И', - 'й' => 'Й', - 'к' => 'К', - 'л' => 'Л', - 'м' => 'М', - 'н' => 'Н', - 'о' => 'О', - 'п' => 'П', - 'р' => 'Р', - 'с' => 'С', - 'т' => 'Т', - 'у' => 'У', - 'ф' => 'Ф', - 'х' => 'Х', - 'ц' => 'Ц', - 'ч' => 'Ч', - 'ш' => 'Ш', - 'щ' => 'Щ', - 'ъ' => 'Ъ', - 'ы' => 'Ы', - 'ь' => 'Ь', - 'э' => 'Э', - 'ю' => 'Ю', - 'я' => 'Я', - 'ѐ' => 'Ѐ', - 'ё' => 'Ё', - 'ђ' => 'Ђ', - 'ѓ' => 'Ѓ', - 'є' => 'Є', - 'ѕ' => 'Ѕ', - 'і' => 'І', - 'ї' => 'Ї', - 'ј' => 'Ј', - 'љ' => 'Љ', - 'њ' => 'Њ', - 'ћ' => 'Ћ', - 'ќ' => 'Ќ', - 'ѝ' => 'Ѝ', - 'ў' => 'Ў', - 'џ' => 'Џ', - 'ѡ' => 'Ѡ', - 'ѣ' => 'Ѣ', - 'ѥ' => 'Ѥ', - 'ѧ' => 'Ѧ', - 'ѩ' => 'Ѩ', - 'ѫ' => 'Ѫ', - 'ѭ' => 'Ѭ', - 'ѯ' => 'Ѯ', - 'ѱ' => 'Ѱ', - 'ѳ' => 'Ѳ', - 'ѵ' => 'Ѵ', - 'ѷ' => 'Ѷ', - 'ѹ' => 'Ѹ', - 'ѻ' => 'Ѻ', - 'ѽ' => 'Ѽ', - 'ѿ' => 'Ѿ', - 'ҁ' => 'Ҁ', - 'ҋ' => 'Ҋ', - 'ҍ' => 'Ҍ', - 'ҏ' => 'Ҏ', - 'ґ' => 'Ґ', - 'ғ' => 'Ғ', - 'ҕ' => 'Ҕ', - 'җ' => 'Җ', - 'ҙ' => 'Ҙ', - 'қ' => 'Қ', - 'ҝ' => 'Ҝ', - 'ҟ' => 'Ҟ', - 'ҡ' => 'Ҡ', - 'ң' => 'Ң', - 'ҥ' => 'Ҥ', - 'ҧ' => 'Ҧ', - 'ҩ' => 'Ҩ', - 'ҫ' => 'Ҫ', - 'ҭ' => 'Ҭ', - 'ү' => 'Ү', - 'ұ' => 'Ұ', - 'ҳ' => 'Ҳ', - 'ҵ' => 'Ҵ', - 'ҷ' => 'Ҷ', - 'ҹ' => 'Ҹ', - 'һ' => 'Һ', - 'ҽ' => 'Ҽ', - 'ҿ' => 'Ҿ', - 'ӂ' => 'Ӂ', - 'ӄ' => 'Ӄ', - 'ӆ' => 'Ӆ', - 'ӈ' => 'Ӈ', - 'ӊ' => 'Ӊ', - 'ӌ' => 'Ӌ', - 'ӎ' => 'Ӎ', - 'ӏ' => 'Ӏ', - 'ӑ' => 'Ӑ', - 'ӓ' => 'Ӓ', - 'ӕ' => 'Ӕ', - 'ӗ' => 'Ӗ', - 'ә' => 'Ә', - 'ӛ' => 'Ӛ', - 'ӝ' => 'Ӝ', - 'ӟ' => 'Ӟ', - 'ӡ' => 'Ӡ', - 'ӣ' => 'Ӣ', - 'ӥ' => 'Ӥ', - 'ӧ' => 'Ӧ', - 'ө' => 'Ө', - 'ӫ' => 'Ӫ', - 'ӭ' => 'Ӭ', - 'ӯ' => 'Ӯ', - 'ӱ' => 'Ӱ', - 'ӳ' => 'Ӳ', - 'ӵ' => 'Ӵ', - 'ӷ' => 'Ӷ', - 'ӹ' => 'Ӹ', - 'ӻ' => 'Ӻ', - 'ӽ' => 'Ӽ', - 'ӿ' => 'Ӿ', - 'ԁ' => 'Ԁ', - 'ԃ' => 'Ԃ', - 'ԅ' => 'Ԅ', - 'ԇ' => 'Ԇ', - 'ԉ' => 'Ԉ', - 'ԋ' => 'Ԋ', - 'ԍ' => 'Ԍ', - 'ԏ' => 'Ԏ', - 'ԑ' => 'Ԑ', - 'ԓ' => 'Ԓ', - 'ԕ' => 'Ԕ', - 'ԗ' => 'Ԗ', - 'ԙ' => 'Ԙ', - 'ԛ' => 'Ԛ', - 'ԝ' => 'Ԝ', - 'ԟ' => 'Ԟ', - 'ԡ' => 'Ԡ', - 'ԣ' => 'Ԣ', - 'ԥ' => 'Ԥ', - 'ԧ' => 'Ԧ', - 'ԩ' => 'Ԩ', - 'ԫ' => 'Ԫ', - 'ԭ' => 'Ԭ', - 'ԯ' => 'Ԯ', - 'ա' => 'Ա', - 'բ' => 'Բ', - 'գ' => 'Գ', - 'դ' => 'Դ', - 'ե' => 'Ե', - 'զ' => 'Զ', - 'է' => 'Է', - 'ը' => 'Ը', - 'թ' => 'Թ', - 'ժ' => 'Ժ', - 'ի' => 'Ի', - 'լ' => 'Լ', - 'խ' => 'Խ', - 'ծ' => 'Ծ', - 'կ' => 'Կ', - 'հ' => 'Հ', - 'ձ' => 'Ձ', - 'ղ' => 'Ղ', - 'ճ' => 'Ճ', - 'մ' => 'Մ', - 'յ' => 'Յ', - 'ն' => 'Ն', - 'շ' => 'Շ', - 'ո' => 'Ո', - 'չ' => 'Չ', - 'պ' => 'Պ', - 'ջ' => 'Ջ', - 'ռ' => 'Ռ', - 'ս' => 'Ս', - 'վ' => 'Վ', - 'տ' => 'Տ', - 'ր' => 'Ր', - 'ց' => 'Ց', - 'ւ' => 'Ւ', - 'փ' => 'Փ', - 'ք' => 'Ք', - 'օ' => 'Օ', - 'ֆ' => 'Ֆ', - 'ა' => 'Ა', - 'ბ' => 'Ბ', - 'გ' => 'Გ', - 'დ' => 'Დ', - 'ე' => 'Ე', - 'ვ' => 'Ვ', - 'ზ' => 'Ზ', - 'თ' => 'Თ', - 'ი' => 'Ი', - 'კ' => 'Კ', - 'ლ' => 'Ლ', - 'მ' => 'Მ', - 'ნ' => 'Ნ', - 'ო' => 'Ო', - 'პ' => 'Პ', - 'ჟ' => 'Ჟ', - 'რ' => 'Რ', - 'ს' => 'Ს', - 'ტ' => 'Ტ', - 'უ' => 'Უ', - 'ფ' => 'Ფ', - 'ქ' => 'Ქ', - 'ღ' => 'Ღ', - 'ყ' => 'Ყ', - 'შ' => 'Შ', - 'ჩ' => 'Ჩ', - 'ც' => 'Ც', - 'ძ' => 'Ძ', - 'წ' => 'Წ', - 'ჭ' => 'Ჭ', - 'ხ' => 'Ხ', - 'ჯ' => 'Ჯ', - 'ჰ' => 'Ჰ', - 'ჱ' => 'Ჱ', - 'ჲ' => 'Ჲ', - 'ჳ' => 'Ჳ', - 'ჴ' => 'Ჴ', - 'ჵ' => 'Ჵ', - 'ჶ' => 'Ჶ', - 'ჷ' => 'Ჷ', - 'ჸ' => 'Ჸ', - 'ჹ' => 'Ჹ', - 'ჺ' => 'Ჺ', - 'ჽ' => 'Ჽ', - 'ჾ' => 'Ჾ', - 'ჿ' => 'Ჿ', - 'ᏸ' => 'Ᏸ', - 'ᏹ' => 'Ᏹ', - 'ᏺ' => 'Ᏺ', - 'ᏻ' => 'Ᏻ', - 'ᏼ' => 'Ᏼ', - 'ᏽ' => 'Ᏽ', - 'ᲀ' => 'В', - 'ᲁ' => 'Д', - 'ᲂ' => 'О', - 'ᲃ' => 'С', - 'ᲄ' => 'Т', - 'ᲅ' => 'Т', - 'ᲆ' => 'Ъ', - 'ᲇ' => 'Ѣ', - 'ᲈ' => 'Ꙋ', - 'ᵹ' => 'Ᵹ', - 'ᵽ' => 'Ᵽ', - 'ᶎ' => 'Ᶎ', - 'ḁ' => 'Ḁ', - 'ḃ' => 'Ḃ', - 'ḅ' => 'Ḅ', - 'ḇ' => 'Ḇ', - 'ḉ' => 'Ḉ', - 'ḋ' => 'Ḋ', - 'ḍ' => 'Ḍ', - 'ḏ' => 'Ḏ', - 'ḑ' => 'Ḑ', - 'ḓ' => 'Ḓ', - 'ḕ' => 'Ḕ', - 'ḗ' => 'Ḗ', - 'ḙ' => 'Ḙ', - 'ḛ' => 'Ḛ', - 'ḝ' => 'Ḝ', - 'ḟ' => 'Ḟ', - 'ḡ' => 'Ḡ', - 'ḣ' => 'Ḣ', - 'ḥ' => 'Ḥ', - 'ḧ' => 'Ḧ', - 'ḩ' => 'Ḩ', - 'ḫ' => 'Ḫ', - 'ḭ' => 'Ḭ', - 'ḯ' => 'Ḯ', - 'ḱ' => 'Ḱ', - 'ḳ' => 'Ḳ', - 'ḵ' => 'Ḵ', - 'ḷ' => 'Ḷ', - 'ḹ' => 'Ḹ', - 'ḻ' => 'Ḻ', - 'ḽ' => 'Ḽ', - 'ḿ' => 'Ḿ', - 'ṁ' => 'Ṁ', - 'ṃ' => 'Ṃ', - 'ṅ' => 'Ṅ', - 'ṇ' => 'Ṇ', - 'ṉ' => 'Ṉ', - 'ṋ' => 'Ṋ', - 'ṍ' => 'Ṍ', - 'ṏ' => 'Ṏ', - 'ṑ' => 'Ṑ', - 'ṓ' => 'Ṓ', - 'ṕ' => 'Ṕ', - 'ṗ' => 'Ṗ', - 'ṙ' => 'Ṙ', - 'ṛ' => 'Ṛ', - 'ṝ' => 'Ṝ', - 'ṟ' => 'Ṟ', - 'ṡ' => 'Ṡ', - 'ṣ' => 'Ṣ', - 'ṥ' => 'Ṥ', - 'ṧ' => 'Ṧ', - 'ṩ' => 'Ṩ', - 'ṫ' => 'Ṫ', - 'ṭ' => 'Ṭ', - 'ṯ' => 'Ṯ', - 'ṱ' => 'Ṱ', - 'ṳ' => 'Ṳ', - 'ṵ' => 'Ṵ', - 'ṷ' => 'Ṷ', - 'ṹ' => 'Ṹ', - 'ṻ' => 'Ṻ', - 'ṽ' => 'Ṽ', - 'ṿ' => 'Ṿ', - 'ẁ' => 'Ẁ', - 'ẃ' => 'Ẃ', - 'ẅ' => 'Ẅ', - 'ẇ' => 'Ẇ', - 'ẉ' => 'Ẉ', - 'ẋ' => 'Ẋ', - 'ẍ' => 'Ẍ', - 'ẏ' => 'Ẏ', - 'ẑ' => 'Ẑ', - 'ẓ' => 'Ẓ', - 'ẕ' => 'Ẕ', - 'ẛ' => 'Ṡ', - 'ạ' => 'Ạ', - 'ả' => 'Ả', - 'ấ' => 'Ấ', - 'ầ' => 'Ầ', - 'ẩ' => 'Ẩ', - 'ẫ' => 'Ẫ', - 'ậ' => 'Ậ', - 'ắ' => 'Ắ', - 'ằ' => 'Ằ', - 'ẳ' => 'Ẳ', - 'ẵ' => 'Ẵ', - 'ặ' => 'Ặ', - 'ẹ' => 'Ẹ', - 'ẻ' => 'Ẻ', - 'ẽ' => 'Ẽ', - 'ế' => 'Ế', - 'ề' => 'Ề', - 'ể' => 'Ể', - 'ễ' => 'Ễ', - 'ệ' => 'Ệ', - 'ỉ' => 'Ỉ', - 'ị' => 'Ị', - 'ọ' => 'Ọ', - 'ỏ' => 'Ỏ', - 'ố' => 'Ố', - 'ồ' => 'Ồ', - 'ổ' => 'Ổ', - 'ỗ' => 'Ỗ', - 'ộ' => 'Ộ', - 'ớ' => 'Ớ', - 'ờ' => 'Ờ', - 'ở' => 'Ở', - 'ỡ' => 'Ỡ', - 'ợ' => 'Ợ', - 'ụ' => 'Ụ', - 'ủ' => 'Ủ', - 'ứ' => 'Ứ', - 'ừ' => 'Ừ', - 'ử' => 'Ử', - 'ữ' => 'Ữ', - 'ự' => 'Ự', - 'ỳ' => 'Ỳ', - 'ỵ' => 'Ỵ', - 'ỷ' => 'Ỷ', - 'ỹ' => 'Ỹ', - 'ỻ' => 'Ỻ', - 'ỽ' => 'Ỽ', - 'ỿ' => 'Ỿ', - 'ἀ' => 'Ἀ', - 'ἁ' => 'Ἁ', - 'ἂ' => 'Ἂ', - 'ἃ' => 'Ἃ', - 'ἄ' => 'Ἄ', - 'ἅ' => 'Ἅ', - 'ἆ' => 'Ἆ', - 'ἇ' => 'Ἇ', - 'ἐ' => 'Ἐ', - 'ἑ' => 'Ἑ', - 'ἒ' => 'Ἒ', - 'ἓ' => 'Ἓ', - 'ἔ' => 'Ἔ', - 'ἕ' => 'Ἕ', - 'ἠ' => 'Ἠ', - 'ἡ' => 'Ἡ', - 'ἢ' => 'Ἢ', - 'ἣ' => 'Ἣ', - 'ἤ' => 'Ἤ', - 'ἥ' => 'Ἥ', - 'ἦ' => 'Ἦ', - 'ἧ' => 'Ἧ', - 'ἰ' => 'Ἰ', - 'ἱ' => 'Ἱ', - 'ἲ' => 'Ἲ', - 'ἳ' => 'Ἳ', - 'ἴ' => 'Ἴ', - 'ἵ' => 'Ἵ', - 'ἶ' => 'Ἶ', - 'ἷ' => 'Ἷ', - 'ὀ' => 'Ὀ', - 'ὁ' => 'Ὁ', - 'ὂ' => 'Ὂ', - 'ὃ' => 'Ὃ', - 'ὄ' => 'Ὄ', - 'ὅ' => 'Ὅ', - 'ὑ' => 'Ὑ', - 'ὓ' => 'Ὓ', - 'ὕ' => 'Ὕ', - 'ὗ' => 'Ὗ', - 'ὠ' => 'Ὠ', - 'ὡ' => 'Ὡ', - 'ὢ' => 'Ὢ', - 'ὣ' => 'Ὣ', - 'ὤ' => 'Ὤ', - 'ὥ' => 'Ὥ', - 'ὦ' => 'Ὦ', - 'ὧ' => 'Ὧ', - 'ὰ' => 'Ὰ', - 'ά' => 'Ά', - 'ὲ' => 'Ὲ', - 'έ' => 'Έ', - 'ὴ' => 'Ὴ', - 'ή' => 'Ή', - 'ὶ' => 'Ὶ', - 'ί' => 'Ί', - 'ὸ' => 'Ὸ', - 'ό' => 'Ό', - 'ὺ' => 'Ὺ', - 'ύ' => 'Ύ', - 'ὼ' => 'Ὼ', - 'ώ' => 'Ώ', - 'ᾀ' => 'ἈΙ', - 'ᾁ' => 'ἉΙ', - 'ᾂ' => 'ἊΙ', - 'ᾃ' => 'ἋΙ', - 'ᾄ' => 'ἌΙ', - 'ᾅ' => 'ἍΙ', - 'ᾆ' => 'ἎΙ', - 'ᾇ' => 'ἏΙ', - 'ᾐ' => 'ἨΙ', - 'ᾑ' => 'ἩΙ', - 'ᾒ' => 'ἪΙ', - 'ᾓ' => 'ἫΙ', - 'ᾔ' => 'ἬΙ', - 'ᾕ' => 'ἭΙ', - 'ᾖ' => 'ἮΙ', - 'ᾗ' => 'ἯΙ', - 'ᾠ' => 'ὨΙ', - 'ᾡ' => 'ὩΙ', - 'ᾢ' => 'ὪΙ', - 'ᾣ' => 'ὫΙ', - 'ᾤ' => 'ὬΙ', - 'ᾥ' => 'ὭΙ', - 'ᾦ' => 'ὮΙ', - 'ᾧ' => 'ὯΙ', - 'ᾰ' => 'Ᾰ', - 'ᾱ' => 'Ᾱ', - 'ᾳ' => 'ΑΙ', - 'ι' => 'Ι', - 'ῃ' => 'ΗΙ', - 'ῐ' => 'Ῐ', - 'ῑ' => 'Ῑ', - 'ῠ' => 'Ῠ', - 'ῡ' => 'Ῡ', - 'ῥ' => 'Ῥ', - 'ῳ' => 'ΩΙ', - 'ⅎ' => 'Ⅎ', - 'ⅰ' => 'Ⅰ', - 'ⅱ' => 'Ⅱ', - 'ⅲ' => 'Ⅲ', - 'ⅳ' => 'Ⅳ', - 'ⅴ' => 'Ⅴ', - 'ⅵ' => 'Ⅵ', - 'ⅶ' => 'Ⅶ', - 'ⅷ' => 'Ⅷ', - 'ⅸ' => 'Ⅸ', - 'ⅹ' => 'Ⅹ', - 'ⅺ' => 'Ⅺ', - 'ⅻ' => 'Ⅻ', - 'ⅼ' => 'Ⅼ', - 'ⅽ' => 'Ⅽ', - 'ⅾ' => 'Ⅾ', - 'ⅿ' => 'Ⅿ', - 'ↄ' => 'Ↄ', - 'ⓐ' => 'Ⓐ', - 'ⓑ' => 'Ⓑ', - 'ⓒ' => 'Ⓒ', - 'ⓓ' => 'Ⓓ', - 'ⓔ' => 'Ⓔ', - 'ⓕ' => 'Ⓕ', - 'ⓖ' => 'Ⓖ', - 'ⓗ' => 'Ⓗ', - 'ⓘ' => 'Ⓘ', - 'ⓙ' => 'Ⓙ', - 'ⓚ' => 'Ⓚ', - 'ⓛ' => 'Ⓛ', - 'ⓜ' => 'Ⓜ', - 'ⓝ' => 'Ⓝ', - 'ⓞ' => 'Ⓞ', - 'ⓟ' => 'Ⓟ', - 'ⓠ' => 'Ⓠ', - 'ⓡ' => 'Ⓡ', - 'ⓢ' => 'Ⓢ', - 'ⓣ' => 'Ⓣ', - 'ⓤ' => 'Ⓤ', - 'ⓥ' => 'Ⓥ', - 'ⓦ' => 'Ⓦ', - 'ⓧ' => 'Ⓧ', - 'ⓨ' => 'Ⓨ', - 'ⓩ' => 'Ⓩ', - 'ⰰ' => 'Ⰰ', - 'ⰱ' => 'Ⰱ', - 'ⰲ' => 'Ⰲ', - 'ⰳ' => 'Ⰳ', - 'ⰴ' => 'Ⰴ', - 'ⰵ' => 'Ⰵ', - 'ⰶ' => 'Ⰶ', - 'ⰷ' => 'Ⰷ', - 'ⰸ' => 'Ⰸ', - 'ⰹ' => 'Ⰹ', - 'ⰺ' => 'Ⰺ', - 'ⰻ' => 'Ⰻ', - 'ⰼ' => 'Ⰼ', - 'ⰽ' => 'Ⰽ', - 'ⰾ' => 'Ⰾ', - 'ⰿ' => 'Ⰿ', - 'ⱀ' => 'Ⱀ', - 'ⱁ' => 'Ⱁ', - 'ⱂ' => 'Ⱂ', - 'ⱃ' => 'Ⱃ', - 'ⱄ' => 'Ⱄ', - 'ⱅ' => 'Ⱅ', - 'ⱆ' => 'Ⱆ', - 'ⱇ' => 'Ⱇ', - 'ⱈ' => 'Ⱈ', - 'ⱉ' => 'Ⱉ', - 'ⱊ' => 'Ⱊ', - 'ⱋ' => 'Ⱋ', - 'ⱌ' => 'Ⱌ', - 'ⱍ' => 'Ⱍ', - 'ⱎ' => 'Ⱎ', - 'ⱏ' => 'Ⱏ', - 'ⱐ' => 'Ⱐ', - 'ⱑ' => 'Ⱑ', - 'ⱒ' => 'Ⱒ', - 'ⱓ' => 'Ⱓ', - 'ⱔ' => 'Ⱔ', - 'ⱕ' => 'Ⱕ', - 'ⱖ' => 'Ⱖ', - 'ⱗ' => 'Ⱗ', - 'ⱘ' => 'Ⱘ', - 'ⱙ' => 'Ⱙ', - 'ⱚ' => 'Ⱚ', - 'ⱛ' => 'Ⱛ', - 'ⱜ' => 'Ⱜ', - 'ⱝ' => 'Ⱝ', - 'ⱞ' => 'Ⱞ', - 'ⱡ' => 'Ⱡ', - 'ⱥ' => 'Ⱥ', - 'ⱦ' => 'Ⱦ', - 'ⱨ' => 'Ⱨ', - 'ⱪ' => 'Ⱪ', - 'ⱬ' => 'Ⱬ', - 'ⱳ' => 'Ⱳ', - 'ⱶ' => 'Ⱶ', - 'ⲁ' => 'Ⲁ', - 'ⲃ' => 'Ⲃ', - 'ⲅ' => 'Ⲅ', - 'ⲇ' => 'Ⲇ', - 'ⲉ' => 'Ⲉ', - 'ⲋ' => 'Ⲋ', - 'ⲍ' => 'Ⲍ', - 'ⲏ' => 'Ⲏ', - 'ⲑ' => 'Ⲑ', - 'ⲓ' => 'Ⲓ', - 'ⲕ' => 'Ⲕ', - 'ⲗ' => 'Ⲗ', - 'ⲙ' => 'Ⲙ', - 'ⲛ' => 'Ⲛ', - 'ⲝ' => 'Ⲝ', - 'ⲟ' => 'Ⲟ', - 'ⲡ' => 'Ⲡ', - 'ⲣ' => 'Ⲣ', - 'ⲥ' => 'Ⲥ', - 'ⲧ' => 'Ⲧ', - 'ⲩ' => 'Ⲩ', - 'ⲫ' => 'Ⲫ', - 'ⲭ' => 'Ⲭ', - 'ⲯ' => 'Ⲯ', - 'ⲱ' => 'Ⲱ', - 'ⲳ' => 'Ⲳ', - 'ⲵ' => 'Ⲵ', - 'ⲷ' => 'Ⲷ', - 'ⲹ' => 'Ⲹ', - 'ⲻ' => 'Ⲻ', - 'ⲽ' => 'Ⲽ', - 'ⲿ' => 'Ⲿ', - 'ⳁ' => 'Ⳁ', - 'ⳃ' => 'Ⳃ', - 'ⳅ' => 'Ⳅ', - 'ⳇ' => 'Ⳇ', - 'ⳉ' => 'Ⳉ', - 'ⳋ' => 'Ⳋ', - 'ⳍ' => 'Ⳍ', - 'ⳏ' => 'Ⳏ', - 'ⳑ' => 'Ⳑ', - 'ⳓ' => 'Ⳓ', - 'ⳕ' => 'Ⳕ', - 'ⳗ' => 'Ⳗ', - 'ⳙ' => 'Ⳙ', - 'ⳛ' => 'Ⳛ', - 'ⳝ' => 'Ⳝ', - 'ⳟ' => 'Ⳟ', - 'ⳡ' => 'Ⳡ', - 'ⳣ' => 'Ⳣ', - 'ⳬ' => 'Ⳬ', - 'ⳮ' => 'Ⳮ', - 'ⳳ' => 'Ⳳ', - 'ⴀ' => 'Ⴀ', - 'ⴁ' => 'Ⴁ', - 'ⴂ' => 'Ⴂ', - 'ⴃ' => 'Ⴃ', - 'ⴄ' => 'Ⴄ', - 'ⴅ' => 'Ⴅ', - 'ⴆ' => 'Ⴆ', - 'ⴇ' => 'Ⴇ', - 'ⴈ' => 'Ⴈ', - 'ⴉ' => 'Ⴉ', - 'ⴊ' => 'Ⴊ', - 'ⴋ' => 'Ⴋ', - 'ⴌ' => 'Ⴌ', - 'ⴍ' => 'Ⴍ', - 'ⴎ' => 'Ⴎ', - 'ⴏ' => 'Ⴏ', - 'ⴐ' => 'Ⴐ', - 'ⴑ' => 'Ⴑ', - 'ⴒ' => 'Ⴒ', - 'ⴓ' => 'Ⴓ', - 'ⴔ' => 'Ⴔ', - 'ⴕ' => 'Ⴕ', - 'ⴖ' => 'Ⴖ', - 'ⴗ' => 'Ⴗ', - 'ⴘ' => 'Ⴘ', - 'ⴙ' => 'Ⴙ', - 'ⴚ' => 'Ⴚ', - 'ⴛ' => 'Ⴛ', - 'ⴜ' => 'Ⴜ', - 'ⴝ' => 'Ⴝ', - 'ⴞ' => 'Ⴞ', - 'ⴟ' => 'Ⴟ', - 'ⴠ' => 'Ⴠ', - 'ⴡ' => 'Ⴡ', - 'ⴢ' => 'Ⴢ', - 'ⴣ' => 'Ⴣ', - 'ⴤ' => 'Ⴤ', - 'ⴥ' => 'Ⴥ', - 'ⴧ' => 'Ⴧ', - 'ⴭ' => 'Ⴭ', - 'ꙁ' => 'Ꙁ', - 'ꙃ' => 'Ꙃ', - 'ꙅ' => 'Ꙅ', - 'ꙇ' => 'Ꙇ', - 'ꙉ' => 'Ꙉ', - 'ꙋ' => 'Ꙋ', - 'ꙍ' => 'Ꙍ', - 'ꙏ' => 'Ꙏ', - 'ꙑ' => 'Ꙑ', - 'ꙓ' => 'Ꙓ', - 'ꙕ' => 'Ꙕ', - 'ꙗ' => 'Ꙗ', - 'ꙙ' => 'Ꙙ', - 'ꙛ' => 'Ꙛ', - 'ꙝ' => 'Ꙝ', - 'ꙟ' => 'Ꙟ', - 'ꙡ' => 'Ꙡ', - 'ꙣ' => 'Ꙣ', - 'ꙥ' => 'Ꙥ', - 'ꙧ' => 'Ꙧ', - 'ꙩ' => 'Ꙩ', - 'ꙫ' => 'Ꙫ', - 'ꙭ' => 'Ꙭ', - 'ꚁ' => 'Ꚁ', - 'ꚃ' => 'Ꚃ', - 'ꚅ' => 'Ꚅ', - 'ꚇ' => 'Ꚇ', - 'ꚉ' => 'Ꚉ', - 'ꚋ' => 'Ꚋ', - 'ꚍ' => 'Ꚍ', - 'ꚏ' => 'Ꚏ', - 'ꚑ' => 'Ꚑ', - 'ꚓ' => 'Ꚓ', - 'ꚕ' => 'Ꚕ', - 'ꚗ' => 'Ꚗ', - 'ꚙ' => 'Ꚙ', - 'ꚛ' => 'Ꚛ', - 'ꜣ' => 'Ꜣ', - 'ꜥ' => 'Ꜥ', - 'ꜧ' => 'Ꜧ', - 'ꜩ' => 'Ꜩ', - 'ꜫ' => 'Ꜫ', - 'ꜭ' => 'Ꜭ', - 'ꜯ' => 'Ꜯ', - 'ꜳ' => 'Ꜳ', - 'ꜵ' => 'Ꜵ', - 'ꜷ' => 'Ꜷ', - 'ꜹ' => 'Ꜹ', - 'ꜻ' => 'Ꜻ', - 'ꜽ' => 'Ꜽ', - 'ꜿ' => 'Ꜿ', - 'ꝁ' => 'Ꝁ', - 'ꝃ' => 'Ꝃ', - 'ꝅ' => 'Ꝅ', - 'ꝇ' => 'Ꝇ', - 'ꝉ' => 'Ꝉ', - 'ꝋ' => 'Ꝋ', - 'ꝍ' => 'Ꝍ', - 'ꝏ' => 'Ꝏ', - 'ꝑ' => 'Ꝑ', - 'ꝓ' => 'Ꝓ', - 'ꝕ' => 'Ꝕ', - 'ꝗ' => 'Ꝗ', - 'ꝙ' => 'Ꝙ', - 'ꝛ' => 'Ꝛ', - 'ꝝ' => 'Ꝝ', - 'ꝟ' => 'Ꝟ', - 'ꝡ' => 'Ꝡ', - 'ꝣ' => 'Ꝣ', - 'ꝥ' => 'Ꝥ', - 'ꝧ' => 'Ꝧ', - 'ꝩ' => 'Ꝩ', - 'ꝫ' => 'Ꝫ', - 'ꝭ' => 'Ꝭ', - 'ꝯ' => 'Ꝯ', - 'ꝺ' => 'Ꝺ', - 'ꝼ' => 'Ꝼ', - 'ꝿ' => 'Ꝿ', - 'ꞁ' => 'Ꞁ', - 'ꞃ' => 'Ꞃ', - 'ꞅ' => 'Ꞅ', - 'ꞇ' => 'Ꞇ', - 'ꞌ' => 'Ꞌ', - 'ꞑ' => 'Ꞑ', - 'ꞓ' => 'Ꞓ', - 'ꞔ' => 'Ꞔ', - 'ꞗ' => 'Ꞗ', - 'ꞙ' => 'Ꞙ', - 'ꞛ' => 'Ꞛ', - 'ꞝ' => 'Ꞝ', - 'ꞟ' => 'Ꞟ', - 'ꞡ' => 'Ꞡ', - 'ꞣ' => 'Ꞣ', - 'ꞥ' => 'Ꞥ', - 'ꞧ' => 'Ꞧ', - 'ꞩ' => 'Ꞩ', - 'ꞵ' => 'Ꞵ', - 'ꞷ' => 'Ꞷ', - 'ꞹ' => 'Ꞹ', - 'ꞻ' => 'Ꞻ', - 'ꞽ' => 'Ꞽ', - 'ꞿ' => 'Ꞿ', - 'ꟃ' => 'Ꟃ', - 'ꟈ' => 'Ꟈ', - 'ꟊ' => 'Ꟊ', - 'ꟶ' => 'Ꟶ', - 'ꭓ' => 'Ꭓ', - 'ꭰ' => 'Ꭰ', - 'ꭱ' => 'Ꭱ', - 'ꭲ' => 'Ꭲ', - 'ꭳ' => 'Ꭳ', - 'ꭴ' => 'Ꭴ', - 'ꭵ' => 'Ꭵ', - 'ꭶ' => 'Ꭶ', - 'ꭷ' => 'Ꭷ', - 'ꭸ' => 'Ꭸ', - 'ꭹ' => 'Ꭹ', - 'ꭺ' => 'Ꭺ', - 'ꭻ' => 'Ꭻ', - 'ꭼ' => 'Ꭼ', - 'ꭽ' => 'Ꭽ', - 'ꭾ' => 'Ꭾ', - 'ꭿ' => 'Ꭿ', - 'ꮀ' => 'Ꮀ', - 'ꮁ' => 'Ꮁ', - 'ꮂ' => 'Ꮂ', - 'ꮃ' => 'Ꮃ', - 'ꮄ' => 'Ꮄ', - 'ꮅ' => 'Ꮅ', - 'ꮆ' => 'Ꮆ', - 'ꮇ' => 'Ꮇ', - 'ꮈ' => 'Ꮈ', - 'ꮉ' => 'Ꮉ', - 'ꮊ' => 'Ꮊ', - 'ꮋ' => 'Ꮋ', - 'ꮌ' => 'Ꮌ', - 'ꮍ' => 'Ꮍ', - 'ꮎ' => 'Ꮎ', - 'ꮏ' => 'Ꮏ', - 'ꮐ' => 'Ꮐ', - 'ꮑ' => 'Ꮑ', - 'ꮒ' => 'Ꮒ', - 'ꮓ' => 'Ꮓ', - 'ꮔ' => 'Ꮔ', - 'ꮕ' => 'Ꮕ', - 'ꮖ' => 'Ꮖ', - 'ꮗ' => 'Ꮗ', - 'ꮘ' => 'Ꮘ', - 'ꮙ' => 'Ꮙ', - 'ꮚ' => 'Ꮚ', - 'ꮛ' => 'Ꮛ', - 'ꮜ' => 'Ꮜ', - 'ꮝ' => 'Ꮝ', - 'ꮞ' => 'Ꮞ', - 'ꮟ' => 'Ꮟ', - 'ꮠ' => 'Ꮠ', - 'ꮡ' => 'Ꮡ', - 'ꮢ' => 'Ꮢ', - 'ꮣ' => 'Ꮣ', - 'ꮤ' => 'Ꮤ', - 'ꮥ' => 'Ꮥ', - 'ꮦ' => 'Ꮦ', - 'ꮧ' => 'Ꮧ', - 'ꮨ' => 'Ꮨ', - 'ꮩ' => 'Ꮩ', - 'ꮪ' => 'Ꮪ', - 'ꮫ' => 'Ꮫ', - 'ꮬ' => 'Ꮬ', - 'ꮭ' => 'Ꮭ', - 'ꮮ' => 'Ꮮ', - 'ꮯ' => 'Ꮯ', - 'ꮰ' => 'Ꮰ', - 'ꮱ' => 'Ꮱ', - 'ꮲ' => 'Ꮲ', - 'ꮳ' => 'Ꮳ', - 'ꮴ' => 'Ꮴ', - 'ꮵ' => 'Ꮵ', - 'ꮶ' => 'Ꮶ', - 'ꮷ' => 'Ꮷ', - 'ꮸ' => 'Ꮸ', - 'ꮹ' => 'Ꮹ', - 'ꮺ' => 'Ꮺ', - 'ꮻ' => 'Ꮻ', - 'ꮼ' => 'Ꮼ', - 'ꮽ' => 'Ꮽ', - 'ꮾ' => 'Ꮾ', - 'ꮿ' => 'Ꮿ', - 'a' => 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - '𐐨' => '𐐀', - '𐐩' => '𐐁', - '𐐪' => '𐐂', - '𐐫' => '𐐃', - '𐐬' => '𐐄', - '𐐭' => '𐐅', - '𐐮' => '𐐆', - '𐐯' => '𐐇', - '𐐰' => '𐐈', - '𐐱' => '𐐉', - '𐐲' => '𐐊', - '𐐳' => '𐐋', - '𐐴' => '𐐌', - '𐐵' => '𐐍', - '𐐶' => '𐐎', - '𐐷' => '𐐏', - '𐐸' => '𐐐', - '𐐹' => '𐐑', - '𐐺' => '𐐒', - '𐐻' => '𐐓', - '𐐼' => '𐐔', - '𐐽' => '𐐕', - '𐐾' => '𐐖', - '𐐿' => '𐐗', - '𐑀' => '𐐘', - '𐑁' => '𐐙', - '𐑂' => '𐐚', - '𐑃' => '𐐛', - '𐑄' => '𐐜', - '𐑅' => '𐐝', - '𐑆' => '𐐞', - '𐑇' => '𐐟', - '𐑈' => '𐐠', - '𐑉' => '𐐡', - '𐑊' => '𐐢', - '𐑋' => '𐐣', - '𐑌' => '𐐤', - '𐑍' => '𐐥', - '𐑎' => '𐐦', - '𐑏' => '𐐧', - '𐓘' => '𐒰', - '𐓙' => '𐒱', - '𐓚' => '𐒲', - '𐓛' => '𐒳', - '𐓜' => '𐒴', - '𐓝' => '𐒵', - '𐓞' => '𐒶', - '𐓟' => '𐒷', - '𐓠' => '𐒸', - '𐓡' => '𐒹', - '𐓢' => '𐒺', - '𐓣' => '𐒻', - '𐓤' => '𐒼', - '𐓥' => '𐒽', - '𐓦' => '𐒾', - '𐓧' => '𐒿', - '𐓨' => '𐓀', - '𐓩' => '𐓁', - '𐓪' => '𐓂', - '𐓫' => '𐓃', - '𐓬' => '𐓄', - '𐓭' => '𐓅', - '𐓮' => '𐓆', - '𐓯' => '𐓇', - '𐓰' => '𐓈', - '𐓱' => '𐓉', - '𐓲' => '𐓊', - '𐓳' => '𐓋', - '𐓴' => '𐓌', - '𐓵' => '𐓍', - '𐓶' => '𐓎', - '𐓷' => '𐓏', - '𐓸' => '𐓐', - '𐓹' => '𐓑', - '𐓺' => '𐓒', - '𐓻' => '𐓓', - '𐳀' => '𐲀', - '𐳁' => '𐲁', - '𐳂' => '𐲂', - '𐳃' => '𐲃', - '𐳄' => '𐲄', - '𐳅' => '𐲅', - '𐳆' => '𐲆', - '𐳇' => '𐲇', - '𐳈' => '𐲈', - '𐳉' => '𐲉', - '𐳊' => '𐲊', - '𐳋' => '𐲋', - '𐳌' => '𐲌', - '𐳍' => '𐲍', - '𐳎' => '𐲎', - '𐳏' => '𐲏', - '𐳐' => '𐲐', - '𐳑' => '𐲑', - '𐳒' => '𐲒', - '𐳓' => '𐲓', - '𐳔' => '𐲔', - '𐳕' => '𐲕', - '𐳖' => '𐲖', - '𐳗' => '𐲗', - '𐳘' => '𐲘', - '𐳙' => '𐲙', - '𐳚' => '𐲚', - '𐳛' => '𐲛', - '𐳜' => '𐲜', - '𐳝' => '𐲝', - '𐳞' => '𐲞', - '𐳟' => '𐲟', - '𐳠' => '𐲠', - '𐳡' => '𐲡', - '𐳢' => '𐲢', - '𐳣' => '𐲣', - '𐳤' => '𐲤', - '𐳥' => '𐲥', - '𐳦' => '𐲦', - '𐳧' => '𐲧', - '𐳨' => '𐲨', - '𐳩' => '𐲩', - '𐳪' => '𐲪', - '𐳫' => '𐲫', - '𐳬' => '𐲬', - '𐳭' => '𐲭', - '𐳮' => '𐲮', - '𐳯' => '𐲯', - '𐳰' => '𐲰', - '𐳱' => '𐲱', - '𐳲' => '𐲲', - '𑣀' => '𑢠', - '𑣁' => '𑢡', - '𑣂' => '𑢢', - '𑣃' => '𑢣', - '𑣄' => '𑢤', - '𑣅' => '𑢥', - '𑣆' => '𑢦', - '𑣇' => '𑢧', - '𑣈' => '𑢨', - '𑣉' => '𑢩', - '𑣊' => '𑢪', - '𑣋' => '𑢫', - '𑣌' => '𑢬', - '𑣍' => '𑢭', - '𑣎' => '𑢮', - '𑣏' => '𑢯', - '𑣐' => '𑢰', - '𑣑' => '𑢱', - '𑣒' => '𑢲', - '𑣓' => '𑢳', - '𑣔' => '𑢴', - '𑣕' => '𑢵', - '𑣖' => '𑢶', - '𑣗' => '𑢷', - '𑣘' => '𑢸', - '𑣙' => '𑢹', - '𑣚' => '𑢺', - '𑣛' => '𑢻', - '𑣜' => '𑢼', - '𑣝' => '𑢽', - '𑣞' => '𑢾', - '𑣟' => '𑢿', - '𖹠' => '𖹀', - '𖹡' => '𖹁', - '𖹢' => '𖹂', - '𖹣' => '𖹃', - '𖹤' => '𖹄', - '𖹥' => '𖹅', - '𖹦' => '𖹆', - '𖹧' => '𖹇', - '𖹨' => '𖹈', - '𖹩' => '𖹉', - '𖹪' => '𖹊', - '𖹫' => '𖹋', - '𖹬' => '𖹌', - '𖹭' => '𖹍', - '𖹮' => '𖹎', - '𖹯' => '𖹏', - '𖹰' => '𖹐', - '𖹱' => '𖹑', - '𖹲' => '𖹒', - '𖹳' => '𖹓', - '𖹴' => '𖹔', - '𖹵' => '𖹕', - '𖹶' => '𖹖', - '𖹷' => '𖹗', - '𖹸' => '𖹘', - '𖹹' => '𖹙', - '𖹺' => '𖹚', - '𖹻' => '𖹛', - '𖹼' => '𖹜', - '𖹽' => '𖹝', - '𖹾' => '𖹞', - '𖹿' => '𖹟', - '𞤢' => '𞤀', - '𞤣' => '𞤁', - '𞤤' => '𞤂', - '𞤥' => '𞤃', - '𞤦' => '𞤄', - '𞤧' => '𞤅', - '𞤨' => '𞤆', - '𞤩' => '𞤇', - '𞤪' => '𞤈', - '𞤫' => '𞤉', - '𞤬' => '𞤊', - '𞤭' => '𞤋', - '𞤮' => '𞤌', - '𞤯' => '𞤍', - '𞤰' => '𞤎', - '𞤱' => '𞤏', - '𞤲' => '𞤐', - '𞤳' => '𞤑', - '𞤴' => '𞤒', - '𞤵' => '𞤓', - '𞤶' => '𞤔', - '𞤷' => '𞤕', - '𞤸' => '𞤖', - '𞤹' => '𞤗', - '𞤺' => '𞤘', - '𞤻' => '𞤙', - '𞤼' => '𞤚', - '𞤽' => '𞤛', - '𞤾' => '𞤜', - '𞤿' => '𞤝', - '𞥀' => '𞤞', - '𞥁' => '𞤟', - '𞥂' => '𞤠', - '𞥃' => '𞤡', - 'ß' => 'SS', - 'ff' => 'FF', - 'fi' => 'FI', - 'fl' => 'FL', - 'ffi' => 'FFI', - 'ffl' => 'FFL', - 'ſt' => 'ST', - 'st' => 'ST', - 'և' => 'ԵՒ', - 'ﬓ' => 'ՄՆ', - 'ﬔ' => 'ՄԵ', - 'ﬕ' => 'ՄԻ', - 'ﬖ' => 'ՎՆ', - 'ﬗ' => 'ՄԽ', - 'ʼn' => 'ʼN', - 'ΐ' => 'Ϊ́', - 'ΰ' => 'Ϋ́', - 'ǰ' => 'J̌', - 'ẖ' => 'H̱', - 'ẗ' => 'T̈', - 'ẘ' => 'W̊', - 'ẙ' => 'Y̊', - 'ẚ' => 'Aʾ', - 'ὐ' => 'Υ̓', - 'ὒ' => 'Υ̓̀', - 'ὔ' => 'Υ̓́', - 'ὖ' => 'Υ̓͂', - 'ᾶ' => 'Α͂', - 'ῆ' => 'Η͂', - 'ῒ' => 'Ϊ̀', - 'ΐ' => 'Ϊ́', - 'ῖ' => 'Ι͂', - 'ῗ' => 'Ϊ͂', - 'ῢ' => 'Ϋ̀', - 'ΰ' => 'Ϋ́', - 'ῤ' => 'Ρ̓', - 'ῦ' => 'Υ͂', - 'ῧ' => 'Ϋ͂', - 'ῶ' => 'Ω͂', - 'ᾈ' => 'ἈΙ', - 'ᾉ' => 'ἉΙ', - 'ᾊ' => 'ἊΙ', - 'ᾋ' => 'ἋΙ', - 'ᾌ' => 'ἌΙ', - 'ᾍ' => 'ἍΙ', - 'ᾎ' => 'ἎΙ', - 'ᾏ' => 'ἏΙ', - 'ᾘ' => 'ἨΙ', - 'ᾙ' => 'ἩΙ', - 'ᾚ' => 'ἪΙ', - 'ᾛ' => 'ἫΙ', - 'ᾜ' => 'ἬΙ', - 'ᾝ' => 'ἭΙ', - 'ᾞ' => 'ἮΙ', - 'ᾟ' => 'ἯΙ', - 'ᾨ' => 'ὨΙ', - 'ᾩ' => 'ὩΙ', - 'ᾪ' => 'ὪΙ', - 'ᾫ' => 'ὫΙ', - 'ᾬ' => 'ὬΙ', - 'ᾭ' => 'ὭΙ', - 'ᾮ' => 'ὮΙ', - 'ᾯ' => 'ὯΙ', - 'ᾼ' => 'ΑΙ', - 'ῌ' => 'ΗΙ', - 'ῼ' => 'ΩΙ', - 'ᾲ' => 'ᾺΙ', - 'ᾴ' => 'ΆΙ', - 'ῂ' => 'ῊΙ', - 'ῄ' => 'ΉΙ', - 'ῲ' => 'ῺΙ', - 'ῴ' => 'ΏΙ', - 'ᾷ' => 'Α͂Ι', - 'ῇ' => 'Η͂Ι', - 'ῷ' => 'Ω͂Ι', -); diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap.php b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap.php deleted file mode 100644 index ff51ae07..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language($language = null) { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } -} - -if (!function_exists('mb_str_pad')) { - function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } -} - -if (!function_exists('mb_ucfirst')) { - function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } -} - -if (!function_exists('mb_lcfirst')) { - function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } -} - -if (!function_exists('mb_trim')) { - function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } -} - -if (!function_exists('mb_ltrim')) { - function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } -} - -if (!function_exists('mb_rtrim')) { - function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } -} - - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap80.php b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap80.php deleted file mode 100644 index 5be7d201..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ /dev/null @@ -1,167 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info(?string $type = 'all'): array|string|int|false|null { return p\Mbstring::mb_get_info((string) $type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } -} - -if (!function_exists('mb_str_pad')) { - function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } -} - -if (!function_exists('mb_ucfirst')) { - function mb_ucfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } -} - -if (!function_exists('mb_lcfirst')) { - function mb_lcfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } -} - -if (!function_exists('mb_trim')) { - function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } -} - -if (!function_exists('mb_ltrim')) { - function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } -} - -if (!function_exists('mb_rtrim')) { - function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/composer.json deleted file mode 100644 index 4ed241a3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-mbstring/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/polyfill-mbstring", - "type": "library", - "description": "Symfony polyfill for the Mbstring extension", - "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2" - }, - "provide": { - "ext-mbstring": "*" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/LICENSE deleted file mode 100644 index 0ed3a246..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Php80.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Php80.php deleted file mode 100644 index 362dd1a9..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Php80.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Ion Bazan - * @author Nico Oelgart - * @author Nicolas Grekas - * - * @internal - */ -final class Php80 -{ - public static function fdiv(float $dividend, float $divisor): float - { - return @($dividend / $divisor); - } - - public static function get_debug_type($value): string - { - switch (true) { - case null === $value: return 'null'; - case \is_bool($value): return 'bool'; - case \is_string($value): return 'string'; - case \is_array($value): return 'array'; - case \is_int($value): return 'int'; - case \is_float($value): return 'float'; - case \is_object($value): break; - case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; - default: - if (null === $type = @get_resource_type($value)) { - return 'unknown'; - } - - if ('Unknown' === $type) { - $type = 'closed'; - } - - return "resource ($type)"; - } - - $class = \get_class($value); - - if (false === strpos($class, '@')) { - return $class; - } - - return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; - } - - public static function get_resource_id($res): int - { - if (!\is_resource($res) && null === @get_resource_type($res)) { - throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); - } - - return (int) $res; - } - - public static function preg_last_error_msg(): string - { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - return 'Internal error'; - case \PREG_BAD_UTF8_ERROR: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - case \PREG_BAD_UTF8_OFFSET_ERROR: - return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; - case \PREG_BACKTRACK_LIMIT_ERROR: - return 'Backtrack limit exhausted'; - case \PREG_RECURSION_LIMIT_ERROR: - return 'Recursion limit exhausted'; - case \PREG_JIT_STACKLIMIT_ERROR: - return 'JIT stack limit exhausted'; - case \PREG_NO_ERROR: - return 'No error'; - default: - return 'Unknown error'; - } - } - - public static function str_contains(string $haystack, string $needle): bool - { - return '' === $needle || false !== strpos($haystack, $needle); - } - - public static function str_starts_with(string $haystack, string $needle): bool - { - return 0 === strncmp($haystack, $needle, \strlen($needle)); - } - - public static function str_ends_with(string $haystack, string $needle): bool - { - if ('' === $needle || $needle === $haystack) { - return true; - } - - if ('' === $haystack) { - return false; - } - - $needleLength = \strlen($needle); - - return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/PhpToken.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/PhpToken.php deleted file mode 100644 index fe6e6910..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/PhpToken.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Fedonyuk Anton - * - * @internal - */ -class PhpToken implements \Stringable -{ - /** - * @var int - */ - public $id; - - /** - * @var string - */ - public $text; - - /** - * @var int - */ - public $line; - - /** - * @var int - */ - public $pos; - - public function __construct(int $id, string $text, int $line = -1, int $position = -1) - { - $this->id = $id; - $this->text = $text; - $this->line = $line; - $this->pos = $position; - } - - public function getTokenName(): ?string - { - if ('UNKNOWN' === $name = token_name($this->id)) { - $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; - } - - return $name; - } - - /** - * @param int|string|array $kind - */ - public function is($kind): bool - { - foreach ((array) $kind as $value) { - if (\in_array($value, [$this->id, $this->text], true)) { - return true; - } - } - - return false; - } - - public function isIgnorable(): bool - { - return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); - } - - public function __toString(): string - { - return (string) $this->text; - } - - /** - * @return static[] - */ - public static function tokenize(string $code, int $flags = 0): array - { - $line = 1; - $position = 0; - $tokens = token_get_all($code, $flags); - foreach ($tokens as $index => $token) { - if (\is_string($token)) { - $id = \ord($token); - $text = $token; - } else { - [$id, $text, $line] = $token; - } - $tokens[$index] = new static($id, $text, $line, $position); - $position += \strlen($text); - } - - return $tokens; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/README.md b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/README.md deleted file mode 100644 index 3816c559..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/README.md +++ /dev/null @@ -1,25 +0,0 @@ -Symfony Polyfill / Php80 -======================== - -This component provides features added to PHP 8.0 core: - -- [`Stringable`](https://php.net/stringable) interface -- [`fdiv`](https://php.net/fdiv) -- [`ValueError`](https://php.net/valueerror) class -- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class -- `FILTER_VALIDATE_BOOL` constant -- [`get_debug_type`](https://php.net/get_debug_type) -- [`PhpToken`](https://php.net/phptoken) class -- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) -- [`str_contains`](https://php.net/str_contains) -- [`str_starts_with`](https://php.net/str_starts_with) -- [`str_ends_with`](https://php.net/str_ends_with) -- [`get_resource_id`](https://php.net/get_resource_id) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php deleted file mode 100644 index 2b955423..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#[Attribute(Attribute::TARGET_CLASS)] -final class Attribute -{ - public const TARGET_CLASS = 1; - public const TARGET_FUNCTION = 2; - public const TARGET_METHOD = 4; - public const TARGET_PROPERTY = 8; - public const TARGET_CLASS_CONSTANT = 16; - public const TARGET_PARAMETER = 32; - public const TARGET_ALL = 63; - public const IS_REPEATABLE = 64; - - /** @var int */ - public $flags; - - public function __construct(int $flags = self::TARGET_ALL) - { - $this->flags = $flags; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php deleted file mode 100644 index bd1212f6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { - class PhpToken extends Symfony\Polyfill\Php80\PhpToken - { - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php deleted file mode 100644 index 7c62d750..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - interface Stringable - { - /** - * @return string - */ - public function __toString(); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php deleted file mode 100644 index 01c6c6c8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class UnhandledMatchError extends Error - { - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php deleted file mode 100644 index 783dbc28..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class ValueError extends Error - { - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/bootstrap.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/bootstrap.php deleted file mode 100644 index e5f7dbc1..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/bootstrap.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php80 as p; - -if (\PHP_VERSION_ID >= 80000) { - return; -} - -if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { - define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); -} - -if (!function_exists('fdiv')) { - function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } -} -if (!function_exists('preg_last_error_msg')) { - function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } -} -if (!function_exists('str_contains')) { - function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_starts_with')) { - function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_ends_with')) { - function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('get_debug_type')) { - function get_debug_type($value): string { return p\Php80::get_debug_type($value); } -} -if (!function_exists('get_resource_id')) { - function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-php80/composer.json deleted file mode 100644 index a503b039..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php80/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "symfony/polyfill-php80", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/LICENSE b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/LICENSE deleted file mode 100644 index 99c6bdf3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2021-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Php81.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Php81.php deleted file mode 100644 index f0507b76..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Php81.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php81; - -/** - * @author Nicolas Grekas - * - * @internal - */ -final class Php81 -{ - public static function array_is_list(array $array): bool - { - if ([] === $array || $array === array_values($array)) { - return true; - } - - $nextKey = -1; - - foreach ($array as $k => $v) { - if ($k !== ++$nextKey) { - return false; - } - } - - return true; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/README.md b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/README.md deleted file mode 100644 index c07ef782..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/README.md +++ /dev/null @@ -1,18 +0,0 @@ -Symfony Polyfill / Php81 -======================== - -This component provides features added to PHP 8.1 core: - -- [`array_is_list`](https://php.net/array_is_list) -- [`enum_exists`](https://php.net/enum-exists) -- [`MYSQLI_REFRESH_REPLICA`](https://php.net/mysqli.constants#constantmysqli-refresh-replica) constant -- [`ReturnTypeWillChange`](https://wiki.php.net/rfc/internal_method_return_types) -- [`CURLStringFile`](https://php.net/CURLStringFile) (but only if PHP >= 7.4 is used) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php deleted file mode 100644 index 5ff93fca..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID >= 70400 && extension_loaded('curl')) { - /** - * @property string $data - */ - class CURLStringFile extends CURLFile - { - private $data; - - public function __construct(string $data, string $postname, string $mime = 'application/octet-stream') - { - $this->data = $data; - parent::__construct('data://application/octet-stream;base64,'.base64_encode($data), $mime, $postname); - } - - public function __set(string $name, $value): void - { - if ('data' !== $name) { - $this->$name = $value; - - return; - } - - if (is_object($value) ? !method_exists($value, '__toString') : !is_scalar($value)) { - throw new TypeError('Cannot assign '.gettype($value).' to property CURLStringFile::$data of type string'); - } - - $this->name = 'data://application/octet-stream;base64,'.base64_encode($value); - } - - public function __isset(string $name): bool - { - return isset($this->$name); - } - - public function &__get(string $name) - { - return $this->$name; - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php deleted file mode 100644 index cb7720a8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80100) { - #[Attribute(Attribute::TARGET_METHOD)] - final class ReturnTypeWillChange - { - public function __construct() - { - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/bootstrap.php b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/bootstrap.php deleted file mode 100644 index 9f872e02..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/bootstrap.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php81 as p; - -if (\PHP_VERSION_ID >= 80100) { - return; -} - -if (defined('MYSQLI_REFRESH_SLAVE') && !defined('MYSQLI_REFRESH_REPLICA')) { - define('MYSQLI_REFRESH_REPLICA', 64); -} - -if (!function_exists('array_is_list')) { - function array_is_list(array $array): bool { return p\Php81::array_is_list($array); } -} - -if (!function_exists('enum_exists')) { - function enum_exists(string $enum, bool $autoload = true): bool { return $autoload && class_exists($enum) && false; } -} diff --git a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/composer.json b/tools/php-cs-fixer/vendor/symfony/polyfill-php81/composer.json deleted file mode 100644 index 28b6408e..00000000 --- a/tools/php-cs-fixer/vendor/symfony/polyfill-php81/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "symfony/polyfill-php81", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php81\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/process/CHANGELOG.md deleted file mode 100644 index 3e33cd0b..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/CHANGELOG.md +++ /dev/null @@ -1,128 +0,0 @@ -CHANGELOG -========= - -7.1 ---- - - * Add `Process::setIgnoredSignals()` to disable signal propagation to the child process - -6.4 ---- - - * Add `PhpSubprocess` to handle PHP subprocesses that take over the - configuration from their parent - * Add `RunProcessMessage` and `RunProcessMessageHandler` - -5.2.0 ------ - - * added `Process::setOptions()` to set `Process` specific options - * added option `create_new_console` to allow a subprocess to continue - to run after the main script exited, both on Linux and on Windows - -5.1.0 ------ - - * added `Process::getStartTime()` to retrieve the start time of the process as float - -5.0.0 ------ - - * removed `Process::inheritEnvironmentVariables()` - * removed `PhpProcess::setPhpBinary()` - * `Process` must be instantiated with a command array, use `Process::fromShellCommandline()` when the command should be parsed by the shell - * removed `Process::setCommandLine()` - -4.4.0 ------ - - * deprecated `Process::inheritEnvironmentVariables()`: env variables are always inherited. - * added `Process::getLastOutputTime()` method - -4.2.0 ------ - - * added the `Process::fromShellCommandline()` to run commands in a shell wrapper - * deprecated passing a command as string when creating a `Process` instance - * deprecated the `Process::setCommandline()` and the `PhpProcess::setPhpBinary()` methods - * added the `Process::waitUntil()` method to wait for the process only for a - specific output, then continue the normal execution of your application - -4.1.0 ------ - - * added the `Process::isTtySupported()` method that allows to check for TTY support - * made `PhpExecutableFinder` look for the `PHP_BINARY` env var when searching the php binary - * added the `ProcessSignaledException` class to properly catch signaled process errors - -4.0.0 ------ - - * environment variables will always be inherited - * added a second `array $env = []` argument to the `start()`, `run()`, - `mustRun()`, and `restart()` methods of the `Process` class - * added a second `array $env = []` argument to the `start()` method of the - `PhpProcess` class - * the `ProcessUtils::escapeArgument()` method has been removed - * the `areEnvironmentVariablesInherited()`, `getOptions()`, and `setOptions()` - methods of the `Process` class have been removed - * support for passing `proc_open()` options has been removed - * removed the `ProcessBuilder` class, use the `Process` class instead - * removed the `getEnhanceWindowsCompatibility()` and `setEnhanceWindowsCompatibility()` methods of the `Process` class - * passing a not existing working directory to the constructor of the `Symfony\Component\Process\Process` class is not - supported anymore - -3.4.0 ------ - - * deprecated the ProcessBuilder class - * deprecated calling `Process::start()` without setting a valid working directory beforehand (via `setWorkingDirectory()` or constructor) - -3.3.0 ------ - - * added command line arrays in the `Process` class - * added `$env` argument to `Process::start()`, `run()`, `mustRun()` and `restart()` methods - * deprecated the `ProcessUtils::escapeArgument()` method - * deprecated not inheriting environment variables - * deprecated configuring `proc_open()` options - * deprecated configuring enhanced Windows compatibility - * deprecated configuring enhanced sigchild compatibility - -2.5.0 ------ - - * added support for PTY mode - * added the convenience method "mustRun" - * deprecation: Process::setStdin() is deprecated in favor of Process::setInput() - * deprecation: Process::getStdin() is deprecated in favor of Process::getInput() - * deprecation: Process::setInput() and ProcessBuilder::setInput() do not accept non-scalar types - -2.4.0 ------ - - * added the ability to define an idle timeout - -2.3.0 ------ - - * added ProcessUtils::escapeArgument() to fix the bug in escapeshellarg() function on Windows - * added Process::signal() - * added Process::getPid() - * added support for a TTY mode - -2.2.0 ------ - - * added ProcessBuilder::setArguments() to reset the arguments on a builder - * added a way to retrieve the standard and error output incrementally - * added Process:restart() - -2.1.0 ------ - - * added support for non-blocking processes (start(), wait(), isRunning(), stop()) - * enhanced Windows compatibility - * added Process::getExitCodeText() that returns a string representation for - the exit code returned by the process - * added ProcessBuilder diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/ExceptionInterface.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/ExceptionInterface.php deleted file mode 100644 index bd4a6040..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * Marker Interface for the Process Component. - * - * @author Johannes M. Schmitt - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/InvalidArgumentException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/InvalidArgumentException.php deleted file mode 100644 index 926ee211..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * InvalidArgumentException for the Process Component. - * - * @author Romain Neutron - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/LogicException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/LogicException.php deleted file mode 100644 index be3d490d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/LogicException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * LogicException for the Process Component. - * - * @author Romain Neutron - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessFailedException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessFailedException.php deleted file mode 100644 index de8a9e98..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessFailedException.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception for failed processes. - * - * @author Johannes M. Schmitt - */ -class ProcessFailedException extends RuntimeException -{ - public function __construct( - private Process $process, - ) { - if ($process->isSuccessful()) { - throw new InvalidArgumentException('Expected a failed process, but the given process was successful.'); - } - - $error = \sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", - $process->getCommandLine(), - $process->getExitCode(), - $process->getExitCodeText(), - $process->getWorkingDirectory() - ); - - if (!$process->isOutputDisabled()) { - $error .= \sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", - $process->getOutput(), - $process->getErrorOutput() - ); - } - - parent::__construct($error); - - $this->process = $process; - } - - public function getProcess(): Process - { - return $this->process; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessSignaledException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessSignaledException.php deleted file mode 100644 index 3fd13e5d..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessSignaledException.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception that is thrown when a process has been signaled. - * - * @author Sullivan Senechal - */ -final class ProcessSignaledException extends RuntimeException -{ - public function __construct( - private Process $process, - ) { - parent::__construct(\sprintf('The process has been signaled with signal "%s".', $process->getTermSignal())); - } - - public function getProcess(): Process - { - return $this->process; - } - - public function getSignal(): int - { - return $this->getProcess()->getTermSignal(); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessStartFailedException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessStartFailedException.php deleted file mode 100644 index 37254725..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessStartFailedException.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception for processes failed during startup. - */ -class ProcessStartFailedException extends ProcessFailedException -{ - public function __construct( - private Process $process, - ?string $message, - ) { - if ($process->isStarted()) { - throw new InvalidArgumentException('Expected a process that failed during startup, but the given process was started successfully.'); - } - - $error = \sprintf('The command "%s" failed.'."\n\nWorking directory: %s\n\nError: %s", - $process->getCommandLine(), - $process->getWorkingDirectory(), - $message ?? 'unknown' - ); - - // Skip parent constructor - RuntimeException::__construct($error); - } - - public function getProcess(): Process - { - return $this->process; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessTimedOutException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessTimedOutException.php deleted file mode 100644 index d3fe4934..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/ProcessTimedOutException.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception that is thrown when a process times out. - * - * @author Johannes M. Schmitt - */ -class ProcessTimedOutException extends RuntimeException -{ - public const TYPE_GENERAL = 1; - public const TYPE_IDLE = 2; - - public function __construct( - private Process $process, - private int $timeoutType, - ) { - parent::__construct(\sprintf( - 'The process "%s" exceeded the timeout of %s seconds.', - $process->getCommandLine(), - $this->getExceededTimeout() - )); - } - - public function getProcess(): Process - { - return $this->process; - } - - public function isGeneralTimeout(): bool - { - return self::TYPE_GENERAL === $this->timeoutType; - } - - public function isIdleTimeout(): bool - { - return self::TYPE_IDLE === $this->timeoutType; - } - - public function getExceededTimeout(): ?float - { - return match ($this->timeoutType) { - self::TYPE_GENERAL => $this->process->getTimeout(), - self::TYPE_IDLE => $this->process->getIdleTimeout(), - default => throw new \LogicException(\sprintf('Unknown timeout type "%d".', $this->timeoutType)), - }; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/RunProcessFailedException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/RunProcessFailedException.php deleted file mode 100644 index e7219d35..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/RunProcessFailedException.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Messenger\RunProcessContext; - -/** - * @author Kevin Bond - */ -final class RunProcessFailedException extends RuntimeException -{ - public function __construct(ProcessFailedException $exception, public readonly RunProcessContext $context) - { - parent::__construct($exception->getMessage(), $exception->getCode()); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Exception/RuntimeException.php b/tools/php-cs-fixer/vendor/symfony/process/Exception/RuntimeException.php deleted file mode 100644 index adead253..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Exception/RuntimeException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * RuntimeException for the Process Component. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/ExecutableFinder.php b/tools/php-cs-fixer/vendor/symfony/process/ExecutableFinder.php deleted file mode 100644 index 5cc65251..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/ExecutableFinder.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -/** - * Generic executable finder. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class ExecutableFinder -{ - private const CMD_BUILTINS = [ - 'assoc', 'break', 'call', 'cd', 'chdir', 'cls', 'color', 'copy', 'date', - 'del', 'dir', 'echo', 'endlocal', 'erase', 'exit', 'for', 'ftype', 'goto', - 'help', 'if', 'label', 'md', 'mkdir', 'mklink', 'move', 'path', 'pause', - 'popd', 'prompt', 'pushd', 'rd', 'rem', 'ren', 'rename', 'rmdir', 'set', - 'setlocal', 'shift', 'start', 'time', 'title', 'type', 'ver', 'vol', - ]; - - private array $suffixes = []; - - /** - * Replaces default suffixes of executable. - */ - public function setSuffixes(array $suffixes): void - { - $this->suffixes = $suffixes; - } - - /** - * Adds new possible suffix to check for executable, including the dot (.). - * - * $finder = new ExecutableFinder(); - * $finder->addSuffix('.foo'); - */ - public function addSuffix(string $suffix): void - { - $this->suffixes[] = $suffix; - } - - /** - * Finds an executable by name. - * - * @param string $name The executable name (without the extension) - * @param string|null $default The default to return if no executable is found - * @param array $extraDirs Additional dirs to check into - */ - public function find(string $name, ?string $default = null, array $extraDirs = []): ?string - { - // windows built-in commands that are present in cmd.exe should not be resolved using PATH as they do not exist as exes - if ('\\' === \DIRECTORY_SEPARATOR && \in_array(strtolower($name), self::CMD_BUILTINS, true)) { - return $name; - } - - $dirs = array_merge( - explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), - $extraDirs - ); - - $suffixes = $this->suffixes; - if ('\\' === \DIRECTORY_SEPARATOR) { - $pathExt = getenv('PATHEXT'); - $suffixes = array_merge($suffixes, $pathExt ? explode(\PATH_SEPARATOR, $pathExt) : ['.exe', '.bat', '.cmd', '.com']); - } - $suffixes = '' !== pathinfo($name, PATHINFO_EXTENSION) ? array_merge([''], $suffixes) : array_merge($suffixes, ['']); - foreach ($suffixes as $suffix) { - foreach ($dirs as $dir) { - if ('' === $dir) { - $dir = '.'; - } - if (@is_file($file = $dir.\DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === \DIRECTORY_SEPARATOR || @is_executable($file))) { - return $file; - } - - if (!@is_dir($dir) && basename($dir) === $name.$suffix && @is_executable($dir)) { - return $dir; - } - } - } - - if ('\\' === \DIRECTORY_SEPARATOR || !\function_exists('exec') || \strlen($name) !== strcspn($name, '/'.\DIRECTORY_SEPARATOR)) { - return $default; - } - - $execResult = exec('command -v -- '.escapeshellarg($name)); - - if (($executablePath = substr($execResult, 0, strpos($execResult, \PHP_EOL) ?: null)) && @is_executable($executablePath)) { - return $executablePath; - } - - return $default; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/InputStream.php b/tools/php-cs-fixer/vendor/symfony/process/InputStream.php deleted file mode 100644 index 586e7429..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/InputStream.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\RuntimeException; - -/** - * Provides a way to continuously write to the input of a Process until the InputStream is closed. - * - * @author Nicolas Grekas - * - * @implements \IteratorAggregate - */ -class InputStream implements \IteratorAggregate -{ - private ?\Closure $onEmpty = null; - private array $input = []; - private bool $open = true; - - /** - * Sets a callback that is called when the write buffer becomes empty. - */ - public function onEmpty(?callable $onEmpty = null): void - { - $this->onEmpty = null !== $onEmpty ? $onEmpty(...) : null; - } - - /** - * Appends an input to the write buffer. - * - * @param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar, - * stream resource or \Traversable - */ - public function write(mixed $input): void - { - if (null === $input) { - return; - } - if ($this->isClosed()) { - throw new RuntimeException(\sprintf('"%s" is closed.', static::class)); - } - $this->input[] = ProcessUtils::validateInput(__METHOD__, $input); - } - - /** - * Closes the write buffer. - */ - public function close(): void - { - $this->open = false; - } - - /** - * Tells whether the write buffer is closed or not. - */ - public function isClosed(): bool - { - return !$this->open; - } - - public function getIterator(): \Traversable - { - $this->open = true; - - while ($this->open || $this->input) { - if (!$this->input) { - yield ''; - continue; - } - $current = array_shift($this->input); - - if ($current instanceof \Iterator) { - yield from $current; - } else { - yield $current; - } - if (!$this->input && $this->open && null !== $onEmpty = $this->onEmpty) { - $this->write($onEmpty($this)); - } - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/LICENSE b/tools/php-cs-fixer/vendor/symfony/process/LICENSE deleted file mode 100644 index 0138f8f0..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessContext.php b/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessContext.php deleted file mode 100644 index 5e223040..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessContext.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Messenger; - -use Symfony\Component\Process\Process; - -/** - * @author Kevin Bond - */ -final class RunProcessContext -{ - public readonly ?int $exitCode; - public readonly ?string $output; - public readonly ?string $errorOutput; - - public function __construct( - public readonly RunProcessMessage $message, - Process $process, - ) { - $this->exitCode = $process->getExitCode(); - $this->output = !$process->isStarted() || $process->isOutputDisabled() ? null : $process->getOutput(); - $this->errorOutput = !$process->isStarted() || $process->isOutputDisabled() ? null : $process->getErrorOutput(); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessage.php b/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessage.php deleted file mode 100644 index b2c33fe3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessage.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Messenger; - -/** - * @author Kevin Bond - */ -class RunProcessMessage implements \Stringable -{ - public function __construct( - public readonly array $command, - public readonly ?string $cwd = null, - public readonly ?array $env = null, - public readonly mixed $input = null, - public readonly ?float $timeout = 60.0, - ) { - } - - public function __toString(): string - { - return implode(' ', $this->command); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessageHandler.php b/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessageHandler.php deleted file mode 100644 index 41c1934c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Messenger/RunProcessMessageHandler.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Messenger; - -use Symfony\Component\Process\Exception\ProcessFailedException; -use Symfony\Component\Process\Exception\RunProcessFailedException; -use Symfony\Component\Process\Process; - -/** - * @author Kevin Bond - */ -final class RunProcessMessageHandler -{ - public function __invoke(RunProcessMessage $message): RunProcessContext - { - $process = new Process($message->command, $message->cwd, $message->env, $message->input, $message->timeout); - - try { - return new RunProcessContext($message, $process->mustRun()); - } catch (ProcessFailedException $e) { - throw new RunProcessFailedException($e, new RunProcessContext($message, $e->getProcess())); - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/PhpExecutableFinder.php b/tools/php-cs-fixer/vendor/symfony/process/PhpExecutableFinder.php deleted file mode 100644 index 9f9218f9..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/PhpExecutableFinder.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -/** - * An executable finder specifically designed for the PHP executable. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class PhpExecutableFinder -{ - private ExecutableFinder $executableFinder; - - public function __construct() - { - $this->executableFinder = new ExecutableFinder(); - } - - /** - * Finds The PHP executable. - */ - public function find(bool $includeArgs = true): string|false - { - if ($php = getenv('PHP_BINARY')) { - if (!is_executable($php) && !$php = $this->executableFinder->find($php)) { - return false; - } - - if (@is_dir($php)) { - return false; - } - - return $php; - } - - $args = $this->findArguments(); - $args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; - - // PHP_BINARY return the current sapi executable - if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cli', 'cli-server', 'phpdbg'], true)) { - return \PHP_BINARY.$args; - } - - if ($php = getenv('PHP_PATH')) { - if (!@is_executable($php) || @is_dir($php)) { - return false; - } - - return $php; - } - - if ($php = getenv('PHP_PEAR_PHP_BIN')) { - if (@is_executable($php) && !@is_dir($php)) { - return $php; - } - } - - if (@is_executable($php = \PHP_BINDIR.('\\' === \DIRECTORY_SEPARATOR ? '\\php.exe' : '/php')) && !@is_dir($php)) { - return $php; - } - - $dirs = [\PHP_BINDIR]; - if ('\\' === \DIRECTORY_SEPARATOR) { - $dirs[] = 'C:\xampp\php\\'; - } - - if ($herdPath = getenv('HERD_HOME')) { - $dirs[] = $herdPath.\DIRECTORY_SEPARATOR.'bin'; - } - - return $this->executableFinder->find('php', false, $dirs); - } - - /** - * Finds the PHP executable arguments. - */ - public function findArguments(): array - { - $arguments = []; - if ('phpdbg' === \PHP_SAPI) { - $arguments[] = '-qrr'; - } - - return $arguments; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/PhpProcess.php b/tools/php-cs-fixer/vendor/symfony/process/PhpProcess.php deleted file mode 100644 index 0e7ff846..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/PhpProcess.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\LogicException; -use Symfony\Component\Process\Exception\RuntimeException; - -/** - * PhpProcess runs a PHP script in an independent process. - * - * $p = new PhpProcess(''); - * $p->run(); - * print $p->getOutput()."\n"; - * - * @author Fabien Potencier - */ -class PhpProcess extends Process -{ - /** - * @param string $script The PHP script to run (as a string) - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param int $timeout The timeout in seconds - * @param array|null $php Path to the PHP binary to use with any additional arguments - */ - public function __construct(string $script, ?string $cwd = null, ?array $env = null, int $timeout = 60, ?array $php = null) - { - if (null === $php) { - $executableFinder = new PhpExecutableFinder(); - $php = $executableFinder->find(false); - $php = false === $php ? null : array_merge([$php], $executableFinder->findArguments()); - } - if ('phpdbg' === \PHP_SAPI) { - $file = tempnam(sys_get_temp_dir(), 'dbg'); - file_put_contents($file, $script); - register_shutdown_function('unlink', $file); - $php[] = $file; - $script = null; - } - - parent::__construct($php, $cwd, $env, $script, $timeout); - } - - public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static - { - throw new LogicException(\sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); - } - - public function start(?callable $callback = null, array $env = []): void - { - if (null === $this->getCommandLine()) { - throw new RuntimeException('Unable to find the PHP executable.'); - } - - parent::start($callback, $env); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/PhpSubprocess.php b/tools/php-cs-fixer/vendor/symfony/process/PhpSubprocess.php deleted file mode 100644 index bdd4173c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/PhpSubprocess.php +++ /dev/null @@ -1,164 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\LogicException; -use Symfony\Component\Process\Exception\RuntimeException; - -/** - * PhpSubprocess runs a PHP command as a subprocess while keeping the original php.ini settings. - * - * For this, it generates a temporary php.ini file taking over all the current settings and disables - * loading additional .ini files. Basically, your command gets prefixed using "php -n -c /tmp/temp.ini". - * - * Given your php.ini contains "memory_limit=-1" and you have a "MemoryTest.php" with the following content: - * - * run(); - * print $p->getOutput()."\n"; - * - * This will output "string(2) "-1", because the process is started with the default php.ini settings. - * - * $p = new PhpSubprocess(['MemoryTest.php'], null, null, 60, ['php', '-d', 'memory_limit=256M']); - * $p->run(); - * print $p->getOutput()."\n"; - * - * This will output "string(4) "256M"", because the process is started with the temporarily created php.ini settings. - * - * @author Yanick Witschi - * @author Partially copied and heavily inspired from composer/xdebug-handler by John Stevenson - */ -class PhpSubprocess extends Process -{ - /** - * @param array $command The command to run and its arguments listed as separate entries. They will automatically - * get prefixed with the PHP binary - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param int $timeout The timeout in seconds - * @param array|null $php Path to the PHP binary to use with any additional arguments - */ - public function __construct(array $command, ?string $cwd = null, ?array $env = null, int $timeout = 60, ?array $php = null) - { - if (null === $php) { - $executableFinder = new PhpExecutableFinder(); - $php = $executableFinder->find(false); - $php = false === $php ? null : array_merge([$php], $executableFinder->findArguments()); - } - - if (null === $php) { - throw new RuntimeException('Unable to find PHP binary.'); - } - - $tmpIni = $this->writeTmpIni($this->getAllIniFiles(), sys_get_temp_dir()); - - $php = array_merge($php, ['-n', '-c', $tmpIni]); - register_shutdown_function('unlink', $tmpIni); - - $command = array_merge($php, $command); - - parent::__construct($command, $cwd, $env, null, $timeout); - } - - public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static - { - throw new LogicException(\sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); - } - - public function start(?callable $callback = null, array $env = []): void - { - if (null === $this->getCommandLine()) { - throw new RuntimeException('Unable to find the PHP executable.'); - } - - parent::start($callback, $env); - } - - private function writeTmpIni(array $iniFiles, string $tmpDir): string - { - if (false === $tmpfile = @tempnam($tmpDir, '')) { - throw new RuntimeException('Unable to create temporary ini file.'); - } - - // $iniFiles has at least one item and it may be empty - if ('' === $iniFiles[0]) { - array_shift($iniFiles); - } - - $content = ''; - - foreach ($iniFiles as $file) { - // Check for inaccessible ini files - if (($data = @file_get_contents($file)) === false) { - throw new RuntimeException('Unable to read ini: '.$file); - } - // Check and remove directives after HOST and PATH sections - if (preg_match('/^\s*\[(?:PATH|HOST)\s*=/mi', $data, $matches, \PREG_OFFSET_CAPTURE)) { - $data = substr($data, 0, $matches[0][1]); - } - - $content .= $data."\n"; - } - - // Merge loaded settings into our ini content, if it is valid - $config = parse_ini_string($content); - $loaded = ini_get_all(null, false); - - if (false === $config || false === $loaded) { - throw new RuntimeException('Unable to parse ini data.'); - } - - $content .= $this->mergeLoadedConfig($loaded, $config); - - // Work-around for https://bugs.php.net/bug.php?id=75932 - $content .= "opcache.enable_cli=0\n"; - - if (false === @file_put_contents($tmpfile, $content)) { - throw new RuntimeException('Unable to write temporary ini file.'); - } - - return $tmpfile; - } - - private function mergeLoadedConfig(array $loadedConfig, array $iniConfig): string - { - $content = ''; - - foreach ($loadedConfig as $name => $value) { - if (!\is_string($value)) { - continue; - } - - if (!isset($iniConfig[$name]) || $iniConfig[$name] !== $value) { - // Double-quote escape each value - $content .= $name.'="'.addcslashes($value, '\\"')."\"\n"; - } - } - - return $content; - } - - private function getAllIniFiles(): array - { - $paths = [(string) php_ini_loaded_file()]; - - if (false !== $scanned = php_ini_scanned_files()) { - $paths = array_merge($paths, array_map('trim', explode(',', $scanned))); - } - - return $paths; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Pipes/AbstractPipes.php b/tools/php-cs-fixer/vendor/symfony/process/Pipes/AbstractPipes.php deleted file mode 100644 index 51a566f3..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Pipes/AbstractPipes.php +++ /dev/null @@ -1,176 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Exception\InvalidArgumentException; - -/** - * @author Romain Neutron - * - * @internal - */ -abstract class AbstractPipes implements PipesInterface -{ - public array $pipes = []; - - private string $inputBuffer = ''; - /** @var resource|string|\Iterator */ - private $input; - private bool $blocked = true; - private ?string $lastError = null; - - /** - * @param resource|string|\Iterator $input - */ - public function __construct($input) - { - if (\is_resource($input) || $input instanceof \Iterator) { - $this->input = $input; - } else { - $this->inputBuffer = (string) $input; - } - } - - public function close(): void - { - foreach ($this->pipes as $pipe) { - if (\is_resource($pipe)) { - fclose($pipe); - } - } - $this->pipes = []; - } - - /** - * Returns true if a system call has been interrupted. - */ - protected function hasSystemCallBeenInterrupted(): bool - { - $lastError = $this->lastError; - $this->lastError = null; - - // stream_select returns false when the `select` system call is interrupted by an incoming signal - return null !== $lastError && false !== stripos($lastError, 'interrupted system call'); - } - - /** - * Unblocks streams. - */ - protected function unblock(): void - { - if (!$this->blocked) { - return; - } - - foreach ($this->pipes as $pipe) { - stream_set_blocking($pipe, 0); - } - if (\is_resource($this->input)) { - stream_set_blocking($this->input, 0); - } - - $this->blocked = false; - } - - /** - * Writes input to stdin. - * - * @throws InvalidArgumentException When an input iterator yields a non supported value - */ - protected function write(): ?array - { - if (!isset($this->pipes[0])) { - return null; - } - $input = $this->input; - - if ($input instanceof \Iterator) { - if (!$input->valid()) { - $input = null; - } elseif (\is_resource($input = $input->current())) { - stream_set_blocking($input, 0); - } elseif (!isset($this->inputBuffer[0])) { - if (!\is_string($input)) { - if (!\is_scalar($input)) { - throw new InvalidArgumentException(\sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', get_debug_type($this->input), get_debug_type($input))); - } - $input = (string) $input; - } - $this->inputBuffer = $input; - $this->input->next(); - $input = null; - } else { - $input = null; - } - } - - $r = $e = []; - $w = [$this->pipes[0]]; - - // let's have a look if something changed in streams - if (false === @stream_select($r, $w, $e, 0, 0)) { - return null; - } - - foreach ($w as $stdin) { - if (isset($this->inputBuffer[0])) { - $written = fwrite($stdin, $this->inputBuffer); - $this->inputBuffer = substr($this->inputBuffer, $written); - if (isset($this->inputBuffer[0])) { - return [$this->pipes[0]]; - } - } - - if ($input) { - while (true) { - $data = fread($input, self::CHUNK_SIZE); - if (!isset($data[0])) { - break; - } - $written = fwrite($stdin, $data); - $data = substr($data, $written); - if (isset($data[0])) { - $this->inputBuffer = $data; - - return [$this->pipes[0]]; - } - } - if (feof($input)) { - if ($this->input instanceof \Iterator) { - $this->input->next(); - } else { - $this->input = null; - } - } - } - } - - // no input to read on resource, buffer is empty - if (!isset($this->inputBuffer[0]) && !($this->input instanceof \Iterator ? $this->input->valid() : $this->input)) { - $this->input = null; - fclose($this->pipes[0]); - unset($this->pipes[0]); - } elseif (!$w) { - return [$this->pipes[0]]; - } - - return null; - } - - /** - * @internal - */ - public function handleError(int $type, string $msg): void - { - $this->lastError = $msg; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Pipes/PipesInterface.php b/tools/php-cs-fixer/vendor/symfony/process/Pipes/PipesInterface.php deleted file mode 100644 index 967f8de7..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Pipes/PipesInterface.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -/** - * PipesInterface manages descriptors and pipes for the use of proc_open. - * - * @author Romain Neutron - * - * @internal - */ -interface PipesInterface -{ - public const CHUNK_SIZE = 16384; - - /** - * Returns an array of descriptors for the use of proc_open. - */ - public function getDescriptors(): array; - - /** - * Returns an array of filenames indexed by their related stream in case these pipes use temporary files. - * - * @return string[] - */ - public function getFiles(): array; - - /** - * Reads data in file handles and pipes. - * - * @param bool $blocking Whether to use blocking calls or not - * @param bool $close Whether to close pipes if they've reached EOF - * - * @return string[] An array of read data indexed by their fd - */ - public function readAndWrite(bool $blocking, bool $close = false): array; - - /** - * Returns if the current state has open file handles or pipes. - */ - public function areOpen(): bool; - - /** - * Returns if pipes are able to read output. - */ - public function haveReadSupport(): bool; - - /** - * Closes file handles and pipes. - */ - public function close(): void; -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Pipes/UnixPipes.php b/tools/php-cs-fixer/vendor/symfony/process/Pipes/UnixPipes.php deleted file mode 100644 index 8e95afaa..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Pipes/UnixPipes.php +++ /dev/null @@ -1,144 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Process; - -/** - * UnixPipes implementation uses unix pipes as handles. - * - * @author Romain Neutron - * - * @internal - */ -class UnixPipes extends AbstractPipes -{ - public function __construct( - private ?bool $ttyMode, - private bool $ptyMode, - mixed $input, - private bool $haveReadSupport, - ) { - parent::__construct($input); - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup(): void - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - $this->close(); - } - - public function getDescriptors(): array - { - if (!$this->haveReadSupport) { - $nullstream = fopen('/dev/null', 'c'); - - return [ - ['pipe', 'r'], - $nullstream, - $nullstream, - ]; - } - - if ($this->ttyMode) { - return [ - ['file', '/dev/tty', 'r'], - ['file', '/dev/tty', 'w'], - ['file', '/dev/tty', 'w'], - ]; - } - - if ($this->ptyMode && Process::isPtySupported()) { - return [ - ['pty'], - ['pty'], - ['pty'], - ]; - } - - return [ - ['pipe', 'r'], - ['pipe', 'w'], // stdout - ['pipe', 'w'], // stderr - ]; - } - - public function getFiles(): array - { - return []; - } - - public function readAndWrite(bool $blocking, bool $close = false): array - { - $this->unblock(); - $w = $this->write(); - - $read = $e = []; - $r = $this->pipes; - unset($r[0]); - - // let's have a look if something changed in streams - set_error_handler($this->handleError(...)); - if (($r || $w) && false === stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { - restore_error_handler(); - // if a system call has been interrupted, forget about it, let's try again - // otherwise, an error occurred, let's reset pipes - if (!$this->hasSystemCallBeenInterrupted()) { - $this->pipes = []; - } - - return $read; - } - restore_error_handler(); - - foreach ($r as $pipe) { - // prior PHP 5.4 the array passed to stream_select is modified and - // lose key association, we have to find back the key - $read[$type = array_search($pipe, $this->pipes, true)] = ''; - - do { - $data = @fread($pipe, self::CHUNK_SIZE); - $read[$type] .= $data; - } while (isset($data[0]) && ($close || isset($data[self::CHUNK_SIZE - 1]))); - - if (!isset($read[$type][0])) { - unset($read[$type]); - } - - if ($close && feof($pipe)) { - fclose($pipe); - unset($this->pipes[$type]); - } - } - - return $read; - } - - public function haveReadSupport(): bool - { - return $this->haveReadSupport; - } - - public function areOpen(): bool - { - return (bool) $this->pipes; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Pipes/WindowsPipes.php b/tools/php-cs-fixer/vendor/symfony/process/Pipes/WindowsPipes.php deleted file mode 100644 index 116b8e30..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Pipes/WindowsPipes.php +++ /dev/null @@ -1,185 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Process; - -/** - * WindowsPipes implementation uses temporary files as handles. - * - * @see https://bugs.php.net/51800 - * @see https://bugs.php.net/65650 - * - * @author Romain Neutron - * - * @internal - */ -class WindowsPipes extends AbstractPipes -{ - private array $files = []; - private array $fileHandles = []; - private array $lockHandles = []; - private array $readBytes = [ - Process::STDOUT => 0, - Process::STDERR => 0, - ]; - - public function __construct( - mixed $input, - private bool $haveReadSupport, - ) { - if ($this->haveReadSupport) { - // Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big. - // Workaround for this problem is to use temporary files instead of pipes on Windows platform. - // - // @see https://bugs.php.net/51800 - $pipes = [ - Process::STDOUT => Process::OUT, - Process::STDERR => Process::ERR, - ]; - $tmpDir = sys_get_temp_dir(); - $lastError = 'unknown reason'; - set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; }); - for ($i = 0;; ++$i) { - foreach ($pipes as $pipe => $name) { - $file = \sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); - - if (!$h = fopen($file.'.lock', 'w')) { - if (file_exists($file.'.lock')) { - continue 2; - } - restore_error_handler(); - throw new RuntimeException('A temporary file could not be opened to write the process output: '.$lastError); - } - if (!flock($h, \LOCK_EX | \LOCK_NB)) { - continue 2; - } - if (isset($this->lockHandles[$pipe])) { - flock($this->lockHandles[$pipe], \LOCK_UN); - fclose($this->lockHandles[$pipe]); - } - $this->lockHandles[$pipe] = $h; - - if (!($h = fopen($file, 'w')) || !fclose($h) || !$h = fopen($file, 'r')) { - flock($this->lockHandles[$pipe], \LOCK_UN); - fclose($this->lockHandles[$pipe]); - unset($this->lockHandles[$pipe]); - continue 2; - } - $this->fileHandles[$pipe] = $h; - $this->files[$pipe] = $file; - } - break; - } - restore_error_handler(); - } - - parent::__construct($input); - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup(): void - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - $this->close(); - } - - public function getDescriptors(): array - { - if (!$this->haveReadSupport) { - $nullstream = fopen('NUL', 'c'); - - return [ - ['pipe', 'r'], - $nullstream, - $nullstream, - ]; - } - - // We're not using pipe on Windows platform as it hangs (https://bugs.php.net/51800) - // We're not using file handles as it can produce corrupted output https://bugs.php.net/65650 - // So we redirect output within the commandline and pass the nul device to the process - return [ - ['pipe', 'r'], - ['file', 'NUL', 'w'], - ['file', 'NUL', 'w'], - ]; - } - - public function getFiles(): array - { - return $this->files; - } - - public function readAndWrite(bool $blocking, bool $close = false): array - { - $this->unblock(); - $w = $this->write(); - $read = $r = $e = []; - - if ($blocking) { - if ($w) { - @stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6); - } elseif ($this->fileHandles) { - usleep((int) (Process::TIMEOUT_PRECISION * 1E6)); - } - } - foreach ($this->fileHandles as $type => $fileHandle) { - $data = stream_get_contents($fileHandle, -1, $this->readBytes[$type]); - - if (isset($data[0])) { - $this->readBytes[$type] += \strlen($data); - $read[$type] = $data; - } - if ($close) { - ftruncate($fileHandle, 0); - fclose($fileHandle); - flock($this->lockHandles[$type], \LOCK_UN); - fclose($this->lockHandles[$type]); - unset($this->fileHandles[$type], $this->lockHandles[$type]); - } - } - - return $read; - } - - public function haveReadSupport(): bool - { - return $this->haveReadSupport; - } - - public function areOpen(): bool - { - return $this->pipes && $this->fileHandles; - } - - public function close(): void - { - parent::close(); - foreach ($this->fileHandles as $type => $handle) { - ftruncate($handle, 0); - fclose($handle); - flock($this->lockHandles[$type], \LOCK_UN); - fclose($this->lockHandles[$type]); - } - $this->fileHandles = $this->lockHandles = []; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/Process.php b/tools/php-cs-fixer/vendor/symfony/process/Process.php deleted file mode 100644 index 03ce70e5..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/Process.php +++ /dev/null @@ -1,1674 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\InvalidArgumentException; -use Symfony\Component\Process\Exception\LogicException; -use Symfony\Component\Process\Exception\ProcessFailedException; -use Symfony\Component\Process\Exception\ProcessSignaledException; -use Symfony\Component\Process\Exception\ProcessStartFailedException; -use Symfony\Component\Process\Exception\ProcessTimedOutException; -use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Pipes\UnixPipes; -use Symfony\Component\Process\Pipes\WindowsPipes; - -/** - * Process is a thin wrapper around proc_* functions to easily - * start independent PHP processes. - * - * @author Fabien Potencier - * @author Romain Neutron - * - * @implements \IteratorAggregate - */ -class Process implements \IteratorAggregate -{ - public const ERR = 'err'; - public const OUT = 'out'; - - public const STATUS_READY = 'ready'; - public const STATUS_STARTED = 'started'; - public const STATUS_TERMINATED = 'terminated'; - - public const STDIN = 0; - public const STDOUT = 1; - public const STDERR = 2; - - // Timeout Precision in seconds. - public const TIMEOUT_PRECISION = 0.2; - - public const ITER_NON_BLOCKING = 1; // By default, iterating over outputs is a blocking call, use this flag to make it non-blocking - public const ITER_KEEP_OUTPUT = 2; // By default, outputs are cleared while iterating, use this flag to keep them in memory - public const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating - public const ITER_SKIP_ERR = 8; // Use this flag to skip STDERR while iterating - - private ?\Closure $callback = null; - private array|string $commandline; - private ?string $cwd; - private array $env = []; - /** @var resource|string|\Iterator|null */ - private $input; - private ?float $starttime = null; - private ?float $lastOutputTime = null; - private ?float $timeout = null; - private ?float $idleTimeout = null; - private ?int $exitcode = null; - private array $fallbackStatus = []; - private array $processInformation; - private bool $outputDisabled = false; - /** @var resource */ - private $stdout; - /** @var resource */ - private $stderr; - /** @var resource|null */ - private $process; - private string $status = self::STATUS_READY; - private int $incrementalOutputOffset = 0; - private int $incrementalErrorOutputOffset = 0; - private bool $tty = false; - private bool $pty; - private array $options = ['suppress_errors' => true, 'bypass_shell' => true]; - private array $ignoredSignals = []; - - private WindowsPipes|UnixPipes $processPipes; - - private ?int $latestSignal = null; - private ?int $cachedExitCode = null; - - private static ?bool $sigchild = null; - private static array $executables = []; - - /** - * Exit codes translation table. - * - * User-defined errors must use exit codes in the 64-113 range. - */ - public static array $exitCodes = [ - 0 => 'OK', - 1 => 'General error', - 2 => 'Misuse of shell builtins', - - 126 => 'Invoked command cannot execute', - 127 => 'Command not found', - 128 => 'Invalid exit argument', - - // signals - 129 => 'Hangup', - 130 => 'Interrupt', - 131 => 'Quit and dump core', - 132 => 'Illegal instruction', - 133 => 'Trace/breakpoint trap', - 134 => 'Process aborted', - 135 => 'Bus error: "access to undefined portion of memory object"', - 136 => 'Floating point exception: "erroneous arithmetic operation"', - 137 => 'Kill (terminate immediately)', - 138 => 'User-defined 1', - 139 => 'Segmentation violation', - 140 => 'User-defined 2', - 141 => 'Write to pipe with no one reading', - 142 => 'Signal raised by alarm', - 143 => 'Termination (request to terminate)', - // 144 - not defined - 145 => 'Child process terminated, stopped (or continued*)', - 146 => 'Continue if stopped', - 147 => 'Stop executing temporarily', - 148 => 'Terminal stop signal', - 149 => 'Background process attempting to read from tty ("in")', - 150 => 'Background process attempting to write to tty ("out")', - 151 => 'Urgent data available on socket', - 152 => 'CPU time limit exceeded', - 153 => 'File size limit exceeded', - 154 => 'Signal raised by timer counting virtual time: "virtual timer expired"', - 155 => 'Profiling timer expired', - // 156 - not defined - 157 => 'Pollable event', - // 158 - not defined - 159 => 'Bad syscall', - ]; - - /** - * @param array $command The command to run and its arguments listed as separate entries - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input - * @param int|float|null $timeout The timeout in seconds or null to disable - * - * @throws LogicException When proc_open is not installed - */ - public function __construct(array $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60) - { - if (!\function_exists('proc_open')) { - throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.'); - } - - $this->commandline = $command; - $this->cwd = $cwd; - - // on Windows, if the cwd changed via chdir(), proc_open defaults to the dir where PHP was started - // on Gnu/Linux, PHP builds with --enable-maintainer-zts are also affected - // @see : https://bugs.php.net/51800 - // @see : https://bugs.php.net/50524 - if (null === $this->cwd && (\defined('ZEND_THREAD_SAFE') || '\\' === \DIRECTORY_SEPARATOR)) { - $this->cwd = getcwd(); - } - if (null !== $env) { - $this->setEnv($env); - } - - $this->setInput($input); - $this->setTimeout($timeout); - $this->pty = false; - } - - /** - * Creates a Process instance as a command-line to be run in a shell wrapper. - * - * Command-lines are parsed by the shell of your OS (/bin/sh on Unix-like, cmd.exe on Windows.) - * This allows using e.g. pipes or conditional execution. In this mode, signals are sent to the - * shell wrapper and not to your commands. - * - * In order to inject dynamic values into command-lines, we strongly recommend using placeholders. - * This will save escaping values, which is not portable nor secure anyway: - * - * $process = Process::fromShellCommandline('my_command "${:MY_VAR}"'); - * $process->run(null, ['MY_VAR' => $theValue]); - * - * @param string $command The command line to pass to the shell of the OS - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input - * @param int|float|null $timeout The timeout in seconds or null to disable - * - * @throws LogicException When proc_open is not installed - */ - public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static - { - $process = new static([], $cwd, $env, $input, $timeout); - $process->commandline = $command; - - return $process; - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup(): void - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - if ($this->options['create_new_console'] ?? false) { - $this->processPipes->close(); - } else { - $this->stop(0); - } - } - - public function __clone() - { - $this->resetProcessData(); - } - - /** - * Runs the process. - * - * The callback receives the type of output (out or err) and - * some bytes from the output in real-time. It allows to have feedback - * from the independent process during execution. - * - * The STDOUT and STDERR are also available after the process is finished - * via the getOutput() and getErrorOutput() methods. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @return int The exit status code - * - * @throws ProcessStartFailedException When process can't be launched - * @throws RuntimeException When process is already running - * @throws ProcessTimedOutException When process timed out - * @throws ProcessSignaledException When process stopped after receiving signal - * @throws LogicException In case a callback is provided and output has been disabled - * - * @final - */ - public function run(?callable $callback = null, array $env = []): int - { - $this->start($callback, $env); - - return $this->wait(); - } - - /** - * Runs the process. - * - * This is identical to run() except that an exception is thrown if the process - * exits with a non-zero exit code. - * - * @return $this - * - * @throws ProcessFailedException if the process didn't terminate successfully - * - * @final - */ - public function mustRun(?callable $callback = null, array $env = []): static - { - if (0 !== $this->run($callback, $env)) { - throw new ProcessFailedException($this); - } - - return $this; - } - - /** - * Starts the process and returns after writing the input to STDIN. - * - * This method blocks until all STDIN data is sent to the process then it - * returns while the process runs in the background. - * - * The termination of the process can be awaited with wait(). - * - * The callback receives the type of output (out or err) and some bytes from - * the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @throws ProcessStartFailedException When process can't be launched - * @throws RuntimeException When process is already running - * @throws LogicException In case a callback is provided and output has been disabled - */ - public function start(?callable $callback = null, array $env = []): void - { - if ($this->isRunning()) { - throw new RuntimeException('Process is already running.'); - } - - $this->resetProcessData(); - $this->starttime = $this->lastOutputTime = microtime(true); - $this->callback = $this->buildCallback($callback); - $descriptors = $this->getDescriptors(null !== $callback); - - if ($this->env) { - $env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->env, $env, 'strcasecmp') : $this->env; - } - - $env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->getDefaultEnv(), $env, 'strcasecmp') : $this->getDefaultEnv(); - - if (\is_array($commandline = $this->commandline)) { - $commandline = array_values(array_map(strval(...), $commandline)); - } else { - $commandline = $this->replacePlaceholders($commandline, $env); - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - $commandline = $this->prepareWindowsCommandLine($commandline, $env); - } elseif ($this->isSigchildEnabled()) { - // last exit code is output on the fourth pipe and caught to work around --enable-sigchild - $descriptors[3] = ['pipe', 'w']; - - if (\is_array($commandline)) { - // exec is mandatory to deal with sending a signal to the process - $commandline = 'exec '.$this->buildShellCommandline($commandline); - } - - // See https://unix.stackexchange.com/questions/71205/background-process-pipe-input - $commandline = '{ ('.$commandline.') <&3 3<&- 3>/dev/null & } 3<&0;'; - $commandline .= 'pid=$!; echo $pid >&3; wait $pid 2>/dev/null; code=$?; echo $code >&3; exit $code'; - } - - $envPairs = []; - foreach ($env as $k => $v) { - if (false !== $v && false === \in_array($k, ['argc', 'argv', 'ARGC', 'ARGV'], true)) { - $envPairs[] = $k.'='.$v; - } - } - - if (!is_dir($this->cwd)) { - throw new RuntimeException(\sprintf('The provided cwd "%s" does not exist.', $this->cwd)); - } - - $lastError = null; - set_error_handler(function ($type, $msg) use (&$lastError) { - $lastError = $msg; - - return true; - }); - - $oldMask = []; - - if ($this->ignoredSignals && \function_exists('pcntl_sigprocmask')) { - // we block signals we want to ignore, as proc_open will use fork / posix_spawn which will copy the signal mask this allow to block - // signals in the child process - pcntl_sigprocmask(\SIG_BLOCK, $this->ignoredSignals, $oldMask); - } - - try { - $process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options); - - // Ensure array vs string commands behave the same - if (!$process && \is_array($commandline)) { - $process = @proc_open('exec '.$this->buildShellCommandline($commandline), $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options); - } - } finally { - if ($this->ignoredSignals && \function_exists('pcntl_sigprocmask')) { - // we restore the signal mask here to avoid any side effects - pcntl_sigprocmask(\SIG_SETMASK, $oldMask); - } - - restore_error_handler(); - } - - if (!$process) { - throw new ProcessStartFailedException($this, $lastError); - } - $this->process = $process; - $this->status = self::STATUS_STARTED; - - if (isset($descriptors[3])) { - $this->fallbackStatus['pid'] = (int) fgets($this->processPipes->pipes[3]); - } - - if ($this->tty) { - return; - } - - $this->updateStatus(false); - $this->checkTimeout(); - } - - /** - * Restarts the process. - * - * Be warned that the process is cloned before being started. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @throws ProcessStartFailedException When process can't be launched - * @throws RuntimeException When process is already running - * - * @see start() - * - * @final - */ - public function restart(?callable $callback = null, array $env = []): static - { - if ($this->isRunning()) { - throw new RuntimeException('Process is already running.'); - } - - $process = clone $this; - $process->start($callback, $env); - - return $process; - } - - /** - * Waits for the process to terminate. - * - * The callback receives the type of output (out or err) and some bytes - * from the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @param callable|null $callback A valid PHP callback - * - * @return int The exitcode of the process - * - * @throws ProcessTimedOutException When process timed out - * @throws ProcessSignaledException When process stopped after receiving signal - * @throws LogicException When process is not yet started - */ - public function wait(?callable $callback = null): int - { - $this->requireProcessIsStarted(__FUNCTION__); - - $this->updateStatus(false); - - if (null !== $callback) { - if (!$this->processPipes->haveReadSupport()) { - $this->stop(0); - throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait".'); - } - $this->callback = $this->buildCallback($callback); - } - - do { - $this->checkTimeout(); - $running = $this->isRunning() && ('\\' === \DIRECTORY_SEPARATOR || $this->processPipes->areOpen()); - $this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); - } while ($running); - - while ($this->isRunning()) { - $this->checkTimeout(); - usleep(1000); - } - - if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) { - throw new ProcessSignaledException($this); - } - - return $this->exitcode; - } - - /** - * Waits until the callback returns true. - * - * The callback receives the type of output (out or err) and some bytes - * from the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @throws RuntimeException When process timed out - * @throws LogicException When process is not yet started - * @throws ProcessTimedOutException In case the timeout was reached - */ - public function waitUntil(callable $callback): bool - { - $this->requireProcessIsStarted(__FUNCTION__); - $this->updateStatus(false); - - if (!$this->processPipes->haveReadSupport()) { - $this->stop(0); - throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil".'); - } - $callback = $this->buildCallback($callback); - - $ready = false; - while (true) { - $this->checkTimeout(); - $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); - $output = $this->processPipes->readAndWrite($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); - - foreach ($output as $type => $data) { - if (3 !== $type) { - $ready = $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data) || $ready; - } elseif (!isset($this->fallbackStatus['signaled'])) { - $this->fallbackStatus['exitcode'] = (int) $data; - } - } - if ($ready) { - return true; - } - if (!$running) { - return false; - } - - usleep(1000); - } - } - - /** - * Returns the Pid (process identifier), if applicable. - * - * @return int|null The process id if running, null otherwise - */ - public function getPid(): ?int - { - return $this->isRunning() ? $this->processInformation['pid'] : null; - } - - /** - * Sends a POSIX signal to the process. - * - * @param int $signal A valid POSIX signal (see https://php.net/pcntl.constants) - * - * @return $this - * - * @throws LogicException In case the process is not running - * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed - * @throws RuntimeException In case of failure - */ - public function signal(int $signal): static - { - $this->doSignal($signal, true); - - return $this; - } - - /** - * Disables fetching output and error output from the underlying process. - * - * @return $this - * - * @throws RuntimeException In case the process is already running - * @throws LogicException if an idle timeout is set - */ - public function disableOutput(): static - { - if ($this->isRunning()) { - throw new RuntimeException('Disabling output while the process is running is not possible.'); - } - if (null !== $this->idleTimeout) { - throw new LogicException('Output cannot be disabled while an idle timeout is set.'); - } - - $this->outputDisabled = true; - - return $this; - } - - /** - * Enables fetching output and error output from the underlying process. - * - * @return $this - * - * @throws RuntimeException In case the process is already running - */ - public function enableOutput(): static - { - if ($this->isRunning()) { - throw new RuntimeException('Enabling output while the process is running is not possible.'); - } - - $this->outputDisabled = false; - - return $this; - } - - /** - * Returns true in case the output is disabled, false otherwise. - */ - public function isOutputDisabled(): bool - { - return $this->outputDisabled; - } - - /** - * Returns the current output of the process (STDOUT). - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getOutput(): string - { - $this->readPipesForOutput(__FUNCTION__); - - if (false === $ret = stream_get_contents($this->stdout, -1, 0)) { - return ''; - } - - return $ret; - } - - /** - * Returns the output incrementally. - * - * In comparison with the getOutput method which always return the whole - * output, this one returns the new output since the last call. - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getIncrementalOutput(): string - { - $this->readPipesForOutput(__FUNCTION__); - - $latest = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); - $this->incrementalOutputOffset = ftell($this->stdout); - - if (false === $latest) { - return ''; - } - - return $latest; - } - - /** - * Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR). - * - * @param int $flags A bit field of Process::ITER_* flags - * - * @return \Generator - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getIterator(int $flags = 0): \Generator - { - $this->readPipesForOutput(__FUNCTION__, false); - - $clearOutput = !(self::ITER_KEEP_OUTPUT & $flags); - $blocking = !(self::ITER_NON_BLOCKING & $flags); - $yieldOut = !(self::ITER_SKIP_OUT & $flags); - $yieldErr = !(self::ITER_SKIP_ERR & $flags); - - while (null !== $this->callback || ($yieldOut && !feof($this->stdout)) || ($yieldErr && !feof($this->stderr))) { - if ($yieldOut) { - $out = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); - - if (isset($out[0])) { - if ($clearOutput) { - $this->clearOutput(); - } else { - $this->incrementalOutputOffset = ftell($this->stdout); - } - - yield self::OUT => $out; - } - } - - if ($yieldErr) { - $err = stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset); - - if (isset($err[0])) { - if ($clearOutput) { - $this->clearErrorOutput(); - } else { - $this->incrementalErrorOutputOffset = ftell($this->stderr); - } - - yield self::ERR => $err; - } - } - - if (!$blocking && !isset($out[0]) && !isset($err[0])) { - yield self::OUT => ''; - } - - $this->checkTimeout(); - $this->readPipesForOutput(__FUNCTION__, $blocking); - } - } - - /** - * Clears the process output. - * - * @return $this - */ - public function clearOutput(): static - { - ftruncate($this->stdout, 0); - fseek($this->stdout, 0); - $this->incrementalOutputOffset = 0; - - return $this; - } - - /** - * Returns the current error output of the process (STDERR). - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getErrorOutput(): string - { - $this->readPipesForOutput(__FUNCTION__); - - if (false === $ret = stream_get_contents($this->stderr, -1, 0)) { - return ''; - } - - return $ret; - } - - /** - * Returns the errorOutput incrementally. - * - * In comparison with the getErrorOutput method which always return the - * whole error output, this one returns the new error output since the last - * call. - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getIncrementalErrorOutput(): string - { - $this->readPipesForOutput(__FUNCTION__); - - $latest = stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset); - $this->incrementalErrorOutputOffset = ftell($this->stderr); - - if (false === $latest) { - return ''; - } - - return $latest; - } - - /** - * Clears the process output. - * - * @return $this - */ - public function clearErrorOutput(): static - { - ftruncate($this->stderr, 0); - fseek($this->stderr, 0); - $this->incrementalErrorOutputOffset = 0; - - return $this; - } - - /** - * Returns the exit code returned by the process. - * - * @return int|null The exit status code, null if the Process is not terminated - */ - public function getExitCode(): ?int - { - $this->updateStatus(false); - - return $this->exitcode; - } - - /** - * Returns a string representation for the exit code returned by the process. - * - * This method relies on the Unix exit code status standardization - * and might not be relevant for other operating systems. - * - * @return string|null A string representation for the exit status code, null if the Process is not terminated - * - * @see http://tldp.org/LDP/abs/html/exitcodes.html - * @see http://en.wikipedia.org/wiki/Unix_signal - */ - public function getExitCodeText(): ?string - { - if (null === $exitcode = $this->getExitCode()) { - return null; - } - - return self::$exitCodes[$exitcode] ?? 'Unknown error'; - } - - /** - * Checks if the process ended successfully. - */ - public function isSuccessful(): bool - { - return 0 === $this->getExitCode(); - } - - /** - * Returns true if the child process has been terminated by an uncaught signal. - * - * It always returns false on Windows. - * - * @throws LogicException In case the process is not terminated - */ - public function hasBeenSignaled(): bool - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['signaled']; - } - - /** - * Returns the number of the signal that caused the child process to terminate its execution. - * - * It is only meaningful if hasBeenSignaled() returns true. - * - * @throws RuntimeException In case --enable-sigchild is activated - * @throws LogicException In case the process is not terminated - */ - public function getTermSignal(): int - { - $this->requireProcessIsTerminated(__FUNCTION__); - - if ($this->isSigchildEnabled() && -1 === $this->processInformation['termsig']) { - throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal cannot be retrieved.'); - } - - return $this->processInformation['termsig']; - } - - /** - * Returns true if the child process has been stopped by a signal. - * - * It always returns false on Windows. - * - * @throws LogicException In case the process is not terminated - */ - public function hasBeenStopped(): bool - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['stopped']; - } - - /** - * Returns the number of the signal that caused the child process to stop its execution. - * - * It is only meaningful if hasBeenStopped() returns true. - * - * @throws LogicException In case the process is not terminated - */ - public function getStopSignal(): int - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['stopsig']; - } - - /** - * Checks if the process is currently running. - */ - public function isRunning(): bool - { - if (self::STATUS_STARTED !== $this->status) { - return false; - } - - $this->updateStatus(false); - - return $this->processInformation['running']; - } - - /** - * Checks if the process has been started with no regard to the current state. - */ - public function isStarted(): bool - { - return self::STATUS_READY != $this->status; - } - - /** - * Checks if the process is terminated. - */ - public function isTerminated(): bool - { - $this->updateStatus(false); - - return self::STATUS_TERMINATED == $this->status; - } - - /** - * Gets the process status. - * - * The status is one of: ready, started, terminated. - */ - public function getStatus(): string - { - $this->updateStatus(false); - - return $this->status; - } - - /** - * Stops the process. - * - * @param int|float $timeout The timeout in seconds - * @param int|null $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) - * - * @return int|null The exit-code of the process or null if it's not running - */ - public function stop(float $timeout = 10, ?int $signal = null): ?int - { - $timeoutMicro = microtime(true) + $timeout; - if ($this->isRunning()) { - // given SIGTERM may not be defined and that "proc_terminate" uses the constant value and not the constant itself, we use the same here - $this->doSignal(15, false); - do { - usleep(1000); - } while ($this->isRunning() && microtime(true) < $timeoutMicro); - - if ($this->isRunning()) { - // Avoid exception here: process is supposed to be running, but it might have stopped just - // after this line. In any case, let's silently discard the error, we cannot do anything. - $this->doSignal($signal ?: 9, false); - } - } - - if ($this->isRunning()) { - if (isset($this->fallbackStatus['pid'])) { - unset($this->fallbackStatus['pid']); - - return $this->stop(0, $signal); - } - $this->close(); - } - - return $this->exitcode; - } - - /** - * Adds a line to the STDOUT stream. - * - * @internal - */ - public function addOutput(string $line): void - { - $this->lastOutputTime = microtime(true); - - fseek($this->stdout, 0, \SEEK_END); - fwrite($this->stdout, $line); - fseek($this->stdout, $this->incrementalOutputOffset); - } - - /** - * Adds a line to the STDERR stream. - * - * @internal - */ - public function addErrorOutput(string $line): void - { - $this->lastOutputTime = microtime(true); - - fseek($this->stderr, 0, \SEEK_END); - fwrite($this->stderr, $line); - fseek($this->stderr, $this->incrementalErrorOutputOffset); - } - - /** - * Gets the last output time in seconds. - */ - public function getLastOutputTime(): ?float - { - return $this->lastOutputTime; - } - - /** - * Gets the command line to be executed. - */ - public function getCommandLine(): string - { - return $this->buildShellCommandline($this->commandline); - } - - /** - * Gets the process timeout in seconds (max. runtime). - */ - public function getTimeout(): ?float - { - return $this->timeout; - } - - /** - * Gets the process idle timeout in seconds (max. time since last output). - */ - public function getIdleTimeout(): ?float - { - return $this->idleTimeout; - } - - /** - * Sets the process timeout (max. runtime) in seconds. - * - * To disable the timeout, set this value to null. - * - * @return $this - * - * @throws InvalidArgumentException if the timeout is negative - */ - public function setTimeout(?float $timeout): static - { - $this->timeout = $this->validateTimeout($timeout); - - return $this; - } - - /** - * Sets the process idle timeout (max. time since last output) in seconds. - * - * To disable the timeout, set this value to null. - * - * @return $this - * - * @throws LogicException if the output is disabled - * @throws InvalidArgumentException if the timeout is negative - */ - public function setIdleTimeout(?float $timeout): static - { - if (null !== $timeout && $this->outputDisabled) { - throw new LogicException('Idle timeout cannot be set while the output is disabled.'); - } - - $this->idleTimeout = $this->validateTimeout($timeout); - - return $this; - } - - /** - * Enables or disables the TTY mode. - * - * @return $this - * - * @throws RuntimeException In case the TTY mode is not supported - */ - public function setTty(bool $tty): static - { - if ('\\' === \DIRECTORY_SEPARATOR && $tty) { - throw new RuntimeException('TTY mode is not supported on Windows platform.'); - } - - if ($tty && !self::isTtySupported()) { - throw new RuntimeException('TTY mode requires /dev/tty to be read/writable.'); - } - - $this->tty = $tty; - - return $this; - } - - /** - * Checks if the TTY mode is enabled. - */ - public function isTty(): bool - { - return $this->tty; - } - - /** - * Sets PTY mode. - * - * @return $this - */ - public function setPty(bool $bool): static - { - $this->pty = $bool; - - return $this; - } - - /** - * Returns PTY state. - */ - public function isPty(): bool - { - return $this->pty; - } - - /** - * Gets the working directory. - */ - public function getWorkingDirectory(): ?string - { - if (null === $this->cwd) { - // getcwd() will return false if any one of the parent directories does not have - // the readable or search mode set, even if the current directory does - return getcwd() ?: null; - } - - return $this->cwd; - } - - /** - * Sets the current working directory. - * - * @return $this - */ - public function setWorkingDirectory(string $cwd): static - { - $this->cwd = $cwd; - - return $this; - } - - /** - * Gets the environment variables. - */ - public function getEnv(): array - { - return $this->env; - } - - /** - * Sets the environment variables. - * - * @param array $env The new environment variables - * - * @return $this - */ - public function setEnv(array $env): static - { - $this->env = $env; - - return $this; - } - - /** - * Gets the Process input. - * - * @return resource|string|\Iterator|null - */ - public function getInput() - { - return $this->input; - } - - /** - * Sets the input. - * - * This content will be passed to the underlying process standard input. - * - * @param string|resource|\Traversable|self|null $input The content - * - * @return $this - * - * @throws LogicException In case the process is running - */ - public function setInput(mixed $input): static - { - if ($this->isRunning()) { - throw new LogicException('Input cannot be set while the process is running.'); - } - - $this->input = ProcessUtils::validateInput(__METHOD__, $input); - - return $this; - } - - /** - * Performs a check between the timeout definition and the time the process started. - * - * In case you run a background process (with the start method), you should - * trigger this method regularly to ensure the process timeout - * - * @throws ProcessTimedOutException In case the timeout was reached - */ - public function checkTimeout(): void - { - if (self::STATUS_STARTED !== $this->status) { - return; - } - - if (null !== $this->timeout && $this->timeout < microtime(true) - $this->starttime) { - $this->stop(0); - - throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL); - } - - if (null !== $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) { - $this->stop(0); - - throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE); - } - } - - /** - * @throws LogicException in case process is not started - */ - public function getStartTime(): float - { - if (!$this->isStarted()) { - throw new LogicException('Start time is only available after process start.'); - } - - return $this->starttime; - } - - /** - * Defines options to pass to the underlying proc_open(). - * - * @see https://php.net/proc_open for the options supported by PHP. - * - * Enabling the "create_new_console" option allows a subprocess to continue - * to run after the main process exited, on both Windows and *nix - */ - public function setOptions(array $options): void - { - if ($this->isRunning()) { - throw new RuntimeException('Setting options while the process is running is not possible.'); - } - - $defaultOptions = $this->options; - $existingOptions = ['blocking_pipes', 'create_process_group', 'create_new_console']; - - foreach ($options as $key => $value) { - if (!\in_array($key, $existingOptions)) { - $this->options = $defaultOptions; - throw new LogicException(\sprintf('Invalid option "%s" passed to "%s()". Supported options are "%s".', $key, __METHOD__, implode('", "', $existingOptions))); - } - $this->options[$key] = $value; - } - } - - /** - * Defines a list of posix signals that will not be propagated to the process. - * - * @param list<\SIG*> $signals - */ - public function setIgnoredSignals(array $signals): void - { - if ($this->isRunning()) { - throw new RuntimeException('Setting ignored signals while the process is running is not possible.'); - } - - $this->ignoredSignals = $signals; - } - - /** - * Returns whether TTY is supported on the current operating system. - */ - public static function isTtySupported(): bool - { - static $isTtySupported; - - return $isTtySupported ??= ('/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT) && @is_writable('/dev/tty')); - } - - /** - * Returns whether PTY is supported on the current operating system. - */ - public static function isPtySupported(): bool - { - static $result; - - if (null !== $result) { - return $result; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - return $result = false; - } - - return $result = (bool) @proc_open('echo 1 >/dev/null', [['pty'], ['pty'], ['pty']], $pipes); - } - - /** - * Creates the descriptors needed by the proc_open. - */ - private function getDescriptors(bool $hasCallback): array - { - if ($this->input instanceof \Iterator) { - $this->input->rewind(); - } - if ('\\' === \DIRECTORY_SEPARATOR) { - $this->processPipes = new WindowsPipes($this->input, !$this->outputDisabled || $hasCallback); - } else { - $this->processPipes = new UnixPipes($this->isTty(), $this->isPty(), $this->input, !$this->outputDisabled || $hasCallback); - } - - return $this->processPipes->getDescriptors(); - } - - /** - * Builds up the callback used by wait(). - * - * The callbacks adds all occurred output to the specific buffer and calls - * the user callback (if present) with the received output. - * - * @param callable|null $callback The user defined PHP callback - */ - protected function buildCallback(?callable $callback = null): \Closure - { - if ($this->outputDisabled) { - return fn ($type, $data): bool => null !== $callback && $callback($type, $data); - } - - $out = self::OUT; - - return function ($type, $data) use ($callback, $out): bool { - if ($out == $type) { - $this->addOutput($data); - } else { - $this->addErrorOutput($data); - } - - return null !== $callback && $callback($type, $data); - }; - } - - /** - * Updates the status of the process, reads pipes. - * - * @param bool $blocking Whether to use a blocking read call - */ - protected function updateStatus(bool $blocking): void - { - if (self::STATUS_STARTED !== $this->status) { - return; - } - - $this->processInformation = proc_get_status($this->process); - $running = $this->processInformation['running']; - - // In PHP < 8.3, "proc_get_status" only returns the correct exit status on the first call. - // Subsequent calls return -1 as the process is discarded. This workaround caches the first - // retrieved exit status for consistent results in later calls, mimicking PHP 8.3 behavior. - if (\PHP_VERSION_ID < 80300) { - if (!isset($this->cachedExitCode) && !$running && -1 !== $this->processInformation['exitcode']) { - $this->cachedExitCode = $this->processInformation['exitcode']; - } - - if (isset($this->cachedExitCode) && !$running && -1 === $this->processInformation['exitcode']) { - $this->processInformation['exitcode'] = $this->cachedExitCode; - } - } - - $this->readPipes($running && $blocking, '\\' !== \DIRECTORY_SEPARATOR || !$running); - - if ($this->fallbackStatus && $this->isSigchildEnabled()) { - $this->processInformation = $this->fallbackStatus + $this->processInformation; - } - - if (!$running) { - $this->close(); - } - } - - /** - * Returns whether PHP has been compiled with the '--enable-sigchild' option or not. - */ - protected function isSigchildEnabled(): bool - { - if (null !== self::$sigchild) { - return self::$sigchild; - } - - if (!\function_exists('phpinfo')) { - return self::$sigchild = false; - } - - ob_start(); - phpinfo(\INFO_GENERAL); - - return self::$sigchild = str_contains(ob_get_clean(), '--enable-sigchild'); - } - - /** - * Reads pipes for the freshest output. - * - * @param string $caller The name of the method that needs fresh outputs - * @param bool $blocking Whether to use blocking calls or not - * - * @throws LogicException in case output has been disabled or process is not started - */ - private function readPipesForOutput(string $caller, bool $blocking = false): void - { - if ($this->outputDisabled) { - throw new LogicException('Output has been disabled.'); - } - - $this->requireProcessIsStarted($caller); - - $this->updateStatus($blocking); - } - - /** - * Validates and returns the filtered timeout. - * - * @throws InvalidArgumentException if the given timeout is a negative number - */ - private function validateTimeout(?float $timeout): ?float - { - $timeout = (float) $timeout; - - if (0.0 === $timeout) { - $timeout = null; - } elseif ($timeout < 0) { - throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.'); - } - - return $timeout; - } - - /** - * Reads pipes, executes callback. - * - * @param bool $blocking Whether to use blocking calls or not - * @param bool $close Whether to close file handles or not - */ - private function readPipes(bool $blocking, bool $close): void - { - $result = $this->processPipes->readAndWrite($blocking, $close); - - $callback = $this->callback; - foreach ($result as $type => $data) { - if (3 !== $type) { - $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data); - } elseif (!isset($this->fallbackStatus['signaled'])) { - $this->fallbackStatus['exitcode'] = (int) $data; - } - } - } - - /** - * Closes process resource, closes file handles, sets the exitcode. - * - * @return int The exitcode - */ - private function close(): int - { - $this->processPipes->close(); - if ($this->process) { - proc_close($this->process); - $this->process = null; - } - $this->exitcode = $this->processInformation['exitcode']; - $this->status = self::STATUS_TERMINATED; - - if (-1 === $this->exitcode) { - if ($this->processInformation['signaled'] && 0 < $this->processInformation['termsig']) { - // if process has been signaled, no exitcode but a valid termsig, apply Unix convention - $this->exitcode = 128 + $this->processInformation['termsig']; - } elseif ($this->isSigchildEnabled()) { - $this->processInformation['signaled'] = true; - $this->processInformation['termsig'] = -1; - } - } - - // Free memory from self-reference callback created by buildCallback - // Doing so in other contexts like __destruct or by garbage collector is ineffective - // Now pipes are closed, so the callback is no longer necessary - $this->callback = null; - - return $this->exitcode; - } - - /** - * Resets data related to the latest run of the process. - */ - private function resetProcessData(): void - { - $this->starttime = null; - $this->callback = null; - $this->exitcode = null; - $this->fallbackStatus = []; - $this->processInformation = []; - $this->stdout = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); - $this->stderr = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); - $this->process = null; - $this->latestSignal = null; - $this->status = self::STATUS_READY; - $this->incrementalOutputOffset = 0; - $this->incrementalErrorOutputOffset = 0; - } - - /** - * Sends a POSIX signal to the process. - * - * @param int $signal A valid POSIX signal (see https://php.net/pcntl.constants) - * @param bool $throwException Whether to throw exception in case signal failed - * - * @throws LogicException In case the process is not running - * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed - * @throws RuntimeException In case of failure - */ - private function doSignal(int $signal, bool $throwException): bool - { - // Signal seems to be send when sigchild is enable, this allow blocking the signal correctly in this case - if ($this->isSigchildEnabled() && \in_array($signal, $this->ignoredSignals)) { - return false; - } - - if (null === $pid = $this->getPid()) { - if ($throwException) { - throw new LogicException('Cannot send signal on a non running process.'); - } - - return false; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - exec(\sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode); - if ($exitCode && $this->isRunning()) { - if ($throwException) { - throw new RuntimeException(\sprintf('Unable to kill the process (%s).', implode(' ', $output))); - } - - return false; - } - } else { - if (!$this->isSigchildEnabled()) { - $ok = @proc_terminate($this->process, $signal); - } elseif (\function_exists('posix_kill')) { - $ok = @posix_kill($pid, $signal); - } elseif ($ok = proc_open(\sprintf('kill -%d %d', $signal, $pid), [2 => ['pipe', 'w']], $pipes)) { - $ok = false === fgets($pipes[2]); - } - if (!$ok) { - if ($throwException) { - throw new RuntimeException(\sprintf('Error while sending signal "%s".', $signal)); - } - - return false; - } - } - - $this->latestSignal = $signal; - $this->fallbackStatus['signaled'] = true; - $this->fallbackStatus['exitcode'] = -1; - $this->fallbackStatus['termsig'] = $this->latestSignal; - - return true; - } - - private function buildShellCommandline(string|array $commandline): string - { - if (\is_string($commandline)) { - return $commandline; - } - - if ('\\' === \DIRECTORY_SEPARATOR && isset($commandline[0][0]) && \strlen($commandline[0]) === strcspn($commandline[0], ':/\\')) { - // On Windows, we don't rely on the OS to find the executable if possible to avoid lookups - // in the current directory which could be untrusted. Instead we use the ExecutableFinder. - $commandline[0] = (self::$executables[$commandline[0]] ??= (new ExecutableFinder())->find($commandline[0])) ?? $commandline[0]; - } - - return implode(' ', array_map($this->escapeArgument(...), $commandline)); - } - - private function prepareWindowsCommandLine(string|array $cmd, array &$env): string - { - $cmd = $this->buildShellCommandline($cmd); - $uid = bin2hex(random_bytes(4)); - $cmd = preg_replace_callback( - '/"(?:( - [^"%!^]*+ - (?: - (?: !LF! | "(?:\^[%!^])?+" ) - [^"%!^]*+ - )++ - ) | [^"]*+ )"/x', - function ($m) use (&$env, $uid) { - static $varCount = 0; - static $varCache = []; - if (!isset($m[1])) { - return $m[0]; - } - if (isset($varCache[$m[0]])) { - return $varCache[$m[0]]; - } - if (str_contains($value = $m[1], "\0")) { - $value = str_replace("\0", '?', $value); - } - if (false === strpbrk($value, "\"%!\n")) { - return '"'.$value.'"'; - } - - $value = str_replace(['!LF!', '"^!"', '"^%"', '"^^"', '""'], ["\n", '!', '%', '^', '"'], $value); - $value = '"'.preg_replace('/(\\\\*)"/', '$1$1\\"', $value).'"'; - $var = $uid.++$varCount; - - $env[$var] = $value; - - return $varCache[$m[0]] = '!'.$var.'!'; - }, - $cmd - ); - - static $comSpec; - - if (!$comSpec && $comSpec = (new ExecutableFinder())->find('cmd.exe')) { - // Escape according to CommandLineToArgvW rules - $comSpec = '"'.preg_replace('{(\\\\*+)"}', '$1$1\"', $comSpec) .'"'; - } - - $cmd = ($comSpec ?? 'cmd').' /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; - foreach ($this->processPipes->getFiles() as $offset => $filename) { - $cmd .= ' '.$offset.'>"'.$filename.'"'; - } - - return $cmd; - } - - /** - * Ensures the process is running or terminated, throws a LogicException if the process has a not started. - * - * @throws LogicException if the process has not run - */ - private function requireProcessIsStarted(string $functionName): void - { - if (!$this->isStarted()) { - throw new LogicException(\sprintf('Process must be started before calling "%s()".', $functionName)); - } - } - - /** - * Ensures the process is terminated, throws a LogicException if the process has a status different than "terminated". - * - * @throws LogicException if the process is not yet terminated - */ - private function requireProcessIsTerminated(string $functionName): void - { - if (!$this->isTerminated()) { - throw new LogicException(\sprintf('Process must be terminated before calling "%s()".', $functionName)); - } - } - - /** - * Escapes a string to be used as a shell argument. - */ - private function escapeArgument(?string $argument): string - { - if ('' === $argument || null === $argument) { - return '""'; - } - if ('\\' !== \DIRECTORY_SEPARATOR) { - return "'".str_replace("'", "'\\''", $argument)."'"; - } - if (str_contains($argument, "\0")) { - $argument = str_replace("\0", '?', $argument); - } - if (!preg_match('/[()%!^"<>&|\s]/', $argument)) { - return $argument; - } - $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument); - - return '"'.str_replace(['"', '^', '%', '!', "\n"], ['""', '"^^"', '"^%"', '"^!"', '!LF!'], $argument).'"'; - } - - private function replacePlaceholders(string $commandline, array $env): string - { - return preg_replace_callback('/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/', function ($matches) use ($commandline, $env) { - if (!isset($env[$matches[1]]) || false === $env[$matches[1]]) { - throw new InvalidArgumentException(\sprintf('Command line is missing a value for parameter "%s": ', $matches[1]).$commandline); - } - - return $this->escapeArgument($env[$matches[1]]); - }, $commandline); - } - - private function getDefaultEnv(): array - { - $env = getenv(); - $env = ('\\' === \DIRECTORY_SEPARATOR ? array_intersect_ukey($env, $_SERVER, 'strcasecmp') : array_intersect_key($env, $_SERVER)) ?: $env; - - return $_ENV + ('\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($env, $_ENV, 'strcasecmp') : $env); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/ProcessUtils.php b/tools/php-cs-fixer/vendor/symfony/process/ProcessUtils.php deleted file mode 100644 index a2dbde9f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/ProcessUtils.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\InvalidArgumentException; - -/** - * ProcessUtils is a bunch of utility methods. - * - * This class contains static methods only and is not meant to be instantiated. - * - * @author Martin Hasoň - */ -class ProcessUtils -{ - /** - * This class should not be instantiated. - */ - private function __construct() - { - } - - /** - * Validates and normalizes a Process input. - * - * @param string $caller The name of method call that validates the input - * @param mixed $input The input to validate - * - * @throws InvalidArgumentException In case the input is not valid - */ - public static function validateInput(string $caller, mixed $input): mixed - { - if (null !== $input) { - if (\is_resource($input)) { - return $input; - } - if (\is_scalar($input)) { - return (string) $input; - } - if ($input instanceof Process) { - return $input->getIterator($input::ITER_SKIP_ERR); - } - if ($input instanceof \Iterator) { - return $input; - } - if ($input instanceof \Traversable) { - return new \IteratorIterator($input); - } - - throw new InvalidArgumentException(\sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller)); - } - - return $input; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/process/README.md b/tools/php-cs-fixer/vendor/symfony/process/README.md deleted file mode 100644 index afce5e45..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Process Component -================= - -The Process component executes commands in sub-processes. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/process.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/tools/php-cs-fixer/vendor/symfony/process/composer.json b/tools/php-cs-fixer/vendor/symfony/process/composer.json deleted file mode 100644 index dda5575e..00000000 --- a/tools/php-cs-fixer/vendor/symfony/process/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "symfony/process", - "type": "library", - "description": "Executes commands in sub-processes", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.2" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Process\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/Required.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/Required.php deleted file mode 100644 index 9df85118..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/Required.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Attribute; - -/** - * A required dependency. - * - * This attribute indicates that a property holds a required dependency. The annotated property or method should be - * considered during the instantiation process of the containing class. - * - * @author Alexander M. Turek - */ -#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] -final class Required -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/SubscribedService.php deleted file mode 100644 index f850b840..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/Attribute/SubscribedService.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Attribute; - -use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait; -use Symfony\Contracts\Service\ServiceSubscriberInterface; - -/** - * For use as the return value for {@see ServiceSubscriberInterface}. - * - * @example new SubscribedService('http_client', HttpClientInterface::class, false, new Target('githubApi')) - * - * Use with {@see ServiceMethodsSubscriberTrait} to mark a method's return type - * as a subscribed service. - * - * @author Kevin Bond - */ -#[\Attribute(\Attribute::TARGET_METHOD)] -final class SubscribedService -{ - /** @var object[] */ - public array $attributes; - - /** - * @param string|null $key The key to use for the service - * @param class-string|null $type The service class - * @param bool $nullable Whether the service is optional - * @param object|object[] $attributes One or more dependency injection attributes to use - */ - public function __construct( - public ?string $key = null, - public ?string $type = null, - public bool $nullable = false, - array|object $attributes = [], - ) { - $this->attributes = \is_array($attributes) ? $attributes : [$attributes]; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/service-contracts/CHANGELOG.md deleted file mode 100644 index 7932e261..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/LICENSE b/tools/php-cs-fixer/vendor/symfony/service-contracts/LICENSE deleted file mode 100644 index 7536caea..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/README.md b/tools/php-cs-fixer/vendor/symfony/service-contracts/README.md deleted file mode 100644 index 42841a57..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Symfony Service Contracts -========================= - -A set of abstractions extracted out of the Symfony components. - -Can be used to build on semantics that the Symfony components proved useful and -that already have battle tested implementations. - -See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ResetInterface.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ResetInterface.php deleted file mode 100644 index a4f389b0..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/ResetInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -/** - * Provides a way to reset an object to its initial state. - * - * When calling the "reset()" method on an object, it should be put back to its - * initial state. This usually means clearing any internal buffers and forwarding - * the call to internal dependencies. All properties of the object should be put - * back to the same state it had when it was first ready to use. - * - * This method could be called, for example, to recycle objects that are used as - * services, so that they can be used to handle several requests in the same - * process loop (note that we advise making your services stateless instead of - * implementing this interface when possible.) - */ -interface ResetInterface -{ - /** - * @return void - */ - public function reset(); -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceCollectionInterface.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceCollectionInterface.php deleted file mode 100644 index 2333139c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceCollectionInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -/** - * A ServiceProviderInterface that is also countable and iterable. - * - * @author Kevin Bond - * - * @template-covariant T of mixed - * - * @extends ServiceProviderInterface - * @extends \IteratorAggregate - */ -interface ServiceCollectionInterface extends ServiceProviderInterface, \Countable, \IteratorAggregate -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceLocatorTrait.php deleted file mode 100644 index b62ec3e5..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceLocatorTrait.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(ContainerExceptionInterface::class); -class_exists(NotFoundExceptionInterface::class); - -/** - * A trait to help implement ServiceProviderInterface. - * - * @author Robin Chalas - * @author Nicolas Grekas - */ -trait ServiceLocatorTrait -{ - private array $factories; - private array $loading = []; - private array $providedTypes; - - /** - * @param array $factories - */ - public function __construct(array $factories) - { - $this->factories = $factories; - } - - public function has(string $id): bool - { - return isset($this->factories[$id]); - } - - public function get(string $id): mixed - { - if (!isset($this->factories[$id])) { - throw $this->createNotFoundException($id); - } - - if (isset($this->loading[$id])) { - $ids = array_values($this->loading); - $ids = \array_slice($this->loading, array_search($id, $ids)); - $ids[] = $id; - - throw $this->createCircularReferenceException($id, $ids); - } - - $this->loading[$id] = $id; - try { - return $this->factories[$id]($this); - } finally { - unset($this->loading[$id]); - } - } - - public function getProvidedServices(): array - { - if (!isset($this->providedTypes)) { - $this->providedTypes = []; - - foreach ($this->factories as $name => $factory) { - if (!\is_callable($factory)) { - $this->providedTypes[$name] = '?'; - } else { - $type = (new \ReflectionFunction($factory))->getReturnType(); - - $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '').($type instanceof \ReflectionNamedType ? $type->getName() : $type) : '?'; - } - } - } - - return $this->providedTypes; - } - - private function createNotFoundException(string $id): NotFoundExceptionInterface - { - if (!$alternatives = array_keys($this->factories)) { - $message = 'is empty...'; - } else { - $last = array_pop($alternatives); - if ($alternatives) { - $message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last); - } else { - $message = sprintf('only knows about the "%s" service.', $last); - } - } - - if ($this->loading) { - $message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message); - } else { - $message = sprintf('Service "%s" not found: the current service locator %s', $id, $message); - } - - return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface { - }; - } - - private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface - { - return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface { - }; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php deleted file mode 100644 index 0d89d9f2..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\Attribute\Required; -use Symfony\Contracts\Service\Attribute\SubscribedService; - -/** - * Implementation of ServiceSubscriberInterface that determines subscribed services - * from methods that have the #[SubscribedService] attribute. - * - * Service ids are available as "ClassName::methodName" so that the implementation - * of subscriber methods can be just `return $this->container->get(__METHOD__);`. - * - * @author Kevin Bond - */ -trait ServiceMethodsSubscriberTrait -{ - protected ContainerInterface $container; - - public static function getSubscribedServices(): array - { - $services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : []; - - foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { - if (self::class !== $method->getDeclaringClass()->name) { - continue; - } - - if (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) { - continue; - } - - if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { - throw new \LogicException(sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name)); - } - - if (!$returnType = $method->getReturnType()) { - throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); - } - - /* @var SubscribedService $attribute */ - $attribute = $attribute->newInstance(); - $attribute->key ??= self::class.'::'.$method->name; - $attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; - $attribute->nullable = $returnType->allowsNull(); - - if ($attribute->attributes) { - $services[] = $attribute; - } else { - $services[$attribute->key] = ($attribute->nullable ? '?' : '').$attribute->type; - } - } - - return $services; - } - - #[Required] - public function setContainer(ContainerInterface $container): ?ContainerInterface - { - $ret = null; - if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) { - $ret = parent::setContainer($container); - } - - $this->container = $container; - - return $ret; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceProviderInterface.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceProviderInterface.php deleted file mode 100644 index 2e71f00c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceProviderInterface.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; - -/** - * A ServiceProviderInterface exposes the identifiers and the types of services provided by a container. - * - * @author Nicolas Grekas - * @author Mateusz Sip - * - * @template-covariant T of mixed - */ -interface ServiceProviderInterface extends ContainerInterface -{ - /** - * @return T - */ - public function get(string $id): mixed; - - public function has(string $id): bool; - - /** - * Returns an associative array of service types keyed by the identifiers provided by the current container. - * - * Examples: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the object provides a service named "logger" that implements Psr\Log\LoggerInterface - * * ['foo' => '?'] means the container provides service name "foo" of unspecified type - * * ['bar' => '?Bar\Baz'] means the container provides a service "bar" of type Bar\Baz|null - * - * @return array The provided service types, keyed by service names - */ - public function getProvidedServices(): array; -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberInterface.php deleted file mode 100644 index 3da19169..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberInterface.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Symfony\Contracts\Service\Attribute\SubscribedService; - -/** - * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method. - * - * The getSubscribedServices method returns an array of service types required by such instances, - * optionally keyed by the service names used internally. Service types that start with an interrogation - * mark "?" are optional, while the other ones are mandatory service dependencies. - * - * The injected service locators SHOULD NOT allow access to any other services not specified by the method. - * - * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally. - * This interface does not dictate any injection method for these service locators, although constructor - * injection is recommended. - * - * @author Nicolas Grekas - */ -interface ServiceSubscriberInterface -{ - /** - * Returns an array of service types (or {@see SubscribedService} objects) required - * by such instances, optionally keyed by the service names used internally. - * - * For mandatory dependencies: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name - * internally to fetch a service which must implement Psr\Log\LoggerInterface. - * * ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name - * internally to fetch an iterable of Psr\Log\LoggerInterface instances. - * * ['Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface'] - * - * otherwise: - * - * * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency - * * ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency - * * ['?Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface'] - * - * additionally, an array of {@see SubscribedService}'s can be returned: - * - * * [new SubscribedService('logger', Psr\Log\LoggerInterface::class)] - * * [new SubscribedService(type: Psr\Log\LoggerInterface::class, nullable: true)] - * * [new SubscribedService('http_client', HttpClientInterface::class, attributes: new Target('githubApi'))] - * - * @return string[]|SubscribedService[] The required service types, optionally keyed by service names - */ - public static function getSubscribedServices(): array; -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberTrait.php deleted file mode 100644 index cc3bc321..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\Attribute\Required; -use Symfony\Contracts\Service\Attribute\SubscribedService; - -trigger_deprecation('symfony/contracts', 'v3.5', '"%s" is deprecated, use "ServiceMethodsSubscriberTrait" instead.', ServiceSubscriberTrait::class); - -/** - * Implementation of ServiceSubscriberInterface that determines subscribed services - * from methods that have the #[SubscribedService] attribute. - * - * Service ids are available as "ClassName::methodName" so that the implementation - * of subscriber methods can be just `return $this->container->get(__METHOD__);`. - * - * @property ContainerInterface $container - * - * @author Kevin Bond - * - * @deprecated since symfony/contracts v3.5, use ServiceMethodsSubscriberTrait instead - */ -trait ServiceSubscriberTrait -{ - public static function getSubscribedServices(): array - { - $services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : []; - - foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { - if (self::class !== $method->getDeclaringClass()->name) { - continue; - } - - if (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) { - continue; - } - - if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { - throw new \LogicException(sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name)); - } - - if (!$returnType = $method->getReturnType()) { - throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); - } - - /* @var SubscribedService $attribute */ - $attribute = $attribute->newInstance(); - $attribute->key ??= self::class.'::'.$method->name; - $attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; - $attribute->nullable = $returnType->allowsNull(); - - if ($attribute->attributes) { - $services[] = $attribute; - } else { - $services[$attribute->key] = ($attribute->nullable ? '?' : '').$attribute->type; - } - } - - return $services; - } - - #[Required] - public function setContainer(ContainerInterface $container): ?ContainerInterface - { - $ret = null; - if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) { - $ret = parent::setContainer($container); - } - - $this->container = $container; - - return $ret; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php deleted file mode 100644 index 07d12b4a..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Test; - -class_alias(ServiceLocatorTestCase::class, ServiceLocatorTest::class); - -if (false) { - /** - * @deprecated since PHPUnit 9.6 - */ - class ServiceLocatorTest - { - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php b/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php deleted file mode 100644 index 65a3fe33..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Test; - -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\ContainerInterface; -use Psr\Container\NotFoundExceptionInterface; -use Symfony\Contracts\Service\ServiceLocatorTrait; - -abstract class ServiceLocatorTestCase extends TestCase -{ - protected function getServiceLocator(array $factories): ContainerInterface - { - return new class($factories) implements ContainerInterface { - use ServiceLocatorTrait; - }; - } - - public function testHas() - { - $locator = $this->getServiceLocator([ - 'foo' => fn () => 'bar', - 'bar' => fn () => 'baz', - fn () => 'dummy', - ]); - - $this->assertTrue($locator->has('foo')); - $this->assertTrue($locator->has('bar')); - $this->assertFalse($locator->has('dummy')); - } - - public function testGet() - { - $locator = $this->getServiceLocator([ - 'foo' => fn () => 'bar', - 'bar' => fn () => 'baz', - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('baz', $locator->get('bar')); - } - - public function testGetDoesNotMemoize() - { - $i = 0; - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$i) { - ++$i; - - return 'bar'; - }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame(2, $i); - } - - public function testThrowsOnUndefinedInternalService() - { - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - if (!$this->getExpectedException()) { - $this->expectException(NotFoundExceptionInterface::class); - $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); - } - - $locator->get('foo'); - } - - public function testThrowsOnCircularReference() - { - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - 'bar' => function () use (&$locator) { return $locator->get('baz'); }, - 'baz' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $this->expectException(ContainerExceptionInterface::class); - $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); - - $locator->get('foo'); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/service-contracts/composer.json b/tools/php-cs-fixer/vendor/symfony/service-contracts/composer.json deleted file mode 100644 index fc8674a7..00000000 --- a/tools/php-cs-fixer/vendor/symfony/service-contracts/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "symfony/service-contracts", - "type": "library", - "description": "Generic abstractions related to writing services", - "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "autoload": { - "psr-4": { "Symfony\\Contracts\\Service\\": "" }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/stopwatch/CHANGELOG.md deleted file mode 100644 index 4b764039..00000000 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/CHANGELOG.md +++ /dev/null @@ -1,30 +0,0 @@ -CHANGELOG -========= - -7.2 ---- - - * Add method `getLastPeriod()` to `StopwatchEvent` - * Add `getRootSectionEvents()` method and `ROOT` constant to `Stopwatch` - -5.2 ---- - - * Add `name` argument to the `StopWatchEvent` constructor, accessible via a new `StopwatchEvent::getName()` - -5.0.0 ------ - - * Removed support for passing `null` as 1st (`$id`) argument of `Section::get()` method, pass a valid child section identifier instead. - -4.4.0 ------ - - * Deprecated passing `null` as 1st (`$id`) argument of `Section::get()` method, pass a valid child section identifier instead. - -3.4.0 ------ - - * added the `Stopwatch::reset()` method - * allowed to measure sub-millisecond times by introducing an argument to the - constructor of `Stopwatch` diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/LICENSE b/tools/php-cs-fixer/vendor/symfony/stopwatch/LICENSE deleted file mode 100644 index 0138f8f0..00000000 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/README.md b/tools/php-cs-fixer/vendor/symfony/stopwatch/README.md deleted file mode 100644 index 824ddfd6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Stopwatch Component -=================== - -The Stopwatch component provides a way to profile code. - -Getting Started ---------------- - -```bash -composer require symfony/stopwatch -``` - -```php -use Symfony\Component\Stopwatch\Stopwatch; - -$stopwatch = new Stopwatch(); - -// optionally group events into sections (e.g. phases of the execution) -$stopwatch->openSection(); - -// starts event named 'eventName' -$stopwatch->start('eventName'); - -// ... run your code here - -// optionally, start a new "lap" time -$stopwatch->lap('foo'); - -// ... run your code here - -$event = $stopwatch->stop('eventName'); - -$stopwatch->stopSection('phase_1'); -``` - -Resources ---------- - - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/Section.php b/tools/php-cs-fixer/vendor/symfony/stopwatch/Section.php deleted file mode 100644 index 07922292..00000000 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/Section.php +++ /dev/null @@ -1,155 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Stopwatch; - -/** - * Stopwatch section. - * - * @author Fabien Potencier - */ -class Section -{ - /** - * @var StopwatchEvent[] - */ - private array $events = []; - - private ?string $id = null; - - /** - * @var Section[] - */ - private array $children = []; - - /** - * @param float|null $origin Set the origin of the events in this section, use null to set their origin to their start time - * @param bool $morePrecision If true, time is stored as float to keep the original microsecond precision - */ - public function __construct( - private ?float $origin = null, - private bool $morePrecision = false, - ) { - } - - /** - * Returns the child section. - */ - public function get(string $id): ?self - { - foreach ($this->children as $child) { - if ($id === $child->getId()) { - return $child; - } - } - - return null; - } - - /** - * Creates or re-opens a child section. - * - * @param string|null $id Null to create a new section, the identifier to re-open an existing one - */ - public function open(?string $id): self - { - if (null === $id || null === $session = $this->get($id)) { - $session = $this->children[] = new self(microtime(true) * 1000, $this->morePrecision); - } - - return $session; - } - - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets the session identifier. - * - * @return $this - */ - public function setId(string $id): static - { - $this->id = $id; - - return $this; - } - - /** - * Starts an event. - */ - public function startEvent(string $name, ?string $category): StopwatchEvent - { - if (!isset($this->events[$name])) { - $this->events[$name] = new StopwatchEvent($this->origin ?: microtime(true) * 1000, $category, $this->morePrecision, $name); - } - - return $this->events[$name]->start(); - } - - /** - * Checks if the event was started. - */ - public function isEventStarted(string $name): bool - { - return isset($this->events[$name]) && $this->events[$name]->isStarted(); - } - - /** - * Stops an event. - * - * @throws \LogicException When the event has not been started - */ - public function stopEvent(string $name): StopwatchEvent - { - if (!isset($this->events[$name])) { - throw new \LogicException(\sprintf('Event "%s" is not started.', $name)); - } - - return $this->events[$name]->stop(); - } - - /** - * Stops then restarts an event. - * - * @throws \LogicException When the event has not been started - */ - public function lap(string $name): StopwatchEvent - { - return $this->stopEvent($name)->start(); - } - - /** - * Returns a specific event by name. - * - * @throws \LogicException When the event is not known - */ - public function getEvent(string $name): StopwatchEvent - { - if (!isset($this->events[$name])) { - throw new \LogicException(\sprintf('Event "%s" is not known.', $name)); - } - - return $this->events[$name]; - } - - /** - * Returns the events from this section. - * - * @return StopwatchEvent[] - */ - public function getEvents(): array - { - return $this->events; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/Stopwatch.php b/tools/php-cs-fixer/vendor/symfony/stopwatch/Stopwatch.php deleted file mode 100644 index 8961507f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/Stopwatch.php +++ /dev/null @@ -1,163 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Stopwatch; - -use Symfony\Contracts\Service\ResetInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(Section::class); - -/** - * Stopwatch provides a way to profile code. - * - * @author Fabien Potencier - */ -class Stopwatch implements ResetInterface -{ - public const ROOT = '__root__'; - - /** - * @var Section[] - */ - private array $sections; - - /** - * @var Section[] - */ - private array $activeSections; - - /** - * @param bool $morePrecision If true, time is stored as float to keep the original microsecond precision - */ - public function __construct( - private bool $morePrecision = false, - ) { - $this->reset(); - } - - /** - * @return Section[] - */ - public function getSections(): array - { - return $this->sections; - } - - /** - * Creates a new section or re-opens an existing section. - * - * @param string|null $id The id of the session to re-open, null to create a new one - * - * @throws \LogicException When the section to re-open is not reachable - */ - public function openSection(?string $id = null): void - { - $current = end($this->activeSections); - - if (null !== $id && null === $current->get($id)) { - throw new \LogicException(\sprintf('The section "%s" has been started at an other level and cannot be opened.', $id)); - } - - $this->start('__section__.child', 'section'); - $this->activeSections[] = $current->open($id); - $this->start('__section__'); - } - - /** - * Stops the last started section. - * - * The id parameter is used to retrieve the events from this section. - * - * @see getSectionEvents() - * - * @throws \LogicException When there's no started section to be stopped - */ - public function stopSection(string $id): void - { - $this->stop('__section__'); - - if (1 == \count($this->activeSections)) { - throw new \LogicException('There is no started section to stop.'); - } - - $this->sections[$id] = array_pop($this->activeSections)->setId($id); - $this->stop('__section__.child'); - } - - /** - * Starts an event. - */ - public function start(string $name, ?string $category = null): StopwatchEvent - { - return end($this->activeSections)->startEvent($name, $category); - } - - /** - * Checks if the event was started. - */ - public function isStarted(string $name): bool - { - return end($this->activeSections)->isEventStarted($name); - } - - /** - * Stops an event. - */ - public function stop(string $name): StopwatchEvent - { - return end($this->activeSections)->stopEvent($name); - } - - /** - * Stops then restarts an event. - */ - public function lap(string $name): StopwatchEvent - { - return end($this->activeSections)->stopEvent($name)->start(); - } - - /** - * Returns a specific event by name. - */ - public function getEvent(string $name): StopwatchEvent - { - return end($this->activeSections)->getEvent($name); - } - - /** - * Gets all events for a given section. - * - * @return StopwatchEvent[] - */ - public function getSectionEvents(string $id): array - { - return isset($this->sections[$id]) ? $this->sections[$id]->getEvents() : []; - } - - /** - * Gets all events for the root section. - * - * @return StopwatchEvent[] - */ - public function getRootSectionEvents(): array - { - return $this->sections[self::ROOT]->getEvents() ?? []; - } - - /** - * Resets the stopwatch to its original state. - */ - public function reset(): void - { - $this->sections = $this->activeSections = [self::ROOT => new Section(null, $this->morePrecision)]; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchEvent.php b/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchEvent.php deleted file mode 100644 index cabe642c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchEvent.php +++ /dev/null @@ -1,242 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Stopwatch; - -/** - * Represents an Event managed by Stopwatch. - * - * @author Fabien Potencier - */ -class StopwatchEvent -{ - /** - * @var StopwatchPeriod[] - */ - private array $periods = []; - - private float $origin; - private string $category; - - /** - * @var float[] - */ - private array $started = []; - - private string $name; - - /** - * @param float $origin The origin time in milliseconds - * @param string|null $category The event category or null to use the default - * @param bool $morePrecision If true, time is stored as float to keep the original microsecond precision - * @param string|null $name The event name or null to define the name as default - * - * @throws \InvalidArgumentException When the raw time is not valid - */ - public function __construct( - float $origin, - ?string $category = null, - private bool $morePrecision = false, - ?string $name = null, - ) { - $this->origin = $this->formatTime($origin); - $this->category = \is_string($category) ? $category : 'default'; - $this->name = $name ?? 'default'; - } - - /** - * Gets the category. - */ - public function getCategory(): string - { - return $this->category; - } - - /** - * Gets the origin in milliseconds. - */ - public function getOrigin(): float - { - return $this->origin; - } - - /** - * Starts a new event period. - * - * @return $this - */ - public function start(): static - { - $this->started[] = $this->getNow(); - - return $this; - } - - /** - * Stops the last started event period. - * - * @return $this - * - * @throws \LogicException When stop() is called without a matching call to start() - */ - public function stop(): static - { - if (!\count($this->started)) { - throw new \LogicException('stop() called but start() has not been called before.'); - } - - $this->periods[] = new StopwatchPeriod(array_pop($this->started), $this->getNow(), $this->morePrecision); - - return $this; - } - - /** - * Checks if the event was started. - */ - public function isStarted(): bool - { - return (bool) $this->started; - } - - /** - * Stops the current period and then starts a new one. - * - * @return $this - */ - public function lap(): static - { - return $this->stop()->start(); - } - - /** - * Stops all non already stopped periods. - */ - public function ensureStopped(): void - { - while (\count($this->started)) { - $this->stop(); - } - } - - /** - * Gets all event periods. - * - * @return StopwatchPeriod[] - */ - public function getPeriods(): array - { - return $this->periods; - } - - /** - * Gets the last event period. - */ - public function getLastPeriod(): ?StopwatchPeriod - { - if ([] === $this->periods) { - return null; - } - - return $this->periods[array_key_last($this->periods)]; - } - - /** - * Gets the relative time of the start of the first period in milliseconds. - */ - public function getStartTime(): int|float - { - if (isset($this->periods[0])) { - return $this->periods[0]->getStartTime(); - } - - if ($this->started) { - return $this->started[0]; - } - - return 0; - } - - /** - * Gets the relative time of the end of the last period in milliseconds. - */ - public function getEndTime(): int|float - { - $count = \count($this->periods); - - return $count ? $this->periods[$count - 1]->getEndTime() : 0; - } - - /** - * Gets the duration of the events in milliseconds (including all periods). - */ - public function getDuration(): int|float - { - $periods = $this->periods; - $left = \count($this->started); - - for ($i = $left - 1; $i >= 0; --$i) { - $periods[] = new StopwatchPeriod($this->started[$i], $this->getNow(), $this->morePrecision); - } - - $total = 0; - foreach ($periods as $period) { - $total += $period->getDuration(); - } - - return $total; - } - - /** - * Gets the max memory usage of all periods in bytes. - */ - public function getMemory(): int - { - $memory = 0; - foreach ($this->periods as $period) { - if ($period->getMemory() > $memory) { - $memory = $period->getMemory(); - } - } - - return $memory; - } - - /** - * Return the current time relative to origin in milliseconds. - */ - protected function getNow(): float - { - return $this->formatTime(microtime(true) * 1000 - $this->origin); - } - - /** - * Formats a time. - * - * @throws \InvalidArgumentException When the raw time is not valid - */ - private function formatTime(float $time): float - { - return round($time, 1); - } - - /** - * Gets the event name. - */ - public function getName(): string - { - return $this->name; - } - - public function __toString(): string - { - return \sprintf('%s/%s: %.2F MiB - %d ms', $this->getCategory(), $this->getName(), $this->getMemory() / 1024 / 1024, $this->getDuration()); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchPeriod.php b/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchPeriod.php deleted file mode 100644 index d80d7e15..00000000 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/StopwatchPeriod.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Stopwatch; - -/** - * Represents a Period for an Event. - * - * @author Fabien Potencier - */ -class StopwatchPeriod -{ - private int|float $start; - private int|float $end; - private int $memory; - - /** - * @param int|float $start The relative time of the start of the period (in milliseconds) - * @param int|float $end The relative time of the end of the period (in milliseconds) - * @param bool $morePrecision If true, time is stored as float to keep the original microsecond precision - */ - public function __construct(int|float $start, int|float $end, bool $morePrecision = false) - { - $this->start = $morePrecision ? (float) $start : (int) $start; - $this->end = $morePrecision ? (float) $end : (int) $end; - $this->memory = memory_get_usage(true); - } - - /** - * Gets the relative time of the start of the period in milliseconds. - */ - public function getStartTime(): int|float - { - return $this->start; - } - - /** - * Gets the relative time of the end of the period in milliseconds. - */ - public function getEndTime(): int|float - { - return $this->end; - } - - /** - * Gets the time spent in this period in milliseconds. - */ - public function getDuration(): int|float - { - return $this->end - $this->start; - } - - /** - * Gets the memory usage in bytes. - */ - public function getMemory(): int - { - return $this->memory; - } - - public function __toString(): string - { - return \sprintf('%.2F MiB - %d ms', $this->getMemory() / 1024 / 1024, $this->getDuration()); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/stopwatch/composer.json b/tools/php-cs-fixer/vendor/symfony/stopwatch/composer.json deleted file mode 100644 index 35568695..00000000 --- a/tools/php-cs-fixer/vendor/symfony/stopwatch/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "symfony/stopwatch", - "type": "library", - "description": "Provides a way to profile code", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.2", - "symfony/service-contracts": "^2.5|^3" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Stopwatch\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/AbstractString.php b/tools/php-cs-fixer/vendor/symfony/string/AbstractString.php deleted file mode 100644 index 500d7c31..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/AbstractString.php +++ /dev/null @@ -1,718 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a string of abstract characters. - * - * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). - * This class is the abstract type to use as a type-hint when the logic you want to - * implement doesn't care about the exact variant it deals with. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -abstract class AbstractString implements \Stringable, \JsonSerializable -{ - public const PREG_PATTERN_ORDER = \PREG_PATTERN_ORDER; - public const PREG_SET_ORDER = \PREG_SET_ORDER; - public const PREG_OFFSET_CAPTURE = \PREG_OFFSET_CAPTURE; - public const PREG_UNMATCHED_AS_NULL = \PREG_UNMATCHED_AS_NULL; - - public const PREG_SPLIT = 0; - public const PREG_SPLIT_NO_EMPTY = \PREG_SPLIT_NO_EMPTY; - public const PREG_SPLIT_DELIM_CAPTURE = \PREG_SPLIT_DELIM_CAPTURE; - public const PREG_SPLIT_OFFSET_CAPTURE = \PREG_SPLIT_OFFSET_CAPTURE; - - protected string $string = ''; - protected ?bool $ignoreCase = false; - - abstract public function __construct(string $string = ''); - - /** - * Unwraps instances of AbstractString back to strings. - * - * @return string[]|array - */ - public static function unwrap(array $values): array - { - foreach ($values as $k => $v) { - if ($v instanceof self) { - $values[$k] = $v->__toString(); - } elseif (\is_array($v) && $values[$k] !== $v = static::unwrap($v)) { - $values[$k] = $v; - } - } - - return $values; - } - - /** - * Wraps (and normalizes) strings in instances of AbstractString. - * - * @return static[]|array - */ - public static function wrap(array $values): array - { - $i = 0; - $keys = null; - - foreach ($values as $k => $v) { - if (\is_string($k) && '' !== $k && $k !== $j = (string) new static($k)) { - $keys ??= array_keys($values); - $keys[$i] = $j; - } - - if (\is_string($v)) { - $values[$k] = new static($v); - } elseif (\is_array($v) && $values[$k] !== $v = static::wrap($v)) { - $values[$k] = $v; - } - - ++$i; - } - - return null !== $keys ? array_combine($keys, $values) : $values; - } - - /** - * @param string|string[] $needle - */ - public function after(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = \PHP_INT_MAX; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOf($n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - $str->string = $n; - } - } - - if (\PHP_INT_MAX === $i) { - return $str; - } - - if (!$includeNeedle) { - $i += $str->length(); - } - - return $this->slice($i); - } - - /** - * @param string|string[] $needle - */ - public function afterLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = null; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOfLast($n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - $str->string = $n; - } - } - - if (null === $i) { - return $str; - } - - if (!$includeNeedle) { - $i += $str->length(); - } - - return $this->slice($i); - } - - abstract public function append(string ...$suffix): static; - - /** - * @param string|string[] $needle - */ - public function before(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = \PHP_INT_MAX; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOf($n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - $str->string = $n; - } - } - - if (\PHP_INT_MAX === $i) { - return $str; - } - - if ($includeNeedle) { - $i += $str->length(); - } - - return $this->slice(0, $i); - } - - /** - * @param string|string[] $needle - */ - public function beforeLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = null; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOfLast($n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - $str->string = $n; - } - } - - if (null === $i) { - return $str; - } - - if ($includeNeedle) { - $i += $str->length(); - } - - return $this->slice(0, $i); - } - - /** - * @return int[] - */ - public function bytesAt(int $offset): array - { - $str = $this->slice($offset, 1); - - return '' === $str->string ? [] : array_values(unpack('C*', $str->string)); - } - - abstract public function camel(): static; - - /** - * @return static[] - */ - abstract public function chunk(int $length = 1): array; - - public function collapseWhitespace(): static - { - $str = clone $this; - $str->string = trim(preg_replace("/(?:[ \n\r\t\x0C]{2,}+|[\n\r\t\x0C])/", ' ', $str->string), " \n\r\t\x0C"); - - return $str; - } - - /** - * @param string|string[] $needle - */ - public function containsAny(string|iterable $needle): bool - { - return null !== $this->indexOf($needle); - } - - /** - * @param string|string[] $suffix - */ - public function endsWith(string|iterable $suffix): bool - { - if (\is_string($suffix)) { - throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($suffix as $s) { - if ($this->endsWith((string) $s)) { - return true; - } - } - - return false; - } - - public function ensureEnd(string $suffix): static - { - if (!$this->endsWith($suffix)) { - return $this->append($suffix); - } - - $suffix = preg_quote($suffix); - $regex = '{('.$suffix.')(?:'.$suffix.')++$}D'; - - return $this->replaceMatches($regex.($this->ignoreCase ? 'i' : ''), '$1'); - } - - public function ensureStart(string $prefix): static - { - $prefix = new static($prefix); - - if (!$this->startsWith($prefix)) { - return $this->prepend($prefix); - } - - $str = clone $this; - $i = $prefixLen = $prefix->length(); - - while ($this->indexOf($prefix, $i) === $i) { - $str = $str->slice($prefixLen); - $i += $prefixLen; - } - - return $str; - } - - /** - * @param string|string[] $string - */ - public function equalsTo(string|iterable $string): bool - { - if (\is_string($string)) { - throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($string as $s) { - if ($this->equalsTo((string) $s)) { - return true; - } - } - - return false; - } - - abstract public function folded(): static; - - public function ignoreCase(): static - { - $str = clone $this; - $str->ignoreCase = true; - - return $str; - } - - /** - * @param string|string[] $needle - */ - public function indexOf(string|iterable $needle, int $offset = 0): ?int - { - if (\is_string($needle)) { - throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - $i = \PHP_INT_MAX; - - foreach ($needle as $n) { - $j = $this->indexOf((string) $n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - } - } - - return \PHP_INT_MAX === $i ? null : $i; - } - - /** - * @param string|string[] $needle - */ - public function indexOfLast(string|iterable $needle, int $offset = 0): ?int - { - if (\is_string($needle)) { - throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - $i = null; - - foreach ($needle as $n) { - $j = $this->indexOfLast((string) $n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - } - } - - return $i; - } - - public function isEmpty(): bool - { - return '' === $this->string; - } - - abstract public function join(array $strings, ?string $lastGlue = null): static; - - public function jsonSerialize(): string - { - return $this->string; - } - - abstract public function length(): int; - - abstract public function lower(): static; - - /** - * Matches the string using a regular expression. - * - * Pass PREG_PATTERN_ORDER or PREG_SET_ORDER as $flags to get all occurrences matching the regular expression. - * - * @return array All matches in a multi-dimensional array ordered according to flags - */ - abstract public function match(string $regexp, int $flags = 0, int $offset = 0): array; - - abstract public function padBoth(int $length, string $padStr = ' '): static; - - abstract public function padEnd(int $length, string $padStr = ' '): static; - - abstract public function padStart(int $length, string $padStr = ' '): static; - - abstract public function prepend(string ...$prefix): static; - - public function repeat(int $multiplier): static - { - if (0 > $multiplier) { - throw new InvalidArgumentException(\sprintf('Multiplier must be positive, %d given.', $multiplier)); - } - - $str = clone $this; - $str->string = str_repeat($str->string, $multiplier); - - return $str; - } - - abstract public function replace(string $from, string $to): static; - - abstract public function replaceMatches(string $fromRegexp, string|callable $to): static; - - abstract public function reverse(): static; - - abstract public function slice(int $start = 0, ?int $length = null): static; - - abstract public function snake(): static; - - public function kebab(): static - { - return $this->snake()->replace('_', '-'); - } - - abstract public function splice(string $replacement, int $start = 0, ?int $length = null): static; - - /** - * @return static[] - */ - public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array - { - if (null === $flags) { - throw new \TypeError('Split behavior when $flags is null must be implemented by child classes.'); - } - - if ($this->ignoreCase) { - $delimiter .= 'i'; - } - - set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); - - try { - if (false === $chunks = preg_split($delimiter, $this->string, $limit, $flags)) { - throw new RuntimeException('Splitting failed with error: '.preg_last_error_msg()); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - - if (self::PREG_SPLIT_OFFSET_CAPTURE & $flags) { - foreach ($chunks as &$chunk) { - $str->string = $chunk[0]; - $chunk[0] = clone $str; - } - } else { - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - } - - return $chunks; - } - - /** - * @param string|string[] $prefix - */ - public function startsWith(string|iterable $prefix): bool - { - if (\is_string($prefix)) { - throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($prefix as $prefix) { - if ($this->startsWith((string) $prefix)) { - return true; - } - } - - return false; - } - - abstract public function title(bool $allWords = false): static; - - public function toByteString(?string $toEncoding = null): ByteString - { - $b = new ByteString(); - - $toEncoding = \in_array($toEncoding, ['utf8', 'utf-8', 'UTF8'], true) ? 'UTF-8' : $toEncoding; - - if (null === $toEncoding || $toEncoding === $fromEncoding = $this instanceof AbstractUnicodeString || preg_match('//u', $b->string) ? 'UTF-8' : 'Windows-1252') { - $b->string = $this->string; - - return $b; - } - - try { - $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); - } catch (\ValueError $e) { - if (!\function_exists('iconv')) { - throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e); - } - - $b->string = iconv('UTF-8', $toEncoding, $this->string); - } - - return $b; - } - - public function toCodePointString(): CodePointString - { - return new CodePointString($this->string); - } - - public function toString(): string - { - return $this->string; - } - - public function toUnicodeString(): UnicodeString - { - return new UnicodeString($this->string); - } - - abstract public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - abstract public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - /** - * @param string|string[] $prefix - */ - public function trimPrefix($prefix): static - { - if (\is_array($prefix) || $prefix instanceof \Traversable) { // don't use is_iterable(), it's slow - foreach ($prefix as $s) { - $t = $this->trimPrefix($s); - - if ($t->string !== $this->string) { - return $t; - } - } - - return clone $this; - } - - $str = clone $this; - - if ($prefix instanceof self) { - $prefix = $prefix->string; - } else { - $prefix = (string) $prefix; - } - - if ('' !== $prefix && \strlen($this->string) >= \strlen($prefix) && 0 === substr_compare($this->string, $prefix, 0, \strlen($prefix), $this->ignoreCase)) { - $str->string = substr($this->string, \strlen($prefix)); - } - - return $str; - } - - abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - /** - * @param string|string[] $suffix - */ - public function trimSuffix($suffix): static - { - if (\is_array($suffix) || $suffix instanceof \Traversable) { // don't use is_iterable(), it's slow - foreach ($suffix as $s) { - $t = $this->trimSuffix($s); - - if ($t->string !== $this->string) { - return $t; - } - } - - return clone $this; - } - - $str = clone $this; - - if ($suffix instanceof self) { - $suffix = $suffix->string; - } else { - $suffix = (string) $suffix; - } - - if ('' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase)) { - $str->string = substr($this->string, 0, -\strlen($suffix)); - } - - return $str; - } - - public function truncate(int $length, string $ellipsis = '', bool|TruncateMode $cut = TruncateMode::Char): static - { - $stringLength = $this->length(); - - if ($stringLength <= $length) { - return clone $this; - } - - $ellipsisLength = '' !== $ellipsis ? (new static($ellipsis))->length() : 0; - - if ($length < $ellipsisLength) { - $ellipsisLength = 0; - } - - $desiredLength = $length; - if (TruncateMode::WordAfter === $cut || !$cut) { - if (null === $length = $this->indexOf([' ', "\r", "\n", "\t"], ($length ?: 1) - 1)) { - return clone $this; - } - - $length += $ellipsisLength; - } elseif (TruncateMode::WordBefore === $cut && null !== $this->indexOf([' ', "\r", "\n", "\t"], ($length ?: 1) - 1)) { - $length += $ellipsisLength; - } - - $str = $this->slice(0, $length - $ellipsisLength); - - if (TruncateMode::WordBefore === $cut) { - if (0 === $ellipsisLength && $desiredLength === $this->indexOf([' ', "\r", "\n", "\t"], $length)) { - return $str; - } - - $str = $str->beforeLast([' ', "\r", "\n", "\t"]); - } - - return $ellipsisLength ? $str->trimEnd()->append($ellipsis) : $str; - } - - abstract public function upper(): static; - - /** - * Returns the printable length on a terminal. - */ - abstract public function width(bool $ignoreAnsiDecoration = true): int; - - public function wordwrap(int $width = 75, string $break = "\n", bool $cut = false): static - { - $lines = '' !== $break ? $this->split($break) : [clone $this]; - $chars = []; - $mask = ''; - - if (1 === \count($lines) && '' === $lines[0]->string) { - return $lines[0]; - } - - foreach ($lines as $i => $line) { - if ($i) { - $chars[] = $break; - $mask .= '#'; - } - - foreach ($line->chunk() as $char) { - $chars[] = $char->string; - $mask .= ' ' === $char->string ? ' ' : '?'; - } - } - - $string = ''; - $j = 0; - $b = $i = -1; - $mask = wordwrap($mask, $width, '#', $cut); - - while (false !== $b = strpos($mask, '#', $b + 1)) { - for (++$i; $i < $b; ++$i) { - $string .= $chars[$j]; - unset($chars[$j++]); - } - - if ($break === $chars[$j] || ' ' === $chars[$j]) { - unset($chars[$j++]); - } - - $string .= $break; - } - - $str = clone $this; - $str->string = $string.implode('', $chars); - - return $str; - } - - public function __sleep(): array - { - return ['string']; - } - - public function __clone() - { - $this->ignoreCase = false; - } - - public function __toString(): string - { - return $this->string; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/AbstractUnicodeString.php b/tools/php-cs-fixer/vendor/symfony/string/AbstractUnicodeString.php deleted file mode 100644 index 979fcea8..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/AbstractUnicodeString.php +++ /dev/null @@ -1,664 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a string of abstract Unicode characters. - * - * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). - * This class is the abstract type to use as a type-hint when the logic you want to - * implement is Unicode-aware but doesn't care about code points vs grapheme clusters. - * - * @author Nicolas Grekas - * - * @throws ExceptionInterface - */ -abstract class AbstractUnicodeString extends AbstractString -{ - public const NFC = \Normalizer::NFC; - public const NFD = \Normalizer::NFD; - public const NFKC = \Normalizer::NFKC; - public const NFKD = \Normalizer::NFKD; - - // all ASCII letters sorted by typical frequency of occurrence - private const ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - - // the subset of folded case mappings that is not in lower case mappings - private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; - private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; - - // the subset of https://github.com/unicode-org/cldr/blob/master/common/transforms/Latin-ASCII.xml that is not in NFKD - private const TRANSLIT_FROM = ['Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ', 'ħ', 'ı', 'ĸ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'ʼn', 'Ŋ', 'ŋ', 'Œ', 'œ', 'Ŧ', 'ŧ', 'ƀ', 'Ɓ', 'Ƃ', 'ƃ', 'Ƈ', 'ƈ', 'Ɖ', 'Ɗ', 'Ƌ', 'ƌ', 'Ɛ', 'Ƒ', 'ƒ', 'Ɠ', 'ƕ', 'Ɩ', 'Ɨ', 'Ƙ', 'ƙ', 'ƚ', 'Ɲ', 'ƞ', 'Ƣ', 'ƣ', 'Ƥ', 'ƥ', 'ƫ', 'Ƭ', 'ƭ', 'Ʈ', 'Ʋ', 'Ƴ', 'ƴ', 'Ƶ', 'ƶ', 'DŽ', 'Dž', 'dž', 'Ǥ', 'ǥ', 'ȡ', 'Ȥ', 'ȥ', 'ȴ', 'ȵ', 'ȶ', 'ȷ', 'ȸ', 'ȹ', 'Ⱥ', 'Ȼ', 'ȼ', 'Ƚ', 'Ⱦ', 'ȿ', 'ɀ', 'Ƀ', 'Ʉ', 'Ɇ', 'ɇ', 'Ɉ', 'ɉ', 'Ɍ', 'ɍ', 'Ɏ', 'ɏ', 'ɓ', 'ɕ', 'ɖ', 'ɗ', 'ɛ', 'ɟ', 'ɠ', 'ɡ', 'ɢ', 'ɦ', 'ɧ', 'ɨ', 'ɪ', 'ɫ', 'ɬ', 'ɭ', 'ɱ', 'ɲ', 'ɳ', 'ɴ', 'ɶ', 'ɼ', 'ɽ', 'ɾ', 'ʀ', 'ʂ', 'ʈ', 'ʉ', 'ʋ', 'ʏ', 'ʐ', 'ʑ', 'ʙ', 'ʛ', 'ʜ', 'ʝ', 'ʟ', 'ʠ', 'ʣ', 'ʥ', 'ʦ', 'ʪ', 'ʫ', 'ᴀ', 'ᴁ', 'ᴃ', 'ᴄ', 'ᴅ', 'ᴆ', 'ᴇ', 'ᴊ', 'ᴋ', 'ᴌ', 'ᴍ', 'ᴏ', 'ᴘ', 'ᴛ', 'ᴜ', 'ᴠ', 'ᴡ', 'ᴢ', 'ᵫ', 'ᵬ', 'ᵭ', 'ᵮ', 'ᵯ', 'ᵰ', 'ᵱ', 'ᵲ', 'ᵳ', 'ᵴ', 'ᵵ', 'ᵶ', 'ᵺ', 'ᵻ', 'ᵽ', 'ᵾ', 'ᶀ', 'ᶁ', 'ᶂ', 'ᶃ', 'ᶄ', 'ᶅ', 'ᶆ', 'ᶇ', 'ᶈ', 'ᶉ', 'ᶊ', 'ᶌ', 'ᶍ', 'ᶎ', 'ᶏ', 'ᶑ', 'ᶒ', 'ᶓ', 'ᶖ', 'ᶙ', 'ẚ', 'ẜ', 'ẝ', 'ẞ', 'Ỻ', 'ỻ', 'Ỽ', 'ỽ', 'Ỿ', 'ỿ', '©', '®', '₠', '₢', '₣', '₤', '₧', '₺', '₹', 'ℌ', '℞', '㎧', '㎮', '㏆', '㏗', '㏞', '㏟', '¼', '½', '¾', '⅓', '⅔', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅛', '⅜', '⅝', '⅞', '⅟', '〇', '‘', '’', '‚', '‛', '“', '”', '„', '‟', '′', '″', '〝', '〞', '«', '»', '‹', '›', '‐', '‑', '‒', '–', '—', '―', '︱', '︲', '﹘', '‖', '⁄', '⁅', '⁆', '⁎', '、', '。', '〈', '〉', '《', '》', '〔', '〕', '〘', '〙', '〚', '〛', '︑', '︒', '︹', '︺', '︽', '︾', '︿', '﹀', '﹑', '﹝', '﹞', '⦅', '⦆', '。', '、', '×', '÷', '−', '∕', '∖', '∣', '∥', '≪', '≫', '⦅', '⦆']; - private const TRANSLIT_TO = ['AE', 'D', 'O', 'TH', 'ss', 'ae', 'd', 'o', 'th', 'D', 'd', 'H', 'h', 'i', 'q', 'L', 'l', 'L', 'l', '\'n', 'N', 'n', 'OE', 'oe', 'T', 't', 'b', 'B', 'B', 'b', 'C', 'c', 'D', 'D', 'D', 'd', 'E', 'F', 'f', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'N', 'n', 'OI', 'oi', 'P', 'p', 't', 'T', 't', 'T', 'V', 'Y', 'y', 'Z', 'z', 'DZ', 'Dz', 'dz', 'G', 'g', 'd', 'Z', 'z', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', 'z', 'B', 'U', 'E', 'e', 'J', 'j', 'R', 'r', 'Y', 'y', 'b', 'c', 'd', 'd', 'e', 'j', 'g', 'g', 'G', 'h', 'h', 'i', 'I', 'l', 'l', 'l', 'm', 'n', 'n', 'N', 'OE', 'r', 'r', 'r', 'R', 's', 't', 'u', 'v', 'Y', 'z', 'z', 'B', 'G', 'H', 'j', 'L', 'q', 'dz', 'dz', 'ts', 'ls', 'lz', 'A', 'AE', 'B', 'C', 'D', 'D', 'E', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', 'V', 'W', 'Z', 'ue', 'b', 'd', 'f', 'm', 'n', 'p', 'r', 'r', 's', 't', 'z', 'th', 'I', 'p', 'U', 'b', 'd', 'f', 'g', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'v', 'x', 'z', 'a', 'd', 'e', 'e', 'i', 'u', 'a', 's', 's', 'SS', 'LL', 'll', 'V', 'v', 'Y', 'y', '(C)', '(R)', 'CE', 'Cr', 'Fr.', 'L.', 'Pts', 'TL', 'Rs', 'x', 'Rx', 'm/s', 'rad/s', 'C/kg', 'pH', 'V/m', 'A/m', ' 1/4', ' 1/2', ' 3/4', ' 1/3', ' 2/3', ' 1/5', ' 2/5', ' 3/5', ' 4/5', ' 1/6', ' 5/6', ' 1/8', ' 3/8', ' 5/8', ' 7/8', ' 1/', '0', '\'', '\'', ',', '\'', '"', '"', ',,', '"', '\'', '"', '"', '"', '<<', '>>', '<', '>', '-', '-', '-', '-', '-', '-', '-', '-', '-', '||', '/', '[', ']', '*', ',', '.', '<', '>', '<<', '>>', '[', ']', '[', ']', '[', ']', ',', '.', '[', ']', '<<', '>>', '<', '>', ',', '[', ']', '((', '))', '.', ',', '*', '/', '-', '/', '\\', '|', '||', '<<', '>>', '((', '))']; - - private static array $transliterators = []; - private static array $tableZero; - private static array $tableWide; - - public static function fromCodePoints(int ...$codes): static - { - $string = ''; - - foreach ($codes as $code) { - if (0x80 > $code %= 0x200000) { - $string .= \chr($code); - } elseif (0x800 > $code) { - $string .= \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $string .= \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $string .= \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - } - - return new static($string); - } - - /** - * Generic UTF-8 to ASCII transliteration. - * - * Install the intl extension for best results. - * - * @param string[]|\Transliterator[]|\Closure[] $rules See "*-Latin" rules from Transliterator::listIDs() - */ - public function ascii(array $rules = []): self - { - $str = clone $this; - $s = $str->string; - $str->string = ''; - - array_unshift($rules, 'nfd'); - $rules[] = 'latin-ascii'; - - if (\function_exists('transliterator_transliterate')) { - $rules[] = 'any-latin/bgn'; - } - - $rules[] = 'nfkd'; - $rules[] = '[:nonspacing mark:] remove'; - - while (\strlen($s) - 1 > $i = strspn($s, self::ASCII)) { - if (0 < --$i) { - $str->string .= substr($s, 0, $i); - $s = substr($s, $i); - } - - if (!$rule = array_shift($rules)) { - $rules = []; // An empty rule interrupts the next ones - } - - if ($rule instanceof \Transliterator) { - $s = $rule->transliterate($s); - } elseif ($rule instanceof \Closure) { - $s = $rule($s); - } elseif ($rule) { - if ('nfd' === $rule = strtolower($rule)) { - normalizer_is_normalized($s, self::NFD) ?: $s = normalizer_normalize($s, self::NFD); - } elseif ('nfkd' === $rule) { - normalizer_is_normalized($s, self::NFKD) ?: $s = normalizer_normalize($s, self::NFKD); - } elseif ('[:nonspacing mark:] remove' === $rule) { - $s = preg_replace('/\p{Mn}++/u', '', $s); - } elseif ('latin-ascii' === $rule) { - $s = str_replace(self::TRANSLIT_FROM, self::TRANSLIT_TO, $s); - } elseif ('de-ascii' === $rule) { - $s = preg_replace("/([AUO])\u{0308}(?=\p{Ll})/u", '$1e', $s); - $s = str_replace(["a\u{0308}", "o\u{0308}", "u\u{0308}", "A\u{0308}", "O\u{0308}", "U\u{0308}"], ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'], $s); - } elseif (\function_exists('transliterator_transliterate')) { - if (null === $transliterator = self::$transliterators[$rule] ??= \Transliterator::create($rule)) { - if ('any-latin/bgn' === $rule) { - $rule = 'any-latin'; - $transliterator = self::$transliterators[$rule] ??= \Transliterator::create($rule); - } - - if (null === $transliterator) { - throw new InvalidArgumentException(\sprintf('Unknown transliteration rule "%s".', $rule)); - } - - self::$transliterators['any-latin/bgn'] = $transliterator; - } - - $s = $transliterator->transliterate($s); - } - } elseif (!\function_exists('iconv')) { - $s = preg_replace('/[^\x00-\x7F]/u', '?', $s); - } else { - $s = @preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) { - $c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]); - - if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) { - throw new \LogicException(\sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class)); - } - - return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?'); - }, $s); - } - } - - $str->string .= $s; - - return $str; - } - - public function camel(): static - { - $str = clone $this; - $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?!\p{Lu})/u', static function ($m) { - static $i = 0; - - return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, preg_replace('/[^\pL0-9]++/u', ' ', $this->string))); - - return $str; - } - - /** - * @return int[] - */ - public function codePointsAt(int $offset): array - { - $str = $this->slice($offset, 1); - - if ('' === $str->string) { - return []; - } - - $codePoints = []; - - foreach (preg_split('//u', $str->string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { - $codePoints[] = mb_ord($c, 'UTF-8'); - } - - return $codePoints; - } - - public function folded(bool $compat = true): static - { - $str = clone $this; - - if (!$compat || !\defined('Normalizer::NFKC_CF')) { - $str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC); - $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $str->string), 'UTF-8'); - } else { - $str->string = normalizer_normalize($str->string, \Normalizer::NFKC_CF); - } - - return $str; - } - - public function join(array $strings, ?string $lastGlue = null): static - { - $str = clone $this; - - $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; - $str->string = implode($this->string, $strings).$tail; - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function lower(): static - { - $str = clone $this; - $str->string = mb_strtolower(str_replace('İ', 'i̇', $str->string), 'UTF-8'); - - return $str; - } - - /** - * @param string $locale In the format language_region (e.g. tr_TR) - */ - public function localeLower(string $locale): static - { - if (null !== $transliterator = $this->getLocaleTransliterator($locale, 'Lower')) { - $str = clone $this; - $str->string = $transliterator->transliterate($str->string); - - return $str; - } - - return $this->lower(); - } - - public function match(string $regexp, int $flags = 0, int $offset = 0): array - { - $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; - - if ($this->ignoreCase) { - $regexp .= 'i'; - } - - set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); - - try { - if (false === $match($regexp.'u', $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - throw new RuntimeException('Matching failed with error: '.preg_last_error_msg()); - } - } finally { - restore_error_handler(); - } - - return $matches; - } - - public function normalize(int $form = self::NFC): static - { - if (!\in_array($form, [self::NFC, self::NFD, self::NFKC, self::NFKD])) { - throw new InvalidArgumentException('Unsupported normalization form.'); - } - - $str = clone $this; - normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); - - return $str; - } - - public function padBoth(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_BOTH); - } - - public function padEnd(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_RIGHT); - } - - public function padStart(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_LEFT); - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - if ($this->ignoreCase) { - $fromRegexp .= 'i'; - } - - if (\is_array($to) || $to instanceof \Closure) { - $replace = 'preg_replace_callback'; - $to = static function (array $m) use ($to): string { - $to = $to($m); - - if ('' !== $to && (!\is_string($to) || !preg_match('//u', $to))) { - throw new InvalidArgumentException('Replace callback must return a valid UTF-8 string.'); - } - - return $to; - }; - } elseif ('' !== $to && !preg_match('//u', $to)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } else { - $replace = 'preg_replace'; - } - - set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); - - try { - if (null === $string = $replace($fromRegexp.'u', $to, $this->string)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && str_ends_with($k, '_ERROR')) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - $str->string = $string; - - return $str; - } - - public function reverse(): static - { - $str = clone $this; - $str->string = implode('', array_reverse(preg_split('/(\X)/u', $str->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY))); - - return $str; - } - - public function snake(): static - { - $str = $this->camel(); - $str->string = mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1_\2', $str->string), 'UTF-8'); - - return $str; - } - - public function title(bool $allWords = false): static - { - $str = clone $this; - - $limit = $allWords ? -1 : 1; - - $str->string = preg_replace_callback('/\b./u', static fn (array $m): string => mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'), $str->string, $limit); - - return $str; - } - - /** - * @param string $locale In the format language_region (e.g. tr_TR) - */ - public function localeTitle(string $locale): static - { - if (null !== $transliterator = $this->getLocaleTransliterator($locale, 'Title')) { - $str = clone $this; - $str->string = $transliterator->transliterate($str->string); - - return $str; - } - - return $this->title(); - } - - public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{^[$chars]++|[$chars]++$}uD", '', $str->string); - - return $str; - } - - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{[$chars]++$}uD", '', $str->string); - - return $str; - } - - public function trimPrefix($prefix): static - { - if (!$this->ignoreCase) { - return parent::trimPrefix($prefix); - } - - $str = clone $this; - - if ($prefix instanceof \Traversable) { - $prefix = iterator_to_array($prefix, false); - } elseif ($prefix instanceof parent) { - $prefix = $prefix->string; - } - - $prefix = implode('|', array_map('preg_quote', (array) $prefix)); - $str->string = preg_replace("{^(?:$prefix)}iuD", '', $this->string); - - return $str; - } - - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{^[$chars]++}uD", '', $str->string); - - return $str; - } - - public function trimSuffix($suffix): static - { - if (!$this->ignoreCase) { - return parent::trimSuffix($suffix); - } - - $str = clone $this; - - if ($suffix instanceof \Traversable) { - $suffix = iterator_to_array($suffix, false); - } elseif ($suffix instanceof parent) { - $suffix = $suffix->string; - } - - $suffix = implode('|', array_map('preg_quote', (array) $suffix)); - $str->string = preg_replace("{(?:$suffix)$}iuD", '', $this->string); - - return $str; - } - - public function upper(): static - { - $str = clone $this; - $str->string = mb_strtoupper($str->string, 'UTF-8'); - - return $str; - } - - /** - * @param string $locale In the format language_region (e.g. tr_TR) - */ - public function localeUpper(string $locale): static - { - if (null !== $transliterator = $this->getLocaleTransliterator($locale, 'Upper')) { - $str = clone $this; - $str->string = $transliterator->transliterate($str->string); - - return $str; - } - - return $this->upper(); - } - - public function width(bool $ignoreAnsiDecoration = true): int - { - $width = 0; - $s = str_replace(["\x00", "\x05", "\x07"], '', $this->string); - - if (str_contains($s, "\r")) { - $s = str_replace(["\r\n", "\r"], "\n", $s); - } - - if (!$ignoreAnsiDecoration) { - $s = preg_replace('/[\p{Cc}\x7F]++/u', '', $s); - } - - foreach (explode("\n", $s) as $s) { - if ($ignoreAnsiDecoration) { - $s = preg_replace('/(?:\x1B(?: - \[ [\x30-\x3F]*+ [\x20-\x2F]*+ [\x40-\x7E] - | [P\]X^_] .*? \x1B\\\\ - | [\x41-\x7E] - )|[\p{Cc}\x7F]++)/xu', '', $s); - } - - $lineWidth = $this->wcswidth($s); - - if ($lineWidth > $width) { - $width = $lineWidth; - } - } - - return $width; - } - - private function pad(int $len, self $pad, int $type): static - { - $sLen = $this->length(); - - if ($len <= $sLen) { - return clone $this; - } - - $padLen = $pad->length(); - $freeLen = $len - $sLen; - $len = $freeLen % $padLen; - - switch ($type) { - case \STR_PAD_RIGHT: - return $this->append(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - case \STR_PAD_LEFT: - return $this->prepend(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - case \STR_PAD_BOTH: - $freeLen /= 2; - - $rightLen = ceil($freeLen); - $len = $rightLen % $padLen; - $str = $this->append(str_repeat($pad->string, intdiv($rightLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - $leftLen = floor($freeLen); - $len = $leftLen % $padLen; - - return $str->prepend(str_repeat($pad->string, intdiv($leftLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - default: - throw new InvalidArgumentException('Invalid padding type.'); - } - } - - /** - * Based on https://github.com/jquast/wcwidth, a Python implementation of https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c. - */ - private function wcswidth(string $string): int - { - $width = 0; - - foreach (preg_split('//u', $string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { - $codePoint = mb_ord($c, 'UTF-8'); - - if (0 === $codePoint // NULL - || 0x034F === $codePoint // COMBINING GRAPHEME JOINER - || (0x200B <= $codePoint && 0x200F >= $codePoint) // ZERO WIDTH SPACE to RIGHT-TO-LEFT MARK - || 0x2028 === $codePoint // LINE SEPARATOR - || 0x2029 === $codePoint // PARAGRAPH SEPARATOR - || (0x202A <= $codePoint && 0x202E >= $codePoint) // LEFT-TO-RIGHT EMBEDDING to RIGHT-TO-LEFT OVERRIDE - || (0x2060 <= $codePoint && 0x2063 >= $codePoint) // WORD JOINER to INVISIBLE SEPARATOR - ) { - continue; - } - - // Non printable characters - if (32 > $codePoint // C0 control characters - || (0x07F <= $codePoint && 0x0A0 > $codePoint) // C1 control characters and DEL - ) { - return -1; - } - - self::$tableZero ??= require __DIR__.'/Resources/data/wcswidth_table_zero.php'; - - if ($codePoint >= self::$tableZero[0][0] && $codePoint <= self::$tableZero[$ubound = \count(self::$tableZero) - 1][1]) { - $lbound = 0; - while ($ubound >= $lbound) { - $mid = floor(($lbound + $ubound) / 2); - - if ($codePoint > self::$tableZero[$mid][1]) { - $lbound = $mid + 1; - } elseif ($codePoint < self::$tableZero[$mid][0]) { - $ubound = $mid - 1; - } else { - continue 2; - } - } - } - - self::$tableWide ??= require __DIR__.'/Resources/data/wcswidth_table_wide.php'; - - if ($codePoint >= self::$tableWide[0][0] && $codePoint <= self::$tableWide[$ubound = \count(self::$tableWide) - 1][1]) { - $lbound = 0; - while ($ubound >= $lbound) { - $mid = floor(($lbound + $ubound) / 2); - - if ($codePoint > self::$tableWide[$mid][1]) { - $lbound = $mid + 1; - } elseif ($codePoint < self::$tableWide[$mid][0]) { - $ubound = $mid - 1; - } else { - $width += 2; - - continue 2; - } - } - } - - ++$width; - } - - return $width; - } - - private function getLocaleTransliterator(string $locale, string $id): ?\Transliterator - { - $rule = $locale.'-'.$id; - if (\array_key_exists($rule, self::$transliterators)) { - return self::$transliterators[$rule]; - } - - if (null !== $transliterator = self::$transliterators[$rule] = \Transliterator::create($rule)) { - return $transliterator; - } - - // Try to find a parent locale (nl_BE -> nl) - if (false === $i = strpos($locale, '_')) { - return null; - } - - $parentRule = substr_replace($locale, '-'.$id, $i); - - // Parent locale was already cached, return and store as current locale - if (\array_key_exists($parentRule, self::$transliterators)) { - return self::$transliterators[$rule] = self::$transliterators[$parentRule]; - } - - // Create transliterator based on parent locale and cache the result on both initial and parent locale values - $transliterator = \Transliterator::create($parentRule); - - return self::$transliterators[$rule] = self::$transliterators[$parentRule] = $transliterator; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/ByteString.php b/tools/php-cs-fixer/vendor/symfony/string/ByteString.php deleted file mode 100644 index 5cbfd6de..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/ByteString.php +++ /dev/null @@ -1,490 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Random\Randomizer; -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a binary-safe string of bytes. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class ByteString extends AbstractString -{ - private const ALPHABET_ALPHANUMERIC = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; - - public function __construct(string $string = '') - { - $this->string = $string; - } - - /* - * The following method was derived from code of the Hack Standard Library (v4.40 - 2020-05-03) - * - * https://github.com/hhvm/hsl/blob/80a42c02f036f72a42f0415e80d6b847f4bf62d5/src/random/private.php#L16 - * - * Code subject to the MIT license (https://github.com/hhvm/hsl/blob/master/LICENSE). - * - * Copyright (c) 2004-2020, Facebook, Inc. (https://www.facebook.com/) - */ - - public static function fromRandom(int $length = 16, ?string $alphabet = null): self - { - if ($length <= 0) { - throw new InvalidArgumentException(\sprintf('A strictly positive length is expected, "%d" given.', $length)); - } - - $alphabet ??= self::ALPHABET_ALPHANUMERIC; - $alphabetSize = \strlen($alphabet); - $bits = (int) ceil(log($alphabetSize, 2.0)); - if ($bits <= 0 || $bits > 56) { - throw new InvalidArgumentException('The length of the alphabet must in the [2^1, 2^56] range.'); - } - - if (\PHP_VERSION_ID >= 80300) { - return new static((new Randomizer())->getBytesFromString($alphabet, $length)); - } - - $ret = ''; - while ($length > 0) { - $urandomLength = (int) ceil(2 * $length * $bits / 8.0); - $data = random_bytes($urandomLength); - $unpackedData = 0; - $unpackedBits = 0; - for ($i = 0; $i < $urandomLength && $length > 0; ++$i) { - // Unpack 8 bits - $unpackedData = ($unpackedData << 8) | \ord($data[$i]); - $unpackedBits += 8; - - // While we have enough bits to select a character from the alphabet, keep - // consuming the random data - for (; $unpackedBits >= $bits && $length > 0; $unpackedBits -= $bits) { - $index = ($unpackedData & ((1 << $bits) - 1)); - $unpackedData >>= $bits; - // Unfortunately, the alphabet size is not necessarily a power of two. - // Worst case, it is 2^k + 1, which means we need (k+1) bits and we - // have around a 50% chance of missing as k gets larger - if ($index < $alphabetSize) { - $ret .= $alphabet[$index]; - --$length; - } - } - } - } - - return new static($ret); - } - - public function bytesAt(int $offset): array - { - $str = $this->string[$offset] ?? ''; - - return '' === $str ? [] : [\ord($str)]; - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); - - return $str; - } - - public function camel(): static - { - $str = clone $this; - - $parts = explode(' ', trim(ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $this->string)))); - $parts[0] = 1 !== \strlen($parts[0]) && ctype_upper($parts[0]) ? $parts[0] : lcfirst($parts[0]); - $str->string = implode('', $parts); - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $str = clone $this; - $chunks = []; - - foreach (str_split($this->string, $length) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - return '' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - if ('' !== $string && $this->ignoreCase) { - return 0 === strcasecmp($string, $this->string); - } - - return $string === $this->string; - } - - public function folded(): static - { - $str = clone $this; - $str->string = strtolower($str->string); - - return $str; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? stripos($this->string, $needle, $offset) : strpos($this->string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? strripos($this->string, $needle, $offset) : strrpos($this->string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function isUtf8(): bool - { - return '' === $this->string || preg_match('//u', $this->string); - } - - public function join(array $strings, ?string $lastGlue = null): static - { - $str = clone $this; - - $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; - $str->string = implode($this->string, $strings).$tail; - - return $str; - } - - public function length(): int - { - return \strlen($this->string); - } - - public function lower(): static - { - $str = clone $this; - $str->string = strtolower($str->string); - - return $str; - } - - public function match(string $regexp, int $flags = 0, int $offset = 0): array - { - $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; - - if ($this->ignoreCase) { - $regexp .= 'i'; - } - - set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); - - try { - if (false === $match($regexp, $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - throw new RuntimeException('Matching failed with error: '.preg_last_error_msg()); - } - } finally { - restore_error_handler(); - } - - return $matches; - } - - public function padBoth(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_BOTH); - - return $str; - } - - public function padEnd(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_RIGHT); - - return $str; - } - - public function padStart(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_LEFT); - - return $str; - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$str->string; - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - - if ('' !== $from) { - $str->string = $this->ignoreCase ? str_ireplace($from, $to, $this->string) : str_replace($from, $to, $this->string); - } - - return $str; - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - if ($this->ignoreCase) { - $fromRegexp .= 'i'; - } - - $replace = \is_array($to) || $to instanceof \Closure ? 'preg_replace_callback' : 'preg_replace'; - - set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); - - try { - if (null === $string = $replace($fromRegexp, $to, $this->string)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && str_ends_with($k, '_ERROR')) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - $str->string = $string; - - return $str; - } - - public function reverse(): static - { - $str = clone $this; - $str->string = strrev($str->string); - - return $str; - } - - public function slice(int $start = 0, ?int $length = null): static - { - $str = clone $this; - $str->string = substr($this->string, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function snake(): static - { - $str = $this->camel(); - $str->string = strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1_\2', $str->string)); - - return $str; - } - - public function splice(string $replacement, int $start = 0, ?int $length = null): static - { - $str = clone $this; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array - { - if (1 > $limit ??= \PHP_INT_MAX) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter, $limit, $flags); - } - - $str = clone $this; - $chunks = $this->ignoreCase - ? preg_split('{'.preg_quote($delimiter).'}iD', $this->string, $limit) - : explode($delimiter, $this->string, $limit); - - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - return '' !== $prefix && 0 === ($this->ignoreCase ? strncasecmp($this->string, $prefix, \strlen($prefix)) : strncmp($this->string, $prefix, \strlen($prefix))); - } - - public function title(bool $allWords = false): static - { - $str = clone $this; - $str->string = $allWords ? ucwords($str->string) : ucfirst($str->string); - - return $str; - } - - public function toUnicodeString(?string $fromEncoding = null): UnicodeString - { - return new UnicodeString($this->toCodePointString($fromEncoding)->string); - } - - public function toCodePointString(?string $fromEncoding = null): CodePointString - { - $u = new CodePointString(); - - if (\in_array($fromEncoding, [null, 'utf8', 'utf-8', 'UTF8', 'UTF-8'], true) && preg_match('//u', $this->string)) { - $u->string = $this->string; - - return $u; - } - - set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); - - try { - try { - $validEncoding = false !== mb_detect_encoding($this->string, $fromEncoding ?? 'Windows-1252', true); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $u->string = iconv($fromEncoding ?? 'Windows-1252', 'UTF-8', $this->string); - - return $u; - } - } finally { - restore_error_handler(); - } - - if (!$validEncoding) { - throw new InvalidArgumentException(\sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252')); - } - - $u->string = mb_convert_encoding($this->string, 'UTF-8', $fromEncoding ?? 'Windows-1252'); - - return $u; - } - - public function trim(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = trim($str->string, $chars); - - return $str; - } - - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = rtrim($str->string, $chars); - - return $str; - } - - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = ltrim($str->string, $chars); - - return $str; - } - - public function upper(): static - { - $str = clone $this; - $str->string = strtoupper($str->string); - - return $str; - } - - public function width(bool $ignoreAnsiDecoration = true): int - { - $string = preg_match('//u', $this->string) ? $this->string : preg_replace('/[\x80-\xFF]/', '?', $this->string); - - return (new CodePointString($string))->width($ignoreAnsiDecoration); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/CHANGELOG.md b/tools/php-cs-fixer/vendor/symfony/string/CHANGELOG.md deleted file mode 100644 index ff505b14..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/CHANGELOG.md +++ /dev/null @@ -1,51 +0,0 @@ -CHANGELOG -========= - -7.2 ---- - - * Add `TruncateMode` enum to handle more truncate methods - * Add the `AbstractString::kebab()` method - -7.1 ---- - - * Add `localeLower()`, `localeUpper()`, `localeTitle()` methods to `AbstractUnicodeString` - -6.2 ---- - - * Add support for emoji in `AsciiSlugger` - -5.4 ---- - - * Add `trimSuffix()` and `trimPrefix()` methods - -5.3 ---- - - * Made `AsciiSlugger` fallback to parent locale's symbolsMap - -5.2.0 ------ - - * added a `FrenchInflector` class - -5.1.0 ------ - - * added the `AbstractString::reverse()` method - * made `AbstractString::width()` follow POSIX.1-2001 - * added `LazyString` which provides memoizing stringable objects - * The component is not marked as `@experimental` anymore - * added the `s()` helper method to get either an `UnicodeString` or `ByteString` instance, - depending of the input string UTF-8 compliancy - * added `$cut` parameter to `Symfony\Component\String\AbstractString::truncate()` - * added `AbstractString::containsAny()` - * allow passing a string of custom characters to `ByteString::fromRandom()` - -5.0.0 ------ - - * added the component as experimental diff --git a/tools/php-cs-fixer/vendor/symfony/string/CodePointString.php b/tools/php-cs-fixer/vendor/symfony/string/CodePointString.php deleted file mode 100644 index 337bfc12..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/CodePointString.php +++ /dev/null @@ -1,260 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; - -/** - * Represents a string of Unicode code points encoded as UTF-8. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class CodePointString extends AbstractUnicodeString -{ - public function __construct(string $string = '') - { - if ('' !== $string && !preg_match('//u', $string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $this->string = $string; - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $rx = '/('; - while (65535 < $length) { - $rx .= '.{65535}'; - $length -= 65535; - } - $rx .= '.{'.$length.'})/us'; - - $str = clone $this; - $chunks = []; - - foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function codePointsAt(int $offset): array - { - $str = $offset ? $this->slice($offset, 1) : $this; - - return '' === $str->string ? [] : [mb_ord($str->string, 'UTF-8')]; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - if ('' === $suffix || !preg_match('//u', $suffix)) { - return false; - } - - if ($this->ignoreCase) { - return preg_match('{'.preg_quote($suffix).'$}iuD', $this->string); - } - - return \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix)); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - if ('' !== $string && $this->ignoreCase) { - return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); - } - - return $string === $this->string; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? mb_stripos($this->string, $needle, $offset, 'UTF-8') : mb_strpos($this->string, $needle, $offset, 'UTF-8'); - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? mb_strripos($this->string, $needle, $offset, 'UTF-8') : mb_strrpos($this->string, $needle, $offset, 'UTF-8'); - - return false === $i ? null : $i; - } - - public function length(): int - { - return mb_strlen($this->string, 'UTF-8'); - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - - if ('' === $from || !preg_match('//u', $from)) { - return $str; - } - - if ('' !== $to && !preg_match('//u', $to)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - if ($this->ignoreCase) { - $str->string = implode($to, preg_split('{'.preg_quote($from).'}iuD', $this->string)); - } else { - $str->string = str_replace($from, $to, $this->string); - } - - return $str; - } - - public function slice(int $start = 0, ?int $length = null): static - { - $str = clone $this; - $str->string = mb_substr($this->string, $start, $length, 'UTF-8'); - - return $str; - } - - public function splice(string $replacement, int $start = 0, ?int $length = null): static - { - if (!preg_match('//u', $replacement)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $str = clone $this; - $start = $start ? \strlen(mb_substr($this->string, 0, $start, 'UTF-8')) : 0; - $length = $length ? \strlen(mb_substr($this->string, $start, $length, 'UTF-8')) : $length; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array - { - if (1 > $limit ??= \PHP_INT_MAX) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter.'u', $limit, $flags); - } - - if (!preg_match('//u', $delimiter)) { - throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); - } - - $str = clone $this; - $chunks = $this->ignoreCase - ? preg_split('{'.preg_quote($delimiter).'}iuD', $this->string, $limit) - : explode($delimiter, $this->string, $limit); - - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - if ('' === $prefix || !preg_match('//u', $prefix)) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos($this->string, $prefix, 0, 'UTF-8'); - } - - return 0 === strncmp($this->string, $prefix, \strlen($prefix)); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/Exception/ExceptionInterface.php b/tools/php-cs-fixer/vendor/symfony/string/Exception/ExceptionInterface.php deleted file mode 100644 index 36197865..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/Exception/ExceptionInterface.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Exception; - -interface ExceptionInterface extends \Throwable -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/Exception/InvalidArgumentException.php b/tools/php-cs-fixer/vendor/symfony/string/Exception/InvalidArgumentException.php deleted file mode 100644 index 6aa586bc..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Exception; - -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/Exception/RuntimeException.php b/tools/php-cs-fixer/vendor/symfony/string/Exception/RuntimeException.php deleted file mode 100644 index 77cb091f..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/Exception/RuntimeException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Exception; - -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/Inflector/EnglishInflector.php b/tools/php-cs-fixer/vendor/symfony/string/Inflector/EnglishInflector.php deleted file mode 100644 index a5be28d6..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/Inflector/EnglishInflector.php +++ /dev/null @@ -1,586 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -final class EnglishInflector implements InflectorInterface -{ - /** - * Map English plural to singular suffixes. - * - * @see http://english-zone.com/spelling/plurals.html - */ - private const PLURAL_MAP = [ - // First entry: plural suffix, reversed - // Second entry: length of plural suffix - // Third entry: Whether the suffix may succeed a vowel - // Fourth entry: Whether the suffix may succeed a consonant - // Fifth entry: singular suffix, normal - - // bacteria (bacterium) - ['airetcab', 8, true, true, 'bacterium'], - - // corpora (corpus) - ['aroproc', 7, true, true, 'corpus'], - - // criteria (criterion) - ['airetirc', 8, true, true, 'criterion'], - - // curricula (curriculum) - ['alucirruc', 9, true, true, 'curriculum'], - - // quora (quorum) - ['arouq', 5, true, true, 'quorum'], - - // genera (genus) - ['areneg', 6, true, true, 'genus'], - - // media (medium) - ['aidem', 5, true, true, 'medium'], - - // memoranda (memorandum) - ['adnaromem', 9, true, true, 'memorandum'], - - // phenomena (phenomenon) - ['anemonehp', 9, true, true, 'phenomenon'], - - // strata (stratum) - ['atarts', 6, true, true, 'stratum'], - - // nebulae (nebula) - ['ea', 2, true, true, 'a'], - - // services (service) - ['secivres', 8, true, true, 'service'], - - // mice (mouse), lice (louse) - ['eci', 3, false, true, 'ouse'], - - // geese (goose) - ['esee', 4, false, true, 'oose'], - - // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) - ['i', 1, true, true, 'us'], - - // men (man), women (woman) - ['nem', 3, true, true, 'man'], - - // children (child) - ['nerdlihc', 8, true, true, 'child'], - - // oxen (ox) - ['nexo', 4, false, false, 'ox'], - - // indices (index), appendices (appendix), prices (price) - ['seci', 4, false, true, ['ex', 'ix', 'ice']], - - // codes (code) - ['sedoc', 5, false, true, 'code'], - - // selfies (selfie) - ['seifles', 7, true, true, 'selfie'], - - // zombies (zombie) - ['seibmoz', 7, true, true, 'zombie'], - - // movies (movie) - ['seivom', 6, true, true, 'movie'], - - // names (name) - ['seman', 5, true, false, 'name'], - - // conspectuses (conspectus), prospectuses (prospectus) - ['sesutcep', 8, true, true, 'pectus'], - - // feet (foot) - ['teef', 4, true, true, 'foot'], - - // geese (goose) - ['eseeg', 5, true, true, 'goose'], - - // teeth (tooth) - ['hteet', 5, true, true, 'tooth'], - - // news (news) - ['swen', 4, true, true, 'news'], - - // series (series) - ['seires', 6, true, true, 'series'], - - // babies (baby) - ['sei', 3, false, true, 'y'], - - // accesses (access), addresses (address), kisses (kiss) - ['sess', 4, true, false, 'ss'], - - // statuses (status) - ['sesutats', 8, true, true, 'status'], - - // article (articles), ancle (ancles) - ['sel', 3, true, true, 'le'], - - // analyses (analysis), ellipses (ellipsis), fungi (fungus), - // neuroses (neurosis), theses (thesis), emphases (emphasis), - // oases (oasis), crises (crisis), houses (house), bases (base), - // atlases (atlas) - ['ses', 3, true, true, ['s', 'se', 'sis']], - - // objectives (objective), alternative (alternatives) - ['sevit', 5, true, true, 'tive'], - - // drives (drive) - ['sevird', 6, false, true, 'drive'], - - // lives (life), wives (wife) - ['sevi', 4, false, true, 'ife'], - - // moves (move) - ['sevom', 5, true, true, 'move'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf), caves (cave), staves (staff) - ['sev', 3, true, true, ['f', 've', 'ff']], - - // axes (axis), axes (ax), axes (axe) - ['sexa', 4, false, false, ['ax', 'axe', 'axis']], - - // indexes (index), matrixes (matrix) - ['sex', 3, true, false, 'x'], - - // quizzes (quiz) - ['sezz', 4, true, false, 'z'], - - // bureaus (bureau) - ['suae', 4, false, true, 'eau'], - - // fees (fee), trees (tree), employees (employee) - ['see', 3, true, true, 'ee'], - - // edges (edge) - ['segd', 4, true, true, 'dge'], - - // roses (rose), garages (garage), cassettes (cassette), - // waltzes (waltz), heroes (hero), bushes (bush), arches (arch), - // shoes (shoe) - ['se', 2, true, true, ['', 'e']], - - // status (status) - ['sutats', 6, true, true, 'status'], - - // tags (tag) - ['s', 1, true, true, ''], - - // chateaux (chateau) - ['xuae', 4, false, true, 'eau'], - - // people (person) - ['elpoep', 6, true, true, 'person'], - ]; - - /** - * Map English singular to plural suffixes. - * - * @see http://english-zone.com/spelling/plurals.html - */ - private const SINGULAR_MAP = [ - // First entry: singular suffix, reversed - // Second entry: length of singular suffix - // Third entry: Whether the suffix may succeed a vowel - // Fourth entry: Whether the suffix may succeed a consonant - // Fifth entry: plural suffix, normal - - // axes (axis) - ['sixa', 4, false, false, 'axes'], - - // criterion (criteria) - ['airetirc', 8, false, false, 'criterion'], - - // nebulae (nebula) - ['aluben', 6, false, false, 'nebulae'], - - // children (child) - ['dlihc', 5, true, true, 'children'], - - // prices (price) - ['eci', 3, false, true, 'ices'], - - // services (service) - ['ecivres', 7, true, true, 'services'], - - // lives (life), wives (wife) - ['efi', 3, false, true, 'ives'], - - // selfies (selfie) - ['eifles', 6, true, true, 'selfies'], - - // movies (movie) - ['eivom', 5, true, true, 'movies'], - - // lice (louse) - ['esuol', 5, false, true, 'lice'], - - // mice (mouse) - ['esuom', 5, false, true, 'mice'], - - // geese (goose) - ['esoo', 4, false, true, 'eese'], - - // houses (house), bases (base) - ['es', 2, true, true, 'ses'], - - // geese (goose) - ['esoog', 5, true, true, 'geese'], - - // caves (cave) - ['ev', 2, true, true, 'ves'], - - // drives (drive) - ['evird', 5, false, true, 'drives'], - - // objectives (objective), alternative (alternatives) - ['evit', 4, true, true, 'tives'], - - // moves (move) - ['evom', 4, true, true, 'moves'], - - // staves (staff) - ['ffats', 5, true, true, 'staves'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) - ['ff', 2, true, true, 'ffs'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) - ['f', 1, true, true, ['fs', 'ves']], - - // arches (arch) - ['hc', 2, true, true, 'ches'], - - // bushes (bush) - ['hs', 2, true, true, 'shes'], - - // teeth (tooth) - ['htoot', 5, true, true, 'teeth'], - - // albums (album) - ['mubla', 5, true, true, 'albums'], - - // quorums (quorum) - ['murouq', 6, true, true, ['quora', 'quorums']], - - // bacteria (bacterium), curricula (curriculum), media (medium), memoranda (memorandum), phenomena (phenomenon), strata (stratum) - ['mu', 2, true, true, 'a'], - - // men (man), women (woman) - ['nam', 3, true, true, 'men'], - - // people (person) - ['nosrep', 6, true, true, ['persons', 'people']], - - // criteria (criterion) - ['noiretirc', 9, true, true, 'criteria'], - - // phenomena (phenomenon) - ['nonemonehp', 10, true, true, 'phenomena'], - - // echoes (echo) - ['ohce', 4, true, true, 'echoes'], - - // heroes (hero) - ['oreh', 4, true, true, 'heroes'], - - // atlases (atlas) - ['salta', 5, true, true, 'atlases'], - - // aliases (alias) - ['saila', 5, true, true, 'aliases'], - - // irises (iris) - ['siri', 4, true, true, 'irises'], - - // analyses (analysis), ellipses (ellipsis), neuroses (neurosis) - // theses (thesis), emphases (emphasis), oases (oasis), - // crises (crisis) - ['sis', 3, true, true, 'ses'], - - // accesses (access), addresses (address), kisses (kiss) - ['ss', 2, true, false, 'sses'], - - // syllabi (syllabus) - ['suballys', 8, true, true, 'syllabi'], - - // buses (bus) - ['sub', 3, true, true, 'buses'], - - // circuses (circus) - ['suc', 3, true, true, 'cuses'], - - // hippocampi (hippocampus) - ['supmacoppih', 11, false, false, 'hippocampi'], - - // campuses (campus) - ['sup', 3, true, true, 'puses'], - - // status (status) - ['sutats', 6, true, true, ['status', 'statuses']], - - // conspectuses (conspectus), prospectuses (prospectus) - ['sutcep', 6, true, true, 'pectuses'], - - // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) - ['su', 2, true, true, 'i'], - - // news (news) - ['swen', 4, true, true, 'news'], - - // feet (foot) - ['toof', 4, true, true, 'feet'], - - // chateaux (chateau), bureaus (bureau) - ['uae', 3, false, true, ['eaus', 'eaux']], - - // oxen (ox) - ['xo', 2, false, false, 'oxen'], - - // hoaxes (hoax) - ['xaoh', 4, true, false, 'hoaxes'], - - // indices (index) - ['xedni', 5, false, true, ['indicies', 'indexes']], - - // fax (faxes, faxxes) - ['xaf', 3, true, true, ['faxes', 'faxxes']], - - // boxes (box) - ['xo', 2, false, true, 'oxes'], - - // indexes (index), matrixes (matrix), appendices (appendix) - ['x', 1, true, false, ['ces', 'xes']], - - // babies (baby) - ['y', 1, false, true, 'ies'], - - // quizzes (quiz) - ['ziuq', 4, true, false, 'quizzes'], - - // waltzes (waltz) - ['z', 1, true, true, 'zes'], - ]; - - /** - * A list of words which should not be inflected, reversed. - */ - private const UNINFLECTED = [ - '', - - // data - 'atad', - - // deer - 'reed', - - // equipment - 'tnempiuqe', - - // feedback - 'kcabdeef', - - // fish - 'hsif', - - // health - 'htlaeh', - - // history - 'yrotsih', - - // info - 'ofni', - - // information - 'noitamrofni', - - // money - 'yenom', - - // moose - 'esoom', - - // series - 'seires', - - // sheep - 'peehs', - - // species - 'seiceps', - - // traffic - 'ciffart', - - // aircraft - 'tfarcria', - - // hardware - 'erawdrah', - ]; - - public function singularize(string $plural): array - { - $pluralRev = strrev($plural); - $lowerPluralRev = strtolower($pluralRev); - $pluralLength = \strlen($lowerPluralRev); - - // Check if the word is one which is not inflected, return early if so - if (\in_array($lowerPluralRev, self::UNINFLECTED, true)) { - return [$plural]; - } - - // The outer loop iterates over the entries of the plural table - // The inner loop $j iterates over the characters of the plural suffix - // in the plural table to compare them with the characters of the actual - // given plural suffix - foreach (self::PLURAL_MAP as $map) { - $suffix = $map[0]; - $suffixLength = $map[1]; - $j = 0; - - // Compare characters in the plural table and of the suffix of the - // given plural one by one - while ($suffix[$j] === $lowerPluralRev[$j]) { - // Let $j point to the next character - ++$j; - - // Successfully compared the last character - // Add an entry with the singular suffix to the singular array - if ($j === $suffixLength) { - // Is there any character preceding the suffix in the plural string? - if ($j < $pluralLength) { - $nextIsVowel = str_contains('aeiou', $lowerPluralRev[$j]); - - if (!$map[2] && $nextIsVowel) { - // suffix may not succeed a vowel but next char is one - break; - } - - if (!$map[3] && !$nextIsVowel) { - // suffix may not succeed a consonant but next char is one - break; - } - } - - $newBase = substr($plural, 0, $pluralLength - $suffixLength); - $newSuffix = $map[4]; - - // Check whether the first character in the plural suffix - // is uppercased. If yes, uppercase the first character in - // the singular suffix too - $firstUpper = ctype_upper($pluralRev[$j - 1]); - - if (\is_array($newSuffix)) { - $singulars = []; - - foreach ($newSuffix as $newSuffixEntry) { - $singulars[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); - } - - return $singulars; - } - - return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; - } - - // Suffix is longer than word - if ($j === $pluralLength) { - break; - } - } - } - - // Assume that plural and singular is identical - return [$plural]; - } - - public function pluralize(string $singular): array - { - $singularRev = strrev($singular); - $lowerSingularRev = strtolower($singularRev); - $singularLength = \strlen($lowerSingularRev); - - // Check if the word is one which is not inflected, return early if so - if (\in_array($lowerSingularRev, self::UNINFLECTED, true)) { - return [$singular]; - } - - // The outer loop iterates over the entries of the singular table - // The inner loop $j iterates over the characters of the singular suffix - // in the singular table to compare them with the characters of the actual - // given singular suffix - foreach (self::SINGULAR_MAP as $map) { - $suffix = $map[0]; - $suffixLength = $map[1]; - $j = 0; - - // Compare characters in the singular table and of the suffix of the - // given plural one by one - - while ($suffix[$j] === $lowerSingularRev[$j]) { - // Let $j point to the next character - ++$j; - - // Successfully compared the last character - // Add an entry with the plural suffix to the plural array - if ($j === $suffixLength) { - // Is there any character preceding the suffix in the plural string? - if ($j < $singularLength) { - $nextIsVowel = str_contains('aeiou', $lowerSingularRev[$j]); - - if (!$map[2] && $nextIsVowel) { - // suffix may not succeed a vowel but next char is one - break; - } - - if (!$map[3] && !$nextIsVowel) { - // suffix may not succeed a consonant but next char is one - break; - } - } - - $newBase = substr($singular, 0, $singularLength - $suffixLength); - $newSuffix = $map[4]; - - // Check whether the first character in the singular suffix - // is uppercased. If yes, uppercase the first character in - // the singular suffix too - $firstUpper = ctype_upper($singularRev[$j - 1]); - - if (\is_array($newSuffix)) { - $plurals = []; - - foreach ($newSuffix as $newSuffixEntry) { - $plurals[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); - } - - return $plurals; - } - - return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; - } - - // Suffix is longer than word - if ($j === $singularLength) { - break; - } - } - } - - // Assume that plural is singular with a trailing `s` - return [$singular.'s']; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/Inflector/FrenchInflector.php b/tools/php-cs-fixer/vendor/symfony/string/Inflector/FrenchInflector.php deleted file mode 100644 index 955abbf4..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/Inflector/FrenchInflector.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -/** - * French inflector. - * - * This class does only inflect nouns; not adjectives nor composed words like "soixante-dix". - */ -final class FrenchInflector implements InflectorInterface -{ - /** - * A list of all rules for pluralise. - * - * @see https://la-conjugaison.nouvelobs.com/regles/grammaire/le-pluriel-des-noms-121.php - */ - private const PLURALIZE_REGEXP = [ - // First entry: regexp - // Second entry: replacement - - // Words finishing with "s", "x" or "z" are invariables - // Les mots finissant par "s", "x" ou "z" sont invariables - ['/(s|x|z)$/i', '\1'], - - // Words finishing with "eau" are pluralized with a "x" - // Les mots finissant par "eau" prennent tous un "x" au pluriel - ['/(eau)$/i', '\1x'], - - // Words finishing with "au" are pluralized with a "x" excepted "landau" - // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" - ['/^(landau)$/i', '\1s'], - ['/(au)$/i', '\1x'], - - // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" - // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" - ['/^(pneu|bleu|émeu)$/i', '\1s'], - ['/(eu)$/i', '\1x'], - - // Words finishing with "al" are pluralized with a "aux" excepted - // Les mots finissant en "al" se terminent en "aux" sauf - ['/^(bal|carnaval|caracal|chacal|choral|corral|étal|festival|récital|val)$/i', '\1s'], - ['/al$/i', '\1aux'], - - // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux - ['/^(aspir|b|cor|ém|ferm|soupir|trav|vant|vitr)ail$/i', '\1aux'], - - // Bijou, caillou, chou, genou, hibou, joujou et pou qui prennent un x au pluriel - ['/^(bij|caill|ch|gen|hib|jouj|p)ou$/i', '\1oux'], - - // Invariable words - ['/^(cinquante|soixante|mille)$/i', '\1'], - - // French titles - ['/^(mon|ma)(sieur|dame|demoiselle|seigneur)$/', 'mes\2s'], - ['/^(Mon|Ma)(sieur|dame|demoiselle|seigneur)$/', 'Mes\2s'], - ]; - - /** - * A list of all rules for singularize. - */ - private const SINGULARIZE_REGEXP = [ - // First entry: regexp - // Second entry: replacement - - // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux - ['/((aspir|b|cor|ém|ferm|soupir|trav|vant|vitr))aux$/i', '\1ail'], - - // Words finishing with "eau" are pluralized with a "x" - // Les mots finissant par "eau" prennent tous un "x" au pluriel - ['/(eau)x$/i', '\1'], - - // Words finishing with "al" are pluralized with a "aux" expected - // Les mots finissant en "al" se terminent en "aux" sauf - ['/(amir|anim|arsen|boc|can|capit|capor|chev|crist|génér|hopit|hôpit|idé|journ|littor|loc|m|mét|minér|princip|radic|termin)aux$/i', '\1al'], - - // Words finishing with "au" are pluralized with a "x" excepted "landau" - // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" - ['/(au)x$/i', '\1'], - - // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" - // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" - ['/(eu)x$/i', '\1'], - - // Words finishing with "ou" are pluralized with a "s" excepted bijou, caillou, chou, genou, hibou, joujou, pou - // Les mots finissant par "ou" prennent un "s" sauf bijou, caillou, chou, genou, hibou, joujou, pou - ['/(bij|caill|ch|gen|hib|jouj|p)oux$/i', '\1ou'], - - // French titles - ['/^mes(dame|demoiselle)s$/', 'ma\1'], - ['/^Mes(dame|demoiselle)s$/', 'Ma\1'], - ['/^mes(sieur|seigneur)s$/', 'mon\1'], - ['/^Mes(sieur|seigneur)s$/', 'Mon\1'], - - // Default rule - ['/s$/i', ''], - ]; - - /** - * A list of words which should not be inflected. - * This list is only used by singularize. - */ - private const UNINFLECTED = '/^(abcès|accès|abus|albatros|anchois|anglais|autobus|bois|brebis|carquois|cas|chas|colis|concours|corps|cours|cyprès|décès|devis|discours|dos|embarras|engrais|entrelacs|excès|fils|fois|gâchis|gars|glas|héros|intrus|jars|jus|kermès|lacis|legs|lilas|marais|mars|matelas|mépris|mets|mois|mors|obus|os|palais|paradis|parcours|pardessus|pays|plusieurs|poids|pois|pouls|printemps|processus|progrès|puits|pus|rabais|radis|recors|recours|refus|relais|remords|remous|rictus|rhinocéros|repas|rubis|sans|sas|secours|sens|souris|succès|talus|tapis|tas|taudis|temps|tiers|univers|velours|verglas|vernis|virus)$/i'; - - public function singularize(string $plural): array - { - if ($this->isInflectedWord($plural)) { - return [$plural]; - } - - foreach (self::SINGULARIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $plural)) { - return [preg_replace($regexp, $replace, $plural)]; - } - } - - return [$plural]; - } - - public function pluralize(string $singular): array - { - if ($this->isInflectedWord($singular)) { - return [$singular]; - } - - foreach (self::PLURALIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $singular)) { - return [preg_replace($regexp, $replace, $singular)]; - } - } - - return [$singular.'s']; - } - - private function isInflectedWord(string $word): bool - { - return 1 === preg_match(self::UNINFLECTED, $word); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/Inflector/InflectorInterface.php b/tools/php-cs-fixer/vendor/symfony/string/Inflector/InflectorInterface.php deleted file mode 100644 index 67f28340..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/Inflector/InflectorInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -interface InflectorInterface -{ - /** - * Returns the singular forms of a string. - * - * If the method can't determine the form with certainty, several possible singulars are returned. - * - * @return string[] - */ - public function singularize(string $plural): array; - - /** - * Returns the plural forms of a string. - * - * If the method can't determine the form with certainty, several possible plurals are returned. - * - * @return string[] - */ - public function pluralize(string $singular): array; -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/Inflector/SpanishInflector.php b/tools/php-cs-fixer/vendor/symfony/string/Inflector/SpanishInflector.php deleted file mode 100644 index 4b98cb62..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/Inflector/SpanishInflector.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -final class SpanishInflector implements InflectorInterface -{ - /** - * A list of all rules for pluralise. - * - * @see https://www.spanishdict.com/guide/spanish-plural-noun-forms - * @see https://www.rae.es/gram%C3%A1tica/morfolog%C3%ADa/la-formaci%C3%B3n-del-plural-plurales-en-s-y-plurales-en-es-reglas-generales - */ - // First entry: regex - // Second entry: replacement - private const PLURALIZE_REGEXP = [ - // Specials sí, no - ['/(sí|no)$/i', '\1es'], - - // Words ending with vowel must use -s (RAE 3.2a, 3.2c) - ['/(a|e|i|o|u|á|é|í|ó|ú)$/i', '\1s'], - - // Word ending in s or x and the previous letter is accented (RAE 3.2n) - ['/ás$/i', 'ases'], - ['/és$/i', 'eses'], - ['/ís$/i', 'ises'], - ['/ós$/i', 'oses'], - ['/ús$/i', 'uses'], - - // Words ending in -ión must changed to -iones - ['/ión$/i', '\1iones'], - - // Words ending in some consonants must use -es (RAE 3.2k) - ['/(l|r|n|d|j|s|x|ch|y)$/i', '\1es'], - - // Word ending in z, must changed to ces - ['/(z)$/i', 'ces'], - ]; - - /** - * A list of all rules for singularize. - */ - private const SINGULARIZE_REGEXP = [ - // Specials sí, no - ['/(sí|no)es$/i', '\1'], - - // Words ending in -ión must changed to -iones - ['/iones$/i', '\1ión'], - - // Word ending in z, must changed to ces - ['/ces$/i', 'z'], - - // Word ending in s or x and the previous letter is accented (RAE 3.2n) - ['/(\w)ases$/i', '\1ás'], - ['/eses$/i', 'és'], - ['/ises$/i', 'ís'], - ['/(\w{2,})oses$/i', '\1ós'], - ['/(\w)uses$/i', '\1ús'], - - // Words ending in some consonants and -es, must be the consonants - ['/(l|r|n|d|j|s|x|ch|y)e?s$/i', '\1'], - - // Words ended with vowel and s, must be vowel - ['/(a|e|i|o|u|á|é|ó|í|ú)s$/i', '\1'], - ]; - - private const UNINFLECTED_RULES = [ - // Words ending with pies (RAE 3.2n) - '/.*(piés)$/i', - ]; - - private const UNINFLECTED = '/^(lunes|martes|miércoles|jueves|viernes|análisis|torax|yo|pies)$/i'; - - public function singularize(string $plural): array - { - if ($this->isInflectedWord($plural)) { - return [$plural]; - } - - foreach (self::SINGULARIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $plural)) { - return [preg_replace($regexp, $replace, $plural)]; - } - } - - return [$plural]; - } - - public function pluralize(string $singular): array - { - if ($this->isInflectedWord($singular)) { - return [$singular]; - } - - foreach (self::PLURALIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $singular)) { - return [preg_replace($regexp, $replace, $singular)]; - } - } - - return [$singular.'s']; - } - - private function isInflectedWord(string $word): bool - { - foreach (self::UNINFLECTED_RULES as $rule) { - if (1 === preg_match($rule, $word)) { - return true; - } - } - - return 1 === preg_match(self::UNINFLECTED, $word); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/LICENSE b/tools/php-cs-fixer/vendor/symfony/string/LICENSE deleted file mode 100644 index f37c76b5..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2019-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/php-cs-fixer/vendor/symfony/string/LazyString.php b/tools/php-cs-fixer/vendor/symfony/string/LazyString.php deleted file mode 100644 index b86d7337..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/LazyString.php +++ /dev/null @@ -1,145 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -/** - * A string whose value is computed lazily by a callback. - * - * @author Nicolas Grekas - */ -class LazyString implements \Stringable, \JsonSerializable -{ - private \Closure|string $value; - - /** - * @param callable|array $callback A callable or a [Closure, method] lazy-callable - */ - public static function fromCallable(callable|array $callback, mixed ...$arguments): static - { - if (\is_array($callback) && !\is_callable($callback) && !(($callback[0] ?? null) instanceof \Closure || 2 < \count($callback))) { - throw new \TypeError(\sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']')); - } - - $lazyString = new static(); - $lazyString->value = static function () use (&$callback, &$arguments): string { - static $value; - - if (null !== $arguments) { - if (!\is_callable($callback)) { - $callback[0] = $callback[0](); - $callback[1] ??= '__invoke'; - } - $value = $callback(...$arguments); - $callback = !\is_scalar($value) && !$value instanceof \Stringable ? self::getPrettyName($callback) : 'callable'; - $arguments = null; - } - - return $value ?? ''; - }; - - return $lazyString; - } - - public static function fromStringable(string|int|float|bool|\Stringable $value): static - { - if (\is_object($value)) { - return static::fromCallable($value->__toString(...)); - } - - $lazyString = new static(); - $lazyString->value = (string) $value; - - return $lazyString; - } - - /** - * Tells whether the provided value can be cast to string. - */ - final public static function isStringable(mixed $value): bool - { - return \is_string($value) || $value instanceof \Stringable || \is_scalar($value); - } - - /** - * Casts scalars and stringable objects to strings. - * - * @throws \TypeError When the provided value is not stringable - */ - final public static function resolve(\Stringable|string|int|float|bool $value): string - { - return $value; - } - - public function __toString(): string - { - if (\is_string($this->value)) { - return $this->value; - } - - try { - return $this->value = ($this->value)(); - } catch (\Throwable $e) { - if (\TypeError::class === $e::class && __FILE__ === $e->getFile()) { - $type = explode(', ', $e->getMessage()); - $type = substr(array_pop($type), 0, -\strlen(' returned')); - $r = new \ReflectionFunction($this->value); - $callback = $r->getStaticVariables()['callback']; - - $e = new \TypeError(\sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type)); - } - - throw $e; - } - } - - public function __sleep(): array - { - $this->__toString(); - - return ['value']; - } - - public function jsonSerialize(): string - { - return $this->__toString(); - } - - private function __construct() - { - } - - private static function getPrettyName(callable $callback): string - { - if (\is_string($callback)) { - return $callback; - } - - if (\is_array($callback)) { - $class = \is_object($callback[0]) ? get_debug_type($callback[0]) : $callback[0]; - $method = $callback[1]; - } elseif ($callback instanceof \Closure) { - $r = new \ReflectionFunction($callback); - - if ($r->isAnonymous() || !$class = $r->getClosureCalledClass()) { - return $r->name; - } - - $class = $class->name; - $method = $r->name; - } else { - $class = get_debug_type($callback); - $method = '__invoke'; - } - - return $class.'::'.$method; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/README.md b/tools/php-cs-fixer/vendor/symfony/string/README.md deleted file mode 100644 index 9c7e1e19..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/README.md +++ /dev/null @@ -1,14 +0,0 @@ -String Component -================ - -The String component provides an object-oriented API to strings and deals -with bytes, UTF-8 code points and grapheme clusters in a unified way. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/string.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_wide.php b/tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_wide.php deleted file mode 100644 index 6a750942..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/Resources/data/wcswidth_table_wide.php +++ /dev/null @@ -1,1175 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -if (!\function_exists(u::class)) { - function u(?string $string = ''): UnicodeString - { - return new UnicodeString($string ?? ''); - } -} - -if (!\function_exists(b::class)) { - function b(?string $string = ''): ByteString - { - return new ByteString($string ?? ''); - } -} - -if (!\function_exists(s::class)) { - /** - * @return UnicodeString|ByteString - */ - function s(?string $string = ''): AbstractString - { - $string ??= ''; - - return preg_match('//u', $string) ? new UnicodeString($string) : new ByteString($string); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/Slugger/AsciiSlugger.php b/tools/php-cs-fixer/vendor/symfony/string/Slugger/AsciiSlugger.php deleted file mode 100644 index 9d4edf15..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/Slugger/AsciiSlugger.php +++ /dev/null @@ -1,207 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Slugger; - -use Symfony\Component\Emoji\EmojiTransliterator; -use Symfony\Component\String\AbstractUnicodeString; -use Symfony\Component\String\UnicodeString; -use Symfony\Contracts\Translation\LocaleAwareInterface; - -if (!interface_exists(LocaleAwareInterface::class)) { - throw new \LogicException('You cannot use the "Symfony\Component\String\Slugger\AsciiSlugger" as the "symfony/translation-contracts" package is not installed. Try running "composer require symfony/translation-contracts".'); -} - -/** - * @author Titouan Galopin - */ -class AsciiSlugger implements SluggerInterface, LocaleAwareInterface -{ - private const LOCALE_TO_TRANSLITERATOR_ID = [ - 'am' => 'Amharic-Latin', - 'ar' => 'Arabic-Latin', - 'az' => 'Azerbaijani-Latin', - 'be' => 'Belarusian-Latin', - 'bg' => 'Bulgarian-Latin', - 'bn' => 'Bengali-Latin', - 'de' => 'de-ASCII', - 'el' => 'Greek-Latin', - 'fa' => 'Persian-Latin', - 'he' => 'Hebrew-Latin', - 'hy' => 'Armenian-Latin', - 'ka' => 'Georgian-Latin', - 'kk' => 'Kazakh-Latin', - 'ky' => 'Kirghiz-Latin', - 'ko' => 'Korean-Latin', - 'mk' => 'Macedonian-Latin', - 'mn' => 'Mongolian-Latin', - 'or' => 'Oriya-Latin', - 'ps' => 'Pashto-Latin', - 'ru' => 'Russian-Latin', - 'sr' => 'Serbian-Latin', - 'sr_Cyrl' => 'Serbian-Latin', - 'th' => 'Thai-Latin', - 'tk' => 'Turkmen-Latin', - 'uk' => 'Ukrainian-Latin', - 'uz' => 'Uzbek-Latin', - 'zh' => 'Han-Latin', - ]; - - private \Closure|array $symbolsMap = [ - 'en' => ['@' => 'at', '&' => 'and'], - ]; - private bool|string $emoji = false; - - /** - * Cache of transliterators per locale. - * - * @var \Transliterator[] - */ - private array $transliterators = []; - - public function __construct( - private ?string $defaultLocale = null, - array|\Closure|null $symbolsMap = null, - ) { - $this->symbolsMap = $symbolsMap ?? $this->symbolsMap; - } - - public function setLocale(string $locale): void - { - $this->defaultLocale = $locale; - } - - public function getLocale(): string - { - return $this->defaultLocale; - } - - /** - * @param bool|string $emoji true will use the same locale, - * false will disable emoji, - * and a string to use a specific locale - */ - public function withEmoji(bool|string $emoji = true): static - { - if (false !== $emoji && !class_exists(EmojiTransliterator::class)) { - throw new \LogicException(\sprintf('You cannot use the "%s()" method as the "symfony/emoji" package is not installed. Try running "composer require symfony/emoji".', __METHOD__)); - } - - $new = clone $this; - $new->emoji = $emoji; - - return $new; - } - - public function slug(string $string, string $separator = '-', ?string $locale = null): AbstractUnicodeString - { - $locale ??= $this->defaultLocale; - - $transliterator = []; - if ($locale && ('de' === $locale || str_starts_with($locale, 'de_'))) { - // Use the shortcut for German in UnicodeString::ascii() if possible (faster and no requirement on intl) - $transliterator = ['de-ASCII']; - } elseif (\function_exists('transliterator_transliterate') && $locale) { - $transliterator = (array) $this->createTransliterator($locale); - } - - if ($emojiTransliterator = $this->createEmojiTransliterator($locale)) { - $transliterator[] = $emojiTransliterator; - } - - if ($this->symbolsMap instanceof \Closure) { - // If the symbols map is passed as a closure, there is no need to fallback to the parent locale - // as the closure can just provide substitutions for all locales of interest. - $symbolsMap = $this->symbolsMap; - array_unshift($transliterator, static fn ($s) => $symbolsMap($s, $locale)); - } - - $unicodeString = (new UnicodeString($string))->ascii($transliterator); - - if (\is_array($this->symbolsMap)) { - $map = null; - if (isset($this->symbolsMap[$locale])) { - $map = $this->symbolsMap[$locale]; - } else { - $parent = self::getParentLocale($locale); - if ($parent && isset($this->symbolsMap[$parent])) { - $map = $this->symbolsMap[$parent]; - } - } - if ($map) { - foreach ($map as $char => $replace) { - $unicodeString = $unicodeString->replace($char, ' '.$replace.' '); - } - } - } - - return $unicodeString - ->replaceMatches('/[^A-Za-z0-9]++/', $separator) - ->trim($separator) - ; - } - - private function createTransliterator(string $locale): ?\Transliterator - { - if (\array_key_exists($locale, $this->transliterators)) { - return $this->transliterators[$locale]; - } - - // Exact locale supported, cache and return - if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$locale] ?? null) { - return $this->transliterators[$locale] = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); - } - - // Locale not supported and no parent, fallback to any-latin - if (!$parent = self::getParentLocale($locale)) { - return $this->transliterators[$locale] = null; - } - - // Try to use the parent locale (ie. try "de" for "de_AT") and cache both locales - if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$parent] ?? null) { - $transliterator = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); - } - - return $this->transliterators[$locale] = $this->transliterators[$parent] = $transliterator ?? null; - } - - private function createEmojiTransliterator(?string $locale): ?EmojiTransliterator - { - if (\is_string($this->emoji)) { - $locale = $this->emoji; - } elseif (!$this->emoji) { - return null; - } - - while (null !== $locale) { - try { - return EmojiTransliterator::create("emoji-$locale"); - } catch (\IntlException) { - $locale = self::getParentLocale($locale); - } - } - - return null; - } - - private static function getParentLocale(?string $locale): ?string - { - if (!$locale) { - return null; - } - if (false === $str = strrchr($locale, '_')) { - // no parent locale - return null; - } - - return substr($locale, 0, -\strlen($str)); - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/Slugger/SluggerInterface.php b/tools/php-cs-fixer/vendor/symfony/string/Slugger/SluggerInterface.php deleted file mode 100644 index dd0d5810..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/Slugger/SluggerInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Slugger; - -use Symfony\Component\String\AbstractUnicodeString; - -/** - * Creates a URL-friendly slug from a given string. - * - * @author Titouan Galopin - */ -interface SluggerInterface -{ - /** - * Creates a slug for the given string and locale, using appropriate transliteration when needed. - */ - public function slug(string $string, string $separator = '-', ?string $locale = null): AbstractUnicodeString; -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/TruncateMode.php b/tools/php-cs-fixer/vendor/symfony/string/TruncateMode.php deleted file mode 100644 index 12568cd5..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/TruncateMode.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -enum TruncateMode -{ - /** - * Will cut exactly at given length. - * - * Length: 14 - * Source: Lorem ipsum dolor sit amet - * Output: Lorem ipsum do - */ - case Char; - - /** - * Returns the string up to the last complete word containing the specified length. - * - * Length: 14 - * Source: Lorem ipsum dolor sit amet - * Output: Lorem ipsum - */ - case WordBefore; - - /** - * Returns the string up to the complete word after or at the given length. - * - * Length: 14 - * Source: Lorem ipsum dolor sit amet - * Output: Lorem ipsum dolor - */ - case WordAfter; -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/UnicodeString.php b/tools/php-cs-fixer/vendor/symfony/string/UnicodeString.php deleted file mode 100644 index b458de0c..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/UnicodeString.php +++ /dev/null @@ -1,382 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; - -/** - * Represents a string of Unicode grapheme clusters encoded as UTF-8. - * - * A letter followed by combining characters (accents typically) form what Unicode defines - * as a grapheme cluster: a character as humans mean it in written texts. This class knows - * about the concept and won't split a letter apart from its combining accents. It also - * ensures all string comparisons happen on their canonically-composed representation, - * ignoring e.g. the order in which accents are listed when a letter has many of them. - * - * @see https://unicode.org/reports/tr15/ - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class UnicodeString extends AbstractUnicodeString -{ - public function __construct(string $string = '') - { - if ('' === $string || normalizer_is_normalized($this->string = $string)) { - return; - } - - if (false === $string = normalizer_normalize($string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $this->string = $string; - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string = $this->string.(1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix)); - - if (normalizer_is_normalized($str->string)) { - return $str; - } - - if (false === $string = normalizer_normalize($str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $str->string = $string; - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $rx = '/('; - while (65535 < $length) { - $rx .= '\X{65535}'; - $length -= 65535; - } - $rx .= '\X{'.$length.'})/u'; - - $str = clone $this; - $chunks = []; - - foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($suffix, $form) ?: $suffix = normalizer_normalize($suffix, $form); - - if ('' === $suffix || false === $suffix) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)), $suffix, 0, 'UTF-8'); - } - - return $suffix === grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($string, $form) ?: $string = normalizer_normalize($string, $form); - - if ('' !== $string && false !== $string && $this->ignoreCase) { - return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); - } - - return $string === $this->string; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); - - if ('' === $needle || false === $needle) { - return null; - } - - try { - $i = $this->ignoreCase ? grapheme_stripos($this->string, $needle, $offset) : grapheme_strpos($this->string, $needle, $offset); - } catch (\ValueError) { - return null; - } - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); - - if ('' === $needle || false === $needle) { - return null; - } - - $string = $this->string; - - if (0 > $offset) { - // workaround https://bugs.php.net/74264 - if (0 > $offset += grapheme_strlen($needle)) { - $string = grapheme_substr($string, 0, $offset); - } - $offset = 0; - } - - $i = $this->ignoreCase ? grapheme_strripos($string, $needle, $offset) : grapheme_strrpos($string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function join(array $strings, ?string $lastGlue = null): static - { - $str = parent::join($strings, $lastGlue); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - return $str; - } - - public function length(): int - { - return grapheme_strlen($this->string); - } - - public function normalize(int $form = self::NFC): static - { - $str = clone $this; - - if (\in_array($form, [self::NFC, self::NFKC], true)) { - normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); - } elseif (!\in_array($form, [self::NFD, self::NFKD], true)) { - throw new InvalidArgumentException('Unsupported normalization form.'); - } elseif (!normalizer_is_normalized($str->string, $form)) { - $str->string = normalizer_normalize($str->string, $form); - $str->ignoreCase = null; - } - - return $str; - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - - if (normalizer_is_normalized($str->string)) { - return $str; - } - - if (false === $string = normalizer_normalize($str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $str->string = $string; - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - normalizer_is_normalized($from) ?: $from = normalizer_normalize($from); - - if ('' !== $from && false !== $from) { - $tail = $str->string; - $result = ''; - $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; - - while ('' !== $tail && false !== $i = $indexOf($tail, $from)) { - $slice = grapheme_substr($tail, 0, $i); - $result .= $slice.$to; - $tail = substr($tail, \strlen($slice) + \strlen($from)); - } - - $str->string = $result.$tail; - - if (normalizer_is_normalized($str->string)) { - return $str; - } - - if (false === $string = normalizer_normalize($str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $str->string = $string; - } - - return $str; - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - $str = parent::replaceMatches($fromRegexp, $to); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - return $str; - } - - public function slice(int $start = 0, ?int $length = null): static - { - $str = clone $this; - - $str->string = (string) grapheme_substr($this->string, $start, $length ?? 2147483647); - - return $str; - } - - public function splice(string $replacement, int $start = 0, ?int $length = null): static - { - $str = clone $this; - - $start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0; - $length = $length ? \strlen(grapheme_substr($this->string, $start, $length)) : $length; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647); - - if (normalizer_is_normalized($str->string)) { - return $str; - } - - if (false === $string = normalizer_normalize($str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $str->string = $string; - - return $str; - } - - public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array - { - if (1 > $limit ??= 2147483647) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter.'u', $limit, $flags); - } - - normalizer_is_normalized($delimiter) ?: $delimiter = normalizer_normalize($delimiter); - - if (false === $delimiter) { - throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); - } - - $str = clone $this; - $tail = $this->string; - $chunks = []; - $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; - - while (1 < $limit && false !== $i = $indexOf($tail, $delimiter)) { - $str->string = grapheme_substr($tail, 0, $i); - $chunks[] = clone $str; - $tail = substr($tail, \strlen($str->string) + \strlen($delimiter)); - --$limit; - } - - $str->string = $tail; - $chunks[] = clone $str; - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($prefix, $form) ?: $prefix = normalizer_normalize($prefix, $form); - - if ('' === $prefix || false === $prefix) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES), $prefix, 0, 'UTF-8'); - } - - return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES); - } - - public function __wakeup(): void - { - if (!\is_string($this->string)) { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); - } - - public function __clone() - { - if (null === $this->ignoreCase) { - normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); - } - - $this->ignoreCase = false; - } -} diff --git a/tools/php-cs-fixer/vendor/symfony/string/composer.json b/tools/php-cs-fixer/vendor/symfony/string/composer.json deleted file mode 100644 index 10d0ee62..00000000 --- a/tools/php-cs-fixer/vendor/symfony/string/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "symfony/string", - "type": "library", - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "keywords": ["string", "utf8", "utf-8", "grapheme", "i18n", "unicode"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "symfony/error-handler": "^6.4|^7.0", - "symfony/emoji": "^7.1", - "symfony/http-client": "^6.4|^7.0", - "symfony/intl": "^6.4|^7.0", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.5" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\String\\": "" }, - "files": [ "Resources/functions.php" ], - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} From b8d173a35929d6127ebd074b51327aaf71a8bc0b Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 13:34:43 +0100 Subject: [PATCH 15/52] build: update node packages --- README.md | 2 +- package.json | 1 - yarn.lock | 5722 +++++++++++++++++++++++++++----------------------- 3 files changed, 3096 insertions(+), 2629 deletions(-) diff --git a/README.md b/README.md index 864c7028..6f688eb5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![Symfony Version](https://img.shields.io/badge/Symfony-^6.4-success?logo=symfony&style=flat-square) ![PHP Version](https://img.shields.io/badge/Php-^8.3-informational?logo=PHP&style=flat-square&logoColor=white) ![Composer Version](https://img.shields.io/badge/Composer-^2.7-informational?logo=Composer&style=flat-square&logoColor=white) -![Nodejs Version](https://img.shields.io/badge/Nodejs-18_LTS-informational?logo=node.js&style=flat-square&logoColor=white) +![Nodejs Version](https://img.shields.io/badge/Nodejs-23_LTS-informational?logo=node.js&style=flat-square&logoColor=white) ![MariaDB Version](https://img.shields.io/badge/MariaDB-10.11-informational?logo=mariadb&style=flat-square&logoColor=white) [![DataWiz 2 Build](https://github.com/leibniz-psychology/datawiz2/actions/workflows/wf-main.yml/badge.svg?branch=master)](https://github.com/leibniz-psychology/datawiz2/actions/workflows/wf-main.yml) [![Übersetzungsstatus](http://weblate.zpid.de/widgets/datawiz/-/datawiz-2/svg-badge.svg)](http://weblate.zpid.de/engage/datawiz/) diff --git a/package.json b/package.json index 276607b8..a60ae842 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "cypress": "^12.11.0", "cypress-wait-until": "^1.7.2", "dropzone": "^5.9.3", - "fibers": "^5.0.0", "list.js": "^2.3.1", "markdownlint-cli2": "^0.7.1", "postcss": "^8.3.11", diff --git a/yarn.lock b/yarn.lock index 70de30b2..acf5bf9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,933 +18,793 @@ integrity sha512-dDEkAhTkjIWG31TZASfhz4a05l+0k2db0Na6ZXuddvU1NNlbF/I2j5hQk79g8JIDctAfn36XFFfpvfdxHMf0Lw== "@alpinejs/focus@^3.12.0": - version "3.12.0" - resolved "https://registry.yarnpkg.com/@alpinejs/focus/-/focus-3.12.0.tgz#d287e48653a4fe38b12110b7fc2101ecc5008816" - integrity sha512-KfFS6W2Ao71e/zWMg5B51QR8Djocc2grDBhZ4VYNYFh5cUnb3TELQ3luY0kjl9phy2NToi52Gz360G889Pz1Bg== + version "3.14.8" + resolved "https://registry.yarnpkg.com/@alpinejs/focus/-/focus-3.14.8.tgz#589df66847ddc376013e010e30e81595f8ccd044" + integrity sha512-lTeU4lyifIL4h2nGf2BHKSX3d8lT7mPn3phR5Yu497ub+al9W2eKXVc42MVm1piY3l6KiYCdNXZTcHaTEm78Kg== dependencies: - focus-trap "^6.6.1" + focus-trap "^6.9.4" + tabbable "^5.3.3" "@ampproject/remapping@^2.2.0": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" - integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== - dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@babel/code-frame@^7.0.0": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.5.tgz#234d98e1551960604f1246e6475891a570ad5658" - integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ== + version "2.3.0" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" + integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== dependencies: - "@babel/highlight" "^7.22.5" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.24" -"@babel/code-frame@^7.18.6", "@babel/code-frame@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.21.4.tgz#d0fa9e4413aca81f2b23b9442797bda1826edb39" - integrity sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0", "@babel/code-frame@^7.26.2": + version "7.26.2" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" + integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== dependencies: - "@babel/highlight" "^7.18.6" + "@babel/helper-validator-identifier" "^7.25.9" + js-tokens "^4.0.0" + picocolors "^1.0.0" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.21.5": - version "7.21.7" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.7.tgz#61caffb60776e49a57ba61a88f02bedd8714f6bc" - integrity sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA== +"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.26.0", "@babel/compat-data@^7.26.5": + version "7.26.5" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.26.5.tgz#df93ac37f4417854130e21d72c66ff3d4b897fc7" + integrity sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg== "@babel/core@^7.17.0": - version "7.21.8" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.8.tgz#2a8c7f0f53d60100ba4c32470ba0281c92aa9aa4" - integrity sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ== + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" + integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.5" - "@babel/helper-compilation-targets" "^7.21.5" - "@babel/helper-module-transforms" "^7.21.5" - "@babel/helpers" "^7.21.5" - "@babel/parser" "^7.21.8" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.5" - "@babel/types" "^7.21.5" - convert-source-map "^1.7.0" + "@babel/code-frame" "^7.26.0" + "@babel/generator" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.0" + "@babel/parser" "^7.26.0" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.26.0" + convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.2.2" - semver "^6.3.0" - -"@babel/generator@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.5.tgz#c0c0e5449504c7b7de8236d99338c3e2a340745f" - integrity sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w== - dependencies: - "@babel/types" "^7.21.5" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" - -"@babel/helper-annotate-as-pure@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" - integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.21.5.tgz#817f73b6c59726ab39f6ba18c234268a519e5abb" - integrity sha512-uNrjKztPLkUk7bpCNC0jEKDJzzkvel/W+HguzbN8krA+LPfC1CEobJEvAvGka2A/M+ViOqXdcRL0GqPUJSjx9g== - dependencies: - "@babel/types" "^7.21.5" - -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.5.tgz#631e6cc784c7b660417421349aac304c94115366" - integrity sha512-1RkbFGUKex4lvsB9yhIfWltJM5cZKUftB2eNajaDv3dCMEp49iBG0K14uH8NnX9IPux2+mK7JGEOB0jn48/J6w== - dependencies: - "@babel/compat-data" "^7.21.5" - "@babel/helper-validator-option" "^7.21.0" - browserslist "^4.21.3" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/generator@^7.26.0", "@babel/generator@^7.26.5": + version "7.26.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.26.5.tgz#e44d4ab3176bbcaf78a5725da5f1dc28802a9458" + integrity sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw== + dependencies: + "@babel/parser" "^7.26.5" + "@babel/types" "^7.26.5" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^3.0.2" + +"@babel/helper-annotate-as-pure@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" + integrity sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g== + dependencies: + "@babel/types" "^7.25.9" + +"@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.25.9": + version "7.26.5" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz#75d92bb8d8d51301c0d49e52a65c9a7fe94514d8" + integrity sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA== + dependencies: + "@babel/compat-data" "^7.26.5" + "@babel/helper-validator-option" "^7.25.9" + browserslist "^4.24.0" lru-cache "^5.1.1" - semver "^6.3.0" - -"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.21.0": - version "7.21.8" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.21.8.tgz#205b26330258625ef8869672ebca1e0dee5a0f02" - integrity sha512-+THiN8MqiH2AczyuZrnrKL6cAxFRRQDKW9h1YkBvbgKmAm6mwiacig1qT73DHIWMGo40GRnsEfN3LA+E6NtmSw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.21.5" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-member-expression-to-functions" "^7.21.5" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-replace-supers" "^7.21.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" - "@babel/helper-split-export-declaration" "^7.18.6" - semver "^6.3.0" - -"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.20.5": - version "7.21.8" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.21.8.tgz#a7886f61c2e29e21fd4aaeaf1e473deba6b571dc" - integrity sha512-zGuSdedkFtsFHGbexAvNuipg1hbtitDLo2XE8/uf6Y9sOQV1xsYX/2pNbtedp/X0eU1pIt+kGvaqHCowkRbS5g== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - regexpu-core "^5.3.1" - semver "^6.3.0" - -"@babel/helper-define-polyfill-provider@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a" - integrity sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww== + semver "^6.3.1" + +"@babel/helper-create-class-features-plugin@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz#7644147706bb90ff613297d49ed5266bde729f83" + integrity sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-member-expression-to-functions" "^7.25.9" + "@babel/helper-optimise-call-expression" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/traverse" "^7.25.9" + semver "^6.3.1" + +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.25.9": + version "7.26.3" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.26.3.tgz#5169756ecbe1d95f7866b90bb555b022595302a0" + integrity sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong== + dependencies: + "@babel/helper-annotate-as-pure" "^7.25.9" + regexpu-core "^6.2.0" + semver "^6.3.1" + +"@babel/helper-define-polyfill-provider@^0.6.2", "@babel/helper-define-polyfill-provider@^0.6.3": + version "0.6.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz#f4f2792fae2ef382074bc2d713522cf24e6ddb21" + integrity sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg== dependencies: - "@babel/helper-compilation-targets" "^7.17.7" - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-compilation-targets" "^7.22.6" + "@babel/helper-plugin-utils" "^7.22.5" debug "^4.1.1" lodash.debounce "^4.0.8" resolve "^1.14.2" - semver "^6.1.2" -"@babel/helper-environment-visitor@^7.18.9", "@babel/helper-environment-visitor@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz#c769afefd41d171836f7cb63e295bedf689d48ba" - integrity sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ== +"@babel/helper-member-expression-to-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" + integrity sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/helper-module-imports@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" + integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/helper-module-transforms@^7.25.9", "@babel/helper-module-transforms@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" + integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== + dependencies: + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0", "@babel/helper-function-name@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4" - integrity sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg== +"@babel/helper-optimise-call-expression@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz#3324ae50bae7e2ab3c33f60c9a877b6a0146b54e" + integrity sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ== dependencies: - "@babel/template" "^7.20.7" - "@babel/types" "^7.21.0" - -"@babel/helper-hoist-variables@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== + "@babel/types" "^7.25.9" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.26.5": + version "7.26.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz#18580d00c9934117ad719392c4f6585c9333cc35" + integrity sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg== + +"@babel/helper-remap-async-to-generator@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz#e53956ab3d5b9fb88be04b3e2f31b523afd34b92" + integrity sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw== dependencies: - "@babel/types" "^7.18.6" + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-wrap-function" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/helper-member-expression-to-functions@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.5.tgz#3b1a009af932e586af77c1030fba9ee0bde396c0" - integrity sha512-nIcGfgwpH2u4n9GG1HpStW5Ogx7x7ekiFHbjjFRKXbn5zUvqO9ZgotCO4x1aNbKn/x/xOUaXEhyNHCwtFCpxWg== +"@babel/helper-replace-supers@^7.25.9": + version "7.26.5" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.26.5.tgz#6cb04e82ae291dae8e72335dfe438b0725f14c8d" + integrity sha512-bJ6iIVdYX1YooY2X7w1q6VITt+LnUILtNk7zT78ykuwStx8BauCzxvFqFaHjOpW1bVnSUM1PN1f0p5P21wHxvg== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.25.9" + "@babel/helper-optimise-call-expression" "^7.25.9" + "@babel/traverse" "^7.26.5" + +"@babel/helper-skip-transparent-expression-wrappers@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz#0b2e1b62d560d6b1954893fd2b705dc17c91f0c9" + integrity sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA== dependencies: - "@babel/types" "^7.21.5" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" -"@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz#ac88b2f76093637489e718a90cec6cf8a9b029af" - integrity sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg== - dependencies: - "@babel/types" "^7.21.4" +"@babel/helper-string-parser@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" + integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== -"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.20.11", "@babel/helper-module-transforms@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.21.5.tgz#d937c82e9af68d31ab49039136a222b17ac0b420" - integrity sha512-bI2Z9zBGY2q5yMHoBvJ2a9iX3ZOAzJPm7Q8Yz6YeoUjU/Cvhmi2G4QyTNyPBqqXSgTjUxRg3L0xV45HvkNWWBw== - dependencies: - "@babel/helper-environment-visitor" "^7.21.5" - "@babel/helper-module-imports" "^7.21.4" - "@babel/helper-simple-access" "^7.21.5" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.19.1" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.5" - "@babel/types" "^7.21.5" +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== -"@babel/helper-optimise-call-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" - integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.21.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.21.5.tgz#345f2377d05a720a4e5ecfa39cbf4474a4daed56" - integrity sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg== - -"@babel/helper-remap-async-to-generator@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz#997458a0e3357080e54e1d79ec347f8a8cd28519" - integrity sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-wrap-function" "^7.18.9" - "@babel/types" "^7.18.9" - -"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.20.7", "@babel/helper-replace-supers@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.21.5.tgz#a6ad005ba1c7d9bc2973dfde05a1bba7065dde3c" - integrity sha512-/y7vBgsr9Idu4M6MprbOVUfH3vs7tsIfnVWv/Ml2xgwvyH6LTngdfbf5AdsKwkJy4zgy1X/kuNrEKvhhK28Yrg== - dependencies: - "@babel/helper-environment-visitor" "^7.21.5" - "@babel/helper-member-expression-to-functions" "^7.21.5" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.5" - "@babel/types" "^7.21.5" - -"@babel/helper-simple-access@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.21.5.tgz#d697a7971a5c39eac32c7e63c0921c06c8a249ee" - integrity sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg== - dependencies: - "@babel/types" "^7.21.5" - -"@babel/helper-skip-transparent-expression-wrappers@^7.20.0": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz#fbe4c52f60518cab8140d77101f0e63a8a230684" - integrity sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg== - dependencies: - "@babel/types" "^7.20.0" - -"@babel/helper-split-export-declaration@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" - integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-string-parser@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz#2b3eea65443c6bdc31c22d037c65f6d323b6b2bd" - integrity sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w== - -"@babel/helper-validator-identifier@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - -"@babel/helper-validator-identifier@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" - integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== - -"@babel/helper-validator-option@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" - integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== - -"@babel/helper-wrap-function@^7.18.9": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz#75e2d84d499a0ab3b31c33bcfe59d6b8a45f62e3" - integrity sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q== - dependencies: - "@babel/helper-function-name" "^7.19.0" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.5" - "@babel/types" "^7.20.5" - -"@babel/helpers@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.21.5.tgz#5bac66e084d7a4d2d9696bdf0175a93f7fb63c08" - integrity sha512-BSY+JSlHxOmGsPTydUkPf1MdMQ3M81x5xGCOVgWM3G8XH77sJ292Y2oqcp0CbbgxhqBuI46iUz1tT7hqP7EfgA== - dependencies: - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.5" - "@babel/types" "^7.21.5" - -"@babel/highlight@^7.18.6", "@babel/highlight@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" - integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== - dependencies: - "@babel/helper-validator-identifier" "^7.22.5" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/parser@^7.20.7", "@babel/parser@^7.21.5", "@babel/parser@^7.21.8": - version "7.21.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.8.tgz#642af7d0333eab9c0ad70b14ac5e76dbde7bfdf8" - integrity sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA== - -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" - integrity sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.20.7.tgz#d9c85589258539a22a901033853101a6198d4ef1" - integrity sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" - "@babel/plugin-proposal-optional-chaining" "^7.20.7" - -"@babel/plugin-proposal-async-generator-functions@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz#bfb7276d2d573cb67ba379984a2334e262ba5326" - integrity sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-remap-async-to-generator" "^7.18.9" - "@babel/plugin-syntax-async-generators" "^7.8.4" +"@babel/helper-validator-option@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" + integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== -"@babel/plugin-proposal-class-properties@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" - integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== +"@babel/helper-wrap-function@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz#d99dfd595312e6c894bd7d237470025c85eea9d0" + integrity sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g== dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" -"@babel/plugin-proposal-class-static-block@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.21.0.tgz#77bdd66fb7b605f3a61302d224bdfacf5547977d" - integrity sha512-XP5G9MWNUskFuP30IfFSEFB0Z6HzLIUcjYM4bYOPHXl7eiJ9HFv8tWj6TXTN5QODiEhDZAeI4hLok2iHFFV4hw== +"@babel/helpers@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" + integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.21.0" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/template" "^7.25.9" + "@babel/types" "^7.26.0" -"@babel/plugin-proposal-dynamic-import@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz#72bcf8d408799f547d759298c3c27c7e7faa4d94" - integrity sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw== +"@babel/parser@^7.25.9", "@babel/parser@^7.26.0", "@babel/parser@^7.26.5": + version "7.26.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.26.5.tgz#6fec9aebddef25ca57a935c86dbb915ae2da3e1f" + integrity sha512-SRJ4jYmXRqV1/Xc+TIVG84WjHBXKlxO9sHQnA2Pf12QQEAp1LOh6kDzNHXcUnbH1QI0FDoPPVOt+vyUDucxpaw== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - -"@babel/plugin-proposal-export-namespace-from@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz#5f7313ab348cdb19d590145f9247540e94761203" - integrity sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA== + "@babel/types" "^7.26.5" + +"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" + integrity sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - -"@babel/plugin-proposal-json-strings@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz#7e8788c1811c393aff762817e7dbf1ebd0c05f0b" - integrity sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ== + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/plugin-bugfix-safari-class-field-initializer-scope@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz#af9e4fb63ccb8abcb92375b2fcfe36b60c774d30" + integrity sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz#e8dc26fcd616e6c5bf2bd0d5a2c151d4f92a9137" + integrity sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-proposal-logical-assignment-operators@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz#dfbcaa8f7b4d37b51e8bfb46d94a5aea2bb89d83" - integrity sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz#807a667f9158acac6f6164b4beb85ad9ebc9e1d1" + integrity sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/plugin-transform-optional-chaining" "^7.25.9" + +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz#de7093f1e7deaf68eadd7cc6b07f2ab82543269e" + integrity sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1" - integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" +"@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": + version "7.21.0-placeholder-for-preset-env.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" + integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== -"@babel/plugin-proposal-numeric-separator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz#899b14fbafe87f053d2c5ff05b36029c62e13c75" - integrity sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q== +"@babel/plugin-syntax-import-assertions@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz#620412405058efa56e4a564903b79355020f445f" + integrity sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-proposal-object-rest-spread@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" - integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== +"@babel/plugin-syntax-import-attributes@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz#3b1412847699eea739b4f2602c74ce36f6b0b0f7" + integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== dependencies: - "@babel/compat-data" "^7.20.5" - "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.20.7" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-proposal-optional-catch-binding@^7.18.6": +"@babel/plugin-syntax-unicode-sets-regex@^7.18.6": version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb" - integrity sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw== + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" + integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.20.7", "@babel/plugin-proposal-optional-chaining@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz#886f5c8978deb7d30f678b2e24346b287234d3ea" - integrity sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA== +"@babel/plugin-transform-arrow-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz#7821d4410bee5daaadbb4cdd9a6649704e176845" + integrity sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-proposal-private-methods@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea" - integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA== +"@babel/plugin-transform-async-generator-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz#1b18530b077d18a407c494eb3d1d72da505283a2" + integrity sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-remap-async-to-generator" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/plugin-proposal-private-property-in-object@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0.tgz#19496bd9883dd83c23c7d7fc45dcd9ad02dfa1dc" - integrity sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw== +"@babel/plugin-transform-async-to-generator@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz#c80008dacae51482793e5a9c08b39a5be7e12d71" + integrity sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-create-class-features-plugin" "^7.21.0" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-remap-async-to-generator" "^7.25.9" -"@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz#af613d2cd5e643643b65cded64207b15c85cb78e" - integrity sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w== +"@babel/plugin-transform-block-scoped-functions@^7.25.9": + version "7.26.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.26.5.tgz#3dc4405d31ad1cbe45293aa57205a6e3b009d53e" + integrity sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.26.5" -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== +"@babel/plugin-transform-block-scoping@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz#c33665e46b06759c93687ca0f84395b80c0473a1" + integrity sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg== dependencies: - "@babel/helper-plugin-utils" "^7.8.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-class-properties@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" - integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== +"@babel/plugin-transform-class-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz#a8ce84fedb9ad512549984101fa84080a9f5f51f" + integrity sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" - integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== +"@babel/plugin-transform-class-static-block@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz#6c8da219f4eb15cae9834ec4348ff8e9e09664a0" + integrity sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-dynamic-import@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" - integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== +"@babel/plugin-transform-classes@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz#7152457f7880b593a63ade8a861e6e26a4469f52" + integrity sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg== dependencies: - "@babel/helper-plugin-utils" "^7.8.0" + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" + "@babel/traverse" "^7.25.9" + globals "^11.1.0" -"@babel/plugin-syntax-export-namespace-from@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" - integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== +"@babel/plugin-transform-computed-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz#db36492c78460e534b8852b1d5befe3c923ef10b" + integrity sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/template" "^7.25.9" -"@babel/plugin-syntax-import-assertions@^7.20.0": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz#bb50e0d4bea0957235390641209394e87bdb9cc4" - integrity sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ== +"@babel/plugin-transform-destructuring@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz#966ea2595c498224340883602d3cfd7a0c79cea1" + integrity sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-import-meta@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" - integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== +"@babel/plugin-transform-dotall-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz#bad7945dd07734ca52fe3ad4e872b40ed09bb09a" + integrity sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== +"@babel/plugin-transform-duplicate-keys@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz#8850ddf57dce2aebb4394bb434a7598031059e6d" + integrity sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw== dependencies: - "@babel/helper-plugin-utils" "^7.8.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" - integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== +"@babel/plugin-transform-duplicate-named-capturing-groups-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz#6f7259b4de127721a08f1e5165b852fcaa696d31" + integrity sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== +"@babel/plugin-transform-dynamic-import@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz#23e917de63ed23c6600c5dd06d94669dce79f7b8" + integrity sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg== dependencies: - "@babel/helper-plugin-utils" "^7.8.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-numeric-separator@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" - integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== +"@babel/plugin-transform-exponentiation-operator@^7.25.9": + version "7.26.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz#e29f01b6de302c7c2c794277a48f04a9ca7f03bc" + integrity sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== +"@babel/plugin-transform-export-namespace-from@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz#90745fe55053394f554e40584cda81f2c8a402a2" + integrity sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww== dependencies: - "@babel/helper-plugin-utils" "^7.8.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== +"@babel/plugin-transform-for-of@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz#4bdc7d42a213397905d89f02350c5267866d5755" + integrity sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A== dependencies: - "@babel/helper-plugin-utils" "^7.8.0" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== +"@babel/plugin-transform-function-name@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz#939d956e68a606661005bfd550c4fc2ef95f7b97" + integrity sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA== dependencies: - "@babel/helper-plugin-utils" "^7.8.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/plugin-syntax-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" - integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== +"@babel/plugin-transform-json-strings@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz#c86db407cb827cded902a90c707d2781aaa89660" + integrity sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-top-level-await@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== +"@babel/plugin-transform-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz#1a1c6b4d4aa59bc4cad5b6b3a223a0abd685c9de" + integrity sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-arrow-functions@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.21.5.tgz#9bb42a53de447936a57ba256fbf537fc312b6929" - integrity sha512-wb1mhwGOCaXHDTcsRYMKF9e5bbMgqwxtqa2Y1ifH96dXJPwbuLX9qHy3clhrxVqgMz7nyNXs8VkxdH8UBcjKqA== +"@babel/plugin-transform-logical-assignment-operators@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz#b19441a8c39a2fda0902900b306ea05ae1055db7" + integrity sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q== dependencies: - "@babel/helper-plugin-utils" "^7.21.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-async-to-generator@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz#dfee18623c8cb31deb796aa3ca84dda9cea94354" - integrity sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q== +"@babel/plugin-transform-member-expression-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz#63dff19763ea64a31f5e6c20957e6a25e41ed5de" + integrity sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA== dependencies: - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-remap-async-to-generator" "^7.18.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-block-scoped-functions@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz#9187bf4ba302635b9d70d986ad70f038726216a8" - integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ== +"@babel/plugin-transform-modules-amd@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz#49ba478f2295101544abd794486cd3088dddb6c5" + integrity sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-block-scoping@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.21.0.tgz#e737b91037e5186ee16b76e7ae093358a5634f02" - integrity sha512-Mdrbunoh9SxwFZapeHVrwFmri16+oYotcZysSzhNIVDwIAb1UV+kvnxULSYq9J3/q5MDG+4X6w8QVgD1zhBXNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - -"@babel/plugin-transform-classes@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.21.0.tgz#f469d0b07a4c5a7dbb21afad9e27e57b47031665" - integrity sha512-RZhbYTCEUAe6ntPehC4hlslPWosNHDox+vAs4On/mCLRLfoDVHf6hVEd7kuxr1RnHwJmxFfUM3cZiZRmPxJPXQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-replace-supers" "^7.20.7" - "@babel/helper-split-export-declaration" "^7.18.6" - globals "^11.1.0" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-computed-properties@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.21.5.tgz#3a2d8bb771cd2ef1cd736435f6552fe502e11b44" - integrity sha512-TR653Ki3pAwxBxUe8srfF3e4Pe3FTA46uaNHYyQwIoM4oWKSoOZiDNyHJ0oIoDIUPSRQbQG7jzgVBX3FPVne1Q== +"@babel/plugin-transform-modules-commonjs@^7.25.9": + version "7.26.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz#8f011d44b20d02c3de44d8850d971d8497f981fb" + integrity sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ== dependencies: - "@babel/helper-plugin-utils" "^7.21.5" - "@babel/template" "^7.20.7" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-destructuring@^7.21.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.21.3.tgz#73b46d0fd11cd6ef57dea8a381b1215f4959d401" - integrity sha512-bp6hwMFzuiE4HqYEyoGJ/V2LeIWn+hLVKc4pnj++E5XQptwhtcGmSayM029d/j2X1bPKGTlsyPwAubuU22KhMA== +"@babel/plugin-transform-modules-systemjs@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz#8bd1b43836269e3d33307151a114bcf3ba6793f8" + integrity sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz#b286b3e7aae6c7b861e45bed0a2fafd6b1a4fef8" - integrity sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg== +"@babel/plugin-transform-modules-umd@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz#6710079cdd7c694db36529a1e8411e49fcbf14c9" + integrity sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-duplicate-keys@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz#687f15ee3cdad6d85191eb2a372c4528eaa0ae0e" - integrity sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw== +"@babel/plugin-transform-named-capturing-groups-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz#454990ae6cc22fd2a0fa60b3a2c6f63a38064e6a" + integrity sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-exponentiation-operator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz#421c705f4521888c65e91fdd1af951bfefd4dacd" - integrity sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw== +"@babel/plugin-transform-new-target@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz#42e61711294b105c248336dcb04b77054ea8becd" + integrity sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-for-of@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.21.5.tgz#e890032b535f5a2e237a18535f56a9fdaa7b83fc" - integrity sha512-nYWpjKW/7j/I/mZkGVgHJXh4bA1sfdFnJoOXwJuj4m3Q2EraO/8ZyrkCau9P5tbHQk01RMSt6KYLCsW7730SXQ== +"@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": + version "7.26.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.26.6.tgz#fbf6b3c92cb509e7b319ee46e3da89c5bedd31fe" + integrity sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw== dependencies: - "@babel/helper-plugin-utils" "^7.21.5" + "@babel/helper-plugin-utils" "^7.26.5" -"@babel/plugin-transform-function-name@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz#cc354f8234e62968946c61a46d6365440fc764e0" - integrity sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ== +"@babel/plugin-transform-numeric-separator@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz#bfed75866261a8b643468b0ccfd275f2033214a1" + integrity sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q== dependencies: - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-literals@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz#72796fdbef80e56fba3c6a699d54f0de557444bc" - integrity sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg== +"@babel/plugin-transform-object-rest-spread@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz#0203725025074164808bcf1a2cfa90c652c99f18" + integrity sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/plugin-transform-parameters" "^7.25.9" -"@babel/plugin-transform-member-expression-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz#ac9fdc1a118620ac49b7e7a5d2dc177a1bfee88e" - integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA== +"@babel/plugin-transform-object-super@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz#385d5de135162933beb4a3d227a2b7e52bb4cf03" + integrity sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" -"@babel/plugin-transform-modules-amd@^7.20.11": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.11.tgz#3daccca8e4cc309f03c3a0c4b41dc4b26f55214a" - integrity sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g== +"@babel/plugin-transform-optional-catch-binding@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz#10e70d96d52bb1f10c5caaac59ac545ea2ba7ff3" + integrity sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g== dependencies: - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-commonjs@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.21.5.tgz#d69fb947eed51af91de82e4708f676864e5e47bc" - integrity sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ== +"@babel/plugin-transform-optional-chaining@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz#e142eb899d26ef715435f201ab6e139541eee7dd" + integrity sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A== dependencies: - "@babel/helper-module-transforms" "^7.21.5" - "@babel/helper-plugin-utils" "^7.21.5" - "@babel/helper-simple-access" "^7.21.5" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" -"@babel/plugin-transform-modules-systemjs@^7.20.11": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.20.11.tgz#467ec6bba6b6a50634eea61c9c232654d8a4696e" - integrity sha512-vVu5g9BPQKSFEmvt2TA4Da5N+QVS66EX21d8uoOihC+OCpUoGvzVsXeqFdtAEfVa5BILAeFt+U7yVmLbQnAJmw== +"@babel/plugin-transform-parameters@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz#b856842205b3e77e18b7a7a1b94958069c7ba257" + integrity sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g== dependencies: - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-validator-identifier" "^7.19.1" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-umd@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz#81d3832d6034b75b54e62821ba58f28ed0aab4b9" - integrity sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ== +"@babel/plugin-transform-private-methods@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz#847f4139263577526455d7d3223cd8bda51e3b57" + integrity sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw== dependencies: - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-named-capturing-groups-regex@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz#626298dd62ea51d452c3be58b285d23195ba69a8" - integrity sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA== +"@babel/plugin-transform-private-property-in-object@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz#9c8b73e64e6cc3cbb2743633885a7dd2c385fe33" + integrity sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.20.5" - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-new-target@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz#d128f376ae200477f37c4ddfcc722a8a1b3246a8" - integrity sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw== +"@babel/plugin-transform-property-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz#d72d588bd88b0dec8b62e36f6fda91cedfe28e3f" + integrity sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-object-super@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz#fb3c6ccdd15939b6ff7939944b51971ddc35912c" - integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA== +"@babel/plugin-transform-regenerator@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz#03a8a4670d6cebae95305ac6defac81ece77740b" + integrity sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.6" + "@babel/helper-plugin-utils" "^7.25.9" + regenerator-transform "^0.15.2" -"@babel/plugin-transform-parameters@^7.20.7", "@babel/plugin-transform-parameters@^7.21.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.21.3.tgz#18fc4e797cf6d6d972cb8c411dbe8a809fa157db" - integrity sha512-Wxc+TvppQG9xWFYatvCGPvZ6+SIUxQ2ZdiBP+PHYMIjnPXD+uThCshaz4NZOnODAtBjjcVQQ/3OKs9LW28purQ== +"@babel/plugin-transform-regexp-modifiers@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz#2f5837a5b5cd3842a919d8147e9903cc7455b850" + integrity sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-property-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz#e22498903a483448e94e032e9bbb9c5ccbfc93a3" - integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg== +"@babel/plugin-transform-reserved-words@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz#0398aed2f1f10ba3f78a93db219b27ef417fb9ce" + integrity sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-regenerator@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.21.5.tgz#576c62f9923f94bcb1c855adc53561fd7913724e" - integrity sha512-ZoYBKDb6LyMi5yCsByQ5jmXsHAQDDYeexT1Szvlmui+lADvfSecr5Dxd/PkrTC3pAD182Fcju1VQkB4oCp9M+w== +"@babel/plugin-transform-shorthand-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz#bb785e6091f99f826a95f9894fc16fde61c163f2" + integrity sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng== dependencies: - "@babel/helper-plugin-utils" "^7.21.5" - regenerator-transform "^0.15.1" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-reserved-words@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz#b1abd8ebf8edaa5f7fe6bbb8d2133d23b6a6f76a" - integrity sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA== +"@babel/plugin-transform-spread@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz#24a35153931b4ba3d13cec4a7748c21ab5514ef9" + integrity sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" -"@babel/plugin-transform-shorthand-properties@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9" - integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw== +"@babel/plugin-transform-sticky-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz#c7f02b944e986a417817b20ba2c504dfc1453d32" + integrity sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-spread@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz#c2d83e0b99d3bf83e07b11995ee24bf7ca09401e" - integrity sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw== +"@babel/plugin-transform-template-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz#6dbd4a24e8fad024df76d1fac6a03cf413f60fe1" + integrity sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-sticky-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz#c6706eb2b1524028e317720339583ad0f444adcc" - integrity sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q== +"@babel/plugin-transform-typeof-symbol@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz#224ba48a92869ddbf81f9b4a5f1204bbf5a2bc4b" + integrity sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-template-literals@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz#04ec6f10acdaa81846689d63fae117dd9c243a5e" - integrity sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA== +"@babel/plugin-transform-unicode-escapes@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz#a75ef3947ce15363fccaa38e2dd9bc70b2788b82" + integrity sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-typeof-symbol@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz#c8cea68263e45addcd6afc9091429f80925762c0" - integrity sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw== +"@babel/plugin-transform-unicode-property-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz#a901e96f2c1d071b0d1bb5dc0d3c880ce8f53dd3" + integrity sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-escapes@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.21.5.tgz#1e55ed6195259b0e9061d81f5ef45a9b009fb7f2" - integrity sha512-LYm/gTOwZqsYohlvFUe/8Tujz75LqqVC2w+2qPHLR+WyWHGCZPN1KBpJCJn+4Bk4gOkQy/IXKIge6az5MqwlOg== +"@babel/plugin-transform-unicode-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz#5eae747fe39eacf13a8bd006a4fb0b5d1fa5e9b1" + integrity sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA== dependencies: - "@babel/helper-plugin-utils" "^7.21.5" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz#194317225d8c201bbae103364ffe9e2cea36cdca" - integrity sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA== +"@babel/plugin-transform-unicode-sets-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz#65114c17b4ffc20fa5b163c63c70c0d25621fabe" + integrity sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" "@babel/preset-env@^7.16.0": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.21.5.tgz#db2089d99efd2297716f018aeead815ac3decffb" - integrity sha512-wH00QnTTldTbf/IefEVyChtRdw5RJvODT/Vb4Vcxq1AZvtXj6T0YeX0cAcXhI6/BdGuiP3GcNIL4OQbI2DVNxg== - dependencies: - "@babel/compat-data" "^7.21.5" - "@babel/helper-compilation-targets" "^7.21.5" - "@babel/helper-plugin-utils" "^7.21.5" - "@babel/helper-validator-option" "^7.21.0" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.20.7" - "@babel/plugin-proposal-async-generator-functions" "^7.20.7" - "@babel/plugin-proposal-class-properties" "^7.18.6" - "@babel/plugin-proposal-class-static-block" "^7.21.0" - "@babel/plugin-proposal-dynamic-import" "^7.18.6" - "@babel/plugin-proposal-export-namespace-from" "^7.18.9" - "@babel/plugin-proposal-json-strings" "^7.18.6" - "@babel/plugin-proposal-logical-assignment-operators" "^7.20.7" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" - "@babel/plugin-proposal-numeric-separator" "^7.18.6" - "@babel/plugin-proposal-object-rest-spread" "^7.20.7" - "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" - "@babel/plugin-proposal-optional-chaining" "^7.21.0" - "@babel/plugin-proposal-private-methods" "^7.18.6" - "@babel/plugin-proposal-private-property-in-object" "^7.21.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.18.6" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.20.0" - "@babel/plugin-syntax-import-meta" "^7.10.4" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.21.5" - "@babel/plugin-transform-async-to-generator" "^7.20.7" - "@babel/plugin-transform-block-scoped-functions" "^7.18.6" - "@babel/plugin-transform-block-scoping" "^7.21.0" - "@babel/plugin-transform-classes" "^7.21.0" - "@babel/plugin-transform-computed-properties" "^7.21.5" - "@babel/plugin-transform-destructuring" "^7.21.3" - "@babel/plugin-transform-dotall-regex" "^7.18.6" - "@babel/plugin-transform-duplicate-keys" "^7.18.9" - "@babel/plugin-transform-exponentiation-operator" "^7.18.6" - "@babel/plugin-transform-for-of" "^7.21.5" - "@babel/plugin-transform-function-name" "^7.18.9" - "@babel/plugin-transform-literals" "^7.18.9" - "@babel/plugin-transform-member-expression-literals" "^7.18.6" - "@babel/plugin-transform-modules-amd" "^7.20.11" - "@babel/plugin-transform-modules-commonjs" "^7.21.5" - "@babel/plugin-transform-modules-systemjs" "^7.20.11" - "@babel/plugin-transform-modules-umd" "^7.18.6" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.20.5" - "@babel/plugin-transform-new-target" "^7.18.6" - "@babel/plugin-transform-object-super" "^7.18.6" - "@babel/plugin-transform-parameters" "^7.21.3" - "@babel/plugin-transform-property-literals" "^7.18.6" - "@babel/plugin-transform-regenerator" "^7.21.5" - "@babel/plugin-transform-reserved-words" "^7.18.6" - "@babel/plugin-transform-shorthand-properties" "^7.18.6" - "@babel/plugin-transform-spread" "^7.20.7" - "@babel/plugin-transform-sticky-regex" "^7.18.6" - "@babel/plugin-transform-template-literals" "^7.18.9" - "@babel/plugin-transform-typeof-symbol" "^7.18.9" - "@babel/plugin-transform-unicode-escapes" "^7.21.5" - "@babel/plugin-transform-unicode-regex" "^7.18.6" - "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.21.5" - babel-plugin-polyfill-corejs2 "^0.3.3" - babel-plugin-polyfill-corejs3 "^0.6.0" - babel-plugin-polyfill-regenerator "^0.4.1" - core-js-compat "^3.25.1" - semver "^6.3.0" - -"@babel/preset-modules@^0.1.5": - version "0.1.5" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" - integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" + integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== + dependencies: + "@babel/compat-data" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-validator-option" "^7.25.9" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.25.9" + "@babel/plugin-bugfix-safari-class-field-initializer-scope" "^7.25.9" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.25.9" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.25.9" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.25.9" + "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" + "@babel/plugin-syntax-import-assertions" "^7.26.0" + "@babel/plugin-syntax-import-attributes" "^7.26.0" + "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" + "@babel/plugin-transform-arrow-functions" "^7.25.9" + "@babel/plugin-transform-async-generator-functions" "^7.25.9" + "@babel/plugin-transform-async-to-generator" "^7.25.9" + "@babel/plugin-transform-block-scoped-functions" "^7.25.9" + "@babel/plugin-transform-block-scoping" "^7.25.9" + "@babel/plugin-transform-class-properties" "^7.25.9" + "@babel/plugin-transform-class-static-block" "^7.26.0" + "@babel/plugin-transform-classes" "^7.25.9" + "@babel/plugin-transform-computed-properties" "^7.25.9" + "@babel/plugin-transform-destructuring" "^7.25.9" + "@babel/plugin-transform-dotall-regex" "^7.25.9" + "@babel/plugin-transform-duplicate-keys" "^7.25.9" + "@babel/plugin-transform-duplicate-named-capturing-groups-regex" "^7.25.9" + "@babel/plugin-transform-dynamic-import" "^7.25.9" + "@babel/plugin-transform-exponentiation-operator" "^7.25.9" + "@babel/plugin-transform-export-namespace-from" "^7.25.9" + "@babel/plugin-transform-for-of" "^7.25.9" + "@babel/plugin-transform-function-name" "^7.25.9" + "@babel/plugin-transform-json-strings" "^7.25.9" + "@babel/plugin-transform-literals" "^7.25.9" + "@babel/plugin-transform-logical-assignment-operators" "^7.25.9" + "@babel/plugin-transform-member-expression-literals" "^7.25.9" + "@babel/plugin-transform-modules-amd" "^7.25.9" + "@babel/plugin-transform-modules-commonjs" "^7.25.9" + "@babel/plugin-transform-modules-systemjs" "^7.25.9" + "@babel/plugin-transform-modules-umd" "^7.25.9" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.25.9" + "@babel/plugin-transform-new-target" "^7.25.9" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.25.9" + "@babel/plugin-transform-numeric-separator" "^7.25.9" + "@babel/plugin-transform-object-rest-spread" "^7.25.9" + "@babel/plugin-transform-object-super" "^7.25.9" + "@babel/plugin-transform-optional-catch-binding" "^7.25.9" + "@babel/plugin-transform-optional-chaining" "^7.25.9" + "@babel/plugin-transform-parameters" "^7.25.9" + "@babel/plugin-transform-private-methods" "^7.25.9" + "@babel/plugin-transform-private-property-in-object" "^7.25.9" + "@babel/plugin-transform-property-literals" "^7.25.9" + "@babel/plugin-transform-regenerator" "^7.25.9" + "@babel/plugin-transform-regexp-modifiers" "^7.26.0" + "@babel/plugin-transform-reserved-words" "^7.25.9" + "@babel/plugin-transform-shorthand-properties" "^7.25.9" + "@babel/plugin-transform-spread" "^7.25.9" + "@babel/plugin-transform-sticky-regex" "^7.25.9" + "@babel/plugin-transform-template-literals" "^7.25.9" + "@babel/plugin-transform-typeof-symbol" "^7.25.9" + "@babel/plugin-transform-unicode-escapes" "^7.25.9" + "@babel/plugin-transform-unicode-property-regex" "^7.25.9" + "@babel/plugin-transform-unicode-regex" "^7.25.9" + "@babel/plugin-transform-unicode-sets-regex" "^7.25.9" + "@babel/preset-modules" "0.1.6-no-external-plugins" + babel-plugin-polyfill-corejs2 "^0.4.10" + babel-plugin-polyfill-corejs3 "^0.10.6" + babel-plugin-polyfill-regenerator "^0.6.1" + core-js-compat "^3.38.1" + semver "^6.3.1" + +"@babel/preset-modules@0.1.6-no-external-plugins": + version "0.1.6-no-external-plugins" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" + integrity sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" - "@babel/plugin-transform-dotall-regex" "^7.4.4" "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/regjsgen@^0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" - integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== - "@babel/runtime@^7.8.4": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.5.tgz#8492dddda9644ae3bda3b45eabe87382caee7200" - integrity sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q== - dependencies: - regenerator-runtime "^0.13.11" - -"@babel/template@^7.18.10", "@babel/template@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" - integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - -"@babel/traverse@^7.20.5", "@babel/traverse@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.5.tgz#ad22361d352a5154b498299d523cf72998a4b133" - integrity sha512-AhQoI3YjWi6u/y/ntv7k48mcrCXmus0t79J9qPNlk/lAsFlCiJ047RmbfMOawySTHtywXhbXgpx/8nXMYd+oFw== - dependencies: - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.5" - "@babel/helper-environment-visitor" "^7.21.5" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.21.5" - "@babel/types" "^7.21.5" - debug "^4.1.0" + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" + integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== + dependencies: + regenerator-runtime "^0.14.0" + +"@babel/template@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" + integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== + dependencies: + "@babel/code-frame" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/traverse@^7.25.9", "@babel/traverse@^7.26.5": + version "7.26.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.26.5.tgz#6d0be3e772ff786456c1a37538208286f6e79021" + integrity sha512-rkOSPOw+AXbgtwUga3U4u8RpoK9FEFWBNAlTpcnkLFjL5CT+oyHNuUUC/xx6XefEJ16r38r8Bc/lfp6rYuHeJQ== + dependencies: + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.5" + "@babel/parser" "^7.26.5" + "@babel/template" "^7.25.9" + "@babel/types" "^7.26.5" + debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.20.0", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.4", "@babel/types@^7.21.5", "@babel/types@^7.4.4": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.5.tgz#18dfbd47c39d3904d5db3d3dc2cc80bedb60e5b6" - integrity sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q== +"@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.26.5", "@babel/types@^7.4.4": + version "7.26.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.26.5.tgz#7a1e1c01d28e26d1fe7f8ec9567b3b92b9d07747" + integrity sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg== dependencies: - "@babel/helper-string-parser" "^7.21.5" - "@babel/helper-validator-identifier" "^7.19.1" - to-fast-properties "^2.0.0" + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" "@colors/colors@1.5.0": version "1.5.0" @@ -952,15 +812,15 @@ integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== "@commitlint/cli@^17.6.3": - version "17.6.3" - resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-17.6.3.tgz#a02194a2bb6efe4e681eda2addd072a8d02c9497" - integrity sha512-ItSz2fd4F+CujgIbQOfNNerDF1eFlsBGEfp9QcCb1kxTYMuKTYZzA6Nu1YRRrIaaWwe2E7awUGpIMrPoZkOG3A== - dependencies: - "@commitlint/format" "^17.4.4" - "@commitlint/lint" "^17.6.3" - "@commitlint/load" "^17.5.0" - "@commitlint/read" "^17.5.1" - "@commitlint/types" "^17.4.4" + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-17.8.1.tgz#10492114a022c91dcfb1d84dac773abb3db76d33" + integrity sha512-ay+WbzQesE0Rv4EQKfNbSMiJJ12KdKTDzIt0tcK4k11FdsWmtwP0Kp1NWMOUswfIWo6Eb7p7Ln721Nx9FLNBjg== + dependencies: + "@commitlint/format" "^17.8.1" + "@commitlint/lint" "^17.8.1" + "@commitlint/load" "^17.8.1" + "@commitlint/read" "^17.8.1" + "@commitlint/types" "^17.8.1" execa "^5.0.0" lodash.isfunction "^3.0.9" resolve-from "5.0.0" @@ -968,73 +828,73 @@ yargs "^17.0.0" "@commitlint/config-conventional@^17.6.3": - version "17.6.3" - resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-17.6.3.tgz#21f5835235493e386effeaa98b898124230b1000" - integrity sha512-bLyHEjjRWqlLQWIgYFHmUPbEFMOOLXeF3QbUinDIJev/u9e769tkoTH9YPknEywiuIrAgZaVo+OfzAIsJP0fsw== + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-17.8.1.tgz#e5bcf0cfec8da7ac50bc04dc92e0a4ea74964ce0" + integrity sha512-NxCOHx1kgneig3VLauWJcDWS40DVjg7nKOpBEEK9E5fjJpQqLCilcnKkIIjdBH98kEO1q3NpE5NSrZ2kl/QGJg== dependencies: - conventional-changelog-conventionalcommits "^5.0.0" + conventional-changelog-conventionalcommits "^6.1.0" -"@commitlint/config-validator@^17.4.4": - version "17.4.4" - resolved "https://registry.yarnpkg.com/@commitlint/config-validator/-/config-validator-17.4.4.tgz#d0742705719559a101d2ee49c0c514044af6d64d" - integrity sha512-bi0+TstqMiqoBAQDvdEP4AFh0GaKyLFlPPEObgI29utoKEYoPQTvF0EYqIwYYLEoJYhj5GfMIhPHJkTJhagfeg== +"@commitlint/config-validator@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/config-validator/-/config-validator-17.8.1.tgz#5cc93b6b49d5524c9cc345a60e5bf74bcca2b7f9" + integrity sha512-UUgUC+sNiiMwkyiuIFR7JG2cfd9t/7MV8VB4TZ+q02ZFkHoduUS4tJGsCBWvBOGD9Btev6IecPMvlWUfJorkEA== dependencies: - "@commitlint/types" "^17.4.4" + "@commitlint/types" "^17.8.1" ajv "^8.11.0" -"@commitlint/ensure@^17.4.4": - version "17.4.4" - resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-17.4.4.tgz#a36e7719bdb9c2b86c8b8c2e852b463a7bfda5fa" - integrity sha512-AHsFCNh8hbhJiuZ2qHv/m59W/GRE9UeOXbkOqxYMNNg9pJ7qELnFcwj5oYpa6vzTSHtPGKf3C2yUFNy1GGHq6g== +"@commitlint/ensure@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-17.8.1.tgz#59183557844999dbb6aab6d03629a3d104d01a8d" + integrity sha512-xjafwKxid8s1K23NFpL8JNo6JnY/ysetKo8kegVM7c8vs+kWLP8VrQq+NbhgVlmCojhEDbzQKp4eRXSjVOGsow== dependencies: - "@commitlint/types" "^17.4.4" + "@commitlint/types" "^17.8.1" lodash.camelcase "^4.3.0" lodash.kebabcase "^4.1.1" lodash.snakecase "^4.1.1" lodash.startcase "^4.4.0" lodash.upperfirst "^4.3.1" -"@commitlint/execute-rule@^17.4.0": - version "17.4.0" - resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-17.4.0.tgz#4518e77958893d0a5835babe65bf87e2638f6939" - integrity sha512-LIgYXuCSO5Gvtc0t9bebAMSwd68ewzmqLypqI2Kke1rqOqqDbMpYcYfoPfFlv9eyLIh4jocHWwCK5FS7z9icUA== +"@commitlint/execute-rule@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-17.8.1.tgz#504ed69eb61044eeb84fdfd10cc18f0dab14f34c" + integrity sha512-JHVupQeSdNI6xzA9SqMF+p/JjrHTcrJdI02PwesQIDCIGUrv04hicJgCcws5nzaoZbROapPs0s6zeVHoxpMwFQ== -"@commitlint/format@^17.4.4": - version "17.4.4" - resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-17.4.4.tgz#0f6e1b4d7a301c7b1dfd4b6334edd97fc050b9f5" - integrity sha512-+IS7vpC4Gd/x+uyQPTAt3hXs5NxnkqAZ3aqrHd5Bx/R9skyCAWusNlNbw3InDbAK6j166D9asQM8fnmYIa+CXQ== +"@commitlint/format@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-17.8.1.tgz#6108bb6b4408e711006680649927e1b559bdc5f8" + integrity sha512-f3oMTyZ84M9ht7fb93wbCKmWxO5/kKSbwuYvS867duVomoOsgrgljkGGIztmT/srZnaiGbaK8+Wf8Ik2tSr5eg== dependencies: - "@commitlint/types" "^17.4.4" + "@commitlint/types" "^17.8.1" chalk "^4.1.0" -"@commitlint/is-ignored@^17.6.3": - version "17.6.3" - resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-17.6.3.tgz#8e21046558a0339fbf2a33ef0ad7d5a9ae7ff6bc" - integrity sha512-LQbNdnPbxrpbcrVKR5yf51SvquqktpyZJwqXx3lUMF6+nT9PHB8xn3wLy8pi2EQv5Zwba484JnUwDE1ygVYNQA== - dependencies: - "@commitlint/types" "^17.4.4" - semver "7.5.0" - -"@commitlint/lint@^17.6.3": - version "17.6.3" - resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-17.6.3.tgz#2d9a88b73c44be8b97508c980198a6f289251655" - integrity sha512-fBlXwt6SHJFgm3Tz+luuo3DkydAx9HNC5y4eBqcKuDuMVqHd2ugMNr+bQtx6riv9mXFiPoKp7nE4Xn/ls3iVDA== - dependencies: - "@commitlint/is-ignored" "^17.6.3" - "@commitlint/parse" "^17.4.4" - "@commitlint/rules" "^17.6.1" - "@commitlint/types" "^17.4.4" - -"@commitlint/load@^17.5.0": - version "17.5.0" - resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-17.5.0.tgz#be45dbbb50aaf5eb7e8e940e1e0d6171d1426bab" - integrity sha512-l+4W8Sx4CD5rYFsrhHH8HP01/8jEP7kKf33Xlx2Uk2out/UKoKPYMOIRcDH5ppT8UXLMV+x6Wm5osdRKKgaD1Q== - dependencies: - "@commitlint/config-validator" "^17.4.4" - "@commitlint/execute-rule" "^17.4.0" - "@commitlint/resolve-extends" "^17.4.4" - "@commitlint/types" "^17.4.4" - "@types/node" "*" +"@commitlint/is-ignored@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-17.8.1.tgz#cf25bcd8409c79684b63f8bdeb35df48edda244e" + integrity sha512-UshMi4Ltb4ZlNn4F7WtSEugFDZmctzFpmbqvpyxD3la510J+PLcnyhf9chs7EryaRFJMdAKwsEKfNK0jL/QM4g== + dependencies: + "@commitlint/types" "^17.8.1" + semver "7.5.4" + +"@commitlint/lint@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-17.8.1.tgz#bfc21215f6b18d41d4d43e2aa3cb79a5d7726cd8" + integrity sha512-aQUlwIR1/VMv2D4GXSk7PfL5hIaFSfy6hSHV94O8Y27T5q+DlDEgd/cZ4KmVI+MWKzFfCTiTuWqjfRSfdRllCA== + dependencies: + "@commitlint/is-ignored" "^17.8.1" + "@commitlint/parse" "^17.8.1" + "@commitlint/rules" "^17.8.1" + "@commitlint/types" "^17.8.1" + +"@commitlint/load@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-17.8.1.tgz#fa061e7bfa53281eb03ca8517ca26d66a189030c" + integrity sha512-iF4CL7KDFstP1kpVUkT8K2Wl17h2yx9VaR1ztTc8vzByWWcbO/WaKwxsnCOqow9tVAlzPfo1ywk9m2oJ9ucMqA== + dependencies: + "@commitlint/config-validator" "^17.8.1" + "@commitlint/execute-rule" "^17.8.1" + "@commitlint/resolve-extends" "^17.8.1" + "@commitlint/types" "^17.8.1" + "@types/node" "20.5.1" chalk "^4.1.0" cosmiconfig "^8.0.0" cosmiconfig-typescript-loader "^4.0.0" @@ -1043,72 +903,72 @@ lodash.uniq "^4.5.0" resolve-from "^5.0.0" ts-node "^10.8.1" - typescript "^4.6.4 || ^5.0.0" + typescript "^4.6.4 || ^5.2.2" -"@commitlint/message@^17.4.2": - version "17.4.2" - resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-17.4.2.tgz#f4753a79701ad6db6db21f69076e34de6580e22c" - integrity sha512-3XMNbzB+3bhKA1hSAWPCQA3lNxR4zaeQAQcHj0Hx5sVdO6ryXtgUBGGv+1ZCLMgAPRixuc6en+iNAzZ4NzAa8Q== +"@commitlint/message@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-17.8.1.tgz#a5cd226c419be20ee03c3d237db6ac37b95958b3" + integrity sha512-6bYL1GUQsD6bLhTH3QQty8pVFoETfFQlMn2Nzmz3AOLqRVfNNtXBaSY0dhZ0dM6A2MEq4+2d7L/2LP8TjqGRkA== -"@commitlint/parse@^17.4.4": - version "17.4.4" - resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-17.4.4.tgz#8311b12f2b730de6ea0679ae2a37b386bcc5b04b" - integrity sha512-EKzz4f49d3/OU0Fplog7nwz/lAfXMaDxtriidyGF9PtR+SRbgv4FhsfF310tKxs6EPj8Y+aWWuX3beN5s+yqGg== +"@commitlint/parse@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-17.8.1.tgz#6e00b8f50ebd63562d25dcf4230da2c9f984e626" + integrity sha512-/wLUickTo0rNpQgWwLPavTm7WbwkZoBy3X8PpkUmlSmQJyWQTj0m6bDjiykMaDt41qcUbfeFfaCvXfiR4EGnfw== dependencies: - "@commitlint/types" "^17.4.4" - conventional-changelog-angular "^5.0.11" - conventional-commits-parser "^3.2.2" + "@commitlint/types" "^17.8.1" + conventional-changelog-angular "^6.0.0" + conventional-commits-parser "^4.0.0" -"@commitlint/read@^17.5.1": - version "17.5.1" - resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-17.5.1.tgz#fec903b766e2c41e3cefa80630040fcaba4f786c" - integrity sha512-7IhfvEvB//p9aYW09YVclHbdf1u7g7QhxeYW9ZHSO8Huzp8Rz7m05aCO1mFG7G8M+7yfFnXB5xOmG18brqQIBg== +"@commitlint/read@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-17.8.1.tgz#b3f28777607c756078356cc133368b0e8c08092f" + integrity sha512-Fd55Oaz9irzBESPCdMd8vWWgxsW3OWR99wOntBDHgf9h7Y6OOHjWEdS9Xzen1GFndqgyoaFplQS5y7KZe0kO2w== dependencies: - "@commitlint/top-level" "^17.4.0" - "@commitlint/types" "^17.4.4" + "@commitlint/top-level" "^17.8.1" + "@commitlint/types" "^17.8.1" fs-extra "^11.0.0" git-raw-commits "^2.0.11" minimist "^1.2.6" -"@commitlint/resolve-extends@^17.4.4": - version "17.4.4" - resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-17.4.4.tgz#8f931467dea8c43b9fe38373e303f7c220de6fdc" - integrity sha512-znXr1S0Rr8adInptHw0JeLgumS11lWbk5xAWFVno+HUFVN45875kUtqjrI6AppmD3JI+4s0uZlqqlkepjJd99A== +"@commitlint/resolve-extends@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-17.8.1.tgz#9af01432bf2fd9ce3dd5a00d266cce14e4c977e7" + integrity sha512-W/ryRoQ0TSVXqJrx5SGkaYuAaE/BUontL1j1HsKckvM6e5ZaG0M9126zcwL6peKSuIetJi7E87PRQF8O86EW0Q== dependencies: - "@commitlint/config-validator" "^17.4.4" - "@commitlint/types" "^17.4.4" + "@commitlint/config-validator" "^17.8.1" + "@commitlint/types" "^17.8.1" import-fresh "^3.0.0" lodash.mergewith "^4.6.2" resolve-from "^5.0.0" resolve-global "^1.0.0" -"@commitlint/rules@^17.6.1": - version "17.6.1" - resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-17.6.1.tgz#dff529b8d1e0455808fe7e3e1fa70617e4eb2759" - integrity sha512-lUdHw6lYQ1RywExXDdLOKxhpp6857/4c95Dc/1BikrHgdysVUXz26yV0vp1GL7Gv+avx9WqZWTIVB7pNouxlfw== +"@commitlint/rules@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-17.8.1.tgz#da49cab1b7ebaf90d108de9f58f684dc4ccb65a0" + integrity sha512-2b7OdVbN7MTAt9U0vKOYKCDsOvESVXxQmrvuVUZ0rGFMCrCPJWWP1GJ7f0lAypbDAhaGb8zqtdOr47192LBrIA== dependencies: - "@commitlint/ensure" "^17.4.4" - "@commitlint/message" "^17.4.2" - "@commitlint/to-lines" "^17.4.0" - "@commitlint/types" "^17.4.4" + "@commitlint/ensure" "^17.8.1" + "@commitlint/message" "^17.8.1" + "@commitlint/to-lines" "^17.8.1" + "@commitlint/types" "^17.8.1" execa "^5.0.0" -"@commitlint/to-lines@^17.4.0": - version "17.4.0" - resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-17.4.0.tgz#9bd02e911e7d4eab3fb4a50376c4c6d331e10d8d" - integrity sha512-LcIy/6ZZolsfwDUWfN1mJ+co09soSuNASfKEU5sCmgFCvX5iHwRYLiIuoqXzOVDYOy7E7IcHilr/KS0e5T+0Hg== +"@commitlint/to-lines@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-17.8.1.tgz#a5c4a7cf7dff3dbdd69289fc0eb19b66f3cfe017" + integrity sha512-LE0jb8CuR/mj6xJyrIk8VLz03OEzXFgLdivBytoooKO5xLt5yalc8Ma5guTWobw998sbR3ogDd+2jed03CFmJA== -"@commitlint/top-level@^17.4.0": - version "17.4.0" - resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-17.4.0.tgz#540cac8290044cf846fbdd99f5cc51e8ac5f27d6" - integrity sha512-/1loE/g+dTTQgHnjoCy0AexKAEFyHsR2zRB4NWrZ6lZSMIxAhBJnmCqwao7b4H8888PsfoTBCLBYIw8vGnej8g== +"@commitlint/top-level@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-17.8.1.tgz#206d37d6782f33c9572e44fbe3758392fdeea7bc" + integrity sha512-l6+Z6rrNf5p333SHfEte6r+WkOxGlWK4bLuZKbtf/2TXRN+qhrvn1XE63VhD8Oe9oIHQ7F7W1nG2k/TJFhx2yA== dependencies: find-up "^5.0.0" -"@commitlint/types@^17.4.4": - version "17.4.4" - resolved "https://registry.yarnpkg.com/@commitlint/types/-/types-17.4.4.tgz#1416df936e9aad0d6a7bbc979ecc31e55dade662" - integrity sha512-amRN8tRLYOsxRr6mTnGGGvB5EmW/4DDjLMgiwK3CCVEmN6Sr/6xePGEpWaspKkckILuUORCwe6VfDBw6uj4axQ== +"@commitlint/types@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/types/-/types-17.8.1.tgz#883a0ad35c5206d5fef7bc6ce1bbe648118af44e" + integrity sha512-PXDQXkAmiMEG162Bqdh9ChML/GJZo6vU+7F03ALKDK8zYc6SuAr47LjG7hGYRqUOz+WK0dU7bQ0xzuqFMdxzeQ== dependencies: chalk "^4.1.0" @@ -1124,10 +984,10 @@ resolved "https://registry.yarnpkg.com/@csstools/selector-specificity/-/selector-specificity-2.2.0.tgz#2cbcf822bf3764c9658c4d2e568bd0c0cb748016" integrity sha512-+OJ9konv95ClSTOJCmMZqpd5+YGsB2S+x6w3E1oaM8UuR5j8nTNHYSz8c9BEPGDOCMQYIEEGlVPj/VY64iTbGw== -"@cypress/request@^2.88.10": - version "2.88.11" - resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.11.tgz#5a4c7399bc2d7e7ed56e92ce5acb620c8b187047" - integrity sha512-M83/wfQ1EkspjkE2lNWNV5ui2Cv7UCv1swW1DqljahbzLVWltcsexQh8jYtuS/vzFXP+HySntGM83ZXA9fn17w== +"@cypress/request@2.88.12": + version "2.88.12" + resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.12.tgz#ba4911431738494a85e93fb04498cb38bc55d590" + integrity sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -1144,7 +1004,7 @@ performance-now "^2.1.0" qs "~6.10.3" safe-buffer "^5.1.2" - tough-cookie "~2.5.0" + tough-cookie "^4.1.3" tunnel-agent "^0.6.0" uuid "^8.3.2" @@ -1167,9 +1027,9 @@ integrity sha512-wa/zupVG0eWxRYJjC1IiPBdt3Lruv0RqGN+/DTMmUWUyMAEB27KXmVY6a8YpUVTM7QwVuaLNGW4EqDgrS2upXQ== "@hotwired/stimulus@^3.0.0": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.1.tgz#e3de23623b0c52c247aba4cd5d530d257008676b" - integrity sha512-HGlzDcf9vv/EQrMJ5ZG6VWNs8Z/xMN+1o2OhV1gKiSG6CqZt5MCBB1gRg5ILiN3U0jEAxuDTNPRfBcnZBDmupQ== + version "3.2.2" + resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz#071aab59c600fed95b97939e605ff261a4251608" + integrity sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A== "@isaacs/cliui@^8.0.2": version "8.0.2" @@ -1183,66 +1043,56 @@ wrap-ansi "^8.1.0" wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" -"@jest/schemas@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.3.tgz#39cf1b8469afc40b6f5a2baaa146e332c4151788" - integrity sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg== +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== dependencies: - "@sinclair/typebox" "^0.25.16" + "@sinclair/typebox" "^0.27.8" -"@jest/types@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.5.0.tgz#f59ef9b031ced83047c67032700d8c807d6e1593" - integrity sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog== +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== dependencies: - "@jest/schemas" "^29.4.3" + "@jest/schemas" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" - integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== +"@jridgewell/gen-mapping@^0.3.2", "@jridgewell/gen-mapping@^0.3.5": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz#4f0e06362e01362f823d348f1872b08f666d8142" + integrity sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA== dependencies: - "@jridgewell/set-array" "^1.0.1" + "@jridgewell/set-array" "^1.2.1" "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.9" - -"@jridgewell/resolve-uri@3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" - integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + "@jridgewell/trace-mapping" "^0.3.24" -"@jridgewell/resolve-uri@^3.0.3": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" - integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== +"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== -"@jridgewell/set-array@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" - integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== -"@jridgewell/source-map@^0.3.2": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.3.tgz#8108265659d4c33e72ffe14e33d6cc5eb59f2fda" - integrity sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg== +"@jridgewell/source-map@^0.3.3": + version "0.3.6" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.6.tgz#9d71ca886e32502eb9362c9a74a46787c36df81a" + integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ== dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" -"@jridgewell/sourcemap-codec@1.4.14": - version "1.4.14" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== - -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.15" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" - integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== "@jridgewell/trace-mapping@0.3.9": version "0.3.9" @@ -1252,18 +1102,18 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.18" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6" - integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA== +"@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== dependencies: - "@jridgewell/resolve-uri" "3.1.0" - "@jridgewell/sourcemap-codec" "1.4.14" + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" "@leichtgewicht/ip-codec@^2.0.1": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" - integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== + version "2.0.5" + resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz#4fc56c15c580b9adb7dc3c333a134e540b44bfb1" + integrity sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -1287,39 +1137,128 @@ fastq "^1.6.0" "@nuxt/friendly-errors-webpack-plugin@^2.5.1": - version "2.5.2" - resolved "https://registry.yarnpkg.com/@nuxt/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-2.5.2.tgz#982a43ee2da61611f7396439e57038392d3944d5" - integrity sha512-LLc+90lnxVbpKkMqk5z1EWpXoODhc6gRkqqXJCInJwF5xabHAE7biFvbULfvTRmtaTzAaP8IV4HQDLUgeAUTTw== + version "2.6.0" + resolved "https://registry.yarnpkg.com/@nuxt/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-2.6.0.tgz#bd0cf6cd73b6e1d3e7c7f1c0de43333e69cc660c" + integrity sha512-3IZj6MXbzlvUxDncAxgBMLQwGPY/JlNhy2i+AGyOHCAReR5HcBxYjVRBvyaKM9R3s5k4OODYKeHAbrToZH/47w== dependencies: - chalk "^2.3.2" - consola "^2.6.0" - error-stack-parser "^2.0.0" + chalk "^2.4.2" + consola "^3.2.3" + error-stack-parser "^2.1.4" string-width "^4.2.3" +"@parcel/watcher-android-arm64@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.0.tgz#e32d3dda6647791ee930556aee206fcd5ea0fb7a" + integrity sha512-qlX4eS28bUcQCdribHkg/herLe+0A9RyYC+mm2PXpncit8z5b3nSqGVzMNR3CmtAOgRutiZ02eIJJgP/b1iEFQ== + +"@parcel/watcher-darwin-arm64@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.0.tgz#0d9e680b7e9ec1c8f54944f1b945aa8755afb12f" + integrity sha512-hyZ3TANnzGfLpRA2s/4U1kbw2ZI4qGxaRJbBH2DCSREFfubMswheh8TeiC1sGZ3z2jUf3s37P0BBlrD3sjVTUw== + +"@parcel/watcher-darwin-x64@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.0.tgz#f9f1d5ce9d5878d344f14ef1856b7a830c59d1bb" + integrity sha512-9rhlwd78saKf18fT869/poydQK8YqlU26TMiNg7AIu7eBp9adqbJZqmdFOsbZ5cnLp5XvRo9wcFmNHgHdWaGYA== + +"@parcel/watcher-freebsd-x64@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.0.tgz#2b77f0c82d19e84ff4c21de6da7f7d096b1a7e82" + integrity sha512-syvfhZzyM8kErg3VF0xpV8dixJ+RzbUaaGaeb7uDuz0D3FK97/mZ5AJQ3XNnDsXX7KkFNtyQyFrXZzQIcN49Tw== + +"@parcel/watcher-linux-arm-glibc@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.0.tgz#92ed322c56dbafa3d2545dcf2803334aee131e42" + integrity sha512-0VQY1K35DQET3dVYWpOaPFecqOT9dbuCfzjxoQyif1Wc574t3kOSkKevULddcR9znz1TcklCE7Ht6NIxjvTqLA== + +"@parcel/watcher-linux-arm-musl@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.0.tgz#cd48e9bfde0cdbbd2ecd9accfc52967e22f849a4" + integrity sha512-6uHywSIzz8+vi2lAzFeltnYbdHsDm3iIB57d4g5oaB9vKwjb6N6dRIgZMujw4nm5r6v9/BQH0noq6DzHrqr2pA== + +"@parcel/watcher-linux-arm64-glibc@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.0.tgz#7b81f6d5a442bb89fbabaf6c13573e94a46feb03" + integrity sha512-BfNjXwZKxBy4WibDb/LDCriWSKLz+jJRL3cM/DllnHH5QUyoiUNEp3GmL80ZqxeumoADfCCP19+qiYiC8gUBjA== + +"@parcel/watcher-linux-arm64-musl@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.0.tgz#dcb8ff01077cdf59a18d9e0a4dff7a0cfe5fd732" + integrity sha512-S1qARKOphxfiBEkwLUbHjCY9BWPdWnW9j7f7Hb2jPplu8UZ3nes7zpPOW9bkLbHRvWM0WDTsjdOTUgW0xLBN1Q== + +"@parcel/watcher-linux-x64-glibc@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.0.tgz#2e254600fda4e32d83942384d1106e1eed84494d" + integrity sha512-d9AOkusyXARkFD66S6zlGXyzx5RvY+chTP9Jp0ypSTC9d4lzyRs9ovGf/80VCxjKddcUvnsGwCHWuF2EoPgWjw== + +"@parcel/watcher-linux-x64-musl@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.0.tgz#01fcea60fedbb3225af808d3f0a7b11229792eef" + integrity sha512-iqOC+GoTDoFyk/VYSFHwjHhYrk8bljW6zOhPuhi5t9ulqiYq1togGJB5e3PwYVFFfeVgc6pbz3JdQyDoBszVaA== + +"@parcel/watcher-win32-arm64@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.0.tgz#87cdb16e0783e770197e52fb1dc027bb0c847154" + integrity sha512-twtft1d+JRNkM5YbmexfcH/N4znDtjgysFaV9zvZmmJezQsKpkfLYJ+JFV3uygugK6AtIM2oADPkB2AdhBrNig== + +"@parcel/watcher-win32-ia32@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.0.tgz#778c39b56da33e045ba21c678c31a9f9d7c6b220" + integrity sha512-+rgpsNRKwo8A53elqbbHXdOMtY/tAtTzManTWShB5Kk54N8Q9mzNWV7tV+IbGueCbcj826MfWGU3mprWtuf1TA== + +"@parcel/watcher-win32-x64@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.0.tgz#33873876d0bbc588aacce38e90d1d7480ce81cb7" + integrity sha512-lPrxve92zEHdgeff3aiu4gDOIt4u7sJYha6wbdEZDCDUhtjTsOMiaJzG5lMY4GkWH8p0fMmO2Ppq5G5XXG+DQw== + +"@parcel/watcher@^2.4.1": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.5.0.tgz#5c88818b12b8de4307a9d3e6dc3e28eba0dfbd10" + integrity sha512-i0GV1yJnm2n3Yq1qw6QrUrd/LI9bE8WEBOTtOkpCXHHdyN3TAGgqAK/DAT05z4fq2x04cARXt2pDmjWjL92iTQ== + dependencies: + detect-libc "^1.0.3" + is-glob "^4.0.3" + micromatch "^4.0.5" + node-addon-api "^7.0.0" + optionalDependencies: + "@parcel/watcher-android-arm64" "2.5.0" + "@parcel/watcher-darwin-arm64" "2.5.0" + "@parcel/watcher-darwin-x64" "2.5.0" + "@parcel/watcher-freebsd-x64" "2.5.0" + "@parcel/watcher-linux-arm-glibc" "2.5.0" + "@parcel/watcher-linux-arm-musl" "2.5.0" + "@parcel/watcher-linux-arm64-glibc" "2.5.0" + "@parcel/watcher-linux-arm64-musl" "2.5.0" + "@parcel/watcher-linux-x64-glibc" "2.5.0" + "@parcel/watcher-linux-x64-musl" "2.5.0" + "@parcel/watcher-win32-arm64" "2.5.0" + "@parcel/watcher-win32-ia32" "2.5.0" + "@parcel/watcher-win32-x64" "2.5.0" + "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== "@popperjs/core@^2.9.0": - version "2.11.7" - resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.7.tgz#ccab5c8f7dc557a52ca3288c10075c9ccd37fff7" - integrity sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw== + version "2.11.8" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" + integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== "@ryangjchandler/alpine-tooltip@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@ryangjchandler/alpine-tooltip/-/alpine-tooltip-1.2.0.tgz#2a5acaf805f7721c6cf0eed705372029e92ef57e" - integrity sha512-PzShzyYPoDTMvfayQRoNAnoxOkcfVYrrYrtiqX/Dg09Jp2qpNDB8IkcShs3BQwK0D4RnaYFtFXCqtXGhGU0dPA== + version "1.3.1" + resolved "https://registry.yarnpkg.com/@ryangjchandler/alpine-tooltip/-/alpine-tooltip-1.3.1.tgz#71d57bb26ec3948667f69549a66f8484b83cb130" + integrity sha512-6Vx87IVUUyzNzRbjvi3i14bq51K6BGSep/fipS8d7gNDr9ebGn2P5LMPISn1ryFg71bBNHPdm0jO/K812d7BWQ== -"@sinclair/typebox@^0.25.16": - version "0.25.24" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718" - integrity sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ== +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== "@symfony/stimulus-bridge@^3.2.0": - version "3.2.2" - resolved "https://registry.yarnpkg.com/@symfony/stimulus-bridge/-/stimulus-bridge-3.2.2.tgz#afc1918f82d78cb2b6e299285c54094aa7f53696" - integrity sha512-kIaUEGPXW7g14zsHkIvQWw8cmfCdXSqsEQx18fuHPBb+R0h8nYPyY+e9uVtTuHlE2wHwAjrJoc6YBBK4a7CpKA== + version "3.2.3" + resolved "https://registry.yarnpkg.com/@symfony/stimulus-bridge/-/stimulus-bridge-3.2.3.tgz#1c496d4b11e24051be26a11045118f29f9c3f9b7" + integrity sha512-36rQTihQ2MGOn8EmdOYCr3DQfP3WS1CNcUUXKTPY5ghtFOeb7OVuhbc32AjRowE2/vaVDOUCPOTv3VLf5VtXBA== dependencies: "@hotwired/stimulus-webpack-helpers" "^1.0.1" "@types/webpack-env" "^1.16.4" @@ -1328,20 +1267,19 @@ schema-utils "^3.0.0" "@symfony/webpack-encore@^4.0.0": - version "4.3.0" - resolved "https://registry.yarnpkg.com/@symfony/webpack-encore/-/webpack-encore-4.3.0.tgz#2cf025bd9ee33b176cf6c040c5fb610415cc66f8" - integrity sha512-YhM6xh+aKmrWS7X7Y2CUDte4wiUm9WIo0w07KTwDLLQnOUdMHRf3wa680WXH/I3oHqD+grFa7BHPpR0sfmoGMQ== + version "4.7.0" + resolved "https://registry.yarnpkg.com/@symfony/webpack-encore/-/webpack-encore-4.7.0.tgz#d8f9ddc28ddb4175d65e3dd9de3a86e38e6fff52" + integrity sha512-vlvg1mYLVSaujTEUmkd/ucwK7LG7+89PHfOwfz/sJ53n2IFGtuAXyPyXL0igJ0tMcKvDuCShiWTX1nfnzT/Srw== dependencies: "@nuxt/friendly-errors-webpack-plugin" "^2.5.1" assets-webpack-plugin "7.0.*" - babel-loader "^8.2.5" + babel-loader "^9.1.3" chalk "^4.0.0" clean-webpack-plugin "^4.0.0" css-loader "^6.7.0" - css-minimizer-webpack-plugin "^4.0.0" - fast-levenshtein "^3.0.0" + css-minimizer-webpack-plugin "^5.0.0" + fastest-levenshtein "^1.0.16" mini-css-extract-plugin "^2.6.0" - pkg-up "^3.1.0" pretty-error "^4.0.0" resolve-url-loader "^5.0.0" semver "^7.3.2" @@ -1359,9 +1297,9 @@ integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== "@tsconfig/node10@^1.0.7": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" - integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" + integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== "@tsconfig/node12@^1.0.7": version "1.0.11" @@ -1379,70 +1317,90 @@ integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== "@types/body-parser@*": - version "1.19.2" - resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" - integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== + version "1.19.5" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.5.tgz#04ce9a3b677dc8bd681a17da1ab9835dc9d3ede4" + integrity sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg== dependencies: "@types/connect" "*" "@types/node" "*" "@types/bonjour@^3.5.9": - version "3.5.10" - resolved "https://registry.yarnpkg.com/@types/bonjour/-/bonjour-3.5.10.tgz#0f6aadfe00ea414edc86f5d106357cda9701e275" - integrity sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw== + version "3.5.13" + resolved "https://registry.yarnpkg.com/@types/bonjour/-/bonjour-3.5.13.tgz#adf90ce1a105e81dd1f9c61fdc5afda1bfb92956" + integrity sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ== dependencies: "@types/node" "*" "@types/connect-history-api-fallback@^1.3.5": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz#9fd20b3974bdc2bcd4ac6567e2e0f6885cb2cf41" - integrity sha512-4x5FkPpLipqwthjPsF7ZRbOv3uoLUFkTA9G9v583qi4pACvq0uTELrB8OLUzPWUI4IJIyvM85vzkV1nyiI2Lig== + version "1.5.4" + resolved "https://registry.yarnpkg.com/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz#7de71645a103056b48ac3ce07b3520b819c1d5b3" + integrity sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw== dependencies: "@types/express-serve-static-core" "*" "@types/node" "*" "@types/connect@*": - version "3.4.35" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" - integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + version "3.4.38" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.38.tgz#5ba7f3bc4fbbdeaff8dded952e5ff2cc53f8d858" + integrity sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug== dependencies: "@types/node" "*" -"@types/eslint-scope@^3.7.3": - version "3.7.4" - resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16" - integrity sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA== +"@types/eslint-scope@^3.7.7": + version "3.7.7" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" + integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== dependencies: "@types/eslint" "*" "@types/estree" "*" "@types/eslint@*": - version "8.37.0" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.37.0.tgz#29cebc6c2a3ac7fea7113207bf5a828fdf4d7ef1" - integrity sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ== + version "9.6.1" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584" + integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag== dependencies: "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@^1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194" - integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA== +"@types/estree@*", "@types/estree@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== -"@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.33": - version "4.17.34" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.34.tgz#c119e85b75215178bc127de588e93100698ab4cc" - integrity sha512-fvr49XlCGoUj2Pp730AItckfjat4WNb0lb3kfrLWffd+RLeoGAMsq7UOy04PAPtoL01uKwcp6u8nhzpgpDYr3w== +"@types/express-serve-static-core@*", "@types/express-serve-static-core@^5.0.0": + version "5.0.5" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-5.0.5.tgz#f6a851c7fd512e5da087f6f20d29f44b162a6a95" + integrity sha512-GLZPrd9ckqEBFMcVM/qRFAP0Hg3qiVEojgEFsx/N/zKXsBzbGF6z5FBDpZ0+Xhp1xr+qRZYjfGr1cWHB9oFHSA== dependencies: "@types/node" "*" "@types/qs" "*" "@types/range-parser" "*" "@types/send" "*" -"@types/express@*", "@types/express@^4.17.13": - version "4.17.17" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.17.tgz#01d5437f6ef9cfa8668e616e13c2f2ac9a491ae4" - integrity sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q== +"@types/express-serve-static-core@^4.17.33": + version "4.19.6" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz#e01324c2a024ff367d92c66f48553ced0ab50267" + integrity sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + "@types/send" "*" + +"@types/express@*": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@types/express/-/express-5.0.0.tgz#13a7d1f75295e90d19ed6e74cab3678488eaa96c" + integrity sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^5.0.0" + "@types/qs" "*" + "@types/serve-static" "*" + +"@types/express@^4.17.13": + version "4.17.21" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.21.tgz#c26d4a151e60efe0084b23dc3369ebc631ed192d" + integrity sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ== dependencies: "@types/body-parser" "*" "@types/express-serve-static-core" "^4.17.33" @@ -1457,46 +1415,46 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/http-errors@*": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-2.0.4.tgz#7eb47726c391b7345a6ec35ad7f4de469cf5ba4f" + integrity sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA== + "@types/http-proxy@^1.17.8": - version "1.17.11" - resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.11.tgz#0ca21949a5588d55ac2b659b69035c84bd5da293" - integrity sha512-HC8G7c1WmaF2ekqpnFq626xd3Zz0uvaqFmBJNRZCGEZCXkvSdJoNFn/8Ygbd9fKNQj8UzLdCETaI0UWPAjK7IA== + version "1.17.15" + resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.15.tgz#12118141ce9775a6499ecb4c01d02f90fc839d36" + integrity sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ== dependencies: "@types/node" "*" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" - integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== "@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" + integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== dependencies: "@types/istanbul-lib-coverage" "*" "@types/istanbul-reports@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" - integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz#0f03e3d2f670fbdac586e34b433783070cc16f54" + integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== dependencies: "@types/istanbul-lib-report" "*" -"@types/json-schema@*", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": - version "7.0.11" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" - integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== - -"@types/mime@*": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10" - integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== +"@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/mime@^1": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" - integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== + version "1.3.5" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" + integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w== "@types/minimatch@*": version "5.1.2" @@ -1504,44 +1462,58 @@ integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== "@types/minimist@^1.2.0": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" - integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== + version "1.2.5" + resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.5.tgz#ec10755e871497bcd83efe927e43ec46e8c0747e" + integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== + +"@types/node-forge@^1.3.0": + version "1.3.11" + resolved "https://registry.yarnpkg.com/@types/node-forge/-/node-forge-1.3.11.tgz#0972ea538ddb0f4d9c2fa0ec5db5724773a604da" + integrity sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ== + dependencies: + "@types/node" "*" "@types/node@*": - version "18.16.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.3.tgz#6bda7819aae6ea0b386ebc5b24bdf602f1b42b01" - integrity sha512-OPs5WnnT1xkCBiuQrZA4+YAV4HEJejmHneyraIaxsbev5yCEr6KMwINNFP9wQeFIw8FWcoTqF3vQsa5CDaI+8Q== + version "22.10.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.7.tgz#14a1ca33fd0ebdd9d63593ed8d3fbc882a6d28d7" + integrity sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg== + dependencies: + undici-types "~6.20.0" + +"@types/node@20.5.1": + version "20.5.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.1.tgz#178d58ee7e4834152b0e8b4d30cbfab578b9bb30" + integrity sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg== -"@types/node@^14.14.31": - version "14.18.43" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.43.tgz#679e000d9f1d914132ea295b4a1ffdf20370ec49" - integrity sha512-n3eFEaoem0WNwLux+k272P0+aq++5o05bA9CfiwKPdYPB5ZambWKdWoeHy7/OJiizMhzg27NLaZ6uzjLTzXceQ== +"@types/node@^16.18.39": + version "16.18.124" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.124.tgz#3485947880c049e643e06d9ca368e5a94b4ef92f" + integrity sha512-8ADCm5WzM/IpWxjs1Jhtwo6j+Fb8z4yr/CobP5beUUPdyCI0mg87/bqQYxNcqnhZ24Dc9RME8SQWu5eI/FmSGA== "@types/normalize-package-data@^2.4.0": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" - integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== + version "2.4.4" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" + integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA== "@types/parse-json@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" - integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" + integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw== "@types/q@^1.5.1": - version "1.5.5" - resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.5.tgz#75a2a8e7d8ab4b230414505d92335d1dcb53a6df" - integrity sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ== + version "1.5.8" + resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.8.tgz#95f6c6a08f2ad868ba230ead1d2d7f7be3db3837" + integrity sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw== "@types/qs@*": - version "6.9.7" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + version "6.9.18" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.18.tgz#877292caa91f7c1b213032b34626505b746624c2" + integrity sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA== "@types/range-parser@*": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" - integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + version "1.2.7" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.7.tgz#50ae4353eaaddc04044279812f52c8c65857dbcb" + integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== "@types/retry@0.12.0": version "0.12.0" @@ -1549,27 +1521,28 @@ integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== "@types/send@*": - version "0.17.1" - resolved "https://registry.yarnpkg.com/@types/send/-/send-0.17.1.tgz#ed4932b8a2a805f1fe362a70f4e62d0ac994e301" - integrity sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q== + version "0.17.4" + resolved "https://registry.yarnpkg.com/@types/send/-/send-0.17.4.tgz#6619cd24e7270793702e4e6a4b958a9010cfc57a" + integrity sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA== dependencies: "@types/mime" "^1" "@types/node" "*" "@types/serve-index@^1.9.1": - version "1.9.1" - resolved "https://registry.yarnpkg.com/@types/serve-index/-/serve-index-1.9.1.tgz#1b5e85370a192c01ec6cec4735cf2917337a6278" - integrity sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg== + version "1.9.4" + resolved "https://registry.yarnpkg.com/@types/serve-index/-/serve-index-1.9.4.tgz#e6ae13d5053cb06ed36392110b4f9a49ac4ec898" + integrity sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug== dependencies: "@types/express" "*" "@types/serve-static@*", "@types/serve-static@^1.13.10": - version "1.15.1" - resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.1.tgz#86b1753f0be4f9a1bee68d459fcda5be4ea52b5d" - integrity sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ== + version "1.15.7" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.7.tgz#22174bbd74fb97fe303109738e9b5c2f3064f714" + integrity sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw== dependencies: - "@types/mime" "*" + "@types/http-errors" "*" "@types/node" "*" + "@types/send" "*" "@types/sinonjs__fake-timers@8.1.1": version "8.1.1" @@ -1577,45 +1550,45 @@ integrity sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g== "@types/sizzle@^2.3.2": - version "2.3.3" - resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.3.tgz#ff5e2f1902969d305225a047c8a0fd5c915cebef" - integrity sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ== + version "2.3.9" + resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.9.tgz#d4597dbd4618264c414d7429363e3f50acb66ea2" + integrity sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w== "@types/sockjs@^0.3.33": - version "0.3.33" - resolved "https://registry.yarnpkg.com/@types/sockjs/-/sockjs-0.3.33.tgz#570d3a0b99ac995360e3136fd6045113b1bd236f" - integrity sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw== + version "0.3.36" + resolved "https://registry.yarnpkg.com/@types/sockjs/-/sockjs-0.3.36.tgz#ce322cf07bcc119d4cbf7f88954f3a3bd0f67535" + integrity sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q== dependencies: "@types/node" "*" "@types/webpack-env@^1.16.4": - version "1.18.0" - resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.18.0.tgz#ed6ecaa8e5ed5dfe8b2b3d00181702c9925f13fb" - integrity sha512-56/MAlX5WMsPVbOg7tAxnYvNYMMWr/QJiIp6BxVSW3JJXUVzzOn64qW8TzQyMSqSUFM2+PVI4aUHcHOzIz/1tg== + version "1.18.5" + resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.18.5.tgz#eccda0b04fe024bed505881e2e532f9c119169bf" + integrity sha512-wz7kjjRRj8/Lty4B+Kr0LN6Ypc/3SymeCCGSbaXp2leH0ZVg/PriNiOwNj4bD4uphI7A8NXS4b6Gl373sfO5mA== -"@types/ws@^8.5.1": - version "8.5.4" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.4.tgz#bb10e36116d6e570dd943735f86c933c1587b8a5" - integrity sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg== +"@types/ws@^8.5.5": + version "8.5.13" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.13.tgz#6414c280875e2691d0d1e080b05addbf5cb91e20" + integrity sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA== dependencies: "@types/node" "*" "@types/yargs-parser@*": - version "21.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" - integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== + version "21.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" + integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== "@types/yargs@^17.0.8": - version "17.0.24" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.24.tgz#b3ef8d50ad4aa6aecf6ddc97c580a00f5aa11902" - integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== + version "17.0.33" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.33.tgz#8c32303da83eec050a84b3c7ae7b9f922d13e32d" + integrity sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA== dependencies: "@types/yargs-parser" "*" "@types/yauzl@^2.9.1": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.0.tgz#b3248295276cf8c6f153ebe6a9aba0c988cb2599" - integrity sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw== + version "2.10.3" + resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.3.tgz#e9b2808b4f109504a03cda958259876f61017999" + integrity sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q== dependencies: "@types/node" "*" @@ -1631,141 +1604,141 @@ resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.1.5.tgz#74ee3aad995d0a3996a6bb9533d4d280514ede03" integrity sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA== -"@webassemblyjs/ast@1.11.5", "@webassemblyjs/ast@^1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.5.tgz#6e818036b94548c1fb53b754b5cae3c9b208281c" - integrity sha512-LHY/GSAZZRpsNQH+/oHqhRQ5FT7eoULcBqgfyTB5nQHogFnK3/7QoN7dLnwSE/JkUAF0SrRuclT7ODqMFtWxxQ== +"@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.14.1.tgz#a9f6a07f2b03c95c8d38c4536a1fdfb521ff55b6" + integrity sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ== dependencies: - "@webassemblyjs/helper-numbers" "1.11.5" - "@webassemblyjs/helper-wasm-bytecode" "1.11.5" + "@webassemblyjs/helper-numbers" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" -"@webassemblyjs/floating-point-hex-parser@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.5.tgz#e85dfdb01cad16b812ff166b96806c050555f1b4" - integrity sha512-1j1zTIC5EZOtCplMBG/IEwLtUojtwFVwdyVMbL/hwWqbzlQoJsWCOavrdnLkemwNoC/EOwtUFch3fuo+cbcXYQ== +"@webassemblyjs/floating-point-hex-parser@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz#fcca1eeddb1cc4e7b6eed4fc7956d6813b21b9fb" + integrity sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA== -"@webassemblyjs/helper-api-error@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.5.tgz#1e82fa7958c681ddcf4eabef756ce09d49d442d1" - integrity sha512-L65bDPmfpY0+yFrsgz8b6LhXmbbs38OnwDCf6NpnMUYqa+ENfE5Dq9E42ny0qz/PdR0LJyq/T5YijPnU8AXEpA== +"@webassemblyjs/helper-api-error@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz#e0a16152248bc38daee76dd7e21f15c5ef3ab1e7" + integrity sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ== -"@webassemblyjs/helper-buffer@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.5.tgz#91381652ea95bb38bbfd270702351c0c89d69fba" - integrity sha512-fDKo1gstwFFSfacIeH5KfwzjykIE6ldh1iH9Y/8YkAZrhmu4TctqYjSh7t0K2VyDSXOZJ1MLhht/k9IvYGcIxg== +"@webassemblyjs/helper-buffer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz#822a9bc603166531f7d5df84e67b5bf99b72b96b" + integrity sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA== -"@webassemblyjs/helper-numbers@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.5.tgz#23380c910d56764957292839006fecbe05e135a9" - integrity sha512-DhykHXM0ZABqfIGYNv93A5KKDw/+ywBFnuWybZZWcuzWHfbp21wUfRkbtz7dMGwGgT4iXjWuhRMA2Mzod6W4WA== +"@webassemblyjs/helper-numbers@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz#dbd932548e7119f4b8a7877fd5a8d20e63490b2d" + integrity sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA== dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.5" - "@webassemblyjs/helper-api-error" "1.11.5" + "@webassemblyjs/floating-point-hex-parser" "1.13.2" + "@webassemblyjs/helper-api-error" "1.13.2" "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.5.tgz#e258a25251bc69a52ef817da3001863cc1c24b9f" - integrity sha512-oC4Qa0bNcqnjAowFn7MPCETQgDYytpsfvz4ujZz63Zu/a/v71HeCAAmZsgZ3YVKec3zSPYytG3/PrRCqbtcAvA== +"@webassemblyjs/helper-wasm-bytecode@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz#e556108758f448aae84c850e593ce18a0eb31e0b" + integrity sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA== -"@webassemblyjs/helper-wasm-section@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.5.tgz#966e855a6fae04d5570ad4ec87fbcf29b42ba78e" - integrity sha512-uEoThA1LN2NA+K3B9wDo3yKlBfVtC6rh0i4/6hvbz071E8gTNZD/pT0MsBf7MeD6KbApMSkaAK0XeKyOZC7CIA== +"@webassemblyjs/helper-wasm-section@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz#9629dda9c4430eab54b591053d6dc6f3ba050348" + integrity sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw== dependencies: - "@webassemblyjs/ast" "1.11.5" - "@webassemblyjs/helper-buffer" "1.11.5" - "@webassemblyjs/helper-wasm-bytecode" "1.11.5" - "@webassemblyjs/wasm-gen" "1.11.5" + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/wasm-gen" "1.14.1" -"@webassemblyjs/ieee754@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.5.tgz#b2db1b33ce9c91e34236194c2b5cba9b25ca9d60" - integrity sha512-37aGq6qVL8A8oPbPrSGMBcp38YZFXcHfiROflJn9jxSdSMMM5dS5P/9e2/TpaJuhE+wFrbukN2WI6Hw9MH5acg== +"@webassemblyjs/ieee754@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz#1c5eaace1d606ada2c7fd7045ea9356c59ee0dba" + integrity sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw== dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.5.tgz#482e44d26b6b949edf042a8525a66c649e38935a" - integrity sha512-ajqrRSXaTJoPW+xmkfYN6l8VIeNnR4vBOTQO9HzR7IygoCcKWkICbKFbVTNMjMgMREqXEr0+2M6zukzM47ZUfQ== +"@webassemblyjs/leb128@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.13.2.tgz#57c5c3deb0105d02ce25fa3fd74f4ebc9fd0bbb0" + integrity sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw== dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.5.tgz#83bef94856e399f3740e8df9f63bc47a987eae1a" - integrity sha512-WiOhulHKTZU5UPlRl53gHR8OxdGsSOxqfpqWeA2FmcwBMaoEdz6b2x2si3IwC9/fSPLfe8pBMRTHVMk5nlwnFQ== - -"@webassemblyjs/wasm-edit@^1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.5.tgz#93ee10a08037657e21c70de31c47fdad6b522b2d" - integrity sha512-C0p9D2fAu3Twwqvygvf42iGCQ4av8MFBLiTb+08SZ4cEdwzWx9QeAHDo1E2k+9s/0w1DM40oflJOpkZ8jW4HCQ== - dependencies: - "@webassemblyjs/ast" "1.11.5" - "@webassemblyjs/helper-buffer" "1.11.5" - "@webassemblyjs/helper-wasm-bytecode" "1.11.5" - "@webassemblyjs/helper-wasm-section" "1.11.5" - "@webassemblyjs/wasm-gen" "1.11.5" - "@webassemblyjs/wasm-opt" "1.11.5" - "@webassemblyjs/wasm-parser" "1.11.5" - "@webassemblyjs/wast-printer" "1.11.5" - -"@webassemblyjs/wasm-gen@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.5.tgz#ceb1c82b40bf0cf67a492c53381916756ef7f0b1" - integrity sha512-14vteRlRjxLK9eSyYFvw1K8Vv+iPdZU0Aebk3j6oB8TQiQYuO6hj9s4d7qf6f2HJr2khzvNldAFG13CgdkAIfA== - dependencies: - "@webassemblyjs/ast" "1.11.5" - "@webassemblyjs/helper-wasm-bytecode" "1.11.5" - "@webassemblyjs/ieee754" "1.11.5" - "@webassemblyjs/leb128" "1.11.5" - "@webassemblyjs/utf8" "1.11.5" - -"@webassemblyjs/wasm-opt@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.5.tgz#b52bac29681fa62487e16d3bb7f0633d5e62ca0a" - integrity sha512-tcKwlIXstBQgbKy1MlbDMlXaxpucn42eb17H29rawYLxm5+MsEmgPzeCP8B1Cl69hCice8LeKgZpRUAPtqYPgw== - dependencies: - "@webassemblyjs/ast" "1.11.5" - "@webassemblyjs/helper-buffer" "1.11.5" - "@webassemblyjs/wasm-gen" "1.11.5" - "@webassemblyjs/wasm-parser" "1.11.5" - -"@webassemblyjs/wasm-parser@1.11.5", "@webassemblyjs/wasm-parser@^1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.5.tgz#7ba0697ca74c860ea13e3ba226b29617046982e2" - integrity sha512-SVXUIwsLQlc8srSD7jejsfTU83g7pIGr2YYNb9oHdtldSxaOhvA5xwvIiWIfcX8PlSakgqMXsLpLfbbJ4cBYew== - dependencies: - "@webassemblyjs/ast" "1.11.5" - "@webassemblyjs/helper-api-error" "1.11.5" - "@webassemblyjs/helper-wasm-bytecode" "1.11.5" - "@webassemblyjs/ieee754" "1.11.5" - "@webassemblyjs/leb128" "1.11.5" - "@webassemblyjs/utf8" "1.11.5" - -"@webassemblyjs/wast-printer@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.5.tgz#7a5e9689043f3eca82d544d7be7a8e6373a6fa98" - integrity sha512-f7Pq3wvg3GSPUPzR0F6bmI89Hdb+u9WXrSKc4v+N0aV0q6r42WoF92Jp2jEorBEBRoRNXgjp53nBniDXcqZYPA== - dependencies: - "@webassemblyjs/ast" "1.11.5" - "@xtuc/long" "4.2.2" +"@webassemblyjs/utf8@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.13.2.tgz#917a20e93f71ad5602966c2d685ae0c6c21f60f1" + integrity sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ== -"@webpack-cli/configtest@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.0.1.tgz#a69720f6c9bad6aef54a8fa6ba9c3533e7ef4c7f" - integrity sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A== +"@webassemblyjs/wasm-edit@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597" + integrity sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/helper-wasm-section" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-opt" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + "@webassemblyjs/wast-printer" "1.14.1" + +"@webassemblyjs/wasm-gen@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz#991e7f0c090cb0bb62bbac882076e3d219da9570" + integrity sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" -"@webpack-cli/info@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-2.0.1.tgz#eed745799c910d20081e06e5177c2b2569f166c0" - integrity sha512-fE1UEWTwsAxRhrJNikE7v4EotYflkEhBL7EbajfkPlf6E37/2QshOy/D48Mw8G5XMFlQtS6YV42vtbG9zBpIQA== +"@webassemblyjs/wasm-opt@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz#e6f71ed7ccae46781c206017d3c14c50efa8106b" + integrity sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" -"@webpack-cli/serve@^2.0.2": +"@webassemblyjs/wasm-parser@1.14.1", "@webassemblyjs/wasm-parser@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz#b3e13f1893605ca78b52c68e54cf6a865f90b9fb" + integrity sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-api-error" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wast-printer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz#3bb3e9638a8ae5fdaf9610e7a06b4d9f9aa6fe07" + integrity sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@xtuc/long" "4.2.2" + +"@webpack-cli/configtest@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.1.1.tgz#3b2f852e91dac6e3b85fb2a314fb8bef46d94646" + integrity sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw== + +"@webpack-cli/info@^2.0.2": version "2.0.2" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.2.tgz#10aa290e44a182c02e173a89452781b1acbc86d9" - integrity sha512-S9h3GmOmzUseyeFW3tYNnWS7gNUuwxZ3mmMq0JyW78Vx1SGKPSkt5bT4pB0rUnVfHjP0EL9gW2bOzmtiTfQt0A== + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-2.0.2.tgz#cc3fbf22efeb88ff62310cf885c5b09f44ae0fdd" + integrity sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A== + +"@webpack-cli/serve@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e" + integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -1777,7 +1750,7 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -JSONStream@^1.0.4: +JSONStream@^1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== @@ -1785,7 +1758,7 @@ JSONStream@^1.0.4: jsonparse "^1.2.0" through ">=2.2.7 <3" -accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: +accepts@~1.3.4, accepts@~1.3.8: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== @@ -1793,20 +1766,17 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: mime-types "~2.1.34" negotiator "0.6.3" -acorn-import-assertions@^1.7.6: - version "1.8.0" - resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" - integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== - acorn-walk@^8.1.1: - version "8.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + version "8.3.4" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" + integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== + dependencies: + acorn "^8.11.0" -acorn@^8.0.5, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1: - version "8.8.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" - integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== +acorn@^8.0.5, acorn@^8.11.0, acorn@^8.14.0, acorn@^8.4.1, acorn@^8.8.2: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== adjust-sourcemap-loader@^4.0.0: version "4.0.0" @@ -1843,7 +1813,7 @@ ajv-keywords@^5.1.0: dependencies: fast-deep-equal "^3.1.3" -ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1854,19 +1824,19 @@ ajv@^6.12.4, ajv@^6.12.5: uri-js "^4.2.2" ajv@^8.0.0, ajv@^8.0.1, ajv@^8.11.0, ajv@^8.9.0: - version "8.12.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" - integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== + version "8.17.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== dependencies: - fast-deep-equal "^3.1.1" + fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" json-schema-traverse "^1.0.0" require-from-string "^2.0.2" - uri-js "^4.2.2" alpinejs@^3.12.0: - version "3.12.1" - resolved "https://registry.yarnpkg.com/alpinejs/-/alpinejs-3.12.1.tgz#97c1b975e68fb7c5dcd601cb58130ce163c5fc5d" - integrity sha512-GjEmZscHuCPv/XRbzabQLFH3I1+M3TbZqEsLDuYai/Yw+pE1IL7DK4ejRfqBSaysi4wWZ1k5IqVG2aefhWWqsQ== + version "3.14.8" + resolved "https://registry.yarnpkg.com/alpinejs/-/alpinejs-3.14.8.tgz#062de45daa219db14375b3cb35ba28e5b0627337" + integrity sha512-wT2fuP2DXpGk/jKaglwy7S/IJpm1FD+b7U6zUrhwErjoq5h27S4dxkJEXVvhbdwyPv9U+3OkUuNLkZT4h2Kfrg== dependencies: "@vue/reactivity" "~3.1.1" @@ -1893,9 +1863,9 @@ ansi-regex@^5.0.1: integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-regex@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" - integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + version "6.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.1.0.tgz#95ec409c69619d6cb1b8b34f14b660ef28ebd654" + integrity sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA== ansi-styles@^3.2.1: version "3.2.1" @@ -1956,24 +1926,19 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -array-buffer-byte-length@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" - integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== +array-buffer-byte-length@^1.0.1, array-buffer-byte-length@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz#384d12a37295aec3769ab022ad323a18a51ccf8b" + integrity sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw== dependencies: - call-bind "^1.0.2" - is-array-buffer "^3.0.1" + call-bound "^1.0.3" + is-array-buffer "^3.0.5" array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== -array-flatten@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" - integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== - array-ify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" @@ -1996,17 +1961,32 @@ array-uniq@^1.0.1: resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== -array.prototype.reduce@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz#6b20b0daa9d9734dd6bc7ea66b5bbce395471eac" - integrity sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q== +array.prototype.reduce@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.7.tgz#6aadc2f995af29cb887eb866d981dc85ab6f7dc7" + integrity sha512-mzmiUCVwtiD4lgxYP8g7IYy8El8p2CSMePvIbTS7gchKir/L1fgJrk0yDKmAX6mnRQFKNADYIk8nNlTris5H1Q== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" es-array-method-boxes-properly "^1.0.0" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" is-string "^1.0.7" +arraybuffer.prototype.slice@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz#9d760d84dbdd06d0cbf92c8849615a1a7ab3183c" + integrity sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ== + dependencies: + array-buffer-byte-length "^1.0.1" + call-bind "^1.0.8" + define-properties "^1.2.1" + es-abstract "^1.23.5" + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + is-array-buffer "^3.0.4" + arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -2039,9 +2019,9 @@ astral-regex@^2.0.0: integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== async@^3.2.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" - integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ== + version "3.2.6" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.6.tgz#1b0728e14929d51b85b449b7f06e27c1145e38ce" + integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA== asynckit@^0.4.0: version "0.4.0" @@ -2054,21 +2034,23 @@ at-least-node@^1.0.0: integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== autoprefixer@^10.4.0: - version "10.4.14" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.14.tgz#e28d49902f8e759dd25b153264e862df2705f79d" - integrity sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ== + version "10.4.20" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.20.tgz#5caec14d43976ef42e32dcb4bd62878e96be5b3b" + integrity sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g== dependencies: - browserslist "^4.21.5" - caniuse-lite "^1.0.30001464" - fraction.js "^4.2.0" + browserslist "^4.23.3" + caniuse-lite "^1.0.30001646" + fraction.js "^4.3.7" normalize-range "^0.1.2" - picocolors "^1.0.0" + picocolors "^1.0.1" postcss-value-parser "^4.2.0" -available-typed-arrays@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" - integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== +available-typed-arrays@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" + integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== + dependencies: + possible-typed-array-names "^1.0.0" aws-sign2@~0.7.0: version "0.7.0" @@ -2076,52 +2058,50 @@ aws-sign2@~0.7.0: integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== aws4@^1.8.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" - integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== + version "1.13.2" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.13.2.tgz#0aa167216965ac9474ccfa83892cfb6b3e1e52ef" + integrity sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw== axios@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.4.0.tgz#38a7bf1224cd308de271146038b551d725f0be1f" - integrity sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA== + version "1.7.9" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.9.tgz#d7d071380c132a24accda1b2cfc1535b79ec650a" + integrity sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw== dependencies: - follow-redirects "^1.15.0" + follow-redirects "^1.15.6" form-data "^4.0.0" proxy-from-env "^1.1.0" -babel-loader@^8.2.5: - version "8.3.0" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.3.0.tgz#124936e841ba4fe8176786d6ff28add1f134d6a8" - integrity sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q== +babel-loader@^9.1.3: + version "9.2.1" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-9.2.1.tgz#04c7835db16c246dd19ba0914418f3937797587b" + integrity sha512-fqe8naHt46e0yIdkjUZYqddSXfej3AHajX+CSO5X7oy0EmPc6o5Xh+RClNoHjnieWz9AW4kZxW9yyFMhVB1QLA== dependencies: - find-cache-dir "^3.3.1" - loader-utils "^2.0.0" - make-dir "^3.1.0" - schema-utils "^2.6.5" + find-cache-dir "^4.0.0" + schema-utils "^4.0.0" -babel-plugin-polyfill-corejs2@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" - integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q== +babel-plugin-polyfill-corejs2@^0.4.10: + version "0.4.12" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.12.tgz#ca55bbec8ab0edeeef3d7b8ffd75322e210879a9" + integrity sha512-CPWT6BwvhrTO2d8QVorhTCQw9Y43zOu7G9HigcfxvepOU6b8o3tcWad6oVgZIsZCTt42FFv97aA7ZJsbM4+8og== dependencies: - "@babel/compat-data" "^7.17.7" - "@babel/helper-define-polyfill-provider" "^0.3.3" - semver "^6.1.1" + "@babel/compat-data" "^7.22.6" + "@babel/helper-define-polyfill-provider" "^0.6.3" + semver "^6.3.1" -babel-plugin-polyfill-corejs3@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz#56ad88237137eade485a71b52f72dbed57c6230a" - integrity sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA== +babel-plugin-polyfill-corejs3@^0.10.6: + version "0.10.6" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz#2deda57caef50f59c525aeb4964d3b2f867710c7" + integrity sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.3" - core-js-compat "^3.25.1" + "@babel/helper-define-polyfill-provider" "^0.6.2" + core-js-compat "^3.38.0" -babel-plugin-polyfill-regenerator@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747" - integrity sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw== +babel-plugin-polyfill-regenerator@^0.6.1: + version "0.6.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.3.tgz#abeb1f3f1c762eace37587f42548b08b57789bc8" + integrity sha512-LiWSbl4CRSIa5x/JAU6jZiG9eit9w6mz+yVMFwDE83LAWvt0AfGBoZ7HS/mkhrKuh2ZlzfVZYKoLjXdqw6Yt7Q== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.3" + "@babel/helper-define-polyfill-provider" "^0.6.3" balanced-match@^1.0.0: version "1.0.2" @@ -2156,9 +2136,9 @@ big.js@^5.2.2: integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + version "2.3.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== blob-util@^2.0.2: version "2.0.2" @@ -2170,31 +2150,29 @@ bluebird@^3.7.2: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== +body-parser@1.20.3: + version "1.20.3" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" + integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== dependencies: bytes "3.1.2" - content-type "~1.0.4" + content-type "~1.0.5" debug "2.6.9" depd "2.0.0" destroy "1.2.0" http-errors "2.0.0" iconv-lite "0.4.24" on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.1" + qs "6.13.0" + raw-body "2.5.2" type-is "~1.6.18" unpipe "1.0.0" bonjour-service@^1.0.11: - version "1.1.1" - resolved "https://registry.yarnpkg.com/bonjour-service/-/bonjour-service-1.1.1.tgz#960948fa0e0153f5d26743ab15baf8e33752c135" - integrity sha512-Z/5lQRMOG9k7W+FkeGTNjh7htqn/2LMnfOvBZ8pynNZCM9MwkQkI3zeI4oz09uWdcgmgHugVvBqxGg4VQJ5PCg== + version "1.3.0" + resolved "https://registry.yarnpkg.com/bonjour-service/-/bonjour-service-1.3.0.tgz#80d867430b5a0da64e82a8047fc1e355bdb71722" + integrity sha512-3YuAUiSkWykd+2Azjgyxei8OWf8thdn8AITIog2M4UICzoqfjlqr64WIjEXZllf/W6vK1goqleSR6brGomxQqA== dependencies: - array-flatten "^2.1.2" - dns-equal "^1.0.0" fast-deep-equal "^3.1.3" multicast-dns "^7.2.5" @@ -2218,22 +2196,22 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" -braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== +braces@^3.0.2, braces@^3.0.3, braces@~3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: - fill-range "^7.0.1" + fill-range "^7.1.1" -browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.21.3, browserslist@^4.21.4, browserslist@^4.21.5: - version "4.21.5" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7" - integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w== +browserslist@^4.0.0, browserslist@^4.23.0, browserslist@^4.23.3, browserslist@^4.24.0, browserslist@^4.24.3: + version "4.24.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b" + integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== dependencies: - caniuse-lite "^1.0.30001449" - electron-to-chromium "^1.4.284" - node-releases "^2.0.8" - update-browserslist-db "^1.0.10" + caniuse-lite "^1.0.30001688" + electron-to-chromium "^1.5.73" + node-releases "^2.0.19" + update-browserslist-db "^1.1.1" buffer-crc32@~0.2.3: version "0.2.13" @@ -2253,28 +2231,41 @@ buffer@^5.6.0: base64-js "^1.3.1" ieee754 "^1.1.13" -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw== - bytes@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== cachedir@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8" - integrity sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw== + version "2.4.0" + resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.4.0.tgz#7fef9cf7367233d7c88068fe6e34ed0d355a610d" + integrity sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ== -call-bind@^1.0.0, call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== +call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz#32e5892e6361b29b0b545ba6f7763378daca2840" + integrity sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + +call-bind@^1.0.7, call-bind@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" + integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" + call-bind-apply-helpers "^1.0.0" + es-define-property "^1.0.0" + get-intrinsic "^1.2.4" + set-function-length "^1.2.2" + +call-bound@^1.0.2, call-bound@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.3.tgz#41cfd032b593e39176a71533ab4f384aa04fd681" + integrity sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA== + dependencies: + call-bind-apply-helpers "^1.0.1" + get-intrinsic "^1.2.6" callsites@^3.0.0: version "3.1.0" @@ -2315,17 +2306,17 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001449, caniuse-lite@^1.0.30001464: - version "1.0.30001482" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001482.tgz#8b3fad73dc35b2674a5c96df2d4f9f1c561435de" - integrity sha512-F1ZInsg53cegyjroxLNW9DmrEQ1SuGRTO1QlpA0o2/6OpQ0gFeDRoq1yFmnr8Sakn9qwwt9DmbxHB6w167OSuQ== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001646, caniuse-lite@^1.0.30001688: + version "1.0.30001692" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001692.tgz#4585729d95e6b95be5b439da6ab55250cd125bf9" + integrity sha512-A95VKan0kdtrsnMubMKxEKUKImOPSuCpYgxSQBo036P5YYgVIcOYJEgt/txJWqObiRQeISNCfef9nvlQ0vbV7A== caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== -chalk@^2.0.0, chalk@^2.3.2, chalk@^2.4.1: +chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -2347,10 +2338,10 @@ check-more-types@^2.24.0: resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== -"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.3: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== +chokidar@^3.5.3, chokidar@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== dependencies: anymatch "~3.1.2" braces "~3.0.2" @@ -2362,15 +2353,22 @@ check-more-types@^2.24.0: optionalDependencies: fsevents "~2.3.2" +chokidar@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-4.0.3.tgz#7be37a4c03c9aee1ecfe862a4a23b2c70c205d30" + integrity sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA== + dependencies: + readdirp "^4.0.1" + chrome-trace-event@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" - integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== + version "1.0.4" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz#05bffd7ff928465093314708c93bdfa9bd1f0f5b" + integrity sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ== ci-info@^3.2.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" - integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== + version "3.9.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== clean-stack@^2.0.0: version "2.2.0" @@ -2392,9 +2390,9 @@ cli-cursor@^3.1.0: restore-cursor "^3.1.0" cli-table3@~0.6.1: - version "0.6.3" - resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2" - integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg== + version "0.6.5" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.5.tgz#013b91351762739c16a9567c21a04632e449bf2f" + integrity sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ== dependencies: string-width "^4.2.0" optionalDependencies: @@ -2459,7 +2457,7 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colord@^2.9.1, colord@^2.9.3: +colord@^2.9.3: version "2.9.3" resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.3.tgz#4f8ce919de456f1d5c1c368c307fe20f3e59fb43" integrity sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw== @@ -2501,16 +2499,16 @@ commander@^7.2.0: resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== +common-path-prefix@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0" + integrity sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w== + common-tags@^1.8.0: version "1.8.2" resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6" integrity sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA== -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== - compare-func@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3" @@ -2519,7 +2517,7 @@ compare-func@^2.0.0: array-ify "^1.0.0" dot-prop "^5.1.0" -compressible@~2.0.16: +compressible@~2.0.18: version "2.0.18" resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg== @@ -2527,16 +2525,16 @@ compressible@~2.0.16: mime-db ">= 1.43.0 < 2" compression@^1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f" - integrity sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ== + version "1.7.5" + resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.5.tgz#fdd256c0a642e39e314c478f6c2cd654edd74c93" + integrity sha512-bQJ0YRck5ak3LgtnpKkiabX5pNF7tMUh1BSy2ZBOTh0Dim0BUu6aPPwByIns6/A5Prh8PufSPerMDUklpzes2Q== dependencies: - accepts "~1.3.5" - bytes "3.0.0" - compressible "~2.0.16" + bytes "3.1.2" + compressible "~2.0.18" debug "2.6.9" + negotiator "~0.6.4" on-headers "~1.0.2" - safe-buffer "5.1.2" + safe-buffer "5.2.1" vary "~1.1.2" concat-map@0.0.1: @@ -2549,10 +2547,10 @@ connect-history-api-fallback@^2.0.0: resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz#647264845251a0daf25b97ce87834cace0f5f1c8" integrity sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA== -consola@^2.6.0: - version "2.15.3" - resolved "https://registry.yarnpkg.com/consola/-/consola-2.15.3.tgz#2e11f98d6a4be71ff72e0bdf07bd23e12cb61550" - integrity sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw== +consola@^3.2.3: + version "3.4.0" + resolved "https://registry.yarnpkg.com/consola/-/consola-3.4.0.tgz#4cfc9348fd85ed16a17940b3032765e31061ab88" + integrity sha512-EiPU8G6dQG0GFHNR8ljnZFki/8a+cQwEQ+7wpxdChl02Q8HXlwEZWD5lqAF8vC2sEC3Tehr8hy7vErz88LHyUA== content-disposition@0.5.4: version "0.5.4" @@ -2561,66 +2559,66 @@ content-disposition@0.5.4: dependencies: safe-buffer "5.2.1" -content-type@~1.0.4: +content-type@~1.0.4, content-type@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== -conventional-changelog-angular@^5.0.11: - version "5.0.13" - resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz#896885d63b914a70d4934b59d2fe7bde1832b28c" - integrity sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA== +conventional-changelog-angular@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-6.0.0.tgz#a9a9494c28b7165889144fd5b91573c4aa9ca541" + integrity sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg== dependencies: compare-func "^2.0.0" - q "^1.5.1" -conventional-changelog-conventionalcommits@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-5.0.0.tgz#41bdce54eb65a848a4a3ffdca93e92fa22b64a86" - integrity sha512-lCDbA+ZqVFQGUj7h9QBKoIpLhl8iihkO0nCTyRNzuXtcd7ubODpYB04IFy31JloiJgG0Uovu8ot8oxRzn7Nwtw== +conventional-changelog-conventionalcommits@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-6.1.0.tgz#3bad05f4eea64e423d3d90fc50c17d2c8cf17652" + integrity sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw== dependencies: compare-func "^2.0.0" - lodash "^4.17.15" - q "^1.5.1" -conventional-commits-parser@^3.2.2: - version "3.2.4" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz#a7d3b77758a202a9b2293d2112a8d8052c740972" - integrity sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q== +conventional-commits-parser@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-4.0.0.tgz#02ae1178a381304839bce7cea9da5f1b549ae505" + integrity sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg== dependencies: - JSONStream "^1.0.4" + JSONStream "^1.3.5" is-text-path "^1.0.1" - lodash "^4.17.15" - meow "^8.0.0" - split2 "^3.0.0" - through2 "^4.0.0" + meow "^8.1.2" + split2 "^3.2.2" convert-source-map@^1.7.0: version "1.9.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== +cookie@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" + integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== -core-js-compat@^3.25.1: - version "3.30.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.30.1.tgz#961541e22db9c27fc48bfc13a3cafa8734171dfe" - integrity sha512-d690npR7MC6P0gq4npTl5n2VQeNAmUrJ90n+MHiKS7W2+xno4o3F5GDEuylSdi6EJ3VssibSGXOa1r3YXD3Mhw== +core-js-compat@^3.38.0, core-js-compat@^3.38.1: + version "3.40.0" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.40.0.tgz#7485912a5a4a4315c2fdb2cbdc623e6881c88b38" + integrity sha512-0XEDpr5y5mijvw8Lbc6E5AkjrHfp7eEoPlu36SWeAbcL8fn1G1ANe8DBlo2XoNN89oVpxWwOjYIPVzR4ZvsKCQ== dependencies: - browserslist "^4.21.5" + browserslist "^4.24.3" core-js@^3.23.0: - version "3.30.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.30.1.tgz#fc9c5adcc541d8e9fa3e381179433cbf795628ba" - integrity sha512-ZNS5nbiSwDTq4hFosEDqm65izl2CWmLz0hARJMyNQBgkUZMIF51cQiMvIQKA6hvuaeWxQDP3hEedM1JZIgTldQ== + version "3.40.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.40.0.tgz#2773f6b06877d8eda102fc42f828176437062476" + integrity sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ== core-util-is@1.0.2: version "1.0.2" @@ -2633,9 +2631,9 @@ core-util-is@~1.0.0: integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== cosmiconfig-typescript-loader@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.3.0.tgz#c4259ce474c9df0f32274ed162c0447c951ef073" - integrity sha512-NTxV1MFfZDLPiBMjxbHRwSh5LaLcPMwNdCutmnHJCKoVnlvldPWlllonKwrsRJ5pYZBIBGRWWU2tfvzxgeSW5Q== + version "4.4.0" + resolved "https://registry.yarnpkg.com/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.4.0.tgz#f3feae459ea090f131df5474ce4b1222912319f9" + integrity sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw== cosmiconfig@^7.1.0: version "7.1.0" @@ -2648,24 +2646,14 @@ cosmiconfig@^7.1.0: path-type "^4.0.0" yaml "^1.10.0" -cosmiconfig@^8.0.0: - version "8.1.3" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.1.3.tgz#0e614a118fcc2d9e5afc2f87d53cd09931015689" - integrity sha512-/UkO2JKI18b5jVMJUp0lvKFMpa/Gye+ZgZjKD+DGEN9y7NRcf/nK1A0sp67ONmKtnDCNMS44E6jrk0Yc3bDuUw== - dependencies: - import-fresh "^3.2.1" - js-yaml "^4.1.0" - parse-json "^5.0.0" - path-type "^4.0.0" - -cosmiconfig@^8.1.3: - version "8.2.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.2.0.tgz#f7d17c56a590856cd1e7cee98734dca272b0d8fd" - integrity sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ== +cosmiconfig@^8.0.0, cosmiconfig@^8.3.5: + version "8.3.6" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.3.6.tgz#060a2b871d66dba6c8538ea1118ba1ac16f5fae3" + integrity sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA== dependencies: - import-fresh "^3.2.1" + import-fresh "^3.3.0" js-yaml "^4.1.0" - parse-json "^5.0.0" + parse-json "^5.2.0" path-type "^4.0.0" create-require@^1.1.0: @@ -2681,49 +2669,49 @@ cross-env@^7.0.3: cross-spawn "^7.0.1" cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" which "^2.0.1" -css-declaration-sorter@^6.3.1: - version "6.4.0" - resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-6.4.0.tgz#630618adc21724484b3e9505bce812def44000ad" - integrity sha512-jDfsatwWMWN0MODAFuHszfjphEXfNw9JUAhmY4pLu3TyTU+ohUpsbVtbU+1MZn4a47D9kqh03i4eyOm+74+zew== +css-declaration-sorter@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-7.2.0.tgz#6dec1c9523bc4a643e088aab8f09e67a54961024" + integrity sha512-h70rUM+3PNFuaBDTLe8wF/cdWu+dOZmb7pJt8Z2sedYbAcQVQV/tEchueg3GWxwqS0cxtbxmaHEdkNACqcvsow== css-functions-list@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/css-functions-list/-/css-functions-list-3.2.0.tgz#8290b7d064bf483f48d6559c10e98dc4d1ad19ee" - integrity sha512-d/jBMPyYybkkLVypgtGv12R+pIFw4/f/IHtCTxWpZc8ofTYOPigIgmA6vu5rMHartZC+WuXhBUHfnyNUIQSYrg== + version "3.2.3" + resolved "https://registry.yarnpkg.com/css-functions-list/-/css-functions-list-3.2.3.tgz#95652b0c24f0f59b291a9fc386041a19d4f40dbe" + integrity sha512-IQOkD3hbR5KrN93MtcYuad6YPuTSUhntLHDuLEbFWE+ff2/XSZNdZG+LcbbIW5AXKg/WFIfYItIzVoHngHXZzA== css-loader@^6.7.0: - version "6.7.3" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.7.3.tgz#1e8799f3ccc5874fdd55461af51137fcc5befbcd" - integrity sha512-qhOH1KlBMnZP8FzRO6YCH9UHXQhVMcEGLyNdb7Hv2cpcmJbW0YrddO+tG1ab5nT41KpHIYGsbeHqxB9xPu1pKQ== + version "6.11.0" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.11.0.tgz#33bae3bf6363d0a7c2cf9031c96c744ff54d85ba" + integrity sha512-CTJ+AEQJjq5NzLga5pE39qdiSV56F8ywCIsqNIRF0r7BDgWsN25aazToqAFg7ZrtA/U016xudB3ffgweORxX7g== dependencies: icss-utils "^5.1.0" - postcss "^8.4.19" - postcss-modules-extract-imports "^3.0.0" - postcss-modules-local-by-default "^4.0.0" - postcss-modules-scope "^3.0.0" + postcss "^8.4.33" + postcss-modules-extract-imports "^3.1.0" + postcss-modules-local-by-default "^4.0.5" + postcss-modules-scope "^3.2.0" postcss-modules-values "^4.0.0" postcss-value-parser "^4.2.0" - semver "^7.3.8" + semver "^7.5.4" -css-minimizer-webpack-plugin@^4.0.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-4.2.2.tgz#79f6199eb5adf1ff7ba57f105e3752d15211eb35" - integrity sha512-s3Of/4jKfw1Hj9CxEO1E5oXhQAxlayuHO2y/ML+C6I9sQ7FdzfEV6QgMLN3vI+qFsjJGIAFLKtQK7t8BOXAIyA== - dependencies: - cssnano "^5.1.8" - jest-worker "^29.1.2" - postcss "^8.4.17" - schema-utils "^4.0.0" - serialize-javascript "^6.0.0" - source-map "^0.6.1" +css-minimizer-webpack-plugin@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-5.0.1.tgz#33effe662edb1a0bf08ad633c32fa75d0f7ec565" + integrity sha512-3caImjKFQkS+ws1TGcFn0V1HyDJFq1Euy589JlD6/3rV2kj+w7r5G9WDMgSHvpvXHNZ2calVypZWuEDQd9wfLg== + dependencies: + "@jridgewell/trace-mapping" "^0.3.18" + cssnano "^6.0.1" + jest-worker "^29.4.3" + postcss "^8.4.24" + schema-utils "^4.0.1" + serialize-javascript "^6.0.1" css-select-base-adapter@^0.1.1: version "0.1.1" @@ -2751,6 +2739,17 @@ css-select@^4.1.3: domutils "^2.8.0" nth-check "^2.0.1" +css-select@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-5.1.0.tgz#b8ebd6554c3637ccc76688804ad3f6a6fdaea8a6" + integrity sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg== + dependencies: + boolbase "^1.0.0" + css-what "^6.1.0" + domhandler "^5.0.2" + domutils "^3.0.1" + nth-check "^2.0.1" + css-tree@1.0.0-alpha.37: version "1.0.0-alpha.37" resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.37.tgz#98bebd62c4c1d9f960ec340cf9f7522e30709a22" @@ -2759,7 +2758,7 @@ css-tree@1.0.0-alpha.37: mdn-data "2.0.4" source-map "^0.6.1" -css-tree@^1.1.2, css-tree@^1.1.3: +css-tree@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d" integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q== @@ -2767,12 +2766,28 @@ css-tree@^1.1.2, css-tree@^1.1.3: mdn-data "2.0.14" source-map "^0.6.1" +css-tree@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-2.3.1.tgz#10264ce1e5442e8572fc82fbe490644ff54b5c20" + integrity sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw== + dependencies: + mdn-data "2.0.30" + source-map-js "^1.0.1" + +css-tree@~2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-2.2.1.tgz#36115d382d60afd271e377f9c5f67d02bd48c032" + integrity sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA== + dependencies: + mdn-data "2.0.28" + source-map-js "^1.0.1" + css-what@^3.2.1: version "3.4.2" resolved "https://registry.yarnpkg.com/css-what/-/css-what-3.4.2.tgz#ea7026fcb01777edbde52124e21f327e7ae950e4" integrity sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ== -css-what@^6.0.1: +css-what@^6.0.1, css-what@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== @@ -2782,75 +2797,82 @@ cssesc@^3.0.0: resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -cssnano-preset-default@^5.2.14: - version "5.2.14" - resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.2.14.tgz#309def4f7b7e16d71ab2438052093330d9ab45d8" - integrity sha512-t0SFesj/ZV2OTylqQVOrFgEh5uanxbO6ZAdeCrNsUQ6fVuXwYTxJPNAGvGTxHbD68ldIJNec7PyYZDBrfDQ+6A== - dependencies: - css-declaration-sorter "^6.3.1" - cssnano-utils "^3.1.0" - postcss-calc "^8.2.3" - postcss-colormin "^5.3.1" - postcss-convert-values "^5.1.3" - postcss-discard-comments "^5.1.2" - postcss-discard-duplicates "^5.1.0" - postcss-discard-empty "^5.1.1" - postcss-discard-overridden "^5.1.0" - postcss-merge-longhand "^5.1.7" - postcss-merge-rules "^5.1.4" - postcss-minify-font-values "^5.1.0" - postcss-minify-gradients "^5.1.1" - postcss-minify-params "^5.1.4" - postcss-minify-selectors "^5.2.1" - postcss-normalize-charset "^5.1.0" - postcss-normalize-display-values "^5.1.0" - postcss-normalize-positions "^5.1.1" - postcss-normalize-repeat-style "^5.1.1" - postcss-normalize-string "^5.1.0" - postcss-normalize-timing-functions "^5.1.0" - postcss-normalize-unicode "^5.1.1" - postcss-normalize-url "^5.1.0" - postcss-normalize-whitespace "^5.1.1" - postcss-ordered-values "^5.1.3" - postcss-reduce-initial "^5.1.2" - postcss-reduce-transforms "^5.1.0" - postcss-svgo "^5.1.0" - postcss-unique-selectors "^5.1.1" - -cssnano-utils@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-3.1.0.tgz#95684d08c91511edfc70d2636338ca37ef3a6861" - integrity sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA== +cssnano-preset-default@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-6.1.2.tgz#adf4b89b975aa775f2750c89dbaf199bbd9da35e" + integrity sha512-1C0C+eNaeN8OcHQa193aRgYexyJtU8XwbdieEjClw+J9d94E41LwT6ivKH0WT+fYwYWB0Zp3I3IZ7tI/BbUbrg== + dependencies: + browserslist "^4.23.0" + css-declaration-sorter "^7.2.0" + cssnano-utils "^4.0.2" + postcss-calc "^9.0.1" + postcss-colormin "^6.1.0" + postcss-convert-values "^6.1.0" + postcss-discard-comments "^6.0.2" + postcss-discard-duplicates "^6.0.3" + postcss-discard-empty "^6.0.3" + postcss-discard-overridden "^6.0.2" + postcss-merge-longhand "^6.0.5" + postcss-merge-rules "^6.1.1" + postcss-minify-font-values "^6.1.0" + postcss-minify-gradients "^6.0.3" + postcss-minify-params "^6.1.0" + postcss-minify-selectors "^6.0.4" + postcss-normalize-charset "^6.0.2" + postcss-normalize-display-values "^6.0.2" + postcss-normalize-positions "^6.0.2" + postcss-normalize-repeat-style "^6.0.2" + postcss-normalize-string "^6.0.2" + postcss-normalize-timing-functions "^6.0.2" + postcss-normalize-unicode "^6.1.0" + postcss-normalize-url "^6.0.2" + postcss-normalize-whitespace "^6.0.2" + postcss-ordered-values "^6.0.2" + postcss-reduce-initial "^6.1.0" + postcss-reduce-transforms "^6.0.2" + postcss-svgo "^6.0.3" + postcss-unique-selectors "^6.0.4" + +cssnano-utils@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-4.0.2.tgz#56f61c126cd0f11f2eef1596239d730d9fceff3c" + integrity sha512-ZR1jHg+wZ8o4c3zqf1SIUSTIvm/9mU343FMR6Obe/unskbvpGhZOo1J6d/r8D1pzkRQYuwbcH3hToOuoA2G7oQ== -cssnano@^5.1.8: - version "5.1.15" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.1.15.tgz#ded66b5480d5127fcb44dac12ea5a983755136bf" - integrity sha512-j+BKgDcLDQA+eDifLx0EO4XSA56b7uut3BQFH+wbSaSTuGLuiyTa/wbRYthUXX8LC9mLg+WWKe8h+qJuwTAbHw== +cssnano@^6.0.1: + version "6.1.2" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-6.1.2.tgz#4bd19e505bd37ee7cf0dc902d3d869f6d79c66b8" + integrity sha512-rYk5UeX7VAM/u0lNqewCdasdtPK81CgX8wJFLEIXHbV2oldWRgJAsZrdhRXkV1NJzA2g850KiFm9mMU2HxNxMA== dependencies: - cssnano-preset-default "^5.2.14" - lilconfig "^2.0.3" - yaml "^1.10.2" + cssnano-preset-default "^6.1.2" + lilconfig "^3.1.1" -csso@^4.0.2, csso@^4.2.0: +csso@^4.0.2: version "4.2.0" resolved "https://registry.yarnpkg.com/csso/-/csso-4.2.0.tgz#ea3a561346e8dc9f546d6febedd50187cf389529" integrity sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA== dependencies: css-tree "^1.1.2" +csso@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/csso/-/csso-5.0.5.tgz#f9b7fe6cc6ac0b7d90781bb16d5e9874303e2ca6" + integrity sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ== + dependencies: + css-tree "~2.2.0" + cypress-wait-until@^1.7.2: version "1.7.2" resolved "https://registry.yarnpkg.com/cypress-wait-until/-/cypress-wait-until-1.7.2.tgz#7f534dd5a11c89b65359e7a0210f20d3dfc22107" integrity sha512-uZ+M8/MqRcpf+FII/UZrU7g1qYZ4aVlHcgyVopnladyoBrpoaMJ4PKZDrdOJ05H5RHbr7s9Tid635X3E+ZLU/Q== cypress@^12.11.0: - version "12.11.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.11.0.tgz#b46dc6a1d0387f59a4b5c6a18cc03884fd61876e" - integrity sha512-TJE+CCWI26Hwr5Msb9GpQhFLubdYooW0fmlPwTsfiyxmngqc7+SZGLPeIkj2dTSSZSEtpQVzOzvcnzH0o8G7Vw== + version "12.17.4" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.4.tgz#b4dadf41673058493fa0d2362faa3da1f6ae2e6c" + integrity sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ== dependencies: - "@cypress/request" "^2.88.10" + "@cypress/request" "2.88.12" "@cypress/xvfb" "^1.2.4" - "@types/node" "^14.14.31" + "@types/node" "^16.18.39" "@types/sinonjs__fake-timers" "8.1.1" "@types/sizzle" "^2.3.2" arch "^2.2.0" @@ -2883,9 +2905,10 @@ cypress@^12.11.0: minimist "^1.2.8" ospath "^1.2.2" pretty-bytes "^5.6.0" + process "^0.11.10" proxy-from-env "1.0.0" request-progress "^3.0.0" - semver "^7.3.2" + semver "^7.5.3" supports-color "^8.1.1" tmp "~0.2.1" untildify "^4.0.0" @@ -2903,25 +2926,52 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +data-view-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.2.tgz#211a03ba95ecaf7798a8c7198d79536211f88570" + integrity sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + is-data-view "^1.0.2" + +data-view-byte-length@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz#9e80f7ca52453ce3e93d25a35318767ea7704735" + integrity sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + is-data-view "^1.0.2" + +data-view-byte-offset@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz#068307f9b71ab76dbbe10291389e020856606191" + integrity sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + is-data-view "^1.0.1" + datatables.net-dt@^1.11.5: - version "1.13.4" - resolved "https://registry.yarnpkg.com/datatables.net-dt/-/datatables.net-dt-1.13.4.tgz#ec32d22a02772ee6dda2677032cb6b24f3f5e4d0" - integrity sha512-QAvuEej/qKSiaSmSeDQ36wWO72XzFGKkd0jdiqbp+2FHAAzIk+ffsqQAwylystMoBSiO0zlcdaqHoAPa5Dy7Pg== + version "1.13.11" + resolved "https://registry.yarnpkg.com/datatables.net-dt/-/datatables.net-dt-1.13.11.tgz#931e01e3fa9ec2f44d7d5ea87e91fb4ffb8eaaae" + integrity sha512-4GpS4OFLwIMfhb5UdJh6bEnh0E52jIJOlx7KLKs1pSce/xpHjvcmucbUWNaEndQIpHXtIxmVPoqcDB0ZbiVB+A== dependencies: - datatables.net ">=1.12.1" - jquery ">=1.7" + datatables.net "1.13.11" + jquery "1.8 - 4" -datatables.net@>=1.12.1, datatables.net@^1.11.5: - version "1.13.4" - resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-1.13.4.tgz#9a809cee82eca0a884e10b4d47a3a3d6e65e9fe7" - integrity sha512-yzhArTOB6tPO2QFKm1z3hA4vabtt2hRvgw8XLsT1xqEirinfGYqWDiWXlkTPTaJv2e7gG+Kf985sXkzBFlGrGQ== +datatables.net@1.13.11, datatables.net@^1.11.5: + version "1.13.11" + resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-1.13.11.tgz#e2a4c8b50553512f241ebfcbc078d74d551183b2" + integrity sha512-AE6RkMXziRaqzPcu/pl3SJXeRa6fmXQG/fVjuRESujvkzqDCYEeKTTpPMuVJSGYJpPi32WGSphVNNY1G4nSN/g== dependencies: - jquery ">=1.7" + jquery "1.8 - 4" dayjs@^1.10.4: - version "1.11.7" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" - integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ== + version "1.11.13" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c" + integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg== debug@2.6.9: version "2.6.9" @@ -2937,12 +2987,12 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.4: + version "4.4.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== dependencies: - ms "2.1.2" + ms "^2.1.3" decamelize-keys@^1.1.0: version "1.1.1" @@ -2964,16 +3014,26 @@ default-gateway@^6.0.3: dependencies: execa "^5.0.0" +define-data-property@^1.0.1, define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== -define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" - integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== +define-properties@^1.1.3, define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== dependencies: + define-data-property "^1.0.1" has-property-descriptors "^1.0.0" object-keys "^1.1.1" @@ -3042,15 +3102,10 @@ dlv@^1.1.3: resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79" integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== -dns-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" - integrity sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg== - dns-packet@^5.2.2: - version "5.6.0" - resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-5.6.0.tgz#2202c947845c7a63c23ece58f2f70ff6ab4c2f7d" - integrity sha512-rza3UH1LwdHh9qyPXp8lkwpjSNk/AMD3dPytUoRoqnypDUhY0xvbdmVhWOfxO68frEfV9BU8V12Ez7ZsHGZpCQ== + version "5.6.1" + resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-5.6.1.tgz#ae888ad425a9d1478a0674256ab866de1012cf2f" + integrity sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw== dependencies: "@leichtgewicht/ip-codec" "^2.0.1" @@ -3078,12 +3133,21 @@ dom-serializer@^1.0.1: domhandler "^4.2.0" entities "^2.0.0" +dom-serializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" + integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.2" + entities "^4.2.0" + domelementtype@1: version "1.3.1" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== -domelementtype@^2.0.1, domelementtype@^2.2.0: +domelementtype@^2.0.1, domelementtype@^2.2.0, domelementtype@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== @@ -3095,6 +3159,13 @@ domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.3.1: dependencies: domelementtype "^2.2.0" +domhandler@^5.0.2, domhandler@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" + integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== + dependencies: + domelementtype "^2.3.0" + domutils@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" @@ -3112,6 +3183,15 @@ domutils@^2.5.2, domutils@^2.8.0: domelementtype "^2.2.0" domhandler "^4.2.0" +domutils@^3.0.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.2.2.tgz#edbfe2b668b0c1d97c24baf0f1062b132221bc78" + integrity sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw== + dependencies: + dom-serializer "^2.0.0" + domelementtype "^2.3.0" + domhandler "^5.0.3" + dot-prop@^5.1.0: version "5.3.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" @@ -3124,6 +3204,15 @@ dropzone@^5.9.3: resolved "https://registry.yarnpkg.com/dropzone/-/dropzone-5.9.3.tgz#b3070ae090fa48cbc04c17535635537ca72d70d6" integrity sha512-Azk8kD/2/nJIuVPK+zQ9sjKMRIpRvNyqn9XwbBHNq+iNuSccbJS6hwm1Woy0pMST0erSo0u4j+KJaodndDk4vA== +dunder-proto@^1.0.0, dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + eastasianwidth@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" @@ -3142,10 +3231,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -electron-to-chromium@^1.4.284: - version "1.4.380" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.380.tgz#195dc59d930c6b74efbee6f0e6a267ce4af5ed91" - integrity sha512-XKGdI4pWM78eLH2cbXJHiBnWUwFSzZM7XujsB6stDiGu9AeSqziedP6amNLpJzE3i0rLTcfAwdCTs5ecP5yeSg== +electron-to-chromium@^1.5.73: + version "1.5.83" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.83.tgz#3f74078f0c83e24bf7e692eaa855a998d1bec34f" + integrity sha512-LcUDPqSt+V0QmI47XLzZrz5OqILSMGsPFkDYus22rIbgorSvBYEFqq854ltTmUdHkY92FSdAAvsh4jWEULMdfQ== emoji-regex@^8.0.0: version "8.0.0" @@ -3167,6 +3256,11 @@ encodeurl@~1.0.2: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== +encodeurl@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" + integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== + end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" @@ -3174,35 +3268,41 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^5.13.0: - version "5.13.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz#26d1ecc448c02de997133217b5c1053f34a0a275" - integrity sha512-eyV8f0y1+bzyfh8xAwW/WTSZpLbjhqc4ne9eGSH4Zo2ejdyiNG9pU6mf9DG8a7+Auk6MFTlNOT4Y2y/9k8GKVg== +enhanced-resolve@^5.17.1: + version "5.18.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz#91eb1db193896b9801251eeff1c6980278b1e404" + integrity sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" enquirer@^2.3.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + version "2.4.1" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" + integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== dependencies: ansi-colors "^4.1.1" + strip-ansi "^6.0.1" entities@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== +entities@^4.2.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + entities@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4" integrity sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q== envinfo@^7.7.3: - version "7.8.1" - resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" - integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== + version "7.14.0" + resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.14.0.tgz#26dac5db54418f2a4c1159153a0b2ae980838aae" + integrity sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg== error-ex@^1.3.1: version "1.3.2" @@ -3211,85 +3311,120 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -error-stack-parser@^2.0.0: +error-stack-parser@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.1.4.tgz#229cb01cdbfa84440bfa91876285b94680188286" integrity sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ== dependencies: stackframe "^1.3.4" -es-abstract@^1.17.2, es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.2: - version "1.21.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.2.tgz#a56b9695322c8a185dc25975aa3b8ec31d0e7eff" - integrity sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg== - dependencies: - array-buffer-byte-length "^1.0.0" - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - es-set-tostringtag "^2.0.1" - es-to-primitive "^1.2.1" - function.prototype.name "^1.1.5" - get-intrinsic "^1.2.0" - get-symbol-description "^1.0.0" - globalthis "^1.0.3" - gopd "^1.0.1" - has "^1.0.3" - has-property-descriptors "^1.0.0" - has-proto "^1.0.1" - has-symbols "^1.0.3" - internal-slot "^1.0.5" - is-array-buffer "^3.0.2" - is-callable "^1.2.7" - is-negative-zero "^2.0.2" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.2" - is-string "^1.0.7" - is-typed-array "^1.1.10" - is-weakref "^1.0.2" - object-inspect "^1.12.3" +es-abstract@^1.17.2, es-abstract@^1.23.2, es-abstract@^1.23.5, es-abstract@^1.23.9: + version "1.23.9" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.23.9.tgz#5b45994b7de78dada5c1bebf1379646b32b9d606" + integrity sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA== + dependencies: + array-buffer-byte-length "^1.0.2" + arraybuffer.prototype.slice "^1.0.4" + available-typed-arrays "^1.0.7" + call-bind "^1.0.8" + call-bound "^1.0.3" + data-view-buffer "^1.0.2" + data-view-byte-length "^1.0.2" + data-view-byte-offset "^1.0.1" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + es-set-tostringtag "^2.1.0" + es-to-primitive "^1.3.0" + function.prototype.name "^1.1.8" + get-intrinsic "^1.2.7" + get-proto "^1.0.0" + get-symbol-description "^1.1.0" + globalthis "^1.0.4" + gopd "^1.2.0" + has-property-descriptors "^1.0.2" + has-proto "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + internal-slot "^1.1.0" + is-array-buffer "^3.0.5" + is-callable "^1.2.7" + is-data-view "^1.0.2" + is-regex "^1.2.1" + is-shared-array-buffer "^1.0.4" + is-string "^1.1.1" + is-typed-array "^1.1.15" + is-weakref "^1.1.0" + math-intrinsics "^1.1.0" + object-inspect "^1.13.3" object-keys "^1.1.1" - object.assign "^4.1.4" - regexp.prototype.flags "^1.4.3" - safe-regex-test "^1.0.0" - string.prototype.trim "^1.2.7" - string.prototype.trimend "^1.0.6" - string.prototype.trimstart "^1.0.6" - typed-array-length "^1.0.4" - unbox-primitive "^1.0.2" - which-typed-array "^1.1.9" + object.assign "^4.1.7" + own-keys "^1.0.1" + regexp.prototype.flags "^1.5.3" + safe-array-concat "^1.1.3" + safe-push-apply "^1.0.0" + safe-regex-test "^1.1.0" + set-proto "^1.0.0" + string.prototype.trim "^1.2.10" + string.prototype.trimend "^1.0.9" + string.prototype.trimstart "^1.0.8" + typed-array-buffer "^1.0.3" + typed-array-byte-length "^1.0.3" + typed-array-byte-offset "^1.0.4" + typed-array-length "^1.0.7" + unbox-primitive "^1.1.0" + which-typed-array "^1.1.18" es-array-method-boxes-properly@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== +es-define-property@^1.0.0, es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + es-module-lexer@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.2.1.tgz#ba303831f63e6a394983fde2f97ad77b22324527" - integrity sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg== + version "1.6.0" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.6.0.tgz#da49f587fd9e68ee2404fe4e256c0c7d3a81be21" + integrity sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ== -es-set-tostringtag@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" - integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== +es-object-atoms@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== dependencies: - get-intrinsic "^1.1.3" - has "^1.0.3" - has-tostringtag "^1.0.0" + es-errors "^1.3.0" -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +es-to-primitive@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.3.0.tgz#96c89c82cc49fd8794a24835ba3e1ff87f214e18" + integrity sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g== + dependencies: + is-callable "^1.2.7" + is-date-object "^1.0.5" + is-symbol "^1.0.4" + +escalade@^3.1.1, escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== escape-html@~1.0.3: version "1.0.3" @@ -3399,36 +3534,36 @@ executable@^4.1.1: pify "^2.2.0" express@^4.17.3: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + version "4.21.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" + integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.1" + body-parser "1.20.3" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.5.0" + cookie "0.7.1" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" etag "~1.8.1" - finalhandler "1.2.0" + finalhandler "1.3.1" fresh "0.5.2" http-errors "2.0.0" - merge-descriptors "1.0.1" + merge-descriptors "1.0.3" methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.7" + path-to-regexp "0.1.12" proxy-addr "~2.0.7" - qs "6.11.0" + qs "6.13.0" range-parser "~1.2.1" safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" + send "0.19.0" + serve-static "1.16.2" setprototypeof "1.2.0" statuses "2.0.1" type-is "~1.6.18" @@ -3466,49 +3601,36 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@^3.2.11: - version "3.2.12" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" - integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-glob@^3.2.12, fast-glob@^3.2.9: - version "3.3.0" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.0.tgz#7c40cb491e1e2ed5664749e87bfb516dbe8727c0" - integrity sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA== +fast-glob@^3.2.11, fast-glob@^3.2.12, fast-glob@^3.2.9, fast-glob@^3.3.2: + version "3.3.3" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818" + integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" glob-parent "^5.1.2" merge2 "^1.3.0" - micromatch "^4.0.4" + micromatch "^4.0.8" fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-3.0.0.tgz#37b899ae47e1090e40e3fd2318e4d5f0142ca912" - integrity sha512-hKKNajm46uNmTlhHSyZkmToAc56uZJwYq7yrciZjqOxnlfQwERDQJmHPUp7m1m9wx8vgOe8IaCKZ5Kv2k1DdCQ== - dependencies: - fastest-levenshtein "^1.0.7" +fast-uri@^3.0.1: + version "3.0.5" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.5.tgz#19f5f9691d0dab9b85861a7bb5d98fca961da9cd" + integrity sha512-5JnBCWpFlMo0a3ciDy/JckMzzv1U9coZrIhedq+HXxxUfDTAiS0LA8OKVao4G9BxmCVck/jtA5r3KAtRWEyD8Q== -fastest-levenshtein@^1.0.12, fastest-levenshtein@^1.0.16, fastest-levenshtein@^1.0.7: +fastest-levenshtein@^1.0.12, fastest-levenshtein@^1.0.16: version "1.0.16" resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5" integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== fastq@^1.6.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" - integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + version "1.18.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.18.0.tgz#d631d7e25faffea81887fe5ea8c9010e1b36fee0" + integrity sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw== dependencies: reusify "^1.0.4" @@ -3526,13 +3648,6 @@ fd-slicer@~1.1.0: dependencies: pend "~1.2.0" -fibers@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/fibers/-/fibers-5.0.3.tgz#2fd03acb255db66fe693d15beafbf5ae92193fd7" - integrity sha512-/qYTSoZydQkM21qZpGLDLuCq8c+B8KhuCQ1kLPvnRNhxhVbvrpmH9l2+Lblf5neDuEsY4bfT7LeO553TXQDvJw== - dependencies: - detect-libc "^1.0.3" - figures@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" @@ -3547,41 +3662,33 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== +finalhandler@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019" + integrity sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ== dependencies: debug "2.6.9" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" on-finished "2.4.1" parseurl "~1.3.3" statuses "2.0.1" unpipe "~1.0.0" -find-cache-dir@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" - integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== - dependencies: - commondir "^1.0.1" - make-dir "^3.0.2" - pkg-dir "^4.1.0" - -find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== +find-cache-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-4.0.0.tgz#a30ee0448f81a3990708f6453633c733e2f6eec2" + integrity sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg== dependencies: - locate-path "^3.0.0" + common-path-prefix "^3.0.0" + pkg-dir "^7.0.0" find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" @@ -3599,35 +3706,49 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" +find-up@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" + integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw== + dependencies: + locate-path "^7.1.0" + path-exists "^5.0.0" + flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + version "3.2.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" + integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== dependencies: - flatted "^3.1.0" + flatted "^3.2.9" + keyv "^4.5.3" rimraf "^3.0.2" -flatted@^3.1.0: - version "3.2.7" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" - integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +flatted@^3.2.9: + version "3.3.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.2.tgz#adba1448a9841bec72b42c532ea23dbbedef1a27" + integrity sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA== flatten@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b" integrity sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg== -focus-trap@^6.6.1: +focus-trap@^6.9.4: version "6.9.4" resolved "https://registry.yarnpkg.com/focus-trap/-/focus-trap-6.9.4.tgz#436da1a1d935c48b97da63cd8f361c6f3aa16444" integrity sha512-v2NTsZe2FF59Y+sDykKY+XjqZ0cPfhq/hikWVL88BqLivnNiEffAsac6rP6H45ff9wG9LL5ToiDqrLEP9GX9mw== dependencies: tabbable "^5.3.3" -follow-redirects@^1.0.0, follow-redirects@^1.15.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +follow-redirects@^1.0.0, follow-redirects@^1.15.6: + version "1.15.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" + integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== for-each@^0.3.3: version "0.3.3" @@ -3637,9 +3758,9 @@ for-each@^0.3.3: is-callable "^1.1.3" foreground-child@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" - integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + version "3.3.0" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.3.0.tgz#0ac8644c06e431439f8561db8ecf29a7b5519c77" + integrity sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg== dependencies: cross-spawn "^7.0.0" signal-exit "^4.0.1" @@ -3650,9 +3771,9 @@ forever-agent@~0.6.1: integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + version "4.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.1.tgz#ba1076daaaa5bfd7e99c1a6cb02aa0a5cff90d48" + integrity sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -3672,10 +3793,10 @@ forwarded@0.2.0: resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== -fraction.js@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950" - integrity sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA== +fraction.js@^4.3.7: + version "4.3.7" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.7.tgz#06ca0085157e42fda7f9e726e79fefc4068840f7" + integrity sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew== fresh@0.5.2: version "0.5.2" @@ -3683,9 +3804,9 @@ fresh@0.5.2: integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== fs-extra@^11.0.0: - version "11.1.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.1.1.tgz#da69f7c39f3b002378b0954bb6ae7efdc0876e2d" - integrity sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ== + version "11.3.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.3.0.tgz#0daced136bbaf65a555a326719af931adc7a314d" + integrity sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew== dependencies: graceful-fs "^4.2.0" jsonfile "^6.0.1" @@ -3701,10 +3822,10 @@ fs-extra@^9.1.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-monkey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.3.tgz#ae3ac92d53bb328efe0e9a1d9541f6ad8d48e2d3" - integrity sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q== +fs-monkey@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.6.tgz#8ead082953e88d992cf3ff844faa907b26756da2" + integrity sha512-b1FMfwetIKymC0eioW7mTywihSQE4oLzQn1dB6rZB5fx/3NpNEdAWeCSMB+60/AeT0TCXsxzAlcYVEFCTAksWg== fs.realpath@^1.0.0: version "1.0.0" @@ -3712,26 +3833,28 @@ fs.realpath@^1.0.0: integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== -function.prototype.name@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" - integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== +function.prototype.name@^1.1.6, function.prototype.name@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.8.tgz#e68e1df7b259a5c949eeef95cdbde53edffabb78" + integrity sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.0" - functions-have-names "^1.2.2" + call-bind "^1.0.8" + call-bound "^1.0.3" + define-properties "^1.2.1" + functions-have-names "^1.2.3" + hasown "^2.0.2" + is-callable "^1.2.7" -functions-have-names@^1.2.2, functions-have-names@^1.2.3: +functions-have-names@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== @@ -3746,20 +3869,35 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.0.tgz#7ad1dc0535f3a2904bba075772763e5051f6d05f" - integrity sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.3" +get-intrinsic@^1.2.4, get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.7.tgz#dcfcb33d3272e15f445d15124bc0a216189b9044" + integrity sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + function-bind "^1.1.2" + get-proto "^1.0.0" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" get-port@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" integrity sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg== +get-proto@^1.0.0, get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" + get-stream@^5.0.0, get-stream@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" @@ -3772,13 +3910,14 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -get-symbol-description@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" - integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== +get-symbol-description@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.1.0.tgz#7bdd54e0befe8ffc9f3b4e203220d9f1e881b6ee" + integrity sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg== dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" + call-bound "^1.0.3" + es-errors "^1.3.0" + get-intrinsic "^1.2.6" getos@^3.2.1: version "3.2.1" @@ -3824,28 +3963,17 @@ glob-to-regexp@^0.4.1: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob@7.1.6: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^10.0.0: - version "10.2.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-10.2.2.tgz#ce2468727de7e035e8ecf684669dc74d0526ab75" - integrity sha512-Xsa0BcxIC6th9UwNjZkhrMtNo/MnyRL8jGCP+uEwhA5oFOCY1f2s1/oNKY47xQ0Bg5nkjsfAEIej1VeH62bDDQ== +glob@^10.3.10, glob@^10.3.7: + version "10.4.5" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" + integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== dependencies: foreground-child "^3.1.0" - jackspeak "^2.0.3" - minimatch "^9.0.0" - minipass "^5.0.0" - path-scurry "^1.7.0" + jackspeak "^3.1.2" + minimatch "^9.0.4" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^1.11.1" glob@^7.0.3, glob@^7.1.3: version "7.2.3" @@ -3894,12 +4022,13 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globalthis@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" - integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== +globalthis@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" + integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== dependencies: - define-properties "^1.1.3" + define-properties "^1.2.1" + gopd "^1.0.1" globby@13.1.4: version "13.1.4" @@ -3940,14 +4069,12 @@ globjoin@^0.1.4: resolved "https://registry.yarnpkg.com/globjoin/-/globjoin-0.1.4.tgz#2f4494ac8919e3767c5cbb691e9f463324285d43" integrity sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg== -gopd@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" - integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== - dependencies: - get-intrinsic "^1.1.3" +gopd@^1.0.1, gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -3967,10 +4094,10 @@ hard-rejection@^2.1.0: resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== -has-bigints@^1.0.1, has-bigints@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" - integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== +has-bigints@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.1.0.tgz#28607e965ac967e03cd2a2c70a2636a1edad49fe" + integrity sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg== has-flag@^3.0.0: version "3.0.0" @@ -3982,36 +4109,38 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-property-descriptors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" - integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== +has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== dependencies: - get-intrinsic "^1.1.1" + es-define-property "^1.0.0" -has-proto@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" - integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== +has-proto@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.2.0.tgz#5de5a6eabd95fdffd9818b43055e8065e39fe9d5" + integrity sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ== + dependencies: + dunder-proto "^1.0.0" -has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== +has-symbols@^1.0.1, has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== -has-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== dependencies: - has-symbols "^1.0.2" + has-symbols "^1.0.3" -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== dependencies: - function-bind "^1.1.1" + function-bind "^1.1.2" hosted-git-info@^2.1.4: version "2.8.9" @@ -4036,9 +4165,9 @@ hpack.js@^2.1.6: wbuf "^1.1.0" html-entities@^2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.3.tgz#117d7626bece327fc8baace8868fa6f5ef856e46" - integrity sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA== + version "2.5.2" + resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.5.2.tgz#201a3cf95d3a15be7099521620d19dfb4f65359f" + integrity sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA== html-tags@^3.2.0: version "3.3.1" @@ -4082,14 +4211,14 @@ http-errors@~1.6.2: statuses ">= 1.4.0 < 2" http-parser-js@>=0.5.1: - version "0.5.8" - resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3" - integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== + version "0.5.9" + resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.9.tgz#b817b3ca0edea6236225000d795378707c169cec" + integrity sha512-n1XsPy3rXVxlqxVioEWdC+0+M+SQw0DpJynwtOPo1X+ZlvdzTLtDBIJJlDQTnwZIFJrZSzSGmIOUdP8tu+SgLw== http-proxy-middleware@^2.0.3: - version "2.0.6" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f" - integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw== + version "2.0.7" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" + integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== dependencies: "@types/http-proxy" "^1.17.8" http-proxy "^1.18.1" @@ -4143,16 +4272,16 @@ ieee754@^1.1.13: integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== ignore@^5.2.0, ignore@^5.2.1: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== -immutable@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.0.tgz#eb1738f14ffb39fd068b1dbe1296117484dd34be" - integrity sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg== +immutable@^5.0.2: + version "5.0.3" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-5.0.3.tgz#aa037e2313ea7b5d400cd9298fa14e404c933db1" + integrity sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw== -import-fresh@^3.0.0, import-fresh@^3.2.1: +import-fresh@^3.0.0, import-fresh@^3.2.1, import-fresh@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -4166,9 +4295,9 @@ import-lazy@^4.0.0: integrity sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw== import-local@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" - integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== + version "3.2.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260" + integrity sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" @@ -4216,14 +4345,14 @@ ini@^1.3.4, ini@^1.3.5: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -internal-slot@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" - integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== +internal-slot@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.1.0.tgz#1eac91762947d2f7056bc838d93e13b2e9604961" + integrity sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw== dependencies: - get-intrinsic "^1.2.0" - has "^1.0.3" - side-channel "^1.0.4" + es-errors "^1.3.0" + hasown "^2.0.2" + side-channel "^1.1.0" interpret@^3.1.1: version "3.1.1" @@ -4236,30 +4365,40 @@ ipaddr.js@1.9.1: integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== ipaddr.js@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.0.1.tgz#eca256a7a877e917aeb368b0a7497ddf42ef81c0" - integrity sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng== + version "2.2.0" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.2.0.tgz#d33fa7bac284f4de7af949638c9d68157c6b92e8" + integrity sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA== -is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" - integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== +is-array-buffer@^3.0.4, is-array-buffer@^3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.5.tgz#65742e1e687bd2cc666253068fd8707fe4d44280" + integrity sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A== dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.2.0" - is-typed-array "^1.1.10" + call-bind "^1.0.8" + call-bound "^1.0.3" + get-intrinsic "^1.2.6" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== -is-bigint@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" - integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== +is-async-function@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-async-function/-/is-async-function-2.1.0.tgz#1d1080612c493608e93168fc4458c245074c06a6" + integrity sha512-GExz9MtyhlZyXYLxzlJRj5WUCE661zhDa1Yna52CN57AJsymh+DvXXjyveSioqSRdxvUrdKdvqB1b5cVKsNpWQ== + dependencies: + call-bound "^1.0.3" + get-proto "^1.0.1" + has-tostringtag "^1.0.2" + safe-regex-test "^1.1.0" + +is-bigint@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.1.0.tgz#dda7a3445df57a42583db4228682eba7c4170672" + integrity sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ== dependencies: - has-bigints "^1.0.1" + has-bigints "^1.0.2" is-binary-path@~2.1.0: version "2.1.0" @@ -4268,15 +4407,15 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-boolean-object@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" - integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== +is-boolean-object@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.2.1.tgz#c20d0c654be05da4fbc23c562635c019e93daf89" + integrity sha512-l9qO6eFlUETHtuihLcYOaLKByJ1f+N4kthcU9YjHy3N+B3hWv0y/2Nd0mu/7lTFnRQHTrSdXF50HQ3bl5fEnng== dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" + call-bound "^1.0.2" + has-tostringtag "^1.0.2" -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: +is-callable@^1.1.3, is-callable@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== @@ -4288,19 +4427,29 @@ is-ci@^3.0.0: dependencies: ci-info "^3.2.0" -is-core-module@^2.11.0, is-core-module@^2.5.0: - version "2.12.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" - integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== +is-core-module@^2.16.0, is-core-module@^2.5.0: + version "2.16.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" + integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== dependencies: - has "^1.0.3" + hasown "^2.0.2" -is-date-object@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== +is-data-view@^1.0.1, is-data-view@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-data-view/-/is-data-view-1.0.2.tgz#bae0a41b9688986c2188dda6657e56b8f9e63b8e" + integrity sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw== + dependencies: + call-bound "^1.0.2" + get-intrinsic "^1.2.6" + is-typed-array "^1.1.13" + +is-date-object@^1.0.5, is-date-object@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.1.0.tgz#ad85541996fc7aa8b2729701d27b7319f95d82f7" + integrity sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg== dependencies: - has-tostringtag "^1.0.0" + call-bound "^1.0.2" + has-tostringtag "^1.0.2" is-docker@^2.0.0, is-docker@^2.1.1: version "2.2.1" @@ -4312,11 +4461,28 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== +is-finalizationregistry@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz#eefdcdc6c94ddd0674d9c85887bf93f944a97c90" + integrity sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg== + dependencies: + call-bound "^1.0.3" + is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== +is-generator-function@^1.0.10: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.1.0.tgz#bf3eeda931201394f57b5dba2800f91a238309ca" + integrity sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ== + dependencies: + call-bound "^1.0.3" + get-proto "^1.0.0" + has-tostringtag "^1.0.2" + safe-regex-test "^1.1.0" + is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -4332,17 +4498,18 @@ is-installed-globally@~0.4.0: global-dirs "^3.0.0" is-path-inside "^3.0.2" -is-negative-zero@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" - integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== +is-map@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" + integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw== -is-number-object@^1.0.4: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" - integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== +is-number-object@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.1.1.tgz#144b21e95a1bc148205dcc2814a9134ec41b2541" + integrity sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw== dependencies: - has-tostringtag "^1.0.0" + call-bound "^1.0.3" + has-tostringtag "^1.0.2" is-number@^7.0.0: version "7.0.0" @@ -4400,39 +4567,49 @@ is-plain-object@^5.0.0: resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== -is-regex@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== +is-regex@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.2.1.tgz#76d70a3ed10ef9be48eb577887d74205bf0cad22" + integrity sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g== dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" + call-bound "^1.0.2" + gopd "^1.2.0" + has-tostringtag "^1.0.2" + hasown "^2.0.2" -is-shared-array-buffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" - integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== +is-set@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.3.tgz#8ab209ea424608141372ded6e0cb200ef1d9d01d" + integrity sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg== + +is-shared-array-buffer@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz#9b67844bd9b7f246ba0708c3a93e34269c774f6f" + integrity sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A== dependencies: - call-bind "^1.0.2" + call-bound "^1.0.3" is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-string@^1.0.5, is-string@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" - integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== +is-string@^1.0.7, is-string@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.1.1.tgz#92ea3f3d5c5b6e039ca8677e5ac8d07ea773cbb9" + integrity sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA== dependencies: - has-tostringtag "^1.0.0" + call-bound "^1.0.3" + has-tostringtag "^1.0.2" -is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== +is-symbol@^1.0.4, is-symbol@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.1.1.tgz#f47761279f532e2b05a7024a7506dbbedacd0634" + integrity sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w== dependencies: - has-symbols "^1.0.2" + call-bound "^1.0.2" + has-symbols "^1.1.0" + safe-regex-test "^1.1.0" is-text-path@^1.0.1: version "1.0.1" @@ -4441,16 +4618,12 @@ is-text-path@^1.0.1: dependencies: text-extensions "^1.0.0" -is-typed-array@^1.1.10, is-typed-array@^1.1.9: - version "1.1.10" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" - integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== +is-typed-array@^1.1.13, is-typed-array@^1.1.14, is-typed-array@^1.1.15: + version "1.1.15" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.15.tgz#4bfb4a45b61cee83a5a46fba778e4e8d59c0ce0b" + integrity sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ== dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.0" + which-typed-array "^1.1.16" is-typedarray@~1.0.0: version "1.0.0" @@ -4462,12 +4635,25 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== -is-weakref@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" - integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== +is-weakmap@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.2.tgz#bf72615d649dfe5f699079c54b83e47d1ae19cfd" + integrity sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w== + +is-weakref@^1.0.2, is-weakref@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.1.0.tgz#47e3472ae95a63fa9cf25660bcf0c181c39770ef" + integrity sha512-SXM8Nwyys6nT5WP6pltOwKytLV7FqQ4UiibxVmW+EIosHcmCqkkjViTb5SNssDlkCiEYRP1/pdWUKVvZBmsR2Q== + dependencies: + call-bound "^1.0.2" + +is-weakset@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.4.tgz#c9f5deb0bc1906c6d6f1027f284ddf459249daca" + integrity sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ== dependencies: - call-bind "^1.0.2" + call-bound "^1.0.3" + get-intrinsic "^1.2.6" is-wsl@^2.2.0: version "2.2.0" @@ -4501,21 +4687,21 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== -jackspeak@^2.0.3: - version "2.2.0" - resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.2.0.tgz#497cbaedc902ec3f31d5d61be804d2364ff9ddad" - integrity sha512-r5XBrqIJfwRIjRt/Xr5fv9Wh09qyhHfKnYddDlpM+ibRR20qrYActpCAgU6U+d53EOEjzkvxPMVHSlgR7leXrQ== +jackspeak@^3.1.2: + version "3.4.3" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.4.3.tgz#8833a9d89ab4acde6188942bd1c53b6390ed5a8a" + integrity sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw== dependencies: "@isaacs/cliui" "^8.0.2" optionalDependencies: "@pkgjs/parseargs" "^0.11.0" -jest-util@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.5.0.tgz#24a4d3d92fc39ce90425311b23c27a6e0ef16b8f" - integrity sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ== +jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== dependencies: - "@jest/types" "^29.5.0" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" @@ -4531,25 +4717,25 @@ jest-worker@^27.4.5: merge-stream "^2.0.0" supports-color "^8.0.0" -jest-worker@^29.1.2: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.5.0.tgz#bdaefb06811bd3384d93f009755014d8acb4615d" - integrity sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA== +jest-worker@^29.4.3: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" + integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== dependencies: "@types/node" "*" - jest-util "^29.5.0" + jest-util "^29.7.0" merge-stream "^2.0.0" supports-color "^8.0.0" -jiti@^1.18.2: - version "1.18.2" - resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.18.2.tgz#80c3ef3d486ebf2450d9335122b32d121f2a83cd" - integrity sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg== +jiti@^1.20.0, jiti@^1.21.6: + version "1.21.7" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.7.tgz#9dd81043424a3d28458b193d965f0d18a2300ba9" + integrity sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A== -jquery@>=1.7: - version "3.6.4" - resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.4.tgz#ba065c188142100be4833699852bf7c24dc0252f" - integrity sha512-v28EW9DWDFpzcD9O5iyJXg3R3+q+mET5JhnjJzQUZMHOv67bpSIHq81GEYpPNZHG+XXHsfSme3nxp/hndKEcsQ== +"jquery@1.8 - 4": + version "3.7.1" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" + integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== js-tokens@^4.0.0: version "4.0.0" @@ -4576,15 +4762,20 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +jsesc@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" + integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== + +jsesc@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" + integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: version "2.3.1" @@ -4611,7 +4802,7 @@ json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json5@^2.1.2, json5@^2.2.2: +json5@^2.1.2, json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -4640,38 +4831,45 @@ jsprim@^2.0.2: json-schema "0.4.0" verror "1.10.0" +keyv@^4.5.3: + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + kind-of@^6.0.2, kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== -klona@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.6.tgz#85bffbf819c03b2f53270412420a4555ef882e22" - integrity sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA== - known-css-properties@^0.26.0: version "0.26.0" resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.26.0.tgz#008295115abddc045a9f4ed7e2a84dc8b3a77649" integrity sha512-5FZRzrZzNTBruuurWpvZnvP9pum+fe0HcK8z/ooo+U+Hmp4vtbyp1/QDsqmufirXy4egGzbaH/y2uCZf+6W5Kg== +known-css-properties@^0.29.0: + version "0.29.0" + resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.29.0.tgz#e8ba024fb03886f23cb882e806929f32d814158f" + integrity sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ== + launch-editor@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/launch-editor/-/launch-editor-2.6.0.tgz#4c0c1a6ac126c572bd9ff9a30da1d2cae66defd7" - integrity sha512-JpDCcQnyAAzZZaZ7vEiSqL690w7dAEyLao+KC96zBplnYbJS7TYNjvM3M7y3dGz+v7aIsJk3hllWuc0kWAjyRQ== + version "2.9.1" + resolved "https://registry.yarnpkg.com/launch-editor/-/launch-editor-2.9.1.tgz#253f173bd441e342d4344b4dae58291abb425047" + integrity sha512-Gcnl4Bd+hRO9P9icCP/RVVT2o8SFlPXofuCxvA2SaZuH45whSvf5p8x5oih5ftLiVhEI4sp5xDY+R+b3zJBh5w== dependencies: picocolors "^1.0.0" - shell-quote "^1.7.3" + shell-quote "^1.8.1" lazy-ass@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw== -lilconfig@^2.0.3, lilconfig@^2.0.5, lilconfig@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" - integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== +lilconfig@^3.0.0, lilconfig@^3.1.1, lilconfig@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.1.3.tgz#a1bcfd6257f9585bf5ae14ceeebb7b559025e4c4" + integrity sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw== lines-and-columns@^1.1.6: version "1.2.4" @@ -4720,14 +4918,6 @@ loader-utils@^2.0.0: emojis-list "^3.0.0" json5 "^2.1.2" -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" @@ -4742,6 +4932,13 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +locate-path@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" + integrity sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA== + dependencies: + p-locate "^6.0.0" + lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -4835,6 +5032,11 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" +lru-cache@^10.2.0: + version "10.4.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" + integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -4849,18 +5051,6 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lru-cache@^9.0.0: - version "9.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.1.1.tgz#c58a93de58630b688de39ad04ef02ef26f1902f1" - integrity sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A== - -make-dir@^3.0.2, make-dir@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" @@ -4917,6 +5107,11 @@ markdownlint@0.28.2: markdown-it "13.0.1" markdownlint-micromark "0.1.2" +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + mathml-tag-names@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" @@ -4927,6 +5122,16 @@ mdn-data@2.0.14: resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow== +mdn-data@2.0.28: + version "2.0.28" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.28.tgz#5ec48e7bef120654539069e1ae4ddc81ca490eba" + integrity sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g== + +mdn-data@2.0.30: + version "2.0.30" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.30.tgz#ce4df6f80af6cfbe218ecd5c552ba13c4dfa08cc" + integrity sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA== + mdn-data@2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" @@ -4943,13 +5148,13 @@ media-typer@0.3.0: integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== memfs@^3.4.3: - version "3.5.1" - resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.5.1.tgz#f0cd1e2bfaef58f6fe09bfb9c2288f07fea099ec" - integrity sha512-UWbFJKvj5k+nETdteFndTpYxdeTMox/ULeqX5k/dpaQJCCFmj5EeKv3dBcyO2xmkRAx2vppRu5dVG7SOtsGOzA== + version "3.6.0" + resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.6.0.tgz#d7a2110f86f79dd950a8b6df6d57bc984aa185f6" + integrity sha512-EGowvkkgbMcIChjMTMkESFDbZeSh8xZ7kNSF0hAiAN4Jh6jgHCRS0Ga/+C8y6Au+oqpezRHCfPsmJ2+DwAgiwQ== dependencies: - fs-monkey "^1.0.3" + fs-monkey "^1.0.4" -meow@^8.0.0: +meow@^8.0.0, meow@^8.1.2: version "8.1.2" resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== @@ -4984,10 +5189,10 @@ meow@^9.0.0: type-fest "^0.18.0" yargs-parser "^20.2.3" -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== +merge-descriptors@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" + integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ== merge-stream@^2.0.0: version "2.0.0" @@ -5004,7 +5209,7 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== -micromatch@4.0.5, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: +micromatch@4.0.5: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== @@ -5012,11 +5217,24 @@ micromatch@4.0.5, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: braces "^3.0.2" picomatch "^2.3.1" -mime-db@1.52.0, "mime-db@>= 1.43.0 < 2": +micromatch@^4.0.2, micromatch@^4.0.5, micromatch@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== + dependencies: + braces "^3.0.3" + picomatch "^2.3.1" + +mime-db@1.52.0: version "1.52.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== +"mime-db@>= 1.43.0 < 2": + version "1.53.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.53.0.tgz#3cb63cd820fc29896d9d4e8c32ab4fcd74ccb447" + integrity sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg== + mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" @@ -5040,28 +5258,29 @@ min-indent@^1.0.0: integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== mini-css-extract-plugin@^2.6.0: - version "2.7.5" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.5.tgz#afbb344977659ec0f1f6e050c7aea456b121cfc5" - integrity sha512-9HaR++0mlgom81s95vvNjxkg52n2b5s//3ZTI1EtzFb98awsLSivs2LMsVqnQ3ay0PVhqWcGNyDaTE961FOcjQ== + version "2.9.2" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.9.2.tgz#966031b468917a5446f4c24a80854b2947503c5b" + integrity sha512-GJuACcS//jtq4kCtd5ii/M0SZf7OZRH+BxdqXZHaJfb8TJiVl+NgQRPwiYt2EuqeSkNydn/7vP+bcE27C5mb9w== dependencies: schema-utils "^4.0.0" + tapable "^2.2.1" minimalistic-assert@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== -minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" -minimatch@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.0.tgz#bfc8e88a1c40ffd40c172ddac3decb8451503b56" - integrity sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w== +minimatch@^9.0.4: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== dependencies: brace-expansion "^2.0.1" @@ -5079,10 +5298,10 @@ minimist@^1.2.6, minimist@^1.2.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== -minipass@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" - integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== mkdirp@~0.5.1: version "0.5.6" @@ -5096,12 +5315,7 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@2.1.3, ms@^2.1.1: +ms@2.1.3, ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -5123,21 +5337,31 @@ mz@^2.7.0: object-assign "^4.0.1" thenify-all "^1.0.0" -nanoid@^3.3.6: - version "3.3.6" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" - integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== +nanoid@^3.3.8: + version "3.3.8" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" + integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== negotiator@0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== +negotiator@~0.6.4: + version "0.6.4" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.4.tgz#777948e2452651c570b712dd01c23e262713fff7" + integrity sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w== + neo-async@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== +node-addon-api@^7.0.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-7.1.1.tgz#1aba6693b0f255258a049d621329329322aad558" + integrity sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ== + node-forge@^1: version "1.3.1" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" @@ -5155,10 +5379,10 @@ node-notifier@^9.0.0: uuid "^8.3.0" which "^2.0.2" -node-releases@^2.0.8: - version "2.0.10" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f" - integrity sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w== +node-releases@^2.0.19: + version "2.0.19" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" + integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== normalize-package-data@^2.5.0: version "2.5.0" @@ -5190,11 +5414,6 @@ normalize-range@^0.1.2: resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== -normalize-url@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" - integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== - npm-run-path@^4.0.0, npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" @@ -5226,45 +5445,50 @@ object-hash@^3.0.0: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== -object-inspect@^1.12.3, object-inspect@^1.9.0: - version "1.12.3" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" - integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== +object-inspect@^1.13.3: + version "1.13.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" + integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object.assign@^4.1.4: - version "4.1.4" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" - integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== +object.assign@^4.1.7: + version "4.1.7" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.7.tgz#8c14ca1a424c6a561b0bb2a22f66f5049a945d3d" + integrity sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - has-symbols "^1.0.3" + call-bind "^1.0.8" + call-bound "^1.0.3" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + has-symbols "^1.1.0" object-keys "^1.1.1" object.getownpropertydescriptors@^2.1.0: - version "2.1.6" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.6.tgz#5e5c384dd209fa4efffead39e3a0512770ccc312" - integrity sha512-lq+61g26E/BgHv0ZTFgRvi7NMEPuAxLkFU7rukXjc/AlwH4Am5xXVnIXy3un1bg/JPbXHrixRkK1itUzzPiIjQ== - dependencies: - array.prototype.reduce "^1.0.5" - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.21.2" - safe-array-concat "^1.0.0" + version "2.1.8" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.8.tgz#2f1fe0606ec1a7658154ccd4f728504f69667923" + integrity sha512-qkHIGe4q0lSYMv0XI4SsBTJz3WaURhLvd0lKSgtVuOsJ2krg4SgMw3PIRQFMp07yi++UR3se2mkcLqsBNpBb/A== + dependencies: + array.prototype.reduce "^1.0.6" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-object-atoms "^1.0.0" + gopd "^1.0.1" + safe-array-concat "^1.1.2" object.values@^1.1.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.6.tgz#4abbaa71eba47d63589d402856f908243eea9b1d" - integrity sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw== + version "1.2.1" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.2.1.tgz#deed520a50809ff7f75a7cfd4bc64c7a038c6216" + integrity sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + call-bind "^1.0.8" + call-bound "^1.0.3" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" @@ -5311,7 +5535,16 @@ ospath@^1.2.2: resolved "https://registry.yarnpkg.com/ospath/-/ospath-1.2.2.tgz#1276639774a3f8ef2572f7fe4280e0ea4550c07b" integrity sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA== -p-limit@^2.0.0, p-limit@^2.2.0: +own-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/own-keys/-/own-keys-1.0.1.tgz#e4006910a2bf913585289676eebd6f390cf51358" + integrity sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg== + dependencies: + get-intrinsic "^1.2.6" + object-keys "^1.1.1" + safe-push-apply "^1.0.0" + +p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== @@ -5325,12 +5558,12 @@ p-limit@^3.0.2: dependencies: yocto-queue "^0.1.0" -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== +p-limit@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" + integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== dependencies: - p-limit "^2.0.0" + yocto-queue "^1.0.0" p-locate@^4.1.0: version "4.1.0" @@ -5346,6 +5579,13 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" +p-locate@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" + integrity sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw== + dependencies: + p-limit "^4.0.0" + p-map@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" @@ -5371,6 +5611,11 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +package-json-from-dist@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505" + integrity sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -5378,7 +5623,7 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-json@^5.0.0: +parse-json@^5.0.0, parse-json@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== @@ -5393,16 +5638,16 @@ parseurl@~1.3.2, parseurl@~1.3.3: resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== +path-exists@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" + integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -5423,18 +5668,18 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-scurry@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.7.0.tgz#99c741a2cfbce782294a39994d63748b5a24f6db" - integrity sha512-UkZUeDjczjYRE495+9thsgcVgsaCPkaw80slmfVFgllxY+IO8ubTsOpFVjDPROBqJdHfVPUFRHPBV/WciOVfWg== +path-scurry@^1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== dependencies: - lru-cache "^9.0.0" - minipass "^5.0.0" + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== +path-to-regexp@0.1.12: + version "0.1.12" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" + integrity sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ== path-type@^4.0.0: version "4.0.0" @@ -5456,10 +5701,10 @@ picocolors@^0.2.1: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" @@ -5489,69 +5734,74 @@ pinkie@^2.0.0: integrity sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg== pirates@^4.0.1: - version "4.0.5" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" - integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== + version "4.0.6" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== -pkg-dir@^4.1.0, pkg-dir@^4.2.0: +pkg-dir@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== dependencies: find-up "^4.0.0" -pkg-up@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5" - integrity sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA== +pkg-dir@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-7.0.0.tgz#8f0c08d6df4476756c5ff29b3282d0bab7517d11" + integrity sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA== dependencies: - find-up "^3.0.0" + find-up "^6.3.0" + +possible-typed-array-names@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" + integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== -postcss-calc@^8.2.3: - version "8.2.4" - resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-8.2.4.tgz#77b9c29bfcbe8a07ff6693dc87050828889739a5" - integrity sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q== +postcss-calc@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-9.0.1.tgz#a744fd592438a93d6de0f1434c572670361eb6c6" + integrity sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ== dependencies: - postcss-selector-parser "^6.0.9" + postcss-selector-parser "^6.0.11" postcss-value-parser "^4.2.0" -postcss-colormin@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-5.3.1.tgz#86c27c26ed6ba00d96c79e08f3ffb418d1d1988f" - integrity sha512-UsWQG0AqTFQmpBegeLLc1+c3jIqBNB0zlDGRWR+dQ3pRKJL1oeMzyqmH3o2PIfn9MBdNrVPWhDbT769LxCTLJQ== +postcss-colormin@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-6.1.0.tgz#076e8d3fb291fbff7b10e6b063be9da42ff6488d" + integrity sha512-x9yX7DOxeMAR+BgGVnNSAxmAj98NX/YxEMNFP+SDCEeNLb2r3i6Hh1ksMsnW8Ub5SLCpbescQqn9YEbE9554Sw== dependencies: - browserslist "^4.21.4" + browserslist "^4.23.0" caniuse-api "^3.0.0" - colord "^2.9.1" + colord "^2.9.3" postcss-value-parser "^4.2.0" -postcss-convert-values@^5.1.3: - version "5.1.3" - resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-5.1.3.tgz#04998bb9ba6b65aa31035d669a6af342c5f9d393" - integrity sha512-82pC1xkJZtcJEfiLw6UXnXVXScgtBrjlO5CBmuDQc+dlb88ZYheFsjTn40+zBVi3DkfF7iezO0nJUPLcJK3pvA== +postcss-convert-values@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-6.1.0.tgz#3498387f8efedb817cbc63901d45bd1ceaa40f48" + integrity sha512-zx8IwP/ts9WvUM6NkVSkiU902QZL1bwPhaVaLynPtCsOTqp+ZKbNi+s6XJg3rfqpKGA/oc7Oxk5t8pOQJcwl/w== dependencies: - browserslist "^4.21.4" + browserslist "^4.23.0" postcss-value-parser "^4.2.0" -postcss-discard-comments@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-5.1.2.tgz#8df5e81d2925af2780075840c1526f0660e53696" - integrity sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ== +postcss-discard-comments@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-6.0.2.tgz#e768dcfdc33e0216380623652b0a4f69f4678b6c" + integrity sha512-65w/uIqhSBBfQmYnG92FO1mWZjJ4GL5b8atm5Yw2UgrwD7HiNiSSNwJor1eCFGzUgYnN/iIknhNRVqjrrpuglw== -postcss-discard-duplicates@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-5.1.0.tgz#9eb4fe8456706a4eebd6d3b7b777d07bad03e848" - integrity sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw== +postcss-discard-duplicates@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-6.0.3.tgz#d121e893c38dc58a67277f75bb58ba43fce4c3eb" + integrity sha512-+JA0DCvc5XvFAxwx6f/e68gQu/7Z9ud584VLmcgto28eB8FqSFZwtrLwB5Kcp70eIoWP/HXqz4wpo8rD8gpsTw== -postcss-discard-empty@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-5.1.1.tgz#e57762343ff7f503fe53fca553d18d7f0c369c6c" - integrity sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A== +postcss-discard-empty@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-6.0.3.tgz#ee39c327219bb70473a066f772621f81435a79d9" + integrity sha512-znyno9cHKQsK6PtxL5D19Fj9uwSzC2mB74cpT66fhgOadEUPyXFkbgwm5tvc3bt3NAy8ltE5MrghxovZRVnOjQ== -postcss-discard-overridden@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz#7e8c5b53325747e9d90131bb88635282fb4a276e" - integrity sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw== +postcss-discard-overridden@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-6.0.2.tgz#4e9f9c62ecd2df46e8fdb44dc17e189776572e2d" + integrity sha512-j87xzI4LUggC5zND7KdjsI25APtyMuynXZSujByMaav2roV6OZX+8AaCUcZSWqckZpjAjRyFDdpqybgjFO0HJQ== postcss-import@^15.1.0: version "15.1.0" @@ -5569,99 +5819,98 @@ postcss-js@^4.0.1: dependencies: camelcase-css "^2.0.1" -postcss-load-config@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-4.0.1.tgz#152383f481c2758274404e4962743191d73875bd" - integrity sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA== +postcss-load-config@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-4.0.2.tgz#7159dcf626118d33e299f485d6afe4aff7c4a3e3" + integrity sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ== dependencies: - lilconfig "^2.0.5" - yaml "^2.1.1" + lilconfig "^3.0.0" + yaml "^2.3.4" postcss-loader@^7.3.0: - version "7.3.0" - resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-7.3.0.tgz#05991c1e490d8ff86ef18358d87db3b5b2dcb5f5" - integrity sha512-qLAFjvR2BFNz1H930P7mj1iuWJFjGey/nVhimfOAAQ1ZyPpcClAxP8+A55Sl8mBvM+K2a9Pjgdj10KpANWrNfw== + version "7.3.4" + resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-7.3.4.tgz#aed9b79ce4ed7e9e89e56199d25ad1ec8f606209" + integrity sha512-iW5WTTBSC5BfsBJ9daFMPVrLT36MrNiC6fqOZTTaHjBNX6Pfd5p+hSBqe/fEeNd7pc13QiAyGt7VdGMw4eRC4A== dependencies: - cosmiconfig "^8.1.3" - jiti "^1.18.2" - klona "^2.0.6" - semver "^7.3.8" + cosmiconfig "^8.3.5" + jiti "^1.20.0" + semver "^7.5.4" postcss-media-query-parser@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz#27b39c6f4d94f81b1a73b8f76351c609e5cef244" integrity sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig== -postcss-merge-longhand@^5.1.7: - version "5.1.7" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.1.7.tgz#24a1bdf402d9ef0e70f568f39bdc0344d568fb16" - integrity sha512-YCI9gZB+PLNskrK0BB3/2OzPnGhPkBEwmwhfYk1ilBHYVAZB7/tkTHFBAnCrvBBOmeYyMYw3DMjT55SyxMBzjQ== +postcss-merge-longhand@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-6.0.5.tgz#ba8a8d473617c34a36abbea8dda2b215750a065a" + integrity sha512-5LOiordeTfi64QhICp07nzzuTDjNSO8g5Ksdibt44d+uvIIAE1oZdRn8y/W5ZtYgRH/lnLDlvi9F8btZcVzu3w== dependencies: postcss-value-parser "^4.2.0" - stylehacks "^5.1.1" + stylehacks "^6.1.1" -postcss-merge-rules@^5.1.4: - version "5.1.4" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-5.1.4.tgz#2f26fa5cacb75b1402e213789f6766ae5e40313c" - integrity sha512-0R2IuYpgU93y9lhVbO/OylTtKMVcHb67zjWIfCiKR9rWL3GUk1677LAqD/BcHizukdZEjT8Ru3oHRoAYoJy44g== +postcss-merge-rules@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-6.1.1.tgz#7aa539dceddab56019469c0edd7d22b64c3dea9d" + integrity sha512-KOdWF0gju31AQPZiD+2Ar9Qjowz1LTChSjFFbS+e2sFgc4uHOp3ZvVX4sNeTlk0w2O31ecFGgrFzhO0RSWbWwQ== dependencies: - browserslist "^4.21.4" + browserslist "^4.23.0" caniuse-api "^3.0.0" - cssnano-utils "^3.1.0" - postcss-selector-parser "^6.0.5" + cssnano-utils "^4.0.2" + postcss-selector-parser "^6.0.16" -postcss-minify-font-values@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-5.1.0.tgz#f1df0014a726083d260d3bd85d7385fb89d1f01b" - integrity sha512-el3mYTgx13ZAPPirSVsHqFzl+BBBDrXvbySvPGFnQcTI4iNslrPaFq4muTkLZmKlGk4gyFAYUBMH30+HurREyA== +postcss-minify-font-values@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-6.1.0.tgz#a0e574c02ee3f299be2846369211f3b957ea4c59" + integrity sha512-gklfI/n+9rTh8nYaSJXlCo3nOKqMNkxuGpTn/Qm0gstL3ywTr9/WRKznE+oy6fvfolH6dF+QM4nCo8yPLdvGJg== dependencies: postcss-value-parser "^4.2.0" -postcss-minify-gradients@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-5.1.1.tgz#f1fe1b4f498134a5068240c2f25d46fcd236ba2c" - integrity sha512-VGvXMTpCEo4qHTNSa9A0a3D+dxGFZCYwR6Jokk+/3oB6flu2/PnPXAh2x7x52EkY5xlIHLm+Le8tJxe/7TNhzw== +postcss-minify-gradients@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-6.0.3.tgz#ca3eb55a7bdb48a1e187a55c6377be918743dbd6" + integrity sha512-4KXAHrYlzF0Rr7uc4VrfwDJ2ajrtNEpNEuLxFgwkhFZ56/7gaE4Nr49nLsQDZyUe+ds+kEhf+YAUolJiYXF8+Q== dependencies: - colord "^2.9.1" - cssnano-utils "^3.1.0" + colord "^2.9.3" + cssnano-utils "^4.0.2" postcss-value-parser "^4.2.0" -postcss-minify-params@^5.1.4: - version "5.1.4" - resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-5.1.4.tgz#c06a6c787128b3208b38c9364cfc40c8aa5d7352" - integrity sha512-+mePA3MgdmVmv6g+30rn57USjOGSAyuxUmkfiWpzalZ8aiBkdPYjXWtHuwJGm1v5Ojy0Z0LaSYhHaLJQB0P8Jw== +postcss-minify-params@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-6.1.0.tgz#54551dec77b9a45a29c3cb5953bf7325a399ba08" + integrity sha512-bmSKnDtyyE8ujHQK0RQJDIKhQ20Jq1LYiez54WiaOoBtcSuflfK3Nm596LvbtlFcpipMjgClQGyGr7GAs+H1uA== dependencies: - browserslist "^4.21.4" - cssnano-utils "^3.1.0" + browserslist "^4.23.0" + cssnano-utils "^4.0.2" postcss-value-parser "^4.2.0" -postcss-minify-selectors@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-5.2.1.tgz#d4e7e6b46147b8117ea9325a915a801d5fe656c6" - integrity sha512-nPJu7OjZJTsVUmPdm2TcaiohIwxP+v8ha9NehQ2ye9szv4orirRU3SDdtUmKH+10nzn0bAyOXZ0UEr7OpvLehg== +postcss-minify-selectors@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-6.0.4.tgz#197f7d72e6dd19eed47916d575d69dc38b396aff" + integrity sha512-L8dZSwNLgK7pjTto9PzWRoMbnLq5vsZSTu8+j1P/2GB8qdtGQfn+K1uSvFgYvgh83cbyxT5m43ZZhUMTJDSClQ== dependencies: - postcss-selector-parser "^6.0.5" + postcss-selector-parser "^6.0.16" -postcss-modules-extract-imports@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz#cda1f047c0ae80c97dbe28c3e76a43b88025741d" - integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw== +postcss-modules-extract-imports@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz#b4497cb85a9c0c4b5aabeb759bb25e8d89f15002" + integrity sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q== -postcss-modules-local-by-default@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz#ebbb54fae1598eecfdf691a02b3ff3b390a5a51c" - integrity sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ== +postcss-modules-local-by-default@^4.0.5: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz#d150f43837831dae25e4085596e84f6f5d6ec368" + integrity sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw== dependencies: icss-utils "^5.0.0" - postcss-selector-parser "^6.0.2" + postcss-selector-parser "^7.0.0" postcss-value-parser "^4.1.0" -postcss-modules-scope@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz#9ef3151456d3bbfa120ca44898dfca6f2fa01f06" - integrity sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg== +postcss-modules-scope@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz#1bbccddcb398f1d7a511e0a2d1d047718af4078c" + integrity sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA== dependencies: - postcss-selector-parser "^6.0.4" + postcss-selector-parser "^7.0.0" postcss-modules-values@^4.0.0: version "4.0.0" @@ -5670,103 +5919,102 @@ postcss-modules-values@^4.0.0: dependencies: icss-utils "^5.0.0" -postcss-nested@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/postcss-nested/-/postcss-nested-6.0.1.tgz#f83dc9846ca16d2f4fa864f16e9d9f7d0961662c" - integrity sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ== +postcss-nested@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/postcss-nested/-/postcss-nested-6.2.0.tgz#4c2d22ab5f20b9cb61e2c5c5915950784d068131" + integrity sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ== dependencies: - postcss-selector-parser "^6.0.11" + postcss-selector-parser "^6.1.1" -postcss-normalize-charset@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-5.1.0.tgz#9302de0b29094b52c259e9b2cf8dc0879879f0ed" - integrity sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg== +postcss-normalize-charset@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-6.0.2.tgz#1ec25c435057a8001dac942942a95ffe66f721e1" + integrity sha512-a8N9czmdnrjPHa3DeFlwqst5eaL5W8jYu3EBbTTkI5FHkfMhFZh1EGbku6jhHhIzTA6tquI2P42NtZ59M/H/kQ== -postcss-normalize-display-values@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-5.1.0.tgz#72abbae58081960e9edd7200fcf21ab8325c3da8" - integrity sha512-WP4KIM4o2dazQXWmFaqMmcvsKmhdINFblgSeRgn8BJ6vxaMyaJkwAzpPpuvSIoG/rmX3M+IrRZEz2H0glrQNEA== +postcss-normalize-display-values@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-6.0.2.tgz#54f02764fed0b288d5363cbb140d6950dbbdd535" + integrity sha512-8H04Mxsb82ON/aAkPeq8kcBbAtI5Q2a64X/mnRRfPXBq7XeogoQvReqxEfc0B4WPq1KimjezNC8flUtC3Qz6jg== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-positions@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-5.1.1.tgz#ef97279d894087b59325b45c47f1e863daefbb92" - integrity sha512-6UpCb0G4eofTCQLFVuI3EVNZzBNPiIKcA1AKVka+31fTVySphr3VUgAIULBhxZkKgwLImhzMR2Bw1ORK+37INg== +postcss-normalize-positions@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-6.0.2.tgz#e982d284ec878b9b819796266f640852dbbb723a" + integrity sha512-/JFzI441OAB9O7VnLA+RtSNZvQ0NCFZDOtp6QPFo1iIyawyXg0YI3CYM9HBy1WvwCRHnPep/BvI1+dGPKoXx/Q== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-repeat-style@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.1.1.tgz#e9eb96805204f4766df66fd09ed2e13545420fb2" - integrity sha512-mFpLspGWkQtBcWIRFLmewo8aC3ImN2i/J3v8YCFUwDnPu3Xz4rLohDO26lGjwNsQxB3YF0KKRwspGzE2JEuS0g== +postcss-normalize-repeat-style@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-6.0.2.tgz#f8006942fd0617c73f049dd8b6201c3a3040ecf3" + integrity sha512-YdCgsfHkJ2jEXwR4RR3Tm/iOxSfdRt7jplS6XRh9Js9PyCR/aka/FCb6TuHT2U8gQubbm/mPmF6L7FY9d79VwQ== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-string@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-5.1.0.tgz#411961169e07308c82c1f8c55f3e8a337757e228" - integrity sha512-oYiIJOf4T9T1N4i+abeIc7Vgm/xPCGih4bZz5Nm0/ARVJ7K6xrDlLwvwqOydvyL3RHNf8qZk6vo3aatiw/go3w== +postcss-normalize-string@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-6.0.2.tgz#e3cc6ad5c95581acd1fc8774b309dd7c06e5e363" + integrity sha512-vQZIivlxlfqqMp4L9PZsFE4YUkWniziKjQWUtsxUiVsSSPelQydwS8Wwcuw0+83ZjPWNTl02oxlIvXsmmG+CiQ== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-timing-functions@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-5.1.0.tgz#d5614410f8f0b2388e9f240aa6011ba6f52dafbb" - integrity sha512-DOEkzJ4SAXv5xkHl0Wa9cZLF3WCBhF3o1SKVxKQAa+0pYKlueTpCgvkFAHfk+Y64ezX9+nITGrDZeVGgITJXjg== +postcss-normalize-timing-functions@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-6.0.2.tgz#40cb8726cef999de984527cbd9d1db1f3e9062c0" + integrity sha512-a+YrtMox4TBtId/AEwbA03VcJgtyW4dGBizPl7e88cTFULYsprgHWTbfyjSLyHeBcK/Q9JhXkt2ZXiwaVHoMzA== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-unicode@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-5.1.1.tgz#f67297fca3fea7f17e0d2caa40769afc487aa030" - integrity sha512-qnCL5jzkNUmKVhZoENp1mJiGNPcsJCs1aaRmURmeJGES23Z/ajaln+EPTD+rBeNkSryI+2WTdW+lwcVdOikrpA== +postcss-normalize-unicode@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-6.1.0.tgz#aaf8bbd34c306e230777e80f7f12a4b7d27ce06e" + integrity sha512-QVC5TQHsVj33otj8/JD869Ndr5Xcc/+fwRh4HAsFsAeygQQXm+0PySrKbr/8tkDKzW+EVT3QkqZMfFrGiossDg== dependencies: - browserslist "^4.21.4" + browserslist "^4.23.0" postcss-value-parser "^4.2.0" -postcss-normalize-url@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-5.1.0.tgz#ed9d88ca82e21abef99f743457d3729a042adcdc" - integrity sha512-5upGeDO+PVthOxSmds43ZeMeZfKH+/DKgGRD7TElkkyS46JXAUhMzIKiCa7BabPeIy3AQcTkXwVVN7DbqsiCew== +postcss-normalize-url@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-6.0.2.tgz#292792386be51a8de9a454cb7b5c58ae22db0f79" + integrity sha512-kVNcWhCeKAzZ8B4pv/DnrU1wNh458zBNp8dh4y5hhxih5RZQ12QWMuQrDgPRw3LRl8mN9vOVfHl7uhvHYMoXsQ== dependencies: - normalize-url "^6.0.1" postcss-value-parser "^4.2.0" -postcss-normalize-whitespace@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-5.1.1.tgz#08a1a0d1ffa17a7cc6efe1e6c9da969cc4493cfa" - integrity sha512-83ZJ4t3NUDETIHTa3uEg6asWjSBYL5EdkVB0sDncx9ERzOKBVJIUeDO9RyA9Zwtig8El1d79HBp0JEi8wvGQnA== +postcss-normalize-whitespace@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-6.0.2.tgz#fbb009e6ebd312f8b2efb225c2fcc7cf32b400cd" + integrity sha512-sXZ2Nj1icbJOKmdjXVT9pnyHQKiSAyuNQHSgRCUgThn2388Y9cGVDR+E9J9iAYbSbLHI+UUwLVl1Wzco/zgv0Q== dependencies: postcss-value-parser "^4.2.0" -postcss-ordered-values@^5.1.3: - version "5.1.3" - resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-5.1.3.tgz#b6fd2bd10f937b23d86bc829c69e7732ce76ea38" - integrity sha512-9UO79VUhPwEkzbb3RNpqqghc6lcYej1aveQteWY+4POIwlqkYE21HKWaLDF6lWNuqCobEAyTovVhtI32Rbv2RQ== +postcss-ordered-values@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-6.0.2.tgz#366bb663919707093451ab70c3f99c05672aaae5" + integrity sha512-VRZSOB+JU32RsEAQrO94QPkClGPKJEL/Z9PCBImXMhIeK5KAYo6slP/hBYlLgrCjFxyqvn5VC81tycFEDBLG1Q== dependencies: - cssnano-utils "^3.1.0" + cssnano-utils "^4.0.2" postcss-value-parser "^4.2.0" -postcss-reduce-initial@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-5.1.2.tgz#798cd77b3e033eae7105c18c9d371d989e1382d6" - integrity sha512-dE/y2XRaqAi6OvjzD22pjTUQ8eOfc6m/natGHgKFBK9DxFmIm69YmaRVQrGgFlEfc1HePIurY0TmDeROK05rIg== +postcss-reduce-initial@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-6.1.0.tgz#4401297d8e35cb6e92c8e9586963e267105586ba" + integrity sha512-RarLgBK/CrL1qZags04oKbVbrrVK2wcxhvta3GCxrZO4zveibqbRPmm2VI8sSgCXwoUHEliRSbOfpR0b/VIoiw== dependencies: - browserslist "^4.21.4" + browserslist "^4.23.0" caniuse-api "^3.0.0" -postcss-reduce-transforms@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-5.1.0.tgz#333b70e7758b802f3dd0ddfe98bb1ccfef96b6e9" - integrity sha512-2fbdbmgir5AvpW9RLtdONx1QoYG2/EtqpNQbFASDlixBbAYuTcJ0dECwlqNqH7VbaUnEnh8SrxOe2sRIn24XyQ== +postcss-reduce-transforms@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-6.0.2.tgz#6fa2c586bdc091a7373caeee4be75a0f3e12965d" + integrity sha512-sB+Ya++3Xj1WaT9+5LOOdirAxP7dJZms3GRcYheSPi1PiTMigsxHAdkrbItHxwYHr4kt1zL7mmcHstgMYT+aiA== dependencies: postcss-value-parser "^4.2.0" postcss-resolve-nested-selector@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz#29ccbc7c37dedfac304e9fff0bf1596b3f6a0e4e" - integrity sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw== + version "0.1.6" + resolved "https://registry.yarnpkg.com/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.6.tgz#3d84dec809f34de020372c41b039956966896686" + integrity sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw== postcss-safe-parser@^6.0.0: version "6.0.0" @@ -5774,22 +6022,22 @@ postcss-safe-parser@^6.0.0: integrity sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ== postcss-scss@^4.0.2: - version "4.0.6" - resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.6.tgz#5d62a574b950a6ae12f2aa89b60d63d9e4432bfd" - integrity sha512-rLDPhJY4z/i4nVFZ27j9GqLxj1pwxE80eAzUNRMXtcpipFYIeowerzBgG3yJhMtObGEXidtIgbUpQ3eLDsf5OQ== + version "4.0.9" + resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.9.tgz#a03c773cd4c9623cb04ce142a52afcec74806685" + integrity sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A== -postcss-selector-parser@^6.0.11, postcss-selector-parser@^6.0.13: - version "6.0.13" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz#d05d8d76b1e8e173257ef9d60b706a8e5e99bf1b" - integrity sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ== +postcss-selector-parser@^6.0.11, postcss-selector-parser@^6.0.13, postcss-selector-parser@^6.0.16, postcss-selector-parser@^6.1.1, postcss-selector-parser@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz#27ecb41fb0e3b6ba7a1ec84fff347f734c7929de" + integrity sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg== dependencies: cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.5, postcss-selector-parser@^6.0.9: - version "6.0.12" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.12.tgz#2efae5ffab3c8bfb2b7fbf0c426e3bca616c4abb" - integrity sha512-NdxGCAZdRrwVI1sy59+Wzrh+pMMHxapGnpfenDVlMEXoOcvt4pGE0JLK9YY2F5dLxcFYA/YbVQKhcGU+FtSYQg== +postcss-selector-parser@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-7.0.0.tgz#41bd8b56f177c093ca49435f65731befe25d6b9c" + integrity sha512-9RbEr1Y7FFfptd/1eEdntyjMwLeghW1bHX9GWjXo19vx4ytPQhANltvVxDggzJl7mnWM+dX28kb6cyS/4iQjlQ== dependencies: cssesc "^3.0.0" util-deprecate "^1.0.2" @@ -5809,20 +6057,20 @@ postcss-svg@^3.0.0: svgo "^1.1.1" xmldoc "^1.1.2" -postcss-svgo@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-5.1.0.tgz#0a317400ced789f233a28826e77523f15857d80d" - integrity sha512-D75KsH1zm5ZrHyxPakAxJWtkyXew5qwS70v56exwvw542d9CRtTo78K0WeFxZB4G7JXKKMbEZtZayTGdIky/eA== +postcss-svgo@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-6.0.3.tgz#1d6e180d6df1fa8a3b30b729aaa9161e94f04eaa" + integrity sha512-dlrahRmxP22bX6iKEjOM+c8/1p+81asjKT+V5lrgOH944ryx/OHpclnIbGsKVd3uWOXFLYJwCVf0eEkJGvO96g== dependencies: postcss-value-parser "^4.2.0" - svgo "^2.7.0" + svgo "^3.2.0" -postcss-unique-selectors@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-5.1.1.tgz#a9f273d1eacd09e9aa6088f4b0507b18b1b541b6" - integrity sha512-5JiODlELrz8L2HwxfPnhOWZYWDxVHWL83ufOv84NrcgipI7TaeRsatAhK4Tr2/ZiYldpK/wBvw5BD3qfaK96GA== +postcss-unique-selectors@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-6.0.4.tgz#983ab308896b4bf3f2baaf2336e14e52c11a2088" + integrity sha512-K38OCaIrO8+PzpArzkLKB42dSARtC2tmG6PvD4b1o1Q2E9Os8jzfWFfSy/rixsHwohtsDdFtAWGjFVFUdwYaMg== dependencies: - postcss-selector-parser "^6.0.5" + postcss-selector-parser "^6.0.16" postcss-value-parser@^4.0.0, postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: version "4.2.0" @@ -5846,23 +6094,14 @@ postcss@^7.0.6: picocolors "^0.2.1" source-map "^0.6.1" -postcss@^8.2.14, postcss@^8.3.11, postcss@^8.4.17, postcss@^8.4.19: - version "8.4.23" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.23.tgz#df0aee9ac7c5e53e1075c24a3613496f9e6552ab" - integrity sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA== - dependencies: - nanoid "^3.3.6" - picocolors "^1.0.0" - source-map-js "^1.0.2" - -postcss@^8.4.23: - version "8.4.26" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.26.tgz#1bc62ab19f8e1e5463d98cf74af39702a00a9e94" - integrity sha512-jrXHFF8iTloAenySjM/ob3gSj7pCu0Ji49hnjqzsgSRa50hkWCKD0HQ+gMNJkW38jBI68MpAAg7ZWwHwX8NMMw== +postcss@^8.2.14, postcss@^8.3.11, postcss@^8.4.19, postcss@^8.4.24, postcss@^8.4.33, postcss@^8.4.47: + version "8.5.1" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.1.tgz#e2272a1f8a807fafa413218245630b5db10a3214" + integrity sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ== dependencies: - nanoid "^3.3.6" - picocolors "^1.0.0" - source-map-js "^1.0.2" + nanoid "^3.3.8" + picocolors "^1.1.1" + source-map-js "^1.2.1" prettier@^2.4.1: version "2.8.8" @@ -5887,6 +6126,11 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== + proxy-addr@~2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" @@ -5905,35 +6149,37 @@ proxy-from-env@^1.1.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== -psl@^1.1.28: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== +psl@^1.1.33: + version "1.15.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.15.0.tgz#bdace31896f1d97cec6a79e8224898ce93d974c6" + integrity sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w== + dependencies: + punycode "^2.3.1" pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + version "3.0.2" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8" + integrity sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw== dependencies: end-of-stream "^1.1.0" once "^1.3.1" -punycode@^2.1.0, punycode@^2.1.1: - version "2.3.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== +punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== -q@^1.1.2, q@^1.5.1: +q@^1.1.2: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== -qs@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== +qs@6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" + integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== dependencies: - side-channel "^1.0.4" + side-channel "^1.0.6" qs@~6.10.3: version "6.10.5" @@ -5942,6 +6188,11 @@ qs@~6.10.3: dependencies: side-channel "^1.0.4" +querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -5964,10 +6215,10 @@ range-parser@^1.2.1, range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== dependencies: bytes "3.1.2" http-errors "2.0.0" @@ -6022,6 +6273,11 @@ readable-stream@^2.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" +readdirp@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-4.1.1.tgz#bd115327129672dc47f87408f05df9bd9ca3ef55" + integrity sha512-h80JrZu/MHUZCyHu5ciuoI0+WxsCxzxJTILn6Fs8rxSnFPh+UVHYfeIxK1nVGugMqkfC4vJcBOYbkfkwYK0+gw== + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -6044,10 +6300,24 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -regenerate-unicode-properties@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c" - integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== +reflect.getprototypeof@^1.0.6, reflect.getprototypeof@^1.0.9: + version "1.0.10" + resolved "https://registry.yarnpkg.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz#c629219e78a3316d8b604c765ef68996964e7bf9" + integrity sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw== + dependencies: + call-bind "^1.0.8" + define-properties "^1.2.1" + es-abstract "^1.23.9" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + get-intrinsic "^1.2.7" + get-proto "^1.0.1" + which-builtin-type "^1.2.1" + +regenerate-unicode-properties@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz#626e39df8c372338ea9b8028d1f99dc3fd9c3db0" + integrity sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA== dependencies: regenerate "^1.4.2" @@ -6056,50 +6326,63 @@ regenerate@^1.4.2: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.13.11, regenerator-runtime@^0.13.9: +regenerator-runtime@^0.13.9: version "0.13.11" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== -regenerator-transform@^0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56" - integrity sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg== +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + +regenerator-transform@^0.15.2: + version "0.15.2" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" + integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== dependencies: "@babel/runtime" "^7.8.4" regex-parser@^2.2.11: - version "2.2.11" - resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.2.11.tgz#3b37ec9049e19479806e878cabe7c1ca83ccfe58" - integrity sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q== - -regexp.prototype.flags@^1.4.3: - version "1.5.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" - integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - functions-have-names "^1.2.3" - -regexpu-core@^5.3.1: - version "5.3.2" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" - integrity sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== + version "2.3.0" + resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.3.0.tgz#4bb61461b1a19b8b913f3960364bb57887f920ee" + integrity sha512-TVILVSz2jY5D47F4mA4MppkBrafEaiUWJO/TcZHEIuI13AqoZMkK1WMA4Om1YkYbTx+9Ki1/tSUXbceyr9saRg== + +regexp.prototype.flags@^1.5.3: + version "1.5.4" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz#1ad6c62d44a259007e55b3970e00f746efbcaa19" + integrity sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA== + dependencies: + call-bind "^1.0.8" + define-properties "^1.2.1" + es-errors "^1.3.0" + get-proto "^1.0.1" + gopd "^1.2.0" + set-function-name "^2.0.2" + +regexpu-core@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-6.2.0.tgz#0e5190d79e542bf294955dccabae04d3c7d53826" + integrity sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA== dependencies: - "@babel/regjsgen" "^0.8.0" regenerate "^1.4.2" - regenerate-unicode-properties "^10.1.0" - regjsparser "^0.9.1" + regenerate-unicode-properties "^10.2.0" + regjsgen "^0.8.0" + regjsparser "^0.12.0" unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.1.0" -regjsparser@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" - integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== +regjsgen@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.8.0.tgz#df23ff26e0c5b300a6470cad160a9d090c3a37ab" + integrity sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q== + +regjsparser@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.12.0.tgz#0e846df6c6530586429377de56e0475583b088dc" + integrity sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ== dependencies: - jsesc "~0.5.0" + jsesc "~3.0.2" renderkid@^3.0.0: version "3.0.0" @@ -6169,12 +6452,12 @@ resolve-url-loader@^5.0.0: postcss "^8.2.14" source-map "0.6.1" -resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.2: - version "1.22.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" - integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== +resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.8: + version "1.22.10" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39" + integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== dependencies: - is-core-module "^2.11.0" + is-core-module "^2.16.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -6197,9 +6480,9 @@ reusify@^1.0.4: integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== rfdc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" - integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== + version "1.4.1" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.4.1.tgz#778f76c4fb731d93414e8f925fbecf64cce7f6ca" + integrity sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== rimraf@^2.6.3: version "2.7.1" @@ -6208,7 +6491,7 @@ rimraf@^2.6.3: dependencies: glob "^7.1.3" -rimraf@^3.0.0, rimraf@^3.0.2: +rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -6216,11 +6499,11 @@ rimraf@^3.0.0, rimraf@^3.0.2: glob "^7.1.3" rimraf@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.0.tgz#5bda14e410d7e4dd522154891395802ce032c2cb" - integrity sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g== + version "5.0.10" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.10.tgz#23b9843d3dc92db71f96e1a2ce92e39fd2a8221c" + integrity sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ== dependencies: - glob "^10.0.0" + glob "^10.3.7" run-parallel@^1.1.9: version "1.2.0" @@ -6236,34 +6519,43 @@ rxjs@^7.5.1: dependencies: tslib "^2.1.0" -safe-array-concat@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.0.tgz#2064223cba3c08d2ee05148eedbc563cd6d84060" - integrity sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ== +safe-array-concat@^1.1.2, safe-array-concat@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.1.3.tgz#c9e54ec4f603b0bbb8e7e5007a5ee7aecd1538c3" + integrity sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q== dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.2.0" - has-symbols "^1.0.3" + call-bind "^1.0.8" + call-bound "^1.0.2" + get-intrinsic "^1.2.6" + has-symbols "^1.1.0" isarray "^2.0.5" -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-regex-test@^1.0.0: +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-push-apply@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" - integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== + resolved "https://registry.yarnpkg.com/safe-push-apply/-/safe-push-apply-1.0.0.tgz#01850e981c1602d398c85081f360e4e6d03d27f5" + integrity sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA== + dependencies: + es-errors "^1.3.0" + isarray "^2.0.5" + +safe-regex-test@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.1.0.tgz#7f87dfb67a3150782eaaf18583ff5d1711ac10c1" + integrity sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw== dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.3" - is-regex "^1.1.4" + call-bound "^1.0.2" + es-errors "^1.3.0" + is-regex "^1.2.1" "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" @@ -6271,49 +6563,46 @@ safe-regex-test@^1.0.0: integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== sass-loader@^13.2.2: - version "13.2.2" - resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-13.2.2.tgz#f97e803993b24012c10d7ba9676548bf7a6b18b9" - integrity sha512-nrIdVAAte3B9icfBiGWvmMhT/D+eCDwnk+yA7VE/76dp/WkHX+i44Q/pfo71NYbwj0Ap+PGsn0ekOuU1WFJ2AA== + version "13.3.3" + resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-13.3.3.tgz#60df5e858788cffb1a3215e5b92e9cba61e7e133" + integrity sha512-mt5YN2F1MOZr3d/wBRcZxeFgwgkH44wVc2zohO2YF6JiOMkiXe4BYRZpSu2sO1g71mo/j16txzUhsKZlqjVGzA== dependencies: - klona "^2.0.6" neo-async "^2.6.2" sass@^1.43.4: - version "1.62.1" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.62.1.tgz#caa8d6bf098935bc92fc73fa169fb3790cacd029" - integrity sha512-NHpxIzN29MXvWiuswfc1W3I0N8SXBd8UR26WntmDlRYf0bSADnwnOjsyMZ3lMezSlArD33Vs3YFhp7dWvL770A== + version "1.83.4" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.83.4.tgz#5ccf60f43eb61eeec300b780b8dcb85f16eec6d1" + integrity sha512-B1bozCeNQiOgDcLd33e2Cs2U60wZwjUUXzh900ZyQF5qUasvMdDZYbQ566LJu7cqR+sAHlAfO6RMkaID5s6qpA== dependencies: - chokidar ">=3.0.0 <4.0.0" - immutable "^4.0.0" + chokidar "^4.0.0" + immutable "^5.0.2" source-map-js ">=0.6.2 <2.0.0" + optionalDependencies: + "@parcel/watcher" "^2.4.1" + +sax@^1.2.4: + version "1.4.1" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.4.1.tgz#44cc8988377f126304d3b3fc1010c733b929ef0f" + integrity sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg== -sax@^1.2.4, sax@~1.2.4: +sax@~1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -schema-utils@^2.6.5: - version "2.7.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7" - integrity sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg== - dependencies: - "@types/json-schema" "^7.0.5" - ajv "^6.12.4" - ajv-keywords "^3.5.2" - -schema-utils@^3.0.0, schema-utils@^3.1.1, schema-utils@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.2.tgz#36c10abca6f7577aeae136c804b0c741edeadc99" - integrity sha512-pvjEHOgWc9OWA/f/DE3ohBWTD6EleVLf7iFUkoSwAxttdBhB9QUebQgxER2kWueOvRJXPHNnyrvvh9eZINB8Eg== +schema-utils@^3.0.0, schema-utils@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== dependencies: "@types/json-schema" "^7.0.8" ajv "^6.12.5" ajv-keywords "^3.5.2" -schema-utils@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.0.1.tgz#eb2d042df8b01f4b5c276a2dfd41ba0faab72e8d" - integrity sha512-lELhBAAly9NowEsX0yZBlw9ahZG+sK/1RJ21EpzdYHKEs13Vku3LJ+MIPhh4sMs0oCCeufZQEQbMekiA4vuVIQ== +schema-utils@^4.0.0, schema-utils@^4.0.1, schema-utils@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.0.tgz#3b669f04f71ff2dfb5aba7ce2d5a9d79b35622c0" + integrity sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g== dependencies: "@types/json-schema" "^7.0.9" ajv "^8.9.0" @@ -6326,10 +6615,11 @@ select-hose@^2.0.0: integrity sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg== selfsigned@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-2.1.1.tgz#18a7613d714c0cd3385c48af0075abf3f266af61" - integrity sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ== + version "2.4.1" + resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-2.4.1.tgz#560d90565442a3ed35b674034cec4e95dceb4ae0" + integrity sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q== dependencies: + "@types/node-forge" "^1.3.0" node-forge "^1" "semver@2 || 3 || 4 || 5": @@ -6337,29 +6627,27 @@ selfsigned@^2.1.1: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@7.5.0, semver@^7.3.2, semver@^7.3.8: - version "7.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0" - integrity sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA== - dependencies: - lru-cache "^6.0.0" - -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.3.4: +semver@7.5.4: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" -send@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== +semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.3.2, semver@^7.3.4, semver@^7.5.3, semver@^7.5.4: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + +send@0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" + integrity sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw== dependencies: debug "2.6.9" depd "2.0.0" @@ -6375,10 +6663,10 @@ send@0.18.0: range-parser "~1.2.1" statuses "2.0.1" -serialize-javascript@^6.0.0, serialize-javascript@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c" - integrity sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w== +serialize-javascript@^6.0.1, serialize-javascript@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== dependencies: randombytes "^2.1.0" @@ -6395,15 +6683,46 @@ serve-index@^1.9.1: mime-types "~2.1.17" parseurl "~1.3.2" -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== +serve-static@1.16.2: + version "1.16.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296" + integrity sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw== dependencies: - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.18.0" + send "0.19.0" + +set-function-length@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + +set-function-name@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" + integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.2" + +set-proto@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/set-proto/-/set-proto-1.0.0.tgz#0760dbcff30b2d7e801fd6e19983e56da337565e" + integrity sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw== + dependencies: + dunder-proto "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" setprototypeof@1.1.0: version "1.1.0" @@ -6434,24 +6753,55 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -shell-quote@^1.7.3: - version "1.8.1" - resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680" - integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA== +shell-quote@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.2.tgz#d2d83e057959d53ec261311e9e9b8f51dcb2934a" + integrity sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA== shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== +side-channel-list@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/side-channel-list/-/side-channel-list-1.0.0.tgz#10cb5984263115d3b7a0e336591e290a830af8ad" + integrity sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA== + dependencies: + es-errors "^1.3.0" + object-inspect "^1.13.3" + +side-channel-map@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/side-channel-map/-/side-channel-map-1.0.1.tgz#d6bb6b37902c6fef5174e5f533fab4c732a26f42" + integrity sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" + +side-channel-weakmap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz#11dda19d5368e40ce9ec2bdc1fb0ecbc0790ecea" + integrity sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" + side-channel-map "^1.0.1" + +side-channel@^1.0.4, side-channel@^1.0.6, side-channel@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" + integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" + es-errors "^1.3.0" + object-inspect "^1.13.3" + side-channel-list "^1.0.0" + side-channel-map "^1.0.1" + side-channel-weakmap "^1.0.2" signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" @@ -6459,9 +6809,9 @@ signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== signal-exit@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" - integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== slash@^3.0.0: version "3.0.0" @@ -6500,10 +6850,10 @@ sockjs@^0.3.24: uuid "^8.3.2" websocket-driver "^0.7.4" -"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" - integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== +"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.1, source-map-js@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== source-map-support@~0.5.20: version "0.5.21" @@ -6527,9 +6877,9 @@ spdx-correct@^3.0.0: spdx-license-ids "^3.0.0" spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + version "2.5.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz#5d607d27fc806f66d7b64a766650fa890f04ed66" + integrity sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w== spdx-expression-parse@^3.0.0: version "3.0.1" @@ -6540,9 +6890,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.13" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz#7189a474c46f8d47c7b0da4b987bb45e908bd2d5" - integrity sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w== + version "3.0.21" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz#6d6e980c9df2b6fc905343a3b2d702a6239536c3" + integrity sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg== spdy-transport@^3.0.0: version "3.0.0" @@ -6567,7 +6917,7 @@ spdy@^4.0.2: select-hose "^2.0.0" spdy-transport "^3.0.0" -split2@^3.0.0: +split2@^3.0.0, split2@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== @@ -6580,9 +6930,9 @@ sprintf-js@~1.0.2: integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== sshpk@^1.14.1: - version "1.17.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" - integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== + version "1.18.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.18.0.tgz#1663e55cddf4d688b86a46b77f0d5fe363aba028" + integrity sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -6619,7 +6969,16 @@ string-natural-compare@^2.0.2: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-2.0.3.tgz#9dbe1dd65490a5fe14f7a5c9bc686fc67cb9c6e4" integrity sha512-4Kcl12rNjc+6EKhY8QyDVuQTAlMWwRiNbsxnVwBUKFr7dYPQuXVrtNU4sEkjF9LHY0AY6uVbB3ktbkIH4LC+BQ== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -6637,32 +6996,37 @@ string-width@^5.0.1, string-width@^5.1.2: emoji-regex "^9.2.2" strip-ansi "^7.0.1" -string.prototype.trim@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" - integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== +string.prototype.trim@^1.2.10: + version "1.2.10" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz#40b2dd5ee94c959b4dcfb1d65ce72e90da480c81" + integrity sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + call-bind "^1.0.8" + call-bound "^1.0.2" + define-data-property "^1.1.4" + define-properties "^1.2.1" + es-abstract "^1.23.5" + es-object-atoms "^1.0.0" + has-property-descriptors "^1.0.2" -string.prototype.trimend@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" - integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== +string.prototype.trimend@^1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz#62e2731272cd285041b36596054e9f66569b6942" + integrity sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + call-bind "^1.0.8" + call-bound "^1.0.2" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" -string.prototype.trimstart@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" - integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== +string.prototype.trimstart@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz#7ee834dda8c7c17eff3118472bb35bfedaa34dde" + integrity sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" string_decoder@^1.1.1: version "1.3.0" @@ -6678,7 +7042,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -6686,9 +7057,9 @@ string_decoder@~1.1.1: ansi-regex "^5.0.1" strip-ansi@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" - integrity sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw== + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== dependencies: ansi-regex "^6.0.1" @@ -6710,22 +7081,22 @@ strip-json-comments@5.0.0: integrity sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw== style-loader@^3.3.0: - version "3.3.2" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.2.tgz#eaebca714d9e462c19aa1e3599057bc363924899" - integrity sha512-RHs/vcrKdQK8wZliteNK4NKzxvLBzpuHMqYmUVWeKa6MkaIQ97ZTOS0b+zapZhy6GcrgWnvWYCMHRirC3FsUmw== + version "3.3.4" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.4.tgz#f30f786c36db03a45cbd55b6a70d930c479090e7" + integrity sha512-0WqXzrsMTyb8yjZJHDqwmnwRJvhALK9LfRtRc6B4UTWe8AijYLZYZ9thuJTZc2VfQWINADW/j+LiJnfy2RoC1w== style-search@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902" integrity sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg== -stylehacks@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-5.1.1.tgz#7934a34eb59d7152149fa69d6e9e56f2fc34bcc9" - integrity sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw== +stylehacks@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-6.1.1.tgz#543f91c10d17d00a440430362d419f79c25545a6" + integrity sha512-gSTTEQ670cJNoaeIp9KX6lZmm8LJ3jPB5yJmX8Zq/wQxOsAFXV3qjWzHas3YYk1qesuVIyYWWUpZ0vSE/dTSGg== dependencies: - browserslist "^4.21.4" - postcss-selector-parser "^6.0.4" + browserslist "^4.23.0" + postcss-selector-parser "^6.0.16" stylelint-config-idiomatic-order@^9.0.0: version "9.0.0" @@ -6760,10 +7131,11 @@ stylelint-order@^5.0.0: postcss-sorting "^7.0.1" stylelint-scss@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-5.0.1.tgz#b33a6580b5734eace083cfc2cc3021225e28547f" - integrity sha512-n87iCRZrr2J7//I/QFsDXxFLnHKw633U4qvWZ+mOW6KDAp/HLj06H+6+f9zOuTYy+MdGdTuCSDROCpQIhw5fvQ== + version "5.3.2" + resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-5.3.2.tgz#c54564dfbd98de0c08742b9c43025cda91acf940" + integrity sha512-4LzLaayFhFyneJwLo0IUa8knuIvj+zF0vBFueQs4e3tEaAMIQX8q5th8ziKkgOavr6y/y9yoBe+RXN/edwLzsQ== dependencies: + known-css-properties "^0.29.0" postcss-media-query-parser "^0.2.3" postcss-resolve-nested-selector "^0.1.1" postcss-selector-parser "^6.0.13" @@ -6813,14 +7185,14 @@ stylelint@^14.16.1: v8-compile-cache "^2.3.0" write-file-atomic "^4.0.2" -sucrase@^3.32.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.32.0.tgz#c4a95e0f1e18b6847127258a75cf360bc568d4a7" - integrity sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ== +sucrase@^3.35.0: + version "3.35.0" + resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.35.0.tgz#57f17a3d7e19b36d8995f06679d121be914ae263" + integrity sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA== dependencies: "@jridgewell/gen-mapping" "^0.3.2" commander "^4.0.0" - glob "7.1.6" + glob "^10.3.10" lines-and-columns "^1.1.6" mz "^2.7.0" pirates "^4.0.1" @@ -6884,18 +7256,18 @@ svgo@^1.1.1: unquote "~1.1.1" util.promisify "~1.0.0" -svgo@^2.7.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.8.0.tgz#4ff80cce6710dc2795f0c7c74101e6764cfccd24" - integrity sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg== +svgo@^3.2.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/svgo/-/svgo-3.3.2.tgz#ad58002652dffbb5986fc9716afe52d869ecbda8" + integrity sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw== dependencies: "@trysound/sax" "0.2.0" commander "^7.2.0" - css-select "^4.1.3" - css-tree "^1.1.3" - csso "^4.2.0" + css-select "^5.1.0" + css-tree "^2.3.1" + css-what "^6.1.0" + csso "^5.0.5" picocolors "^1.0.0" - stable "^0.1.8" sync-rpc@^1.3.6: version "1.3.6" @@ -6910,9 +7282,9 @@ tabbable@^5.3.3: integrity sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA== table@^6.8.1: - version "6.8.1" - resolved "https://registry.yarnpkg.com/table/-/table-6.8.1.tgz#ea2b71359fe03b017a5fbc296204471158080bdf" - integrity sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA== + version "6.9.0" + resolved "https://registry.yarnpkg.com/table/-/table-6.9.0.tgz#50040afa6264141c7566b3b81d4d82c47a8668f5" + integrity sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A== dependencies: ajv "^8.0.1" lodash.truncate "^4.4.2" @@ -6921,62 +7293,61 @@ table@^6.8.1: strip-ansi "^6.0.1" tailwind-scrollbar@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/tailwind-scrollbar/-/tailwind-scrollbar-3.0.0.tgz#efc233195afc69bcae4cff393600d31fabe7860c" - integrity sha512-OkVRX9Q1T769vk979UZ519jhj/j/zNBHql7zPLI+tlhX+ahksYO4ZryWD29lOETDx9Wj1sw+K1OeW7W3+ECQOA== + version "3.1.0" + resolved "https://registry.yarnpkg.com/tailwind-scrollbar/-/tailwind-scrollbar-3.1.0.tgz#ff7596407b6da5209261d8ff03860ab9206a59e3" + integrity sha512-pmrtDIZeHyu2idTejfV59SbaJyvp1VRjYxAjZBH0jnyrPRo6HL1kD5Glz8VPagasqr6oAx6M05+Tuw429Z8jxg== tailwindcss@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.3.2.tgz#2f9e35d715fdf0bbf674d90147a0684d7054a2d3" - integrity sha512-9jPkMiIBXvPc2KywkraqsUfbfj+dHDb+JPWtSJa9MLFdrPyazI7q6WX2sUrm7R9eVR7qqv3Pas7EvQFzxKnI6w== + version "3.4.17" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.4.17.tgz#ae8406c0f96696a631c790768ff319d46d5e5a63" + integrity sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og== dependencies: "@alloc/quick-lru" "^5.2.0" arg "^5.0.2" - chokidar "^3.5.3" + chokidar "^3.6.0" didyoumean "^1.2.2" dlv "^1.1.3" - fast-glob "^3.2.12" + fast-glob "^3.3.2" glob-parent "^6.0.2" is-glob "^4.0.3" - jiti "^1.18.2" - lilconfig "^2.1.0" - micromatch "^4.0.5" + jiti "^1.21.6" + lilconfig "^3.1.3" + micromatch "^4.0.8" normalize-path "^3.0.0" object-hash "^3.0.0" - picocolors "^1.0.0" - postcss "^8.4.23" + picocolors "^1.1.1" + postcss "^8.4.47" postcss-import "^15.1.0" postcss-js "^4.0.1" - postcss-load-config "^4.0.1" - postcss-nested "^6.0.1" - postcss-selector-parser "^6.0.11" - postcss-value-parser "^4.2.0" - resolve "^1.22.2" - sucrase "^3.32.0" + postcss-load-config "^4.0.2" + postcss-nested "^6.2.0" + postcss-selector-parser "^6.1.2" + resolve "^1.22.8" + sucrase "^3.35.0" tapable@^2.1.1, tapable@^2.2.0, tapable@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== -terser-webpack-plugin@^5.3.0, terser-webpack-plugin@^5.3.7: - version "5.3.7" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.7.tgz#ef760632d24991760f339fe9290deb936ad1ffc7" - integrity sha512-AfKwIktyP7Cu50xNjXF/6Qb5lBNzYaWpU6YfoX3uZicTx0zTy0stDDCsvjDapKsSDvOeWo5MEq4TmdBy2cNoHw== +terser-webpack-plugin@^5.3.0, terser-webpack-plugin@^5.3.10: + version "5.3.11" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.11.tgz#93c21f44ca86634257cac176f884f942b7ba3832" + integrity sha512-RVCsMfuD0+cTt3EwX8hSl2Ks56EbFHWmhluwcqoPKtBnfjiT6olaq7PRIRfhyU8nnC2MrnDrBLfrD/RGE+cVXQ== dependencies: - "@jridgewell/trace-mapping" "^0.3.17" + "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" - schema-utils "^3.1.1" - serialize-javascript "^6.0.1" - terser "^5.16.5" + schema-utils "^4.3.0" + serialize-javascript "^6.0.2" + terser "^5.31.1" -terser@^5.16.5: - version "5.17.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.17.1.tgz#948f10830454761e2eeedc6debe45c532c83fd69" - integrity sha512-hVl35zClmpisy6oaoKALOpS0rDYLxRFLHhRuDlEGTKey9qHjS1w9GMORjuwIMt70Wan4lwsLYyWDVnWgF+KUEw== +terser@^5.31.1: + version "5.37.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.37.0.tgz#38aa66d1cfc43d0638fab54e43ff8a4f72a21ba3" + integrity sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA== dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" commander "^2.20.0" source-map-support "~0.5.20" @@ -7000,9 +7371,9 @@ thenify-all@^1.0.0: any-promise "^1.0.0" throttleit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" - integrity sha512-rkTVqu6IjfQ/6+uNuuc3sZek4CEYxTJom3IktzgdSxcZqdARuebbA/f4QmAxMQIxqq9ZLEUkSYqvuk1I6VKq4g== + version "1.0.1" + resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.1.tgz#304ec51631c3b770c65c6c6f76938b384000f4d5" + integrity sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ== through2@^4.0.0: version "4.0.2" @@ -7029,16 +7400,9 @@ tippy.js@^6.3.7: "@popperjs/core" "^2.9.0" tmp@^0.2.1, tmp@~0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" - integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== - dependencies: - rimraf "^3.0.0" - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + version "0.2.3" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" + integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w== to-regex-range@^5.0.1: version "5.0.1" @@ -7052,13 +7416,15 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== +tough-cookie@^4.1.3: + version "4.1.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" + integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== dependencies: - psl "^1.1.28" + psl "^1.1.33" punycode "^2.1.1" + universalify "^0.2.0" + url-parse "^1.5.3" trim-newlines@^3.0.0: version "3.0.1" @@ -7071,9 +7437,9 @@ ts-interface-checker@^0.1.9: integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== ts-node@^10.8.1: - version "10.9.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" - integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + version "10.9.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== dependencies: "@cspotcode/source-map-support" "^0.8.0" "@tsconfig/node10" "^1.0.7" @@ -7090,9 +7456,9 @@ ts-node@^10.8.1: yn "3.1.1" tslib@^2.1.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" - integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== tunnel-agent@^0.6.0: version "0.6.0" @@ -7134,39 +7500,80 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -typed-array-length@^1.0.4: +typed-array-buffer@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz#a72395450a4869ec033fd549371b47af3a2ee536" + integrity sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + is-typed-array "^1.1.14" + +typed-array-byte-length@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz#8407a04f7d78684f3d252aa1a143d2b77b4160ce" + integrity sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg== + dependencies: + call-bind "^1.0.8" + for-each "^0.3.3" + gopd "^1.2.0" + has-proto "^1.2.0" + is-typed-array "^1.1.14" + +typed-array-byte-offset@^1.0.4: version "1.0.4" - resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" - integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz#ae3698b8ec91a8ab945016108aef00d5bff12355" + integrity sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.8" + for-each "^0.3.3" + gopd "^1.2.0" + has-proto "^1.2.0" + is-typed-array "^1.1.15" + reflect.getprototypeof "^1.0.9" + +typed-array-length@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.7.tgz#ee4deff984b64be1e118b0de8c9c877d5ce73d3d" + integrity sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg== dependencies: - call-bind "^1.0.2" + call-bind "^1.0.7" for-each "^0.3.3" - is-typed-array "^1.1.9" + gopd "^1.0.1" + is-typed-array "^1.1.13" + possible-typed-array-names "^1.0.0" + reflect.getprototypeof "^1.0.6" -"typescript@^4.6.4 || ^5.0.0": - version "5.0.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" - integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== +"typescript@^4.6.4 || ^5.2.2": + version "5.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e" + integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== -unbox-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" - integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== +unbox-primitive@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.1.0.tgz#8d9d2c9edeea8460c7f35033a88867944934d1e2" + integrity sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw== dependencies: - call-bind "^1.0.2" + call-bound "^1.0.3" has-bigints "^1.0.2" - has-symbols "^1.0.3" - which-boxed-primitive "^1.0.2" + has-symbols "^1.1.0" + which-boxed-primitive "^1.1.1" + +undici-types@~6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" + integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== unicode-canonical-property-names-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" - integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== + version "2.0.1" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz#cb3173fe47ca743e228216e4a3ddc4c84d628cc2" + integrity sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg== unicode-match-property-ecmascript@^2.0.0: version "2.0.0" @@ -7177,9 +7584,9 @@ unicode-match-property-ecmascript@^2.0.0: unicode-property-aliases-ecmascript "^2.0.0" unicode-match-property-value-ecmascript@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" - integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== + version "2.2.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz#a0401aee72714598f739b68b104e4fe3a0cb3c71" + integrity sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg== unicode-property-aliases-ecmascript@^2.0.0: version "2.1.0" @@ -7191,10 +7598,15 @@ uniq@^1.0.1: resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" integrity sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA== +universalify@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== + universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + version "2.0.1" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" + integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" @@ -7211,13 +7623,13 @@ untildify@^4.0.0: resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== -update-browserslist-db@^1.0.10: - version "1.0.11" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" - integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== +update-browserslist-db@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz#97e9c96ab0ae7bcac08e9ae5151d26e6bc6b5580" + integrity sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg== dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" + escalade "^3.2.0" + picocolors "^1.1.1" uri-js@^4.2.2: version "4.4.1" @@ -7226,6 +7638,14 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +url-parse@^1.5.3: + version "1.5.10" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -7262,9 +7682,9 @@ v8-compile-cache-lib@^3.0.1: integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== v8-compile-cache@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== + version "2.4.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128" + integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== validate-npm-package-license@^3.0.1: version "3.0.4" @@ -7288,10 +7708,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -watchpack@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" - integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== +watchpack@^2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.2.tgz#2feeaed67412e7c33184e5a79ca738fbd38564da" + integrity sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -7304,14 +7724,14 @@ wbuf@^1.1.0, wbuf@^1.7.3: minimalistic-assert "^1.0.0" webpack-cli@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.0.2.tgz#2954c10ecb61c5d4dad6f68ee2d77f051741946c" - integrity sha512-4y3W5Dawri5+8dXm3+diW6Mn1Ya+Dei6eEVAdIduAmYNLzv1koKVAqsfgrrc9P2mhrYHQphx5htnGkcNwtubyQ== + version "5.1.4" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.1.4.tgz#c8e046ba7eaae4911d7e71e2b25b776fcc35759b" + integrity sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^2.0.1" - "@webpack-cli/info" "^2.0.1" - "@webpack-cli/serve" "^2.0.2" + "@webpack-cli/configtest" "^2.1.1" + "@webpack-cli/info" "^2.0.2" + "@webpack-cli/serve" "^2.0.5" colorette "^2.0.14" commander "^10.0.1" cross-spawn "^7.0.3" @@ -7322,10 +7742,10 @@ webpack-cli@^5.0.2: rechoir "^0.8.0" webpack-merge "^5.7.3" -webpack-dev-middleware@^5.3.1: - version "5.3.3" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz#efae67c2793908e7311f1d9b06f2a08dcc97e51f" - integrity sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA== +webpack-dev-middleware@^5.3.4: + version "5.3.4" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz#eb7b39281cbce10e104eb2b8bf2b63fce49a3517" + integrity sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q== dependencies: colorette "^2.0.10" memfs "^3.4.3" @@ -7334,9 +7754,9 @@ webpack-dev-middleware@^5.3.1: schema-utils "^4.0.0" webpack-dev-server@^4.8.0: - version "4.13.3" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.13.3.tgz#9feb740b8b56b886260bae1360286818a221bae8" - integrity sha512-KqqzrzMRSRy5ePz10VhjyL27K2dxqwXQLP5rAKwRJBPUahe7Z2bBWzHw37jeb8GCPKxZRO79ZdQUAPesMh/Nug== + version "4.15.2" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.15.2.tgz#9e0c70a42a012560860adb186986da1248333173" + integrity sha512-0XavAZbNJ5sDrCbkpWL8mia0o5WPOd2YGtxrEiZkBK9FjLppIUK2TgxK6qGD2P3hUXTJNNPVibrerKcx5WkR1g== dependencies: "@types/bonjour" "^3.5.9" "@types/connect-history-api-fallback" "^1.3.5" @@ -7344,7 +7764,7 @@ webpack-dev-server@^4.8.0: "@types/serve-index" "^1.9.1" "@types/serve-static" "^1.13.10" "@types/sockjs" "^0.3.33" - "@types/ws" "^8.5.1" + "@types/ws" "^8.5.5" ansi-html-community "^0.0.8" bonjour-service "^1.0.11" chokidar "^3.5.3" @@ -7366,15 +7786,16 @@ webpack-dev-server@^4.8.0: serve-index "^1.9.1" sockjs "^0.3.24" spdy "^4.0.2" - webpack-dev-middleware "^5.3.1" + webpack-dev-middleware "^5.3.4" ws "^8.13.0" webpack-merge@^5.7.3: - version "5.8.0" - resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61" - integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q== + version "5.10.0" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.10.0.tgz#a3ad5d773241e9c682803abf628d4cd62b8a4177" + integrity sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA== dependencies: clone-deep "^4.0.1" + flat "^5.0.2" wildcard "^2.0.0" webpack-notifier@^1.15.0: @@ -7391,33 +7812,32 @@ webpack-sources@^3.2.3: integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== webpack@^5.74.0: - version "5.81.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.81.0.tgz#27a2e8466c8b4820d800a8d90f06ef98294f9956" - integrity sha512-AAjaJ9S4hYCVODKLQTgG5p5e11hiMawBwV2v8MYLE0C/6UAGLuAF4n1qa9GOwdxnicaP+5k6M5HrLmD4+gIB8Q== - dependencies: - "@types/eslint-scope" "^3.7.3" - "@types/estree" "^1.0.0" - "@webassemblyjs/ast" "^1.11.5" - "@webassemblyjs/wasm-edit" "^1.11.5" - "@webassemblyjs/wasm-parser" "^1.11.5" - acorn "^8.7.1" - acorn-import-assertions "^1.7.6" - browserslist "^4.14.5" + version "5.97.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.97.1.tgz#972a8320a438b56ff0f1d94ade9e82eac155fa58" + integrity sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg== + dependencies: + "@types/eslint-scope" "^3.7.7" + "@types/estree" "^1.0.6" + "@webassemblyjs/ast" "^1.14.1" + "@webassemblyjs/wasm-edit" "^1.14.1" + "@webassemblyjs/wasm-parser" "^1.14.1" + acorn "^8.14.0" + browserslist "^4.24.0" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.13.0" + enhanced-resolve "^5.17.1" es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" - graceful-fs "^4.2.9" + graceful-fs "^4.2.11" json-parse-even-better-errors "^2.3.1" loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - schema-utils "^3.1.2" + schema-utils "^3.2.0" tapable "^2.1.1" - terser-webpack-plugin "^5.3.7" - watchpack "^2.4.0" + terser-webpack-plugin "^5.3.10" + watchpack "^2.4.1" webpack-sources "^3.2.3" websocket-driver@>=0.5.1, websocket-driver@^0.7.4: @@ -7434,28 +7854,57 @@ websocket-extensions@>=0.1.1: resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== -which-boxed-primitive@^1.0.2: +which-boxed-primitive@^1.1.0, which-boxed-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz#d76ec27df7fa165f18d5808374a5fe23c29b176e" + integrity sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA== + dependencies: + is-bigint "^1.1.0" + is-boolean-object "^1.2.1" + is-number-object "^1.1.1" + is-string "^1.1.1" + is-symbol "^1.1.1" + +which-builtin-type@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/which-builtin-type/-/which-builtin-type-1.2.1.tgz#89183da1b4907ab089a6b02029cc5d8d6574270e" + integrity sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q== + dependencies: + call-bound "^1.0.2" + function.prototype.name "^1.1.6" + has-tostringtag "^1.0.2" + is-async-function "^2.0.0" + is-date-object "^1.1.0" + is-finalizationregistry "^1.1.0" + is-generator-function "^1.0.10" + is-regex "^1.2.1" + is-weakref "^1.0.2" + isarray "^2.0.5" + which-boxed-primitive "^1.1.0" + which-collection "^1.0.2" + which-typed-array "^1.1.16" + +which-collection@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - -which-typed-array@^1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" - integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== - dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" + resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.2.tgz#627ef76243920a107e7ce8e96191debe4b16c2a0" + integrity sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw== + dependencies: + is-map "^2.0.3" + is-set "^2.0.3" + is-weakmap "^2.0.2" + is-weakset "^2.0.3" + +which-typed-array@^1.1.16, which-typed-array@^1.1.18: + version "1.1.18" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.18.tgz#df2389ebf3fbb246a71390e90730a9edb6ce17ad" + integrity sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.8" + call-bound "^1.0.3" for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.0" - is-typed-array "^1.1.10" + gopd "^1.2.0" + has-tostringtag "^1.0.2" which@^1.3.1: version "1.3.1" @@ -7476,7 +7925,7 @@ wildcard@^2.0.0: resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -7494,6 +7943,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" @@ -7517,9 +7975,9 @@ write-file-atomic@^4.0.2: signal-exit "^3.0.7" ws@^8.13.0: - version "8.13.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" - integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== xmldoc@^1.1.2: version "1.3.0" @@ -7543,16 +8001,21 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@2.2.2, yaml@^2.1.1: +yaml@2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.2.2.tgz#ec551ef37326e6d42872dad1970300f8eb83a073" integrity sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA== -yaml@^1.10.0, yaml@^1.10.2: +yaml@^1.10.0: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yaml@^2.3.4: + version "2.7.0" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.7.0.tgz#aef9bb617a64c937a9a748803786ad8d3ffe1e98" + integrity sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA== + yargs-parser@^20.2.3: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" @@ -7593,3 +8056,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +yocto-queue@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.1.1.tgz#fef65ce3ac9f8a32ceac5a634f74e17e5b232110" + integrity sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g== From 9d86e6f80f50b1a2f74b196f55494c53c629c112 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 13:38:20 +0100 Subject: [PATCH 16/52] ci(actions): update node and php version --- .github/workflows/e2e.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/manifests/php/dev.Dockerfile | 4 ++-- .github/workflows/manifests/php/prod.Dockerfile | 4 ++-- .github/workflows/release.yml | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index be520a4c..916e553c 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -36,7 +36,7 @@ jobs: strategy: fail-fast: true matrix: - php-versions: [ '8.2' ] + php-versions: [ '8.3' ] steps: - name: Install Symfony CLI run: wget https://get.symfony.com/cli/installer -O - | bash diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f132574d..fd0e7192 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: [ '8.2' ] + php-version: [ '8.3' ] steps: - name: Check out code diff --git a/.github/workflows/manifests/php/dev.Dockerfile b/.github/workflows/manifests/php/dev.Dockerfile index 1224c234..90be3f62 100644 --- a/.github/workflows/manifests/php/dev.Dockerfile +++ b/.github/workflows/manifests/php/dev.Dockerfile @@ -1,7 +1,7 @@ FROM composer:lts AS composer -FROM node:18-alpine AS builder +FROM node:23-alpine AS builder COPY . /build RUN apk add --no-cache \ python3 \ @@ -15,7 +15,7 @@ RUN yarn install \ && yarn dev -FROM php:8.2-fpm-alpine +FROM php:8.3-fpm-alpine ENV APP_ENV=dev diff --git a/.github/workflows/manifests/php/prod.Dockerfile b/.github/workflows/manifests/php/prod.Dockerfile index 95a05bb6..55e4099e 100644 --- a/.github/workflows/manifests/php/prod.Dockerfile +++ b/.github/workflows/manifests/php/prod.Dockerfile @@ -1,7 +1,7 @@ FROM composer:lts AS composer -FROM node:18-alpine AS builder +FROM node:23-alpine AS builder COPY . /build RUN apk add --no-cache \ python3 \ @@ -15,7 +15,7 @@ RUN yarn install \ && yarn build -FROM php:8.2-fpm-alpine +FROM php:8.3-fpm-alpine ENV APP_ENV=prod diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ea20ecc..dea5a9ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,12 +16,12 @@ jobs: app_version: ${{ steps.step1.outputs.app_version }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Nodejs uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 23 - name: Install dependencies run: npm install @semantic-release/changelog @semantic-release/git @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/exec @semantic-release/git semantic-release/release-notes-generator From 0202fb2ef9ce527c56eb34fd56527e5a03b585c3 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 13:42:00 +0100 Subject: [PATCH 17/52] ci: update php-cs-fixer config --- .php-cs-fixer.dist.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 2b0b2b79..2a441e65 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,11 +1,16 @@ exclude(['var', 'vendor', 'node_modules']) + ->notPath('config/bundles.php') + ->notName('bundles.php') ->in(__DIR__) - ->exclude('var') ; -$config = new PhpCsFixer\Config(); +$config = new Config(); return $config->setRules([ '@PhpCsFixer' => true, 'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], From 2819cddbba45daa2d4e6da55d70dd10d684123de Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 13:44:28 +0100 Subject: [PATCH 18/52] ci(actions): update lint workflow --- .github/workflows/lint.yml | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fd0e7192..bed22d1e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,28 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Print versions - run: | - git --version - node --version - yarn --version - npx commitlint --version - - - name: Install commitlint - run: | - yarn add conventional-changelog-conventionalcommits - yarn add commitlint@latest - - - name: Validate current commit (last commit) with commitlint - if: github.event_name == 'push' - run: npx commitlint --from HEAD~1 --to HEAD --verbose - - - name: Validate PR commits with commitlint - if: github.event_name == 'pull_request' - run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose + - uses: wagoid/commitlint-github-action@v6 lint-files: @@ -76,7 +55,7 @@ jobs: run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: "Cache composer" - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }} @@ -85,6 +64,9 @@ jobs: - name: "Composer install" run: composer install --no-interaction --no-progress + - name: PHPStan + run: vendor/bin/phpstan analyse --configuration=phpstan.dist.neon src tests + - name: Install PHPUnit id: install run: vendor/bin/simple-phpunit install From 1da4e922024c3d10fd9643e22d8e44e4b2bc2fdf Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 14:34:28 +0100 Subject: [PATCH 19/52] style: fix phpstan errors --- src/Controller/CodebookController.php | 8 ++--- src/Controller/FileManagementController.php | 10 ++++-- src/Form/FileDescriptionType.php | 34 +++++++++++++++++++++ 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 src/Form/FileDescriptionType.php diff --git a/src/Controller/CodebookController.php b/src/Controller/CodebookController.php index b8823975..dad762d6 100644 --- a/src/Controller/CodebookController.php +++ b/src/Controller/CodebookController.php @@ -44,7 +44,7 @@ public function performUpdateAction(string $uuid, Request $request): JsonRespons } $jsonCodebook = $this->codebookCollectionToJsonArray($dataset->getCodebook()); - return new JsonResponse($jsonCodebook, $jsonCodebook != null && sizeof($jsonCodebook) > 0 ? Response::HTTP_OK : Response::HTTP_NO_CONTENT); + return new JsonResponse($jsonCodebook, $jsonCodebook != null ? Response::HTTP_OK : Response::HTTP_NO_CONTENT); } #[Route(path: '/{uuid}/measures', name: 'measures', methods: ['GET'])] @@ -55,7 +55,7 @@ public function createViewMeasuresAction(string $uuid): JsonResponse $viewMeasures = []; if ($dataset) { $measures = $this->em->getRepository(MeasureMetaDataGroup::class)->findOneBy(['experiment' => $dataset->getExperiment()]); - if ($measures && $measures->getMeasures() && sizeof($measures->getMeasures()) > 0) { + if ($measures && $measures->getMeasures()) { foreach ($measures->getMeasures() as $measure) { if ($measure && $measure != '') { $viewMeasures['measures'][] = $measure; @@ -165,8 +165,8 @@ private function saveCodebookVariables(array $arr) $var->setName($variable['name'] ?? $var->getName()); $var->setLabel($variable['label'] ?? null); $var->setItemText($variable['itemText'] ?? null); - $var->setValues($values != null && sizeof($values) != 0 ? $values : null); - $var->setMissings($missings != null && sizeof($missings) != 0 ? $missings : null); + $var->setValues($values != null ? $values : null); + $var->setMissings($missings != null ? $missings : null); $var->setMeasure($variable['measure'] ?? null); $this->em->persist($var); $this->em->flush(); diff --git a/src/Controller/FileManagementController.php b/src/Controller/FileManagementController.php index 72f31ada..dd62fd8c 100644 --- a/src/Controller/FileManagementController.php +++ b/src/Controller/FileManagementController.php @@ -83,7 +83,10 @@ public function previewCsvAction(string $fileId, Request $request): JsonResponse $this->logger->debug("Enter FileManagementController::previewCSVAction with [FileId: {$fileId}]"); $delimiter = $request->get('dataset-import-delimiter') ?? ','; $escape = $request->get('dataset-import-escape') ?? 'double'; - $headerRows = filter_var($request->get('dataset-import-header-rows'), FILTER_VALIDATE_INT) ?? 0; + $headerRows = filter_var($request->get('dataset-import-header-rows'), FILTER_VALIDATE_INT); + if (!$headerRows) { + $headerRows = 0; + } $file = $this->em->find(Dataset::class, $fileId); $data = null; if ($file) { @@ -100,7 +103,10 @@ public function submitCSVAction(string $fileId, Request $request): JsonResponse $delimiter = $request->get('dataset-import-delimiter') ?? ','; $escape = $request->get('dataset-import-escape') ?? 'double'; $remove = $request->get('dataset-import-remove') ?? null; - $headerRows = filter_var($request->get('dataset-import-header-rows'), FILTER_VALIDATE_INT) ?? 0; + $headerRows = filter_var($request->get('dataset-import-header-rows'), FILTER_VALIDATE_INT); + if (!$headerRows) { + $headerRows = 0; + } $dataset = $this->em->find(Dataset::class, $fileId); $data = null; $error = null; diff --git a/src/Form/FileDescriptionType.php b/src/Form/FileDescriptionType.php new file mode 100644 index 00000000..0a20057e --- /dev/null +++ b/src/Form/FileDescriptionType.php @@ -0,0 +1,34 @@ +add(MetaDataDictionary::FILE_DESCRIPTION, TextareaType::class, [ + 'required' => false, + // 'label' => 'Objective', + 'label' => 'Describe the content of the file.', + 'label_attr' => ['class' => 'MetaData-Label'], + 'attr' => [ + 'class' => 'MetaData-TextInput', + ], + ]); + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => AdditionalMaterial::class, + ]); + } +} From a0c19a24df174faa520aa53ad1ca441e078c973e Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 15:42:24 +0100 Subject: [PATCH 20/52] build: update node packages --- assets/styles/components/_widget_author.scss | 2 +- package.json | 67 +- yarn.lock | 3022 +++++++++--------- 3 files changed, 1476 insertions(+), 1615 deletions(-) diff --git a/assets/styles/components/_widget_author.scss b/assets/styles/components/_widget_author.scss index 37c6372d..5a467270 100644 --- a/assets/styles/components/_widget_author.scss +++ b/assets/styles/components/_widget_author.scss @@ -1,4 +1,4 @@ -@import 'assets/styles/components/_buttons.scss'; +@import 'buttons'; .Creator-Details { @apply md:grid md:w-full md:grid-cols-2 md:gap-x-2; diff --git a/package.json b/package.json index a60ae842..fcdcc18c 100644 --- a/package.json +++ b/package.json @@ -1,45 +1,46 @@ { "devDependencies": { "@a2lix/symfony-collection": "^0.6.1", - "@alpine-collective/toolkit-scroll": "^1.0.0", - "@alpinejs/focus": "^3.12.0", - "@babel/core": "^7.17.0", - "@babel/preset-env": "^7.16.0", - "@commitlint/cli": "^17.6.3", - "@commitlint/config-conventional": "^17.6.3", - "@hotwired/stimulus": "^3.0.0", - "@ryangjchandler/alpine-tooltip": "^1.2.0", - "@symfony/stimulus-bridge": "^3.2.0", - "@symfony/webpack-encore": "^4.0.0", - "alpinejs": "^3.12.0", - "autoprefixer": "^10.4.0", - "axios": "^1.4.0", - "core-js": "^3.23.0", + "@alpine-collective/toolkit-scroll": "^1.0.2", + "@alpinejs/focus": "^3.14.8", + "@babel/core": "^7.26.0", + "@babel/preset-env": "^7.26.0", + "@commitlint/cli": "^19.6.1", + "@commitlint/config-conventional": "^19.6.0", + "@hotwired/stimulus": "^3.2.2", + "@ryangjchandler/alpine-tooltip": "^2.0.1", + "@symfony/stimulus-bridge": "^3.2.3", + "@symfony/webpack-encore": "^5.0.1", + "alpinejs": "^3.14.8", + "autoprefixer": "^10.4.20", + "axios": "^1.7.9", + "core-js": "^3.40.0", "cross-env": "^7.0.3", - "cypress": "^12.11.0", - "cypress-wait-until": "^1.7.2", + "cypress": "^14.0.0", + "cypress-wait-until": "^3.0.2", "dropzone": "^5.9.3", "list.js": "^2.3.1", - "markdownlint-cli2": "^0.7.1", - "postcss": "^8.3.11", - "postcss-loader": "^7.3.0", - "postcss-scss": "^4.0.2", + "markdownlint-cli2": "^0.17.2", + "postcss": "^8.5.1", + "postcss-loader": "^8.1.1", + "postcss-scss": "^4.0.9", "postcss-svg": "^3.0.0", - "prettier": "^2.4.1", - "regenerator-runtime": "^0.13.9", - "rimraf": "^5.0.0", - "sass": "^1.43.4", - "sass-loader": "^13.2.2", - "stylelint": "^14.16.1", - "stylelint-config-idiomatic-order": "^9.0.0", + "prettier": "^3.4.2", + "regenerator-runtime": "^0.14.1", + "rimraf": "^6.0.1", + "sass": "^1.83.4", + "sass-loader": "^16.0.4", + "stylelint": "^16.13.2", + "stylelint-config-idiomatic-order": "^10.0.0", "stylelint-config-prettier": "^9.0.5", - "stylelint-config-standard": "^29.0.0", - "stylelint-scss": "^5.0.1", - "tailwind-scrollbar": "^3.0.0", - "tailwindcss": "^3.3.2", + "stylelint-config-standard": "^37.0.0", + "stylelint-scss": "^6.10.1", + "tailwind-scrollbar": "^3.1.0", + "tailwindcss": "^3.4.17", "tippy.js": "^6.3.7", - "webpack": "^5.74.0", - "webpack-cli": "^5.0.2", + "webpack": "^5.97.1", + "webpack-cli": "^6.0.1", + "webpack-dev-server": "^5.2.0", "webpack-notifier": "^1.15.0" }, "license": "MIT", diff --git a/yarn.lock b/yarn.lock index acf5bf9e..f0ec2b82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,12 +12,12 @@ resolved "https://registry.yarnpkg.com/@alloc/quick-lru/-/quick-lru-5.2.0.tgz#7bf68b20c0a350f936915fcae06f58e32007ce30" integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw== -"@alpine-collective/toolkit-scroll@^1.0.0": +"@alpine-collective/toolkit-scroll@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@alpine-collective/toolkit-scroll/-/toolkit-scroll-1.0.2.tgz#941fb651e833c09a8b95b383aea7d5d21f51247b" integrity sha512-dDEkAhTkjIWG31TZASfhz4a05l+0k2db0Na6ZXuddvU1NNlbF/I2j5hQk79g8JIDctAfn36XFFfpvfdxHMf0Lw== -"@alpinejs/focus@^3.12.0": +"@alpinejs/focus@^3.14.8": version "3.14.8" resolved "https://registry.yarnpkg.com/@alpinejs/focus/-/focus-3.14.8.tgz#589df66847ddc376013e010e30e81595f8ccd044" integrity sha512-lTeU4lyifIL4h2nGf2BHKSX3d8lT7mPn3phR5Yu497ub+al9W2eKXVc42MVm1piY3l6KiYCdNXZTcHaTEm78Kg== @@ -47,7 +47,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.26.5.tgz#df93ac37f4417854130e21d72c66ff3d4b897fc7" integrity sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg== -"@babel/core@^7.17.0": +"@babel/core@^7.26.0": version "7.26.0" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== @@ -685,7 +685,7 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/preset-env@^7.16.0": +"@babel/preset-env@^7.26.0": version "7.26.0" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== @@ -811,183 +811,185 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== -"@commitlint/cli@^17.6.3": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-17.8.1.tgz#10492114a022c91dcfb1d84dac773abb3db76d33" - integrity sha512-ay+WbzQesE0Rv4EQKfNbSMiJJ12KdKTDzIt0tcK4k11FdsWmtwP0Kp1NWMOUswfIWo6Eb7p7Ln721Nx9FLNBjg== - dependencies: - "@commitlint/format" "^17.8.1" - "@commitlint/lint" "^17.8.1" - "@commitlint/load" "^17.8.1" - "@commitlint/read" "^17.8.1" - "@commitlint/types" "^17.8.1" - execa "^5.0.0" - lodash.isfunction "^3.0.9" - resolve-from "5.0.0" - resolve-global "1.0.0" +"@commitlint/cli@^19.6.1": + version "19.6.1" + resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-19.6.1.tgz#24edd26595d911cc6b680cdfbb1fb083bfd5f73d" + integrity sha512-8hcyA6ZoHwWXC76BoC8qVOSr8xHy00LZhZpauiD0iO0VYbVhMnED0da85lTfIULxl7Lj4c6vZgF0Wu/ed1+jlQ== + dependencies: + "@commitlint/format" "^19.5.0" + "@commitlint/lint" "^19.6.0" + "@commitlint/load" "^19.6.1" + "@commitlint/read" "^19.5.0" + "@commitlint/types" "^19.5.0" + tinyexec "^0.3.0" yargs "^17.0.0" -"@commitlint/config-conventional@^17.6.3": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-17.8.1.tgz#e5bcf0cfec8da7ac50bc04dc92e0a4ea74964ce0" - integrity sha512-NxCOHx1kgneig3VLauWJcDWS40DVjg7nKOpBEEK9E5fjJpQqLCilcnKkIIjdBH98kEO1q3NpE5NSrZ2kl/QGJg== +"@commitlint/config-conventional@^19.6.0": + version "19.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-19.6.0.tgz#badba72c8639ea79291e2941001bd7ea7fad3a2c" + integrity sha512-DJT40iMnTYtBtUfw9ApbsLZFke1zKh6llITVJ+x9mtpHD08gsNXaIRqHTmwTZL3dNX5+WoyK7pCN/5zswvkBCQ== dependencies: - conventional-changelog-conventionalcommits "^6.1.0" + "@commitlint/types" "^19.5.0" + conventional-changelog-conventionalcommits "^7.0.2" -"@commitlint/config-validator@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/config-validator/-/config-validator-17.8.1.tgz#5cc93b6b49d5524c9cc345a60e5bf74bcca2b7f9" - integrity sha512-UUgUC+sNiiMwkyiuIFR7JG2cfd9t/7MV8VB4TZ+q02ZFkHoduUS4tJGsCBWvBOGD9Btev6IecPMvlWUfJorkEA== +"@commitlint/config-validator@^19.5.0": + version "19.5.0" + resolved "https://registry.yarnpkg.com/@commitlint/config-validator/-/config-validator-19.5.0.tgz#f0a4eda2109fc716ef01bb8831af9b02e3a1e568" + integrity sha512-CHtj92H5rdhKt17RmgALhfQt95VayrUo2tSqY9g2w+laAXyk7K/Ef6uPm9tn5qSIwSmrLjKaXK9eiNuxmQrDBw== dependencies: - "@commitlint/types" "^17.8.1" + "@commitlint/types" "^19.5.0" ajv "^8.11.0" -"@commitlint/ensure@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-17.8.1.tgz#59183557844999dbb6aab6d03629a3d104d01a8d" - integrity sha512-xjafwKxid8s1K23NFpL8JNo6JnY/ysetKo8kegVM7c8vs+kWLP8VrQq+NbhgVlmCojhEDbzQKp4eRXSjVOGsow== +"@commitlint/ensure@^19.5.0": + version "19.5.0" + resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-19.5.0.tgz#b087374a6a0a0140e5925a82901d234885d9f6dd" + integrity sha512-Kv0pYZeMrdg48bHFEU5KKcccRfKmISSm9MvgIgkpI6m+ohFTB55qZlBW6eYqh/XDfRuIO0x4zSmvBjmOwWTwkg== dependencies: - "@commitlint/types" "^17.8.1" + "@commitlint/types" "^19.5.0" lodash.camelcase "^4.3.0" lodash.kebabcase "^4.1.1" lodash.snakecase "^4.1.1" lodash.startcase "^4.4.0" lodash.upperfirst "^4.3.1" -"@commitlint/execute-rule@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-17.8.1.tgz#504ed69eb61044eeb84fdfd10cc18f0dab14f34c" - integrity sha512-JHVupQeSdNI6xzA9SqMF+p/JjrHTcrJdI02PwesQIDCIGUrv04hicJgCcws5nzaoZbROapPs0s6zeVHoxpMwFQ== - -"@commitlint/format@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-17.8.1.tgz#6108bb6b4408e711006680649927e1b559bdc5f8" - integrity sha512-f3oMTyZ84M9ht7fb93wbCKmWxO5/kKSbwuYvS867duVomoOsgrgljkGGIztmT/srZnaiGbaK8+Wf8Ik2tSr5eg== - dependencies: - "@commitlint/types" "^17.8.1" - chalk "^4.1.0" - -"@commitlint/is-ignored@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-17.8.1.tgz#cf25bcd8409c79684b63f8bdeb35df48edda244e" - integrity sha512-UshMi4Ltb4ZlNn4F7WtSEugFDZmctzFpmbqvpyxD3la510J+PLcnyhf9chs7EryaRFJMdAKwsEKfNK0jL/QM4g== - dependencies: - "@commitlint/types" "^17.8.1" - semver "7.5.4" - -"@commitlint/lint@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-17.8.1.tgz#bfc21215f6b18d41d4d43e2aa3cb79a5d7726cd8" - integrity sha512-aQUlwIR1/VMv2D4GXSk7PfL5hIaFSfy6hSHV94O8Y27T5q+DlDEgd/cZ4KmVI+MWKzFfCTiTuWqjfRSfdRllCA== - dependencies: - "@commitlint/is-ignored" "^17.8.1" - "@commitlint/parse" "^17.8.1" - "@commitlint/rules" "^17.8.1" - "@commitlint/types" "^17.8.1" - -"@commitlint/load@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-17.8.1.tgz#fa061e7bfa53281eb03ca8517ca26d66a189030c" - integrity sha512-iF4CL7KDFstP1kpVUkT8K2Wl17h2yx9VaR1ztTc8vzByWWcbO/WaKwxsnCOqow9tVAlzPfo1ywk9m2oJ9ucMqA== - dependencies: - "@commitlint/config-validator" "^17.8.1" - "@commitlint/execute-rule" "^17.8.1" - "@commitlint/resolve-extends" "^17.8.1" - "@commitlint/types" "^17.8.1" - "@types/node" "20.5.1" - chalk "^4.1.0" - cosmiconfig "^8.0.0" - cosmiconfig-typescript-loader "^4.0.0" +"@commitlint/execute-rule@^19.5.0": + version "19.5.0" + resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-19.5.0.tgz#c13da8c03ea0379f30856111e27d57518e25b8a2" + integrity sha512-aqyGgytXhl2ejlk+/rfgtwpPexYyri4t8/n4ku6rRJoRhGZpLFMqrZ+YaubeGysCP6oz4mMA34YSTaSOKEeNrg== + +"@commitlint/format@^19.5.0": + version "19.5.0" + resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-19.5.0.tgz#d879db2d97d70ae622397839fb8603d56e85a250" + integrity sha512-yNy088miE52stCI3dhG/vvxFo9e4jFkU1Mj3xECfzp/bIS/JUay4491huAlVcffOoMK1cd296q0W92NlER6r3A== + dependencies: + "@commitlint/types" "^19.5.0" + chalk "^5.3.0" + +"@commitlint/is-ignored@^19.6.0": + version "19.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-19.6.0.tgz#6adb9097d36b68e00b9c06a73d7a08e9f54c54dc" + integrity sha512-Ov6iBgxJQFR9koOupDPHvcHU9keFupDgtB3lObdEZDroiG4jj1rzky60fbQozFKVYRTUdrBGICHG0YVmRuAJmw== + dependencies: + "@commitlint/types" "^19.5.0" + semver "^7.6.0" + +"@commitlint/lint@^19.6.0": + version "19.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-19.6.0.tgz#f9fc9b11b808c96bd3f85e882e056daabac40c36" + integrity sha512-LRo7zDkXtcIrpco9RnfhOKeg8PAnE3oDDoalnrVU/EVaKHYBWYL1DlRR7+3AWn0JiBqD8yKOfetVxJGdEtZ0tg== + dependencies: + "@commitlint/is-ignored" "^19.6.0" + "@commitlint/parse" "^19.5.0" + "@commitlint/rules" "^19.6.0" + "@commitlint/types" "^19.5.0" + +"@commitlint/load@^19.6.1": + version "19.6.1" + resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-19.6.1.tgz#5fae8843a6048a2d3d1cc16da0af8ee532fa9db4" + integrity sha512-kE4mRKWWNju2QpsCWt428XBvUH55OET2N4QKQ0bF85qS/XbsRGG1MiTByDNlEVpEPceMkDr46LNH95DtRwcsfA== + dependencies: + "@commitlint/config-validator" "^19.5.0" + "@commitlint/execute-rule" "^19.5.0" + "@commitlint/resolve-extends" "^19.5.0" + "@commitlint/types" "^19.5.0" + chalk "^5.3.0" + cosmiconfig "^9.0.0" + cosmiconfig-typescript-loader "^6.1.0" lodash.isplainobject "^4.0.6" lodash.merge "^4.6.2" lodash.uniq "^4.5.0" - resolve-from "^5.0.0" - ts-node "^10.8.1" - typescript "^4.6.4 || ^5.2.2" - -"@commitlint/message@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-17.8.1.tgz#a5cd226c419be20ee03c3d237db6ac37b95958b3" - integrity sha512-6bYL1GUQsD6bLhTH3QQty8pVFoETfFQlMn2Nzmz3AOLqRVfNNtXBaSY0dhZ0dM6A2MEq4+2d7L/2LP8TjqGRkA== - -"@commitlint/parse@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-17.8.1.tgz#6e00b8f50ebd63562d25dcf4230da2c9f984e626" - integrity sha512-/wLUickTo0rNpQgWwLPavTm7WbwkZoBy3X8PpkUmlSmQJyWQTj0m6bDjiykMaDt41qcUbfeFfaCvXfiR4EGnfw== - dependencies: - "@commitlint/types" "^17.8.1" - conventional-changelog-angular "^6.0.0" - conventional-commits-parser "^4.0.0" - -"@commitlint/read@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-17.8.1.tgz#b3f28777607c756078356cc133368b0e8c08092f" - integrity sha512-Fd55Oaz9irzBESPCdMd8vWWgxsW3OWR99wOntBDHgf9h7Y6OOHjWEdS9Xzen1GFndqgyoaFplQS5y7KZe0kO2w== - dependencies: - "@commitlint/top-level" "^17.8.1" - "@commitlint/types" "^17.8.1" - fs-extra "^11.0.0" - git-raw-commits "^2.0.11" - minimist "^1.2.6" -"@commitlint/resolve-extends@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-17.8.1.tgz#9af01432bf2fd9ce3dd5a00d266cce14e4c977e7" - integrity sha512-W/ryRoQ0TSVXqJrx5SGkaYuAaE/BUontL1j1HsKckvM6e5ZaG0M9126zcwL6peKSuIetJi7E87PRQF8O86EW0Q== +"@commitlint/message@^19.5.0": + version "19.5.0" + resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-19.5.0.tgz#c062d9a1d2b3302c3a8cac25d6d1125ea9c019b2" + integrity sha512-R7AM4YnbxN1Joj1tMfCyBryOC5aNJBdxadTZkuqtWi3Xj0kMdutq16XQwuoGbIzL2Pk62TALV1fZDCv36+JhTQ== + +"@commitlint/parse@^19.5.0": + version "19.5.0" + resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-19.5.0.tgz#b450dad9b5a95ac5ba472d6d0fdab822dce946fc" + integrity sha512-cZ/IxfAlfWYhAQV0TwcbdR1Oc0/r0Ik1GEessDJ3Lbuma/MRO8FRQX76eurcXtmhJC//rj52ZSZuXUg0oIX0Fw== dependencies: - "@commitlint/config-validator" "^17.8.1" - "@commitlint/types" "^17.8.1" - import-fresh "^3.0.0" + "@commitlint/types" "^19.5.0" + conventional-changelog-angular "^7.0.0" + conventional-commits-parser "^5.0.0" + +"@commitlint/read@^19.5.0": + version "19.5.0" + resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-19.5.0.tgz#601f9f1afe69852b0f28aa81cd455b40979fad6b" + integrity sha512-TjS3HLPsLsxFPQj6jou8/CZFAmOP2y+6V4PGYt3ihbQKTY1Jnv0QG28WRKl/d1ha6zLODPZqsxLEov52dhR9BQ== + dependencies: + "@commitlint/top-level" "^19.5.0" + "@commitlint/types" "^19.5.0" + git-raw-commits "^4.0.0" + minimist "^1.2.8" + tinyexec "^0.3.0" + +"@commitlint/resolve-extends@^19.5.0": + version "19.5.0" + resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-19.5.0.tgz#f3ec33e12d10df90cae0bfad8e593431fb61b18e" + integrity sha512-CU/GscZhCUsJwcKTJS9Ndh3AKGZTNFIOoQB2n8CmFnizE0VnEuJoum+COW+C1lNABEeqk6ssfc1Kkalm4bDklA== + dependencies: + "@commitlint/config-validator" "^19.5.0" + "@commitlint/types" "^19.5.0" + global-directory "^4.0.1" + import-meta-resolve "^4.0.0" lodash.mergewith "^4.6.2" resolve-from "^5.0.0" - resolve-global "^1.0.0" -"@commitlint/rules@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-17.8.1.tgz#da49cab1b7ebaf90d108de9f58f684dc4ccb65a0" - integrity sha512-2b7OdVbN7MTAt9U0vKOYKCDsOvESVXxQmrvuVUZ0rGFMCrCPJWWP1GJ7f0lAypbDAhaGb8zqtdOr47192LBrIA== +"@commitlint/rules@^19.6.0": + version "19.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-19.6.0.tgz#2436da7974c3cf2a7236257f3ef5dd40c4d91312" + integrity sha512-1f2reW7lbrI0X0ozZMesS/WZxgPa4/wi56vFuJENBmed6mWq5KsheN/nxqnl/C23ioxpPO/PL6tXpiiFy5Bhjw== dependencies: - "@commitlint/ensure" "^17.8.1" - "@commitlint/message" "^17.8.1" - "@commitlint/to-lines" "^17.8.1" - "@commitlint/types" "^17.8.1" - execa "^5.0.0" + "@commitlint/ensure" "^19.5.0" + "@commitlint/message" "^19.5.0" + "@commitlint/to-lines" "^19.5.0" + "@commitlint/types" "^19.5.0" -"@commitlint/to-lines@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-17.8.1.tgz#a5c4a7cf7dff3dbdd69289fc0eb19b66f3cfe017" - integrity sha512-LE0jb8CuR/mj6xJyrIk8VLz03OEzXFgLdivBytoooKO5xLt5yalc8Ma5guTWobw998sbR3ogDd+2jed03CFmJA== +"@commitlint/to-lines@^19.5.0": + version "19.5.0" + resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-19.5.0.tgz#e4b7f34f09064568c96a74de4f1fc9f466c4d472" + integrity sha512-R772oj3NHPkodOSRZ9bBVNq224DOxQtNef5Pl8l2M8ZnkkzQfeSTr4uxawV2Sd3ui05dUVzvLNnzenDBO1KBeQ== -"@commitlint/top-level@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-17.8.1.tgz#206d37d6782f33c9572e44fbe3758392fdeea7bc" - integrity sha512-l6+Z6rrNf5p333SHfEte6r+WkOxGlWK4bLuZKbtf/2TXRN+qhrvn1XE63VhD8Oe9oIHQ7F7W1nG2k/TJFhx2yA== +"@commitlint/top-level@^19.5.0": + version "19.5.0" + resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-19.5.0.tgz#0017ffe39b5ba3611a1debd62efe28803601a14f" + integrity sha512-IP1YLmGAk0yWrImPRRc578I3dDUI5A2UBJx9FbSOjxe9sTlzFiwVJ+zeMLgAtHMtGZsC8LUnzmW1qRemkFU4ng== dependencies: - find-up "^5.0.0" + find-up "^7.0.0" -"@commitlint/types@^17.8.1": - version "17.8.1" - resolved "https://registry.yarnpkg.com/@commitlint/types/-/types-17.8.1.tgz#883a0ad35c5206d5fef7bc6ce1bbe648118af44e" - integrity sha512-PXDQXkAmiMEG162Bqdh9ChML/GJZo6vU+7F03ALKDK8zYc6SuAr47LjG7hGYRqUOz+WK0dU7bQ0xzuqFMdxzeQ== +"@commitlint/types@^19.5.0": + version "19.5.0" + resolved "https://registry.yarnpkg.com/@commitlint/types/-/types-19.5.0.tgz#c5084d1231d4dd50e40bdb656ee7601f691400b3" + integrity sha512-DSHae2obMSMkAtTBSOulg5X7/z+rGLxcXQIkg3OmWvY6wifojge5uVMydfhUvs7yQj+V7jNmRZ2Xzl8GJyqRgg== dependencies: - chalk "^4.1.0" + "@types/conventional-commits-parser" "^5.0.0" + chalk "^5.3.0" -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" +"@csstools/css-parser-algorithms@^3.0.4": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.4.tgz#74426e93bd1c4dcab3e441f5cc7ba4fb35d94356" + integrity sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A== -"@csstools/selector-specificity@^2.0.2": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@csstools/selector-specificity/-/selector-specificity-2.2.0.tgz#2cbcf822bf3764c9658c4d2e568bd0c0cb748016" - integrity sha512-+OJ9konv95ClSTOJCmMZqpd5+YGsB2S+x6w3E1oaM8UuR5j8nTNHYSz8c9BEPGDOCMQYIEEGlVPj/VY64iTbGw== +"@csstools/css-tokenizer@^3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@csstools/css-tokenizer/-/css-tokenizer-3.0.3.tgz#a5502c8539265fecbd873c1e395a890339f119c2" + integrity sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw== + +"@csstools/media-query-list-parser@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@csstools/media-query-list-parser/-/media-query-list-parser-4.0.2.tgz#e80e17eba1693fceafb8d6f2cfc68c0e7a9ab78a" + integrity sha512-EUos465uvVvMJehckATTlNqGj4UJWkTmdWuDMjqvSUkjGpmOyFZBVwb4knxCm/k2GMTXY+c/5RkdndzFYWeX5A== -"@cypress/request@2.88.12": - version "2.88.12" - resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.12.tgz#ba4911431738494a85e93fb04498cb38bc55d590" - integrity sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA== +"@csstools/selector-specificity@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@csstools/selector-specificity/-/selector-specificity-5.0.0.tgz#037817b574262134cabd68fc4ec1a454f168407b" + integrity sha512-PCqQV3c4CoVm3kdPhyeZ07VmBRdH2EpMFA/pd9OASpOEC3aXNGoqPDAZ80D0cLpMBxnmk0+yNhGsEx31hq7Gtw== + +"@cypress/request@^3.0.6": + version "3.0.7" + resolved "https://registry.yarnpkg.com/@cypress/request/-/request-3.0.7.tgz#6a74a4da98d9e5ae9121d6e2d9c14780c9b5cf1a" + integrity sha512-LzxlLEMbBOPYB85uXrDqvD4MgcenjRBLIns3zyhx7vTPj/0u2eQhzXvPiGcaJrV38Q9dbkExWp6cOHPJ+EtFYg== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -995,16 +997,16 @@ combined-stream "~1.0.6" extend "~3.0.2" forever-agent "~0.6.1" - form-data "~2.3.2" - http-signature "~1.3.6" + form-data "~4.0.0" + http-signature "~1.4.0" is-typedarray "~1.0.0" isstream "~0.1.2" json-stringify-safe "~5.0.1" mime-types "~2.1.19" performance-now "^2.1.0" - qs "~6.10.3" + qs "6.13.1" safe-buffer "^5.1.2" - tough-cookie "^4.1.3" + tough-cookie "^5.0.0" tunnel-agent "^0.6.0" uuid "^8.3.2" @@ -1016,17 +1018,22 @@ debug "^3.1.0" lodash.once "^4.1.1" -"@discoveryjs/json-ext@^0.5.0": - version "0.5.7" - resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" - integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== +"@discoveryjs/json-ext@^0.6.1": + version "0.6.3" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.6.3.tgz#f13c7c205915eb91ae54c557f5e92bddd8be0e83" + integrity sha512-4B4OijXeVNOPZlYA2oEwWOTkzyltLao+xbotHQeqN++Rv27Y6s818+n2Qkp8q+Fxhn0t/5lA5X1Mxktud8eayQ== + +"@dual-bundle/import-meta-resolve@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@dual-bundle/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz#519c1549b0e147759e7825701ecffd25e5819f7b" + integrity sha512-+nxncfwHM5SgAtrVzgpzJOI1ol0PkumhVo469KCf9lUi21IGcY90G98VuHm9VRrUypmAzawAHO9bs6hqeADaVg== "@hotwired/stimulus-webpack-helpers@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@hotwired/stimulus-webpack-helpers/-/stimulus-webpack-helpers-1.0.1.tgz#4cd74487adeca576c9865ac2b9fe5cb20cef16dd" integrity sha512-wa/zupVG0eWxRYJjC1IiPBdt3Lruv0RqGN+/DTMmUWUyMAEB27KXmVY6a8YpUVTM7QwVuaLNGW4EqDgrS2upXQ== -"@hotwired/stimulus@^3.0.0": +"@hotwired/stimulus@^3.2.2": version "3.2.2" resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz#071aab59c600fed95b97939e605ff261a4251608" integrity sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A== @@ -1071,7 +1078,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.24" -"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": +"@jridgewell/resolve-uri@^3.1.0": version "3.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== @@ -1094,15 +1101,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== @@ -1110,6 +1109,33 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jsonjoy.com/base64@^1.1.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jsonjoy.com/base64/-/base64-1.1.2.tgz#cf8ea9dcb849b81c95f14fc0aaa151c6b54d2578" + integrity sha512-q6XAnWQDIMA3+FTiOYajoYqySkO+JSat0ytXGSuRdq9uXE7o92gzuQwQM14xaCRlBLGq3v5miDGC4vkVTn54xA== + +"@jsonjoy.com/json-pack@^1.0.3": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@jsonjoy.com/json-pack/-/json-pack-1.1.1.tgz#1f2db19ab1fd3304ccac259a1ef1dc6aff6df0ba" + integrity sha512-osjeBqMJ2lb/j/M8NCPjs1ylqWIcTRTycIhVB5pt6LgzgeRSb0YRZ7j9RfA8wIUrsr/medIuhVyonXRZWLyfdw== + dependencies: + "@jsonjoy.com/base64" "^1.1.1" + "@jsonjoy.com/util" "^1.1.2" + hyperdyperid "^1.2.0" + thingies "^1.20.0" + +"@jsonjoy.com/util@^1.1.2", "@jsonjoy.com/util@^1.3.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jsonjoy.com/util/-/util-1.5.0.tgz#6008e35b9d9d8ee27bc4bfaa70c8cbf33a537b4c" + integrity sha512-ojoNsrIuPI9g6o8UxhraZQSyF2ByJanAY4cTFbc8Mf2AXEF4aQRGY1dJxyJpuyav8r9FGflEt/Ff3u5Nt6YMPA== + +"@keyv/serialize@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@keyv/serialize/-/serialize-1.0.2.tgz#72507c4be94d8914434a4aa80661f8ac6131967f" + integrity sha512-+E/LyaAeuABniD/RvUezWVXKpeuvwLEA9//nE9952zBaOdBd2mQ3pPoM8cUe2X6IcMByfuSLzmYqnYshG60+HQ== + dependencies: + buffer "^6.0.3" + "@leichtgewicht/ip-codec@^2.0.1": version "2.0.5" resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz#4fc56c15c580b9adb7dc3c333a134e540b44bfb1" @@ -1245,17 +1271,24 @@ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== -"@ryangjchandler/alpine-tooltip@^1.2.0": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@ryangjchandler/alpine-tooltip/-/alpine-tooltip-1.3.1.tgz#71d57bb26ec3948667f69549a66f8484b83cb130" - integrity sha512-6Vx87IVUUyzNzRbjvi3i14bq51K6BGSep/fipS8d7gNDr9ebGn2P5LMPISn1ryFg71bBNHPdm0jO/K812d7BWQ== +"@ryangjchandler/alpine-tooltip@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@ryangjchandler/alpine-tooltip/-/alpine-tooltip-2.0.1.tgz#e2c56b3dcc0c65d6457e3bd8a122b54acd9bd557" + integrity sha512-Hv9C02bUE4JSewZhfceYSHw+oiBuUF3ITCMKqmiFWJ3bvjhHZzM8YEPpNQVMfEVRR4K4JJYJD16re4stGIjoyg== + dependencies: + tippy.js "^6.3.1" "@sinclair/typebox@^0.27.8": version "0.27.8" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== -"@symfony/stimulus-bridge@^3.2.0": +"@sindresorhus/merge-streams@^2.1.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz#719df7fb41766bc143369eaa0dd56d8dc87c9958" + integrity sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg== + +"@symfony/stimulus-bridge@^3.2.3": version "3.2.3" resolved "https://registry.yarnpkg.com/@symfony/stimulus-bridge/-/stimulus-bridge-3.2.3.tgz#1c496d4b11e24051be26a11045118f29f9c3f9b7" integrity sha512-36rQTihQ2MGOn8EmdOYCr3DQfP3WS1CNcUUXKTPY5ghtFOeb7OVuhbc32AjRowE2/vaVDOUCPOTv3VLf5VtXBA== @@ -1266,29 +1299,25 @@ loader-utils "^2.0.0" schema-utils "^3.0.0" -"@symfony/webpack-encore@^4.0.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@symfony/webpack-encore/-/webpack-encore-4.7.0.tgz#d8f9ddc28ddb4175d65e3dd9de3a86e38e6fff52" - integrity sha512-vlvg1mYLVSaujTEUmkd/ucwK7LG7+89PHfOwfz/sJ53n2IFGtuAXyPyXL0igJ0tMcKvDuCShiWTX1nfnzT/Srw== +"@symfony/webpack-encore@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@symfony/webpack-encore/-/webpack-encore-5.0.1.tgz#c424baf820ecefc8f8e3b22f8e9778dd3f039eaf" + integrity sha512-2l9ssZCJDMKOXi1iggjn7HEaErdYvITvuheLvtXHAgR2mauV2FiE/pNFS+Bqz2sbj1g4pPcqJIl5AwFE9etOgg== dependencies: "@nuxt/friendly-errors-webpack-plugin" "^2.5.1" - assets-webpack-plugin "7.0.*" babel-loader "^9.1.3" - chalk "^4.0.0" - clean-webpack-plugin "^4.0.0" - css-loader "^6.7.0" - css-minimizer-webpack-plugin "^5.0.0" + css-loader "^7.1.0" + css-minimizer-webpack-plugin "^7.0.0" fastest-levenshtein "^1.0.16" mini-css-extract-plugin "^2.6.0" + picocolors "^1.1.0" pretty-error "^4.0.0" resolve-url-loader "^5.0.0" semver "^7.3.2" style-loader "^3.3.0" - sync-rpc "^1.3.6" tapable "^2.2.1" terser-webpack-plugin "^5.3.0" tmp "^0.2.1" - webpack-dev-server "^4.8.0" yargs-parser "^21.0.0" "@trysound/sax@0.2.0": @@ -1296,26 +1325,6 @@ resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== -"@tsconfig/node10@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" - integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== - -"@tsconfig/node12@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" - integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== - -"@tsconfig/node14@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" - integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== - -"@tsconfig/node16@^1.0.2": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" - integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== - "@types/body-parser@*": version "1.19.5" resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.5.tgz#04ce9a3b677dc8bd681a17da1ab9835dc9d3ede4" @@ -1324,14 +1333,14 @@ "@types/connect" "*" "@types/node" "*" -"@types/bonjour@^3.5.9": +"@types/bonjour@^3.5.13": version "3.5.13" resolved "https://registry.yarnpkg.com/@types/bonjour/-/bonjour-3.5.13.tgz#adf90ce1a105e81dd1f9c61fdc5afda1bfb92956" integrity sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ== dependencies: "@types/node" "*" -"@types/connect-history-api-fallback@^1.3.5": +"@types/connect-history-api-fallback@^1.5.4": version "1.5.4" resolved "https://registry.yarnpkg.com/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz#7de71645a103056b48ac3ce07b3520b819c1d5b3" integrity sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw== @@ -1346,6 +1355,20 @@ dependencies: "@types/node" "*" +"@types/conventional-commits-parser@^5.0.0": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@types/conventional-commits-parser/-/conventional-commits-parser-5.0.1.tgz#8cb81cf170853496cbc501a3b32dcf5e46ffb61a" + integrity sha512-7uz5EHdzz2TqoMfV7ee61Egf5y6NkcO4FB/1iCCQnbeiI1F3xzv3vK5dBCXUCLQgGYS+mUeigK1iKQzvED+QnQ== + dependencies: + "@types/node" "*" + +"@types/debug@^4.0.0": + version "4.1.12" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917" + integrity sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ== + dependencies: + "@types/ms" "*" + "@types/eslint-scope@^3.7.7": version "3.7.7" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" @@ -1397,7 +1420,7 @@ "@types/qs" "*" "@types/serve-static" "*" -"@types/express@^4.17.13": +"@types/express@^4.17.21": version "4.17.21" resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.21.tgz#c26d4a151e60efe0084b23dc3369ebc631ed192d" integrity sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ== @@ -1407,14 +1430,6 @@ "@types/qs" "*" "@types/serve-static" "*" -"@types/glob@^7.1.1": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" - integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== - dependencies: - "@types/minimatch" "*" - "@types/node" "*" - "@types/http-errors@*": version "2.0.4" resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-2.0.4.tgz#7eb47726c391b7345a6ec35ad7f4de469cf5ba4f" @@ -1451,20 +1466,20 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== +"@types/katex@^0.16.0": + version "0.16.7" + resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.16.7.tgz#03ab680ab4fa4fbc6cb46ecf987ecad5d8019868" + integrity sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ== + "@types/mime@^1": version "1.3.5" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w== -"@types/minimatch@*": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" - integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== - -"@types/minimist@^1.2.0": - version "1.2.5" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.5.tgz#ec10755e871497bcd83efe927e43ec46e8c0747e" - integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== +"@types/ms@*": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@types/ms/-/ms-2.1.0.tgz#052aa67a48eccc4309d7f0191b7e41434b90bb78" + integrity sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA== "@types/node-forge@^1.3.0": version "1.3.11" @@ -1480,26 +1495,6 @@ dependencies: undici-types "~6.20.0" -"@types/node@20.5.1": - version "20.5.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.1.tgz#178d58ee7e4834152b0e8b4d30cbfab578b9bb30" - integrity sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg== - -"@types/node@^16.18.39": - version "16.18.124" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.124.tgz#3485947880c049e643e06d9ca368e5a94b4ef92f" - integrity sha512-8ADCm5WzM/IpWxjs1Jhtwo6j+Fb8z4yr/CobP5beUUPdyCI0mg87/bqQYxNcqnhZ24Dc9RME8SQWu5eI/FmSGA== - -"@types/normalize-package-data@^2.4.0": - version "2.4.4" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" - integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA== - -"@types/parse-json@^4.0.0": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" - integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw== - "@types/q@^1.5.1": version "1.5.8" resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.8.tgz#95f6c6a08f2ad868ba230ead1d2d7f7be3db3837" @@ -1515,10 +1510,10 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.7.tgz#50ae4353eaaddc04044279812f52c8c65857dbcb" integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== -"@types/retry@0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" - integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== +"@types/retry@0.12.2": + version "0.12.2" + resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.2.tgz#ed279a64fa438bb69f2480eda44937912bb7480a" + integrity sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow== "@types/send@*": version "0.17.4" @@ -1528,14 +1523,14 @@ "@types/mime" "^1" "@types/node" "*" -"@types/serve-index@^1.9.1": +"@types/serve-index@^1.9.4": version "1.9.4" resolved "https://registry.yarnpkg.com/@types/serve-index/-/serve-index-1.9.4.tgz#e6ae13d5053cb06ed36392110b4f9a49ac4ec898" integrity sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug== dependencies: "@types/express" "*" -"@types/serve-static@*", "@types/serve-static@^1.13.10": +"@types/serve-static@*", "@types/serve-static@^1.15.5": version "1.15.7" resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.7.tgz#22174bbd74fb97fe303109738e9b5c2f3064f714" integrity sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw== @@ -1554,19 +1549,24 @@ resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.9.tgz#d4597dbd4618264c414d7429363e3f50acb66ea2" integrity sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w== -"@types/sockjs@^0.3.33": +"@types/sockjs@^0.3.36": version "0.3.36" resolved "https://registry.yarnpkg.com/@types/sockjs/-/sockjs-0.3.36.tgz#ce322cf07bcc119d4cbf7f88954f3a3bd0f67535" integrity sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q== dependencies: "@types/node" "*" +"@types/unist@^2.0.0": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.11.tgz#11af57b127e32487774841f7a4e54eab166d03c4" + integrity sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA== + "@types/webpack-env@^1.16.4": version "1.18.5" resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.18.5.tgz#eccda0b04fe024bed505881e2e532f9c119169bf" integrity sha512-wz7kjjRRj8/Lty4B+Kr0LN6Ypc/3SymeCCGSbaXp2leH0ZVg/PriNiOwNj4bD4uphI7A8NXS4b6Gl373sfO5mA== -"@types/ws@^8.5.5": +"@types/ws@^8.5.10": version "8.5.13" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.13.tgz#6414c280875e2691d0d1e080b05addbf5cb91e20" integrity sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA== @@ -1725,20 +1725,20 @@ "@webassemblyjs/ast" "1.14.1" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.1.1.tgz#3b2f852e91dac6e3b85fb2a314fb8bef46d94646" - integrity sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw== +"@webpack-cli/configtest@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-3.0.1.tgz#76ac285b9658fa642ce238c276264589aa2b6b57" + integrity sha512-u8d0pJ5YFgneF/GuvEiDA61Tf1VDomHHYMjv/wc9XzYj7nopltpG96nXN5dJRstxZhcNpV1g+nT6CydO7pHbjA== -"@webpack-cli/info@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-2.0.2.tgz#cc3fbf22efeb88ff62310cf885c5b09f44ae0fdd" - integrity sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A== +"@webpack-cli/info@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-3.0.1.tgz#3cff37fabb7d4ecaab6a8a4757d3826cf5888c63" + integrity sha512-coEmDzc2u/ffMvuW9aCjoRzNSPDl/XLuhPdlFRpT9tZHmJ/039az33CE7uH+8s0uL1j5ZNtfdv0HkfaKRBGJsQ== -"@webpack-cli/serve@^2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e" - integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ== +"@webpack-cli/serve@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-3.0.1.tgz#bd8b1f824d57e30faa19eb78e4c0951056f72f00" + integrity sha512-sbgw03xQaCLiT6gcY/6u3qBDn01CWw/nbaXl3gTdTFuJJ75Gffv3E3DBpgvY2fkkrdS1fpjaXNOmJlnbtKauKg== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -1766,14 +1766,7 @@ accepts@~1.3.4, accepts@~1.3.8: mime-types "~2.1.34" negotiator "0.6.3" -acorn-walk@^8.1.1: - version "8.3.4" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" - integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== - dependencies: - acorn "^8.11.0" - -acorn@^8.0.5, acorn@^8.11.0, acorn@^8.14.0, acorn@^8.4.1, acorn@^8.8.2: +acorn@^8.0.5, acorn@^8.14.0, acorn@^8.8.2: version "8.14.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== @@ -1833,7 +1826,7 @@ ajv@^8.0.0, ajv@^8.0.1, ajv@^8.11.0, ajv@^8.9.0: json-schema-traverse "^1.0.0" require-from-string "^2.0.2" -alpinejs@^3.12.0: +alpinejs@^3.14.8: version "3.14.8" resolved "https://registry.yarnpkg.com/alpinejs/-/alpinejs-3.14.8.tgz#062de45daa219db14375b3cb35ba28e5b0627337" integrity sha512-wT2fuP2DXpGk/jKaglwy7S/IJpm1FD+b7U6zUrhwErjoq5h27S4dxkJEXVvhbdwyPv9U+3OkUuNLkZT4h2Kfrg== @@ -1904,11 +1897,6 @@ arch@^2.2.0: resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - arg@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c" @@ -1944,23 +1932,11 @@ array-ify@^1.0.0: resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng== -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - integrity sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng== - dependencies: - array-uniq "^1.0.1" - array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== - array.prototype.reduce@^1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.7.tgz#6aadc2f995af29cb887eb866d981dc85ab6f7dc7" @@ -1987,11 +1963,6 @@ arraybuffer.prototype.slice@^1.0.4: get-intrinsic "^1.2.6" is-array-buffer "^3.0.4" -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== - asn1@~0.2.3: version "0.2.6" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" @@ -2004,15 +1975,6 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== -assets-webpack-plugin@7.0.*: - version "7.0.0" - resolved "https://registry.yarnpkg.com/assets-webpack-plugin/-/assets-webpack-plugin-7.0.0.tgz#c61ed7466f35ff7a4d90d7070948736f471b8804" - integrity sha512-DMZ9r6HFxynWeONRMhSOFTvTrmit5dovdoUKdJgCG03M6CC7XiwNImPH+Ad1jaVrQ2n59e05lBhte52xPt4MSA== - dependencies: - camelcase "^6.0.0" - escape-string-regexp "^4.0.0" - lodash "^4.17.20" - astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" @@ -2033,7 +1995,7 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -autoprefixer@^10.4.0: +autoprefixer@^10.4.20: version "10.4.20" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.20.tgz#5caec14d43976ef42e32dcb4bd62878e96be5b3b" integrity sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g== @@ -2062,7 +2024,7 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.13.2.tgz#0aa167216965ac9474ccfa83892cfb6b3e1e52ef" integrity sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw== -axios@^1.4.0: +axios@^1.7.9: version "1.7.9" resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.9.tgz#d7d071380c132a24accda1b2cfc1535b79ec650a" integrity sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw== @@ -2168,7 +2130,7 @@ body-parser@1.20.3: type-is "~1.6.18" unpipe "1.0.0" -bonjour-service@^1.0.11: +bonjour-service@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/bonjour-service/-/bonjour-service-1.3.0.tgz#80d867430b5a0da64e82a8047fc1e355bdb71722" integrity sha512-3YuAUiSkWykd+2Azjgyxei8OWf8thdn8AITIog2M4UICzoqfjlqr64WIjEXZllf/W6vK1goqleSR6brGomxQqA== @@ -2181,14 +2143,6 @@ boolbase@^1.0.0, boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - brace-expansion@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" @@ -2196,14 +2150,14 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" -braces@^3.0.2, braces@^3.0.3, braces@~3.0.2: +braces@^3.0.3, braces@~3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: fill-range "^7.1.1" -browserslist@^4.0.0, browserslist@^4.23.0, browserslist@^4.23.3, browserslist@^4.24.0, browserslist@^4.24.3: +browserslist@^4.0.0, browserslist@^4.23.3, browserslist@^4.24.0, browserslist@^4.24.3: version "4.24.4" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b" integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== @@ -2223,7 +2177,7 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -buffer@^5.6.0: +buffer@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -2231,11 +2185,34 @@ buffer@^5.6.0: base64-js "^1.3.1" ieee754 "^1.1.13" +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +bundle-name@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bundle-name/-/bundle-name-4.1.0.tgz#f3b96b34160d6431a19d7688135af7cfb8797889" + integrity sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q== + dependencies: + run-applescript "^7.0.0" + bytes@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== +cacheable@^1.8.7: + version "1.8.7" + resolved "https://registry.yarnpkg.com/cacheable/-/cacheable-1.8.7.tgz#a4e2c99de531539cb26db7003f1ac9287b6d9f15" + integrity sha512-AbfG7dAuYNjYxFUtL1lAqmlWdxczCJ47w7cFjhGcnGnUdwSo6VgmSojfoW3tUI12HUkgTJ5kqj78yyq6TsFtlg== + dependencies: + hookified "^1.6.0" + keyv "^5.2.3" + cachedir@^2.3.0: version "2.4.0" resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.4.0.tgz#7fef9cf7367233d7c88068fe6e34ed0d355a610d" @@ -2277,25 +2254,6 @@ camelcase-css@^2.0.1: resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== -camelcase-keys@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-6.2.2.tgz#5e755d6ba51aa223ec7d3d52f25778210f9dc3c0" - integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== - dependencies: - camelcase "^5.3.1" - map-obj "^4.0.0" - quick-lru "^4.0.1" - -camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.0.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - caniuse-api@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0" @@ -2333,12 +2291,32 @@ chalk@^4.0.0, chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^5.3.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8" + integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w== + +character-entities-legacy@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz#76bc83a90738901d7bc223a9e93759fdd560125b" + integrity sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ== + +character-entities@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.2.tgz#2d09c2e72cd9523076ccb21157dff66ad43fcc22" + integrity sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ== + +character-reference-invalid@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz#85c66b041e43b47210faf401278abf808ac45cb9" + integrity sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw== + check-more-types@^2.24.0: version "2.24.0" resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== -chokidar@^3.5.3, chokidar@^3.6.0: +chokidar@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== @@ -2370,18 +2348,16 @@ ci-info@^3.2.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== +ci-info@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-4.1.0.tgz#92319d2fa29d2620180ea5afed31f589bc98cf83" + integrity sha512-HutrvTNsF48wnxkzERIXOe5/mlcfFcbfCmwcg6CJnizbSue78AbDt+1cgl26zwn61WFxhcPykPfZrbqjGmBb4A== + clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== -clean-webpack-plugin@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-4.0.0.tgz#72947d4403d452f38ed61a9ff0ada8122aacd729" - integrity sha512-WuWE1nyTNAyW5T7oNyys2EN0cfP2fdRxhxnIQWiAp0bMabPdHhoGxM8A6YL2GhqwgrPnnaemVE7nv5XJ2Fhh2w== - dependencies: - del "^4.1.1" - cli-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" @@ -2467,17 +2443,17 @@ colorette@^2.0.10, colorette@^2.0.14, colorette@^2.0.16: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: +combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" -commander@^10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" - integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== +commander@^12.1.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" + integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== commander@^2.20.0: version "2.20.3" @@ -2499,6 +2475,11 @@ commander@^7.2.0: resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== +commander@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== + common-path-prefix@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0" @@ -2537,11 +2518,6 @@ compression@^1.7.4: safe-buffer "5.2.1" vary "~1.1.2" -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - connect-history-api-fallback@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz#647264845251a0daf25b97ce87834cace0f5f1c8" @@ -2564,29 +2540,29 @@ content-type@~1.0.4, content-type@~1.0.5: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== -conventional-changelog-angular@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-6.0.0.tgz#a9a9494c28b7165889144fd5b91573c4aa9ca541" - integrity sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg== +conventional-changelog-angular@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz#5eec8edbff15aa9b1680a8dcfbd53e2d7eb2ba7a" + integrity sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ== dependencies: compare-func "^2.0.0" -conventional-changelog-conventionalcommits@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-6.1.0.tgz#3bad05f4eea64e423d3d90fc50c17d2c8cf17652" - integrity sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw== +conventional-changelog-conventionalcommits@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz#aa5da0f1b2543094889e8cf7616ebe1a8f5c70d5" + integrity sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w== dependencies: compare-func "^2.0.0" -conventional-commits-parser@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-4.0.0.tgz#02ae1178a381304839bce7cea9da5f1b549ae505" - integrity sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg== +conventional-commits-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz#57f3594b81ad54d40c1b4280f04554df28627d9a" + integrity sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA== dependencies: JSONStream "^1.3.5" - is-text-path "^1.0.1" - meow "^8.1.2" - split2 "^3.2.2" + is-text-path "^2.0.0" + meow "^12.0.1" + split2 "^4.0.0" convert-source-map@^1.7.0: version "1.9.0" @@ -2615,7 +2591,7 @@ core-js-compat@^3.38.0, core-js-compat@^3.38.1: dependencies: browserslist "^4.24.3" -core-js@^3.23.0: +core-js@^3.40.0: version "3.40.0" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.40.0.tgz#2773f6b06877d8eda102fc42f828176437062476" integrity sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ== @@ -2630,36 +2606,22 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cosmiconfig-typescript-loader@^4.0.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.4.0.tgz#f3feae459ea090f131df5474ce4b1222912319f9" - integrity sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw== - -cosmiconfig@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" - integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== +cosmiconfig-typescript-loader@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-6.1.0.tgz#7f644503e1c2bff90aed2d29a637008f279646bb" + integrity sha512-tJ1w35ZRUiM5FeTzT7DtYWAFFv37ZLqSRkGi2oeCK1gPhvaWjkAtfXvLmvE1pRfxxp9aQo6ba/Pvg1dKj05D4g== dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.2.1" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.10.0" + jiti "^2.4.1" -cosmiconfig@^8.0.0, cosmiconfig@^8.3.5: - version "8.3.6" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.3.6.tgz#060a2b871d66dba6c8538ea1118ba1ac16f5fae3" - integrity sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA== +cosmiconfig@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-9.0.0.tgz#34c3fc58287b915f3ae905ab6dc3de258b55ad9d" + integrity sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg== dependencies: + env-paths "^2.2.1" import-fresh "^3.3.0" js-yaml "^4.1.0" parse-json "^5.2.0" - path-type "^4.0.0" - -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== cross-env@^7.0.3: version "7.0.3" @@ -2682,15 +2644,15 @@ css-declaration-sorter@^7.2.0: resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-7.2.0.tgz#6dec1c9523bc4a643e088aab8f09e67a54961024" integrity sha512-h70rUM+3PNFuaBDTLe8wF/cdWu+dOZmb7pJt8Z2sedYbAcQVQV/tEchueg3GWxwqS0cxtbxmaHEdkNACqcvsow== -css-functions-list@^3.1.0: +css-functions-list@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/css-functions-list/-/css-functions-list-3.2.3.tgz#95652b0c24f0f59b291a9fc386041a19d4f40dbe" integrity sha512-IQOkD3hbR5KrN93MtcYuad6YPuTSUhntLHDuLEbFWE+ff2/XSZNdZG+LcbbIW5AXKg/WFIfYItIzVoHngHXZzA== -css-loader@^6.7.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.11.0.tgz#33bae3bf6363d0a7c2cf9031c96c744ff54d85ba" - integrity sha512-CTJ+AEQJjq5NzLga5pE39qdiSV56F8ywCIsqNIRF0r7BDgWsN25aazToqAFg7ZrtA/U016xudB3ffgweORxX7g== +css-loader@^7.1.0: + version "7.1.2" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-7.1.2.tgz#64671541c6efe06b0e22e750503106bdd86880f8" + integrity sha512-6WvYYn7l/XEGN8Xu2vWFt9nVzrCn39vKyTEFf/ExEyoksJjjSZV/0/35XPlMbpnr6VGhZIUg5yJrL8tGfes/FA== dependencies: icss-utils "^5.1.0" postcss "^8.4.33" @@ -2701,17 +2663,17 @@ css-loader@^6.7.0: postcss-value-parser "^4.2.0" semver "^7.5.4" -css-minimizer-webpack-plugin@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-5.0.1.tgz#33effe662edb1a0bf08ad633c32fa75d0f7ec565" - integrity sha512-3caImjKFQkS+ws1TGcFn0V1HyDJFq1Euy589JlD6/3rV2kj+w7r5G9WDMgSHvpvXHNZ2calVypZWuEDQd9wfLg== +css-minimizer-webpack-plugin@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-7.0.0.tgz#b77a3d2f7c0fd02d3ac250dcc2f79065363f3cd3" + integrity sha512-niy66jxsQHqO+EYbhPuIhqRQ1mNcNVUHrMnkzzir9kFOERJUaQDDRhh7dKDz33kBpkWMF9M8Vx0QlDbc5AHOsw== dependencies: - "@jridgewell/trace-mapping" "^0.3.18" - cssnano "^6.0.1" - jest-worker "^29.4.3" - postcss "^8.4.24" - schema-utils "^4.0.1" - serialize-javascript "^6.0.1" + "@jridgewell/trace-mapping" "^0.3.25" + cssnano "^7.0.1" + jest-worker "^29.7.0" + postcss "^8.4.38" + schema-utils "^4.2.0" + serialize-javascript "^6.0.2" css-select-base-adapter@^0.1.1: version "0.1.1" @@ -2774,6 +2736,14 @@ css-tree@^2.3.1: mdn-data "2.0.30" source-map-js "^1.0.1" +css-tree@^3.0.1, css-tree@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-3.1.0.tgz#7aabc035f4e66b5c86f54570d55e05b1346eb0fd" + integrity sha512-0eW44TGN5SQXU1mWSkKwFstI/22X2bG1nYzZTYMAWjylYURhse752YgbE4Cx46AC+bAvI+/dYTPRk1LqSUnu6w== + dependencies: + mdn-data "2.12.2" + source-map-js "^1.0.1" + css-tree@~2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-2.2.1.tgz#36115d382d60afd271e377f9c5f67d02bd48c032" @@ -2797,54 +2767,54 @@ cssesc@^3.0.0: resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -cssnano-preset-default@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-6.1.2.tgz#adf4b89b975aa775f2750c89dbaf199bbd9da35e" - integrity sha512-1C0C+eNaeN8OcHQa193aRgYexyJtU8XwbdieEjClw+J9d94E41LwT6ivKH0WT+fYwYWB0Zp3I3IZ7tI/BbUbrg== +cssnano-preset-default@^7.0.6: + version "7.0.6" + resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-7.0.6.tgz#0220fa7507478369aa2a226bac03e1204cd024c1" + integrity sha512-ZzrgYupYxEvdGGuqL+JKOY70s7+saoNlHSCK/OGn1vB2pQK8KSET8jvenzItcY+kA7NoWvfbb/YhlzuzNKjOhQ== dependencies: - browserslist "^4.23.0" + browserslist "^4.23.3" css-declaration-sorter "^7.2.0" - cssnano-utils "^4.0.2" - postcss-calc "^9.0.1" - postcss-colormin "^6.1.0" - postcss-convert-values "^6.1.0" - postcss-discard-comments "^6.0.2" - postcss-discard-duplicates "^6.0.3" - postcss-discard-empty "^6.0.3" - postcss-discard-overridden "^6.0.2" - postcss-merge-longhand "^6.0.5" - postcss-merge-rules "^6.1.1" - postcss-minify-font-values "^6.1.0" - postcss-minify-gradients "^6.0.3" - postcss-minify-params "^6.1.0" - postcss-minify-selectors "^6.0.4" - postcss-normalize-charset "^6.0.2" - postcss-normalize-display-values "^6.0.2" - postcss-normalize-positions "^6.0.2" - postcss-normalize-repeat-style "^6.0.2" - postcss-normalize-string "^6.0.2" - postcss-normalize-timing-functions "^6.0.2" - postcss-normalize-unicode "^6.1.0" - postcss-normalize-url "^6.0.2" - postcss-normalize-whitespace "^6.0.2" - postcss-ordered-values "^6.0.2" - postcss-reduce-initial "^6.1.0" - postcss-reduce-transforms "^6.0.2" - postcss-svgo "^6.0.3" - postcss-unique-selectors "^6.0.4" - -cssnano-utils@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-4.0.2.tgz#56f61c126cd0f11f2eef1596239d730d9fceff3c" - integrity sha512-ZR1jHg+wZ8o4c3zqf1SIUSTIvm/9mU343FMR6Obe/unskbvpGhZOo1J6d/r8D1pzkRQYuwbcH3hToOuoA2G7oQ== + cssnano-utils "^5.0.0" + postcss-calc "^10.0.2" + postcss-colormin "^7.0.2" + postcss-convert-values "^7.0.4" + postcss-discard-comments "^7.0.3" + postcss-discard-duplicates "^7.0.1" + postcss-discard-empty "^7.0.0" + postcss-discard-overridden "^7.0.0" + postcss-merge-longhand "^7.0.4" + postcss-merge-rules "^7.0.4" + postcss-minify-font-values "^7.0.0" + postcss-minify-gradients "^7.0.0" + postcss-minify-params "^7.0.2" + postcss-minify-selectors "^7.0.4" + postcss-normalize-charset "^7.0.0" + postcss-normalize-display-values "^7.0.0" + postcss-normalize-positions "^7.0.0" + postcss-normalize-repeat-style "^7.0.0" + postcss-normalize-string "^7.0.0" + postcss-normalize-timing-functions "^7.0.0" + postcss-normalize-unicode "^7.0.2" + postcss-normalize-url "^7.0.0" + postcss-normalize-whitespace "^7.0.0" + postcss-ordered-values "^7.0.1" + postcss-reduce-initial "^7.0.2" + postcss-reduce-transforms "^7.0.0" + postcss-svgo "^7.0.1" + postcss-unique-selectors "^7.0.3" + +cssnano-utils@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-5.0.0.tgz#b53a0343dd5d21012911882db6ae7d2eae0e3687" + integrity sha512-Uij0Xdxc24L6SirFr25MlwC2rCFX6scyUmuKpzI+JQ7cyqDEwD42fJ0xfB3yLfOnRDU5LKGgjQ9FA6LYh76GWQ== -cssnano@^6.0.1: - version "6.1.2" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-6.1.2.tgz#4bd19e505bd37ee7cf0dc902d3d869f6d79c66b8" - integrity sha512-rYk5UeX7VAM/u0lNqewCdasdtPK81CgX8wJFLEIXHbV2oldWRgJAsZrdhRXkV1NJzA2g850KiFm9mMU2HxNxMA== +cssnano@^7.0.1: + version "7.0.6" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-7.0.6.tgz#63d54fd42bc017f6aaed69e47d9aaef85b7850ec" + integrity sha512-54woqx8SCbp8HwvNZYn68ZFAepuouZW4lTwiMVnBErM3VkO7/Sd4oTOt3Zz3bPx3kxQ36aISppyXj2Md4lg8bw== dependencies: - cssnano-preset-default "^6.1.2" - lilconfig "^3.1.1" + cssnano-preset-default "^7.0.6" + lilconfig "^3.1.2" csso@^4.0.2: version "4.2.0" @@ -2860,28 +2830,28 @@ csso@^5.0.5: dependencies: css-tree "~2.2.0" -cypress-wait-until@^1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/cypress-wait-until/-/cypress-wait-until-1.7.2.tgz#7f534dd5a11c89b65359e7a0210f20d3dfc22107" - integrity sha512-uZ+M8/MqRcpf+FII/UZrU7g1qYZ4aVlHcgyVopnladyoBrpoaMJ4PKZDrdOJ05H5RHbr7s9Tid635X3E+ZLU/Q== +cypress-wait-until@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/cypress-wait-until/-/cypress-wait-until-3.0.2.tgz#c90dddfa4c46a2c422f5b91d486531c560bae46e" + integrity sha512-iemies796dD5CgjG5kV0MnpEmKSH+s7O83ZoJLVzuVbZmm4lheMsZqAVT73hlMx4QlkwhxbyUzhOBUOZwoOe0w== -cypress@^12.11.0: - version "12.17.4" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.4.tgz#b4dadf41673058493fa0d2362faa3da1f6ae2e6c" - integrity sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ== +cypress@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-14.0.0.tgz#a71cb0a243a0bfeb97b6973ab9c5291ca5288e93" + integrity sha512-kEGqQr23so5IpKeg/dp6GVi7RlHx1NmW66o2a2Q4wk9gRaAblLZQSiZJuDI8UMC4LlG5OJ7Q6joAiqTrfRNbTw== dependencies: - "@cypress/request" "2.88.12" + "@cypress/request" "^3.0.6" "@cypress/xvfb" "^1.2.4" - "@types/node" "^16.18.39" "@types/sinonjs__fake-timers" "8.1.1" "@types/sizzle" "^2.3.2" arch "^2.2.0" blob-util "^2.0.2" bluebird "^3.7.2" - buffer "^5.6.0" + buffer "^5.7.1" cachedir "^2.3.0" chalk "^4.1.0" check-more-types "^2.24.0" + ci-info "^4.0.0" cli-cursor "^3.1.0" cli-table3 "~0.6.1" commander "^6.2.1" @@ -2896,7 +2866,6 @@ cypress@^12.11.0: figures "^3.2.0" fs-extra "^9.1.0" getos "^3.2.1" - is-ci "^3.0.0" is-installed-globally "~0.4.0" lazy-ass "^1.6.0" listr2 "^3.8.3" @@ -2910,14 +2879,15 @@ cypress@^12.11.0: request-progress "^3.0.0" semver "^7.5.3" supports-color "^8.1.1" - tmp "~0.2.1" + tmp "~0.2.3" + tree-kill "1.2.2" untildify "^4.0.0" yauzl "^2.10.0" -dargs@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" - integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== +dargs@^8.0.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/dargs/-/dargs-8.1.0.tgz#a34859ea509cbce45485e5aa356fef70bfcc7272" + integrity sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw== dashdash@^1.12.0: version "1.14.1" @@ -2987,32 +2957,32 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.4: +debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.4, debug@^4.3.7: version "4.4.0" resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== dependencies: ms "^2.1.3" -decamelize-keys@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.1.tgz#04a2d523b2f18d80d0158a43b895d56dff8d19d8" - integrity sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg== +decode-named-character-reference@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz#daabac9690874c394c81e4162a0304b35d824f0e" + integrity sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg== dependencies: - decamelize "^1.1.0" - map-obj "^1.0.0" + character-entities "^2.0.0" -decamelize@^1.1.0, decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== +default-browser-id@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/default-browser-id/-/default-browser-id-5.0.0.tgz#a1d98bf960c15082d8a3fa69e83150ccccc3af26" + integrity sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA== -default-gateway@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/default-gateway/-/default-gateway-6.0.3.tgz#819494c888053bdb743edbf343d6cdf7f2943a71" - integrity sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg== +default-browser@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/default-browser/-/default-browser-5.2.1.tgz#7b7ba61204ff3e425b556869ae6d3e9d9f1712cf" + integrity sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg== dependencies: - execa "^5.0.0" + bundle-name "^4.1.0" + default-browser-id "^5.0.0" define-data-property@^1.0.1, define-data-property@^1.1.4: version "1.1.4" @@ -3023,10 +2993,10 @@ define-data-property@^1.0.1, define-data-property@^1.1.4: es-errors "^1.3.0" gopd "^1.0.1" -define-lazy-prop@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" - integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== +define-lazy-prop@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz#dbb19adfb746d7fc6d734a06b72f4a00d021255f" + integrity sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg== define-properties@^1.1.3, define-properties@^1.2.1: version "1.2.1" @@ -3037,19 +3007,6 @@ define-properties@^1.1.3, define-properties@^1.2.1: has-property-descriptors "^1.0.0" object-keys "^1.1.1" -del@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4" - integrity sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ== - dependencies: - "@types/glob" "^7.1.1" - globby "^6.1.0" - is-path-cwd "^2.0.0" - is-path-in-cwd "^2.0.0" - p-map "^2.0.0" - pify "^4.0.1" - rimraf "^2.6.3" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -3065,6 +3022,11 @@ depd@~1.1.2: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== +dequal@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" + integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== + destroy@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" @@ -3080,16 +3042,18 @@ detect-node@^2.0.4: resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== +devlop@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/devlop/-/devlop-1.1.0.tgz#4db7c2ca4dc6e0e834c30be70c94bbc976dc7018" + integrity sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA== + dependencies: + dequal "^2.0.0" + didyoumean@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037" integrity sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw== -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -3289,17 +3253,17 @@ entities@^2.0.0: resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== -entities@^4.2.0: +entities@^4.2.0, entities@^4.4.0: version "4.5.0" resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== -entities@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4" - integrity sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q== +env-paths@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== -envinfo@^7.7.3: +envinfo@^7.14.0: version "7.14.0" resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.14.0.tgz#26dac5db54418f2a4c1159153a0b2ae980838aae" integrity sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg== @@ -3436,11 +3400,6 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - eslint-scope@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -3511,21 +3470,6 @@ execa@4.1.0: signal-exit "^3.0.2" strip-final-newline "^2.0.0" -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - executable@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/executable/-/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c" @@ -3533,7 +3477,7 @@ executable@^4.1.1: dependencies: pify "^2.2.0" -express@^4.17.3: +express@^4.21.2: version "4.21.2" resolved "https://registry.yarnpkg.com/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== @@ -3601,7 +3545,7 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@^3.2.11, fast-glob@^3.2.12, fast-glob@^3.2.9, fast-glob@^3.3.2: +fast-glob@^3.2.9, fast-glob@^3.3.2, fast-glob@^3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818" integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg== @@ -3655,12 +3599,12 @@ figures@^3.2.0: dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== +file-entry-cache@^10.0.5: + version "10.0.5" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-10.0.5.tgz#0255cd065769ef930005073883389e432a16a9a7" + integrity sha512-umpQsJrBNsdMDgreSryMEXvJh66XeLtZUwA8Gj7rHGearGufUFv6rB/bcXRFsiGWw/VeSUgUofF4Rf2UKEOrTA== dependencies: - flat-cache "^3.0.4" + flat-cache "^6.1.5" fill-range@^7.1.1: version "7.1.1" @@ -3690,7 +3634,7 @@ find-cache-dir@^4.0.0: common-path-prefix "^3.0.0" pkg-dir "^7.0.0" -find-up@^4.0.0, find-up@^4.1.0: +find-up@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -3698,14 +3642,6 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - find-up@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" @@ -3714,21 +3650,30 @@ find-up@^6.3.0: locate-path "^7.1.0" path-exists "^5.0.0" -flat-cache@^3.0.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" - integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== +find-up@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-7.0.0.tgz#e8dec1455f74f78d888ad65bf7ca13dd2b4e66fb" + integrity sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g== dependencies: - flatted "^3.2.9" - keyv "^4.5.3" - rimraf "^3.0.2" + locate-path "^7.2.0" + path-exists "^5.0.0" + unicorn-magic "^0.1.0" + +flat-cache@^6.1.5: + version "6.1.5" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-6.1.5.tgz#a3e0077571aa340c85c011aa6b9150b4606e2b0d" + integrity sha512-QR+2kN38f8nMfiIQ1LHYjuDEmZNZVjxuxY+HufbS3BW0EX01Q5OnH7iduOYRutmgiXb797HAKcXUeXrvRjjgSQ== + dependencies: + cacheable "^1.8.7" + flatted "^3.3.2" + hookified "^1.6.0" flat@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -flatted@^3.2.9: +flatted@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.2.tgz#adba1448a9841bec72b42c532ea23dbbedef1a27" integrity sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA== @@ -3770,7 +3715,7 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== -form-data@^4.0.0: +form-data@^4.0.0, form-data@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.1.tgz#ba1076daaaa5bfd7e99c1a6cb02aa0a5cff90d48" integrity sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw== @@ -3779,15 +3724,6 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -3803,15 +3739,6 @@ fresh@0.5.2: resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== -fs-extra@^11.0.0: - version "11.3.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.3.0.tgz#0daced136bbaf65a555a326719af931adc7a314d" - integrity sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-extra@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -3822,16 +3749,6 @@ fs-extra@^9.1.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-monkey@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.6.tgz#8ead082953e88d992cf3ff844faa907b26756da2" - integrity sha512-b1FMfwetIKymC0eioW7mTywihSQE4oLzQn1dB6rZB5fx/3NpNEdAWeCSMB+60/AeT0TCXsxzAlcYVEFCTAksWg== - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - fsevents@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" @@ -3885,11 +3802,6 @@ get-intrinsic@^1.2.4, get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@ hasown "^2.0.2" math-intrinsics "^1.1.0" -get-port@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" - integrity sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg== - get-proto@^1.0.0, get-proto@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" @@ -3905,11 +3817,6 @@ get-stream@^5.0.0, get-stream@^5.1.0: dependencies: pump "^3.0.0" -get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - get-symbol-description@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.1.0.tgz#7bdd54e0befe8ffc9f3b4e203220d9f1e881b6ee" @@ -3933,16 +3840,14 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -git-raw-commits@^2.0.11: - version "2.0.11" - resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.11.tgz#bc3576638071d18655e1cc60d7f524920008d723" - integrity sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A== +git-raw-commits@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-4.0.0.tgz#b212fd2bff9726d27c1283a1157e829490593285" + integrity sha512-ICsMM1Wk8xSGMowkOmPrzo2Fgmfo4bMHLNX6ytHjajRJUqvHOw/TFapQ+QG75c3X/tTDDhOSRPGC52dDbNM8FQ== dependencies: - dargs "^7.0.0" - lodash "^4.17.15" - meow "^8.0.0" - split2 "^3.0.0" - through2 "^4.0.0" + dargs "^8.0.0" + meow "^12.0.1" + split2 "^4.0.0" glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" @@ -3963,7 +3868,7 @@ glob-to-regexp@^0.4.1: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob@^10.3.10, glob@^10.3.7: +glob@^10.3.10: version "10.4.5" resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== @@ -3975,24 +3880,24 @@ glob@^10.3.10, glob@^10.3.7: package-json-from-dist "^1.0.0" path-scurry "^1.11.1" -glob@^7.0.3, glob@^7.1.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== +glob@^11.0.0: + version "11.0.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-11.0.1.tgz#1c3aef9a59d680e611b53dcd24bb8639cef064d9" + integrity sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw== dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" + foreground-child "^3.1.0" + jackspeak "^4.0.1" + minimatch "^10.0.0" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^2.0.0" -global-dirs@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" - integrity sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg== +global-directory@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/global-directory/-/global-directory-4.0.1.tgz#4d7ac7cfd2cb73f304c53b8810891748df5e361e" + integrity sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q== dependencies: - ini "^1.3.4" + ini "4.1.1" global-dirs@^3.0.0: version "3.0.1" @@ -4030,16 +3935,17 @@ globalthis@^1.0.4: define-properties "^1.2.1" gopd "^1.0.1" -globby@13.1.4: - version "13.1.4" - resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.4.tgz#2f91c116066bcec152465ba36e5caa4a13c01317" - integrity sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g== +globby@14.0.2: + version "14.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-14.0.2.tgz#06554a54ccfe9264e5a9ff8eded46aa1e306482f" + integrity sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw== dependencies: - dir-glob "^3.0.1" - fast-glob "^3.2.11" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^4.0.0" + "@sindresorhus/merge-streams" "^2.1.0" + fast-glob "^3.3.2" + ignore "^5.2.4" + path-type "^5.0.0" + slash "^5.1.0" + unicorn-magic "^0.1.0" globby@^11.1.0: version "11.1.0" @@ -4053,17 +3959,6 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -globby@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" - integrity sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw== - dependencies: - array-union "^1.0.1" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - globjoin@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/globjoin/-/globjoin-0.1.4.tgz#2f4494ac8919e3767c5cbb691e9f463324285d43" @@ -4089,11 +3984,6 @@ handle-thing@^2.0.0: resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" integrity sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg== -hard-rejection@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" - integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== - has-bigints@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.1.0.tgz#28607e965ac967e03cd2a2c70a2636a1edad49fe" @@ -4142,17 +4032,10 @@ hasown@^2.0.2: dependencies: function-bind "^1.1.2" -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - -hosted-git-info@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" - integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== - dependencies: - lru-cache "^6.0.0" +hookified@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/hookified/-/hookified-1.6.0.tgz#161315ed4525a21f74d710dd9cec71e73951bed2" + integrity sha512-se7cpwTA+iA/eY548Bu03JJqBiEZAqU2jnyKdj5B5qurtBg64CZGHTgqCv4Yh7NWu6FGI09W61MCq+NoPj9GXA== hpack.js@^2.1.6: version "2.1.6" @@ -4164,12 +4047,7 @@ hpack.js@^2.1.6: readable-stream "^2.0.1" wbuf "^1.1.0" -html-entities@^2.3.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.5.2.tgz#201a3cf95d3a15be7099521620d19dfb4f65359f" - integrity sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA== - -html-tags@^3.2.0: +html-tags@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.3.1.tgz#a04026a18c882e4bba8a01a3d39cfe465d40b5ce" integrity sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ== @@ -4215,7 +4093,7 @@ http-parser-js@>=0.5.1: resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.9.tgz#b817b3ca0edea6236225000d795378707c169cec" integrity sha512-n1XsPy3rXVxlqxVioEWdC+0+M+SQw0DpJynwtOPo1X+ZlvdzTLtDBIJJlDQTnwZIFJrZSzSGmIOUdP8tu+SgLw== -http-proxy-middleware@^2.0.3: +http-proxy-middleware@^2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== @@ -4235,24 +4113,24 @@ http-proxy@^1.18.1: follow-redirects "^1.0.0" requires-port "^1.0.0" -http-signature@~1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.3.6.tgz#cb6fbfdf86d1c974f343be94e87f7fc128662cf9" - integrity sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw== +http-signature@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.4.0.tgz#dee5a9ba2bf49416abc544abd6d967f6a94c8c3f" + integrity sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg== dependencies: assert-plus "^1.0.0" jsprim "^2.0.2" - sshpk "^1.14.1" + sshpk "^1.18.0" human-signals@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +hyperdyperid@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/hyperdyperid/-/hyperdyperid-1.2.0.tgz#59668d323ada92228d2a869d3e474d5a33b69e6b" + integrity sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A== iconv-lite@0.4.24: version "0.4.24" @@ -4266,22 +4144,27 @@ icss-utils@^5.0.0, icss-utils@^5.1.0: resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== -ieee754@^1.1.13: +ieee754@^1.1.13, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^5.2.0, ignore@^5.2.1: +ignore@^5.2.0, ignore@^5.2.4: version "5.3.2" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== +ignore@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.3.tgz#397ef9315dfe0595671eefe8b633fec6943ab733" + integrity sha512-bAH5jbK/F3T3Jls4I0SO1hmPR0dKU0a7+SY6n1yzRtG54FLO8d6w/nxLFX2Nb7dBu6cCWXPaAME6cYqFUMmuCA== + immutable@^5.0.2: version "5.0.3" resolved "https://registry.yarnpkg.com/immutable/-/immutable-5.0.3.tgz#aa037e2313ea7b5d400cd9298fa14e404c933db1" integrity sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw== -import-fresh@^3.0.0, import-fresh@^3.2.1, import-fresh@^3.3.0: +import-fresh@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -4289,11 +4172,6 @@ import-fresh@^3.0.0, import-fresh@^3.2.1, import-fresh@^3.3.0: parent-module "^1.0.0" resolve-from "^4.0.0" -import-lazy@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153" - integrity sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw== - import-local@^3.0.2: version "3.2.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260" @@ -4302,6 +4180,11 @@ import-local@^3.0.2: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" +import-meta-resolve@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz#f9db8bead9fafa61adb811db77a2bf22c5399706" + integrity sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw== + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -4317,30 +4200,27 @@ indexes-of@^1.0.1: resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" integrity sha512-bup+4tap3Hympa+JBJUG7XuOsdNQ6fxt0MHyXMKuLBKn0OqsTfvUxkUrroEX1+B2VsSHvCjiIcZVxRtYa4nllA== -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: +inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== - ini@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== -ini@^1.3.4, ini@^1.3.5: +ini@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ini/-/ini-4.1.1.tgz#d95b3d843b1e906e56d6747d5447904ff50ce7a1" + integrity sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g== + +ini@^1.3.5: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== @@ -4364,11 +4244,24 @@ ipaddr.js@1.9.1: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== -ipaddr.js@^2.0.1: +ipaddr.js@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.2.0.tgz#d33fa7bac284f4de7af949638c9d68157c6b92e8" integrity sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA== +is-alphabetical@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-2.0.1.tgz#01072053ea7c1036df3c7d19a6daaec7f19e789b" + integrity sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ== + +is-alphanumerical@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz#7c03fbe96e3e931113e57f964b0a368cc2dfd875" + integrity sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw== + dependencies: + is-alphabetical "^2.0.0" + is-decimal "^2.0.0" + is-array-buffer@^3.0.4, is-array-buffer@^3.0.5: version "3.0.5" resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.5.tgz#65742e1e687bd2cc666253068fd8707fe4d44280" @@ -4420,14 +4313,7 @@ is-callable@^1.1.3, is-callable@^1.2.7: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-ci@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.1.tgz#db6ecbed1bd659c43dac0f45661e7674103d1867" - integrity sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ== - dependencies: - ci-info "^3.2.0" - -is-core-module@^2.16.0, is-core-module@^2.5.0: +is-core-module@^2.16.0: version "2.16.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== @@ -4451,11 +4337,21 @@ is-date-object@^1.0.5, is-date-object@^1.1.0: call-bound "^1.0.2" has-tostringtag "^1.0.2" -is-docker@^2.0.0, is-docker@^2.1.1: +is-decimal@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-2.0.1.tgz#9469d2dc190d0214fd87d78b78caecc0cc14eef7" + integrity sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A== + +is-docker@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== +is-docker@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-3.0.0.tgz#90093aa3106277d8a77a5910dbae71747e15a200" + integrity sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ== + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -4490,6 +4386,18 @@ is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-hexadecimal@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz#86b5bf668fca307498d319dfc03289d781a90027" + integrity sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg== + +is-inside-container@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-inside-container/-/is-inside-container-1.0.0.tgz#e81fba699662eb31dbdaf26766a61d4814717ea4" + integrity sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA== + dependencies: + is-docker "^3.0.0" + is-installed-globally@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" @@ -4503,6 +4411,11 @@ is-map@^2.0.3: resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw== +is-network-error@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-network-error/-/is-network-error-1.1.0.tgz#d26a760e3770226d11c169052f266a4803d9c997" + integrity sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g== + is-number-object@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.1.1.tgz#144b21e95a1bc148205dcc2814a9134ec41b2541" @@ -4521,35 +4434,11 @@ is-obj@^2.0.0: resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== -is-path-cwd@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" - integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== - -is-path-in-cwd@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz#bfe2dca26c69f397265a4009963602935a053acb" - integrity sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ== - dependencies: - is-path-inside "^2.1.0" - -is-path-inside@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-2.1.0.tgz#7c9810587d659a40d27bcdb4d5616eab059494b2" - integrity sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg== - dependencies: - path-is-inside "^1.0.2" - is-path-inside@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== -is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== - is-plain-obj@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" @@ -4611,12 +4500,12 @@ is-symbol@^1.0.4, is-symbol@^1.1.1: has-symbols "^1.1.0" safe-regex-test "^1.1.0" -is-text-path@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" - integrity sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w== +is-text-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-2.0.0.tgz#b2484e2b720a633feb2e85b67dc193ff72c75636" + integrity sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw== dependencies: - text-extensions "^1.0.0" + text-extensions "^2.0.0" is-typed-array@^1.1.13, is-typed-array@^1.1.14, is-typed-array@^1.1.15: version "1.1.15" @@ -4662,6 +4551,13 @@ is-wsl@^2.2.0: dependencies: is-docker "^2.0.0" +is-wsl@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-3.1.0.tgz#e1c657e39c10090afcbedec61720f6b924c3cbd2" + integrity sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw== + dependencies: + is-inside-container "^1.0.0" + isarray@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" @@ -4696,6 +4592,13 @@ jackspeak@^3.1.2: optionalDependencies: "@pkgjs/parseargs" "^0.11.0" +jackspeak@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-4.0.2.tgz#11f9468a3730c6ff6f56823a820d7e3be9bef015" + integrity sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw== + dependencies: + "@isaacs/cliui" "^8.0.2" + jest-util@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" @@ -4717,7 +4620,7 @@ jest-worker@^27.4.5: merge-stream "^2.0.0" supports-color "^8.0.0" -jest-worker@^29.4.3: +jest-worker@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== @@ -4732,6 +4635,11 @@ jiti@^1.20.0, jiti@^1.21.6: resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.7.tgz#9dd81043424a3d28458b193d965f0d18a2300ba9" integrity sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A== +jiti@^2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-2.4.2.tgz#d19b7732ebb6116b06e2038da74a55366faef560" + integrity sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A== + "jquery@1.8 - 4": version "3.7.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" @@ -4742,6 +4650,13 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +js-yaml@4.1.0, js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" @@ -4750,13 +4665,6 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -4772,11 +4680,6 @@ jsesc@~3.0.2: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" @@ -4807,6 +4710,11 @@ json5@^2.1.2, json5@^2.2.3: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +jsonc-parser@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.3.1.tgz#f2a524b4f7fd11e3d791e559977ad60b98b798b4" + integrity sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ== + jsonfile@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" @@ -4831,29 +4739,31 @@ jsprim@^2.0.2: json-schema "0.4.0" verror "1.10.0" -keyv@^4.5.3: - version "4.5.4" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" - integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== +katex@^0.16.0: + version "0.16.20" + resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.20.tgz#75c741ded0f7ee8d896a1d31bac307e61af863c3" + integrity sha512-jjuLaMGD/7P8jUTpdKhA9IoqnH+yMFB3sdAFtq5QdAqeP2PjiSbnC3EaguKPNtv6dXXanHxp1ckwvF4a86LBig== + dependencies: + commander "^8.3.0" + +keyv@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-5.2.3.tgz#32db1a4aa8d05e2b8ab82688a57ddc5d2184a25c" + integrity sha512-AGKecUfzrowabUv0bH1RIR5Vf7w+l4S3xtQAypKaUpTdIR1EbrAcTxHCrpo9Q+IWeUlFE2palRtgIQcgm+PQJw== dependencies: - json-buffer "3.0.1" + "@keyv/serialize" "^1.0.2" -kind-of@^6.0.2, kind-of@^6.0.3: +kind-of@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== -known-css-properties@^0.26.0: - version "0.26.0" - resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.26.0.tgz#008295115abddc045a9f4ed7e2a84dc8b3a77649" - integrity sha512-5FZRzrZzNTBruuurWpvZnvP9pum+fe0HcK8z/ooo+U+Hmp4vtbyp1/QDsqmufirXy4egGzbaH/y2uCZf+6W5Kg== - -known-css-properties@^0.29.0: - version "0.29.0" - resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.29.0.tgz#e8ba024fb03886f23cb882e806929f32d814158f" - integrity sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ== +known-css-properties@^0.35.0: + version "0.35.0" + resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.35.0.tgz#f6f8e40ab4e5700fa32f5b2ef5218a56bc853bd6" + integrity sha512-a/RAk2BfKk+WFGhhOCAYqSiFLc34k8Mt/6NWRI4joER0EYUzXIcFivjjnoD3+XU1DggLn/tZc3DOAgke7l8a4A== -launch-editor@^2.6.0: +launch-editor@^2.6.1: version "2.9.1" resolved "https://registry.yarnpkg.com/launch-editor/-/launch-editor-2.9.1.tgz#253f173bd441e342d4344b4dae58291abb425047" integrity sha512-Gcnl4Bd+hRO9P9icCP/RVVT2o8SFlPXofuCxvA2SaZuH45whSvf5p8x5oih5ftLiVhEI4sp5xDY+R+b3zJBh5w== @@ -4866,7 +4776,7 @@ lazy-ass@^1.6.0: resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw== -lilconfig@^3.0.0, lilconfig@^3.1.1, lilconfig@^3.1.3: +lilconfig@^3.0.0, lilconfig@^3.1.2, lilconfig@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.1.3.tgz#a1bcfd6257f9585bf5ae14ceeebb7b559025e4c4" integrity sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw== @@ -4876,12 +4786,12 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -linkify-it@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-4.0.1.tgz#01f1d5e508190d06669982ba31a7d9f56a5751ec" - integrity sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw== +linkify-it@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421" + integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ== dependencies: - uc.micro "^1.0.1" + uc.micro "^2.0.0" list.js@^2.3.1: version "2.3.1" @@ -4925,14 +4835,7 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -locate-path@^7.1.0: +locate-path@^7.1.0, locate-path@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" integrity sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA== @@ -4949,11 +4852,6 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== -lodash.isfunction@^3.0.9: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz#06de25df4db327ac931981d1bdb067e5af68d051" - integrity sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw== - lodash.isplainobject@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" @@ -5009,7 +4907,7 @@ lodash.upperfirst@^4.3.1: resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" integrity sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg== -lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21: +lodash@^4.17.20, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5037,6 +4935,11 @@ lru-cache@^10.2.0: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== +lru-cache@^11.0.0: + version "11.0.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.0.2.tgz#fbd8e7cf8211f5e7e5d91905c415a3f55755ca39" + integrity sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -5044,68 +4947,49 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -map-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - integrity sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg== - -map-obj@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" - integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== - -markdown-it@13.0.1: - version "13.0.1" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-13.0.1.tgz#c6ecc431cacf1a5da531423fc6a42807814af430" - integrity sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q== +markdown-it@14.1.0: + version "14.1.0" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45" + integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg== dependencies: argparse "^2.0.1" - entities "~3.0.1" - linkify-it "^4.0.1" - mdurl "^1.0.1" - uc.micro "^1.0.5" - -markdownlint-cli2-formatter-default@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/markdownlint-cli2-formatter-default/-/markdownlint-cli2-formatter-default-0.0.4.tgz#81e26b0a50409c0357c6f0d38d8246946b236fab" - integrity sha512-xm2rM0E+sWgjpPn1EesPXx5hIyrN2ddUnUwnbCsD/ONxYtw3PX6LydvdH6dciWAoFDpwzbHM1TO7uHfcMd6IYg== - -markdownlint-cli2@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/markdownlint-cli2/-/markdownlint-cli2-0.7.1.tgz#42cd126f640c1bd0b820759c29b47c06fb2246cf" - integrity sha512-N58lw50Ws0WOfCc07B9dPKMnPMbIj6ZCMlszZLVfxBwKN/M+WZqXLdOHyRL2BWCZ3APBxQN9qDEw7Vf1PRqFkg== - dependencies: - globby "13.1.4" - markdownlint "0.28.2" - markdownlint-cli2-formatter-default "0.0.4" - micromatch "4.0.5" - strip-json-comments "5.0.0" - yaml "2.2.2" - -markdownlint-micromark@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/markdownlint-micromark/-/markdownlint-micromark-0.1.2.tgz#5520e04febffa46741875a2f297509ffdb561f5c" - integrity sha512-jRxlQg8KpOfM2IbCL9RXM8ZiYWz2rv6DlZAnGv8ASJQpUh6byTBnEsbuMZ6T2/uIgntyf7SKg/mEaEBo1164fQ== - -markdownlint@0.28.2: - version "0.28.2" - resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.28.2.tgz#ea31586a02fe3a06403ecafbbe22d77e363c8ed5" - integrity sha512-yYaQXoKKPV1zgrFsyAuZPEQoe+JrY9GDag9ObKpk09twx4OCU5lut+0/kZPrQ3W7w82SmgKhd7D8m34aG1unVw== - dependencies: - markdown-it "13.0.1" - markdownlint-micromark "0.1.2" + entities "^4.4.0" + linkify-it "^5.0.0" + mdurl "^2.0.0" + punycode.js "^2.3.1" + uc.micro "^2.1.0" + +markdownlint-cli2-formatter-default@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/markdownlint-cli2-formatter-default/-/markdownlint-cli2-formatter-default-0.0.5.tgz#b8fde4e127f9a9c0596e6d45eed352dd0aa0ff98" + integrity sha512-4XKTwQ5m1+Txo2kuQ3Jgpo/KmnG+X90dWt4acufg6HVGadTUG5hzHF/wssp9b5MBYOMCnZ9RMPaU//uHsszF8Q== + +markdownlint-cli2@^0.17.2: + version "0.17.2" + resolved "https://registry.yarnpkg.com/markdownlint-cli2/-/markdownlint-cli2-0.17.2.tgz#8d3dc2637fae42cea01fe3bf218501cbf33a7cd5" + integrity sha512-XH06ZOi8wCrtOSSj3p8y3yJzwgzYOSa7lglNyS3fP05JPRzRGyjauBb5UvlLUSCGysMmULS1moxdRHHudV+g/Q== + dependencies: + globby "14.0.2" + js-yaml "4.1.0" + jsonc-parser "3.3.1" + markdownlint "0.37.4" + markdownlint-cli2-formatter-default "0.0.5" + micromatch "4.0.8" + +markdownlint@0.37.4: + version "0.37.4" + resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.37.4.tgz#dd58c4a13b798d4702438e5f7fd587a219f753f6" + integrity sha512-u00joA/syf3VhWh6/ybVFkib5Zpj2e5KB/cfCei8fkSRuums6nyisTWGqjTWIOFoFwuXoTBQQiqlB4qFKp8ncQ== + dependencies: + markdown-it "14.1.0" + micromark "4.0.1" + micromark-core-commonmark "2.0.2" + micromark-extension-directive "3.0.2" + micromark-extension-gfm-autolink-literal "2.1.0" + micromark-extension-gfm-footnote "2.1.0" + micromark-extension-gfm-table "2.1.0" + micromark-extension-math "3.1.0" + micromark-util-types "2.0.1" math-intrinsics@^1.1.0: version "1.1.0" @@ -5137,57 +5021,45 @@ mdn-data@2.0.4: resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== -mdurl@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" - integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== +mdn-data@2.12.2: + version "2.12.2" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.12.2.tgz#9ae6c41a9e65adf61318b32bff7b64fbfb13f8cf" + integrity sha512-IEn+pegP1aManZuckezWCO+XZQDplx1366JoVhTpMpBB1sPey/SbveZQUosKiKiGYjg1wH4pMlNgXbCiYgihQA== + +mdn-data@^2.14.0: + version "2.15.0" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.15.0.tgz#8d8bc0d9a463edf4296c418a8b49d3a8b2c686fb" + integrity sha512-KIrS0lFPOqA4DgeO16vI5fkAsy8p++WBlbXtB5P1EQs8ubBgguAInNd1DnrCeTRfGchY0kgThgDOOIPyOLH2dQ== + +mdurl@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0" + integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w== media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== -memfs@^3.4.3: - version "3.6.0" - resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.6.0.tgz#d7a2110f86f79dd950a8b6df6d57bc984aa185f6" - integrity sha512-EGowvkkgbMcIChjMTMkESFDbZeSh8xZ7kNSF0hAiAN4Jh6jgHCRS0Ga/+C8y6Au+oqpezRHCfPsmJ2+DwAgiwQ== - dependencies: - fs-monkey "^1.0.4" - -meow@^8.0.0, meow@^8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" - integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^3.0.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.18.0" - yargs-parser "^20.2.3" - -meow@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-9.0.0.tgz#cd9510bc5cac9dee7d03c73ee1f9ad959f4ea364" - integrity sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize "^1.2.0" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^3.0.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.18.0" - yargs-parser "^20.2.3" +memfs@^4.6.0: + version "4.17.0" + resolved "https://registry.yarnpkg.com/memfs/-/memfs-4.17.0.tgz#a3c4b5490b9b1e7df5d433adc163e08208ce7ca2" + integrity sha512-4eirfZ7thblFmqFjywlTmuWVSvccHAJbn1r8qQLzmTO11qcqpohOjmY2mFce6x7x7WtskzRqApPD0hv+Oa74jg== + dependencies: + "@jsonjoy.com/json-pack" "^1.0.3" + "@jsonjoy.com/util" "^1.3.0" + tree-dump "^1.0.1" + tslib "^2.0.0" + +meow@^12.0.1: + version "12.1.1" + resolved "https://registry.yarnpkg.com/meow/-/meow-12.1.1.tgz#e558dddbab12477b69b2e9a2728c327f191bace6" + integrity sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw== + +meow@^13.2.0: + version "13.2.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-13.2.0.tgz#6b7d63f913f984063b3cc261b6e8800c4cd3474f" + integrity sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA== merge-descriptors@1.0.3: version "1.0.3" @@ -5209,15 +5081,252 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== -micromatch@4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== +micromark-core-commonmark@2.0.2, micromark-core-commonmark@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-2.0.2.tgz#6a45bbb139e126b3f8b361a10711ccc7c6e15e93" + integrity sha512-FKjQKbxd1cibWMM1P9N+H8TwlgGgSkWZMmfuVucLCHaYqeSvJ0hFeHsIa65pA2nYbes0f8LDHPMrd9X7Ujxg9w== + dependencies: + decode-named-character-reference "^1.0.0" + devlop "^1.0.0" + micromark-factory-destination "^2.0.0" + micromark-factory-label "^2.0.0" + micromark-factory-space "^2.0.0" + micromark-factory-title "^2.0.0" + micromark-factory-whitespace "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-classify-character "^2.0.0" + micromark-util-html-tag-name "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-resolve-all "^2.0.0" + micromark-util-subtokenize "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-directive@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/micromark-extension-directive/-/micromark-extension-directive-3.0.2.tgz#2eb61985d1995a7c1ff7621676a4f32af29409e8" + integrity sha512-wjcXHgk+PPdmvR58Le9d7zQYWy+vKEU9Se44p2CrCDPiLr2FMyiT4Fyb5UFKFC66wGB3kPlgD7q3TnoqPS7SZA== + dependencies: + devlop "^1.0.0" + micromark-factory-space "^2.0.0" + micromark-factory-whitespace "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + parse-entities "^4.0.0" + +micromark-extension-gfm-autolink-literal@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz#6286aee9686c4462c1e3552a9d505feddceeb935" + integrity sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw== dependencies: - braces "^3.0.2" - picomatch "^2.3.1" + micromark-util-character "^2.0.0" + micromark-util-sanitize-uri "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-footnote@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz#4dab56d4e398b9853f6fe4efac4fc9361f3e0750" + integrity sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw== + dependencies: + devlop "^1.0.0" + micromark-core-commonmark "^2.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-sanitize-uri "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-table@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.0.tgz#5cadedfbb29fca7abf752447967003dc3b6583c9" + integrity sha512-Ub2ncQv+fwD70/l4ou27b4YzfNaCJOvyX4HxXU15m7mpYY+rjuWzsLIPZHJL253Z643RpbcP1oeIJlQ/SKW67g== + dependencies: + devlop "^1.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-math@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/micromark-extension-math/-/micromark-extension-math-3.1.0.tgz#c42ee3b1dd5a9a03584e83dd8f08e3de510212c1" + integrity sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg== + dependencies: + "@types/katex" "^0.16.0" + devlop "^1.0.0" + katex "^0.16.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-destination@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz#8fef8e0f7081f0474fbdd92deb50c990a0264639" + integrity sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-label@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz#5267efa97f1e5254efc7f20b459a38cb21058ba1" + integrity sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg== + dependencies: + devlop "^1.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-space@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz#36d0212e962b2b3121f8525fc7a3c7c029f334fc" + integrity sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-title@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz#237e4aa5d58a95863f01032d9ee9b090f1de6e94" + integrity sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw== + dependencies: + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-whitespace@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz#06b26b2983c4d27bfcc657b33e25134d4868b0b1" + integrity sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ== + dependencies: + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-character@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-2.1.1.tgz#2f987831a40d4c510ac261e89852c4e9703ccda6" + integrity sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q== + dependencies: + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-chunked@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz#47fbcd93471a3fccab86cff03847fc3552db1051" + integrity sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-classify-character@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz#d399faf9c45ca14c8b4be98b1ea481bced87b629" + integrity sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-combine-extensions@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz#2a0f490ab08bff5cc2fd5eec6dd0ca04f89b30a9" + integrity sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg== + dependencies: + micromark-util-chunked "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-decode-numeric-character-reference@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz#fcf15b660979388e6f118cdb6bf7d79d73d26fe5" + integrity sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-encode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz#0d51d1c095551cfaac368326963cf55f15f540b8" + integrity sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw== + +micromark-util-html-tag-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz#e40403096481986b41c106627f98f72d4d10b825" + integrity sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA== + +micromark-util-normalize-identifier@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz#c30d77b2e832acf6526f8bf1aa47bc9c9438c16d" + integrity sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-resolve-all@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz#e1a2d62cdd237230a2ae11839027b19381e31e8b" + integrity sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg== + dependencies: + micromark-util-types "^2.0.0" + +micromark-util-sanitize-uri@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz#ab89789b818a58752b73d6b55238621b7faa8fd7" + integrity sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-encode "^2.0.0" + micromark-util-symbol "^2.0.0" + +micromark-util-subtokenize@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.3.tgz#70ffb99a454bd8c913c8b709c3dc97baefb65f96" + integrity sha512-VXJJuNxYWSoYL6AJ6OQECCFGhIU2GGHMw8tahogePBrjkG8aCCas3ibkp7RnVOSTClg2is05/R7maAhF1XyQMg== + dependencies: + devlop "^1.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-symbol@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz#e5da494e8eb2b071a0d08fb34f6cefec6c0a19b8" + integrity sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q== -micromatch@^4.0.2, micromatch@^4.0.5, micromatch@^4.0.8: +micromark-util-types@2.0.1, micromark-util-types@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-2.0.1.tgz#a3edfda3022c6c6b55bfb049ef5b75d70af50709" + integrity sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ== + +micromark@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/micromark/-/micromark-4.0.1.tgz#294c2f12364759e5f9e925a767ae3dfde72223ff" + integrity sha512-eBPdkcoCNvYcxQOAKAlceo5SNdzZWfF+FcSupREAzdAh9rRmE239CEQAiTwIgblwnoM8zzj35sZ5ZwvSEOF6Kw== + dependencies: + "@types/debug" "^4.0.0" + debug "^4.0.0" + decode-named-character-reference "^1.0.0" + devlop "^1.0.0" + micromark-core-commonmark "^2.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-combine-extensions "^2.0.0" + micromark-util-decode-numeric-character-reference "^2.0.0" + micromark-util-encode "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-resolve-all "^2.0.0" + micromark-util-sanitize-uri "^2.0.0" + micromark-util-subtokenize "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromatch@4.0.8, micromatch@^4.0.2, micromatch@^4.0.5, micromatch@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== @@ -5252,11 +5361,6 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -min-indent@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - mini-css-extract-plugin@^2.6.0: version "2.9.2" resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.9.2.tgz#966031b468917a5446f4c24a80854b2947503c5b" @@ -5270,12 +5374,12 @@ minimalistic-assert@^1.0.0: resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== -minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== +minimatch@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.0.1.tgz#ce0521856b453c86e25f2c4c0d03e6ff7ddc440b" + integrity sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ== dependencies: - brace-expansion "^1.1.7" + brace-expansion "^2.0.1" minimatch@^9.0.4: version "9.0.5" @@ -5284,15 +5388,6 @@ minimatch@^9.0.4: dependencies: brace-expansion "^2.0.1" -minimist-options@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" - integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== - dependencies: - arrify "^1.0.1" - is-plain-obj "^1.1.0" - kind-of "^6.0.3" - minimist@^1.2.6, minimist@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" @@ -5384,26 +5479,6 @@ node-releases@^2.0.19: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== -normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-package-data@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" - integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== - dependencies: - hosted-git-info "^4.0.1" - is-core-module "^2.5.0" - semver "^7.3.4" - validate-npm-package-license "^3.0.1" - normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -5414,7 +5489,7 @@ normalize-range@^0.1.2: resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== -npm-run-path@^4.0.0, npm-run-path@^4.0.1: +npm-run-path@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== @@ -5495,7 +5570,7 @@ obuf@^1.0.0, obuf@^1.1.2: resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== -on-finished@2.4.1: +on-finished@2.4.1, on-finished@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== @@ -5507,28 +5582,29 @@ on-headers@~1.0.2: resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" -onetime@^5.1.0, onetime@^5.1.2: +onetime@^5.1.0: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== dependencies: mimic-fn "^2.1.0" -open@^8.0.9: - version "8.4.2" - resolved "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9" - integrity sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ== +open@^10.0.3: + version "10.1.0" + resolved "https://registry.yarnpkg.com/open/-/open-10.1.0.tgz#a7795e6e5d519abe4286d9937bb24b51122598e1" + integrity sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw== dependencies: - define-lazy-prop "^2.0.0" - is-docker "^2.1.1" - is-wsl "^2.2.0" + default-browser "^5.2.1" + define-lazy-prop "^3.0.0" + is-inside-container "^1.0.0" + is-wsl "^3.1.0" ospath@^1.2.2: version "1.2.2" @@ -5551,13 +5627,6 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - p-limit@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" @@ -5572,13 +5641,6 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - p-locate@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" @@ -5586,11 +5648,6 @@ p-locate@^6.0.0: dependencies: p-limit "^4.0.0" -p-map@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" - integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== - p-map@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" @@ -5598,12 +5655,13 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" -p-retry@^4.5.0: - version "4.6.2" - resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-4.6.2.tgz#9baae7184057edd4e17231cee04264106e092a16" - integrity sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ== +p-retry@^6.2.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-6.2.1.tgz#81828f8dc61c6ef5a800585491572cc9892703af" + integrity sha512-hEt02O4hUct5wtwg4H4KcWgDdm+l1bOaEy/hWzd8xtXB9BqxTWBBhb+2ImAtH4Cv4rPjV76xN3Zumqk3k3AhhQ== dependencies: - "@types/retry" "0.12.0" + "@types/retry" "0.12.2" + is-network-error "^1.0.0" retry "^0.13.1" p-try@^2.0.0: @@ -5623,7 +5681,20 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-json@^5.0.0, parse-json@^5.2.0: +parse-entities@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-4.0.2.tgz#61d46f5ed28e4ee62e9ddc43d6b010188443f159" + integrity sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw== + dependencies: + "@types/unist" "^2.0.0" + character-entities-legacy "^3.0.0" + character-reference-invalid "^2.0.0" + decode-named-character-reference "^1.0.0" + is-alphanumerical "^2.0.0" + is-decimal "^2.0.0" + is-hexadecimal "^2.0.0" + +parse-json@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== @@ -5648,16 +5719,6 @@ path-exists@^5.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w== - path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" @@ -5676,6 +5737,14 @@ path-scurry@^1.11.1: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" +path-scurry@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-2.0.0.tgz#9f052289f23ad8bf9397a2a0425e7b8615c58580" + integrity sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg== + dependencies: + lru-cache "^11.0.0" + minipass "^7.1.2" + path-to-regexp@0.1.12: version "0.1.12" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" @@ -5686,6 +5755,11 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +path-type@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-5.0.0.tgz#14b01ed7aea7ddf9c7c3f46181d4d04f9c785bb8" + integrity sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg== + pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" @@ -5701,7 +5775,7 @@ picocolors@^0.2.1: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== -picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.1: +picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.0, picocolors@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== @@ -5711,28 +5785,11 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -pify@^2.0.0, pify@^2.2.0, pify@^2.3.0: +pify@^2.2.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== -pify@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" - integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw== - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg== - pirates@^4.0.1: version "4.0.6" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" @@ -5757,51 +5814,53 @@ possible-typed-array-names@^1.0.0: resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== -postcss-calc@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-9.0.1.tgz#a744fd592438a93d6de0f1434c572670361eb6c6" - integrity sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ== +postcss-calc@^10.0.2: + version "10.1.0" + resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-10.1.0.tgz#82548b9d52891b87cf6181a445bea4b78e2eedfb" + integrity sha512-uQ/LDGsf3mgsSUEXmAt3VsCSHR3aKqtEIkmB+4PhzYwRYOW5MZs/GhCCFpsOtJJkP6EC6uGipbrnaTjqaJZcJw== dependencies: - postcss-selector-parser "^6.0.11" + postcss-selector-parser "^7.0.0" postcss-value-parser "^4.2.0" -postcss-colormin@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-6.1.0.tgz#076e8d3fb291fbff7b10e6b063be9da42ff6488d" - integrity sha512-x9yX7DOxeMAR+BgGVnNSAxmAj98NX/YxEMNFP+SDCEeNLb2r3i6Hh1ksMsnW8Ub5SLCpbescQqn9YEbE9554Sw== +postcss-colormin@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-7.0.2.tgz#6f3c53c13158168669f45adc3926f35cb240ef8e" + integrity sha512-YntRXNngcvEvDbEjTdRWGU606eZvB5prmHG4BF0yLmVpamXbpsRJzevyy6MZVyuecgzI2AWAlvFi8DAeCqwpvA== dependencies: - browserslist "^4.23.0" + browserslist "^4.23.3" caniuse-api "^3.0.0" colord "^2.9.3" postcss-value-parser "^4.2.0" -postcss-convert-values@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-6.1.0.tgz#3498387f8efedb817cbc63901d45bd1ceaa40f48" - integrity sha512-zx8IwP/ts9WvUM6NkVSkiU902QZL1bwPhaVaLynPtCsOTqp+ZKbNi+s6XJg3rfqpKGA/oc7Oxk5t8pOQJcwl/w== +postcss-convert-values@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-7.0.4.tgz#fc13ecedded6365f3c794b502dbcf77d298da12c" + integrity sha512-e2LSXPqEHVW6aoGbjV9RsSSNDO3A0rZLCBxN24zvxF25WknMPpX8Dm9UxxThyEbaytzggRuZxaGXqaOhxQ514Q== dependencies: - browserslist "^4.23.0" + browserslist "^4.23.3" postcss-value-parser "^4.2.0" -postcss-discard-comments@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-6.0.2.tgz#e768dcfdc33e0216380623652b0a4f69f4678b6c" - integrity sha512-65w/uIqhSBBfQmYnG92FO1mWZjJ4GL5b8atm5Yw2UgrwD7HiNiSSNwJor1eCFGzUgYnN/iIknhNRVqjrrpuglw== +postcss-discard-comments@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-7.0.3.tgz#9c414e8ee99d3514ad06a3465ccc20ec1dbce780" + integrity sha512-q6fjd4WU4afNhWOA2WltHgCbkRhZPgQe7cXF74fuVB/ge4QbM9HEaOIzGSiMvM+g/cOsNAUGdf2JDzqA2F8iLA== + dependencies: + postcss-selector-parser "^6.1.2" -postcss-discard-duplicates@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-6.0.3.tgz#d121e893c38dc58a67277f75bb58ba43fce4c3eb" - integrity sha512-+JA0DCvc5XvFAxwx6f/e68gQu/7Z9ud584VLmcgto28eB8FqSFZwtrLwB5Kcp70eIoWP/HXqz4wpo8rD8gpsTw== +postcss-discard-duplicates@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-7.0.1.tgz#f87f2fe47d8f01afb1e98361c1db3ce1e8afd1a3" + integrity sha512-oZA+v8Jkpu1ct/xbbrntHRsfLGuzoP+cpt0nJe5ED2FQF8n8bJtn7Bo28jSmBYwqgqnqkuSXJfSUEE7if4nClQ== -postcss-discard-empty@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-6.0.3.tgz#ee39c327219bb70473a066f772621f81435a79d9" - integrity sha512-znyno9cHKQsK6PtxL5D19Fj9uwSzC2mB74cpT66fhgOadEUPyXFkbgwm5tvc3bt3NAy8ltE5MrghxovZRVnOjQ== +postcss-discard-empty@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-7.0.0.tgz#218829d1ef0a5d5142dd62f0aa60e00e599d2033" + integrity sha512-e+QzoReTZ8IAwhnSdp/++7gBZ/F+nBq9y6PomfwORfP7q9nBpK5AMP64kOt0bA+lShBFbBDcgpJ3X4etHg4lzA== -postcss-discard-overridden@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-6.0.2.tgz#4e9f9c62ecd2df46e8fdb44dc17e189776572e2d" - integrity sha512-j87xzI4LUggC5zND7KdjsI25APtyMuynXZSujByMaav2roV6OZX+8AaCUcZSWqckZpjAjRyFDdpqybgjFO0HJQ== +postcss-discard-overridden@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-7.0.0.tgz#b123ea51e3d4e1d0a254cf71eaff1201926d319c" + integrity sha512-GmNAzx88u3k2+sBTZrJSDauR0ccpE24omTQCVmaTTZFz1du6AasspjaUPMJ2ud4RslZpoFKyf+6MSPETLojc6w== postcss-import@^15.1.0: version "15.1.0" @@ -5827,12 +5886,12 @@ postcss-load-config@^4.0.2: lilconfig "^3.0.0" yaml "^2.3.4" -postcss-loader@^7.3.0: - version "7.3.4" - resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-7.3.4.tgz#aed9b79ce4ed7e9e89e56199d25ad1ec8f606209" - integrity sha512-iW5WTTBSC5BfsBJ9daFMPVrLT36MrNiC6fqOZTTaHjBNX6Pfd5p+hSBqe/fEeNd7pc13QiAyGt7VdGMw4eRC4A== +postcss-loader@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-8.1.1.tgz#2822589e7522927344954acb55bbf26e8b195dfe" + integrity sha512-0IeqyAsG6tYiDRCYKQJLAmgQr47DX6N7sFSWvQxt6AcupX8DIdmykuk/o/tx0Lze3ErGHJEp5OSRxrelC6+NdQ== dependencies: - cosmiconfig "^8.3.5" + cosmiconfig "^9.0.0" jiti "^1.20.0" semver "^7.5.4" @@ -5841,55 +5900,56 @@ postcss-media-query-parser@^0.2.3: resolved "https://registry.yarnpkg.com/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz#27b39c6f4d94f81b1a73b8f76351c609e5cef244" integrity sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig== -postcss-merge-longhand@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-6.0.5.tgz#ba8a8d473617c34a36abbea8dda2b215750a065a" - integrity sha512-5LOiordeTfi64QhICp07nzzuTDjNSO8g5Ksdibt44d+uvIIAE1oZdRn8y/W5ZtYgRH/lnLDlvi9F8btZcVzu3w== +postcss-merge-longhand@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-7.0.4.tgz#a52d0662b4b29420f3b64a8d5b0ac5133d8db776" + integrity sha512-zer1KoZA54Q8RVHKOY5vMke0cCdNxMP3KBfDerjH/BYHh4nCIh+1Yy0t1pAEQF18ac/4z3OFclO+ZVH8azjR4A== dependencies: postcss-value-parser "^4.2.0" - stylehacks "^6.1.1" + stylehacks "^7.0.4" -postcss-merge-rules@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-6.1.1.tgz#7aa539dceddab56019469c0edd7d22b64c3dea9d" - integrity sha512-KOdWF0gju31AQPZiD+2Ar9Qjowz1LTChSjFFbS+e2sFgc4uHOp3ZvVX4sNeTlk0w2O31ecFGgrFzhO0RSWbWwQ== +postcss-merge-rules@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-7.0.4.tgz#648cc864d3121e6ec72c2a4f08df1cc801e60ce8" + integrity sha512-ZsaamiMVu7uBYsIdGtKJ64PkcQt6Pcpep/uO90EpLS3dxJi6OXamIobTYcImyXGoW0Wpugh7DSD3XzxZS9JCPg== dependencies: - browserslist "^4.23.0" + browserslist "^4.23.3" caniuse-api "^3.0.0" - cssnano-utils "^4.0.2" - postcss-selector-parser "^6.0.16" + cssnano-utils "^5.0.0" + postcss-selector-parser "^6.1.2" -postcss-minify-font-values@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-6.1.0.tgz#a0e574c02ee3f299be2846369211f3b957ea4c59" - integrity sha512-gklfI/n+9rTh8nYaSJXlCo3nOKqMNkxuGpTn/Qm0gstL3ywTr9/WRKznE+oy6fvfolH6dF+QM4nCo8yPLdvGJg== +postcss-minify-font-values@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-7.0.0.tgz#d16a75a2548e000779566b3568fc874ee5d0aa17" + integrity sha512-2ckkZtgT0zG8SMc5aoNwtm5234eUx1GGFJKf2b1bSp8UflqaeFzR50lid4PfqVI9NtGqJ2J4Y7fwvnP/u1cQog== dependencies: postcss-value-parser "^4.2.0" -postcss-minify-gradients@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-6.0.3.tgz#ca3eb55a7bdb48a1e187a55c6377be918743dbd6" - integrity sha512-4KXAHrYlzF0Rr7uc4VrfwDJ2ajrtNEpNEuLxFgwkhFZ56/7gaE4Nr49nLsQDZyUe+ds+kEhf+YAUolJiYXF8+Q== +postcss-minify-gradients@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-7.0.0.tgz#f6d84456e6d49164a55d0e45bb1b1809c6cf0959" + integrity sha512-pdUIIdj/C93ryCHew0UgBnL2DtUS3hfFa5XtERrs4x+hmpMYGhbzo6l/Ir5de41O0GaKVpK1ZbDNXSY6GkXvtg== dependencies: colord "^2.9.3" - cssnano-utils "^4.0.2" + cssnano-utils "^5.0.0" postcss-value-parser "^4.2.0" -postcss-minify-params@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-6.1.0.tgz#54551dec77b9a45a29c3cb5953bf7325a399ba08" - integrity sha512-bmSKnDtyyE8ujHQK0RQJDIKhQ20Jq1LYiez54WiaOoBtcSuflfK3Nm596LvbtlFcpipMjgClQGyGr7GAs+H1uA== +postcss-minify-params@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-7.0.2.tgz#264a76e25f202d8b5ca5290569c0e8c3ac599dfe" + integrity sha512-nyqVLu4MFl9df32zTsdcLqCFfE/z2+f8GE1KHPxWOAmegSo6lpV2GNy5XQvrzwbLmiU7d+fYay4cwto1oNdAaQ== dependencies: - browserslist "^4.23.0" - cssnano-utils "^4.0.2" + browserslist "^4.23.3" + cssnano-utils "^5.0.0" postcss-value-parser "^4.2.0" -postcss-minify-selectors@^6.0.4: - version "6.0.4" - resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-6.0.4.tgz#197f7d72e6dd19eed47916d575d69dc38b396aff" - integrity sha512-L8dZSwNLgK7pjTto9PzWRoMbnLq5vsZSTu8+j1P/2GB8qdtGQfn+K1uSvFgYvgh83cbyxT5m43ZZhUMTJDSClQ== +postcss-minify-selectors@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-7.0.4.tgz#2b69c99ec48a1c223fce4840609d9c53340a11f5" + integrity sha512-JG55VADcNb4xFCf75hXkzc1rNeURhlo7ugf6JjiiKRfMsKlDzN9CXHZDyiG6x/zGchpjQS+UAgb1d4nqXqOpmA== dependencies: - postcss-selector-parser "^6.0.16" + cssesc "^3.0.0" + postcss-selector-parser "^6.1.2" postcss-modules-extract-imports@^3.1.0: version "3.1.0" @@ -5926,107 +5986,107 @@ postcss-nested@^6.2.0: dependencies: postcss-selector-parser "^6.1.1" -postcss-normalize-charset@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-6.0.2.tgz#1ec25c435057a8001dac942942a95ffe66f721e1" - integrity sha512-a8N9czmdnrjPHa3DeFlwqst5eaL5W8jYu3EBbTTkI5FHkfMhFZh1EGbku6jhHhIzTA6tquI2P42NtZ59M/H/kQ== +postcss-normalize-charset@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-7.0.0.tgz#92244ae73c31bf8f8885d5f16ff69e857ac6c001" + integrity sha512-ABisNUXMeZeDNzCQxPxBCkXexvBrUHV+p7/BXOY+ulxkcjUZO0cp8ekGBwvIh2LbCwnWbyMPNJVtBSdyhM2zYQ== -postcss-normalize-display-values@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-6.0.2.tgz#54f02764fed0b288d5363cbb140d6950dbbdd535" - integrity sha512-8H04Mxsb82ON/aAkPeq8kcBbAtI5Q2a64X/mnRRfPXBq7XeogoQvReqxEfc0B4WPq1KimjezNC8flUtC3Qz6jg== +postcss-normalize-display-values@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-7.0.0.tgz#01fb50e5e97ef8935363629bea5a6d3b3aac1342" + integrity sha512-lnFZzNPeDf5uGMPYgGOw7v0BfB45+irSRz9gHQStdkkhiM0gTfvWkWB5BMxpn0OqgOQuZG/mRlZyJxp0EImr2Q== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-positions@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-6.0.2.tgz#e982d284ec878b9b819796266f640852dbbb723a" - integrity sha512-/JFzI441OAB9O7VnLA+RtSNZvQ0NCFZDOtp6QPFo1iIyawyXg0YI3CYM9HBy1WvwCRHnPep/BvI1+dGPKoXx/Q== +postcss-normalize-positions@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-7.0.0.tgz#4eebd7c9d3dde40c97b8047cad38124fc844c463" + integrity sha512-I0yt8wX529UKIGs2y/9Ybs2CelSvItfmvg/DBIjTnoUSrPxSV7Z0yZ8ShSVtKNaV/wAY+m7bgtyVQLhB00A1NQ== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-repeat-style@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-6.0.2.tgz#f8006942fd0617c73f049dd8b6201c3a3040ecf3" - integrity sha512-YdCgsfHkJ2jEXwR4RR3Tm/iOxSfdRt7jplS6XRh9Js9PyCR/aka/FCb6TuHT2U8gQubbm/mPmF6L7FY9d79VwQ== +postcss-normalize-repeat-style@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-7.0.0.tgz#0cb784655d5714d29bd3bda6dee2fb628aa7227b" + integrity sha512-o3uSGYH+2q30ieM3ppu9GTjSXIzOrRdCUn8UOMGNw7Af61bmurHTWI87hRybrP6xDHvOe5WlAj3XzN6vEO8jLw== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-string@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-6.0.2.tgz#e3cc6ad5c95581acd1fc8774b309dd7c06e5e363" - integrity sha512-vQZIivlxlfqqMp4L9PZsFE4YUkWniziKjQWUtsxUiVsSSPelQydwS8Wwcuw0+83ZjPWNTl02oxlIvXsmmG+CiQ== +postcss-normalize-string@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-7.0.0.tgz#a119d3e63a9614570d8413d572fb9fc8c6a64e8c" + integrity sha512-w/qzL212DFVOpMy3UGyxrND+Kb0fvCiBBujiaONIihq7VvtC7bswjWgKQU/w4VcRyDD8gpfqUiBQ4DUOwEJ6Qg== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-timing-functions@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-6.0.2.tgz#40cb8726cef999de984527cbd9d1db1f3e9062c0" - integrity sha512-a+YrtMox4TBtId/AEwbA03VcJgtyW4dGBizPl7e88cTFULYsprgHWTbfyjSLyHeBcK/Q9JhXkt2ZXiwaVHoMzA== +postcss-normalize-timing-functions@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-7.0.0.tgz#99d0ee8c4b23b7f4355fafb91385833b9b07108b" + integrity sha512-tNgw3YV0LYoRwg43N3lTe3AEWZ66W7Dh7lVEpJbHoKOuHc1sLrzMLMFjP8SNULHaykzsonUEDbKedv8C+7ej6g== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-unicode@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-6.1.0.tgz#aaf8bbd34c306e230777e80f7f12a4b7d27ce06e" - integrity sha512-QVC5TQHsVj33otj8/JD869Ndr5Xcc/+fwRh4HAsFsAeygQQXm+0PySrKbr/8tkDKzW+EVT3QkqZMfFrGiossDg== +postcss-normalize-unicode@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-7.0.2.tgz#095f8d36ea29adfdf494069c1de101112992a713" + integrity sha512-ztisabK5C/+ZWBdYC+Y9JCkp3M9qBv/XFvDtSw0d/XwfT3UaKeW/YTm/MD/QrPNxuecia46vkfEhewjwcYFjkg== dependencies: - browserslist "^4.23.0" + browserslist "^4.23.3" postcss-value-parser "^4.2.0" -postcss-normalize-url@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-6.0.2.tgz#292792386be51a8de9a454cb7b5c58ae22db0f79" - integrity sha512-kVNcWhCeKAzZ8B4pv/DnrU1wNh458zBNp8dh4y5hhxih5RZQ12QWMuQrDgPRw3LRl8mN9vOVfHl7uhvHYMoXsQ== +postcss-normalize-url@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-7.0.0.tgz#c88cb7cf8952d3ff631e4eba924e7b060ca802f6" + integrity sha512-+d7+PpE+jyPX1hDQZYG+NaFD+Nd2ris6r8fPTBAjE8z/U41n/bib3vze8x7rKs5H1uEw5ppe9IojewouHk0klQ== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-whitespace@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-6.0.2.tgz#fbb009e6ebd312f8b2efb225c2fcc7cf32b400cd" - integrity sha512-sXZ2Nj1icbJOKmdjXVT9pnyHQKiSAyuNQHSgRCUgThn2388Y9cGVDR+E9J9iAYbSbLHI+UUwLVl1Wzco/zgv0Q== +postcss-normalize-whitespace@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-7.0.0.tgz#46b025f0bea72139ddee63015619b0c21cebd845" + integrity sha512-37/toN4wwZErqohedXYqWgvcHUGlT8O/m2jVkAfAe9Bd4MzRqlBmXrJRePH0e9Wgnz2X7KymTgTOaaFizQe3AQ== dependencies: postcss-value-parser "^4.2.0" -postcss-ordered-values@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-6.0.2.tgz#366bb663919707093451ab70c3f99c05672aaae5" - integrity sha512-VRZSOB+JU32RsEAQrO94QPkClGPKJEL/Z9PCBImXMhIeK5KAYo6slP/hBYlLgrCjFxyqvn5VC81tycFEDBLG1Q== +postcss-ordered-values@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-7.0.1.tgz#8b4b5b8070ca7756bd49f07d5edf274b8f6782e0" + integrity sha512-irWScWRL6nRzYmBOXReIKch75RRhNS86UPUAxXdmW/l0FcAsg0lvAXQCby/1lymxn/o0gVa6Rv/0f03eJOwHxw== dependencies: - cssnano-utils "^4.0.2" + cssnano-utils "^5.0.0" postcss-value-parser "^4.2.0" -postcss-reduce-initial@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-6.1.0.tgz#4401297d8e35cb6e92c8e9586963e267105586ba" - integrity sha512-RarLgBK/CrL1qZags04oKbVbrrVK2wcxhvta3GCxrZO4zveibqbRPmm2VI8sSgCXwoUHEliRSbOfpR0b/VIoiw== +postcss-reduce-initial@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-7.0.2.tgz#3dc085347a5943e18547d4b0aa5bd4ff5a93b2c5" + integrity sha512-pOnu9zqQww7dEKf62Nuju6JgsW2V0KRNBHxeKohU+JkHd/GAH5uvoObqFLqkeB2n20mr6yrlWDvo5UBU5GnkfA== dependencies: - browserslist "^4.23.0" + browserslist "^4.23.3" caniuse-api "^3.0.0" -postcss-reduce-transforms@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-6.0.2.tgz#6fa2c586bdc091a7373caeee4be75a0f3e12965d" - integrity sha512-sB+Ya++3Xj1WaT9+5LOOdirAxP7dJZms3GRcYheSPi1PiTMigsxHAdkrbItHxwYHr4kt1zL7mmcHstgMYT+aiA== +postcss-reduce-transforms@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-7.0.0.tgz#0386080a14e5faad9f8eda33375b79fe7c4f9677" + integrity sha512-pnt1HKKZ07/idH8cpATX/ujMbtOGhUfE+m8gbqwJE05aTaNw8gbo34a2e3if0xc0dlu75sUOiqvwCGY3fzOHew== dependencies: postcss-value-parser "^4.2.0" -postcss-resolve-nested-selector@^0.1.1: +postcss-resolve-nested-selector@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.6.tgz#3d84dec809f34de020372c41b039956966896686" integrity sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw== -postcss-safe-parser@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz#bb4c29894171a94bc5c996b9a30317ef402adaa1" - integrity sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ== +postcss-safe-parser@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-7.0.1.tgz#36e4f7e608111a0ca940fd9712ce034718c40ec0" + integrity sha512-0AioNCJZ2DPYz5ABT6bddIqlhgwhpHZ/l65YAYo0BCIn0xiDpsnTHz0gnoTGk0OXZW0JRs+cDwL8u/teRdz+8A== -postcss-scss@^4.0.2: +postcss-scss@^4.0.9: version "4.0.9" resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.9.tgz#a03c773cd4c9623cb04ce142a52afcec74806685" integrity sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A== -postcss-selector-parser@^6.0.11, postcss-selector-parser@^6.0.13, postcss-selector-parser@^6.0.16, postcss-selector-parser@^6.1.1, postcss-selector-parser@^6.1.2: +postcss-selector-parser@^6.1.1, postcss-selector-parser@^6.1.2: version "6.1.2" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz#27ecb41fb0e3b6ba7a1ec84fff347f734c7929de" integrity sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg== @@ -6042,10 +6102,10 @@ postcss-selector-parser@^7.0.0: cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss-sorting@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-sorting/-/postcss-sorting-7.0.1.tgz#923b5268451cf2d93ebf8835e17a6537757049a5" - integrity sha512-iLBFYz6VRYyLJEJsBJ8M3TCqNcckVzz4wFounSc5Oez35ogE/X+aoC5fFu103Ot7NyvjU3/xqIXn93Gp3kJk4g== +postcss-sorting@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/postcss-sorting/-/postcss-sorting-8.0.2.tgz#6393385ece272baf74bee9820fb1b58098e4eeca" + integrity sha512-M9dkSrmU00t/jK7rF6BZSZauA5MAaBW4i5EnJXspMwt4iqTh/L9j6fgMnbElEOfyRyfLfVbIHj/R52zHzAPe1Q== postcss-svg@^3.0.0: version "3.0.0" @@ -6057,20 +6117,20 @@ postcss-svg@^3.0.0: svgo "^1.1.1" xmldoc "^1.1.2" -postcss-svgo@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-6.0.3.tgz#1d6e180d6df1fa8a3b30b729aaa9161e94f04eaa" - integrity sha512-dlrahRmxP22bX6iKEjOM+c8/1p+81asjKT+V5lrgOH944ryx/OHpclnIbGsKVd3uWOXFLYJwCVf0eEkJGvO96g== +postcss-svgo@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-7.0.1.tgz#2b63571d8e9568384df334bac9917baff4d23f58" + integrity sha512-0WBUlSL4lhD9rA5k1e5D8EN5wCEyZD6HJk0jIvRxl+FDVOMlJ7DePHYWGGVc5QRqrJ3/06FTXM0bxjmJpmTPSA== dependencies: postcss-value-parser "^4.2.0" - svgo "^3.2.0" + svgo "^3.3.2" -postcss-unique-selectors@^6.0.4: - version "6.0.4" - resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-6.0.4.tgz#983ab308896b4bf3f2baaf2336e14e52c11a2088" - integrity sha512-K38OCaIrO8+PzpArzkLKB42dSARtC2tmG6PvD4b1o1Q2E9Os8jzfWFfSy/rixsHwohtsDdFtAWGjFVFUdwYaMg== +postcss-unique-selectors@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-7.0.3.tgz#483fc11215b23d517d5d9bbe5833d9915619ca33" + integrity sha512-J+58u5Ic5T1QjP/LDV9g3Cx4CNOgB5vz+kM6+OxHHhFACdcDeKhBXjQmB7fnIZM12YSTvsL0Opwco83DmacW2g== dependencies: - postcss-selector-parser "^6.0.16" + postcss-selector-parser "^6.1.2" postcss-value-parser@^4.0.0, postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: version "4.2.0" @@ -6094,7 +6154,7 @@ postcss@^7.0.6: picocolors "^0.2.1" source-map "^0.6.1" -postcss@^8.2.14, postcss@^8.3.11, postcss@^8.4.19, postcss@^8.4.24, postcss@^8.4.33, postcss@^8.4.47: +postcss@^8.2.14, postcss@^8.4.32, postcss@^8.4.33, postcss@^8.4.38, postcss@^8.4.47, postcss@^8.4.49, postcss@^8.5.1: version "8.5.1" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.1.tgz#e2272a1f8a807fafa413218245630b5db10a3214" integrity sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ== @@ -6103,10 +6163,10 @@ postcss@^8.2.14, postcss@^8.3.11, postcss@^8.4.19, postcss@^8.4.24, postcss@^8.4 picocolors "^1.1.1" source-map-js "^1.2.1" -prettier@^2.4.1: - version "2.8.8" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" - integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== +prettier@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.4.2.tgz#a5ce1fb522a588bf2b78ca44c6e6fe5aa5a2b13f" + integrity sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ== pretty-bytes@^5.6.0: version "5.6.0" @@ -6149,13 +6209,6 @@ proxy-from-env@^1.1.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== -psl@^1.1.33: - version "1.15.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.15.0.tgz#bdace31896f1d97cec6a79e8224898ce93d974c6" - integrity sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w== - dependencies: - punycode "^2.3.1" - pump@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8" @@ -6164,7 +6217,12 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.1: +punycode.js@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7" + integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA== + +punycode@^2.1.0: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== @@ -6181,28 +6239,18 @@ qs@6.13.0: dependencies: side-channel "^1.0.6" -qs@~6.10.3: - version "6.10.5" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.5.tgz#974715920a80ff6a262264acd2c7e6c2a53282b4" - integrity sha512-O5RlPh0VFtR78y79rgcgKK4wbAI0C5zGVLztOIdpWX6ep368q5Hv6XRxDvXuZ9q3C6v+e3n8UfZZJw7IIG27eQ== +qs@6.13.1: + version "6.13.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.1.tgz#3ce5fc72bd3a8171b85c99b93c65dd20b7d1b16e" + integrity sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg== dependencies: - side-channel "^1.0.4" - -querystringify@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" - integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== + side-channel "^1.0.6" queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -quick-lru@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" - integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== - randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -6232,34 +6280,6 @@ read-cache@^1.0.0: dependencies: pify "^2.3.0" -read-pkg-up@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== - dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" - -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" - -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.6: - version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - readable-stream@^2.0.1: version "2.3.8" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" @@ -6273,6 +6293,15 @@ readable-stream@^2.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@^3.0.6: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readdirp@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-4.1.1.tgz#bd115327129672dc47f87408f05df9bd9ca3ef55" @@ -6292,14 +6321,6 @@ rechoir@^0.8.0: dependencies: resolve "^1.20.0" -redent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" - integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== - dependencies: - indent-string "^4.0.0" - strip-indent "^3.0.0" - reflect.getprototypeof@^1.0.6, reflect.getprototypeof@^1.0.9: version "1.0.10" resolved "https://registry.yarnpkg.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz#c629219e78a3316d8b604c765ef68996964e7bf9" @@ -6326,12 +6347,7 @@ regenerate@^1.4.2: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.13.9: - version "0.13.11" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" - integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== - -regenerator-runtime@^0.14.0: +regenerator-runtime@^0.14.0, regenerator-runtime@^0.14.1: version "0.14.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== @@ -6424,22 +6440,15 @@ resolve-cwd@^3.0.0: dependencies: resolve-from "^5.0.0" -resolve-from@5.0.0, resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve-global@1.0.0, resolve-global@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/resolve-global/-/resolve-global-1.0.0.tgz#a2a79df4af2ca3f49bf77ef9ddacd322dad19255" - integrity sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw== - dependencies: - global-dirs "^0.1.1" +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve-url-loader@^5.0.0: version "5.0.0" @@ -6452,7 +6461,7 @@ resolve-url-loader@^5.0.0: postcss "^8.2.14" source-map "0.6.1" -resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.8: +resolve@^1.1.7, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.8: version "1.22.10" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39" integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== @@ -6484,26 +6493,18 @@ rfdc@^1.3.0: resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.4.1.tgz#778f76c4fb731d93414e8f925fbecf64cce7f6ca" integrity sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== -rimraf@^2.6.3: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== +rimraf@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-6.0.1.tgz#ffb8ad8844dd60332ab15f52bc104bc3ed71ea4e" + integrity sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A== dependencies: - glob "^7.1.3" + glob "^11.0.0" + package-json-from-dist "^1.0.0" -rimraf@^5.0.0: - version "5.0.10" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.10.tgz#23b9843d3dc92db71f96e1a2ce92e39fd2a8221c" - integrity sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ== - dependencies: - glob "^10.3.7" +run-applescript@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/run-applescript/-/run-applescript-7.0.0.tgz#e5a553c2bffd620e169d276c1cd8f1b64778fbeb" + integrity sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A== run-parallel@^1.1.9: version "1.2.0" @@ -6562,14 +6563,14 @@ safe-regex-test@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sass-loader@^13.2.2: - version "13.3.3" - resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-13.3.3.tgz#60df5e858788cffb1a3215e5b92e9cba61e7e133" - integrity sha512-mt5YN2F1MOZr3d/wBRcZxeFgwgkH44wVc2zohO2YF6JiOMkiXe4BYRZpSu2sO1g71mo/j16txzUhsKZlqjVGzA== +sass-loader@^16.0.4: + version "16.0.4" + resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-16.0.4.tgz#5c2afb755fbc0a45a004369efa11579518a39a45" + integrity sha512-LavLbgbBGUt3wCiYzhuLLu65+fWXaXLmq7YxivLhEqmiupCFZ5sKUAipK3do6V80YSU0jvSxNhEdT13IXNr3rg== dependencies: neo-async "^2.6.2" -sass@^1.43.4: +sass@^1.83.4: version "1.83.4" resolved "https://registry.yarnpkg.com/sass/-/sass-1.83.4.tgz#5ccf60f43eb61eeec300b780b8dcb85f16eec6d1" integrity sha512-B1bozCeNQiOgDcLd33e2Cs2U60wZwjUUXzh900ZyQF5qUasvMdDZYbQ566LJu7cqR+sAHlAfO6RMkaID5s6qpA== @@ -6599,7 +6600,7 @@ schema-utils@^3.0.0, schema-utils@^3.2.0: ajv "^6.12.5" ajv-keywords "^3.5.2" -schema-utils@^4.0.0, schema-utils@^4.0.1, schema-utils@^4.3.0: +schema-utils@^4.0.0, schema-utils@^4.2.0, schema-utils@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.0.tgz#3b669f04f71ff2dfb5aba7ce2d5a9d79b35622c0" integrity sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g== @@ -6614,7 +6615,7 @@ select-hose@^2.0.0: resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" integrity sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg== -selfsigned@^2.1.1: +selfsigned@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-2.4.1.tgz#560d90565442a3ed35b674034cec4e95dceb4ae0" integrity sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q== @@ -6622,24 +6623,12 @@ selfsigned@^2.1.1: "@types/node-forge" "^1.3.0" node-forge "^1" -"semver@2 || 3 || 4 || 5": - version "5.7.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" - integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== - -semver@7.5.4: - version "7.5.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.3.2, semver@^7.3.4, semver@^7.5.3, semver@^7.5.4: +semver@^7.3.2, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0: version "7.6.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== @@ -6663,7 +6652,7 @@ send@0.19.0: range-parser "~1.2.1" statuses "2.0.1" -serialize-javascript@^6.0.1, serialize-javascript@^6.0.2: +serialize-javascript@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== @@ -6792,7 +6781,7 @@ side-channel-weakmap@^1.0.2: object-inspect "^1.13.3" side-channel-map "^1.0.1" -side-channel@^1.0.4, side-channel@^1.0.6, side-channel@^1.1.0: +side-channel@^1.0.6, side-channel@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== @@ -6803,7 +6792,7 @@ side-channel@^1.0.4, side-channel@^1.0.6, side-channel@^1.1.0: side-channel-map "^1.0.1" side-channel-weakmap "^1.0.2" -signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: +signal-exit@^3.0.2: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -6818,10 +6807,10 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slash@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" - integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== +slash@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-5.1.0.tgz#be3adddcdf09ac38eebe8dcdc7b1a57a75b095ce" + integrity sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg== slice-ansi@^3.0.0: version "3.0.0" @@ -6868,32 +6857,6 @@ source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -spdx-correct@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" - integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz#5d607d27fc806f66d7b64a766650fa890f04ed66" - integrity sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.21" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz#6d6e980c9df2b6fc905343a3b2d702a6239536c3" - integrity sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg== - spdy-transport@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-3.0.0.tgz#00d4863a6400ad75df93361a1608605e5dcdcf31" @@ -6917,19 +6880,17 @@ spdy@^4.0.2: select-hose "^2.0.0" spdy-transport "^3.0.0" -split2@^3.0.0, split2@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" - integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== - dependencies: - readable-stream "^3.0.0" +split2@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" + integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== -sshpk@^1.14.1: +sshpk@^1.18.0: version "1.18.0" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.18.0.tgz#1663e55cddf4d688b86a46b77f0d5fe363aba028" integrity sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ== @@ -7068,122 +7029,108 @@ strip-final-newline@^2.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== -strip-indent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" - integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== - dependencies: - min-indent "^1.0.0" - -strip-json-comments@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-5.0.0.tgz#ec101b766476a703031bc607e3c712569de2aa06" - integrity sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw== - style-loader@^3.3.0: version "3.3.4" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.4.tgz#f30f786c36db03a45cbd55b6a70d930c479090e7" integrity sha512-0WqXzrsMTyb8yjZJHDqwmnwRJvhALK9LfRtRc6B4UTWe8AijYLZYZ9thuJTZc2VfQWINADW/j+LiJnfy2RoC1w== -style-search@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902" - integrity sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg== - -stylehacks@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-6.1.1.tgz#543f91c10d17d00a440430362d419f79c25545a6" - integrity sha512-gSTTEQ670cJNoaeIp9KX6lZmm8LJ3jPB5yJmX8Zq/wQxOsAFXV3qjWzHas3YYk1qesuVIyYWWUpZ0vSE/dTSGg== +stylehacks@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-7.0.4.tgz#9c21f7374f4bccc0082412b859b3c89d77d3277c" + integrity sha512-i4zfNrGMt9SB4xRK9L83rlsFCgdGANfeDAYacO1pkqcE7cRHPdWHwnKZVz7WY17Veq/FvyYsRAU++Ga+qDFIww== dependencies: - browserslist "^4.23.0" - postcss-selector-parser "^6.0.16" + browserslist "^4.23.3" + postcss-selector-parser "^6.1.2" -stylelint-config-idiomatic-order@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/stylelint-config-idiomatic-order/-/stylelint-config-idiomatic-order-9.0.0.tgz#8c04761ad41f234eb489f758d9b0b0d8743f7dd8" - integrity sha512-+LtfPycY1Paayf1MaERyh6BzVPnZxemX5NtzdUPqi4u8hyAR7859f/4EL02+Kr9va76iX7mbYC4HendocXKJZQ== +stylelint-config-idiomatic-order@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-idiomatic-order/-/stylelint-config-idiomatic-order-10.0.0.tgz#7c875bcadd7c8bc52d845c591c8d74f4dc6563b4" + integrity sha512-gJjT1nwhgnHS52+mRn+5Iw6keZIPRN4W+vbzct9Elb+tWOo61jC/CzXzAJHvvOYQZqUYItfs2aQ8fU5hnCvuGg== dependencies: - stylelint-order "^5.0.0" + stylelint-order "^6.0.2" stylelint-config-prettier@^9.0.5: version "9.0.5" resolved "https://registry.yarnpkg.com/stylelint-config-prettier/-/stylelint-config-prettier-9.0.5.tgz#9f78bbf31c7307ca2df2dd60f42c7014ee9da56e" integrity sha512-U44lELgLZhbAD/xy/vncZ2Pq8sh2TnpiPvo38Ifg9+zeioR+LAkHu0i6YORIOxFafZoVg0xqQwex6e6F25S5XA== -stylelint-config-recommended@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-9.0.0.tgz#1c9e07536a8cd875405f8ecef7314916d94e7e40" - integrity sha512-9YQSrJq4NvvRuTbzDsWX3rrFOzOlYBmZP+o513BJN/yfEmGSr0AxdvrWs0P/ilSpVV/wisamAHu5XSk8Rcf4CQ== +stylelint-config-recommended@^15.0.0: + version "15.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-15.0.0.tgz#93d48db401215708b724f078533864e52085a07b" + integrity sha512-9LejMFsat7L+NXttdHdTq94byn25TD+82bzGRiV1Pgasl99pWnwipXS5DguTpp3nP1XjvLXVnEJIuYBfsRjRkA== -stylelint-config-standard@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-29.0.0.tgz#4cc0e0f05512a39bb8b8e97853247d3a95d66fa2" - integrity sha512-uy8tZLbfq6ZrXy4JKu3W+7lYLgRQBxYTUUB88vPgQ+ZzAxdrvcaSUW9hOMNLYBnwH+9Kkj19M2DHdZ4gKwI7tg== +stylelint-config-standard@^37.0.0: + version "37.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-37.0.0.tgz#55e75c7215d5398b096d2f75af6a16693c18532d" + integrity sha512-+6eBlbSTrOn/il2RlV0zYGQwRTkr+WtzuVSs1reaWGObxnxLpbcspCUYajVQHonVfxVw2U+h42azGhrBvcg8OA== dependencies: - stylelint-config-recommended "^9.0.0" + stylelint-config-recommended "^15.0.0" -stylelint-order@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/stylelint-order/-/stylelint-order-5.0.0.tgz#abd20f6b85ac640774cbe40e70d3fe9c6fdf4400" - integrity sha512-OWQ7pmicXufDw5BlRqzdz3fkGKJPgLyDwD1rFY3AIEfIH/LQY38Vu/85v8/up0I+VPiuGRwbc2Hg3zLAsJaiyw== +stylelint-order@^6.0.2: + version "6.0.4" + resolved "https://registry.yarnpkg.com/stylelint-order/-/stylelint-order-6.0.4.tgz#3e80d876c61a98d2640de181433686f24284748b" + integrity sha512-0UuKo4+s1hgQ/uAxlYU4h0o0HS4NiQDud0NAUNI0aa8FJdmYHA5ZZTFHiV5FpmE3071e9pZx5j0QpVJW5zOCUA== dependencies: - postcss "^8.3.11" - postcss-sorting "^7.0.1" + postcss "^8.4.32" + postcss-sorting "^8.0.2" -stylelint-scss@^5.0.1: - version "5.3.2" - resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-5.3.2.tgz#c54564dfbd98de0c08742b9c43025cda91acf940" - integrity sha512-4LzLaayFhFyneJwLo0IUa8knuIvj+zF0vBFueQs4e3tEaAMIQX8q5th8ziKkgOavr6y/y9yoBe+RXN/edwLzsQ== +stylelint-scss@^6.10.1: + version "6.10.1" + resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-6.10.1.tgz#6ad0e9485b0f57adb9051dd8cf334b10d1a5df20" + integrity sha512-CBqs0jecftIyhic6xba+4OvZUp4B0wNbX19w6Rq1fPo+lBDmTevk+olo8H7u/WQpTSDCDbBN4f3oocQurvXLTQ== dependencies: - known-css-properties "^0.29.0" + css-tree "^3.0.1" + is-plain-object "^5.0.0" + known-css-properties "^0.35.0" + mdn-data "^2.14.0" postcss-media-query-parser "^0.2.3" - postcss-resolve-nested-selector "^0.1.1" - postcss-selector-parser "^6.0.13" + postcss-resolve-nested-selector "^0.1.6" + postcss-selector-parser "^7.0.0" postcss-value-parser "^4.2.0" -stylelint@^14.16.1: - version "14.16.1" - resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-14.16.1.tgz#b911063530619a1bbe44c2b875fd8181ebdc742d" - integrity sha512-ErlzR/T3hhbV+a925/gbfc3f3Fep9/bnspMiJPorfGEmcBbXdS+oo6LrVtoUZ/w9fqD6o6k7PtUlCOsCRdjX/A== +stylelint@^16.13.2: + version "16.13.2" + resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-16.13.2.tgz#a0e8aab7cedde55f185ac8af6f526e53df783294" + integrity sha512-wDlgh0mRO9RtSa3TdidqHd0nOG8MmUyVKl+dxA6C1j8aZRzpNeEgdhFmU5y4sZx4Fc6r46p0fI7p1vR5O2DZqA== dependencies: - "@csstools/selector-specificity" "^2.0.2" + "@csstools/css-parser-algorithms" "^3.0.4" + "@csstools/css-tokenizer" "^3.0.3" + "@csstools/media-query-list-parser" "^4.0.2" + "@csstools/selector-specificity" "^5.0.0" + "@dual-bundle/import-meta-resolve" "^4.1.0" balanced-match "^2.0.0" colord "^2.9.3" - cosmiconfig "^7.1.0" - css-functions-list "^3.1.0" - debug "^4.3.4" - fast-glob "^3.2.12" + cosmiconfig "^9.0.0" + css-functions-list "^3.2.3" + css-tree "^3.1.0" + debug "^4.3.7" + fast-glob "^3.3.3" fastest-levenshtein "^1.0.16" - file-entry-cache "^6.0.1" + file-entry-cache "^10.0.5" global-modules "^2.0.0" globby "^11.1.0" globjoin "^0.1.4" - html-tags "^3.2.0" - ignore "^5.2.1" - import-lazy "^4.0.0" + html-tags "^3.3.1" + ignore "^7.0.1" imurmurhash "^0.1.4" is-plain-object "^5.0.0" - known-css-properties "^0.26.0" + known-css-properties "^0.35.0" mathml-tag-names "^2.1.3" - meow "^9.0.0" - micromatch "^4.0.5" + meow "^13.2.0" + micromatch "^4.0.8" normalize-path "^3.0.0" - picocolors "^1.0.0" - postcss "^8.4.19" - postcss-media-query-parser "^0.2.3" - postcss-resolve-nested-selector "^0.1.1" - postcss-safe-parser "^6.0.0" - postcss-selector-parser "^6.0.11" + picocolors "^1.1.1" + postcss "^8.4.49" + postcss-resolve-nested-selector "^0.1.6" + postcss-safe-parser "^7.0.1" + postcss-selector-parser "^7.0.0" postcss-value-parser "^4.2.0" resolve-from "^5.0.0" string-width "^4.2.3" - strip-ansi "^6.0.1" - style-search "^0.1.0" - supports-hyperlinks "^2.3.0" + supports-hyperlinks "^3.1.0" svg-tags "^1.0.0" - table "^6.8.1" - v8-compile-cache "^2.3.0" - write-file-atomic "^4.0.2" + table "^6.9.0" + write-file-atomic "^5.0.1" sucrase@^3.35.0: version "3.35.0" @@ -7219,10 +7166,10 @@ supports-color@^8.0.0, supports-color@^8.1.1: dependencies: has-flag "^4.0.0" -supports-hyperlinks@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624" - integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA== +supports-hyperlinks@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-3.1.0.tgz#b56150ff0173baacc15f21956450b61f2b18d3ac" + integrity sha512-2rn0BZ+/f7puLOHZm1HOJfwBggfaHXUpPUSSG/SWM4TWp5KCfmNYwnC3hruy2rZlMnmWZ+QAGpZfchu3f3695A== dependencies: has-flag "^4.0.0" supports-color "^7.0.0" @@ -7256,7 +7203,7 @@ svgo@^1.1.1: unquote "~1.1.1" util.promisify "~1.0.0" -svgo@^3.2.0: +svgo@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/svgo/-/svgo-3.3.2.tgz#ad58002652dffbb5986fc9716afe52d869ecbda8" integrity sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw== @@ -7269,19 +7216,12 @@ svgo@^3.2.0: csso "^5.0.5" picocolors "^1.0.0" -sync-rpc@^1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/sync-rpc/-/sync-rpc-1.3.6.tgz#b2e8b2550a12ccbc71df8644810529deb68665a7" - integrity sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw== - dependencies: - get-port "^3.1.0" - tabbable@^5.3.3: version "5.3.3" resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-5.3.3.tgz#aac0ff88c73b22d6c3c5a50b1586310006b47fbf" integrity sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA== -table@^6.8.1: +table@^6.9.0: version "6.9.0" resolved "https://registry.yarnpkg.com/table/-/table-6.9.0.tgz#50040afa6264141c7566b3b81d4d82c47a8668f5" integrity sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A== @@ -7292,12 +7232,12 @@ table@^6.8.1: string-width "^4.2.3" strip-ansi "^6.0.1" -tailwind-scrollbar@^3.0.0: +tailwind-scrollbar@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/tailwind-scrollbar/-/tailwind-scrollbar-3.1.0.tgz#ff7596407b6da5209261d8ff03860ab9206a59e3" integrity sha512-pmrtDIZeHyu2idTejfV59SbaJyvp1VRjYxAjZBH0jnyrPRo6HL1kD5Glz8VPagasqr6oAx6M05+Tuw429Z8jxg== -tailwindcss@^3.3.2: +tailwindcss@^3.4.17: version "3.4.17" resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.4.17.tgz#ae8406c0f96696a631c790768ff319d46d5e5a63" integrity sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og== @@ -7351,10 +7291,10 @@ terser@^5.31.1: commander "^2.20.0" source-map-support "~0.5.20" -text-extensions@^1.0.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" - integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== +text-extensions@^2.0.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-2.4.0.tgz#a1cfcc50cf34da41bfd047cc744f804d1680ea34" + integrity sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g== thenify-all@^1.0.0: version "1.6.0" @@ -7370,18 +7310,16 @@ thenify-all@^1.0.0: dependencies: any-promise "^1.0.0" +thingies@^1.20.0: + version "1.21.0" + resolved "https://registry.yarnpkg.com/thingies/-/thingies-1.21.0.tgz#e80fbe58fd6fdaaab8fad9b67bd0a5c943c445c1" + integrity sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g== + throttleit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.1.tgz#304ec51631c3b770c65c6c6f76938b384000f4d5" integrity sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ== -through2@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" - integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== - dependencies: - readable-stream "3" - "through@>=2.2.7 <3", through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -7392,14 +7330,31 @@ thunky@^1.0.2: resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== -tippy.js@^6.3.7: +tinyexec@^0.3.0: + version "0.3.2" + resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.2.tgz#941794e657a85e496577995c6eef66f53f42b3d2" + integrity sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA== + +tippy.js@^6.3.1, tippy.js@^6.3.7: version "6.3.7" resolved "https://registry.yarnpkg.com/tippy.js/-/tippy.js-6.3.7.tgz#8ccfb651d642010ed9a32ff29b0e9e19c5b8c61c" integrity sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ== dependencies: "@popperjs/core" "^2.9.0" -tmp@^0.2.1, tmp@~0.2.1: +tldts-core@^6.1.72: + version "6.1.72" + resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-6.1.72.tgz#32b38e1843f4adab57d2414a9ec4af9a81826bc0" + integrity sha512-FW3H9aCaGTJ8l8RVCR3EX8GxsxDbQXuwetwwgXA2chYdsX+NY1ytCBl61narjjehWmCw92tc1AxlcY3668CU8g== + +tldts@^6.1.32: + version "6.1.72" + resolved "https://registry.yarnpkg.com/tldts/-/tldts-6.1.72.tgz#9b85f47e451e2ff079fab5801b4fa156ecda69f4" + integrity sha512-QNtgIqSUb9o2CoUjX9T5TwaIvUUJFU1+12PJkgt42DFV2yf9J6549yTF2uGloQsJ/JOC8X+gIB81ind97hRiIQ== + dependencies: + tldts-core "^6.1.72" + +tmp@^0.2.1, tmp@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w== @@ -7416,46 +7371,29 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tough-cookie@^4.1.3: - version "4.1.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" - integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== +tough-cookie@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-5.1.0.tgz#0667b0f2fbb5901fe6f226c3e0b710a9a4292f87" + integrity sha512-rvZUv+7MoBYTiDmFPBrhL7Ujx9Sk+q9wwm22x8c8T5IJaR+Wsyc7TNxbVxo84kZoRJZZMazowFLqpankBEQrGg== dependencies: - psl "^1.1.33" - punycode "^2.1.1" - universalify "^0.2.0" - url-parse "^1.5.3" + tldts "^6.1.32" -trim-newlines@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" - integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== +tree-dump@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/tree-dump/-/tree-dump-1.0.2.tgz#c460d5921caeb197bde71d0e9a7b479848c5b8ac" + integrity sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ== + +tree-kill@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" + integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== ts-interface-checker@^0.1.9: version "0.1.13" resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== -ts-node@^10.8.1: - version "10.9.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" - integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - -tslib@^2.1.0: +tslib@^2.0.0, tslib@^2.1.0: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== @@ -7472,26 +7410,11 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== -type-fest@^0.18.0: - version "0.18.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" - integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== - type-fest@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -7545,15 +7468,10 @@ typed-array-length@^1.0.7: possible-typed-array-names "^1.0.0" reflect.getprototypeof "^1.0.6" -"typescript@^4.6.4 || ^5.2.2": - version "5.7.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e" - integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw== - -uc.micro@^1.0.1, uc.micro@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" - integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== +uc.micro@^2.0.0, uc.micro@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" + integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A== unbox-primitive@^1.1.0: version "1.1.0" @@ -7593,16 +7511,16 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== +unicorn-magic@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/unicorn-magic/-/unicorn-magic-0.1.0.tgz#1bb9a51c823aaf9d73a8bfcd3d1a23dde94b0ce4" + integrity sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ== + uniq@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" integrity sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA== -universalify@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" - integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== - universalify@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" @@ -7638,14 +7556,6 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -url-parse@^1.5.3: - version "1.5.10" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" - integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -7676,24 +7586,6 @@ uuid@^8.3.0, uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - -v8-compile-cache@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128" - integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -7723,80 +7615,78 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" -webpack-cli@^5.0.2: - version "5.1.4" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.1.4.tgz#c8e046ba7eaae4911d7e71e2b25b776fcc35759b" - integrity sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg== +webpack-cli@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-6.0.1.tgz#a1ce25da5ba077151afd73adfa12e208e5089207" + integrity sha512-MfwFQ6SfwinsUVi0rNJm7rHZ31GyTcpVE5pgVA3hwFRb7COD4TzjUUwhGWKfO50+xdc2MQPuEBBJoqIMGt3JDw== dependencies: - "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^2.1.1" - "@webpack-cli/info" "^2.0.2" - "@webpack-cli/serve" "^2.0.5" + "@discoveryjs/json-ext" "^0.6.1" + "@webpack-cli/configtest" "^3.0.1" + "@webpack-cli/info" "^3.0.1" + "@webpack-cli/serve" "^3.0.1" colorette "^2.0.14" - commander "^10.0.1" + commander "^12.1.0" cross-spawn "^7.0.3" - envinfo "^7.7.3" + envinfo "^7.14.0" fastest-levenshtein "^1.0.12" import-local "^3.0.2" interpret "^3.1.1" rechoir "^0.8.0" - webpack-merge "^5.7.3" + webpack-merge "^6.0.1" -webpack-dev-middleware@^5.3.4: - version "5.3.4" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz#eb7b39281cbce10e104eb2b8bf2b63fce49a3517" - integrity sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q== +webpack-dev-middleware@^7.4.2: + version "7.4.2" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-7.4.2.tgz#40e265a3d3d26795585cff8207630d3a8ff05877" + integrity sha512-xOO8n6eggxnwYpy1NlzUKpvrjfJTvae5/D6WOK0S2LSo7vjmo5gCM1DbLUmFqrMTJP+W/0YZNctm7jasWvLuBA== dependencies: colorette "^2.0.10" - memfs "^3.4.3" + memfs "^4.6.0" mime-types "^2.1.31" + on-finished "^2.4.1" range-parser "^1.2.1" schema-utils "^4.0.0" -webpack-dev-server@^4.8.0: - version "4.15.2" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.15.2.tgz#9e0c70a42a012560860adb186986da1248333173" - integrity sha512-0XavAZbNJ5sDrCbkpWL8mia0o5WPOd2YGtxrEiZkBK9FjLppIUK2TgxK6qGD2P3hUXTJNNPVibrerKcx5WkR1g== - dependencies: - "@types/bonjour" "^3.5.9" - "@types/connect-history-api-fallback" "^1.3.5" - "@types/express" "^4.17.13" - "@types/serve-index" "^1.9.1" - "@types/serve-static" "^1.13.10" - "@types/sockjs" "^0.3.33" - "@types/ws" "^8.5.5" +webpack-dev-server@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-5.2.0.tgz#68043886edaa3fd875ad20e01589990a79612f9c" + integrity sha512-90SqqYXA2SK36KcT6o1bvwvZfJFcmoamqeJY7+boioffX9g9C0wjjJRGUrQIuh43pb0ttX7+ssavmj/WN2RHtA== + dependencies: + "@types/bonjour" "^3.5.13" + "@types/connect-history-api-fallback" "^1.5.4" + "@types/express" "^4.17.21" + "@types/serve-index" "^1.9.4" + "@types/serve-static" "^1.15.5" + "@types/sockjs" "^0.3.36" + "@types/ws" "^8.5.10" ansi-html-community "^0.0.8" - bonjour-service "^1.0.11" - chokidar "^3.5.3" + bonjour-service "^1.2.1" + chokidar "^3.6.0" colorette "^2.0.10" compression "^1.7.4" connect-history-api-fallback "^2.0.0" - default-gateway "^6.0.3" - express "^4.17.3" + express "^4.21.2" graceful-fs "^4.2.6" - html-entities "^2.3.2" - http-proxy-middleware "^2.0.3" - ipaddr.js "^2.0.1" - launch-editor "^2.6.0" - open "^8.0.9" - p-retry "^4.5.0" - rimraf "^3.0.2" - schema-utils "^4.0.0" - selfsigned "^2.1.1" + http-proxy-middleware "^2.0.7" + ipaddr.js "^2.1.0" + launch-editor "^2.6.1" + open "^10.0.3" + p-retry "^6.2.0" + schema-utils "^4.2.0" + selfsigned "^2.4.1" serve-index "^1.9.1" sockjs "^0.3.24" spdy "^4.0.2" - webpack-dev-middleware "^5.3.4" - ws "^8.13.0" + webpack-dev-middleware "^7.4.2" + ws "^8.18.0" -webpack-merge@^5.7.3: - version "5.10.0" - resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.10.0.tgz#a3ad5d773241e9c682803abf628d4cd62b8a4177" - integrity sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA== +webpack-merge@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-6.0.1.tgz#50c776868e080574725abc5869bd6e4ef0a16c6a" + integrity sha512-hXXvrjtx2PLYx4qruKl+kyRSLc52V+cCvMxRjmKwoA+CBbbF5GfIBtR6kCvl0fYGqTUPKB+1ktVmTHqMOzgCBg== dependencies: clone-deep "^4.0.1" flat "^5.0.2" - wildcard "^2.0.0" + wildcard "^2.0.1" webpack-notifier@^1.15.0: version "1.15.0" @@ -7811,7 +7701,7 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.74.0: +webpack@^5.97.1: version "5.97.1" resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.97.1.tgz#972a8320a438b56ff0f1d94ade9e82eac155fa58" integrity sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg== @@ -7920,7 +7810,7 @@ which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" -wildcard@^2.0.0: +wildcard@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== @@ -7966,15 +7856,15 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -write-file-atomic@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" - integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== +write-file-atomic@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-5.0.1.tgz#68df4717c55c6fa4281a7860b4c2ba0a6d2b11e7" + integrity sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw== dependencies: imurmurhash "^0.1.4" - signal-exit "^3.0.7" + signal-exit "^4.0.1" -ws@^8.13.0: +ws@^8.18.0: version "8.18.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== @@ -7996,31 +7886,11 @@ yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yaml@2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.2.2.tgz#ec551ef37326e6d42872dad1970300f8eb83a073" - integrity sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA== - -yaml@^1.10.0: - version "1.10.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== - yaml@^2.3.4: version "2.7.0" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.7.0.tgz#aef9bb617a64c937a9a748803786ad8d3ffe1e98" integrity sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA== -yargs-parser@^20.2.3: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - yargs-parser@^21.0.0, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" @@ -8047,16 +7917,6 @@ yauzl@^2.10.0: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - yocto-queue@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.1.1.tgz#fef65ce3ac9f8a32ceac5a634f74e17e5b232110" From 7c419b8013f49ad65c96ee564507e568d49996c8 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 15:54:35 +0100 Subject: [PATCH 21/52] build: update webpack encore --- composer.json | 2 +- composer.lock | 39 +++++++++++++++++++-------------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/composer.json b/composer.json index a657d999..681fa47f 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "symfony/var-dumper": "6.4.*", "symfony/web-link": "6.4.*", "symfony/web-profiler-bundle": "6.4.*", - "symfony/webpack-encore-bundle": "^1.7", + "symfony/webpack-encore-bundle": "^v2.2.0", "symfony/yaml": "6.4.*", "twig/extra-bundle": "^3.3", "twig/markdown-extra": "^3.3", diff --git a/composer.lock b/composer.lock index 2fff466b..ad80e239 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ecec05e20cc0258731f535cd1afad48a", + "content-hash": "594ce4f5cf9e736d1ae111dc8ec9ab6a", "packages": [ { "name": "composer/package-versions-deprecated", @@ -8742,33 +8742,32 @@ }, { "name": "symfony/webpack-encore-bundle", - "version": "v1.17.2", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/webpack-encore-bundle.git", - "reference": "471ebbc03072dad6e31840dc317bc634a32785f5" + "reference": "e335394b68a775a9b2bd173a8ba4fd2001f3870c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/webpack-encore-bundle/zipball/471ebbc03072dad6e31840dc317bc634a32785f5", - "reference": "471ebbc03072dad6e31840dc317bc634a32785f5", + "url": "https://api.github.com/repos/symfony/webpack-encore-bundle/zipball/e335394b68a775a9b2bd173a8ba4fd2001f3870c", + "reference": "e335394b68a775a9b2bd173a8ba4fd2001f3870c", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/asset": "^4.4 || ^5.0 || ^6.0", - "symfony/config": "^4.4 || ^5.0 || ^6.0", - "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", - "symfony/deprecation-contracts": "^2.1 || ^3.0", - "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.25.0", - "symfony/service-contracts": "^1.0 || ^2.0 || ^3.0" + "php": ">=8.1.0", + "symfony/asset": "^5.4 || ^6.2 || ^7.0", + "symfony/config": "^5.4 || ^6.2 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.2 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.2 || ^7.0", + "symfony/service-contracts": "^1.1.9 || ^2.1.3 || ^3.0" }, "require-dev": { - "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^5.3 || ^6.0", - "symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/web-link": "^4.4 || ^5.0 || ^6.0" + "symfony/framework-bundle": "^5.4 || ^6.2 || ^7.0", + "symfony/http-client": "^5.4 || ^6.2 || ^7.0", + "symfony/phpunit-bridge": "^5.4 || ^6.2 || ^7.0", + "symfony/twig-bundle": "^5.4 || ^6.2 || ^7.0", + "symfony/web-link": "^5.4 || ^6.2 || ^7.0" }, "type": "symfony-bundle", "extra": { @@ -8792,10 +8791,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Integration with your Symfony app & Webpack Encore!", + "description": "Integration of your Symfony app with Webpack Encore", "support": { "issues": "https://github.com/symfony/webpack-encore-bundle/issues", - "source": "https://github.com/symfony/webpack-encore-bundle/tree/v1.17.2" + "source": "https://github.com/symfony/webpack-encore-bundle/tree/v2.2.0" }, "funding": [ { @@ -8811,7 +8810,7 @@ "type": "tidelift" } ], - "time": "2023-09-26T14:36:28+00:00" + "time": "2024-10-02T07:27:19+00:00" }, { "name": "symfony/yaml", From b10fc58fccab4af714cc493ca603f1a6d032ab78 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 15:59:55 +0100 Subject: [PATCH 22/52] build: install symfony/stimulus-bundle --- composer.json | 1 + composer.lock | 71 +++++++++++++++++++++++++++++++++++++++++++++- config/bundles.php | 1 + symfony.lock | 14 +++++++++ 4 files changed, 86 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 681fa47f..3ac86302 100644 --- a/composer.json +++ b/composer.json @@ -33,6 +33,7 @@ "symfony/runtime": "6.4.*", "symfony/security-bundle": "6.4.*", "symfony/serializer": "6.4.*", + "symfony/stimulus-bundle": "^2.22", "symfony/stopwatch": "6.4.*", "symfony/translation": "6.4.*", "symfony/twig-bundle": "6.4.*", diff --git a/composer.lock b/composer.lock index ad80e239..67108bc5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "594ce4f5cf9e736d1ae111dc8ec9ab6a", + "content-hash": "19944536361c8ce097be783ab1c80fee", "packages": [ { "name": "composer/package-versions-deprecated", @@ -7759,6 +7759,75 @@ ], "time": "2024-09-25T14:20:29+00:00" }, + { + "name": "symfony/stimulus-bundle", + "version": "v2.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/stimulus-bundle.git", + "reference": "e13034d428354023c82a1db108d40fdf6cec2d36" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stimulus-bundle/zipball/e13034d428354023c82a1db108d40fdf6cec2d36", + "reference": "e13034d428354023c82a1db108d40fdf6cec2d36", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/deprecation-contracts": "^2.0|^3.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "twig/twig": "^2.15.3|^3.8" + }, + "require-dev": { + "symfony/asset-mapper": "^6.3|^7.0", + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/phpunit-bridge": "^5.4|^6.0|^7.0", + "symfony/twig-bundle": "^5.4|^6.0|^7.0", + "zenstruck/browser": "^1.4" + }, + "type": "symfony-bundle", + "autoload": { + "psr-4": { + "Symfony\\UX\\StimulusBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Integration with your Symfony app & Stimulus!", + "keywords": [ + "symfony-ux" + ], + "support": { + "source": "https://github.com/symfony/stimulus-bundle/tree/v2.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-06T14:30:33+00:00" + }, { "name": "symfony/stopwatch", "version": "v6.4.13", diff --git a/config/bundles.php b/config/bundles.php index 645603cf..a5cb271d 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -15,4 +15,5 @@ Oneup\FlysystemBundle\OneupFlysystemBundle::class => ['all' => true], Oneup\UploaderBundle\OneupUploaderBundle::class => ['all' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], + Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true], ]; diff --git a/symfony.lock b/symfony.lock index 59912891..3625a18b 100644 --- a/symfony.lock +++ b/symfony.lock @@ -445,6 +445,20 @@ "symfony/service-contracts": { "version": "v2.1.3" }, + "symfony/stimulus-bundle": { + "version": "2.22", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "2.13", + "ref": "6acd9ff4f7fd5626d2962109bd4ebab351d43c43" + }, + "files": [ + "assets/bootstrap.js", + "assets/controllers.json", + "assets/controllers/hello_controller.js" + ] + }, "symfony/stopwatch": { "version": "v4.4.10" }, From bce8aaa2aadb1efbab19d13e76a23c6df8994260 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Fri, 17 Jan 2025 16:07:30 +0100 Subject: [PATCH 23/52] build: update recipe symfony/webpack-encore-bundle --- symfony.lock | 9 +++------ webpack.config.js | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/symfony.lock b/symfony.lock index 3625a18b..3c5da087 100644 --- a/symfony.lock +++ b/symfony.lock @@ -526,18 +526,15 @@ ] }, "symfony/webpack-encore-bundle": { - "version": "1.16", + "version": "2.2", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "1.10", - "ref": "eff2e505d4557c967b6710fe06bd947ba555cae5" + "version": "2.0", + "ref": "35ee1edee91a1a7137095f53db7ed0c20884b745" }, "files": [ "assets/app.js", - "assets/bootstrap.js", - "assets/controllers.json", - "assets/controllers/hello_controller.js", "assets/styles/app.css", "config/packages/webpack_encore.yaml", "package.json", diff --git a/webpack.config.js b/webpack.config.js index 770ad88f..648bd207 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -64,7 +64,7 @@ Encore // enables and configure @babel/preset-env polyfills .configureBabelPresetEnv((config) => { config.useBuiltIns = 'usage'; - config.corejs = '3.23'; + config.corejs = '3.38'; }) // enables Sass/SCSS support From f483c6a3260edf9eabea069aaeeb553f6b5634d8 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 13:58:12 +0100 Subject: [PATCH 24/52] chore: remove unused php-cs-fixer executable --- bin/php-cs-fixer | Bin 1852521 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 bin/php-cs-fixer diff --git a/bin/php-cs-fixer b/bin/php-cs-fixer deleted file mode 100755 index 859a4c38b0f1091a195136d34f53c166253e449d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1852521 zcmeFa2Yg(`)izEih#o>S1g?$jm2F9DW1C`QV_A}IfmM)X8?YR)(q2i6SG!`1ZP8Ll zp(KGoD4_%bp@cM&kOY#D4lkiYLINQn^cP5I2?Q|hJI~BHb7$_}UCEg5&HMj;fBzDW z_THIi&YU@O=FFLL511G)=5z7BR3`3c)_NmDBUOhTj{jE0r&W2=yzZe?-Wy1zeUIo! zB3JOT1763{4zIDxTbx?&=jtgH64vxj^%f`kQhvtk$QJxef6C8!hYhGF3-hDH1KG@I zeSda%0TSb1QzDlt=1=rGi^Hi~Kb>Eb@(xStNA)>+l%XdJ2Zs}>wB$1E+Gzi+t8 z7yFL)`wLzn>lKE4ueGJyOQ-t%Ox~y8i2@k!D`t{uKM90&slpIFr-uyFpG{KbGAggC z=(3i^=C-b8R4iUql^XDB27Ri~+L{>EySK5ccX7+n&7HlAmv=AkZ0>DsZ)%QBo$8%b zg-ZFkTsGI6^GC9|LMk&@)7;yzY?(L3JGHsDskx)Gxv`+C-bEn6!>RMCPSK?$ z{ee`*Pu9eiE?v>uyP~FLq^+GQ(cHEoKu0~oCA17?vN@`dM{-EzvYBB&Q}A;B3B^>-$KNDk zzdunVkss#>DZoDt4Cehpz1O_n?=Kco*^D=w7^Qq(F_SMO`qDmgjPg(M{4{}Sq2htR zK2@lhN%c{0tMq$RYoZYs3bv)?oqV#_<398b^XAMrXvU1FR}1EQ2hW%@V}>+kSOkRR zWqd!GhoTYJ36GRCHC!C_*7~_Ts>3~FPW?gkGrUA5N%dPFmEhp|+4a-@-)^3&s)20I zPxKFYHLGIB=d+nutrsg~*Z7&#iGD7&+DqiUYJWX-D@aa6uG-T)?M-JBN$LkyI!Op6 z2(?dsg!Hp8P%{bbWH9ho-Q+xUZ#b3DLxTr$*WZa}3AxM*$%wpJl8oLU% z3PZWRw_2=sb)G!K+7~410mO1RrW@xCRq?9urFUb*K>t~YLTs%=MWYJyf zDMd_I6(CkU2NGmZSqNT#qJXXmHjEfa*`--dk)cTP%L@`i`;oQOJ*bW}*wlJyzu*m~ z*7{y!c6cP4ry*ZB!JmN~s_A7uMO|w#DM6mZzN)vksim{Gw>}oHugCu+pQ=Hv=e#ca zE~@scbtRR$Q9+qvI<21=ixgr8rpRVbDhmNZLDAZx7H&d2r4qMNjQK7c55ahke|=;Y z*90we3imZdP#XC4=FcY(fY~Jk`rld16jH;!X}X%&a&5P0WJ+hLacOk26he7Q^`czl zWq=Pyzf@VwDEE0=B6;do_HXXYq^+ljiC{Q%E_eZ=4n0RF{l4PhQf(>RU-MMTj-ipp zyz(S_8nc;vHtqK`jEs;2M>Zv!Avn^xPM=H+xt=7S^$HL6T#pX5=bnia>WcDR`vESZCKXb+t}XP(Xy<$lb(5pFW9l_ zsyjB@?CLEx+icg(Hrs4-`oI1cBa+Yc#~b?cgqW3PVLRsP~v~$!o z;`gTpQvHqOZFePxN78;vrr_rW68%0YoHIT z-KJe2>o*D#%nh*`fEMpP>uN#zC?j>MSz3Has*q0f=^r$mrHuD-M$pWek6a=d_i-~G zL2j*`?e|-1VSsLbN6j6QZ9g}gWLZpIHJcknftPQsbAn#qI#@3`_l?TgRU95p=zQ04 ziJ*5+%`BIE6Wx4`uuu8IXxf*uQRp^YDCm=oUwcn7PjE9IJ)E|4wNz5ACUo1|8k=&T}O9{+wG` z9CU_`T(+M^FF)B#u1o=0|IH=?^k*L**iEvM0F;&Q$oYdvcf-zHJEG^j^X?&%PMS{@ z(UutYS0vJ@WP(%;x%Opr(2G9uy-vv`&BsG<+#02j?eE*^!a%?O$GtL=&10q{+sZ^P zLvyTr69r75-N^d~R#MR4-#Nh;uewm)_F`eASctPk^e?A9Po)fKPtd=;@!)B~MD;j; zz{mt1{6L?5^_YDn|HSD0ZRCh)E|B>vTsY{dCtqs1n&^W_fNP;}G-AWQx9h?PChJb>oY2N|;%76E60^I+v}C$o#z1O3XLdzl&> zRHpDCcQb{4y2z0!<{J~~{$g5mc^)ek=>Df2aFbMLav8)sG{+~A>i}4cY$8;(NDi69Ep2X4$uV2OGFSmU^w1|hFA!q> z#2F@YvVK(ALgbpo1%uv`xqeu3kquQ9=q!?dLNQ88+Cr`;3IILeiQ}G^q#xm=3ey_H z&*aVpdd3A`K3UT5#_2KF=Jo-+ttyR^PPtW*ONXW@UdGQ+A4>a;6he-)L&cmT>;tMR7ZhmER?zvy+NfwclymUmrDle!d9sf#Vz0t2l|~ue`=a- zqFWqzrvDS4Hm}Qg-T?af4}EGsDS9uHS&81!x8qrNLAQ8s!vm5>yaw<{LgFDq|3Woq z@^A$@z3Mbm)&X2rX+9DxncHGoHU0UlTcDp9op8GpD~5%$gP42{-+3wrVg_xWdu^Kl z$nft1I3{F}vx44po^@z2uw}Z&*u9GnioOCr%~o`hV@6CBG98(MtviN-YoWuMT(OKF*&KCYCe7lTNcp!clh)Xl0mGW z$v{PcwbMC0X!htYnfgo&*QaZU7N_(;s)D!3yc=@|`pGMvyg&*Qr_>Y{IO@pO#vU-} zv`dD+E!jj>r3Fx@{30LWKaAY@5sEpOhG_VZ?y8`l8$GgBK;|>!Dxu?+!LRXi&Li>E zI(1=f5pGRDfmNEk%hp`6D@6MWeMl^|IXv=sxb0pwGY2a-CpJ8H33H z;dJH(^oY9s&lCi4!Xvn`c(5$X+^w~|K~G*h=lele}iWY#)E!b6M+deQCMnu%w{8iyr_8sEU81O3dO9~l+q z4q)b_*LUP|4IBffkwP_t>XvM%CK9dw?GNTkc4K%`0|VqzVDi_b{zRrrn0e4Qu4~#{ zGRf$oQ^uEPD8lI{gM9zRtpgf=ZKmnBp~4nBh3&!C5VYai;q#<0>Fiusm*1Dj7gCAL zB0oplBr=(x*!f&6=mjsHVEU+th!H?Y;}LSF1{+Qk$d^KGf5{>Oz2TvqJ|hfB(6Sr@ z+O!*?*^$#@Ctf#4V9aQxC9TmM{X3b(4f^oVZx=~UaivwPByJ)mpW*6)UNwBhUnRLn zxjUOpw`2ygP8o|h6X+l6E;KP>3fRb0hGybU7N6w;I&Iq9^Q9co0?Wg9@_mx41A6~u zTV5skXriEs68<3jH`q%CJ^954_Lj6Brxooc>oS;8N{vanZnuZo#)CdJ_q?Ly-HG!q zPG#6Vtl`Ro-n9FdzaS|^z$>%4WGj{kHSmj^9CZCR-!p0~Eh$Vb&W`w*#py)Q+wNqR zKx4Zl?vsMV@8~KdQ&bHs1`K3T{{y)GpvPS}wMjCFE1=>karNJPYa&An%SvUR;ywfV z%-heI*`QR&%7#*Aunhsd@8ruLl2Rl&IO_C=vt-kdypPdAPk*@kN0M9wtA`B*%pTed zq8~nggPC82o3CSNB$@5+9v$)Z(iieR$|Ec2_x^I(vr>vkdF2r8`BBb`&J&dSE#?pO z*_{{dBRQvplx8t6(0BS|;%J9f;04{q0s-CgM@vr^gaeK0kjoPfIEZ(VO-=iY(uvF( zxK|B@=Ins6v2QUN==L9LetS%`wrm%ivV21hA(i%l0UF&5+A%zt1O3aMnFc{~));Kw zTK&RMHrY6opj9lIFO$+|Ld#%FspT-hfxi9RF<%tOvej+NcIRliLvVo%41;&F&Vs&h z!{U^nIYXPxpv4kYzyNK{v31azy^k|CNkU{Qp$%l@uf1CY$<%HvgZLxrXs9UYP1DZY zLRc#+J822p5|c{$9SKqsT3F4e0yT|umj-?7jp_>p(($cqCe=)&zkm@H(?!&n!WlvP zKE-AgG&MN)qXIa$obI({o7dAqCx$Myk!)?ChXI@O7!|bZ`B#nQalA>JO-3~$4WRa% zsD-HLHEr{R!J2XmqDM4m$g%~7@F(24L4STzm6_s{m0DXi(6p9};mWk^?c5BYw-)|v zLUGRY!mi&^>hffBEZs9$-8&sQJA(u;xMj>rrQGq_N&yB`Up6noX z(eiYEA+8DOSYp_)vX)r^y>7}+%z~+eKU6}_$wbd|Q?wXoPzv1mpx?Tu-x%!LC^njW z+W3?6H8-wFUdJ60v~%6Bb{4@nlO0UaL+kAkkFd8F&27P_qbvsE7-iK@!(XIt+AoN)3pi8cr zYu5ZoRLWn{I-qtb@chbgx9+B7uz8?oU$N(3gfX}0x6pQ_Tp_+Bo$X7cO;|ubH6nbK zq5yybJ?EA$e_x;^!k{@}C<^psupvzU49v$HduR~QufE%90s*s}>M#hV0;5M2X)cAC zM3hcWWETVU;$3h2yYS?8R>RXWTJ*pusH)pVJKTm$?M`I{0iAK+BPM$6j)IJ&2Ymgb z!_SotH79&nR}=Ko-+ao9g07WhwDuf%qNSpGodgScgH~O7=J8TD*QhxhDeq$dv1V1n zKm zm}w_RIE409Mgy(?#5W2R(Tu$>hjtjZ9q9M2-u5*?bER!+r>17j{X<#1e)Y@|=!^GX z*isP#iWyO>WfTxWi-G>M`8~78Vwxl6WwfP|7R=PDCPlFGg|1O@$<`Z5|6zNL0(!uM z_gpKSxQ2B#}UyNFabfoq{(8pJO!BIpZy-8owjUB@ScXr!*)sSxBgEH2O| zm)vh0A6FehkosqYbxzPi6$A%*#jG=T7Y1py$ue>wG!sh>u{Ofm0NQ!-{bt5q=YV0A zk=(iXQZfSFS!E0OkrCSlo=JeV{^8i;ge%wJ2@ttV!y|>!Fvujf-=ODw<|{)2;>4tA ztx$8*N{cS=tkuFSvByfr{n2o?7grJVsI9gz#>$CF8PF(yy(JT7^jqwdf&TEpTQ3$y zUF8)g=7gQ6W3rFp_Fb4eC7*2Ig9xvVs0` z!?_0v7p`V%n6|8>0&S??X6woztrX`^!f1BjWP#!2>s%qw-#@j-5dtzL zqC&Km43Dxq+eooGgYX@SGeDxC`@H$;KLw#S0-+<0j-7OoUWzyP5&P1t1s(6$Hy=n9N5&{v$%A!R78rtW-hHS@>pHAZ#kEv4qcDhQS zi@!SGOyXRjP|u+lDedvmw3QaP48oDzz@Q&{<_{)H=5i83Fpis!vm=a>WWx%2Y|BHl zq(<&cD})11)EK!kRWg)3!%_yV{@b@76Trh9DTe@?{3LcT`(*k3oZdu{Nu-_G{+YXK zk%9j9$+%g*a-E$JZa3|O4pza8@P19*02&4Q_~{d06dvbQ;t^P+mo)Pswd&`n37vxp z`pZ`J8WyzUuKQmQSl5z=SR|caKGN+ca!uKFnH4G8^-t!#5bVL&j{6U2eEVw;7SMPl zUfE%6%+h|SfWJMq)%<}T+4#;>fpTq2m_J(ZZp2X!BfWdrLkB(gnDag=) znZY7O_l*M5;x!oT!C^fU|F~tU+IB|K+j5nLD>Bg+w@k!r<*0+TBA7JeC2y zoxK>)>lc0M4MB9aEW}F@sTb0*niP#jNjkOLUs%B>WK8YP-bSkh=p)B|->ks9LuUjq zj^lOFx#Jw|eV}6_2C$0730jC;vA-@R*C}DYDzt~Ij2>R4!=e{eDV^zM3 zmUL*vBPpxj#HLylGQ94|_7U``>koT;yujpr)8Togs2q)Mp)tP@j4oHOiv@c3@sFBa zb7OH_3ak_&0KS+F0_f*WXx6_0N z8_NRe87XGq!HNT~Ckg9;&ed`d1T^u|6DGLoTC;#p^OveO4qC&Tux*6xm%PyXw>47p zMP(T_5rc8?dmHs;jC7!vz44`bL0?z~ePgie*|LK^H|reZebzeI0h9TLb+pc)n%o%? zpQQBQ5p?ih-#77Y@)aykQ4Cj9$opbO0G*%va<|mdoua6P0uw$9_)<-SAVQ)gqtY0y ze1|(X=(aEZ>RW=_;Be;R2B8;*4D`zdKZi#f(CT~s@dE*$T@joIeym8WSDo1~dpkEZ zX!T#u+f4A>?&vbxol6a?C!yt;%P5?QCIP*D&QIPEEO&7ujHOqIx!OjP+*tg~%Qe!|`X z=#xAB&PaEb!#erd6u?6if`|^K;-o?8wum3|kOVsIg$KVR60I%|2aPh-%yRz$ee*-x z>?ZlAmCxVht8Ke>rB?IU09ttFcoTqd1B_fLTEH)oyEu?8W{Y|KjAH(Q0l$*UhGv7_ zbjwBm5|$`%U>O@nLM<5#4))5y8V;O-UUS)J%#3t$c@Q;$H-ec(VIpt=ddP8mn7$f| z0^qSu^JE~3+}%NMXiA%HAr&gpmhGSr7R@RQ$ZH($2L1b?KQucXNjT-Cp;n09+PuPZ zVnyp)aw5}`scfKi*vCdJNP*=(c>tPNO>?`*}mvh9!x=hxc$$6EqE1V+|{3;eGf*) zn{!)(o^kNIzY_#^uErcK@#%0`!fR0V|!+HEBr_{$dQ z;)tNj{e>+w=(`th`-I?CuxSm+WUIboN$u$g;Ej%5%aIGv_ERo9NI>1mqSKh9>&zWu z{RXLz*#m7lW0{F&E-K##F*3uW2=5t-7;&FtVS+yQ?=RgXeAYVXv{I=K*u(#6N|jc8}YNcqJ7h(Zbu>rBU zSoY*?$&RfLxeAQ+vn>SO`>~si ze^VDNDAhAnU{cpD*pmGW*AR4e%koa)${j!rSEgF-qVO)uFOrw=Wu$unrWJ zMWqOxbMR?%W({=zE6zGaSQ}gTgl|FSl%H&Qf*FnJmM?RS zK?{4FV|u}X6*MF~5en2~kUKf(vd8Y5FYqzqa#*CdA_k z%SBYqFzpbNOM(Kc@h~le!Tkc=a@IjF3xBS%xo8wa$AuJr5}OlJYiVKDFqdNHK=a4< z8rQHAT(GLi>rlb+^9EYY1$UtL+%U;FcCHAx=EdxF3=JnT(r>baEgauRm zB`y0X+epx}f3n~#fpeo8E^pfF#O`;RZ(}XHBWm;Cf3v{^-ErG{?-68o<-kSe7FG|N z)A|-s(<*BwYcYZzck8YR0d!4(3#fjDcCx@aJx${qngsN;hX$??tV-%fQ^lc?*(v~m zfTh(vuH0Lrfp-68v`Wz20FKL<7NT9#NGV=Q_8p9Zo_);W#_r8`jEW20ri`ep5w+mn zF072XVUf?X?+coFd2}r(~f=-i$hzEUX-vv=@_ z0{YB>cN-%aFKzMVxSliKL^iRT?i6ep9xkc{8Uyt-JHw!#dT+gnskvPdi`AJyGqR9K z)u^l=8?0B^pn=|hXkipdk%eBPH@Z(ROAPlV6Gny?RcQ+W`rskgn*eB=!(R!O zed0*(9?(`Xo1;M@LEBD|K%J*HCH3$K30j!4$ZR8UyG=<+Xeqkakgg{Rwi2x39tiry zV`>i(0l3Dz1WFEIslbzYYfpVAFpr>LpL?hY^|-BNvdXq=>OEMeZlfJEIHF9`A8R_@ z#H|H-$IZ{4C(ODN^AgMz*%WPez^-f~!IoWgTY=vEm+Q=;v}+|xkb>Y=H*Wbga4&Py zgYJ6S9@WB_JM}4n(@Y_lX*WFIvpZrRF!^QMQD!H%>#dZ4>bL}XkT|jAY~{OfKV50i zeg3rk0O8VI&L{!Y%Ng=GVmV`gmayRvfWGzblXezdHzp?lrW0v@vLQEE#C~sg+V>n; zFhGLNm^HUWAYJdi1XAiA2-Y;wDHAjz==Kxt|FIyBp*!ZVaNya`;ISL@>KlGFU696T zY+)8nf|G@Ag}=|n4fLHWjv22E1vE;3{>8lobn)k&GtKP|HG*K8#njjh^snR*0`!UG zkAEt)ZXUzB(UeQwu#VjnY|y01U88m}Pv}4&?S9v+=S_18pzsI(z8T_l8b z4G;OCLnqEM6`SHzjFBvEg3hu(V=|!IZFS|(gq=tjCF95qqi5};dn9P%DVLj2x2vBl7gH-e^p-Ay zKFU%C{qj?b%m#jUAY(MQy+Q_9r!k7~5|5CeU(J1grPS87no0{1xibC8IO}SRH17@W zevAux#&=KNTyWi83nrhzZOiguIrAza@YBH30Db!_!)Et?qtns`!GP-l&akeR@l7(r z`=3~mKrh;Cwi)jhjsb5^Vaj3ulCeQw`c65YmKw=At7TN)KEH4%_h8U_zdPxBB4F2` zI6(LjivBjU-2+YjU_*Ij57idMau;j% zdHs&MPlFC$aQ!c(n$sP{Aj?$9Wz*!7Q_!NA^WzjzP8XAb!Ml}VK#zZRD--o~hu9LB zAimdF%%w*|O9Cqx6f}0peJ2ZVGb{5(pbq=vHg*HE~SW=ZWC30XGh2$i-jl zhmIHC!vi4b?~Z!gEFZf*X$fT4x)fc3LJfhXTkEonm)J^!&j02aCMxIl(GoaIhPsu= zk0keuW_8xQ?nGu4^hX+gWjGm{2ezjAm6_ zb^v1bO?wzkulp5u70|;rKj$}s95Ml6WZZ$53N8v+%)JEk0VW6X1?c1N5tyN6@pr{P`^feF^>Mn_;8S`PwjjUzk#^@rFZy}fKH)pd=^nm;yjfRt@RB~BP zXJ6HIfg?N`g8p>fYrho%?#T(w)tA8)JK|Pq3zx7N4W7q`Lrp+md-jU`B(DUPgPQ1#C(w1{J0*1lN~JNcl}<88R}uZ|nVTIisQZ?1gpW4h zRJ7*ietHjXKvz6*#JiHOlp9(W5m^LRt;l(3>m|6kkG(I@%bxz0S!WWDAgH62F>c4O ztmgn+#(<#Ty`*J|uqmTjG+;1(hv2dtxB+duuJv(&lc`WN9F5>1oSWFrfX;jS{x1uT z1Q?=mRP>sxFI47Swo&zF8UL`rZob3EK7mt}^I$=XIDdLfn98A)>Zwm=2-+lt)9*#N>8! zxL{#L#*~w%+C_aIO->(&u>Zo?pf4S{<2{YW%fqCWM({Oweb)f9IisS-JK) zG)42*5ZVLW*q}e&{w@>Bmz`139Cpz;vz)JF5W@Q&d%K`VtbO4-!d+=c5fc}exQt`; z{=l&Z&}+7M%B*{dM<4KIaM-_dU|!ixTPx6yzw?tn2s=|t8rQ(6n}r>aiL7s+H~(z@ z^8zCNQUouiH#k6Va?^qKee*Okj8))9so1D62kqaMJR=xj&>cR%>%GEF>A)trg3*8s zlEct0j0L*&E68g@P@nsmp74s!6oRf`yFSrv{dsA zmy+FKR~`cMdn`WC-`@FIvs7KGtEHHtWHw#{w=3u$X0AM1Bw0G>l;W8NwgI|(Q+1knck+?Y5TLcQA30TUC>XDNte}al zo~)d%2YIXl?VEMP6OwbU(wxd?0oT`c>e4`0%=yI`l4o*B9$A^SN(I14?3REQ{#IoI z(jO@SXzWIMd*kXq9zX9*DNyDMQjD3K-9&GcViMhN%Jo}Gh7WTA`gTj)90K?~xD`Nm zI&+_ylG@|cxH6rVht-Ku`dpFOkb}IRq%Qi~DQth18|c=tznj2-c*r3}QB((;e$dan{;h7|Z&Eq_oC1HrwFABS zy%)_rHe_h6+Noku*fjRwL9_S$^)FJG%U>65OQ%nnvRQwsE=7C2_}Z8H{LsZ*KhTqxpL3EVuA#*I*+>4W zbbNp+slVk)XV&FUG)aLRIcU?(3I;}_@)*nLG7w8&58@F7^yK1JvjqfG!}1`( z47#P={O!o`8p;pmK#zZTU8~^22^|k^G-`@bL94y@E)i7B3dVzKaSI7v&aD9Y*`7I< z3LGLdUOo#n)>Z(4l^dL=9Ave(FQ$J*;b(72H z>>8nE`QVP>ZP?<0zPs5A#-L(Qj4m2GPxQwWXhJsJr>ObgIWr9D}#Y<_t8tgB4Cjk=CY^`L(rC>4%!S}3S7lz z4s^rAxBWzb5$YbBOZpHr_D6)Po@2EIEqrK#nM`0i&lsR|fVVJIMxyo&+i%}}nVFC_ zj15a>01}Xw!6Mx*WSO6mj8n-79nBPxfa&>4fjN8DBg8p{OqhA-? z^5)4f+C|G`*k2$I(CTe$e?hO`n<>Gof za}#aKq+8kK+uva5(^N191khW4o;PC@B2LkL(qxaDznr1@vy2G3?A6E2jABYD;)wo$ zBZZmitNAFiZ0Nv`Pvy92X+&ol0 z7iuMmJ-aTi5W&+1UKa;_X5PnV2v68}Q4vUH7zXJv+KmN?gFd#?=&&GR^`{~dtxl{r zDCe_d1^Sb-&%8`fA_j6(G4koPz)_(;vXDW)u*dol0f;bc0$|#k4pFEtZ(`4Dl0MXE zUI2K11_u53OFJ14Il{`91zt?I0fZEFJ&(qq*WGoZ88;)0P${fo&{2*7k~mrdboIX% zm>Eul5h{hGue~{+5l7W8VnEO<_jzcp$TY%Olme=QaE4L9eVO4vy&pXJiolJliFoNo z0vitSbqox8-!G?|K`lnV%c-DlakJ!dFzX-aU8mlBweU7|ObF|HNZWCz0&V!af4_iK z>QqA`xI0m{S&MD7V?S^1+jqJkO)t+*6wJ3-cR~9Xp1oFJ$l{J67_`^cX{}G7Ke+$9 z-<8}^Ok~re19V+t9c4RsM!b){eU&fd5+i_FPeTpV67=$GzPF9QM753!(*ZC*oX+kW z=>GHnG+iK?BkJKoU|p-2qf^B3e1SfcM6rvtbPHiNvuN~KKbKXvKA`|;G#`ve zxo+6#0vhO8@6fPMM{W!_>^#6hKXUT$-NJpuSUysjd)g(C_YE#AEO0^3zwU7}mM^5= zVYRP}t8baZ|go4pEl2GHfK|s@>LXCoLM`6Obo{k1B;fqP%QSGX=U` z?x_(A_70!FWIsZq@jZ0eZ>KnqAPd zj+?fpR2Z@7jb#^jS2G^yvK14}`I(5JU`!?*9r`>wNTC0G;r@Dv}I;TVXK1bb5#*h4w$-^aX`Ow(OJg|PQ;{7n9`q( zV~H7O(tJkF-k>qTu=sHt3QR;se1A#ug-_xc=E7%REs%lU)Y}q@@o^2i4McAsKX==8t=gi{Wqf70$ zjn-Mv^XL82xQ!LMxP=rP{RNi23bts{3!f0KDvZ|_77&)~pt%8k_09i&RuC$vsz%To zlGNY8S;?a_=qbMsArZjTpEW&v(}(owU_1wbo&Yay}NKz!Q5yR^R)2#;llv3O*{kGYbfGub=;QAHk{6V=R``g1W=kMQpM_zrAz&4T4v}jnR18VyQqC z!Y~f#Jq!x^#|Iag1(ApujdU6fsx}a*KhcQOxvrqGcW!xDc&p&O7!yN&fEoxR7eel3 zGXZ+!v?t~WaD)de`~|=~L)J}V9)sU&xZ0q*-T9}b0vq80m%|CKa=n223-(Gt z7am^wC&8^?LIr_%4gLgHp4}4A{zX4FE0h)bcK{GSg1*QW`~=?hJLx)ut{ph(T;Z)k z{|*2w-W;ubjawb`CmpB$P(a7WWVgTGe2qM-_CvfrQ8Niz{C?Bkf>%K)Ehdj1P6xkG z=k52^aG(=r?`RhD>dWg6TZ=gEhvC10bm=x433Sib4*Rk&HV!1UKVI7)AnnKP3OeV~ z_v!?x!hj?^S^UgnL4khe)XU6(R6)}O1uN{Z*0eJwr5ut2IcNpicEtmK6OJkjZrJ2b ztHKPaf1z@}_>dM8=zgEMay;$FPz@tEZ?7h60bGpjK4{`sPybXntKh}ydwob>`-+2R z!X8}qb38K$+P-AN_JUZ!on}N$9PNLawI6i*Zg!p6B!x1Qb9Kk81mVZ13mDJdn$#M#AtJ+x<-cwvKjiapPp_9klXO281$S| zx9pNSR_H|xsp`o0sc6%6D=P!&&tALpZNVB_vm(^AiR%hF{hDXYWTS%L#EfY|pMgOG z3~=T6^`1FGvk5%|h20 zZTQtc4-=pYHbIG*_Pf%j$Q<)>4~q+Q*I!++g+Nu{iJ`Q__kSf%T97Xy{IAU>#N$Foug%??)KzDg$JLA<=uuzPlX1*$< zwFgh6LC=fb|FTr;@bcQt1J<%EHeiCQ0)3}if5eSqW%@DLTgsvbt$XElGbC;Vw3>8i zM5k4kux$oC{DQO1)VPA9>~g)BzT7~2L7j)-`D-i=(07L~|BQ&E!eFUn3I7B)%Enb- zL4E;o5)T2OtsgtjMBPcX!>)G{Cm2(uDbh%$>Tc@24;$kPhY zy$d_@oAf`051KU*lwMuZ8%m}HsT z2U`7MG6W8rr&7~E&q4owUDj->9|xp-q(|||JcG*`wuPXlO;0~2TtmC5sXC@W-A#QV=6%wqXXHKJBo10jnlx>WpVz z70`&tP#DxGlJ3I}>_rR$d{o-Zo;=lkIq*E~l7cJy}s&u;mo@EI{|mhfqSc$2944dAab=b)GDJ7+fmUP!+~ zy{iJSfpolw3}b`dwZ$7|O`3YmMqq1k1j|>ZEUE}Gf1)X@=$ITAMh}l3HP>Rs@`^wcpp-rYtrx(m&Zvb?sfnAIb zy@=`(68=UO1NGcbI2f)(Ns zaI<#NaG*!#)=v_+hH<{`JkUHrKsbR#xAAz9i2$=7%a|$|f zLxX96>WYl$ykaC=@1uDKz3q4N zzAXS&H#HT{`@?YFp&$G`b+sp3#oBLTeFI&x?7v z_72epzrD^hag-ig`~@H?-mQxO-nl#I`hvFXJmm@D)AFvz;4^@B#{R#N#L-_tXEfG+ zPJk`HWei~TA=>~Q+&;Cr1_gcTwNL$E<3ZKYP#3h8bp~|C4O`3?(5VqRE@+<}SLix{KK9yM$4MbaY@+O3b95MwBcLZ_*vcar?SYBQjMm+Ffd21efd7!T>n6*lHnM|M@&kl1#*py&fSPu#o!L7( z-Z)gutU(|0c+dm=;;rwP0o|@!c^G``2`J}~`vGP^CqDl~T$r(DfRw5nGfl*rw(toa zsz9$^^m7v-SWT6bwknUatg$PO1G3En1F8NL1^Jd`>B=3t&06``h%xym6zP1O`WTe@ zMxNTAiVFON#Q^%99S_-GD$qObf_d?N=d=0?bQj40T_ppd=;zk0 z4*Tz+^}OyU+g1loB>`_ocH^TyPoQX`zq>j$8}$bR_(DZuj2%UEdDWy%;* zSD!BBN`S7}@5w$XWAV5uVSHjl+am6_hyA#P?FZVsaFSZspcE5{|^agI=K zo7xw@-S~-K6OtUW$R&RN8v42$olT)3SXoP_UsY)2N4b`udpv%kaoCO-tCnLGS*d?~ zm^}~Bg*VQP+M!=YvkoL9W!x!yWV&?Cg?Em>odFXyGBsR&l+l*4M--q0Bhz#qnLyiS zZg0*@jSnY!WJ=%gSfkWx?2!rlY~sjt(KG)rTL8x%GEm@HL&n$Ho`W`@v}KD_XY3)v zLLdK-G4r33PkvuTR30+UV6z4K&)tgV_L{MW467EEy2KZ^*LD$fxBB0hslnKG5e1ZU zN?r3}4;fp|d1_yg)7S~Jp@oe~8V%it${ zqXj>Y=e@~nA)`Z@ud`PUx_0-5>jc@lY;t70$iw})(Gj&t!(Q5KSvi^()I-L{FBt93 zCkE(0YKx}|D%;0kqEURpPXtzM$4y$o8i6&Y9hr zJ|yludnaBg_=mp_{G`9Ox2Q{mAb!l#ZO|Lu zzVVj=J#(X=Sq}9K20A?RUK7*VmcW*^G&Z+&HFt6F2(+`c%gj}Gpd_|OaRFOf&`1BV zmG%A&3$CG~Wyv`R3N zI6r1;`Nji@p8h4U-J1?_d1_yTC(c2soRtJTIzB>IJ>^Y0{WOJ7vg0emdC!qiIf+-D zgrY}sskL-huUD;#9&Kg_&DV(fzP&e4%&7aMycB&4F_XkTa=*sZ)vGS3FEUIez?}L5 zwLGa?kjg9J9ZA=ps(Z(4x_g`28+#kuTU(pkx~I;oIt4rs6ZD<-e)<@8P!w&TOpj8< zYI>|I!@X+kS*bORlJ}}dxP9^{zRIgk@VBhI`Ci6f=c(fJBJCP0`Mj#?!cZz-x4^A9 zU*J_I zv-CyYVYHRvZ>o1vRcgSinaCVva6U*k1a8_LDdbBvA#ask%h*!^)KBM&QkkN!WXnxM zl`2KhqM19FZtSM^T%5}eQyONgrYg*1tr3?!y;rLI&`Lt@O_QzCB3aFCB^p(;%Fz<4ozAP9gT4<|Gj+969j!d3^F(M-h>3DSP%WYi zUcj;zk818n1=V6J)6;6K&Hy!3J=94nmaAq}RgFpESf?6SwzXai+ho1$fCpK7g`q^j z8>S1fJ=z=M_4ytyJVqC?473+iCtn|%I<=~90e!QzA&pZMN!-$yuUQpKWR7U+GCBeI4d^a0^V8jG1=;sC6A(=~QC^nvWs|6MOwKkCp zeyq?x3PZW?Y9?;jv`}H4&$9%ERDoKe$HDV!~ z%pzxZds90oc_Yb1s$lv{rC@Q==098?OKFr02dH{TpTHl=P~%r0Ri-$yM9D*C)(^00 zGu3bQqv$t2lvrg_e;Ev@P-B*gBdO?}Ge}hWlt6Q;l}caH*Q#_LFdh8GI&GDN_jHnY zh!hjaa7v5zg|1D}p>*|IUF@h3=uDLwCe0)h?@Jyw8ubsQZlylMtz43c-_Zhj^Lo`c zOeaZW*9i)u+qr3efxoD$(Z-FnzLqfrs}kgBfs8&*q*%=rGq|~h?r7k9F?^~MI<0wK z@&?GXDKxFrl_rQvuAs^6dc337TjQ&TtQF7!`nW5&$*)Y%2b(iA25HsEWK$V+@+#04 z*1TRdvi`oZfR>+wtA`* z6OmQ>P&KykXG>pIHO>M%mM@|y5sK^RZ0~Mv>~3z-KU!8abT=C|@Q3h5EWIyb1;bH_ z)U`mei0~6dGOE2#sT$WjOHW_|e;lqPIg=Qe*z;F@LXg0-eEQHUGjSrNFg|=Pm0vR| zx8;!L&kJ6WTNtd0L?=n=(bjQO9E7Cbr3N3G-k2iuMY`G|H)=ge`Z$cC&RgmVs#=Dp z61^1u!NzO)I666-j8a>roDrIgkO||m$nmrg;VP0E)5CHVGAS4;s#YdVby#Bjrb;}R zgH(sUY;m`%^==oFpQh}C+{z013r zJA0d&J35;isXH`5D?ML*;oGa3v(a@x6~^X0l^-ALl{rKgjcA3k?MoAgF`8akVD7Z6 zSk$bdW0ar!bD(2*ZK<3|;wql4hbBn{Udr-mGMCX!DoFXgjdq_knWBUhex^ha?s7Cx zb?M$}PfuJymCI;ZjEKyZoXP<>bqS+|`cj^(OQtYT6Pui;ki+ekPe~ABRHHqfEGc+_rwBmS`2>vA-=Li(1A7O5{2}7fr zzYNe}3vY#X{JY4brL7_qrVtj)IB23`5$_Nh!oP5vrt)3Il=`X?-MU6IR9%P~(l>!? zdq6MCw>`9%O=K#kD_{oQK*oB6H7~dZA||y#jgy2zdG;^_i<`~P8HEA)tq>xC^Of|ZAm|zQoT7k1hRSFh6>bWvM5iN~C9@Vj;zFP66iZB+F z#vynb7P^VtlVWqtf=8CjqHAp% z0PcXs`L;51S4KS3>dEMS{i;~=(9Pra<#JkIxmQ-qWfd3M39a|Q*`!8FA&jPmq4JGU z+5?bQFBgoh)|;$H0gDxlxbCi{{8TU?ACPiKv1O}y)cbM@Pv0R)4Ht()IzOCPA3Tj1 z0vv^B2-a?juyAfm-QAFhWSBBVO+a-Vg)?EYsDhblVCyNj@uMczsu}mPIZw*V_%y{U zWHI4Gyh`nZrBJ=neZ#>-1Z^x1Y9=DEPHkQzPp5h(pX|-_Xl;p;so2LxF$GR&SwXSl z(^s_ooUSP`o5;{?lfu*Vh%R2GXkQM?4;gPp8BTRe$Q;^YR$drp<-vFbsMC|2KQLao zNvK_o4jdLpaojD-jOB;2#dK1ZWYld{T2v%YkDG>tMt(XQPifhpk&W*oYJyj~h;ml3 zOc$me@2ZiW{7R9iHv3T?Roi)q_6r9HqrtfHHW+ClgXx!%V2m!Yz)dpJ6yr2z8pjyL zO^q?Kn<9E9r_t9j^jfFeo{?;XnzA|rW0|7A_&P6r z)Q5z4xEIo&xpS%Ji4niXDru@W*Ry_VR>tQ~c78zWY{z2o6%>s-wjxt67@safltzk&?pi5WM3X?XB z(4MZa)TlLdelPCLoH2vC-7G8to4Tt7SLM5x7OZz)J4Fwx3!GKqWy_Ons>B0lGeN@~mQGqk zF+(K}baeES_BUcMQ#T;#?wa=1_}b~~w;eQ2K_Dd+Q+-!fcB*J;r>AFfelqrJ^!Bzj zv^IBjG&DB%_R`93j-i5r4#&_RD!o3|(-WfsCPoNkHJFV>bosEZn63{tB&q>07}`r@ z2ZunkKCn{h?`8UKi`D>80aHym$ zP8Dm5vrj=1=2ung+}hMyv4G{Y5k+qeQrrB@ZlW4#o|v%Z5d!`X9wtrBPr`CsB8^R8 zqqIJ)FYol#5;T{^vf#O2DJynOi23ozjI6A#uI@Qp5W1_1SN5*)N3p$B?a?p=Qj_G# zAEt3fF`uX3rZ9daZ4^1uivR=wjiH9K|4~t6XJ;ib+v2NRU@C7KUhDowdR&+RIGa+m zEZFOY?Xs+ABIGiVnC;ivjZTK1mN=B9?{lN{mBP?tJwApWV!YOmRKcMztR3?+drPzf zMOFiOiD+Ew==9C}mGVxey#V^7W)fjE=6ro=R+i z3@aig6TRaIu#O;(!{CM#iM5Fo#XQpfM2^GLS%_ikJn;8=n%Y}wgSgs+RTG<8KZAB( z#g=z3t~&&2sqaf|F+L$*-2z+%o=G;+zDk-ws3+Q$wusawN*bT|bctq>EpM4H z1{|)^8K8EFz=OroICz00MY5!-XqO7d1qu{4=qpk*hPT4&@CnMrs2Xras~@H)C|EJsMDB{r;ba6=W4 zPptKiZe51S8wEJrM`8klG16@RwJT`rk%9=3Seq5t)EkIvoY zvSc~MfV;6{<3@VpHo)$`);gyM_X*W&PFG4Ns z$|0pGD>Mq2NFG&`s%urTY{BALj;CmywnE_o<`l0-mjB(OSp|*Z-9*MKQ1J{>y-gNdd%`)wJF@c}DObOOC_Kg!JgQJlyjG3O>B5a$%%te7nHN*ar@*?g98d{SEf+v? zfRxl>Ty;R!85odSauIw;-ZmDcG6H3`#}sJD_6(~DaXF#tw}DvsHv}76Y>==?1$pSq zO2+z6RXKM?Q7R3c6!IvWNt&j0kunUTVkSLg^1fCj=;$3^iP6(UorIPnKzK^MSeDMI z5!651ckHG~Fb8l)TS;iJU+iI~eN2E=hueZ^uqz(q5^4>${pCQiN0 z?b=+6Lh2gS2gNKV$JM9VZ3XY6^i?Z|u&64bmsDR4tC4_pNGigvmWr)JPPICeZmqsz zu;yw=!>VAY8$6_K05PxTFuKSIhtd{I&L0++zo)9T8Lwt?ekv`{VA}|`!@{82O;WOM zJXJ5)=nf`pbY{$>s_2#)XAR&vR&-Ihis%_6KQ-c+ZchCK5uYdvKnH8Xdm?I02dIh} zfq3d)o%u(*JZX=Hmn3cT%)`1sXtW@PHLpY4ig|l1vNz$x`=8q~BQsR2@%X+t> zv?i!bThtInAhx##to8j#d7tlf#pC8zjWG(L@{! zqjTb(n)Ts;n7f{S+Nwh9 zo}r^-DUQc{DaY)7z<&V)lL0GT|HcR6^T~0Q3=T_ zDAQ2kJ~Qrys`a#m=Ad23tJ6^uBi2Ur<`2eWSK<-nusf|=6Lt01Fm)&lu8OexT-wLV zMH}@kU}6U=XhG13x}MYLdo{F+pMs^LD{9fpT7e33pc&z_DTRU24!5Lel8L~M%QRNf zO{;J_up2y9wWz4xmL?j$sy7CpR6oo3%G#WS+BQN-bvu_#0LbJ=H?LMudmbh_D)KcE zzf$iW6Hv4Zwsw(LQ*6AK>~@+?c-O>mO+<{Y2kh>pKj0e8oon7L?4iXdY=KT?2D0!| z)h&Px-Ah~A7Pt2{AKguNWwx}pO|6erF9ZzzUq{lZF?5Nd_?v1K4g1o}01m4j_%kf9 zMn$Cy8lF;H`cNWWRSni1_!UvL;MdB$@!w&-unq_D;OHjZ%SP+{#u#e$93O>2P_`Pe z%jg4q08UCyE8R>9do_uW5a=Zr9Rb|AJ(*y>qyFm2Od?#Gc<@qpd8JXi5E%|GdQLB9 zXp=4_QUGGoH18xQ^m>XagF->ZRVih2Wsbg0;6Wawj3f`vqW5}LoH~Z<3=VoSm@P(C zmT=Vuf7vdLDPT@%W}xa+9NVK`j-H#bEOWS6OB=R)RdPwN>BC5-yzx z9`2{)`pHQu^cS60oB*6_hKe&nxSIBUvufm~t{{cZo!i~p*4{>URS5{ajK#FyrgkrK z29*(3Lti^(`jli-<6d+#bW@S`_8Z2~_0SQbFw5kAsa&emvdl#1#jHZJ7g4B@RCHb{ zSMo~5tkO9%Y+VQk`W3DNT{DY{t176AU}3M+u~W4GA}^HTfGpHrZ=G8AK@K$Zq%w5F z6J3WX`$?&S3YqSc(aCGob`nza=t}jc{X|a5f+cU&lA3yBdZf|g;117?(s1;J$XJ8* zP~8%jI+5bs>MvMYdaM2}+ePx`^rSu+NHLQJh)j1Kt97C`(1-4smEtH;l%bPFCJ@Qj z%68+XQylJsYN$rl>D>G1oaRE;cUbWWy4j?ThSGBu{L1j}hqU(*cIZ&_L0R@6MG z9WhabDsDs*$bKyIGlSS9>V^7}R~IOZWuWFMDKi5lFbZ5XM_x4z3}QFr?I^Ks`_j&A z!HMOwwAS#-8*r-A^x+5v-keFc1l`+A8+z1e-J8ed#x<_q)OvItFH+t0xh7QwR3@xa zbg^km+mbS^uLlCt<4C5lNwIoo9yy-luoHiN>)ouq{BQ&hO|P2ASOb7 zv(2K8P+CW*YN<4)dp#uRG-;Z=3@}i9#K;t(ZV}ypD!P%SnHgn7nI%%B(NOJ9hN2k* zZS^<0c*9hTM|BR-tKlsqPupf~L@(nW#g4A7FWuv+-B`#%nH9962Pkak!Wd;m9q<@1w{%x6G1x12K&{c0#3L$1F;69p;bK^mO**r}a#u|4hYys+9v>Dhqo?K#Nc`;)G>wYCX%c6oE%- z%SdHUIYD4?gI3)v)2vqT8 zHyXFg*oY;Lm(mP!t^`thee8&;hbU9}rCk7vk6&pOCJQG?Ri7r^RR$SG2>+t`2TPJofm2$dBD`t@R_d+NQ8-l(Qu^4FM43>y zX-_0n4|2c_sv8_N_OOT%C~GX+cRcO# zrJFEt4;|iz^Yr$UpDG{u(d=92&C7;hf>nIoHtKUWh{fQ(If@?Pf)W(!-LH2|Xwxa7*D*AMG?6}*LNT1V zbIZzptmaxyN-7Oz8p>4|)&8pUTOw^Q7TO0E;Z~A-#PR(WHB};M(22%WhP>od5_b+J zvlR8f2}gfDeMt!GZCX=gwiRK>pqwU1qEq9ZI7(@2d7z?>Coq$Ot70dWAY5@db*GNT z-OETFg#_{|U56)K4Y`UX{#cSeN1{Gm2HA3`M@1Yk3hTzFHD}rm$H~~^kq>d{W^IPF zNV!#d)evUpuDXX#Egyu4^e2@20f{+75h@p$Gc#N%Yeu>i-tkZMRoz5;swH)WzEg{u zy8Pd)vSXV}jkReQXEn#U(nBp0iexua2QT!f|I$nTXRqX_MZ(3j1S?;hNvgyqZmoWi zKF~j!ZqWy{aQz4w0es?xPCa7rwwFG5q&`-Y#GYxLs;j%9dwEyy^0p(}+E=zwdUC&< zH!W=|8kV&*(HrVA&YP|yTRJ+L@rL|b=S^FCZ{yO2wk6G7^pe~^=Oul6MrE2Edft3= zV{=D0t#?zNIiYvUTH3nl@j+TNqC?dP#usV6hks#@$62(}386dE9aT<(G#I3^5hxfH zRnmy1ASr#^>yesKRgT@V@W6G$saF9PD8Rm~M@O}*X~zKVx6V+nphy&kuv%{l*)EEB ztMD&+9K9Pz>s1ECi*%2t+RjiSpglu$r562MI6_7DYFOO)Gj}eX;a^@DIHZ+6x=QzM zQ^cAJ!%~qcO$w7zObI-)T7iBp3iFK4<|VXJ*xTIM+1{zfTva$CLHw~1WrW0(=#0ux z(k8gF{OZq%{I6qKk7-(@p`w4ZTS!E2jTTBlSkoi5gLb!> zHnW?of`X`q>1gQgZtiUBZSQPq?lkRLQDb^(uX4@*$F#=c`Ty4(6BLsTNuqJo{`?3B zAZ#_NPN#-bupD(WVRV##NxxunqAZI5kF6yY%Oeg{No-z}%gYC6m0|cmt&7X^7+Uh5 zWBWg0VYs&RwfZzZK4=@7etx#;%F-)Pe~%2tsgC{O5r#x=2-9HaUFNBR7})ac@fhh34fUL?7> z2wLEtf8LQKPL4Id(yO1ti4nT8Q9gY|%_u3AJ0xx*Kdg@x^%|shka&(6W~)+*d|;fZ z&=Loggymq0Y|iBQN;~OJP?~~pvQ;xEvOxFaWRgwtR#uZK6)h6#Ei#;%B$AY5q}(zG zC$&;LO-w5I|51=r-Syof)_3XuCHbQ>Q;B-QBvTeMu@4Kq#QoJ501;REL%n8m6mzV0 zx&@I`d8(qR{6ht4FmWKUsGZ}zG)?Qp1GV`ka=IWwMlB&OG*ihu1;8{{wZ1gY(cKc4 zeV$%dj$}Y#tL5Kdvy)<(ZxljfQqRG+;HqLZC}FNQnNJt%cycXClO|^3io{M;KUXE{ zPV8MheHDEu{GgH_5yy;IoY74gGQjnSKQK`c!KC%(cGza zx>JA?-0*SPvg{acnsKj|m+e=}B}w|sD}}-_uHr)Q$@Fn>Q#R(WN>x-v#~-Cp>TOTf zRTu^v{Z}CVn4qs_o2h#^0+GtAG&R*Y+D7H4@{ROibGnCxZOz2sNnjxKJ}O9m?p)c$ z_A#{lYW!zL-J!j!c})(ePP0X4ZKyj|WhF|vS5NDSS4JDBY~=2J>Pn$VRwG}^kDbc& z#n2x8ajQO`f9s>6R`5HVo+Lcpq)Ywu$avFs()F&x<7T3Zq9MyisC~!G5v1&)uL=wm z`x@zl0Jc(>5sQ_+&0ohK2+{|3b0wKNh7!4Q@4B}??6+@AKN-j#Je{F2$l3Z2sY166}4i3|) z0`%i)apwY9O9&>28WIk5R2mLwoMHP!mOFM}{mg^vXOp+#yyHRw zMX8($v{KRHDAC%LG+M=gr7;mSu=$y_H8>U9+t@`Pr9PUzh`V@s_i{3ttyHAGAyN;5 zG+fZtkJy~j+}p5hnK#8dwb}Z5uKpeIN!?(<$Bvo02XVX8%@<~1g?u)g6n?EO&twI+_w=D45RQDl84knXJ3cSvBca%HUi!RWAb zGD|ms*0@~^%U)`;d8i*y_*Zo)zy(BN23^3O|MT;q$Y;@U$kSyIY~y9a_V@t z&VRW6co*GIDRt6oxj{%sS5UcId_g4LX;GjcIr#}%Ls#m1BhBLyMI${6XRTY1R3Po? z*WJ@W*m0i?<(k zai|8%=%|^k-R8qvwwFsz;bA!BsJKyoczvVZVf}o?%Hl*HjhS8t-6NCfr)7uW?hy6u zaFebnkxLcxCwiSl`qEc^O)5x7OXE_5Fi*8rPPa0a8crtM&0!tUjL~IKv-)Svo^!~| zSqCTjX3RNo;Gltlnf{DJ4?1vW;@|^k_6;Qc{>02#SUXdbyoGeQlRo-Wry&-yQtMx; z1=$VuXx9f_C_@`+%_#tsskZVSOxtIt>Zz+tX*rh>d5)ygPhY7CKH5MvG+zQ$K9;^i zo&i?U!&{YO=UQGipQk<)cJ`!-8PeJuY*xG%$heUwa-51+GY;OIGgn+I8v-!ieTv4I%FE*H6ts@B@ zHmW0BB6gh#HCjJUu8>|mXil%jW13rO-42a&;iQ`Hp%XVJxI7T&+u)ncqkFTXwdNi& z%86(y8&m?&nS7ey# zr9u&z|F|0HkzMy{q=kZNkUiOZ-3r(S* zzir}Hiu3vWa<;L)4)y|Zx;DI62YN#ZaV-Q@8ugL`M(uu)#TieUdi?{g<-2`-ER-f6?0G)eBg`CE+ztX7 z^p8qBoJzg01qM&zb#ef`O!Sn@gKhz!xM<%&a5Todv*})z8e%PO% zDpP-4f3>$0_yA0-e)(RCM`h6;&y#BIX%W~*EL8_&UguOBums=w5 zGz?Ni7$K4Q0CSY)(H`{K!NY2kkoDmQ_KL`c7Kdu@Dz{5LBVx0SaEG>z(ENU*`6uM0 zt%mfbSmH!GkOA&DA0X8fai*HAQ=ubvyI{>QYfo@$0r^mkV%~prF?l!mboi@)qzcz{ z3k5eiWfmbOq8ox~ji459iA&4K`jz73y7 z=^;oHk;YXsEz!9)GSUMz85Qr2w=^T4Y=uN$)mgI!+t_Tw*$X{qtNt)wcmvB;wh{)U zdRwnzBP%?PLh*G3PY3VQYu;{ zCL3!+)s_~|+KLmoBmXVAj=-p3g?9J@rg4axtux}>l6>xU%*$7RbMXD^i_^*Yy5jC| zMW%ffbS3Nx`In+z;ML}8&jl?}*_VD39wvl|H~B&=pvfg#feyeu=R+B7CWFMcnQK^R znX}1Z7(pqMNg)lySW<|_81Q6WVlk?A0a(tVM2pzwY@p0A72EkaoEPs0a0@XZM@)%k z|7t)Fk9KJHlfk~~U&*!I_huVp*fxCQKDQni)cNGSIkPye;*N*&3l8UF78JOK;~Ogn$O&cV-&ERg@;&uz#vc6=~JWxn6p?X&HtZ+=L<`!+q^x{9Paq|V8M z8(6mUk=DJWvOKf%z?0-#Q9+2-J-K{V&c6ig_;z1zxN>*jX9cu@??&BBQrn8GR&v{b zg#gFlz1c6Y+n6lpiEpT30-VJFl4ZRW_oc>ea9sG$CH>LfY?1%rF;zn=wIR_Z)V{qN zmXvF@f0Zx)d4EYcE$Sa=F%K%+F7KBGM!2uT1M5S;8u6NVOaRwplY*ozep(aUBaf$) zZW;CXaf*fk#p4<6j_b$YxNw|A7+D`8NlYP?h2=9k_o2lzRwrr^Hk)W7XrDk#jZ{gF zcUoFr{gJHllO}{qv-xOU|HAUvY!DE{^A08awso)l6YPY}p#y!kJP4VGIOltju~y6_ zT0hEPGPRkK{^V`gH%bNaCl@>7Flk0a&biSXlb-&^XNN6WEg1UN2)gmrSW?U` z>KQg1-x611KXD5*BELWglEqo*ogKB{pY{|_eVL8~vMlnJKpnaYht0LMwdOApF&5L~ z3g0LiY_42jEHRg0n+y~Mlz!gZ?y9$f0LHz0z=Twp>z6E*VX2z&y@V$uch(EV)c~vY zE=9G>*Dq{uosjkF1uWwcTzbm^$Sk|s;0CZj0D8p$IcjW2b-+2nXI65OkUZ zSu+LwwpPi0)-w=^eB>4^VkT*~z{H&m$9WegSi^`7@^q}ol{0uC+QID>houQ7UOGmH zz9nMFj@SE-*5!D;R#G^CI(X#2?1a!52NUJjRau`+Gg~IeJ*enZQ~m5(X+PPlh#pZH z6}I%o#sD?Ln2hhAi|2zqHFWSh9U+1HWX8o7{r4UD@5|n}ca{`-Eg2iy_L(F~Po~$m zy$>2@O+#vH>A*KM`w^j$qd__1Pa&d}w?IexI5dGDX$psNj)ckhba-|Hyz>5PD#ymb z$U@Mbq}78B0}$T8}4fF8{ry(eoZ-jLIZLZOiQ03UCT<>qmGkp?w|w zF__kkl{LGezpK#zH8n~Lu|Mw*;dmbnVqj?!sq2UH_5Hq?BmAJ$>tD}#`^Y5}znNfC z$*bIKGVQT49ogc8((pMN?X_6H%jG&V#2J3{2Qw=6%t zB}9d*fmnK#0ZFv({jdqqB$M~AhqJdJ#=;AXjcr}|ka)>oyzggE`h(LR632b{3Vp*K zLGURlyzqE914-?SOHcKRuk7)uR8`L&D$t7ko!PFUs6WWNjDb6a@h6vZkB6Fxf|%7Q zF(XIjw2xsYo={+{o>C&xa`&f#tn^7A>@NS?100hN`_t=HH9A6Hu#gx9nKVMo!MXf> zh?CY9|609(?JSSf3mezoNdyh2*tfH^ANn&^;XJ{C?yUG?KDk_-j90^@)#+DPEYr9u z^G+WFx9U|%9@2silqFv%sT7}?p#3g3C9+5jp`BLn5Dpohof?mh4+K%kS5QlYs6q>( zDtYfyPaY9R!rQ_(GF=g;8Epx{1!gLQbHjmaLkT}{KW5HwL#;GSEjMDLGva+e#waBp zIF+UcRcK4o2|wUYQ3a~7(d4D=Tzl``@Rk3Lse#Pw-T^0jTH(wS5swr^JF3#ggHV*D zu|QqVP|+4q1|jZtcJKx)A+Q|fnY=WB%Fe=_I)k16@dmEAu~#mUGaV8kcO6`svAC*`GJD!P-Z(M zU@f1ebYzVj6V-^NSHq7Ueenx{gqt%4sl&Ixqc)vmWxGPaVL}%vD8MOgb1wK6k?7Nq zSa?1)J=Os#QV2{pejU`*wp`?AIRw}yIdJ&;C)}$6nTDWMf1NMp4g@pq0;_KToocW> zh9YxTZ1kGU6AKW(grQ)?EV zD^A#tglKI@{$Z>JW~lEqml6#&8+R$dwATD#GS@C7YfwApMBsf!wzAfW^9i!hUFs*- z);w2?rRMCJTGUR<`jCuDe+wL6|Kxb_CI12zqu;TLJK8XjtH&XfC-DUG1={Wyp}o7r&HrYMcjf%ZLuc6Y8{r686KdID&%7 zJQlvjjq5{v*Ze0mtl2TH&4dVeE>=6_O59WHBI^+4Tq_cdBe2{23XzKQWQYa1@zo8dtG3}=A+4Ld5{ zm5b*~@J?y?^xMHT*pC7vDOU=U$1(>=ZA6TD$^w1YRQ!Oz7RZi6AidZv{94yV2+rnT zgFDnIN8*!zi9ipbDgDqkmT0*AJVPkm-cWXm)J|+sAI6JnEg_XU)rwHipoQM42uIkt z)lwy=$ST-YKI$FA5QT`?D|{@fXH<($vC(H@E~9^!{`!DZYb@uz#1E*4Y$jt!(U0@{ z%poHT$QLs@#gJ>AXFIQ9(eC1ac7Gf9Cv4)^HECBwGpiWFZZKdXo;pAXmD_d!AY-^W z_N|i}7C>AR)DNn$ug0lhQP*D|#3it+>1e~6NrAprpTH$S#RC?JZ)dEPKe^8q(8CiC z$(FE1$w*9|3UKzyQ78>XzYQu;KyQ4PYC|#{h7VIUKBI*Yl3*@^NHckpu7m+X`(@r@ zIqSEWw(elie!Ed(meMGQca&fuR@jFxi#!n6UvUMwW6X@|f|_9Rg_9p?Im4k(&dL`Z zV>pwk=&lrvPI#-IxFwU4S>BZsiXK9nb4G0h`8VUHbZJLya##3D^B8yX%+Ckck}|{C z2=PTA3<8l6a26mVW-vYPUCty;1bQ77fUoG!T3t>27Rc|LHI+#+-ak90E6l}o&=Mz7 zgx;_b)F)ZH5!574HiAB|?P(tyjba)`v}%Y!72EzWIJuhlj;TykF-q;t!K*Z=$h~U8 z3%o9JB?Ikw;A^A>8r;d|6=xT@rdCmK>d2%jJGT?+)+)rioH^^ct2&x+(S23wx?-tVE;`$8hnOW|%xT42bWcm!+#32~cjknLMEU{Z628c!KehwXf_>Kcv!B7u}dark)TUkkuPtibo1=hQ@b_b5|Vn=F&;Q?774{5 zsOF=xvKSqIztFp&DcT8fQ)Gx|&IEyb-5A4ALDxm6B$Qc(cZr9RA4tqjYdpbuBjWtQ z{8oo!{)S-qA-tq8+lzm#A|!}U`ja`5VvKyFQJi)yRPQ<)v_0$GzQHW+s4dEnvOt9y z#3|?e?MHa;_rjV%gVcF4xZA)&Z?fCDSm~8h=`^sD(?8QYuNK{=@%)}kE^pmV|NucB=M``vrdx-C^*HANylJ|&2 zs@;$h&C6m-o$S^DWel9%<%ri{Shrl%{0P=i_ z5;S*or`fzy33xMufMgdK5>3?XdwVep;qO89R~^T3brV4pERY(rOmt&W@LdE((U2)` zi5g8EE-Yc}qOjrx#Z^YwbZdxfI2eIL+}H<>25_;j)sK1Ys>D}>9!^ud3j|8hl zWCQ~V)$+1KY#Fu6g9h7MjxZRtk%kG>E?V6O$ui!)Y;~O^3z>&=BA~EzNP{&^j!q)o z1VrdKMeSGe+8ls*vJ-tdG`gyecz7-tTj6lStsFnzprQOxR#a;XL0e`vrDrql1@>bP z9YBy|D}R{GU)Na7t%wRRv^`i$BA=;x<@C)-Y1*Ni?li8{Z>30r<1lsy8xz9^RrO&K zf*rnFRD`x5hv5Jp&4-sbzTxNM3gW>OkIJMX7PYeJ;6JVqX$bXElmH44&IAjw0HY00Vc`j#j42mi||O%8C&aGzd(TJJHQjB za;HxfzLX-9p5!r=*3w=U4O1MErt{UZ8}YhXBbj6R0IRHi_SAQb$)s&cI;#vT%3n=8 ztu|`S42Rf8Tk2r8$Ox%O>RnNBw1(->+&1ao1vI(*ilEn`3xli5T8|~wk)vK^8Y%FT zg^dK(s4d`PvAf4K;3J)57&Dwcls>MSk$@sEO6#6#S2gmO9%1 zxGVM?LP@7|$sJ4%rad^WX5va-_Qy#ydQxRPyoF1KJFT*5>owrIOr7rbc*Il_v4A?sh3$E>p%lS3V zA4r}O`{jO5u|8ZE+sDm+%qC;hvtY7cTVc17j|$>n_IF?D%|EyT z=+(BAf0R#Hv^%~2XHn4IztwVgG)J(RNLk4k%aM)Ky_g{`D0Ab=G-SO4;)|K_p-krr zT#?2iOUog#HtZ_w`mliVw7gtwxagEyakZKf(+8CzIZ0Bj!q&>qCOB+isSdpcA>Z&$ zU*5qe${=PRY+Am=-M9R~_huucUL9%S8>GY^i_A>UG2p>qr`(?MPyPfCL-)iqxVVKb zN;APEf&+?ii`165sfP&vTE^Rt(@|d{41&%>C3p<14pEM~PRAJ+Sl$_pIHZRhGDU~K zz!b<+UZaD+l<^C>x9dkp(des?MPohJ(a;Buinb!O*a7yxaD5TCiOi@vT$YctS5b>` zF#ita|Hu!sv3N-P(dVaNQ}K+}6ajHDEn6kAY%oST;Ph6t%{X!BiWzv4E+=bh$&ZEp zRHua-4xZ3Zx;179;LyJ~SwWlU7{eDyzc;ZPk7cdS=-$BiAGL9$W(&?Q} z4KsDM09goG@q+?Ejh!6=Q>=&!K5My6dzch1qa?%4F_+?}HWI@SLc5kwa0yiW!sUWd zyl`t}5R-h7EIBlk5j(M&ri!wRjEeSy z+bNkP6d)=X`tEx+dK93ZUh_zgRN25Sv6lWM2}$rCN$@KFAnip_ARmf+cyhMeARAMdzTxp{_=hch_U7)V-xO5~O|Ym3cUcu(y35n+BNh>71qMtmKW zi4^X;uz`mAa#iz$EQ^~`i#o&hSUrW(a*cy^9ADsk+Hel(>B^sY_$54l&DE2Xe{R9f z2|1DElI{_xd8 z?5UX3@YkLqPj=NMX$E0K`lOYAj1%*=TjEjiO2A=DXhgHFR+2~?N40gqY@%%o#AtF@ znpp4)Xt#-@Kmm@YS^Bq3Picw}wGg6ft}2dwyzx|lpGicx??KND zX7=F_r@SN}GtmPT>V(vZl;BADNQ>j!BvpsbEok z=T22oSm*EpCt*N51KElhaEMA7boRpqXPsC1HDscIpTblvm1szAKf0k2)Sl9p2X^m9 z_E~+22b)2h2`5tDe22FX-SN_~Mw>F~pcD+eL{y#K`eJ0{@uS>V;Giv9L#uj!2BQ)2&&7^kz_Y~&!csv7&jilCxlAvb zDn4evBBy%Vbc#PyTed7Z)T{Lvke-3KNAJhtX`F&Cw9Io6JxmldEKlgljn^)#n+N zS(_=?WPt0k-wZtP=^1UOfdnOagDuwxP|QxILsd#zZ}b`#9O|#0%uomeN4YrRM<^*cJNY~Ubzo{S zB@(V>?;QQ2H!c;H~gfl^(yQDXaKFw*f zJT$I{!q5#H+P!hpfm|Ge+Zo0ijZpk8xh)0vFRo#P_2*MuDAk|so+4hhaCgeObuo+8 z${G!YcbQ;RfO4;D9*qWO3vAv%9|OsB8GOVwZKBv@bj!pEyX$Ar_Y{AzWF}G$I4Rj^ zwIj)Aj788L7$^bAgAk{_u=nHU>#&}o$Ru}{DaQ|GdaiT-WIoYgRKsjY{GwKD!CKL9 z+ACgT`tJMo_m6}^pLF_P-0!TdQ(rLiz&^tR_4)IN!QY9q6&q8p%<~4g@|M&tQBf9? ztK?FG^Id@@h<*1$XgYxv7xt3M?aA)xmRedqw5`T%J?);#2f0W;GQv4E@Bw7XFTHH5I;jdvOp1G` zxAG~w%qNOHKu&DvfhAf%S7{m52UMm^DNdK}cA?DC6jAlp;AP}Ej6+)UGIj|qeyOxb zAN_oA&^sfeE&u_trc=luFQCxP+sxZKPUOzw`KEJ-unK$+nST~%2bTH(T_w{Tk zx7n0KL!n?_K4wmraO0<3&Oh6M?WLs{<(lOpu-rel!0>bch$%zPrajinXd-}(_i}ML ze7rj`*W=OTc>UgN{mtGFuQ#7 zi#d=1C#$ECuS-?b90N9zXegX9*&scx*iDn^I@E9k<{Ry!^lM6nzjKR}NUO;AZrm`h zCJLWRdjg#jN&!yW*SBt$B0##iMibngO&<_NHZ~Xt!Cc-*(SD7>Er+e%^z0p6w9IeB zO(@Id=e7+|ZJ^6)x*DES=(u{Waeqh^*(aDZQeQ53T0g# zEiU*1cUwm3x65Q&F>|~K*IH}6wT2pmGJUYPv{z_cq7=1oLb^J?xYR$e$CM!@y_Wqg&# z$?4=mbUa);h{pw_Mi3J&tQx_|IZka5gPWig*IEAYkALJP!&eu$#m?dws79I@k8163 zTOv+~j9Zy=qGzu@!8yNpf(Jh_6ppps3;hEIqA9v1tGXuRy&5Bh_-*Oq8+f785f#_I zqY0dt2e=F#m`<-Q=aR-femQk>yGDr?T+K=agVdS^%~k7Jh> z1NISiYjMKlx+(SYqZ=?#7R$QXf)uzx>Qs`6aG$&0MYvVxv_MG-)~(gL1tr&lTjz-? zT59v0Mh&kQM^rZIntF&#=8f1pzueLim8kz%_<;6WwA|$7ZQs^KGt|JgNS^_Ig40nm zQ{#$K|3yBF{3|KxfK7Ha*vEym6;(h5l;T&}WELMz`qJjNAk2cJOX#5yQF_Rrhy4oB zlLDmmz9OTuPI5^uk6n2Ad-6!ftncNy1PDVBzw3=7wIA-!uUYZw(>uC$#X>BXOHKV& zbRj)hFI>=@AS1Y_G9)eHsyc^*zu43Fo}X1@e}+ z*3OWkIy@DBj3lEFv%P?xUel+3-F!Ffp}?*Bcc3RqjITkXl<^k-rSaZxLXDTTuFwlXdxU_2HLmA7=e0M_uVGof0rb=(I^(FTO zmihxMl_7J-arFqr%r#_nt@+n;Y#B*RRm|A>>Y9V+=;r8+X7HEbQqNKEIu?0AU%ulll5Oy^aEAeoVd#4a`*sFX&FN8H;J%9~@tuow1k8D@HI3boEzPt>rx=MyZGOlj}|I(L{@Lnqeu$x0{zg)97zETQ3bL7Q;h_rS;@2JYW=-Vh~W z&LBUeuSy-)6%m^g1ayFsy7S)I3JXW0*cM5=%c3R$H!dS&Yry}>x}?eaaE5)9OveW5 zjR7~d4Nf71%HepNos)M#4B!f?$Zi)mH&Z)sd!alGN$3sS~gBfsAx~OFKjvb*0RAeOGau(^b_eK*u zp{uRgJBGI4AAwN~W>7Zntn8F1+Z61TRnqvwmDS@>Z~V3^i+?QcNkn%*s!&?4Fd*Xu zx08u4dI-@LmVFD4M(~Q80%2EI2n*7UNsdJ-h4>Ucs|!Z;Lq((sSc)$V`@qh*lNOgx zto7>>2n1ZXD>ol3Z8U#f;%~q(en-g0c(C-(f40I54vJ#K((EJYG*3tHd5h3+pMemU zEDi(_j{YDe&;0sua%B*^sjp==z$}ftbHfq&20sTrWeeyqF6&UeoBP6UDW@pHzyr#e zdmQjH9q6qHkwd1cu@!><>{%d z^LOb7sQH>U52am??HUqj=;6btV!e+d`e=2PO^(7^*rd1~M|@*=IJ#d(lVCzGC5S+{ zj?lj3)n-RWi1bl8d2}?M937#mv+6ixXILrf^8g2^nOgBdCHf1f1t69+WLBtJC;>@i zU~{aQaJq|Bfvf3SGciIS z(6tPrLLx4GKvJTTQi+EI2}1E~pb}QkQ^CjJ3C4d;hf_!%8bKgPSS#bfpf41KZBD|e zkbQ;1WXV7iIfcuRdJ+ZUdsVNPe-hO!;0T^K!BCO@xV2;F8&uHfa7sSay;PtE`GeN7RR@pVy6&vIe9=F%*=+b0$PBcMFIat^oOH zKAHDM2tzHyfiB0*w>Ubbw7!5N9Zphw*n2lYj#N~dg*1lHU76$CoWCEQ0Mr9Y@N<~_ zkO#mi6&%o#b#gW1+@Mo?CunQ5f!~;H3CmwBH=3{b4jSb(!Xr?wlarvPhud!wRutD^ z6&1;9*J8%g7Qhtr2bLR)tqWZiUm@)%|2B>pdyx90Ci2L@<@6ZXJwY|#3+M%wsl?@W z3-V82Vzch35>&(iW-9hOG@`jTmyH*|&xsiv7z6;EldE{ab|sjwIZVC)&y+vt+vULt zPbBL`D(*E~UIUk_3^p`C;bp9{+COFk;B>(iJgz5+8v_fB;3c?aO;>sT#7u^WNg!nr zwIG-(P-hEV=W)6`;&xY-=wMI=i|)!ZShauMWd)QV#;pP~@2Su>dROxajByx#jL8QF z1c_f`D~``HtrI#4q~L@_Jet2r%uAJfN<~_8H7F=>)39gJgQFTvuG@UNrP~oZV(Y~Y z@c3>pQbX}#cy>PLir!SYjuLF%o3b5wfG!_-esA7*FY*Q~-RTl^A(2imH~+Hx8v9XC ztlO!KA52%85zQ-2S`Vx5hkYoqpj|0M30(GRB2T8djZ#-&@A1QWRK3G0Q_Kfky=LNR zL$0H2G~Spw72PJj*qAsx3ny=}URRVPveJ;`SfHK?V$t{dI0rIqjuJOpPA((_eu4%5!Y-N5asJX4nrpdL)%wwqm{*?+RJYIiEMMXVkV!~_5U3KDdUy8%$NUAI)K z23MO11+bkMog`yphU5oZoTS0+dkObd9jZNCH0}KCfnvWuZU_6Du05OKx`fl z;Od5wAe@m>3;YLOt2q#X)xhZ{Jf0$u;IpcjZ`Fy{9kF3)sY*Ffq3#+P+9waRAtHJB6yHLUA@nd+|U`XCKah;H!LeH61;{ zqHgWJdcN~RSMvFuZ*HM5E#cfH7kJ2|L4!I8YCBqNh02atc5uB1}pa z9Xzo&y8cfnhvH49f-KzDvYZ0nHw0z4aVI$fJ&7VYVa@O?L?*iydrvH>M7HuHLtyc< zwdT&e0SSb&hsgwr77sh2u83CChcQNupz6#R(~yOTpu%OVF7gc8wZ>m*w{y_Ycy(1J zaMIK^3|TsbkK1DcEBy6@0l&v+%WBk^W)I(iD5~Td@6}rEaRTpI=A25P_7=FgZ+~%J z(TwrkFGBWvkg3XBBz%)WB6J`jDLpudsXHQ>`Qhpl^KGSJYPp$nehx~Pp~xB4);f;Wpjq$(HRUKD62$5p->9fJ z2Wf-Iari*v zK*C(1AYdiI8ujeS$PWw6dcc?uB!Jm0P*IMCI4rSlK+yXGJo5u!#euUekBXaJUz|?H z*AjEg(+LaeqO)JAiNr(7T|1v&jGUzbGFou>K#s_S)Wlb%IXiwL<`V)aKVx?WW<_-h zJJr!8dk9_=W!tjLGM=NZJL;k2&*~F}yKg$dl_AE-!;y~fV77*(#N!FQhk&}lk)s1> z(*0}~8{kduqqQckF#n78^1pQ7+1l4_t9-`NPU5&edMo)li+9=(4;zOT|J4UN$Pl9} z7pYQAiyUx)49gZ)F}b*HCtfuw(Jmq>FTw}D#!~n>v(4!)V0RNfR4%G z?4k+!rKifIFlNg8aoEHzi8r%LA7ZEZcaXw}r-Hu*--a`FGc1LrK|taiVwF#?rVxzq zxLv`5KE9?tDdvkr*NewPl>r{Qi9$&qBrF`tb!rbNeZ_CtHzoaKq%2b`x6ugQQC`~o z@iG`$LtNvFwA#~fj9Mw&kG+2{)%c);1avl-@q+1Vq19a$^v23bqplea)M#P03 z?ehq4YRH5W7+i>^nL41W>@~Ockyej0Bzl{+cAR*P zhU1S$r%a=O`-PfD1e%J<>*pc!n)G~S=PeDc(Ja&bVzjn694-Q^${%CoO_Z8lZSMY`HU9b# zzy2Vx4{l>+vna_;2Kx1%ieC%sH$GJV)x$sFE7e2YJd_XscZu;N(BcOO;@4l*H}5HR zve_RvlWos9X-<1Xo+FWkn?+gZw$a{{lQ^*ma1SL<7I2t=)g^BP5f49L>79Crfcwa} zdX9W6&rO2jJ4fk8#vnt*gTja^CiT{&$Yu{QZ?s&0gY9&C%9vy|yhB<8?FGeKuw%s# zKrIU7T1j1~7XW33s{i7a`bin~a|9f1K`fmOUQAGXkQa~&r1=&Q7`;Bu5=5q7lUIGo z)-shyL_E8Z(W1V-j4*Y1A@>kkWq}!%bI_(hNmcjt#!yRVUNxc%4ei=9{7`-mv|niXyo{E~A!x=z&L{gg-o>S@mh+F$LI^)81t9i|KWB`0qnZAn^~5_8m{KTpmKukx&pXrKI^)kV z8~i%^_2J4t^>^v5Gkef!x7Qxr@7(_!g^bzcurvEYTdeTyFZN~s3;gx?3I6jrZKT5% zTcdzmvvs)q@E7^X|HyA_zz(6QZ(h9U95a&?RbHn>^4Q^d&5L))wN~ zl~cK})4Z~PgonZyVRNPusIDj(ZpBU*^G*tiDFgPEq-Vt*)H=rQz_AF*3Tn?R*;b@a zr#~#5sVbk@BUO{2*MWO=wnmc~dd!yCNJ+|2f>{W);*rHG>}LbgU_IdNk#FsfS~gJ zu_`Rm5zP@Pb`(pelq>#40s0)3MzQ~(*2zJYf#LEyz@q9mt6r|%(|YkKluS{bPN6NK z%q8WP{DHJyO;p7dthjd-b)!gCQiF`;(=dC{95lYMq88(KO*DGa{PH^}t;<8smg}KK ztBVQAx^Tdl_+H+%0l^UEFOi$f|J~Q@WQP|URP{DoX@fp}Z2*oxKYU2mAJ{KIE)qgQ zV2j|m6;UkZrp@FdxX6R+5!HfMFy6ShBtgSh6%kSThRPD5kb%@AkOQEP$W;$nMWDv# zo)W=SaCkE%p`qP^A0I$6%W_u|5kfP2e~eU=mO(8L4&OnGDluRTpey!5_n;;U1XAPF zu^Q%urH$nZ&eo5#BwpA)iceSPeMd<0E@_hql3zZEUZIN43d(ia= zbs}buN#BVyfFxM%$xyGDX9g{B`8fGgb|?O$HOu#TPLtJirc)cwqt9Eu#uJ1kSuG6q zjM}ZVPnSVB{8M%r{Tb}?(4Vp*6>(>Mw!;gSil$!U6*sXQ{E$Z=Y>UtG1=GT`ULVd! zl3@XY&myVT=1o#4r9!p6;HTX3UKo1y2^=vT+(rsrYav9NXD0qQG#(M3QWhD2cdS10 zsgT!wm|2k6aQIrqY<(<1fjd62;<#Zjbg-NugPwe>d2taNC@~X?g7Bl*Ca#m!c-X%} z(8Ls}Isj8;7lJ?h8J5p#n&3>%c?xLn$NcPaI^L1!S*v&WRR*@Ceu`u6~25NZt;c52Mg}E zChR^{E^vC%e?Mh$(p>FsAFX}y{gH?$%V=MIXa~)d2MJ`**8ccaQkE3vGE-|wW-7>p zNhRPfHIo3Qw8lX5@ZRhf1M%KW%+rKMoHw}r3NQ$XjFUkG@(!iu7aslAfeVusjUiGd zi>JsHZb(a}@XkkVED7QtNEcmc?CI(;YW^sOm1R zg4ltYY9hF5h7ew3&DaxX;(V><6Kh>uFL61ILb{l1RTvhhFm_bm~TKet{%{fm3UyTW7YMm3DR%Q*QJ@#Q&SQcwAmuSaK|)TW#s; zSAeY5W6C913zgsy+t6C8G)rZwX@|UHfpeyF5vJ1DIhZh*lJ&Dmv4}I~l(2}(l@PBWZzE`-M&(+@rVU<9>ORo{ zIuL?lYuI3GMPBwPSl}Y`nQ=kP5I65O0iUozM+9^%Fd}9>8gmbj_w}*3m~U84?+8j# z>?p^4SlQ6KU+1RyNcam$Twfx#S=jnZHNPo%Qlc`-OJ`TE zKoEHmN$0y{Y79i|%{J2QTBK#XZI?GyWQdtcBm}zB{Nq<@G%(2GgJ{1*tbpM{-aJvu z+JvqKDp{-e3DTC|5o2>-z2<9lyK@7`|H-1?B6H!ptPr$5w&@i?QlYh|7i&~4qLQMT zzEoQt7GRIyz~^mTqPQ91xW>QsqxH21-#@u8KI=!1mLF2fAP^#0Xtv5fuMwG>LP61_ z>lQwEd@S*@;%n7RFHyj$0cc&c7Ytx|3@?jviWh_N8KQIKL16je(j?UcrDt6&jwkcv zFX7t`21n_kTyy%bN9*6WJMX`^|Kz_gE4ts8<$Du5R_=?-u065iFTRjA`rtd97MM3i zsKy5TLi@45U^nTM_3LDs6;mXGRJ7pY%7_rFTu5MR)XvS-#~)S7W5V(_@MsrMCzFebsL_ zt?q)t;L&Sa9*@QvII==X@!M=U7y3pe*=>W^!rGYn*TSRO$9Medz;avaK-)&nt{gn+ z%~GB0?~nZK)=BZ!Ws~F-ly*g=#tet{^7kTDS5Ai? zpqcQWGyP?z=qFRp-*WfGO;GrfNq7Q%_Kj&+y4$mNj4j&1y|s9pUj&`j@-1x*6bG{} zDSd7!|62e6;)kw5g+|O(W}+b&IGvd_l8x`PP1_c6&*rFHVsOBlc2{(s)=yxx9>2K!cB zhW$xkOS5g!T3(!nF>b@8vI~?%eCKaj*0=dkSYdLWG^(9Badfiy`}|%$vIhd*B10s-?!C+-eugOM(tW6H4ZmsO--PZ zu%hDuB1AnBv3f9ivLze>!`+NBPD5H(ca+3))`4$>5 zU4}X4qGR(wsCq)o@2c#jc`zvcFZtCnEtIL0HiB>PIsakwGGKeQ+60v6fJ*ChT6pCgvZg10&0cg0NhdO0ybzg}b>OnkBqG0OGnH*wTgPW? zz~(6ztoa~qBJ+%FtmX^hR4CJrE7kac?edz&_LdEWgVi*XcizaE(G6|A2|p?GfSM1> z4f%N>Wr-h*l+B(Co4&5sLL>BuAUWtzC-3_VJj{ymO5_{^>Tpah)Jx-8C|P!e+IR>9 z6C$6@`%n|(4oh8Mpm>^5nQ_8P=#$+jN~Sh}61D-qE6TKCnvB+S7-Zb%!l`lo9lnQe zie6k^Fd**E=+afF=og@8Dn3s)MYv2$TuS;zDBV8;f_~@apRGOc7Unw~OInul5vw96 zyUepVq+k+jCwP&?wdMhfFi6!klwm^3!C*=<#o;afII2s)K0;o`JBCy;NE^O?$O+MY z;j-c~#rqEq8-5ZSUJc#6zsPVdWks;)0o>BIrI5sD;Ith?iOL z9&3nv$I=IqKJpINJ25_eb!&f>!fUE|ClZ7$88=?0!66?=j27dw1!Rw~(CIzrw1l3M zeT3bCb4I=rGbmpnpLFX5%3)*KwWsJBPEVcf{JgMDwR?+2@PlXB2^w)1MrUA|x_Kqx zoYy8tsBvquL>=jILSX>Ozt|!twlf9cxz$r;E1xNMWDG0vH+q6uiv$@g(La;0uGj-f zo&N_hZAy^nH#y?>?4_VxGY?CP^PG-wWpPCgq7agIBwW$)#cy_IyC9Lrgxa zPqp{t~c~E*@jua$pCuI#LSG92s z+jw9+xq#Z=eiIICmq!baA@>aUSH5lv(5v8&B52n7r1qkV>IoKsViY==Zji5; zYYDPDD$*^zE~9|l?;*JWmpkh~Od<#W$|4=$&?@{^8Xh5_lktT^d=1z}u?^8lW|PW?;yI5;R_TzPSP$fM~s0M8yn zDhtywPjvb1GcP@yz0zbynpV5xpWGDFBVpHosCydTK7W^zx4hEYmD zy<&Iu3Em4EQ5+P$pIjC{&xvOBiNr#^7@#ODBrZ)6^d_!WvZGRun7F*mdsQXLeD1#9 zqP%$o8V;l+RS0j556S zD-^>)y$jgByE3O_>bq|a_TDh*?ysVA!c;^k#E_dDUg5ZCq6@g+R1j^~J7_~87$m0a zy+*fx9P-7I&vCLfzx_+@tN2l-3oCaL7CYbsbhbu7@|8Y89Go(C)3Tl46efS4(d2nw zt52A6YXGzevM7mqp$^Cme?f&TVv+n=wRs;W!_)#J#jf*jOPxnNF3_*fAT9RG2_&7U z3c_2ZhKTI$&97#-zxm_}ejhkILPWFqshLulHxfo*F73)*a0!U@IFKYL*C^B7<*2i5 zFH?(xqP%eNU5+p=YkZqblrL0A`1s>gaqUBFvB(-yD`pHFy8$)u^*5;KASHbJZ^(V! zKiE8Yv)_IGV)KXYkDL3*mBrnEJI}hz%i9OCzxj^o{dKK1;61kf(~YgYZ>__F&L93^ zq4tshh@@Lq@4;7Je^vX{_TRR)_n7C4d2~1T_R#tdm_huP9}q<{SoXCCEh5rqOPRgM zEqzj8Kl&(RD*Et6;1`>$XN~2+7M1vhNY8)^0S#&o__*Bo)a3Hfl_3NwZ~o>1bCv5? zSdp+(*=GU%yLIXdCq!Yp(?QK}(1bS2(W&iYqg7OMi|);lz^GhEzw)V~-QcyN2)`52ekRTqPBlIyp^hSNefj*?4A?V8aL z%inHkdO8x5#ZU1Xx$rNy$!(Z9w$kK5r8Cj9}tbG zXSMopMSgsR1BUs@+DZdbQtSJiz$WGO2PiLsTq0PmQjSP!@$*}Yzu?m~Dg49p&<77# zr|iK48%Sr+o)1v;X?7o=;5r8^?sRf>#;Z<}C~p+&*g6q2y;`G}xDn5W+ zFB%L1I6AtVyhrwZSY{wepFenj$0$LrB~@{DLv(z*_J{ioy2IKR!;|UczC>bQaGc?s zqsL4AdVbNPc+`5R2us_D2cf7m3=ImGjFfN-szcBmu4%D?H;{XM=&xLww_~|HL29E( z=@kHZK{o(|gcS6IyAOqlStvp(f8a;~hcja>*y?riX6BCMAwAA|KpgbXNyP=nC&^#OUjrxYYZ!D~rCFv$a_L@(C?ALRwE?V96%y19NB&VRf*ZUWf5)E+?9tE)4d z$dI#Is&HY73)?)K_NNlTM7PL=C8oxA|={^YXcCV{>K%a0ASH*t7SS-X%dwl zu4bP#O8edFmoOq*oUg00!%1H(Y9TSatY)c2HLfm#Hxnm(MufPuzTE8&gUUzoY*M?; znavB{l{UI2XZbG~*YE06x=)L!NL`epuAJ}5g1|6F^Z=&CQgh%O_yaU%TkHboZBj5N zAMpp=lqvMsMt~2BPVxdz8~bOFHuo#+a1M`bB{B@Gz1GU;&4wUj);NP!iHQNn+_A+v zFXA{u{a1&lA@IzuXDF9}3MOl7+-L(7+n=1g-PoWAIM;%8%gy&NbDQ_PD9{>`H}5r9 zcMBy(8{}o;Do!fusCW5potsO#d-EWOupHgeFPk)1UzFg+X?%j12Fo_$=I9&eKf6M4 z2D#v{+56%{@q0uIqr!%?xOi81)m*=tP1mI&Nx*E`A%8Ye7P#FKVv$$=EooVN6klp+dv3ePivFu8Sc{2+bGv@iHK`} zH%553V9fh%o(WNdT}i#0+sXyW#Q{JjHVmj!eYzapdI?kD^%ZiXS3F@iSpd4<+dTLY zg?;o$DQSRHCF~6zE1`0cmN|l|Gh;=+&~dT;-VK;KS^x6u)sxW>`NN<4WLM9z-HAI2 z0Z0nu!$Xv8Tm4HuBtK~4Mxzg?IqNt&g{M$9Kj(p36P3r5cA&Zd|3*jlK^a?m?LGPKf-WV7QqCFsTAp(IQ;Qh~-(tHLn#Uc5!YAB-a<|j`fM$ zLZia^3aDQYINx*$!ML3Jgy5}Z<;#o&Y=j%im*rF*v0AZ{{sn-`2K1}0Q~Z_}ymkZL zw83@n7#?o!{|zreh`R!|8C)XEC>T#wJ(z1H{f#lHPyynH&!BuGp$OXV<>(4mfT6D9 z2i^dItqCH-9dMhdSFabiy&BA)^4>xHYw!FLCmBqejIE~ zuVINX=s<3LLQThUBk0+f539=9%uEK_dZtIi~}7Ib8o!Ph^hI+N`V7QtC%&-mbl6&6q&`x z`M|*cjYSjgKapg`qa$|6IWhLY=9YhZ)P|0af)_{kkL065eq-H7e{Z9p-~FSb_8R}Y z{P_hjvixxQs|5!9d$R)xWuKx<;P;*Jed%E70bFs*5AnaRSRCS3$o~$~?sR@@>gY%` zUHB9IVv+Xk?;mrJLiGxRb^#cdKL2~WX-P94WMdIzsHJcp?^c`W4Rc*ue%Ki=e|77u z(PL-aZhq0}Ec=(8ag}z`8Kb|43-|Y^(_y(_1E$<1-YwQ6&MimB2>EL_S^#zS;88~t zOu5eAKl%IuLeZs-7k6#@uR3H0iheaxZP8mW$)H7#0qA6~xrOycymkDz&e}(u4?na4Q z2-P;LcW8=F-7}rp_sB_xQ|1YG-=mJ)<$+S0Rfv@cq)Lc_1``t7 zp}?9t9Xx3<1DYEpL0t0JR}!$8PN$Y*L~&mH?GC%Q^8lRVi_W3&DfsITlO2qbLFRRN zA%43za9SmGgYG1D?B=6cbmXu?ZHeJy^dGT`TPjEvEm2EW?4T-;p<*s>jhPiLJuo*? zI`ZnfuSDAL*b2C|gPy{|MWrhB0TNd}Za|T6O!lDy;^y8!aw4I;7eHV5KG-q80~+mv z(A?HrH8kOSRP(UVA`9SATuBjvH6c>_HGW}R1IN@j|MJYvz@+T(Y?*=@)0Ru6aL6*? zIkz9v@||{TD8KU`<`M>=L21MeH81|e0_#Jz;X~`XCMOjOLO9CloSdp8 zVfqrpp=24WzdFF66<;X~3+2IeEgiLC94ojdnhd!&v?tAePCu{p0A*cFl zsfAdcOfuIxQ>E${w|&6#qGzEjV9}1P`Bs__`U|$blrkp^HeaOAFjs=!DVId4hC2T$ zRzHSyh3tk!zN#!PQ~hB?Db}Vx*q2+Hf`j1JZy0Z*X@|p;kNY0(iU`B41_56pJc>SKb_jZ8DW>W<|M|*xoj{D z1ZiM@gZIZ66ddcad_1cDN$n@{Sg`0;Un=Jv$A}rNCF|uwv0VJ;f|DV`hy}xKYq&$U z>J{7P96haGAPmC3x3Yfz7a}4hfvdiT0oDGPwUUA&dVl%=Q{!QOI-K|d(l)haVnxW9 zC`&(}NK5|?!l)eRb7BlV2{T%-m;ePS)VczhZEPfYy0UU`nbN`7T(`_FWbvWsVL6h? zDa2cgS5k7p{zZwl1fO_{397zVkU7GsK@Dv1sxpldZ2j3%J@}5+9YgC>+&g80<)8|m z=zUPp*p6Kk^t$W|GOF??|3r`g>WMVlj+0mDs;p5hYcVV}jXX{_;YP55A#M!nfq0r! z^I$HbLJnsYfM)l|qd@Y5)+~BExJK3S&_YNP?=~|@=4tf>T(eE)lO?T?Q1*Q&S6*1qgyjTX-RVJASD9qssUF$y1Om>d zJ2i>K$ErBaK|karpW%Rj#3g$gC6hU!UnKb~)*HW(Sae-rP;*;ZdZi5iK1dWq6prNytD!@ z3r+e~Y&9QA7RHlU=M9Cc9Bj0scl9NQV8p~|8P z=)B_;oeq6Qxd|dHAG4wp-*vXxVqCBeT=YR;LM@SLaVO-(lk*{3wz@ih-tuHOCu2); zDY!MIxXzlddK@5|Pet)#3ebGSd;?c}R*h1bn&se>w|T)Pi+o1r6;_H`@Ra>TMXF zN@KvV`haFjBPEa{;(XLf%saSc@*zbWcF!!rq}wv2SA(XsN1KoXQWJp45=UnG zTr7oc`A^#84O-Bys8hlYg%1#0Yd1;yJC`=DTRLBlw0^Mr!r+5@8S58o7N5#}Qxh3C zt5}DQ8>$Azr*Tu>o880z&#FIO zMR6p?;uXGKjUNLgT(j-n7vUGZR3uUIk`>a+ghEO6_(nM71ovu-;_754a%T%vD5#p# zLrzLp2l>VZlTqaDGQK2X6m{OpzLE?!(SC)hPwA~q2|93v(m9g=D(#U}9-Noax#Q17 zgNNda%Y{%+q3~468fF5N>B4kV2yQtUVL`BnJ;Brd<;V{gq$n7Pt#IU^+P=Y#AG8xk zJkC|b3Ib)N>B+!~^CBnygyU?~56w81R*ukx@eO%{*;9!`BEAM~N(|`{e7?L> z0E1>R6j8U&mUhdJJt=P>q*OFSP24#{$#sx{3kxj{UMF8-@C5gGI*p|udf5o-A=>pI#M0Z0ptK92bHq5MF2{!4VkY>e0cF1=cZlf)W_o8KeE$M);^?9) z#MOWCT?N+_!~_+L1Tf|5ek0xrPJjBj&G@#aEQtZmgaQ2X#9pGpouy_GlPjr-sNDi(Jrq6XqZG&|=1et;T zn6oHpXlJ2u{R0sdAVf#3J&Fx$Z zbrr({I>1plF5s&{2zIbED5J#RD4h5Ukf*GP`&_~EmYf=XSHh{d2J^dyGNe|HJ5fDRPDr-n-SzG3Z z3V5|TLf{+5H^DA8BEO)@z}_hE<6uZ`LgfUG{0obhh~7V zG;Gwq6IEK9mclslw!5bMCth9T{t^7Aa4u) zsay_RwwsKeM3$zHDFD*HgM=u6XL6)~GE#JHplL??pbTTUU`5DZdNfG3v!StV)bFbYRh-dm0O}>kxLb2+JV8j1V?SDLPAgqLjP( zWK45!gh0f|c0d~b-P1dKM;;}ZiTiqE16I-O0I9CAcOb<;c$y+(6?akFiE8>i?r8u= zpDxse_F%}ZiEO`tf`P6o4K`mS5wALkK%7%ix*tU|Q~oKmH1C~>%rpcDa(ico8UaQd zOC!J*T`5O6O6PMkYVg%hDlv3@H#RQGA@}iqI6|eUunbyDx`yucUU36bh|*)kI&W|( zHg4KMI`&V!(bXWt(>GE0&8l^BhP)^bt7#J{p%4@I?K4eP)KWv?Qol>^WP;&`gsG-7 zA$`86NaX%PW(Fn`vRZnV!!;!UNtI>6rP+FY&L`+$Cdn-!5A4tM(RCqpyRgn!S8WDQ zFa}v^Xu(zFlVL|(=-UryCHtcd-I!TFqWki9$(516T5ljAS2y9rn{PC0A)%|A-fqd# z;x3TU{DuMMsBu-Jx24{qZ#{=-K)N6Fd276g<1b&HW_#O zD6J3IFUu}tJah7VCwuZQ`>6T2{rdIp>n^W<5vy3ffsH@!N(hji(y;RKYMm1A01k*z>BV)tTp1~bnl<2+rVmrb*n0*hTwJKKB@9rBis#FJhKIv35U(L1K3M2#}71F&g-?oB5juBFQmLhY~Q zDK-H9#aL>V{I(Bn(|M@S1kNd;?vSJ?PA2_^cu=M82nO^}wfo~h!cUct#fR_%#6NOp zKzt+o8w`?rV)oyac%C_zl(ehB!z8#va%$HM^bwKpA3P)iy&%KIFcoIZQyTw8&tlmbZVukuyVG5B-7bvhek>}`=#rnl<2u)l@ z=e14Hlu+ad-wN`1{gj~2aEaZ@NY@hmXc_r9i#l}At}dmdUb~YV$I#z25=Y2Ktw88g zyZQKaz|<1{0CgC-RPE%6>@|JtM^;=e-w>6b+tC&^kB^vKdg7G;Qo*`7Yu_Qa0HV%< zA}0zSN(m#xL@O3(#SRufY6m-PpsMn@n&>_ND6mx!XI}EOg0+#z7BcZ`MaI?mgsyBv z@5^~)=M{du8$7qi$c03GLN<_CB=4ZP z$oF6Q_pvkk7#H)5-*y>Z)Rn^IUAnPEY$n~bjv)eZje#HjpjQ!xP)t1ZweXJSWp4}> z40UhQ7XuW=AD*U9oEoX(jOg(ID%1BoAVi5zKJLX@uZ8AQoXm(H>Ki6 z3K`y=jBt5eX+8Lr>LiBkFn^*w>%tnMeh#>IS9uSLRSpaDL5H;D0rFY*eNcI_o+?^& zahzBIIbnvDol*s~$Vp+%tc_B@Kr143QJD(vO9+2rRfa!o**k^zu!XITR`cuDFT|hq zf`cpQHWi;6eOj}GK=q3P5@tB^J~%y%tJeiD0FIWZsk|LwflFDKFlC@LS7)03@ zDX`d2UdvvxBs`s9y0;8m4LzD&gJwTyqgL_RsYFr9Rd8aUR2lXqku4xh#^Bn?9=26bW-{nv5qqO<@Z%&C0Mk@~ zAYA1fp0IK+!|}=Js-I4~g-27NaNrpApwkW`+aY4A-*6p#^Vs(I5Me@QrW-ev|ugd7nh#V1H5FV-hIjOqtd-);NPD zf1ZKsO@gql=lvJ3toq%-$@!!UHN$wblf)znwWJ3S5tI44{RvDc=mogn<$VT#FtYA3 zDtePB3gnI%=zbNR9c5D2xsx;K0^8tMVyye%lhadZL;0{*;FqVPE0i2(9XSvO6&~km z%DH61@w=umw5u_&+@~1rq56<(GKTUXASn`il#M*;!_-Ej&{P+v+%lQ0aR2NBUZgd^ z6@1*<^C|EZ$fT%H0RgdTq%)seSm_e%Hn9q^h%U?M4>PO+HfatV#O+(0lexu#CPZ&3 zQKtgIMPKNXD>3^Ic_=(XlQH~f18x_D$f2M-| z5FXZ6B#K7MN$SGIg6QM`YR_Nf>^)Vh+&ZJ$Bw zxTyLDk43i1rP%KZ3hs>nlM>>Ni|CZ+T^JVw#R2pt9!hn4eU=~(Ixu+8``-1eOJ^(z zi+((;;Te4}=L)FajaMKsV#YU3ZWq}4^=dQ1&9jFXV=-poa#})hv6)=*2 z&#?vI`oGEQpeQnxC7@G!19;E?;cBChP;~>|o-U4l;4q^jAf*;c7pimp-n0+jGCnc& zu>e@o031%0*0h(FnLq|jSvZdB2T{y1R=j(q8WTzuV7bW7fcc z9XlPKq!OL2gX}G?yb%=MqKf(CY;=8jt{${>N$@tPcH$iDnog3iE!>c*`ZItskB zsuk)N4{#+;f+4hm1enX_k_DkCqL(0TggQt)7|7h4!xIP<);kqrt*9|TH0XOwPs(R^ zA>W4VxrD)kfWr^l1zcRnrG&C86p*PXXf%Ibs@3piaKe^gMGQ{C)?h zdm_#eM?{EgRxipSTle6{G8btId2F0WnQFTcULgp*`QS`NTZ^6u(W@zrv4427CH!(G z{x;daB1p+Dx`|URZejDu=?bJ^;bXD#6N|_NN6|qb9$|7l8hgX>70vpO_Zmdg=t~-IRnH-Wa%UL9z?n(8#i)6b%&KbR-r{0kLRX^-5;9p<|or?%^?hVTGgDpt=I2& zFTilP7sShOv&9NDsrp#P1jc8F(YlE9mu*d(r1mY1hiEDT+$qX2!Ws{zig)G*Z>m{I z5w~=$6s#^(8CcfAps|lR9q5svxeXq!CZrL1ONqFHndOKTdzZXDF_5495IA=+t(qB;_SiY=+$;VxE2C z9HfeFDRQqaySR363ctepaW@`HRJYHS6;UfiO%Uphq)_>}QaBIGC{y8pcCHRpwlHIp zH6j?Hv}dO(Du{&Y(_xg8DqAic)XAbgo19SI4K{;UMZSk70ZNxQDKU#BlanOc`Wnf% zEtFr8V~wgF%5LhaRyCrms;N3H9cU9(Ih^Dgeh?K&TB-WSy>I{Ua(I@WkW{=#h#T|8 z<&oTb&>3)V2?R~f+P#B6ewp=5ovl2eZ5KB)(X)tCKn4J`jhl;L?uw?@zFXOHh zJ#7r;3U&{jDED#r@r}`3bOTrqH|fg24n$1Xbh8;wfOybCr#5>7-TDD*4=WcWUniSq-1^1y$ovRR)D3ko znPCBFTmj%_sD>a}8cdAqmcWs`bZ92Se%Y7^GyA%FX4!+Y8cdSuA2!c>Yw5=Hee+0+7D z6z~!dEW0ydV|Rz}s~o~_Z-cOM3OR(o8*|@gaD5Yrpayf5fah?1GR%F`{W^#6Pq$#M zdI}{7JxE3w0nP~*CAV+7f674mwvNJ`+`g%VIR~j~F|`fGlif|y{kD=YZ2L=tN@()I z62iVKHGkX9srlP)ZdsFRpmUh$_qaPS-{h-NNueo%Dxv)}z~uWW(G05h)3=q-=D<{u z#vMrZ+wLDoLV>aUuEl3p1%mwJZHphZqXY-}6vMH^oj2sS-9Kg^{h@LTq$E%Y^QQyp z4<(WG$I5k1K&pm02Pq>2C`D#RQ^mUL-uYwK$d%bS_Ad=&j89{Hqog6@MIM`-MwpB8 zEZN(Pe?;O%5)RJ*Nl6z%XdkVoWihlE5i60@aED_`?Pa``EFLi=B~$$NYR0XXYP&bJ zG$6c4n(si6*Drx}$~&&;eBh0S(9=U<>4#8JPHkr8#QT z9og$vq2x*!f(ZZ2`YDc|g{;@zGZIVAauh{2;?`O6!tO3~tjnwvOpZ#b*8H1f7FLWS z2??hSlLoY>a}K3DZk)N6DllB8pWlEnEP0IJeHH2*SSMjULLLX^7~99SVD5<4)%Wv; zCe+zN=awdp)t05O%G8RIVz1S8su$Q27*E%wKfyhZTp1xF*$U*iS%S|EV>`ww=9TUh zOhyPSDH4OJU|U(EK1oI5qJ`=3)=DdhK^n>O@C&@5s%*UAjd}NsV?zEP)An+{QJ2*h zsrQxGv09x4z$(Jv|JCbRch08+!4(ZzI6;FZ$MyVgJ5F@wr8tT{2cGoJrqen zg+__cv*`n;+($Z>pJa_H$fUeG>^p$>`>14*wZT{l88QcWn52Bx3%LV?K-I;?BEGUk zQob5GWU`0Qc3dmZa*AupZsPmGS~}*X4_)7nOr$8tfslgaTqMbuu`3QklbURb&>uXg z^7W3FrKtH}p+Y#vc z<$6HC_~(=_Wj;VZOrB%Khr+v4De5DtQ01Ga*W4ZcKGzIV#fpl7Nij0-Fd)9g;hEli z!oI?bSP3Dh95o6|qI0k-(O6Vq=Kz7QlO<9bSRnH%ZebNNh85ObkzZW})W7~^$yAk$ zET1A+k*u|<4~FrujI|k^+JfBF_iQ><=bHIo2#JAWH<&(Uw8oC6FX_OxRLc^_;cvLs zq8EwMz+Y99Dl{T8OP{dm(@U_7RzOi=$5}o+b0UZ`_q}PVLwzqq|`8g?3mv)OMerVT%S8r=3-F7q~7#CEo zQ8eX!qKr=I;TkTqY)Nsi`)hH;r#J`U&S0$4 z!v^)yJKI8h;^acQoVnp4aL$UBmOc}>$(1UozzV-|#~KCrcHK^(YI4|qFi?6U(0czGx$(O52K`){QxUFf z$ZrEfW%)b#BPexYdPHwxu6_h)Fv7t1-cgJQ#5q(2MwHMec2>%03K$E>&bU%Nnc?t- zI{H3zAp4mtDwPntk+szI!2o0|N<*`PEVE4pMH=BV^Pu$W<5xf{AEgGB^)7V5vB8C~ zLE?s!5%ojL4XzBaE~`~xDf2xDu#B6#n+Swv5kpGnMx>WVH5$f3SfVkTti70nJa z5S5Dwt4~TM`pj)e#t2){_RvR3FY|9cqs=6kZ+p^n^S9rcNg-+)KN*_L4In!z3_&o1 zo*44}AwaoIWOJ=T(`ZPIb>*8lifdlV!=R1jvx-KLaZyUzqjCwZlBIJFR>f-nxx#}6t7(IagQc|e(tDRgcU%qt8K zMrq8-0$*}9wQcAmu^~cRm0Yq*ydRlB_$YK1QCV9HC&KTAlNF+ucA-E9k5@xUcLT{@ zF<8mC;%h~4E#oRn$l%2i&H!cET;~C_0n5Z7qH#wk$WKo15%Ih9rFiTopyBO}m06hA%;737ovvCjHw= zjdBR7=ZI11Rp7r06jf7#5WcN+BsE$vnD-1hE&#qId=-Gq5$&gU^N_p|uwW%EHc&wb z${#a~iA%tdNrTXH)N{nGEEAP-R^kg`2R11dP1Q|l&Jf?@RrlGWy1rIKxsSVo1}JQz zu=pP34m4zcR)OvCHQMWk_m#~emch8Mz!_d2E{9KkN%S#rfx`CHzI;Am`v$}&_lhlb z#;eT^>i%?=w5+)Pj;rjIidLks0c#Vr@N9`CGPB-AMNM=gM9{U9!cA(5p=uJK z_c7OSag5!@=&V*2#>vlp1;vD1@zdU z>@*k9dE=m7)vhRue`jEqzb77M*Km1WbOPv|o!#)evhh@1P+^tH1K#0L;`y4NQ@*Gi zb$!S42%`=W#D}CIM#3nFmJ^bEpqaueTwXN225ebxBU!}kA*O?aiPA&RPJZ1woO_qM z7Of&j96XR;ra*1&q_n~dd@LmaU{4U#LRQR+9e=`^$fr)XZXPj@uW5qF{LP>h;p=> zq)@9sUnuJBg%T5AI9b_?GESDWN5P0K;Duck9)xB}9(?bFVnaE)_{x6|U!|yGgY@sv zD8&{gV(4sszac7cz^~q3YonIYnPb>(znlz#OcB@1$e|dY!M~~ono}g9bhBS+-&Vub z0yeOfaxE7%4TCbad4~GPXE>9fZK~}=;Q8lr&3atmQ*ae<7O+p=*CGmus+WE?=C8x| z4yZo>#VWkn0*B`*&ZU?vOlIT@OJ07Qt*$B^#hb`cI{}Kmx6`>g4Opdl74Wde6eR8R zenVH1^LqgRhZRlhIdJ<;`J6PMD@#!Sa3J*A{4g;{_he5Y9h*Zpoq6ZsG z3yJc^8sx)lalcDBbuCzTGXxIdMy7diS8G18X*ZfqR9Mga+&2ik@PF;5e`Fi$>WA}j!EehU0S5sMzhf* zRX08Z)5GiF8UWKQXzg%8G!WP)jaHvz6<5Xo%=KX1_JPt27tuY&b{l50d14z}XB#&dxHReC_dwW^avo-% ziyQ%s8fb957eEm=dl5Rs#8chVH@fpw{VQG;iT>}a=e=-+0ogPUvH5d2 z$sGGrQWpr#uzi?e8oulJN-+Ej4}#);Q?B8`$FA&h0m)5-H%nBD-WYI+3SDGK5NC+G zJ%udD*gQ!dh!+A7r5jvVe#&J7h&PcS?&Nenu{PV`(%HlVE4M)62*M71;TZP{|6%kf zxG}m83O!YRIYh-WIpJvW@C3&{h&1RS;kFsBfM|i9zJ%-*^Qvk_dSjh9%1o}N$|txw zBb2C)nc(E~f#6TB0r)aP2Y+6tN0>73eCKc5&oJNH+P&KCZvD9V>WA%pWpnQ7GFlRe zLo++NcY_Xg1BZfh;FC}OwwY}IZEG9#Xm($HG`|i#kb)Bxi0rOn{zWNdUx=Cq%A>YN z9g{nVgp~%^XBG`NN|1dR$n}a!^C#6aI?)cSx{QK_{oiriLFn?cJ3Y#<`MbG@Svn_BGR)@r2~Rxi1c8199V+q0 z+mm=w0FI_gP6YsdKmpkO(8V7`W?Yzu*bt~5w)*7bf%so@mLTT-f~N)B+|?iHedlf} z8n@~RkIV`s%2{S1XHNOwfm!Lc`v2H__x?7HBVG7^ehOG&7N9Ir7iZ7DODnP|3bJ`Z zky?_9lb29nhy*3X6rcq_ON#C9ex9c;eVZ8olw@yqf6MGzn3=v*S6A1qtE;O!nCJ=o zz!zp*vibXB!4}-EShA^HFFrAQ01_;8H9>nY8O!yQuI;tn$#lSMII7;Gx^8EFfY(=M zZ?Vr-csk|HXJPv@lNOFBQOq0`ECFaM(a-0FI-w0=-C;$g!%K^}yf4tp6;`~WsVQqN z#Wl;N&!TsfsAWpEH@d4TT3TGbfk9|+9?fkii>V(oIaI*$C$Ux7GMJBE$NR;i3cA+r z+6`o(DcUTG9uZbdhftHlabn!$j-F->% zDijFaAQXCF56!Ns^Q&$TFp6#P$Q>&C>G}z|g9kX5T)#QaB8xY->+6~R!kdY@@0jD7 z0{pRU8ZW7$K2AqyuC-XZI@mPUPT!vi_hhdow{t%~?&V55Wsfb;D zIQ)@-n21o2O0r3*6E|!6U_qW#w5uj;EF#P@J}P=x5Bfw6;>5`ui=$xDomS>)Cqx~E z-GJQvloV&zQG`Dm2Um{bF*=yrxI~ZVtl4f0>4u;r`UpL&ot-cl$N38;LxxQ0p`4`K zWiL4hIIM(gHaiI<2&uQaMST7upmwfsWC-yDybs|$4qfANhyu8loZKI8@)QBHUAMH8 zE!=E6!YM}uGuiH|3;gK3Q@TF9uaUHg zejh_rgKYxJMy!9OhXHu)f~`+cRuw{C4$3Vrayuo4oK!a-@Yo`@OHIM`^5RoIfmwq4 zFgkbdpt0l&l4Ge0-6qdJ34KyL;Ll}8BUTE80yBYhMX_E?x*2_9aD0Z#6em5wO4?^c zE;dE`^Ve_sJoi~$Uz-mmFOXjD#|0E$@ZP%JhZ-Qk$&A=?A(3t}%z&No`~pW&!}Ywy z9)leAt7#qQf$rSWKrElo3>7--J}=rpNlLl^>l)W}zM7L%*&2A)wbT*F!NH{+ptse` zhQfL;b&~L*Ni`YGj;~;r&t^!b4PX+=i&R-$a|GdtuDhS4zK3e^P&+Bb6cm)z>zZk8H88;*nKyW zol^o6^pNRR->Tin7S3YLP97O$`#TI+GrOswT3n-=&Wq68g)tZ=s! zZKRCCNK8@K2qKK_nd=jl9mx_Bd0&N~Lz@&aGB)=@6mk3UoUnr&YQ}Vqelpfe9*-bhD zZXv~O@*dJxGh2SAeRBAx?m-_Hc^r4!*HD?wX5qNzjM(9b8GUpqODdj*CCwD1QKJt= zS5i%RHmUMR6p%RcHrM?AfvQhKZ&kfR!#F&k1RgyNGy&ztS%$VXxIDW;ur_Jg=~_LJBzsW*;#-j zJvwMaUAAe=SO;2|hSxB>%GQ&hW9Pf&awVb`Ex!P1df3QJg?fXKEmoIUF5Qb(i{eVG z*Hl7%+Ij(drfhox|%dAnq)Xi8dS;n4LxCd z1%XQGfTWgiwBkbySo+v`RBK*|j zsbNPhr5jN5;T%h-I@l<=(nmJbq+Kah3#TfI5RVB*UtF+es4J~kw7QbgJ79J##D$r` z?{Vn|lV^INP#5^O&2LHf6YNm_2t?F9TUiSUQ*0iEoxpqE* zyN>!IFBQfDtCU4k*~{+ud?T(O89>rJR-*%u)sk+ZU!bed99zi>p=pgdutu=4Zs0uM zd?5Fw&pPd2RQnH~1Qv_MH)x(9iz)alyeNW|I4V&dg?HenfdX3F$CtV@=Q zkr7V;Q*#dqq(7mRwHAe(O=`3r5T9Y$H}*J9HDeIS4=?_NY3k5lsW`s1hS={fVI`iP z^dBB|cm9ODDfqd&e|X&OpX_{NkB0{*dk4?D`qcf)-iiMD=J4cDf9*Zie~-E+&yEiC z_sO?Mhu`7nb2$J;h9ptE78;PjyT-@_M@>GIF#etK`_3t0ZRG&+5#1wqwlpHqE2G)o z7<;YfxD9LqpISmhdE+H5DpfT#^qt=A{7`Oxziykg)3(<7rG?Ai5Dvri(n55Re&X^1 z4o0(YkUVfK)5q~9LE;wjq0*IX4}Y%k2M=>)T?suPGnn?8t#95{CnwCDN@~cdLa@pn zupq^S9|j|Bg*jZj+MuGI$3Yth+TMP+f4KXnzMO*EeRj0}R}kvXZWja<@b_%c(*Lm$5d;*&KrUrrvqSzXM=6VQN z${MM3MYzO65k{GnR|)Gp;ZzDac9LvFRhlSQNj*uRsmsaR;dFoWdW2947XtZ0su_5O zdZ7*=xxK+H2rgpWTt$~uhK9V&gle{xM;qG+WM7tW2IA7CqTXts+H$!UMCB0%u6sKOM1Y?j_WG9j?oBJx&8yrum7(V=v(x#?Qe8cmdN zs*o*2`QS}Bbj{>l1-PK>;C)MYY?ZWa;ChZ*dcO`1mJYv|$!rFLhNC$QV_R_^ZTRbq z*aTck_S@U%*swpFi#R!vSWclZP}_2(NK?2ohWCU(f6)pbIQo!#G0rW#Rxb1nmg>p} zoX$NW3Rc{7c{DkbVWWw{5P_!o5^wEKH)OoD+7pq*&}vU^A7C9h06QFnjuNq=|eDb&xdW?m-zvTD^Zm*L0(S$Zn>>9LU^3jcB4 zsXB`J7xuW$QjQRn+{l_4()enLsE%kl8RiICCV)F;U{q$pCZ5 zvXJvqhJ8!mW`BkRiXp^7zJczf0sO0YB)^Qv*&mKyB0snFAF>W6>j90EykZq4GTwD! zx`q!esU&g)wkpYpCZdcd!KfbVjxTbBuUcMaprobI>g}Vk}hsWcaG6 zxLRHhei+8q1Rdi!^+YsIa~_nQ%uLpEBpsy_R+n;#WA|~P??k2 zz9TWZ?8+m~ljhh{S{lutN(u)y3YK&8Cej45JR#QP4)Vo@v(;`bFL0ZuQ=z2T!cIw_ zEz3ESYxc?Hg{*5xSq7p*fVnDXoU;_sD3eZ9#Q=;rg^4DlV}Rg*w}bfL7<9S7eF`@- zoCnDi)Fc9BB_)M8*ZPdp-nJ^?;zIK_MCG2OeS&uvOWnyafuaIof+IlKM)FhEZmOB0 zbR{}74)JPq0UnjXQ9H>&rjV}6DFh{9ni5m2oGH+I$}x=FCmbRPQOn9|w0ABRBA6ZAC1Igs-|2BVe<`3)7^a7>PV8AXNU&k3expFt~vw%@>&5Ao=4WPuhlg!K^wF zOkKW%mz=HmR#>I5bos@Ical%iwsg;?*e@F)S(tLjGbysk}VG?*2^0N8c#Kme2^aU3RpGokK;^dlJiOj?X3ixtcEAgY)Uv)Zf5$JXbqyBHw0tyozNc34!+-xGmkm&M>s-Sp*a7kDfW>7Go+8@WLm_zL_%f_+pXka?L z`AC?n@?L8tJWH$VYk@3p9Cc&xH<$(7BcvC0X-&ayiBA9rN-2_v##hchMXm`z*oi{3 zX&DKR{6e5gYND~aqF<0gC2>4wuzgd*@9Rn;=JM`}jglbZjMa>R6S~qaOV8B;OoINY zIRoARhXsxpGhZ$yQU06;Kp2SYZ>_(aPOjdla6WCH58>uKL+r{q(GHCMz<+1Mq5Lz# zh1xU%k+Skrq|r&S*l$s;28>8}zmiEEA{>V$;kh+iOk|kBCTrOw z24;k2CTGlkI(MsTef|CdlXYqBl)YgP&RSJ)RccpzXAzoRg}8`K-4T03jenf7IeP_7 zyw|(go89ake=df9*4GB-8_GS66k!)Br#x*7r@V*+6|N=~#pf6EZl*=Ffl!sxh*4p$$otnbXSO zI=xpndp9@WFPiqo&u?~m)318tjrHo>fE=_DF}^9p)YkQ;BZm;E3TSaJfLA}g`+O_> zz9(w@2M8(H5NRMRN9EigNG=Rq{z`cTomHh3l1GgwBNADZNSsVA!$VNW7i*V;3YtbC5b z5l?aiV8(Lu$@zr;0&(*E<3NNjGd5sT7a&Bj=mAVrha9PnLrMLkFH4O*<+}T*stQ*^ z`fQJMukALIF1RK|RWPxmzN<@UjE^L@gp_wKFTwe~J{@fSV`uaKzq9%8{mti}cfR^# zZ}#)LIzY85yB6{5E0mYs6m)I=Kzn<7=Q;jQ6|&ephHfDm)V zPN+}FvW?O+DY9rigR2NqWC8@KmI#6vRlow?Fh8PYYIhbPpt)~|w|Fju$=LIR5Ppah z-N{X0jN`i+|1h4s9k;M<{J5p{sOU@>o=%A$yu5My>z~#Q%wKNvmJd7=7r)?l)C>o%u256oNB@&9{8dWAU>fGeKtMja# z<<+CzYRVLugB3UE@(P9O#Br4HdzO#X{Pku(nP`&a3NK&d5FTX`@+zp9+ToFHNw@BV z0z}Q`E$q;A{~}Qu$C$VFS_^-_Yu%qoRO$mBnI4RJb=i1R978y#ho6$(a&)E-1G*Q- zG{jo;-P~#oU$(x7jQYNXJ%R6gk0+Dwy;W&K8=X#ZBN`IFcu%3)>GN0-zrCt;DV6Pa zD`sf6o-ao~3|rqzFZZFSVgCo0|BUAkzQ5J_em5ktzK?u7uOED`_p;$~ZnQ%o`wpRR ztezA^-CM05r|9S7s~5=!ZT!K503Js!u*LD*x6uL%_XG5bA?=7b0${vu+XtO=K_LG$ ze1EIOAAcTP=6%hiGo*YXl3#NWY#EakC*#M_p!NOF=ppp>vv&3K@?JV$-Iw+r2>MAA z_9nitmpaH$jBokZ`RZSkgf=?8)86xqn^}pC?CIz12^|^nWv|)j>DTLDJ^$*o$G^AF zKhM4|Y0@VktCIs-`E=E}LOmW(E?rw(3;G~_ zfi9_diXPaY{Kf5PR|x?feSta1>q7>H7ViLm^&QuONu&CY;cekLPjySdtx6?zn@81- zYQ22!LmRk)C==Nw7R&k%!}swsAJUK7gp7_NmY<>Z!AqzgFhIP?JNf$_J{Uyy1! zQI#!h>R{^@V+EuFPQvTwE5e|d*R=+*Gc%n1#TNnq7Y zYd1D5mqs_vv{X+|>?eMPe^LB%Q*7ashewgC*n ziL~_w)_DIvuMigRGh0C@EG0NmaJx4dp!H70jngj)A&gCQa*M({N-hul8CI?CiqV!+ zl*N|PC07_0$qC8@3mOd^Os1~~mpGYvuA>)~d>me4(8_aO58iajRjhkuqz79`n3VZM zB0%jE&>i4*G|3VAwHfa(SdSe6N^d23>(f;(;>2|n9L6bnM9C+j2%M<(syL^fHo6Oi zg)&$W4!AC(Dp=m4KX?IxI;a3e*xg8L7zeUCky`U& ztAdnHB9UOP6T8#b0VlE+jui66P;B&$x8Mi6d3)>ThC#A^@1tO8z!#l&HX$pMqOS^) zpb^xPEzv@d+NBJUkgb(EV_CR)vRTn&Hk;_LZofJ?r%*R?XDdWX5nDg!#uO|GC?Enh zw}xz(T&&EEWuD0PU{2d2*0(0gy`+4ZxhW zpW`MU^Bm{0U6{GGCp^V9(x6bJR7$3wh$jG`7IXSC0(VVo8navYcjb&$FUCgCcHR!A zdY)?!0#I^qEX$6t?0e95LC+1R$@VFs9?C7sbjHag$_oyarDsSN!|ujE97EO9WEZ1% zbsaaHDFfFWS}NBkqjCB)kn?6CL?47L(Y$GY{=Kz82@pCAJ;d`}h8?!<|FLyX!wtDUxq3bDGL3<6A>d%-?pA(4 z{ct3~{X;0Bkq{n)o*(Bqe2PpIIBlg)Tb>3;fYT}%Px{_bV4)U-VZn&=4JQIwx|DJE z@ePO~k*X!$IC=zd)Mz!t?&V6On#dVuLj$V(K2YAMWhECsT|kd@iUAj8R_3fkfL3m?;oM-OsDQYvtx zg3xK8NZF4$0lfwlm$>xoNQK0%BNMtXw4LNwrL<2S0t!y!+JDl z8WA81o|p}DIC!UYDi)I@@=Ial%t6;X3s%PRacI|(_j~0KdWoT+jLv}`ukz)o)7y+h zj>#IPjfgVoJ+g}M0N6ygjcznrylWMcSGqbB-~whG+9(SAO{UfV5|Vy6`0`mBqYDf$%Ci0} zF<1;8RJ(mQkKH6D!2aar=qzR~2{{pA(n>n}mZDNK(au|z)JhT~vT+N2G34+K@xp&a zRB&z!GYji0!tBD&y%Y6AYii0$YXGn#O&p)(Fn;%$4qzq$KA+iv40th-(-wIHLR^et z$_o=q{}eL{w+^qS7M&WXRd;%@*9^)(smy$Z9zLvBQKr z{oUg}FTOhJKYqqjTKy-7k1Cnhs{8vGzG3B;t(Mrql98qL7SV&uSOKpVK*huNO?`Y1 zKlqO=Y#VUkaKUU*(}mLVH8h-;xR<>ziF`WV&8=3q|LhoGKI-Dw+3wCs_Yv2y^Bm00 zX)+-#pus;u&#Q4!#>L|c!^;a8A0;4C+3+aDu_o*+6$iBi0>3LHfl@KXoyq~H8c3%n zN~u<$U?%D2M*>Xf%P|J(uQr)T1OroXhA~=Q^MK*#EqQ0U=nQQC6_me zooMcNC4Rx`3|O09bU~xR>PZ1@_@zMBJ8rW68f zHAEW}8W@-EVl}SqNHuXeLvlp90pS%cqG}DO#<3B|Dy$86>QZTn{bWdHZxDbCnu6yl z`$UQOFWD;=785Tm7w%4iBH`l~B`Yfg-l}T$)%XRhrMxSXVsUSPMX`Z-eKH$w>t zy(IEx$)l?lXsoZ5$&d<*%kWv>Mk+dDeczCX$Y0171?$2KMVB`Wq)ii9&4x_-V3JdL zG+hK~1?RRIUjWih!jEcrbWR8Lh{2RtD@q8>%{ZYnwsYWntaV~2(ua>n<~sbxd2HCe zu+`@4QWGA5L8TIoIgs!QR~2Ako=k*Od|JIS5jgc3u|KJ}!Lrh0L$VA!iYK4Ox=%he z*|!wq*@rsO%>tF>n#v?$Xri(Pk(B7F*XDXkMAa@~p*%7@5NuMV3f8MFwFNvdE@2?i z17}lBD3V>tmC$FlkZNRTGSqZ75;iK#7vjCH%jOPk&E-An%W9YUKIt<|`-+_=3p6gP zNG3^-@g=*9PYnZXm`C_0aV9WPBWsM5q|+*0vh(WO1|Ui-gR>oqS4&u$8Bu7FuFhmx zha>%@;o#3oL`rxUNi4iFf(*|oag;B0w!+(p)ZitHijKd-|PtKDHEc~ockx{na+ zwXr2x4^BARBwu}$20!x6T}5!_(LFNnYN@wZElZs>SVyicmow|G1Y0(l|3}#WM|ho! zAt)@%VLlLpS^+M>6>BqaO&?ZSDpezz1}-g`7Sh;P#>)(cWoK2X-`LziBGpMCAAwuC z(yA9!*mOI6^n&BJw>SO~fn4WSAiUSefaMJp4P%6<$4FQ}ErnJL&e~EXO}Mn4sGA?l zQ!+_YtokR!*}=U#gk4E;p%Na76ssVUyw)N)Wwdv^8y+Lp--)7*(}ai0`uv-$c51Ea zkTteY03>eM1?sD|8SFN=OQp4i*FFR;-0bZLL9r#37VF%GEE2;$iHQn+Zjd<*$r_8e zQXXj4C6G>k3&vb^(N~%8OD#tIklKnnm!kpv--!^BmO!hR4T!9yDJd%85cxHpeyIdL zt##lEH$%0is0gUMWSp#qwbBWjCkC|ps((Mb{d??}!Hq2b_||LYN5c7y77v)sWG}_~ z69{cjrSKYu#t((sbaN(iu&e)^cMuB#=^bZqo{yScAP#h)&-qkTPj1#bl1{ZgJkD3x z$HXS4AU-Z+lLw$c_^~@`6WR9a^|EjF83eDcu9`%8ubW z*fQLg8?rZ2Gyq^-sYv_ncpcz|=z;#9qi{z}S;L518)*|f7r<)vE_ge#)s{MJ8?Y)B zs}x`W$XA_5q0`u)bszP%Voq~GnNMh}RP8va=fh5l8?qdyk!bB#Abtf;?Kl%S!IqBl zAmLd-fcd%-#!3P%2ZmRXg~cotwp5h67NW$CX>zoYNA<3;u?x)_0W#-Jd@0}K_4S`H ziQxAt0Mp2Pf)0JavC1JRqCY~r5!B~8hVk44>Ge(oh2OrJCgw_muu8lug=4BBR6FoF zwKkpQCe~KgXPof>gsBM9JwF>9A7;2`o#hPIOem0VWjYk2<-o6Ju2*}`7kbJ~nqX*# zz}VFi`@Inc=XM5!K3)Tggmo-2=&K+kbrS=B)y{)jm--87SyxFu7}y02NfW^+79yiP z{E>zzC@0nRZOR3|ID!faf-W7@@(lY+R@#!8&YIFy6Gdszb4k}FP4)Yu@sEgD3xX05 zQidRMX4aQp!xu7D<6P$G!lH~C!jB@HMa`9;EN(50vzEXVly_%PC!D+N1l`!Hkld&o zM%A#yI8rvd`5^1$RScDCCfFZ8$!krLLdw5ir(F3C7}WCO#}7&W{iipUem* z$T^wkHo)V_v^)MWSk2)gmAq8=4jg=xaj)PM%dWJODyH?J7!Kt`xa_-Npqv)Ly2M|y zX3_MLwVFu9(1FFrX`3}tG3k-ZH+c*SMZH9)}uN+b)Cgc?qu6% z3!t=uDxYg+w1l-Nzo6wr3NME@EzCAoT(4Lr#rYhGE0^0!<<}}lZIXl-U%#9nJO2-B zUn5Ndi3Hg(8V=w*olSSHcz$xgi1^1`&4CTAaG%p?w(GY_6sKo0Tv?nqu2LJnm+|nP z7{r)gVY6PIx3@tXyO(fuB;V!GW<4dr(Lb8~pm#`>0uSS@S+Y;lYp1Nr=3Sh_sqetf zugyBW<2RSQlWT8$F(J3PlOh8$0Svm8(T-n)Oh*zCQ#xOkpqeTpw{Y7Vo!XB;h;*b_r&RCfFxPMLWORAzaW zT%#HsQzEGCk}>$Ze)@&pr%Er51V85Rh1~t|r{VjzlPQkSNs;LU7! zG#I}`u0PJDa1cx*GAg~EjCoM(g7tQXre4Ioc=mXisGYbiQ~uBFvXQzZz2AqUG3n+Q=Uu!vlIQOr5fM;iH-@bqPxBCyCfBr!7{!;AcH8$3OT~n1@ z|ACM(aBr=7=7}{P73m)CTd;7y{#2NZ)pvN3p%hqf=TeGtzQZw699+gIc@~{$!_RCy zyKn=&KxWm>8YJ0mB)0t=`4uoSeb`JMzP8`U1zz2W51mjt zNCCQ>Tyej+{c<`Sj*-YFrXFc;u22oz_MuYV;Mx0uv{ylY`~JntKmLC9;PL6^-&O+L*xcM~x#ray zfByOBE$CZFCvZ!JxFF=eUP1tZQ3%ZIR14~+Z{RSB+$MbS@`m8Oj7KLSK2s3|z9GUbq zgyEsFa>nT?K_XAwfjix!c?;!~5uA^PNC$hVF?kEB{8{r;%WiQ^u|=PGnWywOJl~l; zeKkN3Ip8lFNlHC@?|{~p#6Z}}Bcwv6|LNIugbfr0PgdnhWNZZd^wpc)nYgcd$$tYH zQ7Und(H}MnIM>**P*nA%>bQt@X8)z#Cc~*+jx2RGo73!rD{Vo9Bnm#}$$mv*&BA5@ z)oqC7rp~?{oe!T*ClHvk&{;VnXlV~U={*ZncIDIvfkq`$iOLIa&CoB566lalTkZtY0 z8lL@7Bc;pkK`UoJkZE9VVuTytaYx{Vd2g=;K;b-dJ8|a?t|-+QexKRgHgu7as$Kpr zWqN0lCVThr$3 zy{ND^M@e~(fAl3ewmE{9NixZHFo#%|`~}GBLV=B_sTc1<(aK3m%}|AiC+2@|M2Oi; z*>^Pj$JXCxlX3qX);{iaBdPTP7t&Ng;EiMEiYi_hE=$n{i-y4iT!KgiA(upPtHO33 z3V?>^r+$+ZQsK!BuM11yT0huD1zdJExir zHV|P-z@BI^e5|2RG$F$lw5r`+0Gg^E zcC64G#xxle*oqrWw{PE8r-h}9>h~Y*9rgQi&E3BV@2^aL(rC(l&@ho8r;ifmP+K~o z-`ek>f_SJlFgqVYi|LoiGx9t)Ray(&B1PV!S*k@M+HEueA~u7sto>>}e=`GKUm}V3 z)r&2xt=o@PFdbgNX?7d`zqxz7Da!Zl>F{!hjnvugbF(lIPoGJjEzT0tMH@+~cO*!o z5S-gQ`Us;ulcfDtzK*RaEnaKD$>m4=4< z?eG#AX#ldALL#%}-V71mJNtXz9PB*Y@AjYWBLU*Khx?DZN1&A(y?6Io;p6YmTfKK* z+=!jV?3y?RI7C+U`Tp?7AurH|Td_jkU_v!v0($eb-9N3HxJY#%4oMsz#=o}diw2#* z#(y84;YcV(_8LO%>E+;T$h{X@Tvk|Gkfr8#?rO{2WrG9~VF)O#L380I4Q1_!EY$jz zOBu7Ak}p#g#DQi~ zg2H(IPGpjs$sU?s1?qRrDU2wTG_0N-OxS3Ah205AOtDSU=m}=iL#4S^=LFMtDw+P1 z83lxL1MrK>$=MIbSVA&RZ;sajB!y4cLotS|%PFv^qe$}-ze(#3f;G9+heK0_@2Npq zx)@XILFQ_6ZX%=U%Q0-0M-zB@SVU}x@cPfY z$KlQJ-Pz?8uh@nM`y4m)au@JA3V=$Mi{whQ?-29!ME&v@0{((kjC?)kqjT_d(+d_2 z-<&70O0s7gUy^R(lPoR)sBBqw#BeHWI6T)7xphWnp*EFPE)Wec4Bs>FR!TeAed6$tP&h5 za~8A{T{k?6$`z zM|%g~;BM&t?%~1l$}TfEbDLJ1!4K&I|Dt&()@b_$swIU6&jXT=sVb5XIs!kxYyn3&8s{sMYheVgW{1`{*tgj3;gy!X-?}I9n#Jn}tv_%? zxoY8Mj;Rmt*$9Pm^);QT7np6>XiZ~H_yp zEJ3*z>7OC>a5v2u*)M*Zib9FXJ10oUke)fwQw25Mgt-3onR{f(*SU6sDlLKmtx~NN zofFKUX3X?St=w;yC+m1EbqXb}6@x0<)Hu6mBm&$VJeI+2U#xqFHrWe#I5>YIH*qsw zESyz~SuONqNIbzT&T{7}RhXgVn&|hRbWgrLeAMroSy6+zhz(UdNLz-ow#?4L!F)5F zT)j!h-Z(>hV=Ty(O77!;%?TJcvRfqcr=jz8RPtoy**bhXW>`QZibiPlAVDnH+&fGD z6HO<ChMSu;nP5peQCw(jCp> zc6i$Qq8g<2w5)U93RR6}B*L`lqGrM4&NU_@qHRIb-%Upr!V!x%H!mgx;YOyH;rIy_ z5x50J6OhD5YM71)sgBjLxcjX9s+enip&!C> znS-$xugKcTjEdJY1bv^CW$8`8aWrvyxL3`?RTzA$Z2*=Msi{j*?o$QJ^N#UTJ2U2Y zOYf?HC7AYxkEaMrknrtTzD%@!!4z=>>cof{|+BRm)3dsQ1+UG5sGoRY*>d4 z=2$ao6W_#cN{R(|qIK5SK9)(Ssq3@T*l#Jp6Fe>GZzsigO}80t7PRw-f!N97v)&z7 zE3Ow%Q|jX;h7qiqN`}Xv-6LKSJGj)flSl^6cn}PW=uzR+T!;PHtE)M;$ouX=>*x(4 zxHOg*x{du7wQ7UN!3quHOf_H|uvDR^Oy{Y(E+)wCGX0Tz8=w&alF$ZxFMP`_x1gF3 z2bINzoex~y65F6r?bjcgYYnKd)?^FOZ1lKH!dHT7FkFqXz43!J>q98VZ6gHarKei) z&%h=Al5Igu6Jn|8|I?nm2Nn<{rK88Nxzk9s!&r<@Nz3aw(!S1Ku+HifR`{5OwQ1ON z2nfvS@M|348(j)1s_S@HF7%0p+^nTUAuYgiRYB z!Z-R!d15!dkeFGvH-9%zTS=1%p{I5We`&=${s_2fk=IF zg6J&wSAcb*wb`z)Ko7PPh&f2xOh!7`FdV33Oia*nLt^r z3+g2?<<;4XtGKC!g(ndJ49Qrym)HVHiZSdl@UQ}X!tp!g4d15ONO~tz+}bjo(c~xP zCoVfP4R>spBbZ>pX}8w)Z^-Tl#TeB8pS# ztS1p$u>b_)ip?8a!GMMNES^*4PvxBQ?LXU`Dx~F{>f3xy<(LYC-S;c=@{iTD{4P1?T5!V)H2@W+&RlP1mQ7k5!imi*pJv0(u~((9gn>)Q z4>k{RvL$IcGI2H^pH_!D=hemGo;Ze#WwWpB#p>NbxX^Aw6sq8;-((u*au5xLq#{DpSGs9+R5}t($fSxn%6?EYY9T zgCix#6+hTscr-bC$Qa7r4lf6jLkE=*lu*WhR7%LscnoA-_I-JvGl=zkaz-bB9s~^= zj3Lg2xB+U^pbUYu>vQaB1NZnV_1jd@CQ=thi)}t&LzvQt7D;P%g0~E_6v&!&>Fb8h z2>uv1V`o;482f{TRpA-mos?#L24| zYb-7pzSC(VbjhUD4I$xIH2p7X=O#m(~iuUPq82ZR~VyA%26})**=r433 zPOC6Xiy+sQo{4w;{Oyg|sLPB{}e?z2cl7s$pBvE8pnNZ=^@}Rxxwh zW&pKrXrni9#m02-`WDkMYAhjkK3gz!=5Htb=YnZz6ea0d&GgFjI0Qhbk&kMYS#yA*%0+V;Td$$l{*In8;~jrRHe>i&ff z)Dj9?j+OgKjF7~<;zIOw4NLW1b;N(h7q+#CxK$>!5|JL`R&h8NB`HIaDAHrxw96Br zX!|q?&aH(D)ZXs2;m`C8NhCDyg~Rd2u;1<>rT)stpzz1^JY)pXp=X(w$j?KRBEKpP zw=NOAoudrRF(d&QS3$_HhO-fTCpf1uoethx2&p%Tafd+#@(ca_9x8ng4-@$ud^e!zWMT_T3`4i48Eg;Q(ymEUg>` zZoP%^GP#??w2<9nC?A8k$gpy137BQ=thzfA5-ujEyX^YYN&-pJ-KRo|Z z*;6B|9sBOH6> ztU)0|w${9mjT4|`7^`ngbb(!DAXf)z#k1--oHAMr=fdQQj|fogi{2u$ zZ6O!?)g{twK?{X$d(K@{@KS7JpWlYx#DHs|N+|(0c(@yq%+vz)P@cBMU_>Nb_EB_( zS?81ktEv&+E z&YT>Z_x`=fe|cT?MQ9@3QagP3f4jRU)K89fP7aSu^wj$5u4@F+K<>(py-0F#|G!;o zX@Op$-0i|27vpEWine1c3;w)^ z!zU0l=O>c`yY<50BwLf^rm`KRB<=zAtO?S&EB4*Ddnesvr0t_`DWZppVI~Z9=rw{q z)f{Y>M-R|KRkA))bw@#hJ&hZxnQJKmYlYD<675KLq%cTGPvf#D3oK3?*tNc5E7~r` z5CF9iL?@UdPIU)17W`08$5SH2z{5t z5T~3)MC9dOV$op45v(Gz2?DE{Qq7iwE4by9))Jkym~#moXF4f{0#UlFGGZ0hRGBH+ z_5@|XlJ}^AfDhdgbw@)Ql2oVIRER&*I?#SG@#-Iv&9MIN{?73+JX?~iXm5vyOz{q$ z_!J{y8$o+oi*%)pC(?!KKt58i5FwOjx-op6oMWHHj*MR2PwBEI^)0jNmVIAgZ|-1% z2=@_`(3f$sEieE-iCHIy`i403qaC-RHPAwMGd&fUQrc?c$$0Yxw+&^NZ6-TxRN5A7 zu!-qK4|Qf@t!QEWGi{#b)=y#axR4e$7*#nwMs>H!ch$ZyZMczhGS^O6lDccqeTQfR zqz(|VAil|@kZaY>ej*{kY1SaZJGe-z_sYZ~`F<`Ez~;E=kATuAlKpSi*br{(I@(}s z>$hi_QXr^NkWw~}mLs`^#v{^#g$V3r_JQv(RzQO|-m12Vw{Fk1H7c&A%ssshOa)() z3pjYKGx;c9m7a0 z8`F$#%E{b>@&5Fv`%VA&>HZ#~Lc9BWPx?r6ck=A03k6?WwM4Z}>9mXWstfh0%d?b0 z?k=YD@;q5pw1_B5hUIg*SYcqBcg29r1;3E$Q9`Okb18MH)*+xGT^H~)MdGs89UUOv z+-j-kUsQ!?m)#YU4Bm?{$e5OEoh`f`p6@fxplA>}b8L|V2B}HDtE7&QwnBvBXd!Ko zaEMJ7G&RqG%6zB_j#*&dv@1XrtD0>mD@HkpP{JPWEkXP=wR3vEp-~YOV z!;Md(6vo(_Rph^@py_6|ngrqirOSVTu)lU7P8m1LzH3BpRG5}W=TOwE-AR*aQ zlx+^0*XqY*-1Fk_8{D)U5>z6<28lFZObhKl^_I${ zTP=!Tb&L~9Yt*-yul0_~3h|hWlvo5qul0Fd$5y52gCeCQAAOeoT@sXo4fn9}64tM_ zIk=6_WvCuTiWzmsNQ?YHHBuZiOguip%aXfcLroFG1|H>1luX2q*~S$?mLs=Dq6rZ! zA_JwTl}Ml<&U`+hFTH_ZZZx@?Nn_s*W^Te!N02(7?-EbRN{|F^KqF0X(_%NMAlU*4G=a-_Mb+=UQcZI$y4*W5pUm})~ z1YJkOsjL9O$2w7P)bTLzk#ZGPMr0099#7GbdtK=T;ehP=fu}iYwPdycBlM0W)lq*- zC2%(lU5d(zXi7^$u0JSFJL~V0M`>1+L>Wikr@YF7PU>q#WPD0jm$0#GX|+Yq3JloJGgv>B>DdUkr!E}LRh-)j9^O(*OWu?5tJ;Cg2?a~(Ua54tyWY&76eO} z`V40-QxhtOelmCiW{xb>!q+8{&Iuyhx;uYDGU_wj7-6q=caFP!1I9wj-rpV`oa`Mu z;}=|$cZqWY_Tf<%j@%=CFQGc&{o|cy`zI_v^0M8(?8%FXmpQ~|+?u6nt&y=_zr&oh z0*?=mP=fnRNGuWGb$52Z#d{>t@Rq(gJYid-3oEqum`|EQ(_bCz?mv4(K<#~h!aLh| z+>sj)^09w-fUWd3TV@ZP>7>Eab$p^Ouh%67y4Lq1uxg>ulS`6TjQWae=Z+y2bwpo* z9|*0u5SLq+JLB>sho1X@NIn}%ARRBT40dN2cdfy>)>c6k6xJPVWB#;8fhQ&>GClIQ z=@5AOWv#td4SM!wlmamY7n6y%!$sfv!@X^3h>fkk7$7bQb|2!p<>)eB^3SeJ;7_ge zhgd0Gry!?R(%IzFIyH9lT#lhsVzM2)NFsnwhyb8CoTAqVXrtK)mL;4({)rGN)U!+6 zrN$@)zTzJ+ZLUc^(Y$H^&_Vd@X=Hl!m_n(a&5`rh_o2U6?!A?HXi_UzG{Use z_YPE|>IYZ4M14aj5S{^)3w^ zt*b^GUQXAT&ribRXSOI@WS*ZQiWJnyQwbf$0|AtPEZ7`jhn>nee7m4 zz97D(7zU^C9Dt_#$>rt92N+NKA^}ByFydoQO(aM23)OgIqdZ9wEI?QiPIpj9f?0>3 zCQ9&2`6qvXb3r{K$k2+D^B2N>Wj?Bo>l!K%K9D-DD-#?d6f+W%dXZLpMS5o%Y)z3sLnj8*&2sCm=$Fe zTM`*Co*2vIpEKBf-h^LRGv%V_jWzMU-;6o+}fq%No8t zLGzxoT6rya)(^E4ETu8AvVYwDkkJ1?5rGK6AOoJsA3e?;)S+k0^P6aiC99k7g~;R@ z&D~LdCAf<0k4sC^_S_@`ThYOQ-hxOfL-=ivzqv~}?6;L*BmEt>!#QXTBh3f*0U%|4 zH2|ib-(dV0A%dpMQv!_x&w3#Wb*>Q$s_gzZ-MWt^|F7tpWI&z%r90|=JbX`1-X-~0 zL{`=N5I;#EUG>N}l2h=cdTVfjJ5Th`AL6KZOi-Ock``vG)m-s~#)mTq4_A^i(?wQO zY+w>ZO$Z+87YD`%+^E!ZP*8R|EuMI??e(JKnr6pX3(gWLk0a-U=`Ef-AN-?5vBJtU z@H2I|&g)aRIgiUTOz-$eZCJQTJTiskKS74ps5IBya*vJ_Wj%|w&Vz>PQM7=BEFzOG zIoH-kgQge{5y+ri?IdkWtd&@O5=RsmAVcwks0wdI0!B62&b`+_gLuv$LL8WIiUeF^ z276cVF? zULXBN5b>S%Ejw7F>h)3xya|flz+IISRl@!o8k0e#I-HD3^fno2s;0@Opqk0&in0TW zP_0T*{-wLh`F?e}k*pYPjQ08sH~A8AAzV5>FWve2Gjff?e{hTpdZUXGTnu=)Zl%aR zD>Y@FWH)U2v0sx%sW1Y8LjueX;ACM!blNAcMhmyIK8Yx@m~O1SsmUPbXh*UnG7|#Q zVvrUgiGK3}kr5{ylMKCa5Dl9Aqw^Kx7bui^i1wduY$LauzUYmAqMT4SaM7^LQ0L$7 z+`V%LcYi{Vz%n{QLS&x*C8NfrN3F?NjuQi5W`p{-t-GHi2>r*=bTZ~<;1-E`juPJnB{mMS0 zO^olpd zz4Xt7bBMy)A;+jjMBb{Lh`5PzrVcF?3CO!m*;IM14Evq5J%^whFF=ya=X_13f>>sEGst+baA%AokqUep4l#&k^Vla2s# zBsew1-B^rvx1JDf=ul?L(WCzH)fsm+CsVnXx8~ABy&GM%DCps~6zujtwpnG9>TZl= zl(niCg30XIOhFCe%+#FowgMP88I5So)P)SY7hIESyZhEPOfvN&9884j3sN^stD5q!Ea2NV+S2j+*B6uVdl1CyHb)u-AQ2YR znd!zwWY*wEoLm&`S{#Lxt88Wy{hvj$M*2VYW|HmR>dHh4wWNyFv(9z|A7M}1(^$x2xL-od^ZV`x7 zSEMT$mbb2xo!u(`Wbk%ue zxJ>&eV)k5D+3>T5>|Kd9I~NxCp|Qj@FHFY1QdxiBxM(Q{YL~K{RIc zp^YsJXCv8Yv1bxhh-agj*blz+PmXpN8b~s7q|dn`3KEj_VNr{002hwG+o6L}<_6=W zWpUhX`eZST4WA9q4PO;!4IdQ;4Id@6ui+cUE?-pZe>j}K9S+COWUZxv)=8Ns$c8pT z_T?z?F>IZ%fXJkH*5tx@bqJ3UhH{1=#^E9Sy}R(-4)-pkQ=SRHR?-?0cNVi0Rs4yH&PAz8 zKEsP42@jE+THG!#;!$}||CheHnBcVATRKmidy3*8{V}Nn#^M-}CtgCOWQ3g?cwpcT zFsxy6H}KC5#H=ldzgr6dOQ=kBm|;;GvUE3wBT8_jG#^6&EsQCtkOVzuF-|`Hq{$Gv zxF{&lBS=7s2oFK*-F=PtYcUO$14*Sm4ek=aLwKTq1U-qL3)WWW#WP-uq|DAd*Tex#~)V zSuV!HSsAdxu+bl0df2_z#6oWH?9x+%EsN5(TaCSQPsl?JE%fj+KZfgjZRqKv;>9p@ zy(p88A&|GRhag0EQ&*JRpl;uHoSQGq$*U+yqsjD53jxm1p+0G#m_>&bW@m^IJMgQ~ zrX5qm1GDLvoy~kI+^3oaJ!HcU&=OOWcy(LQ|DyU2KT{Y+J5mE@WWfBm4n{K@ykvfg z8z(dXTD==s@nUoKZg3w+d&g@<5?+#$c;6)6{Up;RJ~zz;{0l41TIa$0Omzmgb6j3B zept0`COU3?v4u;3$Xld8Wg^nyY>p(*TQ@NE1RUgv&74k~n=re_{l|NM=^phTKV$ll z{*%K;UEPa~jCi51s{?p#yuToj0&wEe_p={bZ*gBBveIH)$kxFP{O_B(`<`1%tsimF z0F{wX)`FqezQ)$p%a_Axe>j~^rZ}*ySiRNi_F*I(A#VzjsO;{XbRS`T=+pq?oE2lA z7;eyupkKOBRGec;S?D5ENXgE8YHo*`_&}10tW}^c$dt zB>-b6ZjQweX_?Nt{`(a*olp;Xvom>R0gVhPv1%wYW5r-EeNPdz&4c_Bx9KfXcSlC-SvX1`FjyH^Iq{w?G^&95E6=T_L}riTQ`xUOVdMTgq2K0Xirl~G-Zow{hTI}Iymfi zpFBPJE7_rJE&~sqKT1Hs2O)9$3fAHn6S0-99#=uoM9_oENY6AmQcsQk+2!aA=PIQ) zxxO;?u(9Qlp~OmhwGl&Ncx56axG6gBEe(Pjd^Nhrk}0Ry#3LtMuxByPa(b*x(3<1A zSQ94@fCszG->63uQe3#RmfP<8gV!(42k5dSce0LhVO9E&bdifY*g=-R_pg!7V)qis z(y!A|blpSo4B<#wl8XuoQqoN#lTxv1gIa9?%OuDw(yxubx|v+)P)jCvUA6`ova>h7 z;0ZP16SM8@b0{!pbGiA1Un_WL>;!3P{l(<`J>uy|9_fT8Ihz@6m-hpo0@}n0CnG5? znuN@}N$?WS9Id36lUq%M{i?{n9>O_H9ozM0C{>M``Ry`>t@8~LjGQ9E8a@8p`A&*< zfU1Z@_+D7CKq4QJ?Jd@qbZ>a;3XhM_nJ+$JX_>BpQvn-Ho4O3+TB(NM*Vs);@v@W& zlx|;BIE7$%lk9LH18Ibu4#YrSZ$nr<0`a+rBf_0xt}7+ErJWKJ>U*xcIC>3&s!&UQ zxFX4jM;V=^rgAhfg>*Vz)o=2X0an@8KBnO=vB9??BjP#|1qP+%9N**m&hBW zioL?cmEsaGEh`+#`K`ht#QFX~>0P47{!^YzShB}|!bQBoHhy_`XOSHxu4Ebi@?G~R zlj}mj$TzETJ}VtebrPs+0Av%9yh6qY_z@W8d4U6%Gd=SM8@h!M)1hAH391H{tKS&W zGYfJt9#%fmdE&qWmATg4dtdZ!d@0X=Y~8j$< z*yHY_{?5Up!7g|&-jzwI7%k!exdEMUWc6YId7Fw%*ngj-WS z=ZUV?+P~`^{SKQ4hG_f{uyQFSgaA1S`I?ELIGh{_sSz(1p*H4+j5&)LpSyE(;zMJ# z7>c0D`+w7sl9m52=YIO?BQv|^aZ-`@?u|pB!LP`-ugP|gWV3pOwC~BLweVoBxMXkI z?^MPPPrO)Jtmzn}UllR{wvL-_-u<{swKB2v(F_?$4TF6jl6HdU1ml7%5y7pxWvzTS zD#npvke3Q;izK1hcg%8vcOiZeRl#>+Xaou`iu*6c(czl9(n9^wB2#lQhJwH3JP2g<_`d+cxih{6SO#p30i1;p@kl_?%@TjCQZie zFYnOy=qyMjo}K9ynL&?BMQk{yMf{0aSL>Hg29%DY8T|W>TX&-I2*L*3W(jy`6F#)~ z0%KUeJf;GUMv&1XpIQ;U3&G&9c+^=eIyX5~BsvsYKh?PDdQ+hnx>jXFiSm+@s9!*U zm$YCxN}<0?8c_m1NbizHNiGSI(G`h1#jhAMi?gKA8VK1fI(M-dp}t*eUxF%p+KHs= zrYTS5U?eaBD;Q&nx5iUz|E=Vhh=ZssS1g3$d#~;&)paXH-d(BrsjL`S1*t6j7Pmg0 zPtItF{?lD*X|UZMPu>DVNq9zQMoc|Yx!cmOFB7AMC&#wFh_*>FK@r!TH5ei7~d3X^ffVH?yjc`0D1rLvK^+d}U#B zUUI(0XXa=*<(5rmYtTR;dlv}@>8g@02yGG8SgV>-qug4AL6TV)a?OalFrh9a%g{w3 z)eHiUf6=p`5ay5A_T@pFqJfI8A#N&bhg+j;H_clQ38w&L7p+OHjje@ZMyrVnQ>B@t zf=0?{$g-R9wi8G^jG=Hn0w7OE4RqRtU)mt?>`A5XAh<05x<4GhoWDYu=vBO$@(x?A zOzkESmp0nqRdf+w3s44y_JihvUdB4;H?eOsqQQtvOjA0lMuIBpGZu8p#Xz7&a~ad1 z&52s540;Ee!d?$m8&RK)7Lcn;ukeZqyJA7{_pL_iAjbwTL7mx~FN3Iv1hkAur^W2r z_=B>M%@8%A*iNYjA(j6hdp~Y;zWS_giA z6ui&!`p_ubXtwv`&+8j)Xp{P|(I$lj{i*?+3M`?+t+r4)u`r%T8W1{kYEu;Dv{Q$_ z+O+xc=Ghh5ShEAj`UKBjn8T)#I&3vb0-KbI6a3W;Yge%=j6yhZZ#3>}#I)CxO9xJ| z>kBJ}dO0@RNcysE3C^9-ftVcm8%eQn^#c10VUs~Oo3moJq*aBFQ(p22`@*?Q$uBSj zO$j6xM^->o{Mc+sNw~7%dL+GwdKN5UN2!_)4MHPj`W1;Ga@}d9Gna&8GNXF46c-xKC8r$Ge3UuT;K~JLwfGcY%Jb@u%h!51ztD`ZH7DV( zZ=v`FPqK3hIyx8n3D?PNNZh1MlSm7lBDrfD+5zBLpPj+HrJL^*87+CoBR1OfAnQzU zzb=&}z5I0UAD*9jQRd-oU!jsty;Kp^5T_6mRr;8{pcA;S*0jYvsexCf@q-xm;T+W0 zLivellENSv7$uz+Z`{#3qxooX8C#U%`iK#}ftln*4~B0Wic$6$GOaf`9PG*TM*tW8 zLukbMT4ir8u74bgM~+3ubHTCt2@wS}MGm-`A#v8nH3qNxmd&mGoL6#wX7hlcG;LE5 z1~ezAwSpRN0CQTi!4UzBV2rVwyQcjZfkUkj;MEU`3+6K&!oUQ(*WxlEVrZMx!X%33 zq20n3p>uC&mCeMsL8)@DYO}0iFt8K&t zF)fMU(~QbT9hx@UTj=6t|39xLb4E8NB%Q$xQ{{GhW2+sczM(a(5Z1s}d;K2wLPgcc z$7CBf>qevxg?>pJPRW6Kzg)wl@bLgg0jB8$PXU`^q|4c-+1_`Ofs?G602Qn#6b zez|70SYRi3P8o#kQQJEA^@^S|k3p&q=c>BwDAj~V1|gyfifvb;5MA8!8tu&Z? z*bv1UH-@41oLsLz6`1Qg(u4KddMOYAWiH5$M=x>5C9=_t=el|lE-7GG3!oi!z{pGT z68oxjg3qDlGbHP{nh$r#c**vcc7fKcx!I|-BTWm@xYjRka3Tu=pqUa9j9FqxrwOq7 zi|OPw{+UlAeI(^Mdx;((u;U$b^I)iQm&`FP5)!%3{W<+mx~bSlFbnB&olkU^l~P$q zMP^S>RR}MWUVK}L+E`7)i==oQ0`SbEf+3mtN zRZ~o`(@zsuKvqa6B0M>4&X)QcjVsCg3c}JC03OURS;Epvx?-_(Wtez}bpuW8ye~64 zOBduRmMLf{$jlsqf|dk`;vJDF1Rp0-IjF$HuMUU2rbrInfxNS9baFt)=Ra=ar}@W8 zdReB^O54uY1%o&U2403G%j{JG9ETG?kW{e6*eXarZNTJnVFjn<+LI;BUCDMY_g0$r-r%HHStfBJfdJCMwsYuuxO~?A6uy2PDa$?68sFYTYCE{bXZ| z4Xq++GZcvlh)@n#=5cun;N@r#o*YUMIh@WE8)2TSadD9o6tvN_4uzOxnUSp5f@Ym^ zFENai4`lI!i>Nba@_`34K3^GVWRO20Y+t|=Sh)PPuX+xf)vIT$yU&jH|GJ2!Ryc3U zQGsouqJ+{D6Q>i=xJZO3f339*05i2AAs?B@iUP4*VUZ@1KqVndHy^oqs9F%_hFV0a z7D(x!M`a3vebUt{Swvh_AddZT;b;b9h^mypk!WZ_5yD(DM(yU0^5jG{Gw;PBjZB&Z z*AmFU8xm~lAnS41*m8+Fg~?L$csE4h`S5ZM-kG8>Z1K3OojTQGl$mzB0>;8Y79r<= zYT`fm4HD9^<5mGPT#-4_=aj8+dAgzFjtP~#zY^alfvH=e81_;iF1v!h;}O^I5DS zPFvqt*t#5!u4!Jc2LsRvg9z?RvEJ@Lm2@Ws{dRm7t)Otf@!O_uolJ)k8>pk8hdC4A zwv2c#UVd`K9F*M<65e5L>3U9lq*&VG=n*7TzPj@O4u{G&uZhl*hJ9dwP^7f8WvyP% zNLKI|R#*xg3FMAK&tl&3cy#nMR_GkeibhQ=AuaM$bY;w zq3A=ifmWbdh}!1aa_6H=pD!d8g;8PzlSbO9iI$2!GQnGVX*4U|hB9&G!dAX=t zT}1kNm4@;)91N)nhHPSk3{~HIJ!-0IfUutViZVn8Sgb(olbM^9R1TY z7y?m5ex|wCatG_pb3t{`BNZws9^5YmOlg{QCGY@bk$EkK0D}{YD31_Ip zL=;gNpYm9)OyDPs)j)hx8m^(^eL9#9UN4B$fK0_-8KwX#xla7W^hN75Hwe{69fR0vC$-ss}bFu76}8*>^q{f#ulnO_Fq80#&4g zqRY_fSXV+qR~{yk7a(2)75RMW=4@Wn+v3cqDlJ;IamAAfE~FjG31aSM7_oBIbk`)G^KHd9!v(Ey4SgTQ>_qS?w`-< z5>!?UK6xuvnf$UVYO016SSF@!G@FbUTUQ@xTE%XV|M%78>hhe%m1^wEZKu14(twd8 zap_PYMYUUN@4iAf0LTUhihT?-T4ZJiydJ%LHAkjm#tfhc%!L=jR|B|~r>SwUvNj%* z5EVE1taR?yD3J0C{xg{pS`;%qUkegPq)_)ip6$pH8vH&u#Cae-$N2Yh29}r^pW0?P z#ho<{B)4>+^N%zdP~Pu7Ld4S^uFHgmPjLW8x9HYwMA*Q}!>mcMFs_;=_^q)S_;$1z zvaiUo=CZJbOPNGO0J*%3{Ay3m`N~Vti+Lu`Bu=VbN`bv|S1P4pbL(&)I!iY6itoR6&V&@qjf zqam(qm=2YXGoxt3U7N}UnUh0~;mlf5-CRAr+jad;lPNB+H@3yhq)Y@)aOISSTq+Dh zO>(zwwW_HR?g#^2BY`f+P2eYj7GD^ACtetAT=p@5Ba_X*lf?A1`Q!~9FaAk*ECWef zZzt0qQ0IgAEV3#?g{<+Cti)$)^BZ7LJS>=Jrnv(h4lj){BfhybLfttm+Cn`*3;jGF z&w!E6M;&l`Zf^;9(E!2&SpB7Se+RHqV-&+)LK~C%$`HkkuPW0qbbGi5nOj$w9g-~h z#<42ZGb^w^(JQ}G9gap&Xn;D}qb@QZA9bOhDeX#nT@7tWTt`YpeIar(%{I6?_XGD2 zo;`WkJ>r`UVWtV-?nV-Gt!9Ke3J3D~!wmj|ggNXEW+335@%f(zmsbHpVDcqSB6ZYc zacFK(I9B3P5T{sdoz8<)%z3X(g09Jsbj+*GsMB08)4b#@uI7b~8*%)l7GHDcHmj@j zZbdQwch&LM$SPmGGlsryAfI>n5(dh?iV|2n4bqsbZC z8V`5I;|X^SCP=C)X0LzXowlzh<6bN<>*3q}uR(}{OIN$;4M@G}E58(J<=T4D(8H_ICAJ0XYeg0MQ|`EOHyU$72{9TEE?asLnPV<+jpJpEwTX-<@rFUwt4jFa|oup<_XWfNqemtPU-C1)b_4du1 zIE{X@^)+r+Yjs*1e7M~k>p*eGTI;7@ut7Rbi*B}n_ zA(SE?EpFW!!fKjK%O*nG4y`I&H8nrTXi?`->7fBL{&aUdn^3bb9Bo**GiF}Ug6UL* zq_YoQ3Su?*OW?E#b6-=KyR$|`wO=J@im|53`q;F9WjDhhcA!6ehZ96lH9{dsNymeL zYidT#IAR@9KI8zSdQG$!(*Uy8lELH5=87XPO8N>(M&Dc_psy@)hRx0~;~5--O$Gj| zkZ4wQHI(2CX&L6+xfNoSNs4kSjbb2UYnGdKukq{Q^d&gCasymjzPNGGCY73I$S<&V zy4DH3Wb(D+RGzRIMoND7YDi{bcM!VJsj{TT+X)%-hE=k*`2Ybu7`NOL$K6i8f`+D0 z5VmEIDbHI9lotC9;Hl*Y%TVT(>X_<>!7ONfGaafA;fdbx*J(dP_}WBoXl#8SR#lbl zd@u1u-}|bnD*#JKEU-IH_CKqo5)fvD}0AHf)CHd1B|0LwaE9? ze=W)_fHk4={jF9Y-R2U38p|RgREibQQ08M6LD{6Kj5)7ZZ6Tnk*7tt|$W@)JaS|4; z1fPr*S@B{e_!=Yf#lQh2gW=d*$^0z_w3sxCC2@@@+Wx1TB2%C;k-l(1O*4d{{R%S# zQz-HEB1zC06R~;31jAON;XNyoczEdkLJc-mY(#6f(r8%?`5oblPotR?+-Ksh7blxK z$?8>P(@z$(y(?B*wOQG5*GR$I4g!%@r8BZ`;b6FINJw~oZT$t}YnAGu`vyL?N*fNs zM>Nq0hEn#&K;bPUn;RrJA&8y8X@iGX2(`{@zJQi$Jm{lwBe z@JSE;V;(ng8M}=bDWJYpFXyp^nwO)lf5Ab0BXpLE*_egdB_~78i>;lAGnk4%2M#Ln zUT$wAoxzD(sL@^RdxWA}Mu^~<_KPf&T{j_eue%u3;Fb1N85z{YMqd4Z*#Q=NjKob` z-`vlX(VeEllU>auOTsOB=fdFis^sLeMnhD((76pgq)n6^B-;v@9^Y=YY36a6G7z{j zBL{~E-J}(}m4Y!GAaQN5+A?n(L4lC{O=iAYOabsM3Mo`OssIBK+_14C^Z_%Pu`kS( z$E?Q!cZNPk-Pt9MeCQzRceskRYP|VGSDN8bHoEFbBd&$u{jo~_yG$+W{hG^E=q;N| z5`!={OCuDSLu8jLEzxuV?c#E?ohG_zqF@#Nq>aVoTSI-iJEzf8_v<$17$)&qekky7 zy_ud06l$~`WwJ5d9t?{hS+f$lUKACg! zyle;z3acsmE@Z9enDUI4RbgyA*MlxXd+CaImBZ3$()*o$t_Wr9{Z-h|D*cFPPEsfx z>+)RKZCbpp--Uo`1b;RQRm`R>NXV;!rIy0gn{zm)%>bft@74+S6@+Ku-+WzyVc2R) z>pqmVT~pafURNt_nyW!>3Zl+Nik9jq$@7*sOsjVydOp-NXIE17qv5 zhm#_CXYmBFSK$O70kzlHjUh+{{#8zIRe{RILP9($lthuLp}269o!6j{tNiAf6O3sU zXp9a&8918S)K`KHCV;X8GxNev;RBO@IVcH43Qz9FNL3ygI>u zU>P!m#c?q^%?MF+dXr`cwg*xt^q*h!Vxy`ylCKffLq7A4%jFwv-z z3s+u27piv|C2DDV5CX?=x7W4wmE}6GCL~y;-OQ0z(aP&QX{nm1uC'^g7%hYO# zCl-QomI0+&WdR8_w)9k!?1Q>AtT#NJXeAWeRjvP(cJ)D?*&@@xQVkmUuL})bEdQw0 zExaVwG%keCxhYf4zBzNv(4 zs=%`-{6ztq+U`$ZBk+`$B;CZ7viSY~*!%K^xQ-;x|M?VUH9b|5C1km~XLjYQ5kfXI z5-@<=+e^8j1cg*1sA8)M9qsmh_Wk`LGV*?PAS~OxL(f?7UcNjcBO~LEzc*c>yz_J+ zM;Aj1XhD&D`6V${|{9HRN`#|}1{FJ%Xsp8utryco+!N;`CWq zd1zsMFo=aaFC`Vq*CL!sgQ3=N0t*5E*=4L04sQMqEQCfDlvFDX*O`RBEM}!~yCWJ7 z#bWV`+~^G-^+^i>QsHhUA{pH#{k zc3Piy@7(_8b}K5E1=O($STLdu6JV1FMwJ`}K~R89EbT#`sR;X)SB1z~v(BsJM0r!~oV*AxO0iXb{D z+Y?{|u^Gq7Ps!V`F;90@Dms|7cW7;~%dP=U-%ZGJoix=#&WSt-zhfz~pASDwTwE4M z9780Z$>I|jySF#JmoiW>a>F65Un9jigWatS*tP`u-H}i{+~i6Tu8Yl4i+()|34~^mBkWy_?OoiQ%oLRO})>)i@2i}8BsB@ zCVBE6692oZ7+sCJ>@pn{0{LuP%8nNf07~+P{(#w|oOt?IinVsbucYSGH zc3UpMWM_&HxnF724=-q)@}bIh(tX{fHRp;eQmJ;88d$-5K#=)7&VLXK z+Ig=)Q|5++Y}wq|ADTL=Fw)GBA-8O8gJ+`CK_dIOZH{=7UqWF+c3v>~!_Yv~Hfdkv z>Jnx*)hwlruZkyV7Bybnh%@(RF@AwbW?sHa@rRH`d67ps{)OuZvAJq%2!C%ubv`~r&If$SpMm|| zk~aNQ`QEqk>`VF>R8fBNXm%(W!cgkCyo^O?>*8`WUb=1p2#(}8j#$qcd#Y`$anV8+ zhzuN&F*GbCU46s1A!kf23tau9WW0ZZgd-U;3YC?leCtR;^8WArF*XUmOa_zgHZn9w zDu?HjzCA2}ROw*j98M1Jt-nRScw#jhmifp}56L)n>Wd8Jzrvyx`EcW4Mz6B?dGAa4 zD!@#Bi>ARd8=L*UJs-X3o%=cK@e^G4=iYL`=+h|YVS>3$C*|(PNR6n|Mu~?pLha7a z-?!*6jjG?UC%u#fYVw=@jyh~ z{QLR-CX!wRDMHj-k~C5!%#~=I3ghi+ zS_pw+Zyk*8JIcp=HX4r3p#>P6fX`8`f>5jo|Gmr0^Y@DF!Lc$lC?qJ8VOa?wXB7we}?#8 zPz)91Ltm2Icrs=Ebc9t9~B$2I*C&icQRGqEBtg1+8n2ENP3jqZIa38#1 zaA38(Ew=n{*vsYHyAlFVj32pK2-tuVP3UBy;k*(Z1Qr~483@>AQm$X#l#3Vkt?!S{ z4Q)PoLR@LFHYwS9eLoxC`B6~M7|;%hC<&O&Ln8*c=#hwbYMYjno9;kG1BS-+C996A z$Qf``Zay=TCKU$=H(iu6Nnb-LgPd;qdz9nG7%V%}L0buyP|_p~fq!XU6;og;f8nlA zHj@lX5FynwZe}_qH|K!z%g@<=`;q5tCuaE>yD!W65|Y=3ai|_pQIaa01LaKbP+!(4 zr{B;IXx&W34`BR=8MtnTyFiZ>Zmjr5>*N;!GY#XaJqbB9I{s$Hw|Z-%{2M$^036MQ zPF0JU>7vJEUThu0L)?{mMLf(*hMQU>sr?g>q{43hC_cBrfyzFDY&WyiQ{-xl1xj~Z z|4HmN7HI}K%Wns7l-~n~wz0FlubB^$FUoni$>*uZ{fLSUR+H8slzLr}Zy;VP>(g^G zI39wKI#y1$A36o2vRsRfA&eY-&Z)eQw7MR=Do#jFVZWcSZ-4eh%Xuli3mUt|y^LH1 zVlcVNWQDR)SU%rbx?0SXfOkFzNFcC^ zRB>+>o_#(~pb019aN#g?mM!2=OKf?$gr#7;Y^0l9*&RbbjoXkjCMawqN%>MNfVq6O zL?VxwA^D(Bm%)^DdTQ0|vm<>47Eee=nLhqELaJ>Yj#LYm5YcLj?G~1cWY5~C*NGzb z-4^M&A$fH4Z;L69xF)Avj~(3kd~SPrmEa*fI8__yD3OgD$%(%WDikkMK$8+A!kVY# zniT05d;~e9+l3k3v(3tJk@R8u37Oy!jxK!Cc#Summ7nk_ z5IEu?axOT%273M;IA-k>bB^q3pls>}^UB-(*rw{Sy{# z#iS8vVKnjGA2Q{#%!-i|W{Va3Z++1Hflxf|<% zv_R@0#U>(u6Q!h4HAtX|Hk=_E;$E&T?&Lg=7<>kAV0I14piGLANtY6jdPS6p5wD_xnRe@x6gI4gNZ|499SU^Wu68r$qqiZcHy%+6@#F)C?=rLAl@3$;0H@ zjnQ=`A}05z+_TvwonfIZu#P;z0y76q7r-JbjpaC#ctEFq^tZftL#_J&w`Srg;B_fn zGQ^XkQ9~HbE3@UK?k0TE*B)Og60=bG{5fp^=`$RrJ|ipBr_3J}bY|&0S*`_1!fpx= zPb|heyb=|}X9hiA$4&_%8jtO}s}BnfhGDsw&eG+zVm1$|B0CCMW%lL>%;=l=_(Taa zJ;Lao5@TeP*n70O78WSCAW3wlb=T!g^A2J0S-DIcwh+rhYqoGNQXK*+k6p+On-+O% ztOyp@d&6{La>um;oPdTmdlh#fWz(b-oZgf;`7pIQb1kMOM^dIDvZz;?b{t0`n%twU zXS+Llu>7+OEiJWzmz;n8QCiVV1~;sfi~7tNG?$pcljqwT2U|PaVG_QRW#>UgyFP1A zc8KVW-LkA6xpln=A(U9rJVPk$UJ%9tEDLY)#M)@qup)JqyK>SqKjCE~UOALHj;VQU?w=EzC3~|#R#8xsEQo!a5fg!+zp#gFJNhY zP$D{$&OljdM|4$-HS+|S;xJDtH1AHf@C&Y}dV(^t^J_jt1_N*b^AC}6%gdZ18z5C( z|GH1mJbgvQAS1k*96T@;`tQ$vn!de``rGDK+&?#Vtd>_0&$*U_Vfi&5BBxCLnNCne z=l63SAH`nMws~4;C&il{xmoYLgi>cQeGV_P%FUOYTQaB(suL&3QT4NCIvz4-a)>`b zYmwi%!d6tSL^*>wgqsZd^VV6>r~XRl(=`;cH$t6iGI`w-$Z^V%0}pKCC$J;Z*PhCn z^Ya(Ilh;+fjq;E<1GE#VdeQw6NpNw`BEm%vJQDkHnA_&Wdl(fQ+bY@rZPhfoD$7xO zLB1!h1*<-Y!KG0FX??kN9L&3pBuXmki}GRiUm=2uGXdL>s*z^2q~I6(oB&$tdXw^{ zK{ts8rRvJ&osDacISBl4QU3)W&zKCF=?2DHB7WmOrt`G*2?%haREf%4Io6Jb9C|aD zu1)iulx!!sT;qfuhdnMi&sDghji*33sC3GBQGM%ui5L@zc4;~ZaEjRFgA&BcDIF>$+B(KbnP)CVe8K6tTE@M zys~?T1X^l;n38(6oH?Bg*YtkSKR@NE8J=jZcG@qqb>hRNF2xy}<$Ja}nHI8hbl*G3!9~?@)yL)@Exk<60`K^MI90)9FY{cQTE+z zLco0YFuE+GkL9imf6I}fHdLlbNd+e-yp~D3xhMrOB$rR57?@~UNzvI(`a?HQ+~4fZ z-k}4SQC~iMc+s1lyh4@EPW%30mp^ZR_*81mSW6xUwxJ{4?%w9NM>|iR>~F$@b$u5Y zw3(bYb@PWqAw4fT_MMm;F+EkQae?S_basX$@rrwxBj?Nc88f2BM*}%M+SPn%O(l|w z-$(&4_q4L$iI_5(Q|=sr+EORmz=27)@BDP`wz}Z1&ta|;hS}#sU_($^x-IZm>p?bK z4*{k!@pF-R#2bf|>c;VFEGj|}^UIA)evUWS!|?ORd`mcLh&n~w_Gy2=cX4?RGbgmG zO9aFh?TKQ=!vpg2^8%SgA&JoD>wWz^__Ht40eL(z1$p(&QeR=TMLv{u&*)g*W5N81 zBa633&xhEDQ)eTY5mT(G1oHSsP_nSQ)%xPm>y@?+);h+J#}YEozd-U>m+1&OgEbY% zsRa81o8!zxmLM3Pwz@v(_KPm3j|ZFYPWn=T8c(`IerutmaPeXBwrj<8-g|Ikk)5&w z!BC(Y89C$>wys{B$I%m$t4n5Bm{j5;<<`0EOd{lPM_W$KOU0_Sp@_~h=&f-ybmy3Dtc*ytyt%gl!m%oSN- zixCcxgqga~f2gldka{L=BXQ2@kkSx*vGqcsuF^|rf$|DJG0dA2>b>kEKB6~1d9@|w z;I)?|FvYP#^8iXFDV>#GH!nzD##p8+3aSoe$#f*8^%y6@%4o!N+1M=M-JPG3|8}x91Uu393ywON zvt99`talQWT5w$q6TL}IHE_4(hc>Pv0hUvb4HDGC&=Z4+kaG`RLs8)c4de<$o&$SL zDxV4YzKhU0J~fHt@7r2`r3%0~B&G858c%tZu1F6!rL$)_|>kpJKsd@ez<*qfQ%?L2&^Fcc3=@~dO^?$0&^km zd*Trjo&%y^RDDdVFBConi>-5mZL5=~~{_JqG zJ=6(~Vt35YZbz42g#1^S(v7%wi7%i)aD90CtUrF)-@h75L322yMZ>8st2hG)C**OI z>pL82f0VaJ!&)B+JpA{fBuZd{;9n`@9C{AGNcBS*Wx@xPBV=84v5g(ORP^sy-?X`n zmBn_WnFkzBJi;Y|XP_Kr)X!ZSWODr_Yp!5Vz_mhQ%An0;aC+j+>_Tou+=uDrR6dDu zR&ZQD5x~Vz51SNIVQH4*rEpGRufA~`LFkZ3izg#oZv6t$zlQfgg2G8hf_FZ(A*rg$P5&k9ZO zoR4Ox<>jwo^vrCwH=MQ^2<3kx?-usGXpXb%(6C3npwkK*Q`nh%d2jkvw0MSO*m{Nl5~Og!P&u-xnkWy5nQu+M+Fd2W>rMP7HxjO@!3g0L1LKxvy0Mxpe5qo z(Apne^f&030a1-4+^rO~5O4-N!Iwjz+hoxqd{F;ZufY$1R*3h`ElgBom4L zz|8)B12aS2UpG^Bn9ozAQL_|M3pE)(c0BdaEiP(`gf277JEP5eeOQ5pq*9SCRh4I8dWz=jhCwk+r5! zJsbGp!uNs|5nJb!1vt2?JsSiJgP;1=CmccTQztP)AcJVXgQXdL`82@s@{K)R#=T z5FF-jz)A+Hl^FCm5?H+`7ljw+U*y1XRrkkl`loEGyPvEBPsykNYVy6X*(NFoUz_sQ z?3J%0o;L1IZat1C<&8rVswQ%dpFD z;47$<*=w{=hi5zjYEj(BefH|-W`n4QDZ%%g2#6u;~iuewA2MM{$ z(>@9zmbIwrPmmRT)%BDyyA&JDN_%yQ(h=k1N5?=UP(C+ym=_6Q7|n%w8;9nDtjjQB zRRM>776eN+BfZgTU`gkdnhie?3c|=Vurg|ks{mE@tIiElcQ_bbDcXd67TkbV`Avhp zNG?NF(uc2+8&=ptnk`mXx>xZ`Edah*YE%;5z~4MR4~Azif00%l^1^8scN-xl%%taJQu%x%O|jtAA5N zt-pOL?~){z9t z3sg)2Nf61Y=ezFSI(oE+`XcJ?65kmR_rK+2o(CA2IF5g#kt0K_sU@CWolgfiUGu;7@^ZzP zq%t9)3jdVmtAz{Cv?;t8WZ~gp$I@S`-4^>ktiSztm*?H?sH?RZ*4XE>u{VBV?gF1(XiHwr) z8Y&``;H%_4QtvTSnuKL8iZ3iaspwLSx;g+%Y9-_80+Zg#9N({EjdHGIbJ#8hvr5I$ zHdnWpn#i~ft?=ZLax_R_iD7Y#i&`SF(Ip2;=eCEF9&e@1}nl}elSD6xefGlA&^dLD0f0h@66bB>tucSzH`{V%bR01A&1YR94!wu%{nEy zui&|7uv|l2=4{wDoQUe7`mX@PSs+PZ3zG0(5sVIw*7x(Nx8#6=t>IJ$txvx~kYNRwmk?Z8c&Rb2qFqIVw5VrW8LvZ zdl?#6bhL=_(|yB`xRO9bfovv=P0eAyg_n5rLo~>jt#B)xE6)lz9U7W8xfmYJ7F132Q z0b64Rb|Hkl7R<~KnUJF<;dkWyN6D<-o$ADS^-ipdDt(#H7l z6i#~NueAPC&?G$>yz8ULjW2i&nK-sM$m?qM&^jDEPe;U*ej5Sv)-8UHuDa__(wC?=Q|q z!}kCwE|wuw0A1Y*+H`3<9f#=QF7hfOL(Qpc5Tc4#R#5SG<Zqi)i%Zqvzh08earowJ@DO6cfVWb``-EGt6msNUOwI2{`TNIzC|Vk zc+Y09w|BNT`ErPT;w$+vCUDh-MZ=wq`~gh4BGXO!=VuQe7K=qpM)`s(ti7;h(L6L` z%=Pn^qcNO0GdTpfyQGi>+#IC?=YGFEvcebqxQ4xRtsUx>DN zT{ODtD;AEjcVXkHSwFext1lh@g8dV^Tzjs+iKCrVte#*$j(P?hq!<3$0Y3tTR97bR zkddEw_;{v)_*qes9E2MPxX zOe_M4{OV`Dv9Zy$9{j_{j~}D@_}uxT2>42S5tt%SLRs9&5p@6ku|WQCr3vwCFGv>< z>RlWaI}y;}h`(TU((&FE5EO{z0FB_qSKQkG)D(gOEH?7sGnn281cglfMgiy{(hQ@S zfW8p`lAL{1_$4VkDipNlw0iFk|E#VT-cQ9vr%Pfdl?i5Bpy-)J0f_=nnxUfTQe?qc zi-6-ek;?~{G_y7aM~>oK3vhut0>X;_P>Zgq-=7GJZ>7IZW=dmwWMFhcj>syZ4-9V2 zHTBZk+FE$awS~W;w$4iDr{Z&(Bbn4CbTiaBY)TqFD@p1yKlm?fO|qoqBgy4(*oOXL ztX{tDA1r&rVcR6~HXugD7OU7+yB0BB@@!#986-003Jc9$)?Xrp$jSsP(r|ia_qSZ} zzn}bm0?S~9v^!pq&VU%^&|M+qr%(p`8`y)8rx9YbfHZx(hR0Cu%U6EG+c=k+O{17> zqHaQQ$Im4icD1P;LhDSMRWy<4>Diw*>Tgo-K(F@7Hc){718}Y!+bP6k-J&dm2O_ZA z1ukPtyf6-whWwMK7O*m}nPTk{Elb^t>q~u5QlAm(-Ku&N_Eb@f#APb%$Oo&I`{;8_ zp;6BfE5EG$0@@eVD+CYb!h3#xz4SV_?>x{;NdSl5>5<9ll`^==dL36`y-^#`k%}PF zK_anta*hn1sBd2(b_5O=_)nb93jU;5NaP6b3^H+ue-TOOMIRNikq`Gh>$1Oi-%i%qkr@s`g;aOXMHRjVs_FuL1@~*fBxOGV z5)oq{m=PqxleR`@R*#65V$~`->HdXb1C@5P2rjp!FF?PS=Elf}^+nQ!7tT zm2aFotFsCT9ygp2K{ys`Dy>Ln~m= zH-fy{_D;l-E6wMKWLPlp8Mi2|4ADx1sItPe|DdBC9JZtTl{@GL@$ImU$T_i8$2!fT zXM^MPhu<}Uz=`B8G)X@ui#DjNx8LZ{!6>E@5nV~U+61g zS9xM^)52*>@zW0Ok+CzTQ*ELq`=>LxY7poI9)u40x6po;IZr1vPrbiV5Ii33Isl$xB59^cT9*&|rRIX4c zoDoo?!pUah+2uD~#v=^lO&91A&1DxItVs{;GdkVCfm9?!IuPpNHJ7Un+^ud4u;hE+ zD&oz>{2?ARdRu|5I2*il22*GkKwTp>yUL)HLOrd~1#XP4#PDtBID4%}T8mYPF9sG# zCr~8-ukjbo`RZ$UkyJYtf4A4hMdwWpS6^3=rsAy@96$X8#XsmrT7H7pXBa{Jk9=EQ ztBwaUx?#!joQ?&_ZjnJ3ixH|Q_s^C%0K3)V{$NIeDX1Qn526hWvXEPf>y;~n~!e~GX& zSzW5Az#&^v2MQh@}-K|N{ON2BIvj23no4<_Omn;dxTxtGm_UCRM19ke2i*G`6m8a5u^V@DinXjB)Z#5sl zWWcHqpq^G$4kxX7{o+9Jc+pvtJO-#>|CGy;i~N$me6hl(OmK}qcx5YcrEN*7wE>sx zM?v3;VyaPHACG(QBlzjN+r(uJcBavbn;N1OLRZ|kXlsLqnnwVjp3Y&d(*Siy_jg6K zr_>U#a;^OnNEB3Ro=pzJUUvn6rd(rvICq6hlR8HjAbs~@RSfW=f-0!FMOz*I#!I^m z^)tOD!9#kbk4Rbt}0#^3RNo+y%by znC3C2(z1bFMb)`Zl&P;6DYXNuv^wE3niQSdKIN@+ZtRC^I=uik3dLf%>7mx$+B9+a5$Z<>B z$XSjpA!$c4rgD7dzDQXF=QeGJQjwUtm|Aq*qyvxMdqt?@?(nS}(2<01d8wBxUIcc2 zYMc(QFst6qEc0lQ&E~pXIRK?p_CtAiI0WwBY zz)RYuqtPM|^$1OoJ2AV75iQzRvrBYQ~!Q&hl*xioudNUmnIH?n&s&il`FPpO6~ z1nV3RoT|>vfdW0ZF5&ib7o}|ufg8=lsKAs z2x_G9Q~18GpTYNaOT6AEVt8udYQi--X|2BiQ`$r7;F%XqMD z_D){4{3R#08i{CrIYLBpYXH`crV4V}k}Qr^wlwDX#d&Y|+BG2f#NY(N5ZmEioR3ak zS6$*PS6i3?0->>8>_FVw^cSRSi+wsb-%05r(2gh}T*U`!ey?e!l%n5jdAd9Z!PXxh z4-M>FK5%0yS|>XbxMqB;KrML)@_L;jUKY*Zq7yE_v=b2_^=Lew^tV*iiM-{!Lxh&g zJtDs`o=dxQY?hbeO&ZXy!J`PrSBdO(u~S}k!sH<$$2}xEP#_ z&PP79H}+j9)T%Nu+-p^hDszf!EC)vw9y;yacyt4N`Zm)OMTHWAmdw74hpB9wd?4BK zk)=yHdf^TH+MgKV5NL5s*rTfi9uE;r=BTfP4(~CWg?#T?6?&l zpP?r&1dU+Zzzf-=j8TJJ@m8oKa9+Ov(i^bSDbD~itR*SXU^)@TD}tf`!FrC?Bi#nP z>r~Hz%hD^&2p)I5?OluQr ze#wwFC?!QvG!Zn-KBu%a4`34R#E5SgTe_+OG@4TkP0?#p9B%45Cc87*HG-L|UuNAF zCh5;jH1X8$Dv|PO+tb5mhjeXrs(KVrCpqy#)-N<(16_)V;GA_LPB|e)B1J4KNr2r( z@l(fZMZ9;y>K6R8u*HGFyvgvW176q?nk2s!Luc>F)yq%J8E%glJq(TsOPj&LgLA}B z#dSHXY<}>^0X(ZtbhOs-H(wvOroERT9ni&KN{=%J%eGM34O$%@?cQKWc5XC;_Zc#Q z&dLhp5+@6%+a3Pc9sblEe)Dyf`z~L?2a6WIMv@#Afzk&vv7`rP0@F)CBBN=gGZIeE z$7iGA=o~>kgA-t*mc)r)%l60Fio;Y%+f^r_%m#O*&&s|rm1IJVgl&AfvyW7k>)&Ff zj=TJ-h3rizCS#xDjgWGuSkk#CtX!}zMl5Or^QfPP@Mq7`J`h;@`_ad63(vAwMza?d2Z=A*%n#-}f z84{;vE`QoSD|jP6<{YY*lQPHQJb@^r!E9aRe<9~u{CejfL$dASaq`iqWueskjgm_t z>`K1l+TRtb7%3D?$o()H%X@uORME~`pLa~dR3?YHsx_KUxSOehFCu#=zMLb8#p+}Au}vto7G{^$Sj9NTqx zLKlcfDfa_ezMb()N#x3totRkhf}&dLlqufu{kKj|!}%sUJ$z_&X506_?0(bv=Hcb5 z-G5wucZvVs{Rhwt|Brw1H+JpzH=XX}AFH?TQ$ZzEVD$lhh1aW$e;2Vu@)um}NywB$ z34P=7kJN#(c1LV55kcWe6tz#W)ywvyua~y23$DNE*ivd`=U= zRAZ8S5TK+Tq_VhMoWj5*5}l5xFde_`kDZ|L0Cd zKThg?AGk&?V{1GsY_UWP#Lwa_RJUKWvb5k1us|mHBn3X!xH@=>l5zOJZcpdC%y_IA zA>^?-M2HV9{|+~i0i32szA^2Gd+uf!gId0Kn~&RD%yu#r>C~dm4oH!$bF(+jM+e-& z2_oqDL=v@L8n!t>!?4Y}2gbuzFqx~Y&9HIRe*%?DS#?_zy24}_6;jzzmpWLq&USL0 zf<9v^qRmyEQqmno1$}^h)?ZAa4?PvV-DU7eK^5W+lO_fFL?4q-ra3T>i^F>6OJ&c* zk-@*f%$DUPo(?8cI8D0}wD}!A+rS5~hfpVO^eQq_eQ$Fj|K)bu~Yo>>BFcK5%t!xzq*5keuN* z&g~_~LGr$~E>;3y+EQGQIg%uep6yQ63*hEevw7K10-Vr@?8oF2{mBqx3ye4oh%0vj zkIsi{aiKx+p|}3(OKzesTAxW!u5h`UyPEuN%H{goGG%w0S74v(VbRdT#^r*cc0HX9 z-W{kCN{N*@SmL^r`4KXKj}Y+5Cr@$Ao4=47mWHe6{dQ2XAo4hGd<^iD}-oRhsLUf$Mg^5F&){v<2R$h zDM-4qaa1_EOXZlX?s4GFf{4&jUd$S@ome%hELil}%9me$+1}haXgdT9^nEmfkI0Wn zhpnGh{QDQZap(3!RPmk8Z1i_F`et^kckiVY7hU$Xg2}B^SCKQ4*9p*h@UO=FCTuWg_YHntT2}Q$<^>=iUI}I8M*`Re7dM7 z;s&X1ohr;6HhOn}S#kBp#OIRxBkVzZ@iv86NJF5fABcK7#VpgBrTQy5DZcerE$3kG z=81by8JjR~=cyGM+?G_SmbFVWNNQw6&|%vE{@_#@nT6n7?3e;sm>Mx(7%}r~PSoIw zmD3U7S+r3Q325kYD}xxjnKXtQEtK7sYDqF@5mQK-Rm4eJ6HRj@5LO2#apP)y{{9hS zP8VZ(lYSW|_G4hoX7@(F=tm6Dgnx%Ss1F}Ldb+dmAFg7>^S!5kP1v)tKW<#hp{wxK zWfP|2i9n4n;MP2X{sQOad)xwkKQdT{AQgdnrvW}hYD17cVU>9N!kK^rbUs+d^_xjS zoFv=4m|PJxolw049JCERvs$T&8%+wp!D}ljgq3{X90$7n{OQy6M^E9O{@2}2O~5vo zl;nld15ryudWx|b$WzV;8$ouu+#+m=!^RpY;jNFy}8?Om8adueR$NL zfGgzvyG-$=uJ_1%)TcM_zOk0GMhlRsIf>V&ctb*i2H=Ct^v+-P2gAQBwq%j`*_!km z%Yq8-JU}+~f^P!n0;PH|p`0CDQd7G=Y)O6*b%H+wPi5RZ_qY#F`JQpsUJz*TQi3y6 zcW9)cwcfcc0YEMMh+6?YO!UurYX>|*znrUbfu5|tCN%d1Zg!U z+sv&SE3icee1s4hmQ@ti2T|>&HRwP{$E7-#>{+E)@3XGZpE%T=%wz`U#b%HzGejCDpjw zI(?6P4p1t>jMO@X>EdLHAUYJ!MmWk4$Ezi7IkU{wdqBIm(8~NME-R}dTf3kI z?QRn_FGQRwoh?*QWv{lmS*g^k+CGGfX@NfejbA*5iYh`Hca!k1d& zna@ok^n#-oj#BqTW5q>VOR2;=t9UMd$8?K<@tCPtCT|VN=L=!5RStAoO2Z=GV>f^Aw%}iW`&lkO;(yLb^frJQ!h~m|$xvP?RGP z{tEvVqeRcbDzsEdF*qD5oJ1;v0{y*U5zpo87OTfbqOT1a22dB5bZxR+ahPFdRvjyE z5wsZ<(90}cq}7BGc6}~$%^R2z~ zkLdOO!TQ10hRgk@&aqtpbze3CVf`>v%|gW4!3vPkI`+OhBN8e_fV*O zjMJ%377LDN>)~ozUu2mae|tW9(K|Qwu2HCJclF*JfFe~O?osBF>BBvWtRG`sNVl+h zb3pZ;Obb*62yHPrTGEj#O1aDLdtWsVU}EbmiydEgQx7s)dHu zzy?9cM7B%S85CoYo~9s5JB{W7*8}3959>x&I1%s~fZ)kJBynWkR8}a_8`q5c>FAi9 zXYNQHINLBPE(OU7-voad(kbDi&uqu&{`Hme>0s8$v18{gSVIbnW3dlsS zs)?rz4(W`d>?MZ{vyQ;~m4erAwI1#8UDGNHEc3gP%%&Obq~kCV&q}372>=oPO>iKe zK!bUd7>u%_ex&8rYL3`JP>7O z;1c|U1gdy35LSMrBv<4gK%NzhmVVD@w#dvC>7j9InJ5uWXzmPk2G-1PtDOT)s_((1 ze7w2l^Q$ylq6dU@NNx~YlIqk~zA=#}!uz;+Y!q2}C>Dwpxp6YCrkDwgD}v;E$izTNnc=mt81%XF{Y>tQ@f z6^ha=Pg=GCI+G@FlK+ImmroY6JE9~8pJ1)H;QDj%)@U3C2*KJ#57)(_dpdRDe>y7N2LQIFMmPneOCoFiDn*qJo*o^-HB1kVs(A? zN=JV62xT<6aPx={b4GsoDRqoc%p@dBp2`Zm@sZQl@#H#aXdVo2nuEumAl+f_Sdi6+ z(pk(L&||kON7k{h10rv!0xU41M{SVctN&VOueik*eL z9GrJo5x)0*`rygd)6M<#(YKoi>4V*!{p<-9RtUOCo9%DzeZRSvKil8m+SyJXs#+`_ zltNI%6zBd@iAd;BDY)pk2QDLA0K*|@@Dz0i02XhGj!&rNp8V(V`4qGWsTwPOmfIs_ zDupd(vM0_MOPh#(F7t*_H(-7iPL16Pw(i)h>Am`+*DLJJ59)ML@r2_&_J^#0iTa)8za6e{Is}?dGTr}#=LQDEH1%moP0SQjpPQqEg>rGxEPz+_e zUb$7(ub{A^Mf`|xw(68KtYrSpq4h@8OXx(iuzQyU!u@mv%8dFMoI9Kuj_=<;7S{#3 zGoU`)tJd-FG#r2zQ{>j~q5*z~XirJ)o_PdS=>0F`%cB6G4C}ULfBOEsFZWxE z#3EDX%tKh*lq-*$NHgZk?CMA#_WpygI6HDs@Xk%YQ{}rvG;`~zMQi zRgqoWC&j^*n7v5ZlG~mMfYn_xO_cWRc}zfDYbCj#B~*J=3jILiD$I!7pJa|Ef|88i zc6u}sjD$vs zX$Iv63aa_-biA(2M7$*j>?p5vpp76qa1o`Q;IMLZ&+o7?4>BVvz zY`zpX_Nxh&3RjuXH;0BFzek%XG`tW$ay;c)pt&{`S^IZTx+wO@bEJ2UkSD@8UNl}) z*1nT{^`POa6i?-Qr-+HVj;|}Dt_?>v17&e&-!hrB(J}c0f*jW>c|pyIQOjjH+x%+y zMhQ?$pWwrY1f2`h<9yF}#Xo$A{FNuK;GNlN-|z0-zk;DMAUu#=0533QBJ5RZZB;ZK z48o+svWpGODMhq_5D3Nj?4n2Y6^`-YN(5GA4Zd!*|M9oqbtiXL|A85j4T{VF-cf@2j_pQ*Wfc6E-LiGewX@kL^V;C_mbq1hZIk6Wo$3Jmgm;pp+` zM0kQpOY${}u0r#@PT!88E<#Z$_!~~{;{R`x*Y#AKUR6pW3_ONL*9V}8+a$J1QaO^Z~ zPQJ^_vc=Gv2qvc9==CIlk;?Wac;$r@kUn|cMrNT+2{LF8@9`CPk>{p_DAVC>8u{WV zwOF-gTs0%vKC|Fh#494$aXffA81~NHG@xI)e+SwzG3t|+1#fnUHql(O?vr#VyLW#4{O(VkZ$7~vnw}Gr0&xvr3g1jmv+xLnJnyXY z&6m=J>kz%IO0v&8{BQIrdQ&@G)SE;+W~-Fx%L08iB8-ZUTo#tHu0%A5V%g82Gy7+` z7q&;WB9~6`__?nImGPxAE$l3)JOeVxOX_87a)}V>335_Q28gh8VgPd`A+H(eT`i19 zb6c+5zu!85kie=B?X@=l?AiBg@}zzHI_V{DEI;_Kokog)RHY{|-J5$TvxKk(k+`$I z{ny)v-B&++x_bWtgrQC1;D(KvW3jN7GL|(>y`N)>$90gbD&duSjZU~qiT&LcvUPqg zris9zQy9*25=F^wKWs6Y$c)pg79e9K&shP^fAJM@w8-ZwvQ$9nVrh**8eKMrgk(~F zEW{42DXNB>wuQwfy_MT69i{X)^9V}kBLq04Zi{s_^w|;NUxZr z>9q=#;WiIxEI)qs(_mOAWC(#$VCv^4O64giIyvA5iy&fkssUlq3Hlnt| zJX5M$HF&T?FwyqTQNIzsOE99yzy~9wAU_?Q%(%>ABT=$J0UYwR&uqJ38syG>q%~zNZCN>A{P|69+z=W-))vB0EK0<2FWHxufZ(@h0XB|z<3s)ZZo|Pdc5Y1eY zO(^t`p8u4pstGa?2%z8@uyXI~iQs(?>Wj{yJitNFY@kr^t=y!rYpQ%tP~B~8N684U zq^?PQMwplUe1ICZ_+*9^Nt&cqBxQ~8S;iwd8LmN6j`=ZQLy&8Q$vnv}2FkDB$tiV9 z$(7-C|B+7$fUqOWpJG&EQ;Edt7U+x+*>ox|R}zpvl>-=E$4 zpGRH%-236v+nsN|Lg|ri2h~UZua`EwP9c{HyiPuvRN*lCNp~5qbnvE-`iU>Hfn|paDENzk2Ua?6!N-Znyz`HDxs6_{OCyc$; zhQ2JmHX89F>_rYqLCoaLs+S;W0(=I)%6A-gXr54s91@lq`S*M0Cs*f8?(Y;cLHcAT zL*UEQg(rwkUwdYF5zr@7Izkxd`t&r2SxuEZ%5cl^BSyip1_h9K44JuE=ozLac!_?~ zOD$ScFgpv?hKfDC#kiL>>#Wh&;)3A^>aak~B#yYKZ*9qh*1JNg=Eg}!N+5|ukwUV? z+>HEiI9+SE0zekV>}4PbzW&;x6kY-!oU=L!~gC2F?JBB>^I z{Fn^ULuur1LCK+~^9nJ$$amUx{O|X@^DAV+et`?45XMEuOTQ`~S@QgazfKbC*S`v4 z=f`%~E9N7Fc&0fv+<%Vt1ZT-2DV~6DX%z)HG)nZQf-uwL=8%ajU5yt1mQI)Hn@n|p zvvlJ^XEr5VNP(Mb+e=~8kN$b18;88X_0k2+idi2AH5m4E0;ieCgs;$WSv1MSP02 z=EThS6DU0lyfzWqlUI9y6pNqzP92gRgjZHy;5pnnVd|#2In0)SStIG-1P$RZDq$&9 zYy@p1R6R=VF!tGC3NGZ zOuKhJ!HT1GQ%}xE`G&3MLN#XU^FErPJYtk)S(S;0!B%ZpX-a}rqQc2^o3i1sw^G*b zbJTzQ{C4Y`hf?fMB|~KxKWH#H(H%et zk>Qaem@9DSD|y6pt+@8T`MQ0ZO~oc9+@!NfIj}i96q}SDPwo4Me-po}wL9ItwL9*Q z`x8>fbfmfyfvcsmMTQkX5eD=f%`R&E$qZ49H4&IedsmFnKjimQ$MpM$+R|cx{9__d z5E&39E34z`6KS3`+winMEfDC~vhVh|a67<8~J6jI~eQ?@(#Dx8g?8eNfqS z5i$%W3*o-aNEhnvx01em1Wl|1m%GSuQl7Fl8ZJBcqBW(ql{Gb>KA@M3C|hT0Vq-QH zdRo$e_>pq1)Zf~TfKipEW8*VrZmkiT06%l}?hQv}3ENk&mcZ0tKm272Io^Q%bNze( zYlmjZUVz0<7XQy|JQeC&?7ciq#0qkL`|mH#M#J~CvtEK%98S9mNyKPRM(1z(WBVH% z9DiaHX`*gdIRmsGzLJxc1qWVF`dGj~3X+I({@v#Kx*&8PYZ=Zh#z@JKIO=PY}K&S)tIL3~ka?*6i`-##7dMWO?F^1AIVEH~V618}B!f z`bztMv~%FXs%E!4*x7acr4uN-JJ@-KmW;KU*>ZbldlT*c$QhP~L6D?n#1SN7rPBBE z9G+J6tQz+(P{r2lqz=k6Kv-6_qI~Na@@c?OtoW`v`x#{N^j-QQKBi ztmJcOKZ8|Pjlbs@ox@d`b0YG8XwWi7&C28`pB~m z?Wn$cF`7`K(*P{woscq;j24NK=6ohWKCy?arD}_t zk!5@~8jj8f;I>cTxakP$XBRs;tsenwt;m@g0xgR&9G8G zL!sm9eu=-efsy^ifHzf|D)GM)%Y5Ucc}T@v$QiiK&E6`)^FE!S*QM;_Vrx@BO5qVo!Z%-} z0}(`t4(5Rh=LCDn2jW!X=qtr4;SM)qLTFs)th%_m?T};JNYudKG<^VxPo(6vCMl1X z73zAMjJ7=*U-Zt&5Q7B)Z9MVmcUm3C1G6X+i6%meR)uVs`+;9#c8bJQ?3(hGTPq8< zfe>-$OI?q2jK!GYZ~AIHdMlczts&kGRK7`|bw=0CvK07IcDwrZ<(x zzgNN zdYIOyztHXMKDC+G@9@Rv?wLu<-It5ToZZ=Qx_&rBTEo-U*?4pz>mt`;r^mTc3jWb< zP@E>)qc#}USA^7bbjg2=e{HpgkR$ym^Xrr5#d?B|La;V@cfr~XVDYwU=noWT5tjh3 zL&j&F8mi2=2_4!hlm9~t*)bU%08KOf5^k?axUJ3!s%ip`zF+-!m*=C?e&-fEK!L#1 z@sUMM-Rh3mPd=I)TR>tUpNb0nWPZG{|U|M6nwT0YlLrsvSHO#&&7#QsaY{*;> z47*?8Z7T~Cy)Y3)yAZW?!mJuQL8Y#;rooa}XV&cuwV5;84uGP)vm}!9sLeE%Un1Xy z$m7G!Q>L!mP^2vv87NkX+x_!NsuBNN_Z3wA_|NM7$2gpc#y#Va8iq#xOv1xY&t!Fz`gmctEoVI!t!$uZg2(nG>a zj+(jcZ$WEgJrfVEaAF^OLP$UV(S}TS{pt4eXOA}bKHBKE>8^%Aiuj8n+O;;_l|T-v z9K|#vB{H_$0($G28;fTge*@QN|6 zYoQM$+&tu`&hF!!=D54utxZ@BurnyI*FSxVRa(9iChYQ#zO@Dde7VRXV99*V*H|ZV zn`y9R7@L@~+jRenzr@aEK7euhXUAjpd-#eRkZuOZbTKv9>OfAy+}S#0(h(|XPQzSp zcvUDd1VkahwTv5@vz%2qI61cqT&av!7S~X6h6~IZK+5`eG|^x28LX-tLt|sih4P=^ zIbDon(As?ALh3HtawuHT5LD?@*-<07M~x5JR2$hjbw-+^Y}1g)v;cLiL(UPY4je#$ zJ3cuW?Ws`%7j!ldcA*#ue18*QQm~>LTLjmY)R=$kKGG@d{rDpotaKJX{dC_;3=6^E z2M&?URpyIHElX`E>McZSz;b;K;Rt76va4b!2OHrju;MpW_Fst&cz;w%cqzUn$ba+- z2_TgH@$kJw2eNlDCz+T7Vs=+LA(*lTA@*Pavj(09ZUV4i@kW7QrQDRa+@!9Z@^m? z|7w|6nlh*h2y#F1nP%PCXPuSSeETnu)j@((Y;UATY=(&kN$YSG1?;s*3@4o`EORd< z`7oLmUG`-}!F^92(FYZl-YJP!{;^!!|rnrSA^Y~j(>`Darx)1kjtQ}2c=o(RIO>>YnK9ykaeBPTccON$V}g5DB7M#N!R|Wk zLqv%G0J~}}y$3igiK)?nJ)4WPV(?QNj|Zr!KAe@NV~Jxxif(HGm56*qgut;6^{XL|I#ZdIxDn*+wz*ZPe!2-dNw=-+b&8#6J-ER!`uFW6TfS zzre-AGOB8K@jUVGh3l4M884E?gMBDI`$J?i;B?3C(u7ngHi&QZkZm~Js@ery z@HiiGH(pKwoXN+;%fI*>2Vtx zCqH$15gRwN13_d^7ZA+d;&zIDpvOZL5#{RD|8q5(iVsWC2q=a3LdgUUCbd68G55zt z-x#$_hZA;1vci_~$y)F9^u$&2utq=*c?V0fwrM|RG(WIcwoy?9h8?vPzv`d7-bI(f zzrU>RQ3?wj0SwO*CNQIF&+H;H$OBY8#x&E9J}*CNIz5=aKx<7_x~6{!H>^^HFi90D z@g!PFZwektg!(Cx-TvtGVzQT5r@jS7(2>Q=*iO=Ffy%Rh6hY!y1)MhGuG9KE(NIL3 zrpW+}vki2kQcwlX$;KcDxZYgAfSfKx4M>x4QX_-emQtHc&TXy8hGz2 zhJ0XLyz#U>2Qe{%(=KEXxvIUj~6%q7YvljP9@ zJmOuBpFD;fH}lN})_Zbh*Gzm)4pI76f;|K?;1Ns;XKb80dxF?SZAj1->F6-&MabMr zyLZmJ03_>8pM49w;?4o11m@DfafitZ=*!|sDkSX|$f0>XK?BvexLwD0TgS3*{3UGu zaU^0OAI`ZGG$0%d#;s%E!yOj#>Ya~XY6ikQuw3KHyTh);*N1+=7~4aR-s!HsxQi5o zC*iS7Mw;Dfj90fVuGufe&1lQ52v_J$_Jvp;(BiY^3Hxl=O@gnLJ9vLD3|6 zu)PQ}`eg*C(gk{1Nyrd#V)WFpV(U4bO@*CB4o`9lw;)qWib%2@20JGW^VIT0%4Kiw z!UteVYF{AEBs+*u@MiKrB6`e~nZQQ9fFyX@8xJ%)o^rGloZ!ps_S@zKUPC!j{1S^% z`Y@3x!BV6mMi_-NUJ>_J$}kMj1DB+wscb;f7>vQdtX-hm5O_El(CM2M9s1EDsaF-c z2FomREm`|wm)-pQE=SVU0t4xKq6~3566R!+j&>IN6yHGfZjyW^@n*S&V*@-WIqhsJ zxMsW*U;`04&EkW#N~e>f4P^n@AH0#a;Ek*ea^dlR7In?CCl4sY>CkY@3>fFjxi zSRExFE^j6B?-Y|Dc+%0vQ^3~zunWhIix!0e7zwLtYHQ<5J1N9+EsKYiOrPF;5agvo|0P9#ovgX3z;JpJoAP~$LrMBbM|i^NJ0s{^khj}kiA z#Ep1? zWKU|nc<p;J%=w%;tA@rHe_8Ui=p@G@TTLzb@|iBgvngy?Q9Gn2RBO;Z_U0clhf>`aG}$ z<>Vt4LW)DBTt&=Bdp0{^rTJ7DYo5V8?gb>%UAP#Bn1I9~H!r60U>4HS4NIl*A<|qG z^$`;SF+-MJ`0Ipj)W7;@GOV3H&vO;?5xO7JAY1YLqpXU*RFc$68|;^i*G+osW7`{)Ja(mseBe?%QW?$IyZCAeN3+>%nkvB;2I-&OhOd!+t{2S{~8Tkl>XpCqINh66j$z=&~Ng~gKaK)F9#<_ zqW+v5jbY^&IDr)b{!^IlDsS->6oA?#ITmo7>tN>BV7o*enzJWT6MsM}O0CDra4Y_jbST~jf@@dk9YS5GM z;6+~*DLR33JoT*rQBxb}TYX@C+oUHaJ-_E}AbAwOw{Oz4eZ{%I^5e~V-hwKY^Q8aIw6Q3828)s9W3eI9v_wJP+VUPe3=52%Vz=J*B zu<%qGV)*{MBj}(VYBfoIdJl)?LR}Kg(XsKbB~M89X}o2 zOEffz9V^U0>FPy){E|7r-@7>K5^QF3*0IPG!`(~XQM~SS zjIC$uyEo9k2SMDoEbYTPk02CDqM6$O2uEPy=DT7%lN4!Q+L)j&3lIj9qZVR;*gl2- z7sIO^Dp1-ei)Om?J)!|6JJW&T3K^cLo6%q8jb~q?XTrDOZ>n7z6X7$WIfAJGkAYB}-g~f` zC$BM+VZRS?);bj~K<{*v0pPujPx`$J4U7rQ2>cc_2S3-KmteShNV~ZkvvR=7CT82x z+!0mO0Ek{(hwVS>X_=ve?hTPNSG{)xDI@G{)O5oVV-MKKyrGrs6 zu7a%fLORV^sbb{hqen{$DpSy0pldC;$)JvthdkTIeqzV)Rub!DIQ?+3IF`BM9jBbV zk;&tgB-J>E9CYvE1@IAc`1m$H#ES5emmj4WH|Xu_sYQ9H*0q$>_aT)&{mrJ6N(NHD zDEd<=v@7Z_91dRlH|dk{F_c}RXThlrsnkr>T_|+QrmFP%6{xK?4vN_dp;=Bn#gm!p zq@H05PB+0a;VK$VZ(1kiFFn&eooW^y-3}1RL+T*FnL_u(6pr4%*QyH89{vct1Wr1B zOcjBGPp-g~z<`zl*C4wxK{0R6`9b(}ndOWCM=nP!piV|9XNpxH9PJ|G0CvwIt`hiTsIBRi5{T zFRxfb39tq=L(Rk%T%`(%6JEzru|>e=w93M}?D+C2kl|eqDz<)GJg3z_7UlYP zZP|CnHx(~yCR_0sC4Gq%FG@S0Xf3ghF5F=}hR{l)gLo2JJ`9vrRj?XCay zX#YQ-Go|vQz4eVv$-|6Ev6odTMa|<6YD#?J4*B#b(=A0stZKqDKb|cLxka3)CjEH71D|TxkgZ3 zjYe=)pfCwl+$|hk|K>$+j5jKORbEhA&c~u=YV<_(v+<%H9XWyJGAGdefu_LpEJ{b=|1lw@?HlX+2RP4a#z1fn>>w^wcP zHhdA9pfL8FR*?}I<2~Maj)nQo#1O2#sZE$-$;@Wtr(Gkk^S&cI)@~f$&1|D?GS+10 z(Z6qQgr4-JcBZIm4OR2yht!wSaHU1!TRIy8;G!0o?NX{X3=n?Auy{iYZ$*#;p1Te3 zbWj#g8HgkN0R`gh1h} z@;3ck@;_VNDBrVi2ar%ye}<4bT)vXoAY5(DS6Zq~`_tZ-z8n%n6Sqvbl=2gqvP;9OwUayx*3ek8o=M>aI6sl$ zD%)ict*SiBuK-fV4+Th-tqK?$b*k>OsISoP=OWE zgwWJimI|fK7n+nsb3HZhe{CidSkmW!`3e!g*ws~1N30l>*endt?OqtEY+3=>=nb__ zbXdFfR=0f%0)#`nHZia5GTO6yctcy3Ra~K9#__O9HKGeZZvLBiDIahd=kmMRYU>koB@ka_z!O^6f&qY}y2hXiviw|I_LUDAS(Ur6f zAn{r101>Z`i1?Y}k=x*qKdi{lYPic^=KW^y9SkmQ@R?* zvOsj286d+%$Mf5V+0AcTpOM}t9@0um4#x0Kh3PfoW6CW;0n>k#ZED;JFBkbs=-S)y zYXm+8MnRo89faP>jAQyB$o|nm_GT^0RgKhdNLzPfc3#}?KJ;LB^cLpCcUrx10I!A7 z@WT~)v)z$=(s_UGEWOXyt$!mQ>z@yn&P=qVp%VNxtrQ5tz8t+hW}R1R;g0VhtQyoC z839HTVpTd7T3|K&(CG^r{-t-HJch zAHqd&14cn-awJRX>~v%Vfgq`32N$yO%U&ykPns1-tHUdL*zKI@ZG_s7Vikf3Rrr~~ z=n5qt(nwjkE756$51!@!&T%tmlDVe5Dfb#iltJ5RzZ->38X(GR$_?Sd3z|D7PmGy$=YKmwB#Y_piW%W1A|GF(_kBJ+mx{w=dTY4b7W9x`EF$Qt5V?4SOO&5k})AP~W{;8N20g*$LE_keUWKiWcq*Dln zL_W5}2uPW)1}|9uQTuvlk1uE0C1aBvMhaFp{=UJlQM!o##31C~u_PKSe>+ciw)yrc zDrWOvS2K{mMy0pzuBh+H_WHBU{axpBqSKX7tZ+kkNCohzLN2taT8HXINck(e{JVM#_|2R7M>+a@J(GkuC z=a8(;LAbiQPupq1=_cwhxJ?5?NlXbEZ(xYdxXXOt&wP}!@V`A?WFwb$hmOVMXD{}r z<0npopeetXb9u?~7#s1QJTrF(7>ABRNN1TlNgSaO2piggnKAs3)NyM6XI{9wtv?`Z zEkeR!X0o`|nLSFYdVfi0=uk%~QaeS{Lx=)G$g7i!J44{u{Jz+z-W8IL>IxTHARE>D ziKpZP;b#I%S~YZLlUfk&+N`0kXcw9Bb3U-7)%?yD+Qh~7(3vymPt6+EXXp2FI=Z@q z-er;gwBgMD5a>T2U$s%apMV?EN{g7xn_S$qx!b#~KN44HUX2(sFH13DNFK(0gz=pp zy*SBPw082G9H1}YTj^CUS`7ui+M;cQCQ;)Hl(gi$!j|IVFgNh7fV9+ZTCre+Yr zEh2Z8bQW!cA_Im~6OjF;MQBl>!0McFU0V=>Ec3_u-5^BM7Gh zgnx|oU-i$=H{bP78th+OaNU1>wzQF& zW-R!ZkKiHCHR9UtpBy9YJ=}Hc_t=+Te%apKIcU3p-c_V-h7bBztz#r0zIWbxb&T8V zEn@t>M>&-6w6*%CH-6As{Sp6s{!{Bm{`m*@?;qjZ>wf(c$Om1rZvTXCRxpgSnYDHD zQdkA1u~T{wjE3j$)k}Ub)jWvE7&(}{Mkz@x^_mO^L`0~7e zPm^lhMNeQC>`$aiMhZm-9lduLJHXh(7PN_j)4rGh#e-ysa6~mJ$llc0j+#|YbHs8p zKinJMW-3Y}(egUMe%0OxGMO8gQ#YAwwV|BZS6M#AqWQjt&8T(np2qgcbt0`vne?+z zu8{QIxm#MKPKQX#uSEG`b8)kj-t3vq&pPwn3&JOgjBG`fFB-@4wxvh5v5`VLod_AP z^a-YP2sRx4O7=Ve`;+_`+qsik`t7|7!|SRIl-|N&Bj{^2bG+7i3)w47lNSUq**bOl zdG+KjTK6R=%@Z@EuaGP-v_mZ12QF(B6eh0*XV4rLgXr5!$)S@Eg^zi|F{>OPYKGgQ z3n{$lphJ~#^=d;dJEKz)qZ=AgkuOpcap8fwzsi_`b7<$#Ej9koah5w5c&~I`5~?ue z9mr1Gh&hj;p0OJIa;cPciqE>TD+uv z|L_>Dzdzi+qQTI8F9YhuA_r;pHEt7ty>W)hq`3m20bpS|0MVNDzJ@=5f4z=Dtc=LD_6_l(4I2x4P+*+yeeJ@l`g@2xM~F)81aU%@LxIPB5W$t@e2-8G z@Hx`eVJ^5y;<|uI^|pe45mw`4loY9t48#kmFMi>C79ei}RN@(pyAGBID2IelKL!fv zi((CO)tkL2@t@2QBvPpk`e^LvJ%;Tf#rwGy?GXHa)=xZ=OtKnAQS z6Ua}&;BYvd%Li&do==dH0g;Gjtz)4+?3h&~Q0UJ8{TDEIqbpQ$eKP_Tc!^N>9pwL{ z+Za#=iUFi@U^L=IAI(lDt!K~o515zDC7YBS)#yx75P5ujHt`q7DNBp zdm@HczIS)O+vUkSdNM{(+1t_h^^qYCnDrKZa&S%Y`IFHIDm1>;HvDb%0)PUFU z2@UE1ky2znD3}ip0d>F)(E=N#k|*CQfFC~mesgbsYiIlDPe*@*7c97ynm?dJ+m@s| z$8k)v!!Zb$VoC1=+59F0h%a}2yfCB+W>0Uug1*RlLBizG1uA+CUchsCisBft;F2GJ z4-{8n3V*u3zb}_0Nn_c)xIM;k+}=1@X$}_T=JN2E>bpWaaTx2{b#`?Q#kfSS%2~Au zi7%|*Zg`s2KM%Y8rvQ=<7yK@jp)gwJFF`DWESAkBzaz;*daLnb?wNrpZW>c_U$`MR z&U+K25H|r!-7Ud=La6}XOR23upEwgi-5bXCn&b()wmoG)(5IgU8I;^%2<($qna@Mv z79y-L_AI2o3xf+wuL&vY-UFN^AeOlh@M&_@W#Z4`wYR#l_FNjyBmyPVWVBES^n?^1s=X`}F&4i6{%MG972AJtEv5RCZ+Xvrm z?r-g@=LHz;azfmLfVLY>hzw7RzjK;r&*d2wRyz%xel&O6Z6^wWa%;6Z8B>JF58bHG zH3eAOGtFS6f^mAV8i%+146rt14;5oXLlLwTg=4s482Grr`Uj0|Otp!i!r&%tEkoX{ z3`*{bg!S`4u13#%fa!EsR*^sH0I`Nlp9Jm_94D5dd6U+oRE2nLbWggi-M9;o>3L1I zH~+G^e_#^;Y_;0hVCgH>`-6^>jlKpj{+ml%z0vNpJOqC5k^D{SS$)ySsAB*8JvQMGz1{ z47L(5v-s}>LLQ1EpVH>z7e85JeA3#jzmBeukn!pqscSLtv;}wJOBB?De*wJMNuAiwHAuKka-Km19w7XI0v*8aHm*;;$;maMbA`3_1|dd7pnoiP#j zc{C5jNEYHO-#vmtiYsSI;Qp{buD42Bn24wALEfM7==ADD%uTH~e_H!DKj$=H%$8+H z{aX?cUG8ns50hGD?mC0XFDD^V!l+;6HzWuC>(OV9;TLJLB;=&K_y6X$_o(~!)7AR} zsM{Hdpz*gv&W`qld3(l!>Q>KbX4gr35Db_+9`{+D=aPP6terAz?nnPV z84cZFN1Low^h}Eb?2booV99l*i)PLs>Z01iyeaH%>}|>v(w*?2j-Uq*xR+Pwy)mL~ z;Z(-GoV!3@y4o#FIDyLrhN^tHk$HwzI{9jh;Y9_w84%xWcp&(Jy2Fc5=HmQEiW4(Wc3Ta1=d(+-LG>+T&FYD8y z)?!DhE*?>-4?_#k562b%o;1xie8Yn3?whWD6CNxxp3Y#o@${P|#@nA>y*S$IPp`(V zI#;=$(aP8w2a~P&YrGnzrbkc2Yxd~dF?^GcaIRRHE?t5nyV|hpnn-(nv<0tQTDInO zzNKaFW_9kGEY&$tV^*IOXqqSbd^$Kk0tnL{_>|0Z*X*0PbAYbYR>!NfkB^)b-O!19 zJExDoK-DyQ>xzikruvDvw=?}jPp z*S7n=F3ywY1z75xes?gl*YBp+>-GRqv;U91ckgfOIMRgw=cj=Aa()0EiN3|jES=b< zC@SGbA~hmqPlohB5D7|HlLQw4Z8MJdv%k+%)z$ZN08o@{XRO(ciF5jNS65e8S5?=g z1z5hG53O(}Ps|eWVapKCJ5DQY7;!qmW*u+97f?h;90`qo>vGzs{XZ@vr}+u`>&1V% zxkoCYY7Uhbx!O=^LcEz)p%P(59`xveq20ZnCt#LrXeeR>1J1VB?D0~cb>!Y{Brxyh2s zXl9ts_yU`|dJM@B$H(aysVSt^i8>#`aw%oOhCfKv<=&d_6%1BE7Ve=8V@pEX)Zf<~ zHt!9YSg*Gx9XWwOZbqf80cD zz4Mma_T0B*9B1C@fX{pj6kxx0%4!%gdwnr*2BpvfGMdWb!bURdE##g+0@eHC==Dlh z+zsh%XsSYY3imU3+UX6<{m(fp=vi!^iUBF5)7#isUx$0(HBg(m7LKsxQH2yznYg62dk-+4fS7WcZc=B0~mu4uv zOeq;V+B^K&H}^kRZ_C~)pR6K0wnQ8kAIaBm`L&{b)z#Npy>&lE(!Gyw-G$LQCX2KP z@TU6cliR~1^8!it;7+-EZ}lbq{|USz9h&5Z@n6784~`PT1{qft74o2~9&^@IlIiFz zjh;2NjXv+1=4W+syJN34$A93G^R;KqcF01K08Z)O1~0bg$4CB{u1Z^JUwVXxfFKAb z5M6NU4SztFxTusrDSKgNu>)Ob7dz0|2XDiD&g8|zu~R4oG~rnb`izMb2qn9v)SY~?*8d00Bs@g#;kOcq8JtF8foRrXF;G`hNZ6joqNx+&OF z_x|S)f7e&g$r8|5Of-_#L;UfMmrH?S`NK5vS9f#sR&Z<`?jp$;yx8PsL6j5Yt$MKt#dy^zsJ=TbpMDE92Vqf$B`wbx$gR-1<#qC@h7~4{ zaMLtCM?BKPU;k`Hw!u-~zEvWN7?u4KlGXVj4(xmUizBX_$>QNqfE?=WldKH__2^G6 ztKmcC?5b9u!pwa>ynx<3?Iep6l=pP0UFr)9Ph@GB!?6v0s$;vmow#;i7wRnhI(MgH zs-o$Eh54);pMU#+W&GSrHEGy)_9m*&=f8S%J|2i;M<~iyzT;&rDmMPH;uo?}rIUeXUyu}~q0|b$!UsK7Jr)WV_Z`nfbdih;QRQ6`ZAZG)D zm4-w?Z#K=?@xo>-RFW43m#Uc^Ys0&DN8fe3j-}y>w@O3QXynvHiw(n#TcSpv;Fd}Z zGd~9NjM}Xn_z`HmRgs1elgTtFI0U>wr}+!FGtzIwJ~20p&?0e5FHxy6`p#np=U5{i zJ>T0tM2zIEjSr<$DdfjmGM4)vAyvC&>?m%pmc7%yx_wmM+c8*NU!CIOcT0I}M1D^+ zGTZdI$ZFAS!T^!58a6$qT~4yjzwqteAN!yFJoj=IyWx>MZw*Bt@b%xYl))sFnU2;5 zaMHiIkb)XuNum!TwpcH`R4TSeIz06ET3*C3asj(~3s$IYniOudn5fe;4H~MITM6tg zg!Go`o}jEKSO242tXV)~P^n_m);t|;`}woSf6pTsLs!5Y0vVH;xK*G@CDRS1_+6o5 z3cJeCZ{|K!o`^FzMU;@{a*D2F8-N+n^5|}2UPwJm0L5<8@%Mn3JY!937xy5M~< zMy~0f)?;EAP(zgy@+jF+6p%87nhVG_mGlc6l52@r`ZI*IVxYuWZ|Esb11%zBafRh11Vu8O zJ-Q(Y%aX{Q;DQrNwn9PRl8Q6l4J2@;IEn|vw(Gl`ExqopWXRr~im$w6L-I{YLv5d` zderISQ}<`m9G^o1!=oQ&PoVk17KB)v&7Ci=QQI_;c_y!Kf#^Jz2;TTxYJeI)C zSUZ16_FU>Qnan$~#5^3INHKzA`=hX!*o))GqssbhkbjD%{AuS)7@Cnh$IpMN5v+VVMN*D2a|+Oz4cs``II9_`oR5gy zhDpe)x27Fip0Z;#B7BY1Q^!7f*jW+iZzPKU`wEl$@qzre2#Z9F!Ej195SR!UJKg#5 zr_N7E%cm9tIILj;SFpNHw*_vwGvU795&JqEKa^cXfyQqDehwXxw_Aa582}mVJe}Qm zLzG`22kw^4GTl%pMCPQWS1HNX>mqpOS`%{m#lDs<*^Y|v#DD^jnBgA{YGz_%RpmO?4<*3?WaV91gP#ab1~ zPNd9(95u;(O%LYhDa**mAf8|!pA(+xmhw(ITV@rqX5Ns!aGRhqv>_AgY_Zl%2pxyuJCDyi}1OR+x_wUhIFL% zRySk1kd50>{AL1yS5}}>y)Q**up7)HE|2!xulie9u#}I4{W8zh@ZE4AZnb#lh#e%} z@B#g9D^wX-MAb2ali3!OZO&|U-lBI|6gRR1Cn2(exJR^LYQp*SpePRsX~~JJH@+q@ z)JwEbi^j7?LBPDlk}luLkrBb|V)GVbs?C$W&33c-f`tYA9Hl)Kry|!y5=M&f3spsG zIH3!OHzLZZ39(oe_rOn=;z*4=+)6i-hU2_;DFev;nOD0aGWzfgTWAc^N?io)uGda; zp%oj0jUNv#UY-u@!pClFD^q|7;5lT=EPyewngw1m_w04+Rm>>qs+d`H1c4hhZp?x& zH^Y89rj=Ik80f~wg6@qkgY6~47bNEqvKO0-U^zz9g@DlV^!bCw^iIWJ&-M>@whwn6 z>W|&8whpDp?W5hjt;c+}^#ELGYx|IYyUMq)q(h8w#HKK|Ou9|1gK@-l^I<~jF>3_P z&mgIV$~bj;sEUNm_)T}9pmS36eP>;}Ia#!Ms`jga0NTdtdzdXzTue^}ku~f59o_0Z0cHSggnnA16x?^om(3b!6Nz1qzeHhr5?_J446W?N7wWu{B_{1sS<1Y^?s6 z!Sz$e8FN?L8-0Knv-ti93^=Yd?gz-a7fUFhRT82RES+X{gNBIb__)(~vic9Wzsy!j zfb)D43Q-LBrLHj5Ocz{Wu>k;3N>SmV10|e932-Gn29*R2y*+y>m2e!XCd$fV>a9Kf z%2T{@&~W5Ovn$0QonG3{0&~0^4o@Ki*@X(`yPUNWThARJx585}2cc*eDx?3&7g!>h zB3@LosFPKz;tACug%_?64sGBM!jukQ4-XiEhHC}}>_|V+JM3OuD6mJz+2ou&#RY{e zGMN<)9jgCAglc_}e!|w3iq_As?3)Fa&REoK*PRSiK`wEyqT)5H-kW$G%^Px>W5BTO zb-HRkm2&OwJKCh@ecMQVOv|e2ts5{ZD}H)1@f$9QXGxr3yv$N?eX07CiWmv(&FzR;tK(D%}l${jZHCOcC$x;V4kndUI! z&#pP2ec1gtk_B z&b1beie(N#W~L`~-|wnqDd2z~k^|-sMSzkQAEd4E;$vDGxtF?N6LM2!J#pKzpaqFq zW=n`PE^c~0Izde`w#11wLJzj2g;fpj8u8t<#~!0!MKCcgzzzI)wcvf4?Ms!obG_pc zvX4Bh?`;J*{X7x#87d;2Bo$!G!tcSP>7CTcYnZi$=|*a?B}HnqAX)1U+OcFEF(0B*zcW+en?@CF0T^8OyCPNO0k8w?!^-nbgyqT4p22j&83UmEvW(V3t7?V4u=wwS%qs$ zL7rjI$7>XpG(lPOdcK_F3Y#X7qz@Lx-AB952UXd~E730{hMa;LsZ7I76*}&=I@TQAT$~}u2ADy9 z(@R+Ej@2IoRa!KvnF*kWlE0p5vj^v+Q`f*h2fxC*u^IvX(1TKr`FcYnVvz-9ek96;1Mx1M#_J)x1}{)$tqOx}ohol#DPm{AD~sB_0a8Fbp_1 zm@R5eF_STG&kzSI$JAd3)4vUGlE)HYx5e~Ij~ui`G8?v7g(97)ttqVmhJ0uNigRFdqS_;D^=;U3)O7dMBPW62=F8Q8I*T53&b<5~;7S;8z zJ8gpjZnPDgM8`mh$LM7vE8azRkcmkepXmglKA}BNcyQ{9jQF`IWsEnG?_=` z1)wM=y*u^UH7cKAB}Ce&eTR2V;Nevpgm~QuB;GZ^$u~F|>P$o81uX+geIhOaO8uoz zaZ-Qna+ox{)buB{mrk)e!!d_9ZLC*bw+WPN&?2(P>*j+7uO-yD z*vEK*f<8MxXj1EBtKwB%G<7dnhoVXdhfoeHFDyw^GKg}!cEMEJVAS?zP4lQvf=}x+ z(EVhj-n6@Ft=j2Fzkq>}G2?RMU93iE()wNqp8T!Evi9Jr{5_HqfeSTi>kZ&8hK-`( zA_&1px`XF{u+W^)S<@vX^DLOfGOSXK1ts3BIn`rEqk z=~Z}K5d}~Z^b%&kd`20s%xp8Ns%hsHvzR@rpzJ)<_l$VEdy3r>Q@eYL+MQ)nE3WA_!Np+mEsfnM zX9zR;Ib3YxZ|v>Cx1+18;c5CRl$P~<$s-(=S%uRGim~KiY}$1on$s$kO@^@6Zs&%X zsYvy9fW*-08y<)`f7Lft-s?=!aX%Rso;@B8TnR@v=Yc-jhpjaI?#Vc9h++;Wv(!#} zIYjE!_^a_H<}w|gT+c?|4XHjRR;F<_hF;xSjfc1&eZvlX`4R`NzByoS?r2f;sf6-2 zJZ2q|=mRXq^Q#9#I71G_QW(EOrS{3g@%NWoXOKC|x34GT@BRHt^j&gG0Cow~urRMB zGHtq`U|G3(>T;wws3k}LrujO9eN}RgOGg$8=JJ}?dhypD?fqnV$UH0`T2% z|0k(8aH)Pegmj60%9|anGZf!mH6+)J3M1OZ7Vc`94kI6P239aHxhBQi9xkCj#^tT$ z($wWaRylZeSKrG4vbkArA(=IS1f@f{(3g9*X!CXEcQwY9B%W2vTsmiWl_?D>EW>n@Cy&NOM$_Wd;j*ubt9znlds?jP5KAntU znMGkPI7u*<%G@8HOyc~{3k%GZpQ44D||9<*0 z(t)nEGRm#;V#v69>+KxdDjOBYR!HAt*YCZfm6k*lwjto#3~^i>HfweeSqp+)`(@i))aI?jugrO zmksGG`CgO;PjnmAFomGd^ z)ehDTOxvErYk-Jd{kJLdG`|89oqCLO zxG(Bpc)BT1Nv{6cM)&`N|CNHef~WyuLJdetXzoaH`erziWkEhIq-he=JFLvdm4kR; zq$Qx|NOQ!I;>zWkvyO> zEA%}tFU(oSN(+ZW&~m*n6wA$=R7A$Tup; zP+6Ey8I)lmhTjokGX0EXwXf+EBWM=6I-aRak^FfVLK#e>+;asgC5R2XLZ z&=+PtQ8HB2-WS1yQ(_%TZ`b)2e&>+No=tIaldJ{Ig$PMuPFFEG4K$%^2LpXS86&v&2IT{XmsBDLVFB^c24FMB zl~4BV=WET#`G2MvNtgku0~$Zb52{vEQh5?Xn<{!N4x46;%7u_&Kft)?P7_n8++nP} z*+T;tWMoS&6&U0>}Z<)vP3sG?vnP|gq~ zERm%Uee7n18AW`LDw>?IHWdkx(jF7lWBsTbKI@vsW!a;gChhrYDqZUc(laGW!JR+D zVUosGhbEzl>qc6>suirDfuaA2GJ-aLjfFKeQq1)o(N+y z2R4h7w;=BOn{~Aii{`}RswB>)^^-2+G_Wd=P$X1vZHZ!xcyZ5`pLkdsO?3rHg!-*v zGtK^W*!MayW7G>;%jd~;L8a^yyF>v%lf z_?`dr1J<}H7-ekRDGyYiV9Rl1+r`F*1H(=F!RhM=3G4_F$)cV%g(YiCCOfpRoCgAq z-*7kL`s3Y5AbB}}Cxh={i*dQ*qL(tBdm}~!z;tmn5MTcAf#NM>3}k}B_dU*j*W38r zx@2ZK{s`EMxHSA=P{JvUjeJpl)_|W8`q^MK#6%yE^CD(EVjVhdhdKQCY~|bO7)h#% zR`)sw`_B&h&K#+yRnf>KEixr^MpPxTk_5<$JvLb&CZLcUWFGZ;mjj6g9pUmt7h+v* zsnV6uhD=L?TrZjdW_phm;fzDciX3R-t?~uU7u+5VA26-KJr|#UHNGmbVmCk;iN|sT zMVV;(+)FZ+C_*C1Mx8y#^xZ$IYf^-y1MPlWS-qBcwt6U_Va7>EuakJ?!r);0>3GW{ zskx0cZf?QFE8fb9^jjgMbipE%R3>*6_}hI~b+Dt;1$2ae6fTc2uQMGU96w+&_EixxE(_R1uUEQTxQR4d5q+Md?!~k-eLcQDKkd98e1}>T zUrsMzzok>qmoSWst}oOp=u4D$el<*F9hjhomyF8lOs+3Gvk@GO&PNxc2BBwFw({|% z+$nc5LBFOMyElGVJak`k|hJ7?R??|g@=SU`e z4_C;X?Y)jn^cxiZ7=H)54^24VqXrNrtM0pJ_?wcQ`YzBfX*T$l&Kl>i{ID5(uHcaZ zZ^q&2JGA#CPD5T>tq4#Ng*VGjYge}~G#m*GO}*UzoCb4n=;sKjl&!?9nkuEiv zJ=;VkLwZS^o6aOb*IfC4n=pK$(wo?BAOe_5TtUM-C@8GNM^6}3jzLbeK}QJg49+O> z%FzhUs8dvb($X`RWA_dw#KAfJfp7Q@Z5k`j2-QL!G786ELb)LItOkv?Y$+a7+%KhA zJ`_>d#8$|!!JZ{ID6*r$p^FNog$X8nsJ0ln#}`wKyH%GYXeh<&3T4SkN2?r05;0lr z0cr^_0V=>DeUU-NS&8bMfz?y$HxqS~=G_w|s^`LsQ+ij&1NApZv(@gx?O=#J%F!qZ zT$Hb4ptX-Iy>S>a|5no!RSi8U#)=gi$wJX{C*UVscX6GHw7zkIKrhbu9txKXOV}>k zuQWwvb1VQ%r%Fo{Q!_yv6~mG&~8MM0u*EU0BKUZB#VtwG5+?TxI? z(hDPIEiz)Un~}1$@=2WB6M6)$o)%;NimI@fw5Y*f!+>aT?=U}#N%6x$ppI*v4BLsiqB^Qd=WudZOh?Hu<}~;|&sJ zVNEqG&AA8u&0hU3?bW;lD^^OlI@E*7vHUgf{W7^^8;sj~W2CM@#y`2v4m7l&sT;>j zP>6%+S-zHBXlE!Nf3Fjy%bG{^!%dE2x=_!28m|p?v)L z`>`2++IjN);E+~pcL96ad3n=$A=R#x6o#kqmo7M<)v+PIG|4Re$L{{2*~L`6BIphZ zSBL_1I!SnFG!DDgEFqZA2WR8)#`|j@G`D9AbLXRvKXEOzrTOrPy?<*k0M-dsaA_Uz zS>||3aW9I9z7wb0yTHi&89sRVvY6pZKC>Ch?C%1W*43%te*5I4fb4|N3^KU7+*|Sc zj1imd8|{<+$KRx0!j;f-G5GTS2Uk3F^qGuKk-x>&uz$y)=RdPQPR48hXL=6D*Hw{$ zU+h<{Uc*1nHIzGaa4n>VRfoPKsf$`;U^P?;=8d$QBwQPZVDaA3+`YBHIXAD#-p z5asd`7jQVQtMRy{MxWS;3N_xFR^O7fZWZ_K-i+Z~$($7sQ`okUNw8YerH1ekTEoFy zt=(Bp4?Qj1%y;Is@M zUT4Fr`Yc!6_Dp=(wVTlqEGf__gH?u*;vs@x)?Q8^82gs9a5q3Y^`q!qm@-RYq)?&{lV#8e+Si|)AdVcP^@L- zbXHj{eCr78p}z_;MCScw8zXX-qn-GOAq(Dfuf;%cw9+l)TgWlxL&|Q|7fz6Bd#5@R zS|Cun;|V z!Dxm;{d2^G%oWwwNEoxx?O{}J<_2fN;o@h=_v@dbyh{W*W_>8^4r(-rh!g2WulbuK z6sC$uYkcF60+{oX*cemZ=erARWLGyE4*T^l$(-ptuGT#A>^gf$Vat47JvZjQ-F_K8f1PJ{EVWbuCNg0na+QGqf6F^8N)9KXZpjDVmv{ zi`@I_>r&WzTe(hPKru&CQDQ+pClbL&Qss>XxyYLzS6|><8{OlnIHa$sD}Ufh+2oKu zh~c?#UQ4e}IkA|Tx>iRYS)f}w?D4Y?uDOLAvy{&42PjP&N1pT3_m7|b4&L+PLNA{p zR4n>l*s3#%PtL=ae zi!R%$ci1wV)SVP@=idz`eH`}^Owf)1JJn$?6m7zwB{G%)!f|Vt^&>*f(x6yRw*^Q9 zm=X@ngR~ri8@ftFjFP7GD;dddS`{CB^ltBEOuQ^?`S#+N*Vx6|M|9?XlN%ZE-LQW& zVj_8D`RnQBK1ure_b+Z>B7$6s zqnzwQGE7haC0jw-8ziPh?mi7wy4#VT+;9j#E{)u>YBX_cKGm>hYSF$$wCB6ZYih=n z;AdE|jQ;9VmC6KkGye*##6nGwx3;dXkhMg&rtM7Kn22cM9&i~Jr%mw)mfhFb3<5Qg zZhLbxqR%WYA^)N<+y*)+t%@<0Redyl48m@(^x+50m7*e1J|&Zh@)FuBvl5D-u3{+^ z@77=~6pI2eB7TF>B|S(cz!)MbI9{iWUnoczGE&wpWELxvb?lZq zRRsgQJZ)m*X@PVXgR2&l*j?Gdh7m`CP=z-_g7q79c^VG|RFLhfN?P&Bn~O@29#NT7 zyoLuWz{%O>xV-8#8JdWZ7|GQ&zCQULVa@PI$UeqS?^ChLpQBT{k9kG151p|~y)pZ~ z{^|M2*=RCFkaXEP=vmo2j3`nOR5Ho~V3@6JzS zpnKq_+e9Odi8s@SV<2|%1IR&wE$MIFz@8@x`4smNCJu>L@*)XwjQ^CUVYK?#gTqrM z#aMeixWV(2Z+Y-Jh^8q2Je&0Vt9zXf?{$vx=zMs|-ODdQDU!iPf3<9`m|$9PmvB;9 zbm6=Uuycdj<1y)~z-N5F(*kxea5L<`(uk0P4W^M+E{|IsH< z39%Ef!qH6e#LIQ@oJ6dP+fl0HZ(P|CrC1blJ$@nwee^A*0;8dHWsUbb6KbuMUrCyc z{lyVw4;h?&&*Uu4j|m5mY~LcOh<>ah<(pafwvj_-j9AX&gW&~SXkf^aoH8hht)`Qz zNhk3S1^)##L4`6u&rkZu7u4x~vhg9zFZnB^=i{r7E3ZD)SDzNI;5f=xzu)+z^6KC9 z)xQ_7K2dZ0>-EP-?PI{H-2B~P$2wtqlEC&{vY(KKUBW@qrUoM@#+r> z;U6jx{;@A({joBZ`T?;|5G=(5EL6c0`|9+=^4{W28xB`>cEiz`l#d85z9&f7IwI!+ ziK>$oS!R&$ZIulSrh{|su%$vdh~vksZRVX>dsYRa`;-^HC`radq~bY@`aZA0V(5`X zKV4W&n3>{~_xUgWZHiPKbRn8tU}y3j5_BUa1wD?XG6Dr8w6(M!XTt&OnIpRZ9uJVA z!W8usY-Un&n^v`!^tDTDWSHO{&ZRB)J8YND&9XY);TXw`te1dKj{Q!o@^@@ij~(R> zAZrb0h0$3?#5ocSnJu>XXXEjV#qk#I#Vo={^4Glg%@%av z6GAMu@*SJcjcYh&u%>mq;6y3o$UWyuHx&1hGFRQR(GOcv5$x%B3UB@I#C1m-Nr_Ia zZr9dq&kDF^9qtWZfholuq9xO=H@D-hGXCXO?PZe<%lfeR#v^3VV+9VM_e}X_*?)V9 zs?4F7GWin04aUp-a#;BnX5*hC3DLL6V|4%XurNK!Az&|v13-Rlm+lCh^m~-}f>%@L zdsIXN6Fo(3PV!1H-`C^Qte-=40jmUiXuWzc7ak!2U2qjWG5$-DW<>uffg9v6JsC)L zS$uv{X~E^U_osN@b~o{JgU0I%zh=4(?14}*gm8UrWc^L%rLWr?SsanAiUBJugGSrU z7$+Yx=QuBYUKKeKIqt%bSN4qAuj75b zLH&-%a3d!&lq6TFs%kfk(EE-0`w1PQFST-rwCx)yK4DW4Q+>|fj=}@|*f};vCUlq& zAZa7#7o;sGru!_LqQNmK5NiEMo3zl68e`=<*$_X5(FClYa{C*G@_@U^I8`PjUsgjM zq!CSNEnsL-xtN?mmdJrEC z;0r{cNl4kdJwC!Ko*>yPo(OowUEzdXHy;lv%A^ghI89Mt@ka*WLen)d;%=tfJlBSa z-svn$JuKkLxs(aUMBXSelqW0e&D%aPITn~SU&x(wCSF;a!UKMYTEa1>f-}bHfqULt zIa+~Nx(YUaB$!>`(TYWeSw$9)78OzU0@JacBQ1z8WpVwmyS#dm#6KE~uEiMrr)uSX zubdR!=39#ESO>0qRv}shjH8cf&+#0a8?bf(nfET0i4c&B%O0XK2dj{mD15D1uJFCqN9zbwdH) zCzvgmm^WJGeSP?inbHJvv|I(6L(*a>GCm7^6I zS&OQ^@Yg?^iVhY*{boEdHz+zV@ZQzGDCQs(nrii1lULUlaD?|hTtI19Q%<-i~PA!z!52ELo45 z3~_|3Pd&skdOm5!0lX(m8;ZD7hr$O*b1UV2=h`JG$lgN zAT5tzWKYmpwikDZ9X)eL#JM>Ta(fDmxX64^M8P|(*HGPCeTHHONXqO1XIrCC`Yl(@Vbt5AU*&T8}ENm0P>PUL^1sg(WgXLakKnIVwY0i zuLikGB}~9B7gNlyX*GUbw7%qW{L1oI+?k89h!n9QT1!ET$Xz*@|7T{ZhyD8_JvKk>%z!LTFTwJlMFk9W)TYU2WA-=dvy_X21xI=c zMhD?0=ZMJ0?tyJuY%BLV{&Nf&+i>(_*XMgKKu=}rAPswSz=(FB%s)wOHc%oWk0V^; zU&_Go1f88maP7+)vP0&9=mE=cmN_|xw@UFPEnRH|il1&h+u1w(>(0UMLI1(Ct!*qY zOMNQ{((U--Vo-DofZz#LCXWw5;9KI_&mSe3TtB5r#hWKI3BciGfI_{OuY%gn%18D& zftoodTd{j=VY!mmw8Fp-Le*8G(f_bJYH?5V8m$2tPaS_Ja|wNHU-Ht!ywiNw04o~x z+3@Nd<_1xi(b}S2y+}?sr{zcm`zg~$C>=|gOfgUjRIbkue~tVAG-G&oydBsAE|KHG zLf(@cG!Cr}G+A?*6&$0P?woE}VM#D6F{xwP>c4lQ5O{ z0ugFIsqKQQ`P4&9S{-1G`v72A>%Z-VRhtR;0(*+tE4tJTkRarR;B8lPHtcG z)D5@7uF4MZxQeV}7{w9(28TSQ3t5=Nu8mnL7cTc#Iyeq7CfM+c70t)*{dhv8##sJ9 zG9>+8$+NmLBwl4TSJ%_mwiMAw!jD>t?>e*@@2qoKG6`N~;B5cQ4R?JxeLXs(P$9=w zG@{OJ{*clcNG{)d0&zh?!n%y;$Br`G?SRo8n0)kS0hn~mz30;!AUP+^^i~QYILH|26Uo(9RuOG|ghq3mT?Q zc?NxKG#NsQV-iQf+x*LraF*6?yWks9v6n1qT;Do9WqrI;P0#2nBE#$BHN?v}%P>7z z%x#ax?2g3A<34=$dN9+4u81iDQ$=0n-BjR<31d8VlvKSTC8kmSd_X{aXm1vc4oY_{E?O%L?NKQe>vsupD1VT}gq;5|`1{ox{&zo&z4 zEH!HIS6XOgW0bEY<8C3XBcUSYRrpoVx=Q*I-X|@yt%Ys~AI(mJOmyMx zSW@jtl{pqhiff*mWlp{mKc;&tAL5oxh?KPD1FlxOq{ogcIPbQGhF_BGFK0gVay}ug ztaIk#BfJ-OWSyt74`z7rYQq~0j!Ulf5d z=sfz5?Y$|&@lMXKPZ_x|=u8mxg{XxKbyXAbmyGqUy&&2vIqY73H#i@iZaK@1w^*y! zh~F(Z^2h%N|mVm}^@5eIZ5VW3W3zyH64>D++?4-b41A}Pd8HF^q%mWc5va@UVofbMqD z8h%!>K17&YH537FE8ks8^+9arQAmyoKWI2ALz9~Z$L#Vo={^4Glg&i%M% zetYNwLN)405IW!LmY}?8*&$dMV^HEoXez3lS&Wju2t~qRcp;>bl3SC>;08kKUkB5_ z4R07erY0$Q?jAB~MU+K}Sh9dZe6+*L*Wnxe$<`=eHmr^I2+#SQ!r=$wWA}_-kEVTr zS%zbzls=OJDfCeej~JmlczLd&RN?XIXp(^X5Z2BUxTx2^vn%}uQeJj zOb<5b@imgTX5&n;tb-gCuzx_F%~~?zx(?CT_9lYJKLbQ`8Nxr?Hz86Ahv7T%%jY4Q zc=w#d9R8?l{#q8aYvO~YK@iDCLS36b#2h2b9%~H92fl006|t3M0ewV}*^bRNut$~*WG>P!cY32iquerSiuF+GAt>Z5UoazRmFTH;veD9A$E-Z@?1oJx~;E2 zbj$1C+_nBM*{%9ZcB%e(iHm9OCjI4hk^T_+w?7@->rY4T?uXL38a&+P>{~@P^7gy| zvcao82h<6WLA^`pHDKg+qyp%9R@kZ-6O$vz^A?*77K0okOE&Q@mixl;U8ocwlI7*# zoaSI826~}S!*PvgA^ioU+EYoIVC@cZbT5(Jg3ZAa`?BSF@Fc)}*y_a%!egc^Ke`IB z+wFG+!`g%3;NHV~vxT!&*r!;0_i43fBZ0Oyb|@MMOM2dGAOsF1@>kHI%7u5BlcFHl zCL6^^pL!$38ygIQ(yt6!#vFb(8edPhB?w8jFIuqwa&LX z>avR9WOzzbQTLk;{GeQO5sc=w7rot`9+nA!RPl(x`vw{Ga3wW@3;Iga`0*ID%mh;c zF$ctz0OI9%w&WKYF1*|j3w~2W1#hHxG(tHTD4KC$28vrH#aM%B@LG)V4Z?`(9@reQ zTA@5!^#uJ}^aK5K@e|z%@A}yy2fUXWoIpfv6V8 zEPw=Q9PiC-^69)Lkmlw$`NO;>8iqo_CtZT}8Bmh!taQZEs#YGUZw4;vPXRJ(adCk# zWxAIUB6HK|=@1xkZqF3LO1LtNA8T|0a&|usATjy!rP+YxNTB$DhW52jYb(fA3oehbW)HtX@T5+(9{6-xbiM=Twj0x;%^W32xt62ud;s za@Od0ua5%3rEzlM3v`vvFr1X3k)P<+ znsMHbnX|q76#*!i7;KBqQO1FPJi1iF8zW!jo!`2)N2ji4R|Yg^e~g1rwx=sh;B1hH zd(gfD*~@N}qIfQ4lv*o8OZfD7BxuzFn?gYBQCF<<-RAr!i*!y~zT-|BCG^PIS7HH` zSZL)iu7PkC_qV5S_dC#m?x%#vpv7Vx4rGHrw2O^ecqYX?kb$wF{cguRrKZ&lU@Qb z4^Eh^%RM85&57&a$|T5*qP8+Ng^Q&!wygM`wCs@{BEbCi^(lM&0di;YWhoOOWFA}d zBVmFIeeq#SC;;j?Vq*%6=jdT;&LMeK8r%`Ea1ah5Yd)w2j8?%QQcHw3qMOdDWB{v> zT^HWjvA+TlN8JO%@tq6;N*PUKSIftH&!0TlDNb(y7sx9k)#{;>i~?k(1FLyJqYV^8W0k92i}}MSOiPy7o;g4ZPGfnlMz9G zIbLIsiW$1pwb_BVCdLVO!UF2rahw8*jw@#}94s+I7Qvt9nV6+KJh zB0KTtiS-VmFic{Qi2p!uawnJw`cgqfADKbE)F82LJmfPwV|rAGo4%K4Ep{8*Kx|sLuTDvFK!Sef2LebVjR9~9B84VyFis zT}_n?d)gtfozKX(4eUi%L^+7bpJ}I3)JN}FD432euMv8sqmP$nBsz`!vFDu;?Zv8rahHg%% zy$1HCt&D|pM%hN9OiU5gcP`6XQi3Y{3iiECHL<-M!o(?Rlhch#@+XureAU@hcqkwLcRIbu1a!NV0qwpXr=6O&RczEKV#9{d&(mjm8gbdQVigK}q zP`T7pJcK5Qp9q0`V@lesoMhC3t2T-vk$fJD@oTRfgZV&ZCSL*64n==pyim+t)*oGo_fLJe7bY z`K!6Kf!*IqS_aW|=SLQ`=kvLT_}~TT=T1VJp}*IY`2^SEi^1eutxyUVz2OAPfF;rgCoV%#$3p#@ zKUft9V%(maz$=5n&4KCbZxej{hksXl?OSkNpPN2tenm8K6p+%FxB-}4AVdgv0Xk*; zVc3&|qzfH^NLteD+9y~=w_h_$6g?DBdd8r=lRSl)y-74sE7`OtE=-H?D^jD!PPlE^AT${W&q$hN>nP} zFcDU)wpR^N*brD~MKBLPw^=+_vwILH);IOi7R&8ihlpR5k$@@4zfMUf>VGaW2h;qKOWKDKkERj{Csax>}HwpiY<|4caXhrTn&OW-C_vOsx ztw`w7DXl(EB#<}t&YZmKu=#p0wQuUpBg|_Bcx%3U#+vKH)9AC)cytQZG0=KRsTw@;Xm(!sn ziEc|W#pF`m4V%Ko>W>**KQYUXofL3+b91dW`~Z${ab{VlkV)Dj`!*Xw5+4EL5&4B6 zF`a5b=;>r-uHOzXryz2fF_W50UxGEof>LU+)(u=?fi(vV?l5`i6Oic=Nm3@!ZEWvh z!-7$!Zm1IO(IYn$mza=SXX^5j;kH(VKpf9uqf*M@M}gKZ2Hy@11j#kdJWYYWp{*w# z{DGeVG?EF|B+9piRDgCg1&{>Hg?gzZWCADk3@I7CFgHZ$G%%O|=By2MW*W2qV#S02 zgoh@B2E4T#IQp$W0&MS<3!5_42!18EI@ra)&9I-2DLM!^*}mWfZN>r&>Yrflg>znJL+mc~(0?Wbyjqr+nYln{Ic9ShFe1w}{61-(RHqd>t65)7Bc8M{D zr4KdnPwl(3a=L}@b?$#8?ll=i8{JNP@KoN0b0-{7fXvgJaEKO~Yv+s!+Ly+7ifoeY zM`CKtGU&m7acM>`d+99*1X$twpA#qkl+a@mx%y1vn!iC}{G&s`zLUauw($2-=0hxJ zmM2I^KeY!j>)Myon~SsY<;}{<`yZ^x(RhZ$X&NdhCl-IIrAF8;rSI%wxh04lV7Pzf zM{?aJnxQtyTOh7u5w)~=2pk9+G1l7T>BLg5S+g9F>GjnWf-0vKXoM>*k;Vx_WXqCh zdOow=u}gVZx}NwZ25q!xzAq%7kuUuMdh=5HI9*p+hJ5lTPFZL#C+dM&S&mGPAEQ9< zHRAIDI!s;HC$kbmX7v)#3p1xYy*qax>CWSko)UIFQXe^Ks%}9)n-MwN;RV3i`&zcC zheKExChFm`Cl)nu48e(~pkz5Z6ii)7p#&Adl|;Vwgs2o}`hvI)z8su6E8;P~oRzJufDs4%X7{RDG z8ADCFo1R70q&u*h(m&PFTtf7X&JhTn4hU9$nxptN8J}B5PY&Bq)@x@aY@LRYzmI}w4mJl zpP@5{t@NYczCW353=)r5m)w$8@HgME?^fA+rftW&**J2WwO%O=*7^fbKdBuF3B=e9 zFCIAFpNeabOiOlDk(1yn$tnTsx}#I{B-|p8Y1gMkf`Fi38>=(Nj7|%u=m|fG!qOZv zLH3C)Q1!Q_>Q-!uz&wrmnTf(c`N=wMvRH&saj5{!Mxe zdAJK{Pvov3U#M&vei!X!uZwYjgij=MTN{w#zqvW4BaG zU^~UhKD;~`>SZKw9=lj-&Lu57$wIX-*4yFi;~pGye^d?VTRVY#z3VPjAc#7_NeDqQ zef#%vPbxKe-Cckjw0Uvh6k3Q-{(Bmb+$T;5k-WNYge4_A%OieUB# z_d|jgXi9kLu8_6M0Ct;P^I4d7i8*=*B`k}Va77c%UccPDicTnHKzv7uY2@shAvGTO z^7iYYsLC$9JwbQcL4^4C6!8sR>5k`6ZwD7Tjmhu~>HWY0%+wz3JhAHIxf7B$Hy=FS z-~L17hGs!OI$vthp57em)T7U^2J}!(mloahN*z7xa<(Vw3;-XZiCB?{y&TYX1D( z3VH^k7*`w2)IG$_ zD}b`jypzRj=Y1qxsI@9tf#3uw8Q0`CHtuDtGY>IcI3Uz_rlP-|6LTnvR9A3=ib|19 z!c&!Ji&=w(It_a<=CsY+x!&G`ki0fd z%Bwu$%MrW69W22TtHzSuEjkK=LrT2pxxIlEnUxSdu~d7(s zk`2AbNNlMo5tvOv$=FL>fFOp5-LeIJ6UH;7{fE)n#Ocm_L*Gj0jZJ+S#evwrevP6} zi2eFI=nw{S&>@Z8rxN%&jqK$3^0cu0nY*ndgw4%;Bz~XO63niWMf63W{ufM22{=Hl zGnhy)R1qp7%d*tX?j0FDf--!UWsBwLPmKsZSCdz+T1*eyhb=Fq^Lg)atCiib2AJfp z2n zOM!lyFoCyq9kYG7x#=pD`J92u$prTW!&%m!{n8S?da7^?wxn9|R1mR?34;9lgA>Fi zLYXjq5|{}2%ggRX9@kq|6-P~d)jZ~UaVBr%jL;+2ofI*7P7lCp8OQHVHgG)%^K-yM zgJ=K&<-ivpmc+X5dTOBoi@qM=lp{qftSjEZK_ca*VVScjAc~{6aHY z4284OBI8N2^h}?ka?o&BnL}xnhrw#1Ifa3fp`#-8P?u566zixmWni}U7~QQ~&V&Lb zD$v%QEWHBtd^!};rFUBht|0M=@G=rJ7j7H_q@uLwb0j?SK;sJ>vf(<>aYR7QGRn?I zrWaax<^{4QD~}8y1{{Gy;dl2~-qxTg&^`m@A1SB!%d`FGPy4%1p6)+8>_2$6wY}44 zW!i6$2bQW<-b?Cdx^*DqdA$}MqOxusDPSw>5detQY9TZ=#kCI63Zsm@_6pX7tB9R= zJmH*b&1P5592BKU1bIlejtYT&6D`>Rpju(Jjb#Hfru z*VU56T4brpv#_CGtcyZfHmn$%Pt>4^&PgULV1T;q-d*=de_ zGDoC8V1;Q*PlgD|DnkA&+c6!)eF$>Qajai&v2F^0@kiS6F%Pt;e@cpen;niNjvR{; zwU9ofAhOW>hhpi2nt5_@)yqFc`L1gQsGDqnh=gPOJRd?U$won_)nXF@Uj-+_rQV1{ zA%KOIV6M~-FGv(GJi*lejeQfBfo?}a8s3LT{D6#yL5P#Lk-y418-$FKn8no?7o@i1 z**+HdP+E-skM86*ec*gJm`IEq&@4tVFBt`MWj3SO#(9M7w~cx6S2Qoa=rW8o*d|3j z`j5Q`)3($~l=kaDcGxT^PKxYxolBZ04fxeY z;BRz6uIsEU&|Tk%NwQ!Ui_y72p|gKHynF>$jX!rxgp1xuXWSPN)NKPOcC!!a187ql zKnPTWS>oC0r-9)caSQrn>JES48Y-yDt{zC)O|4_Oa;(3m=c5xy-1$T_NGN*hpoM%B z;lVwG#~v;r;uiw{iW1Jhw4u@`o-!?Yo+WYK`%21{z43E|($4lTpH5&ln#`Dc0S01t zJ`68m*Gqisoq_SqtcY%$5w0ggLKHwie^_x{fofia*xz@quR7h0m9FI5J0Fj)*f+0oT;fPS%tq&HI%OeuW#^9@zeg}V7-na3jSGMa z-X>$Nv&s1M8UaoY7;sTI)bqMYK;$5}$B?B#xF?b?OQsL!Z7+7Y&gmG_p({OnTL9W< z7CT|(M&Hr2-Q_7;-8c5YdcJqCbGW{O(<~f5ux;Lmwn0~|=_9&7)2Da;!T&~VD(xdu z9*T0@)2*#1TYuku(%;+p+w+I}hx|LZGFMI7Pks0l=+&{RkF^+NYcMa#c0* zg$n7@|D5Mf&jbQ?Qpk&nE^^=0b|v%;9T~|`Aa1Bu1OY%cuRJ!{0LLtligX-KNq__* zXEYL0T;51?h*^`t|C)iE%tcv+zSLW5!#cO~+rbWMmw&{8Ng z3|}?P2x8xq(1$^Js6{^kgA;4T%Fv{Sr)bf!jQBiusKog!dd6Qd0NG2ych%A^KpxOO zDofymER04uUWUojDAJjabC53~t;gTZGoRJ`egXuFnMb1u5;eJ%f&MS=#h(PW8^28D zJVkc&v&`2)rU*nC)T);U8--+#$LSE1^!S}&x>>`CTGQeN{8(o(et_4ie(2j$FfiOs z<-Qt;??d03nLhkR>OA{YU)e9bpyR0D6Z+ORjU9^-lA=B%YmIax3!)v2rt(AF6hOqb zRGxs1HMvC-!AdE*Fjk;?m^%SV8-?t3ESAlNruqdeZ(nUa+ueHbct;h6OAxTEX0`xT z1=Y9JI;(IhsmS{x61;@YGD)=oE>p)?Z>vqQasVmx%W3X~~ zbJqrbt!!M*dRj!~r=6p+{{9K71}3aastdYZB*(R?{rSGC!`Rfju0jh9qrB~I!ee2%P3E8QsiZ5g zw>$Cb^su2~krV}69_0zd9_8=FGN;I{pD6Bivg>efj&m>~`QM))2ACzq0IAbQpN7l7DS zGUrp-eYk#*zR_LmTuRr%C}Sv=d;wNC2bc^WIXFd(X#x*IkK^As9b4Puy}yW|C?L~w zo=sF|-hGr|hCh9{#l<_X4+Wj_i=oZ?I2Q{uFDC+>GV z?qaXH9o(>wPDT`YNAQ@OedTOIZ`<^>b$Z%?*XsFAM;MRTcSa6|)G$S}H%(3#Fekx= zPum!5BtZIXaCy4Xc?Jdw$fsgf`uxwZEPWU}?y|KBXzs22=}&*^?(83S9kC5hUL&>Y z+Sz#g*-H5PsQYp-VGx==!rS|wui+7&|092Hi3ECR@eeS#6?DI%+aiNQXr%YY5AhE^ z7ST>FjW`S0oQ`2q>szt;-G?2bft`!2;dxLQ5txc`pp18G6zY7G)zlME!?9xiJnHA+ z6sh#O^RVydK!%%|Y(L? z(0jTBJW+E8koal1Lpt~U=W>{Z3i4@&vu?{?e4+q(0_ig^_QIket$V0A@B!rQyLiAzn&tg z*L1P(`#b-+{rLIAo#uY}!yiu0uTO{QkN@&Z78oysG&MiAe}_|JLW$*g()%N4z3)k{eJN_FocH*m<3BPpd8{{#PzlUg2r@y2+km@Ri zPcJoz64jOqM75z(rLvy9S|tski3D2~@nBEA+7yr@lK4|-W`)gE$8>6n&hJRn6&b9! z35su9^y)5!!H*5-{NIbf5xNl#AWB8mb%(?z=|bGcOw|_fYqkVz(IIYlD!DTc;2J(eHs>rDyA&u}YN;>$ z^)DdhvN<&^l{D|I*xMgD0qJlI7KM}Ma(2fi1(EMG7z^D~uv!~@2h#=}J#BF3`)bZL zUZ8?!&JQTiiA|krGW|Z-HJBB0fQt&xZR;IgRQjz9Lk`>c68jiVO4z}D8qSBOeerh| zhoQvUN0yTX=;W78u`32R)8?ia@Fkg^z4*~kN0cnba9I*i=((>jM4$U0 zcYM?DYd3w20VOwl)#qvcGlGx0ZT;!sYSgC-e`N~(#*LQ+2U|~f-30I*e06z+HSZ&L z!(iWy+S)(q+W-um1VOnZ;0Yngn~KTEM1%IU_VBZ?Uc(2Csl`o5a5PTpOB@4hvRK!D zg!DXgKS8LTN(~~>`?tDnj`*5kl#L{>E%YeCw2NH^3S7oi_G~E0i(o86?Q;)IhuaB$ z)x+7f7_ewd6Gk)DoS3kNg-7A4EWR5vGnU+X1^R&N=kcXJ8%2M|bSIBxTS-=n%O8&~ zJNTEg6J)#St?Mh-f~}-$zYC=+KIXshD&iHs1*(3s@F%a*xNC1SmA3$Mn2EaL6MH(F z1?R(Zp?+C)vz7c3EXfa~EC^4+npt&GUz>W)kDQzo^EUEdui*tVCE zhprKjf#$UmmA(BT9(pdde&vm4qaPkQ>4o}jkYM6k@S?mhM#(@yxZ*uHs6-Dw${&3E z4H`HJTiD`l?4o`R_LwyW*ii$M1XnjQWDIHsCRwk>^6PEc>s^FD!tOXo5oMWC@XYpbzZa=dTeOt#sPVhCHzH zF#l$n5XlQirfQW&b@=Z~UTyE=np>1sd$5fw*r9tO*kGbfpPO&$oI)-1RQd>?Na!h? z9R6RSt^hZpm+D6>U3vBU52u@o$3pNdN^!#8^>eku8+ehl8)+d@BNaAiNdhS>E{B z@vOr0L}%k$Fu`vOw7E@lLYjWXn;BF?Ufk$PM0Pr&oS79Ox7l0-PoapE)JJnoP1 zd1HpkprarD0&^GDmIkAvpJWJzf;`Tl-WyF}1;ANRmuBOEmF(Qmey-9Av3qLGAhAQdUIbFlEzYYQg3z-@YSSd;>~sqovze zW(zvg11+O3m-p4NWKa)1vWwl4^@XkA+=mxj18D!z_6gCKjuGdi8m;xBgz6J5aW^dp zRZJOhSw93v!v=N{DJF4qOQ+MP>$m2uaBsr?Pjgpz)A1V!50DNSPC)EIC2zRA(c~8) z(NJ(@lbzBPgzL#rJz2nHu=4KsL8?BE77(IwFy-)qD5W2VJcd^o9}9E#+%uU#=-&_? zQlM}R-TT{-jp?-6${8_*1#=Py&bFMbitx}XKIBxpG=qgLie7|TRk~(aGJU|ApN^6d z)VL(*mi5w}B#u-5bW0)fg`3>bN{$fsARt6CMGz#3yL^j&^@zy)L31V4?*xwRvTS(z zh#Ho!H&|~TOki)6{8m>zcIG=k2{jZQI5lu!@|4?J0jfyz5M~v7_Sv`jR2cO2#s<9| zsZ%(ud$z#>Gj$UXt6gU4GMim;$+(CYTkzCU{Lm{4R-w~yrQH#C!|7svT5b6jz?lxN zPvECF9Zxh#YwQmgDeUf8fjhb*tf?1aDlY1p$U3YSl4W8!Y@-lQvdp;~XO9&K-r}|p zvU;l|o?YLGh$#ND@>el*_P&w<1u2b9dW@u)0oEb?~{*T=Qqza+h|6qUr@y^y>e{1hyKhT@TgBY$rcqT>4bTSvYCRl2704%A7>@b8bi{X_}RD8Ahhvt}6kTGF3 zU>1U1L$|2zV$%R{{%O2=+7iPOJMwX+CoPI{S?6SM`oz?F6rh}8fFINb#ChZpRB4eI zEul$(=zlWu7fT^xe3l`7zqf19%KURAt5}*~SLhSuFIEX9uX~*|<5_|o$)0c@sfE!u z%gV?q1UYolLup4v9=dpWv6F3UVFjrORJIHBEEz(D3Ix%<9-YC|rBg_p+u&dn z|4z)oz;TBv8|FVhKw11I+*lBBf=UgW^&=t1^@q#OUOxbkn?o5?H4+Oc83_`drqdZ{VmA{2O z*vf=n=NaJ1Pk?wrsQ(HG6ULE)=*Fhb$8fzxd4>B7WEoU9JAiRFx^@AU58?alTIB)h zR&KJ6!Z73z?qudZ48zlq(PFX~O`{u#EZw@WUZ0GUC{4BdI$WZiu8jbXsQ9`Fn!M8- zK%JHI{{3vedJ1Uv((DyS_l&)kJKIYE-V}jK*xsn4LWwS{8B^=voAg#U3&@H)wwABH zyPa~hNCHhY|0a4BT2&TNX!giSJ`!cbv=-OpZ~93ZtzPOU&%xo|zJ9{16^T}oYz!}; zcLd#JG#g&rRyUFEL@W6WLG73c{&sa|6P;vH7mJU7Z*-k|+$^h=2-U~cV>KC{@BWPy zkW|0$$Lk3-5)`{YHniXcai`e>DRnbnick(0HW6s3fFy5YvC*9yWO&CY6pVb8TJAIX zzzNGHvlhdFVk`?sXtdBu_-S*ttBFQm@Gy&H!Cfm=fs{i52WnapDzAB`Fh& z9W^LYDGKze@?hy?ey}g*od80?ra+>VbeFB?nRh90!Lh5357LRG{7&_X1Ve^9Ip^YI zFp(aDTvz>g0TB@gQMv@OSv+MgF#sxeQ0A<3m-l}vP7|5%RuEquGQ$}JCJJuvKv!oW)iLw zbn%~J5?I8i1=lO)q4GARon(Lb)yc?$J!UGdvnIuaAPx@o{!&`FZqwwQv5Z9~m3-)dXrHC^zw{*S!)T7FFG0FG*1Tzo1=IJp)ADA~8q5g_Y)oJv z1!ievN>9rFBj!=k%+gqtlOVoh4Vi|kq$22ZZ;rBARZk`Xy7~s3Fn{i8#@*A|RxLJa zbdVR@bIRiz>}H7m$$dmG(NqbPo?@j@n#MQZ_(m?lVIKIHxGWU9OnZ#kG#neDdI~}t zj#gHfmNr;_-o*&$OmQ8j2y;i4Z=2p?Z}``|iUz;J1%-z9iAmfSf1NqG!ymPBg5E>o zC|(pqoq#s+iu2}w1x>m|tOsH2V&oy{XdbSWL-V(nsLZ+9KC?RMzrw4ehocFvky;|0 zs*}V4!!s(&ypAOgx5Dx59tld26TOCyyLyhIIw$gP&;hsC??2i_vey3k3l?B;$y_uZ z0@ezIOW|gC)_KwIKiqxR@4xT?67w&XiV@)DzskrUN;;{(Jss`M55R+l#0t{}*ZLd_ zZ>+-+2TIGrWAgq*5EzXoquEW2cJa zZKxOrT6sO3j;0)xe#_A#QP4uqs+oDncm!sBu*J&S8Svn}_n)yEf(*IHky${1b9XjD z#2*Y6wCWA4Cv|m9n0v#pk#u3&xQEVNoDMn7w$t|Z;=?4ZA-T8}6Cu7d*x0y}eM>?72r7genxL?@5 zQT7omgBf=WtOdI^5zHY2;o{TDLb(3SH_sx}Rbv=>Be+Zsg$IM_=maNZ=ICUVn4V52 zTh~krBowunko*WIt>x+sfue=4R3=nv9)uud7VQNm%lTeKX$QZ2h5U7w->!T)IG+_c z2rl#>?BunCit_xCcOiDTj?Ex4V~+!$+rkIHo#3{>5~k!Ei8dN8BQBUD02<5J?PGd@3c^Q47Y z4QUnc!(|<>Mxi{tRC~hib8gcRCK1MSV}~;2WA{Wbf=wzhM$!GE^0aUrF4bt{p&d`k zL5h=g>&ec+Q`FxUE2>C@IaHZQ42KH>A<~0E?TRX71&%qE&<}J7b|N+)*&VTPppZAq z8zZ@DabjEOqL|3e*D^>VtEES`;*`MWQ%bSzd96FY8;zIgnz+wg@l#zp92)4v+bBpo zpdJsFC?AbrHLiw8jih7X@gsff?UIEQYFN zI$WwQQQ_x}FkU4WlFS{Rlr3lDuPxUw_EkvqckIp#%`pV`*~!l3cRN3v46hbS!+(bY zKrS%UQoa{b!<>&=z_8?S<_3{HjW)OpADzubHs?- zZ!uNCS`o)oK+SnN!9_UJ3!$(id|+q8iA<}IR`e+=r4F^EW3rM#wvu)}Mg#(l8N%15 zHy1C*=Tm3i132~uW=6?$q)ZFUgXMaaJ24eFvZwFd!;{^;$Gdww{l6YQdCZ?aNx0PZ zeez^y?~spo_O`d49_&1%%XMs|mR5U6Mzj~TaV!w;qBwCe;Cn9vW?-#|Nh~>zeL9QKQsF-pM3n`hc8*RW~EcK`=hn%xQ2hMHyoU0 z4L_D5=|ztp4L-Dn+TkBQEIT~;IJA;+@l(K4PbUyk#Q+(|AT~iZnR$65()q99WPJbo z(J4xcihR=P{nytAPjTFVHt&m^N7o(qYVQGFF-^2f3q890ZZt)KuOa+zaK8;v(BVBu zw_z8WM62m&R&ktG7G$IQ*C7%(R9<2gHo9MrC+DZ>OGVVi>U+nlG#*&d_(y*@JsDgL`%@Uw8D2%dm_CjUt|cw*Go&YH5m*S} z@RSWJ194vY3Uc^HqIh;k@Rp0YBI-ccYgDGyr4>=8Bj+}4xfK;b1C$!rU6sz0w#J9s zl90?>2=E8X=^W4*MbtPU^3>gl$dV$Fm0MEA+PH;k%wa+=Y#0mDJj9~etb--p{~V4g zdyvVX;r(McDU<%XGl%wZ9^JI9LmRvnVU#j)UgP9XQHc}ZaQ1qFqQB%8t#U!HyOU3F z!fPOe*lBU%4}XVgiq2>E!7>D%6e*!qU~5?TWpzWh3VJ+hhO#x?UI%_D>WRy;(}Et- zew}$l=$%H?KkqKU?yknza4N<|FX4~szh*|WI3ow7^bDk|argN8$1aM*Tkji)QxIGR zM{ajcdq3_}ab*rSUhi^XX_@O&qQ2NUiN--5oX?TIS@GA`sW!JlmRJ<4R8n_?;HK@HpRMdAO6Lo$wT%<#94V?newH}6uV^^O$6f;?X6HcUmCUT`>6 zk-nE)mzlx0C5=9v@yxa`{eE!uAJ^lV+@)EZwkVtCy&-+4IFa0o&kp;4-FdbH`9|p^ zX%9waOO-sYE}0A~x+WmK8Y9{x`Ns7HR(0G>9K7ObVoHgz67pC8@E*BTq!5c-1msu8 z5nZc_GiTXY2@dG1-Bk^bcT0p^J)$MoFs@&(B?z}3Rq+n5q!ZUCW)?%g3T1coUI!z~ zRuwc0Pm)C|2F`kVDzxafG^nw6jDJ6VbnoMz)(t>u2IT6=KorY z2og_N83^%Yx~tLy|2OKv{={%Oy#IaN?QOije%xIXa97tp%D#m~#oJzF6Od0ulo4@` z-Bad)1~{_`B7l@&0Y|D4_Qn(W4 zcX!tu)Un{}BFR4|Fy#{MaAp!OB?t{08~A_S^-R0^HQj~;qyH)ilS{nIUivgq zlU$@SOe27eJK zO9dhQ-Q4i08k0b;SBPAk$~BtDZ+Vp_*aQ}%sAf;d!iO|J8%zQIv2mji@9f#4ckUW- zg(4oxePau2d+A>1!(v@G60OClO4M2iC-egZM1AjPgHDA3Pd7JNX;8RmS8nYhVF#uV z5BUaIGkQrnaW$NtvF=?D0DauhVCUj$rY1<_HzFjeazJ61Ab&cm`*A!2kATHDAW6Bc zH=Aml{Z@cVX!Ru7vCOBgjZX3v86TM zd!620y$o>jp~6bB5x1Or z`$~!8U_g%vZ)I46-F(E%e89Ci*)mZZvQR+6b!A_W9tXcWNQwX9XPuu!;CO|r+lG() zObG@5*`=3s@+a2^iKdHW1LN=e%+_~4>?6Wth^kHFDTr4r6kHy$MbKJOfj!U`wjl>< zq%C3{~+tqG&yv&_i&7p4~)X; z1tRVPLp2n=1Ie_RQ9xcbPXy&7xSNJ`_=^7&AGeG{E|$I3@Al3xF|($2$F)_?bhZ-^;jI&XD#MeJW5? zCfd!EfN(uFJU`pq4BI<%uPA=$hWlBwd$dCr&*rx7g+B~@6lDiap&E9nhp5}9WD z1>_-r{p)MJMBGqrenEP!Bl?zDj!?&q^^F);oHa_EE6fXp)wV-8@n@Y6JAc9}3e`Vo zr6K+$CQ1Pe@HkfN+!x@Xp>{KQojO{izy&`GG2}>30xN@`qhMng!fb-DPzfYt`(opv z$h6|#rehuUA3fjOKHS~klU&FSNJAsrJ{DeV`C6DRu&F1hPt?@SmN7B0?)dJ+VMaVM z!tBx*Ls^L8R^vyx)oA<>s&1Ka<_ZsG6pt5ZE#yJIbT%-5L4T_zSoYF5&bUMSRKSgw zJMPj}{k^1hz9RoWd+)jx*OjG-{^u#eHdzr!2wj}jbsF1}5JG9H5YT|^&L)&71c4N3 zh#-l;l2THQKK&wRocHK4&KUhF{Q&(6=lkYdbKUmZaRDUTl_sk!*n6+rTyxF)oXg!f zC6yVqFd_(~M98?lWQ^3s0FrV0hQ`UHD-sQ`ZatN}mUyz1QKWTcNukfMpzx*Drfs1j zb2WO&nJV{A&tf2@J<=rlD6XI!?K5jz#`fXRQf$NbS=K6Q9IpMEYlLDgl@;|YYHB3N z#|n&`9ygfvpX7Tr$cJMr>7c>DfI4+Pn2fO>lS`q<7@kbkRzb`#h!3KX@bgN3nP-~1s0m00%zPM5nRfxa9aicR}n z&B9{R3NU7!M^8X~hx@MAC?v**{HN?fgbI@JOq!NmghsA=ti?K2LWnpMptP?_eYXK)qMmg$^U@0fjBs%L(dY(GB%sSAj>*6q#Bo@=Y z94bW!mx>af9#@!&Qo@Q*w#58rve(ng6$q6?v_MLv6;J}zLU91iaFJ3eHYQ0`w|`Xb zh2qV)dXcNob~gTe@Ms5_tJs@tI_#N>R)XT((6<4n>n57asMt~EaFmA%C#CXUdPtA8 zP(YOAA;lyj2cg8^T6ccxR?73l{{y;W8RCL2VXNZ#(A9TK$s=_G=Vt`qWY){eWH;f3 z@m+#yfxJd5F!lv$MwC{@72dmt0-a1^^ay! zK}?8oNC{`}{7LV$$3XXtF8JEFxNbu}NpITFaRpQ+ys%GVUsCTPMK__j2D~cLX-l`J zw51_xh@JNu7C#ij6GMr%j*SjFZA4`K1hqvkaYPp{;vkZGn^A4hen6~+nz^OAjOrdD zk{Cq_P|OO}x|NysyKQLs zs;F?lie!SaQ;uJPqbKjsZ46zPX0GUwZeiVd(B3mz8p8y~kfgo5IJtYpDQ2M$`8M>i zpOb3fX$V9pFbQe;3oxeHRuIlw)-K3KC2gpVbf>}^L7s53Rt`kS#*OyqOH!c8W|0EPsPAD_)#^+|QhMo6Ohp;3OhzWFWq9I(onz+o>BI{a zT3ue!WT{bzvEvXxi5f{bo31f%M<=EcV3j43!a(Z+lSbunkNAqX!uHAza>u`4+g;z)Ni>#ApViI}6=D5)g;m5fUHHab)rk0&?1t*t zuy4r!(E9C&S`7-jJ?aw9bn|1!B$Ut@F)9mE`1##-dr|Jl`P{r^(X%mk%zx~SUL$md zRRDB&O%!&>2ae{~Cq%^QL?l!Gh1qgS2-D-_gw`klp|QsHW%gx+8%B&Ln-EpB?}QR> z9271}qimd1xU9q(cgtIW`_5nD0jIbi&N@L-nM1;`He({8+ve$h@*%Hxa`dFg%-B%@I2nKR z!x_NoJ6>xp>@*i$X(j|rtcGkGj2g(`=6!ZW5bMJC$AJeVA9$5) zz#LA=KmC)fz%AbpzJ+{RH9Qt)={6Mk!krUH>F-*OqAxO1@Ohw?D?2+Ye?Hj#FV8@{ zJn00d7czM*gS#twrsyj`$ry_QC0+#c|0Ef5Orow{`)74Ml9kjA5$E+W%lENQb`{(1 zI1r~zBay_X1kbf9mMyI(Dbhox{!C%n5*=sSDLESL5DRMbs+t&tGz*p>kXY2FfcFX| z!A1%T$q}eIOmZqzLi3byPEJG_>1E`48IwopmxS6SRNdl+C|CdpA@D(t1J8qTCRTvh zT!2D$s2f0fVJCs*)gAENQ~m7>d0KcK(gG>=J6}?98Sc zzNxqV_C#26ko;mS#wsxq>MQG~$@u&fQrG&Bo2@mF#C*wvhQBd0FnbmzicCx7ns}$^ z(O~SXnVZ=u_cNTv_}i-J;iB|>I8@qJ5y_wAil!C!&C_eEb62b6oeN}S(u8-^`6ke7 zeCHmx0k?5kr`W5)u+EE69F{{&Jv324f$PQ%1;6>q_eE&uqa_k%^0fz$Fw{A)ptTLK zO2pCWZ|hI+JFe|vXnfSOlfNNLr9)wAYHgdJh(wWe1Uc}Y^d4jX61PLxNg3S<3kr2= z4aQ8|*ERYmOu5>^+oz1E7i4(~rjYH!z-|;HOC`aD(7~Mxq;I0h02D+;Z~Ar=tys>P1mOeB{tDyZp^z6Np?1C2t5M&5DzlRBe%vRedW zNYnw=3Uv<$ue2u5BodxoX_%edPYH6X3wrcEC!qR7dkGn=CX)uc3Lo$>PEx&IP><5=P!2PJg*8=C6#(oKL`=hD1RJ_ zQxinvctzwl)l>x(s&wnYsfvy3nRIC!sTl72Jf2Ka0lXj-W-!epLD@JxF-HLvfXbN= zRQhD*jUkP*-NyN?v$$n5R=XDoS!ELbAaV~~&*>&c4u}|N@eXDlh@yNemH{Oby1jRq=-!;HL){;McDkAxuiJ@fnsr875ChKsOe!pz8k9%5V& zUFv!lqLD9^HkG?4ctT|eIP4UbQZF6d>j7sMq z$2B2Is8`^xQA#}VGq`;zHm)#vDI&T_UqX;X1>VG`6)m+e1rS~ZPTsF)8i?~8H*S!a z%l!nk0tyW!hD#Hjk|dyFvRiho{8L!B*Hx4OE{dQ@kVnOxM;&1T zE{($pNFtCB!lHpfle&}lIh<`dvAJfs8huF_7-9vYl%V)0=fR(?-RQL`%8-8xh{2ir zU|t+?Uu&W|f*1q#YlEACS>LIzjh|Q;SBXkxP_? z;?fFW(DM=XKy!rA3M7VH;jGmL=~c4+6jjao76&uCH@^%Ih|hD%1Q3e42H|~2BOIMN zhxDGuT_l;GcRdzHC`bdyTkcKdYUa^PJI*v4B&ay3q@QV6z_Z=8gN>D^j~=h6)X1Zn z*gZ;uIvGatk)^M=lN_+M+?_|+7Rcaq(yGNo^Bm3Hx$c9gj#kyDgYVpv7RSU! zhgJoMaGTsNAP%cFpY=u}D9BYnuRNZ7YBZKFO-OV>0UiM%s<=$xFi%;z1C5`ekI;fhGwsFXeoB*o=~+?e+<;Rf7vc1Z zA}}>53sMDU6^!Mzprqg!0WvzgC4o&~C$c6NpMjoIOE~*egEo$OR%ffCQ*o?VfOjmv zs*)<@Er3Lz;N{fqL`jUqgm_~mp(JdBZ=CF@TWif`8g+?47B2(TW&H{1%HGbO`Oo7m zr**j8e}OWSA~^e~53HNDr_nnIK|<*L{KKx->#3j)2Jg^28ah9h?~BoiZk?*6N~`Ax zM%0_*Qmi144Be%IQ)S;s;ViXIR?DlFwzTqr{H^!g!T{=FvGCj4y*?|VR#FOQ zTDMUz+dCc=@6+=PP-OqorzQ&mp9+VhfKVe6@_@(ugnGOsH$%baZ~uZI;Q5pF&6SOfKg+MMRPf2xj#w)2t9~L@ z3cexnz(1=i$Ry$~&X6%jc9||spfYCS)zc`K$P^dhhhxA3hvmQ7{#8o!M zfH)fGqkI@rE%(a?u zYP$@Rki8Ft-8hN*uYoMPkONM-jBNSQE3}{w&g>J3aiL2AJk}~Sy9Ng*bX&p5ymy?f zV9Jhyy|eF%5#FqU;`XoPon!=eVxG|4EcJ&Ozp6D77ABBq@lq44(3_eL>tnboAaW-u zQdFrUilC^ow%Rq>@>I5?j zG8C~G_<|nwJvpmW=$}khgE+&p)T9COp|;O#kQ`R@ua>hgG%S|(2tUJg2=UFLj!#+> z#>3ssk(FR@-;@(!gV7-ldnLFexr4@1ey)r#?@9u z*F8{ACzcD2`oKSLC9)uA2!Kuo3!$|N1pRM?M0%reO@>+pIs$DYg2Bo!kA=v4BXcCK zhRJZD>0$MY6m=|Ls4wB#Kdw`u>ORypLxL&Wh*3C~3vE_t*+NtNGur4AD>60d&HxszZ zyoHri0HTC4Zx!vn-?QkbRC|G2$Bs(gS9(q&q|2oWi5SS=+n&bSwMWQsVEim=PRewM zQ$8=C9vuc^h=G~c=>q+7oIPSeX@RhQO5U7*s%J&c$fn5_CiKVOs?Wo${B(GD+se2; zX)TZiOxdSuo8bt=Q;7Cot!t26QF>p@d}RU0l!rDTcmf=K^?B|m2)D1{>O3phU8%Z{^yn^BASje5 z-#zH-wF2Sq%J+h(GhODc2O9%)PPA-nW37*?A8;0B?DB=|;PA#Y=O1l71qSA2oM*hZ z9Gw6S^=9nV)l~>aciwi7`QMi><-f-&_+YmANFYH0AjNx;qt|my-qnlsxx)EOr5f~6 z5dYcUlUx6n++#er7&SN@Ts$N!}Qh;vXm*MfwUL@#szpELrq05VPk35cZz zI`>fS@J_-5{K|ldk=kH{&aGJQ1&ziQMj|xjHyW4C*XyW>v=eXKLP4P)gc{F|M_ zk(|KF8JDNO;rlkPk=&6vRN!+t8W>YR4WgoK;x}mwF`W6j5t@{)Ovf-GN)9gaqaor^ zql3s$hgD^g^`&AcuTd!dpwc+6jac|bUbg4aI}=h-!=>~!pZOO4<9qcVi>TZ9=9`;0 z+w-CsY!1Wf#Ypwq?ONhr0Wv$p`6E0AeNTPQ#Y*3upPgcbW+dgqtxx=O%5 zLoxnIz=QqBm*nSF1H-6{y|z8#Ehh~Ded7gweZfc<1Ae8*JZ~UJjrrybmHCzQ%3-R4 zsB?C9@(!n@)!scj;T^y0K$(Wzg9mqf;)oCp1fih4qwbSI2n_EIpTRrHB1S4lnpMMj z8!0?Aqal<=4Iqn?wo1T*^)yh?HMv zPstM3<2JH8Sqnz;R@5BZ$;c_7>(GzmG9*%O3O>wDxhmoNy{8)pxMM7Zl#dY;45kog zUQR>=sUBmpiQDFQV4)zE&8DIa$c&G~_A`xxtCNsGoNoqSLqtMY08yBPt^%kzQFNs~ zN$uXylx_YShp+%BbF-ptkZ@d^)jbv8YJ1e|qg*vi)j~Oa3K8J^s!Fh|T_T8N5D9lb z+V_+@tIN#N!~H~`XNgeug6QH_SAr@*Qrx^mlXm_fd|SoGEVYdtmOnBWqYzoV^so_k z$ClU@B;elb|306D8??4hs2~p~Nsqo{DX@Y+v6#3ykn1&fEiYn>jCd^~-;OGzP!>)g z!30rH3WiAH2JS6^qDti@2-z(am>TW*j)-#KKsw^(-zK zN%Uf1K@@>4b+@3@8wi9j?@`EsXZk5CLhoLj%WYOLP5tN+H3fbPT0+-f_47rfV85nrmi~4woAha^VLI&tV5dcZrK9|Np6cMo>gpm?n8 zY5FH_97AQkUA|g>y1lXX6y;WT9WXOgUq*-ip4HTK`d&5|xw za*{R17q3Ecvc}!wk&7b!>o{@^xG@>IKw4zM#&@{cOgI8h z4iB88&fXkBU4X`xK()1Dp=OWTAJ|bMTPMfZ8fWGlHc}b9JdRlHKhu9y<+(mxG@(bt=JLYi6lk34NZ?qW)Z#7X&k9bw;c&vMP@!C*05c>|s{O`~fvfSSc2l?8mI)-bc_ zM1cUA*za8jj>SgkzqImektt*?R}v}aG7>W9;(3B)W-w?#tWamQ^ZnkX6T^G2iHK8# z`|MsE!c{sPoDVl~t2b(?0|Kr;y@>3m?mOQ8Er{&o=hf59k1sS`%*3 z`#PFfg?=mXGwty>T_ypmv42nF_>xCE-QnQm=Q?_me5$Rt&KME+=%ROWRM+a7C`cBa zw0%uMH@9!xn0xr@w9`A8o4av4@vKaXVddz=m@p-P3-Czk?{rk^5FsO@Mj54X%$ohd z!71-&JD_sII{Wy^+pPU4CxF&~gVpa>a2OsVw|8S>S32mvk+u@2a`?J~ZjKHPalzft z^_Gh+P`<;GVp2kKCQFQ7&ovR-@UnLVu?mx{BbTGs-GUYdmx{zf@~w|BYK#UAKHy-Y z&rxV`({9ML%P~k-psh7zx-Npqk}E&x>bA)nv6uixF9^1Buz6iXdGxR0Xl za~aLlihTijY7qgRxhxc^6!BV$Mf!zQ*H0gcG#A(pa;wH-@ud+Jm*>pgxUzg{?BMvd@`iD@{1hi!>3fUVFpl}p=pChY zkPluvYmLGv1}b@hKq8XdL6fU#5Y&51cs5et;x;Lq85o{_QpFP<8(<5tY2FF)GJwOC~ty+_-Lk(F}iMk zTC=_&4ADCvWtJ{FjCvEZM5Tetd)4}9d`e$IkYym>!YmZRt+BWRcYAe? zoH0_kI13v+ZK-x(A1N+lxJK|~253uwl()ItO2=7sYO^72A_4}@ij2mAXzg>0)tM3* zh?1sq5XT@>j{8+?nnAIbxK>dc zAuq5w8d7qQ-N;ReQU6O0RHC1twXFqVXx;PC3a)sU#lU`H9mm0Qw5uwmRz;2CUxnm= zt{0aqQ}d4fE0Y}yfMH|+!igu`6Xqf69q8lD18 z?KIVAgi`paz-t;@Ek*NAIx2}T(uMbO+ZwS;@~7^I33YaZsU1ZhHgunX=k}Bl1D9Ohz3Y+RHii`^ z>do#oT`Se&1?j*(~NEEwh#a-HPxM|U{MzJV7C=AxM62)@7c~Kf79L4 z$YSNM`4EOX)_={eC2(b=v3;+Hxq>EEMl;@nK;%i?`$9jJqJmTyS5TLWk%h4PBncH_ z0CMBIN(rX#5!N&*^Q#PxbxI@pJ~RJ_n03ID(xJa9sq_aHm|w)5R8HeAM$4>hPE41- znX^5v$IKYHLZp^#=Cs2s*@u3Va`BS)cR#us7%YAf#6HOs?hX?Ka?kcz$Q6LeNW@Im zLeSXEiWMXv^?8GlA^x6n3bw$k`4gvik?UZ`dFZXsfesO zgIgn?dYwtWe$uk`eCEKVip`qaF~iK-E9d8(cbfwSBwjMzG1##_O)&WCUd3uF6lUgB z>e$N?_E&>B^@eo;hU~ZBi6r0iT3jOQ{f4*`8b?w!T>y_t7q7brr+E5ocaLt>P8@*I zVYXvK)YU`Ivp$f#-M8dD&{G+tb$7AZX)dffqSC%^E5WAEIo81W{^g97GDa zhIp}|rP>R35|bZYr`0541j0l_yQYT(vNhCZC`*AqOeaUgBzNis3Eg*LE(jGy)*WJ@ zy;kDbK+sY3JfHV|hU+HWCVE_LnKDyqA2m!Uq?nBby>bpI{6mH<_gM+Y2RlZ^AOCFR z;7BRo?x`q6`&M@tyd!ka6?+9fJdSq?RIE}PL}mnK&I$rvW@e=@#4rQd3dww zV;Tt737@MnA)6f4<{AFfJ3~n{AscHan&yE$2Lu#+7$n`TNatW6ZJHQVo5|*SOLD|= zk2?@Gl#CDgVNQq>bSsE$H47kOlvKBLG5ji8P>c-TQwbH%;6IoLag+Y`i_Wtcka{ScY?S)>EjKpA56ldie}g^T7a(nDE$9&N)slv+U+Ct#DSkL<5WJ0_30 z-Iu^#(?Q>(=nDtp_%)DAx$7I4P8MFzOyMTG@vW&gi6v zx;eGuSkDOAL0LJgnQU|<&7TvK^Hy`e$p!iF`q_t(7~}Zpm&bW7<2c6jk9Lj==XCG9 zcPa-*ico#>d>k3di+(tlz&+SqiM=PipMu%owgyK*#(QYO-{7KmJ)`U6haLX@?xQ5 z#$Fzbg~=dJLVIM^xu<--xzJPZ;r6{ystg+Er$i+~V5_o8z0QD%^kagq;Y zJ)svJH2Fftf%vG1B_?v(=#p=y>_x0vka;BH$j{%yoYppdSLu)8J$@qmBN^UzHFCnM zlbn-}a0#E2u_-rK`X~;WbYSC)935>L&u%0ihiX8q8pVxGdXaJ1#Fus!$8F_1x2Era z=asq2yWsB~vnS=b!Bfnd#1gz`6+J5xa1#Y6;qYRp7-Ae*r{x~%6U7yZq982xA#+n9 zi%MX$pXIrT-LtYnH@KxALOH1!k}boKR5L!WaPnI#@Ttzr3#5s_$Jbu({|sg0NMl%e z?b}-a=e4(oUCCLfXfL9Od>R*D-t`YK%3*@LXWhfzaSsVx;*rdJ!xI{X+Des`2zrUr z@LD{I*}OvU@|!m{=`?oVogNSR?|?X`XM;Y@Roj8zQcLV_5Xv#R7p9pz)1=sG7(^$M zqClqXx12fa;#wS?G-XB!4I(LeaaOFDogkG4J7%8nWkp3*(rot`*ME0W|Gn4lt08ky zT4fj%kfAmA?YG}HcUM?zr0J*y`-=Z#_fnk6w1plfUgf zO)c8}TyZLb%&mX9^YxuOh#KE-icj}|KHsCkp)Yn?O)$uPw8G?i11RY4;-r#m%P;tK z_;j5-JGC)0mCjx3OZb3oKyocPQ)U2_yER85XjHx_T1#Do)v+0F$4Tf&CCrTypFVLT z!$2r+Rxvg|lvX>ob21#zI&^jdoe}0DiAr!7+<=&M$*Qpkzw!33^H#2-v>cse@F)2J zblZ8bFTGxyvPK(J=HQ35o!#}V&4cyFjc*%r$YjI(hojf$gE!&{7|Z-x%`cO4`DH@~ zMaEQLOVMNb-G1lgiKV-f#Qn?C*Eg|tv5cFePDaL)vH2oZ=fC2dG7vL4{{rfmOu%2M z@w?&OWX)g&7YM}~RBHStH_%|wM1z)6tm&5;0^pxXzlnVwAI!m7RH{Rp;A-=^77od~ zifxam1h@J4;QO_mwZ~hldAX?&N$j`_Wa$ zuOeM4wo3vOb+>5QP}#+LziR`al4CQEf7b?(d*2qMoKhQbAqKMu@f8nGK=4Oe^l`d~ z!(T>npBSRJxm68QRI-uBDVC*qRJ^6+ts?#1#$u!W<-PWo*C5I}ksWgUoQdWX+i9Eb zoHs>u|1_d{E~x(=OsUafG5?v##2qB)X@V(#Wim8#@89@5R7lOEH(fYXBWbyTi-I(G z$K-3smg;~1U6PI>+oq7DgNGw_ZRA)Z1m8P3eh;KI{bI7OW3ns7$5BxvHo?q7udgYP zmSu_0VL7YFoIMcq)VVMk>k;U2Vw7OjR2_GlOWsi-K5uiDa3*iZpH)29sqKgPh5%Yn z$4ER!>RoF6R@zXwW4tG-r^Svz@TkU*{T}AKw!6N2@Mvdcb3dHSHVJC=V4OQixOp` z4CeaA(=FB=V~vuRNDQVW1r+T9SI|bG3x~e`nWzw!m*-qu;6hASC67Nt+**IMyc`-Z zu`%4{BbE%cuHg17R{8QbIQof6;kD!&0LA9Vmk?J9a|9U)Xc!yo8Idetjb7{Jm$De| zB7s1tDPpiTY8)QLN}E0&4rPbRm7L6LvVV8+-g5@v*>!DWd?eP!sb!1zL?IjF&-mv% ze{}u~or*XznusSnA2l!S%RoFp8KASORDJ_BH_eP_6~qfWST)4Y7##?-RC~qvt>I2V!PVj95Fy=~2=n^JIH1!!O#@hhYAzJrG$E_yF*xuj|>J?SV04M6= z@R-GkYWx%KEJKqKie5L562lGCsmckMl^)q~b;yJ>!YA@zd?IpV8KpTSmXA~X+;K#K z|9_gyc{w{{;$W2Mm}IEsJ|A{YMuns}A8Hcp*ei15)8hd|GX|gx-iS<74nV2vWbI z1q!w0mtk+%ma^i^xUeTcbY|| z`sX-W_(_uG5K0Fv-C-=^c?KFOI)?jP)`{u_TUrd{c;F)NHAx!>3D}nyk04z^tD=lQ zM7%;To?x*}X3dzF%?2pu&h5?x+vib}rjlnVgLiLz_=Ony`Mm0R^ z(x`9-j}wg^ND*4XwWO|nAJy+0QsAl48zS~;*uCYKwFv&sP+_?~`~|HnFBWluIAX)P z(8l1>dNDe`=)Nf0B-~}EKX=X#jxJ8mT2bWIV&mz-_B#IiXXNhf?rrg}*c%*2a=IGT zoTa2MVKF#TcfoMz>6Hw`sAtM`;nV0F4#AgN5Bd-afLbs7$46?ypjs6Vf0mQz69O)?dGhQm@@LVcOtF7f)h67VOc!>)1qk~>wRwkQ-BF&$99>AAm*#LXATr8VN zglX;chCjW7(-aK0(|?`O7frgj*hzhCEV^HI)+e-+*l~~ z{A$eX-D?Y)72+B4QLWgYpHe=d-cS}B+XQ)PYz6t}IM`ya?6yQcy`r)6qTl=51?i{u zc?43+{Q*gn-VgMBjY?;mX=PZA=EPJ^yAi*wzb(U-AYst^9tGJAB`2YW}Z? zH7Ed1c`q*RceH8P2a68QdYOoStxEDosU28hHrnG+@A$Yim+q2pZ`~uhe7GQ|XpVqTG((d;{cD+|3NHh$H3 z5-bs;^U**a2cSCiY4`dE0+!Z%)(+Bp-F#7U4NKBs!@6&5P5Ttd^S(Vs*~I-Jz@?yW z-fBF;G)4EQor{g*4`FeuCkPnWd53wOvuYgmyqSLhUU2=<#d$vgsek=V<0GI}gF^60 z3l5p3IY(~4faBiD$w7wVwn_*2Z{~i&T|2SyD8+k@WaCU&dU4nZZE9vQp_ObUxy;p7 zZW6vG+y!9HO!!m%7>E;`Q@E!>-THfHv{ttifS6_Eg)RYbj_MJcmhY`lV*?#n+6zl1t6 z96@)Xg1}V`Uj7yJIPz6JXtc@7f^^WJ+UYCV$K<#AC+`vr!-ku34`{#c06m}=opvC=zv%&I zpgaXFiAoaD6HKPE)F0d>I>Lc4Qs3x5)ZW}dN+wmAe5m1C^)O*j95G?%F_RKK$%kNq z7UPTa5&lKUpxmnfF+Aor72bq{GnPF)IUk(rAjS|u66VpX%_i%eMw~!|^U*t)DxMh? z=I^xNT3^bg>U!VT&w;Mu2_=PUEl`YfR0$HHbL*MS4)44RH>}bzb~0Rz3Fwk#yNTOf z5_qDpj0@EPsA;J>?TX*3un?KAlRF1;!+vzp01i=X(x=P;aM+zP(rs###$*a}L%Y3>+RcquA zu{}fxmI-vO0hSPsi+d(gi~P=U-0Co){9+c5+q~r^ULlB2yA7g)&NcdEmSPUDf+K+% zScZ*kL?-d1YB+wP$E5|83l8xEYB6?4I40fAeLJy2FuO z9I3sq11I|n5WkUjV6=Qu7-F7Fm^g-AIyrs}cf;^M*pgYw;=C&r0i^PrI2!hwWb^WC zlMrq`&tpOJt(+>dGdFACcJ(_Vs&F> zcbE6|tZ(kE?L0xgKqTkF>QnXHZJ&>IEnGP=!!6H1@GZ zHibO})_f{|ST$T`0j)fZd{}rU$2vkkkkW^Ohg_s$Bpy*3S zYTTDAv_YoYns+-P`wrz<3)bpgtlXVMlM)M;2!_Yd$ON}W14FCWn8nv>g4YjIlQdt7 zU>d6sZXURt9IsWlpT%_btp8Jg@TT8@ZCVUcbZEnKEsSuu)l4nCX@q&99nE`ebpg2mUuW>Z0h#V&hA=SXAUzo4ElS_Vx$@ zk)LBUup4eoc!>NNmw|_F8P`4?M7WJ1M z1Ne1%Fp=}X&`Z3sx4ued^JIN@MnjODa0}@ptJglC&0UVGzZA_GC3F|Se5D6KoY~JOARA(4 z1o51QmR2{zq*S6Qt*R`C`C0pHb__cVES@Aru|N<4S4N_lXnL3+3AgEc#;NxGywET9 z+$sFx2$OPbxl43@dzz30Xg4K*&uy zL1E2g!{__zLWS(`z|PrWtl-vt53(Zjl1)_`im*WOo7r5ly-&a>w};Eh;hSPeHG$Q18JR zG)9BImf&!NeBp3gR594!!#M_L-& z1t4M1U!DvOe=0_gJB3zMODM268czlT@2iR6u!MK|f439x@bmZ39Mc%{X|;@7|EyH5 zs+LTpPdV(TE+iXWr#JaQuB^)Bx=An{IuQ{J#H2(=`8m7TG#VX9p>N#PUf;z|(StPB z7M*-xy2~zcMZAn`OIixTT>NqkiCXp|CLcYr-b&PVG*!?JH#H*`JShAzOOSUDAL9zR zbV4{D$`Tqpq|3`r9caxp|6Oetv~IYc)?aS7Z?tbL*x&s3D{?(oumC#6t6sm_?7?#7 z8Jo6u+OKc49xS8J*Ebd(pet4zRo!E7F=Arg@r6W|5_H8bS`WUEUfMTq%dEbFmzdF` zC*&`ZtkH?*hvQo5X5nV#Q7fBSdv^ho(_<{Riqjc3ZhHUzmUgxIyYu((uWe2oL|ERM z1OsN;n978gZamL(%I;^}_u35u z63o}*X1@3T{`R7FlRgK##j#N@L6G$-EYg2tztn%R*Ws07NJwW6Q{}Ty$lI@rjqi44 z^6>e8YGxh)K4dIJ%G;6c^$MwHXF%%F05Us@Dm74NbeD>x%tz!pGGr6$ z;3be`O&r@94_LAkfD@gVfy@mFc#{V77x0(RcbI~k8v>gi@i4Qp$DE&*x~4^DD++D# z-b?|h`12fIfd~<5GTnHgp=sT6onHKQ#P)s#0uI_^G~QI90QxCgaO*w{fW0GyEq5T{ zR?EvMoq#*S9(DH|#cj=pSqk{27Z8%PTanS7Nlh!cuAE1GVDHc*^yJzD@Zr*6wa59! zjtOC_$28V(Ye)AyhIst(getFG;79SxOtx~d5nvA@O{Fn?H0%PgHI(UWKr5eqBmko5 z$kVK9Aztan@=hgw;v3EsZ0)Ww|KU|JxD5oq;qFOkD?vSYAjknAMA*-#x9)4DFfB|2 z0~1Mj?Ls{`KkGuJG#ut7iN3m8hCs{mYL}IqOWj-9$m<8$Z%4QkLF{vcsg&haoTy;! z`-Q_(asfK4b0nb+8~{aWrONsLUJ zgIx&A=f@`(gNvaW9zm?f-ClQ@kQP#zs-PG^J2@_8r+bQwz9C{#L>OjXsfz`1nWYbr zIr^e8!rWEZKf+};%~1o6<)3?qf2I4*86%f{0b(;t923VJ9u*- zD-_>2C5Gp2wzbEjb?uY)5O-Ys(Pd!03{C0p4&YkOC|iM`2(D$p&%&j4q}PY;*c*X+ zUK$e!bY>6z7{w|?3=0D$@ztg8RgPuRFHR781nuDr z>|Kf-h_x-F)Grh2u3nEObqqr^FS`na`FBp7dVp!GXGB)y9xD8CF6DyN?vV?j3Lb5z zzxR(o3DR%O)r>SB`3C9Dv3xuGvfwPn>xOE3q=iW+2BJWD>lEM;3#B1CDsLt$y?$R(94`9&N1E zkG_45l)dxOyGxC33zwx}Z9zCKkywpktAIdhaU?UXdm0~mf1p{(I<39f7*bS{Go%2s zTnj*&hg?o!)xqrgGOLU!Z@~pbm^7d82FH8jg-8c4{4K*r!J5g6AtFIQK5A(# zkOih8VP!)IX-MftsV*;#;u9?$f=YxgMrTDGL+Y&GZ_;R4Nl215m4u|)Y^o}A#e!7Y zgoqh9xXPBFawaNUrOYn^?h6%sBP+BAap!P!ff_DDB(8N3WrD=NUkuKQoir;H3=7bt z3M5d_Jr0lp$#b+tNR}jj2|*zx%3gw;X_%A$K#!Er=S|r1YSV2pI;-uGG3$t!oyn9$ zBI?6vB%`fL0l_@iW?Yg^$+CRN)1=R7A^c!}ryPrwp>8^eHlfgqVBmlSx>u)@%Yv&DIIsk%-8= zXfxH7C6#gO3b+=!6@>4czY;kK6F(lvyhT8O?RzDDgL{jWvLGS=LP)>Rom_^d1$|3z zaj}FH$VfaRvJ!z&upSRBW>6@8Q#}B|4o(6?;o^>%>NV^`3UalYx79krpp4By^T=f$fPa8$z>-4s4aWeV5F`VQy^Qcj;4mAu zz+ieksFKh5b0JHGL|3pw;+QZU1P_T6nH+L}mSz&?RTBUb+R`SZ%Hs)IPn|0-1WGwY zDmiA7LPFKt)uAhn1g+Nu>&xLDm+(JE zlJ?VB2%U(`ytBUfC+v@`45c$X470TWq_lC0ssIT-!BaPSN<^jR7=a?x)Cg|UPTo|U zyErsEDHE!knmS%Yq3{q@)@sY~S5U03r>xjP=rj}XRcWBQfJDs=XP2_Ys!ggE1t(yC z7}F(Dxo&5~PLaqzUr9 zk^j4f7-h0um!XOqo~Vv$4NQ8|qoPK}X((N^C?Sz((`WV79ntrGQE`g1VvK_`rTs6@fboWxrDWHO@_@(1MP%n#1kttBxXq$}SmiN6*YFzO_ zm9b*sB{GsI|Hts%>C3^%uK59mhWt%cbTsrR3?vj!LWkrx=Q@D)0}1<;@HkU=sNg{7 z+5ONSGNgQdVd3V@_E1zFylU^>#%?Pg;#q4_^10MtXej+bokF*wQ9au|a@$SfHgJgUS74tK1;C8N*Dk0rcF3FK(t0*i4I13?J) zPS&+Fkn(qx4RZ2;EBOhg!$_RaTw0Q+IXn#WA)NP{>L@NZYkvLlLsHsugH)E{gboK8P$;lIi$xI?F`}L&rA?W+jOu2Y zLqwNU4}LM%%2X*T=Z8XimP4rjsc@I-j!JegC=7Rg>}iYgWI+TqsrVEXK`j^6>@uuG zgw7V^cBNKzjzn&LfKFl$p0sf|MCcx1b$k{UwrbF zCg0Gk#MtyhTmVkj8=NB@i*V07k&bFoJ~Y#(GRn9neAnJ7HsP!NMtk&J(|z>Ug$KoN z7jBfFe<*(au)SH$-&sKHU-t7=LrO<_xG(~ESox|h0j6eIl_fnWtZ4zcdC^Zcx39Fm z{BW90*WuE&ebpF?CJ&aQ*TV-N+V7LU+sIu{W(Nekx7_F)qp1J*j+0hg-sb^u8NP+d z#7NIW02Mqs7L^8d8(%~(F1L)0b=|N<4G!^D1&<2Lsm;jgunj1 zhYYob%TSAbV$`?szfWHzEf1&+5lEHr#r)Ik@5=WRf+t1gs5FwNAse~2eAjxPqys{w z%%WVh3)CJzR}5H0|3$5Dzx9=kk4)it|Gx1MEq`i!)IT3~-%9nYq5K(*1cHeKAKZp;sW7TfcOgQQ3oH05 z(Esh{6N5DC|13ZT!crnW*iCv!*8K{k=i&RCAKu?YF73kwM^W5He&`)B>`pFf!7mmC z_<@`LK`Y687!3|Tj4qHn*z24u3?D!r`S|?C0($*;bK$EVG9_WwWMTgx;5nJmJU*1@ zfQ^`=7KJwd&OI6yML;&i5?@6kfAjsrG>Xd_-hGZcr#@00@UEZW z$mnWi=rvni?oArN zi|TTO;5P4rBWSv2Qfm=aoAjM3AIZC7=z7K|zV9MlihZ1SzX0tgvv9+V$qGgGEAvYm z4-YSfBh=^GLnTGF_O%y5iW-d_u_3c>DDkH+A#YM^dEM#1LcKBhT5LL5(yGN0SJPF6 zFUc)OL0v1c;O#;|y<7LJ4LngJE!XAg+%Iv};gq4JBN_x#vpz_zuLc1^)A_fD!FB)&?eyF6bPZ?PS`cu zDuo{*mR30v{u}$H@`b?R_e_1>s&P%$Uu2NR zH-0=D^-jo@t0ZKP-o#1PiC-q?eHZzXpmbWhQoNp1(GC$*o#O3Mby2_xl*8%R6O7B+ zoDTF4n)2&%+}WHJ{rTpgbM#kO2k4@dqlo}Mny?R8udaMCa$4a^!_>w7?*@^);x@DG zS#3%u%hBlKJ?Nagf?;#?`qTzHd)>L#VQ`&B?KlXUnYd&jx0Rgz%o;QGqAxQW+^*Nf z_Q0}#Nz(s|oA)Qz`*$Rs_$vex+DXVDup0a0F6zrR8EgcSG7NR+$aBCQCWd9a!9>hP zmBRVay=X*1bRcjq+=<55(~6z-7%Bs8(T;HNJdEqA>&D`KRp zdI76@mM$61T286h9Xa{<)Q(w8)Tpu~@?IGDe*=a$h>K9Hi9E)JUBGhH`VmPUu`V81 zyk+QwCn7V!tvLJ^8Ol9v@^LFc@mWfB) z+tN*DBemb$Y_}F#OE(tUl9J@DwRVYl?3LnlAwt(V&(J+Gora4DzH339dXBg}`2Mim-YDaR%k565v*rL@dba^6^p^TsX)C6>f#Sm6hP!uzRD>(p-9S$PmQZF(^@7sM=@G zE{3n&xQmUYrKNct0g%KM$Bjwq2bwb~Ef*WN?k+aAch>%Nu)DpnjvElx zHrAgWtgdYDJ=n%RQ=RX87H zt0f*dP&EaI=5YK2n3gN1gJ~V`KXlGlyg_AkaE{X7qe*Hnn8X#Mpk8QMHdarDha0Ca z@nP$22(LRoyBf^=tk3*nx#GGDFS$$;0f2C+mja`LR@vY{C=v+;lKyEZtMdDIjeE$- zhJW~ywEb@Kyv{_OvGZO z=e>cV=L!*}TxyP@B?uLpe!!3mlr>zYd#n9g(lU?(k1rsaKs5aD?fzfxKL=6cSHlnO z8w+F~QtAJX^Iy;3oBwCV1{K`$5^YWhB(q^IMB(G=64ZEad@*N+sAlTZWID> zevLs)yBDXYopbekltV{jL*e-KgSO%)r!3G80thBo#kAV@IxqA1AqIdHv{{c7YHddorHP(*Hmso!6>RY3LOq6>z-=9W=gn zJU&6CZ2BalEdJLS8^xdw|CR9n}xC2)adDlP5Gs8L`td`i0V{5t zr6&I8bUNg08c_jPfL%$&Q7cw@^H?rY})W5V^1O5`N zmNJvn-ow9#NSLItgU^mn2AvUqfe0@DfY;kQk{CW4y!GLCY{}OIr{(dw-{s~|Cmdp`D8dwdaYLI9tR{!k?)j^33$_OLC(=8s z8n|4NL$d2=j=NVi+5i1{`N|nQizXiVV2JQYAvyw*Y|%4HG<3+A+DH49zc7y_ff*GE zQVKP(bACj}sNA~~g<;R&AJw{ZA9lgO`md1J>)ehMa9m+=$WVLx&(#%4w;CC0NOMBc zfrixR{eBkN{Ag=yL)1{Ti~D-I{$JM~YhQG0I=Bh4+6e^Tq!sg%41vwoW{Ml1=$CAM#8}o{sndHr-s}=k!{eLW`=@axG2F%Jna)t zfvnKgQeZ5R69Ai>zlQp}>ApnlLl-fAmkw;Xdv^@KnNiKhwM?D!!`IMYQ@-PPVIrhu zE0Z9_$mJ@T#(B3m<2!}O5rY(C6}p$5MyP$F#hZWc2YeT zxEy0{ObPSk%jQ#HH3OPnc1Lfz$Srg|r59Mrg|a;U;2pTWItv*pi!htC+?PN21c3judc2J{9bcNNMPB*erh%+P&d{k~!Q+iAZX}Hc7(~ zOL`4=Yc;`wD5JUcdsU+2XeL%Iq(M$wJO+m5*po*XLILcLj-d-=Ls2qh$oH3j7=Bq8 z7hVRwo^xswCvaEnZ|dKW@P`(11W>Zq@&XnbsA#L+6lYL!{ujukH*TxrWY!7G><;Dd zFj(E=$;)@peMDkl(E?cnIhM>>93(dJsGN{&?7o@u3YTqI_l z-+j0KYcY|^Oy3UHYU@jsCi_yN4YKPZFq3;( zfziDK->LK(cdEsISNiW@yZHvOMyRTc|GejaTD)e4G64`eDvHnbiXV*SLHzIWc~fkwXyEePOHU^yyTEWImtW!wM=+|R4tIp<{O zXD2;0?VF=Br21i9E4j|eKj;lw}`TG?3t)8@g(+7pUB&6Do&h_TuDiC_P)wzId6a?$+c zXWVPo0}F7U*(udvZEc!9gWZ?5fenN{WUry3zv|!sy+lMN*u*lI#~N z5%KS0UrZjTh5;2q=@H+F4u(=GPS3!j&aIAlb3se&;9(0snwa2~4|9^gpx z_II|*YZ@i%H6CzqAvUvoprhXL@r0H5Ide~4d$6GKE0Lk;!X^@MyMt8JY(3ciR@vEo zL~u6V-~0HXJwoUvPl!m4UpPCY4G|5j5*9Vzq1J3>XZY@Zb14faukIle=#Znt7O%05 z_fguLnJn%Ru$$BQrw{F=_g{a+-Aa;eguE9_i}6CmnWa#zo7}zH*=6n13EsmDnfLTy z>=d#+cNw6A4OEr8{N0nXn}cz@|;d%@3jp7%py_p#l)w2B?@ z$^G^ZNE_l-yYmxDzW)WmU|!5=!(ES-m2KtDb0hIByIX1^GH0oui0qIekeC!i(NY*gPdh zjHf@He&hSSy=|BUhj1{$<48VoL1WlaH*VNyxN>gV4Dfz=5s%xD$Q!==CvdZ4l&0xp zj{NB~WM*B=8@~-1;Q`a5|3<I)PO+E<_&dW!C6M3~x&0 zRU|N;Z?~pL5hW8^QkY;XxWWv9svHg|v>lhoqsW0D2fkbPf-@{*ji1JoS`9v#(c>0u z#;T!RyT=S7fxqOqRF97Z+T@ZxoI>iarf-DcRZmimV=c~_k;9?gY8b}eh^xvyXAKn7 zv+Yy4dC5(W3b)sQN&Mc@ydLS(xsDo!H0{%ooa&BD_FM@QcjJjbooE%UCK)iTBn;l- z?>K{SO@6l+ZN;WAEqk^xMzWy}nJDrR(+2Be@mS$IVc ztn03p0E_{U)1B6i|@}VqK-WAuWbeIMunPIljm{#z_n~0cGk92u)E2A*7hMaB! zxq@11+9b13uq%R)y0u~fk|iV$og>wx`J(;84v3UCl#`;fnN z>}oxyB zrYx&wml#>Y<^4eg4$Dyu7F2Q9LENaA2M;fhza}QW`5rJ|rXk{}O#)p31}EJ{iy@|F zRSP{=R@l0E6BFWxFA@Cl6EoXzuC2REugQh(DGdt4M+=kTbgx~+L6fbO9%^VVo*7AXhuiF6fH7MBML8_PiOJ9;w4Px5S8_q z?IQ%8CUaB?k~KD(bCy9uYqOfug%=Sk0VhKa{OWcczeU5)?Jasdnr}dO6pG(HdW@|= zCM44jT&Ds{MnC)&4g(AtgBE{sk_uaZZpOW1+v<)4lyhUrX<_f<0P>Ik(YeX@3VLdHJ6U4M`vN~fw7=~4Yu!<{&kkpy@5=-iFb1jSFDA-#rlDh;(e&D z+RZ@@uUmFuHinRu>BP&epN|b6!8V?to|r0o5dub*RUjRlE6|T-eU&9a-71nm%uLw; z2SK=q)3mqxC+|QUC60w+0imPr4Ef4TOrq?Q+ebaPTd8AsI{qXK;vR`GR~tWUQc6yq z;4`oS|BV7O`G}9QuLJ||5xsm^dfgPho^A^GY>FvlU)dDG)V)2$*%LS`7ci48FN2F; zvqtCSAIlP**l45qW$S}@Gm+z6w}Fv$rM#Ecz2oqJFlCPzIJRs;K78$0z{jTB+Ut1! z+TB=eHL`8Wz7TeO$VnTi*C&`EXw3V_N?8)T<4PeSLxU{N7y1XK%m)a|ffRE97avk< zTTOVP!TW`2$pNHxgP+pj8_S!-G_6tuITU+*Yo{Fudl)q$(%A`#FIFpmpi$MS>ysgEzC+M8F7+b5H#AH zbPrR(uyJ$Zhl*_rQ+%nMLJ&|ksJun_bcSwvwi7}A_HS~~18w@RMy~-(&kOyx0fp`; zBD!xMH0~(ENlP$G&hvA4XvJa>>~+@}&?UhHGi6S2U*eR7&B3FSPXDJ3Fq+{C?@iOx z$}w(3_44JW+fQRY%WQODt^tmd6A@sJsgwbK$<;Q#%xFn=fg+v_sY=YtKyCx*R-*V^ssda(n*UZ5239p?&1hUS z$0#V*%ia<6h24uoRI5O7A$5cc(gg_2iG6K>>Qmdwl7aEEr@wH*pJ1eLsMWp7Y{N_WZPI&}_!os9XB`YzP$2&u z(lda?8J|Jr-;HoMX-EN7@O3zardGeEj4}|od1NcVMSIJgyROfk09m6hKroHO@ zz=;SYwaD=Fa*TGr-Pf*A3Fm#gPfsQsvRZ*mT%o);gHN51(57kOn|A*riAOb$d~C1U zQPjD6P(K25>MSKd!~PXWS};3t9#-OGuq)fK_b`?BtKP;>BlT4I`eYZCn<+hF_2gn) zhPR*veK|kA1{%O2Ee{OYLi(n|IG|I&xIBAGa$(@KLS{eFlfBBvun(ke8~3=9e^Hz2 zXTn^uHJ`r)vMx=b*R)9GKKfVdJ+s%mV^{jqL_D5v?N+u zE0sHVnaR5~6|&*J!pA`j^sU4{LYYk52JSH>5V1r#lj-Zu(73pbZGx0YT)^kZj?d62 z%0jL)SYYr#3{xPnRFvt)3C39KS>9B-hi!(0S;1hR+E@F0C+#2`g21e*AQsAFyF(CL zO)%HM?Cr*Qte0Kgy3Z?gpOV~@oweq1H2}h2Iwu^%33wt~9wDye&}{udB(&ME)Sj9* z;DVc6Q_9zC4RhF)(=C$_nGKc%+45WW2gk=q;o4=%SsQLK;7DsfRV>0Ka2__Uph~US z8*jD<0cD{VgNr+J_6;>tkC$+ht}-bmTbstn7(i_GEo?WrNRF z9-&su%BpC6kplR`$`0S|?yVq(SAW}C-~1DQ+uS|aUE5ySS-~yMi*u`c%gcE7Y-3~P z(Z<@r-k-Or@G&Oe16gJn>_!#1C8%5vGe-^tR8GCAO+RrA6BbnHg}^g7yUtD!*>&V_ z5U1Ha0Wjq}O+F?(QH83_Dp%DD=(l^lEx_fQ;g2)JyGxu*ero$(&2po}u8!2cc)Xzy5 z*gHVuig(dQqJSQ&alvnT^70J2C~?V|UE=duF<3;Od+vDLdn>Cq-edzMr<%)7BLyN_ zluyb*t{|0w?{BWUT?fO;cInLZfmFs~=7s%Dd0gM`IyY*4Cn`PD4}`A&V>F#c5+c#QC1aq}VV^ z@R>5cBzmvLtwIgauxADw+c!pV@M;6xj9`y61onCvg_2i^Mts6MBx&SZur?K-^OY8$Ok_y2q@t`GSG+FBBRtiuSQ$ zMMO6at|W?*2HY^HS`|IyAjm+#6M5)Jqz;HDQGIEw2sKGt^Bs_@m-zofn)qpPb8Ynf zz4!ytoo2!Mc5QRMhUw9CCwMA2v+wJmUZ(n$@+AD%f#hzulD8_DdzTs-2@|YSz9`d39$B2a6~`)b=A_B5#_c1rb7jKv zGz2bC-D6HyO+NGFJ9I02RJp5^Zk7sSpVL?4kQ^CQp)Olo0r6TcMebZ6|M$G{uY=cp zsN1NURiy*)>zqI7k&i~ zuYWF+>-}8{?Z``ne+_xX!ri4ivrW}?DHO^NaHV>P*QOT>5>qKwojB2h#}UmLqclX5 zG=-!{N8=6FC{QJoLNkLseI&Z?I3@bmQ*&{Ob<#v6u?nB89OHTS6!(nMD**$c)Au9~ z0mk4|HIEeO%iK|))oHQN3@D=Bu`-p>TzR5e%?sT6n#3GqL%1x^*PUek+n5rK>4(jY z9!f+YS2cR9g$fC8+|si23ZnY{mr8oRd=61x~3EPDJenVE`0d&*AJ6ZHEtZXoNEKen#mi_xQH_ zYX&Knw&%%cUOMW|E+hc%Z2R~Cp$b%G>-32LW_UKS7O~#3axM?`WSNF^N1K48m`p*O zj}9HRZ9Eb1gDIkgiO~DnRC4VDlPrPIq*1J}!``e6&7I#K_f*DK8#6y^8mH@DTH|LidQl*w=NgO`?ptmI~_8tyxZL zo#MKQXv$+cxm37M?3W*W`gASBUMXqY$ zfK=*o(@Q>^_EN%FoC7_E@=VXm)#SL;12mIkr6N(9cZGH=V`Oo@c?3Nps}e`C*a&YD zh>`(`kq8VZg0w(%(+XR=tG{jI?@CaL*F7k7Nu9}7lXL;fq(GaGk&Vl=R=px9eXfqT zu(!AF$8z;`i(n%0REYa^N?)~n#iCCk+i4*Ldr+B9#%m_MpI{zwK7)Z9wk-3>)6dA0 zh_+R>6r?AeiWgVz1@mmRRS*a!Cw<^BxByuvfHInuP62EiO5OBX`~2b%yc@Q53ot7h z^UV$dIqDqR3X6GPbicWM8`4`BVIt`AutQV`m2+Uo<(D|hnofdLkbW124;pxJ=Y^QK z8hcCdz?V_eb@vX(9I<+Xj%#>fJGi3eAaA;Pe>#u!~|VS zZU8xD$=$j+c!uOoq&2Pg5!c)s;e5_aBBA)rLWCr!=be@TIvT+5%9GyH;k6VOA4t&9 z3#hau`HLmh9cnIMOBYcmYxUnG?(|^w+0MqF4;~?$b&b$w?46&7 z>syUw2v*oSU#FLy?j!s~saaK*-f&IqX_ZfMXcb4`K7E0(Pg>+EJ#aIaRcE<@3e2sG z(Xe*}cfW40XJ%@E(t?|HJu03{f4$)|=3}tBI;*k@W?5gAsoDbrvI_Av(>CFVX7YUU z>-}u*DbVwA78~`z!QMNqUw6*tW`?+N2GUL#4D8~Cm@y?f4N#++3HPC>{7*TYij^y!7z><%F-84^v z*jB@(=YUCynPsrb=@i4~8Pd^ug9~tAP%BxUV4vuo5DoHhb^)Qbb`gwIXJ|o43O`NHKU%OR)8Kb!w5$p z-_R)C;WR7@Unk5nq589P(Y61&x3>9M<$|Z%8*9vn-;Ld_swpZ?xebwmKY>mafe=yW zS=McUSUnjGyB;4CaUj5nfGVb<>ZiYO z=nqL=WtM`_A>L=w`w0dwsZk^ua4h68+3YoQ5bYE<9T*i;aw@42ludE6GqnXoP`0t# za`EW)KyRS}0lmbn=VYHUCJ1nvO$TDnv)??E;?Khan!j9>y0ZIZ`2D6c>KxEC%=kZA ziA7u#YA<6*$xff}5i!ebr86qYYp`-@N(~|bBtQ5Tx04ly&7`EdvgpaE#@!jh_uCu( z)Y#wN-MRJ8&oycN0w%XmW49sqIz>nm)o;u{@N+|rbgOk7Ap(*ROo95s%?<)Q^LW(TOy*dKt>P%RZ`2M73k5*&6EA;9mZt#4 zZ4+HxkO8u7lbCDUa5mIj_iG<~MgWxOiOBK;zpg@3etv!upF4QG%iC0|tKxYFL5LEg!$dGS)|X3VZqB$T@)hp& znkbzA=rfDmwOC2-P6w?@^|4U;%^Yf|CE_{>P$J$WZz~c`xbKX#EtvpWm6y(OkyLy4 zHscKO|5HtEVJYfPggZ{FaFOZl_73I!g?V-#wZR{jU{u+Nu)@@gr1~%&o;MtGwTG1AM3}P5EjYARwnXzOEIrq;O|5CuXuU8dNvY@sDj;AqNCf>2G5try8jeZjj~${8Q2=e)z60K?^tk3LfdRINwR%TO#>P)~arjo(k4#I&nH55eL9pJVzeV}C#y%7ru3n23N z29%L`YM1gH-TfCKiv=C*T3ttekSj}qfxRhVzHTQui?28$Z>P~2c`K|oiU^V_J!mQ4 z1YFnZJmhBA84kw&=DvtVmr-$rKnsQYf(lGBT-n8kPuHX>}X)wSm{jpY+Ej& zp>x8FhMn%KHF1x`Xg9n#I~$yj_?}_p4^UqO6m@jm;*D{C7|PXb%kBC0o16G`;laWK z%n~f))xqB`P=KRlQe5)`XCHTr1-MQj2sLk09$8k6FQ7pJqsV`8`!Bfd4wvrYKM!?e z$eER;K*njc&)#obe0c8p_uaCSPhD1{l{AUK79h z>Cs)ByGvI}{2G<93K3n8cFj>@9Smaqob!#k0I)9^O~{1 zQ)MaFl%6|HS(ykcE1q>w6ALiuwz*0yZ<4)Q6& zzeXYjBmGq}VjZbs&PA3H`=47TG(#-LQHNM8|NXlP$5SLnT=R%DWgy`cco0`a*D&XnUduY(P{E&Q-bF^`N4K#e&xVhFfL51`*^1fI(~#Api#IsR}s8RT+J$#_b(nzA-K9=&L=3 za*a~IQNtEyUkH>1%4BYD{g&tE(ul;E2{o{e) zwkWF**+I3t)-zx7hGInjM`K85=$~DM<0b8ZnIT#rBiEXmP)o9Q=w zq)Q{Ylyi+=5M2!qEMC>#4+}dEi4|SYW@N&lTbVoO6q6D1G1?}hb!rsP3Kkmn1D)s& zc*T6Ubxbt|9&fqd6xSC6>Os$urBNSxDtBB`?N+5mWPi9I{v!9Av##8mn+r=&U75-r zb&ygWymCr|ZGgH_=%TVAIOGK`j7F5DhsVA(gG%Cph%1YgTNV=tR41}V3j~Iq1@I>j z!4snnfh*=5wdSvq_5&`qiSj*{mjQ|@pFoHJl8@B)Fw_p<5X=M0VqnRk(E7vDq$&pB++ics{c9d=vJ-G*)wbmBc+=>wRuo%K@%rg6=Q2t}SO^A@%cygN>km|a38H==B6@#D$dfWBH=vLXZa_p&8Yl^BbB-;DpeDfu{7*))C_Se0VxRTv zUfbAM--etc>*i->GS*qh9&3zO`~ch26!PI6(G*jXFIdQQ|2f~gd6vGYS(l0lW|?ER z(#_nj!3AlO$QUzKupRsw9h9^&)KpD_I~39qiex)4B@go$Ym6r37NV~L045txTybnI zAwhIYYeyi^PojF?#aGWn$*??fw6-vQkK}2LmoYBPfqQ5$dkv~{QFZRdm|%9`TLjPX zAGby=3sY&vS<~k7_l6Vz)gZk}%fAzcFX^ZJJl2LN8H5D35acGzV|kfm2vWf?D)Mb2 zrf{RHmhle4yYhf*_j2;ywRLCQP#QE8qB)By?)xBtO(?%w2wcDW5R2Skl|VC9t(E2Y zuLA3Y;#r zSN&}!&5LM#+%#wy~~R-*kQ{3a+qc)(pF7_u?cZjs$WU&6gSTKWKZxW z6$c=uL`vGq$q5u%TqUsIx%KyzTmS8#{q|puZ?)eZA3t|b?%ev%(L+=fhbHF+sA{$j zxTdY$c}~Bv2sJv9$dLstinsNibfA2AO;;LVXQM$>S%LCel5-3AWc*qDT@p?tFoCv$ zfEYlY*;bs4VVQg)AR-hsWFg>_ewp4T#AmXmNpL2*MX+Y@qVs@$)VNO9fj|f`t2#&G zj0$XS&i5O4IGnQ&$c!vsSC4;boc8D zC6Y@JMXpm8lcRfW$tfy!G16icl{>nJ7b7Sp{*v8Ys&Zo1`_!V?jufvP()D)U!98x_ z-rElE`Nf5tr>C9scalV*Polstc&l6p_!&zEw^;PDXnapcVg5jJxb=kFR-}kQ8 zmLR36F*xe}OT^`%$OUC4tl*~De;WhL*5H5)HN7&p83P=TB1utds9q%g{Q&c`L0pqx#%UXi6wJq?_4<_>|S$`Kzff+_Ao0}t;*29 z*f8N>)yv|0BpdW2$X)4^1-51;bne7TAn@NvzL0jt$lspwSFQn|{TLHbKGJh2ajberzyEzGmi*Vh9`(*_20es<2)q-hP%u*TQFHRNcLalYXgj`W zzdOnk(v1Y*2FNdax1g%rl75EN7(GBF;4LPZEkoYMdl;#2$=u-D41)0xFah7*F4E-R ztRXMnYE-@%Us@`?-2imw_~qdEN17Qg8L`PBK0>cb?^ZB11IUk2<#Ke4%d}uGff*eX z8?h+;v%4rP8C8?20Kiq#Y+7v6Fls*9`SaGs`lG}3?FX#A=6~+Mkl8)37M%Mh%+=>q z>wVg=%~VV-l)EH-8CaFs(A>N$`q1#E-{0AJw7I@*Kv?Z3H>%-XlSIn?frP-BZYuRXr&l{qL!nat#X`cJM2R1SWxwx+8DXYwWZL?5+_H5PuTy(JYUGi6c4d;S{N zb)`hxolx`XgO2V>QG^oK_S47rH^KH}F%kZnm4^g9WhN;KP>cBDW;dALQCz&9fM#2I zB-eV#FZeWc7g(O5 zy+G{KV_j6}m$T>RC!nPuX1VtnlbN;u@wf{rMC`%3klC1m;9DQYHKiXXN^zx6?=W@Q zR?#$4fmhDzOtZ;@4TXKc=ke(&e8E!k?bj`j#!w5`ltPnWrb`=~HP=37$WfvYl&QhR zbRBkD?-GS}Bp6s1jQjlrr{1q0OttKPyH4<6mLaMTq0R11u8j!C!Ie#8&+Q9%c0ugA#pRRZZ;L;i=-{lC#={;2W_31dBs&duKngnh7e*e1I}AA)-xn>&}eoNsWhlMI;9GWpIN7 zIoiN72)WBGW#WQO)XHKg5N&Y$a@@Q1&EV|S2e-KSP{yw#7~RRPIC@JRUPK{fysdn2 zlcG^&`*wB^lGWyjK6a#XUMkYToC8@<)msvVFmayAk^wofVP?Z{as}#yV(zn#ZX3I^ z(JYT*@zE9yI97?jG*!9&Y}})AdL3#h-UK*KvtN^F`SV?4jAPCX%LNFu}$@KLI-9$NeLJ^Sy29mJk)9GUj1l_nqC#88|(_<@iL9$wVX~kQhwIxpVSyIw#$Iu)` z)saBWV@HIC)|=9q<&@oW>Dy-k*_G;(4oY>ahCawn5F%ybigVV(4Sm})8H0yiKv&JF zMYe{Tox;achpmE31XbGOE-gDY1(8p^rtk8Qc)`6n0f#fTQV!^B3rZ)+&i#Me+}I~b zch~oW7o*t5p!Lqef(*%MFqwg5;#wUVeRBjIl7{vxrPqgyN-8h?;2}g6{3Hc}?Gy?s zI8aQA{D%?C3`&jYT|G`Awpl$I+R}0n?CA(WsjkgQlY8fan1;-hxS+m4=2AdAOz0Wv7*ZNU{VkiqWUfly`-@R$FJWAp+3cd*g@4_W1L$Ro2sB6a`_s%46*FEF!4l+ZvkLkHc%6w3sRSK)CiI|Z4kB-IOr#n z_K8=6c3L(G+I-C4RK%K2QP?Tz6T&q|Cw(~N{%5c?g3`w8!RFeU0A$=!u=$@)b~pF- zD5>HCnZx~^f8X5R1MWjXk!~W5M9PS?6lx?vD1PwW_WI+k4JLU#2~xAmuvH7>d({mn zk0tFu@>|n&3#`tZlH_V0{nhHTj7yhY3%F>2XeFYEGCHA50^{mr`24K>K8EBY9QHo^ z5-u%jt&Q4Jd8<3A)pf`riq{9$|CR=@_8^ugkDl(CB1hNCnD!se+4AN%mDNfR!kvtY5H|FLtU)Cofr{0_9_WY(AH4f(Fg(sZNiqrP*(^}zA z$oq^__owCLp<>R!pyqsGHMz)gU_*lA=tRNg&PkzBR7|WP9Q$mvZn;Z>#C;4q_Qh_0 z^kM)O_R}EnxCttaSeL9=65MHlLC)!$fyS&dl6EsMGy-V2!za|v)QpTEh)AzSc$SdM z0e2e(PXNiS?G3njKm2gzd(=9?-w!tV_nkX%2w5zf5duMmi@ov)%!na`}a=hD>F z+{_Z)&Y*j-(nMqE`~aES+r@fJ<-Nw#njOCF)GD6$)-#L!U3X$;_Ov1+s6^nSApamtD8T3=97W%bsjB=Bj*SU!$FJv zAjmP%U+(8Qi~;a1Hkg3qQjr1JMTj=S(M2%Z$%qcJ?nb>78-?wUrr~==iPP-+9H5M{MqY$jp|?@OBBD3i2ZgJ zhlpONU4kr33KzPK&MK=uqfe&?ugy)$)5`%&Ds}-NU;#8eEPUyfO*t{}uZh@#84P6N-6`O~z!gZ|v=92B{k_+R4w*I`$5{+N_l4X?&i!4rnk+C4m{Ak>bYzj&%P^iB=40Z z;v6&u$-#~Pak6fe}gXlL_m zb=gU-)G)V$b1U`JGS^=?;a|-u;#YKkpRFOvSEVfhXcXT>7g4svH3;y?>kHx;T0@M8 z?v7%sMeMsXi|6k(pfEEC0~Fw=D?`yXApp>H`>x%d2f-2xAmg{-0A9;W&b zasL;=)wr9B>~n^LJS&xPERNrX1Qw<%p5N-^BP0arhG9Y>eq2g|Ul9FgAK74~YoI{v ziprF`T-rgkM7NBXE><;l#a07KmD0iLX{KVJWC z>oGDj{{88LoqhhU?PXd&JncSVCu6#>ME(+F7YGp1 zoYNO>r^C@o$br|L$f)nJ9D=k35v}-GhGxTwRsv4jI^Spwu=S=nWC*H75|=vXPNo$o zLzHXGBG4I3zy*`zv|)8CzmBtLL$4&H~#RM@e5jOI=|y zj{ULW^^RBA9_;{A^5bj`vvt5ahv+gLH+b|D{^gQg%7zKLDQ-I8LPAlDjAW^mcw zz9@3X37@mj))S}0!lc?$dffI9w1>QSOaB*ot@ZA}q45l}D0u|~T%1?f@0uA^wAOL9 zyXD=?j2_(I66OAJ@)rf;xfT?hYW&NM<8`jH2QdF#B|TFDZ%KA;^EwxG&pzOt93-r~ zrsKCAOBzfNZ;;WF( zQe+~(e`BJEZYoxQ(9pfZm~m^IALRD!lbEj)G*UXPiit_o)Deze?fT5*?O{dv;L8vg z^PasZ$vAHH_|o4ERwwLC?+^ZB&eFYCgX7^Tig~i!E|2c{uyqofLx??yu-7nQlr#Nj!@vr2aSPTy`!(c#&LW(z^w@}!J@YdWnqZu ze%|5G1Go6&-H*k4mv~YuKqr{3MlV5@o@ST8;3zYgnkV`meg@A$OK;k?)jxiWe+aHF zdMOJ#JW&heC0#XL>HTCanOcD zu$uL#>_fq&-J(VPLa#M&Qn%(SX;O}ChQrA>!xun4C@P^|>^hRtj)y>lpN7+z$LR|& zRW6NcR--&xW*^wnGdaH#A?1pea^ z;Rzs6kNX!tc1^TlJ}D-L-b#J1tLH4dIz(~>c=eWg-2Q+QVW%0GAPYZilW78bpa)e{ zU9~u%R@?MKXD|Dcjh9IN0J+;hxdB9>1f;c5Gu6`zZDSe+sf{u0@m(M)_Oc5A&@@Aw zr}wFX<2y{J8J%2p-QA;j?`g)|aUr`-osGofF=DML_|%g}3cVs&$}@?!sd z)cn&faHS2^TyUy7u#po7VjPdp88O7_DZE+P|Aqv4Vb^Dci(SnxcQzisiX#u{FG7q^ zdWblomR0Hlg$~7*T%wT(naOcSw0A5kMhvf$RO3@rVU4I8q%YcL9dePQTc=vrobl@* zLjQWwJp~*yZ`FVu1uS<-A#b5Z`i63|v9tbYb8iEl+?B7tHlj5R?gU)qadCmmiCV_G|3JEXBEYvV#ZSpT# zESWYoHuTlabC%daQ#X)UNR3!4LMB<&`BR7N`Z)r!f7D`^eRk#6sim0;gT>pHdG8)C z)>yx|=)YNwpXOj|7_Jv(Z|WaA#f>D`02~!D@^re%lflInZ#;Uow9nEwD1o!F&R~w#Tr>ropI&b(AbN|mKjp()jvQW>gPUTWq4;tO^i@K}5(Wj-2Og={IwZCfX+ zs41c%D?&y$`Os|;6DIjtm{*SdO`6fd_U$AERG-Ynb*5SZxf!m5{}?>^+jm==j~>Kd z4j=CBJhp|lYR-193bs;O{fnh-owNX8mDN{BJpv@Xo&`u|coKLa>G{ouR!c!_=$qJp zRJ?xk=i|XE%996Mqo4X`LtLqXXuS3&Z9PrKX9EN<;zGaC$pHhn!|#o@>i4%$M}|5= zWqHwnkI;L;_{SL^+bNmbzyqhO;oh6`)A8sH_wf}B=%eYuj&Ne)_ZS>B&?Gd7&nfod zU+yoskHGpXNW~efYzt?xT`~>fDK?#1|)sv6(^Gg+K{8GPvWl!u67(dbU3%!PR zra$x()RBLTFZlCk`_CP{`JI0LK|lYhpC9Vy7n{IAGD}H*oR-( zj3Cyd`>(%dg9=VT&Q9k(2ja4D*dZ4ft!ZvWvnW(@^L>D-hzXE%v70z3b?ed~(_{TR znekv_TUtGcmafAAlk+C4b|w#@81&C32;hSTlCd)J-p-Hg{-HzkIey*z6c$5p=(0a7 zG8iFX&m5oqG}t*i+0cNiWkVBXaJw!j=e>JACnOU3uUZpYL0glBB!^=)1WgOX-iOc^ z!eCKSs?C_tYmyav{%s#dkE8u|;(0~9@B4>gqhL6BFu)af@cu+PIh<^gG(UlnZ|5|;-Gf0wrOJGpLr9%t2CMDMpoLTJD?8B+Wwfg5i`OS(#Il|2EhqWGC zcxmNXS*K)4^Jun$?r%9v!0l#+=6gspIk9_b7&H%V!z*fdKW`7$vS4Fhyh-^Z;jO1N zWDn@GR4RW?@`7QiUu2?{GoK7k>1>CRVh zm6fY|76j8+&WT14PLjBtObzx-SF-wwINN2-k4<&34~8QOE;Jr`D^JJ470|Wd8xsEc z_4FmA9TA?O-PdYco{0PuLAG##(>{O8he290JdJB`GKV+)kzmY(<+a|6@l>hHln$u9 zkwvWF`7LaUsRk|6gKPF+I5`|YXKry?kes}bXbyF)X8s&*Up$|xSh3IR_T80#TDcpc zu@uT_HNYh}#>o`8b^~Bi@1om2FM(qbaK)*2Lavx>1+;)3aEoUU3lHz*cZS;xzs6Nl zkbhR_L64xc<_1Um-JzH)Q-Lu$iu(zFrU&TB&}kL3Tf(SbuhE{yqiPCrC4c8hYr0Bn zEu^qhU<7$Y?USB;LU;A}HR{PY)ofB6@sRdo$Q6Xz8>ntTAuzOiFn}A{Vm%(C7-9bf zP?rG@b|NReBj3_VxIQ(Ig(JUR71O}MFMu!y1W|8UWbxMcf5WQtJjiA=fSg_m5w+{3 zb^_s^5s+`XYLGU-!$F9r@a4V+-4AN4$J$q73B)L)mm-#jpj@sw7F|LDF?JibIJ3_N zH!}MPNn05s%Tx5?$H597=389|*|q%QGDu%mCK|b`maIR`#f>31IS;=pE`YXU4zY$y zi+EE3AjyMWAPW1GS&tT7kXg)4*tcr)CMM@Wos@WMS8D>{EPGta$?KZANv64Itdc}n za+K~DtIguleaa*>iB$!AX7`os0WB8+E{1QWhPW>!ZaE`1uL4yXIH(b5#~VN?52s1{ zxCo_WzZVY zaalHpT`g2PryaUp{inv+Zs^(DprUW(Q`AL;y`4_!`ip;Ivzx(h+p z6{N-a&mxy(zT?C2o)I6W1eVgxZ!!$U(WuoDf2tF5bBKBEm0k}C8!IKsnjUS4l6)Ic zKbvj4=q8v-yh`CwTM8qgMI_J)oKh|#wNO`XgRyfP;SP~BYpK4f{3~~5n@ORieWJyp zzpZ1pd=@CkoSB$V8a>+AUHi4iFC*3A;(vt8oHF6fvgs161;M!SwY%NSeHF=YTff^E zazi}$W7OL`v`vIpu|gJ(CleePSaPvHTM4QIOa-~}->D%N<^V|?nK-r)pAs$uhw3vAjUv`R%p1y%ExrAu(aOo>O5fOjXYAg12<)4Tx}ppL>k zNr66?aUoV?tQESwg7(q)*kh6`_M-W12!RXYbuq4gYH>&19eAdL$8p59BZR+$AvtzM zPm(m1+L1*(gA54n4lDwga7{x5pp53vkP%P+TiV)UQ?-wy{y9vuuq9!KVB>v3M3Ruu zqK}*S%`dza^=5lo^o)daG%_70&M^1Fd=D24HU*Q;q4adp(x)Gdn`>RukH{ zEQd*`-}@b^_~HL7_U3MH9hbtqq6JQGSwwem&jR&KOg0+^?QN~lix!*+?$Tv?v-|wc zwmIwgf7LDWz z`P^)1JogA28BI@DmsXUK((E9Ww^TW@_6nAFdo;$CgX64#L0wozApIvYz5Y&DVSSTA z&+gruj`vV*lZoSzM&a0YG%3cA9a&@&=Y25xX?2BJKpT6954Zjkbu%A6-G7SPBOmWP z*fh3qB~sFa|E*sfaKD0R0Jz652gg75USpY%KS15jK??B4QP(VvdYB}L1#G79=MScL z!)5kWxltcwt=A|3iXDvnD?-cpSBsnsKgzmWVjDKRz|E#(HBlJ1QO`W^2sncB)-Jms z@&G&8Rrgx`h@DBE28}j*1K64fEB0AlD6*|3q^0=(f*iY{icDV?m6@1dCq4*170gZ) z)kD`3w`|Tcs-Hd_U#!zA?HZHDS?hhg){DMCiT_N&$`o8Nk{R93?T(hqe6qGr(%mw4 zTSQ;k5({84NVluGhh(*U=Ar=^d^_NPuuvk+29v2kDUp1R2RmvX>Y}0f5SMDMJK_`*8-Ne!BLFeYtjM_m!OSz7f&lUC{ zu(zVta)rVr>N*RiHXB1WlUd^}N;ucl25L!#{%~@$=5vfoxpGD4#xA#QF47y41E_m< zSy?>*aZ%joCklCy?jE`(dGuJC*;b*jFHTi%hbTfD-F;MGca)>{Nw-&BILgUy7RpPA z>+t6M5@o1;(O_NtbvU|2FkDbwZ4x}+c?R%rrKjyO!nik!g6?l$diu%-`JqcA!m&K( zI-E}c0ZDD|z9xH)f+)!Ja0fTfZ+yc_QTUbr!JP$)%L#^0HC<9r8Q!fJKs7| zi2QH3rV{nxc_cqizG%OBfIEyBEvrM2kSO^$^+d+F;$u{voSzrVe7k08NsOE~SZcqIU~ zuVGqhvN}krsd2lP^=vb*AFN&$sl{4#N94(1$z?K3dDurios+?1M70i4Y7i0b)ptO` zViIyT#qEIz29yfK%?ciw;lEQ5?#Ue;6nT(>nzj4iwNIOZmBX6f$@xCq=Bv{Zv4fKnYxH4F!>iwdI7 zT@}r-K)gYFaMp~-BB>X}d{d${sDT}U=&x;!X(40Q>12W})LXlUDvO75C85a}nxy9X z;UYw+M33a`X7>vb|8O+g)YLYux3TdB0L{2~j(p=2%RmT}p{$XDQ*Si;2h0#T6U#rS z$bVDG65;+qt9zBMIl@QtHMSp|wj|e9B==jis;@bC+q3Jg;~ zQ%lhm;X08PZ&upl28L5pVOxa&%}>tzKd;t3A-BNL z;&OWW{~h912Bpar)4E;Z2zDEkaQ5KrfXgj90&<1*#Z`0-UXO`SPX=dG-mlt!j>2*E z;_gJyS=Ww{;VVD)VOkjVFi>pNW=`Z%z~Gxff68D)EL@{Pohe!w)xn&K<@tIE9^17* z|L~%F#1)Lmx}9mOI|k^W^2L zjfoo7^(yPX8|}pyQ$a~Ov}Rm#wWCBEcZYmCoW2}iPLoQgDZIlXl8A*sDo41&kiKK4 z8^6Lug7}4JfcYM}eY0m7LA|5KW!gu*qdQ;CsP~HWVq6(~=c`^%)gf(`zutLWywo-2}u!L^f4FIHFub z4C3CWO*u4ztO_xu)M_AV3ovzsGhyRu_qZSSt}rfDQKus}T~%kDN|BBYBMRQvg{3df z`@^%PKh3ze^uZXV7zXR~OJ}od9PN7gRGjRe*ZXiTlRM?>gY?_|rtiQTmJAf-x&FeUBFYG&E+KJlVfl_<6E^v+yr)>zdQ7%C!EQg}*S>M+0`0rMp}d z#b=c8Z`#7|9w%_KVyu~#{hJoEpInT8ej`D)p#baYfoJd!tY+mFqP{Lpp;)#zzadrJ zBxPvz{WCuA$znCTSf#q~d4{r$Iq&%;Q4=OlO!A3~8Zbwn z_ZY}qgxgQTj!%Np$bhznUTrmR5>Tzz_e4J;~dNV?dYIkMJ zk@RrxS*OHF4$^IO(t1ZUogZa~3z9dA3*o-r-gK<$LPj*0Mb#Tl*}A>7UMP!at<7$T zC9wV+kasfe-CzGdz;(!r`6HB&?pa&hFtPrBfOve{LQ3xUFK`t3()#3Y0qN8CyVf~z ze?=FncnQvx-QncNH@x~~1meN`k&`!A(D1l-jKq*h?`-(vpohbM$Ug@sp`y=iTKdiq ztq)@^&c$&LWtvX#@m+Ktt!Py-$%U%7W&9GwriCxOk7e?Z6%AR90a>DZdx|>S-rwAP zh~nEk<>rm7fis+FaXF#7>FRK@ruk9JW$K9K&VMn>0nqi6#0m*dL1TiixO+7M$4LuH`GEhdxS3~n`+m*~K z?f~L<>myVrJ|ACBL|0w8ZP+$7MQKTZYQ%~VuOhstFK>wo@b?l%6)w3@2Ly&1@`{jO z>@o#}ST??$7v8t=bobGBF;X>+&z;wD(n>5rQX^D>Lu_jtG&p6pF}s~((?dZS9i1S~ zm7Dkw^^n*WNsaaj|4DPeAHF0_XXvTz{?rYuCKKVO8xUjkdB=Q=ru!D<)0#IA(7>>< zjvw<55Oix2?Z*T7J#eAui&1}ic`C$7;!h-^*yUJsexn;YxP^Am{LZOdpVC`#*rF-wvbIE{f43a>5CMTX8rX+s`qPRz5Wau4fk?H}E`z zc?mS&(AG9?Dc;`L+)@1d_U5-JM~8HiWb`Y)*gtH&@R^_FwX?eqf^uR+#pblh_SrDr zuKQkvcYS3IKc1PPdjGp8n}-`ak9M|k0K&8Fr;i@V7|NGmq)bAOk_O|hmMf@R7#2up z7Ifw3L;ge2r1jCsQ`q5aAY<@(A=`ULLobpiBMQUgG-h8 zsloFk3h})HRmp`SC&dC+S3*^*^bjQ%4-QbFGCjH1TUkNbN<1}&W3fl31>=n34$8sm z6UEI;UY!jQKk?D(0sh@q;7shsF2F|dhS8OGE5CadJREaD`YbK__$A63 zyImpN#Rgb4Aa$d<@|k&5J9OoTTiff8f}UK1^nEGG8;nE+o${bhV-lc8r54M$UQ zrdk_)c~zyuCJi=@~ErCd2TK>T=_Cdg>Y_~x;PVS$<+XbUXsC!Xd<63I+LPzdL zLpp47xl+ovoot|>vD$p!LTr{S=kOF6;W3h*?Ybu7yF&~Xcw5v5J2!RZJfT!nX!I@d zP`#SJTEeq^3=4%TT52g-Ad}flO=t{MeiYC#AY_Y8p75~B?ze2Dij9!C)59SL)g|b^fPBUu=Pq;thFYEh7 zg}Z2tbc36)ItW2hN&glS&uVAKWg-K(eVca5dzVW#mKt+oNQSIy3|b$Gw|++&xu zPz8#UoPN3gfv#9>c=mc}MWgcu3p#ooTktC+?A}qrj3atoj$#YPBnj*AxwT8#(c23* zX>xRL{;crz_1ua5=RR(JT&$_4mAnaJ^tjk=hm!4_$-CdF#gB;Y=0|&Rgc-q?S<}C3!q2xCv!=`i5@L=i}*1 zp0|YTRBz$d?b&5;>BSnd9gh2Qa)0v#7h4P_qZOn=@IL7tlFN>){Tk}OK@mLaJ-@`Y zG-#xEdbSq2Ji3c>VuCDa(p$Pq#jmLUnX44$$;VF~Z9d-I-rqB`q)S6^!L@3OxZTSf zsx*pj{^vf3``+Ksw~7r58GSbKYa~!)5TFd6S-5JID=fD~l%}yxpxtthnZq$im7R7r z2&jRSU+w#HMBqo&5g2BWY?<=W7=pegTWR^SUUJ;-#-i!Nir@OOnV1?MivK=aF-U|W zw%>E$<;1MyAmCgj4TpGGiRtl82FYz#Hllpa>?#I4P1M|cJaX)&A)vh_U_`@bm2sVh zq--CI4VqUuf_Vrz-}oH;SAIg9F)h?d%M9ftB*KT?5YP&MWm~0}%IK{Ci0Ks?W(M!Z z=MnhdSC`hy2_gjeL~{)F$VLpuEnkolmtsFWQK`L9oM>Uc+`GqEL!__p znydIpnzTFIh%&ey2v_7n(&lEaKnPq$G!<^1+j87?6igl2AkiIIA3@~BqT`^(HNP64 zo}#+urd>nYI#{OM3R8S0Htw_5Z~WXPr`MFu*%SrA0~quD%g41|9cxk)&_Q-@o;pbz zKD1V4W@;$GW5a6IAd*B?A=*GGj+4M5OH01bDEplDMCE(4J(`Wxs2+`MRLYs!H2XO2 ze>fJPFP8}LLRxx!GXX+ej-;{lR^>)PwCeC;0?8@-H9tFL;t@Bnx$!EK z5#MX;wR>p_X8lO@aex=bxIz;)F9{;FCp&^zfH~VHFNdcEBHd0z1`AF?M4XB04kygx zAlB8Z%gIX>8MYzv(joAgBC6)@-Mi_#GzerI&{MU$}Q< zLKvLD%-VKsVu)i(mm1RG5OnN#ahtAZ3@5>kvaALRU&mHVIvxp395nU#CGLX^hLD?D zL~V&^T}YfqFr_qBV{-LBMjWz^iwtEq5AKE z3oIgn6_dt^{@Xb8rJf`m4kL$ zRm&J2Du)R5%O|@#`!H8-KFBmohjkJKbeSY}d-Y)N)!9Q><+nzsV@d{RxCb(DfkE5VORPn0nXtw4VzN+X4A-gwj zYU0r3$Kk7u%8NKOA4qc7xuZps2tu%YQl|^JAnhY#hU%HCNNeH?V{XyD8__v-U+$?- zC%U@)frc`X0tdd_*t8losGW~#LVDfY_Dr{ihbYtY{^s7qcxIX!Ts3Jxo^(ghWYBzY zJ%K9*(|Qb{BDJ)CZgh{Ek}#%yR|G%bkvUtGoZShv=ljmJSGLX2t_+*!c+Dx!1vw}> z*V^zSY(C^UMo%HsKx4&KEPxiJr#CksRpV1Qgt1T~rqxH~Rls$tM_Mrq9w8*}>E7ny z{_gtLzT(<_b*W2M%8vc}O413jbN7B@rf$xI2vcReW_%AdxCYaPBTmvlA?sSvo#K&; zzq{k{6g<3{q}0`m$*bZ1JO zhBqh0$vU2@BBkDqmUzHFn3Vm?<)Oa}C&TBc;5mJ>i%1R#@Rk!AeNKhImpibE9Z#SW zB)8m#b0ZRBnqu$q)4hGxK|)IA8E$wwp_w14Qk2?IPi8tS1;)>NN2uAQgu!qXwN`%A z>?TxHqVDxm1PDH#DB-H*11r2#wr_U{cITt<@)^pV6gzF8O!~wHZx@G%!22}FrIAyt zw~L}=L7fPQD}{_EiR6V$H|z~ZK9;|FZ=DVdP)yk~kjL86pHie&|M>AIAAgKXfu5~| z)V+z>q*v6@%J=3FN`i5%9$Z<-ZDytkt?%7~qOn0CE6ZGyCGK5o^-k7S69m9OIyL>g z)yh6F3>bL{qw57C(;S4%aXcOV+*`$UMZK@S?EUfXCrB%_^C(&RNYFh(7<8rn@4tD4 zJf&wVGOIw+XtNC{C%H-7@l`lCZ)n>zEsMW}oxJV6;dJ*==eNDR8euDpcJr1umUfK! z3){+)GP4b+Pm6kWRlQ?cB<oF zyeG!XGFr;q60am(#P$0_tH;hr|8L+8q5(VF%giL^q3m(SYr4PALeNcgV%^cO9?D)4 z(hi2BLv^s~uV5|1#8=WbU_X-`D?7JnLAk9d;j-fc-kkN9&D}l5yKFsx*rt=u;JJVx zW;zY?@j;t*L?^)yqotaArUb6#L~LDR3oncwRu8$X>JcSWe-y2P^PGiC%P1EsD@V4a z>-UlOu)eWRg*nrl6-HJl(fZ@*{YP6H{0&(t`}P~k00qH09ji_dHD+KqaL&99Y-Bz? zoTga_X-CWbFLpSdNd*vGs>ryqYwbKYJE}Ahp4E52`38WzGJ4F(cTWWNH%$N{alBJ; z?l2BdQ-@0=xMr8Lfk$**&he@_3R^Vsv}k9EOAF&+1hVZNH$aXoS@Gj!G__%Lggfp_ z=kMGzkH!stQk?wq&YLt&23)5lfocyY|2}y08s_FFEKqv#MAYyMzC}YW;A8eJ{?Z(6 z$KrIe7LEXdvy<}L|ff8$aH+0umBff7gLu8^fVNvaoS z(DK7te~|MuSri(RlpWx&g7`!l&Hv5a? zH#!cTUJ)^8j1X36`c}i*({;jhDDn(C6nWu66gp$}$K!LxJK5iv7iu|g2P534#&?S5 zV%+dx>!dj5Ro~SYYj73%*I2DUe_)R1s;;Iog1G`z(zjmIi}46&s+ zyRAnvbs7t+#tuMs3j!Kn(0-}oTE_^)88$oPH=^UTxV{6+56JILR&zQ?OPj2}1~Qcj zd&5*wTSjJBHR`6--)?@$tq+!Uu{Qu#OS{x34ckKkL2iKPDg(9Fo4v#vu}Rp(Cq3og z!5}fQCBP!_8g-&!mOz!}v;OEulyn(�m$MJO@XIb1Lfoum@DyKQ(wrhvu_Oz8vM` z-I&M9Vl1U_KZy>lNE_N5fPbUvRWb*xPf-*faiD`qg;!mLtXxA3c8s707Y5*eyn>sji9z+z4B8-8aHRx~#f_T92|}3Co{V;jm$nL-r-8=1b->6~ZN0jpb9>9` zULhYFW=?1*>$FLRK`KbP0N{*{do;2TDd#H`^~&&D}e;aevB^I`P2lkF!Y zi&o8i;VG%PURg~Ov*FmUO^-C<=7tvN&F6HDI9`3pCCTF)5v^fbEY&n6Ud$R(16l-5@p^tGpA=fM{_}d z3+PoH?Tx$EpFyEjn20gCU_45;0ijXUp(!i7IPK!NY^P6Pe5=EO&9`gcHZ)&L(N*1+ za(N8bt!tHKlTcZdtY^VzW~_uwK-*M**A1DhWeuYkPH~lZiXnGHu`>EC?P|L}T8%KU zr@#vU^pblfIB9m+E1PP18Sa@$sja1kqpqCT1bwR^e zE_s>_d;g+8#DxPiHa{6$>_HV#VpY3gLr)=C)S~JYwT#U^g0B(gFr4;|pf;g85Gx5W zOoDa@RIp;HSyWjdc4#&Ws}UguIp`5o$sk`NUAccjN@2xqli;_o1Z7DR^{THL8KC`4 zNtjk=Ee3FzZ>7aHazz2H3}|bHyW-~JPZ-l?=f4MTXw(b@u$2qs)U2MesOB+JVTUK! zDQ0*jNBTy5oH=4_C^KjJ)YA92--h6qHsPN7dl7btih(T$w5#mc9*4C8eO*B4kp^oFD+q^bSho+m^n(Gf>OB_Us$<8hLMoO&gX|XAEvAJSd7Lhr+h9`M0sEE{Mz>*@Dy~Fx z8rTg1@5EIhcGh6KdiqipX^1gI2A*#M;I+PjlqR2OA%vcZ5TkB8Ef8vYo2nv(5c zlgk2((hAhBhy{fN4asD0XBXilUG-}8c6(==(TK>69SuUMn%auVK#6aLgNy#f@yj=8 z`)r9^;81dqO!>5DtSz}mp9$6e#2qF@Gc!}>k2KrfJ@`|^g{9BRRm3LcD*SO{75+l2 zE>_`h@JYT3e{3H#R}rSuK5>7_$%R$>^vfmrO#B1xdSqI*{>_e0C*7*YcS>8ij0mCZsuO=0$Jkvkh2gNX1(oQDBaPxzM(pn15 z&7Yn3Uks1)2d`efy2Q=I*`qLM8a9>E+JlU_e)fVnfG^K&Xv?9EM9z!uB$}A&Tm{F8 z;?w*(^{~Jy=MscQ5uO9j=l2KlS+X?`La%bO5q-Q@8=B;JkEv(6SNzsu#<9;NX)uV1;kW!OG=UI=L9}y*%Z8Z~@ zzJ?Q|tU$9d!(lf4Fiz8OLYeJ@yqoTi0}ufp04xR7#o2l~wUO3>mLk{~rVf1o;ISG37UnzAZ$9$(OdlTYUM!Q`V< zA>ktlER(k|$-o*TrOteIkbz*I`Je0wwh=S8<5!`LK_oV~eD3dI&rv7VU>RG+ul#B3T79Pel>ZXi#%YL@2VW>BG5pB~@rhas zy-IxrENPjW_gv2HGw;op9o^E!{mfqcx?(7?vCr=z>Zzn6*fq-HZ#Kw^Y1b_d52xcj zgsqHTWW7YVWy6i9G@<9X7O3mNbI3w4^O5nVX{@U8l2G8a?Z+LjF~#i0()c2fMFV z7=qbRMlB1;C44~X*JUN`QAnD4i%C65ld@f}=9Hbz_$FIO_07h-b%a@C9V{&r1susl zD}B`;t<%6Ll~u!lqCSb?WROjQ)#6|OMa)2AT;p_J&v;A9M+;}DiXQD!dcZrl?7kxX zSr#G7tUmH)OFKq62Qs%p4zN3r%ybtmh+;IJZj4J?qH8y@gvi(d3|G2y+brcV3Mn6p zgF1Wm&s(O!4N=XZAOP_1)N%X}vK;C#$k0mR!k<5Dj36T+a)wZtmU6C)Twx5QEBKcL zNH(Nao(J*s${HULzgibqos3|bLYNL81jU9;8~LSp=ettCa;E5 zik<0B-?M`ZTz@nK8&#kV3H1a?sBr(_H>=FUHx7&&&C)X~9wN0TCfpxdl2Ds;ycWuI zE$0f)?c2>nzT8v-6;Tob%onat7ms`wK-IE_M(6nqBw8kj?Bnz(|2TVU3Y&K*Jq&+1 zsb;UHcd`4RZ}FL~!pO$)2l*)RnUB#-Q0%J7R8cc*ISVqKBlU5J`iQ-8x)@GqfXv38 zR1vZ!E1#I%UuhU#r)&PDe|D*R<)ov;YE64N8J)D2If@!%v%V3|lgZ&AB2~U+QcB|) z$|;Q<)69sDr38lvwZ*`5ojj;@OqpvqVGvWav%RMTI^@D_t>1sN$yh6o?I8I;z)2c` zG$`az#qqe(gW<%}TKTd1^r1Z0R9l3X&pyWfq?fGeYQ+%w z<+D%l(xPiJjHynN;vw^wxsS%-DjEY8g$1AauOBw zn`}}3+NdVV&%4zsPv=eZZqCuLItnQbH|Ov+L>*9xhztTw>QS^dFki}O$g?i}vjL#zg6qFj~3-^MHDFtQCfRG<3UJ{9| zBj{HS4~^1HP;h4oV%+h`S`Tr%pB8vvB9eM?u$k~^=BIVWVbQTkI2GxI zK8Z>V@yHY#(4}xEXgW+S7YhYXc+<(vnO*&!Ab?T)JVw4|Tw8~mhcP9Dt={S#OmE#z z6@jxEW)*|8l2kY%9@B$g1E7;+&^E^H-q#@>h}u){o(BhYQ!xsQfrbVtKN3PngGmqz zSmqYn;LHHdUcRytHnLzy;Q0jd57GSu=&out>D8wcjrffkewH=VgMW@I13r^6PJKZc{oL>roiyKO#c=l6;El% zg2iM?hMx8IA$U;@?q_LS9#hzDboxO4l0zVPC)~tiXORob3UwG1Dz|Y^qcWCXFm!&? zLsjaPLtKs-nPe{2*&5S3mnYLs>GSZIGbj6qU1e*h=-Um+UzZSPL`REb0=7HUm<~_c zDoo>+6QM(I`8g*f8qo*c%=VA+*7N)k8^#l-3Gtx(`C@$eYSSyWETdy|nUlfgvR^og zie7O#c_>x7nR2d=;FDKZ4dY&O^2$DoFQjU z!Vo7x*tGVX!3g{#7RUw&3`GeY|GfbviC#E51|t6}gO8X<3mf6IjdwHyvDD3$F^0_M z6TszAmOvJ+IS*VYD1phlVqIbdje^aQ{wX(xEa*RG$KO3S*yH$}}pq^j(akt5? z5e?OBYLy5V7&ApE{X^6c)ahx!M^976ZLT_9$&>RtVFTL!;VcM8>~QG9+f>5>vtEtkfJ_wwJf zCk}7vymV344rID$hp#I@i?jA20h6UH)KGwOI0aXmr8gY1)Pe+9TF+W<V)tY2=){-DQtM>XKrSa|=V8Iex zaCU1)+f@@Qt{pPrcKB3?;)?#dx^Q^Vv!r|OftbOGd#Cr$@z!EwJ$}AO#)ZgN@Y)5* z_B0gPev_zLZn~oM61X?cB4OHG+YLFR{E~=H#<{A~BAQz;x7C$JkOXS^w=dy18C+y! z3@Je`$CtP{8%aXy#LAT5U|OG#aFjL;?U-D&rz60Jpd)38$$h9LtUvjDJU)YY)XGl+ zrYaa|b{#x}@gvoTl>6lxtL-|7b602|suTAdG>D~W*w6MpyWq^Y&62q`|UcY1cqT1dSQt3cofvWjUa zw8h59`4j@FrViXW!uvt|{VStDLEs);Z~NPm2G{s;8=b}AHxEGO|K@? z@Cyk9;qW$*As7#^{eZAx(ihhjcp zW3K?IVNPq*tFZ$UF2ASUxIRSLG@d2y8P2VBIcJwD`dD=6U`<8_OxHHEXeTZ%GEeWW z=2+nGthF^n+wWOh#WECIh8kU-KgZotr(yj66)RmtQqrnh)|-J=$GzUutr3K)q00C? zLG;99#*1(#YC2Wy*Y)<*;sPL%y3Mja2(ALOnCx1PUB=F?bn?=7f9u0n&g5p!U)|@7 zt*V=5sPYa@VLh53#Ps|v&SL6>dm5QmX5Ea0r*1l9)#P>8Jumez*WQQrQ&V>D2WJtv zHkU=}bCWYD7ffJ*X^~877EIbQQz9Hj;WKPAtxr^9=7=--_K?lX4T1VEs4zhD74Au; zM?y*($<`*y4=4`(9`8HNnaF~&YUi{Drctio&eI#26Ok(oW|PfAebTFi*DNehO&rM^ zl_ar^1!%wB`z`7l1vHb7Ao|BRUv4L+Wg3Z32dp-uBfz?@S&%Z9e%0eRHGTJP4u z=vE#AkeX}aLb7QHZK1emi7-gl9&Kb;kW}0_ zwS|z$#Os7XNOKwdRDH>=x#JgD>lj)cRG{nO7jE!2E3y|R$0`EUvWOX8R*+>Xh#7!S6FU&M|=s@&Q)*m z+MdUo+xvU77oK z8`OT0#VRG(jvbG2l96Xb4%2~q2U>Cgm7nR zBuvZ3zWe2tn4Y$KWy-&*D^u*&Noa1Pt576Cg3#wt-OBL;w z5;$~+WH7VSFLmEfc|58QA`5H?!gGumv#~M4AF^;By%DxkQ5(4TD&t$`*lC4&5zuE0 zg3QXdJmE{1-e;w*w6n#qsgFgb z-8|XZ_lZn_M9`|1M4w?;PYX6X9ZdqR8qW}JA;%-(qn*s8O=yVd#j=ek#n!FU>sms> z{ixm$KWp`77U8=7qQN`sxwq*&_1wKpoV!j)%QO~%I|Yuw!eU|4N88cAVhMh>9~@syj503o5!z}>amXEmnXR8 zH}Y(CN`l%@Sx7)d7j(~)MKDz~PzRBqBOhXG1gSlmpcd;WWC98Sj^2N+Jd^1POO<9Z0O9a#cKZnGJ z`Frm+1Ag=luKsyA{CRNE2<+2S7@d%N%!ss`3}Mu{Pcegyp{w^-jVZK{HYr`b?eUYB zul{+1rAe4LG``TXVuaj!yi^b%0NJBr)GQy6pwOE8oxNUK!B9V;Qd$q!TK@B$$@C2p zdcpmCbW~~?_l~ker=!-WzTz5Pi>+%bt$;VH%g_54w-xF2i+&PE7+-?OfKY~RcR2a+ zjRmBP5sK586M}PS-G$!<3H?JvDPsN?!xJ1Lh9`!rabrS{RFF5^F%V}|Z{Tnu2;^HAE%j1_-?sWgAdU;$9fX;x5GE`Bp>pm+ zCwIQ84Nkg1fil-J>^~bcKj>38u7u9;KI7R4SF=(R>60unedwGsd`r1mtSi$yd@*e{ z5PdH~U&wV}p`*#GHn#i(99Wwcc|B(UP7hYUz5aM}@5%ZGa=4XAAUy~fFIW(#qpD7d zwDGLeWdJ1|Wb;6vhA_i8vuu^R6L3o0tQX5f4lL6eR2 zxv2_Ey~u(oKA<atPZ*6cfHgdBe)}G zJnFJGuwTPdbDxOUu*nC5^H)^o{vw=vqG<77}rf@!usH+GNz6Q)(KE-GWc&U4_P+16HH*X`St?Q z)`N@3s*Gn?y~kiEg_=+Fh%wmnvN4W>t0VDE8G(nlsq z#-sBr6)3P`1^HDk_QWr;3B73&c(Ve-C(9AEQ#x=?)OU2h4M|gZj^oS%@r!?Brn&eV zpBr^!Cy7vs>0v3Tz!K#rS!O}^eby`1gW@96(_$@HgbXK=T}eR;=!X6=uXY;j{bPbH zUw(Q8>TM{y@UD4v4oJu%`dA`2bLalQZEoN{Pd0bg_jh*x{`Rm1O4z>=zAyoW4MYhp zZ8MRr9mJose4Jx3Q1#xu?$58fL&474B|kN}?!M5;(FzAfbQ1psVO8YtMCVf{@j822 za8_(Ll{Og5U}0FLLMys++&?=5B6pI3z}2&v%{aj3`mr9_d&cM>7x+N=DGpD0hU4ys zXFR**-p8#+rFGl-V&nb0#vTAVr)zmBg=7C=PUD00v{c_aW*dIxl4B)bF;7Qp3=pt%( zb9|N{Czxm;f5}QjW4iSP2Vq2}_!J10SIBEF()<^3j(!iRdCS$Y;pEoI>TQy=$lSWSwF*P^%M*zX&PxeQkPlc4^P43_N>?iV`^;0QRgD_2(=YGWc89*7AgzgY}w z1QGq{4}Vzt(~I-|@Ju}I4ZNFaE)fA;2ous@l(ARb6JU4XTFfhd}DOxl8k0-H4~rrw2w9Uaa$;dD+A zy`UIM%3{eH|#`-B{&7)A^*$Ol8|}ukc)?M|rYAKZR%s z8-U8SwW4ZfgG7H_L-x;_^JLkdnmZ;Gh5f7*)e9bp@Xn_%r}o7~AD*PFu|$8h&N?pj z1<2#OyX)VXl8}9xhL4liv|QQFno{&$HBV#qH1A-Zc>H927l|0(Z0>FC9p2xS=e$@3 zIG5@P&!efjF>dR?C$pv;vS6(z+SVX+iHV_V9AzHp%cTbS3=Hf^{VK2@!<9v z+d`mbFgVK1Ev!+r1CGLDw~XxtCwNS-1$1W~U@$LVcR9UJ@g*#k8Y?2XSt%R*yL|@x zwG(3IMBwfu8YZEts#vU9#;Z84X8nU%+022vTibu;Z`*r^dz&~L^j59)49&NnK6s4@j=<78T^4t->aX&v2VW!>-{v5ETZ`?gIbP534aFT(K53IZ7q|8kXcd%O+H z=#xfmAU+AMh3 zt8U74j8I`#$;>t5w~WngvCP0}pcqz?fc@R|t$jpjCF8sWn7+}biqJe{-Bc#*&-XNd z!kFKW2+*QoUQwqHZ@MK~H3XMgV7|$>S(Bpcjg};X02~+pzjTR9;Eh_{f{SQ$o6A)t0}67~ zRfmDxljOGSQim{q>}!li;i+acN(wp2_)WQMtOwV$dmx8A_+R_KE!BSS`iTO5` zRY9rJmei z=QpD8@6;1e^P7h>cgld*&Rx>9ZY0G7HX*aEg2$X+;<7;S7qP!J=OO)&);18k2zUYkM3>dN*IiS}%0VFv<0$y|q+D&?^uxq&S_FUI(z`N0( z;sT^mF#scdI16m%$(!Dr!Bjf@1f}heKHA&ad9v1fF*dv32tuyYCBI6dsklPV1o_O-sTA3XJK(1ZG|FHji?l$be83-p}e2-I}5@gkuWZD z@1DPhgU^4}dMRkT_l+11NN?g}s2+4Hmh=ttE`pDBrmp$FEy*JsfifLiKo z(}jDAbl5T#wxc1O*;T_O$fL6y+9JR`pMaaiV4^qZaGg8+W5W?U(HX0S?I98g+ zgcITXG?$4_#=f|ZFFyO%k3a63kXkjJ=TOV1G2sXn7S<~j~g+a9QM`bC}sKsn}_;P+4%BDwdg=zwYAag_pW3k-xK z#R$v^2Pkg3({ysu6A6UJ2w0>c_B?m~Q^QMMes!`%^$&z7mBE+UUGKQmK&#-n=eC5_ zkdgFf1cL(4u|>Re)qDEmZUibGg9_$Ek)(QBJl>hjr&i?l1>FJ(cM!2d>^ zrh1LuNK_;U@M+pLT5YV>nLAZoIA`Bz$g22*wQ}&l8)X^VckKPtq^yggk+s~NR5dLeS zQu8l=k*7%#Op1{)a9%H3#_x%d*k43f7V$F^Fu~FEbTvlEXgA+P-v4>;VC8p{gB5Uh ziF4zV!Rjr}=oW!Xq3bsO6>%>Tg>c8qwSr=-OOK@S;F~ONs0}6@A6T94j7jEXZAfe4 zbcNQAMf{XB&$Sqy^}uC*&$-5FDv=+f+8ajBgxEMc_K)Z1FgeI8QDSk1sA@1Ywz;`;e`F%zd=gj$n`SZmK^+A-q7dw1we@&rfYY z!x$ao=1mk8(ga#~9h@oVm>5iCp%q}NHDaoNkC15+`F7BV)>j8Ao~B8NV6~G@_6qRO z)3Uqum-T%V7~!vZ&Pq&WX(Xz!ZOUVDlYZ$zU>o_kuj0uDUXMq@buAeaq?>@MGiA?< ziC@ngg#$yhB$?>%!gU>X*j~_!fVdaYo&>Bc_@y4cV02+>I#YW{{(%(@vdJ3mum#@m z{Bp7;@s<4~e;$r@zQ9Ua3XGnsGY8D$5>OmOP*b6Wolr{1OZ01iOW>+qXKV;t7##` zz=BWS$y`b8nsW_kR8P-qALi7ZGW8-$vv1p%_OUJP-E2g) zwi94w4s}GM;E=<(qApAf-YCxa0zyCmvN`9p+|W!SNTfD{Sb0ircq*jGBt*sZ5f}nT z-?cI9s#CP#YJ95y_DRh_uOL3TZO!xe;2^98xQ1u|#(!bK<`{br-HYS49M>8lnrqgPT*1eH*1arN0#;nb9q3 zII2sLFT#jakRfJmYtbvvjy7H4Orr*>#ZzNP&sYw85jAK0{{pkDm&U~w zU@hE-Qk6*0$GbLW#D@|rq3<`W|5QXDM1q$I80=5axqc0k#Q7Sq_AW zA)hOCWB5tl&|nNSVm76*21t&rT)xyJtymk`<-` zrvu4(9ApU2Q5Zz{X&rd=ZR9@)=Tdcfk1;25BqEv-V`ybi^%yGelKyj=Hw=dYkqRW+ zp1t3+^yEo=hoQd>f4w$;W@zw3hH3$)k?OjB%#a`ePvMg_-Pq+(35mveMd(PBl9zP^KnoPB{1(rzmmQIY|} zdZ>u=YIsnDkMm&7J9mQjA&`dbe6y2=nxaLBP!y!Wv@b1MZvh|8c9U?~edNLornC5f zwk(&}Fp9<%RBcH8sz}=k-%>-eTwx&tgI%>SZmVr?aH3XhOM4x9qvYWX20VP{bRAmc zn{&k92@E-xaqKFvq(n8%uz_H9DqC>;WDNQQoeV*Zg1}oKdEHfG5_z4lmZ?mG$Zspa zL^8QN3*;u1Rwijgi>5Gwj4XbSjvYFA?xqy)Ms%k#s&Np+L;*9d!+sG-QwQ|xv_c+u;>SGj3>e4hbZ6h|lPrwHm5rP#ss zbugsNkfHKWzS;1=nV^(k2`^U`8b(&SD3}avtaG>Y0* z!Ad&cu2BWCi3u)3uQ#Sl6}-pTsLpm5`0M`( zi>6B(MvJt7%Yw_0pa1kv;=fDQ9Is#PkV0;c7nO=n4xze@kE!oS!uN3{Wg@hyH5mnYD07=5UK>d% z%3U$_jwHrQy~fccWKUmSj9*KZo`0aAYq%z21&cr{pmZs+Y&}l4cdUt%vtsiVRsDR7 z%xPvD4M)dkm&h<<2s%=z^*g7@G$NEzyJX%qDyU8F^=|!caw`uDwup)1%X?#*}?k%hd&&QdVlEsNwY&g{Oh9wEF7C1 zqS6mWzZ{HyWo;B({8WXEXZ`g4w1HZ5JCE_beZBq*KZ4#qGgE2hPa8-y9G|oFIJO@@ z;`LG+C}sD80*(5Eu)`a!f*tF8_~PXho5vG-j0iw%5bmg;!oyZFSmp^?IHxUuZnHA| z>mQ@FrxM(*Dlm$?{2g5;RoMcjH*R|}YXGgx5Vv&pg0!`P6Er-*QEBM^l+Qp&;@v(9 zfC&?e{z@u@5Jreeg&G|Ub}K>&sL_U=0z0$(a{)uQiweQAlh@4iSRf`g(YeVw(n&9- z3Xp|p#uA6owY(Z=v6Y$QDgpf>B{o^?QHe%j3i^y~ zgLySX`HPN(MqdGsZL4Qf3eM6(76shQBN_iNTcK`7k49ly zrofCZkZMWVb2|K4+(Sg`Zf{jJ*NMx>#+(j+8nE)ym4lP>?F?uaI)SjDVt~(9A`Qn; zumRG>vm|6(M0(taQeKUqEJV50oV{oK`bvNrpAV6oeaPiQDA8 zf#05lJac3@i#_AeydE&G_`QL3Y2{BwUyxDzr%h0*=^G{n|7mCU@j>08^-SjqYxEuRaPk-M$4o#F-T2N0e-X6d$SV>z2yDZI>B-CCDXtLn_T(d&cbe)v!mqQKboT{x`&M23iDZ1snRqz9a3{UEzh>XAx(7|%v%b&!FNVj~iKM}$ z;yxX29)S<8ad>z#07BuqV2DWBQ(j2Zd}5+n`5c62ba~e=@`=mPb*svM?XPEFP~uq2(OUw%g4v8Fj77`89cv)T6a3m9+OJ8>u3pm z=G)5GAwL|Mo_ExC9`x3qY@uwxM?p$Dqki-9j!t!usds%kPeO^3M*#)vT( zIj2r_+v4Rmp#99$XsY+`{%&R$q1;dgoh7D#&A4pYOI2G)hI<-}xxE^{f@zz!7cXV| z%8L=tkUJVuk9ttgw{fsc`iLEs;zuS6ne0<&<2D!i;?nS9-3%DfuDO>r4Vhf6_Vvcu z7}yx4rpn=}PP#)hLfQalfSq<*BGiWs0?Fk-FlLR0Cx z6Ab-RF|1+{nxI#bx=zz z)mq|9TeaZabM5XPK(W|j8+~3_k)6Copo2071(JM&!J}pd6zMAgJ$+?)o9Zf{Y-&|v ztf$XuGFO`bb1*do@FI2JH3{O4++81}w)Iq;4!tF0t~RkSEf)c0Y0E{B!ji(S1?y7e zX5c<>uRsOeGS#-5GgK=8GE$ZtkbGF|W^7f1Fbn5N$0>du`hN$r!uD!+)BMYsWt5Tm zn0CvUA>GhVeKySsl+*WM#Jq+i|8&xSf%uRm3JBTtKQ7NmF8lODEdZ^OLB%}mFQ?6lh5N~aK>uD@OkL2us0Im;!r&+(uemKGOoeG6O3y|Cm7|> zjNN}YidJhxlfcdvgu#=+=q9B+k)YfeVwul>L-B2hI8-_Yl^zMw73}HDcn-(!1ud2S zu&1kXGIq}jzGp+&GZV>+LA)ulGPEh9Dvi&l?>y21hca2VN=k&}@b$-=dr!O&45wI3 z-BkOM0(E!x6s7)|DO+|UGkxSkX?{`MYe<=*g4jTgv_g!U;uu=l{LFY0<(k+xWE&j0 z4G$`5@F8*AZD-Ys%p`UlW>btAd&*?0aB)bv*KQyQ?j{b*j^p>Wu1q9b8XTPBa-7;wU>dwkf~O!nTQRpSVO_fs4-@v^jR(09DadW9WRJ zWSsq<3e{060Z6ooEIY7?9R_2QF$w*)t?NG44=%U349IZbUnykF}lyqc&<(lH5*$6cSI)5$dKa#<+cpAX+O0iapFn0QlTG@gN=9zum!!RCU(5 z0ZxQ<7;5BRMB61;uC&qfPzw3f%FpIzc=YO3(ku65t=|r1q5q*2J>&@>!}0?6NYf#4 zWi9W@X6a_QKeky{{;Y5BA8u}MtUuY?d=QC&%u>7ihu>`OZo;FR%DvV0@hhsEMf^WP zIOv@3_nr$Bz0BB&P`sr!5k@Qv7!5`?(33xv(BS zWQbEn%G*!49e;Jr``r#E#y|fx9xN>}TRmF-<%rLZepx>1xReQpbOmQ~CEO0b%v}k!*JWm7PYiccWAV~xwpSm_PWGpsb|=( zZao+eCL>(QFdg%@3NDjZRV7&6?O~cfGO`zB5uoXfhQ|ZkWM#KkIc!5z~uI$w!q5@T$x~$eUZU9_-+pnX zIW;nKUp%*C8Z0jdLkf5W7;-Z7*haMU(9Us|1IG!BqUcR^+o(@K6+k=P&eYNFQ)5mz z=4mF*e5yWS)kHbQyXq73pRwRV9g3pR`u2k&=o*^74;sWF>l10g9<#8E2!BL{ON*e- zl=cxhS3d0F!pdjelc-|7?acA`K|Nx@=;}SNYHJ;rLE`Q5%3Z`=CzLIrUwvt4V!aDX z&;jrMwMs{(f4yh<{2->iA&9p82PB4%LGt}9LOKb|7UM0Ertk|HT*DGf~q!JvgSCIg^sB|rxPK!A)S5W$Q9L?Lah z)suRxp66aYRnK!*57ndG{X6rA)2>xdpcmjP^!M$(&v?%b1VDh2U80wTxYHT;+4F$$ zIo0rz+LGyeN(}+&j?yo=Oo`SN0a^`hqt_~jAS23i;pw9wz?iGAsViDD%|F`N_@h(! zmD&0*?vIV7*j4u2E3V!&;sgN${FAr{^N8HUnK`_Hz+ zsf##Qxl63e6zH~Iu~d*wxD%7qNVNAHA~Xz=IfQb-@y#ieO8zSVfOG(L6CgPB=6HF# zdRfur!<6}q-GcB4_)M#4_mzWN^o-oo=EMn3WK9WEQKaiWvn^-4wH`BO5 zPH}!-f;JEs()##=8$0+n*ZO##e}8%Z%elAsqxJEP?VGdw^+Y2^tg$&Q8#`&%mde`A z6zhxuF@de5JKcs*BQ-)OFVTY1Wc}Q2tdB?pyaS^O@3{s5hzcTJU`CUP+*1d_XhU}m zl2jAIhK*XToK9bTQVTGCegtZck``mCHciaqbi0cs`Pnno$yiWhS*InjkenjW(AdhU z8XmoKWl>{qTp#1042L8R+fny-67}zb(!|sjBcb^apEh zic&|phMk)tW~`iXp@7?gL4etzc!ETxtPnrBDXb+h0z!t*8pyAJYL!xGm{(o08ne_1 zKa?;%a4u#*nn^#qclU1c;SYcK!x?)MEwtCpWma_2g9>)fxi!FnkQMyYdK9aug_S{F zWDO-bg`9#SB8=pR^aDpi$UP8f=rK5c(cAAc1qGQ7G=_{6oGujKduI*gXqQIybr`U& zfcX(#Q#qZ3l*u82jyx+#C>>u&wn?`p{!-|d@JHu-YI^&Q>g}c1@GVr`&830NwTvYx zj#>*qlB|}fi*?k0-fQd*c5gLyXLsqSxqG_Xc-H+qEb4KuOZE=ydf33K?)MIKU10-s zJ19k|TkJwwj<;kufHECl9zq!k_bk~Fq&I=0J=ruEq_96QLBy?UZ?fC+g^rl5$6G8j z=r%xR0Y$8i?T2-zu?1P4t@HsyOq`%Z4xF83 zQ^V!)9cn00>Kn2B;|BPeF>2O`g@!y__h{@Yhi4|9d7dR1p@jW&-LPC*X*@Y4T@-ai zeQLG-P;}CUWZHfOWj*^R%n}KU;ZQ=lbmn3)LP@m27*S!kujRIrh2Tc%0v(`MI&<2X zSi+T6D6PDYFhqe8A_O^PZhG8ULlJ%?FHXtu5gKg9WKh451v>^X0PwJX0?XaT>7Y-O z769;NH{9n!H(nyp4V<$E|3jXVS@PKK0re!hn@rJlHJZB#+POLgFR1D$r(~n5k)%TI z;@7qX0iu~}WHu&E8@;CzhZOPF*~-+1}mT?>+g|7u$Dl|8U{OF`#3av8Q?L(0gtd-GZxg_dd^BWIV?!XsYflyOx4Qv=ipjKr~1bDA>*Ejw@p z!_fd+O(_|<4@F+9Y9ghU)z-`5BG7SnpSj4eAHX~=GfYL?h0zKoE(mM=@ur|G<<*Q& z3wxRRqt+d5nNrKo$-xBWW(d2@JvUjcxs{Al$M7)h@PQk{j4emLtmh1(AiK*L-2LiO zA+ZeJsOhZ+lr$8e0+=kgiY5I-y%qG(Vkd5tml>8wKB-P#Pt8m#s0qqxEfkkI#!QOi z7JJeOp4XbrCU31ey6IXo#N{|YH@IYJR6&s(D7f+|P8Rn5V7MP)KJOk{1zEu!{?iJM z2f}Fdj>bJAjpB-@-$(m;AUIb|>ELzkBw|n3(cApI)0F72RUty8yEA)_sXI6|99#go z^c*#yRhsQFQJ}OqgRzmh z=CX;@<0B{X2SIXV?ZnmkTKurvU#KEq#hp*zv;%h4shIjnR7tR5X$DCssfwHub*?$X z0!?wQ3|5bV;AAZh1uJI_akhqjPra_`SFO$kOVD>hiHlxYRp6v&(cz=BhP=ZznSvK@ z%u@jh<>j5`?FI~Z)Xk9?QyX~latP0Bq@kx0P8_QahHR7H!#RR_L|ig^l=MWEAzH^F zJ(N4Qtf^3oqKk)O4!|4-2d2SQRdX~7S^$o_gHu=tj=OaB-n~f&%$rDMh4Pz7 zdTQ(sbq!q$a)d^o}3U(s%*jeG}SxKi&g6xbHMiCUk~1#P;>6*&H?wU>AYM8ht{R z9=6}<9rRCz&~b>in;S)^1;7QD{Rj`V@CDRRQ2bT^&W^!ofyoI~&x@@}(k zg*KV@EmJ{G^xl^;km3h;0q_05nT0Y;yOt}eI+7dt=t>+{{*I;cR%S6}`26}+`4t?% z&y|up?VD2uh#pWi2;l9+dlFhZfsb`8nbLR(jFz8OZglnlRwSh5KXFt>d=<%^35N*m z3%numKhl6EW32n=Blwp$PlT%zbDm@EymJt-uPE7EZ_=oADIaL3cnQ(rend6zpe=?b zq~ZNCX!2JW`1mhQfumV5<~h}*T2~tIuXZ`s^{iVjokE;IOBOD`2bP}!@-pxW0~|c( zm2vlPa#giy;f@$uFLQGl-~5a4quH+b$v+XHJ*cXxgUq#|9-+}5 zr(TZjI#?DF&JP%nTnk>YX=Izy#uKxNu*!J_$SFEQc*e7+@h@kdkH$#B!!-EuaYo4f z<{ISg)yFICjip6Ojlsz;eO0VHIh<_vP6$67x|Y^j(YA}IYsz({}fybY$4}=?~Y*>HIp_gLxMn4yqi@{sEh8xZp{{= zXVTED5WJdpCG$!pDS9IoBWh{`uP}lrzDDo|b}a1j#I=@9cW^+8V%r37&-ktk)B!^E zNsgERZ5HLNkf6Jp3dzK^h!>H>l6oAVx%MbL2T}*Up32nOR-iv4V>x!HeodTndu!bViCR(TXru zD$1xRyBxyX#|x;UaE1yjIOq5mdqYB6fULCKJ>EO$Ubos_d!aiLV$1t*<%4q;NTNv0 z$U{xBe^(eyq|ZiGCgz$r=pnT&q-kGeT-5oQe#B)k)C3cu3eKE}j;)>9y*X5oLTPXb zM#m*GNqkwK;7}D1ySG0=nu~+2AspidjU!ng$m~|IA|5k@PaF2-{e{RB>_An~`Lw;U zxwN+0S$f#`=)=Z)cYgrSOQsD{d`aRUdmBf8KUx*aVCqVrugI<^e))KHaSOc(Dj{U# zg7JC5f3NLLgrW=znKAM5;OZPXNS|h*f&sYn4&0&U5{QU}?5H*m@UfE?Qn>eGGuxy( zXlGSyDO8WRsNhHp31!lMP#^Ek{xi!#CiIjiBBqiXemS_&dR%NEvc*)qc$XQGR55J7 z!Q%T>$i{_rl1l0vn!T*~zp{ZPsf~SCR)C~CdV0#VKp-fAvq}11%|$fnmthVqP%H4E zz6nItE@|9hXaG1#(@EoDDVcP&P&15n)iDuLQ2SGlE1jGw9buI!BlQirk#W?&g!F)r zN6Q(uu(7fBGZ8CY;$A(G+j(D=MU5L!7EVX!`pUMjGPrCm9NPP`ph0A-Z}7ZjRj%T} z#=;_k)AOk)T2QbN@gJJOb#q4Dpqdj%ySFvm!ZQb0)kgdsH{U8G`(mvTvs71gP4hK_ z1%lESgbNFi#oE`^U2}OgZ-3ap@kKI83V!Zig>jlNQ^CJ3eirr0v~aJ$87_JT+stKV zc!V2_(V9F!)Y14Lyr}tEy*%Kcs$YSlL_^UOI$6UwQQ?Kp6Yhx}#1ul0b%GM|F1KeG zBEGo%_#t3p2I$c)I%}(h7T(!t|Mc1DcZ-{nzy?U0gH)99v4UZGTIA>F;rnkT9CT z!KLDml0Dz~6polk-nvO2_Cr=Z#l=NGTJ)h9l`rK)3%Bg}HKsD{l_pwRlVoJQ8BjIQ>O|V9Z}$s%+g4MAQ>V%Sv*+5 zwJn-Om0u5n7aOfCk8qxDaUA`OB?O3iB9LOOM65XMf8kz-7T2(OBvE+rOav0=?3k%K z%Z&(WkC=5UE*x4^HeIvhXca8jk6D8rHEW%CX|*QpatR4ZiD%T`4sL$#JwCYo5hMqa zUB@rrU_%L7c*!WSK5r6DSBn>Hj zf>c;mIC7o20T85Cjs76!25Y8Zg$!�bl(HqYO$0W-H}klZ|YdrFZo)@*N_dT4(FC zbqF8LkG(qFnQVm9uQpvf9%VPSM%_NLKRx{!OWsLRr2qwCQrY+blzv+KN4@SyhPp5~ zSm}+P_BLT=gE^gkN*8Tab^CviI`6<|yEEqQOkkDWD?1KZc*Hy5BiW4eo{yhKqR1ad=j(L{j@mibW*HDXEYK5?(Z2Z0C+4hC6WphL$whpE7|YucJV z(pbz1d0jRMdFHcq(fC^dgjj8E)=N<}$o5ydz(Fr(a&_OlapuA_N~Sz@{sSlCB*H|j z5gU+m0THQp4pC5im`VkDPF)TFg~173w1ow)(tmBr?X^FJ!a*Dj_qs<8qIr5EI<9n| zbiiwusf6=HY78YB67W)~Z=3;kV8N4Jc~)u8xR}(V!k-jtQHhV3TBG(PW?6hFD(^=) zJ&>yE_fW=43S$AT$+^I9Hfe~Cm6gp~&Ey)JP*Pr!sZ7?3%YR?!wF7|4@VUlJdC<~G z(PYllSoYB1L2`Evi>~~S780#ANfap&21e|*3r$xvX|*w?6(EqNoshR(8sTd+4h3_v zcTN=@b4U*Ow#xtkZkfS?o5{+_wu=o4kL_%t&2kH>_$9;KMEm$qz9W(xlIe7t; z!UQ`QF@B!B>}k}AD>@#3F7YxJ?7)x&iD`iX*`4G`&LtzTN^n>~u|d@e-+A%uh49bf zRMLXH2&a~J;gz)m!xBOo;N;2QJA!f=uApWdMmjCOdEc{}ugL-zl1D4aKc=LL<1X45 zoJP0jX98BD%c30axkPh5Bj{Wq3#`4R++T4dAUQ|K+di zL`WGNwnXlopVz3i2fRxyo#R{Rnv;NqgFyG)gXOiwpNI~z1NWYV&*0$ju>JG65{GI< zr9b%8qwVGss&fksJj~r3rvFrX-Tdj}g^jklNKF52g$FEsN@1(2YOjMz@v`;4F%>R5 z(z8nox)zQD24|>W`3FquJ*Y-TLQh?ax=o^onRZ8EJt0K67cV+i0N z;Uwe+2arLu%^cFiBPs+2(mDqfDYXF|m%UH}8y)u=nQF&dp2#d5!6tdE4!B6u%7fif zz`O-doc7`;Yw~wxed{y%LFXAh`1#Tn|2kKl@KZf;c)hvVmUotyHs$a7#?q?%a1K0p z$$t8e9gKlBOnt({f8RrNh8yj>*t-fihsIhqTj z9q@WZf1N%5793>UjJ;@F8KWSE;DdhN^MVc@rPbhq-CG4~-8*>Lm!dh>ErM)l%5E)6 z!m?-s>0Klb30mKU+dAb4xTT48!AGK z#hrrQ-FNN=jr|l3BGz*&{|k+N_vG1}$R0O~?k3J7<*s?8OrgN{)4YHJ-wXZb!Rrt& zl`MugijEigJ=5E1K4+{l=q4wwp4< z-njV$xgtQ2W6uGY6Bu+IvF9ZTXXE6ke_ zZk$u+^~(MlehNZ(@}1`Ty~Tj`IXb)Wkcn7Iffp;Q@IOHmme%~({HMi*O4LQ68z%wd zRM|vnWa7_hw$^{bkBacZH*9-7c=BGfc(9ljM+|JRiZ?4r)jFNjpW(E+9&Nj<1>xyH z1TkS|&CqEG8R8Py1Z->Nso=E~$Jmt86KAp7GP??BSU;(;Oa@_HR!4{MN<>!Xlfp7V zVX7&RNt-y73+$boyu3}P)pT1kVQVkipKVRekpPoXbChg31eplSA_gPf9eZ}}o>c_* zoS5YlM>OdPgQ7GMG-ej10DGf|Tw%@S_0Egoi-aT5PXJj8Xxy9pTja=~U;!Y+4hCCZ zPEjobh39qT*jTG?quJ>F^IMF`4oe3rnifKDS{wDBTSo4u%+bwbbS1H--;u>T$3@P4 zDO`Xphpo$#?V1C7h2(*}Gx>>q6OPEJRI>sH7hAgHnXIl9|LOb|QNI3NVwA36?O z6)(p)RwnnW~+0RA6oQ)>mVsJ zJH58!-X9BtQutsh_sXI&hqa>4QRcXKeZdpxyrP`B_Phf#$g!xVf!-JUN2dopVjsFV z2)do|mTvId9hSLNBQu1*?9lsIS68pS>rh9H>8C3TbT=^e$`dy8^6 zrc-RHh^%!w?gXn%e_GJK{90Fv=#D<9UPI3a8S_?9Jc zO1S)rL@J-E?aXg~v?@9!2iasmWCY;418?m1W?&>Md>-qh^h4pBl@@Rogq-ar$q(c$ zsWqX`kt*{<)rE66-2vqA&C0+f3vEtLG69X8Ye6$bq_kvld0}%i z&g$m6CDB#;WmcT=R zQVH4pO^j-8_o>Jj$f)G$yCD6fS3HuoU6}n;uq(xx7m6i7DmM}>MQ&dV|wNO=#`Q*8@PN=Sq zJytxjTWf;f3MGvebnTGTqSe$_;9>j56$!a?K0zGMU(K#70yZ}OI?C^CLhe24EyLEf z^=veJDWgE5dMJ94Ok-gWA_|Jx$z6aY{sG&-TY00svi4~^iaF{mJlbk+bhg%h(q7%f zo^Cg{Mawwpi;cC%s9_R)($ch9YY+Yuz{gxaVnt%PbDv8~$mbKvMH5v5t_Z3;pQr5Iut>|Kck}bE8r9AQDv96E%v5<+|tRC)0N1P_KI{rswb|BnRvG^AKMuX9Wi!ot+n)!_iSqW6kX7 z*qt09-@wHu7Z1CBb_q|RvrAziUfxtF_9E;BmPC-FNb_~T8lViM1D<~4; z(ft@`!=%4Db{u(SU0p4Nc9I2$NpCRpA)Zw1N`b1uEva0^H#GdS%YfAe>q!k9BYT2{ zN|FZRoBe%cOCiS(!yi!CVgKo==ES?aZ4b5xdaj=mtj=?M1;MgdKMBHopgA!=Y&5x|8ug`&cmmNG3{-8Al*f+x z$2c>Qd9Wal$vYR7$0`d^5zK@o>O-CE*`mHMu}o#7zSDdtjDHxQdae4eI4R*HNWJ~* zR95FfW+}0Ee2u_PSs}-8wK-wx5sN|}0=4!?Z|P1%Y(YLe!-+Bp=7=c~eeY`O2IZM8 zHz`>l#~*m+eztBDKkJU+If2Ab(YB(xBishUqAaM<#Iu`#1u!AR&@w?8iff1SLjn*5 z1M2;7AzLNqD_j`6=svry?w!O~I8kpPMP`Cmv1mMzMo&aJ;xg8F+p!j?^f!fI}Y(p2B$f-?iDyzea~fH6_>d_S(AJ%X{AwM1`7MF zAyN%=kI8`wlU!CbUyAJn>4IKb?2j;x{kZ*epbykk-od|*x4XCha^d!$b#`{Xc<=Bw z{(E@%r1kN9{Os=SA106Ao_nkH@dqLtf3&l`^JMO=St?GP{(EIJ&9@JheeGuId6IQr({ZvEVE}|H3{~XHuC7OK}mggH=-RBtO?vEs%F>#Zl z9~yAjZ5g|G=V?XR?!ljYKd&qJM2T2f5I8FBMG`813X4tMEW&(~N_E{F51Evr~Y-JDh9teAgNFVaj5g8i0wC4@$I zN0NSiOl}7>qtQJYL!6ffiZ9*=oSkVw@>6I5wa^ow;aQgq{itz(1jP{6S<8E`i~8df z>i37e(LSwp<1@sEA6M8c!K&c0zMZV$nFYeL^)!98ELA6he~YodshA>McEzxe=p$1- zEHU0SIDD#fStW(_j-Ns*xDAncUjzd2aipC~IEm<~^BjOsD$}McLUoVkt1Gt0c$C5e z$}3#Q{LFq}s_(*)tqP}vGZJRiuS+2bSZxZuCGLO}TpfpmkA0z4Y0XJj7LuZi8uI~= z9^J?4Sd?xqyakt_5Y+cbykB)|2sso~1 z4~E06apr!h4q|QZ&skqSe0z*scgLs4BKv}UG-8VvY7u9$j!AcK=a z3kr2pe11r1EHvPtbc!Z~0+@;{+71KiDH>pQ4+48(7|}VHq9KK=>QF8KUqd-!g^~EP zH(?x;VC()})O#1bN*Qm~d|QJx7tP1R>(79M^oU4aN)U5#{s&7_#+CuNAZcGK52_qxVFm-Dp+e~Q8u^s0%7*1o; zOFI*qRsQ9?Mjc9Mn$RK*npmjS&I00MXc&N7Vl4fUVF!v51v`3G5LARLl+By9pVDLN;3i73?V5E6ie_x+0`^}X974HXYg`$wq7 zRf+u(V`-pM*Hit$MOB6Z#*);4#S!EY%9T_GCe$e{f9%NWG}&E!m%gWIzLHKS3`I$% zzOZ?Ae2A!1tl04j*jNWAJ8KfBgJb~X;SuayJ3icIXK8?=+&{1v{Czd(CXSS=FobI^aUW9-&}H4wf8U)A0~9H6`plGQ`XD7CXkr&F2mX?ujAS^<>Ja>0|3F$*8Y4!bf)2=jr(SsH7^aad|1Sq)j z1W(Y|DbiVceKULAzeHLo1xBt3L%m2eZYZ9HYPf@9ATWZrZo>9_6ByIIOk~ct`7eZx zIq-Egcs%@aVfZQ*hkr~=`1A2_(CH2KNeX?-T*0O@UH^WL9=@wH&7LM^0fGLAY1^Z@ z!g9~NDih{7U?vx-2qXW!XNxVRTGY9bA{$pKys7(9c!jCro8x`hlVvPT9^P-Qb3a}r zq?oV($7erID)AA1oL473ADGci^4{q3HuLwJPp-0c!FN~NqQ`F&o1N`8?!eY`GU_0% zsMm#FqkF6I1FXd?W0rwaI^tB19DKM}Se73Z(5`j}03;%$6LWw3{0vdsNF>!AARG8$ z;^d-k3*`!!!2Sg^w_Y&$-xJk5sYU+5RBp_HgS+a)+6AA23x^EU7V z7JX3^h2cj5U;>^FmTRR3@J`mk(xG{iS6t&FUpUo|*KJHU!7ykU)+X`Q=1F&CKE5d5 zRC=RrDSKGn$;m=~c+$`#KsjfR`4V3mb*?5ye*F%OI*r{xgzsxRb$Gpwwg|*&JHMO>977Gi+Zu!88=M@16>8IYqIV=I@O)%@S3LG4 zPaf*2VKm2dqZ03cTaBmipStwbY7m((wBWT zGn!qSPH1}16 z1N&dxX$VKjiSs5s$98|@=*n)R1-ydqC?t5W7~`1ilA77$r$S_-$Kr;!TOb?wz%32a z_`$(~{ekh^@1r@84ae5Ati+!oaRZ`m=TcDJqQ3zgn!bnQlkXZF!-h-{f`WHOT~JKe zyA@qJ@hrYq74|e=pb*6$nQqF#4Uq_{FHli-W2Zmp2ppv63P_#<;gLS=iCuJhOwoKi zcs>}ugg;$RkN>TPzt+=1oB&+VNYENwIkjqes|oq$CLePMtVW{b;+z8>*2^u>1&+LO znOZ&ZW^0{JIYrQQDT2+NFW-kG z*G$AGvS5+-hNwRaZU>CjTJmln=lEY}BbbeF4Soeo5mK?Xfd(!HPYJLR$r?K5!`S1T ze^z)C1{#k}`U4@h(zEZ#4?Z*PrS?3TwU;L(N=<;^oMhg8q?J@M3f7x?ylL%1GD2YjqKjs;hy$w_%U|FajdHzb@I|d5LnmqmB<~YI0+Gm-U zyJU9_vsYMW56c|vT!TrbTW)I6cQ?$GZq0%PADtjz?qzS3616$ONu(yVJw~k>BPp)~ zBt*$U!VLT%bMb^TEQupL7g?96XB7;`lIdODevMb%4jzbd(_0WrdsAQsF0fT~ zL!#Q8s$&u+(Hxh@rl-iCl5;>rAt3win4Zhqt7t zx9uHw`pV$Wx+UdNg<=FN27slJ9mbNIdUsqQycSQ04dYVd1Go#s*Wele=5$a1T5PA< z_P+)JZ9~7If=DMQxgjRnz3~w$&dVh#FO0zH%t#mpglYbyfw=>$FzRrXt9O*MmHW?- zGYucmnUp^cSUer35B?k?TBc_$icQ`9Mw=ZRMzr!25hpWEcG4M~9{U@7$T9Q|RQ<=7 z;~V3Sa9H|Nhb3>1J8J6J2M{dnE=A0zJ((E3MbzL^ zdq9Pv{WOEQev0@9ci)Et>JydN`3*8!@DFYr^#=A!2aAmYr38|WmymC`idOh3xdNHY z1H%EMEKRu+U=|F1f#Gu9#1%SDm+7oa?h|TO0df;@;k1y(jj?SPaFJNB)*KbsX5pI1 zvev+_>|QF!jLC=w^ylUx1Xr+~@B|Ws5I+;#7T*{r7%qMi;W!H+h@T>qKzgw0xMP^S z!ZZGRW@XMdvZo%-uURW!|4sb1~TaMT`r z-gZeH%MFM&N$BBK+V*AgQPUPevq{a-VP8$w=Z+`)C|Ct6U($=Ra#PsctF1b6zD-}Z z%*w*1IgnN)y3`p-nSJ3(L(y+FCc`Z7g#62GG0;EASSI8I{t+axr$GLl9`k{=I-QmF z)+cKZI~`>8L$vKd4}uc*6go-7-D+GcVq#6ghd#FPuGEZev^$SC;Un;{y}r?2M8e;P zVEK(=yHVVCLKRpa6=yt$P>nMU0Cv7@eF+ItWdoqXd@8ZEP!D0Wc9RqW0tB=gy~fJp z&8^1j+7<(QyJ-R^iRpuR?YJu+NAFwGC$-;dN~iGhorc?Xq+?}t`O3m)Y<>I!Alhg{`YhhdjIGdy!8nJ(NFz+Bh#c8W@W_W;bS@5P$pKPL?IRc(DwzSIhMCV} zJd}w*u{46Y0g+wD+yVwcvu~Z9j8^W^m0KFsv{dvNNYDVk8fr)RhoBt2hKKrufApV!4YjY~C{jDOd;`GHP6fe)of>zO z^Fa6ya5dySN6S&mTC`?9_~3))=EBPQa=SUBc{*$(#fJ$`+iMTK6BIVy|91Cp$sO$P z2o6oqX=!6K6BBp5iyVUlam7PK{Kx#Jp+KIcoq3?CQMgs2eG( zXX;Q5ZAMKskDF1cr~pikPV8>shA-JsGW5Y3h|QXgRbEkUsp7f<$*$z{4|z zxS)3lls=kF!Yma~1fpQ%(xyb9_#i4%4MvH8I!g~5A2Auw4**WoUZw4bZW&Qns{%(5 z8nGe5V~OV06#wRL#T;_p3IWY&R_FbMZ->vE5NH})%Xc2?dK62m(>Mgg4Fo6C)ZBmw z?*Uu$tOu9hxOwSsELI=z`qet*$|{<+bY}LvrfDnrN$>0>^bg=1X_}nslOMD2-cQgM z6~plk%}D_mz?(NxKyx@=Awwtpn%9hj&3$A#x&oss`orW)j;#(%C%7J^N8&OQRCv>Q z*{Rjj;)YKTn=?Pd!el7(f17?c=TgbYkjZxg|E)Y>Lz#Ht2`^)%oYt-iJ(grRtgu?t zaLJPfU9ipq4-QjnS4S(r<#}^q?{RLBU8WBigH~~2iQu-9cn>+3jPp#au!ui2(GE(s zmEL&VeTwLn$FPhH#e2B18w1)d#0>MincAqFF+P~G$aFA{K0{3kF&qyLAQE|j!cBH8 z!i+hk@ZfbJ}p&<0|sCbHdX8#KO3GN9Z-0D4GX%0gE#VwP=gpmaz89{%k&uD z^&8?i6ti&809g?$M@Du&0M!8#Ly{d{taIbY6jSiQNY>`21F!w=0Kg0p6tnFOsKBLm z;pCa5RC@2uyKm!M3N3SLM;RjSRNybxwwA07FF?D5m}fj9ObJa#Q~kO_3{mt(}KzO3}v3 z6tHm|G{K49!XU?=o%dJDY zq$-h+lNH|?&)mh)$(uiYynupE4^XoV6%?1(Hrwh;a*2UyFnQb{VE6oyx!QPNUVcf^ za;ejIdCR&~D4wLERRD{DiG)DE>yKBJE<3<9X@N-qG?_w%;|%=wU_pGYvRH7Uh+h@d zZ%XZIEx_{;U>VUzC~}F2LQ!FUS115%kw}yS-iU}7CnSG~`6dLnRvvuZxYw9(+-4>o zc|m$&E9KYUZp`|=@Cmx|AC$VioxEQ3Fq7}SfG5rmu2p~cZH&ivE7(HBut4WBvCkdi zY6^2lpZi=;*)|0jX^)3*F-}w-ZM?JV6M2X2u2^m>D6q1%(z9$DY!xBjdSx!eYbHke zEbr1-GD@;JcLl@4bS*`Zl2%1dT?A7KQC4CUP!vhfhOL7UaX|INNvL$sdQ!*D|5XQv8k`7c8@|Px) z@g(qH-WlA4sBYSq!06O$1pY)BAXHT7TO$ErquQw zBXKXi^ae~uovB~|U0FKNRha33cdk@cc-f7rN2o%r9oTp&t*}69EC(YVgPzj>Y_7HS$*}KP-@iCTo@bPUZAxyeP`NXr9!#)UNle%$ zYs0E5`A&M~IpcyI^KX9*(EwS9_+7`RRL ztrbOTyCHr{;|A)GWbIHTfcF9@jxZF%LA-9Yoy2H-;(FLxcqkXe53qf_MlNGZ2qU@ePS;wE0BzR(=oD=7N1{tJ6k->rdJnZPY=B`d{Yh zP*}>$OSLG6bqEuFDf~`?f#HLUYuJ{X@-`$UhK}QZa=iV^Jk`2ZPxVzLoIH+mP) z>xCv;-jbGnYP*+AI_V8N3VmOtS}O&t@SdPx-CQWmihFXdZArFCd&}y`M*W!O(V-@j zftQU{meqDD6GO&KoOs`MGc<%{Jc5TFVza|NFwu>jlbbph4=#RtY5vB`Wl_+F)Q64w zm^HS@#f2UyD8>lNBzgg1583BU=3a_nvv4KFBK6~B?NOOwpmSA1S2LC}(Q`yCoN74) zDS1kdpg$$@QV#8tB!0gwaTD1guCTD8P=XTS=auF zQ-j76pqfLaElRP8c$%v?L$mZk6@EUF(%x! zz#N8wymuEV^EF-{OX#Phb#0=C#W{cv_(s*sFf2~ zL^2bKO$_JczueCbI6s`u^Ih5F3R`6s8>s1fkCHuu81)o>+84Z{hd2*E4#@#*|4wF9NqKeW@ zSl;+0J$A`^@K@FMa2N}-6(WHWb6gO5sw%>;3Ryhef(*p_I%FB!0ylVFh2IMBj?Vs& zD!(*FuF>ahfTQEXFF(WiELtegC9GUmL=#=v$6`vmA4`B%E zS97sFT8(X6#Jj?YxNEa1 zt%40qE0ejr8KrjRpikAkuOC-z1`4GU<^{tzHLr;{?qOV|w`EloRw?aA#gg#38?7{l zr?SHL=y)M_7NwvQT)pm}Q@ja&C97Z^B@Iw01Q&*buKbjezV4ekiqnzaRO=+pW;O`q zlEAQ&wsdqz=W3>VWn0Bo%%6oe_-e5YHV*v_1S}C&92b|bNf?^perqlYZaB6)bAxj1h8Z+OYqfT$p%;Sf zSrqXzw7_02VnT$(+@-BLFIkp~;f`uOXWW*l3Q$;h4;B<^>Cejx zIwxx>D*4ifMapJYbX`-g5q1v2(_@Cfe_V?&a%ak7_4 zm7UKYpgfP|SJ_KGVTP{Yg@or+cT1~0xJ2IO&g{X7ART%v7u`t;7NOCPWzSQj8?R0k zW7YPMtZMpQgmt_>cUBH1AcsGYdMLzd@#(neF+8y&8;l}JYg$6f!&h{Ef(|M=K_xb@ ze1eESzOTr)|J>Q$oR@2A@*uCNAPXni;l4bKSnRb!;+9rZUx`cdIhCv5n>t#9ZQwz_ zv7;<<$XFFqB%nK`K;ig^woxb*@>K#O=q}ICAC88{)E)UO%c?vI&YFjg#sS_Y`y-*|39>gs}pPx-Mw9(`k7B8Ys(0qiWTWVRCsV(h3n7JSuwAQOW1%kDmZ1*9a5@5u?zY= zdU+z*CT<$*5NU^}`izY9UgsEiLChwq#U+~oP6U!DxSgm}1S1ta-g5J1#3`htQU3tm zONk1y8VLUe^6lGXur%Byu040kZvZm*9W+|IL{+pw!UW}JzLzBV{ z3$-Q=AuKo`mh({cWO8Ayo4ytTP_nz(w(t*O^xaKjC&#pN<3OIwmz8{ndn>fZD38Vm z(IeNYCL4C5Y4B0V)M6QPDkY#++FB$NK1Zww#mgEAog>s}1vfH3e)gJ#6?>4+p!T9aDS)mItj=ON`zVP0$2+l68QYBu;FU6PXj&g3I|PQVTeixt#$My-naxieEMw>9?0of5fwuYj>~4 zv}uUHY!rRGy12CzskI7xz(unHxpne@X=ndY4zN;gAd6&CB85mkT0~&zhYzz4^u%&p zEWwYny`?I>$Y{&Jw#uqkO>UL%%a%3=kdhLpvI;_E-5M;o~y2j1(8zE>F{NvEh~ zl2BcZ%6%01@$IYT$z3Yu1?&@{yPMKmj8bH=31nb1_%4&6bdi%0Sz6-P*cdTSjatqEV_4t7OV7fQVF=A_LRm*uf7F}^}S#ZVxIe$UbheF78#x?llOwYvRVUN zKo?bKuoJ$PUmjuN49UMl-(c7?Dv39N5KG;li|ZS3@}U;kTwhpRTK#cnb#1i`oYEZ7 z-BZVuzF^PovC|mNn)6TZfb0U?CZ%?hRfLF|zJ+2)M~CzCt~;~_Q-n9G%qj!G=*pjY z6y);#e5i2)I;g7q%py|e_74!^or$azMZYVA_Vw}v3nw;?3KfBHBk3)Y5WS!bazKqw zHz+|4dT=QniOR3Y9XSuZ8Sy-Az&Q^q#SEafwq}rWM6J<)8y=pvAVGBhvH{`+El*=k zz6hmvO(`lejjON=TpJqUN05xr7Fs|<+#YtCemJ?}?(88z)Hf-vfmUr4Zp!1+QO_r~ zmn6E*qc;UTLb~__QbzeSwZuo7Dz{47=b(Y!V2D#S#$HFL@tvL<9N^y}YG_6#sQI;o^Mi6%ACijP=ZTJfQWgz(A)JDshC zA3vdlYD|@hzQtYw!^0$|RZazx)TDvYJL*zty7ERbTD9>%fXL>v9Qa)=EkI#t)Wvco z#Ipg*@o??&gXMMyiG$XDCM#k=cB=Jqyw!HzvtJbYlc}3TwK0h}bbLHwBxQM{(U+nn z;Vf6%sU%JzKObm{Q_W1EH}I=VV-st`N(kP*MLys+}%;evoKbaDJOg(6V*F!JNJrI*l5(!%$y8YllWoOT4USrpR|{`8fk6-zu@7C=LB$!$GMrX3b`TP*ACt!<+GDos zCt3?!{$oiP;4xYlSn{y{q9ouh)Fh*D`f($m{8+XjIALwUy0Ngega~nL$aG_s zA&Bn@qWj%YRWhe&RZw%i0h?bf_lF^xti)upzz#?yN(Url7)6HF7g4fls>`eyS^;xTL;NS8fpC_ydaM;V zvrjAi$sS*g=fv6wkwG;|jAYUTo!1UWl-{J43=Qp7mk1Oe-(y(f0X-tT9iAD%L}I37 z7>RonX>I#j_lk_HhIb&Mkxmoi7BS=eygY6-|ERV7i=DTh z?7aQ)+#f+ImNC=0;8p|m!+zY^Twh*74db;=du4s=v&OIDyARvTODi3CaBMx^K*nCk zbHVt{-K{gv`>OElPlkcaa|R0LQt_=B>xrs^7T5C(W50M}afQZ^D@m^4l#g0S70w&C zobS8;5cP`j0IMl~Wrv01l)K7F^Jld6uoBXy!?)lj5nj0$po4a*(kpQ*Ond9zVP*h& zyGW0%{UKH9rgz{8)PE9&9sBk6@|R`H5d%O6-(0fa1()XSll{~tDq|a;=pHq z^s=`HV0!DFB#FlA@bLgim-nAB49-|zXHZ2v%;}_hg;&B#EDeIj*%@3}`z7S3oThEig#E;PF@Zh ztP?Z7iGu=#I$+fF=79%U86KdjCBhl$A2~*8i0%pW<4nKcnjOEdvk=*1)E_@TV|l*; zBoZ*=jqw@0Kaa6=QKxmv!+0Z|NS!oT|Dgjg35nx0dy~*EKGTa zG6POj^9p@+x5Ts5y)sh3_A9daWdfM1jg(y~L~K(fRy5d>p1L3D{y0Og&bW-4FLXQF~RjEcBDfPlfSlm87B=VMjB>}q7R9SqM*`q~BxAK!DQ!)xWloysqxD+f7 z)0si#m7zv?uWr1)bHS@gP=VLxHds(i*Bvmh;pf zw~vncFHq?%UQ_`E$E*ST!Puo;n+{!67OF39eMH(! zYblSzK~FZcJS_R#VMtcTu||9fXBbU4w>IFg11&N^52@TV%TWxY=7fPwN8KyMY_e2g zDD^Ov3HuCsuNNsASZqZ-e2IRw|pvZ7&mrEb^U z^D#3gx57?f=IoZxt#UX=?q1f$k^q{@V_Dp!dW*-TvUaja=inZ{TCxupmCTWW5labR zqje|p0ZjboD{}Ggfp%Zy^ry$&{!u|t|73VPe0p^D;+Z6%tkLx|3Pa^`WtXG>I!Fg4 zVc|c7`-*$pF~v*(EfONEK{JCaj&~t7H(!1IuSQo(`um$87Duin+G ze^al1pjZEvUj4CN{o8u=xAp4Z(X03L>fhC?KhdjyPp^K+tKV4X3%vNPjZrRMef@X! zJ-Pa8`{;puWMh0E!`ue}n_vF#v{0DmRNSpXCqpQEN5&oEu{^8%zCvx%X>;Edc z`fF?A6TbHwTTi+8?SH7R$;GR$|Lf>VGiNrJV@1m=}{*U!yncsZ#)qfvdz4|)7`i)I@ zMH-JUzWM5Z(y!#vtFLY6ddwGpXOBMR#W!DB8*=sP>;GL}w5$I^uYSfie`BEabLq@LRW82y z%C=vwUVZ(4>Q{30*Z+!Md?roUS90+WY<1=0)z@~=^gY7_f5wkqef@uH6L$6g=~ai% z{>sjNSH@(^D;KYR{ZHt7`pDn}F?(q6*Z-tGlB>V5wch8W-`PiU@y%Di*7xM<)vy1l z=;|NZiwFGbo3H*~eI!?}e*I5JSHHED?`hArmv&_*>X6U=%HW21a52PxR@;!PfAIh4 z#WQ_m$4jpM%2vM5N58XWlZ$V@vgMGgSHJ$}wGDmIu<4&`ga3j)va5elub%VSH(!0N zS4aBh--)ii`O0?USfBk%`pmBWWxX2k*>CK{AuoPwYb6)2er@0(SHH7E@Io6jRBl(c z(|@7Q3}cUY^*ckNV|`@w#;%Osoai%q^ORS=vEBV#+OTbsi*LTN6Cziyer?ODFWNS} z)CLWy%GK{|bHCuDZ@w~smaA94wiTDF-x(yGX&Z)Q?aGkiU*Z|%68y_O@F9#tA>mYH zlnR|_3@duZ(;z$ShEnxLcYnWs0Md?h*{3YxOx5%=$3Z~vJU|JJv!R!B5O|b zo$X(2&kHooKY8*F&KovPm`tyzfuWfhVtRlv55StUPyMVCZgktdj39ZG;r`fyTk79I z!MErW)^dYndZG$YoS#KC?6WQ-P06tCA|TQUt9IqJsZgN|4-b(tb+d;sH;B_rhsUEJ zJKQoYgGl&G2W-*}>%dp0xTrj{*riSAJ0#D@RHqEZs>oU4WBFAGgQX~f;FOUCugnWtxNxGPZIVD-_1(z(9!tH$ ztR>LQ&3oC6#A?g5B z_h^k;o)zg>m;o90*2V&SdfagIimiej!dkmCkuF34@~rr5z76hJ)a`|b)AKjPAd7S& z8H{hj=WL^KqX_jlD0)7Nv(kn*wTneO|D#4dR>4_(-g7qJH$y&LZw+{tAc*#$v3J%$ zmis7XbRWzR?yGkP8QSS72rLfE?Ny}r0=GMtlaQi7uwF=ke@Xuh2Z|@+Z%z(T;EqMck7DWL{87G4zuS-782ofKH43sNg!7PGBM5QjQ(2wNy$+ge!S z3>w_zHF%oIEp_M+V-nDTdg2E&g}j?tAp9a$xoaAs;!c6WCK#_&c^^9C*XYZcb1fp$ z#tR!EpM%h(485aTTn=#bhnhypK>!ATn^Q)ZRGZ3X4k^Q88YSoNEyzNv?Vs__+JirB zFXGR7dt+g1ZG*QQF}l@I!m-hYGv{h&qy4BRshFqn=Z*v2Zgw`?>kHDEFbIg#p&cSy z{NmiJ%>#%?z5M{#Qg!Oim?)F3&VkGX9E4DrVT4iO_@4~rA~frO37g`j80)%}B~-qK zNHVCNESYi&2fE{B2FXEexv^~>v~Wc^uubBTR;%NZ;zzT1t(C5P_(kTqKZA@_M~wI*{NZGz)zD$Y33)8UJ$G7N=C=7<-zvNFozL zU?ZTD+$uGJ8qGF8A3mVxdUzF>LahK=lHwGd;NrG2MW##Y?O*T=(s5iR)0Z2E7J>39IV#`!~z%Un4t8Rg#Bg2Pf z6RpJK+!zmFJMCOX z=MINAP&cL3Q!06t%q|+Ns{aTeH}&as&R?t)3yu5U@N~4Wzu$WS$4$q7fcR^_=Q%XZ z!OQQ$?M+~FlN1qU21Q5a6*L%Xv~)HBd5UFVSQl0yY;o25|^Hou@@CPzc+?okVDeQi@ zp;;=_G^Oh;fGXmV+Z7`*ZaY*G328{0UxKVebRsy<8TK(*Cbdl<6eC$v;_@q2i>!}^ zUz|Ov&sw_kum_$VdF^`#^41a=%0u{4RTSRxI1rQ9%B`+|nKCBJln;p2+<~r1lOARi z^C)%G0Q*2R_HB?wSQ!QF3aXx@TfYC=(w@z05E+6z^dL3xZOZwEPy8q zRmJy8`NFD0KtZcSLn6+py}%nedIBb*Dwj7HC*s&VIf3fl?`xPn-qoUAB<{H zaAoBv$=whUZ?>bF`PFWT7#; zh?j3QmNqxrTP=J5=;b5#52b~c+q|EB%I8a~i_4E6wh{f-LzMoDXD@E1-+t*^`m(XO zu!Ujmw7(#?fI@3l>ce%zzwMtdZMB#g#og5JT^!xDn#g2l=jXxUI|y-lcOty%IliD> z>>@mwql*2p4FzfLLUNsy=9wWph0jY^vMQ2TEf@5UBr=Ib{uNp{S0Gdj4^%&MF;pUU zAg8v5|14_2LkXp>Q1%QU=~ka>z-8B%ykrEWFf|chCF{d4AB_ zJAK+891dN>a$|`%?0NdRFGMd-aYEd8{3-YPgU`XK1<=%lBms}k7wYH;RjgS=1}cMz2BbP_QIl!Z zsVm{0u*o$9e?oMuRD}FAJf^hzTp>J~(a^U)>Oc_rbnPc?!R7LLoI*2W9&*YLM1auoD7tVv8C))YuM~n9AWl?0-75qw%G5OuA1(+ zjoN9hH(kzyNLM7=Av547ceSiZ1UgKNC(Qr_3m9$xaO zN1Fb)y3w*_MNL?UE(<41PE^sDs$in<7|t>cs7th|XI9i;6_)KYnON0G3ZHh%qm>Nd zRpJD-|I}(OFr{)|bt$3^d2?%END=n)T(j3`-u|ehRC`0KQ3297wDy4y-sNa~xW6>ygK9>&w*prY(L=cB-rSH6_(32L(Q zo)=uOy-rzA^M(tsm@EKOf0FV1fYLB;QGgmcCIDnJM0kqw&J_J%PL9Glb_u(*rs^Y0 z9;x>2U{5_?f2IX)L+J&t7JSfUTr9<(dxURbLGy@qMs1rkK)Y5T%b6&bfnInzgvop{FDglvMMT{_ zI+m#)mZ94>s{-`)t;jM4qV7Dynp|9_nUH(T%nYNn9s+;Y5>n`CXgQ9ymIRIznn<Tg7abfpK9gsT<6Y7%wV?G*U2c&Gq3j<)}v zE1EMh_T~yh8Vq^< ziX|uSg3Ck@j@MzdoowW@L%aV*I=)`SAW?!ov z73uFqN7aY_L%tH95BmqvNE|t@?f3q<{U(b6#pH1B&k={``!Eu2Z&hHy1P`aX@GxRN z|F6%#Dy&O+)P{l$%z@r7(#I82F3H^edgADiYw%s}bLGjvq&9xJGawI@gEY#BwOqz0 z#9%WmslI6M^Bdze@4+jOmngv+RbkCIv6wG(gK*2qnq{q})h(&VI^TFO93G*ft2SzV z5YEsI+n>nj5&WHz;ld*@fU{wIy0-Mt4@06Zo1gUH*2i3}M+b~LKX){a?WAmS(b234 zAj(+$C~PsB&-yo}>Yv~rv%Lj)yfEi`bR^PX8hRe{776dm93<4}(+nMi04o2c$!;BWNC^CsiFg`SiFDri0OJY6 z5`pQHT$n38!HmC^dFDf|s2*_9pZRjY!p@68fR|(?p+gxdmrpt)0Pa>=Ulto0+mzSa zmVH*ucGiVSRpR{xo(aiQp&vvqi4f;n5KSY!d)U_vRWZhd)53FnJFy4m`_|Km7%5TI z%m7G6%Fq`gM_D?T>i}X*`jX7TnEiCXj^V$EGLMsyBz3Dps)eX1yM$hEC*;c;FT6yR zpGWlndNWR&nHCa8kE^Qnl6t;9IO-0bvx?6G3(@&?lbL#5PLc#Kb_AWgKv0emy}h1x zZ%fj)yXXgau{8ELzaaYZzu7K+ zO{h0N;d|9cZo%u#)vR}1EElA-BI||d+uQfAFaFl+ITY`4P_IqGCC_xgWP%G)3Z6SJ zgfDzNY?ZhxrWWLA=%p_vJ(G~UE-W?Vgb5PodPNg0yT~tk+}}r3cam1$Pn`B{RTegNv zbml?^o^w8x>6)5SvhkF=P_oX<;j->LNsZnSq%?24f;)}$$l~_pHe|K5=%x`{Y-2jw zCc=~^ek~DrVHk3vCz#>SffMPx$Ya(Ff(tE^10Z?T-z-C5}wSBE}d28`&({e(h>KAysG`fc$ERI16$#J zg%VbsL@MAvyN^`kuvyu8cGK%OS9jgy)fuIHjwYR<0Ot-u-7!U>xpTRmwR0T zisyy{7P&^g_@Y`GnQEL zxfB_fS+oBbZY?1}#bqNLuiuvQWX?vL&QMBHCws;s*N%9BV{n=`bK~&}xDq%*f5oUs zGDS^Tap?ETTVA)Ot_%V*Mp5lG*tCvO9c>S9xA=*aOc3C@m^Imh#QEwa;V`nz7a~$2 zQgS!=J-t@QZ>BvGQW1Q+3cg#LAa_SSFItucT+s&APVEZyK1yR4#Ddy%`zKPdF3|uf z)HS*hDVa_I)QG-VKsCOJx*jTo0##aYZ^slV({fz{HNSx3NK0d0iB=~ilpfDp9QsRjImRDc=7WK z+Z5_5zJ|dkqP`h5K9^c&rhhX!Wpp@eGqiZ+g}04^j(Z=mMu!q!#i{N-ZMIG;I39gQ+STV^>2>Dz={_HoR0u zHRdujLsNy+Lx8N7x}8UT#R7gLQC@`cdu_t;eLBrFou)wTC5RL^VpBBt6DU;dfB@A_ zNKF|ilzin8V%coxJS9 zAhu7M%R)G=oMu_|>bY6^dy=Bk9SA)%<{ETFr1ygrt#834cn)r%j=?3diD~oYT7oxn zQ>LP;tdna(lCEZrxL^kuzKk{Nfy<@sN8);MTZ&E?_X3ZeZRACTpF%*)L7Src6U>cr6(cI!1nuW4LDiW~Jdup&f-IoAK7$q2_^D8VLmke)11!lot0~k| zl0rj!?o4pAfkQ4vUZxU=sgt~&Qm9me?X;+(LoE=(Qg>-j6@9t70!-H1ifoj+v`jl$ z>D^`t3J-J5$onR+YcF;Q;;PD|Zy+(N;syq+fesKap@xoR(}L_?i|FPo*J_@URn9)! z5)=xZcb1aX?$_jGy_iz?wV8-OzOGUCdkLbvI(*CoN1WdTs(dAK>BxxL<+aUrXKUfdsL2qlYhqVZPcL<^+7$Nyzh&_3&UUjvbum8U6_7=0>Jr}~ zUgA>^98-T8t;-BDNo6B6r}xUF^b8135L4>x>j^e);Sl7A6npja2yTLt+x8LO+*syo zQ8nosm36|2}l#}tPoVLq&%w3~n2SZ2}v~a?49Zq4) zetO&;J$DLJRyCC@e!YY96C2;SVN%dFlD6iJro!|ar)bD_7dzq7LBtz7fJI_PYF#B~;oEw0W~LbSsh!_$NSZ#7WSam7mJZ%y;1*X`5l>~jTSEuk zF&U0VKjWQ7rTO4%+81);okJt1QEJlUVdU^5{rje3e@=H2Ca+C2&dMsm!DDoSA;YnQ zP8_mUut>>mak#<*Q8CILw@@=-Dsn%a&J6S4x+U4xwkmT<9L=>m>`U4ZbmiC?kCwfF zq+?NJ8y*L&EzdJLKud*ie~>>~JnnPfKEf9MJs|LkFpxdZ4OHJftCk$cO$5|;M^hpF zoXNkSGLC&Tc4aqv-2ns->f3gyDC<4#jc`2{pGcx>XY)d(DE%OQdyZ*|T8j7meVCSx zc)<@OJYV11Q_W`{t-4~!smJkBKpjuc$2D2y|Ea**K@SZ|~ z-qNfQxJgLJZYiAVO@&f?O&xgEGvN){nmFG_qv0_ooOu47#9BTOfY^cr-vj3rDC@=V z#dMBBoN45&YaOhR65AbL^`X=IqCY-?H>!KbS^(LzJrD{zy=BbNoT_Pz3f7JlPY?Zt zj<)kLAk&l4x1=!`QmmqlYFw|)`@*V}rP<-mB}4(Mo%?D=!z%9!M77XU5(QX)qbAy?itmuYOqjhFBhZ*=!jn)X1nwV0iVIJ_95KwI}@I10on>|@op zLq`M`Zk#CZi69sU{bslQIJ5gYWazn)Mr`bQS2K>o+C&$LndU}+{QRr|X1qH%qiT^U zR@@XXwoI%S=2r>P;*H_wz0pXjINd>~j&;sikk{5Ts!|}d|Jpjn8JGl>Vi;nfVos@s z?vWsQD2U);<2hVB0fUPLbvx!>a_QD!aV00LoQ=HcH}U*ebzj|kI%D589s=65ciRB> zW{C+`s^s$z_(P8wl67(UCH#Gf7XuM9BU-#BaT(Ah#)b7y&S)@(Ch4Uh3K1t51*V!n zN$`${hcvv=Kj+)9LZNKh-~gI%4NY_2a|4u6bAajk^0=G`-}T~edLIsY=>k4djbP|S zyLHqEiQ}mNJpu&_9nx(S?czWW)&bfBoD!rCW3NZUaWA?xhgFOw0NRKN`JwS))`q;n zk=@hW-YzYKUw)f~-xeq5O*b6Q&CN{aHH*Yu-D4wnZLsecQa%Z2825+A$K6G+_x%Hu zl;BIsH3+v*R7hv-+Io9hn>Glp!|5q*IdR|gjHBK$5XaW2+dl$SM^bq<@Pw;ljkPgwqe=xOkQXvY^b0Qb|6 z;Gw9B&w+}YQEX9`J3tup=gewR>=*3x?8{O2#Zr6G++rR zcV%Ct;cM$_Kf?@onz4?b%PXa&C>{-mwunX02)Edui?p@M_Qp9lWrMwy{`N=pCnar^ zD}Q3A%b%3WD*zF+9bxxPoY39?k&l#@f=NE$cJ)}1rD%Z~21vvTGr&p+jZC(%XM}bY z7+}PF);|QYE%Y7hl$xx>E~iz`2xd@)XFWuIy1GOb&zj(p46KW5Q~+VFkz32!#xoQj zw_U$y6F%~rR(;0@!&Syr!k`%-V#_COkDq8z^yMp(?9ZIrAOE3ofW3|G09hG5`8H}A zj|SANu>DxM3jK_~Qq)HDb|DiGWWCYwXcGzd_L0^M37;>K94TlKug6=#3uh0GhWpPw zH*lWhb>4GIW>M_-kDeZb&d$ud^-fZ^dugzLbb6rqo+@!~BD7tJG-lnrvjI%gXIKi@ zkwY?vFS-z_f-do(|9Sra3J8_85{JM$NQj<&VD=&r^bQ(eC6OX&Z`9p?-a8pjl*C3h zjMmMuWJJ0rHTwXA_MkH)Hf-3_`&QAfuWLn#4gc)nyXiyu(lz@7*X&i-ekwTF0WEK| zfBJZ7LsB%`&(0c3;xbFK6)22;$|DU+#mTz@e+|p(A{b1!8*II!emL}jyRSSoWM8pD zWo-%liQFoLsL=965JqQGKy)uTM4)J-XX(kx#2o*<)rV$l2s|*ml|DV&Zo*pAe3F@y zq-Xc6Leafffsk|MK)@50m~ zu9dCi(NY%7zo568F3eGeCy8wIfpkayqcrFBva^dU|8{e)hthmtEx^$X>ax(3JXEw} z)PyD3m+wJWl#Nho9%s=>8ODM$i0*d^Q%ox$02KkZpCbU>54WWH6icTreAw)T5#`{e z!}THjNnjw48g|nmKcK6j=jakmgcb1+AO}p2)xzLlg$b26AzO1WnLt(;M$Bejq=_&L ziYk7wf>`}Rj1Sde?|i?h)GT#To6+}z%v zw~9xMDv_8KTI_ux>Z%ihtw4jl#c?2MxGbr>A@4%FrywutHB+FH0)$4+D+*Y^CZ>;* zme+8gmvmS`&VYS}l%Uq_E)^)#c7W)eqJ`oU5xu;yNJLoaiHj^q40OUae}4YK^4j80 zI$NKuw>#?#8-T@6+M7$8od+9;8UbQU`y>AS*r9KEUO;>@GJ~Z zR);u2cLoIA*=^9M>&a9c&qt_6F1h9mfH@jVff2qJ5mK0&%)RAY?5SYoHU@JSs1OFD z7Gsr2IP>V_lshz#P;Gzvaui#8;_`V~#AOqBS5PIrt?(G70fq*W0s7nL4zMJU>H<13 z?u`p^-^Z<8P23t?M3t3mveL;c1$T8I*>@<;DVR&#h zNxTH=rGO||_BB7r81n4?GcnfLLs-XqjeGNU#n;UXjXz1SMP#JxQZOWj%nYbCU`;q> zNdsjNT64dYCKw;)-yI9>V(9@1L5t!6ruGlL|F=Cxea#3l!LK2Npo!wOzUkMt>IF_9 z$eaOMNq8ND?N|w7L9C;w$n=~3cnvm9$W1SfdM7bMu6RtytG+2bbo{cO3Dhl)AlA;Q=bM}$QiEn#7aJbt*8%!g_@2|r5Y7})|)kg_`94Mapm zQ-ESw4{^;IKBTt`&ogvA&=-X-?|}Ew*e45-5-)@nI23yR^IxS9zs7UY5&m(1P?`e1cjE*&y5?YW##@|tLkWZ{WIdUCrLs0WcrV!f#;2HOT zH>5s-AOHcXa~e|Sx73;pGswlIwh0R%#wSSAW(3!DH_Nw-o>ZX~4O>JRYr(27Tzd91 z2PBs|pTeYTb{qT3JfC!BF!*qS2~|NsRK;Suu$8o=o`kQ+S_ONr%)!G^3$R+4XgK%r zXfH!Qu=BxgTDR$y`G@`iI@xCD&A~H0GG}K`MPvvo6-8XlQH>Hn$iYLMB%HN77cUx* zUt}D6E$r%c80#JkqQDt$9a2D`+lfpu==53|Zk;QP!D-;-`|@&GD?9bD^%SVX3)#Kv zGL3=dNBnwkJZ>Z9yRiBd)05o2ZabM^hl0Ohb$k^=R`r##RqM4q)Y{9NZKVTbqB17= zf+V}tNZjB2E91h?Df4H4d?Xf zuCA`PuBxssZXn|=XC6>4Ui^kHv_fRDLugIrY2zvnY@LuZB}IMmYf+4CtMc}Tf(vh9 zpLZ`f{7V@P&nuURTB%5us_F{dB!-0d?j-T82`4lwpaV7^*(uU$fD{4ySv=e1Cf6s) zkWpVzvO*>^X__h*^usN2g~@C$?`WI-bKY@d&}?*rNp?C36Hun~y-k`2*h^gdQEl~! zbj4*cbM?_D^d{}7hIH)ocDj&0Hn1nDLyOv5haYRy2H1gxu?T)rP#`T;-|S>aE#x8E zbn!9Vp{d*>=g8vBZ9rK7v-pys21V65*K7zTJPHon*|#7E+UITCR%mDr9XK!DPO(wZ zVl5P0r!Nf+VFn#bB@$6KviNnEin2MHW1$NJ=d*bO!o!pjxhy=M(2sKDFYYw`MKpTH zm=IE$Tf=#Kx^{-d!3(5r|2W=zjf(s~&v8MvRsAiM@va^x=sE-kqYTPmCa|!O3+rL3 zyRq#l%=&qiF1b7R^-j*KmCwh}3-;G3{z54B^rpI0vNY+=y`A?Tt;n$6#92M$&CfutqA((!mk~tQ(t; z?&=TZD{c+#_oJQN;oAD+{1@Ck`N%@kXv>BSNXZ-q!4>*0{FT^QsyW}|U3r5W8iKh2 zikh6-2=0gUe`g|<`~bGv0|JUS@PEsO^rEgavbe4(cF6SU{fb+YuI``!4GGFQ4(Y-k z11Gn;$b?OL)5L*Bp(uYf6kBy5Wl=hx3P?45Ag1~Huux&x`yFH7Bt3kE}+R;IE327r)n`G2%OdpiFd9n%B2BKByMvO_y z{@J2HI9rG@#7$0fFs_BS%-Jx_rVtqd06qb$1Z;MwTGa!H7(W7SC`bH@{nv6*t z^ifqu0!>74&67F8B+?(Kz-HTaK}n>HGs^-jQy2VGYSPE#EF!jqSgjP>Q7B#(#YX4@!EUEBNLp-+Uy5kde-VNq(3Osy5@? zG=E1I8xi`f5)%pnYsr_FAc_4B6Epzm?KJmi5t-(wrNFG4yrTt%5vfZ&Iqh5I8XLu0 zcNaU8l`L{fx~ustkyF0GRg52za8wxKs15_@Hy_f`HI+Q8z!IKj#e72XO9vH`acX?O_+})|d#$+(^|`k^^Ry@%C<}=7QPk zxN&ZIh(ybndYE8t5NG-Rob|E~?rf>$=`XUIH~)Nj_4b~mzn~JpSSsiVG#wwkJbg!d zb)GAoafHi}R+Hv^C{|OI#3koXBn1Zt?ytw~Eqb^rK=XHCpHRCpLx=xq3J-qVPmlOG z}_YGih1 zh$vL$07UUUuae7c7{4si+4E4M5sFAO$T!U~dU!oK!&$ZVSMOU)ukUxp6+0w*TyJ_`pDg@o{Je9nFyx7!D!qHu39kF)DUyLNn>3O<~VkZQ0&V(qabIDvH zNtIb&_dG7L|7>^rw!Ny}J))-V?^-q5Ja8SQl5^JI(YKq!t&RC0a{Vw}n3}SWs{;H- zN05!`Zj_s&bjx%9e(_vvT&jXYmUj z_^x6UfhYB?wE)g}+HCdSy?gqcTFML})2j3&G@SdXx%w~a`Q19Kqo!g?6i>TUpkX8@ z;X=p<^-)+LsGV`)S3OI}1@0MU6sNQ?o+nkyaIlI?8wY=dy(e;oHs$9_{*5$q{c0_j z$i1r{o=&H{&sVrO{bd+KF#9993o_-I(@+%ym2hCVB_VwdJvXu3;rP3SU2Z%<$tGO~ zV`Y`{AbrOic=S#0Dg14|1m&&cItX723xl7O<{^N`mq?PlI{IP!dNp#@U2AcAHhG1l z5OK<2Hraf@jURd1nopS6(->xHExqhDi$|3`f7Q1Pak!BLeda4nJcZ(a90n4yFa5KGJNt# zpNk-MWbkZ~sP@wT*c3)$i#w@^Ew6Ja++t?c7Lf?s|7XV%&e;tfSTtq+>AAuERiGsjIjN%1p8V2RgJQpBt$^c&;DaYl>T2`OLtJ1&%5o*uu~R z0;FkT%DXFK-_a=(-Q z02}`D{v94Mmc2;YPwZ6^z7Sk7ft`h+jMwx zUUcRtOm?g7IkS)UUZ0;%FJ5CY&R<~zdvSHB&WD*}<8b)%@mS709d2I0Ycn~q2I;v% za&t%a9fU3ZgUTG84RFB&(v)#4H>uvlnJi`7?|bWg|J}iSLU|{SWX-@nzlJP8opYWB zJ(mKZKfOe34oAn%KE8U1J;IBZgUJk+HgPA96J(e@uKykJ_QH?H=dVyFQ#{2tof=(A z#yd=XY8rZl)yJG2%y`A>HR;uF@+(|&=&$(tlTQGEZaI>BT0~Iz`nU1x|K!*6&z-&{ zga$mupc!w-Ji3B0BZmCSYb$5(I;^~^PHB?6*pHLhk@k>Y zz&4{$yni3}#UR&k<&(qRPq1&X@Ax5k@FzK?(<8>uWXA8tZ?cLzGRSv7t;6>U$A6M z`U?pcW?6i$ z<1#sa-(+@rXq4gKVGGLbf(Mm&;x(Dzw5`A^GOq7O;+QZo)9KPXjDLUx&POOcQy-cI zb|(YuFYr>YneJdz@2V+Kx%bWHK2lfVq-9ouC!pxR`UI&=d=WC5QaaOycy}K?+g|6s zo~>lNuRFPA$CDh02BLJ<;)lST_kcbrpa?TQEY<|8RBVWZi4#pUW?&w7IxO9HoqfZY z$R9URI(z?U|MBk5H~jI{&i;-;ST3ExdBf;_<`~%#MR==*3?pxED0Wk%E^iqt`Uv!^ zDrQ|(RzOVsg-CqUzG>4a$eqke8_7F?_rvC0^+jr&+!pPfps!Qg2e$CC1J1nRuX}O8 zV~vq18WG6J9W8TR!T(0sL#R?LuMUeEG6l{rG^SZJ45MjM#=3UI+zpj=U{I2A+8`tL z$^$aKnSy?ZPB?=@jTZXI6R}qiR=er`cH-kmHwYi0IHr`d1bBc0!1+JokYY|tF+Ye~ zuqSpf#g!H=UdI9@=0k~ONEI|PKSbC5 zP_8a-3#sTxs1!tptwdrQ$$G+bNLgGr78dR|Rc#^$B<3^$FXM}&|G1t?L6DY@*3fF? z0psewB%{_k)FWrnn)&d*{#{Yj%y}_eT z?kxY;83yNq8eVsbHq)7kvv8UOWepb413jX4lVQLn0K1>=0(Y z$_weHL=_O2X9y0U0a`VWr~CKC70wb8cPRbhGA5(6e=s2|WRhe^UFOKJvXbz|R+CE} z#B2sE0>=E_3V}h6uE0_U@te#q3Bzg{l`!;K<~0%d7nkE+w@ngqnzH0-G$WM7>^Yqh z@;|NK`}Ko6tB1RXFMoY!`I8y<4*ko7m$J`5F2GuKCmS5#Qe9B;|24$py zNlaOE3V<@YX?1TW{O-pd=TcN9OIUUOS2WSicK2mr=0qr znRVpHttLt&!&p=_oZ@hBvHz=T!LkXkvvDf1K(g^MFeQo8!DO{|9%THhp$f=8C)?ZhyjZCk~PMI2?y4wVjqUuD_ zQI~K5!VA`;h1A3%Krwx?;?@9tBa8J!7ftL*Is%udAkTetgiU_sfWn3nyyQ3XQ7u05 zs?8T5Iz8wF3Xo2p1&Qjw{oHvFzE9BBawEf)1(tBXY-q&WWUQVJnq{cGS5Yux>&Lc& zhZ~};)e_IsRG53x64G^_mI8b%Hzh~IIe}M!q^=A=qgv_5eNo;HeyBp*OYJXN}GUtq3yq&Vlot3t@|PGT%c=kNoO)Y7Y4~KSDA!6?o=Oy zu2h~9mc#kUHBn%roTNE4l`41~IHep4Gv!@)aANe+P7JOILS_66vJ`Zh4{x?&D7 zF}$m{Mp(~uv~U5XR%;}X*+LWivl&OaDhH{r#*Cco7hOOeeNcte0gL8n_rac>~{m`O0k5#SnPx&P>w?o6fpScRT>av3kC$4P6P zlxM&ozpx%szO>lFNP7tCIe0iI?tm?4$9ljD&US;;wIuCDYSty{Pg&0+RZz9Q{8ciypeG6+QeIOJ0C*0Sq^)e@?--oN_ zkRx}3M6KD?cyz*4&+l2s0hvN*Gqo!M&XC6jl4b&^bu=3wb@>Nmiu{1v0}vR&CXM~; zi4d-PsMeoLeB~0H7G@-&9^&S1R^^mxo8j0mC153R-@AZDQUr-uuJ?Jw>!0Y3%i998 z;cPS05ozyHI)@Nl^pCY`crH&)Wg455p;3DE8N!LrHAy_gB|}FLu4Nc#Q)_D!!VYQG z`1?fCX|NHJvLPKXZZdaUWsOw$$iBB}%f~6xiLWJe)*Y4(41K6*Lyry%F+P&}dW+7J z?pdXlQPaj*#tqn9S@Ev>GHga7UlF7sk9BNPBMZkit2+BFLPYIo z^MWb)>qt>~-)du5?v6pim|jaRd4o7`gd9O$6rXLY&cMqb92ojk z@rZ6pe-yX<4IxuhnoGw&RS>`d;~fRzde^MYIBsruyU|nsN+y(VIprq}kk`+v`RL`& zh5N2Cx6lC-AeZ6_AZXz}EAEnhahv#Uj;27V=2Wo%)~8H_-sM2aJ1GXi(lHlqytjS>Yd&Z)^N0mDsYbjnx zp4|6$22))2_TqvkGOk{tFl_8=^?ObiZJr~`3%jigzRYvH(LE*>*ht*)f;U*1bbj$a zshj*EpMI!Lu=z(=_{s8fYJy{A1Tf2;CuPKYB3&+H6x70zT+-*C^BwLZhgSpIUf&<< zw_gr^i%_R9AHTu$V0&vp7OIJkmJz{oREUAM_zIo zIBLMd>(yq`s|&dPhbbXIT9z9Q|A0_yWuX#hfqob(v&f+MoAW|-Z5BA}uk|Nmci!Z*v zJNW*CFTgbU=|iA&N224Bae}=MzbNGFjx&oWn*`E&89=SxR1c`ZKUOg9e+- za9uaA?GjgL%bo3BRT!!wvLHpPYvghj6m$#!4Gzah%WQ^H@?I6r*65xn-8ArD#k3F} zI7xZs8$0X%rv|n&aHaD?H~w}`W9M`Wk)BH!yvMly^y1hZ=i>7S`4e*Z9-t~N?%!{_ z+aY+8*{#ZkF?7y#9xxwhJ%WQ3-1NfA8(?*O5e8S(B|KI89RIrV+-p*jM3J%a$XFJy z6Ak=Mh+Kxj6sjPn?p!(!vvn^O#cCP##;DUbHz#*cFGDsr9usmJ%=TIj6$)DB&>_yS z3Gkpp@RS5W#NmlqTfV>V#zM*cUw{NNTz>~7n1Sgai8c+^9p+mZ>9OJ@fijnHuN(5| z3nU|N-q|ADH6FtJW_XboJiv4ZA*_X|T$jI(&Lw3o=jcRIY&%ya80R$DkbiDXlyZ+| zJykipCLpUy%t|hYYli;PFdpmRayBYse=>a z%T8xs-q_h&&J$SBvr%cXKzBjD%diTmRaKRZH!n_MTKf!vDSM7B6I=1MV~Vj){2v#g zBhR~?aw6rx;gDsrOl`DP_p-o$((MZM)yAig{!$f+YT$-e z=}#Rwl?rfX$pX9AcrfNk6E2wukizc0yxPJ<@f#!BuVb+|#yhyWdvrCu+$4{B<6X`} zTg%TSAs(tbSyAJ!Ru7pe#6n4#{!YdH-y{N4jegiEfh6JbF3ZpbQ3jBkV*qd|6z2q4 zxG=!gm|LQ3vT0J5AvBWtr>1M<1GW1TQUYI*SL<*UK3X1u;G_kl}ZW0!e-T(zdr zBplJx_|w*Nxn9x0ia1R@&ckV2H*}CH_9o^dY67M~Mce3wE4zm+ovqEIwx%&-q~W=z^$Fqy`0q20r*#%$udb2dhg6IN5gYYx9f+UGDQN zhsin?e9^>}&E&4`Anq)|T*~7xY`N#98{gevGRh*8NhoQ}BfONwNK?3j_&TRSGek|x z=&wC!`xw6~XZ}7gEC(XWVg8#TSZ9E&cJN+J==L{!xTI_G*^01$yI6=>pU6+CK@8HC z|2ooszD#LLC<^=xfM^08PYIxO_JE=bJ+2M`z)3PEbQ#YFP?6d{XgCLrg+U#@7kN! zXXljmic$B99<4GDn_(KcGcbUxQ-4u&V;U(IPIs&pJpUYPVH&#isSZ#k+A=>Zcc3k_ z8+7EvGo@4A7>)F?G+6m(7?mr3;s5*zfigU>YWwp03wcO_Wz>j=JyzyBe!aH4xd!^znOIi>2)d9zl_d|-_wGAFedI7q77r%i#LW*o zQvjoolLx=ky_pI+v3YG6_lS575#dA?uq(v2;c!ZmkX|~I(4yAs!<|R%)(-LqD7=<> zb5wGqhbU`#`P#h>mJn5_@iae?i8h-wJ*>QEn0F`QqXS_yZfq`<_g;zP#w;aONok$c z1)``0FuGK8@=1M{0TSUJAhd6)aZ*w=(s8a)>%|y0>>z8owj#WbuP=EcT^_{ORsAT- z_Fh&wC0BB3!i#TGHJa7HioAhqCObQp=}>%d$iB#mU5{fpVil>1Kf;JP3)waUHer+j zKZ1^hdS$8aqXy43J3*N0ee3B&mU`vwrgL3b+2$rq@g^H@D~KhEw|PfyT$79;$A~zP zv7P_VBj-@zR!>I<_)CoZi1WoCXtfA$Eh(I9)OKbd{hrb`LOEm*UN(sVE zWRgI{I+QHo^%YyIgD9}Fe@PK#2YoyxB2s6ff>VzI9YD3)bq281*1p9>1{=da9);+V zR2YH&$Jr>JD~3qOQrhQPB$kg%Wi;%5Q?Xq>6cD zWfqcQk++G(>DIPEcY(fKj%Og!DSB|0yMBNSqn~4EQWOUbBp!T*r=w@ zbPZf1IkNFDtpxgWl@``6FGsI;F3w)VqA_Z>H`~|e&&QYTSJ){O_L9aL<{QI0kCx#S z%<-<>B(vw^Xf=_>3+*Wez0PP`forlsXqG0pZ6jo03Dm=#-VRwZU+FQ_3`$O`JWc(z}zJ_0G#qQ=K{UC zF+?3^c&+-!4IRw^{*Ie(q{kwv-)o%@JJs-gOyB=7P>+=pEvtBYBE64+CUY^~tE|?c;J|9FN_m=G0B@7oTDbHhuYru;xWwiHoxCs}l;^H_Q9^fH* zM2h=vwaJG&aOUY`yf-?3b%xBn>a31*5SmthciO`T^e*nFsV<4xyGAn4>Dl%4T4vQ( z8lXFMNPBuztCKIcJwXWzMQptC_&d*-Q)BYq%}4nNd_5Yh*NniM&)Mv1eQ%_B=Sk=C z1gLEDa_~Kh5Hyd(v?>blK#S?h&pt;rfmA8W>kEVizhMI&Kb12k*)iRi($mXsK^P=@ z!(n&-K4zR>doSgyjFnAAZqU#xL?S29|}GTxE*h`(p=m>B|FI0+V(Q@I#7>~Sp67C|Gmla z+kphd4)O|D6~(b{sF3y6lh!@4!zu^jrO&mClPA0|b`M@7)~CRpDePhtiv-luQ7ZI6 zu4jEft&Zz6R;-c$ERj%T5-nM}Pa_meMV~+@Q7!1Eni<5JnJ&-2^lMS9p;8j}?EFNh zp-J&<4l6XTeZ3JQ#ZtQFi*8u6dYd(?v1`)4Wc8r1G@%twV@1Mp68;M1qoHZj?%2#O z6x@_U2k_2YHTS&9ljWA=d%`T(kCRDwu-SZ2Hm#?XF+#7rl%P*e`FUk_Gi2C3`N9%= z?ZULaQUY#?rbtr8E>f2glPYK;9v2C?RKZV2wa(QQU%P>%8S{&S?u-u*3&KIvoikx6sHU<%^sSx27*9#|ba1DM4_1$~`QvsU3{21}`Q* zg42{De|2(q@B&rWe#M#$#;(pcLC(_Gq?aSATr<8-+P` zmKB%Y3GQJzw!5)VMJBd-F!=a0IQLO}+4F)eqGqRt^QR96pYj}&s)4#37PyPAA-n3B4P`vLb`#>WiIwlP}PD=_2WSRGyJ&{5YC0=k? z0A{IH#8f14~4Zj?u!$ zfWlJKZ6QHkR*FcX$mM&K?z`YD(94NzozG%To?}PN8XNW#{2^Ji*U0!dJH9?M&F8vSZyWVVa#P$!O+CGK zE35$ibB803-;6J*G#s(Dq&dP}GYB#8inP_-8kBdAZTjfN7{A;;q0xa%Hp&>^O~tR5 zlA=5K)$BXyGODsPe(n()xcRubf1g*W!MD4%j|{L!TWen(JznG0?q9EMZEhSr+WaG& zRqzEr+WZQ!M~9A~N81RcL23J?KZI$Cn`*}mp$&KxOK}TaccvWpmi+f#h^9>miC+AM z+_lRW*SrEYF}Bi57b9_1105X06=O7T3#v#REM=K0Jw0F{k2x%I0~sg*P)D)1iV$vN z@>WYCw4fDolD@ymA_a3vb(qoF)zZJcI7jgJSkzemJ>0AI*O75-fHrrzrU6`U-1-vKCb2=6bL;IBf5?c#`v7^`;a>)PkaQAn*8c z+57v89QgErV`!zM@3xD#cZT9zjj6h`IUk?VBHy1rgGRob9RpY%xM89d=VIm%9$cXY zGLEQQHT!&h%IbsPeekC{tE&&bI9U7m|NrjbPyAn8F^0$T;Eun!bBCMFl_QEB8$iuu z!e{^WfqDK4YmEZN`1Co!5*t)&wn(K*hf~XlxEo`{bNaKry?^AqmmC+#Xk?W9`DW!!$^T%ku_=MMZVnAqL#QFNe6Zj_Zzm=*_h%Gm5W&pPij*viv`cB5aSa$ zUlQLP>*+IjKI7V`7yYNv*$=CsvziB1|Jh%Hx+b(s?+hq&Ry%_UGa6LD??L??zOUg+ z1Iu}6-~tWZSvj&Uc#w~IQ{^4k36x}|B&%)Y; zry?$#-^XXC_wOG&+riNzeSRhm3-)X66vOAESKa%HZ4u!EI*;S=?}JZiE~7_Z;etkb zWB}17vVZ3EaZ0N|7J3PL#RBp`OiOBE%isd`7+6C*&qcV(i=g}>F`Nd$)g3G`Gd&%7V{#Uc_ zDfHO~abQ377Cbn4n5L`!zM8&r_>FdLHkgd9?*ySH9tx!@Ngdr=kxSWeM;yD0gq$8M z>iZJ;PG6R=YEgSm33DtdOkVnKAOn_be#3!c&6A{?Pyz|P6?$ojLrkCl zJDeOgI!A#TK7@2U61>Id_vJaynun)Lc4=S&8Tte!iMN0tT9m+@43}15hI3Ui=+uzt z^d{gjSQB_Y?*fmf5qS58%j!UmE(-R_x-ugCH_C~uYA4_`d@worSgYL${rR=>wj;u& z2*T5z4C9Y;&b3oong^GVb6jJT9sBY5%& zK^%DGW)XoH=tWlm&bsM~3y1^|`m5_J6w|^@r=;N6N8j zdP`0IPH&%W?+vvrBS9vj!^k3vMPAOC0{#3UNM25YFJ*!@3vobl0{gpbdY?O>9qv9_ zTOSr6&aVKpF7gAPQc*7+)TZ5d^$kJvw?a+<%M{b4SoElNqi;fgb}g5lCb> zj|M+YaAFWTQtt?4ssF)m?|n*}e0cP15AKhR;nUqA4*m@{pz##``}e`iTjLj_WvX$uaWR8`iPi7$T)v8-6JtA8sS*&7uT7o8tlGUK9IO{2A zO`&@n=n4*ieG8PAmlmKh0R413_B~ZZBExnf+ZhDYiBp15SyY zSM0Nv$US(IcnWo<&LsYGpy`gpTi3CN%(@6&0Gc4G7<_j@s!9&(&(Zr zB%K=lKolswi6kgVkH>wpq-%h%uChh|Xfo>!-?Q3UcGV?7Zun|jJVxeA%dTIaMqm!r zKbbrzTP0D8T|7dStP|(9iJjL>WYe$p!?*a#z~GUVmm`KMPa;L|F_uao<|~<*>W35LEtl{JirusVG0H;>ugIxl zlK!4ZB;|VJggLPYEG1CFKeN??6_{ubVPCDS?{jl&2Alod(|;c#75ESO6M5BJJUQ)u z?cvuFzJk%Q{@5Nem%)GTYD$vCBxr9xvlkmf7+1ULk4J0IwyfR8j`lr7Wdi+@ zNo4ug<|F(4`Q8hV=7m*sK1>&OXj<4ma#i zl&IKT*WbG+WwA*rA++{Kn4Z>p(58$K`e$)frOtyk5i8z*Vzt<*Y%25_Y-#<0qo(>J zki)l|!z}|)ejYvA-Fbp8peH^;RR%pDr@Nm0Z=VhyW2&qk(|Uf_TFdStony(Z%jc;z zIq3-Nzq1>9mQyhH)LS}!qV4wVIZjR6FQHHTVJX_Ko=d1Qc53ZzdySTU)?LWFPhnQE z{zNiTU9*Q%?g<%eo0SS;Pr2i?VrgrI9QI#mUziBVOd=gN!`8)@Wc?Lah0dLJ$9E7W z-ss$GJp{@`G=)(nL7w{<+U2~nrQZOFft1`&fTD$dsUIOr`##+cj{L51M~B{O^615l z5;ME%_O_$FVNSX90`GX9O%TkZfzzU2-Qg03u){4rqQ5m21$JyB3A5SQ{*GhDL+2H0W0-iH2u|xJizQO3L3*AR7MZ;m@Bw{LuFxnfi0s zeI}|X{N4Rr@YC?)0Q-4EnRz7MAP~1YdFySe#<&#gf9|_1TQMwHfT-ZkE+TMW%jG3b zTbgr*lYO6}N2O`6$1{1$fk$8nGv+lHbc|30>9*QV!SH;>Yeuji0-7!4{rK zOTA{ktkoTSSdc9Ae!(T9KmNAM9+oT3gyPzPOYXRcog4=(aGyFzpMxIM(d&9GbUTmK zXD^Xlf;&(o=8e3M6L=I*6?;6oRM)~?$-{7hmKSSRLaw;mx6k9>yM&#^7Qb7)bXQZ+ zEFwrv4xn!5#H(MLZoy`WUW`~s)4e3f-C42u$Jh1;P9{K*Dsn4#a zzei3=@?=U98wD+Cn3U(L?L@B*+9?_sJ7?)@$#RsuB%J)B{9Gh+`3OTws2&L{p3ddT zdIu}N-`m+nv6SKd{;ce(y4jwg7+XPz*`GL%VZY=+w*BTLvy0JN;3(0; zsiNU-z+Jt}u93sRV>NTKMZGBBq5POlW`}~fSEJ*xKUw7K^wG>aywz9FX5&RZRGCD% zha}T*AdH8|_g*4hieNY@u=M_4Ep4pWMfa!`jj8;K)fE14&q1L(r z12UGPLLl=@SoR&WUS|##oe#^W5Dd~k-K1C;xmbJUlRq8ezXvP#5OIBR^dHx_o(-Ar z))eOMCo6aEt>Apm=OP!lpnj}T`vB)8z)73NYycmS7qwB62$n5J{^Kp8ihqX^6!y?|sB$VGE!I z7>b8G9YOZ&U?p|QT?P41!WVf?i!JEi+3XVO-CH?4M5b8(Y!k&e84(Hm&-1vV+$H8a zl%mYwr?V(_4aXAYJ8I@jrjA_DFd6l98Y!56i#`0vxIr%HybI-s0#+=Q6b< z=5XH-Rdl0CfvcRO0`T8Rx2U*vQM!cOH&mB^{1_l({9*=7oR4vBj6HOrTT5I>nDy%! zjs+@S#kXKxHkxu}Z)ox~Ra7Y8Yjo!4$#7`zYlM$M6AT~vSM>+jWtsYtUnEr1lZ{F_~Mija2ko zKg#Ld?zm*)Y#drvx_UWOV<-?Ge|b6n38)}CQ);sb_xd;|kk+}XP|SMmig%6tCY{vu z+X}m7i;HQ*dJPJzo?-3hBN^e7h{QX zfvYTP_QEB$41%Y2NQYOdaacY9p3WxclTbi79kGq8B5lf5(cuLyp(tMzK&Ja&K4lV8 z^aZ7mj(Qzfu5+L59KtjwnkN3Tb4r#M+wiC?$uD&gAxRIVUwRA$r1aQpv#p{Rg~Sn( z`;$*)8Rgr!K9tlbgIwZQnsVPcxzIF|IcPwzN{8igp%!qlP~S;$cU>YQI6{CD5s^gT zZZltOvk&RsiL%*3;EgThL62~@Ewdl3&U(I=FY~H(j1+fN-^K?9G;p|a! zgoJG?8dMe+y-z0ST<)m===gpvJCeV=PxWY5S6C1|+!=b)(QwptMv(vUa1ZtP9wJKv z1)Ln$;UNA^y>!b)=5Bx<7!ZTiR7>0j;4wCz(4x{tuc_o#5GW8~GMjTd&@qKSXhWn0ZvZxuCBCKJ2ULdnac zG(SKMZ{&{?#P}v>ldIR_C!~K4u0!=q$rC{!9*v%3DMrV7<&ZxVe?@FYZ6w4m_nMlR z2jL99q=Fvs)>t7vA&E`X(}rGw7LI_%UBWa%w8#7*)T8_nv7g^2wJ4A370{Fx6-*f; za{Uz!W=V-b3oLXfT?ef@lsu(we~KUOX>Qk@XOMM!Ov}*M={y4ko>C?Ub$bm|z<&4X zQ)SB*tG5w=!qu8;v{2{P_7>es>e3>8OT)Tjs;gAs%0)xqg{Yis(E!zq8;W0_qtca_ z*6&s>L<@g0QE)8#7maFkg+WJ$oB7bPS0%?raM}@;ZaN9~z=+d-=WwW4E1kkk$WT*D zqSx};8l68s83mjY-gF0_5AQm^w6|R(%7rMahfg0rJ^FgMySItZz~%?v3gf zx13it5!yZFT@(z=`SJl434po4T_ZnEakvQ1n2Me~bznaI*(D&AQ9sux&`;hi-Ekjz z%Qcz^_k&i1d8=Jh>Mz;sq1-$7x!_Q!@`4!SH<9PL+uGx?F+b|YTVeS3aBFMxDNK6) zj+dqQwk#8+KVdHE5z>K&yW2=_)n4*VDAB0QCZtrs>Bmjmc8R#DriswVkJ4QwIMXym zLUT@%joO;H%Rs)({bMf^$ESoza-Avfm!4L1Hj=QB}?5&$Z_vk!f27R z$Q9F`B<_Dninz?xQ@Q1j;Wysr_A@;Xa74uW!@LM=4gZS2NO{3Mi$lA|AKPnmA`_F@Gv3d*cYVxY*z~eHu}Q*LICVLN)kdr%D3VeD<8>t zA8@Gu;{W^`$IHepM*?U1SSOQNjmFN1tu``l>jg(ws;9nP;@wP3DL2 zr_*1KBY+e;F!UV&Gjn+j^)Hgdi%g3XjoJ+7itLBo!XzK_kdZ#7@;|b+U=V%C(?<3y ze&t7x^c9aD>907j9YfL=L3HRkz9~!Vccs~d!xMdEA1xW*nBF8Bh0fH_QAd(mHNv_j z#m3%~K<1Z8@PtnjkR_MJKB~>vTL>TpqAh+})E}XkHQr`eCK}!b63)Q#l*Y`ZSvktZqXNr_C$bK z_pT+v%V|1%H%RYtwS%w3Q2~FeWKJi+sgmdmi8OF6fRbOwKR$_n{3`zOyZFbK@sGd6 zKmHW|K&=?$HR?D~m?v@-^|Rdu@}uxEv_$R+WRm}g-AXoDnrf{h%C{n`%SVD6_(l9~ z`!oo4e#IU4?H4<{<#X(L(@po~n{?xS^;j?Hh269BP5H)eJnKBIub}EQNLPh*-fa6V zXw5hM-_*jpYMZN) zz9HLEgB0`vZNu`ZJ6hja+ZyiSc)Up3?X$q$oc7LJpteYFe-_4y?*2WzBUF?m{KCgdc zhn$16F@hIYJEt2{`6FnRH(iNjv6MmZyb&r*kiJp+c4k7h)vZR^kQzuMHfK`A@DKE?c@#IJ9 zTSzh9=6v@0AyOj7v#s%u<1;)*3gYtf`bka$^3;gADWfqlQ5yE93Kecz%mcS{n{aiB zP!ew13zgmU&pIX=1iTfhoTnAdmf0BELBj8xUe5&e1OK`{s zsY7UY`>)RZdZA-VIyQ<1mq!-F3U~z*h3*<$V6FwtaVkyZ7@GqST0NuVmxw%TOCFz8 zrNpC?d?qwuMh$ln#f^jNJw%6WNz0yWXdOsxQ85v$a~?POY;Jck5(s}XVAb71UM?k@ zH#@MacrP)(j#JT(M>7<*1eQDIS3KQA3vIr+~C7V$kE-_#| z@H>O!%j4hv#$LY}&4trom>f!goDa!mK$3%?`t~PoL$F|K(HsCwsWY_qRHX zhCahChCXhacib1tNM3(J>^W5o*jKE3vN)7Ei?5u+Xw^q(cd6xAsIU+sBDY#J-=3%? zR(?kIQWWW^h}!Fd$jPMHH7Ow#>bN^N#Ghwl6Ad2?SZP;6+C&9*e=2kMoJdS$gcFHTV1#D1B#PnUSh40_ISth8;}8+`B4XTN zv(^Bjyy%tREq2-K42}xr=3AdrJS-UWUGek!{!Pq$)B7G~-$pV%@5|v?jsW?)<#S6N ziD^gkSU(?8rAYDXT0Z_wFS~;hZW0&&`sruyNnH50>p^sMDC06#BbHqf7`S~Hz&1S* z!abn6b}%J%mG<9!B4XSVIYP>#B<=)9sV3J+VArzlHAg39)Z3qu*si}3I`ljqmge+4 zo+bGMCM<@!CG0CwFd= zA@9`Wa4(eGR;UCp6~b9Ro6g4KWwH}#tnn^vCpJI!i4+o+02aUAm_n3azWL{`af)_w z{1jVL8Ql-WEj+w_|MlqdjXsyTi?F=$b1~QIqZl~+^{+Gu)znb0V8qT>m(%N4&kVEk z=4LfagsVH7iL2OUy<8%VvG-CLiBu=rMfKWstnkXX8^LWcs1K3jWXR-;qx65lz)}Cfk!y&E{+MkbOMX zgP=6oaQTzc{!{g#7*K9y4z6wpRT}~~lZ?C~Wy2Si>lX+$(^3bS zA5#=2I#;3%A)+A)Xy}yY1c*}S#dat?ZKJ=d14Tonnh6TZK>%>ker`+HwNQPdC3M^` zcTLoUhz23|9-9{d98wH@{pyV?I~Ra+=Le`&XRGa&><98l+PNv4%1T5s`CC&%wrSpq z7;-naq=k-#d@EXL@L}3xV*K7CrzQ*XaBzu)Ae;RE6F}O zn;!qLkcz#{>Na*}Z?v$De(E*-$8~Gkv8I8zjjlk5sP+fifsqG-s|Y`XZlO9 zq|2=dj~?*0CLX1cWdEihY zD(wv=jqPkRM7bTMwq!G{TRn&OEWho<5^tZvQKfkz`)21S+@F2&`>o=wY7D1sf(bXxi$O`S zymde@K~gRF5U~k4-qMjx$;8bB+Hc&u=Y24R2@SUw)+fdOh!cAt5%l6zy-}YxNt(yzrUz6XdN7Z^9*MT%o!ciIh~<>O;K_tUivApK?F}~{>F-B7R(l6OhHLAO^{Kzr0^Ry7R?yM==k+;)^_y!Cy;hGLvc`)J zcHS_I)(X)kb+mxw>8EmwsjZ4MNlOp`xO$M^QH_9*KxPneqVStw2hR zVYhJ1oZ6J%pwoQ*bV1m2v(m((jNLoh8-oAW_IGx<<1+!&jy{Dm0cA(Q010J=?<}EG z6f$B0;ymF5Ml2Ifl0>*klIQt%B7~^mv;G+AB9irzI+WFIN|&0-VJ!W{vpXHL1B>gi zGziv$JHUTzL9;u)y1u;F9iP5ut0^1OZzEjZsU0Ka*|7cJ(ymVq1t)ow9KIFFt9+`+ zJp;Qiy=Rnz(*HRr&VNLTrqi$R`tAM4H7*s94Z?dPY&+_qret9wit*F`T8$Y$4Ksw~ zeYU>;3>Q3qb=2FFiP8m{7d^tH`r4lx9JmB*B7|H)H z!dVn$5RC+N&sq34*E}B`=%CX9^m|A%EC!dmI<+*FDV8eZraP>(oR;vxyBIzlppdu*}+6B09r?d)`|+8YTi%?%h?K#%qj{9xsvwDujkrZ#T$;zs^= zu9a`ZRqtB=z2R&Q``S+FHn^M9TZuz8!6vxXC#S@0dc;=P2(CW)H&PHB3UhYqAd*h< zldm*+QW?oM>e6@K+k-;N6WcWJ8sMcbWan<1@j0_54v~vp>%jsf?IaBcSxKj2-t-_1K*l5?KahvPE^eA~#Th z*IzRo`aA5HGC$sYLO{^X;KJ|r)vdT4f9F1_TBS3Ex0dA2j=^r=Ko8`t?|4K3&zv%<)JG`w$6*-``>)R2m)cP2gD$`GwBOTw!5kJ&oY3JB(~3sceut1OEI&z5h-x}_s^Ny5SU<^Qw;=j6N>B8{S$>r>755;gMEU7{xDAS~*XEbTC z8qJ)L$#m&#IB`-U# zc;>ubSSc#nX_@WAj2gIoYe1=vm+WTYjWO)U3Gci^af0VJ%M>6myKz~;OfMR)yMZ5+ zenzdpBo`W2E$Z8hJ3!_c)WWLW9YvU2a@^^OAQy)Y;xYRylI((~VB_~wRd)=XX}wHb z5cR)m!Rt&z2l=NE1x@kpO0gguWcLE}qm(B0Zf<^?L0nGcud_AMI#cB0WAoy4+7(R> zvCIvE$^XV4MUFa5@D*kZGx%hDI>N2#QlF8r0ocR5alZchNEB#%DhtkvkMcQ7 zv{ARUcTi5@jaa6$(N9by1w3ZI+YQLh)DFB%CKsi}g83UvtGCQ=v0XGn_KFV~Zb;S8 z64`f+v8H8G8 zMP!rhZ{^};m91r}eZ_$h5Qi5QK@(mBMns#!;S}@T;2xI1Faw=qvUrsmDwQkKPdc>0 z39t?$A#c3=a)2BcTuR^D09VbI(+{1H!Wsx-3q0?K837q*LKc!+t85koofI5l4{W}| zpS~>VVZu>*V#7bs`jmjhZJ~$;yCuGj6)_B}S2EW-NIxVKE)nx@5LR+i2vkzpbWbnG zFXotB@3L}R3{e|bMjH)$G`ku|obB=2-eZst1ao+3hg9}(dXO)X(Gp(DQ`~%t%St!* z{(#rN#Z=|L+H{)C9*;*S<4czd`yxF&rkG6gvd~Sk^GmiCZ^Dx&!)-}>-PplZNIUYU zI+8;5dt7`wI-8t0#SMQx9>0=na92d!420AN=hwi%t0@kV;PUFhXmG3*EbrO%x@77c z+!eOeifm20OuFpZrKi9sFlCln%D=^}EkQUc6S_^3th&@eFy=m2`J(mR*PF#pAVWZK z-8%NEI}F5GW^d4Q7K_iFh2e^PM%OEJbIB(=UZ*3@Fgfx>&$Ozqv~pT15CGybZdF6E zs_~}ludo))`IR7bCKXN3Xf%dU;LKk_P@CCOC zsbRKsAh*)f@VS+^>QWOM@0T0D*n|GTBsmcDih8V z9e5ifsoD7K^!|NO{CE|0V<4}T(-_Lj0%xh&_Phywpnpt zwk8+IWf+fsSm#`Qjoi@jf4RH8Gx$=gqo?75jGk-%_7H)Zwe@{I*Kq7AhcjNdSpRc zs;6a6k1{?f%2sTwkbi=x5T`f9olK8s@)PSsih!sTZ4+^6&mH;7UYG*Xh6Qb!J@I8EwPlAgy+x)K8Bg7>j^!jIwl;~g)vds9ezi7us*UVR{}GLQ$wEuhqt>#Z_4J*0~@W@=w1z=LJ~ zcJ2rk%>49H~JZGjFAYQsZKolF(O=Op0N(?1S-`)q>DAZGr#c$C-l>?ng)@B?fGE7sS)yhA?pQ~n=JU{ppS0^MZESPTe z+lba9F692%_!Tc)Xnj>0eDb|bDRdpZKS8m!rcxO^ofSg@(v{w`2dOH5K&f!9%V#i^ z#7YAGacb0@)Le}G4XsD&0sm0-fY@>QbKDdLKfsIo_s>UH$1m5;&Q@1GIo$o^nit<( zxoHXND1>>Oc?N|~-%k)%5HrX3r-%cA$$!y%CwrFYyED4#dIMO6ue+;Z3{NC9t(xR0 za&pTquGEf(R(>2l$pn>^U1Y?Mznq?)&c;{6pC_{`sMOSBTk_BQG>jVPI1j5~y3YPc za8>S(5)dMbIcA=lgx=V^Ifk=(hQ)RsW?~g)QU(ZUPGcssw8c6ZSXq1{RxS*9L2qeN zs!bX)t^QcNqYa5GZHG3A?bj*hFY?u%fZ0cuFnwr|jS| zk9d234B}q%oaK*LH3EvllrI_sP?4+!5iXcltWy#Z$RV~;}lYy#Y6Zmvdk}u z`(kv53lUati-Sqq*aYkPWHsbF;nMP|)mz$t33pM8q{8dwGL^YN+zR*S?%TGE=unt0 zyyiU>uTFEu*LpkARoY+3^=IR!xCm@AI^*qEei4{loznz?_knTKq0UhOkKZ>gEK38k z`RwKNQtqDx6fmq{tLLSX@6jj_I<#_V;PZz9@YtNyGhUt@gHio`#81K5&VvuPcGmxJ zBwmy9UfITAm3F}x9vVaHz^yPVNrMr3|WzK@ieYiQNMkbW5o!f9g8QJT1}A9 za=2HqXhqgWhE$?*@sKcbx9yLd4-vXc%@B}F%Ok-#SYr6MH4V#O<`)t146`wRLkN(o zP`nkWD8%&AMW06+ehI#}baiEWn$9oY<^t;Ad?U|*9&t|?c}&^&8P7oTu zE6#wni6fhgjM5}|d-oUFrJujjpn&hgbBm5b2CQmmY-N3?mQx5`PXo5!~S^kbZf}4wlqXR z1xNRGyadf3cGp1tAgY&kwsy9?Wva*AUK%|dR#SwlNSuT$;$p%~bK>75s&1M1syM_p|fzNt5D z5@?Z>$5g3w#QFy?shR5CTI*JOiAR^ya~Y?(tB|$uxr1cVottS8mxWltWq>aXBw+_7 z7XMa=OiSniL~F(5vApaaq}s^lbG+RucdoP#479eb#n(D9_p{s`h#DRQIK{F+&vDaa zHxTFXWEZO{09)3D-LLY6%LvEePA8e%_+tew z>t#guN3$`V=q8E~1kvDeBwV2tr2Sj)S4!a&p0_-@dfqUU!w_6=LbHO^Vb5B?cePBv|_@HUm`AlE@+O~OS- zkZ*7dPH3a-{+r(1*c1fs!{OW_^jw+}M_xHZfsQ1kl0+m3LN4@1Q*aQ@51g`u{u2o@ z>oavAJTMn=rCFxq7kwGBAvweN^A`hQ={@Z!)4toCIp$F8U!P??vbv=142R-QwU4zv z`Sc1N3T4PFned$K^|l$JN!LM2V;3^MJVpN9V2>lhEwRrfT>A+d5a-*zeID>89|@Qu z^F{tN6q9>9B&+z=1ycl${~TXNxaa6e2YWC%f2Emev-y*Q6U(zwMK(dklxeBXsd!PQ zq&kD)MNUSwoQY*$WYy|ft3?tn1@l(~-YVymY}aCHu4`+Ik|Eq_*!Vomw>^5AapU9kZr|72d3sfs(vK2!^1^zA%xD9@4ag<9F3(Q2G{}FkpCtYOuhOW1KMc9=FFG= z^MM|UNIk^)uwC(YYTTw!u;+%JlZsSOj@?I+FGsV+x8e(zyj~@0gSxL10I&^oG)7k} z^@7c>Ov`5SHNX>2=ZqQ`t}%K z+A~P&`b`qEiKD!?EF|l17<<_3|FDWa=-2q)TE!H+>abHeyWZjNGz|W5i1@sO!JoLy z56tTwlf(RXV!<>N-=;tE>omH&Pk*Hb4iR7b@AR^QQMxF>E}J^=si8mUqvOA=hNp#) zFw)?}ymWKm_bE2M&-m<>C3_`08=X{ZFb5LpYYsTllfP#_??n_uxwNp+pExWV=0LtA zE?hbtD8k0aaSN0oE@lA{0v3K=gmd2oOr52_0A2&6>t{VC&*_Frw9z-M_jeLgyK zVAdfb=LG)M&!;eW(0`8SuoLon!%W(8*mQa3b13mR)>hk`C1Tkd!?(^W zvw%<&aMDbSb&40AUwJ#VZRbFx!ZG)_2vBKwjmQvX zMToEkS|gC}yL1l?cO!(1N=xV&5!Hvk$FZOgR9ClmtWoQpf_INaVi8o=t*Ws(gRFVg6vhex!b;*Rc!4*+acCu5$*NnT{ogt|YU_AD4QyOin{zK|Z;GulkuW4QB#Ee1Q3B#{G=sDB1R7KKgSWcvCAurA{2WVl*}i14?hY zmn-Iw>s|2!=|KgWl;d$Q`A&8Q9wPA%j=Z-(2=l;*;IAPzKBYyfvrj856Q3s`h+vF0|O)CFR))ZFMHrf z$0DeMq3a2r%=TZ7_n^Qf>~@RIR()P-B3lqnxz?;pJW?dvn@j;hn<5mRV&l=FYwgUl zIDGfhIiQt0?b&Nxj!(x(fj(CAq~fUN$OWjzQeI=Io^siH8w8hYzC$hg2f0|zDw9F$ zt;@>CU!u8fA@G2)opE!MQ$l9M)G{o|Jj)GPOS!{4HVYZfPlmOS%c zc4SZ=kGz!CTd^k(ane8j`R=HehV~&LW#PX;^K%VN8aAS6YF*& zH7)!gtghJcgScBZ2pR4l1sop1euP3CsA7=PhIOwFwGA+;O%?3?EapCS!G@+;l*L+` zNm_*>hD3rK*ArRrIzfS>dOGl=;-HS!oTy=i<@mE)u2A|TC>}jWTiqkrnBa_Tu-o3m z>Y7l;6uq<*x`3uoK^B(nZyL2cGR5(_TM`!%t_1>K%jGLJGbJ1bcUK&8#6Tn6F={tQ z|9Uk$2S(Wayg7ukGUW`^(cWQ{gOc9Avzj$zOVLHy(SYqk@=1Ue3TH)pCwt+5g$Ae0 z$)t?jM~b^}KS>-yG}1=k(~$pcjLxN4+&dxQhM@`bqm-2*#&<9NT!0wrLNAI$BJ$Re zFhGA@`of=GP0nC#^XcB}^V8|Y>qA&DucjBsq&$2?O?+wp+|X$6)!8GQe^Ha(yt~D1 zN#Tm5StnBkaj)~V@xj*}(H&#fK|PVLer`t1WO_NddcAsw zJFw~zDCn>Jzqk>uAv(qx>MIQw*(Y%A5k3>3mD4{5pUrD zbWOr5pL4aRBGNPE2ZV|Q*|8#H^E@rzlV*e;;jp`SF*pE~hB^l{}0z zWBE1yb&F7mo~Y{(h*LsXvz~>GuwqhV()x-9I`~2}S;F?6lsbz{UMlFqx5P9SpcmdI zr)_NKPdA||I5l=#EM%fl= zPFyBhw#B8C1&Ll%;((!y16XnV3F5f6c$f~b%4U>2NBNjCM>sqTL%^GLZxvXrJ4RjN&O?5> zf-<}-D|hbYVISg%19i^o%Dq=FU(q+V^m;NrI}v@SFesD+(=A3Up}E zy)z6AkrLe*vU{r+8vd_F!|sJTX!tL48e$uDB=-ZO-T!X1>$zSBt^c*rx_d+f4ga4; z!~XhC_~8F-e9(J`G1`BI7>xesGRH;9@d$?p(c&NlV7-Ob;ef+ny}!w^MX$W~EYp^c zHR6S?J%VEpgf^$#%;Zf)6ATA*GTR!z7#+WUf+5RJYi}UTf-~4El01-vh)63D3O|fr zi^4%sEowI>w8C!Hvc%>#YO@bI1Z1V>}(9}jBEM~3LuZ2d5 zKyTOucxF`I(6fjH={nn?$=mF5q6e3!IDjgeXBAP2%h79?g0s<&*kqtohosdx3E1|G zM1cScF}vy>68TUL5p!mlPGUz4MuxvhKUtbc2W@d8#%&TPNtC4eDQ5CAEZ*!e$tCMZ z+JE$s1WB@73Qi`iTq7lG?tG50uG{spULk7IOP$21e2#)YCwk<@1v`+ZB#9vN@ilB6 zgd;3rK^tQdEw=IR)$5>;q`pAj#$Bly6^J|AXpLSi(c{aMkb#lA2m@6%s3&#;X|N7VtU4BM)B7Aj(aZVJ0nS<`#)6ep*irB; zGTGCam~oILVNkNU+-3;Zqb_RbqG7Vt9jz7}@q)xwM=gu3?&+ZDiMK4adTN<;RZmts zquWvnDZuH7%T2@V`bK;Td#0*1=657~287n=r8?{LUvoMa)rPPBYfYM|E zAe6`$1!+KGR+vxNNfGl^%9PQ}HWq9vPMsAKM@u`P$&uZIb6j7Eoo-I%Skp=gnWx3&Dd} zu^AJxlAozf9Kg$QdZIRl9=*hrEHlZVJT#Lhb$9UL;pO4QhtY=jaRCW8RVu}ps$h5g z+#OtMCZMc_cvsiG1jn6w+MiUeHDmS=xrt{Kgn3w|H~t1;;0FUgqm$p=9sK4F>zc1D z$y%Dx{dPcwp;4TA0pLFC1@5y5obM_!^nls6OO;@q%)Uvaq|zh+#YJzDmh!I?4lkqh z-z_4tkv+XQL!|;rWUR=XEC&E@+OT>fVlUIhgrGuq{x_c)GGfL`x+CZxOvXH4Yjl?@x)*5OU ztEYKdGi+6lUv5$`W1eh+w?GU#bGzoZ!rzB9evWY959J|WFa^WqxP8RG{|)T-;>Gy# zXnc7&y-dT>0t7|cee?+o^^N+>2|{-6j|o~=4iZAhCvV*RRf`&?ckKn9RzF;97aB^Z zw*W!dD~{i>5!qSR1Iw70+||saBG8>U3_x{QWFB24i<>9a&~Z8b2`%YJA-`pp85)ZO z(T}XL=vxh5p~{dK%h4!9F*2iUtLlxz1-k(xh^y>vi!ao)`T?-$u+}*oZg@l|86z2B zK|=X~x;eVWS}_!15D<cA}7tv)YxdJ$%;D9Io#4c%rbkW= zQ_c5TVo?&KabTerGYLCv4)K)lZEP^>zMrH}}O*TS{m7<_^EXpYCRWewdX_~9YZ0dp{5-G&q0|tDI#pvnd z8wjegM1&};euC${(UZWq5J9!bKY&^jYNm-)q*RBwi5upt#neZs4}Atf5z3=T7`kX( zO{mWyT5uV!-VaKP!}JzIa6w0YkR-fpa+}2bH)0d#63td-31bsK9YGP1(!(tc(%k2a zx2IQaxio*dse;}gTGYzWeN)RvQ{?`p#=a+auVKKLENk(VGk!oBD*ABk8Q*iQ*Aud>mw9vPPB$d1L3_6`2%CwW!}2 z1S`HzPg8a;2Ky$e!XCxG#QCTc)8MBExIK=odFov|!xP|sW#ieCC*Q(m|7-R$XTOiO zRFYJ&#=f}I3U-p+m+NoRK|h91+$SYamDc^DOBrq&x%l{eJi35Ejk;+A#mMMtfbEvt zjdg$U;jd;N(!0StC{e3qCBogi3GP`2L!u%#ON)KZk*ZryAlbgFSFbl#UM)thfu?HV ze-XVi8U>!=`?`ehoI4B|?Ed}9><{DD>(Q=9fFb^A)AeuVGkl(U)ifNOQqWMH50+B5 z%8PpB6f}tUbJwQg<&d%*qM5{}uD@8%!RXrzbv(#+E6^ga_ze*95j2KQQC@M&ViU&P z0SMPh29)a(br|L#>92YG1o!X^bu=+?)4H0_rTa>;^=a$_@5k4dmzyU)6GPIgJnbO^ zStE>k#dYUu#;=Q+b|kV5)0&n;z=`?q{;3K1n#03d=L2I384hF+z{P3BB!Sx>%sQsd zp^u$NJaDkoDIz%Zp{=DZRY!0m(B{vyt7yJj@9Y7inVQWav8j8Kms%GK^dg5<#Ni;n zu#Q3a=}RfDu5W|Dl!y~D)AhxD(g_dOfGqUKdZCN7ClCkmZ<V=vpFlx&KHA;rHA<7+G$%V$HQ0caq*iPF(b zpJnzEaRFS7$lI=?h?82#DtK~@Bz-3Qj!sSnW9G)08o8Pdj;Cj5>Yi|0!4{(xbx(lw z%oJDMloU&#Wzu9c{#RRBp*|9}GMsctJ(=jlt0VYht3LN`7HK5HG8V7BCxz|7_{I>C zRde*JX98958q-kuL|IE9Ofpjt2ksB4jL9QQE#qr0!nZUXWb!ovtH7O%9tH&v6@~gr zG!_Ff?90o^$vDLULAj~~&}|jJIXZeW+<&~Y!P7Cf2qQ60qs}Yv#!aCaUF4J#Zu$Qz zO;pM_ZgCplV0ZUI5<@LI)=3FIWl_6y>D}$Jc$e)o_Gl$g7E`efC3YeVAz~REzJ8-8 zTR*M)0fXQk!tqb`JzdF}jAaC&WBw93=1u8B=EDY+Sl&hgikTbsStfUxzk;+sT^DvB z&HD62(s8N+uUyvcI-}abC>BgW3zx|g-4Z~@OOHN;OySiT?uU2@@Wz)k`WU#ey{`#i z8R5oH(-nzg39POh9X;JzTOU5&+1fxH@`wWYqmRnrIcXCym6pYd>Q!CK5jv4xFcSJ! zWRn;Yt1GQfV0uTL%u1SyalxiaeXxmZgduCEi!f8E%p&TLq)1)#I1_{i0*#WlmK&B= zfWRm=7GYbXW1|zSho!hg$A3}|OnAwk?MYNPc~$!zv~4hOxNgFTLGCbh^;U57`-y8f zV0w`KEU6pfjypzK8Aee|SVOLo*J6fx#ZBC0N-H;IJ{9H`c|$ZF%Fzi_16U=c&VfA3;_j@}a8`QAe{}%sjZtt_!kv!af_GGxb39sbi;rbt> z;s#Xx^7Q)Z)ipPWT+8zOW(rJm)oVI&l((ov`*hulzLh$##M3poy%cN9v6U4v`rZEd zci`v4Q&lJQziEyrjn8R*# zR)lB~b2e`m2*o7Lq*J5BZL69raMQ{~D53IB0RP}kAa^h`;FWpXwS*dR9Y<;K^ezrf z|MJQ%GA*weax)q@r6wj46UVqGQF6dO~A*;D3~qBTqWsVSYBkS?))jsxj^o_W?nw{%XlM`*t|tF zbt@X^Q}}wy)YZ-Ht(c}FmTjqGh@COPE_WX0(H$j1fAoA3DQ>TIahV{im13f9z zF7rz85E}~cu>x^Uip{^nRj$!Ll(3U|(z#S{YOB^^!(z;4hmL=^ScP;6utir{{=2)@EJ5TTF@j#sOG&)&zW0n(Ix zE*_|Gt)mF85CqK=#ZAqEhI&Bm3rl;r4dGk}l0lScA~jcg$;&UKTnpW!WztPrp6 z-LCzVc5#c7QtlUUk^O?|I|%zR>Cx)~ia4%DYm%7yA>?jOthv?|r9nae0It<`V(ShB z-ccPf4;(VmJdor)rFV|k(dqWdueDIBpF2>3tEOY$M$)>=tl8fP&77g~6vC$TuI|Zw zE1+9(xyV$@4Yken4knAh_6r<9dj&1Ky7I}NRu6aYe8N~>6M~BH?+&=p#%AEFqrInF zo4EIWxV8D@XnpM|D?`}gxkE8e1|-uuR$Jl6gGIya#P_g-agHUDeqn>agT3^0E=*lZ1ZJ z5*qb5c`@EdwG+4{REriAmD0?^duCB9PL1MQoxt?OVFKNr1UtAlMIhP3o+^MK$LM^( zPC_J^f0~Ntx-ngeB&bA4 zDk?eUHLxj*;{J&?a^NDCnFwU~!UM!fEY+X;B63_r7mJU%Ft!cK&)F~?t1SA5sEJFd zQ0G;QBZW152Fu|UqITnxuSaLs<6PM%arYB&CQQ~jOT>j?VKO0&!K|?Y&n|wrnErHuLsRH`fSigT zUh!AyT(C%2s4lb!IOZ1{Sis55f}@c^ zfYu}P+ks}6m-ZwY~&%)XDGXD8_HQ+0Kny1Ker#E;0KBmzUWH1P17LyIPn zc}c}n#Om<`7&mI9xBN_x&i|TdH#(Zw9G6#l6-WM_$NgBP;7m79a7D!(&qTi#=BBC# z;!-g)%om&8={@Icx# z6{z|$2_aooG{vD&&v+oggq@xh7>b3XLpDf?XwKZGY>YR7a7~8lvcnMWH#9K&1XdeO-q)_RY0@&L_&m$byUO4hLs0U_Xu651~y{miZ z6Lt^cg!bAK)9wHV5ANT;52N(D>hytH?U3KoJKz1!mn+C!=;>g#cGsNPXRJX;@HweL0zgRdiHiZx z+4X98@LezzGJEpk07h+Zyx88_aqvPKPn5pgdH(kl6sGKSwOlRh*v}`;{g5&v9g$kRICt&=fsVu z8muZyRXb+BmKU9i??3PcG$w0%i6$QlXu^@qZgH+8Jz)2E?NpQ5K!Q#;m>XuWA9)md|9Q2LoRI}oVP>mICJzypjd90(PufUnOKhe;r1uY3uH&UFpg zX>==2)mEx^kEW_SRi&T9ImBq?U1vDe48n{#frGV>r$h$alCYZkspk!)diH4tZ=|0g zUi2CaW^J5WbX>%qkZ1x`R^ZqpbK@M@o|guLlDeyJYFKv;(Lv}j{#8JElRnG~WP^mh z!E5qwjEyY_ORejCh3_?LsRLpO|KJ&9zGEblp%jVyt3xKG(TR_v7*_Ney|>6kQ?!oM zi&~{=T&gF!Z)D4rZi&KLR=7u$(C`CPQE(zC+}+l`o*aTL4^JDdDcBqSU3NFqkO1;p zKqfPSNNe3LRuBYXY!E^l03#h7tS7xCWUlE~pu5z>FA;X!d*9MXFnyqfw~@~9Zk*68 z0s~bEy4t=0DtRIhRgk+`5-Jc}pAHA_L))0ivl~XW>`v!1xEA?;nqct1!VY9 zHAKAMXYxCp2u_X|^8mj+z%vZu{13^FdPjU$#pjz8kFJpY2iwAyU?z2tbRefc0M%MT z-;ro>8CZ>l65GAePH*%EufKpnOhHZzK?qZ&J@GqjP=!|hh^?uJ1T_+aXEz|XN`ncG zLJUlaPZulUQm%gx8AGmAj^4&*a_lE8v zS3X|pmLn59-=x`!=#!sCEY<2r)&P$wy@!s-NID8TDGcHtcRV9~M>caPWcngM@X*Pq zBgbaVZP<1klA90M%y8&lBH@>a4&3}nICI<;4o1r%8;_==UwH0UCiUAVdWB$CQCVDS@loninTcT>RT@am5>6%2rV?9% ziH})PzFdP+Q^*iW48$IYDMMT+$?ES^d)3-LY=AY4k72uy$~u&h)Yqk990zL4Xz~7Hb0WPUkp54&<%qt*NeoOaDwMouXDWcH3X zjQT?92U`_M+xPz>eTva>S!c?)XpHv51p34kR$9kAK}!S#`2}ZLVhN2gD`EY-KkNo# zjywBl6nza1IN>$@Fw+%%F1nV5l#;<^>En8X$^u+m`!Ed?H%ir|MW6JSODW%fUbkyR zhDo)65~>a}vQF}e2v0#`-g-hoMFpL4?JTH%GFk|I+#LQJ!)@-BQo~OYpD>DkcfF4B zi-m#8wC7g-t*XApqK?J_snjSgW87FHZXonMwQSvEHA~*;&YX#Zirc4LKNuOwzC=f9 zC11p>(a)}We6yiRCsNgyw5xF(h9R1Ni}U}VzzO#-zPQ_rk+@X-NK=pkZQtSt!4xNU=&GMyilRD z^~6qDb9%q6_>%ZP>51Y~xD$vg&38!Xr`;0D+dVR1Db`FG1jJgfijPA~7M~1t{F=+WqMqQ5bEvqU@GK?Hf$2Tr1ClPpnm7kv zURsi=;597<`G+cI_EJ9Tyc)h|Q$goN>Psvq{F66(`1&$-&t3j)Td&l1DnrS}8 zO)hLpv9~3Zlsp0yAGXp1A>C&(R0#`WXUE-RSzf4Ldn`?b)OV}CHekeff<#54 z=YNHQ%f>(w2Twg~Nz>XUq!FnvMkIRXO!%7qud{XMc~gkz8^H~+ zlL3tvTI`Cc_kTMu!-axo%iwbZRZRJyj0H-pX8qz zzr|Do#td#^-uH{FJ-Nxsez9gXl@|~2zWMs<-qz0F+q>&X6|#aq;l6~BaP{eTqLHNGYO?#qgkD;(P?#=jq}hS zInPs;#(@%E36`Amj&ht1!1SDF_Tq7g(u!oIG^lAz?6J36#HDf?`)1@^Z65mg^nyh~v~T9H8K3MmvqUrja-k(q_Eh)7M9$#}CE3LOgND zFueJXn?%^BUo+D4P*K|PY-w~&lO5KP+PaEqb^U@@ny3g#9FikveP?HDr@gtgxh_Ij zaL5g(y_qDIe>4COuDxe9!?R#H;nj3DX2=FU;J%at-_s4QT>)xr9Lsx3r+B;?jr$8P z_n!V0r^Ov4L&Nzho?03qft^x^z?(EqS>F*y4G%0G+MV6V;;Xlb91 zPQdKNrkIt4)J4t(VQT)JpiAPehYdvPAnKyy1bo!xJ)M>i^*w#K!`3UhNTfbuH*T|n zV~>=5A2QSYiPxLpMC%@5(=p&_cL(p)pY@JpK)m5c^xbQmz+*^5HD5}eVRB;EAPw#i zjZyir`+>2j#;^$+;!k6(oN4e&Spk0-m4m2(qq%dv;%7bT+3r#A__&P&UQJluKDMyU zI5q-k=7>+{3eQ@RbXGFK6e#4%G-R2u`?0QghW)lhgnzEjZ>WUwx4xtf(K6Rul;0^c(vx z^l@r?B*1{;QULH%2gM(8pzxN743QWoaZ<#6{Pm6N;Iwa6Nq>h*IwFgG!lt|;1T2id zLQ8=MW$F{Yx;*~tx+N}CNNcq{v~Q|yu})4Ss`1llV8>n}63w3`OIBlO<&&)MV#Abh zWpqbDeY59@9CBq2~uI9I2a&bIr_Rc69x}+H;;QLKwVnB;^8qdXXBy7 zhYp%4AcckDM<`AJ2*89wL0mennmO^y6U}TNJ|H!ZSVOA6=s}Uyq>H6S540g&!1`B* z*aL!rY%bznnbeFnI7Bd{QE+8)TfVAideRerbG`~kJ`IulV~)*SP`HagS}r_>6=yC4 zc|9TNRXX#sG&cb5K@Jw5y*-O74*f0{rT1O#3rlD)GVG zCQ5O3-k2Cehr`1!A4;UAo#5PZ^ARvM{}(coGfy4kJn5Xv%N6r;}PzK1%6t9Ohkmiqm|VcJ9{tx z_I+b^?q7VW4*B4A*vW6R^OOX48r{RwffS~F|2EtBwQ+(l>c+zVtT$$nfbL)swsre( z#J`RZCO-eco(C$azf-8Wwa5%!0v7<%N zdyEFIK#1KVgIYjtEW9Ohh94Ff`nRxvE5jE+*}~i2;7kvc7Z$E~F=9dZ_Yuwx=l&JP ztx_OyKDuBGNA>z0WxU2xfZT5oZozg4Lwm{uLgBc7+&#fK$mD{lTW7m?@SMz3Z&mbpbu@swwV~mfWDq0~F_}0|>hUUV% zZ+yiY>Nd73Tv>#$g7KDn0+Uc8PFw>KUUv^WTvPVkI2z#Kg>j=2j=+=sbSy~%Li;WM zEXu*e{P~+BL`odse@IX`zz^7@a}{o_!74}A7mRhHcjoG_jQIxtC=&RMy6vlBhEJr0 ze74<2W{LK*t=&D@dIkKXqhhZXN982XFMEV6!66>>OA3<4GBa5Wg`0|0Gjt}wUL!cO z!8QyML(VunEEs#nst$GA8C~va?7+l@fu~k(p7;XUII>Q-?`QX};LPQy2oPg}0GbS7 z`eNZSs@7C4V^*;;IYmY?xriN1?i~n3dosco{rw(s7ytw@Is47yOFgvNZ-zydGYl$~ zS4f&jjD7;#7?=}rLq7f(+-R%_$hQY%2UaH|wJ!(s1Az09l~AZ5U>rn$e0T=U;w8xk z1sWgx1;0vD5d@L#Bkn&EZ?~q8s$f!<2=O|B-R}uYA&25Q_8$r0(8UsOWhIeUz`>3C z4;~;rG311dBe6M#Z`q&7hbgk5aO5~Rk#&ZU2-95pJ zP7VC80DyWVf%!>D#QG=D`!5B35(Cm^!fw<5mFh~RE5khahC6K!;NkvX{_+51Y zgY(XNM$SC%_D?QPu}sufFIN7xy|VZ0InqWg@Nve8Yo=Yv{Yn1ms}@3D^dnx7%0`+3 zy{kcaAVL!PsIhqLOLaa@2h|>+d5f1L1o|#+z47qyF2av-hKr?!s{_rZ*kA*PpVu*m^q|}!K!X)< z=^a6d=uW$R((ounRR^w3vZfInt84Ri2#7Sq>)9_#`KuCX;fYRvqt1!H>Zq#I;%aFq~H8{bBya4mlL042~b(XagZ4 zl{0tj@f49(SAEu@z|f}fnlO$_)}tH^pX+o`?G@j`0*@dMA@VLFw!#jk@F{FQC+U0XE*EK;OmcgT_0Ydq5}!5x zSI51f5yePtRUlIcERjKRI#`d4wn;v;cMA@8AEE?>Po#E6e{eRA!w_+ktMBUB5j;ol zuy^xyz>b(^PK5O15TA5((Qss!`sLDwqwt7fQbs6gClKfxj}_N%qA zozO|tvUWEmFO2;0*s(;gqx7Gg{K~RHtj9v{!77-^q z2i_K|+c}6et|Wu5&=iiq%Rr#gJMNBv{ILBHS`%i>swRM>Rdv6XL6(^QIV0#SLPt6A zg03cd=g~M=_QCdweQ{8tfmm0&ES72bSC~Gl>N0UX3ciZ1f=ozFbz39uxV2W#mcQi4+g|$ZYWQ zI&}n?W8EOo2}iHb=;-8Z1P=s(rIMneVd{;nr6hqpA}!gzlRP3Fv0fk~X_T;0EhSZ2 zfPG0JPDf5j6(L>QTNoREu)-c+o-%h#>B)3#P82z^$CfLs^om2?@GP{;cgtkp@r|U+XlN`ZX7gMaPXuN_;@&}_ZA38az3NE z(=JY`UVo6=&WC3`+?qLPE;iN%@qP&Hi_m`M=p2cNFe$p87C^_Rm!l_K%z(Po5vDW) zamVf5HA*_V*D5m$xfD3Ru#5E(F}Sj6Sjll3JSZUlqufG78A{!V{ti319fP#Uyl7eK zojZAHwl!vR;V;vQ6eocfvUW~VrQn*_!$kTM_7UCwNDdr{r&hcK=^k9n)vm6~PyxDY z`?e|7wU0$6u4C8ZP=4NdBUe~GYz{9N_K&s|`*4B|FZs9gqaz6q*t|xLxT{OM{c25Q zb2F|^?2HI1@-7C^ysL><<+S#~a#s#55eCv~UY^Poox8a7MFvVz4kDN%24^(BT>J{j zDUTZOaJ7jSdenH8Zem74c}GM{7RMZctQEMFt7U|J-WtgJq)*oPE}&1Km9j4tQbeY|GMZ%gU7 zhw|-^Pye++o2MP^8jlMhXX2B_zTYio2YmFB0pLUU;xBMm8LPg+Q$={!RqBxK=+(w% zLFcfI&sE^T=*W#F^d!uK1cXR!jCyjzHE7=OKno2<#E4*Ttixa$V0L=KN8OWih)`$h z=HjAF&c&aSV(K4PDRieh(SAlLEJ)eq}(Q4mPT2TlqeI|wfNTzUgi=QNM|O!9!Pzs@)QsO0E8<-AuS-o zb29s&^(gI(~8@Dn7&=-hhr+ePv3|K#0 z8Dv$vCO+a7*mQwF=rUuW6)b`43KKLDfJMG7D?Dnbi$mcRwenlKw$84Os%!{kk-}8? z_*(i|r|&8^{E!GY^Rxp;pvHGcl4@11lfDvXhuV9(d&V}K5;A;(#k*vi zY&F-iYT;8|H5}4o(BL2mb-8k?BW(xbyS^}JO5~cBceL-GCVQp1=CjZqy-|Kthtb3I zzmeTGF`$&Iek-pjgnN9}IU!aiAJ;)di4*w(*=XzB>rfBhkd=DsUb#njQfc@TX_NW|I?hVZ9bzgC9dU=`}g%3UR6e z&TMQzL)*uVIbT@qN-XPQ)5$Jn3ZmhVRI0{fqymaOOnw;(dUzE2xQ!W?^C>&we@p*_wO&BZ*2a!3+BI;&>WmkKw@Dv zv0~GZ*zWrCrwN6r+f2{L^HnXJNES?$5+0OFFvbEuW)V0>L!`RU@EWQM^8v+Epl}`Y zh2k3WYw)26t;x#TH55=#IE&M9L;9#dX7qK7=Nobd62Im<7P1<;fkBVxZ7;{n&_lv^ z4SCHrJ30_fu8@&j{ZH&%Uf{mTIUpd@tz`*XaObi>*!(&DD&mtuvJ79E0JP!u2Gjhv ztOlsycg3yR=BBJmOb<9NVLJ@O#L0^Rr#*x}4G&L0$ks&p5NDRVQohnZdgkRCKp8BBD56JF zm3uIW?RP^oem!CO7w%ZKrZW8b#Zxj1!pQ@q0h9=D7)}^k?Y>KG>e3`2%(~}_G&!Vh zZP-|8t9o1-CMu8z0xjLnRAL2x@7v%Sx! z&+()Uo`!7D$|qzz^$X}=;3=)vMO(7PtA6i)dPlAE%Qjw2Mb66*>VbA>sn^hmM+?ih zu0Xx-zu=a}EIUP@EQ2=T$f@%g^}h2MZmWUDzZ*`BZcDN~x>8K2pr%O!VvulqcmqJa zL=Pq#Z(fi$?C?x29T)VdnA$fnrkL_l)e}Q-7%s1eY~G-L$%AJr3VyjULsu$2yW&4a z7ivk0{AY)$7ni@4X}NI8k}KB*K0v*Djn|!#9g~L{axp2f<5GUdvUZUXQW2P-jVpc4 zq@vSUC&hlFhd4lx&L(`6DS4z-pgw`j4UJxRDArrENL$h8vnl%5+?5u`YD*7 zqld0Vhbw7>C=VBdm0$xTWXGm(Z}1eu{y$Ar*Heb0JCeq|2CpTySGMuO@0xJS?@TAI zu_{MOX%s)_X=n|~93Dv8j@l7FQ&ljb4uC%U*4=G7z{icyn%n+tyt&i2t7rC}_RmJ)FUJPvR-v(*7@Y6d_QI<#mU^h%Twn_k;P)ELdC_W)PCF03{&V=OXz=xONe~X@I9O}$HUEPkj0 z3!n(DfA8Ma+OX00thB( z0x4ur5JbJ6t41X;3Oo$46=;Boi@x*Xk28mxmKJ_c|(qZV%ek=&aklXg#=p zAE^asI-mAH&>z#Q3hMD1NO&w8XFNOT!lbkvQE%i0pryxSrKc2rNV%=mAKUAH4$NgAZ63mWnQ zxWZbLw3Vqsd!+@Uj$vCMT0{y)9ErCI89uH=o2doNUX8d#V=7_UR|y~Bn0Sx8f4RIo zVJr*@wIQ7wZ&pDK3l541{tpp3I=4?mt>yBht3v%JHCa9Q=H9>VB4l#rJLj$M;x~~d>Hh?#`{8Wx+Qp4jur(}qAeVz3gcxEk zcY+208qVY1;pKCf$FN4$kiSF|jD(V(@l5d{z}dw$bg~N#5ftKhv3Jg+D=x>Mn!-TG zxGI17JsudbYEUHI(P8HzF>~+W6 zlf)>QbPypNyZjprz*Llh(3}gy%+a!9y+={L*!%@7Dy^%4 zyRh-i%(Y|Lux4FCgQX+LcAmr6S$k{_d19NQv>7!``n$Fg`z|Xg==w_pyle7ZJdvnuOT=RW?+7VASn3ACZMooJ6)6&t`vrc}+gW+R z$lJU+f6X_!y}Q6h@srzt6HR!$0VhYFA{WKybF|-$bgLE#@%5fFTCpntRs+S{p5B>&wB}0ErM=j-!36bO`TAqxq(}>;Zm_&mZ9^ z|2`sXU*jIfn{Q^UMz5^$@T;QAd0B%wFv@<;Yx-$?ju9)}oz!+$?eS!Mk7dW)=DHw- z+_1PKTSZ{gSR6%LIL{@+AhJu$Tu1E#4bh4}sdpbe(m?B*x;RK}Iddl3Y7J@lB3u0d zoc3$y82hPT<+jSNue%JV`}GQW#mQnz0i=2e7K*f&+>3IkrD|w zCM)2>7Lo!`QxcULj!jt+Gvz`j+(F2K6$N6~g<9AZJ*H8pTf?R-XVF0RBD&l~Nu{fA zwW}H~LCm5~E@Pq!f8E^8G?7Ijd!(kDE`4&M<*)(qWYuvt8x*?%OtT{Ql6jwQ=#<*6 zDooIY;Yr()6tC+A5Nx^JslwpXkmVd>cczjnt_fh#9f)^PSy@4gQOTWyUf++ty}`Z4 zJ_re0+;90mj~~gO^1o<_FLxeUZ1jy7$km&V62o)+i>f%sq<8JnoHv4(y&tu(rNo8!kQ3 zdC8t)69|-Dd}MDiI$lX3nT&+V>+g`O4>y2zBByb$Dq(8NfjurSO_V@*Qia|4Qr+yS&RG*e8AunA_8G9JM#r!0}(-|MUI7P$$-w zef?0vqswOBO0)Zd8>b5&38bQ{C6X$To-cX0j~7eQ6pvfD$Q<}W#CEUWk6+k})0~9U zZ=|JMclG+@jgkSz-x%Uxc7rNwO+wreEJ}>2%o)C{1gM3_eYjURc=ROPj@ z_&2Po1${X4R&g-haDc^lQ*f5TD+^Oywp$u24k%DB{|fqjforwBi?i-FBC2zmoh0=J zd=CrBt9AFb!y}6e7kn4PP}(27pkbSr*E7Pjl2Pnfc)@_YKGGa^hQrPW#GmLu{+%*2 z3Ye^k2p1e{vAwLFiXW+CaOyo|(@=gq@!pb zga>~g?qG;mN8U7XjrS#_PNL+yc(EnK)#QK)^y2R%W+;ymUkE&VSYNzF@aT=X%VtmikMnCeUModMf6Mr3WXW@6wvqydz2sD$7d%?;GTd&Jo4zV*ZqPwI!Zv@T4e%ky0?I@(Dq=|Ydckm+2z zf6`cZ0E{zpo_wGfm{#;pO;ND93nNSjNd`n}n8#pf6UK%Fs+Ui=+6cZnyE^Kwc@XOu z9x6UFqXBNu@ghKV4MED`1k7=s_*ZBTT9)JFYggeo0wB>+>Aj_IZ_dlielW@^QJfK$ zn^h?tnK9z=x`^pWXvP5*bI%9`G^4mrKu*gu+cQkchem6&N_;{=>hlhl#0)d8L?pVS zpF%m5^7$M~e&7v0KqrKkgFL!41rJ*hJw@W>KZp!@eyC_IgE(wr?uh#OpDSoxx#Xzv z%oqxxGN89`RIAwVgO!P zFLr?QdlWDIIye6(^(uY>MidaM3mn5;a)@=h`VCwgMZJc?1X4l0Y}XwXX)>VW(9qy3 zqAwAMYY5LAvLi}<9W(6pML?tnuBve;s;;XkyDY3c#{qG~fRrS|6N@S8OdX}BjrCsu zuj|A%(Ry$~sJK`VgT9K4GDmP*)ST?5l+3sZosaXTJaQRZ%Xp;}z{el3F*y|QmJ5%4!XyFoQ=oxg!R*!Qk;aP_RuGXK8h;AuKGAww#|s~l zY~_GkkkM$Z+s7L>;p@2DG3KgEVj@fm+hvg;{eTRW9xevMJ~b+eN*%SsqS83&<231I zpGoxSHBbc8oCsCaHNZl`A;}0uRSX9MiB(QC3oL!$`!xA-7DJ$?_JkD8x7X1m^`%XnG<94T|Z>)cmLGP(0Wz2XX+m^&nUPdOjntPBJ z;SrC9Jf}Fa&$Si@p^>i%IfvbmM(C)yg{@IAyQ1o zNM9o#%Gk*I_EF%NQ~@n`n$8WmOAUycU8P70V?B`fgic9Um97!mICjeHXD(^nh?O%< z1p?>f9QAX&VolzN6Z5r_;X`rku8MAs?Ye>jHW3lH&0zy9rqF?BbnOgc{7zt3H6rU& zE>k9@u~c@z>w*`vaH}AzX|oP8HZ|KwTAVBH)Oa`WSdO7`(?&I=lpJXfQ9J>t&uqH! zW2P+}<<&(M&S=Q5Mx|5QHR&f${>%1<$5Snil=C%H(s*+LEMK0^Z71cCRlMm=jQIRss_Z{}q3- zPC>Ax{;fKPJALsmj>{r!u;|0TPmxoWsh|EY#FG=2yQ)F+{>kCh@kzMljA+&H96>$c zHZPGdlA%MV6{&;c*{ak~4!sJR&C|}`wK*uBoSa#nmDV7!+!|HnYMu~z*AO+n!%=4+ zeC}3K?3sYU`+hv25d^Wu7f?~!KJQ+3+6ZMpnoa!*9+tNdrI+wYeQ45tzd7o5-w+=- z2%a!qjN_JMlrj^i^$EAewD6h3x!C)9ENK22tBSZgoC0rcKL5MEbqwGi01@%)+Q!cM z>fYAQ#`-SG9ztjYdxlThP>A4PNj<6U5u9Y{zEIzpdN>t6f@^+B6FOqEZsI%_TVZ#We}*&*q6wIQKP;n~TL>wm8|#cT z6LIMy&=aPAbA71%5nMECGtGvmPA_C>v_cNXhTb(jVhBE7*i2_7?f=&a3uO~(g%NDL?+gXHUfnQ#qhgYoDNgbaw7 zz@V;f#B;ckISjRd0e16UGy0x*hP66=vpj9PYM}YVmX64Sx;@l2XJ(=8n9cjt&Bw&$ zOxqsb;R%r*)Almf47^DPR4TaD@fO~iX<*# z-UP#CV<#bQ^Ls%+)Ov3IF84TWthT$N|h^Ig_M-tw_QzZsk2pP zlRztCEm2>k8uGSNj9oW8cnR@a^e;jr*~Epx>c*xzilA7#DF!YlEjt8{)Jg^x>7~K+ z;6XCU#Lg?-s+maH7Xg-P8IUiOhgByy>4l%)8E1665{a;|O+ejj~w z?|>ANu66(`y6G6@YEbv!{E&CXBJqks65y|89BDa`!bk+=sHQa~>M;!mjoMUfUmS4` zah7c?Wrg<|Eh$832Q^z_5*NZrsIM}#>Kf!Qqwqt%ko-51Ae-LebKL1`LF3noz)z*R zZ&M6%YxCKo#{U*tB5f2*`y0#yHjhsMe-_a5%M^eIyD8aUT?=^HXguJy?xkAm937!O zD4XIbB2VnFKs z+YLy6(!>F){H}AaV#5hWfRBF*xcS zBmDFBc*vYJlVK=9(49$Z5;bcT(=0~pV+X19ANMUOdF9&~Jvne!Mvc5HdsPXV$ELdA z1B0`_gdOW@qgLznU~mStp~YioL>W*SA7VSL!4~rKF2+4LOY?FJxw=Loa{trg1dDJ{GnRPCW6dxg>QFRd$!s`lqP;n9@A`6h<!NRCBQ^0pE!0m0Y2GV6r zSSoa}@Yv>V6>A^}R8i?QAYW{Zo}3!i^o#<5+vn=d{p{%bfYF zvsLycvJmto2!y@MxV-$B%_WI@=A9iWU)F(=B7J~K^VArL_*kaqdVEIvCPE46rRlC* zUM{$<@oqQ(r};sFy~>!A4%sA8yrAm7>`;r?(M8o`v4u|ds&c(mH8JaX$sV0 z*AzA%7JF#ViB~*tAqG)3zEWa@BU1D!=hzF@>{mWU9^r;w{Ky%AiD=WUC2%*B+>a_o=`l_9^?A^jRLNa?yE zVKH@(=%WDC?;VpE$M&Gch2E4wgxL6dSlFlixUt;^E$kXC8-*tZu}C@X3vPvpofS_9 zix3Ht77$ayZkXVm(2*I9;WCx#?K-m=%&ra*;}4U_AxT~~;QGX~uBZ}VaCvvNGl-D; zT>QUjALDBQ>FJ}zI)OlpkMYC_R8=IiZ&PNPIKj0shk+?rf$A|!rzI7cV!A7;HTW7* z(dBKqc2A+`s;>ELoTMkgV$!`hfn}0f39^O`21#5oaY#1A(4e3?jJt4VSD0PVcL{_$ zb8|RW?JQ{`o;iCq@Am1Yn+%N)lL8b5DPa=N=ER|Q>yJ8XFt2@;BZ%XF;s`tes5wln z8A1ChM>y8A#ff9o9hlb);9ZqNi1%97&9&6T(deVTcAcb8EK=yP9F+UcY?u(DRx(HF z46B)$bOw!?@K^Xd^jo!@qbt)J3Y5XT_XF5q@T5Cj-KfLXAt&;-pIo2f#v|Hi+{;Us z`~&lfi3TK|bg?#I)?{#+?dDIvv__-ThX;%EPexCUFE8*Ku#5 z=A93Jt8i6_cfG_6c<@h8?Q3tNh4|xxad+i_rB49^loO=HP@Y{1;HA$40nXCqg)zHw z)VV-2Jwm-nq|Ekk!0X#UKz-nfmB*B|mE7TqJICHeACKtn>K(8&yN65PK&rr3I0v5_ z^w-ZXE}5r7AKh}Q#4Ry&htF9o0xy=~oB7;o5Mtf6JmMdDJF@{2&sr?-IthQ2h?XaP z!J7oicfIk3uYL}k!G01A)*I2?4tG}J5vkn64$dJ@^h<|jSDtb7U4sy6zWF0aVtCtv zy+j7((eko{fI&RVvfx$H7wdb^w$|EhFqVSrvn{78gQosYLwdITDjUT)Vs&l*G1rFAC22MRs?h zjZS;VOxvnSGh~H9*|LCMHA!F?+!_>3aj)VvWt(y(Vp50aaGZVEk;l(Wyy>)(0WWc; z3XdQIVW;u3XF|7DMJZfFrG7DLb!L#MDbdi_znQRdF|ggc=u%kNzbLDuAeB=`t099mJoPc`UGQ!h1=-ko(98_V@EWLBcE*ekEB&LN z5$TB2R)2L8L@#6wP=t&_4`p-QFxvvT#v#fIr=7Rm9gMN7`4PNgSDEzhS61xz2e7b^5kqKI*M;Mjw#~8 z@hvTBGh+Z^_p`UQ^>VNA2s@p7+1K@*9s8OFs};)wLMc}!jeSx{2;wN3C0e2=0Rj2Z zOHqQM5}98Vk~e4Yf+hdo+yyxa9qniHu~~+R<9F?ZLj@q<-VEkGhezGl!~m;%>UIv# zm|d>h!z0MY{-!^8*GJYw#O3yJ+Xwl(i^rpbIS7du-)r{AOhRv%5#Eta`i_s9Kqx|9 z_b|iz-^7>7qNvpQQ&93RE}}j!3mmD_6Y&V3u>R$7t9f^Ha4JkbXk2WkubOBnm5boG(pvVRjpD^_& zKuI*NxOi11dwN3!eZo)sf=zvhBYR`CTE_-^xd}M(7g4Kq1ys|G)l%Sk?$l9lT_woJ zK0uHz*Q1JsLD^6jS~3Z-@_*kDa%Y7}xhwTfya(j1KnjDsu; zfoYnXFP}4X^pLj#+>+a$*>7^@EEwYO6K?L%viJdk#6VDybY=%uTJJZBZFXjZywhLk z#*-`sCZS#qV2?dd(-T%JO6E#uawbDHAW}Mx!a*1&+QDpXG9W)3w1}Szp=hz{J>mtQb0T*D5J!BBm? z!veD~g%0mw2O${0^CQKbZwoTfC!kL$M17i>Sc>C7q*!l;q3S>YMO^g8O+s$th`V6& z8r~>sjO!@a!QcZQSQkXKH!s3fsAXJdCb-a*3&J4Erlvi8sk~T6{Rpl}*3c?`>h()+ z`zO|Ib=8djKX#in*?tfHp|Pn8z*zFH$OfNT^6CAQZ5pNNF3!|Tv{oUBqv0=m?C-CR zkM%)ZSdw8+AVtYHrUWwQ?(COF#o{_wM72GtjCf3?uQYq*;S;o_`cii%c2jj;6&7CDx#T6S*p`Y zma6=MN;C$zhMtT)`YJ*@dNgF`EgAcWWJxO<%3%w@;Ku`r0!ITo89*qJL3%rJ%w&RY zE{q+cIigFYmx!k8aT^r#W!qIZVtT5qy+ z6U-^c^XO=@$*T|96eOG2rSHTJ9bF#vrzv8B_(o1i(5IV#NdwyJ+C7?11C33s22*0%u?t1E2zdHWzWIiKx{ZBI!`Z5M zSWk4Y8W7GQsTCczrw(upKHQ4te^KnS=Ff2xO^2vOo!Q`SJC2z+=Y8BAAf2)xS2$8| zku2*}>O9hNaI>diVOEiZ1>;JejXd!h`lXUleH9@!g5RY#+P?f?Cq;h#>&!}*8lVuz zSNVr_p4LpAZ_yV=NZ@I!e9-n_n{u&XO*}1~X7pC+exa=W$z5g9SLSXqH78WYiiith zZ>Z7ruq3Ky6sk_JXGkO$(!i=NhCfZheIOdcrh_I(Fg5F(ZsDX5;yf(h7zdo(JyGf! zbCN*!CrQH(btmt+MA0WG0DIe-7zG5E&)B1j#8$$k2s>F}zjENjbp*=9jb|4}G`QLK zHZF)LS}k=8o!m|4vp*UncF1>Th;XTD?GOP~$9g3>#Azvjz8ZFnUpV@>LM=O*#Rfht z)!5}|W>SJipm1SU**ptjh~2@7h}q#qqk2ljDdoZ zw%?e&{VN4crmHj(06O*X9i2v058)ZWZvSogG+E%N5JYgmVocHGk8iXe)#&=h?H$-gElMMKHIEiD>R`moJ zLXu6<7pu0h&nvw2fJ8BlD#)UTn`hl&dvtnri7>0nc8^b&~j<6FU;`8y9A=ux+|8sJJap3U5llNhV%}a4!kD2&!unTB-FN`OucSksN zMQ91n#jr)flNGocfNNQB>0^`K>mP;}f*W5hekoh;cRh^$x{JN{Iqr)c!GLdkwRoRb z>)P$r=PSFr?KaZMueV?BuJ5$h)_KyhvbVk_n6I~_Fli-Cu3-Odz#jfEdcg zzNB|(wC&T2?|Xe5Cqo9GUL^J+%2o&G=WrY#VGj2FEFGty5fz5}jWO1Ze=$R?t%19V zWDO*MQ{@?~fOH6<-${qxFZ+^N49D9fdRYsm9E${O*YAiB4E><-ZR3E1)5iOSxI%RT zT83JcFLZR^OY6Zrw5T#mz_ZR~&L^P=mbu?9h$cA6ua$2mpj?=lAkzbU-fTX?tGJ=J zAl6D*2>GU=PrOy${$YJ{eP`u4@gYaf2#J#K8*9(k@iEKXbm5_xVY6bivMpZC88VIKsV$0C`=vN(aHe4vLFF!EPvUYFi&cm%^K~)&7>${4vMS5PEF017M^6dl?#XPtRBtEW$5bc zOgQ{I#lzDMlwW-PYLajW%pC}_LNt>Y+ogGAo!)5oN}k|4zB(&|i^saNo9p)A3tZU8 z0=$PRsr#C2d(wLgggc!v$eC=BFRt>;8{LtKQ_qbR^FGpa7V+OFLr0&Di5f6!ll zkBhT>!DSh;pmldN&yPP3hHrSA8zKIBznX=!*T@G0Ok@XpwP#^+q2dL5@-%qSqYaC& zIlI*j$pTuX!Ez_XFXTQfrnTOP3eW<$ZQ{6);4_!$Y1QR}J``>C@1Tz$HqKvy@FrF( zC$5$8;!QC%_T*&*oZ_cON-LzCm~Zfu$1@dBBf6%QrXSCDvLBFxzwy@|KG7(u)JvTm z__cDmAw3)qx<5T2|DBYzFa2hX1T?lv=$Jn~zC$kkWxdz31gSPtH4swaWtf$Q1R@tz;EN1u;VxkiCVaBuOwb3_jxt1doMwDw05B^U);~FVCp^s2ZAvP2Ugg-R95#FC0z3A*8W@XM@w%>lxjTzIp>{T@Ef8UcN9Grsv%lO8qX0a6=F3+kZ-WNn zLSPSay$;ogVpw#tJVf5Sk0P4e)g_sPwAPYu`m}R8zjFQs_l^6bq_udxzUfC1Y$(g_nKXJ%KG(r zRv|e^a;YTX(Crqw^Uy3m{FTLvn}l&9JbH^{yD8BY`p_7xR0-aK3p*LUF?jvoF!B(H zKdeMz$hLz1hAwhg$@rD|h4aIbib~dnPysm}o_2;5^VZKpx!F8yLt~Q#TEQ%)xcI@D0xD841{8*`z%deqxni3cey zNRbdtqA>=M<$fO9zi|u2gR)sv`%H>j=|31}$i5k?)aAXdEGfU{qkf_o>7Tv-$hy%Np=N~|Sd_`JAM>4Js?z_Vk33TJw6 zsM5k^j1G)z{{#eyvEoAXTV{hypY$7RJ&4ZpX0q~{gb;^B{%i^&lY5ukBGEB{Qz}{x zGCm+Zf88Ah4_G;o1iH#(h&leNS-mYevK&jSrV*wl*m8s;^)FK{OVpTe-$hvQSc$%!dtgXzqz8X(iH8 znL-x`A=Y*V&$4|hsNirVm{1$4&7F;81D;9iCOqo2n41U!IP{?MLVFV?4<$y~;deZV zlt_>Zck)AMq^B+pM)f!bFdD1LDM6Ia!pfn)_`NC74%D)Wo50bAzv;xpq8#v3^jX#ia)kMFGD zI2FB+Rb?CylW2b>23AE4dDltuB+x35^0Ya(8}j{0qltUTbk@Nw-@@OZ8y4_zR)T-j zfe`cYK701li}p|JJG_nPx2Z3$kkY&bz5rFWn#|?*{l@0X&fl4_cUjVr>F@bP>04(i z;ZdM+u>OcVDUc-qwWw%U-=7%;*4rQ7=<8$G-MJt_L&SP#D_LO zTngv*%HA`b1uNY74z^reYCU;RdNw(Rb#md39%VM;x?f+}X&XFom}^GidB0M)uw6}U zOu{-v&f~?_M1LEMQIw<0MNF*8Rb9dl0F%tiM?|nWa@wNz{n$P1R!(l>7{b78s@We` zmk-`|&Mz)Fs(F+G!jwoOj+LD(mWGRpwG}jj4%uVE7A3M@7Uhh3( zq=AK|tUDNH@pVUE1UfuFA_FbLGb~R7)te-{)`w;QM}(05PDGo3!Z4v&xPg+jA|Ih$ zwNE_IA$`^KqYz6=?V(Y*y;%muj&`mt5Eluq2?rx_4GeQA|;FHyv8Lo!p4%s3W7xz;twt( z=g0+N$ei9o$3$3In=NlqHmQrDXRPLAS2+_P3v_V zw>d-DEl#a=Kb#*A`XBH(9ultf;W{`lt2oI-ms|1Ex3iv#pp6^1=YBVf37fu$@&Nj} zmfMWU)_hRm@Oip6;j+wh)zidJ6~&X7$`(S9obU#ZewyJ=BjF@TQ=^Gc5$Hz!BzcY+ zO>6@2$zM<2TiJWL+um7US^GQqp~=wg523}bmf}A8*%N0IIWcSBn7q^O}_MENL=#OHmShMev|iN zam@jiID=e9I9h!yHa_%21Q9VmhuE>Qq{j?NEs0B-P!)HjYLJ2}OWB~w z8HM35t{0^GQz)Tl2n>S*ICd6m*knc6fvLij&%nN;OQ5RXVTJ+!PE7O;p>Yj|@LY2;fn#hogmeY4)>Lmo4RatUL&6|8?!up#rYxPNEpWe+Z>odsx%3O0UFN{dylMXdJH=&eJB>6(x*$GnvUJ|l)UJY zUH5UhgLmcmWObLz4U-)&%U}lDiDLLiM)<^VsbDK%$_isQTEi|LcSF25BXeAdaWWu`uN3{OlpG;IGgN|y z5I55B_RLYE1*bKXk0d%f`dm=)m7;yszS0F_wFMBx=PueCA#-Uw>s{{*7bY=v#pa$u zbtdg`^@8jv#fsDKaRuQ-qFMroeEAM}ex=I+(+?gsj)#Nu28By&w%4B(2)|a8U)x?T z^b2~VIi$0-*OhsRmli?Ha-Y5P7S2Aoz5vXQkkP3tyz{lL%j)(^iBWHy_0GXXBtgcT zb1q-&!ccHwhX3r=RZ%XfEH3pPv5)siIAI(UU0#6)`5CmG{v2Y+3k0Da2}ysgiwmxU zg)XR)j;soR0s(xj%e0NB$z)b|D7McTvBVj)RKS=yndQnohC0~f3u%dN< z9gm*-tjZpqb87NbB) zbGaqwH!hd-pnljr>p`txeM2|*c;E2ww1GQ96ulV{d_dkHdeAg-252NC!IiHrsst67 zQHmMtF|CT+PP21SI@dh_j`-0)j#!Z!x9Exbul3Ef_TDpU?)L7=Q@(A6ecNOwoA>}? zhqC*{5~=5ySe0S#aN`dPE~)KDq5LXd72n(z$A)2IXs`#m15+Uxfd0XqwT@j;5(Q~ORAZoygy;xsSR1T(A8NL|I)l%Ydm+Fchg$CRfIWI9&WQ%* z$hL+#c8gd)2rKeka_>OBz$tG zd&~p|&{;3!X+)h4FSI^=xw*QBgE`!3RcC76=iE?Ech|b;lsWEJCEwJ%eB7k(Sb`HV z4di3is`|G4*73IA#N|a!YAQ^qsSBNaS@@QJVwQ1E`+S9gSt&-y5KdP9u^D58Yu zCWyaO5RqI!WcDfdhv55p?+|(TP^TrQl|d`I^omWn**sb`p%%p(*30~kcJi4k3U$Y63F0I$iE4xVr95g_#*czMV?n5m zM6~fM`_3_{UY~S4H_pU(iI}eGP*zJGbX&)nIt8MLiU7Iy#HIy@H8)}JTIbwCU@9Jw z!RsCxl}5XGy1Vn8vv-{jBj_SNXzC2r*o8l7)`a5na-52f6odWdXJwm)XazC1CtM;4 z(lB3&Dk`o&CrYft37$E@yHc^4Q2Wi-A1)9Ijr0e&ebQubpsr#{MUh$Hr^MZf#Op`N z^BlV;FmAS$!Wv|2=te|gOh>cfPehfu zcUsMAlnQBTyQ3$X{M$LoINysHH4xA4P){!VAe{nKqKFBOBkoPrenE6d2YP<}X0iDQ zh~yCR{{%KazZpv4~cZIAcoxdAVpgvRw*^(TUVEsy5e2Y8kGjm}Aj z`8#A@8=nc*h}_aj`O?$Q?|n~6U_EDk_qdE}q6k1tsuAxOx0 z#e%gHr>|v?3}u*v8jgb5@Hy^v6s`GnoUB_x@FYV!X0X?pr#f1;Yx86n5q3SB~r~#ExPi#=Fn4Z!Rs7OUXV!oBmuAbQd z(bM5zC~fF3NhOiw|Ck6>af?sEqg|oL#UK;;S8^{z?{*K4Lj;MXeuss}DH#OXsDnUd zxu-Ppaq36Yc_9!^ke&p>9SwHnlNVWZYa)?2p-dc=Gb!SyE$XdG)YmLiQ&V1W0|7rU z9sNp$#l?u@}#WVeJ$Q(N( zKW$G5H%_UXP;aD&b(GZ5e2%l&6^Oa)4Sb{B<-TH*f=@$|l2W-vGg|iG03Az%YqEHV zh|!rzhB~Dhjlj_B`dO}U2C0MDeD3&f25&vc8)byV4WY*a35-gZ9%N^~a$JqffQ+A9 z0RtW5Jp0TAxMG8Iy;)q&j7lEX)mMej#b6(O6iGTWPF1z!Q~q`#DUjw*uf*{3nA?P+pZT{o_2o6E<9kmw{#c z?>SF)2CjEvxY4Epp}I+{mn;bqHM5^>aYRe&iH>deusXJeNgH*0*wAbvBEx>G7*!($ z_f;%-bYK4D2J#it*iI6o@-;8rLHbi(irdoXWZ`>tZm0jVG)b5((lFf=0&Bw_V&IUQOx3BO(N?~0tFGH_ z`Z}(`D9DDR+MYbKfO8+-HTZN%QVmq1@}5ovz=&KxaAPEmx|veR)KEeLVqj?OM-jtxz<@qeU`jv|w}Xj3l}N=cnZ!K@ zKQ|69l5L^63}Cz&X-*@c>j=*LKa;_A4|n2S%OKWUKX-z(R&XP2R1uKyTf&tSCy|Yq z-V+)-Y*oSv2@sVjElwQO&|A(33Za~oc;G$U5}NA)UNkTVA%0O&=}h(5<^=;v@Vy8u zX?y{Vr!_PHC`cZ-q++BK&VE%d1b^d$uj8&={OE=M*kA9c_D2a;Lh)^YLf~{WuiBU- zDaX78I6iUQBmIvESll3L^@I`F5jB_XgS5Q%xJ@Ku_OMocwPItz!y*PuhD8x&V>7bH zJB4C%7OyjE%9Y2>Xm~Fqe-9(C6N0`zj%Wrqdup~$_ZqwF>p!*;WehO=^*cq1Z?EQL zER@!D;44+XyH`DHyR4eoq~^B{136_~-eO8>kWZeH)EPG=Ei{^mQ%b-LTbXg&S#Z9c zyi0gTBFU2YC>5a=mFI z`B5^KIVb-hizeVTOBY}1AvrFHFw}1h;QV(;TnHvpHBdNB#jhs;t+W|C^)VEWanm`Z zV^bt0-b2L`C8oguzZdx4UGWrRaU)lrhj5H=){&fwVEE*0MthWK56fBZcCqtxyny+! zxF|`13vh`XwhT%z%VhFls~|!n7~;IEhbMc;$9v8oA?#y$nIpWM${Qbc<+5=B-!?CI zCPz;K2yja6%gchj5x@(Nv0<6R@`zcT7jrR+7QmN1x|D>uG$qdIK_iAoAzWs^{zT^Zbl8vs!0dX+_*> zWSj}Q_@A;pIGyb!o>wnkpeIk?uIjvOOhwkx-E=X8;vuXJopH#Fh(k zV?}lK7`+tLcEN62Lxny;_QrCeK-88#mnO7OL=tDA8hEiI1nEN#PZvBq=Haau>wC|( z*2ccPm96r^V+;9<%ROevd?rSf9w`XQ{J%0UBOrr}>Nm_SoAczUV$s&eryKaA7P4V5 z90d&w>oMLk(i<5TJPtC@I0|_{AU<_4F8y{s0R3 zJrNc}<=ELK%G;(rR&Q42VWc>Czp6Pa{xFjB(d9xMY&uJ@A(wwXC8_y1t0_h2v^GWt z8B^4D@P`weL-7gGl@po|km2d0C~eYBlIramH^lBFMYO;QZvOx8jhJ8rMZ6^FjUR8o z%LrP9=~lU?v!N-u?bxV5;O}7wKpX}rl6y%7FWVG(y2A^OH!~bk{3HfnX$0kg5KsoR z^)h#{C!U(%QWxnE_LE6P_dCQ*zkm6*;x}DzzW{cu!%NnaU8wFZLWp+aBQVR5E{rT2 znVPEiJezQ(e0e#22vGfbb-*Xym&9w4ew{Fh+|~E{&V+9g$~1hPZINy3AGROmd+b+Kxxx0*UbykpEiX|w1t$O@mAvIpy)a}tZ06&Y3JQ8O?{7t0X z9Fjab33r@yD<_k*%h=(rZsjTtDqrFGE{MfV(U2~CE6fd;%4i`g<| z&b(v?NG>0P_;cyt5s>WafIr%}$vBj^qGL1SF6opK@;4Ea9@N-9J6>K!2w>D+)4_v| zF(ZymsI)h_b@|#YKH3T<$0{bBPAB zElj=r88z*g@R^fq0E4(qM8h7!*^LscXPADhOu>YL0|- zcL@s@C4qeFax9%*^Z>Xf8;Z$@s+VO=Efrk@J5h5DUbjI=xDW`+LC$RU+uGQCy5+B4 zS(DK{1saCl=fz%v7h+0ujcTbh+0j@47iD`V4&E zV2fH6kK=uMTY4D=3P)439Mzw)lmS<}cFE6RB6e)>F=9a0(PvxL;A0Q3KsbH?h1rgI zHRb-I2bt-KluAuIozh?fmzE-7qs97fcx1(GBm*Krj3t3;&W{8@FMY^qD$IE|05TRgLwfU7d4%<$Z)r z$C|{&OQ;vyd&nWbE?f8^0>xchr%UCr;dSyez2rCPRQZ0PJ9&bS!1o|(e(S`1OLhN=P4OeK@W zO~sfXtTchl!|lAEV0MgC2q~JWvhL#rzq&81-$P0W zjw5w(eriRT&C&1FO*2W%XW@YolAM!;2|Evp#)rha4FlhkZ!3aRViMFd*9|%HCO4J^&LLr4UQg@m(=v8b;*93 zBqiWbFt>mez022GB4z8s?n|=TEQL>W^u+lI3MEF|a*13pW@P`N<_%GF4&F>f_v2Sv zxYi<$$OXLBY>e=ayQ6=|MSYw3nDq^|Zy|3q4T{Y@2#j3jPSQMOO;@5~$WZN=04VDP z6&z(m3K`4+q!uGukl%!zyD3tfIWadr((Bw&yjXetXkhMoZ}`W*dvzf z012@x&WL=sMW#4n|FBMACC!v5%`Rd{J{!jjHREJw>BF~>+-*Ajips4G)u8#la^QR z&;Xig9^D~ounQgw@jYf7MIS9QfHV4q8@hqLrGPuS2yjAFgPqZE{6)aQjDuQdvH2Ki z3$?G2=$D$V}jn#g}&k?q;=BH?c^i9Of7c(pm}2*!GG-qceH3qR- z6=L2Xm0$i1J?BglMVMESWta65v49s<4o@Kz_79d?^UxHt-#-5A*Mre33Wo?=0$ljW z*@Yh%xK7G^F+UfiOx9sk%oI>5%=`G@GEJl#Wo8qzX(CptP>SWCQC~ zcvKG3Vwz6wI3d|E4|#ns3KqN>w}VGB>yio56{7111t1A{<7&;ZD~y3YTXSzz%ZTKB zqjHnj1M?;0tZ)8w{UBTjmB4vFE}1Zd_FO&!#-!2yI2Ya@_y7rbcCdYV@t6A?^aATa zn&9J+_CjbIyOhU|8h=3+D)AiZ2<%+BJtS;on~lxAHePR1qgqS!HBm3P*ZAL1Z{=@l zTnZ7oBnhtxAfMh*@2&Rag-Acjk2vP(F}-4+7CQeN4VY)bBX%!zKFn!4w)Qs-qP>3P zlz@Y2rmvb7;7q9Lfwc&ygAnWU3E;J}CApX*aD(FX{Q6z6nfJ%to${Z#Q!PoA_ zbdEu!+xbZog%e^h6p#I|&6ECOc4aZtXBEC`B^|M(J8Id{1zxHdLwz7T`G=Qh;JDB? zA%rZ!kmCXY#xF0q*l7fqRVN|HVP$xd5>J}a=w9Oi$kEBEwh_oIPtkp^@epl5jy?-hyUsh2eSKWAv>3TEJ6BKl7O-iojSK?kBvG(rKCiz{ja zF%0fpY&)%ZLWo01H{z&}QO_?ba2}2*X~qF$rmWbkSEtw z$0GtGo%MA!S4Ido;e8SrczkW*WOyu!0}qs;{!2-V%Xm1D#`(oFCEX3LhAG&;GDr|u z>ER5oyMc|%o9+inZvR(S)f3$?hSbMWpa&t&45?wA$In5rUrf|rN=tF>@XS=zB?ENz zB~`rrH5#1Z;lwd7ty($XUS%?K|L?dLM9b>Wx@Q;GblN7*@c`7#nmixim4~5&roX}x zUN`JIpUXm9L4%De-)_`Umg5%9eBEx|bkFz0(>3*h97}i<;3=OU42LAwPB-)rnoN)5 z&^Eskb={ax<#A51?13I1h2PgTB-x?WTKDzUNob@Wr)+w=RyP_#EAKKxWxA094d%Rg zV6!pT%#FtQPd*z6IX7J+x#R|`@8qrgbsbz@ec1VMgZfexV?a~(ubsLMp-tW)RDEia zOB$~611_tm3un^}vMaew8LWA;;gk_vUg@vvMyzWy_57@{{^#0O!f^*8 z4NaGh1I}s&$?z0s^k;iKw|idF-->mb}ePN{hYJ4BNSm#|}N5~;5>j{3Nfbu=fS z$BzIesiOOotJk2+xH-Z|29eT9EBh4)9d^CauGUIM%f55K?1PMHtWi!9l-Hr@cyjZJ2^$zD3-#juWmhm`C@Zi zgP(gxm#0!+wp}r(L!gswW`GlG9kiK+({rm9+YBUpQyS@?Mj>Vo>J+UdcF}mvco=vS zRl`OSclkU@K6a`5Uw!AuuTF&4GA5~BWRiO-YowsRQHHQT(r!%+85{`(P^zLg41y9t z@(b*CIwyG04Vup31ZZURHzw>M>sixU&WS_#>SU`!q++;J#Fcm0LW~ZxN zU=1K)Fh!E)GfcDSa->H041VSRkG!}4kLoz`g@4yyF=pjE!Uhc3+0Du}jskMRy%<;o z&hAGd${-CeYoTE^5;mLUe}BH;dh6;w=Zr?e&L;bC@5Y*Q`czj}*IQRtS0mJM?)QQh zq6LB)vZu`CfT$20kn~_GhuKR6p~1ysG8Q-JGzWN@LN4qjs)XoDbRui_kJ1C|AZNN{ z8z|H`q%&GDwA=w1tl;0guOXw{6l;arfD8)q>uZkG9f5))P#X9!ccxU-$fHO`I<1zp zRY{{S53k=r;xiX)(_|A@(u%l<}+pI=VW>5A+h-QbXu+(;&p@eI2( z`}ejVKiR&!^>mx1vk*!$t~{6@znr}~gGc&kL-k^CHQKG6;<7<-aHLs5^C~wV&XGye z^Tl7WwF<+JRM?nhh$I=$94;^@qae{sZ4=W@pHA_l*STabeY;CHYfFTG-b|zoIZ}D7&EmVMJum$g0Iy+ta7|oQh(v*7uG~ZTzNQZ_bDXkOhfdF4 z#{Ie)w@MK`W1)h%%42B_cenP9eCZBanrFDr50G1cgcj3Sm1iuegCWt{A}^54tdWlW zi1b1QUS;u8Q7KcqY9)rv!w3uAA>Bvt9bQfbCN4&4cJuKv~H^pRTJ-*0q#dZhCQI_*>&f*AkrV^B$0{ z-*G>p<2SfRO4H9z=_YHZ#bcyXE-dCYh>i8NsVj)5DF4&5lVc`NicYM}rH-yca$hB} zYXerOE?UimH!d~AAVsjU6JR6mK(`6))uZhy45p8vhv~`A^mHTs!XBGHOl!S(MqJ~^ zuzH3f42V*)MFm!A65opwX`U5g00tzKE9V4Cy7b{SpUS(QQ6@PTX)M39tfkQw0VFo% z*V6G8sGR{92x-LSVc(D&MAHJ(roIZ32v}i~f<=K^dIHlmtr}HF#&_yAEqf@R0YfSG z8fxPNp@~D*d25a3Fm+i+#Qm$q-N~6O>JeV6;fa%5+6{vPs7 zKKke@9#_8e@#3q`kj-H}ErN$HoBoT@HTuq}) zBB!g%0w__iL60Tuk2HfuaMA7->%u42+PtLjBqYV*Wn?>>1Gtd<6Z?^LA-i_NC>@qA zJ*g_fVQg!iMsJBB7#(CmCq8=Lf`np`3r=!mOO zG;z2Ssk4|%cBPI3X(K44wH@|MX}!Swzx0BJ&d||K9;GZ)%93 znzMNHlBT{h_du+0uXPX;Ubz?(j92-$qVHXeWp{R{`zbBtZEnS;04Kq4qEP{<6c>83 z88&-Feb~!b&LrlKXMkaQKx^V-8L|a5hp&q*@Lz5sJZjC$JSSUDm&@K~<>A;blW|1h zhG}lISCztV2w->8Rm9P~gmggAzR~BhAh$kK8&MKHV1x;MwnclG0_3J|?JogJT9(5!+lfnHlk3KMD1 zVE~ZgbTT$)%o3NLF@Bv_`BIcTrX${Q1JmTnNTWSa-(qp~mIs3RGa1K!-q`))=JQYga`mr} z=P)fe6h^-grLR*0G0(sK*BMIc#9N;Jx-lkzPsYe7G=-ozqUVa#(*LWI>D!I*pZ|zm zDx!5`%wE^4p>RgYRieGqpcfh}1(R}<1p^A-0ww{6X5bp*II!CW*2)dzz_YQU!2%&U zQxm_uOCW+NI>w&$yJ;dRr(r9-Nl0~&cbVX&L8Cp%{ltlt^l?239A3f!iM``{IGOl< zeui7TVYeu5-|QXpNZ=Ldqlg3f(0f1PRqMzX#!wg2^f6*$=`%kNj6MarpkIb89Gz^i z>B+8*aG1T{V`d?`n4rDcvG3>vsqsbpjoe6yBWgg-iB(=-9o-q-qT2gNL6Ww`K^R2N z`Qi#)g@87~`M$;874C6N-n_u3!u)J;qal1l!;cp?crYkH;BVE0kg=^7FHWZKW|H2p zbN1?$CIGqMn-(aaf_dTHRw|-;S(zfGAMU-5o>71V@pCu%raiK$5*5-e_{q0s4a!0# zoCI*Ccq^Ew=G;tWSvrpDg( zYgH@YOhudcwGsK$O;PY24H3!e(!|Z~GOgCESEbmz9nIeQ=2q2OJobn5yx}s3eJTBJ zI_vnOTA~$tubb%~blBt3$(AlmnGU8=Qw!KzX+ z?kc>NT+Ig|6W+aKm!}1cqp7OgT9HzuyMNR{BCB0NNb zOEbcwNo^C^s6JeW47fq5wfR2;ZR^GgVeSGBvSZ^Ht)DHJ(J5(Lg)`yWNw%So#ZtO( zEbJDGTuj7+q28>e!Uo1mZ?FjX>B00EP4Gdn`~D?Q=Ih@w+0ht(*e=TECR8lW>%#?> z-pJzGjD+gq@MiLMBdtMLEx@ayR$Q6}TOdL{Nv)bW00P-L^}5u&28%GjIvI8tC(zx0 zJ7EZp^+OC-n3B;L>l{`YFzToXC~zp(Y6G$`lx;W99K6Fm}U+X}_EUVcRj~mpJfM<^{O}^v1qBV34Y%J+!*qKLk z9c8BWUmdMV<#k=xMV7_NSMPeP5@mL$fLMCr7Vk?{BW_qOiD$Ko?HrG&DB(!dvd`U4 z6X38rxT4`UW1A~MacZ4y|HK@qSZ(L;adzMOh?`?mOwPt_wtRli%cFPjEt z$PjUiM|$odFlVl4!=46Vg}im9&L!ZNbpzWSp5~1anIFXOXcVL)C*RS($woiJz(h&mrN=lZf8nM{;X$}p|dBZO9M;#Mqly8Cqg%H*yFCd|I`{&@a&F$2Ft zXDio&1s;N|@N4mGh4EdME+VR^9@G|X@6xGC`t0E3>Cz0Y%4NK<6yf2J*&C2qhWedn zd4tv@wU>zTFdLk?C8O1O-R2qP7%(V>-Od-NWXEFoGC8NSQ`|e5R-dEM?#GLd7tcp5 zqm;L@rl9Uk*{`MNgX5li zHrkGE!5oP&_#Azs(eMRMC}AJzv%M2UOr>m&HDD|Unt=|kT-e*A@a5YbDFyV~_v%_p zTkyZ4b$#@O7O!#$Sk&{+2h-zMLcx~s+V0cQ7f@6Ddm*}M*P)hgxszsEk*;=viq2Kf ziBLELJ2}MqAk8aXG7(84p?bI&`EdR z@~6Z*JRG!mJ$s3OpR_~it+lbQsU;T|{sx}l1d`?-=MzaGCuqTW&n+k)Ns`cFa`I{+ zEq0$H*%os}uNV&747icuyw;0{(*z%sH$npx=a#o$j!>d-ChVoBMiKQxl?g|FcYXF8 zInzwq7-Nk>yTZX%kHwsU7qsYm&*yy6{aT;;$4($%-tFICc7c>P0SI*M2SS2(#vs%1 zoF7wbnd0yLUZ$h-y*@49clke*FN6~!IysFztj#JFONfj~^C1bbK{?b?v|D6vj5o}A zU^5JdI)%z%CCP#t-I2`|Jzp3zt9%P}58{|=f6NUy?Bc;?axa~Wk{(wO4%SnPgsG*b zkM|qcZtUBgXepawYq)EOtwI!D#BS{A>p6}%RTrKG3KicqjmpIc9!5&ZB zi33MbSFax6>SUNe)w*OP5~&9Z*stZ-@GnoXo#`nv7e;m_StLu2Gvfx^cf6-?aWSds zIpZu&ITVGziqq0IMp!Rj`jetgxgKqj4<$-+dKm0Dp3ry@zSJWj>0qpS_Gki@txg?< z2F1MHn;y(hcu-ToQ3b{!x>eyH&#$l8g~ZBL&0b^x=wQYwPl&=o_TWH|uOHU~lGJ)h z+7l|W;k&7pPOXMCR1h8)0in2-ZuDwKKh|W^$s3pnO-B`i+j*?C@X=P?${^y32vPw@ zKh`jZz^1Q7xx$U}x}?hOOB@yIN0)fu?hPDNVqA5Md@v~$(~Ggma{D2E=MM!FVLU~# zP)lP!AN>X!*{GGTq_KlS+B8)kYA6o)?GwYOFKBgDh^cwv6bNtGx$1SEc3%HC^kY8&g6$L*96dI z;8-{YPHBd8`w|!d(tof3E24I|6SD&M`6a;J+y3pd-xWBBjPUpm0Cnh$2&mzX>9~k+ z{@2-TdMYycU$snLax$>h)bfDbI^+3k#LZ<1ve2G09bbRNd?re*?=0)8TxgTjGw{!|I$k=E%Z&MU9y2bf;FieWYRomC z_YD2^>O;@N@B#F4hELkpymsYc4AS?(FU}aD2YTq^7co&ByliYOIK>7n(Y@iwsPfhx zv0uOfFby~?EB8^NdUxD3l^Z&m#%!x)vsY}M9LyeHsXE4a*YoTQ^D9sL&V=gP(#Q^1(G->#d{eJwpI1F^KVPf; zxepoGVY9@5z@Jvl>h6ObOOB?JgqX@^-HVcHlE-Zlt_S7gBk*!=Cr*tzUO@LU7Z*^VQhT>Z|OSYFY9n~uxuDDHHJ?f-+lDmcUuqd0iK`$ly#cq*Y!Kr z?au4@+0o$>kWaTn@)_Y6{Qz~{?o z`t5`5dvxx~Y3?8*uqBI>H&4Bcn!k}zl%2QO@in)uFv>*=x~%^s5s%EgX&(y_u_>ZI zJTNs-vIqj*Gtn`sbEX<|^b`M2q)e+BVY+$-VOAp8c2jiRz4&qWr3N(vUi|rr8?s+p-H)z(cEGK z2tjZ!0_^nd>}0{}@lpZve59a6>0t{#S)mqGqJ~9!y}K4qqpRV{7EiXZZh5i|%{OM0 z(Rh(HlX&eM%D9bDIio>rUYcW_7Ay}(pUYb*C^SF;e8i}r zVEX-16f4?J${||zDO7gPJm|F zOx;sfz`cmV2k|jZ+?LRW?gqJM*y9$e(~?R-YFO4}ewVEJ`*Kc`NhN&5q)QX^jjJiP zxwHeq(ZU`{t9S?cLWLNUfHQ9hR_Pb$R7B=pPjzE|_gJrSsz0cU0kf%8^C=ogHC?=(AMw(@TT?8>+rt!c-U+UNe}yQ447AQiEAM4ZF~gOy zvPLM+Ivqa6e>`-xvJ@)3QC~nqY@n`yk!9{p%ER?xN`0{LekwX z2sgEqlosB+bVQe8@%nT+!@|jE0=6r-Y1$Ri8Qw9AD)It@e4jz@BYfmJKlYqSMCHWL z0=NIok(C%w(Srk6VZhvjR62vZ&!G(yFW%8L!GFLGK@o$nLT?Ru=_x|OgR9b{){M%2 z8+ww#FjV7BSsb@?R30=Ub}7bBO$+F{tRBA0LNE8pOWDTn`-piTnNl2NMO+L<6$mz; z!PND++UlGO;P}CT;7btNuWC}>f%EW5=G)Ob{;)>y8mzsOU11R zxJXlee*0kScl&p@80-x_sMzW0zzhLRl1gqBvh3yLy2x>afilY3TI}>yf;L?@TVSPK zRgVLme4RrGzPxV0knxyIB962k6*Y&HA8}OnuJ*mXQZ@#ZU34E|JGiFPo_aeKcmd;; zu|x6q<=R1lK@?C&H}+t!xF4fCGRn1LgQmwwibO-uQxIFeGrF))(M~ZR z1o~Hy_`*3*9ykl?!n1L*`U^^kt`pWVAEh$ z)k#1o`lYJO@>}u`kIW#9^=&!0C}MIya~Z18#t9L4=b;kCv<;_5m0{mp$H z-@3mJe3swr5rL(>`^PvtG&}UAdb|J#{L>7yN0Pf2(05MXA5C{oCkH=}Pl{Ixjer-( z6DWoJB{Nal^J$Zel1uUTb&+Bq1r8`4-nde_dZ)RN(jznXxT@&`Ezx8BT&oC#J!+A( z*BGhmei@|kyV|h!o403+*S1w#6D^HMXqD`h(oU0av4oi0#tx zCwEN`cSvhj9m-zU?=aHv9%l@$>MmbynqDUP(vCojda+ew!R$=wpJv_(l3|k=m~J>v z^B;w;h9qZWjM&Zm1U17?QDGVeLn?=JB%{;GE5u)L`w#IXeH=&cB7~T&6tb9RHMg|BGJr6nX+;z%ztcKe%{ma1+E!v+kMf~?hT3>9iL9xroZZGdhmYILGqt_+Wq(%3$7O6zw|V; zM7E8eN*&BJw@8Ee~P}Sr%0MEn<5SUyYL`F)=YU#@Y}a3IuJP+ zGU)i0m1+{*{(_BhvCeTTkTrd7|4QXitYg!CJ@DKA!j@PO984!iP0L?btatz9^wC|XwdoC z;{cXAN#-vmWLTAg)^L@<4|x@srOXf)o29}&7oVll>s_(iA3RG5nO}aETI}0dO33uh zQv10Ne#tDU&Qm4!1?dTwBs-m=W zs|Z;=k~QV|kkohX)AZswYRCWom<5(SgIue&T1+P=2d{A-d#iBHoeJHRDf)^A}uX>)*-ZKoKhBnA~Aj(6#saDPo7x zFTQ08l=}+nGPL}pNdQyEESg-jG&!%| z+_LG{J&8&T#Rzlc6W+E}ORWS3)5O#i(HFz``1^zfc!;V*uPAYJ9BLi&!BmR!wKcW- z09W>Ie*QTMEWAO9Q2Ps&KVw__OWODVNG$|7?fb$FYRUgzqM8Fs^CheDz6Ck%{;=al z$#;%e6D82sg&MiqVN46&oc%L@TJ=gPGi>Mli-?i1kZ9TXz(IQ~?~!)!8A=rI;otLb zu71TT4deA&dwXATPDC`rXT*JkM=!m208T~Euo!to8@#{);@99p3bIVUqvd{nKVCy1 zEKD`t+rz2^x%b#O#@>d)m(2nZI3Bl8+tb#$Ac5y6*fv5*5kAF$011fsJ8qQt;K7;T zM5Yfp`q~P+Hr9;A2(%TpHF?56cEqJi9dN{u&|jj!(q&G}IM5ZnZZ0hYmJEI4@$U1a zkaK&#AS9k)k~|VRJ=NgaSSlA_WP@?*u`Z7>e#UPoRvj3;N@6JpjTiKO%k56YT$X-r zQH0*_BjIV;5Hv)EAxKDoaMJFH5t5dQTOJk-wlHuzR?ECm>g%+66V8W79Oh(*n)1Hn zLAFy5^>)uie4|MF>hs%g$!CiKm9T;lEq^nVO8@7;N}0t5-?zOH>dF{1p{(@Xg`}Kf z_3>le_#s7~KfS zb1-+KI4RbUH_XcZj7XzA6n(C4vVue1dt$G~${yXsBlAN(Lg1gxk#b~4A`lYSS9Tx> zw90?Nmb+1hTk`5oi3@7`Bg!{!Y{~$Yz8ERHL=uhu7L668mv^5wrUCeB+5p^SF;?Tx zSSLv>4NLn2Ly{V^<5a{`DZatMmaS=RW0K)y{M=hg!cXTZ_Wj8M=DU5QD1cz7l{f+a z{JG?&2#bpLx_*ayZ)D@hqDrYA(vG+)>6lS`3ato1`1WM}W=9xPctwL5D6b)109aTd; z^XSRF?I)S?GDp&hG648>$Y7JvJK9N9Qz#`{v}?H^eG0uKe^8Byj~JHE9|NrDsqxEK z^j}T3S&)hHE>j@~;J%G`D7AV6#)>nA9FAWs2Szts1M;f?(?uSO3$^&Qvx3RE#@PT9 z_998%j2O263BpvAD=iAW?OC%}wX<%8NRI?~4kpA6p+j5d*c2wEhw9HfJO1H#{^PNl z@KK$`+PDRd>CU0&*w)w(>U}-66m`)R(|gZ`+opz(d=`9fYPnsPgS! z`%MmVUUm-r$cy))iF9}8$1i7`WE`;a7C0k;k|T$Ukw1W3xS2<7x3lTi@dC>7A|3WR9F3;r8@@fia{ZcYsUMA2u{)an+AH#^g%e zO1vRdivw$z0MDK`nu3@Digt^h=H6_v{{pvcMsvP!ze*v9`Zs9z7f)?_$oJuSr>jD!ufufF zP(gEqvMjk=q_`{(w;{C+nP<*n>#yauJ_v?c@#e+1SaCD*Zz7dG6QA(5csoIZ=B~ zEELd7zQ3n3-t+mny_ef6FrzM2syuYUgwtK2ckBhMfZf7q^GkI{sWmOoGk27(5@@P< zZDYJOGCuKv`$el{UY^*kAbPf^^%gAV8r6qTjjW8QWdbLL^I{J{6{0sNpt|!Kr18c` zt}z~$KvpKQHvz*q>fW{}P8nqBu|*!5d#fucJwvD{=80;xh8|}=`H#*J}j4@H7|rlWWtjA zq%Ek%aj#B`raX2$Q{A>bY|1coj5(n-*A6YWz`uD4P)(2oA`6dROh?lh82AKdnRUR| zMt>rLe;OhEXEORz>I{!w{3o)1oV}AkDgV{j{H!w6!yTME9m&ef2#)!lryr=8Hx9t| zaz>m`^cg@l`ZT{P?N;s(++R8*N7lM5pcna3oz_Yb5dUuS)0UYp_#F0^GkIYtf1|#E zHS;^;ih>(v74$QEbM^*=c=G~mfdT{p^356U`~t^JMhLCp%nVMvV+3coTN=(GLwG7m z(H;}ze-BcutD!)%Jk~DN3e2J&dI*+$%QDr);u5YQTpp6A%CCzdo%-wIoPh%Cp7Z*l zfJD_K2&Q^%S6>y89skT)Nk2n05{g8_ak5?bcj4kGQ`?&8^&Ds4-M3h}8aj}s*{ynm z`Xn>#aYGAXs$h&3IExhy7N`pE4ll+Cipa)^9)VkzZPxE}JBF_zlV^4xE-D+(^hgvw z=oh|$^^p*q2M0MGT;%FL6*_PwLJf&KFwQAnW*rn^B>&UD67Y5co zFJE(lS_ssQg)I7iq`k4n&26xW5D@9)LYjK+`GHOYv4Sa=$YqJ&zNQ5#Q z;Ori+Nm;%i&`TcsdR-eQqUZzC!{H2!Yk=@+5&r18Asv@=o zDbp%=CEizy6?|49M`ZPVgL0a+(k4B`s7#xe*P-66FN&f$0}kq}^FNaiE>@4GrQP)My9FFqVIB?z(ks1kCGfqMT!B19g0kEaFBF27DRI()`C30n;jwz!ook*o!=wK1MD9P#Gt$&9Xdd5=<2LKqhlK z@$j`q7mj>luMcdCD1UudIhzv8rk4v6-oq_H$i_K7cz^$x%SOb&!4Au#eK@H3W^#PE zXaD_jwdQ*1BR<0ELFE3N*w^}a2u2Tj?Dj2g^*D(?9^=}T*e|&hq@C%>JNSnW=BP+I zKY2QNMUWSRWTX1++3e_$k-~lw_KhcYJ(nE&Ume<0+=X)ZWcqT7ZG!{WK#+gx)o&f* zRO<0!el#`WbC@~7)=67Y6icvh-Vb!@b<&J#_YaeIZw){~blv($m5<&J3VMY{>4@VE zYq5VM_mEP-73e+fWV^(D(q248Y4yGd7pLkW^(VsEjtBZ1i;4wni7HRq>=RLYqOOeg zY4oCvDh;mRVNDy*>lIGcD;wTFL`sbLJo+VG+mU=AdNld(_jmRAcaygO#;oT26tnMk z5C&K{8z6JT(vdw)X4WVW$V!eGN|d1h!0F`GLTms+!%}Z!&eY*N7F~hZJJb_Cgmzk2 z=Ib0Rg^Iqz1I8+77w^ZTru)-ubD@r{&U zfj=Wd*>Z;Vg^vi08e9yYXX0RV$S%P>PD)(l6v<%i=R-++RU*{Qz#H!Hs2%0O!iFlC z6D$38S4N^lkq%af_qf|OmX9Sng1+aW)Qz+$)~5&;vIHjF1uJPlsbP=!FJ^C#j3=lkQONL8M1Ou28aQ>F2lDN5qFSP z(Dd05V4Is|<;xeAJvKqH%UYy&&E4keOWU9oCO^4J3(?B1LR!trY+{ zU6SR@{&OQLF^9>_v)ZmvwK!)JI%2~p%j!BVX)~%U$&JDv&9vi5N7fCF9c8K-)aXI; z;=ZG*K@3CI3DuOMn9z4}N7r5E2D4-X#|=$X(*Yw9zVzV;cV*V-!Vz|uE(DYz9|zV7 z^R7|5zCyvpvb}Fi+gS2zEI;1kpSe~5ARwO^O`mwBqQ%Cpu|(}lZElwSgP$>hi7Pna zD4?1jfyf*TCCrf0?%i-~bhQ8MkfcbQOXfKDYhrfg9v zExA(*s~#ei&WaP|kM+i+Uff(FBc=z6n2U; zVI<-lQ~Yf@(o?~mb-1BN&}ek~&i}bZp7$haxk~`W1f?`$_j6EC4>dh*-+lTBmkRA{Ki+z>g+E=-)}gG8y~9th{v`j4fYxYlBR$x=di5I# zZ3)9Ux3bXm-A50xLxSPuKo{#L8byRRF(#d4Zzbm*tcA@_T$pKqcE5my|EB%!3*K?r zz`9)pHa=3Yn8@!>Z{57PbN2QvD{)FC+IY2tiAi%zf)t!QD+SWNg{J zENwA)JKO&e3!?dti~V;b@cu$6jLKpN{|vw1c*(;d8{@aH-)?^P+2ZsN@&K_I|7aU* z%TOE~opC!7g;{Bfsrh*hIBTdDarTC{HTE(+s*){k2%mq6)vUC%pUCc`oeH=e4!4OK z;BWHez*IVa%RELft&+tr6^R=}&;K^`{ziC-H5IlQNh_9My9I!LxS!E(ae&uF=bVhsQupU zD3EKdPPz4*N<|5)VKba2eaq@FIQ&!R^S5U&84*0xH?g0uKQYJ77wa#iA&4%wlq=6P8C@@@xJgm{OCtc9+wxsM zhtI96`5KxJ&c1R104Z4Qn9&SR?>(IV;RH3|BI_R0i!~st=cX-71I|N;cF54gKH7pU zYedlY@$Vn+Z$EmV#Qi|>_D5ySH18ojAG#Pzu017l{2mGppZj47a?8xb|4ewWA9s?D zbhd4lxkFUdGmP)^j3Y}87ZlJiCcX^@je(Md%a8sdwUVl? zj2%s7L0XQELoL}bA>-y3HR6Nya}2pH+}THhH1_DV!gi=5XsFT=p}71tLm2uVi1rQ) zkW8uqpNmtWIv+HQ8)K9OiDfkX-Z=mT#Zl6Bh-J()OOv62gKz~}mvD)T`e%5y_%~iz zniD}*{Q*090{;yI;uFg0=e`rF{BD;J#lCc3d2Lu@2;Fnq_Fq{iGLx z`6I2v5$@eE#n0%r9U+2fC{-Rkd;0hpu0s$7l!QpW&0o?VDBlnASm!%8Gw9J2+6p*0 z!uUu_MwJo-*l>hkVf&6@%$_m8t*f3s+4@8K=<$QC`wywy00lq{8qS|MaiG{L7)l*> z>JFc0a+J!bjcL!V4IJDLR-2Sp3baUe#X_A-^a0jt?i+sxH-UGs zHFI!!HaQ9-E^0|6v9avNTS^qP;-*igt@A2T*=7>s3Ydh*2MHkZK&lQ76rZgu7;5LI z9RrW_DQrczaZ}KROF=uUHQdrO`NB?m4mAm<)%zT7*zcF1eWAk&tU;rhkSgC+Gu#lO z>ZEEoh*Z(X#dS;lc3$@pqNh=Re{k-EdvyHSE2#z|<^b~FGk^JWg_7h70zE%T-bS#q zCXqQ8Dd)`=xO4azA<0KOU);QDTi&X%20;V64+h;_Sks~b zjFHwiMKL?b@a|eq-01b&{j+0ke=`1#aIOBrZU!E(*v_>z%#mzYJ=%HtACI?r$s||p zk9M?pwk>0nAhKmbdxkPHkr63%5ETjNsj(2KM8RDDMzo=;+%O1<4jD^y=OsnFs<<=e z4!3bz+*u~uu>DQd3|xVh){Glr)!Qx*VV8#R9X*(Mh3{NnD)M>eLG}_R$BQw^u5t5D z*B@w!l^8uLhINHIsX2%Pho*pG2j<>*JGBrZ9dWM>RK741+Ok+lkM@;Ac` zT#qX|UA?-7ZLDJZd<3yq&evn?fmP#!I@x}6#y04V4N%?W1j5tOz>K5}*3IL--XO|s z15VFA?rg?3Q$?lURIeI@g?sxU@__13y#Vu@K6ntW3C|Gz<|Y5=v{;K9G^O1)qnkHx z-^4!|FqOmPbXT?u$IlT@xOwYe_>$g-5SAE!pxyhqR-nalsv!#t24+4$3c%^8tOG5k zIJ))Eaz$eG&f+v*k3PTMeW@U}LC$~vqW5iy*WjY!+rRF%(E#4pquaki--cKf0s-t> z{+YdC_zGV%PbFG`=Rm~&wTkOvfw-Go@9Do@K!Z`l@?rZOe2bptMt>iW&(bzfX(2|$ z*m3PPP$-hx+TYV`fhHx8I}FLfu|o|ox>&5|0=q-)n`L~TCstOD%Ej?J*trQB$Ou~+ zfRyo}E_Z%G*DZSbMK|x%%Xo-wEG0}ni_sN$P^G0wwc1{VxX>GGqrsJNj9Pqx(4sw+ zAIo~P2c=&AS<-XGLTHy)cw#>KM_vT0#0{1Vt~6h=gCa_FsLv47f@3%cJt&GqVsEwD zvIz@A9&c&a$Z+ZAoUb}NEKA#q0v*(QJ^KTs*AQVZrj3^XznsP0#wF~ikT_VSlE)Hw z&cJrYal&#*b;{3i5c6>K;|#mXI6!eSeKUWDtc2O|=!+XSZ;YN<6(L)j$?{UVM+;YFin@fB8&20 z75=V=7K=-#3g-jt5=+eKPY2VtdaN)#o5>9&n738}^76(;9%mS?jp||XZcq%<6A1$G zk_)>R$YRCsh+u&MmsSwS5zgGRr$3>obz$kXwBWwbLxjOW;#j@^i5AwtJApT2yUzZ^ z^-Fj7uyF-wQd0pki0R9^E)0e~9Gi_^3J`D$5m=T%oP(eeuV>wu2l!#~+~qst29-G9 zd}+9jyeeMtlWmkuf4G15(Y@{cd-r#?e*0ki9!7ZU*5{Z&{0mmJtp6Q3WsQI;8mUT` zW*zoC#OenXoeY;A3iQCMba8jOrpFhCn2k;sV2i>ESaQBUY`*@^by%gro?`7gJ4Vs< z^LQ!oN#X1cPh`bmjPU^~>*v!=CZz@7uvCl6=(NvTLSJ53mHiDg#osOG^&=)ccW<_M zD}_5w_T;xJrPk2Wl!kqkc4AmPThfgbt*BL1QET;O`8}8LH(NAWXv>%uv#i_47c;lX zs+bA_pn{|s9I>Z-A%BFiR7CmQQFa5@Vh$5&QZ}sEhB+Ny%cy$3HH4P*tA0|?rv>M~ zBP|+Ez=i7ym{nCT@@MrWai)86WWKoDZf?^o)x^Qw*sH2)wXUd?Wx|tpC=S+)>#PIeC8!2&6o$D^abMzL6AF+x$o%3j^tc}Wq$GPz1K#K>%6J987 zQ(RbF5W=P0kJyJXsA=WJ+MHVY(us?G&OONcz8L>_h@)qCsJldhVRNIcVoh&YxosJl zZ5cuLUoBnIf&K_w({cY%u87Qp441u97~t^V z2`%4X=hVPvH?^WrLNm2UU^)8yW^;5)#N~1tR&)UDV82mzg%|98X_Z+Z)TIM!3oqFC znQ0LFz!oitK0VQeN`%E9KfV9x;noANON7er@9b|qd9w8%c*Zb!s7EGMB-_v9Q0XVm zkxx(|t9qg*bhPG=E_jxE3VyYloV0Q;A&%kz4p5Ri0If4Jxux$@1qn0Bc`O3Zok9G8 zRu&hs!GcTU;F{Fj6`s;>uzR&G-QOAgi&E!5)=@#v*#38Jmcn1~$Qgu@(kqo5BkR|N zm7RKC02$w=JLp7Stpy?><(z;ava(Mj3Q~tp%HvR)n*@h;6k84IFIg_yN=QcngBCGm z#bA45n1h`RZy!Hc-2Pl@NA6v|q&!&so}C+n++>CdRFclRY|!HG#Tb~%)!>961=8^_ zGR6*33dQcJCb`J&iHY>x`56P?(H7YwTgM`fq2RhTc+p5NV42|HYJ6&k1kw`}A3Qld zIOAOm{MRnU@*-0BG8eKD_D%kf3bBnY*LMoV(t@wQ=yV{kgES^BaneDB2Mlis{a{?{ zTgt)U{Ky-Z!gc-#2NeFNOob9ijFb^ZtHQ9cOC`j3Jus+V)2}Z|-lqZy_tBh=o2n>` zQ#-?J>ndo{B|2L7fosVf{WxK?uZnH(ig#V=o5T}%Zb8fPZjh<02};xSp|xZn17E~I zLP3iA8ROxMlxdB}GOPYeW=)5cdMU>cFsw^B0wZN1=4f`6BBPJ+B-l`Rx7@WsCez z@n6+uYca91glbfEES$EegkPQU!e8t}oxUE4$06>?kS{(^&#i{=iosI$- z6&M5+P#$#<714)!+Na>r<>-j33-S8LLaaai)Sx(Cri7ztM(M-{3$706_SWGK@C&|( z=`H5APYuIpZW+sL=ncBYp17k_IFk%eH>hcUZnFUbL<6RY>np4tkjnJ8CNe<~9_;a$y3&ssU_Sl*hfnvv+xmBq+v^#d#S1QtmFsuw2saTnY@1$kFnvHUNE9?HTx+s^b7 zyTjrJs|5+-MgjD{&=e1}C*gg*iG9ay@Rv|%{wFF^twJ9a0skm}e*tI12qmtDgVHc- z55c^F(n%aBVr{j$@_=1S9vVh*7TH2UMlhqg@{f ziw>IA>UGVWD;m}7*BR1Q`izzvRaZ+o@A?Tw*)f9{Ogj=7feKZ~t3j(=*c#??{jc!) z?3O_(db1awnEG&8`Y=kfDdS8yb)iCz6{~M?dcrv?q$)+Hj8&q&s~+#|>0DT(e44s# zNgF^eV781xVzl&c(aLVJ^ifur4Fj)cuKJmJaE$IWRvh82votk9r&Sq!IiGt+rh;o; z_m>%qW$cAH*?E6Ff4i8$s>sJ6pe$)6Xn^Z8xW00yLbZ}MD=U?lS1aze?qA6|f4pmR z_#8J9r4XI=#@P%r(J~w0^-ercWYHyAdpHM7u-WsLx09hHwvb)jAvE;`a!PsO-&buCHI0X~uD+h$pEM2HDc5T_@DwaB9CoHE8$flW5-<-?2&mD80_B zXHg9a&@KSk&l}^K{VE7~(d(b%0M;1QI}?DbwM-KF1^A+e9BT`ycf`85*>FT2X+Nj7#xqD zCj0=Pe|xVCL6}!%r99+!*!ylE%aH;vq;I160;NEkSh2l!z0+ zq84MI$h8!+UTO;4!)hRj9A#e*hc%h??5PJ%NB7T%b5#VNwzM z*LWT0-WtW=h~XR9cT^3?%`_gsc5YD23qo3sn(a`s&*q*`3{0#V?~BA{qWJA zc8trF{E%U&pq}q&nhW3xp@cyldBhB07AgzSj-R(T;p|@yh_+I{5k}}C1764TvsbSp z6uB5}7|2aoH(jkRXF~o4hSKTN7f^kZKGVx=R7QIOI!S_^!CJmSU_#W6!9cEE2z}!D z^c1|}mj|b(L*Q$xSJo0boq88Jn^+IIxRp;lh;$HUt>-Ro<6z%@OPlZcw_gEdyD6vesdM~BJ3^xvhmGVAMN4a z)hp%Cz42exxl+pj{_WYLr`z{3oNqR-0M-?L{QMIF!@nEx;OZxUxF@}#U`5?z&z_(S zN?D*I{%hwXuL?AMpL5e!m;_rO#TkYv5*CaAzi`j&zfq-S#`Ak7JJO|e+g=gdwij+9 z2m0~`$A6DsVXGWljo>Q$aLDk9adYAVSx=Jb@Z)RT8^{Y=_1RarY(_q$B4v;ui^OMp zi%&n>qBsbW_^%Y!_tN49L-a`r|5N}l6<=QgVRdT1#`NNDGO11cWSb07&EJjjr&m|( zPNmP5-GUSfkKa)Ac5grD{b#ec2Mb&}^Lo1AJ(O_;+U^+mU`XS=@fH1#{=9N!{2Wj5 z2-kDr1Jt7A>6G2i@$}ZULR5cxb##4nThpc^PqP~O(t%!Ln9YzXByaX2iA$#xNvMfc za8zl$G5%oWjC4{8KJo$9MkU+ge8=;doCsvbyetlpnFJ}pig|)-UJ-slyl;g6$R)5o zU(Tb-*_gGPk=1U@{%H~pokzKs3)(kAts+u?JGI)bvQ+7W8mRtI^%|-)lmnH$R1jSN3B7|fVw1&DMzlpz^<`ca^Ss{0!Y;NB1Te1;O!;HEZLHO*?LPLx zkFMY8Y@Vz+Pa>J28jF2X>>nR+2r)qo_0rcnyy#GdCaP1Wv$XE(Nqq zeAwF$X%2#dFDGk0=4DJ)a6OZD}c-F}K&gy)BP z@zI+X`-iB^d2qV#4?VP?+R~0A6;s!0_!38xvK-5IzGb^k3U;k~cU+RlQ~^7zN`Q~^ zoX*$!O#GE-A2x6)-TW*WmQPS@_ZW*MV@tHLW!GtKy@8t7;4`m5>fUs7FjFGG?+U?@1G_!4x%^%^e(n+P{AftSm*^s0tEiXh@6V z=CHYg_}4YHDY%7H?Q7DIyf#$7V!K|F*67{D2f&bl%J{A;+ za|(E0l5bfWgLzn=)1V~kVdg3>cAy3bKExpBm%a}G*Qw!MN%CA`VoBuzIL6qw^u!O? z826yk6j37eFF`QbwO%csdZsum(eZ7|)VupxtBg;2Sz(O2ohd^~10jpy?$&cVLfB9> zhR+^8l4)2;E6(SmHiE9t$eATT`NZWFfd@N{eO7M2MR@&o>+fS+rJ{KM7B$68Oz zjY{MV)B(FjrFI#%-$(?8Nk(Frq*MIsqf%F8n1WeOAouR5WiCjXb7-Rw1#e3M8D#eg z35W?NRLq%}1=YpS)Fs8U0^gU7}$xG`1YjR-t<4co*YPwm#En9I$WrGK-E^59ezHYs+c z;+{?-Qbh|tSOIzC;L<3z)JREdokpE)-;PsVFL)(dni;H{QWU(QNp>4efRgx@rJ=)M z$vS&xnU??{jtg!GY?6pXvFa`5@DX`ajW6wFIP!}ONxspOt$Z)sq^h)dWbTT|H&}(j z7vmx6kE%^c?GKl$)9X?4n5nY(AY3drW*r~B zm$!7{rAuL0eUC?RL6ts%nqR`XLLH7nMX-Pt#;rJ)tqgY?=wB0L>z;Y@@+Vu9BcXGT zaQsb|qIJwg+F8tnYee~d1I$mCRDLKks$l8N$z#d}Vo74O960c;p&Off@4}0QzE7=q zMD37h{CiZy@O)rZ$}`+O{Kt*!*m`>Y>DN~`ZhU&R zZ0UlbB=Vm*IJPTp7{gS1#=21;7uLFQ)!7mT$bm?+MkWJ&u;fE=LR|Qj>7crRm}+Dl zF&cT3xY9+^sN(hi{Lb&Hb!6HQ7=|YQB+KgM z3q4kw=cDXKy@Cg{TaZ9FH%+TlA7lFk(9K^^DCJ+c~ierwl2I=X^cFH4G6@l&Cl}!1a!(h;pPyTAL_ZgpE#5Qe_oqiY_BnNg(7p zu#!8^7$cog+8N~imtS=$q$LHSYR5~Vmz^~J22i)W`kG;BvrW@CZ&^K!&&9-*1?$kn zZ;VlHVXm740{uYC{-79+0Lujh47!h1-6sEKV+~YFEW}&5yTilqV$bbh5~{0oK!w$l z!!iMZ(1X_W@x)+7YAHj!sQ^3B)u*tW@A4)$ zL#uvFc!op#{63mojOvcksGssSvqDZ;`jW9oO6M?5s3~Fw8c9e*)}B##K)*_*!*2cR zgKCGVl>ZEs!(#Yw*!^!zlzKxZL>DM4CTlPKxQV3b!z#u_GOjXN_upXqLkbQuCFS)5 z2S-pT%A`hcRPu*z0v4wT#afFv)7pmYRB&yqFc0^vY?M37`o7oZz(DTA0W&Du+U+ca z1p5qq{}5WDC%K+lK%}_$yNZ6Del1E>qGrNlJ{{lJC-R0n>3}I6Wo|F#qtsSw3`>MA zg#XX&QMsDO1^as}W~uEl-mKo^R)58~hLtGuR+X-KGt^VpV)d|=scVjtB9qCgwz}&?E=93^q^F=)8WpmL-uug6r51Xc753JTxL#RSAY64r@bRx*%E%f8358nXBpO=^u-Kyy zS*EmjA=ZNn^}5GF>+HrrLvbF!TVX}Qy{}B#5t6GkHUEQ0^S4`cnfI>dDb`{>L=wc) zLs5iO)`T?$LAY4uAgc-%9!pP_G;FDp*EZrGBl9ELubK^Nil=-Cm7Bn@Tf68xcSm(+ zS*GFlwCG{-y8BBdz^ZyQ^~(^t{FF_lcl1BpM%Z(RDShOH1|9XGYzz25Bz z0W0d&oG_XnSGVm5E*g`<%xV0dE0*)OBbu@QpyT#2mrBAv=!#3SbAJ$A#c>`Aa7#LG zC%Vs1(x&Y@52YPTAcyuen`grVNx27VKgVIGu@b(v1Y#V8reyF~mSdWpY| z)aeh4zzai>_vkZSMADq+E+uD5j|dY$!i1Woe>{;=6PjnPNa|L${C#6XHa4*J1wRVA zV7;Mze9LkhqHH3IK+(0MB@Ha}xda-^IWC8n0v{X^fJJbD!F`QKaE}A|Wbi5wwMbhL zJfA{M0767{!1P+AM29l4b)ZBls&!d1WV>HEU_WI#@59oRySmhD!u zr5TJm2g!q6()4yW`EU?um37|aVpTwIb%9pMlwi2vpnBM7?CWZnUbn2VGu8ANVGS2i zUvynI|Eu2{xKL_w;Pf}n0_!E#&z}ai8ijh(s``t0+M+Htm5Z+;OB%OSjGcf%gyG8~ z6jGb~4h6*&&hPoWtS2Z5ooJLo4wtW;K^DlludaT&-K&FI8sDOL z`C+sQuYK_Lja*zOKFbRv*G5Qyg^!Or-cS+6ikDMYEx82CFP%3_grippf_MO!Jzm9v zzmXDNE~SBweKLJFo1f87Alp;H!Q7z0*yd*C;@h?M1_%G~4=FT03w5s*7UDnk3-^Ys3 z{nA*~QOJT*^Zaj!k#S5%hZWogTl_LudIXTSi=DHZy!96QZ3j>+^W*cjjZM$3dUNmZ zr$;Esx2OL(54MCk^lCOI;{`ss7r}-Le5A(mybtt_yz}l7{%&&e!{PkL<3jkD`|?Nw zUaitTgx`NMdokV6ob%sQ)U(=!fa5%Oyo&ZTwI8H~Q1~Mk&sf1K{6awfNOBiuT_bU%heVPkYCE z$5+;Pbs;*pWo0!eeNT*3?>;L z9KX#j*(d?3IACQa8UoP6LR(U#RgX6)7x>53e(^9LfCqKyVT+i<8cJuav=q`CaMTRW zMGNC+=0+bP7~lhWu^1!e$MQSZ`y1p-Mnbrt|IsxS{cullJ`6)AEE!F>;Ip!S<{~Ro zQE82$6{BM%7&Hv4TlY0)Dyj62i>!MZv8<^F2K7i}2C0HEq%KKPoJj{7 zNWtt>cnJjz3an7f(DtSl((+YufR9DO4BAnu#O^RZ|S$?z8;^-SPY$GmNC2L>z z$eJ{j!Vr~ekKu@32tt8>MZE=e$g*UYgkT!(=H~AnJo@d{gZ+nF-)-+a-nzT3XN%(V z-SO;@1jZs{88ewN`s5SHLi6p7@g^QC->v||_gK`WH2JO%k{IK2%vYm+Z_p#jXjH-d zWVHLIj~9P>zVS~VFRs#UOCV4~C3&*rO}w^*-vB8jzN^|cG@EoE#D@%Xhyb02Z@nx) zKnvVwqGL`}M??nf~<8Q;~bzDG~z^CKz9ak(g)i`M^W zTqfdk9?0nguAz_QpQWJ`P38DwP7rs{ME;J3z>;YH)zSRLgp>-N$_g)~@rO91XLNpl zKRY~}A|l0q5d@FMet)N*4{%9p+T%10O}P!H4ZP%7_7GENfu&*4(*OlQJkt;g!!W7= z6F1QWq@Uq2$2iy^e#GkvyetKr8sp+YZS#h4jdFb-3D?#v2gX zvRh?i>_|-6$+H%Er*WGQOkRrH`tn$O|j(Qs*NkM98jFUaBe-)IB{l@>)rl z+Lw_m1|N$snV{m>C;!MB#rOGBen|oP$lZWsR3uHvclwi@GC$OSGV-eON}~^0Rhn6k zYtFoVO(7+^f_MLnmqh|5*$ZVjg;mw1y-q_%_(7G7rqr+#eb`Kw?FNe)VPz!o?SwEf zqwsy4bST|`$`0~INFr*u?dd&LrG8@M3{`{S|Z$q1k=WS{IgYLD(tuyMD zmdVIj6y<4bq`}UK6Y0?i+q*JfvGF1fKYTY%)v9jZkuUWxbhp5zln1Xz8=@I#7~q`Z z^^5<62iCc+-D9VlZjK$ZdQU6%20g$58GnH^e53&{1+U@Be&7+h6wKfPTkK>-&?Q*Z z55BxdxaPuL+*K>l0d3DO12TEP9kA)$GSG*%^Oao1A?Ylx;v=2;IgS^;e~VIY%yF9O zCDb5#9@%}39kK7RHT$HJd{xAg%2+faiiTYq2_gyM*QA z@5b0(I?=zK^M9re65~rJ<@fm;Ll+s1i-P?(EaQg{BTGa2yISQA_3{rKF_GE&pGi(p zQSlQ&|93H8DaB+s@?MG12W3Ruo19L3^#=7+0oHdepWI0)Cd3yCZjM7=RR->&!dMow zqQUx*Q;_;b(YXv_MQAUzyKC!?K_m-!Mf5N>d@qRX#gxEu@)<0}=s*qd1<^^`BJVY< zpgD+|vqp&cNB-|m1mFX6D=1PL>`8>I=h zDh+Mv%QmWDmO3%UUL#PMh2pX?^kb{@-8I>()p(MdjKpu(*2Xx}>6t`rvz*hWErm+m zW?NdH0d3OENwag3@btFd3bA`-w-}NnASLllz}N*4J3!rmOgG?QcA_c?bF?m;=myrpX6f2k^Tzf? zcIrN=j54&uR7X?4wIbt>JIQfr8mzs3%6`Z}=lvf}0OnBe>Ri?Y~3S`R5 zv%GqcnCgtT2yOZK7c&hdMp}Fdnd4}faswo|>+C67w1%0&ks9vk75-SEnL-p8k2FK$ zJglr)i<45YU}Vh(@zMA9#88vduMOL91vf6sEza${Z7(_kpUo0icQ=eeFGW5ulQWY2p3refpvXUO4 z!&Ieit0wD7q}GcFXzQBSiUjEV<{o=8li089DmOis?HUusUwoyi@sXi31+zHc<7Atk zM6d;RQ~tI4ud3fJeTslG@edmj|8{_qXfjA74*)=Ev%G>7s1SWq5`gPwQrg_pfcqio9xB{zfefn= zSzBLG-f@ED&S=-(ZXzM*`B$I$bLIxA#(?buhZuI>^Puh^Ml@Ar9T2@n#{T?ta`cDU zq1?{ddflgdx&I^Iwmx_D3T~0IUP+m)25(C=tSGsnKn*SL5EX`_`|IVltp1NHkDg3Z zBG04ISF_`n^E)3ezWPl57=d#9e{j~qXve^$HqmPrj6U3_L!_?2h0ch`vQj;O=K8g|TADWzM{!65`WjUN(Az*W zb$@>L@9%6m^NVK=5u`8-lSZ7gXo_+j;GNU?*;}Yu>|T@@NN{-#%Ut|N(y()seY}el zQUQKr{M<6}!01IRx@+M|^y*yT>J_BY)WyN%=-})K2kM>%T-X%FXn}ejItbpSw!Sdm zEh{D$q%_uQ9Tgf3=l$VfMnpiJ!B}xg0g@5^K`6^7_(roH6Lb?&JH)TK<;zt^tA2bK z7}90bhAIvR0(3QHRt^aKqS_)6VMtd%Yj~?z5OOhF%*Tc=ANAA{YWg1?&3~L8UQMP% zRvzT7J^taJCIez&BMZ}2*rkrOFNt_c2uzGtnW$*FnIdHBkl51R=87$Mxn5#NI9ZF#Lr4Mxd zEmfbZJ1`vs%UytFUhLz+S%LR8oiOoXkTE3*XfA9@9w3Hs0fj#9=tjGCbv@&%A#?oz z`48!Onjv!7^J*GgeuPG#1*0-g7<|Fhsoqhw53;>nLg^w`50FI zhK2=V^}4xjw!*d6B=&_%KeFCG(C zW_RaDXK#*WDc#+^GbKl!M#tG=MOafLsI(JFH!keuIQQAFe0=@Siq2noVu?(UnKzvG z{IGFmW0=d`29H}%q^)G4i%Z(%m2r^ShvZjyRO(7pk_m3?vTAtIt>V?v6*fD)XpcrV z;?b@(dp_EoxEuPsi-31Oq*8cnQ@pgSX4-+Lceqj=Y@z0!6JL$iJ1d&P#Ij2R^)bW3 zaX%K?ZHRAR3Xfy2xUVT0!grEGJri0!W-7d2;E(}vp`25uTitB5z9TSypQ%#iTPxoX+d_e2=-`D2w6RB ztd{Lpedser=0`pqMJI**B3~+RosNqd8pn2a?-KQA7H@3)$vV~#igb&>)Fz8 zsX{0wXY1W$cElu47lp+Lsz+{{kZjNxRb!XB^IS7;iD0(NfMtC*ofO%HZTOj{L|AL{MdjdAoDmZXE$avSR4C>hXfN#SA74etdzmo#tP$nYDD&Cl{zh>CHURO&SKr>xx7bzz=YdlY2Xk;1RTxEWqX zp-4Hqn|MsP#$fQ2s_I^ArwZ4;M~v9(1V}L^2Zo|j&qoq8c9XD9R}yN&ci6faH&A?? zts^XmxXneJssAJ6$DbFIGiIufz-Pl;o8H?B;`RfB9b5x?djJzR&*2HzNMuD&BDkWf z9WE>9`xz?|C>+$xz{hbF}JHOxF8U3Yw@$BLKyN~W|TQE`g!R-imWDz%xz6q79 zDPc2FZ#_wx-l+BLNhsGt`J9gNu*{&slmHZ6>*-0^+B2|8>4AC69Oc)+-GYL!_Ic2? zk<5U*|Ej;W>iGaNG?nCfn=tzVnnHrRIvAzaLDGU&)s1Eff+Wj_tVg3!!n@Yk^aAi=+4g|F`6Whv-1peKOMy zs!C0hX%KF&P+0*gFM7@&ehQ1|U3B)kFax)RT+dA$X9o6O>P1%Vft? zmngLIz&~u-hb;B}9!_Qa`b9UN{9Vn`1v3hTQAgO4}_K8G@ z4(D$$zEA}M-qm95TGG97UygTCb2A|+2-zK&3Ml~((aBmYAJik?eQPwE;o1(U^x7GYLMnsNrZyDU zSZP0?bbI{{0v%hYaA{tg zouZ~H%2R=k0S%lH+TNea%-3I0^IqmV%P-75mh3|4_FL5L7+#F8%XJd#U&eIWK3qEQX0S|i>I%^oVihi3k1yFo-@R2Z$MDnf^OuKE>FW=$5qegAawN`$VmD=3q4 zI(@ToQ_${FUcDuTw#td5z&|}}PLqiXB=J33OS{Q{2Jf=Q^JG3hg|Qzp2aES_Ue1r- zt7y`dT>T`LL2k8|>miWdi?rJ`na8?9FL9Jggm|DMKa7Q$Z2KzTtG~Fm9x%|fcoxPE z%T$*)Q3_@8wHZlsnT0Up1PnlW*p0$eNf%!6;mqtqU;qg6mvib<)(=-=?PP|~p zjY5leTMXJS(Tveh)nokh?^;<@8GXvc> z#+pfU*g!%69#*)12V+6JTf@+>$_(#^2Pi-gLts>4F?lzIK9snbh6g*r!NFy?=mgg* zCFS3dSjj!>3vOsNp(R?{;}EK*qj_s;$USroym{?&SxD=8s z>1r%;{<1G6GYnJi>l3508K<1ErEoF{`Tn&P0pRpx_1X&@iXl4fk;Jx z#2D$H*bh+_{$h}hOW5ANt*F=ohhnYk_*jYt3aUMO)@g%M-x%lQ2YCGZmzQ^qkgX=| z1E=FL@b$NI?iL|ZQoSPu>FnkJq2Q zKsSSZ;G#YvLzc;6)en-ju`hmPpA#J$Nvoh8n;B5|g&tsg_C4^DWdYdHl2KG812Alz zN*GGHoaTEu!$%?S(}OiVx+Mh?xK2TVRYCfh5o&11?e9}RJ9e0#u68EB2L2UoE3H$j z+zMh=xP32bb=%j1(^x6nzDDNbsH*L2Kp-&^8LMGd)NGcS4>Cm}<{wSpyghv%Tkm>L z`ag&!?^|hJ?gY54CSd51wl~_*5Ev`Vzr|f>$EWz~cribk+BJZC&Vln2-8wz*h_;xG zOK0@h+xY40NLn0OW9#TzfvdFK80(?}s*)?QYnr61 z?>0BT-+J(Dd;iJyzdgJEWc!{$)&wIaLt-(4im5;0p1_~p;8P}$TpMAV_01t~>KNnA z7{`xeB;F&k!IyRS@X^CtxNB?wF+Up}OpbAyaS_8j1u`5S(pW}w{5UZZFGerk*9_-9p@zkZG7s zoEvK(_S)4o37NGUpYR7v?mCB=l1TYPU{l=w6kz>AIsIvhdP!4_8-<#&3NhE(3aD@q zB$0=~PhfYg2`t)H359GRcO855*wCNxXuCM0143+J9ZBlP zd~4o7tA?pKti|;^hqBLxS|WxuJe&$C9By25kuGI%1P2#C6L=PeiE|kPO)05p$J5lV z+{#RlP@IMTg|?|^;`3}xvVp;A7x+f!U2hhO zcwJFlji%>U`&2T~TDT%WtU%#kP74zsIRGB;&ewGP8aHb=V`$CppP+=v^kDXKb|8jR zHloh&WOO=RLASG*2TdkCg1@zj4=UV09g~7EI#{YMW<1?+Iv+uQjc8;^U@H3{$p&;g zOqiI`=^LDJIiwYG6>xHPjQHo(73g#QI>0*;$rz9=nC9Y8$D`w@MoV>7 ze{P3Sl~|7#YG&}4^LuGEe`)KO+>Y~%NV!@p{#w~$#TQuZA=Pzu=(8CwR`316{MGDW z}i|^c}%iSo7=_hLc^QKd|6f-@RtafagY4M2wc^IqL)K-)3&{X2C`2`m`dYmLd zh_zh%s((q{12+wvdoy8Kbx+6QUd66yM!~R!37OmFxJhf-Q1MlSQ_}cVeiTG)rsRq_YRN>AR#$jE$E$>q<8^@{^hbszSkW*aj-w=x1df| zu&QCB=B#f>1y1~>)f9x&69Z(B=3I#=#37chHy99w@U-pmHv5RsMVr^kJ#tb&SIiqWjRKk-PvL_g> z@t&@Z-b_zl&kwmK;d9^&5Ad`^5Jf56&^@6gn9o=m6<4%fBJ5HTriUm}F$HGlzb_Nh zselvzRwS{ExdhHQIiyko2HWxMc(MajSkD_Tro%&1`rVS`d1}Em=#cj~WaUAm7ZOp@ zPm3Bw%fBL!C|6g7PZbWyXkAk1s8Ic0#D1Mdg`xbj4$CGR5Qb$Uy<);GHI0{bRJ9_9 z`3tXsaM}Bw8@7G9Y;%EF_R(w~x^UlG@5@!$*bKH0KKe~>1CKpaefT%ydy|tNXUC`@ z3~ToI_mB4}X0K0^a9|Uj(&4 z-9*VY8ev8M-Q?iW&W#d_MTA?!HZdCrr*A*`?W3LhPyb^df64#g=eEq@^axQ@oPX~l zOYf+4n$mgG4v9ft(kW3kKN$iV2Uu6cUJs8eONdQDPV$TSVg~0!&#U??Nl>cDfBzVM z#?g^zoxpVTc>C@H1|?ohM^b$Oe;&M^9KTYnWivmLQDt(IiuixRZZ0#kg%BS~39))Z zN0~H~RhOx$FK{k!ZA8X(NUtXgUrxk6%vg%th+iV%;w8~uWo!qAY3KrrKrZx&`g}5? zkbhZr;UHK!U9BUbGb(IOpY3dM7e8UHn_?Y4*=&rC1k)_YC99x*{+s@!+p!xgvsX5Z3>x4(gM>uR2if} zDh3cqCx?f+nnwCh2OXK!(iyjAFwNecPOls5CCEXZ)X!7S3#tjL9h{w;=`h1ExrfMP5?9fLZh&3cRMYU7W|aXN^iHHK^X4Z}$E<^t0AAtbjv z%JM70k@BU`wj~m2TfPQEGz*sUPIlM}w0yRfa=7BG+roc9*4mL{j#H05+*XzfjvV5k z(;lT$EWR_+rFp)G@?Z|mJ2*Xh4>Hb9XW}0p-Wbu_hn0K*o%x=D`&aW*np3J#wX~8N zO*bFeY-b0j^Ap};Nu3=*1>2U)Duz3cK9gD9fD3x)utEgCp;iO43pFva-~GJ)hBiQh z3{bMVH7Yycc!;}gBKl=*(mJ#ZMihvP$VS8@;)%o#0E&IpofP<@M>4fKqv;SSv{nqp zvkl9DezxJMzAJ;X-##?&`NK!q878zrion3Un2K_5CcP}G_?RIdh&unf#L|fZYMBom zK28e|n1tEsk$4T(vpJAY`Iw!^`@vpX@ZefOnXHs2{Q4b5*6ncn9ni9S=hrnPns_l{ zq#Mk7hO49x25@R2mov;AlpKyD)fFmH))922mW&?>!Ss|AOFsv2>~(NN_rszMdZ);)*`>hHQ^WHe#0_^GdIHQqqs` z7_sT~lc{{qt2y**)d5&#)P2EkU*F%^ege05cTE3xXZyjoIGKks{5_9v;2yRc28s2k zO)~O{?)8i}6ir41KXvq=tCDl{P1O5uIY-U6d%JxKXG^P7A=;^baC+&-S680cE0X>r zZ%A+>aLpxv_y97P}sUy6>z9V zzNq@8$`w|EOsfZj>CJY$Y;SxtKYoQ$TslowMon45H&?XWRW52=zd=W+EAggWqw+E9 zxzYzvIFya}k*$9hXE_>!LDu@c?yk_VtLtFepDiY@qBgX#-%UAn;0G0Cb0`oZb~-kB zj=_Zg*FO$vR(Z1WMC(dvVTX&%`ZMB-C2z-sDAYXKeus}@%PT}=AU5FE^QBVN{eaaR z-^uYYTvyD($!z*gQzH?36A$>s^k8CXhbM>v@LqN+BDI557Mb2DT;Y4O!_j-V!}Nmj z99}TyhEGl+hXv0V^iHck3M-z%(sbW=gj`A?rkqSP-YQ!wIE1bt^>4%(k33HYsl*aY zXXe3|^iDL2_W_6=y3$tXyk^ZHtSoMA66!hgO-T6^)0 zXxyoNpqBIWWHLJ)u|FC(*t*#%q_*r`vj->;`PbnczEqxpqN0?8IbZN0W9doZi_w*J ztB3t-WNZst6kk~gw^ZF=Ciqmg-b5h1qn9X)g?OI`xENe9ueQjwavz_uF=bs3Jh-7H zVxpa7KUoa~Th@lYW{ZvS)<~d%VJAm0)Q4PmBL^DpSccmU5ssB_6Kn*PRM#&!nXqO|Zdc}B+C(5jQ2QFg0xV-S24c~{Rm8kBrRzbNx5~c~9l$lLOqdx=0_2IV z|2l(?YB4V)GY%-m#$qPLero7UorVr8olGT%Tr3ZJPn{>1M{$X^5$Li(b1JFsE~_z~ zB71Xsf*~wVEi&E3^E13jV@USy+MycF_K~6$^5<&prD<##o%fCI(R5F`EFXw{wQ~wC zexpAy_|HE1WbHSv-k|6;rT&x8uouN-5F4%12s*;25OHWDLp+%=-9071=*~}iAPr>Q zk@IBAb^)+xUDBLXVyMIs0J7xJj6ss82iMo_rbt^>CjSwp7v~De-ni&HP zmOvtM1SFjax^zwNci6Vg_B)*CIB&9_?fVjh&+^Aakt<4-XG_4-XFy z58KYO^MuHHoL3aX$68blbQPQM``i%%q_7o?!#b-A3#a{4OwBNAIy{)93l{V-17aR! zI9*{i9nO`=ANK7{ne8HZft8NJR!v)iz;aVJPV?StAEf!XwHiC0){?I0wqX=5%7*Ig zzypkYNXI6uN3>04h!)}Dx?E31!4zOzJHs>3Mp*8JNj5o4V{kL0akoCJ8}7l3|-Q!RY&-3eakF%@|5d0U;kb z#7CBVMPa%=owp(OAywAXGUPMwi9TUpzU?H{l;%q^-&|!@$f)c_wLe{XsdZh`#jGV| z#jD!UQooJ4V`>e5)XquBQ@3@J$-FdYlJ6?Rb{iAH+1 zpnsTkJUMdkN-|01fQT+;x2@3#+huYfftsiQC5Za_xsHk>?X{w+ban$7X7t?R9Q_I{ zrGD01M{^C}OS@N~VVH`tQ0X_-}82*Jou|;NWjp2ou&qQ_c<15nA}A z;Rj{ZKHKud7_#wkk>qChe2kP7T=!gvON%=r7|-f6&N5*RK%BE09`!kI#!^Rc+rzz? zt%H^JR|D#F^7_W*(`0a*jN$@Qrk?+=FQ~q4nV`E$P<-}J&ECiT{mTzwhS4%1e}I0? zoqi`sWdqf*)7gjT`y+iOqdxQacRq~z{WE^}+UFJR{Iq{^$y|+{Q|vCDUG(_z;A>9` zeLhBtaX!Fi9S^2;3Xk9jP8K$kK0X*?!vzn!OR*PqfrN$|;i%K#5Go%Bp1HG$PuSEt z8hknNx8QF;YarW;n9a5rL*hUkFM4h)~hu<;hS|7T3FY+I8_ltmpqczi9T-)RIFo1 zFmL5v&C+Z?9}O`Mn5ne?`X&;qXmk+$BvQ6d=yS<*M? zwJaquF%-1}DKU3CP&w|(axn8hioXL3y)$SUCuCDKH$>gv+SCAg)zE+sLPrMy>{%ZJ zcDaS-LMo*M&5PD{L6Wew;fz+Hf3OdNlSh3!ju5_0K#6zHPJt3i>8O$yJpT2HfoP@^ zk()RWT5XzvXdY?rw+)0Sh-(dnvVYqsNTa`E6k70^Fb;-KHUvTTod*gLEhQ9tatL25 zwA1)f>{^6t0k*b6iF>p4)>IWXXiwnNgu@WeZ8hD*nK}>*(w|UB#}#WGasb0`f@DWL zDBk9v@?nHhQ}%5k9QB&K$`o6~yq&+b$9QjQLe-pqLyv1HGzv8lz>D9a`78BP=uED= zTx6Vf-iOE(?iC7t%3SGVVk*eq;Y@OKjCo^WJ*q98dv+St)4tAN?==Ahr~8r#(WY+x z#O5#&!xGqoqZ6SYScuBah`)uUA-R1y{;RGHWrPf=8E!_xJyFE{R}Cj=-`xw8srAc8Xei&a#q2PeBso> zKJ3i!YBqR#@Th>AdV8`1mf$qbkl#sH+yQ7kY7RnaTzlm-Kv)+ys1WAKB^LGrxbCtd zG2}#p)3}cXMR9^*n6I{Rt`}A8N>)i$7^{5!ByNeVWT|ReHb^`O8V!&{grp)bp3C(E1yHcU2&O0*2?Pi01tFsp zM9mErOmf1k99QfxTOFLuL+VJ;l>#}A^;+JI)USn!D)i9yVM3SSVv*GV(n9WOzT`dZ zq94zB^R%&b8b#oH@0=ca%(CIN^n6p}9G(x(c!ZSRFqq)Ua4=3=R#A9MTzJsNSk_>F z9`(*Q?P-#?&qzQSu$ML>_QHHI$xCf^YO1)=4cY~e3`cTX1L1{;!nOV(0oYj;=YP1t zVHxr+wvmxEiyo@iD#XS762wQ@c_K+lN@Sw)s%_G+b_2gnm@!C; zL|9Wr^ zMDjs~`uDWCpZFTaA_c}u@h z1r30k!H@!u3m>0M$_BvBv4KQ3N?=|;K@!$c7Bd4bIzd<*r3ZG9>rM&jQkn0cAq@e8 zt8lCJ{@x+d1RY%L`9rVgDHUahj*7{Ib+-U72-!P8!&|xBJc5~Z$U&5q-Hie@?CpXM z#h%)6G(5#0bV)BLmvtk^%n9MQ>XhFK(%fh^1+tG5Q3S4ek6SvbT7Mg74?wH_fkaFh zF>s#sw66>=Zu%QLxR<1}hO0PGu=D=*jh!WYkKdN@jUb>im-zM`i!W8D$fF~Lm-!vv zSm53wAFbS5)H26#zT*4+W%+(QViCUN!w2{7SgFI_SA}$c`GGvb1D2E$C`#`+`eO&* zQtUOv>aY*5{kqR| zX(58U0VkT(Lq4J4`H$qiRduT+3BM&q%Mg%IN|BQFfbqBExrF}4P1&Q9;SgK?(wT+O zm*w}j^hBlgP3vfUyQ`Oy_qFH?31ppv*NFkGF2DAbzEk}%{gcRNuzhdNFCA4s z4IW{byzYY5$^IyF%W!CeMGLK!?FE)C z774-BF=~)L@#!T@3qEpin}K4g2@*xD5zz|N!lOqRpilh-bTrl?go!xTAY2!@*(At= zbF*>~x}XbM4|E0+=_}0nF*L-ZnGp=Goi5-gNZ03ploo{3_e0z$S=e1%S=rs$`M1;e ze>`1)4_@*&7%3;9koJNNxVULe%G&Sh-V08(Z%&M>!&Z-JOwVK3v5bb(8QXM|VMe3f z;o*kIIGbdL!>L@;SEJ!)J<(7+?_--#l4NZTPcBc-{&{eCahw)Rpd-uEet-1pNJ}yz zH*Em&B4m97>xgjg?diC&H>oQb5f_ z(g$STfIqd`cPhBxZDL6Uls!Os{mvM5?MZ$n3$h}Q={wU+Zk1@Egri(4a<7z}{m_&3 zm5j9jq__bk*YDqqXV#q^X@+~?3VjN55tgUmQ{wuo5hL|=1FH$ebY5+GFPKL!#nq=$ zm8fZM9Sj)!eTT)7R2{fFxA~aqp~!@>WSB@%U0P!WK0NuV&L%?OgCpdeNJge9s_Ah+?G59vepxQDA2|`X+7be>-Sc4 zLp}HFX4DeQ+eVckNIQdNo1E=9r3`ar2V@A+F%d7Y5-yeBMmA7{MQLRSgUYhDNq9ri zRsFV8r!@&_Po?J6j1tCLL3U`yh+Vmxqic^`!Z{yTDPWLeTi%fAC4$;$g*_%J5g`Xz-u;(=D z1^Wnf$04azZvBey{dE)Z8+!5v)2nxbQ*AQZ>CBrm7g7>Py;-TzNF*;}0r?I(4wpdZ zdI=wr0n&PN@^rf4NNdMVRLqggxMKy^MK9R`ZvL&Pwg#9LZ z-j!AFRz&zSpX1)#MV=q;Tg72cy>3cJ!S4%H&Y8p(TCNI*0mtCDdCGkNVp?`4-PT9SOdV* zR6ujzu4+Xq+P7n>iaO1V1dniBy{q-MYuW|Eq#oD#k?e^OHy&& zdXU^R?(PS@n)XxJ^V)8TQ5YD84HcH7J38A%(aOb+g0Ai3@WkG6)^z%Thjg+dj9^gt zzy!q*m2ij@QTQ@irS^eKj{ZJTo>QnzT}3E2$1dwm*Xk;O$xfB`Jbzwy-4=3#ZmR;} zkvm2K2^`4dK~NPz(?wi2L5(*-og{kIYWq??RONFm#tgfoz4IQD4_FguRJw@2v4z(# zz{4C@zS+ixJ429MY1X70+O@?_G&LD_>6LLO&)FtS;-6bgmxpRWOCD^W2hCOk$_g2p z0UontNiv=7MA{6_aB70{g14`W3WbY-D~({$%37hZSCp;Z7iaCUlCMU)(r}gzPz7F| zNk?Uo22i$6RzvVFeID4R34!ALvKF?0q`p`Z`bu;QA4b_b8l0TGgz|ZVr!q~9K|U)D z0Zfz|pTf_g@7^afkZg?!_nCS69oP*2qqkr^O)eobVoKOqgp!Nbwg2V(1Zj=u?3h9l zOQBC@7*TD$%ZG?UwvRZof>>n6$xF*1Xwbq2n&Zw!gg)>b@G}V@Ou$MtowA9CLLwFg zi5L|aW`Q{YfQu86(MDzf&1geF`MjVJ&uqnPR6`;VKhQADV;l~a0t1EM#B|7$8V2lr zQ(f>Y|HJ%Dk32^dfODS;$IvCh34>>XTd0-tI{AZiF~dXWN}GxsQM6S+fo+gdUUYKPiJrMV)#~~A#jHWhiVFEg{yx!Edm}1XEgcXHBizj}<~23?oFb)a z&um#68{qJs_DU*FnF3B!ztzSbQ|qNw9CK%V_#WQ%N*jBURMqfFLOn&3f0>|l8Q6{;tgML9r5-n4Q3MC-`>1cJP< zJ{nCWKV_cqTscPNGVNwAhOu*iX?=@RDW0X9d$v~}ylur)PrDN`0Rl8lm2Ew=Dr!Qo zi@$Pp9T?%;*VZ`Og8Xg6Gv$;NK^{6Zo5{@$>oIeaf?TRLX>`!`A#tZo79`MF_q4bDrMD64yP9Q3&Ui$Vj7gD-5 zP3B}DtwC*(E7YpN+ypg+YcIs1=PqCO4AlbWjA`7J3Z8r7k$ssU*3@xQ`IA#W|M#0A^nT0a2k;R5@$V)(^_L1Ww)N zYF8*5eUPRd+9dbo0{8={?28^SXZVsVZewg#RIpQ=N2+xx~OQ{S8mpmh(hVh ztQBb7-4N;ZWpg8Xft*ptMWWIQ;NT0^BB<(>jW%a6QFP_c!YId~32(4uOJU?4{$@WZ zIYbB4ku#)}Q<7Jhf^Fnw;V|L7&J#W|>az3R2ck%Gfvz>09{AoSX{T*9vLmQO=ZqC8 z+@N@=$2rhTZ=np+OJn}n*1nv%N0=a$Vwm*bic=lvChu=Z-mk{p!p@IK_aLtu*a>&+ z*vo7uR339Ji$u8RJOb3%yuF;%wnM*0(_V#Ip(da>Gm7`bOvLD?OI|$Ph+KR>3BRtl zb`1n0$$()N2@tR|MSy#h%)2SR#c~93sZtza^*+Y$cxm)Czod=?9@}Z|t}2obB!L!* zU6vCN38RH2K|`=07)_VEygj2frIOdEMMad{9>Cu+ z^6OBTcE3L%U55IJL-<)OCvSY9%Mjh9gLWJBKJU@46#XMR(9lmXB9ZMy9x2Uk&{bnF zFl~vt$un>%j_0^p1T%Zc!D@hza)uh{I@;phS-eJFp@`~`$m<$-+xtwI1T%_F;#VMs zIXIT!ZKh;OkUAcTchY*Vf|bD$D~BrZnjMb0T|EvOC#actS0Vx>qeT+&0136vVui=& zpuB5w^0xC$i3C^uQ1WR=IA$@Iw%`9ObJQRCT{%~2$tS+fDi7#hRZ)%`*UmssK5+d? zj-=EN*i5eVSGh%Cc(%KFJcM7y1A)pYOh1rr+_?Gq)>;T+RN?$SB+ow?6M2lSDt^ zjjU|p0Mj=T(dw1d5)Q9|{-2u#BqaZ}3<&`&RS#{QxJ{V7(ppp);ju%4fVmr5-TGv2O(cbY>ej+Q1Wf5x`qhY$VHo@5Bo^sQ!NR^COwhYd7Au2$rM$3776 z7pV~Gh>Te_fYr+U3NDa5L?Tx#@GR>P`1cSGzv84Pjlt>@&U}H{syp+G^SDk5X<@4a z%$}Dni?b3Gg1UOLc*X96tlQYByyaKtdx~{ ztjD~_#5cxBx_fY3X_{(q!$A*Oo`f^yJ``hwRV+ajF?T(5syYg@k##4z_LN)nK5}V)?b#$=o}Pu<2%omhF;?{y zL#=}#GC>m55Ll#x&;yuSx-xfG&LlG9c+LzBV8!LBw%}$~UcVs($U%c8OehhNf_5V& zp@>L`=}8o+bwn~W0egLiX}?X^ZZTb4yQ+<;1}%dhr+M*EDBV&jq*h8s11y)GBc?7`xD?}F>F=1QGR%l|lU(gWwJ1Ze!j{yp=t=ljQbBq9 zEsvQalLAv-@B_4TOz$R6F-jCCB6$0PD=W;6YsiDTb94NDZGj0<^?qlm1vn9+KQYLG z%N4g~#2)c3NhZz^K4avXLqYJ^huXzvseR~m)Cce1(2tz}&SnhkdEhZNLqlLx9w8X& za&odSA}jV8m0J~;7kA(i1>l66)lOi(u9$@!e~|T;pE$duH3dPs-qjQ6yIfubn>7eZ z5`z4xx&t7~j737XOv_j~nXbLq4)?k&?iG(ZpqPvQ(x z64-`RC^Fv!9Xmrg{-HSahn}9&Zqz|H!PDM>gVFmORqrr1)ta%zbM(!}p+g2{+IRdR zC7j1nF#cE@HQU(@0*%Y{A+uQKR+&QrrZX-l0$(ffkqn8AAUC{b#Gjvs{SIl9Erd&~ zKA!t-r>9OT>8W*rp=x`2zmt0F1@*0WsiWC@AWGc&XhUWhlB|-%3mFK%9me}8w#re+GA_JY{xJ!#8O0Q$;5)xD}?xw1!LJF zsgE6GAVQ-p=J(FTW;iNwdEdr-NEL}Ba2H4FxX`{$v8&^&{gPyYy9jQ>c$(zQ*gB#3=ooYePBZyoB@7hi_J{EuZk(^3>}8>DS_m$y;z%fq z{6|{kAUVCum)~bEi(Oq7D7+_SacomR5$`k0!hlRrW|%~|i_KDECne={BCHV^AS{8wZhc_PE%{j1alcm z^lOn8A%P5>)7F7VTX(K|Z!=c`6U>h9pZ+M#Mgr?W*OVjh~ zbgB`Vx+ZCECQM(o*%jSv2w`Ai`$8C!F4kYNgY~D^>0Sd8_0BalF|lh|aLQ~dzDak| z$LvV@{W@L98ml9pgPn|ap-S{rO&T(iqF)r2E)>tM)s3QVg9uSMrPy2{M;4KzN=o|@ zG+)t?@Z5V59$dEzp<)aE;r(>T!;{TZ`$ZqJr}eI6uah2S&%dE#S^f6@WyP-O<|7Fi z^X{dyO46_ka{s+WVvoGSQ%z+{rz9h~jSY60#=eT86m zp9G(8J=wmUPl@sCqgUHc5qJ>t1y5m|cFb(8Y;LJ|6mGuS`f?7(5;n$$I7N!{>T^@K zkCdxwrN=qT=5g=Mb;#{Rs#DrXL*Do=Hxs#v(6wdezw|_swucw&y~JyYcoIE5D6u0; z5&;)a=Hff!cJQw>tJ9Tb*pH>Bv&At=#==?=0h;~M;J`OvSBi!{?`A8&sgNiz|<^F04dEW9y02sDCWQT}H-uLPq_jjhqB!EATNh`O>#1Y79_B*gsf=SoNbZ0@21VrIfy)S^5M|pEw}uA@cphCa#dxyv zIg*uA^1z&Q$rI!NRNy~Ls=lT-o0lU70yMrlW)>H5>wue@O1wKq1WCWZOK^qKxBD$2 z(cTRU+m0EG5lhwl4lndy$+xM>QX(gAC*81u>?mn~0sR&D9_WB{RY{jnV2N4K<9nr( zRZJ#+g^cI6p9S=&48=Jm5d_+z=)BOl$vgA%kC3#z{|MIrKaoM>_8KHJ2N94|Bm`FR z3<&IC(T+{WU8)!?&hcx3x3vOVLoZZgV(=tSV*$(^#>?0;^;2kNktv;1ofn90sg8S} z`c?0uLexLLEn~mYxX(gVxB^B@JR)O?**#E9oz74uN~Xum`zj|E{rVK(Y*Y=vYeO38 zkiV)|4Wk{a=%Y|H$Q>xp6!tc7!kZ;)VkP;)Hb&i{o^X%}Cs`=SsrSXMP@V`}@6olY zZsi#*OycsvDt!^IaFSu^oxp8;_!Z}$pj{Y!l-XQO80QU=D7g21BDKoliYkMo(3ysl zk*Xo8l4oZx5Lkt={vqfDQsDL9W0d+NrG%fK=QO%}RdDDVKI0Smd zK`EPTEl31XpjQu4xW73xYlA*vi0U>gH39>|3Q2Ik`nQV0Rbyoon;;X35L;m%QwfJS zIh*THzH*)d6(#yR8hN3|=t*`POrut$AK#UMCmvUAnr2A1CumF+ES0KiScsQ2ZR^kM zT#D7QOyt}a(%Lq=V)sUN5wLa4X)x`9FEq+7(7B3x%KOK|6J+~T3@{y}YMvl5A@gP` zrn_nG8>bL5YK9LVW<6|b%KKZZ>75~0Tia=mOjVQ}!k9F*Qg-O~>P7pgkr-_Qm%K~I z&JD2;-x(O%TnewmC=KRTdcWsi-#y#fwtL7#vpDO6KyYmCGw;AxgbNk=jH5t3LM0QG z0IuQ~>BWTUr4)M{7T)AIH}lKQxt(73@4MZ-_ut=|`_t;~>fFx1-Nffxf4cdP0aEjX zE$)r%w7CxXKk&m@tmGr}fdRw_B@)Kgvfl zxuZmHtHelQY;lSX0W9`;?`*i&I~xzMmor6c|GF2NysGr$tw-;Ex(;Sv_X_mFg9OJA z$C!KIT6=s(`~Ad%Z22*P6?e&NvJ`o`oVbcn%ScTAD&DJL%Cw*eUuNQ@ z;#g~;&=Oe86AIxNvb(4h_9S9@jcsiUr9l+Nw=CU{u<%*-lMV)CJ zbg4=?CpGC(XzU0cC#Qn(phu@5Ym8ijgNeE%+VP2K#)mMkd`Y5qzT7gUE9B&z^|ZQK zUlt{$6v8bL;2Rw?4892|t4mFAqtid>o#QOQ)POX$VRcn?2S;a4D9;1=Y0p7#^&oH< z(2m{_RWy@OEr)AYS!ty`a065wBS6(jED&`OI%#-y!Y>EZB?@sW*xU^RbhEl?bh+69 zx>_m-8>3oKIw^6(6_9kP1yVJ4)9AZ;Z+!C>0hem4fLyO3Re~y+zO~y#mluJhO$Rt_ zJtV2y-EXZG-!f|As%F3CT$|Q;dw~V@DGgWo z9&DwnTGT0-$JB5oO<%uVxAHY>{qAAPfQj8PgJq>FLKKXukS+1ObKhM-L}=2&V8cnz@tcc?SX=ZtwJ=OQFBKtg^q zL=T4>Jb$QS0RC`RpphaTZ7fzl4f>z^BQz9b7mE*F&eiLM6{fGLCbaAX<%Z?n-ixj6r>`FG?P2@BW$s#C z6_t&n1&t?D#fiz?UuHV6 ziu;5a2ymG@ZG{~C?)K8^DqPYe+Qugwh9(6~1w&&|7xqrZFl4j&lSabR!Qmn93|HYB zeWe3IE9j9~?H+hb%f0E3&tY?>c{dVzh$9L59V?2|q}(we$hz?g1ti?)xL9xd&>cCE&&65Qo?iMJ*&Y zAnw?=U1a)azJe`~absx$&gues@OPO>^Rh3+r^Q#wH-L9JIzwvi_?&I%oa`_0HwZqQ zJsRf~X6RJ#t}D8>sHa}fy5y1`q$<2l?HjcQy{vGR&f4+VuUVif%Iz&^58veB3_sQ0Qe0<1L;eI znVq?f1!Jn8`XI=F=^5u%25&u)E%Sj~ITRIgIHM$q%FRBerj9SV>pV7Od7_{`aO9i{ zJ`tEEaKhJFt?s(AkR7v?li5=0g&*t&FUwPj2ngyiHq=>@*Xy16reoprowWsfFJ#TR zy!1C4qlYzrP$H>1Y(Mty5}WaQrj&(kahNSt$P|PlY+EY3f{U3}+GYoSgkgY(JRCec zqNH?r+k$QVkmplicmvb%h3+)rr3cekaf*SMJ1>w#0B1C~w{F>;OZaagQlVJ1rYu>4Dh+hu2M3n}=}C&*I9;&eCJ<-7Ga`2!4y`=*w{`<%TBtdaRETIZ~quskzKqp*C(Tg%G0T1}lm(lBegeX`2D| zs@$id!j2=GQJxXlB2C_eK@^^H$RcfaadrU5I&R^@sg-3mOMGT_FPvQLCC`dSUXv0D zJTc|8lfr1;Nel+HjcF33_&XZI2Q4UrhkAS zqLZ&%bZztxWvPPw>YxmD<_>DcEE9MZ$_6pWNj35Un5R|>g{VqXQzC0EaDPFe5`hCW z7p@E`G_G<%GT1(4=|FsWusBoknhgxmFF07=#)zX~*Bfs( z@KH1xj7jutZx8SH_U1ba^YaUE?T9;eys$qwTR0ZCkQi?BC`t6giBqpBfkSpd!QpJ za*c;08J2_{S(tWRE;t@VDMD^rBnF>^xI9B{8SE#7Cc)%BRzZVE-P8+-d3W1(DOy~o# zhDd{=(bPmqoGhjXFhW{L)W?N*xQ*7=*@sTZ0v-jdE8N^Vc;dkJl6B_}Bv72&UYP0n z1Wg&c+Neb#!F)(NFVMl26Ge#Bunwk=1#bEPgCg<>%}!Xj!mRJNXLeEn(ODHH&IL{* zp;Dvth={!UOQ%|1uNDsbpB9MPOmfZ5PG=u!S?NRgyZ-s8e<7JYh04#?TonSNll^~cbdS$x;D%Zf8JwW#omBZL z#7DjC{Na9YVixj zh)e=Cbyp=XU@{_K{u87(Mho!61rTc7CJ(T&eU36%mxMC#9w*;I6lC_Se=faEo}Krx zlYK_{Se#FxDbmkzm~WG}nI<*dWsEA!q!-!`k-vDM5lP_{G&7C`W+y9=r5p?NOC~0? z@Fg#8+o~~W{mQeGIbV0N^XmKP-VaZo3be6 zSQ=BVs(n}lm{Q(iFtJbsLY$2Cjgt(O^gaotVAvA!V?c@sw<90p7#a52`iE+ZQ1R&r z1q6P|^a4<>IKxXI@Fp)cq7nBYvH zDku)s!cd@efCwS#o?S7CbUmCL=(0ybt5PY_dUg0sP_2W_z$5h=z`pf>`}6=qsWv7; z2s)76D-hwV2KJDD4UJ=yS!UkGw)^Kv-7?&URw)#(Oo%PDZL*xA`PVv)Ho&n7HbF#H zWjgRMD-?~{F@h74F;2`AXyrNhYAtbvlxv5Hz6F?dnmW|>`d~)Xr!^xUcP3HqrB}%S zf|)w@B_=KB9Alu`aYE;|5@W8p zhiN0!LL@*tNOZFfvQGFEXge@Ynu$Hxj9+1KUX5QJWF5a0=tTTf&-&Rv0ZN3Z1~t0``)_|sn#zo2N{5LCi|KA{o7{>mqjruWnm}!`bAm2&o7)}~ zwsT}`@e~0iF%`{zs#|(M&j5u3sO?1eBm3B27c7=ioFl_{W*{kr4L$x54%vK_bU7he z2J*-vXg=)PD(p48_|_W2f`&xK>Do_F(1Rg;ZrXT8CtP-`Ek%~1AG`;@j+D4xBxeJFI1EEa`->SArd#O@UOp^-4$y_hk&GVo^$* zr5oTlu{~d3G!j2{R0u5i#b=5^L6DQBwxHr0`U(xjJ~wt zXVS4oOL-_j!KDG|Y77pS2o5m9p>}^f!#+ojO6bRk8BsP7!0V^4_qJX=&zo>OqGQdy zJx&=(YvEB@-mq#OcfN&HNu!nmrGNh%3}6CU{B~Tq$hd%)aIIdIK>?{2l6(vK@*si_ zN0Pmb@W52W)eSYKYOod#`}>z41hjk#Fc0<2VwvEI4-&I2yCLhQkbqn3raM!*2Y{NVQa|L1e5xf&E=|tLTMprpm8j7ZO(}Z#j%TqKM zI;UE|CB>);IK4cDEpfV!vm?mj%h_wpQ;CurwSVC|)HyCb0wDyz zfy?$xoVPKP>2R3{ zy*o*?3{fgl98QVM71=0JO>f{I3*`a|1b)?K}%8P$9HfbsvVwRd> z)1Xw;S03WZyIdtDOLVS}a3@xueyXcdxY5mI2S`ymSl@I`S~@qK`r>Xl%@D3QR##y@ zT(!CCQM8uA4dEwp8*wdwNS8n`Lm=q{ZhyM#YN}9x!eZBh5oHZ)YZB~%#ile}oVR6* zkH&%yHkuFtjO2^c2p?fJi!AH{RGYwP_jAi zo{k6Gcw8F4(U1Uu0HmVZ|u@XUxh|u@sz*5PSJo`Y1037dX>C0hdDdyha0PTXEyKu zY6eRoC}Gz9sN>6n18fdoT~I<2uP*kvH{y|ZBzb^Q z<{06v2!#k&JTMu5pb}|S)|UI>J=zlzZ|ihu3A*?2z=BV49jEOYInA4aY2tx+rsbLt zaK;B7D_s8Fh?1nEo6x>S`KOhQEEfJ>>t7&ENfy5+8LM1457G6d)}rUOYblEujJ@pC z(E8GUC1fwYaj4m-eS63oXe<8&&JH9-2HamK&66{$h1_ksWvYd%q9C96S=H+%bJMwD zSN~kqiWPQ~7g}}78g?W0U+pmJwOW%qL#}G)8551{%I}~Yud1UPH@lB;IV=y(=+`ML zY2m4x@{aFrW|_CHYAjY$!9<|j@XQ}hU3uCH+aY37Wk-Wp)62|5Dmm@G%te@jpf(Wg z{9@x@_MSg`xwZFv>*Y_|Pbsy_*bEJ3s~)~df;azGaD&^oyyacuYlOeTQ_j9EGdjDgn@dwsf*R15>`PVGY^A3(wKnlrdv z-<@tc|0LV0JRyaJcO!Tz+NK-btwW+OO%?M`sb2SMSCR8>D^gOYzcH!5duK9cp6@=5*vi z%-2kzadxN~9?(Z4u|&Kw0fSQf0H<9p`t{q^*+t+geZybv6hG+2lA#;4qz#l$h=HCZ zAq#^qvhEb zcAJc?@m%nRP;DlEBfYk1?{gG;ePmtb4d%; z+5#1TX;%5us(orpxk%Zvb)Hv(6Bo@&q7*iYxxRnKhg9me$Y_oiDprCMTG@K@=G7Z( zND{HIAsBg6HB(zjPH5<#H{QH__VTB1Z7N@jPH5-ltL-gog2%+g;vpX-u zcv@+CeU}Q5;#P5p4ht;6iAIgwFgqWe49*#5KODdj2OPXC3Yh;}D-`*g%ZH4k@Hr&& ze9N?!GLaA^TLEX}sQHO(E4g9e;7i29?L+2Lq4NS*L!vwOP%ZMreIX7b_PkaJVj`Eq zwGNFpQ1>K7B)D4=*Ro6_mW5Pb3ERC+lOTEwZRmun8>We>_lw#>!sMHUxS2wzBxe@W zl{udI!mqg!nip1-1RD$=Zd_n8Mb%R*h!`S-GN2gp49s=5x8A(id;R9sPj5C}SlFZ! z93v_^tR7v``9J^re?sje)mVzC6!u|=(JgvkSP2xslOq4;fB!Fq2V%LXCp9K$!k{<( zLp;>)p|UnM;#+9WK(9>Mw1NXZ8W5sITvO^QL3gS|`0^JVd#I&GXPmk=k%jkctogtV zy&M7I>jRlyuKI=|tMm-KN@OHJyZ^J`?++^OTigE3~*heB~}8wIzg-PD#1M)fYJ zE92F>?bq+N_g=nw^J3#UN5%QMt>zUN#+5$|&C7$ndV+#UK4!EP*Zu(0EPT>#ERW)# z4gEG4IQMXve`J~-G(n0e*zh#d+FrKz!w`$$ntSA9n>g|lI_Gb%pe`@DMjG^U_*9Vn z?TlGPWOpFW5q0+xw27RLR#S~bY^;Np#h=y0%Hmebj#bA2D|g^a1&leep`5~Lxg~jW7cfQ1eduJUigT1Uk3(kcV*e05Tx#wKL>Mez!=^=IfYS|3 zOE!Fsz7esiQqPEG8&cfRPZl`2nK8rm;*FC`c_w$`cbJxWJe!ZGgU-k4U7I2pNq`|pv2k5(OhTe=J>rh zl}$sJh=z1${+^9Ilg`Ml44O+6l(;f75T-+_7I%>6Y<6c4P^46uLtAEadxeHtoU%dR zYg>T~#%}!)t`yUUF>oUYJhMZ69>HDbtP-R@**HM7gi_fC3*Xc6yj=xwvQ8tjNjE$X zT;M{SFIbXOckK6C%;~F##o>HMqB!Za4CM}!6f$qH$lRaRC-sj^)vj z8VXQ5NaBf9^DH?pP`IRG@r1$jh3HK!f?7Hl{ze}oP`k#6s>TU04BWR$8G(dxHRlKA z$vPLDmuol2VG}`%fuW?b4WmzGd?u;Df6tBeuz^u-k59dWtMuAUrs%8oUsXzfATU}#}MO;w&fX0c4MmnFVK+ioboDCUP4pE4*4`-yLFJ((utUEpK3FKV!mmaxSEG@ z+J`)@pM+Z*R_{LH=VqbFtX6faKjGz|T&_0!npdPiOqQ{U5txjp+k)CYxD~M^rnT#I z`SqrHV{cvga;*X)Q8uWDuUs@FS>LZ-<}|h30HC$+h^LD?*|R78PyLe`52%+h>~~wK zHhzE^9U&%WdVy(PtPL2@i)o4An6eB-%_ugOY=fN5CNO4Pg{gXVzRgOtfdZ02Ct3FW z@I8?*SPKX*MNDEd_MwVrMPSLcCPBSeej<^RVr{?%9)InV1rwJ#yCDeodiPGg&%y?pYDHmF=dgCm*}@FaVTd@9?LFi*pBFid}8 zg8k&GP`dx3$7~HdH=G=+t6ML&-u$%na`RtlNxo{o3tpX7x09M1&$r%eU%S@kn`hh4 zHaDJMyP|dann>C%>9t$KuIIDOtt+b8CFdzobi5`anV#28tIF}(D_WE?h&)LG(Nt4U zGrH=!6FR2thH-3ppN?2dkuWwb?~_r`5+qZKLnL?ednar2+d#SWbxI?V6Y_v7|3Tl>5GYX!F!GXZ zGtXK_gbVq@yr!KlC+Z6d+SlZE531lk4rJBKQ zPu1bDuP0XfUvO4{mtUI2r`CuOndDAwB`|=x-;`mDeYqTNqF}(+eIqHT>88^J54YCJ z$(q!+<|Dh(o1w#E*Vq`KGODv$54hL(B1Jz`_nn47+qIiZv*Y!ho6ECsN8MbR9j`6O z6H;^%QJmnR7`$42+y!xh2*lK-V|+s2t-)(YRILYHahB^sT$Lp@4l{q&OfDmwGqOP_ zedo;>n)EuJW;=<#kPSkt2jzx~AOM|T@~aH&g*1*sRXDMKVC!LZ2twE_9?NB>xHB#D z;7GbSST?+52H~R!FFirF8*Ze_HKucnDIM)l9XXck*cwyQ<{xRbha-aj@_#0uQ9KQP)!@7;j-osKsoMl%)^oz;nLiN?v zH%~TKR#twXn19eCTo{^i2tya9&$Hts(HBei6@=Fg_7u5zRk_p1}a=Tr^q6Y0`BD5 zl>+_^uTOhthw^OZmbCE41+yJDU%hy-@$xY=Vh3zULv)@Yd?-#k@*5hn;Qfn!(p+eb zyXntfZfwJnitRx^@Bkj}DEqb+gNdKCn0IpPUpBX1Gp;Ocw*Tdzf6j9Z-`Xq_9%oI4 zZrTJAyC{l?4ERka@NE2^4|%8yH1g#RSmOe>HT6dvX#EuA@T!GPAR3v6!~JrIRrw{j z#L42!7*;9TLWWH0<;z|KJixJG?EwZ;7>T)hpsiyeV(pa*K6U)nyUD#*1Dcp1(jkCM z?5t3XbAR{}Y@~>WzIO;5GX5*Ef_lOAVaQL*CelSUuWr;A)K<}&G3wN)9IY8E(Q3y? zYih>ii|)`Hu>#zC7<=Rik=yzbQAS@3bau|U4obF6)C@>k7eM~hDR@=upyW%?5t)!< z>$(quX$Z6|;eESybxzOZs9lBHczCVfN}$BrkQ21lfTEKMjBwm!u5;n6b7mY(Ez`ic zM(^KJ9kr7&=o2SoO$59zs%V~IJ7GBbni1!EY6ipwgaJ2mnuwSx6knowjYMGtC{zgH z%QwqVfG~wT6q+TI#TuO7QO#JlnP|#wekYXm0u**#q=@12_cjtuC+MMnze3JsQhtv0 zUmtTLQ1tl{UM{*1;ZF?Gc9m3brqAGt42HTS~YTmtF5YF@)(K3 zB(=s!4aBzy?Kl_>knt%YNOqM7O&Z*aHm;;QPSaE#1#knPbmGS%U7fh4GD>B!7#S?w zr52cvTiA(YhUZp77_NjoJWI!6F8v}H<3tZB?bEmHk|!y-wGGOa^0&01cM?$=q;7O` zlj+S0kXS@rUq!J2>p$bUV115Y3TaxFGdjI#bKP~Z6LE3rStXyU;en*2IkangFUMH6 zNxrTFv(>8?>VH{9vK3p6{9^`d^qo#LZ|Or+)Uo`tLXvSuA4)e2%-k&=V$1s6h@fx- z5W!)DGsA6kdB&^ zSDk8|@K}VG)lg#90_qV81znTF5hMa57LFk)U%H0extX9A8P+3vBvx~0rjvG{gNWFf z-I?^!?#vAQ;pr1Z1j2^`eSwfbX-?llqto)>R(L4DSRkx{+dCp8=Oxr3p`Cc8p=%2#qzBa~hasS-eLH|%1 zw7ySnH}>%7@Jf5>R3kLaFqbMHk(U(<5e$a zQ#?G=yYeP*h}IFiMMocX^qW<^4ZEO!CfP&(+#MUAXst2sjWwRBwS*oT7@4tb@ zaCb{DAX|nl!p>?i>NTN{4?f~7FA96x@VcMInrE=ZMpeYnut#B*-|8J4>l52#I_RBM z`?Blw0h8+f*Q!??_74XK@LnEPuiw7ut|yx+-S%&WgS}!G(ZSBdVCxEy1 z9&f$IjlyudKCUq2c=_(_)|>RH?4V)eOo$<4ZZ%Qu6*j0h9^tBBokkM?`oQY;PCoa( zlHZ_%r1Hz*nO>qPCtv&YmO48s5t(KCfOG?gj*l-d4rxsCdNpBAA4@V3Gt^?C0wPA% zu8=tpM`5e+P+Hp> z?GThW0hf+AejN01UoLDt6#{Z;?LUopAq(tQ0R~J#;>O(e;WNi|M!RC z04=_T{P!-awUe)-!Iv+8)<5%d<`@;Sg_|jmY)!@<^7O^djf_EHCUqY7$$g|1(ni*~ zg+<@-T1yiGy{I{&PR)gsjNrGQOK zU}xhsZ@5ki!EQQ-Dys5wZ^}X-ZdyX5B^Z&~bQN|FE z0V6d6q|DvBSqYteA|A<(m4JWKKRUtW#hag_cn!vH`ta9`X@W`0?SM4i42N8jS-eqr z5hifc&`CSEZ|VYTBv=bD3Luu|LCY7K*m#B_{?tEI13p%_g(yxuzyNY{2MDCM);5)S z9;SsPV9E=62== z$Usc@?`VzzJ=Lrlx}LfcD^c722QWDwgn5zPm*51{Frb3AT>Un_02GXq9|`Szfp1`G zarq8&KRO6F=}O5GhCg+4v>SiYmSJk}2zz zxDk^c@&A{xqYdot%U*UB? zf%4W|cRiDI+~E~oq@srg;)@_eAquKaA4I(*+11$DTe4TlPdE&k#;$NI3)%^FPz(03%a3$AmH{m)m&sgtf6F#ozN#Ji`csj*C|))(WaN zY8_+YfV>jM1rerVu8;(V7E~&IwLvI|Vwi4?PzucL51|=r#eORq)|{MoWsIJ8-+PWu z^C_gph(`_L^g!jt?(6fbdh6Y#V#F?>VgiOXl#IUi%6c5~b%Jr83t14G-Il5C zStT_rP{HfLU=bxG06C+Wh{$_0eN9glFGq-qm_0hV95a!ta9pIXL2sq(cNU2tYE*ei zI8&x_mB!Yf?asTik7so7hy_t`h*lA&DNuwAGI6AwKm4HKslbY;l4j&0QL9=wgb8_w zD=y+=vFVX|sV+FUGH`r~4%9=t=BVIL;~G#s;Xz+w{Ncyye@H)4?1)D(e?FJd4~jyV zsR7)7a5O<4hX#S3ioiyC_dgaLN)bn13>`i42JozK03aDt7k?hY5crY0kJMzIvAgdh31Rb6%0c}eIQ1_B#~!sh6` zj)N!?p~lYg`*im_vl$B~I5*`0p{yaBa&Mu?Mgz=7+?X@>jG0F!Mkzg%)h8g1W<+g( z*2?5NOa1|Of;g`v{+$)Ac-u=uPllvwi%RxxV{9O9dXC3ZDcE35^J%jS%hxjM%w zWygR|`VhD{!0JE119cw`pGNN@Ebr=n)ctMpFuL&F#!hTvqea#>)rfbyMZSQPy%A6edb02ADmR z$P@d_iQc13f)}9l2+152Ai7z=*=KSU?VCDzSh|ihYzN8km;0xntEVQ5&y&{xFUF~? zUBcXEAIg=X_F0BS*C4>m!tL+X?XLi#Pcqc|YJ)YR|1YCL=XMK+!uQkxk=02{(XzFoZaR?BO ztEWSmGvmA`UyF@vG>fSVEjG+!-mVBXHl<^!Y@Rgi!g`U#h1dWp(@&JJT*A!&#bxX) zjx{v=UPK1N!3)~aq8N3i(7ucGK>=%mYt-Qf5_eW+vWQ|fu~~U*@DA_m#XYUaaKJ5+ zUFwfLe8-g%G;77oW59==!ZpBuswDmW9{7Oe=I%hOajyi7LjFdd_pwbNa}hw^O88j^54d08P`NXM zq*y$1(@&~EnhcJnT8%i&>LJ;%h!fozdl&}*TqyflY?68Lz@Vy2RFu|K`R`Nhve57de5oMcyLrV}S44QF(duoMcE#5W`xLP{4I>MF!*T&X_jk~x@M8x5^ zUR|B7ZN@0wsE#+r!PZ6#wrNo-|IoKHYHv`xil)h=uWL+PYI@X{Q3=$Rbk*r zHd2%M=pSwpNa)pD6xiU=|pvGqbE0&ky-F353 zi(=X&i?|~>EnscSX(N~eEQZN;G@utt7cUJ^YY5X0>mbhe8dYxHAQg4?m*0se(M<|& zwa7)b98Yjkx{n;AzhzS;f4A)+*=pbPyX!Ik0z8AMDeq&sq)%mRVULttE4u384Kdis za;6=d=5U%pH9e(n(aE{=z-l9`!ccYsLPzd%o#HAAbi_!F0gOZNbX$^+&*#c0 ztu_V0A9@o-*~Rzfr500}$~z8Ao$;n07AkH8>>}d^VzXQNXWag~4_bY6W*dglrWy>% zbc@U2xM=ZMcq9ZAn|}<+6olO|!Zd^2Ar(y`d7H>(5~a0_h&rezviWxrZnNSPRS?={ zYp`8p@fGx^uyKN*&_LOY#+&1v!jG%BpwuY&q3nch8uy*WioPO}4uQX;`Uu;AYOd+l zdT6AEP~Icp$%&!`olF7F;hsZX z@2aA6x(h9zU|lB#WFg#8;5n9iERgC!U*)37j*J*rzJVG7H?&QLiW5aFl@hryd4;uN zuR7uA#KcxY>`qh7Fcz{%pM!(d|Km^W!Yb zTw<-%n4Glwho0F$!N5jgLoIY%3Yu^?k3y5|amH#c-E;&^{6Rs#l$*QoW5p(HcJn=5 z_1%o3q>!8KVRv0WxH{qFh^ZtDqWCi6SCNCn*rKr$-&(sYqyrSd*qbnwl`l|57x6m! z)BvJX#Zgrj78Wia=Bm&p0?LQ?bjyc7>3w`A3o|c)YGKr4ks6?DvPYrT#MHG>2#pY= znRKu`l0arB5Ik}hG@+9rqBjuTREpbZdQU>MY;1uv@qae|mC?cqB=VD9R)HqT9fnD5 z?rTJw{n0sDnspKaMq_dBWf(L$nn8E0Z;}}!#e!pOq}jvggHxRI!xE7J(YRX@=UV2z zYudoUnka;1a>HOC`*{a_?C%jR;V-2Ddn-1G6EuW&Hd~3cVq7EWly3kDJgilMb=g`k zP)sDDpaNlO%ul!?!CGOiac{7Zdj6KIj$==K;;6e6-R^8j(}Ex>si6~TM4C4*u_VW= z*G#?HW3g9il!?3|(qiB={#C#^-Wax)_)&%IMRDIz3kTa`++)&1Eex~Jb1VFm98J-$dQL3a2ym*!NL)DMEHZRf9892| z`CO#=oy6yltqfY3)E(JlEZvloL_n1JaBe`7NLp!|%;~S`Z18v^w%JeRWOhf)$}1~j zBIT~V*AYezWaEg#u5OxagWkjvOV-*u-T`&mytf^RI-c}W+EXnWzst4=T}<{~tU`QW z4wv~VEy)$Z;3~0=T6xP^qL7KF)0xg3gorDBL(-^ShWkSZxh(bXseuLp#C)5x!{Qz@a%OP(pOtLMh2iBUX9sa-LPIoFvO662KB&f3R1F(w8HfV0bV&^GhhkOTMPgt@HHa;`}fD(OLgw z*HY489N{th_{8tt0lJcq*-}HqX*4E#a4W<_6ddhghPZ$TF%t1$t=_)b$98`xVQYot ziKZFR<6^bPdWBo^n2Z+@2DYWYIX#1>_<%9ZypkI>`@SrJfaK6nkkf?7s4o4bKX~jN zGmk)o<2_`g)8K5t#mrpC?g!tqVz8_6w)1ZLN%sNrGaHOr(*-hdV&)jMSTJrn&Haj= z+K908(5{$4kyXRsfkM`Y8m&05iU$Gpn%ATCl={Shz~#5@Tk=!kIoRTyVr)ij zGjVM%*tD);Td+waJ#c0+NfinH&{4x?ZsNIu;Yo5{D!|R$N%VrasSZ-w3^$9K>A;uF z4FsNK0)V@)vhTvXS@Ze(Yp`D%PR@(LGS?1fUf;0NAU+&%F~7t;m-^I3x|{6^C3PA# zX*HQ}wEh^8-mj0(-}J{wN1h@rQ8a+F77FX@~lRc&3UO{LW! z1~O$%?h`?{MoXx~?jk5aj2l(UlySMCm+KG7$7daf4*{zgi6WBCs+6ptLV{xg&5<)0 zBxCYcr`f=KPGBzVZuAe1hwcYYy9=&PTLwgQoMEVlJ^pZk+nWhA>uKm0i4Vx?Bj2S| z?@4F}x!Z|j5)2)fa#;p1@>hxonhj2-Fk#!8nzZ>YLtE)yb4AmgMT^A$)pbIvD46iI z?1+>Ghp>6*A&6KOSY6etCUa>6YSNeEKCceIwIPW2RyNfqG5h?}?d{hKOY@7>%`vzp z5>q!xG4WiEH<2q8l`&v(HzuGY<(_IYa0hTXa>i^|$c4m9LoUT4wMONQd6eXxhhCBu ztV~BDCS1JfyMG~!l(C^-x#+wCt~019mC##- zgV%B~>G-%Wp~gXLDP$Yta)?puDey`m{$~xXPfUvb@6g+ZzB&O*{!3Vf^NJlbNT^b0 zB&f239?Wlqv#de`3@)&Nflc7I!_nv~+^szQ)BDh`z78)fA>2@$JX~rZP!-eo8B*%N zg>!^hP@LNh>lZWeQkegIJRF{5li*}H{5Y;o1|N}6ZpbXCbcTH9A&AeTA@cA6h>MId zg;<%CJ|p(p+S=BuCwg2-jxOo1wZp+Dy#)8i83v8XwHz}@+}7}K?RaTjySui4kF_#u z3jnr$1I-9F8t(}dK^x#_`^6Hfi${K=buNf-9>2C@R*+a47DJ>KMR5Q_3@#RY2%K${ z;)~(NXw>7WRf;g2(*v1qDaN{}#68;)4)5XiA_5b$1+#^Rxg2fa-cVV@gBNx>9^MC( z;@0}v$?`sK(@{3=<7%VxzKPUMh)%$q$(e*3)3+m9gwP1BO@uF4vYHj z<#)F??oyew43N~kkdvu`?~gND3keH*gOl-uT3VAT%$Y%J^2yBl+QkSz$Mq3swe;WG z@k(A_(72*q2e5`5@5sE!aRB1bo88k(Wb&I?pSyXuaP#oi+5!t)jRfIkumX$iiLB1Z zwc69c0;8{7-QwE0qb;6@?g>P)%lqJQ){zGTy2div^7&+dYYU(>eu3op1o~f5{9=E2 z_*JCt24)0sIp+mR4gLx-@z>f1CnmCk4JRVkc`p(ppJldAc(tP=f4C0$Rl|-ovOrsC zm?rM-AU9?<2ucX!hnu*SO$MN$2>o2i5H*z0EYL}rxrRb;%E&#c;QG+oEm{aFt(kla zZc)ZrNc$OfhU~j9PsH1k0@~maCad(%JFX)1%?p*Po7&fc4oaX7f!|;K>X@t1BtBF@F0=&J#|Ua8s=wI@}#!B8U3u zYlD_d%abD}PR_|h9$}l{cRw>7Uw_olM$o>;ORY+*25)Af9S}e^qJ;gcOQr{u>G^nY zh*ZJdFXJwg=mKmj;mx>k*y-PvR}GKtQ8wjHOJomNomD!WL^I~=W6|8#V8goTHFSzca#2&41tVzpYjcm4&drn^;_ zNuB%M@mFLWJiT2#f)e`pqId9CzCS@(U2rv$M6V+6AzTaTfblc(0~aa;zH~ni z4lj;Zt9y&`q+T7|`b+58;law?JII5{z9D7z-?8pmzC%d=2*&6n61J1?$q)RmnSy8l z6ueUfN?b*Q^WNbhv|SezycnLYR(I|yiWzBo>=sgSa`euJFcfhSkSrp*woHN#3Go=X zG_fRVZ}nL6ZU0g)4vy%LIK9;B?C+0uL`%LW|G;ADj{<($h$C~{KRKU(N!AJ8i*cLz z5&+crZN>NvdK7mx_OPURF+A%XfR$eK&rZlu@AhHfU-I#g7co5N?LMj`?9nOSz-Ty- zUS#dbti?bVuDs|Q4?LCmzrxP2w&+j9T{>QYGJSZtLUo*ac zsk*0QF~qy_4hS+`07e<^7~1DkJ!Zj&Rrhm$|Ks4Id;IkrwhK%YBtReH@#*mI<+Gwl z&PVfcWrH5MYX0E|Xql2qxrPinkvUpbO`3W&RKkERR!gQ@Ql%Re?&@mq2zo`Dmt`p~ zVVZdu$3O-iN)IWgpoO5Wj_bHZlfcXuK+8n#(c+z@l`V=urc{=}Y$_xo1Mu?N|MN>= ze=7{}OT{TKIlqE}NMig2B8C5S7*uY8>e6|nq-VsrFpGeDU_e5Ci1hl<16^D|bc&Ha zz{;I!7&jqwajgSR7V|KZD({TKwFUr~@Vc0lp#g9tGK>*1tWS*dH3+w>`ZHV-5IILw zTRQPUzt~LZQi(I0QM2GTx<dLx0;fi4DnK`86*PyFu6$GYUnqP7BrC;tMTSc@P0tt{FyajuAa1=}BM+K0@oQ&}dt&FID#{Dsa zUNuKWX2!tX`(RMIeNqPF=LvH(ViGQ3?3cZc#VjR!**bJ$YloCbAD-_&?a zhkG>4>7HKu?(wV5?SFl}Rng74eq&Al5TUi)7q$lK_QIaZ%rE99u}zkL%v1}}Z>D9r zt@Go|h%1=!3}#+Iu=?v-15I^|k{Diw$o!wpfu(UwjAr6j~wH_>b z+(m;ei63Wfn(vFx){N~Cm=)MLQ2WCE{emX3zC`o}x+9)k=3($i{UcHpZ?L=m2egbeHZQBwDE=cnym{1thb@0} zf)m*iXS9pw*!BkKI7B>+iq+{?_^enoPE_upGK8onY;ins%-VZfz3p~oL79kOho=M+{0hl8*|k_&A9uo6?7?vR4AYpl>Z zH&65{2Te~h^85}ot!;!E7y{_7EAvtwIn}9{p}p3Pe$$%&-B=am`&P_*)$yo*BudTo z+fTUnYKYau<>&xA28F~y5=8iVlf{jrK+p0u#Lf59?Lw16UCK^?gsfJx+z1dgjuz}S`wY3F&ge$#m%Y!W;6L0jFOOt}Pr7MvVQ?)3y(gu@IJa30bi|QLD;VmWr|4g>` zlWrYG(oBPo^qhqS4eo|V7)C98K;WPb=dsvum5|b~Y`JsxGW^^9fa7BO<`9wPF;jRQOW>lizfBBYfjA=ppKG?hL(U-)r_LVtiUOZQDQFA zni`+?4`7Ch#W%8>i%6yx!R6!4-UY`|i=(?PuHXwzmStW+7^;wI-W)b)ucx zSsQ=)P<dWcL8FsFZ5e~h&u<-fw=lRbo^TW}Hh2_P? z#RXKGLAH*QlkVt}#u-kloed8UVThg#&dX=$%Xo z`19ioT+q;cGO->0IP>C%Ww@l57w7NvmRIJNEBPfzRzFlr^FQ#xef_0R@1oEOyyf%u zOP}(v5r6Rff&Q}6)erM`4zO*oG=Cp&SY)XJh)+v*=I#r8TX%k`cNehuBjE9}3q0=5-;*DGwv4h%XzMQU=8u*90T1t0 z_fVBT_HenojFR^OgFo`Hn!npc>u7I<(0`Cm2a3&Id${s+2^71Jr>MgMbn7olcb4%P zbYyvuh`*Nb8r@&+E=f_4Tgv0t@%+jOwp3UfKM&;7GU&53zw~K-8Et@eCoGPK{B!ph zZw>@eP?IH5QBgpPcL9wJ^8=pW6GT960e;(oGm6i`UI2fx6OtJz$$q5D+bVTcSQ4ODZOLqZQeknwZHBkEm zngQZ{Kn%=rAAP)w2PDWnYli5OJHP?*qcGSszT-dreitnPRQL|wL+Ly6DwXTvWABe)C<^rx%!~79AU<$lfRmq10fKK5*NRkNpeF~i@OKJ*g%;jUs6bi5q zfZ_)TS3><`2ml7*={>3*{6`%ms)srQvW8Nq0Ik$pLZ3|J@DL5(J%F+!aiKU!EEMd4 zT;5;m_+@C^R6kR52=AjTcCL&#gn;P+s8C^{8Ni2XyNk&H$UnUY9i<;p;^#YeNWk9m zJu)wUDOo@&g2Q}+$NZ&_q406fJ#fG?keI*p1>_s!h6=@Wb_atjPqV2HGYWL5WR(VdIbfk5*U z*d9ubvqW!&YE*s^8uSU3J~SUSuL56_#5y9XuYY)n~uJGj{o?9VG#sduTGB~k^p#v)XWjO2X zcL(gkAAKlXv;s2o$IAfb-sdC)ASj40(AiM4KFuOVp}O;f zNc=r^T$BT(5}boNtaXfEtdDkK3ETnd901iUKpaAjuTjp3gGwj)h#CSM&1aPU2cQW+ zKEDfVh%+f!%SB^taWD67%}XY(!~GR@$7jx;O;d6GiKfN)ww z*=RNr4LrOVoakwM3 zK;l|knA-vHK;;CIMEwC%?k<%ne;Iv1N~#O=iduqZK4k3YyBH#t1-8B-A}VA?EUx57 z>!W4BhRTQwB3Wf&LgeV`a9C3uV9NCh#FU?@d@{|??#ny8qG-9gr(QzKWF-CwI8hH` z_^DF-f7yH2_bSipPWU^2h3qPphz$q{gdlMo0aC&g8xN4QDN6NXA&hL0T!ef|^Ik0~ zokM3(WTs5TpzRJQGo8*@)q%D;b6s!Ifm~N~R=z*`J*>pml~pj zTE(W+kT0-#k`4dVp&9CV)&B4>A^|+44=E8|52Mlm7P;nvdUir;fJH<^(eVdTAPoa) zAF8_|HWiJKf)NVy3^;^kuv5iEDi?)e(grk9h99)Hq66}ua7oI?|D(6|F$KTHn0Y*s zz&S#yqk_M5^6*R>q?eH24G0E{QVl|V6(TeHj~2-zvPjLad|(o-q9}n6T}41qul%E= ziD3k(A}IXF2o`@qJCa0af-oTm>;Z~`rdliz&khMfA*RqufMK};6+K)$D22L6A?S4x zFaC=(i~m?gNuUGETrphWN+*>Q^WU<)_!_ThOl+g?TCk+@E+jM zH%K=xUA6qjmf~NqI4$HNGLS#@4C)#azFoypjK}L`Xay%%tT7sO2u_I%p`eiRkMa*u zkQng^gIfr82omrMk|RGcO-T<=x+m#xFm+|j0HVCug5g~}1B7Z1 zvFQow&`xN>r*GC_f~NvPbOcPLjonv^diPrwk4U--K&GNrY*$^yA$SE^ zm-IoBxgHpxD{G_P0}P0Th|oSAUmU(zC%ol96iLCJI(-lYhF$z#~uwBE`i)oc!a0fhHB<3*^*4a~};2hq`FCL|zEE@A^_2=NU9TI3zvHa~8y+LasP56t} zoNEvy4rv0I3P_8L)zrSoutp1$;Z1!vGD^dlS^liKB0nlaC3J4k2xut4M*kr#4wewu zcgsjZj7poNfLMtvb2&sv^v^Xt3}_ixVOwh3LBclK;e%$uDc4j7*g|;+>$uBHKnZ zi=n{FOqh@QQIk>Ff=GnxFD7e z(#Imzj*5X5%O|ub=d{^EpR_;_m$ua5FBC{wMHs|}Ba5;PjS<#Lybl%ur*H*wAtFW3 z4!=0X|qiibDjLfCvhVP=;cqF=)FIhUBI%o=k>Xbfg4Y zi52W58JZ!C6ePqB2zP-943nl2L{YS*60V`)QV{LGU?eUuf>ac#iZUF5zaTyYfJ#hl zqTq&4uho$NPS(Lv>LQO!PJ<`li1a4t##jsa2pxbxh^0bl^t!AvsoI+>>8;J8&0?q6 z8gDJ=kYM<>N+(z-ZCB~FKbY*5K7kE$5s@)d1*V=M{i1j*1pz1pvUD-{2rQIF5@n%S z@}I`?B4tVxP)L^v5|J))l|qGXN$edM!Qw@Pz++lKWvn!VgpzVGEZ`J1T8ac%G76NA z5m*oja6-B=B8m{Pq^c-Vf$#`YBc$LT2^TI%bM|3AL&8MXg#=+EvIBWE90|4XBi+D8 zX{67NM2El~q!Pf$Q6#L#2w6BNT8U{Q40al1f`K}w;bJzWw-=97tUOJvWWtyHALNP%R!Q1Qv3n-%xNWw6qvOqM%~KxD0Uxc3j9t3gtb- zO+-)ZCFmAPV5{Vp7zX%e!Ub6Qnf#)DikyHMGAnloJ_Uvn zD3sG;f|%5T8pu7VM=S@Lj-d#JK!lU(ghFKD;}C>Onj+n^SPpm=?DKsUQC1Sb4*6Hg z64Iq;a9Mtc)e^KgJb+Ik<^kN1!L?FLxR6*Rtp-Vja{Gp#JuXSK%^on=BK*c{`$*u2+o$?Z6EgQFYm8^`G9N;`tV&j+ARCJzWv4rS3a<6>@G2(=AbnP!yk*3)|k~Qi1ry?y5va-gl-u&aq*sqx%NVqbH)dM-dNT zbY5!4#!}fhs(WAc2)fU9+TVB=VA_fzl!a9Lt}Nfm&IbwQ*jQ^ZH0wa zR)RWQ<%24mo0KTsugAo=e=-r&A)EL1_?@YN*Pt)`jFh!jO28)Bun|?L1unerjK9m3 zCQl27-EUeyU*7~qIM7ioZ}*s|Secl5>@ zkx(zMUTh!sG`GrGGqJ_3AwsT|0(W$K8`}`??hJ{z#nZned8(|Q&iKN`kZ9LMaRYk> z$-H*`rAjYQHrZ#rp5XCl;DzK(jUEm)u96lL$12!4pp>G%4DH*3iL-VA&2serma{yQ z<8qb1Gj10QPp0K97Aa+UF;;u^@-7%Hy>$YKt&_zaO4yj2&_+;?J?TY7$ngv5CBu6F z3UWegL+wFi64m4J!PiUf!RD>bi3`YI_`-49RWIUH+(5wM?>1_8E7Y}Lx}e>ooeao| z0lnfd=+!sSB^Y1?mD;Yd+@kSSs~=lrzI!c~Uj$p!^+B7wA=@fPIND&Oadt(%FX1c; zX#Z}xXzR@%F)4Po zEB$_hpG4CYy^IS6$|u43pN<>Z(dJQ6L-+^`*&;T9)e4kydP^x{5adSqZ}I42tmkJW zyc}f$MOqt0s3GBLr!D2=r=&WFfnUi^{)GX7rwwv08^bS)qb^-Ri@ik)Nj)LGxT~_N z1DhFq5osLr?)y$h_bE9o4ToRvYm8~Idlfw)c3QuMF_zq;sdr1sh)Z9P2@DGdd&FC6 zyM_a6k|@ZY@I$Y*RDyAVM8~!ECcpnMz9jO5T-SH4qnqc_aP{7ekJ@qnklF#hs(=HE zS1(@27)z_>;18$bvD3Zc!*2eS7ZzM(NQIr6!zIZ$^Mn^0z$fXnl7ijXiNT@9RFgd@ zLW=e#r*KRTaW2sRG@n#3(Mt%g;26SNX>SDnW-grr|vg!@Nv85zQ` z=bq11RR|$W@md9*-}s2nO33X96}Y4pJ|foca9e)G6&!bOzbY^HAS0FnfL7qLNqccs zYNcV4sQncpCH(vdw>jdY&RMcH}C@-t%YCr3GVg6 zvknzFDcu#f36ev*9^16yF(++^2}+S3iTVZwl44LA$=f}m*%mziSDPRjOvlNtwi8{~uHhWG_7TBy;ATO2&sM5&8v-{7Up`A@mla+NhSj^o zxHfMrDg{-^l<1^Vr;}ScTe@Fu`DVp;ailg*x4)|Tjbqgn`(J%yZ_EBS_P)__{S8Zq z@QUyL@qx-eX3*Z>;f2Fm4O9frQ&1dDu78p!@~4TO*6#e%3~~YwGbyCXZ^5qm9aPI2 zsw-N)x%Z8VZ&ttYdWF{c$CZ2K9JSn!U709BjslAbrn!_e-E!6F>lJbeT0dGT=y4Bj zX&O5(o%yJf{k6C~iS7$oQ!&AeT281j{SqynUX1=MF7kq9_^}9pCb9nBd~!DfMP7_1 zO*!XD=g;b8zaxaCdQ!?zsFkOIL?S%sOylzZ2J&BEx$ykhoi_8@|E*iXY)V;BI8I3xJUV zH?T|Jd-;0Twb;IB({NlGFC60ap>$({VNkd+ofLGZ9Hy_TC6^n>9no!J&ptlO5plVNmU>^RJ4l`1&UWOz`@E)YLev% zEjT~fE_RdYs}S4GiL2d+_cyw6a8q4EdMByJ#vtNiQ^*+nm0M2mN1BK~B*Mfo$#{h8 z8%!mrySe@nnA4_sZQ@&((OR@At+HPCZnd^VG1072tt1b~o-q1jkSWp*LRFMBQ>22% zdjphtjtbQa9)<8aV-!j&r(-R7SSB8l&_ssmU0M@cYDsiT;!_yFUVC<;9jy&aAT<}B zen@M*x|Nvh&OJ!4Acg~pDf$~YhKw1FVx#^OJjJ5X=uN>-Rd^#h6{+?Bs<}-hX8qN? zrgBQL@T0P#tWc~Bl*y+C832W5$Nr8rvpV7IY0$A_r_Qy${e$DDPo2PlDyQrc2kE~8^b{Gm$kn&Z1GQ{A>y|62+tJ$cB_mxRYDdSOFc&O>?;5TF6c zVF_ohY*^wd1fREfV3N|HpxB8~insA!z_`S<6o&CPHwFpTF*%+x%Tg7FK}CWNimWe+ zHHb@19M6>R)MVu$dxXsigM>Myp$bFm)C_`*usQh0;zY(JTXGl3^|mXvaEzfBmbS(F zlLr+*w`a*(z%FuaWv@VXvM@8EYvcYhhE%b)VxPQtQTZO~@^GQn!u|Dh15|Rz^+;f& zB)U-fo;}Ry5jy!C$NgjvUJ>v3mi+r3dkJ3U(kk~i$zzL>%`SIBw#W^;|Rr#Yt)mcBj8aEd$DX3Pb>1NyHfcXCgHx8a(tqG|~UM9kI*XHnUuL8m2wwT7y_gcAy$&T zlF0?M-%SvjqwXg%To9|mwJp3v!MoB-O5dk7dG%El0i;C9E&(Ki02t6;nR#zmx z8V?eKuxm(FHB39R(Fn#v7h!F)5btCp^qL^=FHXS%D&Ln(!kUEiN>w5wQo6yN$jlsy zbZ}Gf9#JO>yQa*IbC8NS3M9Q{a{gO#lI%y5bXbnCLLDoOm^ z>$r*{YGn)_Qtv=ZB3((g-O}M;qzD!aUSL;kOUY~9U@gYw6<9F9+D7~JmPXrz)k3H4 zwCv@$E;Fy5AQ4>dwc|vR;!aaAe)xOnrqggKY3c=gg6_O>G z6vDtJ{;y5ON@bcocERY|ZF{sxt=c!|2pe3{NV+e2NLn-!l|3Xe)4a7uo8Z` z!}gU(<%w>+Y-u1Un?ni~jidG?ohXrO=;wS1{gm9;tR19nBhID+tdliRvWkjPL|hs2 z1M$sde%k>EPDD9M#I-3?DqwIilt#h(mInf>8u4`dwGU)9A4~YMStU&1bHykW z7Ox#S_^2v0H(9MxE7i$pLbOWOkFcEqZ#>8{mN)thSxyYTbSMfL$|3$jEs)&=?_R~O zfva)VT!+YNN0MsNr@j!*Kfuemgv-U#%a^o(CqkU{*KeVPDh|c~9q{rl?6@FY?fJ4) zL8Flf7L7|Wu6_Tz`zv0q3Pal}dASA(n;=TcssN9Xig}ZaO_h~MfQ~cBgS^nz(s>d) zP2@dMpau5@yDM5=MyH5PB(hPOD?%@O@xg>)4;Pv6R&g(r*mM)Wmkah{j;z@HX`jM= zpm<0KI63?j$n7g<8{K!jA8uC+r(P2bvOdBE=d z#dcx}%&E?|<&X$VcSD80-p8ops7uM^nwY_nG?@ub5*lwKw*4RaEo*12b;`b;&W=Co ziTS5`X?j>PFM}nJ-7wWPl01j#%CJfBQxIe-f_ENctf(lk-{fwe1Kc);jV~ElS}U1>5k=Pg4b^VhNZ{mkZVk@B}$+2VSe)rVdttZc%KPRV|LP9UX{~kMbx~cJp zP3KzAymk6VHprI2x>=$`TWk1P{pLrWa(h6aRxJCo|j9{=KhB9V&18i|b0piTjtCAW4mGY2)s; z;<8v#xwK{K-%XxOx{%T5vD_LG&fvs=i)tgl1IRmUY>2|HlOFAjFar~U_g2Wz*)Uy9n3Y|ELGb+S-LqSiwegcn9J96}+Uy_wMvn?_z)DpM%cgI;lY=mYGTz7$Dq8 zoWWsa*hs>!=h-%d&Oc)dh?k)3eD3qiiAja;1Fx%c0+}-}We?c-KKn$@F!JB+OvVo| zl0zrfen}Sz6ZzFJkvA1ZsY>Q7zOD%kSb*@@&4E8Wfp-OEsD>FGZIf?XsNVn0y~mEp zzb(}*dn;unurgy@%+m?&-OxLFu$BG|BTy`JYQn|(OP^s0F;U84nCwU>j;a;Q5(X9J z2AOhDSvI$qw4f6;UDC~C@Qf9d#ExjM5$$4})Q)CoI~bA{cE*bj8y_RlRd^X6U|^y9 zRa-5rcvt(f%jMWPV|Xq!P!Y3YhS8lX- z;8h&WBq_jv(p-usGk!at`T%X@|B4K%r~9ojscxf+<|~WMC9F%)63e#(#CD=NSrg6AIq91w=}XT0(wuo?vNLlyUE&xEE)fYJ`B~Q zx@2(&tQSn)yTCapnJ4DMS(YG4c+tdFRtlDp5#dAkxH~Q@8XQFFC@Q0%q(EjwAIAnI zK`Eg^8L4&@%ox^;+=)8eF-UTW+^1u(ZCh&p{I@fWIOnlt`pCm`K` z&VGV7=cOX7X3L+@bBUcQB278z1eV^dp^v||N+;sI4&F(<*!I4y3M=KWSCmaBJNcwu zzQoGZag{nm3cF>6R&jHZsc2ufXOxugJGzWp(yvwNb}rquZrj={nm)Y6E5pH1W`ST- z9Xkep5cZa1DJi__(kGC@jyAh{B3*~fFs4GJh<&^jFD^i@W7>UwBf+-Z7l}<;Fd)Ad zuO&pmMI{A#y7`_Zc`ne~pmL^5yw)rYLbE)L=f@mXCqxZ9)>I}v+@&!Yi!j9% zMV#!+l+jW#?Ed5$-t7Jajts5?Y<&mvMhXWOOLI?l_7%9FCc2<;$7( z;E}(^VIR}#0<=64j#UI1b;Y6QtV1e|X-5B48hRRCm4u3=eGT_2p*ynQ>2fiwU?sSf zjR?Y`6Swnfx>Gc0nBEWYmGt9#^gcK2`ong$k8h;=>;Ov<@3KT82kiVz z9_D+yaaUBk-+w9>KJ!W#y(&g-lDXFPAyVOTj6?ftWZzC}>xt8i=g#4J$n5J}d=k#r zh?F{ZR$rZOcc$mYnagj2w(Fk+TN4B#TTj0diBtxj6PK^8{SpPz*q>aTX!$qYU7hFP zAY#khr?QY0n+f2F3ydH%IPeq8sk@W$rKEH#6QAN*CO&D3rG%b$aEd2h7EC#aUMftc zIH~v}rIfgx7i7UTkR_rVJT!H3L2Yn&#Xi#pNQn|5e?y>@FM&#}r6jEqYD5RYP)2Cg zl<(r!K)7SO2D)s*s))RDS=I2BWK)8r*DK;3YCBD@3d{Ku?H8Y;9A#2lzhLor%LEc2Fo{sNkTH50f->j$p{8;Vfw}P za|a!SNXlY#>Gb#a@nACd`tqi%mXHBEF0c`%`$h-|;_k8btBF!1Fsle1 z&U!!6eDxxBTXu$oV14K+Z2l{uV=~lBe0o=x2r`UA8MF?Gc=4!vx=*CbxzaA1*}D_T zR3bwuDs3*F>XpYD-iB>9H`=S?wkNhgco)swBLw0aSI;m1^R(Nyu^vBK z$i#l08*J2NXN_UCu~JS(m3AjLx*D%vzxW9ae9VoK#ptByUZBO7?pQ595No`8H821J zURkjYoYl6tj_SHF`Vg~ZYTrZRvLXC!37 zpeAUr{6fHXMS%w6aS00uO1b(qlWx99)XF?;v>=+988xaZmsF^IPX<_MuUZ62k*G~R zrLwXaQJ0#8lDf2G%dSf;i=;@@C7)7P*^H^B-zVZx_H(mqHlE39ghc(DHwT4NBEE8t-)H%AdQ88;&!WDDRvIQ=q?~J>jq>+^dx+Cs$ zVu2=FRkwzTT#4SZ#1EmUTNhG127!ENX*yU!UePoBDbfr!4Oq$ao>9jjZU;smAPW*) z)c>G=qxHgWFeiIA#p|#2}(;kBZE^JH6+d$geaZSrv0V0 zs*sm;JlBY2CwQeIRbgQPg_#6$QQ8Mr-oA=dRw-C?40EV*UJf(sujs6Ve6U}@g~~lw zeI7BEX~{^R?EUsnI4sA-13lqT0IopLX%)OT(|$-yo!K;@60V_4j(<~*AH3akvI4Vg z*YRK*{#PL_>1gl%rar|WYEa2?Q?7DrtGw}Xs=kWF`My zz1usx1iq`ZeHr@nQdt_n-L9VNvXHBM$VSUkp)HU&91_t?tzxh|XJ}p~XxJ?)&pf@x zE0FPPZ-ObwQHY|g&P%!Tj2Xh-lC4oz39SId2KvNxuSQYfGgKz0A7fkhTA1`gRd$)J zQoU;TS2!!3F=pLiO1#+nNX{O&gwZehBxyZ$5|?JiXD3_UzKFF^4vvX=>^4_1Mjrw} zSF~SdI)M6{HnAi;uXb^hm<;ZG86Y^W zh^tml6&;_b2zu3r3v)=7q#+?j&vr3=&&ac8^LEj^#Mmkcb9w%njhGSg+` zmb(lBq$CC>p32H1R1Cbkw#Dh$0`>r`54SUPw$c@;Zjs@_xyH9o$!XiRs~zy8s&Lr) z(mU_U4n4L|2R@NYoAk?7PU}kJH=&@trX}CZY{e(0JarU|TCCnY* zIBV;N7q8<&_72&sSB+Qa-t`Kwn*gs)o^Lwa`oqT4r%pDWZ)!b$<_r#9zr|PXLKbZ? zGGbem5R9#JWl7e@l}ZVcd`*d$0~5^<*De{wBj!aKEbjp(Fi0j(l(cu>cW%f**2Wvv z7*LYIl#t>ZCypI6p(Jdj{$O%F_3f^!pMZ~7Ti(V~skJil{J7tNT>hrF&z(Ab z=B;vNc=T&{^0>CP=Fp+~nnOox57*Q+?K@b%ZNYDzDqE;TX@Q4pj?^_AZor?~rhRoa z4cnL4`1|F^d=pV<>i#1~kJKNnJ6Lz9p}w~6;Nc@pua+R)#y3x${!wY6anx%S zA1GqSjzQ&GySiI1W2@#>tPPP=s;bO7@w|4%gQ^u!pqJc+`60`y?u#FEwBp6uOI;sz zw|;m7a|f;6c>fe8O=R0v_N#703u{P<;{{5eY5i-YCpO(-o+ zMNBqp#5;Ici~ppU(qx*TyU-!}cR z$H;J@@Q&A&H!pVMVexW4Q<3zGAJ|=iV=#FmpGc)f_7k-)qxS9#QeQ>^==m;UiZ@Y%Uh{mB+6qX1aFfH7nUAkBzOb2wR(L zUKaL~fzo8~Eqt7mk4lmDWUDKf?_e|Xef!%L_41sn^F$#1vBuXS9s&~ZY6FV3hwGs! zn@=8f;fq1&gpVZ;#;u$LFfCOxDHkuS4OalIvVYld^(ZCA>L7=mp;2KqB&p? zeES>UHwz_uzSOA*`6?v`SemFsLaHmRo)`+c-r-IOyN1~7tN6o;EA2QO)K=}XAu(_T z>!IH|ays?a`POr%{-CMin-#TkD>sHKWg^lmyTt?0=kTJ?E_SIVbG&KKr_Eu1=mD|k zPd~P~jbDiFNZ*dcxIs?jVA%+3PI8|D-j4L5F)rLMYc@JDZ`I(Q(RXnHm#joIwf^87 zMrps-c=oMRZ+$NzG&Tg6^-`34QD9LoP3HS0q!kx9UJR5&+QdPuI(Po$sWWy)iD`KV<#-p%A4rbgNBT2u0*h`GwR z%Ht&!BqLZ|+R(sQ_%{yY8_#4jXjrzyW?j zXXTWx@~P)~2c9GW8J6Pmr2{pk31Y2&NsE-H3##K&&p@ZW^Fv%j`qsHqCu9t_M@qyG zR^_qS<=%9yN77gV9HhK{Eu98~_ctx}`@rscX>9A;XU}}^Y$H-pm&Vi*f%bfBX2Xs^4m#_A8Ux8wHT=H8?3nwt;wLDEC zL7D_qgr)kTGkI#e(-S6#Yp|6U?#aof<3IRb>+!}DzkB{{4Iez6UNHO?JV~z6(|*d)pceH{{}Q z8FN;A18n@5il|!=M0U-IMYOaqY>$w9A*09!#!8mB2EH|1Wi1keqWZo2SqQ80aA@_% zbb4N0rnu0iRG|lJvr3iP#9&C#J6Bpnb#uCchO81~j90r&4Z9}5oPr;mZ{F8n zP5~!vfKX`oc4KH_2}7U-sPLIdl<{i3#8GV7P^gaUpio|8kxZD|8OQHPQG$#hAr_{$ zo_kHZEh#~qwoMfJAiIae7+gy8en1FH}>Zr!uZK5XoAYjeV5DW?rHtfZFL5S$aL)naIun4?R zVi9$z2n-`%l?o4esDP!lLc({bwW*}=bgf=^s4^}bI=MsPC$w-cBa}>Oa@i6FNWd=V z?@x$xo1DKdo!)JeB&`>(cJ^E=nw(0+;7l|Ye1U~K4j;6zXq=LWvs1Z&PL(AS?OfTr*Dro> zC9^Wd>{MAY(ax1!?fM9wc2>(6vr}csL_1dox3Dvtjf~l;vSgxNR3=vuWwz`CiP^ET zM53K5)6LRZY-G$%l_eAHTp3nr%3#KrohnNv+PSii%geq-?NnVVmDcwhlhZUu;`r#gwpTbb1|fe7yuv4<67 zOqrlJ`zcA= zX=}d@+FL%ZsoB@^@xjY2A0N5=VogX|@UNo@FDy67-r(yX{H1;W?~8Ff*|U5dghN?h zjPPVH^>q+l@uD10c8gyJ;V}7FzisE$Q$+?Rq}Cl){oEAQ23WhqozuGE;Bo5~B^Aa%ta|h>|4AC-Ew=H_~Q>gmKp|c6MWL zZ&TP1ftx(iO3WQ1mW24$m1oklR2D?yM}!^i(QqGPDaz zRHzR$?${24W2bUpQz-_;#6hA`4b1y;-T0wvr@r%5rBh$j-JCJy$PwzT1OqXG+QN80>pTnjNJu zoqWe?JGyU#tytX|m8asdf?m!RT`fwu8#4r}jv2lV2u4QDl*2>{GN1F?<%!rP&kppo zU1@K7KQN+{59xS0@h0zj%apjvYHAUsER!-yNo3y%t4mm_Zi~?>C9)_1^yvnkJrDEw zrvXt+wDhWN^1XvS*hQhJLrdFb3ot2PG696H$!cP3jCO+R^1zqRx)Vv*3DVsz(;=no z3{f;puh{uia7-6&#fOrOB${1~mma>{sZP{}jf15XYPgoP8%tA^eizkZ$vd-JK9MEP zP-lDlCEmEu<<~dM#=2b+Q?3*(VHf22Hjwm0Bt!!(wYcZvPH~=Hk&rb#=_J@FM>w@h zp4{k4=h=~j9{9T*H+pcST^uePs>)Iou2&VM!ZH*xn1YvAmGW74MOucQBo@zPkH+;I z;11;b-5atut@hxdBZnI5>JJ^+Ezg7jc=t_soGwiZ*pW)uwQ^!E5nA$>lJl~~?4Ck2 zF;fv?qOI+LLYSCfrgzIj@F2UOT~l~Hb0azmm53r9z8HmN3fet|9c4+Bn6HM$G9^6+ zk>zBOQd&ghix}PV#5+36ix1;s+1*BP z>LNPg#}M%;%$~@*)U)2miII;8*fjvUhTrQ%9pCEuGwt4N|G-4hspi;?DLz)TTe8e z!&wGgzI9g9`q}4nlpcJy!>pPFwRoD-XMV3-c8$UoR?hX4$0ga%pE`fKDZ6%!!U1Py ze~t|oK0zMuxdMZ*ij5(+E;W>37~&1X)ZgaMJ$L2@((N2gI=(Hc!a-)1mu zyLaQc6Q@qeX6>*?vpAp6;Gu%5&h{QmvtPv_qvBLP&FDr@QfrZ=X=U!Ux$COfKc!-i z5%d53y-+g$82`%Qx05(#c=%<6tlYGa=9Z6-)*wV;<@dqFZ%OIl_3`iHiS)-4>5p6b zrh_dXA8$li$2AYXn-JFYGOpA$!j@-*Fm7sJo|K;}z4Gt!82_DM$e;7yKVirefBz|e zOPfF!%RSoiaih>sg;G#Dq^aDg3uv`lc~@KYV9Ito;HLB-zQ88yYf62pbK?CC@p%(y zI-Tlt|5f#xszE9z%Gd2ZAgy#34kjU4hUkf3i;;>5rNFy%S&`lEara3T!;YfRy=G^L z*e$dDu{i9!EgzJMghii=3bNg>5e^n;LCRy|zH z1B0Y9xy`$z2-!H_ArhGe3!=iSKr4aIc+`HyKyLyYY`YQxCc{F{YvGBdn@GL z6#VLvaZfD!#YV#fUd~V3Zm-Ou_lMgSN%<$uELBwcr_v7JDvl^@txtiSJit{R zuFTbLu+s{raBy8aDQmUZ+pni5)$rx`Xjc=I(MsJuO zAolD_V)hUu*~n7NC6D;BZLYJU%rD+%Ttr>52bb6Av8{NY4~`De@>`E7vl6a$a(A_4 z@J2w`RpCA7TIQyt_j2<>w^AQZj!*3?cP>t&J~kCIjw1Q%`O zK`#=h=iPe$3}!f!@c+xr@UGkZ<;^g=9yP>iXbt+}4n%{?bRWB>`;c`XcI!6mVe%r3 z=j$_h?Dt>$53wyUIx>}yX9_EOFgYlfO`*$DUqWV2YF?IGZQ!Tk0~Zd(AGq>IKI#~Q zOM&DAmo1^M-DP*gJE(AYHS3nDcr%N1;Ng`LznzL*tB?y)^5}Bl1Mr<>2}lt^9oJ_!QNUju?>9A^>3-I}HIDuh)AcP&17wC#CH&1hwX%OSsAWszr zK#C88OB=*sN{!3KSJgkr-GgQ9{?};f>8AR)0avTBm$282tizBi;w&5nw^RF{aI=H= z3pDx~DRLp5ii{jBd1VJ~Z|RbN?hE_&F_iZmN^S{|^y2zgd~^k`4xkILUMUEc3XQJ* zyWDU$nv@{^w+t^NQ=&%`N@b8n8Y~(uz+j~$P^`ZEU+lG)wer7-F^5lsg}u)4PFs`j z)Wl9X+DwtWv?g2Vq&SD+5DE;c;3?wjq>C3QZ5XA~^z>F`k_5MK#fv63zz+q3^PUiH zYK5+ylpzU3gv6-Px=Wo;jR%DBq)qv5(bwhD8}XClFLFzgi9lLSMwVw*g}2K-eMdh` zRM@J@?2=y$QbkoyXGfLYNEsFbkNNddUZ}KDet*gK6>Z^1%d8FRtr}45UbgWb92wu* zpFkWX`aP#?GHrSyK5jPFI2uB`b)Do`5jApYsCE$^u^SLGw&0uGCxpsEw%3GokBvF~ z1n7a1AbKdWjDS)iQo@q8-iPwNuMTBm#J77jkyVGCpetQv-2DN956$E?|CB)KM zl9h0Ui`CL)@O|1&To8`*nDZaKvU*qnc@CeDM2sY0~MWZa{U>qhowDr?##Z1hQmkqfh$L|$YaN5BnKVX z##WR+x3QxNx>%(&Cj|$QlD7Po%29khUy5wLsAp2+)>0CP6r~{AEjTd{722n`6zW%| z5D~}>4FxPIVl#T2@*OA$hNGk-N;IfsD47V;s>`h*2&h#j-o~2;wjvR7%H^HfytF?d z%ri*|{-pW%7OXyooHQw+aVN8hJlxZfwbitEOZV5*=$%Q_M%o@(z#Pxs>9*PQ5|D-o zSJR7ht*vi1o&WxsldY}$tBzGP$yJLLm)fs(Tm|SiR~%0QYJlM4aU2S2x0=k7ks}%XZ9I5`LL`XyIa);+&ZuU> zMR83rQDB{}0g#_KogL`$IK2>F3oHgNgJ@}rXWhP7%ZyEfMQ4tvbL1Kv{z|AS$_e6C zp4)CzkTWHvy4o$pU?YPw2CugvV0Swiz`1RAdxE^I-J?klOILchSYEQ8jN&nZ%36Al zBTCla8HFx>7mM&Q`Om%NqXazn^7}!#i?nEetqFWGwA36`oxjpv0edcI(Yh{Iv|q#% z3*GJSUXyDHuJvF;CvN_J7f&d_IN^%yi=7ppwqNhsotYBV$X+rG9VBpsp7;Y&dws3q?XykaYd!b&=~H-Lsp<5o zH?iUP?ejl4+k`t{6H#xSX>EG*?ejlUmiTPAua6)!K1rA`IbKuXw5Vvt;=3a6>+h-d zC>QyzG2e!h(#=qX(q+ve$%A5R<(x3G>2Gf9{e(fj9Pn`S0w6_>WU!g?WkFHNM7&RR za(8v23}xRAb=zqB%ht_l-{+}Y*jjp4HPLMCWn}UMtQV)0Lk<~mbavq$=j1@6c;1E@ zNMk6E(9ns15!QS=;o)$jEtr8#A6u1j6KzZoo5bxm=%ohtD@bKbW^8uMw7rq&@?>pJ zgHJVM^5RYX zjpL!Gw_gwtZE1ib;UMhDgQR4Z7tPR<{O0*kPCI<~@_&JKDlcx?L(T2Y6Z9ne(C_Z8 zQ#pePw59J;Uxh11Ku6qB>#@R22zyAWFA?c#7|XO6I4OYMjysUntHr6}B;~C#3=R*n z$47p7TpfNXHm+apf+pxX(4MN2Aq}SCzGJ-?((27xO@3H+4-S^ZN7W@|)dv^5<;|^R z1f5-Ox0l26-7K-{53A*(;RAns@dKR0Y{M?9uFeA=%dwJ{S3kaXb*~g5J6Bt~uwO-v zKr&ZNacJvR^fp>xXIDi?i)8XzAn#eh#dexN*P1*^@97I8H%(%vo;=MvU6(#7n*y)Z zw!e!@%YwWL7Li7TbFJTNy&gjgjJL0(#*v#EkiLKrC)B6pI^R`x|wF7UnsUD`K^WKs)H zN@@`HZPc;&bU6gE3J)!nD$Gu0=#lw&y%7Z!jlAOFgtHQ(3YFIMe6kEOD8y_`d7T1- z(^ngm_%fj)cmK-u`wE82XPM_S*!RZm!vKoOOLxMTZV%D}Vm~>E$5wudLt^-GxcR5} zTU%Fq)c!W|Z&QONsKfik5>SVCgP5c7&R`B53?Gtwe zSjdAlZfdI;z!y7Y#1mW>A9dLDjM~<1K&H9f;lhbx;8Ui$Y~G!!-uV`YSWje6BX5`3 zL1wYdMUFT4Eda%Yi?aXg`#|AUqu-YIfr6u&Z9h2QB@^F?X(cy3=@GVDjr87%Fa3Ow zPjzy##%unvL|dVWA(bkO$mqYm3-sIbE>Q991>v|6gmw2LaF{Xy_60p>-(z0Zg)WgI zH__#D>a0Q0WTDyYGBp?IN(%Et z)i`b?`&qM&SA!&9C-5DZvZ!;Qg39HrvB6fTqtfDcIPEJD5Rlf^lc&zgPJshw z+q=7ZuD7*!AHaS`c_;S(mY*cm{;K_W|24G)aJ~JHdOEJ-ade3%A*QE^u|yf}Wp|B6 zVLYquy;EYSV`H%5u`R2Y=6UZ{ZojO>Gkuu%0Shob2sea=YJK37+wlyY29G(+Q6_iY_V~QjzLwyn$F6uWvtEsBqQ*}{?i;Xg3eMf&E zm)~vr`-J?~A$b*_@ov{}9GJkcU4J*r?|1e0_vH5#{r!FU-J!p6Th5-U_w@I_k>Bs@ z@86Z*SM~R4`7ICfVshb4`E5hlx8%1xFpBUq^7{k*{kHu6BmMnv<+nW7i!^8Dw@p5r zlixNia9)1*Xqq3$?+^9&59Rkq`uq3fx4kv~`|{f!G5?YL{#4Waf&9j;JFIN^zI^@D zU+dRD;U*h={dfDqT{if7U|%=+_0Ya>7Y^cv?Ca0?^>h2W#jpQiU$`R&DgUQ^{X2gB zjeY%le*G`|`Vaj2Tl@Nt{QBSa^%wm5Klb&X`1OT-{bzm++t+P={hfXF@oU7se#Wm+ z`|9V{n0>p7^V_)RilfSeta_Px`wJ-AJ$$)*4FHioPeUTGS z2JMS&fAYC~v9(W32A}*jTWeDHy zD}3G5uX(E2{GZtum1_Ra?TczO|L^UKiZgG3%@eSB18kmv%^P6z1Z>^_nWDb3D~>=Hc!Cj4X}9vHgAB<6R>#$Y@UG48({MUY~BEyCt&ji*gOH7H^Alz*t`KY zPr&94uz3PDZ-C7cuz3S)o`B68VDkiQ-T<2)AwLbVc_KD%h|LqRc|&ZTh|L>f^F(ak z5Su4r^M=^GB4!Fl8@yofJtag7rf&<>w*}L;1?t;^0k%NE7XFjMw?O-~@R@zl@+=q( zizIBp7{5TqFWl3VOC)6>XJ2IQg0Xr*zl_xjWc7lvdV#E7Fgv^OKZQvP#?A$@bHQxl z!rw8@EZxF5zs$BR;2tyNGi$a$%d=oMYGHfWwKfMvKH~(fXLhDdsc87KzxRBQ_^-OMj|u zU-}b%nOrYXu9pnWC8D`x{m2sgktM@#iT%iu;kQKmmdq?I(JU>QSz01Lm&`0J(JU>Q zSz4l5S~7iDqFGupv$RCBv}D?`MD18Iv$RCBv}A}a(JU<)VoOA9$uL?XMoWg#5;0mb zjFyPel3}z&jFt?eC1SK>7%dT_CBtZm7%iD0TB0FZGK`jJh?dN}EYZ9y8Rzq(Wc^b! zDfv-$2~Vv{c*-u}sd4)$x&73*{gm8(YTSNGZa+0{KP9)H8n>U4+fPkf@}pGpr^fvJ z=of(-qs*t1JKQ(W%kRu>Z-LO%epBi)v6qTpuKo)Yu=cyr?AEgL9 zH5amwQyv(W3zVIwhGl+Kvzq!X&>eef3b*h%n_^0pAEhk)!oXahEd9c;EPT#B{1>KH z3;#=U{=%RwTn3sLFD+YZmnj&_<~A(T z;w+n%FH=lbOfHt$W2~69UH)lg|~pk}Iw`)PR+g zM6Q_Btx!8xT#wj0uUZYOG?=Sa!zwjk)oNHJuUD;xRcgShX}~HqVAbkdr3S2;2CPy8 zR!sv|sR64-%PKj)Y8tRg4Ole|SS1dtM&~LuVAV8Wm8h(m2CPy8R!sv|iP5TQz$!Ih z%`{+@h^?6htdfIkrU9$OZ_PAdl^U>S8n8+<*GvOesR3)I0jtDz%`{+@8n9*>uu7!Y zOaoS_0c)lKtHgcHG+>n)ux1*tN-0<~4OnF_v1S^uN|{)*K6aIz>YC}pDm|z*(}z`d zqHAWAS8s~muH8|6U*#BL%{tgsTKYB9oK;%$HPf6`+Rru9oKnx znZ~UtDyDI3ii2s~nsVMWZcTY@8n>q0H4Ru}f3#*YzsCM(&7^$o5&3Cyy~f^Y%_Mnk zf^jChYt*qdlh(Bv#+iJsvFBPhiCias>n0QHZiuZ@|JDtob!yzYp|VaLTQ?lmsa5NS!#Z(THyqZ9!@A+HP8`+^ zhjrqxZaAzHhjqhYoj9x;4(r5W-EdeZ4(o=)I&oMx9M*}$y5X=+9M%nob>gsYIII(g zb;DtuIIJ5E>%?K*a9Ae}8)geOs5u*^{TtMk4b%4xYR86Y_y+Z1!*qIs8n9tnyg`}Y zFumQNly4Y*8$^1;@Y^7M8;0Ko@!K%`Hi+Mb;kQBjHVnTF;Z-e-47=9bXZ^Q80AbuN$ z-v;s9F#I-%--hA0LHsrhzYXHIVfbwjzYW80gZOP2ejCJZ)AVSQ+}$)=zDdisY1Vs_ zwr}%^>5Sg+ob+&8h)F^Z`1JGBz~KQ-zM?fH2gM+ z-=^WWN&GeqzfIz|Y4~jtzfHq$llW~Kew)N^)9~9Qew&8hCh^-e{5FZ-rs20q{5B20 zP2#s{_-zuuO~Y@K_-%Q8^!>LUXy36({Ifvev?wLAxTjuF(QL?s7uD56> zw#?JnqMU7+lyA{$Y?-ICMXB2|nct!f*)mUOi!!)n8nDHl@>k~RY*8YAW%{s1PwrP{ z-L@#7zcTIEq9^w&vvpgP)?b;fY|)eZm07+m%5Kza&PFuGI-*`vf@qAjM7`#4L}RQc z>NT~9##mF-YfeWr#=4?jQgNQLm|BG)7-C>iugK%V>;R z81!XpDLp^_rqYWArJbUQ?B5jG7wtnzBS=^edxYQ+XpH(D^_t>DWArhjUQ?ZDj2a*Hn({y{1ah7;Qz=YswUj z(ON{krcTiq?M2jU3KfmfVnn^BQqdS~M$~Ic6^+qqM7^d~(HQMU)N9HUjnO(py{10V z80|yUYYG&N(LzLhUVfjpug}Zx)Asdw`F+~HK2zMNPutgLsvGrb`}(~8K5gHa4@Oiy z#!N?b3>A%;lIk!f8Z#}`u}U;%YN~^kXw3A~KTT0}Xc3KBAE$nDG-fVKVSx4~`g?0v zVNm(<_eN)aROR#^%yB7vPP-OO7@^SwZD%xLq(u|7m(hd~6HU-YMiW+jG-3IzlZ_^5 z3!@3^W}^wEXTmz#Xo5B`ny{`mnxLJFCfv?UsNI=xyE37SoNzlbp>}1$?Z$-KkqNgG z6KXdm+%8P0otSVtFrju~!u5Va?ZAZV`Go5IgzNQ$>iLB0@r3I2gzN2u>hXl@>4fU- zgzM#m>gj~*;e_htgzMde>fwaz*@VjFgzMFW%Hf3T(S*v~gzL?O>d}PD@r3Hlgv;%O z>dA!5=>+@KXu|bkLiJ?Q@t;)uCmsJu#edTApH%!O9sfzif70=vRQx9$|4GGv((#{E z{3jj%NyUHC@t;)uCmsJu#edTApH%!O9sfzif70=vRQx9$|4GGv((#{E{3jj%NyUHC z@t;)uCmsJu#edTApH%!O9sfzif70=vRQx9$|4GGv((#{E{3jj%NyUHC@t;)uCmsJu z#edTApH%!O9sfzif70=vRQx9$|4GGv((#{E{3jj%NyUH4@t;!sryTz&#ed52pHlp% z9RDfBf6DQnQv9bJ|0%_P%JH94{HGlMDaC)v@t;!sryTz&#ed52pHlp%0=|mZl;byL z-;Upu;y2~^O(}j;j^C8xH|6+EDSlIq-<0Av<@il0ep8O$l;St#_)RH(Q;y%1;y2~^ zO(}j;j^C8xH|6+EDSlIq-<0Av<@il0ep8O$l;St-_)RN*(~jS?;y3O1O)GxWj^DK6 zH|_XMD}K|C-?ZX4?f6YAe$$TMwBk4I_)RN*(~jS?;y3O1O)GxWuD{c&ztgV2)2hGI zj_+iJc@3iATt@uwn{?m&8wBtXm_)k0j(~AGJ<3FwVPdon8ivP6Z zKdtyrJO0y(|Fq*jt@uwn{?m&8wBtXm_)k0j(~AGJ<3FwVPdon8ivP6ZKdtyrJO0y( z|BU$^(Tw6Zg_l(QW z3`Zu>jE@^;6u%jlhZ*(TXMEf+qj=7^e9WldKI7wt8O3+Tar|dEqK#(UFP>5SW?UX-)IXbXzj(&*borQ3zjfB}omG5i9p72Sch>QpReWb1 z-&w_X*72QHd}kfsS;cqO@tRem{mMxU4LhF+%)U>%ql*!j?b*(Gwb-w zDn7H0&#dAz>-fwnKC_O`tl~54_{=IkvyRWK;xp^`%qjn89iKVn|E%Nl*!bu8JU0G0 zK97xmj?ZJ`pX2jb<#*Qcd2Iagam8bmk6G8}$0{GQKCXCd?RWitZ0+}P#bcx2_5HEZ zKj-+*DgASf|D4i4=lIVl{d120oYFt%_|GZ+bB_O<;y>s5J*WCT=lVUT`aS3RJ*WCT z=khYA@-pZ8J*WJcbNQK5{>-_4XTxjfCOJk9yMz?|CiIhU_Fm9IIMuQ`>kIhU_F zm9IIMuQ}!KoXgjo@^{YVYfj~B&gE-P+T6!Z{$p*h8Tt8J>>l&CjQsp9PHW_EnR?`JvAfLQvhwn`I9$x%GWE#cV)vQ9W$KZ? z#c7TFEmM#DEq15*Tc#fQTb$O&-!k>c-(q|6w@f|qx7eQiEmM#DEy9<-W$KZ?Mfmc! zOg-|q*xvjtQ;+;D!k52g?9SgJeED0}J?3u_zWkq?_~-we6Mp$S#{c|h?0)lijQ{!1 zI1Q1%W8$3ujBw}gm^kM@Bi#8rCeHcKsIK`tCeHcKsIK`tCeHcK6puS5&iT)1?(=v4 zN~f9fpV8ds@0k0O|BU87f9IaX-=RB~zhmxD{thQI^LK2TD}RUXUH*=_NBKL}KAYys z-=VvgzhmxF{thQK^LI?X@^|R|q|eA2oBI zAEA4lA2s`uAK^4?e$?fCgzk2J)XaT;gwwG3Q8V}X5xU>`Q8V}X5l+MAM{PPOKSKMI zAGP5@euVZZKWb}Y`4O7?{HP5V@*_0&`B7UX%a739=SOY$kRPGB&yTu&8lkz*kJ@k| zKSFb#A9ej4QF}G&`Z=QZYSi^}MD5k6>*t8tt5Mg_5w%yNuAd`nuSQ)zN7P=8x_*wR zy&84>98r5U>iRjN_G;Aib42acsO#s5+N)95&k?m(qpqJLYOh9JKS$JFjk^AgT6;~O zmejnAnmR41wHS5n88vEcQaC?q)Y&9(e$=RO?HJYGVAQ35l#`ZupQX%W_7clId7qce zW4@B#E%YZw{Mj$%-!3! zN)zVl?OUY>bMyAC(t^2o`&Q||+`E0NG+?gXz7>7Ut=l&Tk9o|c+qdF{xpVvG;4zQ6 za{Jca3v=W4t-aNlTO*w$&tq=f;U|8 z>Ak1PJ;j{msgKkoRCEB@n-|F~MaamRmL@gH~m#})r^$A4V$A9wu675{O^ ze_Zh&cl^f{|8d8ET=5@w{KpmlamRmL@gH}68drT9w?&lvxN7sb<29~$Ju>SZ-PH0P z8GoajYP}x0vwl;{e`NfQZmRWqWY#;nsq*&7_#fR=>-EU2cXU(b?~&mV-Bf$<$gFpC zQ|0lI;S=3d`|!xDcXU(b^O4~d-PHCyGV2}PRC#@5_(eChy^qX#M>kb|9~qv}P4%`O zne~otsysh3e50FOWXV4=>mA)Rei`1;O)j$JADQ)zZmPULGW?^PYOfxd^^R_;{68{z zh;FL)_QTx~bmVBeUMo zP1T=ACQs2#_1+%2_ui}e^vL8Z>Q(RMkq=gSRlgpYyhXk0y*x7SD(Y2zdt~+}>Q(RM zk=dW9SG|=-W?!OSdKZNOlefYE>n{wLd=&;*Utz%HsW8Cu3j-!Ug#qewVZh|2FhG4S z448b_;!nE(}ng3j>C4VSxHv7%)5w1JvijfZ%$_!I`H&xHZQqcA{yE({p|3j@^W!hrF+FhKn)3>be41Jt*|fbp|1K>aEV z7(WXG)ThFL+4I5x^`|gk_Pj7aeJKnWzY7D@kHS6Y_dVtJJ?Hm5<@Y`3_dVtJJ?Hm5 z<@Y`3_dVtJJ?Hm5+Rws0=l4D3_dVzLJ>~a3=l4D3_dVzLJ>~a3=l4D3_dVzLJ>~a3 z=l4D3_dVzLJ>~a(=ihzh-+kxbedXVM=ihzh-+kxbedXVM=ihzh-+kxbedXW%ztjGx zaG&<1aNq1{;Xds{;r`!yJncc@{y+LR^}ld`(!Z(ih5OU~P5mz1xBjnipZZ+5Z~b54 zKJ~XS==cpPeuIwRpyD^^_zfz4gO1;z;y38{4Jv+vj^Ci-H|Y2cDt?2G-=N|*==cpP zeuIwRpyD^^_zfz4gO1;z;y38{4Jv+vj^Ci-H|Y8@sQNPK`ZB2cGU)m;sQNPKcn>Px zgO2y0;yvhi4=Ub+j`yJAJ?MB3D&B*R_n_iE=y(q*-h(!pDh$#-7Y1$gR2ZZ^E(|(e zgNj$q@yaP)Imaufc;y_goZ^*pymE?H&ic1P?k~h&E##d4Ipu%O`JYq%=d3>}d~W4A z|8vU!obx}Y{LeZ6bISjm^FOEj&pH2d%Kx16Kd1c9IsbFY|D5wbr~J=3|8vU!obx}Y z{Li_*}{;2S| z`4@%HIa)4!ZsU!@=j^`=Uj+WLzb|}Yqy6Z%w*QM!)!*ng{iVVeHrkJFD?h$4`w-ox zzf}0bM*Goi<n7l@}RldJ4{zbRxFBQJ9(SCGW<^2oeXLOtXQeoKr#oHs4$6=H2 z=r;YO!m#^`x78jF8~>x*%D-Xv7jG-x!zTaHZRPi{`-`^~|6$XI=r;YO!m#^`w^bg7 z&7MWKRUe1lU%ajIF>LlNx~=*-?Ed0ym6u_&chPP7ONC+g7jLWl44eInZqr{X47`WW@mUn&f{zu2epHf-_}_0eA{474@f3Z*Xf7tXl>Qi|g zc7L%??f0eDi+yU}hfUw3KJ~|j-Cyiedp~UYAN6sz zr!egPVxQWdVY3HOA7^_C!|pHksXZDt`w;bUwx=-c{$ii@55s0JqQ1XWd9vw)s88+H zu-T8OkF!06VVh5g`qX|6n>~s8INMVgw)usqPwm;T+4rcAvpt1j8y`h|YTt&<-ba0$ z?I{e~cq!^rdpB(MKkDObPhr^gzfbjl*!90p^?%s)zfbjl*!90p^?%s)zfbjl*!90p z^?%s)zfbjl*!90p^?%s)zfbjl*!90p^?%s)zfbjl*!90p^?%s)zfbjl*!90p^?%s) zzfbjl*!91U`v1%q^PXW<6aCRMU(9BrZri-c1W=-Fp>0;`$S=0AtSXCuGrti*NE_h(pD<+thkGpwre+w}bz zR#o|J`u+^7s{A&6e}+|6ew)5Oo1wjXHf#F+Oc!&XVa?O%r@ebNYx@377ju98v!9uQ z;1?|v{+f#57i|>&nv&obtrY&6n&21h6#kl`;1?|w{+g=b7i|^(nzG;*trh;7y5JY> z75+Mg+qv`973q`2r;EY2(=y|rgjLS-Xp{m4*M|`5B0{Y5LkP7IA=dpNg!+gO>i`i#4+J6B1tNqxi4f}q5kfBnA=V8dgnkG@ ztRqASJrRUhSBMb$A_%e05FzwN5MtdSLg(yRN_?ByROI~B6o1yNda1 zPh)n~r?!#C>?-E8J&oB_pYBE)v#Xfr_B3W!eF_|D%&ubY+tZj`^=WaWF}sTSa8F}= z_Nj8DF+O9C+|wAJefk_}oX^%_BE;;fPpKos>?-Ecy&SWvKFy9aW>+!4?rF@f`qVqp zm|ex3yQeX`>eKN^V|Equ@Seu(s!!1)joDSq&3hWNt3GXyG-g*ZU+-zmuKH9y(wJSv z9KNS9yXw>XNMm+&JlKsfv#aC5Zea08Wi{B1F|(`V!ERtdNYeznF-A`k@*M027Kt=X zup49au8=0!4J;gKnqW7^=wTsEup3xR(lo(tjM1w^nqW7uz@%w{-54`FKOXGHnAv%( zSvY^x&i6lbt?YlGTL=)GtE z1LbP}L)Xgw2g=p{hu(YkKTxjrKXk3^f1q6Lf9Snu{{!V}|3lZx{s+p{{)gUs_CHXr z_CIv3?0=wK?SJUKXa57`YX3vm%Kit+)&7Uxd-gw2uJ%84t?YlGTUVv|J<_OEzl*K*o<^>>fMy>i?-_?&aYSr&zJHMwO?`hPk-}T-9NTXK$F1G!98nxpt@>R*C4e+))$ihXfTvNbe%DV9AdOn}yEro7Y1FFU_0t4MqgMSc zjuChowd!~MgaOj1Rlkd)1)fH&`dvSDfHZ2=@8Ym>ExgnLG+>pygZb;=P zH{_mPZb;=PH{`OB8&dhn4Y{Y68&dhn4Y_ROhE#rXL+rEN zxZe5OZ{W(^J@}v9_ljpG-}v@Rc%b|zH8r(I4g1Ns%o2*>e{AeOQ`Qt)YRG25;b-D97Rpt5iPRrh*DE` zMB820a7c63HCRN0HtbMCokkoA0Sz9&CogIaAGW_o4{F5W<4V=xNIQF9o) z(7#sMVdKf+6I$8fW~Hv)$*!+aYU=Hsjhgy{N^ku^h-mcn))La zanjgbf6{WCRO;%%ZBkWlT&{O6*XzR^HT6wLJcWW=-_+;wYZQ+rF3gr=d{iEi{ zAtm!jqt$){av^jc0fMacNHd=lsX2lsTYxt8NV8?tw?Jwd4q6cn`ostVG(p2bE2^PZ zi)yGu7`hJ#Iz1+#Efj4Lf?m ziUd(4`zWXqt{!bx`ERVTx*CnjMx(CLscSr>Xs|Mk?nbA((ZstE;;ku9C~q3AA&uUUMr%kTz}J+fz{k-dq2jnTDag*p~ku}w0!}*V1`hih0Csa3$uCy;{tiJFza4%VOGstP}djKj4QKI^7r6*U}Bm32dwzo=#{ zdb66-a1B;?6Jv*!g}-iW_`z54*I&gCvJrpND{N15`il1iKiFdYb)9NX`>@)aRu}Mt zEpAS`cH*zA5`K`=_)8sYPT$bqMLLJ(r7NoRk~{q7wWiv6t?5Nxi-uo=6s;%Mu0)P2 zbQ{fU*COGX5+uFmwOO(rf8BEN!>hk0HeH(&6RyEyvhaE5&NUxin%AdY?)c$vUY~a6 zT)*ruT#ue!S5L3EoLM(!+~G8D%+RmkuNrZ~{dn^RdS-Rr2ua+4Em%UUshln7k|*ea z8)mZ=l4*II(`-o~E!YTOxGMg)t~#GvU=8)5buAL;ftszBcetg9r`ZyVTC?8KSy^mz zcG`P9D>=+wa_wx+N`d6unzQblo3mHNyIIL)RtnynbwARaZAo&oEf>@*;xsmMR$QEI zMHwEsHD`TP$KS}g;QXFlZ~@IKcxuir(w3WZGwzg{bCN2Se0u*nm^C#&AT$~?hG z-x&nOOu!H3n3;Ah#9#JgX4(T3{H5yPuMZ^nL6w;?_h3ch2Tc}#T~+WyMfxB-gSg2W zF*AK5-nc>aoSBvc@FNnunKRQa0sN(S@z-?-KUA3lz?tbq%4%i~D$nLfyfbrBk(oJH zk(qflYhKNnSLi-7?+l+=m|;5+hf_~4MVIk|Vh8w~J9GR{4!7k?)AG>xL9yenvll-w)!W~)XxZMx59%%cy58c4-tZo_ zuA*|!=?)nQ?%VN$U2RZHBUGUGwO@b?rJ; z9e>^3;s=@0x)wdU=BnPh?hzmUdL8C}t*!`$@k0*~OtN{`JvwV$m&{t%)!yqayVec7 z!JIc-R;?Qv^;;IxTH!b3m+-^cc4L;FqIF|7UiB~l3C{2vf)>01U1JIEm0B%@=J?^F zYe_F!EqC_#>z)}uydy0iNLqj^WKkBVT9I89Heq9wU?1VBwUhg&sa*e@TGrxz8oH>Ve`__zZ& zO!5`Dm{EFj+M`({!MIrh!mY>!O;!?g*-CFtLzg4Tn}sAFyqeP<#5Ob7O)$sbYexLi zY|c3U@Izxqv#Fq<+0eN?VIuV9Z6C8Obp#f zavtFa)xz51d~eP`-YNhyefBvPP|(ic-z7~vkmNHD>w}nlN#hlg6hAdD$+aR$v2OEn zlE7t&wRst#k5_%!XD>}8iSL&ct2HktnOt_uMW$Ib^m2^o&C5Q)!!s>C*)I=Znpb3H z07X@ViyzWI{E{$j;l>+tCCa*j(NswaaGO^V6?xKCX(^Ia!d3K3&w@2q5s;CkR~3*o zuSVpEU$opNen>dinxP;XBcLA$hrP^eSm0n$*OF#k3(dNol;C;@`g(-P&Fj(7WSY&^ zv>4b*-7)iH@vS83R_KbY8~8IVYcvs4OHM7VrdX2t+QM+z=7Ohlp(}GYf)R6y!JBifsAtZ-K1xWUp7TM;lH`5xORbsLFw<<#N7eJe zB%4@!3vI!1Oa-0=0#=HjK8k>D2vWX+;j@IwPT zetEEo#;DEsh0y!+vs264xA~tR{>fQ@BBv$(Dxh1-H=x?KLq6-jAKC9Y|GjFz=l%DZ z{a*0j9s9lLzt`>ePyF{|`~6e@{ltFX^50$i{onZSe`&w}%zuAjzi<2R4g39x|K7CU zcl`I3{l4qJd-nUD|K7IW|E>T2EBk%lfA{V8lK&pq?+5;S$9{k6zjy8TXa4)C{r;K% z{?dN`x&Qvke*cC4erCV_h5!D!{od2g3!vPL(yj}j+>FwW3!vPL(r(Kh&jIY|6ab*y z?3qpg>~a5pPrLtn-230t&Oe~sET?w;_qgZ3ryc)2?)UF$w||d&{d?N!-{U_2o_6{7 zxW~Vz9sWJ;@9$}Me~)|nd)nFG0|-G+l>16>MivQU~S%aY8JrSoT4rPtj#HE55U@-qP_sE%_(XKz}lRmPW+vAV` zz}t+H;Q+kND47bt+l-RH0N!Sl1P1Unqa-kZw;3gY0ldv92@K$EMoC}*Z!<~)19+QJ z5*WbSjFP|r-e!~p2JkkcBrt%t86|-Myv-;H4B%}>NnikPGfDyjc$-lY7{J?%lE47o zW|Ra5@HV3)Fo3riC4m9F%_vFi|E9zM*5=%$!~oXj6eR}CLsEPH7vGco0Oe+-NPd8F zGfMIUlp82O8SyZsU8vaMum|Ggv)KqPx6Ndx4_C><{X z0FqIXJFw%7lBB;SuK`-*_0cH;w8$xP7szp>fFx({N$!8|^-1nPlCx)$JMfK+`k(Zk z*RG=&fH$&dk~>i5jFQ}eZe)}WQUG(#C>@yqx{*=Rg5T3RfIsIgqq_$FoKtkrz&0ZF zd*_*S0_b#B%I}nuZWoAi%n1ZKJWHr_PD!>vptEOkt)e7bAkf(}$yStxs(;|YkAIMC zfk$UKB~9Sb86{}~kIpC!Il!YcO7a69olzQO{^5ThrC|klboNY^3IsZ%Brzb+86}AU zfzBvN35P)40-eq%*(T8GjFR64I-OCnMxfIfC2Isaol&ws zpwk&8zYBCaqhyUhr!z{@1Uj8jVShX%18h2PHKhq`I;SX2VADB8X#$(hDM}OAbWTy4 zz@~GG(gZf0Q71h91vZ^ilqT-5A$9PLS15N1=sIht+$rEFjgpWKaN!L|Al30r zAlDhC@eoLvMoCJ*Gc!t~BQVR1lFWc{XOv_Hj60(wGho~qC7A)^&M3(Y7eD((hpui+^id+LGnNtivfl1~Rc?e`IQs1!; zK*n;4Edw%^Q}hi$FZ1`x6ML+xp`39hwSzDxAKr=H+p5hO*E1;M8d-Q!kFLR1L z`h)cD4-8dtiJd>Al>w>BDUOanFLR1E2efCWC|sbIIYkQudYMxkIe}j06z%a3(%0`O zTcDTm*>|)~;FUQ=>->YX_d7;KfA|l2Mq33cnCGM)240y{)B@m@ImPh;cx6seCxBPx z6vqqTl{rNX0h*Xow8!tnm+xqgKoj$4v`3(cIYoN}nwV3xN1%y0MehnUF{fycKofI{ z<^eP@r)ZBr6LX682sAOLXpcY>bBdY;G%=^BOW(v8 zWt1!j=u}2&9DPO3zmy#Toywlcj(|>Ol7FUoxTqS{ga{k{0(;7Wa}I1X`Luqs6_H#l57(y_Chhq{Y3I#l57(0WHnn zqs0L&%_+(VXlYK-;((Us6fF*DX--i_KudFqG6GtfQ!XRv;7eK@(9--FE$*c>@)a%a zr7Z3hE$*fC^A-K>OWEHm+TTlQ>nqydOWEHm+TTm*?kn2gOWEHm+TTlQ@+;ckOWEHm z+TTm*^()%nOWEHm+TTlQ`73(Gm;bZ(;T65&OX>V8dPSh6v45}Vy&uc!sD zGBBS@LFjZ(s7;r~LLM zzkSMYU-H|h{PrckeadfN^4q8U_9ef4%5Put+o$~YCBJ>j4`^bP`#$BjFZu0Len1oR zXO!Q*-)OMd&5-@fFxPx%2&%*&+wfF|Y?pouv}`vaPoQ?x&zi8)0L z0h*XolpoN>cQ0MoD{sE@qUhALwF6 zNtb{wW|VvZ(8Y|BW&vHyD0v2;iy0+71G<<|@)JN8GfG+qbTOmkHGnQ=lyng2Vn!*_ z0lJt`(nz3-8Kp=E=we1mKY=c0lp-CViy0+t1-h6~igbW3W|VXn=whJk9z?S605>C& zR=9D1n-NJ%Ee~)rB58#j2e=uLv=sFKHzSf(*l~cH5lKsR4{$RgX@wpKxEYbOl=%QR zBa&A5ae$i4l2#aUfSVCX%LEQ^Ga_k)A_uq`k+huJ z0d7VlEh9O=&4{FBCU!F-X&K7F|4P4L_aKUYjGFBpMA7sVb`PRxM$UE*qG>fnX^bmFrqG(#T-77`fZkn?C z|2yg5A#R!?E&a2brbtWw4sp{IY3ZNcG(}qacZi#&NK60hrYX|WzeC(KMOyl2H%*b2 z{vG0`DbmtEyJ?EF^zRTiO_7%V*-cZVrGJOGX^OP;&u*F`E&V&hO;e<$e|FOpY3bh~ zZki%3{j-~E9u4nj$UzJH$;>q@{m{xM_;C^zRTiO_7%V*-cZVrGJOG zX^OP;?+`alk(T});-)Fm(!WF8G(}qacZi#&NK60hrYX|WzeC(KW%S=j|LmqI($c>} z+%!d6`e!#yk(T});-)Fm(m%UtinR3a5I0ScmOHnbrbtU44{_5JX}R=6+%!d6PW=!! zO_7#cKg3N_q~+KTanlrOx%NZcG(}qaeTbW;NXxw+;-)Fma`1<^X^OO5yxlZKT2B5D zH%*b2o41>$NXyY5;-)Fma`kr86lpp8L)eBa)-?AJH%*aN$YVE6k=9iA5I0Sc4*SPVQ>4TG zanls(uz%b%MLO&sH%*Za`^QaFq{IGk(-i5jf7~=hI_w`eO_2`!$4yhD!~Sv86zQ;k z+%!cx>>oExkq-OEO;e=9{&CY3>9Bv?G(|e>A2&^rmi-(2A!*tFo4-;0vi~=Kqxxn4 zZ~jL0%l_X0{*dp>{@?tK*N=O z1|LdV`epE;q@`bP03S+P`epE;q@`a5A4*#KW$>Y-rC$agN?Q75@S&uoUj`paTKZ-1 zp`@i>1|LdV`epE;q@`a5A4*#KW$>Y-rC)CVA4*#KW$>Y-rC$agN?Q75@S&tbzW^Uf zI`j+hp`=5<03S*^^b7Ezq(i>|A4)p(3-F<&HNF^pC~1u^1|LdV-BMZ5g~6jQX@3qUbNyL|u@Q?%OyKruzT z{sRoY(xMZ5k26jQY8D?l+tyM6)`Q?%k~jRMZ5k06jQY83qUbNyM6!^Q?%;?KruzTe*-9{Xx9gTVv2V8;~opA z{rZYG0L2vT@&_oUXqP`gF-5!l0g5Tw5xAz&mbN0$3+>WL;koFgLKFr7hsSM`Qx$+ z(jk9bY(YBYk4r2_hx~D21?iAKE~hXWpqS1Nz+{pR`2!}CbjTktnWRJhfXO5s@&`;N z>5xBQGD(O00h38OLz{C{o;sYk8Xcr$aF-5!hfQc#E#Rp7G(Jnq< zVv2V00TWZSiw~HXqFsEz#1!q~116@^K*==r025QRiw~HXqFsEz#1!q~116?u7auS& zMZ5Tbi7DE}2TV-SE zz{C{o@&_iSXqP`QF-5!lfr%;Fn4(=jfQc#Er@z3&6z%!~Oia-}{RJkbXxATLVv6?g7?_x%T_1pnDcZwh zU}B1P{QxGWXb+Epi7DFk1=qNW_V5$exQcdp|1RX^_sPEbU4(yrpX{68h5YRURi1~RxW-kq>j$n;746~Q?;`y2`&{4P8dW{_@DG@nqFw&L#1!q}A22aR zyFLIDQ?!SFz{C{o`ti3RU!Y`~eB(abH@H}rbjTMM>yi%n;$mIWAzxgqOFHC>i*-qd zynvEPI^+YCOwu6_pk$Jc=>bqONr!xZl1Vz`1C&hCAs?V*k`DO*C6jc>2Pm1OLq0&s zBpvbrN+#)$4^T3V249sCE1B05e5XHU^j}nzAs!OwnF905e5X76zCpnzAs!Owr`60cMIOZw)Y0G0eP- z3@}qPb;STPMbnlIFjMre{C&yJAT(K?WM>eXq$N9p&?K#~;NVxZWdqDqd0gr-z)aDM zjSg^OuV^my7+|Jo#!3d5DVj??2ACV=}QbSQ#6-)3@}qPW3z*=qyJyKz5+1Q zpMUN83cyU!uCD;h6z%#7z)aDuuK>&x?fUw4^#5zuR{&<}x$EoK(SJZ_n*0Emspqb* z0L&Ea`U=2I(XOum%oOeV3cyU!uCD;h6z%#7z)aDuuK>(+`WudQ2ACNw4MLN&VsnGgB(0^$gKs$28DOT$<5q_OW{P&_1Heqt-0CpE zOwpW67+|JoZgm)7rfAMB4gi=b+Wiv%GevW*aqxBct8d&szYc%(joatf;jaLp$@Yi8 z0)!^%@K=D)Bpv<=5SpaJUwz~D`E~d!Kxp!L_$xqYk`8|b2u;%AuK=M*I{XzNG)afQ z0)!^%@K=D)Bpv<=5Sm7RlltrS_l^4ZEvF_2->7?U{-dkUH|pNEB2(+#ngF0FZgQd2 z05nB&Vf5e|wdPxA<~M50w{BbC$ajA0tp7&So^PGg-^9rBja%9`TI4(c94C7s&-R~O zk-w2+`_}as7i4=&{9bH><`nIE3usQ!uBU+J6zzHmXim|thk)i3?Rxh-?9T6}K6oB> z=66vWG^g@=*JDZFz&fqzy->pUDnS-n$KOD&ozfVccGLjEt@ zue=EP;|6k*cU(JufZN7Nhx}i-{9lCpU$|d*5q|N7`+>M7`~bIu^Zk%NZUQGA@_*su zZd~)_l&66u;(dcg6it2_G@@wo z)1VPWlb;5SD4P5MilM*1~j5*=Qp4cMLWL%jVRjr4QNEs&Tl{?igtbj z8d0?K8_)_w7oqxX${{7nd2WUjk53oe* z|F468zjpos8d1-ke}G05?fm<-{L$gB>5mK=QO{kUe=YxGV2LbW{>Q))Nz4BjSR!fp z9|KDyE&pR+iKOL!3@p)TKqGp6081nt^81a;?>8a8-?;n$ji~%Czu$!Xe&g~3G@_on z`~Zz8+U56~kl$}yet<^QbC(~W5kXhhL2Z$Kl8c6kFDQMAh&(1@a4-hf6F?eYdRqG*>lpbE{(TtN1f1`QQoB!zY1yrJ*yZiu^=rq6+O@4q%6z%c@RHA5?AD|LNyZiu^D4KEU z;cpd}f9u@^a-tr)cz~QJ+QkE;MA0q|ASH@+aR4b%w2K2siK1N`KuQ$t;s8>jXcq^N z5=FZ>fRrd&?F(@LJCWTFaR57!w8Zf(XI+QC)oAi9gV4j@N;u!DvWNmX)Exd+qWYFG z=aF zjDg`uI@ACdjz$Bq(fI-lN76~`4EGQJou+%g=j`b4-$@JJ{BN9X7{H@m=j_G+9z}CD zV*rn$8Pgh|8EJz!Lv;pdCYt3NpqXek#{kVlbM|F`W}>N;252Ulvo8ZQ6HV?KpqXg4 z&j8It)9d_Wtb`lH8QUW{8^jrD3ECjeNK4WNaYkCAHi$FQiueuUjI?BL5ND(%{D1V7 zV*@l(dpIXBKr_)4zX6(wrZ^1HOfC?8^YnMANJc&`dOEU;h{@@dk0m_DEd} z;tVtpq2w0ui!&hn)q(+j(KPT^I)h)-aQxMx0e;bY;ji=vzi1TrD^0>LdNll%GT|3v zGW?Y~;TOFe{%V-OFRowUuT%`bzEPVsbRdOm82BsagkLX|N5ctHxQ>Cpa#;99)52d3 zG5AGo#a}HZ;1|sef92Qki|ZNqs|5x8q6y-!d>ww#H{-7s74VB@iN6}2@QeN$f3>iH zUo=(xm5;MT-nbp`9T`{uL>- zG^A*u0V%XKq{!zYh1P}?EjA#9_J$PsVWiOFkRp>u3T+N4GJ2%Y>X0I{M+)r@DKdPd z(DINX(?<$z4=FN!q|o}1BJ)QI?GFfEGC&|w(E^Yn6GRGa04Xv;q{s^Xt;`T99Da~T zhKLjn0Z5T4B89FSDKbW+(A6VF=7FADy<=6I4iqV}_g^J@2gaFmEZO_7WbeO9_Wmo`do0%g zl}UDrbsLrJGkBm+CBKTvJWGC_{Ho9Dktg|8Oz=HV@~b}6N1o(YG3oa_$*=nCA9<2r z#X^ARNq*H=1du2BRV)s8p5#}3l>m8?U&Vrf=ShCmR}PRT`Bf|;c%I}}eKi4j5}&cK z;CT|CeT4ye5}&cy;CT|CeboVZl3#tn5fdrNulh;^Qj%ZAqJ)=|{Hm``AW!nESg7zk z$*=l~1@a`nip2}hll-c$VjxfQt1sj?u$~oim*0q`E$D{)2G+PDkNid~cOj4b2G+eI zkNid~fgz9l2G+tNkNid~iy@Ev#`EM?fpO-&NPhK&{KoU-SAlWnc@$Wo9Qlps3ayYL zzY$AnNRi)ouJ8&e@*A`>$=xKOnk>XZqcxI8}qo?7SMT%SH zzX6_Er1aDL;h9B>TczQdMT(D}hG!NjZk2{-7AZb@8lG9CxK$dS zS)};rX?SLl;#O&RW|6{)9XJ-Fr(v8q4`cNFH~%A}SmcS((=g6FPmG?1apoy8dK$)= zr^M)K7-yamqo-kU8F?t%tnWx0)X&7go5~HVKoOw!&o`!MeDKUB)#+j$Y z=xG>dmST8j&JDvj^OW%FhH>U8;nfY}%u~Xv8^)QZgjY9=GfxSxZWw2t5?V|RVDdE)(U8;nfY}%u~Xv8^)QZgjY9=GfxSxZWw2t5?V|RV zDdE)(U8;nfY}%u)=` z%=O1G&O9ab$1u)3CG^KI&O9ab$1u)3CG^KI&O9ab$1u)3CG^KI&O9ab$1u)3CG^KI z&O9ab$1u)3CG^KI&O9ab$1u)3CG^KI&O9ab$1u)3CG^KI&O9ab$1u)3CG^KI&O9ab z$1u)3CG^KI&O9ab$1u)3CG^KI&O9ab$1u)3CG^KI&O9ab$1u)3CG^KI&O9ab$1u)3 zCG^KI&O9ab$1u)3CG^KI&O9ab$1u)3CG^KI&O9ab$1u)3CC0Dc{s$kM49`p&1&p&Y zvYDZq;onw!voqLkuXY+s&oxZth_lh%+}`MHLeS~anZLFdw)@?u z?VV0zLd7;dYCQZL!mm7P?{47DnrHpaU+s4LowfRB)TR7cR^e8!zX@^wywk5OxV^E_ z`?9n4S$ku*b5w>0&$jEIZ?u2@ENfL(^D4@QdXygK{oUxTe!(8Cw>JhIFe8{W*lF){ zR~r*MsI#@vZ4bQWGn0>cy^T(L%k9qyv(fI>PUmr_?};ERZLPQaXrtpv>l?kcC5qkT z`Emc*#_MRo`tH`MDNM_bo^%K2KlYxT zZT$6_ohSX?myNB?myL?qPED%728$UqR@+-!y`9FRj#buJ@Aozv?FO0a6*hYPMj^`! zlR#AbCAtw6vy?`63%uJ}?ex|g%X1sO!EV1}t(fR{);B~$9M+uW`$+1rcZ=%flzQ~x znThRozrAVdkiU8Ui%~)HM)cD0O z8u45mX_m?_WtU2m{~_|cxQCw`>nIX1Gd0lsNvaY#cKW-f_GcQqTjZc;?EBDA9U1HUx*GdhvS6nMcFtXH?v)23NcE8_#w(>>i*-GcD?qFw-X?nR~IopRCn{^y* zEc#xST$ZcIQfgDdo@&<%+Z}DCgDLig?v^#1nXdQxo%ZSzSZQcdqdjOynQTax{+q#g zkB=~W>ec9`ovF6%NqbQ7Al4)ma6Ip$#j^U~LA4e%_`XJp5T9As!0I}wf6~yFIi}6_ zTBnglqH$eRV!O-aY;c?n%Op@X=6Yq2T%rxb#sr-kEtD#^x(LI3SPf=nGAX&9p$bcK zsFn*47X^!nQ(3{u&R}6-Sl)_Kp(f&L!QFvEu9LUdeDZsz)U#?c(7$r%H==vq)3xsU zy1A8VZ!v;;_mgf9^?#THZjq)O!Gd?F-)M-HJoe!GE;ai|#jQ~UIFp*BD-3bbd{q(J zjhrk@4G_|9?W|8tK6uh;D2{vogTecawH{(xi}yIzUTBE#$}?!R`<8FfCGC5~IYee44=NX06Cra~= z)5u!|zg-ypU!cfKjLn6<+#Re?ai%KFZ~UlHPHEh1JS?Yh4t0ufHPemK&#I!d*Vev& zMM0$}aQgoxsS5itQXd$QmDC6>V^|?Dat-sO^jgxseCAM}!<#9CutZTXBx3L2nRIu`e^@C&U&s31WT~{URSmv}=8Z|l>B-P^J$vG7<>?)8y;NIi87;k5 z#K}ecoF3NdTlMK@Twu?uJz~aJ72+yZz5ASG+eoXiZLCFRP2{pg9F}#0c&C`8b8hT= z6Gb9d*DNkTXsFcSel@kUOA(zYb`O-2vASG9&gR-D&SE_}Vi~9ufetS*Xh}0x5Z!Qm zYveQo^{@nD&2;Q_hBJ+c)eUSPqHF$_tm5c3VXG@hci&SiwW!t5LcVeSkX9zAKcow!kRW%lIk(evpF7h*zvrjb^CTDHA7DE1fWE!@3~yEhcPh}G@Nkn23*e(6b8q^FsW; zH8$H{U>g~7Zgh7{7x0`4(0HGL^846jHZO*~oc5aS(06yTWyV-J^d052Z5y5=xh9T3 zCXiC_U3OC@v)H08Wz*S!R9Ho9K4{JlpX8_$oyL$S?WY}VnXf)uwXOTL&UOc9IJQ=w zS=Wvl3|vdqAh`MPt-gOM6Rfs3d6J#}GxV_-6TGw%7wAr8c=RNRvr6=c4o;d6SpP2@ zSl&m(V}+OE(`rM!wG9N5zSCRcavn03S#4Ey?Zk-t!-=k+3F1TrsXUuf?Nn`P?A#6( zA=oqff!DnegU-hK&71itj)x?0K;TDE$q^4R4ltJnsMJsi0%xYW>(AIuunpA(+weE< z1QqHL6#NTwH?c(%5o!$1vXBL^G(W(Hw-fZtMF*^`pxwC~F>tl*9>|}oi&(Lm>uv3{am<76-ikpf8g|`DuXi_a zI%6t=@!Hm$JCjbfOigrmI-AB3dF{!EpX1yNj%y5d9}RZ;vhF%@*^47($%iIO`*E&u zeujz)sUX&rXtRY!SA5%}9NAB6V&OJNoMEeT4<13-_$P1q!N7cC=c{cTf5FJO)3ZZ2 z7!OUGnE71e(e4fgP*26qO()KD*|?fz%)BPVU)CrkWJ=>HB^8jf`Cj|=$LYh74v5xN z%$#YP6N6okRX%Fy{MQ6G%i1`&B~$a)px{Tjqe|KIM^bt|GQF`;Din)}qYg?9WegWU zmr=CXy=HPR@V%?B%kGw)=aH{*XHH8hReelJBbeYPit>J?irx!OvSb|g7_=XoSBSkw zVAEGNABSu~-UjM?CW4yqA2sgq3{1H+iL94fnpRFkn=a&y;(@qrGr*^Q_K;hiA0YBX zBYYIi>c&}#5w%!r!1CiwD4N0i_3E0fJ(P#bf1WW+w!I5|5L4^=2zkb7G3Ba;8F=4y z-s7E6?tBM%IEpz<45RvoCc@SMDhk>f^9#`?OaBKI;VIiRx*ZWMaI|dvpd2)4;#E5` zRR=~z9~jxp@S;twxn6G?qmPbMk|p~f+a1tF;Xhr*3FVjb%3LDyH}92uf+m#`5PI=w zs@s$W4tLk(+|Kc!ob@uO72ODxGMvFA@3%@JcIL)y?ejZ4%cV|y0ZXET!#j5tQ=PR<-kkK9QHn;I3| zF^?UsXM@@HFk}3!Un5y49ZZeY*na}cBN_Q{<6FxZa|H91>OrPrB<^ zHg#qG&=>PEKkVt|h*Mx4T}0$)?MNeK?OVwF$Og9fjHPZ2Kpph-k+t5-Bi9jwVw(9^ zC+$(_*|QhaaBFbk>ZYvOy+{8N^UmM`Rzj9>oOXp@Nu0+-=d9L;R$_9P`+77SJmU`A1SR>$P~lNVh27x1%GzQudH{ngau{H=Ia zykX<7&#YW$iuh~N9u*lm-i*k}XGK;EeMaQ8N1jo=p7Ji@C_C$CPsSBW`ZR&B@??HR zQGG)Ri|v(f68wdS6L`Y!OY(s3vs~V6kD8j4^<2Z2s8lI)gzD&Xs}wXJ6M#aSf(^^@ zPWoh|J6McwreLyAcSzjynBN3V6i*B7z^5nPs(en)cY>|a&Zw*bgGrwu6<-i#Uo@qs z4gV_1zE?_P0=`~)(pyU{=GQ)!0SrRH=0GO%Alvps?Mpw*KT=kH3B{VHkQK)!ndSV) zTlm%jYhLNQBgTIozYo7}HQDRN0AtblkGq4}U98@9w=6kvIh7`^SK4o{deiN2$0VEM z#i2Krgkk+=qtIA;W}N-ynLqu}_LJ>QZLRfVezv+i-+8qA7=zA9KVH4l!vf}d_wjBY zpZNW;zR(=6QNG8Je~C+8xU?$|Z*A@LdjnfA?De7lp^+0{F_=&dLRMC=8Uz=y3qM~e zD9&=HYE3OQLqK8BlK5`#=FLalt+lD7^tJ%f+wSytp23Vg?7|N%t(dy_c&f6x_O(&z z0|CoYM2~NOWZk@pH$#hv~mmzHdhEj2DN zdN`#NfmLM)VMJIQ-7Fm6vMrCSK+XCqCLdqT+yKxwY1`^)}AY%xP~oZA_2ZVB4%3)mVF0Y#M*r!KUFm zXsykZ+wcCm-LxP-i*219?E4NH%Pl((;ge+hxX31VwzU8) zd#kF8ix^TPbQQpe!!fBv+Olf(AMe@)0qOM2AE8A)hE-MwQbU$+_a1jwQ~mj!1t}2& zo-_8{x2}-c_fcCuoO4Jl-wg3jfGOieD-5`*w}<3mNuiF?$5F#+(dGNL;IY|BV)(u_ z0XFR785xbFwtkPsqc*8V`IUl4;b6Yc79~d29%o8STE4rxb9a3fu5PWkALjcOs!Mbf zcZ#--%waQDU7?b=etLJb@D#pwzKeOy&gzp+|CotOH8<%|H|*4AE~-jx9`*jxPH+25 zYu0l5H7e_8?f(4kCZhl4x%L2_8IuIeNtbqZAGz5((|^`)Z*Ou2J??-qsf0|rMvaC_k|WnO;Tn)4HFb?F>9IXVY2m!a%FCwH}eyLx!K#h zI(e2SgZ1Qmtl=d$q1%Qyu}AS$mx2COTx5Q6h58viX9KGxV1_eCKUwo)IMAAk%`cR# zx#s=hOtnowC+^Xw))e7-H0rfmTkE~4iH;43cVN8c;gYzr`_n-t++5bb=KyLu9U%5TZ=3y6tl6#n*2XJGs!0M@~)z_xYR3#3O*^6EVSOo5nGL| zq+s>4nmcpLDSweh4{%!}<~}2nlg>d~bU)eR1BE}IVw2NEuf^Lb+(F0ruN#y6#)CfA zP;7amQek=}#qFaqz?tx0)nnRNN{<=#g*oxTk)6)|h z#qK59Nt(EhLN$GmD(FlII1?fL&1O`U))X&J*%^+=KZ*^0Ea+%X zL~v939Hz?bhs9{>cRdyx@jmz*^@1NM#3x2LfPKL7Dp+&x+}nLKHo z1wB$R6#R{BPf^5JDuPib^aB&c#1Akt4108iBi~z`ygO16!mDKpryyNnd!~MM6R$KvX0xx9X7Ady zy-V90cX@&gqkSJAdSoFgCpq*aRCt!cUwW6eSk2FQx_dhfQuYxRUmGLX^;hh60UQS@ ze|*J_Y_A?)9JM#>TT^_H>=E;Y1~$UOE(Q&Ly7{Qn!S~6G6}j`xcR5jYj>|V-c8Lhw zu0YTDj2!wf!MlP?^NO0YTrm|WavwPXNe#gKV}NJ}=T&UtQK~3p-oe^V{I0Jt|DtoO zX$Nd0`+y>P-y5XW>=E^hdaagg*-*gljpG0lXF7y4*HPSvXw zx^5RLgm#!3+wZKm7%yYmnBL*Q$`uZX=!`1zuco4;B1_*^`}`70jzxc*$4uKBFgWXG;^vT1W*#9-u4}6~ldUbx%!CZU{dXRx z*=qRVT~y5z&33Q^=Ts=b!tBh-9!{p$wcuj0f`y;>IDBWfzZK!AIGXp5U**-cISIv@ zeYBLlO;IYlSxy?b49ki2QIxeCEyq_+($yh7D+$PyESWfCxKNZqx!oz5Azx6I$2$Ms za(654Q;cVDH01^l&T$EVgE?PH>YcBR|EwGrk{eN^e0U{GvBvJ_l~J)PU7CU@g+eVj zGp1pXpSx|p7ACP3TEkk*E#h*CVVjsV9ZDf)dXIWlozviOFTQlh<_5+%&J(T2SW^pY zvOe&(%tUD+@&uR-F6}uWbiFRnF(7g0cn_bKG<+Z`4S$ zU@^E9%z9@g#ea2WjB@HVg~Z%BZ$OP_M~zj(D>_Q^xgDOW+_YFeuXUvzDs15(y* z<~z~BlQ>MkVU)haF1U6|1$IW~68j^_I<&T4ugju8E=sWOikJito$B)=FYRJvmUP*=aWgD|2W(IiqVgAj&Z^jpCRD<>rQvQ3l(A08t?x#|NioQ zyM-Ydg4Fo=OTYhGeS(TvP+YzaHnV}Xj@v-I&HP93i}y`PXF1rqup`1!lW)sWmYT&_ z3nQB*EIhtj=@KU~dCS?7jGdYb!S3RKg>NJn*H6mV`bMgT2F9GIg7;V0l@=VI690!A zn;CPydok=g>SKVoKCc~L08c!MHMwcu9A4erhLU0@8$WP6LujiFzK;^Yh)Lu41Tu0k zHU`-)c-L;Q!;9e<5qCJuK|Dh_*)tQdifX2E5WbBpC_Nfk&iSICazlJYul!z7J#IjO z7p8TUnvcs-tnXQyi+5C2-hsE>7Ks~@Zf)5oX_($3YOCLxm`}GUrMx&`>jznvmpc8Y z-Blcu;MHQ0JZhJut|)^?!^eg=)}$ZzaJnh26`rglUXRo1+m|$JhOah$hthOxdDPjo zlavO0C7hNA7SpJg7R&U7ib!+O68Md7%xqwH<)^aCvVoS|wY?q&iY!D0#0)I{z`& zYl{=!aeiP(BtAq`-XqG~=vRu7gAH~NKOQ8vuBBF;{}`WKt&P(Lu%QTzEANA8k2`Bp zpj&HL=2TdsI0VnNn&4Yd2)8k8P=PB87oNsk{K*(61{btkn`3-d9(6F+8cN0VDsJuy zq%`H>9}K=$e(^ciC?{Gh6Niy-sd#gDuw&mwK@I&wD311KeHVBWT=O6|A=peQBY@d!B6SML6P!qt*FTREA`=AU?9lf@K%A;oqb zB&f;=KV^^7Fo%oe*3RNi-DfgVCyN7*{XDgRuw1uq z5PVKy2i2hhrX1!x)kxc0TH1ZY@B|kTk>{YRM_uAT=i7Uh^i=_tnBto;^CroW9NPqI zy>rgkpU(208L2tA`?632ir08yhMjb+P($i)!2vAF)noz(3r(!cfQyb}S&wcX%b~7d z_TypG*0WA-(0Uh30^>UpTZkQ?xs>-&*3QDGKYwRtUdy+fEpfnxYuhj>s^DnzA9e68 zkDf=Vjs?&TB%5Np2zBED&N>q6wonxCtQyf}J~~^hg;9mDGZza9=jVPRhi{`~Yk}F@ z(2J}9U-?lJ)VwsR!I>l-U1PVgrG;*CyTb-bQ!pJBF1myzrbx5#hfo7b)|Jb$Oyi{qq;4XL)n-2yK}vI=6M&tv*j zc-lKd88s!e)ZHn&87F3jY7himer%CMxti2wzgdTkEoLzz*Mf>^OjO`OkSz)q;g7Wl z`j_>f+5t@0qX2dQu9%^}t&&%XKBOsLbpkb;+<6q%3*c7*GeNT%EG!R=MhB zE!jnV-ju4`GM1II6ouB8smt}$Laq~gH-{Kx>Rj5QON?-BCOZo4tFJDuRjlR6P?e(_ z4>b#Km4BSXb8EbgAw8{?+S~fti$DC~nIAviYpnlPt4Rfv9SXU*n?>UcZW`J(k}&y z)->@x8$L@X=}e=PWvv%IE_MNJF4r+W>3bUfcB2bRVp3>HRpUlfi*_-R$~(wy#Z;HI z%lh8g+{Ol_T9{a#MYcYbP-AqMp0m!dA8Kl zVm;1SSS;S9`l6??$~LMRPT?0KxnLo`V76nbSwentr1Xt(o(IaGkva-HQc$@_DKr?g&ca~9H43V%xu#^k zf%y=!J`IUZJoT;5$Yg!X`iy)5C+OLt_<3kGwkjXl9lwmw97UD2E@NmmhgYAk9g ztp$&_(gEcy{5U3#T1aL#P-KBdb z%-fd>HaCCTvhgkyL8GHrhs8Wz0h%b=wli*rMigxFEaXLq>*NiIH%m=PiE2znM{{B* z8R@N()W%%v`Xgw7LJ{W^Ej$~n#b8NqT&^DBi7VQZcxH>^wAqlL>~!p+hIKB}5IZ!R zx}u8AJrw_n(;R6Tc#Mg`0vEY_s$i=F1%skve$8=Erg?Np9F~vz^eBDESUJ~S%u!;B z5`Q&SF@Gt)dGzv2%A33O%zgVC>(1o1j5@YIQOlj?G7!QZt z`{}(;x4Jvai+xPTY+Yda6X0$7M|RoIQRlJh&$H<~P1Y>N!VRbytSBq04Q`fQsFxfI-+ORkMNCX;| zworXlWFBds$A1~j-sn{o-)o07|J?zri-EjPy zI>y1!SMEQuJI8S_3J3bq6-j(Te`0=XWo7PmYiVg^MTc8$tJeznF;1`8RTC?ne!tf* z7L5&)3qW*UJUR`$%6l8ka6yA~@@pUEHb!pgMQ^Yv5Aj@`Y)~ z@Tlqv0lsw26^`QDt<_z?A^C(demHCBx_ZQ|`4;JQ2PErFw zRVT6-NT)-x{Tn!5JCHI&DN6&FMod4>B75-|xIGYKR z3js&i#wU00>sZD6=Nj+(QJ(id$FV!#)d_HxO1KW=&W8~C%ZEt}@XVP|j@a={W8o3u zMH(V9d$)_CZ}-}3nHE5e$g|SATjq=M<}w5xH8xhd#?i5BD=StQ?gQ{MD7Wl1m~+bm zYAk1)^GS~{OyYma;r^z!Wo0%JZJ|6ca-k$XAB+Cfyp@`Rfwi(qf5cnhn)#D4mOjQS zmBw5xF zj=s>hG)ClyMS#r^O)k~SKAlXtD~n6fklNyl6?U(vh6yKFM;~Uw5r#(NlF4vbNsH9* zKYo@-tV;%8&FuoO%vS3C0|YF-1RqB9YaBk@JNgs=BBgMdsp*~A$w2u>wB(qQLs4tQ zgkiFn$S%2~DtjysBha{iuES!XOzg_dn-F2@^SfGd35Qv6LK@|gi??W_jW`~=RMU2l zY5aAUlUBe1_4t*S)Cjnqf>GYaQ7bRwHzjiBjY(-T9RjyS%aCL#{z8A05LY{@jUxcT_OzUl;NGcbYR8ytZ9nAR!ML z&j574)j^<)5E#Gv>BGUn#X(y6D@D6?5pI~fd_t-&GiIA3#rH3XNp+44)@#FNZ8%ZU z*pmi2CeE_MaDJPn%inpl6LPnZ$31lF5?4X9Ld@A&TysoxRNjA#@@oPeZ-7^t%?q+n z&`y>|0YzAp_aQgdaMQ7Wln07_tf9P(X5)H{A4fzMCkxrqTFzVa2y8CL88yr^Ap~no z_xyivx2!R0sllSDwA{ea9hz&SmT+^SQt3m{CBLZ$&C~9eWwd|QaIF4DOcY!WwT6q% zEv;IpeYtA$bKN|iUl1`|5ZYMm*}Wa-*h8O`-`d>VC1gl-cAcHot2|0e2k3p`X&mn0 zf>X7h`O?a$!tx6Tvl&-WuBlK#1zW3CMUIkLvd+qB)*;cwn`2yZRI4GQEGX%H<_ORi zo?p%;&9m*bPtq4F=_Adl$xpX7du#Zb-0m&a_sm602MvBuWT)}4XyO?=Ik0J!J*7x( z>`kZdy_rY&x5Q3UlK+nymIA-=cWu7+mX4TWK=a}VQrUAAO2vWnb_`3IA-$XF$yn8n zITxv_cWL@s%rD34^oV!a>34r3t8+Y4K3Bi?2EVq3Gy zW7In@K+2kGt)J&3rarz6pHQ4N<%FCqz>*Br6TO}RH$Tl_=(ls zzHR0p3G$6y-7+I=nq<>Dd&egnC;~gAq`9c3LNvd!PaH85$;PwWC7`wP=8xL%9}U36 zB22;km((vzZQDE8^l9`k@5S`C^R%EM-;YKKnLn>X+5R4||i$h6}elF$)n;7c07B!F(o$l8eG6`*}-wv%fLD ziB^53h%PM?! zj066+pga&j#-B=$#QQRns;cf>6?PFeZFV}3F(zdCs?cDxt_n7R1Lah;pi<@4y73{d zun!!sr3n9zs;xWlF}d_=t_am?jN#relmA%#>1}7-IkFEM?YApCKqro@1j9t$p7DB7 zdFdz)+3@E+nAPA^J`}5{rL?+K(pATN#_qRiBro!D9j0GWSq8kK!|*m*R4jDp7RD$C zDp;%hNPh^s?e}nB$O`Wf^LqkVJ3S^Glbda6Fz}1T-t7R$9)eH#D2O{25QL=@4f!MN zg+K1vRY!SZm|P{f)b`3V+HC2w4whKqY-!x|s==A4P8L2!Fz2rp;=p1uE|_4nGvUvm zyW)6OdVcmRlBq61KrI5X7=T!HBC|RxdHdoP1Z!h#gfHHc<2aT}r3sZSUmh zcin}S#ug&F_=x7Ji1yv-eQ8IO!U3_vMWMr%LAPb4+Mx7ac|ei|95)hq5ph!-t}^lQ z2utTS?E840uD(VXVEY7>p-Jk@zR=KO4&svyzv5>l8>*sd$qJ+EDWN3N(HyCYs2D9W z*Hk{JA9WXOtrlYLI(uDO=X@G+#nqQPTZ7$xX9*m@Rg)~nFFT$ZEu2yX)~q8G*g0DF znWTg;x?ASJOY@hZO@WZ3PK}l){KZ2$?yM+QX@#YZP_>8mv&DMs2k{k^@7K+_!>hO_ zGKjI9|)SMiXY`Ev|aHm6e^|63!29J zM`@)os}hcNv8I*_e1dac%<-Z8@!joE+*=c!A-hfR!H-gHNUpB0xxV2+t~pXdyRBN! zZ?e1-$5z9k2y7cgU&VW+;DEt4?ir77F8hhcFtm5v2dR_b<`C!dr});JJaNv2kY zjkGSHz^GUf8335Wmm>>3WUJ{lhMq>llN+|nW2WjYJ*j9(Fm6537gZ2#uUZsXXuTiu zGNwF**QmZ#O!M)gy2aHbOwf)9C5N<)gA`{g!!vX-vb^W+=JAm8^3qpAr3a?5c1c^r zgsQu;;P{u z&JI-HU6PTFPT6jNP3Z>(gs%&C9DdF0Xc`XVz9P zU2aczZZtbHH!gK9J-XWA5jZ;xjf);3{X>>P&O(Qs?^hM>npokE}vhbX?r-Z9GH6H_or_JlpPEe1w%Hd??x8jtZtb zSJ$pRTEE=Ba=qDnwBEk5x_)_j^~&n%+Ew)GYJ2<&HXr#Hm^F3GTw0sCwzk^7K7I9S zXMN^I=jydfH!fYe(rI72^r*cyejQMwYtzFO%v_niHnX;NwKH@1+Vu4G8*81bSK1wP zs|ijur*E9Bf|;QTplwxUz-J}v-LGzUwjS?1836wDa;_Lltnf@y6n%8EynIj6z%TS< zW_g(zXD&g~Bl1iiljjq0J+fV`FKW)DA9+gE(K5CWFD@^qp)N9B&kM^k;s}vlB^=pG zb!OS_ZrknWgZrI9Z{sOG1oGZqx;&!PMFUlgTr*cj=7JSI!xuN3QT>e(Iq8Py(~YFZ zRX=ZFYfD5}mev;5yWpkJy66EawWiHgil=zsdY6~~oIngeg#)sWv@%UB zvMhBr3%NDDvmOAF;8#50ugG+*~Z^xL-DNCOoU3$gX zPEkQP$mU@Z`=;o`XXEs^2@$sv$c!&oyjwrqC7{)IfhY!u698q$;FB!jvp8KNn z*pi_$I-;tQ9~!>~yQI9+KeF74=Q>H*@#+!f*ZaHiD`B8_zBrb3L{+)39KQlOoFhst zJJ<2c#ffZl$|||ye2*_?d(giKaGHyF@gim&xMA*}p@fJ=LxatsN{c$?yH9znZT8u}==6KAeSLZPC!N(VdiU_PH4fP!uCm0tyF1&vJ3`K|5N&I{`&ftE z(i!TJ3WDI}{OaI5CJwM@oUvXvRlHcL=HgH-u=cu2-lo~On8DD(hN^nU4Ifp_=%zny zu3QFJpX_dZal*FPn-}@waiv?YPgA(PH%{4z0Y*i$_3~%at#kmzAP4+uX|`ZbmY1C~ zx965@VzC8%#5ZL&J+RZeSc@@4q|;Q30x{;*mp4{peA{DTeZ9Nd#U%39=JrNs6F)c^ zIcE+_ragrFdvwBj^DpxX|paqSw@j}--;rkN+M<&!?|!T{Ilj$UO(93K%-G&~tj=0gTi&=l;>)$e>S;tN9*r(^ z+-BKP#MPZq!|Pi#?dXEXZQdWDVWWyXu1Tj0B}{#e4JD|xCmiQbBbpOdQOA)7So^_h zr2Uy|59-zl(r(0#WxW_Vk14DO__<9TZ`Jg&ru-Dwm);$_MvIys1CI-<-`1x^%sOzs z`h->27jl|5oU-p(1EPfEYv(#Wc+bBNdSBo>j0gR8cW2zr^Sz5huOC}+*4XjY=wjuq zlh$%F!B#5M%crc<3hU$2)-esH+EZ1YN*Sva{jK&!eJ940E~^_^$nk9$+*-q0YEnNPzRxy@~zB}qK0>7?&%)}HDZ-Y6TdmT1!h zoN#(4TSKWJl{~yln7(?jgU>j**lllge~wd$b9OzkpHReCGCZl69f}V8oSQcv;i$k= zDg3o zRkNtZ(x;1yxBh&kb^G?+pJC5<(toY|`TWA{r$51w*HW%qcWx~))7|^Gesb$h>-LJJ zq+ItGmL9b3KUldnZ<%1K9djT>I6 z!@0)v)zHMw<~Fq1&N}K6l{op@-NGKWeS%lquM&@pzr(46FS_;_VOA9GCr8OqFurHo z==J?fPnOD^|BUWzJ#B4l^uBb~mml2a7p>-BySQ5;6-=E*#VG;bTn%`&P}cYf!!g-L zLXpk-vpe`1cKUgtn6$_KRL@G6K5jt^aaRmBbaBc*>yvSOGCL5Tz)4bm-fpeih|7ui zRv~52imZM&bst|8+Gf^Qs~sL~nwr#Xzd@Dj?^+0D*X%+-=##FK5Qwlz4Q<4Tu+!Ux zr24pYDS85TrxWl<%GhuD@f8VtiM@Tnf9L9-zn4qrs25HDAqG{Lbr&z?3`HLM?1t#B z_94uQ%Xw3j{QWVOJmvD>z%2MmzEq)0!iL^<6jpH99P?wPjLj?FZR?8fL?KS8juL_5PBnf#mA!~|n}m|}ctWc?~iuIbIaWYGNLNKG%y9EJL|h4m#4 z8}usB3ckq8!dcqx`m-sQ!_Av>KV6vnv-A~@tBe_mNyd>{J6~;Y^wv64lfS@+f>W?6 zd|P-nB(DaR)KX&LxPefb!T=>M48SmP!1)od7YJo%+GC>fO7MLzP` zS9JwD>}DW-6ip9h{60%_yD~<%3Au1aXHsw8gg!6866@vh;Tbu%G}a|OqMY8-YhpTi zt~WH;8Rw$iP5)3liN&iH!b+SftxNV66vx{V zJg(C~cKh<@_C10e0qaTiUqMOKQkQi3o3h-xmON%o0SLq_-X(38P*QZAeOsHN_*7(d z@R;cO)HJ{RD5Vv;Sj-2ql6?3{e!Pen)_PLUsq`=}%I{)K1=Zw6QD+)w8spgLjcGhSQ{7FSGH3Hu7vtfYU9_m7pyHu#-C4YgtKh^Bcolur01L&WVyyv?l&p+A znpCI=U7noDL&*9H9$?mhJKDRALHlWE4MFM!wZ~1%dJrHHKi=Ki=x%)xLtc^L%o%G6 z2B4x-g)Z3`pb20w8ht5;4D>;E7#bdE65;U#8pMGCv}{$*VZgf zFSl{>(=FZsjcfhdtM++L10e9YOOc^_rgss+7qAc!EPZLy=?7d@FebQ$z?NLbW>m(G za;=`m*;i5jDn26K=`>6gsQNaJ<1$BY1Qn)^mxyo{ww`wTy)8SDYO@dy_qV_t)E(_9 zSD$qnuj3ZW^ggZ}>GM+TK{g%q4%mvFhrAV&UATYWBNg@&ZA_m)$JD=g5Rt&J@#Spv zj}lVjGiLrk+=OXT$xB`V_Vi=p9s)FY19A+$%9UQD3`b5j(cQ6H7;K86oefwSJn636 zwHcDByG;xMShM0qNAwB(&g0HksCn|@UoH=RIQ4T}d zM%t)>Pz>GlaIkQ{C}E=QlW8f~M%Va^c>g{e*uzOYd^(A{qU>6ql71Hxf7cIxeS3HC z1VQ?fZOG{S7DP089v^1K)YjYYtu|Xpxk+-Je+9w0U}}wgbnu-O+7zvP|YZ z$CVKOFJ3IJw_(HWQXBl>7-}U#$tP{h@NY41-c+&7le;df-gSJm%R18avU`~WHnlL{ z?BhNZ242_4X3P&)mgZV_?1Bkf!8D2XSJC$@)BQQ#ZtI@mJ*ca_E#Bd0z7lz1@}tQM zhBIM{HABICI2=sYipgi;6-`l8Y*pvzZ&fp6ioD$)L7gzAik8{)`*UbV$(CxXw2&-K zWRlTnp&}-Ax8~2q;Nwo@+?lv{JR9!Lupd5O3ReG!lOar%lyEN35%5Zt~f)!LZjzI4>k}k-tIuk7Y?&^`tu)q*fUkU;FcA7IaI;0!;~&M z>)eUT{-~gy!urF5dcd0*Q~oXoD_>p5#csT$tQfZPm3@C?b8U|7&;2X|Y@%thARZw+%GUsshwNiRy73;%m`+uQ!R2eR*_c39d4HO6ZlvGQgaS1<+X zeQDlx$MgQUk{au2X}O8qur63eM^=yZ6I-LeE)dqeyI@33FNzT(d~0^wnAFF{)yhR* zr9&BTkND@OHSXbSZcd3H9R92BB;wRZgogRvALKQU$y{q|4IT}$gWZVX?zyr6qo%~A z9c-7i`+gT914d0$Wl=+=XOX6tUz)Ah%MWA8+)#uIE{)Tg%1-IH?WsB+k62@xTWU{T z*0P;K&*cL~va!0>IK(8`S44y*ne$S(>fpm@x~^@QD=4yjs67GWYF*B1FIf3Q?owcy zf^jt$1|M3&sdV2 z3=2FCrRN=UfoYXtV(b$`9;9dIg8cA9mSCr8#M$990@Xu5*<{BQ%B~LMB*90&G(Yw6 zHj_z>w$A2fV=T{^{o3O8?cQVB^39u^8=y=p+Pz9vTI$a_7lCc{3352sNViq{0&3ir^Y8;e z?0jI?Rl|vHKHKhMBvR2aJ@Xg`Jsk>Toh$SNv5uHcyxo9YYPR5*v_`CP7h*ABTG}Y9 znfGl(t#mZlkK%GTWGvpP?9|&ky%b?ieK0s{&fH%)mofBbt^0T2RF16AT$uJ{hHCSm zj{bc_Ym=MHBZs6SM2rFdZ*yVx6KtFqNSpDUv$v!c#zof?NFIzms+X=?D0D%_%<@c8 z-a{f79n;?m&x`W8x<@~Ny~sz;8tv_EEV24E9oE+}#|v#7tts-zC*(nOupM%L*$Jx3 z-O5KwG>s45onidv1+FkYmC=~`z^;8id%=xKyfJrd#!tDTG06>-M2hKtVcgP1 zIAp*3yN1hFqIrdJdI$4Ld(v*3l^%$@VI^jcVJL|YB^9b^ko8QQnZzm6E!ngVaoIy^ zc+&Uex9G!%Os1r?FgC@3Dy6KiTsS;Zp=p*QE2@atOuMQGqJLDFn^MYr@s5D>S6o*&p-c@iL<|$0_DU z1+3MiZC%jk8t-FCd(wVb_s(8G8apuYSGzqNLGZ<$M|~Ws!DHlZEbqL3mfGo@w^$TU ze7)Z0Do&O6k0&oqE#u!0&%SS}G&#|nXxciu*LkjSzKLIJtdJXi);BVM!?`#S8Ei?v zWSAd3{L2qM|C0|wNg*-WyS>N~qAThX3a}NcqEnN9`Ga5l>Bm!Nv3_LQ$Bu>Ey)Dju zTY^i?0O953jf_`q<$`arYUUu58n$sz+FDPnnMkY=U%1OaS(N$V1yu`q_`W*v!RPcy zlYi-3^~mibZKk3uv{1-Of3uv&SfE*>2`v^tW6x$1de>=hu3&X@XXjao zN2MpJp-KEhC1DS(`&C^*`GayfHfy%Pd)@wKkIo=`+S%=Iaaz5Dcy8Jjhk=P?!o@Kn zthJu8u)_CoCZDAAgr6jzGZkHG^PjS;@WV!*lLYfuF3MkHqu?MOfs_%<|sI_egrHz+=0 zZItdu&$9C?RkI89e?)6w&$n&Tf-{r~{?gv6c7zzS_A_NErPJyV9;{@b9*^y#y1o`x zCZj_EyfGf4hmCy|PMKEt7;pcDr!FyC72ma)dT+?Z@c^B7-wy!b)=zk$HM{`- z{NAX?X{n&vI2ZQ_AeSU+S9xh!bzRLs3TROo|CQowxHT@Yi)D=Os3l`ARV62cV-Mh_ zPPLbeAvHB^5DnDa;>44^Z3muG7W){0UvU^0R3X24bFa*OCPZQOrH01~m;oHy09+-0 z`7Nr(SICz~R!aDgT6D>?=G;;z%+W*`o%JvYNBp z?$+wY?pkLN=ML;koOh!cJkDuTh@=OVYK~M0JMj>@@XPGTPN@u23(M$tCE#LYoIZzc zSd#T?Rr-A2A&-tjDe?oTMOn}xmP8*KafKVPoOakbH%M)Cddr&R;&p!aC%5m;wr(#O ztaS9GaO3394KJM_L`LT~%FOU0scQFnP7umKxVcs-BAl-(-pqKE`uQ z1@ua?i>tiEG!M4FFH(8JsC{#hN0{b;N7&A#-(Ok;cJ0$k;i0bt0)nJIAk#EFB=fnw ziep}}$g+IstTL^n&F3&*=Dtg_IJlcl;J(jaeOe5n^F|ZU^yQhwAnIc?*^ou+*FPsU z6J~r}rU{(6wilWcdrqbal*VV54^z#=&qDCx`!P+h@6&JQ?Vzj zUFkztbAWm6e0mdrdwdo4Uilu@OsF`Q7*5kCVVXvLFL^v`CPX>VY(x<*h2(jynSdC; zz(-$*5wo`>?`_q#gK3t%@*?e$Cm*ouy6u7YzUGLW>UVGWoY^-qD-j_BBIp&R+Jv%IL1gUp_2nGGv>l?5=crhj~e zUp&DgbDyj(jrzTsqpE-;MmK1?lRdw375Et-2Ve8($`$&kf#w~_x%?GCOM3?>Zw->neI z5nZO)EEWf>jb<=8a_6Vduq+0d3HRqcpCo`OJ#`C0gX|FQ9H9(gml8?`yzILxi<2Xy zR$C~IyNseK;rfyUi#<01oHzX;gZtvcos+y>#@8fG#rq0NbUOFtmU$yxP%B*;!=>TR zL-?^AxyEeE4bQ7APD2G4GB8)+Es7E4v_4z=(#X_;S_+TmMD3SDrWW3!7&VzjOUkv) zR1>s$*etzVP)9DdTr9L^URs8hgg%1~lBZobd4zJO zXHypAa}I9K0xM%yvhPABy@~wSH&gCWysWmT9h)|Mj`sS+Jl>iCaPgK3?$n1gCG@R?1%;c=6OVT2Crn_i}8r_Ms- zOuF@U^ZOJ>b<;y8jRXCV&zCfHk_?AWoy;9dQ9pgOWWg>zB zi&8#SkI-CXhM6XR25$LsUYkAUDUUGb*8l$EbjsXA*5};%X;mGe#H_U}9j-2Ah-}LK zl~K8f$>ziM2%xgWgNIv3o6qia?rb9(nHf0VKgSh__s`!y-F@FXJ%81E-+PY$zvEZ$ z&rjc0%8HgxK>EInQE@?Vax%cO(NsGLM?O*g<`k={CzK}b+rdimrR zKJa59yZLNjp$2)o8_4x|M==ESDN^eF%-1J;Y`|GAT9G=$*wTw@;o+Y=FioQKBL>x) zx3nfdDET#pUSK1Yv<&sRj?-YHg~VDbXqhsOP9W&S)qv>D0HKWn49PzYGS_woKCxgx z3ukj45&{dKG%(3>Pon5}w?WxW2HPgm$N>lRaJwOX zj98_pg*e85QX1_C}eHe$)zuZgGx24pWGbAB=+Wg%Qp1c!RJz&=cCGYWUM zAzPc!DR;J!xed$odjv)fU%y8Xcn{igU8TZdX0rAl`cH&2=>XFycP+e4AO&Aq5Wt;RNpjo% zrF)N}(cYqb`2APt$z%YZC(ILa4&t7zaBoE|gTQtTH+*+RmnheyR@BHoqwLTBmW-vs z)qa`$?K$!zi?J7_Lb}4k+-c&EgJEyccY8eMJ*$I z;v(Xjr)}_X>k@<5%H$~CZ8W3097IJJNP4l4WDa;qfnqPEW_!kb2rTui%xzt}sTXDW z<{!3#<1S;e7g!;*&M7 zzP(6>U1cC7F@Liu_}zWBap!&b3!+9ku7{0bI?7p?#VZ2E{Z?xKo>ZBlqBy-o+c6Lhz%Y; z{|P!c8%w-wm^YVuhp{CA#j3hg7wnpH>$)_T3d!i}vC&){WnD51{ueILMO5M-Oj%X% z$Vb8~$btQCiOFUJtH3OII~OnO81MkD1~Js;?cTzPl#<0DC^}$HWi3xe;*464tk z-%H5#)o(RbNB$B}Io#5ZcwvquYlQiVdeG{Jx0%FVokZxV6Ej8NjfK%<2Y{d%#I?lg zUqJ=HS0rFyCDeBVGc@hy`TTCaNxEV6v>SI;p?k$>qxCuSs3_L{6|KI|3g5IgTYp|( zDZ~gJ)Ull|b1VE5$=+#$C`iO-`)PD+pmzi`ZZeehiLX}&CdBg_Y%CN{-h3c4FCh%h zbk{XOi-|&%M7hoUM3%XIu>>($#iEBcet|O4wjwpYu$Gw+D=H#(*kB2o>*Z>TX46WA zDN7bAimLs@YjDh6iVV0Kl8 z=d?HH3L&|;M;bsN|M#|Q3DRScEekIpao@ufYr_*-)L2N6+Dff7d$e_wXVS-mv1K2zQgK|GOF*wEby5 zaTyi{FC940cI~z>lCl*x_;BQ)G$hbS%7w=u)i@3q4Z&JpxIB|$1#r5OYJkI~R12Kd zVF4w;|1<+QTn}}?AriH~Sv?0%w@%PRNvC+AO?-vX6}*3eNPBtY$y@}f0SjvVSy3rU z|Eli!3K%A-j8;E#5d8dOa2Z$jQ?5%h)+j;p#UN-og6faI8C}Q=x20wlO`h~dwMeO1 zdo_6Z>Pei?v)~rHSxAhX zx1?t!;0$mh4xFNg-vBZ9U%`#!I^jmjQ3blfft1QQfkS~H)k3cdQWLLJz{mzAM?tXN z9aeDlKR>TuhKXGm{y_{}UDp;|PjxZ(6OE`u3ZDKK)7^=dqw%BL&jnPK&vK@tsJ}iS z%ZOVnLy!jC%`N$#EDO{O6+3G;m5|cDvTl!dc{IYlEKB>8PQ`B08583uhkl*5kj_uE+mw>v27#g;!)>4Dk361}%>y zBFAscf(N3%@2dQNxtCf<(E$mBH8;NV>a4oLZH6;6ryUvUi zeRbrj$-cgqlO2C!QQ|QugU4-5Ns8}0?u6J6u z;K{^>_iCn2MW7QVYcO`It3>Ck+wVX7`u**%@4WvC|NrZ+5$(fQN)ew@_y!|YWIpw% z&8?%TL~CXgEMtu3OjFr`3bW~UPBuV6kdu=%8aCNJ_Kg|EVlInnslaun;J~33bK}Si zGU&asoD9n*d8%iP9O$3E*xqL5-6Y0}+ePMS#eOiv@;I|mU>u(B7vneV7sZ>eDQ1yA z6Wp7P3t#2fKn^4`1zu>8pmi`TysUsX9x-DEN_{G`&pPp_5Hs{+CNHrYRkyKi?)VHF zhT#A?J+f1UG>FqKyagbO(jpsVhee%b9+@V`Orum9%|R4j#PKIGppE-{78%24isy4Y zhRekkfe+%Iwj-i1j%~n8S&-*V4CC=8 zRIw3<3V;n%4H!a%WP2Xw8RtqkwNjRGhGH4vvs+;5{h+NiRs^7Uf(5~?2g$1ca~mP_ z0&W6#Z;5z$FW75T%COU@lzk!IB%d%3Qw&QN4shXEPeeV4ubfDRUl>s;SfQL+Wr7o8 z9^l9A35Rx!_+|tewzqva7IcUQf8@*a4$TCu)j`|IuacTG1N~82aA9uX3b7M zLutguDZ6moY7&-;;lW|~@+Dqx>GMU9j-=b?OdK6O+WCHO{|O&aJR;q@I~L6!t-w~# zidq^%iUaqPKI}4Rfj(YFh7V}m=PCSi{u3&idSPVD-q8xueBlpO22FBSn%qW~rL#W=--93k$5Q@HoDBvd%Ii#W~X1R9=mx za=1L3JC3>WX+6fPtN#g_;Kip<@bCZyaGS(}Jruyx5emL#4Y)XB0c*fx844b;fB|aq z&vh7d5MQ0(TcyLv<8#mewan*)m6u7h)S3~rkO}GQx9>%lzi!*bcHB`oE%kM!TD&2=Z4bS*Z1c8Cy(t|V>W)8YRd-bLhskQ|>9Aykex^arEsXLWH3$bNJFT#T|%#9NZ9Kt z^ZFhH#$*t!%=9iJ%d8gf+w{hKJ_RJ@@ve7_KbbZU-!u+WZii2^hPzGBK2Ar=wpIsC5vzqD?jDWds2#wQa+sQ3G%BsVvh;iVy(lH{fd6(BO&LpEa#$49Qm0szltRD{ncw%j&?mz{1AU-EWF8*=2y3ST%?v*o1N5 zW{ea8xACVpuo1`;E4c~^8YLoQ3s4arFSF)zen7(HKmbJtJ32Jso#P^mbh$Z}{jf$olOt!$e)0*8e!3VQPhs9F8&^anHO9rHPs1wo z#l`>v>pQt3afc*G;bRhz0UF!Vkf2~yB1US@meLCe+zng7Y|jxv!p@KY@TRF8;B~Zs zce-tfAm*VlnA{soyiy9{vt}4oo?2>it0#nst&tFqOHCQBjn7Vqn&56R5n`3Z73K@M z91|4s9$idvjaa_l&k|mk({bn~_WVirB;;#|?bjtXPA_hAWmgr*FDVoWNsoFkHWU#u zCTJhhx$V2$DxdQf2>!>zB$%6O=>-;)kc_2uCG^t5X(CY9-ILtNGSrgZY5Qk-#5{w+ zn!($taJY{TUiF6IER(@=W{iDKb(Wbpwo6Vc(`A;laIGU9&+qo}Sd8lfy!36IF5kbH z)dA&25WqVOldBC{qWdn@=LZW|2d`@yC zcf7a&v|wqQtBRi_zktL^P* zLs)yD7#b(7H{%ov9GCuphsgw^*uk#|Wk|>yDH}&Cv>iU@j@(CaMM{= zFX&BXXL#5jzMQ_A@U702nnkU9gK={eY`spO_l{rJRjPK_Cm=jN9R(xwRRGE=g;kf& zzCO^mIiKJ)QvkB9UjQTH)~7{-@Krv7ny*IV0hjPM{Td)=I5$MPiCt1J$%clx3ZQ!D z#}^3601+`IrhS8wQU@TuL0`K*@~}zWbSeFn9O)MN800*{Ajd}pcBDgS%YTlLwc;gH zvDuy~1CfeM7&oMG24qVb-zfrZcOeJ1(9V2Q8rlraPmLrW}wNvPfqgB@UJS^JanOJRNaqU&1 ztW-odISnB95tjz4Y9|d{mvqR%Bl>#*tm^2!RHut{Qa=+3bJmKK$g`1oITp2}NsNQc z+{~n5(OQm4zo;Wx!K4+?MyIk`18Kq)zdBBI-J0_t?3zh#hv09QZ!9}xuQp#! z&8D zRWU3xmPt$q9}mPZ$`_?m#}(Z9%AXY~)CgF-D#C)X7EtDL@3gek`VysiKs*9?!+A5ot-N4i>x*=TON~xUY z;Aa2>_qZ9CndtDRn3a_kCnKo+PTf=cA)-(Y2Zw%jJ0JsKrz{mKG9f*Mk4po^{uzBtFyBuRhag)c`MWwD z|23Gt+Iu_g4=3;j+T4K2B$YpBLn$h#t1C+|gFxW|5FWZb>9oK5?#J(se%yPy|KRZ> zBtk^*OLp}NA}aF25zMBG&;uLLS=1nc5nh2g(F|uS+QyR`_dVIL*U$-May$xJ zM`W1J7YIcMs0yEwtkS9YL{A1|G7Wi?oaGBl;BkEC1Q}|ncPelV--( zS1CGRvnBX$Att!lzyynO<;~v;A>+z=JDX9;viJxk`@J(5NR!d&oBk0l44+<{^p7Zm zok9TW$L@+fEXi(V1ifxB??dD}(yf>^+L7YHC9856LE{Vm;_bhCqhqGv>*JE^+1Y5= z-5DZ)0iJZ6;{nP$SoUA*H(l$z? z3=QNO!gA~us1ewKP%-OAS%%q9abt`Tg0%D#>^t43{THWtiYVV~_dq%!VQUyAfU8+q zqjwzvO>9|qpzD*SK^1^vTO^$02e9taQua z_>55BRTL5Q8Z0Jc?GdJD!|_WA12Q43JrPW{wVStHKG9ZzU>B`W*zpHa>G2Xps=Z}I zVTD;nr@ERagc$(R=}L8SM&L)xf1dzM;gvEoNg?XTK(+-zG(%Vzt19ngc=_kZm`%g; znh6sotC)X{aOyC;I)_L|!rAB*f(tmGA^hNA^twOPXcb-Ull6YeZ^2>+X29^`Oj=dH zoR5SDvHBv=g#XGVJ+%-RQwJBoR1@UuI;K6Mz5GGn*^x+Is7kQReGvYaS6mg_s5``H zyTg|J{~J6JaW85>9bH&1@w8*qbepUOc_!rOteuRGX;lI72e^G8e*oCQ(;xPziD9%` zE*mpZ)})rCB+W0Fwe027PJ1~=)b;uaG^<8@IWidyjXI42153LuA?LXhD{)OYp;mmIEpr2;mbi3$+m$o6%3w!z17 zG7h-|_b2xR8#R^V%ret54e*(>TVmwfC*7F~F>EHW-EDt)6)c`(L-M+DfOu_CMi}wO zjMd@aK%if>eIh^ZT=0IWecZ5*bWD{}sZcA@gROqp2g;%grIgGG*gb5F77&C;-N-1& zKU7S#1NFF?h&t9X)hrb}B|mvW3iExtpwT;Y5VJ3-tl?6h#UyiNa`N3_LN{C__TMsO zuwe?>R*VKJ%prL#!ISPuUiJde8^NcvP$ELD_F#x) zZ-Xf;#8593V*Wzm3SRZXxlC-j(x&7l->0Zehpr83iqqNgAnV?&@mOnxIXl5v0g5E? zM8TWhxKj3GQnu2TsH6lEDSJMM1^6k^xB(2P3XALIX#6e|wLs|ecM>%o%2tfnsC$wW z;ypd4qDxBXVb%BSl0ub_q(B8D6tqZNoN4FN0*eoOmIxe2*Ms5f&ap^lYp(urC7;b-td%CK$KwE-?>te^IZc;@5mx4iI|g2rJ+ ziLA|DBZS;Yyw#yo@6BqF7toBHJ=6y~!tQ(7x)5vN z8B?kUx|zcnv2?RUFKR4BJBfSM#{Ohb+Nrdw_Uwewi(lbVT`V5=pJdnV;+I$F4PS5{ zIa>+CJcPEY020@9zGQ_4v;7Xx#EJo2E`lTI$}K8MLVFk6Kn+YdVvq@g4gMc^r1cmJ z!r9<|`r{3a?dgQzp8vt;qmh3;KfRc2O?o&XI#%z%1oe3mw|aAxW^8CSIzR3qhiy|` zvG+7yG_J$p`OWR^(BTtwxR3tK8G-8zVgk+@$`k2X$FTrDn*8>PxIFppi3e;PJ-COA zx_`Zif80sT!qlm{2+<{eX+fel)Ln|`4;d3>b9_~zSMgbn=v7>>uZetv*PjsoHGa3f z?IBrm#&~puqg>5wdm~o9Q5umUE+^g0F%zc?5b|L2ws4RvxlZSmT@_Hw(n`@Q2Su+E zDQ}3GMeHd7Gcy^iU4qp%qAeedrrNll=!i*&N|U<5Te=1^gr4|s-#L|9yUu4`Y%kJd z$Yduq7Ub06?dX5Dw-0une!F*YwEJ*pe?J+IsG^JjhOc+;bg>i4`lh;S#JLm=>48gt zq*I%a$0~>$L+%Av(64VIYeX?e$&w|XN%WfiC8#2b*A6D-92Tr&qSWETu7ZvxnUX)H z4pH@I&9MH>pQcXzEL9!s+{E|7hD&ZjD;b>jk)R$*!Lh{%jkGa?Y2t5Ja7j^?0Xf#> z@L1a^7Qg5&+&`r5)EXN29(E^=C!vFXjmHggeyH@OK)Y3Y8$-X>M>!vL-lda{Lajb~ ziU$6JlOgx3{}%s}iS_Le*(ZgSub%&nd6$9tK}5y}QzJD#IiQoCVl2cRGnr#KQE|$rtQR=ycPlW}u@TDm1~})e7|?_-D75i_oXg22+|M~ zn~p7%E0)Xf^Y2zh(wWKDl|>{($r4#Okq`akXVJ^aMhO<{h@$!XkPGf7eV>({%{M5& zC?T>mq~^~M%NR{Vk&}d*^*AgGeH_$UE4JGeQ{2}=W!jnbMd=yeACFEMBu1kWs~1S$ zJLye(uCgmu$$Yr7-L9vQ5WuDA1JOm-v>AlRDqLmcRX{U_sytjBtCqW5jRa=} ziBl$8b<9R6Hy!j?jK4N-zv@kN{4UT5&&!+B+DuBh=~DAYJOZWxick7XwDeVA>E~5?%!w3I@GmXJr98AH^n2Ve0G(L`7JmuOPve39ERHS6cU z1ZOxEV%S;A9puxD-VlLoYSOv*ttPs%3N$Fw8LF;cpJH&09!FR#al4c3zY@>D@>@o( zL?38%eIP4UGzvI#b-O=g+d`+4*3Q1|0cDEo>2at-PMxcAUqjD$YgbUW>js(HF1V)f z>uS|_rMg~Ch!Vi7@Tv{l*~3TTEicw{@e8Xe!xIS6L~R->$-8QczS{8ud{w| zM2AN=+IPz_+d~_ZRv*{>aJ`_%%P2rv@)lfgAyTe4RDFk6IP4oTq~K_|^%7xUf0*#S ztDh#L;Zc9cL!~PE+^t|$GqXWO4?I>3|F>bTa4cS(YMp7H{OP-MyFuY4V>>0sJb7?a z<0X#|B?|%FNsh13judOUWpWt=B$y)h*!ksd_|aLF9#^kB5x$l)ZxZS2Rbl?s_3LT% zQyi*}d#6bQq1pAU#joow|M)LrHB!;sL-b|sn6-&diuH2^DQ$h`mvx;X4Q45(p*RSt z@^xHc9Dw|{{YL^(esLc73=Id@4G+^sv;L%7lK^j%9K zwzTusYIs5ia=8M9F?#+JHd)#sQU=2S_j@sd+BQo#D_X-I%7M66hZPAxGdm>P%LX`f z1%=PBg$jyXV#Gh-?i2U|S?c;2y1q4}W7VMo&6Xi11st{DCcTg2cuf5WMqJ_w)Pgt0 zfhASKz<(PZrT$egKf>dXl_@=m0OBE~s+FrZ2_M2sZuY?)viKC9aI;T4j~+cf*g3$h zY<&E8f8WhNK77b-?3Fh+H2rY>tapyDYJjY?cOE_zyF*RJ2mtS_$;nCeqZH$_qFw#2 z<*4B3SF89JREh(sR*T=l18=T1WbR#Oc;Qsy(qg#0-g8^C$@kj9JP7`mxpsi3E-E-~ zeI5IXq70<45%NR8IGDcZwC^gLHkuDIvS#~XhMr<} z)@Uk~I;;4a>973TirBogJf05_Avk#r>f**jRj~=Grmt;Yfk4*3KJ*E;8jv%lL1*b@+$LGiotI1+R}H5Q~--3@!XWnd9uSH{gYcc*(aE z$ND~Okk;`k~ z7DEW_q_<|5AsVwIJ6(^3+pGi>3URes1w5AYpI^Kz%6R;r9a>}bDsdQT22VC>kFcBi zt~bF0$c^I*Xk4>9K(1DEtYpWQusot5I9xWE4OudP3}I{$0jsC{cnoTW!C z?+l{@SWyV2RIB4;gh|D%VrV}^Y+&doyr^_~B4wZj-qB__CAUTqSv408B>=>*k>z7> z7RLkm?sji5<%!p_Y1R1^*(KXv?Fx3_1xbsh&fJ1wEk}(yN^HBjKt+sb@~U^sT=?2r zMy=MOdyZ#zW^hH2R{Fhy?4O(PyH#B*;f#f?LGF z2AVB2EOsmnWPF@g9~=3GFO#LITZlV#E?dbI6fSM?gR{~ZeFrv5gn%VQ4nhWh_hQJX zU8{(B`(06EQ36^v2S!OvU(Jv(cM_*lI`f9;Ql9kRw@hxe*V>V0n2()>umagTJ#Qn ztM$!j`U-mnYCOv62?SK78(e;Zx2jkV=7 z#)?~V_V7)9C;=tEBBjvqY~Rzd9S8v^IM12t0VvdWSnjt;sv&0zGSmt%iAh zfzSZwFW3Mbziy3i3PW^y$EVnr$ptCda|8=FoV_4XHP;E)egJw7mQ2WZy>&4h{PzHN zD6n6VIBYC=vg4BNq((uo86gy;Za!)HK{BZ#M}+N$q+`KhFl>eWlx`Cfo7^zID-;2e z)-5)5fBDN_s+&4uy2d%fbr1}W@Q= zlninE5-fP9GCE5RBo>)l1&?DuPV^rp-0(Uu{HYryjsRm=Xy=;dgpnB-E z!T1sLS~fqLGL5?$WqY_Bnm1pG`!8+$4-N+}6?jSo{pKdha&#!+{?6hVYaAI>t23pA ze~s}<%hAKzr`BL<=l>44qw3x{K1GgHULDGOkCGk0IKJZbfG`Bdu7L%Tkf^F)-1TQ ziA6)x-|*fgD8c(qv6mX5nS&*5I}9Z%(#D~*{6J5nVAn9>k#c9?f3h}cWP z#S`+QM~@%vf%D?o_|bz$2YcV{Jw;(W7eBHbE?>9)6wbVl?mv9IbAW0%Bgf5jkcCI? zxciD^To3L)5D2$!Vgmh(RK9gH>1y}k4e z-QNBKt&kwW)LlE$DjwAz?fvHuI}f!g4&%N5`zVvK-uz1}e6;huW*Li#tpwU%V-?)a zdQ?R+9{wLmg%ZdAhya*8jX-ZD#CY_B1`FIu$?^E1#1-7S1qz7XA45SM^P$1D;b^x9 zUh&mwrF}O&w?EoBz?uH_tVk$>(oR-d;))9ES%nJ4Q3IKwkgUT(6?C}iq@f0KKP5G) z^NK28XH|5HP>jn#X-kp-rF>{8DXy6%&tq^NX~buP3Mz3=mO*$3ece4$dx zK5(Y0ouwLaw}%%oxUqiH!)9tc)ED=%C1|C6*xUS{qi(nRjDOtR{EwsVHh*1{@=*Bf z8qTlVojcoy8=KGW9HQQ{4gTtGAvGRmftBRJ-27Gvug<6B>iI-r8(^&dso|Zr-md zFC%|i?s6$V+2ep+LFKtKNeg)FrseRl@rCT{NFNf zmRQyxb0wal2)&fXm&-OD!Y9P3fxbk#?5R|VQ7Fo0?p&lfAr$A`X~fl2jUWg?5rRBy zZ8}w8b7yf8D#enY&Qtw@70b{AY07dNgYlR{>O3F8@z)#T=_nh}qOOfea`C3zch&lbsi=I>GGtZtBZ)4m%bH>Ov!1E1a-jOVXXz?MYY$X^W8GY0l`?Za&5P>i5@Pg+ ze_Rb+U3#wU)OF)11hIxaQS(yWd>fQfi@f7FY9;sUdL~>8?-5^0j0-+YeWv{tTftpZ zpJg_ZWZah38IM3xrtTv}U;-hU49OD5uJaX6dhnH7M(fsP7-^G=)g1-=L-|NpJq`qD z_|8LgmYtb0a*pGwY1%&AeTJ|Kmu8#`GEPnpEY%3CN3)3xv!^3^gyD~#em^=Hyud4Q z%%vEo2rK==;-h(j(;XSz2SUi)cFN|r7~6X5Hu#|IIGK&gT-2e`JixgQcX&*3K7joF zxi*GN8D(Nfid}3YI_tgFw{HCbYrZ;e(T;c004XnB$Ag|XpV>{?BSgq|4rRizH^)E@ zc)PwN>;Wdb{mhwH77?ijKZ#$-tpF-v6zv}{GwKT_rxX}I;yW!xM*1j0Fx-+fK$dn~ z6?oE;cuu{U~I7U}7LPQCfPG!1GJC?ha-d3*rE!mdCXY!LXxfY%{BqYA-m}2XFerghoMkMvgm_>(tWCv(`fF$0)z^DR>bVuX#^z4imO! zabaeog(~97+T)$WNS077)Y9xd^?8=d?n9#?R&@yltAPwG zLcRLbK(mmpZy|YB%Vwb$TdMJ$p)@%aob=HEfm=s%2L^B}i@wC7LLevQ#$;{i-UwN~ zNUoEWHgd=@tQe<(7rY9ZellO^z}{%E5HXx)EAvc_?7FnHNwOAberXuIz6CVa4gk|}Nc7Q&`;A7HCj79JgH$Mc3FeH&cLl(59mH-`(d+!7w z-j=}ICCm)O@&Hh)ex+Y-!^m90@`eAm=mZ3nB8WJ4OU*&RUK2Pp(mE!Dm_zVb5#y+* zI;DkBYA4M8;QO0HZ+Ai(# zSlBljT~U7FBT`ysIVLbV!(di)2)BRc$QR=d1_HN%ZVRT4GTJyroC)$HXtun>e4{I2 zqP}K(&@kzv-qJy*o=Y&E5-i-8=A&=O$S5D@BH*UhEFdW<8gZ*PDLZSN!3q}jl|hUo zf`$##o~v_!$C!lV97FPGCVNXxZOnA$xy`KmOKt9JC0~gpJLLW<>jBSNU_;A^*NmKe z=YpvYnd{>@?gR1?81FI}Q$?fsQ1WJm-?Immz!&jD!cFb27*+r``OQZbHzST)I;0v7 z(UlMP%tWIm+@J*%0{tt6QxQ3wZA>uFgCXwlMVBHPx7z{|VR!;bju+_@eJ~tMafwgw z8;mCSF+v2Tw8u;di%1(BS&Hj59yzMw%ce8#I^1ImC70?CeffpR;k_DUZoyM;u%#lt z=!y@cTx%hT3n1rB&+r)ABYD0UQ1hd>WQ%V1Q;I!LI3SoeW-2@-62i0*&>o&T)k0v4 zKLWytzXp|wb#bbTc$WTg|Acu!5v*AqC4y5CuzCw)L?0QIZ^|pMNpn!XjsNjfxG23= zSGwAru9DlGKtN6<4u9~$Z3v$qhQJ}2GgEob!OA09Qm|xi~e>h4CGby z1z|l9o}?!-S|m$}9?of+OK+#lZ)C*V3iDN!}Ak9;Rm ztjI)VV3Tq>8olnlLQtqOjU9=Ri9u*dT(@V36LN&W6t)xrKMm_TYBJ=)yqkM;UKgbaCL=@Dkq#yZf|FEVjbvYn?9=+!L8{eCD&C@C(gy@3H}{u;boLaW`P zb|g=Hm5m7A}eSG(n`X42D}f36BY(YI1KBtPvis6SE}<66!e<*6!Y^=rPZA{@)J2NkAMe zMrdns4d)&2#t*#BiHuEYU9lq`$&J&;FCg?71%iSQ5Y)Qex`|$E9R}RQ+XwZ|rv5H| z3~XI-2J@>L;<;Da25Fx}8k8x59~#Mi(YESK6VHIqz^%(T1+XFRMxKNbp}Tf98C}&K z7C@g-qc3)SFNp>Ikji~*N^n)q ze;nR=21~hpHh7C?=RtC_wB1;8c3g<(Y!6yhL^T8xt3fSjP7=0$pg>TjYDF6Zl3*(pNa zye--zQ)7MFaCH#e<4nEAJuI>tO|e-`p;;AWl9~_TmaM+@PHn>tb*f=1t2nzw5PBb} zkK=HSvZ5ADaruPC?p@!-*WCkz)ab9-7wPMELDVxw{$l`gJt~7#k1{v{TVa(?-ANgn zung{Xyi4RFf)xd2&*D8)X;)iEXqdMHC#na>L{XEF5F%MccS^Qxn&6%-6*PBJ{D^c3 zyv?5|Dsw%#z9JMTsjr}%wxM`phszwE+rqgonrt)>f;6~I8fbC z=AGz{ihU?GLR}e9n1jQLxdawY$V*{=hDvO%r)0W3JGd`B{l-j+sN>B@ayXA9H=#D+ z4)|xL22J)TZGoO>oJ?oPRZuW;^IrO;uE@$Yjl+V%9ej8 zn2DN2AyHg;c#XMd<1RuiuhN-CX`>9l&Ui>y6eFOJh=jI5gNF(xrO=Ws^D3z)GFu5$ z4K$!4UP#%y)MI$qj?ODnA*ts~nrC%3Lb`(tpjEVq)O9+mFav!ZfNsge<~;BB`RGGF z{+Fk4g5rRAzJ(aaSTWYvrGicHLHE7&NmiW5EVk^+hWMBROANhJ{wh6%R#?^@zh zlY;H-uUo5kSCisLG`O(hB5Un#@AS0VPAah7elBJMo6k)iF974^mF0xtUyh^g5{5Tt1k(cg3=8Ao8DvWx?y zte8j^ML-zagB<6X z4^T4$dR|@q%7?}Cn6QuOc~c}Z;^%mk%_IRHQr~PTTOq!YjOo)dyX~yGisM~sxXBWn z4T1Z> zufk;>JQD+d2=gi{FX6?M);(x4$+)`KrCw+50VnHd|)bs4A1hIj0B)$kID2d zrlU=sJ=udYoa*|qK?~!5zM%_pWJXDxgkn>hT3POY2`h!ywebrZsG&6vY{jiBcA+p+ z$%P`}4FN+inR5AVPzUMalASJIoqa{p^j4a$xk?{gOJnY-R^sEvlV0P#aPZ^;e+YAG zdu9a(OM`>K$r;Bo=l5g;Bk>iISd;lBqqs4B0-JKcbl-Xr?FhNSkCCzP?2Ol>aR99^ ziUF3|28fPfV)7wmC(LG3AF2hCC7-a?=k%vXyeWK$G~aUG8foL4Zmyo-l*a~;3x~!vss6RUJ=!eN zE!b5!OD_~+d^#^ymm7}GQl~UIPDpcbNq+57)5=37>diBTtqEgA&xJc)s&t~OAgE-=RitD-_^Pj!c2@D`WjGU1V&^lF zzlt5Z_o(+|$!P`~(C1hV<8=zzN6eTi_wrOHYPQ6*dmW^JgQ>3l$z(~`4n!jJs*wM! zl6qu>uIAc|%qfd?BLnIRUEv7mPd&J9V3wTm71Pv${7j`RwB$e6Gkji}SDH=6&PSe2YH1Yp}pFSpmYB_j@;t}hTTrgiLl%W#v z$ih|W=LWW|;7O>cLrcoZZ8jGaCkD7XR^b-B!-QWJ^+-KtuGwx=wR zFG+UA(#{LgQ0CM{SEkDrz3=!aa1}j;R`u~!04$3^B_DUXqLEJ8^N&mqj3blT*i?Z5 zotoj0wpHSKA2ozcv4GDTQ0;tXF)~Z8avfL`A+?H8Z$YS%UOq|8EjE1;R1vmZ+9|1*`<$0P_r(zS`ywPmU^(^Yz98z<|YKQ;KJCKp=h=1u*ZF00~tz&WzQQvw{S~ z6%P!`XbFjx_)G#{>P`~26Z1y32N!(H$iU~RhQj2W3c)di!Vj^*mqUYq`Z_P$@SddP zmYY>k*fX>vhgYFNf8;LZpn84{aSt-K+)HO(`0Q-u8N)zwV96weqa3xfaFoMvF{Q=a zvxYDT@CZ(g*5@BM*f3Vi7TJa{*PoS?CjzSBhl$I>u`6qup8p5W7xyb+&O~L!qku%7 zIQxN$JoSLU@zg^kktzmC24{Fu<%yrmXaAzAynBQ8pPSZ#V3$7Ps z7*+wRmxp9D8Aai4R2JpIZJ!^T=HRlp2AsGi*PQZ-ve0qIk(}RIjV61yCXPdd)~%PS zfm_!Ciccp=s?VAiu0%3fLO))#;$s<*ootdzIwp&DXgq_Hexz-zOZM!z7SlTE2Ed;Z zV!Tiqu#(7~;d+12KRwx*OmLxx#|mbOyK$l8d2-qt3=N$b2&dIxY>P6;2+}ltvfD_X z=8?(EaoC}~_14f^9Q4jX9jtIXvNXK-$Vm-c*DeOt4T79261j;!A6ZY+3DieluzDsO znT0NC1*oc=Otqo}2B~ylFO|&b!D_@VIxsQT^TCuXUhPL-NSV=#d{6q2+!0In!Yp7j zI^pNohsI9SpvsrFW^+{2ZY$lnC<^j1r@7w%>|^rFxwUbN%X5 zk!Egsn^-8}W!ijH1dFW)jSyAsU~q8i!C?#wL#}T5rj2qTAL4C=&};Z2>Yuhro$d+T zPVh5Sk!uSMUv_E)D3EEz>E2DyY@$t7C1Fsym>XhqmZa)qVxlk_Nmo-JJ-ToU#xh>t z2WrqPA|WIVP|i7I6QMR5VG7(8U|*9j>8?CZSd*xxvqm=kU~4>MPSd4iSKsHW zGX<7dqZ4Hzv>~yAkY)>CAW$M(G^T_k*&1dm%=HXiTiB>7vOXGCwt`LSJF;i{vVMdt z;`1{hQ~ZoUs>%llMFURjl2Pad6Dj;r%{8soH0jOZSGmEY*Q>7>AVYsb78s)oA4U-* zMaFRiI%7km!_c0~Yu}o8NRJ0=!*N(a_@cQz*k!B%Sj}}T+LOCcSkxw%8oz-pgKRzx z1_zhdrn9ISHzH>f?PQ4486t+Ro(#4wODegcCUHEbT>e>douG`;LO9@hr>&3;CVdG_ z<_?dN;UNv?Itg>CuX@mfB=VDbT5XP9utYbKtw9OLFUg@U0I-D%6B{!Q;B z9$SPkm`;d#S^Z)7dN}%d7!R~0IR?U3;>lc#MaXOJQ4;9Ob8eFxu?5V;sggbD=tx|n z$_q+AlHwnO<<)rybD;Ar+ruP!+wb-}$H-(^T2wzwT4UHCqXucinHw=Rb!yv4l;JqH ziBQo&7x~fjMja{aCw?=#v`RI7M1E`R=_Quy{+Q2A=!41Z)nYe}MoiN#4}OSFmXT${ ztKhBBc1m=Wv4vRR!IObdLYDtoW7K#tX(g*a+vSMN8C3<3Ji(kQ+gTX64QsETG|q+z zmU2TbN~G5uG#@eq70IsfXv8VsiRBcC9}dSKUY2~NhD{{z!4T?YaI!OgiP)&&G-`;| z9b6++h`iC@nRpl?yc0I&&hgvZp3TCrS>IZff#l4kXC@9dos5Ptk||?vyPDcX#Ezp3 zy0nq9t(|>UT0&bn&mtR;1|*T+U=WDuEWql7A$C)iO1`y%nMB?2T`8QDJ{UZ@-M6yk~bCG z?BrkgCcgd3)*xMOJjo#p8ix^Dn>#ChP>q5`H{@&7PE9N|mdL@#r&3_C*LxtTSS{Tv zM&nKk7Gnw15AYnRX0I86eX*TPs5!x19ZQlL^aVy*Xu-JuF)(2;Ts}o4)1J%1ND`~% zN1~_*I{Cs`+v^itNKdcjMp)jg0bQKjTaMhcw{*>ov&cXSsT`51LWQ1_S@;22sZOiV z6Rqzj`#KrIYI?Nq-6W*0_LCkKTA*26AW7^j8-jBc1KG;S2^aZk;5nZ)lP&2ucoVIe zWMxfMa3c!wZix;)FpA>>rKH?xnF1ok%ju7&_L1M?>=*o24m~h(gc)QwV>RnjM-jNnK0+8q4*Qa?UXQSVVdvV%($))ni)4gwx_Mbd_ zaB%eK@zLJ*PY(Wu{18d$y}gGIzCYUCd2;Z>)4lxD7y5r4&`pc*k9Musr}Zj-8yto$ z0I5h26$Yuo_)g%Fvnah}+FA0DkikR)CaC1?7xAL-FBG^Q(n1A&3pHiQh~iseUA&Ks zqv3Jy6uQK-fG43kU#HJHQZ)mfymPDOzHWl6sYb<=62l+WJtB+~6Whw>#LvMbqCMFm z#3mBhi5)~W0$SbIi7p|vU918EJQ=Y#y&=Gu7<)Atauh!puch!o98&fTJ+ucnZE?B= z6S5vajeKCr<=>o^^}^+iSEB7&-?8x7AI;BCbnTg6QbPT3PbTB;!_iBH7$Ra@D0pO2(UBK5s>5$ks;!AdwcKuy{F&qJ=*;n6kLGf?PUsV{^UO;3cXWYqPj}=I}i7s z9xT#z+4J!jHZ**VSLuBB>4Sp@yE_jT=)df~pS>l08M;4x`uOPr9apCv@->9N=_&*N zubrol9z6PXe)r|D@nFkTpjmd_+oUGo*z8A|9F1C<%m!E z&o8b->wA0O{LoD4dD>N^PF2Pu?8a0%geTC0+d;HQqAF^%1=JOs@f7-$2(#vIr9~Tl zwrW$I4*_Kqb3#uC9?b6;3c5|ZsON5rvJZ>dxejP{S==~EfK-uL)XqtOl$b1Rv?MTUl;(%!V>K0;0#<@e z(`~8&{tipB$-+vqCw+CkJGqav_v7xp!HXB&H@A+y!05Eo-B%aG*D4?3=mZ|I@l?m3 zmp$zbUow9t31Y8^Ax{xrzA8)VDxTshFQ0L@f91ra(E)3M0W1#Q!;`-SAPVSg;_FxX z34bLY%wUs#P@%fLbEtBU!~nyeqPy3uo3w_F#j0uN_FcvvKR7P&Yu?r|TQgFqyQ3ro zJS6*^0CCm^$BOt81xM;c{%dL{eKs{Vgc>324Nq#C$~b4WY3dUV=k@rIY*EwaOd8Qc zBJI*SPdD=X2p))(zN~z(n_#=|+`G4Tk6h^1`qRDdAO9#tpL@{{k9NP?dGxIm{;7}* z`WA~KaYqbI+A4FJ2?blDa}6^J-9R7=2EN&&mCDgpU-AJ3Hjj0^*$jT#rLTl{@<4%{ z69d|fTp_-)YC|PKvU@UhFkfFW2i=nzRn~pDyAPimG}C0taGB9?AJ0ePl@j=WK<$~$ z4hCoay%#SA#{&%WfqR!;OuN)}#K<-63O}OTehkxUxiE0+=<&%(Y^H z6Pi}QIRoiTmgt^fIEeKdkIsO}6gelGrV7G(Oqu2JnxMuu>`%E_f;o|emE^HgcvhhQ z90?3(Rhy1jiFm|n{BRkPN2gq4tn1@f{o~gUUTDvcPmzy;%~{P?6gy8t zE6Fc`gG>Dr=aV>_vK6a~B&)o~ZH?uuWNmtOj*hyb#}G{38}t28s7(+HAoSn~KLwey zb0KvuiC8Yaxgd)vU~R`q=Nf|lqA@U4G35+7yM>Vc8p6ua4(EVpVV`wlwh{fnGj1v6 zl?b}qv^Y60VEie*tcQRI^zUd({enit9eEp&)!08K0!a&3UWNobG^e@Sh* ziWbk3*i^2Ma9ts$5~j)@co#@xV&xH5DK_vp>y-{zJ#@J?AntmknN;SPZ>Y?2Pz8ww zv>BgP`?EkHTWFa?ZnFv&6Hq6>w;`cuV?+B2ltbf;ZZ(q`xgjB0@WBE=!5Jjxb73Fh zFtIXR1?cQ2tgSqyN5Pd===mOKth~6VE_-O8z?IsIcMq1t@S;6~iNf7DPNNlqa;>j~ zd%wh=8yh}lDLMl~MVcvPaoT)&%mx$`KdW8{Om%bugA?lPuH(++AyeaFOshrr{j(3Ivv`Ez4R` zjvoeujD9*=WbA5gq&7+2xTRL@sOx&W?1-nMMaHYiut*(n9Zj^%c)zJtotA&aC1OdDhUX+rCU_S~1Km_V3hRU@kc=hyn`omB{JNhSN$GzbRxWItg zR0~DyZ{-3}MQKFIzx|gUJ5G=ZdpJd=k`}A<$JkP|XkfHpf)Va#h!MJJ0Xxw!Q4^A3 z85%D_^;dMEUl6+3;sUj@($zRn9s8Hzr?6BO^dTh7KwDg!((SZ`#E*s>y`*IQT;1hW8sIx2w+TWe(8VxZCBdJ9XK0G>&bl^UEt7Mb>=i6Sb*0qqhD zUnBQ@G`*AYC<$aAQbPcrjhZpnK@8)b2hWEZS%Y?eHhVLvkk}mLpLD6Hvo}hWZ5BHW z!ft$T^9VPVI_*w(+#SB}j^B5O>x@;?s^Jfp4rl;3dbEapn2AZ9ZVcNG1E&aS_*n%R zt(^2x87#C{t_4va zRHFnPwKtg#&Y-JK?vF-Opui;SvnT2XI zStNDJ{@{P;g?jSclOv>0INE>k|Mo=Re}M#tfBg$KytlrfciB0Cc~YdwwO03h^mC_s zHW+q%Cv4ioe^OMSOH|?;ai5{M6V#3O!qz9O-JD-T&h`?-!m2YEkcv3|WWLE2M=-Cc zS1J8lrIAc|1Z1Jw3FsQ0#bSUck{GI5v*hX+|Cq7uAAvH*rR#RO;+g9~8p)2>bv+tj zmZGlV&_vl-Zd5aP{tq=IuJJRPkqu;HFdd;7OZ?hvdIHwo=#S|LnMx#qxT3*dXub9Z z%`Al|J7KZVSZad?zTpa~S-`kms6JaMkbty8GivcU>M6Hwp6={pteGC zl32thDCizvjJaG}moinc46sOzfS)MHHxWIkOZ?IvGkQCo5O^KAU;q*!v>IcAhfy=D zrXP(oKuprCwrstUolz7koloNdbS=6#_xCL6@TM0P@bORGmNQgK9+Fq@ccl`wf2Bh( z=pNs2arlXx3L^*eFL165_F;ecQZ5#|)UmD3edUu($lA|?6KRk($FqiDm$M#>{Jro0Y zr@+_h=J-i|x7L1=w%&oX{3&bs6V@3WK?#B`k6Salk6p1|V^?&YcJSFd66PEP@*J*> z*md`;_qO9CLmAyx2!=KqYJnk&QsrmyZJ{w01$Dzu(uiqroiGGr6GV6ri(7P00f&-U6JSk;+rj7BNNcVln3)#v% z;v_r2&81q{-3bR6;`8v0gl*cTg(siA%q(8k7g>oSuFI zFt%wv6|JWWj`SdlgjR#`Ra7hahP|V^xJeEi#f1%h{q%j0YLNbOh`Ih%tEn(OR3+++ zU6ZpJ;0ej5=mO=vLzzJc^-u7_nnbj213|zw#YXsR$eicBigc0dp(E<4$JLE-07R4M zPDgdblQqz)_>>wYBo-XntFY2bdP?u>P+zt6(5FzHl(ap(u5T6F+Ga~QKv#y!;-=OH zC}9{PAH``0V@x=o$`Iq`fQ_reS5Byu*GP+MeXb6+IN@}dOvM?PMt;;$B??9LPza+RLMcJ+jp|nbef< zhwI~6Ng@+eI?pmMvYY$r>5=B-*E=s?M^m2cb5~pTc@J*RG-My-3M0p zP$8Tf1p##yqmERhYksqCpB6Y4x$hep*PYUl+IxFfspC{6m35IwCXBu6GpqmuN&gJZV%%Z^G zt{myZ_9@ChT*FWtAmWP`Dhg`ymn2ydXsV&) zPqeZ%SOh`p2%F%fL}$TjEW7B%04ZJXToy$`1Jy)4Vf7US+Orl`k3h2^DXK=0f+nKL zur`idBI2xinw9ava4=)gPV<0+TZb%R&Z@2!AA`uE-9Pwxvg3sC4ji>mEXc0BfQG}cZJms(n zTu+2e?Pi}zi5XpV^0ClT^1W9KT57u2(^=`pWHWnj&vmQ(TzS;qZATcBlba6;H`Dui z>nl?4wmd;>5l`1!FGo{*v7H3)ClIp{(!j@sU?_d2Jw_j^4EO6o!aY}ZQ5`8lP-R=H zP-sgUFo%c&$%(`A)%J?{*VNDvuC1&vClDp|-Z35dNP&iTXe@ztL=qPQtnx@Ty|BgQz9hr{tzsMkq}uDI;O;Vnpk3)BjuQ z#}rX9QZG#b*$Op=`9;#yg=h#FoRb2x?H*1RI#|ULBI&T{Pk^yZ6)MVI^Ww^&_2x=>u2Zj*~!_@SQ zs7+C#lxLf0L|14~A3t1g9j-1Ms43T`)J(25xr!HX312wd^tKyW;fhV&G7*B@O6{p1 z=m!0OcWf#s)hYFWk}X=n)~!TP(Gl=b}s3xGGBj#BqA_?GIrP zBPL=57~MNEc#iYC;dqtwVhm{9n*b^j3u6yvxP&%?ageUAxx8wb*FKRnVRv z$|o{SR6#QCqQ8MZU0m*mZOP2XxF{%AUi_NzIa#p?Q1lPNy~gjTEhv8~>#`$bxQcwk zEgF7aJC!JORX?zK*^PvP@tPh$Xu`o9fkQOnK`5~UavARVw`i9r3g#TBAW?vriB0Ue zgdVOdSKw##gC6$Om35;{;LGI7%jW5PXv|NBGNbIORkB`5Y?F_82X3VmSB@MY*ASTp z$z%wRj?d+1@rqbvi9@ZMr7_jnp+6zvj|?SYl$o7mIL+y#GPsI7cpHLCv90QGOBfks~V@8)iL-61&gD=DLeXH zY-t-Lz!o>2?0Q*rLBMwWAhE7AN$E0m>-1BE>u(X^dMJBO1l$(Etr7}^*|K1hg#h=Htbwb2#6amzzj_2fXpH~xPdSV7ug5s0UGe(2ims?0KrXr2TqFiOde*T$!@tr`9k!$kUGor$=N45X z`)S7(vEhDABKahq-A^|>^d`us8y=RP0$yhZ7&Cg6`y9JBp@CxLFhqgM$A6g{9`P_5 zwn*bq_wH!;V({`}j7`^Q7#_o%alU;Io)XVdm0QsJxH!eD^YsVcsq!F<$LUFPIQ=!H z;m6T<9|LP2b`7FRLMg(7d*_q>Q+|YfQGDd}_J=SA4qo9x{44C-iy9%34cfU~0(L-7 zv$vW)4)wjG~s3UaAPAAhR|3>GWcLobtq*5#}ce!4ZP&bs50rsxd zqn*puT^te5MrvsfC?Z(r|9| zIOhr%$||Che`?d|=WQyiTQsbE&ss;REt4>*awF5#l53i4b0DyWIQp%^EB`Qb* z|B`NaQpme(b?_KkwTAbvU5R`*vgusw!G2ns7HBv`%3SkoeORf=tEq{* zK8#k}^&Y%{H@Nu92q9pZjJU}i$-_essoQNm8qtYG??|gRW%?mTZShu+9Bki1+x~ca zyCGQcndo=k8uOCQNBb646NGAw@%_8K^XUcNP!CFEZGuOs#IsAaHXVr#%|E$_ z`w!mvjrVTl)4p9{#>LIV=SB+4N{?H4@c3tkr^f%up(!MqmXD}2J#$J>BnRLY8qtux zBom||fj()UhwEd^5$VIQdV;$A9R^}@7^`ZZN>_I0M!)n2TH~}3l;~uH!>#2S>e5W4 zVoC6)VyV`Inh9xxJbe)Uo9SQbUR49n8NQnbAP`gj4zA0#J`2jffI zG(`butH3B`ThA6`H3npf6>hKLCrnf#J!HSC^eioAE-rh+lOWHMS}M+6le$!CQ4P2W zvsbC_cU63;f>c+j4 zk2knu%YAg}uCxaTu!uLlXdt1B%6-8-65cIXe4Fk`rsr<5MR4KA(B!2_iu8|9Afnz!k``QB zD$j*WSIsaJA+17<(zqnl+L-HF>a?STCVfQH3nJtD*j8Q&o3XlwbQsA#oV7UdGKG>V z#ea`iYf;h(W5=8_ovB6LBhB6xfun4&_$~YFU?@Dvrnm0>eN4HEeQDWNbrD|^4(mVM zK)Z54BJd}viwt%dJrm*32BQ9F5oz+WWfv{nENjQIyG0V^#JHFE5Z(01HA=mmZUDHk z)h)ClfOZnC5SPS|AIZC&vj8IbGUSueoMHpc5c8ei(sB>|&5)%1USjF&$t|%~#(guH z=qP@1^yI|QpW;H>S_aKLTNz;$r(_n8o=a+ThtDA1kx{Gx|jjk3z6E8GMB1Sep*UV*t;KV@oB(U+9Wh1TSB zNp3uO#knS&eUnzRaF@rf*#Re5!nUQLjhpmFae5n4k^PIB3Q4W#lL8#vNanxrIjsF@ zVedqO_8(oGJx7W|v?vL^q+tNfl7j>yDlHhc8U0m@!9G-47O+GpN(AdTfqm)9itgw5 z?|(O@1%>*iEOeRb6&0ekO6f3n<3Uy?VgDr;yH95UI5JUB{-?8mK92Egef{LXPiFy@ z6U-*(R_1E^bQU0K33=J+(^b21_VDtg*f4TIyK^>heRyyslhOM{U)6tYUE23O(*;Ai_$4tT|>RWa#{3%b%;lIbD6UNiryuQ*6 z@$#CTd@#CTBsF6zSEz7s#|;+2_I3t4Mr^hpOXzEB^$(Ny9N!-%ntY3eTX-4H14UC* z(v)0+mE_u$5IaP?A->KEw_BYU=P6~3ytE+GED@JAK%%XGlT%Fny~2!D94`LD?CTsK z12L99Xv!EX5Dk;DJQJv!x@mp`19Tf}4E#CoN$YBur0ht)pYm34ZSf!&<4zr0A1PUF zmSdFNf(Ipz3T|ax3m3~%TZ#l2>OP>=q+Hao!6vS0@-LmCws<0CzK%>!MCaEw7Ft%B zqS;cfL5P(UA4N&uPT^??=C!D?{Ie-~Ss#Iy3eVj12L01xDL;LBEJe*qSC`?0@Y6FX z{?Lg$dTIJLGcBO?uVJNa!A9FM6K@F%?aH(JxjaCs!31 zk%*DS3zje_vd|dX6>`h%pY8gmWq2qJrcc*CXI`3}O*PT+pE-Ygy6(wHQoE5#D*{K; z)bnzd^bfo4nH{WO{T3ShfwUY0k543e_n+kYXoEJPtZ-=I z{0)UaI?R*9;LWGSVS(z6k_iplClPRPilRD+n`sH zjZ6r^L_teQWRwbcg1yxc3M5x8^BRk?c@&boePm>b$Ei17R0|~b3Q(hF5m0`Yk_8Yz z{}~3C4g-H1!t&SRS1Y$7v1kKkmRTNEzQn~!1u96W+c+4XZlbkut#ZpzMxBNF^&68A zuPVUn0&iBIAL&XZH`oxr1{tp+%7JrAlf(abMB5%jc zz4aj7VDItiZOY*>{c9~8R*RAoiq;%ir}I*Oa1E7M(@v(Xu|ZRBacb+E^4iR#rZ=1W znnoY@ZOSUY6GN~&%#KfQQw}DZx5cy^LfUKQ2E6wH-=@^LsJ;EQ;EBt;woL~us-IG= zcMt1|yiJ*^I9+o;y%8B!*(|SNdRtKLZtL}YTe>pZL4Px;eA9H4?;|E>!O{QT6zBBm zjYwH+t7lWRh_3oZBu!>ap3NzOSEN9{Q={3tszh-%}rJ-*A&XBQ>{}fSAQgvt+0!h{(&tX!E!V8mZTfQ-A z948Ky&_XvlytH4uGAXs0icygYkf);(E)ZL{94360lXx^jMcwPjhNLi)T2N5(qNmWn z-&y?4-m0t__RFDTN7qHVJ84ItBa`Dqboj0`KM){ovc%K zs>)&To4Wq=#-k?Hl?1QJ3P*cw=^)^A9VCDypWTq=zFJn+@o?4R(;JU` zYsp3YMl6}>2yYR#y0821m`K7;B=9GSd6e~9(i6SWAABL^wZ0A`?n3_J9^nnPU6yQu zb`^_dQzo^2hX8ewBynEp!f?=SCOXw0+W*Oj78c<|%*0xg?P4s8*v30t+6tl;i#QS# zbdN8_yliG&TFMqL1FZkAz3W|W<4EqVR6gND9w9Z>@eI%gK~k12MQ1C5Ku|;-Nw5G= zwqoY?Kwv?x5C4J%WHEJi$J>5M$Jw2p`$FD&3{whIFe`$-5j&f(FL-9}fB1d(VK}4l}R(BUUf@ggiGfD|b z_npmSmbs0s^t-LCt+TWE6JE;3eDF`s&f1@BZt@}u){nWhgzscOx#e&ZvqpI6B9Qy* zO2yLe&dxq@|6L0R8>G8BeH4__!(tW--^${hlSH*t_NG8723!~e9ros7pL1Fs#(I|% zwLGShf6uj1YQch^G{N>zO8H-~xVy+PhlbGo&Ur(kVo!>`@8y)f+2J8wHG!6MQ{+F3J*#K{(`LlAdoT^Bv}|2a6;0sAyK~KhY=PQ z)a2Xyy2x>Lx9*lJ%J+9FRnkma5iI)S?jpxj{%ySl1($cFNR#MkO}X(csK;`57dift zFLGRe^fGnK4)TYew6RNldzXg0^#3;v_pam*_90X5Fhwc>PF<3ULpH!iYk4WK0J z%?$y4x&}~^W+nwFiA!Z_YkO4r&oHNU5}AQXdY4lh3$B!!^NUd~Bbbyr(Q#t9@v%fN zT2{WxsZHb5Z7AiW`4*>@n4CXFif^~*OD9TKgt8f%Zlkl3yi%gE(m^smZA$IT#9UII z>jH0l7NHv_%)ZNGoqG?ZESLTibhC9O`2&76`W`|!Xq~=wZY94llDVcp-fntN6D;z# zzt_^uE($$agEBsB#jCQ4sf%<^2lpHM19x1DgXOwoi5ucv0P4I0fu6j!z0r@q-Qfgz zE2HL)KoB%mxD4yYZQ9Jo%qO%&je4?GN;qKZY1bm~!SM`uUHr+3gWA>?$)Bz)D{4WK zE9zksTW7Y!*kUd2qxF5@6}D4kATi?;Sm=zrg@4HJ+}X8e-m% zmwolUvEd<_eU{^JHby2r9cqrX?qA5jv7Py7$|)e5Dmt23-jJcii*Hy`T{!6zv$*|J zd?p!gWzn?Olfgiegw=|`KsXQAh9(eD)%C(&A*x12QbO-sHUB%poz)LrG2 zvY3TOMZU->t+&Xry0otJ1iIz5YxlE@K@TQbRW2VpqOMpWM(RSQRCx%$?3T99%;gJv zZ+zF1!!F61s%G?xcFih|^dwN}kWd~|k4Qm>$v}vfwd0;rrOKA7Jl|!aTzeEOa}v|X zd006HYB>*p>S=qbT5zIR42N+jjP0rGmRWh_Gi`AVV(k@8=$9xz`6l~nw?9{vEC${j z(W^(U==NI4GUOwl+>JYw5PsW9cC&vBZa!@oP`EvuKZQJ{tNR3d;AN$#n-d~wY0f2E zdoXC09`tA~^Guq2mczBvIoSl9*hGFHv@&MPU7pg}ta}CPOQ@-$L@(}^2cVFBrFKwu zv3*VYHhPFLHfgu;twR*w-;U5eCMm5)dj~q_EbXFRhesvc(R`);y50E?p<6YR3YRHNz4P?53EUOSdu@n-ky`6C<%PylYje z(@wM_#*i*F?XaMHn9LBKo*HGmOb@a*vT30u0de1IK%9*)OC=xu`SO%nJ(T<*>L22` z5-fsY_k0+ZinH#xKN$t*SMx9~O7L4!y5I*fT?)P+7N%Iny{Yg(AQcuLfQYbl0IW6{ zO}p~|#tV*4xzaSSdfj>N(v)}vv_6}G%E%he1#WUQ$iFHTGMJS%9~;}sXn}LK=b_OA zdErGkD{88BU6d#)Uo2`5FN3R7G0qYfmv;7sL9bKZ@^&mRQ+kO}8Y$w@Lcu=V75IM-3Igy*CISau^b zIyiuanJIp~O}T4Q2bII=O<4~+TXS(P7q0;w0EY>qH97lX6MOVI;MQG|Jfxq(6=y>! z3cl`zlJpdVgzgXfLc)vg{1U?xF9w6C7lq@wnF)&-93$*n(yo}C1f2ccgzY8y>MR@- zp7I~}Vdm9^JvpyU>r`=U{mY*OPe;Ak)pQ>8WU2(wt5OLw8z&cK9Lq+39o1SdPddR~ z{Y7xvsvhq(k1W#_AZ_%pqw-n-0g+jDN;9H_8Vg|Yj9?U;7Z}_o`UQ`EHm1qJTLl66 ztI!W&Si)6aJbD&1U({QN&FWsz?z9@m&x@Pvwk2FNjsmQ!OT`iA5$@!zki&urER*4+ z+b6`2%qk2=5XYGbU*@0%T1VsV?8=g!vf9l7KNy(;>&0*$^i9aNDS}F4(=`gui8(u5 z$`qq>wy$C)-5S!HK01%)6nC%~yw}I~3@X^oxxChYroLsmmfJ7skKd2X>e*~ZM1)#( z`?E05S`s_qo*ggm@>gq)dMtHtm_7Y*Y^AM2$?r!qsQ2#dVlkq$k1s_PP~9&vnqz0k zqLN}K#!Dg_(xyZX@o7=Cp+b3TF{ib$q3>ncxNyD48q39A3)6167g-A^pGlY+OPu!9 zkk02s5=vJT((U`wxr}CS=t|kZeITZvaV4C?hO0e5f#} z6Vyv(t;}HvBfg(fc*|d5cdEwrR>jG|NdT*&-Dn;MjXkS7%tm^?(zn4BPhaYGH;$Z4 zOGQW(EW>a@1uA>U6+;oXWtkK-E)TR7nBJ-9Yy~;(avH#GHRfZpyMs>wTTpo=;5nBP z>)zl0dr~H^s?{yd*dsG#k>YCQA=^%*h7=aI^W;(^G{6e$q}mBub=YFhPWSigEv208 zaB+RHvU#NTNe0QiMhgh`qZwm*N@w7-|H;B6f{3FI-T$x@@vF?0JaJ_Ck59Sl{WA~h9yD~yJn$B@tw3YVy*vewSWZ$G= z0JalH1$I zognJ*(}f_0RQ`wXqIbdYAVpwX@cgyJG;aKpPTDBu++Ltma=u#_HS-VW`x~iKFr{la zo2PkKH3LP)Ls@QGMAuc+5$6>2C-ZTLMLGE|$Kffx${-N*qnHfZ52UzwfZ!S71KWo3IFAV>}GV0EhNT};1({(h{zyPWSr=N*O1T)B%TWd_5%(NJNODVCy$ zlT=oTTqmp8rkJkNxH}x#nY`XNYK?w)ooqG$`+&iB$qL=a4S-cTm*FggnupgHHhVND zUzu9_q;>opS_n%z9AfSp*tS=b1^mHR@jM*K8aA_RT;qGOau=H5U04W-X$1wGp)F*M zpN&hK(i!3BXX=eeo_0s;Rbb9JmewbK1`cVGjnmX_1U)hLcON`_@aWUeA3P*~GDI2V zrw1Zu+fR%{2@gYD=kCtKPai(meRThUROE`uLFGjP*bqq-!CeDMdEPM~pyb8@tYFwE zHf5Yiszc%}($dCQ77>ZV!D6|#yi}Ds($}`I>%sp}+3 zTKeWx2j?wD=iv;RbI^^30j*fDxl-P42Y^m!%az=u&4Wh+EYgyPIza>!Bek(3nXH9S z7>$IpsOMp16@>wk77th1&S7o~Wg8N6SaHVm`+=5Sp%&#X&^N^q+|Ece@{!ruwT@e^z<2IDC+?s( zoJdgK6fIaJx(LQrlLbc0+Ey)z?fYcNVG@PiQGjDu;zpr!5b4=frRKjQ(q*&O9W0ae zx@II+HHdL$ccqo&)lC`^EA5vWSf%52&2Vna!ci9vg7F2oNiA)a?MtFwBBB5d<-5$n zHsD_+Zvw*dD_2<O4 zcX0}n$r`58l{ft3H&m@DBi8098p9|>P%WcUl8<9~yvBHD2!U!6Nr+dRhi?~0$hH|p zNcb-NZ#9O{V<9oW`B(t+ACCp#ug5~D!Z8qRkywz_%2=W@ppgDYm@A{j$bdeJ&_f)C zajY?o*zw1{RCj2QU>~7$27r?CE(kzdVviw~*(BS_8p(J_Y3x56T|^PU{m-aR?0?$7 zHVhQ##!OhIcdxfEqXBh;3ubgMHoz1YOj9KR)>wB-8+_}yPuN9DrPe| zwv+9CEL(DI2w6dN(v0VI6Pf}gwBfkaA?PJDg`2P!YRJM@KP&f%^Fymw&AMQ}PMbEFy1xSOa9e7S=VQ3};)4N2}5)!XrT66TK*y4h7 zbaFno%Cl>Fz^#CiJO%+_KbU{lg@+ZafYh(?q!%IXxsO=oo&;KnwP={pGBzd3iF<8Z z;~tJkppkyq9Tp%t`OdvE-$mF9T_7eGE_OHp$US9vYkR|ms2TTq7$N3JTVQn|SX=;5 zT)$HmJj(_qVl=qI-%z?GC#T}eGIrVt`g}1*N%(Yz&{bpBLO-@4+i(Ti5SewR2%jcZ z(%4BEq7K@ieM=&U#R;@C^k2Fx9nXWsY#haxh{|Ah;f2OkB50Abf^}GYfK-~3@2Ei; zH-?~X%$CQ6LIJy#0IKDZW#bULPyoUiZ9{QrWvjT!(f2Cc;vgouxA9X zVBjNg_jEFo_LjR@LHh@F({Ao}zN)tBrqMPht>%lyUVYEptG4m`UfF!r=o~apI|e0S z;dWk{=Dw*OzcjyX9PgD){p*ufz1=p=R-tipa@eTjS>w2Nc)EwsRr3t>j+-5G*f?r* z0JPIIY|w&g)KPEW9MxO313<1mYaBK@FUy7fM(3C?_Yvh#HHdfUG-{`Z)s{IqZJjjR zbu_;Ru*Z$#eFn(ZkLt&r3R=Z8Q-6UUrhQO7JY-Xa>M5{q5kExEpS)}}o*#6~LGy4A z(JLCp} zwL82=;^5%L(MrG-TNy~oky5(@{%e)ZJr-m)xvGwlivSZf>{s-xx(I%nGr65;JU?!t z6ZPX4NgwiBXk3gZT)r64!LRl0wj9h{GS;Ti?lh zB{5x}X-pRzStc@>ejJ9_8-Og9a9}X0TCz6i&CZO^DxX(&MDBW1H(TIg&1NT~JX3z{H$z?oOLIZGi$CYyhbH*pevA^+r zP`bx)@-_Hv>(?=PPfQxO^i1vHLgwr4E@P9!v26QBa}E#Ih#nB5ZUje%=dGqw4!-x^ z_mm z8h%DZvU__cFmDr?xV>$Tx>uO>qB)%AfxMF&ho&gI70(yve`^jAzXAy{yZTUwsEc{U z-x$Jt{1`E@{8B0+%yO$2Zw*9^5(eFyu52cz14U7DdwZqE_ABgGPG;NP1q0ULOx4g$ z2PD-`>tNy=@4g@!o{ToGLkc)m~OX%dj4-uPMwJC$C^jiY%uE;O!AuW6iIEulMTDP7&3k21#MV z0@V<$48~cTk4kK7s|%e)V%loBZ}u|m{h@>>mUIe^q}b>tT_GQ;z|I>f{`{iGJ@WBVqpB+8> EKPCXzng9R* From 52fb993ee32395c1524f175fe4a26357b6a3746f Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 13:58:32 +0100 Subject: [PATCH 25/52] build: remove deprecations in config --- config/packages/doctrine.yaml | 2 ++ config/packages/framework.yaml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index be036a8c..94c2b2e0 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -24,6 +24,8 @@ doctrine: alias: App filters: ownership: App\Security\Authorization\OwnershipFilter + controller_resolver: + auto_mapping: false when@test: doctrine: diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 0dd27ddb..224855ba 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -19,6 +19,10 @@ framework: trusted_proxies: '%env(TRUSTED_PROXIES)%' + uid: + default_uuid_version: 7 + time_based_uuid_version: 7 + when@test: framework: test: true From 6d1855b689cf9c5d43da6359bebf91e63ef70459 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 14:26:07 +0100 Subject: [PATCH 26/52] build: upgrade oneup uploader bundle --- composer.json | 4 +- composer.lock | 108 ++++++++++---------------------------------------- symfony.lock | 3 -- 3 files changed, 22 insertions(+), 93 deletions(-) diff --git a/composer.json b/composer.json index 3ac86302..0eaec07c 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,8 @@ "knpuniversity/oauth2-client-bundle": "^2.7", "league/commonmark": "^2.4", "league/csv": "^9.7", - "oneup/flysystem-bundle": "^4.6", - "oneup/uploader-bundle": "^4.0", + "oneup/flysystem-bundle": "^4.12.3", + "oneup/uploader-bundle": "^5.0.1", "stevenmaguire/oauth2-keycloak": "^4.0", "symfony/console": "6.4.*", "symfony/debug-bundle": "6.4.*", diff --git a/composer.lock b/composer.lock index 67108bc5..aa696a94 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "19944536361c8ce097be783ab1c80fee", + "content-hash": "2ff84dfbace72d3926d25dcbcf06a455", "packages": [ { "name": "composer/package-versions-deprecated", @@ -2848,46 +2848,44 @@ }, { "name": "oneup/uploader-bundle", - "version": "4.0.1", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/1up-lab/OneupUploaderBundle.git", - "reference": "34d22041d40ff45f87de56cd617a580d48cbdd8c" + "reference": "470b11eeee82946fbf93d5944c63749bcdf65f6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/1up-lab/OneupUploaderBundle/zipball/34d22041d40ff45f87de56cd617a580d48cbdd8c", - "reference": "34d22041d40ff45f87de56cd617a580d48cbdd8c", + "url": "https://api.github.com/repos/1up-lab/OneupUploaderBundle/zipball/470b11eeee82946fbf93d5944c63749bcdf65f6f", + "reference": "470b11eeee82946fbf93d5944c63749bcdf65f6f", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0", - "symfony/asset": "^4.4 || ^5.4 || ^6.0", + "php": "^8.0", + "symfony/asset": "^5.4 || ^6.0 || ^7.0", "symfony/event-dispatcher-contracts": "^1.0 || ^2.0 || ^3.0", - "symfony/finder": "^4.4 || ^5.4 || ^6.0", - "symfony/framework-bundle": "^4.4 || ^5.4 || ^6.0", - "symfony/mime": "^4.4 || ^5.4 || ^6.0", - "symfony/templating": "^4.4 || ^5.4 || ^6.0", - "symfony/translation": "^4.4 || ^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/mime": "^5.4 || ^6.0 || ^7.0", + "symfony/translation": "^5.4 || ^6.0 || ^7.0", "symfony/translation-contracts": "^1.0 || ^2.0 || ^3.0", - "symfony/yaml": "^4.4 || ^5.4 || ^6.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0", "twig/twig": "^2.4 || ^3.0" }, "require-dev": { "amazonwebservices/aws-sdk-for-php": "1.5.*", "doctrine/common": "^2.12 || ^3.0", "doctrine/doctrine-bundle": "^2.4", - "friendsofphp/php-cs-fixer": "^2.16", + "friendsofphp/php-cs-fixer": "^3.40", "knplabs/gaufrette": "^0.9", "m2mtech/flysystem-stream-wrapper": "^1.0", "oneup/flysystem-bundle": "^4.1", - "phpstan/phpstan": "^0.12.10", + "phpstan/phpstan": "^1.8", "phpunit/phpunit": "^9.5", - "sensio/framework-extra-bundle": "^5.0 || ^6.0", - "symfony/browser-kit": "^4.4 || ^5.4 || ^6.0", - "symfony/phpunit-bridge": "^5.4", - "symfony/security-bundle": "^4.4 || ^5.4 || ^6.0", - "symfony/var-dumper": "^4.4 || ^5.4 || ^6.0", + "symfony/browser-kit": "^5.4 || ^6.0 || ^7.0", + "symfony/phpunit-bridge": "^6.0.17 || ^7.0", + "symfony/security-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", "twistor/flysystem-stream-wrapper": "^1.0" }, "suggest": { @@ -2936,9 +2934,9 @@ ], "support": { "issues": "https://github.com/1up-lab/OneupUploaderBundle/issues", - "source": "https://github.com/1up-lab/OneupUploaderBundle/tree/4.0.1" + "source": "https://github.com/1up-lab/OneupUploaderBundle/tree/5.0.1" }, - "time": "2022-07-25T07:51:47+00:00" + "time": "2024-04-04T06:57:10+00:00" }, { "name": "psr/cache", @@ -7976,72 +7974,6 @@ ], "time": "2024-11-13T13:31:12+00:00" }, - { - "name": "symfony/templating", - "version": "v6.4.13", - "source": { - "type": "git", - "url": "https://github.com/symfony/templating.git", - "reference": "e27b6ea8d737cb0dfd41b2f5f055c9ed677afa33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/templating/zipball/e27b6ea8d737cb0dfd41b2f5f055c9ed677afa33", - "reference": "e27b6ea8d737cb0dfd41b2f5f055c9ed677afa33", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-ctype": "~1.8" - }, - "require-dev": { - "psr/log": "^1|^2|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Templating\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides all the tools needed to build any kind of template system", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/templating/tree/v6.4.13" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-10-25T15:07:50+00:00" - }, { "name": "symfony/translation", "version": "v6.4.13", diff --git a/symfony.lock b/symfony.lock index 3c5da087..0a0eaf46 100644 --- a/symfony.lock +++ b/symfony.lock @@ -465,9 +465,6 @@ "symfony/string": { "version": "v5.2.3" }, - "symfony/templating": { - "version": "v5.2.4" - }, "symfony/translation": { "version": "6.4", "recipe": { From 1741998d309105c13ae2c93b3c547f44c6f06a0e Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 14:42:53 +0100 Subject: [PATCH 27/52] build: update composer packages --- composer.json | 40 +++---- composer.lock | 293 ++++++++++---------------------------------------- symfony.lock | 6 -- 3 files changed, 79 insertions(+), 260 deletions(-) diff --git a/composer.json b/composer.json index 0eaec07c..469f2616 100644 --- a/composer.json +++ b/composer.json @@ -9,31 +9,31 @@ "ext-iconv": "*", "ext-json": "*", "ext-zip": "*", - "composer/package-versions-deprecated": "^1.10", - "doctrine/doctrine-bundle": "^2.1", - "doctrine/doctrine-migrations-bundle": "^3.0", - "doctrine/orm": "^2.7", - "knpuniversity/oauth2-client-bundle": "^2.7", - "league/commonmark": "^2.4", - "league/csv": "^9.7", + "composer/package-versions-deprecated": "^1.11.99", + "doctrine/doctrine-bundle": "^2.13.2", + "doctrine/doctrine-migrations-bundle": "^3.4.0", + "doctrine/orm": "^3.3.1", + "knpuniversity/oauth2-client-bundle": "^2.18.3", + "league/commonmark": "^2.6.1", + "league/csv": "^9.21.0", "oneup/flysystem-bundle": "^4.12.3", "oneup/uploader-bundle": "^5.0.1", - "stevenmaguire/oauth2-keycloak": "^4.0", + "stevenmaguire/oauth2-keycloak": "^5.1.0", "symfony/console": "6.4.*", "symfony/debug-bundle": "6.4.*", "symfony/dotenv": "6.4.*", "symfony/expression-language": "6.4.*", - "symfony/flex": "^2.1", + "symfony/flex": "^2.4.7", "symfony/form": "6.4.*", "symfony/framework-bundle": "6.4.*", "symfony/http-client": "6.4.*", - "symfony/maker-bundle": "^1.33", - "symfony/monolog-bundle": "^3.0", + "symfony/maker-bundle": "^1.62.1", + "symfony/monolog-bundle": "^v3.10.0", "symfony/phpunit-bridge": "6.4.*", "symfony/runtime": "6.4.*", "symfony/security-bundle": "6.4.*", "symfony/serializer": "6.4.*", - "symfony/stimulus-bundle": "^2.22", + "symfony/stimulus-bundle": "^v2.22.1", "symfony/stopwatch": "6.4.*", "symfony/translation": "6.4.*", "symfony/twig-bundle": "6.4.*", @@ -41,17 +41,17 @@ "symfony/var-dumper": "6.4.*", "symfony/web-link": "6.4.*", "symfony/web-profiler-bundle": "6.4.*", - "symfony/webpack-encore-bundle": "^v2.2.0", + "symfony/webpack-encore-bundle": "^2.2.0", "symfony/yaml": "6.4.*", - "twig/extra-bundle": "^3.3", - "twig/markdown-extra": "^3.3", - "twig/string-extra": "^3.3", - "twig/twig": "^2.0 | ^3.0" + "twig/extra-bundle": "^v3.18.0", + "twig/markdown-extra": "^v3.18.0", + "twig/string-extra": "^v3.18.0", + "twig/twig": "^v3.18.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.68", - "phpstan/phpstan": "^1.10", - "rector/rector": "^0.15.25", + "friendsofphp/php-cs-fixer": "^v3.68", + "phpstan/phpstan": "^2.1.1", + "rector/rector": "^2.0.7", "symfony/browser-kit": "6.4.*", "symfony/css-selector": "6.4.*" }, diff --git a/composer.lock b/composer.lock index aa696a94..c8932eed 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2ff84dfbace72d3926d25dcbcf06a455", + "content-hash": "59980d645105fea52e615bba39e9611f", "packages": [ { "name": "composer/package-versions-deprecated", @@ -333,138 +333,42 @@ ], "time": "2024-04-18T06:56:21+00:00" }, - { - "name": "doctrine/common", - "version": "3.5.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/common.git", - "reference": "d9ea4a54ca2586db781f0265d36bea731ac66ec5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/d9ea4a54ca2586db781f0265d36bea731ac66ec5", - "reference": "d9ea4a54ca2586db781f0265d36bea731ac66ec5", - "shasum": "" - }, - "require": { - "doctrine/persistence": "^2.0 || ^3.0 || ^4.0", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9.0 || ^10.0", - "doctrine/collections": "^1", - "phpstan/phpstan": "^1.4.1", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5.20 || ^8.5 || ^9.0", - "squizlabs/php_codesniffer": "^3.0", - "symfony/phpunit-bridge": "^6.1", - "vimeo/psalm": "^4.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, proxies and much more.", - "homepage": "https://www.doctrine-project.org/projects/common.html", - "keywords": [ - "common", - "doctrine", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/common/issues", - "source": "https://github.com/doctrine/common/tree/3.5.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcommon", - "type": "tidelift" - } - ], - "time": "2025-01-01T22:12:03+00:00" - }, { "name": "doctrine/dbal", - "version": "3.9.4", + "version": "4.2.2", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "ec16c82f20be1a7224e65ac67144a29199f87959" + "reference": "19a2b7deb5fe8c2df0ff817ecea305e50acb62ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/ec16c82f20be1a7224e65ac67144a29199f87959", - "reference": "ec16c82f20be1a7224e65ac67144a29199f87959", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/19a2b7deb5fe8c2df0ff817ecea305e50acb62ec", + "reference": "19a2b7deb5fe8c2df0ff817ecea305e50acb62ec", "shasum": "" }, "require": { - "composer-runtime-api": "^2", - "doctrine/cache": "^1.11|^2.0", "doctrine/deprecations": "^0.5.3|^1", - "doctrine/event-manager": "^1|^2", - "php": "^7.4 || ^8.0", + "php": "^8.1", "psr/cache": "^1|^2|^3", "psr/log": "^1|^2|^3" }, "require-dev": { "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", - "jetbrains/phpstorm-stubs": "2023.1", + "jetbrains/phpstorm-stubs": "2023.2", "phpstan/phpstan": "2.1.1", + "phpstan/phpstan-phpunit": "2.0.3", "phpstan/phpstan-strict-rules": "^2", - "phpunit/phpunit": "9.6.22", + "phpunit/phpunit": "10.5.39", "slevomat/coding-standard": "8.13.1", "squizlabs/php_codesniffer": "3.10.2", - "symfony/cache": "^5.4|^6.0|^7.0", - "symfony/console": "^4.4|^5.4|^6.0|^7.0" + "symfony/cache": "^6.3.8|^7.0", + "symfony/console": "^5.4|^6.3|^7.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." }, - "bin": [ - "bin/doctrine-dbal" - ], "type": "library", "autoload": { "psr-4": { @@ -517,7 +421,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.9.4" + "source": "https://github.com/doctrine/dbal/tree/4.2.2" }, "funding": [ { @@ -533,7 +437,7 @@ "type": "tidelift" } ], - "time": "2025-01-16T08:28:55+00:00" + "time": "2025-01-16T08:40:56+00:00" }, { "name": "doctrine/deprecations", @@ -1220,62 +1124,50 @@ }, { "name": "doctrine/orm", - "version": "2.20.1", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "e3cabade99ebccc6ba078884c1c5f250866a494e" + "reference": "b1f8253105aa5382c495e5f9f8ef34e297775428" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/e3cabade99ebccc6ba078884c1c5f250866a494e", - "reference": "e3cabade99ebccc6ba078884c1c5f250866a494e", + "url": "https://api.github.com/repos/doctrine/orm/zipball/b1f8253105aa5382c495e5f9f8ef34e297775428", + "reference": "b1f8253105aa5382c495e5f9f8ef34e297775428", "shasum": "" }, "require": { "composer-runtime-api": "^2", - "doctrine/cache": "^1.12.1 || ^2.1.1", - "doctrine/collections": "^1.5 || ^2.1", - "doctrine/common": "^3.0.3", - "doctrine/dbal": "^2.13.1 || ^3.2", + "doctrine/collections": "^2.2", + "doctrine/dbal": "^3.8.2 || ^4", "doctrine/deprecations": "^0.5.3 || ^1", "doctrine/event-manager": "^1.2 || ^2", "doctrine/inflector": "^1.4 || ^2.0", "doctrine/instantiator": "^1.3 || ^2", - "doctrine/lexer": "^2 || ^3", - "doctrine/persistence": "^2.4 || ^3", + "doctrine/lexer": "^3", + "doctrine/persistence": "^3.3.1 || ^4", "ext-ctype": "*", - "php": "^7.1 || ^8.0", + "php": "^8.1", "psr/cache": "^1 || ^2 || ^3", - "symfony/console": "^4.2 || ^5.0 || ^6.0 || ^7.0", - "symfony/polyfill-php72": "^1.23", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "doctrine/annotations": "<1.13 || >= 3.0" + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/var-exporter": "^6.3.9 || ^7.0" }, "require-dev": { - "doctrine/annotations": "^1.13 || ^2", - "doctrine/coding-standard": "^9.0.2 || ^12.0", - "phpbench/phpbench": "^0.16.10 || ^1.0", - "phpstan/extension-installer": "~1.1.0 || ^1.4", - "phpstan/phpstan": "~1.4.10 || 2.0.3", - "phpstan/phpstan-deprecation-rules": "^1 || ^2", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", + "doctrine/coding-standard": "^12.0", + "phpbench/phpbench": "^1.0", + "phpdocumentor/guides-cli": "^1.4", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "2.0.3", + "phpstan/phpstan-deprecation-rules": "^2", + "phpunit/phpunit": "^10.4.0", "psr/log": "^1 || ^2 || ^3", "squizlabs/php_codesniffer": "3.7.2", - "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7.0", - "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2 || ^7.0", - "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + "symfony/cache": "^5.4 || ^6.2 || ^7.0" }, "suggest": { "ext-dom": "Provides support for XSD validation for XML mapping files", - "symfony/cache": "Provides cache support for Setup Tool with doctrine/cache 2.0", - "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" + "symfony/cache": "Provides cache support for Setup Tool with doctrine/cache 2.0" }, - "bin": [ - "bin/doctrine" - ], "type": "library", "autoload": { "psr-4": { @@ -1316,9 +1208,9 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.20.1" + "source": "https://github.com/doctrine/orm/tree/3.3.1" }, - "time": "2024-12-19T06:48:36+00:00" + "time": "2024-12-19T07:08:14+00:00" }, { "name": "doctrine/persistence", @@ -3450,20 +3342,20 @@ }, { "name": "stevenmaguire/oauth2-keycloak", - "version": "4.0.0", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/stevenmaguire/oauth2-keycloak.git", - "reference": "05ead6bb6bcd2b6f96dfae87c769dcd3e5f6129d" + "reference": "1b690b7377dfe7a23e1590373f37e12cf40a6d75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stevenmaguire/oauth2-keycloak/zipball/05ead6bb6bcd2b6f96dfae87c769dcd3e5f6129d", - "reference": "05ead6bb6bcd2b6f96dfae87c769dcd3e5f6129d", + "url": "https://api.github.com/repos/stevenmaguire/oauth2-keycloak/zipball/1b690b7377dfe7a23e1590373f37e12cf40a6d75", + "reference": "1b690b7377dfe7a23e1590373f37e12cf40a6d75", "shasum": "" }, "require": { - "firebase/php-jwt": "^4.0 || ^5.0 || ^6.0", + "firebase/php-jwt": "^6.0", "league/oauth2-client": "^2.0", "php": "~7.2 || ~8.0" }, @@ -3505,9 +3397,9 @@ ], "support": { "issues": "https://github.com/stevenmaguire/oauth2-keycloak/issues", - "source": "https://github.com/stevenmaguire/oauth2-keycloak/tree/4.0.0" + "source": "https://github.com/stevenmaguire/oauth2-keycloak/tree/5.1.0" }, - "time": "2023-03-14T09:43:47+00:00" + "time": "2023-10-24T06:10:44+00:00" }, { "name": "symfony/asset", @@ -6462,71 +6354,6 @@ ], "time": "2024-09-09T11:45:10+00:00" }, - { - "name": "symfony/polyfill-php72", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", - "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "metapackage", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, { "name": "symfony/polyfill-php80", "version": "v1.31.0", @@ -9750,20 +9577,20 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.15", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1" + "reference": "cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c91d4e8bc056f46cf653656e6f71004b254574d1", - "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7", + "reference": "cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -9804,7 +9631,7 @@ "type": "github" } ], - "time": "2025-01-05T16:40:22+00:00" + "time": "2025-01-05T16:43:48+00:00" }, { "name": "react/cache", @@ -10334,21 +10161,21 @@ }, { "name": "rector/rector", - "version": "0.15.25", + "version": "2.0.7", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "015935c7ed9e48a4f5895ba974f337e20a263841" + "reference": "e70d681f6a0c361a63e6825897cd97746436f015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/015935c7ed9e48a4f5895ba974f337e20a263841", - "reference": "015935c7ed9e48a4f5895ba974f337e20a263841", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/e70d681f6a0c361a63e6825897cd97746436f015", + "reference": "e70d681f6a0c361a63e6825897cd97746436f015", "shasum": "" }, "require": { - "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.14" + "php": "^7.4|^8.0", + "phpstan/phpstan": "^2.1.1" }, "conflict": { "rector/rector-doctrine": "*", @@ -10356,15 +10183,13 @@ "rector/rector-phpunit": "*", "rector/rector-symfony": "*" }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, "bin": [ "bin/rector" ], "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.15-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -10383,7 +10208,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.15.25" + "source": "https://github.com/rectorphp/rector/tree/2.0.7" }, "funding": [ { @@ -10391,7 +10216,7 @@ "type": "github" } ], - "time": "2023-04-20T16:07:39+00:00" + "time": "2025-01-19T09:41:28+00:00" }, { "name": "sebastian/diff", diff --git a/symfony.lock b/symfony.lock index 0a0eaf46..d648cf78 100644 --- a/symfony.lock +++ b/symfony.lock @@ -11,9 +11,6 @@ "doctrine/collections": { "version": "1.6.7" }, - "doctrine/common": { - "version": "2.13.3" - }, "doctrine/dbal": { "version": "2.10.2" }, @@ -389,9 +386,6 @@ "symfony/polyfill-mbstring": { "version": "v1.17.1" }, - "symfony/polyfill-php72": { - "version": "v1.17.1" - }, "symfony/polyfill-php80": { "version": "v1.17.1" }, From 21a181609e0ea9b4187ec679bc45f571eda6029f Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 14:47:00 +0100 Subject: [PATCH 28/52] fix: replace deprecated Route Annotation with Route Attribute --- src/Controller/AdministrationController.php | 2 +- src/Controller/CodebookController.php | 2 +- src/Controller/DashboardController.php | 2 +- src/Controller/ExportController.php | 2 +- src/Controller/FileManagementController.php | 2 +- src/Controller/ModerationController.php | 2 +- src/Controller/OauthController.php | 2 +- src/Controller/ReviewController.php | 2 +- src/Controller/StudyController.php | 2 +- src/Controller/UserController.php | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Controller/AdministrationController.php b/src/Controller/AdministrationController.php index cf072e91..2b8597b1 100644 --- a/src/Controller/AdministrationController.php +++ b/src/Controller/AdministrationController.php @@ -10,7 +10,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; #[IsGranted('ROLE_ADMIN')] diff --git a/src/Controller/CodebookController.php b/src/Controller/CodebookController.php index dad762d6..3a79b3d8 100644 --- a/src/Controller/CodebookController.php +++ b/src/Controller/CodebookController.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; #[Route(path: '/codebook', name: 'codebook_')] diff --git a/src/Controller/DashboardController.php b/src/Controller/DashboardController.php index 437373f6..4d90884f 100644 --- a/src/Controller/DashboardController.php +++ b/src/Controller/DashboardController.php @@ -4,7 +4,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; class DashboardController extends AbstractController diff --git a/src/Controller/ExportController.php b/src/Controller/ExportController.php index 2b4dc19f..a7bfaf0d 100644 --- a/src/Controller/ExportController.php +++ b/src/Controller/ExportController.php @@ -14,7 +14,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Serializer\Encoder\CsvEncoder; use Symfony\Component\Serializer\Encoder\JsonEncoder; diff --git a/src/Controller/FileManagementController.php b/src/Controller/FileManagementController.php index dd62fd8c..900f7d81 100644 --- a/src/Controller/FileManagementController.php +++ b/src/Controller/FileManagementController.php @@ -15,7 +15,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; #[Route(path: '/filemanagement', name: 'File-')] diff --git a/src/Controller/ModerationController.php b/src/Controller/ModerationController.php index 8da019a0..7ef1f684 100644 --- a/src/Controller/ModerationController.php +++ b/src/Controller/ModerationController.php @@ -5,7 +5,7 @@ use Psr\Log\LoggerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; #[IsGranted('ROLE_REVIEWER')] diff --git a/src/Controller/OauthController.php b/src/Controller/OauthController.php index 5f215a82..28748aa0 100644 --- a/src/Controller/OauthController.php +++ b/src/Controller/OauthController.php @@ -5,7 +5,7 @@ use KnpU\OAuth2ClientBundle\Client\ClientRegistry; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; #[Route(path: '/security', name: 'Security-', condition: "'%kernel.environment%' in ['dev', 'prod']")] class OauthController extends AbstractController diff --git a/src/Controller/ReviewController.php b/src/Controller/ReviewController.php index bdc14d47..aed055bb 100644 --- a/src/Controller/ReviewController.php +++ b/src/Controller/ReviewController.php @@ -7,7 +7,7 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; #[IsGranted('ROLE_USER')] diff --git a/src/Controller/StudyController.php b/src/Controller/StudyController.php index 91fd56b2..b4887379 100644 --- a/src/Controller/StudyController.php +++ b/src/Controller/StudyController.php @@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; #[Route(path: '/studies', name: 'Study-')] diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 126e6a88..78ee1a96 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; #[IsGranted('ROLE_USER')] From 48f562f02a7102e286c1ffa8d4b35dbabfc0f2a5 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 15:31:58 +0100 Subject: [PATCH 29/52] fix: change broken link from study description to export --- src/Controller/StudyController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/StudyController.php b/src/Controller/StudyController.php index b4887379..19c08472 100644 --- a/src/Controller/StudyController.php +++ b/src/Controller/StudyController.php @@ -352,7 +352,7 @@ private function _routeButtonClicks(FormInterface $form, string $uuid): ?Redirec ['saveAndDatasets', 'Study-datasets'], ['saveAndMaterials', 'Study-materials'], ['saveAndReview', 'Study-review'], - ['saveAndExport', 'Study-export'], + ['saveAndExport', 'export_index'], ['saveAndSettings', 'Study-settings'], ]; From 507e55e85aec245ac3bd168cd74ba7fc43732133 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 15:43:14 +0100 Subject: [PATCH 30/52] style: fix phpstan errors --- src/Controller/CodebookController.php | 2 +- src/Controller/FileManagementController.php | 44 ++++++++++--------- src/Controller/StudyController.php | 8 ++-- .../Authentication/OauthAuthenticator.php | 34 +++++++------- 4 files changed, 45 insertions(+), 43 deletions(-) diff --git a/src/Controller/CodebookController.php b/src/Controller/CodebookController.php index 3a79b3d8..0a05ec84 100644 --- a/src/Controller/CodebookController.php +++ b/src/Controller/CodebookController.php @@ -125,7 +125,7 @@ public function datasetMatrixAction(Request $request, string $uuid): JsonRespons private function codebookCollectionToJsonArray(?Collection $codebook): ?array { $jsonCodebook = null; - if ($codebook && is_iterable($codebook)) { + if ($codebook) { $jsonCodebook = []; foreach ($codebook as $var) { $jsonCodebook['variables'][] = [ diff --git a/src/Controller/FileManagementController.php b/src/Controller/FileManagementController.php index 900f7d81..d842fa1c 100644 --- a/src/Controller/FileManagementController.php +++ b/src/Controller/FileManagementController.php @@ -49,32 +49,36 @@ public function submitSavAction(string $fileId): JsonResponse $this->logger->debug("Enter FileManagementController::previewSavAction with [FileId: {$fileId}]"); $dataset = $this->em->find(Dataset::class, $fileId); $data = null; + if ($dataset) { $data = $this->savImportable->savToArray($dataset); } - if (isset($dataset, $data) && !empty($data)) { - if (is_iterable($data) && key_exists('codebook', $data)) { - foreach ($data['codebook'] as $var) { - $this->em->persist( - DatasetVariables::createNew( - $dataset, - $var['id'], - $var['name'], - $var['label'], - $var['itemText'], - $var['values'], - $var['missings'], - ) - ); - } - $this->em->flush(); - if (key_exists('records', $data)) { - $this->crud->saveDatasetMatrix($data['records'], $dataset->getId()); - } + + if (!isset($dataset) or empty($data)) { + return new JsonResponse([], Response::HTTP_UNPROCESSABLE_ENTITY); + } + + if (key_exists('codebook', $data)) { + foreach ($data['codebook'] as $var) { + $this->em->persist( + DatasetVariables::createNew( + $dataset, + $var['id'], + $var['name'], + $var['label'], + $var['itemText'], + $var['values'], + $var['missings'], + ) + ); + } + $this->em->flush(); + if (key_exists('records', $data)) { + $this->crud->saveDatasetMatrix($data['records'], $dataset->getId()); } } - return new JsonResponse($data ?? [], $data != null ? Response::HTTP_OK : Response::HTTP_UNPROCESSABLE_ENTITY); + return new JsonResponse($data, Response::HTTP_OK); } #[Route(path: '/preview/csv/{fileId}', name: 'preview-csv', methods: ['POST'])] diff --git a/src/Controller/StudyController.php b/src/Controller/StudyController.php index 19c08472..2ef1f931 100644 --- a/src/Controller/StudyController.php +++ b/src/Controller/StudyController.php @@ -116,11 +116,11 @@ public function documentationAction(string $uuid, Request $request): Response $formData = $form->getData(); $currentCreators = $this->em->getRepository(CreatorMetaDataGroup::class)->findBy(['basicInformation' => $basicInformation]); - if (is_iterable($currentCreators)) { - foreach ($currentCreators as $currentCreator) { - $this->em->remove($currentCreator); - } + + foreach ($currentCreators as $currentCreator) { + $this->em->remove($currentCreator); } + $newCreators = $formData->getCreators(); if (!$form->getData()->getCreators() instanceof Collection) { throw new \Error('Creators is not a collection'); diff --git a/src/Security/Authentication/OauthAuthenticator.php b/src/Security/Authentication/OauthAuthenticator.php index afeb9e90..0b45b488 100644 --- a/src/Security/Authentication/OauthAuthenticator.php +++ b/src/Security/Authentication/OauthAuthenticator.php @@ -40,25 +40,23 @@ public function authenticate(Request $request): SelfValidatingPassport $user = $this->crud->readById(DataWizUser::class, $keycloakUser->getId()); $kcArray = $keycloakUser->toArray(); - if (is_iterable($kcArray)) { - if ($user === null) { - $user = new DataWizUser(); - $user->setId(new Uuid($keycloakUser->getId())); - $user->setRoles([UserRoles::USER]); - $user->setDateRegistered(new \DateTime()); - } - if (key_exists('email', $kcArray)) { - $user->setEmail($kcArray['email']); - } - if (key_exists('given_name', $kcArray)) { - $user->setFirstname($kcArray['given_name']); - } - if (key_exists('family_name', $kcArray)) { - $user->setLastname($kcArray['family_name']); - } - $user->setLastLogin(new \DateTime()); - $this->crud->update($user); + if ($user === null) { + $user = new DataWizUser(); + $user->setId(new Uuid($keycloakUser->getId())); + $user->setRoles([UserRoles::USER]); + $user->setDateRegistered(new \DateTime()); } + if (key_exists('email', $kcArray)) { + $user->setEmail($kcArray['email']); + } + if (key_exists('given_name', $kcArray)) { + $user->setFirstname($kcArray['given_name']); + } + if (key_exists('family_name', $kcArray)) { + $user->setLastname($kcArray['family_name']); + } + $user->setLastLogin(new \DateTime()); + $this->crud->update($user); return $user; }) From 2ae6b3527968476071edfc098b1b17a59ee885e2 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 15:43:43 +0100 Subject: [PATCH 31/52] ci(hooks): add phpstan --- .githooks/pre-commit | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index dfd754ed..84f88596 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -57,32 +57,15 @@ yarn markdownlint-cli2 '**/*.md' '#node_modules' '#vendor' '#tools' '#CHANGELOG. echo "" echo "Lint PHP Files..." -PHP_CS_FIXER="vendor/bin/php-cs-fixer" -HAS_PHP_CS_FIXER=false - -if [ -x $PHP_CS_FIXER ]; then - HAS_PHP_CS_FIXER=true -fi - -if $HAS_PHP_CS_FIXER; then - FILES=` git status --porcelain | grep -e '^[AM]\(.*\).php$' | cut -c 3- | tr '\n' ' '` - if [ -z "$FILES" ] - then - echo "No php files found in commit." - else - echo ${FILES} - $PHP_CS_FIXER fix --config .php-cs-fixer.dist.php --verbose ${FILES} --diff - git add ${FILES} - fi -else - echo "" - echo "Please install php-cs-fixer with" - echo "" - echo " composer install" - echo "or" - echo " composer require friendsofphp/php-cs-fixer" - echo "" - exit 1 +FILES=` git status --porcelain | grep -e '^[AM]\(.*\).php$' | cut -c 3- | sed 's/config\/bundles.php//' | xargs` +if [ -z "$FILES" ] + then + echo "No php files found in commit." + else + echo ${FILES} + vendor/bin/phpstan analyse --configuration=phpstan.dist.neon ${FILES} + vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php --verbose ${FILES} --diff + git add ${FILES} fi echo "" From 9ab9ab5c7874d8e9f4468203c324e0f44bb3619d Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 15:54:09 +0100 Subject: [PATCH 32/52] refactor: use Attributes instead of Annotations --- config/routes.yaml | 4 ++-- src/Controller/ExportController.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/routes.yaml b/config/routes.yaml index 62e9c956..d4665975 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -1,8 +1,8 @@ controllers: resource: ../src/Controller/ - type: annotation + type: attribute kernel: resource: ../src/Kernel.php - type: annotation \ No newline at end of file + type: attribute \ No newline at end of file diff --git a/src/Controller/ExportController.php b/src/Controller/ExportController.php index a7bfaf0d..dd90274a 100644 --- a/src/Controller/ExportController.php +++ b/src/Controller/ExportController.php @@ -20,7 +20,7 @@ use Symfony\Component\Serializer\Encoder\JsonEncoder; use Symfony\Component\Serializer\Encoder\XmlEncoder; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory; -use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader; +use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader; use Symfony\Component\Serializer\NameConverter\MetadataAwareNameConverter; use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer; @@ -39,7 +39,7 @@ public function __construct( private readonly FilesystemOperator $matrixFilesystem, private readonly FilesystemOperator $materialFilesystem ) { - $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader()); + $classMetadataFactory = new ClassMetadataFactory(new AttributeLoader()); $metadataAwareNameConverter = new MetadataAwareNameConverter($classMetadataFactory); $this->serializer = new Serializer( [new DateTimeNormalizer(), new ObjectNormalizer($classMetadataFactory, $metadataAwareNameConverter)], From 109ddb1860038d5d6cf3c005a3918233f744866b Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 17:28:06 +0100 Subject: [PATCH 33/52] style: remove Action from controller function names --- rector.php | 15 ++++++------ src/Controller/CodebookController.php | 8 +++---- src/Controller/DashboardController.php | 4 ++-- src/Controller/ExportController.php | 2 +- src/Controller/FileManagementController.php | 14 +++++------ src/Controller/NavigationController.php | 4 ++-- src/Controller/OauthController.php | 6 ++--- src/Controller/ReviewController.php | 2 +- src/Controller/StudyController.php | 24 +++++++++---------- src/Entity/Administration/DataWizUser.php | 5 ++-- templates/layouts/threeColumn.html.twig | 2 +- templates/pages/export/export.html.twig | 2 +- templates/pages/review/index.html.twig | 2 +- templates/pages/study/datasets.html.twig | 2 +- templates/pages/study/documentation.html.twig | 2 +- templates/pages/study/introduction.html.twig | 2 +- templates/pages/study/materials.html.twig | 2 +- templates/pages/study/measure.html.twig | 2 +- templates/pages/study/method.html.twig | 2 +- templates/pages/study/sample.html.twig | 2 +- templates/pages/study/theory.html.twig | 2 +- 21 files changed, 54 insertions(+), 52 deletions(-) diff --git a/rector.php b/rector.php index e553e870..21c73dd9 100644 --- a/rector.php +++ b/rector.php @@ -3,15 +3,16 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Symfony\Set\SymfonyLevelSetList; use Rector\Symfony\Set\SymfonySetList; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->symfonyContainerXml(__DIR__.'/var/cache/dev/App_KernelDevDebugContainer.xml'); - - $rectorConfig->sets([ - SymfonyLevelSetList::UP_TO_SYMFONY_62, +return RectorConfig::configure() + ->withPaths([__DIR__]) + ->withSkipPath(__DIR__.'/var') + ->withSkipPath(__DIR__.'/vendor') + ->withSkipPath(__DIR__.'/node_modules') + ->withSymfonyContainerXml(__DIR__.'/var/cache/dev/App_KernelDevDebugContainer.xml') + ->withSets([ + SymfonySetList::SYMFONY_64, SymfonySetList::SYMFONY_CODE_QUALITY, SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, ]); -}; diff --git a/src/Controller/CodebookController.php b/src/Controller/CodebookController.php index 0a05ec84..d0c38f4f 100644 --- a/src/Controller/CodebookController.php +++ b/src/Controller/CodebookController.php @@ -26,7 +26,7 @@ class CodebookController extends AbstractController public function __construct(protected EntityManagerInterface $em, protected LoggerInterface $logger, private readonly FilesystemOperator $matrixFilesystem) {} #[Route(path: '/{uuid}', name: 'index', methods: ['GET'])] - public function codebookIndexAction(string $uuid): Response + public function codebookIndex(string $uuid): Response { return $this->render('pages/codebook/index.html.twig', [ 'codebook' => $this->em->getRepository(Dataset::class)->find($uuid), @@ -34,7 +34,7 @@ public function codebookIndexAction(string $uuid): Response } #[Route(path: '/{uuid}/data', name: 'dataupdate', methods: ['GET', 'POST'])] - public function performUpdateAction(string $uuid, Request $request): JsonResponse + public function performUpdate(string $uuid, Request $request): JsonResponse { $this->logger->debug("Enter CodebookController::performUpdateAction with [UUID: {$uuid}]"); $dataset = $this->em->getRepository(Dataset::class)->find($uuid); @@ -48,7 +48,7 @@ public function performUpdateAction(string $uuid, Request $request): JsonRespons } #[Route(path: '/{uuid}/measures', name: 'measures', methods: ['GET'])] - public function createViewMeasuresAction(string $uuid): JsonResponse + public function createViewMeasures(string $uuid): JsonResponse { $this->logger->debug("Enter CodebookController::createViewMeasuresAction with [UUID: {$uuid}]"); $dataset = $this->em->getRepository(Dataset::class)->find($uuid); @@ -68,7 +68,7 @@ public function createViewMeasuresAction(string $uuid): JsonResponse } #[Route(path: '/{uuid}/matrix', name: 'matrix', methods: ['GET'])] - public function datasetMatrixAction(Request $request, string $uuid): JsonResponse + public function datasetMatrix(Request $request, string $uuid): JsonResponse { $size = $request->get('size') ?? 0; $page = $request->get('page') ?? 1; diff --git a/src/Controller/DashboardController.php b/src/Controller/DashboardController.php index 4d90884f..d469c200 100644 --- a/src/Controller/DashboardController.php +++ b/src/Controller/DashboardController.php @@ -10,14 +10,14 @@ class DashboardController extends AbstractController { #[Route(path: '/', name: 'landing', methods: ['GET'])] - public function landingAction(): Response + public function landing(): Response { return $this->render('pages/administration/landing.html.twig'); } #[Route(path: '/dashboard', name: 'dashboard', methods: ['GET'])] #[IsGranted('ROLE_USER')] - public function dashboardAction(): Response + public function dashboard(): Response { return $this->render('pages/administration/dashboard.html.twig'); } diff --git a/src/Controller/ExportController.php b/src/Controller/ExportController.php index dd90274a..0023ebff 100644 --- a/src/Controller/ExportController.php +++ b/src/Controller/ExportController.php @@ -57,7 +57,7 @@ public function exportIndex(string $uuid): Response } #[Route(path: '/export/{uuid}', name: 'export_action', methods: ['POST'])] - public function exportAction(Request $request, string $uuid): Response + public function export(Request $request, string $uuid): Response { $this->logger->debug("Enter ExportController::exportAction(POST) for UUID: {$uuid}"); $experiment = $this->em->getRepository(Experiment::class)->find($uuid); diff --git a/src/Controller/FileManagementController.php b/src/Controller/FileManagementController.php index d842fa1c..a8cbabf0 100644 --- a/src/Controller/FileManagementController.php +++ b/src/Controller/FileManagementController.php @@ -31,7 +31,7 @@ public function __construct( ) {} #[Route(path: '/preview/sav/{fileId}', name: 'preview-sav', methods: ['POST'])] - public function previewSavAction(string $fileId): JsonResponse + public function previewSav(string $fileId): JsonResponse { $this->logger->debug("Enter FileManagementController::previewSavAction with [FileId: {$fileId}]"); $dataset = $this->em->find(Dataset::class, $fileId); @@ -44,7 +44,7 @@ public function previewSavAction(string $fileId): JsonResponse } #[Route(path: '/submit/sav/{fileId}', name: 'submit-sav', methods: ['POST'])] - public function submitSavAction(string $fileId): JsonResponse + public function submitSav(string $fileId): JsonResponse { $this->logger->debug("Enter FileManagementController::previewSavAction with [FileId: {$fileId}]"); $dataset = $this->em->find(Dataset::class, $fileId); @@ -82,7 +82,7 @@ public function submitSavAction(string $fileId): JsonResponse } #[Route(path: '/preview/csv/{fileId}', name: 'preview-csv', methods: ['POST'])] - public function previewCsvAction(string $fileId, Request $request): JsonResponse + public function previewCsv(string $fileId, Request $request): JsonResponse { $this->logger->debug("Enter FileManagementController::previewCSVAction with [FileId: {$fileId}]"); $delimiter = $request->get('dataset-import-delimiter') ?? ','; @@ -101,7 +101,7 @@ public function previewCsvAction(string $fileId, Request $request): JsonResponse } #[Route(path: '/submit/csv/{fileId}', name: 'submit-csv', methods: ['POST'])] - public function submitCSVAction(string $fileId, Request $request): JsonResponse + public function submitCSV(string $fileId, Request $request): JsonResponse { $this->logger->debug("Enter FileManagementController::submitCSVAction with [FileId: {$fileId}]"); $delimiter = $request->get('dataset-import-delimiter') ?? ','; @@ -155,7 +155,7 @@ public function submitCSVAction(string $fileId, Request $request): JsonResponse } #[Route(path: '/{uuid}/delete/dataset', name: 'delete_dataset', methods: ['POST'])] - public function deleteDatasetAction(string $uuid): RedirectResponse + public function deleteDataset(string $uuid): RedirectResponse { $this->logger->debug("Enter FileManagementController::deleteMaterialAction with [UUID: {$uuid}]"); $dataset = $this->em->find(Dataset::class, $uuid); @@ -166,7 +166,7 @@ public function deleteDatasetAction(string $uuid): RedirectResponse } #[Route(path: '/{uuid}/delete/material', name: 'delete_material', methods: ['POST'])] - public function deleteMaterialAction(string $uuid): RedirectResponse + public function deleteMaterial(string $uuid): RedirectResponse { $this->logger->debug("Enter FileManagementController::deleteMaterialAction with [UUID: {$uuid}]"); $material = $this->em->find(AdditionalMaterial::class, $uuid); @@ -177,7 +177,7 @@ public function deleteMaterialAction(string $uuid): RedirectResponse } #[Route(path: '/{uuid}/update/description', name: 'update_description', methods: ['POST'])] - public function updateDescriptionAction(string $uuid, Request $request): JsonResponse + public function updateDescription(string $uuid, Request $request): JsonResponse { $this->logger->debug("Enter FileManagementController::updateDescriptionAction with [UUID: {$uuid}]"); $entity = $this->em->find(AdditionalMaterial::class, $uuid); diff --git a/src/Controller/NavigationController.php b/src/Controller/NavigationController.php index 8b61b310..9ecd2a7e 100644 --- a/src/Controller/NavigationController.php +++ b/src/Controller/NavigationController.php @@ -13,7 +13,7 @@ class NavigationController extends AbstractController { public function __construct(private readonly EntityManagerInterface $em) {} - public function sidebarNavigationAction(Request $request): Response + public function sidebarNavigation(Request $request): Response { $uuid = $request->get('uuid'); // magic string refer to the name of your slug :) @@ -22,7 +22,7 @@ public function sidebarNavigationAction(Request $request): Response ]); } - public function savebarNavigationAction( + public function savebarNavigation( Request $request, ?string $prevUrl, ?string $prevTitle, diff --git a/src/Controller/OauthController.php b/src/Controller/OauthController.php index 28748aa0..d9210542 100644 --- a/src/Controller/OauthController.php +++ b/src/Controller/OauthController.php @@ -13,14 +13,14 @@ class OauthController extends AbstractController public function __construct(private readonly ClientRegistry $clientRegistry) {} #[Route(path: '/login', name: 'login', methods: ['GET'])] - public function loginAction(): RedirectResponse + public function login(): RedirectResponse { return $this->clientRegistry->getClient('keycloak')->redirect(['openid'], []); } #[Route(path: '/logout', name: 'logout', methods: ['GET'])] - public function logoutAction(ClientRegistry $clientRegistry) {} + public function logout(ClientRegistry $clientRegistry) {} #[Route(path: '/login/check', name: 'check', methods: ['GET'])] - public function loginCheckAction() {} + public function loginCheck() {} } diff --git a/src/Controller/ReviewController.php b/src/Controller/ReviewController.php index aed055bb..ffbcceca 100644 --- a/src/Controller/ReviewController.php +++ b/src/Controller/ReviewController.php @@ -16,7 +16,7 @@ class ReviewController extends AbstractController public function __construct(private readonly EntityManagerInterface $em) {} #[Route(path: 'review/{uuid}', name: 'Study-review', methods: ['GET'])] - public function reviewAction(string $uuid): Response + public function review(string $uuid): Response { $experiment = $this->em->getRepository(Experiment::class)->find($uuid); diff --git a/src/Controller/StudyController.php b/src/Controller/StudyController.php index 2ef1f931..9286815a 100644 --- a/src/Controller/StudyController.php +++ b/src/Controller/StudyController.php @@ -35,7 +35,7 @@ public function __construct( ) {} #[Route(path: '/', name: 'overview', methods: ['GET'])] - public function overviewAction(): Response + public function overview(): Response { $this->logger->debug('Enter StudyController::overviewAction'); @@ -45,7 +45,7 @@ public function overviewAction(): Response } #[Route(path: '/new', name: 'new', methods: ['GET', 'POST'])] - public function newAction(Questionnairable $questionnaire, Request $request): Response + public function new(Questionnairable $questionnaire, Request $request): Response { $this->logger->debug('Enter StudyController::newAction'); $newExperiment = Experiment::createNewExperiment($this->em->getRepository(DataWizUser::class)->find($this->security->getUser())); @@ -68,7 +68,7 @@ public function newAction(Questionnairable $questionnaire, Request $request): Re } #[Route(path: '/{uuid}/settings', name: 'settings', methods: ['GET'])] - public function settingsAction(string $uuid, Request $request): Response + public function settings(string $uuid, Request $request): Response { $this->logger->debug("Enter StudyController::settingsAction with [UUID: {$uuid}]"); $experiment = $this->em->getRepository(Experiment::class)->find($uuid); @@ -91,7 +91,7 @@ public function settingsAction(string $uuid, Request $request): Response } #[Route(path: '/{uuid}/documentation', name: 'documentation', methods: ['GET', 'POST'])] - public function documentationAction(string $uuid, Request $request): Response + public function documentation(string $uuid, Request $request): Response { $this->logger->debug("Enter StudyController::documentationAction with [UUID: {$uuid}]"); $experiment = $this->em->getRepository(Experiment::class)->find($uuid); @@ -149,7 +149,7 @@ public function documentationAction(string $uuid, Request $request): Response } #[Route(path: '/{uuid}/theory', name: 'theory', methods: ['GET', 'POST'])] - public function theoryAction(string $uuid, Request $request): Response + public function theory(string $uuid, Request $request): Response { $this->logger->debug("Enter StudyController::theoryAction with [UUID: {$uuid}]"); $experiment = $this->em->getRepository(Experiment::class)->find($uuid); @@ -177,7 +177,7 @@ public function theoryAction(string $uuid, Request $request): Response } #[Route(path: '/{uuid}/sample', name: 'sample', methods: ['GET', 'POST'])] - public function sampleAction(string $uuid, Request $request): Response + public function sample(string $uuid, Request $request): Response { $this->logger->debug("Enter StudyController::sampleAction with [UUID: {$uuid}]"); $experiment = $this->em->getRepository(Experiment::class)->find($uuid); @@ -212,7 +212,7 @@ public function sampleAction(string $uuid, Request $request): Response } #[Route(path: '/{uuid}/measure', name: 'measure', methods: ['GET', 'POST'])] - public function measureAction(string $uuid, Request $request): Response + public function measure(string $uuid, Request $request): Response { $this->logger->debug("Enter StudyController::measureAction with [UUID: {$uuid}]"); $experiment = $this->em->getRepository(Experiment::class)->find($uuid); @@ -244,7 +244,7 @@ public function measureAction(string $uuid, Request $request): Response } #[Route(path: '/{uuid}/method', name: 'method', methods: ['GET', 'POST'])] - public function methodAction(string $uuid, Request $request): Response + public function method(string $uuid, Request $request): Response { $this->logger->debug("Enter StudyController::methodAction with [UUID: {$uuid}]"); $experiment = $this->em->getRepository(Experiment::class)->find($uuid); @@ -272,7 +272,7 @@ public function methodAction(string $uuid, Request $request): Response } #[Route(path: '/{uuid}/materials', name: 'materials', methods: ['GET'])] - public function materialsAction(string $uuid): Response + public function materials(string $uuid): Response { $this->logger->debug("Enter StudyController::materialsAction with [UUID: {$uuid}]"); $experiment = $this->em->getRepository(Experiment::class)->find($uuid); @@ -287,7 +287,7 @@ public function materialsAction(string $uuid): Response } #[Route(path: '/{uuid}/datasets', name: 'datasets', methods: ['GET'])] - public function datasetsAction(string $uuid): Response + public function datasets(string $uuid): Response { $this->logger->debug("Enter StudyController::datasetsAction with [UUID: {$uuid}]"); $experiment = $this->em->getRepository(Experiment::class)->find($uuid); @@ -302,7 +302,7 @@ public function datasetsAction(string $uuid): Response } #[Route(path: '/{uuid}/introduction', name: 'introduction', methods: ['GET'])] - public function introductionAction(string $uuid): Response + public function introduction(string $uuid): Response { $this->logger->debug("Enter StudyController::introductionAction with [UUID: {$uuid}]"); $experiment = $this->em->getRepository(Experiment::class)->find($uuid); @@ -317,7 +317,7 @@ public function introductionAction(string $uuid): Response } #[Route(path: '/{uuid}/delete', name: 'delete', methods: ['GET'])] - public function deleteAction(string $uuid): Response + public function delete(string $uuid): Response { $this->logger->debug("Enter StudyController::deleteAction with [UUID: {$uuid}]"); $experiment = $this->em->getRepository(Experiment::class)->find($uuid); diff --git a/src/Entity/Administration/DataWizUser.php b/src/Entity/Administration/DataWizUser.php index 3c434f7f..9d9509af 100644 --- a/src/Entity/Administration/DataWizUser.php +++ b/src/Entity/Administration/DataWizUser.php @@ -57,9 +57,10 @@ public function setRoles(array $roles): void $this->roles = $roles; } - public function eraseCredentials(): null + public function eraseCredentials(): void { - return null; + // If you store any temporary, sensitive data on the user, clear it here + // $this->plainPassword = null; } public function getEmail(): ?string diff --git a/templates/layouts/threeColumn.html.twig b/templates/layouts/threeColumn.html.twig index 139adc65..3e063b65 100644 --- a/templates/layouts/threeColumn.html.twig +++ b/templates/layouts/threeColumn.html.twig @@ -11,7 +11,7 @@
- {{ render(controller('App\\Controller\\NavigationController::sidebarNavigationAction', {request: app.request })) }} + {{ render(controller('App\\Controller\\NavigationController::sidebarNavigation', {request: app.request })) }}
diff --git a/templates/pages/export/export.html.twig b/templates/pages/export/export.html.twig index d02fa675..731d767e 100644 --- a/templates/pages/export/export.html.twig +++ b/templates/pages/export/export.html.twig @@ -96,7 +96,7 @@ {% endif %} - {{ render(controller('App\\Controller\\NavigationController::savebarNavigationAction', { + {{ render(controller('App\\Controller\\NavigationController::savebarNavigation', { request: app.request, prevUrl: 'Study-review', prevTitle: 'title.review.title'|trans, diff --git a/templates/pages/review/index.html.twig b/templates/pages/review/index.html.twig index 18fbe86b..a0e9e8d2 100644 --- a/templates/pages/review/index.html.twig +++ b/templates/pages/review/index.html.twig @@ -76,7 +76,7 @@ #} - {{ render(controller('App\\Controller\\NavigationController::savebarNavigationAction', { + {{ render(controller('App\\Controller\\NavigationController::savebarNavigation', { request: app.request, prevUrl: 'Study-materials', prevTitle: 'title.material.title-short'|trans, diff --git a/templates/pages/study/datasets.html.twig b/templates/pages/study/datasets.html.twig index ebe087ea..a25d37c8 100644 --- a/templates/pages/study/datasets.html.twig +++ b/templates/pages/study/datasets.html.twig @@ -49,7 +49,7 @@ {{ include('pages/study/_datasetImportModal.html.twig') }} - {{ render(controller('App\\Controller\\NavigationController::savebarNavigationAction', { + {{ render(controller('App\\Controller\\NavigationController::savebarNavigation', { request: app.request, prevUrl: 'Study-sample', prevTitle: 'title.samples.title'|trans, diff --git a/templates/pages/study/documentation.html.twig b/templates/pages/study/documentation.html.twig index b65d2f24..49a2aadb 100644 --- a/templates/pages/study/documentation.html.twig +++ b/templates/pages/study/documentation.html.twig @@ -77,7 +77,7 @@ } %} - {{ render(controller('App\\Controller\\NavigationController::savebarNavigationAction', { + {{ render(controller('App\\Controller\\NavigationController::savebarNavigation', { request: app.request, prevUrl: 'Study-introduction', prevTitle: 'title.introduction.title'|trans, diff --git a/templates/pages/study/introduction.html.twig b/templates/pages/study/introduction.html.twig index d84ebe58..ffa4d5c3 100644 --- a/templates/pages/study/introduction.html.twig +++ b/templates/pages/study/introduction.html.twig @@ -29,7 +29,7 @@ {{ "title.introduction.start.steps" | trans | markdown_to_html }}
- {{ render(controller('App\\Controller\\NavigationController::savebarNavigationAction', { + {{ render(controller('App\\Controller\\NavigationController::savebarNavigation', { request: app.request, prevUrl: null, prevTitle: null, diff --git a/templates/pages/study/materials.html.twig b/templates/pages/study/materials.html.twig index c8b13e4b..4bbdfd19 100644 --- a/templates/pages/study/materials.html.twig +++ b/templates/pages/study/materials.html.twig @@ -41,7 +41,7 @@

{% endif %} - {{ render(controller('App\\Controller\\NavigationController::savebarNavigationAction', { + {{ render(controller('App\\Controller\\NavigationController::savebarNavigation', { request: app.request, prevUrl: 'Study-datasets', prevTitle: 'title.dataset.title-short'|trans, diff --git a/templates/pages/study/measure.html.twig b/templates/pages/study/measure.html.twig index add4b2be..73b693da 100644 --- a/templates/pages/study/measure.html.twig +++ b/templates/pages/study/measure.html.twig @@ -46,7 +46,7 @@ removeTxt: 'generic.remove', } %} - {{ render(controller('App\\Controller\\NavigationController::savebarNavigationAction', { + {{ render(controller('App\\Controller\\NavigationController::savebarNavigation', { request: app.request, prevTitle: 'title.method.title', nextTitle: 'title.samples.title', diff --git a/templates/pages/study/method.html.twig b/templates/pages/study/method.html.twig index d98061e4..51b5d61d 100644 --- a/templates/pages/study/method.html.twig +++ b/templates/pages/study/method.html.twig @@ -206,7 +206,7 @@ - {{ render(controller('App\\Controller\\NavigationController::savebarNavigationAction', { + {{ render(controller('App\\Controller\\NavigationController::savebarNavigation', { request: app.request, prevTitle: 'title.theroies.title', nextTitle: 'title.measures.title', diff --git a/templates/pages/study/sample.html.twig b/templates/pages/study/sample.html.twig index a5e10b55..cb49a7aa 100644 --- a/templates/pages/study/sample.html.twig +++ b/templates/pages/study/sample.html.twig @@ -144,7 +144,7 @@ - {{ render(controller('App\\Controller\\NavigationController::savebarNavigationAction', { + {{ render(controller('App\\Controller\\NavigationController::savebarNavigation', { request: app.request, prevTitle: 'title.measures.title', nextUrl: 'Study-datasets', diff --git a/templates/pages/study/theory.html.twig b/templates/pages/study/theory.html.twig index d0045fc5..cb4cb809 100644 --- a/templates/pages/study/theory.html.twig +++ b/templates/pages/study/theory.html.twig @@ -46,7 +46,7 @@ - {{ render(controller('App\\Controller\\NavigationController::savebarNavigationAction', { + {{ render(controller('App\\Controller\\NavigationController::savebarNavigation', { request: app.request, prevTitle: 'title.basic.title', nextTitle: 'title.method.title', From a6eb7beec01502263c611e68dc8eb5ac92b2e147 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 17:32:07 +0100 Subject: [PATCH 34/52] test: update bootstrap.php --- tests/bootstrap.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 47a58557..3181151d 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -4,7 +4,9 @@ require dirname(__DIR__).'/vendor/autoload.php'; -if (method_exists(Dotenv::class, 'bootEnv')) { +if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) { + require dirname(__DIR__).'/config/bootstrap.php'; +} elseif (method_exists(Dotenv::class, 'bootEnv')) { (new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); } From 5d34721acab02ccbcd49cd6789bbcecd432cc0b9 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 21:09:38 +0100 Subject: [PATCH 35/52] ci(actions): disable e2e tests --- .github/workflows/wf-dev.yml | 10 +++++----- .github/workflows/wf-main.yml | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/wf-dev.yml b/.github/workflows/wf-dev.yml index 88da7cd5..836228d3 100644 --- a/.github/workflows/wf-dev.yml +++ b/.github/workflows/wf-dev.yml @@ -10,11 +10,11 @@ jobs: call-lint-workflow: uses: ./.github/workflows/lint.yml - call-e2e-workflow: - needs: - - call-lint-workflow - uses: ./.github/workflows/e2e.yml - secrets: inherit + #call-e2e-workflow: + # needs: + # - call-lint-workflow + # uses: ./.github/workflows/e2e.yml + # secrets: inherit call-container-build-workflow: needs: diff --git a/.github/workflows/wf-main.yml b/.github/workflows/wf-main.yml index b31ae6aa..1e71f63b 100644 --- a/.github/workflows/wf-main.yml +++ b/.github/workflows/wf-main.yml @@ -8,16 +8,16 @@ jobs: call-lint-workflow: uses: ./.github/workflows/lint.yml - call-e2e-workflow: - needs: - - call-lint-workflow - uses: ./.github/workflows/e2e.yml - secrets: inherit + #call-e2e-workflow: + # needs: + # - call-lint-workflow + # uses: ./.github/workflows/e2e.yml + # secrets: inherit call-container-build-workflow: needs: - call-lint-workflow - - call-e2e-workflow + # - call-e2e-workflow uses: ./.github/workflows/container-build.yml with: container-tag: latest From f4b88690c5ca84cc8dc640cf20556a4c3ee51eec Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 21:15:52 +0100 Subject: [PATCH 36/52] build: upgrade to symfony 7.0 --- README.md | 2 +- composer.json | 46 +- composer.lock | 1641 ++++++++++++++++++++++++------------------------- rector.php | 2 +- 4 files changed, 830 insertions(+), 861 deletions(-) diff --git a/README.md b/README.md index 6f688eb5..ddee247a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DataWiz - Research Data Documentation Assistant -![Symfony Version](https://img.shields.io/badge/Symfony-^6.4-success?logo=symfony&style=flat-square) +![Symfony Version](https://img.shields.io/badge/Symfony-^7.0-success?logo=symfony&style=flat-square) ![PHP Version](https://img.shields.io/badge/Php-^8.3-informational?logo=PHP&style=flat-square&logoColor=white) ![Composer Version](https://img.shields.io/badge/Composer-^2.7-informational?logo=Composer&style=flat-square&logoColor=white) ![Nodejs Version](https://img.shields.io/badge/Nodejs-23_LTS-informational?logo=node.js&style=flat-square&logoColor=white) diff --git a/composer.json b/composer.json index 469f2616..046b887c 100644 --- a/composer.json +++ b/composer.json @@ -19,41 +19,41 @@ "oneup/flysystem-bundle": "^4.12.3", "oneup/uploader-bundle": "^5.0.1", "stevenmaguire/oauth2-keycloak": "^5.1.0", - "symfony/console": "6.4.*", - "symfony/debug-bundle": "6.4.*", - "symfony/dotenv": "6.4.*", - "symfony/expression-language": "6.4.*", + "symfony/console": "7.0.*", + "symfony/debug-bundle": "7.0.*", + "symfony/dotenv": "7.0.*", + "symfony/expression-language": "7.0.*", "symfony/flex": "^2.4.7", - "symfony/form": "6.4.*", - "symfony/framework-bundle": "6.4.*", - "symfony/http-client": "6.4.*", + "symfony/form": "7.0.*", + "symfony/framework-bundle": "7.0.*", + "symfony/http-client": "7.0.*", "symfony/maker-bundle": "^1.62.1", "symfony/monolog-bundle": "^v3.10.0", - "symfony/phpunit-bridge": "6.4.*", - "symfony/runtime": "6.4.*", - "symfony/security-bundle": "6.4.*", - "symfony/serializer": "6.4.*", + "symfony/phpunit-bridge": "7.0.*", + "symfony/runtime": "7.0.*", + "symfony/security-bundle": "7.0.*", + "symfony/serializer": "7.0.*", "symfony/stimulus-bundle": "^v2.22.1", - "symfony/stopwatch": "6.4.*", - "symfony/translation": "6.4.*", - "symfony/twig-bundle": "6.4.*", - "symfony/uid": "6.4.*", - "symfony/var-dumper": "6.4.*", - "symfony/web-link": "6.4.*", - "symfony/web-profiler-bundle": "6.4.*", + "symfony/stopwatch": "7.0.*", + "symfony/translation": "7.0.*", + "symfony/twig-bundle": "7.0.*", + "symfony/uid": "7.0.*", + "symfony/var-dumper": "7.0.*", + "symfony/web-link": "7.0.*", + "symfony/web-profiler-bundle": "7.0.*", "symfony/webpack-encore-bundle": "^2.2.0", - "symfony/yaml": "6.4.*", + "symfony/yaml": "7.0.*", "twig/extra-bundle": "^v3.18.0", "twig/markdown-extra": "^v3.18.0", "twig/string-extra": "^v3.18.0", "twig/twig": "^v3.18.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^v3.68", + "friendsofphp/php-cs-fixer": "^v3.65.0", "phpstan/phpstan": "^2.1.1", "rector/rector": "^2.0.7", - "symfony/browser-kit": "6.4.*", - "symfony/css-selector": "6.4.*" + "symfony/browser-kit": "7.0.*", + "symfony/css-selector": "7.0.*" }, "config": { "preferred-install": { @@ -101,7 +101,7 @@ "extra": { "symfony": { "allow-contrib": false, - "require": "6.4.*" + "require": "7.0.*" } } } diff --git a/composer.lock b/composer.lock index c8932eed..836a4935 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "59980d645105fea52e615bba39e9611f", + "content-hash": "d48f8723f00f95d5d539e6d24b503b46", "packages": [ { "name": "composer/package-versions-deprecated", @@ -2651,16 +2651,16 @@ }, { "name": "oneup/flysystem-bundle", - "version": "4.12.3", + "version": "4.12.4", "source": { "type": "git", "url": "https://github.com/1up-lab/OneupFlysystemBundle.git", - "reference": "23d7186524a9c6236662c452891b1175cb193777" + "reference": "b5f0caa9ee098e878158a46e48cfdc81bcb8bcf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/1up-lab/OneupFlysystemBundle/zipball/23d7186524a9c6236662c452891b1175cb193777", - "reference": "23d7186524a9c6236662c452891b1175cb193777", + "url": "https://api.github.com/repos/1up-lab/OneupFlysystemBundle/zipball/b5f0caa9ee098e878158a46e48cfdc81bcb8bcf9", + "reference": "b5f0caa9ee098e878158a46e48cfdc81bcb8bcf9", "shasum": "" }, "require": { @@ -2734,9 +2734,9 @@ ], "support": { "issues": "https://github.com/1up-lab/OneupFlysystemBundle/issues", - "source": "https://github.com/1up-lab/OneupFlysystemBundle/tree/4.12.3" + "source": "https://github.com/1up-lab/OneupFlysystemBundle/tree/4.12.4" }, - "time": "2024-10-15T06:27:06+00:00" + "time": "2024-10-15T06:48:15+00:00" }, { "name": "oneup/uploader-bundle", @@ -3403,28 +3403,28 @@ }, { "name": "symfony/asset", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/asset.git", - "reference": "2466c17d61d14539cddf77e57ebb9cc971185302" + "reference": "0f106714bb8d857560edd2ada7f387d2f437c830" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/asset/zipball/2466c17d61d14539cddf77e57ebb9cc971185302", - "reference": "2466c17d61d14539cddf77e57ebb9cc971185302", + "url": "https://api.github.com/repos/symfony/asset/zipball/0f106714bb8d857560edd2ada7f387d2f437c830", + "reference": "0f106714bb8d857560edd2ada7f387d2f437c830", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "conflict": { - "symfony/http-foundation": "<5.4" + "symfony/http-foundation": "<6.4" }, "require-dev": { - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0" + "symfony/http-client": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3452,7 +3452,7 @@ "description": "Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/asset/tree/v6.4.13" + "source": "https://github.com/symfony/asset/tree/v7.0.8" }, "funding": [ { @@ -3468,35 +3468,35 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:07:50+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/cache", - "version": "v6.4.16", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "70d60e9a3603108563010f8592dff15a6f15dfae" + "reference": "0ee03f2aa8bb920f7041678f5f46f60998e3a7a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/70d60e9a3603108563010f8592dff15a6f15dfae", - "reference": "70d60e9a3603108563010f8592dff15a6f15dfae", + "url": "https://api.github.com/repos/symfony/cache/zipball/0ee03f2aa8bb920f7041678f5f46f60998e3a7a8", + "reference": "0ee03f2aa8bb920f7041678f5f46f60998e3a7a8", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/cache": "^2.0|^3.0", "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3", - "symfony/var-exporter": "^6.3.6|^7.0" + "symfony/var-exporter": "^6.4|^7.0" }, "conflict": { - "doctrine/dbal": "<2.13.1", - "symfony/dependency-injection": "<5.4", - "symfony/http-kernel": "<5.4", - "symfony/var-dumper": "<5.4" + "doctrine/dbal": "<3.6", + "symfony/dependency-injection": "<6.4", + "symfony/http-kernel": "<6.4", + "symfony/var-dumper": "<6.4" }, "provide": { "psr/cache-implementation": "2.0|3.0", @@ -3505,15 +3505,15 @@ }, "require-dev": { "cache/integration-tests": "dev-master", - "doctrine/dbal": "^2.13.1|^3|^4", + "doctrine/dbal": "^3.6|^4", "predis/predis": "^1.1|^2.0", "psr/simple-cache": "^1.0|^2.0|^3.0", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/filesystem": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/filesystem": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3548,7 +3548,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.4.16" + "source": "https://github.com/symfony/cache/tree/v7.0.10" }, "funding": [ { @@ -3564,7 +3564,7 @@ "type": "tidelift" } ], - "time": "2024-11-20T10:10:54+00:00" + "time": "2024-07-17T06:06:58+00:00" }, { "name": "symfony/cache-contracts", @@ -3644,20 +3644,20 @@ }, { "name": "symfony/clock", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/clock.git", - "reference": "b2bf55c4dd115003309eafa87ee7df9ed3dde81b" + "reference": "817e27b87908632f647f8684a603b70ec89b75e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/clock/zipball/b2bf55c4dd115003309eafa87ee7df9ed3dde81b", - "reference": "b2bf55c4dd115003309eafa87ee7df9ed3dde81b", + "url": "https://api.github.com/repos/symfony/clock/zipball/817e27b87908632f647f8684a603b70ec89b75e4", + "reference": "817e27b87908632f647f8684a603b70ec89b75e4", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/clock": "^1.0", "symfony/polyfill-php83": "^1.28" }, @@ -3698,7 +3698,7 @@ "time" ], "support": { - "source": "https://github.com/symfony/clock/tree/v6.4.13" + "source": "https://github.com/symfony/clock/tree/v7.0.8" }, "funding": [ { @@ -3714,38 +3714,38 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/config", - "version": "v6.4.14", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "4e55e7e4ffddd343671ea972216d4509f46c22ef" + "reference": "f8a8fb0c2d0a188a00a2dd5af8a4eb070641ec60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/4e55e7e4ffddd343671ea972216d4509f46c22ef", - "reference": "4e55e7e4ffddd343671ea972216d4509f46c22ef", + "url": "https://api.github.com/repos/symfony/config/zipball/f8a8fb0c2d0a188a00a2dd5af8a4eb070641ec60", + "reference": "f8a8fb0c2d0a188a00a2dd5af8a4eb070641ec60", "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": { @@ -3773,7 +3773,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.14" + "source": "https://github.com/symfony/config/tree/v7.0.8" }, "funding": [ { @@ -3789,51 +3789,50 @@ "type": "tidelift" } ], - "time": "2024-11-04T11:33:53+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/console", - "version": "v6.4.17", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "799445db3f15768ecc382ac5699e6da0520a0a04" + "reference": "f381ef0bc6675a29796d7055088a7193a9e6edff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04", - "reference": "799445db3f15768ecc382ac5699e6da0520a0a04", + "url": "https://api.github.com/repos/symfony/console/zipball/f381ef0bc6675a29796d7055088a7193a9e6edff", + "reference": "f381ef0bc6675a29796d7055088a7193a9e6edff", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" + "symfony/string": "^6.4|^7.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3867,7 +3866,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.17" + "source": "https://github.com/symfony/console/tree/v7.0.10" }, "funding": [ { @@ -3883,37 +3882,37 @@ "type": "tidelift" } ], - "time": "2024-12-07T12:07:30+00:00" + "time": "2024-07-26T12:31:22+00:00" }, { "name": "symfony/debug-bundle", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/debug-bundle.git", - "reference": "7bcfaff39e094cc09455201916d016d9b2ae08ff" + "reference": "aa024d28ce7ce0c6a16ee57c066838bece92893f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug-bundle/zipball/7bcfaff39e094cc09455201916d016d9b2ae08ff", - "reference": "7bcfaff39e094cc09455201916d016d9b2ae08ff", + "url": "https://api.github.com/repos/symfony/debug-bundle/zipball/aa024d28ce7ce0c6a16ee57c066838bece92893f", + "reference": "aa024d28ce7ce0c6a16ee57c066838bece92893f", "shasum": "" }, "require": { "ext-xml": "*", - "php": ">=8.1", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/twig-bridge": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "php": ">=8.2", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/twig-bridge": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "conflict": { - "symfony/config": "<5.4", - "symfony/dependency-injection": "<5.4" + "symfony/config": "<6.4", + "symfony/dependency-injection": "<6.4" }, "require-dev": { - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/web-profiler-bundle": "^5.4|^6.0|^7.0" + "symfony/config": "^6.4|^7.0", + "symfony/web-profiler-bundle": "^6.4|^7.0" }, "type": "symfony-bundle", "autoload": { @@ -3941,7 +3940,7 @@ "description": "Provides a tight integration of the Symfony VarDumper component and the ServerLogCommand from MonologBridge into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug-bundle/tree/v6.4.13" + "source": "https://github.com/symfony/debug-bundle/tree/v7.0.8" }, "funding": [ { @@ -3957,44 +3956,43 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/dependency-injection", - "version": "v6.4.16", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "7a379d8871f6a36f01559c14e11141cc02eb8dc8" + "reference": "01dcf140b25aa351383f2d3829acbcedd9784ee9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/7a379d8871f6a36f01559c14e11141cc02eb8dc8", - "reference": "7a379d8871f6a36f01559c14e11141cc02eb8dc8", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/01dcf140b25aa351383f2d3829acbcedd9784ee9", + "reference": "01dcf140b25aa351383f2d3829acbcedd9784ee9", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/container": "^1.1|^2.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/service-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.2.10|^7.0" + "symfony/service-contracts": "^3.3", + "symfony/var-exporter": "^6.4|^7.0" }, "conflict": { "ext-psr": "<1.1|>=2", - "symfony/config": "<6.1", - "symfony/finder": "<5.4", - "symfony/proxy-manager-bridge": "<6.3", - "symfony/yaml": "<5.4" + "symfony/config": "<6.4", + "symfony/finder": "<6.4", + "symfony/yaml": "<6.4" }, "provide": { "psr/container-implementation": "1.1|2.0", "symfony/service-implementation": "1.1|2.0|3.0" }, "require-dev": { - "symfony/config": "^6.1|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/config": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4022,7 +4020,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.4.16" + "source": "https://github.com/symfony/dependency-injection/tree/v7.0.10" }, "funding": [ { @@ -4038,7 +4036,7 @@ "type": "tidelift" } ], - "time": "2024-11-25T14:52:46+00:00" + "time": "2024-07-26T07:32:22+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4109,67 +4107,65 @@ }, { "name": "symfony/doctrine-bridge", - "version": "v6.4.17", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "2ba7e747a944b69f9f583c35173560afebbff995" + "reference": "462b41a82739386c1b5c6304c572ce1790c57dd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/2ba7e747a944b69f9f583c35173560afebbff995", - "reference": "2ba7e747a944b69f9f583c35173560afebbff995", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/462b41a82739386c1b5c6304c572ce1790c57dd1", + "reference": "462b41a82739386c1b5c6304c572ce1790c57dd1", "shasum": "" }, "require": { - "doctrine/event-manager": "^1.2|^2", + "doctrine/event-manager": "^2", "doctrine/persistence": "^3.1", - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "doctrine/dbal": "<2.13.1", + "doctrine/dbal": "<3.6", "doctrine/lexer": "<1.1", "doctrine/orm": "<2.15", - "symfony/cache": "<5.4", - "symfony/dependency-injection": "<6.2", - "symfony/form": "<5.4.38|>=6,<6.4.6|>=7,<7.0.6", - "symfony/http-foundation": "<6.3", - "symfony/http-kernel": "<6.2", - "symfony/lock": "<6.3", - "symfony/messenger": "<5.4", - "symfony/property-info": "<5.4", - "symfony/security-bundle": "<5.4", + "symfony/cache": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/form": "<6.4.6|>=7,<7.0.6", + "symfony/http-foundation": "<6.4", + "symfony/http-kernel": "<6.4", + "symfony/lock": "<6.4", + "symfony/messenger": "<6.4", + "symfony/property-info": "<6.4", + "symfony/security-bundle": "<6.4", "symfony/security-core": "<6.4", "symfony/validator": "<6.4" }, "require-dev": { "doctrine/collections": "^1.0|^2.0", - "doctrine/data-fixtures": "^1.1|^2", - "doctrine/dbal": "^2.13.1|^3|^4", + "doctrine/data-fixtures": "^1.1", + "doctrine/dbal": "^3.6|^4", "doctrine/orm": "^2.15|^3", "psr/log": "^1|^2|^3", - "symfony/cache": "^5.4|^6.0|^7.0", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^6.2|^7.0", - "symfony/doctrine-messenger": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/form": "^5.4.38|^6.4.6|^7.0.6", - "symfony/http-kernel": "^6.3|^7.0", - "symfony/lock": "^6.3|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/property-access": "^5.4|^6.0|^7.0", - "symfony/property-info": "^5.4|^6.0|^7.0", - "symfony/proxy-manager-bridge": "^6.4", + "symfony/cache": "^6.4|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/doctrine-messenger": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/form": "^6.4.6|^7.0.6", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/property-access": "^6.4|^7.0", + "symfony/property-info": "^6.4|^7.0", "symfony/security-core": "^6.4|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/translation": "^5.4|^6.0|^7.0", - "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/translation": "^6.4|^7.0", + "symfony/uid": "^6.4|^7.0", "symfony/validator": "^6.4|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/var-dumper": "^6.4|^7.0" }, "type": "symfony-bridge", "autoload": { @@ -4197,7 +4193,7 @@ "description": "Provides integration for Doctrine with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-bridge/tree/v6.4.17" + "source": "https://github.com/symfony/doctrine-bridge/tree/v7.0.10" }, "funding": [ { @@ -4213,32 +4209,32 @@ "type": "tidelift" } ], - "time": "2024-12-18T10:42:42+00:00" + "time": "2024-07-26T12:31:22+00:00" }, { "name": "symfony/dotenv", - "version": "v6.4.16", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/dotenv.git", - "reference": "1ac5e7e7e862d4d574258daf08bd569ba926e4a5" + "reference": "3a0c9ce95ed71a1ad297604742a46085e808c7a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/1ac5e7e7e862d4d574258daf08bd569ba926e4a5", - "reference": "1ac5e7e7e862d4d574258daf08bd569ba926e4a5", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/3a0c9ce95ed71a1ad297604742a46085e808c7a3", + "reference": "3a0c9ce95ed71a1ad297604742a46085e808c7a3", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "conflict": { - "symfony/console": "<5.4", - "symfony/process": "<5.4" + "symfony/console": "<6.4", + "symfony/process": "<6.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0" + "symfony/console": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4271,7 +4267,7 @@ "environment" ], "support": { - "source": "https://github.com/symfony/dotenv/tree/v6.4.16" + "source": "https://github.com/symfony/dotenv/tree/v7.0.10" }, "funding": [ { @@ -4287,26 +4283,26 @@ "type": "tidelift" } ], - "time": "2024-11-27T11:08:19+00:00" + "time": "2024-07-09T18:35:37+00:00" }, { "name": "symfony/error-handler", - "version": "v6.4.17", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "37ad2380e8c1a8cf62a1200a5c10080b679b446c" + "reference": "fd1cc26512b502c8fe8dfe90b67a9d8228bbafa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/37ad2380e8c1a8cf62a1200a5c10080b679b446c", - "reference": "37ad2380e8c1a8cf62a1200a5c10080b679b446c", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/fd1cc26512b502c8fe8dfe90b67a9d8228bbafa2", + "reference": "fd1cc26512b502c8fe8dfe90b67a9d8228bbafa2", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/var-dumper": "^6.4|^7.0" }, "conflict": { "symfony/deprecation-contracts": "<2.5", @@ -4315,7 +4311,7 @@ "require-dev": { "symfony/deprecation-contracts": "^2.5|^3", "symfony/http-kernel": "^6.4|^7.0", - "symfony/serializer": "^5.4|^6.0|^7.0" + "symfony/serializer": "^6.4|^7.0" }, "bin": [ "Resources/bin/patch-type-declarations" @@ -4346,7 +4342,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.4.17" + "source": "https://github.com/symfony/error-handler/tree/v7.0.10" }, "funding": [ { @@ -4362,28 +4358,28 @@ "type": "tidelift" } ], - "time": "2024-12-06T13:30:51+00:00" + "time": "2024-07-26T12:31:22+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e" + "reference": "5c30c7fc4ccf847e4dd8a18b6158cb1f77702550" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", - "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5c30c7fc4ccf847e4dd8a18b6158cb1f77702550", + "reference": "5c30c7fc4ccf847e4dd8a18b6158cb1f77702550", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4", + "symfony/dependency-injection": "<6.4", "symfony/service-contracts": "<2.5" }, "provide": { @@ -4392,13 +4388,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^5.4|^6.0|^7.0" + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4426,7 +4422,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.13" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.8" }, "funding": [ { @@ -4442,7 +4438,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -4522,22 +4518,21 @@ }, { "name": "symfony/expression-language", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", - "reference": "3524904fb026356a5230cd197f9a4e6a61e0e7df" + "reference": "8e64bd4eb4c4dd180fc7de9c72011c49ebbdc822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/3524904fb026356a5230cd197f9a4e6a61e0e7df", - "reference": "3524904fb026356a5230cd197f9a4e6a61e0e7df", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/8e64bd4eb4c4dd180fc7de9c72011c49ebbdc822", + "reference": "8e64bd4eb4c4dd180fc7de9c72011c49ebbdc822", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/cache": "^5.4|^6.0|^7.0", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", + "symfony/cache": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3" }, "type": "library", @@ -4566,7 +4561,7 @@ "description": "Provides an engine that can compile and evaluate expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/expression-language/tree/v6.4.13" + "source": "https://github.com/symfony/expression-language/tree/v7.0.8" }, "funding": [ { @@ -4582,29 +4577,29 @@ "type": "tidelift" } ], - "time": "2024-10-09T08:40:40+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/filesystem", - "version": "v6.4.13", + "version": "v7.0.9", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3" + "reference": "f6b35b0de74a2577196114eef957f2414b5599d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/4856c9cf585d5a0313d8d35afd681a526f038dd3", - "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/f6b35b0de74a2577196114eef957f2414b5599d5", + "reference": "f6b35b0de74a2577196114eef957f2414b5599d5", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "symfony/process": "^5.4|^6.4|^7.0" + "symfony/process": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4632,7 +4627,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.13" + "source": "https://github.com/symfony/filesystem/tree/v7.0.9" }, "funding": [ { @@ -4648,27 +4643,27 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:07:50+00:00" + "time": "2024-06-28T09:58:46+00:00" }, { "name": "symfony/finder", - "version": "v6.4.17", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7" + "reference": "25b267662f297a8479bf6cf88fdc92e4b16cf24c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7", - "reference": "1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7", + "url": "https://api.github.com/repos/symfony/finder/zipball/25b267662f297a8479bf6cf88fdc92e4b16cf24c", + "reference": "25b267662f297a8479bf6cf88fdc92e4b16cf24c", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "symfony/filesystem": "^6.0|^7.0" + "symfony/filesystem": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4696,7 +4691,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.4.17" + "source": "https://github.com/symfony/finder/tree/v7.0.10" }, "funding": [ { @@ -4712,7 +4707,7 @@ "type": "tidelift" } ], - "time": "2024-12-29T13:51:37+00:00" + "time": "2024-07-24T07:06:56+00:00" }, { "name": "symfony/flex", @@ -4784,56 +4779,55 @@ }, { "name": "symfony/form", - "version": "v6.4.13", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "0fe17f90af23908ddc11dc23507db98e66572046" + "reference": "2713488dbb290a6c0d043766b0e9d0b02672c935" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/0fe17f90af23908ddc11dc23507db98e66572046", - "reference": "0fe17f90af23908ddc11dc23507db98e66572046", + "url": "https://api.github.com/repos/symfony/form/zipball/2713488dbb290a6c0d043766b0e9d0b02672c935", + "reference": "2713488dbb290a6c0d043766b0e9d0b02672c935", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/options-resolver": "^5.4|^6.0|^7.0", + "php": ">=8.2", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/options-resolver": "^6.4|^7.0", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-icu": "^1.21", "symfony/polyfill-mbstring": "~1.0", - "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/property-access": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "symfony/console": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/doctrine-bridge": "<5.4.21|>=6,<6.2.7", - "symfony/error-handler": "<5.4", - "symfony/framework-bundle": "<5.4", - "symfony/http-kernel": "<5.4", - "symfony/translation": "<5.4.35|>=6.0,<6.3.12|>=6.4,<6.4.3|>=7.0,<7.0.3", + "symfony/console": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/doctrine-bridge": "<6.4", + "symfony/error-handler": "<6.4", + "symfony/framework-bundle": "<6.4", + "symfony/http-kernel": "<6.4", + "symfony/translation": "<6.4.3|>=7.0,<7.0.3", "symfony/translation-contracts": "<2.5", - "symfony/twig-bridge": "<6.3" + "symfony/twig-bridge": "<6.4" }, "require-dev": { "doctrine/collections": "^1.0|^2.0", - "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/expression-language": "^5.4|^6.0|^7.0", - "symfony/html-sanitizer": "^6.1|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/intl": "^5.4|^6.0|^7.0", - "symfony/security-core": "^6.2|^7.0", - "symfony/security-csrf": "^5.4|^6.0|^7.0", - "symfony/translation": "^5.4.35|~6.3.12|^6.4.3|^7.0.3", - "symfony/uid": "^5.4|^6.0|^7.0", - "symfony/validator": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^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/expression-language": "^6.4|^7.0", + "symfony/html-sanitizer": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/security-core": "^6.4|^7.0", + "symfony/security-csrf": "^6.4|^7.0", + "symfony/translation": "^6.4.3|^7.0.3", + "symfony/uid": "^6.4|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4861,7 +4855,7 @@ "description": "Allows to easily create, process and reuse HTML forms", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/form/tree/v6.4.13" + "source": "https://github.com/symfony/form/tree/v7.0.10" }, "funding": [ { @@ -4877,112 +4871,109 @@ "type": "tidelift" } ], - "time": "2024-10-09T08:40:40+00:00" + "time": "2024-07-19T08:29:37+00:00" }, { "name": "symfony/framework-bundle", - "version": "v6.4.17", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "17d8ae2e7aa77154f942e8ac48849ac718b0963f" + "reference": "07a37173aace78420ccaf5eceaf4a79c7dfab375" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/17d8ae2e7aa77154f942e8ac48849ac718b0963f", - "reference": "17d8ae2e7aa77154f942e8ac48849ac718b0963f", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/07a37173aace78420ccaf5eceaf4a79c7dfab375", + "reference": "07a37173aace78420ccaf5eceaf4a79c7dfab375", "shasum": "" }, "require": { "composer-runtime-api": ">=2.1", "ext-xml": "*", - "php": ">=8.1", - "symfony/cache": "^5.4|^6.0|^7.0", - "symfony/config": "^6.1|^7.0", - "symfony/dependency-injection": "^6.4.12|^7.0", + "php": ">=8.2", + "symfony/cache": "^6.4|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/error-handler": "^6.1|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/filesystem": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/filesystem": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4", + "symfony/http-kernel": "^6.4|^7.0", "symfony/polyfill-mbstring": "~1.0", "symfony/routing": "^6.4|^7.0" }, "conflict": { - "doctrine/annotations": "<1.13.1", "doctrine/persistence": "<1.3", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/asset": "<5.4", + "symfony/asset": "<6.4", "symfony/asset-mapper": "<6.4", - "symfony/clock": "<6.3", - "symfony/console": "<5.4|>=7.0", + "symfony/clock": "<6.4", + "symfony/console": "<6.4", "symfony/dom-crawler": "<6.4", - "symfony/dotenv": "<5.4", - "symfony/form": "<5.4", - "symfony/http-client": "<6.3", - "symfony/lock": "<5.4", - "symfony/mailer": "<5.4", - "symfony/messenger": "<6.3", + "symfony/dotenv": "<6.4", + "symfony/form": "<6.4", + "symfony/http-client": "<6.4", + "symfony/lock": "<6.4", + "symfony/mailer": "<6.4", + "symfony/messenger": "<6.4", "symfony/mime": "<6.4", - "symfony/property-access": "<5.4", - "symfony/property-info": "<5.4", - "symfony/runtime": "<5.4.45|>=6.0,<6.4.13|>=7.0,<7.1.6", + "symfony/property-access": "<6.4", + "symfony/property-info": "<6.4", "symfony/scheduler": "<6.4.4|>=7.0.0,<7.0.4", - "symfony/security-core": "<5.4", - "symfony/security-csrf": "<5.4", + "symfony/security-core": "<6.4", + "symfony/security-csrf": "<6.4", "symfony/serializer": "<6.4", - "symfony/stopwatch": "<5.4", + "symfony/stopwatch": "<6.4", "symfony/translation": "<6.4", - "symfony/twig-bridge": "<5.4", - "symfony/twig-bundle": "<5.4", + "symfony/twig-bridge": "<6.4", + "symfony/twig-bundle": "<6.4", "symfony/validator": "<6.4", "symfony/web-profiler-bundle": "<6.4", "symfony/workflow": "<6.4" }, "require-dev": { - "doctrine/annotations": "^1.13.1|^2", "doctrine/persistence": "^1.3|^2|^3", "dragonmantank/cron-expression": "^3.1", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", "seld/jsonlint": "^1.10", - "symfony/asset": "^5.4|^6.0|^7.0", + "symfony/asset": "^6.4|^7.0", "symfony/asset-mapper": "^6.4|^7.0", - "symfony/browser-kit": "^5.4|^6.0|^7.0", - "symfony/clock": "^6.2|^7.0", - "symfony/console": "^5.4.9|^6.0.9|^7.0", - "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/browser-kit": "^6.4|^7.0", + "symfony/clock": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/css-selector": "^6.4|^7.0", "symfony/dom-crawler": "^6.4|^7.0", - "symfony/dotenv": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/form": "^5.4|^6.0|^7.0", - "symfony/html-sanitizer": "^6.1|^7.0", - "symfony/http-client": "^6.3|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/mailer": "^5.4|^6.0|^7.0", - "symfony/messenger": "^6.3|^7.0", + "symfony/dotenv": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/form": "^6.4|^7.0", + "symfony/html-sanitizer": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/mailer": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", "symfony/mime": "^6.4|^7.0", - "symfony/notifier": "^5.4|^6.0|^7.0", + "symfony/notifier": "^6.4|^7.0", "symfony/polyfill-intl-icu": "~1.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/property-info": "^5.4|^6.0|^7.0", - "symfony/rate-limiter": "^5.4|^6.0|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/property-info": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0", "symfony/scheduler": "^6.4.4|^7.0.4", - "symfony/security-bundle": "^5.4|^6.0|^7.0", - "symfony/semaphore": "^5.4|^6.0|^7.0", + "symfony/security-bundle": "^6.4|^7.0", + "symfony/semaphore": "^6.4|^7.0", "symfony/serializer": "^6.4|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/string": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/string": "^6.4|^7.0", "symfony/translation": "^6.4|^7.0", - "symfony/twig-bundle": "^5.4|^6.0|^7.0", - "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/twig-bundle": "^6.4|^7.0", + "symfony/uid": "^6.4|^7.0", "symfony/validator": "^6.4|^7.0", - "symfony/web-link": "^5.4|^6.0|^7.0", + "symfony/web-link": "^6.4|^7.0", "symfony/workflow": "^6.4|^7.0", - "symfony/yaml": "^5.4|^6.0|^7.0", - "twig/twig": "^2.10|^3.0.4" + "symfony/yaml": "^6.4|^7.0", + "twig/twig": "^3.0.4" }, "type": "symfony-bundle", "autoload": { @@ -5010,7 +5001,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v6.4.17" + "source": "https://github.com/symfony/framework-bundle/tree/v7.0.10" }, "funding": [ { @@ -5026,32 +5017,31 @@ "type": "tidelift" } ], - "time": "2024-12-19T14:08:41+00:00" + "time": "2024-07-26T13:24:26+00:00" }, { "name": "symfony/http-client", - "version": "v6.4.17", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "88898d842eb29d7e1a903724c94e90a6ca9c0509" + "reference": "3ae495c67ba9c3b504fecd070a6c28b4143088cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/88898d842eb29d7e1a903724c94e90a6ca9c0509", - "reference": "88898d842eb29d7e1a903724c94e90a6ca9c0509", + "url": "https://api.github.com/repos/symfony/http-client/zipball/3ae495c67ba9c3b504fecd070a6c28b4143088cf", + "reference": "3ae495c67ba9c3b504fecd070a6c28b4143088cf", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "~3.4.4|^3.5.2", + "symfony/http-client-contracts": "^3.4.1", "symfony/service-contracts": "^2.5|^3" }, "conflict": { "php-http/discovery": "<1.15", - "symfony/http-foundation": "<6.3" + "symfony/http-foundation": "<6.4" }, "provide": { "php-http/async-client-implementation": "*", @@ -5068,11 +5058,11 @@ "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", "psr/http-client": "^1.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0" + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -5103,7 +5093,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.4.17" + "source": "https://github.com/symfony/http-client/tree/v7.0.10" }, "funding": [ { @@ -5119,7 +5109,7 @@ "type": "tidelift" } ], - "time": "2024-12-18T12:18:31+00:00" + "time": "2024-07-17T06:06:58+00:00" }, { "name": "symfony/http-client-contracts", @@ -5201,36 +5191,36 @@ }, { "name": "symfony/http-foundation", - "version": "v6.4.16", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57" + "reference": "e7bb762b114f2f1e2610322e025709df08211f1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/431771b7a6f662f1575b3cfc8fd7617aa9864d57", - "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e7bb762b114f2f1e2610322e025709df08211f1d", + "reference": "e7bb762b114f2f1e2610322e025709df08211f1d", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.1", "symfony/polyfill-php83": "^1.27" }, "conflict": { - "symfony/cache": "<6.4.12|>=7.0,<7.1.5" + "doctrine/dbal": "<3.6", + "symfony/cache": "<6.4" }, "require-dev": { - "doctrine/dbal": "^2.13.1|^3|^4", + "doctrine/dbal": "^3.6|^4", "predis/predis": "^1.1|^2.0", - "symfony/cache": "^6.4.12|^7.1.5", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4|^7.0", - "symfony/mime": "^5.4|^6.0|^7.0", - "symfony/rate-limiter": "^5.4|^6.0|^7.0" + "symfony/cache": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -5258,7 +5248,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.4.16" + "source": "https://github.com/symfony/http-foundation/tree/v7.0.10" }, "funding": [ { @@ -5274,77 +5264,76 @@ "type": "tidelift" } ], - "time": "2024-11-13T18:58:10+00:00" + "time": "2024-07-26T12:37:16+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.4.17", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "c5647393c5ce11833d13e4b70fff4b571d4ac710" + "reference": "31cb30794c8bb944a4e1f6bb6aef95840b3345a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c5647393c5ce11833d13e4b70fff4b571d4ac710", - "reference": "c5647393c5ce11833d13e4b70fff4b571d4ac710", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/31cb30794c8bb944a4e1f6bb6aef95840b3345a7", + "reference": "31cb30794c8bb944a4e1f6bb6aef95840b3345a7", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.5|^3", "symfony/error-handler": "^6.4|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "symfony/browser-kit": "<5.4", - "symfony/cache": "<5.4", - "symfony/config": "<6.1", - "symfony/console": "<5.4", + "symfony/browser-kit": "<6.4", + "symfony/cache": "<6.4", + "symfony/config": "<6.4", + "symfony/console": "<6.4", "symfony/dependency-injection": "<6.4", - "symfony/doctrine-bridge": "<5.4", - "symfony/form": "<5.4", - "symfony/http-client": "<5.4", + "symfony/doctrine-bridge": "<6.4", + "symfony/form": "<6.4", + "symfony/http-client": "<6.4", "symfony/http-client-contracts": "<2.5", - "symfony/mailer": "<5.4", - "symfony/messenger": "<5.4", - "symfony/translation": "<5.4", + "symfony/mailer": "<6.4", + "symfony/messenger": "<6.4", + "symfony/translation": "<6.4", "symfony/translation-contracts": "<2.5", - "symfony/twig-bridge": "<5.4", + "symfony/twig-bridge": "<6.4", "symfony/validator": "<6.4", - "symfony/var-dumper": "<6.3", - "twig/twig": "<2.13" + "symfony/var-dumper": "<6.4", + "twig/twig": "<3.0.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", - "symfony/browser-kit": "^5.4|^6.0|^7.0", - "symfony/clock": "^6.2|^7.0", - "symfony/config": "^6.1|^7.0", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/browser-kit": "^6.4|^7.0", + "symfony/clock": "^6.4|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/css-selector": "^6.4|^7.0", "symfony/dependency-injection": "^6.4|^7.0", - "symfony/dom-crawler": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/dom-crawler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", "symfony/http-client-contracts": "^2.5|^3", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/property-access": "^5.4.5|^6.0.5|^7.0", - "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/property-access": "^6.4|^7.0", + "symfony/routing": "^6.4|^7.0", "symfony/serializer": "^6.4.4|^7.0.4", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/translation": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3", - "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/uid": "^6.4|^7.0", "symfony/validator": "^6.4|^7.0", - "symfony/var-dumper": "^5.4|^6.4|^7.0", - "symfony/var-exporter": "^6.2|^7.0", - "twig/twig": "^2.13|^3.0.4" + "symfony/var-dumper": "^6.4|^7.0", + "symfony/var-exporter": "^6.4|^7.0", + "twig/twig": "^3.0.4" }, "type": "library", "autoload": { @@ -5372,7 +5361,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.17" + "source": "https://github.com/symfony/http-kernel/tree/v7.0.10" }, "funding": [ { @@ -5388,7 +5377,7 @@ "type": "tidelift" } ], - "time": "2024-12-31T14:49:31+00:00" + "time": "2024-07-26T14:56:00+00:00" }, { "name": "symfony/maker-bundle", @@ -5484,21 +5473,20 @@ }, { "name": "symfony/mime", - "version": "v6.4.17", + "version": "v7.0.9", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232" + "reference": "60757ea7d562ae1756c1f430a6f7872156a15f32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232", - "reference": "ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232", + "url": "https://api.github.com/repos/symfony/mime/zipball/60757ea7d562ae1756c1f430a6f7872156a15f32", + "reference": "60757ea7d562ae1756c1f430a6f7872156a15f32", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, @@ -5506,17 +5494,17 @@ "egulias/email-validator": "~3.0.0", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<5.4", + "symfony/mailer": "<6.4", "symfony/serializer": "<6.4.3|>7.0,<7.0.3" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", "league/html-to-markdown": "^5.0", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.4|^7.0", - "symfony/property-access": "^5.4|^6.0|^7.0", - "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/property-access": "^6.4|^7.0", + "symfony/property-info": "^6.4|^7.0", "symfony/serializer": "^6.4.3|^7.0.3" }, "type": "library", @@ -5549,7 +5537,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.4.17" + "source": "https://github.com/symfony/mime/tree/v7.0.9" }, "funding": [ { @@ -5565,42 +5553,41 @@ "type": "tidelift" } ], - "time": "2024-12-02T11:09:41+00:00" + "time": "2024-06-28T09:58:46+00:00" }, { "name": "symfony/monolog-bridge", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bridge.git", - "reference": "9d14621e59f22c2b6d030d92d37ffe5ae1e60452" + "reference": "d80b7aeabc539538c6ae8962259ac422632d7796" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/9d14621e59f22c2b6d030d92d37ffe5ae1e60452", - "reference": "9d14621e59f22c2b6d030d92d37ffe5ae1e60452", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/d80b7aeabc539538c6ae8962259ac422632d7796", + "reference": "d80b7aeabc539538c6ae8962259ac422632d7796", "shasum": "" }, "require": { - "monolog/monolog": "^1.25.1|^2|^3", - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-kernel": "^5.4|^6.0|^7.0", + "monolog/monolog": "^3", + "php": ">=8.2", + "symfony/http-kernel": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "symfony/console": "<5.4", - "symfony/http-foundation": "<5.4", - "symfony/security-core": "<5.4" + "symfony/console": "<6.4", + "symfony/http-foundation": "<6.4", + "symfony/security-core": "<6.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/mailer": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/mime": "^5.4|^6.0|^7.0", - "symfony/security-core": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/console": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/mailer": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/security-core": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "symfony-bridge", "autoload": { @@ -5628,7 +5615,7 @@ "description": "Provides integration for Monolog with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/monolog-bridge/tree/v6.4.13" + "source": "https://github.com/symfony/monolog-bridge/tree/v7.0.8" }, "funding": [ { @@ -5644,7 +5631,7 @@ "type": "tidelift" } ], - "time": "2024-10-14T08:49:08+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/monolog-bundle", @@ -5729,20 +5716,20 @@ }, { "name": "symfony/options-resolver", - "version": "v6.4.16", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "368128ad168f20e22c32159b9f761e456cec0c78" + "reference": "19eecfc6f1b0e4b093db7f4a71eedc91843e711a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/368128ad168f20e22c32159b9f761e456cec0c78", - "reference": "368128ad168f20e22c32159b9f761e456cec0c78", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/19eecfc6f1b0e4b093db7f4a71eedc91843e711a", + "reference": "19eecfc6f1b0e4b093db7f4a71eedc91843e711a", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", @@ -5776,7 +5763,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.4.16" + "source": "https://github.com/symfony/options-resolver/tree/v7.0.8" }, "funding": [ { @@ -5792,31 +5779,31 @@ "type": "tidelift" } ], - "time": "2024-11-20T10:57:02+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/password-hasher", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/password-hasher.git", - "reference": "e97a1b31f60b8bdfc1fdedab4398538da9441d47" + "reference": "25c66dba8ca72c9636b16e9a4b33d18554969a3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/password-hasher/zipball/e97a1b31f60b8bdfc1fdedab4398538da9441d47", - "reference": "e97a1b31f60b8bdfc1fdedab4398538da9441d47", + "url": "https://api.github.com/repos/symfony/password-hasher/zipball/25c66dba8ca72c9636b16e9a4b33d18554969a3f", + "reference": "25c66dba8ca72c9636b16e9a4b33d18554969a3f", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "conflict": { - "symfony/security-core": "<5.4" + "symfony/security-core": "<6.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/security-core": "^5.4|^6.0|^7.0" + "symfony/console": "^6.4|^7.0", + "symfony/security-core": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -5848,7 +5835,7 @@ "password" ], "support": { - "source": "https://github.com/symfony/password-hasher/tree/v6.4.13" + "source": "https://github.com/symfony/password-hasher/tree/v7.0.8" }, "funding": [ { @@ -5864,31 +5851,31 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v6.4.16", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "cebafe2f1ad2d1e745c1015b7c2519592341e4e6" + "reference": "d2e5a1a4db3993707172c490cea8e9b252d2f677" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/cebafe2f1ad2d1e745c1015b7c2519592341e4e6", - "reference": "cebafe2f1ad2d1e745c1015b7c2519592341e4e6", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/d2e5a1a4db3993707172c490cea8e9b252d2f677", + "reference": "d2e5a1a4db3993707172c490cea8e9b252d2f677", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.2.5" }, "conflict": { "phpunit/phpunit": "<7.5|9.1.2" }, "require-dev": { "symfony/deprecation-contracts": "^2.5|^3.0", - "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^5.4|^6.4|^7.0", "symfony/polyfill-php81": "^1.27" }, "bin": [ @@ -5930,7 +5917,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.16" + "source": "https://github.com/symfony/phpunit-bridge/tree/v7.0.10" }, "funding": [ { @@ -5946,7 +5933,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T15:06:22+00:00" + "time": "2024-07-26T12:31:22+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -6667,20 +6654,20 @@ }, { "name": "symfony/process", - "version": "v6.4.15", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3cb242f059c14ae08591c5c4087d1fe443564392" + "reference": "a358943d5a15277fc6001f47541c08b7d815338f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3cb242f059c14ae08591c5c4087d1fe443564392", - "reference": "3cb242f059c14ae08591c5c4087d1fe443564392", + "url": "https://api.github.com/repos/symfony/process/zipball/a358943d5a15277fc6001f47541c08b7d815338f", + "reference": "a358943d5a15277fc6001f47541c08b7d815338f", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -6708,7 +6695,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.15" + "source": "https://github.com/symfony/process/tree/v7.0.8" }, "funding": [ { @@ -6724,29 +6711,28 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:19:14+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/property-access", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "8cc779d88d12e440adaa26387bcfc25744064afe" + "reference": "ca11e9661ea88664873dba66412525fe301dd744" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/8cc779d88d12e440adaa26387bcfc25744064afe", - "reference": "8cc779d88d12e440adaa26387bcfc25744064afe", + "url": "https://api.github.com/repos/symfony/property-access/zipball/ca11e9661ea88664873dba66412525fe301dd744", + "reference": "ca11e9661ea88664873dba66412525fe301dd744", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/property-info": "^5.4|^6.0|^7.0" + "php": ">=8.2", + "symfony/property-info": "^6.4|^7.0" }, "require-dev": { - "symfony/cache": "^5.4|^6.0|^7.0" + "symfony/cache": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -6785,7 +6771,7 @@ "reflection" ], "support": { - "source": "https://github.com/symfony/property-access/tree/v6.4.13" + "source": "https://github.com/symfony/property-access/tree/v7.0.8" }, "funding": [ { @@ -6801,39 +6787,38 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/property-info", - "version": "v6.4.17", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "38b125d78e67668159f75383a293ec0c5d3f2963" + "reference": "ee413c259f1af416e306709ef699102afd56c27a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/38b125d78e67668159f75383a293ec0c5d3f2963", - "reference": "38b125d78e67668159f75383a293ec0c5d3f2963", + "url": "https://api.github.com/repos/symfony/property-info/zipball/ee413c259f1af416e306709ef699102afd56c27a", + "reference": "ee413c259f1af416e306709ef699102afd56c27a", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/string": "^5.4|^6.0|^7.0" + "php": ">=8.2", + "symfony/string": "^6.4|^7.0" }, "conflict": { - "doctrine/annotations": "<1.12", "phpdocumentor/reflection-docblock": "<5.2", "phpdocumentor/type-resolver": "<1.5.1", - "symfony/dependency-injection": "<5.4|>=6.0,<6.4" + "symfony/dependency-injection": "<6.4", + "symfony/serializer": "<6.4" }, "require-dev": { - "doctrine/annotations": "^1.12|^2", "phpdocumentor/reflection-docblock": "^5.2", - "phpstan/phpdoc-parser": "^1.0|^2.0", - "symfony/cache": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/serializer": "^5.4|^6.4|^7.0" + "phpstan/phpdoc-parser": "^1.0", + "symfony/cache": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -6869,7 +6854,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v6.4.17" + "source": "https://github.com/symfony/property-info/tree/v7.0.10" }, "funding": [ { @@ -6885,40 +6870,38 @@ "type": "tidelift" } ], - "time": "2024-12-26T19:01:29+00:00" + "time": "2024-07-26T07:32:22+00:00" }, { "name": "symfony/routing", - "version": "v6.4.16", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220" + "reference": "ed9fe56db2eb080b4fc1ecea9d66277ef6d1fb8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/91e02e606b4b705c2f4fb42f7e7708b7923a3220", - "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220", + "url": "https://api.github.com/repos/symfony/routing/zipball/ed9fe56db2eb080b4fc1ecea9d66277ef6d1fb8a", + "reference": "ed9fe56db2eb080b4fc1ecea9d66277ef6d1fb8a", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { - "doctrine/annotations": "<1.12", - "symfony/config": "<6.2", - "symfony/dependency-injection": "<5.4", - "symfony/yaml": "<5.4" + "symfony/config": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/yaml": "<6.4" }, "require-dev": { - "doctrine/annotations": "^1.12|^2", "psr/log": "^1|^2|^3", - "symfony/config": "^6.2|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -6952,7 +6935,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.4.16" + "source": "https://github.com/symfony/routing/tree/v7.0.10" }, "funding": [ { @@ -6968,35 +6951,35 @@ "type": "tidelift" } ], - "time": "2024-11-13T15:31:34+00:00" + "time": "2024-07-17T06:06:58+00:00" }, { "name": "symfony/runtime", - "version": "v6.4.14", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/runtime.git", - "reference": "4facd4174f45cd37c65860403412b67c7381136a" + "reference": "ea34522c447dd91a2b31cb330ee4540a56ba53f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/runtime/zipball/4facd4174f45cd37c65860403412b67c7381136a", - "reference": "4facd4174f45cd37c65860403412b67c7381136a", + "url": "https://api.github.com/repos/symfony/runtime/zipball/ea34522c447dd91a2b31cb330ee4540a56ba53f6", + "reference": "ea34522c447dd91a2b31cb330ee4540a56ba53f6", "shasum": "" }, "require": { "composer-plugin-api": "^1.0|^2.0", - "php": ">=8.1" + "php": ">=8.2" }, "conflict": { - "symfony/dotenv": "<5.4" + "symfony/dotenv": "<6.4" }, "require-dev": { - "composer/composer": "^1.0.2|^2.0", - "symfony/console": "^5.4.9|^6.0.9|^7.0", - "symfony/dotenv": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0" + "composer/composer": "^2.6", + "symfony/console": "^6.4|^7.0", + "symfony/dotenv": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0" }, "type": "composer-plugin", "extra": { @@ -7031,7 +7014,7 @@ "runtime" ], "support": { - "source": "https://github.com/symfony/runtime/tree/v6.4.14" + "source": "https://github.com/symfony/runtime/tree/v7.0.8" }, "funding": [ { @@ -7047,69 +7030,68 @@ "type": "tidelift" } ], - "time": "2024-11-05T16:39:55+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/security-bundle", - "version": "v6.4.13", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "181d1fcf5f88ef8212ed7f6434e5ff51c9d7dff3" + "reference": "c9a134cffcb4ca10bebe22a69f1322b2db3082e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/181d1fcf5f88ef8212ed7f6434e5ff51c9d7dff3", - "reference": "181d1fcf5f88ef8212ed7f6434e5ff51c9d7dff3", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/c9a134cffcb4ca10bebe22a69f1322b2db3082e1", + "reference": "c9a134cffcb4ca10bebe22a69f1322b2db3082e1", "shasum": "" }, "require": { "composer-runtime-api": ">=2.1", "ext-xml": "*", - "php": ">=8.1", - "symfony/clock": "^6.3|^7.0", - "symfony/config": "^6.1|^7.0", - "symfony/dependency-injection": "^6.4.11|^7.1.4", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^6.2|^7.0", - "symfony/http-kernel": "^6.2", - "symfony/password-hasher": "^5.4|^6.0|^7.0", - "symfony/security-core": "^6.2|^7.0", - "symfony/security-csrf": "^5.4|^6.0|^7.0", - "symfony/security-http": "^6.3.6|^7.0", + "php": ">=8.2", + "symfony/clock": "^6.4|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/password-hasher": "^6.4|^7.0", + "symfony/security-core": "^6.4|^7.0", + "symfony/security-csrf": "^6.4|^7.0", + "symfony/security-http": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "symfony/browser-kit": "<5.4", - "symfony/console": "<5.4", + "symfony/browser-kit": "<6.4", + "symfony/console": "<6.4", "symfony/framework-bundle": "<6.4", - "symfony/http-client": "<5.4", - "symfony/ldap": "<5.4", + "symfony/http-client": "<6.4", + "symfony/ldap": "<6.4", "symfony/serializer": "<6.4", - "symfony/twig-bundle": "<5.4", + "symfony/twig-bundle": "<6.4", "symfony/validator": "<6.4" }, "require-dev": { - "symfony/asset": "^5.4|^6.0|^7.0", - "symfony/browser-kit": "^5.4|^6.0|^7.0", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/css-selector": "^5.4|^6.0|^7.0", - "symfony/dom-crawler": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/form": "^5.4|^6.0|^7.0", + "symfony/asset": "^6.4|^7.0", + "symfony/browser-kit": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/css-selector": "^6.4|^7.0", + "symfony/dom-crawler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/form": "^6.4|^7.0", "symfony/framework-bundle": "^6.4|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/ldap": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/rate-limiter": "^5.4|^6.0|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/ldap": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0", "symfony/serializer": "^6.4|^7.0", - "symfony/translation": "^5.4|^6.0|^7.0", - "symfony/twig-bridge": "^5.4|^6.0|^7.0", - "symfony/twig-bundle": "^5.4|^6.0|^7.0", + "symfony/translation": "^6.4|^7.0", + "symfony/twig-bridge": "^6.4|^7.0", + "symfony/twig-bundle": "^6.4|^7.0", "symfony/validator": "^6.4|^7.0", - "symfony/yaml": "^5.4|^6.0|^7.0", - "twig/twig": "^2.13|^3.0.4", + "symfony/yaml": "^6.4|^7.0", + "twig/twig": "^3.0.4", "web-token/jwt-checker": "^3.1", "web-token/jwt-signature-algorithm-ecdsa": "^3.1", "web-token/jwt-signature-algorithm-eddsa": "^3.1", @@ -7143,7 +7125,7 @@ "description": "Provides a tight integration of the Security component into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-bundle/tree/v6.4.13" + "source": "https://github.com/symfony/security-bundle/tree/v7.0.10" }, "funding": [ { @@ -7159,48 +7141,46 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-07-24T07:06:56+00:00" }, { "name": "symfony/security-core", - "version": "v6.4.16", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/security-core.git", - "reference": "19cdb7de86e556202ab16e0cffd1a97348231bc0" + "reference": "6048754a72768c43419129d3e1c5b2cf7e349adc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/19cdb7de86e556202ab16e0cffd1a97348231bc0", - "reference": "19cdb7de86e556202ab16e0cffd1a97348231bc0", + "url": "https://api.github.com/repos/symfony/security-core/zipball/6048754a72768c43419129d3e1c5b2cf7e349adc", + "reference": "6048754a72768c43419129d3e1c5b2cf7e349adc", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/event-dispatcher-contracts": "^2.5|^3", - "symfony/password-hasher": "^5.4|^6.0|^7.0", + "symfony/password-hasher": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "symfony/event-dispatcher": "<5.4", - "symfony/http-foundation": "<5.4", - "symfony/ldap": "<5.4", - "symfony/security-guard": "<5.4", - "symfony/translation": "<5.4.35|>=6.0,<6.3.12|>=6.4,<6.4.3|>=7.0,<7.0.3", - "symfony/validator": "<5.4" + "symfony/event-dispatcher": "<6.4", + "symfony/http-foundation": "<6.4", + "symfony/ldap": "<6.4", + "symfony/translation": "<6.4.3|>=7.0,<7.0.3", + "symfony/validator": "<6.4" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", "psr/container": "^1.1|^2.0", "psr/log": "^1|^2|^3", - "symfony/cache": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", - "symfony/ldap": "^5.4|^6.0|^7.0", - "symfony/string": "^5.4|^6.0|^7.0", - "symfony/translation": "^5.4.35|~6.3.12|^6.4.3|^7.0.3", + "symfony/cache": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/ldap": "^6.4|^7.0", + "symfony/string": "^6.4|^7.0", + "symfony/translation": "^6.4.3|^7.0.3", "symfony/validator": "^6.4|^7.0" }, "type": "library", @@ -7229,7 +7209,7 @@ "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-core/tree/v6.4.16" + "source": "https://github.com/symfony/security-core/tree/v7.0.10" }, "funding": [ { @@ -7245,31 +7225,31 @@ "type": "tidelift" } ], - "time": "2024-11-27T09:48:51+00:00" + "time": "2024-07-26T12:31:22+00:00" }, { "name": "symfony/security-csrf", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/security-csrf.git", - "reference": "c34421b7d34efbaef5d611ab2e646a0ec464ffe3" + "reference": "40543b13b35999316d3f79a18d0d4075f30b8d9b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-csrf/zipball/c34421b7d34efbaef5d611ab2e646a0ec464ffe3", - "reference": "c34421b7d34efbaef5d611ab2e646a0ec464ffe3", + "url": "https://api.github.com/repos/symfony/security-csrf/zipball/40543b13b35999316d3f79a18d0d4075f30b8d9b", + "reference": "40543b13b35999316d3f79a18d0d4075f30b8d9b", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/security-core": "^5.4|^6.0|^7.0" + "php": ">=8.2", + "symfony/security-core": "^6.4|^7.0" }, "conflict": { - "symfony/http-foundation": "<5.4" + "symfony/http-foundation": "<6.4" }, "require-dev": { - "symfony/http-foundation": "^5.4|^6.0|^7.0" + "symfony/http-foundation": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -7297,7 +7277,7 @@ "description": "Symfony Security Component - CSRF Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-csrf/tree/v6.4.13" + "source": "https://github.com/symfony/security-csrf/tree/v7.0.8" }, "funding": [ { @@ -7313,49 +7293,48 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/security-http", - "version": "v6.4.15", + "version": "v7.0.9", "source": { "type": "git", "url": "https://github.com/symfony/security-http.git", - "reference": "ded1e078f952e686b058d9eac98e497bea47b308" + "reference": "828b0ce72c7e178aa56c6694f1ba9593cac531d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-http/zipball/ded1e078f952e686b058d9eac98e497bea47b308", - "reference": "ded1e078f952e686b058d9eac98e497bea47b308", + "url": "https://api.github.com/repos/symfony/security-http/zipball/828b0ce72c7e178aa56c6694f1ba9593cac531d9", + "reference": "828b0ce72c7e178aa56c6694f1ba9593cac531d9", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-foundation": "^6.2|^7.0", - "symfony/http-kernel": "^6.3|^7.0", + "php": ">=8.2", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", "symfony/polyfill-mbstring": "~1.0", - "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/property-access": "^6.4|^7.0", "symfony/security-core": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "symfony/clock": "<6.3", - "symfony/event-dispatcher": "<5.4.9|>=6,<6.0.9", + "symfony/clock": "<6.4", + "symfony/event-dispatcher": "<6.4", "symfony/http-client-contracts": "<3.0", - "symfony/security-bundle": "<5.4", - "symfony/security-csrf": "<5.4" + "symfony/security-bundle": "<6.4", + "symfony/security-csrf": "<6.4" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/cache": "^5.4|^6.0|^7.0", - "symfony/clock": "^6.3|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/cache": "^6.4|^7.0", + "symfony/clock": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", "symfony/http-client-contracts": "^3.0", - "symfony/rate-limiter": "^5.4|^6.0|^7.0", - "symfony/routing": "^5.4|^6.0|^7.0", - "symfony/security-csrf": "^5.4|^6.0|^7.0", - "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/rate-limiter": "^6.4|^7.0", + "symfony/routing": "^6.4|^7.0", + "symfony/security-csrf": "^6.4|^7.0", + "symfony/translation": "^6.4|^7.0", "web-token/jwt-checker": "^3.1", "web-token/jwt-signature-algorithm-ecdsa": "^3.1" }, @@ -7385,7 +7364,7 @@ "description": "Symfony Security Component - HTTP Integration", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-http/tree/v6.4.15" + "source": "https://github.com/symfony/security-http/tree/v7.0.9" }, "funding": [ { @@ -7401,61 +7380,58 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:40:18+00:00" + "time": "2024-06-22T11:38:48+00:00" }, { "name": "symfony/serializer", - "version": "v6.4.15", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "9d862d66198f3c2e30404228629ef4c18d5d608e" + "reference": "79b073ce21280bae2567cf1c48ae078dc3eeb01d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/9d862d66198f3c2e30404228629ef4c18d5d608e", - "reference": "9d862d66198f3c2e30404228629ef4c18d5d608e", + "url": "https://api.github.com/repos/symfony/serializer/zipball/79b073ce21280bae2567cf1c48ae078dc3eeb01d", + "reference": "79b073ce21280bae2567cf1c48ae078dc3eeb01d", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "doctrine/annotations": "<1.12", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/dependency-injection": "<5.4", - "symfony/property-access": "<5.4", - "symfony/property-info": "<5.4.24|>=6,<6.2.11", - "symfony/uid": "<5.4", + "symfony/dependency-injection": "<6.4", + "symfony/property-access": "<6.4", + "symfony/property-info": "<6.4", + "symfony/uid": "<6.4", "symfony/validator": "<6.4", - "symfony/yaml": "<5.4" + "symfony/yaml": "<6.4" }, "require-dev": { - "doctrine/annotations": "^1.12|^2", "phpdocumentor/reflection-docblock": "^3.2|^4.0|^5.0", "seld/jsonlint": "^1.10", - "symfony/cache": "^5.4|^6.0|^7.0", - "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/error-handler": "^5.4|^6.0|^7.0", - "symfony/filesystem": "^5.4|^6.0|^7.0", - "symfony/form": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/mime": "^5.4|^6.0|^7.0", - "symfony/property-access": "^5.4.26|^6.3|^7.0", - "symfony/property-info": "^5.4.24|^6.2.11|^7.0", + "symfony/cache": "^6.4|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/filesystem": "^6.4|^7.0", + "symfony/form": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/property-access": "^6.4|^7.0", + "symfony/property-info": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3", - "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/uid": "^6.4|^7.0", "symfony/validator": "^6.4|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/var-dumper": "^6.4|^7.0", + "symfony/var-exporter": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -7483,7 +7459,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v6.4.15" + "source": "https://github.com/symfony/serializer/tree/v7.0.10" }, "funding": [ { @@ -7499,7 +7475,7 @@ "type": "tidelift" } ], - "time": "2024-10-23T13:25:59+00:00" + "time": "2024-07-17T06:06:58+00:00" }, { "name": "symfony/service-contracts", @@ -7655,20 +7631,20 @@ }, { "name": "symfony/stopwatch", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "2cae0a6f8d04937d02f6d19806251e2104d54f92" + "reference": "e4a0d6fef3dd428ca23172e62d1d863f6f25d541" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2cae0a6f8d04937d02f6d19806251e2104d54f92", - "reference": "2cae0a6f8d04937d02f6d19806251e2104d54f92", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e4a0d6fef3dd428ca23172e62d1d863f6f25d541", + "reference": "e4a0d6fef3dd428ca23172e62d1d863f6f25d541", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/service-contracts": "^2.5|^3" }, "type": "library", @@ -7697,7 +7673,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.4.13" + "source": "https://github.com/symfony/stopwatch/tree/v7.0.8" }, "funding": [ { @@ -7713,24 +7689,24 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/string", - "version": "v6.4.15", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f" + "reference": "a1ac40b358a5e45c2b6c32ec9b183828c1dcf5d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", - "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "url": "https://api.github.com/repos/symfony/string/zipball/a1ac40b358a5e45c2b6c32ec9b183828c1dcf5d6", + "reference": "a1ac40b358a5e45c2b6c32ec9b183828c1dcf5d6", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -7740,11 +7716,11 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/intl": "^6.2|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0" + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -7783,7 +7759,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.15" + "source": "https://github.com/symfony/string/tree/v7.0.10" }, "funding": [ { @@ -7799,37 +7775,36 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:31:12+00:00" + "time": "2024-07-22T10:25:05+00:00" }, { "name": "symfony/translation", - "version": "v6.4.13", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66" + "reference": "480fc1b9f44d9104239eb36de1e1151814c8a8d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/bee9bfabfa8b4045a66bf82520e492cddbaffa66", - "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66", + "url": "https://api.github.com/repos/symfony/translation/zipball/480fc1b9f44d9104239eb36de1e1151814c8a8d8", + "reference": "480fc1b9f44d9104239eb36de1e1151814c8a8d8", "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" @@ -7837,17 +7812,17 @@ "require-dev": { "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": { @@ -7878,7 +7853,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.13" + "source": "https://github.com/symfony/translation/tree/v7.0.10" }, "funding": [ { @@ -7894,7 +7869,7 @@ "type": "tidelift" } ], - "time": "2024-09-27T18:14:25+00:00" + "time": "2024-07-26T12:31:22+00:00" }, { "name": "symfony/translation-contracts", @@ -7976,65 +7951,64 @@ }, { "name": "symfony/twig-bridge", - "version": "v6.4.17", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "238e1aac992b5231c66faf10131ace7bdba97065" + "reference": "c8e05d7545962198df715d705c132de0674dc5b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/238e1aac992b5231c66faf10131ace7bdba97065", - "reference": "238e1aac992b5231c66faf10131ace7bdba97065", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/c8e05d7545962198df715d705c132de0674dc5b2", + "reference": "c8e05d7545962198df715d705c132de0674dc5b2", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/translation-contracts": "^2.5|^3", - "twig/twig": "^2.13|^3.0.4" + "twig/twig": "^3.0.4" }, "conflict": { "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/console": "<5.4", - "symfony/form": "<6.3", - "symfony/http-foundation": "<5.4", + "symfony/console": "<6.4", + "symfony/form": "<6.4", + "symfony/http-foundation": "<6.4", "symfony/http-kernel": "<6.4", - "symfony/mime": "<6.2", + "symfony/mime": "<6.4", "symfony/serializer": "<6.4", - "symfony/translation": "<5.4", - "symfony/workflow": "<5.4" + "symfony/translation": "<6.4", + "symfony/workflow": "<6.4" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3|^4", "league/html-to-markdown": "^5.0", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/asset": "^5.4|^6.0|^7.0", - "symfony/asset-mapper": "^6.3|^7.0", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/asset": "^6.4|^7.0", + "symfony/asset-mapper": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", "symfony/form": "^6.4|^7.0", - "symfony/html-sanitizer": "^6.1|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/html-sanitizer": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", - "symfony/intl": "^5.4|^6.0|^7.0", - "symfony/mime": "^6.2|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", "symfony/polyfill-intl-icu": "~1.0", - "symfony/property-info": "^5.4|^6.0|^7.0", - "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/property-info": "^6.4|^7.0", + "symfony/routing": "^6.4|^7.0", "symfony/security-acl": "^2.8|^3.0", - "symfony/security-core": "^5.4|^6.0|^7.0", - "symfony/security-csrf": "^5.4|^6.0|^7.0", - "symfony/security-http": "^5.4|^6.0|^7.0", + "symfony/security-core": "^6.4|^7.0", + "symfony/security-csrf": "^6.4|^7.0", + "symfony/security-http": "^6.4|^7.0", "symfony/serializer": "^6.4.3|^7.0.3", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/translation": "^6.1|^7.0", - "symfony/web-link": "^5.4|^6.0|^7.0", - "symfony/workflow": "^5.4|^6.0|^7.0", - "symfony/yaml": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/translation": "^6.4|^7.0", + "symfony/web-link": "^6.4|^7.0", + "symfony/workflow": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0", "twig/cssinliner-extra": "^2.12|^3", "twig/inky-extra": "^2.12|^3", "twig/markdown-extra": "^2.12|^3" @@ -8065,7 +8039,7 @@ "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bridge/tree/v6.4.17" + "source": "https://github.com/symfony/twig-bridge/tree/v7.0.8" }, "funding": [ { @@ -8081,47 +8055,47 @@ "type": "tidelift" } ], - "time": "2024-12-19T14:08:41+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/twig-bundle", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/twig-bundle.git", - "reference": "c3beeb5336aba1ea03c37e526968c2fde3ef25c4" + "reference": "a90e474bc260e59bed98a556db63673e6420a0be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/c3beeb5336aba1ea03c37e526968c2fde3ef25c4", - "reference": "c3beeb5336aba1ea03c37e526968c2fde3ef25c4", + "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/a90e474bc260e59bed98a556db63673e6420a0be", + "reference": "a90e474bc260e59bed98a556db63673e6420a0be", "shasum": "" }, "require": { "composer-runtime-api": ">=2.1", - "php": ">=8.1", - "symfony/config": "^6.1|^7.0", - "symfony/dependency-injection": "^6.1|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^6.2", - "symfony/twig-bridge": "^6.4", - "twig/twig": "^2.13|^3.0.4" + "php": ">=8.2", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/twig-bridge": "^6.4|^7.0", + "twig/twig": "^3.0.4" }, "conflict": { - "symfony/framework-bundle": "<5.4", - "symfony/translation": "<5.4" + "symfony/framework-bundle": "<6.4", + "symfony/translation": "<6.4" }, "require-dev": { - "symfony/asset": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", - "symfony/form": "^5.4|^6.0|^7.0", - "symfony/framework-bundle": "^5.4|^6.0|^7.0", - "symfony/routing": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/translation": "^5.4|^6.0|^7.0", - "symfony/web-link": "^5.4|^6.0|^7.0", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/asset": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/form": "^6.4|^7.0", + "symfony/framework-bundle": "^6.4|^7.0", + "symfony/routing": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/translation": "^6.4|^7.0", + "symfony/web-link": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0" }, "type": "symfony-bundle", "autoload": { @@ -8149,7 +8123,7 @@ "description": "Provides a tight integration of Twig into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bundle/tree/v6.4.13" + "source": "https://github.com/symfony/twig-bundle/tree/v7.0.8" }, "funding": [ { @@ -8165,28 +8139,28 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/uid", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "18eb207f0436a993fffbdd811b5b8fa35fa5e007" + "reference": "82d01607b09ba79f38efe4c213dbf528ff0beeed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/18eb207f0436a993fffbdd811b5b8fa35fa5e007", - "reference": "18eb207f0436a993fffbdd811b5b8fa35fa5e007", + "url": "https://api.github.com/repos/symfony/uid/zipball/82d01607b09ba79f38efe4c213dbf528ff0beeed", + "reference": "82d01607b09ba79f38efe4c213dbf528ff0beeed", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-uuid": "^1.15" }, "require-dev": { - "symfony/console": "^5.4|^6.0|^7.0" + "symfony/console": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -8223,7 +8197,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v6.4.13" + "source": "https://github.com/symfony/uid/tree/v7.0.8" }, "funding": [ { @@ -8239,38 +8213,36 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.4.15", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80" + "reference": "3b5bed54f7c541aa0bf4cb0d3eb63b9e422ccb8b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80", - "reference": "38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3b5bed54f7c541aa0bf4cb0d3eb63b9e422ccb8b", + "reference": "3b5bed54f7c541aa0bf4cb0d3eb63b9e422ccb8b", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/console": "<5.4" + "symfony/console": "<6.4" }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/error-handler": "^6.3|^7.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/uid": "^5.4|^6.0|^7.0", - "twig/twig": "^2.13|^3.0.4" + "symfony/console": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/uid": "^6.4|^7.0", + "twig/twig": "^3.0.4" }, "bin": [ "Resources/bin/var-dump-server" @@ -8308,7 +8280,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.4.15" + "source": "https://github.com/symfony/var-dumper/tree/v7.0.10" }, "funding": [ { @@ -8324,30 +8296,29 @@ "type": "tidelift" } ], - "time": "2024-11-08T15:28:48+00:00" + "time": "2024-07-26T12:31:22+00:00" }, { "name": "symfony/var-exporter", - "version": "v6.4.13", + "version": "v7.0.9", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "0f605f72a363f8743001038a176eeb2a11223b51" + "reference": "18053b0e249c7303f9461f78d15cceae69c83b02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/0f605f72a363f8743001038a176eeb2a11223b51", - "reference": "0f605f72a363f8743001038a176eeb2a11223b51", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/18053b0e249c7303f9461f78d15cceae69c83b02", + "reference": "18053b0e249c7303f9461f78d15cceae69c83b02", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3" + "php": ">=8.2" }, "require-dev": { "symfony/property-access": "^6.4|^7.0", "symfony/serializer": "^6.4|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -8385,7 +8356,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.4.13" + "source": "https://github.com/symfony/var-exporter/tree/v7.0.9" }, "funding": [ { @@ -8401,34 +8372,34 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-06-28T07:59:17+00:00" }, { "name": "symfony/web-link", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/web-link.git", - "reference": "4d188b64bb9a9c5e2e4d20c8d5fdce6bbbb32c94" + "reference": "270f39e3d1c7cc62b5a931fd6e9f2ea4e99ee9cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-link/zipball/4d188b64bb9a9c5e2e4d20c8d5fdce6bbbb32c94", - "reference": "4d188b64bb9a9c5e2e4d20c8d5fdce6bbbb32c94", + "url": "https://api.github.com/repos/symfony/web-link/zipball/270f39e3d1c7cc62b5a931fd6e9f2ea4e99ee9cf", + "reference": "270f39e3d1c7cc62b5a931fd6e9f2ea4e99ee9cf", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/link": "^1.1|^2.0" }, "conflict": { - "symfony/http-kernel": "<5.4" + "symfony/http-kernel": "<6.4" }, "provide": { "psr/link-implementation": "1.0|2.0" }, "require-dev": { - "symfony/http-kernel": "^5.4|^6.0|^7.0" + "symfony/http-kernel": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -8468,7 +8439,7 @@ "push" ], "support": { - "source": "https://github.com/symfony/web-link/tree/v6.4.13" + "source": "https://github.com/symfony/web-link/tree/v7.0.8" }, "funding": [ { @@ -8484,42 +8455,41 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/web-profiler-bundle", - "version": "v6.4.17", + "version": "v7.0.10", "source": { "type": "git", "url": "https://github.com/symfony/web-profiler-bundle.git", - "reference": "979f8ee1a4f2464c20f3fef0d2111827fef2e97e" + "reference": "884ed0470bd703ec40a78dfec94fe971ca55cad6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/979f8ee1a4f2464c20f3fef0d2111827fef2e97e", - "reference": "979f8ee1a4f2464c20f3fef0d2111827fef2e97e", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/884ed0470bd703ec40a78dfec94fe971ca55cad6", + "reference": "884ed0470bd703ec40a78dfec94fe971ca55cad6", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/config": "^5.4|^6.0|^7.0", + "php": ">=8.2", + "symfony/config": "^6.4|^7.0", "symfony/framework-bundle": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", - "symfony/routing": "^5.4|^6.0|^7.0", - "symfony/twig-bundle": "^5.4|^6.0", - "twig/twig": "^2.13|^3.0.4" + "symfony/routing": "^6.4|^7.0", + "symfony/twig-bundle": "^6.4|^7.0", + "twig/twig": "^3.0.4" }, "conflict": { - "symfony/form": "<5.4", - "symfony/mailer": "<5.4", - "symfony/messenger": "<5.4", - "symfony/twig-bundle": ">=7.0" + "symfony/form": "<6.4", + "symfony/mailer": "<6.4", + "symfony/messenger": "<6.4" }, "require-dev": { - "symfony/browser-kit": "^5.4|^6.0|^7.0", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/css-selector": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0" + "symfony/browser-kit": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/css-selector": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0" }, "type": "symfony-bundle", "autoload": { @@ -8550,7 +8520,7 @@ "dev" ], "support": { - "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.4.17" + "source": "https://github.com/symfony/web-profiler-bundle/tree/v7.0.10" }, "funding": [ { @@ -8566,7 +8536,7 @@ "type": "tidelift" } ], - "time": "2024-12-08T23:00:41+00:00" + "time": "2024-07-26T12:31:22+00:00" }, { "name": "symfony/webpack-encore-bundle", @@ -8642,28 +8612,27 @@ }, { "name": "symfony/yaml", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9" + "reference": "89bdddd79e918448ce978be664768ef27b9e5798" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", - "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", + "url": "https://api.github.com/repos/symfony/yaml/zipball/89bdddd79e918448ce978be664768ef27b9e5798", + "reference": "89bdddd79e918448ce978be664768ef27b9e5798", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "symfony/console": "<5.4" + "symfony/console": "<6.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0|^7.0" + "symfony/console": "^6.4|^7.0" }, "bin": [ "Resources/bin/yaml-lint" @@ -8694,7 +8663,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.4.13" + "source": "https://github.com/symfony/yaml/tree/v7.0.8" }, "funding": [ { @@ -8710,7 +8679,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "twig/extra-bundle", @@ -9407,16 +9376,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.68.1", + "version": "v3.66.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff" + "reference": "5f5f2a142ff36b93c41885bca29cc5f861c013e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b9db2b2ea3cdba7201067acee46f984ef2397cff", - "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/5f5f2a142ff36b93c41885bca29cc5f861c013e6", + "reference": "5f5f2a142ff36b93c41885bca29cc5f861c013e6", "shasum": "" }, "require": { @@ -9433,17 +9402,17 @@ "react/promise": "^2.0 || ^3.0", "react/socket": "^1.0", "react/stream": "^1.0", - "sebastian/diff": "^4.0 || ^5.1 || ^6.0", - "symfony/console": "^5.4 || ^6.4 || ^7.0", - "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", - "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", - "symfony/finder": "^5.4 || ^6.4 || ^7.0", - "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", - "symfony/polyfill-mbstring": "^1.31", - "symfony/polyfill-php80": "^1.31", - "symfony/polyfill-php81": "^1.31", - "symfony/process": "^5.4 || ^6.4 || ^7.2", - "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0 <7.2", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { "facile-it/paraunit": "^1.3.1 || ^2.4", @@ -9455,9 +9424,9 @@ "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", - "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", - "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", - "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" + "phpunit/phpunit": "^9.6.21 || ^10.5.38 || ^11.4.3", + "symfony/var-dumper": "^5.4.47 || ^6.4.15 || ^7.1.8", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.1.6" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -9498,7 +9467,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.1" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.66.0" }, "funding": [ { @@ -9506,7 +9475,7 @@ "type": "github" } ], - "time": "2025-01-17T09:20:36+00:00" + "time": "2024-12-29T13:46:23+00:00" }, { "name": "masterminds/html5", @@ -9577,16 +9546,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.1", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7" + "reference": "7d08f569e582ade182a375c366cbd896eccadd3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7", - "reference": "cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7d08f569e582ade182a375c366cbd896eccadd3a", + "reference": "7d08f569e582ade182a375c366cbd896eccadd3a", "shasum": "" }, "require": { @@ -9631,7 +9600,7 @@ "type": "github" } ], - "time": "2025-01-05T16:43:48+00:00" + "time": "2025-01-21T14:54:06+00:00" }, { "name": "react/cache", @@ -10287,27 +10256,27 @@ }, { "name": "symfony/browser-kit", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "65d4b3fd9556e4b5b41287bef93c671f8f9f86ab" + "reference": "0030d568e9147b853e168117edf72b74f9643e85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/65d4b3fd9556e4b5b41287bef93c671f8f9f86ab", - "reference": "65d4b3fd9556e4b5b41287bef93c671f8f9f86ab", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/0030d568e9147b853e168117edf72b74f9643e85", + "reference": "0030d568e9147b853e168117edf72b74f9643e85", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/dom-crawler": "^5.4|^6.0|^7.0" + "php": ">=8.2", + "symfony/dom-crawler": "^6.4|^7.0" }, "require-dev": { - "symfony/css-selector": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/mime": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0" + "symfony/css-selector": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -10335,7 +10304,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v6.4.13" + "source": "https://github.com/symfony/browser-kit/tree/v7.0.8" }, "funding": [ { @@ -10351,24 +10320,24 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:07:50+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/css-selector", - "version": "v6.4.13", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "cb23e97813c5837a041b73a6d63a9ddff0778f5e" + "reference": "63b9f8c9b3c28c43ad06764c67fe092af2576d17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/cb23e97813c5837a041b73a6d63a9ddff0778f5e", - "reference": "cb23e97813c5837a041b73a6d63a9ddff0778f5e", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/63b9f8c9b3c28c43ad06764c67fe092af2576d17", + "reference": "63b9f8c9b3c28c43ad06764c67fe092af2576d17", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -10400,7 +10369,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.4.13" + "source": "https://github.com/symfony/css-selector/tree/v7.0.8" }, "funding": [ { @@ -10416,30 +10385,30 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/dom-crawler", - "version": "v6.4.16", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "4304e6ad5c894a9c72831ad459f627bfd35d766d" + "reference": "46cdbb48603db7b9ea55172d3edb6b3e9de58028" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4304e6ad5c894a9c72831ad459f627bfd35d766d", - "reference": "4304e6ad5c894a9c72831ad459f627bfd35d766d", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/46cdbb48603db7b9ea55172d3edb6b3e9de58028", + "reference": "46cdbb48603db7b9ea55172d3edb6b3e9de58028", "shasum": "" }, "require": { "masterminds/html5": "^2.6", - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "^5.4|^6.0|^7.0" + "symfony/css-selector": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -10467,7 +10436,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v6.4.16" + "source": "https://github.com/symfony/dom-crawler/tree/v7.0.8" }, "funding": [ { @@ -10483,7 +10452,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T15:06:22+00:00" + "time": "2024-05-31T14:55:39+00:00" } ], "aliases": [], diff --git a/rector.php b/rector.php index 21c73dd9..60a67237 100644 --- a/rector.php +++ b/rector.php @@ -12,7 +12,7 @@ ->withSkipPath(__DIR__.'/node_modules') ->withSymfonyContainerXml(__DIR__.'/var/cache/dev/App_KernelDevDebugContainer.xml') ->withSets([ - SymfonySetList::SYMFONY_64, + SymfonySetList::SYMFONY_70, SymfonySetList::SYMFONY_CODE_QUALITY, SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, ]); From c56d7a6d9f267f8c1bfbcdc11e2dc991e03c570b Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 21:22:59 +0100 Subject: [PATCH 37/52] build: update symfony/framework-bundle --- config/packages/framework.yaml | 14 +++----------- symfony.lock | 6 +++--- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 224855ba..06df9511 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -1,21 +1,13 @@ # see https://symfony.com/doc/current/reference/configuration/framework.html framework: secret: '%env(APP_SECRET)%' - annotations: false - http_method_override: false - handle_all_throwables: true + #csrf_protection: true - # Enables session support. Note that the session will ONLY be started if you read or write from it. - # Remove or comment this section to explicitly disable session support. - session: - handler_id: null - cookie_secure: auto - cookie_samesite: lax + # Note that the session will be started ONLY if you read or write from it. + session: true #esi: true #fragments: true - php_errors: - log: true trusted_proxies: '%env(TRUSTED_PROXIES)%' diff --git a/symfony.lock b/symfony.lock index d648cf78..eb238bd3 100644 --- a/symfony.lock +++ b/symfony.lock @@ -293,12 +293,12 @@ "version": "v4.4.19" }, "symfony/framework-bundle": { - "version": "6.4", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.4", - "ref": "32126346f25e1cee607cc4aa6783d46034920554" + "version": "7.0", + "ref": "6356c19b9ae08e7763e4ba2d9ae63043efc75db5" }, "files": [ "config/packages/cache.yaml", From 45669755e97c7e0cd732ba22085c1cc01d4811ec Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 21:23:43 +0100 Subject: [PATCH 38/52] build: update symfony/routing recipe --- config/packages/routing.yaml | 2 -- symfony.lock | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/config/packages/routing.yaml b/config/packages/routing.yaml index 4b766ce5..8166181c 100644 --- a/config/packages/routing.yaml +++ b/config/packages/routing.yaml @@ -1,7 +1,5 @@ framework: router: - utf8: true - # Configure how to generate URLs in non-HTTP contexts, such as CLI commands. # See https://symfony.com/doc/current/routing.html#generating-urls-in-commands #default_uri: http://localhost diff --git a/symfony.lock b/symfony.lock index eb238bd3..1a624b60 100644 --- a/symfony.lock +++ b/symfony.lock @@ -399,12 +399,12 @@ "version": "v5.2.3" }, "symfony/routing": { - "version": "6.2", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.2", - "ref": "e0a11b4ccb8c9e70b574ff5ad3dfdcd41dec5aa6" + "version": "7.0", + "ref": "21b72649d5622d8f7da329ffb5afb232a023619d" }, "files": [ "config/packages/routing.yaml", From 9a88cfe7c2a5ad10cc3b88a4fd5a06eb256fd5c6 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 21:28:15 +0100 Subject: [PATCH 39/52] build: upgrade to symfony 7.2 --- composer.json | 44 +-- composer.lock | 809 ++++++++++++++++++++++++++++---------------------- rector.php | 2 +- 3 files changed, 478 insertions(+), 377 deletions(-) diff --git a/composer.json b/composer.json index 046b887c..772a6efe 100644 --- a/composer.json +++ b/composer.json @@ -19,30 +19,30 @@ "oneup/flysystem-bundle": "^4.12.3", "oneup/uploader-bundle": "^5.0.1", "stevenmaguire/oauth2-keycloak": "^5.1.0", - "symfony/console": "7.0.*", - "symfony/debug-bundle": "7.0.*", - "symfony/dotenv": "7.0.*", - "symfony/expression-language": "7.0.*", + "symfony/console": "7.2.*", + "symfony/debug-bundle": "7.2.*", + "symfony/dotenv": "7.2.*", + "symfony/expression-language": "7.2.*", "symfony/flex": "^2.4.7", - "symfony/form": "7.0.*", - "symfony/framework-bundle": "7.0.*", - "symfony/http-client": "7.0.*", + "symfony/form": "7.2.*", + "symfony/framework-bundle": "7.2.*", + "symfony/http-client": "7.2.*", "symfony/maker-bundle": "^1.62.1", "symfony/monolog-bundle": "^v3.10.0", - "symfony/phpunit-bridge": "7.0.*", - "symfony/runtime": "7.0.*", - "symfony/security-bundle": "7.0.*", - "symfony/serializer": "7.0.*", + "symfony/phpunit-bridge": "7.2.*", + "symfony/runtime": "7.2.*", + "symfony/security-bundle": "7.2.*", + "symfony/serializer": "7.2.*", "symfony/stimulus-bundle": "^v2.22.1", - "symfony/stopwatch": "7.0.*", - "symfony/translation": "7.0.*", - "symfony/twig-bundle": "7.0.*", - "symfony/uid": "7.0.*", - "symfony/var-dumper": "7.0.*", - "symfony/web-link": "7.0.*", - "symfony/web-profiler-bundle": "7.0.*", + "symfony/stopwatch": "7.2.*", + "symfony/translation": "7.2.*", + "symfony/twig-bundle": "7.2.*", + "symfony/uid": "7.2.*", + "symfony/var-dumper": "7.2.*", + "symfony/web-link": "7.2.*", + "symfony/web-profiler-bundle": "7.2.*", "symfony/webpack-encore-bundle": "^2.2.0", - "symfony/yaml": "7.0.*", + "symfony/yaml": "7.2.*", "twig/extra-bundle": "^v3.18.0", "twig/markdown-extra": "^v3.18.0", "twig/string-extra": "^v3.18.0", @@ -52,8 +52,8 @@ "friendsofphp/php-cs-fixer": "^v3.65.0", "phpstan/phpstan": "^2.1.1", "rector/rector": "^2.0.7", - "symfony/browser-kit": "7.0.*", - "symfony/css-selector": "7.0.*" + "symfony/browser-kit": "7.2.*", + "symfony/css-selector": "7.2.*" }, "config": { "preferred-install": { @@ -101,7 +101,7 @@ "extra": { "symfony": { "allow-contrib": false, - "require": "7.0.*" + "require": "7.2.*" } } } diff --git a/composer.lock b/composer.lock index 836a4935..d63d94eb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d48f8723f00f95d5d539e6d24b503b46", + "content-hash": "9b9af3b99534c0da685a437103b79ff4", "packages": [ { "name": "composer/package-versions-deprecated", @@ -3403,16 +3403,16 @@ }, { "name": "symfony/asset", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/asset.git", - "reference": "0f106714bb8d857560edd2ada7f387d2f437c830" + "reference": "cb926cd59fefa1f9b4900b3695f0f846797ba5c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/asset/zipball/0f106714bb8d857560edd2ada7f387d2f437c830", - "reference": "0f106714bb8d857560edd2ada7f387d2f437c830", + "url": "https://api.github.com/repos/symfony/asset/zipball/cb926cd59fefa1f9b4900b3695f0f846797ba5c0", + "reference": "cb926cd59fefa1f9b4900b3695f0f846797ba5c0", "shasum": "" }, "require": { @@ -3452,7 +3452,7 @@ "description": "Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/asset/tree/v7.0.8" + "source": "https://github.com/symfony/asset/tree/v7.2.0" }, "funding": [ { @@ -3468,20 +3468,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/cache", - "version": "v7.0.10", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "0ee03f2aa8bb920f7041678f5f46f60998e3a7a8" + "reference": "e7e983596b744c4539f31e79b0350a6cf5878a20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/0ee03f2aa8bb920f7041678f5f46f60998e3a7a8", - "reference": "0ee03f2aa8bb920f7041678f5f46f60998e3a7a8", + "url": "https://api.github.com/repos/symfony/cache/zipball/e7e983596b744c4539f31e79b0350a6cf5878a20", + "reference": "e7e983596b744c4539f31e79b0350a6cf5878a20", "shasum": "" }, "require": { @@ -3489,6 +3489,7 @@ "psr/cache": "^2.0|^3.0", "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^2.5|^3", + "symfony/deprecation-contracts": "^2.5|^3.0", "symfony/service-contracts": "^2.5|^3", "symfony/var-exporter": "^6.4|^7.0" }, @@ -3508,6 +3509,7 @@ "doctrine/dbal": "^3.6|^4", "predis/predis": "^1.1|^2.0", "psr/simple-cache": "^1.0|^2.0|^3.0", + "symfony/clock": "^6.4|^7.0", "symfony/config": "^6.4|^7.0", "symfony/dependency-injection": "^6.4|^7.0", "symfony/filesystem": "^6.4|^7.0", @@ -3548,7 +3550,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.0.10" + "source": "https://github.com/symfony/cache/tree/v7.2.1" }, "funding": [ { @@ -3564,7 +3566,7 @@ "type": "tidelift" } ], - "time": "2024-07-17T06:06:58+00:00" + "time": "2024-12-07T08:08:50+00:00" }, { "name": "symfony/cache-contracts", @@ -3644,16 +3646,16 @@ }, { "name": "symfony/clock", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/clock.git", - "reference": "817e27b87908632f647f8684a603b70ec89b75e4" + "reference": "b81435fbd6648ea425d1ee96a2d8e68f4ceacd24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/clock/zipball/817e27b87908632f647f8684a603b70ec89b75e4", - "reference": "817e27b87908632f647f8684a603b70ec89b75e4", + "url": "https://api.github.com/repos/symfony/clock/zipball/b81435fbd6648ea425d1ee96a2d8e68f4ceacd24", + "reference": "b81435fbd6648ea425d1ee96a2d8e68f4ceacd24", "shasum": "" }, "require": { @@ -3698,7 +3700,7 @@ "time" ], "support": { - "source": "https://github.com/symfony/clock/tree/v7.0.8" + "source": "https://github.com/symfony/clock/tree/v7.2.0" }, "funding": [ { @@ -3714,26 +3716,26 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/config", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "f8a8fb0c2d0a188a00a2dd5af8a4eb070641ec60" + "reference": "bcd3c4adf0144dee5011bb35454728c38adec055" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/f8a8fb0c2d0a188a00a2dd5af8a4eb070641ec60", - "reference": "f8a8fb0c2d0a188a00a2dd5af8a4eb070641ec60", + "url": "https://api.github.com/repos/symfony/config/zipball/bcd3c4adf0144dee5011bb35454728c38adec055", + "reference": "bcd3c4adf0144dee5011bb35454728c38adec055", "shasum": "" }, "require": { "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^6.4|^7.0", + "symfony/filesystem": "^7.1", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -3773,7 +3775,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/v7.0.8" + "source": "https://github.com/symfony/config/tree/v7.2.0" }, "funding": [ { @@ -3789,20 +3791,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-11-04T11:36:24+00:00" }, { "name": "symfony/console", - "version": "v7.0.10", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f381ef0bc6675a29796d7055088a7193a9e6edff" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f381ef0bc6675a29796d7055088a7193a9e6edff", - "reference": "f381ef0bc6675a29796d7055088a7193a9e6edff", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { @@ -3866,7 +3868,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.0.10" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -3882,20 +3884,20 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:31:22+00:00" + "time": "2024-12-11T03:49:26+00:00" }, { "name": "symfony/debug-bundle", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/debug-bundle.git", - "reference": "aa024d28ce7ce0c6a16ee57c066838bece92893f" + "reference": "2dade0d1415c08b627379b5ec214ec8424cb2e32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug-bundle/zipball/aa024d28ce7ce0c6a16ee57c066838bece92893f", - "reference": "aa024d28ce7ce0c6a16ee57c066838bece92893f", + "url": "https://api.github.com/repos/symfony/debug-bundle/zipball/2dade0d1415c08b627379b5ec214ec8424cb2e32", + "reference": "2dade0d1415c08b627379b5ec214ec8424cb2e32", "shasum": "" }, "require": { @@ -3940,7 +3942,7 @@ "description": "Provides a tight integration of the Symfony VarDumper component and the ServerLogCommand from MonologBridge into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug-bundle/tree/v7.0.8" + "source": "https://github.com/symfony/debug-bundle/tree/v7.2.0" }, "funding": [ { @@ -3956,27 +3958,27 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/dependency-injection", - "version": "v7.0.10", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "01dcf140b25aa351383f2d3829acbcedd9784ee9" + "reference": "a475747af1a1c98272a5471abc35f3da81197c5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/01dcf140b25aa351383f2d3829acbcedd9784ee9", - "reference": "01dcf140b25aa351383f2d3829acbcedd9784ee9", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/a475747af1a1c98272a5471abc35f3da81197c5d", + "reference": "a475747af1a1c98272a5471abc35f3da81197c5d", "shasum": "" }, "require": { "php": ">=8.2", "psr/container": "^1.1|^2.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/service-contracts": "^3.3", + "symfony/service-contracts": "^3.5", "symfony/var-exporter": "^6.4|^7.0" }, "conflict": { @@ -4020,7 +4022,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v7.0.10" + "source": "https://github.com/symfony/dependency-injection/tree/v7.2.0" }, "funding": [ { @@ -4036,7 +4038,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T07:32:22+00:00" + "time": "2024-11-25T15:45:00+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4107,27 +4109,29 @@ }, { "name": "symfony/doctrine-bridge", - "version": "v7.0.10", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "462b41a82739386c1b5c6304c572ce1790c57dd1" + "reference": "f12195479a55b77bc8427b48443b966622f4a18b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/462b41a82739386c1b5c6304c572ce1790c57dd1", - "reference": "462b41a82739386c1b5c6304c572ce1790c57dd1", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/f12195479a55b77bc8427b48443b966622f4a18b", + "reference": "f12195479a55b77bc8427b48443b966622f4a18b", "shasum": "" }, "require": { "doctrine/event-manager": "^2", "doctrine/persistence": "^3.1", "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { + "doctrine/collections": "<1.8", "doctrine/dbal": "<3.6", "doctrine/lexer": "<1.1", "doctrine/orm": "<2.15", @@ -4144,8 +4148,8 @@ "symfony/validator": "<6.4" }, "require-dev": { - "doctrine/collections": "^1.0|^2.0", - "doctrine/data-fixtures": "^1.1", + "doctrine/collections": "^1.8|^2.0", + "doctrine/data-fixtures": "^1.1|^2", "doctrine/dbal": "^3.6|^4", "doctrine/orm": "^2.15|^3", "psr/log": "^1|^2|^3", @@ -4163,6 +4167,7 @@ "symfony/security-core": "^6.4|^7.0", "symfony/stopwatch": "^6.4|^7.0", "symfony/translation": "^6.4|^7.0", + "symfony/type-info": "^7.1", "symfony/uid": "^6.4|^7.0", "symfony/validator": "^6.4|^7.0", "symfony/var-dumper": "^6.4|^7.0" @@ -4193,7 +4198,7 @@ "description": "Provides integration for Doctrine with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-bridge/tree/v7.0.10" + "source": "https://github.com/symfony/doctrine-bridge/tree/v7.2.2" }, "funding": [ { @@ -4209,20 +4214,20 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:31:22+00:00" + "time": "2024-12-19T14:25:03+00:00" }, { "name": "symfony/dotenv", - "version": "v7.0.10", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/dotenv.git", - "reference": "3a0c9ce95ed71a1ad297604742a46085e808c7a3" + "reference": "28347a897771d0c28e99b75166dd2689099f3045" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/3a0c9ce95ed71a1ad297604742a46085e808c7a3", - "reference": "3a0c9ce95ed71a1ad297604742a46085e808c7a3", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/28347a897771d0c28e99b75166dd2689099f3045", + "reference": "28347a897771d0c28e99b75166dd2689099f3045", "shasum": "" }, "require": { @@ -4267,7 +4272,7 @@ "environment" ], "support": { - "source": "https://github.com/symfony/dotenv/tree/v7.0.10" + "source": "https://github.com/symfony/dotenv/tree/v7.2.0" }, "funding": [ { @@ -4283,20 +4288,20 @@ "type": "tidelift" } ], - "time": "2024-07-09T18:35:37+00:00" + "time": "2024-11-27T11:18:42+00:00" }, { "name": "symfony/error-handler", - "version": "v7.0.10", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "fd1cc26512b502c8fe8dfe90b67a9d8228bbafa2" + "reference": "6150b89186573046167796fa5f3f76601d5145f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/fd1cc26512b502c8fe8dfe90b67a9d8228bbafa2", - "reference": "fd1cc26512b502c8fe8dfe90b67a9d8228bbafa2", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/6150b89186573046167796fa5f3f76601d5145f8", + "reference": "6150b89186573046167796fa5f3f76601d5145f8", "shasum": "" }, "require": { @@ -4342,7 +4347,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v7.0.10" + "source": "https://github.com/symfony/error-handler/tree/v7.2.1" }, "funding": [ { @@ -4358,20 +4363,20 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:31:22+00:00" + "time": "2024-12-07T08:50:44+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "5c30c7fc4ccf847e4dd8a18b6158cb1f77702550" + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5c30c7fc4ccf847e4dd8a18b6158cb1f77702550", - "reference": "5c30c7fc4ccf847e4dd8a18b6158cb1f77702550", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", "shasum": "" }, "require": { @@ -4422,7 +4427,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.8" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" }, "funding": [ { @@ -4438,7 +4443,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -4518,21 +4523,22 @@ }, { "name": "symfony/expression-language", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", - "reference": "8e64bd4eb4c4dd180fc7de9c72011c49ebbdc822" + "reference": "26f4884a455e755e630a5fc372df124a3578da2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/8e64bd4eb4c4dd180fc7de9c72011c49ebbdc822", - "reference": "8e64bd4eb4c4dd180fc7de9c72011c49ebbdc822", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/26f4884a455e755e630a5fc372df124a3578da2e", + "reference": "26f4884a455e755e630a5fc372df124a3578da2e", "shasum": "" }, "require": { "php": ">=8.2", "symfony/cache": "^6.4|^7.0", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3" }, "type": "library", @@ -4561,7 +4567,7 @@ "description": "Provides an engine that can compile and evaluate expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/expression-language/tree/v7.0.8" + "source": "https://github.com/symfony/expression-language/tree/v7.2.0" }, "funding": [ { @@ -4577,20 +4583,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-10-15T11:52:45+00:00" }, { "name": "symfony/filesystem", - "version": "v7.0.9", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "f6b35b0de74a2577196114eef957f2414b5599d5" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/f6b35b0de74a2577196114eef957f2414b5599d5", - "reference": "f6b35b0de74a2577196114eef957f2414b5599d5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { @@ -4627,7 +4633,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.0.9" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -4643,20 +4649,20 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:58:46+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v7.0.10", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "25b267662f297a8479bf6cf88fdc92e4b16cf24c" + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/25b267662f297a8479bf6cf88fdc92e4b16cf24c", - "reference": "25b267662f297a8479bf6cf88fdc92e4b16cf24c", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", "shasum": "" }, "require": { @@ -4691,7 +4697,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.0.10" + "source": "https://github.com/symfony/finder/tree/v7.2.2" }, "funding": [ { @@ -4707,7 +4713,7 @@ "type": "tidelift" } ], - "time": "2024-07-24T07:06:56+00:00" + "time": "2024-12-30T19:00:17+00:00" }, { "name": "symfony/flex", @@ -4779,20 +4785,21 @@ }, { "name": "symfony/form", - "version": "v7.0.10", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "2713488dbb290a6c0d043766b0e9d0b02672c935" + "reference": "264cff30f52f12149aff92bbc23e78160a45c2f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/2713488dbb290a6c0d043766b0e9d0b02672c935", - "reference": "2713488dbb290a6c0d043766b0e9d0b02672c935", + "url": "https://api.github.com/repos/symfony/form/zipball/264cff30f52f12149aff92bbc23e78160a45c2f3", + "reference": "264cff30f52f12149aff92bbc23e78160a45c2f3", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/event-dispatcher": "^6.4|^7.0", "symfony/options-resolver": "^6.4|^7.0", "symfony/polyfill-ctype": "~1.8", @@ -4855,7 +4862,7 @@ "description": "Allows to easily create, process and reuse HTML forms", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/form/tree/v7.0.10" + "source": "https://github.com/symfony/form/tree/v7.2.0" }, "funding": [ { @@ -4871,20 +4878,20 @@ "type": "tidelift" } ], - "time": "2024-07-19T08:29:37+00:00" + "time": "2024-11-27T11:55:00+00:00" }, { "name": "symfony/framework-bundle", - "version": "v7.0.10", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "07a37173aace78420ccaf5eceaf4a79c7dfab375" + "reference": "aaf86f38b483ce101c7e60be050bc0140431cfe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/07a37173aace78420ccaf5eceaf4a79c7dfab375", - "reference": "07a37173aace78420ccaf5eceaf4a79c7dfab375", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/aaf86f38b483ce101c7e60be050bc0140431cfe2", + "reference": "aaf86f38b483ce101c7e60be050bc0140431cfe2", "shasum": "" }, "require": { @@ -4893,14 +4900,14 @@ "php": ">=8.2", "symfony/cache": "^6.4|^7.0", "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", + "symfony/dependency-injection": "^7.2", "symfony/deprecation-contracts": "^2.5|^3", "symfony/error-handler": "^6.4|^7.0", "symfony/event-dispatcher": "^6.4|^7.0", - "symfony/filesystem": "^6.4|^7.0", + "symfony/filesystem": "^7.1", "symfony/finder": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", + "symfony/http-kernel": "^7.2", "symfony/polyfill-mbstring": "~1.0", "symfony/routing": "^6.4|^7.0" }, @@ -4922,16 +4929,18 @@ "symfony/mime": "<6.4", "symfony/property-access": "<6.4", "symfony/property-info": "<6.4", + "symfony/runtime": "<6.4.13|>=7.0,<7.1.6", "symfony/scheduler": "<6.4.4|>=7.0.0,<7.0.4", "symfony/security-core": "<6.4", - "symfony/security-csrf": "<6.4", - "symfony/serializer": "<6.4", + "symfony/security-csrf": "<7.2", + "symfony/serializer": "<7.1", "symfony/stopwatch": "<6.4", "symfony/translation": "<6.4", "symfony/twig-bridge": "<6.4", "symfony/twig-bundle": "<6.4", "symfony/validator": "<6.4", "symfony/web-profiler-bundle": "<6.4", + "symfony/webhook": "<7.2", "symfony/workflow": "<6.4" }, "require-dev": { @@ -4963,17 +4972,19 @@ "symfony/scheduler": "^6.4.4|^7.0.4", "symfony/security-bundle": "^6.4|^7.0", "symfony/semaphore": "^6.4|^7.0", - "symfony/serializer": "^6.4|^7.0", + "symfony/serializer": "^7.1", "symfony/stopwatch": "^6.4|^7.0", "symfony/string": "^6.4|^7.0", "symfony/translation": "^6.4|^7.0", "symfony/twig-bundle": "^6.4|^7.0", + "symfony/type-info": "^7.1", "symfony/uid": "^6.4|^7.0", "symfony/validator": "^6.4|^7.0", "symfony/web-link": "^6.4|^7.0", + "symfony/webhook": "^7.2", "symfony/workflow": "^6.4|^7.0", "symfony/yaml": "^6.4|^7.0", - "twig/twig": "^3.0.4" + "twig/twig": "^3.12" }, "type": "symfony-bundle", "autoload": { @@ -5001,7 +5012,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v7.0.10" + "source": "https://github.com/symfony/framework-bundle/tree/v7.2.2" }, "funding": [ { @@ -5017,29 +5028,31 @@ "type": "tidelift" } ], - "time": "2024-07-26T13:24:26+00:00" + "time": "2024-12-19T14:25:03+00:00" }, { "name": "symfony/http-client", - "version": "v7.0.10", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "3ae495c67ba9c3b504fecd070a6c28b4143088cf" + "reference": "339ba21476eb184290361542f732ad12c97591ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/3ae495c67ba9c3b504fecd070a6c28b4143088cf", - "reference": "3ae495c67ba9c3b504fecd070a6c28b4143088cf", + "url": "https://api.github.com/repos/symfony/http-client/zipball/339ba21476eb184290361542f732ad12c97591ec", + "reference": "339ba21476eb184290361542f732ad12c97591ec", "shasum": "" }, "require": { "php": ">=8.2", "psr/log": "^1|^2|^3", - "symfony/http-client-contracts": "^3.4.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-client-contracts": "~3.4.4|^3.5.2", "symfony/service-contracts": "^2.5|^3" }, "conflict": { + "amphp/amp": "<2.5", "php-http/discovery": "<1.15", "symfony/http-foundation": "<6.4" }, @@ -5050,18 +5063,19 @@ "symfony/http-client-implementation": "3.0" }, "require-dev": { - "amphp/amp": "^2.5", - "amphp/http-client": "^4.2.1", - "amphp/http-tunnel": "^1.0", + "amphp/http-client": "^4.2.1|^5.0", + "amphp/http-tunnel": "^1.0|^2.0", "amphp/socket": "^1.1", "guzzlehttp/promises": "^1.4|^2.0", "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", "psr/http-client": "^1.0", + "symfony/amphp-http-client-meta": "^1.0|^2.0", "symfony/dependency-injection": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", "symfony/messenger": "^6.4|^7.0", "symfony/process": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0", "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", @@ -5093,7 +5107,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.0.10" + "source": "https://github.com/symfony/http-client/tree/v7.2.2" }, "funding": [ { @@ -5109,7 +5123,7 @@ "type": "tidelift" } ], - "time": "2024-07-17T06:06:58+00:00" + "time": "2024-12-30T18:35:15+00:00" }, { "name": "symfony/http-client-contracts", @@ -5191,31 +5205,32 @@ }, { "name": "symfony/http-foundation", - "version": "v7.0.10", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e7bb762b114f2f1e2610322e025709df08211f1d" + "reference": "62d1a43796ca3fea3f83a8470dfe63a4af3bc588" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e7bb762b114f2f1e2610322e025709df08211f1d", - "reference": "e7bb762b114f2f1e2610322e025709df08211f1d", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/62d1a43796ca3fea3f83a8470dfe63a4af3bc588", + "reference": "62d1a43796ca3fea3f83a8470dfe63a4af3bc588", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", "symfony/polyfill-mbstring": "~1.1", "symfony/polyfill-php83": "^1.27" }, "conflict": { "doctrine/dbal": "<3.6", - "symfony/cache": "<6.4" + "symfony/cache": "<6.4.12|>=7.0,<7.1.5" }, "require-dev": { "doctrine/dbal": "^3.6|^4", "predis/predis": "^1.1|^2.0", - "symfony/cache": "^6.4|^7.0", + "symfony/cache": "^6.4.12|^7.1.5", "symfony/dependency-injection": "^6.4|^7.0", "symfony/expression-language": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", @@ -5248,7 +5263,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.0.10" + "source": "https://github.com/symfony/http-foundation/tree/v7.2.2" }, "funding": [ { @@ -5264,25 +5279,26 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:37:16+00:00" + "time": "2024-12-30T19:00:17+00:00" }, { "name": "symfony/http-kernel", - "version": "v7.0.10", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "31cb30794c8bb944a4e1f6bb6aef95840b3345a7" + "reference": "3c432966bd8c7ec7429663105f5a02d7e75b4306" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/31cb30794c8bb944a4e1f6bb6aef95840b3345a7", - "reference": "31cb30794c8bb944a4e1f6bb6aef95840b3345a7", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/3c432966bd8c7ec7429663105f5a02d7e75b4306", + "reference": "3c432966bd8c7ec7429663105f5a02d7e75b4306", "shasum": "" }, "require": { "php": ">=8.2", "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/error-handler": "^6.4|^7.0", "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", @@ -5305,7 +5321,7 @@ "symfony/twig-bridge": "<6.4", "symfony/validator": "<6.4", "symfony/var-dumper": "<6.4", - "twig/twig": "<3.0.4" + "twig/twig": "<3.12" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" @@ -5323,9 +5339,9 @@ "symfony/finder": "^6.4|^7.0", "symfony/http-client-contracts": "^2.5|^3", "symfony/process": "^6.4|^7.0", - "symfony/property-access": "^6.4|^7.0", + "symfony/property-access": "^7.1", "symfony/routing": "^6.4|^7.0", - "symfony/serializer": "^6.4.4|^7.0.4", + "symfony/serializer": "^7.1", "symfony/stopwatch": "^6.4|^7.0", "symfony/translation": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3", @@ -5333,7 +5349,7 @@ "symfony/validator": "^6.4|^7.0", "symfony/var-dumper": "^6.4|^7.0", "symfony/var-exporter": "^6.4|^7.0", - "twig/twig": "^3.0.4" + "twig/twig": "^3.12" }, "type": "library", "autoload": { @@ -5361,7 +5377,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.0.10" + "source": "https://github.com/symfony/http-kernel/tree/v7.2.2" }, "funding": [ { @@ -5377,7 +5393,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T14:56:00+00:00" + "time": "2024-12-31T14:59:40+00:00" }, { "name": "symfony/maker-bundle", @@ -5473,16 +5489,16 @@ }, { "name": "symfony/mime", - "version": "v7.0.9", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "60757ea7d562ae1756c1f430a6f7872156a15f32" + "reference": "7f9617fcf15cb61be30f8b252695ed5e2bfac283" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/60757ea7d562ae1756c1f430a6f7872156a15f32", - "reference": "60757ea7d562ae1756c1f430a6f7872156a15f32", + "url": "https://api.github.com/repos/symfony/mime/zipball/7f9617fcf15cb61be30f8b252695ed5e2bfac283", + "reference": "7f9617fcf15cb61be30f8b252695ed5e2bfac283", "shasum": "" }, "require": { @@ -5537,7 +5553,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v7.0.9" + "source": "https://github.com/symfony/mime/tree/v7.2.1" }, "funding": [ { @@ -5553,20 +5569,20 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:58:46+00:00" + "time": "2024-12-07T08:50:44+00:00" }, { "name": "symfony/monolog-bridge", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bridge.git", - "reference": "d80b7aeabc539538c6ae8962259ac422632d7796" + "reference": "bbae784f0456c5a87c89d7c1a3fcc9cbee976c1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/d80b7aeabc539538c6ae8962259ac422632d7796", - "reference": "d80b7aeabc539538c6ae8962259ac422632d7796", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/bbae784f0456c5a87c89d7c1a3fcc9cbee976c1d", + "reference": "bbae784f0456c5a87c89d7c1a3fcc9cbee976c1d", "shasum": "" }, "require": { @@ -5615,7 +5631,7 @@ "description": "Provides integration for Monolog with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/monolog-bridge/tree/v7.0.8" + "source": "https://github.com/symfony/monolog-bridge/tree/v7.2.0" }, "funding": [ { @@ -5631,7 +5647,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-10-14T18:16:08+00:00" }, { "name": "symfony/monolog-bundle", @@ -5716,16 +5732,16 @@ }, { "name": "symfony/options-resolver", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "19eecfc6f1b0e4b093db7f4a71eedc91843e711a" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/19eecfc6f1b0e4b093db7f4a71eedc91843e711a", - "reference": "19eecfc6f1b0e4b093db7f4a71eedc91843e711a", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { @@ -5763,7 +5779,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.0.8" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -5779,20 +5795,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/password-hasher", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/password-hasher.git", - "reference": "25c66dba8ca72c9636b16e9a4b33d18554969a3f" + "reference": "d8bd3d66d074c0acba1214a0d42f5941a8e1e94d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/password-hasher/zipball/25c66dba8ca72c9636b16e9a4b33d18554969a3f", - "reference": "25c66dba8ca72c9636b16e9a4b33d18554969a3f", + "url": "https://api.github.com/repos/symfony/password-hasher/zipball/d8bd3d66d074c0acba1214a0d42f5941a8e1e94d", + "reference": "d8bd3d66d074c0acba1214a0d42f5941a8e1e94d", "shasum": "" }, "require": { @@ -5835,7 +5851,7 @@ "password" ], "support": { - "source": "https://github.com/symfony/password-hasher/tree/v7.0.8" + "source": "https://github.com/symfony/password-hasher/tree/v7.2.0" }, "funding": [ { @@ -5851,20 +5867,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v7.0.10", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "d2e5a1a4db3993707172c490cea8e9b252d2f677" + "reference": "2bbde92ab25a0e2c88160857af7be9db5da0d145" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/d2e5a1a4db3993707172c490cea8e9b252d2f677", - "reference": "d2e5a1a4db3993707172c490cea8e9b252d2f677", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/2bbde92ab25a0e2c88160857af7be9db5da0d145", + "reference": "2bbde92ab25a0e2c88160857af7be9db5da0d145", "shasum": "" }, "require": { @@ -5917,7 +5933,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v7.0.10" + "source": "https://github.com/symfony/phpunit-bridge/tree/v7.2.0" }, "funding": [ { @@ -5933,7 +5949,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:31:22+00:00" + "time": "2024-11-13T16:15:23+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -6654,16 +6670,16 @@ }, { "name": "symfony/process", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "a358943d5a15277fc6001f47541c08b7d815338f" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/a358943d5a15277fc6001f47541c08b7d815338f", - "reference": "a358943d5a15277fc6001f47541c08b7d815338f", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { @@ -6695,7 +6711,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.0.8" + "source": "https://github.com/symfony/process/tree/v7.2.0" }, "funding": [ { @@ -6711,20 +6727,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/property-access", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "ca11e9661ea88664873dba66412525fe301dd744" + "reference": "3ae42efba01e45aaedecf5c93c8d6a3ab3a82276" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/ca11e9661ea88664873dba66412525fe301dd744", - "reference": "ca11e9661ea88664873dba66412525fe301dd744", + "url": "https://api.github.com/repos/symfony/property-access/zipball/3ae42efba01e45aaedecf5c93c8d6a3ab3a82276", + "reference": "3ae42efba01e45aaedecf5c93c8d6a3ab3a82276", "shasum": "" }, "require": { @@ -6771,7 +6787,7 @@ "reflection" ], "support": { - "source": "https://github.com/symfony/property-access/tree/v7.0.8" + "source": "https://github.com/symfony/property-access/tree/v7.2.0" }, "funding": [ { @@ -6787,35 +6803,35 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-09-26T12:28:35+00:00" }, { "name": "symfony/property-info", - "version": "v7.0.10", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "ee413c259f1af416e306709ef699102afd56c27a" + "reference": "1dfeb0dac7a99f7b3be42db9ccc299c5a6483fcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/ee413c259f1af416e306709ef699102afd56c27a", - "reference": "ee413c259f1af416e306709ef699102afd56c27a", + "url": "https://api.github.com/repos/symfony/property-info/zipball/1dfeb0dac7a99f7b3be42db9ccc299c5a6483fcf", + "reference": "1dfeb0dac7a99f7b3be42db9ccc299c5a6483fcf", "shasum": "" }, "require": { "php": ">=8.2", - "symfony/string": "^6.4|^7.0" + "symfony/string": "^6.4|^7.0", + "symfony/type-info": "~7.1.9|^7.2.2" }, "conflict": { "phpdocumentor/reflection-docblock": "<5.2", "phpdocumentor/type-resolver": "<1.5.1", - "symfony/dependency-injection": "<6.4", - "symfony/serializer": "<6.4" + "symfony/dependency-injection": "<6.4" }, "require-dev": { "phpdocumentor/reflection-docblock": "^5.2", - "phpstan/phpdoc-parser": "^1.0", + "phpstan/phpdoc-parser": "^1.0|^2.0", "symfony/cache": "^6.4|^7.0", "symfony/dependency-injection": "^6.4|^7.0", "symfony/serializer": "^6.4|^7.0" @@ -6854,7 +6870,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v7.0.10" + "source": "https://github.com/symfony/property-info/tree/v7.2.2" }, "funding": [ { @@ -6870,20 +6886,20 @@ "type": "tidelift" } ], - "time": "2024-07-26T07:32:22+00:00" + "time": "2024-12-31T11:04:50+00:00" }, { "name": "symfony/routing", - "version": "v7.0.10", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "ed9fe56db2eb080b4fc1ecea9d66277ef6d1fb8a" + "reference": "e10a2450fa957af6c448b9b93c9010a4e4c0725e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/ed9fe56db2eb080b4fc1ecea9d66277ef6d1fb8a", - "reference": "ed9fe56db2eb080b4fc1ecea9d66277ef6d1fb8a", + "url": "https://api.github.com/repos/symfony/routing/zipball/e10a2450fa957af6c448b9b93c9010a4e4c0725e", + "reference": "e10a2450fa957af6c448b9b93c9010a4e4c0725e", "shasum": "" }, "require": { @@ -6935,7 +6951,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v7.0.10" + "source": "https://github.com/symfony/routing/tree/v7.2.0" }, "funding": [ { @@ -6951,20 +6967,20 @@ "type": "tidelift" } ], - "time": "2024-07-17T06:06:58+00:00" + "time": "2024-11-25T11:08:51+00:00" }, { "name": "symfony/runtime", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/runtime.git", - "reference": "ea34522c447dd91a2b31cb330ee4540a56ba53f6" + "reference": "2c350568f3eaccb25fbbbf962bd67cde273121a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/runtime/zipball/ea34522c447dd91a2b31cb330ee4540a56ba53f6", - "reference": "ea34522c447dd91a2b31cb330ee4540a56ba53f6", + "url": "https://api.github.com/repos/symfony/runtime/zipball/2c350568f3eaccb25fbbbf962bd67cde273121a7", + "reference": "2c350568f3eaccb25fbbbf962bd67cde273121a7", "shasum": "" }, "require": { @@ -7014,7 +7030,7 @@ "runtime" ], "support": { - "source": "https://github.com/symfony/runtime/tree/v7.0.8" + "source": "https://github.com/symfony/runtime/tree/v7.2.0" }, "funding": [ { @@ -7030,20 +7046,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-11-06T11:43:25+00:00" }, { "name": "symfony/security-bundle", - "version": "v7.0.10", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "c9a134cffcb4ca10bebe22a69f1322b2db3082e1" + "reference": "e7b04b503a4eb49307b9997ac9370f403c2f5198" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/c9a134cffcb4ca10bebe22a69f1322b2db3082e1", - "reference": "c9a134cffcb4ca10bebe22a69f1322b2db3082e1", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/e7b04b503a4eb49307b9997ac9370f403c2f5198", + "reference": "e7b04b503a4eb49307b9997ac9370f403c2f5198", "shasum": "" }, "require": { @@ -7052,14 +7068,14 @@ "php": ">=8.2", "symfony/clock": "^6.4|^7.0", "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4.11|^7.1.4", "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", "symfony/password-hasher": "^6.4|^7.0", - "symfony/security-core": "^6.4|^7.0", + "symfony/security-core": "^7.2", "symfony/security-csrf": "^6.4|^7.0", - "symfony/security-http": "^6.4|^7.0", + "symfony/security-http": "^7.2", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -7091,13 +7107,8 @@ "symfony/twig-bundle": "^6.4|^7.0", "symfony/validator": "^6.4|^7.0", "symfony/yaml": "^6.4|^7.0", - "twig/twig": "^3.0.4", - "web-token/jwt-checker": "^3.1", - "web-token/jwt-signature-algorithm-ecdsa": "^3.1", - "web-token/jwt-signature-algorithm-eddsa": "^3.1", - "web-token/jwt-signature-algorithm-hmac": "^3.1", - "web-token/jwt-signature-algorithm-none": "^3.1", - "web-token/jwt-signature-algorithm-rsa": "^3.1" + "twig/twig": "^3.12", + "web-token/jwt-library": "^3.3.2|^4.0" }, "type": "symfony-bundle", "autoload": { @@ -7125,7 +7136,7 @@ "description": "Provides a tight integration of the Security component into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-bundle/tree/v7.0.10" + "source": "https://github.com/symfony/security-bundle/tree/v7.2.2" }, "funding": [ { @@ -7141,29 +7152,31 @@ "type": "tidelift" } ], - "time": "2024-07-24T07:06:56+00:00" + "time": "2024-12-30T18:55:54+00:00" }, { "name": "symfony/security-core", - "version": "v7.0.10", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/security-core.git", - "reference": "6048754a72768c43419129d3e1c5b2cf7e349adc" + "reference": "fdbf318b939a86f89b0c071f60b9d551261d3cc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/6048754a72768c43419129d3e1c5b2cf7e349adc", - "reference": "6048754a72768c43419129d3e1c5b2cf7e349adc", + "url": "https://api.github.com/repos/symfony/security-core/zipball/fdbf318b939a86f89b0c071f60b9d551261d3cc1", + "reference": "fdbf318b939a86f89b0c071f60b9d551261d3cc1", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/event-dispatcher-contracts": "^2.5|^3", "symfony/password-hasher": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { + "symfony/dependency-injection": "<6.4", "symfony/event-dispatcher": "<6.4", "symfony/http-foundation": "<6.4", "symfony/ldap": "<6.4", @@ -7175,6 +7188,7 @@ "psr/container": "^1.1|^2.0", "psr/log": "^1|^2|^3", "symfony/cache": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", "symfony/event-dispatcher": "^6.4|^7.0", "symfony/expression-language": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", @@ -7209,7 +7223,7 @@ "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-core/tree/v7.0.10" + "source": "https://github.com/symfony/security-core/tree/v7.2.0" }, "funding": [ { @@ -7225,20 +7239,20 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:31:22+00:00" + "time": "2024-11-27T09:50:52+00:00" }, { "name": "symfony/security-csrf", - "version": "v7.0.8", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/security-csrf.git", - "reference": "40543b13b35999316d3f79a18d0d4075f30b8d9b" + "reference": "a2031e57dc02002163770a5cc02fafdd70decf1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-csrf/zipball/40543b13b35999316d3f79a18d0d4075f30b8d9b", - "reference": "40543b13b35999316d3f79a18d0d4075f30b8d9b", + "url": "https://api.github.com/repos/symfony/security-csrf/zipball/a2031e57dc02002163770a5cc02fafdd70decf1d", + "reference": "a2031e57dc02002163770a5cc02fafdd70decf1d", "shasum": "" }, "require": { @@ -7249,7 +7263,9 @@ "symfony/http-foundation": "<6.4" }, "require-dev": { - "symfony/http-foundation": "^6.4|^7.0" + "psr/log": "^1|^2|^3", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -7277,7 +7293,7 @@ "description": "Symfony Security Component - CSRF Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-csrf/tree/v7.0.8" + "source": "https://github.com/symfony/security-csrf/tree/v7.2.2" }, "funding": [ { @@ -7293,29 +7309,30 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-12-20T09:56:48+00:00" }, { "name": "symfony/security-http", - "version": "v7.0.9", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/security-http.git", - "reference": "828b0ce72c7e178aa56c6694f1ba9593cac531d9" + "reference": "125844598d9cef4fe72a9f6c4a78ac7c59c3f532" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-http/zipball/828b0ce72c7e178aa56c6694f1ba9593cac531d9", - "reference": "828b0ce72c7e178aa56c6694f1ba9593cac531d9", + "url": "https://api.github.com/repos/symfony/security-http/zipball/125844598d9cef4fe72a9f6c4a78ac7c59c3f532", + "reference": "125844598d9cef4fe72a9f6c4a78ac7c59c3f532", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", "symfony/polyfill-mbstring": "~1.0", "symfony/property-access": "^6.4|^7.0", - "symfony/security-core": "^6.4|^7.0", + "symfony/security-core": "^7.2", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -7330,13 +7347,13 @@ "symfony/cache": "^6.4|^7.0", "symfony/clock": "^6.4|^7.0", "symfony/expression-language": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", "symfony/http-client-contracts": "^3.0", "symfony/rate-limiter": "^6.4|^7.0", "symfony/routing": "^6.4|^7.0", "symfony/security-csrf": "^6.4|^7.0", "symfony/translation": "^6.4|^7.0", - "web-token/jwt-checker": "^3.1", - "web-token/jwt-signature-algorithm-ecdsa": "^3.1" + "web-token/jwt-library": "^3.3.2|^4.0" }, "type": "library", "autoload": { @@ -7364,7 +7381,7 @@ "description": "Symfony Security Component - HTTP Integration", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-http/tree/v7.0.9" + "source": "https://github.com/symfony/security-http/tree/v7.2.1" }, "funding": [ { @@ -7380,24 +7397,25 @@ "type": "tidelift" } ], - "time": "2024-06-22T11:38:48+00:00" + "time": "2024-12-07T08:50:44+00:00" }, { "name": "symfony/serializer", - "version": "v7.0.10", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "79b073ce21280bae2567cf1c48ae078dc3eeb01d" + "reference": "3f5ed9f5e6c02e3853109190ba38408f5e1d2dd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/79b073ce21280bae2567cf1c48ae078dc3eeb01d", - "reference": "79b073ce21280bae2567cf1c48ae078dc3eeb01d", + "url": "https://api.github.com/repos/symfony/serializer/zipball/3f5ed9f5e6c02e3853109190ba38408f5e1d2dd0", + "reference": "3f5ed9f5e6c02e3853109190ba38408f5e1d2dd0", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -7412,11 +7430,12 @@ }, "require-dev": { "phpdocumentor/reflection-docblock": "^3.2|^4.0|^5.0", + "phpstan/phpdoc-parser": "^1.0|^2.0", "seld/jsonlint": "^1.10", "symfony/cache": "^6.4|^7.0", "symfony/config": "^6.4|^7.0", "symfony/console": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", + "symfony/dependency-injection": "^7.2", "symfony/error-handler": "^6.4|^7.0", "symfony/filesystem": "^6.4|^7.0", "symfony/form": "^6.4|^7.0", @@ -7427,6 +7446,7 @@ "symfony/property-access": "^6.4|^7.0", "symfony/property-info": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3", + "symfony/type-info": "^7.1", "symfony/uid": "^6.4|^7.0", "symfony/validator": "^6.4|^7.0", "symfony/var-dumper": "^6.4|^7.0", @@ -7459,7 +7479,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v7.0.10" + "source": "https://github.com/symfony/serializer/tree/v7.2.0" }, "funding": [ { @@ -7475,7 +7495,7 @@ "type": "tidelift" } ], - "time": "2024-07-17T06:06:58+00:00" + "time": "2024-11-25T15:21:05+00:00" }, { "name": "symfony/service-contracts", @@ -7631,16 +7651,16 @@ }, { "name": "symfony/stopwatch", - "version": "v7.0.8", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "e4a0d6fef3dd428ca23172e62d1d863f6f25d541" + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e4a0d6fef3dd428ca23172e62d1d863f6f25d541", - "reference": "e4a0d6fef3dd428ca23172e62d1d863f6f25d541", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e46690d5b9d7164a6d061cab1e8d46141b9f49df", + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df", "shasum": "" }, "require": { @@ -7673,7 +7693,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.0.8" + "source": "https://github.com/symfony/stopwatch/tree/v7.2.2" }, "funding": [ { @@ -7689,20 +7709,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-12-18T14:28:33+00:00" }, { "name": "symfony/string", - "version": "v7.0.10", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a1ac40b358a5e45c2b6c32ec9b183828c1dcf5d6" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a1ac40b358a5e45c2b6c32ec9b183828c1dcf5d6", - "reference": "a1ac40b358a5e45c2b6c32ec9b183828c1dcf5d6", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { @@ -7716,6 +7736,7 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { + "symfony/emoji": "^7.1", "symfony/error-handler": "^6.4|^7.0", "symfony/http-client": "^6.4|^7.0", "symfony/intl": "^6.4|^7.0", @@ -7759,7 +7780,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.0.10" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { @@ -7775,24 +7796,25 @@ "type": "tidelift" } ], - "time": "2024-07-22T10:25:05+00:00" + "time": "2024-11-13T13:31:26+00:00" }, { "name": "symfony/translation", - "version": "v7.0.10", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "480fc1b9f44d9104239eb36de1e1151814c8a8d8" + "reference": "e2674a30132b7cc4d74540d6c2573aa363f05923" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/480fc1b9f44d9104239eb36de1e1151814c8a8d8", - "reference": "480fc1b9f44d9104239eb36de1e1151814c8a8d8", + "url": "https://api.github.com/repos/symfony/translation/zipball/e2674a30132b7cc4d74540d6c2573aa363f05923", + "reference": "e2674a30132b7cc4d74540d6c2573aa363f05923", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/translation-contracts": "^2.5|^3.0" }, @@ -7853,7 +7875,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v7.0.10" + "source": "https://github.com/symfony/translation/tree/v7.2.2" }, "funding": [ { @@ -7869,7 +7891,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:31:22+00:00" + "time": "2024-12-07T08:18:10+00:00" }, { "name": "symfony/translation-contracts", @@ -7951,22 +7973,23 @@ }, { "name": "symfony/twig-bridge", - "version": "v7.0.8", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "c8e05d7545962198df715d705c132de0674dc5b2" + "reference": "29e4c66de9618e67dc1f5f13bc667aca2a228f1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/c8e05d7545962198df715d705c132de0674dc5b2", - "reference": "c8e05d7545962198df715d705c132de0674dc5b2", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/29e4c66de9618e67dc1f5f13bc667aca2a228f1e", + "reference": "29e4c66de9618e67dc1f5f13bc667aca2a228f1e", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/translation-contracts": "^2.5|^3", - "twig/twig": "^3.0.4" + "twig/twig": "^3.12" }, "conflict": { "phpdocumentor/reflection-docblock": "<3.2.2", @@ -7988,6 +8011,7 @@ "symfony/asset-mapper": "^6.4|^7.0", "symfony/console": "^6.4|^7.0", "symfony/dependency-injection": "^6.4|^7.0", + "symfony/emoji": "^7.1", "symfony/expression-language": "^6.4|^7.0", "symfony/finder": "^6.4|^7.0", "symfony/form": "^6.4|^7.0", @@ -8039,7 +8063,7 @@ "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bridge/tree/v7.0.8" + "source": "https://github.com/symfony/twig-bridge/tree/v7.2.2" }, "funding": [ { @@ -8055,20 +8079,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-12-19T14:25:03+00:00" }, { "name": "symfony/twig-bundle", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/twig-bundle.git", - "reference": "a90e474bc260e59bed98a556db63673e6420a0be" + "reference": "cd2be4563afaef5285bb6e0a06c5445e644a5c01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/a90e474bc260e59bed98a556db63673e6420a0be", - "reference": "a90e474bc260e59bed98a556db63673e6420a0be", + "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/cd2be4563afaef5285bb6e0a06c5445e644a5c01", + "reference": "cd2be4563afaef5285bb6e0a06c5445e644a5c01", "shasum": "" }, "require": { @@ -8079,7 +8103,7 @@ "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", "symfony/twig-bridge": "^6.4|^7.0", - "twig/twig": "^3.0.4" + "twig/twig": "^3.12" }, "conflict": { "symfony/framework-bundle": "<6.4", @@ -8123,7 +8147,7 @@ "description": "Provides a tight integration of Twig into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bundle/tree/v7.0.8" + "source": "https://github.com/symfony/twig-bundle/tree/v7.2.0" }, "funding": [ { @@ -8139,20 +8163,95 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-10-23T08:11:15+00:00" + }, + { + "name": "symfony/type-info", + "version": "v7.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/type-info.git", + "reference": "3b5a17470fff0034f25fd4287cbdaa0010d2f749" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/type-info/zipball/3b5a17470fff0034f25fd4287cbdaa0010d2f749", + "reference": "3b5a17470fff0034f25fd4287cbdaa0010d2f749", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/container": "^1.1|^2.0" + }, + "require-dev": { + "phpstan/phpdoc-parser": "^1.0|^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\TypeInfo\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mathias Arlaud", + "email": "mathias.arlaud@gmail.com" + }, + { + "name": "Baptiste LEDUC", + "email": "baptiste.leduc@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Extracts PHP types information.", + "homepage": "https://symfony.com", + "keywords": [ + "PHPStan", + "phpdoc", + "symfony", + "type" + ], + "support": { + "source": "https://github.com/symfony/type-info/tree/v7.2.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-20T13:38:37+00:00" }, { "name": "symfony/uid", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "82d01607b09ba79f38efe4c213dbf528ff0beeed" + "reference": "2d294d0c48df244c71c105a169d0190bfb080426" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/82d01607b09ba79f38efe4c213dbf528ff0beeed", - "reference": "82d01607b09ba79f38efe4c213dbf528ff0beeed", + "url": "https://api.github.com/repos/symfony/uid/zipball/2d294d0c48df244c71c105a169d0190bfb080426", + "reference": "2d294d0c48df244c71c105a169d0190bfb080426", "shasum": "" }, "require": { @@ -8197,7 +8296,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v7.0.8" + "source": "https://github.com/symfony/uid/tree/v7.2.0" }, "funding": [ { @@ -8213,20 +8312,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/var-dumper", - "version": "v7.0.10", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3b5bed54f7c541aa0bf4cb0d3eb63b9e422ccb8b" + "reference": "c6a22929407dec8765d6e2b6ff85b800b245879c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3b5bed54f7c541aa0bf4cb0d3eb63b9e422ccb8b", - "reference": "3b5bed54f7c541aa0bf4cb0d3eb63b9e422ccb8b", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c6a22929407dec8765d6e2b6ff85b800b245879c", + "reference": "c6a22929407dec8765d6e2b6ff85b800b245879c", "shasum": "" }, "require": { @@ -8242,7 +8341,7 @@ "symfony/http-kernel": "^6.4|^7.0", "symfony/process": "^6.4|^7.0", "symfony/uid": "^6.4|^7.0", - "twig/twig": "^3.0.4" + "twig/twig": "^3.12" }, "bin": [ "Resources/bin/var-dump-server" @@ -8280,7 +8379,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.0.10" + "source": "https://github.com/symfony/var-dumper/tree/v7.2.0" }, "funding": [ { @@ -8296,20 +8395,20 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:31:22+00:00" + "time": "2024-11-08T15:48:14+00:00" }, { "name": "symfony/var-exporter", - "version": "v7.0.9", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "18053b0e249c7303f9461f78d15cceae69c83b02" + "reference": "1a6a89f95a46af0f142874c9d650a6358d13070d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/18053b0e249c7303f9461f78d15cceae69c83b02", - "reference": "18053b0e249c7303f9461f78d15cceae69c83b02", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/1a6a89f95a46af0f142874c9d650a6358d13070d", + "reference": "1a6a89f95a46af0f142874c9d650a6358d13070d", "shasum": "" }, "require": { @@ -8356,7 +8455,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.0.9" + "source": "https://github.com/symfony/var-exporter/tree/v7.2.0" }, "funding": [ { @@ -8372,20 +8471,20 @@ "type": "tidelift" } ], - "time": "2024-06-28T07:59:17+00:00" + "time": "2024-10-18T07:58:17+00:00" }, { "name": "symfony/web-link", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/web-link.git", - "reference": "270f39e3d1c7cc62b5a931fd6e9f2ea4e99ee9cf" + "reference": "f537556a885e14a1d28f6c759d41e57e93d0a532" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-link/zipball/270f39e3d1c7cc62b5a931fd6e9f2ea4e99ee9cf", - "reference": "270f39e3d1c7cc62b5a931fd6e9f2ea4e99ee9cf", + "url": "https://api.github.com/repos/symfony/web-link/zipball/f537556a885e14a1d28f6c759d41e57e93d0a532", + "reference": "f537556a885e14a1d28f6c759d41e57e93d0a532", "shasum": "" }, "require": { @@ -8439,7 +8538,7 @@ "push" ], "support": { - "source": "https://github.com/symfony/web-link/tree/v7.0.8" + "source": "https://github.com/symfony/web-link/tree/v7.2.0" }, "funding": [ { @@ -8455,20 +8554,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/web-profiler-bundle", - "version": "v7.0.10", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/web-profiler-bundle.git", - "reference": "884ed0470bd703ec40a78dfec94fe971ca55cad6" + "reference": "5d37d9bd86ab49bd94c57e18e601e27fb6760f2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/884ed0470bd703ec40a78dfec94fe971ca55cad6", - "reference": "884ed0470bd703ec40a78dfec94fe971ca55cad6", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/5d37d9bd86ab49bd94c57e18e601e27fb6760f2c", + "reference": "5d37d9bd86ab49bd94c57e18e601e27fb6760f2c", "shasum": "" }, "require": { @@ -8478,12 +8577,13 @@ "symfony/http-kernel": "^6.4|^7.0", "symfony/routing": "^6.4|^7.0", "symfony/twig-bundle": "^6.4|^7.0", - "twig/twig": "^3.0.4" + "twig/twig": "^3.12" }, "conflict": { "symfony/form": "<6.4", "symfony/mailer": "<6.4", - "symfony/messenger": "<6.4" + "symfony/messenger": "<6.4", + "symfony/serializer": "<7.2" }, "require-dev": { "symfony/browser-kit": "^6.4|^7.0", @@ -8520,7 +8620,7 @@ "dev" ], "support": { - "source": "https://github.com/symfony/web-profiler-bundle/tree/v7.0.10" + "source": "https://github.com/symfony/web-profiler-bundle/tree/v7.2.2" }, "funding": [ { @@ -8536,7 +8636,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:31:22+00:00" + "time": "2024-12-11T15:34:14+00:00" }, { "name": "symfony/webpack-encore-bundle", @@ -8612,20 +8712,21 @@ }, { "name": "symfony/yaml", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "89bdddd79e918448ce978be664768ef27b9e5798" + "reference": "099581e99f557e9f16b43c5916c26380b54abb22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/89bdddd79e918448ce978be664768ef27b9e5798", - "reference": "89bdddd79e918448ce978be664768ef27b9e5798", + "url": "https://api.github.com/repos/symfony/yaml/zipball/099581e99f557e9f16b43c5916c26380b54abb22", + "reference": "099581e99f557e9f16b43c5916c26380b54abb22", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -8663,7 +8764,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v7.0.8" + "source": "https://github.com/symfony/yaml/tree/v7.2.0" }, "funding": [ { @@ -8679,7 +8780,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-10-23T06:56:12+00:00" }, { "name": "twig/extra-bundle", @@ -9376,16 +9477,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.66.0", + "version": "v3.68.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "5f5f2a142ff36b93c41885bca29cc5f861c013e6" + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/5f5f2a142ff36b93c41885bca29cc5f861c013e6", - "reference": "5f5f2a142ff36b93c41885bca29cc5f861c013e6", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b9db2b2ea3cdba7201067acee46f984ef2397cff", + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff", "shasum": "" }, "require": { @@ -9402,17 +9503,17 @@ "react/promise": "^2.0 || ^3.0", "react/socket": "^1.0", "react/stream": "^1.0", - "sebastian/diff": "^4.0 || ^5.0 || ^6.0", - "symfony/console": "^5.4 || ^6.0 || ^7.0", - "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", - "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", - "symfony/finder": "^5.4 || ^6.0 || ^7.0", - "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", - "symfony/polyfill-mbstring": "^1.28", - "symfony/polyfill-php80": "^1.28", - "symfony/polyfill-php81": "^1.28", - "symfony/process": "^5.4 || ^6.0 || ^7.0 <7.2", - "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + "sebastian/diff": "^4.0 || ^5.1 || ^6.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" }, "require-dev": { "facile-it/paraunit": "^1.3.1 || ^2.4", @@ -9424,9 +9525,9 @@ "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", - "phpunit/phpunit": "^9.6.21 || ^10.5.38 || ^11.4.3", - "symfony/var-dumper": "^5.4.47 || ^6.4.15 || ^7.1.8", - "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.1.6" + "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", + "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -9467,7 +9568,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.66.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.1" }, "funding": [ { @@ -9475,7 +9576,7 @@ "type": "github" } ], - "time": "2024-12-29T13:46:23+00:00" + "time": "2025-01-17T09:20:36+00:00" }, { "name": "masterminds/html5", @@ -10256,16 +10357,16 @@ }, { "name": "symfony/browser-kit", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "0030d568e9147b853e168117edf72b74f9643e85" + "reference": "8d64d17e198082f8f198d023a6b634e7b5fdda94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/0030d568e9147b853e168117edf72b74f9643e85", - "reference": "0030d568e9147b853e168117edf72b74f9643e85", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/8d64d17e198082f8f198d023a6b634e7b5fdda94", + "reference": "8d64d17e198082f8f198d023a6b634e7b5fdda94", "shasum": "" }, "require": { @@ -10304,7 +10405,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v7.0.8" + "source": "https://github.com/symfony/browser-kit/tree/v7.2.0" }, "funding": [ { @@ -10320,20 +10421,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/css-selector", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "63b9f8c9b3c28c43ad06764c67fe092af2576d17" + "reference": "601a5ce9aaad7bf10797e3663faefce9e26c24e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/63b9f8c9b3c28c43ad06764c67fe092af2576d17", - "reference": "63b9f8c9b3c28c43ad06764c67fe092af2576d17", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/601a5ce9aaad7bf10797e3663faefce9e26c24e2", + "reference": "601a5ce9aaad7bf10797e3663faefce9e26c24e2", "shasum": "" }, "require": { @@ -10369,7 +10470,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v7.0.8" + "source": "https://github.com/symfony/css-selector/tree/v7.2.0" }, "funding": [ { @@ -10385,20 +10486,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/dom-crawler", - "version": "v7.0.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "46cdbb48603db7b9ea55172d3edb6b3e9de58028" + "reference": "b176e1f1f550ef44c94eb971bf92488de08f7c6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/46cdbb48603db7b9ea55172d3edb6b3e9de58028", - "reference": "46cdbb48603db7b9ea55172d3edb6b3e9de58028", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b176e1f1f550ef44c94eb971bf92488de08f7c6b", + "reference": "b176e1f1f550ef44c94eb971bf92488de08f7c6b", "shasum": "" }, "require": { @@ -10436,7 +10537,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v7.0.8" + "source": "https://github.com/symfony/dom-crawler/tree/v7.2.0" }, "funding": [ { @@ -10452,7 +10553,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:55:39+00:00" + "time": "2024-11-13T16:15:23+00:00" } ], "aliases": [], diff --git a/rector.php b/rector.php index 60a67237..94e8a432 100644 --- a/rector.php +++ b/rector.php @@ -12,7 +12,7 @@ ->withSkipPath(__DIR__.'/node_modules') ->withSymfonyContainerXml(__DIR__.'/var/cache/dev/App_KernelDevDebugContainer.xml') ->withSets([ - SymfonySetList::SYMFONY_70, + SymfonySetList::SYMFONY_72, SymfonySetList::SYMFONY_CODE_QUALITY, SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, ]); From 12c6d3dca7f02a51748d357cd82bf2725b5381da Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Tue, 21 Jan 2025 22:23:25 +0100 Subject: [PATCH 40/52] refactor: remove axios in stimulus controllers --- assets/controllers/modal_controller.js | 10 +++++----- assets/controllers/text-edit_controller.js | 11 ++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/assets/controllers/modal_controller.js b/assets/controllers/modal_controller.js index 0c68acf2..0c6500e5 100644 --- a/assets/controllers/modal_controller.js +++ b/assets/controllers/modal_controller.js @@ -1,5 +1,4 @@ import { Controller } from '@hotwired/stimulus'; -import axios from 'axios'; export default class extends Controller { static targets = [ "modalOverlay" ] @@ -53,12 +52,13 @@ export default class extends Controller { window.location.href = url; } - postToUrl(url) { - axios.post(url).then(() => { + async postToUrl(url) { + try { + await fetch(url, { method: 'POST' }); location.reload(); - }).catch((error) => { + } catch (error) { console.log(error); - }); + } } } \ No newline at end of file diff --git a/assets/controllers/text-edit_controller.js b/assets/controllers/text-edit_controller.js index a38fd9bc..6277ca2d 100644 --- a/assets/controllers/text-edit_controller.js +++ b/assets/controllers/text-edit_controller.js @@ -1,5 +1,5 @@ import { Controller } from '@hotwired/stimulus'; -import axios from 'axios'; + export default class extends Controller { static targets = [ "displayArea", "inputArea", "input"] static values = { @@ -37,13 +37,14 @@ export default class extends Controller { this.inputTarget.value = this.textValue; } - postToUrl(url, value) { - axios.post(url, value).then((data) => { + async postToUrl(url, value) { + try { + const data = await fetch(url, { method: 'POST', body: value }); console.log(data); location.reload(); - }).catch((error) => { + } catch (error) { throw new Error("text-edit-controller: Could not save text: " + error); - }); + } } toggleEditMode() { From 732a9a3e40a26e17c7195a040f4c4ca2b1f1dd62 Mon Sep 17 00:00:00 2001 From: Joel Beckmann Date: Wed, 22 Jan 2025 12:15:17 +0100 Subject: [PATCH 41/52] refactor: automatically resolve entities from controller routes --- src/Controller/AdministrationController.php | 13 +- src/Controller/CodebookController.php | 64 +++++---- src/Controller/ExportController.php | 19 +-- src/Controller/FileManagementController.php | 130 ++++++++---------- src/Controller/NavigationController.php | 16 +-- src/Controller/ReviewController.php | 9 +- src/Controller/StudyController.php | 96 ++++++------- .../components/_fileDisplayCard.html.twig | 6 +- .../components/_navigationSidebar.html.twig | 26 ++-- templates/components/_reviewValue.html.twig | 2 +- templates/layouts/codebook.html.twig | 4 +- .../administration/admin/studies.html.twig | 4 +- .../pages/administration/admin/user.html.twig | 4 +- templates/pages/codebook/index.html.twig | 2 +- templates/pages/export/export.html.twig | 2 +- .../pages/study/_datasetImportModal.html.twig | 4 +- templates/pages/study/datasets.html.twig | 8 +- templates/pages/study/introduction.html.twig | 2 +- templates/pages/study/overview.html.twig | 8 +- templates/pages/study/settings.html.twig | 2 +- 20 files changed, 189 insertions(+), 232 deletions(-) diff --git a/src/Controller/AdministrationController.php b/src/Controller/AdministrationController.php index 2b8597b1..1bb3c9cd 100644 --- a/src/Controller/AdministrationController.php +++ b/src/Controller/AdministrationController.php @@ -34,12 +34,11 @@ public function listUser(): Response ); } - #[Route(path: '/admin/user/{uid}', name: 'admin_user_edit', methods: ['GET', 'POST'])] - public function editUserDetails(Request $request, string $uid): Response + #[Route(path: '/admin/user/{id}', name: 'admin_user_edit', methods: ['GET', 'POST'])] + public function editUserDetails(DataWizUser $user, Request $request): Response { - $this->logger->debug("AdministrationController::editUserDetails: Enter with uuid: {$uid}"); + $this->logger->debug("AdministrationController::editUserDetails: Enter with uuid: {$user->getId()}"); - $user = $this->em->getRepository(DataWizUser::class)->find($uid); $form = $this->createForm(UserDetailForm::class, $user, ['allow_edit_roles' => true]); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { @@ -69,15 +68,15 @@ public function listStudies(): Response ); } - #[Route(path: '/admin/user/{uid}/studies', name: 'admin_user_studies', methods: ['GET'])] - public function listStudiesForUser(string $uid): Response + #[Route(path: '/admin/user/{id}/studies', name: 'admin_user_studies', methods: ['GET'])] + public function listStudiesForUser(DataWizUser $owner): Response { $this->logger->debug('AdministrationController::listStudies: Enter'); return $this->render( 'pages/administration/admin/studies.html.twig', [ - 'studies' => $this->em->getRepository(Experiment::class)->findBy(['owner' => $this->em->getRepository(DataWizUser::class)->find($uid)]), + 'studies' => $this->em->getRepository(Experiment::class)->findBy(['owner' => $owner]), 'backPath' => $this->generateUrl('admin_user'), ] ); diff --git a/src/Controller/CodebookController.php b/src/Controller/CodebookController.php index d0c38f4f..129a375e 100644 --- a/src/Controller/CodebookController.php +++ b/src/Controller/CodebookController.php @@ -23,22 +23,25 @@ #[IsGranted('ROLE_USER')] class CodebookController extends AbstractController { - public function __construct(protected EntityManagerInterface $em, protected LoggerInterface $logger, private readonly FilesystemOperator $matrixFilesystem) {} - - #[Route(path: '/{uuid}', name: 'index', methods: ['GET'])] - public function codebookIndex(string $uuid): Response + public function __construct( + protected EntityManagerInterface $em, + protected LoggerInterface $logger, + private readonly FilesystemOperator $matrixFilesystem, + ) {} + + #[Route(path: '/{id}', name: 'index', methods: ['GET'])] + public function codebookIndex(Dataset $dataset): Response { return $this->render('pages/codebook/index.html.twig', [ - 'codebook' => $this->em->getRepository(Dataset::class)->find($uuid), + 'codebook' => $dataset, ]); } - #[Route(path: '/{uuid}/data', name: 'dataupdate', methods: ['GET', 'POST'])] - public function performUpdate(string $uuid, Request $request): JsonResponse + #[Route(path: '/{id}/data', name: 'dataupdate', methods: ['GET', 'POST'])] + public function performUpdate(Dataset $dataset, Request $request): JsonResponse { - $this->logger->debug("Enter CodebookController::performUpdateAction with [UUID: {$uuid}]"); - $dataset = $this->em->getRepository(Dataset::class)->find($uuid); - if ($dataset && $request->isMethod('POST')) { + $this->logger->debug("Enter CodebookController::performUpdateAction with [UUID: {$dataset->getId()}]"); + if ($request->isMethod('POST')) { $postedData = json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR); $this->saveCodebookVariables($postedData); } @@ -47,19 +50,16 @@ public function performUpdate(string $uuid, Request $request): JsonResponse return new JsonResponse($jsonCodebook, $jsonCodebook != null ? Response::HTTP_OK : Response::HTTP_NO_CONTENT); } - #[Route(path: '/{uuid}/measures', name: 'measures', methods: ['GET'])] - public function createViewMeasures(string $uuid): JsonResponse + #[Route(path: '/{id}/measures', name: 'measures', methods: ['GET'])] + public function createViewMeasures(Dataset $dataset): JsonResponse { - $this->logger->debug("Enter CodebookController::createViewMeasuresAction with [UUID: {$uuid}]"); - $dataset = $this->em->getRepository(Dataset::class)->find($uuid); + $this->logger->debug("Enter CodebookController::createViewMeasuresAction with [UUID: {$dataset->getId()}]"); $viewMeasures = []; - if ($dataset) { - $measures = $this->em->getRepository(MeasureMetaDataGroup::class)->findOneBy(['experiment' => $dataset->getExperiment()]); - if ($measures && $measures->getMeasures()) { - foreach ($measures->getMeasures() as $measure) { - if ($measure && $measure != '') { - $viewMeasures['measures'][] = $measure; - } + $measures = $this->em->getRepository(MeasureMetaDataGroup::class)->findOneBy(['experiment' => $dataset->getExperiment()]); + if ($measures && $measures->getMeasures()) { + foreach ($measures->getMeasures() as $measure) { + if ($measure && $measure != '') { + $viewMeasures['measures'][] = $measure; } } } @@ -67,26 +67,24 @@ public function createViewMeasures(string $uuid): JsonResponse return new JsonResponse($viewMeasures, key_exists('measures', $viewMeasures) ? Response::HTTP_OK : Response::HTTP_NO_CONTENT); } - #[Route(path: '/{uuid}/matrix', name: 'matrix', methods: ['GET'])] - public function datasetMatrix(Request $request, string $uuid): JsonResponse + #[Route(path: '/{id}/matrix', name: 'matrix', methods: ['GET'])] + public function datasetMatrix(Request $request, Dataset $dataset): JsonResponse { $size = $request->get('size') ?? 0; $page = $request->get('page') ?? 1; - $this->logger->debug("Enter CodebookController::datasetMatrixAction with [UUID: {$uuid}]"); - $dataset = $this->em->getRepository(Dataset::class)->find($uuid); + $this->logger->debug("Enter CodebookController::datasetMatrixAction with [UUID: {$dataset->getId()}]"); $response = null; - if ($dataset) { - foreach ($dataset->getCodebook() as $var) { - $response['header'][] = $var->getName(); - } + + foreach ($dataset->getCodebook() as $var) { + $response['header'][] = $var->getName(); } try { - if (!$this->matrixFilesystem->has($uuid.'.csv')) { + if (!$this->matrixFilesystem->has($dataset->getId().'.csv')) { return new JsonResponse($response, Response::HTTP_OK); } - $file = Reader::createFromString($this->matrixFilesystem->read($uuid.'.csv')); + $file = Reader::createFromString($this->matrixFilesystem->read($dataset->getId().'.csv')); if ($file->count() === 0) { $response['error'] = 'error.dataset.matrix.empty'; return new JsonResponse($response, Response::HTTP_UNPROCESSABLE_ENTITY); @@ -110,11 +108,11 @@ public function datasetMatrix(Request $request, string $uuid): JsonResponse $response['pagination']['max_pages'] = ceil($file->count() / $size); } } catch (FilesystemException $e) { - $this->logger->critical("FileSystemException in CodebookController::createViewMeasuresAction [UUID: {$uuid}] Exception: ".$e->getMessage()); + $this->logger->critical("FileSystemException in CodebookController::createViewMeasuresAction [UUID: {$dataset->getId()}] Exception: ".$e->getMessage()); $response['error'] = 'error.dataset.matrix.notFound'; return new JsonResponse($response, Response::HTTP_UNPROCESSABLE_ENTITY); } catch (UnableToProcessCsv $e) { - $this->logger->critical("UnableToProcessCsv in CodebookController::createViewMeasuresAction [UUID: {$uuid}] Exception: ".$e->getMessage()); + $this->logger->critical("UnableToProcessCsv in CodebookController::createViewMeasuresAction [UUID: {$dataset->getId()}] Exception: ".$e->getMessage()); $response['error'] = 'error.dataset.matrix.unprocessable'; return new JsonResponse($response, Response::HTTP_UNPROCESSABLE_ENTITY); } diff --git a/src/Controller/ExportController.php b/src/Controller/ExportController.php index 0023ebff..e286bd2f 100644 --- a/src/Controller/ExportController.php +++ b/src/Controller/ExportController.php @@ -47,29 +47,22 @@ public function __construct( ); } - #[Route(path: '/export/{uuid}', name: 'export_index', methods: ['GET'])] - public function exportIndex(string $uuid): Response + #[Route(path: '/export/{id}', name: 'export_index', methods: ['GET'])] + public function exportIndex(Experiment $experiment): Response { - $this->logger->debug("Enter ExportController::exportAction(GET) for UUID: {$uuid}"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter ExportController::exportAction(GET) for UUID: {$experiment->getId()}"); return $this->render('pages/export/export.html.twig', ['export_error' => null, 'experiment' => $experiment]); } - #[Route(path: '/export/{uuid}', name: 'export_action', methods: ['POST'])] - public function export(Request $request, string $uuid): Response + #[Route(path: '/export/{id}', name: 'export_action', methods: ['POST'])] + public function export(Request $request, Experiment $experiment): Response { - $this->logger->debug("Enter ExportController::exportAction(POST) for UUID: {$uuid}"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter ExportController::exportAction(POST) for UUID: {$experiment->getId()}"); $exportFormat = $request->get('exportFormat'); $exportDataset = $request->get('exportDataset'); $exportMaterial = $request->get('exportMaterial'); - if (!$experiment) { - $this->logger->critical('ExportController::exportAction(POST): Error during getting experiment: Experiment == null'); - return $this->render('pages/export/export.html.twig', ['export_error' => 'error.experiment.empty', 'experiment' => null]); - } - $zip = new \ZipArchive(); $zipName = sys_get_temp_dir().'/'.$this->sanitizeFilename($experiment->getSettingsMetaDataGroup()->getShortName()).'.zip'; diff --git a/src/Controller/FileManagementController.php b/src/Controller/FileManagementController.php index a8cbabf0..93b6c5e0 100644 --- a/src/Controller/FileManagementController.php +++ b/src/Controller/FileManagementController.php @@ -30,33 +30,21 @@ public function __construct( private readonly LoggerInterface $logger ) {} - #[Route(path: '/preview/sav/{fileId}', name: 'preview-sav', methods: ['POST'])] - public function previewSav(string $fileId): JsonResponse + #[Route(path: '/preview/sav/{id}', name: 'preview-sav', methods: ['POST'])] + public function previewSav(Dataset $dataset): JsonResponse { - $this->logger->debug("Enter FileManagementController::previewSavAction with [FileId: {$fileId}]"); - $dataset = $this->em->find(Dataset::class, $fileId); - $data = null; - if ($dataset) { - $data = $this->savImportable->savToArray($dataset); - } + $this->logger->debug("Enter FileManagementController::previewSavAction with [FileId: {$dataset->getId()}]"); + $data = $this->savImportable->savToArray($dataset); - return new JsonResponse($data ?? [], $data != null ? Response::HTTP_OK : Response::HTTP_UNPROCESSABLE_ENTITY); + return new JsonResponse($data, Response::HTTP_OK); } - #[Route(path: '/submit/sav/{fileId}', name: 'submit-sav', methods: ['POST'])] - public function submitSav(string $fileId): JsonResponse + #[Route(path: '/submit/sav/{id}', name: 'submit-sav', methods: ['POST'])] + public function submitSav(Dataset $dataset): JsonResponse { - $this->logger->debug("Enter FileManagementController::previewSavAction with [FileId: {$fileId}]"); - $dataset = $this->em->find(Dataset::class, $fileId); - $data = null; + $this->logger->debug("Enter FileManagementController::previewSavAction with [FileId: {$dataset->getId()}]"); - if ($dataset) { - $data = $this->savImportable->savToArray($dataset); - } - - if (!isset($dataset) or empty($data)) { - return new JsonResponse([], Response::HTTP_UNPROCESSABLE_ENTITY); - } + $data = $this->savImportable->savToArray($dataset); if (key_exists('codebook', $data)) { foreach ($data['codebook'] as $var) { @@ -81,29 +69,29 @@ public function submitSav(string $fileId): JsonResponse return new JsonResponse($data, Response::HTTP_OK); } - #[Route(path: '/preview/csv/{fileId}', name: 'preview-csv', methods: ['POST'])] - public function previewCsv(string $fileId, Request $request): JsonResponse + #[Route(path: '/preview/csv/{id}', name: 'preview-csv', methods: ['POST'])] + public function previewCsv(Dataset $dataset, Request $request): JsonResponse { - $this->logger->debug("Enter FileManagementController::previewCSVAction with [FileId: {$fileId}]"); + $this->logger->debug("Enter FileManagementController::previewCSVAction with [FileId: {$dataset->getId()}]"); $delimiter = $request->get('dataset-import-delimiter') ?? ','; $escape = $request->get('dataset-import-escape') ?? 'double'; $headerRows = filter_var($request->get('dataset-import-header-rows'), FILTER_VALIDATE_INT); if (!$headerRows) { $headerRows = 0; } - $file = $this->em->find(Dataset::class, $fileId); - $data = null; - if ($file) { - $data = $this->csvImportable->csvToArray($file->getStorageName(), $delimiter, $escape, $headerRows, 5); + + $data = $this->csvImportable->csvToArray($dataset->getStorageName(), $delimiter, $escape, $headerRows, 5); + if ($data === null) { + return new JsonResponse(null, Response::HTTP_UNPROCESSABLE_ENTITY); } - return new JsonResponse($data, $data ? Response::HTTP_OK : Response::HTTP_UNPROCESSABLE_ENTITY); + return new JsonResponse($data, Response::HTTP_OK); } - #[Route(path: '/submit/csv/{fileId}', name: 'submit-csv', methods: ['POST'])] - public function submitCSV(string $fileId, Request $request): JsonResponse + #[Route(path: '/submit/csv/{id}', name: 'submit-csv', methods: ['POST'])] + public function submitCSV(Dataset $dataset, Request $request): JsonResponse { - $this->logger->debug("Enter FileManagementController::submitCSVAction with [FileId: {$fileId}]"); + $this->logger->debug("Enter FileManagementController::submitCSVAction with [FileId: {$dataset->getId()}]"); $delimiter = $request->get('dataset-import-delimiter') ?? ','; $escape = $request->get('dataset-import-escape') ?? 'double'; $remove = $request->get('dataset-import-remove') ?? null; @@ -111,39 +99,35 @@ public function submitCSV(string $fileId, Request $request): JsonResponse if (!$headerRows) { $headerRows = 0; } - $dataset = $this->em->find(Dataset::class, $fileId); $data = null; $error = null; - if ($dataset) { - if ($remove) { - $error = $this->crud->deleteDataset($dataset) ? false : 'error.import.csv.codebook.delete'; - } else { - $data = $this->csvImportable->csvToArray($dataset->getStorageName(), $delimiter, $escape, $headerRows); - if ($data && key_exists('header', $data) && is_iterable($data['header']) && sizeof($data['header']) > 0) { - $varId = 1; - foreach ($data['header'] as $var) { - $this->em->persist(DatasetVariables::createNew($dataset, $varId++, $var)); - } - $this->em->flush(); - } elseif ($data && key_exists('records', $data) && is_iterable($data['records']) && sizeof($data['records']) > 0) { - $varId = 1; - foreach ($data['records'][0] as $ignored) { - $this->em->persist(DatasetVariables::createNew($dataset, $varId, "var_{$varId}")); - ++$varId; - } - $this->em->flush(); - } else { - $error = 'error.import.csv.codebook.empty'; + if ($remove) { + $error = $this->crud->deleteDataset($dataset) ? false : 'error.import.csv.codebook.delete'; + } else { + $data = $this->csvImportable->csvToArray($dataset->getStorageName(), $delimiter, $escape, $headerRows); + if ($data && key_exists('header', $data) && is_iterable($data['header']) && sizeof($data['header']) > 0) { + $varId = 1; + foreach ($data['header'] as $var) { + $this->em->persist(DatasetVariables::createNew($dataset, $varId++, $var)); } - if ($error == null && $data && key_exists('records', $data) && is_iterable($data['records']) && sizeof($data['records']) > 0) { - $this->crud->saveDatasetMatrix($data['records'], $dataset->getId()); - } else { - $error = 'error.import.csv.matrix.empty'; + $this->em->flush(); + } elseif ($data && key_exists('records', $data) && is_iterable($data['records']) && sizeof($data['records']) > 0) { + $varId = 1; + foreach ($data['records'][0] as $ignored) { + $this->em->persist(DatasetVariables::createNew($dataset, $varId, "var_{$varId}")); + ++$varId; } + $this->em->flush(); + } else { + $error = 'error.import.csv.codebook.empty'; + } + if ($error == null && $data && key_exists('records', $data) && is_iterable($data['records']) && sizeof($data['records']) > 0) { + $this->crud->saveDatasetMatrix($data['records'], $dataset->getId()); + } else { + $error = 'error.import.csv.matrix.empty'; } - } else { - $error = 'error.import.csv.dataset.empty'; } + if ($error != null && !$remove) { $this->crud->deleteDataset($dataset); } @@ -154,36 +138,34 @@ public function submitCSV(string $fileId, Request $request): JsonResponse ); } - #[Route(path: '/{uuid}/delete/dataset', name: 'delete_dataset', methods: ['POST'])] - public function deleteDataset(string $uuid): RedirectResponse + #[Route(path: '/{id}/delete/dataset', name: 'delete_dataset', methods: ['POST'])] + public function deleteDataset(Dataset $dataset): RedirectResponse { - $this->logger->debug("Enter FileManagementController::deleteMaterialAction with [UUID: {$uuid}]"); - $dataset = $this->em->find(Dataset::class, $uuid); + $this->logger->debug("Enter FileManagementController::deleteMaterialAction with [UUID: {$dataset->getId()}]"); $experimentId = $dataset->getExperiment()->getId(); $this->crud->deleteDataset($dataset); - return $this->redirectToRoute('Study-datasets', ['uuid' => $experimentId]); + return $this->redirectToRoute('Study-datasets', ['id' => $experimentId]); } - #[Route(path: '/{uuid}/delete/material', name: 'delete_material', methods: ['POST'])] - public function deleteMaterial(string $uuid): RedirectResponse + #[Route(path: '/{id}/delete/material', name: 'delete_material', methods: ['POST'])] + public function deleteMaterial(AdditionalMaterial $material): RedirectResponse { - $this->logger->debug("Enter FileManagementController::deleteMaterialAction with [UUID: {$uuid}]"); - $material = $this->em->find(AdditionalMaterial::class, $uuid); + $this->logger->debug("Enter FileManagementController::deleteMaterialAction with [UUID: {$material->getId()}]"); $experimentId = $material->getExperiment()->getId(); $this->crud->deleteMaterial($material); - return $this->redirectToRoute('Study-materials', ['uuid' => $experimentId]); + return $this->redirectToRoute('Study-materials', ['id' => $experimentId]); } - #[Route(path: '/{uuid}/update/description', name: 'update_description', methods: ['POST'])] - public function updateDescription(string $uuid, Request $request): JsonResponse + #[Route(path: '/{id}/update/description', name: 'update_description', methods: ['POST'])] + public function updateDescription(string $id, Request $request): JsonResponse { - $this->logger->debug("Enter FileManagementController::updateDescriptionAction with [UUID: {$uuid}]"); - $entity = $this->em->find(AdditionalMaterial::class, $uuid); + $this->logger->debug("Enter FileManagementController::updateDescriptionAction with [UUID: {$id}]"); + $entity = $this->em->find(AdditionalMaterial::class, $id); $success = false; if ($entity == null) { - $entity = $this->em->find(Dataset::class, $uuid); + $entity = $this->em->find(Dataset::class, $id); } if ($entity) { $description = $request->getContent(); diff --git a/src/Controller/NavigationController.php b/src/Controller/NavigationController.php index 9ecd2a7e..4065d210 100644 --- a/src/Controller/NavigationController.php +++ b/src/Controller/NavigationController.php @@ -15,10 +15,10 @@ public function __construct(private readonly EntityManagerInterface $em) {} public function sidebarNavigation(Request $request): Response { - $uuid = $request->get('uuid'); // magic string refer to the name of your slug :) + $id = $request->get('id'); // magic string refer to the name of your slug :) return $this->render('components/_navigationSidebar.html.twig', [ - 'experiment' => $this->getEntityAtChange($uuid), + 'experiment' => $this->getEntityAtChange($id), ]); } @@ -30,20 +30,20 @@ public function savebarNavigation( ?string $nextTitle, ?FormView $form ): Response { - $uuid = $request->get('uuid'); // still a magic strings + $id = $request->get('id'); // still a magic strings return $this->render('components/_navigationSavebar.html.twig', [ - 'experiment' => $this->getEntityAtChange($uuid), - 'prevUrl' => $prevUrl ? $this->generateUrl($prevUrl, ['uuid' => $uuid]) : null, + 'experiment' => $this->getEntityAtChange($id), + 'prevUrl' => $prevUrl ? $this->generateUrl($prevUrl, ['id' => $id]) : null, 'prevTitle' => $prevTitle, - 'nextUrl' => $nextUrl ? $this->generateUrl($nextUrl, ['uuid' => $uuid]) : null, + 'nextUrl' => $nextUrl ? $this->generateUrl($nextUrl, ['id' => $id]) : null, 'nextTitle' => $nextTitle, 'form' => $form, ]); } - protected function getEntityAtChange(string $uuid, string $className = Experiment::class) + protected function getEntityAtChange(string $id, string $className = Experiment::class) { - return $this->em->getRepository($className)->find($uuid); + return $this->em->getRepository($className)->find($id); } } diff --git a/src/Controller/ReviewController.php b/src/Controller/ReviewController.php index ffbcceca..6942b0d8 100644 --- a/src/Controller/ReviewController.php +++ b/src/Controller/ReviewController.php @@ -4,7 +4,6 @@ use App\Entity\Constant\UserRoles; use App\Entity\Study\Experiment; -use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -13,13 +12,9 @@ #[IsGranted('ROLE_USER')] class ReviewController extends AbstractController { - public function __construct(private readonly EntityManagerInterface $em) {} - - #[Route(path: 'review/{uuid}', name: 'Study-review', methods: ['GET'])] - public function review(string $uuid): Response + #[Route(path: 'review/{id}', name: 'Study-review', methods: ['GET'])] + public function review(Experiment $experiment): Response { - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); - if (!$this->_checkAccess($experiment)) { return $this->redirectToRoute('dashboard'); } diff --git a/src/Controller/StudyController.php b/src/Controller/StudyController.php index 9286815a..6eec2bc7 100644 --- a/src/Controller/StudyController.php +++ b/src/Controller/StudyController.php @@ -58,7 +58,7 @@ public function new(Questionnairable $questionnaire, Request $request): Response $this->em->persist($newExperiment); $this->em->flush(); - return $this->redirectToRoute('Study-introduction', ['uuid' => $newExperiment->getId()]); + return $this->redirectToRoute('Study-introduction', ['id' => $newExperiment->getId()]); } return $this->render('pages/study/new.html.twig', [ @@ -67,11 +67,10 @@ public function new(Questionnairable $questionnaire, Request $request): Response ]); } - #[Route(path: '/{uuid}/settings', name: 'settings', methods: ['GET'])] - public function settings(string $uuid, Request $request): Response + #[Route(path: '/{id}/settings', name: 'settings', methods: ['GET'])] + public function settings(Experiment $experiment, Request $request): Response { - $this->logger->debug("Enter StudyController::settingsAction with [UUID: {$uuid}]"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter StudyController::settingsAction with [UUID: {$experiment->getId()}]"); if (!$this->_checkAccess($experiment)) { return $this->redirectToRoute('dashboard'); @@ -90,11 +89,10 @@ public function settings(string $uuid, Request $request): Response ]); } - #[Route(path: '/{uuid}/documentation', name: 'documentation', methods: ['GET', 'POST'])] - public function documentation(string $uuid, Request $request): Response + #[Route(path: '/{id}/documentation', name: 'documentation', methods: ['GET', 'POST'])] + public function documentation(Experiment $experiment, Request $request): Response { - $this->logger->debug("Enter StudyController::documentationAction with [UUID: {$uuid}]"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter StudyController::documentationAction with [UUID: {$experiment->getId()}]"); if (!$this->_checkAccess($experiment)) { return $this->redirectToRoute('dashboard'); @@ -140,19 +138,18 @@ public function documentation(string $uuid, Request $request): Response $this->em->persist($formData); $this->em->flush(); - $navigationResponse = $this->handleNavigation($form, $uuid, null, 'Study-theory'); + $navigationResponse = $this->handleNavigation($form, $experiment->getId(), null, 'Study-theory'); if ($navigationResponse !== null) { return $navigationResponse; } - return $this->redirectToRoute('Study-documentation', ['uuid' => $uuid]); + return $this->redirectToRoute('Study-documentation', ['id' => $experiment->getId()]); } - #[Route(path: '/{uuid}/theory', name: 'theory', methods: ['GET', 'POST'])] - public function theory(string $uuid, Request $request): Response + #[Route(path: '/{id}/theory', name: 'theory', methods: ['GET', 'POST'])] + public function theory(Experiment $experiment, Request $request): Response { - $this->logger->debug("Enter StudyController::theoryAction with [UUID: {$uuid}]"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter StudyController::theoryAction with [UUID: {$experiment->getId()}]"); if (!$this->_checkAccess($experiment)) { return $this->redirectToRoute('dashboard'); @@ -164,7 +161,7 @@ public function theory(string $uuid, Request $request): Response $this->em->persist($experiment); $this->em->flush(); - $navigationResponse = $this->handleNavigation($form, $uuid, 'Study-documentation', 'Study-method'); + $navigationResponse = $this->handleNavigation($form, $experiment->getId(), 'Study-documentation', 'Study-method'); if ($navigationResponse !== null) { return $navigationResponse; } @@ -176,11 +173,10 @@ public function theory(string $uuid, Request $request): Response ]); } - #[Route(path: '/{uuid}/sample', name: 'sample', methods: ['GET', 'POST'])] - public function sample(string $uuid, Request $request): Response + #[Route(path: '/{id}/sample', name: 'sample', methods: ['GET', 'POST'])] + public function sample(Experiment $experiment, Request $request): Response { - $this->logger->debug("Enter StudyController::sampleAction with [UUID: {$uuid}]"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter StudyController::sampleAction with [UUID: {$experiment->getId()}]"); if (!$this->_checkAccess($experiment)) { return $this->redirectToRoute('dashboard'); @@ -199,7 +195,7 @@ public function sample(string $uuid, Request $request): Response $this->em->persist($formData); $this->em->flush(); - $navigationResponse = $this->handleNavigation($form, $uuid, 'Study-measure', null); + $navigationResponse = $this->handleNavigation($form, $experiment->getId(), 'Study-measure', null); if ($navigationResponse !== null) { return $navigationResponse; } @@ -211,11 +207,10 @@ public function sample(string $uuid, Request $request): Response ]); } - #[Route(path: '/{uuid}/measure', name: 'measure', methods: ['GET', 'POST'])] - public function measure(string $uuid, Request $request): Response + #[Route(path: '/{id}/measure', name: 'measure', methods: ['GET', 'POST'])] + public function measure(Experiment $experiment, Request $request): Response { - $this->logger->debug("Enter StudyController::measureAction with [UUID: {$uuid}]"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter StudyController::measureAction with [UUID: {$experiment->getId()}]"); if (!$this->_checkAccess($experiment)) { return $this->redirectToRoute('dashboard'); @@ -231,7 +226,7 @@ public function measure(string $uuid, Request $request): Response $this->em->persist($formData); $this->em->flush(); - $navigationResponse = $this->handleNavigation($form, $uuid, 'Study-method', 'Study-sample'); + $navigationResponse = $this->handleNavigation($form, $experiment->getId(), 'Study-method', 'Study-sample'); if ($navigationResponse !== null) { return $navigationResponse; } @@ -243,11 +238,10 @@ public function measure(string $uuid, Request $request): Response ]); } - #[Route(path: '/{uuid}/method', name: 'method', methods: ['GET', 'POST'])] - public function method(string $uuid, Request $request): Response + #[Route(path: '/{id}/method', name: 'method', methods: ['GET', 'POST'])] + public function method(Experiment $experiment, Request $request): Response { - $this->logger->debug("Enter StudyController::methodAction with [UUID: {$uuid}]"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter StudyController::methodAction with [UUID: {$experiment->getId()}]"); if (!$this->_checkAccess($experiment)) { return $this->redirectToRoute('dashboard'); @@ -259,7 +253,7 @@ public function method(string $uuid, Request $request): Response $this->em->persist($experiment); $this->em->flush(); - $navigationResponse = $this->handleNavigation($form, $uuid, 'Study-theory', 'Study-measure'); + $navigationResponse = $this->handleNavigation($form, $experiment->getId(), 'Study-theory', 'Study-measure'); if ($navigationResponse !== null) { return $navigationResponse; } @@ -271,11 +265,10 @@ public function method(string $uuid, Request $request): Response ]); } - #[Route(path: '/{uuid}/materials', name: 'materials', methods: ['GET'])] - public function materials(string $uuid): Response + #[Route(path: '/{id}/materials', name: 'materials', methods: ['GET'])] + public function materials(Experiment $experiment): Response { - $this->logger->debug("Enter StudyController::materialsAction with [UUID: {$uuid}]"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter StudyController::materialsAction with [UUID: {$experiment->getId()}]"); if (!$this->_checkAccess($experiment)) { return $this->redirectToRoute('dashboard'); @@ -286,11 +279,10 @@ public function materials(string $uuid): Response ]); } - #[Route(path: '/{uuid}/datasets', name: 'datasets', methods: ['GET'])] - public function datasets(string $uuid): Response + #[Route(path: '/{id}/datasets', name: 'datasets', methods: ['GET'])] + public function datasets(Experiment $experiment): Response { - $this->logger->debug("Enter StudyController::datasetsAction with [UUID: {$uuid}]"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter StudyController::datasetsAction with [UUID: {$experiment->getId()}]"); if (!$this->_checkAccess($experiment)) { return $this->redirectToRoute('dashboard'); @@ -301,11 +293,10 @@ public function datasets(string $uuid): Response ]); } - #[Route(path: '/{uuid}/introduction', name: 'introduction', methods: ['GET'])] - public function introduction(string $uuid): Response + #[Route(path: '/{id}/introduction', name: 'introduction', methods: ['GET'])] + public function introduction(Experiment $experiment): Response { - $this->logger->debug("Enter StudyController::introductionAction with [UUID: {$uuid}]"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter StudyController::introductionAction with [UUID: {$experiment->getId()}]"); if (!$this->_checkAccess($experiment)) { return $this->redirectToRoute('dashboard'); @@ -316,11 +307,10 @@ public function introduction(string $uuid): Response ]); } - #[Route(path: '/{uuid}/delete', name: 'delete', methods: ['GET'])] - public function delete(string $uuid): Response + #[Route(path: '/{id}/delete', name: 'delete', methods: ['GET'])] + public function delete(Experiment $experiment): Response { - $this->logger->debug("Enter StudyController::deleteAction with [UUID: {$uuid}]"); - $experiment = $this->em->getRepository(Experiment::class)->find($uuid); + $this->logger->debug("Enter StudyController::deleteAction with [UUID: {$experiment->getId()}]"); if (!$this->_checkAccess($experiment)) { return $this->redirectToRoute('dashboard'); @@ -340,7 +330,7 @@ private function _prepareEmptyArray(?array $array): array return $array; } - private function _routeButtonClicks(FormInterface $form, string $uuid): ?RedirectResponse + private function _routeButtonClicks(FormInterface $form, string $id): ?RedirectResponse { $sections = [ ['saveAndIntroduction', 'Study-introduction'], @@ -362,7 +352,7 @@ private function _routeButtonClicks(FormInterface $form, string $uuid): ?Redirec throw new \Error("Navigation button {$section[0]} is not a SubmitButton"); } if ($navigationButton->isClicked()) { - return $this->redirectToRoute($section[1], ['uuid' => $uuid]); + return $this->redirectToRoute($section[1], ['id' => $id]); } } @@ -374,7 +364,7 @@ private function _checkAccess(Experiment $experiment): bool return $this->isGranted(UserRoles::ADMINISTRATOR) || $experiment->getOwner() === $this->getUser(); } - private function handleNavigation(FormInterface $form, string $uuid, ?string $prev, ?string $next): ?RedirectResponse + private function handleNavigation(FormInterface $form, string $id, ?string $prev, ?string $next): ?RedirectResponse { if ($prev !== null) { $prevButton = $form->get('saveAndPrevious'); @@ -382,7 +372,7 @@ private function handleNavigation(FormInterface $form, string $uuid, ?string $pr throw new \Error('Cannot find "previous" navigation button'); } if ($prevButton->isClicked()) { - return $this->redirectToRoute($prev, ['uuid' => $uuid]); + return $this->redirectToRoute($prev, ['id' => $id]); } } @@ -392,11 +382,11 @@ private function handleNavigation(FormInterface $form, string $uuid, ?string $pr throw new \Error('Cannot find "next" navigation button'); } if ($nextButton->isClicked()) { - return $this->redirectToRoute($next, ['uuid' => $uuid]); + return $this->redirectToRoute($next, ['id' => $id]); } } - if ($response = $this->_routeButtonClicks($form, $uuid)) { + if ($response = $this->_routeButtonClicks($form, $id)) { return $response; } diff --git a/templates/components/_fileDisplayCard.html.twig b/templates/components/_fileDisplayCard.html.twig index bebe73ca..65be5e4b 100644 --- a/templates/components/_fileDisplayCard.html.twig +++ b/templates/components/_fileDisplayCard.html.twig @@ -9,7 +9,7 @@
{{ include('components/_deleteModal.html.twig', { 'title': "title.dataset.deleteModal.title", @@ -33,11 +33,11 @@ {{ bytesToSize(file.originalSize) }}
- {{ _self.editDescription(file, loopIndex, path('File-update_description', { 'uuid': file.id })) }} + {{ _self.editDescription(file, loopIndex, path('File-update_description', { id: file.id })) }} {% if type == 'dataset' %}
- {{ include('components/icons/table-edit.svg') }} {{ "link.edit.codebook"|trans }} diff --git a/templates/components/_navigationSidebar.html.twig b/templates/components/_navigationSidebar.html.twig index 023e4357..1e759bbb 100644 --- a/templates/components/_navigationSidebar.html.twig +++ b/templates/components/_navigationSidebar.html.twig @@ -10,7 +10,7 @@
{{ experiment.settingsMetaDataGroup.shortName }} - @@ -21,12 +21,12 @@